@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
package/CHANGELOG.md
CHANGED
package/LICENSE.md
CHANGED
|
@@ -28,9 +28,10 @@ function BackButton() {
|
|
|
28
28
|
const history = useHistory();
|
|
29
29
|
const isTemplatePart = location.params.postType === _constants.TEMPLATE_PART_POST_TYPE;
|
|
30
30
|
const isNavigationMenu = location.params.postType === _constants.NAVIGATION_POST_TYPE;
|
|
31
|
+
const isPattern = location.params.postType === _constants.PATTERN_TYPES.user;
|
|
31
32
|
const previousTemplateId = location.state?.fromTemplateId;
|
|
32
|
-
const isFocusMode = isTemplatePart || isNavigationMenu;
|
|
33
|
-
if (!isFocusMode || !previousTemplateId) {
|
|
33
|
+
const isFocusMode = isTemplatePart || isNavigationMenu || isPattern;
|
|
34
|
+
if (!isFocusMode || !previousTemplateId && !isPattern) {
|
|
34
35
|
return null;
|
|
35
36
|
}
|
|
36
37
|
return (0, _react.createElement)(_components.Button, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_icons","_i18n","_router","_constants","_lockUnlock","useLocation","useHistory","unlock","routerPrivateApis","BackButton","location","history","isTemplatePart","params","postType","TEMPLATE_PART_POST_TYPE","isNavigationMenu","NAVIGATION_POST_TYPE","previousTemplateId","state","fromTemplateId","isFocusMode","_react","createElement","Button","className","icon","arrowLeft","onClick","back","__","_default","exports","default"],"sources":["@wordpress/edit-site/src/components/block-editor/back-button.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { arrowLeft } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport {\n\tTEMPLATE_PART_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n} from '../../utils/constants';\nimport { unlock } from '../../lock-unlock';\n\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\n\nfunction BackButton() {\n\tconst location = useLocation();\n\tconst history = useHistory();\n\tconst isTemplatePart = location.params.postType === TEMPLATE_PART_POST_TYPE;\n\tconst isNavigationMenu = location.params.postType === NAVIGATION_POST_TYPE;\n\tconst previousTemplateId = location.state?.fromTemplateId;\n\n\tconst isFocusMode = isTemplatePart || isNavigationMenu;\n\n\tif ( ! isFocusMode || ! previousTemplateId ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Button\n\t\t\tclassName=\"edit-site-visual-editor__back-button\"\n\t\t\ticon={ arrowLeft }\n\t\t\tonClick={ () => {\n\t\t\t\thistory.back();\n\t\t\t} }\n\t\t>\n\t\t\t{ __( 'Back' ) }\n\t\t</Button>\n\t);\n}\n\nexport default BackButton;\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAKA,IAAAI,UAAA,GAAAJ,OAAA;
|
|
1
|
+
{"version":3,"names":["_components","require","_icons","_i18n","_router","_constants","_lockUnlock","useLocation","useHistory","unlock","routerPrivateApis","BackButton","location","history","isTemplatePart","params","postType","TEMPLATE_PART_POST_TYPE","isNavigationMenu","NAVIGATION_POST_TYPE","isPattern","PATTERN_TYPES","user","previousTemplateId","state","fromTemplateId","isFocusMode","_react","createElement","Button","className","icon","arrowLeft","onClick","back","__","_default","exports","default"],"sources":["@wordpress/edit-site/src/components/block-editor/back-button.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { arrowLeft } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport {\n\tTEMPLATE_PART_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n\tPATTERN_TYPES,\n} from '../../utils/constants';\nimport { unlock } from '../../lock-unlock';\n\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\n\nfunction BackButton() {\n\tconst location = useLocation();\n\tconst history = useHistory();\n\tconst isTemplatePart = location.params.postType === TEMPLATE_PART_POST_TYPE;\n\tconst isNavigationMenu = location.params.postType === NAVIGATION_POST_TYPE;\n\tconst isPattern = location.params.postType === PATTERN_TYPES.user;\n\tconst previousTemplateId = location.state?.fromTemplateId;\n\n\tconst isFocusMode = isTemplatePart || isNavigationMenu || isPattern;\n\n\tif ( ! isFocusMode || ( ! previousTemplateId && ! isPattern ) ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Button\n\t\t\tclassName=\"edit-site-visual-editor__back-button\"\n\t\t\ticon={ arrowLeft }\n\t\t\tonClick={ () => {\n\t\t\t\thistory.back();\n\t\t\t} }\n\t\t>\n\t\t\t{ __( 'Back' ) }\n\t\t</Button>\n\t);\n}\n\nexport default BackButton;\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAKA,IAAAI,UAAA,GAAAJ,OAAA;AAKA,IAAAK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|
61
61
|
},
|
|
62
62
|
showHandle: enableResizing
|
|
63
63
|
// The editor is centered horizontally, resizing it only
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_components","_resizeHandle","_interopRequireDefault","HANDLE_STYLES_OVERRIDE","position","undefined","userSelect","cursor","width","height","top","right","bottom","left","ResizableEditor","enableResizing","children","setWidth","useState","resizableRef","useRef","resizeWidthBy","useCallback","deltaPixels","current","offsetWidth","_react","createElement","ResizableBox","ref","api","resizable","size","onResizeStop","event","direction","element","style","minWidth","maxWidth","maxHeight","enable","showHandle","resizeRatio","handleComponent","default","handleClasses","handleStyles","_default","exports"],"sources":["@wordpress/edit-site/src/components/block-editor/resizable-editor.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useRef, useCallback } from '@wordpress/element';\nimport { ResizableBox } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport ResizeHandle from './resize-handle';\n\n// Removes the inline styles in the drag handles.\nconst HANDLE_STYLES_OVERRIDE = {\n\tposition: undefined,\n\tuserSelect: undefined,\n\tcursor: undefined,\n\twidth: undefined,\n\theight: undefined,\n\ttop: undefined,\n\tright: undefined,\n\tbottom: undefined,\n\tleft: undefined,\n};\n\nfunction ResizableEditor( { enableResizing, height, children } ) {\n\tconst [ width, setWidth ] = useState( '100%' );\n\tconst resizableRef = useRef();\n\tconst resizeWidthBy = useCallback( ( deltaPixels ) => {\n\t\tif ( resizableRef.current ) {\n\t\t\tsetWidth( resizableRef.current.offsetWidth + deltaPixels );\n\t\t}\n\t}, [] );\n\treturn (\n\t\t<ResizableBox\n\t\t\tref={ ( api ) => {\n\t\t\t\tresizableRef.current = api?.resizable;\n\t\t\t} }\n\t\t\tsize={ {\n\t\t\t\twidth: enableResizing ? width : '100%',\n\t\t\t\theight: enableResizing && height ? height : '100%',\n\t\t\t} }\n\t\t\tonResizeStop={ ( event, direction, element ) => {\n\t\t\t\tsetWidth( element.style.width );\n\t\t\t} }\n\t\t\tminWidth={ 300 }\n\t\t\tmaxWidth=\"100%\"\n\t\t\tmaxHeight=\"100%\"\n\t\t\tenable={ {\n\t\t\t\
|
|
1
|
+
{"version":3,"names":["_element","require","_components","_resizeHandle","_interopRequireDefault","HANDLE_STYLES_OVERRIDE","position","undefined","userSelect","cursor","width","height","top","right","bottom","left","ResizableEditor","enableResizing","children","setWidth","useState","resizableRef","useRef","resizeWidthBy","useCallback","deltaPixels","current","offsetWidth","_react","createElement","ResizableBox","ref","api","resizable","size","onResizeStop","event","direction","element","style","minWidth","maxWidth","maxHeight","enable","showHandle","resizeRatio","handleComponent","default","handleClasses","handleStyles","_default","exports"],"sources":["@wordpress/edit-site/src/components/block-editor/resizable-editor.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useRef, useCallback } from '@wordpress/element';\nimport { ResizableBox } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport ResizeHandle from './resize-handle';\n\n// Removes the inline styles in the drag handles.\nconst HANDLE_STYLES_OVERRIDE = {\n\tposition: undefined,\n\tuserSelect: undefined,\n\tcursor: undefined,\n\twidth: undefined,\n\theight: undefined,\n\ttop: undefined,\n\tright: undefined,\n\tbottom: undefined,\n\tleft: undefined,\n};\n\nfunction ResizableEditor( { enableResizing, height, children } ) {\n\tconst [ width, setWidth ] = useState( '100%' );\n\tconst resizableRef = useRef();\n\tconst resizeWidthBy = useCallback( ( deltaPixels ) => {\n\t\tif ( resizableRef.current ) {\n\t\t\tsetWidth( resizableRef.current.offsetWidth + deltaPixels );\n\t\t}\n\t}, [] );\n\treturn (\n\t\t<ResizableBox\n\t\t\tref={ ( api ) => {\n\t\t\t\tresizableRef.current = api?.resizable;\n\t\t\t} }\n\t\t\tsize={ {\n\t\t\t\twidth: enableResizing ? width : '100%',\n\t\t\t\theight: enableResizing && height ? height : '100%',\n\t\t\t} }\n\t\t\tonResizeStop={ ( event, direction, element ) => {\n\t\t\t\tsetWidth( element.style.width );\n\t\t\t} }\n\t\t\tminWidth={ 300 }\n\t\t\tmaxWidth=\"100%\"\n\t\t\tmaxHeight=\"100%\"\n\t\t\tenable={ {\n\t\t\t\tleft: enableResizing,\n\t\t\t\tright: enableResizing,\n\t\t\t} }\n\t\t\tshowHandle={ enableResizing }\n\t\t\t// The editor is centered horizontally, resizing it only\n\t\t\t// moves half the distance. Hence double the ratio to correctly\n\t\t\t// align the cursor to the resizer handle.\n\t\t\tresizeRatio={ 2 }\n\t\t\thandleComponent={ {\n\t\t\t\tleft: (\n\t\t\t\t\t<ResizeHandle\n\t\t\t\t\t\tdirection=\"left\"\n\t\t\t\t\t\tresizeWidthBy={ resizeWidthBy }\n\t\t\t\t\t/>\n\t\t\t\t),\n\t\t\t\tright: (\n\t\t\t\t\t<ResizeHandle\n\t\t\t\t\t\tdirection=\"right\"\n\t\t\t\t\t\tresizeWidthBy={ resizeWidthBy }\n\t\t\t\t\t/>\n\t\t\t\t),\n\t\t\t} }\n\t\t\thandleClasses={ undefined }\n\t\t\thandleStyles={ {\n\t\t\t\tleft: HANDLE_STYLES_OVERRIDE,\n\t\t\t\tright: HANDLE_STYLES_OVERRIDE,\n\t\t\t} }\n\t\t>\n\t\t\t{ children }\n\t\t</ResizableBox>\n\t);\n}\n\nexport default ResizableEditor;\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAKA,IAAAE,aAAA,GAAAC,sBAAA,CAAAH,OAAA;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGA;AACA,MAAMI,sBAAsB,GAAG;EAC9BC,QAAQ,EAAEC,SAAS;EACnBC,UAAU,EAAED,SAAS;EACrBE,MAAM,EAAEF,SAAS;EACjBG,KAAK,EAAEH,SAAS;EAChBI,MAAM,EAAEJ,SAAS;EACjBK,GAAG,EAAEL,SAAS;EACdM,KAAK,EAAEN,SAAS;EAChBO,MAAM,EAAEP,SAAS;EACjBQ,IAAI,EAAER;AACP,CAAC;AAED,SAASS,eAAeA,CAAE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J,IAAAe,MAAA,CAAAC,aAAA,EAAC1B,aAAA,CAAA4C,OAAY;QACZV,SAAS,EAAC,OAAO;QACjBd,aAAa,EAAGA;MAAe,CAC/B;IAEH,CAAG;IACHyB,aAAa,EAAGzC,SAAW;IAC3B0C,YAAY,EAAG;MACdlC,IAAI,EAAEV,sBAAsB;MAC5BQ,KAAK,EAAER;IACR;EAAG,GAEDa,QACW,CAAC;AAEjB;AAAC,IAAAgC,QAAA,GAEclC,eAAe;AAAAmC,OAAA,CAAAJ,OAAA,GAAAG,QAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.usePostLinkProps = usePostLinkProps;
|
|
7
|
+
var _router = require("@wordpress/router");
|
|
8
|
+
var _lockUnlock = require("../../lock-unlock");
|
|
9
|
+
var _link = require("../routes/link");
|
|
10
|
+
/**
|
|
11
|
+
* WordPress dependencies
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Internal dependencies
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
const {
|
|
19
|
+
useHistory
|
|
20
|
+
} = (0, _lockUnlock.unlock)(_router.privateApis);
|
|
21
|
+
function usePostLinkProps() {
|
|
22
|
+
const history = useHistory();
|
|
23
|
+
return (params, state) => {
|
|
24
|
+
return (0, _link.getPostLinkProps)(history, params, state);
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=use-post-link-props.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_router","require","_lockUnlock","_link","useHistory","unlock","routerPrivateApis","usePostLinkProps","history","params","state","getPostLinkProps"],"sources":["@wordpress/edit-site/src/components/block-editor/use-post-link-props.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { getPostLinkProps } from '../routes/link';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nexport function usePostLinkProps() {\n\tconst history = useHistory();\n\n\treturn ( params, state ) => {\n\t\treturn getPostLinkProps( history, params, state );\n\t};\n}\n"],"mappings":";;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAGA;AACA;AACA;;AAIA,MAAM;EAAEG;AAAW,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAE3C,SAASC,gBAAgBA,CAAA,EAAG;EAClC,MAAMC,OAAO,GAAGJ,UAAU,CAAC,CAAC;EAE5B,OAAO,CAAEK,MAAM,EAAEC,KAAK,KAAM;IAC3B,OAAO,IAAAC,sBAAgB,EAAEH,OAAO,EAAEC,MAAM,EAAEC,KAAM,CAAC;EAClD,CAAC;AACF"}
|
|
@@ -5,14 +5,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = useSiteEditorSettings;
|
|
7
7
|
exports.useSpecificEditorSettings = useSpecificEditorSettings;
|
|
8
|
-
var _compose = require("@wordpress/compose");
|
|
9
8
|
var _data = require("@wordpress/data");
|
|
10
9
|
var _element = require("@wordpress/element");
|
|
11
10
|
var _coreData = require("@wordpress/core-data");
|
|
12
11
|
var _editor = require("@wordpress/editor");
|
|
13
|
-
var _preferences = require("@wordpress/preferences");
|
|
14
12
|
var _store = require("../../store");
|
|
15
13
|
var _lockUnlock = require("../../lock-unlock");
|
|
14
|
+
var _usePostLinkProps = require("./use-post-link-props");
|
|
16
15
|
/**
|
|
17
16
|
* WordPress dependencies
|
|
18
17
|
*/
|
|
@@ -91,16 +90,9 @@ function useArchiveLabel(templateSlug) {
|
|
|
91
90
|
}, [authorSlug, isAuthor, taxonomy, term]);
|
|
92
91
|
}
|
|
93
92
|
function useSpecificEditorSettings() {
|
|
94
|
-
const
|
|
95
|
-
setIsInserterOpened
|
|
96
|
-
} = (0, _data.useDispatch)(_store.store);
|
|
97
|
-
const isLargeViewport = (0, _compose.useViewportMatch)('medium');
|
|
93
|
+
const getPostLinkProps = (0, _usePostLinkProps.usePostLinkProps)();
|
|
98
94
|
const {
|
|
99
95
|
templateSlug,
|
|
100
|
-
focusMode,
|
|
101
|
-
isDistractionFree,
|
|
102
|
-
hasFixedToolbar,
|
|
103
|
-
keepCaretInsideBlock,
|
|
104
96
|
canvasMode,
|
|
105
97
|
settings,
|
|
106
98
|
postWithTemplate
|
|
@@ -112,9 +104,6 @@ function useSpecificEditorSettings() {
|
|
|
112
104
|
getCanvasMode,
|
|
113
105
|
getSettings
|
|
114
106
|
} = (0, _lockUnlock.unlock)(select(_store.store));
|
|
115
|
-
const {
|
|
116
|
-
get: getPreference
|
|
117
|
-
} = select(_preferences.store);
|
|
118
107
|
const {
|
|
119
108
|
getEditedEntityRecord
|
|
120
109
|
} = select(_coreData.store);
|
|
@@ -124,32 +113,26 @@ function useSpecificEditorSettings() {
|
|
|
124
113
|
const _context = getEditedPostContext();
|
|
125
114
|
return {
|
|
126
115
|
templateSlug: _record.slug,
|
|
127
|
-
focusMode: !!getPreference('core/edit-site', 'focusMode'),
|
|
128
|
-
isDistractionFree: !!getPreference('core/edit-site', 'distractionFree'),
|
|
129
|
-
hasFixedToolbar: !!getPreference('core/edit-site', 'fixedToolbar') || !isLargeViewport,
|
|
130
|
-
keepCaretInsideBlock: !!getPreference('core/edit-site', 'keepCaretInsideBlock'),
|
|
131
116
|
canvasMode: getCanvasMode(),
|
|
132
117
|
settings: getSettings(),
|
|
133
118
|
postWithTemplate: _context?.postId
|
|
134
119
|
};
|
|
135
|
-
}, [
|
|
120
|
+
}, []);
|
|
136
121
|
const archiveLabels = useArchiveLabel(templateSlug);
|
|
137
122
|
const defaultRenderingMode = postWithTemplate ? 'template-locked' : 'all';
|
|
138
123
|
const defaultEditorSettings = (0, _element.useMemo)(() => {
|
|
139
124
|
return {
|
|
140
125
|
...settings,
|
|
126
|
+
richEditingEnabled: true,
|
|
141
127
|
supportsTemplateMode: true,
|
|
142
|
-
|
|
143
|
-
focusMode: canvasMode === 'view' && focusMode ? false : focusMode,
|
|
144
|
-
isDistractionFree,
|
|
145
|
-
hasFixedToolbar,
|
|
146
|
-
keepCaretInsideBlock,
|
|
128
|
+
focusMode: canvasMode !== 'view',
|
|
147
129
|
defaultRenderingMode,
|
|
130
|
+
getPostLinkProps,
|
|
148
131
|
// I wonder if they should be set in the post editor too
|
|
149
132
|
__experimentalArchiveTitleTypeLabel: archiveLabels.archiveTypeLabel,
|
|
150
133
|
__experimentalArchiveTitleNameLabel: archiveLabels.archiveNameLabel
|
|
151
134
|
};
|
|
152
|
-
}, [settings,
|
|
135
|
+
}, [settings, canvasMode, defaultRenderingMode, getPostLinkProps, archiveLabels.archiveTypeLabel, archiveLabels.archiveNameLabel]);
|
|
153
136
|
return defaultEditorSettings;
|
|
154
137
|
}
|
|
155
138
|
function useSiteEditorSettings() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_compose","require","_data","_element","_coreData","_editor","_preferences","_store","_lockUnlock","useBlockEditorSettings","unlock","editorPrivateApis","useArchiveLabel","templateSlug","taxonomyMatches","match","taxonomy","term","isAuthor","authorSlug","authorMatches","useSelect","select","getEntityRecords","getTaxonomy","getAuthors","coreStore","archiveTypeLabel","archiveNameLabel","labels","singular_name","records","slug","per_page","name","authorRecords","useSpecificEditorSettings","setIsInserterOpened","useDispatch","editSiteStore","isLargeViewport","useViewportMatch","focusMode","isDistractionFree","hasFixedToolbar","keepCaretInsideBlock","canvasMode","settings","postWithTemplate","getEditedPostType","getEditedPostId","getEditedPostContext","getCanvasMode","getSettings","get","getPreference","preferencesStore","getEditedEntityRecord","usedPostType","usedPostId","_record","_context","postId","archiveLabels","defaultRenderingMode","defaultEditorSettings","useMemo","supportsTemplateMode","__experimentalSetIsInserterOpened","__experimentalArchiveTitleTypeLabel","__experimentalArchiveTitleNameLabel","useSiteEditorSettings","postType"],"sources":["@wordpress/edit-site/src/components/block-editor/use-site-editor-settings.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { useBlockEditorSettings } = unlock( editorPrivateApis );\n\nfunction useArchiveLabel( templateSlug ) {\n\tconst taxonomyMatches = templateSlug?.match(\n\t\t/^(category|tag|taxonomy-([^-]+))$|^(((category|tag)|taxonomy-([^-]+))-(.+))$/\n\t);\n\tlet taxonomy;\n\tlet term;\n\tlet isAuthor = false;\n\tlet authorSlug;\n\tif ( taxonomyMatches ) {\n\t\t// If is for a all taxonomies of a type\n\t\tif ( taxonomyMatches[ 1 ] ) {\n\t\t\ttaxonomy = taxonomyMatches[ 2 ]\n\t\t\t\t? taxonomyMatches[ 2 ]\n\t\t\t\t: taxonomyMatches[ 1 ];\n\t\t}\n\t\t// If is for a all taxonomies of a type\n\t\telse if ( taxonomyMatches[ 3 ] ) {\n\t\t\ttaxonomy = taxonomyMatches[ 6 ]\n\t\t\t\t? taxonomyMatches[ 6 ]\n\t\t\t\t: taxonomyMatches[ 4 ];\n\t\t\tterm = taxonomyMatches[ 7 ];\n\t\t}\n\t\ttaxonomy = taxonomy === 'tag' ? 'post_tag' : taxonomy;\n\n\t\t//getTaxonomy( 'category' );\n\t\t//wp.data.select('core').getEntityRecords( 'taxonomy', 'category', {slug: 'newcat'} );\n\t} else {\n\t\tconst authorMatches = templateSlug?.match( /^(author)$|^author-(.+)$/ );\n\t\tif ( authorMatches ) {\n\t\t\tisAuthor = true;\n\t\t\tif ( authorMatches[ 2 ] ) {\n\t\t\t\tauthorSlug = authorMatches[ 2 ];\n\t\t\t}\n\t\t}\n\t}\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecords, getTaxonomy, getAuthors } =\n\t\t\t\tselect( coreStore );\n\t\t\tlet archiveTypeLabel;\n\t\t\tlet archiveNameLabel;\n\t\t\tif ( taxonomy ) {\n\t\t\t\tarchiveTypeLabel =\n\t\t\t\t\tgetTaxonomy( taxonomy )?.labels?.singular_name;\n\t\t\t}\n\t\t\tif ( term ) {\n\t\t\t\tconst records = getEntityRecords( 'taxonomy', taxonomy, {\n\t\t\t\t\tslug: term,\n\t\t\t\t\tper_page: 1,\n\t\t\t\t} );\n\t\t\t\tif ( records && records[ 0 ] ) {\n\t\t\t\t\tarchiveNameLabel = records[ 0 ].name;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( isAuthor ) {\n\t\t\t\tarchiveTypeLabel = 'Author';\n\t\t\t\tif ( authorSlug ) {\n\t\t\t\t\tconst authorRecords = getAuthors( { slug: authorSlug } );\n\t\t\t\t\tif ( authorRecords && authorRecords[ 0 ] ) {\n\t\t\t\t\t\tarchiveNameLabel = authorRecords[ 0 ].name;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tarchiveTypeLabel,\n\t\t\t\tarchiveNameLabel,\n\t\t\t};\n\t\t},\n\t\t[ authorSlug, isAuthor, taxonomy, term ]\n\t);\n}\n\nexport function useSpecificEditorSettings() {\n\tconst { setIsInserterOpened } = useDispatch( editSiteStore );\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst {\n\t\ttemplateSlug,\n\t\tfocusMode,\n\t\tisDistractionFree,\n\t\thasFixedToolbar,\n\t\tkeepCaretInsideBlock,\n\t\tcanvasMode,\n\t\tsettings,\n\t\tpostWithTemplate,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetEditedPostType,\n\t\t\t\tgetEditedPostId,\n\t\t\t\tgetEditedPostContext,\n\t\t\t\tgetCanvasMode,\n\t\t\t\tgetSettings,\n\t\t\t} = unlock( select( editSiteStore ) );\n\t\t\tconst { get: getPreference } = select( preferencesStore );\n\t\t\tconst { getEditedEntityRecord } = select( coreStore );\n\t\t\tconst usedPostType = getEditedPostType();\n\t\t\tconst usedPostId = getEditedPostId();\n\t\t\tconst _record = getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tusedPostType,\n\t\t\t\tusedPostId\n\t\t\t);\n\t\t\tconst _context = getEditedPostContext();\n\t\t\treturn {\n\t\t\t\ttemplateSlug: _record.slug,\n\t\t\t\tfocusMode: !! getPreference( 'core/edit-site', 'focusMode' ),\n\t\t\t\tisDistractionFree: !! getPreference(\n\t\t\t\t\t'core/edit-site',\n\t\t\t\t\t'distractionFree'\n\t\t\t\t),\n\t\t\t\thasFixedToolbar:\n\t\t\t\t\t!! getPreference( 'core/edit-site', 'fixedToolbar' ) ||\n\t\t\t\t\t! isLargeViewport,\n\t\t\t\tkeepCaretInsideBlock: !! getPreference(\n\t\t\t\t\t'core/edit-site',\n\t\t\t\t\t'keepCaretInsideBlock'\n\t\t\t\t),\n\t\t\t\tcanvasMode: getCanvasMode(),\n\t\t\t\tsettings: getSettings(),\n\t\t\t\tpostWithTemplate: _context?.postId,\n\t\t\t};\n\t\t},\n\t\t[ isLargeViewport ]\n\t);\n\tconst archiveLabels = useArchiveLabel( templateSlug );\n\tconst defaultRenderingMode = postWithTemplate ? 'template-locked' : 'all';\n\tconst defaultEditorSettings = useMemo( () => {\n\t\treturn {\n\t\t\t...settings,\n\n\t\t\tsupportsTemplateMode: true,\n\t\t\t__experimentalSetIsInserterOpened: setIsInserterOpened,\n\t\t\tfocusMode: canvasMode === 'view' && focusMode ? false : focusMode,\n\t\t\tisDistractionFree,\n\t\t\thasFixedToolbar,\n\t\t\tkeepCaretInsideBlock,\n\t\t\tdefaultRenderingMode,\n\n\t\t\t// I wonder if they should be set in the post editor too\n\t\t\t__experimentalArchiveTitleTypeLabel: archiveLabels.archiveTypeLabel,\n\t\t\t__experimentalArchiveTitleNameLabel: archiveLabels.archiveNameLabel,\n\t\t};\n\t}, [\n\t\tsettings,\n\t\tsetIsInserterOpened,\n\t\tfocusMode,\n\t\tisDistractionFree,\n\t\thasFixedToolbar,\n\t\tkeepCaretInsideBlock,\n\t\tcanvasMode,\n\t\tarchiveLabels.archiveTypeLabel,\n\t\tarchiveLabels.archiveNameLabel,\n\t\tdefaultRenderingMode,\n\t] );\n\n\treturn defaultEditorSettings;\n}\n\nexport default function useSiteEditorSettings() {\n\tconst defaultEditorSettings = useSpecificEditorSettings();\n\tconst { postType, postId } = useSelect( ( select ) => {\n\t\tconst { getEditedPostType, getEditedPostId } = unlock(\n\t\t\tselect( editSiteStore )\n\t\t);\n\t\tconst usedPostType = getEditedPostType();\n\t\tconst usedPostId = getEditedPostId();\n\t\treturn {\n\t\t\tpostType: usedPostType,\n\t\t\tpostId: usedPostId,\n\t\t};\n\t}, [] );\n\treturn useBlockEditorSettings( defaultEditorSettings, postType, postId );\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAKA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AAdA;AACA;AACA;;AAQA;AACA;AACA;;AAIA,MAAM;EAAEQ;AAAuB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAE9D,SAASC,eAAeA,CAAEC,YAAY,EAAG;EACxC,MAAMC,eAAe,GAAGD,YAAY,EAAEE,KAAK,CAC1C,8EACD,CAAC;EACD,IAAIC,QAAQ;EACZ,IAAIC,IAAI;EACR,IAA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AiB,EACjBC,eAAe,EACfC,oBAAoB,EACpBC,UAAU,EACViB,aAAa,CAACpC,gBAAgB,EAC9BoC,aAAa,CAACnC,gBAAgB,EAC9BoC,oBAAoB,CACnB,CAAC;EAEH,OAAOC,qBAAqB;AAC7B;AAEe,SAASM,qBAAqBA,CAAA,EAAG;EAC/C,MAAMN,qBAAqB,GAAG7B,yBAAyB,CAAC,CAAC;EACzD,MAAM;IAAEoC,QAAQ;IAAEV;EAAO,CAAC,GAAG,IAAAzC,eAAS,EAAIC,MAAM,IAAM;IACrD,MAAM;MAAE2B,iBAAiB;MAAEC;IAAgB,CAAC,GAAG,IAAAxC,kBAAM,EACpDY,MAAM,CAAEiB,YAAc,CACvB,CAAC;IACD,MAAMmB,YAAY,GAAGT,iBAAiB,CAAC,CAAC;IACxC,MAAMU,UAAU,GAAGT,eAAe,CAAC,CAAC;IACpC,OAAO;MACNsB,QAAQ,EAAEd,YAAY;MACtBI,MAAM,EAAEH;IACT,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EACP,OAAOlD,sBAAsB,CAAEwD,qBAAqB,EAAEO,QAAQ,EAAEV,MAAO,CAAC;AACzE"}
|
|
1
|
+
{"version":3,"names":["_data","require","_element","_coreData","_editor","_store","_lockUnlock","_usePostLinkProps","useBlockEditorSettings","unlock","editorPrivateApis","useArchiveLabel","templateSlug","taxonomyMatches","match","taxonomy","term","isAuthor","authorSlug","authorMatches","useSelect","select","getEntityRecords","getTaxonomy","getAuthors","coreStore","archiveTypeLabel","archiveNameLabel","labels","singular_name","records","slug","per_page","name","authorRecords","useSpecificEditorSettings","getPostLinkProps","usePostLinkProps","canvasMode","settings","postWithTemplate","getEditedPostType","getEditedPostId","getEditedPostContext","getCanvasMode","getSettings","editSiteStore","getEditedEntityRecord","usedPostType","usedPostId","_record","_context","postId","archiveLabels","defaultRenderingMode","defaultEditorSettings","useMemo","richEditingEnabled","supportsTemplateMode","focusMode","__experimentalArchiveTitleTypeLabel","__experimentalArchiveTitleNameLabel","useSiteEditorSettings","postType"],"sources":["@wordpress/edit-site/src/components/block-editor/use-site-editor-settings.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport { usePostLinkProps } from './use-post-link-props';\n\nconst { useBlockEditorSettings } = unlock( editorPrivateApis );\n\nfunction useArchiveLabel( templateSlug ) {\n\tconst taxonomyMatches = templateSlug?.match(\n\t\t/^(category|tag|taxonomy-([^-]+))$|^(((category|tag)|taxonomy-([^-]+))-(.+))$/\n\t);\n\tlet taxonomy;\n\tlet term;\n\tlet isAuthor = false;\n\tlet authorSlug;\n\tif ( taxonomyMatches ) {\n\t\t// If is for a all taxonomies of a type\n\t\tif ( taxonomyMatches[ 1 ] ) {\n\t\t\ttaxonomy = taxonomyMatches[ 2 ]\n\t\t\t\t? taxonomyMatches[ 2 ]\n\t\t\t\t: taxonomyMatches[ 1 ];\n\t\t}\n\t\t// If is for a all taxonomies of a type\n\t\telse if ( taxonomyMatches[ 3 ] ) {\n\t\t\ttaxonomy = taxonomyMatches[ 6 ]\n\t\t\t\t? taxonomyMatches[ 6 ]\n\t\t\t\t: taxonomyMatches[ 4 ];\n\t\t\tterm = taxonomyMatches[ 7 ];\n\t\t}\n\t\ttaxonomy = taxonomy === 'tag' ? 'post_tag' : taxonomy;\n\n\t\t//getTaxonomy( 'category' );\n\t\t//wp.data.select('core').getEntityRecords( 'taxonomy', 'category', {slug: 'newcat'} );\n\t} else {\n\t\tconst authorMatches = templateSlug?.match( /^(author)$|^author-(.+)$/ );\n\t\tif ( authorMatches ) {\n\t\t\tisAuthor = true;\n\t\t\tif ( authorMatches[ 2 ] ) {\n\t\t\t\tauthorSlug = authorMatches[ 2 ];\n\t\t\t}\n\t\t}\n\t}\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecords, getTaxonomy, getAuthors } =\n\t\t\t\tselect( coreStore );\n\t\t\tlet archiveTypeLabel;\n\t\t\tlet archiveNameLabel;\n\t\t\tif ( taxonomy ) {\n\t\t\t\tarchiveTypeLabel =\n\t\t\t\t\tgetTaxonomy( taxonomy )?.labels?.singular_name;\n\t\t\t}\n\t\t\tif ( term ) {\n\t\t\t\tconst records = getEntityRecords( 'taxonomy', taxonomy, {\n\t\t\t\t\tslug: term,\n\t\t\t\t\tper_page: 1,\n\t\t\t\t} );\n\t\t\t\tif ( records && records[ 0 ] ) {\n\t\t\t\t\tarchiveNameLabel = records[ 0 ].name;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( isAuthor ) {\n\t\t\t\tarchiveTypeLabel = 'Author';\n\t\t\t\tif ( authorSlug ) {\n\t\t\t\t\tconst authorRecords = getAuthors( { slug: authorSlug } );\n\t\t\t\t\tif ( authorRecords && authorRecords[ 0 ] ) {\n\t\t\t\t\t\tarchiveNameLabel = authorRecords[ 0 ].name;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tarchiveTypeLabel,\n\t\t\t\tarchiveNameLabel,\n\t\t\t};\n\t\t},\n\t\t[ authorSlug, isAuthor, taxonomy, term ]\n\t);\n}\n\nexport function useSpecificEditorSettings() {\n\tconst getPostLinkProps = usePostLinkProps();\n\tconst { templateSlug, canvasMode, settings, postWithTemplate } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetEditedPostType,\n\t\t\t\tgetEditedPostId,\n\t\t\t\tgetEditedPostContext,\n\t\t\t\tgetCanvasMode,\n\t\t\t\tgetSettings,\n\t\t\t} = unlock( select( editSiteStore ) );\n\t\t\tconst { getEditedEntityRecord } = select( coreStore );\n\t\t\tconst usedPostType = getEditedPostType();\n\t\t\tconst usedPostId = getEditedPostId();\n\t\t\tconst _record = getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tusedPostType,\n\t\t\t\tusedPostId\n\t\t\t);\n\t\t\tconst _context = getEditedPostContext();\n\t\t\treturn {\n\t\t\t\ttemplateSlug: _record.slug,\n\t\t\t\tcanvasMode: getCanvasMode(),\n\t\t\t\tsettings: getSettings(),\n\t\t\t\tpostWithTemplate: _context?.postId,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst archiveLabels = useArchiveLabel( templateSlug );\n\tconst defaultRenderingMode = postWithTemplate ? 'template-locked' : 'all';\n\tconst defaultEditorSettings = useMemo( () => {\n\t\treturn {\n\t\t\t...settings,\n\n\t\t\trichEditingEnabled: true,\n\t\t\tsupportsTemplateMode: true,\n\t\t\tfocusMode: canvasMode !== 'view',\n\t\t\tdefaultRenderingMode,\n\t\t\tgetPostLinkProps,\n\t\t\t// I wonder if they should be set in the post editor too\n\t\t\t__experimentalArchiveTitleTypeLabel: archiveLabels.archiveTypeLabel,\n\t\t\t__experimentalArchiveTitleNameLabel: archiveLabels.archiveNameLabel,\n\t\t};\n\t}, [\n\t\tsettings,\n\t\tcanvasMode,\n\t\tdefaultRenderingMode,\n\t\tgetPostLinkProps,\n\t\tarchiveLabels.archiveTypeLabel,\n\t\tarchiveLabels.archiveNameLabel,\n\t] );\n\n\treturn defaultEditorSettings;\n}\n\nexport default function useSiteEditorSettings() {\n\tconst defaultEditorSettings = useSpecificEditorSettings();\n\tconst { postType, postId } = useSelect( ( select ) => {\n\t\tconst { getEditedPostType, getEditedPostId } = unlock(\n\t\t\tselect( editSiteStore )\n\t\t);\n\t\tconst usedPostType = getEditedPostType();\n\t\tconst usedPostId = getEditedPostId();\n\t\treturn {\n\t\t\tpostType: usedPostType,\n\t\t\tpostId: usedPostId,\n\t\t};\n\t}, [] );\n\treturn useBlockEditorSettings( defaultEditorSettings, postType, postId );\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAA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CAAC;EACzD,MAAM;IAAE4B,QAAQ;IAAEX;EAAO,CAAC,GAAG,IAAAhC,eAAS,EAAIC,MAAM,IAAM;IACrD,MAAM;MAAEoB,iBAAiB;MAAEC;IAAgB,CAAC,GAAG,IAAAjC,kBAAM,EACpDY,MAAM,CAAEyB,YAAc,CACvB,CAAC;IACD,MAAME,YAAY,GAAGP,iBAAiB,CAAC,CAAC;IACxC,MAAMQ,UAAU,GAAGP,eAAe,CAAC,CAAC;IACpC,OAAO;MACNqB,QAAQ,EAAEf,YAAY;MACtBI,MAAM,EAAEH;IACT,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EACP,OAAOzC,sBAAsB,CAAE+C,qBAAqB,EAAEQ,QAAQ,EAAEX,MAAO,CAAC;AACzE"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.CreateTemplatePartModalContents = CreateTemplatePartModalContents;
|
|
6
7
|
exports.default = CreateTemplatePartModal;
|
|
7
8
|
var _react = require("react");
|
|
8
9
|
var _data = require("@wordpress/data");
|
|
@@ -26,11 +27,22 @@ var _templatePartCreate = require("../../utils/template-part-create");
|
|
|
26
27
|
*/
|
|
27
28
|
|
|
28
29
|
function CreateTemplatePartModal({
|
|
30
|
+
modalTitle = (0, _i18n.__)('Create template part'),
|
|
31
|
+
...restProps
|
|
32
|
+
}) {
|
|
33
|
+
return (0, _react.createElement)(_components.Modal, {
|
|
34
|
+
title: modalTitle,
|
|
35
|
+
onRequestClose: restProps.closeModal,
|
|
36
|
+
overlayClassName: "edit-site-create-template-part-modal"
|
|
37
|
+
}, (0, _react.createElement)(CreateTemplatePartModalContents, {
|
|
38
|
+
...restProps
|
|
39
|
+
}));
|
|
40
|
+
}
|
|
41
|
+
function CreateTemplatePartModalContents({
|
|
29
42
|
defaultArea = _constants.TEMPLATE_PART_AREA_DEFAULT_CATEGORY,
|
|
30
43
|
blocks = [],
|
|
31
44
|
confirmLabel = (0, _i18n.__)('Create'),
|
|
32
45
|
closeModal,
|
|
33
|
-
modalTitle = (0, _i18n.__)('Create template part'),
|
|
34
46
|
onCreate,
|
|
35
47
|
onError,
|
|
36
48
|
defaultTitle = ''
|
|
@@ -76,11 +88,7 @@ function CreateTemplatePartModal({
|
|
|
76
88
|
setIsSubmitting(false);
|
|
77
89
|
}
|
|
78
90
|
}
|
|
79
|
-
return (0, _react.createElement)(
|
|
80
|
-
title: modalTitle,
|
|
81
|
-
onRequestClose: closeModal,
|
|
82
|
-
overlayClassName: "edit-site-create-template-part-modal"
|
|
83
|
-
}, (0, _react.createElement)("form", {
|
|
91
|
+
return (0, _react.createElement)("form", {
|
|
84
92
|
onSubmit: async event => {
|
|
85
93
|
event.preventDefault();
|
|
86
94
|
await createTemplatePart();
|
|
@@ -135,6 +143,6 @@ function CreateTemplatePartModal({
|
|
|
135
143
|
type: "submit",
|
|
136
144
|
"aria-disabled": !title || isSubmitting,
|
|
137
145
|
isBusy: isSubmitting
|
|
138
|
-
}, confirmLabel))))
|
|
146
|
+
}, confirmLabel))));
|
|
139
147
|
}
|
|
140
148
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_components","_i18n","_element","_compose","_editor","_notices","_coreData","_icons","_blocks","_constants","_templatePartCreate","CreateTemplatePartModal","defaultArea","TEMPLATE_PART_AREA_DEFAULT_CATEGORY","blocks","confirmLabel","__","closeModal","modalTitle","onCreate","onError","defaultTitle","createErrorNotice","useDispatch","noticesStore","saveEntityRecord","coreStore","existingTemplateParts","useExistingTemplateParts","title","setTitle","useState","area","setArea","isSubmitting","setIsSubmitting","instanceId","useInstanceId","templatePartAreas","useSelect","select","editorStore","__experimentalGetDefaultTemplatePartAreas","createTemplatePart","uniqueTitle","getUniqueTemplatePartTitle","cleanSlug","getCleanTemplatePartSlug","templatePart","TEMPLATE_PART_POST_TYPE","slug","content","serialize","throwOnError","error","errorMessage","message","code","type","_react","createElement","Modal","onRequestClose","overlayClassName","onSubmit","event","preventDefault","__experimentalVStack","spacing","TextControl","__nextHasNoMarginBottom","label","value","onChange","required","BaseControl","id","className","__experimentalRadioGroup","checked","map","icon","description","__experimentalRadio","key","Flex","align","justify","FlexItem","Icon","FlexBlock","check","__experimentalHStack","Button","variant","onClick","isBusy"],"sources":["@wordpress/edit-site/src/components/create-template-part-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tIcon,\n\tBaseControl,\n\tTextControl,\n\tFlex,\n\tFlexItem,\n\tFlexBlock,\n\tButton,\n\tModal,\n\t__experimentalRadioGroup as RadioGroup,\n\t__experimentalRadio as Radio,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport { useInstanceId } from '@wordpress/compose';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { check } from '@wordpress/icons';\nimport { serialize } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport {\n\tTEMPLATE_PART_POST_TYPE,\n\tTEMPLATE_PART_AREA_DEFAULT_CATEGORY,\n} from '../../utils/constants';\nimport {\n\tuseExistingTemplateParts,\n\tgetUniqueTemplatePartTitle,\n\tgetCleanTemplatePartSlug,\n} from '../../utils/template-part-create';\n\nexport default function CreateTemplatePartModal( {\n\tdefaultArea = TEMPLATE_PART_AREA_DEFAULT_CATEGORY,\n\tblocks = [],\n\tconfirmLabel = __( 'Create' ),\n\tcloseModal,\n\tmodalTitle = __( 'Create template part' ),\n\tonCreate,\n\tonError,\n\tdefaultTitle = '',\n} ) {\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\tconst existingTemplateParts = useExistingTemplateParts();\n\n\tconst [ title, setTitle ] = useState( defaultTitle );\n\tconst [ area, setArea ] = useState( defaultArea );\n\tconst [ isSubmitting, setIsSubmitting ] = useState( false );\n\tconst instanceId = useInstanceId( CreateTemplatePartModal );\n\n\tconst templatePartAreas = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).__experimentalGetDefaultTemplatePartAreas(),\n\t\t[]\n\t);\n\n\tasync function createTemplatePart() {\n\t\tif ( ! title || isSubmitting ) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tsetIsSubmitting( true );\n\t\t\tconst uniqueTitle = getUniqueTemplatePartTitle(\n\t\t\t\ttitle,\n\t\t\t\texistingTemplateParts\n\t\t\t);\n\t\t\tconst cleanSlug = getCleanTemplatePartSlug( uniqueTitle );\n\n\t\t\tconst templatePart = await saveEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tTEMPLATE_PART_POST_TYPE,\n\t\t\t\t{\n\t\t\t\t\tslug: cleanSlug,\n\t\t\t\t\ttitle: uniqueTitle,\n\t\t\t\t\tcontent: serialize( blocks ),\n\t\t\t\t\tarea,\n\t\t\t\t},\n\t\t\t\t{ throwOnError: true }\n\t\t\t);\n\t\t\tawait onCreate( templatePart );\n\n\t\t\t// TODO: Add a success notice?\n\t\t} catch ( error ) {\n\t\t\tconst errorMessage =\n\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t? error.message\n\t\t\t\t\t: __(\n\t\t\t\t\t\t\t'An error occurred while creating the template part.'\n\t\t\t\t\t );\n\n\t\t\tcreateErrorNotice( errorMessage, { type: 'snackbar' } );\n\n\t\t\tonError?.();\n\t\t} finally {\n\t\t\tsetIsSubmitting( false );\n\t\t}\n\t}\n\n\treturn (\n\t\t<Modal\n\t\t\ttitle={ modalTitle }\n\t\t\tonRequestClose={ closeModal }\n\t\t\toverlayClassName=\"edit-site-create-template-part-modal\"\n\t\t>\n\t\t\t<form\n\t\t\t\tonSubmit={ async ( event ) => {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tawait createTemplatePart();\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<VStack spacing=\"4\">\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\t\tvalue={ title }\n\t\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\t\trequired\n\t\t\t\t\t/>\n\t\t\t\t\t<BaseControl\n\t\t\t\t\t\tlabel={ __( 'Area' ) }\n\t\t\t\t\t\tid={ `edit-site-create-template-part-modal__area-selection-${ instanceId }` }\n\t\t\t\t\t\tclassName=\"edit-site-create-template-part-modal__area-base-control\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<RadioGroup\n\t\t\t\t\t\t\tlabel={ __( 'Area' ) }\n\t\t\t\t\t\t\tclassName=\"edit-site-create-template-part-modal__area-radio-group\"\n\t\t\t\t\t\t\tid={ `edit-site-create-template-part-modal__area-selection-${ instanceId }` }\n\t\t\t\t\t\t\tonChange={ setArea }\n\t\t\t\t\t\t\tchecked={ area }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ templatePartAreas.map(\n\t\t\t\t\t\t\t\t( {\n\t\t\t\t\t\t\t\t\ticon,\n\t\t\t\t\t\t\t\t\tlabel,\n\t\t\t\t\t\t\t\t\tarea: value,\n\t\t\t\t\t\t\t\t\tdescription,\n\t\t\t\t\t\t\t\t} ) => (\n\t\t\t\t\t\t\t\t\t<Radio\n\t\t\t\t\t\t\t\t\t\tkey={ label }\n\t\t\t\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\t\t\t\tclassName=\"edit-site-create-template-part-modal__area-radio\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<Flex align=\"start\" justify=\"start\">\n\t\t\t\t\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t\t\t\t\t<Icon icon={ icon } />\n\t\t\t\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t\t\t\t\t<FlexBlock className=\"edit-site-create-template-part-modal__option-label\">\n\t\t\t\t\t\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t\t\t\t\t\t\t<div>{ description }</div>\n\t\t\t\t\t\t\t\t\t\t\t</FlexBlock>\n\n\t\t\t\t\t\t\t\t\t\t\t<FlexItem className=\"edit-site-create-template-part-modal__checkbox\">\n\t\t\t\t\t\t\t\t\t\t\t\t{ area === value && (\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Icon icon={ check } />\n\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t\t\t\t</Flex>\n\t\t\t\t\t\t\t\t\t</Radio>\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</RadioGroup>\n\t\t\t\t\t</BaseControl>\n\t\t\t\t\t<HStack justify=\"right\">\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tcloseModal();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\taria-disabled={ ! title || isSubmitting }\n\t\t\t\t\t\t\tisBusy={ isSubmitting }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ confirmLabel }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</HStack>\n\t\t\t\t</VStack>\n\t\t\t</form>\n\t\t</Modal>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAcA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAA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AE,CACZ,CAAC,EACX,IAAAtB,MAAA,CAAAC,aAAA,EAAC5D,WAAA,CAAA0F,SAAS;IAACb,SAAS,EAAC;EAAoD,GACtEN,KAAK,EACP,IAAAZ,MAAA,CAAAC,aAAA,eAAOsB,WAAkB,CACf,CAAC,EAEZ,IAAAvB,MAAA,CAAAC,aAAA,EAAC5D,WAAA,CAAAwF,QAAQ;IAACX,SAAS,EAAC;EAAgD,GACjE7C,IAAI,KAAKwC,KAAK,IACf,IAAAb,MAAA,CAAAC,aAAA,EAAC5D,WAAA,CAAAyF,IAAI;IAACR,IAAI,EAAGU;EAAO,CAAE,CAEd,CACL,CACA,CAET,CACW,CACA,CAAC,EACd,IAAAhC,MAAA,CAAAC,aAAA,EAAC5D,WAAA,CAAA4F,oBAAM;IAACL,OAAO,EAAC;EAAO,GACtB,IAAA5B,MAAA,CAAAC,aAAA,EAAC5D,WAAA,CAAA6F,MAAM;IACNC,OAAO,EAAC,UAAU;IAClBC,OAAO,EAAGA,CAAA,KAAM;MACf9E,UAAU,CAAC,CAAC;IACb;EAAG,GAED,IAAAD,QAAE,EAAE,QAAS,CACR,CAAC,EACT,IAAA2C,MAAA,CAAAC,aAAA,EAAC5D,WAAA,CAAA6F,MAAM;IACNC,OAAO,EAAC,SAAS;IACjBpC,IAAI,EAAC,QAAQ;IACb,iBAAgB,CAAE7B,KAAK,IAAIK,YAAc;IACzC8D,MAAM,EAAG9D;EAAc,GAErBnB,YACK,CACD,CACD,CACH,CACA,CAAC;AAEV"}
|
|
1
|
+
{"version":3,"names":["_data","require","_components","_i18n","_element","_compose","_editor","_notices","_coreData","_icons","_blocks","_constants","_templatePartCreate","CreateTemplatePartModal","modalTitle","__","restProps","_react","createElement","Modal","title","onRequestClose","closeModal","overlayClassName","CreateTemplatePartModalContents","defaultArea","TEMPLATE_PART_AREA_DEFAULT_CATEGORY","blocks","confirmLabel","onCreate","onError","defaultTitle","createErrorNotice","useDispatch","noticesStore","saveEntityRecord","coreStore","existingTemplateParts","useExistingTemplateParts","setTitle","useState","area","setArea","isSubmitting","setIsSubmitting","instanceId","useInstanceId","templatePartAreas","useSelect","select","editorStore","__experimentalGetDefaultTemplatePartAreas","createTemplatePart","uniqueTitle","getUniqueTemplatePartTitle","cleanSlug","getCleanTemplatePartSlug","templatePart","TEMPLATE_PART_POST_TYPE","slug","content","serialize","throwOnError","error","errorMessage","message","code","type","onSubmit","event","preventDefault","__experimentalVStack","spacing","TextControl","__nextHasNoMarginBottom","label","value","onChange","required","BaseControl","id","className","__experimentalRadioGroup","checked","map","icon","description","__experimentalRadio","key","Flex","align","justify","FlexItem","Icon","FlexBlock","check","__experimentalHStack","Button","variant","onClick","isBusy"],"sources":["@wordpress/edit-site/src/components/create-template-part-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tIcon,\n\tBaseControl,\n\tTextControl,\n\tFlex,\n\tFlexItem,\n\tFlexBlock,\n\tButton,\n\tModal,\n\t__experimentalRadioGroup as RadioGroup,\n\t__experimentalRadio as Radio,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\nimport { useInstanceId } from '@wordpress/compose';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { check } from '@wordpress/icons';\nimport { serialize } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport {\n\tTEMPLATE_PART_POST_TYPE,\n\tTEMPLATE_PART_AREA_DEFAULT_CATEGORY,\n} from '../../utils/constants';\nimport {\n\tuseExistingTemplateParts,\n\tgetUniqueTemplatePartTitle,\n\tgetCleanTemplatePartSlug,\n} from '../../utils/template-part-create';\n\nexport default function CreateTemplatePartModal( {\n\tmodalTitle = __( 'Create template part' ),\n\t...restProps\n} ) {\n\treturn (\n\t\t<Modal\n\t\t\ttitle={ modalTitle }\n\t\t\tonRequestClose={ restProps.closeModal }\n\t\t\toverlayClassName=\"edit-site-create-template-part-modal\"\n\t\t>\n\t\t\t<CreateTemplatePartModalContents { ...restProps } />\n\t\t</Modal>\n\t);\n}\n\nexport function CreateTemplatePartModalContents( {\n\tdefaultArea = TEMPLATE_PART_AREA_DEFAULT_CATEGORY,\n\tblocks = [],\n\tconfirmLabel = __( 'Create' ),\n\tcloseModal,\n\tonCreate,\n\tonError,\n\tdefaultTitle = '',\n} ) {\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\tconst existingTemplateParts = useExistingTemplateParts();\n\n\tconst [ title, setTitle ] = useState( defaultTitle );\n\tconst [ area, setArea ] = useState( defaultArea );\n\tconst [ isSubmitting, setIsSubmitting ] = useState( false );\n\tconst instanceId = useInstanceId( CreateTemplatePartModal );\n\n\tconst templatePartAreas = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).__experimentalGetDefaultTemplatePartAreas(),\n\t\t[]\n\t);\n\tasync function createTemplatePart() {\n\t\tif ( ! title || isSubmitting ) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tsetIsSubmitting( true );\n\t\t\tconst uniqueTitle = getUniqueTemplatePartTitle(\n\t\t\t\ttitle,\n\t\t\t\texistingTemplateParts\n\t\t\t);\n\t\t\tconst cleanSlug = getCleanTemplatePartSlug( uniqueTitle );\n\n\t\t\tconst templatePart = await saveEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tTEMPLATE_PART_POST_TYPE,\n\t\t\t\t{\n\t\t\t\t\tslug: cleanSlug,\n\t\t\t\t\ttitle: uniqueTitle,\n\t\t\t\t\tcontent: serialize( blocks ),\n\t\t\t\t\tarea,\n\t\t\t\t},\n\t\t\t\t{ throwOnError: true }\n\t\t\t);\n\t\t\tawait onCreate( templatePart );\n\n\t\t\t// TODO: Add a success notice?\n\t\t} catch ( error ) {\n\t\t\tconst errorMessage =\n\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t? error.message\n\t\t\t\t\t: __(\n\t\t\t\t\t\t\t'An error occurred while creating the template part.'\n\t\t\t\t\t );\n\n\t\t\tcreateErrorNotice( errorMessage, { type: 'snackbar' } );\n\n\t\t\tonError?.();\n\t\t} finally {\n\t\t\tsetIsSubmitting( false );\n\t\t}\n\t}\n\treturn (\n\t\t<form\n\t\t\tonSubmit={ async ( event ) => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tawait createTemplatePart();\n\t\t\t} }\n\t\t>\n\t\t\t<VStack spacing=\"4\">\n\t\t\t\t<TextControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\tvalue={ title }\n\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\trequired\n\t\t\t\t/>\n\t\t\t\t<BaseControl\n\t\t\t\t\tlabel={ __( 'Area' ) }\n\t\t\t\t\tid={ `edit-site-create-template-part-modal__area-selection-${ instanceId }` }\n\t\t\t\t\tclassName=\"edit-site-create-template-part-modal__area-base-control\"\n\t\t\t\t>\n\t\t\t\t\t<RadioGroup\n\t\t\t\t\t\tlabel={ __( 'Area' ) }\n\t\t\t\t\t\tclassName=\"edit-site-create-template-part-modal__area-radio-group\"\n\t\t\t\t\t\tid={ `edit-site-create-template-part-modal__area-selection-${ instanceId }` }\n\t\t\t\t\t\tonChange={ setArea }\n\t\t\t\t\t\tchecked={ area }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ templatePartAreas.map(\n\t\t\t\t\t\t\t( { icon, label, area: value, description } ) => (\n\t\t\t\t\t\t\t\t<Radio\n\t\t\t\t\t\t\t\t\tkey={ label }\n\t\t\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\t\t\tclassName=\"edit-site-create-template-part-modal__area-radio\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<Flex align=\"start\" justify=\"start\">\n\t\t\t\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t\t\t\t<Icon icon={ icon } />\n\t\t\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t\t\t\t<FlexBlock className=\"edit-site-create-template-part-modal__option-label\">\n\t\t\t\t\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t\t\t\t\t\t<div>{ description }</div>\n\t\t\t\t\t\t\t\t\t\t</FlexBlock>\n\n\t\t\t\t\t\t\t\t\t\t<FlexItem className=\"edit-site-create-template-part-modal__checkbox\">\n\t\t\t\t\t\t\t\t\t\t\t{ area === value && (\n\t\t\t\t\t\t\t\t\t\t\t\t<Icon icon={ check } />\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t\t\t</Flex>\n\t\t\t\t\t\t\t\t</Radio>\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) }\n\t\t\t\t\t</RadioGroup>\n\t\t\t\t</BaseControl>\n\t\t\t\t<HStack justify=\"right\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tcloseModal();\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\taria-disabled={ ! title || isSubmitting }\n\t\t\t\t\t\tisBusy={ isSubmitting }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ confirmLabel }\n\t\t\t\t\t</Button>\n\t\t\t\t</HStack>\n\t\t\t</VStack>\n\t\t</form>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAcA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG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EAAO,GAClC,IAAA1E,MAAA,CAAAC,aAAA,EAAChB,WAAA,CAAA0F,QAAQ,QACR,IAAA3E,MAAA,CAAAC,aAAA,EAAChB,WAAA,CAAA2F,IAAI;IAACR,IAAI,EAAGA;EAAM,CAAE,CACZ,CAAC,EACX,IAAApE,MAAA,CAAAC,aAAA,EAAChB,WAAA,CAAA4F,SAAS;IAACb,SAAS,EAAC;EAAoD,GACtEN,KAAK,EACP,IAAA1D,MAAA,CAAAC,aAAA,eAAOoE,WAAkB,CACf,CAAC,EAEZ,IAAArE,MAAA,CAAAC,aAAA,EAAChB,WAAA,CAAA0F,QAAQ;IAACX,SAAS,EAAC;EAAgD,GACjExC,IAAI,KAAKmC,KAAK,IACf,IAAA3D,MAAA,CAAAC,aAAA,EAAChB,WAAA,CAAA2F,IAAI;IAACR,IAAI,EAAGU;EAAO,CAAE,CAEd,CACL,CACA,CAET,CACW,CACA,CAAC,EACd,IAAA9E,MAAA,CAAAC,aAAA,EAAChB,WAAA,CAAA8F,oBAAM;IAACL,OAAO,EAAC;EAAO,GACtB,IAAA1E,MAAA,CAAAC,aAAA,EAAChB,WAAA,CAAA+F,MAAM;IACNC,OAAO,EAAC,UAAU;IAClBC,OAAO,EAAGA,CAAA,KAAM;MACf7E,UAAU,CAAC,CAAC;IACb;EAAG,GAED,IAAAP,QAAE,EAAE,QAAS,CACR,CAAC,EACT,IAAAE,MAAA,CAAAC,aAAA,EAAChB,WAAA,CAAA+F,MAAM;IACNC,OAAO,EAAC,SAAS;IACjB/B,IAAI,EAAC,QAAQ;IACb,iBAAgB,CAAE/C,KAAK,IAAIuB,YAAc;IACzCyD,MAAM,EAAGzD;EAAc,GAErBf,YACK,CACD,CACD,CACH,CAAC;AAET"}
|
|
@@ -19,8 +19,6 @@ var _coreData = require("@wordpress/core-data");
|
|
|
19
19
|
var _sidebarEditMode = require("../sidebar-edit-mode");
|
|
20
20
|
var _codeEditor = _interopRequireDefault(require("../code-editor"));
|
|
21
21
|
var _editMode = _interopRequireDefault(require("../keyboard-shortcuts/edit-mode"));
|
|
22
|
-
var _inserterSidebar = _interopRequireDefault(require("../secondary-sidebar/inserter-sidebar"));
|
|
23
|
-
var _listViewSidebar = _interopRequireDefault(require("../secondary-sidebar/list-view-sidebar"));
|
|
24
22
|
var _welcomeGuide = _interopRequireDefault(require("../welcome-guide"));
|
|
25
23
|
var _startTemplateOptions = _interopRequireDefault(require("../start-template-options"));
|
|
26
24
|
var _store = require("../../store");
|
|
@@ -29,7 +27,6 @@ var _useTitle = _interopRequireDefault(require("../routes/use-title"));
|
|
|
29
27
|
var _canvasLoader = _interopRequireDefault(require("../canvas-loader"));
|
|
30
28
|
var _lockUnlock = require("../../lock-unlock");
|
|
31
29
|
var _useEditedEntityRecord = _interopRequireDefault(require("../use-edited-entity-record"));
|
|
32
|
-
var _sidebarFixedBottom = require("../sidebar-edit-mode/sidebar-fixed-bottom");
|
|
33
30
|
var _patternModal = _interopRequireDefault(require("../pattern-modal"));
|
|
34
31
|
var _constants = require("../../utils/constants");
|
|
35
32
|
var _siteEditorCanvas = _interopRequireDefault(require("../block-editor/site-editor-canvas"));
|
|
@@ -51,7 +48,9 @@ const {
|
|
|
51
48
|
BlockRemovalWarningModal
|
|
52
49
|
} = (0, _lockUnlock.unlock)(_blockEditor.privateApis);
|
|
53
50
|
const {
|
|
54
|
-
ExperimentalEditorProvider: EditorProvider
|
|
51
|
+
ExperimentalEditorProvider: EditorProvider,
|
|
52
|
+
InserterSidebar,
|
|
53
|
+
ListViewSidebar
|
|
55
54
|
} = (0, _lockUnlock.unlock)(_editor.privateApis);
|
|
56
55
|
const interfaceLabels = {
|
|
57
56
|
/* translators: accessibility text for the editor content landmark region. */
|
|
@@ -72,7 +71,6 @@ const blockRemovalRules = {
|
|
|
72
71
|
'core/post-template': (0, _i18n.__)('Post Template displays each post or page in a Query Loop.')
|
|
73
72
|
};
|
|
74
73
|
function Editor({
|
|
75
|
-
listViewToggleElement,
|
|
76
74
|
isLoading
|
|
77
75
|
}) {
|
|
78
76
|
const {
|
|
@@ -97,12 +95,13 @@ function Editor({
|
|
|
97
95
|
showIconLabels,
|
|
98
96
|
showBlockBreadcrumbs
|
|
99
97
|
} = (0, _data.useSelect)(select => {
|
|
98
|
+
const {
|
|
99
|
+
get
|
|
100
|
+
} = select(_preferences.store);
|
|
100
101
|
const {
|
|
101
102
|
getEditedPostContext,
|
|
102
103
|
getEditorMode,
|
|
103
|
-
getCanvasMode
|
|
104
|
-
isInserterOpened,
|
|
105
|
-
isListViewOpened
|
|
104
|
+
getCanvasMode
|
|
106
105
|
} = (0, _lockUnlock.unlock)(select(_store.store));
|
|
107
106
|
const {
|
|
108
107
|
__unstableGetEditorMode
|
|
@@ -114,7 +113,9 @@ function Editor({
|
|
|
114
113
|
getEntityRecord
|
|
115
114
|
} = select(_coreData.store);
|
|
116
115
|
const {
|
|
117
|
-
getRenderingMode
|
|
116
|
+
getRenderingMode,
|
|
117
|
+
isInserterOpened,
|
|
118
|
+
isListViewOpened
|
|
118
119
|
} = select(_editor.store);
|
|
119
120
|
const _context = getEditedPostContext();
|
|
120
121
|
|
|
@@ -130,8 +131,8 @@ function Editor({
|
|
|
130
131
|
isInserterOpen: isInserterOpened(),
|
|
131
132
|
isListViewOpen: isListViewOpened(),
|
|
132
133
|
isRightSidebarOpen: getActiveComplementaryArea(_store.store.name),
|
|
133
|
-
|
|
134
|
-
|
|
134
|
+
showBlockBreadcrumbs: get('core', 'showBlockBreadcrumbs'),
|
|
135
|
+
showIconLabels: get('core', 'showIconLabels')
|
|
135
136
|
};
|
|
136
137
|
}, []);
|
|
137
138
|
const isViewMode = canvasMode === 'view';
|
|
@@ -177,13 +178,11 @@ function Editor({
|
|
|
177
178
|
hideDragHandle: true
|
|
178
179
|
}), (0, _react.createElement)(_siteEditorCanvas.default, null), (0, _react.createElement)(BlockRemovalWarningModal, {
|
|
179
180
|
rules: blockRemovalRules
|
|
180
|
-
}), (0, _react.createElement)(_patternModal.default, null)), editorMode === 'text' && isEditMode && (0, _react.createElement)(_codeEditor.default, null), isEditMode && (0, _react.createElement)(_editMode.default, null)),
|
|
181
|
-
secondarySidebar: isEditMode && (shouldShowInserter && (0, _react.createElement)(
|
|
182
|
-
listViewToggleElement: listViewToggleElement
|
|
183
|
-
})),
|
|
181
|
+
}), (0, _react.createElement)(_patternModal.default, null)), editorMode === 'text' && isEditMode && (0, _react.createElement)(_codeEditor.default, null), isEditMode && (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_editMode.default, null), (0, _react.createElement)(_editor.EditorKeyboardShortcutsRegister, null), (0, _react.createElement)(_editor.EditorKeyboardShortcuts, null))),
|
|
182
|
+
secondarySidebar: isEditMode && (shouldShowInserter && (0, _react.createElement)(InserterSidebar, null) || shouldShowListView && (0, _react.createElement)(ListViewSidebar, null)),
|
|
184
183
|
sidebar: isEditMode && isRightSidebarOpen && (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_interface.ComplementaryArea.Slot, {
|
|
185
184
|
scope: "core/edit-site"
|
|
186
|
-
})
|
|
185
|
+
})),
|
|
187
186
|
footer: shouldShowBlockBreadcrumbs && (0, _react.createElement)(_blockEditor.BlockBreadcrumb, {
|
|
188
187
|
rootLabelText: postWithTemplate && renderingMode !== 'template-only' ? (0, _i18n.__)('Page') : (0, _i18n.__)('Template')
|
|
189
188
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_classnames","_interopRequireDefault","require","_data","_components","_compose","_preferences","_blockEditor","_interface","_editor","_i18n","_coreData","_sidebarEditMode","_codeEditor","_editMode","_inserterSidebar","_listViewSidebar","_welcomeGuide","_startTemplateOptions","_store","_globalStylesRenderer","_useTitle","_canvasLoader","_lockUnlock","_useEditedEntityRecord","_sidebarFixedBottom","_patternModal","_constants","_siteEditorCanvas","_templatePartConverter","_useSiteEditorSettings","BlockRemovalWarningModal","unlock","blockEditorPrivateApis","ExperimentalEditorProvider","EditorProvider","editorPrivateApis","interfaceLabels","body","__","sidebar","actions","footer","blockRemovalRules","Editor","listViewToggleElement","isLoading","record","editedPost","getTitle","isLoaded","hasLoadedPost","useEditedEntityRecord","type","editedPostType","isLargeViewport","useViewportMatch","context","contextPost","editorMode","canvasMode","renderingMode","blockEditorMode","isRightSidebarOpen","isInserterOpen","isListViewOpen","showIconLabels","showBlockBreadcrumbs","useSelect","select","getEditedPostContext","getEditorMode","getCanvasMode","isInserterOpened","isListViewOpened","editSiteStore","__unstableGetEditorMode","blockEditorStore","getActiveComplementaryArea","interfaceStore","getEntityRecord","coreDataStore","getRenderingMode","editorStore","_context","postId","postType","undefined","name","preferencesStore","get","isViewMode","isEditMode","showVisualEditor","shouldShowBlockBreadcrumbs","shouldShowInserter","shouldShowListView","secondarySidebarLabel","postWithTemplate","title","_POST_TYPE_LABELS$edi","sprintf","POST_TYPE_LABELS","TEMPLATE_POST_TYPE","useTitle","loadingProgressId","useInstanceId","CanvasLoader","settings","useSpecificEditorSettings","isReady","_react","createElement","Fragment","default","id","Notice","status","isDismissible","post","__unstableTemplate","useSubRegistry","SidebarComplementaryAreaFills","InterfaceSkeleton","isDistractionFree","enableRegionNavigation","className","classnames","notices","EditorSnackbars","content","GlobalStylesRenderer","EditorNotices","SidebarInspectorFill","BlockInspector","BlockToolbar","hideDragHandle","rules","secondarySidebar","ComplementaryArea","Slot","scope","SidebarFixedBottomSlot","BlockBreadcrumb","rootLabelText","labels"],"sources":["@wordpress/edit-site/src/components/editor/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { Notice } from '@wordpress/components';\nimport { useInstanceId, useViewportMatch } from '@wordpress/compose';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tBlockBreadcrumb,\n\tBlockToolbar,\n\tstore as blockEditorStore,\n\tprivateApis as blockEditorPrivateApis,\n\tBlockInspector,\n} from '@wordpress/block-editor';\nimport {\n\tInterfaceSkeleton,\n\tComplementaryArea,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport {\n\tEditorNotices,\n\tEditorSnackbars,\n\tprivateApis as editorPrivateApis,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as coreDataStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport {\n\tSidebarComplementaryAreaFills,\n\tSidebarInspectorFill,\n} from '../sidebar-edit-mode';\nimport CodeEditor from '../code-editor';\nimport KeyboardShortcutsEditMode from '../keyboard-shortcuts/edit-mode';\nimport InserterSidebar from '../secondary-sidebar/inserter-sidebar';\nimport ListViewSidebar from '../secondary-sidebar/list-view-sidebar';\nimport WelcomeGuide from '../welcome-guide';\nimport StartTemplateOptions from '../start-template-options';\nimport { store as editSiteStore } from '../../store';\nimport { GlobalStylesRenderer } from '../global-styles-renderer';\nimport useTitle from '../routes/use-title';\nimport CanvasLoader from '../canvas-loader';\nimport { unlock } from '../../lock-unlock';\nimport useEditedEntityRecord from '../use-edited-entity-record';\nimport { SidebarFixedBottomSlot } from '../sidebar-edit-mode/sidebar-fixed-bottom';\nimport PatternModal from '../pattern-modal';\nimport { POST_TYPE_LABELS, TEMPLATE_POST_TYPE } from '../../utils/constants';\nimport SiteEditorCanvas from '../block-editor/site-editor-canvas';\nimport TemplatePartConverter from '../template-part-converter';\nimport { useSpecificEditorSettings } from '../block-editor/use-site-editor-settings';\n\nconst { BlockRemovalWarningModal } = unlock( blockEditorPrivateApis );\nconst { ExperimentalEditorProvider: EditorProvider } =\n\tunlock( editorPrivateApis );\n\nconst interfaceLabels = {\n\t/* translators: accessibility text for the editor content landmark region. */\n\tbody: __( 'Editor content' ),\n\t/* translators: accessibility text for the editor settings landmark region. */\n\tsidebar: __( 'Editor settings' ),\n\t/* translators: accessibility text for the editor publish landmark region. */\n\tactions: __( 'Editor publish' ),\n\t/* translators: accessibility text for the editor footer landmark region. */\n\tfooter: __( 'Editor footer' ),\n};\n\n// Prevent accidental removal of certain blocks, asking the user for\n// confirmation.\nconst blockRemovalRules = {\n\t'core/query': __( 'Query Loop displays a list of posts or pages.' ),\n\t'core/post-content': __(\n\t\t'Post Content displays the content of a post or page.'\n\t),\n\t'core/post-template': __(\n\t\t'Post Template displays each post or page in a Query Loop.'\n\t),\n};\n\nexport default function Editor( { listViewToggleElement, isLoading } ) {\n\tconst {\n\t\trecord: editedPost,\n\t\tgetTitle,\n\t\tisLoaded: hasLoadedPost,\n\t} = useEditedEntityRecord();\n\n\tconst { type: editedPostType } = editedPost;\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\n\tconst {\n\t\tcontext,\n\t\tcontextPost,\n\t\teditorMode,\n\t\tcanvasMode,\n\t\trenderingMode,\n\t\tblockEditorMode,\n\t\tisRightSidebarOpen,\n\t\tisInserterOpen,\n\t\tisListViewOpen,\n\t\tshowIconLabels,\n\t\tshowBlockBreadcrumbs,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetEditedPostContext,\n\t\t\tgetEditorMode,\n\t\t\tgetCanvasMode,\n\t\t\tisInserterOpened,\n\t\t\tisListViewOpened,\n\t\t} = unlock( select( editSiteStore ) );\n\t\tconst { __unstableGetEditorMode } = select( blockEditorStore );\n\t\tconst { getActiveComplementaryArea } = select( interfaceStore );\n\t\tconst { getEntityRecord } = select( coreDataStore );\n\t\tconst { getRenderingMode } = select( editorStore );\n\t\tconst _context = getEditedPostContext();\n\n\t\t// The currently selected entity to display.\n\t\t// Typically template or template part in the site editor.\n\t\treturn {\n\t\t\tcontext: _context,\n\t\t\tcontextPost: _context?.postId\n\t\t\t\t? getEntityRecord(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t_context.postType,\n\t\t\t\t\t\t_context.postId\n\t\t\t\t )\n\t\t\t\t: undefined,\n\t\t\teditorMode: getEditorMode(),\n\t\t\tcanvasMode: getCanvasMode(),\n\t\t\trenderingMode: getRenderingMode(),\n\t\t\tblockEditorMode: __unstableGetEditorMode(),\n\t\t\tisInserterOpen: isInserterOpened(),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tisRightSidebarOpen: getActiveComplementaryArea(\n\t\t\t\teditSiteStore.name\n\t\t\t),\n\t\t\tshowIconLabels: select( preferencesStore ).get(\n\t\t\t\t'core/edit-site',\n\t\t\t\t'showIconLabels'\n\t\t\t),\n\t\t\tshowBlockBreadcrumbs: select( preferencesStore ).get(\n\t\t\t\t'core/edit-site',\n\t\t\t\t'showBlockBreadcrumbs'\n\t\t\t),\n\t\t};\n\t}, [] );\n\n\tconst isViewMode = canvasMode === 'view';\n\tconst isEditMode = canvasMode === 'edit';\n\tconst showVisualEditor = isViewMode || editorMode === 'visual';\n\tconst shouldShowBlockBreadcrumbs =\n\t\tshowBlockBreadcrumbs &&\n\t\tisEditMode &&\n\t\tshowVisualEditor &&\n\t\tblockEditorMode !== 'zoom-out';\n\tconst shouldShowInserter = isEditMode && showVisualEditor && isInserterOpen;\n\tconst shouldShowListView = isEditMode && showVisualEditor && isListViewOpen;\n\tconst secondarySidebarLabel = isListViewOpen\n\t\t? __( 'List View' )\n\t\t: __( 'Block Library' );\n\tconst postWithTemplate = !! context?.postId;\n\n\tlet title;\n\tif ( hasLoadedPost ) {\n\t\ttitle = sprintf(\n\t\t\t// translators: A breadcrumb trail for the Admin document title. %1$s: title of template being edited, %2$s: type of template (Template or Template Part).\n\t\t\t__( '%1$s ‹ %2$s' ),\n\t\t\tgetTitle(),\n\t\t\tPOST_TYPE_LABELS[ editedPostType ] ??\n\t\t\t\tPOST_TYPE_LABELS[ TEMPLATE_POST_TYPE ]\n\t\t);\n\t}\n\n\t// Only announce the title once the editor is ready to prevent \"Replace\"\n\t// action in <URLQueryController> from double-announcing.\n\tuseTitle( hasLoadedPost && title );\n\n\tconst loadingProgressId = useInstanceId(\n\t\tCanvasLoader,\n\t\t'edit-site-editor__loading-progress'\n\t);\n\n\tconst settings = useSpecificEditorSettings();\n\tconst isReady =\n\t\t! isLoading &&\n\t\t( ( postWithTemplate && !! contextPost && !! editedPost ) ||\n\t\t\t( ! postWithTemplate && !! editedPost ) );\n\n\treturn (\n\t\t<>\n\t\t\t{ ! isReady ? <CanvasLoader id={ loadingProgressId } /> : null }\n\t\t\t{ isEditMode && <WelcomeGuide /> }\n\t\t\t{ hasLoadedPost && ! editedPost && (\n\t\t\t\t<Notice status=\"warning\" isDismissible={ false }>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t\"You attempted to edit an item that doesn't exist. Perhaps it was deleted?\"\n\t\t\t\t\t) }\n\t\t\t\t</Notice>\n\t\t\t) }\n\t\t\t{ isReady && (\n\t\t\t\t<EditorProvider\n\t\t\t\t\tpost={ postWithTemplate ? contextPost : editedPost }\n\t\t\t\t\t__unstableTemplate={\n\t\t\t\t\t\tpostWithTemplate ? editedPost : undefined\n\t\t\t\t\t}\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t>\n\t\t\t\t\t<SidebarComplementaryAreaFills />\n\t\t\t\t\t{ isEditMode && <StartTemplateOptions /> }\n\t\t\t\t\t<InterfaceSkeleton\n\t\t\t\t\t\tisDistractionFree={ true }\n\t\t\t\t\t\tenableRegionNavigation={ false }\n\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t'edit-site-editor__interface-skeleton',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'show-icon-labels': showIconLabels,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tnotices={ <EditorSnackbars /> }\n\t\t\t\t\t\tcontent={\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<GlobalStylesRenderer />\n\t\t\t\t\t\t\t\t{ isEditMode && <EditorNotices /> }\n\t\t\t\t\t\t\t\t{ showVisualEditor && (\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t<TemplatePartConverter />\n\t\t\t\t\t\t\t\t\t\t<SidebarInspectorFill>\n\t\t\t\t\t\t\t\t\t\t\t<BlockInspector />\n\t\t\t\t\t\t\t\t\t\t</SidebarInspectorFill>\n\t\t\t\t\t\t\t\t\t\t{ ! isLargeViewport && (\n\t\t\t\t\t\t\t\t\t\t\t<BlockToolbar hideDragHandle />\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t<SiteEditorCanvas />\n\t\t\t\t\t\t\t\t\t\t<BlockRemovalWarningModal\n\t\t\t\t\t\t\t\t\t\t\trules={ blockRemovalRules }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t<PatternModal />\n\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t{ editorMode === 'text' && isEditMode && (\n\t\t\t\t\t\t\t\t\t<CodeEditor />\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t{ isEditMode && <KeyboardShortcutsEditMode /> }\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsecondarySidebar={\n\t\t\t\t\t\t\tisEditMode &&\n\t\t\t\t\t\t\t( ( shouldShowInserter && <InserterSidebar /> ) ||\n\t\t\t\t\t\t\t\t( shouldShowListView && (\n\t\t\t\t\t\t\t\t\t<ListViewSidebar\n\t\t\t\t\t\t\t\t\t\tlistViewToggleElement={\n\t\t\t\t\t\t\t\t\t\t\tlistViewToggleElement\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) ) )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsidebar={\n\t\t\t\t\t\t\tisEditMode &&\n\t\t\t\t\t\t\tisRightSidebarOpen && (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<ComplementaryArea.Slot scope=\"core/edit-site\" />\n\t\t\t\t\t\t\t\t\t<SidebarFixedBottomSlot />\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfooter={\n\t\t\t\t\t\t\tshouldShowBlockBreadcrumbs && (\n\t\t\t\t\t\t\t\t<BlockBreadcrumb\n\t\t\t\t\t\t\t\t\trootLabelText={\n\t\t\t\t\t\t\t\t\t\tpostWithTemplate &&\n\t\t\t\t\t\t\t\t\t\trenderingMode !== 'template-only'\n\t\t\t\t\t\t\t\t\t\t\t? __( 'Page' )\n\t\t\t\t\t\t\t\t\t\t\t: __( 'Template' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlabels={ {\n\t\t\t\t\t\t\t...interfaceLabels,\n\t\t\t\t\t\t\tsecondarySidebar: secondarySidebarLabel,\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</EditorProvider>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAOA,IAAAM,UAAA,GAAAN,OAAA;AAKA,IAAAO,OAAA,GAAAP,OAAA;AAMA,IAAAQ,KAAA,GAAAR,OAAA;AACA,IAAAS,SAAA,GAAAT,OAAA;AAKA,IAAAU,gBAAA,GAAAV,OAAA;AAIA,IAAAW,WAAA,GAAAZ,sBAAA,CAAAC,OAAA;AACA,IAAAY,SAAA,GAAAb,sBAAA,CAAAC,OAAA;AACA,IAAAa,gBAAA,GAAAd,sBAAA,CAAAC,OAAA;AACA,IAAAc,gBAAA,GAAAf,sBAAA,CAAAC,OAAA;AACA,IAAAe,aAAA,GAAAhB,sBAAA,CAAAC,OAAA;AACA,IAAAgB,qBAAA,GAAAjB,sBAAA,CAAAC,OAA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AM,IAAIiC,UAAU,IACpC,IAAAmB,MAAA,CAAAC,aAAA,EAACnG,WAAA,CAAAqG,OAAU,MAAE,CACb,EACCtB,UAAU,IAAI,IAAAmB,MAAA,CAAAC,aAAA,EAAClG,SAAA,CAAAoG,OAAyB,MAAE,CAC3C,CACF;IACDwB,gBAAgB,EACf9C,UAAU,KACNG,kBAAkB,IAAI,IAAAgB,MAAA,CAAAC,aAAA,EAACjG,gBAAA,CAAAmG,OAAe,MAAE,CAAC,IAC1ClB,kBAAkB,IACnB,IAAAe,MAAA,CAAAC,aAAA,EAAChG,gBAAA,CAAAkG,OAAe;MACfrE,qBAAqB,EACpBA;IACA,CACD,CACC,CACJ;IACDL,OAAO,EACNoD,UAAU,IACV7B,kBAAkB,IACjB,IAAAgD,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAE,QAAA,QACC,IAAAF,MAAA,CAAAC,aAAA,EAACxG,UAAA,CAAAmI,iBAAiB,CAACC,IAAI;MAACC,KAAK,EAAC;IAAgB,CAAE,CAAC,EACjD,IAAA9B,MAAA,CAAAC,aAAA,EAACvF,mBAAA,CAAAqH,sBAAsB,MAAE,CACxB,CAEH;IACDpG,MAAM,EACLoD,0BAA0B,IACzB,IAAAiB,MAAA,CAAAC,aAAA,EAACzG,YAAA,CAAAwI,eAAe;MACfC,aAAa,EACZ9C,gBAAgB,IAChBrC,aAAa,KAAK,eAAe,GAC9B,IAAAtB,QAAE,EAAE,MAAO,CAAC,GACZ,IAAAA,QAAE,EAAE,UAAW;IAClB,CACD,CAEF;IACD0G,MAAM,EAAG;MACR,GAAG5G,eAAe;MAClBqG,gBAAgB,EAAEzC;IACnB;EAAG,CACH,CACc,CAEhB,CAAC;AAEL"}
|
|
1
|
+
{"version":3,"names":["_classnames","_interopRequireDefault","require","_data","_components","_compose","_preferences","_blockEditor","_interface","_editor","_i18n","_coreData","_sidebarEditMode","_codeEditor","_editMode","_welcomeGuide","_startTemplateOptions","_store","_globalStylesRenderer","_useTitle","_canvasLoader","_lockUnlock","_useEditedEntityRecord","_patternModal","_constants","_siteEditorCanvas","_templatePartConverter","_useSiteEditorSettings","BlockRemovalWarningModal","unlock","blockEditorPrivateApis","ExperimentalEditorProvider","EditorProvider","InserterSidebar","ListViewSidebar","editorPrivateApis","interfaceLabels","body","__","sidebar","actions","footer","blockRemovalRules","Editor","isLoading","record","editedPost","getTitle","isLoaded","hasLoadedPost","useEditedEntityRecord","type","editedPostType","isLargeViewport","useViewportMatch","context","contextPost","editorMode","canvasMode","renderingMode","blockEditorMode","isRightSidebarOpen","isInserterOpen","isListViewOpen","showIconLabels","showBlockBreadcrumbs","useSelect","select","get","preferencesStore","getEditedPostContext","getEditorMode","getCanvasMode","editSiteStore","__unstableGetEditorMode","blockEditorStore","getActiveComplementaryArea","interfaceStore","getEntityRecord","coreDataStore","getRenderingMode","isInserterOpened","isListViewOpened","editorStore","_context","postId","postType","undefined","name","isViewMode","isEditMode","showVisualEditor","shouldShowBlockBreadcrumbs","shouldShowInserter","shouldShowListView","secondarySidebarLabel","postWithTemplate","title","_POST_TYPE_LABELS$edi","sprintf","POST_TYPE_LABELS","TEMPLATE_POST_TYPE","useTitle","loadingProgressId","useInstanceId","CanvasLoader","settings","useSpecificEditorSettings","isReady","_react","createElement","Fragment","default","id","Notice","status","isDismissible","post","__unstableTemplate","useSubRegistry","SidebarComplementaryAreaFills","InterfaceSkeleton","isDistractionFree","enableRegionNavigation","className","classnames","notices","EditorSnackbars","content","GlobalStylesRenderer","EditorNotices","SidebarInspectorFill","BlockInspector","BlockToolbar","hideDragHandle","rules","EditorKeyboardShortcutsRegister","EditorKeyboardShortcuts","secondarySidebar","ComplementaryArea","Slot","scope","BlockBreadcrumb","rootLabelText","labels"],"sources":["@wordpress/edit-site/src/components/editor/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { Notice } from '@wordpress/components';\nimport { useInstanceId, useViewportMatch } from '@wordpress/compose';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tBlockBreadcrumb,\n\tBlockToolbar,\n\tstore as blockEditorStore,\n\tprivateApis as blockEditorPrivateApis,\n\tBlockInspector,\n} from '@wordpress/block-editor';\nimport {\n\tInterfaceSkeleton,\n\tComplementaryArea,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport {\n\tEditorKeyboardShortcutsRegister,\n\tEditorKeyboardShortcuts,\n\tEditorNotices,\n\tEditorSnackbars,\n\tprivateApis as editorPrivateApis,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as coreDataStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport {\n\tSidebarComplementaryAreaFills,\n\tSidebarInspectorFill,\n} from '../sidebar-edit-mode';\nimport CodeEditor from '../code-editor';\nimport KeyboardShortcutsEditMode from '../keyboard-shortcuts/edit-mode';\nimport WelcomeGuide from '../welcome-guide';\nimport StartTemplateOptions from '../start-template-options';\nimport { store as editSiteStore } from '../../store';\nimport { GlobalStylesRenderer } from '../global-styles-renderer';\nimport useTitle from '../routes/use-title';\nimport CanvasLoader from '../canvas-loader';\nimport { unlock } from '../../lock-unlock';\nimport useEditedEntityRecord from '../use-edited-entity-record';\nimport PatternModal from '../pattern-modal';\nimport { POST_TYPE_LABELS, TEMPLATE_POST_TYPE } from '../../utils/constants';\nimport SiteEditorCanvas from '../block-editor/site-editor-canvas';\nimport TemplatePartConverter from '../template-part-converter';\nimport { useSpecificEditorSettings } from '../block-editor/use-site-editor-settings';\n\nconst { BlockRemovalWarningModal } = unlock( blockEditorPrivateApis );\nconst {\n\tExperimentalEditorProvider: EditorProvider,\n\tInserterSidebar,\n\tListViewSidebar,\n} = unlock( editorPrivateApis );\n\nconst interfaceLabels = {\n\t/* translators: accessibility text for the editor content landmark region. */\n\tbody: __( 'Editor content' ),\n\t/* translators: accessibility text for the editor settings landmark region. */\n\tsidebar: __( 'Editor settings' ),\n\t/* translators: accessibility text for the editor publish landmark region. */\n\tactions: __( 'Editor publish' ),\n\t/* translators: accessibility text for the editor footer landmark region. */\n\tfooter: __( 'Editor footer' ),\n};\n\n// Prevent accidental removal of certain blocks, asking the user for\n// confirmation.\nconst blockRemovalRules = {\n\t'core/query': __( 'Query Loop displays a list of posts or pages.' ),\n\t'core/post-content': __(\n\t\t'Post Content displays the content of a post or page.'\n\t),\n\t'core/post-template': __(\n\t\t'Post Template displays each post or page in a Query Loop.'\n\t),\n};\n\nexport default function Editor( { isLoading } ) {\n\tconst {\n\t\trecord: editedPost,\n\t\tgetTitle,\n\t\tisLoaded: hasLoadedPost,\n\t} = useEditedEntityRecord();\n\n\tconst { type: editedPostType } = editedPost;\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\n\tconst {\n\t\tcontext,\n\t\tcontextPost,\n\t\teditorMode,\n\t\tcanvasMode,\n\t\trenderingMode,\n\t\tblockEditorMode,\n\t\tisRightSidebarOpen,\n\t\tisInserterOpen,\n\t\tisListViewOpen,\n\t\tshowIconLabels,\n\t\tshowBlockBreadcrumbs,\n\t} = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { getEditedPostContext, getEditorMode, getCanvasMode } = unlock(\n\t\t\tselect( editSiteStore )\n\t\t);\n\t\tconst { __unstableGetEditorMode } = select( blockEditorStore );\n\t\tconst { getActiveComplementaryArea } = select( interfaceStore );\n\t\tconst { getEntityRecord } = select( coreDataStore );\n\t\tconst { getRenderingMode, isInserterOpened, isListViewOpened } =\n\t\t\tselect( editorStore );\n\t\tconst _context = getEditedPostContext();\n\n\t\t// The currently selected entity to display.\n\t\t// Typically template or template part in the site editor.\n\t\treturn {\n\t\t\tcontext: _context,\n\t\t\tcontextPost: _context?.postId\n\t\t\t\t? getEntityRecord(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t_context.postType,\n\t\t\t\t\t\t_context.postId\n\t\t\t\t )\n\t\t\t\t: undefined,\n\t\t\teditorMode: getEditorMode(),\n\t\t\tcanvasMode: getCanvasMode(),\n\t\t\trenderingMode: getRenderingMode(),\n\t\t\tblockEditorMode: __unstableGetEditorMode(),\n\t\t\tisInserterOpen: isInserterOpened(),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tisRightSidebarOpen: getActiveComplementaryArea(\n\t\t\t\teditSiteStore.name\n\t\t\t),\n\t\t\tshowBlockBreadcrumbs: get( 'core', 'showBlockBreadcrumbs' ),\n\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t};\n\t}, [] );\n\n\tconst isViewMode = canvasMode === 'view';\n\tconst isEditMode = canvasMode === 'edit';\n\tconst showVisualEditor = isViewMode || editorMode === 'visual';\n\tconst shouldShowBlockBreadcrumbs =\n\t\tshowBlockBreadcrumbs &&\n\t\tisEditMode &&\n\t\tshowVisualEditor &&\n\t\tblockEditorMode !== 'zoom-out';\n\tconst shouldShowInserter = isEditMode && showVisualEditor && isInserterOpen;\n\tconst shouldShowListView = isEditMode && showVisualEditor && isListViewOpen;\n\tconst secondarySidebarLabel = isListViewOpen\n\t\t? __( 'List View' )\n\t\t: __( 'Block Library' );\n\tconst postWithTemplate = !! context?.postId;\n\n\tlet title;\n\tif ( hasLoadedPost ) {\n\t\ttitle = sprintf(\n\t\t\t// translators: A breadcrumb trail for the Admin document title. %1$s: title of template being edited, %2$s: type of template (Template or Template Part).\n\t\t\t__( '%1$s ‹ %2$s' ),\n\t\t\tgetTitle(),\n\t\t\tPOST_TYPE_LABELS[ editedPostType ] ??\n\t\t\t\tPOST_TYPE_LABELS[ TEMPLATE_POST_TYPE ]\n\t\t);\n\t}\n\n\t// Only announce the title once the editor is ready to prevent \"Replace\"\n\t// action in <URLQueryController> from double-announcing.\n\tuseTitle( hasLoadedPost && title );\n\n\tconst loadingProgressId = useInstanceId(\n\t\tCanvasLoader,\n\t\t'edit-site-editor__loading-progress'\n\t);\n\n\tconst settings = useSpecificEditorSettings();\n\tconst isReady =\n\t\t! isLoading &&\n\t\t( ( postWithTemplate && !! contextPost && !! editedPost ) ||\n\t\t\t( ! postWithTemplate && !! editedPost ) );\n\n\treturn (\n\t\t<>\n\t\t\t{ ! isReady ? <CanvasLoader id={ loadingProgressId } /> : null }\n\t\t\t{ isEditMode && <WelcomeGuide /> }\n\t\t\t{ hasLoadedPost && ! editedPost && (\n\t\t\t\t<Notice status=\"warning\" isDismissible={ false }>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t\"You attempted to edit an item that doesn't exist. Perhaps it was deleted?\"\n\t\t\t\t\t) }\n\t\t\t\t</Notice>\n\t\t\t) }\n\t\t\t{ isReady && (\n\t\t\t\t<EditorProvider\n\t\t\t\t\tpost={ postWithTemplate ? contextPost : editedPost }\n\t\t\t\t\t__unstableTemplate={\n\t\t\t\t\t\tpostWithTemplate ? editedPost : undefined\n\t\t\t\t\t}\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t>\n\t\t\t\t\t<SidebarComplementaryAreaFills />\n\t\t\t\t\t{ isEditMode && <StartTemplateOptions /> }\n\t\t\t\t\t<InterfaceSkeleton\n\t\t\t\t\t\tisDistractionFree={ true }\n\t\t\t\t\t\tenableRegionNavigation={ false }\n\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t'edit-site-editor__interface-skeleton',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'show-icon-labels': showIconLabels,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tnotices={ <EditorSnackbars /> }\n\t\t\t\t\t\tcontent={\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<GlobalStylesRenderer />\n\t\t\t\t\t\t\t\t{ isEditMode && <EditorNotices /> }\n\t\t\t\t\t\t\t\t{ showVisualEditor && (\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t<TemplatePartConverter />\n\t\t\t\t\t\t\t\t\t\t<SidebarInspectorFill>\n\t\t\t\t\t\t\t\t\t\t\t<BlockInspector />\n\t\t\t\t\t\t\t\t\t\t</SidebarInspectorFill>\n\t\t\t\t\t\t\t\t\t\t{ ! isLargeViewport && (\n\t\t\t\t\t\t\t\t\t\t\t<BlockToolbar hideDragHandle />\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t<SiteEditorCanvas />\n\t\t\t\t\t\t\t\t\t\t<BlockRemovalWarningModal\n\t\t\t\t\t\t\t\t\t\t\trules={ blockRemovalRules }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t<PatternModal />\n\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t{ editorMode === 'text' && isEditMode && (\n\t\t\t\t\t\t\t\t\t<CodeEditor />\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t{ isEditMode && (\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t<KeyboardShortcutsEditMode />\n\t\t\t\t\t\t\t\t\t\t<EditorKeyboardShortcutsRegister />\n\t\t\t\t\t\t\t\t\t\t<EditorKeyboardShortcuts />\n\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsecondarySidebar={\n\t\t\t\t\t\t\tisEditMode &&\n\t\t\t\t\t\t\t( ( shouldShowInserter && <InserterSidebar /> ) ||\n\t\t\t\t\t\t\t\t( shouldShowListView && <ListViewSidebar /> ) )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsidebar={\n\t\t\t\t\t\t\tisEditMode &&\n\t\t\t\t\t\t\tisRightSidebarOpen && (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<ComplementaryArea.Slot scope=\"core/edit-site\" />\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfooter={\n\t\t\t\t\t\t\tshouldShowBlockBreadcrumbs && (\n\t\t\t\t\t\t\t\t<BlockBreadcrumb\n\t\t\t\t\t\t\t\t\trootLabelText={\n\t\t\t\t\t\t\t\t\t\tpostWithTemplate &&\n\t\t\t\t\t\t\t\t\t\trenderingMode !== 'template-only'\n\t\t\t\t\t\t\t\t\t\t\t? __( 'Page' )\n\t\t\t\t\t\t\t\t\t\t\t: __( 'Template' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlabels={ {\n\t\t\t\t\t\t\t...interfaceLabels,\n\t\t\t\t\t\t\tsecondarySidebar: secondarySidebarLabel,\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</EditorProvider>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAOA,IAAAM,UAAA,GAAAN,OAAA;AAKA,IAAAO,OAAA,GAAAP,OAAA;AAQA,IAAAQ,KAAA,GAAAR,OAAA;AACA,IAAAS,SAAA,GAAAT,OAAA;AAKA,IAAAU,gBAAA,GAAAV,OAAA;AAIA,IAAAW,WAAA,GAAAZ,sBAAA,CAAAC,OAAA;AACA,IAAAY,SAAA,GAAAb,sBAAA,CAAAC,OAAA;AACA,IAAAa,aAAA,GAAAd,sBAAA,CAAAC,OAAA;AACA,IAAAc,qBAAA,GAAAf,sBAAA,CAAAC,OAAA;AACA,IAAAe,MAAA,GAAAf,OAAA;AACA,IAAAgB,qBAAA,GAAAhB,OAAA;AACA,IAAAiB,SAAA,G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