@wordpress/editor 14.8.8 → 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 +4 -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/block-settings-menu/content-only-settings-menu.js +15 -18
- package/build/components/block-settings-menu/content-only-settings-menu.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 +2 -7
- package/build/components/document-tools/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/header/index.js +19 -16
- package/build/components/header/index.js.map +1 -1
- package/build/components/inserter-sidebar/index.js +8 -9
- package/build/components/inserter-sidebar/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/disable-non-page-content-blocks.js +17 -18
- package/build/components/provider/disable-non-page-content-blocks.js.map +1 -1
- package/build/components/provider/index.js +1 -1
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/use-post-content-blocks.js +34 -0
- package/build/components/provider/use-post-content-blocks.js.map +1 -0
- package/build/components/resizable-editor/resize-handle.js +4 -0
- 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/index.js.map +1 -1
- package/build/components/visual-editor/use-select-nearest-editable-block.js.map +1 -1
- package/build/components/zoom-out-toggle/index.js +1 -1
- package/build/components/zoom-out-toggle/index.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/dataviews/store/private-actions.js +2 -7
- package/build/dataviews/store/private-actions.js.map +1 -1
- package/build/private-apis.js +0 -1
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +46 -6
- 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/private-selectors.js +3 -3
- package/build/store/private-selectors.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 +15 -21
- 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 +3 -10
- 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 +1 -3
- 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 +20 -18
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/inserter-sidebar/index.js +8 -9
- package/build-module/components/inserter-sidebar/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/disable-non-page-content-blocks.js +17 -18
- package/build-module/components/provider/disable-non-page-content-blocks.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/provider/use-post-content-blocks.js +27 -0
- package/build-module/components/provider/use-post-content-blocks.js.map +1 -0
- package/build-module/components/resizable-editor/resize-handle.js +5 -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/index.js +1 -3
- 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/components/zoom-out-toggle/index.js +1 -1
- package/build-module/components/zoom-out-toggle/index.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/dataviews/store/private-actions.js +4 -8
- package/build-module/dataviews/store/private-actions.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 +44 -6
- 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/private-selectors.js +2 -2
- package/build-module/store/private-selectors.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 +29 -6
- package/build-style/style.css +29 -6
- package/build-types/bindings/api.d.ts +0 -13
- package/build-types/bindings/api.d.ts.map +1 -1
- package/build-types/components/document-tools/index.d.ts.map +1 -1
- package/build-types/components/header/index.d.ts.map +1 -1
- package/build-types/components/inserter-sidebar/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/disable-non-page-content-blocks.d.ts.map +1 -1
- package/build-types/components/provider/index.d.ts.map +1 -1
- package/build-types/components/provider/use-post-content-blocks.d.ts +2 -0
- package/build-types/components/provider/use-post-content-blocks.d.ts.map +1 -0
- package/build-types/components/resizable-editor/resize-handle.d.ts.map +1 -1
- package/build-types/private-apis.d.ts.map +1 -1
- package/build-types/store/actions.d.ts +2 -17
- package/build-types/store/actions.d.ts.map +1 -1
- package/build-types/store/private-selectors.d.ts +2 -2
- package/build-types/store/private-selectors.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/block-settings-menu/content-only-settings-menu.js +19 -19
- package/src/components/document-tools/index.js +2 -5
- package/src/components/header/index.js +24 -13
- package/src/components/inserter-sidebar/index.js +8 -11
- 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/disable-non-page-content-blocks.js +20 -34
- package/src/components/provider/index.js +1 -0
- package/src/components/provider/use-post-content-blocks.js +42 -0
- package/src/components/resizable-editor/resize-handle.js +5 -0
- package/src/components/zoom-out-toggle/index.js +1 -1
- package/src/dataviews/store/private-actions.ts +7 -7
- package/src/private-apis.js +1 -5
- package/src/store/actions.js +51 -7
- package/src/store/private-selectors.js +2 -2
- package/src/store/selectors.js +21 -0
- package/src/store/test/actions.js +76 -0
- package/src/store/test/reducer.js +0 -22
- package/tsconfig.tsbuildinfo +1 -1
- package/build/dataviews/actions/delete-post.js +0 -98
- package/build/dataviews/actions/delete-post.js.map +0 -1
- package/build/dataviews/actions/rename-post.js +0 -125
- package/build/dataviews/actions/rename-post.js.map +0 -1
- package/build/dataviews/actions/reset-post.js +0 -113
- package/build/dataviews/actions/reset-post.js.map +0 -1
- package/build/dataviews/actions/restore-post.js +0 -112
- package/build/dataviews/actions/restore-post.js.map +0 -1
- package/build/dataviews/actions/trash-post.js +0 -144
- package/build/dataviews/actions/trash-post.js.map +0 -1
- package/build/dataviews/fields/index.js +0 -32
- package/build/dataviews/fields/index.js.map +0 -1
- package/build-module/dataviews/actions/delete-post.js +0 -89
- package/build-module/dataviews/actions/delete-post.js.map +0 -1
- package/build-module/dataviews/actions/rename-post.js +0 -118
- package/build-module/dataviews/actions/rename-post.js.map +0 -1
- package/build-module/dataviews/actions/reset-post.js +0 -106
- package/build-module/dataviews/actions/reset-post.js.map +0 -1
- package/build-module/dataviews/actions/restore-post.js +0 -104
- package/build-module/dataviews/actions/restore-post.js.map +0 -1
- package/build-module/dataviews/actions/trash-post.js +0 -137
- package/build-module/dataviews/actions/trash-post.js.map +0 -1
- package/build-module/dataviews/fields/index.js +0 -26
- package/build-module/dataviews/fields/index.js.map +0 -1
- package/build-types/dataviews/actions/delete-post.d.ts +0 -5
- package/build-types/dataviews/actions/delete-post.d.ts.map +0 -1
- package/build-types/dataviews/actions/rename-post.d.ts +0 -5
- package/build-types/dataviews/actions/rename-post.d.ts.map +0 -1
- package/build-types/dataviews/actions/reset-post.d.ts +0 -5
- package/build-types/dataviews/actions/reset-post.d.ts.map +0 -1
- package/build-types/dataviews/actions/restore-post.d.ts +0 -5
- package/build-types/dataviews/actions/restore-post.d.ts.map +0 -1
- package/build-types/dataviews/actions/trash-post.d.ts +0 -5
- package/build-types/dataviews/actions/trash-post.d.ts.map +0 -1
- package/build-types/dataviews/fields/index.d.ts +0 -8
- package/build-types/dataviews/fields/index.d.ts.map +0 -1
- package/src/dataviews/actions/delete-post.tsx +0 -109
- package/src/dataviews/actions/rename-post.tsx +0 -146
- package/src/dataviews/actions/reset-post.tsx +0 -147
- package/src/dataviews/actions/restore-post.tsx +0 -134
- package/src/dataviews/actions/trash-post.tsx +0 -198
- package/src/dataviews/fields/index.ts +0 -26
|
@@ -3,38 +3,31 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { useSelect, useRegistry } from '@wordpress/data';
|
|
5
5
|
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
6
|
-
import { useEffect
|
|
7
|
-
import { applyFilters } from '@wordpress/hooks';
|
|
6
|
+
import { useEffect } from '@wordpress/element';
|
|
8
7
|
|
|
9
8
|
/**
|
|
10
9
|
* Internal dependencies
|
|
11
10
|
*/
|
|
12
|
-
import
|
|
13
|
-
import { unlock } from '../../lock-unlock';
|
|
14
|
-
const POST_CONTENT_BLOCK_TYPES = ['core/post-title', 'core/post-featured-image', 'core/post-content'];
|
|
11
|
+
import usePostContentBlocks from './use-post-content-blocks';
|
|
15
12
|
|
|
16
13
|
/**
|
|
17
14
|
* Component that when rendered, makes it so that the site editor allows only
|
|
18
15
|
* page content to be edited.
|
|
19
16
|
*/
|
|
20
17
|
export default function DisableNonPageContentBlocks() {
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
// Note that there are two separate subscriptions because the result for each
|
|
24
|
-
// returns a new array.
|
|
25
|
-
const contentOnlyIds = useSelect(select => {
|
|
18
|
+
const contentOnlyIds = usePostContentBlocks();
|
|
19
|
+
const templateParts = useSelect(select => {
|
|
26
20
|
const {
|
|
27
|
-
|
|
28
|
-
} =
|
|
29
|
-
return
|
|
30
|
-
}, [
|
|
21
|
+
getBlocksByName
|
|
22
|
+
} = select(blockEditorStore);
|
|
23
|
+
return getBlocksByName('core/template-part');
|
|
24
|
+
}, []);
|
|
31
25
|
const disabledIds = useSelect(select => {
|
|
32
26
|
const {
|
|
33
|
-
getBlocksByName,
|
|
34
27
|
getBlockOrder
|
|
35
28
|
} = select(blockEditorStore);
|
|
36
|
-
return
|
|
37
|
-
}, []);
|
|
29
|
+
return templateParts.flatMap(clientId => getBlockOrder(clientId));
|
|
30
|
+
}, [templateParts]);
|
|
38
31
|
const registry = useRegistry();
|
|
39
32
|
useEffect(() => {
|
|
40
33
|
const {
|
|
@@ -46,6 +39,9 @@ export default function DisableNonPageContentBlocks() {
|
|
|
46
39
|
for (const clientId of contentOnlyIds) {
|
|
47
40
|
setBlockEditingMode(clientId, 'contentOnly');
|
|
48
41
|
}
|
|
42
|
+
for (const clientId of templateParts) {
|
|
43
|
+
setBlockEditingMode(clientId, 'contentOnly');
|
|
44
|
+
}
|
|
49
45
|
for (const clientId of disabledIds) {
|
|
50
46
|
setBlockEditingMode(clientId, 'disabled');
|
|
51
47
|
}
|
|
@@ -56,12 +52,15 @@ export default function DisableNonPageContentBlocks() {
|
|
|
56
52
|
for (const clientId of contentOnlyIds) {
|
|
57
53
|
unsetBlockEditingMode(clientId);
|
|
58
54
|
}
|
|
55
|
+
for (const clientId of templateParts) {
|
|
56
|
+
unsetBlockEditingMode(clientId);
|
|
57
|
+
}
|
|
59
58
|
for (const clientId of disabledIds) {
|
|
60
59
|
unsetBlockEditingMode(clientId);
|
|
61
60
|
}
|
|
62
61
|
});
|
|
63
62
|
};
|
|
64
|
-
}, [contentOnlyIds, disabledIds, registry]);
|
|
63
|
+
}, [templateParts, contentOnlyIds, disabledIds, registry]);
|
|
65
64
|
return null;
|
|
66
65
|
}
|
|
67
66
|
//# sourceMappingURL=disable-non-page-content-blocks.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useSelect","useRegistry","store","blockEditorStore","useEffect","
|
|
1
|
+
{"version":3,"names":["useSelect","useRegistry","store","blockEditorStore","useEffect","usePostContentBlocks","DisableNonPageContentBlocks","contentOnlyIds","templateParts","select","getBlocksByName","disabledIds","getBlockOrder","flatMap","clientId","registry","setBlockEditingMode","unsetBlockEditingMode","dispatch","batch"],"sources":["@wordpress/editor/src/components/provider/disable-non-page-content-blocks.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useRegistry } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport usePostContentBlocks from './use-post-content-blocks';\n\n/**\n * Component that when rendered, makes it so that the site editor allows only\n * page content to be edited.\n */\nexport default function DisableNonPageContentBlocks() {\n\tconst contentOnlyIds = usePostContentBlocks();\n\tconst templateParts = useSelect( ( select ) => {\n\t\tconst { getBlocksByName } = select( blockEditorStore );\n\t\treturn getBlocksByName( 'core/template-part' );\n\t}, [] );\n\tconst disabledIds = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockOrder } = select( blockEditorStore );\n\t\t\treturn templateParts.flatMap( ( clientId ) =>\n\t\t\t\tgetBlockOrder( clientId )\n\t\t\t);\n\t\t},\n\t\t[ templateParts ]\n\t);\n\n\tconst registry = useRegistry();\n\n\tuseEffect( () => {\n\t\tconst { setBlockEditingMode, unsetBlockEditingMode } =\n\t\t\tregistry.dispatch( blockEditorStore );\n\n\t\tregistry.batch( () => {\n\t\t\tsetBlockEditingMode( '', 'disabled' );\n\t\t\tfor ( const clientId of contentOnlyIds ) {\n\t\t\t\tsetBlockEditingMode( clientId, 'contentOnly' );\n\t\t\t}\n\t\t\tfor ( const clientId of templateParts ) {\n\t\t\t\tsetBlockEditingMode( clientId, 'contentOnly' );\n\t\t\t}\n\t\t\tfor ( const clientId of disabledIds ) {\n\t\t\t\tsetBlockEditingMode( clientId, 'disabled' );\n\t\t\t}\n\t\t} );\n\n\t\treturn () => {\n\t\t\tregistry.batch( () => {\n\t\t\t\tunsetBlockEditingMode( '' );\n\t\t\t\tfor ( const clientId of contentOnlyIds ) {\n\t\t\t\t\tunsetBlockEditingMode( clientId );\n\t\t\t\t}\n\t\t\t\tfor ( const clientId of templateParts ) {\n\t\t\t\t\tunsetBlockEditingMode( clientId );\n\t\t\t\t}\n\t\t\t\tfor ( const clientId of disabledIds ) {\n\t\t\t\t\tunsetBlockEditingMode( clientId );\n\t\t\t\t}\n\t\t\t} );\n\t\t};\n\t}, [ templateParts, contentOnlyIds, disabledIds, registry ] );\n\n\treturn null;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,SAASC,SAAS,QAAQ,oBAAoB;;AAE9C;AACA;AACA;AACA,OAAOC,oBAAoB,MAAM,2BAA2B;;AAE5D;AACA;AACA;AACA;AACA,eAAe,SAASC,2BAA2BA,CAAA,EAAG;EACrD,MAAMC,cAAc,GAAGF,oBAAoB,CAAC,CAAC;EAC7C,MAAMG,aAAa,GAAGR,SAAS,CAAIS,MAAM,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,MAAMA,QAAQ,IAAIH,WAAW,EAAG;UACrCM,qBAAqB,CAAEH,QAAS,CAAC;QAClC;MACD,CAAE,CAAC;IACJ,CAAC;EACF,CAAC,EAAE,CAAEN,aAAa,EAAED,cAAc,EAAEI,WAAW,EAAEI,QAAQ,CAAG,CAAC;EAE7D,OAAO,IAAI;AACZ","ignoreList":[]}
|
|
@@ -30,9 +30,7 @@ import EditorKeyboardShortcuts from '../global-keyboard-shortcuts';
|
|
|
30
30
|
import PatternRenameModal from '../pattern-rename-modal';
|
|
31
31
|
import PatternDuplicateModal from '../pattern-duplicate-modal';
|
|
32
32
|
import TemplatePartMenuItems from '../template-part-menu-items';
|
|
33
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
34
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
35
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
33
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
36
34
|
const {
|
|
37
35
|
ExperimentalBlockEditorProvider
|
|
38
36
|
} = unlock(blockEditorPrivateApis);
|
|
@@ -193,7 +191,7 @@ export const ExperimentalEditorProvider = withRegistryProvider(({
|
|
|
193
191
|
...postContext,
|
|
194
192
|
templateSlug: rootLevelPost.type === 'wp_template' ? rootLevelPost.slug : undefined
|
|
195
193
|
};
|
|
196
|
-
}, [shouldRenderTemplate, post.id, post.type, rootLevelPost.type, rootLevelPost.slug, postTypes]);
|
|
194
|
+
}, [shouldRenderTemplate, post.id, post.type, post.slug, rootLevelPost.type, rootLevelPost.slug, postTypes]);
|
|
197
195
|
const {
|
|
198
196
|
id,
|
|
199
197
|
type
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useEffect","useLayoutEffect","useMemo","useDispatch","useSelect","__","EntityProvider","useEntityBlockEditor","store","coreStore","BlockEditorProvider","BlockContextProvider","privateApis","blockEditorPrivateApis","noticesStore","editPatternsPrivateApis","createBlock","withRegistryProvider","editorStore","useBlockEditorSettings","unlock","DisableNonPageContentBlocks","NavigationBlockEditingMode","useHideBlocksFromInserter","useCommands","BlockRemovalWarnings","StartPageOptions","KeyboardShortcutHelpModal","ContentOnlySettingsMenu","StartTemplateOptions","EditorKeyboardShortcuts","PatternRenameModal","PatternDuplicateModal","TemplatePartMenuItems","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","ExperimentalBlockEditorProvider","PatternsMenuItems","noop","NON_CONTEXTUAL_POST_TYPES","useBlockEditorProps","post","template","mode","rootLevelPost","postBlocks","onInput","onChange","type","id","templateBlocks","onInputTemplate","onChangeTemplate","maybeNavigationBlocks","ref","templateLock","blocks","disableRootLevelChanges","ExperimentalEditorProvider","settings","recovery","initialEdits","children","BlockEditorProviderComponent","__unstableTemplate","editorSettings","selection","isReady","postTypes","select","getEditorSettings","getEditorSelection","getRenderingMode","__unstableIsEditorReady","getPostTypes","per_page","shouldRenderTemplate","defaultBlockContext","postContext","slug","postType","split","postTypesSlugs","map","entity","match","join","includes","postId","templateSlug","undefined","blockEditorSettings","updatePostLock","setupEditor","updateEditorSettings","setCurrentTemplateId","setEditedPost","setRenderingMode","createWarningNotice","postLock","autosave","actions","label","url","editLink","_settings$defaultRend","defaultRenderingMode","kind","value","useSubRegistry","__unstableIsPreviewMode","EditorProvider","props"],"sources":["@wordpress/editor/src/components/provider/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useLayoutEffect, useMemo } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tEntityProvider,\n\tuseEntityBlockEditor,\n\tstore as coreStore,\n} from '@wordpress/core-data';\nimport {\n\tBlockEditorProvider,\n\tBlockContextProvider,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { privateApis as editPatternsPrivateApis } from '@wordpress/patterns';\nimport { createBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport withRegistryProvider from './with-registry-provider';\nimport { store as editorStore } from '../../store';\nimport useBlockEditorSettings from './use-block-editor-settings';\nimport { unlock } from '../../lock-unlock';\nimport DisableNonPageContentBlocks from './disable-non-page-content-blocks';\nimport NavigationBlockEditingMode from './navigation-block-editing-mode';\nimport { useHideBlocksFromInserter } from './use-hide-blocks-from-inserter';\nimport useCommands from '../commands';\nimport BlockRemovalWarnings from '../block-removal-warnings';\nimport StartPageOptions from '../start-page-options';\nimport KeyboardShortcutHelpModal from '../keyboard-shortcut-help-modal';\nimport ContentOnlySettingsMenu from '../block-settings-menu/content-only-settings-menu';\nimport StartTemplateOptions from '../start-template-options';\nimport EditorKeyboardShortcuts from '../global-keyboard-shortcuts';\nimport PatternRenameModal from '../pattern-rename-modal';\nimport PatternDuplicateModal from '../pattern-duplicate-modal';\nimport TemplatePartMenuItems from '../template-part-menu-items';\n\nconst { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis );\nconst { PatternsMenuItems } = unlock( editPatternsPrivateApis );\n\nconst noop = () => {};\n\n/**\n * These are global entities that are only there to split blocks into logical units\n * They don't provide a \"context\" for the current post/page being rendered.\n * So we should not use their ids as post context. This is important to allow post blocks\n * (post content, post title) to be used within them without issues.\n */\nconst NON_CONTEXTUAL_POST_TYPES = [\n\t'wp_block',\n\t'wp_navigation',\n\t'wp_template_part',\n];\n\n/**\n * Depending on the post, template and template mode,\n * returns the appropriate blocks and change handlers for the block editor provider.\n *\n * @param {Array} post Block list.\n * @param {boolean} template Whether the page content has focus (and the surrounding template is inert). If `true` return page content blocks. Default `false`.\n * @param {string} mode Rendering mode.\n *\n * @example\n * ```jsx\n * const [ blocks, onInput, onChange ] = useBlockEditorProps( post, template, mode );\n * ```\n *\n * @return {Array} Block editor props.\n */\nfunction useBlockEditorProps( post, template, mode ) {\n\tconst rootLevelPost =\n\t\tmode === 'post-only' || ! template ? 'post' : 'template';\n\tconst [ postBlocks, onInput, onChange ] = useEntityBlockEditor(\n\t\t'postType',\n\t\tpost.type,\n\t\t{ id: post.id }\n\t);\n\tconst [ templateBlocks, onInputTemplate, onChangeTemplate ] =\n\t\tuseEntityBlockEditor( 'postType', template?.type, {\n\t\t\tid: template?.id,\n\t\t} );\n\tconst maybeNavigationBlocks = useMemo( () => {\n\t\tif ( post.type === 'wp_navigation' ) {\n\t\t\treturn [\n\t\t\t\tcreateBlock( 'core/navigation', {\n\t\t\t\t\tref: post.id,\n\t\t\t\t\t// As the parent editor is locked with `templateLock`, the template locking\n\t\t\t\t\t// must be explicitly \"unset\" on the block itself to allow the user to modify\n\t\t\t\t\t// the block's content.\n\t\t\t\t\ttemplateLock: false,\n\t\t\t\t} ),\n\t\t\t];\n\t\t}\n\t}, [ post.type, post.id ] );\n\n\t// It is important that we don't create a new instance of blocks on every change\n\t// We should only create a new instance if the blocks them selves change, not a dependency of them.\n\tconst blocks = useMemo( () => {\n\t\tif ( maybeNavigationBlocks ) {\n\t\t\treturn maybeNavigationBlocks;\n\t\t}\n\n\t\tif ( rootLevelPost === 'template' ) {\n\t\t\treturn templateBlocks;\n\t\t}\n\n\t\treturn postBlocks;\n\t}, [ maybeNavigationBlocks, rootLevelPost, templateBlocks, postBlocks ] );\n\n\t// Handle fallback to postBlocks outside of the above useMemo, to ensure\n\t// that constructed block templates that call `createBlock` are not generated\n\t// too frequently. This ensures that clientIds are stable.\n\tconst disableRootLevelChanges =\n\t\t( !! template && mode === 'template-locked' ) ||\n\t\tpost.type === 'wp_navigation';\n\tif ( disableRootLevelChanges ) {\n\t\treturn [ blocks, noop, noop ];\n\t}\n\n\treturn [\n\t\tblocks,\n\t\trootLevelPost === 'post' ? onInput : onInputTemplate,\n\t\trootLevelPost === 'post' ? onChange : onChangeTemplate,\n\t];\n}\n\n/**\n * This component provides the editor context and manages the state of the block editor.\n *\n * @param {Object} props The component props.\n * @param {Object} props.post The post object.\n * @param {Object} props.settings The editor settings.\n * @param {boolean} props.recovery Indicates if the editor is in recovery mode.\n * @param {Array} props.initialEdits The initial edits for the editor.\n * @param {Object} props.children The child components.\n * @param {Object} [props.BlockEditorProviderComponent] The block editor provider component to use. Defaults to ExperimentalBlockEditorProvider.\n * @param {Object} [props.__unstableTemplate] The template object.\n *\n * @example\n * ```jsx\n * <ExperimentalEditorProvider\n * post={ post }\n * settings={ settings }\n * recovery={ recovery }\n * initialEdits={ initialEdits }\n * __unstableTemplate={ template }\n * >\n * { children }\n * </ExperimentalEditorProvider>\n *\n * @return {Object} The rendered ExperimentalEditorProvider component.\n */\nexport const ExperimentalEditorProvider = withRegistryProvider(\n\t( {\n\t\tpost,\n\t\tsettings,\n\t\trecovery,\n\t\tinitialEdits,\n\t\tchildren,\n\t\tBlockEditorProviderComponent = ExperimentalBlockEditorProvider,\n\t\t__unstableTemplate: template,\n\t} ) => {\n\t\tconst { editorSettings, selection, isReady, mode, postTypes } =\n\t\t\tuseSelect( ( select ) => {\n\t\t\t\tconst {\n\t\t\t\t\tgetEditorSettings,\n\t\t\t\t\tgetEditorSelection,\n\t\t\t\t\tgetRenderingMode,\n\t\t\t\t\t__unstableIsEditorReady,\n\t\t\t\t} = select( editorStore );\n\t\t\t\tconst { getPostTypes } = select( coreStore );\n\n\t\t\t\treturn {\n\t\t\t\t\teditorSettings: getEditorSettings(),\n\t\t\t\t\tisReady: __unstableIsEditorReady(),\n\t\t\t\t\tmode: getRenderingMode(),\n\t\t\t\t\tselection: getEditorSelection(),\n\t\t\t\t\tpostTypes: getPostTypes( { per_page: -1 } ),\n\t\t\t\t};\n\t\t\t}, [] );\n\t\tconst shouldRenderTemplate = !! template && mode !== 'post-only';\n\t\tconst rootLevelPost = shouldRenderTemplate ? template : post;\n\t\tconst defaultBlockContext = useMemo( () => {\n\t\t\tconst postContext = {};\n\t\t\t// If it is a template, try to inherit the post type from the slug.\n\t\t\tif ( post.type === 'wp_template' ) {\n\t\t\t\tif ( post.slug === 'page' ) {\n\t\t\t\t\tpostContext.postType = 'page';\n\t\t\t\t} else if ( post.slug === 'single' ) {\n\t\t\t\t\tpostContext.postType = 'post';\n\t\t\t\t} else if ( post.slug.split( '-' )[ 0 ] === 'single' ) {\n\t\t\t\t\t// If the slug is single-{postType}, infer the post type from the slug.\n\t\t\t\t\tconst postTypesSlugs =\n\t\t\t\t\t\tpostTypes?.map( ( entity ) => entity.slug ) || [];\n\t\t\t\t\tconst match = post.slug.match(\n\t\t\t\t\t\t`^single-(${ postTypesSlugs.join( '|' ) })(?:-.+)?$`\n\t\t\t\t\t);\n\t\t\t\t\tif ( match ) {\n\t\t\t\t\t\tpostContext.postType = match[ 1 ];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (\n\t\t\t\t! NON_CONTEXTUAL_POST_TYPES.includes( rootLevelPost.type ) ||\n\t\t\t\tshouldRenderTemplate\n\t\t\t) {\n\t\t\t\tpostContext.postId = post.id;\n\t\t\t\tpostContext.postType = post.type;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t...postContext,\n\t\t\t\ttemplateSlug:\n\t\t\t\t\trootLevelPost.type === 'wp_template'\n\t\t\t\t\t\t? rootLevelPost.slug\n\t\t\t\t\t\t: undefined,\n\t\t\t};\n\t\t}, [\n\t\t\tshouldRenderTemplate,\n\t\t\tpost.id,\n\t\t\tpost.type,\n\t\t\trootLevelPost.type,\n\t\t\trootLevelPost.slug,\n\t\t\tpostTypes,\n\t\t] );\n\t\tconst { id, type } = rootLevelPost;\n\t\tconst blockEditorSettings = useBlockEditorSettings(\n\t\t\teditorSettings,\n\t\t\ttype,\n\t\t\tid,\n\t\t\tmode\n\t\t);\n\t\tconst [ blocks, onInput, onChange ] = useBlockEditorProps(\n\t\t\tpost,\n\t\t\ttemplate,\n\t\t\tmode\n\t\t);\n\n\t\tconst {\n\t\t\tupdatePostLock,\n\t\t\tsetupEditor,\n\t\t\tupdateEditorSettings,\n\t\t\tsetCurrentTemplateId,\n\t\t\tsetEditedPost,\n\t\t\tsetRenderingMode,\n\t\t} = unlock( useDispatch( editorStore ) );\n\t\tconst { createWarningNotice } = useDispatch( noticesStore );\n\n\t\t// Ideally this should be synced on each change and not just something you do once.\n\t\tuseLayoutEffect( () => {\n\t\t\t// Assume that we don't need to initialize in the case of an error recovery.\n\t\t\tif ( recovery ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tupdatePostLock( settings.postLock );\n\t\t\tsetupEditor( post, initialEdits, settings.template );\n\t\t\tif ( settings.autosave ) {\n\t\t\t\tcreateWarningNotice(\n\t\t\t\t\t__(\n\t\t\t\t\t\t'There is an autosave of this post that is more recent than the version below.'\n\t\t\t\t\t),\n\t\t\t\t\t{\n\t\t\t\t\t\tid: 'autosave-exists',\n\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'View the autosave' ),\n\t\t\t\t\t\t\t\turl: settings.autosave.editLink,\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\n\t\t// Synchronizes the active post with the state\n\t\tuseEffect( () => {\n\t\t\tsetEditedPost( post.type, post.id );\n\t\t}, [ post.type, post.id, setEditedPost ] );\n\n\t\t// Synchronize the editor settings as they change.\n\t\tuseEffect( () => {\n\t\t\tupdateEditorSettings( settings );\n\t\t}, [ settings, updateEditorSettings ] );\n\n\t\t// Synchronizes the active template with the state.\n\t\tuseEffect( () => {\n\t\t\tsetCurrentTemplateId( template?.id );\n\t\t}, [ template?.id, setCurrentTemplateId ] );\n\n\t\t// Sets the right rendering mode when loading the editor.\n\t\tuseEffect( () => {\n\t\t\tsetRenderingMode( settings.defaultRenderingMode ?? 'post-only' );\n\t\t}, [ settings.defaultRenderingMode, setRenderingMode ] );\n\n\t\tuseHideBlocksFromInserter( post.type, mode );\n\n\t\t// Register the editor commands.\n\t\tuseCommands();\n\n\t\tif ( ! isReady ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn (\n\t\t\t<EntityProvider kind=\"root\" type=\"site\">\n\t\t\t\t<EntityProvider\n\t\t\t\t\tkind=\"postType\"\n\t\t\t\t\ttype={ post.type }\n\t\t\t\t\tid={ post.id }\n\t\t\t\t>\n\t\t\t\t\t<BlockContextProvider value={ defaultBlockContext }>\n\t\t\t\t\t\t<BlockEditorProviderComponent\n\t\t\t\t\t\t\tvalue={ blocks }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\tonInput={ onInput }\n\t\t\t\t\t\t\tselection={ selection }\n\t\t\t\t\t\t\tsettings={ blockEditorSettings }\n\t\t\t\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t\t{ ! settings.__unstableIsPreviewMode && (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<PatternsMenuItems />\n\t\t\t\t\t\t\t\t\t<TemplatePartMenuItems />\n\t\t\t\t\t\t\t\t\t<ContentOnlySettingsMenu />\n\t\t\t\t\t\t\t\t\t{ mode === 'template-locked' && (\n\t\t\t\t\t\t\t\t\t\t<DisableNonPageContentBlocks />\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ type === 'wp_navigation' && (\n\t\t\t\t\t\t\t\t\t\t<NavigationBlockEditingMode />\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t<EditorKeyboardShortcuts />\n\t\t\t\t\t\t\t\t\t<KeyboardShortcutHelpModal />\n\t\t\t\t\t\t\t\t\t<BlockRemovalWarnings />\n\t\t\t\t\t\t\t\t\t<StartPageOptions />\n\t\t\t\t\t\t\t\t\t<StartTemplateOptions />\n\t\t\t\t\t\t\t\t\t<PatternRenameModal />\n\t\t\t\t\t\t\t\t\t<PatternDuplicateModal />\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</BlockEditorProviderComponent>\n\t\t\t\t\t</BlockContextProvider>\n\t\t\t\t</EntityProvider>\n\t\t\t</EntityProvider>\n\t\t);\n\t}\n);\n\n/**\n * This component establishes a new post editing context, and serves as the entry point for a new post editor (or post with template editor).\n *\n * It supports a large number of post types, including post, page, templates,\n * custom post types, patterns, template parts.\n *\n * All modification and changes are performed to the `@wordpress/core-data` store.\n *\n * @param {Object} props The component props.\n * @param {Object} [props.post] The post object to edit. This is required.\n * @param {Object} [props.__unstableTemplate] The template object wrapper the edited post.\n * This is optional and can only be used when the post type supports templates (like posts and pages).\n * @param {Object} [props.settings] The settings object to use for the editor.\n * This is optional and can be used to override the default settings.\n * @param {Element} [props.children] Children elements for which the BlockEditorProvider context should apply.\n * This is optional.\n *\n * @example\n * ```jsx\n * <EditorProvider\n * post={ post }\n * settings={ settings }\n * __unstableTemplate={ template }\n * >\n * { children }\n * </EditorProvider>\n * ```\n *\n * @return {JSX.Element} The rendered EditorProvider component.\n */\nexport function EditorProvider( props ) {\n\treturn (\n\t\t<ExperimentalEditorProvider\n\t\t\t{ ...props }\n\t\t\tBlockEditorProviderComponent={ BlockEditorProvider }\n\t\t>\n\t\t\t{ props.children }\n\t\t</ExperimentalEditorProvider>\n\t);\n}\n\nexport default EditorProvider;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,eAAe,EAAEC,OAAO,QAAQ,oBAAoB;AACxE,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SACCC,cAAc,EACdC,oBAAoB,EACpBC,KAAK,IAAIC,SAAS,QACZ,sBAAsB;AAC7B,SACCC,mBAAmB,EACnBC,oBAAoB,EACpBC,WAAW,IAAIC,sBAAsB,QAC/B,yBAAyB;AAChC,SAASL,KAAK,IAAIM,YAAY,QAAQ,oBAAoB;AAC1D,SAASF,WAAW,IAAIG,uBAAuB,QAAQ,qBAAqB;AAC5E,SAASC,WAAW,QAAQ,mBAAmB;;AAE/C;AACA;AACA;AACA,OAAOC,oBAAoB,MAAM,0BAA0B;AAC3D,SAAST,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BAAiB,IAAE,CAAC,eACrBN,IAAA,CAACF,qBAAqB,IAAE,CAAC,eACzBE,IAAA,CAACP,uBAAuB,IAAE,CAAC,EACzBmB,IAAI,KAAK,iBAAiB,iBAC3BZ,IAAA,CAACd,2BAA2B,IAAE,CAC9B,EACC+B,IAAI,KAAK,eAAe,iBACzBjB,IAAA,CAACb,0BAA0B,IAAE,CAC7B,eACDa,IAAA,CAACL,uBAAuB,IAAE,CAAC,eAC3BK,IAAA,CAACR,yBAAyB,IAAE,CAAC,eAC7BQ,IAAA,CAACV,oBAAoB,IAAE,CAAC,eACxBU,IAAA,CAACT,gBAAgB,IAAE,CAAC,eACpBS,IAAA,CAACN,oBAAoB,IAAE,CAAC,eACxBM,IAAA,CAACJ,kBAAkB,IAAE,CAAC,eACtBI,IAAA,CAACH,qBAAqB,IAAE,CAAC;UAAA,CACxB,CACF;QAAA,CAC4B;MAAC,CACV;IAAC,CACR;EAAC,CACF,CAAC;AAEnB,CACD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASmF,cAAcA,CAAEC,KAAK,EAAG;EACvC,oBACCjF,IAAA,CAAC2B,0BAA0B;IAAA,GACrBsD,KAAK;IACVjD,4BAA4B,EAAGzD,mBAAqB;IAAAwD,QAAA,EAElDkD,KAAK,CAAClD;EAAQ,CACW,CAAC;AAE/B;AAEA,eAAeiD,cAAc","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["useEffect","useLayoutEffect","useMemo","useDispatch","useSelect","__","EntityProvider","useEntityBlockEditor","store","coreStore","BlockEditorProvider","BlockContextProvider","privateApis","blockEditorPrivateApis","noticesStore","editPatternsPrivateApis","createBlock","withRegistryProvider","editorStore","useBlockEditorSettings","unlock","DisableNonPageContentBlocks","NavigationBlockEditingMode","useHideBlocksFromInserter","useCommands","BlockRemovalWarnings","StartPageOptions","KeyboardShortcutHelpModal","ContentOnlySettingsMenu","StartTemplateOptions","EditorKeyboardShortcuts","PatternRenameModal","PatternDuplicateModal","TemplatePartMenuItems","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","ExperimentalBlockEditorProvider","PatternsMenuItems","noop","NON_CONTEXTUAL_POST_TYPES","useBlockEditorProps","post","template","mode","rootLevelPost","postBlocks","onInput","onChange","type","id","templateBlocks","onInputTemplate","onChangeTemplate","maybeNavigationBlocks","ref","templateLock","blocks","disableRootLevelChanges","ExperimentalEditorProvider","settings","recovery","initialEdits","children","BlockEditorProviderComponent","__unstableTemplate","editorSettings","selection","isReady","postTypes","select","getEditorSettings","getEditorSelection","getRenderingMode","__unstableIsEditorReady","getPostTypes","per_page","shouldRenderTemplate","defaultBlockContext","postContext","slug","postType","split","postTypesSlugs","map","entity","match","join","includes","postId","templateSlug","undefined","blockEditorSettings","updatePostLock","setupEditor","updateEditorSettings","setCurrentTemplateId","setEditedPost","setRenderingMode","createWarningNotice","postLock","autosave","actions","label","url","editLink","_settings$defaultRend","defaultRenderingMode","kind","value","useSubRegistry","__unstableIsPreviewMode","EditorProvider","props"],"sources":["@wordpress/editor/src/components/provider/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useLayoutEffect, useMemo } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tEntityProvider,\n\tuseEntityBlockEditor,\n\tstore as coreStore,\n} from '@wordpress/core-data';\nimport {\n\tBlockEditorProvider,\n\tBlockContextProvider,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { privateApis as editPatternsPrivateApis } from '@wordpress/patterns';\nimport { createBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport withRegistryProvider from './with-registry-provider';\nimport { store as editorStore } from '../../store';\nimport useBlockEditorSettings from './use-block-editor-settings';\nimport { unlock } from '../../lock-unlock';\nimport DisableNonPageContentBlocks from './disable-non-page-content-blocks';\nimport NavigationBlockEditingMode from './navigation-block-editing-mode';\nimport { useHideBlocksFromInserter } from './use-hide-blocks-from-inserter';\nimport useCommands from '../commands';\nimport BlockRemovalWarnings from '../block-removal-warnings';\nimport StartPageOptions from '../start-page-options';\nimport KeyboardShortcutHelpModal from '../keyboard-shortcut-help-modal';\nimport ContentOnlySettingsMenu from '../block-settings-menu/content-only-settings-menu';\nimport StartTemplateOptions from '../start-template-options';\nimport EditorKeyboardShortcuts from '../global-keyboard-shortcuts';\nimport PatternRenameModal from '../pattern-rename-modal';\nimport PatternDuplicateModal from '../pattern-duplicate-modal';\nimport TemplatePartMenuItems from '../template-part-menu-items';\n\nconst { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis );\nconst { PatternsMenuItems } = unlock( editPatternsPrivateApis );\n\nconst noop = () => {};\n\n/**\n * These are global entities that are only there to split blocks into logical units\n * They don't provide a \"context\" for the current post/page being rendered.\n * So we should not use their ids as post context. This is important to allow post blocks\n * (post content, post title) to be used within them without issues.\n */\nconst NON_CONTEXTUAL_POST_TYPES = [\n\t'wp_block',\n\t'wp_navigation',\n\t'wp_template_part',\n];\n\n/**\n * Depending on the post, template and template mode,\n * returns the appropriate blocks and change handlers for the block editor provider.\n *\n * @param {Array} post Block list.\n * @param {boolean} template Whether the page content has focus (and the surrounding template is inert). If `true` return page content blocks. Default `false`.\n * @param {string} mode Rendering mode.\n *\n * @example\n * ```jsx\n * const [ blocks, onInput, onChange ] = useBlockEditorProps( post, template, mode );\n * ```\n *\n * @return {Array} Block editor props.\n */\nfunction useBlockEditorProps( post, template, mode ) {\n\tconst rootLevelPost =\n\t\tmode === 'post-only' || ! template ? 'post' : 'template';\n\tconst [ postBlocks, onInput, onChange ] = useEntityBlockEditor(\n\t\t'postType',\n\t\tpost.type,\n\t\t{ id: post.id }\n\t);\n\tconst [ templateBlocks, onInputTemplate, onChangeTemplate ] =\n\t\tuseEntityBlockEditor( 'postType', template?.type, {\n\t\t\tid: template?.id,\n\t\t} );\n\tconst maybeNavigationBlocks = useMemo( () => {\n\t\tif ( post.type === 'wp_navigation' ) {\n\t\t\treturn [\n\t\t\t\tcreateBlock( 'core/navigation', {\n\t\t\t\t\tref: post.id,\n\t\t\t\t\t// As the parent editor is locked with `templateLock`, the template locking\n\t\t\t\t\t// must be explicitly \"unset\" on the block itself to allow the user to modify\n\t\t\t\t\t// the block's content.\n\t\t\t\t\ttemplateLock: false,\n\t\t\t\t} ),\n\t\t\t];\n\t\t}\n\t}, [ post.type, post.id ] );\n\n\t// It is important that we don't create a new instance of blocks on every change\n\t// We should only create a new instance if the blocks them selves change, not a dependency of them.\n\tconst blocks = useMemo( () => {\n\t\tif ( maybeNavigationBlocks ) {\n\t\t\treturn maybeNavigationBlocks;\n\t\t}\n\n\t\tif ( rootLevelPost === 'template' ) {\n\t\t\treturn templateBlocks;\n\t\t}\n\n\t\treturn postBlocks;\n\t}, [ maybeNavigationBlocks, rootLevelPost, templateBlocks, postBlocks ] );\n\n\t// Handle fallback to postBlocks outside of the above useMemo, to ensure\n\t// that constructed block templates that call `createBlock` are not generated\n\t// too frequently. This ensures that clientIds are stable.\n\tconst disableRootLevelChanges =\n\t\t( !! template && mode === 'template-locked' ) ||\n\t\tpost.type === 'wp_navigation';\n\tif ( disableRootLevelChanges ) {\n\t\treturn [ blocks, noop, noop ];\n\t}\n\n\treturn [\n\t\tblocks,\n\t\trootLevelPost === 'post' ? onInput : onInputTemplate,\n\t\trootLevelPost === 'post' ? onChange : onChangeTemplate,\n\t];\n}\n\n/**\n * This component provides the editor context and manages the state of the block editor.\n *\n * @param {Object} props The component props.\n * @param {Object} props.post The post object.\n * @param {Object} props.settings The editor settings.\n * @param {boolean} props.recovery Indicates if the editor is in recovery mode.\n * @param {Array} props.initialEdits The initial edits for the editor.\n * @param {Object} props.children The child components.\n * @param {Object} [props.BlockEditorProviderComponent] The block editor provider component to use. Defaults to ExperimentalBlockEditorProvider.\n * @param {Object} [props.__unstableTemplate] The template object.\n *\n * @example\n * ```jsx\n * <ExperimentalEditorProvider\n * post={ post }\n * settings={ settings }\n * recovery={ recovery }\n * initialEdits={ initialEdits }\n * __unstableTemplate={ template }\n * >\n * { children }\n * </ExperimentalEditorProvider>\n *\n * @return {Object} The rendered ExperimentalEditorProvider component.\n */\nexport const ExperimentalEditorProvider = withRegistryProvider(\n\t( {\n\t\tpost,\n\t\tsettings,\n\t\trecovery,\n\t\tinitialEdits,\n\t\tchildren,\n\t\tBlockEditorProviderComponent = ExperimentalBlockEditorProvider,\n\t\t__unstableTemplate: template,\n\t} ) => {\n\t\tconst { editorSettings, selection, isReady, mode, postTypes } =\n\t\t\tuseSelect( ( select ) => {\n\t\t\t\tconst {\n\t\t\t\t\tgetEditorSettings,\n\t\t\t\t\tgetEditorSelection,\n\t\t\t\t\tgetRenderingMode,\n\t\t\t\t\t__unstableIsEditorReady,\n\t\t\t\t} = select( editorStore );\n\t\t\t\tconst { getPostTypes } = select( coreStore );\n\n\t\t\t\treturn {\n\t\t\t\t\teditorSettings: getEditorSettings(),\n\t\t\t\t\tisReady: __unstableIsEditorReady(),\n\t\t\t\t\tmode: getRenderingMode(),\n\t\t\t\t\tselection: getEditorSelection(),\n\t\t\t\t\tpostTypes: getPostTypes( { per_page: -1 } ),\n\t\t\t\t};\n\t\t\t}, [] );\n\t\tconst shouldRenderTemplate = !! template && mode !== 'post-only';\n\t\tconst rootLevelPost = shouldRenderTemplate ? template : post;\n\t\tconst defaultBlockContext = useMemo( () => {\n\t\t\tconst postContext = {};\n\t\t\t// If it is a template, try to inherit the post type from the slug.\n\t\t\tif ( post.type === 'wp_template' ) {\n\t\t\t\tif ( post.slug === 'page' ) {\n\t\t\t\t\tpostContext.postType = 'page';\n\t\t\t\t} else if ( post.slug === 'single' ) {\n\t\t\t\t\tpostContext.postType = 'post';\n\t\t\t\t} else if ( post.slug.split( '-' )[ 0 ] === 'single' ) {\n\t\t\t\t\t// If the slug is single-{postType}, infer the post type from the slug.\n\t\t\t\t\tconst postTypesSlugs =\n\t\t\t\t\t\tpostTypes?.map( ( entity ) => entity.slug ) || [];\n\t\t\t\t\tconst match = post.slug.match(\n\t\t\t\t\t\t`^single-(${ postTypesSlugs.join( '|' ) })(?:-.+)?$`\n\t\t\t\t\t);\n\t\t\t\t\tif ( match ) {\n\t\t\t\t\t\tpostContext.postType = match[ 1 ];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (\n\t\t\t\t! NON_CONTEXTUAL_POST_TYPES.includes( rootLevelPost.type ) ||\n\t\t\t\tshouldRenderTemplate\n\t\t\t) {\n\t\t\t\tpostContext.postId = post.id;\n\t\t\t\tpostContext.postType = post.type;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t...postContext,\n\t\t\t\ttemplateSlug:\n\t\t\t\t\trootLevelPost.type === 'wp_template'\n\t\t\t\t\t\t? rootLevelPost.slug\n\t\t\t\t\t\t: undefined,\n\t\t\t};\n\t\t}, [\n\t\t\tshouldRenderTemplate,\n\t\t\tpost.id,\n\t\t\tpost.type,\n\t\t\tpost.slug,\n\t\t\trootLevelPost.type,\n\t\t\trootLevelPost.slug,\n\t\t\tpostTypes,\n\t\t] );\n\t\tconst { id, type } = rootLevelPost;\n\t\tconst blockEditorSettings = useBlockEditorSettings(\n\t\t\teditorSettings,\n\t\t\ttype,\n\t\t\tid,\n\t\t\tmode\n\t\t);\n\t\tconst [ blocks, onInput, onChange ] = useBlockEditorProps(\n\t\t\tpost,\n\t\t\ttemplate,\n\t\t\tmode\n\t\t);\n\n\t\tconst {\n\t\t\tupdatePostLock,\n\t\t\tsetupEditor,\n\t\t\tupdateEditorSettings,\n\t\t\tsetCurrentTemplateId,\n\t\t\tsetEditedPost,\n\t\t\tsetRenderingMode,\n\t\t} = unlock( useDispatch( editorStore ) );\n\t\tconst { createWarningNotice } = useDispatch( noticesStore );\n\n\t\t// Ideally this should be synced on each change and not just something you do once.\n\t\tuseLayoutEffect( () => {\n\t\t\t// Assume that we don't need to initialize in the case of an error recovery.\n\t\t\tif ( recovery ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tupdatePostLock( settings.postLock );\n\t\t\tsetupEditor( post, initialEdits, settings.template );\n\t\t\tif ( settings.autosave ) {\n\t\t\t\tcreateWarningNotice(\n\t\t\t\t\t__(\n\t\t\t\t\t\t'There is an autosave of this post that is more recent than the version below.'\n\t\t\t\t\t),\n\t\t\t\t\t{\n\t\t\t\t\t\tid: 'autosave-exists',\n\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'View the autosave' ),\n\t\t\t\t\t\t\t\turl: settings.autosave.editLink,\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\n\t\t// Synchronizes the active post with the state\n\t\tuseEffect( () => {\n\t\t\tsetEditedPost( post.type, post.id );\n\t\t}, [ post.type, post.id, setEditedPost ] );\n\n\t\t// Synchronize the editor settings as they change.\n\t\tuseEffect( () => {\n\t\t\tupdateEditorSettings( settings );\n\t\t}, [ settings, updateEditorSettings ] );\n\n\t\t// Synchronizes the active template with the state.\n\t\tuseEffect( () => {\n\t\t\tsetCurrentTemplateId( template?.id );\n\t\t}, [ template?.id, setCurrentTemplateId ] );\n\n\t\t// Sets the right rendering mode when loading the editor.\n\t\tuseEffect( () => {\n\t\t\tsetRenderingMode( settings.defaultRenderingMode ?? 'post-only' );\n\t\t}, [ settings.defaultRenderingMode, setRenderingMode ] );\n\n\t\tuseHideBlocksFromInserter( post.type, mode );\n\n\t\t// Register the editor commands.\n\t\tuseCommands();\n\n\t\tif ( ! isReady ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn (\n\t\t\t<EntityProvider kind=\"root\" type=\"site\">\n\t\t\t\t<EntityProvider\n\t\t\t\t\tkind=\"postType\"\n\t\t\t\t\ttype={ post.type }\n\t\t\t\t\tid={ post.id }\n\t\t\t\t>\n\t\t\t\t\t<BlockContextProvider value={ defaultBlockContext }>\n\t\t\t\t\t\t<BlockEditorProviderComponent\n\t\t\t\t\t\t\tvalue={ blocks }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\tonInput={ onInput }\n\t\t\t\t\t\t\tselection={ selection }\n\t\t\t\t\t\t\tsettings={ blockEditorSettings }\n\t\t\t\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t\t{ ! settings.__unstableIsPreviewMode && (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<PatternsMenuItems />\n\t\t\t\t\t\t\t\t\t<TemplatePartMenuItems />\n\t\t\t\t\t\t\t\t\t<ContentOnlySettingsMenu />\n\t\t\t\t\t\t\t\t\t{ mode === 'template-locked' && (\n\t\t\t\t\t\t\t\t\t\t<DisableNonPageContentBlocks />\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ type === 'wp_navigation' && (\n\t\t\t\t\t\t\t\t\t\t<NavigationBlockEditingMode />\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t<EditorKeyboardShortcuts />\n\t\t\t\t\t\t\t\t\t<KeyboardShortcutHelpModal />\n\t\t\t\t\t\t\t\t\t<BlockRemovalWarnings />\n\t\t\t\t\t\t\t\t\t<StartPageOptions />\n\t\t\t\t\t\t\t\t\t<StartTemplateOptions />\n\t\t\t\t\t\t\t\t\t<PatternRenameModal />\n\t\t\t\t\t\t\t\t\t<PatternDuplicateModal />\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</BlockEditorProviderComponent>\n\t\t\t\t\t</BlockContextProvider>\n\t\t\t\t</EntityProvider>\n\t\t\t</EntityProvider>\n\t\t);\n\t}\n);\n\n/**\n * This component establishes a new post editing context, and serves as the entry point for a new post editor (or post with template editor).\n *\n * It supports a large number of post types, including post, page, templates,\n * custom post types, patterns, template parts.\n *\n * All modification and changes are performed to the `@wordpress/core-data` store.\n *\n * @param {Object} props The component props.\n * @param {Object} [props.post] The post object to edit. This is required.\n * @param {Object} [props.__unstableTemplate] The template object wrapper the edited post.\n * This is optional and can only be used when the post type supports templates (like posts and pages).\n * @param {Object} [props.settings] The settings object to use for the editor.\n * This is optional and can be used to override the default settings.\n * @param {Element} [props.children] Children elements for which the BlockEditorProvider context should apply.\n * This is optional.\n *\n * @example\n * ```jsx\n * <EditorProvider\n * post={ post }\n * settings={ settings }\n * __unstableTemplate={ template }\n * >\n * { children }\n * </EditorProvider>\n * ```\n *\n * @return {JSX.Element} The rendered EditorProvider component.\n */\nexport function EditorProvider( props ) {\n\treturn (\n\t\t<ExperimentalEditorProvider\n\t\t\t{ ...props }\n\t\t\tBlockEditorProviderComponent={ BlockEditorProvider }\n\t\t>\n\t\t\t{ props.children }\n\t\t</ExperimentalEditorProvider>\n\t);\n}\n\nexport default EditorProvider;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,eAAe,EAAEC,OAAO,QAAQ,oBAAoB;AACxE,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SACCC,cAAc,EACdC,oBAAoB,EACpBC,KAAK,IAAIC,SAAS,QACZ,sBAAsB;AAC7B,SACCC,mBAAmB,EACnBC,oBAAoB,EACpBC,WAAW,IAAIC,sBAAsB,QAC/B,yBAAyB;AAChC,SAASL,KAAK,IAAIM,YAAY,QAAQ,oBAAoB;AAC1D,SAASF,WAAW,IAAIG,uBAAuB,QAAQ,qBAAqB;AAC5E,SAASC,WAAW,QAAQ,mBAAmB;;AAE/C;AACA;AACA;AACA,OAAOC,oBAAoB,MAAM,0BAA0B;AAC3D,SAAST,KAAK,IAAIU,WAAW,QAAQ,aAAa;AAClD,OAAOC,sBAAsB,MAAM,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AAE,CAAC,eACzBE,IAAA,CAACP,uBAAuB,IAAE,CAAC,EACzBmB,IAAI,KAAK,iBAAiB,iBAC3BZ,IAAA,CAACd,2BAA2B,IAAE,CAC9B,EACC+B,IAAI,KAAK,eAAe,iBACzBjB,IAAA,CAACb,0BAA0B,IAAE,CAC7B,eACDa,IAAA,CAACL,uBAAuB,IAAE,CAAC,eAC3BK,IAAA,CAACR,yBAAyB,IAAE,CAAC,eAC7BQ,IAAA,CAACV,oBAAoB,IAAE,CAAC,eACxBU,IAAA,CAACT,gBAAgB,IAAE,CAAC,eACpBS,IAAA,CAACN,oBAAoB,IAAE,CAAC,eACxBM,IAAA,CAACJ,kBAAkB,IAAE,CAAC,eACtBI,IAAA,CAACH,qBAAqB,IAAE,CAAC;UAAA,CACxB,CACF;QAAA,CAC4B;MAAC,CACV;IAAC,CACR;EAAC,CACF,CAAC;AAEnB,CACD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASmF,cAAcA,CAAEC,KAAK,EAAG;EACvC,oBACCjF,IAAA,CAAC2B,0BAA0B;IAAA,GACrBsD,KAAK;IACVjD,4BAA4B,EAAGzD,mBAAqB;IAAAwD,QAAA,EAElDkD,KAAK,CAAClD;EAAQ,CACW,CAAC;AAE/B;AAEA,eAAeiD,cAAc","ignoreList":[]}
|
|
@@ -51,9 +51,7 @@ import { store as coreStore } from '@wordpress/core-data';
|
|
|
51
51
|
*/
|
|
52
52
|
import EditorProvider from './index.js';
|
|
53
53
|
import { insertContentWithTitle } from '../post-title';
|
|
54
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
55
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
56
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
54
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
57
55
|
class NativeEditorProvider extends Component {
|
|
58
56
|
constructor() {
|
|
59
57
|
super(...arguments);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BackHandler","memize","SafeAreaProvider","RNReactNativeGutenbergBridge","requestBlockTypeImpressions","setBlockTypeImpressions","subscribeParentGetHtml","subscribeParentToggleHTMLMode","subscribeUpdateHtml","subscribeSetTitle","subscribeMediaAppend","subscribeReplaceBlock","subscribeUpdateEditorSettings","subscribeUpdateCapabilities","subscribeShowNotice","subscribeShowEditorHelp","subscribeToContentUpdate","Component","count","wordCount","parse","serialize","getUnregisteredTypeHandlerName","getBlockType","createBlock","pasteHandler","withDispatch","withSelect","compose","applyFilters","store","blockEditorStore","getGlobalStyles","getColorsAndGradients","NEW_BLOCK_TYPES","__","postTypeEntities","name","baseURL","map","postTypeEntity","kind","transientEdits","blocks","selection","mergedEdits","meta","rawAttributes","EditorHelpTopics","editorStore","noticesStore","coreStore","EditorProvider","insertContentWithTitle","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","NativeEditorProvider","constructor","arguments","post","props","addEntities","receiveEntityRecords","type","onHardwareBackPress","bind","onContentUpdate","getEditorSettings","settings","capabilities","maxSize","state","isHelpVisible","componentDidMount","createErrorNotice","locale","hostAppNamespace","updateEditorSettings","updateBlockEditorSettings","getThemeColors","subscriptionParentGetHtml","serializeToNativeAction","subscriptionParentToggleHTMLMode","toggleMode","subscriptionParentSetTitle","payload","editTitle","title","subscriptionParentUpdateHtml","updateHtmlAction","html","subscriptionParentReplaceBlock","replaceBlockAction","clientId","subscriptionParentMediaAppend","blockName","mediaType","blockType","newBlock","id","mediaId","mediaUrl","indexAfterSelected","selectedBlockIndex","insertionIndex","blockCount","insertBlock","subscriptionParentUpdateEditorSettings","editorSettings","subscriptionParentUpdateCapabilities","updateCapabilitiesAction","subscriptionParentShowNotice","createSuccessNotice","message","subscriptionParentShowEditorHelp","setState","hardwareBackPressListener","addEventListener","subscriptionOnContentUpdate","data","storedImpressions","impressions","storedImpressionKeys","Object","keys","storedImpressionsCurrent","every","newKey","includes","componentWillUnmount","remove","rawStyles","rawFeatures","defaultEditorColors","defaultEditorGradients","componentDidUpdate","prevProps","isReady","isUnsupportedBlock","unsupportedBlockNames","filter","block","attributes","originalName","editorDidMount","clearSelectedBlock","content","rawContent","onClearPostTitleSelection","onInsertBlockAfter","onInsertBlocks","plainText","mode","hasChanges","raw","contentInfo","characterCount","paragraphCount","provideToNative_Html","parsed","resetEditorBlocksWithoutUndoLevel","blockClientId","replaceBlock","switchMode","render","children","isVisible","onClose","close","showSupport","supportSection","ComposedNativeProvider","select","_settings$colors","_settings$gradients","__unstableIsEditorReady","isEditorReady","getEditorBlocks","getEditedPostAttribute","getEditedPostContent","getEditorMode","getBlockIndex","getSelectedBlockClientId","getGlobalBlockCount","colors","gradients","selectedBlockClientId","dispatch","editPost","resetEditorBlocks","switchEditorMode","togglePostTitleSelection","updateSettings","insertBlocks","__unstableShouldCreateUndoLevel","undefined","ExperimentalEditorProvider"],"sources":["@wordpress/editor/src/components/provider/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { BackHandler } from 'react-native';\nimport memize from 'memize';\nimport { SafeAreaProvider } from 'react-native-safe-area-context';\n\n/**\n * WordPress dependencies\n */\nimport RNReactNativeGutenbergBridge, {\n\trequestBlockTypeImpressions,\n\tsetBlockTypeImpressions,\n\tsubscribeParentGetHtml,\n\tsubscribeParentToggleHTMLMode,\n\tsubscribeUpdateHtml,\n\tsubscribeSetTitle,\n\tsubscribeMediaAppend,\n\tsubscribeReplaceBlock,\n\tsubscribeUpdateEditorSettings,\n\tsubscribeUpdateCapabilities,\n\tsubscribeShowNotice,\n\tsubscribeShowEditorHelp,\n\tsubscribeToContentUpdate,\n} from '@wordpress/react-native-bridge';\nimport { Component } from '@wordpress/element';\nimport { count as wordCount } from '@wordpress/wordcount';\nimport {\n\tparse,\n\tserialize,\n\tgetUnregisteredTypeHandlerName,\n\tgetBlockType,\n\tcreateBlock,\n\tpasteHandler,\n} from '@wordpress/blocks';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\nimport { applyFilters } from '@wordpress/hooks';\nimport {\n\tstore as blockEditorStore,\n\tgetGlobalStyles,\n\tgetColorsAndGradients,\n} from '@wordpress/block-editor';\nimport { NEW_BLOCK_TYPES } from '@wordpress/block-library';\nimport { __ } from '@wordpress/i18n';\n\nconst postTypeEntities = [\n\t{ name: 'post', baseURL: '/wp/v2/posts' },\n\t{ name: 'page', baseURL: '/wp/v2/pages' },\n\t{ name: 'attachment', baseURL: '/wp/v2/media' },\n\t{ name: 'wp_block', baseURL: '/wp/v2/blocks' },\n].map( ( postTypeEntity ) => ( {\n\tkind: 'postType',\n\t...postTypeEntity,\n\ttransientEdits: {\n\t\tblocks: true,\n\t\tselection: true,\n\t},\n\tmergedEdits: {\n\t\tmeta: true,\n\t},\n\trawAttributes: [ 'title', 'excerpt', 'content' ],\n} ) );\nimport { EditorHelpTopics, store as editorStore } from '@wordpress/editor';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport EditorProvider from './index.js';\nimport { insertContentWithTitle } from '../post-title';\n\nclass NativeEditorProvider extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\t// Keep a local reference to `post` to detect changes.\n\t\tthis.post = this.props.post;\n\t\tthis.props.addEntities( postTypeEntities );\n\t\tthis.props.receiveEntityRecords(\n\t\t\t'postType',\n\t\t\tthis.post.type,\n\t\t\tthis.post\n\t\t);\n\n\t\tthis.onHardwareBackPress = this.onHardwareBackPress.bind( this );\n\t\tthis.onContentUpdate = this.onContentUpdate.bind( this );\n\n\t\tthis.getEditorSettings = memize(\n\t\t\t( settings, capabilities ) => ( {\n\t\t\t\t...settings,\n\t\t\t\tcapabilities,\n\t\t\t} ),\n\t\t\t{\n\t\t\t\tmaxSize: 1,\n\t\t\t}\n\t\t);\n\t\tthis.state = {\n\t\t\tisHelpVisible: false,\n\t\t};\n\t}\n\n\tcomponentDidMount() {\n\t\tconst {\n\t\t\tcapabilities,\n\t\t\tcreateErrorNotice,\n\t\t\tlocale,\n\t\t\thostAppNamespace,\n\t\t\tupdateEditorSettings,\n\t\t\tupdateBlockEditorSettings,\n\t\t} = this.props;\n\n\t\tupdateEditorSettings( {\n\t\t\tcapabilities,\n\t\t\t...this.getThemeColors( this.props ),\n\t\t\tlocale,\n\t\t\thostAppNamespace,\n\t\t} );\n\n\t\tthis.subscriptionParentGetHtml = subscribeParentGetHtml( () => {\n\t\t\tthis.serializeToNativeAction();\n\t\t} );\n\n\t\tthis.subscriptionParentToggleHTMLMode = subscribeParentToggleHTMLMode(\n\t\t\t() => {\n\t\t\t\tthis.toggleMode();\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentSetTitle = subscribeSetTitle( ( payload ) => {\n\t\t\tthis.props.editTitle( payload.title );\n\t\t} );\n\n\t\tthis.subscriptionParentUpdateHtml = subscribeUpdateHtml(\n\t\t\t( payload ) => {\n\t\t\t\tthis.updateHtmlAction( payload.html );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentReplaceBlock = subscribeReplaceBlock(\n\t\t\t( payload ) => {\n\t\t\t\tthis.replaceBlockAction( payload.html, payload.clientId );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentMediaAppend = subscribeMediaAppend(\n\t\t\t( payload ) => {\n\t\t\t\tconst blockName = 'core/' + payload.mediaType;\n\t\t\t\tconst blockType = getBlockType( blockName );\n\n\t\t\t\tif ( blockType && blockType?.name ) {\n\t\t\t\t\tconst newBlock = createBlock( blockType.name, {\n\t\t\t\t\t\tid: payload.mediaId,\n\t\t\t\t\t\t[ payload.mediaType === 'image' ? 'url' : 'src' ]:\n\t\t\t\t\t\t\tpayload.mediaUrl,\n\t\t\t\t\t} );\n\n\t\t\t\t\tconst indexAfterSelected =\n\t\t\t\t\t\tthis.props.selectedBlockIndex + 1;\n\t\t\t\t\tconst insertionIndex =\n\t\t\t\t\t\tindexAfterSelected || this.props.blockCount;\n\n\t\t\t\t\tthis.props.insertBlock( newBlock, insertionIndex );\n\t\t\t\t} else {\n\t\t\t\t\tcreateErrorNotice(\n\t\t\t\t\t\t__( 'File type not supported as a media file.' )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentUpdateEditorSettings =\n\t\t\tsubscribeUpdateEditorSettings( ( { ...editorSettings } ) => {\n\t\t\t\tupdateEditorSettings( this.getThemeColors( editorSettings ) );\n\t\t\t} );\n\n\t\tthis.subscriptionParentUpdateCapabilities = subscribeUpdateCapabilities(\n\t\t\t( payload ) => {\n\t\t\t\tthis.updateCapabilitiesAction( payload );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentShowNotice = subscribeShowNotice(\n\t\t\t( payload ) => {\n\t\t\t\tthis.props.createSuccessNotice( payload.message );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentShowEditorHelp = subscribeShowEditorHelp( () => {\n\t\t\tthis.setState( { isHelpVisible: true } );\n\t\t} );\n\n\t\tthis.hardwareBackPressListener = BackHandler.addEventListener(\n\t\t\t'hardwareBackPress',\n\t\t\tthis.onHardwareBackPress\n\t\t);\n\n\t\tthis.subscriptionOnContentUpdate = subscribeToContentUpdate(\n\t\t\t( data ) => {\n\t\t\t\tthis.onContentUpdate( data );\n\t\t\t}\n\t\t);\n\n\t\t// Request current block impressions from native app.\n\t\trequestBlockTypeImpressions( ( storedImpressions ) => {\n\t\t\tconst impressions = { ...NEW_BLOCK_TYPES, ...storedImpressions };\n\n\t\t\t// Persist impressions to JavaScript store.\n\t\t\tupdateBlockEditorSettings( { impressions } );\n\n\t\t\t// Persist impressions to native store if they do not include latest\n\t\t\t// `NEW_BLOCK_TYPES` configuration.\n\t\t\tconst storedImpressionKeys = Object.keys( storedImpressions );\n\t\t\tconst storedImpressionsCurrent = Object.keys(\n\t\t\t\tNEW_BLOCK_TYPES\n\t\t\t).every( ( newKey ) => storedImpressionKeys.includes( newKey ) );\n\t\t\tif ( ! storedImpressionsCurrent ) {\n\t\t\t\tsetBlockTypeImpressions( impressions );\n\t\t\t}\n\t\t} );\n\t}\n\n\tcomponentWillUnmount() {\n\t\tif ( this.subscriptionParentGetHtml ) {\n\t\t\tthis.subscriptionParentGetHtml.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentToggleHTMLMode ) {\n\t\t\tthis.subscriptionParentToggleHTMLMode.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentSetTitle ) {\n\t\t\tthis.subscriptionParentSetTitle.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentUpdateHtml ) {\n\t\t\tthis.subscriptionParentUpdateHtml.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentReplaceBlock ) {\n\t\t\tthis.subscriptionParentReplaceBlock.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentMediaAppend ) {\n\t\t\tthis.subscriptionParentMediaAppend.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentUpdateEditorSettings ) {\n\t\t\tthis.subscriptionParentUpdateEditorSettings.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentUpdateCapabilities ) {\n\t\t\tthis.subscriptionParentUpdateCapabilities.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentShowNotice ) {\n\t\t\tthis.subscriptionParentShowNotice.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentShowEditorHelp ) {\n\t\t\tthis.subscriptionParentShowEditorHelp.remove();\n\t\t}\n\n\t\tif ( this.hardwareBackPressListener ) {\n\t\t\tthis.hardwareBackPressListener.remove();\n\t\t}\n\n\t\tif ( this.subscriptionOnContentUpdate ) {\n\t\t\tthis.subscriptionOnContentUpdate.remove();\n\t\t}\n\t}\n\n\tgetThemeColors( { rawStyles, rawFeatures } ) {\n\t\tconst { defaultEditorColors, defaultEditorGradients } = this.props;\n\n\t\tif ( rawStyles && rawFeatures ) {\n\t\t\treturn getGlobalStyles( rawStyles, rawFeatures );\n\t\t}\n\n\t\treturn getColorsAndGradients(\n\t\t\tdefaultEditorColors,\n\t\t\tdefaultEditorGradients,\n\t\t\trawFeatures\n\t\t);\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tif ( ! prevProps.isReady && this.props.isReady ) {\n\t\t\tconst blocks = this.props.blocks;\n\t\t\tconst isUnsupportedBlock = ( { name } ) =>\n\t\t\t\tname === getUnregisteredTypeHandlerName();\n\t\t\tconst unsupportedBlockNames = blocks\n\t\t\t\t.filter( isUnsupportedBlock )\n\t\t\t\t.map( ( block ) => block.attributes.originalName );\n\t\t\tRNReactNativeGutenbergBridge.editorDidMount(\n\t\t\t\tunsupportedBlockNames\n\t\t\t);\n\t\t}\n\t}\n\n\tonHardwareBackPress() {\n\t\tconst { clearSelectedBlock, selectedBlockIndex } = this.props;\n\n\t\tif ( selectedBlockIndex !== -1 ) {\n\t\t\tclearSelectedBlock();\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tonContentUpdate( { content: rawContent } ) {\n\t\tconst {\n\t\t\teditTitle,\n\t\t\tonClearPostTitleSelection,\n\t\t\tonInsertBlockAfter: onInsertBlocks,\n\t\t\ttitle,\n\t\t} = this.props;\n\t\tconst content = pasteHandler( {\n\t\t\tplainText: rawContent,\n\t\t} );\n\n\t\tinsertContentWithTitle( title, content, editTitle, onInsertBlocks );\n\t\tonClearPostTitleSelection();\n\t}\n\n\tserializeToNativeAction() {\n\t\tconst title = this.props.title;\n\t\tlet html;\n\n\t\tif ( this.props.mode === 'text' ) {\n\t\t\t// The HTMLTextInput component does not update the store when user is doing changes\n\t\t\t// Let's request the HTML from the component's state directly.\n\t\t\thtml = applyFilters( 'native.persist-html' );\n\t\t} else {\n\t\t\thtml = serialize( this.props.blocks );\n\t\t}\n\n\t\tconst hasChanges =\n\t\t\ttitle !== this.post.title.raw || html !== this.post.content.raw;\n\n\t\t// Variable to store the content structure metrics.\n\t\tconst contentInfo = {};\n\t\tcontentInfo.characterCount = wordCount(\n\t\t\thtml,\n\t\t\t'characters_including_spaces'\n\t\t);\n\t\tcontentInfo.wordCount = wordCount( html, 'words' );\n\t\tcontentInfo.paragraphCount = this.props.paragraphCount;\n\t\tcontentInfo.blockCount = this.props.blockCount;\n\t\tRNReactNativeGutenbergBridge.provideToNative_Html(\n\t\t\thtml,\n\t\t\ttitle,\n\t\t\thasChanges,\n\t\t\tcontentInfo\n\t\t);\n\n\t\tif ( hasChanges ) {\n\t\t\tthis.post.title.raw = title;\n\t\t\tthis.post.content.raw = html;\n\t\t}\n\t}\n\n\tupdateHtmlAction( html ) {\n\t\tconst parsed = parse( html );\n\t\tthis.props.resetEditorBlocksWithoutUndoLevel( parsed );\n\t}\n\n\treplaceBlockAction( html, blockClientId ) {\n\t\tconst parsed = parse( html );\n\t\tthis.props.replaceBlock( blockClientId, parsed );\n\t}\n\n\ttoggleMode() {\n\t\tconst { mode, switchMode } = this.props;\n\t\t// Refresh html content first.\n\t\tthis.serializeToNativeAction();\n\t\tswitchMode( mode === 'visual' ? 'text' : 'visual' );\n\t}\n\n\tupdateCapabilitiesAction( capabilities ) {\n\t\tthis.props.updateEditorSettings( { capabilities } );\n\t}\n\n\trender() {\n\t\tconst { children, post, capabilities, settings, ...props } = this.props;\n\t\tconst editorSettings = this.getEditorSettings( settings, capabilities );\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<EditorProvider\n\t\t\t\t\tpost={ this.post }\n\t\t\t\t\tsettings={ editorSettings }\n\t\t\t\t\t{ ...props }\n\t\t\t\t>\n\t\t\t\t\t<SafeAreaProvider>{ children }</SafeAreaProvider>\n\t\t\t\t</EditorProvider>\n\t\t\t\t<EditorHelpTopics\n\t\t\t\t\tisVisible={ this.state.isHelpVisible }\n\t\t\t\t\tonClose={ () => this.setState( { isHelpVisible: false } ) }\n\t\t\t\t\tclose={ () => this.setState( { isHelpVisible: false } ) }\n\t\t\t\t\tshowSupport={ capabilities?.supportSection === true }\n\t\t\t\t/>\n\t\t\t</>\n\t\t);\n\t}\n}\n\nconst ComposedNativeProvider = compose( [\n\twithSelect( ( select ) => {\n\t\tconst {\n\t\t\t__unstableIsEditorReady: isEditorReady,\n\t\t\tgetEditorBlocks,\n\t\t\tgetEditedPostAttribute,\n\t\t\tgetEditedPostContent,\n\t\t\tgetEditorSettings,\n\t\t\tgetEditorMode,\n\t\t} = select( editorStore );\n\n\t\tconst { getBlockIndex, getSelectedBlockClientId, getGlobalBlockCount } =\n\t\t\tselect( blockEditorStore );\n\n\t\tconst settings = getEditorSettings();\n\t\tconst defaultEditorColors = settings?.colors ?? [];\n\t\tconst defaultEditorGradients = settings?.gradients ?? [];\n\n\t\tconst selectedBlockClientId = getSelectedBlockClientId();\n\t\treturn {\n\t\t\tmode: getEditorMode(),\n\t\t\tisReady: isEditorReady(),\n\t\t\tblocks: getEditorBlocks(),\n\t\t\ttitle: getEditedPostAttribute( 'title' ),\n\t\t\tgetEditedPostContent,\n\t\t\tdefaultEditorColors,\n\t\t\tdefaultEditorGradients,\n\t\t\tselectedBlockIndex: getBlockIndex( selectedBlockClientId ),\n\t\t\tblockCount: getGlobalBlockCount(),\n\t\t\tparagraphCount: getGlobalBlockCount( 'core/paragraph' ),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst {\n\t\t\teditPost,\n\t\t\tresetEditorBlocks,\n\t\t\tupdateEditorSettings,\n\t\t\tswitchEditorMode,\n\t\t\ttogglePostTitleSelection,\n\t\t} = dispatch( editorStore );\n\t\tconst {\n\t\t\tclearSelectedBlock,\n\t\t\tupdateSettings,\n\t\t\tinsertBlock,\n\t\t\tinsertBlocks,\n\t\t\treplaceBlock,\n\t\t} = dispatch( blockEditorStore );\n\t\tconst { addEntities, receiveEntityRecords } = dispatch( coreStore );\n\t\tconst { createSuccessNotice, createErrorNotice } =\n\t\t\tdispatch( noticesStore );\n\n\t\treturn {\n\t\t\tupdateBlockEditorSettings: updateSettings,\n\t\t\tupdateEditorSettings,\n\t\t\taddEntities,\n\t\t\tinsertBlock,\n\t\t\tinsertBlocks,\n\t\t\tcreateSuccessNotice,\n\t\t\tcreateErrorNotice,\n\t\t\tclearSelectedBlock,\n\t\t\teditTitle( title ) {\n\t\t\t\teditPost( { title } );\n\t\t\t},\n\t\t\treceiveEntityRecords,\n\t\t\tresetEditorBlocksWithoutUndoLevel( blocks ) {\n\t\t\t\tresetEditorBlocks( blocks, {\n\t\t\t\t\t__unstableShouldCreateUndoLevel: false,\n\t\t\t\t} );\n\t\t\t},\n\t\t\tswitchMode( mode ) {\n\t\t\t\tswitchEditorMode( mode );\n\t\t\t},\n\t\t\tonInsertBlockAfter( blocks ) {\n\t\t\t\tinsertBlocks( blocks, undefined, undefined, false );\n\t\t\t},\n\t\t\tonClearPostTitleSelection() {\n\t\t\t\ttogglePostTitleSelection( false );\n\t\t\t},\n\t\t\treplaceBlock,\n\t\t};\n\t} ),\n] )( NativeEditorProvider );\n\nexport default ComposedNativeProvider;\nexport { ComposedNativeProvider as ExperimentalEditorProvider };\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,QAAQ,cAAc;AAC1C,OAAOC,MAAM,MAAM,QAAQ;AAC3B,SAASC,gBAAgB,QAAQ,gCAAgC;;AAEjE;AACA;AACA;AACA,OAAOC,4BAA4B,IAClCC,2BAA2B,EAC3BC,uBAAuB,EACvBC,sBAAsB,EACtBC,6BAA6B,EAC7BC,mBAAmB,EACnBC,iBAAiB,EACjBC,oBAAoB,EACpBC,qBAAqB,EACrBC,6BAA6B,EAC7BC,2BAA2B,EAC3BC,mBAAmB,EACnBC,uBAAuB,EACvBC,wBAAwB,QAClB,gCAAgC;AACvC,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SACCC,KAAK,EACLC,SAAS,EACTC,8BAA8B,EAC9BC,YAAY,EACZC,WAAW,EAC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5B0J,YAAY,CAAE1J,MAAM,EAAE4J,SAAS,EAAEA,SAAS,EAAE,KAAM,CAAC;IACpD,CAAC;IACD/C,yBAAyBA,CAAA,EAAG;MAC3B2C,wBAAwB,CAAE,KAAM,CAAC;IAClC,CAAC;IACD7B;EACD,CAAC;AACF,CAAE,CAAC,CACF,CAAC,CAAE1G,oBAAqB,CAAC;AAE3B,eAAemH,sBAAsB;AACrC,SAASA,sBAAsB,IAAIyB,0BAA0B","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["BackHandler","memize","SafeAreaProvider","RNReactNativeGutenbergBridge","requestBlockTypeImpressions","setBlockTypeImpressions","subscribeParentGetHtml","subscribeParentToggleHTMLMode","subscribeUpdateHtml","subscribeSetTitle","subscribeMediaAppend","subscribeReplaceBlock","subscribeUpdateEditorSettings","subscribeUpdateCapabilities","subscribeShowNotice","subscribeShowEditorHelp","subscribeToContentUpdate","Component","count","wordCount","parse","serialize","getUnregisteredTypeHandlerName","getBlockType","createBlock","pasteHandler","withDispatch","withSelect","compose","applyFilters","store","blockEditorStore","getGlobalStyles","getColorsAndGradients","NEW_BLOCK_TYPES","__","postTypeEntities","name","baseURL","map","postTypeEntity","kind","transientEdits","blocks","selection","mergedEdits","meta","rawAttributes","EditorHelpTopics","editorStore","noticesStore","coreStore","EditorProvider","insertContentWithTitle","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","NativeEditorProvider","constructor","arguments","post","props","addEntities","receiveEntityRecords","type","onHardwareBackPress","bind","onContentUpdate","getEditorSettings","settings","capabilities","maxSize","state","isHelpVisible","componentDidMount","createErrorNotice","locale","hostAppNamespace","updateEditorSettings","updateBlockEditorSettings","getThemeColors","subscriptionParentGetHtml","serializeToNativeAction","subscriptionParentToggleHTMLMode","toggleMode","subscriptionParentSetTitle","payload","editTitle","title","subscriptionParentUpdateHtml","updateHtmlAction","html","subscriptionParentReplaceBlock","replaceBlockAction","clientId","subscriptionParentMediaAppend","blockName","mediaType","blockType","newBlock","id","mediaId","mediaUrl","indexAfterSelected","selectedBlockIndex","insertionIndex","blockCount","insertBlock","subscriptionParentUpdateEditorSettings","editorSettings","subscriptionParentUpdateCapabilities","updateCapabilitiesAction","subscriptionParentShowNotice","createSuccessNotice","message","subscriptionParentShowEditorHelp","setState","hardwareBackPressListener","addEventListener","subscriptionOnContentUpdate","data","storedImpressions","impressions","storedImpressionKeys","Object","keys","storedImpressionsCurrent","every","newKey","includes","componentWillUnmount","remove","rawStyles","rawFeatures","defaultEditorColors","defaultEditorGradients","componentDidUpdate","prevProps","isReady","isUnsupportedBlock","unsupportedBlockNames","filter","block","attributes","originalName","editorDidMount","clearSelectedBlock","content","rawContent","onClearPostTitleSelection","onInsertBlockAfter","onInsertBlocks","plainText","mode","hasChanges","raw","contentInfo","characterCount","paragraphCount","provideToNative_Html","parsed","resetEditorBlocksWithoutUndoLevel","blockClientId","replaceBlock","switchMode","render","children","isVisible","onClose","close","showSupport","supportSection","ComposedNativeProvider","select","_settings$colors","_settings$gradients","__unstableIsEditorReady","isEditorReady","getEditorBlocks","getEditedPostAttribute","getEditedPostContent","getEditorMode","getBlockIndex","getSelectedBlockClientId","getGlobalBlockCount","colors","gradients","selectedBlockClientId","dispatch","editPost","resetEditorBlocks","switchEditorMode","togglePostTitleSelection","updateSettings","insertBlocks","__unstableShouldCreateUndoLevel","undefined","ExperimentalEditorProvider"],"sources":["@wordpress/editor/src/components/provider/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { BackHandler } from 'react-native';\nimport memize from 'memize';\nimport { SafeAreaProvider } from 'react-native-safe-area-context';\n\n/**\n * WordPress dependencies\n */\nimport RNReactNativeGutenbergBridge, {\n\trequestBlockTypeImpressions,\n\tsetBlockTypeImpressions,\n\tsubscribeParentGetHtml,\n\tsubscribeParentToggleHTMLMode,\n\tsubscribeUpdateHtml,\n\tsubscribeSetTitle,\n\tsubscribeMediaAppend,\n\tsubscribeReplaceBlock,\n\tsubscribeUpdateEditorSettings,\n\tsubscribeUpdateCapabilities,\n\tsubscribeShowNotice,\n\tsubscribeShowEditorHelp,\n\tsubscribeToContentUpdate,\n} from '@wordpress/react-native-bridge';\nimport { Component } from '@wordpress/element';\nimport { count as wordCount } from '@wordpress/wordcount';\nimport {\n\tparse,\n\tserialize,\n\tgetUnregisteredTypeHandlerName,\n\tgetBlockType,\n\tcreateBlock,\n\tpasteHandler,\n} from '@wordpress/blocks';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\nimport { applyFilters } from '@wordpress/hooks';\nimport {\n\tstore as blockEditorStore,\n\tgetGlobalStyles,\n\tgetColorsAndGradients,\n} from '@wordpress/block-editor';\nimport { NEW_BLOCK_TYPES } from '@wordpress/block-library';\nimport { __ } from '@wordpress/i18n';\n\nconst postTypeEntities = [\n\t{ name: 'post', baseURL: '/wp/v2/posts' },\n\t{ name: 'page', baseURL: '/wp/v2/pages' },\n\t{ name: 'attachment', baseURL: '/wp/v2/media' },\n\t{ name: 'wp_block', baseURL: '/wp/v2/blocks' },\n].map( ( postTypeEntity ) => ( {\n\tkind: 'postType',\n\t...postTypeEntity,\n\ttransientEdits: {\n\t\tblocks: true,\n\t\tselection: true,\n\t},\n\tmergedEdits: {\n\t\tmeta: true,\n\t},\n\trawAttributes: [ 'title', 'excerpt', 'content' ],\n} ) );\nimport { EditorHelpTopics, store as editorStore } from '@wordpress/editor';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport EditorProvider from './index.js';\nimport { insertContentWithTitle } from '../post-title';\n\nclass NativeEditorProvider extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\t// Keep a local reference to `post` to detect changes.\n\t\tthis.post = this.props.post;\n\t\tthis.props.addEntities( postTypeEntities );\n\t\tthis.props.receiveEntityRecords(\n\t\t\t'postType',\n\t\t\tthis.post.type,\n\t\t\tthis.post\n\t\t);\n\n\t\tthis.onHardwareBackPress = this.onHardwareBackPress.bind( this );\n\t\tthis.onContentUpdate = this.onContentUpdate.bind( this );\n\n\t\tthis.getEditorSettings = memize(\n\t\t\t( settings, capabilities ) => ( {\n\t\t\t\t...settings,\n\t\t\t\tcapabilities,\n\t\t\t} ),\n\t\t\t{\n\t\t\t\tmaxSize: 1,\n\t\t\t}\n\t\t);\n\t\tthis.state = {\n\t\t\tisHelpVisible: false,\n\t\t};\n\t}\n\n\tcomponentDidMount() {\n\t\tconst {\n\t\t\tcapabilities,\n\t\t\tcreateErrorNotice,\n\t\t\tlocale,\n\t\t\thostAppNamespace,\n\t\t\tupdateEditorSettings,\n\t\t\tupdateBlockEditorSettings,\n\t\t} = this.props;\n\n\t\tupdateEditorSettings( {\n\t\t\tcapabilities,\n\t\t\t...this.getThemeColors( this.props ),\n\t\t\tlocale,\n\t\t\thostAppNamespace,\n\t\t} );\n\n\t\tthis.subscriptionParentGetHtml = subscribeParentGetHtml( () => {\n\t\t\tthis.serializeToNativeAction();\n\t\t} );\n\n\t\tthis.subscriptionParentToggleHTMLMode = subscribeParentToggleHTMLMode(\n\t\t\t() => {\n\t\t\t\tthis.toggleMode();\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentSetTitle = subscribeSetTitle( ( payload ) => {\n\t\t\tthis.props.editTitle( payload.title );\n\t\t} );\n\n\t\tthis.subscriptionParentUpdateHtml = subscribeUpdateHtml(\n\t\t\t( payload ) => {\n\t\t\t\tthis.updateHtmlAction( payload.html );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentReplaceBlock = subscribeReplaceBlock(\n\t\t\t( payload ) => {\n\t\t\t\tthis.replaceBlockAction( payload.html, payload.clientId );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentMediaAppend = subscribeMediaAppend(\n\t\t\t( payload ) => {\n\t\t\t\tconst blockName = 'core/' + payload.mediaType;\n\t\t\t\tconst blockType = getBlockType( blockName );\n\n\t\t\t\tif ( blockType && blockType?.name ) {\n\t\t\t\t\tconst newBlock = createBlock( blockType.name, {\n\t\t\t\t\t\tid: payload.mediaId,\n\t\t\t\t\t\t[ payload.mediaType === 'image' ? 'url' : 'src' ]:\n\t\t\t\t\t\t\tpayload.mediaUrl,\n\t\t\t\t\t} );\n\n\t\t\t\t\tconst indexAfterSelected =\n\t\t\t\t\t\tthis.props.selectedBlockIndex + 1;\n\t\t\t\t\tconst insertionIndex =\n\t\t\t\t\t\tindexAfterSelected || this.props.blockCount;\n\n\t\t\t\t\tthis.props.insertBlock( newBlock, insertionIndex );\n\t\t\t\t} else {\n\t\t\t\t\tcreateErrorNotice(\n\t\t\t\t\t\t__( 'File type not supported as a media file.' )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentUpdateEditorSettings =\n\t\t\tsubscribeUpdateEditorSettings( ( { ...editorSettings } ) => {\n\t\t\t\tupdateEditorSettings( this.getThemeColors( editorSettings ) );\n\t\t\t} );\n\n\t\tthis.subscriptionParentUpdateCapabilities = subscribeUpdateCapabilities(\n\t\t\t( payload ) => {\n\t\t\t\tthis.updateCapabilitiesAction( payload );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentShowNotice = subscribeShowNotice(\n\t\t\t( payload ) => {\n\t\t\t\tthis.props.createSuccessNotice( payload.message );\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentShowEditorHelp = subscribeShowEditorHelp( () => {\n\t\t\tthis.setState( { isHelpVisible: true } );\n\t\t} );\n\n\t\tthis.hardwareBackPressListener = BackHandler.addEventListener(\n\t\t\t'hardwareBackPress',\n\t\t\tthis.onHardwareBackPress\n\t\t);\n\n\t\tthis.subscriptionOnContentUpdate = subscribeToContentUpdate(\n\t\t\t( data ) => {\n\t\t\t\tthis.onContentUpdate( data );\n\t\t\t}\n\t\t);\n\n\t\t// Request current block impressions from native app.\n\t\trequestBlockTypeImpressions( ( storedImpressions ) => {\n\t\t\tconst impressions = { ...NEW_BLOCK_TYPES, ...storedImpressions };\n\n\t\t\t// Persist impressions to JavaScript store.\n\t\t\tupdateBlockEditorSettings( { impressions } );\n\n\t\t\t// Persist impressions to native store if they do not include latest\n\t\t\t// `NEW_BLOCK_TYPES` configuration.\n\t\t\tconst storedImpressionKeys = Object.keys( storedImpressions );\n\t\t\tconst storedImpressionsCurrent = Object.keys(\n\t\t\t\tNEW_BLOCK_TYPES\n\t\t\t).every( ( newKey ) => storedImpressionKeys.includes( newKey ) );\n\t\t\tif ( ! storedImpressionsCurrent ) {\n\t\t\t\tsetBlockTypeImpressions( impressions );\n\t\t\t}\n\t\t} );\n\t}\n\n\tcomponentWillUnmount() {\n\t\tif ( this.subscriptionParentGetHtml ) {\n\t\t\tthis.subscriptionParentGetHtml.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentToggleHTMLMode ) {\n\t\t\tthis.subscriptionParentToggleHTMLMode.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentSetTitle ) {\n\t\t\tthis.subscriptionParentSetTitle.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentUpdateHtml ) {\n\t\t\tthis.subscriptionParentUpdateHtml.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentReplaceBlock ) {\n\t\t\tthis.subscriptionParentReplaceBlock.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentMediaAppend ) {\n\t\t\tthis.subscriptionParentMediaAppend.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentUpdateEditorSettings ) {\n\t\t\tthis.subscriptionParentUpdateEditorSettings.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentUpdateCapabilities ) {\n\t\t\tthis.subscriptionParentUpdateCapabilities.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentShowNotice ) {\n\t\t\tthis.subscriptionParentShowNotice.remove();\n\t\t}\n\n\t\tif ( this.subscriptionParentShowEditorHelp ) {\n\t\t\tthis.subscriptionParentShowEditorHelp.remove();\n\t\t}\n\n\t\tif ( this.hardwareBackPressListener ) {\n\t\t\tthis.hardwareBackPressListener.remove();\n\t\t}\n\n\t\tif ( this.subscriptionOnContentUpdate ) {\n\t\t\tthis.subscriptionOnContentUpdate.remove();\n\t\t}\n\t}\n\n\tgetThemeColors( { rawStyles, rawFeatures } ) {\n\t\tconst { defaultEditorColors, defaultEditorGradients } = this.props;\n\n\t\tif ( rawStyles && rawFeatures ) {\n\t\t\treturn getGlobalStyles( rawStyles, rawFeatures );\n\t\t}\n\n\t\treturn getColorsAndGradients(\n\t\t\tdefaultEditorColors,\n\t\t\tdefaultEditorGradients,\n\t\t\trawFeatures\n\t\t);\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tif ( ! prevProps.isReady && this.props.isReady ) {\n\t\t\tconst blocks = this.props.blocks;\n\t\t\tconst isUnsupportedBlock = ( { name } ) =>\n\t\t\t\tname === getUnregisteredTypeHandlerName();\n\t\t\tconst unsupportedBlockNames = blocks\n\t\t\t\t.filter( isUnsupportedBlock )\n\t\t\t\t.map( ( block ) => block.attributes.originalName );\n\t\t\tRNReactNativeGutenbergBridge.editorDidMount(\n\t\t\t\tunsupportedBlockNames\n\t\t\t);\n\t\t}\n\t}\n\n\tonHardwareBackPress() {\n\t\tconst { clearSelectedBlock, selectedBlockIndex } = this.props;\n\n\t\tif ( selectedBlockIndex !== -1 ) {\n\t\t\tclearSelectedBlock();\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tonContentUpdate( { content: rawContent } ) {\n\t\tconst {\n\t\t\teditTitle,\n\t\t\tonClearPostTitleSelection,\n\t\t\tonInsertBlockAfter: onInsertBlocks,\n\t\t\ttitle,\n\t\t} = this.props;\n\t\tconst content = pasteHandler( {\n\t\t\tplainText: rawContent,\n\t\t} );\n\n\t\tinsertContentWithTitle( title, content, editTitle, onInsertBlocks );\n\t\tonClearPostTitleSelection();\n\t}\n\n\tserializeToNativeAction() {\n\t\tconst title = this.props.title;\n\t\tlet html;\n\n\t\tif ( this.props.mode === 'text' ) {\n\t\t\t// The HTMLTextInput component does not update the store when user is doing changes\n\t\t\t// Let's request the HTML from the component's state directly.\n\t\t\thtml = applyFilters( 'native.persist-html' );\n\t\t} else {\n\t\t\thtml = serialize( this.props.blocks );\n\t\t}\n\n\t\tconst hasChanges =\n\t\t\ttitle !== this.post.title.raw || html !== this.post.content.raw;\n\n\t\t// Variable to store the content structure metrics.\n\t\tconst contentInfo = {};\n\t\tcontentInfo.characterCount = wordCount(\n\t\t\thtml,\n\t\t\t'characters_including_spaces'\n\t\t);\n\t\tcontentInfo.wordCount = wordCount( html, 'words' );\n\t\tcontentInfo.paragraphCount = this.props.paragraphCount;\n\t\tcontentInfo.blockCount = this.props.blockCount;\n\t\tRNReactNativeGutenbergBridge.provideToNative_Html(\n\t\t\thtml,\n\t\t\ttitle,\n\t\t\thasChanges,\n\t\t\tcontentInfo\n\t\t);\n\n\t\tif ( hasChanges ) {\n\t\t\tthis.post.title.raw = title;\n\t\t\tthis.post.content.raw = html;\n\t\t}\n\t}\n\n\tupdateHtmlAction( html ) {\n\t\tconst parsed = parse( html );\n\t\tthis.props.resetEditorBlocksWithoutUndoLevel( parsed );\n\t}\n\n\treplaceBlockAction( html, blockClientId ) {\n\t\tconst parsed = parse( html );\n\t\tthis.props.replaceBlock( blockClientId, parsed );\n\t}\n\n\ttoggleMode() {\n\t\tconst { mode, switchMode } = this.props;\n\t\t// Refresh html content first.\n\t\tthis.serializeToNativeAction();\n\t\tswitchMode( mode === 'visual' ? 'text' : 'visual' );\n\t}\n\n\tupdateCapabilitiesAction( capabilities ) {\n\t\tthis.props.updateEditorSettings( { capabilities } );\n\t}\n\n\trender() {\n\t\tconst { children, post, capabilities, settings, ...props } = this.props;\n\t\tconst editorSettings = this.getEditorSettings( settings, capabilities );\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<EditorProvider\n\t\t\t\t\tpost={ this.post }\n\t\t\t\t\tsettings={ editorSettings }\n\t\t\t\t\t{ ...props }\n\t\t\t\t>\n\t\t\t\t\t<SafeAreaProvider>{ children }</SafeAreaProvider>\n\t\t\t\t</EditorProvider>\n\t\t\t\t<EditorHelpTopics\n\t\t\t\t\tisVisible={ this.state.isHelpVisible }\n\t\t\t\t\tonClose={ () => this.setState( { isHelpVisible: false } ) }\n\t\t\t\t\tclose={ () => this.setState( { isHelpVisible: false } ) }\n\t\t\t\t\tshowSupport={ capabilities?.supportSection === true }\n\t\t\t\t/>\n\t\t\t</>\n\t\t);\n\t}\n}\n\nconst ComposedNativeProvider = compose( [\n\twithSelect( ( select ) => {\n\t\tconst {\n\t\t\t__unstableIsEditorReady: isEditorReady,\n\t\t\tgetEditorBlocks,\n\t\t\tgetEditedPostAttribute,\n\t\t\tgetEditedPostContent,\n\t\t\tgetEditorSettings,\n\t\t\tgetEditorMode,\n\t\t} = select( editorStore );\n\n\t\tconst { getBlockIndex, getSelectedBlockClientId, getGlobalBlockCount } =\n\t\t\tselect( blockEditorStore );\n\n\t\tconst settings = getEditorSettings();\n\t\tconst defaultEditorColors = settings?.colors ?? [];\n\t\tconst defaultEditorGradients = settings?.gradients ?? [];\n\n\t\tconst selectedBlockClientId = getSelectedBlockClientId();\n\t\treturn {\n\t\t\tmode: getEditorMode(),\n\t\t\tisReady: isEditorReady(),\n\t\t\tblocks: getEditorBlocks(),\n\t\t\ttitle: getEditedPostAttribute( 'title' ),\n\t\t\tgetEditedPostContent,\n\t\t\tdefaultEditorColors,\n\t\t\tdefaultEditorGradients,\n\t\t\tselectedBlockIndex: getBlockIndex( selectedBlockClientId ),\n\t\t\tblockCount: getGlobalBlockCount(),\n\t\t\tparagraphCount: getGlobalBlockCount( 'core/paragraph' ),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst {\n\t\t\teditPost,\n\t\t\tresetEditorBlocks,\n\t\t\tupdateEditorSettings,\n\t\t\tswitchEditorMode,\n\t\t\ttogglePostTitleSelection,\n\t\t} = dispatch( editorStore );\n\t\tconst {\n\t\t\tclearSelectedBlock,\n\t\t\tupdateSettings,\n\t\t\tinsertBlock,\n\t\t\tinsertBlocks,\n\t\t\treplaceBlock,\n\t\t} = dispatch( blockEditorStore );\n\t\tconst { addEntities, receiveEntityRecords } = dispatch( coreStore );\n\t\tconst { createSuccessNotice, createErrorNotice } =\n\t\t\tdispatch( noticesStore );\n\n\t\treturn {\n\t\t\tupdateBlockEditorSettings: updateSettings,\n\t\t\tupdateEditorSettings,\n\t\t\taddEntities,\n\t\t\tinsertBlock,\n\t\t\tinsertBlocks,\n\t\t\tcreateSuccessNotice,\n\t\t\tcreateErrorNotice,\n\t\t\tclearSelectedBlock,\n\t\t\teditTitle( title ) {\n\t\t\t\teditPost( { title } );\n\t\t\t},\n\t\t\treceiveEntityRecords,\n\t\t\tresetEditorBlocksWithoutUndoLevel( blocks ) {\n\t\t\t\tresetEditorBlocks( blocks, {\n\t\t\t\t\t__unstableShouldCreateUndoLevel: false,\n\t\t\t\t} );\n\t\t\t},\n\t\t\tswitchMode( mode ) {\n\t\t\t\tswitchEditorMode( mode );\n\t\t\t},\n\t\t\tonInsertBlockAfter( blocks ) {\n\t\t\t\tinsertBlocks( blocks, undefined, undefined, false );\n\t\t\t},\n\t\t\tonClearPostTitleSelection() {\n\t\t\t\ttogglePostTitleSelection( false );\n\t\t\t},\n\t\t\treplaceBlock,\n\t\t};\n\t} ),\n] )( NativeEditorProvider );\n\nexport default ComposedNativeProvider;\nexport { ComposedNativeProvider as ExperimentalEditorProvider };\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,QAAQ,cAAc;AAC1C,OAAOC,MAAM,MAAM,QAAQ;AAC3B,SAASC,gBAAgB,QAAQ,gCAAgC;;AAEjE;AACA;AACA;AACA,OAAOC,4BAA4B,IAClCC,2BAA2B,EAC3BC,uBAAuB,EACvBC,sBAAsB,EACtBC,6BAA6B,EAC7BC,mBAAmB,EACnBC,iBAAiB,EACjBC,oBAAoB,EACpBC,qBAAqB,EACrBC,6BAA6B,EAC7BC,2BAA2B,EAC3BC,mBAAmB,EACnBC,uBAAuB,EACvBC,w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AA+B,EAAE;MAClC,CAAE,CAAC;IACJ,CAAC;IACD/B,UAAUA,CAAEX,IAAI,EAAG;MAClBsC,gBAAgB,CAAEtC,IAAK,CAAC;IACzB,CAAC;IACDH,kBAAkBA,CAAE9G,MAAM,EAAG;MAC5B0J,YAAY,CAAE1J,MAAM,EAAE4J,SAAS,EAAEA,SAAS,EAAE,KAAM,CAAC;IACpD,CAAC;IACD/C,yBAAyBA,CAAA,EAAG;MAC3B2C,wBAAwB,CAAE,KAAM,CAAC;IAClC,CAAC;IACD7B;EACD,CAAC;AACF,CAAE,CAAC,CACF,CAAC,CAAE1G,oBAAqB,CAAC;AAE3B,eAAemH,sBAAsB;AACrC,SAASA,sBAAsB,IAAIyB,0BAA0B","ignoreList":[]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { useSelect } from '@wordpress/data';
|
|
5
|
+
import { useMemo } from '@wordpress/element';
|
|
6
|
+
import { applyFilters } from '@wordpress/hooks';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Internal dependencies
|
|
10
|
+
*/
|
|
11
|
+
import { store as editorStore } from '../../store';
|
|
12
|
+
import { unlock } from '../../lock-unlock';
|
|
13
|
+
const POST_CONTENT_BLOCK_TYPES = ['core/post-title', 'core/post-featured-image', 'core/post-content'];
|
|
14
|
+
export default function usePostContentBlocks() {
|
|
15
|
+
const contentOnlyBlockTypes = useMemo(() => [...applyFilters('editor.postContentBlockTypes', POST_CONTENT_BLOCK_TYPES)], []);
|
|
16
|
+
|
|
17
|
+
// Note that there are two separate subscriptions because the result for each
|
|
18
|
+
// returns a new array.
|
|
19
|
+
const contentOnlyIds = useSelect(select => {
|
|
20
|
+
const {
|
|
21
|
+
getPostBlocksByName
|
|
22
|
+
} = unlock(select(editorStore));
|
|
23
|
+
return getPostBlocksByName(contentOnlyBlockTypes);
|
|
24
|
+
}, [contentOnlyBlockTypes]);
|
|
25
|
+
return contentOnlyIds;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=use-post-content-blocks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useSelect","useMemo","applyFilters","store","editorStore","unlock","POST_CONTENT_BLOCK_TYPES","usePostContentBlocks","contentOnlyBlockTypes","contentOnlyIds","select","getPostBlocksByName"],"sources":["@wordpress/editor/src/components/provider/use-post-content-blocks.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { applyFilters } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst POST_CONTENT_BLOCK_TYPES = [\n\t'core/post-title',\n\t'core/post-featured-image',\n\t'core/post-content',\n];\n\nexport default function usePostContentBlocks() {\n\tconst contentOnlyBlockTypes = useMemo(\n\t\t() => [\n\t\t\t...applyFilters(\n\t\t\t\t'editor.postContentBlockTypes',\n\t\t\t\tPOST_CONTENT_BLOCK_TYPES\n\t\t\t),\n\t\t],\n\t\t[]\n\t);\n\n\t// Note that there are two separate subscriptions because the result for each\n\t// returns a new array.\n\tconst contentOnlyIds = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getPostBlocksByName } = unlock( select( editorStore ) );\n\t\t\treturn getPostBlocksByName( contentOnlyBlockTypes );\n\t\t},\n\t\t[ contentOnlyBlockTypes ]\n\t);\n\n\treturn contentOnlyIds;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,YAAY,QAAQ,kBAAkB;;AAE/C;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAClD,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,MAAMC,wBAAwB,GAAG,CAChC,iBAAiB,EACjB,0BAA0B,EAC1B,mBAAmB,CACnB;AAED,eAAe,SAASC,oBAAoBA,CAAA,EAAG;EAC9C,MAAMC,qBAAqB,GAAGP,OAAO,CACpC,MAAM,CACL,GAAGC,YAAY,CACd,8BAA8B,EAC9BI,wBACD,CAAC,CACD,EACD,EACD,CAAC;;EAED;EACA;EACA,MAAMG,cAAc,GAAGT,SAAS,CAC7BU,MAAM,IAAM;IACb,MAAM;MAAEC;IAAoB,CAAC,GAAGN,MAAM,CAAEK,MAAM,CAAEN,WAAY,CAAE,CAAC;IAC/D,OAAOO,mBAAmB,CAAEH,qBAAsB,CAAC;EACpD,CAAC,EACD,CAAEA,qBAAqB,CACxB,CAAC;EAED,OAAOC,cAAc;AACtB","ignoreList":[]}
|
|
@@ -4,9 +4,7 @@
|
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
import { LEFT, RIGHT } from '@wordpress/keycodes';
|
|
6
6
|
import { VisuallyHidden, Tooltip, __unstableMotion as motion } from '@wordpress/components';
|
|
7
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
9
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
8
|
const DELTA_DISTANCE = 20; // The distance to resize per keydown in pixels.
|
|
11
9
|
|
|
12
10
|
export default function ResizeHandle({
|
|
@@ -17,6 +15,10 @@ export default function ResizeHandle({
|
|
|
17
15
|
const {
|
|
18
16
|
keyCode
|
|
19
17
|
} = event;
|
|
18
|
+
if (keyCode !== LEFT && keyCode !== RIGHT) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
event.preventDefault();
|
|
20
22
|
if (direction === 'left' && keyCode === LEFT || direction === 'right' && keyCode === RIGHT) {
|
|
21
23
|
resizeWidthBy(DELTA_DISTANCE);
|
|
22
24
|
} else if (direction === 'left' && keyCode === RIGHT || direction === 'right' && keyCode === LEFT) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","LEFT","RIGHT","VisuallyHidden","Tooltip","__unstableMotion","motion","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","DELTA_DISTANCE","ResizeHandle","direction","resizeWidthBy","handleKeyDown","event","keyCode","resizeHandleVariants","active","opacity","scaleY","resizableHandleHelpId","children","text","button","className","onKeyDown","variants","whileFocus","whileHover","whileTap","role","id"],"sources":["@wordpress/editor/src/components/resizable-editor/resize-handle.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { LEFT, RIGHT } from '@wordpress/keycodes';\nimport {\n\tVisuallyHidden,\n\tTooltip,\n\t__unstableMotion as motion,\n} from '@wordpress/components';\n\nconst DELTA_DISTANCE = 20; // The distance to resize per keydown in pixels.\n\nexport default function ResizeHandle( { direction, resizeWidthBy } ) {\n\tfunction handleKeyDown( event ) {\n\t\tconst { keyCode } = event;\n\n\t\tif (\n\t\t\t( direction === 'left' && keyCode === LEFT ) ||\n\t\t\t( direction === 'right' && keyCode === RIGHT )\n\t\t) {\n\t\t\tresizeWidthBy( DELTA_DISTANCE );\n\t\t} else if (\n\t\t\t( direction === 'left' && keyCode === RIGHT ) ||\n\t\t\t( direction === 'right' && keyCode === LEFT )\n\t\t) {\n\t\t\tresizeWidthBy( -DELTA_DISTANCE );\n\t\t}\n\t}\n\n\tconst resizeHandleVariants = {\n\t\tactive: {\n\t\t\topacity: 1,\n\t\t\tscaleY: 1.3,\n\t\t},\n\t};\n\n\tconst resizableHandleHelpId = `resizable-editor__resize-help-${ direction }`;\n\n\treturn (\n\t\t<>\n\t\t\t<Tooltip text={ __( 'Drag to resize' ) }>\n\t\t\t\t<motion.button\n\t\t\t\t\tclassName={ `editor-resizable-editor__resize-handle is-${ direction }` }\n\t\t\t\t\taria-label={ __( 'Drag to resize' ) }\n\t\t\t\t\taria-describedby={ resizableHandleHelpId }\n\t\t\t\t\tonKeyDown={ handleKeyDown }\n\t\t\t\t\tvariants={ resizeHandleVariants }\n\t\t\t\t\twhileFocus=\"active\"\n\t\t\t\t\twhileHover=\"active\"\n\t\t\t\t\twhileTap=\"active\"\n\t\t\t\t\tkey=\"handle\"\n\t\t\t\t\trole=\"separator\"\n\t\t\t\t\taria-orientation=\"vertical\"\n\t\t\t\t/>\n\t\t\t</Tooltip>\n\t\t\t<VisuallyHidden id={ resizableHandleHelpId }>\n\t\t\t\t{ __( 'Use left and right arrow keys to resize the canvas.' ) }\n\t\t\t</VisuallyHidden>\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,IAAI,EAAEC,KAAK,QAAQ,qBAAqB;AACjD,SACCC,cAAc,EACdC,OAAO,EACPC,gBAAgB,IAAIC,MAAM,QACpB,uBAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA
|
|
1
|
+
{"version":3,"names":["__","LEFT","RIGHT","VisuallyHidden","Tooltip","__unstableMotion","motion","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","DELTA_DISTANCE","ResizeHandle","direction","resizeWidthBy","handleKeyDown","event","keyCode","preventDefault","resizeHandleVariants","active","opacity","scaleY","resizableHandleHelpId","children","text","button","className","onKeyDown","variants","whileFocus","whileHover","whileTap","role","id"],"sources":["@wordpress/editor/src/components/resizable-editor/resize-handle.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { LEFT, RIGHT } from '@wordpress/keycodes';\nimport {\n\tVisuallyHidden,\n\tTooltip,\n\t__unstableMotion as motion,\n} from '@wordpress/components';\n\nconst DELTA_DISTANCE = 20; // The distance to resize per keydown in pixels.\n\nexport default function ResizeHandle( { direction, resizeWidthBy } ) {\n\tfunction handleKeyDown( event ) {\n\t\tconst { keyCode } = event;\n\n\t\tif ( keyCode !== LEFT && keyCode !== RIGHT ) {\n\t\t\treturn;\n\t\t}\n\t\tevent.preventDefault();\n\n\t\tif (\n\t\t\t( direction === 'left' && keyCode === LEFT ) ||\n\t\t\t( direction === 'right' && keyCode === RIGHT )\n\t\t) {\n\t\t\tresizeWidthBy( DELTA_DISTANCE );\n\t\t} else if (\n\t\t\t( direction === 'left' && keyCode === RIGHT ) ||\n\t\t\t( direction === 'right' && keyCode === LEFT )\n\t\t) {\n\t\t\tresizeWidthBy( -DELTA_DISTANCE );\n\t\t}\n\t}\n\n\tconst resizeHandleVariants = {\n\t\tactive: {\n\t\t\topacity: 1,\n\t\t\tscaleY: 1.3,\n\t\t},\n\t};\n\n\tconst resizableHandleHelpId = `resizable-editor__resize-help-${ direction }`;\n\n\treturn (\n\t\t<>\n\t\t\t<Tooltip text={ __( 'Drag to resize' ) }>\n\t\t\t\t<motion.button\n\t\t\t\t\tclassName={ `editor-resizable-editor__resize-handle is-${ direction }` }\n\t\t\t\t\taria-label={ __( 'Drag to resize' ) }\n\t\t\t\t\taria-describedby={ resizableHandleHelpId }\n\t\t\t\t\tonKeyDown={ handleKeyDown }\n\t\t\t\t\tvariants={ resizeHandleVariants }\n\t\t\t\t\twhileFocus=\"active\"\n\t\t\t\t\twhileHover=\"active\"\n\t\t\t\t\twhileTap=\"active\"\n\t\t\t\t\tkey=\"handle\"\n\t\t\t\t\trole=\"separator\"\n\t\t\t\t\taria-orientation=\"vertical\"\n\t\t\t\t/>\n\t\t\t</Tooltip>\n\t\t\t<VisuallyHidden id={ resizableHandleHelpId }>\n\t\t\t\t{ __( 'Use left and right arrow keys to resize the canvas.' ) }\n\t\t\t</VisuallyHidden>\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,IAAI,EAAEC,KAAK,QAAQ,qBAAqB;AACjD,SACCC,cAAc,EACdC,OAAO,EACPC,gBAAgB,IAAIC,MAAM,QACpB,uBAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,E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EAAC,QAAQ;QAEjBC,IAAI,EAAC,WAAW;QAChB,oBAAiB;MAAU,GAFvB,QAGJ;IAAC,CACM,CAAC,eACV3B,IAAA,CAACL,cAAc;MAACiC,EAAE,EAAGX,qBAAuB;MAAAC,QAAA,EACzC1B,EAAE,CAAE,qDAAsD;IAAC,CAC9C,CAAC;EAAA,CAChB,CAAC;AAEL","ignoreList":[]}
|
|
@@ -14,9 +14,7 @@ import PostPublishPanel from '../post-publish-panel';
|
|
|
14
14
|
import PluginPrePublishPanel from '../plugin-pre-publish-panel';
|
|
15
15
|
import PluginPostPublishPanel from '../plugin-post-publish-panel';
|
|
16
16
|
import { store as editorStore } from '../../store';
|
|
17
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
19
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
18
|
const {
|
|
21
19
|
Fill,
|
|
22
20
|
Slot
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useSelect","useDispatch","Button","createSlotFill","__","useCallback","EntitiesSavedStates","PostPublishPanel","PluginPrePublishPanel","PluginPostPublishPanel","store","editorStore","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","Fill","Slot","ActionsPanelFill","SavePublishPanels","setEntitiesSavedStatesCallback","closeEntitiesSavedStates","isEntitiesSavedStatesOpen","forceIsDirtyPublishPanel","closePublishSidebar","togglePublishSidebar","publishSidebarOpened","isPublishable","isDirty","hasOtherEntitiesChanges","select","isPublishSidebarOpened","isEditedPostPublishable","isCurrentPostPublished","isEditedPostDirty","hasNonPostEntityChanges","_hasOtherEntitiesChanges","openEntitiesSavedStates","unmountableContent","onClose","forceIsDirty","PrePublishExtension","PostPublishExtension","className","children","__next40pxDefaultSize","variant","onClick","disabled","accessibleWhenDisabled","close","bubblesVirtually"],"sources":["@wordpress/editor/src/components/save-publish-panels/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Button, createSlotFill } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport EntitiesSavedStates from '../entities-saved-states';\nimport PostPublishPanel from '../post-publish-panel';\nimport PluginPrePublishPanel from '../plugin-pre-publish-panel';\nimport PluginPostPublishPanel from '../plugin-post-publish-panel';\nimport { store as editorStore } from '../../store';\n\nconst { Fill, Slot } = createSlotFill( 'ActionsPanel' );\n\nexport const ActionsPanelFill = Fill;\n\nexport default function SavePublishPanels( {\n\tsetEntitiesSavedStatesCallback,\n\tcloseEntitiesSavedStates,\n\tisEntitiesSavedStatesOpen,\n\tforceIsDirtyPublishPanel,\n} ) {\n\tconst { closePublishSidebar, togglePublishSidebar } =\n\t\tuseDispatch( editorStore );\n\tconst {\n\t\tpublishSidebarOpened,\n\t\tisPublishable,\n\t\tisDirty,\n\t\thasOtherEntitiesChanges,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tisPublishSidebarOpened,\n\t\t\tisEditedPostPublishable,\n\t\t\tisCurrentPostPublished,\n\t\t\tisEditedPostDirty,\n\t\t\thasNonPostEntityChanges,\n\t\t} = select( editorStore );\n\t\tconst _hasOtherEntitiesChanges = hasNonPostEntityChanges();\n\t\treturn {\n\t\t\tpublishSidebarOpened: isPublishSidebarOpened(),\n\t\t\tisPublishable:\n\t\t\t\t! isCurrentPostPublished() && isEditedPostPublishable(),\n\t\t\tisDirty: _hasOtherEntitiesChanges || isEditedPostDirty(),\n\t\t\thasOtherEntitiesChanges: _hasOtherEntitiesChanges,\n\t\t};\n\t}, [] );\n\n\tconst openEntitiesSavedStates = useCallback(\n\t\t() => setEntitiesSavedStatesCallback( true ),\n\t\t[]\n\t);\n\n\t// It is ok for these components to be unmounted when not in visual use.\n\t// We don't want more than one present at a time, decide which to render.\n\tlet unmountableContent;\n\tif ( publishSidebarOpened ) {\n\t\tunmountableContent = (\n\t\t\t<PostPublishPanel\n\t\t\t\tonClose={ closePublishSidebar }\n\t\t\t\tforceIsDirty={ forceIsDirtyPublishPanel }\n\t\t\t\tPrePublishExtension={ PluginPrePublishPanel.Slot }\n\t\t\t\tPostPublishExtension={ PluginPostPublishPanel.Slot }\n\t\t\t/>\n\t\t);\n\t} else if ( isPublishable && ! hasOtherEntitiesChanges ) {\n\t\tunmountableContent = (\n\t\t\t<div className=\"editor-layout__toggle-publish-panel\">\n\t\t\t\t<Button\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tonClick={ togglePublishSidebar }\n\t\t\t\t\taria-expanded={ false }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Open publish panel' ) }\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t);\n\t} else {\n\t\tunmountableContent = (\n\t\t\t<div className=\"editor-layout__toggle-entities-saved-states-panel\">\n\t\t\t\t<Button\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tonClick={ openEntitiesSavedStates }\n\t\t\t\t\taria-expanded={ false }\n\t\t\t\t\tdisabled={ ! isDirty }\n\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Open save panel' ) }\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t);\n\t}\n\n\t// Since EntitiesSavedStates controls its own panel, we can keep it\n\t// always mounted to retain its own component state (such as checkboxes).\n\treturn (\n\t\t<>\n\t\t\t{ isEntitiesSavedStatesOpen && (\n\t\t\t\t<EntitiesSavedStates close={ closeEntitiesSavedStates } />\n\t\t\t) }\n\t\t\t<Slot bubblesVirtually />\n\t\t\t{ ! isEntitiesSavedStatesOpen && unmountableContent }\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,MAAM,EAAEC,cAAc,QAAQ,uBAAuB;AAC9D,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,QAAQ,oBAAoB;;AAEhD;AACA;AACA;AACA,OAAOC,mBAAmB,MAAM,0BAA0B;AAC1D,OAAOC,gBAAgB,MAAM,uBAAuB;AACpD,OAAOC,qBAAqB,MAAM,6BAA6B;AAC/D,OAAOC,sBAAsB,MAAM,8BAA8B;AACjE,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA
|
|
1
|
+
{"version":3,"names":["useSelect","useDispatch","Button","createSlotFill","__","useCallback","EntitiesSavedStates","PostPublishPanel","PluginPrePublishPanel","PluginPostPublishPanel","store","editorStore","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","Fill","Slot","ActionsPanelFill","SavePublishPanels","setEntitiesSavedStatesCallback","closeEntitiesSavedStates","isEntitiesSavedStatesOpen","forceIsDirtyPublishPanel","closePublishSidebar","togglePublishSidebar","publishSidebarOpened","isPublishable","isDirty","hasOtherEntitiesChanges","select","isPublishSidebarOpened","isEditedPostPublishable","isCurrentPostPublished","isEditedPostDirty","hasNonPostEntityChanges","_hasOtherEntitiesChanges","openEntitiesSavedStates","unmountableContent","onClose","forceIsDirty","PrePublishExtension","PostPublishExtension","className","children","__next40pxDefaultSize","variant","onClick","disabled","accessibleWhenDisabled","close","bubblesVirtually"],"sources":["@wordpress/editor/src/components/save-publish-panels/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Button, createSlotFill } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport EntitiesSavedStates from '../entities-saved-states';\nimport PostPublishPanel from '../post-publish-panel';\nimport PluginPrePublishPanel from '../plugin-pre-publish-panel';\nimport PluginPostPublishPanel from '../plugin-post-publish-panel';\nimport { store as editorStore } from '../../store';\n\nconst { Fill, Slot } = createSlotFill( 'ActionsPanel' );\n\nexport const ActionsPanelFill = Fill;\n\nexport default function SavePublishPanels( {\n\tsetEntitiesSavedStatesCallback,\n\tcloseEntitiesSavedStates,\n\tisEntitiesSavedStatesOpen,\n\tforceIsDirtyPublishPanel,\n} ) {\n\tconst { closePublishSidebar, togglePublishSidebar } =\n\t\tuseDispatch( editorStore );\n\tconst {\n\t\tpublishSidebarOpened,\n\t\tisPublishable,\n\t\tisDirty,\n\t\thasOtherEntitiesChanges,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tisPublishSidebarOpened,\n\t\t\tisEditedPostPublishable,\n\t\t\tisCurrentPostPublished,\n\t\t\tisEditedPostDirty,\n\t\t\thasNonPostEntityChanges,\n\t\t} = select( editorStore );\n\t\tconst _hasOtherEntitiesChanges = hasNonPostEntityChanges();\n\t\treturn {\n\t\t\tpublishSidebarOpened: isPublishSidebarOpened(),\n\t\t\tisPublishable:\n\t\t\t\t! isCurrentPostPublished() && isEditedPostPublishable(),\n\t\t\tisDirty: _hasOtherEntitiesChanges || isEditedPostDirty(),\n\t\t\thasOtherEntitiesChanges: _hasOtherEntitiesChanges,\n\t\t};\n\t}, [] );\n\n\tconst openEntitiesSavedStates = useCallback(\n\t\t() => setEntitiesSavedStatesCallback( true ),\n\t\t[]\n\t);\n\n\t// It is ok for these components to be unmounted when not in visual use.\n\t// We don't want more than one present at a time, decide which to render.\n\tlet unmountableContent;\n\tif ( publishSidebarOpened ) {\n\t\tunmountableContent = (\n\t\t\t<PostPublishPanel\n\t\t\t\tonClose={ closePublishSidebar }\n\t\t\t\tforceIsDirty={ forceIsDirtyPublishPanel }\n\t\t\t\tPrePublishExtension={ PluginPrePublishPanel.Slot }\n\t\t\t\tPostPublishExtension={ PluginPostPublishPanel.Slot }\n\t\t\t/>\n\t\t);\n\t} else if ( isPublishable && ! hasOtherEntitiesChanges ) {\n\t\tunmountableContent = (\n\t\t\t<div className=\"editor-layout__toggle-publish-panel\">\n\t\t\t\t<Button\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tonClick={ togglePublishSidebar }\n\t\t\t\t\taria-expanded={ false }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Open publish panel' ) }\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t);\n\t} else {\n\t\tunmountableContent = (\n\t\t\t<div className=\"editor-layout__toggle-entities-saved-states-panel\">\n\t\t\t\t<Button\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tonClick={ openEntitiesSavedStates }\n\t\t\t\t\taria-expanded={ false }\n\t\t\t\t\tdisabled={ ! isDirty }\n\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Open save panel' ) }\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t);\n\t}\n\n\t// Since EntitiesSavedStates controls its own panel, we can keep it\n\t// always mounted to retain its own component state (such as checkboxes).\n\treturn (\n\t\t<>\n\t\t\t{ isEntitiesSavedStatesOpen && (\n\t\t\t\t<EntitiesSavedStates close={ closeEntitiesSavedStates } />\n\t\t\t) }\n\t\t\t<Slot bubblesVirtually />\n\t\t\t{ ! isEntitiesSavedStatesOpen && unmountableContent }\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,MAAM,EAAEC,cAAc,QAAQ,uBAAuB;AAC9D,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,QAAQ,oBAAoB;;AAEhD;AACA;AACA;AACA,OAAOC,mBAAmB,MAAM,0BAA0B;AAC1D,OAAOC,gBAAgB,MAAM,uBAAuB;AACpD,OAAOC,qBAAqB,MAAM,6BAA6B;AAC/D,OAAOC,sBAAsB,MAAM,8BAA8B;AACjE,SAASC,KAAK,IAAIC,WAAW,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AGnC,qBAAqB,CAACW,IAAM;MAClDyB,oBAAoB,EAAGnC,sBAAsB,CAACU;IAAM,CACpD,CACD;EACF,CAAC,MAAM,IAAKU,aAAa,IAAI,CAAEE,uBAAuB,EAAG;IACxDS,kBAAkB,gBACjB3B,IAAA;MAAKgC,SAAS,EAAC,qCAAqC;MAAAC,QAAA,eACnDjC,IAAA,CAACX,MAAM;QACN6C,qBAAqB;QACrBC,OAAO,EAAC,WAAW;QACnBC,OAAO,EAAGtB,oBAAsB;QAChC,iBAAgB,KAAO;QAAAmB,QAAA,EAErB1C,EAAE,CAAE,oBAAqB;MAAC,CACrB;IAAC,CACL,CACL;EACF,CAAC,MAAM;IACNoC,kBAAkB,gBACjB3B,IAAA;MAAKgC,SAAS,EAAC,mDAAmD;MAAAC,QAAA,eACjEjC,IAAA,CAACX,MAAM;QACN6C,qBAAqB;QACrBC,OAAO,EAAC,WAAW;QACnBC,OAAO,EAAGV,uBAAyB;QACnC,iBAAgB,KAAO;QACvBW,QAAQ,EAAG,CAAEpB,OAAS;QACtBqB,sBAAsB;QAAAL,QAAA,EAEpB1C,EAAE,CAAE,iBAAkB;MAAC,CAClB;IAAC,CACL,CACL;EACF;;EAEA;EACA;EACA,oBACCa,KAAA,CAAAF,SAAA;IAAA+B,QAAA,GACGtB,yBAAyB,iBAC1BX,IAAA,CAACP,mBAAmB;MAAC8C,KAAK,EAAG7B;IAA0B,CAAE,CACzD,eACDV,IAAA,CAACM,IAAI;MAACkC,gBAAgB;IAAA,CAAE,CAAC,EACvB,CAAE7B,yBAAyB,IAAIgB,kBAAkB;EAAA,CAClD,CAAC;AAEL","ignoreList":[]}
|
|
@@ -12,8 +12,7 @@ import { forwardRef } from '@wordpress/element';
|
|
|
12
12
|
import { store as editorStore } from '../../store';
|
|
13
13
|
import { unlock } from '../../lock-unlock';
|
|
14
14
|
import { sidebars } from './constants';
|
|
15
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
16
|
const {
|
|
18
17
|
Tabs
|
|
19
18
|
} = unlock(componentsPrivateApis);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["privateApis","componentsPrivateApis","__","_x","useSelect","forwardRef","store","editorStore","unlock","sidebars","jsx","_jsx","jsxs","_jsxs","Tabs","SidebarHeader","_","ref","documentLabel","select","getPostTypeLabel","TabList","children","Tab","tabId","document","block"],"sources":["@wordpress/editor/src/components/sidebar/header.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\nimport { __, _x } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport { sidebars } from './constants';\n\nconst { Tabs } = unlock( componentsPrivateApis );\n\nconst SidebarHeader = ( _, ref ) => {\n\tconst { documentLabel } = useSelect( ( select ) => {\n\t\tconst { getPostTypeLabel } = select( editorStore );\n\n\t\treturn {\n\t\t\t// translators: Default label for the Document sidebar tab, not selected.\n\t\t\tdocumentLabel: getPostTypeLabel() || _x( 'Document', 'noun' ),\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<Tabs.TabList ref={ ref }>\n\t\t\t<Tabs.Tab\n\t\t\t\ttabId={ sidebars.document }\n\t\t\t\t// Used for focus management in the SettingsSidebar component.\n\t\t\t\tdata-tab-id={ sidebars.document }\n\t\t\t>\n\t\t\t\t{ documentLabel }\n\t\t\t</Tabs.Tab>\n\t\t\t<Tabs.Tab\n\t\t\t\ttabId={ sidebars.block }\n\t\t\t\t// Used for focus management in the SettingsSidebar component.\n\t\t\t\tdata-tab-id={ sidebars.block }\n\t\t\t>\n\t\t\t\t{ /* translators: Text label for the Block Settings Sidebar tab. */ }\n\t\t\t\t{ __( 'Block' ) }\n\t\t\t</Tabs.Tab>\n\t\t</Tabs.TabList>\n\t);\n};\n\nexport default forwardRef( SidebarHeader );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,qBAAqB,QAAQ,uBAAuB;AAC5E,SAASC,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;AACxC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,UAAU,QAAQ,oBAAoB;;AAE/C;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAClD,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,QAAQ,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA
|
|
1
|
+
{"version":3,"names":["privateApis","componentsPrivateApis","__","_x","useSelect","forwardRef","store","editorStore","unlock","sidebars","jsx","_jsx","jsxs","_jsxs","Tabs","SidebarHeader","_","ref","documentLabel","select","getPostTypeLabel","TabList","children","Tab","tabId","document","block"],"sources":["@wordpress/editor/src/components/sidebar/header.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\nimport { __, _x } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport { sidebars } from './constants';\n\nconst { Tabs } = unlock( componentsPrivateApis );\n\nconst SidebarHeader = ( _, ref ) => {\n\tconst { documentLabel } = useSelect( ( select ) => {\n\t\tconst { getPostTypeLabel } = select( editorStore );\n\n\t\treturn {\n\t\t\t// translators: Default label for the Document sidebar tab, not selected.\n\t\t\tdocumentLabel: getPostTypeLabel() || _x( 'Document', 'noun' ),\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<Tabs.TabList ref={ ref }>\n\t\t\t<Tabs.Tab\n\t\t\t\ttabId={ sidebars.document }\n\t\t\t\t// Used for focus management in the SettingsSidebar component.\n\t\t\t\tdata-tab-id={ sidebars.document }\n\t\t\t>\n\t\t\t\t{ documentLabel }\n\t\t\t</Tabs.Tab>\n\t\t\t<Tabs.Tab\n\t\t\t\ttabId={ sidebars.block }\n\t\t\t\t// Used for focus management in the SettingsSidebar component.\n\t\t\t\tdata-tab-id={ sidebars.block }\n\t\t\t>\n\t\t\t\t{ /* translators: Text label for the Block Settings Sidebar tab. */ }\n\t\t\t\t{ __( 'Block' ) }\n\t\t\t</Tabs.Tab>\n\t\t</Tabs.TabList>\n\t);\n};\n\nexport default forwardRef( SidebarHeader );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,qBAAqB,QAAQ,uBAAuB;AAC5E,SAASC,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;AACxC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,UAAU,QAAQ,oBAAoB;;AAE/C;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAClD,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,QAAQ,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEvC,MAAM;EAAEC;AAAK,CAAC,GAAGN,MAAM,CAAEP,qBAAsB,CAAC;AAEhD,MAAMc,aAAa,GAAGA,CAAEC,CAAC,EAAEC,GAAG,KAAM;EACnC,MAAM;IAAEC;EAAc,CAAC,GAAGd,SAAS,CAAIe,MAAM,IAAM;IAClD,MAAM;MAAEC;IAAiB,CAAC,GAAGD,MAAM,CAAEZ,WAAY,CAAC;IAElD,OAAO;MACN;MACAW,aAAa,EAAEE,gBAAgB,CAAC,CAAC,IAAIjB,EAAE,CAAE,UAAU,EAAE,MAAO;IAC7D,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,oBACCU,KAAA,CAACC,IAAI,CAACO,OAAO;IAACJ,GAAG,EAAGA,GAAK;IAAAK,QAAA,gBACxBX,IAAA,CAACG,IAAI,CAACS,GAAG;MACRC,KAAK,EAAGf,QAAQ,CAACgB;MACjB;MAAA;MACA,eAAchB,QAAQ,CAACgB,QAAU;MAAAH,QAAA,EAE/BJ;IAAa,CACN,CAAC,eACXP,IAAA,CAACG,IAAI,CAACS,GAAG;MACRC,KAAK,EAAGf,QAAQ,CAACiB;MACjB;MAAA;MACA,eAAcjB,QAAQ,CAACiB,KAAO;MAAAJ,QAAA,EAG5BpB,EAAE,CAAE,OAAQ;IAAC,CACN,CAAC;EAAA,CACE,CAAC;AAEjB,CAAC;AAED,eAAeG,UAAU,CAAEU,aAAc,CAAC","ignoreList":[]}
|
|
@@ -27,8 +27,7 @@ import { sidebars } from './constants';
|
|
|
27
27
|
import { unlock } from '../../lock-unlock';
|
|
28
28
|
import { store as editorStore } from '../../store';
|
|
29
29
|
import { NAVIGATION_POST_TYPE, TEMPLATE_PART_POST_TYPE, TEMPLATE_POST_TYPE } from '../../store/constants';
|
|
30
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
31
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
30
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
32
31
|
const {
|
|
33
32
|
Tabs
|
|
34
33
|
} = unlock(componentsPrivateApis);
|