@wordpress/edit-site 5.32.0 → 5.34.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 +4 -0
- package/build/components/add-new-page/index.js +3 -0
- package/build/components/add-new-page/index.js.map +1 -1
- package/build/components/add-new-pattern/index.js +8 -7
- package/build/components/add-new-pattern/index.js.map +1 -1
- package/build/components/add-new-template/add-custom-generic-template-modal-content.js +3 -0
- 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 +3 -1
- package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
- package/build/components/add-new-template/index.js +282 -13
- package/build/components/add-new-template/index.js.map +1 -1
- package/build/components/add-new-template/utils.js +22 -11
- package/build/components/add-new-template/utils.js.map +1 -1
- package/build/components/app/index.js.map +1 -1
- package/build/components/async/index.js +51 -0
- package/build/components/async/index.js.map +1 -0
- package/build/components/block-editor/block-inspector-button.js +10 -9
- package/build/components/block-editor/block-inspector-button.js.map +1 -1
- package/build/components/block-editor/editor-canvas.js +15 -6
- package/build/components/block-editor/editor-canvas.js.map +1 -1
- package/build/components/block-editor/inserter-media-categories.js.map +1 -1
- package/build/components/block-editor/resizable-editor.js.map +1 -1
- package/build/components/block-editor/resize-handle.js +20 -5
- package/build/components/block-editor/resize-handle.js.map +1 -1
- package/build/components/block-editor/site-editor-canvas.js +5 -1
- package/build/components/block-editor/site-editor-canvas.js.map +1 -1
- package/build/components/block-editor/use-navigate-to-entity-record.js.map +1 -1
- package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build/components/canvas-loader/index.js.map +1 -1
- package/build/components/code-editor/index.js.map +1 -1
- package/build/components/create-template-part-modal/index.js +3 -0
- package/build/components/create-template-part-modal/index.js.map +1 -1
- package/build/components/editor/index.js +61 -11
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor-canvas-container/index.js.map +1 -1
- package/build/components/error-boundary/index.js.map +1 -1
- package/build/components/error-boundary/warning.js.map +1 -1
- package/build/components/global-styles/background-panel.js +13 -1
- package/build/components/global-styles/background-panel.js.map +1 -1
- package/build/components/global-styles/block-preview-panel.js +6 -1
- package/build/components/global-styles/block-preview-panel.js.map +1 -1
- package/build/components/global-styles/color-indicator-wrapper.js.map +1 -1
- package/build/components/global-styles/color-palette-panel.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/font-families.js +1 -1
- package/build/components/global-styles/font-families.js.map +1 -1
- package/build/components/global-styles/font-family-item.js.map +1 -1
- package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
- package/build/components/global-styles/font-library-modal/context.js +69 -35
- package/build/components/global-styles/font-library-modal/context.js.map +1 -1
- 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 +18 -6
- 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.map +1 -1
- 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 +1 -1
- package/build/components/global-styles/font-library-modal/index.js.map +1 -1
- package/build/components/global-styles/font-library-modal/installed-fonts.js +31 -28
- package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- 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.map +1 -1
- package/build/components/global-styles/font-library-modal/resolvers.js.map +1 -1
- package/build/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/constants.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/filter-fonts.js.map +1 -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/index.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js +6 -2
- package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/toggleFont.js.map +1 -1
- package/build/components/global-styles/global-styles-provider.js.map +1 -1
- package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build/components/global-styles/header.js.map +1 -1
- package/build/components/global-styles/highlighted-colors.js +1 -1
- package/build/components/global-styles/highlighted-colors.js.map +1 -1
- package/build/components/global-styles/hooks.js +11 -3
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/icon-with-current-color.js.map +1 -1
- package/build/components/global-styles/index.js.map +1 -1
- package/build/components/global-styles/navigation-button.js.map +1 -1
- package/build/components/global-styles/palette.js.map +1 -1
- package/build/components/global-styles/preview-colors.js.map +1 -1
- package/build/components/global-styles/preview-iframe.js.map +1 -1
- package/build/components/global-styles/preview-styles.js.map +1 -1
- package/build/components/global-styles/root-menu.js +2 -2
- package/build/components/global-styles/root-menu.js.map +1 -1
- package/build/components/global-styles/screen-background.js +1 -1
- package/build/components/global-styles/screen-background.js.map +1 -1
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-block.js.map +1 -1
- package/build/components/global-styles/screen-color-palette.js.map +1 -1
- package/build/components/global-styles/screen-colors.js.map +1 -1
- package/build/components/global-styles/screen-css.js.map +1 -1
- package/build/components/global-styles/screen-layout.js.map +1 -1
- package/build/components/global-styles/screen-revisions/index.js +1 -1
- package/build/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build/components/global-styles/screen-root.js.map +1 -1
- package/build/components/global-styles/screen-style-variations.js.map +1 -1
- package/build/components/global-styles/screen-typography-element.js.map +1 -1
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/style-variations-container.js +8 -2
- package/build/components/global-styles/style-variations-container.js.map +1 -1
- package/build/components/global-styles/subtitle.js.map +1 -1
- package/build/components/global-styles/typography-elements.js.map +1 -1
- package/build/components/global-styles/typography-example.js.map +1 -1
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/typography-preview.js.map +1 -1
- package/build/components/global-styles/ui.js +1 -1
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/global-styles/variations/variation.js.map +1 -1
- package/build/components/global-styles/variations/variations-color.js.map +1 -1
- package/build/components/global-styles/variations/variations-panel.js.map +1 -1
- package/build/components/global-styles/variations/variations-typography.js.map +1 -1
- package/build/components/global-styles-renderer/index.js.map +1 -1
- package/build/components/header-edit-mode/document-tools/index.js.map +1 -1
- package/build/components/header-edit-mode/index.js +36 -52
- package/build/components/header-edit-mode/index.js.map +1 -1
- package/build/components/header-edit-mode/more-menu/index.js +4 -100
- package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
- 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.map +1 -1
- package/build/components/keyboard-shortcuts/global.js.map +1 -1
- package/build/components/keyboard-shortcuts/register.js +0 -67
- package/build/components/keyboard-shortcuts/register.js.map +1 -1
- package/build/components/layout/animation.js +3 -2
- package/build/components/layout/animation.js.map +1 -1
- package/build/components/layout/hooks.js.map +1 -1
- package/build/components/layout/index.js +20 -52
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/router.js +70 -33
- package/build/components/layout/router.js.map +1 -1
- package/build/components/media/index.js.map +1 -1
- package/build/components/page/header.js.map +1 -1
- package/build/components/page/index.js +5 -2
- package/build/components/page/index.js.map +1 -1
- package/build/components/page-pages/index.js +18 -19
- package/build/components/page-pages/index.js.map +1 -1
- package/build/components/page-patterns/dataviews-pattern-actions.js +16 -11
- package/build/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
- package/build/components/page-patterns/delete-category-menu-item.js.map +1 -1
- package/build/components/page-patterns/header.js +5 -3
- package/build/components/page-patterns/header.js.map +1 -1
- package/build/components/page-patterns/index.js +140 -62
- package/build/components/page-patterns/index.js.map +1 -1
- package/build/components/page-patterns/rename-category-menu-item.js.map +1 -1
- package/build/components/page-patterns/search-items.js +2 -1
- package/build/components/page-patterns/search-items.js.map +1 -1
- package/build/components/page-patterns/use-pattern-settings.js.map +1 -1
- package/build/components/page-patterns/use-patterns.js +6 -10
- package/build/components/page-patterns/use-patterns.js.map +1 -1
- package/build/components/page-patterns/utils.js.map +1 -1
- package/build/components/page-templates/hooks.js.map +1 -0
- package/build/components/{page-templates-template-parts → page-templates}/index.js +78 -103
- package/build/components/page-templates/index.js.map +1 -0
- package/build/components/pagination/index.js.map +1 -1
- package/build/components/pattern-modal/duplicate.js +13 -8
- package/build/components/pattern-modal/duplicate.js.map +1 -1
- package/build/components/pattern-modal/index.js.map +1 -1
- package/build/components/pattern-modal/rename.js +6 -3
- package/build/components/pattern-modal/rename.js.map +1 -1
- package/build/components/plugin-template-setting-panel/index.js +9 -0
- package/build/components/plugin-template-setting-panel/index.js.map +1 -1
- package/build/components/{template-actions/rename-menu-item.js → rename-post-menu-item/index.js} +18 -16
- package/build/components/rename-post-menu-item/index.js.map +1 -0
- package/build/components/resizable-frame/index.js +10 -11
- package/build/components/resizable-frame/index.js.map +1 -1
- package/build/components/revisions/index.js.map +1 -1
- package/build/components/routes/link.js.map +1 -1
- package/build/components/routes/use-title.js.map +1 -1
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/save-hub/index.js.map +1 -1
- package/build/components/save-panel/index.js +3 -3
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/sidebar/index.js +41 -75
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-button/index.js.map +1 -1
- package/build/components/sidebar-dataviews/add-new-view.js.map +1 -1
- package/build/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
- package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build/components/sidebar-dataviews/default-views.js +1 -1
- package/build/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build/components/sidebar-dataviews/index.js +1 -1
- package/build/components/sidebar-dataviews/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/default-sidebar.js +18 -7
- package/build/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js +5 -3
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build/components/sidebar-edit-mode/index.js +31 -55
- package/build/components/sidebar-edit-mode/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/index.js +55 -3
- package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/page-summary.js +23 -16
- package/build/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
- package/build/components/sidebar-edit-mode/settings-header/index.js +4 -5
- package/build/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-panel/hooks.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-panel/index.js +3 -6
- package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
- package/build/components/sidebar-navigation-item/index.js +31 -0
- package/build/components/sidebar-navigation-item/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen/index.js +36 -9
- package/build/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
- 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.map +1 -1
- 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.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js +1 -2
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/index.js +6 -15
- package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js +7 -2
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
- 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.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +20 -15
- package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js +1 -1
- 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 +6 -5
- 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.map +1 -1
- package/build/components/sidebar-navigation-screen-page/index.js +53 -12
- package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/index.js +17 -15
- 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.map +1 -1
- 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.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +3 -1
- 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.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js +1 -1
- 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 -2
- package/build/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/index.js +64 -52
- package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
- package/build/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -1
- package/build/components/sidebar-navigation-screen-template/index.js +11 -8
- package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-template/template-areas.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/content.js +3 -3
- package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/index.js +4 -36
- package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build/components/site-hub/index.js +22 -21
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/site-icon/index.js.map +1 -1
- package/build/components/start-template-options/index.js.map +1 -1
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +14 -13
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
- package/build/components/table/index.js.map +1 -1
- package/build/components/template-actions/index.js +7 -8
- package/build/components/template-actions/index.js.map +1 -1
- package/build/components/template-part-converter/convert-to-regular.js.map +1 -1
- package/build/components/template-part-converter/convert-to-template-part.js.map +1 -1
- package/build/components/template-part-converter/index.js.map +1 -1
- package/build/components/use-edited-entity-record/index.js.map +1 -1
- package/build/components/welcome-guide/editor.js.map +1 -1
- package/build/components/welcome-guide/image.js.map +1 -1
- package/build/components/welcome-guide/index.js.map +1 -1
- package/build/components/welcome-guide/page.js.map +1 -1
- package/build/components/welcome-guide/styles.js +6 -3
- package/build/components/welcome-guide/styles.js.map +1 -1
- package/build/components/welcome-guide/template.js.map +1 -1
- package/build/deprecated.js +55 -0
- package/build/deprecated.js.map +1 -0
- package/build/hooks/commands/use-common-commands.js.map +1 -1
- package/build/hooks/commands/use-edit-mode-commands.js +10 -28
- package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build/hooks/components.js.map +1 -1
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/push-changes-to-global-styles/index.js +3 -40
- package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +36 -5
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
- package/build/index.js +18 -23
- package/build/index.js.map +1 -1
- package/build/lock-unlock.js.map +1 -1
- package/build/store/actions.js +21 -96
- package/build/store/actions.js.map +1 -1
- package/build/store/constants.js.map +1 -1
- package/build/store/index.js +1 -1
- package/build/store/index.js.map +1 -1
- package/build/store/private-actions.js +1 -85
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js.map +1 -1
- package/build/utils/clone-deep.js.map +1 -1
- package/build/utils/constants.js +2 -2
- package/build/utils/constants.js.map +1 -1
- package/build/utils/get-is-list-page.js.map +1 -1
- package/build/utils/is-previewing-theme.js.map +1 -1
- package/build/utils/is-template-removable.js.map +1 -1
- package/build/utils/is-template-revertable.js.map +1 -1
- package/build/utils/math.js.map +1 -1
- package/build/utils/set-nested-value.js +44 -0
- package/build/utils/set-nested-value.js.map +1 -0
- package/build/utils/template-part-create.js.map +1 -1
- package/build/utils/use-activate-theme.js.map +1 -1
- package/build/utils/use-actual-current-theme.js.map +1 -1
- package/build-module/components/add-new-page/index.js +3 -0
- package/build-module/components/add-new-page/index.js.map +1 -1
- package/build-module/components/add-new-pattern/index.js +8 -7
- 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 +3 -0
- package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
- package/build-module/components/add-new-template/add-custom-template-modal-content.js +3 -1
- package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
- package/build-module/components/add-new-template/index.js +283 -14
- package/build-module/components/add-new-template/index.js.map +1 -1
- package/build-module/components/add-new-template/utils.js +21 -11
- package/build-module/components/add-new-template/utils.js.map +1 -1
- package/build-module/components/app/index.js.map +1 -1
- package/build-module/components/async/index.js +44 -0
- package/build-module/components/async/index.js.map +1 -0
- package/build-module/components/block-editor/block-inspector-button.js +9 -8
- package/build-module/components/block-editor/block-inspector-button.js.map +1 -1
- package/build-module/components/block-editor/editor-canvas.js +16 -7
- package/build-module/components/block-editor/editor-canvas.js.map +1 -1
- package/build-module/components/block-editor/inserter-media-categories.js.map +1 -1
- package/build-module/components/block-editor/resizable-editor.js.map +1 -1
- package/build-module/components/block-editor/resize-handle.js +21 -6
- package/build-module/components/block-editor/resize-handle.js.map +1 -1
- package/build-module/components/block-editor/site-editor-canvas.js +5 -1
- package/build-module/components/block-editor/site-editor-canvas.js.map +1 -1
- package/build-module/components/block-editor/use-navigate-to-entity-record.js.map +1 -1
- package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build-module/components/canvas-loader/index.js.map +1 -1
- package/build-module/components/code-editor/index.js.map +1 -1
- package/build-module/components/create-template-part-modal/index.js +3 -0
- package/build-module/components/create-template-part-modal/index.js.map +1 -1
- package/build-module/components/editor/index.js +61 -11
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor-canvas-container/index.js.map +1 -1
- package/build-module/components/error-boundary/index.js.map +1 -1
- package/build-module/components/error-boundary/warning.js.map +1 -1
- package/build-module/components/global-styles/background-panel.js +14 -1
- package/build-module/components/global-styles/background-panel.js.map +1 -1
- package/build-module/components/global-styles/block-preview-panel.js +6 -1
- package/build-module/components/global-styles/block-preview-panel.js.map +1 -1
- package/build-module/components/global-styles/color-indicator-wrapper.js.map +1 -1
- package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/font-families.js.map +1 -1
- package/build-module/components/global-styles/font-family-item.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/context.js +68 -35
- 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.map +1 -1
- package/build-module/components/global-styles/font-library-modal/font-collection.js +19 -7
- 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.map +1 -1
- package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/index.js +2 -2
- 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 +32 -29
- 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-details.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +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/upload-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/constants.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js.map +1 -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/index.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js +6 -2
- package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/toggleFont.js.map +1 -1
- package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
- package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/header.js.map +1 -1
- package/build-module/components/global-styles/highlighted-colors.js +1 -1
- package/build-module/components/global-styles/highlighted-colors.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +11 -3
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/icon-with-current-color.js.map +1 -1
- package/build-module/components/global-styles/index.js.map +1 -1
- package/build-module/components/global-styles/navigation-button.js.map +1 -1
- package/build-module/components/global-styles/palette.js.map +1 -1
- package/build-module/components/global-styles/preview-colors.js.map +1 -1
- package/build-module/components/global-styles/preview-iframe.js.map +1 -1
- package/build-module/components/global-styles/preview-styles.js.map +1 -1
- package/build-module/components/global-styles/root-menu.js +2 -2
- package/build-module/components/global-styles/root-menu.js.map +1 -1
- package/build-module/components/global-styles/screen-background.js +1 -1
- package/build-module/components/global-styles/screen-background.js.map +1 -1
- package/build-module/components/global-styles/screen-block-list.js.map +1 -1
- package/build-module/components/global-styles/screen-block.js.map +1 -1
- package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
- package/build-module/components/global-styles/screen-colors.js.map +1 -1
- package/build-module/components/global-styles/screen-css.js.map +1 -1
- package/build-module/components/global-styles/screen-layout.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/index.js +1 -1
- package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build-module/components/global-styles/screen-root.js.map +1 -1
- package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
- package/build-module/components/global-styles/screen-typography-element.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/style-variations-container.js +8 -2
- package/build-module/components/global-styles/style-variations-container.js.map +1 -1
- package/build-module/components/global-styles/subtitle.js.map +1 -1
- package/build-module/components/global-styles/typography-elements.js.map +1 -1
- package/build-module/components/global-styles/typography-example.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/typography-preview.js.map +1 -1
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/global-styles/variations/variation.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-color.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-panel.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-typography.js.map +1 -1
- package/build-module/components/global-styles-renderer/index.js.map +1 -1
- package/build-module/components/header-edit-mode/document-tools/index.js.map +1 -1
- package/build-module/components/header-edit-mode/index.js +41 -57
- package/build-module/components/header-edit-mode/index.js.map +1 -1
- package/build-module/components/header-edit-mode/more-menu/index.js +6 -100
- package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
- package/build-module/components/header-edit-mode/more-menu/site-export.js.map +1 -1
- package/build-module/components/header-edit-mode/more-menu/welcome-guide-menu-item.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/global.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/register.js +0 -67
- package/build-module/components/keyboard-shortcuts/register.js.map +1 -1
- package/build-module/components/layout/animation.js +4 -3
- package/build-module/components/layout/animation.js.map +1 -1
- package/build-module/components/layout/hooks.js.map +1 -1
- package/build-module/components/layout/index.js +20 -52
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/layout/router.js +70 -33
- package/build-module/components/layout/router.js.map +1 -1
- package/build-module/components/media/index.js.map +1 -1
- package/build-module/components/page/header.js.map +1 -1
- package/build-module/components/page/index.js +5 -2
- package/build-module/components/page/index.js.map +1 -1
- package/build-module/components/page-pages/index.js +18 -19
- package/build-module/components/page-pages/index.js.map +1 -1
- package/build-module/components/page-patterns/dataviews-pattern-actions.js +16 -11
- package/build-module/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
- package/build-module/components/page-patterns/delete-category-menu-item.js.map +1 -1
- package/build-module/components/page-patterns/header.js +5 -3
- package/build-module/components/page-patterns/header.js.map +1 -1
- package/build-module/components/page-patterns/index.js +143 -65
- package/build-module/components/page-patterns/index.js.map +1 -1
- package/build-module/components/page-patterns/rename-category-menu-item.js.map +1 -1
- package/build-module/components/page-patterns/search-items.js +3 -2
- package/build-module/components/page-patterns/search-items.js.map +1 -1
- package/build-module/components/page-patterns/use-pattern-settings.js.map +1 -1
- package/build-module/components/page-patterns/use-patterns.js +3 -6
- package/build-module/components/page-patterns/use-patterns.js.map +1 -1
- package/build-module/components/page-patterns/utils.js.map +1 -1
- package/build-module/components/page-templates/hooks.js.map +1 -0
- package/build-module/components/{page-templates-template-parts → page-templates}/index.js +77 -102
- package/build-module/components/page-templates/index.js.map +1 -0
- package/build-module/components/pagination/index.js.map +1 -1
- package/build-module/components/pattern-modal/duplicate.js +11 -6
- package/build-module/components/pattern-modal/duplicate.js.map +1 -1
- package/build-module/components/pattern-modal/index.js.map +1 -1
- package/build-module/components/pattern-modal/rename.js +4 -1
- package/build-module/components/pattern-modal/rename.js.map +1 -1
- package/build-module/components/plugin-template-setting-panel/index.js +8 -0
- package/build-module/components/plugin-template-setting-panel/index.js.map +1 -1
- package/build-module/components/{template-actions/rename-menu-item.js → rename-post-menu-item/index.js} +17 -15
- package/build-module/components/rename-post-menu-item/index.js.map +1 -0
- package/build-module/components/resizable-frame/index.js +10 -11
- package/build-module/components/resizable-frame/index.js.map +1 -1
- package/build-module/components/revisions/index.js.map +1 -1
- package/build-module/components/routes/link.js.map +1 -1
- package/build-module/components/routes/use-title.js.map +1 -1
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/save-hub/index.js.map +1 -1
- package/build-module/components/save-panel/index.js +2 -2
- package/build-module/components/save-panel/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +42 -75
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-button/index.js.map +1 -1
- package/build-module/components/sidebar-dataviews/add-new-view.js.map +1 -1
- package/build-module/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
- package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build-module/components/sidebar-dataviews/default-views.js +1 -1
- package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build-module/components/sidebar-dataviews/index.js +1 -1
- package/build-module/components/sidebar-dataviews/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/default-sidebar.js +16 -5
- package/build-module/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +5 -3
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/index.js +30 -54
- package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/index.js +58 -6
- package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js +25 -17
- package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/settings-header/index.js +4 -5
- package/build-module/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/template-panel/hooks.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/template-panel/index.js +4 -7
- package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-item/index.js +31 -0
- package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen/index.js +37 -10
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-details-panel/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +2 -3
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +7 -16
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +8 -3
- package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +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-menu/single-navigation-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +20 -15
- package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +6 -5
- package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-page/index.js +56 -15
- package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/index.js +17 -15
- package/build-module/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +3 -1
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.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-pattern/use-pattern-details.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/category-item.js +3 -2
- package/build-module/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/index.js +66 -54
- package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-template/index.js +13 -9
- package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-template/template-areas.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +3 -3
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +4 -36
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build-module/components/site-hub/index.js +22 -21
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/site-icon/index.js.map +1 -1
- package/build-module/components/start-template-options/index.js.map +1 -1
- package/build-module/components/style-book/index.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +14 -13
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
- package/build-module/components/table/index.js.map +1 -1
- package/build-module/components/template-actions/index.js +7 -8
- package/build-module/components/template-actions/index.js.map +1 -1
- package/build-module/components/template-part-converter/convert-to-regular.js.map +1 -1
- package/build-module/components/template-part-converter/convert-to-template-part.js.map +1 -1
- package/build-module/components/template-part-converter/index.js.map +1 -1
- package/build-module/components/use-edited-entity-record/index.js.map +1 -1
- package/build-module/components/welcome-guide/editor.js.map +1 -1
- package/build-module/components/welcome-guide/image.js.map +1 -1
- package/build-module/components/welcome-guide/index.js.map +1 -1
- package/build-module/components/welcome-guide/page.js.map +1 -1
- package/build-module/components/welcome-guide/styles.js +6 -3
- package/build-module/components/welcome-guide/styles.js.map +1 -1
- package/build-module/components/welcome-guide/template.js.map +1 -1
- package/build-module/deprecated.js +45 -0
- package/build-module/deprecated.js.map +1 -0
- package/build-module/hooks/commands/use-common-commands.js.map +1 -1
- package/build-module/hooks/commands/use-edit-mode-commands.js +11 -29
- package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build-module/hooks/components.js.map +1 -1
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/push-changes-to-global-styles/index.js +1 -38
- package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +35 -5
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
- package/build-module/index.js +1 -5
- package/build-module/index.js.map +1 -1
- package/build-module/lock-unlock.js.map +1 -1
- package/build-module/store/actions.js +16 -92
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/constants.js.map +1 -1
- package/build-module/store/index.js.map +1 -1
- package/build-module/store/private-actions.js +0 -83
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/clone-deep.js.map +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.map +1 -1
- package/build-module/utils/is-previewing-theme.js.map +1 -1
- package/build-module/utils/is-template-removable.js.map +1 -1
- package/build-module/utils/is-template-revertable.js.map +1 -1
- package/build-module/utils/math.js.map +1 -1
- package/build-module/utils/set-nested-value.js +38 -0
- package/build-module/utils/set-nested-value.js.map +1 -0
- package/build-module/utils/template-part-create.js.map +1 -1
- package/build-module/utils/use-activate-theme.js.map +1 -1
- package/build-module/utils/use-actual-current-theme.js.map +1 -1
- package/build-style/style-rtl.css +261 -720
- package/build-style/style.css +261 -720
- package/package.json +43 -44
- package/src/components/add-new-page/index.js +7 -1
- package/src/components/add-new-pattern/index.js +15 -12
- package/src/components/add-new-template/add-custom-generic-template-modal-content.js +3 -0
- package/src/components/add-new-template/add-custom-template-modal-content.js +3 -1
- package/src/components/add-new-template/index.js +412 -12
- package/src/components/add-new-template/style.scss +0 -22
- package/src/components/add-new-template/utils.js +44 -24
- package/src/components/async/index.js +43 -0
- package/src/components/block-editor/block-inspector-button.js +9 -11
- package/src/components/block-editor/editor-canvas.js +45 -21
- package/src/components/block-editor/resize-handle.js +30 -11
- package/src/components/block-editor/site-editor-canvas.js +6 -1
- package/src/components/block-editor/style.scss +10 -15
- package/src/components/create-template-part-modal/index.js +3 -0
- package/src/components/editor/index.js +91 -15
- package/src/components/editor/style.scss +6 -1
- package/src/components/global-styles/background-panel.js +16 -0
- package/src/components/global-styles/block-preview-panel.js +6 -1
- package/src/components/global-styles/font-library-modal/context.js +85 -54
- package/src/components/global-styles/font-library-modal/font-collection.js +265 -222
- package/src/components/global-styles/font-library-modal/index.js +2 -2
- package/src/components/global-styles/font-library-modal/installed-fonts.js +184 -147
- package/src/components/global-styles/font-library-modal/style.scss +48 -13
- package/src/components/global-styles/font-library-modal/utils/sort-font-faces.js +6 -2
- package/src/components/global-styles/highlighted-colors.js +1 -1
- package/src/components/global-styles/hooks.js +20 -3
- package/src/components/global-styles/root-menu.js +2 -2
- package/src/components/global-styles/screen-background.js +1 -1
- package/src/components/global-styles/screen-revisions/index.js +1 -1
- package/src/components/global-styles/style-variations-container.js +11 -2
- package/src/components/header-edit-mode/index.js +56 -78
- package/src/components/header-edit-mode/more-menu/index.js +9 -157
- package/src/components/header-edit-mode/style.scss +14 -86
- package/src/components/keyboard-shortcuts/register.js +0 -78
- package/src/components/layout/animation.js +6 -3
- package/src/components/layout/index.js +23 -52
- package/src/components/layout/router.js +73 -50
- package/src/components/layout/style.scss +15 -37
- package/src/components/page/index.js +7 -2
- package/src/components/page-pages/index.js +46 -26
- package/src/components/page-pages/style.scss +40 -22
- package/src/components/page-patterns/dataviews-pattern-actions.js +13 -15
- package/src/components/page-patterns/header.js +7 -3
- package/src/components/page-patterns/index.js +162 -109
- package/src/components/page-patterns/search-items.js +3 -0
- package/src/components/page-patterns/style.scss +21 -7
- package/src/components/page-patterns/use-patterns.js +3 -6
- package/src/components/{page-templates-template-parts → page-templates}/index.js +46 -84
- package/src/components/{page-templates-template-parts → page-templates}/style.scss +2 -2
- package/src/components/pattern-modal/duplicate.js +6 -4
- package/src/components/pattern-modal/rename.js +2 -1
- package/src/components/plugin-template-setting-panel/index.js +8 -0
- package/src/components/{template-actions/rename-menu-item.js → rename-post-menu-item/index.js} +20 -24
- package/src/components/resizable-frame/index.js +6 -9
- package/src/components/save-panel/index.js +2 -2
- package/src/components/sidebar/index.js +52 -100
- package/src/components/sidebar/style.scss +41 -6
- package/src/components/sidebar-dataviews/default-views.js +1 -1
- package/src/components/sidebar-dataviews/index.js +1 -1
- package/src/components/sidebar-edit-mode/default-sidebar.js +13 -6
- package/src/components/sidebar-edit-mode/global-styles-sidebar.js +7 -3
- package/src/components/sidebar-edit-mode/index.js +50 -75
- package/src/components/sidebar-edit-mode/page-panels/index.js +65 -14
- package/src/components/sidebar-edit-mode/page-panels/page-summary.js +40 -20
- package/src/components/sidebar-edit-mode/settings-header/index.js +4 -5
- package/src/components/sidebar-edit-mode/style.scss +1 -1
- package/src/components/sidebar-edit-mode/template-panel/index.js +3 -13
- package/src/components/sidebar-navigation-item/index.js +29 -0
- package/src/components/sidebar-navigation-screen/index.js +29 -12
- package/src/components/sidebar-navigation-screen/style.scss +1 -21
- package/src/components/sidebar-navigation-screen-global-styles/index.js +2 -11
- package/src/components/sidebar-navigation-screen-main/index.js +11 -23
- package/src/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +1 -1
- package/src/components/sidebar-navigation-screen-navigation-menu/index.js +7 -6
- package/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +1 -1
- package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +14 -14
- package/src/components/sidebar-navigation-screen-navigation-menus/index.js +1 -1
- package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +4 -5
- package/src/components/sidebar-navigation-screen-page/index.js +63 -14
- package/src/components/sidebar-navigation-screen-page/style.scss +8 -2
- package/src/components/sidebar-navigation-screen-pattern/index.js +13 -15
- package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +3 -1
- package/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js +1 -1
- package/src/components/sidebar-navigation-screen-patterns/category-item.js +2 -1
- package/src/components/sidebar-navigation-screen-patterns/index.js +97 -95
- package/src/components/sidebar-navigation-screen-patterns/style.scss +5 -0
- package/src/components/sidebar-navigation-screen-template/index.js +9 -13
- package/src/components/sidebar-navigation-screen-templates-browse/content.js +3 -3
- package/src/components/sidebar-navigation-screen-templates-browse/index.js +6 -43
- package/src/components/site-hub/index.js +80 -90
- package/src/components/site-hub/style.scss +14 -34
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +50 -39
- package/src/components/template-actions/index.js +8 -11
- package/src/components/welcome-guide/style.scss +1 -1
- package/src/components/welcome-guide/styles.js +6 -5
- package/src/deprecated.js +42 -0
- package/src/hooks/commands/use-edit-mode-commands.js +12 -33
- package/src/hooks/push-changes-to-global-styles/index.js +1 -40
- package/src/hooks/use-theme-style-variations/test/use-theme-style-variations-by-property.js +4 -0
- package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +74 -17
- package/src/index.js +1 -9
- package/src/store/actions.js +25 -141
- package/src/store/private-actions.js +0 -133
- package/src/store/test/actions.js +7 -2
- package/src/style.scss +1 -7
- package/src/utils/constants.js +2 -1
- package/src/utils/set-nested-value.js +39 -0
- package/build/components/add-new-template/new-template.js +0 -298
- package/build/components/add-new-template/new-template.js.map +0 -1
- package/build/components/add-new-template/template-actions-loading-screen.js +0 -27
- package/build/components/add-new-template/template-actions-loading-screen.js.map +0 -1
- package/build/components/header-edit-mode/more-menu/copy-content-menu-item.js +0 -59
- package/build/components/header-edit-mode/more-menu/copy-content-menu-item.js.map +0 -1
- package/build/components/header-edit-mode/plugin-more-menu-item/index.js +0 -78
- package/build/components/header-edit-mode/plugin-more-menu-item/index.js.map +0 -1
- package/build/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js +0 -71
- package/build/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js.map +0 -1
- package/build/components/header-edit-mode/tools-more-menu-group/index.js +0 -23
- package/build/components/header-edit-mode/tools-more-menu-group/index.js.map +0 -1
- package/build/components/keyboard-shortcut-help-modal/config.js +0 -78
- package/build/components/keyboard-shortcut-help-modal/config.js.map +0 -1
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -48
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +0 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +0 -119
- package/build/components/keyboard-shortcut-help-modal/index.js.map +0 -1
- package/build/components/keyboard-shortcut-help-modal/shortcut.js +0 -54
- package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +0 -1
- package/build/components/keyboard-shortcuts/edit-mode.js +0 -79
- package/build/components/keyboard-shortcuts/edit-mode.js.map +0 -1
- package/build/components/page-actions/index.js +0 -35
- package/build/components/page-actions/index.js.map +0 -1
- package/build/components/page-actions/trash-page-menu-item.js +0 -54
- package/build/components/page-actions/trash-page-menu-item.js.map +0 -1
- package/build/components/page-templates-template-parts/actions.js +0 -207
- package/build/components/page-templates-template-parts/actions.js.map +0 -1
- package/build/components/page-templates-template-parts/add-new-template-part.js +0 -64
- package/build/components/page-templates-template-parts/add-new-template-part.js.map +0 -1
- package/build/components/page-templates-template-parts/hooks.js.map +0 -1
- package/build/components/page-templates-template-parts/index.js.map +0 -1
- package/build/components/preferences-modal/index.js +0 -38
- package/build/components/preferences-modal/index.js.map +0 -1
- package/build/components/sidebar-edit-mode/constants.js +0 -9
- package/build/components/sidebar-edit-mode/constants.js.map +0 -1
- package/build/components/sidebar-edit-mode/page-panels/page-status.js +0 -188
- package/build/components/sidebar-edit-mode/page-panels/page-status.js.map +0 -1
- package/build/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -89
- package/build/components/sidebar-edit-mode/plugin-sidebar/index.js.map +0 -1
- package/build/components/sidebar-navigation-screen-navigation-item/index.js +0 -54
- package/build/components/sidebar-navigation-screen-navigation-item/index.js.map +0 -1
- package/build/components/sync-state-with-url/use-sync-path-with-url.js +0 -132
- package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +0 -1
- package/build/components/template-actions/rename-menu-item.js.map +0 -1
- package/build-module/components/add-new-template/new-template.js +0 -290
- package/build-module/components/add-new-template/new-template.js.map +0 -1
- package/build-module/components/add-new-template/template-actions-loading-screen.js +0 -20
- package/build-module/components/add-new-template/template-actions-loading-screen.js.map +0 -1
- package/build-module/components/header-edit-mode/more-menu/copy-content-menu-item.js +0 -52
- package/build-module/components/header-edit-mode/more-menu/copy-content-menu-item.js.map +0 -1
- package/build-module/components/header-edit-mode/plugin-more-menu-item/index.js +0 -73
- package/build-module/components/header-edit-mode/plugin-more-menu-item/index.js.map +0 -1
- package/build-module/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js +0 -65
- package/build-module/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js.map +0 -1
- package/build-module/components/header-edit-mode/tools-more-menu-group/index.js +0 -16
- package/build-module/components/header-edit-mode/tools-more-menu-group/index.js.map +0 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js +0 -71
- package/build-module/components/keyboard-shortcut-help-modal/config.js.map +0 -1
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -40
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +0 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +0 -110
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +0 -1
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +0 -47
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +0 -1
- package/build-module/components/keyboard-shortcuts/edit-mode.js +0 -72
- package/build-module/components/keyboard-shortcuts/edit-mode.js.map +0 -1
- package/build-module/components/page-actions/index.js +0 -27
- package/build-module/components/page-actions/index.js.map +0 -1
- package/build-module/components/page-actions/trash-page-menu-item.js +0 -47
- package/build-module/components/page-actions/trash-page-menu-item.js.map +0 -1
- package/build-module/components/page-templates-template-parts/actions.js +0 -199
- package/build-module/components/page-templates-template-parts/actions.js.map +0 -1
- package/build-module/components/page-templates-template-parts/add-new-template-part.js +0 -56
- package/build-module/components/page-templates-template-parts/add-new-template-part.js.map +0 -1
- package/build-module/components/page-templates-template-parts/hooks.js.map +0 -1
- package/build-module/components/page-templates-template-parts/index.js.map +0 -1
- package/build-module/components/preferences-modal/index.js +0 -30
- package/build-module/components/preferences-modal/index.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/constants.js +0 -3
- package/build-module/components/sidebar-edit-mode/constants.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/page-panels/page-status.js +0 -180
- package/build-module/components/sidebar-edit-mode/page-panels/page-status.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -83
- package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-navigation-item/index.js +0 -46
- package/build-module/components/sidebar-navigation-screen-navigation-item/index.js.map +0 -1
- package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +0 -124
- package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +0 -1
- package/build-module/components/template-actions/rename-menu-item.js.map +0 -1
- package/src/components/add-new-template/new-template.js +0 -429
- package/src/components/add-new-template/template-actions-loading-screen.js +0 -23
- package/src/components/header-edit-mode/more-menu/copy-content-menu-item.js +0 -51
- package/src/components/header-edit-mode/plugin-more-menu-item/index.js +0 -73
- package/src/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js +0 -64
- package/src/components/header-edit-mode/tools-more-menu-group/index.js +0 -16
- package/src/components/keyboard-shortcut-help-modal/config.js +0 -53
- package/src/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -41
- package/src/components/keyboard-shortcut-help-modal/index.js +0 -151
- package/src/components/keyboard-shortcut-help-modal/shortcut.js +0 -70
- package/src/components/keyboard-shortcut-help-modal/style.scss +0 -61
- package/src/components/keyboard-shortcuts/edit-mode.js +0 -88
- package/src/components/page-actions/index.js +0 -30
- package/src/components/page-actions/trash-page-menu-item.js +0 -63
- package/src/components/page-templates-template-parts/actions.js +0 -277
- package/src/components/page-templates-template-parts/add-new-template-part.js +0 -60
- package/src/components/preferences-modal/index.js +0 -29
- package/src/components/sidebar-edit-mode/constants.js +0 -2
- package/src/components/sidebar-edit-mode/page-panels/page-status.js +0 -249
- package/src/components/sidebar-edit-mode/page-panels/style.scss +0 -40
- package/src/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -80
- package/src/components/sidebar-navigation-screen-navigation-item/index.js +0 -59
- package/src/components/sync-state-with-url/use-sync-path-with-url.js +0 -147
- /package/build/components/{page-templates-template-parts → page-templates}/hooks.js +0 -0
- /package/build-module/components/{page-templates-template-parts → page-templates}/hooks.js +0 -0
- /package/src/components/{page-templates-template-parts → page-templates}/hooks.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_components","_data","_element","_blockEditor","_header","_interopRequireDefault","_lockUnlock","_revisions","_store","_useGlobalStylesRevisions","_revisionsButtons","_styleBook","_pagination","GlobalStylesContext","areGlobalStyleConfigsEqual","unlock","blockEditorPrivateApis","PAGE_SIZE","ScreenRevisions","goTo","useNavigator","user","currentEditorGlobalStyles","setUserConfig","useContext","blocks","editorCanvasContainerView","useSelect","select","editSiteStore","getEditorCanvasContainerView","blockEditorStore","getBlocks","currentPage","setCurrentPage","useState","currentRevisions","setCurrentRevisions","revisions","isLoading","hasUnsavedChanges","revisionsCount","useGlobalStylesRevisions","query","per_page","page","numPages","Math","ceil","currentlySelectedRevision","setCurrentlySelectedRevision","isLoadingRevisionWithUnsavedChanges","setIsLoadingRevisionWithUnsavedChanges","setEditorCanvasContainerView","useDispatch","selectedRevisionMatchesEditorStyles","onCloseRevisions","canvasContainerView","undefined","restoreRevision","revision","styles","settings","selectRevision","id","useEffect","startsWith","length","firstRevision","currentlySelectedRevisionId","shouldSelectFirstItem","isLoadButtonEnabled","hasRevisions","_react","createElement","Fragment","default","title","sprintf","__","description","onBack","Spinner","className","userConfig","isSelected","onClose","closeButtonLabel","onChange","selectedRevisionId","userRevisions","canApplyRevision","onApplyRevision","changePage","totalItems","disabled","label","__experimentalConfirmDialog","isOpen","confirmButtonText","onConfirm","onCancel","_default","exports"],"sources":["@wordpress/edit-site/src/components/global-styles/screen-revisions/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\t__experimentalUseNavigator as useNavigator,\n\t__experimentalConfirmDialog as ConfirmDialog,\n\tSpinner,\n} from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useContext, useState, useEffect } from '@wordpress/element';\nimport {\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport ScreenHeader from '../header';\nimport { unlock } from '../../../lock-unlock';\nimport Revisions from '../../revisions';\nimport { store as editSiteStore } from '../../../store';\nimport useGlobalStylesRevisions from './use-global-styles-revisions';\nimport RevisionsButtons from './revisions-buttons';\nimport StyleBook from '../../style-book';\nimport Pagination from '../../pagination';\n\nconst { GlobalStylesContext, areGlobalStyleConfigsEqual } = unlock(\n\tblockEditorPrivateApis\n);\n\nconst PAGE_SIZE = 10;\n\nfunction ScreenRevisions() {\n\tconst { goTo } = useNavigator();\n\tconst { user: currentEditorGlobalStyles, setUserConfig } =\n\t\tuseContext( GlobalStylesContext );\n\tconst { blocks, editorCanvasContainerView } = useSelect(\n\t\t( select ) => ( {\n\t\t\teditorCanvasContainerView: unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t).getEditorCanvasContainerView(),\n\t\t\tblocks: select( blockEditorStore ).getBlocks(),\n\t\t} ),\n\t\t[]\n\t);\n\tconst [ currentPage, setCurrentPage ] = useState( 1 );\n\tconst [ currentRevisions, setCurrentRevisions ] = useState( [] );\n\tconst { revisions, isLoading, hasUnsavedChanges, revisionsCount } =\n\t\tuseGlobalStylesRevisions( {\n\t\t\tquery: {\n\t\t\t\tper_page: PAGE_SIZE,\n\t\t\t\tpage: currentPage,\n\t\t\t},\n\t\t} );\n\n\tconst numPages = Math.ceil( revisionsCount / PAGE_SIZE );\n\n\tconst [ currentlySelectedRevision, setCurrentlySelectedRevision ] =\n\t\tuseState( currentEditorGlobalStyles );\n\tconst [\n\t\tisLoadingRevisionWithUnsavedChanges,\n\t\tsetIsLoadingRevisionWithUnsavedChanges,\n\t] = useState( false );\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst selectedRevisionMatchesEditorStyles = areGlobalStyleConfigsEqual(\n\t\tcurrentlySelectedRevision,\n\t\tcurrentEditorGlobalStyles\n\t);\n\n\tconst onCloseRevisions = () => {\n\t\tgoTo( '/' ); // Return to global styles main panel.\n\t\tconst canvasContainerView =\n\t\t\teditorCanvasContainerView === 'global-styles-revisions:style-book'\n\t\t\t\t? 'style-book'\n\t\t\t\t: undefined;\n\t\tsetEditorCanvasContainerView( canvasContainerView );\n\t};\n\n\tconst restoreRevision = ( revision ) => {\n\t\tsetUserConfig( () => ( {\n\t\t\tstyles: revision?.styles,\n\t\t\tsettings: revision?.settings,\n\t\t} ) );\n\t\tsetIsLoadingRevisionWithUnsavedChanges( false );\n\t\tonCloseRevisions();\n\t};\n\n\tconst selectRevision = ( revision ) => {\n\t\tsetCurrentlySelectedRevision( {\n\t\t\tstyles: revision?.styles || {},\n\t\t\tsettings: revision?.settings || {},\n\t\t\tid: revision?.id,\n\t\t} );\n\t};\n\n\tuseEffect( () => {\n\t\tif (\n\t\t\t! editorCanvasContainerView ||\n\t\t\t! editorCanvasContainerView.startsWith( 'global-styles-revisions' )\n\t\t) {\n\t\t\tgoTo( '/' ); // Return to global styles main panel.\n\t\t}\n\t}, [ editorCanvasContainerView ] );\n\n\tuseEffect( () => {\n\t\tif ( ! isLoading && revisions.length ) {\n\t\t\tsetCurrentRevisions( revisions );\n\t\t}\n\t}, [ revisions, isLoading ] );\n\n\tconst firstRevision = revisions[ 0 ];\n\tconst currentlySelectedRevisionId = currentlySelectedRevision?.id;\n\tconst shouldSelectFirstItem =\n\t\t!! firstRevision?.id &&\n\t\t! selectedRevisionMatchesEditorStyles &&\n\t\t! currentlySelectedRevisionId;\n\n\tuseEffect( () => {\n\t\t/*\n\t\t * Ensure that the first item is selected and loaded into the preview pane\n\t\t * when no revision is selected and the selected styles don't match the current editor styles.\n\t\t * This is required in case editor styles are changed outside the revisions panel,\n\t\t * e.g., via the reset styles function of useGlobalStylesReset().\n\t\t * See: https://github.com/WordPress/gutenberg/issues/55866\n\t\t */\n\t\tif ( shouldSelectFirstItem ) {\n\t\t\tsetCurrentlySelectedRevision( {\n\t\t\t\tstyles: firstRevision?.styles || {},\n\t\t\t\tsettings: firstRevision?.settings || {},\n\t\t\t\tid: firstRevision?.id,\n\t\t\t} );\n\t\t}\n\t}, [ shouldSelectFirstItem, firstRevision ] );\n\n\t// Only display load button if there is a revision to load,\n\t// and it is different from the current editor styles.\n\tconst isLoadButtonEnabled =\n\t\t!! currentlySelectedRevisionId &&\n\t\tcurrentlySelectedRevisionId !== 'unsaved' &&\n\t\t! selectedRevisionMatchesEditorStyles;\n\tconst hasRevisions = !! currentRevisions.length;\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={\n\t\t\t\t\trevisionsCount &&\n\t\t\t\t\t// translators: %s: number of revisions.\n\t\t\t\t\tsprintf( __( 'Revisions (%s)' ), revisionsCount )\n\t\t\t\t}\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Click on previously saved styles to preview them. To restore a selected version to the editor, hit \"Apply.\" When you\\'re ready, use the Save button to save your changes.'\n\t\t\t\t) }\n\t\t\t\tonBack={ onCloseRevisions }\n\t\t\t/>\n\t\t\t{ ! hasRevisions && (\n\t\t\t\t<Spinner className=\"edit-site-global-styles-screen-revisions__loading\" />\n\t\t\t) }\n\t\t\t{ hasRevisions &&\n\t\t\t\t( editorCanvasContainerView ===\n\t\t\t\t'global-styles-revisions:style-book' ? (\n\t\t\t\t\t<StyleBook\n\t\t\t\t\t\tuserConfig={ currentlySelectedRevision }\n\t\t\t\t\t\tisSelected={ () => {} }\n\t\t\t\t\t\tonClose={ () => {\n\t\t\t\t\t\t\tsetEditorCanvasContainerView(\n\t\t\t\t\t\t\t\t'global-styles-revisions'\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<Revisions\n\t\t\t\t\t\tblocks={ blocks }\n\t\t\t\t\t\tuserConfig={ currentlySelectedRevision }\n\t\t\t\t\t\tcloseButtonLabel={ __( 'Close revisions' ) }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t<RevisionsButtons\n\t\t\t\tonChange={ selectRevision }\n\t\t\t\tselectedRevisionId={ currentlySelectedRevisionId }\n\t\t\t\tuserRevisions={ currentRevisions }\n\t\t\t\tcanApplyRevision={ isLoadButtonEnabled }\n\t\t\t\tonApplyRevision={ () =>\n\t\t\t\t\thasUnsavedChanges\n\t\t\t\t\t\t? setIsLoadingRevisionWithUnsavedChanges( true )\n\t\t\t\t\t\t: restoreRevision( currentlySelectedRevision )\n\t\t\t\t}\n\t\t\t/>\n\t\t\t{ numPages > 1 && (\n\t\t\t\t<div className=\"edit-site-global-styles-screen-revisions__footer\">\n\t\t\t\t\t<Pagination\n\t\t\t\t\t\tclassName=\"edit-site-global-styles-screen-revisions__pagination\"\n\t\t\t\t\t\tcurrentPage={ currentPage }\n\t\t\t\t\t\tnumPages={ numPages }\n\t\t\t\t\t\tchangePage={ setCurrentPage }\n\t\t\t\t\t\ttotalItems={ revisionsCount }\n\t\t\t\t\t\tdisabled={ isLoading }\n\t\t\t\t\t\tlabel={ __( 'Global Styles pagination navigation' ) }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t{ isLoadingRevisionWithUnsavedChanges && (\n\t\t\t\t<ConfirmDialog\n\t\t\t\t\tisOpen={ isLoadingRevisionWithUnsavedChanges }\n\t\t\t\t\tconfirmButtonText={ __( 'Apply' ) }\n\t\t\t\t\tonConfirm={ () =>\n\t\t\t\t\t\trestoreRevision( currentlySelectedRevision )\n\t\t\t\t\t}\n\t\t\t\t\tonCancel={ () =>\n\t\t\t\t\t\tsetIsLoadingRevisionWithUnsavedChanges( false )\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'Any unsaved changes will be lost when you apply this revision.'\n\t\t\t\t\t) }\n\t\t\t\t</ConfirmDialog>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default ScreenRevisions;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAKA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAQA,IAAAK,OAAA,GA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GAChE,IAAAV,MAAA,CAAAC,aAAA,EAAC9D,WAAA,CAAAgE,OAAU;IACVO,SAAS,EAAC,sDAAsD;IAChElD,WAAW,EAAGA,WAAa;IAC3Ba,QAAQ,EAAGA,QAAU;IACrB+C,UAAU,EAAG3D,cAAgB;IAC7B4D,UAAU,EAAGrD,cAAgB;IAC7BsD,QAAQ,EAAGxD,SAAW;IACtByD,KAAK,EAAG,IAAAjB,QAAE,EAAE,qCAAsC;EAAG,CACrD,CACG,CACL,EACC5B,mCAAmC,IACpC,IAAAsB,MAAA,CAAAC,aAAA,EAAC1E,WAAA,CAAAiG,2BAAa;IACbC,MAAM,EAAG/C,mCAAqC;IAC9CgD,iBAAiB,EAAG,IAAApB,QAAE,EAAE,OAAQ,CAAG;IACnCqB,SAAS,EAAGA,CAAA,KACXzC,eAAe,CAAEV,yBAA0B,CAC3C;IACDoD,QAAQ,EAAGA,CAAA,KACVjD,sCAAsC,CAAE,KAAM;EAC9C,GAEC,IAAA2B,QAAE,EACH,gEACD,CACc,CAEf,CAAC;AAEL;AAAC,IAAAuB,QAAA,GAAAC,OAAA,CAAA3B,OAAA,GAEc1D,eAAe"}
|
|
1
|
+
{"version":3,"names":["_i18n","require","_components","_data","_element","_blockEditor","_header","_interopRequireDefault","_lockUnlock","_revisions","_store","_useGlobalStylesRevisions","_revisionsButtons","_styleBook","_pagination","GlobalStylesContext","areGlobalStyleConfigsEqual","unlock","blockEditorPrivateApis","PAGE_SIZE","ScreenRevisions","goTo","useNavigator","user","currentEditorGlobalStyles","setUserConfig","useContext","blocks","editorCanvasContainerView","useSelect","select","editSiteStore","getEditorCanvasContainerView","blockEditorStore","getBlocks","currentPage","setCurrentPage","useState","currentRevisions","setCurrentRevisions","revisions","isLoading","hasUnsavedChanges","revisionsCount","useGlobalStylesRevisions","query","per_page","page","numPages","Math","ceil","currentlySelectedRevision","setCurrentlySelectedRevision","isLoadingRevisionWithUnsavedChanges","setIsLoadingRevisionWithUnsavedChanges","setEditorCanvasContainerView","useDispatch","selectedRevisionMatchesEditorStyles","onCloseRevisions","canvasContainerView","undefined","restoreRevision","revision","styles","settings","selectRevision","id","useEffect","startsWith","length","firstRevision","currentlySelectedRevisionId","shouldSelectFirstItem","isLoadButtonEnabled","hasRevisions","_react","createElement","Fragment","default","title","sprintf","__","description","onBack","Spinner","className","userConfig","isSelected","onClose","closeButtonLabel","onChange","selectedRevisionId","userRevisions","canApplyRevision","onApplyRevision","changePage","totalItems","disabled","label","__experimentalConfirmDialog","isOpen","confirmButtonText","onConfirm","onCancel","_default","exports"],"sources":["@wordpress/edit-site/src/components/global-styles/screen-revisions/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\t__experimentalUseNavigator as useNavigator,\n\t__experimentalConfirmDialog as ConfirmDialog,\n\tSpinner,\n} from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useContext, useState, useEffect } from '@wordpress/element';\nimport {\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport ScreenHeader from '../header';\nimport { unlock } from '../../../lock-unlock';\nimport Revisions from '../../revisions';\nimport { store as editSiteStore } from '../../../store';\nimport useGlobalStylesRevisions from './use-global-styles-revisions';\nimport RevisionsButtons from './revisions-buttons';\nimport StyleBook from '../../style-book';\nimport Pagination from '../../pagination';\n\nconst { GlobalStylesContext, areGlobalStyleConfigsEqual } = unlock(\n\tblockEditorPrivateApis\n);\n\nconst PAGE_SIZE = 10;\n\nfunction ScreenRevisions() {\n\tconst { goTo } = useNavigator();\n\tconst { user: currentEditorGlobalStyles, setUserConfig } =\n\t\tuseContext( GlobalStylesContext );\n\tconst { blocks, editorCanvasContainerView } = useSelect(\n\t\t( select ) => ( {\n\t\t\teditorCanvasContainerView: unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t).getEditorCanvasContainerView(),\n\t\t\tblocks: select( blockEditorStore ).getBlocks(),\n\t\t} ),\n\t\t[]\n\t);\n\tconst [ currentPage, setCurrentPage ] = useState( 1 );\n\tconst [ currentRevisions, setCurrentRevisions ] = useState( [] );\n\tconst { revisions, isLoading, hasUnsavedChanges, revisionsCount } =\n\t\tuseGlobalStylesRevisions( {\n\t\t\tquery: {\n\t\t\t\tper_page: PAGE_SIZE,\n\t\t\t\tpage: currentPage,\n\t\t\t},\n\t\t} );\n\n\tconst numPages = Math.ceil( revisionsCount / PAGE_SIZE );\n\n\tconst [ currentlySelectedRevision, setCurrentlySelectedRevision ] =\n\t\tuseState( currentEditorGlobalStyles );\n\tconst [\n\t\tisLoadingRevisionWithUnsavedChanges,\n\t\tsetIsLoadingRevisionWithUnsavedChanges,\n\t] = useState( false );\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst selectedRevisionMatchesEditorStyles = areGlobalStyleConfigsEqual(\n\t\tcurrentlySelectedRevision,\n\t\tcurrentEditorGlobalStyles\n\t);\n\n\tconst onCloseRevisions = () => {\n\t\tgoTo( '/' ); // Return to global styles main panel.\n\t\tconst canvasContainerView =\n\t\t\teditorCanvasContainerView === 'global-styles-revisions:style-book'\n\t\t\t\t? 'style-book'\n\t\t\t\t: undefined;\n\t\tsetEditorCanvasContainerView( canvasContainerView );\n\t};\n\n\tconst restoreRevision = ( revision ) => {\n\t\tsetUserConfig( () => ( {\n\t\t\tstyles: revision?.styles,\n\t\t\tsettings: revision?.settings,\n\t\t} ) );\n\t\tsetIsLoadingRevisionWithUnsavedChanges( false );\n\t\tonCloseRevisions();\n\t};\n\n\tconst selectRevision = ( revision ) => {\n\t\tsetCurrentlySelectedRevision( {\n\t\t\tstyles: revision?.styles || {},\n\t\t\tsettings: revision?.settings || {},\n\t\t\tid: revision?.id,\n\t\t} );\n\t};\n\n\tuseEffect( () => {\n\t\tif (\n\t\t\t! editorCanvasContainerView ||\n\t\t\t! editorCanvasContainerView.startsWith( 'global-styles-revisions' )\n\t\t) {\n\t\t\tgoTo( '/' ); // Return to global styles main panel.\n\t\t}\n\t}, [ editorCanvasContainerView ] );\n\n\tuseEffect( () => {\n\t\tif ( ! isLoading && revisions.length ) {\n\t\t\tsetCurrentRevisions( revisions );\n\t\t}\n\t}, [ revisions, isLoading ] );\n\n\tconst firstRevision = revisions[ 0 ];\n\tconst currentlySelectedRevisionId = currentlySelectedRevision?.id;\n\tconst shouldSelectFirstItem =\n\t\t!! firstRevision?.id &&\n\t\t! selectedRevisionMatchesEditorStyles &&\n\t\t! currentlySelectedRevisionId;\n\n\tuseEffect( () => {\n\t\t/*\n\t\t * Ensure that the first item is selected and loaded into the preview pane\n\t\t * when no revision is selected and the selected styles don't match the current editor styles.\n\t\t * This is required in case editor styles are changed outside the revisions panel,\n\t\t * e.g., via the reset styles function of useGlobalStylesReset().\n\t\t * See: https://github.com/WordPress/gutenberg/issues/55866\n\t\t */\n\t\tif ( shouldSelectFirstItem ) {\n\t\t\tsetCurrentlySelectedRevision( {\n\t\t\t\tstyles: firstRevision?.styles || {},\n\t\t\t\tsettings: firstRevision?.settings || {},\n\t\t\t\tid: firstRevision?.id,\n\t\t\t} );\n\t\t}\n\t}, [ shouldSelectFirstItem, firstRevision ] );\n\n\t// Only display load button if there is a revision to load,\n\t// and it is different from the current editor styles.\n\tconst isLoadButtonEnabled =\n\t\t!! currentlySelectedRevisionId &&\n\t\tcurrentlySelectedRevisionId !== 'unsaved' &&\n\t\t! selectedRevisionMatchesEditorStyles;\n\tconst hasRevisions = !! currentRevisions.length;\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={\n\t\t\t\t\trevisionsCount &&\n\t\t\t\t\t// translators: %s: number of revisions.\n\t\t\t\t\tsprintf( __( 'Revisions (%s)' ), revisionsCount )\n\t\t\t\t}\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Click on previously saved styles to preview them. To restore a selected version to the editor, hit \"Apply.\" When you\\'re ready, use the Save button to save your changes.'\n\t\t\t\t) }\n\t\t\t\tonBack={ onCloseRevisions }\n\t\t\t/>\n\t\t\t{ ! hasRevisions && (\n\t\t\t\t<Spinner className=\"edit-site-global-styles-screen-revisions__loading\" />\n\t\t\t) }\n\t\t\t{ hasRevisions &&\n\t\t\t\t( editorCanvasContainerView ===\n\t\t\t\t'global-styles-revisions:style-book' ? (\n\t\t\t\t\t<StyleBook\n\t\t\t\t\t\tuserConfig={ currentlySelectedRevision }\n\t\t\t\t\t\tisSelected={ () => {} }\n\t\t\t\t\t\tonClose={ () => {\n\t\t\t\t\t\t\tsetEditorCanvasContainerView(\n\t\t\t\t\t\t\t\t'global-styles-revisions'\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<Revisions\n\t\t\t\t\t\tblocks={ blocks }\n\t\t\t\t\t\tuserConfig={ currentlySelectedRevision }\n\t\t\t\t\t\tcloseButtonLabel={ __( 'Close revisions' ) }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t<RevisionsButtons\n\t\t\t\tonChange={ selectRevision }\n\t\t\t\tselectedRevisionId={ currentlySelectedRevisionId }\n\t\t\t\tuserRevisions={ currentRevisions }\n\t\t\t\tcanApplyRevision={ isLoadButtonEnabled }\n\t\t\t\tonApplyRevision={ () =>\n\t\t\t\t\thasUnsavedChanges\n\t\t\t\t\t\t? setIsLoadingRevisionWithUnsavedChanges( true )\n\t\t\t\t\t\t: restoreRevision( currentlySelectedRevision )\n\t\t\t\t}\n\t\t\t/>\n\t\t\t{ numPages > 1 && (\n\t\t\t\t<div className=\"edit-site-global-styles-screen-revisions__footer\">\n\t\t\t\t\t<Pagination\n\t\t\t\t\t\tclassName=\"edit-site-global-styles-screen-revisions__pagination\"\n\t\t\t\t\t\tcurrentPage={ currentPage }\n\t\t\t\t\t\tnumPages={ numPages }\n\t\t\t\t\t\tchangePage={ setCurrentPage }\n\t\t\t\t\t\ttotalItems={ revisionsCount }\n\t\t\t\t\t\tdisabled={ isLoading }\n\t\t\t\t\t\tlabel={ __( 'Global Styles pagination navigation' ) }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t{ isLoadingRevisionWithUnsavedChanges && (\n\t\t\t\t<ConfirmDialog\n\t\t\t\t\tisOpen={ isLoadingRevisionWithUnsavedChanges }\n\t\t\t\t\tconfirmButtonText={ __( 'Apply' ) }\n\t\t\t\t\tonConfirm={ () =>\n\t\t\t\t\t\trestoreRevision( currentlySelectedRevision )\n\t\t\t\t\t}\n\t\t\t\t\tonCancel={ () =>\n\t\t\t\t\t\tsetIsLoadingRevisionWithUnsavedChanges( false )\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'Are you sure you want to apply this revision? Any unsaved changes will be lost.'\n\t\t\t\t\t) }\n\t\t\t\t</ConfirmDialog>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default ScreenRevisions;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAKA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAQA,IAAAK,OAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AACA,IAAAQ,UAAA,GAAAF,sBAAA,CAAAN,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,yBAAA,GAAAJ,sBAAA,CAAAN,OAAA;AACA,IAAAW,iBAAA,GAAAL,sBAAA,CAAAN,OAAA;AACA,IAAAY,UAAA,GAAAN,sBAAA,CAAAN,OAAA;AACA,IAAAa,WAAA,GAAAP,sBAAA,CAAAN,OAAA;AA1BA;AACA;AACA;;AAcA;AACA;AACA;;AAUA,MAAM;EAAEc,mBAAmB;EAAEC;AAA2B,CAAC,GAAG,IAAAC,kBAA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D,iBAAiB,EAAG,IAAApB,QAAE,EAAE,OAAQ,CAAG;IACnCqB,SAAS,EAAGA,CAAA,KACXzC,eAAe,CAAEV,yBAA0B,CAC3C;IACDoD,QAAQ,EAAGA,CAAA,KACVjD,sCAAsC,CAAE,KAAM;EAC9C,GAEC,IAAA2B,QAAE,EACH,iFACD,CACc,CAEf,CAAC;AAEL;AAAC,IAAAuB,QAAA,GAAAC,OAAA,CAAA3B,OAAA,GAEc1D,eAAe","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_classnames","_interopRequireDefault","require","_i18n","_components","_date","_coreData","_data","_blockEditor","_lockUnlock","DAY_IN_MILLISECONDS","getGlobalStylesChanges","unlock","blockEditorPrivateApis","ChangesSummary","revision","previousRevision","changes","maxResults","length","_react","createElement","className","map","change","key","getRevisionLabel","id","authorDisplayName","formattedModifiedDate","areStylesEqual","__","sprintf","RevisionsButtons","userRevisions","selectedRevisionId","onChange","canApplyRevision","onApplyRevision","currentThemeName","currentUser","useSelect","select","getCurrentTheme","getCurrentUser","coreStore","currentTheme","name","rendered","stylesheet","dateNowInMs","getDate","getTime","datetimeAbbreviated","getSettings","formats","role","index","author","modified","isUnsaved","revisionAuthor","authorAvatar","avatar_urls","isFirstItem","isSelected","isReset","modifiedDate","displayDate","dateI18n","humanTimeDiff","revisionLabel","classnames","Button","disabled","onClick","dateTime","alt","src","size","variant","_default","exports","default"],"sources":["@wordpress/edit-site/src/components/global-styles/screen-revisions/revisions-buttons.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { dateI18n, getDate, humanTimeDiff, getSettings } from '@wordpress/date';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../lock-unlock';\n\nconst DAY_IN_MILLISECONDS = 60 * 60 * 1000 * 24;\nconst { getGlobalStylesChanges } = unlock( blockEditorPrivateApis );\n\nfunction ChangesSummary( { revision, previousRevision } ) {\n\tconst changes = getGlobalStylesChanges( revision, previousRevision, {\n\t\tmaxResults: 7,\n\t} );\n\n\tif ( ! changes.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<ul\n\t\t\tdata-testid=\"global-styles-revision-changes\"\n\t\t\tclassName=\"edit-site-global-styles-screen-revisions__changes\"\n\t\t>\n\t\t\t{ changes.map( ( change ) => (\n\t\t\t\t<li key={ change }>{ change }</li>\n\t\t\t) ) }\n\t\t</ul>\n\t);\n}\n\n/**\n * Returns a button label for the revision.\n *\n * @param {string|number} id A revision object.\n * @param {string} authorDisplayName Author name.\n * @param {string} formattedModifiedDate Revision modified date formatted.\n * @param {boolean} areStylesEqual Whether the revision matches the current editor styles.\n * @return {string} Translated label.\n */\nfunction getRevisionLabel(\n\tid,\n\tauthorDisplayName,\n\tformattedModifiedDate,\n\tareStylesEqual\n) {\n\tif ( 'parent' === id ) {\n\t\treturn __( 'Reset the styles to the theme defaults' );\n\t}\n\n\tif ( 'unsaved' === id ) {\n\t\treturn sprintf(\n\t\t\t/* translators: %s: author display name */\n\t\t\t__( 'Unsaved changes by %s' ),\n\t\t\tauthorDisplayName\n\t\t);\n\t}\n\n\treturn areStylesEqual\n\t\t? sprintf(\n\t\t\t\t// translators: %1$s: author display name, %2$s: revision creation date.\n\t\t\t\t__(\n\t\t\t\t\t'Changes saved by %1$s on %2$s. This revision matches current editor styles.'\n\t\t\t\t),\n\t\t\t\tauthorDisplayName,\n\t\t\t\tformattedModifiedDate\n\t\t )\n\t\t: sprintf(\n\t\t\t\t// translators: %1$s: author display name, %2$s: revision creation date.\n\t\t\t\t__( 'Changes saved by %1$s on %2$s' ),\n\t\t\t\tauthorDisplayName,\n\t\t\t\tformattedModifiedDate\n\t\t );\n}\n\n/**\n * Returns a rendered list of revisions buttons.\n *\n * @typedef {Object} props\n * @property {Array<Object>} userRevisions A collection of user revisions.\n * @property {number} selectedRevisionId The id of the currently-selected revision.\n * @property {Function} onChange Callback fired when a revision is selected.\n *\n * @param {props} Component props.\n * @return {JSX.Element} The modal component.\n */\nfunction RevisionsButtons( {\n\tuserRevisions,\n\tselectedRevisionId,\n\tonChange,\n\tcanApplyRevision,\n\tonApplyRevision,\n} ) {\n\tconst { currentThemeName, currentUser } = useSelect( ( select ) => {\n\t\tconst { getCurrentTheme, getCurrentUser } = select( coreStore );\n\t\tconst currentTheme = getCurrentTheme();\n\t\treturn {\n\t\t\tcurrentThemeName:\n\t\t\t\tcurrentTheme?.name?.rendered || currentTheme?.stylesheet,\n\t\t\tcurrentUser: getCurrentUser(),\n\t\t};\n\t}, [] );\n\tconst dateNowInMs = getDate().getTime();\n\tconst { datetimeAbbreviated } = getSettings().formats;\n\n\treturn (\n\t\t<ol\n\t\t\tclassName=\"edit-site-global-styles-screen-revisions__revisions-list\"\n\t\t\taria-label={ __( 'Global styles revisions list' ) }\n\t\t\trole=\"group\"\n\t\t>\n\t\t\t{ userRevisions.map( ( revision, index ) => {\n\t\t\t\tconst { id, author, modified } = revision;\n\t\t\t\tconst isUnsaved = 'unsaved' === id;\n\t\t\t\t// Unsaved changes are created by the current user.\n\t\t\t\tconst revisionAuthor = isUnsaved ? currentUser : author;\n\t\t\t\tconst authorDisplayName = revisionAuthor?.name || __( 'User' );\n\t\t\t\tconst authorAvatar = revisionAuthor?.avatar_urls?.[ '48' ];\n\t\t\t\tconst isFirstItem = index === 0;\n\t\t\t\tconst isSelected = selectedRevisionId\n\t\t\t\t\t? selectedRevisionId === id\n\t\t\t\t\t: isFirstItem;\n\t\t\t\tconst areStylesEqual = ! canApplyRevision && isSelected;\n\t\t\t\tconst isReset = 'parent' === id;\n\t\t\t\tconst modifiedDate = getDate( modified );\n\t\t\t\tconst displayDate =\n\t\t\t\t\tmodified &&\n\t\t\t\t\tdateNowInMs - modifiedDate.getTime() > DAY_IN_MILLISECONDS\n\t\t\t\t\t\t? dateI18n( datetimeAbbreviated, modifiedDate )\n\t\t\t\t\t\t: humanTimeDiff( modified );\n\t\t\t\tconst revisionLabel = getRevisionLabel(\n\t\t\t\t\tid,\n\t\t\t\t\tauthorDisplayName,\n\t\t\t\t\tdateI18n( datetimeAbbreviated, modifiedDate ),\n\t\t\t\t\tareStylesEqual\n\t\t\t\t);\n\n\t\t\t\treturn (\n\t\t\t\t\t<li\n\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t'edit-site-global-styles-screen-revisions__revision-item',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'is-selected': isSelected,\n\t\t\t\t\t\t\t\t'is-active': areStylesEqual,\n\t\t\t\t\t\t\t\t'is-reset': isReset,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tkey={ id }\n\t\t\t\t\t\taria-current={ isSelected }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tclassName=\"edit-site-global-styles-screen-revisions__revision-button\"\n\t\t\t\t\t\t\tdisabled={ isSelected }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tonChange( revision );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\taria-label={ revisionLabel }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ isReset ? (\n\t\t\t\t\t\t\t\t<span className=\"edit-site-global-styles-screen-revisions__description\">\n\t\t\t\t\t\t\t\t\t{ __( 'Default styles' ) }\n\t\t\t\t\t\t\t\t\t<span className=\"edit-site-global-styles-screen-revisions__meta\">\n\t\t\t\t\t\t\t\t\t\t{ currentThemeName }\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<span className=\"edit-site-global-styles-screen-revisions__description\">\n\t\t\t\t\t\t\t\t\t{ isUnsaved ? (\n\t\t\t\t\t\t\t\t\t\t<span className=\"edit-site-global-styles-screen-revisions__date\">\n\t\t\t\t\t\t\t\t\t\t\t{ __( '(Unsaved)' ) }\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t<time\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"edit-site-global-styles-screen-revisions__date\"\n\t\t\t\t\t\t\t\t\t\t\tdateTime={ modified }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ displayDate }\n\t\t\t\t\t\t\t\t\t\t</time>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t<span className=\"edit-site-global-styles-screen-revisions__meta\">\n\t\t\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\t\t\talt={ authorDisplayName }\n\t\t\t\t\t\t\t\t\t\t\tsrc={ authorAvatar }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t{ authorDisplayName }\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t{ isSelected && (\n\t\t\t\t\t\t\t\t\t\t<ChangesSummary\n\t\t\t\t\t\t\t\t\t\t\trevision={ revision }\n\t\t\t\t\t\t\t\t\t\t\tpreviousRevision={\n\t\t\t\t\t\t\t\t\t\t\t\tindex < userRevisions.length\n\t\t\t\t\t\t\t\t\t\t\t\t\t? userRevisions[ index + 1 ]\n\t\t\t\t\t\t\t\t\t\t\t\t\t: {}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t{ isSelected &&\n\t\t\t\t\t\t\t( areStylesEqual ? (\n\t\t\t\t\t\t\t\t<p className=\"edit-site-global-styles-screen-revisions__applied-text\">\n\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t'These styles are already applied to your site.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tdisabled={ areStylesEqual }\n\t\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\t\tclassName=\"edit-site-global-styles-screen-revisions__apply-button\"\n\t\t\t\t\t\t\t\t\tonClick={ onApplyRevision }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ isReset\n\t\t\t\t\t\t\t\t\t\t? __( 'Reset to defaults' )\n\t\t\t\t\t\t\t\t\t\t: __( 'Apply' ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t</li>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</ol>\n\t);\n}\n\nexport default RevisionsButtons;\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,SAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AAKA,IAAAO,WAAA,GAAAP,OAAA;AAlBA;AACA;AACA;;AAGA;AACA;AACA;;AAQA;AACA;AACA;;AAGA,MAAMQ,mBAAmB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,GAAG,EAAE;AAC/C,MAAM;EAAEC;AAAuB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAEnE,SAASC,cAAcA,CAAE;EAAEC,QAAQ;EAAEC;AAAiB,CAAC,EAAG;EACzD,MAAMC,OAAO,GAAGN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AAGjB;IAAU,GAEnBS,WACG,CACN,EACD,IAAAhD,MAAA,CAAAC,aAAA;MAAMC,SAAS,EAAC;IAAgD,GAC/D,IAAAF,MAAA,CAAAC,aAAA;MACCwD,GAAG,EAAGjD,iBAAmB;MACzBkD,GAAG,EAAGhB;IAAc,CACpB,CAAC,EACAlC,iBACG,CAAC,EACLqC,UAAU,IACX,IAAA7C,MAAA,CAAAC,aAAA,EAACP,cAAc;MACdC,QAAQ,EAAGA,QAAU;MACrBC,gBAAgB,EACfyC,KAAK,GAAGvB,aAAa,CAACf,MAAM,GACzBe,aAAa,CAAEuB,KAAK,GAAG,CAAC,CAAE,GAC1B,CAAC;IACJ,CACD,CAEG,CAEA,CAAC,EACPQ,UAAU,KACTnC,cAAc,GACf,IAAAV,MAAA,CAAAC,aAAA;MAAGC,SAAS,EAAC;IAAwD,GAClE,IAAAS,QAAE,EACH,gDACD,CACE,CAAC,GAEJ,IAAAX,MAAA,CAAAC,aAAA,EAACjB,WAAA,CAAAqE,MAAM;MACNC,QAAQ,EAAG5C,cAAgB;MAC3BiD,IAAI,EAAC,SAAS;MACdC,OAAO,EAAC,SAAS;MACjB1D,SAAS,EAAC,wDAAwD;MAClEqD,OAAO,EAAGrC;IAAiB,GAEzB4B,OAAO,GACN,IAAAnC,QAAE,EAAE,mBAAoB,CAAC,GACzB,IAAAA,QAAE,EAAE,OAAQ,CACR,CACR,CACC,CAAC;EAEP,CAAE,CACC,CAAC;AAEP;AAAC,IAAAkD,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEclD,gBAAgB"}
|
|
1
|
+
{"version":3,"names":["_classnames","_interopRequireDefault","require","_i18n","_components","_date","_coreData","_data","_blockEditor","_lockUnlock","DAY_IN_MILLISECONDS","getGlobalStylesChanges","unlock","blockEditorPrivateApis","ChangesSummary","revision","previousRevision","changes","maxResults","length","_react","createElement","className","map","change","key","getRevisionLabel","id","authorDisplayName","formattedModifiedDate","areStylesEqual","__","sprintf","RevisionsButtons","userRevisions","selectedRevisionId","onChange","canApplyRevision","onApplyRevision","currentThemeName","currentUser","useSelect","select","getCurrentTheme","getCurrentUser","coreStore","currentTheme","name","rendered","stylesheet","dateNowInMs","getDate","getTime","datetimeAbbreviated","getSettings","formats","role","index","author","modified","isUnsaved","revisionAuthor","authorAvatar","avatar_urls","isFirstItem","isSelected","isReset","modifiedDate","displayDate","dateI18n","humanTimeDiff","revisionLabel","classnames","Button","disabled","onClick","dateTime","alt","src","size","variant","_default","exports","default"],"sources":["@wordpress/edit-site/src/components/global-styles/screen-revisions/revisions-buttons.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { dateI18n, getDate, humanTimeDiff, getSettings } from '@wordpress/date';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../lock-unlock';\n\nconst DAY_IN_MILLISECONDS = 60 * 60 * 1000 * 24;\nconst { getGlobalStylesChanges } = unlock( blockEditorPrivateApis );\n\nfunction ChangesSummary( { revision, previousRevision } ) {\n\tconst changes = getGlobalStylesChanges( revision, previousRevision, {\n\t\tmaxResults: 7,\n\t} );\n\n\tif ( ! changes.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<ul\n\t\t\tdata-testid=\"global-styles-revision-changes\"\n\t\t\tclassName=\"edit-site-global-styles-screen-revisions__changes\"\n\t\t>\n\t\t\t{ changes.map( ( change ) => (\n\t\t\t\t<li key={ change }>{ change }</li>\n\t\t\t) ) }\n\t\t</ul>\n\t);\n}\n\n/**\n * Returns a button label for the revision.\n *\n * @param {string|number} id A revision object.\n * @param {string} authorDisplayName Author name.\n * @param {string} formattedModifiedDate Revision modified date formatted.\n * @param {boolean} areStylesEqual Whether the revision matches the current editor styles.\n * @return {string} Translated label.\n */\nfunction getRevisionLabel(\n\tid,\n\tauthorDisplayName,\n\tformattedModifiedDate,\n\tareStylesEqual\n) {\n\tif ( 'parent' === id ) {\n\t\treturn __( 'Reset the styles to the theme defaults' );\n\t}\n\n\tif ( 'unsaved' === id ) {\n\t\treturn sprintf(\n\t\t\t/* translators: %s: author display name */\n\t\t\t__( 'Unsaved changes by %s' ),\n\t\t\tauthorDisplayName\n\t\t);\n\t}\n\n\treturn areStylesEqual\n\t\t? sprintf(\n\t\t\t\t// translators: %1$s: author display name, %2$s: revision creation date.\n\t\t\t\t__(\n\t\t\t\t\t'Changes saved by %1$s on %2$s. This revision matches current editor styles.'\n\t\t\t\t),\n\t\t\t\tauthorDisplayName,\n\t\t\t\tformattedModifiedDate\n\t\t )\n\t\t: sprintf(\n\t\t\t\t// translators: %1$s: author display name, %2$s: revision creation date.\n\t\t\t\t__( 'Changes saved by %1$s on %2$s' ),\n\t\t\t\tauthorDisplayName,\n\t\t\t\tformattedModifiedDate\n\t\t );\n}\n\n/**\n * Returns a rendered list of revisions buttons.\n *\n * @typedef {Object} props\n * @property {Array<Object>} userRevisions A collection of user revisions.\n * @property {number} selectedRevisionId The id of the currently-selected revision.\n * @property {Function} onChange Callback fired when a revision is selected.\n *\n * @param {props} Component props.\n * @return {JSX.Element} The modal component.\n */\nfunction RevisionsButtons( {\n\tuserRevisions,\n\tselectedRevisionId,\n\tonChange,\n\tcanApplyRevision,\n\tonApplyRevision,\n} ) {\n\tconst { currentThemeName, currentUser } = useSelect( ( select ) => {\n\t\tconst { getCurrentTheme, getCurrentUser } = select( coreStore );\n\t\tconst currentTheme = getCurrentTheme();\n\t\treturn {\n\t\t\tcurrentThemeName:\n\t\t\t\tcurrentTheme?.name?.rendered || currentTheme?.stylesheet,\n\t\t\tcurrentUser: getCurrentUser(),\n\t\t};\n\t}, [] );\n\tconst dateNowInMs = getDate().getTime();\n\tconst { datetimeAbbreviated } = getSettings().formats;\n\n\treturn (\n\t\t<ol\n\t\t\tclassName=\"edit-site-global-styles-screen-revisions__revisions-list\"\n\t\t\taria-label={ __( 'Global styles revisions list' ) }\n\t\t\trole=\"group\"\n\t\t>\n\t\t\t{ userRevisions.map( ( revision, index ) => {\n\t\t\t\tconst { id, author, modified } = revision;\n\t\t\t\tconst isUnsaved = 'unsaved' === id;\n\t\t\t\t// Unsaved changes are created by the current user.\n\t\t\t\tconst revisionAuthor = isUnsaved ? currentUser : author;\n\t\t\t\tconst authorDisplayName = revisionAuthor?.name || __( 'User' );\n\t\t\t\tconst authorAvatar = revisionAuthor?.avatar_urls?.[ '48' ];\n\t\t\t\tconst isFirstItem = index === 0;\n\t\t\t\tconst isSelected = selectedRevisionId\n\t\t\t\t\t? selectedRevisionId === id\n\t\t\t\t\t: isFirstItem;\n\t\t\t\tconst areStylesEqual = ! canApplyRevision && isSelected;\n\t\t\t\tconst isReset = 'parent' === id;\n\t\t\t\tconst modifiedDate = getDate( modified );\n\t\t\t\tconst displayDate =\n\t\t\t\t\tmodified &&\n\t\t\t\t\tdateNowInMs - modifiedDate.getTime() > DAY_IN_MILLISECONDS\n\t\t\t\t\t\t? dateI18n( datetimeAbbreviated, modifiedDate )\n\t\t\t\t\t\t: humanTimeDiff( modified );\n\t\t\t\tconst revisionLabel = getRevisionLabel(\n\t\t\t\t\tid,\n\t\t\t\t\tauthorDisplayName,\n\t\t\t\t\tdateI18n( datetimeAbbreviated, modifiedDate ),\n\t\t\t\t\tareStylesEqual\n\t\t\t\t);\n\n\t\t\t\treturn (\n\t\t\t\t\t<li\n\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t'edit-site-global-styles-screen-revisions__revision-item',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'is-selected': isSelected,\n\t\t\t\t\t\t\t\t'is-active': areStylesEqual,\n\t\t\t\t\t\t\t\t'is-reset': isReset,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tkey={ id }\n\t\t\t\t\t\taria-current={ isSelected }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tclassName=\"edit-site-global-styles-screen-revisions__revision-button\"\n\t\t\t\t\t\t\tdisabled={ isSelected }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tonChange( revision );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\taria-label={ revisionLabel }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ isReset ? (\n\t\t\t\t\t\t\t\t<span className=\"edit-site-global-styles-screen-revisions__description\">\n\t\t\t\t\t\t\t\t\t{ __( 'Default styles' ) }\n\t\t\t\t\t\t\t\t\t<span className=\"edit-site-global-styles-screen-revisions__meta\">\n\t\t\t\t\t\t\t\t\t\t{ currentThemeName }\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<span className=\"edit-site-global-styles-screen-revisions__description\">\n\t\t\t\t\t\t\t\t\t{ isUnsaved ? (\n\t\t\t\t\t\t\t\t\t\t<span className=\"edit-site-global-styles-screen-revisions__date\">\n\t\t\t\t\t\t\t\t\t\t\t{ __( '(Unsaved)' ) }\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t<time\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"edit-site-global-styles-screen-revisions__date\"\n\t\t\t\t\t\t\t\t\t\t\tdateTime={ modified }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ displayDate }\n\t\t\t\t\t\t\t\t\t\t</time>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t<span className=\"edit-site-global-styles-screen-revisions__meta\">\n\t\t\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\t\t\talt={ authorDisplayName }\n\t\t\t\t\t\t\t\t\t\t\tsrc={ authorAvatar }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t{ authorDisplayName }\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t{ isSelected && (\n\t\t\t\t\t\t\t\t\t\t<ChangesSummary\n\t\t\t\t\t\t\t\t\t\t\trevision={ revision }\n\t\t\t\t\t\t\t\t\t\t\tpreviousRevision={\n\t\t\t\t\t\t\t\t\t\t\t\tindex < userRevisions.length\n\t\t\t\t\t\t\t\t\t\t\t\t\t? userRevisions[ index + 1 ]\n\t\t\t\t\t\t\t\t\t\t\t\t\t: {}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t{ isSelected &&\n\t\t\t\t\t\t\t( areStylesEqual ? (\n\t\t\t\t\t\t\t\t<p className=\"edit-site-global-styles-screen-revisions__applied-text\">\n\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t'These styles are already applied to your site.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tdisabled={ areStylesEqual }\n\t\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\t\tclassName=\"edit-site-global-styles-screen-revisions__apply-button\"\n\t\t\t\t\t\t\t\t\tonClick={ onApplyRevision }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ isReset\n\t\t\t\t\t\t\t\t\t\t? __( 'Reset to defaults' )\n\t\t\t\t\t\t\t\t\t\t: __( 'Apply' ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t</li>\n\t\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AAAC,aAAA,EAACjB,WAAA,CAAAqE,MAAM;MACNC,QAAQ,EAAG5C,cAAgB;MAC3BiD,IAAI,EAAC,SAAS;MACdC,OAAO,EAAC,SAAS;MACjB1D,SAAS,EAAC,wDAAwD;MAClEqD,OAAO,EAAGrC;IAAiB,GAEzB4B,OAAO,GACN,IAAAnC,QAAE,EAAE,mBAAoB,CAAC,GACzB,IAAAA,QAAE,EAAE,OAAQ,CACR,CACR,CACC,CAAC;EAEP,CAAE,CACC,CAAC;AAEP;AAAC,IAAAkD,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEclD,gBAAgB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_coreData","_element","_blockEditor","_lockUnlock","SITE_EDITOR_AUTHORS_QUERY","per_page","_fields","context","capabilities","DEFAULT_QUERY","page","EMPTY_ARRAY","GlobalStylesContext","unlock","blockEditorPrivateApis","useGlobalStylesRevisions","query","user","userConfig","useContext","_query","authors","currentUser","isDirty","revisions","isLoadingGlobalStylesRevisions","revisionsCount","useSelect","select","_globalStyles$_links$","__experimentalGetDirtyEntityRecords","getCurrentUser","getUsers","getRevisions","__experimentalGetCurrentGlobalStylesId","getEntityRecord","isResolving","coreStore","dirtyEntityRecords","_currentUser","_isDirty","length","globalStylesId","globalStyles","undefined","_revisionsCount","_links","count","globalStylesRevisions","_authors","_isResolving","useMemo","hasUnsavedChanges","isLoading","_modifiedRevisions","map","revision","author","find","id","fetchedRevisionsCount","isLatest","Object","keys","unsavedRevision","styles","settings","name","avatar_urls","modified","Date","unshift","Math","ceil","push"],"sources":["@wordpress/edit-site/src/components/global-styles/screen-revisions/use-global-styles-revisions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useContext, useMemo } from '@wordpress/element';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../lock-unlock';\n\nconst SITE_EDITOR_AUTHORS_QUERY = {\n\tper_page: -1,\n\t_fields: 'id,name,avatar_urls',\n\tcontext: 'view',\n\tcapabilities: [ 'edit_theme_options' ],\n};\nconst DEFAULT_QUERY = { per_page: 100, page: 1 };\nconst EMPTY_ARRAY = [];\nconst { GlobalStylesContext } = unlock( blockEditorPrivateApis );\nexport default function useGlobalStylesRevisions( { query } = {} ) {\n\tconst { user: userConfig } = useContext( GlobalStylesContext );\n\tconst _query = { ...DEFAULT_QUERY, ...query };\n\tconst {\n\t\tauthors,\n\t\tcurrentUser,\n\t\tisDirty,\n\t\trevisions,\n\t\tisLoadingGlobalStylesRevisions,\n\t\trevisionsCount,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\t__experimentalGetDirtyEntityRecords,\n\t\t\t\tgetCurrentUser,\n\t\t\t\tgetUsers,\n\t\t\t\tgetRevisions,\n\t\t\t\t__experimentalGetCurrentGlobalStylesId,\n\t\t\t\tgetEntityRecord,\n\t\t\t\tisResolving,\n\t\t\t} = select( coreStore );\n\t\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\t\tconst _currentUser = getCurrentUser();\n\t\t\tconst _isDirty = dirtyEntityRecords.length > 0;\n\t\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\t\tconst globalStyles = globalStylesId\n\t\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t\t: undefined;\n\t\t\tconst _revisionsCount =\n\t\t\t\tglobalStyles?._links?.[ 'version-history' ]?.[ 0 ]?.count ?? 0;\n\t\t\tconst globalStylesRevisions =\n\t\t\t\tgetRevisions(\n\t\t\t\t\t'root',\n\t\t\t\t\t'globalStyles',\n\t\t\t\t\tglobalStylesId,\n\t\t\t\t\t_query\n\t\t\t\t) || EMPTY_ARRAY;\n\t\t\tconst _authors =\n\t\t\t\tgetUsers( SITE_EDITOR_AUTHORS_QUERY ) || EMPTY_ARRAY;\n\t\t\tconst _isResolving = isResolving( 'getRevisions', [\n\t\t\t\t'root',\n\t\t\t\t'globalStyles',\n\t\t\t\tglobalStylesId,\n\t\t\t\t_query,\n\t\t\t] );\n\t\t\treturn {\n\t\t\t\tauthors: _authors,\n\t\t\t\tcurrentUser: _currentUser,\n\t\t\t\tisDirty: _isDirty,\n\t\t\t\trevisions: globalStylesRevisions,\n\t\t\t\tisLoadingGlobalStylesRevisions: _isResolving,\n\t\t\t\trevisionsCount: _revisionsCount,\n\t\t\t};\n\t\t},\n\t\t[ query ]\n\t);\n\treturn useMemo( () => {\n\t\tif ( ! authors.length || isLoadingGlobalStylesRevisions ) {\n\t\t\treturn {\n\t\t\t\trevisions: EMPTY_ARRAY,\n\t\t\t\thasUnsavedChanges: isDirty,\n\t\t\t\tisLoading: true,\n\t\t\t\trevisionsCount,\n\t\t\t};\n\t\t}\n\n\t\t// Adds author details to each revision.\n\t\tconst _modifiedRevisions = revisions.map( ( revision ) => {\n\t\t\treturn {\n\t\t\t\t...revision,\n\t\t\t\tauthor: authors.find(\n\t\t\t\t\t( author ) => author.id === revision.author\n\t\t\t\t),\n\t\t\t};\n\t\t} );\n\n\t\tconst fetchedRevisionsCount = revisions.length;\n\n\t\tif ( fetchedRevisionsCount ) {\n\t\t\t// Flags the most current saved revision.\n\t\t\tif (\n\t\t\t\t_modifiedRevisions[ 0 ].id !== 'unsaved' &&\n\t\t\t\t_query.page === 1\n\t\t\t) {\n\t\t\t\t_modifiedRevisions[ 0 ].isLatest = true;\n\t\t\t}\n\n\t\t\t// Adds an item for unsaved changes.\n\t\t\tif (\n\t\t\t\tisDirty &&\n\t\t\t\tuserConfig &&\n\t\t\t\tObject.keys( userConfig ).length > 0 &&\n\t\t\t\tcurrentUser &&\n\t\t\t\t_query.page === 1\n\t\t\t) {\n\t\t\t\tconst unsavedRevision = {\n\t\t\t\t\tid: 'unsaved',\n\t\t\t\t\tstyles: userConfig?.styles,\n\t\t\t\t\tsettings: userConfig?.settings,\n\t\t\t\t\tauthor: {\n\t\t\t\t\t\tname: currentUser?.name,\n\t\t\t\t\t\tavatar_urls: currentUser?.avatar_urls,\n\t\t\t\t\t},\n\t\t\t\t\tmodified: new Date(),\n\t\t\t\t};\n\n\t\t\t\t_modifiedRevisions.unshift( unsavedRevision );\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t_query.page === Math.ceil( revisionsCount / _query.per_page )\n\t\t\t) {\n\t\t\t\t// Adds an item for the default theme styles.\n\t\t\t\t_modifiedRevisions.push( {\n\t\t\t\t\tid: 'parent',\n\t\t\t\t\tstyles: {},\n\t\t\t\t\tsettings: {},\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\trevisions: _modifiedRevisions,\n\t\t\thasUnsavedChanges: isDirty,\n\t\t\tisLoading: false,\n\t\t\trevisionsCount,\n\t\t};\n\t}, [\n\t\tisDirty,\n\t\trevisions,\n\t\tcurrentUser,\n\t\tauthors,\n\t\tuserConfig,\n\t\tisLoadingGlobalStylesRevisions,\n\t] );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAKA,IAAAI,WAAA,GAAAJ,OAAA;AAXA;AACA;AACA;;AAMA;AACA;AACA;;AAGA,MAAMK,yBAAyB,GAAG;EACjCC,QAAQ,EAAE,CAAC,CAAC;EACZC,OAAO,EAAE,qBAAqB;EAC9BC,OAAO,EAAE,MAAM;EACfC,YAAY,EAAE,CAAE,oBAAoB;AACrC,CAAC;AACD,MAAMC,aAAa,GAAG;EAAEJ,QAAQ,EAAE,GAAG;EAAEK,IAAI,EAAE;AAAE,CAAC;AAChD,MAAMC,WAAW,GAAG,EAAE;AACtB,MAAM;EAAEC;AAAoB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AACjD,SAASC,wBAAwBA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1BC,QAAQ,EAAEhD,UAAU,EAAEgD,QAAQ;UAC9BT,MAAM,EAAE;YACPU,IAAI,EAAE7C,WAAW,EAAE6C,IAAI;YACvBC,WAAW,EAAE9C,WAAW,EAAE8C;UAC3B,CAAC;UACDC,QAAQ,EAAE,IAAIC,IAAI,CAAC;QACpB,CAAC;QAEDhB,kBAAkB,CAACiB,OAAO,CAAEP,eAAgB,CAAC;MAC9C;MAEA,IACC5C,MAAM,CAACV,IAAI,KAAK8D,IAAI,CAACC,IAAI,CAAE/C,cAAc,GAAGN,MAAM,CAACf,QAAS,CAAC,EAC5D;QACD;QACAiD,kBAAkB,CAACoB,IAAI,CAAE;UACxBf,EAAE,EAAE,QAAQ;UACZM,MAAM,EAAE,CAAC,CAAC;UACVC,QAAQ,EAAE,CAAC;QACZ,CAAE,CAAC;MACJ;IACD;IAEA,OAAO;MACN1C,SAAS,EAAE8B,kBAAkB;MAC7BF,iBAAiB,EAAE7B,OAAO;MAC1B8B,SAAS,EAAE,KAAK;MAChB3B;IACD,CAAC;EACF,CAAC,EAAE,CACFH,OAAO,EACPC,SAAS,EACTF,WAAW,EACXD,OAAO,EACPH,UAAU,EACVO,8BAA8B,CAC7B,CAAC;AACJ"}
|
|
1
|
+
{"version":3,"names":["_data","require","_coreData","_element","_blockEditor","_lockUnlock","SITE_EDITOR_AUTHORS_QUERY","per_page","_fields","context","capabilities","DEFAULT_QUERY","page","EMPTY_ARRAY","GlobalStylesContext","unlock","blockEditorPrivateApis","useGlobalStylesRevisions","query","user","userConfig","useContext","_query","authors","currentUser","isDirty","revisions","isLoadingGlobalStylesRevisions","revisionsCount","useSelect","select","_globalStyles$_links$","__experimentalGetDirtyEntityRecords","getCurrentUser","getUsers","getRevisions","__experimentalGetCurrentGlobalStylesId","getEntityRecord","isResolving","coreStore","dirtyEntityRecords","_currentUser","_isDirty","length","globalStylesId","globalStyles","undefined","_revisionsCount","_links","count","globalStylesRevisions","_authors","_isResolving","useMemo","hasUnsavedChanges","isLoading","_modifiedRevisions","map","revision","author","find","id","fetchedRevisionsCount","isLatest","Object","keys","unsavedRevision","styles","settings","name","avatar_urls","modified","Date","unshift","Math","ceil","push"],"sources":["@wordpress/edit-site/src/components/global-styles/screen-revisions/use-global-styles-revisions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useContext, useMemo } from '@wordpress/element';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../lock-unlock';\n\nconst SITE_EDITOR_AUTHORS_QUERY = {\n\tper_page: -1,\n\t_fields: 'id,name,avatar_urls',\n\tcontext: 'view',\n\tcapabilities: [ 'edit_theme_options' ],\n};\nconst DEFAULT_QUERY = { per_page: 100, page: 1 };\nconst EMPTY_ARRAY = [];\nconst { GlobalStylesContext } = unlock( blockEditorPrivateApis );\nexport default function useGlobalStylesRevisions( { query } = {} ) {\n\tconst { user: userConfig } = useContext( GlobalStylesContext );\n\tconst _query = { ...DEFAULT_QUERY, ...query };\n\tconst {\n\t\tauthors,\n\t\tcurrentUser,\n\t\tisDirty,\n\t\trevisions,\n\t\tisLoadingGlobalStylesRevisions,\n\t\trevisionsCount,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\t__experimentalGetDirtyEntityRecords,\n\t\t\t\tgetCurrentUser,\n\t\t\t\tgetUsers,\n\t\t\t\tgetRevisions,\n\t\t\t\t__experimentalGetCurrentGlobalStylesId,\n\t\t\t\tgetEntityRecord,\n\t\t\t\tisResolving,\n\t\t\t} = select( coreStore );\n\t\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\t\tconst _currentUser = getCurrentUser();\n\t\t\tconst _isDirty = dirtyEntityRecords.length > 0;\n\t\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\t\tconst globalStyles = globalStylesId\n\t\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t\t: undefined;\n\t\t\tconst _revisionsCount =\n\t\t\t\tglobalStyles?._links?.[ 'version-history' ]?.[ 0 ]?.count ?? 0;\n\t\t\tconst globalStylesRevisions =\n\t\t\t\tgetRevisions(\n\t\t\t\t\t'root',\n\t\t\t\t\t'globalStyles',\n\t\t\t\t\tglobalStylesId,\n\t\t\t\t\t_query\n\t\t\t\t) || EMPTY_ARRAY;\n\t\t\tconst _authors =\n\t\t\t\tgetUsers( SITE_EDITOR_AUTHORS_QUERY ) || EMPTY_ARRAY;\n\t\t\tconst _isResolving = isResolving( 'getRevisions', [\n\t\t\t\t'root',\n\t\t\t\t'globalStyles',\n\t\t\t\tglobalStylesId,\n\t\t\t\t_query,\n\t\t\t] );\n\t\t\treturn {\n\t\t\t\tauthors: _authors,\n\t\t\t\tcurrentUser: _currentUser,\n\t\t\t\tisDirty: _isDirty,\n\t\t\t\trevisions: globalStylesRevisions,\n\t\t\t\tisLoadingGlobalStylesRevisions: _isResolving,\n\t\t\t\trevisionsCount: _revisionsCount,\n\t\t\t};\n\t\t},\n\t\t[ query ]\n\t);\n\treturn useMemo( () => {\n\t\tif ( ! authors.length || isLoadingGlobalStylesRevisions ) {\n\t\t\treturn {\n\t\t\t\trevisions: EMPTY_ARRAY,\n\t\t\t\thasUnsavedChanges: isDirty,\n\t\t\t\tisLoading: true,\n\t\t\t\trevisionsCount,\n\t\t\t};\n\t\t}\n\n\t\t// Adds author details to each revision.\n\t\tconst _modifiedRevisions = revisions.map( ( revision ) => {\n\t\t\treturn {\n\t\t\t\t...revision,\n\t\t\t\tauthor: authors.find(\n\t\t\t\t\t( author ) => author.id === revision.author\n\t\t\t\t),\n\t\t\t};\n\t\t} );\n\n\t\tconst fetchedRevisionsCount = revisions.length;\n\n\t\tif ( fetchedRevisionsCount ) {\n\t\t\t// Flags the most current saved revision.\n\t\t\tif (\n\t\t\t\t_modifiedRevisions[ 0 ].id !== 'unsaved' &&\n\t\t\t\t_query.page === 1\n\t\t\t) {\n\t\t\t\t_modifiedRevisions[ 0 ].isLatest = true;\n\t\t\t}\n\n\t\t\t// Adds an item for unsaved changes.\n\t\t\tif (\n\t\t\t\tisDirty &&\n\t\t\t\tuserConfig &&\n\t\t\t\tObject.keys( userConfig ).length > 0 &&\n\t\t\t\tcurrentUser &&\n\t\t\t\t_query.page === 1\n\t\t\t) {\n\t\t\t\tconst unsavedRevision = {\n\t\t\t\t\tid: 'unsaved',\n\t\t\t\t\tstyles: userConfig?.styles,\n\t\t\t\t\tsettings: userConfig?.settings,\n\t\t\t\t\tauthor: {\n\t\t\t\t\t\tname: currentUser?.name,\n\t\t\t\t\t\tavatar_urls: currentUser?.avatar_urls,\n\t\t\t\t\t},\n\t\t\t\t\tmodified: new Date(),\n\t\t\t\t};\n\n\t\t\t\t_modifiedRevisions.unshift( unsavedRevision );\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t_query.page === Math.ceil( revisionsCount / _query.per_page )\n\t\t\t) {\n\t\t\t\t// Adds an item for the default theme styles.\n\t\t\t\t_modifiedRevisions.push( {\n\t\t\t\t\tid: 'parent',\n\t\t\t\t\tstyles: {},\n\t\t\t\t\tsettings: {},\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\trevisions: _modifiedRevisions,\n\t\t\thasUnsavedChanges: isDirty,\n\t\t\tisLoading: false,\n\t\t\trevisionsCount,\n\t\t};\n\t}, [\n\t\tisDirty,\n\t\trevisions,\n\t\tcurrentUser,\n\t\tauthors,\n\t\tuserConfig,\n\t\tisLoadingGlobalStylesRevisions,\n\t] );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAKA,IAAAI,WAAA,GAAAJ,OAAA;AAXA;AACA;AACA;;AAMA;AACA;AACA;;AAGA,MAAMK,yBAAyB,GA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KAAK,CAAC,EAChB;QACD4C,kBAAkB,CAAE,CAAC,CAAE,CAACO,QAAQ,GAAG,IAAI;MACxC;;MAEA;MACA,IACCtC,OAAO,IACPL,UAAU,IACV4C,MAAM,CAACC,IAAI,CAAE7C,UAAW,CAAC,CAACuB,MAAM,GAAG,CAAC,IACpCnB,WAAW,IACXF,MAAM,CAACV,IAAI,KAAK,CAAC,EAChB;QACD,MAAMsD,eAAe,GAAG;UACvBL,EAAE,EAAE,SAAS;UACbM,MAAM,EAAE/C,UAAU,EAAE+C,MAAM;UAC1BC,QAAQ,EAAEhD,UAAU,EAAEgD,QAAQ;UAC9BT,MAAM,EAAE;YACPU,IAAI,EAAE7C,WAAW,EAAE6C,IAAI;YACvBC,WAAW,EAAE9C,WAAW,EAAE8C;UAC3B,CAAC;UACDC,QAAQ,EAAE,IAAIC,IAAI,CAAC;QACpB,CAAC;QAEDhB,kBAAkB,CAACiB,OAAO,CAAEP,eAAgB,CAAC;MAC9C;MAEA,IACC5C,MAAM,CAACV,IAAI,KAAK8D,IAAI,CAACC,IAAI,CAAE/C,cAAc,GAAGN,MAAM,CAACf,QAAS,CAAC,EAC5D;QACD;QACAiD,kBAAkB,CAACoB,IAAI,CAAE;UACxBf,EAAE,EAAE,QAAQ;UACZM,MAAM,EAAE,CAAC,CAAC;UACVC,QAAQ,EAAE,CAAC;QACZ,CAAE,CAAC;MACJ;IACD;IAEA,OAAO;MACN1C,SAAS,EAAE8B,kBAAkB;MAC7BF,iBAAiB,EAAE7B,OAAO;MAC1B8B,SAAS,EAAE,KAAK;MAChB3B;IACD,CAAC;EACF,CAAC,EAAE,CACFH,OAAO,EACPC,SAAS,EACTF,WAAW,EACXD,OAAO,EACPH,UAAU,EACVO,8BAA8B,CAC7B,CAAC;AACJ","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_i18n","_icons","_data","_coreData","_blockEditor","_iconWithCurrentColor","_navigationButton","_rootMenu","_interopRequireDefault","_previewStyles","_lockUnlock","useGlobalStyle","unlock","blockEditorPrivateApis","ScreenRoot","customCSS","hasVariations","canEditCSS","useSelect","select","getEntityRecord","__experimentalGetCurrentGlobalStylesId","__experimentalGetCurrentThemeGlobalStylesVariations","coreStore","globalStylesId","globalStyles","undefined","length","_links","_react","createElement","Card","size","className","CardBody","__experimentalVStack","spacing","CardMedia","default","__experimentalItemGroup","NavigationButtonAsItem","path","__","__experimentalHStack","justify","FlexItem","IconWithCurrentColor","icon","isRTL","chevronLeft","chevronRight","CardDivider","__experimentalSpacer","as","paddingTop","paddingX","marginBottom","Fragment","_default","exports"],"sources":["@wordpress/edit-site/src/components/global-styles/screen-root.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalHStack as HStack,\n\t__experimentalSpacer as Spacer,\n\t__experimentalVStack as VStack,\n\tFlexItem,\n\tCardBody,\n\tCard,\n\tCardDivider,\n\tCardMedia,\n} from '@wordpress/components';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { chevronLeft, chevronRight } from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { IconWithCurrentColor } from './icon-with-current-color';\nimport { NavigationButtonAsItem } from './navigation-button';\nimport RootMenu from './root-menu';\nimport PreviewStyles from './preview-styles';\nimport { unlock } from '../../lock-unlock';\n\nconst { useGlobalStyle } = unlock( blockEditorPrivateApis );\n\nfunction ScreenRoot() {\n\tconst [ customCSS ] = useGlobalStyle( 'css' );\n\n\tconst { hasVariations, canEditCSS } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetEntityRecord,\n\t\t\t__experimentalGetCurrentGlobalStylesId,\n\t\t\t__experimentalGetCurrentThemeGlobalStylesVariations,\n\t\t} = select( coreStore );\n\n\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\tconst globalStyles = globalStylesId\n\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\thasVariations:\n\t\t\t\t!! __experimentalGetCurrentThemeGlobalStylesVariations()\n\t\t\t\t\t?.length,\n\t\t\tcanEditCSS: !! globalStyles?._links?.[ 'wp:action-edit-css' ],\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<Card size=\"small\" className=\"edit-site-global-styles-screen-root\">\n\t\t\t<CardBody>\n\t\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t\t<Card>\n\t\t\t\t\t\t<CardMedia>\n\t\t\t\t\t\t\t<PreviewStyles />\n\t\t\t\t\t\t</CardMedia>\n\t\t\t\t\t</Card>\n\t\t\t\t\t{ hasVariations && (\n\t\t\t\t\t\t<ItemGroup>\n\t\t\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\t\t\tpath=\"/variations\"\n\t\t\t\t\t\t\t\taria-label={ __( 'Browse styles' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t\t\t{ __( 'Browse styles' ) }\n\t\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t\t\t<IconWithCurrentColor\n\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\tisRTL() ? chevronLeft : chevronRight\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t) }\n\t\t\t\t\t<RootMenu />\n\t\t\t\t</VStack>\n\t\t\t</CardBody>\n\n\t\t\t<CardDivider />\n\n\t\t\t<CardBody>\n\t\t\t\t<Spacer\n\t\t\t\t\tas=\"p\"\n\t\t\t\t\tpaddingTop={ 2 }\n\t\t\t\t\t/*\n\t\t\t\t\t * 13px matches the text inset of the NavigationButton (12px padding, plus the width of the button's border).\n\t\t\t\t\t * This is an ad hoc override for this instance and the Addtional CSS option below. Other options for matching the\n\t\t\t\t\t * the nav button inset should be looked at before reusing further.\n\t\t\t\t\t */\n\t\t\t\t\tpaddingX=\"13px\"\n\t\t\t\t\tmarginBottom={ 4 }\n\t\t\t\t>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'Customize the appearance of specific blocks for the whole site.'\n\t\t\t\t\t) }\n\t\t\t\t</Spacer>\n\t\t\t\t<ItemGroup>\n\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\tpath=\"/blocks\"\n\t\t\t\t\t\taria-label={ __( 'Blocks styles' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t\t\t\t<FlexItem>{ __( 'Blocks' ) }</FlexItem>\n\t\t\t\t\t\t\t<IconWithCurrentColor\n\t\t\t\t\t\t\t\ticon={ isRTL() ? chevronLeft : chevronRight }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t</ItemGroup>\n\t\t\t</CardBody>\n\n\t\t\t{ canEditCSS && !! customCSS && (\n\t\t\t\t<>\n\t\t\t\t\t<CardDivider />\n\t\t\t\t\t<CardBody>\n\t\t\t\t\t\t<Spacer\n\t\t\t\t\t\t\tas=\"p\"\n\t\t\t\t\t\t\tpaddingTop={ 2 }\n\t\t\t\t\t\t\tpaddingX=\"13px\"\n\t\t\t\t\t\t\tmarginBottom={ 4 }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'Add your own CSS to customize the appearance and layout of your site.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</Spacer>\n\t\t\t\t\t\t<ItemGroup>\n\t\t\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\t\t\tpath=\"/css\"\n\t\t\t\t\t\t\t\taria-label={ __( 'Additional CSS' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t\t\t{ __( 'Additional CSS' ) }\n\t\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t\t\t<IconWithCurrentColor\n\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\tisRTL() ? chevronLeft : chevronRight\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t</CardBody>\n\t\t\t\t</>\n\t\t\t) }\n\t\t</Card>\n\t);\n}\n\nexport default ScreenRoot;\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAWA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAKA,IAAAM,qBAAA,GAAAN,OAAA;AACA,IAAAO,iBAAA,GAAAP,OAAA;AACA,IAAAQ,SAAA,GAAAC,sBAAA,CAAAT,OAAA;AACA,IAAAU,cAAA,GAAAD,sBAAA,CAAAT,OAAA;AACA,IAAAW,WAAA,GAAAX,OAAA;AA3BA;AACA;AACA;;AAkBA;AACA;AACA;;AAOA,MAAM;EAAEY;AAAe,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAE3D,SAASC,UAAUA,CAAA,EAAG;EACrB,MAAM,CAAEC,SAAS,CAAE,GAAGJ,cAAc,CAAE,KAAM,CAAC;EAE7C,MAAM;IAAEK,aAAa;IAAEC;EAAW,C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CACe,CACd,CACF,CAAC,EAETjC,UAAU,IAAI,CAAC,CAAEF,SAAS,IAC3B,IAAAc,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAA4B,QAAA,QACC,IAAA5B,MAAA,CAAAC,aAAA,EAAChC,WAAA,CAAAqD,WAAW,MAAE,CAAC,EACf,IAAAtB,MAAA,CAAAC,aAAA,EAAChC,WAAA,CAAAoC,QAAQ,QACR,IAAAL,MAAA,CAAAC,aAAA,EAAChC,WAAA,CAAAsD,oBAAM;IACNC,EAAE,EAAC,GAAG;IACNC,UAAU,EAAG,CAAG;IAChBC,QAAQ,EAAC,MAAM;IACfC,YAAY,EAAG;EAAG,GAEhB,IAAAd,QAAE,EACH,uEACD,CACO,CAAC,EACT,IAAAb,MAAA,CAAAC,aAAA,EAAChC,WAAA,CAAAyC,uBAAS,QACT,IAAAV,MAAA,CAAAC,aAAA,EAACxB,iBAAA,CAAAkC,sBAAsB;IACtBC,IAAI,EAAC,MAAM;IACX,cAAa,IAAAC,QAAE,EAAE,gBAAiB;EAAG,GAErC,IAAAb,MAAA,CAAAC,aAAA,EAAChC,WAAA,CAAA6C,oBAAM;IAACC,OAAO,EAAC;EAAe,GAC9B,IAAAf,MAAA,CAAAC,aAAA,EAAChC,WAAA,CAAA+C,QAAQ,QACN,IAAAH,QAAE,EAAE,gBAAiB,CACd,CAAC,EACX,IAAAb,MAAA,CAAAC,aAAA,EAACzB,qBAAA,CAAAyC,oBAAoB;IACpBC,IAAI,EACH,IAAAC,WAAK,EAAC,CAAC,GAAGC,kBAAW,GAAGC;EACxB,CACD,CACM,CACe,CACd,CACF,CACT,CAEE,CAAC;AAET;AAAC,IAAAQ,QAAA,GAAAC,OAAA,CAAArB,OAAA,GAEcxB,UAAU"}
|
|
1
|
+
{"version":3,"names":["_components","require","_i18n","_icons","_data","_coreData","_blockEditor","_iconWithCurrentColor","_navigationButton","_rootMenu","_interopRequireDefault","_previewStyles","_lockUnlock","useGlobalStyle","unlock","blockEditorPrivateApis","ScreenRoot","customCSS","hasVariations","canEditCSS","useSelect","select","getEntityRecord","__experimentalGetCurrentGlobalStylesId","__experimentalGetCurrentThemeGlobalStylesVariations","coreStore","globalStylesId","globalStyles","undefined","length","_links","_react","createElement","Card","size","className","CardBody","__experimentalVStack","spacing","CardMedia","default","__experimentalItemGroup","NavigationButtonAsItem","path","__","__experimentalHStack","justify","FlexItem","IconWithCurrentColor","icon","isRTL","chevronLeft","chevronRight","CardDivider","__experimentalSpacer","as","paddingTop","paddingX","marginBottom","Fragment","_default","exports"],"sources":["@wordpress/edit-site/src/components/global-styles/screen-root.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalHStack as HStack,\n\t__experimentalSpacer as Spacer,\n\t__experimentalVStack as VStack,\n\tFlexItem,\n\tCardBody,\n\tCard,\n\tCardDivider,\n\tCardMedia,\n} from '@wordpress/components';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { chevronLeft, chevronRight } from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { IconWithCurrentColor } from './icon-with-current-color';\nimport { NavigationButtonAsItem } from './navigation-button';\nimport RootMenu from './root-menu';\nimport PreviewStyles from './preview-styles';\nimport { unlock } from '../../lock-unlock';\n\nconst { useGlobalStyle } = unlock( blockEditorPrivateApis );\n\nfunction ScreenRoot() {\n\tconst [ customCSS ] = useGlobalStyle( 'css' );\n\n\tconst { hasVariations, canEditCSS } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetEntityRecord,\n\t\t\t__experimentalGetCurrentGlobalStylesId,\n\t\t\t__experimentalGetCurrentThemeGlobalStylesVariations,\n\t\t} = select( coreStore );\n\n\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\tconst globalStyles = globalStylesId\n\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\thasVariations:\n\t\t\t\t!! __experimentalGetCurrentThemeGlobalStylesVariations()\n\t\t\t\t\t?.length,\n\t\t\tcanEditCSS: !! globalStyles?._links?.[ 'wp:action-edit-css' ],\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<Card size=\"small\" className=\"edit-site-global-styles-screen-root\">\n\t\t\t<CardBody>\n\t\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t\t<Card>\n\t\t\t\t\t\t<CardMedia>\n\t\t\t\t\t\t\t<PreviewStyles />\n\t\t\t\t\t\t</CardMedia>\n\t\t\t\t\t</Card>\n\t\t\t\t\t{ hasVariations && (\n\t\t\t\t\t\t<ItemGroup>\n\t\t\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\t\t\tpath=\"/variations\"\n\t\t\t\t\t\t\t\taria-label={ __( 'Browse styles' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t\t\t{ __( 'Browse styles' ) }\n\t\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t\t\t<IconWithCurrentColor\n\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\tisRTL() ? chevronLeft : chevronRight\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t) }\n\t\t\t\t\t<RootMenu />\n\t\t\t\t</VStack>\n\t\t\t</CardBody>\n\n\t\t\t<CardDivider />\n\n\t\t\t<CardBody>\n\t\t\t\t<Spacer\n\t\t\t\t\tas=\"p\"\n\t\t\t\t\tpaddingTop={ 2 }\n\t\t\t\t\t/*\n\t\t\t\t\t * 13px matches the text inset of the NavigationButton (12px padding, plus the width of the button's border).\n\t\t\t\t\t * This is an ad hoc override for this instance and the Addtional CSS option below. Other options for matching the\n\t\t\t\t\t * the nav button inset should be looked at before reusing further.\n\t\t\t\t\t */\n\t\t\t\t\tpaddingX=\"13px\"\n\t\t\t\t\tmarginBottom={ 4 }\n\t\t\t\t>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'Customize the appearance of specific blocks for the whole site.'\n\t\t\t\t\t) }\n\t\t\t\t</Spacer>\n\t\t\t\t<ItemGroup>\n\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\tpath=\"/blocks\"\n\t\t\t\t\t\taria-label={ __( 'Blocks styles' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t\t\t\t<FlexItem>{ __( 'Blocks' ) }</FlexItem>\n\t\t\t\t\t\t\t<IconWithCurrentColor\n\t\t\t\t\t\t\t\ticon={ isRTL() ? chevronLeft : chevronRight }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t</ItemGroup>\n\t\t\t</CardBody>\n\n\t\t\t{ canEditCSS && !! customCSS && (\n\t\t\t\t<>\n\t\t\t\t\t<CardDivider />\n\t\t\t\t\t<CardBody>\n\t\t\t\t\t\t<Spacer\n\t\t\t\t\t\t\tas=\"p\"\n\t\t\t\t\t\t\tpaddingTop={ 2 }\n\t\t\t\t\t\t\tpaddingX=\"13px\"\n\t\t\t\t\t\t\tmarginBottom={ 4 }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'Add your own CSS to customize the appearance and layout of your site.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</Spacer>\n\t\t\t\t\t\t<ItemGroup>\n\t\t\t\t\t\t\t<NavigationButtonAsItem\n\t\t\t\t\t\t\t\tpath=\"/css\"\n\t\t\t\t\t\t\t\taria-label={ __( 'Additional CSS' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t\t\t{ __( 'Additional CSS' ) }\n\t\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t\t\t<IconWithCurrentColor\n\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\tisRTL() ? chevronLeft : chevronRight\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t</NavigationButtonAsItem>\n\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t</CardBody>\n\t\t\t\t</>\n\t\t\t) }\n\t\t</Card>\n\t);\n}\n\nexport default ScreenRoot;\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAWA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAKA,IAAAM,qBAAA,GAAAN,OAAA;AACA,IAAAO,iBAAA,GAAAP,OAAA;AACA,IAAAQ,SAAA,GAAAC,sBAAA,CAAAT,OAAA;AACA,IAAAU,cAAA,GAAAD,sBAAA,CAAAT,OAAA;AACA,IAAAW,WAAA,GAAAX,OAAA;AA3BA;AACA;AACA;;AAkBA;AACA;AACA;;AAOA,MAAM;EAAEY;AAAe,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAE3D,SAASC,UAAUA,CAAA,EAAG;EACrB,MAAM,CAAEC,SAAS,CAAE,GAAGJ,cAAc,CAAE,KAAM,CAAC;EAE7C,MAAM;IAAEK,aAAa;IAAEC;EAAW,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAC9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AEF,SAAS,IAC3B,IAAAc,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAA4B,QAAA,QACC,IAAA5B,MAAA,CAAAC,aAAA,EAAChC,WAAA,CAAAqD,WAAW,MAAE,CAAC,EACf,IAAAtB,MAAA,CAAAC,aAAA,EAAChC,WAAA,CAAAoC,QAAQ,QACR,IAAAL,MAAA,CAAAC,aAAA,EAAChC,WAAA,CAAAsD,oBAAM;IACNC,EAAE,EAAC,GAAG;IACNC,UAAU,EAAG,CAAG;IAChBC,QAAQ,EAAC,MAAM;IACfC,YAAY,EAAG;EAAG,GAEhB,IAAAd,QAAE,EACH,uEACD,CACO,CAAC,EACT,IAAAb,MAAA,CAAAC,aAAA,EAAChC,WAAA,CAAAyC,uBAAS,QACT,IAAAV,MAAA,CAAAC,aAAA,EAACxB,iBAAA,CAAAkC,sBAAsB;IACtBC,IAAI,EAAC,MAAM;IACX,cAAa,IAAAC,QAAE,EAAE,gBAAiB;EAAG,GAErC,IAAAb,MAAA,CAAAC,aAAA,EAAChC,WAAA,CAAA6C,oBAAM;IAACC,OAAO,EAAC;EAAe,GAC9B,IAAAf,MAAA,CAAAC,aAAA,EAAChC,WAAA,CAAA+C,QAAQ,QACN,IAAAH,QAAE,EAAE,gBAAiB,CACd,CAAC,EACX,IAAAb,MAAA,CAAAC,aAAA,EAACzB,qBAAA,CAAAyC,oBAAoB;IACpBC,IAAI,EACH,IAAAC,WAAK,EAAC,CAAC,GAAGC,kBAAW,GAAGC;EACxB,CACD,CACM,CACe,CACd,CACF,CACT,CAEE,CAAC;AAET;AAAC,IAAAQ,QAAA,GAAAC,OAAA,CAAArB,OAAA,GAEcxB,UAAU","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_i18n","_blockEditor","_header","_interopRequireDefault","_styleVariationsContainer","ScreenStyleVariations","useZoomOut","_react","createElement","Fragment","default","title","__","description","Card","size","isBorderless","className","CardBody","_default","exports"],"sources":["@wordpress/edit-site/src/components/global-styles/screen-style-variations.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Card, CardBody } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useZoomOut } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport ScreenHeader from './header';\nimport StyleVariationsContainer from './style-variations-container';\n\nfunction ScreenStyleVariations() {\n\t// Move to zoom out mode when this component is mounted\n\t// and back to the previous mode when unmounted.\n\tuseZoomOut();\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ __( 'Browse styles' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Choose a variation to change the look of the site.'\n\t\t\t\t) }\n\t\t\t/>\n\n\t\t\t<Card\n\t\t\t\tsize=\"small\"\n\t\t\t\tisBorderless\n\t\t\t\tclassName=\"edit-site-global-styles-screen-style-variations\"\n\t\t\t>\n\t\t\t\t<CardBody>\n\t\t\t\t\t<StyleVariationsContainer />\n\t\t\t\t</CardBody>\n\t\t\t</Card>\n\t\t</>\n\t);\n}\n\nexport default ScreenStyleVariations;\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAKA,IAAAG,OAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,yBAAA,GAAAD,sBAAA,CAAAJ,OAAA;AAXA;AACA;AACA;;AAKA;AACA;AACA;;AAIA,SAASM,qBAAqBA,CAAA,EAAG;EAChC;EACA;EACA,IAAAC,uBAAU,EAAC,CAAC;EAEZ,OACC,IAAAC,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAE,QAAA,QACC,IAAAF,MAAA,CAAAC,aAAA,EAACN,OAAA,CAAAQ,OAAY;IACZC,KAAK,EAAG,IAAAC,QAAE,EAAE,eAAgB,CAAG;IAC/BC,WAAW,EAAG,IAAAD,QAAE,EACf,oDACD;EAAG,CACH,CAAC,EAEF,IAAAL,MAAA,CAAAC,aAAA,EAACV,WAAA,CAAAgB,IAAI;IACJC,IAAI,EAAC,OAAO;IACZC,YAAY;IACZC,SAAS,EAAC;EAAiD,GAE3D,IAAAV,MAAA,CAAAC,aAAA,EAACV,WAAA,CAAAoB,QAAQ,QACR,IAAAX,MAAA,CAAAC,aAAA,EAACJ,yBAAA,CAAAM,OAAwB,MAAE,CAClB,CACL,CACL,CAAC;AAEL;AAAC,IAAAS,QAAA,GAAAC,OAAA,CAAAV,OAAA,GAEcL,qBAAqB"}
|
|
1
|
+
{"version":3,"names":["_components","require","_i18n","_blockEditor","_header","_interopRequireDefault","_styleVariationsContainer","ScreenStyleVariations","useZoomOut","_react","createElement","Fragment","default","title","__","description","Card","size","isBorderless","className","CardBody","_default","exports"],"sources":["@wordpress/edit-site/src/components/global-styles/screen-style-variations.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Card, CardBody } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useZoomOut } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport ScreenHeader from './header';\nimport StyleVariationsContainer from './style-variations-container';\n\nfunction ScreenStyleVariations() {\n\t// Move to zoom out mode when this component is mounted\n\t// and back to the previous mode when unmounted.\n\tuseZoomOut();\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ __( 'Browse styles' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Choose a variation to change the look of the site.'\n\t\t\t\t) }\n\t\t\t/>\n\n\t\t\t<Card\n\t\t\t\tsize=\"small\"\n\t\t\t\tisBorderless\n\t\t\t\tclassName=\"edit-site-global-styles-screen-style-variations\"\n\t\t\t>\n\t\t\t\t<CardBody>\n\t\t\t\t\t<StyleVariationsContainer />\n\t\t\t\t</CardBody>\n\t\t\t</Card>\n\t\t</>\n\t);\n}\n\nexport default ScreenStyleVariations;\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAKA,IAAAG,OAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,yBAAA,GAAAD,sBAAA,CAAAJ,OAAA;AAXA;AACA;AACA;;AAKA;AACA;AACA;;AAIA,SAASM,qBAAqBA,CAAA,EAAG;EAChC;EACA;EACA,IAAAC,uBAAU,EAAC,CAAC;EAEZ,OACC,IAAAC,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAE,QAAA,QACC,IAAAF,MAAA,CAAAC,aAAA,EAACN,OAAA,CAAAQ,OAAY;IACZC,KAAK,EAAG,IAAAC,QAAE,EAAE,eAAgB,CAAG;IAC/BC,WAAW,EAAG,IAAAD,QAAE,EACf,oDACD;EAAG,CACH,CAAC,EAEF,IAAAL,MAAA,CAAAC,aAAA,EAACV,WAAA,CAAAgB,IAAI;IACJC,IAAI,EAAC,OAAO;IACZC,YAAY;IACZC,SAAS,EAAC;EAAiD,GAE3D,IAAAV,MAAA,CAAAC,aAAA,EAACV,WAAA,CAAAoB,QAAQ,QACR,IAAAX,MAAA,CAAAC,aAAA,EAACJ,yBAAA,CAAAM,OAAwB,MAAE,CAClB,CACL,CACL,CAAC;AAEL;AAAC,IAAAS,QAAA,GAAAC,OAAA,CAAAV,OAAA,GAEcL,qBAAqB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_components","_element","_typographyPanel","_interopRequireDefault","_header","_typographyPreview","elements","text","description","__","title","link","heading","caption","button","ScreenTypographyElement","element","headingLevel","setHeadingLevel","useState","_react","createElement","Fragment","default","__experimentalSpacer","marginX","marginBottom","__experimentalToggleGroupControl","label","hideLabelFromVision","value","onChange","isBlock","size","__nextHasNoMarginBottom","__experimentalToggleGroupControlOption","_x","_default","exports"],"sources":["@wordpress/edit-site/src/components/global-styles/screen-typography-element.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\t__experimentalSpacer as Spacer,\n} from '@wordpress/components';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport TypographyPanel from './typography-panel';\nimport ScreenHeader from './header';\nimport TypographyPreview from './typography-preview';\n\nconst elements = {\n\ttext: {\n\t\tdescription: __( 'Manage the fonts used on the site.' ),\n\t\ttitle: __( 'Text' ),\n\t},\n\tlink: {\n\t\tdescription: __( 'Manage the fonts and typography used on the links.' ),\n\t\ttitle: __( 'Links' ),\n\t},\n\theading: {\n\t\tdescription: __( 'Manage the fonts and typography used on headings.' ),\n\t\ttitle: __( 'Headings' ),\n\t},\n\tcaption: {\n\t\tdescription: __( 'Manage the fonts and typography used on captions.' ),\n\t\ttitle: __( 'Captions' ),\n\t},\n\tbutton: {\n\t\tdescription: __( 'Manage the fonts and typography used on buttons.' ),\n\t\ttitle: __( 'Buttons' ),\n\t},\n};\n\nfunction ScreenTypographyElement( { element } ) {\n\tconst [ headingLevel, setHeadingLevel ] = useState( 'heading' );\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ elements[ element ].title }\n\t\t\t\tdescription={ elements[ element ].description }\n\t\t\t/>\n\t\t\t<Spacer marginX={ 4 }>\n\t\t\t\t<TypographyPreview\n\t\t\t\t\telement={ element }\n\t\t\t\t\theadingLevel={ headingLevel }\n\t\t\t\t/>\n\t\t\t</Spacer>\n\t\t\t{ element === 'heading' && (\n\t\t\t\t<Spacer marginX={ 4 } marginBottom=\"1em\">\n\t\t\t\t\t<ToggleGroupControl\n\t\t\t\t\t\tlabel={ __( 'Select heading level' ) }\n\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\tvalue={ headingLevel }\n\t\t\t\t\t\tonChange={ setHeadingLevel }\n\t\t\t\t\t\tisBlock\n\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"heading\"\n\t\t\t\t\t\t\tlabel={ _x( 'All', 'heading levels' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"h1\"\n\t\t\t\t\t\t\tlabel={ __( 'H1' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"h2\"\n\t\t\t\t\t\t\tlabel={ __( 'H2' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"h3\"\n\t\t\t\t\t\t\tlabel={ __( 'H3' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"h4\"\n\t\t\t\t\t\t\tlabel={ __( 'H4' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"h5\"\n\t\t\t\t\t\t\tlabel={ __( 'H5' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"h6\"\n\t\t\t\t\t\t\tlabel={ __( 'H6' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToggleGroupControl>\n\t\t\t\t</Spacer>\n\t\t\t) }\n\t\t\t<TypographyPanel\n\t\t\t\telement={ element }\n\t\t\t\theadingLevel={ headingLevel }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport default ScreenTypographyElement;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAKA,IAAAE,QAAA,GAAAF,OAAA;AAKA,IAAAG,gBAAA,GAAAC,sBAAA,CAAAJ,OAA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CAAwB;IACxBL,KAAK,EAAC,IAAI;IACVF,KAAK,EAAG,IAAAnB,QAAE,EAAE,IAAK;EAAG,CACpB,CAAC,EACF,IAAAW,MAAA,CAAAC,aAAA,EAACrB,WAAA,CAAAmC,sCAAwB;IACxBL,KAAK,EAAC,IAAI;IACVF,KAAK,EAAG,IAAAnB,QAAE,EAAE,IAAK;EAAG,CACpB,CAAC,EACF,IAAAW,MAAA,CAAAC,aAAA,EAACrB,WAAA,CAAAmC,sCAAwB;IACxBL,KAAK,EAAC,IAAI;IACVF,KAAK,EAAG,IAAAnB,QAAE,EAAE,IAAK;EAAG,CACpB,CACkB,CACb,CACR,EACD,IAAAW,MAAA,CAAAC,aAAA,EAACnB,gBAAA,CAAAqB,OAAe;IACfP,OAAO,EAAGA,OAAS;IACnBC,YAAY,EAAGA;EAAc,CAC7B,CACA,CAAC;AAEL;AAAC,IAAAoB,QAAA,GAAAC,OAAA,CAAAf,OAAA,GAEcR,uBAAuB"}
|
|
1
|
+
{"version":3,"names":["_i18n","require","_components","_element","_typographyPanel","_interopRequireDefault","_header","_typographyPreview","elements","text","description","__","title","link","heading","caption","button","ScreenTypographyElement","element","headingLevel","setHeadingLevel","useState","_react","createElement","Fragment","default","__experimentalSpacer","marginX","marginBottom","__experimentalToggleGroupControl","label","hideLabelFromVision","value","onChange","isBlock","size","__nextHasNoMarginBottom","__experimentalToggleGroupControlOption","_x","_default","exports"],"sources":["@wordpress/edit-site/src/components/global-styles/screen-typography-element.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\t__experimentalSpacer as Spacer,\n} from '@wordpress/components';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport TypographyPanel from './typography-panel';\nimport ScreenHeader from './header';\nimport TypographyPreview from './typography-preview';\n\nconst elements = {\n\ttext: {\n\t\tdescription: __( 'Manage the fonts used on the site.' ),\n\t\ttitle: __( 'Text' ),\n\t},\n\tlink: {\n\t\tdescription: __( 'Manage the fonts and typography used on the links.' ),\n\t\ttitle: __( 'Links' ),\n\t},\n\theading: {\n\t\tdescription: __( 'Manage the fonts and typography used on headings.' ),\n\t\ttitle: __( 'Headings' ),\n\t},\n\tcaption: {\n\t\tdescription: __( 'Manage the fonts and typography used on captions.' ),\n\t\ttitle: __( 'Captions' ),\n\t},\n\tbutton: {\n\t\tdescription: __( 'Manage the fonts and typography used on buttons.' ),\n\t\ttitle: __( 'Buttons' ),\n\t},\n};\n\nfunction ScreenTypographyElement( { element } ) {\n\tconst [ headingLevel, setHeadingLevel ] = useState( 'heading' );\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ elements[ element ].title }\n\t\t\t\tdescription={ elements[ element ].description }\n\t\t\t/>\n\t\t\t<Spacer marginX={ 4 }>\n\t\t\t\t<TypographyPreview\n\t\t\t\t\telement={ element }\n\t\t\t\t\theadingLevel={ headingLevel }\n\t\t\t\t/>\n\t\t\t</Spacer>\n\t\t\t{ element === 'heading' && (\n\t\t\t\t<Spacer marginX={ 4 } marginBottom=\"1em\">\n\t\t\t\t\t<ToggleGroupControl\n\t\t\t\t\t\tlabel={ __( 'Select heading level' ) }\n\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\tvalue={ headingLevel }\n\t\t\t\t\t\tonChange={ setHeadingLevel }\n\t\t\t\t\t\tisBlock\n\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"heading\"\n\t\t\t\t\t\t\tlabel={ _x( 'All', 'heading levels' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"h1\"\n\t\t\t\t\t\t\tlabel={ __( 'H1' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"h2\"\n\t\t\t\t\t\t\tlabel={ __( 'H2' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"h3\"\n\t\t\t\t\t\t\tlabel={ __( 'H3' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"h4\"\n\t\t\t\t\t\t\tlabel={ __( 'H4' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"h5\"\n\t\t\t\t\t\t\tlabel={ __( 'H5' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"h6\"\n\t\t\t\t\t\t\tlabel={ __( 'H6' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToggleGroupControl>\n\t\t\t\t</Spacer>\n\t\t\t) }\n\t\t\t<TypographyPanel\n\t\t\t\telement={ element }\n\t\t\t\theadingLevel={ headingLevel }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport default ScreenTypographyElement;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAKA,IAAAE,QAAA,GAAAF,OAAA;AAKA,IAAAG,gBAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAD,sBAAA,CAAAJ,OAAA;AACA,IAAAM,kBAAA,GAAAF,sBAAA,CAAAJ,OAAA;AAhBA;AACA;AACA;;AASA;AACA;AACA;;AAKA,MAAMO,QAAQ,GAAG;EAChBC,IAAI,EAAE;IACLC,WAAW,EAAE,IAAAC,QAAE,EAAE,oCAAqC,CAAC;IACvDC,KAAK,EAAE,IAAAD,QAAE,EAAE,MAAO;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A,EAACrB,WAAA,CAAAmC,sCAAwB;IACxBL,KAAK,EAAC,IAAI;IACVF,KAAK,EAAG,IAAAnB,QAAE,EAAE,IAAK;EAAG,CACpB,CACkB,CACb,CACR,EACD,IAAAW,MAAA,CAAAC,aAAA,EAACnB,gBAAA,CAAAqB,OAAe;IACfP,OAAO,EAAGA,OAAS;IACnBC,YAAY,EAAGA;EAAc,CAC7B,CACA,CAAC;AAEL;AAAC,IAAAoB,QAAA,GAAAC,OAAA,CAAAf,OAAA,GAEcR,uBAAuB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_components","_editor","_data","_typographyElements","_interopRequireDefault","_variationsTypography","_fontFamilies","_header","ScreenTypography","fontLibraryEnabled","useSelect","select","editorStore","getEditorSettings","_react","createElement","Fragment","default","title","__","description","className","__experimentalVStack","spacing","window","__experimentalDisableFontLibrary","_default","exports"],"sources":["@wordpress/edit-site/src/components/global-styles/screen-typography.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { __experimentalVStack as VStack } from '@wordpress/components';\nimport { store as editorStore } from '@wordpress/editor';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport TypographyElements from './typography-elements';\nimport TypographyVariations from './variations/variations-typography';\nimport FontFamilies from './font-families';\nimport ScreenHeader from './header';\n\nfunction ScreenTypography() {\n\tconst fontLibraryEnabled = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).getEditorSettings().fontLibraryEnabled,\n\t\t[]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ __( 'Typography' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Typography styles and the application of those styles on site elements.'\n\t\t\t\t) }\n\t\t\t/>\n\t\t\t<div className=\"edit-site-global-styles-screen\">\n\t\t\t\t<VStack spacing={ 7 }>\n\t\t\t\t\t<TypographyVariations title={ __( 'Presets' ) } />\n\t\t\t\t\t{ ! window.__experimentalDisableFontLibrary &&\n\t\t\t\t\t\tfontLibraryEnabled && <FontFamilies /> }\n\t\t\t\t\t<TypographyElements />\n\t\t\t\t</VStack>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default ScreenTypography;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAKA,IAAAI,mBAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,qBAAA,GAAAD,sBAAA,CAAAL,OAAA;AACA,IAAAO,aAAA,GAAAF,sBAAA,CAAAL,OAAA;AACA,IAAAQ,OAAA,GAAAH,sBAAA,CAAAL,OAAA;AAdA;AACA;AACA;;AAMA;AACA;AACA;;AAMA,SAASS,gBAAgBA,CAAA,EAAG;EAC3B,MAAMC,kBAAkB,GAAG,IAAAC,eAAS,EACjCC,MAAM,IACPA,MAAM,CAAEC,aAAY,CAAC,CAACC,iBAAiB,CAAC,CAAC,CAACJ,kBAAkB,EAC7D,EACD,CAAC;EAED,OACC,IAAAK,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAE,QAAA,QACC,IAAAF,MAAA,CAAAC,aAAA,EAACR,OAAA,CAAAU,OAAY;IACZC,KAAK,EAAG,IAAAC,QAAE,EAAE,YAAa,CAAG;IAC5BC,WAAW,EAAG,IAAAD,QAAE,EACf,yEACD;EAAG,CACH,CAAC,EACF,IAAAL,MAAA,CAAAC,aAAA;IAAKM,SAAS,EAAC;EAAgC,GAC9C,IAAAP,MAAA,CAAAC,aAAA,EAACf,WAAA,CAAAsB,oBAAM;IAACC,OAAO,EAAG;EAAG,GACpB,IAAAT,MAAA,CAAAC,aAAA,EAACV,qBAAA,CAAAY,OAAoB;IAACC,KAAK,EAAG,IAAAC,QAAE,EAAE,SAAU;EAAG,CAAE,CAAC,EAChD,CAAEK,MAAM,CAACC,gCAAgC,IAC1ChB,kBAAkB,IAAI,IAAAK,MAAA,CAAAC,aAAA,EAACT,aAAA,CAAAW,OAAY,MAAE,CAAC,EACvC,IAAAH,MAAA,CAAAC,aAAA,EAACZ,mBAAA,CAAAc,OAAkB,MAAE,CACd,CACJ,CACJ,CAAC;AAEL;AAAC,IAAAS,QAAA,GAAAC,OAAA,CAAAV,OAAA,GAEcT,gBAAgB"}
|
|
1
|
+
{"version":3,"names":["_i18n","require","_components","_editor","_data","_typographyElements","_interopRequireDefault","_variationsTypography","_fontFamilies","_header","ScreenTypography","fontLibraryEnabled","useSelect","select","editorStore","getEditorSettings","_react","createElement","Fragment","default","title","__","description","className","__experimentalVStack","spacing","window","__experimentalDisableFontLibrary","_default","exports"],"sources":["@wordpress/edit-site/src/components/global-styles/screen-typography.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { __experimentalVStack as VStack } from '@wordpress/components';\nimport { store as editorStore } from '@wordpress/editor';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport TypographyElements from './typography-elements';\nimport TypographyVariations from './variations/variations-typography';\nimport FontFamilies from './font-families';\nimport ScreenHeader from './header';\n\nfunction ScreenTypography() {\n\tconst fontLibraryEnabled = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).getEditorSettings().fontLibraryEnabled,\n\t\t[]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\ttitle={ __( 'Typography' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Typography styles and the application of those styles on site elements.'\n\t\t\t\t) }\n\t\t\t/>\n\t\t\t<div className=\"edit-site-global-styles-screen\">\n\t\t\t\t<VStack spacing={ 7 }>\n\t\t\t\t\t<TypographyVariations title={ __( 'Presets' ) } />\n\t\t\t\t\t{ ! window.__experimentalDisableFontLibrary &&\n\t\t\t\t\t\tfontLibraryEnabled && <FontFamilies /> }\n\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AW,OAAY,MAAE,CAAC,EACvC,IAAAH,MAAA,CAAAC,aAAA,EAACZ,mBAAA,CAAAc,OAAkB,MAAE,CACd,CACJ,CACJ,CAAC;AAEL;AAAC,IAAAS,QAAA,GAAAC,OAAA,CAAAV,OAAA,GAEcT,gBAAgB","ignoreList":[]}
|
|
@@ -13,6 +13,7 @@ var _components = require("@wordpress/components");
|
|
|
13
13
|
var _i18n = require("@wordpress/i18n");
|
|
14
14
|
var _previewStyles = _interopRequireDefault(require("./preview-styles"));
|
|
15
15
|
var _variation = _interopRequireDefault(require("./variations/variation"));
|
|
16
|
+
var _useThemeStyleVariationsByProperty = require("../../hooks/use-theme-style-variations/use-theme-style-variations-by-property");
|
|
16
17
|
/**
|
|
17
18
|
* WordPress dependencies
|
|
18
19
|
*/
|
|
@@ -27,12 +28,17 @@ function StyleVariationsContainer({
|
|
|
27
28
|
const variations = (0, _data.useSelect)(select => {
|
|
28
29
|
return select(_coreData.store).__experimentalGetCurrentThemeGlobalStylesVariations();
|
|
29
30
|
}, []);
|
|
31
|
+
|
|
32
|
+
// Filter out variations that are of single property type, i.e. color or typography variations.
|
|
33
|
+
const multiplePropertyVariations = variations?.filter(variation => {
|
|
34
|
+
return !(0, _useThemeStyleVariationsByProperty.isVariationWithSingleProperty)(variation, 'color') && !(0, _useThemeStyleVariationsByProperty.isVariationWithSingleProperty)(variation, 'typography');
|
|
35
|
+
});
|
|
30
36
|
const withEmptyVariation = (0, _element.useMemo)(() => {
|
|
31
37
|
return [{
|
|
32
38
|
title: (0, _i18n.__)('Default'),
|
|
33
39
|
settings: {},
|
|
34
40
|
styles: {}
|
|
35
|
-
}, ...(
|
|
41
|
+
}, ...(multiplePropertyVariations !== null && multiplePropertyVariations !== void 0 ? multiplePropertyVariations : []).map(variation => {
|
|
36
42
|
var _variation$settings, _variation$styles;
|
|
37
43
|
return {
|
|
38
44
|
...variation,
|
|
@@ -40,7 +46,7 @@ function StyleVariationsContainer({
|
|
|
40
46
|
styles: (_variation$styles = variation.styles) !== null && _variation$styles !== void 0 ? _variation$styles : {}
|
|
41
47
|
};
|
|
42
48
|
})];
|
|
43
|
-
}, [
|
|
49
|
+
}, [multiplePropertyVariations]);
|
|
44
50
|
return (0, _react.createElement)(_components.__experimentalGrid, {
|
|
45
51
|
columns: 2,
|
|
46
52
|
className: "edit-site-global-styles-style-variations-container",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_coreData","require","_data","_element","_components","_i18n","_previewStyles","_interopRequireDefault","_variation","StyleVariationsContainer","gap","variations","useSelect","select","coreStore","__experimentalGetCurrentThemeGlobalStylesVariations","withEmptyVariation","useMemo","title","__","settings","styles","map","
|
|
1
|
+
{"version":3,"names":["_coreData","require","_data","_element","_components","_i18n","_previewStyles","_interopRequireDefault","_variation","_useThemeStyleVariationsByProperty","StyleVariationsContainer","gap","variations","useSelect","select","coreStore","__experimentalGetCurrentThemeGlobalStylesVariations","multiplePropertyVariations","filter","variation","isVariationWithSingleProperty","withEmptyVariation","useMemo","title","__","settings","styles","map","_variation$settings","_variation$styles","_react","createElement","__experimentalGrid","columns","className","index","default","key","isFocused","label","withHoverView"],"sources":["@wordpress/edit-site/src/components/global-styles/style-variations-container.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { __experimentalGrid as Grid } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport PreviewStyles from './preview-styles';\nimport Variation from './variations/variation';\nimport { isVariationWithSingleProperty } from '../../hooks/use-theme-style-variations/use-theme-style-variations-by-property';\n\nexport default function StyleVariationsContainer( { gap = 2 } ) {\n\tconst variations = useSelect( ( select ) => {\n\t\treturn select(\n\t\t\tcoreStore\n\t\t).__experimentalGetCurrentThemeGlobalStylesVariations();\n\t}, [] );\n\n\t// Filter out variations that are of single property type, i.e. color or typography variations.\n\tconst multiplePropertyVariations = variations?.filter( ( variation ) => {\n\t\treturn (\n\t\t\t! isVariationWithSingleProperty( variation, 'color' ) &&\n\t\t\t! isVariationWithSingleProperty( variation, 'typography' )\n\t\t);\n\t} );\n\n\tconst withEmptyVariation = useMemo( () => {\n\t\treturn [\n\t\t\t{\n\t\t\t\ttitle: __( 'Default' ),\n\t\t\t\tsettings: {},\n\t\t\t\tstyles: {},\n\t\t\t},\n\t\t\t...( multiplePropertyVariations ?? [] ).map( ( variation ) => ( {\n\t\t\t\t...variation,\n\t\t\t\tsettings: variation.settings ?? {},\n\t\t\t\tstyles: variation.styles ?? {},\n\t\t\t} ) ),\n\t\t];\n\t}, [ multiplePropertyVariations ] );\n\n\treturn (\n\t\t<Grid\n\t\t\tcolumns={ 2 }\n\t\t\tclassName=\"edit-site-global-styles-style-variations-container\"\n\t\t\tgap={ gap }\n\t\t>\n\t\t\t{ withEmptyVariation.map( ( variation, index ) => (\n\t\t\t\t<Variation key={ index } variation={ variation }>\n\t\t\t\t\t{ ( isFocused ) => (\n\t\t\t\t\t\t<PreviewStyles\n\t\t\t\t\t\t\tlabel={ variation?.title }\n\t\t\t\t\t\t\twithHoverView\n\t\t\t\t\t\t\tisFocused={ isFocused }\n\t\t\t\t\t\t\tvariation={ variation }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</Variation>\n\t\t\t) ) }\n\t\t</Grid>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAKA,IAAAK,cAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,UAAA,GAAAD,sBAAA,CAAAN,OAAA;AACA,IAAAQ,kCAAA,GAAAR,OAAA;AAdA;AACA;AACA;;AAOA;AACA;AACA;;AAKe,SAASS,wBAAwBA,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AAEgB,KAAK,KAC3C,IAAAL,MAAA,CAAAC,aAAA,EAACvB,UAAA,CAAA4B,OAAS;IAACC,GAAG,EAAGF,KAAO;IAAChB,SAAS,EAAGA;EAAW,GAC3CmB,SAAS,IACZ,IAAAR,MAAA,CAAAC,aAAA,EAACzB,cAAA,CAAA8B,OAAa;IACbG,KAAK,EAAGpB,SAAS,EAAEI,KAAO;IAC1BiB,aAAa;IACbF,SAAS,EAAGA,SAAW;IACvBnB,SAAS,EAAGA;EAAW,CACvB,CAEQ,CACV,CACG,CAAC;AAET","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","Subtitle","children","level","_react","createElement","__experimentalHeading","className","_default","exports","default"],"sources":["@wordpress/edit-site/src/components/global-styles/subtitle.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalHeading as Heading } from '@wordpress/components';\n\nfunction Subtitle( { children, level } ) {\n\treturn (\n\t\t<Heading\n\t\t\tclassName=\"edit-site-global-styles-subtitle\"\n\t\t\tlevel={ level ?? 2 }\n\t\t>\n\t\t\t{ children }\n\t\t</Heading>\n\t);\n}\n\nexport default Subtitle;\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA,SAASC,QAAQA,CAAE;EAAEC,QAAQ;EAAEC;AAAM,CAAC,EAAG;EACxC,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACN,WAAA,CAAAO,qBAAO;IACPC,SAAS,EAAC,kCAAkC;IAC5CJ,KAAK,EAAGA,KAAK,aAALA,KAAK,cAALA,KAAK,GAAI;EAAG,GAElBD,QACM,CAAC;AAEZ;AAAC,IAAAM,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcT,QAAQ"}
|
|
1
|
+
{"version":3,"names":["_components","require","Subtitle","children","level","_react","createElement","__experimentalHeading","className","_default","exports","default"],"sources":["@wordpress/edit-site/src/components/global-styles/subtitle.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalHeading as Heading } from '@wordpress/components';\n\nfunction Subtitle( { children, level } ) {\n\treturn (\n\t\t<Heading\n\t\t\tclassName=\"edit-site-global-styles-subtitle\"\n\t\t\tlevel={ level ?? 2 }\n\t\t>\n\t\t\t{ children }\n\t\t</Heading>\n\t);\n}\n\nexport default Subtitle;\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA,SAASC,QAAQA,CAAE;EAAEC,QAAQ;EAAEC;AAAM,CAAC,EAAG;EACxC,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACN,WAAA,CAAAO,qBAAO;IACPC,SAAS,EAAC,kCAAkC;IAC5CJ,KAAK,EAAGA,KAAK,aAALA,KAAK,cAALA,KAAK,GAAI;EAAG,GAElBD,QACM,CAAC;AAEZ;AAAC,IAAAM,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcT,QAAQ","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_components","_blockEditor","_navigationButton","_subtitle","_interopRequireDefault","_lockUnlock","useGlobalStyle","unlock","blockEditorPrivateApis","ElementItem","parentMenu","element","label","_ref","prefix","extraStyles","textDecoration","fontFamily","fontStyle","fontWeight","letterSpacing","backgroundColor","fallbackBackgroundColor","gradientValue","color","navigationButtonLabel","sprintf","__","_react","createElement","NavigationButtonAsItem","path","__experimentalHStack","justify","FlexItem","className","style","background","TypographyElements","__experimentalVStack","spacing","default","level","__experimentalItemGroup","isBordered","isSeparated","_default","exports"],"sources":["@wordpress/edit-site/src/components/global-styles/typography-elements.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalVStack as VStack,\n\t__experimentalHStack as HStack,\n\tFlexItem,\n} from '@wordpress/components';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { NavigationButtonAsItem } from './navigation-button';\nimport Subtitle from './subtitle';\n\nimport { unlock } from '../../lock-unlock';\nconst { useGlobalStyle } = unlock( blockEditorPrivateApis );\n\nfunction ElementItem( { parentMenu, element, label } ) {\n\tconst prefix =\n\t\telement === 'text' || ! element ? '' : `elements.${ element }.`;\n\tconst extraStyles =\n\t\telement === 'link'\n\t\t\t? {\n\t\t\t\t\ttextDecoration: 'underline',\n\t\t\t }\n\t\t\t: {};\n\tconst [ fontFamily ] = useGlobalStyle( prefix + 'typography.fontFamily' );\n\tconst [ fontStyle ] = useGlobalStyle( prefix + 'typography.fontStyle' );\n\tconst [ fontWeight ] = useGlobalStyle( prefix + 'typography.fontWeight' );\n\tconst [ letterSpacing ] = useGlobalStyle(\n\t\tprefix + 'typography.letterSpacing'\n\t);\n\tconst [ backgroundColor ] = useGlobalStyle( prefix + 'color.background' );\n\tconst [ fallbackBackgroundColor ] = useGlobalStyle( 'color.background' );\n\tconst [ gradientValue ] = useGlobalStyle( prefix + 'color.gradient' );\n\tconst [ color ] = useGlobalStyle( prefix + 'color.text' );\n\n\tconst navigationButtonLabel = sprintf(\n\t\t// translators: %s: is a subset of Typography, e.g., 'text' or 'links'.\n\t\t__( 'Typography %s styles' ),\n\t\tlabel\n\t);\n\n\treturn (\n\t\t<NavigationButtonAsItem\n\t\t\tpath={ parentMenu + '/typography/' + element }\n\t\t\taria-label={ navigationButtonLabel }\n\t\t>\n\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t<FlexItem\n\t\t\t\t\tclassName=\"edit-site-global-styles-screen-typography__indicator\"\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\tfontFamily: fontFamily ?? 'serif',\n\t\t\t\t\t\tbackground:\n\t\t\t\t\t\t\tgradientValue ??\n\t\t\t\t\t\t\tbackgroundColor ??\n\t\t\t\t\t\t\tfallbackBackgroundColor,\n\t\t\t\t\t\tcolor,\n\t\t\t\t\t\tfontStyle,\n\t\t\t\t\t\tfontWeight,\n\t\t\t\t\t\tletterSpacing,\n\t\t\t\t\t\t...extraStyles,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Aa' ) }\n\t\t\t\t</FlexItem>\n\t\t\t\t<FlexItem>{ label }</FlexItem>\n\t\t\t</HStack>\n\t\t</NavigationButtonAsItem>\n\t);\n}\n\nfunction TypographyElements() {\n\tconst parentMenu = '';\n\n\treturn (\n\t\t<VStack spacing={ 3 }>\n\t\t\t<Subtitle level={ 3 }>{ __( 'Elements' ) }</Subtitle>\n\t\t\t<ItemGroup isBordered isSeparated>\n\t\t\t\t<ElementItem\n\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\telement=\"text\"\n\t\t\t\t\tlabel={ __( 'Text' ) }\n\t\t\t\t/>\n\t\t\t\t<ElementItem\n\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\telement=\"link\"\n\t\t\t\t\tlabel={ __( 'Links' ) }\n\t\t\t\t/>\n\t\t\t\t<ElementItem\n\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\telement=\"heading\"\n\t\t\t\t\tlabel={ __( 'Headings' ) }\n\t\t\t\t/>\n\t\t\t\t<ElementItem\n\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\telement=\"caption\"\n\t\t\t\t\tlabel={ __( 'Captions' ) }\n\t\t\t\t/>\n\t\t\t\t<ElementItem\n\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\telement=\"button\"\n\t\t\t\t\tlabel={ __( 'Buttons' ) }\n\t\t\t\t/>\n\t\t\t</ItemGroup>\n\t\t</VStack>\n\t);\n}\n\nexport default TypographyElements;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAMA,IAAAE,YAAA,GAAAF,OAAA;AAKA,IAAAG,iBAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAC,sBAAA,CAAAL,OAAA;AA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AA,CAAAC,aAAA,EAACpB,WAAW;IACXC,UAAU,EAAGA,UAAY;IACzBC,OAAO,EAAC,MAAM;IACdC,KAAK,EAAG,IAAAe,QAAE,EAAE,OAAQ;EAAG,CACvB,CAAC,EACF,IAAAC,MAAA,CAAAC,aAAA,EAACpB,WAAW;IACXC,UAAU,EAAGA,UAAY;IACzBC,OAAO,EAAC,SAAS;IACjBC,KAAK,EAAG,IAAAe,QAAE,EAAE,UAAW;EAAG,CAC1B,CAAC,EACF,IAAAC,MAAA,CAAAC,aAAA,EAACpB,WAAW;IACXC,UAAU,EAAGA,UAAY;IACzBC,OAAO,EAAC,SAAS;IACjBC,KAAK,EAAG,IAAAe,QAAE,EAAE,UAAW;EAAG,CAC1B,CAAC,EACF,IAAAC,MAAA,CAAAC,aAAA,EAACpB,WAAW;IACXC,UAAU,EAAGA,UAAY;IACzBC,OAAO,EAAC,QAAQ;IAChBC,KAAK,EAAG,IAAAe,QAAE,EAAE,SAAU;EAAG,CACzB,CACS,CACJ,CAAC;AAEX;AAAC,IAAAmB,QAAA,GAAAC,OAAA,CAAAN,OAAA,GAEcH,kBAAkB"}
|
|
1
|
+
{"version":3,"names":["_i18n","require","_components","_blockEditor","_navigationButton","_subtitle","_interopRequireDefault","_lockUnlock","useGlobalStyle","unlock","blockEditorPrivateApis","ElementItem","parentMenu","element","label","_ref","prefix","extraStyles","textDecoration","fontFamily","fontStyle","fontWeight","letterSpacing","backgroundColor","fallbackBackgroundColor","gradientValue","color","navigationButtonLabel","sprintf","__","_react","createElement","NavigationButtonAsItem","path","__experimentalHStack","justify","FlexItem","className","style","background","TypographyElements","__experimentalVStack","spacing","default","level","__experimentalItemGroup","isBordered","isSeparated","_default","exports"],"sources":["@wordpress/edit-site/src/components/global-styles/typography-elements.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalVStack as VStack,\n\t__experimentalHStack as HStack,\n\tFlexItem,\n} from '@wordpress/components';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { NavigationButtonAsItem } from './navigation-button';\nimport Subtitle from './subtitle';\n\nimport { unlock } from '../../lock-unlock';\nconst { useGlobalStyle } = unlock( blockEditorPrivateApis );\n\nfunction ElementItem( { parentMenu, element, label } ) {\n\tconst prefix =\n\t\telement === 'text' || ! element ? '' : `elements.${ element }.`;\n\tconst extraStyles =\n\t\telement === 'link'\n\t\t\t? {\n\t\t\t\t\ttextDecoration: 'underline',\n\t\t\t }\n\t\t\t: {};\n\tconst [ fontFamily ] = useGlobalStyle( prefix + 'typography.fontFamily' );\n\tconst [ fontStyle ] = useGlobalStyle( prefix + 'typography.fontStyle' );\n\tconst [ fontWeight ] = useGlobalStyle( prefix + 'typography.fontWeight' );\n\tconst [ letterSpacing ] = useGlobalStyle(\n\t\tprefix + 'typography.letterSpacing'\n\t);\n\tconst [ backgroundColor ] = useGlobalStyle( prefix + 'color.background' );\n\tconst [ fallbackBackgroundColor ] = useGlobalStyle( 'color.background' );\n\tconst [ gradientValue ] = useGlobalStyle( prefix + 'color.gradient' );\n\tconst [ color ] = useGlobalStyle( prefix + 'color.text' );\n\n\tconst navigationButtonLabel = sprintf(\n\t\t// translators: %s: is a subset of Typography, e.g., 'text' or 'links'.\n\t\t__( 'Typography %s styles' ),\n\t\tlabel\n\t);\n\n\treturn (\n\t\t<NavigationButtonAsItem\n\t\t\tpath={ parentMenu + '/typography/' + element }\n\t\t\taria-label={ navigationButtonLabel }\n\t\t>\n\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t<FlexItem\n\t\t\t\t\tclassName=\"edit-site-global-styles-screen-typography__indicator\"\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\tfontFamily: fontFamily ?? 'serif',\n\t\t\t\t\t\tbackground:\n\t\t\t\t\t\t\tgradientValue ??\n\t\t\t\t\t\t\tbackgroundColor ??\n\t\t\t\t\t\t\tfallbackBackgroundColor,\n\t\t\t\t\t\tcolor,\n\t\t\t\t\t\tfontStyle,\n\t\t\t\t\t\tfontWeight,\n\t\t\t\t\t\tletterSpacing,\n\t\t\t\t\t\t...extraStyles,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Aa' ) }\n\t\t\t\t</FlexItem>\n\t\t\t\t<FlexItem>{ label }</FlexItem>\n\t\t\t</HStack>\n\t\t</NavigationButtonAsItem>\n\t);\n}\n\nfunction TypographyElements() {\n\tconst parentMenu = '';\n\n\treturn (\n\t\t<VStack spacing={ 3 }>\n\t\t\t<Subtitle level={ 3 }>{ __( 'Elements' ) }</Subtitle>\n\t\t\t<ItemGroup isBordered isSeparated>\n\t\t\t\t<ElementItem\n\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\telement=\"text\"\n\t\t\t\t\tlabel={ __( 'Text' ) }\n\t\t\t\t/>\n\t\t\t\t<ElementItem\n\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\telement=\"link\"\n\t\t\t\t\tlabel={ __( 'Links' ) }\n\t\t\t\t/>\n\t\t\t\t<ElementItem\n\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\telement=\"heading\"\n\t\t\t\t\tlabel={ __( 'Headings' ) }\n\t\t\t\t/>\n\t\t\t\t<ElementItem\n\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\telement=\"caption\"\n\t\t\t\t\tlabel={ __( 'Captions' ) }\n\t\t\t\t/>\n\t\t\t\t<ElementItem\n\t\t\t\t\tparentMenu={ parentMenu }\n\t\t\t\t\telement=\"button\"\n\t\t\t\t\tlabel={ __( 'Buttons' ) }\n\t\t\t\t/>\n\t\t\t</ItemGroup>\n\t\t</VStack>\n\t);\n}\n\nexport default TypographyElements;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAMA,IAAAE,YAAA,GAAAF,OAAA;AAK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M;IACdC,KAAK,EAAG,IAAAe,QAAE,EAAE,MAAO;EAAG,CACtB,CAAC,EACF,IAAAC,MAAA,CAAAC,aAAA,EAACpB,WAAW;IACXC,UAAU,EAAGA,UAAY;IACzBC,OAAO,EAAC,MAAM;IACdC,KAAK,EAAG,IAAAe,QAAE,EAAE,OAAQ;EAAG,CACvB,CAAC,EACF,IAAAC,MAAA,CAAAC,aAAA,EAACpB,WAAW;IACXC,UAAU,EAAGA,UAAY;IACzBC,OAAO,EAAC,SAAS;IACjBC,KAAK,EAAG,IAAAe,QAAE,EAAE,UAAW;EAAG,CAC1B,CAAC,EACF,IAAAC,MAAA,CAAAC,aAAA,EAACpB,WAAW;IACXC,UAAU,EAAGA,UAAY;IACzBC,OAAO,EAAC,SAAS;IACjBC,KAAK,EAAG,IAAAe,QAAE,EAAE,UAAW;EAAG,CAC1B,CAAC,EACF,IAAAC,MAAA,CAAAC,aAAA,EAACpB,WAAW;IACXC,UAAU,EAAGA,UAAY;IACzBC,OAAO,EAAC,QAAQ;IAChBC,KAAK,EAAG,IAAAe,QAAE,EAAE,SAAU;EAAG,CACzB,CACS,CACJ,CAAC;AAEX;AAAC,IAAAmB,QAAA,GAAAC,OAAA,CAAAN,OAAA,GAEcH,kBAAkB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_components","_i18n","_blockEditor","_globalStylesProvider","_lockUnlock","_previewStyles","_utils","GlobalStylesContext","unlock","blockEditorPrivateApis","PreviewTypography","fontSize","variation","base","useContext","config","mergeBaseAndUserConfigs","bodyFontFamilies","headingFontFamilies","getFontFamilies","bodyPreviewStyle","getFamilyPreviewStyle","headingPreviewStyle","_react","createElement","__unstableMotion","div","animate","scale","opacity","initial","transition","delay","type","style","textAlign","_x"],"sources":["@wordpress/edit-site/src/components/global-styles/typography-example.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useContext } from '@wordpress/element';\nimport { __unstableMotion as motion } from '@wordpress/components';\nimport { _x } from '@wordpress/i18n';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { mergeBaseAndUserConfigs } from './global-styles-provider';\nimport { unlock } from '../../lock-unlock';\nimport { getFamilyPreviewStyle } from './font-library-modal/utils/preview-styles';\nimport { getFontFamilies } from './utils';\n\nconst { GlobalStylesContext } = unlock( blockEditorPrivateApis );\n\nexport default function PreviewTypography( { fontSize, variation } ) {\n\tconst { base } = useContext( GlobalStylesContext );\n\tlet config = base;\n\tif ( variation ) {\n\t\tconfig = mergeBaseAndUserConfigs( base, variation );\n\t}\n\tconst [ bodyFontFamilies, headingFontFamilies ] = getFontFamilies( config );\n\tconst bodyPreviewStyle = bodyFontFamilies\n\t\t? getFamilyPreviewStyle( bodyFontFamilies )\n\t\t: {};\n\tconst headingPreviewStyle = headingFontFamilies\n\t\t? getFamilyPreviewStyle( headingFontFamilies )\n\t\t: {};\n\n\tif ( fontSize ) {\n\t\tbodyPreviewStyle.fontSize = fontSize;\n\t\theadingPreviewStyle.fontSize = fontSize;\n\t}\n\n\treturn (\n\t\t<motion.div\n\t\t\tanimate={ {\n\t\t\t\tscale: 1,\n\t\t\t\topacity: 1,\n\t\t\t} }\n\t\t\tinitial={ {\n\t\t\t\tscale: 0.1,\n\t\t\t\topacity: 0,\n\t\t\t} }\n\t\t\ttransition={ {\n\t\t\t\tdelay: 0.3,\n\t\t\t\ttype: 'tween',\n\t\t\t} }\n\t\t\tstyle={ {\n\t\t\t\ttextAlign: 'center',\n\t\t\t} }\n\t\t>\n\t\t\t<span style={ headingPreviewStyle }>\n\t\t\t\t{ _x( 'A', 'Uppercase letter A' ) }\n\t\t\t</span>\n\t\t\t<span style={ bodyPreviewStyle }>\n\t\t\t\t{ _x( 'a', 'Lowercase letter A' ) }\n\t\t\t</span>\n\t\t</motion.div>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD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C,KAAK,EAAE,GAAG;MACVC,IAAI,EAAE;IACP,CAAG;IACHC,KAAK,EAAG;MACPC,SAAS,EAAE;IACZ;EAAG,GAEH,IAAAZ,MAAA,CAAAC,aAAA;IAAMU,KAAK,EAAGZ;EAAqB,GAChC,IAAAc,QAAE,EAAE,GAAG,EAAE,oBAAqB,CAC3B,CAAC,EACP,IAAAb,MAAA,CAAAC,aAAA;IAAMU,KAAK,EAAGd;EAAkB,GAC7B,IAAAgB,QAAE,EAAE,GAAG,EAAE,oBAAqB,CAC3B,CACK,CAAC;AAEf"}
|
|
1
|
+
{"version":3,"names":["_element","require","_components","_i18n","_blockEditor","_globalStylesProvider","_lockUnlock","_previewStyles","_utils","GlobalStylesContext","unlock","blockEditorPrivateApis","PreviewTypography","fontSize","variation","base","useContext","config","mergeBaseAndUserConfigs","bodyFontFamilies","headingFontFamilies","getFontFamilies","bodyPreviewStyle","getFamilyPreviewStyle","headingPreviewStyle","_react","createElement","__unstableMotion","div","animate","scale","opacity","initial","transition","delay","type","style","textAlign","_x"],"sources":["@wordpress/edit-site/src/components/global-styles/typography-example.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useContext } from '@wordpress/element';\nimport { __unstableMotion as motion } from '@wordpress/components';\nimport { _x } from '@wordpress/i18n';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { mergeBaseAndUserConfigs } from './global-styles-provider';\nimport { unlock } from '../../lock-unlock';\nimport { getFamilyPreviewStyle } from './font-library-modal/utils/preview-styles';\nimport { getFontFamilies } from './utils';\n\nconst { GlobalStylesContext } = unlock( blockEditorPrivateApis );\n\nexport default function PreviewTypography( { fontSize, variation } ) {\n\tconst { base } = useContext( GlobalStylesContext );\n\tlet config = base;\n\tif ( variation ) {\n\t\tconfig = mergeBaseAndUserConfigs( base, variation );\n\t}\n\tconst [ bodyFontFamilies, headingFontFamilies ] = getFontFamilies( config );\n\tconst bodyPreviewStyle = bodyFontFamilies\n\t\t? getFamilyPreviewStyle( bodyFontFamilies )\n\t\t: {};\n\tconst headingPreviewStyle = headingFontFamilies\n\t\t? getFamilyPreviewStyle( headingFontFamilies )\n\t\t: {};\n\n\tif ( fontSize ) {\n\t\tbodyPreviewStyle.fontSize = fontSize;\n\t\theadingPreviewStyle.fontSize = fontSize;\n\t}\n\n\treturn (\n\t\t<motion.div\n\t\t\tanimate={ {\n\t\t\t\tscale: 1,\n\t\t\t\topacity: 1,\n\t\t\t} }\n\t\t\tinitial={ {\n\t\t\t\tscale: 0.1,\n\t\t\t\topacity: 0,\n\t\t\t} }\n\t\t\ttransition={ {\n\t\t\t\tdelay: 0.3,\n\t\t\t\ttype: 'tween',\n\t\t\t} }\n\t\t\tstyle={ {\n\t\t\t\ttextAlign: 'center',\n\t\t\t} }\n\t\t>\n\t\t\t<span style={ headingPreviewStyle }>\n\t\t\t\t{ _x( 'A', 'Uppercase letter A' ) }\n\t\t\t</span>\n\t\t\t<span style={ bodyPreviewStyle }>\n\t\t\t\t{ _x( 'a', 'Lowercase letter A' ) }\n\t\t\t</span>\n\t\t</motion.div>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAKA,IAAAI,qBAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,cAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAdA;AACA;AACA;;AAMA;AACA;AACA;;AAMA,MAAM;EAAEQ;AAAoB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAEjD,SAASC,iBAAiBA,CAAE;EAAEC,QAAQ;EAAEC;AAAU,CAAC,EAAG;EACpE,MAAM;IAAEC;EAAK,CAAC,GAAG,IAAAC,mBAAU,EAAEP,mBAAoB,CAAC;EAClD,IA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lockElement","TypographyPanel","StylesTypographyPanel","unlock","blockEditorPrivateApis","element","headingLevel","prefixParts","concat","prefix","join","style","undefined","shouldDecodeEncode","inheritedStyle","setStyle","rawSettings","usedElement","settings","_react","createElement","inheritedValue","value","onChange"],"sources":["@wordpress/edit-site/src/components/global-styles/typography-panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst {\n\tuseGlobalStyle,\n\tuseGlobalSetting,\n\tuseSettingsForBlockElement,\n\tTypographyPanel: StylesTypographyPanel,\n} = unlock( blockEditorPrivateApis );\n\nexport default function TypographyPanel( { element, headingLevel } ) {\n\tlet prefixParts = [];\n\tif ( element === 'heading' ) {\n\t\tprefixParts = prefixParts.concat( [ 'elements', headingLevel ] );\n\t} else if ( element && element !== 'text' ) {\n\t\tprefixParts = prefixParts.concat( [ 'elements', element ] );\n\t}\n\tconst prefix = prefixParts.join( '.' );\n\n\tconst [ style ] = useGlobalStyle( prefix, undefined, 'user', {\n\t\tshouldDecodeEncode: false,\n\t} );\n\tconst [ inheritedStyle, setStyle ] = useGlobalStyle(\n\t\tprefix,\n\t\tundefined,\n\t\t'all',\n\t\t{\n\t\t\tshouldDecodeEncode: false,\n\t\t}\n\t);\n\tconst [ rawSettings ] = useGlobalSetting( '' );\n\tconst usedElement = element === 'heading' ? headingLevel : element;\n\tconst settings = useSettingsForBlockElement(\n\t\trawSettings,\n\t\tundefined,\n\t\tusedElement\n\t);\n\n\treturn (\n\t\t<StylesTypographyPanel\n\t\t\tinheritedValue={ inheritedStyle }\n\t\t\tvalue={ style }\n\t\t\tonChange={ setStyle }\n\t\t\tsettings={ settings }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAGA,M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1
|
+
{"version":3,"names":["_blockEditor","require","_lockUnlock","useGlobalStyle","useGlobalSetting","useSettingsForBlockElement","TypographyPanel","StylesTypographyPanel","unlock","blockEditorPrivateApis","element","headingLevel","prefixParts","concat","prefix","join","style","undefined","shouldDecodeEncode","inheritedStyle","setStyle","rawSettings","usedElement","settings","_react","createElement","inheritedValue","value","onChange"],"sources":["@wordpress/edit-site/src/components/global-styles/typography-panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst {\n\tuseGlobalStyle,\n\tuseGlobalSetting,\n\tuseSettingsForBlockElement,\n\tTypographyPanel: StylesTypographyPanel,\n} = unlock( blockEditorPrivateApis );\n\nexport default function TypographyPanel( { element, headingLevel } ) {\n\tlet prefixParts = [];\n\tif ( element === 'heading' ) {\n\t\tprefixParts = prefixParts.concat( [ 'elements', headingLevel ] );\n\t} else if ( element && element !== 'text' ) {\n\t\tprefixParts = prefixParts.concat( [ 'elements', element ] );\n\t}\n\tconst prefix = prefixParts.join( '.' );\n\n\tconst [ style ] = useGlobalStyle( prefix, undefined, 'user', {\n\t\tshouldDecodeEncode: false,\n\t} );\n\tconst [ inheritedStyle, setStyle ] = useGlobalStyle(\n\t\tprefix,\n\t\tundefined,\n\t\t'all',\n\t\t{\n\t\t\tshouldDecodeEncode: false,\n\t\t}\n\t);\n\tconst [ rawSettings ] = useGlobalSetting( '' );\n\tconst usedElement = element === 'heading' ? headingLevel : element;\n\tconst settings = useSettingsForBlockElement(\n\t\trawSettings,\n\t\tundefined,\n\t\tusedElement\n\t);\n\n\treturn (\n\t\t<StylesTypographyPanel\n\t\t\tinheritedValue={ inheritedStyle }\n\t\t\tvalue={ style }\n\t\t\tonChange={ setStyle }\n\t\t\tsettings={ settings }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AA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,EAAGR,QAAU;IACrBG,QAAQ,EAAGA;EAAU,CACrB,CAAC;AAEJ","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_blockEditor","require","_lockUnlock","useGlobalStyle","unlock","blockEditorPrivateApis","TypographyPreview","name","element","headingLevel","_ref","prefix","fontFamily","gradientValue","backgroundColor","fallbackBackgroundColor","color","fontSize","fontStyle","fontWeight","letterSpacing","extraStyles","textDecoration","_react","createElement","className","style","background"],"sources":["@wordpress/edit-site/src/components/global-styles/typography-preview.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { useGlobalStyle } = unlock( blockEditorPrivateApis );\n\nexport default function TypographyPreview( { name, element, headingLevel } ) {\n\tlet prefix = '';\n\tif ( element === 'heading' ) {\n\t\tprefix = `elements.${ headingLevel }.`;\n\t} else if ( element && element !== 'text' ) {\n\t\tprefix = `elements.${ element }.`;\n\t}\n\n\tconst [ fontFamily ] = useGlobalStyle(\n\t\tprefix + 'typography.fontFamily',\n\t\tname\n\t);\n\tconst [ gradientValue ] = useGlobalStyle( prefix + 'color.gradient', name );\n\tconst [ backgroundColor ] = useGlobalStyle(\n\t\tprefix + 'color.background',\n\t\tname\n\t);\n\tconst [ fallbackBackgroundColor ] = useGlobalStyle( 'color.background' );\n\tconst [ color ] = useGlobalStyle( prefix + 'color.text', name );\n\tconst [ fontSize ] = useGlobalStyle( prefix + 'typography.fontSize', name );\n\tconst [ fontStyle ] = useGlobalStyle(\n\t\tprefix + 'typography.fontStyle',\n\t\tname\n\t);\n\tconst [ fontWeight ] = useGlobalStyle(\n\t\tprefix + 'typography.fontWeight',\n\t\tname\n\t);\n\tconst [ letterSpacing ] = useGlobalStyle(\n\t\tprefix + 'typography.letterSpacing',\n\t\tname\n\t);\n\tconst extraStyles =\n\t\telement === 'link'\n\t\t\t? {\n\t\t\t\t\ttextDecoration: 'underline',\n\t\t\t }\n\t\t\t: {};\n\n\treturn (\n\t\t<div\n\t\t\tclassName=\"edit-site-typography-preview\"\n\t\t\tstyle={ {\n\t\t\t\tfontFamily: fontFamily ?? 'serif',\n\t\t\t\tbackground:\n\t\t\t\t\tgradientValue ?? backgroundColor ?? fallbackBackgroundColor,\n\t\t\t\tcolor,\n\t\t\t\tfontSize,\n\t\t\t\tfontStyle,\n\t\t\t\tfontWeight,\n\t\t\t\tletterSpacing,\n\t\t\t\t...extraStyles,\n\t\t\t} }\n\t\t>\n\t\t\tAa\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAGA,MAAM;EAAEE;AAAe,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAE5C,SAASC,iBAAiBA,CAAE;EAAEC,IAAI;EAAEC,OAAO;EAAEC;AAAa,CAAC,EAAG;EAAA,IAAAC,IAAA;EAC5E,IAAIC,MAAM,GAAG,EAAE;EACf,IAAKH,OAAO,KAAK,SAAS,EAAG;IAC5BG,MAAM,GAAI,YAAYF,YAAc,GAAE;EACvC,CAAC,MAAM,IAAKD,OAAO,IAAIA,OAAO,KAAK,MAAM,EAAG;IAC3CG,MAAM,GAAI,YAAYH,OAAS,GAAE;EAClC;EAEA,MAAM,CAAEI,UAAU,CAAE,GAAGT,cAAc,CACpCQ,MAAM,GAAG,uBAAuB,EAChCJ,IACD,CAAC;EACD,MAAM,CAAEM,aAAa,CAAE,GAAGV,cAAc,CAAEQ,MAAM,GAAG,gBAAgB,EAAEJ,IAAK,CAAC;EAC3E,MAAM,CAAEO,eAAe,CAAE,GAAGX,cAAc,CACzCQ,MAAM,GAAG,kBAAkB,EAC3BJ,IACD,CAAC;EACD,MAAM,CAAEQ,uBAAuB,CAAE,GAAGZ,cAAc,CAAE,kBAAmB,CAAC;EACxE,MAAM,CAAEa,KAAK,CAAE,GAAGb,cAAc,CAAEQ,MAAM,GAAG,YAAY,EAAEJ,IAAK,CAAC;EAC/D,MAAM,CAAEU,QAAQ,CAAE,GAAGd,cAAc,CAAEQ,MAAM,GAAG,qBAAqB,EAAEJ,IAAK,CAAC;EAC3E,MAAM,CAAEW,SAAS,CAAE,GAAGf,cAAc,CACnCQ,MAAM,GAAG,sBAAsB,EAC/BJ,IACD,CAAC;EACD,MAAM,CAAEY,UAAU,CAAE,GAAGhB,cAAc,CACpCQ,MAAM,GAAG,uBAAuB,EAChCJ,IACD,CAAC;EACD,MAAM,CAAEa,aAAa,CAAE,GAAGjB,cAAc,CACvCQ,MAAM,GAAG,0BAA0B,EACnCJ,IACD,CAAC;EACD,MAAMc,WAAW,GAChBb,OAAO,KAAK,MAAM,GACf;IACAc,cAAc,EAAE;EAChB,CAAC,GACD,CAAC,CAAC;EAEN,OACC,IAAAC,MAAA,CAAAC,aAAA;IACCC,SAAS,EAAC,8BAA8B;IACxCC,KAAK,EAAG;MACPd,UAAU,EAAEA,UAAU,aAAVA,UAAU,cAAVA,UAAU,GAAI,OAAO;MACjCe,UAAU,GAAAjB,IAAA,GACTG,aAAa,aAAbA,aAAa,cAAbA,aAAa,GAAIC,eAAe,cAAAJ,IAAA,cAAAA,IAAA,GAAIK,uBAAuB;MAC5DC,KAAK;MACLC,QAAQ;MACRC,SAAS;MACTC,UAAU;MACVC,aAAa;MACb,GAAGC;IACJ;EAAG,GACH,IAEI,CAAC;AAER"}
|
|
1
|
+
{"version":3,"names":["_blockEditor","require","_lockUnlock","useGlobalStyle","unlock","blockEditorPrivateApis","TypographyPreview","name","element","headingLevel","_ref","prefix","fontFamily","gradientValue","backgroundColor","fallbackBackgroundColor","color","fontSize","fontStyle","fontWeight","letterSpacing","extraStyles","textDecoration","_react","createElement","className","style","background"],"sources":["@wordpress/edit-site/src/components/global-styles/typography-preview.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { useGlobalStyle } = unlock( blockEditorPrivateApis );\n\nexport default function TypographyPreview( { name, element, headingLevel } ) {\n\tlet prefix = '';\n\tif ( element === 'heading' ) {\n\t\tprefix = `elements.${ headingLevel }.`;\n\t} else if ( element && element !== 'text' ) {\n\t\tprefix = `elements.${ element }.`;\n\t}\n\n\tconst [ fontFamily ] = useGlobalStyle(\n\t\tprefix + 'typography.fontFamily',\n\t\tname\n\t);\n\tconst [ gradientValue ] = useGlobalStyle( prefix + 'color.gradient', name );\n\tconst [ backgroundColor ] = useGlobalStyle(\n\t\tprefix + 'color.background',\n\t\tname\n\t);\n\tconst [ fallbackBackgroundColor ] = useGlobalStyle( 'color.background' );\n\tconst [ color ] = useGlobalStyle( prefix + 'color.text', name );\n\tconst [ fontSize ] = useGlobalStyle( prefix + 'typography.fontSize', name );\n\tconst [ fontStyle ] = useGlobalStyle(\n\t\tprefix + 'typography.fontStyle',\n\t\tname\n\t);\n\tconst [ fontWeight ] = useGlobalStyle(\n\t\tprefix + 'typography.fontWeight',\n\t\tname\n\t);\n\tconst [ letterSpacing ] = useGlobalStyle(\n\t\tprefix + 'typography.letterSpacing',\n\t\tname\n\t);\n\tconst extraStyles =\n\t\telement === 'link'\n\t\t\t? {\n\t\t\t\t\ttextDecoration: 'underline',\n\t\t\t }\n\t\t\t: {};\n\n\treturn (\n\t\t<div\n\t\t\tclassName=\"edit-site-typography-preview\"\n\t\t\tstyle={ {\n\t\t\t\tfontFamily: fontFamily ?? 'serif',\n\t\t\t\tbackground:\n\t\t\t\t\tgradientValue ?? backgroundColor ?? fallbackBackgroundColor,\n\t\t\t\tcolor,\n\t\t\t\tfontSize,\n\t\t\t\tfontStyle,\n\t\t\t\tfontWeight,\n\t\t\t\tletterSpacing,\n\t\t\t\t...extraStyles,\n\t\t\t} }\n\t\t>\n\t\t\tAa\n\t\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,IACD,CAAC;EACD,MAAM,CAAEa,aAAa,CAAE,GAAGjB,cAAc,CACvCQ,MAAM,GAAG,0BAA0B,EACnCJ,IACD,CAAC;EACD,MAAMc,WAAW,GAChBb,OAAO,KAAK,MAAM,GACf;IACAc,cAAc,EAAE;EAChB,CAAC,GACD,CAAC,CAAC;EAEN,OACC,IAAAC,MAAA,CAAAC,aAAA;IACCC,SAAS,EAAC,8BAA8B;IACxCC,KAAK,EAAG;MACPd,UAAU,EAAEA,UAAU,aAAVA,UAAU,cAAVA,UAAU,GAAI,OAAO;MACjCe,UAAU,GAAAjB,IAAA,GACTG,aAAa,aAAbA,aAAa,cAAbA,aAAa,GAAIC,eAAe,cAAAJ,IAAA,cAAAA,IAAA,GAAIK,uBAAuB;MAC5DC,KAAK;MACLC,QAAQ;MACRC,SAAS;MACTC,UAAU;MACVC,aAAa;MACb,GAAGC;IACJ;EAAG,GACH,IAEI,CAAC;AAER","ignoreList":[]}
|
|
@@ -31,7 +31,7 @@ var _screenBackground = _interopRequireDefault(require("./screen-background"));
|
|
|
31
31
|
var _lockUnlock = require("../../lock-unlock");
|
|
32
32
|
var _store = require("../../store");
|
|
33
33
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
34
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
34
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
35
35
|
/**
|
|
36
36
|
* WordPress dependencies
|
|
37
37
|
*/
|