@wordpress/edit-site 5.16.0 → 5.17.1
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-page/index.js +3 -13
- package/build/components/add-new-page/index.js.map +1 -1
- package/build/components/add-new-pattern/index.js +13 -26
- package/build/components/add-new-pattern/index.js.map +1 -1
- package/build/components/add-new-template/add-custom-generic-template-modal-content.js +1 -11
- package/build/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
- package/build/components/add-new-template/add-custom-template-modal-content.js +9 -28
- package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
- package/build/components/add-new-template/index.js +3 -10
- package/build/components/add-new-template/index.js.map +1 -1
- package/build/components/add-new-template/new-template.js +19 -49
- package/build/components/add-new-template/new-template.js.map +1 -1
- package/build/components/add-new-template/template-actions-loading-screen.js +1 -3
- package/build/components/add-new-template/template-actions-loading-screen.js.map +1 -1
- package/build/components/add-new-template/utils.js +52 -102
- package/build/components/add-new-template/utils.js.map +1 -1
- package/build/components/app/index.js +2 -19
- package/build/components/app/index.js.map +1 -1
- package/build/components/block-editor/back-button.js +1 -11
- package/build/components/block-editor/back-button.js.map +1 -1
- package/build/components/block-editor/block-inspector-button.js +3 -14
- package/build/components/block-editor/block-inspector-button.js.map +1 -1
- package/build/components/block-editor/constants.js.map +1 -1
- package/build/components/block-editor/editor-canvas.js +5 -14
- package/build/components/block-editor/editor-canvas.js.map +1 -1
- package/build/components/block-editor/get-block-editor-provider.js +0 -7
- package/build/components/block-editor/get-block-editor-provider.js.map +1 -1
- package/build/components/block-editor/index.js +10 -15
- package/build/components/block-editor/index.js.map +1 -1
- package/build/components/block-editor/inserter-media-categories.js +30 -45
- package/build/components/block-editor/inserter-media-categories.js.map +1 -1
- package/build/components/block-editor/providers/default-block-editor-provider.js +1 -10
- package/build/components/block-editor/providers/default-block-editor-provider.js.map +1 -1
- package/build/components/block-editor/providers/navigation-block-editor-provider.js +10 -19
- package/build/components/block-editor/providers/navigation-block-editor-provider.js.map +1 -1
- package/build/components/block-editor/resizable-editor.js +3 -8
- package/build/components/block-editor/resizable-editor.js.map +1 -1
- package/build/components/block-editor/resize-handle.js +1 -7
- package/build/components/block-editor/resize-handle.js.map +1 -1
- package/build/components/block-editor/site-editor-canvas.js +6 -22
- package/build/components/block-editor/site-editor-canvas.js.map +1 -1
- package/build/components/block-editor/use-site-editor-settings.js +11 -29
- package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build/components/canvas-spinner/index.js +31 -5
- package/build/components/canvas-spinner/index.js.map +1 -1
- package/build/components/code-editor/index.js +3 -18
- package/build/components/code-editor/index.js.map +1 -1
- package/build/components/create-template-part-modal/index.js +4 -19
- package/build/components/create-template-part-modal/index.js.map +1 -1
- package/build/components/editor/index.js +30 -46
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor-canvas-container/index.js +2 -28
- package/build/components/editor-canvas-container/index.js.map +1 -1
- package/build/components/error-boundary/index.js +1 -12
- package/build/components/error-boundary/index.js.map +1 -1
- package/build/components/error-boundary/warning.js +1 -7
- package/build/components/error-boundary/warning.js.map +1 -1
- package/build/components/global-styles/block-preview-panel.js +22 -13
- package/build/components/global-styles/block-preview-panel.js.map +1 -1
- package/build/components/global-styles/color-indicator-wrapper.js +1 -6
- package/build/components/global-styles/color-indicator-wrapper.js.map +1 -1
- package/build/components/global-styles/color-palette-panel.js +1 -8
- package/build/components/global-styles/color-palette-panel.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +14 -16
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/global-styles-provider.js +1 -22
- package/build/components/global-styles/global-styles-provider.js.map +1 -1
- package/build/components/global-styles/gradients-palette-panel.js +1 -11
- package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build/components/global-styles/header.js +3 -7
- package/build/components/global-styles/header.js.map +1 -1
- package/build/components/global-styles/hooks.js +26 -15
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/icon-with-current-color.js +1 -5
- package/build/components/global-styles/icon-with-current-color.js.map +1 -1
- package/build/components/global-styles/index.js +0 -2
- package/build/components/global-styles/index.js.map +1 -1
- package/build/components/global-styles/navigation-button.js +3 -7
- package/build/components/global-styles/navigation-button.js.map +1 -1
- package/build/components/global-styles/palette.js +3 -15
- package/build/components/global-styles/palette.js.map +1 -1
- package/build/components/global-styles/preview.js +7 -18
- package/build/components/global-styles/preview.js.map +1 -1
- package/build/components/global-styles/root-menu.js +1 -10
- package/build/components/global-styles/root-menu.js.map +1 -1
- package/build/components/global-styles/screen-block-list.js +10 -32
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-block.js +28 -49
- package/build/components/global-styles/screen-block.js.map +1 -1
- package/build/components/global-styles/screen-color-palette.js +1 -9
- package/build/components/global-styles/screen-color-palette.js.map +1 -1
- package/build/components/global-styles/screen-colors.js +2 -14
- package/build/components/global-styles/screen-colors.js.map +1 -1
- package/build/components/global-styles/screen-css.js +1 -10
- package/build/components/global-styles/screen-css.js.map +1 -1
- package/build/components/global-styles/screen-layout.js +2 -13
- package/build/components/global-styles/screen-layout.js.map +1 -1
- package/build/components/global-styles/screen-revisions/index.js +7 -25
- package/build/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js +20 -24
- package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +12 -22
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build/components/global-styles/screen-root.js +2 -20
- package/build/components/global-styles/screen-root.js.map +1 -1
- package/build/components/global-styles/screen-style-variations.js +6 -15
- package/build/components/global-styles/screen-style-variations.js.map +1 -1
- package/build/components/global-styles/screen-typography-element.js +2 -12
- package/build/components/global-styles/screen-typography-element.js.map +1 -1
- package/build/components/global-styles/screen-typography.js +4 -17
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/style-variations-container.js +4 -25
- package/build/components/global-styles/style-variations-container.js.map +1 -1
- package/build/components/global-styles/subtitle.js +1 -4
- package/build/components/global-styles/subtitle.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +1 -7
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/typography-preview.js +1 -7
- package/build/components/global-styles/typography-preview.js.map +1 -1
- package/build/components/global-styles/ui.js +14 -62
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles/utils.js +0 -2
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/global-styles/variations-panel.js +1 -9
- package/build/components/global-styles/variations-panel.js.map +1 -1
- package/build/components/global-styles-renderer/index.js +3 -11
- package/build/components/global-styles-renderer/index.js.map +1 -1
- package/build/components/header-edit-mode/document-actions/index.js +10 -51
- package/build/components/header-edit-mode/document-actions/index.js.map +1 -1
- package/build/components/header-edit-mode/index.js +8 -36
- package/build/components/header-edit-mode/index.js.map +1 -1
- package/build/components/header-edit-mode/mode-switcher/index.js +2 -11
- package/build/components/header-edit-mode/mode-switcher/index.js.map +1 -1
- package/build/components/header-edit-mode/more-menu/copy-content-menu-item.js +1 -14
- package/build/components/header-edit-mode/more-menu/copy-content-menu-item.js.map +1 -1
- package/build/components/header-edit-mode/more-menu/index.js +2 -24
- package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
- package/build/components/header-edit-mode/more-menu/site-export.js +1 -14
- package/build/components/header-edit-mode/more-menu/site-export.js.map +1 -1
- package/build/components/header-edit-mode/more-menu/welcome-guide-menu-item.js +1 -6
- package/build/components/header-edit-mode/more-menu/welcome-guide-menu-item.js.map +1 -1
- package/build/components/header-edit-mode/plugin-more-menu-item/index.js +0 -8
- package/build/components/header-edit-mode/plugin-more-menu-item/index.js.map +1 -1
- package/build/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js +3 -4
- package/build/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js.map +1 -1
- package/build/components/header-edit-mode/tools-more-menu-group/index.js +1 -5
- package/build/components/header-edit-mode/tools-more-menu-group/index.js.map +1 -1
- package/build/components/header-edit-mode/undo-redo/redo.js +5 -12
- package/build/components/header-edit-mode/undo-redo/redo.js.map +1 -1
- package/build/components/header-edit-mode/undo-redo/undo.js +5 -12
- package/build/components/header-edit-mode/undo-redo/undo.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/config.js +1 -2
- package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +1 -8
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +4 -24
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/shortcut.js +1 -5
- package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build/components/keyboard-shortcuts/edit-mode.js +3 -24
- package/build/components/keyboard-shortcuts/edit-mode.js.map +1 -1
- package/build/components/keyboard-shortcuts/global.js +1 -9
- package/build/components/keyboard-shortcuts/global.js.map +1 -1
- package/build/components/keyboard-shortcuts/register.js +1 -7
- package/build/components/keyboard-shortcuts/register.js.map +1 -1
- package/build/components/layout/hooks.js +2 -9
- package/build/components/layout/hooks.js.map +1 -1
- package/build/components/layout/index.js +17 -50
- package/build/components/layout/index.js.map +1 -1
- package/build/components/list/added-by.js +10 -23
- package/build/components/list/added-by.js.map +1 -1
- package/build/components/list/header.js +1 -10
- package/build/components/list/header.js.map +1 -1
- package/build/components/list/index.js +8 -20
- package/build/components/list/index.js.map +1 -1
- package/build/components/list/table.js +5 -16
- package/build/components/list/table.js.map +1 -1
- package/build/components/list/use-register-shortcuts.js +1 -5
- package/build/components/list/use-register-shortcuts.js.map +1 -1
- package/build/components/page/header.js +1 -3
- package/build/components/page/header.js.map +1 -1
- package/build/components/page/index.js +1 -7
- package/build/components/page/index.js.map +1 -1
- package/build/components/page-actions/index.js +1 -7
- package/build/components/page-actions/index.js.map +1 -1
- package/build/components/page-actions/trash-page-menu-item.js +4 -13
- package/build/components/page-actions/trash-page-menu-item.js.map +1 -1
- package/build/components/page-content-focus-manager/back-to-page-notification.js +1 -9
- package/build/components/page-content-focus-manager/back-to-page-notification.js.map +1 -1
- package/build/components/page-content-focus-manager/disable-non-page-content-blocks.js +7 -17
- package/build/components/page-content-focus-manager/disable-non-page-content-blocks.js.map +1 -1
- package/build/components/page-content-focus-manager/edit-template-notification.js +0 -16
- package/build/components/page-content-focus-manager/edit-template-notification.js.map +1 -1
- package/build/components/page-content-focus-manager/index.js +1 -8
- package/build/components/page-content-focus-manager/index.js.map +1 -1
- package/build/components/page-main/index.js +1 -11
- package/build/components/page-main/index.js.map +1 -1
- package/build/components/page-patterns/duplicate-menu-item.js +22 -49
- package/build/components/page-patterns/duplicate-menu-item.js.map +1 -1
- package/build/components/page-patterns/grid-item.js +12 -32
- package/build/components/page-patterns/grid-item.js.map +1 -1
- package/build/components/page-patterns/grid.js +1 -5
- package/build/components/page-patterns/grid.js.map +1 -1
- package/build/components/page-patterns/header.js +1 -11
- package/build/components/page-patterns/header.js.map +1 -1
- package/build/components/page-patterns/index.js +6 -15
- package/build/components/page-patterns/index.js.map +1 -1
- package/build/components/page-patterns/no-patterns.js +1 -3
- package/build/components/page-patterns/no-patterns.js.map +1 -1
- package/build/components/page-patterns/pagination.js +7 -7
- package/build/components/page-patterns/pagination.js.map +1 -1
- package/build/components/page-patterns/patterns-list.js +1 -23
- package/build/components/page-patterns/patterns-list.js.map +1 -1
- package/build/components/page-patterns/rename-menu-item.js +5 -14
- package/build/components/page-patterns/rename-menu-item.js.map +1 -1
- package/build/components/page-patterns/search-items.js +27 -38
- package/build/components/page-patterns/search-items.js.map +1 -1
- package/build/components/page-patterns/use-pattern-settings.js +5 -10
- package/build/components/page-patterns/use-pattern-settings.js.map +1 -1
- package/build/components/page-patterns/use-patterns.js +15 -34
- package/build/components/page-patterns/use-patterns.js.map +1 -1
- package/build/components/page-patterns/utils.js +0 -2
- package/build/components/page-patterns/utils.js.map +1 -1
- package/build/components/page-template-parts/add-new-template-part.js +1 -13
- package/build/components/page-template-parts/add-new-template-part.js.map +1 -1
- package/build/components/page-template-parts/index.js +1 -13
- package/build/components/page-template-parts/index.js.map +1 -1
- package/build/components/page-templates/index.js +1 -13
- package/build/components/page-templates/index.js.map +1 -1
- package/build/components/plugin-template-setting-panel/index.js +2 -3
- package/build/components/plugin-template-setting-panel/index.js.map +1 -1
- package/build/components/preferences-modal/enable-feature.js +1 -7
- package/build/components/preferences-modal/enable-feature.js.map +1 -1
- package/build/components/preferences-modal/index.js +1 -16
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/resizable-frame/index.js +24 -44
- package/build/components/resizable-frame/index.js.map +1 -1
- package/build/components/revisions/index.js +5 -17
- package/build/components/revisions/index.js.map +1 -1
- package/build/components/routes/link.js +3 -14
- package/build/components/routes/link.js.map +1 -1
- package/build/components/routes/use-title.js +5 -16
- package/build/components/routes/use-title.js.map +1 -1
- package/build/components/save-button/index.js +3 -20
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/save-hub/index.js +7 -29
- package/build/components/save-hub/index.js.map +1 -1
- package/build/components/save-panel/index.js +6 -28
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/secondary-sidebar/inserter-sidebar.js +1 -9
- package/build/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
- package/build/components/secondary-sidebar/list-view-sidebar.js +21 -32
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build/components/sidebar/index.js +1 -25
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-button/index.js +3 -6
- package/build/components/sidebar-button/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/constants.js.map +1 -1
- package/build/components/sidebar-edit-mode/default-sidebar.js +2 -5
- package/build/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js +1 -18
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build/components/sidebar-edit-mode/index.js +1 -24
- package/build/components/sidebar-edit-mode/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/edit-template.js +11 -20
- package/build/components/sidebar-edit-mode/page-panels/edit-template.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/index.js +3 -18
- package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/page-content.js +1 -6
- package/build/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/page-status.js +3 -20
- package/build/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/page-summary.js +1 -6
- package/build/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/publish-date.js +3 -15
- package/build/components/sidebar-edit-mode/page-panels/publish-date.js.map +1 -1
- package/build/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -5
- package/build/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/settings-header/index.js +14 -25
- package/build/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/sidebar-card/index.js +1 -5
- package/build/components/sidebar-edit-mode/sidebar-card/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js +1 -5
- package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-panel/index.js +1 -21
- package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-panel/last-revision.js +2 -17
- package/build/components/sidebar-edit-mode/template-panel/last-revision.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-panel/template-actions.js +1 -11
- package/build/components/sidebar-edit-mode/template-panel/template-actions.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-panel/template-areas.js +1 -15
- package/build/components/sidebar-edit-mode/template-panel/template-areas.js.map +1 -1
- package/build/components/sidebar-navigation-item/index.js +1 -7
- package/build/components/sidebar-navigation-item/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen/index.js +2 -19
- package/build/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-details-footer/index.js +2 -7
- package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-details-panel/index.js +1 -7
- package/build/components/sidebar-navigation-screen-details-panel/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js +1 -3
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js.map +1 -1
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +1 -5
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -1
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js +1 -3
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js +19 -48
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/index.js +3 -14
- package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/template-part-hint.js +1 -10
- package/build/components/sidebar-navigation-screen-main/template-part-hint.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-item/index.js +1 -13
- package/build/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +3 -5
- package/build/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js +3 -8
- package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js +5 -25
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js +5 -16
- package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +1 -13
- package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +3 -8
- package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +1 -10
- package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +12 -33
- package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +3 -6
- package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js +14 -35
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +5 -19
- package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +6 -14
- package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/index.js +6 -23
- package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/page-details.js +9 -32
- package/build/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/status-label.js +3 -17
- package/build/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pages/index.js +6 -31
- package/build/components/sidebar-navigation-screen-pages/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/index.js +11 -25
- package/build/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +1 -7
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js +1 -5
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +1 -7
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +5 -10
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +5 -22
- package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js +7 -29
- package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/category-item.js +3 -8
- package/build/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/index.js +4 -22
- package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js +1 -6
- package/build/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-my-patterns.js +1 -5
- package/build/components/sidebar-navigation-screen-patterns/use-my-patterns.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +11 -12
- 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 +6 -8
- package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +1 -8
- package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
- package/build/components/sidebar-navigation-screen-template/home-template-details.js +7 -31
- package/build/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -1
- package/build/components/sidebar-navigation-screen-template/index.js +1 -20
- package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates/index.js +4 -16
- package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/index.js +1 -9
- package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build/components/site-hub/index.js +4 -21
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/site-icon/index.js +1 -12
- package/build/components/site-icon/index.js.map +1 -1
- package/build/components/start-template-options/index.js +3 -26
- package/build/components/start-template-options/index.js.map +1 -1
- package/build/components/style-book/index.js +23 -34
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +8 -25
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +5 -13
- package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
- package/build/components/sync-state-with-url/use-sync-path-with-url.js +9 -19
- package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
- package/build/components/table/index.js +0 -2
- package/build/components/table/index.js.map +1 -1
- package/build/components/template-actions/index.js +2 -21
- package/build/components/template-actions/index.js.map +1 -1
- package/build/components/template-actions/rename-menu-item.js +7 -15
- package/build/components/template-actions/rename-menu-item.js.map +1 -1
- package/build/components/template-part-converter/convert-to-regular.js +1 -8
- package/build/components/template-part-converter/convert-to-regular.js.map +1 -1
- package/build/components/template-part-converter/convert-to-template-part.js +7 -16
- package/build/components/template-part-converter/convert-to-template-part.js.map +1 -1
- package/build/components/template-part-converter/index.js +3 -10
- package/build/components/template-part-converter/index.js.map +1 -1
- package/build/components/use-edited-entity-record/index.js +2 -15
- package/build/components/use-edited-entity-record/index.js.map +1 -1
- package/build/components/welcome-guide/editor.js +1 -10
- package/build/components/welcome-guide/editor.js.map +1 -1
- package/build/components/welcome-guide/image.js +0 -2
- package/build/components/welcome-guide/image.js.map +1 -1
- package/build/components/welcome-guide/index.js +1 -7
- 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/styles.js +1 -12
- package/build/components/welcome-guide/styles.js.map +1 -1
- package/build/components/welcome-guide/template.js +1 -9
- package/build/components/welcome-guide/template.js.map +1 -1
- package/build/hooks/commands/use-common-commands.js +132 -122
- package/build/hooks/commands/use-common-commands.js.map +1 -1
- package/build/hooks/commands/use-edit-mode-commands.js +68 -65
- package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build/hooks/components.js +1 -2
- package/build/hooks/components.js.map +1 -1
- package/build/hooks/index.js +0 -3
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/navigation-menu-edit.js +11 -24
- package/build/hooks/navigation-menu-edit.js.map +1 -1
- package/build/hooks/push-changes-to-global-styles/index.js +161 -69
- package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build/hooks/template-part-edit.js +7 -19
- package/build/hooks/template-part-edit.js.map +1 -1
- package/build/index.js +8 -31
- package/build/index.js.map +1 -1
- package/build/lock-unlock.js +1 -2
- package/build/lock-unlock.js.map +1 -1
- package/build/store/actions.js +33 -98
- package/build/store/actions.js.map +1 -1
- package/build/store/constants.js +0 -1
- package/build/store/constants.js.map +1 -1
- package/build/store/index.js +1 -12
- package/build/store/index.js.map +1 -1
- package/build/store/private-actions.js +5 -13
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +1 -3
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +12 -38
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +23 -60
- package/build/store/selectors.js.map +1 -1
- package/build/store/utils.js +13 -16
- package/build/store/utils.js.map +1 -1
- package/build/utils/get-is-list-page.js +2 -2
- package/build/utils/get-is-list-page.js.map +1 -1
- package/build/utils/is-previewing-theme.js +1 -4
- package/build/utils/is-previewing-theme.js.map +1 -1
- package/build/utils/is-template-removable.js +0 -2
- package/build/utils/is-template-removable.js.map +1 -1
- package/build/utils/is-template-revertable.js +0 -3
- package/build/utils/is-template-revertable.js.map +1 -1
- package/build/utils/template-part-create.js +3 -15
- package/build/utils/template-part-create.js.map +1 -1
- package/build/utils/use-activate-theme.js +2 -5
- package/build/utils/use-activate-theme.js.map +1 -1
- package/build/utils/use-debounced-input.js +1 -3
- package/build/utils/use-debounced-input.js.map +1 -1
- package/build-module/components/add-new-page/index.js +2 -7
- package/build-module/components/add-new-page/index.js.map +1 -1
- package/build-module/components/add-new-pattern/index.js +12 -13
- package/build-module/components/add-new-pattern/index.js.map +1 -1
- package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js +1 -11
- package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
- package/build-module/components/add-new-template/add-custom-template-modal-content.js +9 -21
- package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
- package/build-module/components/add-new-template/index.js +3 -6
- package/build-module/components/add-new-template/index.js.map +1 -1
- package/build-module/components/add-new-template/new-template.js +20 -34
- package/build-module/components/add-new-template/new-template.js.map +1 -1
- package/build-module/components/add-new-template/template-actions-loading-screen.js +0 -1
- package/build-module/components/add-new-template/template-actions-loading-screen.js.map +1 -1
- package/build-module/components/add-new-template/utils.js +52 -82
- package/build-module/components/add-new-template/utils.js.map +1 -1
- package/build-module/components/app/index.js +2 -6
- package/build-module/components/app/index.js.map +1 -1
- package/build-module/components/block-editor/back-button.js +1 -6
- package/build-module/components/block-editor/back-button.js.map +1 -1
- package/build-module/components/block-editor/block-inspector-button.js +3 -5
- package/build-module/components/block-editor/block-inspector-button.js.map +1 -1
- package/build-module/components/block-editor/constants.js.map +1 -1
- package/build-module/components/block-editor/editor-canvas.js +6 -8
- package/build-module/components/block-editor/editor-canvas.js.map +1 -1
- package/build-module/components/block-editor/get-block-editor-provider.js +1 -4
- package/build-module/components/block-editor/get-block-editor-provider.js.map +1 -1
- package/build-module/components/block-editor/index.js +10 -6
- package/build-module/components/block-editor/index.js.map +1 -1
- package/build-module/components/block-editor/inserter-media-categories.js +31 -41
- package/build-module/components/block-editor/inserter-media-categories.js.map +1 -1
- package/build-module/components/block-editor/providers/default-block-editor-provider.js +1 -2
- package/build-module/components/block-editor/providers/default-block-editor-provider.js.map +1 -1
- package/build-module/components/block-editor/providers/navigation-block-editor-provider.js +10 -11
- package/build-module/components/block-editor/providers/navigation-block-editor-provider.js.map +1 -1
- package/build-module/components/block-editor/resizable-editor.js +5 -6
- package/build-module/components/block-editor/resizable-editor.js.map +1 -1
- package/build-module/components/block-editor/resize-handle.js +0 -3
- package/build-module/components/block-editor/resize-handle.js.map +1 -1
- package/build-module/components/block-editor/site-editor-canvas.js +5 -8
- package/build-module/components/block-editor/site-editor-canvas.js.map +1 -1
- package/build-module/components/block-editor/use-site-editor-settings.js +10 -23
- package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build-module/components/canvas-spinner/index.js +31 -4
- package/build-module/components/canvas-spinner/index.js.map +1 -1
- package/build-module/components/code-editor/index.js +4 -9
- package/build-module/components/code-editor/index.js.map +1 -1
- package/build-module/components/create-template-part-modal/index.js +4 -8
- package/build-module/components/create-template-part-modal/index.js.map +1 -1
- package/build-module/components/editor/index.js +31 -21
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor-canvas-container/index.js +4 -18
- package/build-module/components/editor-canvas-container/index.js.map +1 -1
- package/build-module/components/error-boundary/index.js +1 -7
- package/build-module/components/error-boundary/index.js.map +1 -1
- package/build-module/components/error-boundary/warning.js +0 -3
- package/build-module/components/error-boundary/warning.js.map +1 -1
- package/build-module/components/global-styles/block-preview-panel.js +22 -10
- package/build-module/components/global-styles/block-preview-panel.js.map +1 -1
- package/build-module/components/global-styles/color-indicator-wrapper.js +1 -4
- package/build-module/components/global-styles/color-indicator-wrapper.js.map +1 -1
- package/build-module/components/global-styles/color-palette-panel.js +1 -2
- package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +14 -13
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/global-styles-provider.js +2 -15
- package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
- package/build-module/components/global-styles/gradients-palette-panel.js +1 -4
- package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/header.js +2 -4
- package/build-module/components/global-styles/header.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +26 -7
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/icon-with-current-color.js +1 -2
- package/build-module/components/global-styles/icon-with-current-color.js.map +1 -1
- package/build-module/components/global-styles/index.js.map +1 -1
- package/build-module/components/global-styles/navigation-button.js +3 -7
- package/build-module/components/global-styles/navigation-button.js.map +1 -1
- package/build-module/components/global-styles/palette.js +3 -5
- package/build-module/components/global-styles/palette.js.map +1 -1
- package/build-module/components/global-styles/preview.js +7 -14
- package/build-module/components/global-styles/preview.js.map +1 -1
- package/build-module/components/global-styles/root-menu.js +1 -4
- package/build-module/components/global-styles/root-menu.js.map +1 -1
- package/build-module/components/global-styles/screen-block-list.js +10 -20
- package/build-module/components/global-styles/screen-block-list.js.map +1 -1
- package/build-module/components/global-styles/screen-block.js +28 -38
- package/build-module/components/global-styles/screen-block.js.map +1 -1
- package/build-module/components/global-styles/screen-color-palette.js +1 -4
- package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
- package/build-module/components/global-styles/screen-colors.js +2 -6
- package/build-module/components/global-styles/screen-colors.js.map +1 -1
- package/build-module/components/global-styles/screen-css.js +1 -5
- package/build-module/components/global-styles/screen-css.js.map +1 -1
- package/build-module/components/global-styles/screen-layout.js +2 -6
- package/build-module/components/global-styles/screen-layout.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/index.js +7 -13
- package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +22 -22
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +12 -16
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build-module/components/global-styles/screen-root.js +2 -9
- package/build-module/components/global-styles/screen-root.js.map +1 -1
- package/build-module/components/global-styles/screen-style-variations.js +6 -9
- package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
- package/build-module/components/global-styles/screen-typography-element.js +2 -6
- package/build-module/components/global-styles/screen-typography-element.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js +4 -8
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/style-variations-container.js +5 -15
- package/build-module/components/global-styles/style-variations-container.js.map +1 -1
- package/build-module/components/global-styles/subtitle.js +0 -3
- package/build-module/components/global-styles/subtitle.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +1 -4
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/typography-preview.js +1 -4
- package/build-module/components/global-styles/typography-preview.js.map +1 -1
- package/build-module/components/global-styles/ui.js +15 -37
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles/utils.js +0 -1
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/global-styles/variations-panel.js +0 -4
- package/build-module/components/global-styles/variations-panel.js.map +1 -1
- package/build-module/components/global-styles-renderer/index.js +3 -6
- package/build-module/components/global-styles-renderer/index.js.map +1 -1
- package/build-module/components/header-edit-mode/document-actions/index.js +12 -41
- package/build-module/components/header-edit-mode/document-actions/index.js.map +1 -1
- package/build-module/components/header-edit-mode/index.js +9 -18
- package/build-module/components/header-edit-mode/index.js.map +1 -1
- package/build-module/components/header-edit-mode/mode-switcher/index.js +4 -7
- package/build-module/components/header-edit-mode/mode-switcher/index.js.map +1 -1
- package/build-module/components/header-edit-mode/more-menu/copy-content-menu-item.js +1 -6
- package/build-module/components/header-edit-mode/more-menu/copy-content-menu-item.js.map +1 -1
- package/build-module/components/header-edit-mode/more-menu/index.js +2 -6
- package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
- package/build-module/components/header-edit-mode/more-menu/site-export.js +1 -6
- package/build-module/components/header-edit-mode/more-menu/site-export.js.map +1 -1
- package/build-module/components/header-edit-mode/more-menu/welcome-guide-menu-item.js +0 -1
- package/build-module/components/header-edit-mode/more-menu/welcome-guide-menu-item.js.map +1 -1
- package/build-module/components/header-edit-mode/plugin-more-menu-item/index.js +1 -2
- package/build-module/components/header-edit-mode/plugin-more-menu-item/index.js.map +1 -1
- package/build-module/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js +3 -2
- package/build-module/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js.map +1 -1
- package/build-module/components/header-edit-mode/tools-more-menu-group/index.js +0 -3
- package/build-module/components/header-edit-mode/tools-more-menu-group/index.js.map +1 -1
- package/build-module/components/header-edit-mode/undo-redo/redo.js +4 -5
- package/build-module/components/header-edit-mode/undo-redo/redo.js.map +1 -1
- package/build-module/components/header-edit-mode/undo-redo/undo.js +4 -5
- package/build-module/components/header-edit-mode/undo-redo/undo.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +1 -4
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +5 -15
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +0 -4
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/edit-mode.js +3 -13
- package/build-module/components/keyboard-shortcuts/edit-mode.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/global.js +1 -6
- package/build-module/components/keyboard-shortcuts/global.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/register.js +0 -2
- package/build-module/components/keyboard-shortcuts/register.js.map +1 -1
- package/build-module/components/layout/hooks.js +2 -4
- package/build-module/components/layout/hooks.js.map +1 -1
- package/build-module/components/layout/index.js +19 -20
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/list/added-by.js +12 -15
- package/build-module/components/list/added-by.js.map +1 -1
- package/build-module/components/list/header.js +1 -4
- package/build-module/components/list/header.js.map +1 -1
- package/build-module/components/list/index.js +8 -6
- package/build-module/components/list/index.js.map +1 -1
- package/build-module/components/list/table.js +5 -7
- package/build-module/components/list/table.js.map +1 -1
- package/build-module/components/list/use-register-shortcuts.js +1 -0
- package/build-module/components/list/use-register-shortcuts.js.map +1 -1
- package/build-module/components/page/header.js +1 -1
- package/build-module/components/page/header.js.map +1 -1
- package/build-module/components/page/index.js +2 -3
- package/build-module/components/page/index.js.map +1 -1
- package/build-module/components/page-actions/index.js +1 -2
- package/build-module/components/page-actions/index.js.map +1 -1
- package/build-module/components/page-actions/trash-page-menu-item.js +3 -6
- package/build-module/components/page-actions/trash-page-menu-item.js.map +1 -1
- package/build-module/components/page-content-focus-manager/back-to-page-notification.js +3 -4
- package/build-module/components/page-content-focus-manager/back-to-page-notification.js.map +1 -1
- package/build-module/components/page-content-focus-manager/disable-non-page-content-blocks.js +6 -9
- package/build-module/components/page-content-focus-manager/disable-non-page-content-blocks.js.map +1 -1
- package/build-module/components/page-content-focus-manager/edit-template-notification.js +2 -12
- package/build-module/components/page-content-focus-manager/edit-template-notification.js.map +1 -1
- package/build-module/components/page-content-focus-manager/index.js +1 -2
- package/build-module/components/page-content-focus-manager/index.js.map +1 -1
- package/build-module/components/page-main/index.js +1 -4
- package/build-module/components/page-main/index.js.map +1 -1
- package/build-module/components/page-patterns/duplicate-menu-item.js +22 -40
- package/build-module/components/page-patterns/duplicate-menu-item.js.map +1 -1
- package/build-module/components/page-patterns/grid-item.js +13 -18
- package/build-module/components/page-patterns/grid-item.js.map +1 -1
- package/build-module/components/page-patterns/grid.js +0 -2
- package/build-module/components/page-patterns/grid.js.map +1 -1
- package/build-module/components/page-patterns/header.js +1 -4
- package/build-module/components/page-patterns/header.js.map +1 -1
- package/build-module/components/page-patterns/index.js +6 -5
- package/build-module/components/page-patterns/index.js.map +1 -1
- package/build-module/components/page-patterns/no-patterns.js +0 -1
- package/build-module/components/page-patterns/no-patterns.js.map +1 -1
- package/build-module/components/page-patterns/pagination.js +6 -4
- package/build-module/components/page-patterns/pagination.js.map +1 -1
- package/build-module/components/page-patterns/patterns-list.js +1 -7
- package/build-module/components/page-patterns/patterns-list.js.map +1 -1
- package/build-module/components/page-patterns/rename-menu-item.js +5 -8
- package/build-module/components/page-patterns/rename-menu-item.js.map +1 -1
- package/build-module/components/page-patterns/search-items.js +28 -32
- package/build-module/components/page-patterns/search-items.js.map +1 -1
- package/build-module/components/page-patterns/use-pattern-settings.js +5 -4
- package/build-module/components/page-patterns/use-pattern-settings.js.map +1 -1
- package/build-module/components/page-patterns/use-patterns.js +15 -24
- package/build-module/components/page-patterns/use-patterns.js.map +1 -1
- package/build-module/components/page-patterns/utils.js.map +1 -1
- package/build-module/components/page-template-parts/add-new-template-part.js +1 -4
- package/build-module/components/page-template-parts/add-new-template-part.js.map +1 -1
- package/build-module/components/page-template-parts/index.js +1 -2
- package/build-module/components/page-template-parts/index.js.map +1 -1
- package/build-module/components/page-templates/index.js +1 -2
- package/build-module/components/page-templates/index.js.map +1 -1
- package/build-module/components/plugin-template-setting-panel/index.js +1 -1
- package/build-module/components/plugin-template-setting-panel/index.js.map +1 -1
- package/build-module/components/preferences-modal/enable-feature.js +0 -3
- package/build-module/components/preferences-modal/enable-feature.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +1 -8
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/resizable-frame/index.js +27 -38
- package/build-module/components/resizable-frame/index.js.map +1 -1
- package/build-module/components/revisions/index.js +5 -7
- package/build-module/components/revisions/index.js.map +1 -1
- package/build-module/components/routes/link.js +3 -8
- package/build-module/components/routes/link.js.map +1 -1
- package/build-module/components/routes/use-title.js +5 -7
- package/build-module/components/routes/use-title.js.map +1 -1
- package/build-module/components/save-button/index.js +3 -13
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/save-hub/index.js +7 -16
- package/build-module/components/save-hub/index.js.map +1 -1
- package/build-module/components/save-panel/index.js +7 -17
- package/build-module/components/save-panel/index.js.map +1 -1
- package/build-module/components/secondary-sidebar/inserter-sidebar.js +1 -2
- package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
- package/build-module/components/secondary-sidebar/list-view-sidebar.js +21 -19
- package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build-module/components/sidebar/index.js +1 -5
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-button/index.js +3 -3
- package/build-module/components/sidebar-button/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/constants.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/default-sidebar.js +2 -2
- package/build-module/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +1 -6
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/index.js +1 -7
- package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/edit-template.js +11 -13
- package/build-module/components/sidebar-edit-mode/page-panels/edit-template.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/index.js +3 -5
- package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/page-content.js +1 -2
- package/build-module/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/page-status.js +2 -11
- package/build-module/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js +0 -2
- package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/publish-date.js +2 -7
- package/build-module/components/sidebar-edit-mode/page-panels/publish-date.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js +2 -3
- package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/settings-header/index.js +15 -17
- package/build-module/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/sidebar-card/index.js +1 -2
- package/build-module/components/sidebar-edit-mode/sidebar-card/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js +1 -2
- package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/template-panel/index.js +1 -7
- package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/template-panel/last-revision.js +2 -11
- package/build-module/components/sidebar-edit-mode/template-panel/last-revision.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/template-panel/template-actions.js +1 -4
- package/build-module/components/sidebar-edit-mode/template-panel/template-actions.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/template-panel/template-areas.js +1 -10
- package/build-module/components/sidebar-edit-mode/template-panel/template-areas.js.map +1 -1
- package/build-module/components/sidebar-navigation-item/index.js +1 -2
- package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen/index.js +3 -7
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-details-footer/index.js +2 -4
- package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-details-panel/index.js +1 -4
- package/build-module/components/sidebar-navigation-screen-details-panel/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js +0 -1
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +1 -2
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js +0 -1
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +19 -30
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +3 -3
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/template-part-hint.js +0 -4
- package/build-module/components/sidebar-navigation-screen-main/template-part-hint.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-item/index.js +1 -2
- package/build-module/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +2 -2
- package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js +2 -3
- package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +5 -13
- package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +5 -9
- package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +1 -7
- package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +2 -6
- package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +0 -2
- package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +11 -28
- package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +4 -4
- package/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +16 -20
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +5 -9
- package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +6 -6
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-page/index.js +6 -6
- package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-page/page-details.js +11 -22
- package/build-module/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-page/status-label.js +3 -13
- package/build-module/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pages/index.js +6 -17
- package/build-module/components/sidebar-navigation-screen-pages/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/index.js +11 -12
- package/build-module/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +1 -2
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js +0 -2
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +1 -2
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +4 -5
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +7 -19
- package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js +8 -18
- package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/category-item.js +2 -4
- package/build-module/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/index.js +4 -7
- package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js +1 -2
- package/build-module/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-my-patterns.js +0 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-my-patterns.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +11 -7
- 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 +5 -5
- package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +1 -2
- package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-template/home-template-details.js +7 -18
- package/build-module/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-template/index.js +0 -6
- package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates/index.js +4 -6
- package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +1 -2
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build-module/components/site-hub/index.js +5 -7
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/site-icon/index.js +1 -6
- package/build-module/components/site-icon/index.js.map +1 -1
- package/build-module/components/start-template-options/index.js +3 -14
- package/build-module/components/start-template-options/index.js.map +1 -1
- package/build-module/components/style-book/index.js +24 -24
- package/build-module/components/style-book/index.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +8 -15
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +5 -7
- package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +9 -14
- package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
- package/build-module/components/table/index.js.map +1 -1
- package/build-module/components/template-actions/index.js +2 -9
- package/build-module/components/template-actions/index.js.map +1 -1
- package/build-module/components/template-actions/rename-menu-item.js +6 -8
- package/build-module/components/template-actions/rename-menu-item.js.map +1 -1
- package/build-module/components/template-part-converter/convert-to-regular.js +0 -3
- package/build-module/components/template-part-converter/convert-to-regular.js.map +1 -1
- package/build-module/components/template-part-converter/convert-to-template-part.js +7 -6
- package/build-module/components/template-part-converter/convert-to-template-part.js.map +1 -1
- package/build-module/components/template-part-converter/index.js +3 -5
- package/build-module/components/template-part-converter/index.js.map +1 -1
- package/build-module/components/use-edited-entity-record/index.js +2 -7
- package/build-module/components/use-edited-entity-record/index.js.map +1 -1
- package/build-module/components/welcome-guide/editor.js +1 -4
- package/build-module/components/welcome-guide/editor.js.map +1 -1
- package/build-module/components/welcome-guide/image.js.map +1 -1
- package/build-module/components/welcome-guide/index.js +0 -1
- package/build-module/components/welcome-guide/index.js.map +1 -1
- package/build-module/components/welcome-guide/page.js +1 -5
- package/build-module/components/welcome-guide/page.js.map +1 -1
- package/build-module/components/welcome-guide/styles.js +1 -5
- package/build-module/components/welcome-guide/styles.js.map +1 -1
- package/build-module/components/welcome-guide/template.js +1 -5
- package/build-module/components/welcome-guide/template.js.map +1 -1
- package/build-module/hooks/commands/use-common-commands.js +133 -108
- package/build-module/hooks/commands/use-common-commands.js.map +1 -1
- package/build-module/hooks/commands/use-edit-mode-commands.js +69 -49
- package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build-module/hooks/components.js.map +1 -1
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/navigation-menu-edit.js +11 -14
- package/build-module/hooks/navigation-menu-edit.js.map +1 -1
- package/build-module/hooks/push-changes-to-global-styles/index.js +162 -61
- package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build-module/hooks/template-part-edit.js +7 -9
- package/build-module/hooks/template-part-edit.js.map +1 -1
- package/build-module/index.js +10 -15
- package/build-module/index.js.map +1 -1
- package/build-module/lock-unlock.js.map +1 -1
- package/build-module/store/actions.js +35 -53
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/constants.js.map +1 -1
- package/build-module/store/index.js +1 -1
- package/build-module/store/index.js.map +1 -1
- package/build-module/store/private-actions.js +6 -8
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +1 -1
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +13 -29
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +26 -31
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/store/utils.js +13 -13
- package/build-module/store/utils.js.map +1 -1
- package/build-module/utils/get-is-list-page.js +2 -1
- package/build-module/utils/get-is-list-page.js.map +1 -1
- package/build-module/utils/is-previewing-theme.js +0 -1
- package/build-module/utils/is-previewing-theme.js.map +1 -1
- package/build-module/utils/is-template-removable.js +0 -1
- package/build-module/utils/is-template-removable.js.map +1 -1
- package/build-module/utils/is-template-revertable.js +0 -2
- package/build-module/utils/is-template-revertable.js.map +1 -1
- package/build-module/utils/template-part-create.js +3 -7
- package/build-module/utils/template-part-create.js.map +1 -1
- package/build-module/utils/use-activate-theme.js +2 -2
- package/build-module/utils/use-activate-theme.js.map +1 -1
- package/build-module/utils/use-debounced-input.js.map +1 -1
- package/build-style/style-rtl.css +37 -27
- package/build-style/style.css +37 -27
- package/package.json +41 -40
- package/src/components/add-new-pattern/index.js +4 -3
- package/src/components/block-editor/index.js +4 -3
- package/src/components/block-editor/providers/navigation-block-editor-provider.js +2 -3
- package/src/components/canvas-spinner/index.js +21 -3
- package/src/components/canvas-spinner/style.scss +5 -2
- package/src/components/editor/index.js +15 -1
- package/src/components/global-styles/block-preview-panel.js +26 -15
- package/src/components/global-styles/hooks.js +27 -1
- package/src/components/global-styles/preview.js +3 -13
- package/src/components/global-styles/screen-colors.js +0 -4
- package/src/components/global-styles/screen-layout.js +0 -2
- package/src/components/global-styles/screen-revisions/index.js +6 -4
- package/src/components/global-styles/screen-revisions/revisions-buttons.js +46 -21
- package/src/components/global-styles/screen-revisions/test/use-global-styles-revisions.js +10 -0
- package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +6 -0
- package/src/components/global-styles/screen-typography.js +0 -4
- package/src/components/global-styles/ui.js +1 -1
- package/src/components/header-edit-mode/document-actions/index.js +13 -26
- package/src/components/header-edit-mode/document-actions/style.scss +17 -4
- package/src/components/header-edit-mode/index.js +1 -1
- package/src/components/header-edit-mode/style.scss +0 -9
- package/src/components/layout/index.js +5 -2
- package/src/components/page-actions/trash-page-menu-item.js +5 -1
- package/src/components/page-content-focus-manager/disable-non-page-content-blocks.js +1 -4
- package/src/components/page-patterns/duplicate-menu-item.js +18 -39
- package/src/components/page-patterns/use-patterns.js +9 -3
- package/src/components/sidebar-edit-mode/default-sidebar.js +1 -0
- package/src/components/sidebar-edit-mode/page-panels/edit-template.js +13 -5
- package/src/components/sidebar-navigation-screen-global-styles/index.js +1 -1
- package/src/components/sidebar-navigation-screen-navigation-menu/index.js +3 -4
- package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +2 -1
- package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +11 -10
- package/src/components/sidebar-navigation-screen-page/index.js +3 -3
- package/src/components/sidebar-navigation-screen-pages/index.js +1 -1
- package/src/components/sidebar-navigation-screen-pattern/index.js +2 -5
- package/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js +0 -3
- package/src/components/sidebar-navigation-screen-patterns/index.js +1 -1
- package/src/components/sidebar-navigation-screen-template/home-template-details.js +4 -2
- package/src/components/sidebar-navigation-screen-templates/index.js +1 -1
- package/src/components/site-hub/index.js +1 -1
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +2 -8
- package/src/components/template-actions/index.js +1 -5
- package/src/components/template-part-converter/convert-to-template-part.js +2 -0
- package/src/components/use-edited-entity-record/index.js +1 -6
- package/src/hooks/commands/use-common-commands.js +153 -72
- package/src/hooks/commands/use-edit-mode-commands.js +61 -19
- package/src/hooks/navigation-menu-edit.js +1 -5
- package/src/hooks/push-changes-to-global-styles/index.js +163 -28
- package/src/style.scss +0 -1
- package/build/components/create-pattern-modal/index.js +0 -129
- package/build/components/create-pattern-modal/index.js.map +0 -1
- package/build/utils/normalize-record-key.js +0 -19
- package/build/utils/normalize-record-key.js.map +0 -1
- package/build-module/components/create-pattern-modal/index.js +0 -116
- package/build-module/components/create-pattern-modal/index.js.map +0 -1
- package/build-module/utils/normalize-record-key.js +0 -12
- package/build-module/utils/normalize-record-key.js.map +0 -1
- package/src/components/create-pattern-modal/index.js +0 -136
- package/src/components/create-pattern-modal/style.scss +0 -3
- package/src/utils/normalize-record-key.js +0 -11
- /package/src/components/global-styles/stories/{index.js → index.story.js} +0 -0
|
@@ -4,13 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = TypographyPanel;
|
|
7
|
-
|
|
8
7
|
var _element = require("@wordpress/element");
|
|
9
|
-
|
|
10
8
|
var _blockEditor = require("@wordpress/block-editor");
|
|
11
|
-
|
|
12
9
|
var _lockUnlock = require("../../lock-unlock");
|
|
13
|
-
|
|
14
10
|
/**
|
|
15
11
|
* WordPress dependencies
|
|
16
12
|
*/
|
|
@@ -18,25 +14,23 @@ var _lockUnlock = require("../../lock-unlock");
|
|
|
18
14
|
/**
|
|
19
15
|
* Internal dependencies
|
|
20
16
|
*/
|
|
17
|
+
|
|
21
18
|
const {
|
|
22
19
|
useGlobalStyle,
|
|
23
20
|
useGlobalSetting,
|
|
24
21
|
useSettingsForBlockElement,
|
|
25
22
|
TypographyPanel: StylesTypographyPanel
|
|
26
23
|
} = (0, _lockUnlock.unlock)(_blockEditor.privateApis);
|
|
27
|
-
|
|
28
24
|
function TypographyPanel({
|
|
29
25
|
element,
|
|
30
26
|
headingLevel
|
|
31
27
|
}) {
|
|
32
28
|
let prefixParts = [];
|
|
33
|
-
|
|
34
29
|
if (element === 'heading') {
|
|
35
30
|
prefixParts = prefixParts.concat(['elements', headingLevel]);
|
|
36
31
|
} else if (element && element !== 'text') {
|
|
37
32
|
prefixParts = prefixParts.concat(['elements', element]);
|
|
38
33
|
}
|
|
39
|
-
|
|
40
34
|
const prefix = prefixParts.join('.');
|
|
41
35
|
const [style] = useGlobalStyle(prefix, undefined, 'user', {
|
|
42
36
|
shouldDecodeEncode: false
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["_blockEditor","require","_lockUnlock","useGlobalStyle","useGlobalSetting","useSettingsForBlockElement","TypographyPanel","StylesTypographyPanel","unlock","blockEditorPrivateApis","element","headingLevel","prefixParts","concat","prefix","join","style","undefined","shouldDecodeEncode","inheritedStyle","setStyle","rawSettings","usedElement","settings","_element","createElement","inheritedValue","value","onChange"],"sources":["@wordpress/edit-site/src/components/global-styles/typography-panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst {\n\tuseGlobalStyle,\n\tuseGlobalSetting,\n\tuseSettingsForBlockElement,\n\tTypographyPanel: StylesTypographyPanel,\n} = unlock( blockEditorPrivateApis );\n\nexport default function TypographyPanel( { element, headingLevel } ) {\n\tlet prefixParts = [];\n\tif ( element === 'heading' ) {\n\t\tprefixParts = prefixParts.concat( [ 'elements', headingLevel ] );\n\t} else if ( element && element !== 'text' ) {\n\t\tprefixParts = prefixParts.concat( [ 'elements', element ] );\n\t}\n\tconst prefix = prefixParts.join( '.' );\n\n\tconst [ style ] = useGlobalStyle( prefix, undefined, 'user', {\n\t\tshouldDecodeEncode: false,\n\t} );\n\tconst [ inheritedStyle, setStyle ] = useGlobalStyle(\n\t\tprefix,\n\t\tundefined,\n\t\t'all',\n\t\t{\n\t\t\tshouldDecodeEncode: false,\n\t\t}\n\t);\n\tconst [ rawSettings ] = useGlobalSetting( '' );\n\tconst usedElement = element === 'heading' ? headingLevel : element;\n\tconst settings = useSettingsForBlockElement(\n\t\trawSettings,\n\t\tundefined,\n\t\tusedElement\n\t);\n\n\treturn (\n\t\t<StylesTypographyPanel\n\t\t\tinheritedValue={ inheritedStyle }\n\t\t\tvalue={ style }\n\t\t\tonChange={ setStyle }\n\t\t\tsettings={ settings }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAGA,MAAM;EACLE,cAAc;EACdC,gBAAgB;EAChBC,0BAA0B;EAC1BC,eAAe,EAAEC;AAClB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAErB,SAASH,eAAeA,CAAE;EAAEI,OAAO;EAAEC;AAAa,CAAC,EAAG;EACpE,IAAIC,WAAW,GAAG,EAAE;EACpB,IAAKF,OAAO,KAAK,SAAS,EAAG;IAC5BE,WAAW,GAAGA,WAAW,CAACC,MAAM,CAAE,CAAE,UAAU,EAAEF,YAAY,CAAG,CAAC;EACjE,CAAC,MAAM,IAAKD,OAAO,IAAIA,OAAO,KAAK,MAAM,EAAG;IAC3CE,WAAW,GAAGA,WAAW,CAACC,MAAM,CAAE,CAAE,UAAU,EAAEH,OAAO,CAAG,CAAC;EAC5D;EACA,MAAMI,MAAM,GAAGF,WAAW,CAACG,IAAI,CAAE,GAAI,CAAC;EAEtC,MAAM,CAAEC,KAAK,CAAE,GAAGb,cAAc,CAAEW,MAAM,EAAEG,SAAS,EAAE,MAAM,EAAE;IAC5DC,kBAAkB,EAAE;EACrB,CAAE,CAAC;EACH,MAAM,CAAEC,cAAc,EAAEC,QAAQ,CAAE,GAAGjB,cAAc,CAClDW,MAAM,EACNG,SAAS,EACT,KAAK,EACL;IACCC,kBAAkB,EAAE;EACrB,CACD,CAAC;EACD,MAAM,CAAEG,WAAW,CAAE,GAAGjB,gBAAgB,CAAE,EAAG,CAAC;EAC9C,MAAMkB,WAAW,GAAGZ,OAAO,KAAK,SAAS,GAAGC,YAAY,GAAGD,OAAO;EAClE,MAAMa,QAAQ,GAAGlB,0BAA0B,CAC1CgB,WAAW,EACXJ,SAAS,EACTK,WACD,CAAC;EAED,OACC,IAAAE,QAAA,CAAAC,aAAA,EAAClB,qBAAqB;IACrBmB,cAAc,EAAGP,cAAgB;IACjCQ,KAAK,EAAGX,KAAO;IACfY,QAAQ,EAAGR,QAAU;IACrBG,QAAQ,EAAGA;EAAU,CACrB,CAAC;AAEJ"}
|
|
@@ -4,13 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = TypographyPreview;
|
|
7
|
-
|
|
8
7
|
var _element = require("@wordpress/element");
|
|
9
|
-
|
|
10
8
|
var _blockEditor = require("@wordpress/block-editor");
|
|
11
|
-
|
|
12
9
|
var _lockUnlock = require("../../lock-unlock");
|
|
13
|
-
|
|
14
10
|
/**
|
|
15
11
|
* WordPress dependencies
|
|
16
12
|
*/
|
|
@@ -18,23 +14,21 @@ var _lockUnlock = require("../../lock-unlock");
|
|
|
18
14
|
/**
|
|
19
15
|
* Internal dependencies
|
|
20
16
|
*/
|
|
17
|
+
|
|
21
18
|
const {
|
|
22
19
|
useGlobalStyle
|
|
23
20
|
} = (0, _lockUnlock.unlock)(_blockEditor.privateApis);
|
|
24
|
-
|
|
25
21
|
function TypographyPreview({
|
|
26
22
|
name,
|
|
27
23
|
element,
|
|
28
24
|
headingLevel
|
|
29
25
|
}) {
|
|
30
26
|
let prefix = '';
|
|
31
|
-
|
|
32
27
|
if (element === 'heading') {
|
|
33
28
|
prefix = `elements.${headingLevel}.`;
|
|
34
29
|
} else if (element && element !== 'text') {
|
|
35
30
|
prefix = `elements.${element}.`;
|
|
36
31
|
}
|
|
37
|
-
|
|
38
32
|
const [fontFamily] = useGlobalStyle(prefix + 'typography.fontFamily', name);
|
|
39
33
|
const [gradientValue] = useGlobalStyle(prefix + 'color.gradient', name);
|
|
40
34
|
const [backgroundColor] = useGlobalStyle(prefix + 'color.background', name);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["_blockEditor","require","_lockUnlock","useGlobalStyle","unlock","blockEditorPrivateApis","TypographyPreview","name","element","headingLevel","prefix","fontFamily","gradientValue","backgroundColor","color","fontSize","fontStyle","fontWeight","letterSpacing","extraStyles","textDecoration","_element","createElement","className","style","background"],"sources":["@wordpress/edit-site/src/components/global-styles/typography-preview.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { useGlobalStyle } = unlock( blockEditorPrivateApis );\n\nexport default function TypographyPreview( { name, element, headingLevel } ) {\n\tlet prefix = '';\n\tif ( element === 'heading' ) {\n\t\tprefix = `elements.${ headingLevel }.`;\n\t} else if ( element && element !== 'text' ) {\n\t\tprefix = `elements.${ element }.`;\n\t}\n\n\tconst [ fontFamily ] = useGlobalStyle(\n\t\tprefix + 'typography.fontFamily',\n\t\tname\n\t);\n\tconst [ gradientValue ] = useGlobalStyle( prefix + 'color.gradient', name );\n\tconst [ backgroundColor ] = useGlobalStyle(\n\t\tprefix + 'color.background',\n\t\tname\n\t);\n\tconst [ color ] = useGlobalStyle( prefix + 'color.text', name );\n\tconst [ fontSize ] = useGlobalStyle( prefix + 'typography.fontSize', name );\n\tconst [ fontStyle ] = useGlobalStyle(\n\t\tprefix + 'typography.fontStyle',\n\t\tname\n\t);\n\tconst [ fontWeight ] = useGlobalStyle(\n\t\tprefix + 'typography.fontWeight',\n\t\tname\n\t);\n\tconst [ letterSpacing ] = useGlobalStyle(\n\t\tprefix + 'typography.letterSpacing',\n\t\tname\n\t);\n\tconst extraStyles =\n\t\telement === 'link'\n\t\t\t? {\n\t\t\t\t\ttextDecoration: 'underline',\n\t\t\t }\n\t\t\t: {};\n\n\treturn (\n\t\t<div\n\t\t\tclassName=\"edit-site-typography-preview\"\n\t\t\tstyle={ {\n\t\t\t\tfontFamily: fontFamily ?? 'serif',\n\t\t\t\tbackground: gradientValue ?? backgroundColor,\n\t\t\t\tcolor,\n\t\t\t\tfontSize,\n\t\t\t\tfontStyle,\n\t\t\t\tfontWeight,\n\t\t\t\tletterSpacing,\n\t\t\t\t...extraStyles,\n\t\t\t} }\n\t\t>\n\t\t\tAa\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAGA,MAAM;EAAEE;AAAe,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAE5C,SAASC,iBAAiBA,CAAE;EAAEC,IAAI;EAAEC,OAAO;EAAEC;AAAa,CAAC,EAAG;EAC5E,IAAIC,MAAM,GAAG,EAAE;EACf,IAAKF,OAAO,KAAK,SAAS,EAAG;IAC5BE,MAAM,GAAI,YAAYD,YAAc,GAAE;EACvC,CAAC,MAAM,IAAKD,OAAO,IAAIA,OAAO,KAAK,MAAM,EAAG;IAC3CE,MAAM,GAAI,YAAYF,OAAS,GAAE;EAClC;EAEA,MAAM,CAAEG,UAAU,CAAE,GAAGR,cAAc,CACpCO,MAAM,GAAG,uBAAuB,EAChCH,IACD,CAAC;EACD,MAAM,CAAEK,aAAa,CAAE,GAAGT,cAAc,CAAEO,MAAM,GAAG,gBAAgB,EAAEH,IAAK,CAAC;EAC3E,MAAM,CAAEM,eAAe,CAAE,GAAGV,cAAc,CACzCO,MAAM,GAAG,kBAAkB,EAC3BH,IACD,CAAC;EACD,MAAM,CAAEO,KAAK,CAAE,GAAGX,cAAc,CAAEO,MAAM,GAAG,YAAY,EAAEH,IAAK,CAAC;EAC/D,MAAM,CAAEQ,QAAQ,CAAE,GAAGZ,cAAc,CAAEO,MAAM,GAAG,qBAAqB,EAAEH,IAAK,CAAC;EAC3E,MAAM,CAAES,SAAS,CAAE,GAAGb,cAAc,CACnCO,MAAM,GAAG,sBAAsB,EAC/BH,IACD,CAAC;EACD,MAAM,CAAEU,UAAU,CAAE,GAAGd,cAAc,CACpCO,MAAM,GAAG,uBAAuB,EAChCH,IACD,CAAC;EACD,MAAM,CAAEW,aAAa,CAAE,GAAGf,cAAc,CACvCO,MAAM,GAAG,0BAA0B,EACnCH,IACD,CAAC;EACD,MAAMY,WAAW,GAChBX,OAAO,KAAK,MAAM,GACf;IACAY,cAAc,EAAE;EAChB,CAAC,GACD,CAAC,CAAC;EAEN,OACC,IAAAC,QAAA,CAAAC,aAAA;IACCC,SAAS,EAAC,8BAA8B;IACxCC,KAAK,EAAG;MACPb,UAAU,EAAEA,UAAU,aAAVA,UAAU,cAAVA,UAAU,GAAI,OAAO;MACjCc,UAAU,EAAEb,aAAa,aAAbA,aAAa,cAAbA,aAAa,GAAIC,eAAe;MAC5CC,KAAK;MACLC,QAAQ;MACRC,SAAS;MACTC,UAAU;MACVC,aAAa;MACb,GAAGC;IACJ;EAAG,GACH,IAEI,CAAC;AAER"}
|
|
@@ -1,64 +1,36 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = exports.GlobalStylesMenuSlot = void 0;
|
|
9
|
-
|
|
10
8
|
var _element = require("@wordpress/element");
|
|
11
|
-
|
|
12
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
-
|
|
14
10
|
var _components = require("@wordpress/components");
|
|
15
|
-
|
|
16
11
|
var _blocks = require("@wordpress/blocks");
|
|
17
|
-
|
|
18
12
|
var _data = require("@wordpress/data");
|
|
19
|
-
|
|
20
13
|
var _blockEditor = require("@wordpress/block-editor");
|
|
21
|
-
|
|
22
14
|
var _i18n = require("@wordpress/i18n");
|
|
23
|
-
|
|
24
15
|
var _preferences = require("@wordpress/preferences");
|
|
25
|
-
|
|
26
16
|
var _icons = require("@wordpress/icons");
|
|
27
|
-
|
|
28
17
|
var _coreData = require("@wordpress/core-data");
|
|
29
|
-
|
|
30
18
|
var _screenRoot = _interopRequireDefault(require("./screen-root"));
|
|
31
|
-
|
|
32
19
|
var _screenBlockList = _interopRequireWildcard(require("./screen-block-list"));
|
|
33
|
-
|
|
34
20
|
var _screenBlock = _interopRequireDefault(require("./screen-block"));
|
|
35
|
-
|
|
36
21
|
var _screenTypography = _interopRequireDefault(require("./screen-typography"));
|
|
37
|
-
|
|
38
22
|
var _screenTypographyElement = _interopRequireDefault(require("./screen-typography-element"));
|
|
39
|
-
|
|
40
23
|
var _screenColors = _interopRequireDefault(require("./screen-colors"));
|
|
41
|
-
|
|
42
24
|
var _screenColorPalette = _interopRequireDefault(require("./screen-color-palette"));
|
|
43
|
-
|
|
44
25
|
var _screenLayout = _interopRequireDefault(require("./screen-layout"));
|
|
45
|
-
|
|
46
26
|
var _screenStyleVariations = _interopRequireDefault(require("./screen-style-variations"));
|
|
47
|
-
|
|
48
27
|
var _styleBook = _interopRequireDefault(require("../style-book"));
|
|
49
|
-
|
|
50
28
|
var _screenCss = _interopRequireDefault(require("./screen-css"));
|
|
51
|
-
|
|
52
29
|
var _screenRevisions = _interopRequireDefault(require("./screen-revisions"));
|
|
53
|
-
|
|
54
30
|
var _lockUnlock = require("../../lock-unlock");
|
|
55
|
-
|
|
56
31
|
var _store = require("../../store");
|
|
57
|
-
|
|
58
32
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
59
|
-
|
|
60
33
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
61
|
-
|
|
62
34
|
/**
|
|
63
35
|
* External dependencies
|
|
64
36
|
*/
|
|
@@ -70,13 +42,13 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
70
42
|
/**
|
|
71
43
|
* Internal dependencies
|
|
72
44
|
*/
|
|
45
|
+
|
|
73
46
|
const SLOT_FILL_NAME = 'GlobalStylesMenu';
|
|
74
47
|
const {
|
|
75
48
|
Slot: GlobalStylesMenuSlot,
|
|
76
49
|
Fill: GlobalStylesMenuFill
|
|
77
50
|
} = (0, _components.createSlotFill)(SLOT_FILL_NAME);
|
|
78
51
|
exports.GlobalStylesMenuSlot = GlobalStylesMenuSlot;
|
|
79
|
-
|
|
80
52
|
function GlobalStylesActionMenu() {
|
|
81
53
|
const {
|
|
82
54
|
toggle
|
|
@@ -85,14 +57,11 @@ function GlobalStylesActionMenu() {
|
|
|
85
57
|
canEditCSS
|
|
86
58
|
} = (0, _data.useSelect)(select => {
|
|
87
59
|
var _globalStyles$_links$;
|
|
88
|
-
|
|
89
60
|
const {
|
|
90
61
|
getEntityRecord,
|
|
91
62
|
__experimentalGetCurrentGlobalStylesId
|
|
92
63
|
} = select(_coreData.store);
|
|
93
|
-
|
|
94
64
|
const globalStylesId = __experimentalGetCurrentGlobalStylesId();
|
|
95
|
-
|
|
96
65
|
const globalStyles = globalStylesId ? getEntityRecord('root', 'globalStyles', globalStylesId) : undefined;
|
|
97
66
|
return {
|
|
98
67
|
canEditCSS: (_globalStyles$_links$ = !!globalStyles?._links?.['wp:action-edit-css']) !== null && _globalStyles$_links$ !== void 0 ? _globalStyles$_links$ : false
|
|
@@ -101,9 +70,7 @@ function GlobalStylesActionMenu() {
|
|
|
101
70
|
const {
|
|
102
71
|
goTo
|
|
103
72
|
} = (0, _components.__experimentalUseNavigator)();
|
|
104
|
-
|
|
105
73
|
const loadCustomCSS = () => goTo('/css');
|
|
106
|
-
|
|
107
74
|
return (0, _element.createElement)(GlobalStylesMenuFill, null, (0, _element.createElement)(_components.DropdownMenu, {
|
|
108
75
|
icon: _icons.moreVertical,
|
|
109
76
|
label: (0, _i18n.__)('More')
|
|
@@ -118,7 +85,6 @@ function GlobalStylesActionMenu() {
|
|
|
118
85
|
}
|
|
119
86
|
}, (0, _i18n.__)('Welcome Guide')))));
|
|
120
87
|
}
|
|
121
|
-
|
|
122
88
|
function RevisionsCountBadge({
|
|
123
89
|
className,
|
|
124
90
|
children
|
|
@@ -127,7 +93,6 @@ function RevisionsCountBadge({
|
|
|
127
93
|
className: (0, _classnames.default)(className, 'edit-site-global-styles-sidebar__revisions-count-badge')
|
|
128
94
|
}, children);
|
|
129
95
|
}
|
|
130
|
-
|
|
131
96
|
function GlobalStylesRevisionsMenu() {
|
|
132
97
|
const {
|
|
133
98
|
setIsListViewOpened
|
|
@@ -136,14 +101,11 @@ function GlobalStylesRevisionsMenu() {
|
|
|
136
101
|
revisionsCount
|
|
137
102
|
} = (0, _data.useSelect)(select => {
|
|
138
103
|
var _globalStyles$_links$2;
|
|
139
|
-
|
|
140
104
|
const {
|
|
141
105
|
getEntityRecord,
|
|
142
106
|
__experimentalGetCurrentGlobalStylesId
|
|
143
107
|
} = select(_coreData.store);
|
|
144
|
-
|
|
145
108
|
const globalStylesId = __experimentalGetCurrentGlobalStylesId();
|
|
146
|
-
|
|
147
109
|
const globalStyles = globalStylesId ? getEntityRecord('root', 'globalStyles', globalStylesId) : undefined;
|
|
148
110
|
return {
|
|
149
111
|
revisionsCount: (_globalStyles$_links$2 = globalStyles?._links?.['version-history']?.[0]?.count) !== null && _globalStyles$_links$2 !== void 0 ? _globalStyles$_links$2 : 0
|
|
@@ -159,14 +121,12 @@ function GlobalStylesRevisionsMenu() {
|
|
|
159
121
|
const {
|
|
160
122
|
setEditorCanvasContainerView
|
|
161
123
|
} = (0, _lockUnlock.unlock)((0, _data.useDispatch)(_store.store));
|
|
162
|
-
|
|
163
124
|
const loadRevisions = () => {
|
|
164
125
|
setIsListViewOpened(false);
|
|
165
126
|
goTo('/revisions');
|
|
166
127
|
setEditorCanvasContainerView('global-styles-revisions');
|
|
167
128
|
};
|
|
168
|
-
|
|
169
|
-
const hasRevisions = revisionsCount >= 2;
|
|
129
|
+
const hasRevisions = revisionsCount > 0;
|
|
170
130
|
return (0, _element.createElement)(GlobalStylesMenuFill, null, canReset || hasRevisions ? (0, _element.createElement)(_components.DropdownMenu, {
|
|
171
131
|
icon: _icons.backup,
|
|
172
132
|
label: (0, _i18n.__)('Revisions')
|
|
@@ -188,7 +148,6 @@ function GlobalStylesRevisionsMenu() {
|
|
|
188
148
|
__experimentalIsFocusable: true
|
|
189
149
|
}));
|
|
190
150
|
}
|
|
191
|
-
|
|
192
151
|
function GlobalStylesNavigationScreen({
|
|
193
152
|
className,
|
|
194
153
|
...props
|
|
@@ -198,7 +157,6 @@ function GlobalStylesNavigationScreen({
|
|
|
198
157
|
...props
|
|
199
158
|
});
|
|
200
159
|
}
|
|
201
|
-
|
|
202
160
|
function BlockStylesNavigationScreens({
|
|
203
161
|
parentMenu,
|
|
204
162
|
blockStyles,
|
|
@@ -212,7 +170,6 @@ function BlockStylesNavigationScreens({
|
|
|
212
170
|
variation: style.name
|
|
213
171
|
})));
|
|
214
172
|
}
|
|
215
|
-
|
|
216
173
|
function ContextScreens({
|
|
217
174
|
name,
|
|
218
175
|
parentMenu = ''
|
|
@@ -233,14 +190,14 @@ function ContextScreens({
|
|
|
233
190
|
blockName: name
|
|
234
191
|
}));
|
|
235
192
|
}
|
|
236
|
-
|
|
237
193
|
function GlobalStylesStyleBook() {
|
|
238
194
|
const navigator = (0, _components.__experimentalUseNavigator)();
|
|
239
195
|
const {
|
|
240
196
|
path
|
|
241
197
|
} = navigator.location;
|
|
242
198
|
return (0, _element.createElement)(_styleBook.default, {
|
|
243
|
-
isSelected: blockName =>
|
|
199
|
+
isSelected: blockName =>
|
|
200
|
+
// Match '/blocks/core%2Fbutton' and
|
|
244
201
|
// '/blocks/core%2Fbutton/typography', but not
|
|
245
202
|
// '/blocks/core%2Fbuttons'.
|
|
246
203
|
path === `/blocks/${encodeURIComponent(blockName)}` || path.startsWith(`/blocks/${encodeURIComponent(blockName)}/`),
|
|
@@ -250,7 +207,6 @@ function GlobalStylesStyleBook() {
|
|
|
250
207
|
}
|
|
251
208
|
});
|
|
252
209
|
}
|
|
253
|
-
|
|
254
210
|
function GlobalStylesBlockLink() {
|
|
255
211
|
const navigator = (0, _components.__experimentalUseNavigator)();
|
|
256
212
|
const {
|
|
@@ -267,22 +223,19 @@ function GlobalStylesBlockLink() {
|
|
|
267
223
|
selectedBlockClientId: clientId
|
|
268
224
|
};
|
|
269
225
|
}, []);
|
|
270
|
-
const blockHasGlobalStyles = (0, _screenBlockList.useBlockHasGlobalStyles)(selectedBlockName);
|
|
271
|
-
|
|
226
|
+
const blockHasGlobalStyles = (0, _screenBlockList.useBlockHasGlobalStyles)(selectedBlockName);
|
|
227
|
+
// When we're in the `Blocks` screen enable deep linking to the selected block.
|
|
272
228
|
(0, _element.useEffect)(() => {
|
|
273
229
|
if (!selectedBlockClientId || !blockHasGlobalStyles) {
|
|
274
230
|
return;
|
|
275
231
|
}
|
|
276
|
-
|
|
277
232
|
const currentPath = navigator.location.path;
|
|
278
|
-
|
|
279
233
|
if (currentPath !== '/blocks' && !currentPath.startsWith('/blocks/')) {
|
|
280
234
|
return;
|
|
281
235
|
}
|
|
282
|
-
|
|
283
|
-
|
|
236
|
+
const newPath = '/blocks/' + encodeURIComponent(selectedBlockName);
|
|
237
|
+
// Avoid navigating to the same path. This can happen when selecting
|
|
284
238
|
// a new block of the same type.
|
|
285
|
-
|
|
286
239
|
if (newPath !== currentPath) {
|
|
287
240
|
navigator.goTo(newPath, {
|
|
288
241
|
skipFocus: true
|
|
@@ -290,16 +243,16 @@ function GlobalStylesBlockLink() {
|
|
|
290
243
|
}
|
|
291
244
|
}, [selectedBlockClientId, selectedBlockName, blockHasGlobalStyles]);
|
|
292
245
|
}
|
|
293
|
-
|
|
294
246
|
function GlobalStylesEditorCanvasContainerLink() {
|
|
295
247
|
const {
|
|
296
248
|
goTo,
|
|
297
249
|
location
|
|
298
250
|
} = (0, _components.__experimentalUseNavigator)();
|
|
299
|
-
const editorCanvasContainerView = (0, _data.useSelect)(select => (0, _lockUnlock.unlock)(select(_store.store)).getEditorCanvasContainerView(), []);
|
|
251
|
+
const editorCanvasContainerView = (0, _data.useSelect)(select => (0, _lockUnlock.unlock)(select(_store.store)).getEditorCanvasContainerView(), []);
|
|
252
|
+
|
|
253
|
+
// If the user switches the editor canvas container view, redirect
|
|
300
254
|
// to the appropriate screen. This effectively allows deep linking to the
|
|
301
255
|
// desired screens from outside the global styles navigation provider.
|
|
302
|
-
|
|
303
256
|
(0, _element.useEffect)(() => {
|
|
304
257
|
if (editorCanvasContainerView === 'global-styles-revisions') {
|
|
305
258
|
// Switching to the revisions container view should
|
|
@@ -311,14 +264,14 @@ function GlobalStylesEditorCanvasContainerLink() {
|
|
|
311
264
|
goTo('/');
|
|
312
265
|
} else if (editorCanvasContainerView === 'global-styles-css') {
|
|
313
266
|
goTo('/css');
|
|
314
|
-
}
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
// location?.path is not a dependency because we don't want to track it.
|
|
315
270
|
// Doing so will cause an infinite loop. We could abstract logic to avoid
|
|
316
271
|
// having to disable the check later.
|
|
317
272
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
318
|
-
|
|
319
273
|
}, [editorCanvasContainerView, goTo]);
|
|
320
274
|
}
|
|
321
|
-
|
|
322
275
|
function GlobalStylesUI() {
|
|
323
276
|
const blocks = (0, _blocks.getBlockTypes)();
|
|
324
277
|
const editorCanvasContainerView = (0, _data.useSelect)(select => (0, _lockUnlock.unlock)(select(_store.store)).getEditorCanvasContainerView(), []);
|
|
@@ -372,7 +325,6 @@ function GlobalStylesUI() {
|
|
|
372
325
|
parentMenu: '/blocks/' + encodeURIComponent(block.name)
|
|
373
326
|
})), 'style-book' === editorCanvasContainerView && (0, _element.createElement)(GlobalStylesStyleBook, null), (0, _element.createElement)(GlobalStylesRevisionsMenu, null), (0, _element.createElement)(GlobalStylesActionMenu, null), (0, _element.createElement)(GlobalStylesBlockLink, null), (0, _element.createElement)(GlobalStylesEditorCanvasContainerLink, null));
|
|
374
327
|
}
|
|
375
|
-
|
|
376
328
|
var _default = GlobalStylesUI;
|
|
377
329
|
exports.default = _default;
|
|
378
330
|
//# sourceMappingURL=ui.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/ui.js"],"names":["SLOT_FILL_NAME","Slot","GlobalStylesMenuSlot","Fill","GlobalStylesMenuFill","GlobalStylesActionMenu","toggle","preferencesStore","canEditCSS","select","getEntityRecord","__experimentalGetCurrentGlobalStylesId","coreStore","globalStylesId","globalStyles","undefined","_links","goTo","loadCustomCSS","moreVertical","onClose","RevisionsCountBadge","className","children","GlobalStylesRevisionsMenu","setIsListViewOpened","editSiteStore","revisionsCount","count","useGlobalStylesReset","blockEditorPrivateApis","canReset","onReset","setEditorCanvasContainerView","loadRevisions","hasRevisions","backup","GlobalStylesNavigationScreen","props","filter","Boolean","join","BlockStylesNavigationScreens","parentMenu","blockStyles","blockName","map","style","index","name","ContextScreens","blockStyleVariations","getBlockStyles","blocksStore","length","GlobalStylesStyleBook","navigator","path","location","encodeURIComponent","startsWith","GlobalStylesBlockLink","selectedBlockName","selectedBlockClientId","getSelectedBlockClientId","getBlockName","blockEditorStore","clientId","blockHasGlobalStyles","currentPath","newPath","skipFocus","GlobalStylesEditorCanvasContainerLink","editorCanvasContainerView","getEditorCanvasContainerView","GlobalStylesUI","blocks","block"],"mappings":";;;;;;;;;AA4BA;;AAzBA;;AAKA;;AAUA;;AACA;;AACA;;AAIA;;AACA;;AACA;;AACA;;AAMA;;AACA;;AAIA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAjDA;AACA;AACA;;AAGA;AACA;AACA;;AAuBA;AACA;AACA;AAmBA,MAAMA,cAAc,GAAG,kBAAvB;AACA,MAAM;AAAEC,EAAAA,IAAI,EAAEC,oBAAR;AAA8BC,EAAAA,IAAI,EAAEC;AAApC,IACL,gCAAgBJ,cAAhB,CADD;;;AAGA,SAASK,sBAAT,GAAkC;AACjC,QAAM;AAAEC,IAAAA;AAAF,MAAa,uBAAaC,kBAAb,CAAnB;AACA,QAAM;AAAEC,IAAAA;AAAF,MAAiB,qBAAaC,MAAF,IAAc;AAAA;;AAC/C,UAAM;AAAEC,MAAAA,eAAF;AAAmBC,MAAAA;AAAnB,QACLF,MAAM,CAAEG,eAAF,CADP;;AAGA,UAAMC,cAAc,GAAGF,sCAAsC,EAA7D;;AACA,UAAMG,YAAY,GAAGD,cAAc,GAChCH,eAAe,CAAE,MAAF,EAAU,cAAV,EAA0BG,cAA1B,CADiB,GAEhCE,SAFH;AAIA,WAAO;AACNP,MAAAA,UAAU,2BACT,CAAC,CAAEM,YAAY,EAAEE,MAAd,GAAwB,oBAAxB,CADM,yEAC4C;AAFhD,KAAP;AAIA,GAbsB,EAapB,EAboB,CAAvB;AAcA,QAAM;AAAEC,IAAAA;AAAF,MAAW,6CAAjB;;AACA,QA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wDGE,MAAM,CAAC9B,GAAP,CAAc+B,KAAF,IACb,4BAAC,4BAAD;AACC,IAAA,GAAG,EAAG,gBAAgBA,KAAK,CAAC5B,IAD7B;AAEC,IAAA,IAAI,EAAG,aAAaU,kBAAkB,CAAEkB,KAAK,CAAC5B,IAAR;AAFvC,KAIC,4BAAC,oBAAD;AAAa,IAAA,IAAI,EAAG4B,KAAK,CAAC5B;AAA1B,IAJD,CADC,CAxDH,EAiEC,4BAAC,cAAD,OAjED,EAmEG2B,MAAM,CAAC9B,GAAP,CAAc+B,KAAF,IACb,4BAAC,cAAD;AACC,IAAA,GAAG,EAAG,mBAAmBA,KAAK,CAAC5B,IADhC;AAEC,IAAA,IAAI,EAAG4B,KAAK,CAAC5B,IAFd;AAGC,IAAA,UAAU,EAAG,aAAaU,kBAAkB,CAAEkB,KAAK,CAAC5B,IAAR;AAH7C,IADC,CAnEH,EA2EG,iBAAiBwB,yBAAjB,IACD,4BAAC,qBAAD,OA5EF,EA+EC,4BAAC,yBAAD,OA/ED,EAgFC,4BAAC,sBAAD,OAhFD,EAiFC,4BAAC,qBAAD,OAjFD,EAkFC,4BAAC,qCAAD,OAlFD,CADD;AAsFA;;eAEcE,c","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalNavigatorProvider as NavigatorProvider,\n\t__experimentalNavigatorScreen as NavigatorScreen,\n\t__experimentalUseNavigator as useNavigator,\n\tcreateSlotFill,\n\tButton,\n\tDropdownMenu,\n\tMenuGroup,\n\tMenuItem,\n} from '@wordpress/components';\nimport { getBlockTypes, store as blocksStore } from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { backup, moreVertical } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport ScreenRoot from './screen-root';\nimport {\n\tuseBlockHasGlobalStyles,\n\tdefault as ScreenBlockList,\n} from './screen-block-list';\nimport ScreenBlock from './screen-block';\nimport ScreenTypography from './screen-typography';\nimport ScreenTypographyElement from './screen-typography-element';\nimport ScreenColors from './screen-colors';\nimport ScreenColorPalette from './screen-color-palette';\nimport ScreenLayout from './screen-layout';\nimport ScreenStyleVariations from './screen-style-variations';\nimport StyleBook from '../style-book';\nimport ScreenCSS from './screen-css';\nimport ScreenRevisions from './screen-revisions';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\n\nconst SLOT_FILL_NAME = 'GlobalStylesMenu';\nconst { Slot: GlobalStylesMenuSlot, Fill: GlobalStylesMenuFill } =\n\tcreateSlotFill( SLOT_FILL_NAME );\n\nfunction GlobalStylesActionMenu() {\n\tconst { toggle } = useDispatch( preferencesStore );\n\tconst { canEditCSS } = useSelect( ( select ) => {\n\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\tselect( coreStore );\n\n\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\tconst globalStyles = globalStylesId\n\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\tcanEditCSS:\n\t\t\t\t!! globalStyles?._links?.[ 'wp:action-edit-css' ] ?? false,\n\t\t};\n\t}, [] );\n\tconst { goTo } = useNavigator();\n\tconst loadCustomCSS = () => goTo( '/css' );\n\n\treturn (\n\t\t<GlobalStylesMenuFill>\n\t\t\t<DropdownMenu icon={ moreVertical } label={ __( 'More' ) }>\n\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t{ canEditCSS && (\n\t\t\t\t\t\t\t<MenuItem onClick={ loadCustomCSS }>\n\t\t\t\t\t\t\t\t{ __( 'Additional CSS' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\ttoggle(\n\t\t\t\t\t\t\t\t\t'core/edit-site',\n\t\t\t\t\t\t\t\t\t'welcomeGuideStyles'\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Welcome Guide' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t</MenuGroup>\n\t\t\t\t) }\n\t\t\t</DropdownMenu>\n\t\t</GlobalStylesMenuFill>\n\t);\n}\n\nfunction RevisionsCountBadge( { className, children } ) {\n\treturn (\n\t\t<span\n\t\t\tclassName={ classnames(\n\t\t\t\tclassName,\n\t\t\t\t'edit-site-global-styles-sidebar__revisions-count-badge'\n\t\t\t) }\n\t\t>\n\t\t\t{ children }\n\t\t</span>\n\t);\n}\nfunction GlobalStylesRevisionsMenu() {\n\tconst { setIsListViewOpened } = useDispatch( editSiteStore );\n\tconst { revisionsCount } = useSelect( ( select ) => {\n\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\tselect( coreStore );\n\n\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\tconst globalStyles = globalStylesId\n\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\trevisionsCount:\n\t\t\t\tglobalStyles?._links?.[ 'version-history' ]?.[ 0 ]?.count ?? 0,\n\t\t};\n\t}, [] );\n\tconst { useGlobalStylesReset } = unlock( blockEditorPrivateApis );\n\tconst [ canReset, onReset ] = useGlobalStylesReset();\n\tconst { goTo } = useNavigator();\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst loadRevisions = () => {\n\t\tsetIsListViewOpened( false );\n\t\tgoTo( '/revisions' );\n\t\tsetEditorCanvasContainerView( 'global-styles-revisions' );\n\t};\n\tconst hasRevisions = revisionsCount >= 2;\n\n\treturn (\n\t\t<GlobalStylesMenuFill>\n\t\t\t{ canReset || hasRevisions ? (\n\t\t\t\t<DropdownMenu icon={ backup } label={ __( 'Revisions' ) }>\n\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t{ hasRevisions && (\n\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\tonClick={ loadRevisions }\n\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t<RevisionsCountBadge>\n\t\t\t\t\t\t\t\t\t\t\t{ revisionsCount }\n\t\t\t\t\t\t\t\t\t\t</RevisionsCountBadge>\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\t\t{ __( 'Revision history' ) }\n\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tonReset();\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tdisabled={ ! canReset }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Reset to defaults' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t) }\n\t\t\t\t</DropdownMenu>\n\t\t\t) : (\n\t\t\t\t<Button\n\t\t\t\t\tlabel={ __( 'Revisions' ) }\n\t\t\t\t\ticon={ backup }\n\t\t\t\t\tdisabled\n\t\t\t\t\t__experimentalIsFocusable\n\t\t\t\t/>\n\t\t\t) }\n\t\t</GlobalStylesMenuFill>\n\t);\n}\n\nfunction GlobalStylesNavigationScreen( { className, ...props } ) {\n\treturn (\n\t\t<NavigatorScreen\n\t\t\tclassName={ [\n\t\t\t\t'edit-site-global-styles-sidebar__navigator-screen',\n\t\t\t\tclassName,\n\t\t\t]\n\t\t\t\t.filter( Boolean )\n\t\t\t\t.join( ' ' ) }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nfunction BlockStylesNavigationScreens( {\n\tparentMenu,\n\tblockStyles,\n\tblockName,\n} ) {\n\treturn blockStyles.map( ( style, index ) => (\n\t\t<GlobalStylesNavigationScreen\n\t\t\tkey={ index }\n\t\t\tpath={ parentMenu + '/variations/' + style.name }\n\t\t>\n\t\t\t<ScreenBlock name={ blockName } variation={ style.name } />\n\t\t</GlobalStylesNavigationScreen>\n\t) );\n}\n\nfunction ContextScreens( { name, parentMenu = '' } ) {\n\tconst blockStyleVariations = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockStyles } = select( blocksStore );\n\t\t\treturn getBlockStyles( name );\n\t\t},\n\t\t[ name ]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<GlobalStylesNavigationScreen\n\t\t\t\tpath={ parentMenu + '/colors/palette' }\n\t\t\t>\n\t\t\t\t<ScreenColorPalette name={ name } />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t{ !! blockStyleVariations?.length && (\n\t\t\t\t<BlockStylesNavigationScreens\n\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\tblockStyles={ blockStyleVariations }\n\t\t\t\t\tblockName={ name }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nfunction GlobalStylesStyleBook() {\n\tconst navigator = useNavigator();\n\tconst { path } = navigator.location;\n\treturn (\n\t\t<StyleBook\n\t\t\tisSelected={ ( blockName ) =>\n\t\t\t\t// Match '/blocks/core%2Fbutton' and\n\t\t\t\t// '/blocks/core%2Fbutton/typography', but not\n\t\t\t\t// '/blocks/core%2Fbuttons'.\n\t\t\t\tpath === `/blocks/${ encodeURIComponent( blockName ) }` ||\n\t\t\t\tpath.startsWith(\n\t\t\t\t\t`/blocks/${ encodeURIComponent( blockName ) }/`\n\t\t\t\t)\n\t\t\t}\n\t\t\tonSelect={ ( blockName ) => {\n\t\t\t\t// Now go to the selected block.\n\t\t\t\tnavigator.goTo( '/blocks/' + encodeURIComponent( blockName ) );\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nfunction GlobalStylesBlockLink() {\n\tconst navigator = useNavigator();\n\tconst { selectedBlockName, selectedBlockClientId } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getSelectedBlockClientId, getBlockName } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst clientId = getSelectedBlockClientId();\n\t\t\treturn {\n\t\t\t\tselectedBlockName: getBlockName( clientId ),\n\t\t\t\tselectedBlockClientId: clientId,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst blockHasGlobalStyles = useBlockHasGlobalStyles( selectedBlockName );\n\t// When we're in the `Blocks` screen enable deep linking to the selected block.\n\tuseEffect( () => {\n\t\tif ( ! selectedBlockClientId || ! blockHasGlobalStyles ) {\n\t\t\treturn;\n\t\t}\n\t\tconst currentPath = navigator.location.path;\n\t\tif (\n\t\t\tcurrentPath !== '/blocks' &&\n\t\t\t! currentPath.startsWith( '/blocks/' )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tconst newPath = '/blocks/' + encodeURIComponent( selectedBlockName );\n\t\t// Avoid navigating to the same path. This can happen when selecting\n\t\t// a new block of the same type.\n\t\tif ( newPath !== currentPath ) {\n\t\t\tnavigator.goTo( newPath, { skipFocus: true } );\n\t\t}\n\t}, [ selectedBlockClientId, selectedBlockName, blockHasGlobalStyles ] );\n}\n\nfunction GlobalStylesEditorCanvasContainerLink() {\n\tconst { goTo, location } = useNavigator();\n\tconst editorCanvasContainerView = useSelect(\n\t\t( select ) =>\n\t\t\tunlock( select( editSiteStore ) ).getEditorCanvasContainerView(),\n\t\t[]\n\t);\n\n\t// If the user switches the editor canvas container view, redirect\n\t// to the appropriate screen. This effectively allows deep linking to the\n\t// desired screens from outside the global styles navigation provider.\n\tuseEffect( () => {\n\t\tif ( editorCanvasContainerView === 'global-styles-revisions' ) {\n\t\t\t// Switching to the revisions container view should\n\t\t\t// redirect to the revisions screen.\n\t\t\tgoTo( '/revisions' );\n\t\t} else if (\n\t\t\t!! editorCanvasContainerView &&\n\t\t\tlocation?.path === '/revisions'\n\t\t) {\n\t\t\t// Switching to any container other than revisions should\n\t\t\t// redirect from the revisions screen to the root global styles screen.\n\t\t\tgoTo( '/' );\n\t\t} else if ( editorCanvasContainerView === 'global-styles-css' ) {\n\t\t\tgoTo( '/css' );\n\t\t}\n\n\t\t// location?.path is not a dependency because we don't want to track it.\n\t\t// Doing so will cause an infinite loop. We could abstract logic to avoid\n\t\t// having to disable the check later.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ editorCanvasContainerView, goTo ] );\n}\n\nfunction GlobalStylesUI() {\n\tconst blocks = getBlockTypes();\n\tconst editorCanvasContainerView = useSelect(\n\t\t( select ) =>\n\t\t\tunlock( select( editSiteStore ) ).getEditorCanvasContainerView(),\n\t\t[]\n\t);\n\treturn (\n\t\t<NavigatorProvider\n\t\t\tclassName=\"edit-site-global-styles-sidebar__navigator-provider\"\n\t\t\tinitialPath=\"/\"\n\t\t>\n\t\t\t<GlobalStylesNavigationScreen path=\"/\">\n\t\t\t\t<ScreenRoot />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/variations\">\n\t\t\t\t<ScreenStyleVariations />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/blocks\">\n\t\t\t\t<ScreenBlockList />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography\">\n\t\t\t\t<ScreenTypography />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/text\">\n\t\t\t\t<ScreenTypographyElement element=\"text\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/link\">\n\t\t\t\t<ScreenTypographyElement element=\"link\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/heading\">\n\t\t\t\t<ScreenTypographyElement element=\"heading\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/caption\">\n\t\t\t\t<ScreenTypographyElement element=\"caption\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/button\">\n\t\t\t\t<ScreenTypographyElement element=\"button\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/colors\">\n\t\t\t\t<ScreenColors />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/layout\">\n\t\t\t\t<ScreenLayout />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/css\">\n\t\t\t\t<ScreenCSS />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path={ '/revisions' }>\n\t\t\t\t<ScreenRevisions />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t{ blocks.map( ( block ) => (\n\t\t\t\t<GlobalStylesNavigationScreen\n\t\t\t\t\tkey={ 'menu-block-' + block.name }\n\t\t\t\t\tpath={ '/blocks/' + encodeURIComponent( block.name ) }\n\t\t\t\t>\n\t\t\t\t\t<ScreenBlock name={ block.name } />\n\t\t\t\t</GlobalStylesNavigationScreen>\n\t\t\t) ) }\n\n\t\t\t<ContextScreens />\n\n\t\t\t{ blocks.map( ( block ) => (\n\t\t\t\t<ContextScreens\n\t\t\t\t\tkey={ 'screens-block-' + block.name }\n\t\t\t\t\tname={ block.name }\n\t\t\t\t\tparentMenu={ '/blocks/' + encodeURIComponent( block.name ) }\n\t\t\t\t/>\n\t\t\t) ) }\n\n\t\t\t{ 'style-book' === editorCanvasContainerView && (\n\t\t\t\t<GlobalStylesStyleBook />\n\t\t\t) }\n\n\t\t\t<GlobalStylesRevisionsMenu />\n\t\t\t<GlobalStylesActionMenu />\n\t\t\t<GlobalStylesBlockLink />\n\t\t\t<GlobalStylesEditorCanvasContainerLink />\n\t\t</NavigatorProvider>\n\t);\n}\nexport { GlobalStylesMenuSlot };\nexport default GlobalStylesUI;\n"]}
|
|
1
|
+
{"version":3,"names":["_element","require","_classnames","_interopRequireDefault","_components","_blocks","_data","_blockEditor","_i18n","_preferences","_icons","_coreData","_screenRoot","_screenBlockList","_interopRequireWildcard","_screenBlock","_screenTypography","_screenTypographyElement","_screenColors","_screenColorPalette","_screenLayout","_screenStyleVariations","_styleBook","_screenCss","_screenRevisions","_lockUnlock","_store","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","SLOT_FILL_NAME","Slot","GlobalStylesMenuSlot","Fill","GlobalStylesMenuFill","createSlotFill","exports","GlobalStylesActionMenu","toggle","useDispatch","preferencesStore","canEditCSS","useSelect","select","_globalStyles$_links$","getEntityRecord","__experimentalGetCurrentGlobalStylesId","coreStore","globalStylesId","globalStyles","undefined","_links","goTo","useNavigator","loadCustomCSS","createElement","DropdownMenu","icon","moreVertical","label","__","onClose","MenuGroup","MenuItem","onClick","RevisionsCountBadge","className","children","classnames","GlobalStylesRevisionsMenu","setIsListViewOpened","editSiteStore","revisionsCount","_globalStyles$_links$2","count","useGlobalStylesReset","unlock","blockEditorPrivateApis","canReset","onReset","setEditorCanvasContainerView","loadRevisions","hasRevisions","backup","disabled","Button","__experimentalIsFocusable","GlobalStylesNavigationScreen","props","__experimentalNavigatorScreen","filter","Boolean","join","BlockStylesNavigationScreens","parentMenu","blockStyles","blockName","map","style","index","path","name","variation","ContextScreens","blockStyleVariations","getBlockStyles","blocksStore","Fragment","length","GlobalStylesStyleBook","navigator","location","isSelected","encodeURIComponent","startsWith","onSelect","GlobalStylesBlockLink","selectedBlockName","selectedBlockClientId","getSelectedBlockClientId","getBlockName","blockEditorStore","clientId","blockHasGlobalStyles","useBlockHasGlobalStyles","useEffect","currentPath","newPath","skipFocus","GlobalStylesEditorCanvasContainerLink","editorCanvasContainerView","getEditorCanvasContainerView","GlobalStylesUI","blocks","getBlockTypes","__experimentalNavigatorProvider","initialPath","element","block","_default"],"sources":["@wordpress/edit-site/src/components/global-styles/ui.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalNavigatorProvider as NavigatorProvider,\n\t__experimentalNavigatorScreen as NavigatorScreen,\n\t__experimentalUseNavigator as useNavigator,\n\tcreateSlotFill,\n\tButton,\n\tDropdownMenu,\n\tMenuGroup,\n\tMenuItem,\n} from '@wordpress/components';\nimport { getBlockTypes, store as blocksStore } from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { backup, moreVertical } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport ScreenRoot from './screen-root';\nimport {\n\tuseBlockHasGlobalStyles,\n\tdefault as ScreenBlockList,\n} from './screen-block-list';\nimport ScreenBlock from './screen-block';\nimport ScreenTypography from './screen-typography';\nimport ScreenTypographyElement from './screen-typography-element';\nimport ScreenColors from './screen-colors';\nimport ScreenColorPalette from './screen-color-palette';\nimport ScreenLayout from './screen-layout';\nimport ScreenStyleVariations from './screen-style-variations';\nimport StyleBook from '../style-book';\nimport ScreenCSS from './screen-css';\nimport ScreenRevisions from './screen-revisions';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\n\nconst SLOT_FILL_NAME = 'GlobalStylesMenu';\nconst { Slot: GlobalStylesMenuSlot, Fill: GlobalStylesMenuFill } =\n\tcreateSlotFill( SLOT_FILL_NAME );\n\nfunction GlobalStylesActionMenu() {\n\tconst { toggle } = useDispatch( preferencesStore );\n\tconst { canEditCSS } = useSelect( ( select ) => {\n\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\tselect( coreStore );\n\n\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\tconst globalStyles = globalStylesId\n\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\tcanEditCSS:\n\t\t\t\t!! globalStyles?._links?.[ 'wp:action-edit-css' ] ?? false,\n\t\t};\n\t}, [] );\n\tconst { goTo } = useNavigator();\n\tconst loadCustomCSS = () => goTo( '/css' );\n\n\treturn (\n\t\t<GlobalStylesMenuFill>\n\t\t\t<DropdownMenu icon={ moreVertical } label={ __( 'More' ) }>\n\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t{ canEditCSS && (\n\t\t\t\t\t\t\t<MenuItem onClick={ loadCustomCSS }>\n\t\t\t\t\t\t\t\t{ __( 'Additional CSS' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\ttoggle(\n\t\t\t\t\t\t\t\t\t'core/edit-site',\n\t\t\t\t\t\t\t\t\t'welcomeGuideStyles'\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Welcome Guide' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t</MenuGroup>\n\t\t\t\t) }\n\t\t\t</DropdownMenu>\n\t\t</GlobalStylesMenuFill>\n\t);\n}\n\nfunction RevisionsCountBadge( { className, children } ) {\n\treturn (\n\t\t<span\n\t\t\tclassName={ classnames(\n\t\t\t\tclassName,\n\t\t\t\t'edit-site-global-styles-sidebar__revisions-count-badge'\n\t\t\t) }\n\t\t>\n\t\t\t{ children }\n\t\t</span>\n\t);\n}\nfunction GlobalStylesRevisionsMenu() {\n\tconst { setIsListViewOpened } = useDispatch( editSiteStore );\n\tconst { revisionsCount } = useSelect( ( select ) => {\n\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\tselect( coreStore );\n\n\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\tconst globalStyles = globalStylesId\n\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\trevisionsCount:\n\t\t\t\tglobalStyles?._links?.[ 'version-history' ]?.[ 0 ]?.count ?? 0,\n\t\t};\n\t}, [] );\n\tconst { useGlobalStylesReset } = unlock( blockEditorPrivateApis );\n\tconst [ canReset, onReset ] = useGlobalStylesReset();\n\tconst { goTo } = useNavigator();\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst loadRevisions = () => {\n\t\tsetIsListViewOpened( false );\n\t\tgoTo( '/revisions' );\n\t\tsetEditorCanvasContainerView( 'global-styles-revisions' );\n\t};\n\tconst hasRevisions = revisionsCount > 0;\n\n\treturn (\n\t\t<GlobalStylesMenuFill>\n\t\t\t{ canReset || hasRevisions ? (\n\t\t\t\t<DropdownMenu icon={ backup } label={ __( 'Revisions' ) }>\n\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t{ hasRevisions && (\n\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\tonClick={ loadRevisions }\n\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t<RevisionsCountBadge>\n\t\t\t\t\t\t\t\t\t\t\t{ revisionsCount }\n\t\t\t\t\t\t\t\t\t\t</RevisionsCountBadge>\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\t\t{ __( 'Revision history' ) }\n\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tonReset();\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tdisabled={ ! canReset }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Reset to defaults' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t) }\n\t\t\t\t</DropdownMenu>\n\t\t\t) : (\n\t\t\t\t<Button\n\t\t\t\t\tlabel={ __( 'Revisions' ) }\n\t\t\t\t\ticon={ backup }\n\t\t\t\t\tdisabled\n\t\t\t\t\t__experimentalIsFocusable\n\t\t\t\t/>\n\t\t\t) }\n\t\t</GlobalStylesMenuFill>\n\t);\n}\n\nfunction GlobalStylesNavigationScreen( { className, ...props } ) {\n\treturn (\n\t\t<NavigatorScreen\n\t\t\tclassName={ [\n\t\t\t\t'edit-site-global-styles-sidebar__navigator-screen',\n\t\t\t\tclassName,\n\t\t\t]\n\t\t\t\t.filter( Boolean )\n\t\t\t\t.join( ' ' ) }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nfunction BlockStylesNavigationScreens( {\n\tparentMenu,\n\tblockStyles,\n\tblockName,\n} ) {\n\treturn blockStyles.map( ( style, index ) => (\n\t\t<GlobalStylesNavigationScreen\n\t\t\tkey={ index }\n\t\t\tpath={ parentMenu + '/variations/' + style.name }\n\t\t>\n\t\t\t<ScreenBlock name={ blockName } variation={ style.name } />\n\t\t</GlobalStylesNavigationScreen>\n\t) );\n}\n\nfunction ContextScreens( { name, parentMenu = '' } ) {\n\tconst blockStyleVariations = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockStyles } = select( blocksStore );\n\t\t\treturn getBlockStyles( name );\n\t\t},\n\t\t[ name ]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<GlobalStylesNavigationScreen\n\t\t\t\tpath={ parentMenu + '/colors/palette' }\n\t\t\t>\n\t\t\t\t<ScreenColorPalette name={ name } />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t{ !! blockStyleVariations?.length && (\n\t\t\t\t<BlockStylesNavigationScreens\n\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\tblockStyles={ blockStyleVariations }\n\t\t\t\t\tblockName={ name }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nfunction GlobalStylesStyleBook() {\n\tconst navigator = useNavigator();\n\tconst { path } = navigator.location;\n\treturn (\n\t\t<StyleBook\n\t\t\tisSelected={ ( blockName ) =>\n\t\t\t\t// Match '/blocks/core%2Fbutton' and\n\t\t\t\t// '/blocks/core%2Fbutton/typography', but not\n\t\t\t\t// '/blocks/core%2Fbuttons'.\n\t\t\t\tpath === `/blocks/${ encodeURIComponent( blockName ) }` ||\n\t\t\t\tpath.startsWith(\n\t\t\t\t\t`/blocks/${ encodeURIComponent( blockName ) }/`\n\t\t\t\t)\n\t\t\t}\n\t\t\tonSelect={ ( blockName ) => {\n\t\t\t\t// Now go to the selected block.\n\t\t\t\tnavigator.goTo( '/blocks/' + encodeURIComponent( blockName ) );\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nfunction GlobalStylesBlockLink() {\n\tconst navigator = useNavigator();\n\tconst { selectedBlockName, selectedBlockClientId } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getSelectedBlockClientId, getBlockName } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst clientId = getSelectedBlockClientId();\n\t\t\treturn {\n\t\t\t\tselectedBlockName: getBlockName( clientId ),\n\t\t\t\tselectedBlockClientId: clientId,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst blockHasGlobalStyles = useBlockHasGlobalStyles( selectedBlockName );\n\t// When we're in the `Blocks` screen enable deep linking to the selected block.\n\tuseEffect( () => {\n\t\tif ( ! selectedBlockClientId || ! blockHasGlobalStyles ) {\n\t\t\treturn;\n\t\t}\n\t\tconst currentPath = navigator.location.path;\n\t\tif (\n\t\t\tcurrentPath !== '/blocks' &&\n\t\t\t! currentPath.startsWith( '/blocks/' )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tconst newPath = '/blocks/' + encodeURIComponent( selectedBlockName );\n\t\t// Avoid navigating to the same path. This can happen when selecting\n\t\t// a new block of the same type.\n\t\tif ( newPath !== currentPath ) {\n\t\t\tnavigator.goTo( newPath, { skipFocus: true } );\n\t\t}\n\t}, [ selectedBlockClientId, selectedBlockName, blockHasGlobalStyles ] );\n}\n\nfunction GlobalStylesEditorCanvasContainerLink() {\n\tconst { goTo, location } = useNavigator();\n\tconst editorCanvasContainerView = useSelect(\n\t\t( select ) =>\n\t\t\tunlock( select( editSiteStore ) ).getEditorCanvasContainerView(),\n\t\t[]\n\t);\n\n\t// If the user switches the editor canvas container view, redirect\n\t// to the appropriate screen. This effectively allows deep linking to the\n\t// desired screens from outside the global styles navigation provider.\n\tuseEffect( () => {\n\t\tif ( editorCanvasContainerView === 'global-styles-revisions' ) {\n\t\t\t// Switching to the revisions container view should\n\t\t\t// redirect to the revisions screen.\n\t\t\tgoTo( '/revisions' );\n\t\t} else if (\n\t\t\t!! editorCanvasContainerView &&\n\t\t\tlocation?.path === '/revisions'\n\t\t) {\n\t\t\t// Switching to any container other than revisions should\n\t\t\t// redirect from the revisions screen to the root global styles screen.\n\t\t\tgoTo( '/' );\n\t\t} else if ( editorCanvasContainerView === 'global-styles-css' ) {\n\t\t\tgoTo( '/css' );\n\t\t}\n\n\t\t// location?.path is not a dependency because we don't want to track it.\n\t\t// Doing so will cause an infinite loop. We could abstract logic to avoid\n\t\t// having to disable the check later.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ editorCanvasContainerView, goTo ] );\n}\n\nfunction GlobalStylesUI() {\n\tconst blocks = getBlockTypes();\n\tconst editorCanvasContainerView = useSelect(\n\t\t( select ) =>\n\t\t\tunlock( select( editSiteStore ) ).getEditorCanvasContainerView(),\n\t\t[]\n\t);\n\treturn (\n\t\t<NavigatorProvider\n\t\t\tclassName=\"edit-site-global-styles-sidebar__navigator-provider\"\n\t\t\tinitialPath=\"/\"\n\t\t>\n\t\t\t<GlobalStylesNavigationScreen path=\"/\">\n\t\t\t\t<ScreenRoot />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/variations\">\n\t\t\t\t<ScreenStyleVariations />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/blocks\">\n\t\t\t\t<ScreenBlockList />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography\">\n\t\t\t\t<ScreenTypography />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/text\">\n\t\t\t\t<ScreenTypographyElement element=\"text\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/link\">\n\t\t\t\t<ScreenTypographyElement element=\"link\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/heading\">\n\t\t\t\t<ScreenTypographyElement element=\"heading\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/caption\">\n\t\t\t\t<ScreenTypographyElement element=\"caption\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/typography/button\">\n\t\t\t\t<ScreenTypographyElement element=\"button\" />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/colors\">\n\t\t\t\t<ScreenColors />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/layout\">\n\t\t\t\t<ScreenLayout />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path=\"/css\">\n\t\t\t\t<ScreenCSS />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t<GlobalStylesNavigationScreen path={ '/revisions' }>\n\t\t\t\t<ScreenRevisions />\n\t\t\t</GlobalStylesNavigationScreen>\n\n\t\t\t{ blocks.map( ( block ) => (\n\t\t\t\t<GlobalStylesNavigationScreen\n\t\t\t\t\tkey={ 'menu-block-' + block.name }\n\t\t\t\t\tpath={ '/blocks/' + encodeURIComponent( block.name ) }\n\t\t\t\t>\n\t\t\t\t\t<ScreenBlock name={ block.name } />\n\t\t\t\t</GlobalStylesNavigationScreen>\n\t\t\t) ) }\n\n\t\t\t<ContextScreens />\n\n\t\t\t{ blocks.map( ( block ) => (\n\t\t\t\t<ContextScreens\n\t\t\t\t\tkey={ 'screens-block-' + block.name }\n\t\t\t\t\tname={ block.name }\n\t\t\t\t\tparentMenu={ '/blocks/' + encodeURIComponent( block.name ) }\n\t\t\t\t/>\n\t\t\t) ) }\n\n\t\t\t{ 'style-book' === editorCanvasContainerView && (\n\t\t\t\t<GlobalStylesStyleBook />\n\t\t\t) }\n\n\t\t\t<GlobalStylesRevisionsMenu />\n\t\t\t<GlobalStylesActionMenu />\n\t\t\t<GlobalStylesBlockLink />\n\t\t\t<GlobalStylesEditorCanvasContainerLink />\n\t\t</NavigatorProvider>\n\t);\n}\nexport { GlobalStylesMenuSlot };\nexport default GlobalStylesUI;\n"],"mapp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B,OAAA,GAAA4H,QAAA"}
|
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getVariationClassName = getVariationClassName;
|
|
7
|
-
|
|
8
7
|
/**
|
|
9
8
|
*
|
|
10
9
|
* @param {string} variation The variation name.
|
|
@@ -15,7 +14,6 @@ function getVariationClassName(variation) {
|
|
|
15
14
|
if (!variation) {
|
|
16
15
|
return '';
|
|
17
16
|
}
|
|
18
|
-
|
|
19
17
|
return `is-style-${variation}`;
|
|
20
18
|
}
|
|
21
19
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/utils.js"],"
|
|
1
|
+
{"version":3,"names":["getVariationClassName","variation"],"sources":["@wordpress/edit-site/src/components/global-styles/utils.js"],"sourcesContent":["/**\n *\n * @param {string} variation The variation name.\n *\n * @return {string} The variation class name.\n */\nexport function getVariationClassName( variation ) {\n\tif ( ! variation ) {\n\t\treturn '';\n\t}\n\treturn `is-style-${ variation }`;\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,qBAAqBA,CAAEC,SAAS,EAAG;EAClD,IAAK,CAAEA,SAAS,EAAG;IAClB,OAAO,EAAE;EACV;EACA,OAAQ,YAAYA,SAAW,EAAC;AACjC"}
|
|
@@ -5,17 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.VariationsPanel = VariationsPanel;
|
|
7
7
|
exports.useBlockVariations = useBlockVariations;
|
|
8
|
-
|
|
9
8
|
var _element = require("@wordpress/element");
|
|
10
|
-
|
|
11
9
|
var _blocks = require("@wordpress/blocks");
|
|
12
|
-
|
|
13
10
|
var _data = require("@wordpress/data");
|
|
14
|
-
|
|
15
11
|
var _components = require("@wordpress/components");
|
|
16
|
-
|
|
17
12
|
var _navigationButton = require("./navigation-button");
|
|
18
|
-
|
|
19
13
|
/**
|
|
20
14
|
* WordPress dependencies
|
|
21
15
|
*/
|
|
@@ -23,10 +17,10 @@ var _navigationButton = require("./navigation-button");
|
|
|
23
17
|
/**
|
|
24
18
|
* Internal dependencies
|
|
25
19
|
*/
|
|
20
|
+
|
|
26
21
|
function getCoreBlockStyles(blockStyles) {
|
|
27
22
|
return blockStyles?.filter(style => style.source === 'block');
|
|
28
23
|
}
|
|
29
|
-
|
|
30
24
|
function useBlockVariations(name) {
|
|
31
25
|
const blockStyles = (0, _data.useSelect)(select => {
|
|
32
26
|
const {
|
|
@@ -37,7 +31,6 @@ function useBlockVariations(name) {
|
|
|
37
31
|
const coreBlockStyles = getCoreBlockStyles(blockStyles);
|
|
38
32
|
return coreBlockStyles;
|
|
39
33
|
}
|
|
40
|
-
|
|
41
34
|
function VariationsPanel({
|
|
42
35
|
name
|
|
43
36
|
}) {
|
|
@@ -49,7 +42,6 @@ function VariationsPanel({
|
|
|
49
42
|
if (style?.isDefault) {
|
|
50
43
|
return null;
|
|
51
44
|
}
|
|
52
|
-
|
|
53
45
|
return (0, _element.createElement)(_navigationButton.NavigationButtonAsItem, {
|
|
54
46
|
key: index,
|
|
55
47
|
path: '/blocks/' + encodeURIComponent(name) + '/variations/' + encodeURIComponent(style.name),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["_blocks","require","_data","_components","_navigationButton","getCoreBlockStyles","blockStyles","filter","style","source","useBlockVariations","name","useSelect","select","getBlockStyles","blocksStore","coreBlockStyles","VariationsPanel","_element","createElement","__experimentalItemGroup","isBordered","isSeparated","map","index","isDefault","NavigationButtonAsItem","key","path","encodeURIComponent","label"],"sources":["@wordpress/edit-site/src/components/global-styles/variations-panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { useSelect } from '@wordpress/data';\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\n/**\n * Internal dependencies\n */\n\nimport { NavigationButtonAsItem } from './navigation-button';\n\nfunction getCoreBlockStyles( blockStyles ) {\n\treturn blockStyles?.filter( ( style ) => style.source === 'block' );\n}\n\nexport function useBlockVariations( name ) {\n\tconst blockStyles = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockStyles } = select( blocksStore );\n\t\t\treturn getBlockStyles( name );\n\t\t},\n\t\t[ name ]\n\t);\n\tconst coreBlockStyles = getCoreBlockStyles( blockStyles );\n\treturn coreBlockStyles;\n}\n\nexport function VariationsPanel( { name } ) {\n\tconst coreBlockStyles = useBlockVariations( name );\n\n\treturn (\n\t\t<ItemGroup isBordered isSeparated>\n\t\t\t{ coreBlockStyles.map( ( style, index ) => {\n\t\t\t\tif ( style?.isDefault ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\treturn (\n\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\tpath={\n\t\t\t\t\t\t\t'/blocks/' +\n\t\t\t\t\t\t\tencodeURIComponent( name ) +\n\t\t\t\t\t\t\t'/variations/' +\n\t\t\t\t\t\t\tencodeURIComponent( style.name )\n\t\t\t\t\t\t}\n\t\t\t\t\t\taria-label={ style.label }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ style.label }\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</ItemGroup>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAKA,IAAAG,iBAAA,GAAAH,OAAA;AAVA;AACA;AACA;;AAIA;AACA;AACA;;AAIA,SAASI,kBAAkBA,CAAEC,WAAW,EAAG;EAC1C,OAAOA,WAAW,EAAEC,MAAM,CAAIC,KAAK,IAAMA,KAAK,CAACC,MAAM,KAAK,OAAQ,CAAC;AACpE;AAEO,SAASC,k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