@wordpress/edit-site 5.17.1 → 5.18.1-next.5a1d1283.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/components/app/index.js +1 -1
- package/build/components/app/index.js.map +1 -1
- package/build/components/block-editor/site-editor-canvas.js +3 -3
- package/build/components/block-editor/site-editor-canvas.js.map +1 -1
- package/build/components/{canvas-spinner → canvas-loader}/index.js +3 -3
- package/build/components/canvas-loader/index.js.map +1 -0
- package/build/components/editor/index.js +3 -3
- package/build/components/editor/index.js.map +1 -1
- package/build/components/global-styles/screen-block.js +5 -0
- package/build/components/global-styles/screen-block.js.map +1 -1
- package/build/components/header-edit-mode/index.js +9 -5
- package/build/components/header-edit-mode/index.js.map +1 -1
- package/build/components/header-edit-mode/more-menu/copy-content-menu-item.js +19 -21
- package/build/components/header-edit-mode/more-menu/copy-content-menu-item.js.map +1 -1
- package/build/components/keyboard-shortcuts/edit-mode.js +1 -26
- package/build/components/keyboard-shortcuts/edit-mode.js.map +1 -1
- package/build/components/page-patterns/grid-item.js +2 -2
- package/build/components/page-patterns/grid-item.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/page-status.js +21 -7
- package/build/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js +1 -45
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js +2 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
- package/build/hooks/commands/use-common-commands.js +1 -17
- package/build/hooks/commands/use-common-commands.js.map +1 -1
- package/build/hooks/commands/use-edit-mode-commands.js +33 -21
- package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build/index.js +1 -1
- package/build/index.js.map +1 -1
- package/build/store/actions.js +52 -6
- package/build/store/actions.js.map +1 -1
- package/build/utils/constants.js.map +1 -0
- package/build-module/components/app/index.js +2 -2
- package/build-module/components/app/index.js.map +1 -1
- package/build-module/components/block-editor/site-editor-canvas.js +4 -4
- package/build-module/components/block-editor/site-editor-canvas.js.map +1 -1
- package/build-module/components/{canvas-spinner → canvas-loader}/index.js +2 -2
- package/build-module/components/canvas-loader/index.js.map +1 -0
- package/build-module/components/editor/index.js +3 -3
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/global-styles/screen-block.js +5 -0
- package/build-module/components/global-styles/screen-block.js.map +1 -1
- package/build-module/components/header-edit-mode/index.js +9 -5
- package/build-module/components/header-edit-mode/index.js.map +1 -1
- package/build-module/components/header-edit-mode/more-menu/copy-content-menu-item.js +19 -21
- package/build-module/components/header-edit-mode/more-menu/copy-content-menu-item.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/edit-mode.js +1 -26
- package/build-module/components/keyboard-shortcuts/edit-mode.js.map +1 -1
- package/build-module/components/page-patterns/grid-item.js +3 -3
- package/build-module/components/page-patterns/grid-item.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/page-status.js +23 -8
- package/build-module/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +1 -45
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +2 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
- package/build-module/hooks/commands/use-common-commands.js +1 -17
- package/build-module/hooks/commands/use-common-commands.js.map +1 -1
- package/build-module/hooks/commands/use-edit-mode-commands.js +34 -22
- package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build-module/index.js +1 -1
- package/build-module/index.js.map +1 -1
- package/build-module/store/actions.js +48 -4
- package/build-module/store/actions.js.map +1 -1
- package/build-module/utils/constants.js.map +1 -0
- package/build-style/style-rtl.css +13 -6
- package/build-style/style.css +13 -6
- package/package.json +40 -40
- package/src/components/app/index.js +1 -2
- package/src/components/block-editor/site-editor-canvas.js +2 -9
- package/src/components/{canvas-spinner → canvas-loader}/index.js +2 -2
- package/src/components/{canvas-spinner → canvas-loader}/style.scss +3 -3
- package/src/components/editor/index.js +3 -3
- package/src/components/global-styles/screen-block.js +14 -0
- package/src/components/header-edit-mode/index.js +37 -34
- package/src/components/header-edit-mode/more-menu/copy-content-menu-item.js +20 -21
- package/src/components/keyboard-shortcuts/edit-mode.js +2 -30
- package/src/components/page-patterns/grid-item.js +3 -3
- package/src/components/page-patterns/style.scss +5 -1
- package/src/components/sidebar-edit-mode/page-panels/page-status.js +37 -18
- package/src/components/sidebar-edit-mode/page-panels/style.scss +9 -0
- package/src/components/sidebar-navigation-screen-global-styles/index.js +1 -40
- package/src/components/sidebar-navigation-screen-navigation-menu/more-menu.js +1 -2
- package/src/hooks/commands/use-common-commands.js +0 -22
- package/src/hooks/commands/use-edit-mode-commands.js +43 -32
- package/src/index.js +1 -1
- package/src/store/actions.js +70 -7
- package/src/store/test/actions.js +87 -0
- package/src/store/test/reducer.js +21 -9
- package/src/style.scss +1 -1
- package/build/components/block-editor/constants.js.map +0 -1
- package/build/components/canvas-spinner/index.js.map +0 -1
- package/build-module/components/block-editor/constants.js.map +0 -1
- package/build-module/components/canvas-spinner/index.js.map +0 -1
- /package/build/{components/block-editor → utils}/constants.js +0 -0
- /package/build-module/{components/block-editor → utils}/constants.js +0 -0
- /package/src/{components/block-editor → utils}/constants.js +0 -0
|
@@ -336,12 +336,19 @@ export function updateSettings(settings) {
|
|
|
336
336
|
* @param {boolean} isOpen If true, opens the list view. If false, closes it.
|
|
337
337
|
* It does not toggle the state, but sets it directly.
|
|
338
338
|
*/
|
|
339
|
-
export
|
|
340
|
-
|
|
339
|
+
export const setIsListViewOpened = isOpen => ({
|
|
340
|
+
dispatch,
|
|
341
|
+
registry
|
|
342
|
+
}) => {
|
|
343
|
+
const isDistractionFree = registry.select(preferencesStore).get('core/edit-site', 'distractionFree');
|
|
344
|
+
if (isDistractionFree && isOpen) {
|
|
345
|
+
dispatch.toggleDistractionFree();
|
|
346
|
+
}
|
|
347
|
+
dispatch({
|
|
341
348
|
type: 'SET_IS_LIST_VIEW_OPENED',
|
|
342
349
|
isOpen
|
|
343
|
-
};
|
|
344
|
-
}
|
|
350
|
+
});
|
|
351
|
+
};
|
|
345
352
|
|
|
346
353
|
/**
|
|
347
354
|
* Sets whether the save view panel should be open.
|
|
@@ -451,8 +458,13 @@ export const revertTemplate = (template, {
|
|
|
451
458
|
* @param {?string} name Sidebar name to be opened.
|
|
452
459
|
*/
|
|
453
460
|
export const openGeneralSidebar = name => ({
|
|
461
|
+
dispatch,
|
|
454
462
|
registry
|
|
455
463
|
}) => {
|
|
464
|
+
const isDistractionFree = registry.select(preferencesStore).get('core/edit-site', 'distractionFree');
|
|
465
|
+
if (isDistractionFree) {
|
|
466
|
+
dispatch.toggleDistractionFree();
|
|
467
|
+
}
|
|
456
468
|
registry.dispatch(interfaceStore).enableComplementaryArea(editSiteStoreName, name);
|
|
457
469
|
};
|
|
458
470
|
|
|
@@ -465,6 +477,7 @@ export const closeGeneralSidebar = () => ({
|
|
|
465
477
|
registry.dispatch(interfaceStore).disableComplementaryArea(editSiteStoreName);
|
|
466
478
|
};
|
|
467
479
|
export const switchEditorMode = mode => ({
|
|
480
|
+
dispatch,
|
|
468
481
|
registry
|
|
469
482
|
}) => {
|
|
470
483
|
registry.dispatch('core/preferences').set('core/edit-site', 'editorMode', mode);
|
|
@@ -476,6 +489,10 @@ export const switchEditorMode = mode => ({
|
|
|
476
489
|
if (mode === 'visual') {
|
|
477
490
|
speak(__('Visual editor selected'), 'assertive');
|
|
478
491
|
} else if (mode === 'text') {
|
|
492
|
+
const isDistractionFree = registry.select(preferencesStore).get('core/edit-site', 'distractionFree');
|
|
493
|
+
if (isDistractionFree) {
|
|
494
|
+
dispatch.toggleDistractionFree();
|
|
495
|
+
}
|
|
479
496
|
speak(__('Code editor selected'), 'assertive');
|
|
480
497
|
}
|
|
481
498
|
};
|
|
@@ -499,4 +516,31 @@ export const setHasPageContentFocus = hasPageContentFocus => ({
|
|
|
499
516
|
hasPageContentFocus
|
|
500
517
|
});
|
|
501
518
|
};
|
|
519
|
+
|
|
520
|
+
/**
|
|
521
|
+
* Action that toggles Distraction free mode.
|
|
522
|
+
* Distraction free mode expects there are no sidebars, as due to the
|
|
523
|
+
* z-index values set, you can't close sidebars.
|
|
524
|
+
*/
|
|
525
|
+
export const toggleDistractionFree = () => ({
|
|
526
|
+
dispatch,
|
|
527
|
+
registry
|
|
528
|
+
}) => {
|
|
529
|
+
const isDistractionFree = registry.select(preferencesStore).get('core/edit-site', 'distractionFree');
|
|
530
|
+
if (!isDistractionFree) {
|
|
531
|
+
registry.batch(() => {
|
|
532
|
+
registry.dispatch(preferencesStore).set('core/edit-site', 'fixedToolbar', false);
|
|
533
|
+
dispatch.setIsInserterOpened(false);
|
|
534
|
+
dispatch.setIsListViewOpened(false);
|
|
535
|
+
dispatch.closeGeneralSidebar();
|
|
536
|
+
});
|
|
537
|
+
}
|
|
538
|
+
registry.batch(() => {
|
|
539
|
+
registry.dispatch(preferencesStore).set('core/edit-site', 'distractionFree', !isDistractionFree);
|
|
540
|
+
registry.dispatch(noticesStore).createInfoNotice(isDistractionFree ? __('Distraction free off.') : __('Distraction free on.'), {
|
|
541
|
+
id: 'core/edit-site/distraction-free-mode/notice',
|
|
542
|
+
type: 'snackbar'
|
|
543
|
+
});
|
|
544
|
+
});
|
|
545
|
+
};
|
|
502
546
|
//# sourceMappingURL=actions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["apiFetch","parse","__unstableSerializeAndClean","deprecated","addQueryArgs","getPathAndQueryString","__","sprintf","store","noticesStore","coreStore","interfaceStore","blockEditorStore","speak","preferencesStore","decodeEntities","STORE_NAME","editSiteStoreName","isTemplateRevertable","toggleFeature","featureName","registry","since","alternative","dispatch","toggle","__experimentalSetPreviewDeviceType","deviceType","type","setTemplate","templateId","templateSlug","template","resolveSelect","getEntityRecord","slug","error","postType","id","context","addTemplate","newTemplate","saveEntityRecord","content","editEntityRecord","blocks","undoIgnore","removeTemplate","deleteEntityRecord","force","lastError","select","getLastEntityDeleteError","templateTitle","title","rendered","createSuccessNotice","errorMessage","message","code","createErrorNotice","setTemplatePart","templatePartId","setNavigationMenu","navigationMenuId","setEditedEntity","postId","setHomeTemplateId","version","setEditedPostContext","setPage","page","path","entity","link","__experimentalGetTemplateForLink","setNavigationPanelActiveMenu","openNavigationPanelToMenu","setIsNavigationPanelOpened","setIsInserterOpened","value","updateSettings","settings","setIsListViewOpened","isOpen","setIsSaveViewOpened","revertTemplate","allowUndo","noticeId","removeNotice","templateEntityConfig","getEntityConfig","fileTemplatePath","baseURL","source","fileTemplate","serializeBlocks","blocksForSerialization","edited","getEditedEntityRecord","raw","undoRevert","actions","label","onClick","openGeneralSidebar","name","enableComplementaryArea","closeGeneralSidebar","disableComplementaryArea","switchEditorMode","mode","set","clearSelectedBlock","setHasPageContentFocus","hasPageContentFocus"],"sources":["@wordpress/edit-site/src/store/actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\nimport { parse, __unstableSerializeAndClean } from '@wordpress/blocks';\nimport deprecated from '@wordpress/deprecated';\nimport { addQueryArgs, getPathAndQueryString } from '@wordpress/url';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { speak } from '@wordpress/a11y';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { STORE_NAME as editSiteStoreName } from './constants';\nimport isTemplateRevertable from '../utils/is-template-revertable';\n\n/**\n * Dispatches an action that toggles a feature flag.\n *\n * @param {string} featureName Feature name.\n */\nexport function toggleFeature( featureName ) {\n\treturn function ( { registry } ) {\n\t\tdeprecated( \"select( 'core/edit-site' ).toggleFeature( featureName )\", {\n\t\t\tsince: '6.0',\n\t\t\talternative:\n\t\t\t\t\"select( 'core/preferences').toggle( 'core/edit-site', featureName )\",\n\t\t} );\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.toggle( 'core/edit-site', featureName );\n\t};\n}\n\n/**\n * Action that changes the width of the editing canvas.\n *\n * @param {string} deviceType\n *\n * @return {Object} Action object.\n */\nexport function __experimentalSetPreviewDeviceType( deviceType ) {\n\treturn {\n\t\ttype: 'SET_PREVIEW_DEVICE_TYPE',\n\t\tdeviceType,\n\t};\n}\n\n/**\n * Action that sets a template, optionally fetching it from REST API.\n *\n * @param {number} templateId The template ID.\n * @param {string} templateSlug The template slug.\n * @return {Object} Action object.\n */\nexport const setTemplate =\n\t( templateId, templateSlug ) =>\n\tasync ( { dispatch, registry } ) => {\n\t\tif ( ! templateSlug ) {\n\t\t\ttry {\n\t\t\t\tconst template = await registry\n\t\t\t\t\t.resolveSelect( coreStore )\n\t\t\t\t\t.getEntityRecord( 'postType', 'wp_template', templateId );\n\t\t\t\ttemplateSlug = template?.slug;\n\t\t\t} catch ( error ) {}\n\t\t}\n\n\t\tdispatch( {\n\t\t\ttype: 'SET_EDITED_POST',\n\t\t\tpostType: 'wp_template',\n\t\t\tid: templateId,\n\t\t\tcontext: { templateSlug },\n\t\t} );\n\t};\n\n/**\n * Action that adds a new template and sets it as the current template.\n *\n * @param {Object} template The template.\n *\n * @return {Object} Action object used to set the current template.\n */\nexport const addTemplate =\n\t( template ) =>\n\tasync ( { dispatch, registry } ) => {\n\t\tconst newTemplate = await registry\n\t\t\t.dispatch( coreStore )\n\t\t\t.saveEntityRecord( 'postType', 'wp_template', template );\n\n\t\tif ( template.content ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( coreStore )\n\t\t\t\t.editEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'wp_template',\n\t\t\t\t\tnewTemplate.id,\n\t\t\t\t\t{ blocks: parse( template.content ) },\n\t\t\t\t\t{ undoIgnore: true }\n\t\t\t\t);\n\t\t}\n\n\t\tdispatch( {\n\t\t\ttype: 'SET_EDITED_POST',\n\t\t\tpostType: 'wp_template',\n\t\t\tid: newTemplate.id,\n\t\t\tcontext: { templateSlug: newTemplate.slug },\n\t\t} );\n\t};\n\n/**\n * Action that removes a template.\n *\n * @param {Object} template The template object.\n */\nexport const removeTemplate =\n\t( template ) =>\n\tasync ( { registry } ) => {\n\t\ttry {\n\t\t\tawait registry\n\t\t\t\t.dispatch( coreStore )\n\t\t\t\t.deleteEntityRecord( 'postType', template.type, template.id, {\n\t\t\t\t\tforce: true,\n\t\t\t\t} );\n\n\t\t\tconst lastError = registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getLastEntityDeleteError(\n\t\t\t\t\t'postType',\n\t\t\t\t\ttemplate.type,\n\t\t\t\t\ttemplate.id\n\t\t\t\t);\n\n\t\t\tif ( lastError ) {\n\t\t\t\tthrow lastError;\n\t\t\t}\n\n\t\t\t// Depending on how the entity was retrieved it's title might be\n\t\t\t// an object or simple string.\n\t\t\tconst templateTitle =\n\t\t\t\ttypeof template.title === 'string'\n\t\t\t\t\t? template.title\n\t\t\t\t\t: template.title?.rendered;\n\n\t\t\tregistry.dispatch( noticesStore ).createSuccessNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: The template/part's name. */\n\t\t\t\t\t__( '\"%s\" deleted.' ),\n\t\t\t\t\tdecodeEntities( templateTitle )\n\t\t\t\t),\n\t\t\t\t{ type: 'snackbar', id: 'site-editor-template-deleted-success' }\n\t\t\t);\n\t\t} catch ( error ) {\n\t\t\tconst errorMessage =\n\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t? error.message\n\t\t\t\t\t: __( 'An error occurred while deleting the template.' );\n\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice( errorMessage, { type: 'snackbar' } );\n\t\t}\n\t};\n\n/**\n * Action that sets a template part.\n *\n * @param {string} templatePartId The template part ID.\n *\n * @return {Object} Action object.\n */\nexport function setTemplatePart( templatePartId ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST',\n\t\tpostType: 'wp_template_part',\n\t\tid: templatePartId,\n\t};\n}\n\n/**\n * Action that sets a navigation menu.\n *\n * @param {string} navigationMenuId The Navigation Menu Post ID.\n *\n * @return {Object} Action object.\n */\nexport function setNavigationMenu( navigationMenuId ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST',\n\t\tpostType: 'wp_navigation',\n\t\tid: navigationMenuId,\n\t};\n}\n\n/**\n * Action that sets an edited entity.\n *\n * @param {string} postType The entity's post type.\n * @param {string} postId The entity's ID.\n *\n * @return {Object} Action object.\n */\nexport function setEditedEntity( postType, postId ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST',\n\t\tpostType,\n\t\tid: postId,\n\t};\n}\n\n/**\n * @deprecated\n */\nexport function setHomeTemplateId() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setHomeTemplateId\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn {\n\t\ttype: 'NOTHING',\n\t};\n}\n\n/**\n * Set's the current block editor context.\n *\n * @param {Object} context The context object.\n *\n * @return {number} The resolved template ID for the page route.\n */\nexport function setEditedPostContext( context ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST_CONTEXT',\n\t\tcontext,\n\t};\n}\n\n/**\n * Resolves the template for a page and displays both. If no path is given, attempts\n * to use the postId to generate a path like `?p=${ postId }`.\n *\n * @param {Object} page The page object.\n * @param {string} page.type The page type.\n * @param {string} page.slug The page slug.\n * @param {string} page.path The page path.\n * @param {Object} page.context The page context.\n *\n * @return {number} The resolved template ID for the page route.\n */\nexport const setPage =\n\t( page ) =>\n\tasync ( { dispatch, registry } ) => {\n\t\tif ( ! page.path && page.context?.postId ) {\n\t\t\tconst entity = await registry\n\t\t\t\t.resolveSelect( coreStore )\n\t\t\t\t.getEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpage.context.postType || 'post',\n\t\t\t\t\tpage.context.postId\n\t\t\t\t);\n\t\t\t// If the entity is undefined for some reason, path will resolve to \"/\"\n\t\t\tpage.path = getPathAndQueryString( entity?.link );\n\t\t}\n\n\t\tconst template = await registry\n\t\t\t.resolveSelect( coreStore )\n\t\t\t.__experimentalGetTemplateForLink( page.path );\n\n\t\tif ( ! template ) {\n\t\t\treturn;\n\t\t}\n\n\t\tdispatch( {\n\t\t\ttype: 'SET_EDITED_POST',\n\t\t\tpostType: 'wp_template',\n\t\t\tid: template.id,\n\t\t\tcontext: {\n\t\t\t\t...page.context,\n\t\t\t\ttemplateSlug: template.slug,\n\t\t\t},\n\t\t} );\n\n\t\treturn template.id;\n\t};\n\n/**\n * Action that sets the active navigation panel menu.\n *\n * @deprecated\n *\n * @return {Object} Action object.\n */\nexport function setNavigationPanelActiveMenu() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setNavigationPanelActiveMenu\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Opens the navigation panel and sets its active menu at the same time.\n *\n * @deprecated\n */\nexport function openNavigationPanelToMenu() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).openNavigationPanelToMenu\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Sets whether the navigation panel should be open.\n *\n * @deprecated\n */\nexport function setIsNavigationPanelOpened() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setIsNavigationPanelOpened\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Opens or closes the inserter.\n *\n * @param {boolean|Object} value Whether the inserter should be\n * opened (true) or closed (false).\n * To specify an insertion point,\n * use an object.\n * @param {string} value.rootClientId The root client ID to insert at.\n * @param {number} value.insertionIndex The index to insert at.\n *\n * @return {Object} Action object.\n */\nexport function setIsInserterOpened( value ) {\n\treturn {\n\t\ttype: 'SET_IS_INSERTER_OPENED',\n\t\tvalue,\n\t};\n}\n\n/**\n * Returns an action object used to update the settings.\n *\n * @param {Object} settings New settings.\n *\n * @return {Object} Action object.\n */\nexport function updateSettings( settings ) {\n\treturn {\n\t\ttype: 'UPDATE_SETTINGS',\n\t\tsettings,\n\t};\n}\n\n/**\n * Sets whether the list view panel should be open.\n *\n * @param {boolean} isOpen If true, opens the list view. If false, closes it.\n * It does not toggle the state, but sets it directly.\n */\nexport function setIsListViewOpened( isOpen ) {\n\treturn {\n\t\ttype: 'SET_IS_LIST_VIEW_OPENED',\n\t\tisOpen,\n\t};\n}\n\n/**\n * Sets whether the save view panel should be open.\n *\n * @param {boolean} isOpen If true, opens the save view. If false, closes it.\n * It does not toggle the state, but sets it directly.\n */\nexport function setIsSaveViewOpened( isOpen ) {\n\treturn {\n\t\ttype: 'SET_IS_SAVE_VIEW_OPENED',\n\t\tisOpen,\n\t};\n}\n\n/**\n * Reverts a template to its original theme-provided file.\n *\n * @param {Object} template The template to revert.\n * @param {Object} [options]\n * @param {boolean} [options.allowUndo] Whether to allow the user to undo\n * reverting the template. Default true.\n */\nexport const revertTemplate =\n\t( template, { allowUndo = true } = {} ) =>\n\tasync ( { registry } ) => {\n\t\tconst noticeId = 'edit-site-template-reverted';\n\t\tregistry.dispatch( noticesStore ).removeNotice( noticeId );\n\t\tif ( ! isTemplateRevertable( template ) ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice( __( 'This template is not revertable.' ), {\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t} );\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tconst templateEntityConfig = registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getEntityConfig( 'postType', template.type );\n\n\t\t\tif ( ! templateEntityConfig ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createErrorNotice(\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'The editor has encountered an unexpected error. Please reload.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{ type: 'snackbar' }\n\t\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst fileTemplatePath = addQueryArgs(\n\t\t\t\t`${ templateEntityConfig.baseURL }/${ template.id }`,\n\t\t\t\t{ context: 'edit', source: 'theme' }\n\t\t\t);\n\n\t\t\tconst fileTemplate = await apiFetch( { path: fileTemplatePath } );\n\t\t\tif ( ! fileTemplate ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createErrorNotice(\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'The editor has encountered an unexpected error. Please reload.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{ type: 'snackbar' }\n\t\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst serializeBlocks = ( {\n\t\t\t\tblocks: blocksForSerialization = [],\n\t\t\t} ) => __unstableSerializeAndClean( blocksForSerialization );\n\n\t\t\tconst edited = registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getEditedEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\ttemplate.type,\n\t\t\t\t\ttemplate.id\n\t\t\t\t);\n\n\t\t\t// We are fixing up the undo level here to make sure we can undo\n\t\t\t// the revert in the header toolbar correctly.\n\t\t\tregistry.dispatch( coreStore ).editEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\ttemplate.type,\n\t\t\t\ttemplate.id,\n\t\t\t\t{\n\t\t\t\t\tcontent: serializeBlocks, // Required to make the `undo` behave correctly.\n\t\t\t\t\tblocks: edited.blocks, // Required to revert the blocks in the editor.\n\t\t\t\t\tsource: 'custom', // required to avoid turning the editor into a dirty state\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tundoIgnore: true, // Required to merge this edit with the last undo level.\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tconst blocks = parse( fileTemplate?.content?.raw );\n\t\t\tregistry\n\t\t\t\t.dispatch( coreStore )\n\t\t\t\t.editEntityRecord( 'postType', template.type, fileTemplate.id, {\n\t\t\t\t\tcontent: serializeBlocks,\n\t\t\t\t\tblocks,\n\t\t\t\t\tsource: 'theme',\n\t\t\t\t} );\n\n\t\t\tif ( allowUndo ) {\n\t\t\t\tconst undoRevert = () => {\n\t\t\t\t\tregistry\n\t\t\t\t\t\t.dispatch( coreStore )\n\t\t\t\t\t\t.editEntityRecord(\n\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\ttemplate.type,\n\t\t\t\t\t\t\tedited.id,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcontent: serializeBlocks,\n\t\t\t\t\t\t\t\tblocks: edited.blocks,\n\t\t\t\t\t\t\t\tsource: 'custom',\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t};\n\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createSuccessNotice( __( 'Template reverted.' ), {\n\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\tid: noticeId,\n\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\t\t\t\t\t\t\t\tonClick: undoRevert,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t} );\n\t\t\t}\n\t\t} catch ( error ) {\n\t\t\tconst errorMessage =\n\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t? error.message\n\t\t\t\t\t: __( 'Template revert failed. Please reload.' );\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice( errorMessage, { type: 'snackbar' } );\n\t\t}\n\t};\n/**\n * Action that opens an editor sidebar.\n *\n * @param {?string} name Sidebar name to be opened.\n */\nexport const openGeneralSidebar =\n\t( name ) =>\n\t( { registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( interfaceStore )\n\t\t\t.enableComplementaryArea( editSiteStoreName, name );\n\t};\n\n/**\n * Action that closes the sidebar.\n */\nexport const closeGeneralSidebar =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( interfaceStore )\n\t\t\t.disableComplementaryArea( editSiteStoreName );\n\t};\n\nexport const switchEditorMode =\n\t( mode ) =>\n\t( { registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( 'core/preferences' )\n\t\t\t.set( 'core/edit-site', 'editorMode', mode );\n\n\t\t// Unselect blocks when we switch to a non visual mode.\n\t\tif ( mode !== 'visual' ) {\n\t\t\tregistry.dispatch( blockEditorStore ).clearSelectedBlock();\n\t\t}\n\n\t\tif ( mode === 'visual' ) {\n\t\t\tspeak( __( 'Visual editor selected' ), 'assertive' );\n\t\t} else if ( mode === 'text' ) {\n\t\t\tspeak( __( 'Code editor selected' ), 'assertive' );\n\t\t}\n\t};\n\n/**\n * Sets whether or not the editor allows only page content to be edited.\n *\n * @param {boolean} hasPageContentFocus True to allow only page content to be\n * edited, false to allow template to be\n * edited.\n */\nexport const setHasPageContentFocus =\n\t( hasPageContentFocus ) =>\n\t( { dispatch, registry } ) => {\n\t\tif ( hasPageContentFocus ) {\n\t\t\tregistry.dispatch( blockEditorStore ).clearSelectedBlock();\n\t\t}\n\t\tdispatch( {\n\t\t\ttype: 'SET_HAS_PAGE_CONTENT_FOCUS',\n\t\t\thasPageContentFocus,\n\t\t} );\n\t};\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,QAAQ,MAAM,sBAAsB;AAC3C,SAASC,KAAK,EAAEC,2BAA2B,QAAQ,mBAAmB;AACtE,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,YAAY,EAAEC,qBAAqB,QAAQ,gBAAgB;AACpE,SAASC,EAAE,E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iBAAiB,EAAEyF,IAAK,CAAC;AACrD,CAAC;;AAEF;AACA;AACA;AACA,OAAO,MAAME,mBAAmB,GAC/BA,CAAA,KACA,CAAE;EAAEvF;AAAS,CAAC,KAAM;EACnBA,QAAQ,CACNG,QAAQ,CAAEb,cAAe,CAAC,CAC1BkG,wBAAwB,CAAE5F,iBAAkB,CAAC;AAChD,CAAC;AAEF,OAAO,MAAM6F,gBAAgB,GAC1BC,IAAI,IACN,CAAE;EAAE1F;AAAS,CAAC,KAAM;EACnBA,QAAQ,CACNG,QAAQ,CAAE,kBAAmB,CAAC,CAC9BwF,GAAG,CAAE,gBAAgB,EAAE,YAAY,EAAED,IAAK,CAAC;;EAE7C;EACA,IAAKA,IAAI,KAAK,QAAQ,EAAG;IACxB1F,QAAQ,CAACG,QAAQ,CAAEZ,gBAAiB,CAAC,CAACqG,kBAAkB,CAAC,CAAC;EAC3D;EAEA,IAAKF,IAAI,KAAK,QAAQ,EAAG;IACxBlG,KAAK,CAAEP,EAAE,CAAE,wBAAyB,CAAC,EAAE,WAAY,CAAC;EACrD,CAAC,MAAM,IAAKyG,IAAI,KAAK,MAAM,EAAG;IAC7BlG,KAAK,CAAEP,EAAE,CAAE,sBAAuB,CAAC,EAAE,WAAY,CAAC;EACnD;AACD,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAM4G,sBAAsB,GAChCC,mBAAmB,IACrB,CAAE;EAAE3F,QAAQ;EAAEH;AAAS,CAAC,KAAM;EAC7B,IAAK8F,mBAAmB,EAAG;IAC1B9F,QAAQ,CAACG,QAAQ,CAAEZ,gBAAiB,CAAC,CAACqG,kBAAkB,CAAC,CAAC;EAC3D;EACAzF,QAAQ,CAAE;IACTI,IAAI,EAAE,4BAA4B;IAClCuF;EACD,CAAE,CAAC;AACJ,CAAC"}
|
|
1
|
+
{"version":3,"names":["apiFetch","parse","__unstableSerializeAndClean","deprecated","addQueryArgs","getPathAndQueryString","__","sprintf","store","noticesStore","coreStore","interfaceStore","blockEditorStore","speak","preferencesStore","decodeEntities","STORE_NAME","editSiteStoreName","isTemplateRevertable","toggleFeature","featureName","registry","since","alternative","dispatch","toggle","__experimentalSetPreviewDeviceType","deviceType","type","setTemplate","templateId","templateSlug","template","resolveSelect","getEntityRecord","slug","error","postType","id","context","addTemplate","newTemplate","saveEntityRecord","content","editEntityRecord","blocks","undoIgnore","removeTemplate","deleteEntityRecord","force","lastError","select","getLastEntityDeleteError","templateTitle","title","rendered","createSuccessNotice","errorMessage","message","code","createErrorNotice","setTemplatePart","templatePartId","setNavigationMenu","navigationMenuId","setEditedEntity","postId","setHomeTemplateId","version","setEditedPostContext","setPage","page","path","entity","link","__experimentalGetTemplateForLink","setNavigationPanelActiveMenu","openNavigationPanelToMenu","setIsNavigationPanelOpened","setIsInserterOpened","value","updateSettings","settings","setIsListViewOpened","isOpen","isDistractionFree","get","toggleDistractionFree","setIsSaveViewOpened","revertTemplate","allowUndo","noticeId","removeNotice","templateEntityConfig","getEntityConfig","fileTemplatePath","baseURL","source","fileTemplate","serializeBlocks","blocksForSerialization","edited","getEditedEntityRecord","raw","undoRevert","actions","label","onClick","openGeneralSidebar","name","enableComplementaryArea","closeGeneralSidebar","disableComplementaryArea","switchEditorMode","mode","set","clearSelectedBlock","setHasPageContentFocus","hasPageContentFocus","batch","createInfoNotice"],"sources":["@wordpress/edit-site/src/store/actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\nimport { parse, __unstableSerializeAndClean } from '@wordpress/blocks';\nimport deprecated from '@wordpress/deprecated';\nimport { addQueryArgs, getPathAndQueryString } from '@wordpress/url';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { speak } from '@wordpress/a11y';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { STORE_NAME as editSiteStoreName } from './constants';\nimport isTemplateRevertable from '../utils/is-template-revertable';\n\n/**\n * Dispatches an action that toggles a feature flag.\n *\n * @param {string} featureName Feature name.\n */\nexport function toggleFeature( featureName ) {\n\treturn function ( { registry } ) {\n\t\tdeprecated( \"select( 'core/edit-site' ).toggleFeature( featureName )\", {\n\t\t\tsince: '6.0',\n\t\t\talternative:\n\t\t\t\t\"select( 'core/preferences').toggle( 'core/edit-site', featureName )\",\n\t\t} );\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.toggle( 'core/edit-site', featureName );\n\t};\n}\n\n/**\n * Action that changes the width of the editing canvas.\n *\n * @param {string} deviceType\n *\n * @return {Object} Action object.\n */\nexport function __experimentalSetPreviewDeviceType( deviceType ) {\n\treturn {\n\t\ttype: 'SET_PREVIEW_DEVICE_TYPE',\n\t\tdeviceType,\n\t};\n}\n\n/**\n * Action that sets a template, optionally fetching it from REST API.\n *\n * @param {number} templateId The template ID.\n * @param {string} templateSlug The template slug.\n * @return {Object} Action object.\n */\nexport const setTemplate =\n\t( templateId, templateSlug ) =>\n\tasync ( { dispatch, registry } ) => {\n\t\tif ( ! templateSlug ) {\n\t\t\ttry {\n\t\t\t\tconst template = await registry\n\t\t\t\t\t.resolveSelect( coreStore )\n\t\t\t\t\t.getEntityRecord( 'postType', 'wp_template', templateId );\n\t\t\t\ttemplateSlug = template?.slug;\n\t\t\t} catch ( error ) {}\n\t\t}\n\n\t\tdispatch( {\n\t\t\ttype: 'SET_EDITED_POST',\n\t\t\tpostType: 'wp_template',\n\t\t\tid: templateId,\n\t\t\tcontext: { templateSlug },\n\t\t} );\n\t};\n\n/**\n * Action that adds a new template and sets it as the current template.\n *\n * @param {Object} template The template.\n *\n * @return {Object} Action object used to set the current template.\n */\nexport const addTemplate =\n\t( template ) =>\n\tasync ( { dispatch, registry } ) => {\n\t\tconst newTemplate = await registry\n\t\t\t.dispatch( coreStore )\n\t\t\t.saveEntityRecord( 'postType', 'wp_template', template );\n\n\t\tif ( template.content ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( coreStore )\n\t\t\t\t.editEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'wp_template',\n\t\t\t\t\tnewTemplate.id,\n\t\t\t\t\t{ blocks: parse( template.content ) },\n\t\t\t\t\t{ undoIgnore: true }\n\t\t\t\t);\n\t\t}\n\n\t\tdispatch( {\n\t\t\ttype: 'SET_EDITED_POST',\n\t\t\tpostType: 'wp_template',\n\t\t\tid: newTemplate.id,\n\t\t\tcontext: { templateSlug: newTemplate.slug },\n\t\t} );\n\t};\n\n/**\n * Action that removes a template.\n *\n * @param {Object} template The template object.\n */\nexport const removeTemplate =\n\t( template ) =>\n\tasync ( { registry } ) => {\n\t\ttry {\n\t\t\tawait registry\n\t\t\t\t.dispatch( coreStore )\n\t\t\t\t.deleteEntityRecord( 'postType', template.type, template.id, {\n\t\t\t\t\tforce: true,\n\t\t\t\t} );\n\n\t\t\tconst lastError = registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getLastEntityDeleteError(\n\t\t\t\t\t'postType',\n\t\t\t\t\ttemplate.type,\n\t\t\t\t\ttemplate.id\n\t\t\t\t);\n\n\t\t\tif ( lastError ) {\n\t\t\t\tthrow lastError;\n\t\t\t}\n\n\t\t\t// Depending on how the entity was retrieved it's title might be\n\t\t\t// an object or simple string.\n\t\t\tconst templateTitle =\n\t\t\t\ttypeof template.title === 'string'\n\t\t\t\t\t? template.title\n\t\t\t\t\t: template.title?.rendered;\n\n\t\t\tregistry.dispatch( noticesStore ).createSuccessNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: The template/part's name. */\n\t\t\t\t\t__( '\"%s\" deleted.' ),\n\t\t\t\t\tdecodeEntities( templateTitle )\n\t\t\t\t),\n\t\t\t\t{ type: 'snackbar', id: 'site-editor-template-deleted-success' }\n\t\t\t);\n\t\t} catch ( error ) {\n\t\t\tconst errorMessage =\n\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t? error.message\n\t\t\t\t\t: __( 'An error occurred while deleting the template.' );\n\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice( errorMessage, { type: 'snackbar' } );\n\t\t}\n\t};\n\n/**\n * Action that sets a template part.\n *\n * @param {string} templatePartId The template part ID.\n *\n * @return {Object} Action object.\n */\nexport function setTemplatePart( templatePartId ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST',\n\t\tpostType: 'wp_template_part',\n\t\tid: templatePartId,\n\t};\n}\n\n/**\n * Action that sets a navigation menu.\n *\n * @param {string} navigationMenuId The Navigation Menu Post ID.\n *\n * @return {Object} Action object.\n */\nexport function setNavigationMenu( navigationMenuId ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST',\n\t\tpostType: 'wp_navigation',\n\t\tid: navigationMenuId,\n\t};\n}\n\n/**\n * Action that sets an edited entity.\n *\n * @param {string} postType The entity's post type.\n * @param {string} postId The entity's ID.\n *\n * @return {Object} Action object.\n */\nexport function setEditedEntity( postType, postId ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST',\n\t\tpostType,\n\t\tid: postId,\n\t};\n}\n\n/**\n * @deprecated\n */\nexport function setHomeTemplateId() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setHomeTemplateId\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn {\n\t\ttype: 'NOTHING',\n\t};\n}\n\n/**\n * Set's the current block editor context.\n *\n * @param {Object} context The context object.\n *\n * @return {number} The resolved template ID for the page route.\n */\nexport function setEditedPostContext( context ) {\n\treturn {\n\t\ttype: 'SET_EDITED_POST_CONTEXT',\n\t\tcontext,\n\t};\n}\n\n/**\n * Resolves the template for a page and displays both. If no path is given, attempts\n * to use the postId to generate a path like `?p=${ postId }`.\n *\n * @param {Object} page The page object.\n * @param {string} page.type The page type.\n * @param {string} page.slug The page slug.\n * @param {string} page.path The page path.\n * @param {Object} page.context The page context.\n *\n * @return {number} The resolved template ID for the page route.\n */\nexport const setPage =\n\t( page ) =>\n\tasync ( { dispatch, registry } ) => {\n\t\tif ( ! page.path && page.context?.postId ) {\n\t\t\tconst entity = await registry\n\t\t\t\t.resolveSelect( coreStore )\n\t\t\t\t.getEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpage.context.postType || 'post',\n\t\t\t\t\tpage.context.postId\n\t\t\t\t);\n\t\t\t// If the entity is undefined for some reason, path will resolve to \"/\"\n\t\t\tpage.path = getPathAndQueryString( entity?.link );\n\t\t}\n\n\t\tconst template = await registry\n\t\t\t.resolveSelect( coreStore )\n\t\t\t.__experimentalGetTemplateForLink( page.path );\n\n\t\tif ( ! template ) {\n\t\t\treturn;\n\t\t}\n\n\t\tdispatch( {\n\t\t\ttype: 'SET_EDITED_POST',\n\t\t\tpostType: 'wp_template',\n\t\t\tid: template.id,\n\t\t\tcontext: {\n\t\t\t\t...page.context,\n\t\t\t\ttemplateSlug: template.slug,\n\t\t\t},\n\t\t} );\n\n\t\treturn template.id;\n\t};\n\n/**\n * Action that sets the active navigation panel menu.\n *\n * @deprecated\n *\n * @return {Object} Action object.\n */\nexport function setNavigationPanelActiveMenu() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setNavigationPanelActiveMenu\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Opens the navigation panel and sets its active menu at the same time.\n *\n * @deprecated\n */\nexport function openNavigationPanelToMenu() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).openNavigationPanelToMenu\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Sets whether the navigation panel should be open.\n *\n * @deprecated\n */\nexport function setIsNavigationPanelOpened() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).setIsNavigationPanelOpened\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Opens or closes the inserter.\n *\n * @param {boolean|Object} value Whether the inserter should be\n * opened (true) or closed (false).\n * To specify an insertion point,\n * use an object.\n * @param {string} value.rootClientId The root client ID to insert at.\n * @param {number} value.insertionIndex The index to insert at.\n *\n * @return {Object} Action object.\n */\nexport function setIsInserterOpened( value ) {\n\treturn {\n\t\ttype: 'SET_IS_INSERTER_OPENED',\n\t\tvalue,\n\t};\n}\n\n/**\n * Returns an action object used to update the settings.\n *\n * @param {Object} settings New settings.\n *\n * @return {Object} Action object.\n */\nexport function updateSettings( settings ) {\n\treturn {\n\t\ttype: 'UPDATE_SETTINGS',\n\t\tsettings,\n\t};\n}\n\n/**\n * Sets whether the list view panel should be open.\n *\n * @param {boolean} isOpen If true, opens the list view. If false, closes it.\n * It does not toggle the state, but sets it directly.\n */\nexport const setIsListViewOpened =\n\t( isOpen ) =>\n\t( { dispatch, registry } ) => {\n\t\tconst isDistractionFree = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( 'core/edit-site', 'distractionFree' );\n\t\tif ( isDistractionFree && isOpen ) {\n\t\t\tdispatch.toggleDistractionFree();\n\t\t}\n\t\tdispatch( {\n\t\t\ttype: 'SET_IS_LIST_VIEW_OPENED',\n\t\t\tisOpen,\n\t\t} );\n\t};\n\n/**\n * Sets whether the save view panel should be open.\n *\n * @param {boolean} isOpen If true, opens the save view. If false, closes it.\n * It does not toggle the state, but sets it directly.\n */\nexport function setIsSaveViewOpened( isOpen ) {\n\treturn {\n\t\ttype: 'SET_IS_SAVE_VIEW_OPENED',\n\t\tisOpen,\n\t};\n}\n\n/**\n * Reverts a template to its original theme-provided file.\n *\n * @param {Object} template The template to revert.\n * @param {Object} [options]\n * @param {boolean} [options.allowUndo] Whether to allow the user to undo\n * reverting the template. Default true.\n */\nexport const revertTemplate =\n\t( template, { allowUndo = true } = {} ) =>\n\tasync ( { registry } ) => {\n\t\tconst noticeId = 'edit-site-template-reverted';\n\t\tregistry.dispatch( noticesStore ).removeNotice( noticeId );\n\t\tif ( ! isTemplateRevertable( template ) ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice( __( 'This template is not revertable.' ), {\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t} );\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tconst templateEntityConfig = registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getEntityConfig( 'postType', template.type );\n\n\t\t\tif ( ! templateEntityConfig ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createErrorNotice(\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'The editor has encountered an unexpected error. Please reload.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{ type: 'snackbar' }\n\t\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst fileTemplatePath = addQueryArgs(\n\t\t\t\t`${ templateEntityConfig.baseURL }/${ template.id }`,\n\t\t\t\t{ context: 'edit', source: 'theme' }\n\t\t\t);\n\n\t\t\tconst fileTemplate = await apiFetch( { path: fileTemplatePath } );\n\t\t\tif ( ! fileTemplate ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createErrorNotice(\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'The editor has encountered an unexpected error. Please reload.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{ type: 'snackbar' }\n\t\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst serializeBlocks = ( {\n\t\t\t\tblocks: blocksForSerialization = [],\n\t\t\t} ) => __unstableSerializeAndClean( blocksForSerialization );\n\n\t\t\tconst edited = registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getEditedEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\ttemplate.type,\n\t\t\t\t\ttemplate.id\n\t\t\t\t);\n\n\t\t\t// We are fixing up the undo level here to make sure we can undo\n\t\t\t// the revert in the header toolbar correctly.\n\t\t\tregistry.dispatch( coreStore ).editEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\ttemplate.type,\n\t\t\t\ttemplate.id,\n\t\t\t\t{\n\t\t\t\t\tcontent: serializeBlocks, // Required to make the `undo` behave correctly.\n\t\t\t\t\tblocks: edited.blocks, // Required to revert the blocks in the editor.\n\t\t\t\t\tsource: 'custom', // required to avoid turning the editor into a dirty state\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tundoIgnore: true, // Required to merge this edit with the last undo level.\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tconst blocks = parse( fileTemplate?.content?.raw );\n\t\t\tregistry\n\t\t\t\t.dispatch( coreStore )\n\t\t\t\t.editEntityRecord( 'postType', template.type, fileTemplate.id, {\n\t\t\t\t\tcontent: serializeBlocks,\n\t\t\t\t\tblocks,\n\t\t\t\t\tsource: 'theme',\n\t\t\t\t} );\n\n\t\t\tif ( allowUndo ) {\n\t\t\t\tconst undoRevert = () => {\n\t\t\t\t\tregistry\n\t\t\t\t\t\t.dispatch( coreStore )\n\t\t\t\t\t\t.editEntityRecord(\n\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\ttemplate.type,\n\t\t\t\t\t\t\tedited.id,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcontent: serializeBlocks,\n\t\t\t\t\t\t\t\tblocks: edited.blocks,\n\t\t\t\t\t\t\t\tsource: 'custom',\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t};\n\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createSuccessNotice( __( 'Template reverted.' ), {\n\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\tid: noticeId,\n\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\t\t\t\t\t\t\t\tonClick: undoRevert,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t} );\n\t\t\t}\n\t\t} catch ( error ) {\n\t\t\tconst errorMessage =\n\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t? error.message\n\t\t\t\t\t: __( 'Template revert failed. Please reload.' );\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice( errorMessage, { type: 'snackbar' } );\n\t\t}\n\t};\n/**\n * Action that opens an editor sidebar.\n *\n * @param {?string} name Sidebar name to be opened.\n */\nexport const openGeneralSidebar =\n\t( name ) =>\n\t( { dispatch, registry } ) => {\n\t\tconst isDistractionFree = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( 'core/edit-site', 'distractionFree' );\n\t\tif ( isDistractionFree ) {\n\t\t\tdispatch.toggleDistractionFree();\n\t\t}\n\t\tregistry\n\t\t\t.dispatch( interfaceStore )\n\t\t\t.enableComplementaryArea( editSiteStoreName, name );\n\t};\n\n/**\n * Action that closes the sidebar.\n */\nexport const closeGeneralSidebar =\n\t() =>\n\t( { registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( interfaceStore )\n\t\t\t.disableComplementaryArea( editSiteStoreName );\n\t};\n\nexport const switchEditorMode =\n\t( mode ) =>\n\t( { dispatch, registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( 'core/preferences' )\n\t\t\t.set( 'core/edit-site', 'editorMode', mode );\n\n\t\t// Unselect blocks when we switch to a non visual mode.\n\t\tif ( mode !== 'visual' ) {\n\t\t\tregistry.dispatch( blockEditorStore ).clearSelectedBlock();\n\t\t}\n\n\t\tif ( mode === 'visual' ) {\n\t\t\tspeak( __( 'Visual editor selected' ), 'assertive' );\n\t\t} else if ( mode === 'text' ) {\n\t\t\tconst isDistractionFree = registry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core/edit-site', 'distractionFree' );\n\t\t\tif ( isDistractionFree ) {\n\t\t\t\tdispatch.toggleDistractionFree();\n\t\t\t}\n\t\t\tspeak( __( 'Code editor selected' ), 'assertive' );\n\t\t}\n\t};\n\n/**\n * Sets whether or not the editor allows only page content to be edited.\n *\n * @param {boolean} hasPageContentFocus True to allow only page content to be\n * edited, false to allow template to be\n * edited.\n */\nexport const setHasPageContentFocus =\n\t( hasPageContentFocus ) =>\n\t( { dispatch, registry } ) => {\n\t\tif ( hasPageContentFocus ) {\n\t\t\tregistry.dispatch( blockEditorStore ).clearSelectedBlock();\n\t\t}\n\t\tdispatch( {\n\t\t\ttype: 'SET_HAS_PAGE_CONTENT_FOCUS',\n\t\t\thasPageContentFocus,\n\t\t} );\n\t};\n\n/**\n * Action that toggles Distraction free mode.\n * Distraction free mode expects there are no sidebars, as due to the\n * z-index values set, you can't close sidebars.\n */\nexport const toggleDistractionFree =\n\t() =>\n\t( { dispatch, registry } ) => {\n\t\tconst isDistractionFree = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( 'core/edit-site', 'distractionFree' );\n\t\tif ( ! isDistractionFree ) {\n\t\t\tregistry.batch( () => {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t\t.set( 'core/edit-site', 'fixedToolbar', false );\n\t\t\t\tdispatch.setIsInserterOpened( false );\n\t\t\t\tdispatch.setIsListViewOpened( false );\n\t\t\t\tdispatch.closeGeneralSidebar();\n\t\t\t} );\n\t\t}\n\t\tregistry.batch( () => {\n\t\t\tregistry\n\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t.set(\n\t\t\t\t\t'core/edit-site',\n\t\t\t\t\t'distractionFree',\n\t\t\t\t\t! isDistractionFree\n\t\t\t\t);\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createInfoNotice(\n\t\t\t\t\tisDistractionFree\n\t\t\t\t\t\t? __( 'Distraction free off.' )\n\t\t\t\t\t\t: __( 'Distraction free on.' ),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K,CAAED,iBAAiB,EAAG;IAC1BhE,QAAQ,CAACkG,KAAK,CAAE,MAAM;MACrBlG,QAAQ,CACNG,QAAQ,CAAEV,gBAAiB,CAAC,CAC5BqG,GAAG,CAAE,gBAAgB,EAAE,cAAc,EAAE,KAAM,CAAC;MAChD3F,QAAQ,CAACuD,mBAAmB,CAAE,KAAM,CAAC;MACrCvD,QAAQ,CAAC2D,mBAAmB,CAAE,KAAM,CAAC;MACrC3D,QAAQ,CAACuF,mBAAmB,CAAC,CAAC;IAC/B,CAAE,CAAC;EACJ;EACA1F,QAAQ,CAACkG,KAAK,CAAE,MAAM;IACrBlG,QAAQ,CACNG,QAAQ,CAAEV,gBAAiB,CAAC,CAC5BqG,GAAG,CACH,gBAAgB,EAChB,iBAAiB,EACjB,CAAE9B,iBACH,CAAC;IACFhE,QAAQ,CACNG,QAAQ,CAAEf,YAAa,CAAC,CACxB+G,gBAAgB,CAChBnC,iBAAiB,GACd/E,EAAE,CAAE,uBAAwB,CAAC,GAC7BA,EAAE,CAAE,sBAAuB,CAAC,EAC/B;MACCgC,EAAE,EAAE,6CAA6C;MACjDV,IAAI,EAAE;IACP,CACD,CAAC;EACH,CAAE,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["FOCUSABLE_ENTITIES"],"sources":["@wordpress/edit-site/src/utils/constants.js"],"sourcesContent":["export const FOCUSABLE_ENTITIES = [\n\t'wp_template_part',\n\t'wp_navigation',\n\t'wp_block',\n];\n"],"mappings":"AAAA,OAAO,MAAMA,kBAAkB,GAAG,CACjC,kBAAkB,EAClB,eAAe,EACf,UAAU,CACV"}
|
|
@@ -908,7 +908,7 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
908
908
|
box-shadow: inset 0 0 0 2px var(--wp-admin-theme-color);
|
|
909
909
|
}
|
|
910
910
|
|
|
911
|
-
.edit-site-canvas-
|
|
911
|
+
.edit-site-canvas-loader {
|
|
912
912
|
width: 100%;
|
|
913
913
|
height: 100%;
|
|
914
914
|
display: flex;
|
|
@@ -918,20 +918,20 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
918
918
|
opacity: 0;
|
|
919
919
|
align-items: center;
|
|
920
920
|
justify-content: center;
|
|
921
|
-
animation: 0.5s ease 1s edit-site-canvas-
|
|
921
|
+
animation: 0.5s ease 1s edit-site-canvas-loader__fade-in-animation;
|
|
922
922
|
animation-fill-mode: forwards;
|
|
923
923
|
}
|
|
924
924
|
@media (prefers-reduced-motion: reduce) {
|
|
925
|
-
.edit-site-canvas-
|
|
925
|
+
.edit-site-canvas-loader {
|
|
926
926
|
animation-duration: 1ms;
|
|
927
927
|
animation-delay: 0s;
|
|
928
928
|
}
|
|
929
929
|
}
|
|
930
|
-
.edit-site-canvas-
|
|
930
|
+
.edit-site-canvas-loader > div {
|
|
931
931
|
width: 160px;
|
|
932
932
|
}
|
|
933
933
|
|
|
934
|
-
@keyframes edit-site-canvas-
|
|
934
|
+
@keyframes edit-site-canvas-loader__fade-in-animation {
|
|
935
935
|
from {
|
|
936
936
|
opacity: 0;
|
|
937
937
|
}
|
|
@@ -1981,6 +1981,9 @@ body.is-fullscreen-mode .edit-site-list-header {
|
|
|
1981
1981
|
.edit-site-patterns__grid .edit-site-patterns__pattern .edit-site-patterns__button {
|
|
1982
1982
|
color: #949494;
|
|
1983
1983
|
}
|
|
1984
|
+
.edit-site-patterns__grid .edit-site-patterns__pattern .edit-site-patterns__dropdown {
|
|
1985
|
+
flex-shrink: 0;
|
|
1986
|
+
}
|
|
1984
1987
|
.edit-site-patterns__grid .edit-site-patterns__pattern.is-placeholder .edit-site-patterns__preview {
|
|
1985
1988
|
min-height: 64px;
|
|
1986
1989
|
color: #949494;
|
|
@@ -1994,7 +1997,7 @@ body.is-fullscreen-mode .edit-site-list-header {
|
|
|
1994
1997
|
}
|
|
1995
1998
|
.edit-site-patterns__grid .edit-site-patterns__preview {
|
|
1996
1999
|
flex: 0 1 auto;
|
|
1997
|
-
margin-bottom:
|
|
2000
|
+
margin-bottom: 12px;
|
|
1998
2001
|
}
|
|
1999
2002
|
|
|
2000
2003
|
.edit-site-patterns__load-more {
|
|
@@ -2186,6 +2189,10 @@ body.is-fullscreen-mode .edit-site-list-header {
|
|
|
2186
2189
|
display: block;
|
|
2187
2190
|
margin-right: 26px;
|
|
2188
2191
|
}
|
|
2192
|
+
.edit-site-change-status__content .edit-site-change-status__password-legend {
|
|
2193
|
+
padding: 0;
|
|
2194
|
+
margin-bottom: 8px;
|
|
2195
|
+
}
|
|
2189
2196
|
|
|
2190
2197
|
.edit-site-summary-field .components-dropdown {
|
|
2191
2198
|
flex-grow: 1;
|
package/build-style/style.css
CHANGED
|
@@ -908,7 +908,7 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
908
908
|
box-shadow: inset 0 0 0 2px var(--wp-admin-theme-color);
|
|
909
909
|
}
|
|
910
910
|
|
|
911
|
-
.edit-site-canvas-
|
|
911
|
+
.edit-site-canvas-loader {
|
|
912
912
|
width: 100%;
|
|
913
913
|
height: 100%;
|
|
914
914
|
display: flex;
|
|
@@ -918,20 +918,20 @@ body.is-fullscreen-mode .interface-interface-skeleton {
|
|
|
918
918
|
opacity: 0;
|
|
919
919
|
align-items: center;
|
|
920
920
|
justify-content: center;
|
|
921
|
-
animation: 0.5s ease 1s edit-site-canvas-
|
|
921
|
+
animation: 0.5s ease 1s edit-site-canvas-loader__fade-in-animation;
|
|
922
922
|
animation-fill-mode: forwards;
|
|
923
923
|
}
|
|
924
924
|
@media (prefers-reduced-motion: reduce) {
|
|
925
|
-
.edit-site-canvas-
|
|
925
|
+
.edit-site-canvas-loader {
|
|
926
926
|
animation-duration: 1ms;
|
|
927
927
|
animation-delay: 0s;
|
|
928
928
|
}
|
|
929
929
|
}
|
|
930
|
-
.edit-site-canvas-
|
|
930
|
+
.edit-site-canvas-loader > div {
|
|
931
931
|
width: 160px;
|
|
932
932
|
}
|
|
933
933
|
|
|
934
|
-
@keyframes edit-site-canvas-
|
|
934
|
+
@keyframes edit-site-canvas-loader__fade-in-animation {
|
|
935
935
|
from {
|
|
936
936
|
opacity: 0;
|
|
937
937
|
}
|
|
@@ -1982,6 +1982,9 @@ body.is-fullscreen-mode .edit-site-list-header {
|
|
|
1982
1982
|
.edit-site-patterns__grid .edit-site-patterns__pattern .edit-site-patterns__button {
|
|
1983
1983
|
color: #949494;
|
|
1984
1984
|
}
|
|
1985
|
+
.edit-site-patterns__grid .edit-site-patterns__pattern .edit-site-patterns__dropdown {
|
|
1986
|
+
flex-shrink: 0;
|
|
1987
|
+
}
|
|
1985
1988
|
.edit-site-patterns__grid .edit-site-patterns__pattern.is-placeholder .edit-site-patterns__preview {
|
|
1986
1989
|
min-height: 64px;
|
|
1987
1990
|
color: #949494;
|
|
@@ -1995,7 +1998,7 @@ body.is-fullscreen-mode .edit-site-list-header {
|
|
|
1995
1998
|
}
|
|
1996
1999
|
.edit-site-patterns__grid .edit-site-patterns__preview {
|
|
1997
2000
|
flex: 0 1 auto;
|
|
1998
|
-
margin-bottom:
|
|
2001
|
+
margin-bottom: 12px;
|
|
1999
2002
|
}
|
|
2000
2003
|
|
|
2001
2004
|
.edit-site-patterns__load-more {
|
|
@@ -2187,6 +2190,10 @@ body.is-fullscreen-mode .edit-site-list-header {
|
|
|
2187
2190
|
display: block;
|
|
2188
2191
|
margin-left: 26px;
|
|
2189
2192
|
}
|
|
2193
|
+
.edit-site-change-status__content .edit-site-change-status__password-legend {
|
|
2194
|
+
padding: 0;
|
|
2195
|
+
margin-bottom: 8px;
|
|
2196
|
+
}
|
|
2190
2197
|
|
|
2191
2198
|
.edit-site-summary-field .components-dropdown {
|
|
2192
2199
|
flex-grow: 1;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/edit-site",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.18.1-next.5a1d1283.0",
|
|
4
4
|
"description": "Edit Site Page module for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -27,44 +27,44 @@
|
|
|
27
27
|
"react-native": "src/index",
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@babel/runtime": "^7.16.0",
|
|
30
|
-
"@wordpress/a11y": "^3.
|
|
31
|
-
"@wordpress/api-fetch": "^6.
|
|
32
|
-
"@wordpress/block-editor": "^12.
|
|
33
|
-
"@wordpress/block-library": "^8.
|
|
34
|
-
"@wordpress/blocks": "^12.
|
|
35
|
-
"@wordpress/commands": "^0.
|
|
36
|
-
"@wordpress/components": "^
|
|
37
|
-
"@wordpress/compose": "^6.
|
|
38
|
-
"@wordpress/core-commands": "^0.
|
|
39
|
-
"@wordpress/core-data": "^6.
|
|
40
|
-
"@wordpress/data": "^9.
|
|
41
|
-
"@wordpress/date": "^4.
|
|
42
|
-
"@wordpress/deprecated": "^3.
|
|
43
|
-
"@wordpress/dom": "^3.
|
|
44
|
-
"@wordpress/editor": "^13.
|
|
45
|
-
"@wordpress/element": "^5.
|
|
46
|
-
"@wordpress/escape-html": "^2.
|
|
47
|
-
"@wordpress/hooks": "^3.
|
|
48
|
-
"@wordpress/html-entities": "^3.
|
|
49
|
-
"@wordpress/i18n": "^4.
|
|
50
|
-
"@wordpress/icons": "^9.
|
|
51
|
-
"@wordpress/interface": "^5.
|
|
52
|
-
"@wordpress/keyboard-shortcuts": "^4.
|
|
53
|
-
"@wordpress/keycodes": "^3.
|
|
54
|
-
"@wordpress/media-utils": "^4.
|
|
55
|
-
"@wordpress/notices": "^4.
|
|
56
|
-
"@wordpress/patterns": "^1.1.
|
|
57
|
-
"@wordpress/plugins": "^6.
|
|
58
|
-
"@wordpress/preferences": "^3.
|
|
59
|
-
"@wordpress/primitives": "^3.
|
|
60
|
-
"@wordpress/private-apis": "^0.
|
|
61
|
-
"@wordpress/reusable-blocks": "^4.
|
|
62
|
-
"@wordpress/router": "^0.
|
|
63
|
-
"@wordpress/style-engine": "^1.
|
|
64
|
-
"@wordpress/url": "^3.
|
|
65
|
-
"@wordpress/viewport": "^5.
|
|
66
|
-
"@wordpress/widgets": "^3.
|
|
67
|
-
"@wordpress/wordcount": "^3.
|
|
30
|
+
"@wordpress/a11y": "^3.41.1-next.5a1d1283.0",
|
|
31
|
+
"@wordpress/api-fetch": "^6.38.1-next.5a1d1283.0",
|
|
32
|
+
"@wordpress/block-editor": "^12.9.1-next.5a1d1283.0",
|
|
33
|
+
"@wordpress/block-library": "^8.18.1-next.5a1d1283.0",
|
|
34
|
+
"@wordpress/blocks": "^12.18.1-next.5a1d1283.0",
|
|
35
|
+
"@wordpress/commands": "^0.12.1-next.5a1d1283.0",
|
|
36
|
+
"@wordpress/components": "^26.0.1-next.5a1d1283.0",
|
|
37
|
+
"@wordpress/compose": "^6.18.1-next.5a1d1283.0",
|
|
38
|
+
"@wordpress/core-commands": "^0.10.1-next.5a1d1283.0",
|
|
39
|
+
"@wordpress/core-data": "^6.18.1-next.5a1d1283.0",
|
|
40
|
+
"@wordpress/data": "^9.11.1-next.5a1d1283.0",
|
|
41
|
+
"@wordpress/date": "^4.41.1-next.5a1d1283.0",
|
|
42
|
+
"@wordpress/deprecated": "^3.41.1-next.5a1d1283.0",
|
|
43
|
+
"@wordpress/dom": "^3.41.1-next.5a1d1283.0",
|
|
44
|
+
"@wordpress/editor": "^13.18.1-next.5a1d1283.0",
|
|
45
|
+
"@wordpress/element": "^5.18.1-next.5a1d1283.0",
|
|
46
|
+
"@wordpress/escape-html": "^2.41.1-next.5a1d1283.0",
|
|
47
|
+
"@wordpress/hooks": "^3.41.1-next.5a1d1283.0",
|
|
48
|
+
"@wordpress/html-entities": "^3.41.1-next.5a1d1283.0",
|
|
49
|
+
"@wordpress/i18n": "^4.41.1-next.5a1d1283.0",
|
|
50
|
+
"@wordpress/icons": "^9.32.1-next.5a1d1283.0",
|
|
51
|
+
"@wordpress/interface": "^5.18.1-next.5a1d1283.0",
|
|
52
|
+
"@wordpress/keyboard-shortcuts": "^4.18.1-next.5a1d1283.0",
|
|
53
|
+
"@wordpress/keycodes": "^3.41.1-next.5a1d1283.0",
|
|
54
|
+
"@wordpress/media-utils": "^4.32.1-next.5a1d1283.0",
|
|
55
|
+
"@wordpress/notices": "^4.9.1-next.5a1d1283.0",
|
|
56
|
+
"@wordpress/patterns": "^1.2.1-next.5a1d1283.0",
|
|
57
|
+
"@wordpress/plugins": "^6.9.1-next.5a1d1283.0",
|
|
58
|
+
"@wordpress/preferences": "^3.18.1-next.5a1d1283.0",
|
|
59
|
+
"@wordpress/primitives": "^3.39.1-next.5a1d1283.0",
|
|
60
|
+
"@wordpress/private-apis": "^0.23.1-next.5a1d1283.0",
|
|
61
|
+
"@wordpress/reusable-blocks": "^4.18.1-next.5a1d1283.0",
|
|
62
|
+
"@wordpress/router": "^0.10.1-next.5a1d1283.0",
|
|
63
|
+
"@wordpress/style-engine": "^1.24.1-next.5a1d1283.0",
|
|
64
|
+
"@wordpress/url": "^3.42.1-next.5a1d1283.0",
|
|
65
|
+
"@wordpress/viewport": "^5.18.1-next.5a1d1283.0",
|
|
66
|
+
"@wordpress/widgets": "^3.18.1-next.5a1d1283.0",
|
|
67
|
+
"@wordpress/wordcount": "^3.41.1-next.5a1d1283.0",
|
|
68
68
|
"change-case": "^4.1.2",
|
|
69
69
|
"classnames": "^2.3.1",
|
|
70
70
|
"colord": "^2.9.2",
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
"publishConfig": {
|
|
85
85
|
"access": "public"
|
|
86
86
|
},
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "fa0b66987dab5a15f38663e06036d09bccffaa4b"
|
|
88
88
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { SlotFillProvider
|
|
4
|
+
import { SlotFillProvider } from '@wordpress/components';
|
|
5
5
|
import { UnsavedChangesWarning } from '@wordpress/editor';
|
|
6
6
|
import { ShortcutProvider } from '@wordpress/keyboard-shortcuts';
|
|
7
7
|
import { store as noticesStore } from '@wordpress/notices';
|
|
@@ -38,7 +38,6 @@ export default function App() {
|
|
|
38
38
|
<ShortcutProvider style={ { height: '100%' } }>
|
|
39
39
|
<SlotFillProvider>
|
|
40
40
|
<GlobalStylesProvider>
|
|
41
|
-
<Popover.Slot />
|
|
42
41
|
<UnsavedChangesWarning />
|
|
43
42
|
<RouterProvider>
|
|
44
43
|
<Layout />
|
|
@@ -11,8 +11,6 @@ import {
|
|
|
11
11
|
BlockList,
|
|
12
12
|
BlockTools,
|
|
13
13
|
__unstableUseClipboardHandler as useClipboardHandler,
|
|
14
|
-
__unstableUseTypingObserver as useTypingObserver,
|
|
15
|
-
BlockEditorKeyboardShortcuts,
|
|
16
14
|
store as blockEditorStore,
|
|
17
15
|
} from '@wordpress/block-editor';
|
|
18
16
|
import {
|
|
@@ -29,7 +27,7 @@ import EditorCanvas from './editor-canvas';
|
|
|
29
27
|
import EditorCanvasContainer from '../editor-canvas-container';
|
|
30
28
|
import useSiteEditorSettings from './use-site-editor-settings';
|
|
31
29
|
import { store as editSiteStore } from '../../store';
|
|
32
|
-
import { FOCUSABLE_ENTITIES } from '
|
|
30
|
+
import { FOCUSABLE_ENTITIES } from '../../utils/constants';
|
|
33
31
|
import { unlock } from '../../lock-unlock';
|
|
34
32
|
import PageContentFocusManager from '../page-content-focus-manager';
|
|
35
33
|
|
|
@@ -78,11 +76,7 @@ export default function SiteEditorCanvas() {
|
|
|
78
76
|
! isMobileViewport;
|
|
79
77
|
|
|
80
78
|
const contentRef = useRef();
|
|
81
|
-
const mergedRefs = useMergeRefs( [
|
|
82
|
-
contentRef,
|
|
83
|
-
useClipboardHandler(),
|
|
84
|
-
useTypingObserver(),
|
|
85
|
-
] );
|
|
79
|
+
const mergedRefs = useMergeRefs( [ contentRef, useClipboardHandler() ] );
|
|
86
80
|
|
|
87
81
|
const isTemplateTypeNavigation = templateType === 'wp_navigation';
|
|
88
82
|
|
|
@@ -121,7 +115,6 @@ export default function SiteEditorCanvas() {
|
|
|
121
115
|
}
|
|
122
116
|
} }
|
|
123
117
|
>
|
|
124
|
-
<BlockEditorKeyboardShortcuts.Register />
|
|
125
118
|
<BackButton />
|
|
126
119
|
<ResizableEditor
|
|
127
120
|
enableResizing={ enableResizing }
|
|
@@ -13,7 +13,7 @@ import { useStylesPreviewColors } from '../global-styles/hooks';
|
|
|
13
13
|
const { ProgressBar, Theme } = unlock( componentsPrivateApis );
|
|
14
14
|
const { useGlobalStyle } = unlock( blockEditorPrivateApis );
|
|
15
15
|
|
|
16
|
-
export default function
|
|
16
|
+
export default function CanvasLoader( { id } ) {
|
|
17
17
|
const [ fallbackIndicatorColor ] = useGlobalStyle( 'color.text' );
|
|
18
18
|
const [ backgroundColor ] = useGlobalStyle( 'color.background' );
|
|
19
19
|
const { highlightedColors } = useStylesPreviewColors();
|
|
@@ -21,7 +21,7 @@ export default function CanvasSpinner( { id } ) {
|
|
|
21
21
|
highlightedColors[ 0 ]?.color ?? fallbackIndicatorColor;
|
|
22
22
|
|
|
23
23
|
return (
|
|
24
|
-
<div className="edit-site-canvas-
|
|
24
|
+
<div className="edit-site-canvas-loader">
|
|
25
25
|
<Theme accent={ indicatorColor } background={ backgroundColor }>
|
|
26
26
|
<ProgressBar id={ id } />
|
|
27
27
|
</Theme>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.edit-site-canvas-
|
|
1
|
+
.edit-site-canvas-loader {
|
|
2
2
|
width: 100%;
|
|
3
3
|
height: 100%;
|
|
4
4
|
display: flex;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
align-items: center;
|
|
10
10
|
justify-content: center;
|
|
11
11
|
|
|
12
|
-
animation: 0.5s ease 1s edit-site-canvas-
|
|
12
|
+
animation: 0.5s ease 1s edit-site-canvas-loader__fade-in-animation;
|
|
13
13
|
animation-fill-mode: forwards;
|
|
14
14
|
@include reduce-motion("animation");
|
|
15
15
|
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
@keyframes edit-site-canvas-
|
|
21
|
+
@keyframes edit-site-canvas-loader__fade-in-animation {
|
|
22
22
|
from {
|
|
23
23
|
opacity: 0;
|
|
24
24
|
}
|
|
@@ -40,7 +40,7 @@ import StartTemplateOptions from '../start-template-options';
|
|
|
40
40
|
import { store as editSiteStore } from '../../store';
|
|
41
41
|
import { GlobalStylesRenderer } from '../global-styles-renderer';
|
|
42
42
|
import useTitle from '../routes/use-title';
|
|
43
|
-
import
|
|
43
|
+
import CanvasLoader from '../canvas-loader';
|
|
44
44
|
import { unlock } from '../../lock-unlock';
|
|
45
45
|
import useEditedEntityRecord from '../use-edited-entity-record';
|
|
46
46
|
import { SidebarFixedBottomSlot } from '../sidebar-edit-mode/sidebar-fixed-bottom';
|
|
@@ -180,7 +180,7 @@ export default function Editor( { isLoading } ) {
|
|
|
180
180
|
useTitle( hasLoadedPost && title );
|
|
181
181
|
|
|
182
182
|
const loadingProgressId = useInstanceId(
|
|
183
|
-
|
|
183
|
+
CanvasLoader,
|
|
184
184
|
'edit-site-editor__loading-progress'
|
|
185
185
|
);
|
|
186
186
|
|
|
@@ -193,7 +193,7 @@ export default function Editor( { isLoading } ) {
|
|
|
193
193
|
|
|
194
194
|
return (
|
|
195
195
|
<>
|
|
196
|
-
{ isLoading ? <
|
|
196
|
+
{ isLoading ? <CanvasLoader id={ loadingProgressId } /> : null }
|
|
197
197
|
{ isEditMode && <WelcomeGuide /> }
|
|
198
198
|
<EntityProvider kind="root" type="site">
|
|
199
199
|
<EntityProvider
|
|
@@ -98,6 +98,20 @@ function ScreenBlock( { name, variation } ) {
|
|
|
98
98
|
const { behavior } = useGlobalBehaviors( name, 'user' );
|
|
99
99
|
|
|
100
100
|
const blockType = getBlockType( name );
|
|
101
|
+
|
|
102
|
+
// Only allow `blockGap` support if serialization has not been skipped, to be sure global spacing can be applied.
|
|
103
|
+
if (
|
|
104
|
+
settings?.spacing?.blockGap &&
|
|
105
|
+
blockType?.supports?.spacing?.blockGap &&
|
|
106
|
+
( blockType?.supports?.spacing?.__experimentalSkipSerialization ===
|
|
107
|
+
true ||
|
|
108
|
+
blockType?.supports?.spacing?.__experimentalSkipSerialization?.some?.(
|
|
109
|
+
( spacingType ) => spacingType === 'blockGap'
|
|
110
|
+
) )
|
|
111
|
+
) {
|
|
112
|
+
settings.spacing.blockGap = false;
|
|
113
|
+
}
|
|
114
|
+
|
|
101
115
|
const blockVariations = useBlockVariations( name );
|
|
102
116
|
const hasTypographyPanel = useHasTypographyPanel( settings );
|
|
103
117
|
const hasColorPanel = useHasColorPanel( settings );
|