@wordpress/edit-site 6.13.0 → 6.13.1-next.cd6172eb0.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/build/components/add-new-pattern/index.js +3 -16
- package/build/components/add-new-pattern/index.js.map +1 -1
- package/build/components/add-new-template/index.js +1 -5
- package/build/components/add-new-template/index.js.map +1 -1
- package/build/components/app/index.js +31 -29
- package/build/components/app/index.js.map +1 -1
- package/build/components/block-editor/use-editor-iframe-props.js +8 -8
- package/build/components/block-editor/use-editor-iframe-props.js.map +1 -1
- package/build/components/block-editor/use-navigate-to-entity-record.js +1 -5
- package/build/components/block-editor/use-navigate-to-entity-record.js.map +1 -1
- package/build/components/block-editor/use-site-editor-settings.js +4 -4
- package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build/components/dataviews-actions/index.js +1 -5
- package/build/components/dataviews-actions/index.js.map +1 -1
- package/build/components/editor/index.js +38 -22
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor/use-editor-title.js +5 -0
- package/build/components/editor/use-editor-title.js.map +1 -1
- package/build/components/editor/use-resolve-edited-entity.js +19 -4
- package/build/components/editor/use-resolve-edited-entity.js.map +1 -1
- package/build/components/global-styles/font-library-modal/context.js +0 -1
- package/build/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-collection.js +36 -26
- package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build/components/global-styles/font-library-modal/installed-fonts.js +0 -1
- package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/upload-fonts.js +0 -1
- package/build/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
- package/build/components/global-styles-sidebar/index.js +5 -5
- package/build/components/global-styles-sidebar/index.js.map +1 -1
- package/build/components/layout/index.js +31 -13
- package/build/components/layout/index.js.map +1 -1
- package/build/components/page-patterns/delete-category-menu-item.js +1 -4
- package/build/components/page-patterns/delete-category-menu-item.js.map +1 -1
- package/build/components/page-patterns/fields.js +6 -11
- package/build/components/page-patterns/fields.js.map +1 -1
- package/build/components/page-patterns/index.js +14 -16
- package/build/components/page-patterns/index.js.map +1 -1
- package/build/components/page-templates/fields.js +8 -17
- package/build/components/page-templates/fields.js.map +1 -1
- package/build/components/page-templates/index.js +13 -12
- package/build/components/page-templates/index.js.map +1 -1
- package/build/components/post-edit/index.js +38 -3
- package/build/components/post-edit/index.js.map +1 -1
- package/build/components/post-list/index.js +25 -39
- package/build/components/post-list/index.js.map +1 -1
- package/build/components/posts-app/index.js +10 -16
- package/build/components/posts-app/index.js.map +1 -1
- package/build/components/posts-app-routes/index.js +3 -7
- package/build/components/posts-app-routes/index.js.map +1 -1
- package/build/components/posts-app-routes/{posts-edit.js → post-item.js} +9 -13
- package/build/components/posts-app-routes/post-item.js.map +1 -0
- package/build/components/posts-app-routes/posts.js +89 -0
- package/build/components/posts-app-routes/posts.js.map +1 -0
- package/build/components/resizable-frame/index.js +6 -5
- package/build/components/resizable-frame/index.js.map +1 -1
- package/build/components/save-panel/index.js +9 -6
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/sidebar-dataviews/add-new-view.js +7 -8
- package/build/components/sidebar-dataviews/add-new-view.js.map +1 -1
- package/build/components/sidebar-dataviews/dataview-item.js +5 -8
- package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build/components/sidebar-dataviews/index.js +4 -3
- package/build/components/sidebar-dataviews/index.js.map +1 -1
- package/build/components/sidebar-global-styles-wrapper/index.js +18 -18
- package/build/components/sidebar-global-styles-wrapper/index.js.map +1 -1
- package/build/components/sidebar-navigation-item/index.js +8 -5
- package/build/components/sidebar-navigation-item/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen/index.js +2 -2
- package/build/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js +8 -19
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/index.js +6 -14
- package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js +1 -5
- package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +2 -7
- package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js +1 -6
- 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 +14 -20
- package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/category-item.js +5 -7
- package/build/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/index.js +4 -5
- package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/content.js +25 -16
- package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/index.js +1 -14
- package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build/components/site-editor-routes/{home-view.js → home.js} +7 -8
- package/build/components/site-editor-routes/home.js.map +1 -0
- package/build/components/site-editor-routes/index.js +12 -18
- package/build/components/site-editor-routes/index.js.map +1 -1
- package/build/components/site-editor-routes/navigation-item.js +49 -0
- package/build/components/site-editor-routes/navigation-item.js.map +1 -0
- package/build/components/{posts-app-routes/home.js → site-editor-routes/navigation.js} +16 -18
- package/build/components/site-editor-routes/navigation.js.map +1 -0
- package/build/components/site-editor-routes/{pages-edit.js → page-item.js} +10 -17
- package/build/components/site-editor-routes/page-item.js.map +1 -0
- package/build/components/site-editor-routes/pages.js +87 -0
- package/build/components/site-editor-routes/pages.js.map +1 -0
- package/build/components/site-editor-routes/{home-edit.js → pattern-item.js} +11 -11
- package/build/components/site-editor-routes/pattern-item.js.map +1 -0
- package/build/components/site-editor-routes/{patterns-view.js → patterns.js} +6 -9
- package/build/components/site-editor-routes/patterns.js.map +1 -0
- package/build/components/site-editor-routes/{styles-view.js → styles.js} +28 -9
- package/build/components/site-editor-routes/styles.js.map +1 -0
- package/build/components/site-editor-routes/{templates-edit.js → template-item.js} +6 -11
- package/build/components/site-editor-routes/template-item.js.map +1 -0
- package/build/components/site-editor-routes/{patterns-edit.js → template-part-item.js} +6 -11
- package/build/components/site-editor-routes/template-part-item.js.map +1 -0
- package/build/components/site-editor-routes/{templates-list-view.js → templates.js} +20 -13
- package/build/components/site-editor-routes/templates.js.map +1 -0
- package/build/components/site-hub/index.js +3 -3
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/style-book/constants.js +8 -19
- package/build/components/style-book/constants.js.map +1 -1
- package/build/components/style-book/index.js +5 -0
- package/build/components/style-book/index.js.map +1 -1
- package/build/hooks/commands/use-common-commands.js +12 -48
- package/build/hooks/commands/use-common-commands.js.map +1 -1
- package/build/hooks/commands/use-set-command-context.js +2 -2
- package/build/hooks/commands/use-set-command-context.js.map +1 -1
- package/build/store/private-actions.js +7 -0
- package/build/store/private-actions.js.map +1 -1
- package/build/store/reducer.js +2 -0
- package/build/store/reducer.js.map +1 -1
- package/build/utils/is-previewing-theme.js +1 -1
- package/build/utils/is-previewing-theme.js.map +1 -1
- package/build/utils/use-activate-theme.js +9 -8
- package/build/utils/use-activate-theme.js.map +1 -1
- package/build-module/components/add-new-pattern/index.js +3 -16
- package/build-module/components/add-new-pattern/index.js.map +1 -1
- package/build-module/components/add-new-template/index.js +1 -5
- package/build-module/components/add-new-template/index.js.map +1 -1
- package/build-module/components/app/index.js +33 -31
- package/build-module/components/app/index.js.map +1 -1
- package/build-module/components/block-editor/use-editor-iframe-props.js +8 -8
- package/build-module/components/block-editor/use-editor-iframe-props.js.map +1 -1
- package/build-module/components/block-editor/use-navigate-to-entity-record.js +1 -5
- package/build-module/components/block-editor/use-navigate-to-entity-record.js.map +1 -1
- package/build-module/components/block-editor/use-site-editor-settings.js +4 -4
- package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build-module/components/dataviews-actions/index.js +1 -5
- package/build-module/components/dataviews-actions/index.js.map +1 -1
- package/build-module/components/editor/index.js +38 -22
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor/use-editor-title.js +5 -0
- package/build-module/components/editor/use-editor-title.js.map +1 -1
- package/build-module/components/editor/use-resolve-edited-entity.js +19 -4
- package/build-module/components/editor/use-resolve-edited-entity.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/context.js +0 -1
- 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 +37 -27
- package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js +0 -1
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/upload-fonts.js +0 -1
- package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
- package/build-module/components/global-styles-sidebar/index.js +5 -5
- package/build-module/components/global-styles-sidebar/index.js.map +1 -1
- package/build-module/components/layout/index.js +33 -15
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/page-patterns/delete-category-menu-item.js +1 -4
- package/build-module/components/page-patterns/delete-category-menu-item.js.map +1 -1
- package/build-module/components/page-patterns/fields.js +6 -11
- package/build-module/components/page-patterns/fields.js.map +1 -1
- package/build-module/components/page-patterns/index.js +14 -16
- package/build-module/components/page-patterns/index.js.map +1 -1
- package/build-module/components/page-templates/fields.js +7 -14
- package/build-module/components/page-templates/fields.js.map +1 -1
- package/build-module/components/page-templates/index.js +13 -12
- package/build-module/components/page-templates/index.js.map +1 -1
- package/build-module/components/post-edit/index.js +38 -3
- package/build-module/components/post-edit/index.js.map +1 -1
- package/build-module/components/post-list/index.js +25 -39
- package/build-module/components/post-list/index.js.map +1 -1
- package/build-module/components/posts-app/index.js +11 -17
- package/build-module/components/posts-app/index.js.map +1 -1
- package/build-module/components/posts-app-routes/index.js +3 -7
- package/build-module/components/posts-app-routes/index.js.map +1 -1
- package/build-module/components/posts-app-routes/{posts-edit.js → post-item.js} +8 -12
- package/build-module/components/posts-app-routes/post-item.js.map +1 -0
- package/build-module/components/posts-app-routes/posts.js +81 -0
- package/build-module/components/posts-app-routes/posts.js.map +1 -0
- package/build-module/components/resizable-frame/index.js +6 -5
- package/build-module/components/resizable-frame/index.js.map +1 -1
- package/build-module/components/save-panel/index.js +9 -6
- package/build-module/components/save-panel/index.js.map +1 -1
- package/build-module/components/sidebar-dataviews/add-new-view.js +7 -8
- package/build-module/components/sidebar-dataviews/add-new-view.js.map +1 -1
- package/build-module/components/sidebar-dataviews/dataview-item.js +5 -8
- package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build-module/components/sidebar-dataviews/index.js +4 -3
- package/build-module/components/sidebar-dataviews/index.js.map +1 -1
- package/build-module/components/sidebar-global-styles-wrapper/index.js +18 -18
- package/build-module/components/sidebar-global-styles-wrapper/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-item/index.js +8 -5
- package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen/index.js +2 -2
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +9 -20
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +6 -14
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +1 -5
- package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +2 -7
- package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +1 -6
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +14 -20
- package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/category-item.js +5 -7
- package/build-module/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/index.js +4 -5
- package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +25 -16
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +1 -14
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build-module/components/site-editor-routes/{home-edit.js → home.js} +5 -7
- package/build-module/components/site-editor-routes/home.js.map +1 -0
- package/build-module/components/site-editor-routes/index.js +12 -18
- package/build-module/components/site-editor-routes/index.js.map +1 -1
- package/build-module/components/site-editor-routes/navigation-item.js +41 -0
- package/build-module/components/site-editor-routes/navigation-item.js.map +1 -0
- package/build-module/components/site-editor-routes/navigation.js +38 -0
- package/build-module/components/site-editor-routes/navigation.js.map +1 -0
- package/build-module/components/site-editor-routes/{pages-edit.js → page-item.js} +9 -16
- package/build-module/components/site-editor-routes/page-item.js.map +1 -0
- package/build-module/components/site-editor-routes/pages.js +79 -0
- package/build-module/components/site-editor-routes/pages.js.map +1 -0
- package/build-module/components/site-editor-routes/pattern-item.js +18 -0
- package/build-module/components/site-editor-routes/pattern-item.js.map +1 -0
- package/build-module/components/site-editor-routes/{patterns-view.js → patterns.js} +5 -8
- package/build-module/components/site-editor-routes/patterns.js.map +1 -0
- package/build-module/components/site-editor-routes/styles.js +44 -0
- package/build-module/components/site-editor-routes/styles.js.map +1 -0
- package/build-module/components/site-editor-routes/{templates-edit.js → template-item.js} +5 -10
- package/build-module/components/site-editor-routes/template-item.js.map +1 -0
- package/build-module/components/site-editor-routes/template-part-item.js +18 -0
- package/build-module/components/site-editor-routes/template-part-item.js.map +1 -0
- package/build-module/components/site-editor-routes/templates.js +33 -0
- package/build-module/components/site-editor-routes/templates.js.map +1 -0
- package/build-module/components/site-hub/index.js +3 -3
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/style-book/constants.js +8 -19
- package/build-module/components/style-book/constants.js.map +1 -1
- package/build-module/components/style-book/index.js +5 -0
- package/build-module/components/style-book/index.js.map +1 -1
- package/build-module/hooks/commands/use-common-commands.js +12 -48
- package/build-module/hooks/commands/use-common-commands.js.map +1 -1
- package/build-module/hooks/commands/use-set-command-context.js +2 -2
- package/build-module/hooks/commands/use-set-command-context.js.map +1 -1
- package/build-module/store/private-actions.js +6 -0
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/reducer.js +2 -0
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/utils/is-previewing-theme.js +1 -1
- package/build-module/utils/is-previewing-theme.js.map +1 -1
- package/build-module/utils/use-activate-theme.js +9 -8
- package/build-module/utils/use-activate-theme.js.map +1 -1
- package/build-style/style-rtl.css +94 -12
- package/build-style/style.css +94 -12
- package/package.json +40 -40
- package/src/components/add-new-pattern/index.js +9 -17
- package/src/components/add-new-template/index.js +3 -5
- package/src/components/app/index.js +34 -35
- package/src/components/block-editor/use-editor-iframe-props.js +5 -4
- package/src/components/block-editor/use-navigate-to-entity-record.js +3 -1
- package/src/components/block-editor/use-site-editor-settings.js +6 -6
- package/src/components/dataviews-actions/index.js +1 -5
- package/src/components/editor/index.js +64 -29
- package/src/components/editor/use-editor-title.js +4 -0
- package/src/components/editor/use-resolve-edited-entity.js +17 -2
- package/src/components/global-styles/font-library-modal/font-collection.js +40 -27
- package/src/components/global-styles/font-library-modal/style.scss +12 -5
- package/src/components/global-styles/style.scss +4 -0
- package/src/components/global-styles-sidebar/index.js +4 -4
- package/src/components/layout/index.js +36 -6
- package/src/components/page-patterns/delete-category-menu-item.js +3 -4
- package/src/components/page-patterns/fields.js +12 -11
- package/src/components/page-patterns/index.js +16 -14
- package/src/components/page-templates/fields.js +4 -15
- package/src/components/page-templates/index.js +18 -13
- package/src/components/post-edit/index.js +36 -2
- package/src/components/post-list/index.js +43 -39
- package/src/components/posts-app/index.js +9 -18
- package/src/components/posts-app-routes/index.js +3 -14
- package/src/components/posts-app-routes/{posts-edit.js → post-item.js} +5 -9
- package/src/components/posts-app-routes/posts.js +66 -0
- package/src/components/resizable-frame/index.js +6 -7
- package/src/components/save-panel/index.js +11 -5
- package/src/components/sidebar-dataviews/add-new-view.js +9 -9
- package/src/components/sidebar-dataviews/dataview-item.js +5 -8
- package/src/components/sidebar-dataviews/index.js +2 -2
- package/src/components/sidebar-dataviews/style.scss +2 -2
- package/src/components/sidebar-global-styles-wrapper/index.js +24 -30
- package/src/components/sidebar-navigation-item/index.js +7 -5
- package/src/components/sidebar-navigation-item/style.scss +1 -2
- package/src/components/sidebar-navigation-screen/index.js +2 -2
- package/src/components/sidebar-navigation-screen/style.scss +2 -2
- package/src/components/sidebar-navigation-screen-global-styles/index.js +13 -34
- package/src/components/sidebar-navigation-screen-main/index.js +6 -10
- package/src/components/sidebar-navigation-screen-navigation-menu/more-menu.js +3 -5
- package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +2 -2
- package/src/components/sidebar-navigation-screen-navigation-menus/index.js +6 -6
- package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +9 -21
- package/src/components/sidebar-navigation-screen-patterns/category-item.js +5 -20
- package/src/components/sidebar-navigation-screen-patterns/index.js +3 -4
- package/src/components/sidebar-navigation-screen-templates-browse/content.js +24 -18
- package/src/components/sidebar-navigation-screen-templates-browse/index.js +1 -14
- package/src/components/site-editor-routes/{home-view.js → home.js} +4 -5
- package/src/components/site-editor-routes/index.js +22 -34
- package/src/components/site-editor-routes/navigation-item.js +39 -0
- package/src/components/site-editor-routes/navigation.js +34 -0
- package/src/components/site-editor-routes/{pages-edit.js → page-item.js} +6 -14
- package/src/components/site-editor-routes/pages.js +66 -0
- package/src/components/site-editor-routes/pattern-item.js +15 -0
- package/src/components/site-editor-routes/patterns.js +15 -0
- package/src/components/site-editor-routes/styles.js +39 -0
- package/src/components/site-editor-routes/template-item.js +15 -0
- package/src/components/site-editor-routes/template-part-item.js +15 -0
- package/src/components/site-editor-routes/templates.js +26 -0
- package/src/components/site-hub/index.js +3 -6
- package/src/components/style-book/constants.ts +8 -19
- package/src/components/style-book/index.js +5 -0
- package/src/hooks/commands/use-common-commands.js +14 -72
- package/src/hooks/commands/use-set-command-context.js +2 -2
- package/src/store/private-actions.js +7 -0
- package/src/store/reducer.js +2 -0
- package/src/utils/is-previewing-theme.js +1 -3
- package/src/utils/use-activate-theme.js +4 -3
- package/build/components/layout/router.js +0 -92
- package/build/components/layout/router.js.map +0 -1
- package/build/components/posts-app-routes/home.js.map +0 -1
- package/build/components/posts-app-routes/posts-edit.js.map +0 -1
- package/build/components/posts-app-routes/posts-list-view-quick-edit.js +0 -63
- package/build/components/posts-app-routes/posts-list-view-quick-edit.js.map +0 -1
- package/build/components/posts-app-routes/posts-list-view.js +0 -48
- package/build/components/posts-app-routes/posts-list-view.js.map +0 -1
- package/build/components/posts-app-routes/posts-view-quick-edit.js +0 -60
- package/build/components/posts-app-routes/posts-view-quick-edit.js.map +0 -1
- package/build/components/posts-app-routes/posts-view.js +0 -41
- package/build/components/posts-app-routes/posts-view.js.map +0 -1
- package/build/components/routes/link.js +0 -69
- package/build/components/routes/link.js.map +0 -1
- package/build/components/site-editor-routes/home-edit.js.map +0 -1
- package/build/components/site-editor-routes/home-view.js.map +0 -1
- package/build/components/site-editor-routes/navigation-edit.js +0 -29
- package/build/components/site-editor-routes/navigation-edit.js.map +0 -1
- package/build/components/site-editor-routes/navigation-item-edit.js +0 -31
- package/build/components/site-editor-routes/navigation-item-edit.js.map +0 -1
- package/build/components/site-editor-routes/navigation-item-view.js +0 -30
- package/build/components/site-editor-routes/navigation-item-view.js.map +0 -1
- package/build/components/site-editor-routes/navigation-view.js +0 -28
- package/build/components/site-editor-routes/navigation-view.js.map +0 -1
- package/build/components/site-editor-routes/pages-edit.js.map +0 -1
- package/build/components/site-editor-routes/pages-list-view-quick-edit.js +0 -64
- package/build/components/site-editor-routes/pages-list-view-quick-edit.js.map +0 -1
- package/build/components/site-editor-routes/pages-list-view.js +0 -47
- package/build/components/site-editor-routes/pages-list-view.js.map +0 -1
- package/build/components/site-editor-routes/pages-view-quick-edit.js +0 -61
- package/build/components/site-editor-routes/pages-view-quick-edit.js.map +0 -1
- package/build/components/site-editor-routes/pages-view.js +0 -42
- package/build/components/site-editor-routes/pages-view.js.map +0 -1
- package/build/components/site-editor-routes/patterns-edit.js.map +0 -1
- package/build/components/site-editor-routes/patterns-view.js.map +0 -1
- package/build/components/site-editor-routes/styles-view.js.map +0 -1
- package/build/components/site-editor-routes/templates-edit.js.map +0 -1
- package/build/components/site-editor-routes/templates-list-view.js.map +0 -1
- package/build/components/site-editor-routes/templates-view.js +0 -29
- package/build/components/site-editor-routes/templates-view.js.map +0 -1
- package/build-module/components/layout/router.js +0 -84
- package/build-module/components/layout/router.js.map +0 -1
- package/build-module/components/posts-app-routes/home.js +0 -40
- package/build-module/components/posts-app-routes/home.js.map +0 -1
- package/build-module/components/posts-app-routes/posts-edit.js.map +0 -1
- package/build-module/components/posts-app-routes/posts-list-view-quick-edit.js +0 -55
- package/build-module/components/posts-app-routes/posts-list-view-quick-edit.js.map +0 -1
- package/build-module/components/posts-app-routes/posts-list-view.js +0 -40
- package/build-module/components/posts-app-routes/posts-list-view.js.map +0 -1
- package/build-module/components/posts-app-routes/posts-view-quick-edit.js +0 -52
- package/build-module/components/posts-app-routes/posts-view-quick-edit.js.map +0 -1
- package/build-module/components/posts-app-routes/posts-view.js +0 -33
- package/build-module/components/posts-app-routes/posts-view.js.map +0 -1
- package/build-module/components/routes/link.js +0 -61
- package/build-module/components/routes/link.js.map +0 -1
- package/build-module/components/site-editor-routes/home-edit.js.map +0 -1
- package/build-module/components/site-editor-routes/home-view.js +0 -17
- package/build-module/components/site-editor-routes/home-view.js.map +0 -1
- package/build-module/components/site-editor-routes/navigation-edit.js +0 -21
- package/build-module/components/site-editor-routes/navigation-edit.js.map +0 -1
- package/build-module/components/site-editor-routes/navigation-item-edit.js +0 -23
- package/build-module/components/site-editor-routes/navigation-item-edit.js.map +0 -1
- package/build-module/components/site-editor-routes/navigation-item-view.js +0 -22
- package/build-module/components/site-editor-routes/navigation-item-view.js.map +0 -1
- package/build-module/components/site-editor-routes/navigation-view.js +0 -20
- package/build-module/components/site-editor-routes/navigation-view.js.map +0 -1
- package/build-module/components/site-editor-routes/pages-edit.js.map +0 -1
- package/build-module/components/site-editor-routes/pages-list-view-quick-edit.js +0 -56
- package/build-module/components/site-editor-routes/pages-list-view-quick-edit.js.map +0 -1
- package/build-module/components/site-editor-routes/pages-list-view.js +0 -39
- package/build-module/components/site-editor-routes/pages-list-view.js.map +0 -1
- package/build-module/components/site-editor-routes/pages-view-quick-edit.js +0 -53
- package/build-module/components/site-editor-routes/pages-view-quick-edit.js.map +0 -1
- package/build-module/components/site-editor-routes/pages-view.js +0 -34
- package/build-module/components/site-editor-routes/pages-view.js.map +0 -1
- package/build-module/components/site-editor-routes/patterns-edit.js +0 -23
- package/build-module/components/site-editor-routes/patterns-edit.js.map +0 -1
- package/build-module/components/site-editor-routes/patterns-view.js.map +0 -1
- package/build-module/components/site-editor-routes/styles-view.js +0 -25
- package/build-module/components/site-editor-routes/styles-view.js.map +0 -1
- package/build-module/components/site-editor-routes/templates-edit.js.map +0 -1
- package/build-module/components/site-editor-routes/templates-list-view.js +0 -26
- package/build-module/components/site-editor-routes/templates-list-view.js.map +0 -1
- package/build-module/components/site-editor-routes/templates-view.js +0 -21
- package/build-module/components/site-editor-routes/templates-view.js.map +0 -1
- package/src/components/layout/router.js +0 -86
- package/src/components/posts-app-routes/home.js +0 -36
- package/src/components/posts-app-routes/posts-list-view-quick-edit.js +0 -52
- package/src/components/posts-app-routes/posts-list-view.js +0 -40
- package/src/components/posts-app-routes/posts-view-quick-edit.js +0 -49
- package/src/components/posts-app-routes/posts-view.js +0 -35
- package/src/components/routes/link.js +0 -68
- package/src/components/site-editor-routes/home-edit.js +0 -17
- package/src/components/site-editor-routes/navigation-edit.js +0 -22
- package/src/components/site-editor-routes/navigation-item-edit.js +0 -26
- package/src/components/site-editor-routes/navigation-item-view.js +0 -25
- package/src/components/site-editor-routes/navigation-view.js +0 -21
- package/src/components/site-editor-routes/pages-list-view-quick-edit.js +0 -56
- package/src/components/site-editor-routes/pages-list-view.js +0 -44
- package/src/components/site-editor-routes/pages-view-quick-edit.js +0 -53
- package/src/components/site-editor-routes/pages-view.js +0 -39
- package/src/components/site-editor-routes/patterns-edit.js +0 -24
- package/src/components/site-editor-routes/patterns-view.js +0 -22
- package/src/components/site-editor-routes/styles-view.js +0 -26
- package/src/components/site-editor-routes/templates-edit.js +0 -22
- package/src/components/site-editor-routes/templates-list-view.js +0 -28
- package/src/components/site-editor-routes/templates-view.js +0 -22
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_i18n","_element","_htmlEntities","_blocks","_blockEditor","_editor","_link","_interopRequireWildcard","_hooks","_usePatternSettings","_lockUnlock","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","useGlobalStyle","unlock","blockEditorPrivateApis","PreviewField","item","settings","usePatternSettings","backgroundColor","blocks","useMemo","parse","content","raw","onClick","useLink","postId","id","postType","type","canvas","isEmpty","length","jsx","EditorProvider","post","children","className","style","jsxs","title","rendered","__","BlockPreview","Async","previewField","exports","label","render","enableSorting","TitleField","linkProps","params","decodeEntities","titleField","getValue","enableHiding","enableGlobalSearch","descriptionField","description","AuthorField","isImageLoaded","setIsImageLoaded","useState","text","icon","imageUrl","useAddedBy","__experimentalHStack","alignment","spacing","clsx","onLoad","alt","src","Icon","authorField","author_text"],"sources":["@wordpress/edit-site/src/components/page-templates/fields.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { Icon, __experimentalHStack as HStack } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useState, useMemo } from '@wordpress/element';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { parse } from '@wordpress/blocks';\nimport {\n\tBlockPreview,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { EditorProvider } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { default as Link, useLink } from '../routes/link';\nimport { useAddedBy } from './hooks';\n\nimport usePatternSettings from '../page-patterns/use-pattern-settings';\nimport { unlock } from '../../lock-unlock';\n\nconst { useGlobalStyle } = unlock( blockEditorPrivateApis );\n\nfunction PreviewField( { item } ) {\n\tconst settings = usePatternSettings();\n\tconst [ backgroundColor = 'white' ] = useGlobalStyle( 'color.background' );\n\tconst blocks = useMemo( () => {\n\t\treturn parse( item.content.raw );\n\t}, [ item.content.raw ] );\n\tconst { onClick } = useLink( {\n\t\tpostId: item.id,\n\t\tpostType: item.type,\n\t\tcanvas: 'edit',\n\t} );\n\n\tconst isEmpty = ! blocks?.length;\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<EditorProvider post={ item } settings={ settings }>\n\t\t\t<div\n\t\t\t\tclassName=\"page-templates-preview-field\"\n\t\t\t\tstyle={ { backgroundColor } }\n\t\t\t>\n\t\t\t\t<button\n\t\t\t\t\tclassName=\"page-templates-preview-field__button\"\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tonClick={ onClick }\n\t\t\t\t\taria-label={ item.title?.rendered || item.title }\n\t\t\t\t>\n\t\t\t\t\t{ isEmpty && __( 'Empty template' ) }\n\t\t\t\t\t{ ! isEmpty && (\n\t\t\t\t\t\t<BlockPreview.Async>\n\t\t\t\t\t\t\t<BlockPreview blocks={ blocks } />\n\t\t\t\t\t\t</BlockPreview.Async>\n\t\t\t\t\t) }\n\t\t\t\t</button>\n\t\t\t</div>\n\t\t</EditorProvider>\n\t);\n}\n\nexport const previewField = {\n\tlabel: __( 'Preview' ),\n\tid: 'preview',\n\trender: PreviewField,\n\tenableSorting: false,\n};\n\nfunction TitleField( { item } ) {\n\tconst linkProps = {\n\t\tparams: {\n\t\t\tpostId: item.id,\n\t\t\tpostType: item.type,\n\t\t\tcanvas: 'edit',\n\t\t},\n\t};\n\treturn (\n\t\t<Link { ...linkProps }>\n\t\t\t{ decodeEntities( item.title?.rendered ) || __( '(no title)' ) }\n\t\t</Link>\n\t);\n}\n\nexport const titleField = {\n\tlabel: __( 'Template' ),\n\tid: 'title',\n\tgetValue: ( { item } ) => item.title?.rendered,\n\trender: TitleField,\n\tenableHiding: false,\n\tenableGlobalSearch: true,\n};\n\nexport const descriptionField = {\n\tlabel: __( 'Description' ),\n\tid: 'description',\n\trender: ( { item } ) => {\n\t\treturn (\n\t\t\titem.description && (\n\t\t\t\t<span className=\"page-templates-description\">\n\t\t\t\t\t{ decodeEntities( item.description ) }\n\t\t\t\t</span>\n\t\t\t)\n\t\t);\n\t},\n\tenableSorting: false,\n\tenableGlobalSearch: true,\n};\n\nfunction AuthorField( { item } ) {\n\tconst [ isImageLoaded, setIsImageLoaded ] = useState( false );\n\tconst { text, icon, imageUrl } = useAddedBy( item.type, item.id );\n\n\treturn (\n\t\t<HStack alignment=\"left\" spacing={ 0 }>\n\t\t\t{ imageUrl && (\n\t\t\t\t<div\n\t\t\t\t\tclassName={ clsx( 'page-templates-author-field__avatar', {\n\t\t\t\t\t\t'is-loaded': isImageLoaded,\n\t\t\t\t\t} ) }\n\t\t\t\t>\n\t\t\t\t\t<img\n\t\t\t\t\t\tonLoad={ () => setIsImageLoaded( true ) }\n\t\t\t\t\t\talt=\"\"\n\t\t\t\t\t\tsrc={ imageUrl }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t{ ! imageUrl && (\n\t\t\t\t<div className=\"page-templates-author-field__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 className=\"page-templates-author-field__name\">{ text }</span>\n\t\t</HStack>\n\t);\n}\n\nexport const authorField = {\n\tlabel: __( 'Author' ),\n\tid: 'author',\n\tgetValue: ( { item } ) => item.author_text,\n\trender: AuthorField,\n};\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AAIA,IAAAO,OAAA,GAAAP,OAAA;AAKA,IAAAQ,KAAA,GAAAC,uBAAA,CAAAT,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AAEA,IAAAW,mBAAA,GAAAZ,sBAAA,CAAAC,OAAA;AACA,IAAAY,WAAA,GAAAZ,OAAA;AAA2C,IAAAa,WAAA,GAAAb,OAAA;AAAA,SAAAc,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CA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,KAAK,EAAE,IAAAL,QAAE,EAAE,QAAS,CAAC;EACrBf,EAAE,EAAE,QAAQ;EACZ4B,QAAQ,EAAEA,CAAE;IAAExC;EAAK,CAAC,KAAMA,IAAI,CAAC8D,WAAW;EAC1C7B,MAAM,EAAEY;AACT,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_i18n","_element","_htmlEntities","_blocks","_blockEditor","_editor","_router","_hooks","_usePatternSettings","_lockUnlock","_jsxRuntime","useLink","Link","unlock","routerPrivateApis","useGlobalStyle","blockEditorPrivateApis","PreviewField","item","settings","usePatternSettings","backgroundColor","blocks","useMemo","parse","content","raw","onClick","type","id","isEmpty","length","jsx","EditorProvider","post","children","className","style","jsxs","title","rendered","__","BlockPreview","Async","previewField","exports","label","render","enableSorting","TitleField","to","decodeEntities","titleField","getValue","enableHiding","enableGlobalSearch","descriptionField","description","AuthorField","isImageLoaded","setIsImageLoaded","useState","text","icon","imageUrl","useAddedBy","__experimentalHStack","alignment","spacing","clsx","onLoad","alt","src","Icon","authorField","author_text"],"sources":["@wordpress/edit-site/src/components/page-templates/fields.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { Icon, __experimentalHStack as HStack } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useState, useMemo } from '@wordpress/element';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { parse } from '@wordpress/blocks';\nimport {\n\tBlockPreview,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { EditorProvider } from '@wordpress/editor';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { useAddedBy } from './hooks';\nimport usePatternSettings from '../page-patterns/use-pattern-settings';\nimport { unlock } from '../../lock-unlock';\n\nconst { useLink, Link } = unlock( routerPrivateApis );\nconst { useGlobalStyle } = unlock( blockEditorPrivateApis );\n\nfunction PreviewField( { item } ) {\n\tconst settings = usePatternSettings();\n\tconst [ backgroundColor = 'white' ] = useGlobalStyle( 'color.background' );\n\tconst blocks = useMemo( () => {\n\t\treturn parse( item.content.raw );\n\t}, [ item.content.raw ] );\n\tconst { onClick } = useLink( `/${ item.type }/${ item.id }?canvas=edit` );\n\n\tconst isEmpty = ! blocks?.length;\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<EditorProvider post={ item } settings={ settings }>\n\t\t\t<div\n\t\t\t\tclassName=\"page-templates-preview-field\"\n\t\t\t\tstyle={ { backgroundColor } }\n\t\t\t>\n\t\t\t\t<button\n\t\t\t\t\tclassName=\"page-templates-preview-field__button\"\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tonClick={ onClick }\n\t\t\t\t\taria-label={ item.title?.rendered || item.title }\n\t\t\t\t>\n\t\t\t\t\t{ isEmpty && __( 'Empty template' ) }\n\t\t\t\t\t{ ! isEmpty && (\n\t\t\t\t\t\t<BlockPreview.Async>\n\t\t\t\t\t\t\t<BlockPreview blocks={ blocks } />\n\t\t\t\t\t\t</BlockPreview.Async>\n\t\t\t\t\t) }\n\t\t\t\t</button>\n\t\t\t</div>\n\t\t</EditorProvider>\n\t);\n}\n\nexport const previewField = {\n\tlabel: __( 'Preview' ),\n\tid: 'preview',\n\trender: PreviewField,\n\tenableSorting: false,\n};\n\nfunction TitleField( { item } ) {\n\treturn (\n\t\t<Link to={ `/${ item.type }/${ item.id }?canvas=edit` }>\n\t\t\t{ decodeEntities( item.title?.rendered ) || __( '(no title)' ) }\n\t\t</Link>\n\t);\n}\n\nexport const titleField = {\n\tlabel: __( 'Template' ),\n\tid: 'title',\n\tgetValue: ( { item } ) => item.title?.rendered,\n\trender: TitleField,\n\tenableHiding: false,\n\tenableGlobalSearch: true,\n};\n\nexport const descriptionField = {\n\tlabel: __( 'Description' ),\n\tid: 'description',\n\trender: ( { item } ) => {\n\t\treturn (\n\t\t\titem.description && (\n\t\t\t\t<span className=\"page-templates-description\">\n\t\t\t\t\t{ decodeEntities( item.description ) }\n\t\t\t\t</span>\n\t\t\t)\n\t\t);\n\t},\n\tenableSorting: false,\n\tenableGlobalSearch: true,\n};\n\nfunction AuthorField( { item } ) {\n\tconst [ isImageLoaded, setIsImageLoaded ] = useState( false );\n\tconst { text, icon, imageUrl } = useAddedBy( item.type, item.id );\n\n\treturn (\n\t\t<HStack alignment=\"left\" spacing={ 0 }>\n\t\t\t{ imageUrl && (\n\t\t\t\t<div\n\t\t\t\t\tclassName={ clsx( 'page-templates-author-field__avatar', {\n\t\t\t\t\t\t'is-loaded': isImageLoaded,\n\t\t\t\t\t} ) }\n\t\t\t\t>\n\t\t\t\t\t<img\n\t\t\t\t\t\tonLoad={ () => setIsImageLoaded( true ) }\n\t\t\t\t\t\talt=\"\"\n\t\t\t\t\t\tsrc={ imageUrl }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t{ ! imageUrl && (\n\t\t\t\t<div className=\"page-templates-author-field__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 className=\"page-templates-author-field__name\">{ text }</span>\n\t\t</HStack>\n\t);\n}\n\nexport const authorField = {\n\tlabel: __( 'Author' ),\n\tid: 'author',\n\tgetValue: ( { item } ) => item.author_text,\n\trender: AuthorField,\n};\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IA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,KAAMV,gBAAgB,CAAE,IAAK,CAAG;QACzCW,GAAG,EAAC,EAAE;QACNC,GAAG,EAAGR;MAAU,CAChB;IAAC,CACE,CACL,EACC,CAAEA,QAAQ,iBACX,IAAAtD,WAAA,CAAAsB,GAAA;MAAKI,SAAS,EAAC,mCAAmC;MAAAD,QAAA,eACjD,IAAAzB,WAAA,CAAAsB,GAAA,EAACjC,WAAA,CAAA0E,IAAI;QAACV,IAAI,EAAGA;MAAM,CAAE;IAAC,CAClB,CACL,eACD,IAAArD,WAAA,CAAAsB,GAAA;MAAMI,SAAS,EAAC,mCAAmC;MAAAD,QAAA,EAAG2B;IAAI,CAAQ,CAAC;EAAA,CAC5D,CAAC;AAEX;AAEO,MAAMY,WAAW,GAAA7B,OAAA,CAAA6B,WAAA,GAAG;EAC1B5B,KAAK,EAAE,IAAAL,QAAE,EAAE,QAAS,CAAC;EACrBZ,EAAE,EAAE,QAAQ;EACZwB,QAAQ,EAAEA,CAAE;IAAEnC;EAAK,CAAC,KAAMA,IAAI,CAACyD,WAAW;EAC1C5B,MAAM,EAAEW;AACT,CAAC","ignoreList":[]}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* wp:polyfill */
|
|
2
1
|
"use strict";
|
|
3
2
|
|
|
4
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
@@ -12,6 +11,7 @@ var _coreData = require("@wordpress/core-data");
|
|
|
12
11
|
var _dataviews = require("@wordpress/dataviews");
|
|
13
12
|
var _router = require("@wordpress/router");
|
|
14
13
|
var _editor = require("@wordpress/editor");
|
|
14
|
+
var _url = require("@wordpress/url");
|
|
15
15
|
var _page = _interopRequireDefault(require("../page"));
|
|
16
16
|
var _addNewTemplate = _interopRequireDefault(require("../add-new-template"));
|
|
17
17
|
var _constants = require("../../utils/constants");
|
|
@@ -93,13 +93,14 @@ const DEFAULT_VIEW = {
|
|
|
93
93
|
};
|
|
94
94
|
function PageTemplates() {
|
|
95
95
|
const {
|
|
96
|
-
|
|
96
|
+
path,
|
|
97
|
+
query
|
|
97
98
|
} = useLocation();
|
|
98
99
|
const {
|
|
99
100
|
activeView = 'all',
|
|
100
101
|
layout,
|
|
101
102
|
postId
|
|
102
|
-
} =
|
|
103
|
+
} = query;
|
|
103
104
|
const [selection, setSelection] = (0, _element.useState)([postId]);
|
|
104
105
|
const defaultView = (0, _element.useMemo)(() => {
|
|
105
106
|
const usedType = layout !== null && layout !== void 0 ? layout : DEFAULT_VIEW.type;
|
|
@@ -117,15 +118,17 @@ function PageTemplates() {
|
|
|
117
118
|
}, [layout, activeView]);
|
|
118
119
|
const [view, setView] = (0, _element.useState)(defaultView);
|
|
119
120
|
(0, _element.useEffect)(() => {
|
|
121
|
+
const usedType = layout !== null && layout !== void 0 ? layout : DEFAULT_VIEW.type;
|
|
120
122
|
setView(currentView => ({
|
|
121
123
|
...currentView,
|
|
124
|
+
type: usedType,
|
|
122
125
|
filters: activeView !== 'all' ? [{
|
|
123
126
|
field: 'author',
|
|
124
127
|
operator: _constants.OPERATOR_IS_ANY,
|
|
125
128
|
value: [activeView]
|
|
126
129
|
}] : []
|
|
127
130
|
}));
|
|
128
|
-
}, [activeView]);
|
|
131
|
+
}, [activeView, layout]);
|
|
129
132
|
const {
|
|
130
133
|
records,
|
|
131
134
|
isResolving: isLoadingData
|
|
@@ -136,12 +139,11 @@ function PageTemplates() {
|
|
|
136
139
|
const onChangeSelection = (0, _element.useCallback)(items => {
|
|
137
140
|
setSelection(items);
|
|
138
141
|
if (view?.type === _constants.LAYOUT_LIST) {
|
|
139
|
-
history.
|
|
140
|
-
...params,
|
|
142
|
+
history.navigate((0, _url.addQueryArgs)(path, {
|
|
141
143
|
postId: items.length === 1 ? items[0] : undefined
|
|
142
|
-
});
|
|
144
|
+
}));
|
|
143
145
|
}
|
|
144
|
-
}, [history,
|
|
146
|
+
}, [history, path, view?.type]);
|
|
145
147
|
const authors = (0, _element.useMemo)(() => {
|
|
146
148
|
if (!records) {
|
|
147
149
|
return EMPTY_ARRAY;
|
|
@@ -173,13 +175,12 @@ function PageTemplates() {
|
|
|
173
175
|
const actions = (0, _element.useMemo)(() => [editAction, ...postTypeActions], [postTypeActions, editAction]);
|
|
174
176
|
const onChangeView = (0, _element.useCallback)(newView => {
|
|
175
177
|
if (newView.type !== view.type) {
|
|
176
|
-
history.
|
|
177
|
-
...params,
|
|
178
|
+
history.navigate((0, _url.addQueryArgs)(path, {
|
|
178
179
|
layout: newView.type
|
|
179
|
-
});
|
|
180
|
+
}));
|
|
180
181
|
}
|
|
181
182
|
setView(newView);
|
|
182
|
-
}, [view.type, setView, history,
|
|
183
|
+
}, [view.type, setView, history, path]);
|
|
183
184
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_page.default, {
|
|
184
185
|
className: "edit-site-page-templates",
|
|
185
186
|
title: (0, _i18n.__)('Templates'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_element","_coreData","_dataviews","_router","_editor","_page","_interopRequireDefault","_addNewTemplate","_constants","_lockUnlock","_dataviewsActions","_fields","_jsxRuntime","usePostActions","unlock","editorPrivateApis","useHistory","useLocation","routerPrivateApis","useEntityRecordsWithPermissions","corePrivateApis","EMPTY_ARRAY","defaultLayouts","LAYOUT_TABLE","fields","layout","primaryField","combinedFields","id","label","__","children","direction","styles","template","maxWidth","minWidth","preview","width","author","LAYOUT_GRID","mediaField","columnFields","LAYOUT_LIST","DEFAULT_VIEW","type","search","page","perPage","sort","field","filters","PageTemplates","params","activeView","postId","selection","setSelection","useState","defaultView","useMemo","usedType","operator","value","view","setView","useEffect","currentView","OPERATOR_IS_ANY","records","isResolving","isLoadingData","TEMPLATE_POST_TYPE","per_page","history","onChangeSelection","useCallback","items","push","length","undefined","authors","authorsSet","Set","forEach","add","author_text","Array","from","map","previewField","titleField","descriptionField","authorField","elements","data","paginationInfo","filterSortAndPaginate","postTypeActions","postType","context","editAction","useEditPostAction","actions","onChangeView","newView","jsx","default","className","title","DataViews","isLoading"],"sources":["@wordpress/edit-site/src/components/page-templates/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useState, useMemo, useCallback, useEffect } from '@wordpress/element';\nimport { privateApis as corePrivateApis } from '@wordpress/core-data';\nimport { DataViews, filterSortAndPaginate } from '@wordpress/dataviews';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport Page from '../page';\nimport AddNewTemplate from '../add-new-template';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tOPERATOR_IS_ANY,\n\tLAYOUT_GRID,\n\tLAYOUT_TABLE,\n\tLAYOUT_LIST,\n} from '../../utils/constants';\nimport { unlock } from '../../lock-unlock';\nimport { useEditPostAction } from '../dataviews-actions';\nimport {\n\tauthorField,\n\tdescriptionField,\n\tpreviewField,\n\ttitleField,\n} from './fields';\n\nconst { usePostActions } = unlock( editorPrivateApis );\nconst { useHistory, useLocation } = unlock( routerPrivateApis );\nconst { useEntityRecordsWithPermissions } = unlock( corePrivateApis );\n\nconst EMPTY_ARRAY = [];\n\nconst defaultLayouts = {\n\t[ LAYOUT_TABLE ]: {\n\t\tfields: [ 'template', 'author' ],\n\t\tlayout: {\n\t\t\tprimaryField: 'title',\n\t\t\tcombinedFields: [\n\t\t\t\t{\n\t\t\t\t\tid: 'template',\n\t\t\t\t\tlabel: __( 'Template' ),\n\t\t\t\t\tchildren: [ 'title', 'description' ],\n\t\t\t\t\tdirection: 'vertical',\n\t\t\t\t},\n\t\t\t],\n\t\t\tstyles: {\n\t\t\t\ttemplate: {\n\t\t\t\t\tmaxWidth: 400,\n\t\t\t\t\tminWidth: 320,\n\t\t\t\t},\n\t\t\t\tpreview: {\n\t\t\t\t\twidth: '1%',\n\t\t\t\t},\n\t\t\t\tauthor: {\n\t\t\t\t\twidth: '1%',\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n\t[ LAYOUT_GRID ]: {\n\t\tfields: [ 'title', 'description', 'author' ],\n\t\tlayout: {\n\t\t\tmediaField: 'preview',\n\t\t\tprimaryField: 'title',\n\t\t\tcolumnFields: [ 'description' ],\n\t\t},\n\t},\n\t[ LAYOUT_LIST ]: {\n\t\tfields: [ 'title', 'description', 'author' ],\n\t\tlayout: {\n\t\t\tprimaryField: 'title',\n\t\t},\n\t},\n};\n\nconst DEFAULT_VIEW = {\n\ttype: LAYOUT_GRID,\n\tsearch: '',\n\tpage: 1,\n\tperPage: 20,\n\tsort: {\n\t\tfield: 'title',\n\t\tdirection: 'asc',\n\t},\n\tfields: defaultLayouts[ LAYOUT_GRID ].fields,\n\tlayout: defaultLayouts[ LAYOUT_GRID ].layout,\n\tfilters: [],\n};\n\nexport default function PageTemplates() {\n\tconst { params } = useLocation();\n\tconst { activeView = 'all', layout, postId } = params;\n\tconst [ selection, setSelection ] = useState( [ postId ] );\n\n\tconst defaultView = useMemo( () => {\n\t\tconst usedType = layout ?? DEFAULT_VIEW.type;\n\t\treturn {\n\t\t\t...DEFAULT_VIEW,\n\t\t\ttype: usedType,\n\t\t\tlayout: defaultLayouts[ usedType ].layout,\n\t\t\tfields: defaultLayouts[ usedType ].fields,\n\t\t\tfilters:\n\t\t\t\tactiveView !== 'all'\n\t\t\t\t\t? [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfield: 'author',\n\t\t\t\t\t\t\t\toperator: 'isAny',\n\t\t\t\t\t\t\t\tvalue: [ activeView ],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t ]\n\t\t\t\t\t: [],\n\t\t};\n\t}, [ layout, activeView ] );\n\tconst [ view, setView ] = useState( defaultView );\n\tuseEffect( () => {\n\t\tsetView( ( currentView ) => ( {\n\t\t\t...currentView,\n\t\t\tfilters:\n\t\t\t\tactiveView !== 'all'\n\t\t\t\t\t? [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfield: 'author',\n\t\t\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\t\t\tvalue: [ activeView ],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t ]\n\t\t\t\t\t: [],\n\t\t} ) );\n\t}, [ activeView ] );\n\n\tconst { records, isResolving: isLoadingData } =\n\t\tuseEntityRecordsWithPermissions( 'postType', TEMPLATE_POST_TYPE, {\n\t\t\tper_page: -1,\n\t\t} );\n\tconst history = useHistory();\n\tconst onChangeSelection = useCallback(\n\t\t( items ) => {\n\t\t\tsetSelection( items );\n\t\t\tif ( view?.type === LAYOUT_LIST ) {\n\t\t\t\thistory.push( {\n\t\t\t\t\t...params,\n\t\t\t\t\tpostId: items.length === 1 ? items[ 0 ] : undefined,\n\t\t\t\t} );\n\t\t\t}\n\t\t},\n\t\t[ history, params, view?.type ]\n\t);\n\n\tconst authors = useMemo( () => {\n\t\tif ( ! records ) {\n\t\t\treturn EMPTY_ARRAY;\n\t\t}\n\t\tconst authorsSet = new Set();\n\t\trecords.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}, [ records ] );\n\n\tconst fields = useMemo(\n\t\t() => [\n\t\t\tpreviewField,\n\t\t\ttitleField,\n\t\t\tdescriptionField,\n\t\t\t{\n\t\t\t\t...authorField,\n\t\t\t\telements: authors,\n\t\t\t},\n\t\t],\n\t\t[ authors ]\n\t);\n\n\tconst { data, paginationInfo } = useMemo( () => {\n\t\treturn filterSortAndPaginate( records, view, fields );\n\t}, [ records, view, fields ] );\n\n\tconst postTypeActions = usePostActions( {\n\t\tpostType: TEMPLATE_POST_TYPE,\n\t\tcontext: 'list',\n\t} );\n\tconst editAction = useEditPostAction();\n\tconst actions = useMemo(\n\t\t() => [ editAction, ...postTypeActions ],\n\t\t[ postTypeActions, editAction ]\n\t);\n\n\tconst onChangeView = useCallback(\n\t\t( newView ) => {\n\t\t\tif ( newView.type !== view.type ) {\n\t\t\t\thistory.push( {\n\t\t\t\t\t...params,\n\t\t\t\t\tlayout: newView.type,\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tsetView( newView );\n\t\t},\n\t\t[ view.type, setView, history, params ]\n\t);\n\n\treturn (\n\t\t<Page\n\t\t\tclassName=\"edit-site-page-templates\"\n\t\t\ttitle={ __( 'Templates' ) }\n\t\t\tactions={ <AddNewTemplate /> }\n\t\t>\n\t\t\t<DataViews\n\t\t\t\tkey={ activeView }\n\t\t\t\tpaginationInfo={ paginationInfo }\n\t\t\t\tfields={ fields }\n\t\t\t\tactions={ actions }\n\t\t\t\tdata={ data }\n\t\t\t\tisLoading={ isLoadingData }\n\t\t\t\tview={ view }\n\t\t\t\tonChangeView={ onChangeView }\n\t\t\t\tonChangeSelection={ onChangeSelection }\n\t\t\t\tselection={ selection }\n\t\t\t\tdefaultLayouts={ defaultLayouts }\n\t\t\t/>\n\t\t</Page>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAKA,IAAAM,KAAA,GAAAC,sBAAA,CAAAP,OAAA;AACA,IAAAQ,eAAA,GAAAD,sBAAA,CAAAP,OAAA;AACA,IAAAS,UAAA,GAAAT,OAAA;AAOA,IAAAU,WAAA,GAAAV,OAAA;AACA,IAAAW,iBAAA,GAAAX,OAAA;AACA,IAAAY,OAAA,GAAAZ,OAAA;AAKkB,IAAAa,WAAA,GAAAb,OAAA;AA7BlB;AACA;AACA;;AAQA;AACA;AACA;;AAmBA,MAAM;EAAEc;AAAe,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AACtD,MAAM;EAAEC,UAAU;EAAEC;AAAY,CAAC,GAAG,IAA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AAG,IAAA3F,WAAA,CAAA8F,GAAA,EAACnG,eAAA,CAAAoG,OAAc,IAAE,CAAG;IAAA5E,QAAA,eAE9B,IAAAnB,WAAA,CAAA8F,GAAA,EAACxG,UAAA,CAAA4G,SAAS;MAETd,cAAc,EAAGA,cAAgB;MACjCxE,MAAM,EAAGA,MAAQ;MACjB+E,OAAO,EAAGA,OAAS;MACnBR,IAAI,EAAGA,IAAM;MACbgB,SAAS,EAAGxC,aAAe;MAC3BP,IAAI,EAAGA,IAAM;MACbwC,YAAY,EAAGA,YAAc;MAC7B7B,iBAAiB,EAAGA,iBAAmB;MACvCnB,SAAS,EAAGA,SAAW;MACvBlC,cAAc,EAAGA;IAAgB,GAV3BgC,UAWN;EAAC,CACG,CAAC;AAET","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_i18n","require","_element","_coreData","_dataviews","_router","_editor","_url","_page","_interopRequireDefault","_addNewTemplate","_constants","_lockUnlock","_dataviewsActions","_fields","_jsxRuntime","usePostActions","unlock","editorPrivateApis","useHistory","useLocation","routerPrivateApis","useEntityRecordsWithPermissions","corePrivateApis","EMPTY_ARRAY","defaultLayouts","LAYOUT_TABLE","fields","layout","primaryField","combinedFields","id","label","__","children","direction","styles","template","maxWidth","minWidth","preview","width","author","LAYOUT_GRID","mediaField","columnFields","LAYOUT_LIST","DEFAULT_VIEW","type","search","page","perPage","sort","field","filters","PageTemplates","path","query","activeView","postId","selection","setSelection","useState","defaultView","useMemo","usedType","operator","value","view","setView","useEffect","currentView","OPERATOR_IS_ANY","records","isResolving","isLoadingData","TEMPLATE_POST_TYPE","per_page","history","onChangeSelection","useCallback","items","navigate","addQueryArgs","length","undefined","authors","authorsSet","Set","forEach","add","author_text","Array","from","map","previewField","titleField","descriptionField","authorField","elements","data","paginationInfo","filterSortAndPaginate","postTypeActions","postType","context","editAction","useEditPostAction","actions","onChangeView","newView","jsx","default","className","title","DataViews","isLoading"],"sources":["@wordpress/edit-site/src/components/page-templates/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useState, useMemo, useCallback, useEffect } from '@wordpress/element';\nimport { privateApis as corePrivateApis } from '@wordpress/core-data';\nimport { DataViews, filterSortAndPaginate } from '@wordpress/dataviews';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport Page from '../page';\nimport AddNewTemplate from '../add-new-template';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tOPERATOR_IS_ANY,\n\tLAYOUT_GRID,\n\tLAYOUT_TABLE,\n\tLAYOUT_LIST,\n} from '../../utils/constants';\nimport { unlock } from '../../lock-unlock';\nimport { useEditPostAction } from '../dataviews-actions';\nimport {\n\tauthorField,\n\tdescriptionField,\n\tpreviewField,\n\ttitleField,\n} from './fields';\n\nconst { usePostActions } = unlock( editorPrivateApis );\nconst { useHistory, useLocation } = unlock( routerPrivateApis );\nconst { useEntityRecordsWithPermissions } = unlock( corePrivateApis );\n\nconst EMPTY_ARRAY = [];\n\nconst defaultLayouts = {\n\t[ LAYOUT_TABLE ]: {\n\t\tfields: [ 'template', 'author' ],\n\t\tlayout: {\n\t\t\tprimaryField: 'title',\n\t\t\tcombinedFields: [\n\t\t\t\t{\n\t\t\t\t\tid: 'template',\n\t\t\t\t\tlabel: __( 'Template' ),\n\t\t\t\t\tchildren: [ 'title', 'description' ],\n\t\t\t\t\tdirection: 'vertical',\n\t\t\t\t},\n\t\t\t],\n\t\t\tstyles: {\n\t\t\t\ttemplate: {\n\t\t\t\t\tmaxWidth: 400,\n\t\t\t\t\tminWidth: 320,\n\t\t\t\t},\n\t\t\t\tpreview: {\n\t\t\t\t\twidth: '1%',\n\t\t\t\t},\n\t\t\t\tauthor: {\n\t\t\t\t\twidth: '1%',\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t},\n\t[ LAYOUT_GRID ]: {\n\t\tfields: [ 'title', 'description', 'author' ],\n\t\tlayout: {\n\t\t\tmediaField: 'preview',\n\t\t\tprimaryField: 'title',\n\t\t\tcolumnFields: [ 'description' ],\n\t\t},\n\t},\n\t[ LAYOUT_LIST ]: {\n\t\tfields: [ 'title', 'description', 'author' ],\n\t\tlayout: {\n\t\t\tprimaryField: 'title',\n\t\t},\n\t},\n};\n\nconst DEFAULT_VIEW = {\n\ttype: LAYOUT_GRID,\n\tsearch: '',\n\tpage: 1,\n\tperPage: 20,\n\tsort: {\n\t\tfield: 'title',\n\t\tdirection: 'asc',\n\t},\n\tfields: defaultLayouts[ LAYOUT_GRID ].fields,\n\tlayout: defaultLayouts[ LAYOUT_GRID ].layout,\n\tfilters: [],\n};\n\nexport default function PageTemplates() {\n\tconst { path, query } = useLocation();\n\tconst { activeView = 'all', layout, postId } = query;\n\tconst [ selection, setSelection ] = useState( [ postId ] );\n\n\tconst defaultView = useMemo( () => {\n\t\tconst usedType = layout ?? DEFAULT_VIEW.type;\n\t\treturn {\n\t\t\t...DEFAULT_VIEW,\n\t\t\ttype: usedType,\n\t\t\tlayout: defaultLayouts[ usedType ].layout,\n\t\t\tfields: defaultLayouts[ usedType ].fields,\n\t\t\tfilters:\n\t\t\t\tactiveView !== 'all'\n\t\t\t\t\t? [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfield: 'author',\n\t\t\t\t\t\t\t\toperator: 'isAny',\n\t\t\t\t\t\t\t\tvalue: [ activeView ],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t ]\n\t\t\t\t\t: [],\n\t\t};\n\t}, [ layout, activeView ] );\n\tconst [ view, setView ] = useState( defaultView );\n\tuseEffect( () => {\n\t\tconst usedType = layout ?? DEFAULT_VIEW.type;\n\t\tsetView( ( currentView ) => ( {\n\t\t\t...currentView,\n\t\t\ttype: usedType,\n\t\t\tfilters:\n\t\t\t\tactiveView !== 'all'\n\t\t\t\t\t? [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfield: 'author',\n\t\t\t\t\t\t\t\toperator: OPERATOR_IS_ANY,\n\t\t\t\t\t\t\t\tvalue: [ activeView ],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t ]\n\t\t\t\t\t: [],\n\t\t} ) );\n\t}, [ activeView, layout ] );\n\n\tconst { records, isResolving: isLoadingData } =\n\t\tuseEntityRecordsWithPermissions( 'postType', TEMPLATE_POST_TYPE, {\n\t\t\tper_page: -1,\n\t\t} );\n\tconst history = useHistory();\n\tconst onChangeSelection = useCallback(\n\t\t( items ) => {\n\t\t\tsetSelection( items );\n\t\t\tif ( view?.type === LAYOUT_LIST ) {\n\t\t\t\thistory.navigate(\n\t\t\t\t\taddQueryArgs( path, {\n\t\t\t\t\t\tpostId: items.length === 1 ? items[ 0 ] : undefined,\n\t\t\t\t\t} )\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\t[ history, path, view?.type ]\n\t);\n\n\tconst authors = useMemo( () => {\n\t\tif ( ! records ) {\n\t\t\treturn EMPTY_ARRAY;\n\t\t}\n\t\tconst authorsSet = new Set();\n\t\trecords.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}, [ records ] );\n\n\tconst fields = useMemo(\n\t\t() => [\n\t\t\tpreviewField,\n\t\t\ttitleField,\n\t\t\tdescriptionField,\n\t\t\t{\n\t\t\t\t...authorField,\n\t\t\t\telements: authors,\n\t\t\t},\n\t\t],\n\t\t[ authors ]\n\t);\n\n\tconst { data, paginationInfo } = useMemo( () => {\n\t\treturn filterSortAndPaginate( records, view, fields );\n\t}, [ records, view, fields ] );\n\n\tconst postTypeActions = usePostActions( {\n\t\tpostType: TEMPLATE_POST_TYPE,\n\t\tcontext: 'list',\n\t} );\n\tconst editAction = useEditPostAction();\n\tconst actions = useMemo(\n\t\t() => [ editAction, ...postTypeActions ],\n\t\t[ postTypeActions, editAction ]\n\t);\n\n\tconst onChangeView = useCallback(\n\t\t( newView ) => {\n\t\t\tif ( newView.type !== view.type ) {\n\t\t\t\thistory.navigate(\n\t\t\t\t\taddQueryArgs( path, {\n\t\t\t\t\t\tlayout: newView.type,\n\t\t\t\t\t} )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tsetView( newView );\n\t\t},\n\t\t[ view.type, setView, history, path ]\n\t);\n\n\treturn (\n\t\t<Page\n\t\t\tclassName=\"edit-site-page-templates\"\n\t\t\ttitle={ __( 'Templates' ) }\n\t\t\tactions={ <AddNewTemplate /> }\n\t\t>\n\t\t\t<DataViews\n\t\t\t\tkey={ activeView }\n\t\t\t\tpaginationInfo={ paginationInfo }\n\t\t\t\tfields={ fields }\n\t\t\t\tactions={ actions }\n\t\t\t\tdata={ data }\n\t\t\t\tisLoading={ isLoadingData }\n\t\t\t\tview={ view }\n\t\t\t\tonChangeView={ onChangeView }\n\t\t\t\tonChangeSelection={ onChangeSelection }\n\t\t\t\tselection={ selection }\n\t\t\t\tdefaultLayouts={ defaultLayouts }\n\t\t\t/>\n\t\t</Page>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,IAAA,GAAAN,OAAA;AAKA,IAAAO,KAAA,GAAAC,sBAAA,CAAAR,OAAA;AACA,IAAAS,eAAA,GAAAD,sBAAA,CAAAR,OAAA;AACA,IAAAU,UAAA,GAAAV,OAAA;AAOA,IAAAW,WAAA,GAAAX,OAAA;AACA,IAAAY,iBAAA,GAAAZ,OAAA;AACA,IAAAa,OAAA,GAAAb,OAAA;AAKkB,IAAAc,WAAA,GAAAd,OAAA;AA9BlB;AACA;AACA;;AASA;AACA;AACA;;AAmBA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ACH,CAAC;IACF;IAEAqB,OAAO,CAAEyC,OAAQ,CAAC;EACnB,CAAC,EACD,CAAE1C,IAAI,CAACpB,IAAI,EAAEqB,OAAO,EAAES,OAAO,EAAEtB,IAAI,CACpC,CAAC;EAED,oBACC,IAAAzC,WAAA,CAAAgG,GAAA,EAACvG,KAAA,CAAAwG,OAAI;IACJC,SAAS,EAAC,0BAA0B;IACpCC,KAAK,EAAG,IAAAjF,QAAE,EAAE,WAAY,CAAG;IAC3B2E,OAAO,eAAG,IAAA7F,WAAA,CAAAgG,GAAA,EAACrG,eAAA,CAAAsG,OAAc,IAAE,CAAG;IAAA9E,QAAA,eAE9B,IAAAnB,WAAA,CAAAgG,GAAA,EAAC3G,UAAA,CAAA+G,SAAS;MAETd,cAAc,EAAGA,cAAgB;MACjC1E,MAAM,EAAGA,MAAQ;MACjBiF,OAAO,EAAGA,OAAS;MACnBR,IAAI,EAAGA,IAAM;MACbgB,SAAS,EAAGzC,aAAe;MAC3BP,IAAI,EAAGA,IAAM;MACbyC,YAAY,EAAGA,YAAc;MAC7B9B,iBAAiB,EAAGA,iBAAmB;MACvCnB,SAAS,EAAGA,SAAW;MACvBnC,cAAc,EAAGA;IAAgB,GAV3BiC,UAWN;EAAC,CACG,CAAC;AAET","ignoreList":[]}
|
|
@@ -15,6 +15,8 @@ var _element = require("@wordpress/element");
|
|
|
15
15
|
var _editor = require("@wordpress/editor");
|
|
16
16
|
var _page = _interopRequireDefault(require("../page"));
|
|
17
17
|
var _lockUnlock = require("../../lock-unlock");
|
|
18
|
+
var _usePatternSettings = _interopRequireDefault(require("../page-patterns/use-pattern-settings"));
|
|
19
|
+
var _blockEditor = require("@wordpress/block-editor");
|
|
18
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
21
|
/**
|
|
20
22
|
* External dependencies
|
|
@@ -51,7 +53,9 @@ function PostEditForm({
|
|
|
51
53
|
} = (0, _data.useDispatch)(_coreData.store);
|
|
52
54
|
const {
|
|
53
55
|
fields: _fields
|
|
54
|
-
} = usePostFields(
|
|
56
|
+
} = usePostFields({
|
|
57
|
+
postType
|
|
58
|
+
});
|
|
55
59
|
const fields = (0, _element.useMemo)(() => _fields?.map(field => {
|
|
56
60
|
if (field.id === 'status') {
|
|
57
61
|
return {
|
|
@@ -70,7 +74,12 @@ function PostEditForm({
|
|
|
70
74
|
id: 'status',
|
|
71
75
|
label: (0, _i18n.__)('Status & Visibility'),
|
|
72
76
|
children: ['status', 'password']
|
|
73
|
-
}, 'author', 'date', 'slug', 'parent', 'comment_status'
|
|
77
|
+
}, 'author', 'date', 'slug', 'parent', 'comment_status', {
|
|
78
|
+
label: (0, _i18n.__)('Template'),
|
|
79
|
+
labelPosition: 'side',
|
|
80
|
+
id: 'template',
|
|
81
|
+
layout: 'regular'
|
|
82
|
+
}].filter(field => ids.length === 1 || fieldsWithBulkEditSupport.includes(field))
|
|
74
83
|
}), [ids]);
|
|
75
84
|
const onChange = edits => {
|
|
76
85
|
for (const id of ids) {
|
|
@@ -92,6 +101,32 @@ function PostEditForm({
|
|
|
92
101
|
(0, _element.useEffect)(() => {
|
|
93
102
|
setMultiEdits({});
|
|
94
103
|
}, [ids]);
|
|
104
|
+
const {
|
|
105
|
+
ExperimentalBlockEditorProvider
|
|
106
|
+
} = (0, _lockUnlock.unlock)(_blockEditor.privateApis);
|
|
107
|
+
const settings = (0, _usePatternSettings.default)();
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* The template field depends on the block editor settings.
|
|
111
|
+
* This is a workaround to ensure that the block editor settings are available.
|
|
112
|
+
* For more information, see: https://github.com/WordPress/gutenberg/issues/67521
|
|
113
|
+
*/
|
|
114
|
+
const fieldsWithDependency = (0, _element.useMemo)(() => {
|
|
115
|
+
return fields.map(field => {
|
|
116
|
+
if (field.id === 'template') {
|
|
117
|
+
return {
|
|
118
|
+
...field,
|
|
119
|
+
Edit: data => /*#__PURE__*/(0, _jsxRuntime.jsx)(ExperimentalBlockEditorProvider, {
|
|
120
|
+
settings: settings,
|
|
121
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(field.Edit, {
|
|
122
|
+
...data
|
|
123
|
+
})
|
|
124
|
+
})
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
return field;
|
|
128
|
+
});
|
|
129
|
+
}, [fields, settings]);
|
|
95
130
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalVStack, {
|
|
96
131
|
spacing: 4,
|
|
97
132
|
children: [ids.length === 1 && /*#__PURE__*/(0, _jsxRuntime.jsx)(PostCardPanel, {
|
|
@@ -99,7 +134,7 @@ function PostEditForm({
|
|
|
99
134
|
postId: ids[0]
|
|
100
135
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_dataviews.DataForm, {
|
|
101
136
|
data: ids.length === 1 ? record : multiEdits,
|
|
102
|
-
fields:
|
|
137
|
+
fields: fieldsWithDependency,
|
|
103
138
|
form: form,
|
|
104
139
|
onChange: onChange
|
|
105
140
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_dataviews","_data","_coreData","_components","_element","_editor","_page","_lockUnlock","_jsxRuntime","PostCardPanel","usePostFields","unlock","editorPrivateApis","fieldsWithBulkEditSupport","PostEditForm","postType","postId","ids","useMemo","split","record","useSelect","select","length","coreDataStore","getEditedEntityRecord","multiEdits","setMultiEdits","useState","editEntityRecord","useDispatch","fields","_fields","map","field","id","elements","filter","element","value","form","type","layout","label","__","children","includes","onChange","edits","status","Date","date","password","prev","useEffect","jsxs","__experimentalVStack","spacing","jsx","DataForm","data","PostEdit","default","className","clsx"],"sources":["@wordpress/edit-site/src/components/post-edit/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { DataForm } from '@wordpress/dataviews';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { __experimentalVStack as VStack } from '@wordpress/components';\nimport { useState, useMemo, useEffect } from '@wordpress/element';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport Page from '../page';\nimport { unlock } from '../../lock-unlock';\n\nconst { PostCardPanel, usePostFields } = unlock( editorPrivateApis );\n\nconst fieldsWithBulkEditSupport = [\n\t'title',\n\t'status',\n\t'date',\n\t'author',\n\t'comment_status',\n];\n\nfunction PostEditForm( { postType, postId } ) {\n\tconst ids = useMemo( () => postId.split( ',' ), [ postId ] );\n\tconst { record } = useSelect(\n\t\t( select ) => {\n\t\t\treturn {\n\t\t\t\trecord:\n\t\t\t\t\tids.length === 1\n\t\t\t\t\t\t? select( coreDataStore ).getEditedEntityRecord(\n\t\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\t\tpostType,\n\t\t\t\t\t\t\t\tids[ 0 ]\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: null,\n\t\t\t};\n\t\t},\n\t\t[ postType, ids ]\n\t);\n\tconst [ multiEdits, setMultiEdits ] = useState( {} );\n\tconst { editEntityRecord } = useDispatch( coreDataStore );\n\tconst { fields: _fields } = usePostFields();\n\tconst fields = useMemo(\n\t\t() =>\n\t\t\t_fields?.map( ( field ) => {\n\t\t\t\tif ( field.id === 'status' ) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...field,\n\t\t\t\t\t\telements: field.elements.filter(\n\t\t\t\t\t\t\t( element ) => element.value !== 'trash'\n\t\t\t\t\t\t),\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\treturn field;\n\t\t\t} ),\n\t\t[ _fields ]\n\t);\n\n\tconst form = useMemo(\n\t\t() => ( {\n\t\t\ttype: 'panel',\n\t\t\tfields: [\n\t\t\t\t{\n\t\t\t\t\tid: 'featured_media',\n\t\t\t\t\tlayout: 'regular',\n\t\t\t\t},\n\t\t\t\t'title',\n\t\t\t\t{\n\t\t\t\t\tid: 'status',\n\t\t\t\t\tlabel: __( 'Status & Visibility' ),\n\t\t\t\t\tchildren: [ 'status', 'password' ],\n\t\t\t\t},\n\t\t\t\t'author',\n\t\t\t\t'date',\n\t\t\t\t'slug',\n\t\t\t\t'parent',\n\t\t\t\t'comment_status',\n\t\t\t].filter(\n\t\t\t\t( field ) =>\n\t\t\t\t\tids.length === 1 ||\n\t\t\t\t\tfieldsWithBulkEditSupport.includes( field )\n\t\t\t),\n\t\t} ),\n\t\t[ ids ]\n\t);\n\tconst onChange = ( edits ) => {\n\t\tfor ( const id of ids ) {\n\t\t\tif (\n\t\t\t\tedits.status &&\n\t\t\t\tedits.status !== 'future' &&\n\t\t\t\trecord?.status === 'future' &&\n\t\t\t\tnew Date( record.date ) > new Date()\n\t\t\t) {\n\t\t\t\tedits.date = null;\n\t\t\t}\n\t\t\tif (\n\t\t\t\tedits.status &&\n\t\t\t\tedits.status === 'private' &&\n\t\t\t\trecord.password\n\t\t\t) {\n\t\t\t\tedits.password = '';\n\t\t\t}\n\t\t\teditEntityRecord( 'postType', postType, id, edits );\n\t\t\tif ( ids.length > 1 ) {\n\t\t\t\tsetMultiEdits( ( prev ) => ( {\n\t\t\t\t\t...prev,\n\t\t\t\t\t...edits,\n\t\t\t\t} ) );\n\t\t\t}\n\t\t}\n\t};\n\tuseEffect( () => {\n\t\tsetMultiEdits( {} );\n\t}, [ ids ] );\n\n\treturn (\n\t\t<VStack spacing={ 4 }>\n\t\t\t{ ids.length === 1 && (\n\t\t\t\t<PostCardPanel postType={ postType } postId={ ids[ 0 ] } />\n\t\t\t) }\n\t\t\t<DataForm\n\t\t\t\tdata={ ids.length === 1 ? record : multiEdits }\n\t\t\t\tfields={ fields }\n\t\t\t\tform={ form }\n\t\t\t\tonChange={ onChange }\n\t\t\t/>\n\t\t</VStack>\n\t);\n}\n\nexport function PostEdit( { postType, postId } ) {\n\treturn (\n\t\t<Page\n\t\t\tclassName={ clsx( 'edit-site-post-edit', {\n\t\t\t\t'is-empty': ! postId,\n\t\t\t} ) }\n\t\t\tlabel={ __( 'Post Edit' ) }\n\t\t>\n\t\t\t{ postId && (\n\t\t\t\t<PostEditForm postType={ postType } postId={ postId } />\n\t\t\t) }\n\t\t\t{ ! postId && <p>{ __( 'Select a page to edit' ) }</p> }\n\t\t</Page>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AAKA,IAAAQ,KAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,WAAA,GAAAT,OAAA;AAA2C,IAAAU,WAAA,GAAAV,OAAA;AApB3C;AACA;AACA;;AAGA;AACA;AACA;;AASA;AACA;AACA;;AAIA,MAAM;EAAEW,aAAa;EAAEC;AAAc,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAEpE,MAAMC,yBAAyB,GAAG,CACjC,OAAO,EACP,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,gBAAgB,CAChB;AAED,SAASC,YAAYA,CAAE;EAAEC,QAAQ;EAAEC;AAAO,CAAC,EAAG;EAC7C,MAAMC,GAAG,GAAG,IAAAC,gBAAO,EAAE,MAAMF,MAAM,CAACG,KAAK,CAAE,GAAI,CAAC,EAAE,CAAEH,MAAM,CAAG,CAAC;EAC5D,MAAM;IAAEI;EAAO,CAAC,GAAG,IAAAC,eAAS,EACzBC,MAAM,IAAM;IACb,OAAO;MACNF,MAAM,EACLH,GAAG,CAACM,MAAM,KAAK,CAAC,GACbD,MAAM,CAAEE,eAAc,CAAC,CAACC,qBAAqB,CAC7C,UAAU,EACVV,QAAQ,EACRE,GAAG,CAAE,CAAC,CACN,CAAC,G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AAQ;MACjBS,IAAI,EAAGA,IAAM;MACbO,QAAQ,EAAGA;IAAU,CACrB,CAAC;EAAA,CACK,CAAC;AAEX;AAEO,SAASc,QAAQA,CAAE;EAAE9C,QAAQ;EAAEC;AAAO,CAAC,EAAG;EAChD,oBACC,IAAAR,WAAA,CAAA+C,IAAA,EAACjD,KAAA,CAAAwD,OAAI;IACJC,SAAS,EAAG,IAAAC,aAAI,EAAE,qBAAqB,EAAE;MACxC,UAAU,EAAE,CAAEhD;IACf,CAAE,CAAG;IACL2B,KAAK,EAAG,IAAAC,QAAE,EAAE,WAAY,CAAG;IAAAC,QAAA,GAEzB7B,MAAM,iBACP,IAAAR,WAAA,CAAAkD,GAAA,EAAC5C,YAAY;MAACC,QAAQ,EAAGA,QAAU;MAACC,MAAM,EAAGA;IAAQ,CAAE,CACvD,EACC,CAAEA,MAAM,iBAAI,IAAAR,WAAA,CAAAkD,GAAA;MAAAb,QAAA,EAAK,IAAAD,QAAE,EAAE,uBAAwB;IAAC,CAAK,CAAC;EAAA,CACjD,CAAC;AAET","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_dataviews","_data","_coreData","_components","_element","_editor","_page","_lockUnlock","_usePatternSettings","_blockEditor","_jsxRuntime","PostCardPanel","usePostFields","unlock","editorPrivateApis","fieldsWithBulkEditSupport","PostEditForm","postType","postId","ids","useMemo","split","record","useSelect","select","length","coreDataStore","getEditedEntityRecord","multiEdits","setMultiEdits","useState","editEntityRecord","useDispatch","fields","_fields","map","field","id","elements","filter","element","value","form","type","layout","label","__","children","labelPosition","includes","onChange","edits","status","Date","date","password","prev","useEffect","ExperimentalBlockEditorProvider","blockEditorPrivateApis","settings","usePatternSettings","fieldsWithDependency","Edit","data","jsx","jsxs","__experimentalVStack","spacing","DataForm","PostEdit","default","className","clsx"],"sources":["@wordpress/edit-site/src/components/post-edit/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { DataForm } from '@wordpress/dataviews';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { __experimentalVStack as VStack } from '@wordpress/components';\nimport { useState, useMemo, useEffect } from '@wordpress/element';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport Page from '../page';\nimport { unlock } from '../../lock-unlock';\nimport usePatternSettings from '../page-patterns/use-pattern-settings';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\nconst { PostCardPanel, usePostFields } = unlock( editorPrivateApis );\n\nconst fieldsWithBulkEditSupport = [\n\t'title',\n\t'status',\n\t'date',\n\t'author',\n\t'comment_status',\n];\n\nfunction PostEditForm( { postType, postId } ) {\n\tconst ids = useMemo( () => postId.split( ',' ), [ postId ] );\n\tconst { record } = useSelect(\n\t\t( select ) => {\n\t\t\treturn {\n\t\t\t\trecord:\n\t\t\t\t\tids.length === 1\n\t\t\t\t\t\t? select( coreDataStore ).getEditedEntityRecord(\n\t\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\t\tpostType,\n\t\t\t\t\t\t\t\tids[ 0 ]\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: null,\n\t\t\t};\n\t\t},\n\t\t[ postType, ids ]\n\t);\n\tconst [ multiEdits, setMultiEdits ] = useState( {} );\n\tconst { editEntityRecord } = useDispatch( coreDataStore );\n\tconst { fields: _fields } = usePostFields( { postType } );\n\tconst fields = useMemo(\n\t\t() =>\n\t\t\t_fields?.map( ( field ) => {\n\t\t\t\tif ( field.id === 'status' ) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...field,\n\t\t\t\t\t\telements: field.elements.filter(\n\t\t\t\t\t\t\t( element ) => element.value !== 'trash'\n\t\t\t\t\t\t),\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\treturn field;\n\t\t\t} ),\n\t\t[ _fields ]\n\t);\n\n\tconst form = useMemo(\n\t\t() => ( {\n\t\t\ttype: 'panel',\n\t\t\tfields: [\n\t\t\t\t{\n\t\t\t\t\tid: 'featured_media',\n\t\t\t\t\tlayout: 'regular',\n\t\t\t\t},\n\t\t\t\t'title',\n\t\t\t\t{\n\t\t\t\t\tid: 'status',\n\t\t\t\t\tlabel: __( 'Status & Visibility' ),\n\t\t\t\t\tchildren: [ 'status', 'password' ],\n\t\t\t\t},\n\t\t\t\t'author',\n\t\t\t\t'date',\n\t\t\t\t'slug',\n\t\t\t\t'parent',\n\t\t\t\t'comment_status',\n\t\t\t\t{\n\t\t\t\t\tlabel: __( 'Template' ),\n\t\t\t\t\tlabelPosition: 'side',\n\t\t\t\t\tid: 'template',\n\t\t\t\t\tlayout: 'regular',\n\t\t\t\t},\n\t\t\t].filter(\n\t\t\t\t( field ) =>\n\t\t\t\t\tids.length === 1 ||\n\t\t\t\t\tfieldsWithBulkEditSupport.includes( field )\n\t\t\t),\n\t\t} ),\n\t\t[ ids ]\n\t);\n\tconst onChange = ( edits ) => {\n\t\tfor ( const id of ids ) {\n\t\t\tif (\n\t\t\t\tedits.status &&\n\t\t\t\tedits.status !== 'future' &&\n\t\t\t\trecord?.status === 'future' &&\n\t\t\t\tnew Date( record.date ) > new Date()\n\t\t\t) {\n\t\t\t\tedits.date = null;\n\t\t\t}\n\t\t\tif (\n\t\t\t\tedits.status &&\n\t\t\t\tedits.status === 'private' &&\n\t\t\t\trecord.password\n\t\t\t) {\n\t\t\t\tedits.password = '';\n\t\t\t}\n\t\t\teditEntityRecord( 'postType', postType, id, edits );\n\t\t\tif ( ids.length > 1 ) {\n\t\t\t\tsetMultiEdits( ( prev ) => ( {\n\t\t\t\t\t...prev,\n\t\t\t\t\t...edits,\n\t\t\t\t} ) );\n\t\t\t}\n\t\t}\n\t};\n\tuseEffect( () => {\n\t\tsetMultiEdits( {} );\n\t}, [ ids ] );\n\n\tconst { ExperimentalBlockEditorProvider } = unlock(\n\t\tblockEditorPrivateApis\n\t);\n\tconst settings = usePatternSettings();\n\n\t/**\n\t * The template field depends on the block editor settings.\n\t * This is a workaround to ensure that the block editor settings are available.\n\t * For more information, see: https://github.com/WordPress/gutenberg/issues/67521\n\t */\n\tconst fieldsWithDependency = useMemo( () => {\n\t\treturn fields.map( ( field ) => {\n\t\t\tif ( field.id === 'template' ) {\n\t\t\t\treturn {\n\t\t\t\t\t...field,\n\t\t\t\t\tEdit: ( data ) => (\n\t\t\t\t\t\t<ExperimentalBlockEditorProvider settings={ settings }>\n\t\t\t\t\t\t\t<field.Edit { ...data } />\n\t\t\t\t\t\t</ExperimentalBlockEditorProvider>\n\t\t\t\t\t),\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn field;\n\t\t} );\n\t}, [ fields, settings ] );\n\n\treturn (\n\t\t<VStack spacing={ 4 }>\n\t\t\t{ ids.length === 1 && (\n\t\t\t\t<PostCardPanel postType={ postType } postId={ ids[ 0 ] } />\n\t\t\t) }\n\t\t\t<DataForm\n\t\t\t\tdata={ ids.length === 1 ? record : multiEdits }\n\t\t\t\tfields={ fieldsWithDependency }\n\t\t\t\tform={ form }\n\t\t\t\tonChange={ onChange }\n\t\t\t/>\n\t\t</VStack>\n\t);\n}\n\nexport function PostEdit( { postType, postId } ) {\n\treturn (\n\t\t<Page\n\t\t\tclassName={ clsx( 'edit-site-post-edit', {\n\t\t\t\t'is-empty': ! postId,\n\t\t\t} ) }\n\t\t\tlabel={ __( 'Post Edit' ) }\n\t\t>\n\t\t\t{ postId && (\n\t\t\t\t<PostEditForm postType={ postType } postId={ postId } />\n\t\t\t) }\n\t\t\t{ ! postId && <p>{ __( 'Select a page to edit' ) }</p> }\n\t\t</Page>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,SAA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-14,13 +14,14 @@ var _dataviews = require("@wordpress/dataviews");
|
|
|
14
14
|
var _editor = require("@wordpress/editor");
|
|
15
15
|
var _i18n = require("@wordpress/i18n");
|
|
16
16
|
var _icons = require("@wordpress/icons");
|
|
17
|
+
var _compose = require("@wordpress/compose");
|
|
18
|
+
var _url = require("@wordpress/url");
|
|
17
19
|
var _page = _interopRequireDefault(require("../page"));
|
|
18
20
|
var _defaultViews = require("../sidebar-dataviews/default-views");
|
|
19
21
|
var _constants = require("../../utils/constants");
|
|
20
22
|
var _addNewPost = _interopRequireDefault(require("../add-new-post"));
|
|
21
23
|
var _lockUnlock = require("../../lock-unlock");
|
|
22
24
|
var _dataviewsActions = require("../dataviews-actions");
|
|
23
|
-
var _compose = require("@wordpress/compose");
|
|
24
25
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
25
26
|
/**
|
|
26
27
|
* WordPress dependencies
|
|
@@ -73,7 +74,8 @@ const getCustomView = editedEntityRecord => {
|
|
|
73
74
|
*/
|
|
74
75
|
function useView(postType) {
|
|
75
76
|
const {
|
|
76
|
-
|
|
77
|
+
path,
|
|
78
|
+
query: {
|
|
77
79
|
activeView = 'all',
|
|
78
80
|
isCustom = 'false',
|
|
79
81
|
layout
|
|
@@ -115,17 +117,13 @@ function useView(postType) {
|
|
|
115
117
|
};
|
|
116
118
|
});
|
|
117
119
|
const setViewWithUrlUpdate = (0, _element.useCallback)(newView => {
|
|
118
|
-
|
|
119
|
-
params
|
|
120
|
-
} = history.getLocationWithParams();
|
|
121
|
-
if (newView.type === _constants.LAYOUT_LIST && !params?.layout) {
|
|
120
|
+
if (newView.type === _constants.LAYOUT_LIST && !layout) {
|
|
122
121
|
// Skip updating the layout URL param if
|
|
123
122
|
// it is not present and the newView.type is LAYOUT_LIST.
|
|
124
|
-
} else if (newView.type !==
|
|
125
|
-
history.
|
|
126
|
-
...params,
|
|
123
|
+
} else if (newView.type !== layout) {
|
|
124
|
+
history.navigate((0, _url.addQueryArgs)(path, {
|
|
127
125
|
layout: newView.type
|
|
128
|
-
});
|
|
126
|
+
}));
|
|
129
127
|
}
|
|
130
128
|
setView(newView);
|
|
131
129
|
if (isCustom === 'true' && editedEntityRecord?.id) {
|
|
@@ -133,7 +131,7 @@ function useView(postType) {
|
|
|
133
131
|
content: JSON.stringify(newView)
|
|
134
132
|
});
|
|
135
133
|
}
|
|
136
|
-
}, [history, isCustom, editEntityRecord, editedEntityRecord?.id]);
|
|
134
|
+
}, [history, isCustom, editEntityRecord, editedEntityRecord?.id, layout, path]);
|
|
137
135
|
|
|
138
136
|
// When layout URL param changes, update the view type
|
|
139
137
|
// without affecting any other config.
|
|
@@ -182,21 +180,17 @@ function PostList({
|
|
|
182
180
|
quickEdit = false,
|
|
183
181
|
isCustom,
|
|
184
182
|
activeView = 'all'
|
|
185
|
-
} = location.
|
|
183
|
+
} = location.query;
|
|
186
184
|
const [selection, setSelection] = (0, _element.useState)((_postId$split = postId?.split(',')) !== null && _postId$split !== void 0 ? _postId$split : []);
|
|
187
185
|
const onChangeSelection = (0, _element.useCallback)(items => {
|
|
188
|
-
var
|
|
186
|
+
var _location$query$isCus;
|
|
189
187
|
setSelection(items);
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
} = history.getLocationWithParams();
|
|
193
|
-
if (((_params$isCustom = params.isCustom) !== null && _params$isCustom !== void 0 ? _params$isCustom : 'false') === 'false') {
|
|
194
|
-
history.push({
|
|
195
|
-
...params,
|
|
188
|
+
if (((_location$query$isCus = location.query.isCustom) !== null && _location$query$isCus !== void 0 ? _location$query$isCus : 'false') === 'false') {
|
|
189
|
+
history.navigate((0, _url.addQueryArgs)(location.path, {
|
|
196
190
|
postId: items.join(',')
|
|
197
|
-
});
|
|
191
|
+
}));
|
|
198
192
|
}
|
|
199
|
-
}, [history]);
|
|
193
|
+
}, [location.path, location.query.isCustom, history]);
|
|
200
194
|
const getActiveViewFilters = (views, match) => {
|
|
201
195
|
var _found$filters;
|
|
202
196
|
const found = views.find(({
|
|
@@ -207,7 +201,9 @@ function PostList({
|
|
|
207
201
|
const {
|
|
208
202
|
isLoading: isLoadingFields,
|
|
209
203
|
fields: _fields
|
|
210
|
-
} = usePostFields(
|
|
204
|
+
} = usePostFields({
|
|
205
|
+
postType
|
|
206
|
+
});
|
|
211
207
|
const fields = (0, _element.useMemo)(() => {
|
|
212
208
|
const activeViewFilters = getActiveViewFilters(defaultViews, activeView).map(({
|
|
213
209
|
field
|
|
@@ -282,12 +278,11 @@ function PostList({
|
|
|
282
278
|
const postIdWasDeleted = deletedIds.includes(postId);
|
|
283
279
|
(0, _element.useEffect)(() => {
|
|
284
280
|
if (postIdWasDeleted) {
|
|
285
|
-
history.
|
|
286
|
-
...history.getLocationWithParams().params,
|
|
281
|
+
history.navigate((0, _url.addQueryArgs)(location.path, {
|
|
287
282
|
postId: undefined
|
|
288
|
-
});
|
|
283
|
+
}));
|
|
289
284
|
}
|
|
290
|
-
}, [postIdWasDeleted,
|
|
285
|
+
}, [history, postIdWasDeleted, location.path]);
|
|
291
286
|
const paginationInfo = (0, _element.useMemo)(() => ({
|
|
292
287
|
totalItems,
|
|
293
288
|
totalPages
|
|
@@ -321,11 +316,7 @@ function PostList({
|
|
|
321
316
|
type,
|
|
322
317
|
id
|
|
323
318
|
}) => {
|
|
324
|
-
history.
|
|
325
|
-
postId: id,
|
|
326
|
-
postType: type,
|
|
327
|
-
canvas: 'edit'
|
|
328
|
-
});
|
|
319
|
+
history.navigate(`/${type}/${id}?canvas=edit`);
|
|
329
320
|
closeModal();
|
|
330
321
|
};
|
|
331
322
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_page.default, {
|
|
@@ -356,11 +347,7 @@ function PostList({
|
|
|
356
347
|
onClickItem: ({
|
|
357
348
|
id
|
|
358
349
|
}) => {
|
|
359
|
-
history.
|
|
360
|
-
postId: id,
|
|
361
|
-
postType,
|
|
362
|
-
canvas: 'edit'
|
|
363
|
-
});
|
|
350
|
+
history.navigate(`/${postType}/${id}?canvas=edit`);
|
|
364
351
|
},
|
|
365
352
|
getItemId: getItemId,
|
|
366
353
|
defaultLayouts: _defaultViews.defaultLayouts,
|
|
@@ -370,10 +357,9 @@ function PostList({
|
|
|
370
357
|
icon: _icons.drawerRight,
|
|
371
358
|
label: (0, _i18n.__)('Details'),
|
|
372
359
|
onClick: () => {
|
|
373
|
-
history.
|
|
374
|
-
...location.params,
|
|
360
|
+
history.navigate((0, _url.addQueryArgs)(location.path, {
|
|
375
361
|
quickEdit: quickEdit ? undefined : true
|
|
376
|
-
});
|
|
362
|
+
}));
|
|
377
363
|
}
|
|
378
364
|
})
|
|
379
365
|
}, activeView + isCustom)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_coreData","_element","_router","_data","_dataviews","_editor","_i18n","_icons","_page","_interopRequireDefault","_defaultViews","_constants","_addNewPost","_lockUnlock","_dataviewsActions","_compose","_jsxRuntime","usePostActions","usePostFields","unlock","editorPrivateApis","useLocation","useHistory","routerPrivateApis","useEntityRecordsWithPermissions","coreDataPrivateApis","EMPTY_ARRAY","getDefaultView","defaultViews","activeView","find","slug","view","getCustomView","editedEntityRecord","content","undefined","JSON","parse","layout","defaultLayouts","type","useView","postType","params","isCustom","history","useDefaultViews","editEntityRecord","useDispatch","coreStore","useSelect","select","getEditedEntityRecord","Number","setView","useState","initialView","_getCustomView","LAYOUT_LIST","_getDefaultView","setViewWithUrlUpdate","useCallback","newView","getLocationWithParams","push","id","stringify","useEffect","prevView","DEFAULT_STATUSES","getItemId","item","toString","PostList","_postId$split","_data$map","_usePrevious","location","postId","quickEdit","selection","setSelection","split","onChangeSelection","items","_params$isCustom","join","getActiveViewFilters","views","match","_found$filters","found","filters","isLoading","isLoadingFields","fields","_fields","useMemo","activeViewFilters","map","field","elements","includes","queryArgs","forEach","filter","operator","OPERATOR_IS_ANY","status","value","author","OPERATOR_IS_NONE","author_exclude","per_page","perPage","page","_embed","order","sort","direction","orderby","search","records","isResolving","isLoadingData","totalItems","totalPages","data","filterSortAndPaginate","ids","record","prevIds","usePrevious","deletedIds","postIdWasDeleted","paginationInfo","labels","canCreateRecord","getPostType","canUser","kind","name","postTypeActions","context","editAction","useEditPostAction","actions","showAddPostModal","setShowAddPostModal","openModal","closeModal","handleNewPage","canvas","jsx","default","title","add_new_item","jsxs","Fragment","children","Button","variant","onClick","__next40pxDefaultSize","onSave","onClose","DataViews","onChangeView","isItemClickable","onClickItem","header","window","__experimentalQuickEditDataViews","size","isPressed","icon","drawerRight","label","__"],"sources":["@wordpress/edit-site/src/components/post-list/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport {\n\tstore as coreStore,\n\tprivateApis as coreDataPrivateApis,\n} from '@wordpress/core-data';\nimport { useState, useMemo, useCallback, useEffect } from '@wordpress/element';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { DataViews, filterSortAndPaginate } from '@wordpress/dataviews';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { __ } from '@wordpress/i18n';\nimport { drawerRight } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport Page from '../page';\nimport {\n\tuseDefaultViews,\n\tdefaultLayouts,\n} from '../sidebar-dataviews/default-views';\nimport {\n\tOPERATOR_IS_ANY,\n\tOPERATOR_IS_NONE,\n\tLAYOUT_LIST,\n} from '../../utils/constants';\n\nimport AddNewPostModal from '../add-new-post';\nimport { unlock } from '../../lock-unlock';\nimport { useEditPostAction } from '../dataviews-actions';\nimport { usePrevious } from '@wordpress/compose';\n\nconst { usePostActions, usePostFields } = unlock( editorPrivateApis );\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\nconst { useEntityRecordsWithPermissions } = unlock( coreDataPrivateApis );\nconst EMPTY_ARRAY = [];\n\nconst getDefaultView = ( defaultViews, activeView ) => {\n\treturn defaultViews.find( ( { slug } ) => slug === activeView )?.view;\n};\n\nconst getCustomView = ( editedEntityRecord ) => {\n\tif ( ! editedEntityRecord?.content ) {\n\t\treturn undefined;\n\t}\n\n\tconst content = JSON.parse( editedEntityRecord.content );\n\tif ( ! content ) {\n\t\treturn undefined;\n\t}\n\n\treturn {\n\t\t...content,\n\t\tlayout: defaultLayouts[ content.type ]?.layout,\n\t};\n};\n\n/**\n * This function abstracts working with default & custom views by\n * providing a [ state, setState ] tuple based on the URL parameters.\n *\n * Consumers use the provided tuple to work with state\n * and don't have to deal with the specifics of default & custom views.\n *\n * @param {string} postType Post type to retrieve default views for.\n * @return {Array} The [ state, setState ] tuple.\n */\nfunction useView( postType ) {\n\tconst {\n\t\tparams: { activeView = 'all', isCustom = 'false', layout },\n\t} = useLocation();\n\tconst history = useHistory();\n\n\tconst defaultViews = useDefaultViews( { postType } );\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\tconst editedEntityRecord = useSelect(\n\t\t( select ) => {\n\t\t\tif ( isCustom !== 'true' ) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst { getEditedEntityRecord } = select( coreStore );\n\t\t\treturn getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t'wp_dataviews',\n\t\t\t\tNumber( activeView )\n\t\t\t);\n\t\t},\n\t\t[ activeView, isCustom ]\n\t);\n\tconst [ view, setView ] = useState( () => {\n\t\tlet initialView;\n\t\tif ( isCustom === 'true' ) {\n\t\t\tinitialView = getCustomView( editedEntityRecord ) ?? {\n\t\t\t\ttype: layout ?? LAYOUT_LIST,\n\t\t\t};\n\t\t} else {\n\t\t\tinitialView = getDefaultView( defaultViews, activeView ) ?? {\n\t\t\t\ttype: layout ?? LAYOUT_LIST,\n\t\t\t};\n\t\t}\n\n\t\tconst type = layout ?? initialView.type;\n\t\treturn {\n\t\t\t...initialView,\n\t\t\ttype,\n\t\t};\n\t} );\n\n\tconst setViewWithUrlUpdate = useCallback(\n\t\t( newView ) => {\n\t\t\tconst { params } = history.getLocationWithParams();\n\n\t\t\tif ( newView.type === LAYOUT_LIST && ! params?.layout ) {\n\t\t\t\t// Skip updating the layout URL param if\n\t\t\t\t// it is not present and the newView.type is LAYOUT_LIST.\n\t\t\t} else if ( newView.type !== params?.layout ) {\n\t\t\t\thistory.push( {\n\t\t\t\t\t...params,\n\t\t\t\t\tlayout: newView.type,\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tsetView( newView );\n\n\t\t\tif ( isCustom === 'true' && editedEntityRecord?.id ) {\n\t\t\t\teditEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'wp_dataviews',\n\t\t\t\t\teditedEntityRecord?.id,\n\t\t\t\t\t{\n\t\t\t\t\t\tcontent: JSON.stringify( newView ),\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\t[ history, isCustom, editEntityRecord, editedEntityRecord?.id ]\n\t);\n\n\t// When layout URL param changes, update the view type\n\t// without affecting any other config.\n\tuseEffect( () => {\n\t\tsetView( ( prevView ) => ( {\n\t\t\t...prevView,\n\t\t\ttype: layout ?? LAYOUT_LIST,\n\t\t} ) );\n\t}, [ layout ] );\n\n\t// When activeView or isCustom URL parameters change, reset the view.\n\tuseEffect( () => {\n\t\tlet newView;\n\t\tif ( isCustom === 'true' ) {\n\t\t\tnewView = getCustomView( editedEntityRecord );\n\t\t} else {\n\t\t\tnewView = getDefaultView( defaultViews, activeView );\n\t\t}\n\n\t\tif ( newView ) {\n\t\t\tconst type = layout ?? newView.type;\n\t\t\tsetView( {\n\t\t\t\t...newView,\n\t\t\t\ttype,\n\t\t\t} );\n\t\t}\n\t}, [ activeView, isCustom, layout, defaultViews, editedEntityRecord ] );\n\n\treturn [ view, setViewWithUrlUpdate, setViewWithUrlUpdate ];\n}\n\nconst DEFAULT_STATUSES = 'draft,future,pending,private,publish'; // All but 'trash'.\n\nfunction getItemId( item ) {\n\treturn item.id.toString();\n}\n\nexport default function PostList( { postType } ) {\n\tconst [ view, setView ] = useView( postType );\n\tconst defaultViews = useDefaultViews( { postType } );\n\tconst history = useHistory();\n\tconst location = useLocation();\n\tconst {\n\t\tpostId,\n\t\tquickEdit = false,\n\t\tisCustom,\n\t\tactiveView = 'all',\n\t} = location.params;\n\tconst [ selection, setSelection ] = useState( postId?.split( ',' ) ?? [] );\n\tconst onChangeSelection = useCallback(\n\t\t( items ) => {\n\t\t\tsetSelection( items );\n\t\t\tconst { params } = history.getLocationWithParams();\n\t\t\tif ( ( params.isCustom ?? 'false' ) === 'false' ) {\n\t\t\t\thistory.push( {\n\t\t\t\t\t...params,\n\t\t\t\t\tpostId: items.join( ',' ),\n\t\t\t\t} );\n\t\t\t}\n\t\t},\n\t\t[ history ]\n\t);\n\n\tconst getActiveViewFilters = ( views, match ) => {\n\t\tconst found = views.find( ( { slug } ) => slug === match );\n\t\treturn found?.filters ?? [];\n\t};\n\n\tconst { isLoading: isLoadingFields, fields: _fields } = usePostFields();\n\tconst fields = useMemo( () => {\n\t\tconst activeViewFilters = getActiveViewFilters(\n\t\t\tdefaultViews,\n\t\t\tactiveView\n\t\t).map( ( { field } ) => field );\n\t\treturn _fields.map( ( field ) => ( {\n\t\t\t...field,\n\t\t\telements: activeViewFilters.includes( field.id )\n\t\t\t\t? []\n\t\t\t\t: field.elements,\n\t\t} ) );\n\t}, [ _fields, defaultViews, activeView ] );\n\n\tconst queryArgs = useMemo( () => {\n\t\tconst filters = {};\n\t\tview.filters?.forEach( ( filter ) => {\n\t\t\tif (\n\t\t\t\tfilter.field === 'status' &&\n\t\t\t\tfilter.operator === OPERATOR_IS_ANY\n\t\t\t) {\n\t\t\t\tfilters.status = filter.value;\n\t\t\t}\n\t\t\tif (\n\t\t\t\tfilter.field === 'author' &&\n\t\t\t\tfilter.operator === OPERATOR_IS_ANY\n\t\t\t) {\n\t\t\t\tfilters.author = filter.value;\n\t\t\t} else if (\n\t\t\t\tfilter.field === 'author' &&\n\t\t\t\tfilter.operator === OPERATOR_IS_NONE\n\t\t\t) {\n\t\t\t\tfilters.author_exclude = filter.value;\n\t\t\t}\n\t\t} );\n\n\t\t// The bundled views want data filtered without displaying the filter.\n\t\tconst activeViewFilters = getActiveViewFilters(\n\t\t\tdefaultViews,\n\t\t\tactiveView\n\t\t);\n\t\tactiveViewFilters.forEach( ( filter ) => {\n\t\t\tif (\n\t\t\t\tfilter.field === 'status' &&\n\t\t\t\tfilter.operator === OPERATOR_IS_ANY\n\t\t\t) {\n\t\t\t\tfilters.status = filter.value;\n\t\t\t}\n\t\t\tif (\n\t\t\t\tfilter.field === 'author' &&\n\t\t\t\tfilter.operator === OPERATOR_IS_ANY\n\t\t\t) {\n\t\t\t\tfilters.author = filter.value;\n\t\t\t} else if (\n\t\t\t\tfilter.field === 'author' &&\n\t\t\t\tfilter.operator === OPERATOR_IS_NONE\n\t\t\t) {\n\t\t\t\tfilters.author_exclude = filter.value;\n\t\t\t}\n\t\t} );\n\n\t\t// We want to provide a different default item for the status filter\n\t\t// than the REST API provides.\n\t\tif ( ! filters.status || filters.status === '' ) {\n\t\t\tfilters.status = DEFAULT_STATUSES;\n\t\t}\n\n\t\treturn {\n\t\t\tper_page: view.perPage,\n\t\t\tpage: view.page,\n\t\t\t_embed: 'author',\n\t\t\torder: view.sort?.direction,\n\t\t\torderby: view.sort?.field,\n\t\t\tsearch: view.search,\n\t\t\t...filters,\n\t\t};\n\t}, [ view, activeView, defaultViews ] );\n\tconst {\n\t\trecords,\n\t\tisResolving: isLoadingData,\n\t\ttotalItems,\n\t\ttotalPages,\n\t} = useEntityRecordsWithPermissions( 'postType', postType, queryArgs );\n\n\t// The REST API sort the authors by ID, but we want to sort them by name.\n\tconst data = useMemo( () => {\n\t\tif ( ! isLoadingFields && view?.sort?.field === 'author' ) {\n\t\t\treturn filterSortAndPaginate(\n\t\t\t\trecords,\n\t\t\t\t{ sort: { ...view.sort } },\n\t\t\t\tfields\n\t\t\t).data;\n\t\t}\n\n\t\treturn records;\n\t}, [ records, fields, isLoadingFields, view?.sort ] );\n\n\tconst ids = data?.map( ( record ) => getItemId( record ) ) ?? [];\n\tconst prevIds = usePrevious( ids ) ?? [];\n\tconst deletedIds = prevIds.filter( ( id ) => ! ids.includes( id ) );\n\tconst postIdWasDeleted = deletedIds.includes( postId );\n\n\tuseEffect( () => {\n\t\tif ( postIdWasDeleted ) {\n\t\t\thistory.push( {\n\t\t\t\t...history.getLocationWithParams().params,\n\t\t\t\tpostId: undefined,\n\t\t\t} );\n\t\t}\n\t}, [ postIdWasDeleted, history ] );\n\n\tconst paginationInfo = useMemo(\n\t\t() => ( {\n\t\t\ttotalItems,\n\t\t\ttotalPages,\n\t\t} ),\n\t\t[ totalItems, totalPages ]\n\t);\n\n\tconst { labels, canCreateRecord } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getPostType, canUser } = select( coreStore );\n\t\t\treturn {\n\t\t\t\tlabels: getPostType( postType )?.labels,\n\t\t\t\tcanCreateRecord: canUser( 'create', {\n\t\t\t\t\tkind: 'postType',\n\t\t\t\t\tname: postType,\n\t\t\t\t} ),\n\t\t\t};\n\t\t},\n\t\t[ postType ]\n\t);\n\n\tconst postTypeActions = usePostActions( {\n\t\tpostType,\n\t\tcontext: 'list',\n\t} );\n\tconst editAction = useEditPostAction();\n\tconst actions = useMemo(\n\t\t() => [ editAction, ...postTypeActions ],\n\t\t[ postTypeActions, editAction ]\n\t);\n\n\tconst [ showAddPostModal, setShowAddPostModal ] = useState( false );\n\n\tconst openModal = () => setShowAddPostModal( true );\n\tconst closeModal = () => setShowAddPostModal( false );\n\tconst handleNewPage = ( { type, id } ) => {\n\t\thistory.push( {\n\t\t\tpostId: id,\n\t\t\tpostType: type,\n\t\t\tcanvas: 'edit',\n\t\t} );\n\t\tcloseModal();\n\t};\n\n\treturn (\n\t\t<Page\n\t\t\ttitle={ labels?.name }\n\t\t\tactions={\n\t\t\t\tlabels?.add_new_item &&\n\t\t\t\tcanCreateRecord && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\tonClick={ openModal }\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ labels.add_new_item }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t{ showAddPostModal && (\n\t\t\t\t\t\t\t<AddNewPostModal\n\t\t\t\t\t\t\t\tpostType={ postType }\n\t\t\t\t\t\t\t\tonSave={ handleNewPage }\n\t\t\t\t\t\t\t\tonClose={ closeModal }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t)\n\t\t\t}\n\t\t>\n\t\t\t<DataViews\n\t\t\t\tkey={ activeView + isCustom }\n\t\t\t\tpaginationInfo={ paginationInfo }\n\t\t\t\tfields={ fields }\n\t\t\t\tactions={ actions }\n\t\t\t\tdata={ data || EMPTY_ARRAY }\n\t\t\t\tisLoading={ isLoadingData || isLoadingFields }\n\t\t\t\tview={ view }\n\t\t\t\tonChangeView={ setView }\n\t\t\t\tselection={ selection }\n\t\t\t\tonChangeSelection={ onChangeSelection }\n\t\t\t\tisItemClickable={ ( item ) => item.status !== 'trash' }\n\t\t\t\tonClickItem={ ( { id } ) => {\n\t\t\t\t\thistory.push( {\n\t\t\t\t\t\tpostId: id,\n\t\t\t\t\t\tpostType,\n\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t\tgetItemId={ getItemId }\n\t\t\t\tdefaultLayouts={ defaultLayouts }\n\t\t\t\theader={\n\t\t\t\t\twindow.__experimentalQuickEditDataViews &&\n\t\t\t\t\tview.type !== LAYOUT_LIST &&\n\t\t\t\t\tpostType === 'page' && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\tisPressed={ quickEdit }\n\t\t\t\t\t\t\ticon={ drawerRight }\n\t\t\t\t\t\t\tlabel={ __( 'Details' ) }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\thistory.push( {\n\t\t\t\t\t\t\t\t\t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AAS,EAAGA,SAAW;MACvB/B,cAAc,EAAGA,4BAAgB;MACjCmI,MAAM,EACLC,MAAM,CAACC,gCAAgC,IACvC7I,IAAI,CAACS,IAAI,KAAKkB,sBAAW,IACzBhB,QAAQ,KAAK,MAAM,iBAClB,IAAA3B,WAAA,CAAA0I,GAAA,EAAC5J,WAAA,CAAAmK,MAAM;QACNa,IAAI,EAAC,SAAS;QACdC,SAAS,EAAG/F,SAAW;QACvBgG,IAAI,EAAGC,kBAAa;QACpBC,KAAK,EAAG,IAAAC,QAAE,EAAE,SAAU,CAAG;QACzBhB,OAAO,EAAGA,CAAA,KAAM;UACfrH,OAAO,CAACmB,IAAI,CAAE;YACb,GAAGa,QAAQ,CAAClC,MAAM;YAClBoC,SAAS,EAAEA,SAAS,GAAG5C,SAAS,GAAG;UACpC,CAAE,CAAC;QACJ;MAAG,CACH;IAEF,GArCKP,UAAU,GAAGgB,QAsCnB;EAAC,CACG,CAAC;AAET","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_components","require","_coreData","_element","_router","_data","_dataviews","_editor","_i18n","_icons","_compose","_url","_page","_interopRequireDefault","_defaultViews","_constants","_addNewPost","_lockUnlock","_dataviewsActions","_jsxRuntime","usePostActions","usePostFields","unlock","editorPrivateApis","useLocation","useHistory","routerPrivateApis","useEntityRecordsWithPermissions","coreDataPrivateApis","EMPTY_ARRAY","getDefaultView","defaultViews","activeView","find","slug","view","getCustomView","editedEntityRecord","content","undefined","JSON","parse","layout","defaultLayouts","type","useView","postType","path","query","isCustom","history","useDefaultViews","editEntityRecord","useDispatch","coreStore","useSelect","select","getEditedEntityRecord","Number","setView","useState","initialView","_getCustomView","LAYOUT_LIST","_getDefaultView","setViewWithUrlUpdate","useCallback","newView","navigate","addQueryArgs","id","stringify","useEffect","prevView","DEFAULT_STATUSES","getItemId","item","toString","PostList","_postId$split","_data$map","_usePrevious","location","postId","quickEdit","selection","setSelection","split","onChangeSelection","items","_location$query$isCus","join","getActiveViewFilters","views","match","_found$filters","found","filters","isLoading","isLoadingFields","fields","_fields","useMemo","activeViewFilters","map","field","elements","includes","queryArgs","forEach","filter","operator","OPERATOR_IS_ANY","status","value","author","OPERATOR_IS_NONE","author_exclude","per_page","perPage","page","_embed","order","sort","direction","orderby","search","records","isResolving","isLoadingData","totalItems","totalPages","data","filterSortAndPaginate","ids","record","prevIds","usePrevious","deletedIds","postIdWasDeleted","paginationInfo","labels","canCreateRecord","getPostType","canUser","kind","name","postTypeActions","context","editAction","useEditPostAction","actions","showAddPostModal","setShowAddPostModal","openModal","closeModal","handleNewPage","jsx","default","title","add_new_item","jsxs","Fragment","children","Button","variant","onClick","__next40pxDefaultSize","onSave","onClose","DataViews","onChangeView","isItemClickable","onClickItem","header","window","__experimentalQuickEditDataViews","size","isPressed","icon","drawerRight","label","__"],"sources":["@wordpress/edit-site/src/components/post-list/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport {\n\tstore as coreStore,\n\tprivateApis as coreDataPrivateApis,\n} from '@wordpress/core-data';\nimport { useState, useMemo, useCallback, useEffect } from '@wordpress/element';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { DataViews, filterSortAndPaginate } from '@wordpress/dataviews';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { __ } from '@wordpress/i18n';\nimport { drawerRight } from '@wordpress/icons';\nimport { usePrevious } from '@wordpress/compose';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport Page from '../page';\nimport {\n\tuseDefaultViews,\n\tdefaultLayouts,\n} from '../sidebar-dataviews/default-views';\nimport {\n\tOPERATOR_IS_ANY,\n\tOPERATOR_IS_NONE,\n\tLAYOUT_LIST,\n} from '../../utils/constants';\n\nimport AddNewPostModal from '../add-new-post';\nimport { unlock } from '../../lock-unlock';\nimport { useEditPostAction } from '../dataviews-actions';\n\nconst { usePostActions, usePostFields } = unlock( editorPrivateApis );\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\nconst { useEntityRecordsWithPermissions } = unlock( coreDataPrivateApis );\nconst EMPTY_ARRAY = [];\n\nconst getDefaultView = ( defaultViews, activeView ) => {\n\treturn defaultViews.find( ( { slug } ) => slug === activeView )?.view;\n};\n\nconst getCustomView = ( editedEntityRecord ) => {\n\tif ( ! editedEntityRecord?.content ) {\n\t\treturn undefined;\n\t}\n\n\tconst content = JSON.parse( editedEntityRecord.content );\n\tif ( ! content ) {\n\t\treturn undefined;\n\t}\n\n\treturn {\n\t\t...content,\n\t\tlayout: defaultLayouts[ content.type ]?.layout,\n\t};\n};\n\n/**\n * This function abstracts working with default & custom views by\n * providing a [ state, setState ] tuple based on the URL parameters.\n *\n * Consumers use the provided tuple to work with state\n * and don't have to deal with the specifics of default & custom views.\n *\n * @param {string} postType Post type to retrieve default views for.\n * @return {Array} The [ state, setState ] tuple.\n */\nfunction useView( postType ) {\n\tconst {\n\t\tpath,\n\t\tquery: { activeView = 'all', isCustom = 'false', layout },\n\t} = useLocation();\n\tconst history = useHistory();\n\n\tconst defaultViews = useDefaultViews( { postType } );\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\tconst editedEntityRecord = useSelect(\n\t\t( select ) => {\n\t\t\tif ( isCustom !== 'true' ) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst { getEditedEntityRecord } = select( coreStore );\n\t\t\treturn getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t'wp_dataviews',\n\t\t\t\tNumber( activeView )\n\t\t\t);\n\t\t},\n\t\t[ activeView, isCustom ]\n\t);\n\tconst [ view, setView ] = useState( () => {\n\t\tlet initialView;\n\t\tif ( isCustom === 'true' ) {\n\t\t\tinitialView = getCustomView( editedEntityRecord ) ?? {\n\t\t\t\ttype: layout ?? LAYOUT_LIST,\n\t\t\t};\n\t\t} else {\n\t\t\tinitialView = getDefaultView( defaultViews, activeView ) ?? {\n\t\t\t\ttype: layout ?? LAYOUT_LIST,\n\t\t\t};\n\t\t}\n\n\t\tconst type = layout ?? initialView.type;\n\t\treturn {\n\t\t\t...initialView,\n\t\t\ttype,\n\t\t};\n\t} );\n\n\tconst setViewWithUrlUpdate = useCallback(\n\t\t( newView ) => {\n\t\t\tif ( newView.type === LAYOUT_LIST && ! layout ) {\n\t\t\t\t// Skip updating the layout URL param if\n\t\t\t\t// it is not present and the newView.type is LAYOUT_LIST.\n\t\t\t} else if ( newView.type !== layout ) {\n\t\t\t\thistory.navigate(\n\t\t\t\t\taddQueryArgs( path, {\n\t\t\t\t\t\tlayout: newView.type,\n\t\t\t\t\t} )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tsetView( newView );\n\n\t\t\tif ( isCustom === 'true' && editedEntityRecord?.id ) {\n\t\t\t\teditEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'wp_dataviews',\n\t\t\t\t\teditedEntityRecord?.id,\n\t\t\t\t\t{\n\t\t\t\t\t\tcontent: JSON.stringify( newView ),\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\t[\n\t\t\thistory,\n\t\t\tisCustom,\n\t\t\teditEntityRecord,\n\t\t\teditedEntityRecord?.id,\n\t\t\tlayout,\n\t\t\tpath,\n\t\t]\n\t);\n\n\t// When layout URL param changes, update the view type\n\t// without affecting any other config.\n\tuseEffect( () => {\n\t\tsetView( ( prevView ) => ( {\n\t\t\t...prevView,\n\t\t\ttype: layout ?? LAYOUT_LIST,\n\t\t} ) );\n\t}, [ layout ] );\n\n\t// When activeView or isCustom URL parameters change, reset the view.\n\tuseEffect( () => {\n\t\tlet newView;\n\t\tif ( isCustom === 'true' ) {\n\t\t\tnewView = getCustomView( editedEntityRecord );\n\t\t} else {\n\t\t\tnewView = getDefaultView( defaultViews, activeView );\n\t\t}\n\n\t\tif ( newView ) {\n\t\t\tconst type = layout ?? newView.type;\n\t\t\tsetView( {\n\t\t\t\t...newView,\n\t\t\t\ttype,\n\t\t\t} );\n\t\t}\n\t}, [ activeView, isCustom, layout, defaultViews, editedEntityRecord ] );\n\n\treturn [ view, setViewWithUrlUpdate, setViewWithUrlUpdate ];\n}\n\nconst DEFAULT_STATUSES = 'draft,future,pending,private,publish'; // All but 'trash'.\n\nfunction getItemId( item ) {\n\treturn item.id.toString();\n}\n\nexport default function PostList( { postType } ) {\n\tconst [ view, setView ] = useView( postType );\n\tconst defaultViews = useDefaultViews( { postType } );\n\tconst history = useHistory();\n\tconst location = useLocation();\n\tconst {\n\t\tpostId,\n\t\tquickEdit = false,\n\t\tisCustom,\n\t\tactiveView = 'all',\n\t} = location.query;\n\tconst [ selection, setSelection ] = useState( postId?.split( ',' ) ?? [] );\n\tconst onChangeSelection = useCallback(\n\t\t( items ) => {\n\t\t\tsetSelection( items );\n\t\t\tif ( ( location.query.isCustom ?? 'false' ) === 'false' ) {\n\t\t\t\thistory.navigate(\n\t\t\t\t\taddQueryArgs( location.path, {\n\t\t\t\t\t\tpostId: items.join( ',' ),\n\t\t\t\t\t} )\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\t[ location.path, location.query.isCustom, history ]\n\t);\n\n\tconst getActiveViewFilters = ( views, match ) => {\n\t\tconst found = views.find( ( { slug } ) => slug === match );\n\t\treturn found?.filters ?? [];\n\t};\n\n\tconst { isLoading: isLoadingFields, fields: _fields } = usePostFields( {\n\t\tpostType,\n\t} );\n\tconst fields = useMemo( () => {\n\t\tconst activeViewFilters = getActiveViewFilters(\n\t\t\tdefaultViews,\n\t\t\tactiveView\n\t\t).map( ( { field } ) => field );\n\t\treturn _fields.map( ( field ) => ( {\n\t\t\t...field,\n\t\t\telements: activeViewFilters.includes( field.id )\n\t\t\t\t? []\n\t\t\t\t: field.elements,\n\t\t} ) );\n\t}, [ _fields, defaultViews, activeView ] );\n\n\tconst queryArgs = useMemo( () => {\n\t\tconst filters = {};\n\t\tview.filters?.forEach( ( filter ) => {\n\t\t\tif (\n\t\t\t\tfilter.field === 'status' &&\n\t\t\t\tfilter.operator === OPERATOR_IS_ANY\n\t\t\t) {\n\t\t\t\tfilters.status = filter.value;\n\t\t\t}\n\t\t\tif (\n\t\t\t\tfilter.field === 'author' &&\n\t\t\t\tfilter.operator === OPERATOR_IS_ANY\n\t\t\t) {\n\t\t\t\tfilters.author = filter.value;\n\t\t\t} else if (\n\t\t\t\tfilter.field === 'author' &&\n\t\t\t\tfilter.operator === OPERATOR_IS_NONE\n\t\t\t) {\n\t\t\t\tfilters.author_exclude = filter.value;\n\t\t\t}\n\t\t} );\n\n\t\t// The bundled views want data filtered without displaying the filter.\n\t\tconst activeViewFilters = getActiveViewFilters(\n\t\t\tdefaultViews,\n\t\t\tactiveView\n\t\t);\n\t\tactiveViewFilters.forEach( ( filter ) => {\n\t\t\tif (\n\t\t\t\tfilter.field === 'status' &&\n\t\t\t\tfilter.operator === OPERATOR_IS_ANY\n\t\t\t) {\n\t\t\t\tfilters.status = filter.value;\n\t\t\t}\n\t\t\tif (\n\t\t\t\tfilter.field === 'author' &&\n\t\t\t\tfilter.operator === OPERATOR_IS_ANY\n\t\t\t) {\n\t\t\t\tfilters.author = filter.value;\n\t\t\t} else if (\n\t\t\t\tfilter.field === 'author' &&\n\t\t\t\tfilter.operator === OPERATOR_IS_NONE\n\t\t\t) {\n\t\t\t\tfilters.author_exclude = filter.value;\n\t\t\t}\n\t\t} );\n\n\t\t// We want to provide a different default item for the status filter\n\t\t// than the REST API provides.\n\t\tif ( ! filters.status || filters.status === '' ) {\n\t\t\tfilters.status = DEFAULT_STATUSES;\n\t\t}\n\n\t\treturn {\n\t\t\tper_page: view.perPage,\n\t\t\tpage: view.page,\n\t\t\t_embed: 'author',\n\t\t\torder: view.sort?.direction,\n\t\t\torderby: view.sort?.field,\n\t\t\tsearch: view.search,\n\t\t\t...filters,\n\t\t};\n\t}, [ view, activeView, defaultViews ] );\n\tconst {\n\t\trecords,\n\t\tisResolving: isLoadingData,\n\t\ttotalItems,\n\t\ttotalPages,\n\t} = useEntityRecordsWithPermissions( 'postType', postType, queryArgs );\n\n\t// The REST API sort the authors by ID, but we want to sort them by name.\n\tconst data = useMemo( () => {\n\t\tif ( ! isLoadingFields && view?.sort?.field === 'author' ) {\n\t\t\treturn filterSortAndPaginate(\n\t\t\t\trecords,\n\t\t\t\t{ sort: { ...view.sort } },\n\t\t\t\tfields\n\t\t\t).data;\n\t\t}\n\n\t\treturn records;\n\t}, [ records, fields, isLoadingFields, view?.sort ] );\n\n\tconst ids = data?.map( ( record ) => getItemId( record ) ) ?? [];\n\tconst prevIds = usePrevious( ids ) ?? [];\n\tconst deletedIds = prevIds.filter( ( id ) => ! ids.includes( id ) );\n\tconst postIdWasDeleted = deletedIds.includes( postId );\n\n\tuseEffect( () => {\n\t\tif ( postIdWasDeleted ) {\n\t\t\thistory.navigate(\n\t\t\t\taddQueryArgs( location.path, {\n\t\t\t\t\tpostId: undefined,\n\t\t\t\t} )\n\t\t\t);\n\t\t}\n\t}, [ history, postIdWasDeleted, location.path ] );\n\n\tconst paginationInfo = useMemo(\n\t\t() => ( {\n\t\t\ttotalItems,\n\t\t\ttotalPages,\n\t\t} ),\n\t\t[ totalItems, totalPages ]\n\t);\n\n\tconst { labels, canCreateRecord } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getPostType, canUser } = select( coreStore );\n\t\t\treturn {\n\t\t\t\tlabels: getPostType( postType )?.labels,\n\t\t\t\tcanCreateRecord: canUser( 'create', {\n\t\t\t\t\tkind: 'postType',\n\t\t\t\t\tname: postType,\n\t\t\t\t} ),\n\t\t\t};\n\t\t},\n\t\t[ postType ]\n\t);\n\n\tconst postTypeActions = usePostActions( {\n\t\tpostType,\n\t\tcontext: 'list',\n\t} );\n\tconst editAction = useEditPostAction();\n\tconst actions = useMemo(\n\t\t() => [ editAction, ...postTypeActions ],\n\t\t[ postTypeActions, editAction ]\n\t);\n\n\tconst [ showAddPostModal, setShowAddPostModal ] = useState( false );\n\n\tconst openModal = () => setShowAddPostModal( true );\n\tconst closeModal = () => setShowAddPostModal( false );\n\tconst handleNewPage = ( { type, id } ) => {\n\t\thistory.navigate( `/${ type }/${ id }?canvas=edit` );\n\t\tcloseModal();\n\t};\n\n\treturn (\n\t\t<Page\n\t\t\ttitle={ labels?.name }\n\t\t\tactions={\n\t\t\t\tlabels?.add_new_item &&\n\t\t\t\tcanCreateRecord && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\tonClick={ openModal }\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ labels.add_new_item }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t{ showAddPostModal && (\n\t\t\t\t\t\t\t<AddNewPostModal\n\t\t\t\t\t\t\t\tpostType={ postType }\n\t\t\t\t\t\t\t\tonSave={ handleNewPage }\n\t\t\t\t\t\t\t\tonClose={ closeModal }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t)\n\t\t\t}\n\t\t>\n\t\t\t<DataViews\n\t\t\t\tkey={ activeView + isCustom }\n\t\t\t\tpaginationInfo={ paginationInfo }\n\t\t\t\tfields={ fields }\n\t\t\t\tactions={ actions }\n\t\t\t\tdata={ data || EMPTY_ARRAY }\n\t\t\t\tisLoading={ isLoadingData || isLoadingFields }\n\t\t\t\tview={ view }\n\t\t\t\tonChangeView={ setView }\n\t\t\t\tselection={ selection }\n\t\t\t\tonChangeSelection={ onChangeSelection }\n\t\t\t\tisItemClickable={ ( item ) => item.status !== 'trash' }\n\t\t\t\tonClickItem={ ( { id } ) => {\n\t\t\t\t\thistory.navigate( `/${ postType }/${ id }?canvas=edit` );\n\t\t\t\t} }\n\t\t\t\tgetItemId={ getItemId }\n\t\t\t\tdefaultLayouts={ defaultLayouts }\n\t\t\t\theader={\n\t\t\t\t\twindow.__experimentalQuickEditDataViews &&\n\t\t\t\t\tview.type !== LAYOUT_LIST &&\n\t\t\t\t\tpostType === 'page' && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\tisPressed={ quickEdit }\n\t\t\t\t\t\t\ticon={ drawerRight }\n\t\t\t\t\t\t\tlabel={ __( 'Details' ) }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\thistory.navigate(\n\t\t\t\t\t\t\t\t\taddQueryArgs( location.path, {\n\t\t\t\t\t\t\t\t\t\tquickEdit: quickEdit ? undefined : true,\n\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t/>\n\t\t</Page>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAIA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,QAAA,GAAAT,OAAA;AACA,IAAAU,IAAA,GAAAV,OAAA;AAKA,IAAAW,KAAA,GAAAC,sBAAA,CAAAZ,OAAA;AACA,IAAAa,aAAA,GAAAb,OAAA;AAIA,IAAAc,UAAA,GAAAd,OAAA;AAMA,IAAAe,WAAA,GAAAH,sBAAA,CAAAZ,OAAA;AACA,IAAAgB,WAAA,GAAAhB,OAAA;AACA,IAAAiB,iBAAA,GAAAjB,OAAA;AAAyD,IAAAkB,WAAA,GAAAlB,OAAA;AAlCzD;AACA;AACA;;AAgBA;AACA;AACA;;AAgBA,MAAM;EAAEmB,cAAc;EAAEC;AAAc,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;A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