@wordpress/editor 14.17.1 → 14.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/bindings/pattern-overrides.js +0 -1
- package/build/bindings/pattern-overrides.js.map +1 -1
- package/build/bindings/post-meta.js +0 -1
- package/build/bindings/post-meta.js.map +1 -1
- package/build/components/autocompleters/user.js +0 -1
- package/build/components/autocompleters/user.js.map +1 -1
- package/build/components/block-removal-warnings/index.js +0 -1
- package/build/components/block-removal-warnings/index.js.map +1 -1
- package/build/components/block-settings-menu/content-only-settings-menu.js +0 -1
- package/build/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
- package/build/components/block-settings-menu/plugin-block-settings-menu-item.js +0 -1
- package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
- package/build/components/collab-sidebar/comments.js +0 -1
- package/build/components/collab-sidebar/comments.js.map +1 -1
- package/build/components/collab-sidebar/index.js +0 -1
- package/build/components/collab-sidebar/index.js.map +1 -1
- package/build/components/collab-sidebar/utils.js +0 -1
- package/build/components/collab-sidebar/utils.js.map +1 -1
- package/build/components/deprecated.js +0 -1
- package/build/components/deprecated.js.map +1 -1
- package/build/components/document-outline/index.js +0 -1
- package/build/components/document-outline/index.js.map +1 -1
- package/build/components/editor/index.js +9 -5
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor-help/index.native.js +0 -1
- package/build/components/editor-help/index.native.js.map +1 -1
- package/build/components/editor-notices/index.js +0 -1
- package/build/components/editor-notices/index.js.map +1 -1
- package/build/components/editor-snackbars/index.js +0 -1
- package/build/components/editor-snackbars/index.js.map +1 -1
- package/build/components/entities-saved-states/entity-type-list.js +0 -1
- package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
- package/build/components/entities-saved-states/hooks/use-is-dirty.js +0 -1
- package/build/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
- package/build/components/entities-saved-states/index.js +0 -1
- package/build/components/entities-saved-states/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +0 -1
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/shortcut.js +0 -1
- package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build/components/list-view-sidebar/index.js +0 -1
- package/build/components/list-view-sidebar/index.js.map +1 -1
- package/build/components/local-autosave-monitor/index.js +0 -1
- package/build/components/local-autosave-monitor/index.js.map +1 -1
- package/build/components/mode-switcher/index.js +0 -1
- package/build/components/mode-switcher/index.js.map +1 -1
- package/build/components/page-attributes/parent.js +8 -5
- package/build/components/page-attributes/parent.js.map +1 -1
- package/build/components/post-actions/actions.js +0 -1
- package/build/components/post-actions/actions.js.map +1 -1
- package/build/components/post-actions/index.js +0 -1
- package/build/components/post-actions/index.js.map +1 -1
- package/build/components/post-author/check.js +3 -4
- package/build/components/post-author/check.js.map +1 -1
- package/build/components/post-author/combobox.js +4 -2
- package/build/components/post-author/combobox.js.map +1 -1
- package/build/components/post-author/hook.js +8 -5
- package/build/components/post-author/hook.js.map +1 -1
- package/build/components/post-fields/index.js +0 -1
- package/build/components/post-fields/index.js.map +1 -1
- package/build/components/post-format/index.js +0 -1
- package/build/components/post-format/index.js.map +1 -1
- package/build/components/post-format/panel.js +0 -1
- package/build/components/post-format/panel.js.map +1 -1
- package/build/components/post-publish-button/index.js +0 -1
- package/build/components/post-publish-button/index.js.map +1 -1
- package/build/components/post-publish-panel/maybe-category-panel.js +2 -4
- package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-post-format-panel.js +0 -1
- package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-tags-panel.js +1 -1
- package/build/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-upload-media.js +0 -1
- package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
- package/build/components/post-publish-panel/media-util.js +0 -1
- package/build/components/post-publish-panel/media-util.js.map +1 -1
- package/build/components/post-saved-state/index.js +0 -1
- package/build/components/post-saved-state/index.js.map +1 -1
- package/build/components/post-schedule/index.js +0 -1
- package/build/components/post-schedule/index.js.map +1 -1
- package/build/components/post-taxonomies/check.js +1 -1
- package/build/components/post-taxonomies/check.js.map +1 -1
- package/build/components/post-taxonomies/flat-term-selector.js +2 -3
- package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/hierarchical-term-selector.js +2 -3
- package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/index.js +1 -2
- package/build/components/post-taxonomies/index.js.map +1 -1
- package/build/components/post-taxonomies/most-used-terms.js +0 -1
- package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
- package/build/components/post-template/classic-theme.js +0 -1
- package/build/components/post-template/classic-theme.js.map +1 -1
- package/build/components/post-template/swap-template-button.js +0 -1
- package/build/components/post-template/swap-template-button.js.map +1 -1
- package/build/components/post-transform-panel/hooks.js +0 -1
- package/build/components/post-transform-panel/hooks.js.map +1 -1
- package/build/components/post-type-support-check/index.js +0 -1
- package/build/components/post-type-support-check/index.js.map +1 -1
- package/build/components/preferences-modal/block-visibility.js +0 -1
- package/build/components/preferences-modal/block-visibility.js.map +1 -1
- package/build/components/preferences-modal/index.js +0 -1
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/provider/disable-non-page-content-blocks.js +0 -1
- package/build/components/provider/disable-non-page-content-blocks.js.map +1 -1
- package/build/components/provider/index.js +0 -1
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/index.native.js +0 -1
- package/build/components/provider/index.native.js.map +1 -1
- package/build/components/provider/use-block-editor-settings.js +0 -1
- package/build/components/provider/use-block-editor-settings.js.map +1 -1
- package/build/components/sidebar/index.js +0 -1
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/start-template-options/index.js +0 -1
- package/build/components/start-template-options/index.js.map +1 -1
- package/build/components/template-part-content-panel/index.js +0 -1
- package/build/components/template-part-content-panel/index.js.map +1 -1
- package/build/components/theme-support-check/index.js +0 -1
- package/build/components/theme-support-check/index.js.map +1 -1
- package/build/components/visual-editor/use-select-nearest-editable-block.js +0 -1
- package/build/components/visual-editor/use-select-nearest-editable-block.js.map +1 -1
- package/build/dataviews/store/private-actions.js +0 -1
- package/build/dataviews/store/private-actions.js.map +1 -1
- package/build/dataviews/store/reducer.js +0 -1
- package/build/dataviews/store/reducer.js.map +1 -1
- package/build/hooks/custom-sources-backwards-compatibility.js +0 -1
- package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
- package/build/hooks/pattern-overrides.js +0 -1
- package/build/hooks/pattern-overrides.js.map +1 -1
- package/build/store/actions.js +0 -1
- package/build/store/actions.js.map +1 -1
- package/build/store/private-actions.js +0 -1
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +0 -1
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +0 -1
- package/build/store/reducer.js.map +1 -1
- package/build/store/reducer.native.js +0 -1
- package/build/store/reducer.native.js.map +1 -1
- package/build/store/selectors.js +0 -1
- package/build/store/selectors.js.map +1 -1
- package/build/utils/get-template-info.js +0 -1
- package/build/utils/get-template-info.js.map +1 -1
- package/build/utils/terms.js +0 -1
- package/build/utils/terms.js.map +1 -1
- package/build-module/bindings/pattern-overrides.js +0 -1
- package/build-module/bindings/pattern-overrides.js.map +1 -1
- package/build-module/bindings/post-meta.js +0 -1
- package/build-module/bindings/post-meta.js.map +1 -1
- package/build-module/components/autocompleters/user.js +0 -1
- package/build-module/components/autocompleters/user.js.map +1 -1
- package/build-module/components/block-removal-warnings/index.js +0 -1
- package/build-module/components/block-removal-warnings/index.js.map +1 -1
- package/build-module/components/block-settings-menu/content-only-settings-menu.js +0 -1
- package/build-module/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
- package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +0 -1
- package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
- package/build-module/components/collab-sidebar/comments.js +0 -1
- package/build-module/components/collab-sidebar/comments.js.map +1 -1
- package/build-module/components/collab-sidebar/index.js +0 -1
- package/build-module/components/collab-sidebar/index.js.map +1 -1
- package/build-module/components/collab-sidebar/utils.js +0 -1
- package/build-module/components/collab-sidebar/utils.js.map +1 -1
- package/build-module/components/deprecated.js +0 -1
- package/build-module/components/deprecated.js.map +1 -1
- package/build-module/components/document-outline/index.js +0 -1
- package/build-module/components/document-outline/index.js.map +1 -1
- package/build-module/components/editor/index.js +9 -5
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor-help/index.native.js +0 -1
- package/build-module/components/editor-help/index.native.js.map +1 -1
- package/build-module/components/editor-notices/index.js +0 -1
- package/build-module/components/editor-notices/index.js.map +1 -1
- package/build-module/components/editor-snackbars/index.js +0 -1
- package/build-module/components/editor-snackbars/index.js.map +1 -1
- package/build-module/components/entities-saved-states/entity-type-list.js +0 -1
- package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
- package/build-module/components/entities-saved-states/hooks/use-is-dirty.js +0 -1
- package/build-module/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
- package/build-module/components/entities-saved-states/index.js +0 -1
- package/build-module/components/entities-saved-states/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +0 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +0 -1
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build-module/components/list-view-sidebar/index.js +0 -1
- package/build-module/components/list-view-sidebar/index.js.map +1 -1
- package/build-module/components/local-autosave-monitor/index.js +0 -1
- package/build-module/components/local-autosave-monitor/index.js.map +1 -1
- package/build-module/components/mode-switcher/index.js +0 -1
- package/build-module/components/mode-switcher/index.js.map +1 -1
- package/build-module/components/page-attributes/parent.js +8 -5
- package/build-module/components/page-attributes/parent.js.map +1 -1
- package/build-module/components/post-actions/actions.js +0 -1
- package/build-module/components/post-actions/actions.js.map +1 -1
- package/build-module/components/post-actions/index.js +0 -1
- package/build-module/components/post-actions/index.js.map +1 -1
- package/build-module/components/post-author/check.js +3 -4
- package/build-module/components/post-author/check.js.map +1 -1
- package/build-module/components/post-author/combobox.js +4 -2
- package/build-module/components/post-author/combobox.js.map +1 -1
- package/build-module/components/post-author/hook.js +8 -5
- package/build-module/components/post-author/hook.js.map +1 -1
- package/build-module/components/post-fields/index.js +0 -1
- package/build-module/components/post-fields/index.js.map +1 -1
- package/build-module/components/post-format/index.js +0 -1
- package/build-module/components/post-format/index.js.map +1 -1
- package/build-module/components/post-format/panel.js +0 -1
- package/build-module/components/post-format/panel.js.map +1 -1
- package/build-module/components/post-publish-button/index.js +0 -1
- package/build-module/components/post-publish-button/index.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-category-panel.js +2 -4
- 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 +0 -1
- 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 -1
- 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 +0 -1
- package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
- package/build-module/components/post-publish-panel/media-util.js +0 -1
- package/build-module/components/post-publish-panel/media-util.js.map +1 -1
- package/build-module/components/post-saved-state/index.js +0 -1
- package/build-module/components/post-saved-state/index.js.map +1 -1
- package/build-module/components/post-schedule/index.js +0 -1
- package/build-module/components/post-schedule/index.js.map +1 -1
- package/build-module/components/post-taxonomies/check.js +1 -1
- package/build-module/components/post-taxonomies/check.js.map +1 -1
- package/build-module/components/post-taxonomies/flat-term-selector.js +2 -3
- package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js +2 -3
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/index.js +1 -2
- package/build-module/components/post-taxonomies/index.js.map +1 -1
- package/build-module/components/post-taxonomies/most-used-terms.js +0 -1
- package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
- package/build-module/components/post-template/classic-theme.js +0 -1
- package/build-module/components/post-template/classic-theme.js.map +1 -1
- package/build-module/components/post-template/swap-template-button.js +0 -1
- package/build-module/components/post-template/swap-template-button.js.map +1 -1
- package/build-module/components/post-transform-panel/hooks.js +0 -1
- package/build-module/components/post-transform-panel/hooks.js.map +1 -1
- package/build-module/components/post-type-support-check/index.js +0 -1
- package/build-module/components/post-type-support-check/index.js.map +1 -1
- package/build-module/components/preferences-modal/block-visibility.js +0 -1
- package/build-module/components/preferences-modal/block-visibility.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +0 -1
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/provider/disable-non-page-content-blocks.js +0 -1
- package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -1
- package/build-module/components/provider/index.js +0 -1
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/provider/index.native.js +0 -1
- package/build-module/components/provider/index.native.js.map +1 -1
- package/build-module/components/provider/use-block-editor-settings.js +0 -1
- package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
- package/build-module/components/sidebar/index.js +0 -1
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/start-template-options/index.js +0 -1
- package/build-module/components/start-template-options/index.js.map +1 -1
- package/build-module/components/template-part-content-panel/index.js +0 -1
- package/build-module/components/template-part-content-panel/index.js.map +1 -1
- package/build-module/components/theme-support-check/index.js +0 -1
- package/build-module/components/theme-support-check/index.js.map +1 -1
- package/build-module/components/visual-editor/use-select-nearest-editable-block.js +0 -1
- package/build-module/components/visual-editor/use-select-nearest-editable-block.js.map +1 -1
- package/build-module/dataviews/store/private-actions.js +0 -1
- package/build-module/dataviews/store/private-actions.js.map +1 -1
- package/build-module/dataviews/store/reducer.js +0 -1
- package/build-module/dataviews/store/reducer.js.map +1 -1
- package/build-module/hooks/custom-sources-backwards-compatibility.js +0 -1
- package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
- package/build-module/hooks/pattern-overrides.js +0 -1
- package/build-module/hooks/pattern-overrides.js.map +1 -1
- package/build-module/store/actions.js +0 -1
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/private-actions.js +0 -1
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +0 -1
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +0 -1
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/reducer.native.js +0 -1
- package/build-module/store/reducer.native.js.map +1 -1
- package/build-module/store/selectors.js +0 -1
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/get-template-info.js +0 -1
- package/build-module/utils/get-template-info.js.map +1 -1
- package/build-module/utils/terms.js +0 -1
- package/build-module/utils/terms.js.map +1 -1
- package/build-types/components/editor/index.d.ts.map +1 -1
- package/build-types/components/page-attributes/parent.d.ts.map +1 -1
- package/build-types/components/post-author/check.d.ts.map +1 -1
- package/build-types/components/post-author/combobox.d.ts.map +1 -1
- package/build-types/components/post-author/hook.d.ts +1 -0
- package/build-types/components/post-author/hook.d.ts.map +1 -1
- package/build-types/components/post-publish-panel/maybe-category-panel.d.ts.map +1 -1
- package/build-types/components/post-publish-panel/maybe-tags-panel.d.ts.map +1 -1
- package/build-types/components/post-taxonomies/check.d.ts.map +1 -1
- package/build-types/components/post-taxonomies/flat-term-selector.d.ts.map +1 -1
- package/build-types/components/post-taxonomies/index.d.ts.map +1 -1
- package/build-types/components/post-template/hooks.d.ts +1 -1
- package/build-types/components/post-template/hooks.d.ts.map +1 -1
- package/package.json +37 -37
- package/src/components/editor/index.js +24 -13
- package/src/components/page-attributes/parent.js +55 -38
- package/src/components/post-author/check.js +7 -4
- package/src/components/post-author/combobox.js +3 -1
- package/src/components/post-author/hook.js +4 -3
- package/src/components/post-publish-panel/maybe-category-panel.js +6 -2
- package/src/components/post-publish-panel/maybe-tags-panel.js +5 -1
- package/src/components/post-taxonomies/check.js +5 -3
- package/src/components/post-taxonomies/flat-term-selector.js +2 -2
- package/src/components/post-taxonomies/hierarchical-term-selector.js +2 -2
- package/src/components/post-taxonomies/index.js +5 -1
- package/src/components/post-taxonomies/test/index.js +32 -18
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","useViewportMatch","useSelect","useDispatch","useMemo","store","preferencesStore","privateApis","preferencesPrivateApis","interfaceStore","EnablePanelOption","EnablePluginDocumentSettingPanelOption","EnablePublishSidebarOption","BlockVisibility","PostTaxonomies","PostFeaturedImageCheck","PostExcerptCheck","PageAttributesCheck","PostTypeSupportCheck","editorStore","unlock","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","PreferencesModal","PreferencesModalTabs","PreferencesModalSection","PreferenceToggleControl","EditorPreferencesModal","extraSections","isActive","select","isModalActive","closeModal","children","PreferencesModalContents","isLargeViewport","showBlockBreadcrumbsOption","getEditorSettings","get","isRichEditingEnabled","richEditingEnabled","isDistractionFreeEnabled","setIsListViewOpened","setIsInserterOpened","set","setPreference","sections","name","tabLabel","content","title","scope","featureName","help","label","description","Slot","taxonomyWrapper","taxonomy","labels","menu_name","panelName","slug","supportKeys","general","onToggle","appearance","window","__experimentalMediaProcessing","filter","Boolean"],"sources":["@wordpress/editor/src/components/preferences-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\n\nimport { __ } from '@wordpress/i18n';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport {\n\tstore as preferencesStore,\n\tprivateApis as preferencesPrivateApis,\n} from '@wordpress/preferences';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport EnablePanelOption from './enable-panel';\nimport EnablePluginDocumentSettingPanelOption from './enable-plugin-document-setting-panel';\nimport EnablePublishSidebarOption from './enable-publish-sidebar';\nimport BlockVisibility from './block-visibility';\nimport PostTaxonomies from '../post-taxonomies';\nimport PostFeaturedImageCheck from '../post-featured-image/check';\nimport PostExcerptCheck from '../post-excerpt/check';\nimport PageAttributesCheck from '../page-attributes/check';\nimport PostTypeSupportCheck from '../post-type-support-check';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst {\n\tPreferencesModal,\n\tPreferencesModalTabs,\n\tPreferencesModalSection,\n\tPreferenceToggleControl,\n} = unlock( preferencesPrivateApis );\n\nexport default function EditorPreferencesModal( { extraSections = {} } ) {\n\tconst isActive = useSelect( ( select ) => {\n\t\treturn select( interfaceStore ).isModalActive( 'editor/preferences' );\n\t}, [] );\n\tconst { closeModal } = useDispatch( interfaceStore );\n\n\tif ( ! isActive ) {\n\t\treturn null;\n\t}\n\n\t// Please wrap all contents inside PreferencesModalContents to prevent all\n\t// hooks from executing when the modal is not open.\n\treturn (\n\t\t<PreferencesModal closeModal={ closeModal }>\n\t\t\t<PreferencesModalContents extraSections={ extraSections } />\n\t\t</PreferencesModal>\n\t);\n}\n\nfunction PreferencesModalContents( { extraSections = {} } ) {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst showBlockBreadcrumbsOption = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditorSettings } = select( editorStore );\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst isRichEditingEnabled = getEditorSettings().richEditingEnabled;\n\t\t\tconst isDistractionFreeEnabled = get( 'core', 'distractionFree' );\n\t\t\treturn (\n\t\t\t\t! isDistractionFreeEnabled &&\n\t\t\t\tisLargeViewport &&\n\t\t\t\tisRichEditingEnabled\n\t\t\t);\n\t\t},\n\t\t[ isLargeViewport ]\n\t);\n\tconst { setIsListViewOpened, setIsInserterOpened } =\n\t\tuseDispatch( editorStore );\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst sections = useMemo(\n\t\t() =>\n\t\t\t[\n\t\t\t\t{\n\t\t\t\t\tname: 'general',\n\t\t\t\t\ttabLabel: __( 'General' ),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Interface' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"showListViewByDefault\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Opens the List View sidebar by default.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Always open List View' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t{ showBlockBreadcrumbsOption && (\n\t\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\t\tfeatureName=\"showBlockBreadcrumbs\"\n\t\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t\t'Display the block hierarchy trail at the bottom of the editor.'\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Show block breadcrumbs' ) }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"allowRightClickOverrides\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Allows contextual List View menus via right-click, overriding browser defaults.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t'Allow right-click contextual menus'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"enableChoosePatternModal\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Shows starter patterns when creating a new page.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Show starter patterns' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Document settings' ) }\n\t\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\t'Select what settings are shown in the document panel.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<EnablePluginDocumentSettingPanelOption.Slot />\n\t\t\t\t\t\t\t\t<PostTaxonomies\n\t\t\t\t\t\t\t\t\ttaxonomyWrapper={ ( content, taxonomy ) => (\n\t\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\t\tlabel={ taxonomy.labels.menu_name }\n\t\t\t\t\t\t\t\t\t\t\tpanelName={ `taxonomy-panel-${ taxonomy.slug }` }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<PostFeaturedImageCheck>\n\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Featured image' ) }\n\t\t\t\t\t\t\t\t\t\tpanelName=\"featured-image\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</PostFeaturedImageCheck>\n\t\t\t\t\t\t\t\t<PostExcerptCheck>\n\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Excerpt' ) }\n\t\t\t\t\t\t\t\t\t\tpanelName=\"post-excerpt\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</PostExcerptCheck>\n\t\t\t\t\t\t\t\t<PostTypeSupportCheck\n\t\t\t\t\t\t\t\t\tsupportKeys={ [ 'comments', 'trackbacks' ] }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Discussion' ) }\n\t\t\t\t\t\t\t\t\t\tpanelName=\"discussion-panel\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</PostTypeSupportCheck>\n\t\t\t\t\t\t\t\t<PageAttributesCheck>\n\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Page attributes' ) }\n\t\t\t\t\t\t\t\t\t\tpanelName=\"page-attributes\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</PageAttributesCheck>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\t\ttitle={ __( 'Publishing' ) }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<EnablePublishSidebarOption\n\t\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t\t'Review settings, such as visibility and tags.'\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t\t'Enable pre-publish checks'\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ extraSections?.general }\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'appearance',\n\t\t\t\t\ttabLabel: __( 'Appearance' ),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Appearance' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Customize the editor interface to suit your needs.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"fixedToolbar\"\n\t\t\t\t\t\t\t\tonToggle={ () =>\n\t\t\t\t\t\t\t\t\tsetPreference(\n\t\t\t\t\t\t\t\t\t\t'core',\n\t\t\t\t\t\t\t\t\t\t'distractionFree',\n\t\t\t\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Access all block and document tools in a single place.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Top toolbar' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"distractionFree\"\n\t\t\t\t\t\t\t\tonToggle={ () => {\n\t\t\t\t\t\t\t\t\tsetPreference(\n\t\t\t\t\t\t\t\t\t\t'core',\n\t\t\t\t\t\t\t\t\t\t'fixedToolbar',\n\t\t\t\t\t\t\t\t\t\ttrue\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tsetIsInserterOpened( false );\n\t\t\t\t\t\t\t\t\tsetIsListViewOpened( false );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Reduce visual distractions by hiding the toolbar and other elements to focus on writing.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Distraction free' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"focusMode\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Highlights the current block and fades other content.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ extraSections?.appearance }\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'accessibility',\n\t\t\t\t\ttabLabel: __( 'Accessibility' ),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Navigation' ) }\n\t\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\t'Optimize the editing experience for enhanced control.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"keepCaretInsideBlock\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Keeps the text cursor within blocks while navigating with arrow keys, preventing it from moving to other blocks and enhancing accessibility for keyboard users.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t'Contain text cursor inside block'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Interface' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"showIconLabels\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Show button text labels' ) }\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Show text instead of icons on buttons across the interface.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'blocks',\n\t\t\t\t\ttabLabel: __( 'Blocks' ),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<PreferencesModalSection title={ __( 'Inserter' ) }>\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"mostUsedBlocks\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Adds a category with the most frequently used blocks in the inserter.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Show most used blocks' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Manage block visibility' ) }\n\t\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\t\"Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later.\"\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<BlockVisibility />\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\twindow.__experimentalMediaProcessing && {\n\t\t\t\t\tname: 'media',\n\t\t\t\t\ttabLabel: __( 'Media' ),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'General' ) }\n\t\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\t'Customize options related to the media upload flow.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core/media\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"optimizeOnUpload\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Compress media items before uploading to the server.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Pre-upload compression' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core/media\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"requireApproval\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Require approval step when optimizing existing media.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Approval step' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t].filter( Boolean ),\n\t\t[\n\t\t\tshowBlockBreadcrumbsOption,\n\t\t\textraSections,\n\t\t\tsetIsInserterOpened,\n\t\t\tsetIsListViewOpened,\n\t\t\tsetPreference,\n\t\t\tisLargeViewport,\n\t\t]\n\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,eACCb,KAAA,CAACK,uBAAuB;QACvByB,KAAK,EAAGtD,EAAE,CAAE,SAAU,CAAG;QACzB2D,WAAW,EAAG3D,EAAE,CACf,qDACD,CAAG;QAAAqC,QAAA,gBAEHf,IAAA,CAACQ,uBAAuB;UACvByB,KAAK,EAAC,YAAY;UAClBC,WAAW,EAAC,kBAAkB;UAC9BC,IAAI,EAAGzD,EAAE,CACR,sDACD,CAAG;UACH0D,KAAK,EAAG1D,EAAE,CAAE,wBAAyB;QAAG,CACxC,CAAC,eACFsB,IAAA,CAACQ,uBAAuB;UACvByB,KAAK,EAAC,YAAY;UAClBC,WAAW,EAAC,iBAAiB;UAC7BC,IAAI,EAAGzD,EAAE,CACR,uDACD,CAAG;UACH0D,KAAK,EAAG1D,EAAE,CAAE,eAAgB;QAAG,CAC/B,CAAC;MAAA,CACsB;IAAC,CACzB;EAEJ,CAAC,CACD,CAACyE,MAAM,CAAEC,OAAQ,CAAC,EACpB,CACClC,0BAA0B,EAC1BR,aAAa,EACbe,mBAAmB,EACnBD,mBAAmB,EACnBG,aAAa,EACbV,eAAe,CAEjB,CAAC;EAED,oBAAOjB,IAAA,CAACM,oBAAoB;IAACsB,QAAQ,EAAGA;EAAU,CAAE,CAAC;AACtD","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["__","useViewportMatch","useSelect","useDispatch","useMemo","store","preferencesStore","privateApis","preferencesPrivateApis","interfaceStore","EnablePanelOption","EnablePluginDocumentSettingPanelOption","EnablePublishSidebarOption","BlockVisibility","PostTaxonomies","PostFeaturedImageCheck","PostExcerptCheck","PageAttributesCheck","PostTypeSupportCheck","editorStore","unlock","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","PreferencesModal","PreferencesModalTabs","PreferencesModalSection","PreferenceToggleControl","EditorPreferencesModal","extraSections","isActive","select","isModalActive","closeModal","children","PreferencesModalContents","isLargeViewport","showBlockBreadcrumbsOption","getEditorSettings","get","isRichEditingEnabled","richEditingEnabled","isDistractionFreeEnabled","setIsListViewOpened","setIsInserterOpened","set","setPreference","sections","name","tabLabel","content","title","scope","featureName","help","label","description","Slot","taxonomyWrapper","taxonomy","labels","menu_name","panelName","slug","supportKeys","general","onToggle","appearance","window","__experimentalMediaProcessing","filter","Boolean"],"sources":["@wordpress/editor/src/components/preferences-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\n\nimport { __ } from '@wordpress/i18n';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport {\n\tstore as preferencesStore,\n\tprivateApis as preferencesPrivateApis,\n} from '@wordpress/preferences';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport EnablePanelOption from './enable-panel';\nimport EnablePluginDocumentSettingPanelOption from './enable-plugin-document-setting-panel';\nimport EnablePublishSidebarOption from './enable-publish-sidebar';\nimport BlockVisibility from './block-visibility';\nimport PostTaxonomies from '../post-taxonomies';\nimport PostFeaturedImageCheck from '../post-featured-image/check';\nimport PostExcerptCheck from '../post-excerpt/check';\nimport PageAttributesCheck from '../page-attributes/check';\nimport PostTypeSupportCheck from '../post-type-support-check';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst {\n\tPreferencesModal,\n\tPreferencesModalTabs,\n\tPreferencesModalSection,\n\tPreferenceToggleControl,\n} = unlock( preferencesPrivateApis );\n\nexport default function EditorPreferencesModal( { extraSections = {} } ) {\n\tconst isActive = useSelect( ( select ) => {\n\t\treturn select( interfaceStore ).isModalActive( 'editor/preferences' );\n\t}, [] );\n\tconst { closeModal } = useDispatch( interfaceStore );\n\n\tif ( ! isActive ) {\n\t\treturn null;\n\t}\n\n\t// Please wrap all contents inside PreferencesModalContents to prevent all\n\t// hooks from executing when the modal is not open.\n\treturn (\n\t\t<PreferencesModal closeModal={ closeModal }>\n\t\t\t<PreferencesModalContents extraSections={ extraSections } />\n\t\t</PreferencesModal>\n\t);\n}\n\nfunction PreferencesModalContents( { extraSections = {} } ) {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst showBlockBreadcrumbsOption = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditorSettings } = select( editorStore );\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst isRichEditingEnabled = getEditorSettings().richEditingEnabled;\n\t\t\tconst isDistractionFreeEnabled = get( 'core', 'distractionFree' );\n\t\t\treturn (\n\t\t\t\t! isDistractionFreeEnabled &&\n\t\t\t\tisLargeViewport &&\n\t\t\t\tisRichEditingEnabled\n\t\t\t);\n\t\t},\n\t\t[ isLargeViewport ]\n\t);\n\tconst { setIsListViewOpened, setIsInserterOpened } =\n\t\tuseDispatch( editorStore );\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst sections = useMemo(\n\t\t() =>\n\t\t\t[\n\t\t\t\t{\n\t\t\t\t\tname: 'general',\n\t\t\t\t\ttabLabel: __( 'General' ),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Interface' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"showListViewByDefault\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Opens the List View sidebar by default.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Always open List View' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t{ showBlockBreadcrumbsOption && (\n\t\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\t\tfeatureName=\"showBlockBreadcrumbs\"\n\t\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t\t'Display the block hierarchy trail at the bottom of the editor.'\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Show block breadcrumbs' ) }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"allowRightClickOverrides\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Allows contextual List View menus via right-click, overriding browser defaults.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t'Allow right-click contextual menus'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"enableChoosePatternModal\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Shows starter patterns when creating a new page.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Show starter patterns' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Document settings' ) }\n\t\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\t'Select what settings are shown in the document panel.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<EnablePluginDocumentSettingPanelOption.Slot />\n\t\t\t\t\t\t\t\t<PostTaxonomies\n\t\t\t\t\t\t\t\t\ttaxonomyWrapper={ ( content, taxonomy ) => (\n\t\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\t\tlabel={ taxonomy.labels.menu_name }\n\t\t\t\t\t\t\t\t\t\t\tpanelName={ `taxonomy-panel-${ taxonomy.slug }` }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<PostFeaturedImageCheck>\n\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Featured image' ) }\n\t\t\t\t\t\t\t\t\t\tpanelName=\"featured-image\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</PostFeaturedImageCheck>\n\t\t\t\t\t\t\t\t<PostExcerptCheck>\n\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Excerpt' ) }\n\t\t\t\t\t\t\t\t\t\tpanelName=\"post-excerpt\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</PostExcerptCheck>\n\t\t\t\t\t\t\t\t<PostTypeSupportCheck\n\t\t\t\t\t\t\t\t\tsupportKeys={ [ 'comments', 'trackbacks' ] }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Discussion' ) }\n\t\t\t\t\t\t\t\t\t\tpanelName=\"discussion-panel\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</PostTypeSupportCheck>\n\t\t\t\t\t\t\t\t<PageAttributesCheck>\n\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Page attributes' ) }\n\t\t\t\t\t\t\t\t\t\tpanelName=\"page-attributes\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</PageAttributesCheck>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\t\ttitle={ __( 'Publishing' ) }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<EnablePublishSidebarOption\n\t\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t\t'Review settings, such as visibility and tags.'\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t\t'Enable pre-publish checks'\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ extraSections?.general }\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'appearance',\n\t\t\t\t\ttabLabel: __( 'Appearance' ),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Appearance' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Customize the editor interface to suit your needs.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"fixedToolbar\"\n\t\t\t\t\t\t\t\tonToggle={ () =>\n\t\t\t\t\t\t\t\t\tsetPreference(\n\t\t\t\t\t\t\t\t\t\t'core',\n\t\t\t\t\t\t\t\t\t\t'distractionFree',\n\t\t\t\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Access all block and document tools in a single place.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Top toolbar' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"distractionFree\"\n\t\t\t\t\t\t\t\tonToggle={ () => {\n\t\t\t\t\t\t\t\t\tsetPreference(\n\t\t\t\t\t\t\t\t\t\t'core',\n\t\t\t\t\t\t\t\t\t\t'fixedToolbar',\n\t\t\t\t\t\t\t\t\t\ttrue\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tsetIsInserterOpened( false );\n\t\t\t\t\t\t\t\t\tsetIsListViewOpened( false );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Reduce visual distractions by hiding the toolbar and other elements to focus on writing.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Distraction free' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tfeatureName=\"focusMode\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Highlights the current block and fades other content.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ extraSections?.appearance }\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'accessibility',\n\t\t\t\t\ttabLabel: __( 'Accessibility' ),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Navigation' ) }\n\t\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\t'Optimize the editing experience for enhanced control.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"keepCaretInsideBlock\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Keeps the text cursor within blocks while navigating with arrow keys, preventing it from moving to other blocks and enhancing accessibility for keyboard users.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t'Contain text cursor inside block'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Interface' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"showIconLabels\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Show button text labels' ) }\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Show text instead of icons on buttons across the interface.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'blocks',\n\t\t\t\t\ttabLabel: __( 'Blocks' ),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<PreferencesModalSection title={ __( 'Inserter' ) }>\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"mostUsedBlocks\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Adds a category with the most frequently used blocks in the inserter.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Show most used blocks' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Manage block visibility' ) }\n\t\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\t\"Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later.\"\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<BlockVisibility />\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\twindow.__experimentalMediaProcessing && {\n\t\t\t\t\tname: 'media',\n\t\t\t\t\ttabLabel: __( 'Media' ),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'General' ) }\n\t\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\t'Customize options related to the media upload flow.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core/media\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"optimizeOnUpload\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Compress media items before uploading to the server.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Pre-upload compression' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<PreferenceToggleControl\n\t\t\t\t\t\t\t\t\tscope=\"core/media\"\n\t\t\t\t\t\t\t\t\tfeatureName=\"requireApproval\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Require approval step when optimizing existing media.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Approval step' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t].filter( Boolean ),\n\t\t[\n\t\t\tshowBlockBreadcrumbsOption,\n\t\t\textraSections,\n\t\t\tsetIsInserterOpened,\n\t\t\tsetIsListViewOpened,\n\t\t\tsetPreference,\n\t\t\tisLargeViewport,\n\t\t]\n\t);\n\n\treturn <PreferencesModalTabs sections={ sections } />;\n}\n"],"mappings":"AAAA;AACA;AACA;;AAEA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SACCC,KAAK,IAAIC,gBAAgB,EACzBC,WAAW,IAAIC,sBAAsB,QAC/B,wBAAwB;AAC/B,SAASH,KAAK,IAAII,cAAc,QAAQ,sBAAsB;;AAE9D;AACA;AACA;AACA,OAAOC,iBAAiB,MAAM,gBAAgB;AAC9C,OAAOC,sCAAsC,MAAM,wCAAwC;AAC3F,OAAOC,0BAA0B,MAAM,0BAA0B;AACjE,OAAOC,eAAe,MAAM,oBAAoB;AAChD,OAAOC,cAAc,MAAM,oBAAoB;AAC/C,OAAOC,sBAAsB,MAAM,8BAA8B;AACjE,OAAOC,gBAAgB,MAAM,uBAAuB;AACpD,OAAOC,mBAAmB,MAAM,0BAA0B;AAC1D,OAAOC,oBAAoB,MAAM,4BAA4B;AAC7D,SAASb,KAAK,IAAIc,WAAW,QAAQ,aAAa;AAClD,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA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|
-
{"version":3,"names":["useSelect","useRegistry","store","blockEditorStore","useEffect","usePostContentBlocks","DisableNonPageContentBlocks","contentOnlyIds","templateParts","isNavigationMode","select","getBlocksByName","_isNavigationMode","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, isNavigationMode } = useSelect( ( select ) => {\n\t\tconst { getBlocksByName, isNavigationMode: _isNavigationMode } =\n\t\t\tselect( blockEditorStore );\n\t\treturn {\n\t\t\ttemplateParts: getBlocksByName( 'core/template-part' ),\n\t\t\tisNavigationMode: _isNavigationMode(),\n\t\t};\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\t// The code here is split into multiple `useEffects` calls.\n\t// This is done to avoid setting/unsetting block editing modes multiple times unnecessarily.\n\t//\n\t// For example, the block editing mode of the root block (clientId: '') only\n\t// needs to be set once, not when `contentOnlyIds` or `disabledIds` change.\n\t//\n\t// It's also unlikely that these different types of blocks are being inserted\n\t// or removed at the same time, so using different effects reflects that.\n\tuseEffect( () => {\n\t\tconst { setBlockEditingMode, unsetBlockEditingMode } =\n\t\t\tregistry.dispatch( blockEditorStore );\n\n\t\tsetBlockEditingMode( '', 'disabled' );\n\n\t\treturn () => {\n\t\t\tunsetBlockEditingMode( '' );\n\t\t};\n\t}, [ registry ] );\n\n\tuseEffect( () => {\n\t\tconst { setBlockEditingMode, unsetBlockEditingMode } =\n\t\t\tregistry.dispatch( blockEditorStore );\n\n\t\tregistry.batch( () => {\n\t\t\tfor ( const clientId of contentOnlyIds ) {\n\t\t\t\tsetBlockEditingMode( clientId, 'contentOnly' );\n\t\t\t}\n\t\t} );\n\n\t\treturn () => {\n\t\t\tregistry.batch( () => {\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} );\n\t\t};\n\t}, [ contentOnlyIds, registry ] );\n\n\tuseEffect( () => {\n\t\tconst { setBlockEditingMode, unsetBlockEditingMode } =\n\t\t\tregistry.dispatch( blockEditorStore );\n\n\t\tregistry.batch( () => {\n\t\t\tif ( ! isNavigationMode ) {\n\t\t\t\tfor ( const clientId of templateParts ) {\n\t\t\t\t\tsetBlockEditingMode( clientId, 'contentOnly' );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\n\t\treturn () => {\n\t\t\tregistry.batch( () => {\n\t\t\t\tif ( ! isNavigationMode ) {\n\t\t\t\t\tfor ( const clientId of templateParts ) {\n\t\t\t\t\t\tunsetBlockEditingMode( clientId );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\t\t};\n\t}, [ templateParts, isNavigationMode, registry ] );\n\n\tuseEffect( () => {\n\t\tconst { setBlockEditingMode, unsetBlockEditingMode } =\n\t\t\tregistry.dispatch( blockEditorStore );\n\n\t\tregistry.batch( () => {\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\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}, [ disabledIds, registry ] );\n\n\treturn null;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["useSelect","useRegistry","store","blockEditorStore","useEffect","usePostContentBlocks","DisableNonPageContentBlocks","contentOnlyIds","templateParts","isNavigationMode","select","getBlocksByName","_isNavigationMode","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, isNavigationMode } = useSelect( ( select ) => {\n\t\tconst { getBlocksByName, isNavigationMode: _isNavigationMode } =\n\t\t\tselect( blockEditorStore );\n\t\treturn {\n\t\t\ttemplateParts: getBlocksByName( 'core/template-part' ),\n\t\t\tisNavigationMode: _isNavigationMode(),\n\t\t};\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\t// The code here is split into multiple `useEffects` calls.\n\t// This is done to avoid setting/unsetting block editing modes multiple times unnecessarily.\n\t//\n\t// For example, the block editing mode of the root block (clientId: '') only\n\t// needs to be set once, not when `contentOnlyIds` or `disabledIds` change.\n\t//\n\t// It's also unlikely that these different types of blocks are being inserted\n\t// or removed at the same time, so using different effects reflects that.\n\tuseEffect( () => {\n\t\tconst { setBlockEditingMode, unsetBlockEditingMode } =\n\t\t\tregistry.dispatch( blockEditorStore );\n\n\t\tsetBlockEditingMode( '', 'disabled' );\n\n\t\treturn () => {\n\t\t\tunsetBlockEditingMode( '' );\n\t\t};\n\t}, [ registry ] );\n\n\tuseEffect( () => {\n\t\tconst { setBlockEditingMode, unsetBlockEditingMode } =\n\t\t\tregistry.dispatch( blockEditorStore );\n\n\t\tregistry.batch( () => {\n\t\t\tfor ( const clientId of contentOnlyIds ) {\n\t\t\t\tsetBlockEditingMode( clientId, 'contentOnly' );\n\t\t\t}\n\t\t} );\n\n\t\treturn () => {\n\t\t\tregistry.batch( () => {\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} );\n\t\t};\n\t}, [ contentOnlyIds, registry ] );\n\n\tuseEffect( () => {\n\t\tconst { setBlockEditingMode, unsetBlockEditingMode } =\n\t\t\tregistry.dispatch( blockEditorStore );\n\n\t\tregistry.batch( () => {\n\t\t\tif ( ! isNavigationMode ) {\n\t\t\t\tfor ( const clientId of templateParts ) {\n\t\t\t\t\tsetBlockEditingMode( clientId, 'contentOnly' );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\n\t\treturn () => {\n\t\t\tregistry.batch( () => {\n\t\t\t\tif ( ! isNavigationMode ) {\n\t\t\t\t\tfor ( const clientId of templateParts ) {\n\t\t\t\t\t\tunsetBlockEditingMode( clientId );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\t\t};\n\t}, [ templateParts, isNavigationMode, registry ] );\n\n\tuseEffect( () => {\n\t\tconst { setBlockEditingMode, unsetBlockEditingMode } =\n\t\t\tregistry.dispatch( blockEditorStore );\n\n\t\tregistry.batch( () => {\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\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}, [ 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,MAAM;IAAEG,aAAa;IAAEC;EAAiB,CAAC,GAAGT,SAAS,CAAIU,MAAM,IAAM;IACpE,MAAM;MAAEC,eAAe;MAAEF,gBAAgB,EAAEG;IAAkB,CAAC,GAC7DF,MAAM,CAAEP,gBAAiB,CAAC;IAC3B,OAAO;MACNK,aAAa,EAAEG,eAAe,CAAE,oBAAqB,CAAC;MACtDF,gBAAgB,EAAEG,iBAAiB,CAAC;IACrC,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EACP,MAAMC,WAAW,GAAGb,SAAS,CAC1BU,MAAM,IAAM;IACb,MAAM;MAAEI;IAAc,CAAC,GAAGJ,MAAM,CAAEP,gBAAiB,CAAC;IACpD,OAAOK,aAAa,CAACO,OAAO,CAAIC,QAAQ,IACvCF,aAAa,CAAEE,QAAS,CACzB,CAAC;EACF,CAAC,EACD,CAAER,aAAa,CAChB,CAAC;EAED,MAAMS,QAAQ,GAAGhB,WAAW,CAAC,CAAC;;EAE9B;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACAG,SAAS,CAAE,MAAM;IAChB,MAAM;MAAEc,mBAAmB;MAAEC;IAAsB,CAAC,GACnDF,QAAQ,CAACG,QAAQ,CAAEjB,gBAAiB,CAAC;IAEtCe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AAEQ,QAAQ,CAAG,CAAC;EAElDb,SAAS,CAAE,MAAM;IAChB,MAAM;MAAEc,mBAAmB;MAAEC;IAAsB,CAAC,GACnDF,QAAQ,CAACG,QAAQ,CAAEjB,gBAAiB,CAAC;IAEtCc,QAAQ,CAACI,KAAK,CAAE,MAAM;MACrB,KAAM,MAAML,QAAQ,IAAIH,WAAW,EAAG;QACrCK,mBAAmB,CAAEF,QAAQ,EAAE,UAAW,CAAC;MAC5C;IACD,CAAE,CAAC;IAEH,OAAO,MAAM;MACZC,QAAQ,CAACI,KAAK,CAAE,MAAM;QACrB,KAAM,MAAML,QAAQ,IAAIH,WAAW,EAAG;UACrCM,qBAAqB,CAAEH,QAAS,CAAC;QAClC;MACD,CAAE,CAAC;IACJ,CAAC;EACF,CAAC,EAAE,CAAEH,WAAW,EAAEI,QAAQ,CAAG,CAAC;EAE9B,OAAO,IAAI;AACZ","ignoreList":[]}
|
|
@@ -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","RENDERING_MODES","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","hasTemplate","editorSettings","selection","isReady","defaultMode","postTypeEntities","select","getEditorSettings","getEditorSelection","getRenderingMode","__unstableIsEditorReady","getEntitiesConfig","getPostType","hasFinishedResolution","postTypeSupports","supports","hasLoadedPostObject","_defaultMode","Array","isArray","editor","find","features","undefined","hasDefaultMode","includes","shouldRenderTemplate","defaultBlockContext","postContext","slug","postType","split","postTypeNames","map","entity","name","match","join","postId","templateSlug","blockEditorSettings","updatePostLock","setupEditor","updateEditorSettings","setCurrentTemplateId","setEditedPost","setRenderingMode","createWarningNotice","postLock","autosave","actions","label","url","editLink","kind","value","useSubRegistry","isPreviewMode","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 * These are rendering modes that the editor supports.\n */\nconst RENDERING_MODES = [ 'post-only', 'template-locked' ];\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 = mode === 'template-locked' ? 'template' : 'post';\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 hasTemplate = !! template;\n\t\tconst {\n\t\t\teditorSettings,\n\t\t\tselection,\n\t\t\tisReady,\n\t\t\tmode,\n\t\t\tdefaultMode,\n\t\t\tpostTypeEntities,\n\t\t} = useSelect(\n\t\t\t( 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 {\n\t\t\t\t\tgetEntitiesConfig,\n\t\t\t\t\tgetPostType,\n\t\t\t\t\thasFinishedResolution,\n\t\t\t\t} = select( coreStore );\n\n\t\t\t\tconst postTypeSupports = getPostType( post.type )?.supports;\n\t\t\t\tconst hasLoadedPostObject = hasFinishedResolution(\n\t\t\t\t\t'getPostType',\n\t\t\t\t\t[ post.type ]\n\t\t\t\t);\n\n\t\t\t\tconst _defaultMode = Array.isArray( postTypeSupports?.editor )\n\t\t\t\t\t? postTypeSupports.editor.find(\n\t\t\t\t\t\t\t( features ) => 'default-mode' in features\n\t\t\t\t\t )?.[ 'default-mode' ]\n\t\t\t\t\t: undefined;\n\t\t\t\tconst hasDefaultMode = RENDERING_MODES.includes( _defaultMode );\n\n\t\t\t\treturn {\n\t\t\t\t\teditorSettings: getEditorSettings(),\n\t\t\t\t\tisReady: __unstableIsEditorReady() && hasLoadedPostObject,\n\t\t\t\t\tmode: getRenderingMode(),\n\t\t\t\t\tdefaultMode:\n\t\t\t\t\t\thasTemplate && hasDefaultMode\n\t\t\t\t\t\t\t? _defaultMode\n\t\t\t\t\t\t\t: 'post-only',\n\t\t\t\t\tselection: getEditorSelection(),\n\t\t\t\t\tpostTypeEntities:\n\t\t\t\t\t\tpost.type === 'wp_template'\n\t\t\t\t\t\t\t? getEntitiesConfig( 'postType' )\n\t\t\t\t\t\t\t: null,\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ post.type, hasTemplate ]\n\t\t);\n\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 name.\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 name.\n\t\t\t\t\tconst postTypeNames =\n\t\t\t\t\t\tpostTypeEntities?.map( ( entity ) => entity.name ) ||\n\t\t\t\t\t\t[];\n\t\t\t\t\tconst match = post.slug.match(\n\t\t\t\t\t\t`^single-(${ postTypeNames.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\tpostTypeEntities,\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\n\t\t\t// The dependencies of the hook are omitted deliberately\n\t\t\t// We only want to run setupEditor (with initialEdits) only once per post.\n\t\t\t// A better solution in the future would be to split this effect into multiple ones.\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( defaultMode );\n\t\t}, [ defaultMode, setRenderingMode ] );\n\n\t\tuseHideBlocksFromInserter( post.type, mode );\n\n\t\t// Register the editor commands.\n\t\tuseCommands();\n\n\t\tif ( ! isReady || ! mode ) {\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.isPreviewMode && (\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 {React.ReactNode} [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 {React.ReactNode} 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</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AAiB,IAAE,CAAC,eACrBN,IAAA,CAACF,qBAAqB,IAAE,CAAC,eACzBE,IAAA,CAACP,uBAAuB,IAAE,CAAC,EACzBoB,IAAI,KAAK,iBAAiB,iBAC3Bb,IAAA,CAACd,2BAA2B,IAAE,CAC9B,EACCgC,IAAI,KAAK,eAAe,iBACzBlB,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,SAASgG,cAAcA,CAAEC,KAAK,EAAG;EACvC,oBACC9F,IAAA,CAAC4B,0BAA0B;IAAA,GACrBkE,KAAK;IACV7D,4BAA4B,EAAG1D,mBAAqB;IAAAyD,QAAA,EAElD8D,KAAK,CAAC9D;EAAQ,CACW,CAAC;AAE/B;AAEA,eAAe6D,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","RENDERING_MODES","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","hasTemplate","editorSettings","selection","isReady","defaultMode","postTypeEntities","select","getEditorSettings","getEditorSelection","getRenderingMode","__unstableIsEditorReady","getEntitiesConfig","getPostType","hasFinishedResolution","postTypeSupports","supports","hasLoadedPostObject","_defaultMode","Array","isArray","editor","find","features","undefined","hasDefaultMode","includes","shouldRenderTemplate","defaultBlockContext","postContext","slug","postType","split","postTypeNames","map","entity","name","match","join","postId","templateSlug","blockEditorSettings","updatePostLock","setupEditor","updateEditorSettings","setCurrentTemplateId","setEditedPost","setRenderingMode","createWarningNotice","postLock","autosave","actions","label","url","editLink","kind","value","useSubRegistry","isPreviewMode","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 * These are rendering modes that the editor supports.\n */\nconst RENDERING_MODES = [ 'post-only', 'template-locked' ];\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 = mode === 'template-locked' ? 'template' : 'post';\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 hasTemplate = !! template;\n\t\tconst {\n\t\t\teditorSettings,\n\t\t\tselection,\n\t\t\tisReady,\n\t\t\tmode,\n\t\t\tdefaultMode,\n\t\t\tpostTypeEntities,\n\t\t} = useSelect(\n\t\t\t( 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 {\n\t\t\t\t\tgetEntitiesConfig,\n\t\t\t\t\tgetPostType,\n\t\t\t\t\thasFinishedResolution,\n\t\t\t\t} = select( coreStore );\n\n\t\t\t\tconst postTypeSupports = getPostType( post.type )?.supports;\n\t\t\t\tconst hasLoadedPostObject = hasFinishedResolution(\n\t\t\t\t\t'getPostType',\n\t\t\t\t\t[ post.type ]\n\t\t\t\t);\n\n\t\t\t\tconst _defaultMode = Array.isArray( postTypeSupports?.editor )\n\t\t\t\t\t? postTypeSupports.editor.find(\n\t\t\t\t\t\t\t( features ) => 'default-mode' in features\n\t\t\t\t\t )?.[ 'default-mode' ]\n\t\t\t\t\t: undefined;\n\t\t\t\tconst hasDefaultMode = RENDERING_MODES.includes( _defaultMode );\n\n\t\t\t\treturn {\n\t\t\t\t\teditorSettings: getEditorSettings(),\n\t\t\t\t\tisReady: __unstableIsEditorReady() && hasLoadedPostObject,\n\t\t\t\t\tmode: getRenderingMode(),\n\t\t\t\t\tdefaultMode:\n\t\t\t\t\t\thasTemplate && hasDefaultMode\n\t\t\t\t\t\t\t? _defaultMode\n\t\t\t\t\t\t\t: 'post-only',\n\t\t\t\t\tselection: getEditorSelection(),\n\t\t\t\t\tpostTypeEntities:\n\t\t\t\t\t\tpost.type === 'wp_template'\n\t\t\t\t\t\t\t? getEntitiesConfig( 'postType' )\n\t\t\t\t\t\t\t: null,\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ post.type, hasTemplate ]\n\t\t);\n\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 name.\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 name.\n\t\t\t\t\tconst postTypeNames =\n\t\t\t\t\t\tpostTypeEntities?.map( ( entity ) => entity.name ) ||\n\t\t\t\t\t\t[];\n\t\t\t\t\tconst match = post.slug.match(\n\t\t\t\t\t\t`^single-(${ postTypeNames.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\tpostTypeEntities,\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\n\t\t\t// The dependencies of the hook are omitted deliberately\n\t\t\t// We only want to run setupEditor (with initialEdits) only once per post.\n\t\t\t// A better solution in the future would be to split this effect into multiple ones.\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( defaultMode );\n\t\t}, [ defaultMode, setRenderingMode ] );\n\n\t\tuseHideBlocksFromInserter( post.type, mode );\n\n\t\t// Register the editor commands.\n\t\tuseCommands();\n\n\t\tif ( ! isReady || ! mode ) {\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.isPreviewMode && (\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 {React.ReactNode} [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 {React.ReactNode} 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,6BAA6B;AAChE,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,OAAOC,2BAA2B,MAAM,mCAAmC;AAC3E,OAAOC,0BAA0B,MAAM,iCAAiC;AACxE,SAASC,yBAAyB,QAAQ,iCAAiC;AAC3E,OAAOC,WAAW,MAAM,aAAa;AACrC,OAAOC,oBAAoB,MAAM,2BAA2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GACrBkE,KAAK;IACV7D,4BAA4B,EAAG1D,mBAAqB;IAAAyD,QAAA,EAElD8D,KAAK,CAAC9D;EAAQ,CACW,CAAC;AAE/B;AAEA,eAAe6D,cAAc","ignoreList":[]}
|
|
@@ -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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A,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":[]}
|
|
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,mBAAm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,MAAM,EAAE;QAC1B2J,+BAA+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":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useMemo","useCallback","useDispatch","useSelect","store","coreStore","__experimentalFetchLinkSuggestions","fetchLinkSuggestions","__experimentalFetchUrlData","fetchUrlData","privateApis","coreDataPrivateApis","__","preferencesStore","useViewportMatch","blocksStore","blockEditorStore","inserterMediaCategories","mediaUpload","default","mediaSideload","editorStore","unlock","useGlobalStylesContext","EMPTY_OBJECT","__experimentalReusableBlocksSelect","select","RECEIVE_INTERMEDIATE_RESULTS","getEntityRecords","per_page","BLOCK_EDITOR_SETTINGS","globalStylesDataKey","globalStylesLinksDataKey","selectBlockPatternsKey","reusableBlocksSelectKey","sectionRootClientIdKey","useBlockEditorSettings","settings","postType","postId","renderingMode","_mergedGlobalStyles$s","_mergedGlobalStyles$_","_settings$__experimen","_settings$__experimen2","isLargeViewport","allowRightClickOverrides","blockTypes","focusMode","hasFixedToolbar","isDistractionFree","keepCaretInsideBlock","hasUploadPermissions","hiddenBlockTypes","canUseUnfilteredHTML","userCanCreatePages","pageOnFront","pageForPosts","userPatternCategories","restBlockPatternCategories","sectionRootClientId","_canUser","canUser","getRawEntityRecord","getEntityRecord","getUserPatternCategories","getBlockPatternCategories","get","getBlockTypes","getBlocksByName","getBlockAttributes","siteSettings","kind","name","undefined","getSectionRootBlock","_getBlocksByName$find","_getBlocksByName$","find","clientId","tagName","_links","hasOwnProperty","page_on_front","page_for_posts","merged","mergedGlobalStyles","globalStylesData","styles","globalStylesLinksData","settingsBlockPatterns","__experimentalAdditionalBlockPatterns","__experimentalBlockPatterns","settingsBlockPatternCategories","__experimentalAdditionalBlockPatternCategories","__experimentalBlockPatternCategories","blockPatterns","filter","postTypes","Array","isArray","includes","blockPatternCategories","x","index","arr","findIndex","y","undo","setIsInserterOpened","saveEntityRecord","createPageEntity","options","Promise","reject","message","allowedBlockTypes","length","defaultAllowedBlockTypes","map","type","forceDisableFocusMode","blockEditorSettings","Object","fromEntries","entries","key","hasFinishedResolution","getBlockPatternsForPostType","patterns","__experimentalUserPatternCategories","search","searchOptions","__experimentalFetchRichUrlData","__experimentalCanUserUseUnfilteredHTML","__experimentalUndo","outlineMode","__experimentalCreatePageEntity","__experimentalUserCanCreatePages","__experimentalPreferPatternsOnRoot","templateLock","template","__experimentalSetIsInserterOpened","editorTool"],"sources":["@wordpress/editor/src/components/provider/use-block-editor-settings.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo, useCallback } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tstore as coreStore,\n\t__experimentalFetchLinkSuggestions as fetchLinkSuggestions,\n\t__experimentalFetchUrlData as fetchUrlData,\n\tprivateApis as coreDataPrivateApis,\n} from '@wordpress/core-data';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tprivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport inserterMediaCategories from '../media-categories';\nimport { mediaUpload } from '../../utils';\nimport { default as mediaSideload } from '../../utils/media-sideload';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport { useGlobalStylesContext } from '../global-styles-provider';\n\nconst EMPTY_OBJECT = {};\n\nfunction __experimentalReusableBlocksSelect( select ) {\n\tconst { RECEIVE_INTERMEDIATE_RESULTS } = unlock( coreDataPrivateApis );\n\tconst { getEntityRecords } = select( coreStore );\n\treturn getEntityRecords( 'postType', 'wp_block', {\n\t\tper_page: -1,\n\t\t[ RECEIVE_INTERMEDIATE_RESULTS ]: true,\n\t} );\n}\n\nconst BLOCK_EDITOR_SETTINGS = [\n\t'__experimentalBlockDirectory',\n\t'__experimentalDiscussionSettings',\n\t'__experimentalFeatures',\n\t'__experimentalGlobalStylesBaseStyles',\n\t'alignWide',\n\t'blockInspectorTabs',\n\t'maxUploadFileSize',\n\t'allowedMimeTypes',\n\t'bodyPlaceholder',\n\t'canLockBlocks',\n\t'canUpdateBlockBindings',\n\t'capabilities',\n\t'clearBlockSelection',\n\t'codeEditingEnabled',\n\t'colors',\n\t'disableCustomColors',\n\t'disableCustomFontSizes',\n\t'disableCustomSpacingSizes',\n\t'disableCustomGradients',\n\t'disableLayoutStyles',\n\t'enableCustomLineHeight',\n\t'enableCustomSpacing',\n\t'enableCustomUnits',\n\t'enableOpenverseMediaCategory',\n\t'fontSizes',\n\t'gradients',\n\t'generateAnchors',\n\t'onNavigateToEntityRecord',\n\t'imageDefaultSize',\n\t'imageDimensions',\n\t'imageEditing',\n\t'imageSizes',\n\t'isPreviewMode',\n\t'isRTL',\n\t'locale',\n\t'maxWidth',\n\t'postContentAttributes',\n\t'postsPerPage',\n\t'readOnly',\n\t'styles',\n\t'titlePlaceholder',\n\t'supportsLayout',\n\t'widgetTypesToHideFromLegacyWidgetBlock',\n\t'__unstableHasCustomAppender',\n\t'__unstableResolvedAssets',\n\t'__unstableIsBlockBasedTheme',\n];\n\nconst {\n\tglobalStylesDataKey,\n\tglobalStylesLinksDataKey,\n\tselectBlockPatternsKey,\n\treusableBlocksSelectKey,\n\tsectionRootClientIdKey,\n} = unlock( privateApis );\n\n/**\n * React hook used to compute the block editor settings to use for the post editor.\n *\n * @param {Object} settings EditorProvider settings prop.\n * @param {string} postType Editor root level post type.\n * @param {string} postId Editor root level post ID.\n * @param {string} renderingMode Editor rendering mode.\n *\n * @return {Object} Block Editor Settings.\n */\nfunction useBlockEditorSettings( settings, postType, postId, renderingMode ) {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst {\n\t\tallowRightClickOverrides,\n\t\tblockTypes,\n\t\tfocusMode,\n\t\thasFixedToolbar,\n\t\tisDistractionFree,\n\t\tkeepCaretInsideBlock,\n\t\thasUploadPermissions,\n\t\thiddenBlockTypes,\n\t\tcanUseUnfilteredHTML,\n\t\tuserCanCreatePages,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t\tuserPatternCategories,\n\t\trestBlockPatternCategories,\n\t\tsectionRootClientId,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tcanUser,\n\t\t\t\tgetRawEntityRecord,\n\t\t\t\tgetEntityRecord,\n\t\t\t\tgetUserPatternCategories,\n\t\t\t\tgetBlockPatternCategories,\n\t\t\t} = select( coreStore );\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst { getBlockTypes } = select( blocksStore );\n\t\t\tconst { getBlocksByName, getBlockAttributes } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst siteSettings = canUser( 'read', {\n\t\t\t\tkind: 'root',\n\t\t\t\tname: 'site',\n\t\t\t} )\n\t\t\t\t? getEntityRecord( 'root', 'site' )\n\t\t\t\t: undefined;\n\n\t\t\tfunction getSectionRootBlock() {\n\t\t\t\tif ( renderingMode === 'template-locked' ) {\n\t\t\t\t\treturn getBlocksByName( 'core/post-content' )?.[ 0 ] ?? '';\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\tgetBlocksByName( 'core/group' ).find(\n\t\t\t\t\t\t( clientId ) =>\n\t\t\t\t\t\t\tgetBlockAttributes( clientId )?.tagName === 'main'\n\t\t\t\t\t) ?? ''\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tallowRightClickOverrides: get(\n\t\t\t\t\t'core',\n\t\t\t\t\t'allowRightClickOverrides'\n\t\t\t\t),\n\t\t\t\tblockTypes: getBlockTypes(),\n\t\t\t\tcanUseUnfilteredHTML: getRawEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\tpostId\n\t\t\t\t)?._links?.hasOwnProperty( 'wp:action-unfiltered-html' ),\n\t\t\t\tfocusMode: get( 'core', 'focusMode' ),\n\t\t\t\thasFixedToolbar:\n\t\t\t\t\tget( 'core', 'fixedToolbar' ) || ! isLargeViewport,\n\t\t\t\thiddenBlockTypes: get( 'core', 'hiddenBlockTypes' ),\n\t\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\t\tkeepCaretInsideBlock: get( 'core', 'keepCaretInsideBlock' ),\n\t\t\t\thasUploadPermissions:\n\t\t\t\t\tcanUser( 'create', {\n\t\t\t\t\t\tkind: 'root',\n\t\t\t\t\t\tname: 'media',\n\t\t\t\t\t} ) ?? true,\n\t\t\t\tuserCanCreatePages: canUser( 'create', {\n\t\t\t\t\tkind: 'postType',\n\t\t\t\t\tname: 'page',\n\t\t\t\t} ),\n\t\t\t\tpageOnFront: siteSettings?.page_on_front,\n\t\t\t\tpageForPosts: siteSettings?.page_for_posts,\n\t\t\t\tuserPatternCategories: getUserPatternCategories(),\n\t\t\t\trestBlockPatternCategories: getBlockPatternCategories(),\n\t\t\t\tsectionRootClientId: getSectionRootBlock(),\n\t\t\t};\n\t\t},\n\t\t[ postType, postId, isLargeViewport, renderingMode ]\n\t);\n\n\tconst { merged: mergedGlobalStyles } = useGlobalStylesContext();\n\tconst globalStylesData = mergedGlobalStyles.styles ?? EMPTY_OBJECT;\n\tconst globalStylesLinksData = mergedGlobalStyles._links ?? EMPTY_OBJECT;\n\n\tconst settingsBlockPatterns =\n\t\tsettings.__experimentalAdditionalBlockPatterns ?? // WP 6.0\n\t\tsettings.__experimentalBlockPatterns; // WP 5.9\n\tconst settingsBlockPatternCategories =\n\t\tsettings.__experimentalAdditionalBlockPatternCategories ?? // WP 6.0\n\t\tsettings.__experimentalBlockPatternCategories; // WP 5.9\n\n\tconst blockPatterns = useMemo(\n\t\t() =>\n\t\t\t[ ...( settingsBlockPatterns || [] ) ].filter(\n\t\t\t\t( { postTypes } ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t! postTypes ||\n\t\t\t\t\t\t( Array.isArray( postTypes ) &&\n\t\t\t\t\t\t\tpostTypes.includes( postType ) )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t),\n\t\t[ settingsBlockPatterns, postType ]\n\t);\n\n\tconst blockPatternCategories = useMemo(\n\t\t() =>\n\t\t\t[\n\t\t\t\t...( settingsBlockPatternCategories || [] ),\n\t\t\t\t...( restBlockPatternCategories || [] ),\n\t\t\t].filter(\n\t\t\t\t( x, index, arr ) =>\n\t\t\t\t\tindex === arr.findIndex( ( y ) => x.name === y.name )\n\t\t\t),\n\t\t[ settingsBlockPatternCategories, restBlockPatternCategories ]\n\t);\n\n\tconst { undo, setIsInserterOpened } = useDispatch( editorStore );\n\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\n\t/**\n\t * Creates a Post entity.\n\t * This is utilised by the Link UI to allow for on-the-fly creation of Posts/Pages.\n\t *\n\t * @param {Object} options parameters for the post being created. These mirror those used on 3rd param of saveEntityRecord.\n\t * @return {Object} the post type object that was created.\n\t */\n\tconst createPageEntity = useCallback(\n\t\t( options ) => {\n\t\t\tif ( ! userCanCreatePages ) {\n\t\t\t\treturn Promise.reject( {\n\t\t\t\t\tmessage: __(\n\t\t\t\t\t\t'You do not have permission to create Pages.'\n\t\t\t\t\t),\n\t\t\t\t} );\n\t\t\t}\n\t\t\treturn saveEntityRecord( 'postType', 'page', options );\n\t\t},\n\t\t[ saveEntityRecord, userCanCreatePages ]\n\t);\n\n\tconst allowedBlockTypes = useMemo( () => {\n\t\t// Omit hidden block types if exists and non-empty.\n\t\tif ( hiddenBlockTypes && hiddenBlockTypes.length > 0 ) {\n\t\t\t// Defer to passed setting for `allowedBlockTypes` if provided as\n\t\t\t// anything other than `true` (where `true` is equivalent to allow\n\t\t\t// all block types).\n\t\t\tconst defaultAllowedBlockTypes =\n\t\t\t\ttrue === settings.allowedBlockTypes\n\t\t\t\t\t? blockTypes.map( ( { name } ) => name )\n\t\t\t\t\t: settings.allowedBlockTypes || [];\n\n\t\t\treturn defaultAllowedBlockTypes.filter(\n\t\t\t\t( type ) => ! hiddenBlockTypes.includes( type )\n\t\t\t);\n\t\t}\n\n\t\treturn settings.allowedBlockTypes;\n\t}, [ settings.allowedBlockTypes, hiddenBlockTypes, blockTypes ] );\n\n\tconst forceDisableFocusMode = settings.focusMode === false;\n\n\treturn useMemo( () => {\n\t\tconst blockEditorSettings = {\n\t\t\t...Object.fromEntries(\n\t\t\t\tObject.entries( settings ).filter( ( [ key ] ) =>\n\t\t\t\t\tBLOCK_EDITOR_SETTINGS.includes( key )\n\t\t\t\t)\n\t\t\t),\n\t\t\t[ globalStylesDataKey ]: globalStylesData,\n\t\t\t[ globalStylesLinksDataKey ]: globalStylesLinksData,\n\t\t\tallowedBlockTypes,\n\t\t\tallowRightClickOverrides,\n\t\t\tfocusMode: focusMode && ! forceDisableFocusMode,\n\t\t\thasFixedToolbar,\n\t\t\tisDistractionFree,\n\t\t\tkeepCaretInsideBlock,\n\t\t\tmediaUpload: hasUploadPermissions ? mediaUpload : undefined,\n\t\t\tmediaSideload: hasUploadPermissions ? mediaSideload : undefined,\n\t\t\t__experimentalBlockPatterns: blockPatterns,\n\t\t\t[ selectBlockPatternsKey ]: ( select ) => {\n\t\t\t\tconst { hasFinishedResolution, getBlockPatternsForPostType } =\n\t\t\t\t\tunlock( select( coreStore ) );\n\t\t\t\tconst patterns = getBlockPatternsForPostType( postType );\n\t\t\t\treturn hasFinishedResolution( 'getBlockPatterns' )\n\t\t\t\t\t? patterns\n\t\t\t\t\t: undefined;\n\t\t\t},\n\t\t\t[ reusableBlocksSelectKey ]: __experimentalReusableBlocksSelect,\n\t\t\t__experimentalBlockPatternCategories: blockPatternCategories,\n\t\t\t__experimentalUserPatternCategories: userPatternCategories,\n\t\t\t__experimentalFetchLinkSuggestions: ( search, searchOptions ) =>\n\t\t\t\tfetchLinkSuggestions( search, searchOptions, settings ),\n\t\t\tinserterMediaCategories,\n\t\t\t__experimentalFetchRichUrlData: fetchUrlData,\n\t\t\t// Todo: This only checks the top level post, not the post within a template or any other entity that can be edited.\n\t\t\t// This might be better as a generic \"canUser\" selector.\n\t\t\t__experimentalCanUserUseUnfilteredHTML: canUseUnfilteredHTML,\n\t\t\t//Todo: this is only needed for native and should probably be removed.\n\t\t\t__experimentalUndo: undo,\n\t\t\t// Check whether we want all site editor frames to have outlines\n\t\t\t// including the navigation / pattern / parts editors.\n\t\t\toutlineMode: ! isDistractionFree && postType === 'wp_template',\n\t\t\t// Check these two properties: they were not present in the site editor.\n\t\t\t__experimentalCreatePageEntity: createPageEntity,\n\t\t\t__experimentalUserCanCreatePages: userCanCreatePages,\n\t\t\tpageOnFront,\n\t\t\tpageForPosts,\n\t\t\t__experimentalPreferPatternsOnRoot: postType === 'wp_template',\n\t\t\ttemplateLock:\n\t\t\t\tpostType === 'wp_navigation' ? 'insert' : settings.templateLock,\n\t\t\ttemplate:\n\t\t\t\tpostType === 'wp_navigation'\n\t\t\t\t\t? [ [ 'core/navigation', {}, [] ] ]\n\t\t\t\t\t: settings.template,\n\t\t\t__experimentalSetIsInserterOpened: setIsInserterOpened,\n\t\t\t[ sectionRootClientIdKey ]: sectionRootClientId,\n\t\t\teditorTool:\n\t\t\t\trenderingMode === 'post-only' && postType !== 'wp_template'\n\t\t\t\t\t? 'edit'\n\t\t\t\t\t: undefined,\n\t\t};\n\n\t\treturn blockEditorSettings;\n\t}, [\n\t\tallowedBlockTypes,\n\t\tallowRightClickOverrides,\n\t\tfocusMode,\n\t\tforceDisableFocusMode,\n\t\thasFixedToolbar,\n\t\tisDistractionFree,\n\t\tkeepCaretInsideBlock,\n\t\tsettings,\n\t\thasUploadPermissions,\n\t\tuserPatternCategories,\n\t\tblockPatterns,\n\t\tblockPatternCategories,\n\t\tcanUseUnfilteredHTML,\n\t\tundo,\n\t\tcreatePageEntity,\n\t\tuserCanCreatePages,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t\tpostType,\n\t\tsetIsInserterOpened,\n\t\tsectionRootClientId,\n\t\tglobalStylesData,\n\t\tglobalStylesLinksData,\n\t\trenderingMode,\n\t] );\n}\n\nexport default useBlockEditorSettings;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,OAAO,EAAEC,WAAW,QAAQ,oBAAoB;AACzD,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SACCC,KAAK,IAAIC,SAAS,EAClBC,kCAAkC,IAAIC,oBAAoB,EAC1DC,0BAA0B,IAAIC,YAAY,EAC1CC,WAAW,IAAIC,mBAAmB,QAC5B,sBAAsB;AAC7B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASR,KAAK,IAAIS,gBAAgB,QAAQ,wBAAwB;AAClE,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASV,KAAK,IAAIW,WAAW,QAAQ,mBAAmB;AACxD,SACCL,WAAW,EACXN,KAAK,IAAIY,gBAAgB,QACnB,yBAAyB;;AAEhC;AACA;AACA;AACA,OAAOC,uBAAuB,MAAM,qBAAqB;AACzD,SAASC,WAAW,QAAQ,aAAa;AACzC,SAASC,OAAO,IAAIC,aAAa,QAAQ,4BAA4B;AACrE,SAAShB,KAAK,IAAIiB,WAAW,QAAQ,aAAa;AAClD,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,sBAAsB,QAAQ,2BAA2B;AAElE,MAAMC,YAAY,GAAG,CAAC,CAAC;AAEvB,SAASC,kCAAkCA,CAAEC,MAAM,EAAG;EACrD,MAAM;I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,QAAQ,KAAK,aAAa;MAC9D;MACAmG,8BAA8B,EAAE1B,gBAAgB;MAChD2B,gCAAgC,EAAEnF,kBAAkB;MACpDC,WAAW;MACXC,YAAY;MACZkF,kCAAkC,EAAErG,QAAQ,KAAK,aAAa;MAC9DsG,YAAY,EACXtG,QAAQ,KAAK,eAAe,GAAG,QAAQ,GAAGD,QAAQ,CAACuG,YAAY;MAChEC,QAAQ,EACPvG,QAAQ,KAAK,eAAe,GACzB,CAAE,CAAE,iBAAiB,EAAE,CAAC,CAAC,EAAE,EAAE,CAAE,CAAE,GACjCD,QAAQ,CAACwG,QAAQ;MACrBC,iCAAiC,EAAEjC,mBAAmB;MACtD,CAAE1E,sBAAsB,GAAIyB,mBAAmB;MAC/CmF,UAAU,EACTvG,aAAa,KAAK,WAAW,IAAIF,QAAQ,KAAK,aAAa,GACxD,MAAM,GACNoC;IACL,CAAC;IAED,OAAOgD,mBAAmB;EAC3B,CAAC,EAAE,CACFN,iBAAiB,EACjBtE,wBAAwB,EACxBE,SAAS,EACTyE,qBAAqB,EACrBxE,eAAe,EACfC,iBAAiB,EACjBC,oBAAoB,EACpBd,QAAQ,EACRe,oBAAoB,EACpBM,qBAAqB,EACrBsC,aAAa,EACbM,sBAAsB,EACtBhD,oBAAoB,EACpBsD,IAAI,EACJG,gBAAgB,EAChBxD,kBAAkB,EAClBC,WAAW,EACXC,YAAY,EACZnB,QAAQ,EACRuE,mBAAmB,EACnBjD,mBAAmB,EACnB2B,gBAAgB,EAChBE,qBAAqB,EACrBjD,aAAa,CACZ,CAAC;AACJ;AAEA,eAAeJ,sBAAsB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["useMemo","useCallback","useDispatch","useSelect","store","coreStore","__experimentalFetchLinkSuggestions","fetchLinkSuggestions","__experimentalFetchUrlData","fetchUrlData","privateApis","coreDataPrivateApis","__","preferencesStore","useViewportMatch","blocksStore","blockEditorStore","inserterMediaCategories","mediaUpload","default","mediaSideload","editorStore","unlock","useGlobalStylesContext","EMPTY_OBJECT","__experimentalReusableBlocksSelect","select","RECEIVE_INTERMEDIATE_RESULTS","getEntityRecords","per_page","BLOCK_EDITOR_SETTINGS","globalStylesDataKey","globalStylesLinksDataKey","selectBlockPatternsKey","reusableBlocksSelectKey","sectionRootClientIdKey","useBlockEditorSettings","settings","postType","postId","renderingMode","_mergedGlobalStyles$s","_mergedGlobalStyles$_","_settings$__experimen","_settings$__experimen2","isLargeViewport","allowRightClickOverrides","blockTypes","focusMode","hasFixedToolbar","isDistractionFree","keepCaretInsideBlock","hasUploadPermissions","hiddenBlockTypes","canUseUnfilteredHTML","userCanCreatePages","pageOnFront","pageForPosts","userPatternCategories","restBlockPatternCategories","sectionRootClientId","_canUser","canUser","getRawEntityRecord","getEntityRecord","getUserPatternCategories","getBlockPatternCategories","get","getBlockTypes","getBlocksByName","getBlockAttributes","siteSettings","kind","name","undefined","getSectionRootBlock","_getBlocksByName$find","_getBlocksByName$","find","clientId","tagName","_links","hasOwnProperty","page_on_front","page_for_posts","merged","mergedGlobalStyles","globalStylesData","styles","globalStylesLinksData","settingsBlockPatterns","__experimentalAdditionalBlockPatterns","__experimentalBlockPatterns","settingsBlockPatternCategories","__experimentalAdditionalBlockPatternCategories","__experimentalBlockPatternCategories","blockPatterns","filter","postTypes","Array","isArray","includes","blockPatternCategories","x","index","arr","findIndex","y","undo","setIsInserterOpened","saveEntityRecord","createPageEntity","options","Promise","reject","message","allowedBlockTypes","length","defaultAllowedBlockTypes","map","type","forceDisableFocusMode","blockEditorSettings","Object","fromEntries","entries","key","hasFinishedResolution","getBlockPatternsForPostType","patterns","__experimentalUserPatternCategories","search","searchOptions","__experimentalFetchRichUrlData","__experimentalCanUserUseUnfilteredHTML","__experimentalUndo","outlineMode","__experimentalCreatePageEntity","__experimentalUserCanCreatePages","__experimentalPreferPatternsOnRoot","templateLock","template","__experimentalSetIsInserterOpened","editorTool"],"sources":["@wordpress/editor/src/components/provider/use-block-editor-settings.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo, useCallback } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tstore as coreStore,\n\t__experimentalFetchLinkSuggestions as fetchLinkSuggestions,\n\t__experimentalFetchUrlData as fetchUrlData,\n\tprivateApis as coreDataPrivateApis,\n} from '@wordpress/core-data';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tprivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport inserterMediaCategories from '../media-categories';\nimport { mediaUpload } from '../../utils';\nimport { default as mediaSideload } from '../../utils/media-sideload';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport { useGlobalStylesContext } from '../global-styles-provider';\n\nconst EMPTY_OBJECT = {};\n\nfunction __experimentalReusableBlocksSelect( select ) {\n\tconst { RECEIVE_INTERMEDIATE_RESULTS } = unlock( coreDataPrivateApis );\n\tconst { getEntityRecords } = select( coreStore );\n\treturn getEntityRecords( 'postType', 'wp_block', {\n\t\tper_page: -1,\n\t\t[ RECEIVE_INTERMEDIATE_RESULTS ]: true,\n\t} );\n}\n\nconst BLOCK_EDITOR_SETTINGS = [\n\t'__experimentalBlockDirectory',\n\t'__experimentalDiscussionSettings',\n\t'__experimentalFeatures',\n\t'__experimentalGlobalStylesBaseStyles',\n\t'alignWide',\n\t'blockInspectorTabs',\n\t'maxUploadFileSize',\n\t'allowedMimeTypes',\n\t'bodyPlaceholder',\n\t'canLockBlocks',\n\t'canUpdateBlockBindings',\n\t'capabilities',\n\t'clearBlockSelection',\n\t'codeEditingEnabled',\n\t'colors',\n\t'disableCustomColors',\n\t'disableCustomFontSizes',\n\t'disableCustomSpacingSizes',\n\t'disableCustomGradients',\n\t'disableLayoutStyles',\n\t'enableCustomLineHeight',\n\t'enableCustomSpacing',\n\t'enableCustomUnits',\n\t'enableOpenverseMediaCategory',\n\t'fontSizes',\n\t'gradients',\n\t'generateAnchors',\n\t'onNavigateToEntityRecord',\n\t'imageDefaultSize',\n\t'imageDimensions',\n\t'imageEditing',\n\t'imageSizes',\n\t'isPreviewMode',\n\t'isRTL',\n\t'locale',\n\t'maxWidth',\n\t'postContentAttributes',\n\t'postsPerPage',\n\t'readOnly',\n\t'styles',\n\t'titlePlaceholder',\n\t'supportsLayout',\n\t'widgetTypesToHideFromLegacyWidgetBlock',\n\t'__unstableHasCustomAppender',\n\t'__unstableResolvedAssets',\n\t'__unstableIsBlockBasedTheme',\n];\n\nconst {\n\tglobalStylesDataKey,\n\tglobalStylesLinksDataKey,\n\tselectBlockPatternsKey,\n\treusableBlocksSelectKey,\n\tsectionRootClientIdKey,\n} = unlock( privateApis );\n\n/**\n * React hook used to compute the block editor settings to use for the post editor.\n *\n * @param {Object} settings EditorProvider settings prop.\n * @param {string} postType Editor root level post type.\n * @param {string} postId Editor root level post ID.\n * @param {string} renderingMode Editor rendering mode.\n *\n * @return {Object} Block Editor Settings.\n */\nfunction useBlockEditorSettings( settings, postType, postId, renderingMode ) {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst {\n\t\tallowRightClickOverrides,\n\t\tblockTypes,\n\t\tfocusMode,\n\t\thasFixedToolbar,\n\t\tisDistractionFree,\n\t\tkeepCaretInsideBlock,\n\t\thasUploadPermissions,\n\t\thiddenBlockTypes,\n\t\tcanUseUnfilteredHTML,\n\t\tuserCanCreatePages,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t\tuserPatternCategories,\n\t\trestBlockPatternCategories,\n\t\tsectionRootClientId,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tcanUser,\n\t\t\t\tgetRawEntityRecord,\n\t\t\t\tgetEntityRecord,\n\t\t\t\tgetUserPatternCategories,\n\t\t\t\tgetBlockPatternCategories,\n\t\t\t} = select( coreStore );\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst { getBlockTypes } = select( blocksStore );\n\t\t\tconst { getBlocksByName, getBlockAttributes } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst siteSettings = canUser( 'read', {\n\t\t\t\tkind: 'root',\n\t\t\t\tname: 'site',\n\t\t\t} )\n\t\t\t\t? getEntityRecord( 'root', 'site' )\n\t\t\t\t: undefined;\n\n\t\t\tfunction getSectionRootBlock() {\n\t\t\t\tif ( renderingMode === 'template-locked' ) {\n\t\t\t\t\treturn getBlocksByName( 'core/post-content' )?.[ 0 ] ?? '';\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\tgetBlocksByName( 'core/group' ).find(\n\t\t\t\t\t\t( clientId ) =>\n\t\t\t\t\t\t\tgetBlockAttributes( clientId )?.tagName === 'main'\n\t\t\t\t\t) ?? ''\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tallowRightClickOverrides: get(\n\t\t\t\t\t'core',\n\t\t\t\t\t'allowRightClickOverrides'\n\t\t\t\t),\n\t\t\t\tblockTypes: getBlockTypes(),\n\t\t\t\tcanUseUnfilteredHTML: getRawEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\tpostId\n\t\t\t\t)?._links?.hasOwnProperty( 'wp:action-unfiltered-html' ),\n\t\t\t\tfocusMode: get( 'core', 'focusMode' ),\n\t\t\t\thasFixedToolbar:\n\t\t\t\t\tget( 'core', 'fixedToolbar' ) || ! isLargeViewport,\n\t\t\t\thiddenBlockTypes: get( 'core', 'hiddenBlockTypes' ),\n\t\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\t\tkeepCaretInsideBlock: get( 'core', 'keepCaretInsideBlock' ),\n\t\t\t\thasUploadPermissions:\n\t\t\t\t\tcanUser( 'create', {\n\t\t\t\t\t\tkind: 'root',\n\t\t\t\t\t\tname: 'media',\n\t\t\t\t\t} ) ?? true,\n\t\t\t\tuserCanCreatePages: canUser( 'create', {\n\t\t\t\t\tkind: 'postType',\n\t\t\t\t\tname: 'page',\n\t\t\t\t} ),\n\t\t\t\tpageOnFront: siteSettings?.page_on_front,\n\t\t\t\tpageForPosts: siteSettings?.page_for_posts,\n\t\t\t\tuserPatternCategories: getUserPatternCategories(),\n\t\t\t\trestBlockPatternCategories: getBlockPatternCategories(),\n\t\t\t\tsectionRootClientId: getSectionRootBlock(),\n\t\t\t};\n\t\t},\n\t\t[ postType, postId, isLargeViewport, renderingMode ]\n\t);\n\n\tconst { merged: mergedGlobalStyles } = useGlobalStylesContext();\n\tconst globalStylesData = mergedGlobalStyles.styles ?? EMPTY_OBJECT;\n\tconst globalStylesLinksData = mergedGlobalStyles._links ?? EMPTY_OBJECT;\n\n\tconst settingsBlockPatterns =\n\t\tsettings.__experimentalAdditionalBlockPatterns ?? // WP 6.0\n\t\tsettings.__experimentalBlockPatterns; // WP 5.9\n\tconst settingsBlockPatternCategories =\n\t\tsettings.__experimentalAdditionalBlockPatternCategories ?? // WP 6.0\n\t\tsettings.__experimentalBlockPatternCategories; // WP 5.9\n\n\tconst blockPatterns = useMemo(\n\t\t() =>\n\t\t\t[ ...( settingsBlockPatterns || [] ) ].filter(\n\t\t\t\t( { postTypes } ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t! postTypes ||\n\t\t\t\t\t\t( Array.isArray( postTypes ) &&\n\t\t\t\t\t\t\tpostTypes.includes( postType ) )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t),\n\t\t[ settingsBlockPatterns, postType ]\n\t);\n\n\tconst blockPatternCategories = useMemo(\n\t\t() =>\n\t\t\t[\n\t\t\t\t...( settingsBlockPatternCategories || [] ),\n\t\t\t\t...( restBlockPatternCategories || [] ),\n\t\t\t].filter(\n\t\t\t\t( x, index, arr ) =>\n\t\t\t\t\tindex === arr.findIndex( ( y ) => x.name === y.name )\n\t\t\t),\n\t\t[ settingsBlockPatternCategories, restBlockPatternCategories ]\n\t);\n\n\tconst { undo, setIsInserterOpened } = useDispatch( editorStore );\n\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\n\t/**\n\t * Creates a Post entity.\n\t * This is utilised by the Link UI to allow for on-the-fly creation of Posts/Pages.\n\t *\n\t * @param {Object} options parameters for the post being created. These mirror those used on 3rd param of saveEntityRecord.\n\t * @return {Object} the post type object that was created.\n\t */\n\tconst createPageEntity = useCallback(\n\t\t( options ) => {\n\t\t\tif ( ! userCanCreatePages ) {\n\t\t\t\treturn Promise.reject( {\n\t\t\t\t\tmessage: __(\n\t\t\t\t\t\t'You do not have permission to create Pages.'\n\t\t\t\t\t),\n\t\t\t\t} );\n\t\t\t}\n\t\t\treturn saveEntityRecord( 'postType', 'page', options );\n\t\t},\n\t\t[ saveEntityRecord, userCanCreatePages ]\n\t);\n\n\tconst allowedBlockTypes = useMemo( () => {\n\t\t// Omit hidden block types if exists and non-empty.\n\t\tif ( hiddenBlockTypes && hiddenBlockTypes.length > 0 ) {\n\t\t\t// Defer to passed setting for `allowedBlockTypes` if provided as\n\t\t\t// anything other than `true` (where `true` is equivalent to allow\n\t\t\t// all block types).\n\t\t\tconst defaultAllowedBlockTypes =\n\t\t\t\ttrue === settings.allowedBlockTypes\n\t\t\t\t\t? blockTypes.map( ( { name } ) => name )\n\t\t\t\t\t: settings.allowedBlockTypes || [];\n\n\t\t\treturn defaultAllowedBlockTypes.filter(\n\t\t\t\t( type ) => ! hiddenBlockTypes.includes( type )\n\t\t\t);\n\t\t}\n\n\t\treturn settings.allowedBlockTypes;\n\t}, [ settings.allowedBlockTypes, hiddenBlockTypes, blockTypes ] );\n\n\tconst forceDisableFocusMode = settings.focusMode === false;\n\n\treturn useMemo( () => {\n\t\tconst blockEditorSettings = {\n\t\t\t...Object.fromEntries(\n\t\t\t\tObject.entries( settings ).filter( ( [ key ] ) =>\n\t\t\t\t\tBLOCK_EDITOR_SETTINGS.includes( key )\n\t\t\t\t)\n\t\t\t),\n\t\t\t[ globalStylesDataKey ]: globalStylesData,\n\t\t\t[ globalStylesLinksDataKey ]: globalStylesLinksData,\n\t\t\tallowedBlockTypes,\n\t\t\tallowRightClickOverrides,\n\t\t\tfocusMode: focusMode && ! forceDisableFocusMode,\n\t\t\thasFixedToolbar,\n\t\t\tisDistractionFree,\n\t\t\tkeepCaretInsideBlock,\n\t\t\tmediaUpload: hasUploadPermissions ? mediaUpload : undefined,\n\t\t\tmediaSideload: hasUploadPermissions ? mediaSideload : undefined,\n\t\t\t__experimentalBlockPatterns: blockPatterns,\n\t\t\t[ selectBlockPatternsKey ]: ( select ) => {\n\t\t\t\tconst { hasFinishedResolution, getBlockPatternsForPostType } =\n\t\t\t\t\tunlock( select( coreStore ) );\n\t\t\t\tconst patterns = getBlockPatternsForPostType( postType );\n\t\t\t\treturn hasFinishedResolution( 'getBlockPatterns' )\n\t\t\t\t\t? patterns\n\t\t\t\t\t: undefined;\n\t\t\t},\n\t\t\t[ reusableBlocksSelectKey ]: __experimentalReusableBlocksSelect,\n\t\t\t__experimentalBlockPatternCategories: blockPatternCategories,\n\t\t\t__experimentalUserPatternCategories: userPatternCategories,\n\t\t\t__experimentalFetchLinkSuggestions: ( search, searchOptions ) =>\n\t\t\t\tfetchLinkSuggestions( search, searchOptions, settings ),\n\t\t\tinserterMediaCategories,\n\t\t\t__experimentalFetchRichUrlData: fetchUrlData,\n\t\t\t// Todo: This only checks the top level post, not the post within a template or any other entity that can be edited.\n\t\t\t// This might be better as a generic \"canUser\" selector.\n\t\t\t__experimentalCanUserUseUnfilteredHTML: canUseUnfilteredHTML,\n\t\t\t//Todo: this is only needed for native and should probably be removed.\n\t\t\t__experimentalUndo: undo,\n\t\t\t// Check whether we want all site editor frames to have outlines\n\t\t\t// including the navigation / pattern / parts editors.\n\t\t\toutlineMode: ! isDistractionFree && postType === 'wp_template',\n\t\t\t// Check these two properties: they were not present in the site editor.\n\t\t\t__experimentalCreatePageEntity: createPageEntity,\n\t\t\t__experimentalUserCanCreatePages: userCanCreatePages,\n\t\t\tpageOnFront,\n\t\t\tpageForPosts,\n\t\t\t__experimentalPreferPatternsOnRoot: postType === 'wp_template',\n\t\t\ttemplateLock:\n\t\t\t\tpostType === 'wp_navigation' ? 'insert' : settings.templateLock,\n\t\t\ttemplate:\n\t\t\t\tpostType === 'wp_navigation'\n\t\t\t\t\t? [ [ 'core/navigation', {}, [] ] ]\n\t\t\t\t\t: settings.template,\n\t\t\t__experimentalSetIsInserterOpened: setIsInserterOpened,\n\t\t\t[ sectionRootClientIdKey ]: sectionRootClientId,\n\t\t\teditorTool:\n\t\t\t\trenderingMode === 'post-only' && postType !== 'wp_template'\n\t\t\t\t\t? 'edit'\n\t\t\t\t\t: undefined,\n\t\t};\n\n\t\treturn blockEditorSettings;\n\t}, [\n\t\tallowedBlockTypes,\n\t\tallowRightClickOverrides,\n\t\tfocusMode,\n\t\tforceDisableFocusMode,\n\t\thasFixedToolbar,\n\t\tisDistractionFree,\n\t\tkeepCaretInsideBlock,\n\t\tsettings,\n\t\thasUploadPermissions,\n\t\tuserPatternCategories,\n\t\tblockPatterns,\n\t\tblockPatternCategories,\n\t\tcanUseUnfilteredHTML,\n\t\tundo,\n\t\tcreatePageEntity,\n\t\tuserCanCreatePages,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t\tpostType,\n\t\tsetIsInserterOpened,\n\t\tsectionRootClientId,\n\t\tglobalStylesData,\n\t\tglobalStylesLinksData,\n\t\trenderingMode,\n\t] );\n}\n\nexport default useBlockEditorSettings;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,EAAEC,WAAW,QAAQ,oBAAoB;AACzD,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SACCC,KAAK,IAAIC,SAAS,EAClBC,kCAAkC,IAAIC,oBAAoB,EAC1DC,0BAA0B,IAAIC,YAAY,EAC1CC,WAAW,IAAIC,mBAAmB,QAC5B,sBAAsB;AAC7B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASR,KAAK,IAAIS,gBAAgB,QAAQ,w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