@wordpress/editor 14.14.0 → 14.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/LICENSE.md +1 -1
- package/README.md +1 -0
- package/build/components/commands/index.js +28 -0
- package/build/components/commands/index.js.map +1 -1
- package/build/components/document-bar/index.js +2 -1
- package/build/components/document-bar/index.js.map +1 -1
- package/build/components/document-tools/index.js +3 -6
- package/build/components/document-tools/index.js.map +1 -1
- package/build/components/editor-help/intro-to-blocks.native.js +1 -1
- package/build/components/editor-help/intro-to-blocks.native.js.map +1 -1
- package/build/components/entities-saved-states/index.js +2 -1
- package/build/components/entities-saved-states/index.js.map +1 -1
- package/build/components/error-boundary/index.native.js +1 -1
- package/build/components/error-boundary/index.native.js.map +1 -1
- package/build/components/more-menu/index.js +0 -1
- package/build/components/more-menu/index.js.map +1 -1
- package/build/components/post-actions/actions.js +9 -4
- package/build/components/post-actions/actions.js.map +1 -1
- package/build/components/post-actions/index.js +17 -14
- package/build/components/post-actions/index.js.map +1 -1
- package/build/components/post-actions/set-as-homepage.js +23 -34
- package/build/components/post-actions/set-as-homepage.js.map +1 -1
- package/build/components/post-actions/set-as-posts-page.js +154 -0
- package/build/components/post-actions/set-as-posts-page.js.map +1 -0
- package/build/components/post-card-panel/index.js +12 -5
- package/build/components/post-card-panel/index.js.map +1 -1
- package/build/components/post-publish-panel/maybe-upload-media.js +1 -1
- package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
- package/build/components/preferences-modal/index.js +2 -4
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/preview-dropdown/index.js +0 -1
- package/build/components/preview-dropdown/index.js.map +1 -1
- package/build/components/provider/disable-non-page-content-blocks.js +65 -13
- package/build/components/provider/disable-non-page-content-blocks.js.map +1 -1
- package/build/components/provider/index.js +9 -13
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/use-block-editor-settings.js +3 -1
- package/build/components/provider/use-block-editor-settings.js.map +1 -1
- package/build/components/start-page-options/index.js +20 -107
- package/build/components/start-page-options/index.js.map +1 -1
- package/build/components/template-part-menu-items/index.js +2 -10
- package/build/components/template-part-menu-items/index.js.map +1 -1
- package/build/store/actions.js +0 -2
- package/build/store/actions.js.map +1 -1
- package/build/store/constants.js +1 -3
- package/build/store/constants.js.map +1 -1
- package/build/store/private-actions.js +1 -1
- package/build/store/private-actions.js.map +1 -1
- package/build/store/utils/notice-builder.js +3 -8
- package/build/store/utils/notice-builder.js.map +1 -1
- package/build/utils/get-item-title.js +32 -0
- package/build/utils/get-item-title.js.map +1 -0
- package/build/utils/media-sideload/index.js +21 -0
- package/build/utils/media-sideload/index.js.map +1 -0
- package/build/utils/media-sideload/index.native.js +8 -0
- package/build/utils/media-sideload/index.native.js.map +1 -0
- package/build/utils/media-upload/index.js +5 -2
- package/build/utils/media-upload/index.js.map +1 -1
- package/build-module/components/commands/index.js +28 -0
- package/build-module/components/commands/index.js.map +1 -1
- package/build-module/components/document-bar/index.js +2 -1
- package/build-module/components/document-bar/index.js.map +1 -1
- package/build-module/components/document-tools/index.js +4 -7
- package/build-module/components/document-tools/index.js.map +1 -1
- package/build-module/components/editor-help/intro-to-blocks.native.js +1 -1
- package/build-module/components/editor-help/intro-to-blocks.native.js.map +1 -1
- package/build-module/components/entities-saved-states/index.js +2 -1
- package/build-module/components/entities-saved-states/index.js.map +1 -1
- package/build-module/components/error-boundary/index.native.js +2 -2
- package/build-module/components/error-boundary/index.native.js.map +1 -1
- package/build-module/components/more-menu/index.js +0 -1
- package/build-module/components/more-menu/index.js.map +1 -1
- package/build-module/components/post-actions/actions.js +9 -4
- package/build-module/components/post-actions/actions.js.map +1 -1
- package/build-module/components/post-actions/index.js +18 -15
- package/build-module/components/post-actions/index.js.map +1 -1
- package/build-module/components/post-actions/set-as-homepage.js +22 -33
- package/build-module/components/post-actions/set-as-homepage.js.map +1 -1
- package/build-module/components/post-actions/set-as-posts-page.js +146 -0
- package/build-module/components/post-actions/set-as-posts-page.js.map +1 -0
- package/build-module/components/post-card-panel/index.js +11 -6
- package/build-module/components/post-card-panel/index.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-upload-media.js +2 -2
- package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +2 -4
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/preview-dropdown/index.js +0 -1
- package/build-module/components/preview-dropdown/index.js.map +1 -1
- package/build-module/components/provider/disable-non-page-content-blocks.js +65 -13
- package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -1
- package/build-module/components/provider/index.js +10 -14
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/provider/use-block-editor-settings.js +3 -1
- package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
- package/build-module/components/start-page-options/index.js +21 -107
- package/build-module/components/start-page-options/index.js.map +1 -1
- package/build-module/components/template-part-menu-items/index.js +2 -10
- package/build-module/components/template-part-menu-items/index.js.map +1 -1
- package/build-module/store/actions.js +0 -2
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/constants.js +0 -2
- package/build-module/store/constants.js.map +1 -1
- package/build-module/store/private-actions.js +1 -1
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/utils/notice-builder.js +3 -8
- package/build-module/store/utils/notice-builder.js.map +1 -1
- package/build-module/utils/get-item-title.js +26 -0
- package/build-module/utils/get-item-title.js.map +1 -0
- package/build-module/utils/media-sideload/index.js +14 -0
- package/build-module/utils/media-sideload/index.js.map +1 -0
- package/build-module/utils/media-sideload/index.native.js +2 -0
- package/build-module/utils/media-sideload/index.native.js.map +1 -0
- package/build-module/utils/media-upload/index.js +5 -2
- package/build-module/utils/media-upload/index.js.map +1 -1
- package/build-style/style-rtl.css +5 -25
- package/build-style/style.css +5 -25
- package/build-types/components/commands/index.d.ts.map +1 -1
- package/build-types/components/document-bar/index.d.ts.map +1 -1
- package/build-types/components/document-tools/index.d.ts.map +1 -1
- package/build-types/components/entities-saved-states/index.d.ts.map +1 -1
- package/build-types/components/more-menu/index.d.ts.map +1 -1
- package/build-types/components/post-actions/actions.d.ts.map +1 -1
- package/build-types/components/post-actions/index.d.ts.map +1 -1
- package/build-types/components/post-actions/set-as-homepage.d.ts.map +1 -1
- package/build-types/components/post-actions/set-as-posts-page.d.ts +10 -0
- package/build-types/components/post-actions/set-as-posts-page.d.ts.map +1 -0
- package/build-types/components/post-card-panel/index.d.ts.map +1 -1
- package/build-types/components/preferences-modal/index.d.ts.map +1 -1
- package/build-types/components/preview-dropdown/index.d.ts.map +1 -1
- package/build-types/components/provider/disable-non-page-content-blocks.d.ts.map +1 -1
- package/build-types/components/provider/index.d.ts.map +1 -1
- package/build-types/components/provider/use-block-editor-settings.d.ts.map +1 -1
- package/build-types/components/start-page-options/index.d.ts +1 -2
- package/build-types/components/start-page-options/index.d.ts.map +1 -1
- package/build-types/store/actions.d.ts.map +1 -1
- package/build-types/store/constants.d.ts +0 -2
- package/build-types/store/constants.d.ts.map +1 -1
- package/build-types/store/private-actions.d.ts.map +1 -1
- package/build-types/store/utils/notice-builder.d.ts.map +1 -1
- package/build-types/utils/get-item-title.d.ts +10 -0
- package/build-types/utils/get-item-title.d.ts.map +1 -0
- package/build-types/utils/media-sideload/index.d.ts +3 -0
- package/build-types/utils/media-sideload/index.d.ts.map +1 -0
- package/build-types/utils/media-upload/index.d.ts +3 -1
- package/build-types/utils/media-upload/index.d.ts.map +1 -1
- package/package.json +37 -37
- package/src/components/commands/index.js +29 -0
- package/src/components/document-bar/index.js +2 -1
- package/src/components/document-tools/index.js +3 -6
- package/src/components/document-tools/style.scss +0 -6
- package/src/components/editor-help/intro-to-blocks.native.js +1 -1
- package/src/components/entities-saved-states/index.js +5 -1
- package/src/components/error-boundary/index.native.js +2 -2
- package/src/components/more-menu/index.js +0 -1
- package/src/components/post-actions/actions.js +12 -4
- package/src/components/post-actions/index.js +19 -17
- package/src/components/post-actions/set-as-homepage.js +29 -45
- package/src/components/post-actions/set-as-posts-page.js +164 -0
- package/src/components/post-card-panel/index.js +8 -6
- package/src/components/post-card-panel/style.scss +4 -13
- package/src/components/post-publish-panel/maybe-upload-media.js +2 -2
- package/src/components/preferences-modal/index.js +8 -13
- package/src/components/preview-dropdown/index.js +0 -1
- package/src/components/provider/disable-non-page-content-blocks.js +64 -13
- package/src/components/provider/index.js +13 -27
- package/src/components/provider/use-block-editor-settings.js +3 -0
- package/src/components/start-page-options/index.js +28 -119
- package/src/components/template-part-menu-items/index.js +2 -11
- package/src/store/actions.js +0 -2
- package/src/store/constants.ts +0 -2
- package/src/store/private-actions.js +1 -1
- package/src/store/utils/notice-builder.js +3 -8
- package/src/store/utils/test/notice-builder.js +3 -4
- package/src/utils/get-item-title.js +25 -0
- package/src/utils/media-sideload/index.js +13 -0
- package/src/utils/media-sideload/index.native.js +1 -0
- package/src/utils/media-upload/index.js +4 -1
- package/tsconfig.json +1 -4
- package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
package/LICENSE.md
CHANGED
package/README.md
CHANGED
|
@@ -499,6 +499,7 @@ _Parameters_
|
|
|
499
499
|
- _$0.maxUploadFileSize_ `?number`: Maximum upload size in bytes allowed for the site.
|
|
500
500
|
- _$0.onError_ `Function`: Function called when an error happens.
|
|
501
501
|
- _$0.onFileChange_ `Function`: Function called each time a file or a temporary representation of the file is available.
|
|
502
|
+
- _$0.onSuccess_ `Function`: Function called after the final representation of the file is available.
|
|
502
503
|
|
|
503
504
|
### MediaUploadCheck
|
|
504
505
|
|
|
@@ -14,6 +14,7 @@ var _notices = require("@wordpress/notices");
|
|
|
14
14
|
var _blockEditor = require("@wordpress/block-editor");
|
|
15
15
|
var _coreData = require("@wordpress/core-data");
|
|
16
16
|
var _interface = require("@wordpress/interface");
|
|
17
|
+
var _url = require("@wordpress/url");
|
|
17
18
|
var _htmlEntities = require("@wordpress/html-entities");
|
|
18
19
|
var _lockUnlock = require("../../lock-unlock");
|
|
19
20
|
var _store = require("../../store");
|
|
@@ -95,6 +96,18 @@ const getEditorCommandLoader = () => function useEditorCommandLoader() {
|
|
|
95
96
|
const {
|
|
96
97
|
getCurrentPostId
|
|
97
98
|
} = (0, _data.useSelect)(_store.store);
|
|
99
|
+
const {
|
|
100
|
+
isBlockBasedTheme,
|
|
101
|
+
canCreateTemplate
|
|
102
|
+
} = (0, _data.useSelect)(select => {
|
|
103
|
+
return {
|
|
104
|
+
isBlockBasedTheme: select(_coreData.store).getCurrentTheme()?.is_block_theme,
|
|
105
|
+
canCreateTemplate: select(_coreData.store).canUser('create', {
|
|
106
|
+
kind: 'postType',
|
|
107
|
+
name: 'wp_template'
|
|
108
|
+
})
|
|
109
|
+
};
|
|
110
|
+
}, []);
|
|
98
111
|
const allowSwitchEditorMode = isCodeEditingEnabled && isRichEditingEnabled;
|
|
99
112
|
if (isPreviewMode) {
|
|
100
113
|
return {
|
|
@@ -258,6 +271,21 @@ const getEditorCommandLoader = () => function useEditorCommandLoader() {
|
|
|
258
271
|
}
|
|
259
272
|
});
|
|
260
273
|
}
|
|
274
|
+
if (canCreateTemplate && isBlockBasedTheme) {
|
|
275
|
+
const isSiteEditor = (0, _url.getPath)(window.location.href)?.includes('site-editor.php');
|
|
276
|
+
if (!isSiteEditor) {
|
|
277
|
+
commands.push({
|
|
278
|
+
name: 'core/go-to-site-editor',
|
|
279
|
+
label: (0, _i18n.__)('Open Site Editor'),
|
|
280
|
+
callback: ({
|
|
281
|
+
close
|
|
282
|
+
}) => {
|
|
283
|
+
close();
|
|
284
|
+
document.location = 'site-editor.php';
|
|
285
|
+
}
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
}
|
|
261
289
|
return {
|
|
262
290
|
commands,
|
|
263
291
|
isLoading: false
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_i18n","_icons","_commands","_preferences","_notices","_blockEditor","_coreData","_interface","_htmlEntities","_lockUnlock","_store","_constants","_patternRenameModal","_patternDuplicateModal","_isTemplateRevertable","_interopRequireDefault","getEditorCommandLoader","useEditorCommandLoader","editorMode","isListViewOpen","showBlockBreadcrumbs","isDistractionFree","isFocusMode","isPreviewMode","isViewable","isCodeEditingEnabled","isRichEditingEnabled","isPublishSidebarEnabled","useSelect","select","_get","_getPostType$viewable","get","preferencesStore","isListViewOpened","getCurrentPostType","getEditorSettings","editorStore","getSettings","blockEditorStore","getPostType","coreStore","viewable","codeEditingEnabled","richEditingEnabled","getActiveComplementaryArea","interfaceStore","toggle","useDispatch","createInfoNotice","noticesStore","__unstableSaveForPreview","setIsListViewOpened","switchEditorMode","toggleDistractionFree","toggleSpotlightMode","toggleTopToolbar","openModal","enableComplementaryArea","disableComplementaryArea","getCurrentPostId","allowSwitchEditorMode","commands","isLoading","push","name","label","__","icon","keyboard","callback","close","listView","id","type","code","isRTL","drawerLeft","drawerRight","activeSidebar","blockDefault","formatListBullets","external","postId","link","window","open","getEditedEntityContextualCommands","useEditedEntityContextualCommands","postType","PATTERN_POST_TYPE","edit","patternRenameModalName","symbol","patternDuplicateModalName","getPageContentFocusCommands","usePageContentFocusCommands","onNavigateToEntityRecord","goBack","templateId","getRenderingMode","_getEditorSettings","getCurrentTemplateId","unlock","editorSettings","isTemplateHidden","onNavigateToPreviousEntityRecord","editedRecord","template","hasResolved","useEntityRecord","sprintf","decodeEntities","title","layout","page","getManipulateDocumentCommands","useManipulateDocumentCommands","revertTemplate","TEMPLATE_PART_POST_TYPE","TEMPLATE_POST_TYPE","includes","isTemplateRevertable","rotateRight","rotateLeft","useCommands","useCommandLoader","hook","context"],"sources":["@wordpress/editor/src/components/commands/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, isRTL, sprintf } from '@wordpress/i18n';\nimport {\n\tblockDefault,\n\tcode,\n\tdrawerLeft,\n\tdrawerRight,\n\tedit,\n\tformatListBullets,\n\tlistView,\n\texternal,\n\tkeyboard,\n\tsymbol,\n\tpage,\n\tlayout,\n\trotateRight,\n\trotateLeft,\n} from '@wordpress/icons';\nimport { useCommandLoader } from '@wordpress/commands';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as coreStore, useEntityRecord } from '@wordpress/core-data';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editorStore } from '../../store';\nimport {\n\tPATTERN_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tTEMPLATE_POST_TYPE,\n} from '../../store/constants';\nimport { modalName as patternRenameModalName } from '../pattern-rename-modal';\nimport { modalName as patternDuplicateModalName } from '../pattern-duplicate-modal';\nimport isTemplateRevertable from '../../store/utils/is-template-revertable';\n\nconst getEditorCommandLoader = () =>\n\tfunction useEditorCommandLoader() {\n\t\tconst {\n\t\t\teditorMode,\n\t\t\tisListViewOpen,\n\t\t\tshowBlockBreadcrumbs,\n\t\t\tisDistractionFree,\n\t\t\tisFocusMode,\n\t\t\tisPreviewMode,\n\t\t\tisViewable,\n\t\t\tisCodeEditingEnabled,\n\t\t\tisRichEditingEnabled,\n\t\t\tisPublishSidebarEnabled,\n\t\t} = useSelect( ( select ) => {\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst { isListViewOpened, getCurrentPostType, getEditorSettings } =\n\t\t\t\tselect( editorStore );\n\t\t\tconst { getSettings } = select( blockEditorStore );\n\t\t\tconst { getPostType } = select( coreStore );\n\n\t\t\treturn {\n\t\t\t\teditorMode: get( 'core', 'editorMode' ) ?? 'visual',\n\t\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\t\tshowBlockBreadcrumbs: get( 'core', 'showBlockBreadcrumbs' ),\n\t\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\t\tisFocusMode: get( 'core', 'focusMode' ),\n\t\t\t\tisPreviewMode: getSettings().isPreviewMode,\n\t\t\t\tisViewable:\n\t\t\t\t\tgetPostType( getCurrentPostType() )?.viewable ?? false,\n\t\t\t\tisCodeEditingEnabled: getEditorSettings().codeEditingEnabled,\n\t\t\t\tisRichEditingEnabled: getEditorSettings().richEditingEnabled,\n\t\t\t\tisPublishSidebarEnabled:\n\t\t\t\t\tselect( editorStore ).isPublishSidebarEnabled(),\n\t\t\t};\n\t\t}, [] );\n\t\tconst { getActiveComplementaryArea } = useSelect( interfaceStore );\n\t\tconst { toggle } = useDispatch( preferencesStore );\n\t\tconst { createInfoNotice } = useDispatch( noticesStore );\n\t\tconst {\n\t\t\t__unstableSaveForPreview,\n\t\t\tsetIsListViewOpened,\n\t\t\tswitchEditorMode,\n\t\t\ttoggleDistractionFree,\n\t\t\ttoggleSpotlightMode,\n\t\t\ttoggleTopToolbar,\n\t\t} = useDispatch( editorStore );\n\t\tconst { openModal, enableComplementaryArea, disableComplementaryArea } =\n\t\t\tuseDispatch( interfaceStore );\n\t\tconst { getCurrentPostId } = useSelect( editorStore );\n\t\tconst allowSwitchEditorMode =\n\t\t\tisCodeEditingEnabled && isRichEditingEnabled;\n\n\t\tif ( isPreviewMode ) {\n\t\t\treturn { commands: [], isLoading: false };\n\t\t}\n\n\t\tconst commands = [];\n\n\t\tcommands.push( {\n\t\t\tname: 'core/open-shortcut-help',\n\t\t\tlabel: __( 'Keyboard shortcuts' ),\n\t\t\ticon: keyboard,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tclose();\n\t\t\t\topenModal( 'editor/keyboard-shortcut-help' );\n\t\t\t},\n\t\t} );\n\n\t\tcommands.push( {\n\t\t\tname: 'core/toggle-distraction-free',\n\t\t\tlabel: isDistractionFree\n\t\t\t\t? __( 'Exit Distraction free' )\n\t\t\t\t: __( 'Enter Distraction free' ),\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\ttoggleDistractionFree();\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\n\t\tcommands.push( {\n\t\t\tname: 'core/open-preferences',\n\t\t\tlabel: __( 'Editor preferences' ),\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tclose();\n\t\t\t\topenModal( 'editor/preferences' );\n\t\t\t},\n\t\t} );\n\n\t\tcommands.push( {\n\t\t\tname: 'core/toggle-spotlight-mode',\n\t\t\tlabel: isFocusMode\n\t\t\t\t? __( 'Exit Spotlight mode' )\n\t\t\t\t: __( 'Enter Spotlight mode' ),\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\ttoggleSpotlightMode();\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\n\t\tcommands.push( {\n\t\t\tname: 'core/toggle-list-view',\n\t\t\tlabel: isListViewOpen\n\t\t\t\t? __( 'Close List View' )\n\t\t\t\t: __( 'Open List View' ),\n\t\t\ticon: listView,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tsetIsListViewOpened( ! isListViewOpen );\n\t\t\t\tclose();\n\t\t\t\tcreateInfoNotice(\n\t\t\t\t\tisListViewOpen\n\t\t\t\t\t\t? __( 'List View off.' )\n\t\t\t\t\t\t: __( 'List View on.' ),\n\t\t\t\t\t{\n\t\t\t\t\t\tid: 'core/editor/toggle-list-view/notice',\n\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t},\n\t\t} );\n\n\t\tcommands.push( {\n\t\t\tname: 'core/toggle-top-toolbar',\n\t\t\tlabel: __( 'Top toolbar' ),\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\ttoggleTopToolbar();\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\n\t\tif ( allowSwitchEditorMode ) {\n\t\t\tcommands.push( {\n\t\t\t\tname: 'core/toggle-code-editor',\n\t\t\t\tlabel:\n\t\t\t\t\teditorMode === 'visual'\n\t\t\t\t\t\t? __( 'Open code editor' )\n\t\t\t\t\t\t: __( 'Exit code editor' ),\n\t\t\t\ticon: code,\n\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\tswitchEditorMode(\n\t\t\t\t\t\teditorMode === 'visual' ? 'text' : 'visual'\n\t\t\t\t\t);\n\t\t\t\t\tclose();\n\t\t\t\t},\n\t\t\t} );\n\t\t}\n\n\t\tcommands.push( {\n\t\t\tname: 'core/toggle-breadcrumbs',\n\t\t\tlabel: showBlockBreadcrumbs\n\t\t\t\t? __( 'Hide block breadcrumbs' )\n\t\t\t\t: __( 'Show block breadcrumbs' ),\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\ttoggle( 'core', 'showBlockBreadcrumbs' );\n\t\t\t\tclose();\n\t\t\t\tcreateInfoNotice(\n\t\t\t\t\tshowBlockBreadcrumbs\n\t\t\t\t\t\t? __( 'Breadcrumbs hidden.' )\n\t\t\t\t\t\t: __( 'Breadcrumbs visible.' ),\n\t\t\t\t\t{\n\t\t\t\t\t\tid: 'core/editor/toggle-breadcrumbs/notice',\n\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t},\n\t\t} );\n\n\t\tcommands.push( {\n\t\t\tname: 'core/open-settings-sidebar',\n\t\t\tlabel: __( 'Show or hide the Settings panel.' ),\n\t\t\ticon: isRTL() ? drawerLeft : drawerRight,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tconst activeSidebar = getActiveComplementaryArea( 'core' );\n\t\t\t\tclose();\n\t\t\t\tif ( activeSidebar === 'edit-post/document' ) {\n\t\t\t\t\tdisableComplementaryArea( 'core' );\n\t\t\t\t} else {\n\t\t\t\t\tenableComplementaryArea( 'core', 'edit-post/document' );\n\t\t\t\t}\n\t\t\t},\n\t\t} );\n\n\t\tcommands.push( {\n\t\t\tname: 'core/open-block-inspector',\n\t\t\tlabel: __( 'Show or hide the Block settings panel' ),\n\t\t\ticon: blockDefault,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tconst activeSidebar = getActiveComplementaryArea( 'core' );\n\t\t\t\tclose();\n\t\t\t\tif ( activeSidebar === 'edit-post/block' ) {\n\t\t\t\t\tdisableComplementaryArea( 'core' );\n\t\t\t\t} else {\n\t\t\t\t\tenableComplementaryArea( 'core', 'edit-post/block' );\n\t\t\t\t}\n\t\t\t},\n\t\t} );\n\n\t\tcommands.push( {\n\t\t\tname: 'core/toggle-publish-sidebar',\n\t\t\tlabel: isPublishSidebarEnabled\n\t\t\t\t? __( 'Disable pre-publish checks' )\n\t\t\t\t: __( 'Enable pre-publish checks' ),\n\t\t\ticon: formatListBullets,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tclose();\n\t\t\t\ttoggle( 'core', 'isPublishSidebarEnabled' );\n\t\t\t\tcreateInfoNotice(\n\t\t\t\t\tisPublishSidebarEnabled\n\t\t\t\t\t\t? __( 'Pre-publish checks disabled.' )\n\t\t\t\t\t\t: __( 'Pre-publish checks enabled.' ),\n\t\t\t\t\t{\n\t\t\t\t\t\tid: 'core/editor/publish-sidebar/notice',\n\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t},\n\t\t} );\n\n\t\tif ( isViewable ) {\n\t\t\tcommands.push( {\n\t\t\t\tname: 'core/preview-link',\n\t\t\t\tlabel: __( 'Preview in a new tab' ),\n\t\t\t\ticon: external,\n\t\t\t\tcallback: async ( { close } ) => {\n\t\t\t\t\tclose();\n\t\t\t\t\tconst postId = getCurrentPostId();\n\t\t\t\t\tconst link = await __unstableSaveForPreview();\n\t\t\t\t\twindow.open( link, `wp-preview-${ postId }` );\n\t\t\t\t},\n\t\t\t} );\n\t\t}\n\n\t\treturn {\n\t\t\tcommands,\n\t\t\tisLoading: false,\n\t\t};\n\t};\n\nconst getEditedEntityContextualCommands = () =>\n\tfunction useEditedEntityContextualCommands() {\n\t\tconst { postType } = useSelect( ( select ) => {\n\t\t\tconst { getCurrentPostType } = select( editorStore );\n\t\t\treturn {\n\t\t\t\tpostType: getCurrentPostType(),\n\t\t\t};\n\t\t}, [] );\n\t\tconst { openModal } = useDispatch( interfaceStore );\n\t\tconst commands = [];\n\n\t\tif ( postType === PATTERN_POST_TYPE ) {\n\t\t\tcommands.push( {\n\t\t\t\tname: 'core/rename-pattern',\n\t\t\t\tlabel: __( 'Rename pattern' ),\n\t\t\t\ticon: edit,\n\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\topenModal( patternRenameModalName );\n\t\t\t\t\tclose();\n\t\t\t\t},\n\t\t\t} );\n\t\t\tcommands.push( {\n\t\t\t\tname: 'core/duplicate-pattern',\n\t\t\t\tlabel: __( 'Duplicate pattern' ),\n\t\t\t\ticon: symbol,\n\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\topenModal( patternDuplicateModalName );\n\t\t\t\t\tclose();\n\t\t\t\t},\n\t\t\t} );\n\t\t}\n\n\t\treturn { isLoading: false, commands };\n\t};\n\nconst getPageContentFocusCommands = () =>\n\tfunction usePageContentFocusCommands() {\n\t\tconst { onNavigateToEntityRecord, goBack, templateId, isPreviewMode } =\n\t\t\tuseSelect( ( select ) => {\n\t\t\t\tconst {\n\t\t\t\t\tgetRenderingMode,\n\t\t\t\t\tgetEditorSettings: _getEditorSettings,\n\t\t\t\t\tgetCurrentTemplateId,\n\t\t\t\t} = unlock( select( editorStore ) );\n\t\t\t\tconst editorSettings = _getEditorSettings();\n\t\t\t\treturn {\n\t\t\t\t\tisTemplateHidden: getRenderingMode() === 'post-only',\n\t\t\t\t\tonNavigateToEntityRecord:\n\t\t\t\t\t\teditorSettings.onNavigateToEntityRecord,\n\t\t\t\t\tgetEditorSettings: _getEditorSettings,\n\t\t\t\t\tgoBack: editorSettings.onNavigateToPreviousEntityRecord,\n\t\t\t\t\ttemplateId: getCurrentTemplateId(),\n\t\t\t\t\tisPreviewMode: editorSettings.isPreviewMode,\n\t\t\t\t};\n\t\t\t}, [] );\n\t\tconst { editedRecord: template, hasResolved } = useEntityRecord(\n\t\t\t'postType',\n\t\t\t'wp_template',\n\t\t\ttemplateId\n\t\t);\n\n\t\tif ( isPreviewMode ) {\n\t\t\treturn { isLoading: false, commands: [] };\n\t\t}\n\n\t\tconst commands = [];\n\n\t\tif ( templateId && hasResolved ) {\n\t\t\tcommands.push( {\n\t\t\t\tname: 'core/switch-to-template-focus',\n\t\t\t\tlabel: sprintf(\n\t\t\t\t\t/* translators: %s: template title */\n\t\t\t\t\t__( 'Edit template: %s' ),\n\t\t\t\t\tdecodeEntities( template.title )\n\t\t\t\t),\n\t\t\t\ticon: layout,\n\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\tonNavigateToEntityRecord( {\n\t\t\t\t\t\tpostId: templateId,\n\t\t\t\t\t\tpostType: 'wp_template',\n\t\t\t\t\t} );\n\t\t\t\t\tclose();\n\t\t\t\t},\n\t\t\t} );\n\t\t}\n\n\t\tif ( !! goBack ) {\n\t\t\tcommands.push( {\n\t\t\t\tname: 'core/switch-to-previous-entity',\n\t\t\t\tlabel: __( 'Go back' ),\n\t\t\t\ticon: page,\n\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\tgoBack();\n\t\t\t\t\tclose();\n\t\t\t\t},\n\t\t\t} );\n\t\t}\n\n\t\treturn { isLoading: false, commands };\n\t};\n\nconst getManipulateDocumentCommands = () =>\n\tfunction useManipulateDocumentCommands() {\n\t\tconst { postType, postId } = useSelect( ( select ) => {\n\t\t\tconst { getCurrentPostId, getCurrentPostType } =\n\t\t\t\tselect( editorStore );\n\t\t\treturn {\n\t\t\t\tpostType: getCurrentPostType(),\n\t\t\t\tpostId: getCurrentPostId(),\n\t\t\t};\n\t\t}, [] );\n\t\tconst { editedRecord: template, hasResolved } = useEntityRecord(\n\t\t\t'postType',\n\t\t\tpostType,\n\t\t\tpostId\n\t\t);\n\t\t// eslint-disable-next-line @wordpress/no-unused-vars-before-return\n\t\tconst { revertTemplate } = unlock( useDispatch( editorStore ) );\n\n\t\tif (\n\t\t\t! hasResolved ||\n\t\t\t! [ TEMPLATE_PART_POST_TYPE, TEMPLATE_POST_TYPE ].includes(\n\t\t\t\tpostType\n\t\t\t)\n\t\t) {\n\t\t\treturn { isLoading: true, commands: [] };\n\t\t}\n\n\t\tconst commands = [];\n\n\t\tif ( isTemplateRevertable( template ) ) {\n\t\t\tconst label =\n\t\t\t\ttemplate.type === TEMPLATE_POST_TYPE\n\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t/* translators: %s: template title */\n\t\t\t\t\t\t\t__( 'Reset template: %s' ),\n\t\t\t\t\t\t\tdecodeEntities( template.title )\n\t\t\t\t\t )\n\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t/* translators: %s: template part title */\n\t\t\t\t\t\t\t__( 'Reset template part: %s' ),\n\t\t\t\t\t\t\tdecodeEntities( template.title )\n\t\t\t\t\t );\n\t\t\tcommands.push( {\n\t\t\t\tname: 'core/reset-template',\n\t\t\t\tlabel,\n\t\t\t\ticon: isRTL() ? rotateRight : rotateLeft,\n\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\trevertTemplate( template );\n\t\t\t\t\tclose();\n\t\t\t\t},\n\t\t\t} );\n\t\t}\n\n\t\treturn {\n\t\t\tisLoading: ! hasResolved,\n\t\t\tcommands,\n\t\t};\n\t};\n\nexport default function useCommands() {\n\tuseCommandLoader( {\n\t\tname: 'core/editor/edit-ui',\n\t\thook: getEditorCommandLoader(),\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/editor/contextual-commands',\n\t\thook: getEditedEntityContextualCommands(),\n\t\tcontext: 'entity-edit',\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/editor/page-content-focus',\n\t\thook: getPageContentFocusCommands(),\n\t\tcontext: 'entity-edit',\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/manipulate-document',\n\t\thook: getManipulateDocumentCommands(),\n\t} );\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAgBA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,G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ences","_notices","_blockEditor","_coreData","_interface","_url","_htmlEntities","_lockUnlock","_store","_constants","_patternRenameModal","_patternDuplicateModal","_isTemplateRevertable","_interopRequireDefault","getEditorCommandLoader","useEditorCommandLoader","editorMode","isListViewOpen","showBlockBreadcrumbs","isDistractionFree","isFocusMode","isPreviewMode","isViewable","isCodeEditingEnabled","isRichEditingEnabled","isPublishSidebarEnabled","useSelect","select","_get","_getPostType$viewable","get","preferencesStore","isListViewOpened","getCurrentPostType","getEditorSettings","editorStore","getSettings","blockEditorStore","getPostType","coreStore","viewable","codeEditingEnabled","richEditingEnabled","getActiveComplementaryArea","interfaceStore","toggle","useDispatch","createInfoNotice","noticesStore","__unstableSaveForPreview","setIsListViewOpened","switchEditorMode","toggleDistractionFree","toggleSpotlightMode","toggleTopToolbar","openModal","enableComplementaryArea","disableComplementaryArea","getCurrentPostId","isBlockBasedTheme","canCreateTemplate","getCurrentTheme","is_block_theme","canUser","kind","name","allowSwitchEditorMode","commands","isLoading","push","label","__","icon","keyboard","callback","close","listView","id","type","code","isRTL","drawerLeft","drawerRight","activeSidebar","blockDefault","formatListBullets","external","postId","link","window","open","isSiteEditor","getPath","location","href","includes","document","getEditedEntityContextualCommands","useEditedEntityContextualCommands","postType","PATTERN_POST_TYPE","edit","patternRenameModalName","symbol","patternDuplicateModalName","getPageContentFocusCommands","usePageContentFocusCommands","onNavigateToEntityRecord","goBack","templateId","getRenderingMode","_getEditorSettings","getCurrentTemplateId","unlock","editorSettings","isTemplateHidden","onNavigateToPreviousEntityRecord","editedRecord","template","hasResolved","useEntityRecord","sprintf","decodeEntities","title","layout","page","getManipulateDocumentCommands","useManipulateDocumentCommands","revertTemplate","TEMPLATE_PART_POST_TYPE","TEMPLATE_POST_TYPE","isTemplateRevertable","rotateRight","rotateLeft","useCommands","useCommandLoader","hook","context"],"sources":["@wordpress/editor/src/components/commands/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, isRTL, sprintf } from '@wordpress/i18n';\nimport {\n\tblockDefault,\n\tcode,\n\tdrawerLeft,\n\tdrawerRight,\n\tedit,\n\tformatListBullets,\n\tlistView,\n\texternal,\n\tkeyboard,\n\tsymbol,\n\tpage,\n\tlayout,\n\trotateRight,\n\trotateLeft,\n} from '@wordpress/icons';\nimport { useCommandLoader } from '@wordpress/commands';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as coreStore, useEntityRecord } from '@wordpress/core-data';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { getPath } from '@wordpress/url';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editorStore } from '../../store';\nimport {\n\tPATTERN_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tTEMPLATE_POST_TYPE,\n} from '../../store/constants';\nimport { modalName as patternRenameModalName } from '../pattern-rename-modal';\nimport { modalName as patternDuplicateModalName } from '../pattern-duplicate-modal';\nimport isTemplateRevertable from '../../store/utils/is-template-revertable';\n\nconst getEditorCommandLoader = () =>\n\tfunction useEditorCommandLoader() {\n\t\tconst {\n\t\t\teditorMode,\n\t\t\tisListViewOpen,\n\t\t\tshowBlockBreadcrumbs,\n\t\t\tisDistractionFree,\n\t\t\tisFocusMode,\n\t\t\tisPreviewMode,\n\t\t\tisViewable,\n\t\t\tisCodeEditingEnabled,\n\t\t\tisRichEditingEnabled,\n\t\t\tisPublishSidebarEnabled,\n\t\t} = useSelect( ( select ) => {\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst { isListViewOpened, getCurrentPostType, getEditorSettings } =\n\t\t\t\tselect( editorStore );\n\t\t\tconst { getSettings } = select( blockEditorStore );\n\t\t\tconst { getPostType } = select( coreStore );\n\n\t\t\treturn {\n\t\t\t\teditorMode: get( 'core', 'editorMode' ) ?? 'visual',\n\t\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\t\tshowBlockBreadcrumbs: get( 'core', 'showBlockBreadcrumbs' ),\n\t\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\t\tisFocusMode: get( 'core', 'focusMode' ),\n\t\t\t\tisPreviewMode: getSettings().isPreviewMode,\n\t\t\t\tisViewable:\n\t\t\t\t\tgetPostType( getCurrentPostType() )?.viewable ?? false,\n\t\t\t\tisCodeEditingEnabled: getEditorSettings().codeEditingEnabled,\n\t\t\t\tisRichEditingEnabled: getEditorSettings().richEditingEnabled,\n\t\t\t\tisPublishSidebarEnabled:\n\t\t\t\t\tselect( editorStore ).isPublishSidebarEnabled(),\n\t\t\t};\n\t\t}, [] );\n\t\tconst { getActiveComplementaryArea } = useSelect( interfaceStore );\n\t\tconst { toggle } = useDispatch( preferencesStore );\n\t\tconst { createInfoNotice } = useDispatch( noticesStore );\n\t\tconst {\n\t\t\t__unstableSaveForPreview,\n\t\t\tsetIsListViewOpened,\n\t\t\tswitchEditorMode,\n\t\t\ttoggleDistractionFree,\n\t\t\ttoggleSpotlightMode,\n\t\t\ttoggleTopToolbar,\n\t\t} = useDispatch( editorStore );\n\t\tconst { openModal, enableComplementaryArea, disableComplementaryArea } =\n\t\t\tuseDispatch( interfaceStore );\n\t\tconst { getCurrentPostId } = useSelect( editorStore );\n\t\tconst { isBlockBasedTheme, canCreateTemplate } = useSelect(\n\t\t\t( select ) => {\n\t\t\t\treturn {\n\t\t\t\t\tisBlockBasedTheme:\n\t\t\t\t\t\tselect( coreStore ).getCurrentTheme()?.is_block_theme,\n\t\t\t\t\tcanCreateTemplate: select( coreStore ).canUser( 'create', {\n\t\t\t\t\t\tkind: 'postType',\n\t\t\t\t\t\tname: 'wp_template',\n\t\t\t\t\t} ),\n\t\t\t\t};\n\t\t\t},\n\t\t\t[]\n\t\t);\n\t\tconst allowSwitchEditorMode =\n\t\t\tisCodeEditingEnabled && isRichEditingEnabled;\n\n\t\tif ( isPreviewMode ) {\n\t\t\treturn { commands: [], isLoading: false };\n\t\t}\n\n\t\tconst commands = [];\n\n\t\tcommands.push( {\n\t\t\tname: 'core/open-shortcut-help',\n\t\t\tlabel: __( 'Keyboard shortcuts' ),\n\t\t\ticon: keyboard,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tclose();\n\t\t\t\topenModal( 'editor/keyboard-shortcut-help' );\n\t\t\t},\n\t\t} );\n\n\t\tcommands.push( {\n\t\t\tname: 'core/toggle-distraction-free',\n\t\t\tlabel: isDistractionFree\n\t\t\t\t? __( 'Exit Distraction free' )\n\t\t\t\t: __( 'Enter Distraction free' ),\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\ttoggleDistractionFree();\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\n\t\tcommands.push( {\n\t\t\tname: 'core/open-preferences',\n\t\t\tlabel: __( 'Editor preferences' ),\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tclose();\n\t\t\t\topenModal( 'editor/preferences' );\n\t\t\t},\n\t\t} );\n\n\t\tcommands.push( {\n\t\t\tname: 'core/toggle-spotlight-mode',\n\t\t\tlabel: isFocusMode\n\t\t\t\t? __( 'Exit Spotlight mode' )\n\t\t\t\t: __( 'Enter Spotlight mode' ),\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\ttoggleSpotlightMode();\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\n\t\tcommands.push( {\n\t\t\tname: 'core/toggle-list-view',\n\t\t\tlabel: isListViewOpen\n\t\t\t\t? __( 'Close List View' )\n\t\t\t\t: __( 'Open List View' ),\n\t\t\ticon: listView,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tsetIsListViewOpened( ! isListViewOpen );\n\t\t\t\tclose();\n\t\t\t\tcreateInfoNotice(\n\t\t\t\t\tisListViewOpen\n\t\t\t\t\t\t? __( 'List View off.' )\n\t\t\t\t\t\t: __( 'List View on.' ),\n\t\t\t\t\t{\n\t\t\t\t\t\tid: 'core/editor/toggle-list-view/notice',\n\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t},\n\t\t} );\n\n\t\tcommands.push( {\n\t\t\tname: 'core/toggle-top-toolbar',\n\t\t\tlabel: __( 'Top toolbar' ),\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\ttoggleTopToolbar();\n\t\t\t\tclose();\n\t\t\t},\n\t\t} );\n\n\t\tif ( allowSwitchEditorMode ) {\n\t\t\tcommands.push( {\n\t\t\t\tname: 'core/toggle-code-editor',\n\t\t\t\tlabel:\n\t\t\t\t\teditorMode === 'visual'\n\t\t\t\t\t\t? __( 'Open code editor' )\n\t\t\t\t\t\t: __( 'Exit code editor' ),\n\t\t\t\ticon: code,\n\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\tswitchEditorMode(\n\t\t\t\t\t\teditorMode === 'visual' ? 'text' : 'visual'\n\t\t\t\t\t);\n\t\t\t\t\tclose();\n\t\t\t\t},\n\t\t\t} );\n\t\t}\n\n\t\tcommands.push( {\n\t\t\tname: 'core/toggle-breadcrumbs',\n\t\t\tlabel: showBlockBreadcrumbs\n\t\t\t\t? __( 'Hide block breadcrumbs' )\n\t\t\t\t: __( 'Show block breadcrumbs' ),\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\ttoggle( 'core', 'showBlockBreadcrumbs' );\n\t\t\t\tclose();\n\t\t\t\tcreateInfoNotice(\n\t\t\t\t\tshowBlockBreadcrumbs\n\t\t\t\t\t\t? __( 'Breadcrumbs hidden.' )\n\t\t\t\t\t\t: __( 'Breadcrumbs visible.' ),\n\t\t\t\t\t{\n\t\t\t\t\t\tid: 'core/editor/toggle-breadcrumbs/notice',\n\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t},\n\t\t} );\n\n\t\tcommands.push( {\n\t\t\tname: 'core/open-settings-sidebar',\n\t\t\tlabel: __( 'Show or hide the Settings panel.' ),\n\t\t\ticon: isRTL() ? drawerLeft : drawerRight,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tconst activeSidebar = getActiveComplementaryArea( 'core' );\n\t\t\t\tclose();\n\t\t\t\tif ( activeSidebar === 'edit-post/document' ) {\n\t\t\t\t\tdisableComplementaryArea( 'core' );\n\t\t\t\t} else {\n\t\t\t\t\tenableComplementaryArea( 'core', 'edit-post/document' );\n\t\t\t\t}\n\t\t\t},\n\t\t} );\n\n\t\tcommands.push( {\n\t\t\tname: 'core/open-block-inspector',\n\t\t\tlabel: __( 'Show or hide the Block settings panel' ),\n\t\t\ticon: blockDefault,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tconst activeSidebar = getActiveComplementaryArea( 'core' );\n\t\t\t\tclose();\n\t\t\t\tif ( activeSidebar === 'edit-post/block' ) {\n\t\t\t\t\tdisableComplementaryArea( 'core' );\n\t\t\t\t} else {\n\t\t\t\t\tenableComplementaryArea( 'core', 'edit-post/block' );\n\t\t\t\t}\n\t\t\t},\n\t\t} );\n\n\t\tcommands.push( {\n\t\t\tname: 'core/toggle-publish-sidebar',\n\t\t\tlabel: isPublishSidebarEnabled\n\t\t\t\t? __( 'Disable pre-publish checks' )\n\t\t\t\t: __( 'Enable pre-publish checks' ),\n\t\t\ticon: formatListBullets,\n\t\t\tcallback: ( { close } ) => {\n\t\t\t\tclose();\n\t\t\t\ttoggle( 'core', 'isPublishSidebarEnabled' );\n\t\t\t\tcreateInfoNotice(\n\t\t\t\t\tisPublishSidebarEnabled\n\t\t\t\t\t\t? __( 'Pre-publish checks disabled.' )\n\t\t\t\t\t\t: __( 'Pre-publish checks enabled.' ),\n\t\t\t\t\t{\n\t\t\t\t\t\tid: 'core/editor/publish-sidebar/notice',\n\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t},\n\t\t} );\n\n\t\tif ( isViewable ) {\n\t\t\tcommands.push( {\n\t\t\t\tname: 'core/preview-link',\n\t\t\t\tlabel: __( 'Preview in a new tab' ),\n\t\t\t\ticon: external,\n\t\t\t\tcallback: async ( { close } ) => {\n\t\t\t\t\tclose();\n\t\t\t\t\tconst postId = getCurrentPostId();\n\t\t\t\t\tconst link = await __unstableSaveForPreview();\n\t\t\t\t\twindow.open( link, `wp-preview-${ postId }` );\n\t\t\t\t},\n\t\t\t} );\n\t\t}\n\t\tif ( canCreateTemplate && isBlockBasedTheme ) {\n\t\t\tconst isSiteEditor = getPath( window.location.href )?.includes(\n\t\t\t\t'site-editor.php'\n\t\t\t);\n\t\t\tif ( ! isSiteEditor ) {\n\t\t\t\tcommands.push( {\n\t\t\t\t\tname: 'core/go-to-site-editor',\n\t\t\t\t\tlabel: __( 'Open Site Editor' ),\n\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\tclose();\n\t\t\t\t\t\tdocument.location = 'site-editor.php';\n\t\t\t\t\t},\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tcommands,\n\t\t\tisLoading: false,\n\t\t};\n\t};\n\nconst getEditedEntityContextualCommands = () =>\n\tfunction useEditedEntityContextualCommands() {\n\t\tconst { postType } = useSelect( ( select ) => {\n\t\t\tconst { getCurrentPostType } = select( editorStore );\n\t\t\treturn {\n\t\t\t\tpostType: getCurrentPostType(),\n\t\t\t};\n\t\t}, [] );\n\t\tconst { openModal } = useDispatch( interfaceStore );\n\t\tconst commands = [];\n\n\t\tif ( postType === PATTERN_POST_TYPE ) {\n\t\t\tcommands.push( {\n\t\t\t\tname: 'core/rename-pattern',\n\t\t\t\tlabel: __( 'Rename pattern' ),\n\t\t\t\ticon: edit,\n\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\topenModal( patternRenameModalName );\n\t\t\t\t\tclose();\n\t\t\t\t},\n\t\t\t} );\n\t\t\tcommands.push( {\n\t\t\t\tname: 'core/duplicate-pattern',\n\t\t\t\tlabel: __( 'Duplicate pattern' ),\n\t\t\t\ticon: symbol,\n\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\topenModal( patternDuplicateModalName );\n\t\t\t\t\tclose();\n\t\t\t\t},\n\t\t\t} );\n\t\t}\n\n\t\treturn { isLoading: false, commands };\n\t};\n\nconst getPageContentFocusCommands = () =>\n\tfunction usePageContentFocusCommands() {\n\t\tconst { onNavigateToEntityRecord, goBack, templateId, isPreviewMode } =\n\t\t\tuseSelect( ( select ) => {\n\t\t\t\tconst {\n\t\t\t\t\tgetRenderingMode,\n\t\t\t\t\tgetEditorSettings: _getEditorSettings,\n\t\t\t\t\tgetCurrentTemplateId,\n\t\t\t\t} = unlock( select( editorStore ) );\n\t\t\t\tconst editorSettings = _getEditorSettings();\n\t\t\t\treturn {\n\t\t\t\t\tisTemplateHidden: getRenderingMode() === 'post-only',\n\t\t\t\t\tonNavigateToEntityRecord:\n\t\t\t\t\t\teditorSettings.onNavigateToEntityRecord,\n\t\t\t\t\tgetEditorSettings: _getEditorSettings,\n\t\t\t\t\tgoBack: editorSettings.onNavigateToPreviousEntityRecord,\n\t\t\t\t\ttemplateId: getCurrentTemplateId(),\n\t\t\t\t\tisPreviewMode: editorSettings.isPreviewMode,\n\t\t\t\t};\n\t\t\t}, [] );\n\t\tconst { editedRecord: template, hasResolved } = useEntityRecord(\n\t\t\t'postType',\n\t\t\t'wp_template',\n\t\t\ttemplateId\n\t\t);\n\n\t\tif ( isPreviewMode ) {\n\t\t\treturn { isLoading: false, commands: [] };\n\t\t}\n\n\t\tconst commands = [];\n\n\t\tif ( templateId && hasResolved ) {\n\t\t\tcommands.push( {\n\t\t\t\tname: 'core/switch-to-template-focus',\n\t\t\t\tlabel: sprintf(\n\t\t\t\t\t/* translators: %s: template title */\n\t\t\t\t\t__( 'Edit template: %s' ),\n\t\t\t\t\tdecodeEntities( template.title )\n\t\t\t\t),\n\t\t\t\ticon: layout,\n\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\tonNavigateToEntityRecord( {\n\t\t\t\t\t\tpostId: templateId,\n\t\t\t\t\t\tpostType: 'wp_template',\n\t\t\t\t\t} );\n\t\t\t\t\tclose();\n\t\t\t\t},\n\t\t\t} );\n\t\t}\n\n\t\tif ( !! goBack ) {\n\t\t\tcommands.push( {\n\t\t\t\tname: 'core/switch-to-previous-entity',\n\t\t\t\tlabel: __( 'Go back' ),\n\t\t\t\ticon: page,\n\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\tgoBack();\n\t\t\t\t\tclose();\n\t\t\t\t},\n\t\t\t} );\n\t\t}\n\n\t\treturn { isLoading: false, commands };\n\t};\n\nconst getManipulateDocumentCommands = () =>\n\tfunction useManipulateDocumentCommands() {\n\t\tconst { postType, postId } = useSelect( ( select ) => {\n\t\t\tconst { getCurrentPostId, getCurrentPostType } =\n\t\t\t\tselect( editorStore );\n\t\t\treturn {\n\t\t\t\tpostType: getCurrentPostType(),\n\t\t\t\tpostId: getCurrentPostId(),\n\t\t\t};\n\t\t}, [] );\n\t\tconst { editedRecord: template, hasResolved } = useEntityRecord(\n\t\t\t'postType',\n\t\t\tpostType,\n\t\t\tpostId\n\t\t);\n\t\t// eslint-disable-next-line @wordpress/no-unused-vars-before-return\n\t\tconst { revertTemplate } = unlock( useDispatch( editorStore ) );\n\n\t\tif (\n\t\t\t! hasResolved ||\n\t\t\t! [ TEMPLATE_PART_POST_TYPE, TEMPLATE_POST_TYPE ].includes(\n\t\t\t\tpostType\n\t\t\t)\n\t\t) {\n\t\t\treturn { isLoading: true, commands: [] };\n\t\t}\n\n\t\tconst commands = [];\n\n\t\tif ( isTemplateRevertable( template ) ) {\n\t\t\tconst label =\n\t\t\t\ttemplate.type === TEMPLATE_POST_TYPE\n\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t/* translators: %s: template title */\n\t\t\t\t\t\t\t__( 'Reset template: %s' ),\n\t\t\t\t\t\t\tdecodeEntities( template.title )\n\t\t\t\t\t )\n\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t/* translators: %s: template part title */\n\t\t\t\t\t\t\t__( 'Reset template part: %s' ),\n\t\t\t\t\t\t\tdecodeEntities( template.title )\n\t\t\t\t\t );\n\t\t\tcommands.push( {\n\t\t\t\tname: 'core/reset-template',\n\t\t\t\tlabel,\n\t\t\t\ticon: isRTL() ? rotateRight : rotateLeft,\n\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\trevertTemplate( template );\n\t\t\t\t\tclose();\n\t\t\t\t},\n\t\t\t} );\n\t\t}\n\n\t\treturn {\n\t\t\tisLoading: ! hasResolved,\n\t\t\tcommands,\n\t\t};\n\t};\n\nexport default function useCommands() {\n\tuseCommandLoader( {\n\t\tname: 'core/editor/edit-ui',\n\t\thook: getEditorCommandLoader(),\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/editor/contextual-commands',\n\t\thook: getEditedEntityContextualCommands(),\n\t\tcontext: 'entity-edit',\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/editor/page-content-focus',\n\t\thook: getPageContentFocusCommands(),\n\t\tcontext: 'entity-edit',\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/manipulate-document',\n\t\thook: getManipulateDocumentCommands(),\n\t} );\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAgBA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,UAAA,GAAAR,OAAA;AACA,IAAAS,IAAA,GAAAT,OAAA;AACA,IAAAU,aAAA,GAAAV,OAAA;AAKA,IAAAW,WAAA,GAAAX,OAAA;AACA,IAAAY,MAAA,GAAAZ,OAAA;AACA,IAAAa,UAAA,GAAAb,OAAA;AAKA,IAAAc,mBAAA,GAAAd,OAAA;AACA,IAAAe,sBAAA,GAAAf,OAAA;AACA,IAAAgB,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AAI,EAAE1H,sBAAsB,CAAC;EAC9B,CAAE,CAAC;EAEH,IAAAyH,0BAAgB,EAAE;IACjBtE,IAAI,EAAE,iCAAiC;IACvCuE,IAAI,EAAEvC,iCAAiC,CAAC,CAAC;IACzCwC,OAAO,EAAE;EACV,CAAE,CAAC;EAEH,IAAAF,0BAAgB,EAAE;IACjBtE,IAAI,EAAE,gCAAgC;IACtCuE,IAAI,EAAE/B,2BAA2B,CAAC,CAAC;IACnCgC,OAAO,EAAE;EACV,CAAE,CAAC;EAEH,IAAAF,0BAAgB,EAAE;IACjBtE,IAAI,EAAE,oCAAoC;IAC1CuE,IAAI,EAAEV,6BAA6B,CAAC;EACrC,CAAE,CAAC;AACJ","ignoreList":[]}
|
|
@@ -17,6 +17,7 @@ var _commands = require("@wordpress/commands");
|
|
|
17
17
|
var _element = require("@wordpress/element");
|
|
18
18
|
var _compose = require("@wordpress/compose");
|
|
19
19
|
var _htmlEntities = require("@wordpress/html-entities");
|
|
20
|
+
var _dom = require("@wordpress/dom");
|
|
20
21
|
var _constants = require("../../store/constants");
|
|
21
22
|
var _store = require("../../store");
|
|
22
23
|
var _pageTypeBadge = _interopRequireDefault(require("../../utils/pageTypeBadge"));
|
|
@@ -176,7 +177,7 @@ function DocumentBar(props) {
|
|
|
176
177
|
as: "h1",
|
|
177
178
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
178
179
|
className: "editor-document-bar__post-title",
|
|
179
|
-
children: title ? (0,
|
|
180
|
+
children: title ? (0, _dom.__unstableStripHTML)(title) : (0, _i18n.__)('No title')
|
|
180
181
|
}), pageTypeBadge && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
181
182
|
className: "editor-document-bar__post-type-label",
|
|
182
183
|
children: `· ${pageTypeBadge}`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_data","_components","_blockEditor","_icons","_keycodes","_coreData","_commands","_element","_compose","_htmlEntities","_constants","_store","_pageTypeBadge","_getTemplateInfo","_jsxRuntime","MotionButton","motion","Button","DocumentBar","props","postId","postType","postTypeLabel","documentTitle","isNotFound","templateTitle","onNavigateToPreviousEntityRecord","isTemplatePreview","useSelect","select","_select$getEntityReco","getCurrentPostType","getCurrentPostId","getEditorSettings","getRenderingMode","editorStore","getEditedEntityRecord","getPostType","isResolving","isResolvingSelector","coreStore","_postType","_postId","_document","default_template_types","templateTypes","getEntityRecord","_templateInfo","getTemplateInfo","template","_postTypeLabel","labels","singular_name","title","open","openCommandCenter","useDispatch","commandsStore","isReducedMotion","useReducedMotion","isTemplate","TEMPLATE_POST_TYPES","includes","hasBackButton","entityTitle","icon","pageTypeBadge","usePageTypeBadge","mountedRef","useRef","useEffect","current","jsxs","className","clsx","children","jsx","__unstableAnimatePresence","isRTL","chevronRightSmall","chevronLeftSmall","onClick","event","stopPropagation","size","initial","opacity","transform","animate","exit","transition","duration","undefined","__","BlockIcon","layout","__experimentalText","__unstableMotion","div","as","decodeEntities","displayShortcut","primary"],"sources":["@wordpress/editor/src/components/document-bar/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, isRTL } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tButton,\n\t__experimentalText as Text,\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n} from '@wordpress/components';\nimport { BlockIcon } from '@wordpress/block-editor';\nimport { chevronLeftSmall, chevronRightSmall, layout } from '@wordpress/icons';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as commandsStore } from '@wordpress/commands';\nimport { useRef, useEffect } from '@wordpress/element';\nimport { useReducedMotion } from '@wordpress/compose';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { TEMPLATE_POST_TYPES } from '../../store/constants';\nimport { store as editorStore } from '../../store';\nimport usePageTypeBadge from '../../utils/pageTypeBadge';\nimport { getTemplateInfo } from '../../utils/get-template-info';\n\n/** @typedef {import(\"@wordpress/components\").IconType} IconType */\n\nconst MotionButton = motion( Button );\n\n/**\n * This component renders a navigation bar at the top of the editor. It displays the title of the current document,\n * a back button (if applicable), and a command center button. It also handles different states of the document,\n * such as \"not found\" or \"unsynced\".\n *\n * @example\n * ```jsx\n * <DocumentBar />\n * ```\n * @param {Object} props The component props.\n * @param {string} props.title A title for the document, defaulting to the document or\n * template title currently being edited.\n * @param {IconType} props.icon An icon for the document, no default.\n * (A default icon indicating the document post type is no longer used.)\n *\n * @return {React.ReactNode} The rendered DocumentBar component.\n */\nexport default function DocumentBar( props ) {\n\tconst {\n\t\tpostId,\n\t\tpostType,\n\t\tpostTypeLabel,\n\t\tdocumentTitle,\n\t\tisNotFound,\n\t\ttemplateTitle,\n\t\tonNavigateToPreviousEntityRecord,\n\t\tisTemplatePreview,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetCurrentPostType,\n\t\t\tgetCurrentPostId,\n\t\t\tgetEditorSettings,\n\t\t\tgetRenderingMode,\n\t\t} = select( editorStore );\n\n\t\tconst {\n\t\t\tgetEditedEntityRecord,\n\t\t\tgetPostType,\n\t\t\tisResolving: isResolvingSelector,\n\t\t} = select( coreStore );\n\t\tconst _postType = getCurrentPostType();\n\t\tconst _postId = getCurrentPostId();\n\t\tconst _document = getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\t_postType,\n\t\t\t_postId\n\t\t);\n\n\t\tconst { default_template_types: templateTypes = [] } =\n\t\t\tselect( coreStore ).getEntityRecord( 'root', '__unstableBase' ) ??\n\t\t\t{};\n\n\t\tconst _templateInfo = getTemplateInfo( {\n\t\t\ttemplateTypes,\n\t\t\ttemplate: _document,\n\t\t} );\n\t\tconst _postTypeLabel = getPostType( _postType )?.labels?.singular_name;\n\n\t\treturn {\n\t\t\tpostId: _postId,\n\t\t\tpostType: _postType,\n\t\t\tpostTypeLabel: _postTypeLabel,\n\t\t\tdocumentTitle: _document.title,\n\t\t\tisNotFound:\n\t\t\t\t! _document &&\n\t\t\t\t! isResolvingSelector(\n\t\t\t\t\t'getEditedEntityRecord',\n\t\t\t\t\t'postType',\n\t\t\t\t\t_postType,\n\t\t\t\t\t_postId\n\t\t\t\t),\n\t\t\ttemplateTitle: _templateInfo.title,\n\t\t\tonNavigateToPreviousEntityRecord:\n\t\t\t\tgetEditorSettings().onNavigateToPreviousEntityRecord,\n\t\t\tisTemplatePreview: getRenderingMode() === 'template-locked',\n\t\t};\n\t}, [] );\n\n\tconst { open: openCommandCenter } = useDispatch( commandsStore );\n\tconst isReducedMotion = useReducedMotion();\n\n\tconst isTemplate = TEMPLATE_POST_TYPES.includes( postType );\n\tconst hasBackButton = !! onNavigateToPreviousEntityRecord;\n\tconst entityTitle = isTemplate ? templateTitle : documentTitle;\n\tconst title = props.title || entityTitle;\n\tconst icon = props.icon;\n\n\tconst pageTypeBadge = usePageTypeBadge( postId );\n\n\tconst mountedRef = useRef( false );\n\tuseEffect( () => {\n\t\tmountedRef.current = true;\n\t}, [] );\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ clsx( 'editor-document-bar', {\n\t\t\t\t'has-back-button': hasBackButton,\n\t\t\t} ) }\n\t\t>\n\t\t\t<AnimatePresence>\n\t\t\t\t{ hasBackButton && (\n\t\t\t\t\t<MotionButton\n\t\t\t\t\t\tclassName=\"editor-document-bar__back\"\n\t\t\t\t\t\ticon={ isRTL() ? chevronRightSmall : chevronLeftSmall }\n\t\t\t\t\t\tonClick={ ( event ) => {\n\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\tonNavigateToPreviousEntityRecord();\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\tinitial={\n\t\t\t\t\t\t\tmountedRef.current\n\t\t\t\t\t\t\t\t? { opacity: 0, transform: 'translateX(15%)' }\n\t\t\t\t\t\t\t\t: false // Don't show entry animation when DocumentBar mounts.\n\t\t\t\t\t\t}\n\t\t\t\t\t\tanimate={ { opacity: 1, transform: 'translateX(0%)' } }\n\t\t\t\t\t\texit={ { opacity: 0, transform: 'translateX(15%)' } }\n\t\t\t\t\t\ttransition={\n\t\t\t\t\t\t\tisReducedMotion ? { duration: 0 } : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Back' ) }\n\t\t\t\t\t</MotionButton>\n\t\t\t\t) }\n\t\t\t</AnimatePresence>\n\t\t\t{ ! isTemplate && isTemplatePreview && (\n\t\t\t\t<BlockIcon\n\t\t\t\t\ticon={ layout }\n\t\t\t\t\tclassName=\"editor-document-bar__icon-layout\"\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ isNotFound ? (\n\t\t\t\t<Text>{ __( 'Document not found' ) }</Text>\n\t\t\t) : (\n\t\t\t\t<Button\n\t\t\t\t\tclassName=\"editor-document-bar__command\"\n\t\t\t\t\tonClick={ () => openCommandCenter() }\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t>\n\t\t\t\t\t<motion.div\n\t\t\t\t\t\tclassName=\"editor-document-bar__title\"\n\t\t\t\t\t\t// Force entry animation when the back button is added or removed.\n\t\t\t\t\t\tkey={ hasBackButton }\n\t\t\t\t\t\tinitial={\n\t\t\t\t\t\t\tmountedRef.current\n\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t\topacity: 0,\n\t\t\t\t\t\t\t\t\t\ttransform: hasBackButton\n\t\t\t\t\t\t\t\t\t\t\t? 'translateX(15%)'\n\t\t\t\t\t\t\t\t\t\t\t: 'translateX(-15%)',\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t: false // Don't show entry animation when DocumentBar mounts.\n\t\t\t\t\t\t}\n\t\t\t\t\t\tanimate={ {\n\t\t\t\t\t\t\topacity: 1,\n\t\t\t\t\t\t\ttransform: 'translateX(0%)',\n\t\t\t\t\t\t} }\n\t\t\t\t\t\ttransition={\n\t\t\t\t\t\t\tisReducedMotion ? { duration: 0 } : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{ icon && <BlockIcon icon={ icon } /> }\n\t\t\t\t\t\t<Text size=\"body\" as=\"h1\">\n\t\t\t\t\t\t\t<span className=\"editor-document-bar__post-title\">\n\t\t\t\t\t\t\t\t{ title\n\t\t\t\t\t\t\t\t\t? decodeEntities( title )\n\t\t\t\t\t\t\t\t\t: __( 'No title' ) }\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t{ pageTypeBadge && (\n\t\t\t\t\t\t\t\t<span className=\"editor-document-bar__post-type-label\">\n\t\t\t\t\t\t\t\t\t{ `· ${ pageTypeBadge }` }\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ postTypeLabel &&\n\t\t\t\t\t\t\t\t! props.title &&\n\t\t\t\t\t\t\t\t! pageTypeBadge && (\n\t\t\t\t\t\t\t\t\t<span className=\"editor-document-bar__post-type-label\">\n\t\t\t\t\t\t\t\t\t\t{ `· ${ decodeEntities(\n\t\t\t\t\t\t\t\t\t\t\tpostTypeLabel\n\t\t\t\t\t\t\t\t\t\t) }` }\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</motion.div>\n\t\t\t\t\t<span className=\"editor-document-bar__shortcut\">\n\t\t\t\t\t\t{ displayShortcut.primary( 'k' ) }\n\t\t\t\t\t</span>\n\t\t\t\t</Button>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAMA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IA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C,CACd,CAAC,EACL3B,aAAa,iBACd,IAAApD,WAAA,CAAA8D,GAAA;YAAMH,SAAS,EAAC,sCAAsC;YAAAE,QAAA,EACnD,KAAMT,aAAa;UAAG,CACnB,CACN,EACC5C,aAAa,IACd,CAAEH,KAAK,CAACkC,KAAK,IACb,CAAEa,aAAa,iBACd,IAAApD,WAAA,CAAA8D,GAAA;YAAMH,SAAS,EAAC,sCAAsC;YAAAE,QAAA,EACnD,KAAM,IAAAyB,4BAAc,EACrB9E,aACD,CAAC;UAAG,CACC,CACN;QAAA,CACG,CAAC;MAAA,GAxCDyC,aAyCK,CAAC,eACb,IAAAjD,WAAA,CAAA8D,GAAA;QAAMH,SAAS,EAAC,+BAA+B;QAAAE,QAAA,EAC5C0B,yBAAe,CAACC,OAAO,CAAE,GAAI;MAAC,CAC3B,CAAC;IAAA,CACA,CACR;EAAA,CACG,CAAC;AAER","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_data","_components","_blockEditor","_icons","_keycodes","_coreData","_commands","_element","_compose","_htmlEntities","_dom","_constants","_store","_pageTypeBadge","_getTemplateInfo","_jsxRuntime","MotionButton","motion","Button","DocumentBar","props","postId","postType","postTypeLabel","documentTitle","isNotFound","templateTitle","onNavigateToPreviousEntityRecord","isTemplatePreview","useSelect","select","_select$getEntityReco","getCurrentPostType","getCurrentPostId","getEditorSettings","getRenderingMode","editorStore","getEditedEntityRecord","getPostType","isResolving","isResolvingSelector","coreStore","_postType","_postId","_document","default_template_types","templateTypes","getEntityRecord","_templateInfo","getTemplateInfo","template","_postTypeLabel","labels","singular_name","title","open","openCommandCenter","useDispatch","commandsStore","isReducedMotion","useReducedMotion","isTemplate","TEMPLATE_POST_TYPES","includes","hasBackButton","entityTitle","icon","pageTypeBadge","usePageTypeBadge","mountedRef","useRef","useEffect","current","jsxs","className","clsx","children","jsx","__unstableAnimatePresence","isRTL","chevronRightSmall","chevronLeftSmall","onClick","event","stopPropagation","size","initial","opacity","transform","animate","exit","transition","duration","undefined","__","BlockIcon","layout","__experimentalText","__unstableMotion","div","as","stripHTML","decodeEntities","displayShortcut","primary"],"sources":["@wordpress/editor/src/components/document-bar/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, isRTL } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tButton,\n\t__experimentalText as Text,\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n} from '@wordpress/components';\nimport { BlockIcon } from '@wordpress/block-editor';\nimport { chevronLeftSmall, chevronRightSmall, layout } from '@wordpress/icons';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as commandsStore } from '@wordpress/commands';\nimport { useRef, useEffect } from '@wordpress/element';\nimport { useReducedMotion } from '@wordpress/compose';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport { TEMPLATE_POST_TYPES } from '../../store/constants';\nimport { store as editorStore } from '../../store';\nimport usePageTypeBadge from '../../utils/pageTypeBadge';\nimport { getTemplateInfo } from '../../utils/get-template-info';\n\n/** @typedef {import(\"@wordpress/components\").IconType} IconType */\n\nconst MotionButton = motion( Button );\n\n/**\n * This component renders a navigation bar at the top of the editor. It displays the title of the current document,\n * a back button (if applicable), and a command center button. It also handles different states of the document,\n * such as \"not found\" or \"unsynced\".\n *\n * @example\n * ```jsx\n * <DocumentBar />\n * ```\n * @param {Object} props The component props.\n * @param {string} props.title A title for the document, defaulting to the document or\n * template title currently being edited.\n * @param {IconType} props.icon An icon for the document, no default.\n * (A default icon indicating the document post type is no longer used.)\n *\n * @return {React.ReactNode} The rendered DocumentBar component.\n */\nexport default function DocumentBar( props ) {\n\tconst {\n\t\tpostId,\n\t\tpostType,\n\t\tpostTypeLabel,\n\t\tdocumentTitle,\n\t\tisNotFound,\n\t\ttemplateTitle,\n\t\tonNavigateToPreviousEntityRecord,\n\t\tisTemplatePreview,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetCurrentPostType,\n\t\t\tgetCurrentPostId,\n\t\t\tgetEditorSettings,\n\t\t\tgetRenderingMode,\n\t\t} = select( editorStore );\n\n\t\tconst {\n\t\t\tgetEditedEntityRecord,\n\t\t\tgetPostType,\n\t\t\tisResolving: isResolvingSelector,\n\t\t} = select( coreStore );\n\t\tconst _postType = getCurrentPostType();\n\t\tconst _postId = getCurrentPostId();\n\t\tconst _document = getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\t_postType,\n\t\t\t_postId\n\t\t);\n\n\t\tconst { default_template_types: templateTypes = [] } =\n\t\t\tselect( coreStore ).getEntityRecord( 'root', '__unstableBase' ) ??\n\t\t\t{};\n\n\t\tconst _templateInfo = getTemplateInfo( {\n\t\t\ttemplateTypes,\n\t\t\ttemplate: _document,\n\t\t} );\n\t\tconst _postTypeLabel = getPostType( _postType )?.labels?.singular_name;\n\n\t\treturn {\n\t\t\tpostId: _postId,\n\t\t\tpostType: _postType,\n\t\t\tpostTypeLabel: _postTypeLabel,\n\t\t\tdocumentTitle: _document.title,\n\t\t\tisNotFound:\n\t\t\t\t! _document &&\n\t\t\t\t! isResolvingSelector(\n\t\t\t\t\t'getEditedEntityRecord',\n\t\t\t\t\t'postType',\n\t\t\t\t\t_postType,\n\t\t\t\t\t_postId\n\t\t\t\t),\n\t\t\ttemplateTitle: _templateInfo.title,\n\t\t\tonNavigateToPreviousEntityRecord:\n\t\t\t\tgetEditorSettings().onNavigateToPreviousEntityRecord,\n\t\t\tisTemplatePreview: getRenderingMode() === 'template-locked',\n\t\t};\n\t}, [] );\n\n\tconst { open: openCommandCenter } = useDispatch( commandsStore );\n\tconst isReducedMotion = useReducedMotion();\n\n\tconst isTemplate = TEMPLATE_POST_TYPES.includes( postType );\n\tconst hasBackButton = !! onNavigateToPreviousEntityRecord;\n\tconst entityTitle = isTemplate ? templateTitle : documentTitle;\n\tconst title = props.title || entityTitle;\n\tconst icon = props.icon;\n\n\tconst pageTypeBadge = usePageTypeBadge( postId );\n\n\tconst mountedRef = useRef( false );\n\tuseEffect( () => {\n\t\tmountedRef.current = true;\n\t}, [] );\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ clsx( 'editor-document-bar', {\n\t\t\t\t'has-back-button': hasBackButton,\n\t\t\t} ) }\n\t\t>\n\t\t\t<AnimatePresence>\n\t\t\t\t{ hasBackButton && (\n\t\t\t\t\t<MotionButton\n\t\t\t\t\t\tclassName=\"editor-document-bar__back\"\n\t\t\t\t\t\ticon={ isRTL() ? chevronRightSmall : chevronLeftSmall }\n\t\t\t\t\t\tonClick={ ( event ) => {\n\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\tonNavigateToPreviousEntityRecord();\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\tinitial={\n\t\t\t\t\t\t\tmountedRef.current\n\t\t\t\t\t\t\t\t? { opacity: 0, transform: 'translateX(15%)' }\n\t\t\t\t\t\t\t\t: false // Don't show entry animation when DocumentBar mounts.\n\t\t\t\t\t\t}\n\t\t\t\t\t\tanimate={ { opacity: 1, transform: 'translateX(0%)' } }\n\t\t\t\t\t\texit={ { opacity: 0, transform: 'translateX(15%)' } }\n\t\t\t\t\t\ttransition={\n\t\t\t\t\t\t\tisReducedMotion ? { duration: 0 } : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Back' ) }\n\t\t\t\t\t</MotionButton>\n\t\t\t\t) }\n\t\t\t</AnimatePresence>\n\t\t\t{ ! isTemplate && isTemplatePreview && (\n\t\t\t\t<BlockIcon\n\t\t\t\t\ticon={ layout }\n\t\t\t\t\tclassName=\"editor-document-bar__icon-layout\"\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ isNotFound ? (\n\t\t\t\t<Text>{ __( 'Document not found' ) }</Text>\n\t\t\t) : (\n\t\t\t\t<Button\n\t\t\t\t\tclassName=\"editor-document-bar__command\"\n\t\t\t\t\tonClick={ () => openCommandCenter() }\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t>\n\t\t\t\t\t<motion.div\n\t\t\t\t\t\tclassName=\"editor-document-bar__title\"\n\t\t\t\t\t\t// Force entry animation when the back button is added or removed.\n\t\t\t\t\t\tkey={ hasBackButton }\n\t\t\t\t\t\tinitial={\n\t\t\t\t\t\t\tmountedRef.current\n\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t\topacity: 0,\n\t\t\t\t\t\t\t\t\t\ttransform: hasBackButton\n\t\t\t\t\t\t\t\t\t\t\t? 'translateX(15%)'\n\t\t\t\t\t\t\t\t\t\t\t: 'translateX(-15%)',\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t: false // Don't show entry animation when DocumentBar mounts.\n\t\t\t\t\t\t}\n\t\t\t\t\t\tanimate={ {\n\t\t\t\t\t\t\topacity: 1,\n\t\t\t\t\t\t\ttransform: 'translateX(0%)',\n\t\t\t\t\t\t} }\n\t\t\t\t\t\ttransition={\n\t\t\t\t\t\t\tisReducedMotion ? { duration: 0 } : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{ icon && <BlockIcon icon={ icon } /> }\n\t\t\t\t\t\t<Text size=\"body\" as=\"h1\">\n\t\t\t\t\t\t\t<span className=\"editor-document-bar__post-title\">\n\t\t\t\t\t\t\t\t{ title\n\t\t\t\t\t\t\t\t\t? stripHTML( title )\n\t\t\t\t\t\t\t\t\t: __( 'No title' ) }\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t{ pageTypeBadge && (\n\t\t\t\t\t\t\t\t<span className=\"editor-document-bar__post-type-label\">\n\t\t\t\t\t\t\t\t\t{ `· ${ pageTypeBadge }` }\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ postTypeLabel &&\n\t\t\t\t\t\t\t\t! props.title &&\n\t\t\t\t\t\t\t\t! pageTypeBadge && (\n\t\t\t\t\t\t\t\t\t<span className=\"editor-document-bar__post-type-label\">\n\t\t\t\t\t\t\t\t\t\t{ `· ${ decodeEntities(\n\t\t\t\t\t\t\t\t\t\t\tpostTypeLabel\n\t\t\t\t\t\t\t\t\t\t) }` }\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</motion.div>\n\t\t\t\t\t<span className=\"editor-document-bar__shortcut\">\n\t\t\t\t\t\t{ displayShortcut.primary( 'k' ) }\n\t\t\t\t\t</span>\n\t\t\t\t</Button>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAMA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,SAAA,GAAAR,OAAA;AACA,IAAAS,QAAA,GAAAT,OAAA;AACA,IAAAU,QAAA,GAAAV,OAAA;AACA,IAAAW,aAAA,GAAAX,OAAA;AACA,IAAAY,IAAA,GAAAZ,OAAA;AAKA,IAAAa,UAAA,GAAAb,OAAA;AACA,IAAAc,MAAA,GAAAd,OAAA;AACA,IAAAe,cAAA,GAAAhB,sBAAA,CAAAC,OAAA;AACA,IAAAgB,gBAAA,GAAAhB,OAAA;AAAgE,IAAAiB,WAAA,GAAAjB,OAAA;AAhChE;AACA;AACA;;AAGA;AACA;AACA;;AAmBA;AACA;AACA;;AAMA,mEAEA,MAAMkB,YAAY,GAAG,IAAAC,4BAAM,EAAEC,kBAAO,C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,OAAO,CAAE,GAAI;MAAC,CAC3B,CAAC;IAAA,CACA,CACR;EAAA,CACG,CAAC;AAER","ignoreList":[]}
|
|
@@ -111,9 +111,8 @@ function DocumentTools({
|
|
|
111
111
|
variant: "unstyled",
|
|
112
112
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
113
113
|
className: "editor-document-tools__left",
|
|
114
|
-
children: [!isDistractionFree && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.
|
|
114
|
+
children: [!isDistractionFree && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarButton, {
|
|
115
115
|
ref: inserterSidebarToggleRef,
|
|
116
|
-
as: _components.Button,
|
|
117
116
|
className: "editor-document-tools__inserter-toggle",
|
|
118
117
|
variant: "primary",
|
|
119
118
|
isPressed: isInserterOpened,
|
|
@@ -141,8 +140,7 @@ function DocumentTools({
|
|
|
141
140
|
showTooltip: !showIconLabels,
|
|
142
141
|
variant: showIconLabels ? 'tertiary' : undefined,
|
|
143
142
|
size: "compact"
|
|
144
|
-
}), !isDistractionFree && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.
|
|
145
|
-
as: _components.Button,
|
|
143
|
+
}), !isDistractionFree && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarButton, {
|
|
146
144
|
className: "editor-document-tools__document-overview-toggle",
|
|
147
145
|
icon: _icons.listView,
|
|
148
146
|
disabled: disableBlockTools,
|
|
@@ -154,8 +152,7 @@ function DocumentTools({
|
|
|
154
152
|
showTooltip: !showIconLabels,
|
|
155
153
|
variant: showIconLabels ? 'tertiary' : undefined,
|
|
156
154
|
"aria-expanded": isListViewOpen,
|
|
157
|
-
ref: listViewToggleRef
|
|
158
|
-
size: "compact"
|
|
155
|
+
ref: listViewToggleRef
|
|
159
156
|
})]
|
|
160
157
|
})]
|
|
161
158
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_compose","_data","_i18n","_blockEditor","_components","_icons","_element","_keyboardShortcuts","_preferences","_lockUnlock","_store","_redo","_undo","_jsxRuntime","DocumentTools","className","disableBlockTools","setIsInserterOpened","setIsListViewOpened","useDispatch","editorStore","isDistractionFree","isInserterOpened","isListViewOpen","listViewShortcut","inserterSidebarToggleRef","listViewToggleRef","showIconLabels","showTools","useSelect","select","get","preferencesStore","isListViewOpened","getEditorMode","getInserterSidebarToggleRef","getListViewToggleRef","getRenderingMode","getCurrentPostType","unlock","getShortcutRepresentation","keyboardShortcutsStore","isVisualMode","window","__experimentalEditorWriteMode","preventDefault","event","isLargeViewport","useViewportMatch","isWideViewport","toolbarAriaLabel","__","toggleListView","useCallback","toggleInserter","longLabel","_x","shortLabel","jsx","NavigableToolbar","clsx","variant","children","jsxs","ToolbarItem","ref","as","Button","isPressed","onMouseDown","onClick","disabled","icon","plus","label","showTooltip","Fragment","ToolSelector","undefined","size","EditorHistoryUndo","EditorHistoryRedo","listView","shortcut","_default","exports","default"],"sources":["@wordpress/editor/src/components/document-tools/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport { NavigableToolbar, ToolSelector } from '@wordpress/block-editor';\nimport { Button, ToolbarItem } from '@wordpress/components';\nimport { listView, plus } from '@wordpress/icons';\nimport { useCallback } from '@wordpress/element';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editorStore } from '../../store';\nimport EditorHistoryRedo from '../editor-history/redo';\nimport EditorHistoryUndo from '../editor-history/undo';\n\nfunction DocumentTools( { className, disableBlockTools = false } ) {\n\tconst { setIsInserterOpened, setIsListViewOpened } =\n\t\tuseDispatch( editorStore );\n\tconst {\n\t\tisDistractionFree,\n\t\tisInserterOpened,\n\t\tisListViewOpen,\n\t\tlistViewShortcut,\n\t\tinserterSidebarToggleRef,\n\t\tlistViewToggleRef,\n\t\tshowIconLabels,\n\t\tshowTools,\n\t} = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\tconst {\n\t\t\tisListViewOpened,\n\t\t\tgetEditorMode,\n\t\t\tgetInserterSidebarToggleRef,\n\t\t\tgetListViewToggleRef,\n\t\t\tgetRenderingMode,\n\t\t\tgetCurrentPostType,\n\t\t} = unlock( select( editorStore ) );\n\t\tconst { getShortcutRepresentation } = select( keyboardShortcutsStore );\n\n\t\treturn {\n\t\t\tisInserterOpened: select( editorStore ).isInserterOpened(),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tlistViewShortcut: getShortcutRepresentation(\n\t\t\t\t'core/editor/toggle-list-view'\n\t\t\t),\n\t\t\tinserterSidebarToggleRef: getInserterSidebarToggleRef(),\n\t\t\tlistViewToggleRef: getListViewToggleRef(),\n\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\tisVisualMode: getEditorMode() === 'visual',\n\t\t\tshowTools:\n\t\t\t\t!! window?.__experimentalEditorWriteMode &&\n\t\t\t\t( getRenderingMode() !== 'post-only' ||\n\t\t\t\t\tgetCurrentPostType() === 'wp_template' ),\n\t\t};\n\t}, [] );\n\n\tconst preventDefault = ( event ) => {\n\t\t// Because the inserter behaves like a dialog,\n\t\t// if the inserter is opened already then when we click on the toggle button\n\t\t// then the initial click event will close the inserter and then be propagated\n\t\t// to the inserter toggle and it will open it again.\n\t\t// To prevent this we need to stop the propagation of the event.\n\t\t// This won't be necessary when the inserter no longer behaves like a dialog.\n\n\t\tif ( isInserterOpened ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\t};\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst isWideViewport = useViewportMatch( 'wide' );\n\n\t/* translators: accessibility text for the editor toolbar */\n\tconst toolbarAriaLabel = __( 'Document tools' );\n\n\tconst toggleListView = useCallback(\n\t\t() => setIsListViewOpened( ! isListViewOpen ),\n\t\t[ setIsListViewOpened, isListViewOpen ]\n\t);\n\n\tconst toggleInserter = useCallback(\n\t\t() => setIsInserterOpened( ! isInserterOpened ),\n\t\t[ isInserterOpened, setIsInserterOpened ]\n\t);\n\n\t/* translators: button label text should, if possible, be under 16 characters. */\n\tconst longLabel = _x(\n\t\t'Block Inserter',\n\t\t'Generic label for block inserter button'\n\t);\n\tconst shortLabel = ! isInserterOpened ? __( 'Add' ) : __( 'Close' );\n\n\treturn (\n\t\t// Some plugins expect and use the `edit-post-header-toolbar` CSS class to\n\t\t// find the toolbar and inject UI elements into it. This is not officially\n\t\t// supported, but we're keeping it in the list of class names for backwards\n\t\t// compatibility.\n\t\t<NavigableToolbar\n\t\t\tclassName={ clsx(\n\t\t\t\t'editor-document-tools',\n\t\t\t\t'edit-post-header-toolbar',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\taria-label={ toolbarAriaLabel }\n\t\t\tvariant=\"unstyled\"\n\t\t>\n\t\t\t<div className=\"editor-document-tools__left\">\n\t\t\t\t{ ! isDistractionFree && (\n\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\tref={ inserterSidebarToggleRef }\n\t\t\t\t\t\tas={ Button }\n\t\t\t\t\t\tclassName=\"editor-document-tools__inserter-toggle\"\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\tisPressed={ isInserterOpened }\n\t\t\t\t\t\tonMouseDown={ preventDefault }\n\t\t\t\t\t\tonClick={ toggleInserter }\n\t\t\t\t\t\tdisabled={ disableBlockTools }\n\t\t\t\t\t\ticon={ plus }\n\t\t\t\t\t\tlabel={ showIconLabels ? shortLabel : longLabel }\n\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\taria-expanded={ isInserterOpened }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ ( isWideViewport || ! showIconLabels ) && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ showTools && isLargeViewport && (\n\t\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\t\tas={ ToolSelector }\n\t\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\tshowIconLabels ? 'tertiary' : undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdisabled={ disableBlockTools }\n\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\tas={ EditorHistoryUndo }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\tas={ EditorHistoryRedo }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ ! isDistractionFree && (\n\t\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\t\tas={ Button }\n\t\t\t\t\t\t\t\tclassName=\"editor-document-tools__document-overview-toggle\"\n\t\t\t\t\t\t\t\ticon={ listView }\n\t\t\t\t\t\t\t\tdisabled={ disableBlockTools }\n\t\t\t\t\t\t\t\tisPressed={ isListViewOpen }\n\t\t\t\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\t\t\t\tlabel={ __( 'Document Overview' ) }\n\t\t\t\t\t\t\t\tonClick={ toggleListView }\n\t\t\t\t\t\t\t\tshortcut={ listViewShortcut }\n\t\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\tshowIconLabels ? 'tertiary' : undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\taria-expanded={ isListViewOpen }\n\t\t\t\t\t\t\t\tref={ listViewToggleRef }\n\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</NavigableToolbar>\n\t);\n}\n\nexport default DocumentTools;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,kBAAA,GAAAR,OAAA;AACA,IAAAS,YAAA,GAAAT,OAAA;AAKA,IAAAU,WAAA,GAAAV,OAAA;AACA,IAAAW,MAAA,GAAAX,OAAA;AACA,IAAAY,KAAA,GAAAb,sBAAA,CAAAC,OAAA;AACA,IAAAa,KAAA,GAAAd,sBAAA,CAAAC,OAAA;AAAuD,IAAAc,WAAA,GAAAd,OAAA;AAxBvD;AACA;AACA;;AAGA;AACA;AACA;;AAWA;AACA;AACA;;AAMA,SAASe,aAAaA,CAAE;EAAEC,SAAS;EAAEC,iBAAiB,GAAG;AAAM,CAAC,EAAG;EAClE,MAAM;IAAEC,mBAAmB;IAAEC;EAAoB,CAAC,GACjD,IAAAC,iBAAW,EAAEC,YAAY,CAAC;EAC3B,MAAM;IACLC,iBAAiB;IACjBC,gBAAgB;IAChBC,cAAc;IACdC,gBAAgB;IAChBC,wBAAwB;IACxBC,iBAAiB;IACjBC,cAAc;IAC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lB,cAAgB;YAC1B+B,QAAQ,EAAG3D,gBAAkB;YAC7BmD,WAAW,EAAG,CAAEhD,cAAgB;YAChCkC,OAAO,EACNlC,cAAc,GAAG,UAAU,GAAGmD,SAC9B;YACD,iBAAgBvD,cAAgB;YAChC0C,GAAG,EAAGvC,iBAAmB;YACzBqD,IAAI,EAAC;UAAS,CACd,CACD;QAAA,CACA,CACF;MAAA,CACG;IAAC,CACW;EAAC;AAErB;AAAC,IAAAK,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcxE,aAAa","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_compose","_data","_i18n","_blockEditor","_components","_icons","_element","_keyboardShortcuts","_preferences","_lockUnlock","_store","_redo","_undo","_jsxRuntime","DocumentTools","className","disableBlockTools","setIsInserterOpened","setIsListViewOpened","useDispatch","editorStore","isDistractionFree","isInserterOpened","isListViewOpen","listViewShortcut","inserterSidebarToggleRef","listViewToggleRef","showIconLabels","showTools","useSelect","select","get","preferencesStore","isListViewOpened","getEditorMode","getInserterSidebarToggleRef","getListViewToggleRef","getRenderingMode","getCurrentPostType","unlock","getShortcutRepresentation","keyboardShortcutsStore","isVisualMode","window","__experimentalEditorWriteMode","preventDefault","event","isLargeViewport","useViewportMatch","isWideViewport","toolbarAriaLabel","__","toggleListView","useCallback","toggleInserter","longLabel","_x","shortLabel","jsx","NavigableToolbar","clsx","variant","children","jsxs","ToolbarButton","ref","isPressed","onMouseDown","onClick","disabled","icon","plus","label","showTooltip","Fragment","ToolbarItem","as","ToolSelector","undefined","size","EditorHistoryUndo","EditorHistoryRedo","listView","shortcut","_default","exports","default"],"sources":["@wordpress/editor/src/components/document-tools/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport { NavigableToolbar, ToolSelector } from '@wordpress/block-editor';\nimport { ToolbarButton, ToolbarItem } from '@wordpress/components';\nimport { listView, plus } from '@wordpress/icons';\nimport { useCallback } from '@wordpress/element';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editorStore } from '../../store';\nimport EditorHistoryRedo from '../editor-history/redo';\nimport EditorHistoryUndo from '../editor-history/undo';\n\nfunction DocumentTools( { className, disableBlockTools = false } ) {\n\tconst { setIsInserterOpened, setIsListViewOpened } =\n\t\tuseDispatch( editorStore );\n\tconst {\n\t\tisDistractionFree,\n\t\tisInserterOpened,\n\t\tisListViewOpen,\n\t\tlistViewShortcut,\n\t\tinserterSidebarToggleRef,\n\t\tlistViewToggleRef,\n\t\tshowIconLabels,\n\t\tshowTools,\n\t} = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\tconst {\n\t\t\tisListViewOpened,\n\t\t\tgetEditorMode,\n\t\t\tgetInserterSidebarToggleRef,\n\t\t\tgetListViewToggleRef,\n\t\t\tgetRenderingMode,\n\t\t\tgetCurrentPostType,\n\t\t} = unlock( select( editorStore ) );\n\t\tconst { getShortcutRepresentation } = select( keyboardShortcutsStore );\n\n\t\treturn {\n\t\t\tisInserterOpened: select( editorStore ).isInserterOpened(),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tlistViewShortcut: getShortcutRepresentation(\n\t\t\t\t'core/editor/toggle-list-view'\n\t\t\t),\n\t\t\tinserterSidebarToggleRef: getInserterSidebarToggleRef(),\n\t\t\tlistViewToggleRef: getListViewToggleRef(),\n\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\tisVisualMode: getEditorMode() === 'visual',\n\t\t\tshowTools:\n\t\t\t\t!! window?.__experimentalEditorWriteMode &&\n\t\t\t\t( getRenderingMode() !== 'post-only' ||\n\t\t\t\t\tgetCurrentPostType() === 'wp_template' ),\n\t\t};\n\t}, [] );\n\n\tconst preventDefault = ( event ) => {\n\t\t// Because the inserter behaves like a dialog,\n\t\t// if the inserter is opened already then when we click on the toggle button\n\t\t// then the initial click event will close the inserter and then be propagated\n\t\t// to the inserter toggle and it will open it again.\n\t\t// To prevent this we need to stop the propagation of the event.\n\t\t// This won't be necessary when the inserter no longer behaves like a dialog.\n\n\t\tif ( isInserterOpened ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\t};\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst isWideViewport = useViewportMatch( 'wide' );\n\n\t/* translators: accessibility text for the editor toolbar */\n\tconst toolbarAriaLabel = __( 'Document tools' );\n\n\tconst toggleListView = useCallback(\n\t\t() => setIsListViewOpened( ! isListViewOpen ),\n\t\t[ setIsListViewOpened, isListViewOpen ]\n\t);\n\n\tconst toggleInserter = useCallback(\n\t\t() => setIsInserterOpened( ! isInserterOpened ),\n\t\t[ isInserterOpened, setIsInserterOpened ]\n\t);\n\n\t/* translators: button label text should, if possible, be under 16 characters. */\n\tconst longLabel = _x(\n\t\t'Block Inserter',\n\t\t'Generic label for block inserter button'\n\t);\n\tconst shortLabel = ! isInserterOpened ? __( 'Add' ) : __( 'Close' );\n\n\treturn (\n\t\t// Some plugins expect and use the `edit-post-header-toolbar` CSS class to\n\t\t// find the toolbar and inject UI elements into it. This is not officially\n\t\t// supported, but we're keeping it in the list of class names for backwards\n\t\t// compatibility.\n\t\t<NavigableToolbar\n\t\t\tclassName={ clsx(\n\t\t\t\t'editor-document-tools',\n\t\t\t\t'edit-post-header-toolbar',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\taria-label={ toolbarAriaLabel }\n\t\t\tvariant=\"unstyled\"\n\t\t>\n\t\t\t<div className=\"editor-document-tools__left\">\n\t\t\t\t{ ! isDistractionFree && (\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\tref={ inserterSidebarToggleRef }\n\t\t\t\t\t\tclassName=\"editor-document-tools__inserter-toggle\"\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\tisPressed={ isInserterOpened }\n\t\t\t\t\t\tonMouseDown={ preventDefault }\n\t\t\t\t\t\tonClick={ toggleInserter }\n\t\t\t\t\t\tdisabled={ disableBlockTools }\n\t\t\t\t\t\ticon={ plus }\n\t\t\t\t\t\tlabel={ showIconLabels ? shortLabel : longLabel }\n\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\taria-expanded={ isInserterOpened }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ ( isWideViewport || ! showIconLabels ) && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ showTools && isLargeViewport && (\n\t\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\t\tas={ ToolSelector }\n\t\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\tshowIconLabels ? 'tertiary' : undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdisabled={ disableBlockTools }\n\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\tas={ EditorHistoryUndo }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\tas={ EditorHistoryRedo }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ ! isDistractionFree && (\n\t\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\t\tclassName=\"editor-document-tools__document-overview-toggle\"\n\t\t\t\t\t\t\t\ticon={ listView }\n\t\t\t\t\t\t\t\tdisabled={ disableBlockTools }\n\t\t\t\t\t\t\t\tisPressed={ isListViewOpen }\n\t\t\t\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\t\t\t\tlabel={ __( 'Document Overview' ) }\n\t\t\t\t\t\t\t\tonClick={ toggleListView }\n\t\t\t\t\t\t\t\tshortcut={ listViewShortcut }\n\t\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\tshowIconLabels ? 'tertiary' : undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\taria-expanded={ isListViewOpen }\n\t\t\t\t\t\t\t\tref={ listViewToggleRef }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</NavigableToolbar>\n\t);\n}\n\nexport default DocumentTools;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,kBAAA,GAAAR,OAAA;AACA,IAAAS,YAAA,GAAAT,OAAA;AAKA,IAAAU,WAAA,GAAAV,OAAA;AACA,IAAAW,MAAA,GAAAX,OAAA;AACA,IAAAY,KAAA,GAAAb,sBAAA,CAAAC,OAAA;AACA,IAAAa,KAAA,GAAAd,sBAAA,CAAAC,OAAA;AAAuD,IAAAc,WAAA,GAAAd,OAAA;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AC,EACA,CAAE1D,iBAAiB,iBACpB,IAAAR,WAAA,CAAA6C,GAAA,EAACtD,WAAA,CAAA4D,aAAa;YACbjD,SAAS,EAAC,iDAAiD;YAC3DuD,IAAI,EAAGY,eAAU;YACjBb,QAAQ,EAAGrD,iBAAmB;YAC9BkD,SAAS,EAAG3C;YACZ;YACAiD,KAAK,EAAG,IAAArB,QAAE,EAAE,mBAAoB,CAAG;YACnCiB,OAAO,EAAGhB,cAAgB;YAC1B+B,QAAQ,EAAG3D,gBAAkB;YAC7BiD,WAAW,EAAG,CAAE9C,cAAgB;YAChCkC,OAAO,EACNlC,cAAc,GAAG,UAAU,GAAGmD,SAC9B;YACD,iBAAgBvD,cAAgB;YAChC0C,GAAG,EAAGvC;UAAmB,CACzB,CACD;QAAA,CACA,CACF;MAAA,CACG;IAAC,CACW;EAAC;AAErB;AAAC,IAAA0D,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcxE,aAAa","ignoreList":[]}
|
|
@@ -56,7 +56,7 @@ const IntroToBlocks = () => {
|
|
|
56
56
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_viewSections.HelpDetailSectionHeadingText, {
|
|
57
57
|
text: (0, _i18n.__)('Build layouts')
|
|
58
58
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_viewSections.HelpDetailBodyText, {
|
|
59
|
-
text: (0, _i18n.__)('Arrange your content into columns, add Call to
|
|
59
|
+
text: (0, _i18n.__)('Arrange your content into columns, add Call to action buttons, and overlay images with text.')
|
|
60
60
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_viewSections.HelpDetailImage, {
|
|
61
61
|
source: require('./images/build-layouts-light.png'),
|
|
62
62
|
sourceDarkMode: require('./images/build-layouts-dark.png')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_i18n","_compose","_style","_interopRequireDefault","_viewSections","_jsxRuntime","IntroToBlocks","titleStyle","usePreferredColorSchemeStyle","styles","helpDetailTitle","helpDetailTitleDark","jsxs","Fragment","children","jsx","HelpDetailImage","source","View","style","helpDetailContainer","Text","accessibilityRole","selectable","__","HelpDetailBodyText","text","HelpDetailSectionHeadingText","accessible","accessibilityLabel","sourceDarkMode","_default","exports","default"],"sources":["@wordpress/editor/src/components/editor-help/intro-to-blocks.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View, Text } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { usePreferredColorSchemeStyle } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\nimport {\n\tHelpDetailBodyText,\n\tHelpDetailSectionHeadingText,\n\tHelpDetailImage,\n} from './view-sections';\n\nconst IntroToBlocks = () => {\n\tconst titleStyle = usePreferredColorSchemeStyle(\n\t\tstyles.helpDetailTitle,\n\t\tstyles.helpDetailTitleDark\n\t);\n\treturn (\n\t\t<>\n\t\t\t<HelpDetailImage\n\t\t\t\tsource={ require( './images/block-layout-collage.png' ) }\n\t\t\t/>\n\t\t\t<View style={ styles.helpDetailContainer }>\n\t\t\t\t<Text\n\t\t\t\t\taccessibilityRole=\"header\"\n\t\t\t\t\tselectable\n\t\t\t\t\tstyle={ titleStyle }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Welcome to the world of blocks' ) }\n\t\t\t\t</Text>\n\t\t\t\t<HelpDetailBodyText\n\t\t\t\t\ttext={ __(\n\t\t\t\t\t\t'Blocks are pieces of content that you can insert, rearrange, and style without needing to know how to code. Blocks are an easy and modern way for you to create beautiful layouts.'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t\t<HelpDetailSectionHeadingText\n\t\t\t\t\ttext={ __( 'Rich text editing' ) }\n\t\t\t\t/>\n\t\t\t\t<HelpDetailBodyText\n\t\t\t\t\ttext={ __(\n\t\t\t\t\t\t'Blocks allow you to focus on writing your content, knowing that all the formatting tools you need are there to help you get your message across.'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t\t<HelpDetailImage\n\t\t\t\t\taccessible\n\t\t\t\t\taccessibilityLabel={ __(\n\t\t\t\t\t\t'Text formatting controls are located within the toolbar positioned above the keyboard while editing a text block'\n\t\t\t\t\t) }\n\t\t\t\t\tsource={ require( './images/rich-text-light.png' ) }\n\t\t\t\t\tsourceDarkMode={ require( './images/rich-text-dark.png' ) }\n\t\t\t\t/>\n\t\t\t\t<HelpDetailSectionHeadingText text={ __( 'Embed media' ) } />\n\t\t\t\t<HelpDetailBodyText\n\t\t\t\t\ttext={ __(\n\t\t\t\t\t\t'Make your content stand out by adding images, gifs, videos, and embedded media to your pages.'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t\t<HelpDetailImage\n\t\t\t\t\tsource={ require( './images/embed-media-light.png' ) }\n\t\t\t\t\tsourceDarkMode={ require( './images/embed-media-dark.png' ) }\n\t\t\t\t/>\n\t\t\t\t<HelpDetailSectionHeadingText text={ __( 'Build layouts' ) } />\n\t\t\t\t<HelpDetailBodyText\n\t\t\t\t\ttext={ __(\n\t\t\t\t\t\t'Arrange your content into columns, add Call to
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_i18n","_compose","_style","_interopRequireDefault","_viewSections","_jsxRuntime","IntroToBlocks","titleStyle","usePreferredColorSchemeStyle","styles","helpDetailTitle","helpDetailTitleDark","jsxs","Fragment","children","jsx","HelpDetailImage","source","View","style","helpDetailContainer","Text","accessibilityRole","selectable","__","HelpDetailBodyText","text","HelpDetailSectionHeadingText","accessible","accessibilityLabel","sourceDarkMode","_default","exports","default"],"sources":["@wordpress/editor/src/components/editor-help/intro-to-blocks.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View, Text } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { usePreferredColorSchemeStyle } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\nimport {\n\tHelpDetailBodyText,\n\tHelpDetailSectionHeadingText,\n\tHelpDetailImage,\n} from './view-sections';\n\nconst IntroToBlocks = () => {\n\tconst titleStyle = usePreferredColorSchemeStyle(\n\t\tstyles.helpDetailTitle,\n\t\tstyles.helpDetailTitleDark\n\t);\n\treturn (\n\t\t<>\n\t\t\t<HelpDetailImage\n\t\t\t\tsource={ require( './images/block-layout-collage.png' ) }\n\t\t\t/>\n\t\t\t<View style={ styles.helpDetailContainer }>\n\t\t\t\t<Text\n\t\t\t\t\taccessibilityRole=\"header\"\n\t\t\t\t\tselectable\n\t\t\t\t\tstyle={ titleStyle }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Welcome to the world of blocks' ) }\n\t\t\t\t</Text>\n\t\t\t\t<HelpDetailBodyText\n\t\t\t\t\ttext={ __(\n\t\t\t\t\t\t'Blocks are pieces of content that you can insert, rearrange, and style without needing to know how to code. Blocks are an easy and modern way for you to create beautiful layouts.'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t\t<HelpDetailSectionHeadingText\n\t\t\t\t\ttext={ __( 'Rich text editing' ) }\n\t\t\t\t/>\n\t\t\t\t<HelpDetailBodyText\n\t\t\t\t\ttext={ __(\n\t\t\t\t\t\t'Blocks allow you to focus on writing your content, knowing that all the formatting tools you need are there to help you get your message across.'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t\t<HelpDetailImage\n\t\t\t\t\taccessible\n\t\t\t\t\taccessibilityLabel={ __(\n\t\t\t\t\t\t'Text formatting controls are located within the toolbar positioned above the keyboard while editing a text block'\n\t\t\t\t\t) }\n\t\t\t\t\tsource={ require( './images/rich-text-light.png' ) }\n\t\t\t\t\tsourceDarkMode={ require( './images/rich-text-dark.png' ) }\n\t\t\t\t/>\n\t\t\t\t<HelpDetailSectionHeadingText text={ __( 'Embed media' ) } />\n\t\t\t\t<HelpDetailBodyText\n\t\t\t\t\ttext={ __(\n\t\t\t\t\t\t'Make your content stand out by adding images, gifs, videos, and embedded media to your pages.'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t\t<HelpDetailImage\n\t\t\t\t\tsource={ require( './images/embed-media-light.png' ) }\n\t\t\t\t\tsourceDarkMode={ require( './images/embed-media-dark.png' ) }\n\t\t\t\t/>\n\t\t\t\t<HelpDetailSectionHeadingText text={ __( 'Build layouts' ) } />\n\t\t\t\t<HelpDetailBodyText\n\t\t\t\t\ttext={ __(\n\t\t\t\t\t\t'Arrange your content into columns, add Call to action buttons, and overlay images with text.'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t\t<HelpDetailImage\n\t\t\t\t\tsource={ require( './images/build-layouts-light.png' ) }\n\t\t\t\t\tsourceDarkMode={ require( './images/build-layouts-dark.png' ) }\n\t\t\t\t/>\n\t\t\t\t<HelpDetailBodyText\n\t\t\t\t\ttext={ __(\n\t\t\t\t\t\t'Give it a try by adding a few blocks to your post or page!'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</View>\n\t\t</>\n\t);\n};\n\nexport default IntroToBlocks;\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAKA,IAAAG,MAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AAIyB,IAAAM,WAAA,GAAAN,OAAA;AAnBzB;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;;AAQA,MAAMO,aAAa,GAAGA,CAAA,KAAM;EAC3B,MAAMC,UAAU,GAAG,IAAAC,qCAA4B,EAC9CC,cAAM,CAACC,eAAe,EACtBD,cAAM,CAACE,mBACR,CAAC;EACD,oBACC,IAAAN,WAAA,CAAAO,IAAA,EAAAP,WAAA,CAAAQ,QAAA;IAAAC,QAAA,gBACC,IAAAT,WAAA,CAAAU,GAAA,EAACX,aAAA,CAAAY,eAAe;MACfC,MAAM,EAAGlB,OAAO,CAAE,mCAAoC;IAAG,CACzD,CAAC,eACF,IAAAM,WAAA,CAAAO,IAA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tD+B,cAAc,EAAG/B,OAAO,CAAE,+BAAgC;MAAG,CAC7D,CAAC,eACF,IAAAM,WAAA,CAAAU,GAAA,EAACX,aAAA,CAAAuB,4BAA4B;QAACD,IAAI,EAAG,IAAAF,QAAE,EAAE,eAAgB;MAAG,CAAE,CAAC,eAC/D,IAAAnB,WAAA,CAAAU,GAAA,EAACX,aAAA,CAAAqB,kBAAkB;QAClBC,IAAI,EAAG,IAAAF,QAAE,EACR,8FACD;MAAG,CACH,CAAC,eACF,IAAAnB,WAAA,CAAAU,GAAA,EAACX,aAAA,CAAAY,eAAe;QACfC,MAAM,EAAGlB,OAAO,CAAE,kCAAmC,CAAG;QACxD+B,cAAc,EAAG/B,OAAO,CAAE,iCAAkC;MAAG,CAC/D,CAAC,eACF,IAAAM,WAAA,CAAAU,GAAA,EAACX,aAAA,CAAAqB,kBAAkB;QAClBC,IAAI,EAAG,IAAAF,QAAE,EACR,4DACD;MAAG,CACH,CAAC;IAAA,CACG,CAAC;EAAA,CACN,CAAC;AAEL,CAAC;AAAC,IAAAO,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEa3B,aAAa","ignoreList":[]}
|
|
@@ -112,6 +112,7 @@ function EntitiesSavedStatesExtensible({
|
|
|
112
112
|
});
|
|
113
113
|
const dialogLabel = (0, _compose.useInstanceId)(EntitiesSavedStatesExtensible, 'label');
|
|
114
114
|
const dialogDescription = (0, _compose.useInstanceId)(EntitiesSavedStatesExtensible, 'description');
|
|
115
|
+
const selectItemsToSaveDescription = !!dirtyEntityRecords.length ? (0, _i18n.__)('Select the items you want to save.') : undefined;
|
|
115
116
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
116
117
|
ref: renderDialog ? saveDialogRef : undefined,
|
|
117
118
|
...(renderDialog && saveDialogProps),
|
|
@@ -160,7 +161,7 @@ function EntitiesSavedStatesExtensible({
|
|
|
160
161
|
children: isDirty ? (0, _element.createInterpolateElement)((0, _i18n.sprintf)(/* translators: %d: number of site changes waiting to be saved. */
|
|
161
162
|
(0, _i18n._n)('There is <strong>%d site change</strong> waiting to be saved.', 'There are <strong>%d site changes</strong> waiting to be saved.', dirtyEntityRecords.length), dirtyEntityRecords.length), {
|
|
162
163
|
strong: /*#__PURE__*/(0, _jsxRuntime.jsx)("strong", {})
|
|
163
|
-
}) :
|
|
164
|
+
}) : selectItemsToSaveDescription
|
|
164
165
|
})]
|
|
165
166
|
}), sortedPartitionedSavables.map(list => {
|
|
166
167
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_entityTypeList.default, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_i18n","_element","_compose","_data","_entityTypeList","_interopRequireDefault","_useIsDirty","_store","_lockUnlock","_jsxRuntime","identity","values","EntitiesSavedStates","close","renderDialog","isDirtyProps","useIsDirty","jsx","EntitiesSavedStatesExtensible","additionalPrompt","undefined","onSave","saveEnabled","saveEnabledProp","saveLabel","__","dirtyEntityRecords","isDirty","setUnselectedEntities","unselectedEntities","saveButtonRef","useRef","saveDirtyEntities","unlock","useDispatch","editorStore","partitionedSavables","reduce","acc","record","name","push","site","siteSavables","wp_template","templateSavables","wp_template_part","templatePartSavables","contentSavables","sortedPartitionedSavables","Object","filter","Array","isArray","dismissPanel","useCallback","saveDialogRef","saveDialogProps","useDialog","onClose","dialogLabel","useInstanceId","dialogDescription","jsxs","ref","className","role","children","Flex","gap","FlexItem","isBlock","as","Button","variant","size","onClick","disabled","accessibleWhenDisabled","entitiesToSkip","id","createInterpolateElement","sprintf","_n","length","strong","map","list","default"],"sources":["@wordpress/editor/src/components/entities-saved-states/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button, Flex, FlexItem } from '@wordpress/components';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport {\n\tuseCallback,\n\tuseRef,\n\tcreateInterpolateElement,\n} from '@wordpress/element';\nimport {\n\t__experimentalUseDialog as useDialog,\n\tuseInstanceId,\n} from '@wordpress/compose';\nimport { useDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport EntityTypeList from './entity-type-list';\nimport { useIsDirty } from './hooks/use-is-dirty';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nfunction identity( values ) {\n\treturn values;\n}\n\n/**\n * Renders the component for managing saved states of entities.\n *\n * @param {Object} props The component props.\n * @param {Function} props.close The function to close the dialog.\n * @param {boolean} props.renderDialog Whether to render the component with modal dialog behavior.\n *\n * @return {React.ReactNode} The rendered component.\n */\nexport default function EntitiesSavedStates( { close, renderDialog } ) {\n\tconst isDirtyProps = useIsDirty();\n\treturn (\n\t\t<EntitiesSavedStatesExtensible\n\t\t\tclose={ close }\n\t\t\trenderDialog={ renderDialog }\n\t\t\t{ ...isDirtyProps }\n\t\t/>\n\t);\n}\n\n/**\n * Renders a panel for saving entities with dirty records.\n *\n * @param {Object} props The component props.\n * @param {string} props.additionalPrompt Additional prompt to display.\n * @param {Function} props.close Function to close the panel.\n * @param {Function} props.onSave Function to call when saving entities.\n * @param {boolean} props.saveEnabled Flag indicating if save is enabled.\n * @param {string} props.saveLabel Label for the save button.\n * @param {boolean} props.renderDialog Whether to render the component with modal dialog behavior.\n * @param {Array} props.dirtyEntityRecords Array of dirty entity records.\n * @param {boolean} props.isDirty Flag indicating if there are dirty entities.\n * @param {Function} props.setUnselectedEntities Function to set unselected entities.\n * @param {Array} props.unselectedEntities Array of unselected entities.\n *\n * @return {React.ReactNode} The rendered component.\n */\nexport function EntitiesSavedStatesExtensible( {\n\tadditionalPrompt = undefined,\n\tclose,\n\tonSave = identity,\n\tsaveEnabled: saveEnabledProp = undefined,\n\tsaveLabel = __( 'Save' ),\n\trenderDialog,\n\tdirtyEntityRecords,\n\tisDirty,\n\tsetUnselectedEntities,\n\tunselectedEntities,\n} ) {\n\tconst saveButtonRef = useRef();\n\tconst { saveDirtyEntities } = unlock( useDispatch( editorStore ) );\n\t// To group entities by type.\n\tconst partitionedSavables = dirtyEntityRecords.reduce( ( acc, record ) => {\n\t\tconst { name } = record;\n\t\tif ( ! acc[ name ] ) {\n\t\t\tacc[ name ] = [];\n\t\t}\n\t\tacc[ name ].push( record );\n\t\treturn acc;\n\t}, {} );\n\n\t// Sort entity groups.\n\tconst {\n\t\tsite: siteSavables,\n\t\twp_template: templateSavables,\n\t\twp_template_part: templatePartSavables,\n\t\t...contentSavables\n\t} = partitionedSavables;\n\tconst sortedPartitionedSavables = [\n\t\tsiteSavables,\n\t\ttemplateSavables,\n\t\ttemplatePartSavables,\n\t\t...Object.values( contentSavables ),\n\t].filter( Array.isArray );\n\n\tconst saveEnabled = saveEnabledProp ?? isDirty;\n\t// Explicitly define this with no argument passed. Using `close` on\n\t// its own will use the event object in place of the expected saved entities.\n\tconst dismissPanel = useCallback( () => close(), [ close ] );\n\n\tconst [ saveDialogRef, saveDialogProps ] = useDialog( {\n\t\tonClose: () => dismissPanel(),\n\t} );\n\tconst dialogLabel = useInstanceId( EntitiesSavedStatesExtensible, 'label' );\n\tconst dialogDescription = useInstanceId(\n\t\tEntitiesSavedStatesExtensible,\n\t\t'description'\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tref={ renderDialog ? saveDialogRef : undefined }\n\t\t\t{ ...( renderDialog && saveDialogProps ) }\n\t\t\tclassName=\"entities-saved-states__panel\"\n\t\t\trole={ renderDialog ? 'dialog' : undefined }\n\t\t\taria-labelledby={ renderDialog ? dialogLabel : undefined }\n\t\t\taria-describedby={ renderDialog ? dialogDescription : undefined }\n\t\t>\n\t\t\t<Flex className=\"entities-saved-states__panel-header\" gap={ 2 }>\n\t\t\t\t<FlexItem\n\t\t\t\t\tisBlock\n\t\t\t\t\tas={ Button }\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\tonClick={ dismissPanel }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t</FlexItem>\n\t\t\t\t<FlexItem\n\t\t\t\t\tisBlock\n\t\t\t\t\tas={ Button }\n\t\t\t\t\tref={ saveButtonRef }\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\tdisabled={ ! saveEnabled }\n\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\tsaveDirtyEntities( {\n\t\t\t\t\t\t\tonSave,\n\t\t\t\t\t\t\tdirtyEntityRecords,\n\t\t\t\t\t\t\tentitiesToSkip: unselectedEntities,\n\t\t\t\t\t\t\tclose,\n\t\t\t\t\t\t} )\n\t\t\t\t\t}\n\t\t\t\t\tclassName=\"editor-entities-saved-states__save-button\"\n\t\t\t\t>\n\t\t\t\t\t{ saveLabel }\n\t\t\t\t</FlexItem>\n\t\t\t</Flex>\n\n\t\t\t<div className=\"entities-saved-states__text-prompt\">\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"entities-saved-states__text-prompt--header-wrapper\"\n\t\t\t\t\tid={ renderDialog ? dialogLabel : undefined }\n\t\t\t\t>\n\t\t\t\t\t<strong className=\"entities-saved-states__text-prompt--header\">\n\t\t\t\t\t\t{ __( 'Are you ready to save?' ) }\n\t\t\t\t\t</strong>\n\t\t\t\t\t{ additionalPrompt }\n\t\t\t\t</div>\n\t\t\t\t<p id={ renderDialog ? dialogDescription : undefined }>\n\t\t\t\t\t{ isDirty\n\t\t\t\t\t\t? createInterpolateElement(\n\t\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t\t/* translators: %d: number of site changes waiting to be saved. */\n\t\t\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t\t\t'There is <strong>%d site change</strong> waiting to be saved.',\n\t\t\t\t\t\t\t\t\t\t'There are <strong>%d site changes</strong> waiting to be saved.',\n\t\t\t\t\t\t\t\t\t\tdirtyEntityRecords.length\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tdirtyEntityRecords.length\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t{ strong: <strong /> }\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: __( 'Select the items you want to save.' ) }\n\t\t\t\t</p>\n\t\t\t</div>\n\n\t\t\t{ sortedPartitionedSavables.map( ( list ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<EntityTypeList\n\t\t\t\t\t\tkey={ list[ 0 ].name }\n\t\t\t\t\t\tlist={ list }\n\t\t\t\t\t\tunselectedEntities={ unselectedEntities }\n\t\t\t\t\t\tsetUnselectedEntities={ setUnselectedEntities }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAKA,IAAAG,QAAA,GAAAH,OAAA;AAIA,IAAAI,KAAA,GAAAJ,OAAA;AAKA,IAAAK,eAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,WAAA,GAAAT,OAAA;AAA2C,IAAAU,WAAA,GAAAV,OAAA;AAtB3C;AACA;AACA;;AAcA;AACA;AACA;;AAMA,SAASW,QAAQA,CAAEC,MAAM,EAAG;EAC3B,OAAOA,MAAM;AACd;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASC,mBAAmBA,CAAE;EAAEC,KAAK;EAAEC;AAAa,CAAC,EAAG;EACtE,MAAMC,YAAY,GAAG,IAAAC,sBAAU,EAAC,CAAC;EACjC,oBACC,IAAAP,WAAA,CAAAQ,GAAA,EAACC,6BAA6B;IAC7BL,KAAK,EAAGA,KAAO;IACfC,YAAY,EAAGA,YAAc;IAAA,GACxBC;EAAY,CACjB,CAAC;AAEJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO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kBAAoB;QACzCD,qBAAqB,EAAGA;MAAuB,GAHzC2D,IAAI,CAAE,CAAC,CAAE,CAAC/C,IAIhB,CAAC;IAEJ,CAAE,CAAC;EAAA,CACC,CAAC;AAER","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_components","require","_i18n","_element","_compose","_data","_entityTypeList","_interopRequireDefault","_useIsDirty","_store","_lockUnlock","_jsxRuntime","identity","values","EntitiesSavedStates","close","renderDialog","isDirtyProps","useIsDirty","jsx","EntitiesSavedStatesExtensible","additionalPrompt","undefined","onSave","saveEnabled","saveEnabledProp","saveLabel","__","dirtyEntityRecords","isDirty","setUnselectedEntities","unselectedEntities","saveButtonRef","useRef","saveDirtyEntities","unlock","useDispatch","editorStore","partitionedSavables","reduce","acc","record","name","push","site","siteSavables","wp_template","templateSavables","wp_template_part","templatePartSavables","contentSavables","sortedPartitionedSavables","Object","filter","Array","isArray","dismissPanel","useCallback","saveDialogRef","saveDialogProps","useDialog","onClose","dialogLabel","useInstanceId","dialogDescription","selectItemsToSaveDescription","length","jsxs","ref","className","role","children","Flex","gap","FlexItem","isBlock","as","Button","variant","size","onClick","disabled","accessibleWhenDisabled","entitiesToSkip","id","createInterpolateElement","sprintf","_n","strong","map","list","default"],"sources":["@wordpress/editor/src/components/entities-saved-states/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button, Flex, FlexItem } from '@wordpress/components';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport {\n\tuseCallback,\n\tuseRef,\n\tcreateInterpolateElement,\n} from '@wordpress/element';\nimport {\n\t__experimentalUseDialog as useDialog,\n\tuseInstanceId,\n} from '@wordpress/compose';\nimport { useDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport EntityTypeList from './entity-type-list';\nimport { useIsDirty } from './hooks/use-is-dirty';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nfunction identity( values ) {\n\treturn values;\n}\n\n/**\n * Renders the component for managing saved states of entities.\n *\n * @param {Object} props The component props.\n * @param {Function} props.close The function to close the dialog.\n * @param {boolean} props.renderDialog Whether to render the component with modal dialog behavior.\n *\n * @return {React.ReactNode} The rendered component.\n */\nexport default function EntitiesSavedStates( { close, renderDialog } ) {\n\tconst isDirtyProps = useIsDirty();\n\treturn (\n\t\t<EntitiesSavedStatesExtensible\n\t\t\tclose={ close }\n\t\t\trenderDialog={ renderDialog }\n\t\t\t{ ...isDirtyProps }\n\t\t/>\n\t);\n}\n\n/**\n * Renders a panel for saving entities with dirty records.\n *\n * @param {Object} props The component props.\n * @param {string} props.additionalPrompt Additional prompt to display.\n * @param {Function} props.close Function to close the panel.\n * @param {Function} props.onSave Function to call when saving entities.\n * @param {boolean} props.saveEnabled Flag indicating if save is enabled.\n * @param {string} props.saveLabel Label for the save button.\n * @param {boolean} props.renderDialog Whether to render the component with modal dialog behavior.\n * @param {Array} props.dirtyEntityRecords Array of dirty entity records.\n * @param {boolean} props.isDirty Flag indicating if there are dirty entities.\n * @param {Function} props.setUnselectedEntities Function to set unselected entities.\n * @param {Array} props.unselectedEntities Array of unselected entities.\n *\n * @return {React.ReactNode} The rendered component.\n */\nexport function EntitiesSavedStatesExtensible( {\n\tadditionalPrompt = undefined,\n\tclose,\n\tonSave = identity,\n\tsaveEnabled: saveEnabledProp = undefined,\n\tsaveLabel = __( 'Save' ),\n\trenderDialog,\n\tdirtyEntityRecords,\n\tisDirty,\n\tsetUnselectedEntities,\n\tunselectedEntities,\n} ) {\n\tconst saveButtonRef = useRef();\n\tconst { saveDirtyEntities } = unlock( useDispatch( editorStore ) );\n\t// To group entities by type.\n\tconst partitionedSavables = dirtyEntityRecords.reduce( ( acc, record ) => {\n\t\tconst { name } = record;\n\t\tif ( ! acc[ name ] ) {\n\t\t\tacc[ name ] = [];\n\t\t}\n\t\tacc[ name ].push( record );\n\t\treturn acc;\n\t}, {} );\n\n\t// Sort entity groups.\n\tconst {\n\t\tsite: siteSavables,\n\t\twp_template: templateSavables,\n\t\twp_template_part: templatePartSavables,\n\t\t...contentSavables\n\t} = partitionedSavables;\n\tconst sortedPartitionedSavables = [\n\t\tsiteSavables,\n\t\ttemplateSavables,\n\t\ttemplatePartSavables,\n\t\t...Object.values( contentSavables ),\n\t].filter( Array.isArray );\n\n\tconst saveEnabled = saveEnabledProp ?? isDirty;\n\t// Explicitly define this with no argument passed. Using `close` on\n\t// its own will use the event object in place of the expected saved entities.\n\tconst dismissPanel = useCallback( () => close(), [ close ] );\n\n\tconst [ saveDialogRef, saveDialogProps ] = useDialog( {\n\t\tonClose: () => dismissPanel(),\n\t} );\n\tconst dialogLabel = useInstanceId( EntitiesSavedStatesExtensible, 'label' );\n\tconst dialogDescription = useInstanceId(\n\t\tEntitiesSavedStatesExtensible,\n\t\t'description'\n\t);\n\n\tconst selectItemsToSaveDescription = !! dirtyEntityRecords.length\n\t\t? __( 'Select the items you want to save.' )\n\t\t: undefined;\n\n\treturn (\n\t\t<div\n\t\t\tref={ renderDialog ? saveDialogRef : undefined }\n\t\t\t{ ...( renderDialog && saveDialogProps ) }\n\t\t\tclassName=\"entities-saved-states__panel\"\n\t\t\trole={ renderDialog ? 'dialog' : undefined }\n\t\t\taria-labelledby={ renderDialog ? dialogLabel : undefined }\n\t\t\taria-describedby={ renderDialog ? dialogDescription : undefined }\n\t\t>\n\t\t\t<Flex className=\"entities-saved-states__panel-header\" gap={ 2 }>\n\t\t\t\t<FlexItem\n\t\t\t\t\tisBlock\n\t\t\t\t\tas={ Button }\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\tonClick={ dismissPanel }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t</FlexItem>\n\t\t\t\t<FlexItem\n\t\t\t\t\tisBlock\n\t\t\t\t\tas={ Button }\n\t\t\t\t\tref={ saveButtonRef }\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\tdisabled={ ! saveEnabled }\n\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\tsaveDirtyEntities( {\n\t\t\t\t\t\t\tonSave,\n\t\t\t\t\t\t\tdirtyEntityRecords,\n\t\t\t\t\t\t\tentitiesToSkip: unselectedEntities,\n\t\t\t\t\t\t\tclose,\n\t\t\t\t\t\t} )\n\t\t\t\t\t}\n\t\t\t\t\tclassName=\"editor-entities-saved-states__save-button\"\n\t\t\t\t>\n\t\t\t\t\t{ saveLabel }\n\t\t\t\t</FlexItem>\n\t\t\t</Flex>\n\n\t\t\t<div className=\"entities-saved-states__text-prompt\">\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"entities-saved-states__text-prompt--header-wrapper\"\n\t\t\t\t\tid={ renderDialog ? dialogLabel : undefined }\n\t\t\t\t>\n\t\t\t\t\t<strong className=\"entities-saved-states__text-prompt--header\">\n\t\t\t\t\t\t{ __( 'Are you ready to save?' ) }\n\t\t\t\t\t</strong>\n\t\t\t\t\t{ additionalPrompt }\n\t\t\t\t</div>\n\t\t\t\t<p id={ renderDialog ? dialogDescription : undefined }>\n\t\t\t\t\t{ isDirty\n\t\t\t\t\t\t? createInterpolateElement(\n\t\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t\t/* translators: %d: number of site changes waiting to be saved. */\n\t\t\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t\t\t'There is <strong>%d site change</strong> waiting to be saved.',\n\t\t\t\t\t\t\t\t\t\t'There are <strong>%d site changes</strong> waiting to be saved.',\n\t\t\t\t\t\t\t\t\t\tdirtyEntityRecords.length\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tdirtyEntityRecords.length\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t{ strong: <strong /> }\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: selectItemsToSaveDescription }\n\t\t\t\t</p>\n\t\t\t</div>\n\n\t\t\t{ sortedPartitionedSavables.map( ( list ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<EntityTypeList\n\t\t\t\t\t\tkey={ list[ 0 ].name }\n\t\t\t\t\t\tlist={ list }\n\t\t\t\t\t\tunselectedEntities={ unselectedEntities }\n\t\t\t\t\t\tsetUnselectedEntities={ setUnselectedEntities }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAKA,IAAAG,QAAA,GAAAH,OAAA;AAIA,IAAAI,KAAA,GAAAJ,OAAA;AAKA,IAAAK,eAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,WAAA,GAAAT,OAAA;AAA2C,IAAAU,WAAA,GAAAV,OAAA;AAtB3C;AACA;AACA;;AAcA;AACA;AACA;;AAMA,SAASW,QAAQA,CAAEC,MAAM,EAAG;EAC3B,OAAOA,MAAM;AACd;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASC,mBAAmBA,CAAE;EAAEC,KAAK;EAAEC;AAAa,CAAC,EAAG;EACtE,MAAMC,YAAY,GAAG,IAAAC,sBAAU,EAAC,CAAC;EACjC,oBACC,IAAAP,WAAA,CAAAQ,GAAA,EAACC,6BAA6B;IAC7BL,KAAK,EAAGA,KAAO;IACfC,YAAY,EAAGA,YAAc;IAAA,GACxBC;EAAY,CACjB,CAAC;AAEJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASG,6BAA6BA,CAAE;EAC9CC,gBAAgB,GAAGC,SAAS;EAC5BP,KAAK;EACLQ,MAAM,GAAGX,QAAQ;EACjBY,WAAW,EAAEC,eAAe,GAA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MAAuB,GAHzC4D,IAAI,CAAE,CAAC,CAAE,CAAChD,IAIhB,CAAC;IAEJ,CAAE,CAAC;EAAA,CACC,CAAC;AAER","ignoreList":[]}
|
|
@@ -110,7 +110,7 @@ class ErrorBoundary extends _element.Component {
|
|
|
110
110
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
111
111
|
style: iconContainerStyle,
|
|
112
112
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Icon, {
|
|
113
|
-
icon: _icons.
|
|
113
|
+
icon: _icons.cautionFilled,
|
|
114
114
|
..._style.default['error-boundary__icon']
|
|
115
115
|
})
|
|
116
116
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|