Open timoconnellaus opened 5 months ago
@timoconnellaus is attempting to deploy a commit to the Shopstory Team on Vercel.
A member of the Team first needs to authorize it.
Here's an example of how it can be used - in this case, I created a tree view of the components that will trigger setFocused and scroll to the selected component
I thought about it a bit, here are my suggestions.
For v1 we could start with most basic top-level components:
RootLayout
(responsible for displaying canvas, right sidebar, top bar, potentially your left sidebar etc).TopBar
I wouldn't give them any props, they can simply use editor context. In the Editor.tsx
there's an editor context set up but I don't think we should make all its properties available for modular components. I'd pick a subset and also add a couple of new ones. Here's my list of properties
focusedFields
setFocusedFields
entry // better name than form
isEditing
actions // maybe not all of them
isAdminMode // probably should be named isDebugMode
readOnly
breakpointIndex
mainBreakpointIndex
locales
locale
devices
// I'd add some new ones from `Editor.tsx
viewport
setViewport
undo // probably should go to actions
redo // probably should go to actions
close // probably should go to actions
setViewport // probably should go to actions
editorComponents: { RootLayout, TopBar } // the editor component themselves.
Thanks to this approach you could trivially:
What do you think about such approach?
This PR does 2 things:
Here is an example of using the plugin