@wordpress/edit-post 7.32.0 → 7.33.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/README.md +4 -196
- package/build/components/browser-url/index.js.map +1 -1
- package/build/components/editor-initialization/index.js +0 -1
- package/build/components/editor-initialization/index.js.map +1 -1
- package/build/components/editor-initialization/listener-hooks.js +1 -38
- package/build/components/editor-initialization/listener-hooks.js.map +1 -1
- package/build/components/header/fullscreen-mode-close/index.js.map +1 -1
- package/build/components/header/header-toolbar/index.native.js.map +1 -1
- package/build/components/header/index.js +4 -4
- package/build/components/header/index.js.map +1 -1
- package/build/components/header/index.native.js +1 -1
- package/build/components/header/index.native.js.map +1 -1
- package/build/components/header/main-dashboard-button/index.js.map +1 -1
- package/build/components/header/more-menu/index.js +7 -6
- package/build/components/header/more-menu/index.js.map +1 -1
- package/build/components/header/post-publish-button-or-toggle.js +9 -6
- package/build/components/header/post-publish-button-or-toggle.js.map +1 -1
- package/build/components/header/preferences-menu-item/index.js +12 -4
- package/build/components/header/preferences-menu-item/index.js.map +1 -1
- package/build/components/header/tools-more-menu-group/index.js.map +1 -1
- package/build/components/header/writing-menu/index.js.map +1 -1
- package/build/components/init-pattern-modal/index.js.map +1 -1
- package/build/components/keyboard-shortcuts/index.js +1 -36
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/layout/actions-panel.js.map +1 -1
- package/build/components/layout/index.js +12 -20
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/index.native.js.map +1 -1
- package/build/components/meta-boxes/index.js.map +1 -1
- package/build/components/meta-boxes/meta-box-visibility.js.map +1 -1
- package/build/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
- package/build/components/preferences-modal/enable-custom-fields.js.map +1 -1
- package/build/components/preferences-modal/enable-panel.js.map +1 -1
- package/build/components/preferences-modal/enable-publish-sidebar.js.map +1 -1
- package/build/components/preferences-modal/index.js +1 -21
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/preferences-modal/meta-boxes-section.js.map +1 -1
- package/build/components/sidebar/plugin-post-publish-panel/index.js.map +1 -1
- package/build/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
- package/build/components/sidebar/post-format/index.js.map +1 -1
- package/build/components/sidebar/post-pending-status/index.js.map +1 -1
- package/build/components/sidebar/post-slug/index.js.map +1 -1
- package/build/components/sidebar/post-status/index.js +9 -9
- package/build/components/sidebar/post-status/index.js.map +1 -1
- package/build/components/sidebar/post-sticky/index.js.map +1 -1
- package/build/components/sidebar/post-trash/index.js.map +1 -1
- package/build/components/sidebar/post-visibility/index.js.map +1 -1
- package/build/components/sidebar/settings-header/index.js.map +1 -1
- package/build/components/sidebar/settings-sidebar/index.js +37 -40
- package/build/components/sidebar/settings-sidebar/index.js.map +1 -1
- package/build/components/text-editor/index.js.map +1 -1
- package/build/components/visual-editor/block-inspector-button.js +1 -1
- package/build/components/visual-editor/block-inspector-button.js.map +1 -1
- package/build/components/visual-editor/header.native.js.map +1 -1
- package/build/components/visual-editor/index.js +4 -1
- package/build/components/visual-editor/index.js.map +1 -1
- package/build/components/visual-editor/index.native.js.map +1 -1
- package/build/components/visual-editor/use-padding-appender.js +62 -0
- package/build/components/visual-editor/use-padding-appender.js.map +1 -0
- package/build/components/welcome-guide/default.js.map +1 -1
- package/build/components/welcome-guide/image.js.map +1 -1
- package/build/components/welcome-guide/index.js.map +1 -1
- package/build/components/welcome-guide/template.js.map +1 -1
- package/build/editor.js +2 -2
- package/build/editor.js.map +1 -1
- package/build/editor.native.js.map +1 -1
- package/build/hooks/commands/use-common-commands.js +5 -22
- package/build/hooks/commands/use-common-commands.js.map +1 -1
- package/build/hooks/components/index.js.map +1 -1
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/use-navigate-to-entity-record.js.map +1 -1
- package/build/hooks/validate-multiple-use/index.js.map +1 -1
- package/build/index.js +4 -8
- package/build/index.js.map +1 -1
- package/build/index.native.js.map +1 -1
- package/build/lock-unlock.js.map +1 -1
- package/build/plugins/copy-content-menu-item/index.js.map +1 -1
- package/build/plugins/index.js.map +1 -1
- package/build/plugins/keyboard-shortcuts-help-menu-item/index.js +7 -4
- package/build/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
- package/build/plugins/welcome-guide-menu-item/index.js.map +1 -1
- package/build/store/actions.js +10 -8
- package/build/store/actions.js.map +1 -1
- package/build/store/constants.js.map +1 -1
- package/build/store/index.js +1 -1
- package/build/store/index.js.map +1 -1
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +34 -19
- package/build/store/selectors.js.map +1 -1
- package/build/utils/meta-boxes.js.map +1 -1
- package/build-module/components/browser-url/index.js.map +1 -1
- package/build-module/components/editor-initialization/index.js +1 -2
- package/build-module/components/editor-initialization/index.js.map +1 -1
- package/build-module/components/editor-initialization/listener-hooks.js +2 -38
- package/build-module/components/editor-initialization/listener-hooks.js.map +1 -1
- package/build-module/components/header/fullscreen-mode-close/index.js.map +1 -1
- package/build-module/components/header/header-toolbar/index.native.js.map +1 -1
- package/build-module/components/header/index.js +3 -3
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/header/index.native.js +1 -1
- package/build-module/components/header/index.native.js.map +1 -1
- package/build-module/components/header/main-dashboard-button/index.js.map +1 -1
- package/build-module/components/header/more-menu/index.js +5 -4
- package/build-module/components/header/more-menu/index.js.map +1 -1
- package/build-module/components/header/post-publish-button-or-toggle.js +9 -6
- package/build-module/components/header/post-publish-button-or-toggle.js.map +1 -1
- package/build-module/components/header/preferences-menu-item/index.js +11 -3
- package/build-module/components/header/preferences-menu-item/index.js.map +1 -1
- package/build-module/components/header/tools-more-menu-group/index.js.map +1 -1
- package/build-module/components/header/writing-menu/index.js.map +1 -1
- package/build-module/components/init-pattern-modal/index.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/index.js +1 -36
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/layout/actions-panel.js.map +1 -1
- package/build-module/components/layout/index.js +11 -19
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/layout/index.native.js.map +1 -1
- package/build-module/components/meta-boxes/index.js.map +1 -1
- package/build-module/components/meta-boxes/meta-box-visibility.js.map +1 -1
- package/build-module/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
- package/build-module/components/preferences-modal/enable-custom-fields.js.map +1 -1
- package/build-module/components/preferences-modal/enable-panel.js.map +1 -1
- package/build-module/components/preferences-modal/enable-publish-sidebar.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +1 -20
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/preferences-modal/meta-boxes-section.js.map +1 -1
- package/build-module/components/sidebar/plugin-post-publish-panel/index.js.map +1 -1
- package/build-module/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
- package/build-module/components/sidebar/post-format/index.js.map +1 -1
- package/build-module/components/sidebar/post-pending-status/index.js.map +1 -1
- package/build-module/components/sidebar/post-slug/index.js.map +1 -1
- package/build-module/components/sidebar/post-status/index.js +9 -10
- package/build-module/components/sidebar/post-status/index.js.map +1 -1
- package/build-module/components/sidebar/post-sticky/index.js.map +1 -1
- package/build-module/components/sidebar/post-trash/index.js.map +1 -1
- package/build-module/components/sidebar/post-visibility/index.js.map +1 -1
- package/build-module/components/sidebar/settings-header/index.js.map +1 -1
- package/build-module/components/sidebar/settings-sidebar/index.js +38 -41
- package/build-module/components/sidebar/settings-sidebar/index.js.map +1 -1
- package/build-module/components/text-editor/index.js.map +1 -1
- package/build-module/components/visual-editor/block-inspector-button.js +1 -1
- package/build-module/components/visual-editor/block-inspector-button.js.map +1 -1
- package/build-module/components/visual-editor/header.native.js.map +1 -1
- package/build-module/components/visual-editor/index.js +4 -1
- package/build-module/components/visual-editor/index.js.map +1 -1
- package/build-module/components/visual-editor/index.native.js.map +1 -1
- package/build-module/components/visual-editor/use-padding-appender.js +55 -0
- package/build-module/components/visual-editor/use-padding-appender.js.map +1 -0
- package/build-module/components/welcome-guide/default.js.map +1 -1
- package/build-module/components/welcome-guide/image.js.map +1 -1
- package/build-module/components/welcome-guide/index.js.map +1 -1
- package/build-module/components/welcome-guide/template.js.map +1 -1
- package/build-module/editor.js +2 -2
- package/build-module/editor.js.map +1 -1
- package/build-module/editor.native.js.map +1 -1
- package/build-module/hooks/commands/use-common-commands.js +7 -24
- package/build-module/hooks/commands/use-common-commands.js.map +1 -1
- package/build-module/hooks/components/index.js.map +1 -1
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/use-navigate-to-entity-record.js.map +1 -1
- package/build-module/hooks/validate-multiple-use/index.js.map +1 -1
- package/build-module/index.js +5 -5
- package/build-module/index.js.map +1 -1
- package/build-module/index.native.js.map +1 -1
- package/build-module/lock-unlock.js.map +1 -1
- package/build-module/plugins/copy-content-menu-item/index.js.map +1 -1
- package/build-module/plugins/index.js.map +1 -1
- package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js +6 -3
- package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
- package/build-module/plugins/welcome-guide-menu-item/index.js.map +1 -1
- package/build-module/store/actions.js +8 -7
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/constants.js.map +1 -1
- package/build-module/store/index.js.map +1 -1
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +33 -18
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/meta-boxes.js.map +1 -1
- package/build-style/classic-rtl.css +2 -2
- package/build-style/classic.css +2 -2
- package/build-style/style-rtl.css +12 -448
- package/build-style/style.css +12 -448
- package/package.json +32 -34
- package/src/classic.scss +1 -1
- package/src/components/editor-initialization/index.js +1 -5
- package/src/components/editor-initialization/listener-hooks.js +1 -40
- package/src/components/editor-initialization/test/listener-hooks.js +1 -96
- package/src/components/header/index.js +2 -3
- package/src/components/header/index.native.js +1 -1
- package/src/components/header/more-menu/index.js +3 -4
- package/src/components/header/post-publish-button-or-toggle.js +8 -3
- package/src/components/header/preferences-menu-item/index.js +9 -3
- package/src/components/header/style.scss +5 -3
- package/src/components/header/test/index.js +13 -1
- package/src/components/keyboard-shortcuts/index.js +3 -44
- package/src/components/layout/index.js +14 -41
- package/src/components/preferences-modal/index.js +1 -24
- package/src/components/sidebar/post-status/index.js +6 -9
- package/src/components/sidebar/settings-sidebar/index.js +62 -58
- package/src/components/visual-editor/block-inspector-button.js +1 -1
- package/src/components/visual-editor/index.js +4 -0
- package/src/components/visual-editor/use-padding-appender.js +66 -0
- package/src/editor.js +2 -2
- package/src/hooks/commands/use-common-commands.js +11 -26
- package/src/index.js +8 -4
- package/src/plugins/keyboard-shortcuts-help-menu-item/index.js +5 -3
- package/src/store/actions.js +10 -12
- package/src/store/selectors.js +41 -33
- package/src/store/test/actions.js +11 -10
- package/src/style.scss +1 -19
- package/build/components/header/plugin-more-menu-item/index.js +0 -78
- package/build/components/header/plugin-more-menu-item/index.js.map +0 -1
- package/build/components/header/plugin-sidebar-more-menu-item/index.js +0 -71
- package/build/components/header/plugin-sidebar-more-menu-item/index.js.map +0 -1
- package/build/components/keyboard-shortcut-help-modal/config.js +0 -78
- package/build/components/keyboard-shortcut-help-modal/config.js.map +0 -1
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -49
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +0 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +0 -132
- package/build/components/keyboard-shortcut-help-modal/index.js.map +0 -1
- package/build/components/keyboard-shortcut-help-modal/shortcut.js +0 -55
- package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +0 -1
- package/build/components/sidebar/plugin-post-status-info/index.js +0 -73
- package/build/components/sidebar/plugin-post-status-info/index.js.map +0 -1
- package/build/components/sidebar/plugin-sidebar/index.js +0 -104
- package/build/components/sidebar/plugin-sidebar/index.js.map +0 -1
- package/build/components/start-page-options/index.js +0 -107
- package/build/components/start-page-options/index.js.map +0 -1
- package/build-module/components/header/plugin-more-menu-item/index.js +0 -73
- package/build-module/components/header/plugin-more-menu-item/index.js.map +0 -1
- package/build-module/components/header/plugin-sidebar-more-menu-item/index.js +0 -65
- package/build-module/components/header/plugin-sidebar-more-menu-item/index.js.map +0 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js +0 -71
- package/build-module/components/keyboard-shortcut-help-modal/config.js.map +0 -1
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -41
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +0 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +0 -122
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +0 -1
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +0 -48
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +0 -1
- package/build-module/components/sidebar/plugin-post-status-info/index.js +0 -66
- package/build-module/components/sidebar/plugin-post-status-info/index.js.map +0 -1
- package/build-module/components/sidebar/plugin-sidebar/index.js +0 -98
- package/build-module/components/sidebar/plugin-sidebar/index.js.map +0 -1
- package/build-module/components/start-page-options/index.js +0 -100
- package/build-module/components/start-page-options/index.js.map +0 -1
- package/src/components/header/plugin-more-menu-item/index.js +0 -73
- package/src/components/header/plugin-sidebar-more-menu-item/index.js +0 -64
- package/src/components/keyboard-shortcut-help-modal/config.js +0 -53
- package/src/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -43
- package/src/components/keyboard-shortcut-help-modal/index.js +0 -163
- package/src/components/keyboard-shortcut-help-modal/shortcut.js +0 -67
- package/src/components/keyboard-shortcut-help-modal/style.scss +0 -61
- package/src/components/keyboard-shortcut-help-modal/test/index.js +0 -36
- package/src/components/sidebar/plugin-post-status-info/index.js +0 -63
- package/src/components/sidebar/plugin-post-status-info/test/__snapshots__/index.js.snap +0 -11
- package/src/components/sidebar/plugin-post-status-info/test/index.js +0 -29
- package/src/components/sidebar/plugin-sidebar/index.js +0 -94
- package/src/components/start-page-options/index.js +0 -108
- package/src/components/start-page-options/style.scss +0 -26
package/build/editor.js
CHANGED
|
@@ -59,9 +59,9 @@ function Editor({
|
|
|
59
59
|
const postObject = getEntityRecord('postType', currentPost.postType, currentPost.postId);
|
|
60
60
|
const supportsTemplateMode = getEditorSettings().supportsTemplateMode;
|
|
61
61
|
const isViewable = (_getPostType$viewable = getPostType(currentPost.postType)?.viewable) !== null && _getPostType$viewable !== void 0 ? _getPostType$viewable : false;
|
|
62
|
-
const
|
|
62
|
+
const canViewTemplate = canUser('read', 'templates');
|
|
63
63
|
return {
|
|
64
|
-
template: supportsTemplateMode && isViewable &&
|
|
64
|
+
template: supportsTemplateMode && isViewable && canViewTemplate && currentPost.postType !== 'wp_template' ? getEditedPostTemplate() : null,
|
|
65
65
|
post: postObject
|
|
66
66
|
};
|
|
67
67
|
}, [currentPost.postType, currentPost.postId]);
|
package/build/editor.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_editor","_element","_components","_coreData","_commands","_layout","_interopRequireDefault","_editorInitialization","_store","_lockUnlock","_useNavigateToEntityRecord","ExperimentalEditorProvider","unlock","editorPrivateApis","Editor","postId","initialPostId","postType","initialPostType","settings","initialEdits","props","currentPost","onNavigateToEntityRecord","onNavigateToPreviousEntityRecord","useNavigateToEntityRecord","post","template","useSelect","select","_getPostType$viewable","getEditedPostTemplate","editPostStore","getEntityRecord","getPostType","canUser","coreStore","getEditorSettings","editorStore","postObject","supportsTemplateMode","isViewable","viewable","
|
|
1
|
+
{"version":3,"names":["_data","require","_editor","_element","_components","_coreData","_commands","_layout","_interopRequireDefault","_editorInitialization","_store","_lockUnlock","_useNavigateToEntityRecord","ExperimentalEditorProvider","unlock","editorPrivateApis","Editor","postId","initialPostId","postType","initialPostType","settings","initialEdits","props","currentPost","onNavigateToEntityRecord","onNavigateToPreviousEntityRecord","useNavigateToEntityRecord","post","template","useSelect","select","_getPostType$viewable","getEditedPostTemplate","editPostStore","getEntityRecord","getPostType","canUser","coreStore","getEditorSettings","editorStore","postObject","supportsTemplateMode","isViewable","viewable","canViewTemplate","editorSettings","useMemo","defaultRenderingMode","initialPost","type","id","_react","createElement","SlotFillProvider","useSubRegistry","__unstableTemplate","ErrorBoundary","CommandMenu","default","PostLockedModal","_default","exports"],"sources":["@wordpress/edit-post/src/editor.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tErrorBoundary,\n\tPostLockedModal,\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { useMemo } from '@wordpress/element';\nimport { SlotFillProvider } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { CommandMenu } from '@wordpress/commands';\n\n/**\n * Internal dependencies\n */\nimport Layout from './components/layout';\nimport EditorInitialization from './components/editor-initialization';\nimport { store as editPostStore } from './store';\nimport { unlock } from './lock-unlock';\nimport useNavigateToEntityRecord from './hooks/use-navigate-to-entity-record';\n\nconst { ExperimentalEditorProvider } = unlock( editorPrivateApis );\n\nfunction Editor( {\n\tpostId: initialPostId,\n\tpostType: initialPostType,\n\tsettings,\n\tinitialEdits,\n\t...props\n} ) {\n\tconst {\n\t\tcurrentPost,\n\t\tonNavigateToEntityRecord,\n\t\tonNavigateToPreviousEntityRecord,\n\t} = useNavigateToEntityRecord(\n\t\tinitialPostId,\n\t\tinitialPostType,\n\t\t'post-only'\n\t);\n\n\tconst { post, template } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedPostTemplate } = select( editPostStore );\n\t\t\tconst { getEntityRecord, getPostType, canUser } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst { getEditorSettings } = select( editorStore );\n\n\t\t\tconst postObject = getEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tcurrentPost.postType,\n\t\t\t\tcurrentPost.postId\n\t\t\t);\n\n\t\t\tconst supportsTemplateMode =\n\t\t\t\tgetEditorSettings().supportsTemplateMode;\n\t\t\tconst isViewable =\n\t\t\t\tgetPostType( currentPost.postType )?.viewable ?? false;\n\t\t\tconst canViewTemplate = canUser( 'read', 'templates' );\n\t\t\treturn {\n\t\t\t\ttemplate:\n\t\t\t\t\tsupportsTemplateMode &&\n\t\t\t\t\tisViewable &&\n\t\t\t\t\tcanViewTemplate &&\n\t\t\t\t\tcurrentPost.postType !== 'wp_template'\n\t\t\t\t\t\t? getEditedPostTemplate()\n\t\t\t\t\t\t: null,\n\t\t\t\tpost: postObject,\n\t\t\t};\n\t\t},\n\t\t[ currentPost.postType, currentPost.postId ]\n\t);\n\n\tconst editorSettings = useMemo(\n\t\t() => ( {\n\t\t\t...settings,\n\t\t\tonNavigateToEntityRecord,\n\t\t\tonNavigateToPreviousEntityRecord,\n\t\t\tdefaultRenderingMode: 'post-only',\n\t\t} ),\n\t\t[ settings, onNavigateToEntityRecord, onNavigateToPreviousEntityRecord ]\n\t);\n\n\tconst initialPost = useMemo( () => {\n\t\treturn {\n\t\t\ttype: initialPostType,\n\t\t\tid: initialPostId,\n\t\t};\n\t}, [ initialPostType, initialPostId ] );\n\n\tif ( ! post ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<SlotFillProvider>\n\t\t\t<ExperimentalEditorProvider\n\t\t\t\tsettings={ editorSettings }\n\t\t\t\tpost={ post }\n\t\t\t\tinitialEdits={ initialEdits }\n\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t__unstableTemplate={ template }\n\t\t\t\t{ ...props }\n\t\t\t>\n\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t<CommandMenu />\n\t\t\t\t\t<EditorInitialization />\n\t\t\t\t\t<Layout initialPost={ initialPost } />\n\t\t\t\t</ErrorBoundary>\n\t\t\t\t<PostLockedModal />\n\t\t\t</ExperimentalEditorProvider>\n\t\t</SlotFillProvider>\n\t);\n}\n\nexport default Editor;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAMA,IAAAE,QAAA,GAAAF,OAAA;A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C,EACf,IAAAN,MAAA,CAAAC,aAAA,EAAC5C,qBAAA,CAAAkD,OAAoB,MAAE,CAAC,EACxB,IAAAP,MAAA,CAAAC,aAAA,EAAC9C,OAAA,CAAAoD,OAAM;IAACV,WAAW,EAAGA;EAAa,CAAE,CACvB,CAAC,EAChB,IAAAG,MAAA,CAAAC,aAAA,EAACnD,OAAA,CAAA0D,eAAe,MAAE,CACS,CACX,CAAC;AAErB;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAH,OAAA,GAEc3C,MAAM","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_memize","_interopRequireDefault","require","_reactNative","_reactNativeGestureHandler","_element","_editor","_blocks","_data","_compose","_reactNativeBridge","_components","_coreData","_layout","Editor","Component","constructor","props","arguments","galleryWithImageBlocks","window","wp","galleryBlockV2Enabled","initialHtmlModeEnabled","mode","switchEditorMode","getEditorSettings","memize","maxSize","setTitleRef","bind","settings","isRTL","I18nManager","componentDidMount","editEntityRecord","postType","postId","subscriptionParentSetFocusOnTitle","subscribeSetFocusOnTitle","postTitleRef","focus","focusTitleWhenAvailable","subscriptionParentFeaturedImageIdNativeUpdated","subscribeFeaturedImageIdNativeUpdated","payload","featured_media","featuredImageId","undoIgnore","componentWillUnmount","remove","titleRef","render","initialEdits","post","initialHtml","editorSettings","normalizedPost","id","title","raw","initialTitle","content","serialize","parse","type","status","meta","_react","createElement","GestureHandlerRootView","style","flex","SlotFillProvider","EditorProvider","useSubRegistry","ErrorBoundary","default","_default","exports","compose","withSelect","select","getEditorMode","editorStore","withDispatch","dispatch","coreStore"],"sources":["@wordpress/edit-post/src/editor.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport memize from 'memize';\nimport { I18nManager } from 'react-native';\nimport { GestureHandlerRootView } from 'react-native-gesture-handler';\n\n/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport {\n\tEditorProvider,\n\tErrorBoundary,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { parse, serialize } from '@wordpress/blocks';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\nimport {\n\tsubscribeSetFocusOnTitle,\n\tsubscribeFeaturedImageIdNativeUpdated,\n} from '@wordpress/react-native-bridge';\nimport { SlotFillProvider } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport Layout from './components/layout';\n\nclass Editor extends Component {\n\tconstructor( props ) {\n\t\tsuper( ...arguments );\n\n\t\t// need to set this globally to avoid race with deprecations\n\t\t// defaulting to true to avoid issues with a not-yet-cached value\n\t\tconst { galleryWithImageBlocks = true } = props;\n\t\twindow.wp.galleryBlockV2Enabled = galleryWithImageBlocks;\n\n\t\tif ( props.initialHtmlModeEnabled && props.mode === 'visual' ) {\n\t\t\t// Enable html mode if the initial mode the parent wants it but we're not already in it.\n\t\t\tthis.props.switchEditorMode( 'text' );\n\t\t}\n\n\t\tthis.getEditorSettings = memize( this.getEditorSettings, {\n\t\t\tmaxSize: 1,\n\t\t} );\n\n\t\tthis.setTitleRef = this.setTitleRef.bind( this );\n\t}\n\n\tgetEditorSettings( settings ) {\n\t\tsettings = {\n\t\t\t...settings,\n\t\t\tisRTL: I18nManager.isRTL,\n\t\t};\n\n\t\treturn settings;\n\t}\n\n\tcomponentDidMount() {\n\t\tconst { editEntityRecord, postType, postId } = this.props;\n\n\t\tthis.subscriptionParentSetFocusOnTitle = subscribeSetFocusOnTitle(\n\t\t\t() => {\n\t\t\t\tif ( this.postTitleRef ) {\n\t\t\t\t\tthis.postTitleRef.focus();\n\t\t\t\t} else {\n\t\t\t\t\t// If the post title ref is not available, we postpone setting focus to when it's available.\n\t\t\t\t\tthis.focusTitleWhenAvailable = true;\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentFeaturedImageIdNativeUpdated =\n\t\t\tsubscribeFeaturedImageIdNativeUpdated( ( payload ) => {\n\t\t\t\teditEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\tpostId,\n\t\t\t\t\t{ featured_media: payload.featuredImageId },\n\t\t\t\t\t{\n\t\t\t\t\t\tundoIgnore: true,\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t} );\n\t}\n\n\tcomponentWillUnmount() {\n\t\tif ( this.subscriptionParentSetFocusOnTitle ) {\n\t\t\tthis.subscriptionParentSetFocusOnTitle.remove();\n\t\t}\n\n\t\tif ( this.subscribeFeaturedImageIdNativeUpdated ) {\n\t\t\tthis.subscribeFeaturedImageIdNativeUpdated.remove();\n\t\t}\n\t}\n\n\tsetTitleRef( titleRef ) {\n\t\tif ( this.focusTitleWhenAvailable && ! this.postTitleRef ) {\n\t\t\tthis.focusTitleWhenAvailable = false;\n\t\t\ttitleRef.focus();\n\t\t}\n\n\t\tthis.postTitleRef = titleRef;\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tsettings,\n\t\t\tinitialEdits,\n\t\t\tpost,\n\t\t\tpostId,\n\t\t\tpostType,\n\t\t\tfeaturedImageId,\n\t\t\tinitialHtml,\n\t\t\t...props\n\t\t} = this.props;\n\n\t\tconst editorSettings = this.getEditorSettings( settings );\n\n\t\tconst normalizedPost = post || {\n\t\t\tid: postId,\n\t\t\ttitle: {\n\t\t\t\traw: props.initialTitle || '',\n\t\t\t},\n\t\t\tfeatured_media: featuredImageId,\n\t\t\tcontent: {\n\t\t\t\t// Make sure the post content is in sync with gutenberg store\n\t\t\t\t// to avoid marking the post as modified when simply loaded\n\t\t\t\t// For now, let's assume: serialize( parse( html ) ) !== html.\n\t\t\t\traw: serialize( parse( initialHtml || '' ) ),\n\t\t\t},\n\t\t\ttype: postType,\n\t\t\tstatus: 'draft',\n\t\t\tmeta: [],\n\t\t};\n\n\t\treturn (\n\t\t\t<GestureHandlerRootView style={ { flex: 1 } }>\n\t\t\t\t<SlotFillProvider>\n\t\t\t\t\t<EditorProvider\n\t\t\t\t\t\tsettings={ editorSettings }\n\t\t\t\t\t\tpost={ normalizedPost }\n\t\t\t\t\t\tinitialEdits={ initialEdits }\n\t\t\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t>\n\t\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t<Layout setTitleRef={ this.setTitleRef } />\n\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t</EditorProvider>\n\t\t\t\t</SlotFillProvider>\n\t\t\t</GestureHandlerRootView>\n\t\t);\n\t}\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst { getEditorMode } = select( editorStore );\n\n\t\treturn {\n\t\t\tmode: getEditorMode(),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { switchEditorMode } = dispatch( editorStore );\n\t\tconst { editEntityRecord } = dispatch( coreStore );\n\t\treturn {\n\t\t\tswitchEditorMode,\n\t\t\teditEntityRecord,\n\t\t};\n\t} ),\n] )( Editor );\n"],"mappings":";;;;;;;;AAGA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,0BAAA,GAAAF,OAAA;AAKA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAKA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,kBAAA,GAAAR,OAAA;AAIA,IAAAS,WAAA,GAAAT,OAAA;AACA,IAAAU,SAAA,GAAAV,OAAA;AAKA,IAAAW,OAAA,GAAAZ,sBAAA,CAAAC,OAAA;AA7BA;AACA;AACA;;AAKA;AACA;AACA;;AAiBA;AACA;AACA;;AAGA,MAAMY,MAAM,SAASC,kBAAS,CAAC;EAC9BC,WAAWA,CAAEC,KAAK,EAAG;IACpB,KAAK,CAAE,GAAGC,SAAU,CAAC;;IAErB;IACA;IAC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L,MAAA,CAAAC,aAAA,EAAC/D,OAAA,CAAAoE,cAAc;MACd3C,QAAQ,EAAGyB,cAAgB;MAC3BF,IAAI,EAAGG,cAAgB;MACvBJ,YAAY,EAAGA,YAAc;MAC7BsB,cAAc,EAAG,KAAO;MAAA,GACnB1D;IAAK,GAEV,IAAAmD,MAAA,CAAAC,aAAA,EAAC/D,OAAA,CAAAsE,aAAa,QACb,IAAAR,MAAA,CAAAC,aAAA,EAACxD,OAAA,CAAAgE,OAAM;MAAChD,WAAW,EAAG,IAAI,CAACA;IAAa,CAAE,CAC5B,CACA,CACC,CACK,CAAC;EAE3B;AACD;AAAC,IAAAiD,QAAA,GAAAC,OAAA,CAAAF,OAAA,GAEc,IAAAG,gBAAO,EAAE,CACvB,IAAAC,gBAAU,EAAIC,MAAM,IAAM;EACzB,MAAM;IAAEC;EAAc,CAAC,GAAGD,MAAM,CAAEE,aAAY,CAAC;EAE/C,OAAO;IACN5D,IAAI,EAAE2D,aAAa,CAAC;EACrB,CAAC;AACF,CAAE,CAAC,EACH,IAAAE,kBAAY,EAAIC,QAAQ,IAAM;EAC7B,MAAM;IAAE7D;EAAiB,CAAC,GAAG6D,QAAQ,CAAEF,aAAY,CAAC;EACpD,MAAM;IAAEjD;EAAiB,CAAC,GAAGmD,QAAQ,CAAEC,eAAU,CAAC;EAClD,OAAO;IACN9D,gBAAgB;IAChBU;EACD,CAAC;AACF,CAAE,CAAC,CACF,CAAC,CAAErB,MAAO,CAAC"}
|
|
1
|
+
{"version":3,"names":["_memize","_interopRequireDefault","require","_reactNative","_reactNativeGestureHandler","_element","_editor","_blocks","_data","_compose","_reactNativeBridge","_components","_coreData","_layout","Editor","Component","constructor","props","arguments","galleryWithImageBlocks","window","wp","galleryBlockV2Enabled","initialHtmlModeEnabled","mode","switchEditorMode","getEditorSettings","memize","maxSize","setTitleRef","bind","settings","isRTL","I18nManager","componentDidMount","editEntityRecord","postType","postId","subscriptionParentSetFocusOnTitle","subscribeSetFocusOnTitle","postTitleRef","focus","focusTitleWhenAvailable","subscriptionParentFeaturedImageIdNativeUpdated","subscribeFeaturedImageIdNativeUpdated","payload","featured_media","featuredImageId","undoIgnore","componentWillUnmount","remove","titleRef","render","initialEdits","post","initialHtml","editorSettings","normalizedPost","id","title","raw","initialTitle","content","serialize","parse","type","status","meta","_react","createElement","GestureHandlerRootView","style","flex","SlotFillProvider","EditorProvider","useSubRegistry","ErrorBoundary","default","_default","exports","compose","withSelect","select","getEditorMode","editorStore","withDispatch","dispatch","coreStore"],"sources":["@wordpress/edit-post/src/editor.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport memize from 'memize';\nimport { I18nManager } from 'react-native';\nimport { GestureHandlerRootView } from 'react-native-gesture-handler';\n\n/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport {\n\tEditorProvider,\n\tErrorBoundary,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { parse, serialize } from '@wordpress/blocks';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\nimport {\n\tsubscribeSetFocusOnTitle,\n\tsubscribeFeaturedImageIdNativeUpdated,\n} from '@wordpress/react-native-bridge';\nimport { SlotFillProvider } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport Layout from './components/layout';\n\nclass Editor extends Component {\n\tconstructor( props ) {\n\t\tsuper( ...arguments );\n\n\t\t// need to set this globally to avoid race with deprecations\n\t\t// defaulting to true to avoid issues with a not-yet-cached value\n\t\tconst { galleryWithImageBlocks = true } = props;\n\t\twindow.wp.galleryBlockV2Enabled = galleryWithImageBlocks;\n\n\t\tif ( props.initialHtmlModeEnabled && props.mode === 'visual' ) {\n\t\t\t// Enable html mode if the initial mode the parent wants it but we're not already in it.\n\t\t\tthis.props.switchEditorMode( 'text' );\n\t\t}\n\n\t\tthis.getEditorSettings = memize( this.getEditorSettings, {\n\t\t\tmaxSize: 1,\n\t\t} );\n\n\t\tthis.setTitleRef = this.setTitleRef.bind( this );\n\t}\n\n\tgetEditorSettings( settings ) {\n\t\tsettings = {\n\t\t\t...settings,\n\t\t\tisRTL: I18nManager.isRTL,\n\t\t};\n\n\t\treturn settings;\n\t}\n\n\tcomponentDidMount() {\n\t\tconst { editEntityRecord, postType, postId } = this.props;\n\n\t\tthis.subscriptionParentSetFocusOnTitle = subscribeSetFocusOnTitle(\n\t\t\t() => {\n\t\t\t\tif ( this.postTitleRef ) {\n\t\t\t\t\tthis.postTitleRef.focus();\n\t\t\t\t} else {\n\t\t\t\t\t// If the post title ref is not available, we postpone setting focus to when it's available.\n\t\t\t\t\tthis.focusTitleWhenAvailable = true;\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentFeaturedImageIdNativeUpdated =\n\t\t\tsubscribeFeaturedImageIdNativeUpdated( ( payload ) => {\n\t\t\t\teditEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\tpostId,\n\t\t\t\t\t{ featured_media: payload.featuredImageId },\n\t\t\t\t\t{\n\t\t\t\t\t\tundoIgnore: true,\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t} );\n\t}\n\n\tcomponentWillUnmount() {\n\t\tif ( this.subscriptionParentSetFocusOnTitle ) {\n\t\t\tthis.subscriptionParentSetFocusOnTitle.remove();\n\t\t}\n\n\t\tif ( this.subscribeFeaturedImageIdNativeUpdated ) {\n\t\t\tthis.subscribeFeaturedImageIdNativeUpdated.remove();\n\t\t}\n\t}\n\n\tsetTitleRef( titleRef ) {\n\t\tif ( this.focusTitleWhenAvailable && ! this.postTitleRef ) {\n\t\t\tthis.focusTitleWhenAvailable = false;\n\t\t\ttitleRef.focus();\n\t\t}\n\n\t\tthis.postTitleRef = titleRef;\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tsettings,\n\t\t\tinitialEdits,\n\t\t\tpost,\n\t\t\tpostId,\n\t\t\tpostType,\n\t\t\tfeaturedImageId,\n\t\t\tinitialHtml,\n\t\t\t...props\n\t\t} = this.props;\n\n\t\tconst editorSettings = this.getEditorSettings( settings );\n\n\t\tconst normalizedPost = post || {\n\t\t\tid: postId,\n\t\t\ttitle: {\n\t\t\t\traw: props.initialTitle || '',\n\t\t\t},\n\t\t\tfeatured_media: featuredImageId,\n\t\t\tcontent: {\n\t\t\t\t// Make sure the post content is in sync with gutenberg store\n\t\t\t\t// to avoid marking the post as modified when simply loaded\n\t\t\t\t// For now, let's assume: serialize( parse( html ) ) !== html.\n\t\t\t\traw: serialize( parse( initialHtml || '' ) ),\n\t\t\t},\n\t\t\ttype: postType,\n\t\t\tstatus: 'draft',\n\t\t\tmeta: [],\n\t\t};\n\n\t\treturn (\n\t\t\t<GestureHandlerRootView style={ { flex: 1 } }>\n\t\t\t\t<SlotFillProvider>\n\t\t\t\t\t<EditorProvider\n\t\t\t\t\t\tsettings={ editorSettings }\n\t\t\t\t\t\tpost={ normalizedPost }\n\t\t\t\t\t\tinitialEdits={ initialEdits }\n\t\t\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t>\n\t\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t<Layout setTitleRef={ this.setTitleRef } />\n\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t</EditorProvider>\n\t\t\t\t</SlotFillProvider>\n\t\t\t</GestureHandlerRootView>\n\t\t);\n\t}\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst { getEditorMode } = select( editorStore );\n\n\t\treturn {\n\t\t\tmode: getEditorMode(),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { switchEditorMode } = dispatch( editorStore );\n\t\tconst { editEntityRecord } = dispatch( coreStore );\n\t\treturn {\n\t\t\tswitchEditorMode,\n\t\t\teditEntityRecord,\n\t\t};\n\t} ),\n] )( Editor );\n"],"mappings":";;;;;;;;AAGA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,O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M;EAC7B,MAAM;IAAE7D;EAAiB,CAAC,GAAG6D,QAAQ,CAAEF,aAAY,CAAC;EACpD,MAAM;IAAEjD;EAAiB,CAAC,GAAGmD,QAAQ,CAAEC,eAAU,CAAC;EAClD,OAAO;IACN9D,gBAAgB;IAChBU;EACD,CAAC;AACF,CAAE,CAAC,CACF,CAAC,CAAErB,MAAO,CAAC","ignoreList":[]}
|
|
@@ -9,12 +9,10 @@ var _i18n = require("@wordpress/i18n");
|
|
|
9
9
|
var _icons = require("@wordpress/icons");
|
|
10
10
|
var _commands = require("@wordpress/commands");
|
|
11
11
|
var _preferences = require("@wordpress/preferences");
|
|
12
|
-
var _interface = require("@wordpress/interface");
|
|
13
12
|
var _editor = require("@wordpress/editor");
|
|
14
13
|
var _notices = require("@wordpress/notices");
|
|
15
|
-
var _keyboardShortcutHelpModal = require("../../components/keyboard-shortcut-help-modal");
|
|
16
|
-
var _preferencesModal = require("../../components/preferences-modal");
|
|
17
14
|
var _store = require("../../store");
|
|
15
|
+
var _lockUnlock = require("../../lock-unlock");
|
|
18
16
|
/**
|
|
19
17
|
* WordPress dependencies
|
|
20
18
|
*/
|
|
@@ -23,14 +21,14 @@ var _store = require("../../store");
|
|
|
23
21
|
* Internal dependencies
|
|
24
22
|
*/
|
|
25
23
|
|
|
24
|
+
const {
|
|
25
|
+
interfaceStore
|
|
26
|
+
} = (0, _lockUnlock.unlock)(_editor.privateApis);
|
|
26
27
|
function useCommonCommands() {
|
|
27
28
|
const {
|
|
28
29
|
openGeneralSidebar,
|
|
29
30
|
closeGeneralSidebar
|
|
30
31
|
} = (0, _data.useDispatch)(_store.store);
|
|
31
|
-
const {
|
|
32
|
-
openModal
|
|
33
|
-
} = (0, _data.useDispatch)(_interface.store);
|
|
34
32
|
const {
|
|
35
33
|
activeSidebar,
|
|
36
34
|
isFullscreen,
|
|
@@ -40,7 +38,7 @@ function useCommonCommands() {
|
|
|
40
38
|
get
|
|
41
39
|
} = select(_preferences.store);
|
|
42
40
|
return {
|
|
43
|
-
activeSidebar: select(
|
|
41
|
+
activeSidebar: select(interfaceStore).getActiveComplementaryArea('core'),
|
|
44
42
|
isPublishSidebarEnabled: select(_editor.store).isPublishSidebarEnabled(),
|
|
45
43
|
isFullscreen: get('core/edit-post', 'fullscreenMode')
|
|
46
44
|
};
|
|
@@ -102,21 +100,6 @@ function useCommonCommands() {
|
|
|
102
100
|
});
|
|
103
101
|
}
|
|
104
102
|
});
|
|
105
|
-
(0, _commands.useCommand)({
|
|
106
|
-
name: 'core/open-preferences',
|
|
107
|
-
label: (0, _i18n.__)('Editor preferences'),
|
|
108
|
-
callback: () => {
|
|
109
|
-
openModal(_preferencesModal.PREFERENCES_MODAL_NAME);
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
(0, _commands.useCommand)({
|
|
113
|
-
name: 'core/open-shortcut-help',
|
|
114
|
-
label: (0, _i18n.__)('Keyboard shortcuts'),
|
|
115
|
-
icon: _icons.keyboard,
|
|
116
|
-
callback: () => {
|
|
117
|
-
openModal(_keyboardShortcutHelpModal.KEYBOARD_SHORTCUT_HELP_MODAL_NAME);
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
103
|
(0, _commands.useCommand)({
|
|
121
104
|
name: 'core/toggle-publish-sidebar',
|
|
122
105
|
label: isPublishSidebarEnabled ? (0, _i18n.__)('Disable pre-publish checks') : (0, _i18n.__)('Enable pre-publish checks'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_i18n","_icons","_commands","_preferences","
|
|
1
|
+
{"version":3,"names":["_data","require","_i18n","_icons","_commands","_preferences","_editor","_notices","_store","_lockUnlock","interfaceStore","unlock","editorPrivateApis","useCommonCommands","openGeneralSidebar","closeGeneralSidebar","useDispatch","editPostStore","activeSidebar","isFullscreen","isPublishSidebarEnabled","useSelect","select","get","preferencesStore","getActiveComplementaryArea","editorStore","toggle","createInfoNotice","noticesStore","useCommand","name","label","__","icon","isRTL","drawerLeft","drawerRight","callback","close","blockDefault","fullscreen","id","type","actions","onClick","formatListBullets"],"sources":["@wordpress/edit-post/src/hooks/commands/use-common-commands.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, isRTL } from '@wordpress/i18n';\nimport {\n\tdrawerLeft,\n\tdrawerRight,\n\tblockDefault,\n\tfullscreen,\n\tformatListBullets,\n} from '@wordpress/icons';\nimport { useCommand } from '@wordpress/commands';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { interfaceStore } = unlock( editorPrivateApis );\n\nexport default function useCommonCommands() {\n\tconst { openGeneralSidebar, closeGeneralSidebar } =\n\t\tuseDispatch( editPostStore );\n\tconst { activeSidebar, isFullscreen, isPublishSidebarEnabled } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { get } = select( preferencesStore );\n\n\t\t\treturn {\n\t\t\t\tactiveSidebar:\n\t\t\t\t\tselect( interfaceStore ).getActiveComplementaryArea(\n\t\t\t\t\t\t'core'\n\t\t\t\t\t),\n\t\t\t\tisPublishSidebarEnabled:\n\t\t\t\t\tselect( editorStore ).isPublishSidebarEnabled(),\n\t\t\t\tisFullscreen: get( 'core/edit-post', 'fullscreenMode' ),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst { toggle } = useDispatch( preferencesStore );\n\tconst { createInfoNotice } = useDispatch( noticesStore );\n\n\tuseCommand( {\n\t\tname: 'core/open-settings-sidebar',\n\t\tlabel: __( 'Toggle settings sidebar' ),\n\t\ticon: isRTL() ? drawerLeft : drawerRight,\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\tif ( activeSidebar === 'edit-post/document' ) {\n\t\t\t\tcloseGeneralSidebar();\n\t\t\t} else {\n\t\t\t\topenGeneralSidebar( 'edit-post/document' );\n\t\t\t}\n\t\t},\n\t} );\n\n\tuseCommand( {\n\t\tname: 'core/open-block-inspector',\n\t\tlabel: __( 'Toggle block inspector' ),\n\t\ticon: blockDefault,\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\tif ( activeSidebar === 'edit-post/block' ) {\n\t\t\t\tcloseGeneralSidebar();\n\t\t\t} else {\n\t\t\t\topenGeneralSidebar( 'edit-post/block' );\n\t\t\t}\n\t\t},\n\t} );\n\n\tuseCommand( {\n\t\tname: 'core/toggle-fullscreen-mode',\n\t\tlabel: isFullscreen\n\t\t\t? __( 'Exit fullscreen' )\n\t\t\t: __( 'Enter fullscreen' ),\n\t\ticon: fullscreen,\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggle( 'core/edit-post', 'fullscreenMode' );\n\t\t\tclose();\n\t\t\tcreateInfoNotice(\n\t\t\t\tisFullscreen ? __( 'Fullscreen off.' ) : __( 'Fullscreen on.' ),\n\t\t\t\t{\n\t\t\t\t\tid: 'core/edit-post/toggle-fullscreen-mode/notice',\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tactions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\ttoggle( 'core/edit-post', 'fullscreenMode' );\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\t} );\n\n\tuseCommand( {\n\t\tname: 'core/toggle-publish-sidebar',\n\t\tlabel: isPublishSidebarEnabled\n\t\t\t? __( 'Disable pre-publish checks' )\n\t\t\t: __( 'Enable pre-publish checks' ),\n\t\ticon: formatListBullets,\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\ttoggle( 'core', 'isPublishSidebarEnabled' );\n\t\t\tcreateInfoNotice(\n\t\t\t\tisPublishSidebarEnabled\n\t\t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QAAE,EAAE,gBAAiB,CAAC,EAC/D;QACCS,EAAE,EAAE,8CAA8C;QAClDC,IAAI,EAAE,UAAU;QAChBC,OAAO,EAAE,CACR;UACCZ,KAAK,EAAE,IAAAC,QAAE,EAAE,MAAO,CAAC;UACnBY,OAAO,EAAEA,CAAA,KAAM;YACdlB,MAAM,CAAE,gBAAgB,EAAE,gBAAiB,CAAC;UAC7C;QACD,CAAC;MAEH,CACD,CAAC;IACF;EACD,CAAE,CAAC;EAEH,IAAAG,oBAAU,EAAE;IACXC,IAAI,EAAE,6BAA6B;IACnCC,KAAK,EAAEZ,uBAAuB,GAC3B,IAAAa,QAAE,EAAE,4BAA6B,CAAC,GAClC,IAAAA,QAAE,EAAE,2BAA4B,CAAC;IACpCC,IAAI,EAAEY,wBAAiB;IACvBR,QAAQ,EAAEA,CAAE;MAAEC;IAAM,CAAC,KAAM;MAC1BA,KAAK,CAAC,CAAC;MACPZ,MAAM,CAAE,MAAM,EAAE,yBAA0B,CAAC;MAC3CC,gBAAgB,CACfR,uBAAuB,GACpB,IAAAa,QAAE,EAAE,8BAA+B,CAAC,GACpC,IAAAA,QAAE,EAAE,6BAA8B,CAAC,EACtC;QACCS,EAAE,EAAE,oCAAoC;QACxCC,IAAI,EAAE;MACP,CACD,CAAC;IACF;EACD,CAAE,CAAC;AACJ","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_hooks","require","_mediaUtils","replaceMediaUpload","MediaUpload","addFilter"],"sources":["@wordpress/edit-post/src/hooks/components/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { MediaUpload } from '@wordpress/media-utils';\n\nconst replaceMediaUpload = () => MediaUpload;\n\naddFilter(\n\t'editor.MediaUpload',\n\t'core/edit-post/replace-media-upload',\n\treplaceMediaUpload\n);\n"],"mappings":";;AAGA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA,MAAME,kBAAkB,GAAGA,CAAA,KAAMC,uBAAW;AAE5C,IAAAC,gBAAS,EACR,oBAAoB,EACpB,qCAAqC,EACrCF,kBACD,CAAC"}
|
|
1
|
+
{"version":3,"names":["_hooks","require","_mediaUtils","replaceMediaUpload","MediaUpload","addFilter"],"sources":["@wordpress/edit-post/src/hooks/components/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { MediaUpload } from '@wordpress/media-utils';\n\nconst replaceMediaUpload = () => MediaUpload;\n\naddFilter(\n\t'editor.MediaUpload',\n\t'core/edit-post/replace-media-upload',\n\treplaceMediaUpload\n);\n"],"mappings":";;AAGA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA,MAAME,kBAAkB,GAAGA,CAAA,KAAMC,uBAAW;AAE5C,IAAAC,gBAAS,EACR,oBAAoB,EACpB,qCAAqC,EACrCF,kBACD,CAAC","ignoreList":[]}
|
package/build/hooks/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["require"],"sources":["@wordpress/edit-post/src/hooks/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport './components';\nimport './validate-multiple-use';\n"],"mappings":";;AAGAA,OAAA;AACAA,OAAA"}
|
|
1
|
+
{"version":3,"names":["require"],"sources":["@wordpress/edit-post/src/hooks/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport './components';\nimport './validate-multiple-use';\n"],"mappings":";;AAGAA,OAAA;AACAA,OAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_data","_editor","useNavigateToEntityRecord","initialPostId","initialPostType","defaultRenderingMode","postHistory","dispatch","useReducer","historyState","type","post","previousRenderingMode","length","slice","postId","postType","getRenderingMode","useSelect","editorStore","setRenderingMode","useDispatch","onNavigateToEntityRecord","useCallback","params","onNavigateToPreviousEntityRecord","currentPost","undefined"],"sources":["@wordpress/edit-post/src/hooks/use-navigate-to-entity-record.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback, useReducer } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * A hook that records the 'entity' history in the post editor as a user\n * navigates between editing a post and editing the post template or patterns.\n *\n * Implemented as a stack, so a little similar to the browser history API.\n *\n * Used to control displaying UI elements like the back button.\n *\n * @param {number} initialPostId The post id of the post when the editor loaded.\n * @param {string} initialPostType The post type of the post when the editor loaded.\n * @param {string} defaultRenderingMode The rendering mode to switch to when navigating.\n *\n * @return {Object} An object containing the `currentPost` variable and\n * `onNavigateToEntityRecord` and `onNavigateToPreviousEntityRecord` functions.\n */\nexport default function useNavigateToEntityRecord(\n\tinitialPostId,\n\tinitialPostType,\n\tdefaultRenderingMode\n) {\n\tconst [ postHistory, dispatch ] = useReducer(\n\t\t( historyState, { type, post, previousRenderingMode } ) => {\n\t\t\tif ( type === 'push' ) {\n\t\t\t\treturn [ ...historyState, { post, previousRenderingMode } ];\n\t\t\t}\n\t\t\tif ( type === 'pop' ) {\n\t\t\t\t// Try to leave one item in the history.\n\t\t\t\tif ( historyState.length > 1 ) {\n\t\t\t\t\treturn historyState.slice( 0, -1 );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn historyState;\n\t\t},\n\t\t[\n\t\t\t{\n\t\t\t\tpost: { postId: initialPostId, postType: initialPostType },\n\t\t\t},\n\t\t]\n\t);\n\n\tconst { post, previousRenderingMode } =\n\t\tpostHistory[ postHistory.length - 1 ];\n\n\tconst { getRenderingMode } = useSelect( editorStore );\n\tconst { setRenderingMode } = useDispatch( editorStore );\n\n\tconst onNavigateToEntityRecord = useCallback(\n\t\t( params ) => {\n\t\t\tdispatch( {\n\t\t\t\ttype: 'push',\n\t\t\t\tpost: { postId: params.postId, postType: params.postType },\n\t\t\t\t// Save the current rendering mode so we can restore it when navigating back.\n\t\t\t\tpreviousRenderingMode: getRenderingMode(),\n\t\t\t} );\n\t\t\tsetRenderingMode( defaultRenderingMode );\n\t\t},\n\t\t[ getRenderingMode, setRenderingMode, defaultRenderingMode ]\n\t);\n\n\tconst onNavigateToPreviousEntityRecord = useCallback( () => {\n\t\tdispatch( { type: 'pop' } );\n\t\tif ( previousRenderingMode ) {\n\t\t\tsetRenderingMode( previousRenderingMode );\n\t\t}\n\t}, [ setRenderingMode, previousRenderingMode ] );\n\n\treturn {\n\t\tcurrentPost: post,\n\t\tonNavigateToEntityRecord,\n\t\tonNavigateToPreviousEntityRecord:\n\t\t\tpostHistory.length > 1\n\t\t\t\t? onNavigateToPreviousEntityRecord\n\t\t\t\t: undefined,\n\t};\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AALA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASG,yBAAyBA,CAChDC,aAAa,EACbC,eAAe,EACfC,oBAAoB,EACnB;EACD,MAAM,CAAEC,WAAW,EAAEC,QAAQ,CAAE,GAAG,IAAAC,mBAAU,EAC3C,CAAEC,YAAY,EAAE;IAAEC,IAAI;IAAEC,IAAI;IAAEC;EAAsB,CAAC,KAAM;IAC1D,IAAKF,IAAI,KAAK,MAAM,EAAG;MACtB,OAAO,CAAE,GAAGD,YAAY,EAAE;QAAEE,IAAI;QAAEC;MAAsB,CAAC,CAAE;IAC5D;IACA,IAAKF,IAAI,KAAK,KAAK,EAAG;MACrB;MACA,IAAKD,YAAY,CAACI,MAAM,GAAG,CAAC,EAAG;QAC9B,OAAOJ,YAAY,CAACK,KAAK,CAAE,CAAC,EAAE,CAAC,CAAE,CAAC;MACnC;IACD;IACA,OAAOL,YAAY;EACpB,CAAC,EACD,CACC;IACCE,IAAI,EAAE;MAAEI,MAAM,EAAEZ,aAAa;MAAEa,QAAQ,EAAEZ;IAAgB;EAC1D,CAAC,CAEH,CAAC;EAED,MAAM;IAAEO,IAAI;IAAEC;EAAsB,CAAC,GACpCN,WAAW,CAAEA,WAAW,CAACO,MAAM,GAAG,CAAC,CAAE;EAEtC,MAAM;IAAEI;EAAiB,CAAC,GAAG,IAAAC,eAAS,EAAEC,aAAY,CAAC;EACrD,MAAM;IAAEC;EAAiB,CAAC,GAAG,IAAAC,iBAAW,EAAEF,aAAY,CAAC;EAEvD,MAAMG,wBAAwB,GAAG,IAAAC,oBAAW,EACzCC,MAAM,IAAM;IACbjB,QAAQ,CAAE;MACTG,IAAI,EAAE,MAAM;MACZC,IAAI,EAAE;QAAEI,MAAM,EAAES,MAAM,CAACT,MAAM;QAAEC,QAAQ,EAAEQ,MAAM,CAACR;MAAS,CAAC;MAC1D;MACAJ,qBAAqB,EAAEK,gBAAgB,CAAC;IACzC,CAAE,CAAC;IACHG,gBAAgB,CAAEf,oBAAqB,CAAC;EACzC,CAAC,EACD,CAAEY,gBAAgB,EAAEG,gBAAgB,EAAEf,oBAAoB,CAC3D,CAAC;EAED,MAAMoB,gCAAgC,GAAG,IAAAF,oBAAW,EAAE,MAAM;IAC3DhB,QAAQ,CAAE;MAAEG,IAAI,EAAE;IAAM,CAAE,CAAC;IAC3B,IAAKE,qBAAqB,EAAG;MAC5BQ,gBAAgB,CAAER,qBAAsB,CAAC;IAC1C;EACD,CAAC,EAAE,CAAEQ,gBAAgB,EAAER,qBAAqB,CAAG,CAAC;EAEhD,OAAO;IACNc,WAAW,EAAEf,IAAI;IACjBW,wBAAwB;IACxBG,gCAAgC,EAC/BnB,WAAW,CAACO,MAAM,GAAG,CAAC,GACnBY,gCAAgC,GAChCE;EACL,CAAC;AACF"}
|
|
1
|
+
{"version":3,"names":["_element","require","_data","_editor","useNavigateToEntityRecord","initialPostId","initialPostType","defaultRenderingMode","postHistory","dispatch","useReducer","historyState","type","post","previousRenderingMode","length","slice","postId","postType","getRenderingMode","useSelect","editorStore","setRenderingMode","useDispatch","onNavigateToEntityRecord","useCallback","params","onNavigateToPreviousEntityRecord","currentPost","undefined"],"sources":["@wordpress/edit-post/src/hooks/use-navigate-to-entity-record.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback, useReducer } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * A hook that records the 'entity' history in the post editor as a user\n * navigates between editing a post and editing the post template or patterns.\n *\n * Implemented as a stack, so a little similar to the browser history API.\n *\n * Used to control displaying UI elements like the back button.\n *\n * @param {number} initialPostId The post id of the post when the editor loaded.\n * @param {string} initialPostType The post type of the post when the editor loaded.\n * @param {string} defaultRenderingMode The rendering mode to switch to when navigating.\n *\n * @return {Object} An object containing the `currentPost` variable and\n * `onNavigateToEntityRecord` and `onNavigateToPreviousEntityRecord` functions.\n */\nexport default function useNavigateToEntityRecord(\n\tinitialPostId,\n\tinitialPostType,\n\tdefaultRenderingMode\n) {\n\tconst [ postHistory, dispatch ] = useReducer(\n\t\t( historyState, { type, post, previousRenderingMode } ) => {\n\t\t\tif ( type === 'push' ) {\n\t\t\t\treturn [ ...historyState, { post, previousRenderingMode } ];\n\t\t\t}\n\t\t\tif ( type === 'pop' ) {\n\t\t\t\t// Try to leave one item in the history.\n\t\t\t\tif ( historyState.length > 1 ) {\n\t\t\t\t\treturn historyState.slice( 0, -1 );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn historyState;\n\t\t},\n\t\t[\n\t\t\t{\n\t\t\t\tpost: { postId: initialPostId, postType: initialPostType },\n\t\t\t},\n\t\t]\n\t);\n\n\tconst { post, previousRenderingMode } =\n\t\tpostHistory[ postHistory.length - 1 ];\n\n\tconst { getRenderingMode } = useSelect( editorStore );\n\tconst { setRenderingMode } = useDispatch( editorStore );\n\n\tconst onNavigateToEntityRecord = useCallback(\n\t\t( params ) => {\n\t\t\tdispatch( {\n\t\t\t\ttype: 'push',\n\t\t\t\tpost: { postId: params.postId, postType: params.postType },\n\t\t\t\t// Save the current rendering mode so we can restore it when navigating back.\n\t\t\t\tpreviousRenderingMode: getRenderingMode(),\n\t\t\t} );\n\t\t\tsetRenderingMode( defaultRenderingMode );\n\t\t},\n\t\t[ getRenderingMode, setRenderingMode, defaultRenderingMode ]\n\t);\n\n\tconst onNavigateToPreviousEntityRecord = useCallback( () => {\n\t\tdispatch( { type: 'pop' } );\n\t\tif ( previousRenderingMode ) {\n\t\t\tsetRenderingMode( previousRenderingMode );\n\t\t}\n\t}, [ setRenderingMode, previousRenderingMode ] );\n\n\treturn {\n\t\tcurrentPost: post,\n\t\tonNavigateToEntityRecord,\n\t\tonNavigateToPreviousEntityRecord:\n\t\t\tpostHistory.length > 1\n\t\t\t\t? onNavigateToPreviousEntityRecord\n\t\t\t\t: undefined,\n\t};\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AALA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASG,yBAAyBA,CAChDC,aAAa,EACbC,eAAe,EACfC,oBAAoB,EACnB;EACD,MAAM,CAAEC,WAAW,EAAEC,QAAQ,CAAE,GAAG,IAAAC,mBAAU,EAC3C,CAAEC,YAAY,EAAE;IAAEC,IAAI;IAAEC,IAAI;IAAEC;EAAsB,CAAC,KAAM;IAC1D,IAAKF,IAAI,KAAK,MAAM,EAAG;MACtB,OAAO,CAAE,GAAGD,YAAY,EAAE;QAAEE,IAAI;QAAEC;MAAsB,CAAC,CAAE;IAC5D;IACA,IAAKF,IAAI,KAAK,KAAK,EAAG;MACrB;MACA,IAAKD,YAAY,CAACI,MAAM,GAAG,CAAC,EAAG;QAC9B,OAAOJ,YAAY,CAACK,KAAK,CAAE,CAAC,EAAE,CAAC,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|
-
{"version":3,"names":["_blocks","require","_components","_data","_blockEditor","_hooks","_i18n","_compose","findFirstOfSameType","blocks","name","Array","isArray","length","block","firstBlock","innerBlocks","enhance","compose","withSelect","select","multiple","hasBlockSupport","blockEditorStore","getBlocks","firstOfSameType","isInvalid","clientId","originalBlockClientId","withDispatch","dispatch","selectFirst","selectBlock","withMultipleValidation","createHigherOrderComponent","BlockEdit","props","_react","createElement","blockType","getBlockType","outboundType","getOutboundType","key","style","minHeight","Warning","actions","Button","variant","onClick","__","onReplace","createBlock","attributes","title","blockName","transform","findTransform","getBlockTransforms","type","addFilter"],"sources":["@wordpress/edit-post/src/hooks/validate-multiple-use/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tcreateBlock,\n\tfindTransform,\n\tgetBlockTransforms,\n\tgetBlockType,\n\thasBlockSupport,\n} from '@wordpress/blocks';\nimport { Button } from '@wordpress/components';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { Warning, store as blockEditorStore } from '@wordpress/block-editor';\nimport { addFilter } from '@wordpress/hooks';\nimport { __ } from '@wordpress/i18n';\nimport { compose, createHigherOrderComponent } from '@wordpress/compose';\n\n/**\n * Recursively find very first block of an specific block type.\n *\n * @param {Object[]} blocks List of blocks.\n * @param {string} name Block name to search.\n *\n * @return {Object|undefined} Return block object or undefined.\n */\nfunction findFirstOfSameType( blocks, name ) {\n\tif ( ! Array.isArray( blocks ) || ! blocks.length ) {\n\t\treturn;\n\t}\n\n\tfor ( const block of blocks ) {\n\t\tif ( block.name === name ) {\n\t\t\treturn block;\n\t\t}\n\n\t\t// Search inside innerBlocks.\n\t\tconst firstBlock = findFirstOfSameType( block.innerBlocks, name );\n\n\t\tif ( firstBlock ) {\n\t\t\treturn firstBlock;\n\t\t}\n\t}\n}\n\nconst enhance = compose(\n\t/**\n\t * For blocks whose block type doesn't support `multiple`, provides the\n\t * wrapped component with `originalBlockClientId` -- a reference to the\n\t * first block of the same type in the content -- if and only if that\n\t * \"original\" block is not the current one. Thus, an inexisting\n\t * `originalBlockClientId` prop signals that the block is valid.\n\t *\n\t * @param {Component} WrappedBlockEdit A filtered BlockEdit instance.\n\t *\n\t * @return {Component} Enhanced component with merged state data props.\n\t */\n\twithSelect( ( select, block ) => {\n\t\tconst multiple = hasBlockSupport( block.name, 'multiple', true );\n\n\t\t// For block types with `multiple` support, there is no \"original\n\t\t// block\" to be found in the content, as the block itself is valid.\n\t\tif ( multiple ) {\n\t\t\treturn {};\n\t\t}\n\n\t\t// Otherwise, only pass `originalBlockClientId` if it refers to a different\n\t\t// block from the current one.\n\t\tconst blocks = select( blockEditorStore ).getBlocks();\n\t\tconst firstOfSameType = findFirstOfSameType( blocks, block.name );\n\t\tconst isInvalid =\n\t\t\tfirstOfSameType && firstOfSameType.clientId !== block.clientId;\n\t\treturn {\n\t\t\toriginalBlockClientId: isInvalid && firstOfSameType.clientId,\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch, { originalBlockClientId } ) => ( {\n\t\tselectFirst: () =>\n\t\t\tdispatch( blockEditorStore ).selectBlock( originalBlockClientId ),\n\t} ) )\n);\n\nconst withMultipleValidation = createHigherOrderComponent( ( BlockEdit ) => {\n\treturn enhance( ( { originalBlockClientId, selectFirst, ...props } ) => {\n\t\tif ( ! originalBlockClientId ) {\n\t\t\treturn <BlockEdit { ...props } />;\n\t\t}\n\n\t\tconst blockType = getBlockType( props.name );\n\t\tconst outboundType = getOutboundType( props.name );\n\n\t\treturn [\n\t\t\t<div key=\"invalid-preview\" style={ { minHeight: '60px' } }>\n\t\t\t\t<BlockEdit key=\"block-edit\" { ...props } />\n\t\t\t</div>,\n\t\t\t<Warning\n\t\t\t\tkey=\"multiple-use-warning\"\n\t\t\t\tactions={ [\n\t\t\t\t\t<Button\n\t\t\t\t\t\tkey=\"find-original\"\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\tonClick={ selectFirst }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Find original' ) }\n\t\t\t\t\t</Button>,\n\t\t\t\t\t<Button\n\t\t\t\t\t\tkey=\"remove\"\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\tonClick={ () => props.onReplace( [] ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Remove' ) }\n\t\t\t\t\t</Button>,\n\t\t\t\t\toutboundType && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tkey=\"transform\"\n\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\tprops.onReplace(\n\t\t\t\t\t\t\t\t\tcreateBlock(\n\t\t\t\t\t\t\t\t\t\toutboundType.name,\n\t\t\t\t\t\t\t\t\t\tprops.attributes\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Transform into:' ) } { outboundType.title }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t),\n\t\t\t\t] }\n\t\t\t>\n\t\t\t\t<strong>{ blockType?.title }: </strong>\n\t\t\t\t{ __( 'This block can only be used once.' ) }\n\t\t\t</Warning>,\n\t\t];\n\t} );\n}, 'withMultipleValidation' );\n\n/**\n * Given a base block name, returns the default block type to which to offer\n * transforms.\n *\n * @param {string} blockName Base block name.\n *\n * @return {?Object} The chosen default block type.\n */\nfunction getOutboundType( blockName ) {\n\t// Grab the first outbound transform.\n\tconst transform = findTransform(\n\t\tgetBlockTransforms( 'to', blockName ),\n\t\t( { type, blocks } ) => type === 'block' && blocks.length === 1 // What about when .length > 1?\n\t);\n\n\tif ( ! transform ) {\n\t\treturn null;\n\t}\n\n\treturn getBlockType( transform.blocks[ 0 ] );\n}\n\naddFilter(\n\t'editor.BlockEdit',\n\t'core/edit-post/validate-multiple-use/with-multiple-validation',\n\twithMultipleValidation\n);\n"],"mappings":";;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAOA,IAAAC,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5B,sBACD,CAAC"}
|
|
1
|
+
{"version":3,"names":["_blocks","require","_components","_data","_blockEditor","_hooks","_i18n","_compose","findFirstOfSameType","blocks","name","Array","isArray","length","block","firstBlock","innerBlocks","enhance","compose","withSelect","select","multiple","hasBlockSupport","blockEditorStore","getBlocks","firstOfSameType","isInvalid","clientId","originalBlockClientId","withDispatch","dispatch","selectFirst","selectBlock","withMultipleValidation","createHigherOrderComponent","BlockEdit","props","_react","createElement","blockType","getBlockType","outboundType","getOutboundType","key","style","minHeight","Warning","actions","Button","variant","onClick","__","onReplace","createBlock","attributes","title","blockName","transform","findTransform","getBlockTransforms","type","addFilter"],"sources":["@wordpress/edit-post/src/hooks/validate-multiple-use/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tcreateBlock,\n\tfindTransform,\n\tgetBlockTransforms,\n\tgetBlockType,\n\thasBlockSupport,\n} from '@wordpress/blocks';\nimport { Button } from '@wordpress/components';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { Warning, store as blockEditorStore } from '@wordpress/block-editor';\nimport { addFilter } from '@wordpress/hooks';\nimport { __ } from '@wordpress/i18n';\nimport { compose, createHigherOrderComponent } from '@wordpress/compose';\n\n/**\n * Recursively find very first block of an specific block type.\n *\n * @param {Object[]} blocks List of blocks.\n * @param {string} name Block name to search.\n *\n * @return {Object|undefined} Return block object or undefined.\n */\nfunction findFirstOfSameType( blocks, name ) {\n\tif ( ! Array.isArray( blocks ) || ! blocks.length ) {\n\t\treturn;\n\t}\n\n\tfor ( const block of blocks ) {\n\t\tif ( block.name === name ) {\n\t\t\treturn block;\n\t\t}\n\n\t\t// Search inside innerBlocks.\n\t\tconst firstBlock = findFirstOfSameType( block.innerBlocks, name );\n\n\t\tif ( firstBlock ) {\n\t\t\treturn firstBlock;\n\t\t}\n\t}\n}\n\nconst enhance = compose(\n\t/**\n\t * For blocks whose block type doesn't support `multiple`, provides the\n\t * wrapped component with `originalBlockClientId` -- a reference to the\n\t * first block of the same type in the content -- if and only if that\n\t * \"original\" block is not the current one. Thus, an inexisting\n\t * `originalBlockClientId` prop signals that the block is valid.\n\t *\n\t * @param {Component} WrappedBlockEdit A filtered BlockEdit instance.\n\t *\n\t * @return {Component} Enhanced component with merged state data props.\n\t */\n\twithSelect( ( select, block ) => {\n\t\tconst multiple = hasBlockSupport( block.name, 'multiple', true );\n\n\t\t// For block types with `multiple` support, there is no \"original\n\t\t// block\" to be found in the content, as the block itself is valid.\n\t\tif ( multiple ) {\n\t\t\treturn {};\n\t\t}\n\n\t\t// Otherwise, only pass `originalBlockClientId` if it refers to a different\n\t\t// block from the current one.\n\t\tconst blocks = select( blockEditorStore ).getBlocks();\n\t\tconst firstOfSameType = findFirstOfSameType( blocks, block.name );\n\t\tconst isInvalid =\n\t\t\tfirstOfSameType && firstOfSameType.clientId !== block.clientId;\n\t\treturn {\n\t\t\toriginalBlockClientId: isInvalid && firstOfSameType.clientId,\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch, { originalBlockClientId } ) => ( {\n\t\tselectFirst: () =>\n\t\t\tdispatch( blockEditorStore ).selectBlock( originalBlockClientId ),\n\t} ) )\n);\n\nconst withMultipleValidation = createHigherOrderComponent( ( BlockEdit ) => {\n\treturn enhance( ( { originalBlockClientId, selectFirst, ...props } ) => {\n\t\tif ( ! originalBlockClientId ) {\n\t\t\treturn <BlockEdit { ...props } />;\n\t\t}\n\n\t\tconst blockType = getBlockType( props.name );\n\t\tconst outboundType = getOutboundType( props.name );\n\n\t\treturn [\n\t\t\t<div key=\"invalid-preview\" style={ { minHeight: '60px' } }>\n\t\t\t\t<BlockEdit key=\"block-edit\" { ...props } />\n\t\t\t</div>,\n\t\t\t<Warning\n\t\t\t\tkey=\"multiple-use-warning\"\n\t\t\t\tactions={ [\n\t\t\t\t\t<Button\n\t\t\t\t\t\tkey=\"find-original\"\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\tonClick={ selectFirst }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Find original' ) }\n\t\t\t\t\t</Button>,\n\t\t\t\t\t<Button\n\t\t\t\t\t\tkey=\"remove\"\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\tonClick={ () => props.onReplace( [] ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Remove' ) }\n\t\t\t\t\t</Button>,\n\t\t\t\t\toutboundType && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tkey=\"transform\"\n\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\tprops.onReplace(\n\t\t\t\t\t\t\t\t\tcreateBlock(\n\t\t\t\t\t\t\t\t\t\toutboundType.name,\n\t\t\t\t\t\t\t\t\t\tprops.attributes\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Transform into:' ) } { outboundType.title }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t),\n\t\t\t\t] }\n\t\t\t>\n\t\t\t\t<strong>{ blockType?.title }: </strong>\n\t\t\t\t{ __( 'This block can only be used once.' ) }\n\t\t\t</Warning>,\n\t\t];\n\t} );\n}, 'withMultipleValidation' );\n\n/**\n * Given a base block name, returns the default block type to which to offer\n * transforms.\n *\n * @param {string} blockName Base block name.\n *\n * @return {?Object} The chosen default block type.\n */\nfunction getOutboundType( blockName ) {\n\t// Grab the first outbound transform.\n\tconst transform = findTransform(\n\t\tgetBlockTransforms( 'to', blockName ),\n\t\t( { type, blocks } ) => type === 'block' && blocks.length === 1 // What about when .length > 1?\n\t);\n\n\tif ( ! transform ) {\n\t\treturn null;\n\t}\n\n\treturn getBlockType( transform.blocks[ 0 ] );\n}\n\naddFilter(\n\t'editor.BlockEdit',\n\t'core/edit-post/validate-multiple-use/with-multiple-validation',\n\twithMultipleValidation\n);\n"],"mappings":";;;AAGA,IAAAA,OAAA,G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AkB,EAClB,+DAA+D,EAC/D5B,sBACD,CAAC","ignoreList":[]}
|
package/build/index.js
CHANGED
|
@@ -19,7 +19,7 @@ Object.defineProperty(exports, "PluginDocumentSettingPanel", {
|
|
|
19
19
|
Object.defineProperty(exports, "PluginMoreMenuItem", {
|
|
20
20
|
enumerable: true,
|
|
21
21
|
get: function () {
|
|
22
|
-
return
|
|
22
|
+
return _editor.PluginMoreMenuItem;
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
25
|
Object.defineProperty(exports, "PluginPostPublishPanel", {
|
|
@@ -31,7 +31,7 @@ Object.defineProperty(exports, "PluginPostPublishPanel", {
|
|
|
31
31
|
Object.defineProperty(exports, "PluginPostStatusInfo", {
|
|
32
32
|
enumerable: true,
|
|
33
33
|
get: function () {
|
|
34
|
-
return
|
|
34
|
+
return _editor.PluginPostStatusInfo;
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
37
|
Object.defineProperty(exports, "PluginPrePublishPanel", {
|
|
@@ -43,13 +43,13 @@ Object.defineProperty(exports, "PluginPrePublishPanel", {
|
|
|
43
43
|
Object.defineProperty(exports, "PluginSidebar", {
|
|
44
44
|
enumerable: true,
|
|
45
45
|
get: function () {
|
|
46
|
-
return
|
|
46
|
+
return _editor.PluginSidebar;
|
|
47
47
|
}
|
|
48
48
|
});
|
|
49
49
|
Object.defineProperty(exports, "PluginSidebarMoreMenuItem", {
|
|
50
50
|
enumerable: true,
|
|
51
51
|
get: function () {
|
|
52
|
-
return
|
|
52
|
+
return _editor.PluginSidebarMoreMenuItem;
|
|
53
53
|
}
|
|
54
54
|
});
|
|
55
55
|
Object.defineProperty(exports, "__experimentalFullscreenModeClose", {
|
|
@@ -86,12 +86,8 @@ require("./hooks");
|
|
|
86
86
|
require("./plugins");
|
|
87
87
|
var _editor2 = _interopRequireDefault(require("./editor"));
|
|
88
88
|
var _lockUnlock = require("./lock-unlock");
|
|
89
|
-
var _pluginMoreMenuItem = _interopRequireDefault(require("./components/header/plugin-more-menu-item"));
|
|
90
89
|
var _pluginPostPublishPanel = _interopRequireDefault(require("./components/sidebar/plugin-post-publish-panel"));
|
|
91
|
-
var _pluginPostStatusInfo = _interopRequireDefault(require("./components/sidebar/plugin-post-status-info"));
|
|
92
90
|
var _pluginPrePublishPanel = _interopRequireDefault(require("./components/sidebar/plugin-pre-publish-panel"));
|
|
93
|
-
var _pluginSidebar = _interopRequireDefault(require("./components/sidebar/plugin-sidebar"));
|
|
94
|
-
var _pluginSidebarMoreMenuItem = _interopRequireDefault(require("./components/header/plugin-sidebar-more-menu-item"));
|
|
95
91
|
var _fullscreenModeClose = _interopRequireDefault(require("./components/header/fullscreen-mode-close"));
|
|
96
92
|
var _mainDashboardButton = _interopRequireDefault(require("./components/header/main-dashboard-button"));
|
|
97
93
|
var _store = require("./store");
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_blocks","require","_blockLibrary","_deprecated","_interopRequireDefault","_element","_data","_preferences","_widgets","_editor","_editor2","_lockUnlock","_pluginMoreMenuItem","_pluginPostPublishPanel","_pluginPostStatusInfo","_pluginPrePublishPanel","_pluginSidebar","_pluginSidebarMoreMenuItem","_fullscreenModeClose","_mainDashboardButton","_store","PluginPostExcerpt","__experimentalPluginPostExcerpt","unlock","editorPrivateApis","exports","initializeEditor","id","postType","postId","settings","initialEdits","isMediumOrBigger","window","matchMedia","matches","target","document","getElementById","root","createRoot","dispatch","preferencesStore","setDefaults","fullscreenMode","themeStyles","welcomeGuide","welcomeGuideTemplate","allowRightClickOverrides","editorMode","fixedToolbar","hiddenBlockTypes","inactivePanels","openPanels","showBlockBreadcrumbs","showIconLabels","showListViewByDefault","isPublishSidebarEnabled","blocksStore","reapplyBlockTypeFilters","select","get","editorStore","setIsListViewOpened","registerCoreBlocks","registerLegacyWidgetBlock","inserter","registerWidgetGroupBlock","process","env","IS_GUTENBERG_PLUGIN","__experimentalRegisterExperimentalCoreBlocks","enableFSEBlocks","__unstableEnableFullSiteEditingBlocks","documentMode","compatMode","console","warn","isIphone","navigator","userAgent","indexOf","addEventListener","event","editorScrollContainer","getElementsByClassName","scrollY","scrollTop","scrollTo","e","preventDefault","render","_react","createElement","default","reinitializeEditor","deprecated","since","version"],"sources":["@wordpress/edit-post/src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport deprecated from '@wordpress/deprecated';\nimport { createRoot } from '@wordpress/element';\nimport { dispatch, select } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\nimport {\n\tPluginBlockSettingsMenuItem,\n\tPluginDocumentSettingPanel,\n\tprivateApis as editorPrivateApis,\n\tstore as editorStore,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport './hooks';\nimport './plugins';\nimport Editor from './editor';\nimport { unlock } from './lock-unlock';\n\nconst { PluginPostExcerpt: __experimentalPluginPostExcerpt } =\n\tunlock( editorPrivateApis );\n\n/**\n * Initializes and returns an instance of Editor.\n *\n * @param {string} id Unique identifier for editor instance.\n * @param {string} postType Post type of the post to edit.\n * @param {Object} postId ID of the post to edit.\n * @param {?Object} settings Editor settings object.\n * @param {Object} initialEdits Programmatic edits to apply initially, to be\n * considered as non-user-initiated (bypass for\n * unsaved changes prompt).\n */\nexport function initializeEditor(\n\tid,\n\tpostType,\n\tpostId,\n\tsettings,\n\tinitialEdits\n) {\n\tconst isMediumOrBigger = window.matchMedia( '(min-width: 782px)' ).matches;\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-post', {\n\t\tfullscreenMode: true,\n\t\tthemeStyles: true,\n\t\twelcomeGuide: true,\n\t\twelcomeGuideTemplate: true,\n\t} );\n\n\tdispatch( preferencesStore ).setDefaults( 'core', {\n\t\tallowRightClickOverrides: true,\n\t\teditorMode: 'visual',\n\t\tfixedToolbar: false,\n\t\thiddenBlockTypes: [],\n\t\tinactivePanels: [],\n\t\topenPanels: [ 'post-status' ],\n\t\tshowBlockBreadcrumbs: true,\n\t\tshowIconLabels: false,\n\t\tshowListViewByDefault: false,\n\t\tisPublishSidebarEnabled: true,\n\t} );\n\n\tdispatch( blocksStore ).reapplyBlockTypeFilters();\n\n\t// Check if the block list view should be open by default.\n\t// If `distractionFree` mode is enabled, the block list view should not be open.\n\t// This behavior is disabled for small viewports.\n\tif (\n\t\tisMediumOrBigger &&\n\t\tselect( preferencesStore ).get( 'core', 'showListViewByDefault' ) &&\n\t\t! select( preferencesStore ).get( 'core', 'distractionFree' )\n\t) {\n\t\tdispatch( editorStore ).setIsListViewOpened( true );\n\t}\n\n\tregisterCoreBlocks();\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tregisterWidgetGroupBlock( { inserter: false } );\n\tif ( process.env.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: settings.__unstableEnableFullSiteEditingBlocks,\n\t\t} );\n\t}\n\n\t// Show a console log warning if the browser is not in Standards rendering mode.\n\tconst documentMode =\n\t\tdocument.compatMode === 'CSS1Compat' ? 'Standards' : 'Quirks';\n\tif ( documentMode !== 'Standards' ) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn(\n\t\t\t\"Your browser is using Quirks Mode. \\nThis can cause rendering issues such as blocks overlaying meta boxes in the editor. Quirks Mode can be triggered by PHP errors or HTML code appearing before the opening <!DOCTYPE html>. Try checking the raw page source or your site's PHP error log and resolving errors there, removing any HTML before the doctype, or disabling plugins.\"\n\t\t);\n\t}\n\n\t// This is a temporary fix for a couple of issues specific to Webkit on iOS.\n\t// Without this hack the browser scrolls the mobile toolbar off-screen.\n\t// Once supported in Safari we can replace this in favor of preventScroll.\n\t// For details see issue #18632 and PR #18686\n\t// Specifically, we scroll `interface-interface-skeleton__body` to enable a fixed top toolbar.\n\t// But Mobile Safari forces the `html` element to scroll upwards, hiding the toolbar.\n\n\tconst isIphone = window.navigator.userAgent.indexOf( 'iPhone' ) !== -1;\n\tif ( isIphone ) {\n\t\twindow.addEventListener( 'scroll', ( event ) => {\n\t\t\tconst editorScrollContainer = document.getElementsByClassName(\n\t\t\t\t'interface-interface-skeleton__body'\n\t\t\t)[ 0 ];\n\t\t\tif ( event.target === document ) {\n\t\t\t\t// Scroll element into view by scrolling the editor container by the same amount\n\t\t\t\t// that Mobile Safari tried to scroll the html element upwards.\n\t\t\t\tif ( window.scrollY > 100 ) {\n\t\t\t\t\teditorScrollContainer.scrollTop =\n\t\t\t\t\t\teditorScrollContainer.scrollTop + window.scrollY;\n\t\t\t\t}\n\t\t\t\t// Undo unwanted scroll on html element, but only in the visual editor.\n\t\t\t\tif (\n\t\t\t\t\tdocument.getElementsByClassName( 'is-mode-visual' )[ 0 ]\n\t\t\t\t) {\n\t\t\t\t\twindow.scrollTo( 0, 0 );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n\n\t// Prevent the default browser action for files dropped outside of dropzones.\n\twindow.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );\n\twindow.addEventListener( 'drop', ( e ) => e.preventDefault(), false );\n\n\troot.render(\n\t\t<Editor\n\t\t\tsettings={ settings }\n\t\t\tpostId={ postId }\n\t\t\tpostType={ postType }\n\t\t\tinitialEdits={ initialEdits }\n\t\t/>\n\t);\n\n\treturn root;\n}\n\n/**\n * Used to reinitialize the editor after an error. Now it's a deprecated noop function.\n */\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editPost.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\nexport { PluginBlockSettingsMenuItem };\nexport { PluginDocumentSettingPanel };\nexport { default as PluginMoreMenuItem } from './components/header/plugin-more-menu-item';\nexport { default as PluginPostPublishPanel } from './components/sidebar/plugin-post-publish-panel';\nexport { default as PluginPostStatusInfo } from './components/sidebar/plugin-post-status-info';\nexport { default as PluginPrePublishPanel } from './components/sidebar/plugin-pre-publish-panel';\nexport { default as PluginSidebar } from './components/sidebar/plugin-sidebar';\nexport { default as PluginSidebarMoreMenuItem } from './components/header/plugin-sidebar-more-menu-item';\nexport { default as __experimentalFullscreenModeClose } from './components/header/fullscreen-mode-close';\nexport { default as __experimentalMainDashboardButton } from './components/header/main-dashboard-button';\nexport { __experimentalPluginPostExcerpt };\nexport { store } from './store';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAIA,IAAAE,WAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AAIA,IAAAQ,OAAA,GAAAR,OAAA;AAUAA,OAAA;AACAA,OAAA;AACA,IAAAS,QAAA,GAAAN,sBAAA,CAAAH,OAAA;AACA,IAAAU,WAAA,GAAAV,OAAA;AAyIA,IAAAW,mBAAA,GAAAR,sBAAA,CAAAH,OAAA;AACA,IAAAY,uBAAA,GAAAT,sBAAA,CAAAH,OAAA;AACA,IAAAa,qBAAA,GAAAV,sBAAA,CAAAH,OAAA;AACA,IAAAc,sBAAA,GAAAX,sBAAA,CAAAH,OAAA;AACA,IAAAe,cAAA,GAAAZ,sBAAA,CAAAH,OAAA;AACA,IAAAgB,0BAAA,GAAAb,sBAAA,CAAAH,OAAA;AACA,IAAAiB,oBAAA,GAAAd,sBAAA,CAAAH,OAAA;AACA,IAAAkB,oBAAA,GAAAf,sBAAA,CAAAH,OAAA;AAEA,IAAAmB,MAAA,GAAAnB,OAAA;A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AAO;QAClD;QACA;QACA,IACCjD,QAAQ,CAACgD,sBAAsB,CAAE,gBAAiB,CAAC,CAAE,CAAC,CAAE,EACvD;UACDpD,MAAM,CAACuD,QAAQ,CAAE,CAAC,EAAE,CAAE,CAAC;QACxB;MACD;IACD,CAAE,CAAC;EACJ;;EAEA;EACAvD,MAAM,CAACiD,gBAAgB,CAAE,UAAU,EAAIO,CAAC,IAAMA,CAAC,CAACC,cAAc,CAAC,CAAC,EAAE,KAAM,CAAC;EACzEzD,MAAM,CAACiD,gBAAgB,CAAE,MAAM,EAAIO,CAAC,IAAMA,CAAC,CAACC,cAAc,CAAC,CAAC,EAAE,KAAM,CAAC;EAErEnD,IAAI,CAACoD,MAAM,CACV,IAAAC,MAAA,CAAAC,aAAA,EAACnF,QAAA,CAAAoF,OAAM;IACNhE,QAAQ,EAAGA,QAAU;IACrBD,MAAM,EAAGA,MAAQ;IACjBD,QAAQ,EAAGA,QAAU;IACrBG,YAAY,EAAGA;EAAc,CAC7B,CACF,CAAC;EAED,OAAOQ,IAAI;AACZ;;AAEA;AACA;AACA;AACO,SAASwD,kBAAkBA,CAAA,EAAG;EACpC,IAAAC,mBAAU,EAAE,gCAAgC,EAAE;IAC7CC,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ"}
|
|
1
|
+
{"version":3,"names":["_blocks","require","_blockLibrary","_deprecated","_interopRequireDefault","_element","_data","_preferences","_widgets","_editor","_editor2","_lockUnlock","_pluginPostPublishPanel","_pluginPrePublishPanel","_fullscreenModeClose","_mainDashboardButton","_store","PluginPostExcerpt","__experimentalPluginPostExcerpt","unlock","editorPrivateApis","exports","initializeEditor","id","postType","postId","settings","initialEdits","isMediumOrBigger","window","matchMedia","matches","target","document","getElementById","root","createRoot","dispatch","preferencesStore","setDefaults","fullscreenMode","themeStyles","welcomeGuide","welcomeGuideTemplate","allowRightClickOverrides","editorMode","fixedToolbar","hiddenBlockTypes","inactivePanels","openPanels","showBlockBreadcrumbs","showIconLabels","showListViewByDefault","isPublishSidebarEnabled","blocksStore","reapplyBlockTypeFilters","select","get","editorStore","setIsListViewOpened","registerCoreBlocks","registerLegacyWidgetBlock","inserter","registerWidgetGroupBlock","process","env","IS_GUTENBERG_PLUGIN","__experimentalRegisterExperimentalCoreBlocks","enableFSEBlocks","__unstableEnableFullSiteEditingBlocks","documentMode","compatMode","console","warn","isIphone","navigator","userAgent","indexOf","addEventListener","event","editorScrollContainer","getElementsByClassName","scrollY","scrollTop","scrollTo","e","preventDefault","render","_react","createElement","default","reinitializeEditor","deprecated","since","version"],"sources":["@wordpress/edit-post/src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport deprecated from '@wordpress/deprecated';\nimport { createRoot } from '@wordpress/element';\nimport { dispatch, select } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\nimport {\n\tPluginBlockSettingsMenuItem,\n\tPluginDocumentSettingPanel,\n\tPluginMoreMenuItem,\n\tPluginPostStatusInfo,\n\tPluginSidebar,\n\tPluginSidebarMoreMenuItem,\n\tprivateApis as editorPrivateApis,\n\tstore as editorStore,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport './hooks';\nimport './plugins';\nimport Editor from './editor';\nimport { unlock } from './lock-unlock';\n\nconst { PluginPostExcerpt: __experimentalPluginPostExcerpt } =\n\tunlock( editorPrivateApis );\n\n/**\n * Initializes and returns an instance of Editor.\n *\n * @param {string} id Unique identifier for editor instance.\n * @param {string} postType Post type of the post to edit.\n * @param {Object} postId ID of the post to edit.\n * @param {?Object} settings Editor settings object.\n * @param {Object} initialEdits Programmatic edits to apply initially, to be\n * considered as non-user-initiated (bypass for\n * unsaved changes prompt).\n */\nexport function initializeEditor(\n\tid,\n\tpostType,\n\tpostId,\n\tsettings,\n\tinitialEdits\n) {\n\tconst isMediumOrBigger = window.matchMedia( '(min-width: 782px)' ).matches;\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-post', {\n\t\tfullscreenMode: true,\n\t\tthemeStyles: true,\n\t\twelcomeGuide: true,\n\t\twelcomeGuideTemplate: true,\n\t} );\n\n\tdispatch( preferencesStore ).setDefaults( 'core', {\n\t\tallowRightClickOverrides: true,\n\t\teditorMode: 'visual',\n\t\tfixedToolbar: false,\n\t\thiddenBlockTypes: [],\n\t\tinactivePanels: [],\n\t\topenPanels: [ 'post-status' ],\n\t\tshowBlockBreadcrumbs: true,\n\t\tshowIconLabels: false,\n\t\tshowListViewByDefault: false,\n\t\tisPublishSidebarEnabled: true,\n\t} );\n\n\tdispatch( blocksStore ).reapplyBlockTypeFilters();\n\n\t// Check if the block list view should be open by default.\n\t// If `distractionFree` mode is enabled, the block list view should not be open.\n\t// This behavior is disabled for small viewports.\n\tif (\n\t\tisMediumOrBigger &&\n\t\tselect( preferencesStore ).get( 'core', 'showListViewByDefault' ) &&\n\t\t! select( preferencesStore ).get( 'core', 'distractionFree' )\n\t) {\n\t\tdispatch( editorStore ).setIsListViewOpened( true );\n\t}\n\n\tregisterCoreBlocks();\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tregisterWidgetGroupBlock( { inserter: false } );\n\tif ( process.env.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: settings.__unstableEnableFullSiteEditingBlocks,\n\t\t} );\n\t}\n\n\t// Show a console log warning if the browser is not in Standards rendering mode.\n\tconst documentMode =\n\t\tdocument.compatMode === 'CSS1Compat' ? 'Standards' : 'Quirks';\n\tif ( documentMode !== 'Standards' ) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn(\n\t\t\t\"Your browser is using Quirks Mode. \\nThis can cause rendering issues such as blocks overlaying meta boxes in the editor. Quirks Mode can be triggered by PHP errors or HTML code appearing before the opening <!DOCTYPE html>. Try checking the raw page source or your site's PHP error log and resolving errors there, removing any HTML before the doctype, or disabling plugins.\"\n\t\t);\n\t}\n\n\t// This is a temporary fix for a couple of issues specific to Webkit on iOS.\n\t// Without this hack the browser scrolls the mobile toolbar off-screen.\n\t// Once supported in Safari we can replace this in favor of preventScroll.\n\t// For details see issue #18632 and PR #18686\n\t// Specifically, we scroll `interface-interface-skeleton__body` to enable a fixed top toolbar.\n\t// But Mobile Safari forces the `html` element to scroll upwards, hiding the toolbar.\n\n\tconst isIphone = window.navigator.userAgent.indexOf( 'iPhone' ) !== -1;\n\tif ( isIphone ) {\n\t\twindow.addEventListener( 'scroll', ( event ) => {\n\t\t\tconst editorScrollContainer = document.getElementsByClassName(\n\t\t\t\t'interface-interface-skeleton__body'\n\t\t\t)[ 0 ];\n\t\t\tif ( event.target === document ) {\n\t\t\t\t// Scroll element into view by scrolling the editor container by the same amount\n\t\t\t\t// that Mobile Safari tried to scroll the html element upwards.\n\t\t\t\tif ( window.scrollY > 100 ) {\n\t\t\t\t\teditorScrollContainer.scrollTop =\n\t\t\t\t\t\teditorScrollContainer.scrollTop + window.scrollY;\n\t\t\t\t}\n\t\t\t\t// Undo unwanted scroll on html element, but only in the visual editor.\n\t\t\t\tif (\n\t\t\t\t\tdocument.getElementsByClassName( 'is-mode-visual' )[ 0 ]\n\t\t\t\t) {\n\t\t\t\t\twindow.scrollTo( 0, 0 );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n\n\t// Prevent the default browser action for files dropped outside of dropzones.\n\twindow.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );\n\twindow.addEventListener( 'drop', ( e ) => e.preventDefault(), false );\n\n\troot.render(\n\t\t<Editor\n\t\t\tsettings={ settings }\n\t\t\tpostId={ postId }\n\t\t\tpostType={ postType }\n\t\t\tinitialEdits={ initialEdits }\n\t\t/>\n\t);\n\n\treturn root;\n}\n\n/**\n * Used to reinitialize the editor after an error. Now it's a deprecated noop function.\n */\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editPost.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\nexport { PluginBlockSettingsMenuItem };\nexport { PluginDocumentSettingPanel };\nexport { PluginMoreMenuItem };\nexport { PluginPostStatusInfo };\nexport { PluginSidebar };\nexport { PluginSidebarMoreMenuItem };\nexport { default as PluginPostPublishPanel } from './components/sidebar/plugin-post-publish-panel';\nexport { default as PluginPrePublishPanel } from './components/sidebar/plugin-pre-publish-panel';\nexport { default as __experimentalFullscreenModeClose } from './components/header/fullscreen-mode-close';\nexport { default as __experimentalMainDashboardButton } from './components/header/main-dashboard-button';\nexport { __experimentalPluginPostExcerpt };\nexport { store } from './store';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAIA,IAAAE,WAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AAIA,IAAAQ,OAAA,GAAAR,OAAA;AAcAA,OAAA;AACAA,OAAA;AACA,IAAAS,QAAA,GAAAN,sBAAA,CAAAH,OAAA;AACA,IAAAU,WAAA,GAAAV,OAAA;AA6IA,IAAAW,uBAAA,GAAAR,sBAAA,CAAAH,OAAA;AACA,IAAAY,sBAAA,GAAAT,sBAAA,CAAAH,OAAA;AACA,IAAAa,oBAAA,GAAAV,sBAAA,CAAAH,OAAA;AACA,IAAAc,oBAAA,GAAAX,sBAAA,CAAAH,OAAA;AAEA,IAAAe,MAAA,GAAAf,OAAA;AAn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O;QAClD;QACA;QACA,IACCjD,QAAQ,CAACgD,sBAAsB,CAAE,gBAAiB,CAAC,CAAE,CAAC,CAAE,EACvD;UACDpD,MAAM,CAACuD,QAAQ,CAAE,CAAC,EAAE,CAAE,CAAC;QACxB;MACD;IACD,CAAE,CAAC;EACJ;;EAEA;EACAvD,MAAM,CAACiD,gBAAgB,CAAE,UAAU,EAAIO,CAAC,IAAMA,CAAC,CAACC,cAAc,CAAC,CAAC,EAAE,KAAM,CAAC;EACzEzD,MAAM,CAACiD,gBAAgB,CAAE,MAAM,EAAIO,CAAC,IAAMA,CAAC,CAACC,cAAc,CAAC,CAAC,EAAE,KAAM,CAAC;EAErEnD,IAAI,CAACoD,MAAM,CACV,IAAAC,MAAA,CAAAC,aAAA,EAAC/E,QAAA,CAAAgF,OAAM;IACNhE,QAAQ,EAAGA,QAAU;IACrBD,MAAM,EAAGA,MAAQ;IACjBD,QAAQ,EAAGA,QAAU;IACrBG,YAAY,EAAGA;EAAc,CAC7B,CACF,CAAC;EAED,OAAOQ,IAAI;AACZ;;AAEA;AACA;AACA;AACO,SAASwD,kBAAkBA,CAAA,EAAG;EACpC,IAAAC,mBAAU,EAAE,gCAAgC,EAAE;IAC7CC,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["require","_data","_preferences","_store","_editor","_interopRequireDefault","initializeEditor","id","postType","postId","dispatch","preferencesStore","setDefaults","editorMode","fullscreenMode","inactivePanels","openPanels","welcomeGuide","hiddenBlockTypes","isPublishSidebarEnabled","fixedToolbar","_react","createElement","default"],"sources":["@wordpress/edit-post/src/index.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport '@wordpress/core-data';\nimport '@wordpress/format-library';\nimport { dispatch } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nexport { store } from './store';\nimport Editor from './editor';\n\n/**\n * Initializes the Editor and returns a componentProvider\n * that can be registered with `AppRegistry.registerComponent`\n *\n * @param {string} id Unique identifier for editor instance.\n * @param {Object} postType Post type of the post to edit.\n * @param {Object} postId ID of the post to edit (unused right now)\n */\nexport function initializeEditor( id, postType, postId ) {\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-post', {\n\t\teditorMode: 'visual',\n\t\tfullscreenMode: true,\n\t\tinactivePanels: [],\n\t\topenPanels: [ 'post-status' ],\n\t\twelcomeGuide: true,\n\t} );\n\tdispatch( preferencesStore ).setDefaults( 'core', {\n\t\thiddenBlockTypes: [],\n\t\tinactivePanels: [],\n\t\topenPanels: [ 'post-status' ],\n\t\tisPublishSidebarEnabled: true,\n\t\tfixedToolbar: false,\n\t} );\n\n\treturn <Editor postId={ postId } postType={ postType } />;\n}\n"],"mappings":";;;;;;;;;;;;;;AAGAA,OAAA;AACAA,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAKA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAC,sBAAA,CAAAL,OAAA;AAZA;AACA;AACA;;AAMA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASM,gBAAgBA,CAAEC,EAAE,EAAEC,QAAQ,EAAEC,MAAM,EAAG;EACxD,IAAAC,cAAQ,EAAEC,kBAAiB,CAAC,CAACC,WAAW,CAAE,gBAAgB,EAAE;IAC3DC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,IAAI;IACpBC,cAAc,EAAE,EAAE;IAClBC,UAAU,EAAE,CAAE,aAAa,CAAE;IAC7BC,YAAY,EAAE;EACf,CAAE,CAAC;EACH,IAAAP,cAAQ,EAAEC,kBAAiB,CAAC,CAACC,WAAW,CAAE,MAAM,EAAE;IACjDM,gBAAgB,EAAE,EAAE;IACpBH,cAAc,EAAE,EAAE;IAClBC,UAAU,EAAE,CAAE,aAAa,CAAE;IAC7BG,uBAAuB,EAAE,IAAI;IAC7BC,YAAY,EAAE;EACf,CAAE,CAAC;EAEH,OAAO,IAAAC,MAAA,CAAAC,aAAA,EAAClB,OAAA,CAAAmB,OAAM;IAACd,MAAM,EAAGA,MAAQ;IAACD,QAAQ,EAAGA;EAAU,CAAE,CAAC;AAC1D"}
|
|
1
|
+
{"version":3,"names":["require","_data","_preferences","_store","_editor","_interopRequireDefault","initializeEditor","id","postType","postId","dispatch","preferencesStore","setDefaults","editorMode","fullscreenMode","inactivePanels","openPanels","welcomeGuide","hiddenBlockTypes","isPublishSidebarEnabled","fixedToolbar","_react","createElement","default"],"sources":["@wordpress/edit-post/src/index.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport '@wordpress/core-data';\nimport '@wordpress/format-library';\nimport { dispatch } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nexport { store } from './store';\nimport Editor from './editor';\n\n/**\n * Initializes the Editor and returns a componentProvider\n * that can be registered with `AppRegistry.registerComponent`\n *\n * @param {string} id Unique identifier for editor instance.\n * @param {Object} postType Post type of the post to edit.\n * @param {Object} postId ID of the post to edit (unused right now)\n */\nexport function initializeEditor( id, postType, postId ) {\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-post', {\n\t\teditorMode: 'visual',\n\t\tfullscreenMode: true,\n\t\tinactivePanels: [],\n\t\topenPanels: [ 'post-status' ],\n\t\twelcomeGuide: true,\n\t} );\n\tdispatch( preferencesStore ).setDefaults( 'core', {\n\t\thiddenBlockTypes: [],\n\t\tinactivePanels: [],\n\t\topenPanels: [ 'post-status' ],\n\t\tisPublishSidebarEnabled: true,\n\t\tfixedToolbar: false,\n\t} );\n\n\treturn <Editor postId={ postId } postType={ postType } />;\n}\n"],"mappings":";;;;;;;;;;;;;;AAGAA,OAAA;AACAA,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAKA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAC,sBAAA,CAAAL,OAAA;AAZA;AACA;AACA;;AAMA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASM,gBAAgBA,CAAEC,EAAE,EAAEC,QAAQ,EAAEC,MAAM,EAAG;EACxD,IAAAC,cAAQ,EAAEC,kBAAiB,CAAC,CAACC,WAAW,CAAE,gBAAgB,EAAE;IAC3DC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,IAAI;IACpBC,cAAc,EAAE,EAAE;IAClBC,UAAU,EAAE,CAAE,aAAa,CAAE;IAC7BC,YAAY,EAAE;EACf,CAAE,CAAC;EACH,IAAAP,cAAQ,EAAEC,kBAAiB,CAAC,CAACC,WAAW,CAAE,MAAM,EAAE;IACjDM,gBAAgB,EAAE,EAAE;IACpBH,cAAc,EAAE,EAAE;IAClBC,UAAU,EAAE,CAAE,aAAa,CAAE;IAC7BG,uBAAuB,EAAE,IAAI;IAC7BC,YAAY,EAAE;EACf,CAAE,CAAC;EAEH,OAAO,IAAAC,MAAA,CAAAC,aAAA,EAAClB,OAAA,CAAAmB,OAAM;IAACd,MAAM,EAAGA,MAAQ;IAACD,QAAQ,EAAGA;EAAU,CAAE,CAAC;AAC1D","ignoreList":[]}
|
package/build/lock-unlock.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_privateApis","require","lock","unlock","__dangerousOptInToUnstableAPIsOnlyForCoreModules","exports"],"sources":["@wordpress/edit-post/src/lock-unlock.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.',\n\t\t'@wordpress/edit-post'\n\t);\n"],"mappings":";;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGO,MAAM;EAAEC,IAAI;EAAEC;AAAO,CAAC,GAC5B,IAAAC,6DAAgD,EAC/C,iHAAiH,EACjH,sBACD,CAAC;AAACC,OAAA,CAAAF,MAAA,GAAAA,MAAA;AAAAE,OAAA,CAAAH,IAAA,GAAAA,IAAA"}
|
|
1
|
+
{"version":3,"names":["_privateApis","require","lock","unlock","__dangerousOptInToUnstableAPIsOnlyForCoreModules","exports"],"sources":["@wordpress/edit-post/src/lock-unlock.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.',\n\t\t'@wordpress/edit-post'\n\t);\n"],"mappings":";;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGO,MAAM;EAAEC,IAAI;EAAEC;AAAO,CAAC,GAC5B,IAAAC,6DAAgD,EAC/C,iHAAiH,EACjH,sBACD,CAAC;AAACC,OAAA,CAAAF,MAAA,GAAAA,MAAA;AAAAE,OAAA,CAAAH,IAAA,GAAAA,IAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_data","_i18n","_compose","_notices","_editor","CopyContentMenuItem","createNotice","useDispatch","noticesStore","getEditedPostAttribute","useSelect","editorStore","getText","onSuccess","__","isDismissible","type","ref","useCopyToClipboard","_react","createElement","MenuItem"],"sources":["@wordpress/edit-post/src/plugins/copy-content-menu-item/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { MenuItem } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as editorStore } from '@wordpress/editor';\n\nexport default function CopyContentMenuItem() {\n\tconst { createNotice } = useDispatch( noticesStore );\n\tconst { getEditedPostAttribute } = useSelect( editorStore );\n\n\tfunction getText() {\n\t\treturn getEditedPostAttribute( 'content' );\n\t}\n\n\tfunction onSuccess() {\n\t\tcreateNotice( 'info', __( 'All content copied.' ), {\n\t\t\tisDismissible: true,\n\t\t\ttype: 'snackbar',\n\t\t} );\n\t}\n\n\tconst ref = useCopyToClipboard( getText, onSuccess );\n\n\treturn <MenuItem ref={ ref }>{ __( 'Copy all blocks' ) }</MenuItem>;\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AARA;AACA;AACA;;AAQe,SAASM,mBAAmBA,CAAA,EAAG;EAC7C,MAAM;IAAEC;EAAa,CAAC,GAAG,IAAAC,iBAAW,EAAEC,cAAa,CAAC;EACpD,MAAM;IAAEC;EAAuB,CAAC,GAAG,IAAAC,eAAS,EAAEC,aAAY,CAAC;EAE3D,SAASC,OAAOA,CAAA,EAAG;IAClB,OAAOH,sBAAsB,CAAE,SAAU,CAAC;EAC3C;EAEA,SAASI,SAASA,CAAA,EAAG;IACpBP,YAAY,CAAE,MAAM,EAAE,IAAAQ,QAAE,EAAE,qBAAsB,CAAC,EAAE;MAClDC,aAAa,EAAE,IAAI;MACnBC,IAAI,EAAE;IACP,CAAE,CAAC;EACJ;EAEA,MAAMC,GAAG,GAAG,IAAAC,2BAAkB,EAAEN,OAAO,EAAEC,SAAU,CAAC;EAEpD,OAAO,IAAAM,MAAA,CAAAC,aAAA,EAACtB,WAAA,CAAAuB,QAAQ;IAACJ,GAAG,EAAGA;EAAK,GAAG,IAAAH,QAAE,EAAE,iBAAkB,CAAa,CAAC;AACpE"}
|
|
1
|
+
{"version":3,"names":["_components","require","_data","_i18n","_compose","_notices","_editor","CopyContentMenuItem","createNotice","useDispatch","noticesStore","getEditedPostAttribute","useSelect","editorStore","getText","onSuccess","__","isDismissible","type","ref","useCopyToClipboard","_react","createElement","MenuItem"],"sources":["@wordpress/edit-post/src/plugins/copy-content-menu-item/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { MenuItem } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as editorStore } from '@wordpress/editor';\n\nexport default function CopyContentMenuItem() {\n\tconst { createNotice } = useDispatch( noticesStore );\n\tconst { getEditedPostAttribute } = useSelect( editorStore );\n\n\tfunction getText() {\n\t\treturn getEditedPostAttribute( 'content' );\n\t}\n\n\tfunction onSuccess() {\n\t\tcreateNotice( 'info', __( 'All content copied.' ), {\n\t\t\tisDismissible: true,\n\t\t\ttype: 'snackbar',\n\t\t} );\n\t}\n\n\tconst ref = useCopyToClipboard( getText, onSuccess );\n\n\treturn <MenuItem ref={ ref }>{ __( 'Copy all blocks' ) }</MenuItem>;\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AARA;AACA;AACA;;AAQe,SAASM,mBAAmBA,CAAA,EAAG;EAC7C,MAAM;IAAEC;EAAa,CAAC,GAAG,IAAAC,iBAAW,EAAEC,cAAa,CAAC;EACpD,MAAM;IAAEC;EAAuB,CAAC,GAAG,IAAAC,eAAS,EAAEC,aAAY,CAAC;EAE3D,SAASC,OAAOA,CAAA,EAAG;IAClB,OAAOH,sBAAsB,CAAE,SAAU,CAAC;EAC3C;EAEA,SAASI,SAASA,CAAA,EAAG;IACpBP,YAAY,CAAE,MAAM,EAAE,IAAAQ,QAAE,EAAE,qBAAsB,CAAC,EAAE;MAClDC,aAAa,EAAE,IAAI;MACnBC,IAAI,EAAE;IACP,CAAE,CAAC;EACJ;EAEA,MAAMC,GAAG,GAAG,IAAAC,2BAAkB,EAAEN,OAAO,EAAEC,SAAU,CAAC;EAEpD,OAAO,IAAAM,MAAA,CAAAC,aAAA,EAACtB,WAAA,CAAAuB,QAAQ;IAACJ,GAAG,EAAGA;EAAK,GAAG,IAAAH,QAAE,EAAE,iBAAkB,CAAa,CAAC;AACpE","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_coreData","_editor","_data","_icons","_i18n","_plugins","_url","_copyContentMenuItem","_interopRequireDefault","_keyboardShortcutsHelpMenuItem","_toolsMoreMenuGroup","_welcomeGuideMenuItem","ManagePatternsMenuItem","url","useSelect","select","canUser","coreStore","getEditorSettings","editorStore","isBlockTheme","__unstableIsBlockBasedTheme","defaultUrl","addQueryArgs","post_type","patternsUrl","path","_react","createElement","MenuItem","role","href","__","registerPlugin","render","Fragment","default","onClose","onSelect","icon","external","target","rel","VisuallyHidden","as"],"sources":["@wordpress/edit-post/src/plugins/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { MenuItem, VisuallyHidden } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { useSelect } from '@wordpress/data';\nimport { external } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { registerPlugin } from '@wordpress/plugins';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport CopyContentMenuItem from './copy-content-menu-item';\nimport KeyboardShortcutsHelpMenuItem from './keyboard-shortcuts-help-menu-item';\nimport ToolsMoreMenuGroup from '../components/header/tools-more-menu-group';\nimport WelcomeGuideMenuItem from './welcome-guide-menu-item';\n\nfunction ManagePatternsMenuItem() {\n\tconst url = useSelect( ( select ) => {\n\t\tconst { canUser } = select( coreStore );\n\t\tconst { getEditorSettings } = select( editorStore );\n\n\t\tconst isBlockTheme = getEditorSettings().__unstableIsBlockBasedTheme;\n\t\tconst defaultUrl = addQueryArgs( 'edit.php', {\n\t\t\tpost_type: 'wp_block',\n\t\t} );\n\t\tconst patternsUrl = addQueryArgs( 'site-editor.php', {\n\t\t\tpath: '/patterns',\n\t\t} );\n\n\t\t// The site editor and templates both check whether the user has\n\t\t// edit_theme_options capabilities. We can leverage that here and not\n\t\t// display the manage patterns link if the user can't access it.\n\t\treturn canUser( 'read', 'templates' ) && isBlockTheme\n\t\t\t? patternsUrl\n\t\t\t: defaultUrl;\n\t}, [] );\n\n\treturn (\n\t\t<MenuItem role=\"menuitem\" href={ url }>\n\t\t\t{ __( 'Manage patterns' ) }\n\t\t</MenuItem>\n\t);\n}\n\nregisterPlugin( 'edit-post', {\n\trender() {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<ToolsMoreMenuGroup>\n\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<ManagePatternsMenuItem />\n\t\t\t\t\t\t\t<KeyboardShortcutsHelpMenuItem\n\t\t\t\t\t\t\t\tonSelect={ onClose }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<WelcomeGuideMenuItem />\n\t\t\t\t\t\t\t<CopyContentMenuItem />\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\t\t\ticon={ external }\n\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/wordpress-block-editor/'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Help' ) }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,CAAAC,aAAA,EAAC9B,WAAA,CAAA6C,cAAc;MAACC,EAAE,EAAC;IAAM,GAEvB;IACA,IAAAZ,QAAE,EAAE,sBAAuB,CAEb,CACP,CACT,CAEgB,CACnB,CAAC;EAEL;AACD,CAAE,CAAC"}
|
|
1
|
+
{"version":3,"names":["_components","require","_coreData","_editor","_data","_icons","_i18n","_plugins","_url","_copyContentMenuItem","_interopRequireDefault","_keyboardShortcutsHelpMenuItem","_toolsMoreMenuGroup","_welcomeGuideMenuItem","ManagePatternsMenuItem","url","useSelect","select","canUser","coreStore","getEditorSettings","editorStore","isBlockTheme","__unstableIsBlockBasedTheme","defaultUrl","addQueryArgs","post_type","patternsUrl","path","_react","createElement","MenuItem","role","href","__","registerPlugin","render","Fragment","default","onClose","onSelect","icon","external","target","rel","VisuallyHidden","as"],"sources":["@wordpress/edit-post/src/plugins/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { MenuItem, VisuallyHidden } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { useSelect } from '@wordpress/data';\nimport { external } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { registerPlugin } from '@wordpress/plugins';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport CopyContentMenuItem from './copy-content-menu-item';\nimport KeyboardShortcutsHelpMenuItem from './keyboard-shortcuts-help-menu-item';\nimport ToolsMoreMenuGroup from '../components/header/tools-more-menu-group';\nimport WelcomeGuideMenuItem from './welcome-guide-menu-item';\n\nfunction ManagePatternsMenuItem() {\n\tconst url = useSelect( ( select ) => {\n\t\tconst { canUser } = select( coreStore );\n\t\tconst { getEditorSettings } = select( editorStore );\n\n\t\tconst isBlockTheme = getEditorSettings().__unstableIsBlockBasedTheme;\n\t\tconst defaultUrl = addQueryArgs( 'edit.php', {\n\t\t\tpost_type: 'wp_block',\n\t\t} );\n\t\tconst patternsUrl = addQueryArgs( 'site-editor.php', {\n\t\t\tpath: '/patterns',\n\t\t} );\n\n\t\t// The site editor and templates both check whether the user has\n\t\t// edit_theme_options capabilities. We can leverage that here and not\n\t\t// display the manage patterns link if the user can't access it.\n\t\treturn canUser( 'read', 'templates' ) && isBlockTheme\n\t\t\t? patternsUrl\n\t\t\t: defaultUrl;\n\t}, [] );\n\n\treturn (\n\t\t<MenuItem role=\"menuitem\" href={ url }>\n\t\t\t{ __( 'Manage patterns' ) }\n\t\t</MenuItem>\n\t);\n}\n\nregisterPlugin( 'edit-post', {\n\trender() {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<ToolsMoreMenuGroup>\n\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<ManagePatternsMenuItem />\n\t\t\t\t\t\t\t<KeyboardShortcutsHelpMenuItem\n\t\t\t\t\t\t\t\tonSelect={ onClose }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<WelcomeGuideMenuItem />\n\t\t\t\t\t\t\t<CopyContentMenuItem />\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\t\t\ticon={ external }\n\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/wordpress-block-editor/'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Help' ) }\n\t\t\t\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</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
|
11
11
|
var _i18n = require("@wordpress/i18n");
|
|
12
12
|
var _keycodes = require("@wordpress/keycodes");
|
|
13
|
-
var
|
|
14
|
-
var
|
|
13
|
+
var _editor = require("@wordpress/editor");
|
|
14
|
+
var _lockUnlock = require("../../lock-unlock");
|
|
15
15
|
/**
|
|
16
16
|
* WordPress dependencies
|
|
17
17
|
*/
|
|
@@ -20,12 +20,15 @@ var _keyboardShortcutHelpModal = require("../../components/keyboard-shortcut-hel
|
|
|
20
20
|
* Internal dependencies
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
|
+
const {
|
|
24
|
+
interfaceStore
|
|
25
|
+
} = (0, _lockUnlock.unlock)(_editor.privateApis);
|
|
23
26
|
function KeyboardShortcutsHelpMenuItem({
|
|
24
27
|
openModal
|
|
25
28
|
}) {
|
|
26
29
|
return (0, _react.createElement)(_components.MenuItem, {
|
|
27
30
|
onClick: () => {
|
|
28
|
-
openModal(
|
|
31
|
+
openModal('editor/keyboard-shortcut-help');
|
|
29
32
|
},
|
|
30
33
|
shortcut: _keycodes.displayShortcut.access('h')
|
|
31
34
|
}, (0, _i18n.__)('Keyboard shortcuts'));
|
|
@@ -33,7 +36,7 @@ function KeyboardShortcutsHelpMenuItem({
|
|
|
33
36
|
var _default = exports.default = (0, _data.withDispatch)(dispatch => {
|
|
34
37
|
const {
|
|
35
38
|
openModal
|
|
36
|
-
} = dispatch(
|
|
39
|
+
} = dispatch(interfaceStore);
|
|
37
40
|
return {
|
|
38
41
|
openModal
|
|
39
42
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_data","_i18n","_keycodes","
|
|
1
|
+
{"version":3,"names":["_components","require","_data","_i18n","_keycodes","_editor","_lockUnlock","interfaceStore","unlock","editorPrivateApis","KeyboardShortcutsHelpMenuItem","openModal","_react","createElement","MenuItem","onClick","shortcut","displayShortcut","access","__","_default","exports","default","withDispatch","dispatch"],"sources":["@wordpress/edit-post/src/plugins/keyboard-shortcuts-help-menu-item/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { MenuItem } from '@wordpress/components';\nimport { withDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { interfaceStore } = unlock( editorPrivateApis );\n\nexport function KeyboardShortcutsHelpMenuItem( { openModal } ) {\n\treturn (\n\t\t<MenuItem\n\t\t\tonClick={ () => {\n\t\t\t\topenModal( 'editor/keyboard-shortcut-help' );\n\t\t\t} }\n\t\t\tshortcut={ displayShortcut.access( 'h' ) }\n\t\t>\n\t\t\t{ __( 'Keyboard shortcuts' ) }\n\t\t</MenuItem>\n\t);\n}\n\nexport default withDispatch( ( dispatch ) => {\n\tconst { openModal } = dispatch( interfaceStore );\n\n\treturn {\n\t\topenModal,\n\t};\n} )( KeyboardShortcutsHelpMenuItem );\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAKA,IAAAK,WAAA,GAAAL,OAAA;AAZA;AACA;AACA;;AAOA;AACA;AACA;;AAGA,MAAM;EAAEM;AAAe,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAE/C,SAASC,6BAA6BA,CAAE;EAAEC;AAAU,CAAC,EAAG;EAC9D,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACb,WAAA,CAAAc,QAAQ;IACRC,OAAO,EAAGA,CAAA,KAAM;MACfJ,SAAS,CAAE,+BAAgC,CAAC;IAC7C,CAAG;IACHK,QAAQ,EAAGC,yBAAe,CAACC,MAAM,CAAE,GAAI;EAAG,GAExC,IAAAC,QAAE,EAAE,oBAAqB,CAClB,CAAC;AAEb;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc,IAAAC,kBAAY,EAAIC,QAAQ,IAAM;EAC5C,MAAM;IAAEb;EAAU,CAAC,GAAGa,QAAQ,CAAEjB,cAAe,CAAC;EAEhD,OAAO;IACNI;EACD,CAAC;AACF,CAAE,CAAC,CAAED,6BAA8B,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_preferences","_i18n","_editor","WelcomeGuideMenuItem","isEditingTemplate","useSelect","select","editorStore","getCurrentPostType","_react","createElement","PreferenceToggleMenuItem","scope","name","label","__"],"sources":["@wordpress/edit-post/src/plugins/welcome-guide-menu-item/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { PreferenceToggleMenuItem } from '@wordpress/preferences';\nimport { __ } from '@wordpress/i18n';\nimport { store as editorStore } from '@wordpress/editor';\n\nexport default function WelcomeGuideMenuItem() {\n\tconst isEditingTemplate = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).getCurrentPostType() === 'wp_template',\n\t\t[]\n\t);\n\n\treturn (\n\t\t<PreferenceToggleMenuItem\n\t\t\tscope=\"core/edit-post\"\n\t\t\tname={ isEditingTemplate ? 'welcomeGuideTemplate' : 'welcomeGuide' }\n\t\t\tlabel={ __( 'Welcome Guide' ) }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AANA;AACA;AACA;;AAMe,SAASI,oBAAoBA,CAAA,EAAG;EAC9C,MAAMC,iBAAiB,GAAG,IAAAC,eAAS,EAChCC,MAAM,IACPA,MAAM,CAAEC,aAAY,CAAC,CAACC,kBAAkB,CAAC,CAAC,KAAK,aAAa,EAC7D,EACD,CAAC;EAED,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACV,YAAA,CAAAW,wBAAwB;IACxBC,KAAK,EAAC,gBAAgB;IACtBC,IAAI,EAAGT,iBAAiB,GAAG,sBAAsB,GAAG,cAAgB;IACpEU,KAAK,EAAG,IAAAC,QAAE,EAAE,eAAgB;EAAG,CAC/B,CAAC;AAEJ"}
|
|
1
|
+
{"version":3,"names":["_data","require","_preferences","_i18n","_editor","WelcomeGuideMenuItem","isEditingTemplate","useSelect","select","editorStore","getCurrentPostType","_react","createElement","PreferenceToggleMenuItem","scope","name","label","__"],"sources":["@wordpress/edit-post/src/plugins/welcome-guide-menu-item/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { PreferenceToggleMenuItem } from '@wordpress/preferences';\nimport { __ } from '@wordpress/i18n';\nimport { store as editorStore } from '@wordpress/editor';\n\nexport default function WelcomeGuideMenuItem() {\n\tconst isEditingTemplate = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).getCurrentPostType() === 'wp_template',\n\t\t[]\n\t);\n\n\treturn (\n\t\t<PreferenceToggleMenuItem\n\t\t\tscope=\"core/edit-post\"\n\t\t\tname={ isEditingTemplate ? 'welcomeGuideTemplate' : 'welcomeGuide' }\n\t\t\tlabel={ __( 'Welcome Guide' ) }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AANA;AACA;AACA;;AAMe,SAASI,oBAAoBA,CAAA,EAAG;EAC9C,MAAMC,iBAAiB,GAAG,IAAAC,eAAS,EAChCC,MAAM,IACPA,MAAM,CAAEC,aAAY,CAAC,CAACC,kBAAkB,CAAC,CAAC,KAAK,aAAa,EAC7D,EACD,CAAC;EAED,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACV,YAAA,CAAAW,wBAAwB;IACxBC,KAAK,EAAC,gBAAgB;IACtBC,IAAI,EAAGT,iBAAiB,GAAG,sBAAsB,GAAG,cAAgB;IACpEU,KAAK,EAAG,IAAAC,QAAE,EAAE,eAAgB;EAAG,CAC/B,CAAC;AAEJ","ignoreList":[]}
|