@wordpress/edit-site 5.25.0 → 5.25.1-next.79a6196f.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/LICENSE.md +1 -1
- package/build/components/block-editor/back-button.js +3 -2
- package/build/components/block-editor/back-button.js.map +1 -1
- package/build/components/block-editor/resizable-editor.js +2 -2
- package/build/components/block-editor/resizable-editor.js.map +1 -1
- package/build/components/block-editor/use-post-link-props.js +27 -0
- package/build/components/block-editor/use-post-link-props.js.map +1 -0
- package/build/components/block-editor/use-site-editor-settings.js +7 -24
- package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build/components/create-template-part-modal/index.js +15 -7
- package/build/components/create-template-part-modal/index.js.map +1 -1
- package/build/components/editor/index.js +15 -16
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor-canvas-container/index.js +9 -7
- package/build/components/editor-canvas-container/index.js.map +1 -1
- package/build/components/global-styles/font-library-modal/collection-font-variant.js +5 -2
- 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 +3 -3
- 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 +5 -5
- package/build/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-collection.js +8 -4
- package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build/components/global-styles/font-library-modal/index.js +38 -21
- package/build/components/global-styles/font-library-modal/index.js.map +1 -1
- package/build/components/global-styles/font-library-modal/installed-fonts.js +2 -2
- package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/library-font-variant.js +5 -2
- 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 +26 -10
- package/build/components/global-styles/font-library-modal/local-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/resolvers.js +6 -6
- package/build/components/global-styles/font-library-modal/resolvers.js.map +1 -1
- package/build/components/global-styles/font-library-modal/{tab-layout.js → tab-panel-layout.js} +4 -4
- package/build/components/global-styles/font-library-modal/tab-panel-layout.js.map +1 -0
- package/build/components/global-styles/font-library-modal/utils/index.js +35 -38
- package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
- package/build/components/global-styles/preview.js +43 -1
- package/build/components/global-styles/preview.js.map +1 -1
- package/build/components/global-styles/screen-color-palette.js +16 -12
- package/build/components/global-styles/screen-color-palette.js.map +1 -1
- package/build/components/global-styles/screen-revisions/index.js +52 -52
- package/build/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js +26 -35
- package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +40 -22
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build/components/global-styles/ui.js +13 -62
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/header-edit-mode/document-tools/index.js +8 -106
- package/build/components/header-edit-mode/document-tools/index.js.map +1 -1
- package/build/components/header-edit-mode/index.js +7 -11
- package/build/components/header-edit-mode/index.js.map +1 -1
- package/build/components/header-edit-mode/mode-switcher/index.js +0 -2
- package/build/components/header-edit-mode/mode-switcher/index.js.map +1 -1
- package/build/components/header-edit-mode/more-menu/index.js +10 -7
- package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
- package/build/components/keyboard-shortcuts/edit-mode.js +0 -23
- package/build/components/keyboard-shortcuts/edit-mode.js.map +1 -1
- package/build/components/keyboard-shortcuts/register.js +0 -36
- package/build/components/keyboard-shortcuts/register.js.map +1 -1
- package/build/components/layout/index.js +6 -13
- package/build/components/layout/index.js.map +1 -1
- package/build/components/page-main/index.js +4 -4
- package/build/components/page-main/index.js.map +1 -1
- package/build/components/page-pages/index.js +84 -37
- package/build/components/page-pages/index.js.map +1 -1
- package/build/components/page-patterns/dataviews-pattern-actions.js +305 -0
- package/build/components/page-patterns/dataviews-pattern-actions.js.map +1 -0
- package/build/components/page-patterns/dataviews-patterns.js +307 -0
- package/build/components/page-patterns/dataviews-patterns.js.map +1 -0
- package/build/components/page-patterns/duplicate-menu-item.js +1 -1
- package/build/components/page-patterns/duplicate-menu-item.js.map +1 -1
- package/build/components/page-patterns/grid-item.js +4 -3
- package/build/components/page-patterns/grid-item.js.map +1 -1
- package/build/components/page-patterns/patterns-list.js +2 -1
- package/build/components/page-patterns/patterns-list.js.map +1 -1
- package/build/components/page-patterns/use-patterns.js +23 -13
- package/build/components/page-patterns/use-patterns.js.map +1 -1
- package/build/components/page-templates/index.js +312 -36
- package/build/components/page-templates/index.js.map +1 -1
- package/build/components/{page-patterns/pagination.js → pagination/index.js} +25 -12
- package/build/components/pagination/index.js.map +1 -0
- package/build/components/{page-pages/side-editor.js → post-preview/index.js} +8 -4
- package/build/components/post-preview/index.js.map +1 -0
- package/build/components/preferences-modal/enable-feature.js +3 -2
- package/build/components/preferences-modal/enable-feature.js.map +1 -1
- package/build/components/preferences-modal/enable-panel-option.js +33 -0
- package/build/components/preferences-modal/enable-panel-option.js.map +1 -0
- package/build/components/preferences-modal/index.js +57 -9
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/revisions/index.js +3 -7
- package/build/components/revisions/index.js.map +1 -1
- package/build/components/routes/link.js +6 -2
- package/build/components/routes/link.js.map +1 -1
- package/build/components/save-button/index.js +6 -3
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/sidebar/index.js +3 -11
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-dataviews/add-new-view.js +2 -2
- package/build/components/sidebar-dataviews/add-new-view.js.map +1 -1
- package/build/components/sidebar-dataviews/default-views.js +18 -5
- package/build/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build/components/sidebar-dataviews/index.js +3 -3
- package/build/components/sidebar-dataviews/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/default-sidebar.js +1 -5
- package/build/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js +62 -10
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/index.js +1 -1
- package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -4
- package/build/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-panel/index.js +4 -13
- package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-details-footer/index.js +1 -1
- package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js +5 -2
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/index.js +4 -1
- package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pages-dataviews/index.js +69 -0
- package/build/components/sidebar-navigation-screen-pages-dataviews/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen-templates/index.js +63 -8
- package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build/components/style-book/index.js +38 -8
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build/hooks/commands/use-edit-mode-commands.js +11 -6
- package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build/index.js +12 -7
- package/build/index.js.map +1 -1
- package/build/store/actions.js +39 -44
- package/build/store/actions.js.map +1 -1
- package/build/store/private-actions.js +6 -2
- package/build/store/private-actions.js.map +1 -1
- package/build/store/reducer.js +0 -46
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +32 -41
- package/build/store/selectors.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/block-editor/back-button.js +4 -3
- package/build-module/components/block-editor/back-button.js.map +1 -1
- package/build-module/components/block-editor/resizable-editor.js +2 -2
- package/build-module/components/block-editor/resizable-editor.js.map +1 -1
- package/build-module/components/block-editor/use-post-link-props.js +20 -0
- package/build-module/components/block-editor/use-post-link-props.js.map +1 -0
- package/build-module/components/block-editor/use-site-editor-settings.js +8 -25
- package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build-module/components/create-template-part-modal/index.js +14 -7
- package/build-module/components/create-template-part-modal/index.js.map +1 -1
- package/build-module/components/editor/index.js +16 -17
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor-canvas-container/index.js +9 -7
- package/build-module/components/editor-canvas-container/index.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/collection-font-variant.js +5 -2
- package/build-module/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/confirm-delete-dialog.js +3 -3
- package/build-module/components/global-styles/font-library-modal/confirm-delete-dialog.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/context.js +7 -7
- package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/font-collection.js +8 -4
- package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/index.js +39 -22
- 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 +2 -2
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/library-font-variant.js +5 -2
- package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/local-fonts.js +27 -11
- 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 +5 -5
- 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 → tab-panel-layout.js} +4 -4
- package/build-module/components/global-styles/font-library-modal/tab-panel-layout.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/utils/index.js +34 -36
- package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
- package/build-module/components/global-styles/preview.js +45 -3
- package/build-module/components/global-styles/preview.js.map +1 -1
- package/build-module/components/global-styles/screen-color-palette.js +17 -13
- package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/index.js +53 -53
- package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +27 -36
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +40 -22
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build-module/components/global-styles/ui.js +15 -64
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/header-edit-mode/document-tools/index.js +13 -110
- package/build-module/components/header-edit-mode/document-tools/index.js.map +1 -1
- package/build-module/components/header-edit-mode/index.js +7 -11
- package/build-module/components/header-edit-mode/index.js.map +1 -1
- package/build-module/components/header-edit-mode/mode-switcher/index.js +0 -2
- package/build-module/components/header-edit-mode/mode-switcher/index.js.map +1 -1
- package/build-module/components/header-edit-mode/more-menu/index.js +10 -7
- package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/edit-mode.js +0 -23
- package/build-module/components/keyboard-shortcuts/edit-mode.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/register.js +0 -36
- package/build-module/components/keyboard-shortcuts/register.js.map +1 -1
- package/build-module/components/layout/index.js +6 -13
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/page-main/index.js +4 -4
- package/build-module/components/page-main/index.js.map +1 -1
- package/build-module/components/page-pages/index.js +83 -36
- package/build-module/components/page-pages/index.js.map +1 -1
- package/build-module/components/page-patterns/dataviews-pattern-actions.js +292 -0
- package/build-module/components/page-patterns/dataviews-pattern-actions.js.map +1 -0
- package/build-module/components/page-patterns/dataviews-patterns.js +299 -0
- package/build-module/components/page-patterns/dataviews-patterns.js.map +1 -0
- package/build-module/components/page-patterns/duplicate-menu-item.js +1 -1
- package/build-module/components/page-patterns/duplicate-menu-item.js.map +1 -1
- package/build-module/components/page-patterns/grid-item.js +4 -3
- package/build-module/components/page-patterns/grid-item.js.map +1 -1
- package/build-module/components/page-patterns/patterns-list.js +2 -1
- package/build-module/components/page-patterns/patterns-list.js.map +1 -1
- package/build-module/components/page-patterns/use-patterns.js +23 -13
- package/build-module/components/page-patterns/use-patterns.js.map +1 -1
- package/build-module/components/page-templates/index.js +314 -38
- package/build-module/components/page-templates/index.js.map +1 -1
- package/build-module/components/{page-patterns/pagination.js → pagination/index.js} +24 -12
- package/build-module/components/pagination/index.js.map +1 -0
- package/build-module/components/{page-pages/side-editor.js → post-preview/index.js} +7 -3
- package/build-module/components/post-preview/index.js.map +1 -0
- package/build-module/components/preferences-modal/enable-feature.js +3 -2
- package/build-module/components/preferences-modal/enable-feature.js.map +1 -1
- package/build-module/components/preferences-modal/enable-panel-option.js +26 -0
- package/build-module/components/preferences-modal/enable-panel-option.js.map +1 -0
- package/build-module/components/preferences-modal/index.js +57 -9
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/revisions/index.js +4 -8
- package/build-module/components/revisions/index.js.map +1 -1
- package/build-module/components/routes/link.js +5 -2
- package/build-module/components/routes/link.js.map +1 -1
- package/build-module/components/save-button/index.js +6 -3
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +3 -11
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-dataviews/add-new-view.js +1 -1
- package/build-module/components/sidebar-dataviews/add-new-view.js.map +1 -1
- package/build-module/components/sidebar-dataviews/default-views.js +17 -5
- package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build-module/components/sidebar-dataviews/index.js +2 -2
- package/build-module/components/sidebar-dataviews/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/default-sidebar.js +1 -5
- package/build-module/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +64 -12
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/index.js +2 -2
- package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -4
- package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/template-panel/index.js +6 -15
- package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-details-footer/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +5 -2
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-page/index.js +4 -1
- package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pages-dataviews/index.js +61 -0
- package/build-module/components/sidebar-navigation-screen-pages-dataviews/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-templates/index.js +64 -9
- package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build-module/components/style-book/index.js +40 -10
- package/build-module/components/style-book/index.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +1 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build-module/hooks/commands/use-edit-mode-commands.js +11 -6
- package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build-module/index.js +12 -7
- package/build-module/index.js.map +1 -1
- package/build-module/store/actions.js +36 -41
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/private-actions.js +6 -2
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/reducer.js +0 -44
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +30 -38
- package/build-module/store/selectors.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 +366 -268
- package/build-style/style.css +366 -268
- package/package.json +42 -42
- package/src/components/add-new-template/style.scss +2 -1
- package/src/components/block-editor/back-button.js +4 -2
- package/src/components/block-editor/resizable-editor.js +1 -1
- package/src/components/block-editor/style.scss +1 -2
- package/src/components/block-editor/use-post-link-props.js +20 -0
- package/src/components/block-editor/use-site-editor-settings.js +10 -41
- package/src/components/code-editor/style.scss +0 -4
- package/src/components/create-template-part-modal/index.js +83 -82
- package/src/components/editor/index.js +24 -31
- package/src/components/editor-canvas-container/index.js +8 -6
- package/src/components/global-styles/font-library-modal/collection-font-variant.js +7 -2
- package/src/components/global-styles/font-library-modal/confirm-delete-dialog.js +3 -3
- package/src/components/global-styles/font-library-modal/context.js +7 -7
- package/src/components/global-styles/font-library-modal/font-collection.js +10 -5
- package/src/components/global-styles/font-library-modal/index.js +44 -24
- package/src/components/global-styles/font-library-modal/installed-fonts.js +3 -3
- package/src/components/global-styles/font-library-modal/library-font-variant.js +7 -2
- package/src/components/global-styles/font-library-modal/local-fonts.js +53 -26
- package/src/components/global-styles/font-library-modal/resolvers.js +5 -5
- package/src/components/global-styles/font-library-modal/style.scss +5 -2
- package/src/components/global-styles/font-library-modal/{tab-layout.js → tab-panel-layout.js} +9 -3
- package/src/components/global-styles/font-library-modal/utils/index.js +21 -23
- package/src/components/global-styles/font-library-modal/utils/test/makeFormDataFromFontFamily.spec.js +58 -0
- package/src/components/global-styles/preview.js +55 -3
- package/src/components/global-styles/screen-color-palette.js +16 -26
- package/src/components/global-styles/screen-revisions/index.js +91 -92
- package/src/components/global-styles/screen-revisions/revisions-buttons.js +37 -38
- package/src/components/global-styles/screen-revisions/style.scss +77 -20
- package/src/components/global-styles/screen-revisions/test/use-global-styles-revisions.js +67 -0
- package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +73 -46
- package/src/components/global-styles/ui.js +13 -74
- package/src/components/header-edit-mode/document-tools/index.js +33 -165
- package/src/components/header-edit-mode/index.js +6 -17
- package/src/components/header-edit-mode/mode-switcher/index.js +0 -4
- package/src/components/header-edit-mode/more-menu/index.js +9 -7
- package/src/components/header-edit-mode/style.scss +0 -47
- package/src/components/keyboard-shortcuts/edit-mode.js +1 -26
- package/src/components/keyboard-shortcuts/register.js +0 -43
- package/src/components/layout/index.js +8 -27
- package/src/components/layout/style.scss +10 -3
- package/src/components/list/style.scss +0 -5
- package/src/components/page/style.scss +1 -1
- package/src/components/page-main/index.js +8 -8
- package/src/components/page-pages/index.js +112 -41
- package/src/components/page-pages/style.scss +3 -2
- package/src/components/page-patterns/dataviews-pattern-actions.js +329 -0
- package/src/components/page-patterns/dataviews-patterns.js +380 -0
- package/src/components/page-patterns/duplicate-menu-item.js +1 -1
- package/src/components/page-patterns/grid-item.js +3 -2
- package/src/components/page-patterns/patterns-list.js +2 -1
- package/src/components/page-patterns/style.scss +89 -26
- package/src/components/page-patterns/use-patterns.js +24 -15
- package/src/components/page-templates/index.js +399 -64
- package/src/components/{page-patterns/pagination.js → pagination/index.js} +21 -10
- package/src/components/pagination/style.scss +5 -0
- package/src/components/post-preview/index.js +16 -0
- package/src/components/preferences-modal/enable-feature.js +9 -5
- package/src/components/preferences-modal/enable-panel-option.js +23 -0
- package/src/components/preferences-modal/index.js +107 -22
- package/src/components/revisions/index.js +8 -15
- package/src/components/routes/link.js +11 -3
- package/src/components/save-button/index.js +16 -3
- package/src/components/sidebar/index.js +6 -13
- package/src/components/sidebar-dataviews/add-new-view.js +1 -1
- package/src/components/sidebar-dataviews/default-views.js +23 -6
- package/src/components/sidebar-dataviews/index.js +2 -2
- package/src/components/sidebar-edit-mode/default-sidebar.js +0 -12
- package/src/components/sidebar-edit-mode/global-styles-sidebar.js +85 -14
- package/src/components/sidebar-edit-mode/page-panels/index.js +15 -1
- package/src/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -12
- package/src/components/sidebar-edit-mode/style.scss +0 -10
- package/src/components/sidebar-edit-mode/template-panel/index.js +44 -40
- package/src/components/sidebar-edit-mode/template-panel/style.scss +0 -4
- package/src/components/sidebar-navigation-screen-details-footer/index.js +1 -1
- package/src/components/sidebar-navigation-screen-global-styles/index.js +3 -2
- package/src/components/sidebar-navigation-screen-page/index.js +2 -1
- package/src/components/sidebar-navigation-screen-pages-dataviews/index.js +77 -0
- package/src/components/sidebar-navigation-screen-templates/index.js +85 -28
- package/src/components/sidebar-navigation-screen-templates/style.scss +9 -0
- package/src/components/site-hub/style.scss +5 -2
- package/src/components/style-book/index.js +65 -21
- package/src/components/style-book/style.scss +3 -3
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +4 -1
- package/src/hooks/commands/use-edit-mode-commands.js +8 -12
- package/src/index.js +11 -5
- package/src/store/actions.js +35 -45
- package/src/store/private-actions.js +7 -3
- package/src/store/reducer.js +0 -44
- package/src/store/selectors.js +32 -38
- package/src/store/test/actions.js +11 -39
- package/src/store/test/reducer.js +1 -82
- package/src/store/test/selectors.js +0 -24
- package/src/style.scss +2 -1
- package/src/utils/get-is-list-page.js +2 -3
- package/build/components/global-styles/font-library-modal/tab-layout.js.map +0 -1
- package/build/components/global-styles/screen-revisions/get-revision-changes.js +0 -146
- package/build/components/global-styles/screen-revisions/get-revision-changes.js.map +0 -1
- package/build/components/header-edit-mode/undo-redo/redo.js +0 -41
- package/build/components/header-edit-mode/undo-redo/redo.js.map +0 -1
- package/build/components/header-edit-mode/undo-redo/undo.js +0 -40
- package/build/components/header-edit-mode/undo-redo/undo.js.map +0 -1
- package/build/components/page-pages/side-editor.js.map +0 -1
- package/build/components/page-patterns/pagination.js.map +0 -1
- package/build/components/page-templates/dataviews-templates.js +0 -317
- package/build/components/page-templates/dataviews-templates.js.map +0 -1
- package/build/components/secondary-sidebar/inserter-sidebar.js +0 -60
- package/build/components/secondary-sidebar/inserter-sidebar.js.map +0 -1
- package/build/components/secondary-sidebar/list-view-sidebar.js +0 -109
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +0 -1
- package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js +0 -35
- package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +0 -1
- package/build/components/sidebar-edit-mode/template-panel/last-revision.js +0 -73
- package/build/components/sidebar-edit-mode/template-panel/last-revision.js.map +0 -1
- package/build/components/sidebar-edit-mode/template-panel/pattern-categories.js +0 -219
- package/build/components/sidebar-edit-mode/template-panel/pattern-categories.js.map +0 -1
- package/build-module/components/global-styles/font-library-modal/tab-layout.js.map +0 -1
- package/build-module/components/global-styles/screen-revisions/get-revision-changes.js +0 -139
- package/build-module/components/global-styles/screen-revisions/get-revision-changes.js.map +0 -1
- package/build-module/components/header-edit-mode/undo-redo/redo.js +0 -33
- package/build-module/components/header-edit-mode/undo-redo/redo.js.map +0 -1
- package/build-module/components/header-edit-mode/undo-redo/undo.js +0 -32
- package/build-module/components/header-edit-mode/undo-redo/undo.js.map +0 -1
- package/build-module/components/page-pages/side-editor.js.map +0 -1
- package/build-module/components/page-patterns/pagination.js.map +0 -1
- package/build-module/components/page-templates/dataviews-templates.js +0 -309
- package/build-module/components/page-templates/dataviews-templates.js.map +0 -1
- package/build-module/components/secondary-sidebar/inserter-sidebar.js +0 -53
- package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +0 -1
- package/build-module/components/secondary-sidebar/list-view-sidebar.js +0 -102
- package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js +0 -27
- package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/template-panel/last-revision.js +0 -65
- package/build-module/components/sidebar-edit-mode/template-panel/last-revision.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/template-panel/pattern-categories.js +0 -209
- package/build-module/components/sidebar-edit-mode/template-panel/pattern-categories.js.map +0 -1
- package/src/components/global-styles/font-library-modal/utils/test/makeFormDataFromFontFamilies.spec.js +0 -62
- package/src/components/global-styles/font-library-modal/utils/test/wpKebabCase.spec.js +0 -28
- package/src/components/global-styles/screen-revisions/get-revision-changes.js +0 -171
- package/src/components/global-styles/screen-revisions/test/get-revision-changes.js +0 -191
- package/src/components/header-edit-mode/undo-redo/redo.js +0 -38
- package/src/components/header-edit-mode/undo-redo/undo.js +0 -34
- package/src/components/page-pages/side-editor.js +0 -14
- package/src/components/page-templates/dataviews-templates.js +0 -360
- package/src/components/secondary-sidebar/inserter-sidebar.js +0 -66
- package/src/components/secondary-sidebar/list-view-sidebar.js +0 -123
- package/src/components/secondary-sidebar/style.scss +0 -65
- package/src/components/sidebar-edit-mode/sidebar-fixed-bottom.js +0 -26
- package/src/components/sidebar-edit-mode/template-panel/last-revision.js +0 -82
- package/src/components/sidebar-edit-mode/template-panel/pattern-categories.js +0 -279
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = getRevisionChanges;
|
|
7
|
-
var _i18n = require("@wordpress/i18n");
|
|
8
|
-
/**
|
|
9
|
-
* WordPress dependencies
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
const globalStylesChangesCache = new Map();
|
|
13
|
-
const EMPTY_ARRAY = [];
|
|
14
|
-
const translationMap = {
|
|
15
|
-
caption: (0, _i18n.__)('Caption'),
|
|
16
|
-
link: (0, _i18n.__)('Link'),
|
|
17
|
-
button: (0, _i18n.__)('Button'),
|
|
18
|
-
heading: (0, _i18n.__)('Heading'),
|
|
19
|
-
'settings.color': (0, _i18n.__)('Color settings'),
|
|
20
|
-
'settings.typography': (0, _i18n.__)('Typography settings'),
|
|
21
|
-
'styles.color': (0, _i18n.__)('Colors'),
|
|
22
|
-
'styles.spacing': (0, _i18n.__)('Spacing'),
|
|
23
|
-
'styles.typography': (0, _i18n.__)('Typography')
|
|
24
|
-
};
|
|
25
|
-
const isObject = obj => obj !== null && typeof obj === 'object';
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Get the translation for a given global styles key.
|
|
29
|
-
* @param {string} key A key representing a path to a global style property or setting.
|
|
30
|
-
* @param {Record<string,string>} blockNames A key/value pair object of block names and their rendered titles.
|
|
31
|
-
* @return {string|undefined} A translated key or undefined if no translation exists.
|
|
32
|
-
*/
|
|
33
|
-
function getTranslation(key, blockNames) {
|
|
34
|
-
if (translationMap[key]) {
|
|
35
|
-
return translationMap[key];
|
|
36
|
-
}
|
|
37
|
-
const keyArray = key.split('.');
|
|
38
|
-
if (keyArray?.[0] === 'blocks') {
|
|
39
|
-
const blockName = blockNames[keyArray[1]];
|
|
40
|
-
return blockName ? (0, _i18n.sprintf)(
|
|
41
|
-
// translators: %s: block name.
|
|
42
|
-
(0, _i18n.__)('%s block'), blockName) : keyArray[1];
|
|
43
|
-
}
|
|
44
|
-
if (keyArray?.[0] === 'elements') {
|
|
45
|
-
return (0, _i18n.sprintf)(
|
|
46
|
-
// translators: %s: element name, e.g., heading button, link, caption.
|
|
47
|
-
(0, _i18n.__)('%s element'), translationMap[keyArray[1]]);
|
|
48
|
-
}
|
|
49
|
-
return undefined;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* A deep comparison of two objects, optimized for comparing global styles.
|
|
54
|
-
* @param {Object} changedObject The changed object to compare.
|
|
55
|
-
* @param {Object} originalObject The original object to compare against.
|
|
56
|
-
* @param {string} parentPath A key/value pair object of block names and their rendered titles.
|
|
57
|
-
* @return {string[]} An array of paths whose values have changed.
|
|
58
|
-
*/
|
|
59
|
-
function deepCompare(changedObject, originalObject, parentPath = '') {
|
|
60
|
-
// We have two non-object values to compare.
|
|
61
|
-
if (!isObject(changedObject) && !isObject(originalObject)) {
|
|
62
|
-
/*
|
|
63
|
-
* Only return a path if the value has changed.
|
|
64
|
-
* And then only the path name up to 2 levels deep.
|
|
65
|
-
*/
|
|
66
|
-
return changedObject !== originalObject ? parentPath.split('.').slice(0, 2).join('.') : undefined;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// Enable comparison when an object doesn't have a corresponding property to compare.
|
|
70
|
-
changedObject = isObject(changedObject) ? changedObject : {};
|
|
71
|
-
originalObject = isObject(originalObject) ? originalObject : {};
|
|
72
|
-
const allKeys = new Set([...Object.keys(changedObject), ...Object.keys(originalObject)]);
|
|
73
|
-
let diffs = [];
|
|
74
|
-
for (const key of allKeys) {
|
|
75
|
-
const path = parentPath ? parentPath + '.' + key : key;
|
|
76
|
-
const changedPath = deepCompare(changedObject[key], originalObject[key], path);
|
|
77
|
-
if (changedPath) {
|
|
78
|
-
diffs = diffs.concat(changedPath);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
return diffs;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Get an array of translated summarized global styles changes.
|
|
86
|
-
* Results are cached using a Map() key of `JSON.stringify( { revision, previousRevision } )`.
|
|
87
|
-
*
|
|
88
|
-
* @param {Object} revision The changed object to compare.
|
|
89
|
-
* @param {Object} previousRevision The original object to compare against.
|
|
90
|
-
* @param {Record<string,string>} blockNames A key/value pair object of block names and their rendered titles.
|
|
91
|
-
* @return {string[]} An array of translated changes.
|
|
92
|
-
*/
|
|
93
|
-
function getRevisionChanges(revision, previousRevision, blockNames) {
|
|
94
|
-
const cacheKey = JSON.stringify({
|
|
95
|
-
revision,
|
|
96
|
-
previousRevision
|
|
97
|
-
});
|
|
98
|
-
if (globalStylesChangesCache.has(cacheKey)) {
|
|
99
|
-
return globalStylesChangesCache.get(cacheKey);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
/*
|
|
103
|
-
* Compare the two revisions with normalized keys.
|
|
104
|
-
* The order of these keys determines the order in which
|
|
105
|
-
* they'll appear in the results.
|
|
106
|
-
*/
|
|
107
|
-
const changedValueTree = deepCompare({
|
|
108
|
-
styles: {
|
|
109
|
-
color: revision?.styles?.color,
|
|
110
|
-
typography: revision?.styles?.typography,
|
|
111
|
-
spacing: revision?.styles?.spacing
|
|
112
|
-
},
|
|
113
|
-
blocks: revision?.styles?.blocks,
|
|
114
|
-
elements: revision?.styles?.elements,
|
|
115
|
-
settings: revision?.settings
|
|
116
|
-
}, {
|
|
117
|
-
styles: {
|
|
118
|
-
color: previousRevision?.styles?.color,
|
|
119
|
-
typography: previousRevision?.styles?.typography,
|
|
120
|
-
spacing: previousRevision?.styles?.spacing
|
|
121
|
-
},
|
|
122
|
-
blocks: previousRevision?.styles?.blocks,
|
|
123
|
-
elements: previousRevision?.styles?.elements,
|
|
124
|
-
settings: previousRevision?.settings
|
|
125
|
-
});
|
|
126
|
-
if (!changedValueTree.length) {
|
|
127
|
-
globalStylesChangesCache.set(cacheKey, EMPTY_ARRAY);
|
|
128
|
-
return EMPTY_ARRAY;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
// Remove duplicate results.
|
|
132
|
-
const result = [...new Set(changedValueTree)]
|
|
133
|
-
/*
|
|
134
|
-
* Translate the keys.
|
|
135
|
-
* Remove duplicate or empty translations.
|
|
136
|
-
*/.reduce((acc, curr) => {
|
|
137
|
-
const translation = getTranslation(curr, blockNames);
|
|
138
|
-
if (translation && !acc.includes(translation)) {
|
|
139
|
-
acc.push(translation);
|
|
140
|
-
}
|
|
141
|
-
return acc;
|
|
142
|
-
}, []);
|
|
143
|
-
globalStylesChangesCache.set(cacheKey, result);
|
|
144
|
-
return result;
|
|
145
|
-
}
|
|
146
|
-
//# sourceMappingURL=get-revision-changes.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","globalStylesChangesCache","Map","EMPTY_ARRAY","translationMap","caption","__","link","button","heading","isObject","obj","getTranslation","key","blockNames","keyArray","split","blockName","sprintf","undefined","deepCompare","changedObject","originalObject","parentPath","slice","join","allKeys","Set","Object","keys","diffs","path","changedPath","concat","getRevisionChanges","revision","previousRevision","cacheKey","JSON","stringify","has","get","changedValueTree","styles","color","typography","spacing","blocks","elements","settings","length","set","result","reduce","acc","curr","translation","includes","push"],"sources":["@wordpress/edit-site/src/components/global-styles/screen-revisions/get-revision-changes.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\n\nconst globalStylesChangesCache = new Map();\nconst EMPTY_ARRAY = [];\n\nconst translationMap = {\n\tcaption: __( 'Caption' ),\n\tlink: __( 'Link' ),\n\tbutton: __( 'Button' ),\n\theading: __( 'Heading' ),\n\t'settings.color': __( 'Color settings' ),\n\t'settings.typography': __( 'Typography settings' ),\n\t'styles.color': __( 'Colors' ),\n\t'styles.spacing': __( 'Spacing' ),\n\t'styles.typography': __( 'Typography' ),\n};\n\nconst isObject = ( obj ) => obj !== null && typeof obj === 'object';\n\n/**\n * Get the translation for a given global styles key.\n * @param {string} key A key representing a path to a global style property or setting.\n * @param {Record<string,string>} blockNames A key/value pair object of block names and their rendered titles.\n * @return {string|undefined} A translated key or undefined if no translation exists.\n */\nfunction getTranslation( key, blockNames ) {\n\tif ( translationMap[ key ] ) {\n\t\treturn translationMap[ key ];\n\t}\n\n\tconst keyArray = key.split( '.' );\n\n\tif ( keyArray?.[ 0 ] === 'blocks' ) {\n\t\tconst blockName = blockNames[ keyArray[ 1 ] ];\n\t\treturn blockName\n\t\t\t? sprintf(\n\t\t\t\t\t// translators: %s: block name.\n\t\t\t\t\t__( '%s block' ),\n\t\t\t\t\tblockName\n\t\t\t )\n\t\t\t: keyArray[ 1 ];\n\t}\n\n\tif ( keyArray?.[ 0 ] === 'elements' ) {\n\t\treturn sprintf(\n\t\t\t// translators: %s: element name, e.g., heading button, link, caption.\n\t\t\t__( '%s element' ),\n\t\t\ttranslationMap[ keyArray[ 1 ] ]\n\t\t);\n\t}\n\n\treturn undefined;\n}\n\n/**\n * A deep comparison of two objects, optimized for comparing global styles.\n * @param {Object} changedObject The changed object to compare.\n * @param {Object} originalObject The original object to compare against.\n * @param {string} parentPath A key/value pair object of block names and their rendered titles.\n * @return {string[]} An array of paths whose values have changed.\n */\nfunction deepCompare( changedObject, originalObject, parentPath = '' ) {\n\t// We have two non-object values to compare.\n\tif ( ! isObject( changedObject ) && ! isObject( originalObject ) ) {\n\t\t/*\n\t\t * Only return a path if the value has changed.\n\t\t * And then only the path name up to 2 levels deep.\n\t\t */\n\t\treturn changedObject !== originalObject\n\t\t\t? parentPath.split( '.' ).slice( 0, 2 ).join( '.' )\n\t\t\t: undefined;\n\t}\n\n\t// Enable comparison when an object doesn't have a corresponding property to compare.\n\tchangedObject = isObject( changedObject ) ? changedObject : {};\n\toriginalObject = isObject( originalObject ) ? originalObject : {};\n\n\tconst allKeys = new Set( [\n\t\t...Object.keys( changedObject ),\n\t\t...Object.keys( originalObject ),\n\t] );\n\n\tlet diffs = [];\n\tfor ( const key of allKeys ) {\n\t\tconst path = parentPath ? parentPath + '.' + key : key;\n\t\tconst changedPath = deepCompare(\n\t\t\tchangedObject[ key ],\n\t\t\toriginalObject[ key ],\n\t\t\tpath\n\t\t);\n\t\tif ( changedPath ) {\n\t\t\tdiffs = diffs.concat( changedPath );\n\t\t}\n\t}\n\treturn diffs;\n}\n\n/**\n * Get an array of translated summarized global styles changes.\n * Results are cached using a Map() key of `JSON.stringify( { revision, previousRevision } )`.\n *\n * @param {Object} revision The changed object to compare.\n * @param {Object} previousRevision The original object to compare against.\n * @param {Record<string,string>} blockNames A key/value pair object of block names and their rendered titles.\n * @return {string[]} An array of translated changes.\n */\nexport default function getRevisionChanges(\n\trevision,\n\tpreviousRevision,\n\tblockNames\n) {\n\tconst cacheKey = JSON.stringify( { revision, previousRevision } );\n\n\tif ( globalStylesChangesCache.has( cacheKey ) ) {\n\t\treturn globalStylesChangesCache.get( cacheKey );\n\t}\n\n\t/*\n\t * Compare the two revisions with normalized keys.\n\t * The order of these keys determines the order in which\n\t * they'll appear in the results.\n\t */\n\tconst changedValueTree = deepCompare(\n\t\t{\n\t\t\tstyles: {\n\t\t\t\tcolor: revision?.styles?.color,\n\t\t\t\ttypography: revision?.styles?.typography,\n\t\t\t\tspacing: revision?.styles?.spacing,\n\t\t\t},\n\t\t\tblocks: revision?.styles?.blocks,\n\t\t\telements: revision?.styles?.elements,\n\t\t\tsettings: revision?.settings,\n\t\t},\n\t\t{\n\t\t\tstyles: {\n\t\t\t\tcolor: previousRevision?.styles?.color,\n\t\t\t\ttypography: previousRevision?.styles?.typography,\n\t\t\t\tspacing: previousRevision?.styles?.spacing,\n\t\t\t},\n\t\t\tblocks: previousRevision?.styles?.blocks,\n\t\t\telements: previousRevision?.styles?.elements,\n\t\t\tsettings: previousRevision?.settings,\n\t\t}\n\t);\n\n\tif ( ! changedValueTree.length ) {\n\t\tglobalStylesChangesCache.set( cacheKey, EMPTY_ARRAY );\n\t\treturn EMPTY_ARRAY;\n\t}\n\n\t// Remove duplicate results.\n\tconst result = [ ...new Set( changedValueTree ) ]\n\t\t/*\n\t\t * Translate the keys.\n\t\t * Remove duplicate or empty translations.\n\t\t */\n\t\t.reduce( ( acc, curr ) => {\n\t\t\tconst translation = getTranslation( curr, blockNames );\n\t\t\tif ( translation && ! acc.includes( translation ) ) {\n\t\t\t\tacc.push( translation );\n\t\t\t}\n\t\t\treturn acc;\n\t\t}, [] );\n\n\tglobalStylesChangesCache.set( cacheKey, result );\n\n\treturn result;\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA,MAAMC,wBAAwB,GAAG,IAAIC,GAAG,CAAC,CAAC;AAC1C,MAAMC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MAAMiD,MAAM,GAAG,CAAE,GAAG,IAAIzB,GAAG,CAAEe,gBAAiB,CAAC;EAC9C;AACF;AACA;AACA,KAHE,CAICW,MAAM,CAAE,CAAEC,GAAG,EAAEC,IAAI,KAAM;IACzB,MAAMC,WAAW,GAAG5C,cAAc,CAAE2C,IAAI,EAAEzC,UAAW,CAAC;IACtD,IAAK0C,WAAW,IAAI,CAAEF,GAAG,CAACG,QAAQ,CAAED,WAAY,CAAC,EAAG;MACnDF,GAAG,CAACI,IAAI,CAAEF,WAAY,CAAC;IACxB;IACA,OAAOF,GAAG;EACX,CAAC,EAAE,EAAG,CAAC;EAERrD,wBAAwB,CAACkD,GAAG,CAAEd,QAAQ,EAAEe,MAAO,CAAC;EAEhD,OAAOA,MAAM;AACd"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _i18n = require("@wordpress/i18n");
|
|
9
|
-
var _components = require("@wordpress/components");
|
|
10
|
-
var _data = require("@wordpress/data");
|
|
11
|
-
var _icons = require("@wordpress/icons");
|
|
12
|
-
var _keycodes = require("@wordpress/keycodes");
|
|
13
|
-
var _coreData = require("@wordpress/core-data");
|
|
14
|
-
var _element = require("@wordpress/element");
|
|
15
|
-
/**
|
|
16
|
-
* WordPress dependencies
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
function RedoButton(props, ref) {
|
|
20
|
-
const shortcut = (0, _keycodes.isAppleOS)() ? _keycodes.displayShortcut.primaryShift('z') : _keycodes.displayShortcut.primary('y');
|
|
21
|
-
const hasRedo = (0, _data.useSelect)(select => select(_coreData.store).hasRedo(), []);
|
|
22
|
-
const {
|
|
23
|
-
redo
|
|
24
|
-
} = (0, _data.useDispatch)(_coreData.store);
|
|
25
|
-
return (0, _react.createElement)(_components.Button, {
|
|
26
|
-
...props,
|
|
27
|
-
ref: ref,
|
|
28
|
-
icon: !(0, _i18n.isRTL)() ? _icons.redo : _icons.undo,
|
|
29
|
-
label: (0, _i18n.__)('Redo'),
|
|
30
|
-
shortcut: shortcut
|
|
31
|
-
// If there are no undo levels we don't want to actually disable this
|
|
32
|
-
// button, because it will remove focus for keyboard users.
|
|
33
|
-
// See: https://github.com/WordPress/gutenberg/issues/3486
|
|
34
|
-
,
|
|
35
|
-
"aria-disabled": !hasRedo,
|
|
36
|
-
onClick: hasRedo ? redo : undefined
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
var _default = (0, _element.forwardRef)(RedoButton);
|
|
40
|
-
exports.default = _default;
|
|
41
|
-
//# sourceMappingURL=redo.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_components","_data","_icons","_keycodes","_coreData","_element","RedoButton","props","ref","shortcut","isAppleOS","displayShortcut","primaryShift","primary","hasRedo","useSelect","select","coreStore","redo","useDispatch","_react","createElement","Button","icon","isRTL","redoIcon","undoIcon","label","__","onClick","undefined","_default","forwardRef","exports","default"],"sources":["@wordpress/edit-site/src/components/header-edit-mode/undo-redo/redo.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, isRTL } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { redo as redoIcon, undo as undoIcon } from '@wordpress/icons';\nimport { displayShortcut, isAppleOS } from '@wordpress/keycodes';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { forwardRef } from '@wordpress/element';\n\nfunction RedoButton( props, ref ) {\n\tconst shortcut = isAppleOS()\n\t\t? displayShortcut.primaryShift( 'z' )\n\t\t: displayShortcut.primary( 'y' );\n\n\tconst hasRedo = useSelect(\n\t\t( select ) => select( coreStore ).hasRedo(),\n\t\t[]\n\t);\n\tconst { redo } = useDispatch( coreStore );\n\treturn (\n\t\t<Button\n\t\t\t{ ...props }\n\t\t\tref={ ref }\n\t\t\ticon={ ! isRTL() ? redoIcon : undoIcon }\n\t\t\tlabel={ __( 'Redo' ) }\n\t\t\tshortcut={ shortcut }\n\t\t\t// If there are no undo levels we don't want to actually disable this\n\t\t\t// button, because it will remove focus for keyboard users.\n\t\t\t// See: https://github.com/WordPress/gutenberg/issues/3486\n\t\t\taria-disabled={ ! hasRedo }\n\t\t\tonClick={ hasRedo ? redo : undefined }\n\t\t/>\n\t);\n}\n\nexport default forwardRef( RedoButton );\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AATA;AACA;AACA;;AASA,SAASO,UAAUA,CAAEC,KAAK,EAAEC,GAAG,EAAG;EACjC,MAAMC,QAAQ,GAAG,IAAAC,mBAAS,EAAC,CAAC,GACzBC,yBAAe,CAACC,YAAY,CAAE,GAAI,CAAC,GACnCD,yBAAe,CAACE,OAAO,CAAE,GAAI,CAAC;EAEjC,MAAMC,OAAO,GAAG,IAAAC,eAAS,EACtBC,MAAM,IAAMA,MAAM,CAAEC,eAAU,CAAC,CAACH,OAAO,CAAC,CAAC,EAC3C,EACD,CAAC;EACD,MAAM;IAAEI;EAAK,CAAC,GAAG,IAAAC,iBAAW,EAAEF,eAAU,CAAC;EACzC,OACC,IAAAG,MAAA,CAAAC,aAAA,EAACrB,WAAA,CAAAsB,MAAM;IAAA,GACDf,KAAK;IACVC,GAAG,EAAGA,GAAK;IACXe,IAAI,EAAG,CAAE,IAAAC,WAAK,EAAC,CAAC,GAAGC,WAAQ,GAAGC,WAAU;IACxCC,KAAK,EAAG,IAAAC,QAAE,EAAE,MAAO,CAAG;IACtBnB,QAAQ,EAAGA;IACX;IACA;IACA;IAAA;IACA,iBAAgB,CAAEK,OAAS;IAC3Be,OAAO,EAAGf,OAAO,GAAGI,IAAI,GAAGY;EAAW,CACtC,CAAC;AAEJ;AAAC,IAAAC,QAAA,GAEc,IAAAC,mBAAU,EAAE1B,UAAW,CAAC;AAAA2B,OAAA,CAAAC,OAAA,GAAAH,QAAA"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _i18n = require("@wordpress/i18n");
|
|
9
|
-
var _components = require("@wordpress/components");
|
|
10
|
-
var _data = require("@wordpress/data");
|
|
11
|
-
var _icons = require("@wordpress/icons");
|
|
12
|
-
var _keycodes = require("@wordpress/keycodes");
|
|
13
|
-
var _coreData = require("@wordpress/core-data");
|
|
14
|
-
var _element = require("@wordpress/element");
|
|
15
|
-
/**
|
|
16
|
-
* WordPress dependencies
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
function UndoButton(props, ref) {
|
|
20
|
-
const hasUndo = (0, _data.useSelect)(select => select(_coreData.store).hasUndo(), []);
|
|
21
|
-
const {
|
|
22
|
-
undo
|
|
23
|
-
} = (0, _data.useDispatch)(_coreData.store);
|
|
24
|
-
return (0, _react.createElement)(_components.Button, {
|
|
25
|
-
...props,
|
|
26
|
-
ref: ref,
|
|
27
|
-
icon: !(0, _i18n.isRTL)() ? _icons.undo : _icons.redo,
|
|
28
|
-
label: (0, _i18n.__)('Undo'),
|
|
29
|
-
shortcut: _keycodes.displayShortcut.primary('z')
|
|
30
|
-
// If there are no undo levels we don't want to actually disable this
|
|
31
|
-
// button, because it will remove focus for keyboard users.
|
|
32
|
-
// See: https://github.com/WordPress/gutenberg/issues/3486
|
|
33
|
-
,
|
|
34
|
-
"aria-disabled": !hasUndo,
|
|
35
|
-
onClick: hasUndo ? undo : undefined
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
var _default = (0, _element.forwardRef)(UndoButton);
|
|
39
|
-
exports.default = _default;
|
|
40
|
-
//# sourceMappingURL=undo.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_components","_data","_icons","_keycodes","_coreData","_element","UndoButton","props","ref","hasUndo","useSelect","select","coreStore","undo","useDispatch","_react","createElement","Button","icon","isRTL","undoIcon","redoIcon","label","__","shortcut","displayShortcut","primary","onClick","undefined","_default","forwardRef","exports","default"],"sources":["@wordpress/edit-site/src/components/header-edit-mode/undo-redo/undo.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, isRTL } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { undo as undoIcon, redo as redoIcon } from '@wordpress/icons';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { forwardRef } from '@wordpress/element';\n\nfunction UndoButton( props, ref ) {\n\tconst hasUndo = useSelect(\n\t\t( select ) => select( coreStore ).hasUndo(),\n\t\t[]\n\t);\n\tconst { undo } = useDispatch( coreStore );\n\treturn (\n\t\t<Button\n\t\t\t{ ...props }\n\t\t\tref={ ref }\n\t\t\ticon={ ! isRTL() ? undoIcon : redoIcon }\n\t\t\tlabel={ __( 'Undo' ) }\n\t\t\tshortcut={ displayShortcut.primary( 'z' ) }\n\t\t\t// If there are no undo levels we don't want to actually disable this\n\t\t\t// button, because it will remove focus for keyboard users.\n\t\t\t// See: https://github.com/WordPress/gutenberg/issues/3486\n\t\t\taria-disabled={ ! hasUndo }\n\t\t\tonClick={ hasUndo ? undo : undefined }\n\t\t/>\n\t);\n}\n\nexport default forwardRef( UndoButton );\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AATA;AACA;AACA;;AASA,SAASO,UAAUA,CAAEC,KAAK,EAAEC,GAAG,EAAG;EACjC,MAAMC,OAAO,GAAG,IAAAC,eAAS,EACtBC,MAAM,IAAMA,MAAM,CAAEC,eAAU,CAAC,CAACH,OAAO,CAAC,CAAC,EAC3C,EACD,CAAC;EACD,MAAM;IAAEI;EAAK,CAAC,GAAG,IAAAC,iBAAW,EAAEF,eAAU,CAAC;EACzC,OACC,IAAAG,MAAA,CAAAC,aAAA,EAAChB,WAAA,CAAAiB,MAAM;IAAA,GACDV,KAAK;IACVC,GAAG,EAAGA,GAAK;IACXU,IAAI,EAAG,CAAE,IAAAC,WAAK,EAAC,CAAC,GAAGC,WAAQ,GAAGC,WAAU;IACxCC,KAAK,EAAG,IAAAC,QAAE,EAAE,MAAO,CAAG;IACtBC,QAAQ,EAAGC,yBAAe,CAACC,OAAO,CAAE,GAAI;IACxC;IACA;IACA;IAAA;IACA,iBAAgB,CAAEjB,OAAS;IAC3BkB,OAAO,EAAGlB,OAAO,GAAGI,IAAI,GAAGe;EAAW,CACtC,CAAC;AAEJ;AAAC,IAAAC,QAAA,GAEc,IAAAC,mBAAU,EAAExB,UAAW,CAAC;AAAAyB,OAAA,CAAAC,OAAA,GAAAH,QAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_editor","_interopRequireDefault","require","_useInitEditedEntityFromUrl","SideEditor","postType","postId","useInitEditedEntity","_react","createElement","default"],"sources":["@wordpress/edit-site/src/components/page-pages/side-editor.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport Editor from '../editor';\nimport { useInitEditedEntity } from '../sync-state-with-url/use-init-edited-entity-from-url';\n\nexport default function SideEditor( { postType, postId } ) {\n\tuseInitEditedEntity( {\n\t\tpostId,\n\t\tpostType,\n\t} );\n\n\treturn <Editor />;\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,2BAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIe,SAASE,UAAUA,CAAE;EAAEC,QAAQ;EAAEC;AAAO,CAAC,EAAG;EAC1D,IAAAC,+CAAmB,EAAE;IACpBD,MAAM;IACND;EACD,CAAE,CAAC;EAEH,OAAO,IAAAG,MAAA,CAAAC,aAAA,EAACT,OAAA,CAAAU,OAAM,MAAE,CAAC;AAClB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_i18n","Pagination","currentPage","numPages","changePage","totalItems","_react","createElement","__experimentalHStack","expanded","spacing","justify","className","__experimentalText","variant","sprintf","_n","Button","onClick","disabled","__","_x"],"sources":["@wordpress/edit-site/src/components/page-patterns/pagination.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalText as Text,\n\tButton,\n} from '@wordpress/components';\nimport { __, _x, _n, sprintf } from '@wordpress/i18n';\n\nexport default function Pagination( {\n\tcurrentPage,\n\tnumPages,\n\tchangePage,\n\ttotalItems,\n} ) {\n\treturn (\n\t\t<HStack\n\t\t\texpanded={ false }\n\t\t\tspacing={ 3 }\n\t\t\tjustify=\"flex-start\"\n\t\t\tclassName=\"edit-site-patterns__grid-pagination\"\n\t\t>\n\t\t\t<Text variant=\"muted\">\n\t\t\t\t{\n\t\t\t\t\t// translators: %s: Total number of patterns.\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t// translators: %s: Total number of patterns.\n\t\t\t\t\t\t_n( '%s item', '%s items', totalItems ),\n\t\t\t\t\t\ttotalItems\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t</Text>\n\t\t\t<HStack expanded={ false } spacing={ 1 }>\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\tonClick={ () => changePage( 1 ) }\n\t\t\t\t\tdisabled={ currentPage === 1 }\n\t\t\t\t\taria-label={ __( 'First page' ) }\n\t\t\t\t>\n\t\t\t\t\t«\n\t\t\t\t</Button>\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\tonClick={ () => changePage( currentPage - 1 ) }\n\t\t\t\t\tdisabled={ currentPage === 1 }\n\t\t\t\t\taria-label={ __( 'Previous page' ) }\n\t\t\t\t>\n\t\t\t\t\t‹\n\t\t\t\t</Button>\n\t\t\t</HStack>\n\t\t\t<Text variant=\"muted\">\n\t\t\t\t{ sprintf(\n\t\t\t\t\t// translators: %1$s: Current page number, %2$s: Total number of pages.\n\t\t\t\t\t_x( '%1$s of %2$s', 'paging' ),\n\t\t\t\t\tcurrentPage,\n\t\t\t\t\tnumPages\n\t\t\t\t) }\n\t\t\t</Text>\n\t\t\t<HStack expanded={ false } spacing={ 1 }>\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\tonClick={ () => changePage( currentPage + 1 ) }\n\t\t\t\t\tdisabled={ currentPage === numPages }\n\t\t\t\t\taria-label={ __( 'Next page' ) }\n\t\t\t\t>\n\t\t\t\t\t›\n\t\t\t\t</Button>\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\tonClick={ () => changePage( numPages ) }\n\t\t\t\t\tdisabled={ currentPage === numPages }\n\t\t\t\t\taria-label={ __( 'Last page' ) }\n\t\t\t\t>\n\t\t\t\t\t»\n\t\t\t\t</Button>\n\t\t\t</HStack>\n\t\t</HStack>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AARA;AACA;AACA;;AAQe,SAASE,UAAUA,CAAE;EACnCC,WAAW;EACXC,QAAQ;EACRC,UAAU;EACVC;AACD,CAAC,EAAG;EACH,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACT,WAA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AG,GACvC,IAAAJ,MAAA,CAAAC,aAAA,EAACT,WAAA,CAAAmB,MAAM;IACNH,OAAO,EAAC,UAAU;IAClBI,OAAO,EAAGA,CAAA,KAAMd,UAAU,CAAEF,WAAW,GAAG,CAAE,CAAG;IAC/CiB,QAAQ,EAAGjB,WAAW,KAAKC,QAAU;IACrC,cAAa,IAAAiB,QAAE,EAAE,WAAY;EAAG,GAChC,QAEO,CAAC,EACT,IAAAd,MAAA,CAAAC,aAAA,EAACT,WAAA,CAAAmB,MAAM;IACNH,OAAO,EAAC,UAAU;IAClBI,OAAO,EAAGA,CAAA,KAAMd,UAAU,CAAED,QAAS,CAAG;IACxCgB,QAAQ,EAAGjB,WAAW,KAAKC,QAAU;IACrC,cAAa,IAAAiB,QAAE,EAAE,WAAY;EAAG,GAChC,MAEO,CACD,CACD,CAAC;AAEX"}
|
|
@@ -1,317 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = DataviewsTemplates;
|
|
8
|
-
var _react = require("react");
|
|
9
|
-
var _removeAccents = _interopRequireDefault(require("remove-accents"));
|
|
10
|
-
var _components = require("@wordpress/components");
|
|
11
|
-
var _i18n = require("@wordpress/i18n");
|
|
12
|
-
var _element = require("@wordpress/element");
|
|
13
|
-
var _coreData = require("@wordpress/core-data");
|
|
14
|
-
var _htmlEntities = require("@wordpress/html-entities");
|
|
15
|
-
var _blocks = require("@wordpress/blocks");
|
|
16
|
-
var _blockEditor = require("@wordpress/block-editor");
|
|
17
|
-
var _dataviews = require("@wordpress/dataviews");
|
|
18
|
-
var _page = _interopRequireDefault(require("../page"));
|
|
19
|
-
var _link = _interopRequireDefault(require("../routes/link"));
|
|
20
|
-
var _addedBy = require("../list/added-by");
|
|
21
|
-
var _constants = require("../../utils/constants");
|
|
22
|
-
var _templateActions = require("./template-actions");
|
|
23
|
-
var _usePatternSettings = _interopRequireDefault(require("../page-patterns/use-pattern-settings"));
|
|
24
|
-
var _lockUnlock = require("../../lock-unlock");
|
|
25
|
-
/**
|
|
26
|
-
* External dependencies
|
|
27
|
-
*/
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* WordPress dependencies
|
|
31
|
-
*/
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Internal dependencies
|
|
35
|
-
*/
|
|
36
|
-
|
|
37
|
-
const {
|
|
38
|
-
ExperimentalBlockEditorProvider,
|
|
39
|
-
useGlobalStyle
|
|
40
|
-
} = (0, _lockUnlock.unlock)(_blockEditor.privateApis);
|
|
41
|
-
const EMPTY_ARRAY = [];
|
|
42
|
-
const defaultConfigPerViewType = {
|
|
43
|
-
[_constants.LAYOUT_TABLE]: {},
|
|
44
|
-
[_constants.LAYOUT_GRID]: {
|
|
45
|
-
mediaField: 'preview',
|
|
46
|
-
primaryField: 'title'
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
const DEFAULT_VIEW = {
|
|
50
|
-
type: _constants.LAYOUT_TABLE,
|
|
51
|
-
search: '',
|
|
52
|
-
page: 1,
|
|
53
|
-
perPage: 20,
|
|
54
|
-
// All fields are visible by default, so it's
|
|
55
|
-
// better to keep track of the hidden ones.
|
|
56
|
-
hiddenFields: ['preview'],
|
|
57
|
-
layout: {},
|
|
58
|
-
filters: []
|
|
59
|
-
};
|
|
60
|
-
function normalizeSearchInput(input = '') {
|
|
61
|
-
return (0, _removeAccents.default)(input.trim().toLowerCase());
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// TODO: these are going to be reused in the template part list.
|
|
65
|
-
// That's the reason for leaving the template parts code for now.
|
|
66
|
-
function TemplateTitle({
|
|
67
|
-
item
|
|
68
|
-
}) {
|
|
69
|
-
const {
|
|
70
|
-
isCustomized
|
|
71
|
-
} = (0, _addedBy.useAddedBy)(item.type, item.id);
|
|
72
|
-
return (0, _react.createElement)(_components.__experimentalVStack, {
|
|
73
|
-
spacing: 1
|
|
74
|
-
}, (0, _react.createElement)(_components.__experimentalView, {
|
|
75
|
-
as: "span",
|
|
76
|
-
className: "edit-site-list-title__customized-info"
|
|
77
|
-
}, (0, _react.createElement)(_link.default, {
|
|
78
|
-
params: {
|
|
79
|
-
postId: item.id,
|
|
80
|
-
postType: item.type,
|
|
81
|
-
canvas: 'edit'
|
|
82
|
-
}
|
|
83
|
-
}, (0, _htmlEntities.decodeEntities)(item.title?.rendered || item.slug) || (0, _i18n.__)('(no title)'))), isCustomized && (0, _react.createElement)("span", {
|
|
84
|
-
className: "edit-site-list-added-by__customized-info"
|
|
85
|
-
}, item.type === _constants.TEMPLATE_POST_TYPE ? (0, _i18n._x)('Customized', 'template') : (0, _i18n._x)('Customized', 'template part')));
|
|
86
|
-
}
|
|
87
|
-
function AuthorField({
|
|
88
|
-
item
|
|
89
|
-
}) {
|
|
90
|
-
const {
|
|
91
|
-
text,
|
|
92
|
-
icon,
|
|
93
|
-
imageUrl
|
|
94
|
-
} = (0, _addedBy.useAddedBy)(item.type, item.id);
|
|
95
|
-
return (0, _react.createElement)(_components.__experimentalHStack, {
|
|
96
|
-
alignment: "left",
|
|
97
|
-
spacing: 1
|
|
98
|
-
}, imageUrl ? (0, _react.createElement)(_addedBy.AvatarImage, {
|
|
99
|
-
imageUrl: imageUrl
|
|
100
|
-
}) : (0, _react.createElement)("div", {
|
|
101
|
-
className: "edit-site-list-added-by__icon"
|
|
102
|
-
}, (0, _react.createElement)(_components.Icon, {
|
|
103
|
-
icon: icon
|
|
104
|
-
})), (0, _react.createElement)("span", null, text));
|
|
105
|
-
}
|
|
106
|
-
function TemplatePreview({
|
|
107
|
-
content,
|
|
108
|
-
viewType
|
|
109
|
-
}) {
|
|
110
|
-
const settings = (0, _usePatternSettings.default)();
|
|
111
|
-
const [backgroundColor = 'white'] = useGlobalStyle('color.background');
|
|
112
|
-
const blocks = (0, _element.useMemo)(() => {
|
|
113
|
-
return (0, _blocks.parse)(content);
|
|
114
|
-
}, [content]);
|
|
115
|
-
if (!blocks?.length) {
|
|
116
|
-
return null;
|
|
117
|
-
}
|
|
118
|
-
// Wrap everything in a block editor provider to ensure 'styles' that are needed
|
|
119
|
-
// for the previews are synced between the site editor store and the block editor store.
|
|
120
|
-
// Additionally we need to have the `__experimentalBlockPatterns` setting in order to
|
|
121
|
-
// render patterns inside the previews.
|
|
122
|
-
// TODO: Same approach is used in the patterns list and it becomes obvious that some of
|
|
123
|
-
// the block editor settings are needed in context where we don't have the block editor.
|
|
124
|
-
// Explore how we can solve this in a better way.
|
|
125
|
-
return (0, _react.createElement)(ExperimentalBlockEditorProvider, {
|
|
126
|
-
settings: settings
|
|
127
|
-
}, (0, _react.createElement)("div", {
|
|
128
|
-
className: `page-templates-preview-field is-viewtype-${viewType}`,
|
|
129
|
-
style: {
|
|
130
|
-
backgroundColor
|
|
131
|
-
}
|
|
132
|
-
}, (0, _react.createElement)(_blockEditor.BlockPreview, {
|
|
133
|
-
blocks: blocks
|
|
134
|
-
})));
|
|
135
|
-
}
|
|
136
|
-
function DataviewsTemplates() {
|
|
137
|
-
const [view, setView] = (0, _element.useState)(DEFAULT_VIEW);
|
|
138
|
-
const {
|
|
139
|
-
records: allTemplates,
|
|
140
|
-
isResolving: isLoadingData
|
|
141
|
-
} = (0, _coreData.useEntityRecords)('postType', _constants.TEMPLATE_POST_TYPE, {
|
|
142
|
-
per_page: -1
|
|
143
|
-
});
|
|
144
|
-
const authors = (0, _element.useMemo)(() => {
|
|
145
|
-
if (!allTemplates) {
|
|
146
|
-
return EMPTY_ARRAY;
|
|
147
|
-
}
|
|
148
|
-
const authorsSet = new Set();
|
|
149
|
-
allTemplates.forEach(template => {
|
|
150
|
-
authorsSet.add(template.author_text);
|
|
151
|
-
});
|
|
152
|
-
return Array.from(authorsSet).map(author => ({
|
|
153
|
-
value: author,
|
|
154
|
-
label: author
|
|
155
|
-
}));
|
|
156
|
-
}, [allTemplates]);
|
|
157
|
-
const fields = (0, _element.useMemo)(() => [{
|
|
158
|
-
header: (0, _i18n.__)('Preview'),
|
|
159
|
-
id: 'preview',
|
|
160
|
-
render: ({
|
|
161
|
-
item
|
|
162
|
-
}) => {
|
|
163
|
-
return (0, _react.createElement)(TemplatePreview, {
|
|
164
|
-
content: item.content.raw,
|
|
165
|
-
viewType: view.type
|
|
166
|
-
});
|
|
167
|
-
},
|
|
168
|
-
minWidth: 120,
|
|
169
|
-
maxWidth: 120,
|
|
170
|
-
enableSorting: false
|
|
171
|
-
}, {
|
|
172
|
-
header: (0, _i18n.__)('Template'),
|
|
173
|
-
id: 'title',
|
|
174
|
-
getValue: ({
|
|
175
|
-
item
|
|
176
|
-
}) => item.title?.rendered || item.slug,
|
|
177
|
-
render: ({
|
|
178
|
-
item
|
|
179
|
-
}) => (0, _react.createElement)(TemplateTitle, {
|
|
180
|
-
item: item
|
|
181
|
-
}),
|
|
182
|
-
maxWidth: 400,
|
|
183
|
-
enableHiding: false
|
|
184
|
-
}, {
|
|
185
|
-
header: (0, _i18n.__)('Description'),
|
|
186
|
-
id: 'description',
|
|
187
|
-
getValue: ({
|
|
188
|
-
item
|
|
189
|
-
}) => item.description,
|
|
190
|
-
render: ({
|
|
191
|
-
item
|
|
192
|
-
}) => {
|
|
193
|
-
return item.description ? (0, _htmlEntities.decodeEntities)(item.description) : (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_components.__experimentalText, {
|
|
194
|
-
variant: "muted",
|
|
195
|
-
"aria-hidden": "true"
|
|
196
|
-
}, "\u2014"), (0, _react.createElement)(_components.VisuallyHidden, null, (0, _i18n.__)('No description.')));
|
|
197
|
-
},
|
|
198
|
-
maxWidth: 200,
|
|
199
|
-
enableSorting: false
|
|
200
|
-
}, {
|
|
201
|
-
header: (0, _i18n.__)('Author'),
|
|
202
|
-
id: 'author',
|
|
203
|
-
getValue: ({
|
|
204
|
-
item
|
|
205
|
-
}) => item.author_text,
|
|
206
|
-
render: ({
|
|
207
|
-
item
|
|
208
|
-
}) => {
|
|
209
|
-
return (0, _react.createElement)(AuthorField, {
|
|
210
|
-
item: item
|
|
211
|
-
});
|
|
212
|
-
},
|
|
213
|
-
enableHiding: false,
|
|
214
|
-
type: _constants.ENUMERATION_TYPE,
|
|
215
|
-
elements: authors
|
|
216
|
-
}], [authors, view]);
|
|
217
|
-
const {
|
|
218
|
-
shownTemplates,
|
|
219
|
-
paginationInfo
|
|
220
|
-
} = (0, _element.useMemo)(() => {
|
|
221
|
-
if (!allTemplates) {
|
|
222
|
-
return {
|
|
223
|
-
shownTemplates: EMPTY_ARRAY,
|
|
224
|
-
paginationInfo: {
|
|
225
|
-
totalItems: 0,
|
|
226
|
-
totalPages: 0
|
|
227
|
-
}
|
|
228
|
-
};
|
|
229
|
-
}
|
|
230
|
-
let filteredTemplates = [...allTemplates];
|
|
231
|
-
// Handle global search.
|
|
232
|
-
if (view.search) {
|
|
233
|
-
const normalizedSearch = normalizeSearchInput(view.search);
|
|
234
|
-
filteredTemplates = filteredTemplates.filter(item => {
|
|
235
|
-
const title = item.title?.rendered || item.slug;
|
|
236
|
-
return normalizeSearchInput(title).includes(normalizedSearch) || normalizeSearchInput(item.description).includes(normalizedSearch);
|
|
237
|
-
});
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
// Handle filters.
|
|
241
|
-
if (view.filters.length > 0) {
|
|
242
|
-
view.filters.forEach(filter => {
|
|
243
|
-
if (filter.field === 'author' && filter.operator === _constants.OPERATOR_IN && !!filter.value) {
|
|
244
|
-
filteredTemplates = filteredTemplates.filter(item => {
|
|
245
|
-
return item.author_text === filter.value;
|
|
246
|
-
});
|
|
247
|
-
} else if (filter.field === 'author' && filter.operator === _constants.OPERATOR_NOT_IN && !!filter.value) {
|
|
248
|
-
filteredTemplates = filteredTemplates.filter(item => {
|
|
249
|
-
return item.author_text !== filter.value;
|
|
250
|
-
});
|
|
251
|
-
}
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
// Handle sorting.
|
|
256
|
-
if (view.sort) {
|
|
257
|
-
const stringSortingFields = ['title', 'author'];
|
|
258
|
-
const fieldId = view.sort.field;
|
|
259
|
-
if (stringSortingFields.includes(fieldId)) {
|
|
260
|
-
const fieldToSort = fields.find(field => {
|
|
261
|
-
return field.id === fieldId;
|
|
262
|
-
});
|
|
263
|
-
filteredTemplates.sort((a, b) => {
|
|
264
|
-
var _fieldToSort$getValue, _fieldToSort$getValue2;
|
|
265
|
-
const valueA = (_fieldToSort$getValue = fieldToSort.getValue({
|
|
266
|
-
item: a
|
|
267
|
-
})) !== null && _fieldToSort$getValue !== void 0 ? _fieldToSort$getValue : '';
|
|
268
|
-
const valueB = (_fieldToSort$getValue2 = fieldToSort.getValue({
|
|
269
|
-
item: b
|
|
270
|
-
})) !== null && _fieldToSort$getValue2 !== void 0 ? _fieldToSort$getValue2 : '';
|
|
271
|
-
return view.sort.direction === 'asc' ? valueA.localeCompare(valueB) : valueB.localeCompare(valueA);
|
|
272
|
-
});
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
// Handle pagination.
|
|
277
|
-
const start = (view.page - 1) * view.perPage;
|
|
278
|
-
const totalItems = filteredTemplates?.length || 0;
|
|
279
|
-
filteredTemplates = filteredTemplates?.slice(start, start + view.perPage);
|
|
280
|
-
return {
|
|
281
|
-
shownTemplates: filteredTemplates,
|
|
282
|
-
paginationInfo: {
|
|
283
|
-
totalItems,
|
|
284
|
-
totalPages: Math.ceil(totalItems / view.perPage)
|
|
285
|
-
}
|
|
286
|
-
};
|
|
287
|
-
}, [allTemplates, view, fields]);
|
|
288
|
-
const resetTemplateAction = (0, _templateActions.useResetTemplateAction)();
|
|
289
|
-
const actions = (0, _element.useMemo)(() => [resetTemplateAction, _templateActions.deleteTemplateAction, _templateActions.renameTemplateAction], [resetTemplateAction]);
|
|
290
|
-
const onChangeView = (0, _element.useCallback)(viewUpdater => {
|
|
291
|
-
let updatedView = typeof viewUpdater === 'function' ? viewUpdater(view) : viewUpdater;
|
|
292
|
-
if (updatedView.type !== view.type) {
|
|
293
|
-
updatedView = {
|
|
294
|
-
...updatedView,
|
|
295
|
-
layout: {
|
|
296
|
-
...defaultConfigPerViewType[updatedView.type]
|
|
297
|
-
}
|
|
298
|
-
};
|
|
299
|
-
}
|
|
300
|
-
setView(updatedView);
|
|
301
|
-
}, [view, setView]);
|
|
302
|
-
return (0, _react.createElement)(_page.default, {
|
|
303
|
-
title: (0, _i18n.__)('Templates')
|
|
304
|
-
}, (0, _react.createElement)(_dataviews.DataViews, {
|
|
305
|
-
paginationInfo: paginationInfo,
|
|
306
|
-
fields: fields,
|
|
307
|
-
actions: actions,
|
|
308
|
-
data: shownTemplates,
|
|
309
|
-
getItemId: item => item.id,
|
|
310
|
-
isLoading: isLoadingData,
|
|
311
|
-
view: view,
|
|
312
|
-
onChangeView: onChangeView,
|
|
313
|
-
supportedLayouts: [_constants.LAYOUT_TABLE, _constants.LAYOUT_GRID],
|
|
314
|
-
deferredRendering: !view.hiddenFields?.includes('preview')
|
|
315
|
-
}));
|
|
316
|
-
}
|
|
317
|
-
//# sourceMappingURL=dataviews-templates.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_removeAccents","_interopRequireDefault","require","_components","_i18n","_element","_coreData","_htmlEntities","_blocks","_blockEditor","_dataviews","_page","_link","_addedBy","_constants","_templateActions","_usePatternSettings","_lockUnlock","ExperimentalBlockEditorProvider","useGlobalStyle","unlock","blockEditorPrivateApis","EMPTY_ARRAY","defaultConfigPerViewType","LAYOUT_TABLE","LAYOUT_GRID","mediaField","primaryField","DEFAULT_VIEW","type","search","page","perPage","hiddenFields","layout","filters","normalizeSearchInput","input","removeAccents","trim","toLowerCase","TemplateTitle","item","isCustomized","useAddedBy","id","_react","createElement","__experimentalVStack","spacing","__experimentalView","as","className","default","params","postId","postType","canvas","decodeEntities","title","rendered","slug","__","TEMPLATE_POST_TYPE","_x","AuthorField","text","icon","imageUrl","__experimentalHStack","alignment","AvatarImage","Icon","TemplatePreview","content","viewType","settings","usePatternSettings","backgroundColor","blocks","useMemo","parse","length","style","BlockPreview","DataviewsTemplates","view","setView","useState","records","allTemplates","isResolving","isLoadingData","useEntityRecords","per_page","authors","authorsSet","Set","forEach","template","add","author_text","Array","from","map","author","value","label","fields","header","render","raw","minWidth","maxWidth","enableSorting","getValue","enableHiding","description","Fragment","__experimentalText","variant","VisuallyHidden","ENUMERATION_TYPE","elements","shownTemplates","paginationInfo","totalItems","totalPages","filteredTemplates","normalizedSearch","filter","includes","field","operator","OPERATOR_IN","OPERATOR_NOT_IN","sort","stringSortingFields","fieldId","fieldToSort","find","a","b","_fieldToSort$getValue","_fieldToSort$getValue2","valueA","valueB","direction","localeCompare","start","slice","Math","ceil","resetTemplateAction","useResetTemplateAction","actions","deleteTemplateAction","renameTemplateAction","onChangeView","useCallback","viewUpdater","updatedView","DataViews","data","getItemId","isLoading","supportedLayouts","deferredRendering"],"sources":["@wordpress/edit-site/src/components/page-templates/dataviews-templates.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport removeAccents from 'remove-accents';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tIcon,\n\t__experimentalView as View,\n\t__experimentalText as Text,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tVisuallyHidden,\n} from '@wordpress/components';\nimport { __, _x } from '@wordpress/i18n';\nimport { useState, useMemo, useCallback } from '@wordpress/element';\nimport { useEntityRecords } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { parse } from '@wordpress/blocks';\nimport {\n\tBlockPreview,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { DataViews } from '@wordpress/dataviews';\n\n/**\n * Internal dependencies\n */\nimport Page from '../page';\nimport Link from '../routes/link';\nimport { useAddedBy, AvatarImage } from '../list/added-by';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tENUMERATION_TYPE,\n\tOPERATOR_IN,\n\tOPERATOR_NOT_IN,\n\tLAYOUT_GRID,\n\tLAYOUT_TABLE,\n} from '../../utils/constants';\nimport {\n\tuseResetTemplateAction,\n\tdeleteTemplateAction,\n\trenameTemplateAction,\n} from './template-actions';\nimport usePatternSettings from '../page-patterns/use-pattern-settings';\nimport { unlock } from '../../lock-unlock';\n\nconst { ExperimentalBlockEditorProvider, useGlobalStyle } = unlock(\n\tblockEditorPrivateApis\n);\n\nconst EMPTY_ARRAY = [];\n\nconst defaultConfigPerViewType = {\n\t[ LAYOUT_TABLE ]: {},\n\t[ LAYOUT_GRID ]: {\n\t\tmediaField: 'preview',\n\t\tprimaryField: 'title',\n\t},\n};\n\nconst DEFAULT_VIEW = {\n\ttype: LAYOUT_TABLE,\n\tsearch: '',\n\tpage: 1,\n\tperPage: 20,\n\t// All fields are visible by default, so it's\n\t// better to keep track of the hidden ones.\n\thiddenFields: [ 'preview' ],\n\tlayout: {},\n\tfilters: [],\n};\n\nfunction normalizeSearchInput( input = '' ) {\n\treturn removeAccents( input.trim().toLowerCase() );\n}\n\n// TODO: these are going to be reused in the template part list.\n// That's the reason for leaving the template parts code for now.\nfunction TemplateTitle( { item } ) {\n\tconst { isCustomized } = useAddedBy( item.type, item.id );\n\treturn (\n\t\t<VStack spacing={ 1 }>\n\t\t\t<View as=\"span\" className=\"edit-site-list-title__customized-info\">\n\t\t\t\t<Link\n\t\t\t\t\tparams={ {\n\t\t\t\t\t\tpostId: item.id,\n\t\t\t\t\t\tpostType: item.type,\n\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ decodeEntities( item.title?.rendered || item.slug ) ||\n\t\t\t\t\t\t__( '(no title)' ) }\n\t\t\t\t</Link>\n\t\t\t</View>\n\t\t\t{ isCustomized && (\n\t\t\t\t<span className=\"edit-site-list-added-by__customized-info\">\n\t\t\t\t\t{ item.type === TEMPLATE_POST_TYPE\n\t\t\t\t\t\t? _x( 'Customized', 'template' )\n\t\t\t\t\t\t: _x( 'Customized', 'template part' ) }\n\t\t\t\t</span>\n\t\t\t) }\n\t\t</VStack>\n\t);\n}\n\nfunction AuthorField( { item } ) {\n\tconst { text, icon, imageUrl } = useAddedBy( item.type, item.id );\n\treturn (\n\t\t<HStack alignment=\"left\" spacing={ 1 }>\n\t\t\t{ imageUrl ? (\n\t\t\t\t<AvatarImage imageUrl={ imageUrl } />\n\t\t\t) : (\n\t\t\t\t<div className=\"edit-site-list-added-by__icon\">\n\t\t\t\t\t<Icon icon={ icon } />\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t<span>{ text }</span>\n\t\t</HStack>\n\t);\n}\n\nfunction TemplatePreview( { content, viewType } ) {\n\tconst settings = usePatternSettings();\n\tconst [ backgroundColor = 'white' ] = useGlobalStyle( 'color.background' );\n\tconst blocks = useMemo( () => {\n\t\treturn parse( content );\n\t}, [ content ] );\n\tif ( ! blocks?.length ) {\n\t\treturn null;\n\t}\n\t// Wrap everything in a block editor provider to ensure 'styles' that are needed\n\t// for the previews are synced between the site editor store and the block editor store.\n\t// Additionally we need to have the `__experimentalBlockPatterns` setting in order to\n\t// render patterns inside the previews.\n\t// TODO: Same approach is used in the patterns list and it becomes obvious that some of\n\t// the block editor settings are needed in context where we don't have the block editor.\n\t// Explore how we can solve this in a better way.\n\treturn (\n\t\t<ExperimentalBlockEditorProvider settings={ settings }>\n\t\t\t<div\n\t\t\t\tclassName={ `page-templates-preview-field is-viewtype-${ viewType }` }\n\t\t\t\tstyle={ { backgroundColor } }\n\t\t\t>\n\t\t\t\t<BlockPreview blocks={ blocks } />\n\t\t\t</div>\n\t\t</ExperimentalBlockEditorProvider>\n\t);\n}\n\nexport default function DataviewsTemplates() {\n\tconst [ view, setView ] = useState( DEFAULT_VIEW );\n\tconst { records: allTemplates, isResolving: isLoadingData } =\n\t\tuseEntityRecords( 'postType', TEMPLATE_POST_TYPE, {\n\t\t\tper_page: -1,\n\t\t} );\n\n\tconst authors = useMemo( () => {\n\t\tif ( ! allTemplates ) {\n\t\t\treturn EMPTY_ARRAY;\n\t\t}\n\t\tconst authorsSet = new Set();\n\t\tallTemplates.forEach( ( template ) => {\n\t\t\tauthorsSet.add( template.author_text );\n\t\t} );\n\t\treturn Array.from( authorsSet ).map( ( author ) => ( {\n\t\t\tvalue: author,\n\t\t\tlabel: author,\n\t\t} ) );\n\t}, [ allTemplates ] );\n\n\tconst fields = useMemo(\n\t\t() => [\n\t\t\t{\n\t\t\t\theader: __( 'Preview' ),\n\t\t\t\tid: 'preview',\n\t\t\t\trender: ( { item } ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<TemplatePreview\n\t\t\t\t\t\t\tcontent={ item.content.raw }\n\t\t\t\t\t\t\tviewType={ view.type }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\tminWidth: 120,\n\t\t\t\tmaxWidth: 120,\n\t\t\t\tenableSorting: false,\n\t\t\t},\n\t\t\t{\n\t\t\t\theader: __( 'Template' ),\n\t\t\t\tid: 'title',\n\t\t\t\tgetValue: ( { item } ) => item.title?.rendered || item.slug,\n\t\t\t\trender: ( { item } ) => <TemplateTitle item={ item } />,\n\t\t\t\tmaxWidth: 400,\n\t\t\t\tenableHiding: false,\n\t\t\t},\n\t\t\t{\n\t\t\t\theader: __( 'Description' ),\n\t\t\t\tid: 'description',\n\t\t\t\tgetValue: ( { item } ) => item.description,\n\t\t\t\trender: ( { item } ) => {\n\t\t\t\t\treturn item.description ? (\n\t\t\t\t\t\tdecodeEntities( item.description )\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<Text variant=\"muted\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t\t—\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t<VisuallyHidden>\n\t\t\t\t\t\t\t\t{ __( 'No description.' ) }\n\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t</>\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\tmaxWidth: 200,\n\t\t\t\tenableSorting: false,\n\t\t\t},\n\t\t\t{\n\t\t\t\theader: __( 'Author' ),\n\t\t\t\tid: 'author',\n\t\t\t\tgetValue: ( { item } ) => item.author_text,\n\t\t\t\trender: ( { item } ) => {\n\t\t\t\t\treturn <AuthorField item={ item } />;\n\t\t\t\t},\n\t\t\t\tenableHiding: false,\n\t\t\t\ttype: ENUMERATION_TYPE,\n\t\t\t\telements: authors,\n\t\t\t},\n\t\t],\n\t\t[ authors, view ]\n\t);\n\n\tconst { shownTemplates, paginationInfo } = useMemo( () => {\n\t\tif ( ! allTemplates ) {\n\t\t\treturn {\n\t\t\t\tshownTemplates: EMPTY_ARRAY,\n\t\t\t\tpaginationInfo: { totalItems: 0, totalPages: 0 },\n\t\t\t};\n\t\t}\n\t\tlet filteredTemplates = [ ...allTemplates ];\n\t\t// Handle global search.\n\t\tif ( view.search ) {\n\t\t\tconst normalizedSearch = normalizeSearchInput( view.search );\n\t\t\tfilteredTemplates = filteredTemplates.filter( ( item ) => {\n\t\t\t\tconst title = item.title?.rendered || item.slug;\n\t\t\t\treturn (\n\t\t\t\t\tnormalizeSearchInput( title ).includes(\n\t\t\t\t\t\tnormalizedSearch\n\t\t\t\t\t) ||\n\t\t\t\t\tnormalizeSearchInput( item.description ).includes(\n\t\t\t\t\t\tnormalizedSearch\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t} );\n\t\t}\n\n\t\t// Handle filters.\n\t\tif ( view.filters.length > 0 ) {\n\t\t\tview.filters.forEach( ( filter ) => {\n\t\t\t\tif (\n\t\t\t\t\tfilter.field === 'author' &&\n\t\t\t\t\tfilter.operator === OPERATOR_IN &&\n\t\t\t\t\t!! filter.value\n\t\t\t\t) {\n\t\t\t\t\tfilteredTemplates = filteredTemplates.filter( ( item ) => {\n\t\t\t\t\t\treturn item.author_text === filter.value;\n\t\t\t\t\t} );\n\t\t\t\t} else if (\n\t\t\t\t\tfilter.field === 'author' &&\n\t\t\t\t\tfilter.operator === OPERATOR_NOT_IN &&\n\t\t\t\t\t!! filter.value\n\t\t\t\t) {\n\t\t\t\t\tfilteredTemplates = filteredTemplates.filter( ( item ) => {\n\t\t\t\t\t\treturn item.author_text !== filter.value;\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\t// Handle sorting.\n\t\tif ( view.sort ) {\n\t\t\tconst stringSortingFields = [ 'title', 'author' ];\n\t\t\tconst fieldId = view.sort.field;\n\t\t\tif ( stringSortingFields.includes( fieldId ) ) {\n\t\t\t\tconst fieldToSort = fields.find( ( field ) => {\n\t\t\t\t\treturn field.id === fieldId;\n\t\t\t\t} );\n\t\t\t\tfilteredTemplates.sort( ( a, b ) => {\n\t\t\t\t\tconst valueA = fieldToSort.getValue( { item: a } ) ?? '';\n\t\t\t\t\tconst valueB = fieldToSort.getValue( { item: b } ) ?? '';\n\t\t\t\t\treturn view.sort.direction === 'asc'\n\t\t\t\t\t\t? valueA.localeCompare( valueB )\n\t\t\t\t\t\t: valueB.localeCompare( valueA );\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\n\t\t// Handle pagination.\n\t\tconst start = ( view.page - 1 ) * view.perPage;\n\t\tconst totalItems = filteredTemplates?.length || 0;\n\t\tfilteredTemplates = filteredTemplates?.slice(\n\t\t\tstart,\n\t\t\tstart + view.perPage\n\t\t);\n\t\treturn {\n\t\t\tshownTemplates: filteredTemplates,\n\t\t\tpaginationInfo: {\n\t\t\t\ttotalItems,\n\t\t\t\ttotalPages: Math.ceil( totalItems / view.perPage ),\n\t\t\t},\n\t\t};\n\t}, [ allTemplates, view, fields ] );\n\n\tconst resetTemplateAction = useResetTemplateAction();\n\tconst actions = useMemo(\n\t\t() => [\n\t\t\tresetTemplateAction,\n\t\t\tdeleteTemplateAction,\n\t\t\trenameTemplateAction,\n\t\t],\n\t\t[ resetTemplateAction ]\n\t);\n\tconst onChangeView = useCallback(\n\t\t( viewUpdater ) => {\n\t\t\tlet updatedView =\n\t\t\t\ttypeof viewUpdater === 'function'\n\t\t\t\t\t? viewUpdater( view )\n\t\t\t\t\t: viewUpdater;\n\t\t\tif ( updatedView.type !== view.type ) {\n\t\t\t\tupdatedView = {\n\t\t\t\t\t...updatedView,\n\t\t\t\t\tlayout: {\n\t\t\t\t\t\t...defaultConfigPerViewType[ updatedView.type ],\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tsetView( updatedView );\n\t\t},\n\t\t[ view, setView ]\n\t);\n\treturn (\n\t\t<Page title={ __( 'Templates' ) }>\n\t\t\t<DataViews\n\t\t\t\tpaginationInfo={ paginationInfo }\n\t\t\t\tfields={ fields }\n\t\t\t\tactions={ actions }\n\t\t\t\tdata={ shownTemplates }\n\t\t\t\tgetItemId={ ( item ) => item.id }\n\t\t\t\tisLoading={ isLoadingData }\n\t\t\t\tview={ view }\n\t\t\t\tonChangeView={ onChangeView }\n\t\t\t\tsupportedLayouts={ [ LAYOUT_TABLE, LAYOUT_GRID ] }\n\t\t\t\tdeferredRendering={ ! view.hiddenFields?.includes( 'preview' ) }\n\t\t\t/>\n\t\t</Page>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,cAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AAQA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AAIA,IAAAQ,UAAA,GAAAR,OAAA;AAKA,IAAAS,KAAA,GAAAV,sBAAA,CAAAC,OAAA;AACA,IAAAU,KAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IAAAW,QAAA,GAAAX,OAAA;AACA,IAAAY,UAAA,GAAAZ,OAAA;AAQA,IAAAa,gBAAA,GAAAb,OAAA;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