@wordpress/edit-site 5.29.0 → 5.31.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/actions/index.js +3 -5
- package/build/components/actions/index.js.map +1 -1
- package/build/components/block-editor/editor-canvas.js +18 -6
- package/build/components/block-editor/editor-canvas.js.map +1 -1
- package/build/components/block-editor/use-site-editor-settings.js +1 -1
- package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build/components/editor/index.js +1 -15
- package/build/components/editor/index.js.map +1 -1
- package/build/components/global-styles/color-palette-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-library-modal/collection-font-variant.js +2 -2
- 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 +70 -59
- package/build/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-card.js +10 -15
- 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 +121 -78
- 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 +29 -8
- 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 +3 -2
- 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 +19 -6
- package/build/components/global-styles/font-library-modal/index.js.map +1 -1
- package/build/components/global-styles/font-library-modal/installed-fonts.js +151 -79
- package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/library-font-variant.js +2 -2
- package/build/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
- package/build/components/global-styles/font-library-modal/upload-fonts.js +51 -23
- package/build/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/index.js +39 -5
- package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/preview-styles.js +4 -1
- package/build/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
- package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build/components/global-styles/header.js +2 -2
- package/build/components/global-styles/header.js.map +1 -1
- package/build/components/global-styles/highlighted-colors.js +50 -0
- package/build/components/global-styles/highlighted-colors.js.map +1 -0
- package/build/components/global-styles/hooks.js +50 -1
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/preview-colors.js +62 -0
- package/build/components/global-styles/preview-colors.js.map +1 -0
- package/build/components/global-styles/preview-iframe.js +130 -0
- package/build/components/global-styles/preview-iframe.js.map +1 -0
- package/build/components/global-styles/preview-styles.js +163 -0
- package/build/components/global-styles/preview-styles.js.map +1 -0
- package/build/components/global-styles/screen-block-list.js +1 -1
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-block.js +1 -1
- package/build/components/global-styles/screen-block.js.map +1 -1
- package/build/components/global-styles/screen-colors.js +3 -2
- package/build/components/global-styles/screen-colors.js.map +1 -1
- package/build/components/global-styles/screen-revisions/index.js +2 -2
- package/build/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build/components/global-styles/screen-root.js +2 -2
- package/build/components/global-styles/screen-root.js.map +1 -1
- package/build/components/global-styles/screen-typography.js +5 -2
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/style-variations-container.js +12 -84
- package/build/components/global-styles/style-variations-container.js.map +1 -1
- package/build/components/global-styles/{typogrphy-elements.js → typography-elements.js} +4 -2
- package/build/components/global-styles/typography-elements.js.map +1 -0
- package/build/components/global-styles/typography-example.js +67 -0
- package/build/components/global-styles/typography-example.js.map +1 -0
- package/build/components/global-styles/typography-preview.js +3 -1
- package/build/components/global-styles/typography-preview.js.map +1 -1
- package/build/components/global-styles/ui.js +27 -2
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles/utils.js +22 -0
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/global-styles/variations/variation.js +90 -0
- package/build/components/global-styles/variations/variation.js.map +1 -0
- package/build/components/global-styles/variations/variations-color.js +35 -0
- package/build/components/global-styles/variations/variations-color.js.map +1 -0
- package/build/components/global-styles/{variations-panel.js → variations/variations-panel.js} +1 -1
- package/build/components/global-styles/variations/variations-panel.js.map +1 -0
- package/build/components/global-styles/variations/variations-typography.js +54 -0
- package/build/components/global-styles/variations/variations-typography.js.map +1 -0
- package/build/components/header-edit-mode/index.js +14 -12
- package/build/components/header-edit-mode/index.js.map +1 -1
- package/build/components/header-edit-mode/more-menu/index.js +10 -2
- package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/config.js +6 -0
- package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -1
- package/build/components/keyboard-shortcuts/global.js +17 -3
- package/build/components/keyboard-shortcuts/global.js.map +1 -1
- package/build/components/layout/index.js +4 -1
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/router.js +2 -5
- package/build/components/layout/router.js.map +1 -1
- package/build/components/page-pages/index.js +6 -11
- package/build/components/page-pages/index.js.map +1 -1
- package/build/components/page-patterns/delete-category-menu-item.js +6 -1
- package/build/components/page-patterns/delete-category-menu-item.js.map +1 -1
- package/build/components/page-patterns/index.js +15 -18
- package/build/components/page-patterns/index.js.map +1 -1
- package/build/components/page-patterns/use-patterns.js +9 -9
- package/build/components/page-patterns/use-patterns.js.map +1 -1
- package/build/components/{list/added-by.js → page-templates-template-parts/hooks.js} +1 -61
- package/build/components/page-templates-template-parts/hooks.js.map +1 -0
- package/build/components/page-templates-template-parts/index.js +25 -22
- package/build/components/page-templates-template-parts/index.js.map +1 -1
- package/build/components/resizable-frame/index.js +2 -1
- package/build/components/resizable-frame/index.js.map +1 -1
- package/build/components/revisions/index.js.map +1 -1
- package/build/components/save-panel/index.js +31 -11
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/sidebar/index.js +3 -4
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-dataviews/custom-dataviews-list.js +2 -2
- package/build/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
- package/build/components/sidebar-dataviews/dataview-item.js +2 -2
- package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build/components/sidebar-dataviews/default-views.js +4 -2
- package/build/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build/components/sidebar-dataviews/index.js +4 -3
- package/build/components/sidebar-dataviews/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/index.js +2 -2
- package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/page-summary.js +3 -1
- package/build/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
- package/build/components/sidebar-edit-mode/sidebar-card/index.js +12 -6
- package/build/components/sidebar-edit-mode/sidebar-card/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-panel/index.js +23 -3
- package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js +13 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/index.js +1 -2
- package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/{delete-modal.js → delete-confirm-dialog.js} +4 -5
- package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +1 -0
- package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js +6 -6
- package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +0 -3
- 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 +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.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.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js +2 -2
- package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
- package/build/components/sidebar-navigation-screen-template/index.js +7 -3
- package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/content.js +6 -6
- package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/index.js +7 -5
- package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build/components/start-template-options/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +1 -1
- 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-path-with-url.js +1 -11
- package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
- package/build/components/template-actions/index.js +44 -27
- package/build/components/template-actions/index.js.map +1 -1
- package/build/components/welcome-guide/editor.js +11 -2
- package/build/components/welcome-guide/editor.js.map +1 -1
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +78 -0
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
- package/build/utils/constants.js +5 -3
- package/build/utils/constants.js.map +1 -1
- package/build/utils/get-is-list-page.js +1 -1
- package/build/utils/get-is-list-page.js.map +1 -1
- package/build/utils/math.js +98 -0
- package/build/utils/math.js.map +1 -0
- package/build-module/components/actions/index.js +4 -6
- package/build-module/components/actions/index.js.map +1 -1
- package/build-module/components/block-editor/editor-canvas.js +18 -6
- package/build-module/components/block-editor/editor-canvas.js.map +1 -1
- package/build-module/components/block-editor/use-site-editor-settings.js +1 -1
- package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build-module/components/editor/index.js +2 -16
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/font-families.js +1 -1
- package/build-module/components/global-styles/font-families.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/collection-font-variant.js +4 -4
- 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 +72 -61
- 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 +11 -16
- 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 +124 -81
- 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 +30 -9
- 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 +4 -3
- 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 +19 -6
- 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 +151 -79
- 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-variant.js +4 -4
- 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/upload-fonts.js +52 -24
- 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/index.js +38 -5
- 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/preview-styles.js +4 -1
- package/build-module/components/global-styles/font-library-modal/utils/preview-styles.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 +2 -2
- package/build-module/components/global-styles/header.js.map +1 -1
- package/build-module/components/global-styles/highlighted-colors.js +43 -0
- package/build-module/components/global-styles/highlighted-colors.js.map +1 -0
- package/build-module/components/global-styles/hooks.js +48 -1
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/preview-colors.js +54 -0
- package/build-module/components/global-styles/preview-colors.js.map +1 -0
- package/build-module/components/global-styles/preview-iframe.js +123 -0
- package/build-module/components/global-styles/preview-iframe.js.map +1 -0
- package/build-module/components/global-styles/preview-styles.js +155 -0
- package/build-module/components/global-styles/preview-styles.js.map +1 -0
- package/build-module/components/global-styles/screen-block-list.js +1 -1
- package/build-module/components/global-styles/screen-block-list.js.map +1 -1
- package/build-module/components/global-styles/screen-block.js +1 -1
- package/build-module/components/global-styles/screen-block.js.map +1 -1
- package/build-module/components/global-styles/screen-colors.js +3 -2
- package/build-module/components/global-styles/screen-colors.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/index.js +2 -2
- package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build-module/components/global-styles/screen-root.js +2 -2
- package/build-module/components/global-styles/screen-root.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js +5 -2
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/style-variations-container.js +13 -85
- package/build-module/components/global-styles/style-variations-container.js.map +1 -1
- package/build-module/components/global-styles/{typogrphy-elements.js → typography-elements.js} +4 -2
- package/build-module/components/global-styles/typography-elements.js.map +1 -0
- package/build-module/components/global-styles/typography-example.js +60 -0
- package/build-module/components/global-styles/typography-example.js.map +1 -0
- package/build-module/components/global-styles/typography-preview.js +3 -1
- package/build-module/components/global-styles/typography-preview.js.map +1 -1
- package/build-module/components/global-styles/ui.js +27 -2
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles/utils.js +21 -0
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/global-styles/variations/variation.js +82 -0
- package/build-module/components/global-styles/variations/variation.js.map +1 -0
- package/build-module/components/global-styles/variations/variations-color.js +27 -0
- package/build-module/components/global-styles/variations/variations-color.js.map +1 -0
- package/build-module/components/global-styles/{variations-panel.js → variations/variations-panel.js} +1 -1
- package/build-module/components/global-styles/variations/variations-panel.js.map +1 -0
- package/build-module/components/global-styles/variations/variations-typography.js +46 -0
- package/build-module/components/global-styles/variations/variations-typography.js.map +1 -0
- package/build-module/components/header-edit-mode/index.js +15 -13
- package/build-module/components/header-edit-mode/index.js.map +1 -1
- package/build-module/components/header-edit-mode/more-menu/index.js +13 -5
- package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js +6 -0
- package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/global.js +17 -3
- package/build-module/components/keyboard-shortcuts/global.js.map +1 -1
- package/build-module/components/layout/index.js +4 -1
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/layout/router.js +2 -5
- package/build-module/components/layout/router.js.map +1 -1
- package/build-module/components/page-pages/index.js +7 -12
- package/build-module/components/page-pages/index.js.map +1 -1
- package/build-module/components/page-patterns/delete-category-menu-item.js +6 -1
- package/build-module/components/page-patterns/delete-category-menu-item.js.map +1 -1
- package/build-module/components/page-patterns/index.js +16 -19
- package/build-module/components/page-patterns/index.js.map +1 -1
- package/build-module/components/page-patterns/use-patterns.js +9 -9
- package/build-module/components/page-patterns/use-patterns.js.map +1 -1
- package/build-module/components/{list/added-by.js → page-templates-template-parts/hooks.js} +2 -59
- package/build-module/components/page-templates-template-parts/hooks.js.map +1 -0
- package/build-module/components/page-templates-template-parts/index.js +25 -22
- package/build-module/components/page-templates-template-parts/index.js.map +1 -1
- package/build-module/components/resizable-frame/index.js +2 -1
- 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/save-panel/index.js +31 -11
- package/build-module/components/save-panel/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +3 -4
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-dataviews/custom-dataviews-list.js +2 -2
- package/build-module/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
- package/build-module/components/sidebar-dataviews/dataview-item.js +2 -2
- package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build-module/components/sidebar-dataviews/default-views.js +6 -4
- package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build-module/components/sidebar-dataviews/index.js +4 -3
- package/build-module/components/sidebar-dataviews/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/index.js +3 -3
- package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js +4 -2
- package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/sidebar-card/index.js +13 -7
- package/build-module/components/sidebar-edit-mode/sidebar-card/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/template-panel/index.js +24 -4
- package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +14 -2
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +1 -2
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/{delete-modal.js → delete-confirm-dialog.js} +3 -4
- package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +6 -6
- package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +0 -3
- 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 +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.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.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-template/index.js +6 -2
- package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +5 -5
- 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 +7 -5
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build-module/components/start-template-options/index.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +1 -1
- 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-path-with-url.js +1 -11
- package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
- package/build-module/components/template-actions/index.js +44 -27
- package/build-module/components/template-actions/index.js.map +1 -1
- package/build-module/components/welcome-guide/editor.js +11 -2
- package/build-module/components/welcome-guide/editor.js.map +1 -1
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +76 -1
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
- package/build-module/utils/constants.js +4 -2
- package/build-module/utils/constants.js.map +1 -1
- package/build-module/utils/get-is-list-page.js +1 -1
- package/build-module/utils/get-is-list-page.js.map +1 -1
- package/build-module/utils/math.js +92 -0
- package/build-module/utils/math.js.map +1 -0
- package/build-style/style-rtl.css +196 -315
- package/build-style/style.css +196 -315
- package/package.json +42 -42
- package/src/components/actions/index.js +4 -6
- package/src/components/block-editor/editor-canvas.js +20 -6
- package/src/components/block-editor/style.scss +0 -3
- package/src/components/block-editor/use-site-editor-settings.js +0 -2
- package/src/components/editor/index.js +0 -20
- package/src/components/global-styles/color-palette-panel.js +0 -1
- package/src/components/global-styles/font-families.js +1 -1
- package/src/components/global-styles/font-library-modal/collection-font-variant.js +5 -5
- package/src/components/global-styles/font-library-modal/context.js +136 -107
- package/src/components/global-styles/font-library-modal/font-card.js +11 -26
- package/src/components/global-styles/font-library-modal/font-collection.js +298 -218
- package/src/components/global-styles/font-library-modal/font-demo.js +38 -4
- package/src/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +9 -2
- package/src/components/global-styles/font-library-modal/index.js +23 -16
- package/src/components/global-styles/font-library-modal/installed-fonts.js +243 -114
- package/src/components/global-styles/font-library-modal/library-font-variant.js +5 -5
- package/src/components/global-styles/font-library-modal/style.scss +27 -11
- package/src/components/global-styles/font-library-modal/upload-fonts.js +70 -27
- package/src/components/global-styles/font-library-modal/utils/index.js +45 -5
- package/src/components/global-styles/font-library-modal/utils/preview-styles.js +6 -1
- package/src/components/global-styles/font-library-modal/utils/test/getDisplaySrcFromFontFace.spec.js +7 -18
- package/src/components/global-styles/gradients-palette-panel.js +2 -2
- package/src/components/global-styles/header.js +2 -2
- package/src/components/global-styles/highlighted-colors.js +39 -0
- package/src/components/global-styles/hooks.js +68 -1
- package/src/components/global-styles/preview-colors.js +61 -0
- package/src/components/global-styles/preview-iframe.js +152 -0
- package/src/components/global-styles/preview-styles.js +185 -0
- package/src/components/global-styles/screen-block-list.js +1 -1
- package/src/components/global-styles/screen-block.js +4 -1
- package/src/components/global-styles/screen-colors.js +3 -2
- package/src/components/global-styles/screen-revisions/index.js +5 -2
- package/src/components/global-styles/screen-root.js +2 -2
- package/src/components/global-styles/screen-typography.js +8 -2
- package/src/components/global-styles/style-variations-container.js +14 -92
- package/src/components/global-styles/style.scss +4 -35
- package/src/components/global-styles/{typogrphy-elements.js → typography-elements.js} +5 -1
- package/src/components/global-styles/typography-example.js +64 -0
- package/src/components/global-styles/typography-preview.js +3 -1
- package/src/components/global-styles/ui.js +26 -2
- package/src/components/global-styles/utils.js +37 -0
- package/src/components/global-styles/variations/style.scss +38 -0
- package/src/components/global-styles/variations/variation.js +93 -0
- package/src/components/global-styles/variations/variations-color.js +34 -0
- package/src/components/global-styles/{variations-panel.js → variations/variations-panel.js} +1 -1
- package/src/components/global-styles/variations/variations-typography.js +63 -0
- package/src/components/header-edit-mode/index.js +21 -27
- package/src/components/header-edit-mode/more-menu/index.js +17 -8
- package/src/components/header-edit-mode/style.scss +4 -0
- package/src/components/keyboard-shortcut-help-modal/config.js +4 -0
- package/src/components/keyboard-shortcuts/global.js +16 -4
- package/src/components/layout/index.js +5 -0
- package/src/components/layout/router.js +2 -7
- package/src/components/page-pages/index.js +8 -13
- package/src/components/page-patterns/delete-category-menu-item.js +7 -0
- package/src/components/page-patterns/index.js +23 -24
- package/src/components/page-patterns/use-patterns.js +17 -10
- package/src/components/{list/added-by.js → page-templates-template-parts/hooks.js} +1 -66
- package/src/components/page-templates-template-parts/index.js +34 -25
- package/src/components/page-templates-template-parts/style.scss +48 -0
- package/src/components/resizable-frame/index.js +1 -0
- package/src/components/revisions/index.js +1 -1
- package/src/components/save-panel/index.js +56 -27
- package/src/components/sidebar/index.js +3 -4
- package/src/components/sidebar-dataviews/custom-dataviews-list.js +2 -2
- package/src/components/sidebar-dataviews/dataview-item.js +2 -2
- package/src/components/sidebar-dataviews/default-views.js +14 -4
- package/src/components/sidebar-dataviews/index.js +4 -3
- package/src/components/sidebar-edit-mode/page-panels/index.js +2 -2
- package/src/components/sidebar-edit-mode/page-panels/page-status.js +1 -1
- package/src/components/sidebar-edit-mode/page-panels/page-summary.js +2 -0
- package/src/components/sidebar-edit-mode/sidebar-card/index.js +30 -11
- package/src/components/sidebar-edit-mode/sidebar-card/style.scss +10 -11
- package/src/components/sidebar-edit-mode/template-panel/index.js +25 -6
- package/src/components/sidebar-navigation-screen/style.scss +10 -1
- package/src/components/sidebar-navigation-screen-global-styles/index.js +35 -2
- package/src/components/sidebar-navigation-screen-main/index.js +0 -2
- package/src/components/sidebar-navigation-screen-navigation-menu/{delete-modal.js → delete-confirm-dialog.js} +3 -4
- package/src/components/sidebar-navigation-screen-navigation-menu/more-menu.js +11 -9
- package/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +0 -2
- package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +6 -3
- package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +1 -1
- package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +1 -1
- package/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js +1 -1
- package/src/components/sidebar-navigation-screen-template/index.js +7 -2
- package/src/components/sidebar-navigation-screen-templates-browse/content.js +5 -5
- package/src/components/sidebar-navigation-screen-templates-browse/index.js +5 -3
- package/src/components/start-template-options/index.js +1 -1
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +1 -1
- package/src/components/sync-state-with-url/use-sync-path-with-url.js +3 -19
- package/src/components/template-actions/index.js +63 -46
- package/src/components/welcome-guide/editor.js +9 -6
- package/src/hooks/use-theme-style-variations/test/use-theme-style-variations-by-property.js +173 -0
- package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +85 -1
- package/src/style.scss +2 -3
- package/src/utils/constants.js +4 -2
- package/src/utils/get-is-list-page.js +1 -1
- package/src/utils/math.js +93 -0
- package/build/components/global-styles/font-library-modal/collection-font-details.js +0 -50
- package/build/components/global-styles/font-library-modal/collection-font-details.js.map +0 -1
- package/build/components/global-styles/font-library-modal/confirm-delete-dialog.js +0 -30
- package/build/components/global-styles/font-library-modal/confirm-delete-dialog.js.map +0 -1
- package/build/components/global-styles/font-library-modal/library-font-card.js +0 -39
- package/build/components/global-styles/font-library-modal/library-font-card.js.map +0 -1
- package/build/components/global-styles/font-library-modal/tab-panel-layout.js +0 -67
- package/build/components/global-styles/font-library-modal/tab-panel-layout.js.map +0 -1
- package/build/components/global-styles/preview.js +0 -271
- package/build/components/global-styles/preview.js.map +0 -1
- package/build/components/global-styles/typogrphy-elements.js.map +0 -1
- package/build/components/global-styles/variations-panel.js.map +0 -1
- package/build/components/list/added-by.js.map +0 -1
- package/build/components/list/header.js +0 -55
- package/build/components/list/header.js.map +0 -1
- package/build/components/list/index.js +0 -80
- package/build/components/list/index.js.map +0 -1
- package/build/components/list/table.js +0 -94
- package/build/components/list/table.js.map +0 -1
- package/build/components/list/use-register-shortcuts.js +0 -51
- package/build/components/list/use-register-shortcuts.js.map +0 -1
- package/build/components/sidebar-edit-mode/template-panel/template-actions.js +0 -50
- package/build/components/sidebar-edit-mode/template-panel/template-actions.js.map +0 -1
- package/build/components/sidebar-navigation-screen-main/template-part-hint.js +0 -36
- package/build/components/sidebar-navigation-screen-main/template-part-hint.js.map +0 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +0 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js +0 -36
- package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +0 -1
- package/build/components/sidebar-navigation-screen-templates/index.js +0 -132
- package/build/components/sidebar-navigation-screen-templates/index.js.map +0 -1
- package/build-module/components/global-styles/font-library-modal/collection-font-details.js +0 -42
- package/build-module/components/global-styles/font-library-modal/collection-font-details.js.map +0 -1
- package/build-module/components/global-styles/font-library-modal/confirm-delete-dialog.js +0 -23
- package/build-module/components/global-styles/font-library-modal/confirm-delete-dialog.js.map +0 -1
- package/build-module/components/global-styles/font-library-modal/library-font-card.js +0 -31
- package/build-module/components/global-styles/font-library-modal/library-font-card.js.map +0 -1
- package/build-module/components/global-styles/font-library-modal/tab-panel-layout.js +0 -60
- package/build-module/components/global-styles/font-library-modal/tab-panel-layout.js.map +0 -1
- package/build-module/components/global-styles/preview.js +0 -264
- package/build-module/components/global-styles/preview.js.map +0 -1
- package/build-module/components/global-styles/typogrphy-elements.js.map +0 -1
- package/build-module/components/global-styles/variations-panel.js.map +0 -1
- package/build-module/components/list/added-by.js.map +0 -1
- package/build-module/components/list/header.js +0 -47
- package/build-module/components/list/header.js.map +0 -1
- package/build-module/components/list/index.js +0 -72
- package/build-module/components/list/index.js.map +0 -1
- package/build-module/components/list/table.js +0 -86
- package/build-module/components/list/table.js.map +0 -1
- package/build-module/components/list/use-register-shortcuts.js +0 -45
- package/build-module/components/list/use-register-shortcuts.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/template-panel/template-actions.js +0 -42
- package/build-module/components/sidebar-edit-mode/template-panel/template-actions.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-main/template-part-hint.js +0 -29
- package/build-module/components/sidebar-navigation-screen-main/template-part-hint.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js +0 -27
- package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-templates/index.js +0 -124
- package/build-module/components/sidebar-navigation-screen-templates/index.js.map +0 -1
- package/src/components/global-styles/font-library-modal/collection-font-details.js +0 -56
- package/src/components/global-styles/font-library-modal/confirm-delete-dialog.js +0 -33
- package/src/components/global-styles/font-library-modal/library-font-card.js +0 -34
- package/src/components/global-styles/font-library-modal/tab-panel-layout.js +0 -85
- package/src/components/global-styles/preview.js +0 -327
- package/src/components/list/header.js +0 -48
- package/src/components/list/index.js +0 -87
- package/src/components/list/style.scss +0 -188
- package/src/components/list/table.js +0 -140
- package/src/components/list/use-register-shortcuts.js +0 -49
- package/src/components/sidebar-edit-mode/template-panel/template-actions.js +0 -49
- package/src/components/sidebar-navigation-screen-main/template-part-hint.js +0 -34
- package/src/components/sidebar-navigation-screen-navigation-menu/edit-button.js +0 -22
- package/src/components/sidebar-navigation-screen-templates/index.js +0 -156
- package/src/components/sidebar-navigation-screen-templates/style.scss +0 -9
package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useMemo","mergeBaseAndUserConfigs","cloneDeep","
|
|
1
|
+
{"version":3,"names":["useSelect","store","coreStore","useContext","useMemo","privateApis","blockEditorPrivateApis","__","mergeBaseAndUserConfigs","cloneDeep","unlock","GlobalStylesContext","removePropertyFromObject","object","property","Object","keys","length","key","useCurrentMergeThemeStyleVariationsWithUserConfig","filter","variationsFromTheme","select","_variationsFromTheme","__experimentalGetCurrentThemeGlobalStylesVariations","user","baseVariation","variations","title","settings","styles","useThemeStyleVariationsByProperty","filterObjectByProperty","newObject","forEach","newFilter","clonedBaseVariation","processedStyleVariations","map","variation","result","description"],"sources":["@wordpress/edit-site/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.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';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { mergeBaseAndUserConfigs } from '../../components/global-styles/global-styles-provider';\nimport cloneDeep from '../../utils/clone-deep';\nimport { unlock } from '../../lock-unlock';\n\nconst { GlobalStylesContext } = unlock( blockEditorPrivateApis );\n\n/**\n * Removes all instances of a property from an object.\n *\n * @param {Object} object The object to remove the property from.\n * @param {string} property The property to remove.\n * @return {Object} The modified object.\n */\nexport function removePropertyFromObject( object, property ) {\n\tif ( ! property || typeof property !== 'string' ) {\n\t\treturn object;\n\t}\n\n\tif ( typeof object !== 'object' || ! Object.keys( object ).length ) {\n\t\treturn object;\n\t}\n\n\tfor ( const key in object ) {\n\t\tif ( key === property ) {\n\t\t\tdelete object[ key ];\n\t\t} else if ( typeof object[ key ] === 'object' ) {\n\t\t\tremovePropertyFromObject( object[ key ], property );\n\t\t}\n\t}\n\treturn object;\n}\n\n/**\n * A convenience wrapper for `useThemeStyleVariationsByProperty()` that fetches the current theme style variations,\n * and user-defined global style/settings object.\n *\n * @param {Object} props Object of hook args.\n * @param {string} props.property The property to filter by.\n * @param {Function} props.filter Optional. The filter function to apply to the variations.\n * @return {Object[]|*} The merged object.\n */\nexport function useCurrentMergeThemeStyleVariationsWithUserConfig( {\n\tproperty,\n\tfilter,\n} ) {\n\tconst { variationsFromTheme } = useSelect( ( select ) => {\n\t\tconst _variationsFromTheme =\n\t\t\tselect(\n\t\t\t\tcoreStore\n\t\t\t).__experimentalGetCurrentThemeGlobalStylesVariations();\n\n\t\treturn {\n\t\t\tvariationsFromTheme: _variationsFromTheme || [],\n\t\t};\n\t}, [] );\n\tconst { user: baseVariation } = useContext( GlobalStylesContext );\n\n\tconst variations = 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...variationsFromTheme,\n\t\t];\n\t}, [ variationsFromTheme ] );\n\n\treturn useThemeStyleVariationsByProperty( {\n\t\tvariations,\n\t\tproperty,\n\t\tfilter,\n\t\tbaseVariation: removePropertyFromObject(\n\t\t\tcloneDeep( baseVariation ),\n\t\t\tproperty\n\t\t),\n\t} );\n}\n\n/**\n * Returns a new object, with properties specified in `property`,\n * maintain the original object tree structure.\n * The function is recursive, so it will perform a deep search for the given property.\n * E.g., the function will return `{ a: { b: { c: { test: 1 } } } }` if the property is `test`.\n *\n * @param {Object} object The object to filter\n * @param {Object} property The property to filter by\n * @return {Object} The merged object.\n */\nexport const filterObjectByProperty = ( object, property ) => {\n\tif ( ! object ) {\n\t\treturn {};\n\t}\n\n\tconst newObject = {};\n\tObject.keys( object ).forEach( ( key ) => {\n\t\tif ( key === property ) {\n\t\t\tnewObject[ key ] = object[ key ];\n\t\t} else if ( typeof object[ key ] === 'object' ) {\n\t\t\tconst newFilter = filterObjectByProperty( object[ key ], property );\n\t\t\tif ( Object.keys( newFilter ).length ) {\n\t\t\t\tnewObject[ key ] = newFilter;\n\t\t\t}\n\t\t}\n\t} );\n\treturn newObject;\n};\n\n/**\n * Returns a new object with only the properties specified in `property`.\n * Optional merges the baseVariation object with the variation object.\n * Note: this function will only overwrite the specified property in baseVariation if it exists.\n * The baseVariation will not be otherwise modified. To strip a property from the baseVariation object, use `removePropertyFromObject`.\n * See useCurrentMergeThemeStyleVariationsWithUserConfig for an example of how to use this function.\n *\n * @param {Object} props Object of hook args.\n * @param {Object[]} props.variations The theme style variations to filter.\n * @param {string} props.property The property to filter by.\n * @param {Function} props.filter Optional. The filter function to apply to the variations.\n * @param {Object} props.baseVariation Optional. Base or user settings to be updated with variation properties.\n * @return {Object[]|*} The merged object.\n */\nexport default function useThemeStyleVariationsByProperty( {\n\tvariations,\n\tproperty,\n\tfilter,\n\tbaseVariation,\n} ) {\n\treturn useMemo( () => {\n\t\tif ( ! property || ! variations || variations?.length === 0 ) {\n\t\t\treturn variations;\n\t\t}\n\n\t\tconst clonedBaseVariation =\n\t\t\ttypeof baseVariation === 'object' &&\n\t\t\tObject.keys( baseVariation ).length > 0\n\t\t\t\t? cloneDeep( baseVariation )\n\t\t\t\t: null;\n\n\t\tlet processedStyleVariations = variations.map( ( variation ) => {\n\t\t\tlet result = {\n\t\t\t\t...filterObjectByProperty( cloneDeep( variation ), property ),\n\t\t\t\ttitle: variation?.title,\n\t\t\t\tdescription: variation?.description,\n\t\t\t};\n\n\t\t\tif ( clonedBaseVariation ) {\n\t\t\t\t/*\n\t\t\t\t * Overwrites all baseVariation object `styleProperty` properties\n\t\t\t\t * with the theme variation `styleProperty` properties.\n\t\t\t\t */\n\t\t\t\tresult = mergeBaseAndUserConfigs( clonedBaseVariation, result );\n\t\t\t}\n\t\t\treturn result;\n\t\t} );\n\n\t\tif ( 'function' === typeof filter ) {\n\t\t\tprocessedStyleVariations =\n\t\t\t\tprocessedStyleVariations.filter( filter );\n\t\t}\n\n\t\treturn processedStyleVariations;\n\t}, [ variations, property, baseVariation, filter ] );\n}\n"],"mappings":"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"}
|
|
@@ -45,6 +45,8 @@ export const LAYOUT_GRID = 'grid';
|
|
|
45
45
|
export const LAYOUT_TABLE = 'table';
|
|
46
46
|
export const LAYOUT_LIST = 'list';
|
|
47
47
|
export const ENUMERATION_TYPE = 'enumeration';
|
|
48
|
-
export const
|
|
49
|
-
export const
|
|
48
|
+
export const OPERATOR_IS = 'is';
|
|
49
|
+
export const OPERATOR_IS_NOT = 'isNot';
|
|
50
|
+
export const OPERATOR_IS_ANY = 'isAny';
|
|
51
|
+
export const OPERATOR_IS_NONE = 'isNone';
|
|
50
52
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","privateApis","patternPrivateApis","unlock","NAVIGATION_POST_TYPE","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","TEMPLATE_ORIGINS","custom","theme","plugin","TEMPLATE_PART_AREA_DEFAULT_CATEGORY","PATTERN_TYPES","PATTERN_DEFAULT_CATEGORY","PATTERN_USER_CATEGORY","EXCLUDED_PATTERN_SOURCES","PATTERN_SYNC_TYPES","FOCUSABLE_ENTITIES","user","POST_TYPE_LABELS","LAYOUT_GRID","LAYOUT_TABLE","LAYOUT_LIST","ENUMERATION_TYPE","
|
|
1
|
+
{"version":3,"names":["__","privateApis","patternPrivateApis","unlock","NAVIGATION_POST_TYPE","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","TEMPLATE_ORIGINS","custom","theme","plugin","TEMPLATE_PART_AREA_DEFAULT_CATEGORY","PATTERN_TYPES","PATTERN_DEFAULT_CATEGORY","PATTERN_USER_CATEGORY","EXCLUDED_PATTERN_SOURCES","PATTERN_SYNC_TYPES","FOCUSABLE_ENTITIES","user","POST_TYPE_LABELS","LAYOUT_GRID","LAYOUT_TABLE","LAYOUT_LIST","ENUMERATION_TYPE","OPERATOR_IS","OPERATOR_IS_NOT","OPERATOR_IS_ANY","OPERATOR_IS_NONE"],"sources":["@wordpress/edit-site/src/utils/constants.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as patternPrivateApis } from '@wordpress/patterns';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\n\n// Navigation\nexport const NAVIGATION_POST_TYPE = 'wp_navigation';\n\n// Templates.\nexport const TEMPLATE_POST_TYPE = 'wp_template';\nexport const TEMPLATE_PART_POST_TYPE = 'wp_template_part';\nexport const TEMPLATE_ORIGINS = {\n\tcustom: 'custom',\n\ttheme: 'theme',\n\tplugin: 'plugin',\n};\nexport const TEMPLATE_PART_AREA_DEFAULT_CATEGORY = 'uncategorized';\n\n// Patterns.\nexport const {\n\tPATTERN_TYPES,\n\tPATTERN_DEFAULT_CATEGORY,\n\tPATTERN_USER_CATEGORY,\n\tEXCLUDED_PATTERN_SOURCES,\n\tPATTERN_SYNC_TYPES,\n} = unlock( patternPrivateApis );\n\n// Entities that are editable in focus mode.\nexport const FOCUSABLE_ENTITIES = [\n\tTEMPLATE_PART_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n\tPATTERN_TYPES.user,\n];\n\nexport const POST_TYPE_LABELS = {\n\t[ TEMPLATE_POST_TYPE ]: __( 'Template' ),\n\t[ TEMPLATE_PART_POST_TYPE ]: __( 'Template part' ),\n\t[ PATTERN_TYPES.user ]: __( 'Pattern' ),\n\t[ NAVIGATION_POST_TYPE ]: __( 'Navigation' ),\n};\n\n// DataViews constants\nexport const LAYOUT_GRID = 'grid';\nexport const LAYOUT_TABLE = 'table';\nexport const LAYOUT_LIST = 'list';\nexport const ENUMERATION_TYPE = 'enumeration';\nexport const OPERATOR_IS = 'is';\nexport const OPERATOR_IS_NOT = 'isNot';\nexport const OPERATOR_IS_ANY = 'isAny';\nexport const OPERATOR_IS_NONE = 'isNone';\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,IAAIC,kBAAkB,QAAQ,qBAAqB;;AAEvE;AACA;AACA;AACA,SAASC,MAAM,QAAQ,gBAAgB;;AAEvC;AACA,OAAO,MAAMC,oBAAoB,GAAG,eAAe;;AAEnD;AACA,OAAO,MAAMC,kBAAkB,GAAG,aAAa;AAC/C,OAAO,MAAMC,uBAAuB,GAAG,kBAAkB;AACzD,OAAO,MAAMC,gBAAgB,GAAG;EAC/BC,MAAM,EAAE,QAAQ;EAChBC,KAAK,EAAE,OAAO;EACdC,MAAM,EAAE;AACT,CAAC;AACD,OAAO,MAAMC,mCAAmC,GAAG,eAAe;;AAElE;AACA,OAAO,MAAM;EACZC,aAAa;EACbC,wBAAwB;EACxBC,qBAAqB;EACrBC,wBAAwB;EACxBC;AACD,CAAC,GAAGb,MAAM,CAAED,kBAAmB,CAAC;;AAEhC;AACA,OAAO,MAAMe,kBAAkB,GAAG,CACjCX,uBAAuB,EACvBF,oBAAoB,EACpBQ,aAAa,CAACM,IAAI,CAClB;AAED,OAAO,MAAMC,gBAAgB,GAAG;EAC/B,CAAEd,kBAAkB,GAAIL,EAAE,CAAE,UAAW,CAAC;EACxC,CAAEM,uBAAuB,GAAIN,EAAE,CAAE,eAAgB,CAAC;EAClD,CAAEY,aAAa,CAACM,IAAI,GAAIlB,EAAE,CAAE,SAAU,CAAC;EACvC,CAAEI,oBAAoB,GAAIJ,EAAE,CAAE,YAAa;AAC5C,CAAC;;AAED;AACA,OAAO,MAAMoB,WAAW,GAAG,MAAM;AACjC,OAAO,MAAMC,YAAY,GAAG,OAAO;AACnC,OAAO,MAAMC,WAAW,GAAG,MAAM;AACjC,OAAO,MAAMC,gBAAgB,GAAG,aAAa;AAC7C,OAAO,MAAMC,WAAW,GAAG,IAAI;AAC/B,OAAO,MAAMC,eAAe,GAAG,OAAO;AACtC,OAAO,MAAMC,eAAe,GAAG,OAAO;AACtC,OAAO,MAAMC,gBAAgB,GAAG,QAAQ"}
|
|
@@ -14,7 +14,7 @@ export default function getIsListPage({
|
|
|
14
14
|
categoryType,
|
|
15
15
|
categoryId
|
|
16
16
|
}, isMobileViewport) {
|
|
17
|
-
return ['/wp_template
|
|
17
|
+
return ['/wp_template', '/wp_template_part/all', '/pages'].includes(path) || path === '/patterns' && (
|
|
18
18
|
// Don't treat "/patterns" without categoryType and categoryId as a
|
|
19
19
|
// list page in mobile because the sidebar covers the whole page.
|
|
20
20
|
!isMobileViewport || !!categoryType && !!categoryId);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getIsListPage","path","categoryType","categoryId","isMobileViewport","includes"],"sources":["@wordpress/edit-site/src/utils/get-is-list-page.js"],"sourcesContent":["/**\n * Returns if the params match the list page route.\n *\n * @param {Object} params The url params.\n * @param {string} params.path The current path.\n * @param {string} [params.categoryType] The current category type.\n * @param {string} [params.categoryId] The current category id.\n * @param {boolean} isMobileViewport Is mobile viewport.\n *\n * @return {boolean} Is list page or not.\n */\nexport default function getIsListPage(\n\t{ path, categoryType, categoryId },\n\tisMobileViewport\n) {\n\treturn (\n\t\t[ '/wp_template
|
|
1
|
+
{"version":3,"names":["getIsListPage","path","categoryType","categoryId","isMobileViewport","includes"],"sources":["@wordpress/edit-site/src/utils/get-is-list-page.js"],"sourcesContent":["/**\n * Returns if the params match the list page route.\n *\n * @param {Object} params The url params.\n * @param {string} params.path The current path.\n * @param {string} [params.categoryType] The current category type.\n * @param {string} [params.categoryId] The current category id.\n * @param {boolean} isMobileViewport Is mobile viewport.\n *\n * @return {boolean} Is list page or not.\n */\nexport default function getIsListPage(\n\t{ path, categoryType, categoryId },\n\tisMobileViewport\n) {\n\treturn (\n\t\t[ '/wp_template', '/wp_template_part/all', '/pages' ].includes(\n\t\t\tpath\n\t\t) ||\n\t\t( path === '/patterns' &&\n\t\t\t// Don't treat \"/patterns\" without categoryType and categoryId as a\n\t\t\t// list page in mobile because the sidebar covers the whole page.\n\t\t\t( ! isMobileViewport || ( !! categoryType && !! categoryId ) ) )\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASA,aAAaA,CACpC;EAAEC,IAAI;EAAEC,YAAY;EAAEC;AAAW,CAAC,EAClCC,gBAAgB,EACf;EACD,OACC,CAAE,cAAc,EAAE,uBAAuB,EAAE,QAAQ,CAAE,CAACC,QAAQ,CAC7DJ,IACD,CAAC,IACCA,IAAI,KAAK,WAAW;EACrB;EACA;EACE,CAAEG,gBAAgB,IAAM,CAAC,CAAEF,YAAY,IAAI,CAAC,CAAEC,UAAY,CAAI;AAEnE"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {Object} WPPoint
|
|
3
|
+
* @property {number} x The horizontal coordinate.
|
|
4
|
+
* @property {number} y The vertical coordinate.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Clamps a value to a range. Uses the CSS `clamp()` ordering for arguments.
|
|
9
|
+
*
|
|
10
|
+
* @param {number} min Minimum range.
|
|
11
|
+
* @param {number} value Value to clamp.
|
|
12
|
+
* @param {number} max Maximum range.
|
|
13
|
+
*
|
|
14
|
+
* @return {number} Clamped value.
|
|
15
|
+
*/
|
|
16
|
+
function clamp(min, value, max) {
|
|
17
|
+
return Math.max(min, Math.min(value, max));
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Evaluates a linear function passing through two points at the given x value.
|
|
22
|
+
*
|
|
23
|
+
* Example:
|
|
24
|
+
* f(x)
|
|
25
|
+
* │ ╲
|
|
26
|
+
* │ * (p0)
|
|
27
|
+
* │ ╲
|
|
28
|
+
* │ ╲
|
|
29
|
+
* │ (p1) *
|
|
30
|
+
* │ ╲
|
|
31
|
+
* └──────────── x
|
|
32
|
+
*
|
|
33
|
+
* @param {WPPoint} p0 First point.
|
|
34
|
+
* @param {WPPoint} p1 Second point.
|
|
35
|
+
* @param {number} x Value to evaluate at.
|
|
36
|
+
*
|
|
37
|
+
* @return {number} Result of the two-point linear function at x.
|
|
38
|
+
*/
|
|
39
|
+
function twoPointLinearFn(p0, p1, x) {
|
|
40
|
+
return (p1.y - p0.y) / (p1.x - p0.x) * (x - p0.x) + p0.y;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Evaluates a two-point linear function at a given x value, clamped to the range of the points.
|
|
45
|
+
*
|
|
46
|
+
* Example:
|
|
47
|
+
* f(x)
|
|
48
|
+
* │ ───* (p0)
|
|
49
|
+
* │ ╲
|
|
50
|
+
* │ ╲
|
|
51
|
+
* │ (p1) *───
|
|
52
|
+
* └──────────── x
|
|
53
|
+
*
|
|
54
|
+
* @param {WPPoint} p0 First point.
|
|
55
|
+
* @param {WPPoint} p1 Second point.
|
|
56
|
+
* @param {number} x Value to evaluate at.
|
|
57
|
+
*
|
|
58
|
+
* @return {number} Result of the two-point linear function clamped to the range of the points.
|
|
59
|
+
*/
|
|
60
|
+
function clampedTwoPointLinearFn(p0, p1, x) {
|
|
61
|
+
return clamp(Math.min(p0.y, p1.y), twoPointLinearFn(p0, p1, x), Math.max(p0.y, p1.y));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Computes the iframe scale using a start and end width/scale pair and the current width.
|
|
66
|
+
*
|
|
67
|
+
* The scale is clamped outside the points and is linearly interpolated between.
|
|
68
|
+
*
|
|
69
|
+
* Example:
|
|
70
|
+
* scale
|
|
71
|
+
* │ ───* (start)
|
|
72
|
+
* │ ╲
|
|
73
|
+
* │ ╲
|
|
74
|
+
* │ (end) *───
|
|
75
|
+
* └──────────── width
|
|
76
|
+
*
|
|
77
|
+
* @param {Object} start First width and scale pair.
|
|
78
|
+
* @param {Object} end Second width and scale pair.
|
|
79
|
+
* @param {number} currentWidth Current width.
|
|
80
|
+
*
|
|
81
|
+
* @return {number} The scale of the current width between the two points.
|
|
82
|
+
*/
|
|
83
|
+
export function computeIFrameScale(start, end, currentWidth) {
|
|
84
|
+
return clampedTwoPointLinearFn({
|
|
85
|
+
x: start.width,
|
|
86
|
+
y: start.scale
|
|
87
|
+
}, {
|
|
88
|
+
x: end.width,
|
|
89
|
+
y: end.scale
|
|
90
|
+
}, currentWidth);
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=math.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["clamp","min","value","max","Math","twoPointLinearFn","p0","p1","x","y","clampedTwoPointLinearFn","computeIFrameScale","start","end","currentWidth","width","scale"],"sources":["@wordpress/edit-site/src/utils/math.js"],"sourcesContent":["/**\n * @typedef {Object} WPPoint\n * @property {number} x The horizontal coordinate.\n * @property {number} y The vertical coordinate.\n */\n\n/**\n * Clamps a value to a range. Uses the CSS `clamp()` ordering for arguments.\n *\n * @param {number} min Minimum range.\n * @param {number} value Value to clamp.\n * @param {number} max Maximum range.\n *\n * @return {number} Clamped value.\n */\nfunction clamp( min, value, max ) {\n\treturn Math.max( min, Math.min( value, max ) );\n}\n\n/**\n * Evaluates a linear function passing through two points at the given x value.\n *\n * Example:\n * f(x)\n * │ ╲\n * │ * (p0)\n * │ ╲\n * │ ╲\n * │ (p1) *\n * │ ╲\n * └──────────── x\n *\n * @param {WPPoint} p0 First point.\n * @param {WPPoint} p1 Second point.\n * @param {number} x Value to evaluate at.\n *\n * @return {number} Result of the two-point linear function at x.\n */\nfunction twoPointLinearFn( p0, p1, x ) {\n\treturn ( ( p1.y - p0.y ) / ( p1.x - p0.x ) ) * ( x - p0.x ) + p0.y;\n}\n\n/**\n * Evaluates a two-point linear function at a given x value, clamped to the range of the points.\n *\n * Example:\n * f(x)\n * │ ───* (p0)\n * │ ╲\n * │ ╲\n * │ (p1) *───\n * └──────────── x\n *\n * @param {WPPoint} p0 First point.\n * @param {WPPoint} p1 Second point.\n * @param {number} x Value to evaluate at.\n *\n * @return {number} Result of the two-point linear function clamped to the range of the points.\n */\nfunction clampedTwoPointLinearFn( p0, p1, x ) {\n\treturn clamp(\n\t\tMath.min( p0.y, p1.y ),\n\t\ttwoPointLinearFn( p0, p1, x ),\n\t\tMath.max( p0.y, p1.y )\n\t);\n}\n\n/**\n * Computes the iframe scale using a start and end width/scale pair and the current width.\n *\n * The scale is clamped outside the points and is linearly interpolated between.\n *\n * Example:\n * scale\n * │ ───* (start)\n * │ ╲\n * │ ╲\n * │ (end) *───\n * └──────────── width\n *\n * @param {Object} start First width and scale pair.\n * @param {Object} end Second width and scale pair.\n * @param {number} currentWidth Current width.\n *\n * @return {number} The scale of the current width between the two points.\n */\nexport function computeIFrameScale( start, end, currentWidth ) {\n\treturn clampedTwoPointLinearFn(\n\t\t{ x: start.width, y: start.scale },\n\t\t{ x: end.width, y: end.scale },\n\t\tcurrentWidth\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,KAAKA,CAAEC,GAAG,EAAEC,KAAK,EAAEC,GAAG,EAAG;EACjC,OAAOC,IAAI,CAACD,GAAG,CAAEF,GAAG,EAAEG,IAAI,CAACH,GAAG,CAAEC,KAAK,EAAEC,GAAI,CAAE,CAAC;AAC/C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASE,gBAAgBA,CAAEC,EAAE,EAAEC,EAAE,EAAEC,CAAC,EAAG;EACtC,OAAS,CAAED,EAAE,CAACE,CAAC,GAAGH,EAAE,CAACG,CAAC,KAAOF,EAAE,CAACC,CAAC,GAAGF,EAAE,CAACE,CAAC,CAAE,IAAOA,CAAC,GAAGF,EAAE,CAACE,CAAC,CAAE,GAAGF,EAAE,CAACG,CAAC;AACnE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,uBAAuBA,CAAEJ,EAAE,EAAEC,EAAE,EAAEC,CAAC,EAAG;EAC7C,OAAOR,KAAK,CACXI,IAAI,CAACH,GAAG,CAAEK,EAAE,CAACG,CAAC,EAAEF,EAAE,CAACE,CAAE,CAAC,EACtBJ,gBAAgB,CAAEC,EAAE,EAAEC,EAAE,EAAEC,CAAE,CAAC,EAC7BJ,IAAI,CAACD,GAAG,CAAEG,EAAE,CAACG,CAAC,EAAEF,EAAE,CAACE,CAAE,CACtB,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,kBAAkBA,CAAEC,KAAK,EAAEC,GAAG,EAAEC,YAAY,EAAG;EAC9D,OAAOJ,uBAAuB,CAC7B;IAAEF,CAAC,EAAEI,KAAK,CAACG,KAAK;IAAEN,CAAC,EAAEG,KAAK,CAACI;EAAM,CAAC,EAClC;IAAER,CAAC,EAAEK,GAAG,CAACE,KAAK;IAAEN,CAAC,EAAEI,GAAG,CAACG;EAAM,CAAC,EAC9BF,YACD,CAAC;AACF"}
|