@wordpress/editor 14.9.0 → 14.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/bindings/api.js +0 -29
- package/build/bindings/api.js.map +1 -1
- package/build/components/autocompleters/user.js.map +1 -1
- package/build/components/block-manager/index.js +2 -2
- package/build/components/block-manager/index.js.map +1 -1
- package/build/components/commands/index.js.map +1 -1
- package/build/components/create-template-part-modal/index.js.map +1 -1
- package/build/components/create-template-part-modal/utils.js.map +1 -1
- package/build/components/document-outline/index.js.map +1 -1
- package/build/components/document-outline/item.js.map +1 -1
- package/build/components/document-tools/index.js +1 -1
- package/build/components/document-tools/index.js.map +1 -1
- package/build/components/editor-interface/index.js +1 -12
- package/build/components/editor-interface/index.js.map +1 -1
- package/build/components/entities-saved-states/index.js +1 -1
- package/build/components/entities-saved-states/index.js.map +1 -1
- package/build/components/media-categories/index.js.map +1 -1
- package/build/components/page-attributes/parent.js +1 -1
- package/build/components/page-attributes/parent.js.map +1 -1
- package/build/components/plugin-document-setting-panel/index.js.map +1 -1
- package/build/components/post-actions/index.js.map +1 -1
- package/build/components/post-content-information/index.js +1 -1
- package/build/components/post-content-information/index.js.map +1 -1
- package/build/components/post-featured-image/index.js.map +1 -1
- package/build/components/post-format/index.js +1 -1
- package/build/components/post-format/index.js.map +1 -1
- package/build/components/post-last-revision/index.js +1 -1
- package/build/components/post-last-revision/index.js.map +1 -1
- package/build/components/post-locked-modal/index.js +2 -2
- package/build/components/post-locked-modal/index.js.map +1 -1
- package/build/components/post-preview-button/index.js +1 -1
- package/build/components/post-preview-button/index.js.map +1 -1
- package/build/components/post-publish-button/index.js.map +1 -1
- package/build/components/post-publish-panel/maybe-post-format-panel.js +1 -1
- package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-upload-media.js +1 -0
- package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
- package/build/components/post-publish-panel/media-util.js +1 -0
- package/build/components/post-publish-panel/media-util.js.map +1 -1
- package/build/components/post-publish-panel/postpublish.js +1 -1
- package/build/components/post-publish-panel/postpublish.js.map +1 -1
- package/build/components/post-schedule/label.js.map +1 -1
- package/build/components/post-taxonomies/flat-term-selector.js +4 -4
- package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/hierarchical-term-selector.js +3 -2
- package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/index.js +1 -1
- package/build/components/post-taxonomies/index.js.map +1 -1
- package/build/components/post-taxonomies/panel.js.map +1 -1
- package/build/components/post-template/classic-theme.js +2 -4
- package/build/components/post-template/classic-theme.js.map +1 -1
- package/build/components/post-text-editor/index.js.map +1 -1
- package/build/components/post-title/index.js +15 -19
- package/build/components/post-title/index.js.map +1 -1
- package/build/components/post-title/index.native.js +2 -2
- package/build/components/post-title/index.native.js.map +1 -1
- package/build/components/post-url/index.js +76 -63
- package/build/components/post-url/index.js.map +1 -1
- package/build/components/post-url/panel.js +46 -26
- package/build/components/post-url/panel.js.map +1 -1
- package/build/components/post-visibility/index.js.map +1 -1
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/preview-dropdown/index.js.map +1 -1
- package/build/components/provider/index.js +1 -1
- package/build/components/provider/index.js.map +1 -1
- package/build/components/resizable-editor/resize-handle.js.map +1 -1
- package/build/components/time-to-read/index.js +1 -1
- package/build/components/time-to-read/index.js.map +1 -1
- package/build/components/visual-editor/edit-template-blocks-notification.js +4 -1
- package/build/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
- package/build/components/visual-editor/index.js +4 -3
- package/build/components/visual-editor/index.js.map +1 -1
- package/build/components/visual-editor/use-select-nearest-editable-block.js.map +1 -1
- package/build/dataviews/actions/duplicate-template-part.js +1 -1
- package/build/dataviews/actions/duplicate-template-part.js.map +1 -1
- package/build/private-apis.js +0 -1
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +26 -1
- package/build/store/actions.js.map +1 -1
- package/build/store/constants.js +1 -0
- package/build/store/constants.js.map +1 -1
- package/build/store/local-autosave.js.map +1 -1
- package/build/store/private-actions.js +7 -6
- package/build/store/private-actions.js.map +1 -1
- package/build/store/selectors.js +21 -0
- package/build/store/selectors.js.map +1 -1
- package/build/utils/media-upload/index.js.map +1 -1
- package/build-module/bindings/api.js +1 -29
- package/build-module/bindings/api.js.map +1 -1
- package/build-module/components/autocompleters/user.js +1 -3
- package/build-module/components/autocompleters/user.js.map +1 -1
- package/build-module/components/block-manager/category.js +1 -2
- package/build-module/components/block-manager/category.js.map +1 -1
- package/build-module/components/block-manager/checklist.js +1 -2
- package/build-module/components/block-manager/checklist.js.map +1 -1
- package/build-module/components/block-manager/index.js +3 -4
- package/build-module/components/block-manager/index.js.map +1 -1
- package/build-module/components/block-settings-menu/content-only-settings-menu.js +1 -3
- package/build-module/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
- package/build-module/components/blog-title/index.js +1 -3
- package/build-module/components/blog-title/index.js.map +1 -1
- package/build-module/components/collapsible-block-toolbar/index.js +1 -3
- package/build-module/components/collapsible-block-toolbar/index.js.map +1 -1
- package/build-module/components/commands/index.js.map +1 -1
- package/build-module/components/create-template-part-modal/index.js +1 -2
- package/build-module/components/create-template-part-modal/index.js.map +1 -1
- package/build-module/components/create-template-part-modal/utils.js.map +1 -1
- package/build-module/components/document-bar/index.js +1 -2
- package/build-module/components/document-bar/index.js.map +1 -1
- package/build-module/components/document-outline/index.js +1 -2
- package/build-module/components/document-outline/index.js.map +1 -1
- package/build-module/components/document-outline/item.js +1 -2
- package/build-module/components/document-outline/item.js.map +1 -1
- package/build-module/components/document-tools/index.js +2 -4
- package/build-module/components/document-tools/index.js.map +1 -1
- package/build-module/components/editor/index.js +1 -3
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor-help/add-blocks.native.js +1 -3
- package/build-module/components/editor-help/add-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/customize-blocks.native.js +1 -3
- package/build-module/components/editor-help/customize-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/help-detail-navigation-screen.native.js +1 -2
- package/build-module/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
- package/build-module/components/editor-help/index.native.js +1 -3
- package/build-module/components/editor-help/index.native.js.map +1 -1
- package/build-module/components/editor-help/intro-to-blocks.native.js +1 -3
- package/build-module/components/editor-help/intro-to-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/move-blocks.native.js +1 -3
- package/build-module/components/editor-help/move-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/remove-blocks.native.js +1 -3
- package/build-module/components/editor-help/remove-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/view-sections.native.js +1 -2
- package/build-module/components/editor-help/view-sections.native.js.map +1 -1
- package/build-module/components/editor-interface/index.js +2 -15
- package/build-module/components/editor-interface/index.js.map +1 -1
- package/build-module/components/editor-notices/index.js +1 -3
- package/build-module/components/editor-notices/index.js.map +1 -1
- package/build-module/components/entities-saved-states/entity-record-item.js +1 -3
- package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
- package/build-module/components/entities-saved-states/entity-type-list.js +1 -2
- package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
- package/build-module/components/entities-saved-states/index.js +2 -3
- package/build-module/components/entities-saved-states/index.js.map +1 -1
- package/build-module/components/error-boundary/index.native.js +1 -2
- package/build-module/components/error-boundary/index.native.js.map +1 -1
- package/build-module/components/header/index.js +1 -2
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +1 -2
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +1 -3
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build-module/components/list-view-sidebar/list-view-outline.js +1 -3
- package/build-module/components/list-view-sidebar/list-view-outline.js.map +1 -1
- package/build-module/components/media-categories/index.js.map +1 -1
- package/build-module/components/more-menu/index.js +1 -3
- package/build-module/components/more-menu/index.js.map +1 -1
- package/build-module/components/offline-status/index.native.js +1 -2
- package/build-module/components/offline-status/index.native.js.map +1 -1
- package/build-module/components/page-attributes/parent.js +2 -3
- package/build-module/components/page-attributes/parent.js.map +1 -1
- package/build-module/components/plugin-document-setting-panel/index.js +1 -3
- package/build-module/components/plugin-document-setting-panel/index.js.map +1 -1
- package/build-module/components/post-actions/index.js +1 -3
- package/build-module/components/post-actions/index.js.map +1 -1
- package/build-module/components/post-author/panel.js +1 -2
- package/build-module/components/post-author/panel.js.map +1 -1
- package/build-module/components/post-card-panel/index.js +1 -2
- package/build-module/components/post-card-panel/index.js.map +1 -1
- package/build-module/components/post-content-information/index.js +1 -1
- package/build-module/components/post-content-information/index.js.map +1 -1
- package/build-module/components/post-discussion/panel.js +1 -2
- package/build-module/components/post-discussion/panel.js.map +1 -1
- package/build-module/components/post-excerpt/panel.js +1 -3
- package/build-module/components/post-excerpt/panel.js.map +1 -1
- package/build-module/components/post-featured-image/index.js +1 -2
- package/build-module/components/post-featured-image/index.js.map +1 -1
- package/build-module/components/post-format/index.js +2 -3
- package/build-module/components/post-format/index.js.map +1 -1
- package/build-module/components/post-format/panel.js +1 -2
- package/build-module/components/post-format/panel.js.map +1 -1
- package/build-module/components/post-last-revision/index.js +1 -1
- package/build-module/components/post-last-revision/index.js.map +1 -1
- package/build-module/components/post-locked-modal/index.js +3 -5
- package/build-module/components/post-locked-modal/index.js.map +1 -1
- package/build-module/components/post-panel-row/index.js +1 -2
- package/build-module/components/post-panel-row/index.js.map +1 -1
- package/build-module/components/post-preview-button/index.js +2 -4
- package/build-module/components/post-preview-button/index.js.map +1 -1
- package/build-module/components/post-publish-button/index.js +1 -2
- package/build-module/components/post-publish-button/index.js.map +1 -1
- package/build-module/components/post-publish-panel/index.js +1 -3
- package/build-module/components/post-publish-panel/index.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-category-panel.js +1 -2
- package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-post-format-panel.js +2 -3
- package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-tags-panel.js +1 -2
- package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-upload-media.js +2 -2
- package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
- package/build-module/components/post-publish-panel/media-util.js +1 -0
- package/build-module/components/post-publish-panel/media-util.js.map +1 -1
- package/build-module/components/post-publish-panel/postpublish.js +2 -4
- package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
- package/build-module/components/post-publish-panel/prepublish.js +1 -3
- package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
- package/build-module/components/post-saved-state/index.js +1 -2
- package/build-module/components/post-saved-state/index.js.map +1 -1
- package/build-module/components/post-schedule/label.js.map +1 -1
- package/build-module/components/post-status/index.js +1 -3
- package/build-module/components/post-status/index.js.map +1 -1
- package/build-module/components/post-switch-to-draft-button/index.js +1 -3
- package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
- package/build-module/components/post-taxonomies/flat-term-selector.js +5 -7
- package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js +4 -4
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/index.js +1 -1
- package/build-module/components/post-taxonomies/index.js.map +1 -1
- package/build-module/components/post-taxonomies/most-used-terms.js +1 -2
- package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
- package/build-module/components/post-taxonomies/panel.js.map +1 -1
- package/build-module/components/post-template/block-theme.js +1 -3
- package/build-module/components/post-template/block-theme.js.map +1 -1
- package/build-module/components/post-template/classic-theme.js +3 -6
- package/build-module/components/post-template/classic-theme.js.map +1 -1
- package/build-module/components/post-template/create-new-template-modal.js +1 -2
- package/build-module/components/post-template/create-new-template-modal.js.map +1 -1
- package/build-module/components/post-template/create-new-template.js +1 -3
- package/build-module/components/post-template/create-new-template.js.map +1 -1
- package/build-module/components/post-template/swap-template-button.js +1 -3
- package/build-module/components/post-template/swap-template-button.js.map +1 -1
- package/build-module/components/post-text-editor/index.js +1 -3
- package/build-module/components/post-text-editor/index.js.map +1 -1
- package/build-module/components/post-title/index.js +15 -19
- package/build-module/components/post-title/index.js.map +1 -1
- package/build-module/components/post-title/index.native.js +2 -2
- package/build-module/components/post-title/index.native.js.map +1 -1
- package/build-module/components/post-trash/index.js +1 -2
- package/build-module/components/post-trash/index.js.map +1 -1
- package/build-module/components/post-url/index.js +78 -66
- package/build-module/components/post-url/index.js.map +1 -1
- package/build-module/components/post-url/panel.js +48 -28
- package/build-module/components/post-url/panel.js.map +1 -1
- package/build-module/components/post-visibility/index.js +1 -2
- package/build-module/components/post-visibility/index.js.map +1 -1
- package/build-module/components/posts-per-page/index.js +1 -3
- package/build-module/components/posts-per-page/index.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +1 -3
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/preview-dropdown/index.js +1 -3
- package/build-module/components/preview-dropdown/index.js.map +1 -1
- package/build-module/components/provider/index.js +2 -4
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/provider/index.native.js +1 -3
- package/build-module/components/provider/index.native.js.map +1 -1
- package/build-module/components/resizable-editor/resize-handle.js +1 -3
- package/build-module/components/resizable-editor/resize-handle.js.map +1 -1
- package/build-module/components/save-publish-panels/index.js +1 -3
- package/build-module/components/save-publish-panels/index.js.map +1 -1
- package/build-module/components/sidebar/header.js +1 -2
- package/build-module/components/sidebar/header.js.map +1 -1
- package/build-module/components/sidebar/index.js +1 -2
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar/post-summary.js +1 -3
- package/build-module/components/sidebar/post-summary.js.map +1 -1
- package/build-module/components/site-discussion/index.js +1 -3
- package/build-module/components/site-discussion/index.js.map +1 -1
- package/build-module/components/start-template-options/index.js +1 -2
- package/build-module/components/start-template-options/index.js.map +1 -1
- package/build-module/components/table-of-contents/panel.js +1 -3
- package/build-module/components/table-of-contents/panel.js.map +1 -1
- package/build-module/components/template-part-menu-items/convert-to-template-part.js +1 -3
- package/build-module/components/template-part-menu-items/convert-to-template-part.js.map +1 -1
- package/build-module/components/template-validation-notice/index.js +1 -3
- package/build-module/components/template-validation-notice/index.js.map +1 -1
- package/build-module/components/text-editor/index.js +1 -2
- package/build-module/components/text-editor/index.js.map +1 -1
- package/build-module/components/time-to-read/index.js +1 -1
- package/build-module/components/time-to-read/index.js.map +1 -1
- package/build-module/components/visual-editor/edit-template-blocks-notification.js +4 -1
- package/build-module/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
- package/build-module/components/visual-editor/index.js +5 -6
- package/build-module/components/visual-editor/index.js.map +1 -1
- package/build-module/components/visual-editor/use-select-nearest-editable-block.js.map +1 -1
- package/build-module/dataviews/actions/duplicate-template-part.js +1 -1
- package/build-module/dataviews/actions/duplicate-template-part.js.map +1 -1
- package/build-module/hooks/pattern-overrides.js +1 -3
- package/build-module/hooks/pattern-overrides.js.map +1 -1
- package/build-module/private-apis.js +1 -2
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js +26 -1
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/constants.js +1 -0
- package/build-module/store/constants.js.map +1 -1
- package/build-module/store/local-autosave.js.map +1 -1
- package/build-module/store/private-actions.js +7 -6
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/selectors.js +21 -0
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/media-upload/index.js.map +1 -1
- package/build-style/style-rtl.css +20 -5
- package/build-style/style.css +20 -5
- package/build-types/bindings/api.d.ts +0 -13
- package/build-types/bindings/api.d.ts.map +1 -1
- package/build-types/components/editor-interface/index.d.ts +1 -2
- package/build-types/components/editor-interface/index.d.ts.map +1 -1
- package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts.map +1 -1
- package/build-types/components/post-template/classic-theme.d.ts.map +1 -1
- package/build-types/components/post-url/index.d.ts.map +1 -1
- package/build-types/components/post-url/panel.d.ts.map +1 -1
- package/build-types/components/provider/index.d.ts.map +1 -1
- package/build-types/components/visual-editor/edit-template-blocks-notification.d.ts.map +1 -1
- package/build-types/components/visual-editor/index.d.ts.map +1 -1
- package/build-types/private-apis.d.ts.map +1 -1
- package/build-types/store/actions.d.ts +1 -4
- package/build-types/store/actions.d.ts.map +1 -1
- package/build-types/store/selectors.d.ts +21 -0
- package/build-types/store/selectors.d.ts.map +1 -1
- package/package.json +38 -38
- package/src/bindings/api.js +1 -32
- package/src/components/document-tools/index.js +1 -1
- package/src/components/editor-interface/index.js +0 -15
- package/src/components/header/style.scss +1 -0
- package/src/components/post-saved-state/test/__snapshots__/index.js.snap +1 -1
- package/src/components/post-taxonomies/hierarchical-term-selector.js +1 -0
- package/src/components/post-template/classic-theme.js +1 -2
- package/src/components/post-url/index.js +67 -55
- package/src/components/post-url/panel.js +57 -33
- package/src/components/post-url/style.scss +21 -3
- package/src/components/provider/index.js +1 -0
- package/src/components/visual-editor/edit-template-blocks-notification.js +5 -1
- package/src/components/visual-editor/index.js +3 -1
- package/src/private-apis.js +1 -5
- package/src/store/actions.js +28 -1
- package/src/store/selectors.js +21 -0
- package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
package/build/bindings/api.js
CHANGED
|
@@ -4,13 +4,10 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.bootstrapBlockBindingsSourcesFromServer = bootstrapBlockBindingsSourcesFromServer;
|
|
8
7
|
exports.registerCoreBlockBindingsSources = registerCoreBlockBindingsSources;
|
|
9
8
|
var _blocks = require("@wordpress/blocks");
|
|
10
|
-
var _data = require("@wordpress/data");
|
|
11
9
|
var _patternOverrides = _interopRequireDefault(require("./pattern-overrides"));
|
|
12
10
|
var _postMeta = _interopRequireDefault(require("./post-meta"));
|
|
13
|
-
var _lockUnlock = require("../lock-unlock");
|
|
14
11
|
/**
|
|
15
12
|
* WordPress dependencies
|
|
16
13
|
*/
|
|
@@ -33,30 +30,4 @@ function registerCoreBlockBindingsSources() {
|
|
|
33
30
|
(0, _blocks.registerBlockBindingsSource)(_patternOverrides.default);
|
|
34
31
|
(0, _blocks.registerBlockBindingsSource)(_postMeta.default);
|
|
35
32
|
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Function to bootstrap core block bindings sources defined in the server.
|
|
39
|
-
*
|
|
40
|
-
* @param {Object} sources Object containing the sources to bootstrap.
|
|
41
|
-
*
|
|
42
|
-
* @example
|
|
43
|
-
* ```js
|
|
44
|
-
* import { bootstrapBlockBindingsSourcesFromServer } from '@wordpress/editor';
|
|
45
|
-
*
|
|
46
|
-
* bootstrapBlockBindingsSourcesFromServer( sources );
|
|
47
|
-
* ```
|
|
48
|
-
*/
|
|
49
|
-
function bootstrapBlockBindingsSourcesFromServer(sources) {
|
|
50
|
-
if (sources) {
|
|
51
|
-
const {
|
|
52
|
-
addBootstrappedBlockBindingsSource
|
|
53
|
-
} = (0, _lockUnlock.unlock)((0, _data.dispatch)(_blocks.store));
|
|
54
|
-
for (const [name, args] of Object.entries(sources)) {
|
|
55
|
-
addBootstrappedBlockBindingsSource({
|
|
56
|
-
name,
|
|
57
|
-
...args
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
33
|
//# sourceMappingURL=api.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_blocks","require","
|
|
1
|
+
{"version":3,"names":["_blocks","require","_patternOverrides","_interopRequireDefault","_postMeta","registerCoreBlockBindingsSources","registerBlockBindingsSource","patternOverrides","postMeta"],"sources":["@wordpress/editor/src/bindings/api.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { registerBlockBindingsSource } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport patternOverrides from './pattern-overrides';\nimport postMeta from './post-meta';\n\n/**\n * Function to register core block bindings sources provided by the editor.\n *\n * @example\n * ```js\n * import { registerCoreBlockBindingsSources } from '@wordpress/editor';\n *\n * registerCoreBlockBindingsSources();\n * ```\n */\nexport function registerCoreBlockBindingsSources() {\n\tregisterBlockBindingsSource( patternOverrides );\n\tregisterBlockBindingsSource( postMeta );\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAKA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,SAAA,GAAAD,sBAAA,CAAAF,OAAA;AATA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASI,gCAAgCA,CAAA,EAAG;EAClD,IAAAC,mCAA2B,EAAEC,yBAAiB,CAAC;EAC/C,IAAAD,mCAA2B,EAAEE,iBAAS,CAAC;AACxC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_data","_coreData","_jsxRuntime","getUserLabel","user","avatar","avatar_urls","jsx","className","alt","src","jsxs","Fragment","children","name","slug","_default","exports","default","triggerPrefix","useItems","filterValue","users","useSelect","select","getUsers","coreStore","context","search","encodeURIComponent","options","useMemo","map","key","value","label","getOptionCompletion"],"sources":["@wordpress/editor/src/components/autocompleters/user.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/** @typedef {import('@wordpress/components').WPCompleter} WPCompleter */\n\nexport function getUserLabel( user ) {\n\tconst avatar =\n\t\tuser.avatar_urls && user.avatar_urls[ 24 ] ? (\n\t\t\t<img\n\t\t\t\tclassName=\"editor-autocompleters__user-avatar\"\n\t\t\t\talt=\"\"\n\t\t\t\tsrc={ user.avatar_urls[ 24 ] }\n\t\t\t/>\n\t\t) : (\n\t\t\t<span className=\"editor-autocompleters__no-avatar\"></span>\n\t\t);\n\n\treturn (\n\t\t<>\n\t\t\t{ avatar }\n\t\t\t<span className=\"editor-autocompleters__user-name\">\n\t\t\t\t{ user.name }\n\t\t\t</span>\n\t\t\t<span className=\"editor-autocompleters__user-slug\">\n\t\t\t\t{ user.slug }\n\t\t\t</span>\n\t\t</>\n\t);\n}\n\n/**\n * A user mentions completer.\n *\n * @type {WPCompleter}\n */\nexport default {\n\tname: 'users',\n\tclassName: 'editor-autocompleters__user',\n\ttriggerPrefix: '@',\n\n\tuseItems( filterValue ) {\n\t\tconst users = useSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst { getUsers } = select( coreStore );\n\t\t\t\treturn getUsers( {\n\t\t\t\t\tcontext: 'view',\n\t\t\t\t\tsearch: encodeURIComponent( filterValue ),\n\t\t\t\t} );\n\t\t\t},\n\t\t\t[ filterValue ]\n\t\t);\n\n\t\tconst options = useMemo(\n\t\t\t() =>\n\t\t\t\tusers\n\t\t\t\t\t? users.map( ( user ) => ( {\n\t\t\t\t\t\t\tkey: `user-${ user.slug }`,\n\t\t\t\t\t\t\tvalue: user,\n\t\t\t\t\t\t\tlabel: getUserLabel( user ),\n\t\t\t\t\t } ) )\n\t\t\t\t\t: [],\n\t\t\t[ users ]\n\t\t);\n\n\t\treturn [ options ];\n\t},\n\n\tgetOptionCompletion( user ) {\n\t\treturn `@${ user.slug }`;\n\t},\n};\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAA0D,IAAAG,WAAA,GAAAH,OAAA;AAL1D;AACA;AACA;;AAKA;;AAEO,SAASI,YAAYA,CAAEC,IAAI,EAAG;EACpC,MAAMC,MAAM,GACXD,IAAI,CAACE,WAAW,IAA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UserLabel","user","avatar","avatar_urls","jsx","className","alt","src","jsxs","Fragment","children","name","slug","_default","exports","default","triggerPrefix","useItems","filterValue","users","useSelect","select","getUsers","coreStore","context","search","encodeURIComponent","options","useMemo","map","key","value","label","getOptionCompletion"],"sources":["@wordpress/editor/src/components/autocompleters/user.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/** @typedef {import('@wordpress/components').WPCompleter} WPCompleter */\n\nexport function getUserLabel( user ) {\n\tconst avatar =\n\t\tuser.avatar_urls && user.avatar_urls[ 24 ] ? (\n\t\t\t<img\n\t\t\t\tclassName=\"editor-autocompleters__user-avatar\"\n\t\t\t\talt=\"\"\n\t\t\t\tsrc={ user.avatar_urls[ 24 ] }\n\t\t\t/>\n\t\t) : (\n\t\t\t<span className=\"editor-autocompleters__no-avatar\"></span>\n\t\t);\n\n\treturn (\n\t\t<>\n\t\t\t{ avatar }\n\t\t\t<span className=\"editor-autocompleters__user-name\">\n\t\t\t\t{ user.name }\n\t\t\t</span>\n\t\t\t<span className=\"editor-autocompleters__user-slug\">\n\t\t\t\t{ user.slug }\n\t\t\t</span>\n\t\t</>\n\t);\n}\n\n/**\n * A user mentions completer.\n *\n * @type {WPCompleter}\n */\nexport default {\n\tname: 'users',\n\tclassName: 'editor-autocompleters__user',\n\ttriggerPrefix: '@',\n\n\tuseItems( filterValue ) {\n\t\tconst users = useSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst { getUsers } = select( coreStore );\n\t\t\t\treturn getUsers( {\n\t\t\t\t\tcontext: 'view',\n\t\t\t\t\tsearch: encodeURIComponent( filterValue ),\n\t\t\t\t} );\n\t\t\t},\n\t\t\t[ filterValue ]\n\t\t);\n\n\t\tconst options = useMemo(\n\t\t\t() =>\n\t\t\t\tusers\n\t\t\t\t\t? users.map( ( user ) => ( {\n\t\t\t\t\t\t\tkey: `user-${ user.slug }`,\n\t\t\t\t\t\t\tvalue: user,\n\t\t\t\t\t\t\tlabel: getUserLabel( user ),\n\t\t\t\t\t } ) )\n\t\t\t\t\t: [],\n\t\t\t[ users ]\n\t\t);\n\n\t\treturn [ options ];\n\t},\n\n\tgetOptionCompletion( user ) {\n\t\treturn `@${ user.slug }`;\n\t},\n};\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAA0D,IAAAG,WAAA,GAAAH,OAAA;AAL1D;AACA;AACA;;AAKA;;AAEO,SAASI,YAAYA,CAAEC,IAAI,EAAG;EACpC,MAAMC,MAAM,GACXD,IAAI,CAACE,WAAW,IAAIF,IAAI,CAACE,WAAW,CAAE,EAAE,CAAE,gBACzC,IAAAJ,WAAA,CAAAK,GAAA;IACCC,SAAS,EAAC,oCAAoC;IAC9CC,GAAG,EAAC,EAAE;IACNC,GAAG,EAAGN,IAAI,CAACE,WAAW,CAAE,EAAE;EAAI,CAC9B,CAAC,gBAEF,IAAAJ,WAAA,CAAAK,GAAA;IAAMC,SAAS,EAAC;EAAkC,CAAO,CACzD;EAEF,oBACC,IAAAN,WAAA,CAAAS,IAAA,EAAAT,WAAA,CAAAU,QAAA;IAAAC,QAAA,GACGR,MAAM,eACR,IAAAH,WAAA,CAAAK,GAAA;MAAMC,SAAS,EAAC,kCAAkC;MAAAK,QAAA,EAC/CT,IAAI,CAACU;IAAI,CACN,CAAC,eACP,IAAAZ,WAAA,CAAAK,GAAA;MAAMC,SAAS,EAAC,kCAAkC;MAAAK,QAAA,EAC/CT,IAAI,CAACW;IAAI,CACN,CAAC;EAAA,CACN,CAAC;AAEL;;AAEA;AACA;AACA;AACA;AACA;AAJA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAKe;EACdJ,IAAI,EAAE,OAAO;EACbN,SAAS,EAAE,6BAA6B;EACxCW,aAAa,EAAE,GAAG;EAElBC,QAAQA,CAAEC,WAAW,EAAG;IACvB,MAAMC,KAAK,GAAG,IAAAC,eAAS,EACpBC,MAAM,IAAM;MACb,MAAM;QAAEC;MAAS,CAAC,GAAGD,MAAM,CAAEE,eAAU,CAAC;MACxC,OAAOD,QAAQ,CAAE;QAChBE,OAAO,EAAE,MAAM;QACfC,MAAM,EAAEC,kBAAkB,CAAER,WAAY;MACzC,CAAE,CAAC;IACJ,CAAC,EACD,CAAEA,WAAW,CACd,CAAC;IAED,MAAMS,OAAO,GAAG,IAAAC,gBAAO,EACtB,MACCT,KAAK,GACFA,KAAK,CAACU,GAAG,CAAI5B,IAAI,KAAQ;MACzB6B,GAAG,EAAE,QAAS7B,IAAI,CAACW,IAAI,EAAG;MAC1BmB,KAAK,EAAE9B,IAAI;MACX+B,KAAK,EAAEhC,YAAY,CAAEC,IAAK;IAC1B,CAAC,CAAG,CAAC,GACL,EAAE,EACN,CAAEkB,KAAK,CACR,CAAC;IAED,OAAO,CAAEQ,OAAO,CAAE;EACnB,CAAC;EAEDM,mBAAmBA,CAAEhC,IAAI,EAAG;IAC3B,OAAO,IAAKA,IAAI,CAACW,IAAI,EAAG;EACzB;AACD,CAAC","ignoreList":[]}
|
|
@@ -70,7 +70,7 @@ function BlockManager() {
|
|
|
70
70
|
return;
|
|
71
71
|
}
|
|
72
72
|
const count = filteredBlockTypes.length;
|
|
73
|
-
const resultsFoundMessage = (0, _i18n.sprintf)(
|
|
73
|
+
const resultsFoundMessage = (0, _i18n.sprintf)(/* translators: %d: number of results. */
|
|
74
74
|
(0, _i18n._n)('%d result found.', '%d results found.', count), count);
|
|
75
75
|
debouncedSpeak(resultsFoundMessage);
|
|
76
76
|
}, [filteredBlockTypes?.length, search, debouncedSpeak]);
|
|
@@ -78,7 +78,7 @@ function BlockManager() {
|
|
|
78
78
|
className: "editor-block-manager__content",
|
|
79
79
|
children: [!!numberOfHiddenBlocks && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
80
80
|
className: "editor-block-manager__disabled-blocks-count",
|
|
81
|
-
children: [(0, _i18n.sprintf)(
|
|
81
|
+
children: [(0, _i18n.sprintf)(/* translators: %d: number of blocks. */
|
|
82
82
|
(0, _i18n._n)('%d block is hidden.', '%d blocks are hidden.', numberOfHiddenBlocks), numberOfHiddenBlocks), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
83
83
|
__next40pxDefaultSize: true,
|
|
84
84
|
variant: "link",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_blocks","require","_data","_components","_i18n","_element","_compose","_a11y","_preferences","_lockUnlock","_store","_category","_interopRequireDefault","_jsxRuntime","BlockManager","debouncedSpeak","useDebounce","speak","search","setSearch","useState","showBlockTypes","unlock","useDispatch","editorStore","blockTypes","categories","hasBlockSupport","isMatchingSearchTerm","numberOfHiddenBlocks","useSelect","select","_select$get","_blockTypes","blocksStore","getBlockTypes","hiddenBlockTypes","preferencesStore","get","filter","hiddenBlock","some","registeredBlock","name","getCategories","Array","isArray","length","enableAllBlockTypes","newBlockTypes","blockNames","map","filteredBlockTypes","blockType","parent","includes","useEffect","count","resultsFoundMessage","sprintf","_n","jsxs","className","children","jsx","Button","__next40pxDefaultSize","variant","onClick","__","SearchControl","__nextHasNoMarginBottom","label","placeholder","value","onChange","nextSearch","tabIndex","role","category","default","title","slug"],"sources":["@wordpress/editor/src/components/block-manager/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { SearchControl, Button } from '@wordpress/components';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { useEffect, useState } from '@wordpress/element';\nimport { useDebounce } from '@wordpress/compose';\nimport { speak } from '@wordpress/a11y';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editorStore } from '../../store';\nimport BlockManagerCategory from './category';\n\nexport default function BlockManager() {\n\tconst debouncedSpeak = useDebounce( speak, 500 );\n\tconst [ search, setSearch ] = useState( '' );\n\tconst { showBlockTypes } = unlock( useDispatch( editorStore ) );\n\n\tconst {\n\t\tblockTypes,\n\t\tcategories,\n\t\thasBlockSupport,\n\t\tisMatchingSearchTerm,\n\t\tnumberOfHiddenBlocks,\n\t} = useSelect( ( select ) => {\n\t\t// Some hidden blocks become unregistered\n\t\t// by removing for instance the plugin that registered them, yet\n\t\t// they're still remain as hidden by the user's action.\n\t\t// We consider \"hidden\", blocks which were hidden and\n\t\t// are still registered.\n\t\tconst _blockTypes = select( blocksStore ).getBlockTypes();\n\t\tconst hiddenBlockTypes = (\n\t\t\tselect( preferencesStore ).get( 'core', 'hiddenBlockTypes' ) ?? []\n\t\t).filter( ( hiddenBlock ) => {\n\t\t\treturn _blockTypes.some(\n\t\t\t\t( registeredBlock ) => registeredBlock.name === hiddenBlock\n\t\t\t);\n\t\t} );\n\n\t\treturn {\n\t\t\tblockTypes: _blockTypes,\n\t\t\tcategories: select( blocksStore ).getCategories(),\n\t\t\thasBlockSupport: select( blocksStore ).hasBlockSupport,\n\t\t\tisMatchingSearchTerm: select( blocksStore ).isMatchingSearchTerm,\n\t\t\tnumberOfHiddenBlocks:\n\t\t\t\tArray.isArray( hiddenBlockTypes ) && hiddenBlockTypes.length,\n\t\t};\n\t}, [] );\n\n\tfunction enableAllBlockTypes( newBlockTypes ) {\n\t\tconst blockNames = newBlockTypes.map( ( { name } ) => name );\n\t\tshowBlockTypes( blockNames );\n\t}\n\n\tconst filteredBlockTypes = blockTypes.filter(\n\t\t( blockType ) =>\n\t\t\thasBlockSupport( blockType, 'inserter', true ) &&\n\t\t\t( ! search || isMatchingSearchTerm( blockType, search ) ) &&\n\t\t\t( ! blockType.parent ||\n\t\t\t\tblockType.parent.includes( 'core/post-content' ) )\n\t);\n\n\t// Announce search results on change\n\tuseEffect( () => {\n\t\tif ( ! search ) {\n\t\t\treturn;\n\t\t}\n\t\tconst count = filteredBlockTypes.length;\n\t\tconst resultsFoundMessage = sprintf(\n\t\t\t/* translators: %d: number of results. */\n\t\t\t_n( '%d result found.', '%d results found.', count ),\n\t\t\tcount\n\t\t);\n\t\tdebouncedSpeak( resultsFoundMessage );\n\t}, [ filteredBlockTypes?.length, search, debouncedSpeak ] );\n\n\treturn (\n\t\t<div className=\"editor-block-manager__content\">\n\t\t\t{ !! numberOfHiddenBlocks && (\n\t\t\t\t<div className=\"editor-block-manager__disabled-blocks-count\">\n\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t/* translators: %d: number of blocks. */\n\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t'%d block is hidden.',\n\t\t\t\t\t\t\t'%d blocks are hidden.',\n\t\t\t\t\t\t\tnumberOfHiddenBlocks\n\t\t\t\t\t\t),\n\t\t\t\t\t\tnumberOfHiddenBlocks\n\t\t\t\t\t) }\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\tenableAllBlockTypes( filteredBlockTypes )\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Reset' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t<SearchControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tlabel={ __( 'Search for a block' ) }\n\t\t\t\tplaceholder={ __( 'Search for a block' ) }\n\t\t\t\tvalue={ search }\n\t\t\t\tonChange={ ( nextSearch ) => setSearch( nextSearch ) }\n\t\t\t\tclassName=\"editor-block-manager__search\"\n\t\t\t/>\n\t\t\t<div\n\t\t\t\ttabIndex=\"0\"\n\t\t\t\trole=\"region\"\n\t\t\t\taria-label={ __( 'Available block types' ) }\n\t\t\t\tclassName=\"editor-block-manager__results\"\n\t\t\t>\n\t\t\t\t{ filteredBlockTypes.length === 0 && (\n\t\t\t\t\t<p className=\"editor-block-manager__no-results\">\n\t\t\t\t\t\t{ __( 'No blocks found.' ) }\n\t\t\t\t\t</p>\n\t\t\t\t) }\n\t\t\t\t{ categories.map( ( category ) => (\n\t\t\t\t\t<BlockManagerCategory\n\t\t\t\t\t\tkey={ category.slug }\n\t\t\t\t\t\ttitle={ category.title }\n\t\t\t\t\t\tblockTypes={ filteredBlockTypes.filter(\n\t\t\t\t\t\t\t( blockType ) =>\n\t\t\t\t\t\t\t\tblockType.category === category.slug\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t\t<BlockManagerCategory\n\t\t\t\t\ttitle={ __( 'Uncategorized' ) }\n\t\t\t\t\tblockTypes={ filteredBlockTypes.filter(\n\t\t\t\t\t\t( { category } ) => ! category\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AAKA,IAAAQ,WAAA,GAAAR,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,SAAA,GAAAC,sBAAA,CAAAX,OAAA;AAA8C,IAAAY,WAAA,GAAAZ,OAAA;AAjB9C;AACA;AACA;;AAUA;AACA;AACA;;AAKe,SAASa,YAAYA,CAAA,EAAG;EACtC,MAAMC,cAAc,GAAG,IAAAC,oBAAW,EAAEC,WAAK,EAAE,GAAI,CAAC;EAChD,MAAM,CAAEC,MAAM,EAAEC,SAAS,CAAE,GAAG,IAAAC,iBAAQ,EAAE,EAAG,CAAC;EAC5C,MAAM;IAAEC;EAAe,CAAC,GAAG,IAAAC,kBAAM,EAAE,IAAA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C5C,CAAEnC,MAAM,IAAIU,oBAAoB,CAAEyB,SAAS,EAAEnC,MAAO,CAAC,CAAE,KACvD,CAAEmC,SAAS,CAACC,MAAM,IACnBD,SAAS,CAACC,MAAM,CAACC,QAAQ,CAAE,mBAAoB,CAAC,CACnD,CAAC;;EAED;EACA,IAAAC,kBAAS,EAAE,MAAM;IAChB,IAAK,CAAEtC,MAAM,EAAG;MACf;IACD;IACA,MAAMuC,KAAK,GAAGL,kBAAkB,CAACL,MAAM;IACvC,MAAMW,mBAAmB,GAAG,IAAAC,aAAO,
|
|
1
|
+
{"version":3,"names":["_blocks","require","_data","_components","_i18n","_element","_compose","_a11y","_preferences","_lockUnlock","_store","_category","_interopRequireDefault","_jsxRuntime","BlockManager","debouncedSpeak","useDebounce","speak","search","setSearch","useState","showBlockTypes","unlock","useDispatch","editorStore","blockTypes","categories","hasBlockSupport","isMatchingSearchTerm","numberOfHiddenBlocks","useSelect","select","_select$get","_blockTypes","blocksStore","getBlockTypes","hiddenBlockTypes","preferencesStore","get","filter","hiddenBlock","some","registeredBlock","name","getCategories","Array","isArray","length","enableAllBlockTypes","newBlockTypes","blockNames","map","filteredBlockTypes","blockType","parent","includes","useEffect","count","resultsFoundMessage","sprintf","_n","jsxs","className","children","jsx","Button","__next40pxDefaultSize","variant","onClick","__","SearchControl","__nextHasNoMarginBottom","label","placeholder","value","onChange","nextSearch","tabIndex","role","category","default","title","slug"],"sources":["@wordpress/editor/src/components/block-manager/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { SearchControl, Button } from '@wordpress/components';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { useEffect, useState } from '@wordpress/element';\nimport { useDebounce } from '@wordpress/compose';\nimport { speak } from '@wordpress/a11y';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editorStore } from '../../store';\nimport BlockManagerCategory from './category';\n\nexport default function BlockManager() {\n\tconst debouncedSpeak = useDebounce( speak, 500 );\n\tconst [ search, setSearch ] = useState( '' );\n\tconst { showBlockTypes } = unlock( useDispatch( editorStore ) );\n\n\tconst {\n\t\tblockTypes,\n\t\tcategories,\n\t\thasBlockSupport,\n\t\tisMatchingSearchTerm,\n\t\tnumberOfHiddenBlocks,\n\t} = useSelect( ( select ) => {\n\t\t// Some hidden blocks become unregistered\n\t\t// by removing for instance the plugin that registered them, yet\n\t\t// they're still remain as hidden by the user's action.\n\t\t// We consider \"hidden\", blocks which were hidden and\n\t\t// are still registered.\n\t\tconst _blockTypes = select( blocksStore ).getBlockTypes();\n\t\tconst hiddenBlockTypes = (\n\t\t\tselect( preferencesStore ).get( 'core', 'hiddenBlockTypes' ) ?? []\n\t\t).filter( ( hiddenBlock ) => {\n\t\t\treturn _blockTypes.some(\n\t\t\t\t( registeredBlock ) => registeredBlock.name === hiddenBlock\n\t\t\t);\n\t\t} );\n\n\t\treturn {\n\t\t\tblockTypes: _blockTypes,\n\t\t\tcategories: select( blocksStore ).getCategories(),\n\t\t\thasBlockSupport: select( blocksStore ).hasBlockSupport,\n\t\t\tisMatchingSearchTerm: select( blocksStore ).isMatchingSearchTerm,\n\t\t\tnumberOfHiddenBlocks:\n\t\t\t\tArray.isArray( hiddenBlockTypes ) && hiddenBlockTypes.length,\n\t\t};\n\t}, [] );\n\n\tfunction enableAllBlockTypes( newBlockTypes ) {\n\t\tconst blockNames = newBlockTypes.map( ( { name } ) => name );\n\t\tshowBlockTypes( blockNames );\n\t}\n\n\tconst filteredBlockTypes = blockTypes.filter(\n\t\t( blockType ) =>\n\t\t\thasBlockSupport( blockType, 'inserter', true ) &&\n\t\t\t( ! search || isMatchingSearchTerm( blockType, search ) ) &&\n\t\t\t( ! blockType.parent ||\n\t\t\t\tblockType.parent.includes( 'core/post-content' ) )\n\t);\n\n\t// Announce search results on change\n\tuseEffect( () => {\n\t\tif ( ! search ) {\n\t\t\treturn;\n\t\t}\n\t\tconst count = filteredBlockTypes.length;\n\t\tconst resultsFoundMessage = sprintf(\n\t\t\t/* translators: %d: number of results. */\n\t\t\t_n( '%d result found.', '%d results found.', count ),\n\t\t\tcount\n\t\t);\n\t\tdebouncedSpeak( resultsFoundMessage );\n\t}, [ filteredBlockTypes?.length, search, debouncedSpeak ] );\n\n\treturn (\n\t\t<div className=\"editor-block-manager__content\">\n\t\t\t{ !! numberOfHiddenBlocks && (\n\t\t\t\t<div className=\"editor-block-manager__disabled-blocks-count\">\n\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t/* translators: %d: number of blocks. */\n\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t'%d block is hidden.',\n\t\t\t\t\t\t\t'%d blocks are hidden.',\n\t\t\t\t\t\t\tnumberOfHiddenBlocks\n\t\t\t\t\t\t),\n\t\t\t\t\t\tnumberOfHiddenBlocks\n\t\t\t\t\t) }\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\tenableAllBlockTypes( filteredBlockTypes )\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Reset' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t<SearchControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tlabel={ __( 'Search for a block' ) }\n\t\t\t\tplaceholder={ __( 'Search for a block' ) }\n\t\t\t\tvalue={ search }\n\t\t\t\tonChange={ ( nextSearch ) => setSearch( nextSearch ) }\n\t\t\t\tclassName=\"editor-block-manager__search\"\n\t\t\t/>\n\t\t\t<div\n\t\t\t\ttabIndex=\"0\"\n\t\t\t\trole=\"region\"\n\t\t\t\taria-label={ __( 'Available block types' ) }\n\t\t\t\tclassName=\"editor-block-manager__results\"\n\t\t\t>\n\t\t\t\t{ filteredBlockTypes.length === 0 && (\n\t\t\t\t\t<p className=\"editor-block-manager__no-results\">\n\t\t\t\t\t\t{ __( 'No blocks found.' ) }\n\t\t\t\t\t</p>\n\t\t\t\t) }\n\t\t\t\t{ categories.map( ( category ) => (\n\t\t\t\t\t<BlockManagerCategory\n\t\t\t\t\t\tkey={ category.slug }\n\t\t\t\t\t\ttitle={ category.title }\n\t\t\t\t\t\tblockTypes={ filteredBlockTypes.filter(\n\t\t\t\t\t\t\t( blockType ) =>\n\t\t\t\t\t\t\t\tblockType.category === category.slug\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t\t<BlockManagerCategory\n\t\t\t\t\ttitle={ __( 'Uncategorized' ) }\n\t\t\t\t\tblockTypes={ filteredBlockTypes.filter(\n\t\t\t\t\t\t( { category } ) => ! category\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AAKA,IAAAQ,WAAA,GAAAR,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,SAAA,GAAAC,sBAAA,CAAAX,OAAA;AAA8C,IAAAY,WAAA,GAAAZ,OAAA;AAjB9C;AACA;AACA;;AAUA;AACA;AACA;;AAKe,SAASa,YAAYA,CAAA,EAAG;EACtC,MAAMC,cAAc,GAAG,IAAAC,oBAAW,EAAEC,WAAK,EAAE,GAAI,CAAC;EAChD,MAAM,CAAEC,MAAM,EAAEC,SAAS,CAAE,GAAG,IAAAC,iBAAQ,EAAE,EAAG,CAAC;EAC5C,MAAM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ices","_blockEditor","_coreData","_interface","_store","_constants","_patternRenameModal","_patternDuplicateModal","useEditorCommandLoader","editorMode","isListViewOpen","showBlockBreadcrumbs","isDistractionFree","isTopToolbar","isFocusMode","isPreviewMode","isViewable","isCodeEditingEnabled","isRichEditingEnabled","isPublishSidebarEnabled","useSelect","select","_get","_getPostType$viewable","get","preferencesStore","isListViewOpened","getCurrentPostType","getEditorSettings","editorStore","getSettings","blockEditorStore","getPostType","coreStore","__unstableIsPreviewMode","viewable","codeEditingEnabled","richEditingEnabled","getActiveComplementaryArea","interfaceStore","toggle","useDispatch","createInfoNotice","noticesStore","__unstableSaveForPreview","setIsListViewOpened","switchEditorMode","toggleDistractionFree","openModal","enableComplementaryArea","disableComplementaryArea","getCurrentPostId","allowSwitchEditorMode","commands","isLoading","push","name","label","__","icon","keyboard","callback","close","id","type","actions","onClick","listView","code","isRTL","drawerLeft","drawerRight","activeSidebar","blockDefault","formatListBullets","external","postId","link","window","open","useEditedEntityContextualCommands","postType","PATTERN_POST_TYPE","edit","patternRenameModalName","symbol","patternDuplicateModalName","useCommands","useCommandLoader","hook","context"],"sources":["@wordpress/editor/src/components/commands/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, isRTL } from '@wordpress/i18n';\nimport {\n\tblockDefault,\n\tcode,\n\tdrawerLeft,\n\tdrawerRight,\n\tedit,\n\tformatListBullets,\n\tlistView,\n\texternal,\n\tkeyboard,\n\tsymbol,\n} from '@wordpress/icons';\nimport { useCommandLoader } from '@wordpress/commands';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { PATTERN_POST_TYPE } from '../../store/constants';\nimport { modalName as patternRenameModalName } from '../pattern-rename-modal';\nimport { modalName as patternDuplicateModalName } from '../pattern-duplicate-modal';\n\nfunction useEditorCommandLoader() {\n\tconst {\n\t\teditorMode,\n\t\tisListViewOpen,\n\t\tshowBlockBreadcrumbs,\n\t\tisDistractionFree,\n\t\tisTopToolbar,\n\t\tisFocusMode,\n\t\tisPreviewMode,\n\t\tisViewable,\n\t\tisCodeEditingEnabled,\n\t\tisRichEditingEnabled,\n\t\tisPublishSidebarEnabled,\n\t} = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { isListViewOpened, getCurrentPostType, getEditorSettings } =\n\t\t\tselect( editorStore );\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst { getPostType } = select( coreStore );\n\n\t\treturn {\n\t\t\teditorMode: get( 'core', 'editorMode' ) ?? 'visual',\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tshowBlockBreadcrumbs: get( 'core', 'showBlockBreadcrumbs' ),\n\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\tisFocusMode: get( 'core', 'focusMode' ),\n\t\t\tisTopToolbar: get( 'core', 'fixedToolbar' ),\n\t\t\tisPreviewMode: getSettings().__unstableIsPreviewMode,\n\t\t\tisViewable: getPostType( getCurrentPostType() )?.viewable ?? false,\n\t\t\tisCodeEditingEnabled: getEditorSettings().codeEditingEnabled,\n\t\t\tisRichEditingEnabled: getEditorSettings().richEditingEnabled,\n\t\t\tisPublishSidebarEnabled:\n\t\t\t\tselect( editorStore ).isPublishSidebarEnabled(),\n\t\t};\n\t}, [] );\n\tconst { getActiveComplementaryArea } = useSelect( interfaceStore );\n\tconst { toggle } = useDispatch( preferencesStore );\n\tconst { createInfoNotice } = useDispatch( noticesStore );\n\tconst {\n\t\t__unstableSaveForPreview,\n\t\tsetIsListViewOpened,\n\t\tswitchEditorMode,\n\t\ttoggleDistractionFree,\n\t} = useDispatch( editorStore );\n\tconst { openModal, enableComplementaryArea, disableComplementaryArea } =\n\t\tuseDispatch( interfaceStore );\n\tconst { getCurrentPostId } = useSelect( editorStore );\n\tconst allowSwitchEditorMode = isCodeEditingEnabled && isRichEditingEnabled;\n\n\tif ( isPreviewMode ) {\n\t\treturn { commands: [], isLoading: false };\n\t}\n\n\tconst commands = [];\n\n\tcommands.push( {\n\t\tname: 'core/open-shortcut-help',\n\t\tlabel: __( 'Keyboard shortcuts' ),\n\t\ticon: keyboard,\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\topenModal( 'editor/keyboard-shortcut-help' );\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/toggle-distraction-free',\n\t\tlabel: isDistractionFree\n\t\t\t? __( 'Exit Distraction Free' )\n\t\t\t: __( 'Enter Distraction Free' ),\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggleDistractionFree();\n\t\t\tclose();\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/open-preferences',\n\t\tlabel: __( 'Editor preferences' ),\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\topenModal( 'editor/preferences' );\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/toggle-spotlight-mode',\n\t\tlabel: __( 'Toggle spotlight' ),\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggle( 'core', 'focusMode' );\n\t\t\tclose();\n\t\t\tcreateInfoNotice(\n\t\t\t\tisFocusMode ? __( 'Spotlight off.' ) : __( 'Spotlight on.' ),\n\t\t\t\t{\n\t\t\t\t\tid: 'core/editor/toggle-spotlight-mode/notice',\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tactions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\ttoggle( 'core', 'focusMode' );\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/toggle-list-view',\n\t\tlabel: isListViewOpen\n\t\t\t? __( 'Close List View' )\n\t\t\t: __( 'Open List View' ),\n\t\ticon: listView,\n\t\tcallback: ( { close } ) => {\n\t\t\tsetIsListViewOpened( ! isListViewOpen );\n\t\t\tclose();\n\t\t\tcreateInfoNotice(\n\t\t\t\tisListViewOpen ? __( 'List View off.' ) : __( 'List View on.' ),\n\t\t\t\t{\n\t\t\t\t\tid: 'core/editor/toggle-list-view/notice',\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/toggle-top-toolbar',\n\t\tlabel: __( 'Toggle top toolbar' ),\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggle( 'core', 'fixedToolbar' );\n\t\t\tif ( isDistractionFree ) {\n\t\t\t\ttoggleDistractionFree();\n\t\t\t}\n\t\t\tclose();\n\t\t\tcreateInfoNotice(\n\t\t\t\tisTopToolbar\n\t\t\t\t\t? __( 'Top toolbar off.' )\n\t\t\t\t\t: __( 'Top toolbar on.' ),\n\t\t\t\t{\n\t\t\t\t\tid: 'core/editor/toggle-top-toolbar/notice',\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tactions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\ttoggle( 'core', 'fixedToolbar' );\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\t} );\n\n\tif ( allowSwitchEditorMode ) {\n\t\tcommands.push( {\n\t\t\tname: 'core/toggle-code-editor',\n\t\t\tlabel:\n\t\t\t\teditorMode === 'visual'\n\t\t\t\t\t? __( 'Open code editor' )\n\t\t\t\t\t: __( 'Exit code editor' ),\n\t\t\ticon: code,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tswitchEditorMode( editorMode === 'visual' ? 'text' : 'visual' );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\tcommands.push( {\n\t\tname: 'core/toggle-breadcrumbs',\n\t\tlabel: showBlockBreadcrumbs\n\t\t\t? __( 'Hide block breadcrumbs' )\n\t\t\t: __( 'Show block breadcrumbs' ),\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggle( 'core', 'showBlockBreadcrumbs' );\n\t\t\tclose();\n\t\t\tcreateInfoNotice(\n\t\t\t\tshowBlockBreadcrumbs\n\t\t\t\t\t? __( 'Breadcrumbs hidden.' )\n\t\t\t\t\t: __( 'Breadcrumbs visible.' ),\n\t\t\t\t{\n\t\t\t\t\tid: 'core/editor/toggle-breadcrumbs/notice',\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/open-settings-sidebar',\n\t\tlabel: __( 'Toggle settings sidebar' ),\n\t\ticon: isRTL() ? drawerLeft : drawerRight,\n\t\tcallback: ( { close } ) => {\n\t\t\tconst activeSidebar = getActiveComplementaryArea( 'core' );\n\t\t\tclose();\n\t\t\tif ( activeSidebar === 'edit-post/document' ) {\n\t\t\t\tdisableComplementaryArea( 'core' );\n\t\t\t} else {\n\t\t\t\tenableComplementaryArea( 'core', 'edit-post/document' );\n\t\t\t}\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/open-block-inspector',\n\t\tlabel: __( 'Toggle block inspector' ),\n\t\ticon: blockDefault,\n\t\tcallback: ( { close } ) => {\n\t\t\tconst activeSidebar = getActiveComplementaryArea( 'core' );\n\t\t\tclose();\n\t\t\tif ( activeSidebar === 'edit-post/block' ) {\n\t\t\t\tdisableComplementaryArea( 'core' );\n\t\t\t} else {\n\t\t\t\tenableComplementaryArea( 'core', 'edit-post/block' );\n\t\t\t}\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/toggle-publish-sidebar',\n\t\tlabel: isPublishSidebarEnabled\n\t\t\t? __( 'Disable pre-publish checks' )\n\t\t\t: __( 'Enable pre-publish checks' ),\n\t\ticon: formatListBullets,\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\ttoggle( 'core', 'isPublishSidebarEnabled' );\n\t\t\tcreateInfoNotice(\n\t\t\t\tisPublishSidebarEnabled\n\t\t\t\t\t? __( 'Pre-publish checks disabled.' )\n\t\t\t\t\t: __( 'Pre-publish checks enabled.' ),\n\t\t\t\t{\n\t\t\t\t\tid: 'core/editor/publish-sidebar/notice',\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\t} );\n\n\tif ( isViewable ) {\n\t\tcommands.push( {\n\t\t\tname: 'core/preview-link',\n\t\t\tlabel: __( 'Preview in a new tab' ),\n\t\t\ticon: external,\n\t\t\tcallback: async ( { close } ) => {\n\t\t\t\tclose();\n\t\t\t\tconst postId = getCurrentPostId();\n\t\t\t\tconst link = await __unstableSaveForPreview();\n\t\t\t\twindow.open( link, `wp-preview-${ postId }` );\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn {\n\t\tcommands,\n\t\tisLoading: false,\n\t};\n}\n\nfunction useEditedEntityContextualCommands() {\n\tconst { postType } = useSelect( ( select ) => {\n\t\tconst { getCurrentPostType } = select( editorStore );\n\t\treturn {\n\t\t\tpostType: getCurrentPostType(),\n\t\t};\n\t}, [] );\n\tconst { openModal } = useDispatch( interfaceStore );\n\tconst commands = [];\n\n\tif ( postType === PATTERN_POST_TYPE ) {\n\t\tcommands.push( {\n\t\t\tname: 'core/rename-pattern',\n\t\t\tlabel: __( 'Rename pattern' ),\n\t\t\ticon: edit,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\topenModal( patternRenameModalName );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t\tcommands.push( {\n\t\t\tname: 'core/duplicate-pattern',\n\t\t\tlabel: __( 'Duplicate pattern' ),\n\t\t\ticon: symbol,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\topenModal( patternDuplicateModalName );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn { isLoading: false, commands };\n}\n\nexport default function useCommands() {\n\tuseCommandLoader( {\n\t\tname: 'core/editor/edit-ui',\n\t\thook: useEditorCommandLoader,\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/editor/contextual-commands',\n\t\thook: useEditedEntityContextualCommands,\n\t\tcontext: 'entity-edit',\n\t} );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAYA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,UAAA,GAAAR,OAAA;AAKA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,UAAA,GAAAV,OAAA;AACA,IAAAW,mBAAA,GAAAX,OAAA;AACA,IAAAY,sBAAA,GAAAZ,OAAA;AA9BA;AACA;AACA;;AAsBA;AACA;AACA;;AAMA,SAASa,sBAAsBA,CAAA,EAAG;EACjC,MAAM;IACLC,UAAU;IACVC,cAAc;IACdC,oBAAoB;IACpBC,iBAAiB;IACjBC,YAAY;IACZC,WAAW;IACXC,aAAa;IACbC,UAAU;IACVC,oBAAoB;IACpBC,oBAAoB;IACpBC;EACD,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAAA,IAAAC,IAAA,EAAAC,qBAAA;IAC5B,MAAM;MAAEC;IAAI,CAAC,GAAGH,MAAM,CAAEI,kBAAiB,CAAC;IAC1C,MAAM;MAAEC,gBAAgB;MAAEC,kBAAkB;MAAEC;IAAkB,CAAC,GAChEP,MAAM,CAAEQ,YAAY,CAAC;IACtB,MAAM;MAAEC;I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AAC;IAC9B,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EACP,MAAM;IAAEqB;EAAU,CAAC,GAAG,IAAAP,iBAAW,EAAEF,gBAAe,CAAC;EACnD,MAAMc,QAAQ,GAAG,EAAE;EAEnB,IAAK4B,QAAQ,KAAKC,4BAAiB,EAAG;IACrC7B,QAAQ,CAACE,IAAI,CAAE;MACdC,IAAI,EAAE,qBAAqB;MAC3BC,KAAK,EAAE,IAAAC,QAAE,EAAE,gBAAiB,CAAC;MAC7BC,IAAI,EAAEwB,WAAI;MACVtB,QAAQ,EAAEA,CAAE;QAAEC;MAAM,CAAC,KAAM;QAC1Bd,SAAS,CAAEoC,6BAAuB,CAAC;QACnCtB,KAAK,CAAC,CAAC;MACR;IACD,CAAE,CAAC;IACHT,QAAQ,CAACE,IAAI,CAAE;MACdC,IAAI,EAAE,wBAAwB;MAC9BC,KAAK,EAAE,IAAAC,QAAE,EAAE,mBAAoB,CAAC;MAChCC,IAAI,EAAE0B,aAAM;MACZxB,QAAQ,EAAEA,CAAE;QAAEC;MAAM,CAAC,KAAM;QAC1Bd,SAAS,CAAEsC,gCAA0B,CAAC;QACtCxB,KAAK,CAAC,CAAC;MACR;IACD,CAAE,CAAC;EACJ;EAEA,OAAO;IAAER,SAAS,EAAE,KAAK;IAAED;EAAS,CAAC;AACtC;AAEe,SAASkC,WAAWA,CAAA,EAAG;EACrC,IAAAC,0BAAgB,EAAE;IACjBhC,IAAI,EAAE,qBAAqB;IAC3BiC,IAAI,EAAEjF;EACP,CAAE,CAAC;EAEH,IAAAgF,0BAAgB,EAAE;IACjBhC,IAAI,EAAE,iCAAiC;IACvCiC,IAAI,EAAET,iCAAiC;IACvCU,OAAO,EAAE;EACV,CAAE,CAAC;AACJ","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_data","require","_i18n","_icons","_commands","_preferences","_notices","_blockEditor","_coreData","_interface","_store","_constants","_patternRenameModal","_patternDuplicateModal","useEditorCommandLoader","editorMode","isListViewOpen","showBlockBreadcrumbs","isDistractionFree","isTopToolbar","isFocusMode","isPreviewMode","isViewable","isCodeEditingEnabled","isRichEditingEnabled","isPublishSidebarEnabled","useSelect","select","_get","_getPostType$viewable","get","preferencesStore","isListViewOpened","getCurrentPostType","getEditorSettings","editorStore","getSettings","blockEditorStore","getPostType","coreStore","__unstableIsPreviewMode","viewable","codeEditingEnabled","richEditingEnabled","getActiveComplementaryArea","interfaceStore","toggle","useDispatch","createInfoNotice","noticesStore","__unstableSaveForPreview","setIsListViewOpened","switchEditorMode","toggleDistractionFree","openModal","enableComplementaryArea","disableComplementaryArea","getCurrentPostId","allowSwitchEditorMode","commands","isLoading","push","name","label","__","icon","keyboard","callback","close","id","type","actions","onClick","listView","code","isRTL","drawerLeft","drawerRight","activeSidebar","blockDefault","formatListBullets","external","postId","link","window","open","useEditedEntityContextualCommands","postType","PATTERN_POST_TYPE","edit","patternRenameModalName","symbol","patternDuplicateModalName","useCommands","useCommandLoader","hook","context"],"sources":["@wordpress/editor/src/components/commands/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, isRTL } from '@wordpress/i18n';\nimport {\n\tblockDefault,\n\tcode,\n\tdrawerLeft,\n\tdrawerRight,\n\tedit,\n\tformatListBullets,\n\tlistView,\n\texternal,\n\tkeyboard,\n\tsymbol,\n} from '@wordpress/icons';\nimport { useCommandLoader } from '@wordpress/commands';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { PATTERN_POST_TYPE } from '../../store/constants';\nimport { modalName as patternRenameModalName } from '../pattern-rename-modal';\nimport { modalName as patternDuplicateModalName } from '../pattern-duplicate-modal';\n\nfunction useEditorCommandLoader() {\n\tconst {\n\t\teditorMode,\n\t\tisListViewOpen,\n\t\tshowBlockBreadcrumbs,\n\t\tisDistractionFree,\n\t\tisTopToolbar,\n\t\tisFocusMode,\n\t\tisPreviewMode,\n\t\tisViewable,\n\t\tisCodeEditingEnabled,\n\t\tisRichEditingEnabled,\n\t\tisPublishSidebarEnabled,\n\t} = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { isListViewOpened, getCurrentPostType, getEditorSettings } =\n\t\t\tselect( editorStore );\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst { getPostType } = select( coreStore );\n\n\t\treturn {\n\t\t\teditorMode: get( 'core', 'editorMode' ) ?? 'visual',\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tshowBlockBreadcrumbs: get( 'core', 'showBlockBreadcrumbs' ),\n\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\tisFocusMode: get( 'core', 'focusMode' ),\n\t\t\tisTopToolbar: get( 'core', 'fixedToolbar' ),\n\t\t\tisPreviewMode: getSettings().__unstableIsPreviewMode,\n\t\t\tisViewable: getPostType( getCurrentPostType() )?.viewable ?? false,\n\t\t\tisCodeEditingEnabled: getEditorSettings().codeEditingEnabled,\n\t\t\tisRichEditingEnabled: getEditorSettings().richEditingEnabled,\n\t\t\tisPublishSidebarEnabled:\n\t\t\t\tselect( editorStore ).isPublishSidebarEnabled(),\n\t\t};\n\t}, [] );\n\tconst { getActiveComplementaryArea } = useSelect( interfaceStore );\n\tconst { toggle } = useDispatch( preferencesStore );\n\tconst { createInfoNotice } = useDispatch( noticesStore );\n\tconst {\n\t\t__unstableSaveForPreview,\n\t\tsetIsListViewOpened,\n\t\tswitchEditorMode,\n\t\ttoggleDistractionFree,\n\t} = useDispatch( editorStore );\n\tconst { openModal, enableComplementaryArea, disableComplementaryArea } =\n\t\tuseDispatch( interfaceStore );\n\tconst { getCurrentPostId } = useSelect( editorStore );\n\tconst allowSwitchEditorMode = isCodeEditingEnabled && isRichEditingEnabled;\n\n\tif ( isPreviewMode ) {\n\t\treturn { commands: [], isLoading: false };\n\t}\n\n\tconst commands = [];\n\n\tcommands.push( {\n\t\tname: 'core/open-shortcut-help',\n\t\tlabel: __( 'Keyboard shortcuts' ),\n\t\ticon: keyboard,\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\topenModal( 'editor/keyboard-shortcut-help' );\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/toggle-distraction-free',\n\t\tlabel: isDistractionFree\n\t\t\t? __( 'Exit Distraction Free' )\n\t\t\t: __( 'Enter Distraction Free' ),\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggleDistractionFree();\n\t\t\tclose();\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/open-preferences',\n\t\tlabel: __( 'Editor preferences' ),\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\topenModal( 'editor/preferences' );\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/toggle-spotlight-mode',\n\t\tlabel: __( 'Toggle spotlight' ),\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggle( 'core', 'focusMode' );\n\t\t\tclose();\n\t\t\tcreateInfoNotice(\n\t\t\t\tisFocusMode ? __( 'Spotlight off.' ) : __( 'Spotlight on.' ),\n\t\t\t\t{\n\t\t\t\t\tid: 'core/editor/toggle-spotlight-mode/notice',\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tactions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\ttoggle( 'core', 'focusMode' );\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/toggle-list-view',\n\t\tlabel: isListViewOpen\n\t\t\t? __( 'Close List View' )\n\t\t\t: __( 'Open List View' ),\n\t\ticon: listView,\n\t\tcallback: ( { close } ) => {\n\t\t\tsetIsListViewOpened( ! isListViewOpen );\n\t\t\tclose();\n\t\t\tcreateInfoNotice(\n\t\t\t\tisListViewOpen ? __( 'List View off.' ) : __( 'List View on.' ),\n\t\t\t\t{\n\t\t\t\t\tid: 'core/editor/toggle-list-view/notice',\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/toggle-top-toolbar',\n\t\tlabel: __( 'Toggle top toolbar' ),\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggle( 'core', 'fixedToolbar' );\n\t\t\tif ( isDistractionFree ) {\n\t\t\t\ttoggleDistractionFree();\n\t\t\t}\n\t\t\tclose();\n\t\t\tcreateInfoNotice(\n\t\t\t\tisTopToolbar\n\t\t\t\t\t? __( 'Top toolbar off.' )\n\t\t\t\t\t: __( 'Top toolbar on.' ),\n\t\t\t\t{\n\t\t\t\t\tid: 'core/editor/toggle-top-toolbar/notice',\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tactions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\ttoggle( 'core', 'fixedToolbar' );\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\t} );\n\n\tif ( allowSwitchEditorMode ) {\n\t\tcommands.push( {\n\t\t\tname: 'core/toggle-code-editor',\n\t\t\tlabel:\n\t\t\t\teditorMode === 'visual'\n\t\t\t\t\t? __( 'Open code editor' )\n\t\t\t\t\t: __( 'Exit code editor' ),\n\t\t\ticon: code,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tswitchEditorMode( editorMode === 'visual' ? 'text' : 'visual' );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\tcommands.push( {\n\t\tname: 'core/toggle-breadcrumbs',\n\t\tlabel: showBlockBreadcrumbs\n\t\t\t? __( 'Hide block breadcrumbs' )\n\t\t\t: __( 'Show block breadcrumbs' ),\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggle( 'core', 'showBlockBreadcrumbs' );\n\t\t\tclose();\n\t\t\tcreateInfoNotice(\n\t\t\t\tshowBlockBreadcrumbs\n\t\t\t\t\t? __( 'Breadcrumbs hidden.' )\n\t\t\t\t\t: __( 'Breadcrumbs visible.' ),\n\t\t\t\t{\n\t\t\t\t\tid: 'core/editor/toggle-breadcrumbs/notice',\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/open-settings-sidebar',\n\t\tlabel: __( 'Toggle settings sidebar' ),\n\t\ticon: isRTL() ? drawerLeft : drawerRight,\n\t\tcallback: ( { close } ) => {\n\t\t\tconst activeSidebar = getActiveComplementaryArea( 'core' );\n\t\t\tclose();\n\t\t\tif ( activeSidebar === 'edit-post/document' ) {\n\t\t\t\tdisableComplementaryArea( 'core' );\n\t\t\t} else {\n\t\t\t\tenableComplementaryArea( 'core', 'edit-post/document' );\n\t\t\t}\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/open-block-inspector',\n\t\tlabel: __( 'Toggle block inspector' ),\n\t\ticon: blockDefault,\n\t\tcallback: ( { close } ) => {\n\t\t\tconst activeSidebar = getActiveComplementaryArea( 'core' );\n\t\t\tclose();\n\t\t\tif ( activeSidebar === 'edit-post/block' ) {\n\t\t\t\tdisableComplementaryArea( 'core' );\n\t\t\t} else {\n\t\t\t\tenableComplementaryArea( 'core', 'edit-post/block' );\n\t\t\t}\n\t\t},\n\t} );\n\n\tcommands.push( {\n\t\tname: 'core/toggle-publish-sidebar',\n\t\tlabel: isPublishSidebarEnabled\n\t\t\t? __( 'Disable pre-publish checks' )\n\t\t\t: __( 'Enable pre-publish checks' ),\n\t\ticon: formatListBullets,\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\ttoggle( 'core', 'isPublishSidebarEnabled' );\n\t\t\tcreateInfoNotice(\n\t\t\t\tisPublishSidebarEnabled\n\t\t\t\t\t? __( 'Pre-publish checks disabled.' )\n\t\t\t\t\t: __( 'Pre-publish checks enabled.' ),\n\t\t\t\t{\n\t\t\t\t\tid: 'core/editor/publish-sidebar/notice',\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\t} );\n\n\tif ( isViewable ) {\n\t\tcommands.push( {\n\t\t\tname: 'core/preview-link',\n\t\t\tlabel: __( 'Preview in a new tab' ),\n\t\t\ticon: external,\n\t\t\tcallback: async ( { close } ) => {\n\t\t\t\tclose();\n\t\t\t\tconst postId = getCurrentPostId();\n\t\t\t\tconst link = await __unstableSaveForPreview();\n\t\t\t\twindow.open( link, `wp-preview-${ postId }` );\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn {\n\t\tcommands,\n\t\tisLoading: false,\n\t};\n}\n\nfunction useEditedEntityContextualCommands() {\n\tconst { postType } = useSelect( ( select ) => {\n\t\tconst { getCurrentPostType } = select( editorStore );\n\t\treturn {\n\t\t\tpostType: getCurrentPostType(),\n\t\t};\n\t}, [] );\n\tconst { openModal } = useDispatch( interfaceStore );\n\tconst commands = [];\n\n\tif ( postType === PATTERN_POST_TYPE ) {\n\t\tcommands.push( {\n\t\t\tname: 'core/rename-pattern',\n\t\t\tlabel: __( 'Rename pattern' ),\n\t\t\ticon: edit,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\topenModal( patternRenameModalName );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t\tcommands.push( {\n\t\t\tname: 'core/duplicate-pattern',\n\t\t\tlabel: __( 'Duplicate pattern' ),\n\t\t\ticon: symbol,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\topenModal( patternDuplicateModalName );\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn { isLoading: false, commands };\n}\n\nexport default function useCommands() {\n\tuseCommandLoader( {\n\t\tname: 'core/editor/edit-ui',\n\t\thook: useEditorCommandLoader,\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/editor/contextual-commands',\n\t\thook: useEditedEntityContextualCommands,\n\t\tcontext: 'entity-edit',\n\t} );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAYA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,UAAA,GAAAR,OAAA;AAKA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,UAAA,GAAAV,OAAA;AACA,IAAAW,mBAAA,GAAAX,OAAA;AACA,IAAAY,sBAAA,GAAAZ,OAAA;AA9BA;AACA;AACA;;AAsBA;AACA;AACA;;AAMA,SAASa,sBAAsBA,CAAA,EAAG;EACjC,MAAM;IACLC,UAAU;IACVC,cAAc;IACdC,oBAAoB;IACpBC,iBAAiB;IACjBC,YAAY;IACZC,WAAW;IACXC,aAAa;IACbC,UAAU;IACVC,oBAAoB;IACpBC,oBAAoB;IACpBC;EACD,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAAA,IAAAC,IAAA,EAAAC,qBAAA;IAC5B,MAAM;MAAEC;IAAI,CAAC,GAAGH,MAAM,CAAEI,kBAAiB,CAAC;IAC1C,MAAM;MAAEC,gBAAgB;MAAEC,kBAAkB;MAAEC;IAAkB,CAAC,GAChEP,MAAM,CAAEQ,YAAY,CAAC;IACtB,MAAM;MAAEC;IAAY,CAAC,GAAGT,MAAM,CAAEU,kBAAiB,CAAC;IAClD,MAAM;MAAEC;IAAY,CAAC,GAAGX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IAAAP,iBAAW,EAAEF,gBAAe,CAAC;EACnD,MAAMc,QAAQ,GAAG,EAAE;EAEnB,IAAK4B,QAAQ,KAAKC,4BAAiB,EAAG;IACrC7B,QAAQ,CAACE,IAAI,CAAE;MACdC,IAAI,EAAE,qBAAqB;MAC3BC,KAAK,EAAE,IAAAC,QAAE,EAAE,gBAAiB,CAAC;MAC7BC,IAAI,EAAEwB,WAAI;MACVtB,QAAQ,EAAEA,CAAE;QAAEC;MAAM,CAAC,KAAM;QAC1Bd,SAAS,CAAEoC,6BAAuB,CAAC;QACnCtB,KAAK,CAAC,CAAC;MACR;IACD,CAAE,CAAC;IACHT,QAAQ,CAACE,IAAI,CAAE;MACdC,IAAI,EAAE,wBAAwB;MAC9BC,KAAK,EAAE,IAAAC,QAAE,EAAE,mBAAoB,CAAC;MAChCC,IAAI,EAAE0B,aAAM;MACZxB,QAAQ,EAAEA,CAAE;QAAEC;MAAM,CAAC,KAAM;QAC1Bd,SAAS,CAAEsC,gCAA0B,CAAC;QACtCxB,KAAK,CAAC,CAAC;MACR;IACD,CAAE,CAAC;EACJ;EAEA,OAAO;IAAER,SAAS,EAAE,KAAK;IAAED;EAAS,CAAC;AACtC;AAEe,SAASkC,WAAWA,CAAA,EAAG;EACrC,IAAAC,0BAAgB,EAAE;IACjBhC,IAAI,EAAE,qBAAqB;IAC3BiC,IAAI,EAAEjF;EACP,CAAE,CAAC;EAEH,IAAAgF,0BAAgB,EAAE;IACjBhC,IAAI,EAAE,iCAAiC;IACvCiC,IAAI,EAAET,iCAAiC;IACvCU,OAAO,EAAE;EACV,CAAE,CAAC;AACJ","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_components","_i18n","_element","_compose","_notices","_coreData","_icons","_blocks","_store","_constants","_utils","_jsxRuntime","CreateTemplatePartModal","modalTitle","restProps","defaultModalTitle","useSelect","select","coreStore","getPostType","TEMPLATE_PART_POST_TYPE","labels","add_new_item","jsx","Modal","title","onRequestClose","closeModal","overlayClassName","focusOnMount","size","children","CreateTemplatePartModalContents","defaultArea","TEMPLATE_PART_AREA_DEFAULT_CATEGORY","blocks","confirmLabel","__","onCreate","onError","defaultTitle","createErrorNotice","useDispatch","noticesStore","saveEntityRecord","existingTemplateParts","useExistingTemplateParts","setTitle","useState","area","setArea","isSubmitting","setIsSubmitting","instanceId","useInstanceId","templatePartAreas","editorStore","__experimentalGetDefaultTemplatePartAreas","createTemplatePart","uniqueTitle","getUniqueTemplatePartTitle","cleanSlug","getCleanTemplatePartSlug","templatePart","slug","content","serialize","throwOnError","error","errorMessage","message","code","type","onSubmit","event","preventDefault","jsxs","__experimentalVStack","spacing","TextControl","__next40pxDefaultSize","__nextHasNoMarginBottom","label","value","onChange","required","BaseControl","id","className","__experimentalRadioGroup","checked","map","icon","description","__experimentalRadio","Flex","align","justify","FlexItem","Icon","FlexBlock","check","__experimentalHStack","Button","variant","onClick","isBusy"],"sources":["@wordpress/editor/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 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 { store as editorStore } from '../../store';\nimport {\n\tTEMPLATE_PART_POST_TYPE,\n\tTEMPLATE_PART_AREA_DEFAULT_CATEGORY,\n} from '../../store/constants';\nimport {\n\tuseExistingTemplateParts,\n\tgetUniqueTemplatePartTitle,\n\tgetCleanTemplatePartSlug,\n} from './utils';\n\nexport default function CreateTemplatePartModal( {\n\tmodalTitle,\n\t...restProps\n} ) {\n\tconst defaultModalTitle = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).getPostType( TEMPLATE_PART_POST_TYPE )?.labels\n\t\t\t\t?.add_new_item,\n\t\t[]\n\t);\n\treturn (\n\t\t<Modal\n\t\t\ttitle={ modalTitle || defaultModalTitle }\n\t\t\tonRequestClose={ restProps.closeModal }\n\t\t\toverlayClassName=\"editor-create-template-part-modal\"\n\t\t\tfocusOnMount=\"firstContentElement\"\n\t\t\tsize=\"medium\"\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 = __( 'Add' ),\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__next40pxDefaultSize\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\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Area' ) }\n\t\t\t\t\tid={ `editor-create-template-part-modal__area-selection-${ instanceId }` }\n\t\t\t\t\tclassName=\"editor-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=\"editor-create-template-part-modal__area-radio-group\"\n\t\t\t\t\t\tid={ `editor-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=\"editor-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=\"editor-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=\"editor-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\t__next40pxDefaultSize\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\t__next40pxDefaultSize\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,QAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AAKA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,UAAA,GAAAV,OAAA;AAIA,IAAAW,MAAA,GAAAX,OAAA;AAIiB,IAAAY,WAAA,GAAAZ,OAAA;AAtCjB;AACA;AACA;;AAwBA;AACA;AACA;;AAYe,SAASa,uBAAuBA,CAAE;EAChDC,UAAU;EACV,GAAGC;AACJ,CAAC,EAAG;EACH,MAAMC,iBAAiB,GAAG,IAAAC,eAAS,EAChCC,MAAM,IACPA,MAAM,CAAEC,eAAU,CAAC,CAACC,WAAW,CAAEC,kCAAwB,CAAC,EAAEC,MAAM,EAC/DC,YAAY,EAChB,EACD,CAAC;EACD,oBACC,IAAAX,WAAA,CAAAY,GAAA,EAACvB,WAAA,CAAAwB,KAAK;IACLC,KAAK,EAAGZ,UAAU,IAAIE,iBAAmB;IACzCW,cAAc,EAAGZ,SAAS,CAACa,UAAY;IACvCC,gBAAgB,EAAC,mCAAmC;IACpDC,YAAY,EAAC,qBAAqB;IAClCC,IAAI,EAAC,QAAQ;IAAA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AAkG,QAAQ;gBAACV,SAAS,EAAC,6CAA6C;gBAAAzD,QAAA,EAC9DkB,IAAI,KAAKkC,KAAK,iBACf,IAAAxE,WAAA,CAAAY,GAAA,EAACvB,WAAA,CAAAmG,IAAI;kBAACP,IAAI,EAAGS;gBAAO,CAAE;cACtB,CACQ,CAAC;YAAA,CACN;UAAC,GAlBDnB,KAmBA,CAET;QAAC,CACU;MAAC,CACD,CAAC,eACd,IAAAvE,WAAA,CAAAiE,IAAA,EAAC5E,WAAA,CAAAsG,oBAAM;QAACL,OAAO,EAAC,OAAO;QAAAlE,QAAA,gBACtB,IAAApB,WAAA,CAAAY,GAAA,EAACvB,WAAA,CAAAuG,MAAM;UACNvB,qBAAqB;UACrBwB,OAAO,EAAC,UAAU;UAClBC,OAAO,EAAGA,CAAA,KAAM;YACf9E,UAAU,CAAC,CAAC;UACb,CAAG;UAAAI,QAAA,EAED,IAAAM,QAAE,EAAE,QAAS;QAAC,CACT,CAAC,eACT,IAAA1B,WAAA,CAAAY,GAAA,EAACvB,WAAA,CAAAuG,MAAM;UACNvB,qBAAqB;UACrBwB,OAAO,EAAC,SAAS;UACjBhC,IAAI,EAAC,QAAQ;UACb,iBAAgB,CAAE/C,KAAK,IAAI0B,YAAc;UACzCuD,MAAM,EAAGvD,YAAc;UAAApB,QAAA,EAErBK;QAAY,CACP,CAAC;MAAA,CACF,CAAC;IAAA,CACF;EAAC,CACJ,CAAC;AAET","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_data","require","_components","_i18n","_element","_compose","_notices","_coreData","_icons","_blocks","_store","_constants","_utils","_jsxRuntime","CreateTemplatePartModal","modalTitle","restProps","defaultModalTitle","useSelect","select","coreStore","getPostType","TEMPLATE_PART_POST_TYPE","labels","add_new_item","jsx","Modal","title","onRequestClose","closeModal","overlayClassName","focusOnMount","size","children","CreateTemplatePartModalContents","defaultArea","TEMPLATE_PART_AREA_DEFAULT_CATEGORY","blocks","confirmLabel","__","onCreate","onError","defaultTitle","createErrorNotice","useDispatch","noticesStore","saveEntityRecord","existingTemplateParts","useExistingTemplateParts","setTitle","useState","area","setArea","isSubmitting","setIsSubmitting","instanceId","useInstanceId","templatePartAreas","editorStore","__experimentalGetDefaultTemplatePartAreas","createTemplatePart","uniqueTitle","getUniqueTemplatePartTitle","cleanSlug","getCleanTemplatePartSlug","templatePart","slug","content","serialize","throwOnError","error","errorMessage","message","code","type","onSubmit","event","preventDefault","jsxs","__experimentalVStack","spacing","TextControl","__next40pxDefaultSize","__nextHasNoMarginBottom","label","value","onChange","required","BaseControl","id","className","__experimentalRadioGroup","checked","map","icon","description","__experimentalRadio","Flex","align","justify","FlexItem","Icon","FlexBlock","check","__experimentalHStack","Button","variant","onClick","isBusy"],"sources":["@wordpress/editor/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 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 { store as editorStore } from '../../store';\nimport {\n\tTEMPLATE_PART_POST_TYPE,\n\tTEMPLATE_PART_AREA_DEFAULT_CATEGORY,\n} from '../../store/constants';\nimport {\n\tuseExistingTemplateParts,\n\tgetUniqueTemplatePartTitle,\n\tgetCleanTemplatePartSlug,\n} from './utils';\n\nexport default function CreateTemplatePartModal( {\n\tmodalTitle,\n\t...restProps\n} ) {\n\tconst defaultModalTitle = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).getPostType( TEMPLATE_PART_POST_TYPE )?.labels\n\t\t\t\t?.add_new_item,\n\t\t[]\n\t);\n\treturn (\n\t\t<Modal\n\t\t\ttitle={ modalTitle || defaultModalTitle }\n\t\t\tonRequestClose={ restProps.closeModal }\n\t\t\toverlayClassName=\"editor-create-template-part-modal\"\n\t\t\tfocusOnMount=\"firstContentElement\"\n\t\t\tsize=\"medium\"\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 = __( 'Add' ),\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__next40pxDefaultSize\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\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Area' ) }\n\t\t\t\t\tid={ `editor-create-template-part-modal__area-selection-${ instanceId }` }\n\t\t\t\t\tclassName=\"editor-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=\"editor-create-template-part-modal__area-radio-group\"\n\t\t\t\t\t\tid={ `editor-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=\"editor-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=\"editor-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=\"editor-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\t__next40pxDefaultSize\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\t__next40pxDefaultSize\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 ||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A,CAAAmG,IAAI;kBAACP,IAAI,EAAGS;gBAAO,CAAE;cACtB,CACQ,CAAC;YAAA,CACN;UAAC,GAlBDnB,KAmBA,CAET;QAAC,CACU;MAAC,CACD,CAAC,eACd,IAAAvE,WAAA,CAAAiE,IAAA,EAAC5E,WAAA,CAAAsG,oBAAM;QAACL,OAAO,EAAC,OAAO;QAAAlE,QAAA,gBACtB,IAAApB,WAAA,CAAAY,GAAA,EAACvB,WAAA,CAAAuG,MAAM;UACNvB,qBAAqB;UACrBwB,OAAO,EAAC,UAAU;UAClBC,OAAO,EAAGA,CAAA,KAAM;YACf9E,UAAU,CAAC,CAAC;UACb,CAAG;UAAAI,QAAA,EAED,IAAAM,QAAE,EAAE,QAAS;QAAC,CACT,CAAC,eACT,IAAA1B,WAAA,CAAAY,GAAA,EAACvB,WAAA,CAAAuG,MAAM;UACNvB,qBAAqB;UACrBwB,OAAO,EAAC,SAAS;UACjBhC,IAAI,EAAC,QAAQ;UACb,iBAAgB,CAAE/C,KAAK,IAAI0B,YAAc;UACzCuD,MAAM,EAAGvD,YAAc;UAAApB,QAAA,EAErBK;QAAY,CACP,CAAC;MAAA,CACF,CAAC;IAAA,CACF;EAAC,CACJ,CAAC;AAET","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_changeCase","require","_data","_coreData","_constants","useExistingTemplateParts","useSelect","select","coreStore","getEntityRecords","TEMPLATE_PART_POST_TYPE","per_page","exports","getUniqueTemplatePartTitle","title","templateParts","lowercaseTitle","toLowerCase","existingTitles","map","templatePart","rendered","includes","suffix","getCleanTemplatePartSlug","kebabCase","replace"],"sources":["@wordpress/editor/src/components/create-template-part-modal/utils.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { paramCase as kebabCase } from 'change-case';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { TEMPLATE_PART_POST_TYPE } from '../../store/constants';\n\nexport const useExistingTemplateParts = () => {\n\treturn useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).getEntityRecords(\n\t\t\t\t'postType',\n\t\t\t\tTEMPLATE_PART_POST_TYPE,\n\t\t\t\t{\n\t\t\t\t\tper_page: -1,\n\t\t\t\t}\n\t\t\t),\n\t\t[]\n\t);\n};\n\n/**\n * Return a unique template part title based on\n * the given title and existing template parts.\n *\n * @param {string} title The original template part title.\n * @param {Object} templateParts The array of template part entities.\n * @return {string} A unique template part title.\n */\nexport const getUniqueTemplatePartTitle = ( title, templateParts ) => {\n\tconst lowercaseTitle = title.toLowerCase();\n\tconst existingTitles = templateParts.map( ( templatePart ) =>\n\t\ttemplatePart.title.rendered.toLowerCase()\n\t);\n\n\tif ( ! existingTitles.includes( lowercaseTitle ) ) {\n\t\treturn title;\n\t}\n\n\tlet suffix = 2;\n\twhile ( existingTitles.includes( `${ lowercaseTitle } ${ suffix }` ) ) {\n\t\tsuffix++;\n\t}\n\n\treturn `${ title } ${ suffix }`;\n};\n\n/**\n * Get a valid slug for a template part.\n * Currently template parts only allow latin chars.\n * The fallback slug will receive suffix by default.\n *\n * @param {string} title The template part title.\n * @return {string} A valid template part slug.\n */\nexport const getCleanTemplatePartSlug = ( title ) => {\n\treturn kebabCase( title ).replace( /[^\\w-]+/g, '' ) || 'wp-custom-part';\n};\n"],"mappings":";;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAKA,IAAAG,UAAA,GAAAH,OAAA;AAdA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;;AAGO,MAAMI,wBAAwB,GAAGA,CAAA,KAAM;EAC7C,OAAO,IAAAC,eAAS,EACbC,MAAM,IACPA,MAAM,CAAEC,eAAU,CAAC,CAACC,gBAAgB,CACnC,UAAU,EACVC,kCAAuB,EACvB;IACCC,QAAQ,EAAE,CAAC;EACZ,CACD,CAAC,EACF,EACD,CAAC;AACF,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPAC,OAAA,CAAAP,wBAAA,GAAAA,wBAAA;AAQO,MAAMQ,0BAA0B,GAAGA,CAAEC,KAAK,EAAEC,aAAa,KAAM;EACrE,MAAMC,cAAc,GAAGF,KAAK,CAACG,WAAW,CAAC,CAAC;EAC1C,MAAMC,cAAc,GAAGH,aAAa,CAACI,GAAG,CAAIC,YAAY,IACvDA,YAAY,CAACN,KAAK,CAACO,QAAQ,CAACJ,WAAW,CAAC,CACzC,CAAC;EAED,IAAK,CAAEC,cAAc,CAACI,QAAQ,CAAEN,cAAe,CAAC,EAAG;IAClD,OAAOF,KAAK;EACb;EAEA,IAAIS,MAAM,GAAG,CAAC;EACd,OAAQL,cAAc,CAACI,QAAQ,
|
|
1
|
+
{"version":3,"names":["_changeCase","require","_data","_coreData","_constants","useExistingTemplateParts","useSelect","select","coreStore","getEntityRecords","TEMPLATE_PART_POST_TYPE","per_page","exports","getUniqueTemplatePartTitle","title","templateParts","lowercaseTitle","toLowerCase","existingTitles","map","templatePart","rendered","includes","suffix","getCleanTemplatePartSlug","kebabCase","replace"],"sources":["@wordpress/editor/src/components/create-template-part-modal/utils.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { paramCase as kebabCase } from 'change-case';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { TEMPLATE_PART_POST_TYPE } from '../../store/constants';\n\nexport const useExistingTemplateParts = () => {\n\treturn useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).getEntityRecords(\n\t\t\t\t'postType',\n\t\t\t\tTEMPLATE_PART_POST_TYPE,\n\t\t\t\t{\n\t\t\t\t\tper_page: -1,\n\t\t\t\t}\n\t\t\t),\n\t\t[]\n\t);\n};\n\n/**\n * Return a unique template part title based on\n * the given title and existing template parts.\n *\n * @param {string} title The original template part title.\n * @param {Object} templateParts The array of template part entities.\n * @return {string} A unique template part title.\n */\nexport const getUniqueTemplatePartTitle = ( title, templateParts ) => {\n\tconst lowercaseTitle = title.toLowerCase();\n\tconst existingTitles = templateParts.map( ( templatePart ) =>\n\t\ttemplatePart.title.rendered.toLowerCase()\n\t);\n\n\tif ( ! existingTitles.includes( lowercaseTitle ) ) {\n\t\treturn title;\n\t}\n\n\tlet suffix = 2;\n\twhile ( existingTitles.includes( `${ lowercaseTitle } ${ suffix }` ) ) {\n\t\tsuffix++;\n\t}\n\n\treturn `${ title } ${ suffix }`;\n};\n\n/**\n * Get a valid slug for a template part.\n * Currently template parts only allow latin chars.\n * The fallback slug will receive suffix by default.\n *\n * @param {string} title The template part title.\n * @return {string} A valid template part slug.\n */\nexport const getCleanTemplatePartSlug = ( title ) => {\n\treturn kebabCase( title ).replace( /[^\\w-]+/g, '' ) || 'wp-custom-part';\n};\n"],"mappings":";;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAKA,IAAAG,UAAA,GAAAH,OAAA;AAdA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;;AAGO,MAAMI,wBAAwB,GAAGA,CAAA,KAAM;EAC7C,OAAO,IAAAC,eAAS,EACbC,MAAM,IACPA,MAAM,CAAEC,eAAU,CAAC,CAACC,gBAAgB,CACnC,UAAU,EACVC,kCAAuB,EACvB;IACCC,QAAQ,EAAE,CAAC;EACZ,CACD,CAAC,EACF,EACD,CAAC;AACF,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPAC,OAAA,CAAAP,wBAAA,GAAAA,wBAAA;AAQO,MAAMQ,0BAA0B,GAAGA,CAAEC,KAAK,EAAEC,aAAa,KAAM;EACrE,MAAMC,cAAc,GAAGF,KAAK,CAACG,WAAW,CAAC,CAAC;EAC1C,MAAMC,cAAc,GAAGH,aAAa,CAACI,GAAG,CAAIC,YAAY,IACvDA,YAAY,CAACN,KAAK,CAACO,QAAQ,CAACJ,WAAW,CAAC,CACzC,CAAC;EAED,IAAK,CAAEC,cAAc,CAACI,QAAQ,CAAEN,cAAe,CAAC,EAAG;IAClD,OAAOF,KAAK;EACb;EAEA,IAAIS,MAAM,GAAG,CAAC;EACd,OAAQL,cAAc,CAACI,QAAQ,CAAE,GAAIN,cAAc,IAAMO,MAAM,EAAI,CAAC,EAAG;IACtEA,MAAM,EAAE;EACT;EAEA,OAAO,GAAIT,KAAK,IAAMS,MAAM,EAAG;AAChC,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPAX,OAAA,CAAAC,0BAAA,GAAAA,0BAAA;AAQO,MAAMW,wBAAwB,GAAKV,KAAK,IAAM;EACpD,OAAO,IAAAW,qBAAS,EAAEX,KAAM,CAAC,CAACY,OAAO,CAAE,UAAU,EAAE,EAAG,CAAC,IAAI,gBAAgB;AACxE,CAAC;AAACd,OAAA,CAAAY,wBAAA,GAAAA,wBAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_data","_richText","_blockEditor","_coreData","_components","_item","_interopRequireDefault","_store","_jsxRuntime","emptyHeadingContent","jsx","children","__","incorrectLevelContent","singleH1Headings","multipleH1Headings","EmptyOutlineIllustration","jsxs","SVG","width","height","viewBox","fill","xmlns","Rect","rx","Line","x1","y1","x2","y2","stroke","x","y","Path","d","computeOutlineHeadings","blocks","flatMap","block","name","level","attributes","isEmpty","isEmptyHeading","innerBlocks","heading","content","trim","length","DocumentOutline","onSelect","isTitleSupported","hasOutlineItemsDisabled","selectBlock","useDispatch","blockEditorStore","title","useSelect","select","_postType$supports$ti","getBlocks","getEditedPostAttribute","editorStore","getPostType","coreStore","postType","supports","headings","className","prevHeadingLevel","titleNode","document","querySelector","hasTitle","countByLevel","reduce","acc","hasMultipleH1","default","isValid","href","id","isDisabled","map","item","index","isIncorrectLevel","clientId","getTextContent","create","html"],"sources":["@wordpress/editor/src/components/document-outline/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { create, getTextContent } from '@wordpress/rich-text';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { Path, SVG, Line, Rect } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport DocumentOutlineItem from './item';\nimport { store as editorStore } from '../../store';\n\n/**\n * Module constants\n */\nconst emptyHeadingContent = <em>{ __( '(Empty heading)' ) }</em>;\nconst incorrectLevelContent = [\n\t<br key=\"incorrect-break\" />,\n\t<em key=\"incorrect-message\">{ __( '(Incorrect heading level)' ) }</em>,\n];\nconst singleH1Headings = [\n\t<br key=\"incorrect-break-h1\" />,\n\t<em key=\"incorrect-message-h1\">\n\t\t{ __( '(Your theme may already use a H1 for the post title)' ) }\n\t</em>,\n];\nconst multipleH1Headings = [\n\t<br key=\"incorrect-break-multiple-h1\" />,\n\t<em key=\"incorrect-message-multiple-h1\">\n\t\t{ __( '(Multiple H1 headings are not recommended)' ) }\n\t</em>,\n];\nfunction EmptyOutlineIllustration() {\n\treturn (\n\t\t<SVG\n\t\t\twidth=\"138\"\n\t\t\theight=\"148\"\n\t\t\tviewBox=\"0 0 138 148\"\n\t\t\tfill=\"none\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t>\n\t\t\t<Rect width=\"138\" height=\"148\" rx=\"4\" fill=\"#F0F6FC\" />\n\t\t\t<Line x1=\"44\" y1=\"28\" x2=\"24\" y2=\"28\" stroke=\"#DDDDDD\" />\n\t\t\t<Rect x=\"48\" y=\"16\" width=\"27\" height=\"23\" rx=\"4\" fill=\"#DDDDDD\" />\n\t\t\t<Path\n\t\t\t\td=\"M54.7585 32V23.2727H56.6037V26.8736H60.3494V23.2727H62.1903V32H60.3494V28.3949H56.6037V32H54.7585ZM67.4574 23.2727V32H65.6122V25.0241H65.5611L63.5625 26.277V24.6406L65.723 23.2727H67.4574Z\"\n\t\t\t\tfill=\"black\"\n\t\t\t/>\n\t\t\t<Line x1=\"55\" y1=\"59\" x2=\"24\" y2=\"59\" stroke=\"#DDDDDD\" />\n\t\t\t<Rect x=\"59\" y=\"47\" width=\"29\" height=\"23\" rx=\"4\" fill=\"#DDDDDD\" />\n\t\t\t<Path\n\t\t\t\td=\"M65.7585 63V54.2727H67.6037V57.8736H71.3494V54.2727H73.1903V63H71.3494V59.3949H67.6037V63H65.7585ZM74.6605 63V61.6705L77.767 58.794C78.0313 58.5384 78.2528 58.3082 78.4318 58.1037C78.6136 57.8991 78.7514 57.6989 78.8452 57.5028C78.9389 57.304 78.9858 57.0895 78.9858 56.8594C78.9858 56.6037 78.9276 56.3835 78.8111 56.1989C78.6946 56.0114 78.5355 55.8679 78.3338 55.7685C78.1321 55.6662 77.9034 55.6151 77.6477 55.6151C77.3807 55.6151 77.1477 55.669 76.9489 55.777C76.75 55.8849 76.5966 56.0398 76.4886 56.2415C76.3807 56.4432 76.3267 56.6832 76.3267 56.9616H74.5753C74.5753 56.3906 74.7045 55.8949 74.9631 55.4744C75.2216 55.054 75.5838 54.7287 76.0497 54.4986C76.5156 54.2685 77.0526 54.1534 77.6605 54.1534C78.2855 54.1534 78.8295 54.2642 79.2926 54.4858C79.7585 54.7045 80.1207 55.0085 80.3793 55.3977C80.6378 55.7869 80.767 56.233 80.767 56.7358C80.767 57.0653 80.7017 57.3906 80.571 57.7116C80.4432 58.0327 80.2145 58.3892 79.8849 58.7812C79.5554 59.1705 79.0909 59.6378 78.4915 60.1832L77.2173 61.4318V61.4915H80.8821V63H74.6605Z\"\n\t\t\t\tfill=\"black\"\n\t\t\t/>\n\t\t\t<Line x1=\"80\" y1=\"90\" x2=\"24\" y2=\"90\" stroke=\"#DDDDDD\" />\n\t\t\t<Rect x=\"84\" y=\"78\" width=\"30\" height=\"23\" rx=\"4\" fill=\"#F0B849\" />\n\t\t\t<Path\n\t\t\t\td=\"M90.7585 94V85.2727H92.6037V88.8736H96.3494V85.2727H98.1903V94H96.3494V90.3949H92.6037V94H90.7585ZM99.5284 92.4659V91.0128L103.172 85.2727H104.425V87.2841H103.683L101.386 90.919V90.9872H106.564V92.4659H99.5284ZM103.717 94V92.0227L103.751 91.3793V85.2727H105.482V94H103.717Z\"\n\t\t\t\tfill=\"black\"\n\t\t\t/>\n\t\t\t<Line x1=\"66\" y1=\"121\" x2=\"24\" y2=\"121\" stroke=\"#DDDDDD\" />\n\t\t\t<Rect x=\"70\" y=\"109\" width=\"29\" height=\"23\" rx=\"4\" fill=\"#DDDDDD\" />\n\t\t\t<Path\n\t\t\t\td=\"M76.7585 125V116.273H78.6037V119.874H82.3494V116.273H84.1903V125H82.3494V121.395H78.6037V125H76.7585ZM88.8864 125.119C88.25 125.119 87.6832 125.01 87.1861 124.791C86.6918 124.57 86.3011 124.266 86.0142 123.879C85.7301 123.49 85.5838 123.041 85.5753 122.533H87.4332C87.4446 122.746 87.5142 122.933 87.642 123.095C87.7727 123.254 87.946 123.378 88.1619 123.466C88.3778 123.554 88.6207 123.598 88.8906 123.598C89.1719 123.598 89.4205 123.548 89.6364 123.449C89.8523 123.349 90.0213 123.212 90.1435 123.036C90.2656 122.859 90.3267 122.656 90.3267 122.426C90.3267 122.193 90.2614 121.987 90.1307 121.808C90.0028 121.626 89.8182 121.484 89.5767 121.382C89.3381 121.28 89.054 121.229 88.7244 121.229H87.9105V119.874H88.7244C89.0028 119.874 89.2486 119.825 89.4616 119.729C89.6776 119.632 89.8452 119.499 89.9645 119.328C90.0838 119.155 90.1435 118.953 90.1435 118.723C90.1435 118.504 90.0909 118.312 89.9858 118.148C89.8835 117.98 89.7386 117.849 89.5511 117.756C89.3665 117.662 89.1506 117.615 88.9034 117.615C88.6534 117.615 88.4247 117.661 88.2173 117.751C88.0099 117.839 87.8438 117.966 87.7188 118.131C87.5938 118.295 87.527 118.489 87.5185 118.71H85.75C85.7585 118.207 85.902 117.764 86.1804 117.381C86.4588 116.997 86.8338 116.697 87.3054 116.482C87.7798 116.263 88.3153 116.153 88.9119 116.153C89.5142 116.153 90.0412 116.263 90.4929 116.482C90.9446 116.7 91.2955 116.996 91.5455 117.368C91.7983 117.737 91.9233 118.152 91.9205 118.612C91.9233 119.101 91.7713 119.509 91.4645 119.835C91.1605 120.162 90.7642 120.369 90.2756 120.457V120.526C90.9176 120.608 91.4063 120.831 91.7415 121.195C92.0795 121.555 92.2472 122.007 92.2443 122.55C92.2472 123.047 92.1037 123.489 91.8139 123.875C91.527 124.261 91.1307 124.565 90.625 124.787C90.1193 125.009 89.5398 125.119 88.8864 125.119Z\"\n\t\t\t\tfill=\"black\"\n\t\t\t/>\n\t\t</SVG>\n\t);\n}\n\n/**\n * Returns an array of heading blocks enhanced with the following properties:\n * level - An integer with the heading level.\n * isEmpty - Flag indicating if the heading has no content.\n *\n * @param {?Array} blocks An array of blocks.\n *\n * @return {Array} An array of heading blocks enhanced with the properties described above.\n */\nconst computeOutlineHeadings = ( blocks = [] ) => {\n\treturn blocks.flatMap( ( block = {} ) => {\n\t\tif ( block.name === 'core/heading' ) {\n\t\t\treturn {\n\t\t\t\t...block,\n\t\t\t\tlevel: block.attributes.level,\n\t\t\t\tisEmpty: isEmptyHeading( block ),\n\t\t\t};\n\t\t}\n\t\treturn computeOutlineHeadings( block.innerBlocks );\n\t} );\n};\n\nconst isEmptyHeading = ( heading ) =>\n\t! heading.attributes.content ||\n\theading.attributes.content.trim().length === 0;\n\n/**\n * Renders a document outline component.\n *\n * @param {Object} props Props.\n * @param {Function} props.onSelect Function to be called when an outline item is selected.\n * @param {boolean} props.isTitleSupported Indicates whether the title is supported.\n * @param {boolean} props.hasOutlineItemsDisabled Indicates whether the outline items are disabled.\n *\n * @return {Component} The component to be rendered.\n */\nexport default function DocumentOutline( {\n\tonSelect,\n\tisTitleSupported,\n\thasOutlineItemsDisabled,\n} ) {\n\tconst { selectBlock } = useDispatch( blockEditorStore );\n\tconst { blocks, title } = useSelect( ( select ) => {\n\t\tconst { getBlocks } = select( blockEditorStore );\n\t\tconst { getEditedPostAttribute } = select( editorStore );\n\t\tconst { getPostType } = select( coreStore );\n\t\tconst postType = getPostType( getEditedPostAttribute( 'type' ) );\n\n\t\treturn {\n\t\t\ttitle: getEditedPostAttribute( 'title' ),\n\t\t\tblocks: getBlocks(),\n\t\t\tisTitleSupported: postType?.supports?.title ?? false,\n\t\t};\n\t} );\n\n\tconst headings = computeOutlineHeadings( blocks );\n\tif ( headings.length < 1 ) {\n\t\treturn (\n\t\t\t<div className=\"editor-document-outline has-no-headings\">\n\t\t\t\t<EmptyOutlineIllustration />\n\t\t\t\t<p>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'Navigate the structure of your document and address issues like empty or incorrect heading levels.'\n\t\t\t\t\t) }\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tlet prevHeadingLevel = 1;\n\n\t// Not great but it's the simplest way to locate the title right now.\n\tconst titleNode = document.querySelector( '.editor-post-title__input' );\n\tconst hasTitle = isTitleSupported && title && titleNode;\n\tconst countByLevel = headings.reduce(\n\t\t( acc, heading ) => ( {\n\t\t\t...acc,\n\t\t\t[ heading.level ]: ( acc[ heading.level ] || 0 ) + 1,\n\t\t} ),\n\t\t{}\n\t);\n\tconst hasMultipleH1 = countByLevel[ 1 ] > 1;\n\n\treturn (\n\t\t<div className=\"document-outline\">\n\t\t\t<ul>\n\t\t\t\t{ hasTitle && (\n\t\t\t\t\t<DocumentOutlineItem\n\t\t\t\t\t\tlevel={ __( 'Title' ) }\n\t\t\t\t\t\tisValid\n\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\thref={ `#${ titleNode.id }` }\n\t\t\t\t\t\tisDisabled={ hasOutlineItemsDisabled }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ title }\n\t\t\t\t\t</DocumentOutlineItem>\n\t\t\t\t) }\n\t\t\t\t{ headings.map( ( item, index ) => {\n\t\t\t\t\t// Headings remain the same, go up by one, or down by any amount.\n\t\t\t\t\t// Otherwise there are missing levels.\n\t\t\t\t\tconst isIncorrectLevel = item.level > prevHeadingLevel + 1;\n\n\t\t\t\t\tconst isValid =\n\t\t\t\t\t\t! item.isEmpty &&\n\t\t\t\t\t\t! isIncorrectLevel &&\n\t\t\t\t\t\t!! item.level &&\n\t\t\t\t\t\t( item.level !== 1 ||\n\t\t\t\t\t\t\t( ! hasMultipleH1 && ! hasTitle ) );\n\t\t\t\t\tprevHeadingLevel = item.level;\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<DocumentOutlineItem\n\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\tlevel={ `H${ item.level }` }\n\t\t\t\t\t\t\tisValid={ isValid }\n\t\t\t\t\t\t\tisDisabled={ hasOutlineItemsDisabled }\n\t\t\t\t\t\t\thref={ `#block-${ item.clientId }` }\n\t\t\t\t\t\t\tonSelect={ () => {\n\t\t\t\t\t\t\t\tselectBlock( item.clientId );\n\t\t\t\t\t\t\t\tonSelect?.();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ item.isEmpty\n\t\t\t\t\t\t\t\t? emptyHeadingContent\n\t\t\t\t\t\t\t\t: getTextContent(\n\t\t\t\t\t\t\t\t\t\tcreate( {\n\t\t\t\t\t\t\t\t\t\t\thtml: item.attributes.content,\n\t\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{ isIncorrectLevel && incorrectLevelContent }\n\t\t\t\t\t\t\t{ item.level === 1 &&\n\t\t\t\t\t\t\t\thasMultipleH1 &&\n\t\t\t\t\t\t\t\tmultipleH1Headings }\n\t\t\t\t\t\t\t{ hasTitle &&\n\t\t\t\t\t\t\t\titem.level === 1 &&\n\t\t\t\t\t\t\t\t! hasMultipleH1 &&\n\t\t\t\t\t\t\t\tsingleH1Headings }\n\t\t\t\t\t\t</Document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C,KAAK,KAAK,CAAC,IACjBqC,aAAa,IACb/D,kBAAkB,EACjB2D,QAAQ,IACTW,IAAI,CAAC5C,KAAK,KAAK,CAAC,IAChB,CAAEqC,aAAa,IACfhE,gBAAgB;QAAA,GAxBXwE,KAyBc,CAAC;MAExB,CAAE,CAAC;IAAA,CACA;EAAC,CACD,CAAC;AAER","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_i18n","require","_data","_richText","_blockEditor","_coreData","_components","_item","_interopRequireDefault","_store","_jsxRuntime","emptyHeadingContent","jsx","children","__","incorrectLevelContent","singleH1Headings","multipleH1Headings","EmptyOutlineIllustration","jsxs","SVG","width","height","viewBox","fill","xmlns","Rect","rx","Line","x1","y1","x2","y2","stroke","x","y","Path","d","computeOutlineHeadings","blocks","flatMap","block","name","level","attributes","isEmpty","isEmptyHeading","innerBlocks","heading","content","trim","length","DocumentOutline","onSelect","isTitleSupported","hasOutlineItemsDisabled","selectBlock","useDispatch","blockEditorStore","title","useSelect","select","_postType$supports$ti","getBlocks","getEditedPostAttribute","editorStore","getPostType","coreStore","postType","supports","headings","className","prevHeadingLevel","titleNode","document","querySelector","hasTitle","countByLevel","reduce","acc","hasMultipleH1","default","isValid","href","id","isDisabled","map","item","index","isIncorrectLevel","clientId","getTextContent","create","html"],"sources":["@wordpress/editor/src/components/document-outline/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { create, getTextContent } from '@wordpress/rich-text';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { Path, SVG, Line, Rect } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport DocumentOutlineItem from './item';\nimport { store as editorStore } from '../../store';\n\n/**\n * Module constants\n */\nconst emptyHeadingContent = <em>{ __( '(Empty heading)' ) }</em>;\nconst incorrectLevelContent = [\n\t<br key=\"incorrect-break\" />,\n\t<em key=\"incorrect-message\">{ __( '(Incorrect heading level)' ) }</em>,\n];\nconst singleH1Headings = [\n\t<br key=\"incorrect-break-h1\" />,\n\t<em key=\"incorrect-message-h1\">\n\t\t{ __( '(Your theme may already use a H1 for the post title)' ) }\n\t</em>,\n];\nconst multipleH1Headings = [\n\t<br key=\"incorrect-break-multiple-h1\" />,\n\t<em key=\"incorrect-message-multiple-h1\">\n\t\t{ __( '(Multiple H1 headings are not recommended)' ) }\n\t</em>,\n];\nfunction EmptyOutlineIllustration() {\n\treturn (\n\t\t<SVG\n\t\t\twidth=\"138\"\n\t\t\theight=\"148\"\n\t\t\tviewBox=\"0 0 138 148\"\n\t\t\tfill=\"none\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t>\n\t\t\t<Rect width=\"138\" height=\"148\" rx=\"4\" fill=\"#F0F6FC\" />\n\t\t\t<Line x1=\"44\" y1=\"28\" x2=\"24\" y2=\"28\" stroke=\"#DDDDDD\" />\n\t\t\t<Rect x=\"48\" y=\"16\" width=\"27\" height=\"23\" rx=\"4\" fill=\"#DDDDDD\" />\n\t\t\t<Path\n\t\t\t\td=\"M54.7585 32V23.2727H56.6037V26.8736H60.3494V23.2727H62.1903V32H60.3494V28.3949H56.6037V32H54.7585ZM67.4574 23.2727V32H65.6122V25.0241H65.5611L63.5625 26.277V24.6406L65.723 23.2727H67.4574Z\"\n\t\t\t\tfill=\"black\"\n\t\t\t/>\n\t\t\t<Line x1=\"55\" y1=\"59\" x2=\"24\" y2=\"59\" stroke=\"#DDDDDD\" />\n\t\t\t<Rect x=\"59\" y=\"47\" width=\"29\" height=\"23\" rx=\"4\" fill=\"#DDDDDD\" />\n\t\t\t<Path\n\t\t\t\td=\"M65.7585 63V54.2727H67.6037V57.8736H71.3494V54.2727H73.1903V63H71.3494V59.3949H67.6037V63H65.7585ZM74.6605 63V61.6705L77.767 58.794C78.0313 58.5384 78.2528 58.3082 78.4318 58.1037C78.6136 57.8991 78.7514 57.6989 78.8452 57.5028C78.9389 57.304 78.9858 57.0895 78.9858 56.8594C78.9858 56.6037 78.9276 56.3835 78.8111 56.1989C78.6946 56.0114 78.5355 55.8679 78.3338 55.7685C78.1321 55.6662 77.9034 55.6151 77.6477 55.6151C77.3807 55.6151 77.1477 55.669 76.9489 55.777C76.75 55.8849 76.5966 56.0398 76.4886 56.2415C76.3807 56.4432 76.3267 56.6832 76.3267 56.9616H74.5753C74.5753 56.3906 74.7045 55.8949 74.9631 55.4744C75.2216 55.054 75.5838 54.7287 76.0497 54.4986C76.5156 54.2685 77.0526 54.1534 77.6605 54.1534C78.2855 54.1534 78.8295 54.2642 79.2926 54.4858C79.7585 54.7045 80.1207 55.0085 80.3793 55.3977C80.6378 55.7869 80.767 56.233 80.767 56.7358C80.767 57.0653 80.7017 57.3906 80.571 57.7116C80.4432 58.0327 80.2145 58.3892 79.8849 58.7812C79.5554 59.1705 79.0909 59.6378 78.4915 60.1832L77.2173 61.4318V61.4915H80.8821V63H74.6605Z\"\n\t\t\t\tfill=\"black\"\n\t\t\t/>\n\t\t\t<Line x1=\"80\" y1=\"90\" x2=\"24\" y2=\"90\" stroke=\"#DDDDDD\" />\n\t\t\t<Rect x=\"84\" y=\"78\" width=\"30\" height=\"23\" rx=\"4\" fill=\"#F0B849\" />\n\t\t\t<Path\n\t\t\t\td=\"M90.7585 94V85.2727H92.6037V88.8736H96.3494V85.2727H98.1903V94H96.3494V90.3949H92.6037V94H90.7585ZM99.5284 92.4659V91.0128L103.172 85.2727H104.425V87.2841H103.683L101.386 90.919V90.9872H106.564V92.4659H99.5284ZM103.717 94V92.0227L103.751 91.3793V85.2727H105.482V94H103.717Z\"\n\t\t\t\tfill=\"black\"\n\t\t\t/>\n\t\t\t<Line x1=\"66\" y1=\"121\" x2=\"24\" y2=\"121\" stroke=\"#DDDDDD\" />\n\t\t\t<Rect x=\"70\" y=\"109\" width=\"29\" height=\"23\" rx=\"4\" fill=\"#DDDDDD\" />\n\t\t\t<Path\n\t\t\t\td=\"M76.7585 125V116.273H78.6037V119.874H82.3494V116.273H84.1903V125H82.3494V121.395H78.6037V125H76.7585ZM88.8864 125.119C88.25 125.119 87.6832 125.01 87.1861 124.791C86.6918 124.57 86.3011 124.266 86.0142 123.879C85.7301 123.49 85.5838 123.041 85.5753 122.533H87.4332C87.4446 122.746 87.5142 122.933 87.642 123.095C87.7727 123.254 87.946 123.378 88.1619 123.466C88.3778 123.554 88.6207 123.598 88.8906 123.598C89.1719 123.598 89.4205 123.548 89.6364 123.449C89.8523 123.349 90.0213 123.212 90.1435 123.036C90.2656 122.859 90.3267 122.656 90.3267 122.426C90.3267 122.193 90.2614 121.987 90.1307 121.808C90.0028 121.626 89.8182 121.484 89.5767 121.382C89.3381 121.28 89.054 121.229 88.7244 121.229H87.9105V119.874H88.7244C89.0028 119.874 89.2486 119.825 89.4616 119.729C89.6776 119.632 89.8452 119.499 89.9645 119.328C90.0838 119.155 90.1435 118.953 90.1435 118.723C90.1435 118.504 90.0909 118.312 89.9858 118.148C89.8835 117.98 89.7386 117.849 89.5511 117.756C89.3665 117.662 89.1506 117.615 88.9034 117.615C88.6534 117.615 88.4247 117.661 88.2173 117.751C88.0099 117.839 87.8438 117.966 87.7188 118.131C87.5938 118.295 87.527 118.489 87.5185 118.71H85.75C85.7585 118.207 85.902 117.764 86.1804 117.381C86.4588 116.997 86.8338 116.697 87.3054 116.482C87.7798 116.263 88.3153 116.153 88.9119 116.153C89.5142 116.153 90.0412 116.263 90.4929 116.482C90.9446 116.7 91.2955 116.996 91.5455 117.368C91.7983 117.737 91.9233 118.152 91.9205 118.612C91.9233 119.101 91.7713 119.509 91.4645 119.835C91.1605 120.162 90.7642 120.369 90.2756 120.457V120.526C90.9176 120.608 91.4063 120.831 91.7415 121.195C92.0795 121.555 92.2472 122.007 92.2443 122.55C92.2472 123.047 92.1037 123.489 91.8139 123.875C91.527 124.261 91.1307 124.565 90.625 124.787C90.1193 125.009 89.5398 125.119 88.8864 125.119Z\"\n\t\t\t\tfill=\"black\"\n\t\t\t/>\n\t\t</SVG>\n\t);\n}\n\n/**\n * Returns an array of heading blocks enhanced with the following properties:\n * level - An integer with the heading level.\n * isEmpty - Flag indicating if the heading has no content.\n *\n * @param {?Array} blocks An array of blocks.\n *\n * @return {Array} An array of heading blocks enhanced with the properties described above.\n */\nconst computeOutlineHeadings = ( blocks = [] ) => {\n\treturn blocks.flatMap( ( block = {} ) => {\n\t\tif ( block.name === 'core/heading' ) {\n\t\t\treturn {\n\t\t\t\t...block,\n\t\t\t\tlevel: block.attributes.level,\n\t\t\t\tisEmpty: isEmptyHeading( block ),\n\t\t\t};\n\t\t}\n\t\treturn computeOutlineHeadings( block.innerBlocks );\n\t} );\n};\n\nconst isEmptyHeading = ( heading ) =>\n\t! heading.attributes.content ||\n\theading.attributes.content.trim().length === 0;\n\n/**\n * Renders a document outline component.\n *\n * @param {Object} props Props.\n * @param {Function} props.onSelect Function to be called when an outline item is selected.\n * @param {boolean} props.isTitleSupported Indicates whether the title is supported.\n * @param {boolean} props.hasOutlineItemsDisabled Indicates whether the outline items are disabled.\n *\n * @return {Component} The component to be rendered.\n */\nexport default function DocumentOutline( {\n\tonSelect,\n\tisTitleSupported,\n\thasOutlineItemsDisabled,\n} ) {\n\tconst { selectBlock } = useDispatch( blockEditorStore );\n\tconst { blocks, title } = useSelect( ( select ) => {\n\t\tconst { getBlocks } = select( blockEditorStore );\n\t\tconst { getEditedPostAttribute } = select( editorStore );\n\t\tconst { getPostType } = select( coreStore );\n\t\tconst postType = getPostType( getEditedPostAttribute( 'type' ) );\n\n\t\treturn {\n\t\t\ttitle: getEditedPostAttribute( 'title' ),\n\t\t\tblocks: getBlocks(),\n\t\t\tisTitleSupported: postType?.supports?.title ?? false,\n\t\t};\n\t} );\n\n\tconst headings = computeOutlineHeadings( blocks );\n\tif ( headings.length < 1 ) {\n\t\treturn (\n\t\t\t<div className=\"editor-document-outline has-no-headings\">\n\t\t\t\t<EmptyOutlineIllustration />\n\t\t\t\t<p>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'Navigate the structure of your document and address issues like empty or incorrect heading levels.'\n\t\t\t\t\t) }\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tlet prevHeadingLevel = 1;\n\n\t// Not great but it's the simplest way to locate the title right now.\n\tconst titleNode = document.querySelector( '.editor-post-title__input' );\n\tconst hasTitle = isTitleSupported && title && titleNode;\n\tconst countByLevel = headings.reduce(\n\t\t( acc, heading ) => ( {\n\t\t\t...acc,\n\t\t\t[ heading.level ]: ( acc[ heading.level ] || 0 ) + 1,\n\t\t} ),\n\t\t{}\n\t);\n\tconst hasMultipleH1 = countByLevel[ 1 ] > 1;\n\n\treturn (\n\t\t<div className=\"document-outline\">\n\t\t\t<ul>\n\t\t\t\t{ hasTitle && (\n\t\t\t\t\t<DocumentOutlineItem\n\t\t\t\t\t\tlevel={ __( 'Title' ) }\n\t\t\t\t\t\tisValid\n\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\thref={ `#${ titleNode.id }` }\n\t\t\t\t\t\tisDisabled={ hasOutlineItemsDisabled }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ title }\n\t\t\t\t\t</DocumentOutlineItem>\n\t\t\t\t) }\n\t\t\t\t{ headings.map( ( item, index ) => {\n\t\t\t\t\t// Headings remain the same, go up by one, or down by any amount.\n\t\t\t\t\t// Otherwise there are missing levels.\n\t\t\t\t\tconst isIncorrectLevel = item.level > prevHeadingLevel + 1;\n\n\t\t\t\t\tconst isValid =\n\t\t\t\t\t\t! item.isEmpty &&\n\t\t\t\t\t\t! isIncorrectLevel &&\n\t\t\t\t\t\t!! item.level &&\n\t\t\t\t\t\t( item.level !== 1 ||\n\t\t\t\t\t\t\t( ! hasMultipleH1 && ! hasTitle ) );\n\t\t\t\t\tprevHeadingLevel = item.level;\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<DocumentOutlineItem\n\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\tlevel={ `H${ item.level }` }\n\t\t\t\t\t\t\tisValid={ isValid }\n\t\t\t\t\t\t\tisDisabled={ hasOutlineItemsDisabled }\n\t\t\t\t\t\t\thref={ `#block-${ item.clientId }` }\n\t\t\t\t\t\t\tonSelect={ () => {\n\t\t\t\t\t\t\t\tselectBlock( item.clientId );\n\t\t\t\t\t\t\t\tonSelect?.();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ item.isEmpty\n\t\t\t\t\t\t\t\t? emptyHeadingContent\n\t\t\t\t\t\t\t\t: getTextContent(\n\t\t\t\t\t\t\t\t\t\tcreate( {\n\t\t\t\t\t\t\t\t\t\t\thtml: item.attributes.content,\n\t\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{ isIncorrectLevel && incorrectLevelContent }\n\t\t\t\t\t\t\t{ item.level === 1 &&\n\t\t\t\t\t\t\t\thasMultipleH1 &&\n\t\t\t\t\t\t\t\tmultipleH1Headings }\n\t\t\t\t\t\t\t{ hasTitle &&\n\t\t\t\t\t\t\t\titem.level === 1 &&\n\t\t\t\t\t\t\t\t! hasMultipleH1 &&\n\t\t\t\t\t\t\t\tsingleH1Headings }\n\t\t\t\t\t\t</DocumentOutlineItem>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</ul>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AAKA,IAAAM,KAAA,GAAAC,sBAAA,CAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AAAmD,IAAAS,WAAA,GAAAT,OAAA;AAdnD;AACA;AACA;;AAQA;AACA;AACA;;AAIA;AACA;AACA,GACA,MAAMU,m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CAAE4C,gBAAgB,IAClB,CAAC,CAAEF,IAAI,CAAC5C,KAAK,KACX4C,IAAI,CAAC5C,KAAK,KAAK,CAAC,IACf,CAAEqC,aAAa,IAAI,CAAEJ,QAAU,CAAE;QACrCJ,gBAAgB,GAAGe,IAAI,CAAC5C,KAAK;QAE7B,oBACC,IAAAjC,WAAA,CAAAS,IAAA,EAACZ,KAAA,CAAA0E,OAAmB;UAEnBtC,KAAK,EAAG,IAAK4C,IAAI,CAAC5C,KAAK,EAAK;UAC5BuC,OAAO,EAAGA,OAAS;UACnBG,UAAU,EAAG9B,uBAAyB;UACtC4B,IAAI,EAAG,UAAWI,IAAI,CAACG,QAAQ,EAAK;UACpCrC,QAAQ,EAAGA,CAAA,KAAM;YAChBG,WAAW,CAAE+B,IAAI,CAACG,QAAS,CAAC;YAC5BrC,QAAQ,GAAG,CAAC;UACb,CAAG;UAAAxC,QAAA,GAED0E,IAAI,CAAC1C,OAAO,GACXlC,mBAAmB,GACnB,IAAAgF,wBAAc,EACd,IAAAC,gBAAM,EAAE;YACPC,IAAI,EAAEN,IAAI,CAAC3C,UAAU,CAACK;UACvB,CAAE,CACF,CAAC,EACFwC,gBAAgB,IAAI1E,qBAAqB,EACzCwE,IAAI,CAAC5C,KAAK,KAAK,CAAC,IACjBqC,aAAa,IACb/D,kBAAkB,EACjB2D,QAAQ,IACTW,IAAI,CAAC5C,KAAK,KAAK,CAAC,IAChB,CAAEqC,aAAa,IACfhE,gBAAgB;QAAA,GAxBXwE,KAyBc,CAAC;MAExB,CAAE,CAAC;IAAA,CACA;EAAC,CACD,CAAC;AAER","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_jsxRuntime","TableOfContentsItem","children","isValid","level","href","onSelect","jsx","className","clsx","toLowerCase","jsxs","onClick","_default","exports","default"],"sources":["@wordpress/editor/src/components/document-outline/item.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\nconst TableOfContentsItem = ( {\n\tchildren,\n\tisValid,\n\tlevel,\n\thref,\n\tonSelect,\n} ) => (\n\t<li\n\t\tclassName={ clsx(\n\t\t\t'document-outline__item',\n\t\t\t`is-${ level.toLowerCase() }`,\n\t\t\t{\n\t\t\t\t'is-invalid': ! isValid,\n\t\t\t}\n\t\t) }\n\t>\n\t\t<a\n\t\t\thref={ href }\n\t\t\tclassName=\"document-outline__button\"\n\t\t\tonClick={ onSelect }\n\t\t>\n\t\t\t<span\n\t\t\t\tclassName=\"document-outline__emdash\"\n\t\t\t\taria-hidden=\"true\"\n\t\t\t></span>\n\t\t\t<strong className=\"document-outline__level\">{ level }</strong>\n\t\t\t<span className=\"document-outline__item-content\">{ children }</span>\n\t\t</a>\n\t</li>\n);\n\nexport default TableOfContentsItem;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAwB,IAAAC,WAAA,GAAAD,OAAA;AAHxB;AACA;AACA;;AAGA,MAAME,mBAAmB,GAAGA,CAAE;EAC7BC,QAAQ;EACRC,OAAO;EACPC,KAAK;EACLC,IAAI;EACJC;AACD,CAAC,kBACA,IAAAN,WAAA,CAAAO,GAAA;EACCC,SAAS,EAAG,IAAAC,aAAI,EACf,wBAAwB,
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_jsxRuntime","TableOfContentsItem","children","isValid","level","href","onSelect","jsx","className","clsx","toLowerCase","jsxs","onClick","_default","exports","default"],"sources":["@wordpress/editor/src/components/document-outline/item.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\nconst TableOfContentsItem = ( {\n\tchildren,\n\tisValid,\n\tlevel,\n\thref,\n\tonSelect,\n} ) => (\n\t<li\n\t\tclassName={ clsx(\n\t\t\t'document-outline__item',\n\t\t\t`is-${ level.toLowerCase() }`,\n\t\t\t{\n\t\t\t\t'is-invalid': ! isValid,\n\t\t\t}\n\t\t) }\n\t>\n\t\t<a\n\t\t\thref={ href }\n\t\t\tclassName=\"document-outline__button\"\n\t\t\tonClick={ onSelect }\n\t\t>\n\t\t\t<span\n\t\t\t\tclassName=\"document-outline__emdash\"\n\t\t\t\taria-hidden=\"true\"\n\t\t\t></span>\n\t\t\t<strong className=\"document-outline__level\">{ level }</strong>\n\t\t\t<span className=\"document-outline__item-content\">{ children }</span>\n\t\t</a>\n\t</li>\n);\n\nexport default TableOfContentsItem;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAwB,IAAAC,WAAA,GAAAD,OAAA;AAHxB;AACA;AACA;;AAGA,MAAME,mBAAmB,GAAGA,CAAE;EAC7BC,QAAQ;EACRC,OAAO;EACPC,KAAK;EACLC,IAAI;EACJC;AACD,CAAC,kBACA,IAAAN,WAAA,CAAAO,GAAA;EACCC,SAAS,EAAG,IAAAC,aAAI,EACf,wBAAwB,EACxB,MAAOL,KAAK,CAACM,WAAW,CAAC,CAAC,EAAG,EAC7B;IACC,YAAY,EAAE,CAAEP;EACjB,CACD,CAAG;EAAAD,QAAA,eAEH,IAAAF,WAAA,CAAAW,IAAA;IACCN,IAAI,EAAGA,IAAM;IACbG,SAAS,EAAC,0BAA0B;IACpCI,OAAO,EAAGN,QAAU;IAAAJ,QAAA,gBAEpB,IAAAF,WAAA,CAAAO,GAAA;MACCC,SAAS,EAAC,0BAA0B;MACpC,eAAY;IAAM,CACZ,CAAC,eACR,IAAAR,WAAA,CAAAO,GAAA;MAAQC,SAAS,EAAC,yBAAyB;MAAAN,QAAA,EAAGE;IAAK,CAAU,CAAC,eAC9D,IAAAJ,WAAA,CAAAO,GAAA;MAAMC,SAAS,EAAC,gCAAgC;MAAAN,QAAA,EAAGA;IAAQ,CAAQ,CAAC;EAAA,CAClE;AAAC,CACD,CACJ;AAAC,IAAAW,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEad,mBAAmB","ignoreList":[]}
|
|
@@ -97,7 +97,7 @@ function DocumentTools({
|
|
|
97
97
|
const toggleInserter = (0, _element.useCallback)(() => setIsInserterOpened(!isInserterOpened), [isInserterOpened, setIsInserterOpened]);
|
|
98
98
|
|
|
99
99
|
/* translators: button label text should, if possible, be under 16 characters. */
|
|
100
|
-
const longLabel = (0, _i18n._x)('
|
|
100
|
+
const longLabel = (0, _i18n._x)('Block Inserter', 'Generic label for block inserter button');
|
|
101
101
|
const shortLabel = !isInserterOpened ? (0, _i18n.__)('Add') : (0, _i18n.__)('Close');
|
|
102
102
|
return (
|
|
103
103
|
/*#__PURE__*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_compose","_data","_i18n","_blockEditor","_components","_icons","_element","_keyboardShortcuts","_preferences","_lockUnlock","_store","_redo","_undo","_jsxRuntime","DocumentTools","className","disableBlockTools","setIsInserterOpened","setIsListViewOpened","useDispatch","editorStore","isDistractionFree","isInserterOpened","isListViewOpen","listViewShortcut","inserterSidebarToggleRef","listViewToggleRef","showIconLabels","useSelect","select","get","preferencesStore","isListViewOpened","getEditorMode","getInserterSidebarToggleRef","getListViewToggleRef","unlock","getShortcutRepresentation","keyboardShortcutsStore","__unstableGetEditorMode","blockEditorStore","isVisualMode","isZoomedOutView","preventDefault","event","isLargeViewport","useViewportMatch","isWideViewport","toolbarAriaLabel","__","toggleListView","useCallback","toggleInserter","longLabel","_x","shortLabel","jsx","NavigableToolbar","clsx","variant","children","jsxs","ToolbarItem","ref","as","Button","isPressed","onMouseDown","onClick","disabled","icon","plus","label","showTooltip","Fragment","ToolSelector","undefined","size","EditorHistoryUndo","EditorHistoryRedo","listView","shortcut","_default","exports","default"],"sources":["@wordpress/editor/src/components/document-tools/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\tNavigableToolbar,\n\tToolSelector,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { Button, ToolbarItem } from '@wordpress/components';\nimport { listView, plus } from '@wordpress/icons';\nimport { useCallback } from '@wordpress/element';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editorStore } from '../../store';\nimport EditorHistoryRedo from '../editor-history/redo';\nimport EditorHistoryUndo from '../editor-history/undo';\n\nfunction DocumentTools( { className, disableBlockTools = false } ) {\n\tconst { setIsInserterOpened, setIsListViewOpened } =\n\t\tuseDispatch( editorStore );\n\tconst {\n\t\tisDistractionFree,\n\t\tisInserterOpened,\n\t\tisListViewOpen,\n\t\tlistViewShortcut,\n\t\tinserterSidebarToggleRef,\n\t\tlistViewToggleRef,\n\t\tshowIconLabels,\n\t} = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\tconst {\n\t\t\tisListViewOpened,\n\t\t\tgetEditorMode,\n\t\t\tgetInserterSidebarToggleRef,\n\t\t\tgetListViewToggleRef,\n\t\t} = unlock( select( editorStore ) );\n\t\tconst { getShortcutRepresentation } = select( keyboardShortcutsStore );\n\t\tconst { __unstableGetEditorMode } = select( blockEditorStore );\n\n\t\treturn {\n\t\t\tisInserterOpened: select( editorStore ).isInserterOpened(),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tlistViewShortcut: getShortcutRepresentation(\n\t\t\t\t'core/editor/toggle-list-view'\n\t\t\t),\n\t\t\tinserterSidebarToggleRef: getInserterSidebarToggleRef(),\n\t\t\tlistViewToggleRef: getListViewToggleRef(),\n\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\tisVisualMode: getEditorMode() === 'visual',\n\t\t\tisZoomedOutView: __unstableGetEditorMode() === 'zoom-out',\n\t\t};\n\t}, [] );\n\n\tconst preventDefault = ( event ) => {\n\t\t// Because the inserter behaves like a dialog,\n\t\t// if the inserter is opened already then when we click on the toggle button\n\t\t// then the initial click event will close the inserter and then be propagated\n\t\t// to the inserter toggle and it will open it again.\n\t\t// To prevent this we need to stop the propagation of the event.\n\t\t// This won't be necessary when the inserter no longer behaves like a dialog.\n\n\t\tif ( isInserterOpened ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\t};\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst isWideViewport = useViewportMatch( 'wide' );\n\n\t/* translators: accessibility text for the editor toolbar */\n\tconst toolbarAriaLabel = __( 'Document tools' );\n\n\tconst toggleListView = useCallback(\n\t\t() => setIsListViewOpened( ! isListViewOpen ),\n\t\t[ setIsListViewOpened, isListViewOpen ]\n\t);\n\n\tconst toggleInserter = useCallback(\n\t\t() => setIsInserterOpened( ! isInserterOpened ),\n\t\t[ isInserterOpened, setIsInserterOpened ]\n\t);\n\n\t/* translators: button label text should, if possible, be under 16 characters. */\n\tconst longLabel = _x(\n\t\t'Toggle block inserter',\n\t\t'Generic label for block inserter button'\n\t);\n\tconst shortLabel = ! isInserterOpened ? __( 'Add' ) : __( 'Close' );\n\n\treturn (\n\t\t// Some plugins expect and use the `edit-post-header-toolbar` CSS class to\n\t\t// find the toolbar and inject UI elements into it. This is not officially\n\t\t// supported, but we're keeping it in the list of class names for backwards\n\t\t// compatibility.\n\t\t<NavigableToolbar\n\t\t\tclassName={ clsx(\n\t\t\t\t'editor-document-tools',\n\t\t\t\t'edit-post-header-toolbar',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\taria-label={ toolbarAriaLabel }\n\t\t\tvariant=\"unstyled\"\n\t\t>\n\t\t\t<div className=\"editor-document-tools__left\">\n\t\t\t\t{ ! isDistractionFree && (\n\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\tref={ inserterSidebarToggleRef }\n\t\t\t\t\t\tas={ Button }\n\t\t\t\t\t\tclassName=\"editor-document-tools__inserter-toggle\"\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\tisPressed={ isInserterOpened }\n\t\t\t\t\t\tonMouseDown={ preventDefault }\n\t\t\t\t\t\tonClick={ toggleInserter }\n\t\t\t\t\t\tdisabled={ disableBlockTools }\n\t\t\t\t\t\ticon={ plus }\n\t\t\t\t\t\tlabel={ showIconLabels ? shortLabel : longLabel }\n\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\taria-expanded={ isInserterOpened }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ ( isWideViewport || ! showIconLabels ) && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\t\tas={ ToolSelector }\n\t\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\tshowIconLabels ? 'tertiary' : undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdisabled={ disableBlockTools }\n\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\tas={ EditorHistoryUndo }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\tas={ EditorHistoryRedo }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ ! isDistractionFree && (\n\t\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\t\tas={ Button }\n\t\t\t\t\t\t\t\tclassName=\"editor-document-tools__document-overview-toggle\"\n\t\t\t\t\t\t\t\ticon={ listView }\n\t\t\t\t\t\t\t\tdisabled={ disableBlockTools }\n\t\t\t\t\t\t\t\tisPressed={ isListViewOpen }\n\t\t\t\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\t\t\t\tlabel={ __( 'Document Overview' ) }\n\t\t\t\t\t\t\t\tonClick={ toggleListView }\n\t\t\t\t\t\t\t\tshortcut={ listViewShortcut }\n\t\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\tshowIconLabels ? 'tertiary' : undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\taria-expanded={ isListViewOpen }\n\t\t\t\t\t\t\t\tref={ listViewToggleRef }\n\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</NavigableToolbar>\n\t);\n}\n\nexport default DocumentTools;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAKA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,kBAAA,GAAAR,OAAA;AACA,IAAAS,YAAA,GAAAT,OAAA;AAKA,IAAAU,WAAA,GAAAV,OAAA;AACA,IAAAW,MAAA,GAAAX,OAAA;AACA,IAAAY,KAAA,GAAAb,sBAAA,CAAAC,OAAA;AACA,IAAAa,KAAA,GAAAd,sBAAA,CAAAC,OAAA;AAAuD,IAAAc,WAAA,GAAA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A2C,GAAA,EAACpD,WAAA,CAAA0D,WAAW;YACXE,EAAE,EAAGC,kBAAQ;YACblD,SAAS,EAAC,iDAAiD;YAC3DuD,IAAI,EAAGU,eAAU;YACjBX,QAAQ,EAAGrD,iBAAmB;YAC9BkD,SAAS,EAAG3C;YACZ;YACAiD,KAAK,EAAG,IAAAvB,QAAE,EAAE,mBAAoB,CAAG;YACnCmB,OAAO,EAAGlB,cAAgB;YAC1B+B,QAAQ,EAAGzD,gBAAkB;YAC7BiD,WAAW,EAAG,CAAE9C,cAAgB;YAChCgC,OAAO,EACNhC,cAAc,GAAG,UAAU,GAAGiD,SAC9B;YACD,iBAAgBrD,cAAgB;YAChCwC,GAAG,EAAGrC,iBAAmB;YACzBmD,IAAI,EAAC;UAAS,CACd,CACD;QAAA,CACA,CACF;MAAA,CACG;IAAC,CACW;EAAC;AAErB;AAAC,IAAAK,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEctE,aAAa","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_compose","_data","_i18n","_blockEditor","_components","_icons","_element","_keyboardShortcuts","_preferences","_lockUnlock","_store","_redo","_undo","_jsxRuntime","DocumentTools","className","disableBlockTools","setIsInserterOpened","setIsListViewOpened","useDispatch","editorStore","isDistractionFree","isInserterOpened","isListViewOpen","listViewShortcut","inserterSidebarToggleRef","listViewToggleRef","showIconLabels","useSelect","select","get","preferencesStore","isListViewOpened","getEditorMode","getInserterSidebarToggleRef","getListViewToggleRef","unlock","getShortcutRepresentation","keyboardShortcutsStore","__unstableGetEditorMode","blockEditorStore","isVisualMode","isZoomedOutView","preventDefault","event","isLargeViewport","useViewportMatch","isWideViewport","toolbarAriaLabel","__","toggleListView","useCallback","toggleInserter","longLabel","_x","shortLabel","jsx","NavigableToolbar","clsx","variant","children","jsxs","ToolbarItem","ref","as","Button","isPressed","onMouseDown","onClick","disabled","icon","plus","label","showTooltip","Fragment","ToolSelector","undefined","size","EditorHistoryUndo","EditorHistoryRedo","listView","shortcut","_default","exports","default"],"sources":["@wordpress/editor/src/components/document-tools/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\tNavigableToolbar,\n\tToolSelector,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { Button, ToolbarItem } from '@wordpress/components';\nimport { listView, plus } from '@wordpress/icons';\nimport { useCallback } from '@wordpress/element';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editorStore } from '../../store';\nimport EditorHistoryRedo from '../editor-history/redo';\nimport EditorHistoryUndo from '../editor-history/undo';\n\nfunction DocumentTools( { className, disableBlockTools = false } ) {\n\tconst { setIsInserterOpened, setIsListViewOpened } =\n\t\tuseDispatch( editorStore );\n\tconst {\n\t\tisDistractionFree,\n\t\tisInserterOpened,\n\t\tisListViewOpen,\n\t\tlistViewShortcut,\n\t\tinserterSidebarToggleRef,\n\t\tlistViewToggleRef,\n\t\tshowIconLabels,\n\t} = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\tconst {\n\t\t\tisListViewOpened,\n\t\t\tgetEditorMode,\n\t\t\tgetInserterSidebarToggleRef,\n\t\t\tgetListViewToggleRef,\n\t\t} = unlock( select( editorStore ) );\n\t\tconst { getShortcutRepresentation } = select( keyboardShortcutsStore );\n\t\tconst { __unstableGetEditorMode } = select( blockEditorStore );\n\n\t\treturn {\n\t\t\tisInserterOpened: select( editorStore ).isInserterOpened(),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tlistViewShortcut: getShortcutRepresentation(\n\t\t\t\t'core/editor/toggle-list-view'\n\t\t\t),\n\t\t\tinserterSidebarToggleRef: getInserterSidebarToggleRef(),\n\t\t\tlistViewToggleRef: getListViewToggleRef(),\n\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\tisVisualMode: getEditorMode() === 'visual',\n\t\t\tisZoomedOutView: __unstableGetEditorMode() === 'zoom-out',\n\t\t};\n\t}, [] );\n\n\tconst preventDefault = ( event ) => {\n\t\t// Because the inserter behaves like a dialog,\n\t\t// if the inserter is opened already then when we click on the toggle button\n\t\t// then the initial click event will close the inserter and then be propagated\n\t\t// to the inserter toggle and it will open it again.\n\t\t// To prevent this we need to stop the propagation of the event.\n\t\t// This won't be necessary when the inserter no longer behaves like a dialog.\n\n\t\tif ( isInserterOpened ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\t};\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst isWideViewport = useViewportMatch( 'wide' );\n\n\t/* translators: accessibility text for the editor toolbar */\n\tconst toolbarAriaLabel = __( 'Document tools' );\n\n\tconst toggleListView = useCallback(\n\t\t() => setIsListViewOpened( ! isListViewOpen ),\n\t\t[ setIsListViewOpened, isListViewOpen ]\n\t);\n\n\tconst toggleInserter = useCallback(\n\t\t() => setIsInserterOpened( ! isInserterOpened ),\n\t\t[ isInserterOpened, setIsInserterOpened ]\n\t);\n\n\t/* translators: button label text should, if possible, be under 16 characters. */\n\tconst longLabel = _x(\n\t\t'Block Inserter',\n\t\t'Generic label for block inserter button'\n\t);\n\tconst shortLabel = ! isInserterOpened ? __( 'Add' ) : __( 'Close' );\n\n\treturn (\n\t\t// Some plugins expect and use the `edit-post-header-toolbar` CSS class to\n\t\t// find the toolbar and inject UI elements into it. This is not officially\n\t\t// supported, but we're keeping it in the list of class names for backwards\n\t\t// compatibility.\n\t\t<NavigableToolbar\n\t\t\tclassName={ clsx(\n\t\t\t\t'editor-document-tools',\n\t\t\t\t'edit-post-header-toolbar',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\taria-label={ toolbarAriaLabel }\n\t\t\tvariant=\"unstyled\"\n\t\t>\n\t\t\t<div className=\"editor-document-tools__left\">\n\t\t\t\t{ ! isDistractionFree && (\n\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\tref={ inserterSidebarToggleRef }\n\t\t\t\t\t\tas={ Button }\n\t\t\t\t\t\tclassName=\"editor-document-tools__inserter-toggle\"\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\tisPressed={ isInserterOpened }\n\t\t\t\t\t\tonMouseDown={ preventDefault }\n\t\t\t\t\t\tonClick={ toggleInserter }\n\t\t\t\t\t\tdisabled={ disableBlockTools }\n\t\t\t\t\t\ticon={ plus }\n\t\t\t\t\t\tlabel={ showIconLabels ? shortLabel : longLabel }\n\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\taria-expanded={ isInserterOpened }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ ( isWideViewport || ! showIconLabels ) && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\t\tas={ ToolSelector }\n\t\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\tshowIconLabels ? 'tertiary' : undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdisabled={ disableBlockTools }\n\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\tas={ EditorHistoryUndo }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\tas={ EditorHistoryRedo }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ ! isDistractionFree && (\n\t\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\t\tas={ Button }\n\t\t\t\t\t\t\t\tclassName=\"editor-document-tools__document-overview-toggle\"\n\t\t\t\t\t\t\t\ticon={ listView }\n\t\t\t\t\t\t\t\tdisabled={ disableBlockTools }\n\t\t\t\t\t\t\t\tisPressed={ isListViewOpen }\n\t\t\t\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\t\t\t\tlabel={ __( 'Document Overview' ) }\n\t\t\t\t\t\t\t\tonClick={ toggleListView }\n\t\t\t\t\t\t\t\tshortcut={ listViewShortcut }\n\t\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\tshowIconLabels ? 'tertiary' : undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\taria-expanded={ isListViewOpen }\n\t\t\t\t\t\t\t\tref={ listViewToggleRef }\n\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</NavigableToolbar>\n\t);\n}\n\nexport default DocumentTools;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAKA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AACA,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