@wordpress/edit-site 5.29.0 → 5.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/components/actions/index.js +1 -1
- package/build/components/actions/index.js.map +1 -1
- package/build/components/block-editor/editor-canvas.js +10 -11
- package/build/components/block-editor/editor-canvas.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 +9 -0
- 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 +62 -58
- 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 +118 -76
- 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/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 +8 -14
- 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 +38 -4
- 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 +1 -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 +1 -1
- 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/preview-colors.js +62 -0
- package/build/components/global-styles/preview-colors.js.map +1 -0
- package/build/components/global-styles/preview-iframe.js +131 -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/preview-typography.js +65 -0
- package/build/components/global-styles/preview-typography.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 +10 -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 +10 -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} +1 -1
- package/build/components/global-styles/typography-elements.js.map +1 -0
- 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 +36 -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 +64 -0
- package/build/components/global-styles/variations/variations-typography.js.map +1 -0
- package/build/components/header-edit-mode/index.js +12 -11
- 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/layout/index.js +4 -1
- package/build/components/layout/index.js.map +1 -1
- package/build/components/page-patterns/index.js +14 -14
- package/build/components/page-patterns/index.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 +14 -6
- 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 +18 -3
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/sidebar/index.js +1 -1
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-dataviews/default-views.js +2 -0
- package/build/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-panel/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.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-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 +2 -2
- package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/content.js +4 -4
- 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/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +65 -0
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
- package/build-module/components/actions/index.js +1 -1
- package/build-module/components/actions/index.js.map +1 -1
- package/build-module/components/block-editor/editor-canvas.js +10 -11
- package/build-module/components/block-editor/editor-canvas.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 +8 -0
- 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 +63 -59
- 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 +121 -79
- 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/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 +9 -15
- 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 +37 -4
- 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 +1 -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 +1 -1
- 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/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 +124 -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/preview-typography.js +58 -0
- package/build-module/components/global-styles/preview-typography.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 +10 -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 +10 -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} +1 -1
- package/build-module/components/global-styles/typography-elements.js.map +1 -0
- 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 +28 -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 +56 -0
- package/build-module/components/global-styles/variations/variations-typography.js.map +1 -0
- package/build-module/components/header-edit-mode/index.js +13 -12
- 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/layout/index.js +4 -1
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/page-patterns/index.js +14 -14
- package/build-module/components/page-patterns/index.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 +13 -5
- 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 +18 -3
- package/build-module/components/save-panel/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +1 -1
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-dataviews/default-views.js +3 -1
- package/build-module/components/sidebar-dataviews/default-views.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/template-panel/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.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-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 +1 -1
- package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +3 -3
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +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/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +63 -1
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
- package/build-style/style-rtl.css +163 -286
- package/build-style/style.css +163 -286
- package/package.json +42 -42
- package/src/components/actions/index.js +1 -1
- package/src/components/block-editor/editor-canvas.js +13 -12
- package/src/components/block-editor/style.scss +0 -3
- package/src/components/editor/index.js +0 -20
- package/src/components/global-styles/color-palette-panel.js +11 -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 +116 -104
- package/src/components/global-styles/font-library-modal/font-card.js +11 -26
- package/src/components/global-styles/font-library-modal/font-collection.js +297 -218
- package/src/components/global-styles/font-library-modal/font-demo.js +38 -4
- 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 +15 -8
- package/src/components/global-styles/font-library-modal/upload-fonts.js +17 -19
- package/src/components/global-styles/font-library-modal/utils/index.js +44 -4
- package/src/components/global-styles/font-library-modal/utils/preview-styles.js +2 -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 +1 -1
- package/src/components/global-styles/highlighted-colors.js +39 -0
- package/src/components/global-styles/preview-colors.js +61 -0
- package/src/components/global-styles/preview-iframe.js +153 -0
- package/src/components/global-styles/preview-styles.js +185 -0
- package/src/components/global-styles/preview-typography.js +62 -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 +13 -1
- 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 +19 -2
- package/src/components/global-styles/style-variations-container.js +14 -92
- package/src/components/global-styles/style.scss +0 -34
- 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 +44 -0
- package/src/components/global-styles/variations/variation.js +93 -0
- package/src/components/global-styles/variations/variations-color.js +30 -0
- package/src/components/global-styles/{variations-panel.js → variations/variations-panel.js} +1 -1
- package/src/components/global-styles/variations/variations-typography.js +85 -0
- package/src/components/header-edit-mode/index.js +20 -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/layout/index.js +5 -0
- package/src/components/page-patterns/index.js +21 -21
- package/src/components/{list/added-by.js → page-templates-template-parts/hooks.js} +1 -66
- package/src/components/page-templates-template-parts/index.js +20 -3
- 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 +34 -12
- package/src/components/sidebar/index.js +1 -1
- package/src/components/sidebar-dataviews/default-views.js +3 -1
- package/src/components/sidebar-edit-mode/page-panels/page-status.js +1 -1
- package/src/components/sidebar-edit-mode/template-panel/index.js +1 -1
- package/src/components/sidebar-navigation-screen-main/index.js +0 -2
- package/src/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +1 -1
- package/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +0 -2
- 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 +1 -1
- package/src/components/sidebar-navigation-screen-templates-browse/content.js +3 -3
- package/src/components/sidebar-navigation-screen-templates-browse/index.js +5 -3
- package/src/components/start-template-options/index.js +1 -1
- 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 +68 -1
- package/src/style.scss +2 -2
- 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-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/edit-button.js +0 -36
- package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.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-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/edit-button.js +0 -27
- package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.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-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/global-styles/{typogrphy-elements.js → typography-elements.js} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/edit-site",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.30.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.53.0",
|
|
31
|
+
"@wordpress/api-fetch": "^6.50.0",
|
|
32
|
+
"@wordpress/blob": "^3.53.0",
|
|
33
|
+
"@wordpress/block-editor": "^12.21.0",
|
|
34
|
+
"@wordpress/block-library": "^8.30.0",
|
|
35
|
+
"@wordpress/blocks": "^12.30.0",
|
|
36
|
+
"@wordpress/commands": "^0.24.0",
|
|
37
|
+
"@wordpress/components": "^27.1.0",
|
|
38
|
+
"@wordpress/compose": "^6.30.0",
|
|
39
|
+
"@wordpress/core-commands": "^0.22.0",
|
|
40
|
+
"@wordpress/core-data": "^6.30.0",
|
|
41
|
+
"@wordpress/data": "^9.23.0",
|
|
42
|
+
"@wordpress/dataviews": "^0.7.0",
|
|
43
|
+
"@wordpress/date": "^4.53.0",
|
|
44
|
+
"@wordpress/deprecated": "^3.53.0",
|
|
45
|
+
"@wordpress/dom": "^3.53.0",
|
|
46
|
+
"@wordpress/editor": "^13.30.0",
|
|
47
|
+
"@wordpress/element": "^5.30.0",
|
|
48
|
+
"@wordpress/escape-html": "^2.53.0",
|
|
49
|
+
"@wordpress/hooks": "^3.53.0",
|
|
50
|
+
"@wordpress/html-entities": "^3.53.0",
|
|
51
|
+
"@wordpress/i18n": "^4.53.0",
|
|
52
|
+
"@wordpress/icons": "^9.44.0",
|
|
53
|
+
"@wordpress/interface": "^5.30.0",
|
|
54
|
+
"@wordpress/keyboard-shortcuts": "^4.30.0",
|
|
55
|
+
"@wordpress/keycodes": "^3.53.0",
|
|
56
|
+
"@wordpress/media-utils": "^4.44.0",
|
|
57
|
+
"@wordpress/notices": "^4.21.0",
|
|
58
|
+
"@wordpress/patterns": "^1.14.0",
|
|
59
|
+
"@wordpress/plugins": "^6.21.0",
|
|
60
|
+
"@wordpress/preferences": "^3.30.0",
|
|
61
|
+
"@wordpress/primitives": "^3.51.0",
|
|
62
|
+
"@wordpress/private-apis": "^0.35.0",
|
|
63
|
+
"@wordpress/reusable-blocks": "^4.30.0",
|
|
64
|
+
"@wordpress/router": "^0.22.0",
|
|
65
|
+
"@wordpress/style-engine": "^1.36.0",
|
|
66
|
+
"@wordpress/url": "^3.54.0",
|
|
67
|
+
"@wordpress/viewport": "^5.30.0",
|
|
68
|
+
"@wordpress/widgets": "^3.30.0",
|
|
69
|
+
"@wordpress/wordcount": "^3.53.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": "ac3c3e465a083081a86a4da6ee6fb817b41e5130"
|
|
90
90
|
}
|
|
@@ -26,10 +26,9 @@ import {
|
|
|
26
26
|
const { EditorCanvas: EditorCanvasRoot } = unlock( editorPrivateApis );
|
|
27
27
|
|
|
28
28
|
function EditorCanvas( { enableResizing, settings, children, ...props } ) {
|
|
29
|
-
const { hasBlocks, isFocusMode, templateType, canvasMode
|
|
30
|
-
|
|
31
|
-
const { getBlockCount
|
|
32
|
-
select( blockEditorStore );
|
|
29
|
+
const { hasBlocks, isFocusMode, templateType, canvasMode } = useSelect(
|
|
30
|
+
( select ) => {
|
|
31
|
+
const { getBlockCount } = select( blockEditorStore );
|
|
33
32
|
const { getEditedPostType, getCanvasMode } = unlock(
|
|
34
33
|
select( editSiteStore )
|
|
35
34
|
);
|
|
@@ -38,11 +37,12 @@ function EditorCanvas( { enableResizing, settings, children, ...props } ) {
|
|
|
38
37
|
return {
|
|
39
38
|
templateType: _templateType,
|
|
40
39
|
isFocusMode: FOCUSABLE_ENTITIES.includes( _templateType ),
|
|
41
|
-
isZoomOutMode: __unstableGetEditorMode() === 'zoom-out',
|
|
42
40
|
canvasMode: getCanvasMode(),
|
|
43
41
|
hasBlocks: !! getBlockCount(),
|
|
44
42
|
};
|
|
45
|
-
},
|
|
43
|
+
},
|
|
44
|
+
[]
|
|
45
|
+
);
|
|
46
46
|
const { setCanvasMode } = unlock( useDispatch( editSiteStore ) );
|
|
47
47
|
const [ isFocused, setIsFocused ] = useState( false );
|
|
48
48
|
|
|
@@ -52,8 +52,11 @@ function EditorCanvas( { enableResizing, settings, children, ...props } ) {
|
|
|
52
52
|
}
|
|
53
53
|
}, [ canvasMode ] );
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
// In view mode, make the canvas iframe be perceived and behave as a button
|
|
56
|
+
// to switch to edit mode, with a meaningful label and no title attribute.
|
|
57
|
+
const viewModeIframeProps = {
|
|
58
|
+
'aria-label': __( 'Edit' ),
|
|
59
|
+
title: null,
|
|
57
60
|
role: 'button',
|
|
58
61
|
tabIndex: 0,
|
|
59
62
|
onFocus: () => setIsFocused( true ),
|
|
@@ -107,9 +110,7 @@ function EditorCanvas( { enableResizing, settings, children, ...props } ) {
|
|
|
107
110
|
renderAppender={ showBlockAppender }
|
|
108
111
|
styles={ styles }
|
|
109
112
|
iframeProps={ {
|
|
110
|
-
|
|
111
|
-
scale: isZoomOutMode ? 0.45 : undefined,
|
|
112
|
-
frameSize: isZoomOutMode ? 100 : undefined,
|
|
113
|
+
shouldZoom: true,
|
|
113
114
|
className: classnames(
|
|
114
115
|
'edit-site-visual-editor__editor-canvas',
|
|
115
116
|
{
|
|
@@ -117,7 +118,7 @@ function EditorCanvas( { enableResizing, settings, children, ...props } ) {
|
|
|
117
118
|
}
|
|
118
119
|
),
|
|
119
120
|
...props,
|
|
120
|
-
...( canvasMode === 'view' ?
|
|
121
|
+
...( canvasMode === 'view' ? viewModeIframeProps : {} ),
|
|
121
122
|
} }
|
|
122
123
|
>
|
|
123
124
|
{ 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 {
|
|
@@ -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
|
) }
|
|
@@ -13,6 +13,8 @@ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
|
13
13
|
* Internal dependencies
|
|
14
14
|
*/
|
|
15
15
|
import { unlock } from '../../lock-unlock';
|
|
16
|
+
import ColorVariations from './variations/variations-color';
|
|
17
|
+
import { useCurrentMergeThemeStyleVariationsWithUserConfig } from '../../hooks/use-theme-style-variations/use-theme-style-variations-by-property';
|
|
16
18
|
|
|
17
19
|
const { useGlobalSetting } = unlock( blockEditorPrivateApis );
|
|
18
20
|
const mobilePopoverProps = { placement: 'bottom-start', offset: 8 };
|
|
@@ -45,7 +47,12 @@ export default function ColorPalettePanel( { name } ) {
|
|
|
45
47
|
'color.defaultPalette',
|
|
46
48
|
name
|
|
47
49
|
);
|
|
48
|
-
|
|
50
|
+
const colorVariations = useCurrentMergeThemeStyleVariationsWithUserConfig( {
|
|
51
|
+
property: 'color',
|
|
52
|
+
filter: ( variation ) =>
|
|
53
|
+
variation?.settings?.color &&
|
|
54
|
+
Object.keys( variation?.settings?.color ).length,
|
|
55
|
+
} );
|
|
49
56
|
const isMobileViewport = useViewportMatch( 'small', '<' );
|
|
50
57
|
const popoverProps = isMobileViewport ? mobilePopoverProps : undefined;
|
|
51
58
|
|
|
@@ -78,6 +85,9 @@ export default function ColorPalettePanel( { name } ) {
|
|
|
78
85
|
popoverProps={ popoverProps }
|
|
79
86
|
/>
|
|
80
87
|
) }
|
|
88
|
+
{ !! colorVariations.length && (
|
|
89
|
+
<ColorVariations variations={ colorVariations } />
|
|
90
|
+
) }
|
|
81
91
|
<PaletteEdit
|
|
82
92
|
colors={ customColors }
|
|
83
93
|
onChange={ setCustomColors }
|
|
@@ -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
|
/>
|
|
@@ -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,113 +201,115 @@ 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
|
-
fontFamilyToInstall.slug
|
|
219
|
-
);
|
|
207
|
+
const fontFamiliesToActivate = [];
|
|
208
|
+
let installationErrors = [];
|
|
220
209
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
210
|
+
for ( const fontFamilyToInstall of fontFamiliesToInstall ) {
|
|
211
|
+
let isANewFontFamily = false;
|
|
212
|
+
|
|
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
|
+
} else if ( isANewFontFamily ) {
|
|
278
|
+
// If the font family is new, delete it to avoid having font families without font faces.
|
|
279
|
+
await fetchUninstallFontFamily( installedFontFamily.id );
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
installationErrors = installationErrors.concat(
|
|
283
|
+
unsucessfullyInstalledFontFaces
|
|
263
284
|
);
|
|
264
|
-
sucessfullyInstalledFontFaces = response?.successes;
|
|
265
|
-
unsucessfullyInstalledFontFaces = response?.errors;
|
|
266
285
|
}
|
|
267
286
|
|
|
268
|
-
|
|
269
|
-
(
|
|
270
|
-
|
|
271
|
-
},
|
|
272
|
-
''
|
|
273
|
-
);
|
|
287
|
+
if ( fontFamiliesToActivate.length > 0 ) {
|
|
288
|
+
// Activate the font family (add the font family to the global styles).
|
|
289
|
+
activateCustomFontFamilies( fontFamiliesToActivate );
|
|
274
290
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
throw new Error(
|
|
282
|
-
sprintf(
|
|
283
|
-
/* translators: %s: Specific error message returned from server. */
|
|
284
|
-
__( 'No font faces were installed. %s' ),
|
|
285
|
-
detailedErrorMessage
|
|
286
|
-
)
|
|
291
|
+
// Save the global styles to the database.
|
|
292
|
+
await saveSpecifiedEntityEdits(
|
|
293
|
+
'root',
|
|
294
|
+
'globalStyles',
|
|
295
|
+
globalStylesId,
|
|
296
|
+
[ 'settings.typography.fontFamilies' ]
|
|
287
297
|
);
|
|
288
|
-
}
|
|
289
298
|
|
|
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
|
-
];
|
|
299
|
+
refreshLibrary();
|
|
300
300
|
}
|
|
301
301
|
|
|
302
|
-
|
|
303
|
-
activateCustomFontFamilies( [ fontFamilyToInstall ] );
|
|
304
|
-
|
|
305
|
-
// Save the global styles to the database.
|
|
306
|
-
saveSpecifiedEntityEdits( 'root', 'globalStyles', globalStylesId, [
|
|
307
|
-
'settings.typography.fontFamilies',
|
|
308
|
-
] );
|
|
309
|
-
|
|
310
|
-
refreshLibrary();
|
|
311
|
-
|
|
312
|
-
if ( unsucessfullyInstalledFontFaces.length > 0 ) {
|
|
302
|
+
if ( installationErrors.length > 0 ) {
|
|
313
303
|
throw new Error(
|
|
314
304
|
sprintf(
|
|
315
305
|
/* translators: %s: Specific error message returned from server. */
|
|
316
|
-
__(
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
306
|
+
__( 'There were some errors installing fonts. %s' ),
|
|
307
|
+
installationErrors.reduce(
|
|
308
|
+
( errorMessageCollection, error ) => {
|
|
309
|
+
return `${ errorMessageCollection } ${ error.message }`;
|
|
310
|
+
},
|
|
311
|
+
''
|
|
312
|
+
)
|
|
320
313
|
)
|
|
321
314
|
);
|
|
322
315
|
}
|
|
@@ -371,18 +364,20 @@ function FontLibraryProvider( { children } ) {
|
|
|
371
364
|
...fontFamilies,
|
|
372
365
|
[ font.source ]: newCustomFonts,
|
|
373
366
|
} );
|
|
367
|
+
|
|
368
|
+
if ( font.fontFace ) {
|
|
369
|
+
font.fontFace.forEach( ( face ) => {
|
|
370
|
+
unloadFontFaceInBrowser( face, 'all' );
|
|
371
|
+
} );
|
|
372
|
+
}
|
|
374
373
|
};
|
|
375
374
|
|
|
376
375
|
const activateCustomFontFamilies = ( fontsToAdd ) => {
|
|
377
376
|
// Merge the existing custom fonts with the new fonts.
|
|
378
|
-
const newCustomFonts = mergeFontFamilies(
|
|
379
|
-
fontFamilies?.custom,
|
|
380
|
-
fontsToAdd
|
|
381
|
-
);
|
|
382
377
|
// Activate the fonts by set the new custom fonts array.
|
|
383
378
|
setFontFamilies( {
|
|
384
379
|
...fontFamilies,
|
|
385
|
-
custom:
|
|
380
|
+
custom: mergeFontFamilies( fontFamilies?.custom, fontsToAdd ),
|
|
386
381
|
} );
|
|
387
382
|
// Add custom fonts to the browser.
|
|
388
383
|
fontsToAdd.forEach( ( font ) => {
|
|
@@ -410,13 +405,30 @@ function FontLibraryProvider( { children } ) {
|
|
|
410
405
|
...fontFamilies,
|
|
411
406
|
[ font.source ]: newFonts,
|
|
412
407
|
} );
|
|
408
|
+
|
|
409
|
+
const isFaceActivated = isFontActivated(
|
|
410
|
+
font.slug,
|
|
411
|
+
face.fontStyle,
|
|
412
|
+
face.fontWeight,
|
|
413
|
+
font.source
|
|
414
|
+
);
|
|
415
|
+
|
|
416
|
+
if ( isFaceActivated ) {
|
|
417
|
+
loadFontFaceInBrowser(
|
|
418
|
+
face,
|
|
419
|
+
getDisplaySrcFromFontFace( face.src ),
|
|
420
|
+
'all'
|
|
421
|
+
);
|
|
422
|
+
} else {
|
|
423
|
+
unloadFontFaceInBrowser( face, 'all' );
|
|
424
|
+
}
|
|
413
425
|
};
|
|
414
426
|
|
|
415
427
|
const loadFontFaceAsset = async ( fontFace ) => {
|
|
416
428
|
// If the font doesn't have a src, don't load it.
|
|
417
429
|
if ( ! fontFace.src ) return;
|
|
418
430
|
// Get the src of the font.
|
|
419
|
-
const src = getDisplaySrcFromFontFace( fontFace.src
|
|
431
|
+
const src = getDisplaySrcFromFontFace( fontFace.src );
|
|
420
432
|
// If the font is already loaded, don't load it again.
|
|
421
433
|
if ( ! src || loadedFontUrls.has( src ) ) return;
|
|
422
434
|
// Load the font in the browser.
|
|
@@ -467,7 +479,7 @@ function FontLibraryProvider( { children } ) {
|
|
|
467
479
|
isFontActivated,
|
|
468
480
|
getFontFacesActivated,
|
|
469
481
|
loadFontFaceAsset,
|
|
470
|
-
|
|
482
|
+
installFonts,
|
|
471
483
|
uninstallFontFamily,
|
|
472
484
|
toggleActivateFont,
|
|
473
485
|
getAvailableFontsOutline,
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { _n, sprintf } from '@wordpress/i18n';
|
|
5
5
|
import {
|
|
6
|
+
__experimentalUseNavigator as useNavigator,
|
|
6
7
|
__experimentalText as Text,
|
|
7
8
|
Button,
|
|
8
9
|
Flex,
|
|
@@ -14,46 +15,30 @@ import {
|
|
|
14
15
|
* Internal dependencies
|
|
15
16
|
*/
|
|
16
17
|
import FontDemo from './font-demo';
|
|
17
|
-
import { getFamilyPreviewStyle } from './utils/preview-styles';
|
|
18
18
|
import { chevronRight } from '@wordpress/icons';
|
|
19
19
|
|
|
20
|
-
function FontCard( { font, onClick, variantsText } ) {
|
|
21
|
-
const fakeFontFace = {
|
|
22
|
-
fontStyle: 'normal',
|
|
23
|
-
fontWeight: '400',
|
|
24
|
-
fontFamily: font.fontFamily,
|
|
25
|
-
fake: true,
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
const displayFontFace =
|
|
29
|
-
font.fontFace && font.fontFace.length
|
|
30
|
-
? font?.fontFace?.find(
|
|
31
|
-
( face ) =>
|
|
32
|
-
face.fontStyle === 'normal' && face.fontWeight === '400'
|
|
33
|
-
) || font.fontFace[ 0 ]
|
|
34
|
-
: fakeFontFace;
|
|
35
|
-
|
|
36
|
-
const demoStyle = getFamilyPreviewStyle( font );
|
|
37
|
-
|
|
20
|
+
function FontCard( { font, onClick, variantsText, navigatorPath } ) {
|
|
38
21
|
const variantsCount = font.fontFace?.length || 1;
|
|
39
22
|
|
|
40
23
|
const style = {
|
|
41
24
|
cursor: !! onClick ? 'pointer' : 'default',
|
|
42
25
|
};
|
|
43
26
|
|
|
27
|
+
const navigator = useNavigator();
|
|
28
|
+
|
|
44
29
|
return (
|
|
45
30
|
<Button
|
|
46
|
-
onClick={
|
|
31
|
+
onClick={ () => {
|
|
32
|
+
onClick();
|
|
33
|
+
if ( navigatorPath ) {
|
|
34
|
+
navigator.goTo( navigatorPath );
|
|
35
|
+
}
|
|
36
|
+
} }
|
|
47
37
|
style={ style }
|
|
48
38
|
className="font-library-modal__font-card"
|
|
49
39
|
>
|
|
50
40
|
<Flex justify="space-between" wrap={ false }>
|
|
51
|
-
<FontDemo
|
|
52
|
-
customPreviewUrl={ font.preview }
|
|
53
|
-
fontFace={ displayFontFace }
|
|
54
|
-
text={ font.name }
|
|
55
|
-
style={ demoStyle }
|
|
56
|
-
/>
|
|
41
|
+
<FontDemo font={ font } />
|
|
57
42
|
<Flex justify="flex-end">
|
|
58
43
|
<FlexItem>
|
|
59
44
|
<Text className="font-library-modal__font-card__count">
|