@wordpress/edit-site 5.25.0 → 5.26.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/LICENSE.md +1 -1
- package/build/components/block-editor/back-button.js +3 -2
- package/build/components/block-editor/back-button.js.map +1 -1
- package/build/components/block-editor/resizable-editor.js +2 -2
- package/build/components/block-editor/resizable-editor.js.map +1 -1
- package/build/components/block-editor/use-post-link-props.js +27 -0
- package/build/components/block-editor/use-post-link-props.js.map +1 -0
- package/build/components/block-editor/use-site-editor-settings.js +7 -24
- package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build/components/create-template-part-modal/index.js +15 -7
- package/build/components/create-template-part-modal/index.js.map +1 -1
- package/build/components/editor/index.js +15 -16
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor-canvas-container/index.js +9 -7
- package/build/components/editor-canvas-container/index.js.map +1 -1
- package/build/components/global-styles/font-library-modal/collection-font-variant.js +5 -2
- package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
- package/build/components/global-styles/font-library-modal/confirm-delete-dialog.js +3 -3
- package/build/components/global-styles/font-library-modal/confirm-delete-dialog.js.map +1 -1
- package/build/components/global-styles/font-library-modal/context.js +5 -5
- package/build/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-collection.js +8 -4
- package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build/components/global-styles/font-library-modal/index.js +38 -21
- package/build/components/global-styles/font-library-modal/index.js.map +1 -1
- package/build/components/global-styles/font-library-modal/installed-fonts.js +2 -2
- package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/library-font-variant.js +5 -2
- package/build/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
- package/build/components/global-styles/font-library-modal/local-fonts.js +26 -10
- package/build/components/global-styles/font-library-modal/local-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/resolvers.js +6 -6
- package/build/components/global-styles/font-library-modal/resolvers.js.map +1 -1
- package/build/components/global-styles/font-library-modal/{tab-layout.js → tab-panel-layout.js} +4 -4
- package/build/components/global-styles/font-library-modal/tab-panel-layout.js.map +1 -0
- package/build/components/global-styles/font-library-modal/utils/index.js +35 -38
- package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
- package/build/components/global-styles/preview.js +43 -1
- package/build/components/global-styles/preview.js.map +1 -1
- package/build/components/global-styles/screen-color-palette.js +16 -12
- package/build/components/global-styles/screen-color-palette.js.map +1 -1
- package/build/components/global-styles/screen-revisions/index.js +52 -52
- package/build/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js +26 -35
- package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +40 -22
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build/components/global-styles/ui.js +13 -62
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/header-edit-mode/document-tools/index.js +8 -106
- package/build/components/header-edit-mode/document-tools/index.js.map +1 -1
- package/build/components/header-edit-mode/index.js +7 -11
- package/build/components/header-edit-mode/index.js.map +1 -1
- package/build/components/header-edit-mode/mode-switcher/index.js +0 -2
- package/build/components/header-edit-mode/mode-switcher/index.js.map +1 -1
- package/build/components/header-edit-mode/more-menu/index.js +10 -7
- package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
- package/build/components/keyboard-shortcuts/edit-mode.js +0 -23
- package/build/components/keyboard-shortcuts/edit-mode.js.map +1 -1
- package/build/components/keyboard-shortcuts/register.js +0 -36
- package/build/components/keyboard-shortcuts/register.js.map +1 -1
- package/build/components/layout/index.js +6 -13
- package/build/components/layout/index.js.map +1 -1
- package/build/components/page-main/index.js +4 -4
- package/build/components/page-main/index.js.map +1 -1
- package/build/components/page-pages/index.js +84 -37
- package/build/components/page-pages/index.js.map +1 -1
- package/build/components/page-patterns/dataviews-pattern-actions.js +305 -0
- package/build/components/page-patterns/dataviews-pattern-actions.js.map +1 -0
- package/build/components/page-patterns/dataviews-patterns.js +307 -0
- package/build/components/page-patterns/dataviews-patterns.js.map +1 -0
- package/build/components/page-patterns/duplicate-menu-item.js +1 -1
- package/build/components/page-patterns/duplicate-menu-item.js.map +1 -1
- package/build/components/page-patterns/grid-item.js +4 -3
- package/build/components/page-patterns/grid-item.js.map +1 -1
- package/build/components/page-patterns/patterns-list.js +2 -1
- package/build/components/page-patterns/patterns-list.js.map +1 -1
- package/build/components/page-patterns/use-patterns.js +23 -13
- package/build/components/page-patterns/use-patterns.js.map +1 -1
- package/build/components/page-templates/index.js +312 -36
- package/build/components/page-templates/index.js.map +1 -1
- package/build/components/{page-patterns/pagination.js → pagination/index.js} +25 -12
- package/build/components/pagination/index.js.map +1 -0
- package/build/components/{page-pages/side-editor.js → post-preview/index.js} +8 -4
- package/build/components/post-preview/index.js.map +1 -0
- package/build/components/preferences-modal/enable-feature.js +3 -2
- package/build/components/preferences-modal/enable-feature.js.map +1 -1
- package/build/components/preferences-modal/enable-panel-option.js +33 -0
- package/build/components/preferences-modal/enable-panel-option.js.map +1 -0
- package/build/components/preferences-modal/index.js +57 -9
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/revisions/index.js +3 -7
- package/build/components/revisions/index.js.map +1 -1
- package/build/components/routes/link.js +6 -2
- package/build/components/routes/link.js.map +1 -1
- package/build/components/save-button/index.js +6 -3
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/sidebar/index.js +3 -11
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-dataviews/add-new-view.js +2 -2
- package/build/components/sidebar-dataviews/add-new-view.js.map +1 -1
- package/build/components/sidebar-dataviews/default-views.js +18 -5
- package/build/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build/components/sidebar-dataviews/index.js +3 -3
- package/build/components/sidebar-dataviews/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/default-sidebar.js +1 -5
- package/build/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js +62 -10
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/index.js +1 -1
- package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -4
- package/build/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-panel/index.js +4 -13
- package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-details-footer/index.js +1 -1
- package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js +5 -2
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/index.js +4 -1
- package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pages-dataviews/index.js +69 -0
- package/build/components/sidebar-navigation-screen-pages-dataviews/index.js.map +1 -0
- package/build/components/style-book/index.js +38 -8
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build/hooks/commands/use-edit-mode-commands.js +11 -6
- package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build/index.js +12 -7
- package/build/index.js.map +1 -1
- package/build/store/actions.js +39 -44
- package/build/store/actions.js.map +1 -1
- package/build/store/private-actions.js +6 -2
- package/build/store/private-actions.js.map +1 -1
- package/build/store/reducer.js +0 -46
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +32 -41
- package/build/store/selectors.js.map +1 -1
- package/build/utils/get-is-list-page.js +1 -1
- package/build/utils/get-is-list-page.js.map +1 -1
- package/build-module/components/block-editor/back-button.js +4 -3
- package/build-module/components/block-editor/back-button.js.map +1 -1
- package/build-module/components/block-editor/resizable-editor.js +2 -2
- package/build-module/components/block-editor/resizable-editor.js.map +1 -1
- package/build-module/components/block-editor/use-post-link-props.js +20 -0
- package/build-module/components/block-editor/use-post-link-props.js.map +1 -0
- package/build-module/components/block-editor/use-site-editor-settings.js +8 -25
- package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build-module/components/create-template-part-modal/index.js +14 -7
- package/build-module/components/create-template-part-modal/index.js.map +1 -1
- package/build-module/components/editor/index.js +16 -17
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor-canvas-container/index.js +9 -7
- package/build-module/components/editor-canvas-container/index.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/collection-font-variant.js +5 -2
- package/build-module/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/confirm-delete-dialog.js +3 -3
- package/build-module/components/global-styles/font-library-modal/confirm-delete-dialog.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/context.js +7 -7
- package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/font-collection.js +8 -4
- package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/index.js +39 -22
- package/build-module/components/global-styles/font-library-modal/index.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js +2 -2
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/library-font-variant.js +5 -2
- package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/local-fonts.js +27 -11
- package/build-module/components/global-styles/font-library-modal/local-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/resolvers.js +5 -5
- package/build-module/components/global-styles/font-library-modal/resolvers.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/{tab-layout.js → tab-panel-layout.js} +4 -4
- package/build-module/components/global-styles/font-library-modal/tab-panel-layout.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/utils/index.js +34 -36
- package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
- package/build-module/components/global-styles/preview.js +45 -3
- package/build-module/components/global-styles/preview.js.map +1 -1
- package/build-module/components/global-styles/screen-color-palette.js +17 -13
- package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/index.js +53 -53
- package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +27 -36
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +40 -22
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build-module/components/global-styles/ui.js +15 -64
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/header-edit-mode/document-tools/index.js +13 -110
- package/build-module/components/header-edit-mode/document-tools/index.js.map +1 -1
- package/build-module/components/header-edit-mode/index.js +7 -11
- package/build-module/components/header-edit-mode/index.js.map +1 -1
- package/build-module/components/header-edit-mode/mode-switcher/index.js +0 -2
- package/build-module/components/header-edit-mode/mode-switcher/index.js.map +1 -1
- package/build-module/components/header-edit-mode/more-menu/index.js +10 -7
- package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/edit-mode.js +0 -23
- package/build-module/components/keyboard-shortcuts/edit-mode.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/register.js +0 -36
- package/build-module/components/keyboard-shortcuts/register.js.map +1 -1
- package/build-module/components/layout/index.js +6 -13
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/page-main/index.js +4 -4
- package/build-module/components/page-main/index.js.map +1 -1
- package/build-module/components/page-pages/index.js +83 -36
- package/build-module/components/page-pages/index.js.map +1 -1
- package/build-module/components/page-patterns/dataviews-pattern-actions.js +292 -0
- package/build-module/components/page-patterns/dataviews-pattern-actions.js.map +1 -0
- package/build-module/components/page-patterns/dataviews-patterns.js +299 -0
- package/build-module/components/page-patterns/dataviews-patterns.js.map +1 -0
- package/build-module/components/page-patterns/duplicate-menu-item.js +1 -1
- package/build-module/components/page-patterns/duplicate-menu-item.js.map +1 -1
- package/build-module/components/page-patterns/grid-item.js +4 -3
- package/build-module/components/page-patterns/grid-item.js.map +1 -1
- package/build-module/components/page-patterns/patterns-list.js +2 -1
- package/build-module/components/page-patterns/patterns-list.js.map +1 -1
- package/build-module/components/page-patterns/use-patterns.js +23 -13
- package/build-module/components/page-patterns/use-patterns.js.map +1 -1
- package/build-module/components/page-templates/index.js +314 -38
- package/build-module/components/page-templates/index.js.map +1 -1
- package/build-module/components/{page-patterns/pagination.js → pagination/index.js} +24 -12
- package/build-module/components/pagination/index.js.map +1 -0
- package/build-module/components/{page-pages/side-editor.js → post-preview/index.js} +7 -3
- package/build-module/components/post-preview/index.js.map +1 -0
- package/build-module/components/preferences-modal/enable-feature.js +3 -2
- package/build-module/components/preferences-modal/enable-feature.js.map +1 -1
- package/build-module/components/preferences-modal/enable-panel-option.js +26 -0
- package/build-module/components/preferences-modal/enable-panel-option.js.map +1 -0
- package/build-module/components/preferences-modal/index.js +57 -9
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/revisions/index.js +4 -8
- package/build-module/components/revisions/index.js.map +1 -1
- package/build-module/components/routes/link.js +5 -2
- package/build-module/components/routes/link.js.map +1 -1
- package/build-module/components/save-button/index.js +6 -3
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +3 -11
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-dataviews/add-new-view.js +1 -1
- package/build-module/components/sidebar-dataviews/add-new-view.js.map +1 -1
- package/build-module/components/sidebar-dataviews/default-views.js +17 -5
- package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build-module/components/sidebar-dataviews/index.js +2 -2
- package/build-module/components/sidebar-dataviews/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/default-sidebar.js +1 -5
- package/build-module/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +64 -12
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/index.js +2 -2
- package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -4
- package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/template-panel/index.js +6 -15
- package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-details-footer/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +5 -2
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-page/index.js +4 -1
- package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pages-dataviews/index.js +61 -0
- package/build-module/components/sidebar-navigation-screen-pages-dataviews/index.js.map +1 -0
- package/build-module/components/style-book/index.js +40 -10
- package/build-module/components/style-book/index.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +1 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build-module/hooks/commands/use-edit-mode-commands.js +11 -6
- package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build-module/index.js +12 -7
- package/build-module/index.js.map +1 -1
- package/build-module/store/actions.js +36 -41
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/private-actions.js +6 -2
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/reducer.js +0 -44
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +30 -38
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/get-is-list-page.js +1 -1
- package/build-module/utils/get-is-list-page.js.map +1 -1
- package/build-style/style-rtl.css +357 -268
- package/build-style/style.css +357 -268
- package/package.json +42 -42
- package/src/components/add-new-template/style.scss +2 -1
- package/src/components/block-editor/back-button.js +4 -2
- package/src/components/block-editor/resizable-editor.js +1 -1
- package/src/components/block-editor/style.scss +1 -2
- package/src/components/block-editor/use-post-link-props.js +20 -0
- package/src/components/block-editor/use-site-editor-settings.js +10 -41
- package/src/components/code-editor/style.scss +0 -4
- package/src/components/create-template-part-modal/index.js +83 -82
- package/src/components/editor/index.js +24 -31
- package/src/components/editor-canvas-container/index.js +8 -6
- package/src/components/global-styles/font-library-modal/collection-font-variant.js +7 -2
- package/src/components/global-styles/font-library-modal/confirm-delete-dialog.js +3 -3
- package/src/components/global-styles/font-library-modal/context.js +7 -7
- package/src/components/global-styles/font-library-modal/font-collection.js +10 -5
- package/src/components/global-styles/font-library-modal/index.js +44 -24
- package/src/components/global-styles/font-library-modal/installed-fonts.js +3 -3
- package/src/components/global-styles/font-library-modal/library-font-variant.js +7 -2
- package/src/components/global-styles/font-library-modal/local-fonts.js +53 -26
- package/src/components/global-styles/font-library-modal/resolvers.js +5 -5
- package/src/components/global-styles/font-library-modal/style.scss +5 -2
- package/src/components/global-styles/font-library-modal/{tab-layout.js → tab-panel-layout.js} +9 -3
- package/src/components/global-styles/font-library-modal/utils/index.js +21 -23
- package/src/components/global-styles/font-library-modal/utils/test/makeFormDataFromFontFamily.spec.js +58 -0
- package/src/components/global-styles/preview.js +55 -3
- package/src/components/global-styles/screen-color-palette.js +16 -26
- package/src/components/global-styles/screen-revisions/index.js +91 -92
- package/src/components/global-styles/screen-revisions/revisions-buttons.js +37 -38
- package/src/components/global-styles/screen-revisions/style.scss +77 -20
- package/src/components/global-styles/screen-revisions/test/use-global-styles-revisions.js +67 -0
- package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +73 -46
- package/src/components/global-styles/ui.js +13 -74
- package/src/components/header-edit-mode/document-tools/index.js +33 -165
- package/src/components/header-edit-mode/index.js +6 -17
- package/src/components/header-edit-mode/mode-switcher/index.js +0 -4
- package/src/components/header-edit-mode/more-menu/index.js +9 -7
- package/src/components/header-edit-mode/style.scss +0 -47
- package/src/components/keyboard-shortcuts/edit-mode.js +1 -26
- package/src/components/keyboard-shortcuts/register.js +0 -43
- package/src/components/layout/index.js +8 -27
- package/src/components/layout/style.scss +10 -3
- package/src/components/list/style.scss +0 -5
- package/src/components/page/style.scss +1 -1
- package/src/components/page-main/index.js +8 -8
- package/src/components/page-pages/index.js +112 -41
- package/src/components/page-pages/style.scss +3 -2
- package/src/components/page-patterns/dataviews-pattern-actions.js +329 -0
- package/src/components/page-patterns/dataviews-patterns.js +380 -0
- package/src/components/page-patterns/duplicate-menu-item.js +1 -1
- package/src/components/page-patterns/grid-item.js +3 -2
- package/src/components/page-patterns/patterns-list.js +2 -1
- package/src/components/page-patterns/style.scss +89 -26
- package/src/components/page-patterns/use-patterns.js +24 -15
- package/src/components/page-templates/index.js +399 -64
- package/src/components/{page-patterns/pagination.js → pagination/index.js} +21 -10
- package/src/components/pagination/style.scss +5 -0
- package/src/components/post-preview/index.js +16 -0
- package/src/components/preferences-modal/enable-feature.js +9 -5
- package/src/components/preferences-modal/enable-panel-option.js +23 -0
- package/src/components/preferences-modal/index.js +107 -22
- package/src/components/revisions/index.js +8 -15
- package/src/components/routes/link.js +11 -3
- package/src/components/save-button/index.js +16 -3
- package/src/components/sidebar/index.js +6 -13
- package/src/components/sidebar-dataviews/add-new-view.js +1 -1
- package/src/components/sidebar-dataviews/default-views.js +23 -6
- package/src/components/sidebar-dataviews/index.js +2 -2
- package/src/components/sidebar-edit-mode/default-sidebar.js +0 -12
- package/src/components/sidebar-edit-mode/global-styles-sidebar.js +85 -14
- package/src/components/sidebar-edit-mode/page-panels/index.js +15 -1
- package/src/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -12
- package/src/components/sidebar-edit-mode/style.scss +0 -10
- package/src/components/sidebar-edit-mode/template-panel/index.js +44 -40
- package/src/components/sidebar-edit-mode/template-panel/style.scss +0 -4
- package/src/components/sidebar-navigation-screen-details-footer/index.js +1 -1
- package/src/components/sidebar-navigation-screen-global-styles/index.js +3 -2
- package/src/components/sidebar-navigation-screen-page/index.js +2 -1
- package/src/components/sidebar-navigation-screen-pages-dataviews/index.js +77 -0
- package/src/components/site-hub/style.scss +5 -2
- package/src/components/style-book/index.js +65 -21
- package/src/components/style-book/style.scss +3 -3
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +4 -1
- package/src/hooks/commands/use-edit-mode-commands.js +8 -12
- package/src/index.js +11 -5
- package/src/store/actions.js +35 -45
- package/src/store/private-actions.js +7 -3
- package/src/store/reducer.js +0 -44
- package/src/store/selectors.js +32 -38
- package/src/store/test/actions.js +11 -39
- package/src/store/test/reducer.js +1 -82
- package/src/store/test/selectors.js +0 -24
- package/src/style.scss +1 -1
- package/src/utils/get-is-list-page.js +2 -3
- package/build/components/global-styles/font-library-modal/tab-layout.js.map +0 -1
- package/build/components/global-styles/screen-revisions/get-revision-changes.js +0 -146
- package/build/components/global-styles/screen-revisions/get-revision-changes.js.map +0 -1
- package/build/components/header-edit-mode/undo-redo/redo.js +0 -41
- package/build/components/header-edit-mode/undo-redo/redo.js.map +0 -1
- package/build/components/header-edit-mode/undo-redo/undo.js +0 -40
- package/build/components/header-edit-mode/undo-redo/undo.js.map +0 -1
- package/build/components/page-pages/side-editor.js.map +0 -1
- package/build/components/page-patterns/pagination.js.map +0 -1
- package/build/components/page-templates/dataviews-templates.js +0 -317
- package/build/components/page-templates/dataviews-templates.js.map +0 -1
- package/build/components/secondary-sidebar/inserter-sidebar.js +0 -60
- package/build/components/secondary-sidebar/inserter-sidebar.js.map +0 -1
- package/build/components/secondary-sidebar/list-view-sidebar.js +0 -109
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +0 -1
- package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js +0 -35
- package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +0 -1
- package/build/components/sidebar-edit-mode/template-panel/last-revision.js +0 -73
- package/build/components/sidebar-edit-mode/template-panel/last-revision.js.map +0 -1
- package/build/components/sidebar-edit-mode/template-panel/pattern-categories.js +0 -219
- package/build/components/sidebar-edit-mode/template-panel/pattern-categories.js.map +0 -1
- package/build-module/components/global-styles/font-library-modal/tab-layout.js.map +0 -1
- package/build-module/components/global-styles/screen-revisions/get-revision-changes.js +0 -139
- package/build-module/components/global-styles/screen-revisions/get-revision-changes.js.map +0 -1
- package/build-module/components/header-edit-mode/undo-redo/redo.js +0 -33
- package/build-module/components/header-edit-mode/undo-redo/redo.js.map +0 -1
- package/build-module/components/header-edit-mode/undo-redo/undo.js +0 -32
- package/build-module/components/header-edit-mode/undo-redo/undo.js.map +0 -1
- package/build-module/components/page-pages/side-editor.js.map +0 -1
- package/build-module/components/page-patterns/pagination.js.map +0 -1
- package/build-module/components/page-templates/dataviews-templates.js +0 -309
- package/build-module/components/page-templates/dataviews-templates.js.map +0 -1
- package/build-module/components/secondary-sidebar/inserter-sidebar.js +0 -53
- package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +0 -1
- package/build-module/components/secondary-sidebar/list-view-sidebar.js +0 -102
- package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js +0 -27
- package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/template-panel/last-revision.js +0 -65
- package/build-module/components/sidebar-edit-mode/template-panel/last-revision.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/template-panel/pattern-categories.js +0 -209
- package/build-module/components/sidebar-edit-mode/template-panel/pattern-categories.js.map +0 -1
- package/src/components/global-styles/font-library-modal/utils/test/makeFormDataFromFontFamilies.spec.js +0 -62
- package/src/components/global-styles/font-library-modal/utils/test/wpKebabCase.spec.js +0 -28
- package/src/components/global-styles/screen-revisions/get-revision-changes.js +0 -171
- package/src/components/global-styles/screen-revisions/test/get-revision-changes.js +0 -191
- package/src/components/header-edit-mode/undo-redo/redo.js +0 -38
- package/src/components/header-edit-mode/undo-redo/undo.js +0 -34
- package/src/components/page-pages/side-editor.js +0 -14
- package/src/components/page-templates/dataviews-templates.js +0 -360
- package/src/components/secondary-sidebar/inserter-sidebar.js +0 -66
- package/src/components/secondary-sidebar/list-view-sidebar.js +0 -123
- package/src/components/secondary-sidebar/style.scss +0 -65
- package/src/components/sidebar-edit-mode/sidebar-fixed-bottom.js +0 -26
- package/src/components/sidebar-edit-mode/template-panel/last-revision.js +0 -82
- package/src/components/sidebar-edit-mode/template-panel/pattern-categories.js +0 -279
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
5
5
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
6
|
+
import { store as editorStore } from '@wordpress/editor';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Action that switches the canvas mode.
|
|
@@ -23,13 +24,16 @@ export const setCanvasMode =
|
|
|
23
24
|
mode === 'edit' &&
|
|
24
25
|
registry
|
|
25
26
|
.select( preferencesStore )
|
|
26
|
-
.get( 'core
|
|
27
|
+
.get( 'core', 'showListViewByDefault' ) &&
|
|
27
28
|
! registry
|
|
28
29
|
.select( preferencesStore )
|
|
29
|
-
.get( 'core
|
|
30
|
+
.get( 'core', 'distractionFree' )
|
|
30
31
|
) {
|
|
31
|
-
dispatch.setIsListViewOpened( true );
|
|
32
|
+
registry.dispatch( editorStore ).setIsListViewOpened( true );
|
|
33
|
+
} else {
|
|
34
|
+
registry.dispatch( editorStore ).setIsListViewOpened( false );
|
|
32
35
|
}
|
|
36
|
+
registry.dispatch( editorStore ).setIsInserterOpened( false );
|
|
33
37
|
};
|
|
34
38
|
|
|
35
39
|
/**
|
package/src/store/reducer.js
CHANGED
|
@@ -50,48 +50,6 @@ export function editedPost( state = {}, action ) {
|
|
|
50
50
|
return state;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
/**
|
|
54
|
-
* Reducer to set the block inserter panel open or closed.
|
|
55
|
-
*
|
|
56
|
-
* Note: this reducer interacts with the navigation and list view panels reducers
|
|
57
|
-
* to make sure that only one of the three panels is open at the same time.
|
|
58
|
-
*
|
|
59
|
-
* @param {boolean|Object} state Current state.
|
|
60
|
-
* @param {Object} action Dispatched action.
|
|
61
|
-
*/
|
|
62
|
-
export function blockInserterPanel( state = false, action ) {
|
|
63
|
-
switch ( action.type ) {
|
|
64
|
-
case 'SET_IS_LIST_VIEW_OPENED':
|
|
65
|
-
return action.isOpen ? false : state;
|
|
66
|
-
case 'SET_IS_INSERTER_OPENED':
|
|
67
|
-
return action.value;
|
|
68
|
-
case 'SET_CANVAS_MODE':
|
|
69
|
-
return false;
|
|
70
|
-
}
|
|
71
|
-
return state;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Reducer to set the list view panel open or closed.
|
|
76
|
-
*
|
|
77
|
-
* Note: this reducer interacts with the navigation and inserter panels reducers
|
|
78
|
-
* to make sure that only one of the three panels is open at the same time.
|
|
79
|
-
*
|
|
80
|
-
* @param {Object} state Current state.
|
|
81
|
-
* @param {Object} action Dispatched action.
|
|
82
|
-
*/
|
|
83
|
-
export function listViewPanel( state = false, action ) {
|
|
84
|
-
switch ( action.type ) {
|
|
85
|
-
case 'SET_IS_INSERTER_OPENED':
|
|
86
|
-
return action.value ? false : state;
|
|
87
|
-
case 'SET_IS_LIST_VIEW_OPENED':
|
|
88
|
-
return action.isOpen;
|
|
89
|
-
case 'SET_CANVAS_MODE':
|
|
90
|
-
return false;
|
|
91
|
-
}
|
|
92
|
-
return state;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
53
|
/**
|
|
96
54
|
* Reducer to set the save view panel open or closed.
|
|
97
55
|
*
|
|
@@ -143,8 +101,6 @@ function editorCanvasContainerView( state = undefined, action ) {
|
|
|
143
101
|
export default combineReducers( {
|
|
144
102
|
settings,
|
|
145
103
|
editedPost,
|
|
146
|
-
blockInserterPanel,
|
|
147
|
-
listViewPanel,
|
|
148
104
|
saveViewPanel,
|
|
149
105
|
canvasMode,
|
|
150
106
|
editorCanvasContainerView,
|
package/src/store/selectors.js
CHANGED
|
@@ -14,6 +14,8 @@ import { store as editorStore } from '@wordpress/editor';
|
|
|
14
14
|
*/
|
|
15
15
|
import { getFilteredTemplatePartBlocks } from './utils';
|
|
16
16
|
import { TEMPLATE_PART_POST_TYPE } from '../utils/constants';
|
|
17
|
+
import { unlock } from '../lock-unlock';
|
|
18
|
+
|
|
17
19
|
/**
|
|
18
20
|
* @typedef {'template'|'template_type'} TemplateType Template type.
|
|
19
21
|
*/
|
|
@@ -169,66 +171,58 @@ export function getPage( state ) {
|
|
|
169
171
|
}
|
|
170
172
|
|
|
171
173
|
/**
|
|
172
|
-
* Returns
|
|
174
|
+
* Returns true if the inserter is opened.
|
|
175
|
+
*
|
|
176
|
+
* @deprecated
|
|
173
177
|
*
|
|
174
178
|
* @param {Object} state Global application state.
|
|
175
179
|
*
|
|
176
|
-
* @return {boolean}
|
|
180
|
+
* @return {boolean} Whether the inserter is opened.
|
|
177
181
|
*/
|
|
178
|
-
export
|
|
179
|
-
|
|
180
|
-
|
|
182
|
+
export const isInserterOpened = createRegistrySelector( ( select ) => () => {
|
|
183
|
+
deprecated( `select( 'core/edit-site' ).isInserterOpened`, {
|
|
184
|
+
since: '6.5',
|
|
185
|
+
alternative: `select( 'core/editor' ).isInserterOpened`,
|
|
186
|
+
} );
|
|
187
|
+
return select( editorStore ).isInserterOpened();
|
|
188
|
+
} );
|
|
181
189
|
|
|
182
190
|
/**
|
|
183
191
|
* Get the insertion point for the inserter.
|
|
184
192
|
*
|
|
193
|
+
* @deprecated
|
|
194
|
+
*
|
|
185
195
|
* @param {Object} state Global application state.
|
|
186
196
|
*
|
|
187
197
|
* @return {Object} The root client ID, index to insert at and starting filter value.
|
|
188
198
|
*/
|
|
189
199
|
export const __experimentalGetInsertionPoint = createRegistrySelector(
|
|
190
|
-
( select ) => (
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
if (
|
|
198
|
-
isPage( state ) &&
|
|
199
|
-
select( editorStore ).getRenderingMode() !== 'template-only'
|
|
200
|
-
) {
|
|
201
|
-
const [ postContentClientId ] =
|
|
202
|
-
select( blockEditorStore ).__experimentalGetGlobalBlocksByName(
|
|
203
|
-
'core/post-content'
|
|
204
|
-
);
|
|
205
|
-
if ( postContentClientId ) {
|
|
206
|
-
return {
|
|
207
|
-
rootClientId: postContentClientId,
|
|
208
|
-
insertionIndex: undefined,
|
|
209
|
-
filterValue: undefined,
|
|
210
|
-
};
|
|
200
|
+
( select ) => () => {
|
|
201
|
+
deprecated(
|
|
202
|
+
`select( 'core/edit-site' ).__experimentalGetInsertionPoint`,
|
|
203
|
+
{
|
|
204
|
+
since: '6.5',
|
|
205
|
+
version: '6.7',
|
|
211
206
|
}
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
return {
|
|
215
|
-
rootClientId: undefined,
|
|
216
|
-
insertionIndex: undefined,
|
|
217
|
-
filterValue: undefined,
|
|
218
|
-
};
|
|
207
|
+
);
|
|
208
|
+
return unlock( select( editorStore ) ).getInsertionPoint();
|
|
219
209
|
}
|
|
220
210
|
);
|
|
221
211
|
|
|
222
212
|
/**
|
|
223
|
-
* Returns
|
|
213
|
+
* Returns true if the list view is opened.
|
|
224
214
|
*
|
|
225
215
|
* @param {Object} state Global application state.
|
|
226
216
|
*
|
|
227
|
-
* @return {boolean}
|
|
217
|
+
* @return {boolean} Whether the list view is opened.
|
|
228
218
|
*/
|
|
229
|
-
export
|
|
230
|
-
|
|
231
|
-
|
|
219
|
+
export const isListViewOpened = createRegistrySelector( ( select ) => () => {
|
|
220
|
+
deprecated( `select( 'core/edit-site' ).isListViewOpened`, {
|
|
221
|
+
since: '6.5',
|
|
222
|
+
alternative: `select( 'core/editor' ).isListViewOpened`,
|
|
223
|
+
} );
|
|
224
|
+
return select( editorStore ).isListViewOpened();
|
|
225
|
+
} );
|
|
232
226
|
|
|
233
227
|
/**
|
|
234
228
|
* Returns the current opened/closed state of the save panel.
|
|
@@ -76,47 +76,19 @@ describe( 'actions', () => {
|
|
|
76
76
|
} );
|
|
77
77
|
} );
|
|
78
78
|
|
|
79
|
-
describe( 'setIsListViewOpened', () => {
|
|
80
|
-
it( 'should set the list view opened state', () => {
|
|
81
|
-
const registry = createRegistryWithStores();
|
|
82
|
-
|
|
83
|
-
registry.dispatch( editSiteStore ).setIsListViewOpened( true );
|
|
84
|
-
expect( registry.select( editSiteStore ).isListViewOpened() ).toBe(
|
|
85
|
-
true
|
|
86
|
-
);
|
|
87
|
-
|
|
88
|
-
registry.dispatch( editSiteStore ).setIsListViewOpened( false );
|
|
89
|
-
expect( registry.select( editSiteStore ).isListViewOpened() ).toBe(
|
|
90
|
-
false
|
|
91
|
-
);
|
|
92
|
-
} );
|
|
93
|
-
it( 'should turn off distraction free mode when opening the list view', () => {
|
|
94
|
-
const registry = createRegistryWithStores();
|
|
95
|
-
registry
|
|
96
|
-
.dispatch( preferencesStore )
|
|
97
|
-
.set( 'core/edit-site', 'distractionFree', true );
|
|
98
|
-
registry.dispatch( editSiteStore ).setIsListViewOpened( true );
|
|
99
|
-
expect(
|
|
100
|
-
registry
|
|
101
|
-
.select( preferencesStore )
|
|
102
|
-
.get( 'core/edit-site', 'distractionFree' )
|
|
103
|
-
).toBe( false );
|
|
104
|
-
} );
|
|
105
|
-
} );
|
|
106
|
-
|
|
107
79
|
describe( 'openGeneralSidebar', () => {
|
|
108
80
|
it( 'should turn off distraction free mode when opening a general sidebar', () => {
|
|
109
81
|
const registry = createRegistryWithStores();
|
|
110
82
|
registry
|
|
111
83
|
.dispatch( preferencesStore )
|
|
112
|
-
.set( 'core
|
|
84
|
+
.set( 'core', 'distractionFree', true );
|
|
113
85
|
registry
|
|
114
86
|
.dispatch( editSiteStore )
|
|
115
87
|
.openGeneralSidebar( 'edit-site/global-styles' );
|
|
116
88
|
expect(
|
|
117
89
|
registry
|
|
118
90
|
.select( preferencesStore )
|
|
119
|
-
.get( 'core
|
|
91
|
+
.get( 'core', 'distractionFree' )
|
|
120
92
|
).toBe( false );
|
|
121
93
|
} );
|
|
122
94
|
} );
|
|
@@ -126,18 +98,18 @@ describe( 'actions', () => {
|
|
|
126
98
|
const registry = createRegistryWithStores();
|
|
127
99
|
registry
|
|
128
100
|
.dispatch( preferencesStore )
|
|
129
|
-
.set( 'core
|
|
101
|
+
.set( 'core', 'distractionFree', true );
|
|
130
102
|
registry.dispatch( editSiteStore ).switchEditorMode( 'visual' );
|
|
131
103
|
expect(
|
|
132
104
|
registry
|
|
133
105
|
.select( preferencesStore )
|
|
134
|
-
.get( 'core
|
|
106
|
+
.get( 'core', 'distractionFree' )
|
|
135
107
|
).toBe( true );
|
|
136
108
|
registry.dispatch( editSiteStore ).switchEditorMode( 'text' );
|
|
137
109
|
expect(
|
|
138
110
|
registry
|
|
139
111
|
.select( preferencesStore )
|
|
140
|
-
.get( 'core
|
|
112
|
+
.get( 'core', 'distractionFree' )
|
|
141
113
|
).toBe( false );
|
|
142
114
|
} );
|
|
143
115
|
} );
|
|
@@ -148,8 +120,8 @@ describe( 'actions', () => {
|
|
|
148
120
|
// Enable everything that shouldn't be enabled in distraction free mode.
|
|
149
121
|
registry
|
|
150
122
|
.dispatch( preferencesStore )
|
|
151
|
-
.set( 'core
|
|
152
|
-
registry.dispatch(
|
|
123
|
+
.set( 'core', 'fixedToolbar', true );
|
|
124
|
+
registry.dispatch( editorStore ).setIsListViewOpened( true );
|
|
153
125
|
registry
|
|
154
126
|
.dispatch( editSiteStore )
|
|
155
127
|
.openGeneralSidebar( 'edit-site/global-styles' );
|
|
@@ -158,12 +130,12 @@ describe( 'actions', () => {
|
|
|
158
130
|
expect(
|
|
159
131
|
registry
|
|
160
132
|
.select( preferencesStore )
|
|
161
|
-
.get( 'core
|
|
133
|
+
.get( 'core', 'fixedToolbar' )
|
|
162
134
|
).toBe( true );
|
|
163
|
-
expect( registry.select(
|
|
135
|
+
expect( registry.select( editorStore ).isListViewOpened() ).toBe(
|
|
164
136
|
false
|
|
165
137
|
);
|
|
166
|
-
expect( registry.select(
|
|
138
|
+
expect( registry.select( editorStore ).isInserterOpened() ).toBe(
|
|
167
139
|
false
|
|
168
140
|
);
|
|
169
141
|
expect(
|
|
@@ -174,7 +146,7 @@ describe( 'actions', () => {
|
|
|
174
146
|
expect(
|
|
175
147
|
registry
|
|
176
148
|
.select( preferencesStore )
|
|
177
|
-
.get( 'core
|
|
149
|
+
.get( 'core', 'distractionFree' )
|
|
178
150
|
).toBe( true );
|
|
179
151
|
} );
|
|
180
152
|
} );
|
|
@@ -6,14 +6,7 @@ import deepFreeze from 'deep-freeze';
|
|
|
6
6
|
/**
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
|
-
import {
|
|
10
|
-
settings,
|
|
11
|
-
editedPost,
|
|
12
|
-
blockInserterPanel,
|
|
13
|
-
listViewPanel,
|
|
14
|
-
} from '../reducer';
|
|
15
|
-
|
|
16
|
-
import { setIsInserterOpened } from '../actions';
|
|
9
|
+
import { settings, editedPost } from '../reducer';
|
|
17
10
|
|
|
18
11
|
describe( 'state', () => {
|
|
19
12
|
describe( 'settings()', () => {
|
|
@@ -73,78 +66,4 @@ describe( 'state', () => {
|
|
|
73
66
|
} );
|
|
74
67
|
} );
|
|
75
68
|
} );
|
|
76
|
-
|
|
77
|
-
describe( 'blockInserterPanel()', () => {
|
|
78
|
-
it( 'should apply default state', () => {
|
|
79
|
-
expect( blockInserterPanel( undefined, {} ) ).toEqual( false );
|
|
80
|
-
} );
|
|
81
|
-
|
|
82
|
-
it( 'should default to returning the same state', () => {
|
|
83
|
-
expect( blockInserterPanel( true, {} ) ).toBe( true );
|
|
84
|
-
} );
|
|
85
|
-
|
|
86
|
-
it( 'should set the open state of the inserter panel', () => {
|
|
87
|
-
expect(
|
|
88
|
-
blockInserterPanel( false, setIsInserterOpened( true ) )
|
|
89
|
-
).toBe( true );
|
|
90
|
-
expect(
|
|
91
|
-
blockInserterPanel( true, setIsInserterOpened( false ) )
|
|
92
|
-
).toBe( false );
|
|
93
|
-
} );
|
|
94
|
-
|
|
95
|
-
it( 'should close the inserter when opening the list view panel', () => {
|
|
96
|
-
expect(
|
|
97
|
-
blockInserterPanel( true, {
|
|
98
|
-
type: 'SET_IS_LIST_VIEW_OPENED',
|
|
99
|
-
isOpen: true,
|
|
100
|
-
} )
|
|
101
|
-
).toBe( false );
|
|
102
|
-
} );
|
|
103
|
-
|
|
104
|
-
it( 'should not change the state when closing the list view panel', () => {
|
|
105
|
-
expect(
|
|
106
|
-
blockInserterPanel( true, {
|
|
107
|
-
type: 'SET_IS_LIST_VIEW_OPENED',
|
|
108
|
-
isOpen: false,
|
|
109
|
-
} )
|
|
110
|
-
).toBe( true );
|
|
111
|
-
} );
|
|
112
|
-
} );
|
|
113
|
-
|
|
114
|
-
describe( 'listViewPanel()', () => {
|
|
115
|
-
it( 'should apply default state', () => {
|
|
116
|
-
expect( listViewPanel( undefined, {} ) ).toEqual( false );
|
|
117
|
-
} );
|
|
118
|
-
|
|
119
|
-
it( 'should default to returning the same state', () => {
|
|
120
|
-
expect( listViewPanel( true, {} ) ).toBe( true );
|
|
121
|
-
} );
|
|
122
|
-
|
|
123
|
-
it( 'should set the open state of the list view panel', () => {
|
|
124
|
-
expect(
|
|
125
|
-
listViewPanel( false, {
|
|
126
|
-
type: 'SET_IS_LIST_VIEW_OPENED',
|
|
127
|
-
isOpen: true,
|
|
128
|
-
} )
|
|
129
|
-
).toBe( true );
|
|
130
|
-
expect(
|
|
131
|
-
listViewPanel( true, {
|
|
132
|
-
type: 'SET_IS_LIST_VIEW_OPENED',
|
|
133
|
-
isOpen: false,
|
|
134
|
-
} )
|
|
135
|
-
).toBe( false );
|
|
136
|
-
} );
|
|
137
|
-
|
|
138
|
-
it( 'should close the list view when opening the inserter panel', () => {
|
|
139
|
-
expect( listViewPanel( true, setIsInserterOpened( true ) ) ).toBe(
|
|
140
|
-
false
|
|
141
|
-
);
|
|
142
|
-
} );
|
|
143
|
-
|
|
144
|
-
it( 'should not change the state when closing the inserter panel', () => {
|
|
145
|
-
expect( listViewPanel( true, setIsInserterOpened( false ) ) ).toBe(
|
|
146
|
-
true
|
|
147
|
-
);
|
|
148
|
-
} );
|
|
149
|
-
} );
|
|
150
69
|
} );
|
|
@@ -10,8 +10,6 @@ import {
|
|
|
10
10
|
getCanUserCreateMedia,
|
|
11
11
|
getEditedPostType,
|
|
12
12
|
getEditedPostId,
|
|
13
|
-
isInserterOpened,
|
|
14
|
-
isListViewOpened,
|
|
15
13
|
isPage,
|
|
16
14
|
} from '../selectors';
|
|
17
15
|
|
|
@@ -45,28 +43,6 @@ describe( 'selectors', () => {
|
|
|
45
43
|
} );
|
|
46
44
|
} );
|
|
47
45
|
|
|
48
|
-
describe( 'isInserterOpened', () => {
|
|
49
|
-
it( 'returns the block inserter panel isOpened state', () => {
|
|
50
|
-
const state = {
|
|
51
|
-
blockInserterPanel: true,
|
|
52
|
-
};
|
|
53
|
-
expect( isInserterOpened( state ) ).toBe( true );
|
|
54
|
-
state.blockInserterPanel = false;
|
|
55
|
-
expect( isInserterOpened( state ) ).toBe( false );
|
|
56
|
-
} );
|
|
57
|
-
} );
|
|
58
|
-
|
|
59
|
-
describe( 'isListViewOpened', () => {
|
|
60
|
-
it( 'returns the list view panel isOpened state', () => {
|
|
61
|
-
const state = {
|
|
62
|
-
listViewPanel: true,
|
|
63
|
-
};
|
|
64
|
-
expect( isListViewOpened( state ) ).toBe( true );
|
|
65
|
-
state.listViewPanel = false;
|
|
66
|
-
expect( isListViewOpened( state ) ).toBe( false );
|
|
67
|
-
} );
|
|
68
|
-
} );
|
|
69
|
-
|
|
70
46
|
describe( 'isPage', () => {
|
|
71
47
|
it( 'returns true if the edited post type is a page', () => {
|
|
72
48
|
const state = {
|
package/src/style.scss
CHANGED
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
@import "./components/sidebar-edit-mode/template-panel/style.scss";
|
|
22
22
|
@import "./components/editor/style.scss";
|
|
23
23
|
@import "./components/create-template-part-modal/style.scss";
|
|
24
|
-
@import "./components/secondary-sidebar/style.scss";
|
|
25
24
|
@import "./components/welcome-guide/style.scss";
|
|
26
25
|
@import "./components/start-template-options/style.scss";
|
|
27
26
|
@import "./components/keyboard-shortcut-help-modal/style.scss";
|
|
@@ -48,6 +47,7 @@
|
|
|
48
47
|
@import "./components/resizable-frame/style.scss";
|
|
49
48
|
@import "./hooks/push-changes-to-global-styles/style.scss";
|
|
50
49
|
@import "./components/global-styles/font-library-modal/style.scss";
|
|
50
|
+
@import "./components/pagination/style.scss";
|
|
51
51
|
|
|
52
52
|
body.js #wpadminbar {
|
|
53
53
|
display: none;
|
|
@@ -14,9 +14,8 @@ export default function getIsListPage(
|
|
|
14
14
|
isMobileViewport
|
|
15
15
|
) {
|
|
16
16
|
return (
|
|
17
|
-
[ '/wp_template/all', '/wp_template_part/all'
|
|
18
|
-
|
|
19
|
-
) ||
|
|
17
|
+
[ '/wp_template/all', '/wp_template_part/all' ].includes( path ) ||
|
|
18
|
+
( path === '/page' && window?.__experimentalAdminViews ) ||
|
|
20
19
|
( path === '/patterns' &&
|
|
21
20
|
// Don't treat "/patterns" without categoryType and categoryId as a
|
|
22
21
|
// list page in mobile because the sidebar covers the whole page.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_icons","TabLayout","title","description","handleBack","children","footer","_react","createElement","className","__experimentalSpacer","margin","__experimentalVStack","spacing","justify","__experimentalHStack","Button","variant","onClick","icon","chevronLeft","size","__experimentalHeading","level","__experimentalText","_default","exports","default"],"sources":["@wordpress/edit-site/src/components/global-styles/font-library-modal/tab-layout.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalText as Text,\n\t__experimentalHeading as Heading,\n\t__experimentalVStack as VStack,\n\t__experimentalSpacer as Spacer,\n\t__experimentalHStack as HStack,\n\tButton,\n} from '@wordpress/components';\nimport { chevronLeft } from '@wordpress/icons';\n\nfunction TabLayout( { title, description, handleBack, children, footer } ) {\n\treturn (\n\t\t<div className=\"font-library-modal__tab-layout\">\n\t\t\t<Spacer margin={ 4 } />\n\t\t\t<VStack spacing={ 4 } justify=\"space-between\">\n\t\t\t\t<header>\n\t\t\t\t\t<VStack spacing={ 2 }>\n\t\t\t\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t\t\t\t{ !! handleBack && (\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\t\t\tonClick={ handleBack }\n\t\t\t\t\t\t\t\t\ticon={ chevronLeft }\n\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ title && (\n\t\t\t\t\t\t\t\t<Heading\n\t\t\t\t\t\t\t\t\tlevel={ 2 }\n\t\t\t\t\t\t\t\t\tsize={ 13 }\n\t\t\t\t\t\t\t\t\tclassName=\"edit-site-global-styles-header\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t\t\t</Heading>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t{ description && <Text>{ description }</Text> }\n\t\t\t\t\t</VStack>\n\t\t\t\t</header>\n\t\t\t\t<main>{ children }</main>\n\t\t\t\t{ footer && <footer>{ footer }</footer> }\n\t\t\t</VStack>\n\t\t</div>\n\t);\n}\n\nexport default TabLayout;\n"],"mappings":";;;;;;;AA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,MAAgB,CAC/B,CACJ,CAAC;AAER;AAAC,IAAAmB,QAAA,GAEcxB,SAAS;AAAAyB,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = getRevisionChanges;
|
|
7
|
-
var _i18n = require("@wordpress/i18n");
|
|
8
|
-
/**
|
|
9
|
-
* WordPress dependencies
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
const globalStylesChangesCache = new Map();
|
|
13
|
-
const EMPTY_ARRAY = [];
|
|
14
|
-
const translationMap = {
|
|
15
|
-
caption: (0, _i18n.__)('Caption'),
|
|
16
|
-
link: (0, _i18n.__)('Link'),
|
|
17
|
-
button: (0, _i18n.__)('Button'),
|
|
18
|
-
heading: (0, _i18n.__)('Heading'),
|
|
19
|
-
'settings.color': (0, _i18n.__)('Color settings'),
|
|
20
|
-
'settings.typography': (0, _i18n.__)('Typography settings'),
|
|
21
|
-
'styles.color': (0, _i18n.__)('Colors'),
|
|
22
|
-
'styles.spacing': (0, _i18n.__)('Spacing'),
|
|
23
|
-
'styles.typography': (0, _i18n.__)('Typography')
|
|
24
|
-
};
|
|
25
|
-
const isObject = obj => obj !== null && typeof obj === 'object';
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Get the translation for a given global styles key.
|
|
29
|
-
* @param {string} key A key representing a path to a global style property or setting.
|
|
30
|
-
* @param {Record<string,string>} blockNames A key/value pair object of block names and their rendered titles.
|
|
31
|
-
* @return {string|undefined} A translated key or undefined if no translation exists.
|
|
32
|
-
*/
|
|
33
|
-
function getTranslation(key, blockNames) {
|
|
34
|
-
if (translationMap[key]) {
|
|
35
|
-
return translationMap[key];
|
|
36
|
-
}
|
|
37
|
-
const keyArray = key.split('.');
|
|
38
|
-
if (keyArray?.[0] === 'blocks') {
|
|
39
|
-
const blockName = blockNames[keyArray[1]];
|
|
40
|
-
return blockName ? (0, _i18n.sprintf)(
|
|
41
|
-
// translators: %s: block name.
|
|
42
|
-
(0, _i18n.__)('%s block'), blockName) : keyArray[1];
|
|
43
|
-
}
|
|
44
|
-
if (keyArray?.[0] === 'elements') {
|
|
45
|
-
return (0, _i18n.sprintf)(
|
|
46
|
-
// translators: %s: element name, e.g., heading button, link, caption.
|
|
47
|
-
(0, _i18n.__)('%s element'), translationMap[keyArray[1]]);
|
|
48
|
-
}
|
|
49
|
-
return undefined;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* A deep comparison of two objects, optimized for comparing global styles.
|
|
54
|
-
* @param {Object} changedObject The changed object to compare.
|
|
55
|
-
* @param {Object} originalObject The original object to compare against.
|
|
56
|
-
* @param {string} parentPath A key/value pair object of block names and their rendered titles.
|
|
57
|
-
* @return {string[]} An array of paths whose values have changed.
|
|
58
|
-
*/
|
|
59
|
-
function deepCompare(changedObject, originalObject, parentPath = '') {
|
|
60
|
-
// We have two non-object values to compare.
|
|
61
|
-
if (!isObject(changedObject) && !isObject(originalObject)) {
|
|
62
|
-
/*
|
|
63
|
-
* Only return a path if the value has changed.
|
|
64
|
-
* And then only the path name up to 2 levels deep.
|
|
65
|
-
*/
|
|
66
|
-
return changedObject !== originalObject ? parentPath.split('.').slice(0, 2).join('.') : undefined;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// Enable comparison when an object doesn't have a corresponding property to compare.
|
|
70
|
-
changedObject = isObject(changedObject) ? changedObject : {};
|
|
71
|
-
originalObject = isObject(originalObject) ? originalObject : {};
|
|
72
|
-
const allKeys = new Set([...Object.keys(changedObject), ...Object.keys(originalObject)]);
|
|
73
|
-
let diffs = [];
|
|
74
|
-
for (const key of allKeys) {
|
|
75
|
-
const path = parentPath ? parentPath + '.' + key : key;
|
|
76
|
-
const changedPath = deepCompare(changedObject[key], originalObject[key], path);
|
|
77
|
-
if (changedPath) {
|
|
78
|
-
diffs = diffs.concat(changedPath);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
return diffs;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Get an array of translated summarized global styles changes.
|
|
86
|
-
* Results are cached using a Map() key of `JSON.stringify( { revision, previousRevision } )`.
|
|
87
|
-
*
|
|
88
|
-
* @param {Object} revision The changed object to compare.
|
|
89
|
-
* @param {Object} previousRevision The original object to compare against.
|
|
90
|
-
* @param {Record<string,string>} blockNames A key/value pair object of block names and their rendered titles.
|
|
91
|
-
* @return {string[]} An array of translated changes.
|
|
92
|
-
*/
|
|
93
|
-
function getRevisionChanges(revision, previousRevision, blockNames) {
|
|
94
|
-
const cacheKey = JSON.stringify({
|
|
95
|
-
revision,
|
|
96
|
-
previousRevision
|
|
97
|
-
});
|
|
98
|
-
if (globalStylesChangesCache.has(cacheKey)) {
|
|
99
|
-
return globalStylesChangesCache.get(cacheKey);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
/*
|
|
103
|
-
* Compare the two revisions with normalized keys.
|
|
104
|
-
* The order of these keys determines the order in which
|
|
105
|
-
* they'll appear in the results.
|
|
106
|
-
*/
|
|
107
|
-
const changedValueTree = deepCompare({
|
|
108
|
-
styles: {
|
|
109
|
-
color: revision?.styles?.color,
|
|
110
|
-
typography: revision?.styles?.typography,
|
|
111
|
-
spacing: revision?.styles?.spacing
|
|
112
|
-
},
|
|
113
|
-
blocks: revision?.styles?.blocks,
|
|
114
|
-
elements: revision?.styles?.elements,
|
|
115
|
-
settings: revision?.settings
|
|
116
|
-
}, {
|
|
117
|
-
styles: {
|
|
118
|
-
color: previousRevision?.styles?.color,
|
|
119
|
-
typography: previousRevision?.styles?.typography,
|
|
120
|
-
spacing: previousRevision?.styles?.spacing
|
|
121
|
-
},
|
|
122
|
-
blocks: previousRevision?.styles?.blocks,
|
|
123
|
-
elements: previousRevision?.styles?.elements,
|
|
124
|
-
settings: previousRevision?.settings
|
|
125
|
-
});
|
|
126
|
-
if (!changedValueTree.length) {
|
|
127
|
-
globalStylesChangesCache.set(cacheKey, EMPTY_ARRAY);
|
|
128
|
-
return EMPTY_ARRAY;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
// Remove duplicate results.
|
|
132
|
-
const result = [...new Set(changedValueTree)]
|
|
133
|
-
/*
|
|
134
|
-
* Translate the keys.
|
|
135
|
-
* Remove duplicate or empty translations.
|
|
136
|
-
*/.reduce((acc, curr) => {
|
|
137
|
-
const translation = getTranslation(curr, blockNames);
|
|
138
|
-
if (translation && !acc.includes(translation)) {
|
|
139
|
-
acc.push(translation);
|
|
140
|
-
}
|
|
141
|
-
return acc;
|
|
142
|
-
}, []);
|
|
143
|
-
globalStylesChangesCache.set(cacheKey, result);
|
|
144
|
-
return result;
|
|
145
|
-
}
|
|
146
|
-
//# sourceMappingURL=get-revision-changes.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","globalStylesChangesCache","Map","EMPTY_ARRAY","translationMap","caption","__","link","button","heading","isObject","obj","getTranslation","key","blockNames","keyArray","split","blockName","sprintf","undefined","deepCompare","changedObject","originalObject","parentPath","slice","join","allKeys","Set","Object","keys","diffs","path","changedPath","concat","getRevisionChanges","revision","previousRevision","cacheKey","JSON","stringify","has","get","changedValueTree","styles","color","typography","spacing","blocks","elements","settings","length","set","result","reduce","acc","curr","translation","includes","push"],"sources":["@wordpress/edit-site/src/components/global-styles/screen-revisions/get-revision-changes.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\n\nconst globalStylesChangesCache = new Map();\nconst EMPTY_ARRAY = [];\n\nconst translationMap = {\n\tcaption: __( 'Caption' ),\n\tlink: __( 'Link' ),\n\tbutton: __( 'Button' ),\n\theading: __( 'Heading' ),\n\t'settings.color': __( 'Color settings' ),\n\t'settings.typography': __( 'Typography settings' ),\n\t'styles.color': __( 'Colors' ),\n\t'styles.spacing': __( 'Spacing' ),\n\t'styles.typography': __( 'Typography' ),\n};\n\nconst isObject = ( obj ) => obj !== null && typeof obj === 'object';\n\n/**\n * Get the translation for a given global styles key.\n * @param {string} key A key representing a path to a global style property or setting.\n * @param {Record<string,string>} blockNames A key/value pair object of block names and their rendered titles.\n * @return {string|undefined} A translated key or undefined if no translation exists.\n */\nfunction getTranslation( key, blockNames ) {\n\tif ( translationMap[ key ] ) {\n\t\treturn translationMap[ key ];\n\t}\n\n\tconst keyArray = key.split( '.' );\n\n\tif ( keyArray?.[ 0 ] === 'blocks' ) {\n\t\tconst blockName = blockNames[ keyArray[ 1 ] ];\n\t\treturn blockName\n\t\t\t? sprintf(\n\t\t\t\t\t// translators: %s: block name.\n\t\t\t\t\t__( '%s block' ),\n\t\t\t\t\tblockName\n\t\t\t )\n\t\t\t: keyArray[ 1 ];\n\t}\n\n\tif ( keyArray?.[ 0 ] === 'elements' ) {\n\t\treturn sprintf(\n\t\t\t// translators: %s: element name, e.g., heading button, link, caption.\n\t\t\t__( '%s element' ),\n\t\t\ttranslationMap[ keyArray[ 1 ] ]\n\t\t);\n\t}\n\n\treturn undefined;\n}\n\n/**\n * A deep comparison of two objects, optimized for comparing global styles.\n * @param {Object} changedObject The changed object to compare.\n * @param {Object} originalObject The original object to compare against.\n * @param {string} parentPath A key/value pair object of block names and their rendered titles.\n * @return {string[]} An array of paths whose values have changed.\n */\nfunction deepCompare( changedObject, originalObject, parentPath = '' ) {\n\t// We have two non-object values to compare.\n\tif ( ! isObject( changedObject ) && ! isObject( originalObject ) ) {\n\t\t/*\n\t\t * Only return a path if the value has changed.\n\t\t * And then only the path name up to 2 levels deep.\n\t\t */\n\t\treturn changedObject !== originalObject\n\t\t\t? parentPath.split( '.' ).slice( 0, 2 ).join( '.' )\n\t\t\t: undefined;\n\t}\n\n\t// Enable comparison when an object doesn't have a corresponding property to compare.\n\tchangedObject = isObject( changedObject ) ? changedObject : {};\n\toriginalObject = isObject( originalObject ) ? originalObject : {};\n\n\tconst allKeys = new Set( [\n\t\t...Object.keys( changedObject ),\n\t\t...Object.keys( originalObject ),\n\t] );\n\n\tlet diffs = [];\n\tfor ( const key of allKeys ) {\n\t\tconst path = parentPath ? parentPath + '.' + key : key;\n\t\tconst changedPath = deepCompare(\n\t\t\tchangedObject[ key ],\n\t\t\toriginalObject[ key ],\n\t\t\tpath\n\t\t);\n\t\tif ( changedPath ) {\n\t\t\tdiffs = diffs.concat( changedPath );\n\t\t}\n\t}\n\treturn diffs;\n}\n\n/**\n * Get an array of translated summarized global styles changes.\n * Results are cached using a Map() key of `JSON.stringify( { revision, previousRevision } )`.\n *\n * @param {Object} revision The changed object to compare.\n * @param {Object} previousRevision The original object to compare against.\n * @param {Record<string,string>} blockNames A key/value pair object of block names and their rendered titles.\n * @return {string[]} An array of translated changes.\n */\nexport default function getRevisionChanges(\n\trevision,\n\tpreviousRevision,\n\tblockNames\n) {\n\tconst cacheKey = JSON.stringify( { revision, previousRevision } );\n\n\tif ( globalStylesChangesCache.has( cacheKey ) ) {\n\t\treturn globalStylesChangesCache.get( cacheKey );\n\t}\n\n\t/*\n\t * Compare the two revisions with normalized keys.\n\t * The order of these keys determines the order in which\n\t * they'll appear in the results.\n\t */\n\tconst changedValueTree = deepCompare(\n\t\t{\n\t\t\tstyles: {\n\t\t\t\tcolor: revision?.styles?.color,\n\t\t\t\ttypography: revision?.styles?.typography,\n\t\t\t\tspacing: revision?.styles?.spacing,\n\t\t\t},\n\t\t\tblocks: revision?.styles?.blocks,\n\t\t\telements: revision?.styles?.elements,\n\t\t\tsettings: revision?.settings,\n\t\t},\n\t\t{\n\t\t\tstyles: {\n\t\t\t\tcolor: previousRevision?.styles?.color,\n\t\t\t\ttypography: previousRevision?.styles?.typography,\n\t\t\t\tspacing: previousRevision?.styles?.spacing,\n\t\t\t},\n\t\t\tblocks: previousRevision?.styles?.blocks,\n\t\t\telements: previousRevision?.styles?.elements,\n\t\t\tsettings: previousRevision?.settings,\n\t\t}\n\t);\n\n\tif ( ! changedValueTree.length ) {\n\t\tglobalStylesChangesCache.set( cacheKey, EMPTY_ARRAY );\n\t\treturn EMPTY_ARRAY;\n\t}\n\n\t// Remove duplicate results.\n\tconst result = [ ...new Set( changedValueTree ) ]\n\t\t/*\n\t\t * Translate the keys.\n\t\t * Remove duplicate or empty translations.\n\t\t */\n\t\t.reduce( ( acc, curr ) => {\n\t\t\tconst translation = getTranslation( curr, blockNames );\n\t\t\tif ( translation && ! acc.includes( translation ) ) {\n\t\t\t\tacc.push( translation );\n\t\t\t}\n\t\t\treturn acc;\n\t\t}, [] );\n\n\tglobalStylesChangesCache.set( cacheKey, result );\n\n\treturn result;\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA,MAAMC,wBAAwB,GAAG,IAAIC,GAAG,CAAC,CAAC;AAC1C,MAAMC,WAAW,GAAG,EAAE;AAEtB,MAAMC,cAAc,GAAG;EACtBC,OAAO,EAAE,IAAAC,QAAE,EAAE,SAAU,CAAC;EACxBC,IAAI,EAAE,IAAAD,QAAE,EAAE,MAAO,CAAC;EAClBE,MAAM,EAAE,IAAAF,QAAE,EAAE,QAAS,CAAC;EACtBG,OAAO,EAAE,IAAAH,QAAE,EAAE,SAAU,CAAC;EACxB,gBAAgB,EAAE,IAAAA,QAAE,EAAE,gBAAiB,CAAC;EACxC,qBAAqB,EAAE,IAAAA,QAAE,EAAE,qBAAsB,CAAC;EAClD,cAAc,EAAE,IAAAA,QAAE,EAAE,QAAS,CAAC;EAC9B,gBAAgB,EAAE,IAAAA,QAAE,EAAE,SAAU,CAAC;EACjC,mBAAmB,EAAE,IAAAA,QAAE,EAAE,YAAa;AACvC,CAAC;AAED,MAAMI,QAAQ,GAAKC,GAAG,IAAMA,GAAG,KAAK,IAAI,IAAI,OAAOA,GAAG,KAAK,QAAQ;;AAEnE;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,cAAcA,CAAEC,GAAG,EAAEC,UAAU,EAAG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