@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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/edit-site",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.31.0",
|
|
4
4
|
"description": "Edit Site Page module for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -27,46 +27,46 @@
|
|
|
27
27
|
"react-native": "src/index",
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@babel/runtime": "^7.16.0",
|
|
30
|
-
"@wordpress/a11y": "^3.
|
|
31
|
-
"@wordpress/api-fetch": "^6.
|
|
32
|
-
"@wordpress/blob": "^3.
|
|
33
|
-
"@wordpress/block-editor": "^12.
|
|
34
|
-
"@wordpress/block-library": "^8.
|
|
35
|
-
"@wordpress/blocks": "^12.
|
|
36
|
-
"@wordpress/commands": "^0.
|
|
37
|
-
"@wordpress/components": "^27.
|
|
38
|
-
"@wordpress/compose": "^6.
|
|
39
|
-
"@wordpress/core-commands": "^0.
|
|
40
|
-
"@wordpress/core-data": "^6.
|
|
41
|
-
"@wordpress/data": "^9.
|
|
42
|
-
"@wordpress/dataviews": "^0.
|
|
43
|
-
"@wordpress/date": "^4.
|
|
44
|
-
"@wordpress/deprecated": "^3.
|
|
45
|
-
"@wordpress/dom": "^3.
|
|
46
|
-
"@wordpress/editor": "^13.
|
|
47
|
-
"@wordpress/element": "^5.
|
|
48
|
-
"@wordpress/escape-html": "^2.
|
|
49
|
-
"@wordpress/hooks": "^3.
|
|
50
|
-
"@wordpress/html-entities": "^3.
|
|
51
|
-
"@wordpress/i18n": "^4.
|
|
52
|
-
"@wordpress/icons": "^9.
|
|
53
|
-
"@wordpress/interface": "^5.
|
|
54
|
-
"@wordpress/keyboard-shortcuts": "^4.
|
|
55
|
-
"@wordpress/keycodes": "^3.
|
|
56
|
-
"@wordpress/media-utils": "^4.
|
|
57
|
-
"@wordpress/notices": "^4.
|
|
58
|
-
"@wordpress/patterns": "^1.
|
|
59
|
-
"@wordpress/plugins": "^6.
|
|
60
|
-
"@wordpress/preferences": "^3.
|
|
61
|
-
"@wordpress/primitives": "^3.
|
|
62
|
-
"@wordpress/private-apis": "^0.
|
|
63
|
-
"@wordpress/reusable-blocks": "^4.
|
|
64
|
-
"@wordpress/router": "^0.
|
|
65
|
-
"@wordpress/style-engine": "^1.
|
|
66
|
-
"@wordpress/url": "^3.
|
|
67
|
-
"@wordpress/viewport": "^5.
|
|
68
|
-
"@wordpress/widgets": "^3.
|
|
69
|
-
"@wordpress/wordcount": "^3.
|
|
30
|
+
"@wordpress/a11y": "^3.54.0",
|
|
31
|
+
"@wordpress/api-fetch": "^6.51.0",
|
|
32
|
+
"@wordpress/blob": "^3.54.0",
|
|
33
|
+
"@wordpress/block-editor": "^12.22.0",
|
|
34
|
+
"@wordpress/block-library": "^8.31.0",
|
|
35
|
+
"@wordpress/blocks": "^12.31.0",
|
|
36
|
+
"@wordpress/commands": "^0.25.0",
|
|
37
|
+
"@wordpress/components": "^27.2.0",
|
|
38
|
+
"@wordpress/compose": "^6.31.0",
|
|
39
|
+
"@wordpress/core-commands": "^0.23.0",
|
|
40
|
+
"@wordpress/core-data": "^6.31.0",
|
|
41
|
+
"@wordpress/data": "^9.24.0",
|
|
42
|
+
"@wordpress/dataviews": "^0.8.0",
|
|
43
|
+
"@wordpress/date": "^4.54.0",
|
|
44
|
+
"@wordpress/deprecated": "^3.54.0",
|
|
45
|
+
"@wordpress/dom": "^3.54.0",
|
|
46
|
+
"@wordpress/editor": "^13.31.0",
|
|
47
|
+
"@wordpress/element": "^5.31.0",
|
|
48
|
+
"@wordpress/escape-html": "^2.54.0",
|
|
49
|
+
"@wordpress/hooks": "^3.54.0",
|
|
50
|
+
"@wordpress/html-entities": "^3.54.0",
|
|
51
|
+
"@wordpress/i18n": "^4.54.0",
|
|
52
|
+
"@wordpress/icons": "^9.45.0",
|
|
53
|
+
"@wordpress/interface": "^5.31.0",
|
|
54
|
+
"@wordpress/keyboard-shortcuts": "^4.31.0",
|
|
55
|
+
"@wordpress/keycodes": "^3.54.0",
|
|
56
|
+
"@wordpress/media-utils": "^4.45.0",
|
|
57
|
+
"@wordpress/notices": "^4.22.0",
|
|
58
|
+
"@wordpress/patterns": "^1.15.0",
|
|
59
|
+
"@wordpress/plugins": "^6.22.0",
|
|
60
|
+
"@wordpress/preferences": "^3.31.0",
|
|
61
|
+
"@wordpress/primitives": "^3.52.0",
|
|
62
|
+
"@wordpress/private-apis": "^0.36.0",
|
|
63
|
+
"@wordpress/reusable-blocks": "^4.31.0",
|
|
64
|
+
"@wordpress/router": "^0.23.0",
|
|
65
|
+
"@wordpress/style-engine": "^1.37.0",
|
|
66
|
+
"@wordpress/url": "^3.55.0",
|
|
67
|
+
"@wordpress/viewport": "^5.31.0",
|
|
68
|
+
"@wordpress/widgets": "^3.31.0",
|
|
69
|
+
"@wordpress/wordcount": "^3.54.0",
|
|
70
70
|
"change-case": "^4.1.2",
|
|
71
71
|
"classnames": "^2.3.1",
|
|
72
72
|
"client-zip": "^2.4.4",
|
|
@@ -86,5 +86,5 @@
|
|
|
86
86
|
"publishConfig": {
|
|
87
87
|
"access": "public"
|
|
88
88
|
},
|
|
89
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "ffc07735d0abfb3f69e91d48f25b7fe8d1ef92d2"
|
|
90
90
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { external,
|
|
4
|
+
import { external, edit, backup } from '@wordpress/icons';
|
|
5
5
|
import { addQueryArgs } from '@wordpress/url';
|
|
6
6
|
import { useDispatch } from '@wordpress/data';
|
|
7
7
|
import { decodeEntities } from '@wordpress/html-entities';
|
|
@@ -27,8 +27,6 @@ const { useHistory } = unlock( routerPrivateApis );
|
|
|
27
27
|
export const trashPostAction = {
|
|
28
28
|
id: 'move-to-trash',
|
|
29
29
|
label: __( 'Move to Trash' ),
|
|
30
|
-
isPrimary: true,
|
|
31
|
-
icon: trash,
|
|
32
30
|
isEligible( { status } ) {
|
|
33
31
|
return status !== 'trash';
|
|
34
32
|
},
|
|
@@ -172,8 +170,6 @@ export function usePermanentlyDeletePostAction() {
|
|
|
172
170
|
() => ( {
|
|
173
171
|
id: 'permanently-delete',
|
|
174
172
|
label: __( 'Permanently delete' ),
|
|
175
|
-
isPrimary: true,
|
|
176
|
-
icon: trash,
|
|
177
173
|
supportsBulk: true,
|
|
178
174
|
isEligible( { status } ) {
|
|
179
175
|
return status === 'trash';
|
|
@@ -362,7 +358,7 @@ export const viewPostAction = {
|
|
|
362
358
|
},
|
|
363
359
|
callback( posts ) {
|
|
364
360
|
const post = posts[ 0 ];
|
|
365
|
-
|
|
361
|
+
window.open( post.link, '_blank' );
|
|
366
362
|
},
|
|
367
363
|
};
|
|
368
364
|
|
|
@@ -372,6 +368,8 @@ export function useEditPostAction() {
|
|
|
372
368
|
() => ( {
|
|
373
369
|
id: 'edit-post',
|
|
374
370
|
label: __( 'Edit' ),
|
|
371
|
+
isPrimary: true,
|
|
372
|
+
icon: edit,
|
|
375
373
|
isEligible( { status } ) {
|
|
376
374
|
return status !== 'trash';
|
|
377
375
|
},
|
|
@@ -22,6 +22,7 @@ import {
|
|
|
22
22
|
FOCUSABLE_ENTITIES,
|
|
23
23
|
NAVIGATION_POST_TYPE,
|
|
24
24
|
} from '../../utils/constants';
|
|
25
|
+
import { computeIFrameScale } from '../../utils/math';
|
|
25
26
|
|
|
26
27
|
const { EditorCanvas: EditorCanvasRoot } = unlock( editorPrivateApis );
|
|
27
28
|
|
|
@@ -52,8 +53,11 @@ function EditorCanvas( { enableResizing, settings, children, ...props } ) {
|
|
|
52
53
|
}
|
|
53
54
|
}, [ canvasMode ] );
|
|
54
55
|
|
|
55
|
-
|
|
56
|
-
|
|
56
|
+
// In view mode, make the canvas iframe be perceived and behave as a button
|
|
57
|
+
// to switch to edit mode, with a meaningful label and no title attribute.
|
|
58
|
+
const viewModeIframeProps = {
|
|
59
|
+
'aria-label': __( 'Edit' ),
|
|
60
|
+
title: null,
|
|
57
61
|
role: 'button',
|
|
58
62
|
tabIndex: 0,
|
|
59
63
|
onFocus: () => setIsFocused( true ),
|
|
@@ -99,6 +103,17 @@ function EditorCanvas( { enableResizing, settings, children, ...props } ) {
|
|
|
99
103
|
[ settings.styles, enableResizing, canvasMode ]
|
|
100
104
|
);
|
|
101
105
|
|
|
106
|
+
const frameSize = isZoomOutMode ? 20 : undefined;
|
|
107
|
+
|
|
108
|
+
const scale = isZoomOutMode
|
|
109
|
+
? ( contentWidth ) =>
|
|
110
|
+
computeIFrameScale(
|
|
111
|
+
{ width: 1000, scale: 0.45 },
|
|
112
|
+
{ width: 400, scale: 0.9 },
|
|
113
|
+
contentWidth
|
|
114
|
+
)
|
|
115
|
+
: undefined;
|
|
116
|
+
|
|
102
117
|
return (
|
|
103
118
|
<EditorCanvasRoot
|
|
104
119
|
className={ classnames( 'edit-site-editor-canvas__block-list', {
|
|
@@ -107,9 +122,8 @@ function EditorCanvas( { enableResizing, settings, children, ...props } ) {
|
|
|
107
122
|
renderAppender={ showBlockAppender }
|
|
108
123
|
styles={ styles }
|
|
109
124
|
iframeProps={ {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
frameSize: isZoomOutMode ? 100 : undefined,
|
|
125
|
+
scale,
|
|
126
|
+
frameSize,
|
|
113
127
|
className: classnames(
|
|
114
128
|
'edit-site-visual-editor__editor-canvas',
|
|
115
129
|
{
|
|
@@ -117,7 +131,7 @@ function EditorCanvas( { enableResizing, settings, children, ...props } ) {
|
|
|
117
131
|
}
|
|
118
132
|
),
|
|
119
133
|
...props,
|
|
120
|
-
...( canvasMode === 'view' ?
|
|
134
|
+
...( canvasMode === 'view' ? viewModeIframeProps : {} ),
|
|
121
135
|
} }
|
|
122
136
|
>
|
|
123
137
|
{ children }
|
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
position: relative;
|
|
23
23
|
height: 100%;
|
|
24
24
|
display: block;
|
|
25
|
-
overflow: hidden;
|
|
26
25
|
background-color: $gray-300;
|
|
27
26
|
// Centralize the editor horizontally (flex-direction is column).
|
|
28
27
|
align-items: center;
|
|
@@ -62,8 +61,6 @@
|
|
|
62
61
|
|
|
63
62
|
.components-resizable-box__container {
|
|
64
63
|
margin: 0 auto;
|
|
65
|
-
// Removing this will cancel the bottom margins in the iframe.
|
|
66
|
-
overflow: auto;
|
|
67
64
|
}
|
|
68
65
|
|
|
69
66
|
&.is-view-mode {
|
|
@@ -101,8 +101,6 @@ function useNavigateToPreviousEntityRecord() {
|
|
|
101
101
|
( location.params.postId &&
|
|
102
102
|
FOCUSABLE_ENTITIES.includes( location.params.postType ) );
|
|
103
103
|
const didComeFromEditorCanvas =
|
|
104
|
-
previousLocation?.params.postId &&
|
|
105
|
-
previousLocation?.params.postType &&
|
|
106
104
|
previousLocation?.params.canvas === 'edit';
|
|
107
105
|
const showBackButton = isFocusMode && didComeFromEditorCanvas;
|
|
108
106
|
return showBackButton ? () => history.back() : undefined;
|
|
@@ -14,7 +14,6 @@ import {
|
|
|
14
14
|
BlockBreadcrumb,
|
|
15
15
|
BlockToolbar,
|
|
16
16
|
store as blockEditorStore,
|
|
17
|
-
privateApis as blockEditorPrivateApis,
|
|
18
17
|
BlockInspector,
|
|
19
18
|
} from '@wordpress/block-editor';
|
|
20
19
|
import {
|
|
@@ -56,7 +55,6 @@ import SiteEditorCanvas from '../block-editor/site-editor-canvas';
|
|
|
56
55
|
import TemplatePartConverter from '../template-part-converter';
|
|
57
56
|
import { useSpecificEditorSettings } from '../block-editor/use-site-editor-settings';
|
|
58
57
|
|
|
59
|
-
const { BlockRemovalWarningModal } = unlock( blockEditorPrivateApis );
|
|
60
58
|
const {
|
|
61
59
|
ExperimentalEditorProvider: EditorProvider,
|
|
62
60
|
InserterSidebar,
|
|
@@ -74,21 +72,6 @@ const interfaceLabels = {
|
|
|
74
72
|
footer: __( 'Editor footer' ),
|
|
75
73
|
};
|
|
76
74
|
|
|
77
|
-
// Prevent accidental removal of certain blocks, asking the user for
|
|
78
|
-
// confirmation.
|
|
79
|
-
const blockRemovalRules = {
|
|
80
|
-
'core/query': __( 'Query Loop displays a list of posts or pages.' ),
|
|
81
|
-
'core/post-content': __(
|
|
82
|
-
'Post Content displays the content of a post or page.'
|
|
83
|
-
),
|
|
84
|
-
'core/post-template': __(
|
|
85
|
-
'Post Template displays each post or page in a Query Loop.'
|
|
86
|
-
),
|
|
87
|
-
'bindings/core/pattern-overrides': __(
|
|
88
|
-
'Blocks from synced patterns that can have overriden content.'
|
|
89
|
-
),
|
|
90
|
-
};
|
|
91
|
-
|
|
92
75
|
export default function Editor( { isLoading } ) {
|
|
93
76
|
const {
|
|
94
77
|
record: editedPost,
|
|
@@ -243,9 +226,6 @@ export default function Editor( { isLoading } ) {
|
|
|
243
226
|
<BlockToolbar hideDragHandle />
|
|
244
227
|
) }
|
|
245
228
|
<SiteEditorCanvas />
|
|
246
|
-
<BlockRemovalWarningModal
|
|
247
|
-
rules={ blockRemovalRules }
|
|
248
|
-
/>
|
|
249
229
|
<PatternModal />
|
|
250
230
|
</>
|
|
251
231
|
) }
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
* Internal dependencies
|
|
12
12
|
*/
|
|
13
13
|
import { getFontFaceVariantName } from './utils';
|
|
14
|
-
import
|
|
14
|
+
import FontDemo from './font-demo';
|
|
15
15
|
import { unlock } from '../../../lock-unlock';
|
|
16
16
|
|
|
17
17
|
function CollectionFontVariant( {
|
|
@@ -35,17 +35,17 @@ function CollectionFontVariant( {
|
|
|
35
35
|
);
|
|
36
36
|
|
|
37
37
|
return (
|
|
38
|
-
<div className="font-library-
|
|
38
|
+
<div className="font-library-modal__font-card">
|
|
39
39
|
<Flex justify="flex-start" align="center" gap="1rem">
|
|
40
40
|
<CheckboxControl
|
|
41
41
|
checked={ selected }
|
|
42
42
|
onChange={ handleToggleActivation }
|
|
43
|
-
__nextHasNoMarginBottom
|
|
43
|
+
__nextHasNoMarginBottom
|
|
44
44
|
id={ checkboxId }
|
|
45
45
|
/>
|
|
46
46
|
<label htmlFor={ checkboxId }>
|
|
47
|
-
<
|
|
48
|
-
|
|
47
|
+
<FontDemo
|
|
48
|
+
font={ face }
|
|
49
49
|
text={ displayName }
|
|
50
50
|
onClick={ handleToggleActivation }
|
|
51
51
|
/>
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
useEntityRecords,
|
|
10
10
|
store as coreStore,
|
|
11
11
|
} from '@wordpress/core-data';
|
|
12
|
-
import { __
|
|
12
|
+
import { __ } from '@wordpress/i18n';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Internal dependencies
|
|
@@ -27,6 +27,7 @@ import {
|
|
|
27
27
|
setUIValuesNeeded,
|
|
28
28
|
mergeFontFamilies,
|
|
29
29
|
loadFontFaceInBrowser,
|
|
30
|
+
unloadFontFaceInBrowser,
|
|
30
31
|
getDisplaySrcFromFontFace,
|
|
31
32
|
makeFontFacesFormData,
|
|
32
33
|
makeFontFamilyFormData,
|
|
@@ -162,16 +163,6 @@ function FontLibraryProvider( { children } ) {
|
|
|
162
163
|
// Demo
|
|
163
164
|
const [ loadedFontUrls ] = useState( new Set() );
|
|
164
165
|
|
|
165
|
-
// Theme data
|
|
166
|
-
const { site, currentTheme } = useSelect( ( select ) => {
|
|
167
|
-
return {
|
|
168
|
-
site: select( coreStore ).getSite(),
|
|
169
|
-
currentTheme: select( coreStore ).getCurrentTheme(),
|
|
170
|
-
};
|
|
171
|
-
} );
|
|
172
|
-
const themeUrl =
|
|
173
|
-
site?.url + '/wp-content/themes/' + currentTheme?.stylesheet;
|
|
174
|
-
|
|
175
166
|
const getAvailableFontsOutline = ( availableFontFamilies ) => {
|
|
176
167
|
const outline = availableFontFamilies.reduce( ( acc, font ) => {
|
|
177
168
|
const availableFontFaces =
|
|
@@ -210,115 +201,134 @@ function FontLibraryProvider( { children } ) {
|
|
|
210
201
|
return getActivatedFontsOutline( source )[ slug ] || [];
|
|
211
202
|
};
|
|
212
203
|
|
|
213
|
-
async function
|
|
204
|
+
async function installFonts( fontFamiliesToInstall ) {
|
|
214
205
|
setIsInstalling( true );
|
|
215
206
|
try {
|
|
216
|
-
|
|
217
|
-
let
|
|
218
|
-
|
|
219
|
-
)
|
|
207
|
+
const fontFamiliesToActivate = [];
|
|
208
|
+
let installationErrors = [];
|
|
209
|
+
|
|
210
|
+
for ( const fontFamilyToInstall of fontFamiliesToInstall ) {
|
|
211
|
+
let isANewFontFamily = false;
|
|
220
212
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
installedFontFamily = await fetchInstallFontFamily(
|
|
225
|
-
makeFontFamilyFormData( fontFamilyToInstall )
|
|
213
|
+
// Get the font family if it already exists.
|
|
214
|
+
let installedFontFamily = await fetchGetFontFamilyBySlug(
|
|
215
|
+
fontFamilyToInstall.slug
|
|
226
216
|
);
|
|
227
|
-
}
|
|
228
217
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
218
|
+
// Otherwise create it.
|
|
219
|
+
if ( ! installedFontFamily ) {
|
|
220
|
+
isANewFontFamily = true;
|
|
221
|
+
// Prepare font family form data to install.
|
|
222
|
+
installedFontFamily = await fetchInstallFontFamily(
|
|
223
|
+
makeFontFamilyFormData( fontFamilyToInstall )
|
|
224
|
+
);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// Collect font faces that have already been installed (to be activated later)
|
|
228
|
+
const alreadyInstalledFontFaces =
|
|
229
|
+
installedFontFamily.fontFace && fontFamilyToInstall.fontFace
|
|
230
|
+
? installedFontFamily.fontFace.filter(
|
|
231
|
+
( fontFaceToInstall ) =>
|
|
232
|
+
checkFontFaceInstalled(
|
|
233
|
+
fontFaceToInstall,
|
|
234
|
+
fontFamilyToInstall.fontFace
|
|
235
|
+
)
|
|
236
|
+
)
|
|
237
|
+
: [];
|
|
238
|
+
|
|
239
|
+
// Filter out Font Faces that have already been installed (so that they are not re-installed)
|
|
240
|
+
if (
|
|
241
|
+
installedFontFamily.fontFace &&
|
|
242
|
+
fontFamilyToInstall.fontFace
|
|
243
|
+
) {
|
|
244
|
+
fontFamilyToInstall.fontFace =
|
|
245
|
+
fontFamilyToInstall.fontFace.filter(
|
|
233
246
|
( fontFaceToInstall ) =>
|
|
234
|
-
checkFontFaceInstalled(
|
|
247
|
+
! checkFontFaceInstalled(
|
|
235
248
|
fontFaceToInstall,
|
|
236
|
-
|
|
249
|
+
installedFontFamily.fontFace
|
|
237
250
|
)
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
fontFamilyToInstall
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
( fontFaceToInstall ) =>
|
|
249
|
-
! checkFontFaceInstalled(
|
|
250
|
-
fontFaceToInstall,
|
|
251
|
-
installedFontFamily.fontFace
|
|
252
|
-
)
|
|
251
|
+
);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
// Install the fonts (upload the font files to the server and create the post in the database).
|
|
255
|
+
let sucessfullyInstalledFontFaces = [];
|
|
256
|
+
let unsucessfullyInstalledFontFaces = [];
|
|
257
|
+
if ( fontFamilyToInstall?.fontFace?.length > 0 ) {
|
|
258
|
+
const response = await batchInstallFontFaces(
|
|
259
|
+
installedFontFamily.id,
|
|
260
|
+
makeFontFacesFormData( fontFamilyToInstall )
|
|
253
261
|
);
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
262
|
+
sucessfullyInstalledFontFaces = response?.successes;
|
|
263
|
+
unsucessfullyInstalledFontFaces = response?.errors;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
// Use the sucessfully installed font faces
|
|
267
|
+
// As well as any font faces that were already installed (those will be activated)
|
|
268
|
+
if (
|
|
269
|
+
sucessfullyInstalledFontFaces?.length > 0 ||
|
|
270
|
+
alreadyInstalledFontFaces?.length > 0
|
|
271
|
+
) {
|
|
272
|
+
fontFamilyToInstall.fontFace = [
|
|
273
|
+
...sucessfullyInstalledFontFaces,
|
|
274
|
+
...alreadyInstalledFontFaces,
|
|
275
|
+
];
|
|
276
|
+
fontFamiliesToActivate.push( fontFamilyToInstall );
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
// If it's a system font but was installed successfully, activate it.
|
|
280
|
+
if (
|
|
281
|
+
installedFontFamily &&
|
|
282
|
+
! fontFamilyToInstall?.fontFace?.length
|
|
283
|
+
) {
|
|
284
|
+
fontFamiliesToActivate.push( installedFontFamily );
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
// If the font family is new and is not a system font, delete it to avoid having font families without font faces.
|
|
288
|
+
if (
|
|
289
|
+
isANewFontFamily &&
|
|
290
|
+
fontFamilyToInstall?.fontFace?.length > 0 &&
|
|
291
|
+
sucessfullyInstalledFontFaces?.length === 0
|
|
292
|
+
) {
|
|
293
|
+
await fetchUninstallFontFamily( installedFontFamily.id );
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
installationErrors = installationErrors.concat(
|
|
297
|
+
unsucessfullyInstalledFontFaces
|
|
263
298
|
);
|
|
264
|
-
sucessfullyInstalledFontFaces = response?.successes;
|
|
265
|
-
unsucessfullyInstalledFontFaces = response?.errors;
|
|
266
299
|
}
|
|
267
300
|
|
|
268
|
-
|
|
269
|
-
(
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
301
|
+
installationErrors = installationErrors.reduce(
|
|
302
|
+
( unique, item ) =>
|
|
303
|
+
unique.includes( item.message )
|
|
304
|
+
? unique
|
|
305
|
+
: [ ...unique, item.message ],
|
|
306
|
+
[]
|
|
273
307
|
);
|
|
274
308
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
detailedErrorMessage
|
|
286
|
-
)
|
|
309
|
+
if ( fontFamiliesToActivate.length > 0 ) {
|
|
310
|
+
// Activate the font family (add the font family to the global styles).
|
|
311
|
+
activateCustomFontFamilies( fontFamiliesToActivate );
|
|
312
|
+
|
|
313
|
+
// Save the global styles to the database.
|
|
314
|
+
await saveSpecifiedEntityEdits(
|
|
315
|
+
'root',
|
|
316
|
+
'globalStyles',
|
|
317
|
+
globalStylesId,
|
|
318
|
+
[ 'settings.typography.fontFamilies' ]
|
|
287
319
|
);
|
|
288
|
-
}
|
|
289
320
|
|
|
290
|
-
|
|
291
|
-
// As well as any font faces that were already installed (those will be activated)
|
|
292
|
-
if (
|
|
293
|
-
sucessfullyInstalledFontFaces?.length > 0 ||
|
|
294
|
-
alreadyInstalledFontFaces?.length > 0
|
|
295
|
-
) {
|
|
296
|
-
fontFamilyToInstall.fontFace = [
|
|
297
|
-
...sucessfullyInstalledFontFaces,
|
|
298
|
-
...alreadyInstalledFontFaces,
|
|
299
|
-
];
|
|
321
|
+
refreshLibrary();
|
|
300
322
|
}
|
|
301
323
|
|
|
302
|
-
|
|
303
|
-
|
|
324
|
+
if ( installationErrors.length > 0 ) {
|
|
325
|
+
const installError = new Error(
|
|
326
|
+
__( 'There was an error installing fonts.' )
|
|
327
|
+
);
|
|
304
328
|
|
|
305
|
-
|
|
306
|
-
saveSpecifiedEntityEdits( 'root', 'globalStyles', globalStylesId, [
|
|
307
|
-
'settings.typography.fontFamilies',
|
|
308
|
-
] );
|
|
329
|
+
installError.installationErrors = installationErrors;
|
|
309
330
|
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
if ( unsucessfullyInstalledFontFaces.length > 0 ) {
|
|
313
|
-
throw new Error(
|
|
314
|
-
sprintf(
|
|
315
|
-
/* translators: %s: Specific error message returned from server. */
|
|
316
|
-
__(
|
|
317
|
-
'Some font faces were installed. There were some errors. %s'
|
|
318
|
-
),
|
|
319
|
-
detailedErrorMessage
|
|
320
|
-
)
|
|
321
|
-
);
|
|
331
|
+
throw installError;
|
|
322
332
|
}
|
|
323
333
|
} finally {
|
|
324
334
|
setIsInstalling( false );
|
|
@@ -371,18 +381,20 @@ function FontLibraryProvider( { children } ) {
|
|
|
371
381
|
...fontFamilies,
|
|
372
382
|
[ font.source ]: newCustomFonts,
|
|
373
383
|
} );
|
|
384
|
+
|
|
385
|
+
if ( font.fontFace ) {
|
|
386
|
+
font.fontFace.forEach( ( face ) => {
|
|
387
|
+
unloadFontFaceInBrowser( face, 'all' );
|
|
388
|
+
} );
|
|
389
|
+
}
|
|
374
390
|
};
|
|
375
391
|
|
|
376
392
|
const activateCustomFontFamilies = ( fontsToAdd ) => {
|
|
377
393
|
// Merge the existing custom fonts with the new fonts.
|
|
378
|
-
const newCustomFonts = mergeFontFamilies(
|
|
379
|
-
fontFamilies?.custom,
|
|
380
|
-
fontsToAdd
|
|
381
|
-
);
|
|
382
394
|
// Activate the fonts by set the new custom fonts array.
|
|
383
395
|
setFontFamilies( {
|
|
384
396
|
...fontFamilies,
|
|
385
|
-
custom:
|
|
397
|
+
custom: mergeFontFamilies( fontFamilies?.custom, fontsToAdd ),
|
|
386
398
|
} );
|
|
387
399
|
// Add custom fonts to the browser.
|
|
388
400
|
fontsToAdd.forEach( ( font ) => {
|
|
@@ -410,13 +422,30 @@ function FontLibraryProvider( { children } ) {
|
|
|
410
422
|
...fontFamilies,
|
|
411
423
|
[ font.source ]: newFonts,
|
|
412
424
|
} );
|
|
425
|
+
|
|
426
|
+
const isFaceActivated = isFontActivated(
|
|
427
|
+
font.slug,
|
|
428
|
+
face?.fontStyle,
|
|
429
|
+
face?.fontWeight,
|
|
430
|
+
font.source
|
|
431
|
+
);
|
|
432
|
+
|
|
433
|
+
if ( isFaceActivated ) {
|
|
434
|
+
loadFontFaceInBrowser(
|
|
435
|
+
face,
|
|
436
|
+
getDisplaySrcFromFontFace( face?.src ),
|
|
437
|
+
'all'
|
|
438
|
+
);
|
|
439
|
+
} else {
|
|
440
|
+
unloadFontFaceInBrowser( face, 'all' );
|
|
441
|
+
}
|
|
413
442
|
};
|
|
414
443
|
|
|
415
444
|
const loadFontFaceAsset = async ( fontFace ) => {
|
|
416
445
|
// If the font doesn't have a src, don't load it.
|
|
417
446
|
if ( ! fontFace.src ) return;
|
|
418
447
|
// Get the src of the font.
|
|
419
|
-
const src = getDisplaySrcFromFontFace( fontFace.src
|
|
448
|
+
const src = getDisplaySrcFromFontFace( fontFace.src );
|
|
420
449
|
// If the font is already loaded, don't load it again.
|
|
421
450
|
if ( ! src || loadedFontUrls.has( src ) ) return;
|
|
422
451
|
// Load the font in the browser.
|
|
@@ -467,7 +496,7 @@ function FontLibraryProvider( { children } ) {
|
|
|
467
496
|
isFontActivated,
|
|
468
497
|
getFontFacesActivated,
|
|
469
498
|
loadFontFaceAsset,
|
|
470
|
-
|
|
499
|
+
installFonts,
|
|
471
500
|
uninstallFontFamily,
|
|
472
501
|
toggleActivateFont,
|
|
473
502
|
getAvailableFontsOutline,
|