@wordpress/edit-site 6.11.0 → 6.12.1-next.082ed6819.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/components/add-new-template/utils.js +1 -2
- package/build/components/add-new-template/utils.js.map +1 -1
- package/build/components/app/index.js +0 -5
- package/build/components/app/index.js.map +1 -1
- package/build/components/block-editor/use-editor-iframe-props.js +6 -8
- package/build/components/block-editor/use-editor-iframe-props.js.map +1 -1
- package/build/components/block-editor/use-site-editor-settings.js +4 -12
- package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build/components/editor/index.js +23 -27
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor/use-editor-title.js +37 -12
- package/build/components/editor/use-editor-title.js.map +1 -1
- package/build/components/editor/use-resolve-edited-entity.js +133 -0
- package/build/components/editor/use-resolve-edited-entity.js.map +1 -0
- package/build/components/editor-canvas-container/index.js +1 -1
- package/build/components/editor-canvas-container/index.js.map +1 -1
- package/build/components/global-styles/block-preview-panel.js +8 -10
- package/build/components/global-styles/block-preview-panel.js.map +1 -1
- package/build/components/global-styles/screen-block.js +18 -5
- package/build/components/global-styles/screen-block.js.map +1 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js +24 -22
- package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build/components/global-styles/screen-style-variations.js +11 -5
- package/build/components/global-styles/screen-style-variations.js.map +1 -1
- package/build/components/global-styles/shadows-edit-panel.js +2 -3
- package/build/components/global-styles/shadows-edit-panel.js.map +1 -1
- package/build/components/global-styles/ui.js +42 -2
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles-renderer/index.js +6 -8
- package/build/components/global-styles-renderer/index.js.map +1 -1
- package/build/components/global-styles-sidebar/index.js +17 -1
- package/build/components/global-styles-sidebar/index.js.map +1 -1
- package/build/components/layout/hooks.js +1 -10
- package/build/components/layout/hooks.js.map +1 -1
- package/build/components/layout/index.js +1 -0
- package/build/components/layout/index.js.map +1 -1
- package/build/components/page-patterns/fields.js +3 -7
- package/build/components/page-patterns/fields.js.map +1 -1
- package/build/components/page-patterns/header.js +2 -2
- package/build/components/page-patterns/header.js.map +1 -1
- package/build/components/page-patterns/use-patterns.js +4 -8
- package/build/components/page-patterns/use-patterns.js.map +1 -1
- package/build/components/page-templates/fields.js +1 -2
- package/build/components/page-templates/fields.js.map +1 -1
- package/build/components/post-edit/index.js +15 -11
- package/build/components/post-edit/index.js.map +1 -1
- package/build/components/post-list/index.js +13 -3
- package/build/components/post-list/index.js.map +1 -1
- package/build/components/posts-app/index.js +3 -4
- package/build/components/posts-app/index.js.map +1 -1
- package/build/components/posts-app-routes/home.js +48 -0
- package/build/components/posts-app-routes/home.js.map +1 -0
- package/build/components/posts-app-routes/index.js +37 -0
- package/build/components/posts-app-routes/index.js.map +1 -0
- package/build/components/posts-app-routes/posts-edit.js +44 -0
- package/build/components/posts-app-routes/posts-edit.js.map +1 -0
- package/build/components/posts-app-routes/posts-list-view-quick-edit.js +63 -0
- package/build/components/posts-app-routes/posts-list-view-quick-edit.js.map +1 -0
- package/build/components/posts-app-routes/posts-list-view.js +48 -0
- package/build/components/posts-app-routes/posts-list-view.js.map +1 -0
- package/build/components/posts-app-routes/posts-view-quick-edit.js +60 -0
- package/build/components/posts-app-routes/posts-view-quick-edit.js.map +1 -0
- package/build/components/posts-app-routes/posts-view.js +41 -0
- package/build/components/posts-app-routes/posts-view.js.map +1 -0
- package/build/components/sidebar/index.js +11 -3
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-global-styles-wrapper/index.js +129 -0
- package/build/components/sidebar-global-styles-wrapper/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen-details-footer/index.js +17 -23
- package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js +18 -90
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/index.js +43 -42
- package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +2 -3
- package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
- package/build/components/site-editor-routes/index.js +1 -2
- package/build/components/site-editor-routes/index.js.map +1 -1
- package/build/components/site-editor-routes/styles-view.js +8 -2
- package/build/components/site-editor-routes/styles-view.js.map +1 -1
- package/build/components/site-hub/index.js +19 -6
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/style-book/constants.js +10 -3
- package/build/components/style-book/constants.js.map +1 -1
- package/build/components/style-book/examples.js +94 -2
- package/build/components/style-book/examples.js.map +1 -1
- package/build/components/style-book/index.js +70 -11
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/welcome-guide/index.js +4 -2
- package/build/components/welcome-guide/index.js.map +1 -1
- package/build/components/welcome-guide/page.js +1 -9
- package/build/components/welcome-guide/page.js.map +1 -1
- package/build/components/welcome-guide/template.js +1 -12
- package/build/components/welcome-guide/template.js.map +1 -1
- package/build/hooks/commands/use-common-commands.js +15 -15
- package/build/hooks/commands/use-common-commands.js.map +1 -1
- package/build/index.js +1 -9
- package/build/index.js.map +1 -1
- package/build/posts.js +1 -0
- package/build/posts.js.map +1 -1
- package/build/store/actions.js +13 -0
- package/build/store/actions.js.map +1 -1
- package/build/store/selectors.js +21 -1
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/add-new-template/utils.js +1 -2
- package/build-module/components/add-new-template/utils.js.map +1 -1
- package/build-module/components/app/index.js +0 -5
- package/build-module/components/app/index.js.map +1 -1
- package/build-module/components/block-editor/use-editor-iframe-props.js +6 -8
- package/build-module/components/block-editor/use-editor-iframe-props.js.map +1 -1
- package/build-module/components/block-editor/use-site-editor-settings.js +4 -12
- package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build-module/components/editor/index.js +23 -27
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor/use-editor-title.js +37 -12
- package/build-module/components/editor/use-editor-title.js.map +1 -1
- package/build-module/components/editor/use-resolve-edited-entity.js +125 -0
- package/build-module/components/editor/use-resolve-edited-entity.js.map +1 -0
- package/build-module/components/editor-canvas-container/index.js +1 -1
- package/build-module/components/editor-canvas-container/index.js.map +1 -1
- package/build-module/components/global-styles/block-preview-panel.js +8 -10
- package/build-module/components/global-styles/block-preview-panel.js.map +1 -1
- package/build-module/components/global-styles/screen-block.js +18 -5
- package/build-module/components/global-styles/screen-block.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +25 -23
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build-module/components/global-styles/screen-style-variations.js +11 -5
- package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
- package/build-module/components/global-styles/shadows-edit-panel.js +2 -3
- package/build-module/components/global-styles/shadows-edit-panel.js.map +1 -1
- package/build-module/components/global-styles/ui.js +42 -2
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles-renderer/index.js +6 -8
- package/build-module/components/global-styles-renderer/index.js.map +1 -1
- package/build-module/components/global-styles-sidebar/index.js +18 -2
- package/build-module/components/global-styles-sidebar/index.js.map +1 -1
- package/build-module/components/layout/hooks.js +1 -9
- package/build-module/components/layout/hooks.js.map +1 -1
- package/build-module/components/layout/index.js +1 -0
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/page-patterns/fields.js +4 -8
- package/build-module/components/page-patterns/fields.js.map +1 -1
- package/build-module/components/page-patterns/header.js +2 -2
- package/build-module/components/page-patterns/header.js.map +1 -1
- package/build-module/components/page-patterns/use-patterns.js +4 -8
- package/build-module/components/page-patterns/use-patterns.js.map +1 -1
- package/build-module/components/page-templates/fields.js +1 -2
- package/build-module/components/page-templates/fields.js.map +1 -1
- package/build-module/components/post-edit/index.js +14 -10
- package/build-module/components/post-edit/index.js.map +1 -1
- package/build-module/components/post-list/index.js +13 -3
- package/build-module/components/post-list/index.js.map +1 -1
- package/build-module/components/posts-app/index.js +3 -4
- package/build-module/components/posts-app/index.js.map +1 -1
- package/build-module/components/posts-app-routes/home.js +40 -0
- package/build-module/components/posts-app-routes/home.js.map +1 -0
- package/build-module/components/posts-app-routes/index.js +30 -0
- package/build-module/components/posts-app-routes/index.js.map +1 -0
- package/build-module/components/posts-app-routes/posts-edit.js +36 -0
- package/build-module/components/posts-app-routes/posts-edit.js.map +1 -0
- package/build-module/components/posts-app-routes/posts-list-view-quick-edit.js +55 -0
- package/build-module/components/posts-app-routes/posts-list-view-quick-edit.js.map +1 -0
- package/build-module/components/posts-app-routes/posts-list-view.js +40 -0
- package/build-module/components/posts-app-routes/posts-list-view.js.map +1 -0
- package/build-module/components/posts-app-routes/posts-view-quick-edit.js +52 -0
- package/build-module/components/posts-app-routes/posts-view-quick-edit.js.map +1 -0
- package/build-module/components/posts-app-routes/posts-view.js +33 -0
- package/build-module/components/posts-app-routes/posts-view.js.map +1 -0
- package/build-module/components/sidebar/index.js +11 -3
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-global-styles-wrapper/index.js +121 -0
- package/build-module/components/sidebar-global-styles-wrapper/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-details-footer/index.js +20 -26
- package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +19 -91
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +43 -43
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +3 -4
- package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
- package/build-module/components/site-editor-routes/index.js +1 -2
- package/build-module/components/site-editor-routes/index.js.map +1 -1
- package/build-module/components/site-editor-routes/styles-view.js +8 -2
- package/build-module/components/site-editor-routes/styles-view.js.map +1 -1
- package/build-module/components/site-hub/index.js +19 -6
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/style-book/constants.js +10 -3
- package/build-module/components/style-book/constants.js.map +1 -1
- package/build-module/components/style-book/examples.js +94 -2
- package/build-module/components/style-book/examples.js.map +1 -1
- package/build-module/components/style-book/index.js +71 -12
- package/build-module/components/style-book/index.js.map +1 -1
- package/build-module/components/welcome-guide/index.js +4 -2
- package/build-module/components/welcome-guide/index.js.map +1 -1
- package/build-module/components/welcome-guide/page.js +1 -9
- package/build-module/components/welcome-guide/page.js.map +1 -1
- package/build-module/components/welcome-guide/template.js +1 -11
- package/build-module/components/welcome-guide/template.js.map +1 -1
- package/build-module/hooks/commands/use-common-commands.js +15 -15
- package/build-module/hooks/commands/use-common-commands.js.map +1 -1
- package/build-module/index.js +2 -10
- package/build-module/index.js.map +1 -1
- package/build-module/posts.js +1 -0
- package/build-module/posts.js.map +1 -1
- package/build-module/store/actions.js +13 -0
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/selectors.js +21 -1
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/posts-rtl.css +106 -16
- package/build-style/posts.css +106 -16
- package/build-style/style-rtl.css +176 -78
- package/build-style/style.css +176 -78
- package/package.json +39 -40
- package/src/components/add-new-template/utils.js +2 -2
- package/src/components/app/index.js +0 -5
- package/src/components/block-editor/use-editor-iframe-props.js +2 -3
- package/src/components/block-editor/use-site-editor-settings.js +7 -21
- package/src/components/editor/index.js +31 -30
- package/src/components/editor/use-editor-title.js +50 -13
- package/src/components/editor/use-resolve-edited-entity.js +132 -0
- package/src/components/editor-canvas-container/index.js +1 -1
- package/src/components/editor-canvas-container/style.scss +0 -1
- package/src/components/global-styles/block-preview-panel.js +10 -10
- package/src/components/global-styles/screen-block.js +26 -8
- package/src/components/global-styles/screen-revisions/revisions-buttons.js +28 -31
- package/src/components/global-styles/screen-revisions/style.scss +11 -17
- package/src/components/global-styles/screen-style-variations.js +14 -5
- package/src/components/global-styles/shadows-edit-panel.js +4 -2
- package/src/components/global-styles/ui.js +41 -1
- package/src/components/global-styles-renderer/index.js +4 -10
- package/src/components/global-styles-sidebar/index.js +16 -2
- package/src/components/layout/hooks.js +1 -7
- package/src/components/layout/index.js +6 -1
- package/src/components/page-patterns/fields.js +6 -12
- package/src/components/page-patterns/header.js +3 -2
- package/src/components/page-patterns/style.scss +0 -5
- package/src/components/page-patterns/use-patterns.js +9 -7
- package/src/components/page-templates/fields.js +2 -3
- package/src/components/page-templates/style.scss +1 -0
- package/src/components/post-edit/index.js +37 -32
- package/src/components/post-edit/style.scss +7 -0
- package/src/components/post-list/index.js +10 -5
- package/src/components/post-list/style.scss +29 -3
- package/src/components/posts-app/index.js +3 -4
- package/src/components/posts-app-routes/home.js +36 -0
- package/src/components/posts-app-routes/index.js +36 -0
- package/src/components/posts-app-routes/posts-edit.js +31 -0
- package/src/components/posts-app-routes/posts-list-view-quick-edit.js +52 -0
- package/src/components/posts-app-routes/posts-list-view.js +40 -0
- package/src/components/posts-app-routes/posts-view-quick-edit.js +49 -0
- package/src/components/posts-app-routes/posts-view.js +35 -0
- package/src/components/sidebar/index.js +23 -7
- package/src/components/sidebar-global-styles-wrapper/index.js +150 -0
- package/src/components/sidebar-global-styles-wrapper/style.scss +35 -0
- package/src/components/sidebar-navigation-item/style.scss +2 -2
- package/src/components/sidebar-navigation-screen/style.scss +7 -2
- package/src/components/sidebar-navigation-screen-details-footer/index.js +27 -38
- package/src/components/sidebar-navigation-screen-details-footer/style.scss +0 -4
- package/src/components/sidebar-navigation-screen-global-styles/index.js +19 -103
- package/src/components/sidebar-navigation-screen-main/index.js +46 -45
- package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +8 -0
- package/src/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +1 -1
- package/src/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +4 -4
- package/src/components/site-editor-routes/README.md +2 -2
- package/src/components/site-editor-routes/index.js +0 -2
- package/src/components/site-editor-routes/styles-view.js +11 -1
- package/src/components/site-hub/index.js +33 -16
- package/src/components/site-hub/style.scss +1 -1
- package/src/components/site-icon/style.scss +16 -0
- package/src/components/style-book/constants.ts +11 -3
- package/src/components/style-book/examples.tsx +128 -2
- package/src/components/style-book/index.js +86 -8
- package/src/components/welcome-guide/index.js +3 -3
- package/src/components/welcome-guide/page.js +1 -7
- package/src/components/welcome-guide/template.js +1 -8
- package/src/hooks/commands/use-common-commands.js +253 -246
- package/src/index.js +2 -13
- package/src/posts.js +1 -0
- package/src/store/actions.js +15 -0
- package/src/store/selectors.js +24 -1
- package/src/style.scss +2 -5
- package/build/components/async/index.js +0 -51
- package/build/components/async/index.js.map +0 -1
- package/build/components/post-fields/index.js +0 -290
- package/build/components/post-fields/index.js.map +0 -1
- package/build/components/posts-app/router.js +0 -85
- package/build/components/posts-app/router.js.map +0 -1
- package/build/components/sidebar-navigation-screen-details-panel/index.js +0 -54
- package/build/components/sidebar-navigation-screen-details-panel/index.js.map +0 -1
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js +0 -21
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js.map +0 -1
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +0 -33
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +0 -1
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js +0 -21
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js.map +0 -1
- package/build/components/site-editor-routes/styles-edit.js +0 -28
- package/build/components/site-editor-routes/styles-edit.js.map +0 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +0 -219
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +0 -1
- package/build/components/use-edited-entity-record/index.js +0 -60
- package/build/components/use-edited-entity-record/index.js.map +0 -1
- package/build/hooks/commands/use-edit-mode-commands.js +0 -179
- package/build/hooks/commands/use-edit-mode-commands.js.map +0 -1
- package/build-module/components/async/index.js +0 -44
- package/build-module/components/async/index.js.map +0 -1
- package/build-module/components/post-fields/index.js +0 -283
- package/build-module/components/post-fields/index.js.map +0 -1
- package/build-module/components/posts-app/router.js +0 -77
- package/build-module/components/posts-app/router.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-details-panel/index.js +0 -29
- package/build-module/components/sidebar-navigation-screen-details-panel/index.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js +0 -14
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +0 -25
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js +0 -14
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js.map +0 -1
- package/build-module/components/site-editor-routes/styles-edit.js +0 -20
- package/build-module/components/site-editor-routes/styles-edit.js.map +0 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +0 -212
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +0 -1
- package/build-module/components/use-edited-entity-record/index.js +0 -53
- package/build-module/components/use-edited-entity-record/index.js.map +0 -1
- package/build-module/hooks/commands/use-edit-mode-commands.js +0 -171
- package/build-module/hooks/commands/use-edit-mode-commands.js.map +0 -1
- package/src/components/async/index.js +0 -43
- package/src/components/post-fields/index.js +0 -361
- package/src/components/post-fields/style.scss +0 -3
- package/src/components/posts-app/router.js +0 -69
- package/src/components/sidebar-navigation-screen-details-panel/index.js +0 -40
- package/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js +0 -14
- package/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +0 -31
- package/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js +0 -14
- package/src/components/sidebar-navigation-screen-details-panel/style.scss +0 -26
- package/src/components/site-editor-routes/styles-edit.js +0 -17
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +0 -267
- package/src/components/use-edited-entity-record/index.js +0 -58
- package/src/hooks/commands/use-edit-mode-commands.js +0 -168
- package/src/store/test/actions.js +0 -83
- package/src/store/test/reducer.js +0 -69
- package/src/store/test/selectors.js +0 -41
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = GlobalStylesUIWrapper;
|
|
8
|
+
var _i18n = require("@wordpress/i18n");
|
|
9
|
+
var _element = require("@wordpress/element");
|
|
10
|
+
var _router = require("@wordpress/router");
|
|
11
|
+
var _compose = require("@wordpress/compose");
|
|
12
|
+
var _components = require("@wordpress/components");
|
|
13
|
+
var _ui = _interopRequireDefault(require("../global-styles/ui"));
|
|
14
|
+
var _page = _interopRequireDefault(require("../page"));
|
|
15
|
+
var _lockUnlock = require("../../lock-unlock");
|
|
16
|
+
var _styleBook = _interopRequireDefault(require("../style-book"));
|
|
17
|
+
var _constants = require("../style-book/constants");
|
|
18
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
+
/**
|
|
20
|
+
* WordPress dependencies
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Internal dependencies
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
const {
|
|
28
|
+
useLocation,
|
|
29
|
+
useHistory
|
|
30
|
+
} = (0, _lockUnlock.unlock)(_router.privateApis);
|
|
31
|
+
const {
|
|
32
|
+
Menu
|
|
33
|
+
} = (0, _lockUnlock.unlock)(_components.privateApis);
|
|
34
|
+
const GLOBAL_STYLES_PATH_PREFIX = '/wp_global_styles';
|
|
35
|
+
const GlobalStylesPageActions = ({
|
|
36
|
+
isStyleBookOpened,
|
|
37
|
+
setIsStyleBookOpened
|
|
38
|
+
}) => {
|
|
39
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Menu, {
|
|
40
|
+
trigger: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
41
|
+
__next40pxDefaultSize: true,
|
|
42
|
+
variant: "tertiary",
|
|
43
|
+
size: "compact",
|
|
44
|
+
children: (0, _i18n.__)('Preview')
|
|
45
|
+
}),
|
|
46
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(Menu.RadioItem, {
|
|
47
|
+
value: true,
|
|
48
|
+
checked: isStyleBookOpened,
|
|
49
|
+
name: "styles-preview-actions",
|
|
50
|
+
onChange: () => setIsStyleBookOpened(true),
|
|
51
|
+
defaultChecked: true,
|
|
52
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Menu.ItemLabel, {
|
|
53
|
+
children: (0, _i18n.__)('Style book')
|
|
54
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(Menu.ItemHelpText, {
|
|
55
|
+
children: (0, _i18n.__)('Preview blocks and styles.')
|
|
56
|
+
})]
|
|
57
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(Menu.RadioItem, {
|
|
58
|
+
value: false,
|
|
59
|
+
checked: !isStyleBookOpened,
|
|
60
|
+
name: "styles-preview-actions",
|
|
61
|
+
onChange: () => setIsStyleBookOpened(false),
|
|
62
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Menu.ItemLabel, {
|
|
63
|
+
children: (0, _i18n.__)('Site')
|
|
64
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(Menu.ItemHelpText, {
|
|
65
|
+
children: (0, _i18n.__)('Preview your site.')
|
|
66
|
+
})]
|
|
67
|
+
})]
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
function GlobalStylesUIWrapper() {
|
|
71
|
+
const {
|
|
72
|
+
params
|
|
73
|
+
} = useLocation();
|
|
74
|
+
const history = useHistory();
|
|
75
|
+
const {
|
|
76
|
+
canvas = 'view'
|
|
77
|
+
} = params;
|
|
78
|
+
const [isStyleBookOpened, setIsStyleBookOpened] = (0, _element.useState)(false);
|
|
79
|
+
const isMobileViewport = (0, _compose.useViewportMatch)('medium', '<');
|
|
80
|
+
const pathWithPrefix = params.path;
|
|
81
|
+
const [path, onPathChange] = (0, _element.useMemo)(() => {
|
|
82
|
+
const processedPath = pathWithPrefix.substring(GLOBAL_STYLES_PATH_PREFIX.length);
|
|
83
|
+
return [processedPath ? processedPath : '/', newPath => {
|
|
84
|
+
history.push({
|
|
85
|
+
path: !newPath || newPath === '/' ? GLOBAL_STYLES_PATH_PREFIX : `${GLOBAL_STYLES_PATH_PREFIX}${newPath}`
|
|
86
|
+
});
|
|
87
|
+
}];
|
|
88
|
+
}, [pathWithPrefix, history]);
|
|
89
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
90
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_page.default, {
|
|
91
|
+
actions: !isMobileViewport ? /*#__PURE__*/(0, _jsxRuntime.jsx)(GlobalStylesPageActions, {
|
|
92
|
+
isStyleBookOpened: isStyleBookOpened,
|
|
93
|
+
setIsStyleBookOpened: setIsStyleBookOpened
|
|
94
|
+
}) : null,
|
|
95
|
+
className: "edit-site-styles",
|
|
96
|
+
title: (0, _i18n.__)('Styles'),
|
|
97
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ui.default, {
|
|
98
|
+
path: path,
|
|
99
|
+
onPathChange: onPathChange
|
|
100
|
+
})
|
|
101
|
+
}), canvas === 'view' && isStyleBookOpened && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styleBook.default, {
|
|
102
|
+
enableResizing: false,
|
|
103
|
+
showCloseButton: false,
|
|
104
|
+
showTabs: false,
|
|
105
|
+
isSelected: blockName =>
|
|
106
|
+
// Match '/blocks/core%2Fbutton' and
|
|
107
|
+
// '/blocks/core%2Fbutton/typography', but not
|
|
108
|
+
// '/blocks/core%2Fbuttons'.
|
|
109
|
+
path === `/wp_global_styles/blocks/${encodeURIComponent(blockName)}` || path.startsWith(`/wp_global_styles/blocks/${encodeURIComponent(blockName)}/`),
|
|
110
|
+
path: path,
|
|
111
|
+
onSelect: blockName => {
|
|
112
|
+
if (_constants.STYLE_BOOK_COLOR_GROUPS.find(group => group.slug === blockName)) {
|
|
113
|
+
// Go to color palettes Global Styles.
|
|
114
|
+
onPathChange('/colors/palette');
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
if (blockName === 'typography') {
|
|
118
|
+
// Go to typography Global Styles.
|
|
119
|
+
onPathChange('/typography');
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Now go to the selected block.
|
|
124
|
+
onPathChange(`/blocks/${encodeURIComponent(blockName)}`);
|
|
125
|
+
}
|
|
126
|
+
})]
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_i18n","require","_element","_router","_compose","_components","_ui","_interopRequireDefault","_page","_lockUnlock","_styleBook","_constants","_jsxRuntime","useLocation","useHistory","unlock","routerPrivateApis","Menu","componentsPrivateApis","GLOBAL_STYLES_PATH_PREFIX","GlobalStylesPageActions","isStyleBookOpened","setIsStyleBookOpened","jsxs","trigger","jsx","Button","__next40pxDefaultSize","variant","size","children","__","RadioItem","value","checked","name","onChange","defaultChecked","ItemLabel","ItemHelpText","GlobalStylesUIWrapper","params","history","canvas","useState","isMobileViewport","useViewportMatch","pathWithPrefix","path","onPathChange","useMemo","processedPath","substring","length","newPath","push","Fragment","default","actions","className","title","enableResizing","showCloseButton","showTabs","isSelected","blockName","encodeURIComponent","startsWith","onSelect","STYLE_BOOK_COLOR_GROUPS","find","group","slug"],"sources":["@wordpress/edit-site/src/components/sidebar-global-styles-wrapper/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useMemo, useState } from '@wordpress/element';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useViewportMatch } from '@wordpress/compose';\nimport {\n\tButton,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport GlobalStylesUI from '../global-styles/ui';\nimport Page from '../page';\nimport { unlock } from '../../lock-unlock';\nimport StyleBook from '../style-book';\nimport { STYLE_BOOK_COLOR_GROUPS } from '../style-book/constants';\n\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\nconst { Menu } = unlock( componentsPrivateApis );\nconst GLOBAL_STYLES_PATH_PREFIX = '/wp_global_styles';\n\nconst GlobalStylesPageActions = ( {\n\tisStyleBookOpened,\n\tsetIsStyleBookOpened,\n} ) => {\n\treturn (\n\t\t<Menu\n\t\t\ttrigger={\n\t\t\t\t<Button __next40pxDefaultSize variant=\"tertiary\" size=\"compact\">\n\t\t\t\t\t{ __( 'Preview' ) }\n\t\t\t\t</Button>\n\t\t\t}\n\t\t>\n\t\t\t<Menu.RadioItem\n\t\t\t\tvalue\n\t\t\t\tchecked={ isStyleBookOpened }\n\t\t\t\tname=\"styles-preview-actions\"\n\t\t\t\tonChange={ () => setIsStyleBookOpened( true ) }\n\t\t\t\tdefaultChecked\n\t\t\t>\n\t\t\t\t<Menu.ItemLabel>{ __( 'Style book' ) }</Menu.ItemLabel>\n\t\t\t\t<Menu.ItemHelpText>\n\t\t\t\t\t{ __( 'Preview blocks and styles.' ) }\n\t\t\t\t</Menu.ItemHelpText>\n\t\t\t</Menu.RadioItem>\n\t\t\t<Menu.RadioItem\n\t\t\t\tvalue={ false }\n\t\t\t\tchecked={ ! isStyleBookOpened }\n\t\t\t\tname=\"styles-preview-actions\"\n\t\t\t\tonChange={ () => setIsStyleBookOpened( false ) }\n\t\t\t>\n\t\t\t\t<Menu.ItemLabel>{ __( 'Site' ) }</Menu.ItemLabel>\n\t\t\t\t<Menu.ItemHelpText>\n\t\t\t\t\t{ __( 'Preview your site.' ) }\n\t\t\t\t</Menu.ItemHelpText>\n\t\t\t</Menu.RadioItem>\n\t\t</Menu>\n\t);\n};\n\nexport default function GlobalStylesUIWrapper() {\n\tconst { params } = useLocation();\n\tconst history = useHistory();\n\tconst { canvas = 'view' } = params;\n\tconst [ isStyleBookOpened, setIsStyleBookOpened ] = useState( false );\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst pathWithPrefix = params.path;\n\tconst [ path, onPathChange ] = useMemo( () => {\n\t\tconst processedPath = pathWithPrefix.substring(\n\t\t\tGLOBAL_STYLES_PATH_PREFIX.length\n\t\t);\n\t\treturn [\n\t\t\tprocessedPath ? processedPath : '/',\n\t\t\t( newPath ) => {\n\t\t\t\thistory.push( {\n\t\t\t\t\tpath:\n\t\t\t\t\t\t! newPath || newPath === '/'\n\t\t\t\t\t\t\t? GLOBAL_STYLES_PATH_PREFIX\n\t\t\t\t\t\t\t: `${ GLOBAL_STYLES_PATH_PREFIX }${ newPath }`,\n\t\t\t\t} );\n\t\t\t},\n\t\t];\n\t}, [ pathWithPrefix, history ] );\n\n\treturn (\n\t\t<>\n\t\t\t<Page\n\t\t\t\tactions={\n\t\t\t\t\t! isMobileViewport ? (\n\t\t\t\t\t\t<GlobalStylesPageActions\n\t\t\t\t\t\t\tisStyleBookOpened={ isStyleBookOpened }\n\t\t\t\t\t\t\tsetIsStyleBookOpened={ setIsStyleBookOpened }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : null\n\t\t\t\t}\n\t\t\t\tclassName=\"edit-site-styles\"\n\t\t\t\ttitle={ __( 'Styles' ) }\n\t\t\t>\n\t\t\t\t<GlobalStylesUI path={ path } onPathChange={ onPathChange } />\n\t\t\t</Page>\n\t\t\t{ canvas === 'view' && isStyleBookOpened && (\n\t\t\t\t<StyleBook\n\t\t\t\t\tenableResizing={ false }\n\t\t\t\t\tshowCloseButton={ false }\n\t\t\t\t\tshowTabs={ false }\n\t\t\t\t\tisSelected={ ( blockName ) =>\n\t\t\t\t\t\t// Match '/blocks/core%2Fbutton' and\n\t\t\t\t\t\t// '/blocks/core%2Fbutton/typography', but not\n\t\t\t\t\t\t// '/blocks/core%2Fbuttons'.\n\t\t\t\t\t\tpath ===\n\t\t\t\t\t\t\t`/wp_global_styles/blocks/${ encodeURIComponent(\n\t\t\t\t\t\t\t\tblockName\n\t\t\t\t\t\t\t) }` ||\n\t\t\t\t\t\tpath.startsWith(\n\t\t\t\t\t\t\t`/wp_global_styles/blocks/${ encodeURIComponent(\n\t\t\t\t\t\t\t\tblockName\n\t\t\t\t\t\t\t) }/`\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t\tpath={ path }\n\t\t\t\t\tonSelect={ ( blockName ) => {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tSTYLE_BOOK_COLOR_GROUPS.find(\n\t\t\t\t\t\t\t\t( group ) => group.slug === blockName\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// Go to color palettes Global Styles.\n\t\t\t\t\t\t\tonPathChange( '/colors/palette' );\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( blockName === 'typography' ) {\n\t\t\t\t\t\t\t// Go to typography Global Styles.\n\t\t\t\t\t\t\tonPathChange( '/typography' );\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\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AAe,EAAG,KAAO;MACzBC,QAAQ,EAAG,KAAO;MAClBC,UAAU,EAAKC,SAAS;MACvB;MACA;MACA;MACAjB,IAAI,KACH,4BAA6BkB,kBAAkB,CAC9CD,SACD,CAAC,EAAG,IACLjB,IAAI,CAACmB,UAAU,CACd,4BAA6BD,kBAAkB,CAC9CD,SACD,CAAC,GACF,CACA;MACDjB,IAAI,EAAGA,IAAM;MACboB,QAAQ,EAAKH,SAAS,IAAM;QAC3B,IACCI,kCAAuB,CAACC,IAAI,CACzBC,KAAK,IAAMA,KAAK,CAACC,IAAI,KAAKP,SAC7B,CAAC,EACA;UACD;UACAhB,YAAY,CAAE,iBAAkB,CAAC;UACjC;QACD;QACA,IAAKgB,SAAS,KAAK,YAAY,EAAG;UACjC;UACAhB,YAAY,CAAE,aAAc,CAAC;UAC7B;QACD;;QAEA;QACAA,YAAY,CACX,WAAYiB,kBAAkB,CAAED,SAAU,CAAC,EAC5C,CAAC;MACF;IAAG,CACH,CACD;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
|
|
@@ -6,12 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = SidebarNavigationScreenDetailsFooter;
|
|
8
8
|
var _i18n = require("@wordpress/i18n");
|
|
9
|
-
var _date = require("@wordpress/date");
|
|
10
|
-
var _element = require("@wordpress/element");
|
|
11
9
|
var _url = require("@wordpress/url");
|
|
12
10
|
var _components = require("@wordpress/components");
|
|
13
11
|
var _icons = require("@wordpress/icons");
|
|
14
|
-
var _sidebarNavigationScreenDetailsPanel = require("../sidebar-navigation-screen-details-panel");
|
|
15
12
|
var _sidebarNavigationItem = _interopRequireDefault(require("../sidebar-navigation-item"));
|
|
16
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
14
|
/**
|
|
@@ -24,9 +21,10 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
24
21
|
|
|
25
22
|
function SidebarNavigationScreenDetailsFooter({
|
|
26
23
|
record,
|
|
24
|
+
revisionsCount,
|
|
27
25
|
...otherProps
|
|
28
26
|
}) {
|
|
29
|
-
var _record$_links$predec
|
|
27
|
+
var _record$_links$predec;
|
|
30
28
|
/*
|
|
31
29
|
* There might be other items in the future,
|
|
32
30
|
* but for now it's just modified date.
|
|
@@ -35,8 +33,17 @@ function SidebarNavigationScreenDetailsFooter({
|
|
|
35
33
|
*/
|
|
36
34
|
const hrefProps = {};
|
|
37
35
|
const lastRevisionId = (_record$_links$predec = record?._links?.['predecessor-version']?.[0]?.id) !== null && _record$_links$predec !== void 0 ? _record$_links$predec : null;
|
|
38
|
-
|
|
39
|
-
//
|
|
36
|
+
|
|
37
|
+
// Use incoming prop first, then the record's version history, if available.
|
|
38
|
+
revisionsCount = revisionsCount || record?._links?.['version-history']?.[0]?.count || 0;
|
|
39
|
+
|
|
40
|
+
/*
|
|
41
|
+
* Enable the revisions link if there is a last revision and there is more than one revision.
|
|
42
|
+
* This link is used for theme assets, e.g., templates, which have no database record until they're edited.
|
|
43
|
+
* For these files there's only a "revision" after they're edited twice,
|
|
44
|
+
* which means the revision.php page won't display a proper diff.
|
|
45
|
+
* See: https://github.com/WordPress/gutenberg/issues/49164.
|
|
46
|
+
*/
|
|
40
47
|
if (lastRevisionId && revisionsCount > 1) {
|
|
41
48
|
hrefProps.href = (0, _url.addQueryArgs)('revision.php', {
|
|
42
49
|
revision: record?._links['predecessor-version'][0].id
|
|
@@ -44,27 +51,14 @@ function SidebarNavigationScreenDetailsFooter({
|
|
|
44
51
|
hrefProps.as = 'a';
|
|
45
52
|
}
|
|
46
53
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalItemGroup, {
|
|
54
|
+
size: "large",
|
|
47
55
|
className: "edit-site-sidebar-navigation-screen-details-footer",
|
|
48
56
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
|
|
49
|
-
|
|
57
|
+
icon: _icons.backup,
|
|
50
58
|
...hrefProps,
|
|
51
59
|
...otherProps,
|
|
52
|
-
children:
|
|
53
|
-
|
|
54
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreenDetailsPanel.SidebarNavigationScreenDetailsPanelLabel, {
|
|
55
|
-
children: (0, _i18n.__)('Last modified')
|
|
56
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreenDetailsPanel.SidebarNavigationScreenDetailsPanelValue, {
|
|
57
|
-
children: (0, _element.createInterpolateElement)((0, _i18n.sprintf)(/* translators: %s: is the relative time when the post was last modified. */
|
|
58
|
-
(0, _i18n.__)('<time>%s</time>'), (0, _date.humanTimeDiff)(record.modified)), {
|
|
59
|
-
time: /*#__PURE__*/(0, _jsxRuntime.jsx)("time", {
|
|
60
|
-
dateTime: record.modified
|
|
61
|
-
})
|
|
62
|
-
})
|
|
63
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Icon, {
|
|
64
|
-
className: "edit-site-sidebar-navigation-screen-details-footer__icon",
|
|
65
|
-
icon: _icons.backup
|
|
66
|
-
})]
|
|
67
|
-
})
|
|
60
|
+
children: (0, _i18n.sprintf)(/* translators: %d: Number of Styles revisions. */
|
|
61
|
+
(0, _i18n._n)('%d Revision', '%d Revisions', revisionsCount), revisionsCount)
|
|
68
62
|
})
|
|
69
63
|
});
|
|
70
64
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","
|
|
1
|
+
{"version":3,"names":["_i18n","require","_url","_components","_icons","_sidebarNavigationItem","_interopRequireDefault","_jsxRuntime","SidebarNavigationScreenDetailsFooter","record","revisionsCount","otherProps","_record$_links$predec","hrefProps","lastRevisionId","_links","id","count","href","addQueryArgs","revision","as","jsx","__experimentalItemGroup","size","className","children","default","icon","backup","sprintf","_n"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-details-footer/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { _n, sprintf } from '@wordpress/i18n';\nimport { addQueryArgs } from '@wordpress/url';\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\nimport { backup } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationItem from '../sidebar-navigation-item';\n\nexport default function SidebarNavigationScreenDetailsFooter( {\n\trecord,\n\trevisionsCount,\n\t...otherProps\n} ) {\n\t/*\n\t * There might be other items in the future,\n\t * but for now it's just modified date.\n\t * Later we might render a list of items and isolate\n\t * the following logic.\n\t */\n\tconst hrefProps = {};\n\tconst lastRevisionId =\n\t\trecord?._links?.[ 'predecessor-version' ]?.[ 0 ]?.id ?? null;\n\n\t// Use incoming prop first, then the record's version history, if available.\n\trevisionsCount =\n\t\trevisionsCount ||\n\t\trecord?._links?.[ 'version-history' ]?.[ 0 ]?.count ||\n\t\t0;\n\n\t/*\n\t * Enable the revisions link if there is a last revision and there is more than one revision.\n\t * This link is used for theme assets, e.g., templates, which have no database record until they're edited.\n\t * For these files there's only a \"revision\" after they're edited twice,\n\t * which means the revision.php page won't display a proper diff.\n\t * See: https://github.com/WordPress/gutenberg/issues/49164.\n\t */\n\tif ( lastRevisionId && revisionsCount > 1 ) {\n\t\threfProps.href = addQueryArgs( 'revision.php', {\n\t\t\trevision: record?._links[ 'predecessor-version' ][ 0 ].id,\n\t\t} );\n\t\threfProps.as = 'a';\n\t}\n\treturn (\n\t\t<ItemGroup\n\t\t\tsize=\"large\"\n\t\t\tclassName=\"edit-site-sidebar-navigation-screen-details-footer\"\n\t\t>\n\t\t\t<SidebarNavigationItem\n\t\t\t\ticon={ backup }\n\t\t\t\t{ ...hrefProps }\n\t\t\t\t{ ...otherProps }\n\t\t\t>\n\t\t\t\t{ sprintf(\n\t\t\t\t\t/* translators: %d: Number of Styles revisions. */\n\t\t\t\t\t_n( '%d Revision', '%d Revisions', revisionsCount ),\n\t\t\t\t\trevisionsCount\n\t\t\t\t) }\n\t\t\t</SidebarNavigationItem>\n\t\t</ItemGroup>\n\t);\n}\n"],"mappings":";;;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S;MAAA,GACTF,UAAU;MAAAe,QAAA,EAEb,IAAAI,aAAO,EACR;MACA,IAAAC,QAAE,EAAE,aAAa,EAAE,cAAc,EAAErB,cAAe,CAAC,EACnDA,cACD;IAAC,CACqB;EAAC,CACd,CAAC;AAEd","ignoreList":[]}
|
|
@@ -7,23 +7,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.SidebarNavigationItemGlobalStyles = SidebarNavigationItemGlobalStyles;
|
|
8
8
|
exports.default = SidebarNavigationScreenGlobalStyles;
|
|
9
9
|
var _i18n = require("@wordpress/i18n");
|
|
10
|
-
var _icons = require("@wordpress/icons");
|
|
11
10
|
var _data = require("@wordpress/data");
|
|
12
11
|
var _coreData = require("@wordpress/core-data");
|
|
13
|
-
var _compose = require("@wordpress/compose");
|
|
14
12
|
var _element = require("@wordpress/element");
|
|
15
|
-
var _editor = require("@wordpress/editor");
|
|
16
13
|
var _preferences = require("@wordpress/preferences");
|
|
17
14
|
var _router = require("@wordpress/router");
|
|
18
15
|
var _sidebarNavigationScreen = _interopRequireDefault(require("../sidebar-navigation-screen"));
|
|
19
16
|
var _lockUnlock = require("../../lock-unlock");
|
|
20
17
|
var _store = require("../../store");
|
|
21
|
-
var _sidebarButton = _interopRequireDefault(require("../sidebar-button"));
|
|
22
18
|
var _sidebarNavigationItem = _interopRequireDefault(require("../sidebar-navigation-item"));
|
|
23
|
-
var _styleBook = _interopRequireDefault(require("../style-book"));
|
|
24
19
|
var _useGlobalStylesRevisions = _interopRequireDefault(require("../global-styles/screen-revisions/use-global-styles-revisions"));
|
|
25
20
|
var _sidebarNavigationScreenDetailsFooter = _interopRequireDefault(require("../sidebar-navigation-screen-details-footer"));
|
|
26
|
-
var
|
|
21
|
+
var _sidebarNavigationScreenMain = require("../sidebar-navigation-screen-main");
|
|
27
22
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
28
23
|
/**
|
|
29
24
|
* WordPress dependencies
|
|
@@ -38,10 +33,6 @@ const {
|
|
|
38
33
|
useHistory
|
|
39
34
|
} = (0, _lockUnlock.unlock)(_router.privateApis);
|
|
40
35
|
function SidebarNavigationItemGlobalStyles(props) {
|
|
41
|
-
const {
|
|
42
|
-
openGeneralSidebar
|
|
43
|
-
} = (0, _data.useDispatch)(_store.store);
|
|
44
|
-
const history = useHistory();
|
|
45
36
|
const {
|
|
46
37
|
params
|
|
47
38
|
} = useLocation();
|
|
@@ -52,67 +43,30 @@ function SidebarNavigationItemGlobalStyles(props) {
|
|
|
52
43
|
params: {
|
|
53
44
|
path: '/wp_global_styles'
|
|
54
45
|
},
|
|
55
|
-
uid: "global-styles-navigation-item"
|
|
46
|
+
uid: "global-styles-navigation-item",
|
|
47
|
+
"aria-current": params.path && params.path.startsWith('/wp_global_styles')
|
|
56
48
|
});
|
|
57
49
|
}
|
|
58
50
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
|
|
59
|
-
...props
|
|
60
|
-
onClick: () => {
|
|
61
|
-
// Switch to edit mode.
|
|
62
|
-
history.push({
|
|
63
|
-
...params,
|
|
64
|
-
canvas: 'edit'
|
|
65
|
-
}, undefined, {
|
|
66
|
-
transition: 'canvas-mode-edit-transition'
|
|
67
|
-
});
|
|
68
|
-
// Open global styles sidebar.
|
|
69
|
-
openGeneralSidebar('edit-site/global-styles');
|
|
70
|
-
}
|
|
51
|
+
...props
|
|
71
52
|
});
|
|
72
53
|
}
|
|
73
|
-
function SidebarNavigationScreenGlobalStyles({
|
|
74
|
-
backPath
|
|
75
|
-
}) {
|
|
54
|
+
function SidebarNavigationScreenGlobalStyles() {
|
|
76
55
|
const history = useHistory();
|
|
77
56
|
const {
|
|
78
57
|
params
|
|
79
58
|
} = useLocation();
|
|
80
|
-
const {
|
|
81
|
-
canvas = 'view'
|
|
82
|
-
} = params;
|
|
83
59
|
const {
|
|
84
60
|
revisions,
|
|
85
|
-
isLoading: isLoadingRevisions
|
|
61
|
+
isLoading: isLoadingRevisions,
|
|
62
|
+
revisionsCount
|
|
86
63
|
} = (0, _useGlobalStylesRevisions.default)();
|
|
87
64
|
const {
|
|
88
65
|
openGeneralSidebar
|
|
89
66
|
} = (0, _data.useDispatch)(_store.store);
|
|
90
|
-
const {
|
|
91
|
-
setIsListViewOpened
|
|
92
|
-
} = (0, _data.useDispatch)(_editor.store);
|
|
93
|
-
const isMobileViewport = (0, _compose.useViewportMatch)('medium', '<');
|
|
94
67
|
const {
|
|
95
68
|
setEditorCanvasContainerView
|
|
96
69
|
} = (0, _lockUnlock.unlock)((0, _data.useDispatch)(_store.store));
|
|
97
|
-
const {
|
|
98
|
-
isStyleBookOpened,
|
|
99
|
-
revisionsCount
|
|
100
|
-
} = (0, _data.useSelect)(select => {
|
|
101
|
-
var _globalStyles$_links$;
|
|
102
|
-
const {
|
|
103
|
-
getEditorCanvasContainerView
|
|
104
|
-
} = (0, _lockUnlock.unlock)(select(_store.store));
|
|
105
|
-
const {
|
|
106
|
-
getEntityRecord,
|
|
107
|
-
__experimentalGetCurrentGlobalStylesId
|
|
108
|
-
} = select(_coreData.store);
|
|
109
|
-
const globalStylesId = __experimentalGetCurrentGlobalStylesId();
|
|
110
|
-
const globalStyles = globalStylesId ? getEntityRecord('root', 'globalStyles', globalStylesId) : undefined;
|
|
111
|
-
return {
|
|
112
|
-
isStyleBookOpened: 'style-book' === getEditorCanvasContainerView(),
|
|
113
|
-
revisionsCount: (_globalStyles$_links$ = globalStyles?._links?.['version-history']?.[0]?.count) !== null && _globalStyles$_links$ !== void 0 ? _globalStyles$_links$ : 0
|
|
114
|
-
};
|
|
115
|
-
}, []);
|
|
116
70
|
const {
|
|
117
71
|
set: setPreference
|
|
118
72
|
} = (0, _data.useDispatch)(_preferences.store);
|
|
@@ -125,14 +79,6 @@ function SidebarNavigationScreenGlobalStyles({
|
|
|
125
79
|
});
|
|
126
80
|
return Promise.all([setPreference('core', 'distractionFree', false), openGeneralSidebar('edit-site/global-styles')]);
|
|
127
81
|
}, [history, params, openGeneralSidebar, setPreference]);
|
|
128
|
-
const openStyleBook = (0, _element.useCallback)(async () => {
|
|
129
|
-
await openGlobalStyles();
|
|
130
|
-
// Open the Style Book once the canvas mode is set to edit,
|
|
131
|
-
// and the global styles sidebar is open. This ensures that
|
|
132
|
-
// the Style Book is not prematurely closed.
|
|
133
|
-
setEditorCanvasContainerView('style-book');
|
|
134
|
-
setIsListViewOpened(false);
|
|
135
|
-
}, [openGlobalStyles, setEditorCanvasContainerView, setIsListViewOpened]);
|
|
136
82
|
const openRevisions = (0, _element.useCallback)(async () => {
|
|
137
83
|
await openGlobalStyles();
|
|
138
84
|
// Open the global styles revisions once the canvas mode is set to edit,
|
|
@@ -143,39 +89,21 @@ function SidebarNavigationScreenGlobalStyles({
|
|
|
143
89
|
}, [openGlobalStyles, setEditorCanvasContainerView]);
|
|
144
90
|
|
|
145
91
|
// If there are no revisions, do not render a footer.
|
|
146
|
-
const
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
92
|
+
const shouldShowGlobalStylesFooter = !!revisionsCount && !isLoadingRevisions;
|
|
93
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
94
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreen.default, {
|
|
95
|
+
title: (0, _i18n.__)('Design'),
|
|
96
|
+
isRoot: true,
|
|
97
|
+
description: (0, _i18n.__)('Customize the appearance of your website using the block editor.'),
|
|
98
|
+
content: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreenMain.MainSidebarNavigationContent, {
|
|
99
|
+
activeItem: "styles-navigation-item"
|
|
100
|
+
}),
|
|
155
101
|
footer: shouldShowGlobalStylesFooter && /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreenDetailsFooter.default, {
|
|
156
102
|
record: revisions?.[0],
|
|
103
|
+
revisionsCount: revisionsCount,
|
|
157
104
|
onClick: openRevisions
|
|
158
|
-
}),
|
|
159
|
-
actions: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
160
|
-
children: [!isMobileViewport && /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarButton.default, {
|
|
161
|
-
icon: _icons.seen,
|
|
162
|
-
label: (0, _i18n.__)('Style Book'),
|
|
163
|
-
onClick: () => setEditorCanvasContainerView(!isStyleBookOpened ? 'style-book' : undefined),
|
|
164
|
-
isPressed: isStyleBookOpened
|
|
165
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarButton.default, {
|
|
166
|
-
icon: _icons.edit,
|
|
167
|
-
label: (0, _i18n.__)('Edit styles'),
|
|
168
|
-
onClick: async () => await openGlobalStyles()
|
|
169
|
-
})]
|
|
170
105
|
})
|
|
171
|
-
})
|
|
172
|
-
enableResizing: false,
|
|
173
|
-
isSelected: () => false,
|
|
174
|
-
onClick: openStyleBook,
|
|
175
|
-
onSelect: openStyleBook,
|
|
176
|
-
showCloseButton: false,
|
|
177
|
-
showTabs: false
|
|
178
|
-
})]
|
|
106
|
+
})
|
|
179
107
|
});
|
|
180
108
|
}
|
|
181
109
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_icons","_data","_coreData","_compose","_element","_editor","_preferences","_router","_sidebarNavigationScreen","_interopRequireDefault","_lockUnlock","_store","_sidebarButton","_sidebarNavigationItem","_styleBook","_useGlobalStylesRevisions","_sidebarNavigationScreenDetailsFooter","_content","_jsxRuntime","useLocation","useHistory","unlock","routerPrivateApis","SidebarNavigationItemGlobalStyles","props","openGeneralSidebar","useDispatch","editSiteStore","history","params","hasGlobalStyleVariations","useSelect","select","coreStore","__experimentalGetCurrentThemeGlobalStylesVariations","length","jsx","default","path","uid","onClick","push","canvas","undefined","transition","SidebarNavigationScreenGlobalStyles","backPath","revisions","isLoading","isLoadingRevisions","useGlobalStylesRevisions","setIsListViewOpened","editorStore","isMobileViewport","useViewportMatch","setEditorCanvasContainerView","isStyleBookOpened","revisionsCount","_globalStyles$_links$","getEditorCanvasContainerView","getEntityRecord","__experimentalGetCurrentGlobalStylesId","globalStylesId","globalStyles","_links","count","set","setPreference","preferencesStore","openGlobalStyles","useCallback","Promise","all","openStyleBook","openRevisions","hasRevisions","modifiedDateTime","modified","shouldShowGlobalStylesFooter","jsxs","Fragment","children","title","__","description","content","footer","record","actions","icon","seen","label","isPressed","edit","enableResizing","isSelected","onSelect","showCloseButton","showTabs"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-global-styles/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { edit, seen } from '@wordpress/icons';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useCallback } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport SidebarButton from '../sidebar-button';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport StyleBook from '../style-book';\nimport useGlobalStylesRevisions from '../global-styles/screen-revisions/use-global-styles-revisions';\nimport SidebarNavigationScreenDetailsFooter from '../sidebar-navigation-screen-details-footer';\nimport SidebarNavigationScreenGlobalStylesContent from './content';\n\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\n\nexport function SidebarNavigationItemGlobalStyles( props ) {\n\tconst { openGeneralSidebar } = useDispatch( editSiteStore );\n\tconst history = useHistory();\n\tconst { params } = useLocation();\n\tconst hasGlobalStyleVariations = useSelect(\n\t\t( select ) =>\n\t\t\t!! select(\n\t\t\t\tcoreStore\n\t\t\t).__experimentalGetCurrentThemeGlobalStylesVariations()?.length,\n\t\t[]\n\t);\n\tif ( hasGlobalStyleVariations ) {\n\t\treturn (\n\t\t\t<SidebarNavigationItem\n\t\t\t\t{ ...props }\n\t\t\t\tparams={ { path: '/wp_global_styles' } }\n\t\t\t\tuid=\"global-styles-navigation-item\"\n\t\t\t/>\n\t\t);\n\t}\n\treturn (\n\t\t<SidebarNavigationItem\n\t\t\t{ ...props }\n\t\t\tonClick={ () => {\n\t\t\t\t// Switch to edit mode.\n\t\t\t\thistory.push(\n\t\t\t\t\t{\n\t\t\t\t\t\t...params,\n\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t},\n\t\t\t\t\tundefined,\n\t\t\t\t\t{\n\t\t\t\t\t\ttransition: 'canvas-mode-edit-transition',\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\t// Open global styles sidebar.\n\t\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nexport default function SidebarNavigationScreenGlobalStyles( { backPath } ) {\n\tconst history = useHistory();\n\tconst { params } = useLocation();\n\tconst { canvas = 'view' } = params;\n\tconst { revisions, isLoading: isLoadingRevisions } =\n\t\tuseGlobalStylesRevisions();\n\tconst { openGeneralSidebar } = useDispatch( editSiteStore );\n\tconst { setIsListViewOpened } = useDispatch( editorStore );\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst { isStyleBookOpened, revisionsCount } = useSelect( ( select ) => {\n\t\tconst { getEditorCanvasContainerView } = unlock(\n\t\t\tselect( editSiteStore )\n\t\t);\n\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\tselect( coreStore );\n\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\tconst globalStyles = globalStylesId\n\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t: undefined;\n\t\treturn {\n\t\t\tisStyleBookOpened: 'style-book' === getEditorCanvasContainerView(),\n\t\t\trevisionsCount:\n\t\t\t\tglobalStyles?._links?.[ 'version-history' ]?.[ 0 ]?.count ?? 0,\n\t\t};\n\t}, [] );\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst openGlobalStyles = useCallback( async () => {\n\t\thistory.push(\n\t\t\t{\n\t\t\t\t...params,\n\t\t\t\tcanvas: 'edit',\n\t\t\t},\n\t\t\tundefined,\n\t\t\t{\n\t\t\t\ttransition: 'canvas-mode-edit-transition',\n\t\t\t}\n\t\t);\n\t\treturn Promise.all( [\n\t\t\tsetPreference( 'core', 'distractionFree', false ),\n\t\t\topenGeneralSidebar( 'edit-site/global-styles' ),\n\t\t] );\n\t}, [ history, params, openGeneralSidebar, setPreference ] );\n\n\tconst openStyleBook = useCallback( async () => {\n\t\tawait openGlobalStyles();\n\t\t// Open the Style Book once the canvas mode is set to edit,\n\t\t// and the global styles sidebar is open. This ensures that\n\t\t// the Style Book is not prematurely closed.\n\t\tsetEditorCanvasContainerView( 'style-book' );\n\t\tsetIsListViewOpened( false );\n\t}, [\n\t\topenGlobalStyles,\n\t\tsetEditorCanvasContainerView,\n\t\tsetIsListViewOpened,\n\t] );\n\n\tconst openRevisions = useCallback( async () => {\n\t\tawait openGlobalStyles();\n\t\t// Open the global styles revisions once the canvas mode is set to edit,\n\t\t// and the global styles sidebar is open. The global styles UI is responsible\n\t\t// for redirecting to the revisions screen once the editor canvas container\n\t\t// has been set to 'global-styles-revisions'.\n\t\tsetEditorCanvasContainerView( 'global-styles-revisions' );\n\t}, [ openGlobalStyles, setEditorCanvasContainerView ] );\n\n\t// If there are no revisions, do not render a footer.\n\tconst hasRevisions = revisionsCount > 0;\n\tconst modifiedDateTime = revisions?.[ 0 ]?.modified;\n\tconst shouldShowGlobalStylesFooter =\n\t\thasRevisions && ! isLoadingRevisions && modifiedDateTime;\n\n\treturn (\n\t\t<>\n\t\t\t<SidebarNavigationScreen\n\t\t\t\ttitle={ __( 'Styles' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Choose a different style combination for the theme styles.'\n\t\t\t\t) }\n\t\t\t\tbackPath={ backPath }\n\t\t\t\tcontent={ <SidebarNavigationScreenGlobalStylesContent /> }\n\t\t\t\tfooter={\n\t\t\t\t\tshouldShowGlobalStylesFooter && (\n\t\t\t\t\t\t<SidebarNavigationScreenDetailsFooter\n\t\t\t\t\t\t\trecord={ revisions?.[ 0 ] }\n\t\t\t\t\t\t\tonClick={ openRevisions }\n\t\t\t\t\t\t/>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tactions={\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ ! isMobileViewport && (\n\t\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\t\ticon={ seen }\n\t\t\t\t\t\t\t\tlabel={ __( 'Style Book' ) }\n\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\tsetEditorCanvasContainerView(\n\t\t\t\t\t\t\t\t\t\t! isStyleBookOpened\n\t\t\t\t\t\t\t\t\t\t\t? 'style-book'\n\t\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tisPressed={ isStyleBookOpened }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\ticon={ edit }\n\t\t\t\t\t\t\tlabel={ __( 'Edit styles' ) }\n\t\t\t\t\t\t\tonClick={ async () => await openGlobalStyles() }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</>\n\t\t\t\t}\n\t\t\t/>\n\t\t\t{ isStyleBookOpened && ! isMobileViewport && canvas === 'view' && (\n\t\t\t\t<StyleBook\n\t\t\t\t\tenableResizing={ false }\n\t\t\t\t\tisSelected={ () => false }\n\t\t\t\t\tonClick={ openStyleBook }\n\t\t\t\t\ton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OAAO,eACN,IAAAtE,WAAA,CAAA6D,IAAA,EAAA7D,WAAA,CAAA8D,QAAA;QAAAC,QAAA,GACG,CAAE5B,gBAAgB,iBACnB,IAAAnC,WAAA,CAAAkB,GAAA,EAACxB,cAAA,CAAAyB,OAAa;UACboD,IAAI,EAAGC,WAAM;UACbC,KAAK,EAAG,IAAAR,QAAE,EAAE,YAAa,CAAG;UAC5B3C,OAAO,EAAGA,CAAA,KACTe,4BAA4B,CAC3B,CAAEC,iBAAiB,GAChB,YAAY,GACZb,SACJ,CACA;UACDiD,SAAS,EAAGpC;QAAmB,CAC/B,CACD,eACD,IAAAtC,WAAA,CAAAkB,GAAA,EAACxB,cAAA,CAAAyB,OAAa;UACboD,IAAI,EAAGI,WAAM;UACbF,KAAK,EAAG,IAAAR,QAAE,EAAE,aAAc,CAAG;UAC7B3C,OAAO,EAAG,MAAAA,CAAA,KAAY,MAAM6B,gBAAgB,CAAC;QAAG,CAChD,CAAC;MAAA,CACD;IACF,CACD,CAAC,EACAb,iBAAiB,IAAI,CAAEH,gBAAgB,IAAIX,MAAM,KAAK,MAAM,iBAC7D,IAAAxB,WAAA,CAAAkB,GAAA,EAACtB,UAAA,CAAAuB,OAAS;MACTyD,cAAc,EAAG,KAAO;MACxBC,UAAU,EAAGA,CAAA,KAAM,KAAO;MAC1BvD,OAAO,EAAGiC,aAAe;MACzBuB,QAAQ,EAAGvB,aAAe;MAC1BwB,eAAe,EAAG,KAAO;MACzBC,QAAQ,EAAG;IAAO,CAClB,CACD;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_i18n","require","_data","_coreData","_element","_preferences","_router","_sidebarNavigationScreen","_interopRequireDefault","_lockUnlock","_store","_sidebarNavigationItem","_useGlobalStylesRevisions","_sidebarNavigationScreenDetailsFooter","_sidebarNavigationScreenMain","_jsxRuntime","useLocation","useHistory","unlock","routerPrivateApis","SidebarNavigationItemGlobalStyles","props","params","hasGlobalStyleVariations","useSelect","select","coreStore","__experimentalGetCurrentThemeGlobalStylesVariations","length","jsx","default","path","uid","startsWith","SidebarNavigationScreenGlobalStyles","history","revisions","isLoading","isLoadingRevisions","revisionsCount","useGlobalStylesRevisions","openGeneralSidebar","useDispatch","editSiteStore","setEditorCanvasContainerView","set","setPreference","preferencesStore","openGlobalStyles","useCallback","push","canvas","undefined","transition","Promise","all","openRevisions","shouldShowGlobalStylesFooter","Fragment","children","title","__","isRoot","description","content","MainSidebarNavigationContent","activeItem","footer","record","onClick"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-global-styles/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useCallback } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport useGlobalStylesRevisions from '../global-styles/screen-revisions/use-global-styles-revisions';\nimport SidebarNavigationScreenDetailsFooter from '../sidebar-navigation-screen-details-footer';\nimport { MainSidebarNavigationContent } from '../sidebar-navigation-screen-main';\n\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\n\nexport function SidebarNavigationItemGlobalStyles( props ) {\n\tconst { params } = useLocation();\n\tconst hasGlobalStyleVariations = useSelect(\n\t\t( select ) =>\n\t\t\t!! select(\n\t\t\t\tcoreStore\n\t\t\t).__experimentalGetCurrentThemeGlobalStylesVariations()?.length,\n\t\t[]\n\t);\n\tif ( hasGlobalStyleVariations ) {\n\t\treturn (\n\t\t\t<SidebarNavigationItem\n\t\t\t\t{ ...props }\n\t\t\t\tparams={ { path: '/wp_global_styles' } }\n\t\t\t\tuid=\"global-styles-navigation-item\"\n\t\t\t\taria-current={\n\t\t\t\t\tparams.path && params.path.startsWith( '/wp_global_styles' )\n\t\t\t\t}\n\t\t\t/>\n\t\t);\n\t}\n\treturn <SidebarNavigationItem { ...props } />;\n}\n\nexport default function SidebarNavigationScreenGlobalStyles() {\n\tconst history = useHistory();\n\tconst { params } = useLocation();\n\tconst {\n\t\trevisions,\n\t\tisLoading: isLoadingRevisions,\n\t\trevisionsCount,\n\t} = useGlobalStylesRevisions();\n\tconst { openGeneralSidebar } = useDispatch( editSiteStore );\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst openGlobalStyles = useCallback( async () => {\n\t\thistory.push(\n\t\t\t{\n\t\t\t\t...params,\n\t\t\t\tcanvas: 'edit',\n\t\t\t},\n\t\t\tundefined,\n\t\t\t{\n\t\t\t\ttransition: 'canvas-mode-edit-transition',\n\t\t\t}\n\t\t);\n\t\treturn Promise.all( [\n\t\t\tsetPreference( 'core', 'distractionFree', false ),\n\t\t\topenGeneralSidebar( 'edit-site/global-styles' ),\n\t\t] );\n\t}, [ history, params, openGeneralSidebar, setPreference ] );\n\n\tconst openRevisions = useCallback( async () => {\n\t\tawait openGlobalStyles();\n\t\t// Open the global styles revisions once the canvas mode is set to edit,\n\t\t// and the global styles sidebar is open. The global styles UI is responsible\n\t\t// for redirecting to the revisions screen once the editor canvas container\n\t\t// has been set to 'global-styles-revisions'.\n\t\tsetEditorCanvasContainerView( 'global-styles-revisions' );\n\t}, [ openGlobalStyles, setEditorCanvasContainerView ] );\n\n\t// If there are no revisions, do not render a footer.\n\tconst shouldShowGlobalStylesFooter =\n\t\t!! revisionsCount && ! isLoadingRevisions;\n\n\treturn (\n\t\t<>\n\t\t\t<SidebarNavigationScreen\n\t\t\t\ttitle={ __( 'Design' ) }\n\t\t\t\tisRoot\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Customize the appearance of your website using the block editor.'\n\t\t\t\t) }\n\t\t\t\tcontent={\n\t\t\t\t\t<MainSidebarNavigationContent activeItem=\"styles-navigation-item\" />\n\t\t\t\t}\n\t\t\t\tfooter={\n\t\t\t\t\tshouldShowGlobalStylesFooter && (\n\t\t\t\t\t\t<SidebarNavigationScreenDetailsFooter\n\t\t\t\t\t\t\trecord={ revisions?.[ 0 ] }\n\t\t\t\t\t\t\trevisionsCount={ revisionsCount }\n\t\t\t\t\t\t\tonClick={ openRevisions }\n\t\t\t\t\t\t/>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t/>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAKA,IAAAM,wBAAA,GAAAC,sBAAA,CAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,sBAAA,GAAAH,sBAAA,CAAAP,OAAA;AACA,IAAAW,yBAAA,GAAAJ,sBAAA,CAAAP,OAAA;AACA,IAAAY,qCAAA,GAAAL,sBAAA,CAAAP,OAAA;AACA,IAAAa,4BAAA,GAAAb,OAAA;AAAiF,IAAAc,WAAA,GAAAd,OAAA;AAnBjF;AACA;AACA;;AAQA;AACA;AACA;;AASA,MAAM;EAAEe,WAAW;EAAEC;AAAW,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAExD,SAASC,iCAAiCA,CAAEC,KAAK,EAAG;EAC1D,MAAM;IAAEC;EAAO,CAAC,GAAGN,WAAW,CAAC,CAAC;EAChC,MAAMO,wBAAwB,GAAG,IAAAC,eAAS,EACvCC,MAAM,IACP,CAAC,CAAEA,MAAM,CACRC,eACD,CAAC,CAACC,mDAAmD,CAAC,C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EACjDL,kBAAkB,CAAE,yBAA0B,CAAC,CAC9C,CAAC;EACJ,CAAC,EAAE,CAAEN,OAAO,EAAEb,MAAM,EAAEmB,kBAAkB,EAAEK,aAAa,CAAG,CAAC;EAE3D,MAAMU,aAAa,GAAG,IAAAP,oBAAW,EAAE,YAAY;IAC9C,MAAMD,gBAAgB,CAAC,CAAC;IACxB;IACA;IACA;IACA;IACAJ,4BAA4B,CAAE,yBAA0B,CAAC;EAC1D,CAAC,EAAE,CAAEI,gBAAgB,EAAEJ,4BAA4B,CAAG,CAAC;;EAEvD;EACA,MAAMa,4BAA4B,GACjC,CAAC,CAAElB,cAAc,IAAI,CAAED,kBAAkB;EAE1C,oBACC,IAAAvB,WAAA,CAAAc,GAAA,EAAAd,WAAA,CAAA2C,QAAA;IAAAC,QAAA,eACC,IAAA5C,WAAA,CAAAc,GAAA,EAACtB,wBAAA,CAAAuB,OAAuB;MACvB8B,KAAK,EAAG,IAAAC,QAAE,EAAE,QAAS,CAAG;MACxBC,MAAM;MACNC,WAAW,EAAG,IAAAF,QAAE,EACf,kEACD,CAAG;MACHG,OAAO,eACN,IAAAjD,WAAA,CAAAc,GAAA,EAACf,4BAAA,CAAAmD,4BAA4B;QAACC,UAAU,EAAC;MAAwB,CAAE,CACnE;MACDC,MAAM,EACLV,4BAA4B,iBAC3B,IAAA1C,WAAA,CAAAc,GAAA,EAAChB,qCAAA,CAAAiB,OAAoC;QACpCsC,MAAM,EAAGhC,SAAS,GAAI,CAAC,CAAI;QAC3BG,cAAc,EAAGA,cAAgB;QACjC8B,OAAO,EAAGb;MAAe,CACzB;IAEF,CACD;EAAC,CACD,CAAC;AAEL","ignoreList":[]}
|
|
@@ -4,6 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
+
exports.MainSidebarNavigationContent = MainSidebarNavigationContent;
|
|
7
8
|
exports.default = SidebarNavigationScreenMain;
|
|
8
9
|
var _components = require("@wordpress/components");
|
|
9
10
|
var _i18n = require("@wordpress/i18n");
|
|
@@ -25,6 +26,47 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
25
26
|
* Internal dependencies
|
|
26
27
|
*/
|
|
27
28
|
|
|
29
|
+
function MainSidebarNavigationContent() {
|
|
30
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalItemGroup, {
|
|
31
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
|
|
32
|
+
uid: "navigation-navigation-item",
|
|
33
|
+
params: {
|
|
34
|
+
postType: _constants.NAVIGATION_POST_TYPE
|
|
35
|
+
},
|
|
36
|
+
withChevron: true,
|
|
37
|
+
icon: _icons.navigation,
|
|
38
|
+
children: (0, _i18n.__)('Navigation')
|
|
39
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreenGlobalStyles.SidebarNavigationItemGlobalStyles, {
|
|
40
|
+
uid: "styles-navigation-item",
|
|
41
|
+
icon: _icons.styles,
|
|
42
|
+
children: (0, _i18n.__)('Styles')
|
|
43
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
|
|
44
|
+
uid: "page-navigation-item",
|
|
45
|
+
params: {
|
|
46
|
+
postType: 'page'
|
|
47
|
+
},
|
|
48
|
+
withChevron: true,
|
|
49
|
+
icon: _icons.page,
|
|
50
|
+
children: (0, _i18n.__)('Pages')
|
|
51
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
|
|
52
|
+
uid: "template-navigation-item",
|
|
53
|
+
params: {
|
|
54
|
+
postType: _constants.TEMPLATE_POST_TYPE
|
|
55
|
+
},
|
|
56
|
+
withChevron: true,
|
|
57
|
+
icon: _icons.layout,
|
|
58
|
+
children: (0, _i18n.__)('Templates')
|
|
59
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
|
|
60
|
+
uid: "patterns-navigation-item",
|
|
61
|
+
params: {
|
|
62
|
+
postType: _constants.PATTERN_TYPES.user
|
|
63
|
+
},
|
|
64
|
+
withChevron: true,
|
|
65
|
+
icon: _icons.symbol,
|
|
66
|
+
children: (0, _i18n.__)('Patterns')
|
|
67
|
+
})]
|
|
68
|
+
});
|
|
69
|
+
}
|
|
28
70
|
function SidebarNavigationScreenMain() {
|
|
29
71
|
const {
|
|
30
72
|
setEditorCanvasContainerView
|
|
@@ -38,48 +80,7 @@ function SidebarNavigationScreenMain() {
|
|
|
38
80
|
isRoot: true,
|
|
39
81
|
title: (0, _i18n.__)('Design'),
|
|
40
82
|
description: (0, _i18n.__)('Customize the appearance of your website using the block editor.'),
|
|
41
|
-
content: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
42
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalItemGroup, {
|
|
43
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
|
|
44
|
-
uid: "navigation-navigation-item",
|
|
45
|
-
params: {
|
|
46
|
-
postType: _constants.NAVIGATION_POST_TYPE
|
|
47
|
-
},
|
|
48
|
-
withChevron: true,
|
|
49
|
-
icon: _icons.navigation,
|
|
50
|
-
children: (0, _i18n.__)('Navigation')
|
|
51
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreenGlobalStyles.SidebarNavigationItemGlobalStyles, {
|
|
52
|
-
uid: "styles-navigation-item",
|
|
53
|
-
withChevron: true,
|
|
54
|
-
icon: _icons.styles,
|
|
55
|
-
children: (0, _i18n.__)('Styles')
|
|
56
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
|
|
57
|
-
uid: "page-navigation-item",
|
|
58
|
-
params: {
|
|
59
|
-
postType: 'page'
|
|
60
|
-
},
|
|
61
|
-
withChevron: true,
|
|
62
|
-
icon: _icons.page,
|
|
63
|
-
children: (0, _i18n.__)('Pages')
|
|
64
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
|
|
65
|
-
uid: "template-navigation-item",
|
|
66
|
-
params: {
|
|
67
|
-
postType: _constants.TEMPLATE_POST_TYPE
|
|
68
|
-
},
|
|
69
|
-
withChevron: true,
|
|
70
|
-
icon: _icons.layout,
|
|
71
|
-
children: (0, _i18n.__)('Templates')
|
|
72
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationItem.default, {
|
|
73
|
-
uid: "patterns-navigation-item",
|
|
74
|
-
params: {
|
|
75
|
-
postType: _constants.PATTERN_TYPES.user
|
|
76
|
-
},
|
|
77
|
-
withChevron: true,
|
|
78
|
-
icon: _icons.symbol,
|
|
79
|
-
children: (0, _i18n.__)('Patterns')
|
|
80
|
-
})]
|
|
81
|
-
})
|
|
82
|
-
})
|
|
83
|
+
content: /*#__PURE__*/(0, _jsxRuntime.jsx)(MainSidebarNavigationContent, {})
|
|
83
84
|
});
|
|
84
85
|
}
|
|
85
86
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_i18n","_icons","_data","_element","_sidebarNavigationScreen","_interopRequireDefault","_sidebarNavigationItem","_sidebarNavigationScreenGlobalStyles","_lockUnlock","_store","_constants","_jsxRuntime","
|
|
1
|
+
{"version":3,"names":["_components","require","_i18n","_icons","_data","_element","_sidebarNavigationScreen","_interopRequireDefault","_sidebarNavigationItem","_sidebarNavigationScreenGlobalStyles","_lockUnlock","_store","_constants","_jsxRuntime","MainSidebarNavigationContent","jsxs","__experimentalItemGroup","children","jsx","default","uid","params","postType","NAVIGATION_POST_TYPE","withChevron","icon","navigation","__","SidebarNavigationItemGlobalStyles","styles","page","TEMPLATE_POST_TYPE","layout","PATTERN_TYPES","user","symbol","SidebarNavigationScreenMain","setEditorCanvasContainerView","unlock","useDispatch","editSiteStore","useEffect","undefined","isRoot","title","description","content"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-main/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { layout, symbol, navigation, styles, page } from '@wordpress/icons';\nimport { useDispatch } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { SidebarNavigationItemGlobalStyles } from '../sidebar-navigation-screen-global-styles';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport {\n\tNAVIGATION_POST_TYPE,\n\tTEMPLATE_POST_TYPE,\n\tPATTERN_TYPES,\n} from '../../utils/constants';\n\nexport function MainSidebarNavigationContent() {\n\treturn (\n\t\t<ItemGroup>\n\t\t\t<SidebarNavigationItem\n\t\t\t\tuid=\"navigation-navigation-item\"\n\t\t\t\tparams={ { postType: NAVIGATION_POST_TYPE } }\n\t\t\t\twithChevron\n\t\t\t\ticon={ navigation }\n\t\t\t>\n\t\t\t\t{ __( 'Navigation' ) }\n\t\t\t</SidebarNavigationItem>\n\t\t\t<SidebarNavigationItemGlobalStyles\n\t\t\t\tuid=\"styles-navigation-item\"\n\t\t\t\ticon={ styles }\n\t\t\t>\n\t\t\t\t{ __( 'Styles' ) }\n\t\t\t</SidebarNavigationItemGlobalStyles>\n\t\t\t<SidebarNavigationItem\n\t\t\t\tuid=\"page-navigation-item\"\n\t\t\t\tparams={ { postType: 'page' } }\n\t\t\t\twithChevron\n\t\t\t\ticon={ page }\n\t\t\t>\n\t\t\t\t{ __( 'Pages' ) }\n\t\t\t</SidebarNavigationItem>\n\t\t\t<SidebarNavigationItem\n\t\t\t\tuid=\"template-navigation-item\"\n\t\t\t\tparams={ { postType: TEMPLATE_POST_TYPE } }\n\t\t\t\twithChevron\n\t\t\t\ticon={ layout }\n\t\t\t>\n\t\t\t\t{ __( 'Templates' ) }\n\t\t\t</SidebarNavigationItem>\n\t\t\t<SidebarNavigationItem\n\t\t\t\tuid=\"patterns-navigation-item\"\n\t\t\t\tparams={ { postType: PATTERN_TYPES.user } }\n\t\t\t\twithChevron\n\t\t\t\ticon={ symbol }\n\t\t\t>\n\t\t\t\t{ __( 'Patterns' ) }\n\t\t\t</SidebarNavigationItem>\n\t\t</ItemGroup>\n\t);\n}\n\nexport default function SidebarNavigationScreenMain() {\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\n\t// Clear the editor canvas container view when accessing the main navigation screen.\n\tuseEffect( () => {\n\t\tsetEditorCanvasContainerView( undefined );\n\t}, [ setEditorCanvasContainerView ] );\n\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\tisRoot\n\t\t\ttitle={ __( 'Design' ) }\n\t\t\tdescription={ __(\n\t\t\t\t'Customize the appearance of your website using the block editor.'\n\t\t\t) }\n\t\t\tcontent={ <MainSidebarNavigationContent /> }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAKA,IAAAK,wBAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,sBAAA,GAAAD,sBAAA,CAAAN,OAAA;AACA,IAAAQ,oCAAA,GAAAR,OAAA;AACA,IAAAS,WAAA,GAAAT,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AACA,IAAAW,UAAA,GAAAX,OAAA;AAI+B,IAAAY,WAAA,GAAAZ,OAAA;AArB/B;AACA;AACA;;AAOA;AACA;AACA;;AAYO,SAASa,4BAA4BA,CAAA,EAAG;EAC9C,oBACC,IAAAD,WAAA,CAAAE,I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