Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor and Canvas communication with postMessage #42

Open
wants to merge 31 commits into
base: main
Choose a base branch
from

Conversation

maarten2424
Copy link
Contributor

Description

Removes editor context from Canvas element
Rewrite window.parent logic to window.postmessage on a CanvasProvider
This way the canvas can be hosted externally and it won't run into any CORS issues

Copy link

vercel bot commented Apr 22, 2024

@maarten2424 is attempting to deploy a commit to the Shopstory Team on Vercel.

A member of the Team first needs to authorize it.

@maarten2424 maarten2424 force-pushed the feat/remove-editor-context-canvas branch 5 times, most recently from 3c8dd71 to faa8b7f Compare April 30, 2024 15:36
@maarten2424 maarten2424 force-pushed the feat/remove-editor-context-canvas branch from faa8b7f to d708b88 Compare April 30, 2024 16:48
apps/page-builder-demo/src/app/DocumenWidgetInline.tsx Outdated Show resolved Hide resolved
packages/core/src/components/EasyblocksCanvasProvider.tsx Outdated Show resolved Hide resolved
packages/editor/src/CanvasRoot/CanvasRoot.tsx Outdated Show resolved Hide resolved
meta: CompilationMetadata | null;
compiled: CompiledShopstoryComponentConfig | null;
externalData: FetchOutputResources | null;
formValues: EditorContextType["form"]["values"] | null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we name it entry? It's the naming we're using right now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which one?

packages/core/src/events.ts Outdated Show resolved Hide resolved
packages/editor/src/Editor.tsx Show resolved Hide resolved
packages/editor/src/EditorChildWindow.tsx Outdated Show resolved Hide resolved
packages/editor/src/EditorIframe.tsx Outdated Show resolved Hide resolved
},
};

function useCanvasGlobalKeyboardShortcuts() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's quite a lot of duplication between this function and old useEditorGlobalKeyboardShortcuts. We should unify them a bit, otherwise it's gonna be hard to keep that stable later.

@maarten2424 maarten2424 force-pushed the feat/remove-editor-context-canvas branch from c515c38 to 4a37ec9 Compare May 8, 2024 13:44
@maarten2424 maarten2424 force-pushed the feat/remove-editor-context-canvas branch from 7a9bc0b to 170935a Compare May 15, 2024 13:48
@r00dY r00dY changed the title Feat/remove editor context canvas Editor and Canvas communication with postMessage May 29, 2024
Copy link

vercel bot commented Jun 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
easyblocks-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 5, 2024 7:40am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants