Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

Commit

Permalink
add prelim positioning and messagoing for mocksi v1 toolbar (#168)
Browse files Browse the repository at this point in the history
Co-authored-by: Kayla Fitzsimmons <[email protected]>
  • Loading branch information
fitzk and Kayla Fitzsimmons authored Sep 4, 2024
1 parent 29f4a63 commit be47500
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions apps/mocksi-lite-next/src/pages/content/mocksi-extension.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,13 @@ function getIframeStyles(message: string): Partial<CSSStyleDeclaration> {
width: "400px",
};

case "MINIMIZED":
case "DEMO_ACTIVE":
return {
display: "none",
inset: "0px 0px auto auto",
display: "block",
height: "250px",
inset: "88% 42% 0px",
width: "200px",
};

case "EDITING":
case "INIT":
case "LIST":
Expand All @@ -61,7 +62,11 @@ function getIframeStyles(message: string): Partial<CSSStyleDeclaration> {
inset: "auto 10px 10px auto",
width: "500px",
};

case "MINIMIZED":
return {
display: "none",
inset: "0px 0px auto auto",
};
default:
return {};
}
Expand All @@ -78,7 +83,7 @@ chrome.runtime.onMessage.addListener((request) => {
async function findReplaceAll(
find: string,
replace: string,
flags: string,
flags: string,
highlight: boolean,
) {
const modification: ModificationRequest = {
Expand Down Expand Up @@ -119,7 +124,7 @@ chrome.runtime.onMessage.addListener((request) => {
}
if (request.message === "NEW_EDIT") {
if (request.data) {
const { find, highlightEdits, replace, flags } = request.data;
const { find, flags, highlightEdits, replace } = request.data;
await findReplaceAll(find, replace, flags, highlightEdits);
data = Array.from(reactor.getAppliedModifications()).map(
(mod) => mod.modificationRequest,
Expand Down

0 comments on commit be47500

Please sign in to comment.