@wordpress/core-commands 1.28.0 → 1.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/README.md +4 -0
- package/build/index.js +43 -0
- package/build/index.js.map +1 -1
- package/build/site-editor-navigation-commands.js +10 -10
- package/build/site-editor-navigation-commands.js.map +1 -1
- package/build-module/index.js +41 -0
- package/build-module/index.js.map +1 -1
- package/build-module/site-editor-navigation-commands.js +10 -10
- package/build-module/site-editor-navigation-commands.js.map +1 -1
- package/package.json +15 -15
- package/src/index.js +42 -0
- package/src/site-editor-navigation-commands.js +10 -10
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -16,6 +16,10 @@ _This package assumes that your code will run in an **ES2015+** environment. If
|
|
|
16
16
|
|
|
17
17
|
<!-- START TOKEN(Autogenerated API docs) -->
|
|
18
18
|
|
|
19
|
+
### initializeCommandPalette
|
|
20
|
+
|
|
21
|
+
Initializes the Command Palette.
|
|
22
|
+
|
|
19
23
|
### privateApis
|
|
20
24
|
|
|
21
25
|
Undocumented declaration.
|
package/build/index.js
CHANGED
|
@@ -3,11 +3,54 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.initializeCommandPalette = initializeCommandPalette;
|
|
6
7
|
Object.defineProperty(exports, "privateApis", {
|
|
7
8
|
enumerable: true,
|
|
8
9
|
get: function () {
|
|
9
10
|
return _privateApis.privateApis;
|
|
10
11
|
}
|
|
11
12
|
});
|
|
13
|
+
var _element = require("@wordpress/element");
|
|
14
|
+
var _router = require("@wordpress/router");
|
|
15
|
+
var _commands = require("@wordpress/commands");
|
|
16
|
+
var _adminNavigationCommands = require("./admin-navigation-commands");
|
|
17
|
+
var _siteEditorNavigationCommands = require("./site-editor-navigation-commands");
|
|
18
|
+
var _lockUnlock = require("./lock-unlock");
|
|
19
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
20
|
var _privateApis = require("./private-apis");
|
|
21
|
+
/**
|
|
22
|
+
* WordPress dependencies
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Internal dependencies
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
const {
|
|
30
|
+
RouterProvider
|
|
31
|
+
} = (0, _lockUnlock.unlock)(_router.privateApis);
|
|
32
|
+
|
|
33
|
+
// Register core commands and render the Command Palette.
|
|
34
|
+
function CommandPalette() {
|
|
35
|
+
(0, _adminNavigationCommands.useAdminNavigationCommands)();
|
|
36
|
+
(0, _siteEditorNavigationCommands.useSiteEditorNavigationCommands)();
|
|
37
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(RouterProvider, {
|
|
38
|
+
pathArg: "p",
|
|
39
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_commands.CommandMenu, {})
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Initializes the Command Palette.
|
|
45
|
+
*/
|
|
46
|
+
function initializeCommandPalette() {
|
|
47
|
+
if (!globalThis.IS_GUTENBERG_PLUGIN) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
const root = document.createElement('div');
|
|
51
|
+
document.body.appendChild(root);
|
|
52
|
+
(0, _element.createRoot)(root).render(/*#__PURE__*/(0, _jsxRuntime.jsx)(_element.StrictMode, {
|
|
53
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(CommandPalette, {})
|
|
54
|
+
}));
|
|
55
|
+
}
|
|
13
56
|
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_element","require","_router","_commands","_adminNavigationCommands","_siteEditorNavigationCommands","_lockUnlock","_jsxRuntime","_privateApis","RouterProvider","unlock","routerPrivateApis","CommandPalette","useAdminNavigationCommands","useSiteEditorNavigationCommands","jsx","pathArg","children","CommandMenu","initializeCommandPalette","globalThis","IS_GUTENBERG_PLUGIN","root","document","createElement","body","appendChild","createRoot","render","StrictMode"],"sources":["@wordpress/core-commands/src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createRoot, StrictMode } from '@wordpress/element';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { CommandMenu } from '@wordpress/commands';\n\n/**\n * Internal dependencies\n */\nimport { useAdminNavigationCommands } from './admin-navigation-commands';\nimport { useSiteEditorNavigationCommands } from './site-editor-navigation-commands';\nimport { unlock } from './lock-unlock';\nexport { privateApis } from './private-apis';\n\nconst { RouterProvider } = unlock( routerPrivateApis );\n\n// Register core commands and render the Command Palette.\nfunction CommandPalette() {\n\tuseAdminNavigationCommands();\n\tuseSiteEditorNavigationCommands();\n\treturn (\n\t\t<RouterProvider pathArg=\"p\">\n\t\t\t<CommandMenu />\n\t\t</RouterProvider>\n\t);\n}\n\n/**\n * Initializes the Command Palette.\n */\nexport function initializeCommandPalette() {\n\tif ( ! globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\treturn;\n\t}\n\tconst root = document.createElement( 'div' );\n\tdocument.body.appendChild( root );\n\tcreateRoot( root ).render(\n\t\t<StrictMode>\n\t\t\t<CommandPalette />\n\t\t</StrictMode>\n\t);\n}\n"],"mappings":";;;;;;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAKA,IAAAG,wBAAA,GAAAH,OAAA;AACA,IAAAI,6BAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AAAuC,IAAAM,WAAA,GAAAN,OAAA;AACvC,IAAAO,YAAA,GAAAP,OAAA;AAbA;AACA;AACA;;AAKA;AACA;AACA;;AAMA,MAAM;EAAEQ;AAAe,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;;AAEtD;AACA,SAASC,cAAcA,CAAA,EAAG;EACzB,IAAAC,mDAA0B,EAAC,CAAC;EAC5B,IAAAC,6DAA+B,EAAC,CAAC;EACjC,oBACC,IAAAP,WAAA,CAAAQ,GAAA,EAACN,cAAc;IAACO,OAAO,EAAC,GAAG;IAAAC,QAAA,eAC1B,IAAAV,WAAA,CAAAQ,GAAA,EAACZ,SAAA,CAAAe,WAAW,IAAE;EAAC,CACA,CAAC;AAEnB;;AAEA;AACA;AACA;AACO,SAASC,wBAAwBA,CAAA,EAAG;EAC1C,IAAK,CAAEC,UAAU,CAACC,mBAAmB,EAAG;IACvC;EACD;EACA,MAAMC,IAAI,GAAGC,QAAQ,CAACC,aAAa,CAAE,KAAM,CAAC;EAC5CD,QAAQ,CAACE,IAAI,CAACC,WAAW,CAAEJ,IAAK,CAAC;EACjC,IAAAK,mBAAU,EAAEL,IAAK,CAAC,CAACM,MAAM,cACxB,IAAArB,WAAA,CAAAQ,GAAA,EAACf,QAAA,CAAA6B,UAAU;IAAAZ,QAAA,eACV,IAAAV,WAAA,CAAAQ,GAAA,EAACH,cAAc,IAAE;EAAC,CACP,CACb,CAAC;AACF","ignoreList":[]}
|
|
@@ -241,34 +241,34 @@ const getSiteEditorBasicNavigationCommands = () => function useSiteEditorBasicNa
|
|
|
241
241
|
const result = [];
|
|
242
242
|
if (canCreateTemplate && isBlockBasedTheme) {
|
|
243
243
|
result.push({
|
|
244
|
-
name: 'core/edit-site/open-
|
|
245
|
-
label: (0, _i18n.__)('
|
|
246
|
-
icon: _icons.
|
|
244
|
+
name: 'core/edit-site/open-styles',
|
|
245
|
+
label: (0, _i18n.__)('Styles'),
|
|
246
|
+
icon: _icons.styles,
|
|
247
247
|
callback: ({
|
|
248
248
|
close
|
|
249
249
|
}) => {
|
|
250
250
|
if (isSiteEditor) {
|
|
251
|
-
history.navigate('/
|
|
251
|
+
history.navigate('/styles');
|
|
252
252
|
} else {
|
|
253
253
|
document.location = (0, _url.addQueryArgs)('site-editor.php', {
|
|
254
|
-
p: '/
|
|
254
|
+
p: '/styles'
|
|
255
255
|
});
|
|
256
256
|
}
|
|
257
257
|
close();
|
|
258
258
|
}
|
|
259
259
|
});
|
|
260
260
|
result.push({
|
|
261
|
-
name: 'core/edit-site/open-
|
|
262
|
-
label: (0, _i18n.__)('
|
|
263
|
-
icon: _icons.
|
|
261
|
+
name: 'core/edit-site/open-navigation',
|
|
262
|
+
label: (0, _i18n.__)('Navigation'),
|
|
263
|
+
icon: _icons.navigation,
|
|
264
264
|
callback: ({
|
|
265
265
|
close
|
|
266
266
|
}) => {
|
|
267
267
|
if (isSiteEditor) {
|
|
268
|
-
history.navigate('/
|
|
268
|
+
history.navigate('/navigation');
|
|
269
269
|
} else {
|
|
270
270
|
document.location = (0, _url.addQueryArgs)('site-editor.php', {
|
|
271
|
-
p: '/
|
|
271
|
+
p: '/navigation'
|
|
272
272
|
});
|
|
273
273
|
}
|
|
274
274
|
close();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_commands","require","_i18n","_element","_data","_coreData","_icons","_router","_url","_compose","_htmlEntities","_lockUnlock","_orderEntityRecordsBySearch","useHistory","unlock","routerPrivateApis","icons","post","page","wp_template","layout","wp_template_part","symbolFilled","useDebouncedValue","value","debouncedValue","setDebouncedValue","useState","debounced","useDebounce","useEffect","cancel","getNavigationCommandLoaderPerPostType","postType","useNavigationCommandLoader","search","history","isBlockBasedTheme","canCreateTemplate","useSelect","select","coreStore","getCurrentTheme","is_block_theme","canUser","kind","name","delayedSearch","records","isLoading","query","per_page","orderby","status","getEntityRecords","hasFinishedResolution","commands","useMemo","map","record","command","id","searchLabel","title","rendered","label","decodeEntities","__","icon","callback","close","args","action","targetUrl","addQueryArgs","document","location","isSiteEditor","getPath","window","href","includes","navigate","p","canvas","getNavigationCommandLoaderPerTemplate","templateType","orderedRecords","orderEntityRecordsBySearch","slice","result","push","length","categoryId","getSiteEditorBasicNavigationCommands","useSiteEditorBasicNavigationCommands","navigation","styles","symbol","useSiteEditorNavigationCommands","useCommandLoader","hook","context"],"sources":["@wordpress/core-commands/src/site-editor-navigation-commands.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCommandLoader } from '@wordpress/commands';\nimport { __ } from '@wordpress/i18n';\nimport { useMemo, useEffect, useState } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tpost,\n\tpage,\n\tlayout,\n\tsymbol,\n\tsymbolFilled,\n\tstyles,\n\tnavigation,\n} from '@wordpress/icons';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { addQueryArgs, getPath } from '@wordpress/url';\nimport { useDebounce } from '@wordpress/compose';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from './lock-unlock';\nimport { orderEntityRecordsBySearch } from './utils/order-entity-records-by-search';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nconst icons = {\n\tpost,\n\tpage,\n\twp_template: layout,\n\twp_template_part: symbolFilled,\n};\n\nfunction useDebouncedValue( value ) {\n\tconst [ debouncedValue, setDebouncedValue ] = useState( '' );\n\tconst debounced = useDebounce( setDebouncedValue, 250 );\n\n\tuseEffect( () => {\n\t\tdebounced( value );\n\t\treturn () => debounced.cancel();\n\t}, [ debounced, value ] );\n\n\treturn debouncedValue;\n}\n\nconst getNavigationCommandLoaderPerPostType = ( postType ) =>\n\tfunction useNavigationCommandLoader( { search } ) {\n\t\tconst history = useHistory();\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 delayedSearch = useDebouncedValue( search );\n\t\tconst { records, isLoading } = useSelect(\n\t\t\t( select ) => {\n\t\t\t\tif ( ! delayedSearch ) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tisLoading: false,\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tconst query = {\n\t\t\t\t\tsearch: delayedSearch,\n\t\t\t\t\tper_page: 10,\n\t\t\t\t\torderby: 'relevance',\n\t\t\t\t\tstatus: [\n\t\t\t\t\t\t'publish',\n\t\t\t\t\t\t'future',\n\t\t\t\t\t\t'draft',\n\t\t\t\t\t\t'pending',\n\t\t\t\t\t\t'private',\n\t\t\t\t\t],\n\t\t\t\t};\n\t\t\t\treturn {\n\t\t\t\t\trecords: select( coreStore ).getEntityRecords(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\tpostType,\n\t\t\t\t\t\tquery\n\t\t\t\t\t),\n\t\t\t\t\tisLoading: ! select( coreStore ).hasFinishedResolution(\n\t\t\t\t\t\t'getEntityRecords',\n\t\t\t\t\t\t[ 'postType', postType, query ]\n\t\t\t\t\t),\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ delayedSearch ]\n\t\t);\n\n\t\tconst commands = useMemo( () => {\n\t\t\treturn ( records ?? [] ).map( ( record ) => {\n\t\t\t\tconst command = {\n\t\t\t\t\tname: postType + '-' + record.id,\n\t\t\t\t\tsearchLabel: record.title?.rendered + ' ' + record.id,\n\t\t\t\t\tlabel: record.title?.rendered\n\t\t\t\t\t\t? decodeEntities( record.title?.rendered )\n\t\t\t\t\t\t: __( '(no title)' ),\n\t\t\t\t\ticon: icons[ postType ],\n\t\t\t\t};\n\n\t\t\t\tif (\n\t\t\t\t\t! canCreateTemplate ||\n\t\t\t\t\tpostType === 'post' ||\n\t\t\t\t\t( postType === 'page' && ! isBlockBasedTheme )\n\t\t\t\t) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...command,\n\t\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\t\tconst args = {\n\t\t\t\t\t\t\t\tpost: record.id,\n\t\t\t\t\t\t\t\taction: 'edit',\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tconst targetUrl = addQueryArgs( 'post.php', args );\n\t\t\t\t\t\t\tdocument.location = targetUrl;\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}\n\n\t\t\t\tconst isSiteEditor = getPath( window.location.href )?.includes(\n\t\t\t\t\t'site-editor.php'\n\t\t\t\t);\n\n\t\t\t\treturn {\n\t\t\t\t\t...command,\n\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\tif ( isSiteEditor ) {\n\t\t\t\t\t\t\thistory.navigate(\n\t\t\t\t\t\t\t\t`/${ postType }/${ record.id }?canvas=edit`\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.location = addQueryArgs(\n\t\t\t\t\t\t\t\t'site-editor.php',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tp: `/${ postType }/${ record.id }`,\n\t\t\t\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclose();\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t} );\n\t\t}, [ canCreateTemplate, records, isBlockBasedTheme, history ] );\n\n\t\treturn {\n\t\t\tcommands,\n\t\t\tisLoading,\n\t\t};\n\t};\n\nconst getNavigationCommandLoaderPerTemplate = ( templateType ) =>\n\tfunction useNavigationCommandLoader( { search } ) {\n\t\tconst history = useHistory();\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: templateType,\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 { records, isLoading } = useSelect( ( select ) => {\n\t\t\tconst { getEntityRecords } = select( coreStore );\n\t\t\tconst query = { per_page: -1 };\n\t\t\treturn {\n\t\t\t\trecords: getEntityRecords( 'postType', templateType, query ),\n\t\t\t\tisLoading: ! select( coreStore ).hasFinishedResolution(\n\t\t\t\t\t'getEntityRecords',\n\t\t\t\t\t[ 'postType', templateType, query ]\n\t\t\t\t),\n\t\t\t};\n\t\t}, [] );\n\n\t\t/*\n\t\t * wp_template and wp_template_part endpoints do not support per_page or orderby parameters.\n\t\t * We need to sort the results based on the search query to avoid removing relevant\n\t\t * records below using .slice().\n\t\t */\n\t\tconst orderedRecords = useMemo( () => {\n\t\t\treturn orderEntityRecordsBySearch( records, search ).slice( 0, 10 );\n\t\t}, [ records, search ] );\n\n\t\tconst commands = useMemo( () => {\n\t\t\tif (\n\t\t\t\t! canCreateTemplate ||\n\t\t\t\t( ! isBlockBasedTheme && ! templateType === 'wp_template_part' )\n\t\t\t) {\n\t\t\t\treturn [];\n\t\t\t}\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\tconst result = [];\n\t\t\tresult.push(\n\t\t\t\t...orderedRecords.map( ( record ) => {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tname: templateType + '-' + record.id,\n\t\t\t\t\t\tsearchLabel: record.title?.rendered + ' ' + record.id,\n\t\t\t\t\t\tlabel: record.title?.rendered\n\t\t\t\t\t\t\t? record.title?.rendered\n\t\t\t\t\t\t\t: __( '(no title)' ),\n\t\t\t\t\t\ticon: icons[ templateType ],\n\t\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\t\tif ( isSiteEditor ) {\n\t\t\t\t\t\t\t\thistory.navigate(\n\t\t\t\t\t\t\t\t\t`/${ templateType }/${ record.id }?canvas=edit`\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tdocument.location = addQueryArgs(\n\t\t\t\t\t\t\t\t\t'site-editor.php',\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tp: `/${ templateType }/${ record.id }`,\n\t\t\t\t\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tclose();\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\t} )\n\t\t\t);\n\n\t\t\tif (\n\t\t\t\torderedRecords?.length > 0 &&\n\t\t\t\ttemplateType === 'wp_template_part'\n\t\t\t) {\n\t\t\t\tresult.push( {\n\t\t\t\t\tname: 'core/edit-site/open-template-parts',\n\t\t\t\t\tlabel: __( 'Template parts' ),\n\t\t\t\t\ticon: symbolFilled,\n\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\tif ( isSiteEditor ) {\n\t\t\t\t\t\t\thistory.navigate(\n\t\t\t\t\t\t\t\t'/pattern?postType=wp_template_part&categoryId=all-parts'\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.location = addQueryArgs(\n\t\t\t\t\t\t\t\t'site-editor.php',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tp: '/pattern',\n\t\t\t\t\t\t\t\t\tpostType: 'wp_template_part',\n\t\t\t\t\t\t\t\t\tcategoryId: 'all-parts',\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclose();\n\t\t\t\t\t},\n\t\t\t\t} );\n\t\t\t}\n\t\t\treturn result;\n\t\t}, [ canCreateTemplate, isBlockBasedTheme, orderedRecords, history ] );\n\n\t\treturn {\n\t\t\tcommands,\n\t\t\tisLoading,\n\t\t};\n\t};\n\nconst getSiteEditorBasicNavigationCommands = () =>\n\tfunction useSiteEditorBasicNavigationCommands() {\n\t\tconst history = useHistory();\n\t\tconst isSiteEditor = getPath( window.location.href )?.includes(\n\t\t\t'site-editor.php'\n\t\t);\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 commands = useMemo( () => {\n\t\t\tconst result = [];\n\n\t\t\tif ( canCreateTemplate && isBlockBasedTheme ) {\n\t\t\t\tresult.push( {\n\t\t\t\t\tname: 'core/edit-site/open-navigation',\n\t\t\t\t\tlabel: __( 'Navigation' ),\n\t\t\t\t\ticon: navigation,\n\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\tif ( isSiteEditor ) {\n\t\t\t\t\t\t\thistory.navigate( '/navigation' );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.location = addQueryArgs(\n\t\t\t\t\t\t\t\t'site-editor.php',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tp: '/navigation',\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclose();\n\t\t\t\t\t},\n\t\t\t\t} );\n\n\t\t\t\tresult.push( {\n\t\t\t\t\tname: 'core/edit-site/open-styles',\n\t\t\t\t\tlabel: __( 'Styles' ),\n\t\t\t\t\ticon: styles,\n\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\tif ( isSiteEditor ) {\n\t\t\t\t\t\t\thistory.navigate( '/styles' );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.location = addQueryArgs(\n\t\t\t\t\t\t\t\t'site-editor.php',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tp: '/styles',\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclose();\n\t\t\t\t\t},\n\t\t\t\t} );\n\n\t\t\t\tresult.push( {\n\t\t\t\t\tname: 'core/edit-site/open-pages',\n\t\t\t\t\tlabel: __( 'Pages' ),\n\t\t\t\t\ticon: page,\n\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\tif ( isSiteEditor ) {\n\t\t\t\t\t\t\thistory.navigate( '/page' );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.location = addQueryArgs(\n\t\t\t\t\t\t\t\t'site-editor.php',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tp: '/page',\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclose();\n\t\t\t\t\t},\n\t\t\t\t} );\n\n\t\t\t\tresult.push( {\n\t\t\t\t\tname: 'core/edit-site/open-templates',\n\t\t\t\t\tlabel: __( 'Templates' ),\n\t\t\t\t\ticon: layout,\n\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\tif ( isSiteEditor ) {\n\t\t\t\t\t\t\thistory.navigate( '/template' );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.location = addQueryArgs(\n\t\t\t\t\t\t\t\t'site-editor.php',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tp: '/template',\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclose();\n\t\t\t\t\t},\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tresult.push( {\n\t\t\t\tname: 'core/edit-site/open-patterns',\n\t\t\t\tlabel: __( 'Patterns' ),\n\t\t\t\ticon: symbol,\n\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\tif ( canCreateTemplate ) {\n\t\t\t\t\t\tif ( isSiteEditor ) {\n\t\t\t\t\t\t\thistory.navigate( '/pattern' );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.location = addQueryArgs(\n\t\t\t\t\t\t\t\t'site-editor.php',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tp: '/pattern',\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclose();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// If a user cannot access the site editor\n\t\t\t\t\t\tdocument.location.href = 'edit.php?post_type=wp_block';\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t} );\n\n\t\t\treturn result;\n\t\t}, [ history, isSiteEditor, canCreateTemplate, isBlockBasedTheme ] );\n\n\t\treturn {\n\t\t\tcommands,\n\t\t\tisLoading: false,\n\t\t};\n\t};\n\nexport function useSiteEditorNavigationCommands() {\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/navigate-pages',\n\t\thook: getNavigationCommandLoaderPerPostType( 'page' ),\n\t} );\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/navigate-posts',\n\t\thook: getNavigationCommandLoaderPerPostType( 'post' ),\n\t} );\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/navigate-templates',\n\t\thook: getNavigationCommandLoaderPerTemplate( 'wp_template' ),\n\t} );\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/navigate-template-parts',\n\t\thook: getNavigationCommandLoaderPerTemplate( 'wp_template_part' ),\n\t} );\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/basic-navigation',\n\t\thook: getSiteEditorBasicNavigationCommands(),\n\t\tcontext: 'site-editor',\n\t} );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,SAAA,GAAAC,O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AAY,EAC/B,iBAAiB,EACjB;cACCS,CAAC,EAAE;YACJ,CACD,CAAC;UACF;UACAb,KAAK,CAAC,CAAC;QACR,CAAC,MAAM;UACN;UACAK,QAAQ,CAACC,QAAQ,CAACI,IAAI,GAAG,6BAA6B;QACvD;MACD;IACD,CAAE,CAAC;IAEH,OAAOU,MAAM;EACd,CAAC,EAAE,CAAEtD,OAAO,EAAEyC,YAAY,EAAEvC,iBAAiB,EAAED,iBAAiB,CAAG,CAAC;EAEpE,OAAO;IACNmB,QAAQ;IACRP,SAAS,EAAE;EACZ,CAAC;AACF,CAAC;AAEK,SAASkD,+BAA+BA,CAAA,EAAG;EACjD,IAAAC,0BAAgB,EAAE;IACjBtD,IAAI,EAAE,+BAA+B;IACrCuD,IAAI,EAAErE,qCAAqC,CAAE,MAAO;EACrD,CAAE,CAAC;EACH,IAAAoE,0BAAgB,EAAE;IACjBtD,IAAI,EAAE,+BAA+B;IACrCuD,IAAI,EAAErE,qCAAqC,CAAE,MAAO;EACrD,CAAE,CAAC;EACH,IAAAoE,0BAAgB,EAAE;IACjBtD,IAAI,EAAE,mCAAmC;IACzCuD,IAAI,EAAEhB,qCAAqC,CAAE,aAAc;EAC5D,CAAE,CAAC;EACH,IAAAe,0BAAgB,EAAE;IACjBtD,IAAI,EAAE,wCAAwC;IAC9CuD,IAAI,EAAEhB,qCAAqC,CAAE,kBAAmB;EACjE,CAAE,CAAC;EACH,IAAAe,0BAAgB,EAAE;IACjBtD,IAAI,EAAE,iCAAiC;IACvCuD,IAAI,EAAEP,oCAAoC,CAAC,CAAC;IAC5CQ,OAAO,EAAE;EACV,CAAE,CAAC;AACJ","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_commands","require","_i18n","_element","_data","_coreData","_icons","_router","_url","_compose","_htmlEntities","_lockUnlock","_orderEntityRecordsBySearch","useHistory","unlock","routerPrivateApis","icons","post","page","wp_template","layout","wp_template_part","symbolFilled","useDebouncedValue","value","debouncedValue","setDebouncedValue","useState","debounced","useDebounce","useEffect","cancel","getNavigationCommandLoaderPerPostType","postType","useNavigationCommandLoader","search","history","isBlockBasedTheme","canCreateTemplate","useSelect","select","coreStore","getCurrentTheme","is_block_theme","canUser","kind","name","delayedSearch","records","isLoading","query","per_page","orderby","status","getEntityRecords","hasFinishedResolution","commands","useMemo","map","record","command","id","searchLabel","title","rendered","label","decodeEntities","__","icon","callback","close","args","action","targetUrl","addQueryArgs","document","location","isSiteEditor","getPath","window","href","includes","navigate","p","canvas","getNavigationCommandLoaderPerTemplate","templateType","orderedRecords","orderEntityRecordsBySearch","slice","result","push","length","categoryId","getSiteEditorBasicNavigationCommands","useSiteEditorBasicNavigationCommands","styles","navigation","symbol","useSiteEditorNavigationCommands","useCommandLoader","hook","context"],"sources":["@wordpress/core-commands/src/site-editor-navigation-commands.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCommandLoader } from '@wordpress/commands';\nimport { __ } from '@wordpress/i18n';\nimport { useMemo, useEffect, useState } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tpost,\n\tpage,\n\tlayout,\n\tsymbol,\n\tsymbolFilled,\n\tstyles,\n\tnavigation,\n} from '@wordpress/icons';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { addQueryArgs, getPath } from '@wordpress/url';\nimport { useDebounce } from '@wordpress/compose';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from './lock-unlock';\nimport { orderEntityRecordsBySearch } from './utils/order-entity-records-by-search';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nconst icons = {\n\tpost,\n\tpage,\n\twp_template: layout,\n\twp_template_part: symbolFilled,\n};\n\nfunction useDebouncedValue( value ) {\n\tconst [ debouncedValue, setDebouncedValue ] = useState( '' );\n\tconst debounced = useDebounce( setDebouncedValue, 250 );\n\n\tuseEffect( () => {\n\t\tdebounced( value );\n\t\treturn () => debounced.cancel();\n\t}, [ debounced, value ] );\n\n\treturn debouncedValue;\n}\n\nconst getNavigationCommandLoaderPerPostType = ( postType ) =>\n\tfunction useNavigationCommandLoader( { search } ) {\n\t\tconst history = useHistory();\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 delayedSearch = useDebouncedValue( search );\n\t\tconst { records, isLoading } = useSelect(\n\t\t\t( select ) => {\n\t\t\t\tif ( ! delayedSearch ) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tisLoading: false,\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tconst query = {\n\t\t\t\t\tsearch: delayedSearch,\n\t\t\t\t\tper_page: 10,\n\t\t\t\t\torderby: 'relevance',\n\t\t\t\t\tstatus: [\n\t\t\t\t\t\t'publish',\n\t\t\t\t\t\t'future',\n\t\t\t\t\t\t'draft',\n\t\t\t\t\t\t'pending',\n\t\t\t\t\t\t'private',\n\t\t\t\t\t],\n\t\t\t\t};\n\t\t\t\treturn {\n\t\t\t\t\trecords: select( coreStore ).getEntityRecords(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\tpostType,\n\t\t\t\t\t\tquery\n\t\t\t\t\t),\n\t\t\t\t\tisLoading: ! select( coreStore ).hasFinishedResolution(\n\t\t\t\t\t\t'getEntityRecords',\n\t\t\t\t\t\t[ 'postType', postType, query ]\n\t\t\t\t\t),\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ delayedSearch ]\n\t\t);\n\n\t\tconst commands = useMemo( () => {\n\t\t\treturn ( records ?? [] ).map( ( record ) => {\n\t\t\t\tconst command = {\n\t\t\t\t\tname: postType + '-' + record.id,\n\t\t\t\t\tsearchLabel: record.title?.rendered + ' ' + record.id,\n\t\t\t\t\tlabel: record.title?.rendered\n\t\t\t\t\t\t? decodeEntities( record.title?.rendered )\n\t\t\t\t\t\t: __( '(no title)' ),\n\t\t\t\t\ticon: icons[ postType ],\n\t\t\t\t};\n\n\t\t\t\tif (\n\t\t\t\t\t! canCreateTemplate ||\n\t\t\t\t\tpostType === 'post' ||\n\t\t\t\t\t( postType === 'page' && ! isBlockBasedTheme )\n\t\t\t\t) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...command,\n\t\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\t\tconst args = {\n\t\t\t\t\t\t\t\tpost: record.id,\n\t\t\t\t\t\t\t\taction: 'edit',\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tconst targetUrl = addQueryArgs( 'post.php', args );\n\t\t\t\t\t\t\tdocument.location = targetUrl;\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}\n\n\t\t\t\tconst isSiteEditor = getPath( window.location.href )?.includes(\n\t\t\t\t\t'site-editor.php'\n\t\t\t\t);\n\n\t\t\t\treturn {\n\t\t\t\t\t...command,\n\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\tif ( isSiteEditor ) {\n\t\t\t\t\t\t\thistory.navigate(\n\t\t\t\t\t\t\t\t`/${ postType }/${ record.id }?canvas=edit`\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.location = addQueryArgs(\n\t\t\t\t\t\t\t\t'site-editor.php',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tp: `/${ postType }/${ record.id }`,\n\t\t\t\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclose();\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t} );\n\t\t}, [ canCreateTemplate, records, isBlockBasedTheme, history ] );\n\n\t\treturn {\n\t\t\tcommands,\n\t\t\tisLoading,\n\t\t};\n\t};\n\nconst getNavigationCommandLoaderPerTemplate = ( templateType ) =>\n\tfunction useNavigationCommandLoader( { search } ) {\n\t\tconst history = useHistory();\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: templateType,\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 { records, isLoading } = useSelect( ( select ) => {\n\t\t\tconst { getEntityRecords } = select( coreStore );\n\t\t\tconst query = { per_page: -1 };\n\t\t\treturn {\n\t\t\t\trecords: getEntityRecords( 'postType', templateType, query ),\n\t\t\t\tisLoading: ! select( coreStore ).hasFinishedResolution(\n\t\t\t\t\t'getEntityRecords',\n\t\t\t\t\t[ 'postType', templateType, query ]\n\t\t\t\t),\n\t\t\t};\n\t\t}, [] );\n\n\t\t/*\n\t\t * wp_template and wp_template_part endpoints do not support per_page or orderby parameters.\n\t\t * We need to sort the results based on the search query to avoid removing relevant\n\t\t * records below using .slice().\n\t\t */\n\t\tconst orderedRecords = useMemo( () => {\n\t\t\treturn orderEntityRecordsBySearch( records, search ).slice( 0, 10 );\n\t\t}, [ records, search ] );\n\n\t\tconst commands = useMemo( () => {\n\t\t\tif (\n\t\t\t\t! canCreateTemplate ||\n\t\t\t\t( ! isBlockBasedTheme && ! templateType === 'wp_template_part' )\n\t\t\t) {\n\t\t\t\treturn [];\n\t\t\t}\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\tconst result = [];\n\t\t\tresult.push(\n\t\t\t\t...orderedRecords.map( ( record ) => {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tname: templateType + '-' + record.id,\n\t\t\t\t\t\tsearchLabel: record.title?.rendered + ' ' + record.id,\n\t\t\t\t\t\tlabel: record.title?.rendered\n\t\t\t\t\t\t\t? record.title?.rendered\n\t\t\t\t\t\t\t: __( '(no title)' ),\n\t\t\t\t\t\ticon: icons[ templateType ],\n\t\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\t\tif ( isSiteEditor ) {\n\t\t\t\t\t\t\t\thistory.navigate(\n\t\t\t\t\t\t\t\t\t`/${ templateType }/${ record.id }?canvas=edit`\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tdocument.location = addQueryArgs(\n\t\t\t\t\t\t\t\t\t'site-editor.php',\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tp: `/${ templateType }/${ record.id }`,\n\t\t\t\t\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tclose();\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\t} )\n\t\t\t);\n\n\t\t\tif (\n\t\t\t\torderedRecords?.length > 0 &&\n\t\t\t\ttemplateType === 'wp_template_part'\n\t\t\t) {\n\t\t\t\tresult.push( {\n\t\t\t\t\tname: 'core/edit-site/open-template-parts',\n\t\t\t\t\tlabel: __( 'Template parts' ),\n\t\t\t\t\ticon: symbolFilled,\n\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\tif ( isSiteEditor ) {\n\t\t\t\t\t\t\thistory.navigate(\n\t\t\t\t\t\t\t\t'/pattern?postType=wp_template_part&categoryId=all-parts'\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.location = addQueryArgs(\n\t\t\t\t\t\t\t\t'site-editor.php',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tp: '/pattern',\n\t\t\t\t\t\t\t\t\tpostType: 'wp_template_part',\n\t\t\t\t\t\t\t\t\tcategoryId: 'all-parts',\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclose();\n\t\t\t\t\t},\n\t\t\t\t} );\n\t\t\t}\n\t\t\treturn result;\n\t\t}, [ canCreateTemplate, isBlockBasedTheme, orderedRecords, history ] );\n\n\t\treturn {\n\t\t\tcommands,\n\t\t\tisLoading,\n\t\t};\n\t};\n\nconst getSiteEditorBasicNavigationCommands = () =>\n\tfunction useSiteEditorBasicNavigationCommands() {\n\t\tconst history = useHistory();\n\t\tconst isSiteEditor = getPath( window.location.href )?.includes(\n\t\t\t'site-editor.php'\n\t\t);\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 commands = useMemo( () => {\n\t\t\tconst result = [];\n\n\t\t\tif ( canCreateTemplate && isBlockBasedTheme ) {\n\t\t\t\tresult.push( {\n\t\t\t\t\tname: 'core/edit-site/open-styles',\n\t\t\t\t\tlabel: __( 'Styles' ),\n\t\t\t\t\ticon: styles,\n\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\tif ( isSiteEditor ) {\n\t\t\t\t\t\t\thistory.navigate( '/styles' );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.location = addQueryArgs(\n\t\t\t\t\t\t\t\t'site-editor.php',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tp: '/styles',\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclose();\n\t\t\t\t\t},\n\t\t\t\t} );\n\n\t\t\t\tresult.push( {\n\t\t\t\t\tname: 'core/edit-site/open-navigation',\n\t\t\t\t\tlabel: __( 'Navigation' ),\n\t\t\t\t\ticon: navigation,\n\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\tif ( isSiteEditor ) {\n\t\t\t\t\t\t\thistory.navigate( '/navigation' );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.location = addQueryArgs(\n\t\t\t\t\t\t\t\t'site-editor.php',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tp: '/navigation',\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclose();\n\t\t\t\t\t},\n\t\t\t\t} );\n\n\t\t\t\tresult.push( {\n\t\t\t\t\tname: 'core/edit-site/open-pages',\n\t\t\t\t\tlabel: __( 'Pages' ),\n\t\t\t\t\ticon: page,\n\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\tif ( isSiteEditor ) {\n\t\t\t\t\t\t\thistory.navigate( '/page' );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.location = addQueryArgs(\n\t\t\t\t\t\t\t\t'site-editor.php',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tp: '/page',\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclose();\n\t\t\t\t\t},\n\t\t\t\t} );\n\n\t\t\t\tresult.push( {\n\t\t\t\t\tname: 'core/edit-site/open-templates',\n\t\t\t\t\tlabel: __( 'Templates' ),\n\t\t\t\t\ticon: layout,\n\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\tif ( isSiteEditor ) {\n\t\t\t\t\t\t\thistory.navigate( '/template' );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.location = addQueryArgs(\n\t\t\t\t\t\t\t\t'site-editor.php',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tp: '/template',\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclose();\n\t\t\t\t\t},\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tresult.push( {\n\t\t\t\tname: 'core/edit-site/open-patterns',\n\t\t\t\tlabel: __( 'Patterns' ),\n\t\t\t\ticon: symbol,\n\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\tif ( canCreateTemplate ) {\n\t\t\t\t\t\tif ( isSiteEditor ) {\n\t\t\t\t\t\t\thistory.navigate( '/pattern' );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.location = addQueryArgs(\n\t\t\t\t\t\t\t\t'site-editor.php',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tp: '/pattern',\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclose();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// If a user cannot access the site editor\n\t\t\t\t\t\tdocument.location.href = 'edit.php?post_type=wp_block';\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t} );\n\n\t\t\treturn result;\n\t\t}, [ history, isSiteEditor, canCreateTemplate, isBlockBasedTheme ] );\n\n\t\treturn {\n\t\t\tcommands,\n\t\t\tisLoading: false,\n\t\t};\n\t};\n\nexport function useSiteEditorNavigationCommands() {\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/navigate-pages',\n\t\thook: getNavigationCommandLoaderPerPostType( 'page' ),\n\t} );\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/navigate-posts',\n\t\thook: getNavigationCommandLoaderPerPostType( 'post' ),\n\t} );\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/navigate-templates',\n\t\thook: getNavigationCommandLoaderPerTemplate( 'wp_template' ),\n\t} );\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/navigate-template-parts',\n\t\thook: getNavigationCommandLoaderPerTemplate( 'wp_template_part' ),\n\t} );\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/basic-navigation',\n\t\thook: getSiteEditorBasicNavigationCommands(),\n\t\tcontext: 'site-editor',\n\t} );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AASA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,IAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,aAAA,GAAAT,OAAA;AAKA,IAAAU,WAAA,GAAAV,OAAA;AACA,IAAAW,2BAAA,GAAAX,OAAA;AA1BA;AACA;AACA;;AAoBA;AACA;AACA;;AAIA,MAAM;EAAEY;AAAW,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAElD,MAAMC,KAAK,GAAG;EACbC,IAAI,EAAJA,WAAI;EACJC,IAAI,EAAJA,WAAI;EACJC,WAAW,EAAEC,aAAM;EACnBC,gBAAgB,EAAEC;AACnB,CAAC;AAED,SAASC,iBAAiBA,CAAEC,KAAK,EAAG;EACnC,MAAM,CAAEC,cAAc,EAAEC,iBAAiB,CAAE,GAAG,IAAAC,iBAAQ,EAAE,EAAG,CAAC;EAC5D,MAAMC,SAAS,GAAG,IAAAC,oBAAW,EAAEH,iBAAiB,EAAE,GAAI,CAAC;EAE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wCAAwC;IAC9CuD,IAAI,EAAEhB,qCAAqC,CAAE,kBAAmB;EACjE,CAAE,CAAC;EACH,IAAAe,0BAAgB,EAAE;IACjBtD,IAAI,EAAE,iCAAiC;IACvCuD,IAAI,EAAEP,oCAAoC,CAAC,CAAC;IAC5CQ,OAAO,EAAE;EACV,CAAE,CAAC;AACJ","ignoreList":[]}
|
package/build-module/index.js
CHANGED
|
@@ -1,2 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { createRoot, StrictMode } from '@wordpress/element';
|
|
5
|
+
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
6
|
+
import { CommandMenu } from '@wordpress/commands';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Internal dependencies
|
|
10
|
+
*/
|
|
11
|
+
import { useAdminNavigationCommands } from './admin-navigation-commands';
|
|
12
|
+
import { useSiteEditorNavigationCommands } from './site-editor-navigation-commands';
|
|
13
|
+
import { unlock } from './lock-unlock';
|
|
14
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
15
|
export { privateApis } from './private-apis';
|
|
16
|
+
const {
|
|
17
|
+
RouterProvider
|
|
18
|
+
} = unlock(routerPrivateApis);
|
|
19
|
+
|
|
20
|
+
// Register core commands and render the Command Palette.
|
|
21
|
+
function CommandPalette() {
|
|
22
|
+
useAdminNavigationCommands();
|
|
23
|
+
useSiteEditorNavigationCommands();
|
|
24
|
+
return /*#__PURE__*/_jsx(RouterProvider, {
|
|
25
|
+
pathArg: "p",
|
|
26
|
+
children: /*#__PURE__*/_jsx(CommandMenu, {})
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Initializes the Command Palette.
|
|
32
|
+
*/
|
|
33
|
+
export function initializeCommandPalette() {
|
|
34
|
+
if (!globalThis.IS_GUTENBERG_PLUGIN) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
const root = document.createElement('div');
|
|
38
|
+
document.body.appendChild(root);
|
|
39
|
+
createRoot(root).render(/*#__PURE__*/_jsx(StrictMode, {
|
|
40
|
+
children: /*#__PURE__*/_jsx(CommandPalette, {})
|
|
41
|
+
}));
|
|
42
|
+
}
|
|
2
43
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["privateApis"],"sources":["@wordpress/core-commands/src/index.js"],"sourcesContent":["
|
|
1
|
+
{"version":3,"names":["createRoot","StrictMode","privateApis","routerPrivateApis","CommandMenu","useAdminNavigationCommands","useSiteEditorNavigationCommands","unlock","jsx","_jsx","RouterProvider","CommandPalette","pathArg","children","initializeCommandPalette","globalThis","IS_GUTENBERG_PLUGIN","root","document","createElement","body","appendChild","render"],"sources":["@wordpress/core-commands/src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createRoot, StrictMode } from '@wordpress/element';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { CommandMenu } from '@wordpress/commands';\n\n/**\n * Internal dependencies\n */\nimport { useAdminNavigationCommands } from './admin-navigation-commands';\nimport { useSiteEditorNavigationCommands } from './site-editor-navigation-commands';\nimport { unlock } from './lock-unlock';\nexport { privateApis } from './private-apis';\n\nconst { RouterProvider } = unlock( routerPrivateApis );\n\n// Register core commands and render the Command Palette.\nfunction CommandPalette() {\n\tuseAdminNavigationCommands();\n\tuseSiteEditorNavigationCommands();\n\treturn (\n\t\t<RouterProvider pathArg=\"p\">\n\t\t\t<CommandMenu />\n\t\t</RouterProvider>\n\t);\n}\n\n/**\n * Initializes the Command Palette.\n */\nexport function initializeCommandPalette() {\n\tif ( ! globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\treturn;\n\t}\n\tconst root = document.createElement( 'div' );\n\tdocument.body.appendChild( root );\n\tcreateRoot( root ).render(\n\t\t<StrictMode>\n\t\t\t<CommandPalette />\n\t\t</StrictMode>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAU,EAAEC,UAAU,QAAQ,oBAAoB;AAC3D,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;AACpE,SAASC,WAAW,QAAQ,qBAAqB;;AAEjD;AACA;AACA;AACA,SAASC,0BAA0B,QAAQ,6BAA6B;AACxE,SAASC,+BAA+B,QAAQ,mCAAmC;AACnF,SAASC,MAAM,QAAQ,eAAe;AAAC,SAAAC,GAAA,IAAAC,IAAA;AACvC,SAASP,WAAW,QAAQ,gBAAgB;AAE5C,MAAM;EAAEQ;AAAe,CAAC,GAAGH,MAAM,CAAEJ,iBAAkB,CAAC;;AAEtD;AACA,SAASQ,cAAcA,CAAA,EAAG;EACzBN,0BAA0B,CAAC,CAAC;EAC5BC,+BAA+B,CAAC,CAAC;EACjC,oBACCG,IAAA,CAACC,cAAc;IAACE,OAAO,EAAC,GAAG;IAAAC,QAAA,eAC1BJ,IAAA,CAACL,WAAW,IAAE;EAAC,CACA,CAAC;AAEnB;;AAEA;AACA;AACA;AACA,OAAO,SAASU,wBAAwBA,CAAA,EAAG;EAC1C,IAAK,CAAEC,UAAU,CAACC,mBAAmB,EAAG;IACvC;EACD;EACA,MAAMC,IAAI,GAAGC,QAAQ,CAACC,aAAa,CAAE,KAAM,CAAC;EAC5CD,QAAQ,CAACE,IAAI,CAACC,WAAW,CAAEJ,IAAK,CAAC;EACjCjB,UAAU,CAAEiB,IAAK,CAAC,CAACK,MAAM,cACxBb,IAAA,CAACR,UAAU;IAAAY,QAAA,eACVJ,IAAA,CAACE,cAAc,IAAE;EAAC,CACP,CACb,CAAC;AACF","ignoreList":[]}
|
|
@@ -234,34 +234,34 @@ const getSiteEditorBasicNavigationCommands = () => function useSiteEditorBasicNa
|
|
|
234
234
|
const result = [];
|
|
235
235
|
if (canCreateTemplate && isBlockBasedTheme) {
|
|
236
236
|
result.push({
|
|
237
|
-
name: 'core/edit-site/open-
|
|
238
|
-
label: __('
|
|
239
|
-
icon:
|
|
237
|
+
name: 'core/edit-site/open-styles',
|
|
238
|
+
label: __('Styles'),
|
|
239
|
+
icon: styles,
|
|
240
240
|
callback: ({
|
|
241
241
|
close
|
|
242
242
|
}) => {
|
|
243
243
|
if (isSiteEditor) {
|
|
244
|
-
history.navigate('/
|
|
244
|
+
history.navigate('/styles');
|
|
245
245
|
} else {
|
|
246
246
|
document.location = addQueryArgs('site-editor.php', {
|
|
247
|
-
p: '/
|
|
247
|
+
p: '/styles'
|
|
248
248
|
});
|
|
249
249
|
}
|
|
250
250
|
close();
|
|
251
251
|
}
|
|
252
252
|
});
|
|
253
253
|
result.push({
|
|
254
|
-
name: 'core/edit-site/open-
|
|
255
|
-
label: __('
|
|
256
|
-
icon:
|
|
254
|
+
name: 'core/edit-site/open-navigation',
|
|
255
|
+
label: __('Navigation'),
|
|
256
|
+
icon: navigation,
|
|
257
257
|
callback: ({
|
|
258
258
|
close
|
|
259
259
|
}) => {
|
|
260
260
|
if (isSiteEditor) {
|
|
261
|
-
history.navigate('/
|
|
261
|
+
history.navigate('/navigation');
|
|
262
262
|
} else {
|
|
263
263
|
document.location = addQueryArgs('site-editor.php', {
|
|
264
|
-
p: '/
|
|
264
|
+
p: '/navigation'
|
|
265
265
|
});
|
|
266
266
|
}
|
|
267
267
|
close();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useCommandLoader","__","useMemo","useEffect","useState","useSelect","store","coreStore","post","page","layout","symbol","symbolFilled","styles","navigation","privateApis","routerPrivateApis","addQueryArgs","getPath","useDebounce","decodeEntities","unlock","orderEntityRecordsBySearch","useHistory","icons","wp_template","wp_template_part","useDebouncedValue","value","debouncedValue","setDebouncedValue","debounced","cancel","getNavigationCommandLoaderPerPostType","postType","useNavigationCommandLoader","search","history","isBlockBasedTheme","canCreateTemplate","select","getCurrentTheme","is_block_theme","canUser","kind","name","delayedSearch","records","isLoading","query","per_page","orderby","status","getEntityRecords","hasFinishedResolution","commands","map","record","command","id","searchLabel","title","rendered","label","icon","callback","close","args","action","targetUrl","document","location","isSiteEditor","window","href","includes","navigate","p","canvas","getNavigationCommandLoaderPerTemplate","templateType","orderedRecords","slice","result","push","length","categoryId","getSiteEditorBasicNavigationCommands","useSiteEditorBasicNavigationCommands","useSiteEditorNavigationCommands","hook","context"],"sources":["@wordpress/core-commands/src/site-editor-navigation-commands.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCommandLoader } from '@wordpress/commands';\nimport { __ } from '@wordpress/i18n';\nimport { useMemo, useEffect, useState } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tpost,\n\tpage,\n\tlayout,\n\tsymbol,\n\tsymbolFilled,\n\tstyles,\n\tnavigation,\n} from '@wordpress/icons';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { addQueryArgs, getPath } from '@wordpress/url';\nimport { useDebounce } from '@wordpress/compose';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from './lock-unlock';\nimport { orderEntityRecordsBySearch } from './utils/order-entity-records-by-search';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nconst icons = {\n\tpost,\n\tpage,\n\twp_template: layout,\n\twp_template_part: symbolFilled,\n};\n\nfunction useDebouncedValue( value ) {\n\tconst [ debouncedValue, setDebouncedValue ] = useState( '' );\n\tconst debounced = useDebounce( setDebouncedValue, 250 );\n\n\tuseEffect( () => {\n\t\tdebounced( value );\n\t\treturn () => debounced.cancel();\n\t}, [ debounced, value ] );\n\n\treturn debouncedValue;\n}\n\nconst getNavigationCommandLoaderPerPostType = ( postType ) =>\n\tfunction useNavigationCommandLoader( { search } ) {\n\t\tconst history = useHistory();\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 delayedSearch = useDebouncedValue( search );\n\t\tconst { records, isLoading } = useSelect(\n\t\t\t( select ) => {\n\t\t\t\tif ( ! delayedSearch ) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tisLoading: false,\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tconst query = {\n\t\t\t\t\tsearch: delayedSearch,\n\t\t\t\t\tper_page: 10,\n\t\t\t\t\torderby: 'relevance',\n\t\t\t\t\tstatus: [\n\t\t\t\t\t\t'publish',\n\t\t\t\t\t\t'future',\n\t\t\t\t\t\t'draft',\n\t\t\t\t\t\t'pending',\n\t\t\t\t\t\t'private',\n\t\t\t\t\t],\n\t\t\t\t};\n\t\t\t\treturn {\n\t\t\t\t\trecords: select( coreStore ).getEntityRecords(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\tpostType,\n\t\t\t\t\t\tquery\n\t\t\t\t\t),\n\t\t\t\t\tisLoading: ! select( coreStore ).hasFinishedResolution(\n\t\t\t\t\t\t'getEntityRecords',\n\t\t\t\t\t\t[ 'postType', postType, query ]\n\t\t\t\t\t),\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ delayedSearch ]\n\t\t);\n\n\t\tconst commands = useMemo( () => {\n\t\t\treturn ( records ?? [] ).map( ( record ) => {\n\t\t\t\tconst command = {\n\t\t\t\t\tname: postType + '-' + record.id,\n\t\t\t\t\tsearchLabel: record.title?.rendered + ' ' + record.id,\n\t\t\t\t\tlabel: record.title?.rendered\n\t\t\t\t\t\t? decodeEntities( record.title?.rendered )\n\t\t\t\t\t\t: __( '(no title)' ),\n\t\t\t\t\ticon: icons[ postType ],\n\t\t\t\t};\n\n\t\t\t\tif (\n\t\t\t\t\t! canCreateTemplate ||\n\t\t\t\t\tpostType === 'post' ||\n\t\t\t\t\t( postType === 'page' && ! isBlockBasedTheme )\n\t\t\t\t) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...command,\n\t\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\t\tconst args = {\n\t\t\t\t\t\t\t\tpost: record.id,\n\t\t\t\t\t\t\t\taction: 'edit',\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tconst targetUrl = addQueryArgs( 'post.php', args );\n\t\t\t\t\t\t\tdocument.location = targetUrl;\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}\n\n\t\t\t\tconst isSiteEditor = getPath( window.location.href )?.includes(\n\t\t\t\t\t'site-editor.php'\n\t\t\t\t);\n\n\t\t\t\treturn {\n\t\t\t\t\t...command,\n\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\tif ( isSiteEditor ) {\n\t\t\t\t\t\t\thistory.navigate(\n\t\t\t\t\t\t\t\t`/${ postType }/${ record.id }?canvas=edit`\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.location = addQueryArgs(\n\t\t\t\t\t\t\t\t'site-editor.php',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tp: `/${ postType }/${ record.id }`,\n\t\t\t\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclose();\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t} );\n\t\t}, [ canCreateTemplate, records, isBlockBasedTheme, history ] );\n\n\t\treturn {\n\t\t\tcommands,\n\t\t\tisLoading,\n\t\t};\n\t};\n\nconst getNavigationCommandLoaderPerTemplate = ( templateType ) =>\n\tfunction useNavigationCommandLoader( { search } ) {\n\t\tconst history = useHistory();\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: templateType,\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 { records, isLoading } = useSelect( ( select ) => {\n\t\t\tconst { getEntityRecords } = select( coreStore );\n\t\t\tconst query = { per_page: -1 };\n\t\t\treturn {\n\t\t\t\trecords: getEntityRecords( 'postType', templateType, query ),\n\t\t\t\tisLoading: ! select( coreStore ).hasFinishedResolution(\n\t\t\t\t\t'getEntityRecords',\n\t\t\t\t\t[ 'postType', templateType, query ]\n\t\t\t\t),\n\t\t\t};\n\t\t}, [] );\n\n\t\t/*\n\t\t * wp_template and wp_template_part endpoints do not support per_page or orderby parameters.\n\t\t * We need to sort the results based on the search query to avoid removing relevant\n\t\t * records below using .slice().\n\t\t */\n\t\tconst orderedRecords = useMemo( () => {\n\t\t\treturn orderEntityRecordsBySearch( records, search ).slice( 0, 10 );\n\t\t}, [ records, search ] );\n\n\t\tconst commands = useMemo( () => {\n\t\t\tif (\n\t\t\t\t! canCreateTemplate ||\n\t\t\t\t( ! isBlockBasedTheme && ! templateType === 'wp_template_part' )\n\t\t\t) {\n\t\t\t\treturn [];\n\t\t\t}\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\tconst result = [];\n\t\t\tresult.push(\n\t\t\t\t...orderedRecords.map( ( record ) => {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tname: templateType + '-' + record.id,\n\t\t\t\t\t\tsearchLabel: record.title?.rendered + ' ' + record.id,\n\t\t\t\t\t\tlabel: record.title?.rendered\n\t\t\t\t\t\t\t? record.title?.rendered\n\t\t\t\t\t\t\t: __( '(no title)' ),\n\t\t\t\t\t\ticon: icons[ templateType ],\n\t\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\t\tif ( isSiteEditor ) {\n\t\t\t\t\t\t\t\thistory.navigate(\n\t\t\t\t\t\t\t\t\t`/${ templateType }/${ record.id }?canvas=edit`\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tdocument.location = addQueryArgs(\n\t\t\t\t\t\t\t\t\t'site-editor.php',\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tp: `/${ templateType }/${ record.id }`,\n\t\t\t\t\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tclose();\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\t} )\n\t\t\t);\n\n\t\t\tif (\n\t\t\t\torderedRecords?.length > 0 &&\n\t\t\t\ttemplateType === 'wp_template_part'\n\t\t\t) {\n\t\t\t\tresult.push( {\n\t\t\t\t\tname: 'core/edit-site/open-template-parts',\n\t\t\t\t\tlabel: __( 'Template parts' ),\n\t\t\t\t\ticon: symbolFilled,\n\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\tif ( isSiteEditor ) {\n\t\t\t\t\t\t\thistory.navigate(\n\t\t\t\t\t\t\t\t'/pattern?postType=wp_template_part&categoryId=all-parts'\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.location = addQueryArgs(\n\t\t\t\t\t\t\t\t'site-editor.php',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tp: '/pattern',\n\t\t\t\t\t\t\t\t\tpostType: 'wp_template_part',\n\t\t\t\t\t\t\t\t\tcategoryId: 'all-parts',\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclose();\n\t\t\t\t\t},\n\t\t\t\t} );\n\t\t\t}\n\t\t\treturn result;\n\t\t}, [ canCreateTemplate, isBlockBasedTheme, orderedRecords, history ] );\n\n\t\treturn {\n\t\t\tcommands,\n\t\t\tisLoading,\n\t\t};\n\t};\n\nconst getSiteEditorBasicNavigationCommands = () =>\n\tfunction useSiteEditorBasicNavigationCommands() {\n\t\tconst history = useHistory();\n\t\tconst isSiteEditor = getPath( window.location.href )?.includes(\n\t\t\t'site-editor.php'\n\t\t);\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 commands = useMemo( () => {\n\t\t\tconst result = [];\n\n\t\t\tif ( canCreateTemplate && isBlockBasedTheme ) {\n\t\t\t\tresult.push( {\n\t\t\t\t\tname: 'core/edit-site/open-navigation',\n\t\t\t\t\tlabel: __( 'Navigation' ),\n\t\t\t\t\ticon: navigation,\n\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\tif ( isSiteEditor ) {\n\t\t\t\t\t\t\thistory.navigate( '/navigation' );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.location = addQueryArgs(\n\t\t\t\t\t\t\t\t'site-editor.php',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tp: '/navigation',\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclose();\n\t\t\t\t\t},\n\t\t\t\t} );\n\n\t\t\t\tresult.push( {\n\t\t\t\t\tname: 'core/edit-site/open-styles',\n\t\t\t\t\tlabel: __( 'Styles' ),\n\t\t\t\t\ticon: styles,\n\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\tif ( isSiteEditor ) {\n\t\t\t\t\t\t\thistory.navigate( '/styles' );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.location = addQueryArgs(\n\t\t\t\t\t\t\t\t'site-editor.php',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tp: '/styles',\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclose();\n\t\t\t\t\t},\n\t\t\t\t} );\n\n\t\t\t\tresult.push( {\n\t\t\t\t\tname: 'core/edit-site/open-pages',\n\t\t\t\t\tlabel: __( 'Pages' ),\n\t\t\t\t\ticon: page,\n\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\tif ( isSiteEditor ) {\n\t\t\t\t\t\t\thistory.navigate( '/page' );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.location = addQueryArgs(\n\t\t\t\t\t\t\t\t'site-editor.php',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tp: '/page',\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclose();\n\t\t\t\t\t},\n\t\t\t\t} );\n\n\t\t\t\tresult.push( {\n\t\t\t\t\tname: 'core/edit-site/open-templates',\n\t\t\t\t\tlabel: __( 'Templates' ),\n\t\t\t\t\ticon: layout,\n\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\tif ( isSiteEditor ) {\n\t\t\t\t\t\t\thistory.navigate( '/template' );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.location = addQueryArgs(\n\t\t\t\t\t\t\t\t'site-editor.php',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tp: '/template',\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclose();\n\t\t\t\t\t},\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tresult.push( {\n\t\t\t\tname: 'core/edit-site/open-patterns',\n\t\t\t\tlabel: __( 'Patterns' ),\n\t\t\t\ticon: symbol,\n\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\tif ( canCreateTemplate ) {\n\t\t\t\t\t\tif ( isSiteEditor ) {\n\t\t\t\t\t\t\thistory.navigate( '/pattern' );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.location = addQueryArgs(\n\t\t\t\t\t\t\t\t'site-editor.php',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tp: '/pattern',\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclose();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// If a user cannot access the site editor\n\t\t\t\t\t\tdocument.location.href = 'edit.php?post_type=wp_block';\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t} );\n\n\t\t\treturn result;\n\t\t}, [ history, isSiteEditor, canCreateTemplate, isBlockBasedTheme ] );\n\n\t\treturn {\n\t\t\tcommands,\n\t\t\tisLoading: false,\n\t\t};\n\t};\n\nexport function useSiteEditorNavigationCommands() {\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/navigate-pages',\n\t\thook: getNavigationCommandLoaderPerPostType( 'page' ),\n\t} );\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/navigate-posts',\n\t\thook: getNavigationCommandLoaderPerPostType( 'post' ),\n\t} );\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/navigate-templates',\n\t\thook: getNavigationCommandLoaderPerTemplate( 'wp_template' ),\n\t} );\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/navigate-template-parts',\n\t\thook: getNavigationCommandLoaderPerTemplate( 'wp_template_part' ),\n\t} );\n\tuseCommandLoader( {\n\t\tname: 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nC,OAAO,CAACuC,QAAQ,CAAE,UAAW,CAAC;UAC/B,CAAC,MAAM;YACNN,QAAQ,CAACC,QAAQ,GAAGtD,YAAY,CAC/B,iBAAiB,EACjB;cACC4D,CAAC,EAAE;YACJ,CACD,CAAC;UACF;UACAX,KAAK,CAAC,CAAC;QACR,CAAC,MAAM;UACN;UACAI,QAAQ,CAACC,QAAQ,CAACG,IAAI,GAAG,6BAA6B;QACvD;MACD;IACD,CAAE,CAAC;IAEH,OAAOS,MAAM;EACd,CAAC,EAAE,CAAE9C,OAAO,EAAEmC,YAAY,EAAEjC,iBAAiB,EAAED,iBAAiB,CAAG,CAAC;EAEpE,OAAO;IACNiB,QAAQ;IACRP,SAAS,EAAE;EACZ,CAAC;AACF,CAAC;AAEF,OAAO,SAASyC,+BAA+BA,CAAA,EAAG;EACjDzF,gBAAgB,CAAE;IACjB6C,IAAI,EAAE,+BAA+B;IACrC6C,IAAI,EAAEzD,qCAAqC,CAAE,MAAO;EACrD,CAAE,CAAC;EACHjC,gBAAgB,CAAE;IACjB6C,IAAI,EAAE,+BAA+B;IACrC6C,IAAI,EAAEzD,qCAAqC,CAAE,MAAO;EACrD,CAAE,CAAC;EACHjC,gBAAgB,CAAE;IACjB6C,IAAI,EAAE,mCAAmC;IACzC6C,IAAI,EAAEX,qCAAqC,CAAE,aAAc;EAC5D,CAAE,CAAC;EACH/E,gBAAgB,CAAE;IACjB6C,IAAI,EAAE,wCAAwC;IAC9C6C,IAAI,EAAEX,qCAAqC,CAAE,kBAAmB;EACjE,CAAE,CAAC;EACH/E,gBAAgB,CAAE;IACjB6C,IAAI,EAAE,iCAAiC;IACvC6C,IAAI,EAAEH,oCAAoC,CAAC,CAAC;IAC5CI,OAAO,EAAE;EACV,CAAE,CAAC;AACJ","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["useCommandLoader","__","useMemo","useEffect","useState","useSelect","store","coreStore","post","page","layout","symbol","symbolFilled","styles","navigation","privateApis","routerPrivateApis","addQueryArgs","getPath","useDebounce","decodeEntities","unlock","orderEntityRecordsBySearch","useHistory","icons","wp_template","wp_template_part","useDebouncedValue","value","debouncedValue","setDebouncedValue","debounced","cancel","getNavigationCommandLoaderPerPostType","postType","useNavigationCommandLoader","search","history","isBlockBasedTheme","canCreateTemplate","select","getCurrentTheme","is_block_theme","canUser","kind","name","delayedSearch","records","isLoading","query","per_page","orderby","status","getEntityRecords","hasFinishedResolution","commands","map","record","command","id","searchLabel","title","rendered","label","icon","callback","close","args","action","targetUrl","document","location","isSiteEditor","window","href","includes","navigate","p","canvas","getNavigationCommandLoaderPerTemplate","templateType","orderedRecords","slice","result","push","length","categoryId","getSiteEditorBasicNavigationCommands","useSiteEditorBasicNavigationCommands","useSiteEditorNavigationCommands","hook","context"],"sources":["@wordpress/core-commands/src/site-editor-navigation-commands.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCommandLoader } from '@wordpress/commands';\nimport { __ } from '@wordpress/i18n';\nimport { useMemo, useEffect, useState } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tpost,\n\tpage,\n\tlayout,\n\tsymbol,\n\tsymbolFilled,\n\tstyles,\n\tnavigation,\n} from '@wordpress/icons';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { addQueryArgs, getPath } from '@wordpress/url';\nimport { useDebounce } from '@wordpress/compose';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from './lock-unlock';\nimport { orderEntityRecordsBySearch } from './utils/order-entity-records-by-search';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nconst icons = {\n\tpost,\n\tpage,\n\twp_template: layout,\n\twp_template_part: symbolFilled,\n};\n\nfunction useDebouncedValue( value ) {\n\tconst [ debouncedValue, setDebouncedValue ] = useState( '' );\n\tconst debounced = useDebounce( setDebouncedValue, 250 );\n\n\tuseEffect( () => {\n\t\tdebounced( value );\n\t\treturn () => debounced.cancel();\n\t}, [ debounced, value ] );\n\n\treturn debouncedValue;\n}\n\nconst getNavigationCommandLoaderPerPostType = ( postType ) =>\n\tfunction useNavigationCommandLoader( { search } ) {\n\t\tconst history = useHistory();\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 delayedSearch = useDebouncedValue( search );\n\t\tconst { records, isLoading } = useSelect(\n\t\t\t( select ) => {\n\t\t\t\tif ( ! delayedSearch ) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tisLoading: false,\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tconst query = {\n\t\t\t\t\tsearch: delayedSearch,\n\t\t\t\t\tper_page: 10,\n\t\t\t\t\torderby: 'relevance',\n\t\t\t\t\tstatus: [\n\t\t\t\t\t\t'publish',\n\t\t\t\t\t\t'future',\n\t\t\t\t\t\t'draft',\n\t\t\t\t\t\t'pending',\n\t\t\t\t\t\t'private',\n\t\t\t\t\t],\n\t\t\t\t};\n\t\t\t\treturn {\n\t\t\t\t\trecords: select( coreStore ).getEntityRecords(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\tpostType,\n\t\t\t\t\t\tquery\n\t\t\t\t\t),\n\t\t\t\t\tisLoading: ! select( coreStore ).hasFinishedResolution(\n\t\t\t\t\t\t'getEntityRecords',\n\t\t\t\t\t\t[ 'postType', postType, query ]\n\t\t\t\t\t),\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ delayedSearch ]\n\t\t);\n\n\t\tconst commands = useMemo( () => {\n\t\t\treturn ( records ?? [] ).map( ( record ) => {\n\t\t\t\tconst command = {\n\t\t\t\t\tname: postType + '-' + record.id,\n\t\t\t\t\tsearchLabel: record.title?.rendered + ' ' + record.id,\n\t\t\t\t\tlabel: record.title?.rendered\n\t\t\t\t\t\t? decodeEntities( record.title?.rendered )\n\t\t\t\t\t\t: __( '(no title)' ),\n\t\t\t\t\ticon: icons[ postType ],\n\t\t\t\t};\n\n\t\t\t\tif (\n\t\t\t\t\t! canCreateTemplate ||\n\t\t\t\t\tpostType === 'post' ||\n\t\t\t\t\t( postType === 'page' && ! isBlockBasedTheme )\n\t\t\t\t) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...command,\n\t\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\t\tconst args = {\n\t\t\t\t\t\t\t\tpost: record.id,\n\t\t\t\t\t\t\t\taction: 'edit',\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tconst targetUrl = addQueryArgs( 'post.php', args );\n\t\t\t\t\t\t\tdocument.location = targetUrl;\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}\n\n\t\t\t\tconst isSiteEditor = getPath( window.location.href )?.includes(\n\t\t\t\t\t'site-editor.php'\n\t\t\t\t);\n\n\t\t\t\treturn {\n\t\t\t\t\t...command,\n\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\tif ( isSiteEditor ) {\n\t\t\t\t\t\t\thistory.navigate(\n\t\t\t\t\t\t\t\t`/${ postType }/${ record.id }?canvas=edit`\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.location = addQueryArgs(\n\t\t\t\t\t\t\t\t'site-editor.php',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tp: `/${ postType }/${ record.id }`,\n\t\t\t\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclose();\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t} );\n\t\t}, [ canCreateTemplate, records, isBlockBasedTheme, history ] );\n\n\t\treturn {\n\t\t\tcommands,\n\t\t\tisLoading,\n\t\t};\n\t};\n\nconst getNavigationCommandLoaderPerTemplate = ( templateType ) =>\n\tfunction useNavigationCommandLoader( { search } ) {\n\t\tconst history = useHistory();\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: templateType,\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 { records, isLoading } = useSelect( ( select ) => {\n\t\t\tconst { getEntityRecords } = select( coreStore );\n\t\t\tconst query = { per_page: -1 };\n\t\t\treturn {\n\t\t\t\trecords: getEntityRecords( 'postType', templateType, query ),\n\t\t\t\tisLoading: ! select( coreStore ).hasFinishedResolution(\n\t\t\t\t\t'getEntityRecords',\n\t\t\t\t\t[ 'postType', templateType, query ]\n\t\t\t\t),\n\t\t\t};\n\t\t}, [] );\n\n\t\t/*\n\t\t * wp_template and wp_template_part endpoints do not support per_page or orderby parameters.\n\t\t * We need to sort the results based on the search query to avoid removing relevant\n\t\t * records below using .slice().\n\t\t */\n\t\tconst orderedRecords = useMemo( () => {\n\t\t\treturn orderEntityRecordsBySearch( records, search ).slice( 0, 10 );\n\t\t}, [ records, search ] );\n\n\t\tconst commands = useMemo( () => {\n\t\t\tif (\n\t\t\t\t! canCreateTemplate ||\n\t\t\t\t( ! isBlockBasedTheme && ! templateType === 'wp_template_part' )\n\t\t\t) {\n\t\t\t\treturn [];\n\t\t\t}\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\tconst result = [];\n\t\t\tresult.push(\n\t\t\t\t...orderedRecords.map( ( record ) => {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tname: templateType + '-' + record.id,\n\t\t\t\t\t\tsearchLabel: record.title?.rendered + ' ' + record.id,\n\t\t\t\t\t\tlabel: record.title?.rendered\n\t\t\t\t\t\t\t? record.title?.rendered\n\t\t\t\t\t\t\t: __( '(no title)' ),\n\t\t\t\t\t\ticon: icons[ templateType ],\n\t\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\t\tif ( isSiteEditor ) {\n\t\t\t\t\t\t\t\thistory.navigate(\n\t\t\t\t\t\t\t\t\t`/${ templateType }/${ record.id }?canvas=edit`\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tdocument.location = addQueryArgs(\n\t\t\t\t\t\t\t\t\t'site-editor.php',\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tp: `/${ templateType }/${ record.id }`,\n\t\t\t\t\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tclose();\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\t} )\n\t\t\t);\n\n\t\t\tif (\n\t\t\t\torderedRecords?.length > 0 &&\n\t\t\t\ttemplateType === 'wp_template_part'\n\t\t\t) {\n\t\t\t\tresult.push( {\n\t\t\t\t\tname: 'core/edit-site/open-template-parts',\n\t\t\t\t\tlabel: __( 'Template parts' ),\n\t\t\t\t\ticon: symbolFilled,\n\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\tif ( isSiteEditor ) {\n\t\t\t\t\t\t\thistory.navigate(\n\t\t\t\t\t\t\t\t'/pattern?postType=wp_template_part&categoryId=all-parts'\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.location = addQueryArgs(\n\t\t\t\t\t\t\t\t'site-editor.php',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tp: '/pattern',\n\t\t\t\t\t\t\t\t\tpostType: 'wp_template_part',\n\t\t\t\t\t\t\t\t\tcategoryId: 'all-parts',\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclose();\n\t\t\t\t\t},\n\t\t\t\t} );\n\t\t\t}\n\t\t\treturn result;\n\t\t}, [ canCreateTemplate, isBlockBasedTheme, orderedRecords, history ] );\n\n\t\treturn {\n\t\t\tcommands,\n\t\t\tisLoading,\n\t\t};\n\t};\n\nconst getSiteEditorBasicNavigationCommands = () =>\n\tfunction useSiteEditorBasicNavigationCommands() {\n\t\tconst history = useHistory();\n\t\tconst isSiteEditor = getPath( window.location.href )?.includes(\n\t\t\t'site-editor.php'\n\t\t);\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 commands = useMemo( () => {\n\t\t\tconst result = [];\n\n\t\t\tif ( canCreateTemplate && isBlockBasedTheme ) {\n\t\t\t\tresult.push( {\n\t\t\t\t\tname: 'core/edit-site/open-styles',\n\t\t\t\t\tlabel: __( 'Styles' ),\n\t\t\t\t\ticon: styles,\n\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\tif ( isSiteEditor ) {\n\t\t\t\t\t\t\thistory.navigate( '/styles' );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.location = addQueryArgs(\n\t\t\t\t\t\t\t\t'site-editor.php',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tp: '/styles',\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclose();\n\t\t\t\t\t},\n\t\t\t\t} );\n\n\t\t\t\tresult.push( {\n\t\t\t\t\tname: 'core/edit-site/open-navigation',\n\t\t\t\t\tlabel: __( 'Navigation' ),\n\t\t\t\t\ticon: navigation,\n\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\tif ( isSiteEditor ) {\n\t\t\t\t\t\t\thistory.navigate( '/navigation' );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.location = addQueryArgs(\n\t\t\t\t\t\t\t\t'site-editor.php',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tp: '/navigation',\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclose();\n\t\t\t\t\t},\n\t\t\t\t} );\n\n\t\t\t\tresult.push( {\n\t\t\t\t\tname: 'core/edit-site/open-pages',\n\t\t\t\t\tlabel: __( 'Pages' ),\n\t\t\t\t\ticon: page,\n\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\tif ( isSiteEditor ) {\n\t\t\t\t\t\t\thistory.navigate( '/page' );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.location = addQueryArgs(\n\t\t\t\t\t\t\t\t'site-editor.php',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tp: '/page',\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclose();\n\t\t\t\t\t},\n\t\t\t\t} );\n\n\t\t\t\tresult.push( {\n\t\t\t\t\tname: 'core/edit-site/open-templates',\n\t\t\t\t\tlabel: __( 'Templates' ),\n\t\t\t\t\ticon: layout,\n\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\tif ( isSiteEditor ) {\n\t\t\t\t\t\t\thistory.navigate( '/template' );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.location = addQueryArgs(\n\t\t\t\t\t\t\t\t'site-editor.php',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tp: '/template',\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclose();\n\t\t\t\t\t},\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tresult.push( {\n\t\t\t\tname: 'core/edit-site/open-patterns',\n\t\t\t\tlabel: __( 'Patterns' ),\n\t\t\t\ticon: symbol,\n\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\tif ( canCreateTemplate ) {\n\t\t\t\t\t\tif ( isSiteEditor ) {\n\t\t\t\t\t\t\thistory.navigate( '/pattern' );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.location = addQueryArgs(\n\t\t\t\t\t\t\t\t'site-editor.php',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tp: '/pattern',\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclose();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// If a user cannot access the site editor\n\t\t\t\t\t\tdocument.location.href = 'edit.php?post_type=wp_block';\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t} );\n\n\t\t\treturn result;\n\t\t}, [ history, isSiteEditor, canCreateTemplate, isBlockBasedTheme ] );\n\n\t\treturn {\n\t\t\tcommands,\n\t\t\tisLoading: false,\n\t\t};\n\t};\n\nexport function useSiteEditorNavigationCommands() {\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/navigate-pages',\n\t\thook: getNavigationCommandLoaderPerPostType( 'page' ),\n\t} );\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/navigate-posts',\n\t\thook: getNavigationCommandLoaderPerPostType( 'post' ),\n\t} );\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/navigate-templates',\n\t\thook: getNavigationCommandLoaderPerTemplate( 'wp_template' ),\n\t} );\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/navigate-template-parts',\n\t\thook: getNavigationCommandLoaderPerTemplate( 'wp_template_part' ),\n\t} );\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/basic-navigation',\n\t\thook: getSiteEditorBasicNavigationCommands(),\n\t\tcontext: 'site-editor',\n\t} );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gBAAgB,QAAQ,qBAAqB;AACtD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,OAAO,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,oBAAoB;AACjE,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SACCC,IAAI,EACJC,IAAI,EACJC,MAAM,EACNC,MAAM,EACNC,YAAY,EACZC,MAAM,EACNC,UAAU,QACJ,kBAAkB;AACzB,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;AACpE,SAASC,YAAY,EAAEC,OAAO,QAAQ,gBAAgB;AACtD,SAASC,WAAW,QAAQ,oBAAoB;AAChD,SAASC,cAAc,QAAQ,0BAA0B;;AAEzD;AACA;AACA;AACA,SAASC,MAAM,QAAQ,eAAe;AACtC,SAASC,0BAA0B,QAAQ,wCAAwC;AAEnF,MAAM;EAAEC;AAAW,CAAC,GAAGF,MAAM,CAAEL,iBAAkB,CAAC;AAElD,MAAMQ,KAAK,GAAG;EACbhB,IAAI;EACJC,IAAI;EACJgB,WAAW,EAAEf,MAAM;EACnBgB,gBAAgB,EAAEd;AACnB,CAAC;AAED,SAASe,iBAAiBA,CAAEC,KAAK,EAAG;EACnC,MAAM,CAAEC,cAAc,EAAEC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,CAAE,kBAAmB;EACjE,CAAE,CAAC;EACH/E,gBAAgB,CAAE;IACjB6C,IAAI,EAAE,iCAAiC;IACvC6C,IAAI,EAAEH,oCAAoC,CAAC,CAAC;IAC5CI,OAAO,EAAE;EACV,CAAE,CAAC;AACJ","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/core-commands",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.29.0",
|
|
4
4
|
"description": "WordPress core reusable commands.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -29,19 +29,19 @@
|
|
|
29
29
|
"sideEffects": false,
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@babel/runtime": "7.25.7",
|
|
32
|
-
"@wordpress/block-editor": "^15.
|
|
33
|
-
"@wordpress/commands": "^1.
|
|
34
|
-
"@wordpress/compose": "^7.
|
|
35
|
-
"@wordpress/core-data": "^7.
|
|
36
|
-
"@wordpress/data": "^10.
|
|
37
|
-
"@wordpress/element": "^6.
|
|
38
|
-
"@wordpress/html-entities": "^4.
|
|
39
|
-
"@wordpress/i18n": "^6.
|
|
40
|
-
"@wordpress/icons": "^10.
|
|
41
|
-
"@wordpress/notices": "^5.
|
|
42
|
-
"@wordpress/private-apis": "^1.
|
|
43
|
-
"@wordpress/router": "^1.
|
|
44
|
-
"@wordpress/url": "^4.
|
|
32
|
+
"@wordpress/block-editor": "^15.2.0",
|
|
33
|
+
"@wordpress/commands": "^1.29.0",
|
|
34
|
+
"@wordpress/compose": "^7.29.0",
|
|
35
|
+
"@wordpress/core-data": "^7.29.0",
|
|
36
|
+
"@wordpress/data": "^10.29.0",
|
|
37
|
+
"@wordpress/element": "^6.29.0",
|
|
38
|
+
"@wordpress/html-entities": "^4.29.0",
|
|
39
|
+
"@wordpress/i18n": "^6.2.0",
|
|
40
|
+
"@wordpress/icons": "^10.29.0",
|
|
41
|
+
"@wordpress/notices": "^5.29.0",
|
|
42
|
+
"@wordpress/private-apis": "^1.29.0",
|
|
43
|
+
"@wordpress/router": "^1.29.0",
|
|
44
|
+
"@wordpress/url": "^4.29.0"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"react": "^18.0.0",
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"publishConfig": {
|
|
51
51
|
"access": "public"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "445ede01e8abc8e49a1101b21a3651adbe852120"
|
|
54
54
|
}
|
package/src/index.js
CHANGED
|
@@ -1 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { createRoot, StrictMode } from '@wordpress/element';
|
|
5
|
+
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
6
|
+
import { CommandMenu } from '@wordpress/commands';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Internal dependencies
|
|
10
|
+
*/
|
|
11
|
+
import { useAdminNavigationCommands } from './admin-navigation-commands';
|
|
12
|
+
import { useSiteEditorNavigationCommands } from './site-editor-navigation-commands';
|
|
13
|
+
import { unlock } from './lock-unlock';
|
|
1
14
|
export { privateApis } from './private-apis';
|
|
15
|
+
|
|
16
|
+
const { RouterProvider } = unlock( routerPrivateApis );
|
|
17
|
+
|
|
18
|
+
// Register core commands and render the Command Palette.
|
|
19
|
+
function CommandPalette() {
|
|
20
|
+
useAdminNavigationCommands();
|
|
21
|
+
useSiteEditorNavigationCommands();
|
|
22
|
+
return (
|
|
23
|
+
<RouterProvider pathArg="p">
|
|
24
|
+
<CommandMenu />
|
|
25
|
+
</RouterProvider>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Initializes the Command Palette.
|
|
31
|
+
*/
|
|
32
|
+
export function initializeCommandPalette() {
|
|
33
|
+
if ( ! globalThis.IS_GUTENBERG_PLUGIN ) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const root = document.createElement( 'div' );
|
|
37
|
+
document.body.appendChild( root );
|
|
38
|
+
createRoot( root ).render(
|
|
39
|
+
<StrictMode>
|
|
40
|
+
<CommandPalette />
|
|
41
|
+
</StrictMode>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
@@ -298,17 +298,17 @@ const getSiteEditorBasicNavigationCommands = () =>
|
|
|
298
298
|
|
|
299
299
|
if ( canCreateTemplate && isBlockBasedTheme ) {
|
|
300
300
|
result.push( {
|
|
301
|
-
name: 'core/edit-site/open-
|
|
302
|
-
label: __( '
|
|
303
|
-
icon:
|
|
301
|
+
name: 'core/edit-site/open-styles',
|
|
302
|
+
label: __( 'Styles' ),
|
|
303
|
+
icon: styles,
|
|
304
304
|
callback: ( { close } ) => {
|
|
305
305
|
if ( isSiteEditor ) {
|
|
306
|
-
history.navigate( '/
|
|
306
|
+
history.navigate( '/styles' );
|
|
307
307
|
} else {
|
|
308
308
|
document.location = addQueryArgs(
|
|
309
309
|
'site-editor.php',
|
|
310
310
|
{
|
|
311
|
-
p: '/
|
|
311
|
+
p: '/styles',
|
|
312
312
|
}
|
|
313
313
|
);
|
|
314
314
|
}
|
|
@@ -317,17 +317,17 @@ const getSiteEditorBasicNavigationCommands = () =>
|
|
|
317
317
|
} );
|
|
318
318
|
|
|
319
319
|
result.push( {
|
|
320
|
-
name: 'core/edit-site/open-
|
|
321
|
-
label: __( '
|
|
322
|
-
icon:
|
|
320
|
+
name: 'core/edit-site/open-navigation',
|
|
321
|
+
label: __( 'Navigation' ),
|
|
322
|
+
icon: navigation,
|
|
323
323
|
callback: ( { close } ) => {
|
|
324
324
|
if ( isSiteEditor ) {
|
|
325
|
-
history.navigate( '/
|
|
325
|
+
history.navigate( '/navigation' );
|
|
326
326
|
} else {
|
|
327
327
|
document.location = addQueryArgs(
|
|
328
328
|
'site-editor.php',
|
|
329
329
|
{
|
|
330
|
-
p: '/
|
|
330
|
+
p: '/navigation',
|
|
331
331
|
}
|
|
332
332
|
);
|
|
333
333
|
}
|