@wordpress/core-commands 1.13.0 → 1.13.1-next.cd6172eb0.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/build/admin-navigation-commands.js +1 -5
- package/build/admin-navigation-commands.js.map +1 -1
- package/build/site-editor-navigation-commands.js +36 -53
- package/build/site-editor-navigation-commands.js.map +1 -1
- package/build-module/admin-navigation-commands.js +1 -5
- package/build-module/admin-navigation-commands.js.map +1 -1
- package/build-module/site-editor-navigation-commands.js +36 -53
- package/build-module/site-editor-navigation-commands.js.map +1 -1
- package/package.json +15 -15
- package/src/admin-navigation-commands.js +1 -5
- package/src/site-editor-navigation-commands.js +66 -77
|
@@ -47,11 +47,7 @@ const getAddNewPageCommand = () => function useAddNewPageCommand() {
|
|
|
47
47
|
throwOnError: true
|
|
48
48
|
});
|
|
49
49
|
if (page?.id) {
|
|
50
|
-
history.
|
|
51
|
-
postId: page.id,
|
|
52
|
-
postType: 'page',
|
|
53
|
-
canvas: 'edit'
|
|
54
|
-
});
|
|
50
|
+
history.navigate(`/page/${page.id}?canvas=edit`);
|
|
55
51
|
}
|
|
56
52
|
} catch (error) {
|
|
57
53
|
const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : (0, _i18n.__)('An error occurred while creating the item.');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_commands","require","_i18n","_icons","_url","_coreData","_data","_element","_notices","_router","_lockUnlock","useHistory","unlock","routerPrivateApis","getAddNewPageCommand","useAddNewPageCommand","isSiteEditor","getPath","window","location","href","includes","history","isBlockBasedTheme","useSelect","select","coreStore","getCurrentTheme","is_block_theme","saveEntityRecord","useDispatch","createErrorNotice","noticesStore","createPageEntity","useCallback","close","page","status","throwOnError","id","
|
|
1
|
+
{"version":3,"names":["_commands","require","_i18n","_icons","_url","_coreData","_data","_element","_notices","_router","_lockUnlock","useHistory","unlock","routerPrivateApis","getAddNewPageCommand","useAddNewPageCommand","isSiteEditor","getPath","window","location","href","includes","history","isBlockBasedTheme","useSelect","select","coreStore","getCurrentTheme","is_block_theme","saveEntityRecord","useDispatch","createErrorNotice","noticesStore","createPageEntity","useCallback","close","page","status","throwOnError","id","navigate","error","errorMessage","message","code","__","type","commands","useMemo","addNewPage","document","name","label","icon","plus","callback","isLoading","useAdminNavigationCommands","useCommand","assign","useCommandLoader","hook"],"sources":["@wordpress/core-commands/src/admin-navigation-commands.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCommand, useCommandLoader } from '@wordpress/commands';\nimport { __ } from '@wordpress/i18n';\nimport { plus } from '@wordpress/icons';\nimport { getPath } from '@wordpress/url';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useCallback, useMemo } from '@wordpress/element';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from './lock-unlock';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nconst getAddNewPageCommand = () =>\n\tfunction useAddNewPageCommand() {\n\t\tconst isSiteEditor = getPath( window.location.href )?.includes(\n\t\t\t'site-editor.php'\n\t\t);\n\t\tconst history = useHistory();\n\t\tconst isBlockBasedTheme = useSelect( ( select ) => {\n\t\t\treturn select( coreStore ).getCurrentTheme()?.is_block_theme;\n\t\t}, [] );\n\t\tconst { saveEntityRecord } = useDispatch( coreStore );\n\t\tconst { createErrorNotice } = useDispatch( noticesStore );\n\n\t\tconst createPageEntity = useCallback(\n\t\t\tasync ( { close } ) => {\n\t\t\t\ttry {\n\t\t\t\t\tconst page = await saveEntityRecord(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t'page',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tstatus: 'draft',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthrowOnError: true,\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t\tif ( page?.id ) {\n\t\t\t\t\t\thistory.navigate( `/page/${ page.id }?canvas=edit` );\n\t\t\t\t\t}\n\t\t\t\t} catch ( error ) {\n\t\t\t\t\tconst errorMessage =\n\t\t\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t\t\t? error.message\n\t\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t\t'An error occurred while creating the item.'\n\t\t\t\t\t\t\t );\n\n\t\t\t\t\tcreateErrorNotice( errorMessage, {\n\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t} );\n\t\t\t\t} finally {\n\t\t\t\t\tclose();\n\t\t\t\t}\n\t\t\t},\n\t\t\t[ createErrorNotice, history, saveEntityRecord ]\n\t\t);\n\n\t\tconst commands = useMemo( () => {\n\t\t\tconst addNewPage =\n\t\t\t\tisSiteEditor && isBlockBasedTheme\n\t\t\t\t\t? createPageEntity\n\t\t\t\t\t: () =>\n\t\t\t\t\t\t\t( document.location.href =\n\t\t\t\t\t\t\t\t'post-new.php?post_type=page' );\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tname: 'core/add-new-page',\n\t\t\t\t\tlabel: __( 'Add new page' ),\n\t\t\t\t\ticon: plus,\n\t\t\t\t\tcallback: addNewPage,\n\t\t\t\t},\n\t\t\t];\n\t\t}, [ createPageEntity, isSiteEditor, isBlockBasedTheme ] );\n\n\t\treturn {\n\t\t\tisLoading: false,\n\t\t\tcommands,\n\t\t};\n\t};\n\nexport function useAdminNavigationCommands() {\n\tuseCommand( {\n\t\tname: 'core/add-new-post',\n\t\tlabel: __( 'Add new post' ),\n\t\ticon: plus,\n\t\tcallback: () => {\n\t\t\tdocument.location.assign( 'post-new.php' );\n\t\t},\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/add-new-page',\n\t\thook: getAddNewPageCommand(),\n\t} );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IA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AoB,CAAC;EAC5B,CAAE,CAAC;AACJ","ignoreList":[]}
|
|
@@ -109,16 +109,13 @@ const getNavigationCommandLoaderPerPostType = postType => function useNavigation
|
|
|
109
109
|
callback: ({
|
|
110
110
|
close
|
|
111
111
|
}) => {
|
|
112
|
-
const args = {
|
|
113
|
-
postType,
|
|
114
|
-
postId: record.id,
|
|
115
|
-
canvas: 'edit'
|
|
116
|
-
};
|
|
117
|
-
const targetUrl = (0, _url.addQueryArgs)('site-editor.php', args);
|
|
118
112
|
if (isSiteEditor) {
|
|
119
|
-
history.
|
|
113
|
+
history.navigate(`/${postType}/${record.id}?canvas=edit`);
|
|
120
114
|
} else {
|
|
121
|
-
document.location =
|
|
115
|
+
document.location = (0, _url.addQueryArgs)('site-editor.php', {
|
|
116
|
+
p: `/${postType}/${record.id}`,
|
|
117
|
+
canvas: 'edit'
|
|
118
|
+
});
|
|
122
119
|
}
|
|
123
120
|
close();
|
|
124
121
|
}
|
|
@@ -185,16 +182,13 @@ const getNavigationCommandLoaderPerTemplate = templateType => function useNaviga
|
|
|
185
182
|
callback: ({
|
|
186
183
|
close
|
|
187
184
|
}) => {
|
|
188
|
-
const args = {
|
|
189
|
-
postType: templateType,
|
|
190
|
-
postId: record.id,
|
|
191
|
-
canvas: 'edit'
|
|
192
|
-
};
|
|
193
|
-
const targetUrl = (0, _url.addQueryArgs)('site-editor.php', args);
|
|
194
185
|
if (isSiteEditor) {
|
|
195
|
-
history.
|
|
186
|
+
history.navigate(`/${templateType}/${record.id}?canvas=edit`);
|
|
196
187
|
} else {
|
|
197
|
-
document.location =
|
|
188
|
+
document.location = (0, _url.addQueryArgs)('site-editor.php', {
|
|
189
|
+
p: `/${templateType}/${record.id}`,
|
|
190
|
+
canvas: 'edit'
|
|
191
|
+
});
|
|
198
192
|
}
|
|
199
193
|
close();
|
|
200
194
|
}
|
|
@@ -208,15 +202,14 @@ const getNavigationCommandLoaderPerTemplate = templateType => function useNaviga
|
|
|
208
202
|
callback: ({
|
|
209
203
|
close
|
|
210
204
|
}) => {
|
|
211
|
-
const args = {
|
|
212
|
-
postType: 'wp_template_part',
|
|
213
|
-
categoryId: 'all-parts'
|
|
214
|
-
};
|
|
215
|
-
const targetUrl = (0, _url.addQueryArgs)('site-editor.php', args);
|
|
216
205
|
if (isSiteEditor) {
|
|
217
|
-
history.
|
|
206
|
+
history.navigate('/pattern?postType=wp_template_part&categoryId=all-parts');
|
|
218
207
|
} else {
|
|
219
|
-
document.location =
|
|
208
|
+
document.location = (0, _url.addQueryArgs)('site-editor.php', {
|
|
209
|
+
p: '/pattern',
|
|
210
|
+
postType: 'wp_template_part',
|
|
211
|
+
categoryId: 'all-parts'
|
|
212
|
+
});
|
|
220
213
|
}
|
|
221
214
|
close();
|
|
222
215
|
}
|
|
@@ -254,14 +247,12 @@ const getSiteEditorBasicNavigationCommands = () => function useSiteEditorBasicNa
|
|
|
254
247
|
callback: ({
|
|
255
248
|
close
|
|
256
249
|
}) => {
|
|
257
|
-
const args = {
|
|
258
|
-
postType: 'wp_navigation'
|
|
259
|
-
};
|
|
260
|
-
const targetUrl = (0, _url.addQueryArgs)('site-editor.php', args);
|
|
261
250
|
if (isSiteEditor) {
|
|
262
|
-
history.
|
|
251
|
+
history.navigate('/navigation');
|
|
263
252
|
} else {
|
|
264
|
-
document.location =
|
|
253
|
+
document.location = (0, _url.addQueryArgs)('site-editor.php', {
|
|
254
|
+
p: '/navigation'
|
|
255
|
+
});
|
|
265
256
|
}
|
|
266
257
|
close();
|
|
267
258
|
}
|
|
@@ -273,14 +264,12 @@ const getSiteEditorBasicNavigationCommands = () => function useSiteEditorBasicNa
|
|
|
273
264
|
callback: ({
|
|
274
265
|
close
|
|
275
266
|
}) => {
|
|
276
|
-
const args = {
|
|
277
|
-
path: '/wp_global_styles'
|
|
278
|
-
};
|
|
279
|
-
const targetUrl = (0, _url.addQueryArgs)('site-editor.php', args);
|
|
280
267
|
if (isSiteEditor) {
|
|
281
|
-
history.
|
|
268
|
+
history.navigate('/styles');
|
|
282
269
|
} else {
|
|
283
|
-
document.location =
|
|
270
|
+
document.location = (0, _url.addQueryArgs)('site-editor.php', {
|
|
271
|
+
p: '/styles'
|
|
272
|
+
});
|
|
284
273
|
}
|
|
285
274
|
close();
|
|
286
275
|
}
|
|
@@ -292,14 +281,12 @@ const getSiteEditorBasicNavigationCommands = () => function useSiteEditorBasicNa
|
|
|
292
281
|
callback: ({
|
|
293
282
|
close
|
|
294
283
|
}) => {
|
|
295
|
-
const args = {
|
|
296
|
-
postType: 'page'
|
|
297
|
-
};
|
|
298
|
-
const targetUrl = (0, _url.addQueryArgs)('site-editor.php', args);
|
|
299
284
|
if (isSiteEditor) {
|
|
300
|
-
history.
|
|
285
|
+
history.navigate('/page');
|
|
301
286
|
} else {
|
|
302
|
-
document.location =
|
|
287
|
+
document.location = (0, _url.addQueryArgs)('site-editor.php', {
|
|
288
|
+
p: '/page'
|
|
289
|
+
});
|
|
303
290
|
}
|
|
304
291
|
close();
|
|
305
292
|
}
|
|
@@ -311,14 +298,12 @@ const getSiteEditorBasicNavigationCommands = () => function useSiteEditorBasicNa
|
|
|
311
298
|
callback: ({
|
|
312
299
|
close
|
|
313
300
|
}) => {
|
|
314
|
-
const args = {
|
|
315
|
-
postType: 'wp_template'
|
|
316
|
-
};
|
|
317
|
-
const targetUrl = (0, _url.addQueryArgs)('site-editor.php', args);
|
|
318
301
|
if (isSiteEditor) {
|
|
319
|
-
history.
|
|
302
|
+
history.navigate('/template');
|
|
320
303
|
} else {
|
|
321
|
-
document.location =
|
|
304
|
+
document.location = (0, _url.addQueryArgs)('site-editor.php', {
|
|
305
|
+
p: '/template'
|
|
306
|
+
});
|
|
322
307
|
}
|
|
323
308
|
close();
|
|
324
309
|
}
|
|
@@ -332,14 +317,12 @@ const getSiteEditorBasicNavigationCommands = () => function useSiteEditorBasicNa
|
|
|
332
317
|
close
|
|
333
318
|
}) => {
|
|
334
319
|
if (canCreateTemplate) {
|
|
335
|
-
const args = {
|
|
336
|
-
postType: 'wp_block'
|
|
337
|
-
};
|
|
338
|
-
const targetUrl = (0, _url.addQueryArgs)('site-editor.php', args);
|
|
339
320
|
if (isSiteEditor) {
|
|
340
|
-
history.
|
|
321
|
+
history.navigate('/pattern');
|
|
341
322
|
} else {
|
|
342
|
-
document.location =
|
|
323
|
+
document.location = (0, _url.addQueryArgs)('site-editor.php', {
|
|
324
|
+
p: '/pattern'
|
|
325
|
+
});
|
|
343
326
|
}
|
|
344
327
|
close();
|
|
345
328
|
} else {
|
|
@@ -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","postId","canvas","push","getNavigationCommandLoaderPerTemplate","templateType","orderedRecords","orderEntityRecordsBySearch","slice","result","length","categoryId","getSiteEditorBasicNavigationCommands","useSiteEditorBasicNavigationCommands","navigation","styles","path","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\tconst args = {\n\t\t\t\t\t\t\tpostType,\n\t\t\t\t\t\t\tpostId: record.id,\n\t\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t\t};\n\t\t\t\t\t\tconst targetUrl = addQueryArgs(\n\t\t\t\t\t\t\t'site-editor.php',\n\t\t\t\t\t\t\targs\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif ( isSiteEditor ) {\n\t\t\t\t\t\t\thistory.push( args );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.location = targetUrl;\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\tconst args = {\n\t\t\t\t\t\t\t\tpostType: templateType,\n\t\t\t\t\t\t\t\tpostId: record.id,\n\t\t\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tconst targetUrl = addQueryArgs(\n\t\t\t\t\t\t\t\t'site-editor.php',\n\t\t\t\t\t\t\t\targs\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tif ( isSiteEditor ) {\n\t\t\t\t\t\t\t\thistory.push( args );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tdocument.location = targetUrl;\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\tconst args = {\n\t\t\t\t\t\t\tpostType: 'wp_template_part',\n\t\t\t\t\t\t\tcategoryId: 'all-parts',\n\t\t\t\t\t\t};\n\t\t\t\t\t\tconst targetUrl = addQueryArgs(\n\t\t\t\t\t\t\t'site-editor.php',\n\t\t\t\t\t\t\targs\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif ( isSiteEditor ) {\n\t\t\t\t\t\t\thistory.push( args );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.location = targetUrl;\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\tconst args = {\n\t\t\t\t\t\t\tpostType: 'wp_navigation',\n\t\t\t\t\t\t};\n\t\t\t\t\t\tconst targetUrl = addQueryArgs(\n\t\t\t\t\t\t\t'site-editor.php',\n\t\t\t\t\t\t\targs\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif ( isSiteEditor ) {\n\t\t\t\t\t\t\thistory.push( args );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.location = targetUrl;\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\tconst args = {\n\t\t\t\t\t\t\tpath: '/wp_global_styles',\n\t\t\t\t\t\t};\n\t\t\t\t\t\tconst targetUrl = addQueryArgs(\n\t\t\t\t\t\t\t'site-editor.php',\n\t\t\t\t\t\t\targs\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif ( isSiteEditor ) {\n\t\t\t\t\t\t\thistory.push( args );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.location = targetUrl;\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\tconst args = {\n\t\t\t\t\t\t\tpostType: 'page',\n\t\t\t\t\t\t};\n\t\t\t\t\t\tconst targetUrl = addQueryArgs(\n\t\t\t\t\t\t\t'site-editor.php',\n\t\t\t\t\t\t\targs\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif ( isSiteEditor ) {\n\t\t\t\t\t\t\thistory.push( args );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.location = targetUrl;\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\tconst args = {\n\t\t\t\t\t\t\tpostType: 'wp_template',\n\t\t\t\t\t\t};\n\t\t\t\t\t\tconst targetUrl = addQueryArgs(\n\t\t\t\t\t\t\t'site-editor.php',\n\t\t\t\t\t\t\targs\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif ( isSiteEditor ) {\n\t\t\t\t\t\t\thistory.push( args );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.location = targetUrl;\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\tconst args = {\n\t\t\t\t\t\t\tpostType: 'wp_block',\n\t\t\t\t\t\t};\n\t\t\t\t\t\tconst targetUrl = addQueryArgs(\n\t\t\t\t\t\t\t'site-editor.php',\n\t\t\t\t\t\t\targs\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif ( isSiteEditor ) {\n\t\t\t\t\t\t\thistory.push( args );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.location = targetUrl;\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;AAC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[]}
|
|
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,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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,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":[]}
|
|
@@ -40,11 +40,7 @@ const getAddNewPageCommand = () => function useAddNewPageCommand() {
|
|
|
40
40
|
throwOnError: true
|
|
41
41
|
});
|
|
42
42
|
if (page?.id) {
|
|
43
|
-
history.
|
|
44
|
-
postId: page.id,
|
|
45
|
-
postType: 'page',
|
|
46
|
-
canvas: 'edit'
|
|
47
|
-
});
|
|
43
|
+
history.navigate(`/page/${page.id}?canvas=edit`);
|
|
48
44
|
}
|
|
49
45
|
} catch (error) {
|
|
50
46
|
const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : __('An error occurred while creating the item.');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useCommand","useCommandLoader","__","plus","getPath","store","coreStore","useSelect","useDispatch","useCallback","useMemo","noticesStore","privateApis","routerPrivateApis","unlock","useHistory","getAddNewPageCommand","useAddNewPageCommand","isSiteEditor","window","location","href","includes","history","isBlockBasedTheme","select","getCurrentTheme","is_block_theme","saveEntityRecord","createErrorNotice","createPageEntity","close","page","status","throwOnError","id","
|
|
1
|
+
{"version":3,"names":["useCommand","useCommandLoader","__","plus","getPath","store","coreStore","useSelect","useDispatch","useCallback","useMemo","noticesStore","privateApis","routerPrivateApis","unlock","useHistory","getAddNewPageCommand","useAddNewPageCommand","isSiteEditor","window","location","href","includes","history","isBlockBasedTheme","select","getCurrentTheme","is_block_theme","saveEntityRecord","createErrorNotice","createPageEntity","close","page","status","throwOnError","id","navigate","error","errorMessage","message","code","type","commands","addNewPage","document","name","label","icon","callback","isLoading","useAdminNavigationCommands","assign","hook"],"sources":["@wordpress/core-commands/src/admin-navigation-commands.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCommand, useCommandLoader } from '@wordpress/commands';\nimport { __ } from '@wordpress/i18n';\nimport { plus } from '@wordpress/icons';\nimport { getPath } from '@wordpress/url';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useCallback, useMemo } from '@wordpress/element';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from './lock-unlock';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nconst getAddNewPageCommand = () =>\n\tfunction useAddNewPageCommand() {\n\t\tconst isSiteEditor = getPath( window.location.href )?.includes(\n\t\t\t'site-editor.php'\n\t\t);\n\t\tconst history = useHistory();\n\t\tconst isBlockBasedTheme = useSelect( ( select ) => {\n\t\t\treturn select( coreStore ).getCurrentTheme()?.is_block_theme;\n\t\t}, [] );\n\t\tconst { saveEntityRecord } = useDispatch( coreStore );\n\t\tconst { createErrorNotice } = useDispatch( noticesStore );\n\n\t\tconst createPageEntity = useCallback(\n\t\t\tasync ( { close } ) => {\n\t\t\t\ttry {\n\t\t\t\t\tconst page = await saveEntityRecord(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t'page',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tstatus: 'draft',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthrowOnError: true,\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t\tif ( page?.id ) {\n\t\t\t\t\t\thistory.navigate( `/page/${ page.id }?canvas=edit` );\n\t\t\t\t\t}\n\t\t\t\t} catch ( error ) {\n\t\t\t\t\tconst errorMessage =\n\t\t\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t\t\t? error.message\n\t\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t\t'An error occurred while creating the item.'\n\t\t\t\t\t\t\t );\n\n\t\t\t\t\tcreateErrorNotice( errorMessage, {\n\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t} );\n\t\t\t\t} finally {\n\t\t\t\t\tclose();\n\t\t\t\t}\n\t\t\t},\n\t\t\t[ createErrorNotice, history, saveEntityRecord ]\n\t\t);\n\n\t\tconst commands = useMemo( () => {\n\t\t\tconst addNewPage =\n\t\t\t\tisSiteEditor && isBlockBasedTheme\n\t\t\t\t\t? createPageEntity\n\t\t\t\t\t: () =>\n\t\t\t\t\t\t\t( document.location.href =\n\t\t\t\t\t\t\t\t'post-new.php?post_type=page' );\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tname: 'core/add-new-page',\n\t\t\t\t\tlabel: __( 'Add new page' ),\n\t\t\t\t\ticon: plus,\n\t\t\t\t\tcallback: addNewPage,\n\t\t\t\t},\n\t\t\t];\n\t\t}, [ createPageEntity, isSiteEditor, isBlockBasedTheme ] );\n\n\t\treturn {\n\t\t\tisLoading: false,\n\t\t\tcommands,\n\t\t};\n\t};\n\nexport function useAdminNavigationCommands() {\n\tuseCommand( {\n\t\tname: 'core/add-new-post',\n\t\tlabel: __( 'Add new post' ),\n\t\ticon: plus,\n\t\tcallback: () => {\n\t\t\tdocument.location.assign( 'post-new.php' );\n\t\t},\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/add-new-page',\n\t\thook: getAddNewPageCommand(),\n\t} );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAU,EAAEC,gBAAgB,QAAQ,qBAAqB;AAClE,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,IAAI,QAAQ,kBAAkB;AACvC,SAASC,OAAO,QA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ACJ","ignoreList":[]}
|
|
@@ -102,16 +102,13 @@ const getNavigationCommandLoaderPerPostType = postType => function useNavigation
|
|
|
102
102
|
callback: ({
|
|
103
103
|
close
|
|
104
104
|
}) => {
|
|
105
|
-
const args = {
|
|
106
|
-
postType,
|
|
107
|
-
postId: record.id,
|
|
108
|
-
canvas: 'edit'
|
|
109
|
-
};
|
|
110
|
-
const targetUrl = addQueryArgs('site-editor.php', args);
|
|
111
105
|
if (isSiteEditor) {
|
|
112
|
-
history.
|
|
106
|
+
history.navigate(`/${postType}/${record.id}?canvas=edit`);
|
|
113
107
|
} else {
|
|
114
|
-
document.location =
|
|
108
|
+
document.location = addQueryArgs('site-editor.php', {
|
|
109
|
+
p: `/${postType}/${record.id}`,
|
|
110
|
+
canvas: 'edit'
|
|
111
|
+
});
|
|
115
112
|
}
|
|
116
113
|
close();
|
|
117
114
|
}
|
|
@@ -178,16 +175,13 @@ const getNavigationCommandLoaderPerTemplate = templateType => function useNaviga
|
|
|
178
175
|
callback: ({
|
|
179
176
|
close
|
|
180
177
|
}) => {
|
|
181
|
-
const args = {
|
|
182
|
-
postType: templateType,
|
|
183
|
-
postId: record.id,
|
|
184
|
-
canvas: 'edit'
|
|
185
|
-
};
|
|
186
|
-
const targetUrl = addQueryArgs('site-editor.php', args);
|
|
187
178
|
if (isSiteEditor) {
|
|
188
|
-
history.
|
|
179
|
+
history.navigate(`/${templateType}/${record.id}?canvas=edit`);
|
|
189
180
|
} else {
|
|
190
|
-
document.location =
|
|
181
|
+
document.location = addQueryArgs('site-editor.php', {
|
|
182
|
+
p: `/${templateType}/${record.id}`,
|
|
183
|
+
canvas: 'edit'
|
|
184
|
+
});
|
|
191
185
|
}
|
|
192
186
|
close();
|
|
193
187
|
}
|
|
@@ -201,15 +195,14 @@ const getNavigationCommandLoaderPerTemplate = templateType => function useNaviga
|
|
|
201
195
|
callback: ({
|
|
202
196
|
close
|
|
203
197
|
}) => {
|
|
204
|
-
const args = {
|
|
205
|
-
postType: 'wp_template_part',
|
|
206
|
-
categoryId: 'all-parts'
|
|
207
|
-
};
|
|
208
|
-
const targetUrl = addQueryArgs('site-editor.php', args);
|
|
209
198
|
if (isSiteEditor) {
|
|
210
|
-
history.
|
|
199
|
+
history.navigate('/pattern?postType=wp_template_part&categoryId=all-parts');
|
|
211
200
|
} else {
|
|
212
|
-
document.location =
|
|
201
|
+
document.location = addQueryArgs('site-editor.php', {
|
|
202
|
+
p: '/pattern',
|
|
203
|
+
postType: 'wp_template_part',
|
|
204
|
+
categoryId: 'all-parts'
|
|
205
|
+
});
|
|
213
206
|
}
|
|
214
207
|
close();
|
|
215
208
|
}
|
|
@@ -247,14 +240,12 @@ const getSiteEditorBasicNavigationCommands = () => function useSiteEditorBasicNa
|
|
|
247
240
|
callback: ({
|
|
248
241
|
close
|
|
249
242
|
}) => {
|
|
250
|
-
const args = {
|
|
251
|
-
postType: 'wp_navigation'
|
|
252
|
-
};
|
|
253
|
-
const targetUrl = addQueryArgs('site-editor.php', args);
|
|
254
243
|
if (isSiteEditor) {
|
|
255
|
-
history.
|
|
244
|
+
history.navigate('/navigation');
|
|
256
245
|
} else {
|
|
257
|
-
document.location =
|
|
246
|
+
document.location = addQueryArgs('site-editor.php', {
|
|
247
|
+
p: '/navigation'
|
|
248
|
+
});
|
|
258
249
|
}
|
|
259
250
|
close();
|
|
260
251
|
}
|
|
@@ -266,14 +257,12 @@ const getSiteEditorBasicNavigationCommands = () => function useSiteEditorBasicNa
|
|
|
266
257
|
callback: ({
|
|
267
258
|
close
|
|
268
259
|
}) => {
|
|
269
|
-
const args = {
|
|
270
|
-
path: '/wp_global_styles'
|
|
271
|
-
};
|
|
272
|
-
const targetUrl = addQueryArgs('site-editor.php', args);
|
|
273
260
|
if (isSiteEditor) {
|
|
274
|
-
history.
|
|
261
|
+
history.navigate('/styles');
|
|
275
262
|
} else {
|
|
276
|
-
document.location =
|
|
263
|
+
document.location = addQueryArgs('site-editor.php', {
|
|
264
|
+
p: '/styles'
|
|
265
|
+
});
|
|
277
266
|
}
|
|
278
267
|
close();
|
|
279
268
|
}
|
|
@@ -285,14 +274,12 @@ const getSiteEditorBasicNavigationCommands = () => function useSiteEditorBasicNa
|
|
|
285
274
|
callback: ({
|
|
286
275
|
close
|
|
287
276
|
}) => {
|
|
288
|
-
const args = {
|
|
289
|
-
postType: 'page'
|
|
290
|
-
};
|
|
291
|
-
const targetUrl = addQueryArgs('site-editor.php', args);
|
|
292
277
|
if (isSiteEditor) {
|
|
293
|
-
history.
|
|
278
|
+
history.navigate('/page');
|
|
294
279
|
} else {
|
|
295
|
-
document.location =
|
|
280
|
+
document.location = addQueryArgs('site-editor.php', {
|
|
281
|
+
p: '/page'
|
|
282
|
+
});
|
|
296
283
|
}
|
|
297
284
|
close();
|
|
298
285
|
}
|
|
@@ -304,14 +291,12 @@ const getSiteEditorBasicNavigationCommands = () => function useSiteEditorBasicNa
|
|
|
304
291
|
callback: ({
|
|
305
292
|
close
|
|
306
293
|
}) => {
|
|
307
|
-
const args = {
|
|
308
|
-
postType: 'wp_template'
|
|
309
|
-
};
|
|
310
|
-
const targetUrl = addQueryArgs('site-editor.php', args);
|
|
311
294
|
if (isSiteEditor) {
|
|
312
|
-
history.
|
|
295
|
+
history.navigate('/template');
|
|
313
296
|
} else {
|
|
314
|
-
document.location =
|
|
297
|
+
document.location = addQueryArgs('site-editor.php', {
|
|
298
|
+
p: '/template'
|
|
299
|
+
});
|
|
315
300
|
}
|
|
316
301
|
close();
|
|
317
302
|
}
|
|
@@ -325,14 +310,12 @@ const getSiteEditorBasicNavigationCommands = () => function useSiteEditorBasicNa
|
|
|
325
310
|
close
|
|
326
311
|
}) => {
|
|
327
312
|
if (canCreateTemplate) {
|
|
328
|
-
const args = {
|
|
329
|
-
postType: 'wp_block'
|
|
330
|
-
};
|
|
331
|
-
const targetUrl = addQueryArgs('site-editor.php', args);
|
|
332
313
|
if (isSiteEditor) {
|
|
333
|
-
history.
|
|
314
|
+
history.navigate('/pattern');
|
|
334
315
|
} else {
|
|
335
|
-
document.location =
|
|
316
|
+
document.location = addQueryArgs('site-editor.php', {
|
|
317
|
+
p: '/pattern'
|
|
318
|
+
});
|
|
336
319
|
}
|
|
337
320
|
close();
|
|
338
321
|
} else {
|
|
@@ -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","postId","canvas","push","getNavigationCommandLoaderPerTemplate","templateType","orderedRecords","slice","result","length","categoryId","getSiteEditorBasicNavigationCommands","useSiteEditorBasicNavigationCommands","path","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\tconst args = {\n\t\t\t\t\t\t\tpostType,\n\t\t\t\t\t\t\tpostId: record.id,\n\t\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t\t};\n\t\t\t\t\t\tconst targetUrl = addQueryArgs(\n\t\t\t\t\t\t\t'site-editor.php',\n\t\t\t\t\t\t\targs\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif ( isSiteEditor ) {\n\t\t\t\t\t\t\thistory.push( args );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.location = targetUrl;\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\tconst args = {\n\t\t\t\t\t\t\t\tpostType: templateType,\n\t\t\t\t\t\t\t\tpostId: record.id,\n\t\t\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tconst targetUrl = addQueryArgs(\n\t\t\t\t\t\t\t\t'site-editor.php',\n\t\t\t\t\t\t\t\targs\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tif ( isSiteEditor ) {\n\t\t\t\t\t\t\t\thistory.push( args );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tdocument.location = targetUrl;\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\tconst args = {\n\t\t\t\t\t\t\tpostType: 'wp_template_part',\n\t\t\t\t\t\t\tcategoryId: 'all-parts',\n\t\t\t\t\t\t};\n\t\t\t\t\t\tconst targetUrl = addQueryArgs(\n\t\t\t\t\t\t\t'site-editor.php',\n\t\t\t\t\t\t\targs\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif ( isSiteEditor ) {\n\t\t\t\t\t\t\thistory.push( args );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.location = targetUrl;\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\tconst args = {\n\t\t\t\t\t\t\tpostType: 'wp_navigation',\n\t\t\t\t\t\t};\n\t\t\t\t\t\tconst targetUrl = addQueryArgs(\n\t\t\t\t\t\t\t'site-editor.php',\n\t\t\t\t\t\t\targs\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif ( isSiteEditor ) {\n\t\t\t\t\t\t\thistory.push( args );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.location = targetUrl;\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\tconst args = {\n\t\t\t\t\t\t\tpath: '/wp_global_styles',\n\t\t\t\t\t\t};\n\t\t\t\t\t\tconst targetUrl = addQueryArgs(\n\t\t\t\t\t\t\t'site-editor.php',\n\t\t\t\t\t\t\targs\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif ( isSiteEditor ) {\n\t\t\t\t\t\t\thistory.push( args );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.location = targetUrl;\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\tconst args = {\n\t\t\t\t\t\t\tpostType: 'page',\n\t\t\t\t\t\t};\n\t\t\t\t\t\tconst targetUrl = addQueryArgs(\n\t\t\t\t\t\t\t'site-editor.php',\n\t\t\t\t\t\t\targs\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif ( isSiteEditor ) {\n\t\t\t\t\t\t\thistory.push( args );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.location = targetUrl;\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\tconst args = {\n\t\t\t\t\t\t\tpostType: 'wp_template',\n\t\t\t\t\t\t};\n\t\t\t\t\t\tconst targetUrl = addQueryArgs(\n\t\t\t\t\t\t\t'site-editor.php',\n\t\t\t\t\t\t\targs\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif ( isSiteEditor ) {\n\t\t\t\t\t\t\thistory.push( args );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.location = targetUrl;\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\tconst args = {\n\t\t\t\t\t\t\tpostType: 'wp_block',\n\t\t\t\t\t\t};\n\t\t\t\t\t\tconst targetUrl = addQueryArgs(\n\t\t\t\t\t\t\t'site-editor.php',\n\t\t\t\t\t\t\targs\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif ( isSiteEditor ) {\n\t\t\t\t\t\t\thistory.push( args );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdocument.location = targetUrl;\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,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,GAAGF,SAAS;UAC9B;UACAH,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,EAAEJ,oCAAoC,CAAC,CAAC;IAC5CK,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-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":"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,iBAAiB,CAAE,GAAG1B,QAAQ,CAAE,EAAG,CAAC;EAC5D,MAAM2B,SAAS,GAAGZ,WAAW,CAAEW,iBAAiB,EAAE,GAAI,CAAC;EAEvD3B,SAAS,CAAE,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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.13.0",
|
|
3
|
+
"version": "1.13.1-next.cd6172eb0.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": "
|
|
33
|
-
"@wordpress/commands": "
|
|
34
|
-
"@wordpress/compose": "
|
|
35
|
-
"@wordpress/core-data": "
|
|
36
|
-
"@wordpress/data": "
|
|
37
|
-
"@wordpress/element": "
|
|
38
|
-
"@wordpress/html-entities": "
|
|
39
|
-
"@wordpress/i18n": "
|
|
40
|
-
"@wordpress/icons": "
|
|
41
|
-
"@wordpress/notices": "
|
|
42
|
-
"@wordpress/private-apis": "
|
|
43
|
-
"@wordpress/router": "
|
|
44
|
-
"@wordpress/url": "
|
|
32
|
+
"@wordpress/block-editor": "^14.8.1-next.cd6172eb0.0",
|
|
33
|
+
"@wordpress/commands": "^1.13.1-next.cd6172eb0.0",
|
|
34
|
+
"@wordpress/compose": "^7.13.1-next.cd6172eb0.0",
|
|
35
|
+
"@wordpress/core-data": "^7.13.1-next.cd6172eb0.0",
|
|
36
|
+
"@wordpress/data": "^10.13.1-next.cd6172eb0.0",
|
|
37
|
+
"@wordpress/element": "^6.13.1-next.cd6172eb0.0",
|
|
38
|
+
"@wordpress/html-entities": "^4.13.1-next.cd6172eb0.0",
|
|
39
|
+
"@wordpress/i18n": "^5.13.1-next.cd6172eb0.0",
|
|
40
|
+
"@wordpress/icons": "^10.13.1-next.cd6172eb0.0",
|
|
41
|
+
"@wordpress/notices": "^5.13.1-next.cd6172eb0.0",
|
|
42
|
+
"@wordpress/private-apis": "^1.13.1-next.cd6172eb0.0",
|
|
43
|
+
"@wordpress/router": "^1.13.1-next.cd6172eb0.0",
|
|
44
|
+
"@wordpress/url": "^4.13.1-next.cd6172eb0.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": "4cc93dc1781d8a7bc2bbde265913917920e2bd45"
|
|
54
54
|
}
|
|
@@ -44,11 +44,7 @@ const getAddNewPageCommand = () =>
|
|
|
44
44
|
}
|
|
45
45
|
);
|
|
46
46
|
if ( page?.id ) {
|
|
47
|
-
history.
|
|
48
|
-
postId: page.id,
|
|
49
|
-
postType: 'page',
|
|
50
|
-
canvas: 'edit',
|
|
51
|
-
} );
|
|
47
|
+
history.navigate( `/page/${ page.id }?canvas=edit` );
|
|
52
48
|
}
|
|
53
49
|
} catch ( error ) {
|
|
54
50
|
const errorMessage =
|
|
@@ -136,19 +136,18 @@ const getNavigationCommandLoaderPerPostType = ( postType ) =>
|
|
|
136
136
|
return {
|
|
137
137
|
...command,
|
|
138
138
|
callback: ( { close } ) => {
|
|
139
|
-
const args = {
|
|
140
|
-
postType,
|
|
141
|
-
postId: record.id,
|
|
142
|
-
canvas: 'edit',
|
|
143
|
-
};
|
|
144
|
-
const targetUrl = addQueryArgs(
|
|
145
|
-
'site-editor.php',
|
|
146
|
-
args
|
|
147
|
-
);
|
|
148
139
|
if ( isSiteEditor ) {
|
|
149
|
-
history.
|
|
140
|
+
history.navigate(
|
|
141
|
+
`/${ postType }/${ record.id }?canvas=edit`
|
|
142
|
+
);
|
|
150
143
|
} else {
|
|
151
|
-
document.location =
|
|
144
|
+
document.location = addQueryArgs(
|
|
145
|
+
'site-editor.php',
|
|
146
|
+
{
|
|
147
|
+
p: `/${ postType }/${ record.id }`,
|
|
148
|
+
canvas: 'edit',
|
|
149
|
+
}
|
|
150
|
+
);
|
|
152
151
|
}
|
|
153
152
|
close();
|
|
154
153
|
},
|
|
@@ -220,19 +219,18 @@ const getNavigationCommandLoaderPerTemplate = ( templateType ) =>
|
|
|
220
219
|
: __( '(no title)' ),
|
|
221
220
|
icon: icons[ templateType ],
|
|
222
221
|
callback: ( { close } ) => {
|
|
223
|
-
const args = {
|
|
224
|
-
postType: templateType,
|
|
225
|
-
postId: record.id,
|
|
226
|
-
canvas: 'edit',
|
|
227
|
-
};
|
|
228
|
-
const targetUrl = addQueryArgs(
|
|
229
|
-
'site-editor.php',
|
|
230
|
-
args
|
|
231
|
-
);
|
|
232
222
|
if ( isSiteEditor ) {
|
|
233
|
-
history.
|
|
223
|
+
history.navigate(
|
|
224
|
+
`/${ templateType }/${ record.id }?canvas=edit`
|
|
225
|
+
);
|
|
234
226
|
} else {
|
|
235
|
-
document.location =
|
|
227
|
+
document.location = addQueryArgs(
|
|
228
|
+
'site-editor.php',
|
|
229
|
+
{
|
|
230
|
+
p: `/${ templateType }/${ record.id }`,
|
|
231
|
+
canvas: 'edit',
|
|
232
|
+
}
|
|
233
|
+
);
|
|
236
234
|
}
|
|
237
235
|
close();
|
|
238
236
|
},
|
|
@@ -249,18 +247,19 @@ const getNavigationCommandLoaderPerTemplate = ( templateType ) =>
|
|
|
249
247
|
label: __( 'Template parts' ),
|
|
250
248
|
icon: symbolFilled,
|
|
251
249
|
callback: ( { close } ) => {
|
|
252
|
-
const args = {
|
|
253
|
-
postType: 'wp_template_part',
|
|
254
|
-
categoryId: 'all-parts',
|
|
255
|
-
};
|
|
256
|
-
const targetUrl = addQueryArgs(
|
|
257
|
-
'site-editor.php',
|
|
258
|
-
args
|
|
259
|
-
);
|
|
260
250
|
if ( isSiteEditor ) {
|
|
261
|
-
history.
|
|
251
|
+
history.navigate(
|
|
252
|
+
'/pattern?postType=wp_template_part&categoryId=all-parts'
|
|
253
|
+
);
|
|
262
254
|
} else {
|
|
263
|
-
document.location =
|
|
255
|
+
document.location = addQueryArgs(
|
|
256
|
+
'site-editor.php',
|
|
257
|
+
{
|
|
258
|
+
p: '/pattern',
|
|
259
|
+
postType: 'wp_template_part',
|
|
260
|
+
categoryId: 'all-parts',
|
|
261
|
+
}
|
|
262
|
+
);
|
|
264
263
|
}
|
|
265
264
|
close();
|
|
266
265
|
},
|
|
@@ -303,17 +302,15 @@ const getSiteEditorBasicNavigationCommands = () =>
|
|
|
303
302
|
label: __( 'Navigation' ),
|
|
304
303
|
icon: navigation,
|
|
305
304
|
callback: ( { close } ) => {
|
|
306
|
-
const args = {
|
|
307
|
-
postType: 'wp_navigation',
|
|
308
|
-
};
|
|
309
|
-
const targetUrl = addQueryArgs(
|
|
310
|
-
'site-editor.php',
|
|
311
|
-
args
|
|
312
|
-
);
|
|
313
305
|
if ( isSiteEditor ) {
|
|
314
|
-
history.
|
|
306
|
+
history.navigate( '/navigation' );
|
|
315
307
|
} else {
|
|
316
|
-
document.location =
|
|
308
|
+
document.location = addQueryArgs(
|
|
309
|
+
'site-editor.php',
|
|
310
|
+
{
|
|
311
|
+
p: '/navigation',
|
|
312
|
+
}
|
|
313
|
+
);
|
|
317
314
|
}
|
|
318
315
|
close();
|
|
319
316
|
},
|
|
@@ -324,17 +321,15 @@ const getSiteEditorBasicNavigationCommands = () =>
|
|
|
324
321
|
label: __( 'Styles' ),
|
|
325
322
|
icon: styles,
|
|
326
323
|
callback: ( { close } ) => {
|
|
327
|
-
const args = {
|
|
328
|
-
path: '/wp_global_styles',
|
|
329
|
-
};
|
|
330
|
-
const targetUrl = addQueryArgs(
|
|
331
|
-
'site-editor.php',
|
|
332
|
-
args
|
|
333
|
-
);
|
|
334
324
|
if ( isSiteEditor ) {
|
|
335
|
-
history.
|
|
325
|
+
history.navigate( '/styles' );
|
|
336
326
|
} else {
|
|
337
|
-
document.location =
|
|
327
|
+
document.location = addQueryArgs(
|
|
328
|
+
'site-editor.php',
|
|
329
|
+
{
|
|
330
|
+
p: '/styles',
|
|
331
|
+
}
|
|
332
|
+
);
|
|
338
333
|
}
|
|
339
334
|
close();
|
|
340
335
|
},
|
|
@@ -345,17 +340,15 @@ const getSiteEditorBasicNavigationCommands = () =>
|
|
|
345
340
|
label: __( 'Pages' ),
|
|
346
341
|
icon: page,
|
|
347
342
|
callback: ( { close } ) => {
|
|
348
|
-
const args = {
|
|
349
|
-
postType: 'page',
|
|
350
|
-
};
|
|
351
|
-
const targetUrl = addQueryArgs(
|
|
352
|
-
'site-editor.php',
|
|
353
|
-
args
|
|
354
|
-
);
|
|
355
343
|
if ( isSiteEditor ) {
|
|
356
|
-
history.
|
|
344
|
+
history.navigate( '/page' );
|
|
357
345
|
} else {
|
|
358
|
-
document.location =
|
|
346
|
+
document.location = addQueryArgs(
|
|
347
|
+
'site-editor.php',
|
|
348
|
+
{
|
|
349
|
+
p: '/page',
|
|
350
|
+
}
|
|
351
|
+
);
|
|
359
352
|
}
|
|
360
353
|
close();
|
|
361
354
|
},
|
|
@@ -366,17 +359,15 @@ const getSiteEditorBasicNavigationCommands = () =>
|
|
|
366
359
|
label: __( 'Templates' ),
|
|
367
360
|
icon: layout,
|
|
368
361
|
callback: ( { close } ) => {
|
|
369
|
-
const args = {
|
|
370
|
-
postType: 'wp_template',
|
|
371
|
-
};
|
|
372
|
-
const targetUrl = addQueryArgs(
|
|
373
|
-
'site-editor.php',
|
|
374
|
-
args
|
|
375
|
-
);
|
|
376
362
|
if ( isSiteEditor ) {
|
|
377
|
-
history.
|
|
363
|
+
history.navigate( '/template' );
|
|
378
364
|
} else {
|
|
379
|
-
document.location =
|
|
365
|
+
document.location = addQueryArgs(
|
|
366
|
+
'site-editor.php',
|
|
367
|
+
{
|
|
368
|
+
p: '/template',
|
|
369
|
+
}
|
|
370
|
+
);
|
|
380
371
|
}
|
|
381
372
|
close();
|
|
382
373
|
},
|
|
@@ -389,17 +380,15 @@ const getSiteEditorBasicNavigationCommands = () =>
|
|
|
389
380
|
icon: symbol,
|
|
390
381
|
callback: ( { close } ) => {
|
|
391
382
|
if ( canCreateTemplate ) {
|
|
392
|
-
const args = {
|
|
393
|
-
postType: 'wp_block',
|
|
394
|
-
};
|
|
395
|
-
const targetUrl = addQueryArgs(
|
|
396
|
-
'site-editor.php',
|
|
397
|
-
args
|
|
398
|
-
);
|
|
399
383
|
if ( isSiteEditor ) {
|
|
400
|
-
history.
|
|
384
|
+
history.navigate( '/pattern' );
|
|
401
385
|
} else {
|
|
402
|
-
document.location =
|
|
386
|
+
document.location = addQueryArgs(
|
|
387
|
+
'site-editor.php',
|
|
388
|
+
{
|
|
389
|
+
p: '/pattern',
|
|
390
|
+
}
|
|
391
|
+
);
|
|
403
392
|
}
|
|
404
393
|
close();
|
|
405
394
|
} else {
|