@wordpress/edit-site 5.18.0 → 5.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/components/add-new-pattern/index.js +62 -1
- package/build/components/add-new-pattern/index.js.map +1 -1
- package/build/components/add-new-template/index.js +3 -2
- package/build/components/add-new-template/index.js.map +1 -1
- package/build/components/add-new-template/new-template.js +6 -1
- package/build/components/add-new-template/new-template.js.map +1 -1
- package/build/components/add-new-template/utils.js +6 -1
- package/build/components/add-new-template/utils.js.map +1 -1
- package/build/components/app/index.js +2 -7
- package/build/components/app/index.js.map +1 -1
- package/build/components/block-editor/back-button.js +3 -2
- package/build/components/block-editor/back-button.js.map +1 -1
- package/build/components/block-editor/editor-canvas.js +20 -16
- package/build/components/block-editor/editor-canvas.js.map +1 -1
- package/build/components/block-editor/site-editor-canvas.js +1 -3
- package/build/components/block-editor/site-editor-canvas.js.map +1 -1
- package/build/components/block-editor/use-site-editor-settings.js +8 -4
- package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build/components/canvas-loader/index.js +18 -1
- package/build/components/canvas-loader/index.js.map +1 -1
- package/build/components/editor/index.js +3 -8
- package/build/components/editor/index.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +5 -4
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/font-families.js +68 -0
- package/build/components/global-styles/font-families.js.map +1 -0
- package/build/components/global-styles/font-family-item.js +47 -0
- package/build/components/global-styles/font-family-item.js.map +1 -0
- package/build/components/global-styles/font-library-modal/confirm-delete-dialog.js +31 -0
- package/build/components/global-styles/font-library-modal/confirm-delete-dialog.js.map +1 -0
- package/build/components/global-styles/font-library-modal/context.js +285 -0
- package/build/components/global-styles/font-library-modal/context.js.map +1 -0
- package/build/components/global-styles/font-library-modal/font-card.js +58 -0
- package/build/components/global-styles/font-library-modal/font-card.js.map +1 -0
- package/build/components/global-styles/font-library-modal/font-demo.js +69 -0
- package/build/components/global-styles/font-library-modal/font-demo.js.map +1 -0
- package/build/components/global-styles/font-library-modal/font-variant.js +51 -0
- package/build/components/global-styles/font-library-modal/font-variant.js.map +1 -0
- package/build/components/global-styles/font-library-modal/fonts-grid.js +54 -0
- package/build/components/global-styles/font-library-modal/fonts-grid.js.map +1 -0
- package/build/components/global-styles/font-library-modal/index.js +47 -0
- package/build/components/global-styles/font-library-modal/index.js.map +1 -0
- package/build/components/global-styles/font-library-modal/installed-fonts.js +128 -0
- package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -0
- package/build/components/global-styles/font-library-modal/library-font-card.js +44 -0
- package/build/components/global-styles/font-library-modal/library-font-card.js.map +1 -0
- package/build/components/global-styles/font-library-modal/library-font-details.js +43 -0
- package/build/components/global-styles/font-library-modal/library-font-details.js.map +1 -0
- package/build/components/global-styles/font-library-modal/library-font-variant.js +59 -0
- package/build/components/global-styles/font-library-modal/library-font-variant.js.map +1 -0
- package/build/components/global-styles/font-library-modal/local-fonts.js +143 -0
- package/build/components/global-styles/font-library-modal/local-fonts.js.map +1 -0
- package/build/components/global-styles/font-library-modal/resolvers.js +37 -0
- package/build/components/global-styles/font-library-modal/resolvers.js.map +1 -0
- package/build/components/global-styles/font-library-modal/tab-layout.js +45 -0
- package/build/components/global-styles/font-library-modal/tab-layout.js.map +1 -0
- package/build/components/global-styles/font-library-modal/utils/constants.js +37 -0
- package/build/components/global-styles/font-library-modal/utils/constants.js.map +1 -0
- package/build/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js +58 -0
- package/build/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js.map +1 -0
- package/build/components/global-styles/font-library-modal/utils/index.js +205 -0
- package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -0
- package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js +22 -0
- package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +1 -0
- package/build/components/global-styles/font-library-modal/utils/toggleFont.js +92 -0
- package/build/components/global-styles/font-library-modal/utils/toggleFont.js.map +1 -0
- package/build/components/global-styles/global-styles-provider.js +7 -12
- package/build/components/global-styles/global-styles-provider.js.map +1 -1
- package/build/components/global-styles/screen-block.js +34 -21
- package/build/components/global-styles/screen-block.js.map +1 -1
- package/build/components/global-styles/screen-revisions/index.js +1 -3
- package/build/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +0 -1
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build/components/global-styles/screen-typography.js +4 -72
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/style-variations-container.js +3 -5
- package/build/components/global-styles/style-variations-container.js.map +1 -1
- package/build/components/global-styles/typogrphy-elements.js +96 -0
- package/build/components/global-styles/typogrphy-elements.js.map +1 -0
- package/build/components/page-patterns/duplicate-menu-item.js +52 -16
- package/build/components/page-patterns/duplicate-menu-item.js.map +1 -1
- package/build/components/page-patterns/grid-item.js +46 -20
- package/build/components/page-patterns/grid-item.js.map +1 -1
- package/build/components/page-patterns/header.js +3 -7
- package/build/components/page-patterns/header.js.map +1 -1
- package/build/components/page-patterns/index.js +3 -3
- package/build/components/page-patterns/index.js.map +1 -1
- package/build/components/page-patterns/patterns-list.js +7 -7
- package/build/components/page-patterns/patterns-list.js.map +1 -1
- package/build/components/page-patterns/rename-menu-item.js +6 -5
- package/build/components/page-patterns/rename-menu-item.js.map +1 -1
- package/build/components/page-patterns/search-items.js +8 -2
- package/build/components/page-patterns/search-items.js.map +1 -1
- package/build/components/page-patterns/use-patterns.js +53 -27
- package/build/components/page-patterns/use-patterns.js.map +1 -1
- package/build/components/page-patterns/utils.js +1 -20
- package/build/components/page-patterns/utils.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/edit-template.js +33 -24
- package/build/components/sidebar-edit-mode/page-panels/edit-template.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/hooks.js +64 -0
- package/build/components/sidebar-edit-mode/page-panels/hooks.js.map +1 -0
- package/build/components/sidebar-edit-mode/page-panels/index.js +1 -4
- package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/page-summary.js +2 -1
- package/build/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/reset-default-template.js +56 -0
- package/build/components/sidebar-edit-mode/page-panels/reset-default-template.js.map +1 -0
- package/build/components/sidebar-edit-mode/page-panels/swap-template-button.js +91 -0
- package/build/components/sidebar-edit-mode/page-panels/swap-template-button.js.map +1 -0
- package/build/components/sidebar-edit-mode/template-panel/index.js +11 -9
- package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-panel/last-revision.js +6 -4
- package/build/components/sidebar-edit-mode/template-panel/last-revision.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-panel/pattern-categories.js +211 -0
- package/build/components/sidebar-edit-mode/template-panel/pattern-categories.js.map +1 -0
- package/build/components/sidebar-navigation-screen/index.js +6 -4
- package/build/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-details-footer/index.js +32 -4
- package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +4 -2
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js +4 -31
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/index.js +3 -3
- package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/index.js +18 -8
- package/build/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js +34 -5
- package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/index.js +7 -35
- package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +38 -4
- package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +2 -1
- package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.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/index.js +1 -1
- package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build/components/template-actions/index.js +7 -4
- package/build/components/template-actions/index.js.map +1 -1
- package/build/components/template-actions/rename-menu-item.js +3 -2
- package/build/components/template-actions/rename-menu-item.js.map +1 -1
- package/build/components/welcome-guide/styles.js +2 -2
- package/build/components/welcome-guide/styles.js.map +1 -1
- package/build/hooks/push-changes-to-global-styles/index.js +5 -37
- package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build/store/actions.js +29 -6
- package/build/store/actions.js.map +1 -1
- package/build/utils/constants.js +45 -2
- package/build/utils/constants.js.map +1 -1
- package/build/utils/is-template-removable.js +6 -1
- package/build/utils/is-template-removable.js.map +1 -1
- package/build/utils/is-template-revertable.js +6 -1
- package/build/utils/is-template-revertable.js.map +1 -1
- package/build-module/components/add-new-pattern/index.js +66 -5
- package/build-module/components/add-new-pattern/index.js.map +1 -1
- package/build-module/components/add-new-template/index.js +3 -2
- package/build-module/components/add-new-template/index.js.map +1 -1
- package/build-module/components/add-new-template/new-template.js +6 -1
- package/build-module/components/add-new-template/new-template.js.map +1 -1
- package/build-module/components/add-new-template/utils.js +6 -1
- package/build-module/components/add-new-template/utils.js.map +1 -1
- package/build-module/components/app/index.js +2 -7
- package/build-module/components/app/index.js.map +1 -1
- package/build-module/components/block-editor/back-button.js +3 -2
- package/build-module/components/block-editor/back-button.js.map +1 -1
- package/build-module/components/block-editor/editor-canvas.js +21 -17
- package/build-module/components/block-editor/editor-canvas.js.map +1 -1
- package/build-module/components/block-editor/site-editor-canvas.js +3 -5
- package/build-module/components/block-editor/site-editor-canvas.js.map +1 -1
- package/build-module/components/block-editor/use-site-editor-settings.js +8 -4
- package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build-module/components/canvas-loader/index.js +18 -1
- package/build-module/components/canvas-loader/index.js.map +1 -1
- package/build-module/components/editor/index.js +3 -8
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +5 -4
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/font-families.js +58 -0
- package/build-module/components/global-styles/font-families.js.map +1 -0
- package/build-module/components/global-styles/font-family-item.js +40 -0
- package/build-module/components/global-styles/font-family-item.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/confirm-delete-dialog.js +23 -0
- package/build-module/components/global-styles/font-library-modal/confirm-delete-dialog.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/context.js +276 -0
- package/build-module/components/global-styles/font-library-modal/context.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/font-card.js +49 -0
- package/build-module/components/global-styles/font-library-modal/font-card.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/font-demo.js +62 -0
- package/build-module/components/global-styles/font-library-modal/font-demo.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/font-variant.js +42 -0
- package/build-module/components/global-styles/font-library-modal/font-variant.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/fonts-grid.js +47 -0
- package/build-module/components/global-styles/font-library-modal/fonts-grid.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/index.js +38 -0
- package/build-module/components/global-styles/font-library-modal/index.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js +120 -0
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/library-font-card.js +36 -0
- package/build-module/components/global-styles/font-library-modal/library-font-card.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/library-font-details.js +34 -0
- package/build-module/components/global-styles/font-library-modal/library-font-details.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/library-font-variant.js +50 -0
- package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/local-fonts.js +135 -0
- package/build-module/components/global-styles/font-library-modal/local-fonts.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/resolvers.js +28 -0
- package/build-module/components/global-styles/font-library-modal/resolvers.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/tab-layout.js +37 -0
- package/build-module/components/global-styles/font-library-modal/tab-layout.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/utils/constants.js +26 -0
- package/build-module/components/global-styles/font-library-modal/utils/constants.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js +52 -0
- package/build-module/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/utils/index.js +190 -0
- package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js +16 -0
- package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/utils/toggleFont.js +86 -0
- package/build-module/components/global-styles/font-library-modal/utils/toggleFont.js.map +1 -0
- package/build-module/components/global-styles/global-styles-provider.js +7 -12
- package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
- package/build-module/components/global-styles/screen-block.js +34 -21
- package/build-module/components/global-styles/screen-block.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/index.js +1 -3
- package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +0 -1
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js +6 -74
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/style-variations-container.js +3 -5
- package/build-module/components/global-styles/style-variations-container.js.map +1 -1
- package/build-module/components/global-styles/typogrphy-elements.js +87 -0
- package/build-module/components/global-styles/typogrphy-elements.js.map +1 -0
- package/build-module/components/page-patterns/duplicate-menu-item.js +51 -16
- package/build-module/components/page-patterns/duplicate-menu-item.js.map +1 -1
- package/build-module/components/page-patterns/grid-item.js +47 -21
- package/build-module/components/page-patterns/grid-item.js.map +1 -1
- package/build-module/components/page-patterns/header.js +3 -7
- package/build-module/components/page-patterns/header.js.map +1 -1
- package/build-module/components/page-patterns/index.js +3 -3
- package/build-module/components/page-patterns/index.js.map +1 -1
- package/build-module/components/page-patterns/patterns-list.js +7 -7
- package/build-module/components/page-patterns/patterns-list.js.map +1 -1
- package/build-module/components/page-patterns/rename-menu-item.js +6 -5
- package/build-module/components/page-patterns/rename-menu-item.js.map +1 -1
- package/build-module/components/page-patterns/search-items.js +8 -2
- package/build-module/components/page-patterns/search-items.js.map +1 -1
- package/build-module/components/page-patterns/use-patterns.js +54 -28
- package/build-module/components/page-patterns/use-patterns.js.map +1 -1
- package/build-module/components/page-patterns/utils.js +0 -11
- package/build-module/components/page-patterns/utils.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/edit-template.js +34 -27
- package/build-module/components/sidebar-edit-mode/page-panels/edit-template.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/hooks.js +54 -0
- package/build-module/components/sidebar-edit-mode/page-panels/hooks.js.map +1 -0
- package/build-module/components/sidebar-edit-mode/page-panels/index.js +1 -4
- package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js +2 -1
- package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/reset-default-template.js +49 -0
- package/build-module/components/sidebar-edit-mode/page-panels/reset-default-template.js.map +1 -0
- package/build-module/components/sidebar-edit-mode/page-panels/swap-template-button.js +85 -0
- package/build-module/components/sidebar-edit-mode/page-panels/swap-template-button.js.map +1 -0
- package/build-module/components/sidebar-edit-mode/template-panel/index.js +12 -10
- package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/template-panel/last-revision.js +8 -6
- package/build-module/components/sidebar-edit-mode/template-panel/last-revision.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/template-panel/pattern-categories.js +202 -0
- package/build-module/components/sidebar-edit-mode/template-panel/pattern-categories.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen/index.js +6 -4
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-details-footer/index.js +32 -5
- package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +4 -2
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +6 -33
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-page/index.js +3 -3
- package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/index.js +19 -9
- package/build-module/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js +34 -5
- package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/index.js +10 -38
- package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +38 -4
- package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +3 -2
- package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-template/index.js +2 -2
- package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build-module/components/template-actions/index.js +7 -4
- package/build-module/components/template-actions/index.js.map +1 -1
- package/build-module/components/template-actions/rename-menu-item.js +3 -2
- package/build-module/components/template-actions/rename-menu-item.js.map +1 -1
- package/build-module/components/welcome-guide/styles.js +2 -2
- package/build-module/components/welcome-guide/styles.js.map +1 -1
- package/build-module/hooks/push-changes-to-global-styles/index.js +5 -37
- package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build-module/store/actions.js +30 -7
- package/build-module/store/actions.js.map +1 -1
- package/build-module/utils/constants.js +35 -1
- package/build-module/utils/constants.js.map +1 -1
- package/build-module/utils/is-template-removable.js +6 -1
- package/build-module/utils/is-template-removable.js.map +1 -1
- package/build-module/utils/is-template-revertable.js +6 -1
- package/build-module/utils/is-template-revertable.js.map +1 -1
- package/build-style/style-rtl.css +244 -37
- package/build-style/style.css +244 -37
- package/lib/inflate.js +4082 -0
- package/lib/lib-font.browser.js +3831 -0
- package/lib/unbrotli.js +2679 -0
- package/package.json +40 -40
- package/src/components/add-new-pattern/index.js +83 -5
- package/src/components/add-new-template/index.js +3 -2
- package/src/components/add-new-template/new-template.js +6 -1
- package/src/components/add-new-template/utils.js +12 -3
- package/src/components/app/index.js +9 -12
- package/src/components/block-editor/back-button.js +6 -2
- package/src/components/block-editor/editor-canvas.js +31 -19
- package/src/components/block-editor/site-editor-canvas.js +2 -10
- package/src/components/block-editor/style.scss +88 -1
- package/src/components/block-editor/use-site-editor-settings.js +26 -19
- package/src/components/canvas-loader/index.js +12 -1
- package/src/components/canvas-loader/style.scss +1 -1
- package/src/components/editor/index.js +3 -8
- package/src/components/global-styles/dimensions-panel.js +8 -4
- package/src/components/global-styles/font-families.js +71 -0
- package/src/components/global-styles/font-family-item.js +44 -0
- package/src/components/global-styles/font-library-modal/confirm-delete-dialog.js +33 -0
- package/src/components/global-styles/font-library-modal/context.js +347 -0
- package/src/components/global-styles/font-library-modal/font-card.js +70 -0
- package/src/components/global-styles/font-library-modal/font-demo.js +57 -0
- package/src/components/global-styles/font-library-modal/font-variant.js +53 -0
- package/src/components/global-styles/font-library-modal/fonts-grid.js +55 -0
- package/src/components/global-styles/font-library-modal/index.js +42 -0
- package/src/components/global-styles/font-library-modal/installed-fonts.js +174 -0
- package/src/components/global-styles/font-library-modal/library-font-card.js +40 -0
- package/src/components/global-styles/font-library-modal/library-font-details.js +46 -0
- package/src/components/global-styles/font-library-modal/library-font-variant.js +54 -0
- package/src/components/global-styles/font-library-modal/local-fonts.js +160 -0
- package/src/components/global-styles/font-library-modal/resolvers.js +29 -0
- package/src/components/global-styles/font-library-modal/style.scss +113 -0
- package/src/components/global-styles/font-library-modal/tab-layout.js +50 -0
- package/src/components/global-styles/font-library-modal/utils/constants.js +31 -0
- package/src/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js +58 -0
- package/src/components/global-styles/font-library-modal/utils/index.js +213 -0
- package/src/components/global-styles/font-library-modal/utils/make-families-from-faces.js +15 -0
- package/src/components/global-styles/font-library-modal/utils/test/getDisplaySrcFromFontFace.spec.js +53 -0
- package/src/components/global-styles/font-library-modal/utils/test/getFontFaceVariantName.spec.js +30 -0
- package/src/components/global-styles/font-library-modal/utils/test/getIntersectingFontFaces.spec.js +240 -0
- package/src/components/global-styles/font-library-modal/utils/test/getPreviewStyle.spec.js +121 -0
- package/src/components/global-styles/font-library-modal/utils/test/isUrlEncoded.spec.js +31 -0
- package/src/components/global-styles/font-library-modal/utils/test/makeFamiliesFromFaces.spec.js +57 -0
- package/src/components/global-styles/font-library-modal/utils/test/makeFormDataFromFontFamilies.spec.js +62 -0
- package/src/components/global-styles/font-library-modal/utils/test/mergeFontFaces.spec.js +56 -0
- package/src/components/global-styles/font-library-modal/utils/test/mergeFontFamilies.spec.js +108 -0
- package/src/components/global-styles/font-library-modal/utils/test/setUIValuesNeeded.spec.js +41 -0
- package/src/components/global-styles/font-library-modal/utils/test/toggleFont.spec.js +141 -0
- package/src/components/global-styles/font-library-modal/utils/toggleFont.js +90 -0
- package/src/components/global-styles/global-styles-provider.js +2 -7
- package/src/components/global-styles/screen-block.js +42 -20
- package/src/components/global-styles/screen-revisions/index.js +0 -2
- package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +0 -1
- package/src/components/global-styles/screen-typography.js +7 -95
- package/src/components/global-styles/style-variations-container.js +0 -2
- package/src/components/global-styles/typogrphy-elements.js +110 -0
- package/src/components/list/style.scss +2 -0
- package/src/components/page-patterns/duplicate-menu-item.js +63 -20
- package/src/components/page-patterns/grid-item.js +77 -30
- package/src/components/page-patterns/header.js +3 -12
- package/src/components/page-patterns/index.js +3 -3
- package/src/components/page-patterns/patterns-list.js +7 -7
- package/src/components/page-patterns/rename-menu-item.js +18 -7
- package/src/components/page-patterns/search-items.js +14 -2
- package/src/components/page-patterns/style.scss +1 -5
- package/src/components/page-patterns/use-patterns.js +67 -33
- package/src/components/page-patterns/utils.js +0 -19
- package/src/components/sidebar-edit-mode/page-panels/edit-template.js +47 -33
- package/src/components/sidebar-edit-mode/page-panels/hooks.js +83 -0
- package/src/components/sidebar-edit-mode/page-panels/index.js +0 -4
- package/src/components/sidebar-edit-mode/page-panels/page-summary.js +2 -0
- package/src/components/sidebar-edit-mode/page-panels/reset-default-template.js +44 -0
- package/src/components/sidebar-edit-mode/page-panels/style.scss +41 -10
- package/src/components/sidebar-edit-mode/page-panels/swap-template-button.js +82 -0
- package/src/components/sidebar-edit-mode/template-panel/index.js +28 -24
- package/src/components/sidebar-edit-mode/template-panel/last-revision.js +19 -15
- package/src/components/sidebar-edit-mode/template-panel/pattern-categories.js +270 -0
- package/src/components/sidebar-navigation-screen/index.js +4 -9
- package/src/components/sidebar-navigation-screen/style.scss +7 -1
- package/src/components/sidebar-navigation-screen-details-footer/index.js +38 -10
- package/src/components/sidebar-navigation-screen-details-footer/style.scss +10 -3
- package/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +2 -0
- package/src/components/sidebar-navigation-screen-global-styles/index.js +6 -44
- package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +0 -4
- package/src/components/sidebar-navigation-screen-page/index.js +3 -3
- package/src/components/sidebar-navigation-screen-pattern/index.js +20 -7
- package/src/components/sidebar-navigation-screen-pattern/style.scss +0 -3
- package/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js +46 -13
- package/src/components/sidebar-navigation-screen-patterns/index.js +14 -49
- package/src/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +48 -6
- package/src/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +3 -5
- package/src/components/sidebar-navigation-screen-template/index.js +2 -4
- package/src/components/sidebar-navigation-screen-templates/index.js +1 -1
- package/src/components/template-actions/index.js +14 -8
- package/src/components/template-actions/rename-menu-item.js +15 -4
- package/src/components/welcome-guide/styles.js +2 -2
- package/src/hooks/push-changes-to-global-styles/index.js +6 -49
- package/src/store/actions.js +39 -13
- package/src/store/test/actions.js +0 -1
- package/src/store/test/reducer.js +0 -1
- package/src/style.scss +1 -1
- package/src/utils/constants.js +38 -3
- package/src/utils/is-template-removable.js +8 -1
- package/src/utils/is-template-revertable.js +8 -1
- package/build/components/sidebar-navigation-screen-patterns/use-my-patterns.js +0 -30
- package/build/components/sidebar-navigation-screen-patterns/use-my-patterns.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-my-patterns.js +0 -23
- package/build-module/components/sidebar-navigation-screen-patterns/use-my-patterns.js.map +0 -1
- package/src/components/sidebar-navigation-screen-global-styles/style.scss +0 -12
- package/src/components/sidebar-navigation-screen-patterns/use-my-patterns.js +0 -24
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__experimentalText","Text","__experimentalVStack","VStack","__experimentalHStack","HStack","CheckboxControl","FontFaceDemo","FontVariant","fontFace","variantName","checked","onClick","text","actionHandler","fontStyle","fontWeight","displayVariantName","createElement","className","spacing","justify","alignment","onChange"],"sources":["@wordpress/edit-site/src/components/global-styles/font-library-modal/font-variant.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalText as Text,\n\t__experimentalVStack as VStack,\n\t__experimentalHStack as HStack,\n\tCheckboxControl,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport FontFaceDemo from './font-demo';\n\nfunction FontVariant( {\n\tfontFace,\n\tvariantName,\n\tchecked,\n\tonClick,\n\ttext,\n\tactionHandler,\n} ) {\n\tconst { fontStyle, fontWeight } = fontFace;\n\tconst displayVariantName = variantName || `${ fontWeight } ${ fontStyle }`;\n\n\treturn (\n\t\t<div className=\"font-library-modal__font-variant\">\n\t\t\t<VStack spacing={ 1 }>\n\t\t\t\t<HStack justify=\"flex-start\" alignment=\"top\">\n\t\t\t\t\t{ !! actionHandler ? (\n\t\t\t\t\t\tactionHandler\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<CheckboxControl\n\t\t\t\t\t\t\tchecked={ checked }\n\t\t\t\t\t\t\tonChange={ onClick }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ typeof displayVariantName === 'string' ? (\n\t\t\t\t\t\t<Text>{ displayVariantName }</Text>\n\t\t\t\t\t) : (\n\t\t\t\t\t\tdisplayVariantName\n\t\t\t\t\t) }\n\t\t\t\t</HStack>\n\t\t\t\t<div className=\"font-library-modal__font-variant_demo-wrapper\">\n\t\t\t\t\t<FontFaceDemo fontFace={ fontFace } text={ text } />\n\t\t\t\t</div>\n\t\t\t</VStack>\n\t\t</div>\n\t);\n}\n\nexport default FontVariant;\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,kBAAkB,IAAIC,IAAI,EAC1BC,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,EAC9BC,eAAe,QACT,uBAAuB;;AAE9B;AACA;AACA;AACA,OAAOC,YAAY,MAAM,aAAa;AAEtC,SAASC,WAAWA,CAAE;EACrBC,QAAQ;EACRC,WAAW;EACXC,OAAO;EACPC,OAAO;EACPC,IAAI;EACJC;AACD,CAAC,EAAG;EACH,MAAM;IAAEC,SAAS;IAAEC;EAAW,CAAC,GAAGP,QAAQ;EAC1C,MAAMQ,kBAAkB,GAAGP,WAAW,IAAK,GAAGM,UAAY,IAAID,SAAW,EAAC;EAE1E,OACCG,aAAA;IAAKC,SAAS,EAAC;EAAkC,GAChDD,aAAA,CAACf,MAAM;IAACiB,OAAO,EAAG;EAAG,GACpBF,aAAA,CAACb,MAAM;IAACgB,OAAO,EAAC,YAAY;IAACC,SAAS,EAAC;EAAK,GACzC,CAAC,CAAER,aAAa,GACjBA,aAAa,GAEbI,aAAA,CAACZ,eAAe;IACfK,OAAO,EAAGA,OAAS;IACnBY,QAAQ,EAAGX;EAAS,CACpB,CACD,EACC,OAAOK,kBAAkB,KAAK,QAAQ,GACvCC,aAAA,CAACjB,IAAI,QAAGgB,kBAA0B,CAAC,GAEnCA,kBAEM,CAAC,EACTC,aAAA;IAAKC,SAAS,EAAC;EAA+C,GAC7DD,aAAA,CAACX,YAAY;IAACE,QAAQ,EAAGA,QAAU;IAACI,IAAI,EAAGA;EAAM,CAAE,CAC/C,CACE,CACJ,CAAC;AAER;AAEA,eAAeL,WAAW"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { createElement, Fragment } from "@wordpress/element";
|
|
2
|
+
/**
|
|
3
|
+
* WordPress dependencies
|
|
4
|
+
*/
|
|
5
|
+
import { __experimentalVStack as VStack, __experimentalText as Text, __experimentalSpacer as Spacer } from '@wordpress/components';
|
|
6
|
+
import { useState, useEffect } from '@wordpress/element';
|
|
7
|
+
function FontsGrid({
|
|
8
|
+
title,
|
|
9
|
+
children,
|
|
10
|
+
pageSize = 32
|
|
11
|
+
}) {
|
|
12
|
+
const [lastItem, setLastItem] = useState(null);
|
|
13
|
+
const [page, setPage] = useState(1);
|
|
14
|
+
const itemsLimit = page * pageSize;
|
|
15
|
+
const items = children.slice(0, itemsLimit);
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
if (lastItem) {
|
|
18
|
+
const observer = new window.IntersectionObserver(([entry]) => {
|
|
19
|
+
if (entry.isIntersecting) {
|
|
20
|
+
setPage(prevPage => prevPage + 1);
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
observer.observe(lastItem);
|
|
24
|
+
return () => observer.disconnect();
|
|
25
|
+
}
|
|
26
|
+
}, [lastItem]);
|
|
27
|
+
return createElement("div", {
|
|
28
|
+
className: "font-library-modal__fonts-grid"
|
|
29
|
+
}, createElement(VStack, {
|
|
30
|
+
spacing: 0
|
|
31
|
+
}, title && createElement(Fragment, null, createElement(Text, {
|
|
32
|
+
className: "font-library-modal__subtitle"
|
|
33
|
+
}, title), createElement(Spacer, {
|
|
34
|
+
margin: 2
|
|
35
|
+
})), createElement("div", {
|
|
36
|
+
className: "font-library-modal__fonts-grid__main"
|
|
37
|
+
}, items.map((child, i) => {
|
|
38
|
+
if (i === itemsLimit - 1) {
|
|
39
|
+
return createElement("div", {
|
|
40
|
+
ref: setLastItem
|
|
41
|
+
}, child);
|
|
42
|
+
}
|
|
43
|
+
return child;
|
|
44
|
+
}))));
|
|
45
|
+
}
|
|
46
|
+
export default FontsGrid;
|
|
47
|
+
//# sourceMappingURL=fonts-grid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__experimentalVStack","VStack","__experimentalText","Text","__experimentalSpacer","Spacer","useState","useEffect","FontsGrid","title","children","pageSize","lastItem","setLastItem","page","setPage","itemsLimit","items","slice","observer","window","IntersectionObserver","entry","isIntersecting","prevPage","observe","disconnect","createElement","className","spacing","Fragment","margin","map","child","i","ref"],"sources":["@wordpress/edit-site/src/components/global-styles/font-library-modal/fonts-grid.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalVStack as VStack,\n\t__experimentalText as Text,\n\t__experimentalSpacer as Spacer,\n} from '@wordpress/components';\nimport { useState, useEffect } from '@wordpress/element';\n\nfunction FontsGrid( { title, children, pageSize = 32 } ) {\n\tconst [ lastItem, setLastItem ] = useState( null );\n\tconst [ page, setPage ] = useState( 1 );\n\tconst itemsLimit = page * pageSize;\n\tconst items = children.slice( 0, itemsLimit );\n\n\tuseEffect( () => {\n\t\tif ( lastItem ) {\n\t\t\tconst observer = new window.IntersectionObserver( ( [ entry ] ) => {\n\t\t\t\tif ( entry.isIntersecting ) {\n\t\t\t\t\tsetPage( ( prevPage ) => prevPage + 1 );\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\tobserver.observe( lastItem );\n\n\t\t\treturn () => observer.disconnect();\n\t\t}\n\t}, [ lastItem ] );\n\n\treturn (\n\t\t<div className=\"font-library-modal__fonts-grid\">\n\t\t\t<VStack spacing={ 0 }>\n\t\t\t\t{ title && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<Text className=\"font-library-modal__subtitle\">\n\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t<Spacer margin={ 2 } />\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t\t<div className=\"font-library-modal__fonts-grid__main\">\n\t\t\t\t\t{ items.map( ( child, i ) => {\n\t\t\t\t\t\tif ( i === itemsLimit - 1 ) {\n\t\t\t\t\t\t\treturn <div ref={ setLastItem }>{ child }</div>;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn child;\n\t\t\t\t\t} ) }\n\t\t\t\t</div>\n\t\t\t</VStack>\n\t\t</div>\n\t);\n}\n\nexport default FontsGrid;\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,oBAAoB,IAAIC,MAAM,EAC9BC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AAK,CAACe,GAAG,CAAE,CAAEC,KAAK,EAAEC,CAAC,KAAM;IAC5B,IAAKA,CAAC,KAAKlB,UAAU,GAAG,CAAC,EAAG;MAC3B,OAAOW,aAAA;QAAKQ,GAAG,EAAGtB;MAAa,GAAGoB,KAAY,CAAC;IAChD;IACA,OAAOA,KAAK;EACb,CAAE,CACE,CACE,CACJ,CAAC;AAER;AAEA,eAAezB,SAAS"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { createElement } from "@wordpress/element";
|
|
2
|
+
/**
|
|
3
|
+
* WordPress dependencies
|
|
4
|
+
*/
|
|
5
|
+
import { __ } from '@wordpress/i18n';
|
|
6
|
+
import { Modal, TabPanel } from '@wordpress/components';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Internal dependencies
|
|
10
|
+
*/
|
|
11
|
+
import InstalledFonts from './installed-fonts';
|
|
12
|
+
import { MODAL_TABS } from './utils/constants';
|
|
13
|
+
function FontLibraryModal({
|
|
14
|
+
onRequestClose,
|
|
15
|
+
initialTabName = 'installed-fonts'
|
|
16
|
+
}) {
|
|
17
|
+
return createElement(Modal, {
|
|
18
|
+
title: __('Fonts'),
|
|
19
|
+
onRequestClose: onRequestClose,
|
|
20
|
+
isFullScreen: true,
|
|
21
|
+
className: "font-library-modal",
|
|
22
|
+
style: {
|
|
23
|
+
width: '65vw'
|
|
24
|
+
}
|
|
25
|
+
}, createElement(TabPanel, {
|
|
26
|
+
className: "font-library-modal__tab-panel",
|
|
27
|
+
initialTabName: initialTabName,
|
|
28
|
+
tabs: MODAL_TABS
|
|
29
|
+
}, tab => {
|
|
30
|
+
switch (tab.name) {
|
|
31
|
+
case 'installed-fonts':
|
|
32
|
+
default:
|
|
33
|
+
return createElement(InstalledFonts, null);
|
|
34
|
+
}
|
|
35
|
+
}));
|
|
36
|
+
}
|
|
37
|
+
export default FontLibraryModal;
|
|
38
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__","Modal","TabPanel","InstalledFonts","MODAL_TABS","FontLibraryModal","onRequestClose","initialTabName","createElement","title","isFullScreen","className","style","width","tabs","tab","name"],"sources":["@wordpress/edit-site/src/components/global-styles/font-library-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Modal, TabPanel } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport InstalledFonts from './installed-fonts';\nimport { MODAL_TABS } from './utils/constants';\n\nfunction FontLibraryModal( {\n\tonRequestClose,\n\tinitialTabName = 'installed-fonts',\n} ) {\n\treturn (\n\t\t<Modal\n\t\t\ttitle={ __( 'Fonts' ) }\n\t\t\tonRequestClose={ onRequestClose }\n\t\t\tisFullScreen={ true }\n\t\t\tclassName=\"font-library-modal\"\n\t\t\tstyle={ { width: '65vw' } }\n\t\t>\n\t\t\t<TabPanel\n\t\t\t\tclassName=\"font-library-modal__tab-panel\"\n\t\t\t\tinitialTabName={ initialTabName }\n\t\t\t\ttabs={ MODAL_TABS }\n\t\t\t>\n\t\t\t\t{ ( tab ) => {\n\t\t\t\t\tswitch ( tab.name ) {\n\t\t\t\t\t\tcase 'installed-fonts':\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\treturn <InstalledFonts />;\n\t\t\t\t\t}\n\t\t\t\t} }\n\t\t\t</TabPanel>\n\t\t</Modal>\n\t);\n}\n\nexport default FontLibraryModal;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,EAAEC,QAAQ,QAAQ,uBAAuB;;AAEvD;AACA;AACA;AACA,OAAOC,cAAc,MAAM,mBAAmB;AAC9C,SAASC,UAAU,QAAQ,mBAAmB;AAE9C,SAASC,gBAAgBA,CAAE;EAC1BC,cAAc;EACdC,cAAc,GAAG;AAClB,CAAC,EAAG;EACH,OACCC,aAAA,CAACP,KAAK;IACLQ,KAAK,EAAGT,EAAE,CAAE,OAAQ,CAAG;IACvBM,cAAc,EAAGA,cAAgB;IACjCI,YAAY,EAAG,IAAM;IACrBC,SAAS,EAAC,oBAAoB;IAC9BC,KAAK,EAAG;MAAEC,KAAK,EAAE;IAAO;EAAG,GAE3BL,aAAA,CAACN,QAAQ;IACRS,SAAS,EAAC,+BAA+B;IACzCJ,cAAc,EAAGA,cAAgB;IACjCO,IAAI,EAAGV;EAAY,GAEfW,GAAG,IAAM;IACZ,QAASA,GAAG,CAACC,IAAI;MAChB,KAAK,iBAAiB;MACtB;QACC,OAAOR,aAAA,CAACL,cAAc,MAAE,CAAC;IAC3B;EACD,CACS,CACJ,CAAC;AAEV;AAEA,eAAeE,gBAAgB"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { createElement, Fragment } from "@wordpress/element";
|
|
2
|
+
/**
|
|
3
|
+
* WordPress dependencies
|
|
4
|
+
*/
|
|
5
|
+
import { __ } from '@wordpress/i18n';
|
|
6
|
+
import { useContext, useEffect, useState } from '@wordpress/element';
|
|
7
|
+
import { privateApis as componentsPrivateApis, __experimentalHStack as HStack, __experimentalSpacer as Spacer, Button, Spinner } from '@wordpress/components';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Internal dependencies
|
|
11
|
+
*/
|
|
12
|
+
import TabLayout from './tab-layout';
|
|
13
|
+
import { FontLibraryContext } from './context';
|
|
14
|
+
import FontsGrid from './fonts-grid';
|
|
15
|
+
import LibraryFontDetails from './library-font-details';
|
|
16
|
+
import LibraryFontCard from './library-font-card';
|
|
17
|
+
import LocalFonts from './local-fonts';
|
|
18
|
+
import ConfirmDeleteDialog from './confirm-delete-dialog';
|
|
19
|
+
import { unlock } from '../../../lock-unlock';
|
|
20
|
+
const {
|
|
21
|
+
ProgressBar
|
|
22
|
+
} = unlock(componentsPrivateApis);
|
|
23
|
+
function InstalledFonts() {
|
|
24
|
+
const {
|
|
25
|
+
baseCustomFonts,
|
|
26
|
+
libraryFontSelected,
|
|
27
|
+
baseThemeFonts,
|
|
28
|
+
handleSetLibraryFontSelected,
|
|
29
|
+
refreshLibrary,
|
|
30
|
+
uninstallFont,
|
|
31
|
+
isResolvingLibrary
|
|
32
|
+
} = useContext(FontLibraryContext);
|
|
33
|
+
const [isConfirmDeleteOpen, setIsConfirmDeleteOpen] = useState(false);
|
|
34
|
+
const handleUnselectFont = () => {
|
|
35
|
+
handleSetLibraryFontSelected(null);
|
|
36
|
+
};
|
|
37
|
+
const handleSelectFont = font => {
|
|
38
|
+
handleSetLibraryFontSelected(font);
|
|
39
|
+
};
|
|
40
|
+
const handleConfirmUninstall = async () => {
|
|
41
|
+
const result = await uninstallFont(libraryFontSelected);
|
|
42
|
+
// If the font was succesfully uninstalled it is unselected
|
|
43
|
+
if (result) {
|
|
44
|
+
handleUnselectFont();
|
|
45
|
+
}
|
|
46
|
+
setIsConfirmDeleteOpen(false);
|
|
47
|
+
};
|
|
48
|
+
const handleUninstallClick = async () => {
|
|
49
|
+
setIsConfirmDeleteOpen(true);
|
|
50
|
+
};
|
|
51
|
+
const handleCancelUninstall = () => {
|
|
52
|
+
setIsConfirmDeleteOpen(false);
|
|
53
|
+
};
|
|
54
|
+
const tabDescription = !!libraryFontSelected ? __('Choose font variants. Keep in mind that too many variants could make your site slower.') : null;
|
|
55
|
+
const shouldDisplayDeleteButton = !!libraryFontSelected && libraryFontSelected?.source !== 'theme';
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
refreshLibrary();
|
|
58
|
+
}, []);
|
|
59
|
+
return createElement(TabLayout, {
|
|
60
|
+
title: libraryFontSelected?.name || '',
|
|
61
|
+
description: tabDescription,
|
|
62
|
+
handleBack: !!libraryFontSelected && handleUnselectFont,
|
|
63
|
+
footer: createElement(Footer, {
|
|
64
|
+
shouldDisplayDeleteButton: shouldDisplayDeleteButton,
|
|
65
|
+
handleUninstallClick: handleUninstallClick
|
|
66
|
+
})
|
|
67
|
+
}, createElement(ConfirmDeleteDialog, {
|
|
68
|
+
font: libraryFontSelected,
|
|
69
|
+
isConfirmDeleteOpen: isConfirmDeleteOpen,
|
|
70
|
+
handleConfirmUninstall: handleConfirmUninstall,
|
|
71
|
+
handleCancelUninstall: handleCancelUninstall
|
|
72
|
+
}), !libraryFontSelected && createElement(Fragment, null, isResolvingLibrary && createElement(Spinner, null), baseCustomFonts.length > 0 && createElement(Fragment, null, createElement(Spacer, {
|
|
73
|
+
margin: 2
|
|
74
|
+
}), createElement(FontsGrid, null, baseCustomFonts.map(font => createElement(LibraryFontCard, {
|
|
75
|
+
font: font,
|
|
76
|
+
key: font.slug,
|
|
77
|
+
onClick: () => {
|
|
78
|
+
handleSelectFont(font);
|
|
79
|
+
}
|
|
80
|
+
})))), baseThemeFonts.length > 0 && createElement(Fragment, null, createElement(Spacer, {
|
|
81
|
+
margin: 8
|
|
82
|
+
}), createElement(FontsGrid, {
|
|
83
|
+
title: __('Theme Fonts')
|
|
84
|
+
}, baseThemeFonts.map(font => createElement(LibraryFontCard, {
|
|
85
|
+
font: font,
|
|
86
|
+
key: font.slug,
|
|
87
|
+
onClick: () => {
|
|
88
|
+
handleSelectFont(font);
|
|
89
|
+
}
|
|
90
|
+
})))), createElement(Spacer, {
|
|
91
|
+
margin: 8
|
|
92
|
+
}), createElement(LocalFonts, null)), libraryFontSelected && createElement(LibraryFontDetails, {
|
|
93
|
+
font: libraryFontSelected,
|
|
94
|
+
isConfirmDeleteOpen: isConfirmDeleteOpen,
|
|
95
|
+
handleConfirmUninstall: handleConfirmUninstall,
|
|
96
|
+
handleCancelUninstall: handleCancelUninstall
|
|
97
|
+
}));
|
|
98
|
+
}
|
|
99
|
+
function Footer({
|
|
100
|
+
shouldDisplayDeleteButton,
|
|
101
|
+
handleUninstallClick
|
|
102
|
+
}) {
|
|
103
|
+
const {
|
|
104
|
+
saveFontFamilies,
|
|
105
|
+
fontFamiliesHasChanges,
|
|
106
|
+
isInstalling
|
|
107
|
+
} = useContext(FontLibraryContext);
|
|
108
|
+
return createElement(HStack, {
|
|
109
|
+
justify: "space-between"
|
|
110
|
+
}, isInstalling && createElement(ProgressBar, null), createElement("div", null, shouldDisplayDeleteButton && createElement(Button, {
|
|
111
|
+
variant: "tertiary",
|
|
112
|
+
onClick: handleUninstallClick
|
|
113
|
+
}, __('Delete'))), createElement(Button, {
|
|
114
|
+
disabled: !fontFamiliesHasChanges,
|
|
115
|
+
variant: "primary",
|
|
116
|
+
onClick: saveFontFamilies
|
|
117
|
+
}, __('Update')));
|
|
118
|
+
}
|
|
119
|
+
export default InstalledFonts;
|
|
120
|
+
//# sourceMappingURL=installed-fonts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__","useContext","useEffect","useState","privateApis","componentsPrivateApis","__experimentalHStack","HStack","__experimentalSpacer","Spacer","Button","Spinner","TabLayout","FontLibraryContext","FontsGrid","LibraryFontDetails","LibraryFontCard","LocalFonts","ConfirmDeleteDialog","unlock","ProgressBar","InstalledFonts","baseCustomFonts","libraryFontSelected","baseThemeFonts","handleSetLibraryFontSelected","refreshLibrary","uninstallFont","isResolvingLibrary","isConfirmDeleteOpen","setIsConfirmDeleteOpen","handleUnselectFont","handleSelectFont","font","handleConfirmUninstall","result","handleUninstallClick","handleCancelUninstall","tabDescription","shouldDisplayDeleteButton","source","createElement","title","name","description","handleBack","footer","Footer","Fragment","length","margin","map","key","slug","onClick","saveFontFamilies","fontFamiliesHasChanges","isInstalling","justify","variant","disabled"],"sources":["@wordpress/edit-site/src/components/global-styles/font-library-modal/installed-fonts.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useContext, useEffect, useState } from '@wordpress/element';\nimport {\n\tprivateApis as componentsPrivateApis,\n\t__experimentalHStack as HStack,\n\t__experimentalSpacer as Spacer,\n\tButton,\n\tSpinner,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport TabLayout from './tab-layout';\nimport { FontLibraryContext } from './context';\nimport FontsGrid from './fonts-grid';\nimport LibraryFontDetails from './library-font-details';\nimport LibraryFontCard from './library-font-card';\nimport LocalFonts from './local-fonts';\nimport ConfirmDeleteDialog from './confirm-delete-dialog';\nimport { unlock } from '../../../lock-unlock';\nconst { ProgressBar } = unlock( componentsPrivateApis );\n\nfunction InstalledFonts() {\n\tconst {\n\t\tbaseCustomFonts,\n\t\tlibraryFontSelected,\n\t\tbaseThemeFonts,\n\t\thandleSetLibraryFontSelected,\n\t\trefreshLibrary,\n\t\tuninstallFont,\n\t\tisResolvingLibrary,\n\t} = useContext( FontLibraryContext );\n\tconst [ isConfirmDeleteOpen, setIsConfirmDeleteOpen ] = useState( false );\n\n\tconst handleUnselectFont = () => {\n\t\thandleSetLibraryFontSelected( null );\n\t};\n\n\tconst handleSelectFont = ( font ) => {\n\t\thandleSetLibraryFontSelected( font );\n\t};\n\n\tconst handleConfirmUninstall = async () => {\n\t\tconst result = await uninstallFont( libraryFontSelected );\n\t\t// If the font was succesfully uninstalled it is unselected\n\t\tif ( result ) {\n\t\t\thandleUnselectFont();\n\t\t}\n\t\tsetIsConfirmDeleteOpen( false );\n\t};\n\n\tconst handleUninstallClick = async () => {\n\t\tsetIsConfirmDeleteOpen( true );\n\t};\n\n\tconst handleCancelUninstall = () => {\n\t\tsetIsConfirmDeleteOpen( false );\n\t};\n\n\tconst tabDescription = !! libraryFontSelected\n\t\t? __(\n\t\t\t\t'Choose font variants. Keep in mind that too many variants could make your site slower.'\n\t\t )\n\t\t: null;\n\n\tconst shouldDisplayDeleteButton =\n\t\t!! libraryFontSelected && libraryFontSelected?.source !== 'theme';\n\n\tuseEffect( () => {\n\t\trefreshLibrary();\n\t}, [] );\n\n\treturn (\n\t\t<TabLayout\n\t\t\ttitle={ libraryFontSelected?.name || '' }\n\t\t\tdescription={ tabDescription }\n\t\t\thandleBack={ !! libraryFontSelected && handleUnselectFont }\n\t\t\tfooter={\n\t\t\t\t<Footer\n\t\t\t\t\tshouldDisplayDeleteButton={ shouldDisplayDeleteButton }\n\t\t\t\t\thandleUninstallClick={ handleUninstallClick }\n\t\t\t\t/>\n\t\t\t}\n\t\t>\n\t\t\t<ConfirmDeleteDialog\n\t\t\t\tfont={ libraryFontSelected }\n\t\t\t\tisConfirmDeleteOpen={ isConfirmDeleteOpen }\n\t\t\t\thandleConfirmUninstall={ handleConfirmUninstall }\n\t\t\t\thandleCancelUninstall={ handleCancelUninstall }\n\t\t\t/>\n\n\t\t\t{ ! libraryFontSelected && (\n\t\t\t\t<>\n\t\t\t\t\t{ isResolvingLibrary && <Spinner /> }\n\t\t\t\t\t{ baseCustomFonts.length > 0 && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<Spacer margin={ 2 } />\n\t\t\t\t\t\t\t<FontsGrid>\n\t\t\t\t\t\t\t\t{ baseCustomFonts.map( ( font ) => (\n\t\t\t\t\t\t\t\t\t<LibraryFontCard\n\t\t\t\t\t\t\t\t\t\tfont={ font }\n\t\t\t\t\t\t\t\t\t\tkey={ font.slug }\n\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\thandleSelectFont( font );\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t\t</FontsGrid>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ baseThemeFonts.length > 0 && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<Spacer margin={ 8 } />\n\t\t\t\t\t\t\t<FontsGrid title={ __( 'Theme Fonts' ) }>\n\t\t\t\t\t\t\t\t{ baseThemeFonts.map( ( font ) => (\n\t\t\t\t\t\t\t\t\t<LibraryFontCard\n\t\t\t\t\t\t\t\t\t\tfont={ font }\n\t\t\t\t\t\t\t\t\t\tkey={ font.slug }\n\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\thandleSelectFont( font );\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t\t</FontsGrid>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\n\t\t\t\t\t<Spacer margin={ 8 } />\n\t\t\t\t\t<LocalFonts />\n\t\t\t\t</>\n\t\t\t) }\n\n\t\t\t{ libraryFontSelected && (\n\t\t\t\t<LibraryFontDetails\n\t\t\t\t\tfont={ libraryFontSelected }\n\t\t\t\t\tisConfirmDeleteOpen={ isConfirmDeleteOpen }\n\t\t\t\t\thandleConfirmUninstall={ handleConfirmUninstall }\n\t\t\t\t\thandleCancelUninstall={ handleCancelUninstall }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</TabLayout>\n\t);\n}\n\nfunction Footer( { shouldDisplayDeleteButton, handleUninstallClick } ) {\n\tconst { saveFontFamilies, fontFamiliesHasChanges, isInstalling } =\n\t\tuseContext( FontLibraryContext );\n\treturn (\n\t\t<HStack justify=\"space-between\">\n\t\t\t{ isInstalling && <ProgressBar /> }\n\t\t\t<div>\n\t\t\t\t{ shouldDisplayDeleteButton && (\n\t\t\t\t\t<Button variant=\"tertiary\" onClick={ handleUninstallClick }>\n\t\t\t\t\t\t{ __( 'Delete' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t\t<Button\n\t\t\t\tdisabled={ ! fontFamiliesHasChanges }\n\t\t\t\tvariant=\"primary\"\n\t\t\t\tonClick={ saveFontFamilies }\n\t\t\t>\n\t\t\t\t{ __( 'Update' ) }\n\t\t\t</Button>\n\t\t</HStack>\n\t);\n}\n\nexport default InstalledFonts;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,UAAU,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,oBAAoB;AACpE,SACCC,WAAW,IAAIC,qBAAqB,EACpCC,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,EAC9BC,MAAM,EACNC,OAAO,QACD,uBAAu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OAAO,EAAGC;EAAkB,GAE1BvD,EAAE,CAAE,QAAS,CACR,CACD,CAAC;AAEX;AAEA,eAAeqB,cAAc"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { createElement } from "@wordpress/element";
|
|
2
|
+
/**
|
|
3
|
+
* WordPress dependencies
|
|
4
|
+
*/
|
|
5
|
+
import { __, sprintf } from '@wordpress/i18n';
|
|
6
|
+
import { useContext } from '@wordpress/element';
|
|
7
|
+
import { Icon } from '@wordpress/components';
|
|
8
|
+
import { chevronRight } from '@wordpress/icons';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Internal dependencies
|
|
12
|
+
*/
|
|
13
|
+
import FontCard from './font-card';
|
|
14
|
+
import { FontLibraryContext } from './context';
|
|
15
|
+
function LibraryFontCard({
|
|
16
|
+
font,
|
|
17
|
+
...props
|
|
18
|
+
}) {
|
|
19
|
+
const {
|
|
20
|
+
getFontFacesActivated
|
|
21
|
+
} = useContext(FontLibraryContext);
|
|
22
|
+
const variantsInstalled = font.fontFace?.length || 1;
|
|
23
|
+
const variantsActive = getFontFacesActivated(font.slug, font.source).length;
|
|
24
|
+
const variantsText = sprintf( /* translators: %1$d: Active font variants, %2$d: Total font variants */
|
|
25
|
+
__('%1$s/%2$s variants active'), variantsActive, variantsInstalled);
|
|
26
|
+
return createElement(FontCard, {
|
|
27
|
+
font: font,
|
|
28
|
+
variantsText: variantsText,
|
|
29
|
+
actionHandler: createElement(Icon, {
|
|
30
|
+
icon: chevronRight
|
|
31
|
+
}),
|
|
32
|
+
...props
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
export default LibraryFontCard;
|
|
36
|
+
//# sourceMappingURL=library-font-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__","sprintf","useContext","Icon","chevronRight","FontCard","FontLibraryContext","LibraryFontCard","font","props","getFontFacesActivated","variantsInstalled","fontFace","length","variantsActive","slug","source","variantsText","createElement","actionHandler","icon"],"sources":["@wordpress/edit-site/src/components/global-styles/font-library-modal/library-font-card.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useContext } from '@wordpress/element';\nimport { Icon } from '@wordpress/components';\nimport { chevronRight } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport FontCard from './font-card';\nimport { FontLibraryContext } from './context';\n\nfunction LibraryFontCard( { font, ...props } ) {\n\tconst { getFontFacesActivated } = useContext( FontLibraryContext );\n\n\tconst variantsInstalled = font.fontFace?.length || 1;\n\tconst variantsActive = getFontFacesActivated(\n\t\tfont.slug,\n\t\tfont.source\n\t).length;\n\tconst variantsText = sprintf(\n\t\t/* translators: %1$d: Active font variants, %2$d: Total font variants */\n\t\t__( '%1$s/%2$s variants active' ),\n\t\tvariantsActive,\n\t\tvariantsInstalled\n\t);\n\n\treturn (\n\t\t<FontCard\n\t\t\tfont={ font }\n\t\t\tvariantsText={ variantsText }\n\t\t\tactionHandler={ <Icon icon={ chevronRight } /> }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nexport default LibraryFontCard;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,IAAI,QAAQ,uBAAuB;AAC5C,SAASC,YAAY,QAAQ,kBAAkB;;AAE/C;AACA;AACA;AACA,OAAOC,QAAQ,MAAM,aAAa;AAClC,SAASC,kBAAkB,QAAQ,WAAW;AAE9C,SAASC,eAAeA,CAAE;EAAEC,IAAI;EAAE,GAAGC;AAAM,CAAC,EAAG;EAC9C,MAAM;IAAEC;EAAsB,CAAC,GAAGR,UAAU,CAAEI,kBAAmB,CAAC;EAElE,MAAMK,iBAAiB,GAAGH,IAAI,CAACI,QAAQ,EAAEC,MAAM,IAAI,CAAC;EACpD,MAAMC,cAAc,GAAGJ,qBAAqB,CAC3CF,IAAI,CAACO,IAAI,EACTP,IAAI,CAACQ,MACN,CAAC,CAACH,MAAM;EACR,MAAMI,YAAY,GAAGhB,OAAO,EAC3B;EACAD,EAAE,CAAE,2BAA4B,CAAC,EACjCc,cAAc,EACdH,iBACD,CAAC;EAED,OACCO,aAAA,CAACb,QAAQ;IACRG,IAAI,EAAGA,IAAM;IACbS,YAAY,EAAGA,YAAc;IAC7BE,aAAa,EAAGD,aAAA,CAACf,IAAI;MAACiB,IAAI,EAAGhB;IAAc,CAAE,CAAG;IAAA,GAC3CK;EAAK,CACV,CAAC;AAEJ;AAEA,eAAeF,eAAe"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { createElement, Fragment } from "@wordpress/element";
|
|
2
|
+
/**
|
|
3
|
+
* WordPress dependencies
|
|
4
|
+
*/
|
|
5
|
+
import { __experimentalVStack as VStack, __experimentalSpacer as Spacer } from '@wordpress/components';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Internal dependencies
|
|
9
|
+
*/
|
|
10
|
+
import LibraryFontVariant from './library-font-variant';
|
|
11
|
+
function LibraryFontDetails({
|
|
12
|
+
font
|
|
13
|
+
}) {
|
|
14
|
+
const fontFaces = font.fontFace && font.fontFace.length ? font.fontFace.sort((a, b) => a.fontWeight > b.fontWeight ? 1 : -1) : [{
|
|
15
|
+
fontFamily: font.fontFamily,
|
|
16
|
+
fontStyle: 'normal',
|
|
17
|
+
fontWeight: '400'
|
|
18
|
+
}];
|
|
19
|
+
return createElement(Fragment, null, createElement(Spacer, {
|
|
20
|
+
margin: 4
|
|
21
|
+
}), createElement(VStack, {
|
|
22
|
+
spacing: 0
|
|
23
|
+
}, createElement(Spacer, {
|
|
24
|
+
margin: 8
|
|
25
|
+
}), fontFaces.map((face, i) => createElement(LibraryFontVariant, {
|
|
26
|
+
font: font,
|
|
27
|
+
face: face,
|
|
28
|
+
key: `face${i}`
|
|
29
|
+
}))), createElement(Spacer, {
|
|
30
|
+
margin: 8
|
|
31
|
+
}));
|
|
32
|
+
}
|
|
33
|
+
export default LibraryFontDetails;
|
|
34
|
+
//# sourceMappingURL=library-font-details.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__experimentalVStack","VStack","__experimentalSpacer","Spacer","LibraryFontVariant","LibraryFontDetails","font","fontFaces","fontFace","length","sort","a","b","fontWeight","fontFamily","fontStyle","createElement","Fragment","margin","spacing","map","face","i","key"],"sources":["@wordpress/edit-site/src/components/global-styles/font-library-modal/library-font-details.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalVStack as VStack,\n\t__experimentalSpacer as Spacer,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport LibraryFontVariant from './library-font-variant';\n\nfunction LibraryFontDetails( { font } ) {\n\tconst fontFaces =\n\t\tfont.fontFace && font.fontFace.length\n\t\t\t? font.fontFace.sort( ( a, b ) =>\n\t\t\t\t\ta.fontWeight > b.fontWeight ? 1 : -1\n\t\t\t )\n\t\t\t: [\n\t\t\t\t\t{\n\t\t\t\t\t\tfontFamily: font.fontFamily,\n\t\t\t\t\t\tfontStyle: 'normal',\n\t\t\t\t\t\tfontWeight: '400',\n\t\t\t\t\t},\n\t\t\t ];\n\n\treturn (\n\t\t<>\n\t\t\t<Spacer margin={ 4 } />\n\t\t\t<VStack spacing={ 0 }>\n\t\t\t\t<Spacer margin={ 8 } />\n\t\t\t\t{ fontFaces.map( ( face, i ) => (\n\t\t\t\t\t<LibraryFontVariant\n\t\t\t\t\t\tfont={ font }\n\t\t\t\t\t\tface={ face }\n\t\t\t\t\t\tkey={ `face${ i }` }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t</VStack>\n\t\t\t<Spacer margin={ 8 } />\n\t\t</>\n\t);\n}\n\nexport default LibraryFontDetails;\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,QACxB,uBAAuB;;AAE9B;AACA;AACA;AACA,OAAOC,kBAAkB,MAAM,wBAAwB;AAEvD,SAASC,kBAAkBA,CAAE;EAAEC;AAAK,CAAC,EAAG;EACvC,MAAMC,SAAS,GACdD,IAAI,CAACE,QAAQ,IAAIF,IAAI,CAACE,QAAQ,CAACC,MAAM,GAClCH,IAAI,CAACE,QAAQ,CAACE,IAAI,CAAE,CAAEC,CAAC,EAAEC,CAAC,KAC1BD,CAAC,CAACE,UAAU,GAAGD,CAAC,CAACC,UAAU,GAAG,CAAC,GAAG,CAAC,CACnC,CAAC,GACD,CACA;IACCC,UAAU,EAAER,IAAI,CAACQ,UAAU;IAC3BC,SAAS,EAAE,QAAQ;IACnBF,UAAU,EAAE;EACb,CAAC,CACA;EAEL,OACCG,aAAA,CAAAC,QAAA,QACCD,aAAA,CAACb,MAAM;IAACe,MAAM,EAAG;EAAG,CAAE,CAAC,EACvBF,aAAA,CAACf,MAAM;IAACkB,OAAO,EAAG;EAAG,GACpBH,aAAA,CAACb,MAAM;IAACe,MAAM,EAAG;EAAG,CAAE,CAAC,EACrBX,SAAS,CAACa,GAAG,CAAE,CAAEC,IAAI,EAAEC,CAAC,KACzBN,aAAA,CAACZ,kBAAkB;IAClBE,IAAI,EAAGA,IAAM;IACbe,IAAI,EAAGA,IAAM;IACbE,GAAG,EAAI,OAAOD,CAAG;EAAG,CACpB,CACA,CACK,CAAC,EACTN,aAAA,CAACb,MAAM;IAACe,MAAM,EAAG;EAAG,CAAE,CACrB,CAAC;AAEL;AAEA,eAAeb,kBAAkB"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { createElement } from "@wordpress/element";
|
|
2
|
+
/**
|
|
3
|
+
* WordPress dependencies
|
|
4
|
+
*/
|
|
5
|
+
import { useContext } from '@wordpress/element';
|
|
6
|
+
import { CheckboxControl, Flex } from '@wordpress/components';
|
|
7
|
+
/**
|
|
8
|
+
* Internal dependencies
|
|
9
|
+
*/
|
|
10
|
+
import { getFontFaceVariantName } from './utils';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Internal dependencies
|
|
14
|
+
*/
|
|
15
|
+
import { FontLibraryContext } from './context';
|
|
16
|
+
import FontFaceDemo from './font-demo';
|
|
17
|
+
function LibraryFontVariant({
|
|
18
|
+
face,
|
|
19
|
+
font
|
|
20
|
+
}) {
|
|
21
|
+
const {
|
|
22
|
+
isFontActivated,
|
|
23
|
+
toggleActivateFont
|
|
24
|
+
} = useContext(FontLibraryContext);
|
|
25
|
+
const isIstalled = font?.fontFace ? isFontActivated(font.slug, face.fontStyle, face.fontWeight, font.source) : isFontActivated(font.slug, null, null, font.source);
|
|
26
|
+
const handleToggleActivation = () => {
|
|
27
|
+
if (font?.fontFace) {
|
|
28
|
+
toggleActivateFont(font, face);
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
toggleActivateFont(font);
|
|
32
|
+
};
|
|
33
|
+
const displayName = font.name + ' ' + getFontFaceVariantName(face);
|
|
34
|
+
return createElement("div", {
|
|
35
|
+
className: "font-library-modal__library-font-variant"
|
|
36
|
+
}, createElement(Flex, {
|
|
37
|
+
justify: "space-between",
|
|
38
|
+
align: "center",
|
|
39
|
+
gap: "1rem"
|
|
40
|
+
}, createElement(FontFaceDemo, {
|
|
41
|
+
fontFace: face,
|
|
42
|
+
text: displayName
|
|
43
|
+
}), createElement(CheckboxControl, {
|
|
44
|
+
checked: isIstalled,
|
|
45
|
+
onChange: handleToggleActivation,
|
|
46
|
+
__nextHasNoMarginBottom: true
|
|
47
|
+
})));
|
|
48
|
+
}
|
|
49
|
+
export default LibraryFontVariant;
|
|
50
|
+
//# sourceMappingURL=library-font-variant.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useContext","CheckboxControl","Flex","getFontFaceVariantName","FontLibraryContext","FontFaceDemo","LibraryFontVariant","face","font","isFontActivated","toggleActivateFont","isIstalled","fontFace","slug","fontStyle","fontWeight","source","handleToggleActivation","displayName","name","createElement","className","justify","align","gap","text","checked","onChange","__nextHasNoMarginBottom"],"sources":["@wordpress/edit-site/src/components/global-styles/font-library-modal/library-font-variant.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useContext } from '@wordpress/element';\nimport { CheckboxControl, Flex } from '@wordpress/components';\n/**\n * Internal dependencies\n */\nimport { getFontFaceVariantName } from './utils';\n\n/**\n * Internal dependencies\n */\nimport { FontLibraryContext } from './context';\nimport FontFaceDemo from './font-demo';\n\nfunction LibraryFontVariant( { face, font } ) {\n\tconst { isFontActivated, toggleActivateFont } =\n\t\tuseContext( FontLibraryContext );\n\n\tconst isIstalled = font?.fontFace\n\t\t? isFontActivated(\n\t\t\t\tfont.slug,\n\t\t\t\tface.fontStyle,\n\t\t\t\tface.fontWeight,\n\t\t\t\tfont.source\n\t\t )\n\t\t: isFontActivated( font.slug, null, null, font.source );\n\n\tconst handleToggleActivation = () => {\n\t\tif ( font?.fontFace ) {\n\t\t\ttoggleActivateFont( font, face );\n\t\t\treturn;\n\t\t}\n\t\ttoggleActivateFont( font );\n\t};\n\n\tconst displayName = font.name + ' ' + getFontFaceVariantName( face );\n\n\treturn (\n\t\t<div className=\"font-library-modal__library-font-variant\">\n\t\t\t<Flex justify=\"space-between\" align=\"center\" gap=\"1rem\">\n\t\t\t\t<FontFaceDemo fontFace={ face } text={ displayName } />\n\t\t\t\t<CheckboxControl\n\t\t\t\t\tchecked={ isIstalled }\n\t\t\t\t\tonChange={ handleToggleActivation }\n\t\t\t\t\t__nextHasNoMarginBottom={ true }\n\t\t\t\t/>\n\t\t\t</Flex>\n\t\t</div>\n\t);\n}\n\nexport default LibraryFontVariant;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,eAAe,EAAEC,IAAI,QAAQ,uBAAuB;AAC7D;AACA;AACA;AACA,SAASC,sBAAsB,QAAQ,SAAS;;AAEhD;AACA;AACA;AACA,SAASC,kBAAkB,QAAQ,WAAW;AAC9C,OAAOC,YAAY,MAAM,aAAa;AAEtC,SAASC,kBAAkBA,CAAE;EAAEC,IAAI;EAAEC;AAAK,CAAC,EAAG;EAC7C,MAAM;IAAEC,eAAe;IAAEC;EAAmB,CAAC,GAC5CV,UAAU,CAAEI,kBAAmB,CAAC;EAEjC,MAAMO,UAAU,GAAGH,IAAI,EAAEI,QAAQ,GAC9BH,eAAe,CACfD,IAAI,CAACK,IAAI,EACTN,IAAI,CAACO,SAAS,EACdP,IAAI,CAACQ,UAAU,EACfP,IAAI,CAACQ,MACL,CAAC,GACDP,eAAe,CAAED,IAAI,CAACK,IAAI,EAAE,IAAI,EAAE,IAAI,EAAEL,IAAI,CAACQ,MAAO,CAAC;EAExD,MAAMC,sBAAsB,GAAGA,CAAA,KAAM;IACpC,IAAKT,IAAI,EAAEI,QAAQ,EAAG;MACrBF,kBAAkB,CAAEF,IAAI,EAAED,IAAK,CAAC;MAChC;IACD;IACAG,kBAAkB,CAAEF,IAAK,CAAC;EAC3B,CAAC;EAED,MAAMU,WAAW,GAAGV,IAAI,CAACW,IAAI,GAAG,GAAG,GAAGhB,sBAAsB,CAAEI,IAAK,CAAC;EAEpE,OACCa,aAAA;IAAKC,SAAS,EAAC;EAA0C,GACxDD,aAAA,CAAClB,IAAI;IAACoB,OAAO,EAAC,eAAe;IAACC,KAAK,EAAC,QAAQ;IAACC,GAAG,EAAC;EAAM,GACtDJ,aAAA,CAACf,YAAY;IAACO,QAAQ,EAAGL,IAAM;IAACkB,IAAI,EAAGP;EAAa,CAAE,CAAC,EACvDE,aAAA,CAACnB,eAAe;IACfyB,OAAO,EAAGf,UAAY;IACtBgB,QAAQ,EAAGV,sBAAwB;IACnCW,uBAAuB,EAAG;EAAM,CAChC,CACI,CACF,CAAC;AAER;AAEA,eAAetB,kBAAkB"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { createElement, Fragment } from "@wordpress/element";
|
|
2
|
+
/**
|
|
3
|
+
* WordPress dependencies
|
|
4
|
+
*/
|
|
5
|
+
import { __ } from '@wordpress/i18n';
|
|
6
|
+
import { Button, DropZone, __experimentalSpacer as Spacer, __experimentalText as Text, FormFileUpload } from '@wordpress/components';
|
|
7
|
+
import { useContext } from '@wordpress/element';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Internal dependencies
|
|
11
|
+
*/
|
|
12
|
+
import { ALLOWED_FILE_EXTENSIONS } from './utils/constants';
|
|
13
|
+
import { FontLibraryContext } from './context';
|
|
14
|
+
import { Font } from '../../../../lib/lib-font.browser';
|
|
15
|
+
import makeFamiliesFromFaces from './utils/make-families-from-faces';
|
|
16
|
+
import { loadFontFaceInBrowser } from './utils';
|
|
17
|
+
function LocalFonts() {
|
|
18
|
+
const {
|
|
19
|
+
installFonts
|
|
20
|
+
} = useContext(FontLibraryContext);
|
|
21
|
+
const handleDropZone = files => {
|
|
22
|
+
handleFilesUpload(files);
|
|
23
|
+
};
|
|
24
|
+
const onFilesUpload = event => {
|
|
25
|
+
handleFilesUpload(event.target.files);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Filters the selected files to only allow the ones with the allowed extensions
|
|
30
|
+
*
|
|
31
|
+
* @param {Array} files The files to be filtered
|
|
32
|
+
* @return {void}
|
|
33
|
+
*/
|
|
34
|
+
const handleFilesUpload = files => {
|
|
35
|
+
const uniqueFilenames = new Set();
|
|
36
|
+
const selectedFiles = [...files];
|
|
37
|
+
const allowedFiles = selectedFiles.filter(file => {
|
|
38
|
+
if (uniqueFilenames.has(file.name)) {
|
|
39
|
+
return false; // Discard duplicates
|
|
40
|
+
}
|
|
41
|
+
// Eliminates files that are not allowed
|
|
42
|
+
const fileExtension = file.name.split('.').pop().toLowerCase();
|
|
43
|
+
if (ALLOWED_FILE_EXTENSIONS.includes(fileExtension)) {
|
|
44
|
+
uniqueFilenames.add(file.name);
|
|
45
|
+
return true; // Keep file if the extension is allowed
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return false; // Discard file extension not allowed
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
if (allowedFiles.length > 0) {
|
|
52
|
+
loadFiles(allowedFiles);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Loads the selected files and reads the font metadata
|
|
58
|
+
*
|
|
59
|
+
* @param {Array} files The files to be loaded
|
|
60
|
+
* @return {void}
|
|
61
|
+
*/
|
|
62
|
+
const loadFiles = async files => {
|
|
63
|
+
const fontFacesLoaded = await Promise.all(files.map(async fontFile => {
|
|
64
|
+
const fontFaceData = await getFontFaceMetadata(fontFile);
|
|
65
|
+
await loadFontFaceInBrowser(fontFaceData, fontFaceData.file, 'all');
|
|
66
|
+
return fontFaceData;
|
|
67
|
+
}));
|
|
68
|
+
await handleInstall(fontFacesLoaded);
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
// Create a function to read the file as array buffer
|
|
72
|
+
async function readFileAsArrayBuffer(file) {
|
|
73
|
+
return new Promise((resolve, reject) => {
|
|
74
|
+
const reader = new window.FileReader();
|
|
75
|
+
reader.readAsArrayBuffer(file);
|
|
76
|
+
reader.onload = () => resolve(reader.result);
|
|
77
|
+
reader.onerror = reject;
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
const getFontFaceMetadata = async fontFile => {
|
|
81
|
+
const buffer = await readFileAsArrayBuffer(fontFile);
|
|
82
|
+
const fontObj = new Font('Uploaded Font');
|
|
83
|
+
fontObj.fromDataBuffer(buffer, fontFile.name);
|
|
84
|
+
// Assuming that fromDataBuffer triggers onload event and returning a Promise
|
|
85
|
+
const onloadEvent = await new Promise(resolve => fontObj.onload = resolve);
|
|
86
|
+
const font = onloadEvent.detail.font;
|
|
87
|
+
const {
|
|
88
|
+
name
|
|
89
|
+
} = font.opentype.tables;
|
|
90
|
+
const fontName = name.get(16) || name.get(1);
|
|
91
|
+
const isItalic = name.get(2).toLowerCase().includes('italic');
|
|
92
|
+
const fontWeight = font.opentype.tables['OS/2'].usWeightClass || 'normal';
|
|
93
|
+
const isVariable = !!font.opentype.tables.fvar;
|
|
94
|
+
const weightAxis = isVariable && font.opentype.tables.fvar.axes.find(({
|
|
95
|
+
tag
|
|
96
|
+
}) => tag === 'wght');
|
|
97
|
+
const weightRange = weightAxis ? `${weightAxis.minValue} ${weightAxis.maxValue}` : null;
|
|
98
|
+
return {
|
|
99
|
+
file: fontFile,
|
|
100
|
+
fontFamily: fontName,
|
|
101
|
+
fontStyle: isItalic ? 'italic' : 'normal',
|
|
102
|
+
fontWeight: weightRange || fontWeight
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Creates the font family definition and sends it to the server
|
|
108
|
+
*
|
|
109
|
+
* @param {Array} fontFaces The font faces to be installed
|
|
110
|
+
* @return {void}
|
|
111
|
+
*/
|
|
112
|
+
const handleInstall = async fontFaces => {
|
|
113
|
+
const fontFamilies = makeFamiliesFromFaces(fontFaces);
|
|
114
|
+
await installFonts(fontFamilies);
|
|
115
|
+
};
|
|
116
|
+
return createElement(Fragment, null, createElement(Text, {
|
|
117
|
+
className: "font-library-modal__subtitle"
|
|
118
|
+
}, __('Upload Fonts')), createElement(Spacer, {
|
|
119
|
+
margin: 2
|
|
120
|
+
}), createElement(DropZone, {
|
|
121
|
+
onFilesDrop: handleDropZone
|
|
122
|
+
}), createElement(FormFileUpload, {
|
|
123
|
+
accept: ALLOWED_FILE_EXTENSIONS.map(ext => `.${ext}`).join(','),
|
|
124
|
+
multiple: true,
|
|
125
|
+
onChange: onFilesUpload,
|
|
126
|
+
render: ({
|
|
127
|
+
openFileDialog
|
|
128
|
+
}) => createElement(Button, {
|
|
129
|
+
className: "font-library-modal__upload-area",
|
|
130
|
+
onClick: openFileDialog
|
|
131
|
+
}, createElement("span", null, __('Drag and drop your font files here.')))
|
|
132
|
+
}));
|
|
133
|
+
}
|
|
134
|
+
export default LocalFonts;
|
|
135
|
+
//# sourceMappingURL=local-fonts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__","Button","DropZone","__experimentalSpacer","Spacer","__experimentalText","Text","FormFileUpload","useContext","ALLOWED_FILE_EXTENSIONS","FontLibraryContext","Font","makeFamiliesFromFaces","loadFontFaceInBrowser","LocalFonts","installFonts","handleDropZone","files","handleFilesUpload","onFilesUpload","event","target","uniqueFilenames","Set","selectedFiles","allowedFiles","filter","file","has","name","fileExtension","split","pop","toLowerCase","includes","add","length","loadFiles","fontFacesLoaded","Promise","all","map","fontFile","fontFaceData","getFontFaceMetadata","handleInstall","readFileAsArrayBuffer","resolve","reject","reader","window","FileReader","readAsArrayBuffer","onload","result","onerror","buffer","fontObj","fromDataBuffer","onloadEvent","font","detail","opentype","tables","fontName","get","isItalic","fontWeight","usWeightClass","isVariable","fvar","weightAxis","axes","find","tag","weightRange","minValue","maxValue","fontFamily","fontStyle","fontFaces","fontFamilies","createElement","Fragment","className","margin","onFilesDrop","accept","ext","join","multiple","onChange","render","openFileDialog","onClick"],"sources":["@wordpress/edit-site/src/components/global-styles/font-library-modal/local-fonts.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tButton,\n\tDropZone,\n\t__experimentalSpacer as Spacer,\n\t__experimentalText as Text,\n\tFormFileUpload,\n} from '@wordpress/components';\nimport { useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { ALLOWED_FILE_EXTENSIONS } from './utils/constants';\nimport { FontLibraryContext } from './context';\nimport { Font } from '../../../../lib/lib-font.browser';\nimport makeFamiliesFromFaces from './utils/make-families-from-faces';\nimport { loadFontFaceInBrowser } from './utils';\n\nfunction LocalFonts() {\n\tconst { installFonts } = useContext( FontLibraryContext );\n\n\tconst handleDropZone = ( files ) => {\n\t\thandleFilesUpload( files );\n\t};\n\tconst onFilesUpload = ( event ) => {\n\t\thandleFilesUpload( event.target.files );\n\t};\n\n\t/**\n\t * Filters the selected files to only allow the ones with the allowed extensions\n\t *\n\t * @param {Array} files The files to be filtered\n\t * @return {void}\n\t */\n\tconst handleFilesUpload = ( files ) => {\n\t\tconst uniqueFilenames = new Set();\n\t\tconst selectedFiles = [ ...files ];\n\t\tconst allowedFiles = selectedFiles.filter( ( file ) => {\n\t\t\tif ( uniqueFilenames.has( file.name ) ) {\n\t\t\t\treturn false; // Discard duplicates\n\t\t\t}\n\t\t\t// Eliminates files that are not allowed\n\t\t\tconst fileExtension = file.name.split( '.' ).pop().toLowerCase();\n\t\t\tif ( ALLOWED_FILE_EXTENSIONS.includes( fileExtension ) ) {\n\t\t\t\tuniqueFilenames.add( file.name );\n\t\t\t\treturn true; // Keep file if the extension is allowed\n\t\t\t}\n\t\t\treturn false; // Discard file extension not allowed\n\t\t} );\n\t\tif ( allowedFiles.length > 0 ) {\n\t\t\tloadFiles( allowedFiles );\n\t\t}\n\t};\n\n\t/**\n\t * Loads the selected files and reads the font metadata\n\t *\n\t * @param {Array} files The files to be loaded\n\t * @return {void}\n\t */\n\tconst loadFiles = async ( files ) => {\n\t\tconst fontFacesLoaded = await Promise.all(\n\t\t\tfiles.map( async ( fontFile ) => {\n\t\t\t\tconst fontFaceData = await getFontFaceMetadata( fontFile );\n\t\t\t\tawait loadFontFaceInBrowser(\n\t\t\t\t\tfontFaceData,\n\t\t\t\t\tfontFaceData.file,\n\t\t\t\t\t'all'\n\t\t\t\t);\n\t\t\t\treturn fontFaceData;\n\t\t\t} )\n\t\t);\n\t\tawait handleInstall( fontFacesLoaded );\n\t};\n\n\t// Create a function to read the file as array buffer\n\tasync function readFileAsArrayBuffer( file ) {\n\t\treturn new Promise( ( resolve, reject ) => {\n\t\t\tconst reader = new window.FileReader();\n\t\t\treader.readAsArrayBuffer( file );\n\t\t\treader.onload = () => resolve( reader.result );\n\t\t\treader.onerror = reject;\n\t\t} );\n\t}\n\n\tconst getFontFaceMetadata = async ( fontFile ) => {\n\t\tconst buffer = await readFileAsArrayBuffer( fontFile );\n\t\tconst fontObj = new Font( 'Uploaded Font' );\n\t\tfontObj.fromDataBuffer( buffer, fontFile.name );\n\t\t// Assuming that fromDataBuffer triggers onload event and returning a Promise\n\t\tconst onloadEvent = await new Promise(\n\t\t\t( resolve ) => ( fontObj.onload = resolve )\n\t\t);\n\t\tconst font = onloadEvent.detail.font;\n\t\tconst { name } = font.opentype.tables;\n\t\tconst fontName = name.get( 16 ) || name.get( 1 );\n\t\tconst isItalic = name.get( 2 ).toLowerCase().includes( 'italic' );\n\t\tconst fontWeight =\n\t\t\tfont.opentype.tables[ 'OS/2' ].usWeightClass || 'normal';\n\t\tconst isVariable = !! font.opentype.tables.fvar;\n\t\tconst weightAxis =\n\t\t\tisVariable &&\n\t\t\tfont.opentype.tables.fvar.axes.find(\n\t\t\t\t( { tag } ) => tag === 'wght'\n\t\t\t);\n\t\tconst weightRange = weightAxis\n\t\t\t? `${ weightAxis.minValue } ${ weightAxis.maxValue }`\n\t\t\t: null;\n\t\treturn {\n\t\t\tfile: fontFile,\n\t\t\tfontFamily: fontName,\n\t\t\tfontStyle: isItalic ? 'italic' : 'normal',\n\t\t\tfontWeight: weightRange || fontWeight,\n\t\t};\n\t};\n\n\t/**\n\t * Creates the font family definition and sends it to the server\n\t *\n\t * @param {Array} fontFaces The font faces to be installed\n\t * @return {void}\n\t */\n\tconst handleInstall = async ( fontFaces ) => {\n\t\tconst fontFamilies = makeFamiliesFromFaces( fontFaces );\n\t\tawait installFonts( fontFamilies );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<Text className=\"font-library-modal__subtitle\">\n\t\t\t\t{ __( 'Upload Fonts' ) }\n\t\t\t</Text>\n\t\t\t<Spacer margin={ 2 } />\n\t\t\t<DropZone onFilesDrop={ handleDropZone } />\n\t\t\t<FormFileUpload\n\t\t\t\taccept={ ALLOWED_FILE_EXTENSIONS.map(\n\t\t\t\t\t( ext ) => `.${ ext }`\n\t\t\t\t).join( ',' ) }\n\t\t\t\tmultiple={ true }\n\t\t\t\tonChange={ onFilesUpload }\n\t\t\t\trender={ ( { openFileDialog } ) => (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tclassName=\"font-library-modal__upload-area\"\n\t\t\t\t\t\tonClick={ openFileDialog }\n\t\t\t\t\t>\n\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t{ __( 'Drag and drop your font files here.' ) }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</Button>\n\t\t\t\t) }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport default LocalFonts;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SACCC,MAAM,EACNC,QAAQ,EACRC,oBAAoB,IAAIC,MAAM,EAC9BC,kBAAkB,IAAIC,IAAI,EAC1BC,cAAc,QACR,uBAAuB;AAC9B,SAASC,UAAU,QAAQ,oBAAoB;;AAE/C;AACA;AACA;AACA,SAASC,uBAAuB,QAAQ,mBAAmB;AAC3D,SAASC,kBAAkB,QAAQ,WAAW;AAC9C,SAASC,IAAI,QAAQ,kCAAkC;AACvD,OAAOC,qBAAqB,MAAM,kCAAkC;AACpE,SAASC,qBAAqB,QAAQ,SAAS;AAE/C,SAASC,UAAUA,CAAA,EAAG;EACrB,MAAM;IAAEC;EAAa,CAAC,GAAGP,UAAU,CAAEE,kBAAmB,CAAC;EAEzD,MAAMM,cAAc,GAAKC,KAAK,IAAM;IACnCC,iBAAiB,CAAED,KAAM,CAAC;EAC3B,CAAC;EACD,MAAME,aAAa,GAAKC,KAAK,IAAM;IAClCF,iBAAiB,CAAEE,KAAK,CAACC,MAAM,CAACJ,KAAM,CAAC;EACxC,CAAC;;EAED;AACD;AACA;AACA;AACA;AACA;EACC,MAAMC,iBAAiB,GAAKD,KAAK,IAAM;IACtC,MAAMK,eAAe,GAAG,IAAIC,GAAG,CAAC,CAAC;IACjC,MAAMC,aAAa,GAAG,CAAE,GAAGP,KAAK,CAAE;IAClC,MAAMQ,YAAY,GAAGD,aAAa,CAACE,MAAM,CAAIC,IAAI,IAAM;MACtD,IAAKL,eAAe,CAACM,GAAG,CAAED,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fetch';
|
|
9
|
+
export async function fetchInstallFonts(data) {
|
|
10
|
+
const config = {
|
|
11
|
+
path: '/wp/v2/fonts',
|
|
12
|
+
method: 'POST',
|
|
13
|
+
body: data
|
|
14
|
+
};
|
|
15
|
+
return apiFetch(config);
|
|
16
|
+
}
|
|
17
|
+
export async function fetchUninstallFonts(fonts) {
|
|
18
|
+
const data = {
|
|
19
|
+
fontFamilies: fonts
|
|
20
|
+
};
|
|
21
|
+
const config = {
|
|
22
|
+
path: '/wp/v2/fonts',
|
|
23
|
+
method: 'DELETE',
|
|
24
|
+
data
|
|
25
|
+
};
|
|
26
|
+
return apiFetch(config);
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=resolvers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["apiFetch","fetchInstallFonts","data","config","path","method","body","fetchUninstallFonts","fonts","fontFamilies"],"sources":["@wordpress/edit-site/src/components/global-styles/font-library-modal/resolvers.js"],"sourcesContent":["/**\n * WordPress dependencies\n *\n */\n/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\n\nexport async function fetchInstallFonts( data ) {\n\tconst config = {\n\t\tpath: '/wp/v2/fonts',\n\t\tmethod: 'POST',\n\t\tbody: data,\n\t};\n\treturn apiFetch( config );\n}\n\nexport async function fetchUninstallFonts( fonts ) {\n\tconst data = {\n\t\tfontFamilies: fonts,\n\t};\n\tconst config = {\n\t\tpath: '/wp/v2/fonts',\n\t\tmethod: 'DELETE',\n\t\tdata,\n\t};\n\treturn apiFetch( config );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAOA,QAAQ,MAAM,sBAAsB;AAE3C,OAAO,eAAeC,iBAAiBA,CAAEC,IAAI,EAAG;EAC/C,MAAMC,MAAM,GAAG;IACdC,IAAI,EAAE,cAAc;IACpBC,MAAM,EAAE,MAAM;IACdC,IAAI,EAAEJ;EACP,CAAC;EACD,OAAOF,QAAQ,CAAEG,MAAO,CAAC;AAC1B;AAEA,OAAO,eAAeI,mBAAmBA,CAAEC,KAAK,EAAG;EAClD,MAAMN,IAAI,GAAG;IACZO,YAAY,EAAED;EACf,CAAC;EACD,MAAML,MAAM,GAAG;IACdC,IAAI,EAAE,cAAc;IACpBC,MAAM,EAAE,QAAQ;IAChBH;EACD,CAAC;EACD,OAAOF,QAAQ,CAAEG,MAAO,CAAC;AAC1B"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { createElement } from "@wordpress/element";
|
|
2
|
+
/**
|
|
3
|
+
* WordPress dependencies
|
|
4
|
+
*/
|
|
5
|
+
import { __experimentalText as Text, __experimentalHeading as Heading, __experimentalVStack as VStack, __experimentalSpacer as Spacer, __experimentalHStack as HStack, Button } from '@wordpress/components';
|
|
6
|
+
import { chevronLeft } from '@wordpress/icons';
|
|
7
|
+
function TabLayout({
|
|
8
|
+
title,
|
|
9
|
+
description,
|
|
10
|
+
handleBack,
|
|
11
|
+
children,
|
|
12
|
+
footer
|
|
13
|
+
}) {
|
|
14
|
+
return createElement("div", {
|
|
15
|
+
className: "font-library-modal__tab-layout"
|
|
16
|
+
}, createElement(Spacer, {
|
|
17
|
+
margin: 4
|
|
18
|
+
}), createElement(VStack, {
|
|
19
|
+
spacing: 4,
|
|
20
|
+
justify: "space-between"
|
|
21
|
+
}, createElement("header", null, createElement(VStack, {
|
|
22
|
+
spacing: 2
|
|
23
|
+
}, createElement(HStack, {
|
|
24
|
+
justify: "flex-start"
|
|
25
|
+
}, !!handleBack && createElement(Button, {
|
|
26
|
+
variant: "tertiary",
|
|
27
|
+
onClick: handleBack,
|
|
28
|
+
icon: chevronLeft,
|
|
29
|
+
isSmall: true
|
|
30
|
+
}), title && createElement(Heading, {
|
|
31
|
+
level: 2,
|
|
32
|
+
size: 13,
|
|
33
|
+
className: "edit-site-global-styles-header"
|
|
34
|
+
}, title)), description && createElement(Text, null, description))), createElement("main", null, children), createElement("footer", null, footer)));
|
|
35
|
+
}
|
|
36
|
+
export default TabLayout;
|
|
37
|
+
//# sourceMappingURL=tab-layout.js.map
|