@wordpress/edit-site 5.19.2 → 5.20.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-page/index.js +9 -8
- package/build/components/add-new-page/index.js.map +1 -1
- package/build/components/add-new-pattern/index.js +12 -15
- package/build/components/add-new-pattern/index.js.map +1 -1
- package/build/components/add-new-template/add-custom-generic-template-modal-content.js +8 -7
- package/build/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
- package/build/components/add-new-template/add-custom-template-modal-content.js +20 -19
- package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
- package/build/components/add-new-template/index.js +2 -2
- package/build/components/add-new-template/index.js.map +1 -1
- package/build/components/add-new-template/new-template.js +17 -16
- package/build/components/add-new-template/new-template.js.map +1 -1
- package/build/components/add-new-template/template-actions-loading-screen.js +4 -4
- package/build/components/add-new-template/template-actions-loading-screen.js.map +1 -1
- package/build/components/app/index.js +2 -2
- package/build/components/app/index.js.map +1 -1
- package/build/components/block-editor/back-button.js +2 -2
- package/build/components/block-editor/back-button.js.map +1 -1
- package/build/components/block-editor/block-editor-provider/default-block-editor-provider.js +10 -6
- package/build/components/block-editor/block-editor-provider/default-block-editor-provider.js.map +1 -1
- package/build/components/block-editor/block-editor-provider/index.js +3 -3
- package/build/components/block-editor/block-editor-provider/index.js.map +1 -1
- package/build/components/block-editor/block-editor-provider/navigation-block-editor-provider.js +3 -2
- package/build/components/block-editor/block-editor-provider/navigation-block-editor-provider.js.map +1 -1
- package/build/components/block-editor/block-editor-provider/use-page-content-blocks.js +19 -11
- package/build/components/block-editor/block-editor-provider/use-page-content-blocks.js.map +1 -1
- package/build/components/block-editor/block-inspector-button.js +2 -2
- package/build/components/block-editor/block-inspector-button.js.map +1 -1
- package/build/components/block-editor/editor-canvas.js +4 -3
- package/build/components/block-editor/editor-canvas.js.map +1 -1
- package/build/components/block-editor/index.js +2 -2
- package/build/components/block-editor/index.js.map +1 -1
- package/build/components/block-editor/resizable-editor.js +4 -3
- package/build/components/block-editor/resizable-editor.js.map +1 -1
- package/build/components/block-editor/resize-handle.js +3 -3
- package/build/components/block-editor/resize-handle.js.map +1 -1
- package/build/components/block-editor/site-editor-canvas.js +8 -7
- package/build/components/block-editor/site-editor-canvas.js.map +1 -1
- package/build/components/canvas-loader/index.js +4 -4
- package/build/components/canvas-loader/index.js.map +1 -1
- package/build/components/code-editor/index.js +8 -7
- package/build/components/code-editor/index.js.map +1 -1
- package/build/components/create-template-part-modal/index.js +17 -16
- package/build/components/create-template-part-modal/index.js.map +1 -1
- package/build/components/dataviews/dataviews.js +61 -0
- package/build/components/dataviews/dataviews.js.map +1 -0
- package/build/components/dataviews/index.js +21 -0
- package/build/components/dataviews/index.js.map +1 -0
- package/build/components/dataviews/list-view.js +89 -0
- package/build/components/dataviews/list-view.js.map +1 -0
- package/build/components/dataviews/pagination.js +89 -0
- package/build/components/dataviews/pagination.js.map +1 -0
- package/build/components/dataviews/text-filter.js +44 -0
- package/build/components/dataviews/text-filter.js.map +1 -0
- package/build/components/dataviews/view-actions.js +189 -0
- package/build/components/dataviews/view-actions.js.map +1 -0
- package/build/components/editor/index.js +15 -14
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor-canvas-container/index.js +4 -3
- package/build/components/editor-canvas-container/index.js.map +1 -1
- package/build/components/error-boundary/index.js +2 -1
- package/build/components/error-boundary/index.js.map +1 -1
- package/build/components/error-boundary/warning.js +4 -4
- package/build/components/error-boundary/warning.js.map +1 -1
- package/build/components/global-styles/block-preview-panel.js +5 -4
- package/build/components/global-styles/block-preview-panel.js.map +1 -1
- package/build/components/global-styles/color-indicator-wrapper.js +2 -2
- package/build/components/global-styles/color-indicator-wrapper.js.map +1 -1
- package/build/components/global-styles/color-palette-panel.js +5 -5
- package/build/components/global-styles/color-palette-panel.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +3 -2
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/font-families.js +14 -14
- package/build/components/global-styles/font-families.js.map +1 -1
- package/build/components/global-styles/font-family-item.js +6 -5
- package/build/components/global-styles/font-family-item.js.map +1 -1
- package/build/components/global-styles/font-library-modal/collection-font-details.js +9 -7
- package/build/components/global-styles/font-library-modal/collection-font-details.js.map +1 -1
- package/build/components/global-styles/font-library-modal/collection-font-variant.js +5 -5
- package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
- package/build/components/global-styles/font-library-modal/confirm-delete-dialog.js +2 -2
- package/build/components/global-styles/font-library-modal/confirm-delete-dialog.js.map +1 -1
- package/build/components/global-styles/font-library-modal/context.js +28 -31
- package/build/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-card.js +7 -7
- 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 +44 -23
- 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 +5 -4
- package/build/components/global-styles/font-library-modal/font-demo.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-variant.js +7 -7
- package/build/components/global-styles/font-library-modal/font-variant.js.map +1 -1
- package/build/components/global-styles/font-library-modal/fonts-grid.js +8 -7
- package/build/components/global-styles/font-library-modal/fonts-grid.js.map +1 -1
- package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +9 -9
- package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -1
- package/build/components/global-styles/font-library-modal/index.js +16 -8
- package/build/components/global-styles/font-library-modal/index.js.map +1 -1
- package/build/components/global-styles/font-library-modal/installed-fonts.js +39 -18
- package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/library-font-card.js +3 -2
- package/build/components/global-styles/font-library-modal/library-font-card.js.map +1 -1
- package/build/components/global-styles/font-library-modal/library-font-details.js +6 -6
- package/build/components/global-styles/font-library-modal/library-font-details.js.map +1 -1
- package/build/components/global-styles/font-library-modal/library-font-variant.js +5 -4
- package/build/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
- package/build/components/global-styles/font-library-modal/local-fonts.js +39 -11
- package/build/components/global-styles/font-library-modal/local-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/resolvers.js +1 -1
- package/build/components/global-styles/font-library-modal/resolvers.js.map +1 -1
- package/build/components/global-styles/font-library-modal/tab-layout.js +9 -9
- package/build/components/global-styles/font-library-modal/tab-layout.js.map +1 -1
- package/build/components/global-styles/font-library-modal/upload-fonts.js +26 -0
- package/build/components/global-styles/font-library-modal/upload-fonts.js.map +1 -0
- package/build/components/global-styles/font-library-modal/utils/fonts-outline.js +4 -1
- package/build/components/global-styles/font-library-modal/utils/fonts-outline.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/get-notice-from-response.js +71 -0
- package/build/components/global-styles/font-library-modal/utils/get-notice-from-response.js.map +1 -0
- package/build/components/global-styles/font-library-modal/utils/index.js +4 -1
- package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
- package/build/components/global-styles/global-styles-provider.js +3 -2
- package/build/components/global-styles/global-styles-provider.js.map +1 -1
- package/build/components/global-styles/gradients-palette-panel.js +8 -8
- package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build/components/global-styles/header.js +7 -7
- package/build/components/global-styles/header.js.map +1 -1
- package/build/components/global-styles/icon-with-current-color.js +2 -2
- package/build/components/global-styles/icon-with-current-color.js.map +1 -1
- package/build/components/global-styles/navigation-button.js +7 -7
- package/build/components/global-styles/navigation-button.js.map +1 -1
- package/build/components/global-styles/palette.js +11 -10
- package/build/components/global-styles/palette.js.map +1 -1
- package/build/components/global-styles/preview.js +17 -16
- package/build/components/global-styles/preview.js.map +1 -1
- package/build/components/global-styles/root-menu.js +4 -4
- package/build/components/global-styles/root-menu.js.map +1 -1
- package/build/components/global-styles/screen-block-list.js +10 -9
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-block.js +17 -16
- package/build/components/global-styles/screen-block.js.map +1 -1
- package/build/components/global-styles/screen-color-palette.js +5 -5
- package/build/components/global-styles/screen-color-palette.js.map +1 -1
- package/build/components/global-styles/screen-colors.js +5 -5
- package/build/components/global-styles/screen-colors.js.map +1 -1
- package/build/components/global-styles/screen-css.js +5 -5
- package/build/components/global-styles/screen-css.js.map +1 -1
- package/build/components/global-styles/screen-layout.js +3 -3
- package/build/components/global-styles/screen-layout.js.map +1 -1
- package/build/components/global-styles/screen-revisions/index.js +10 -9
- package/build/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js +10 -10
- package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build/components/global-styles/screen-root.js +14 -14
- package/build/components/global-styles/screen-root.js.map +1 -1
- package/build/components/global-styles/screen-style-variations.js +5 -4
- package/build/components/global-styles/screen-style-variations.js.map +1 -1
- package/build/components/global-styles/screen-typography-element.js +15 -14
- package/build/components/global-styles/screen-typography-element.js.map +1 -1
- package/build/components/global-styles/screen-typography.js +5 -5
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/style-variations-container.js +8 -7
- package/build/components/global-styles/style-variations-container.js.map +1 -1
- package/build/components/global-styles/subtitle.js +2 -2
- package/build/components/global-styles/subtitle.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +2 -2
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/typography-preview.js +2 -2
- package/build/components/global-styles/typography-preview.js.map +1 -1
- package/build/components/global-styles/typogrphy-elements.js +13 -13
- package/build/components/global-styles/typogrphy-elements.js.map +1 -1
- package/build/components/global-styles/ui.js +41 -40
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles/variations-panel.js +3 -3
- package/build/components/global-styles/variations-panel.js.map +1 -1
- package/build/components/header-edit-mode/document-actions/index.js +16 -15
- package/build/components/header-edit-mode/document-actions/index.js.map +1 -1
- package/build/components/header-edit-mode/index.js +20 -19
- package/build/components/header-edit-mode/index.js.map +1 -1
- package/build/components/header-edit-mode/mode-switcher/index.js +3 -3
- package/build/components/header-edit-mode/mode-switcher/index.js.map +1 -1
- package/build/components/header-edit-mode/more-menu/copy-content-menu-item.js +2 -2
- package/build/components/header-edit-mode/more-menu/copy-content-menu-item.js.map +1 -1
- package/build/components/header-edit-mode/more-menu/index.js +14 -14
- package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
- package/build/components/header-edit-mode/more-menu/site-export.js +2 -2
- package/build/components/header-edit-mode/more-menu/site-export.js.map +1 -1
- package/build/components/header-edit-mode/more-menu/welcome-guide-menu-item.js +2 -2
- package/build/components/header-edit-mode/more-menu/welcome-guide-menu-item.js.map +1 -1
- package/build/components/header-edit-mode/plugin-more-menu-item/index.js +1 -1
- package/build/components/header-edit-mode/plugin-more-menu-item/index.js.map +1 -1
- package/build/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js +3 -3
- package/build/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js.map +1 -1
- package/build/components/header-edit-mode/tools-more-menu-group/index.js +2 -2
- package/build/components/header-edit-mode/tools-more-menu-group/index.js.map +1 -1
- package/build/components/header-edit-mode/undo-redo/redo.js +3 -2
- package/build/components/header-edit-mode/undo-redo/redo.js.map +1 -1
- package/build/components/header-edit-mode/undo-redo/undo.js +3 -2
- package/build/components/header-edit-mode/undo-redo/undo.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +2 -2
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +15 -15
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/shortcut.js +8 -7
- package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build/components/layout/index.js +15 -14
- package/build/components/layout/index.js.map +1 -1
- package/build/components/list/added-by.js +9 -8
- package/build/components/list/added-by.js.map +1 -1
- package/build/components/list/header.js +5 -5
- package/build/components/list/header.js.map +1 -1
- package/build/components/list/index.js +5 -5
- package/build/components/list/index.js.map +1 -1
- package/build/components/list/table.js +15 -15
- package/build/components/list/table.js.map +1 -1
- package/build/components/page/header.js +6 -6
- package/build/components/page/header.js.map +1 -1
- package/build/components/page/index.js +5 -5
- package/build/components/page/index.js.map +1 -1
- package/build/components/page-actions/index.js +3 -3
- package/build/components/page-actions/index.js.map +1 -1
- package/build/components/page-actions/trash-page-menu-item.js +2 -2
- package/build/components/page-actions/trash-page-menu-item.js.map +1 -1
- package/build/components/page-content-focus-manager/disable-non-page-content-blocks.js +3 -2
- package/build/components/page-content-focus-manager/disable-non-page-content-blocks.js.map +1 -1
- package/build/components/page-content-focus-manager/edit-template-notification.js +3 -2
- package/build/components/page-content-focus-manager/edit-template-notification.js.map +1 -1
- package/build/components/page-content-focus-manager/index.js +35 -4
- package/build/components/page-content-focus-manager/index.js.map +1 -1
- package/build/components/page-main/index.js +7 -4
- package/build/components/page-main/index.js.map +1 -1
- package/build/components/page-pages/index.js +174 -0
- package/build/components/page-pages/index.js.map +1 -0
- package/build/components/page-patterns/duplicate-menu-item.js +2 -2
- package/build/components/page-patterns/duplicate-menu-item.js.map +1 -1
- package/build/components/page-patterns/grid-item.js +21 -20
- package/build/components/page-patterns/grid-item.js.map +1 -1
- package/build/components/page-patterns/grid.js +3 -4
- package/build/components/page-patterns/grid.js.map +1 -1
- package/build/components/page-patterns/header.js +4 -4
- package/build/components/page-patterns/header.js.map +1 -1
- package/build/components/page-patterns/index.js +4 -4
- package/build/components/page-patterns/index.js.map +1 -1
- package/build/components/page-patterns/no-patterns.js +2 -2
- package/build/components/page-patterns/no-patterns.js.map +1 -1
- package/build/components/page-patterns/pagination.js +10 -10
- package/build/components/page-patterns/pagination.js.map +1 -1
- package/build/components/page-patterns/patterns-list.js +16 -15
- package/build/components/page-patterns/patterns-list.js.map +1 -1
- package/build/components/page-patterns/rename-menu-item.js +10 -9
- package/build/components/page-patterns/rename-menu-item.js.map +1 -1
- package/build/components/page-patterns/use-patterns.js +5 -1
- package/build/components/page-patterns/use-patterns.js.map +1 -1
- package/build/components/page-template-parts/add-new-template-part.js +4 -3
- package/build/components/page-template-parts/add-new-template-part.js.map +1 -1
- package/build/components/page-template-parts/index.js +21 -10
- package/build/components/page-template-parts/index.js.map +1 -1
- package/build/components/page-templates/index.js +10 -10
- package/build/components/page-templates/index.js.map +1 -1
- package/build/components/plugin-template-setting-panel/index.js +1 -1
- package/build/components/plugin-template-setting-panel/index.js.map +1 -1
- package/build/components/preferences-modal/enable-feature.js +2 -2
- package/build/components/preferences-modal/enable-feature.js.map +1 -1
- package/build/components/preferences-modal/index.js +12 -11
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/resizable-frame/index.js +7 -6
- package/build/components/resizable-frame/index.js.map +1 -1
- package/build/components/revisions/index.js +9 -8
- package/build/components/revisions/index.js.map +1 -1
- package/build/components/routes/link.js +2 -2
- package/build/components/routes/link.js.map +1 -1
- package/build/components/save-button/index.js +2 -2
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/save-hub/index.js +4 -4
- package/build/components/save-hub/index.js.map +1 -1
- package/build/components/save-panel/index.js +11 -11
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/secondary-sidebar/inserter-sidebar.js +7 -6
- package/build/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
- package/build/components/secondary-sidebar/list-view-sidebar.js +7 -6
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build/components/sidebar/index.js +23 -14
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-button/index.js +2 -2
- package/build/components/sidebar-button/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/default-sidebar.js +3 -3
- package/build/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js +8 -7
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build/components/sidebar-edit-mode/index.js +6 -5
- package/build/components/sidebar-edit-mode/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/edit-template.js +20 -10
- package/build/components/sidebar-edit-mode/page-panels/edit-template.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/index.js +7 -7
- package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/page-content.js +3 -2
- package/build/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/page-status.js +21 -20
- package/build/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/page-summary.js +4 -4
- package/build/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/publish-date.js +7 -6
- package/build/components/sidebar-edit-mode/page-panels/publish-date.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/reset-default-template.js +3 -3
- package/build/components/sidebar-edit-mode/page-panels/reset-default-template.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/swap-template-button.js +7 -6
- package/build/components/sidebar-edit-mode/page-panels/swap-template-button.js.map +1 -1
- package/build/components/sidebar-edit-mode/plugin-sidebar/index.js +2 -2
- package/build/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/settings-header/index.js +3 -3
- package/build/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/sidebar-card/index.js +7 -7
- package/build/components/sidebar-edit-mode/sidebar-card/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js +2 -2
- package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-panel/hooks.js +71 -0
- package/build/components/sidebar-edit-mode/template-panel/hooks.js.map +1 -0
- package/build/components/sidebar-edit-mode/template-panel/index.js +5 -5
- package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-panel/last-revision.js +5 -5
- 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 +5 -4
- package/build/components/sidebar-edit-mode/template-panel/pattern-categories.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-panel/replace-template-button.js +83 -0
- package/build/components/sidebar-edit-mode/template-panel/replace-template-button.js.map +1 -0
- package/build/components/sidebar-edit-mode/template-panel/template-actions.js +12 -5
- package/build/components/sidebar-edit-mode/template-panel/template-actions.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-panel/template-areas.js +8 -8
- package/build/components/sidebar-edit-mode/template-panel/template-areas.js.map +1 -1
- package/build/components/sidebar-navigation-item/index.js +5 -5
- package/build/components/sidebar-navigation-item/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen/index.js +11 -11
- package/build/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-details-footer/index.js +8 -7
- package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-details-panel/index.js +3 -3
- package/build/components/sidebar-navigation-screen-details-panel/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js +2 -2
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js.map +1 -1
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +2 -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-details-panel/sidebar-navigation-screen-details-panel-value.js +2 -2
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js +12 -11
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/index.js +9 -8
- package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/template-part-hint.js +2 -2
- package/build/components/sidebar-navigation-screen-main/template-part-hint.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-item/index.js +4 -4
- package/build/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +2 -2
- package/build/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js +2 -2
- package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js +7 -7
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js +8 -7
- package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +4 -3
- package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +9 -8
- package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +5 -5
- package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js +8 -8
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +7 -6
- package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +5 -4
- package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/index.js +11 -11
- package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/page-details.js +6 -6
- package/build/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/status-label.js +5 -4
- package/build/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pages/index.js +26 -17
- package/build/components/sidebar-navigation-screen-pages/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/index.js +4 -4
- package/build/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +5 -3
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js +3 -3
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +6 -4
- 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 +4 -4
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +10 -3
- package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js +7 -7
- package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/category-item.js +3 -3
- package/build/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/index.js +27 -15
- package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-template/home-template-details.js +26 -30
- package/build/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -1
- package/build/components/sidebar-navigation-screen-template/index.js +12 -12
- package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates/index.js +6 -6
- package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/index.js +17 -5
- package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build/components/site-hub/index.js +12 -11
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/site-icon/index.js +5 -5
- package/build/components/site-icon/index.js.map +1 -1
- package/build/components/start-template-options/index.js +10 -9
- package/build/components/start-template-options/index.js.map +1 -1
- package/build/components/style-book/index.js +19 -18
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/table/index.js +6 -6
- package/build/components/table/index.js.map +1 -1
- package/build/components/template-actions/index.js +8 -7
- package/build/components/template-actions/index.js.map +1 -1
- package/build/components/template-actions/rename-menu-item.js +10 -9
- package/build/components/template-actions/rename-menu-item.js.map +1 -1
- package/build/components/template-part-converter/convert-to-regular.js +2 -2
- package/build/components/template-part-converter/convert-to-regular.js.map +1 -1
- package/build/components/template-part-converter/convert-to-template-part.js +4 -3
- package/build/components/template-part-converter/convert-to-template-part.js.map +1 -1
- package/build/components/template-part-converter/index.js +5 -5
- package/build/components/template-part-converter/index.js.map +1 -1
- package/build/components/welcome-guide/editor.js +8 -7
- package/build/components/welcome-guide/editor.js.map +1 -1
- package/build/components/welcome-guide/image.js +4 -4
- package/build/components/welcome-guide/image.js.map +1 -1
- package/build/components/welcome-guide/index.js +2 -2
- package/build/components/welcome-guide/index.js.map +1 -1
- package/build/components/welcome-guide/page.js +6 -6
- package/build/components/welcome-guide/page.js.map +1 -1
- package/build/components/welcome-guide/styles.js +15 -15
- package/build/components/welcome-guide/styles.js.map +1 -1
- package/build/components/welcome-guide/template.js +6 -6
- package/build/components/welcome-guide/template.js.map +1 -1
- package/build/hooks/commands/use-common-commands.js +2 -2
- package/build/hooks/commands/use-common-commands.js.map +1 -1
- package/build/hooks/navigation-menu-edit.js +5 -5
- package/build/hooks/navigation-menu-edit.js.map +1 -1
- package/build/hooks/push-changes-to-global-styles/index.js +6 -5
- package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build/hooks/template-part-edit.js +5 -5
- package/build/hooks/template-part-edit.js.map +1 -1
- package/build/index.js +3 -2
- package/build/index.js.map +1 -1
- package/build/utils/constants.js +1 -1
- package/build/utils/constants.js.map +1 -1
- package/build/utils/get-is-list-page.js +1 -1
- package/build/utils/get-is-list-page.js.map +1 -1
- package/build-module/components/add-new-page/index.js +1 -1
- package/build-module/components/add-new-pattern/index.js +8 -12
- package/build-module/components/add-new-pattern/index.js.map +1 -1
- package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js +1 -1
- package/build-module/components/add-new-template/add-custom-template-modal-content.js +1 -1
- package/build-module/components/add-new-template/index.js +1 -1
- package/build-module/components/add-new-template/new-template.js +1 -1
- package/build-module/components/add-new-template/template-actions-loading-screen.js +1 -1
- package/build-module/components/app/index.js +1 -1
- package/build-module/components/block-editor/back-button.js +1 -1
- package/build-module/components/block-editor/block-editor-provider/default-block-editor-provider.js +9 -5
- package/build-module/components/block-editor/block-editor-provider/default-block-editor-provider.js.map +1 -1
- package/build-module/components/block-editor/block-editor-provider/index.js +1 -1
- package/build-module/components/block-editor/block-editor-provider/navigation-block-editor-provider.js +1 -1
- package/build-module/components/block-editor/block-editor-provider/use-page-content-blocks.js +19 -11
- package/build-module/components/block-editor/block-editor-provider/use-page-content-blocks.js.map +1 -1
- package/build-module/components/block-editor/block-inspector-button.js +1 -1
- package/build-module/components/block-editor/editor-canvas.js +1 -1
- package/build-module/components/block-editor/index.js +1 -1
- package/build-module/components/block-editor/resizable-editor.js +1 -1
- package/build-module/components/block-editor/resize-handle.js +1 -1
- package/build-module/components/block-editor/site-editor-canvas.js +1 -1
- package/build-module/components/canvas-loader/index.js +1 -1
- package/build-module/components/code-editor/index.js +1 -1
- package/build-module/components/create-template-part-modal/index.js +1 -1
- package/build-module/components/dataviews/dataviews.js +53 -0
- package/build-module/components/dataviews/dataviews.js.map +1 -0
- package/build-module/components/dataviews/index.js +3 -0
- package/build-module/components/dataviews/index.js.map +1 -0
- package/build-module/components/dataviews/list-view.js +80 -0
- package/build-module/components/dataviews/list-view.js.map +1 -0
- package/build-module/components/dataviews/pagination.js +83 -0
- package/build-module/components/dataviews/pagination.js.map +1 -0
- package/build-module/components/dataviews/text-filter.js +36 -0
- package/build-module/components/dataviews/text-filter.js.map +1 -0
- package/build-module/components/dataviews/view-actions.js +179 -0
- package/build-module/components/dataviews/view-actions.js.map +1 -0
- package/build-module/components/editor/index.js +1 -1
- package/build-module/components/editor-canvas-container/index.js +1 -1
- package/build-module/components/error-boundary/index.js +1 -1
- package/build-module/components/error-boundary/warning.js +1 -1
- package/build-module/components/global-styles/block-preview-panel.js +1 -1
- package/build-module/components/global-styles/color-indicator-wrapper.js +1 -1
- package/build-module/components/global-styles/color-palette-panel.js +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +1 -1
- package/build-module/components/global-styles/font-families.js +3 -4
- package/build-module/components/global-styles/font-families.js.map +1 -1
- package/build-module/components/global-styles/font-family-item.js +1 -1
- package/build-module/components/global-styles/font-library-modal/collection-font-details.js +4 -2
- package/build-module/components/global-styles/font-library-modal/collection-font-details.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/collection-font-variant.js +1 -1
- package/build-module/components/global-styles/font-library-modal/confirm-delete-dialog.js +1 -1
- package/build-module/components/global-styles/font-library-modal/context.js +27 -31
- 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 +1 -1
- package/build-module/components/global-styles/font-library-modal/font-collection.js +33 -13
- 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 +1 -1
- package/build-module/components/global-styles/font-library-modal/font-variant.js +1 -1
- package/build-module/components/global-styles/font-library-modal/fonts-grid.js +1 -1
- package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +1 -1
- package/build-module/components/global-styles/font-library-modal/index.js +11 -4
- 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 +29 -9
- 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-card.js +1 -1
- package/build-module/components/global-styles/font-library-modal/library-font-details.js +1 -1
- package/build-module/components/global-styles/font-library-modal/library-font-variant.js +1 -1
- package/build-module/components/global-styles/font-library-modal/local-fonts.js +39 -12
- package/build-module/components/global-styles/font-library-modal/local-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/resolvers.js +1 -1
- package/build-module/components/global-styles/font-library-modal/resolvers.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/tab-layout.js +1 -1
- package/build-module/components/global-styles/font-library-modal/upload-fonts.js +17 -0
- package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js +4 -1
- package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/get-notice-from-response.js +63 -0
- package/build-module/components/global-styles/font-library-modal/utils/get-notice-from-response.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/utils/index.js +4 -1
- package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
- package/build-module/components/global-styles/global-styles-provider.js +1 -1
- package/build-module/components/global-styles/gradients-palette-panel.js +1 -1
- package/build-module/components/global-styles/header.js +1 -1
- package/build-module/components/global-styles/icon-with-current-color.js +1 -1
- package/build-module/components/global-styles/navigation-button.js +1 -1
- package/build-module/components/global-styles/palette.js +1 -1
- package/build-module/components/global-styles/preview.js +1 -1
- package/build-module/components/global-styles/root-menu.js +1 -1
- package/build-module/components/global-styles/screen-block-list.js +1 -1
- package/build-module/components/global-styles/screen-block.js +1 -1
- package/build-module/components/global-styles/screen-color-palette.js +1 -1
- package/build-module/components/global-styles/screen-colors.js +1 -1
- package/build-module/components/global-styles/screen-css.js +1 -1
- package/build-module/components/global-styles/screen-layout.js +1 -1
- package/build-module/components/global-styles/screen-revisions/index.js +1 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +1 -1
- package/build-module/components/global-styles/screen-root.js +1 -1
- package/build-module/components/global-styles/screen-style-variations.js +1 -1
- package/build-module/components/global-styles/screen-typography-element.js +1 -1
- package/build-module/components/global-styles/screen-typography.js +2 -2
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/style-variations-container.js +1 -1
- package/build-module/components/global-styles/subtitle.js +1 -1
- package/build-module/components/global-styles/typography-panel.js +1 -1
- package/build-module/components/global-styles/typography-preview.js +1 -1
- package/build-module/components/global-styles/typogrphy-elements.js +1 -1
- package/build-module/components/global-styles/ui.js +1 -1
- package/build-module/components/global-styles/variations-panel.js +1 -1
- package/build-module/components/header-edit-mode/document-actions/index.js +1 -1
- package/build-module/components/header-edit-mode/index.js +1 -1
- package/build-module/components/header-edit-mode/mode-switcher/index.js +1 -1
- package/build-module/components/header-edit-mode/more-menu/copy-content-menu-item.js +1 -1
- package/build-module/components/header-edit-mode/more-menu/index.js +1 -1
- package/build-module/components/header-edit-mode/more-menu/site-export.js +1 -1
- package/build-module/components/header-edit-mode/more-menu/welcome-guide-menu-item.js +1 -1
- package/build-module/components/header-edit-mode/plugin-more-menu-item/index.js +1 -1
- package/build-module/components/header-edit-mode/plugin-more-menu-item/index.js.map +1 -1
- package/build-module/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js +2 -2
- package/build-module/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js.map +1 -1
- package/build-module/components/header-edit-mode/tools-more-menu-group/index.js +1 -1
- package/build-module/components/header-edit-mode/undo-redo/redo.js +1 -1
- package/build-module/components/header-edit-mode/undo-redo/undo.js +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +1 -1
- package/build-module/components/layout/index.js +1 -1
- package/build-module/components/list/added-by.js +1 -1
- package/build-module/components/list/header.js +1 -1
- package/build-module/components/list/index.js +1 -1
- package/build-module/components/list/table.js +1 -1
- package/build-module/components/page/header.js +1 -1
- package/build-module/components/page/index.js +1 -1
- package/build-module/components/page-actions/index.js +1 -1
- package/build-module/components/page-actions/trash-page-menu-item.js +1 -1
- package/build-module/components/page-content-focus-manager/disable-non-page-content-blocks.js +1 -1
- package/build-module/components/page-content-focus-manager/edit-template-notification.js +1 -1
- package/build-module/components/page-content-focus-manager/index.js +34 -4
- package/build-module/components/page-content-focus-manager/index.js.map +1 -1
- package/build-module/components/page-main/index.js +4 -1
- package/build-module/components/page-main/index.js.map +1 -1
- package/build-module/components/page-pages/index.js +166 -0
- package/build-module/components/page-pages/index.js.map +1 -0
- package/build-module/components/page-patterns/duplicate-menu-item.js +1 -1
- package/build-module/components/page-patterns/grid-item.js +1 -1
- package/build-module/components/page-patterns/grid.js +1 -2
- package/build-module/components/page-patterns/grid.js.map +1 -1
- package/build-module/components/page-patterns/header.js +1 -1
- package/build-module/components/page-patterns/index.js +1 -1
- package/build-module/components/page-patterns/no-patterns.js +1 -1
- package/build-module/components/page-patterns/pagination.js +1 -1
- package/build-module/components/page-patterns/patterns-list.js +2 -2
- package/build-module/components/page-patterns/patterns-list.js.map +1 -1
- package/build-module/components/page-patterns/rename-menu-item.js +1 -1
- package/build-module/components/page-patterns/use-patterns.js +5 -1
- package/build-module/components/page-patterns/use-patterns.js.map +1 -1
- package/build-module/components/page-template-parts/add-new-template-part.js +1 -1
- package/build-module/components/page-template-parts/index.js +13 -2
- package/build-module/components/page-template-parts/index.js.map +1 -1
- package/build-module/components/page-templates/index.js +1 -1
- package/build-module/components/plugin-template-setting-panel/index.js +1 -1
- package/build-module/components/plugin-template-setting-panel/index.js.map +1 -1
- package/build-module/components/preferences-modal/enable-feature.js +1 -1
- package/build-module/components/preferences-modal/index.js +1 -1
- package/build-module/components/resizable-frame/index.js +1 -1
- package/build-module/components/revisions/index.js +1 -1
- package/build-module/components/routes/link.js +1 -1
- package/build-module/components/save-button/index.js +1 -1
- package/build-module/components/save-hub/index.js +1 -1
- package/build-module/components/save-panel/index.js +1 -1
- package/build-module/components/secondary-sidebar/inserter-sidebar.js +1 -1
- package/build-module/components/secondary-sidebar/list-view-sidebar.js +1 -1
- package/build-module/components/sidebar/index.js +10 -2
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-button/index.js +1 -1
- package/build-module/components/sidebar-edit-mode/default-sidebar.js +1 -1
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +1 -1
- package/build-module/components/sidebar-edit-mode/index.js +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/edit-template.js +15 -5
- package/build-module/components/sidebar-edit-mode/page-panels/edit-template.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/index.js +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/page-content.js +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/page-status.js +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/publish-date.js +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/reset-default-template.js +2 -2
- package/build-module/components/sidebar-edit-mode/page-panels/reset-default-template.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/swap-template-button.js +1 -1
- package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js +1 -1
- package/build-module/components/sidebar-edit-mode/settings-header/index.js +1 -1
- package/build-module/components/sidebar-edit-mode/sidebar-card/index.js +1 -1
- package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js +1 -1
- package/build-module/components/sidebar-edit-mode/template-panel/hooks.js +64 -0
- package/build-module/components/sidebar-edit-mode/template-panel/hooks.js.map +1 -0
- package/build-module/components/sidebar-edit-mode/template-panel/index.js +1 -1
- package/build-module/components/sidebar-edit-mode/template-panel/last-revision.js +1 -1
- package/build-module/components/sidebar-edit-mode/template-panel/pattern-categories.js +4 -4
- package/build-module/components/sidebar-edit-mode/template-panel/pattern-categories.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/template-panel/replace-template-button.js +76 -0
- package/build-module/components/sidebar-edit-mode/template-panel/replace-template-button.js.map +1 -0
- package/build-module/components/sidebar-edit-mode/template-panel/template-actions.js +11 -4
- package/build-module/components/sidebar-edit-mode/template-panel/template-actions.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/template-panel/template-areas.js +2 -2
- package/build-module/components/sidebar-edit-mode/template-panel/template-areas.js.map +1 -1
- package/build-module/components/sidebar-navigation-item/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen-details-footer/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen-details-panel/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js +1 -1
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +1 -1
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen-main/template-part-hint.js +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-item/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +1 -1
- package/build-module/components/sidebar-navigation-screen-page/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen-page/page-details.js +1 -1
- package/build-module/components/sidebar-navigation-screen-page/status-label.js +1 -1
- package/build-module/components/sidebar-navigation-screen-pages/index.js +13 -5
- package/build-module/components/sidebar-navigation-screen-pages/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +4 -2
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +4 -2
- 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 +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +8 -2
- package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/category-item.js +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/index.js +15 -3
- package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-template/home-template-details.js +15 -20
- package/build-module/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-template/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen-templates/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +17 -5
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build-module/components/site-hub/index.js +1 -1
- package/build-module/components/site-icon/index.js +1 -1
- package/build-module/components/start-template-options/index.js +4 -4
- package/build-module/components/start-template-options/index.js.map +1 -1
- package/build-module/components/style-book/index.js +1 -1
- package/build-module/components/table/index.js +1 -1
- package/build-module/components/template-actions/index.js +1 -1
- package/build-module/components/template-actions/rename-menu-item.js +1 -1
- package/build-module/components/template-part-converter/convert-to-regular.js +1 -1
- package/build-module/components/template-part-converter/convert-to-template-part.js +1 -1
- package/build-module/components/template-part-converter/index.js +1 -1
- package/build-module/components/welcome-guide/editor.js +1 -1
- package/build-module/components/welcome-guide/image.js +1 -1
- package/build-module/components/welcome-guide/index.js +1 -1
- package/build-module/components/welcome-guide/page.js +1 -1
- package/build-module/components/welcome-guide/styles.js +1 -1
- package/build-module/components/welcome-guide/template.js +1 -1
- package/build-module/hooks/commands/use-common-commands.js +4 -4
- package/build-module/hooks/commands/use-common-commands.js.map +1 -1
- package/build-module/hooks/navigation-menu-edit.js +1 -1
- package/build-module/hooks/push-changes-to-global-styles/index.js +1 -1
- package/build-module/hooks/template-part-edit.js +1 -1
- package/build-module/index.js +1 -1
- package/build-module/utils/constants.js +1 -1
- package/build-module/utils/constants.js.map +1 -1
- package/build-module/utils/get-is-list-page.js +1 -1
- package/build-module/utils/get-is-list-page.js.map +1 -1
- package/build-style/style-rtl.css +93 -18
- package/build-style/style.css +93 -18
- package/package.json +41 -40
- package/src/components/add-new-pattern/index.js +7 -10
- package/src/components/block-editor/block-editor-provider/default-block-editor-provider.js +10 -5
- package/src/components/block-editor/block-editor-provider/test/use-page-content-blocks.js +33 -4
- package/src/components/block-editor/block-editor-provider/use-page-content-blocks.js +27 -14
- package/src/components/dataviews/dataviews.js +60 -0
- package/src/components/dataviews/index.js +2 -0
- package/src/components/dataviews/list-view.js +106 -0
- package/src/components/dataviews/pagination.js +118 -0
- package/src/components/dataviews/style.scss +36 -0
- package/src/components/dataviews/text-filter.js +37 -0
- package/src/components/dataviews/view-actions.js +246 -0
- package/src/components/global-styles/font-families.js +1 -5
- package/src/components/global-styles/font-library-modal/collection-font-details.js +1 -1
- package/src/components/global-styles/font-library-modal/context.js +36 -38
- package/src/components/global-styles/font-library-modal/font-collection.js +41 -12
- package/src/components/global-styles/font-library-modal/index.js +16 -6
- package/src/components/global-styles/font-library-modal/installed-fonts.js +36 -6
- package/src/components/global-styles/font-library-modal/local-fonts.js +65 -23
- package/src/components/global-styles/font-library-modal/resolvers.js +1 -1
- package/src/components/global-styles/font-library-modal/style.scss +18 -1
- package/src/components/global-styles/font-library-modal/upload-fonts.js +20 -0
- package/src/components/global-styles/font-library-modal/utils/fonts-outline.js +4 -3
- package/src/components/global-styles/font-library-modal/utils/get-notice-from-response.js +62 -0
- package/src/components/global-styles/font-library-modal/utils/index.js +5 -1
- package/src/components/global-styles/font-library-modal/utils/test/makeFormDataFromFontFamilies.spec.js +1 -1
- package/src/components/global-styles/screen-typography.js +3 -4
- package/src/components/header-edit-mode/plugin-more-menu-item/index.js +1 -1
- package/src/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js +1 -1
- package/src/components/page-content-focus-manager/index.js +29 -4
- package/src/components/page-main/index.js +3 -0
- package/src/components/page-pages/index.js +190 -0
- package/src/components/page-patterns/grid.js +1 -1
- package/src/components/page-patterns/patterns-list.js +1 -1
- package/src/components/page-patterns/use-patterns.js +7 -3
- package/src/components/page-template-parts/index.js +14 -1
- package/src/components/plugin-template-setting-panel/index.js +1 -1
- package/src/components/sidebar/index.js +11 -0
- package/src/components/sidebar-edit-mode/page-panels/edit-template.js +31 -16
- package/src/components/sidebar-edit-mode/page-panels/reset-default-template.js +1 -1
- package/src/components/sidebar-edit-mode/template-panel/hooks.js +97 -0
- package/src/components/sidebar-edit-mode/template-panel/pattern-categories.js +18 -16
- package/src/components/sidebar-edit-mode/template-panel/replace-template-button.js +89 -0
- package/src/components/sidebar-edit-mode/template-panel/style.scss +18 -0
- package/src/components/sidebar-edit-mode/template-panel/template-actions.js +27 -12
- package/src/components/sidebar-edit-mode/template-panel/template-areas.js +1 -1
- package/src/components/sidebar-navigation-screen/style.scss +0 -1
- package/src/components/sidebar-navigation-screen-pages/index.js +11 -4
- package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +3 -1
- package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +3 -1
- package/src/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +11 -5
- package/src/components/sidebar-navigation-screen-patterns/index.js +25 -4
- package/src/components/sidebar-navigation-screen-template/home-template-details.js +27 -35
- package/src/components/sidebar-navigation-screen-templates-browse/index.js +12 -4
- package/src/components/start-template-options/index.js +3 -3
- package/src/hooks/commands/use-common-commands.js +12 -4
- package/src/style.scss +1 -0
- package/src/utils/constants.js +1 -1
- package/src/utils/get-is-list-page.js +3 -2
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { createElement, Fragment } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* WordPress dependencies
|
|
4
|
+
*/
|
|
5
|
+
import { Button, Icon, SelectControl, privateApis as componentsPrivateApis, __experimentalInputControlPrefixWrapper as InputControlPrefixWrapper } from '@wordpress/components';
|
|
6
|
+
import { chevronRightSmall, check, blockTable, chevronDown, arrowUp, arrowDown } from '@wordpress/icons';
|
|
7
|
+
import { __ } from '@wordpress/i18n';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Internal dependencies
|
|
11
|
+
*/
|
|
12
|
+
import { unlock } from '../../lock-unlock';
|
|
13
|
+
const {
|
|
14
|
+
DropdownMenuV2,
|
|
15
|
+
DropdownMenuGroupV2,
|
|
16
|
+
DropdownMenuItemV2,
|
|
17
|
+
DropdownSubMenuV2,
|
|
18
|
+
DropdownSubMenuTriggerV2
|
|
19
|
+
} = unlock(componentsPrivateApis);
|
|
20
|
+
export const PAGE_SIZE_VALUES = [5, 20, 50];
|
|
21
|
+
export function PageSizeControl({
|
|
22
|
+
dataView
|
|
23
|
+
}) {
|
|
24
|
+
const label = __('Rows per page:');
|
|
25
|
+
return createElement(SelectControl, {
|
|
26
|
+
__nextHasNoMarginBottom: true,
|
|
27
|
+
label: label,
|
|
28
|
+
hideLabelFromVision: true
|
|
29
|
+
// TODO: This should probably use a label based on the wanted design
|
|
30
|
+
// and we could remove InputControlPrefixWrapper usage.
|
|
31
|
+
,
|
|
32
|
+
prefix: createElement(InputControlPrefixWrapper, {
|
|
33
|
+
as: "span",
|
|
34
|
+
className: "dataviews__per-page-control-prefix"
|
|
35
|
+
}, label),
|
|
36
|
+
value: dataView.getState().pagination.pageSize,
|
|
37
|
+
options: PAGE_SIZE_VALUES.map(pageSize => ({
|
|
38
|
+
value: pageSize,
|
|
39
|
+
label: pageSize
|
|
40
|
+
})),
|
|
41
|
+
onChange: value => dataView.setPageSize(+value)
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
function PageSizeMenu({
|
|
45
|
+
dataView
|
|
46
|
+
}) {
|
|
47
|
+
const currenPageSize = dataView.getState().pagination.pageSize;
|
|
48
|
+
return createElement(DropdownSubMenuV2, {
|
|
49
|
+
trigger: createElement(DropdownSubMenuTriggerV2, {
|
|
50
|
+
suffix: createElement(Fragment, null, currenPageSize, createElement(Icon, {
|
|
51
|
+
icon: chevronRightSmall
|
|
52
|
+
}))
|
|
53
|
+
}, __('Rows per page'))
|
|
54
|
+
}, PAGE_SIZE_VALUES.map(size => {
|
|
55
|
+
return createElement(DropdownMenuItemV2, {
|
|
56
|
+
key: size,
|
|
57
|
+
prefix: currenPageSize === size && createElement(Icon, {
|
|
58
|
+
icon: check
|
|
59
|
+
}),
|
|
60
|
+
onSelect: event => {
|
|
61
|
+
// We need to handle this on DropDown component probably..
|
|
62
|
+
event.preventDefault();
|
|
63
|
+
dataView.setPageSize(size);
|
|
64
|
+
}
|
|
65
|
+
// TODO: check about role and a11y.
|
|
66
|
+
,
|
|
67
|
+
role: "menuitemcheckbox"
|
|
68
|
+
}, size);
|
|
69
|
+
}));
|
|
70
|
+
}
|
|
71
|
+
function FieldsVisibilityMenu({
|
|
72
|
+
dataView
|
|
73
|
+
}) {
|
|
74
|
+
const hideableFields = dataView.getAllColumns().filter(columnn => columnn.getCanHide());
|
|
75
|
+
if (!hideableFields?.length) {
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
return createElement(DropdownSubMenuV2, {
|
|
79
|
+
trigger: createElement(DropdownSubMenuTriggerV2, {
|
|
80
|
+
suffix: createElement(Icon, {
|
|
81
|
+
icon: chevronRightSmall
|
|
82
|
+
})
|
|
83
|
+
}, __('Fields'))
|
|
84
|
+
}, hideableFields?.map(field => {
|
|
85
|
+
return createElement(DropdownMenuItemV2, {
|
|
86
|
+
key: field.id,
|
|
87
|
+
prefix: field.getIsVisible() && createElement(Icon, {
|
|
88
|
+
icon: check
|
|
89
|
+
}),
|
|
90
|
+
onSelect: event => {
|
|
91
|
+
event.preventDefault();
|
|
92
|
+
field.getToggleVisibilityHandler()(event);
|
|
93
|
+
},
|
|
94
|
+
role: "menuitemcheckbox"
|
|
95
|
+
}, field.columnDef.header);
|
|
96
|
+
}));
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// This object is used to construct the sorting options per sortable field.
|
|
100
|
+
const sortingItemsInfo = {
|
|
101
|
+
asc: {
|
|
102
|
+
icon: arrowUp,
|
|
103
|
+
label: __('Sort ascending')
|
|
104
|
+
},
|
|
105
|
+
desc: {
|
|
106
|
+
icon: arrowDown,
|
|
107
|
+
label: __('Sort descending')
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
function SortMenu({
|
|
111
|
+
dataView
|
|
112
|
+
}) {
|
|
113
|
+
const sortableFields = dataView.getAllColumns().filter(columnn => columnn.getCanSort());
|
|
114
|
+
if (!sortableFields?.length) {
|
|
115
|
+
return null;
|
|
116
|
+
}
|
|
117
|
+
const currentSortedField = sortableFields.find(field => field.getIsSorted());
|
|
118
|
+
return createElement(DropdownSubMenuV2, {
|
|
119
|
+
trigger: createElement(DropdownSubMenuTriggerV2, {
|
|
120
|
+
suffix: createElement(Fragment, null, currentSortedField?.columnDef.header, createElement(Icon, {
|
|
121
|
+
icon: chevronRightSmall
|
|
122
|
+
}))
|
|
123
|
+
}, __('Sort by'))
|
|
124
|
+
}, sortableFields?.map(field => {
|
|
125
|
+
const sortedDirection = field.getIsSorted();
|
|
126
|
+
return createElement(DropdownSubMenuV2, {
|
|
127
|
+
key: field.id,
|
|
128
|
+
trigger: createElement(DropdownSubMenuTriggerV2, {
|
|
129
|
+
suffix: createElement(Icon, {
|
|
130
|
+
icon: chevronRightSmall
|
|
131
|
+
})
|
|
132
|
+
}, field.columnDef.header),
|
|
133
|
+
side: "left"
|
|
134
|
+
}, Object.entries(sortingItemsInfo).map(([direction, info]) => {
|
|
135
|
+
return createElement(DropdownMenuItemV2, {
|
|
136
|
+
key: direction,
|
|
137
|
+
prefix: createElement(Icon, {
|
|
138
|
+
icon: info.icon
|
|
139
|
+
}),
|
|
140
|
+
suffix: sortedDirection === direction && createElement(Icon, {
|
|
141
|
+
icon: check
|
|
142
|
+
}),
|
|
143
|
+
onSelect: event => {
|
|
144
|
+
event.preventDefault();
|
|
145
|
+
if (sortedDirection === direction) {
|
|
146
|
+
dataView.resetSorting();
|
|
147
|
+
} else {
|
|
148
|
+
dataView.setSorting([{
|
|
149
|
+
id: field.id,
|
|
150
|
+
desc: direction === 'desc'
|
|
151
|
+
}]);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}, info.label);
|
|
155
|
+
}));
|
|
156
|
+
}));
|
|
157
|
+
}
|
|
158
|
+
export default function ViewActions({
|
|
159
|
+
dataView,
|
|
160
|
+
className
|
|
161
|
+
}) {
|
|
162
|
+
return createElement(DropdownMenuV2, {
|
|
163
|
+
label: __('Actions'),
|
|
164
|
+
className: className,
|
|
165
|
+
trigger: createElement(Button, {
|
|
166
|
+
variant: "tertiary",
|
|
167
|
+
icon: blockTable
|
|
168
|
+
}, __('View'), createElement(Icon, {
|
|
169
|
+
icon: chevronDown
|
|
170
|
+
}))
|
|
171
|
+
}, createElement(DropdownMenuGroupV2, null, createElement(SortMenu, {
|
|
172
|
+
dataView: dataView
|
|
173
|
+
}), createElement(FieldsVisibilityMenu, {
|
|
174
|
+
dataView: dataView
|
|
175
|
+
}), createElement(PageSizeMenu, {
|
|
176
|
+
dataView: dataView
|
|
177
|
+
})));
|
|
178
|
+
}
|
|
179
|
+
//# sourceMappingURL=view-actions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Button","Icon","SelectControl","privateApis","componentsPrivateApis","__experimentalInputControlPrefixWrapper","InputControlPrefixWrapper","chevronRightSmall","check","blockTable","chevronDown","arrowUp","arrowDown","__","unlock","DropdownMenuV2","DropdownMenuGroupV2","DropdownMenuItemV2","DropdownSubMenuV2","DropdownSubMenuTriggerV2","PAGE_SIZE_VALUES","PageSizeControl","dataView","label","createElement","__nextHasNoMarginBottom","hideLabelFromVision","prefix","as","className","value","getState","pagination","pageSize","options","map","onChange","setPageSize","PageSizeMenu","currenPageSize","trigger","suffix","Fragment","icon","size","key","onSelect","event","preventDefault","role","FieldsVisibilityMenu","hideableFields","getAllColumns","filter","columnn","getCanHide","length","field","id","getIsVisible","getToggleVisibilityHandler","columnDef","header","sortingItemsInfo","asc","desc","SortMenu","sortableFields","getCanSort","currentSortedField","find","getIsSorted","sortedDirection","side","Object","entries","direction","info","resetSorting","setSorting","ViewActions","variant"],"sources":["@wordpress/edit-site/src/components/dataviews/view-actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\tIcon,\n\tSelectControl,\n\tprivateApis as componentsPrivateApis,\n\t__experimentalInputControlPrefixWrapper as InputControlPrefixWrapper,\n} from '@wordpress/components';\nimport {\n\tchevronRightSmall,\n\tcheck,\n\tblockTable,\n\tchevronDown,\n\tarrowUp,\n\tarrowDown,\n} from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst {\n\tDropdownMenuV2,\n\tDropdownMenuGroupV2,\n\tDropdownMenuItemV2,\n\tDropdownSubMenuV2,\n\tDropdownSubMenuTriggerV2,\n} = unlock( componentsPrivateApis );\n\nexport const PAGE_SIZE_VALUES = [ 5, 20, 50 ];\n\nexport function PageSizeControl( { dataView } ) {\n\tconst label = __( 'Rows per page:' );\n\treturn (\n\t\t<SelectControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\tlabel={ label }\n\t\t\thideLabelFromVision\n\t\t\t// TODO: This should probably use a label based on the wanted design\n\t\t\t// and we could remove InputControlPrefixWrapper usage.\n\t\t\tprefix={\n\t\t\t\t<InputControlPrefixWrapper\n\t\t\t\t\tas=\"span\"\n\t\t\t\t\tclassName=\"dataviews__per-page-control-prefix\"\n\t\t\t\t>\n\t\t\t\t\t{ label }\n\t\t\t\t</InputControlPrefixWrapper>\n\t\t\t}\n\t\t\tvalue={ dataView.getState().pagination.pageSize }\n\t\t\toptions={ PAGE_SIZE_VALUES.map( ( pageSize ) => ( {\n\t\t\t\tvalue: pageSize,\n\t\t\t\tlabel: pageSize,\n\t\t\t} ) ) }\n\t\t\tonChange={ ( value ) => dataView.setPageSize( +value ) }\n\t\t/>\n\t);\n}\n\nfunction PageSizeMenu( { dataView } ) {\n\tconst currenPageSize = dataView.getState().pagination.pageSize;\n\treturn (\n\t\t<DropdownSubMenuV2\n\t\t\ttrigger={\n\t\t\t\t<DropdownSubMenuTriggerV2\n\t\t\t\t\tsuffix={\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{ currenPageSize }\n\t\t\t\t\t\t\t<Icon icon={ chevronRightSmall } />\n\t\t\t\t\t\t</>\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t{ /* TODO: probably label per view type. */ }\n\t\t\t\t\t{ __( 'Rows per page' ) }\n\t\t\t\t</DropdownSubMenuTriggerV2>\n\t\t\t}\n\t\t>\n\t\t\t{ PAGE_SIZE_VALUES.map( ( size ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<DropdownMenuItemV2\n\t\t\t\t\t\tkey={ size }\n\t\t\t\t\t\tprefix={\n\t\t\t\t\t\t\tcurrenPageSize === size && <Icon icon={ check } />\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonSelect={ ( event ) => {\n\t\t\t\t\t\t\t// We need to handle this on DropDown component probably..\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tdataView.setPageSize( size );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\t// TODO: check about role and a11y.\n\t\t\t\t\t\trole=\"menuitemcheckbox\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ size }\n\t\t\t\t\t</DropdownMenuItemV2>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</DropdownSubMenuV2>\n\t);\n}\n\nfunction FieldsVisibilityMenu( { dataView } ) {\n\tconst hideableFields = dataView\n\t\t.getAllColumns()\n\t\t.filter( ( columnn ) => columnn.getCanHide() );\n\tif ( ! hideableFields?.length ) {\n\t\treturn null;\n\t}\n\treturn (\n\t\t<DropdownSubMenuV2\n\t\t\ttrigger={\n\t\t\t\t<DropdownSubMenuTriggerV2\n\t\t\t\t\tsuffix={ <Icon icon={ chevronRightSmall } /> }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Fields' ) }\n\t\t\t\t</DropdownSubMenuTriggerV2>\n\t\t\t}\n\t\t>\n\t\t\t{ hideableFields?.map( ( field ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<DropdownMenuItemV2\n\t\t\t\t\t\tkey={ field.id }\n\t\t\t\t\t\tprefix={\n\t\t\t\t\t\t\tfield.getIsVisible() && <Icon icon={ check } />\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonSelect={ ( event ) => {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tfield.getToggleVisibilityHandler()( event );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\trole=\"menuitemcheckbox\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ field.columnDef.header }\n\t\t\t\t\t</DropdownMenuItemV2>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</DropdownSubMenuV2>\n\t);\n}\n\n// This object is used to construct the sorting options per sortable field.\nconst sortingItemsInfo = {\n\tasc: { icon: arrowUp, label: __( 'Sort ascending' ) },\n\tdesc: { icon: arrowDown, label: __( 'Sort descending' ) },\n};\nfunction SortMenu( { dataView } ) {\n\tconst sortableFields = dataView\n\t\t.getAllColumns()\n\t\t.filter( ( columnn ) => columnn.getCanSort() );\n\tif ( ! sortableFields?.length ) {\n\t\treturn null;\n\t}\n\tconst currentSortedField = sortableFields.find( ( field ) =>\n\t\tfield.getIsSorted()\n\t);\n\treturn (\n\t\t<DropdownSubMenuV2\n\t\t\ttrigger={\n\t\t\t\t<DropdownSubMenuTriggerV2\n\t\t\t\t\tsuffix={\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{ currentSortedField?.columnDef.header }\n\t\t\t\t\t\t\t<Icon icon={ chevronRightSmall } />\n\t\t\t\t\t\t</>\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Sort by' ) }\n\t\t\t\t</DropdownSubMenuTriggerV2>\n\t\t\t}\n\t\t>\n\t\t\t{ sortableFields?.map( ( field ) => {\n\t\t\t\tconst sortedDirection = field.getIsSorted();\n\t\t\t\treturn (\n\t\t\t\t\t<DropdownSubMenuV2\n\t\t\t\t\t\tkey={ field.id }\n\t\t\t\t\t\ttrigger={\n\t\t\t\t\t\t\t<DropdownSubMenuTriggerV2\n\t\t\t\t\t\t\t\tsuffix={ <Icon icon={ chevronRightSmall } /> }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ field.columnDef.header }\n\t\t\t\t\t\t\t</DropdownSubMenuTriggerV2>\n\t\t\t\t\t\t}\n\t\t\t\t\t\tside=\"left\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ Object.entries( sortingItemsInfo ).map(\n\t\t\t\t\t\t\t( [ direction, info ] ) => {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<DropdownMenuItemV2\n\t\t\t\t\t\t\t\t\t\tkey={ direction }\n\t\t\t\t\t\t\t\t\t\tprefix={ <Icon icon={ info.icon } /> }\n\t\t\t\t\t\t\t\t\t\tsuffix={\n\t\t\t\t\t\t\t\t\t\t\tsortedDirection === direction && (\n\t\t\t\t\t\t\t\t\t\t\t\t<Icon icon={ check } />\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tonSelect={ ( event ) => {\n\t\t\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\t\tsortedDirection === direction\n\t\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\t\tdataView.resetSorting();\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\tdataView.setSorting( [\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tid: field.id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdesc:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdirection ===\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'desc',\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t] );\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ info.label }\n\t\t\t\t\t\t\t\t\t</DropdownMenuItemV2>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t</DropdownSubMenuV2>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</DropdownSubMenuV2>\n\t);\n}\n\nexport default function ViewActions( { dataView, className } ) {\n\treturn (\n\t\t<DropdownMenuV2\n\t\t\tlabel={ __( 'Actions' ) }\n\t\t\tclassName={ className }\n\t\t\ttrigger={\n\t\t\t\t<Button variant=\"tertiary\" icon={ blockTable }>\n\t\t\t\t\t{ __( 'View' ) }\n\t\t\t\t\t<Icon icon={ chevronDown } />\n\t\t\t\t</Button>\n\t\t\t}\n\t\t>\n\t\t\t<DropdownMenuGroupV2>\n\t\t\t\t<SortMenu dataView={ dataView } />\n\t\t\t\t<FieldsVisibilityMenu dataView={ dataView } />\n\t\t\t\t<PageSizeMenu dataView={ dataView } />\n\t\t\t</DropdownMenuGroupV2>\n\t\t</DropdownMenuV2>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,MAAM,EACNC,IAAI,EACJC,aAAa,EACbC,WAAW,IAAIC,qBAAqB,EACpCC,uCAAuC,IAAIC,yBAAyB,QAC9D,uBAAuB;AAC9B,SACCC,iBAAiB,EACjBC,KAAK,EACLC,UAAU,EACVC,WAAW,EACXC,OAAO,EACPC,SAAS,QACH,kBAAkB;AACzB,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,MAAM;EACLC,cAAc;EACdC,mBAAmB;EACnBC,kBAAkB;EAClBC,iBAAiB;EACjBC;AACD,CAAC,GAAGL,MAAM,CAAEV,qBAAsB,CAAC;AAEnC,OAAO,MAAMgB,gBAAgB,GAAG,CAAE,CAAC,EAAE,EAAE,EAAE,EAAE,CAAE;AAE7C,OAAO,SAASC,eAAeA,CAAE;EAAEC;AAAS,CAAC,EAAG;EAC/C,MAAMC,KAAK,GAAGV,EAAE,CAAE,gBAAiB,CAAC;EACpC,OACCW,a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,4 +1,4 @@
|
|
|
1
|
-
import { createElement, Fragment } from "
|
|
1
|
+
import { createElement, Fragment } from "react";
|
|
2
2
|
/**
|
|
3
3
|
* WordPress dependencies
|
|
4
4
|
*/
|
|
@@ -50,10 +50,9 @@ function FontFamilies() {
|
|
|
50
50
|
font: font
|
|
51
51
|
})))));
|
|
52
52
|
}
|
|
53
|
-
|
|
53
|
+
export default (({
|
|
54
54
|
...props
|
|
55
55
|
}) => createElement(FontLibraryProvider, null, createElement(FontFamilies, {
|
|
56
56
|
...props
|
|
57
|
-
}));
|
|
58
|
-
export default process.env.IS_GUTENBERG_PLUGIN ? FontFamiliesComponent : undefined;
|
|
57
|
+
})));
|
|
59
58
|
//# sourceMappingURL=font-families.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","__experimentalItemGroup","ItemGroup","__experimentalVStack","VStack","__experimentalHStack","HStack","Button","Tooltip","typography","useContext","FontLibraryProvider","FontLibraryContext","FontLibraryModal","FontFamilyItem","Subtitle","FontFamilies","modalTabOpen","toggleModal","themeFonts","customFonts","createElement","Fragment","onRequestClose","initialTabName","spacing","justify","level","text","onClick","icon","size","isBordered","isSeparated","map","font","key","slug","
|
|
1
|
+
{"version":3,"names":["__","__experimentalItemGroup","ItemGroup","__experimentalVStack","VStack","__experimentalHStack","HStack","Button","Tooltip","typography","useContext","FontLibraryProvider","FontLibraryContext","FontLibraryModal","FontFamilyItem","Subtitle","FontFamilies","modalTabOpen","toggleModal","themeFonts","customFonts","createElement","Fragment","onRequestClose","initialTabName","spacing","justify","level","text","onClick","icon","size","isBordered","isSeparated","map","font","key","slug","props"],"sources":["@wordpress/edit-site/src/components/global-styles/font-families.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalVStack as VStack,\n\t__experimentalHStack as HStack,\n\tButton,\n\tTooltip,\n} from '@wordpress/components';\nimport { typography } from '@wordpress/icons';\nimport { useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport FontLibraryProvider, {\n\tFontLibraryContext,\n} from './font-library-modal/context';\nimport FontLibraryModal from './font-library-modal';\nimport FontFamilyItem from './font-family-item';\nimport Subtitle from './subtitle';\n\nfunction FontFamilies() {\n\tconst { modalTabOpen, toggleModal, themeFonts, customFonts } =\n\t\tuseContext( FontLibraryContext );\n\n\treturn (\n\t\t<>\n\t\t\t{ !! modalTabOpen && (\n\t\t\t\t<FontLibraryModal\n\t\t\t\t\tonRequestClose={ () => toggleModal() }\n\t\t\t\t\tinitialTabName={ modalTabOpen }\n\t\t\t\t/>\n\t\t\t) }\n\n\t\t\t<VStack spacing={ 3 }>\n\t\t\t\t<HStack justify=\"space-between\">\n\t\t\t\t\t<Subtitle level={ 3 }>{ __( 'Fonts' ) }</Subtitle>\n\t\t\t\t\t<HStack justify=\"flex-end\">\n\t\t\t\t\t\t<Tooltip text={ __( 'Manage fonts' ) }>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\ttoggleModal( 'installed-fonts' )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\taria-label={ __( 'Manage fonts' ) }\n\t\t\t\t\t\t\t\ticon={ typography }\n\t\t\t\t\t\t\t\tsize={ 'small' }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t</HStack>\n\t\t\t\t</HStack>\n\t\t\t\t<ItemGroup isBordered isSeparated>\n\t\t\t\t\t{ customFonts.map( ( font ) => (\n\t\t\t\t\t\t<FontFamilyItem key={ font.slug } font={ font } />\n\t\t\t\t\t) ) }\n\t\t\t\t\t{ themeFonts.map( ( font ) => (\n\t\t\t\t\t\t<FontFamilyItem key={ font.slug } font={ font } />\n\t\t\t\t\t) ) }\n\t\t\t\t</ItemGroup>\n\t\t\t</VStack>\n\t\t</>\n\t);\n}\n\nexport default ( { ...props } ) => (\n\t<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cAAe,CAAG;IACnC8B,IAAI,EAAGrB,UAAY;IACnBsB,IAAI,EAAG;EAAS,CAChB,CACO,CACF,CACD,CAAC,EACTV,aAAA,CAACnB,SAAS;IAAC8B,UAAU;IAACC,WAAW;EAAA,GAC9Bb,WAAW,CAACc,GAAG,CAAIC,IAAI,IACxBd,aAAA,CAACP,cAAc;IAACsB,GAAG,EAAGD,IAAI,CAACE,IAAM;IAACF,IAAI,EAAGA;EAAM,CAAE,CAChD,CAAC,EACDhB,UAAU,CAACe,GAAG,CAAIC,IAAI,IACvBd,aAAA,CAACP,cAAc;IAACsB,GAAG,EAAGD,IAAI,CAACE,IAAM;IAACF,IAAI,EAAGA;EAAM,CAAE,CAChD,CACQ,CACJ,CACP,CAAC;AAEL;AAEA,gBAAe,CAAE;EAAE,GAAGG;AAAM,CAAC,KAC5BjB,aAAA,CAACV,mBAAmB,QACnBU,aAAA,CAACL,YAAY;EAAA,GAAMsB;AAAK,CAAI,CACR,CACrB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createElement, Fragment } from "
|
|
1
|
+
import { createElement, Fragment } from "react";
|
|
2
2
|
/**
|
|
3
3
|
* WordPress dependencies
|
|
4
4
|
*/
|
|
@@ -31,7 +31,9 @@ function CollectionFontDetails({
|
|
|
31
31
|
face: face,
|
|
32
32
|
key: `face${i}`,
|
|
33
33
|
handleToggleVariant: handleToggleVariant,
|
|
34
|
-
selected: isFontFontFaceInOutline(font.slug, face,
|
|
34
|
+
selected: isFontFontFaceInOutline(font.slug, font.fontFace ? face : null,
|
|
35
|
+
// If the font has no fontFace, we want to check if the font is in the outline
|
|
36
|
+
fontToInstallOutline)
|
|
35
37
|
}))), createElement(Spacer, {
|
|
36
38
|
margin: 8
|
|
37
39
|
}));
|
package/build-module/components/global-styles/font-library-modal/collection-font-details.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__experimentalVStack","VStack","__experimentalSpacer","Spacer","CollectionFontVariant","isFontFontFaceInOutline","sortFontFaces","CollectionFontDetails","font","handleToggleVariant","fontToInstallOutline","fontFaces","fontFace","length","fontFamily","fontStyle","fontWeight","createElement","Fragment","margin","spacing","map","face","i","key","selected","slug"],"sources":["@wordpress/edit-site/src/components/global-styles/font-library-modal/collection-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 CollectionFontVariant from './collection-font-variant';\nimport { isFontFontFaceInOutline } from './utils/fonts-outline';\nimport { sortFontFaces } from './utils/sort-font-faces';\n\nfunction CollectionFontDetails( {\n\tfont,\n\thandleToggleVariant,\n\tfontToInstallOutline,\n} ) {\n\tconst fontFaces =\n\t\tfont.fontFace && font.fontFace.length\n\t\t\t? sortFontFaces( font.fontFace )\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<CollectionFontVariant\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\thandleToggleVariant={ handleToggleVariant }\n\t\t\t\t\t\tselected={ isFontFontFaceInOutline(\n\t\t\t\t\t\t\tfont.slug,\n\t\t\t\t\t\t\
|
|
1
|
+
{"version":3,"names":["__experimentalVStack","VStack","__experimentalSpacer","Spacer","CollectionFontVariant","isFontFontFaceInOutline","sortFontFaces","CollectionFontDetails","font","handleToggleVariant","fontToInstallOutline","fontFaces","fontFace","length","fontFamily","fontStyle","fontWeight","createElement","Fragment","margin","spacing","map","face","i","key","selected","slug"],"sources":["@wordpress/edit-site/src/components/global-styles/font-library-modal/collection-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 CollectionFontVariant from './collection-font-variant';\nimport { isFontFontFaceInOutline } from './utils/fonts-outline';\nimport { sortFontFaces } from './utils/sort-font-faces';\n\nfunction CollectionFontDetails( {\n\tfont,\n\thandleToggleVariant,\n\tfontToInstallOutline,\n} ) {\n\tconst fontFaces =\n\t\tfont.fontFace && font.fontFace.length\n\t\t\t? sortFontFaces( font.fontFace )\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<CollectionFontVariant\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\thandleToggleVariant={ handleToggleVariant }\n\t\t\t\t\t\tselected={ isFontFontFaceInOutline(\n\t\t\t\t\t\t\tfont.slug,\n\t\t\t\t\t\t\tfont.fontFace ? face : null, // If the font has no fontFace, we want to check if the font is in the outline\n\t\t\t\t\t\t\tfontToInstallOutline\n\t\t\t\t\t\t) }\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 CollectionFontDetails;\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAA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3
|
* WordPress dependencies
|
|
4
4
|
*/
|
|
@@ -6,8 +6,6 @@ import { createContext, useState, useEffect } from '@wordpress/element';
|
|
|
6
6
|
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
7
7
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
8
8
|
import { useEntityRecord, useEntityRecords, store as coreStore } from '@wordpress/core-data';
|
|
9
|
-
import { store as noticesStore } from '@wordpress/notices';
|
|
10
|
-
import { __ } from '@wordpress/i18n';
|
|
11
9
|
|
|
12
10
|
/**
|
|
13
11
|
* Internal dependencies
|
|
@@ -39,9 +37,6 @@ function FontLibraryProvider({
|
|
|
39
37
|
});
|
|
40
38
|
const globalStyles = useEntityRecord('root', 'globalStyles', globalStylesId);
|
|
41
39
|
const fontFamiliesHasChanges = !!globalStyles?.edits?.settings?.typography?.fontFamilies;
|
|
42
|
-
const {
|
|
43
|
-
createErrorNotice
|
|
44
|
-
} = useDispatch(noticesStore);
|
|
45
40
|
const [isInstalling, setIsInstalling] = useState(false);
|
|
46
41
|
const [refreshKey, setRefreshKey] = useState(0);
|
|
47
42
|
const refreshLibrary = () => {
|
|
@@ -153,7 +148,8 @@ function FontLibraryProvider({
|
|
|
153
148
|
// Prepare formData to install.
|
|
154
149
|
const formData = makeFormDataFromFontFamilies(fonts);
|
|
155
150
|
// Install the fonts (upload the font files to the server and create the post in the database).
|
|
156
|
-
const
|
|
151
|
+
const response = await fetchInstallFonts(formData);
|
|
152
|
+
const fontsInstalled = response?.successes || [];
|
|
157
153
|
// Get intersecting font faces between the fonts we tried to installed and the fonts that were installed
|
|
158
154
|
// (to avoid activating a non installed font).
|
|
159
155
|
const fontToBeActivated = getIntersectingFontFaces(fontsInstalled, fonts);
|
|
@@ -163,35 +159,33 @@ function FontLibraryProvider({
|
|
|
163
159
|
saveSpecifiedEntityEdits('root', 'globalStyles', globalStylesId, ['settings.typography.fontFamilies']);
|
|
164
160
|
refreshLibrary();
|
|
165
161
|
setIsInstalling(false);
|
|
166
|
-
return
|
|
167
|
-
} catch (
|
|
168
|
-
// eslint-disable-next-line no-console
|
|
169
|
-
console.error(e);
|
|
170
|
-
createErrorNotice(__('Error installing fonts.'), {
|
|
171
|
-
type: 'snackbar'
|
|
172
|
-
});
|
|
162
|
+
return response;
|
|
163
|
+
} catch (error) {
|
|
173
164
|
setIsInstalling(false);
|
|
174
|
-
return
|
|
165
|
+
return {
|
|
166
|
+
errors: [error]
|
|
167
|
+
};
|
|
175
168
|
}
|
|
176
169
|
}
|
|
177
170
|
async function uninstallFont(font) {
|
|
178
171
|
try {
|
|
179
172
|
// Uninstall the font (remove the font files from the server and the post from the database).
|
|
180
|
-
await fetchUninstallFonts([font]);
|
|
173
|
+
const response = await fetchUninstallFonts([font]);
|
|
181
174
|
// Deactivate the font family (remove the font family from the global styles).
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
175
|
+
if (!response.errors) {
|
|
176
|
+
deactivateFontFamily(font);
|
|
177
|
+
// Save the global styles to the database.
|
|
178
|
+
await saveSpecifiedEntityEdits('root', 'globalStyles', globalStylesId, ['settings.typography.fontFamilies']);
|
|
179
|
+
}
|
|
185
180
|
// Refresh the library (the the library font families from database).
|
|
186
181
|
refreshLibrary();
|
|
187
|
-
return
|
|
188
|
-
} catch (
|
|
182
|
+
return response;
|
|
183
|
+
} catch (error) {
|
|
189
184
|
// eslint-disable-next-line no-console
|
|
190
|
-
console.error(
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
}
|
|
194
|
-
return false;
|
|
185
|
+
console.error(error);
|
|
186
|
+
return {
|
|
187
|
+
errors: [error]
|
|
188
|
+
};
|
|
195
189
|
}
|
|
196
190
|
}
|
|
197
191
|
const deactivateFontFamily = font => {
|
|
@@ -215,10 +209,12 @@ function FontLibraryProvider({
|
|
|
215
209
|
});
|
|
216
210
|
// Add custom fonts to the browser.
|
|
217
211
|
fontsToAdd.forEach(font => {
|
|
218
|
-
font.fontFace
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
212
|
+
if (font.fontFace) {
|
|
213
|
+
font.fontFace.forEach(face => {
|
|
214
|
+
// Load font faces just in the iframe because they already are in the document.
|
|
215
|
+
loadFontFaceInBrowser(face, getDisplaySrcFromFontFace(face.src), 'iframe');
|
|
216
|
+
});
|
|
217
|
+
}
|
|
222
218
|
});
|
|
223
219
|
};
|
|
224
220
|
const toggleActivateFont = (font, face) => {
|
|
@@ -240,7 +236,7 @@ function FontLibraryProvider({
|
|
|
240
236
|
// Get the src of the font.
|
|
241
237
|
const src = getDisplaySrcFromFontFace(fontFace.src, themeUrl);
|
|
242
238
|
// If the font is already loaded, don't load it again.
|
|
243
|
-
if (loadedFontUrls.has(src)) return;
|
|
239
|
+
if (!src || loadedFontUrls.has(src)) return;
|
|
244
240
|
// Load the font in the browser.
|
|
245
241
|
loadFontFaceInBrowser(fontFace, src, 'document');
|
|
246
242
|
// Add the font to the loaded fonts list.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createContext","useState","useEffect","privateApis","blockEditorPrivateApis","useSelect","useDispatch","useEntityRecord","useEntityRecords","store","coreStore","noticesStore","__","fetchInstallFonts","fetchUninstallFonts","fetchFontCollections","fetchFontCollection","unlock","useGlobalSetting","setUIValuesNeeded","mergeFontFamilies","loadFontFaceInBrowser","getDisplaySrcFromFontFace","makeFormDataFromFontFamilies","toggleFont","getIntersectingFontFaces","FontLibraryContext","FontLibraryProvider","children","__experimentalSaveSpecifiedEntityEdits","saveSpecifiedEntityEdits","globalStylesId","select","__experimentalGetCurrentGlobalStylesId","globalStyles","fontFamiliesHasChanges","edits","settings","typography","fontFamilies","createErrorNotice","isInstalling","setIsInstalling","refreshKey","setRefreshKey","refreshLibrary","Date","now","records","libraryPosts","isResolving","isResolvingLibrary","hasResolved","hasResolvedLibrary","libraryFonts","map","post","JSON","parse","content","raw","setFontFamilies","baseFontFamilies","undefined","saveFontFamilies","modalTabOpen","setModalTabOpen","libraryFontSelected","setLibraryFontSelected","baseThemeFonts","theme","f","source","sort","a","b","name","localeCompare","themeFonts","customFonts","custom","baseCustomFonts","handleSetLibraryFontSelected","font","fonts","fontSelected","find","slug","toggleModal","tabName","loadedFontUrls","Set","site","currentTheme","getSite","getCurrentTheme","themeUrl","url","stylesheet","getAvailableFontsOutline","availableFontFamilies","outline","reduce","acc","availableFontFaces","Array","isArray","fontFace","face","fontStyle","fontWeight","getActivatedFontsOutline","isFontActivated","style","weight","includes","getFontFacesActivated","installFonts","formData","fontsInstalled","fontToBeActivated","activateCustomFontFamilies","e","console","error","type","uninstallFont","deactivateFontFamily","_fontFamilies$font$so","initialCustomFonts","newCustomFonts","filter","fontsToAdd","forEach","src","toggleActivateFont","_fontFamilies$font$so2","initialFonts","newFonts","loadFontFaceAsset","has","add","collections","setFontCollections","getFontCollections","response","getFontCollection","id","hasData","collection","data","updatedCollections","createElement","Provider","value"],"sources":["@wordpress/edit-site/src/components/global-styles/font-library-modal/context.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createContext, useState, useEffect } from '@wordpress/element';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tuseEntityRecord,\n\tuseEntityRecords,\n\tstore as coreStore,\n} from '@wordpress/core-data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport {\n\tfetchInstallFonts,\n\tfetchUninstallFonts,\n\tfetchFontCollections,\n\tfetchFontCollection,\n} from './resolvers';\nimport { unlock } from '../../../lock-unlock';\nconst { useGlobalSetting } = unlock( blockEditorPrivateApis );\nimport {\n\tsetUIValuesNeeded,\n\tmergeFontFamilies,\n\tloadFontFaceInBrowser,\n\tgetDisplaySrcFromFontFace,\n\tmakeFormDataFromFontFamilies,\n} from './utils';\nimport { toggleFont } from './utils/toggleFont';\nimport getIntersectingFontFaces from './utils/get-intersecting-font-faces';\n\nexport const FontLibraryContext = createContext( {} );\n\nfunction FontLibraryProvider( { children } ) {\n\tconst { __experimentalSaveSpecifiedEntityEdits: saveSpecifiedEntityEdits } =\n\t\tuseDispatch( coreStore );\n\tconst { globalStylesId } = useSelect( ( select ) => {\n\t\tconst { __experimentalGetCurrentGlobalStylesId } = select( coreStore );\n\t\treturn { globalStylesId: __experimentalGetCurrentGlobalStylesId() };\n\t} );\n\n\tconst globalStyles = useEntityRecord(\n\t\t'root',\n\t\t'globalStyles',\n\t\tglobalStylesId\n\t);\n\tconst fontFamiliesHasChanges =\n\t\t!! globalStyles?.edits?.settings?.typography?.fontFamilies;\n\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\n\tconst [ isInstalling, setIsInstalling ] = useState( false );\n\tconst [ refreshKey, setRefreshKey ] = useState( 0 );\n\n\tconst refreshLibrary = () => {\n\t\tsetRefreshKey( Date.now() );\n\t};\n\n\tconst {\n\t\trecords: libraryPosts = [],\n\t\tisResolving: isResolvingLibrary,\n\t\thasResolved: hasResolvedLibrary,\n\t} = useEntityRecords( 'postType', 'wp_font_family', { refreshKey } );\n\n\tconst libraryFonts =\n\t\t( libraryPosts || [] ).map( ( post ) =>\n\t\t\tJSON.parse( post.content.raw )\n\t\t) || [];\n\n\t// Global Styles (settings) font families\n\tconst [ fontFamilies, setFontFamilies ] = useGlobalSetting(\n\t\t'typography.fontFamilies'\n\t);\n\t// theme.json file font families\n\tconst [ baseFontFamilies ] = useGlobalSetting(\n\t\t'typography.fontFamilies',\n\t\tundefined,\n\t\t'base'\n\t);\n\n\t// Save font families to the global styles post in the database.\n\tconst saveFontFamilies = () => {\n\t\tsaveSpecifiedEntityEdits( 'root', 'globalStyles', globalStylesId, [\n\t\t\t'settings.typography.fontFamilies',\n\t\t] );\n\t};\n\n\t// Library Fonts\n\tconst [ modalTabOpen, setModalTabOpen ] = useState( false );\n\tconst [ libraryFontSelected, setLibraryFontSelected ] = useState( null );\n\n\tconst baseThemeFonts = baseFontFamilies?.theme\n\t\t? baseFontFamilies.theme\n\t\t\t\t.map( ( f ) => setUIValuesNeeded( f, { source: 'theme' } ) )\n\t\t\t\t.sort( ( a, b ) => a.name.localeCompare( b.name ) )\n\t\t: [];\n\n\tconst themeFonts = fontFamilies?.theme\n\t\t? fontFamilies.theme\n\t\t\t\t.map( ( f ) => setUIValuesNeeded( f, { source: 'theme' } ) )\n\t\t\t\t.sort( ( a, b ) => a.name.localeCompare( b.name ) )\n\t\t: [];\n\n\tconst customFonts = fontFamilies?.custom\n\t\t? fontFamilies.custom\n\t\t\t\t.map( ( f ) => setUIValuesNeeded( f, { source: 'custom' } ) )\n\t\t\t\t.sort( ( a, b ) => a.name.localeCompare( b.name ) )\n\t\t: [];\n\n\tconst baseCustomFonts = libraryFonts\n\t\t? libraryFonts\n\t\t\t\t.map( ( f ) => setUIValuesNeeded( f, { source: 'custom' } ) )\n\t\t\t\t.sort( ( a, b ) => a.name.localeCompare( b.name ) )\n\t\t: [];\n\n\tuseEffect( () => {\n\t\tif ( ! modalTabOpen ) {\n\t\t\tsetLibraryFontSelected( null );\n\t\t}\n\t}, [ modalTabOpen ] );\n\n\tconst handleSetLibraryFontSelected = ( font ) => {\n\t\t// If font is null, reset the selected font\n\t\tif ( ! font ) {\n\t\t\tsetLibraryFontSelected( null );\n\t\t\treturn;\n\t\t}\n\n\t\tconst fonts =\n\t\t\tfont.source === 'theme' ? baseThemeFonts : baseCustomFonts;\n\n\t\t// Tries to find the font in the installed fonts\n\t\tconst fontSelected = fonts.find( ( f ) => f.slug === font.slug );\n\t\t// If the font is not found (it is only defined in custom styles), use the font from custom styles\n\t\tsetLibraryFontSelected( {\n\t\t\t...( fontSelected || font ),\n\t\t\tsource: font.source,\n\t\t} );\n\t};\n\n\tconst toggleModal = ( tabName ) => {\n\t\tsetModalTabOpen( tabName || null );\n\t};\n\n\t// Demo\n\tconst [ loadedFontUrls ] = useState( new Set() );\n\n\t// Theme data\n\tconst { site, currentTheme } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tsite: select( coreStore ).getSite(),\n\t\t\tcurrentTheme: select( coreStore ).getCurrentTheme(),\n\t\t};\n\t} );\n\tconst themeUrl =\n\t\tsite?.url + '/wp-content/themes/' + currentTheme?.stylesheet;\n\n\tconst getAvailableFontsOutline = ( availableFontFamilies ) => {\n\t\tconst outline = availableFontFamilies.reduce( ( acc, font ) => {\n\t\t\tconst availableFontFaces = Array.isArray( font?.fontFace )\n\t\t\t\t? font?.fontFace.map(\n\t\t\t\t\t\t( face ) => `${ face.fontStyle + face.fontWeight }`\n\t\t\t\t )\n\t\t\t\t: [ 'normal400' ]; // If the font doesn't have fontFace, we assume it is a system font and we add the defaults: normal 400\n\n\t\t\tacc[ font.slug ] = availableFontFaces;\n\t\t\treturn acc;\n\t\t}, {} );\n\t\treturn outline;\n\t};\n\n\tconst getActivatedFontsOutline = ( source ) => {\n\t\tswitch ( source ) {\n\t\t\tcase 'theme':\n\t\t\t\treturn getAvailableFontsOutline( themeFonts );\n\t\t\tcase 'custom':\n\t\t\tdefault:\n\t\t\t\treturn getAvailableFontsOutline( customFonts );\n\t\t}\n\t};\n\n\tconst isFontActivated = ( slug, style, weight, source ) => {\n\t\tif ( ! style && ! weight ) {\n\t\t\treturn !! getActivatedFontsOutline( source )[ slug ];\n\t\t}\n\t\treturn !! getActivatedFontsOutline( source )[ slug ]?.includes(\n\t\t\tstyle + weight\n\t\t);\n\t};\n\n\tconst getFontFacesActivated = ( slug, source ) => {\n\t\treturn getActivatedFontsOutline( source )[ slug ] || [];\n\t};\n\n\tasync function installFonts( fonts ) {\n\t\tsetIsInstalling( true );\n\t\ttry {\n\t\t\t// Prepare formData to install.\n\t\t\tconst formData = makeFormDataFromFontFamilies( fonts );\n\t\t\t// Install the fonts (upload the font files to the server and create the post in the database).\n\t\t\tconst fontsInstalled = await fetchInstallFonts( formData );\n\t\t\t// Get intersecting font faces between the fonts we tried to installed and the fonts that were installed\n\t\t\t// (to avoid activating a non installed font).\n\t\t\tconst fontToBeActivated = getIntersectingFontFaces(\n\t\t\t\tfontsInstalled,\n\t\t\t\tfonts\n\t\t\t);\n\t\t\t// Activate the font families (add the font families to the global styles).\n\t\t\tactivateCustomFontFamilies( fontToBeActivated );\n\t\t\t// Save the global styles to the database.\n\t\t\tsaveSpecifiedEntityEdits( 'root', 'globalStyles', globalStylesId, [\n\t\t\t\t'settings.typography.fontFamilies',\n\t\t\t] );\n\t\t\trefreshLibrary();\n\t\t\tsetIsInstalling( false );\n\t\t\treturn true;\n\t\t} catch ( e ) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.error( e );\n\t\t\tcreateErrorNotice( __( 'Error installing fonts.' ), {\n\t\t\t\ttype: 'snackbar',\n\t\t\t} );\n\t\t\tsetIsInstalling( false );\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tasync function uninstallFont( font ) {\n\t\ttry {\n\t\t\t// Uninstall the font (remove the font files from the server and the post from the database).\n\t\t\tawait fetchUninstallFonts( [ font ] );\n\t\t\t// Deactivate the font family (remove the font family from the global styles).\n\t\t\tdeactivateFontFamily( font );\n\t\t\t// Save the global styles to the database.\n\t\t\tawait saveSpecifiedEntityEdits(\n\t\t\t\t'root',\n\t\t\t\t'globalStyles',\n\t\t\t\tglobalStylesId,\n\t\t\t\t[ 'settings.typography.fontFamilies' ]\n\t\t\t);\n\t\t\t// Refresh the library (the the library font families from database).\n\t\t\trefreshLibrary();\n\t\t\treturn true;\n\t\t} catch ( e ) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.error( e );\n\t\t\tcreateErrorNotice( __( 'Error uninstalling fonts.' ), {\n\t\t\t\ttype: 'snackbar',\n\t\t\t} );\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tconst deactivateFontFamily = ( font ) => {\n\t\t// If the user doesn't have custom fonts defined, include as custom fonts all the theme fonts\n\t\t// We want to save as active all the theme fonts at the beginning\n\t\tconst initialCustomFonts = fontFamilies?.[ font.source ] ?? [];\n\t\tconst newCustomFonts = initialCustomFonts.filter(\n\t\t\t( f ) => f.slug !== font.slug\n\t\t);\n\t\tsetFontFamilies( {\n\t\t\t...fontFamilies,\n\t\t\t[ font.source ]: newCustomFonts,\n\t\t} );\n\t};\n\n\tconst activateCustomFontFamilies = ( fontsToAdd ) => {\n\t\t// Merge the existing custom fonts with the new fonts.\n\t\tconst newCustomFonts = mergeFontFamilies(\n\t\t\tfontFamilies?.custom,\n\t\t\tfontsToAdd\n\t\t);\n\t\t// Activate the fonts by set the new custom fonts array.\n\t\tsetFontFamilies( {\n\t\t\t...fontFamilies,\n\t\t\tcustom: newCustomFonts,\n\t\t} );\n\t\t// Add custom fonts to the browser.\n\t\tfontsToAdd.forEach( ( font ) => {\n\t\t\tfont.fontFace.forEach( ( face ) => {\n\t\t\t\t// Load font faces just in the iframe because they already are in the document.\n\t\t\t\tloadFontFaceInBrowser(\n\t\t\t\t\tface,\n\t\t\t\t\tgetDisplaySrcFromFontFace( face.src ),\n\t\t\t\t\t'iframe'\n\t\t\t\t);\n\t\t\t} );\n\t\t} );\n\t};\n\n\tconst toggleActivateFont = ( font, face ) => {\n\t\t// If the user doesn't have custom fonts defined, include as custom fonts all the theme fonts\n\t\t// We want to save as active all the theme fonts at the beginning\n\t\tconst initialFonts = fontFamilies?.[ font.source ] ?? [];\n\t\t// Toggles the received font family or font face\n\t\tconst newFonts = toggleFont( font, face, initialFonts );\n\t\t// Updates the font families activated in global settings:\n\t\tsetFontFamilies( {\n\t\t\t...fontFamilies,\n\t\t\t[ font.source ]: newFonts,\n\t\t} );\n\t};\n\n\tconst loadFontFaceAsset = async ( fontFace ) => {\n\t\t// If the font doesn't have a src, don't load it.\n\t\tif ( ! fontFace.src ) return;\n\t\t// Get the src of the font.\n\t\tconst src = getDisplaySrcFromFontFace( fontFace.src, themeUrl );\n\t\t// If the font is already loaded, don't load it again.\n\t\tif ( loadedFontUrls.has( src ) ) return;\n\t\t// Load the font in the browser.\n\t\tloadFontFaceInBrowser( fontFace, src, 'document' );\n\t\t// Add the font to the loaded fonts list.\n\t\tloadedFontUrls.add( src );\n\t};\n\n\t// Font Collections\n\tconst [ collections, setFontCollections ] = useState( [] );\n\tconst getFontCollections = async () => {\n\t\tconst response = await fetchFontCollections();\n\t\tsetFontCollections( response );\n\t};\n\tconst getFontCollection = async ( id ) => {\n\t\tconst hasData = !! collections.find(\n\t\t\t( collection ) => collection.id === id\n\t\t)?.data;\n\t\tif ( hasData ) return;\n\t\tconst response = await fetchFontCollection( id );\n\t\tconst updatedCollections = collections.map( ( collection ) =>\n\t\t\tcollection.id === id\n\t\t\t\t? { ...collection, data: { ...response?.data } }\n\t\t\t\t: collection\n\t\t);\n\t\tsetFontCollections( updatedCollections );\n\t};\n\n\tuseEffect( () => {\n\t\tgetFontCollections();\n\t}, [] );\n\n\treturn (\n\t\t<FontLibraryContext.Provider\n\t\t\tvalue={ {\n\t\t\t\tlibraryFontSelected,\n\t\t\t\thandleSetLibraryFontSelected,\n\t\t\t\tthemeFonts,\n\t\t\t\tbaseThemeFonts,\n\t\t\t\tcustomFonts,\n\t\t\t\tbaseCustomFonts,\n\t\t\t\tisFontActivated,\n\t\t\t\tgetFontFacesActivated,\n\t\t\t\tloadFontFaceAsset,\n\t\t\t\tinstallFonts,\n\t\t\t\tuninstallFont,\n\t\t\t\ttoggleActivateFont,\n\t\t\t\tgetAvailableFontsOutline,\n\t\t\t\tmodalTabOpen,\n\t\t\t\ttoggleModal,\n\t\t\t\trefreshLibrary,\n\t\t\t\tsaveFontFamilies,\n\t\t\t\tfontFamiliesHasChanges,\n\t\t\t\tisResolvingLibrary,\n\t\t\t\thasResolvedLibrary,\n\t\t\t\tisInstalling,\n\t\t\t\tcollections,\n\t\t\t\tgetFontCollection,\n\t\t\t} }\n\t\t>\n\t\t\t{ children }\n\t\t</FontLibraryContext.Provider>\n\t);\n}\n\nexport default FontLibraryProvider;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,aAAa,EAAEC,QAAQ,EAAEC,SAAS,QAAQ,oBAAoB;AACvE,SAASC,WAAW,IAAIC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AkB,CAAC+H,QAAQ;IAC3BC,KAAK,EAAG;MACPvF,mBAAmB;MACnBe,4BAA4B;MAC5BJ,UAAU;MACVT,cAAc;MACdU,WAAW;MACXE,eAAe;MACf+B,eAAe;MACfI,qBAAqB;MACrBuB,iBAAiB;MACjBtB,YAAY;MACZS,aAAa;MACbS,kBAAkB;MAClBpC,wBAAwB;MACxBlC,YAAY;MACZuB,WAAW;MACX3C,cAAc;MACdmB,gBAAgB;MAChB7B,sBAAsB;MACtBgB,kBAAkB;MAClBE,kBAAkB;MAClBZ,YAAY;MACZqG,WAAW;MACXI;IACD;EAAG,GAEDtH,QAC0B,CAAC;AAEhC;AAEA,eAAeD,mBAAmB"}
|
|
1
|
+
{"version":3,"names":["createContext","useState","useEffect","privateApis","blockEditorPrivateApis","useSelect","useDispatch","useEntityRecord","useEntityRecords","store","coreStore","fetchInstallFonts","fetchUninstallFonts","fetchFontCollections","fetchFontCollection","unlock","useGlobalSetting","setUIValuesNeeded","mergeFontFamilies","loadFontFaceInBrowser","getDisplaySrcFromFontFace","makeFormDataFromFontFamilies","toggleFont","getIntersectingFontFaces","FontLibraryContext","FontLibraryProvider","children","__experimentalSaveSpecifiedEntityEdits","saveSpecifiedEntityEdits","globalStylesId","select","__experimentalGetCurrentGlobalStylesId","globalStyles","fontFamiliesHasChanges","edits","settings","typography","fontFamilies","isInstalling","setIsInstalling","refreshKey","setRefreshKey","refreshLibrary","Date","now","records","libraryPosts","isResolving","isResolvingLibrary","hasResolved","hasResolvedLibrary","libraryFonts","map","post","JSON","parse","content","raw","setFontFamilies","baseFontFamilies","undefined","saveFontFamilies","modalTabOpen","setModalTabOpen","libraryFontSelected","setLibraryFontSelected","baseThemeFonts","theme","f","source","sort","a","b","name","localeCompare","themeFonts","customFonts","custom","baseCustomFonts","handleSetLibraryFontSelected","font","fonts","fontSelected","find","slug","toggleModal","tabName","loadedFontUrls","Set","site","currentTheme","getSite","getCurrentTheme","themeUrl","url","stylesheet","getAvailableFontsOutline","availableFontFamilies","outline","reduce","acc","availableFontFaces","Array","isArray","fontFace","face","fontStyle","fontWeight","getActivatedFontsOutline","isFontActivated","style","weight","includes","getFontFacesActivated","installFonts","formData","response","fontsInstalled","successes","fontToBeActivated","activateCustomFontFamilies","error","errors","uninstallFont","deactivateFontFamily","console","_fontFamilies$font$so","initialCustomFonts","newCustomFonts","filter","fontsToAdd","forEach","src","toggleActivateFont","_fontFamilies$font$so2","initialFonts","newFonts","loadFontFaceAsset","has","add","collections","setFontCollections","getFontCollections","getFontCollection","id","hasData","collection","data","updatedCollections","createElement","Provider","value"],"sources":["@wordpress/edit-site/src/components/global-styles/font-library-modal/context.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createContext, useState, useEffect } from '@wordpress/element';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tuseEntityRecord,\n\tuseEntityRecords,\n\tstore as coreStore,\n} from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport {\n\tfetchInstallFonts,\n\tfetchUninstallFonts,\n\tfetchFontCollections,\n\tfetchFontCollection,\n} from './resolvers';\nimport { unlock } from '../../../lock-unlock';\nconst { useGlobalSetting } = unlock( blockEditorPrivateApis );\nimport {\n\tsetUIValuesNeeded,\n\tmergeFontFamilies,\n\tloadFontFaceInBrowser,\n\tgetDisplaySrcFromFontFace,\n\tmakeFormDataFromFontFamilies,\n} from './utils';\nimport { toggleFont } from './utils/toggleFont';\nimport getIntersectingFontFaces from './utils/get-intersecting-font-faces';\n\nexport const FontLibraryContext = createContext( {} );\n\nfunction FontLibraryProvider( { children } ) {\n\tconst { __experimentalSaveSpecifiedEntityEdits: saveSpecifiedEntityEdits } =\n\t\tuseDispatch( coreStore );\n\tconst { globalStylesId } = useSelect( ( select ) => {\n\t\tconst { __experimentalGetCurrentGlobalStylesId } = select( coreStore );\n\t\treturn { globalStylesId: __experimentalGetCurrentGlobalStylesId() };\n\t} );\n\n\tconst globalStyles = useEntityRecord(\n\t\t'root',\n\t\t'globalStyles',\n\t\tglobalStylesId\n\t);\n\tconst fontFamiliesHasChanges =\n\t\t!! globalStyles?.edits?.settings?.typography?.fontFamilies;\n\n\tconst [ isInstalling, setIsInstalling ] = useState( false );\n\tconst [ refreshKey, setRefreshKey ] = useState( 0 );\n\n\tconst refreshLibrary = () => {\n\t\tsetRefreshKey( Date.now() );\n\t};\n\n\tconst {\n\t\trecords: libraryPosts = [],\n\t\tisResolving: isResolvingLibrary,\n\t\thasResolved: hasResolvedLibrary,\n\t} = useEntityRecords( 'postType', 'wp_font_family', { refreshKey } );\n\n\tconst libraryFonts =\n\t\t( libraryPosts || [] ).map( ( post ) =>\n\t\t\tJSON.parse( post.content.raw )\n\t\t) || [];\n\n\t// Global Styles (settings) font families\n\tconst [ fontFamilies, setFontFamilies ] = useGlobalSetting(\n\t\t'typography.fontFamilies'\n\t);\n\t// theme.json file font families\n\tconst [ baseFontFamilies ] = useGlobalSetting(\n\t\t'typography.fontFamilies',\n\t\tundefined,\n\t\t'base'\n\t);\n\n\t// Save font families to the global styles post in the database.\n\tconst saveFontFamilies = () => {\n\t\tsaveSpecifiedEntityEdits( 'root', 'globalStyles', globalStylesId, [\n\t\t\t'settings.typography.fontFamilies',\n\t\t] );\n\t};\n\n\t// Library Fonts\n\tconst [ modalTabOpen, setModalTabOpen ] = useState( false );\n\tconst [ libraryFontSelected, setLibraryFontSelected ] = useState( null );\n\n\tconst baseThemeFonts = baseFontFamilies?.theme\n\t\t? baseFontFamilies.theme\n\t\t\t\t.map( ( f ) => setUIValuesNeeded( f, { source: 'theme' } ) )\n\t\t\t\t.sort( ( a, b ) => a.name.localeCompare( b.name ) )\n\t\t: [];\n\n\tconst themeFonts = fontFamilies?.theme\n\t\t? fontFamilies.theme\n\t\t\t\t.map( ( f ) => setUIValuesNeeded( f, { source: 'theme' } ) )\n\t\t\t\t.sort( ( a, b ) => a.name.localeCompare( b.name ) )\n\t\t: [];\n\n\tconst customFonts = fontFamilies?.custom\n\t\t? fontFamilies.custom\n\t\t\t\t.map( ( f ) => setUIValuesNeeded( f, { source: 'custom' } ) )\n\t\t\t\t.sort( ( a, b ) => a.name.localeCompare( b.name ) )\n\t\t: [];\n\n\tconst baseCustomFonts = libraryFonts\n\t\t? libraryFonts\n\t\t\t\t.map( ( f ) => setUIValuesNeeded( f, { source: 'custom' } ) )\n\t\t\t\t.sort( ( a, b ) => a.name.localeCompare( b.name ) )\n\t\t: [];\n\n\tuseEffect( () => {\n\t\tif ( ! modalTabOpen ) {\n\t\t\tsetLibraryFontSelected( null );\n\t\t}\n\t}, [ modalTabOpen ] );\n\n\tconst handleSetLibraryFontSelected = ( font ) => {\n\t\t// If font is null, reset the selected font\n\t\tif ( ! font ) {\n\t\t\tsetLibraryFontSelected( null );\n\t\t\treturn;\n\t\t}\n\n\t\tconst fonts =\n\t\t\tfont.source === 'theme' ? baseThemeFonts : baseCustomFonts;\n\n\t\t// Tries to find the font in the installed fonts\n\t\tconst fontSelected = fonts.find( ( f ) => f.slug === font.slug );\n\t\t// If the font is not found (it is only defined in custom styles), use the font from custom styles\n\t\tsetLibraryFontSelected( {\n\t\t\t...( fontSelected || font ),\n\t\t\tsource: font.source,\n\t\t} );\n\t};\n\n\tconst toggleModal = ( tabName ) => {\n\t\tsetModalTabOpen( tabName || null );\n\t};\n\n\t// Demo\n\tconst [ loadedFontUrls ] = useState( new Set() );\n\n\t// Theme data\n\tconst { site, currentTheme } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tsite: select( coreStore ).getSite(),\n\t\t\tcurrentTheme: select( coreStore ).getCurrentTheme(),\n\t\t};\n\t} );\n\tconst themeUrl =\n\t\tsite?.url + '/wp-content/themes/' + currentTheme?.stylesheet;\n\n\tconst getAvailableFontsOutline = ( availableFontFamilies ) => {\n\t\tconst outline = availableFontFamilies.reduce( ( acc, font ) => {\n\t\t\tconst availableFontFaces = Array.isArray( font?.fontFace )\n\t\t\t\t? font?.fontFace.map(\n\t\t\t\t\t\t( face ) => `${ face.fontStyle + face.fontWeight }`\n\t\t\t\t )\n\t\t\t\t: [ 'normal400' ]; // If the font doesn't have fontFace, we assume it is a system font and we add the defaults: normal 400\n\n\t\t\tacc[ font.slug ] = availableFontFaces;\n\t\t\treturn acc;\n\t\t}, {} );\n\t\treturn outline;\n\t};\n\n\tconst getActivatedFontsOutline = ( source ) => {\n\t\tswitch ( source ) {\n\t\t\tcase 'theme':\n\t\t\t\treturn getAvailableFontsOutline( themeFonts );\n\t\t\tcase 'custom':\n\t\t\tdefault:\n\t\t\t\treturn getAvailableFontsOutline( customFonts );\n\t\t}\n\t};\n\n\tconst isFontActivated = ( slug, style, weight, source ) => {\n\t\tif ( ! style && ! weight ) {\n\t\t\treturn !! getActivatedFontsOutline( source )[ slug ];\n\t\t}\n\t\treturn !! getActivatedFontsOutline( source )[ slug ]?.includes(\n\t\t\tstyle + weight\n\t\t);\n\t};\n\n\tconst getFontFacesActivated = ( slug, source ) => {\n\t\treturn getActivatedFontsOutline( source )[ slug ] || [];\n\t};\n\n\tasync function installFonts( fonts ) {\n\t\tsetIsInstalling( true );\n\t\ttry {\n\t\t\t// Prepare formData to install.\n\t\t\tconst formData = makeFormDataFromFontFamilies( fonts );\n\t\t\t// Install the fonts (upload the font files to the server and create the post in the database).\n\t\t\tconst response = await fetchInstallFonts( formData );\n\t\t\tconst fontsInstalled = response?.successes || [];\n\t\t\t// Get intersecting font faces between the fonts we tried to installed and the fonts that were installed\n\t\t\t// (to avoid activating a non installed font).\n\t\t\tconst fontToBeActivated = getIntersectingFontFaces(\n\t\t\t\tfontsInstalled,\n\t\t\t\tfonts\n\t\t\t);\n\t\t\t// Activate the font families (add the font families to the global styles).\n\t\t\tactivateCustomFontFamilies( fontToBeActivated );\n\t\t\t// Save the global styles to the database.\n\t\t\tsaveSpecifiedEntityEdits( 'root', 'globalStyles', globalStylesId, [\n\t\t\t\t'settings.typography.fontFamilies',\n\t\t\t] );\n\t\t\trefreshLibrary();\n\t\t\tsetIsInstalling( false );\n\n\t\t\treturn response;\n\t\t} catch ( error ) {\n\t\t\tsetIsInstalling( false );\n\t\t\treturn {\n\t\t\t\terrors: [ error ],\n\t\t\t};\n\t\t}\n\t}\n\n\tasync function uninstallFont( font ) {\n\t\ttry {\n\t\t\t// Uninstall the font (remove the font files from the server and the post from the database).\n\t\t\tconst response = await fetchUninstallFonts( [ font ] );\n\t\t\t// Deactivate the font family (remove the font family from the global styles).\n\t\t\tif ( ! response.errors ) {\n\t\t\t\tdeactivateFontFamily( font );\n\t\t\t\t// Save the global styles to the database.\n\t\t\t\tawait saveSpecifiedEntityEdits(\n\t\t\t\t\t'root',\n\t\t\t\t\t'globalStyles',\n\t\t\t\t\tglobalStylesId,\n\t\t\t\t\t[ 'settings.typography.fontFamilies' ]\n\t\t\t\t);\n\t\t\t}\n\t\t\t// Refresh the library (the the library font families from database).\n\t\t\trefreshLibrary();\n\t\t\treturn response;\n\t\t} catch ( error ) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.error( error );\n\t\t\treturn {\n\t\t\t\terrors: [ error ],\n\t\t\t};\n\t\t}\n\t}\n\n\tconst deactivateFontFamily = ( font ) => {\n\t\t// If the user doesn't have custom fonts defined, include as custom fonts all the theme fonts\n\t\t// We want to save as active all the theme fonts at the beginning\n\t\tconst initialCustomFonts = fontFamilies?.[ font.source ] ?? [];\n\t\tconst newCustomFonts = initialCustomFonts.filter(\n\t\t\t( f ) => f.slug !== font.slug\n\t\t);\n\t\tsetFontFamilies( {\n\t\t\t...fontFamilies,\n\t\t\t[ font.source ]: newCustomFonts,\n\t\t} );\n\t};\n\n\tconst activateCustomFontFamilies = ( fontsToAdd ) => {\n\t\t// Merge the existing custom fonts with the new fonts.\n\t\tconst newCustomFonts = mergeFontFamilies(\n\t\t\tfontFamilies?.custom,\n\t\t\tfontsToAdd\n\t\t);\n\t\t// Activate the fonts by set the new custom fonts array.\n\t\tsetFontFamilies( {\n\t\t\t...fontFamilies,\n\t\t\tcustom: newCustomFonts,\n\t\t} );\n\t\t// Add custom fonts to the browser.\n\t\tfontsToAdd.forEach( ( font ) => {\n\t\t\tif ( font.fontFace ) {\n\t\t\t\tfont.fontFace.forEach( ( face ) => {\n\t\t\t\t\t// Load font faces just in the iframe because they already are in the document.\n\t\t\t\t\tloadFontFaceInBrowser(\n\t\t\t\t\t\tface,\n\t\t\t\t\t\tgetDisplaySrcFromFontFace( face.src ),\n\t\t\t\t\t\t'iframe'\n\t\t\t\t\t);\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\t};\n\n\tconst toggleActivateFont = ( font, face ) => {\n\t\t// If the user doesn't have custom fonts defined, include as custom fonts all the theme fonts\n\t\t// We want to save as active all the theme fonts at the beginning\n\t\tconst initialFonts = fontFamilies?.[ font.source ] ?? [];\n\t\t// Toggles the received font family or font face\n\t\tconst newFonts = toggleFont( font, face, initialFonts );\n\t\t// Updates the font families activated in global settings:\n\t\tsetFontFamilies( {\n\t\t\t...fontFamilies,\n\t\t\t[ font.source ]: newFonts,\n\t\t} );\n\t};\n\n\tconst loadFontFaceAsset = async ( fontFace ) => {\n\t\t// If the font doesn't have a src, don't load it.\n\t\tif ( ! fontFace.src ) return;\n\t\t// Get the src of the font.\n\t\tconst src = getDisplaySrcFromFontFace( fontFace.src, themeUrl );\n\t\t// If the font is already loaded, don't load it again.\n\t\tif ( ! src || loadedFontUrls.has( src ) ) return;\n\t\t// Load the font in the browser.\n\t\tloadFontFaceInBrowser( fontFace, src, 'document' );\n\t\t// Add the font to the loaded fonts list.\n\t\tloadedFontUrls.add( src );\n\t};\n\n\t// Font Collections\n\tconst [ collections, setFontCollections ] = useState( [] );\n\tconst getFontCollections = async () => {\n\t\tconst response = await fetchFontCollections();\n\t\tsetFontCollections( response );\n\t};\n\tconst getFontCollection = async ( id ) => {\n\t\tconst hasData = !! collections.find(\n\t\t\t( collection ) => collection.id === id\n\t\t)?.data;\n\t\tif ( hasData ) return;\n\t\tconst response = await fetchFontCollection( id );\n\t\tconst updatedCollections = collections.map( ( collection ) =>\n\t\t\tcollection.id === id\n\t\t\t\t? { ...collection, data: { ...response?.data } }\n\t\t\t\t: collection\n\t\t);\n\t\tsetFontCollections( updatedCollections );\n\t};\n\n\tuseEffect( () => {\n\t\tgetFontCollections();\n\t}, [] );\n\n\treturn (\n\t\t<FontLibraryContext.Provider\n\t\t\tvalue={ {\n\t\t\t\tlibraryFontSelected,\n\t\t\t\thandleSetLibraryFontSelected,\n\t\t\t\tthemeFonts,\n\t\t\t\tbaseThemeFonts,\n\t\t\t\tcustomFonts,\n\t\t\t\tbaseCustomFonts,\n\t\t\t\tisFontActivated,\n\t\t\t\tgetFontFacesActivated,\n\t\t\t\tloadFontFaceAsset,\n\t\t\t\tinstallFonts,\n\t\t\t\tuninstallFont,\n\t\t\t\ttoggleActivateFont,\n\t\t\t\tgetAvailableFontsOutline,\n\t\t\t\tmodalTabOpen,\n\t\t\t\ttoggleModal,\n\t\t\t\trefreshLibrary,\n\t\t\t\tsaveFontFamilies,\n\t\t\t\tfontFamiliesHasChanges,\n\t\t\t\tisResolvingLibrary,\n\t\t\t\thasResolvedLibrary,\n\t\t\t\tisInstalling,\n\t\t\t\tcollections,\n\t\t\t\tgetFontCollection,\n\t\t\t} }\n\t\t>\n\t\t\t{ children }\n\t\t</FontLibraryContext.Provider>\n\t);\n}\n\nexport default FontLibraryProvider;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,aAAa,EAAEC,QAAQ,EAAEC,SAAS,QAAQ,oBAAoB;AACvE,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,yBAAyB;AAC/E,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SACCC,eAAe,EACfC,gBAAgB,EAChBC,KAAK,IAAIC,SAAS,QACZ,sBAAsB;;AAE7B;AACA;AACA;AACA,SACCC,iBAAiB,EACjBC,mBAAmB,EACnBC,oBAAoB,EACpBC,mBAAmB,QACb,aAAa;AACpB,SAASC,MAAM,QAAQ,sB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