@wordpress/edit-site 5.24.0 → 5.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/components/add-new-template/add-custom-template-modal-content.js +2 -3
- package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
- package/build/components/block-editor/editor-canvas.js +48 -23
- package/build/components/block-editor/editor-canvas.js.map +1 -1
- package/build/components/block-editor/site-editor-canvas.js +5 -54
- package/build/components/block-editor/site-editor-canvas.js.map +1 -1
- package/build/components/block-editor/use-site-editor-settings.js +14 -5
- package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build/components/editor/index.js +6 -17
- package/build/components/editor/index.js.map +1 -1
- package/build/components/global-styles/font-library-modal/collection-font-variant.js +8 -7
- package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
- package/build/components/global-styles/font-library-modal/context.js +1 -1
- package/build/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build/components/global-styles/font-library-modal/library-font-variant.js +8 -7
- package/build/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
- package/build/components/global-styles/screen-revisions/get-revision-changes.js +146 -0
- package/build/components/global-styles/screen-revisions/get-revision-changes.js.map +1 -0
- package/build/components/global-styles/screen-revisions/index.js +6 -10
- package/build/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js +63 -13
- package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build/components/header-edit-mode/document-tools/index.js +17 -10
- package/build/components/header-edit-mode/document-tools/index.js.map +1 -1
- package/build/components/header-edit-mode/index.js +16 -38
- package/build/components/header-edit-mode/index.js.map +1 -1
- package/build/components/header-edit-mode/more-menu/index.js +11 -9
- package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
- package/build/components/layout/index.js +9 -8
- package/build/components/layout/index.js.map +1 -1
- package/build/components/page/header.js +2 -1
- package/build/components/page/header.js.map +1 -1
- package/build/components/page-pages/index.js +31 -28
- package/build/components/page-pages/index.js.map +1 -1
- package/build/components/page-patterns/patterns-list.js +1 -2
- package/build/components/page-patterns/patterns-list.js.map +1 -1
- package/build/components/page-patterns/rename-menu-item.js +3 -0
- package/build/components/page-patterns/rename-menu-item.js.map +1 -1
- package/build/components/page-templates/dataviews-templates.js +18 -17
- package/build/components/page-templates/dataviews-templates.js.map +1 -1
- package/build/components/preferences-modal/index.js +36 -20
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/routes/use-title.js +3 -4
- package/build/components/routes/use-title.js.map +1 -1
- package/build/components/save-button/index.js +2 -1
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/sidebar/index.js +26 -12
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-dataviews/dataview-item.js +2 -10
- package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build/components/sidebar-dataviews/default-views.js +2 -2
- package/build/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/index.js +9 -3
- package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/page-summary.js +1 -2
- package/build/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +3 -0
- package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
- package/build/components/sidebar-navigation-screen-template/home-template-details.js +3 -89
- package/build/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -1
- package/build/components/sidebar-navigation-screen-template/index.js +2 -1
- package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-template/template-areas.js +117 -0
- package/build/components/sidebar-navigation-screen-template/template-areas.js.map +1 -0
- package/build/components/site-hub/index.js +6 -3
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/template-actions/rename-menu-item.js +3 -0
- package/build/components/template-actions/rename-menu-item.js.map +1 -1
- package/build/components/welcome-guide/styles.js +1 -1
- package/build/components/welcome-guide/styles.js.map +1 -1
- package/build/hooks/commands/use-common-commands.js +9 -1
- package/build/hooks/commands/use-common-commands.js.map +1 -1
- package/build/hooks/navigation-menu-edit.js +1 -1
- package/build/hooks/navigation-menu-edit.js.map +1 -1
- package/build/hooks/template-part-edit.js +1 -1
- package/build/hooks/template-part-edit.js.map +1 -1
- package/build/store/actions.js +15 -8
- package/build/store/actions.js.map +1 -1
- package/build/store/reducer.js +0 -18
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +12 -6
- package/build/store/selectors.js.map +1 -1
- package/build/utils/constants.js +15 -1
- package/build/utils/constants.js.map +1 -1
- package/build-module/components/add-new-template/add-custom-template-modal-content.js +1 -1
- package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
- package/build-module/components/block-editor/editor-canvas.js +50 -25
- package/build-module/components/block-editor/editor-canvas.js.map +1 -1
- package/build-module/components/block-editor/site-editor-canvas.js +8 -56
- package/build-module/components/block-editor/site-editor-canvas.js.map +1 -1
- package/build-module/components/block-editor/use-site-editor-settings.js +14 -5
- package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build-module/components/editor/index.js +9 -20
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/collection-font-variant.js +9 -7
- package/build-module/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/context.js +1 -1
- package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/library-font-variant.js +9 -7
- package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/get-revision-changes.js +139 -0
- package/build-module/components/global-styles/screen-revisions/get-revision-changes.js.map +1 -0
- package/build-module/components/global-styles/screen-revisions/index.js +7 -11
- package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +64 -14
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build-module/components/header-edit-mode/document-tools/index.js +17 -10
- package/build-module/components/header-edit-mode/document-tools/index.js.map +1 -1
- package/build-module/components/header-edit-mode/index.js +20 -42
- package/build-module/components/header-edit-mode/index.js.map +1 -1
- package/build-module/components/header-edit-mode/more-menu/index.js +12 -10
- package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
- package/build-module/components/layout/index.js +9 -8
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/page/header.js +2 -1
- package/build-module/components/page/header.js.map +1 -1
- package/build-module/components/page-pages/index.js +31 -28
- package/build-module/components/page-pages/index.js.map +1 -1
- package/build-module/components/page-patterns/patterns-list.js +1 -2
- package/build-module/components/page-patterns/patterns-list.js.map +1 -1
- package/build-module/components/page-patterns/rename-menu-item.js +3 -0
- package/build-module/components/page-patterns/rename-menu-item.js.map +1 -1
- package/build-module/components/page-templates/dataviews-templates.js +18 -17
- package/build-module/components/page-templates/dataviews-templates.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +37 -21
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/routes/use-title.js +3 -4
- package/build-module/components/routes/use-title.js.map +1 -1
- package/build-module/components/save-button/index.js +2 -1
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +26 -12
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-dataviews/dataview-item.js +2 -10
- package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build-module/components/sidebar-dataviews/default-views.js +2 -2
- package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/index.js +9 -3
- package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js +2 -3
- package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +3 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-template/home-template-details.js +5 -90
- package/build-module/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-template/index.js +2 -1
- package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-template/template-areas.js +109 -0
- package/build-module/components/sidebar-navigation-screen-template/template-areas.js.map +1 -0
- package/build-module/components/site-hub/index.js +6 -3
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/template-actions/rename-menu-item.js +3 -0
- package/build-module/components/template-actions/rename-menu-item.js.map +1 -1
- package/build-module/components/welcome-guide/styles.js +1 -1
- package/build-module/components/welcome-guide/styles.js.map +1 -1
- package/build-module/hooks/commands/use-common-commands.js +9 -1
- package/build-module/hooks/commands/use-common-commands.js.map +1 -1
- package/build-module/hooks/navigation-menu-edit.js +1 -1
- package/build-module/hooks/navigation-menu-edit.js.map +1 -1
- package/build-module/hooks/template-part-edit.js +1 -1
- package/build-module/hooks/template-part-edit.js.map +1 -1
- package/build-module/store/actions.js +13 -6
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/reducer.js +0 -17
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +10 -3
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/constants.js +8 -0
- package/build-module/utils/constants.js.map +1 -1
- package/build-style/style-rtl.css +302 -354
- package/build-style/style.css +302 -354
- package/package.json +42 -42
- package/src/components/add-new-template/add-custom-template-modal-content.js +1 -1
- package/src/components/block-editor/editor-canvas.js +63 -47
- package/src/components/block-editor/site-editor-canvas.js +32 -96
- package/src/components/block-editor/style.scss +6 -12
- package/src/components/block-editor/use-site-editor-settings.js +47 -36
- package/src/components/editor/index.js +10 -16
- package/src/components/global-styles/font-library-modal/collection-font-variant.js +12 -6
- package/src/components/global-styles/font-library-modal/context.js +1 -1
- package/src/components/global-styles/font-library-modal/library-font-variant.js +12 -6
- package/src/components/global-styles/screen-revisions/get-revision-changes.js +171 -0
- package/src/components/global-styles/screen-revisions/index.js +4 -11
- package/src/components/global-styles/screen-revisions/revisions-buttons.js +86 -17
- package/src/components/global-styles/screen-revisions/style.scss +10 -2
- package/src/components/global-styles/screen-revisions/test/get-revision-changes.js +191 -0
- package/src/components/header-edit-mode/document-tools/index.js +13 -13
- package/src/components/header-edit-mode/index.js +29 -63
- package/src/components/header-edit-mode/more-menu/index.js +18 -22
- package/src/components/header-edit-mode/style.scss +58 -33
- package/src/components/layout/index.js +21 -20
- package/src/components/list/style.scss +5 -0
- package/src/components/page/header.js +2 -1
- package/src/components/page/style.scss +2 -2
- package/src/components/page-pages/index.js +59 -35
- package/src/components/page-pages/style.scss +3 -1
- package/src/components/page-patterns/patterns-list.js +5 -2
- package/src/components/page-patterns/rename-menu-item.js +7 -1
- package/src/components/page-templates/dataviews-templates.js +28 -13
- package/src/components/preferences-modal/index.js +59 -33
- package/src/components/routes/use-title.js +3 -10
- package/src/components/save-button/index.js +1 -0
- package/src/components/sidebar/index.js +41 -24
- package/src/components/sidebar/style.scss +10 -12
- package/src/components/sidebar-dataviews/dataview-item.js +3 -7
- package/src/components/sidebar-dataviews/default-views.js +2 -2
- package/src/components/sidebar-edit-mode/page-panels/index.js +39 -25
- package/src/components/sidebar-edit-mode/page-panels/page-summary.js +2 -2
- package/src/components/sidebar-edit-mode/page-panels/style.scss +1 -42
- package/src/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +7 -1
- package/src/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +1 -1
- package/src/components/sidebar-navigation-screen-template/home-template-details.js +1 -96
- package/src/components/sidebar-navigation-screen-template/index.js +8 -2
- package/src/components/sidebar-navigation-screen-template/template-areas.js +135 -0
- package/src/components/site-hub/index.js +4 -5
- package/src/components/template-actions/rename-menu-item.js +7 -1
- package/src/components/welcome-guide/styles.js +1 -1
- package/src/hooks/commands/use-common-commands.js +10 -5
- package/src/hooks/navigation-menu-edit.js +1 -1
- package/src/hooks/template-part-edit.js +1 -1
- package/src/store/actions.js +15 -5
- package/src/store/reducer.js +0 -18
- package/src/store/selectors.js +15 -3
- package/src/style.scss +1 -2
- package/src/utils/constants.js +8 -0
- package/build/components/dataviews/add-filter.js +0 -91
- package/build/components/dataviews/add-filter.js.map +0 -1
- package/build/components/dataviews/constants.js +0 -14
- package/build/components/dataviews/constants.js.map +0 -1
- package/build/components/dataviews/dataviews.js +0 -99
- package/build/components/dataviews/dataviews.js.map +0 -1
- package/build/components/dataviews/filter-summary.js +0 -62
- package/build/components/dataviews/filter-summary.js.map +0 -1
- package/build/components/dataviews/filters.js +0 -63
- package/build/components/dataviews/filters.js.map +0 -1
- package/build/components/dataviews/index.js +0 -21
- package/build/components/dataviews/index.js.map +0 -1
- package/build/components/dataviews/item-actions.js +0 -184
- package/build/components/dataviews/item-actions.js.map +0 -1
- package/build/components/dataviews/pagination.js +0 -123
- package/build/components/dataviews/pagination.js.map +0 -1
- package/build/components/dataviews/reset-filters.js +0 -33
- package/build/components/dataviews/reset-filters.js.map +0 -1
- package/build/components/dataviews/search.js +0 -51
- package/build/components/dataviews/search.js.map +0 -1
- package/build/components/dataviews/view-actions.js +0 -244
- package/build/components/dataviews/view-actions.js.map +0 -1
- package/build/components/dataviews/view-grid.js +0 -82
- package/build/components/dataviews/view-grid.js.map +0 -1
- package/build/components/dataviews/view-list.js +0 -399
- package/build/components/dataviews/view-list.js.map +0 -1
- package/build/components/dataviews/view-side-by-side.js +0 -20
- package/build/components/dataviews/view-side-by-side.js.map +0 -1
- package/build/components/header-edit-mode/document-actions/index.js +0 -172
- package/build/components/header-edit-mode/document-actions/index.js.map +0 -1
- package/build/components/page-content-focus-notifications/back-to-page-notification.js +0 -61
- package/build/components/page-content-focus-notifications/back-to-page-notification.js.map +0 -1
- package/build/components/page-content-focus-notifications/edit-template-notification.js +0 -102
- package/build/components/page-content-focus-notifications/edit-template-notification.js.map +0 -1
- package/build/components/page-content-focus-notifications/index.js +0 -22
- package/build/components/page-content-focus-notifications/index.js.map +0 -1
- package/build/components/sidebar-edit-mode/page-panels/edit-template.js +0 -101
- package/build/components/sidebar-edit-mode/page-panels/edit-template.js.map +0 -1
- package/build/components/sidebar-edit-mode/page-panels/hooks.js +0 -79
- package/build/components/sidebar-edit-mode/page-panels/hooks.js.map +0 -1
- package/build/components/sidebar-edit-mode/page-panels/reset-default-template.js +0 -48
- package/build/components/sidebar-edit-mode/page-panels/reset-default-template.js.map +0 -1
- package/build/components/sidebar-edit-mode/page-panels/swap-template-button.js +0 -84
- package/build/components/sidebar-edit-mode/page-panels/swap-template-button.js.map +0 -1
- package/build/utils/use-debounced-input.js +0 -22
- package/build/utils/use-debounced-input.js.map +0 -1
- package/build-module/components/dataviews/add-filter.js +0 -84
- package/build-module/components/dataviews/add-filter.js.map +0 -1
- package/build-module/components/dataviews/constants.js +0 -6
- package/build-module/components/dataviews/constants.js.map +0 -1
- package/build-module/components/dataviews/dataviews.js +0 -90
- package/build-module/components/dataviews/dataviews.js.map +0 -1
- package/build-module/components/dataviews/filter-summary.js +0 -55
- package/build-module/components/dataviews/filter-summary.js.map +0 -1
- package/build-module/components/dataviews/filters.js +0 -55
- package/build-module/components/dataviews/filters.js.map +0 -1
- package/build-module/components/dataviews/index.js +0 -2
- package/build-module/components/dataviews/index.js.map +0 -1
- package/build-module/components/dataviews/item-actions.js +0 -177
- package/build-module/components/dataviews/item-actions.js.map +0 -1
- package/build-module/components/dataviews/pagination.js +0 -115
- package/build-module/components/dataviews/pagination.js.map +0 -1
- package/build-module/components/dataviews/reset-filters.js +0 -26
- package/build-module/components/dataviews/reset-filters.js.map +0 -1
- package/build-module/components/dataviews/search.js +0 -43
- package/build-module/components/dataviews/search.js.map +0 -1
- package/build-module/components/dataviews/view-actions.js +0 -237
- package/build-module/components/dataviews/view-actions.js.map +0 -1
- package/build-module/components/dataviews/view-grid.js +0 -74
- package/build-module/components/dataviews/view-grid.js.map +0 -1
- package/build-module/components/dataviews/view-list.js +0 -390
- package/build-module/components/dataviews/view-list.js.map +0 -1
- package/build-module/components/dataviews/view-side-by-side.js +0 -12
- package/build-module/components/dataviews/view-side-by-side.js.map +0 -1
- package/build-module/components/header-edit-mode/document-actions/index.js +0 -164
- package/build-module/components/header-edit-mode/document-actions/index.js.map +0 -1
- package/build-module/components/page-content-focus-notifications/back-to-page-notification.js +0 -54
- package/build-module/components/page-content-focus-notifications/back-to-page-notification.js.map +0 -1
- package/build-module/components/page-content-focus-notifications/edit-template-notification.js +0 -96
- package/build-module/components/page-content-focus-notifications/edit-template-notification.js.map +0 -1
- package/build-module/components/page-content-focus-notifications/index.js +0 -14
- package/build-module/components/page-content-focus-notifications/index.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/page-panels/edit-template.js +0 -93
- package/build-module/components/sidebar-edit-mode/page-panels/edit-template.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/page-panels/hooks.js +0 -69
- package/build-module/components/sidebar-edit-mode/page-panels/hooks.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/page-panels/reset-default-template.js +0 -41
- package/build-module/components/sidebar-edit-mode/page-panels/reset-default-template.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/page-panels/swap-template-button.js +0 -77
- package/build-module/components/sidebar-edit-mode/page-panels/swap-template-button.js.map +0 -1
- package/build-module/utils/use-debounced-input.js +0 -15
- package/build-module/utils/use-debounced-input.js.map +0 -1
- package/src/components/dataviews/README.md +0 -191
- package/src/components/dataviews/add-filter.js +0 -108
- package/src/components/dataviews/constants.js +0 -5
- package/src/components/dataviews/dataviews.js +0 -99
- package/src/components/dataviews/filter-summary.js +0 -79
- package/src/components/dataviews/filters.js +0 -65
- package/src/components/dataviews/index.js +0 -1
- package/src/components/dataviews/item-actions.js +0 -208
- package/src/components/dataviews/pagination.js +0 -144
- package/src/components/dataviews/reset-filters.js +0 -26
- package/src/components/dataviews/search.js +0 -42
- package/src/components/dataviews/style.scss +0 -131
- package/src/components/dataviews/view-actions.js +0 -319
- package/src/components/dataviews/view-grid.js +0 -90
- package/src/components/dataviews/view-list.js +0 -512
- package/src/components/dataviews/view-side-by-side.js +0 -9
- package/src/components/header-edit-mode/document-actions/index.js +0 -204
- package/src/components/header-edit-mode/document-actions/style.scss +0 -145
- package/src/components/page-content-focus-notifications/back-to-page-notification.js +0 -58
- package/src/components/page-content-focus-notifications/edit-template-notification.js +0 -104
- package/src/components/page-content-focus-notifications/index.js +0 -14
- package/src/components/sidebar-edit-mode/page-panels/edit-template.js +0 -108
- package/src/components/sidebar-edit-mode/page-panels/hooks.js +0 -99
- package/src/components/sidebar-edit-mode/page-panels/reset-default-template.js +0 -45
- package/src/components/sidebar-edit-mode/page-panels/swap-template-button.js +0 -83
- package/src/utils/use-debounced-input.js +0 -18
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import {
|
|
5
|
-
Button,
|
|
6
|
-
Modal,
|
|
7
|
-
__experimentalHStack as HStack,
|
|
8
|
-
privateApis as componentsPrivateApis,
|
|
9
|
-
} from '@wordpress/components';
|
|
10
|
-
import { __ } from '@wordpress/i18n';
|
|
11
|
-
import { useMemo, useState } from '@wordpress/element';
|
|
12
|
-
import { moreVertical } from '@wordpress/icons';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Internal dependencies
|
|
16
|
-
*/
|
|
17
|
-
import { unlock } from '../../lock-unlock';
|
|
18
|
-
|
|
19
|
-
const {
|
|
20
|
-
DropdownMenuV2Ariakit: DropdownMenu,
|
|
21
|
-
DropdownMenuGroupV2Ariakit: DropdownMenuGroup,
|
|
22
|
-
DropdownMenuItemV2Ariakit: DropdownMenuItem,
|
|
23
|
-
DropdownMenuItemLabelV2Ariakit: DropdownMenuItemLabel,
|
|
24
|
-
} = unlock( componentsPrivateApis );
|
|
25
|
-
|
|
26
|
-
function ButtonTrigger( { action, onClick } ) {
|
|
27
|
-
return (
|
|
28
|
-
<Button
|
|
29
|
-
label={ action.label }
|
|
30
|
-
icon={ action.icon }
|
|
31
|
-
isDestructive={ action.isDestructive }
|
|
32
|
-
size="compact"
|
|
33
|
-
onClick={ onClick }
|
|
34
|
-
/>
|
|
35
|
-
);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function DropdownMenuItemTrigger( { action, onClick } ) {
|
|
39
|
-
return (
|
|
40
|
-
<DropdownMenuItem onClick={ onClick }>
|
|
41
|
-
<DropdownMenuItemLabel>{ action.label }</DropdownMenuItemLabel>
|
|
42
|
-
</DropdownMenuItem>
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
function ActionWithModal( { action, item, ActionTrigger } ) {
|
|
47
|
-
const [ isModalOpen, setIsModalOpen ] = useState( false );
|
|
48
|
-
const actionTriggerProps = {
|
|
49
|
-
action,
|
|
50
|
-
onClick: () => setIsModalOpen( true ),
|
|
51
|
-
};
|
|
52
|
-
const { RenderModal, hideModalHeader } = action;
|
|
53
|
-
return (
|
|
54
|
-
<>
|
|
55
|
-
<ActionTrigger { ...actionTriggerProps } />
|
|
56
|
-
{ isModalOpen && (
|
|
57
|
-
<Modal
|
|
58
|
-
title={ ! hideModalHeader && action.label }
|
|
59
|
-
__experimentalHideHeader={ !! hideModalHeader }
|
|
60
|
-
onRequestClose={ () => {
|
|
61
|
-
setIsModalOpen( false );
|
|
62
|
-
} }
|
|
63
|
-
overlayClassName="dataviews-action-modal"
|
|
64
|
-
>
|
|
65
|
-
<RenderModal
|
|
66
|
-
item={ item }
|
|
67
|
-
closeModal={ () => setIsModalOpen( false ) }
|
|
68
|
-
/>
|
|
69
|
-
</Modal>
|
|
70
|
-
) }
|
|
71
|
-
</>
|
|
72
|
-
);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
function ActionsDropdownMenuGroup( { actions, item } ) {
|
|
76
|
-
return (
|
|
77
|
-
<DropdownMenuGroup>
|
|
78
|
-
{ actions.map( ( action ) => {
|
|
79
|
-
if ( !! action.RenderModal ) {
|
|
80
|
-
return (
|
|
81
|
-
<ActionWithModal
|
|
82
|
-
key={ action.id }
|
|
83
|
-
action={ action }
|
|
84
|
-
item={ item }
|
|
85
|
-
ActionTrigger={ DropdownMenuItemTrigger }
|
|
86
|
-
/>
|
|
87
|
-
);
|
|
88
|
-
}
|
|
89
|
-
return (
|
|
90
|
-
<DropdownMenuItemTrigger
|
|
91
|
-
key={ action.id }
|
|
92
|
-
action={ action }
|
|
93
|
-
onClick={ () => action.callback( item ) }
|
|
94
|
-
/>
|
|
95
|
-
);
|
|
96
|
-
} ) }
|
|
97
|
-
</DropdownMenuGroup>
|
|
98
|
-
);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
export default function ItemActions( { item, actions, isCompact } ) {
|
|
102
|
-
const { primaryActions, secondaryActions } = useMemo( () => {
|
|
103
|
-
return actions.reduce(
|
|
104
|
-
( accumulator, action ) => {
|
|
105
|
-
// If an action is eligible for all items, doesn't need
|
|
106
|
-
// to provide the `isEligible` function.
|
|
107
|
-
if ( action.isEligible && ! action.isEligible( item ) ) {
|
|
108
|
-
return accumulator;
|
|
109
|
-
}
|
|
110
|
-
if ( action.isPrimary && !! action.icon ) {
|
|
111
|
-
accumulator.primaryActions.push( action );
|
|
112
|
-
} else {
|
|
113
|
-
accumulator.secondaryActions.push( action );
|
|
114
|
-
}
|
|
115
|
-
return accumulator;
|
|
116
|
-
},
|
|
117
|
-
{ primaryActions: [], secondaryActions: [] }
|
|
118
|
-
);
|
|
119
|
-
}, [ actions, item ] );
|
|
120
|
-
if ( ! primaryActions.length && ! secondaryActions.length ) {
|
|
121
|
-
return null;
|
|
122
|
-
}
|
|
123
|
-
if ( isCompact ) {
|
|
124
|
-
return (
|
|
125
|
-
<CompactItemActions
|
|
126
|
-
item={ item }
|
|
127
|
-
primaryActions={ primaryActions }
|
|
128
|
-
secondaryActions={ secondaryActions }
|
|
129
|
-
/>
|
|
130
|
-
);
|
|
131
|
-
}
|
|
132
|
-
return (
|
|
133
|
-
<HStack
|
|
134
|
-
spacing={ 1 }
|
|
135
|
-
justify="flex-end"
|
|
136
|
-
style={ {
|
|
137
|
-
flexShrink: '0',
|
|
138
|
-
width: 'auto',
|
|
139
|
-
} }
|
|
140
|
-
>
|
|
141
|
-
{ !! primaryActions.length &&
|
|
142
|
-
primaryActions.map( ( action ) => {
|
|
143
|
-
if ( !! action.RenderModal ) {
|
|
144
|
-
return (
|
|
145
|
-
<ActionWithModal
|
|
146
|
-
key={ action.id }
|
|
147
|
-
action={ action }
|
|
148
|
-
item={ item }
|
|
149
|
-
ActionTrigger={ ButtonTrigger }
|
|
150
|
-
/>
|
|
151
|
-
);
|
|
152
|
-
}
|
|
153
|
-
return (
|
|
154
|
-
<ButtonTrigger
|
|
155
|
-
key={ action.id }
|
|
156
|
-
action={ action }
|
|
157
|
-
onClick={ () => action.callback( item ) }
|
|
158
|
-
/>
|
|
159
|
-
);
|
|
160
|
-
} ) }
|
|
161
|
-
{ !! secondaryActions.length && (
|
|
162
|
-
<DropdownMenu
|
|
163
|
-
trigger={
|
|
164
|
-
<Button
|
|
165
|
-
size="compact"
|
|
166
|
-
icon={ moreVertical }
|
|
167
|
-
label={ __( 'Actions' ) }
|
|
168
|
-
/>
|
|
169
|
-
}
|
|
170
|
-
placement="bottom-end"
|
|
171
|
-
>
|
|
172
|
-
<ActionsDropdownMenuGroup
|
|
173
|
-
actions={ secondaryActions }
|
|
174
|
-
item={ item }
|
|
175
|
-
/>
|
|
176
|
-
</DropdownMenu>
|
|
177
|
-
) }
|
|
178
|
-
</HStack>
|
|
179
|
-
);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
function CompactItemActions( { item, primaryActions, secondaryActions } ) {
|
|
183
|
-
return (
|
|
184
|
-
<DropdownMenu
|
|
185
|
-
trigger={
|
|
186
|
-
<Button
|
|
187
|
-
size="compact"
|
|
188
|
-
icon={ moreVertical }
|
|
189
|
-
label={ __( 'Actions' ) }
|
|
190
|
-
/>
|
|
191
|
-
}
|
|
192
|
-
placement="bottom-end"
|
|
193
|
-
>
|
|
194
|
-
{ !! primaryActions.length && (
|
|
195
|
-
<ActionsDropdownMenuGroup
|
|
196
|
-
actions={ primaryActions }
|
|
197
|
-
item={ item }
|
|
198
|
-
/>
|
|
199
|
-
) }
|
|
200
|
-
{ !! secondaryActions.length && (
|
|
201
|
-
<ActionsDropdownMenuGroup
|
|
202
|
-
actions={ secondaryActions }
|
|
203
|
-
item={ item }
|
|
204
|
-
/>
|
|
205
|
-
) }
|
|
206
|
-
</DropdownMenu>
|
|
207
|
-
);
|
|
208
|
-
}
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import {
|
|
5
|
-
Button,
|
|
6
|
-
__experimentalHStack as HStack,
|
|
7
|
-
__experimentalText as Text,
|
|
8
|
-
__experimentalNumberControl as NumberControl,
|
|
9
|
-
} from '@wordpress/components';
|
|
10
|
-
import { createInterpolateElement } from '@wordpress/element';
|
|
11
|
-
import { sprintf, __, _x, _n } from '@wordpress/i18n';
|
|
12
|
-
import { chevronRight, chevronLeft, previous, next } from '@wordpress/icons';
|
|
13
|
-
|
|
14
|
-
function Pagination( {
|
|
15
|
-
view,
|
|
16
|
-
onChangeView,
|
|
17
|
-
paginationInfo: { totalItems = 0, totalPages },
|
|
18
|
-
} ) {
|
|
19
|
-
if ( ! totalItems || ! totalPages ) {
|
|
20
|
-
return null;
|
|
21
|
-
}
|
|
22
|
-
return (
|
|
23
|
-
<HStack
|
|
24
|
-
expanded={ false }
|
|
25
|
-
spacing={ 3 }
|
|
26
|
-
justify="space-between"
|
|
27
|
-
className="dataviews-pagination"
|
|
28
|
-
>
|
|
29
|
-
<Text variant="muted">
|
|
30
|
-
{
|
|
31
|
-
// translators: %s: Total number of entries.
|
|
32
|
-
sprintf(
|
|
33
|
-
// translators: %s: Total number of entries.
|
|
34
|
-
_n( '%s item', '%s items', totalItems ),
|
|
35
|
-
totalItems
|
|
36
|
-
)
|
|
37
|
-
}
|
|
38
|
-
</Text>
|
|
39
|
-
{ !! totalItems && (
|
|
40
|
-
<HStack expanded={ false } spacing={ 3 }>
|
|
41
|
-
<HStack
|
|
42
|
-
justify="flex-start"
|
|
43
|
-
expanded={ false }
|
|
44
|
-
spacing={ 1 }
|
|
45
|
-
>
|
|
46
|
-
<Button
|
|
47
|
-
onClick={ () =>
|
|
48
|
-
onChangeView( { ...view, page: 1 } )
|
|
49
|
-
}
|
|
50
|
-
disabled={ view.page === 1 }
|
|
51
|
-
__experimentalIsFocusable
|
|
52
|
-
label={ __( 'First page' ) }
|
|
53
|
-
icon={ previous }
|
|
54
|
-
showTooltip
|
|
55
|
-
size="compact"
|
|
56
|
-
/>
|
|
57
|
-
<Button
|
|
58
|
-
onClick={ () =>
|
|
59
|
-
onChangeView( { ...view, page: view.page - 1 } )
|
|
60
|
-
}
|
|
61
|
-
disabled={ view.page === 1 }
|
|
62
|
-
__experimentalIsFocusable
|
|
63
|
-
label={ __( 'Previous page' ) }
|
|
64
|
-
icon={ chevronLeft }
|
|
65
|
-
showTooltip
|
|
66
|
-
size="compact"
|
|
67
|
-
/>
|
|
68
|
-
</HStack>
|
|
69
|
-
<HStack
|
|
70
|
-
justify="flex-start"
|
|
71
|
-
expanded={ false }
|
|
72
|
-
spacing={ 2 }
|
|
73
|
-
>
|
|
74
|
-
{ createInterpolateElement(
|
|
75
|
-
sprintf(
|
|
76
|
-
// translators: %1$s: Current page number, %2$s: Total number of pages.
|
|
77
|
-
_x( '<CurrenPageControl /> of %2$s', 'paging' ),
|
|
78
|
-
view.page,
|
|
79
|
-
totalPages
|
|
80
|
-
),
|
|
81
|
-
{
|
|
82
|
-
CurrenPageControl: (
|
|
83
|
-
<NumberControl
|
|
84
|
-
aria-label={ __( 'Current page' ) }
|
|
85
|
-
min={ 1 }
|
|
86
|
-
max={ totalPages }
|
|
87
|
-
onChange={ ( value ) => {
|
|
88
|
-
const _value = +value;
|
|
89
|
-
if (
|
|
90
|
-
! _value ||
|
|
91
|
-
_value < 1 ||
|
|
92
|
-
_value > totalPages
|
|
93
|
-
) {
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
onChangeView( {
|
|
97
|
-
...view,
|
|
98
|
-
page: _value,
|
|
99
|
-
} );
|
|
100
|
-
} }
|
|
101
|
-
step="1"
|
|
102
|
-
value={ view.page }
|
|
103
|
-
isDragEnabled={ false }
|
|
104
|
-
spinControls="none"
|
|
105
|
-
/>
|
|
106
|
-
),
|
|
107
|
-
}
|
|
108
|
-
) }
|
|
109
|
-
</HStack>
|
|
110
|
-
<HStack
|
|
111
|
-
justify="flex-start"
|
|
112
|
-
expanded={ false }
|
|
113
|
-
spacing={ 1 }
|
|
114
|
-
>
|
|
115
|
-
<Button
|
|
116
|
-
onClick={ () =>
|
|
117
|
-
onChangeView( { ...view, page: view.page + 1 } )
|
|
118
|
-
}
|
|
119
|
-
disabled={ view.page >= totalPages }
|
|
120
|
-
__experimentalIsFocusable
|
|
121
|
-
label={ __( 'Next page' ) }
|
|
122
|
-
icon={ chevronRight }
|
|
123
|
-
showTooltip
|
|
124
|
-
size="compact"
|
|
125
|
-
/>
|
|
126
|
-
<Button
|
|
127
|
-
onClick={ () =>
|
|
128
|
-
onChangeView( { ...view, page: totalPages } )
|
|
129
|
-
}
|
|
130
|
-
disabled={ view.page >= totalPages }
|
|
131
|
-
__experimentalIsFocusable
|
|
132
|
-
label={ __( 'Last page' ) }
|
|
133
|
-
icon={ next }
|
|
134
|
-
showTooltip
|
|
135
|
-
size="compact"
|
|
136
|
-
/>
|
|
137
|
-
</HStack>
|
|
138
|
-
</HStack>
|
|
139
|
-
) }
|
|
140
|
-
</HStack>
|
|
141
|
-
);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
export default Pagination;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { Button } from '@wordpress/components';
|
|
5
|
-
import { __ } from '@wordpress/i18n';
|
|
6
|
-
|
|
7
|
-
export default ( { view, onChangeView } ) => {
|
|
8
|
-
return (
|
|
9
|
-
<Button
|
|
10
|
-
disabled={ view.search === '' && view.filters?.length === 0 }
|
|
11
|
-
__experimentalIsFocusable
|
|
12
|
-
size="compact"
|
|
13
|
-
variant="tertiary"
|
|
14
|
-
onClick={ () => {
|
|
15
|
-
onChangeView( ( currentView ) => ( {
|
|
16
|
-
...currentView,
|
|
17
|
-
page: 1,
|
|
18
|
-
search: '',
|
|
19
|
-
filters: [],
|
|
20
|
-
} ) );
|
|
21
|
-
} }
|
|
22
|
-
>
|
|
23
|
-
{ __( 'Reset filters' ) }
|
|
24
|
-
</Button>
|
|
25
|
-
);
|
|
26
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { __ } from '@wordpress/i18n';
|
|
5
|
-
import { useEffect, useRef } from '@wordpress/element';
|
|
6
|
-
import { SearchControl } from '@wordpress/components';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Internal dependencies
|
|
10
|
-
*/
|
|
11
|
-
import useDebouncedInput from '../../utils/use-debounced-input';
|
|
12
|
-
|
|
13
|
-
export default function Search( { label, view, onChangeView } ) {
|
|
14
|
-
const [ search, setSearch, debouncedSearch ] = useDebouncedInput(
|
|
15
|
-
view.search
|
|
16
|
-
);
|
|
17
|
-
useEffect( () => {
|
|
18
|
-
setSearch( view.search );
|
|
19
|
-
}, [ view ] );
|
|
20
|
-
const onChangeViewRef = useRef( onChangeView );
|
|
21
|
-
useEffect( () => {
|
|
22
|
-
onChangeViewRef.current = onChangeView;
|
|
23
|
-
}, [ onChangeView ] );
|
|
24
|
-
useEffect( () => {
|
|
25
|
-
onChangeViewRef.current( ( currentView ) => ( {
|
|
26
|
-
...currentView,
|
|
27
|
-
page: 1,
|
|
28
|
-
search: debouncedSearch,
|
|
29
|
-
} ) );
|
|
30
|
-
}, [ debouncedSearch ] );
|
|
31
|
-
const searchLabel = label || __( 'Filter list' );
|
|
32
|
-
return (
|
|
33
|
-
<SearchControl
|
|
34
|
-
__nextHasNoMarginBottom
|
|
35
|
-
onChange={ setSearch }
|
|
36
|
-
value={ search }
|
|
37
|
-
label={ searchLabel }
|
|
38
|
-
placeholder={ searchLabel }
|
|
39
|
-
size="compact"
|
|
40
|
-
/>
|
|
41
|
-
);
|
|
42
|
-
}
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
.dataviews-wrapper {
|
|
2
|
-
width: 100%;
|
|
3
|
-
height: calc(100% - #{$grid-unit-40} * 2);
|
|
4
|
-
overflow: auto;
|
|
5
|
-
padding: $grid-unit-40 $grid-unit-40 0;
|
|
6
|
-
|
|
7
|
-
> div {
|
|
8
|
-
min-height: 100%;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.dataviews-pagination {
|
|
13
|
-
margin-top: auto;
|
|
14
|
-
position: sticky;
|
|
15
|
-
bottom: 0;
|
|
16
|
-
background-color: $white;
|
|
17
|
-
padding: $grid-unit-20 0;
|
|
18
|
-
border-top: $border-width solid $gray-200;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.dataviews-filters-options {
|
|
22
|
-
margin: $grid-unit-40 0 $grid-unit-20;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.dataviews-list-view {
|
|
26
|
-
width: 100%;
|
|
27
|
-
text-indent: 0;
|
|
28
|
-
border-color: inherit;
|
|
29
|
-
border-collapse: collapse;
|
|
30
|
-
position: relative;
|
|
31
|
-
|
|
32
|
-
a {
|
|
33
|
-
text-decoration: none;
|
|
34
|
-
}
|
|
35
|
-
th {
|
|
36
|
-
text-align: left;
|
|
37
|
-
font-weight: normal;
|
|
38
|
-
padding: 0 $grid-unit-20 $grid-unit-20;
|
|
39
|
-
color: $gray-700;
|
|
40
|
-
}
|
|
41
|
-
td,
|
|
42
|
-
th {
|
|
43
|
-
padding: $grid-unit-15;
|
|
44
|
-
&[data-field-id="actions"] {
|
|
45
|
-
text-align: right;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
tr {
|
|
49
|
-
border-bottom: 1px solid $gray-100;
|
|
50
|
-
|
|
51
|
-
&:last-child {
|
|
52
|
-
border-bottom: 0;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
thead {
|
|
56
|
-
tr {
|
|
57
|
-
border: 0;
|
|
58
|
-
}
|
|
59
|
-
th {
|
|
60
|
-
position: sticky;
|
|
61
|
-
top: - #{$grid-unit-40}; // Offset the container padding
|
|
62
|
-
background-color: $white;
|
|
63
|
-
box-shadow: inset 0 -#{$border-width} 0 $gray-200;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.dataviews-grid-view {
|
|
69
|
-
margin-bottom: $grid-unit-30;
|
|
70
|
-
grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
|
|
71
|
-
|
|
72
|
-
@include break-xlarge() {
|
|
73
|
-
grid-template-columns: repeat(3, minmax(0, 1fr)) !important; // Todo: eliminate !important dependency
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
@include break-huge() {
|
|
77
|
-
grid-template-columns: repeat(4, minmax(0, 1fr)) !important; // Todo: eliminate !important dependency
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.dataviews-view-grid__card {
|
|
81
|
-
h3 { // Todo: A better way to target this
|
|
82
|
-
white-space: nowrap;
|
|
83
|
-
overflow: hidden;
|
|
84
|
-
text-overflow: ellipsis;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.dataviews-view-grid__media {
|
|
89
|
-
width: 100%;
|
|
90
|
-
min-height: 200px;
|
|
91
|
-
aspect-ratio: 1/1;
|
|
92
|
-
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
|
|
93
|
-
border-radius: $radius-block-ui * 2;
|
|
94
|
-
overflow: hidden;
|
|
95
|
-
|
|
96
|
-
> * {
|
|
97
|
-
object-fit: cover;
|
|
98
|
-
width: 100%;
|
|
99
|
-
height: 100%;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.dataviews-view-grid__title {
|
|
104
|
-
min-height: $grid-unit-30;
|
|
105
|
-
|
|
106
|
-
a {
|
|
107
|
-
color: $gray-900;
|
|
108
|
-
text-decoration: none;
|
|
109
|
-
font-weight: 500;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
.dataviews-view-grid__fields {
|
|
114
|
-
position: relative;
|
|
115
|
-
font-size: 12px;
|
|
116
|
-
line-height: 16px;
|
|
117
|
-
|
|
118
|
-
.dataviews-view-grid__field {
|
|
119
|
-
.dataviews-view-grid__field-header {
|
|
120
|
-
color: $gray-700;
|
|
121
|
-
}
|
|
122
|
-
.dataviews-view-grid__field-value {
|
|
123
|
-
color: $gray-900;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
.dataviews-action-modal {
|
|
130
|
-
z-index: z-index(".dataviews-action-modal");
|
|
131
|
-
}
|