@wordpress/edit-site 5.19.2 → 5.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/components/add-new-page/index.js +9 -8
- package/build/components/add-new-page/index.js.map +1 -1
- package/build/components/add-new-pattern/index.js +12 -15
- package/build/components/add-new-pattern/index.js.map +1 -1
- package/build/components/add-new-template/add-custom-generic-template-modal-content.js +8 -7
- 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 +20 -19
- package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
- package/build/components/add-new-template/index.js +2 -2
- package/build/components/add-new-template/index.js.map +1 -1
- package/build/components/add-new-template/new-template.js +17 -16
- package/build/components/add-new-template/new-template.js.map +1 -1
- package/build/components/add-new-template/template-actions-loading-screen.js +4 -4
- package/build/components/add-new-template/template-actions-loading-screen.js.map +1 -1
- package/build/components/app/index.js +2 -2
- package/build/components/app/index.js.map +1 -1
- package/build/components/block-editor/back-button.js +2 -2
- package/build/components/block-editor/back-button.js.map +1 -1
- package/build/components/block-editor/block-editor-provider/default-block-editor-provider.js +10 -6
- package/build/components/block-editor/block-editor-provider/default-block-editor-provider.js.map +1 -1
- package/build/components/block-editor/block-editor-provider/index.js +3 -3
- package/build/components/block-editor/block-editor-provider/index.js.map +1 -1
- package/build/components/block-editor/block-editor-provider/navigation-block-editor-provider.js +3 -2
- package/build/components/block-editor/block-editor-provider/navigation-block-editor-provider.js.map +1 -1
- package/build/components/block-editor/block-editor-provider/use-page-content-blocks.js +19 -11
- package/build/components/block-editor/block-editor-provider/use-page-content-blocks.js.map +1 -1
- package/build/components/block-editor/block-inspector-button.js +2 -2
- package/build/components/block-editor/block-inspector-button.js.map +1 -1
- package/build/components/block-editor/editor-canvas.js +4 -3
- package/build/components/block-editor/editor-canvas.js.map +1 -1
- package/build/components/block-editor/index.js +2 -2
- package/build/components/block-editor/index.js.map +1 -1
- package/build/components/block-editor/resizable-editor.js +4 -3
- package/build/components/block-editor/resizable-editor.js.map +1 -1
- package/build/components/block-editor/resize-handle.js +3 -3
- package/build/components/block-editor/resize-handle.js.map +1 -1
- package/build/components/block-editor/site-editor-canvas.js +8 -7
- package/build/components/block-editor/site-editor-canvas.js.map +1 -1
- package/build/components/canvas-loader/index.js +4 -4
- package/build/components/canvas-loader/index.js.map +1 -1
- package/build/components/code-editor/index.js +8 -7
- package/build/components/code-editor/index.js.map +1 -1
- package/build/components/create-template-part-modal/index.js +17 -16
- package/build/components/create-template-part-modal/index.js.map +1 -1
- package/build/components/dataviews/dataviews.js +61 -0
- package/build/components/dataviews/dataviews.js.map +1 -0
- package/build/components/dataviews/index.js +21 -0
- package/build/components/dataviews/index.js.map +1 -0
- package/build/components/dataviews/list-view.js +89 -0
- package/build/components/dataviews/list-view.js.map +1 -0
- package/build/components/dataviews/pagination.js +89 -0
- package/build/components/dataviews/pagination.js.map +1 -0
- package/build/components/dataviews/text-filter.js +44 -0
- package/build/components/dataviews/text-filter.js.map +1 -0
- package/build/components/dataviews/view-actions.js +189 -0
- package/build/components/dataviews/view-actions.js.map +1 -0
- package/build/components/editor/index.js +15 -14
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor-canvas-container/index.js +4 -3
- package/build/components/editor-canvas-container/index.js.map +1 -1
- package/build/components/error-boundary/index.js +2 -1
- package/build/components/error-boundary/index.js.map +1 -1
- package/build/components/error-boundary/warning.js +4 -4
- package/build/components/error-boundary/warning.js.map +1 -1
- package/build/components/global-styles/block-preview-panel.js +5 -4
- package/build/components/global-styles/block-preview-panel.js.map +1 -1
- package/build/components/global-styles/color-indicator-wrapper.js +2 -2
- package/build/components/global-styles/color-indicator-wrapper.js.map +1 -1
- package/build/components/global-styles/color-palette-panel.js +5 -5
- package/build/components/global-styles/color-palette-panel.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +3 -2
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/font-families.js +14 -14
- package/build/components/global-styles/font-families.js.map +1 -1
- package/build/components/global-styles/font-family-item.js +6 -5
- package/build/components/global-styles/font-family-item.js.map +1 -1
- package/build/components/global-styles/font-library-modal/collection-font-details.js +9 -7
- package/build/components/global-styles/font-library-modal/collection-font-details.js.map +1 -1
- package/build/components/global-styles/font-library-modal/collection-font-variant.js +5 -5
- package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
- package/build/components/global-styles/font-library-modal/confirm-delete-dialog.js +2 -2
- package/build/components/global-styles/font-library-modal/confirm-delete-dialog.js.map +1 -1
- package/build/components/global-styles/font-library-modal/context.js +28 -31
- package/build/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-card.js +7 -7
- package/build/components/global-styles/font-library-modal/font-card.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-collection.js +44 -23
- package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-demo.js +5 -4
- package/build/components/global-styles/font-library-modal/font-demo.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-variant.js +7 -7
- package/build/components/global-styles/font-library-modal/font-variant.js.map +1 -1
- package/build/components/global-styles/font-library-modal/fonts-grid.js +8 -7
- package/build/components/global-styles/font-library-modal/fonts-grid.js.map +1 -1
- package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +9 -9
- package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -1
- package/build/components/global-styles/font-library-modal/index.js +16 -8
- package/build/components/global-styles/font-library-modal/index.js.map +1 -1
- package/build/components/global-styles/font-library-modal/installed-fonts.js +39 -18
- package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/library-font-card.js +3 -2
- package/build/components/global-styles/font-library-modal/library-font-card.js.map +1 -1
- package/build/components/global-styles/font-library-modal/library-font-details.js +6 -6
- package/build/components/global-styles/font-library-modal/library-font-details.js.map +1 -1
- package/build/components/global-styles/font-library-modal/library-font-variant.js +5 -4
- package/build/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
- package/build/components/global-styles/font-library-modal/local-fonts.js +39 -11
- package/build/components/global-styles/font-library-modal/local-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/resolvers.js +1 -1
- package/build/components/global-styles/font-library-modal/resolvers.js.map +1 -1
- package/build/components/global-styles/font-library-modal/tab-layout.js +9 -9
- package/build/components/global-styles/font-library-modal/tab-layout.js.map +1 -1
- package/build/components/global-styles/font-library-modal/upload-fonts.js +26 -0
- package/build/components/global-styles/font-library-modal/upload-fonts.js.map +1 -0
- package/build/components/global-styles/font-library-modal/utils/fonts-outline.js +4 -1
- package/build/components/global-styles/font-library-modal/utils/fonts-outline.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/get-notice-from-response.js +71 -0
- package/build/components/global-styles/font-library-modal/utils/get-notice-from-response.js.map +1 -0
- package/build/components/global-styles/font-library-modal/utils/index.js +4 -1
- package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
- package/build/components/global-styles/global-styles-provider.js +3 -2
- package/build/components/global-styles/global-styles-provider.js.map +1 -1
- package/build/components/global-styles/gradients-palette-panel.js +8 -8
- package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build/components/global-styles/header.js +7 -7
- package/build/components/global-styles/header.js.map +1 -1
- package/build/components/global-styles/icon-with-current-color.js +2 -2
- package/build/components/global-styles/icon-with-current-color.js.map +1 -1
- package/build/components/global-styles/navigation-button.js +7 -7
- package/build/components/global-styles/navigation-button.js.map +1 -1
- package/build/components/global-styles/palette.js +11 -10
- package/build/components/global-styles/palette.js.map +1 -1
- package/build/components/global-styles/preview.js +17 -16
- package/build/components/global-styles/preview.js.map +1 -1
- package/build/components/global-styles/root-menu.js +4 -4
- package/build/components/global-styles/root-menu.js.map +1 -1
- package/build/components/global-styles/screen-block-list.js +10 -9
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-block.js +17 -16
- package/build/components/global-styles/screen-block.js.map +1 -1
- package/build/components/global-styles/screen-color-palette.js +5 -5
- package/build/components/global-styles/screen-color-palette.js.map +1 -1
- package/build/components/global-styles/screen-colors.js +5 -5
- package/build/components/global-styles/screen-colors.js.map +1 -1
- package/build/components/global-styles/screen-css.js +5 -5
- package/build/components/global-styles/screen-css.js.map +1 -1
- package/build/components/global-styles/screen-layout.js +3 -3
- package/build/components/global-styles/screen-layout.js.map +1 -1
- package/build/components/global-styles/screen-revisions/index.js +10 -9
- package/build/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js +10 -10
- package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build/components/global-styles/screen-root.js +14 -14
- package/build/components/global-styles/screen-root.js.map +1 -1
- package/build/components/global-styles/screen-style-variations.js +5 -4
- package/build/components/global-styles/screen-style-variations.js.map +1 -1
- package/build/components/global-styles/screen-typography-element.js +15 -14
- package/build/components/global-styles/screen-typography-element.js.map +1 -1
- package/build/components/global-styles/screen-typography.js +5 -5
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/style-variations-container.js +8 -7
- package/build/components/global-styles/style-variations-container.js.map +1 -1
- package/build/components/global-styles/subtitle.js +2 -2
- package/build/components/global-styles/subtitle.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +2 -2
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/typography-preview.js +2 -2
- package/build/components/global-styles/typography-preview.js.map +1 -1
- package/build/components/global-styles/typogrphy-elements.js +13 -13
- package/build/components/global-styles/typogrphy-elements.js.map +1 -1
- package/build/components/global-styles/ui.js +41 -40
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles/variations-panel.js +3 -3
- package/build/components/global-styles/variations-panel.js.map +1 -1
- package/build/components/header-edit-mode/document-actions/index.js +16 -15
- package/build/components/header-edit-mode/document-actions/index.js.map +1 -1
- package/build/components/header-edit-mode/index.js +20 -19
- package/build/components/header-edit-mode/index.js.map +1 -1
- package/build/components/header-edit-mode/mode-switcher/index.js +3 -3
- 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 +2 -2
- 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 +14 -14
- package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
- package/build/components/header-edit-mode/more-menu/site-export.js +2 -2
- 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 +2 -2
- 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 +1 -1
- 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 -3
- 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 +2 -2
- 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 +3 -2
- package/build/components/header-edit-mode/undo-redo/redo.js.map +1 -1
- package/build/components/header-edit-mode/undo-redo/undo.js +3 -2
- package/build/components/header-edit-mode/undo-redo/undo.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +2 -2
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +15 -15
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/shortcut.js +8 -7
- package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build/components/layout/index.js +15 -14
- package/build/components/layout/index.js.map +1 -1
- package/build/components/list/added-by.js +9 -8
- package/build/components/list/added-by.js.map +1 -1
- package/build/components/list/header.js +5 -5
- package/build/components/list/header.js.map +1 -1
- package/build/components/list/index.js +5 -5
- package/build/components/list/index.js.map +1 -1
- package/build/components/list/table.js +15 -15
- package/build/components/list/table.js.map +1 -1
- package/build/components/page/header.js +6 -6
- package/build/components/page/header.js.map +1 -1
- package/build/components/page/index.js +5 -5
- package/build/components/page/index.js.map +1 -1
- package/build/components/page-actions/index.js +3 -3
- package/build/components/page-actions/index.js.map +1 -1
- package/build/components/page-actions/trash-page-menu-item.js +2 -2
- package/build/components/page-actions/trash-page-menu-item.js.map +1 -1
- package/build/components/page-content-focus-manager/disable-non-page-content-blocks.js +3 -2
- 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 +3 -2
- package/build/components/page-content-focus-manager/edit-template-notification.js.map +1 -1
- package/build/components/page-content-focus-manager/index.js +35 -4
- package/build/components/page-content-focus-manager/index.js.map +1 -1
- package/build/components/page-main/index.js +7 -4
- package/build/components/page-main/index.js.map +1 -1
- package/build/components/page-pages/index.js +174 -0
- package/build/components/page-pages/index.js.map +1 -0
- package/build/components/page-patterns/duplicate-menu-item.js +2 -2
- package/build/components/page-patterns/duplicate-menu-item.js.map +1 -1
- package/build/components/page-patterns/grid-item.js +21 -20
- package/build/components/page-patterns/grid-item.js.map +1 -1
- package/build/components/page-patterns/grid.js +3 -4
- package/build/components/page-patterns/grid.js.map +1 -1
- package/build/components/page-patterns/header.js +4 -4
- package/build/components/page-patterns/header.js.map +1 -1
- package/build/components/page-patterns/index.js +4 -4
- package/build/components/page-patterns/index.js.map +1 -1
- package/build/components/page-patterns/no-patterns.js +2 -2
- package/build/components/page-patterns/no-patterns.js.map +1 -1
- package/build/components/page-patterns/pagination.js +10 -10
- package/build/components/page-patterns/pagination.js.map +1 -1
- package/build/components/page-patterns/patterns-list.js +16 -15
- package/build/components/page-patterns/patterns-list.js.map +1 -1
- package/build/components/page-patterns/rename-menu-item.js +10 -9
- package/build/components/page-patterns/rename-menu-item.js.map +1 -1
- package/build/components/page-patterns/use-patterns.js +5 -1
- package/build/components/page-patterns/use-patterns.js.map +1 -1
- package/build/components/page-template-parts/add-new-template-part.js +4 -3
- package/build/components/page-template-parts/add-new-template-part.js.map +1 -1
- package/build/components/page-template-parts/index.js +21 -10
- package/build/components/page-template-parts/index.js.map +1 -1
- package/build/components/page-templates/index.js +10 -10
- package/build/components/page-templates/index.js.map +1 -1
- package/build/components/plugin-template-setting-panel/index.js +1 -1
- package/build/components/plugin-template-setting-panel/index.js.map +1 -1
- package/build/components/preferences-modal/enable-feature.js +2 -2
- package/build/components/preferences-modal/enable-feature.js.map +1 -1
- package/build/components/preferences-modal/index.js +12 -11
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/resizable-frame/index.js +7 -6
- package/build/components/resizable-frame/index.js.map +1 -1
- package/build/components/revisions/index.js +9 -8
- package/build/components/revisions/index.js.map +1 -1
- package/build/components/routes/link.js +2 -2
- package/build/components/routes/link.js.map +1 -1
- package/build/components/save-button/index.js +2 -2
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/save-hub/index.js +4 -4
- package/build/components/save-hub/index.js.map +1 -1
- package/build/components/save-panel/index.js +11 -11
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/secondary-sidebar/inserter-sidebar.js +7 -6
- package/build/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
- package/build/components/secondary-sidebar/list-view-sidebar.js +7 -6
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build/components/sidebar/index.js +23 -14
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-button/index.js +2 -2
- package/build/components/sidebar-button/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/default-sidebar.js +3 -3
- package/build/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js +8 -7
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build/components/sidebar-edit-mode/index.js +6 -5
- package/build/components/sidebar-edit-mode/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/edit-template.js +20 -10
- package/build/components/sidebar-edit-mode/page-panels/edit-template.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/index.js +7 -7
- package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/page-content.js +3 -2
- 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 +21 -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 +4 -4
- 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 +7 -6
- package/build/components/sidebar-edit-mode/page-panels/publish-date.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/reset-default-template.js +3 -3
- package/build/components/sidebar-edit-mode/page-panels/reset-default-template.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/swap-template-button.js +7 -6
- package/build/components/sidebar-edit-mode/page-panels/swap-template-button.js.map +1 -1
- package/build/components/sidebar-edit-mode/plugin-sidebar/index.js +2 -2
- package/build/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/settings-header/index.js +3 -3
- package/build/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/sidebar-card/index.js +7 -7
- package/build/components/sidebar-edit-mode/sidebar-card/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js +2 -2
- package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-panel/hooks.js +71 -0
- package/build/components/sidebar-edit-mode/template-panel/hooks.js.map +1 -0
- package/build/components/sidebar-edit-mode/template-panel/index.js +5 -5
- package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-panel/last-revision.js +5 -5
- package/build/components/sidebar-edit-mode/template-panel/last-revision.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-panel/pattern-categories.js +5 -4
- package/build/components/sidebar-edit-mode/template-panel/pattern-categories.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-panel/replace-template-button.js +83 -0
- package/build/components/sidebar-edit-mode/template-panel/replace-template-button.js.map +1 -0
- package/build/components/sidebar-edit-mode/template-panel/template-actions.js +12 -5
- 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 +8 -8
- package/build/components/sidebar-edit-mode/template-panel/template-areas.js.map +1 -1
- package/build/components/sidebar-navigation-item/index.js +5 -5
- package/build/components/sidebar-navigation-item/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen/index.js +11 -11
- package/build/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-details-footer/index.js +8 -7
- package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-details-panel/index.js +3 -3
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +12 -11
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/index.js +9 -8
- package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/template-part-hint.js +2 -2
- package/build/components/sidebar-navigation-screen-main/template-part-hint.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-item/index.js +4 -4
- package/build/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +2 -2
- 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 +2 -2
- package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js +7 -7
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js +8 -7
- 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 +4 -3
- 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 +9 -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 +5 -5
- package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js +8 -8
- 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 +7 -6
- 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 +5 -4
- package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/index.js +11 -11
- package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/page-details.js +6 -6
- package/build/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/status-label.js +5 -4
- package/build/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pages/index.js +26 -17
- package/build/components/sidebar-navigation-screen-pages/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/index.js +4 -4
- 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 +5 -3
- 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 +3 -3
- 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 +6 -4
- 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 +4 -4
- 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 +10 -3
- 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 -7
- 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 -3
- package/build/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/index.js +27 -15
- package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-template/home-template-details.js +26 -30
- package/build/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -1
- package/build/components/sidebar-navigation-screen-template/index.js +12 -12
- package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates/index.js +6 -6
- package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/index.js +17 -5
- package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build/components/site-hub/index.js +12 -11
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/site-icon/index.js +5 -5
- package/build/components/site-icon/index.js.map +1 -1
- package/build/components/start-template-options/index.js +10 -9
- package/build/components/start-template-options/index.js.map +1 -1
- package/build/components/style-book/index.js +19 -18
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/table/index.js +6 -6
- package/build/components/table/index.js.map +1 -1
- package/build/components/template-actions/index.js +8 -7
- package/build/components/template-actions/index.js.map +1 -1
- package/build/components/template-actions/rename-menu-item.js +10 -9
- package/build/components/template-actions/rename-menu-item.js.map +1 -1
- package/build/components/template-part-converter/convert-to-regular.js +2 -2
- package/build/components/template-part-converter/convert-to-regular.js.map +1 -1
- package/build/components/template-part-converter/convert-to-template-part.js +4 -3
- package/build/components/template-part-converter/convert-to-template-part.js.map +1 -1
- package/build/components/template-part-converter/index.js +5 -5
- package/build/components/template-part-converter/index.js.map +1 -1
- package/build/components/welcome-guide/editor.js +8 -7
- package/build/components/welcome-guide/editor.js.map +1 -1
- package/build/components/welcome-guide/image.js +4 -4
- package/build/components/welcome-guide/image.js.map +1 -1
- package/build/components/welcome-guide/index.js +2 -2
- package/build/components/welcome-guide/index.js.map +1 -1
- package/build/components/welcome-guide/page.js +6 -6
- package/build/components/welcome-guide/page.js.map +1 -1
- package/build/components/welcome-guide/styles.js +15 -15
- package/build/components/welcome-guide/styles.js.map +1 -1
- package/build/components/welcome-guide/template.js +6 -6
- package/build/components/welcome-guide/template.js.map +1 -1
- package/build/hooks/commands/use-common-commands.js +2 -2
- package/build/hooks/commands/use-common-commands.js.map +1 -1
- package/build/hooks/navigation-menu-edit.js +5 -5
- package/build/hooks/navigation-menu-edit.js.map +1 -1
- package/build/hooks/push-changes-to-global-styles/index.js +6 -5
- package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build/hooks/template-part-edit.js +5 -5
- package/build/hooks/template-part-edit.js.map +1 -1
- package/build/index.js +3 -2
- package/build/index.js.map +1 -1
- package/build/utils/constants.js +1 -1
- package/build/utils/constants.js.map +1 -1
- package/build/utils/get-is-list-page.js +1 -1
- package/build/utils/get-is-list-page.js.map +1 -1
- package/build-module/components/add-new-page/index.js +1 -1
- package/build-module/components/add-new-pattern/index.js +8 -12
- 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 -1
- package/build-module/components/add-new-template/add-custom-template-modal-content.js +1 -1
- package/build-module/components/add-new-template/index.js +1 -1
- package/build-module/components/add-new-template/new-template.js +1 -1
- package/build-module/components/add-new-template/template-actions-loading-screen.js +1 -1
- package/build-module/components/app/index.js +1 -1
- package/build-module/components/block-editor/back-button.js +1 -1
- package/build-module/components/block-editor/block-editor-provider/default-block-editor-provider.js +9 -5
- package/build-module/components/block-editor/block-editor-provider/default-block-editor-provider.js.map +1 -1
- package/build-module/components/block-editor/block-editor-provider/index.js +1 -1
- package/build-module/components/block-editor/block-editor-provider/navigation-block-editor-provider.js +1 -1
- package/build-module/components/block-editor/block-editor-provider/use-page-content-blocks.js +19 -11
- package/build-module/components/block-editor/block-editor-provider/use-page-content-blocks.js.map +1 -1
- package/build-module/components/block-editor/block-inspector-button.js +1 -1
- package/build-module/components/block-editor/editor-canvas.js +1 -1
- package/build-module/components/block-editor/index.js +1 -1
- package/build-module/components/block-editor/resizable-editor.js +1 -1
- package/build-module/components/block-editor/resize-handle.js +1 -1
- package/build-module/components/block-editor/site-editor-canvas.js +1 -1
- package/build-module/components/canvas-loader/index.js +1 -1
- package/build-module/components/code-editor/index.js +1 -1
- package/build-module/components/create-template-part-modal/index.js +1 -1
- package/build-module/components/dataviews/dataviews.js +53 -0
- package/build-module/components/dataviews/dataviews.js.map +1 -0
- package/build-module/components/dataviews/index.js +3 -0
- package/build-module/components/dataviews/index.js.map +1 -0
- package/build-module/components/dataviews/list-view.js +80 -0
- package/build-module/components/dataviews/list-view.js.map +1 -0
- package/build-module/components/dataviews/pagination.js +83 -0
- package/build-module/components/dataviews/pagination.js.map +1 -0
- package/build-module/components/dataviews/text-filter.js +36 -0
- package/build-module/components/dataviews/text-filter.js.map +1 -0
- package/build-module/components/dataviews/view-actions.js +179 -0
- package/build-module/components/dataviews/view-actions.js.map +1 -0
- package/build-module/components/editor/index.js +1 -1
- package/build-module/components/editor-canvas-container/index.js +1 -1
- package/build-module/components/error-boundary/index.js +1 -1
- package/build-module/components/error-boundary/warning.js +1 -1
- package/build-module/components/global-styles/block-preview-panel.js +1 -1
- package/build-module/components/global-styles/color-indicator-wrapper.js +1 -1
- package/build-module/components/global-styles/color-palette-panel.js +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +1 -1
- package/build-module/components/global-styles/font-families.js +3 -4
- package/build-module/components/global-styles/font-families.js.map +1 -1
- package/build-module/components/global-styles/font-family-item.js +1 -1
- package/build-module/components/global-styles/font-library-modal/collection-font-details.js +4 -2
- package/build-module/components/global-styles/font-library-modal/collection-font-details.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/collection-font-variant.js +1 -1
- package/build-module/components/global-styles/font-library-modal/confirm-delete-dialog.js +1 -1
- package/build-module/components/global-styles/font-library-modal/context.js +27 -31
- package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/font-card.js +1 -1
- package/build-module/components/global-styles/font-library-modal/font-collection.js +33 -13
- package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/font-demo.js +1 -1
- package/build-module/components/global-styles/font-library-modal/font-variant.js +1 -1
- package/build-module/components/global-styles/font-library-modal/fonts-grid.js +1 -1
- package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +1 -1
- package/build-module/components/global-styles/font-library-modal/index.js +11 -4
- package/build-module/components/global-styles/font-library-modal/index.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js +29 -9
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/library-font-card.js +1 -1
- package/build-module/components/global-styles/font-library-modal/library-font-details.js +1 -1
- package/build-module/components/global-styles/font-library-modal/library-font-variant.js +1 -1
- package/build-module/components/global-styles/font-library-modal/local-fonts.js +39 -12
- package/build-module/components/global-styles/font-library-modal/local-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/resolvers.js +1 -1
- package/build-module/components/global-styles/font-library-modal/resolvers.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/tab-layout.js +1 -1
- package/build-module/components/global-styles/font-library-modal/upload-fonts.js +17 -0
- package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js +4 -1
- package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/get-notice-from-response.js +63 -0
- package/build-module/components/global-styles/font-library-modal/utils/get-notice-from-response.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/utils/index.js +4 -1
- package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
- package/build-module/components/global-styles/global-styles-provider.js +1 -1
- package/build-module/components/global-styles/gradients-palette-panel.js +1 -1
- package/build-module/components/global-styles/header.js +1 -1
- package/build-module/components/global-styles/icon-with-current-color.js +1 -1
- package/build-module/components/global-styles/navigation-button.js +1 -1
- package/build-module/components/global-styles/palette.js +1 -1
- package/build-module/components/global-styles/preview.js +1 -1
- package/build-module/components/global-styles/root-menu.js +1 -1
- package/build-module/components/global-styles/screen-block-list.js +1 -1
- package/build-module/components/global-styles/screen-block.js +1 -1
- package/build-module/components/global-styles/screen-color-palette.js +1 -1
- package/build-module/components/global-styles/screen-colors.js +1 -1
- package/build-module/components/global-styles/screen-css.js +1 -1
- package/build-module/components/global-styles/screen-layout.js +1 -1
- package/build-module/components/global-styles/screen-revisions/index.js +1 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +1 -1
- package/build-module/components/global-styles/screen-root.js +1 -1
- package/build-module/components/global-styles/screen-style-variations.js +1 -1
- package/build-module/components/global-styles/screen-typography-element.js +1 -1
- package/build-module/components/global-styles/screen-typography.js +2 -2
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/style-variations-container.js +1 -1
- package/build-module/components/global-styles/subtitle.js +1 -1
- package/build-module/components/global-styles/typography-panel.js +1 -1
- package/build-module/components/global-styles/typography-preview.js +1 -1
- package/build-module/components/global-styles/typogrphy-elements.js +1 -1
- package/build-module/components/global-styles/ui.js +1 -1
- package/build-module/components/global-styles/variations-panel.js +1 -1
- package/build-module/components/header-edit-mode/document-actions/index.js +1 -1
- package/build-module/components/header-edit-mode/index.js +1 -1
- package/build-module/components/header-edit-mode/mode-switcher/index.js +1 -1
- package/build-module/components/header-edit-mode/more-menu/copy-content-menu-item.js +1 -1
- package/build-module/components/header-edit-mode/more-menu/index.js +1 -1
- package/build-module/components/header-edit-mode/more-menu/site-export.js +1 -1
- package/build-module/components/header-edit-mode/more-menu/welcome-guide-menu-item.js +1 -1
- package/build-module/components/header-edit-mode/plugin-more-menu-item/index.js +1 -1
- 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 +2 -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 +1 -1
- package/build-module/components/header-edit-mode/undo-redo/redo.js +1 -1
- package/build-module/components/header-edit-mode/undo-redo/undo.js +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +1 -1
- package/build-module/components/layout/index.js +1 -1
- package/build-module/components/list/added-by.js +1 -1
- package/build-module/components/list/header.js +1 -1
- package/build-module/components/list/index.js +1 -1
- package/build-module/components/list/table.js +1 -1
- package/build-module/components/page/header.js +1 -1
- package/build-module/components/page/index.js +1 -1
- package/build-module/components/page-actions/index.js +1 -1
- package/build-module/components/page-actions/trash-page-menu-item.js +1 -1
- package/build-module/components/page-content-focus-manager/disable-non-page-content-blocks.js +1 -1
- package/build-module/components/page-content-focus-manager/edit-template-notification.js +1 -1
- package/build-module/components/page-content-focus-manager/index.js +34 -4
- package/build-module/components/page-content-focus-manager/index.js.map +1 -1
- package/build-module/components/page-main/index.js +4 -1
- package/build-module/components/page-main/index.js.map +1 -1
- package/build-module/components/page-pages/index.js +166 -0
- package/build-module/components/page-pages/index.js.map +1 -0
- package/build-module/components/page-patterns/duplicate-menu-item.js +1 -1
- package/build-module/components/page-patterns/grid-item.js +1 -1
- package/build-module/components/page-patterns/grid.js +1 -2
- package/build-module/components/page-patterns/grid.js.map +1 -1
- package/build-module/components/page-patterns/header.js +1 -1
- package/build-module/components/page-patterns/index.js +1 -1
- package/build-module/components/page-patterns/no-patterns.js +1 -1
- package/build-module/components/page-patterns/pagination.js +1 -1
- package/build-module/components/page-patterns/patterns-list.js +2 -2
- package/build-module/components/page-patterns/patterns-list.js.map +1 -1
- package/build-module/components/page-patterns/rename-menu-item.js +1 -1
- package/build-module/components/page-patterns/use-patterns.js +5 -1
- package/build-module/components/page-patterns/use-patterns.js.map +1 -1
- package/build-module/components/page-template-parts/add-new-template-part.js +1 -1
- package/build-module/components/page-template-parts/index.js +13 -2
- package/build-module/components/page-template-parts/index.js.map +1 -1
- package/build-module/components/page-templates/index.js +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 +1 -1
- package/build-module/components/preferences-modal/index.js +1 -1
- package/build-module/components/resizable-frame/index.js +1 -1
- package/build-module/components/revisions/index.js +1 -1
- package/build-module/components/routes/link.js +1 -1
- package/build-module/components/save-button/index.js +1 -1
- package/build-module/components/save-hub/index.js +1 -1
- package/build-module/components/save-panel/index.js +1 -1
- package/build-module/components/secondary-sidebar/inserter-sidebar.js +1 -1
- package/build-module/components/secondary-sidebar/list-view-sidebar.js +1 -1
- package/build-module/components/sidebar/index.js +10 -2
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-button/index.js +1 -1
- package/build-module/components/sidebar-edit-mode/default-sidebar.js +1 -1
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +1 -1
- package/build-module/components/sidebar-edit-mode/index.js +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/edit-template.js +15 -5
- 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 +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/page-content.js +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/page-status.js +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/publish-date.js +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/reset-default-template.js +2 -2
- package/build-module/components/sidebar-edit-mode/page-panels/reset-default-template.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/swap-template-button.js +1 -1
- package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js +1 -1
- package/build-module/components/sidebar-edit-mode/settings-header/index.js +1 -1
- package/build-module/components/sidebar-edit-mode/sidebar-card/index.js +1 -1
- package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js +1 -1
- package/build-module/components/sidebar-edit-mode/template-panel/hooks.js +64 -0
- package/build-module/components/sidebar-edit-mode/template-panel/hooks.js.map +1 -0
- package/build-module/components/sidebar-edit-mode/template-panel/index.js +1 -1
- package/build-module/components/sidebar-edit-mode/template-panel/last-revision.js +1 -1
- package/build-module/components/sidebar-edit-mode/template-panel/pattern-categories.js +4 -4
- package/build-module/components/sidebar-edit-mode/template-panel/pattern-categories.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/template-panel/replace-template-button.js +76 -0
- package/build-module/components/sidebar-edit-mode/template-panel/replace-template-button.js.map +1 -0
- package/build-module/components/sidebar-edit-mode/template-panel/template-actions.js +11 -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 +2 -2
- 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 -1
- package/build-module/components/sidebar-navigation-screen/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen-details-footer/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen-details-panel/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js +1 -1
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +1 -1
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen-main/template-part-hint.js +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-item/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +1 -1
- package/build-module/components/sidebar-navigation-screen-page/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen-page/page-details.js +1 -1
- package/build-module/components/sidebar-navigation-screen-page/status-label.js +1 -1
- package/build-module/components/sidebar-navigation-screen-pages/index.js +13 -5
- package/build-module/components/sidebar-navigation-screen-pages/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +4 -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 +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +4 -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 +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +8 -2
- 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 +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/category-item.js +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/index.js +15 -3
- package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-template/home-template-details.js +15 -20
- 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 +1 -1
- package/build-module/components/sidebar-navigation-screen-templates/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +17 -5
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build-module/components/site-hub/index.js +1 -1
- package/build-module/components/site-icon/index.js +1 -1
- package/build-module/components/start-template-options/index.js +4 -4
- package/build-module/components/start-template-options/index.js.map +1 -1
- package/build-module/components/style-book/index.js +1 -1
- package/build-module/components/table/index.js +1 -1
- package/build-module/components/template-actions/index.js +1 -1
- package/build-module/components/template-actions/rename-menu-item.js +1 -1
- package/build-module/components/template-part-converter/convert-to-regular.js +1 -1
- package/build-module/components/template-part-converter/convert-to-template-part.js +1 -1
- package/build-module/components/template-part-converter/index.js +1 -1
- package/build-module/components/welcome-guide/editor.js +1 -1
- package/build-module/components/welcome-guide/image.js +1 -1
- package/build-module/components/welcome-guide/index.js +1 -1
- package/build-module/components/welcome-guide/page.js +1 -1
- package/build-module/components/welcome-guide/styles.js +1 -1
- package/build-module/components/welcome-guide/template.js +1 -1
- package/build-module/hooks/commands/use-common-commands.js +4 -4
- package/build-module/hooks/commands/use-common-commands.js.map +1 -1
- package/build-module/hooks/navigation-menu-edit.js +1 -1
- package/build-module/hooks/push-changes-to-global-styles/index.js +1 -1
- package/build-module/hooks/template-part-edit.js +1 -1
- package/build-module/index.js +1 -1
- package/build-module/utils/constants.js +1 -1
- package/build-module/utils/constants.js.map +1 -1
- package/build-module/utils/get-is-list-page.js +1 -1
- package/build-module/utils/get-is-list-page.js.map +1 -1
- package/build-style/style-rtl.css +93 -18
- package/build-style/style.css +93 -18
- package/package.json +41 -40
- package/src/components/add-new-pattern/index.js +7 -10
- package/src/components/block-editor/block-editor-provider/default-block-editor-provider.js +10 -5
- package/src/components/block-editor/block-editor-provider/test/use-page-content-blocks.js +33 -4
- package/src/components/block-editor/block-editor-provider/use-page-content-blocks.js +27 -14
- package/src/components/dataviews/dataviews.js +60 -0
- package/src/components/dataviews/index.js +2 -0
- package/src/components/dataviews/list-view.js +106 -0
- package/src/components/dataviews/pagination.js +118 -0
- package/src/components/dataviews/style.scss +36 -0
- package/src/components/dataviews/text-filter.js +37 -0
- package/src/components/dataviews/view-actions.js +246 -0
- package/src/components/global-styles/font-families.js +1 -5
- package/src/components/global-styles/font-library-modal/collection-font-details.js +1 -1
- package/src/components/global-styles/font-library-modal/context.js +36 -38
- package/src/components/global-styles/font-library-modal/font-collection.js +41 -12
- package/src/components/global-styles/font-library-modal/index.js +16 -6
- package/src/components/global-styles/font-library-modal/installed-fonts.js +36 -6
- package/src/components/global-styles/font-library-modal/local-fonts.js +65 -23
- package/src/components/global-styles/font-library-modal/resolvers.js +1 -1
- package/src/components/global-styles/font-library-modal/style.scss +18 -1
- package/src/components/global-styles/font-library-modal/upload-fonts.js +20 -0
- package/src/components/global-styles/font-library-modal/utils/fonts-outline.js +4 -3
- package/src/components/global-styles/font-library-modal/utils/get-notice-from-response.js +62 -0
- package/src/components/global-styles/font-library-modal/utils/index.js +5 -1
- package/src/components/global-styles/font-library-modal/utils/test/makeFormDataFromFontFamilies.spec.js +1 -1
- package/src/components/global-styles/screen-typography.js +3 -4
- package/src/components/header-edit-mode/plugin-more-menu-item/index.js +1 -1
- package/src/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js +1 -1
- package/src/components/page-content-focus-manager/index.js +29 -4
- package/src/components/page-main/index.js +3 -0
- package/src/components/page-pages/index.js +190 -0
- package/src/components/page-patterns/grid.js +1 -1
- package/src/components/page-patterns/patterns-list.js +1 -1
- package/src/components/page-patterns/use-patterns.js +7 -3
- package/src/components/page-template-parts/index.js +14 -1
- package/src/components/plugin-template-setting-panel/index.js +1 -1
- package/src/components/sidebar/index.js +11 -0
- package/src/components/sidebar-edit-mode/page-panels/edit-template.js +31 -16
- package/src/components/sidebar-edit-mode/page-panels/reset-default-template.js +1 -1
- package/src/components/sidebar-edit-mode/template-panel/hooks.js +97 -0
- package/src/components/sidebar-edit-mode/template-panel/pattern-categories.js +18 -16
- package/src/components/sidebar-edit-mode/template-panel/replace-template-button.js +89 -0
- package/src/components/sidebar-edit-mode/template-panel/style.scss +18 -0
- package/src/components/sidebar-edit-mode/template-panel/template-actions.js +27 -12
- package/src/components/sidebar-edit-mode/template-panel/template-areas.js +1 -1
- package/src/components/sidebar-navigation-screen/style.scss +0 -1
- package/src/components/sidebar-navigation-screen-pages/index.js +11 -4
- package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +3 -1
- package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +3 -1
- package/src/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +11 -5
- package/src/components/sidebar-navigation-screen-patterns/index.js +25 -4
- package/src/components/sidebar-navigation-screen-template/home-template-details.js +27 -35
- package/src/components/sidebar-navigation-screen-templates-browse/index.js +12 -4
- package/src/components/start-template-options/index.js +3 -3
- package/src/hooks/commands/use-common-commands.js +12 -4
- package/src/style.scss +1 -0
- package/src/utils/constants.js +1 -1
- package/src/utils/get-is-list-page.js +3 -2
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = SidebarNavigationScreenTemplates;
|
|
8
|
-
var
|
|
8
|
+
var _react = require("react");
|
|
9
9
|
var _components = require("@wordpress/components");
|
|
10
10
|
var _i18n = require("@wordpress/i18n");
|
|
11
11
|
var _coreData = require("@wordpress/core-data");
|
|
@@ -34,7 +34,7 @@ const TemplateItem = ({
|
|
|
34
34
|
postType,
|
|
35
35
|
postId
|
|
36
36
|
});
|
|
37
|
-
return (0,
|
|
37
|
+
return (0, _react.createElement)(_sidebarNavigationItem.default, {
|
|
38
38
|
...linkInfo,
|
|
39
39
|
...props
|
|
40
40
|
});
|
|
@@ -53,22 +53,22 @@ function SidebarNavigationScreenTemplates() {
|
|
|
53
53
|
path: '/wp_template/all'
|
|
54
54
|
});
|
|
55
55
|
const canCreate = !isMobileViewport;
|
|
56
|
-
return (0,
|
|
56
|
+
return (0, _react.createElement)(_sidebarNavigationScreen.default, {
|
|
57
57
|
title: (0, _i18n.__)('Templates'),
|
|
58
58
|
description: (0, _i18n.__)('Express the layout of your site with templates.'),
|
|
59
|
-
actions: canCreate && (0,
|
|
59
|
+
actions: canCreate && (0, _react.createElement)(_addNewTemplate.default, {
|
|
60
60
|
templateType: _constants.TEMPLATE_POST_TYPE,
|
|
61
61
|
toggleProps: {
|
|
62
62
|
as: _sidebarButton.default
|
|
63
63
|
}
|
|
64
64
|
}),
|
|
65
|
-
content: (0,
|
|
65
|
+
content: (0, _react.createElement)(_react.Fragment, null, isLoading && (0, _i18n.__)('Loading templates…'), !isLoading && (0, _react.createElement)(_components.__experimentalItemGroup, null, !templates?.length && (0, _react.createElement)(_components.__experimentalItem, null, (0, _i18n.__)('No templates found')), sortedTemplates.map(template => (0, _react.createElement)(TemplateItem, {
|
|
66
66
|
postType: _constants.TEMPLATE_POST_TYPE,
|
|
67
67
|
postId: template.id,
|
|
68
68
|
key: template.id,
|
|
69
69
|
withChevron: true
|
|
70
70
|
}, (0, _htmlEntities.decodeEntities)(template.title?.rendered || template.slug))))),
|
|
71
|
-
footer: !isMobileViewport && (0,
|
|
71
|
+
footer: !isMobileViewport && (0, _react.createElement)(_sidebarNavigationItem.default, {
|
|
72
72
|
withChevron: true,
|
|
73
73
|
...browseAllLink
|
|
74
74
|
}, (0, _i18n.__)('Manage all templates'))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_i18n","_coreData","_htmlEntities","_compose","_sidebarNavigationScreen","_interopRequireDefault","_link","_sidebarNavigationItem","_addNewTemplate","_sidebarButton","_constants","TemplateItem","postType","postId","props","linkInfo","useLink","
|
|
1
|
+
{"version":3,"names":["_components","require","_i18n","_coreData","_htmlEntities","_compose","_sidebarNavigationScreen","_interopRequireDefault","_link","_sidebarNavigationItem","_addNewTemplate","_sidebarButton","_constants","TemplateItem","postType","postId","props","linkInfo","useLink","_react","createElement","default","SidebarNavigationScreenTemplates","isMobileViewport","useViewportMatch","records","templates","isResolving","isLoading","useEntityRecords","TEMPLATE_POST_TYPE","per_page","sortedTemplates","sort","a","b","title","rendered","localeCompare","browseAllLink","path","canCreate","__","description","actions","templateType","toggleProps","as","SidebarButton","content","Fragment","__experimentalItemGroup","length","__experimentalItem","map","template","id","key","withChevron","decodeEntities","slug","footer"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-templates/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalItem as Item,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useEntityRecords } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport { useLink } from '../routes/link';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport AddNewTemplate from '../add-new-template';\nimport SidebarButton from '../sidebar-button';\nimport { TEMPLATE_POST_TYPE } from '../../utils/constants';\n\nconst TemplateItem = ( { postType, postId, ...props } ) => {\n\tconst linkInfo = useLink( {\n\t\tpostType,\n\t\tpostId,\n\t} );\n\treturn <SidebarNavigationItem { ...linkInfo } { ...props } />;\n};\n\nexport default function SidebarNavigationScreenTemplates() {\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\n\tconst { records: templates, isResolving: isLoading } = useEntityRecords(\n\t\t'postType',\n\t\tTEMPLATE_POST_TYPE,\n\t\t{\n\t\t\tper_page: -1,\n\t\t}\n\t);\n\n\tconst sortedTemplates = templates ? [ ...templates ] : [];\n\tsortedTemplates.sort( ( a, b ) =>\n\t\ta.title.rendered.localeCompare( b.title.rendered )\n\t);\n\n\tconst browseAllLink = useLink( { path: '/wp_template/all' } );\n\tconst canCreate = ! isMobileViewport;\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\ttitle={ __( 'Templates' ) }\n\t\t\tdescription={ __(\n\t\t\t\t'Express the layout of your site with templates.'\n\t\t\t) }\n\t\t\tactions={\n\t\t\t\tcanCreate && (\n\t\t\t\t\t<AddNewTemplate\n\t\t\t\t\t\ttemplateType={ TEMPLATE_POST_TYPE }\n\t\t\t\t\t\ttoggleProps={ {\n\t\t\t\t\t\t\tas: SidebarButton,\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t)\n\t\t\t}\n\t\t\tcontent={\n\t\t\t\t<>\n\t\t\t\t\t{ isLoading && __( 'Loading templates…' ) }\n\t\t\t\t\t{ ! isLoading && (\n\t\t\t\t\t\t<ItemGroup>\n\t\t\t\t\t\t\t{ ! templates?.length && (\n\t\t\t\t\t\t\t\t<Item>{ __( 'No templates found' ) }</Item>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ sortedTemplates.map( ( template ) => (\n\t\t\t\t\t\t\t\t<TemplateItem\n\t\t\t\t\t\t\t\t\tpostType={ TEMPLATE_POST_TYPE }\n\t\t\t\t\t\t\t\t\tpostId={ template.id }\n\t\t\t\t\t\t\t\t\tkey={ template.id }\n\t\t\t\t\t\t\t\t\twithChevron\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ decodeEntities(\n\t\t\t\t\t\t\t\t\t\ttemplate.title?.rendered ||\n\t\t\t\t\t\t\t\t\t\t\ttemplate.slug\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</TemplateItem>\n\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t) }\n\t\t\t\t</>\n\t\t\t}\n\t\t\tfooter={\n\t\t\t\t! isMobileViewport && (\n\t\t\t\t\t<SidebarNavigationItem withChevron { ...browseAllLink }>\n\t\t\t\t\t\t{ __( 'Manage all templates' ) }\n\t\t\t\t\t</SidebarNavigationItem>\n\t\t\t\t)\n\t\t\t}\n\t\t/>\n\t);\n}\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B,IAAAJ,MAAA,CAAAC,aAAA,EAACX,sBAAA,CAAAY,OAAqB;MAACqC,WAAW;MAAA,GAAMnB;IAAa,GAClD,IAAAG,QAAE,EAAE,sBAAuB,CACP;EAExB,CACD,CAAC;AAEJ"}
|
|
@@ -5,13 +5,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = SidebarNavigationScreenTemplatesBrowse;
|
|
8
|
-
var
|
|
8
|
+
var _react = require("react");
|
|
9
9
|
var _i18n = require("@wordpress/i18n");
|
|
10
10
|
var _data = require("@wordpress/data");
|
|
11
11
|
var _components = require("@wordpress/components");
|
|
12
|
+
var _router = require("@wordpress/router");
|
|
12
13
|
var _sidebarNavigationScreen = _interopRequireDefault(require("../sidebar-navigation-screen"));
|
|
13
14
|
var _store = require("../../store");
|
|
14
15
|
var _constants = require("../../utils/constants");
|
|
16
|
+
var _lockUnlock = require("../../lock-unlock");
|
|
15
17
|
/**
|
|
16
18
|
* WordPress dependencies
|
|
17
19
|
*/
|
|
@@ -31,18 +33,28 @@ const config = {
|
|
|
31
33
|
backPath: '/patterns'
|
|
32
34
|
}
|
|
33
35
|
};
|
|
36
|
+
const {
|
|
37
|
+
useLocation
|
|
38
|
+
} = (0, _lockUnlock.unlock)(_router.privateApis);
|
|
34
39
|
function SidebarNavigationScreenTemplatesBrowse() {
|
|
35
40
|
const {
|
|
36
41
|
params: {
|
|
37
42
|
postType
|
|
38
43
|
}
|
|
39
44
|
} = (0, _components.__experimentalUseNavigator)();
|
|
45
|
+
const {
|
|
46
|
+
params: {
|
|
47
|
+
didAccessPatternsPage
|
|
48
|
+
}
|
|
49
|
+
} = useLocation();
|
|
40
50
|
const isTemplatePartsMode = (0, _data.useSelect)(select => {
|
|
41
|
-
|
|
42
|
-
return !!settings.supportsTemplatePartsMode;
|
|
51
|
+
return !!select(_store.store).getSettings().supportsTemplatePartsMode;
|
|
43
52
|
}, []);
|
|
44
|
-
return (0,
|
|
45
|
-
|
|
53
|
+
return (0, _react.createElement)(_sidebarNavigationScreen.default
|
|
54
|
+
// If a classic theme that supports template parts has never
|
|
55
|
+
// accessed the Patterns page, return to the dashboard.
|
|
56
|
+
, {
|
|
57
|
+
isRoot: isTemplatePartsMode && !didAccessPatternsPage,
|
|
46
58
|
title: config[postType].title,
|
|
47
59
|
description: config[postType].description,
|
|
48
60
|
backPath: config[postType].backPath
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_data","_components","_sidebarNavigationScreen","_interopRequireDefault","_store","_constants","config","TEMPLATE_POST_TYPE","title","__","description","TEMPLATE_PART_POST_TYPE","backPath","SidebarNavigationScreenTemplatesBrowse","params","postType","useNavigator","isTemplatePartsMode","useSelect","select","
|
|
1
|
+
{"version":3,"names":["_i18n","require","_data","_components","_router","_sidebarNavigationScreen","_interopRequireDefault","_store","_constants","_lockUnlock","config","TEMPLATE_POST_TYPE","title","__","description","TEMPLATE_PART_POST_TYPE","backPath","useLocation","unlock","routerPrivateApis","SidebarNavigationScreenTemplatesBrowse","params","postType","useNavigator","didAccessPatternsPage","isTemplatePartsMode","useSelect","select","editSiteStore","getSettings","supportsTemplatePartsMode","_react","createElement","default","isRoot"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-templates-browse/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { __experimentalUseNavigator as useNavigator } from '@wordpress/components';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport { store as editSiteStore } from '../../store';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n} from '../../utils/constants';\nimport { unlock } from '../../lock-unlock';\n\nconst config = {\n\t[ TEMPLATE_POST_TYPE ]: {\n\t\ttitle: __( 'All templates' ),\n\t\tdescription: __(\n\t\t\t'Create new templates, or reset any customizations made to the templates supplied by your theme.'\n\t\t),\n\t},\n\t[ TEMPLATE_PART_POST_TYPE ]: {\n\t\ttitle: __( 'All template parts' ),\n\t\tdescription: __(\n\t\t\t'Create new template parts, or reset any customizations made to the template parts supplied by your theme.'\n\t\t),\n\t\tbackPath: '/patterns',\n\t},\n};\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport default function SidebarNavigationScreenTemplatesBrowse() {\n\tconst {\n\t\tparams: { postType },\n\t} = useNavigator();\n\tconst {\n\t\tparams: { didAccessPatternsPage },\n\t} = useLocation();\n\n\tconst isTemplatePartsMode = useSelect( ( select ) => {\n\t\treturn !! select( editSiteStore ).getSettings()\n\t\t\t.supportsTemplatePartsMode;\n\t}, [] );\n\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\t// If a classic theme that supports template parts has never\n\t\t\t// accessed the Patterns page, return to the dashboard.\n\t\t\tisRoot={ isTemplatePartsMode && ! didAccessPatternsPage }\n\t\t\ttitle={ config[ postType ].title }\n\t\t\tdescription={ config[ postType ].description }\n\t\t\tbackPath={ config[ postType ].backPath }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAKA,IAAAI,wBAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,UAAA,GAAAP,OAAA;AAIA,IAAAQ,WAAA,GAAAR,OAAA;AAjBA;AACA;AACA;;AAMA;AACA;AACA;;AASA,MAAMS,MAAM,GAAG;EACd,CAAEC,6BAAkB,GAAI;IACvBC,KAAK,EAAE,IAAAC,QAAE,EAAE,eAAgB,CAAC;IAC5BC,WAAW,EAAE,IAAAD,QAAE,EACd,iGACD;EACD,CAAC;EACD,CAAEE,kCAAuB,GAAI;IAC5BH,KAAK,EAAE,IAAAC,QAAE,EAAE,oBAAqB,CAAC;IACjCC,WAAW,EAAE,IAAAD,QAAE,EACd,2GACD,CAAC;IACDG,QAAQ,EAAE;EACX;AACD,CAAC;AAED,MAAM;EAAEC;AAAY,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAEpC,SAASC,sCAAsCA,CAAA,EAAG;EAChE,MAAM;IACLC,MAAM,EAAE;MAAEC;IAAS;EACpB,CAAC,GAAG,IAAAC,sCAAY,EAAC,CAAC;EAClB,MAAM;IACLF,MAAM,EAAE;MAAEG;IAAsB;EACjC,CAAC,GAAGP,WAAW,CAAC,CAAC;EAEjB,MAAMQ,mBAAmB,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACpD,OAAO,CAAC,CAAEA,MAAM,CAAEC,YAAc,CAAC,CAACC,WAAW,CAAC,CAAC,CAC7CC,yBAAyB;EAC5B,CAAC,EAAE,EAAG,CAAC;EAEP,OACC,IAAAC,MAAA,CAAAC,aAAA,EAAC3B,wBAAA,CAAA4B;EACA;EACA;EAAA;IACAC,MAAM,EAAGT,mBAAmB,IAAI,CAAED,qBAAuB;IACzDZ,KAAK,EAAGF,MAAM,CAAEY,QAAQ,CAAE,CAACV,KAAO;IAClCE,WAAW,EAAGJ,MAAM,CAAEY,QAAQ,CAAE,CAACR,WAAa;IAC9CE,QAAQ,EAAGN,MAAM,CAAEY,QAAQ,CAAE,CAACN;EAAU,CACxC,CAAC;AAEJ"}
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var
|
|
8
|
+
var _react = require("react");
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
10
|
var _data = require("@wordpress/data");
|
|
11
11
|
var _components = require("@wordpress/components");
|
|
@@ -14,6 +14,7 @@ var _i18n = require("@wordpress/i18n");
|
|
|
14
14
|
var _blockEditor = require("@wordpress/block-editor");
|
|
15
15
|
var _coreData = require("@wordpress/core-data");
|
|
16
16
|
var _htmlEntities = require("@wordpress/html-entities");
|
|
17
|
+
var _element = require("@wordpress/element");
|
|
17
18
|
var _icons = require("@wordpress/icons");
|
|
18
19
|
var _commands = require("@wordpress/commands");
|
|
19
20
|
var _keycodes = require("@wordpress/keycodes");
|
|
@@ -87,7 +88,7 @@ const SiteHub = (0, _element.forwardRef)(({
|
|
|
87
88
|
}
|
|
88
89
|
}
|
|
89
90
|
};
|
|
90
|
-
return (0,
|
|
91
|
+
return (0, _react.createElement)(_components.__unstableMotion.div, {
|
|
91
92
|
ref: ref,
|
|
92
93
|
...restProps,
|
|
93
94
|
className: (0, _classnames.default)('edit-site-site-hub', restProps.className),
|
|
@@ -97,15 +98,15 @@ const SiteHub = (0, _element.forwardRef)(({
|
|
|
97
98
|
duration: disableMotion ? 0 : HUB_ANIMATION_DURATION,
|
|
98
99
|
ease: 'easeOut'
|
|
99
100
|
}
|
|
100
|
-
}, (0,
|
|
101
|
+
}, (0, _react.createElement)(_components.__experimentalHStack, {
|
|
101
102
|
justify: "space-between",
|
|
102
103
|
alignment: "center",
|
|
103
104
|
className: "edit-site-site-hub__container"
|
|
104
|
-
}, (0,
|
|
105
|
+
}, (0, _react.createElement)(_components.__experimentalHStack, {
|
|
105
106
|
justify: "flex-start",
|
|
106
107
|
className: "edit-site-site-hub__text-content",
|
|
107
108
|
spacing: "0"
|
|
108
|
-
}, (0,
|
|
109
|
+
}, (0, _react.createElement)(_components.__unstableMotion.div, {
|
|
109
110
|
className: (0, _classnames.default)('edit-site-site-hub__view-mode-toggle-container', {
|
|
110
111
|
'has-transparent-background': isTransparent
|
|
111
112
|
}),
|
|
@@ -115,10 +116,10 @@ const SiteHub = (0, _element.forwardRef)(({
|
|
|
115
116
|
duration: disableMotion ? 0 : HUB_ANIMATION_DURATION,
|
|
116
117
|
ease: 'easeOut'
|
|
117
118
|
}
|
|
118
|
-
}, (0,
|
|
119
|
+
}, (0, _react.createElement)(_components.Button, {
|
|
119
120
|
...siteIconButtonProps,
|
|
120
121
|
className: "edit-site-layout__view-mode-toggle"
|
|
121
|
-
}, (0,
|
|
122
|
+
}, (0, _react.createElement)(_components.__unstableMotion.div, {
|
|
122
123
|
initial: false,
|
|
123
124
|
animate: {
|
|
124
125
|
scale: canvasMode === 'view' ? 0.5 : 1
|
|
@@ -131,9 +132,9 @@ const SiteHub = (0, _element.forwardRef)(({
|
|
|
131
132
|
duration: disableMotion ? 0 : HUB_ANIMATION_DURATION,
|
|
132
133
|
ease: 'easeOut'
|
|
133
134
|
}
|
|
134
|
-
}, (0,
|
|
135
|
+
}, (0, _react.createElement)(_siteIcon.default, {
|
|
135
136
|
className: "edit-site-layout__view-mode-toggle-icon"
|
|
136
|
-
})))), (0,
|
|
137
|
+
})))), (0, _react.createElement)(_components.__unstableAnimatePresence, null, (0, _react.createElement)(_components.__unstableMotion.div, {
|
|
137
138
|
layout: canvasMode === 'edit',
|
|
138
139
|
animate: {
|
|
139
140
|
opacity: canvasMode === 'view' ? 1 : 0
|
|
@@ -150,14 +151,14 @@ const SiteHub = (0, _element.forwardRef)(({
|
|
|
150
151
|
ease: 'easeOut',
|
|
151
152
|
delay: canvasMode === 'view' ? 0.1 : 0
|
|
152
153
|
}
|
|
153
|
-
}, (0, _htmlEntities.decodeEntities)(siteTitle))), canvasMode === 'view' && (0,
|
|
154
|
+
}, (0, _htmlEntities.decodeEntities)(siteTitle))), canvasMode === 'view' && (0, _react.createElement)(_components.Button, {
|
|
154
155
|
href: homeUrl,
|
|
155
156
|
target: "_blank",
|
|
156
157
|
label: (0, _i18n.__)('View site (opens in a new tab)'),
|
|
157
158
|
"aria-label": (0, _i18n.__)('View site (opens in a new tab)'),
|
|
158
159
|
icon: _icons.external,
|
|
159
160
|
className: "edit-site-site-hub__site-view-link"
|
|
160
|
-
})), canvasMode === 'view' && (0,
|
|
161
|
+
})), canvasMode === 'view' && (0, _react.createElement)(_components.Button, {
|
|
161
162
|
className: (0, _classnames.default)('edit-site-site-hub_toggle-command-center', {
|
|
162
163
|
'is-transparent': isTransparent
|
|
163
164
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_classnames","_interopRequireDefault","_data","_components","_compose","_i18n","_blockEditor","_coreData","_htmlEntities","_icons","_commands","_keycodes","_store","_siteIcon","_lockUnlock","HUB_ANIMATION_DURATION","SiteHub","forwardRef","isTransparent","restProps","ref","canvasMode","dashboardLink","homeUrl","siteTitle","useSelect","select","getCanvasMode","getSettings","unlock","editSiteStore","getSite","getUnstableBase","coreStore","__experimentalDashboardLink","home","title","open","openCommandCenter","useDispatch","commandsStore","disableMotion","useReducedMotion","setCanvasMode","__experimentalSetPreviewDeviceType","setPreviewDeviceType","clearSelectedBlock","blockEditorStore","isBackToDashboardButton","siteIconButtonProps","href","label","__","role","onClick","event","preventDefault","createElement","__unstableMotion","div","className","classnames","initial","transition","type","duration","ease","__experimentalHStack","justify","alignment","spacing","layout","Button","animate","scale","whileHover","default","__unstableAnimatePresence","opacity","exit","delay","decodeEntities","target","icon","external","search","shortcut","displayShortcut","primary","_default","exports"],"sources":["@wordpress/edit-site/src/components/site-hub/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tButton,\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport { useReducedMotion } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { forwardRef } from '@wordpress/element';\nimport { search, external } from '@wordpress/icons';\nimport { store as commandsStore } from '@wordpress/commands';\nimport { displayShortcut } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport SiteIcon from '../site-icon';\nimport { unlock } from '../../lock-unlock';\n\nconst HUB_ANIMATION_DURATION = 0.3;\n\nconst SiteHub = forwardRef( ( { isTransparent, ...restProps }, ref ) => {\n\tconst { canvasMode, dashboardLink, homeUrl, siteTitle } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getCanvasMode, getSettings } = unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t);\n\n\t\t\tconst {\n\t\t\t\tgetSite,\n\t\t\t\tgetUnstableBase, // Site index.\n\t\t\t} = select( coreStore );\n\n\t\t\treturn {\n\t\t\t\tcanvasMode: getCanvasMode(),\n\t\t\t\tdashboardLink:\n\t\t\t\t\tgetSettings().__experimentalDashboardLink || 'index.php',\n\t\t\t\thomeUrl: getUnstableBase()?.home,\n\t\t\t\tsiteTitle: getSite()?.title,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst { open: openCommandCenter } = useDispatch( commandsStore );\n\n\tconst disableMotion = useReducedMotion();\n\tconst {\n\t\tsetCanvasMode,\n\t\t__experimentalSetPreviewDeviceType: setPreviewDeviceType,\n\t} = unlock( useDispatch( editSiteStore ) );\n\tconst { clearSelectedBlock } = useDispatch( blockEditorStore );\n\tconst isBackToDashboardButton = canvasMode === 'view';\n\tconst siteIconButtonProps = isBackToDashboardButton\n\t\t? {\n\t\t\t\thref: dashboardLink,\n\t\t\t\tlabel: __( 'Go to the Dashboard' ),\n\t\t }\n\t\t: {\n\t\t\t\thref: dashboardLink, // We need to keep the `href` here so the component doesn't remount as a `<button>` and break the animation.\n\t\t\t\trole: 'button',\n\t\t\t\tlabel: __( 'Open Navigation' ),\n\t\t\t\tonClick: ( event ) => {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tif ( canvasMode === 'edit' ) {\n\t\t\t\t\t\tclearSelectedBlock();\n\t\t\t\t\t\tsetPreviewDeviceType( 'Desktop' );\n\t\t\t\t\t\tsetCanvasMode( 'view' );\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t };\n\n\treturn (\n\t\t<motion.div\n\t\t\tref={ ref }\n\t\t\t{ ...restProps }\n\t\t\tclassName={ classnames(\n\t\t\t\t'edit-site-site-hub',\n\t\t\t\trestProps.className\n\t\t\t) }\n\t\t\tinitial={ false }\n\t\t\ttransition={ {\n\t\t\t\ttype: 'tween',\n\t\t\t\tduration: disableMotion ? 0 : HUB_ANIMATION_DURATION,\n\t\t\t\tease: 'easeOut',\n\t\t\t} }\n\t\t>\n\t\t\t<HStack\n\t\t\t\tjustify=\"space-between\"\n\t\t\t\talignment=\"center\"\n\t\t\t\tclassName=\"edit-site-site-hub__container\"\n\t\t\t>\n\t\t\t\t<HStack\n\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\tclassName=\"edit-site-site-hub__text-content\"\n\t\t\t\t\tspacing=\"0\"\n\t\t\t\t>\n\t\t\t\t\t<motion.div\n\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t'edit-site-site-hub__view-mode-toggle-container',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'has-transparent-background': isTransparent,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tlayout\n\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\tduration: disableMotion\n\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t: HUB_ANIMATION_DURATION,\n\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t{ ...siteIconButtonProps }\n\t\t\t\t\t\t\tclassName=\"edit-site-layout__view-mode-toggle\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\tinitial={ false }\n\t\t\t\t\t\t\t\tanimate={ {\n\t\t\t\t\t\t\t\t\tscale: canvasMode === 'view' ? 0.5 : 1,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\twhileHover={ {\n\t\t\t\t\t\t\t\t\tscale: canvasMode === 'view' ? 0.5 : 0.96,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\t\tduration: disableMotion\n\t\t\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t\t\t: HUB_ANIMATION_DURATION,\n\t\t\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<SiteIcon className=\"edit-site-layout__view-mode-toggle-icon\" />\n\t\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</motion.div>\n\n\t\t\t\t\t<AnimatePresence>\n\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\tlayout={ canvasMode === 'edit' }\n\t\t\t\t\t\t\tanimate={ {\n\t\t\t\t\t\t\t\topacity: canvasMode === 'view' ? 1 : 0,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\texit={ {\n\t\t\t\t\t\t\t\topacity: 0,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t'edit-site-site-hub__site-title',\n\t\t\t\t\t\t\t\t{ 'is-transparent': isTransparent }\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\tduration: disableMotion ? 0 : 0.2,\n\t\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t\t\tdelay: canvasMode === 'view' ? 0.1 : 0,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ decodeEntities( siteTitle ) }\n\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t</AnimatePresence>\n\t\t\t\t\t{ canvasMode === 'view' && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\thref={ homeUrl }\n\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\tlabel={ __( 'View site (opens in a new tab)' ) }\n\t\t\t\t\t\t\taria-label={ __(\n\t\t\t\t\t\t\t\t'View site (opens in a new tab)'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\ticon={ external }\n\t\t\t\t\t\t\tclassName=\"edit-site-site-hub__site-view-link\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</HStack>\n\t\t\t\t{ canvasMode === 'view' && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t'edit-site-site-hub_toggle-command-center',\n\t\t\t\t\t\t\t{ 'is-transparent': isTransparent }\n\t\t\t\t\t\t) }\n\t\t\t\t\t\ticon={ search }\n\t\t\t\t\t\tonClick={ () => openCommandCenter() }\n\t\t\t\t\t\tlabel={ __( 'Open command palette' ) }\n\t\t\t\t\t\tshortcut={ displayShortcut.primary( 'k' ) }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</HStack>\n\t\t</motion.div>\n\t);\n} );\n\nexport default SiteHub;\n"],"mappings":";;;;;;;AAoBA,IAAAA,QAAA,GAAAC,OAAA;AAjBA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AAKA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAMA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AACA,IAAAQ,SAAA,GAAAR,OAAA;AACA,IAAAS,aAAA,GAAAT,OAAA;AAEA,IAAAU,MAAA,GAAAV,OAAA;AACA,IAAAW,SAAA,GAAAX,OAAA;AACA,IAAAY,SAAA,GAAAZ,OAAA;AAKA,IAAAa,MAAA,GAAAb,OAAA;AACA,I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ZC,IAAI,EAAE,OAAO;MACbC,QAAQ,EAAExB,aAAa,GAAG,CAAC,GAAG,GAAG;MACjCyB,IAAI,EAAE,SAAS;MACfc,KAAK,EAAE3D,UAAU,KAAK,MAAM,GAAG,GAAG,GAAG;IACtC;EAAG,GAED,IAAA4D,4BAAc,EAAEzD,SAAU,CACjB,CACI,CAAC,EAChBH,UAAU,KAAK,MAAM,IACtB,IAAAvB,QAAA,CAAA2D,aAAA,EAACtD,WAAA,CAAAqE,MAAM;IACNtB,IAAI,EAAG3B,OAAS;IAChB2D,MAAM,EAAC,QAAQ;IACf/B,KAAK,EAAG,IAAAC,QAAE,EAAE,gCAAiC,CAAG;IAChD,cAAa,IAAAA,QAAE,EACd,gCACD,CAAG;IACH+B,IAAI,EAAGC,eAAU;IACjBxB,SAAS,EAAC;EAAoC,CAC9C,CAEK,CAAC,EACPvC,UAAU,KAAK,MAAM,IACtB,IAAAvB,QAAA,CAAA2D,aAAA,EAACtD,WAAA,CAAAqE,MAAM;IACNZ,SAAS,EAAG,IAAAC,mBAAU,EACrB,0CAA0C,EAC1C;MAAE,gBAAgB,EAAE3C;IAAc,CACnC,CAAG;IACHiE,IAAI,EAAGE,aAAQ;IACf/B,OAAO,EAAGA,CAAA,KAAMhB,iBAAiB,CAAC,CAAG;IACrCa,KAAK,EAAG,IAAAC,QAAE,EAAE,sBAAuB,CAAG;IACtCkC,QAAQ,EAAGC,yBAAe,CAACC,OAAO,CAAE,GAAI;EAAG,CAC3C,CAEK,CACG,CAAC;AAEf,CAAE,CAAC;AAAC,IAAAC,QAAA,GAEWzE,OAAO;AAAA0E,OAAA,CAAAd,OAAA,GAAAa,QAAA"}
|
|
1
|
+
{"version":3,"names":["_classnames","_interopRequireDefault","require","_data","_components","_compose","_i18n","_blockEditor","_coreData","_htmlEntities","_element","_icons","_commands","_keycodes","_store","_siteIcon","_lockUnlock","HUB_ANIMATION_DURATION","SiteHub","forwardRef","isTransparent","restProps","ref","canvasMode","dashboardLink","homeUrl","siteTitle","useSelect","select","getCanvasMode","getSettings","unlock","editSiteStore","getSite","getUnstableBase","coreStore","__experimentalDashboardLink","home","title","open","openCommandCenter","useDispatch","commandsStore","disableMotion","useReducedMotion","setCanvasMode","__experimentalSetPreviewDeviceType","setPreviewDeviceType","clearSelectedBlock","blockEditorStore","isBackToDashboardButton","siteIconButtonProps","href","label","__","role","onClick","event","preventDefault","_react","createElement","__unstableMotion","div","className","classnames","initial","transition","type","duration","ease","__experimentalHStack","justify","alignment","spacing","layout","Button","animate","scale","whileHover","default","__unstableAnimatePresence","opacity","exit","delay","decodeEntities","target","icon","external","search","shortcut","displayShortcut","primary","_default","exports"],"sources":["@wordpress/edit-site/src/components/site-hub/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tButton,\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport { useReducedMotion } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { forwardRef } from '@wordpress/element';\nimport { search, external } from '@wordpress/icons';\nimport { store as commandsStore } from '@wordpress/commands';\nimport { displayShortcut } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport SiteIcon from '../site-icon';\nimport { unlock } from '../../lock-unlock';\n\nconst HUB_ANIMATION_DURATION = 0.3;\n\nconst SiteHub = forwardRef( ( { isTransparent, ...restProps }, ref ) => {\n\tconst { canvasMode, dashboardLink, homeUrl, siteTitle } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getCanvasMode, getSettings } = unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t);\n\n\t\t\tconst {\n\t\t\t\tgetSite,\n\t\t\t\tgetUnstableBase, // Site index.\n\t\t\t} = select( coreStore );\n\n\t\t\treturn {\n\t\t\t\tcanvasMode: getCanvasMode(),\n\t\t\t\tdashboardLink:\n\t\t\t\t\tgetSettings().__experimentalDashboardLink || 'index.php',\n\t\t\t\thomeUrl: getUnstableBase()?.home,\n\t\t\t\tsiteTitle: getSite()?.title,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst { open: openCommandCenter } = useDispatch( commandsStore );\n\n\tconst disableMotion = useReducedMotion();\n\tconst {\n\t\tsetCanvasMode,\n\t\t__experimentalSetPreviewDeviceType: setPreviewDeviceType,\n\t} = unlock( useDispatch( editSiteStore ) );\n\tconst { clearSelectedBlock } = useDispatch( blockEditorStore );\n\tconst isBackToDashboardButton = canvasMode === 'view';\n\tconst siteIconButtonProps = isBackToDashboardButton\n\t\t? {\n\t\t\t\thref: dashboardLink,\n\t\t\t\tlabel: __( 'Go to the Dashboard' ),\n\t\t }\n\t\t: {\n\t\t\t\thref: dashboardLink, // We need to keep the `href` here so the component doesn't remount as a `<button>` and break the animation.\n\t\t\t\trole: 'button',\n\t\t\t\tlabel: __( 'Open Navigation' ),\n\t\t\t\tonClick: ( event ) => {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tif ( canvasMode === 'edit' ) {\n\t\t\t\t\t\tclearSelectedBlock();\n\t\t\t\t\t\tsetPreviewDeviceType( 'Desktop' );\n\t\t\t\t\t\tsetCanvasMode( 'view' );\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t };\n\n\treturn (\n\t\t<motion.div\n\t\t\tref={ ref }\n\t\t\t{ ...restProps }\n\t\t\tclassName={ classnames(\n\t\t\t\t'edit-site-site-hub',\n\t\t\t\trestProps.className\n\t\t\t) }\n\t\t\tinitial={ false }\n\t\t\ttransition={ {\n\t\t\t\ttype: 'tween',\n\t\t\t\tduration: disableMotion ? 0 : HUB_ANIMATION_DURATION,\n\t\t\t\tease: 'easeOut',\n\t\t\t} }\n\t\t>\n\t\t\t<HStack\n\t\t\t\tjustify=\"space-between\"\n\t\t\t\talignment=\"center\"\n\t\t\t\tclassName=\"edit-site-site-hub__container\"\n\t\t\t>\n\t\t\t\t<HStack\n\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\tclassName=\"edit-site-site-hub__text-content\"\n\t\t\t\t\tspacing=\"0\"\n\t\t\t\t>\n\t\t\t\t\t<motion.div\n\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t'edit-site-site-hub__view-mode-toggle-container',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'has-transparent-background': isTransparent,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tlayout\n\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\tduration: disableMotion\n\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t: HUB_ANIMATION_DURATION,\n\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t{ ...siteIconButtonProps }\n\t\t\t\t\t\t\tclassName=\"edit-site-layout__view-mode-toggle\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\tinitial={ false }\n\t\t\t\t\t\t\t\tanimate={ {\n\t\t\t\t\t\t\t\t\tscale: canvasMode === 'view' ? 0.5 : 1,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\twhileHover={ {\n\t\t\t\t\t\t\t\t\tscale: canvasMode === 'view' ? 0.5 : 0.96,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\t\tduration: disableMotion\n\t\t\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t\t\t: HUB_ANIMATION_DURATION,\n\t\t\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<SiteIcon className=\"edit-site-layout__view-mode-toggle-icon\" />\n\t\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</motion.div>\n\n\t\t\t\t\t<AnimatePresence>\n\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\tlayout={ canvasMode === 'edit' }\n\t\t\t\t\t\t\tanimate={ {\n\t\t\t\t\t\t\t\topacity: canvasMode === 'view' ? 1 : 0,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\texit={ {\n\t\t\t\t\t\t\t\topacity: 0,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t'edit-site-site-hub__site-title',\n\t\t\t\t\t\t\t\t{ 'is-transparent': isTransparent }\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\tduration: disableMotion ? 0 : 0.2,\n\t\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t\t\tdelay: canvasMode === 'view' ? 0.1 : 0,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ decodeEntities( siteTitle ) }\n\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t</AnimatePresence>\n\t\t\t\t\t{ canvasMode === 'view' && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\thref={ homeUrl }\n\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\tlabel={ __( 'View site (opens in a new tab)' ) }\n\t\t\t\t\t\t\taria-label={ __(\n\t\t\t\t\t\t\t\t'View site (opens in a new tab)'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\ticon={ external }\n\t\t\t\t\t\t\tclassName=\"edit-site-site-hub__site-view-link\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</HStack>\n\t\t\t\t{ canvasMode === 'view' && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t'edit-site-site-hub_toggle-command-center',\n\t\t\t\t\t\t\t{ 'is-transparent': isTransparent }\n\t\t\t\t\t\t) }\n\t\t\t\t\t\ticon={ search }\n\t\t\t\t\t\tonClick={ () => openCommandCenter() }\n\t\t\t\t\t\tlabel={ __( 'Open command palette' ) }\n\t\t\t\t\t\tshortcut={ displayShortcut.primary( 'k' ) }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</HStack>\n\t\t</motion.div>\n\t);\n} );\n\nexport default SiteHub;\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAMA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,aAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,SAAA,GAAAV,OAAA;AACA,IAAAW,SAAA,GAAAX,OAAA;AAKA,IAAAY,MAAA,GAAAZ,OAAA;AACA,IAAAa,SAAA,GAAAd,sBAAA,CAAAC,OAAA;AACA,IAAAc,WAAA,GAAAd,OAAA;AA9BA;AACA;AACA;;AAGA;AACA;AACA;;AAkBA;AACA;AACA;;AAKA,MAAMe,sBAAsB,GAAG,GAAG;AAElC,MAAMC,OAAO,GAAG,IAAAC,mBAAU,EAAE,CAAE;EAAEC,aAAa;EAAE,GAAGC;AAAU,CAAC,EAAEC,GAAG,KAAM;EACvE,MAAM;IAAEC,UAAU;IAAEC,aAAa;IAAEC,OAAO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,OAAS;IAChB4D,MAAM,EAAC,QAAQ;IACfhC,KAAK,EAAG,IAAAC,QAAE,EAAE,gCAAiC,CAAG;IAChD,cAAa,IAAAA,QAAE,EACd,gCACD,CAAG;IACHgC,IAAI,EAAGC,eAAU;IACjBxB,SAAS,EAAC;EAAoC,CAC9C,CAEK,CAAC,EACPxC,UAAU,KAAK,MAAM,IACtB,IAAAoC,MAAA,CAAAC,aAAA,EAACxD,WAAA,CAAAuE,MAAM;IACNZ,SAAS,EAAG,IAAAC,mBAAU,EACrB,0CAA0C,EAC1C;MAAE,gBAAgB,EAAE5C;IAAc,CACnC,CAAG;IACHkE,IAAI,EAAGE,aAAQ;IACfhC,OAAO,EAAGA,CAAA,KAAMhB,iBAAiB,CAAC,CAAG;IACrCa,KAAK,EAAG,IAAAC,QAAE,EAAE,sBAAuB,CAAG;IACtCmC,QAAQ,EAAGC,yBAAe,CAACC,OAAO,CAAE,GAAI;EAAG,CAC3C,CAEK,CACG,CAAC;AAEf,CAAE,CAAC;AAAC,IAAAC,QAAA,GAEW1E,OAAO;AAAA2E,OAAA,CAAAd,OAAA,GAAAa,QAAA"}
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var
|
|
8
|
+
var _react = require("react");
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
10
|
var _data = require("@wordpress/data");
|
|
11
11
|
var _components = require("@wordpress/components");
|
|
@@ -37,20 +37,20 @@ function SiteIcon({
|
|
|
37
37
|
};
|
|
38
38
|
}, []);
|
|
39
39
|
if (isRequestingSite && !siteIconUrl) {
|
|
40
|
-
return (0,
|
|
40
|
+
return (0, _react.createElement)("div", {
|
|
41
41
|
className: "edit-site-site-icon__image"
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
|
-
const icon = siteIconUrl ? (0,
|
|
44
|
+
const icon = siteIconUrl ? (0, _react.createElement)("img", {
|
|
45
45
|
className: "edit-site-site-icon__image",
|
|
46
46
|
alt: (0, _i18n.__)('Site Icon'),
|
|
47
47
|
src: siteIconUrl
|
|
48
|
-
}) : (0,
|
|
48
|
+
}) : (0, _react.createElement)(_components.Icon, {
|
|
49
49
|
className: "edit-site-site-icon__icon",
|
|
50
50
|
size: "48px",
|
|
51
51
|
icon: _icons.wordpress
|
|
52
52
|
});
|
|
53
|
-
return (0,
|
|
53
|
+
return (0, _react.createElement)("div", {
|
|
54
54
|
className: (0, _classnames.default)(className, 'edit-site-site-icon')
|
|
55
55
|
}, icon);
|
|
56
56
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_classnames","_interopRequireDefault","require","_data","_components","_i18n","_icons","_coreData","SiteIcon","className","isRequestingSite","siteIconUrl","useSelect","select","getEntityRecord","coreDataStore","siteData","undefined","site_icon_url","
|
|
1
|
+
{"version":3,"names":["_classnames","_interopRequireDefault","require","_data","_components","_i18n","_icons","_coreData","SiteIcon","className","isRequestingSite","siteIconUrl","useSelect","select","getEntityRecord","coreDataStore","siteData","undefined","site_icon_url","_react","createElement","icon","alt","__","src","Icon","size","wordpress","classnames","_default","exports","default"],"sources":["@wordpress/edit-site/src/components/site-icon/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { Icon } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { wordpress } from '@wordpress/icons';\nimport { store as coreDataStore } from '@wordpress/core-data';\n\nfunction SiteIcon( { className } ) {\n\tconst { isRequestingSite, siteIconUrl } = useSelect( ( select ) => {\n\t\tconst { getEntityRecord } = select( coreDataStore );\n\t\tconst siteData = getEntityRecord( 'root', '__unstableBase', undefined );\n\n\t\treturn {\n\t\t\tisRequestingSite: ! siteData,\n\t\t\tsiteIconUrl: siteData?.site_icon_url,\n\t\t};\n\t}, [] );\n\n\tif ( isRequestingSite && ! siteIconUrl ) {\n\t\treturn <div className=\"edit-site-site-icon__image\" />;\n\t}\n\n\tconst icon = siteIconUrl ? (\n\t\t<img\n\t\t\tclassName=\"edit-site-site-icon__image\"\n\t\t\talt={ __( 'Site Icon' ) }\n\t\t\tsrc={ siteIconUrl }\n\t\t/>\n\t) : (\n\t\t<Icon\n\t\t\tclassName=\"edit-site-site-icon__icon\"\n\t\t\tsize=\"48px\"\n\t\t\ticon={ wordpress }\n\t\t/>\n\t);\n\n\treturn (\n\t\t<div className={ classnames( className, 'edit-site-site-icon' ) }>\n\t\t\t{ icon }\n\t\t</div>\n\t);\n}\n\nexport default SiteIcon;\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AAZA;AACA;AACA;;AAGA;AACA;AACA;;AAOA,SAASM,QAAQA,CAAE;EAAEC;AAAU,CAAC,EAAG;EAClC,MAAM;IAAEC,gBAAgB;IAAEC;EAAY,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAClE,MAAM;MAAEC;IAAgB,CAAC,GAAGD,MAAM,CAAEE,eAAc,CAAC;IACnD,MAAMC,QAAQ,GAAGF,eAAe,CAAE,MAAM,EAAE,gBAAgB,EAAEG,SAAU,CAAC;IAEvE,OAAO;MACNP,gBAAgB,EAAE,CAAEM,QAAQ;MAC5BL,WAAW,EAAEK,QAAQ,EAAEE;IACxB,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,IAAKR,gBAAgB,IAAI,CAAEC,WAAW,EAAG;IACxC,OAAO,IAAAQ,MAAA,CAAAC,aAAA;MAAKX,SAAS,EAAC;IAA4B,CAAE,CAAC;EACtD;EAEA,MAAMY,IAAI,GAAGV,WAAW,GACvB,IAAAQ,MAAA,CAAAC,aAAA;IACCX,SAAS,EAAC,4BAA4B;IACtCa,GAAG,EAAG,IAAAC,QAAE,EAAE,WAAY,CAAG;IACzBC,GAAG,EAAGb;EAAa,CACnB,CAAC,GAEF,IAAAQ,MAAA,CAAAC,aAAA,EAAChB,WAAA,CAAAqB,IAAI;IACJhB,SAAS,EAAC,2BAA2B;IACrCiB,IAAI,EAAC,MAAM;IACXL,IAAI,EAAGM;EAAW,CAClB,CACD;EAED,OACC,IAAAR,MAAA,CAAAC,aAAA;IAAKX,SAAS,EAAG,IAAAmB,mBAAU,EAAEnB,SAAS,EAAE,qBAAsB;EAAG,GAC9DY,IACE,CAAC;AAER;AAAC,IAAAQ,QAAA,GAEcrB,QAAQ;AAAAsB,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
|
|
@@ -5,18 +5,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = StartTemplateOptions;
|
|
8
|
-
var
|
|
8
|
+
var _react = require("react");
|
|
9
9
|
var _components = require("@wordpress/components");
|
|
10
10
|
var _i18n = require("@wordpress/i18n");
|
|
11
|
+
var _element = require("@wordpress/element");
|
|
11
12
|
var _blockEditor = require("@wordpress/block-editor");
|
|
12
13
|
var _data = require("@wordpress/data");
|
|
13
14
|
var _compose = require("@wordpress/compose");
|
|
14
15
|
var _preferences = require("@wordpress/preferences");
|
|
15
16
|
var _blocks = require("@wordpress/blocks");
|
|
16
|
-
var _store = require("../../store");
|
|
17
17
|
var _coreData = require("@wordpress/core-data");
|
|
18
18
|
var _apiFetch = _interopRequireDefault(require("@wordpress/api-fetch"));
|
|
19
19
|
var _url = require("@wordpress/url");
|
|
20
|
+
var _store = require("../../store");
|
|
20
21
|
var _constants = require("../../utils/constants");
|
|
21
22
|
/**
|
|
22
23
|
* WordPress dependencies
|
|
@@ -105,7 +106,7 @@ function PatternSelection({
|
|
|
105
106
|
const [,, onChange] = (0, _coreData.useEntityBlockEditor)('postType', postType);
|
|
106
107
|
const blockPatterns = useStartPatterns(fallbackContent);
|
|
107
108
|
const shownBlockPatterns = (0, _compose.useAsyncList)(blockPatterns);
|
|
108
|
-
return (0,
|
|
109
|
+
return (0, _react.createElement)(_blockEditor.__experimentalBlockPatternsList, {
|
|
109
110
|
blockPatterns: blockPatterns,
|
|
110
111
|
shownPatterns: shownBlockPatterns,
|
|
111
112
|
onClickPattern: (pattern, blocks) => {
|
|
@@ -126,16 +127,16 @@ function StartModal({
|
|
|
126
127
|
if (!fallbackContent) {
|
|
127
128
|
return null;
|
|
128
129
|
}
|
|
129
|
-
return (0,
|
|
130
|
+
return (0, _react.createElement)(_components.Modal, {
|
|
130
131
|
className: "edit-site-start-template-options__modal",
|
|
131
132
|
title: (0, _i18n.__)('Choose a pattern'),
|
|
132
133
|
closeLabel: (0, _i18n.__)('Cancel'),
|
|
133
134
|
focusOnMount: "firstElement",
|
|
134
135
|
onRequestClose: onClose,
|
|
135
136
|
isFullScreen: true
|
|
136
|
-
}, (0,
|
|
137
|
+
}, (0, _react.createElement)("div", {
|
|
137
138
|
className: "edit-site-start-template-options__modal-content"
|
|
138
|
-
}, (0,
|
|
139
|
+
}, (0, _react.createElement)(PatternSelection, {
|
|
139
140
|
fallbackContent: fallbackContent,
|
|
140
141
|
slug: slug,
|
|
141
142
|
isCustom: isCustom,
|
|
@@ -143,11 +144,11 @@ function StartModal({
|
|
|
143
144
|
onChoosePattern: () => {
|
|
144
145
|
onClose();
|
|
145
146
|
}
|
|
146
|
-
})), (0,
|
|
147
|
+
})), (0, _react.createElement)(_components.Flex, {
|
|
147
148
|
className: "edit-site-start-template-options__modal__actions",
|
|
148
149
|
justify: "flex-end",
|
|
149
150
|
expanded: false
|
|
150
|
-
}, (0,
|
|
151
|
+
}, (0, _react.createElement)(_components.FlexItem, null, (0, _react.createElement)(_components.Button, {
|
|
151
152
|
variant: "tertiary",
|
|
152
153
|
onClick: onClose
|
|
153
154
|
}, (0, _i18n.__)('Skip')))));
|
|
@@ -186,7 +187,7 @@ function StartTemplateOptions() {
|
|
|
186
187
|
if (modalState === START_TEMPLATE_MODAL_STATES.INITIAL && !shouldOpenModal || modalState === START_TEMPLATE_MODAL_STATES.CLOSED) {
|
|
187
188
|
return null;
|
|
188
189
|
}
|
|
189
|
-
return (0,
|
|
190
|
+
return (0, _react.createElement)(StartModal, {
|
|
190
191
|
slug: slug,
|
|
191
192
|
isCustom: isCustom,
|
|
192
193
|
postType: postType,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_components","_i18n","_blockEditor","_data","_compose","_preferences","_blocks","_store","_coreData","_apiFetch","_interopRequireDefault","_url","_constants","useFallbackTemplateContent","slug","isCustom","templateContent","setTemplateContent","useState","useEffect","apiFetch","path","addQueryArgs","is_custom","ignore_empty","then","content","raw","useStartPatterns","fallbackContent","patterns","useSelect","select","getEditedPostType","getEditedPostId","editSiteStore","getEntityRecord","coreStore","postId","postType","record","getSettings","blockEditorStore","__experimentalBlockPatterns","currentThemeStylesheet","getCurrentTheme","stylesheet","injectThemeAttributeInBlockTemplateContent","block","innerBlocks","find","innerBlock","name","map","attributes","theme","undefined","useMemo","blocks","parse","title","__","filter","pattern","Array","isArray","templateTypes","some","templateType","startsWith","PatternSelection","onChoosePattern","onChange","useEntityBlockEditor","blockPatterns","shownBlockPatterns","useAsyncList","createElement","__experimentalBlockPatternsList","shownPatterns","onClickPattern","selection","StartModal","onClose","Modal","className","closeLabel","focusOnMount","onRequestClose","isFullScreen","Flex","justify","expanded","FlexItem","Button","variant","onClick","START_TEMPLATE_MODAL_STATES","INITIAL","CLOSED","StartTemplateOptions","modalState","setModalState","shouldOpenModal","_postType","getEditedEntityRecord","hasEditsForEntityRecord","templateRecord","hasEdits","TEMPLATE_POST_TYPE","preferencesStore","get"],"sources":["@wordpress/edit-site/src/components/start-template-options/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Modal, Flex, FlexItem, Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useState, useEffect, useMemo } from '@wordpress/element';\nimport {\n\t__experimentalBlockPatternsList as BlockPatternsList,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { useAsyncList } from '@wordpress/compose';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { parse } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { store as coreStore, useEntityBlockEditor } from '@wordpress/core-data';\nimport apiFetch from '@wordpress/api-fetch';\nimport { addQueryArgs } from '@wordpress/url';\nimport { TEMPLATE_POST_TYPE } from '../../utils/constants';\n\nfunction useFallbackTemplateContent( slug, isCustom = false ) {\n\tconst [ templateContent, setTemplateContent ] = useState( '' );\n\n\tuseEffect( () => {\n\t\tapiFetch( {\n\t\t\tpath: addQueryArgs( '/wp/v2/templates/lookup', {\n\t\t\t\tslug,\n\t\t\t\tis_custom: isCustom,\n\t\t\t\tignore_empty: true,\n\t\t\t} ),\n\t\t} ).then( ( { content } ) => setTemplateContent( content.raw ) );\n\t}, [ isCustom, slug ] );\n\treturn templateContent;\n}\n\nfunction useStartPatterns( fallbackContent ) {\n\tconst { slug, patterns } = useSelect( ( select ) => {\n\t\tconst { getEditedPostType, getEditedPostId } = select( editSiteStore );\n\t\tconst { getEntityRecord } = select( coreStore );\n\t\tconst postId = getEditedPostId();\n\t\tconst postType = getEditedPostType();\n\t\tconst record = getEntityRecord( 'postType', postType, postId );\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn {\n\t\t\tslug: record.slug,\n\t\t\tpatterns: getSettings().__experimentalBlockPatterns,\n\t\t};\n\t}, [] );\n\n\tconst currentThemeStylesheet = useSelect(\n\t\t( select ) => select( coreStore ).getCurrentTheme().stylesheet\n\t);\n\n\t// Duplicated from packages/block-library/src/pattern/edit.js.\n\tfunction injectThemeAttributeInBlockTemplateContent( block ) {\n\t\tif (\n\t\t\tblock.innerBlocks.find(\n\t\t\t\t( innerBlock ) => innerBlock.name === 'core/template-part'\n\t\t\t)\n\t\t) {\n\t\t\tblock.innerBlocks = block.innerBlocks.map( ( innerBlock ) => {\n\t\t\t\tif (\n\t\t\t\t\tinnerBlock.name === 'core/template-part' &&\n\t\t\t\t\tinnerBlock.attributes.theme === undefined\n\t\t\t\t) {\n\t\t\t\t\tinnerBlock.attributes.theme = currentThemeStylesheet;\n\t\t\t\t}\n\t\t\t\treturn innerBlock;\n\t\t\t} );\n\t\t}\n\n\t\tif (\n\t\t\tblock.name === 'core/template-part' &&\n\t\t\tblock.attributes.theme === undefined\n\t\t) {\n\t\t\tblock.attributes.theme = currentThemeStylesheet;\n\t\t}\n\t\treturn block;\n\t}\n\n\treturn useMemo( () => {\n\t\t// filter patterns that are supposed to be used in the current template being edited.\n\t\treturn [\n\t\t\t{\n\t\t\t\tname: 'fallback',\n\t\t\t\tblocks: parse( fallbackContent ),\n\t\t\t\ttitle: __( 'Fallback content' ),\n\t\t\t},\n\t\t\t...patterns\n\t\t\t\t.filter( ( pattern ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\tArray.isArray( pattern.templateTypes ) &&\n\t\t\t\t\t\tpattern.templateTypes.some( ( templateType ) =>\n\t\t\t\t\t\t\tslug.startsWith( templateType )\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t} )\n\t\t\t\t.map( ( pattern ) => {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...pattern,\n\t\t\t\t\t\tblocks: parse( pattern.content ).map( ( block ) =>\n\t\t\t\t\t\t\tinjectThemeAttributeInBlockTemplateContent( block )\n\t\t\t\t\t\t),\n\t\t\t\t\t};\n\t\t\t\t} ),\n\t\t];\n\t}, [ fallbackContent, slug, patterns ] );\n}\n\nfunction PatternSelection( { fallbackContent, onChoosePattern, postType } ) {\n\tconst [ , , onChange ] = useEntityBlockEditor( 'postType', postType );\n\tconst blockPatterns = useStartPatterns( fallbackContent );\n\tconst shownBlockPatterns = useAsyncList( blockPatterns );\n\treturn (\n\t\t<BlockPatternsList\n\t\t\tblockPatterns={ blockPatterns }\n\t\t\tshownPatterns={ shownBlockPatterns }\n\t\t\tonClickPattern={ ( pattern, blocks ) => {\n\t\t\t\tonChange( blocks, { selection: undefined } );\n\t\t\t\tonChoosePattern();\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nfunction StartModal( { slug, isCustom, onClose, postType } ) {\n\tconst fallbackContent = useFallbackTemplateContent( slug, isCustom );\n\tif ( ! fallbackContent ) {\n\t\treturn null;\n\t}\n\treturn (\n\t\t<Modal\n\t\t\tclassName=\"edit-site-start-template-options__modal\"\n\t\t\ttitle={ __( 'Choose a pattern' ) }\n\t\t\tcloseLabel={ __( 'Cancel' ) }\n\t\t\tfocusOnMount=\"firstElement\"\n\t\t\tonRequestClose={ onClose }\n\t\t\tisFullScreen={ true }\n\t\t>\n\t\t\t<div className=\"edit-site-start-template-options__modal-content\">\n\t\t\t\t<PatternSelection\n\t\t\t\t\tfallbackContent={ fallbackContent }\n\t\t\t\t\tslug={ slug }\n\t\t\t\t\tisCustom={ isCustom }\n\t\t\t\t\tpostType={ postType }\n\t\t\t\t\tonChoosePattern={ () => {\n\t\t\t\t\t\tonClose();\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<Flex\n\t\t\t\tclassName=\"edit-site-start-template-options__modal__actions\"\n\t\t\t\tjustify=\"flex-end\"\n\t\t\t\texpanded={ false }\n\t\t\t>\n\t\t\t\t<FlexItem>\n\t\t\t\t\t<Button variant=\"tertiary\" onClick={ onClose }>\n\t\t\t\t\t\t{ __( 'Skip' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</FlexItem>\n\t\t\t</Flex>\n\t\t</Modal>\n\t);\n}\n\nconst START_TEMPLATE_MODAL_STATES = {\n\tINITIAL: 'INITIAL',\n\tCLOSED: 'CLOSED',\n};\n\nexport default function StartTemplateOptions() {\n\tconst [ modalState, setModalState ] = useState(\n\t\tSTART_TEMPLATE_MODAL_STATES.INITIAL\n\t);\n\tconst { shouldOpenModal, slug, isCustom, postType } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedPostType, getEditedPostId } =\n\t\t\t\tselect( editSiteStore );\n\t\t\tconst _postType = getEditedPostType();\n\t\t\tconst postId = getEditedPostId();\n\t\t\tconst { getEditedEntityRecord, hasEditsForEntityRecord } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst templateRecord = getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t_postType,\n\t\t\t\tpostId\n\t\t\t);\n\t\t\tconst hasEdits = hasEditsForEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t_postType,\n\t\t\t\tpostId\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\tshouldOpenModal:\n\t\t\t\t\t! hasEdits &&\n\t\t\t\t\t'' === templateRecord.content &&\n\t\t\t\t\tTEMPLATE_POST_TYPE === _postType &&\n\t\t\t\t\t! select( preferencesStore ).get(\n\t\t\t\t\t\t'core/edit-site',\n\t\t\t\t\t\t'welcomeGuide'\n\t\t\t\t\t),\n\t\t\t\tslug: templateRecord.slug,\n\t\t\t\tisCustom: templateRecord.is_custom,\n\t\t\t\tpostType: _postType,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tif (\n\t\t( modalState === START_TEMPLATE_MODAL_STATES.INITIAL &&\n\t\t\t! shouldOpenModal ) ||\n\t\tmodalState === START_TEMPLATE_MODAL_STATES.CLOSED\n\t) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<StartModal\n\t\t\tslug={ slug }\n\t\t\tisCustom={ isCustom }\n\t\t\tpostType={ postType }\n\t\t\tonClose={ () =>\n\t\t\t\tsetModalState( START_TEMPLATE_MODAL_STATES.CLOSED )\n\t\t\t}\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;AAKA,IAAAA,QAAA,GAAAC,OAAA;AAFA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KA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I,EAAGA,IAAM;IACbC,QAAQ,EAAGA,QAAU;IACrBwB,QAAQ,EAAGA,QAAU;IACrB4C,OAAO,EAAGA,CAAA,KACTmB,aAAa,CAAEL,2BAA2B,CAACE,MAAO;EAClD,CACD,CAAC;AAEJ"}
|
|
1
|
+
{"version":3,"names":["_components","require","_i18n","_element","_blockEditor","_data","_compose","_preferences","_blocks","_coreData","_apiFetch","_interopRequireDefault","_url","_store","_constants","useFallbackTemplateContent","slug","isCustom","templateContent","setTemplateContent","useState","useEffect","apiFetch","path","addQueryArgs","is_custom","ignore_empty","then","content","raw","useStartPatterns","fallbackContent","patterns","useSelect","select","getEditedPostType","getEditedPostId","editSiteStore","getEntityRecord","coreStore","postId","postType","record","getSettings","blockEditorStore","__experimentalBlockPatterns","currentThemeStylesheet","getCurrentTheme","stylesheet","injectThemeAttributeInBlockTemplateContent","block","innerBlocks","find","innerBlock","name","map","attributes","theme","undefined","useMemo","blocks","parse","title","__","filter","pattern","Array","isArray","templateTypes","some","templateType","startsWith","PatternSelection","onChoosePattern","onChange","useEntityBlockEditor","blockPatterns","shownBlockPatterns","useAsyncList","_react","createElement","__experimentalBlockPatternsList","shownPatterns","onClickPattern","selection","StartModal","onClose","Modal","className","closeLabel","focusOnMount","onRequestClose","isFullScreen","Flex","justify","expanded","FlexItem","Button","variant","onClick","START_TEMPLATE_MODAL_STATES","INITIAL","CLOSED","StartTemplateOptions","modalState","setModalState","shouldOpenModal","_postType","getEditedEntityRecord","hasEditsForEntityRecord","templateRecord","hasEdits","TEMPLATE_POST_TYPE","preferencesStore","get"],"sources":["@wordpress/edit-site/src/components/start-template-options/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Modal, Flex, FlexItem, Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useState, useEffect, useMemo } from '@wordpress/element';\nimport {\n\t__experimentalBlockPatternsList as BlockPatternsList,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { useAsyncList } from '@wordpress/compose';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { parse } from '@wordpress/blocks';\nimport { store as coreStore, useEntityBlockEditor } from '@wordpress/core-data';\nimport apiFetch from '@wordpress/api-fetch';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { TEMPLATE_POST_TYPE } from '../../utils/constants';\n\nfunction useFallbackTemplateContent( slug, isCustom = false ) {\n\tconst [ templateContent, setTemplateContent ] = useState( '' );\n\n\tuseEffect( () => {\n\t\tapiFetch( {\n\t\t\tpath: addQueryArgs( '/wp/v2/templates/lookup', {\n\t\t\t\tslug,\n\t\t\t\tis_custom: isCustom,\n\t\t\t\tignore_empty: true,\n\t\t\t} ),\n\t\t} ).then( ( { content } ) => setTemplateContent( content.raw ) );\n\t}, [ isCustom, slug ] );\n\treturn templateContent;\n}\n\nfunction useStartPatterns( fallbackContent ) {\n\tconst { slug, patterns } = useSelect( ( select ) => {\n\t\tconst { getEditedPostType, getEditedPostId } = select( editSiteStore );\n\t\tconst { getEntityRecord } = select( coreStore );\n\t\tconst postId = getEditedPostId();\n\t\tconst postType = getEditedPostType();\n\t\tconst record = getEntityRecord( 'postType', postType, postId );\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn {\n\t\t\tslug: record.slug,\n\t\t\tpatterns: getSettings().__experimentalBlockPatterns,\n\t\t};\n\t}, [] );\n\n\tconst currentThemeStylesheet = useSelect(\n\t\t( select ) => select( coreStore ).getCurrentTheme().stylesheet\n\t);\n\n\t// Duplicated from packages/block-library/src/pattern/edit.js.\n\tfunction injectThemeAttributeInBlockTemplateContent( block ) {\n\t\tif (\n\t\t\tblock.innerBlocks.find(\n\t\t\t\t( innerBlock ) => innerBlock.name === 'core/template-part'\n\t\t\t)\n\t\t) {\n\t\t\tblock.innerBlocks = block.innerBlocks.map( ( innerBlock ) => {\n\t\t\t\tif (\n\t\t\t\t\tinnerBlock.name === 'core/template-part' &&\n\t\t\t\t\tinnerBlock.attributes.theme === undefined\n\t\t\t\t) {\n\t\t\t\t\tinnerBlock.attributes.theme = currentThemeStylesheet;\n\t\t\t\t}\n\t\t\t\treturn innerBlock;\n\t\t\t} );\n\t\t}\n\n\t\tif (\n\t\t\tblock.name === 'core/template-part' &&\n\t\t\tblock.attributes.theme === undefined\n\t\t) {\n\t\t\tblock.attributes.theme = currentThemeStylesheet;\n\t\t}\n\t\treturn block;\n\t}\n\n\treturn useMemo( () => {\n\t\t// filter patterns that are supposed to be used in the current template being edited.\n\t\treturn [\n\t\t\t{\n\t\t\t\tname: 'fallback',\n\t\t\t\tblocks: parse( fallbackContent ),\n\t\t\t\ttitle: __( 'Fallback content' ),\n\t\t\t},\n\t\t\t...patterns\n\t\t\t\t.filter( ( pattern ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\tArray.isArray( pattern.templateTypes ) &&\n\t\t\t\t\t\tpattern.templateTypes.some( ( templateType ) =>\n\t\t\t\t\t\t\tslug.startsWith( templateType )\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t} )\n\t\t\t\t.map( ( pattern ) => {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...pattern,\n\t\t\t\t\t\tblocks: parse( pattern.content ).map( ( block ) =>\n\t\t\t\t\t\t\tinjectThemeAttributeInBlockTemplateContent( block )\n\t\t\t\t\t\t),\n\t\t\t\t\t};\n\t\t\t\t} ),\n\t\t];\n\t}, [ fallbackContent, slug, patterns ] );\n}\n\nfunction PatternSelection( { fallbackContent, onChoosePattern, postType } ) {\n\tconst [ , , onChange ] = useEntityBlockEditor( 'postType', postType );\n\tconst blockPatterns = useStartPatterns( fallbackContent );\n\tconst shownBlockPatterns = useAsyncList( blockPatterns );\n\treturn (\n\t\t<BlockPatternsList\n\t\t\tblockPatterns={ blockPatterns }\n\t\t\tshownPatterns={ shownBlockPatterns }\n\t\t\tonClickPattern={ ( pattern, blocks ) => {\n\t\t\t\tonChange( blocks, { selection: undefined } );\n\t\t\t\tonChoosePattern();\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nfunction StartModal( { slug, isCustom, onClose, postType } ) {\n\tconst fallbackContent = useFallbackTemplateContent( slug, isCustom );\n\tif ( ! fallbackContent ) {\n\t\treturn null;\n\t}\n\treturn (\n\t\t<Modal\n\t\t\tclassName=\"edit-site-start-template-options__modal\"\n\t\t\ttitle={ __( 'Choose a pattern' ) }\n\t\t\tcloseLabel={ __( 'Cancel' ) }\n\t\t\tfocusOnMount=\"firstElement\"\n\t\t\tonRequestClose={ onClose }\n\t\t\tisFullScreen={ true }\n\t\t>\n\t\t\t<div className=\"edit-site-start-template-options__modal-content\">\n\t\t\t\t<PatternSelection\n\t\t\t\t\tfallbackContent={ fallbackContent }\n\t\t\t\t\tslug={ slug }\n\t\t\t\t\tisCustom={ isCustom }\n\t\t\t\t\tpostType={ postType }\n\t\t\t\t\tonChoosePattern={ () => {\n\t\t\t\t\t\tonClose();\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<Flex\n\t\t\t\tclassName=\"edit-site-start-template-options__modal__actions\"\n\t\t\t\tjustify=\"flex-end\"\n\t\t\t\texpanded={ false }\n\t\t\t>\n\t\t\t\t<FlexItem>\n\t\t\t\t\t<Button variant=\"tertiary\" onClick={ onClose }>\n\t\t\t\t\t\t{ __( 'Skip' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</FlexItem>\n\t\t\t</Flex>\n\t\t</Modal>\n\t);\n}\n\nconst START_TEMPLATE_MODAL_STATES = {\n\tINITIAL: 'INITIAL',\n\tCLOSED: 'CLOSED',\n};\n\nexport default function StartTemplateOptions() {\n\tconst [ modalState, setModalState ] = useState(\n\t\tSTART_TEMPLATE_MODAL_STATES.INITIAL\n\t);\n\tconst { shouldOpenModal, slug, isCustom, postType } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedPostType, getEditedPostId } =\n\t\t\t\tselect( editSiteStore );\n\t\t\tconst _postType = getEditedPostType();\n\t\t\tconst postId = getEditedPostId();\n\t\t\tconst { getEditedEntityRecord, hasEditsForEntityRecord } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst templateRecord = getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t_postType,\n\t\t\t\tpostId\n\t\t\t);\n\t\t\tconst hasEdits = hasEditsForEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t_postType,\n\t\t\t\tpostId\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\tshouldOpenModal:\n\t\t\t\t\t! hasEdits &&\n\t\t\t\t\t'' === templateRecord.content &&\n\t\t\t\t\tTEMPLATE_POST_TYPE === _postType &&\n\t\t\t\t\t! select( preferencesStore ).get(\n\t\t\t\t\t\t'core/edit-site',\n\t\t\t\t\t\t'welcomeGuide'\n\t\t\t\t\t),\n\t\t\t\tslug: templateRecord.slug,\n\t\t\t\tisCustom: templateRecord.is_custom,\n\t\t\t\tpostType: _postType,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tif (\n\t\t( modalState === START_TEMPLATE_MODAL_STATES.INITIAL &&\n\t\t\t! shouldOpenModal ) ||\n\t\tmodalState === START_TEMPLATE_MODAL_STATES.CLOSED\n\t) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<StartModal\n\t\t\tslug={ slug }\n\t\t\tisCustom={ isCustom }\n\t\t\tpostType={ postType }\n\t\t\tonClose={ () =>\n\t\t\t\tsetModalState( START_TEMPLATE_MODAL_STATES.CLOSED )\n\t\t\t}\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAIA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,OA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