-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Layout: Add design layout focus and preview updaters #4140
Conversation
1ebfaea
to
d76d286
Compare
1b2b1b8
to
5290920
Compare
8f20f75
to
37fcb1e
Compare
5e7ce01
to
4efe679
Compare
Ping @mtias if you have a moment. |
} | ||
)( Layout ); | ||
function mapStateToProps( state ) { | ||
const { isLoading, section, hasSidebar, isFullScreen, chunkName } = state.ui; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is introducing changes that we have removed (hasSidebar, chunkName, etc).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, thanks! Those must have been left over from my old branch. I think I'll just revert this chunk anyway, since I'm not actually using it in this PR.
It will be visible whenever layoutFocus is set to `design`. DesignPreview is a wrapper for WebPreview that allows for customizations to be applied to the DOM of the preview iframe. When the `customizations` prop is set to an object, that object will be passed through a series of functions to update the iframe's contents. Those functions are defined in `client/lib/design-preview`. Each one will be passed two arguments whenever the `customizations` prop is changed: 1. The document object of the iframe. 2. The current value of `customizations`.
Add "back" link to sidebar following sites and editor convention.
4efe679
to
37acfc5
Compare
Rebased to move the undocumented endpoint to the next PR (which adds actions) and clean up the |
37acfc5
to
f6efc27
Compare
To test, hook the 'customize' button in the my-sites sidebar to activate the new layout:
Then click the button and see if the design preview and design menu become visible. The preview will not load anything because there is no markup being passed. |
Setting to in-progress as some things have changed (current active development is in #4429) |
Relies on #4136 being merged first.
To quote @mtias from #4019 where much of this code originates:
When the
design
layout is active, two panels appear and cover up the rest of the Calypso UI:DesignMenu
(as a sidebar) andDesignPreview
as a main area.DesignMenu
is currently empty but can contain design tools to update the preview.DesignPreview
is a wrapper forWebPreview
that allows for customizations to be applied to the DOM of the preview iframe.When the
customizations
prop inDesignPreview
is set to an object, that object will be passed through a series of functions called "updaters" to update the iframe's content. Those functions are defined inclient/lib/design-preview
. Each one will be passed two arguments whenever thecustomizations
prop is changed:customizations
.The
customizations
object and thepreviewMarkup
used by the preview will be stored in the Redux state tree, but that is in a separate PR (#4153).This PR does not create any design tools by default, only sets the stage for them to be created. Nor does it activate the new layout focus anywhere in Calypso yet (that's in #4156).
Also, the new layout is only available if the config feature flag
design-layout
is enabled, which is only true in development right now.