@wordpress/edit-site 6.11.0 → 6.12.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 +0 -2
- package/build/components/app/index.js.map +1 -1
- package/build/components/block-editor/use-editor-iframe-props.js +6 -8
- package/build/components/block-editor/use-editor-iframe-props.js.map +1 -1
- package/build/components/editor/index.js +9 -4
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor/use-editor-title.js +29 -12
- package/build/components/editor/use-editor-title.js.map +1 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js +24 -22
- package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build/components/global-styles/shadows-edit-panel.js +2 -3
- package/build/components/global-styles/shadows-edit-panel.js.map +1 -1
- package/build/components/global-styles/ui.js +42 -2
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles-renderer/index.js +6 -8
- package/build/components/global-styles-renderer/index.js.map +1 -1
- package/build/components/layout/hooks.js +1 -10
- package/build/components/layout/hooks.js.map +1 -1
- package/build/components/layout/index.js +1 -0
- package/build/components/layout/index.js.map +1 -1
- package/build/components/page-patterns/fields.js +3 -7
- package/build/components/page-patterns/fields.js.map +1 -1
- package/build/components/page-templates/fields.js +1 -2
- package/build/components/page-templates/fields.js.map +1 -1
- package/build/components/post-edit/index.js +14 -8
- package/build/components/post-edit/index.js.map +1 -1
- package/build/components/post-fields/index.js +3 -197
- package/build/components/post-fields/index.js.map +1 -1
- package/build/components/post-list/index.js +11 -1
- package/build/components/post-list/index.js.map +1 -1
- package/build/components/sidebar/index.js +11 -3
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-global-styles-wrapper/index.js +129 -0
- package/build/components/sidebar-global-styles-wrapper/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen-global-styles/index.js +14 -72
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/index.js +43 -42
- package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build/components/site-editor-routes/styles-edit.js +6 -1
- package/build/components/site-editor-routes/styles-edit.js.map +1 -1
- package/build/components/site-editor-routes/styles-view.js +8 -2
- package/build/components/site-editor-routes/styles-view.js.map +1 -1
- package/build/components/site-hub/index.js +19 -6
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/style-book/constants.js +10 -3
- package/build/components/style-book/constants.js.map +1 -1
- package/build/components/style-book/examples.js +71 -1
- package/build/components/style-book/examples.js.map +1 -1
- package/build/components/style-book/index.js +70 -11
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +32 -32
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build/components/welcome-guide/index.js +4 -2
- package/build/components/welcome-guide/index.js.map +1 -1
- package/build/components/welcome-guide/page.js +1 -9
- package/build/components/welcome-guide/page.js.map +1 -1
- package/build/components/welcome-guide/template.js +1 -12
- package/build/components/welcome-guide/template.js.map +1 -1
- package/build/hooks/commands/use-common-commands.js +15 -15
- package/build/hooks/commands/use-common-commands.js.map +1 -1
- package/build/index.js +1 -0
- package/build/index.js.map +1 -1
- package/build/posts.js +1 -0
- package/build/posts.js.map +1 -1
- package/build-module/components/app/index.js +0 -2
- package/build-module/components/app/index.js.map +1 -1
- package/build-module/components/block-editor/use-editor-iframe-props.js +6 -8
- package/build-module/components/block-editor/use-editor-iframe-props.js.map +1 -1
- package/build-module/components/editor/index.js +9 -4
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor/use-editor-title.js +29 -12
- package/build-module/components/editor/use-editor-title.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +25 -23
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build-module/components/global-styles/shadows-edit-panel.js +2 -3
- package/build-module/components/global-styles/shadows-edit-panel.js.map +1 -1
- package/build-module/components/global-styles/ui.js +43 -3
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles-renderer/index.js +6 -8
- package/build-module/components/global-styles-renderer/index.js.map +1 -1
- package/build-module/components/layout/hooks.js +1 -9
- package/build-module/components/layout/hooks.js.map +1 -1
- package/build-module/components/layout/index.js +1 -0
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/page-patterns/fields.js +4 -8
- package/build-module/components/page-patterns/fields.js.map +1 -1
- package/build-module/components/page-templates/fields.js +1 -2
- package/build-module/components/page-templates/fields.js.map +1 -1
- package/build-module/components/post-edit/index.js +14 -8
- package/build-module/components/post-edit/index.js.map +1 -1
- package/build-module/components/post-fields/index.js +7 -202
- package/build-module/components/post-fields/index.js.map +1 -1
- package/build-module/components/post-list/index.js +11 -1
- package/build-module/components/post-list/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +11 -3
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-global-styles-wrapper/index.js +121 -0
- package/build-module/components/sidebar-global-styles-wrapper/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +15 -73
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +43 -43
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build-module/components/site-editor-routes/styles-edit.js +6 -1
- package/build-module/components/site-editor-routes/styles-edit.js.map +1 -1
- package/build-module/components/site-editor-routes/styles-view.js +8 -2
- package/build-module/components/site-editor-routes/styles-view.js.map +1 -1
- package/build-module/components/site-hub/index.js +19 -6
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/style-book/constants.js +10 -3
- package/build-module/components/style-book/constants.js.map +1 -1
- package/build-module/components/style-book/examples.js +71 -1
- package/build-module/components/style-book/examples.js.map +1 -1
- package/build-module/components/style-book/index.js +71 -12
- package/build-module/components/style-book/index.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +32 -32
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build-module/components/welcome-guide/index.js +4 -2
- package/build-module/components/welcome-guide/index.js.map +1 -1
- package/build-module/components/welcome-guide/page.js +1 -9
- package/build-module/components/welcome-guide/page.js.map +1 -1
- package/build-module/components/welcome-guide/template.js +1 -11
- package/build-module/components/welcome-guide/template.js.map +1 -1
- package/build-module/hooks/commands/use-common-commands.js +15 -15
- package/build-module/hooks/commands/use-common-commands.js.map +1 -1
- package/build-module/index.js +1 -0
- package/build-module/index.js.map +1 -1
- package/build-module/posts.js +1 -0
- package/build-module/posts.js.map +1 -1
- package/build-style/posts-rtl.css +54 -5
- package/build-style/posts.css +54 -5
- package/build-style/style-rtl.css +109 -28
- package/build-style/style.css +109 -28
- package/package.json +3 -4
- package/src/components/app/index.js +0 -2
- package/src/components/block-editor/use-editor-iframe-props.js +2 -3
- package/src/components/editor/index.js +16 -4
- package/src/components/editor/use-editor-title.js +37 -13
- package/src/components/editor-canvas-container/style.scss +0 -1
- package/src/components/global-styles/screen-revisions/revisions-buttons.js +28 -31
- package/src/components/global-styles/screen-revisions/style.scss +11 -17
- package/src/components/global-styles/shadows-edit-panel.js +4 -2
- package/src/components/global-styles/ui.js +42 -2
- package/src/components/global-styles-renderer/index.js +4 -10
- package/src/components/layout/hooks.js +1 -7
- package/src/components/layout/index.js +6 -1
- package/src/components/page-patterns/fields.js +6 -12
- package/src/components/page-patterns/style.scss +0 -5
- package/src/components/page-templates/fields.js +2 -3
- package/src/components/post-edit/index.js +38 -30
- package/src/components/post-edit/style.scss +7 -0
- package/src/components/post-fields/index.js +19 -273
- package/src/components/post-list/index.js +9 -3
- package/src/components/post-list/style.scss +29 -3
- package/src/components/sidebar/index.js +23 -7
- package/src/components/sidebar-global-styles-wrapper/index.js +150 -0
- package/src/components/sidebar-global-styles-wrapper/style.scss +35 -0
- package/src/components/sidebar-navigation-item/style.scss +2 -2
- package/src/components/sidebar-navigation-screen-global-styles/index.js +13 -88
- package/src/components/sidebar-navigation-screen-main/index.js +46 -45
- package/src/components/site-editor-routes/styles-edit.js +10 -1
- package/src/components/site-editor-routes/styles-view.js +11 -1
- package/src/components/site-hub/index.js +33 -16
- package/src/components/site-icon/style.scss +16 -0
- package/src/components/style-book/constants.ts +11 -3
- package/src/components/style-book/examples.tsx +105 -1
- package/src/components/style-book/index.js +86 -8
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +54 -64
- package/src/components/welcome-guide/index.js +3 -3
- package/src/components/welcome-guide/page.js +1 -7
- package/src/components/welcome-guide/template.js +1 -8
- package/src/hooks/commands/use-common-commands.js +253 -246
- package/src/index.js +1 -0
- package/src/posts.js +1 -0
- package/src/style.scss +2 -3
- package/build/components/async/index.js +0 -51
- package/build/components/async/index.js.map +0 -1
- package/build/components/use-edited-entity-record/index.js +0 -60
- package/build/components/use-edited-entity-record/index.js.map +0 -1
- package/build/hooks/commands/use-edit-mode-commands.js +0 -179
- package/build/hooks/commands/use-edit-mode-commands.js.map +0 -1
- package/build-module/components/async/index.js +0 -44
- package/build-module/components/async/index.js.map +0 -1
- package/build-module/components/use-edited-entity-record/index.js +0 -53
- package/build-module/components/use-edited-entity-record/index.js.map +0 -1
- package/build-module/hooks/commands/use-edit-mode-commands.js +0 -171
- package/build-module/hooks/commands/use-edit-mode-commands.js.map +0 -1
- package/src/components/async/index.js +0 -43
- package/src/components/use-edited-entity-record/index.js +0 -58
- package/src/hooks/commands/use-edit-mode-commands.js +0 -168
|
@@ -25,33 +25,19 @@ function useResolveEditedEntityAndContext({
|
|
|
25
25
|
const {
|
|
26
26
|
hasLoadedAllDependencies,
|
|
27
27
|
homepageId,
|
|
28
|
-
postsPageId
|
|
29
|
-
url,
|
|
30
|
-
frontPageTemplateId
|
|
28
|
+
postsPageId
|
|
31
29
|
} = useSelect(select => {
|
|
32
30
|
const {
|
|
33
|
-
getEntityRecord
|
|
34
|
-
getEntityRecords
|
|
31
|
+
getEntityRecord
|
|
35
32
|
} = select(coreDataStore);
|
|
36
33
|
const siteData = getEntityRecord('root', 'site');
|
|
37
|
-
const base = getEntityRecord('root', '__unstableBase');
|
|
38
|
-
const templates = getEntityRecords('postType', TEMPLATE_POST_TYPE, {
|
|
39
|
-
per_page: -1
|
|
40
|
-
});
|
|
41
34
|
const _homepageId = siteData?.show_on_front === 'page' && ['number', 'string'].includes(typeof siteData.page_on_front) && !!+siteData.page_on_front // We also need to check if it's not zero(`0`).
|
|
42
35
|
? siteData.page_on_front.toString() : null;
|
|
43
36
|
const _postsPageId = siteData?.show_on_front === 'page' && ['number', 'string'].includes(typeof siteData.page_for_posts) ? siteData.page_for_posts.toString() : null;
|
|
44
|
-
let _frontPageTemplateId;
|
|
45
|
-
if (templates) {
|
|
46
|
-
const frontPageTemplate = templates.find(t => t.slug === 'front-page');
|
|
47
|
-
_frontPageTemplateId = frontPageTemplate ? frontPageTemplate.id : false;
|
|
48
|
-
}
|
|
49
37
|
return {
|
|
50
|
-
hasLoadedAllDependencies: !!
|
|
38
|
+
hasLoadedAllDependencies: !!siteData,
|
|
51
39
|
homepageId: _homepageId,
|
|
52
|
-
postsPageId: _postsPageId
|
|
53
|
-
url: base?.home,
|
|
54
|
-
frontPageTemplateId: _frontPageTemplateId
|
|
40
|
+
postsPageId: _postsPageId
|
|
55
41
|
};
|
|
56
42
|
}, []);
|
|
57
43
|
|
|
@@ -75,20 +61,33 @@ function useResolveEditedEntityAndContext({
|
|
|
75
61
|
const {
|
|
76
62
|
getEditedEntityRecord,
|
|
77
63
|
getEntityRecords,
|
|
78
|
-
getDefaultTemplateId
|
|
79
|
-
__experimentalGetTemplateForLink
|
|
64
|
+
getDefaultTemplateId
|
|
80
65
|
} = select(coreDataStore);
|
|
81
66
|
function resolveTemplateForPostTypeAndId(postTypeToResolve, postIdToResolve) {
|
|
82
67
|
// For the front page, we always use the front page template if existing.
|
|
83
68
|
if (postTypeToResolve === 'page' && homepageId === postIdToResolve) {
|
|
84
|
-
//
|
|
85
|
-
//
|
|
86
|
-
if
|
|
69
|
+
// The /lookup endpoint cannot currently handle a lookup
|
|
70
|
+
// when a page is set as the front page, so specifically in
|
|
71
|
+
// that case, we want to check if there is a front page
|
|
72
|
+
// template, and instead of falling back to the home
|
|
73
|
+
// template, we want to fall back to the page template.
|
|
74
|
+
const templates = getEntityRecords('postType', TEMPLATE_POST_TYPE, {
|
|
75
|
+
per_page: -1
|
|
76
|
+
});
|
|
77
|
+
if (templates) {
|
|
78
|
+
const id = templates?.find(({
|
|
79
|
+
slug
|
|
80
|
+
}) => slug === 'front-page')?.id;
|
|
81
|
+
if (id) {
|
|
82
|
+
return id;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// If no front page template is found, continue with the
|
|
86
|
+
// logic below (fetching the page template).
|
|
87
|
+
} else {
|
|
88
|
+
// Still resolving `templates`.
|
|
87
89
|
return undefined;
|
|
88
90
|
}
|
|
89
|
-
if (!!frontPageTemplateId) {
|
|
90
|
-
return frontPageTemplateId;
|
|
91
|
-
}
|
|
92
91
|
}
|
|
93
92
|
const editedEntity = getEditedEntityRecord('postType', postTypeToResolve, postIdToResolve);
|
|
94
93
|
if (!editedEntity) {
|
|
@@ -96,7 +95,9 @@ function useResolveEditedEntityAndContext({
|
|
|
96
95
|
}
|
|
97
96
|
// Check if the current page is the posts page.
|
|
98
97
|
if (postTypeToResolve === 'page' && postsPageId === postIdToResolve) {
|
|
99
|
-
return
|
|
98
|
+
return getDefaultTemplateId({
|
|
99
|
+
slug: 'home'
|
|
100
|
+
});
|
|
100
101
|
}
|
|
101
102
|
// First see if the post/page has an assigned template and fetch it.
|
|
102
103
|
const currentTemplateSlug = editedEntity.template;
|
|
@@ -141,11 +142,10 @@ function useResolveEditedEntityAndContext({
|
|
|
141
142
|
}
|
|
142
143
|
|
|
143
144
|
// If we're not rendering a specific page, use the front page template.
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
}, [homepageId, postsPageId, hasLoadedAllDependencies, url, postId, postType, frontPageTemplateId]);
|
|
145
|
+
return getDefaultTemplateId({
|
|
146
|
+
slug: 'front-page'
|
|
147
|
+
});
|
|
148
|
+
}, [homepageId, postsPageId, hasLoadedAllDependencies, postId, postType]);
|
|
149
149
|
const context = useMemo(() => {
|
|
150
150
|
if (postTypesWithoutParentTemplate.includes(postType) && postId) {
|
|
151
151
|
return {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useEffect","useMemo","useSelect","useDispatch","store","coreDataStore","privateApis","routerPrivateApis","blockEditorStore","editSiteStore","unlock","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","NAVIGATION_POST_TYPE","PATTERN_TYPES","useLocation","postTypesWithoutParentTemplate","user","authorizedPostTypes","useResolveEditedEntityAndContext","postId","postType","hasLoadedAllDependencies","homepageId","postsPageId","url","frontPageTemplateId","select","getEntityRecord","getEntityRecords","siteData","base","templates","per_page","_homepageId","show_on_front","includes","page_on_front","toString","_postsPageId","page_for_posts","_frontPageTemplateId","frontPageTemplate","find","t","slug","id","home","resolvedTemplateId","undefined","getEditedEntityRecord","getDefaultTemplateId","__experimentalGetTemplateForLink","resolveTemplateForPostTypeAndId","postTypeToResolve","postIdToResolve","editedEntity","link","currentTemplateSlug","template","currentTemplate","slugToCheck","context","isReady","useInitEditedEntityFromURL","params","setEditedEntity","resetZoomLevel"],"sources":["@wordpress/edit-site/src/components/sync-state-with-url/use-init-edited-entity-from-url.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useMemo } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n\tPATTERN_TYPES,\n} from '../../utils/constants';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nconst postTypesWithoutParentTemplate = [\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n\tPATTERN_TYPES.user,\n];\n\nconst authorizedPostTypes = [ 'page', 'post' ];\n\nfunction useResolveEditedEntityAndContext( { postId, postType } ) {\n\tconst {\n\t\thasLoadedAllDependencies,\n\t\thomepageId,\n\t\tpostsPageId,\n\t\turl,\n\t\tfrontPageTemplateId,\n\t} = useSelect( ( select ) => {\n\t\tconst { getEntityRecord, getEntityRecords } = select( coreDataStore );\n\t\tconst siteData = getEntityRecord( 'root', 'site' );\n\t\tconst base = getEntityRecord( 'root', '__unstableBase' );\n\t\tconst templates = getEntityRecords( 'postType', TEMPLATE_POST_TYPE, {\n\t\t\tper_page: -1,\n\t\t} );\n\t\tconst _homepageId =\n\t\t\tsiteData?.show_on_front === 'page' &&\n\t\t\t[ 'number', 'string' ].includes( typeof siteData.page_on_front ) &&\n\t\t\t!! +siteData.page_on_front // We also need to check if it's not zero(`0`).\n\t\t\t\t? siteData.page_on_front.toString()\n\t\t\t\t: null;\n\t\tconst _postsPageId =\n\t\t\tsiteData?.show_on_front === 'page' &&\n\t\t\t[ 'number', 'string' ].includes( typeof siteData.page_for_posts )\n\t\t\t\t? siteData.page_for_posts.toString()\n\t\t\t\t: null;\n\t\tlet _frontPageTemplateId;\n\t\tif ( templates ) {\n\t\t\tconst frontPageTemplate = templates.find(\n\t\t\t\t( t ) => t.slug === 'front-page'\n\t\t\t);\n\t\t\t_frontPageTemplateId = frontPageTemplate\n\t\t\t\t? frontPageTemplate.id\n\t\t\t\t: false;\n\t\t}\n\t\treturn {\n\t\t\thasLoadedAllDependencies: !! base && !! siteData,\n\t\t\thomepageId: _homepageId,\n\t\t\tpostsPageId: _postsPageId,\n\t\t\turl: base?.home,\n\t\t\tfrontPageTemplateId: _frontPageTemplateId,\n\t\t};\n\t}, [] );\n\n\t/**\n\t * This is a hook that recreates the logic to resolve a template for a given WordPress postID postTypeId\n\t * in order to match the frontend as closely as possible in the site editor.\n\t *\n\t * It is not possible to rely on the server logic because there maybe unsaved changes that impact the template resolution.\n\t */\n\tconst resolvedTemplateId = useSelect(\n\t\t( select ) => {\n\t\t\t// If we're rendering a post type that doesn't have a template\n\t\t\t// no need to resolve its template.\n\t\t\tif (\n\t\t\t\tpostTypesWithoutParentTemplate.includes( postType ) &&\n\t\t\t\tpostId\n\t\t\t) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\t// Don't trigger resolution for multi-selected posts.\n\t\t\tif ( postId && postId.includes( ',' ) ) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst {\n\t\t\t\tgetEditedEntityRecord,\n\t\t\t\tgetEntityRecords,\n\t\t\t\tgetDefaultTemplateId,\n\t\t\t\t__experimentalGetTemplateForLink,\n\t\t\t} = select( coreDataStore );\n\n\t\t\tfunction resolveTemplateForPostTypeAndId(\n\t\t\t\tpostTypeToResolve,\n\t\t\t\tpostIdToResolve\n\t\t\t) {\n\t\t\t\t// For the front page, we always use the front page template if existing.\n\t\t\t\tif (\n\t\t\t\t\tpostTypeToResolve === 'page' &&\n\t\t\t\t\thomepageId === postIdToResolve\n\t\t\t\t) {\n\t\t\t\t\t// We're still checking whether the front page template exists.\n\t\t\t\t\t// Don't resolve the template yet.\n\t\t\t\t\tif ( frontPageTemplateId === undefined ) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( !! frontPageTemplateId ) {\n\t\t\t\t\t\treturn frontPageTemplateId;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst editedEntity = getEditedEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostTypeToResolve,\n\t\t\t\t\tpostIdToResolve\n\t\t\t\t);\n\t\t\t\tif ( ! editedEntity ) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\t// Check if the current page is the posts page.\n\t\t\t\tif (\n\t\t\t\t\tpostTypeToResolve === 'page' &&\n\t\t\t\t\tpostsPageId === postIdToResolve\n\t\t\t\t) {\n\t\t\t\t\treturn __experimentalGetTemplateForLink( editedEntity.link )\n\t\t\t\t\t\t?.id;\n\t\t\t\t}\n\t\t\t\t// First see if the post/page has an assigned template and fetch it.\n\t\t\t\tconst currentTemplateSlug = editedEntity.template;\n\t\t\t\tif ( currentTemplateSlug ) {\n\t\t\t\t\tconst currentTemplate = getEntityRecords(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tper_page: -1,\n\t\t\t\t\t\t}\n\t\t\t\t\t)?.find( ( { slug } ) => slug === currentTemplateSlug );\n\t\t\t\t\tif ( currentTemplate ) {\n\t\t\t\t\t\treturn currentTemplate.id;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// If no template is assigned, use the default template.\n\t\t\t\tlet slugToCheck;\n\t\t\t\t// In `draft` status we might not have a slug available, so we use the `single`\n\t\t\t\t// post type templates slug(ex page, single-post, single-product etc..).\n\t\t\t\t// Pages do not need the `single` prefix in the slug to be prioritized\n\t\t\t\t// through template hierarchy.\n\t\t\t\tif ( editedEntity.slug ) {\n\t\t\t\t\tslugToCheck =\n\t\t\t\t\t\tpostTypeToResolve === 'page'\n\t\t\t\t\t\t\t? `${ postTypeToResolve }-${ editedEntity.slug }`\n\t\t\t\t\t\t\t: `single-${ postTypeToResolve }-${ editedEntity.slug }`;\n\t\t\t\t} else {\n\t\t\t\t\tslugToCheck =\n\t\t\t\t\t\tpostTypeToResolve === 'page'\n\t\t\t\t\t\t\t? 'page'\n\t\t\t\t\t\t\t: `single-${ postTypeToResolve }`;\n\t\t\t\t}\n\t\t\t\treturn getDefaultTemplateId( {\n\t\t\t\t\tslug: slugToCheck,\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tif ( ! hasLoadedAllDependencies ) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\t// If we're rendering a specific page, we need to resolve its template.\n\t\t\t// The site editor only supports pages for now, not other CPTs.\n\t\t\tif (\n\t\t\t\tpostType &&\n\t\t\t\tpostId &&\n\t\t\t\tauthorizedPostTypes.includes( postType )\n\t\t\t) {\n\t\t\t\treturn resolveTemplateForPostTypeAndId( postType, postId );\n\t\t\t}\n\n\t\t\t// If we're rendering the home page, and we have a static home page, resolve its template.\n\t\t\tif ( homepageId ) {\n\t\t\t\treturn resolveTemplateForPostTypeAndId( 'page', homepageId );\n\t\t\t}\n\n\t\t\t// If we're not rendering a specific page, use the front page template.\n\t\t\tif ( url ) {\n\t\t\t\tconst template = __experimentalGetTemplateForLink( url );\n\t\t\t\treturn template?.id;\n\t\t\t}\n\t\t},\n\t\t[\n\t\t\thomepageId,\n\t\t\tpostsPageId,\n\t\t\thasLoadedAllDependencies,\n\t\t\turl,\n\t\t\tpostId,\n\t\t\tpostType,\n\t\t\tfrontPageTemplateId,\n\t\t]\n\t);\n\n\tconst context = useMemo( () => {\n\t\tif ( postTypesWithoutParentTemplate.includes( postType ) && postId ) {\n\t\t\treturn {};\n\t\t}\n\n\t\tif ( postType && postId && authorizedPostTypes.includes( postType ) ) {\n\t\t\treturn { postType, postId };\n\t\t}\n\t\t// TODO: for post types lists we should probably not render the front page, but maybe a placeholder\n\t\t// with a message like \"Select a page\" or something similar.\n\t\tif ( homepageId ) {\n\t\t\treturn { postType: 'page', postId: homepageId };\n\t\t}\n\n\t\treturn {};\n\t}, [ homepageId, postType, postId ] );\n\n\tif ( postTypesWithoutParentTemplate.includes( postType ) && postId ) {\n\t\treturn { isReady: true, postType, postId, context };\n\t}\n\n\tif ( hasLoadedAllDependencies ) {\n\t\treturn {\n\t\t\tisReady: resolvedTemplateId !== undefined,\n\t\t\tpostType: TEMPLATE_POST_TYPE,\n\t\t\tpostId: resolvedTemplateId,\n\t\t\tcontext,\n\t\t};\n\t}\n\n\treturn { isReady: false };\n}\n\nexport default function useInitEditedEntityFromURL() {\n\tconst { params = {} } = useLocation();\n\tconst { postType, postId, context, isReady } =\n\t\tuseResolveEditedEntityAndContext( params );\n\n\tconst { setEditedEntity } = useDispatch( editSiteStore );\n\tconst { resetZoomLevel } = unlock( useDispatch( blockEditorStore ) );\n\n\tuseEffect( () => {\n\t\tif ( isReady ) {\n\t\t\tresetZoomLevel();\n\t\t\tsetEditedEntity( postType, postId, context );\n\t\t}\n\t}, [\n\t\tisReady,\n\t\tpostType,\n\t\tpostId,\n\t\tcontext,\n\t\tsetEditedEntity,\n\t\tresetZoomLevel,\n\t] );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,OAAO,QAAQ,oBAAoB;AACvD,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,aAAa,QAAQ,sBAAsB;AAC7D,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;AACpE,SAASH,KAAK,IAAII,gBAAgB,QAAQ,yBAAyB;;AAEnE;AACA;AACA;AACA,SAASJ,KAAK,IAAIK,aAAa,QAAQ,aAAa;AACpD,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SACCC,kBAAkB,EAClBC,uBAAuB,EACvBC,oBAAoB,EACpBC,aAAa,QACP,uBAAuB;AAE9B,MAAM;EAAEC;AAAY,CAAC,GAAGL,MAAM,CAAEH,iBAAkB,CAAC;AAEnD,MAAMS,8BAA8B,GAAG,CACtCL,kBAAkB,EAClBC,uBAAuB,EACvBC,oBAAoB,EACpBC,aAAa,CAACG,IAAI,CAClB;AAED,MAAMC,mBAAmB,GAAG,CAAE,MAAM,EAAE,MAAM,CAAE;AAE9C,SAASC,gCAAgCA,CAAE;EAAEC,MAAM;EAAEC;AAAS,CAAC,EAAG;EACjE,MAAM;IACLC,wBAAwB;IACxBC,UAAU;IACVC,WAA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AAc,CAAC,CAAC;MAChBD,eAAe,CAAE7C,QAAQ,EAAED,MAAM,EAAE0C,OAAQ,CAAC;IAC7C;EACD,CAAC,EAAE,CACFC,OAAO,EACP1C,QAAQ,EACRD,MAAM,EACN0C,OAAO,EACPI,eAAe,EACfC,cAAc,CACb,CAAC;AACJ","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["useEffect","useMemo","useSelect","useDispatch","store","coreDataStore","privateApis","routerPrivateApis","blockEditorStore","editSiteStore","unlock","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","NAVIGATION_POST_TYPE","PATTERN_TYPES","useLocation","postTypesWithoutParentTemplate","user","authorizedPostTypes","useResolveEditedEntityAndContext","postId","postType","hasLoadedAllDependencies","homepageId","postsPageId","select","getEntityRecord","siteData","_homepageId","show_on_front","includes","page_on_front","toString","_postsPageId","page_for_posts","resolvedTemplateId","undefined","getEditedEntityRecord","getEntityRecords","getDefaultTemplateId","resolveTemplateForPostTypeAndId","postTypeToResolve","postIdToResolve","templates","per_page","id","find","slug","editedEntity","currentTemplateSlug","template","currentTemplate","slugToCheck","context","isReady","useInitEditedEntityFromURL","params","setEditedEntity","resetZoomLevel"],"sources":["@wordpress/edit-site/src/components/sync-state-with-url/use-init-edited-entity-from-url.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useMemo } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n\tPATTERN_TYPES,\n} from '../../utils/constants';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nconst postTypesWithoutParentTemplate = [\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n\tPATTERN_TYPES.user,\n];\n\nconst authorizedPostTypes = [ 'page', 'post' ];\n\nfunction useResolveEditedEntityAndContext( { postId, postType } ) {\n\tconst { hasLoadedAllDependencies, homepageId, postsPageId } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecord } = select( coreDataStore );\n\t\t\tconst siteData = getEntityRecord( 'root', 'site' );\n\t\t\tconst _homepageId =\n\t\t\t\tsiteData?.show_on_front === 'page' &&\n\t\t\t\t[ 'number', 'string' ].includes(\n\t\t\t\t\ttypeof siteData.page_on_front\n\t\t\t\t) &&\n\t\t\t\t!! +siteData.page_on_front // We also need to check if it's not zero(`0`).\n\t\t\t\t\t? siteData.page_on_front.toString()\n\t\t\t\t\t: null;\n\t\t\tconst _postsPageId =\n\t\t\t\tsiteData?.show_on_front === 'page' &&\n\t\t\t\t[ 'number', 'string' ].includes(\n\t\t\t\t\ttypeof siteData.page_for_posts\n\t\t\t\t)\n\t\t\t\t\t? siteData.page_for_posts.toString()\n\t\t\t\t\t: null;\n\t\t\treturn {\n\t\t\t\thasLoadedAllDependencies: !! siteData,\n\t\t\t\thomepageId: _homepageId,\n\t\t\t\tpostsPageId: _postsPageId,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\t/**\n\t * This is a hook that recreates the logic to resolve a template for a given WordPress postID postTypeId\n\t * in order to match the frontend as closely as possible in the site editor.\n\t *\n\t * It is not possible to rely on the server logic because there maybe unsaved changes that impact the template resolution.\n\t */\n\tconst resolvedTemplateId = useSelect(\n\t\t( select ) => {\n\t\t\t// If we're rendering a post type that doesn't have a template\n\t\t\t// no need to resolve its template.\n\t\t\tif (\n\t\t\t\tpostTypesWithoutParentTemplate.includes( postType ) &&\n\t\t\t\tpostId\n\t\t\t) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\t// Don't trigger resolution for multi-selected posts.\n\t\t\tif ( postId && postId.includes( ',' ) ) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst {\n\t\t\t\tgetEditedEntityRecord,\n\t\t\t\tgetEntityRecords,\n\t\t\t\tgetDefaultTemplateId,\n\t\t\t} = select( coreDataStore );\n\n\t\t\tfunction resolveTemplateForPostTypeAndId(\n\t\t\t\tpostTypeToResolve,\n\t\t\t\tpostIdToResolve\n\t\t\t) {\n\t\t\t\t// For the front page, we always use the front page template if existing.\n\t\t\t\tif (\n\t\t\t\t\tpostTypeToResolve === 'page' &&\n\t\t\t\t\thomepageId === postIdToResolve\n\t\t\t\t) {\n\t\t\t\t\t// The /lookup endpoint cannot currently handle a lookup\n\t\t\t\t\t// when a page is set as the front page, so specifically in\n\t\t\t\t\t// that case, we want to check if there is a front page\n\t\t\t\t\t// template, and instead of falling back to the home\n\t\t\t\t\t// template, we want to fall back to the page template.\n\t\t\t\t\tconst templates = getEntityRecords(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tper_page: -1,\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t\tif ( templates ) {\n\t\t\t\t\t\tconst id = templates?.find(\n\t\t\t\t\t\t\t( { slug } ) => slug === 'front-page'\n\t\t\t\t\t\t)?.id;\n\t\t\t\t\t\tif ( id ) {\n\t\t\t\t\t\t\treturn id;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// If no front page template is found, continue with the\n\t\t\t\t\t\t// logic below (fetching the page template).\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Still resolving `templates`.\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst editedEntity = getEditedEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostTypeToResolve,\n\t\t\t\t\tpostIdToResolve\n\t\t\t\t);\n\t\t\t\tif ( ! editedEntity ) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\t// Check if the current page is the posts page.\n\t\t\t\tif (\n\t\t\t\t\tpostTypeToResolve === 'page' &&\n\t\t\t\t\tpostsPageId === postIdToResolve\n\t\t\t\t) {\n\t\t\t\t\treturn getDefaultTemplateId( { slug: 'home' } );\n\t\t\t\t}\n\t\t\t\t// First see if the post/page has an assigned template and fetch it.\n\t\t\t\tconst currentTemplateSlug = editedEntity.template;\n\t\t\t\tif ( currentTemplateSlug ) {\n\t\t\t\t\tconst currentTemplate = getEntityRecords(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tper_page: -1,\n\t\t\t\t\t\t}\n\t\t\t\t\t)?.find( ( { slug } ) => slug === currentTemplateSlug );\n\t\t\t\t\tif ( currentTemplate ) {\n\t\t\t\t\t\treturn currentTemplate.id;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// If no template is assigned, use the default template.\n\t\t\t\tlet slugToCheck;\n\t\t\t\t// In `draft` status we might not have a slug available, so we use the `single`\n\t\t\t\t// post type templates slug(ex page, single-post, single-product etc..).\n\t\t\t\t// Pages do not need the `single` prefix in the slug to be prioritized\n\t\t\t\t// through template hierarchy.\n\t\t\t\tif ( editedEntity.slug ) {\n\t\t\t\t\tslugToCheck =\n\t\t\t\t\t\tpostTypeToResolve === 'page'\n\t\t\t\t\t\t\t? `${ postTypeToResolve }-${ editedEntity.slug }`\n\t\t\t\t\t\t\t: `single-${ postTypeToResolve }-${ editedEntity.slug }`;\n\t\t\t\t} else {\n\t\t\t\t\tslugToCheck =\n\t\t\t\t\t\tpostTypeToResolve === 'page'\n\t\t\t\t\t\t\t? 'page'\n\t\t\t\t\t\t\t: `single-${ postTypeToResolve }`;\n\t\t\t\t}\n\t\t\t\treturn getDefaultTemplateId( {\n\t\t\t\t\tslug: slugToCheck,\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tif ( ! hasLoadedAllDependencies ) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\t// If we're rendering a specific page, we need to resolve its template.\n\t\t\t// The site editor only supports pages for now, not other CPTs.\n\t\t\tif (\n\t\t\t\tpostType &&\n\t\t\t\tpostId &&\n\t\t\t\tauthorizedPostTypes.includes( postType )\n\t\t\t) {\n\t\t\t\treturn resolveTemplateForPostTypeAndId( postType, postId );\n\t\t\t}\n\n\t\t\t// If we're rendering the home page, and we have a static home page, resolve its template.\n\t\t\tif ( homepageId ) {\n\t\t\t\treturn resolveTemplateForPostTypeAndId( 'page', homepageId );\n\t\t\t}\n\n\t\t\t// If we're not rendering a specific page, use the front page template.\n\t\t\treturn getDefaultTemplateId( { slug: 'front-page' } );\n\t\t},\n\t\t[ homepageId, postsPageId, hasLoadedAllDependencies, postId, postType ]\n\t);\n\n\tconst context = useMemo( () => {\n\t\tif ( postTypesWithoutParentTemplate.includes( postType ) && postId ) {\n\t\t\treturn {};\n\t\t}\n\n\t\tif ( postType && postId && authorizedPostTypes.includes( postType ) ) {\n\t\t\treturn { postType, postId };\n\t\t}\n\t\t// TODO: for post types lists we should probably not render the front page, but maybe a placeholder\n\t\t// with a message like \"Select a page\" or something similar.\n\t\tif ( homepageId ) {\n\t\t\treturn { postType: 'page', postId: homepageId };\n\t\t}\n\n\t\treturn {};\n\t}, [ homepageId, postType, postId ] );\n\n\tif ( postTypesWithoutParentTemplate.includes( postType ) && postId ) {\n\t\treturn { isReady: true, postType, postId, context };\n\t}\n\n\tif ( hasLoadedAllDependencies ) {\n\t\treturn {\n\t\t\tisReady: resolvedTemplateId !== undefined,\n\t\t\tpostType: TEMPLATE_POST_TYPE,\n\t\t\tpostId: resolvedTemplateId,\n\t\t\tcontext,\n\t\t};\n\t}\n\n\treturn { isReady: false };\n}\n\nexport default function useInitEditedEntityFromURL() {\n\tconst { params = {} } = useLocation();\n\tconst { postType, postId, context, isReady } =\n\t\tuseResolveEditedEntityAndContext( params );\n\n\tconst { setEditedEntity } = useDispatch( editSiteStore );\n\tconst { resetZoomLevel } = unlock( useDispatch( blockEditorStore ) );\n\n\tuseEffect( () => {\n\t\tif ( isReady ) {\n\t\t\tresetZoomLevel();\n\t\t\tsetEditedEntity( postType, postId, context );\n\t\t}\n\t}, [\n\t\tisReady,\n\t\tpostType,\n\t\tpostId,\n\t\tcontext,\n\t\tsetEditedEntity,\n\t\tresetZoomLevel,\n\t] );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,OAAO,QAAQ,oBAAoB;AACvD,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,aAAa,QAAQ,sBAAsB;AAC7D,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;AACpE,SAASH,KAAK,IAAII,gBAAgB,QAAQ,yBAAyB;;AAEnE;AACA;AACA;AACA,SAASJ,KAAK,IAAIK,aAAa,QAAQ,aAAa;AACpD,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SACCC,kBAAkB,EAClBC,uBAAuB,EACvBC,oBAAoB,EACpBC,aAAa,QACP,uBAAuB;AAE9B,MAAM;EAAEC;AAAY,CAAC,GAAGL,MAAM,CAAEH,iBAAkB,CAAC;AAEnD,MAAMS,8BAA8B,GAAG,CACtCL,kBAAkB,EAClBC,uBAAuB,EACvBC,oBAAoB,EACpBC,aAAa,CAACG,IAAI,CAClB;AAED,MAAMC,mBAAmB,GAAG,CAAE,MAAM,EAAE,MAAM,CAAE;AAE9C,SAASC,gCAAgCA,CAAE;EAAEC,MAAM;EAAEC;AAAS,CAAC,EAAG;EACjE,MAAM;IAAEC,wBAAwB;IAAEC,UAAU;IAAEC;EAAY,CAAC,GAAGtB,SAAS,CACpEuB,MAAM,IAAM;IACb,MAAM;MAAEC;IAAgB,CAAC,GAAGD,MAAM,CAAEpB,aAAc,CAAC;IACnD,MAAMsB,QAAQ,GAAGD,eAAe,CAAE,MAAM,EAAE,MAAO,CAAC;IAClD,MAAME,W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/B,OAAO;MACNgC,OAAO,EAAEnB,kBAAkB,KAAKC,SAAS;MACzCf,QAAQ,EAAEV,kBAAkB;MAC5BS,MAAM,EAAEe,kBAAkB;MAC1BkB;IACD,CAAC;EACF;EAEA,OAAO;IAAEC,OAAO,EAAE;EAAM,CAAC;AAC1B;AAEA,eAAe,SAASC,0BAA0BA,CAAA,EAAG;EACpD,MAAM;IAAEC,MAAM,GAAG,CAAC;EAAE,CAAC,GAAGzC,WAAW,CAAC,CAAC;EACrC,MAAM;IAAEM,QAAQ;IAAED,MAAM;IAAEiC,OAAO;IAAEC;EAAQ,CAAC,GAC3CnC,gCAAgC,CAAEqC,MAAO,CAAC;EAE3C,MAAM;IAAEC;EAAgB,CAAC,GAAGtD,WAAW,CAAEM,aAAc,CAAC;EACxD,MAAM;IAAEiD;EAAe,CAAC,GAAGhD,MAAM,CAAEP,WAAW,CAAEK,gBAAiB,CAAE,CAAC;EAEpER,SAAS,CAAE,MAAM;IAChB,IAAKsD,OAAO,EAAG;MACdI,cAAc,CAAC,CAAC;MAChBD,eAAe,CAAEpC,QAAQ,EAAED,MAAM,EAAEiC,OAAQ,CAAC;IAC7C;EACD,CAAC,EAAE,CACFC,OAAO,EACPjC,QAAQ,EACRD,MAAM,EACNiC,OAAO,EACPI,eAAe,EACfC,cAAc,CACb,CAAC;AACJ","ignoreList":[]}
|
|
@@ -6,9 +6,11 @@ import WelcomeGuideStyles from './styles';
|
|
|
6
6
|
import WelcomeGuidePage from './page';
|
|
7
7
|
import WelcomeGuideTemplate from './template';
|
|
8
8
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
-
export default function WelcomeGuide(
|
|
9
|
+
export default function WelcomeGuide({
|
|
10
|
+
postType
|
|
11
|
+
}) {
|
|
10
12
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
11
|
-
children: [/*#__PURE__*/_jsx(WelcomeGuideEditor, {}), /*#__PURE__*/_jsx(WelcomeGuideStyles, {}), /*#__PURE__*/_jsx(WelcomeGuidePage, {}), /*#__PURE__*/_jsx(WelcomeGuideTemplate, {})]
|
|
13
|
+
children: [/*#__PURE__*/_jsx(WelcomeGuideEditor, {}), /*#__PURE__*/_jsx(WelcomeGuideStyles, {}), postType === 'page' && /*#__PURE__*/_jsx(WelcomeGuidePage, {}), postType === 'wp_template' && /*#__PURE__*/_jsx(WelcomeGuideTemplate, {})]
|
|
12
14
|
});
|
|
13
15
|
}
|
|
14
16
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["WelcomeGuideEditor","WelcomeGuideStyles","WelcomeGuidePage","WelcomeGuideTemplate","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","WelcomeGuide","children"],"sources":["@wordpress/edit-site/src/components/welcome-guide/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport WelcomeGuideEditor from './editor';\nimport WelcomeGuideStyles from './styles';\nimport WelcomeGuidePage from './page';\nimport WelcomeGuideTemplate from './template';\n\nexport default function WelcomeGuide() {\n\treturn (\n\t\t<>\n\t\t\t<WelcomeGuideEditor />\n\t\t\t<WelcomeGuideStyles />\n\t\t\t<WelcomeGuidePage
|
|
1
|
+
{"version":3,"names":["WelcomeGuideEditor","WelcomeGuideStyles","WelcomeGuidePage","WelcomeGuideTemplate","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","WelcomeGuide","postType","children"],"sources":["@wordpress/edit-site/src/components/welcome-guide/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport WelcomeGuideEditor from './editor';\nimport WelcomeGuideStyles from './styles';\nimport WelcomeGuidePage from './page';\nimport WelcomeGuideTemplate from './template';\n\nexport default function WelcomeGuide( { postType } ) {\n\treturn (\n\t\t<>\n\t\t\t<WelcomeGuideEditor />\n\t\t\t<WelcomeGuideStyles />\n\t\t\t{ postType === 'page' && <WelcomeGuidePage /> }\n\t\t\t{ postType === 'wp_template' && <WelcomeGuideTemplate /> }\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,kBAAkB,MAAM,UAAU;AACzC,OAAOC,kBAAkB,MAAM,UAAU;AACzC,OAAOC,gBAAgB,MAAM,QAAQ;AACrC,OAAOC,oBAAoB,MAAM,YAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAE9C,eAAe,SAASC,YAAYA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACpD,oBACCF,KAAA,CAAAF,SAAA;IAAAK,QAAA,gBACCP,IAAA,CAACL,kBAAkB,IAAE,CAAC,eACtBK,IAAA,CAACJ,kBAAkB,IAAE,CAAC,EACpBU,QAAQ,KAAK,MAAM,iBAAIN,IAAA,CAACH,gBAAgB,IAAE,CAAC,EAC3CS,QAAQ,KAAK,aAAa,iBAAIN,IAAA,CAACF,oBAAoB,IAAE,CAAC;EAAA,CACvD,CAAC;AAEL","ignoreList":[]}
|
|
@@ -5,11 +5,6 @@ import { useDispatch, useSelect } from '@wordpress/data';
|
|
|
5
5
|
import { Guide } from '@wordpress/components';
|
|
6
6
|
import { __ } from '@wordpress/i18n';
|
|
7
7
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Internal dependencies
|
|
11
|
-
*/
|
|
12
|
-
import { store as editSiteStore } from '../../store';
|
|
13
8
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
9
|
export default function WelcomeGuidePage() {
|
|
15
10
|
const {
|
|
@@ -18,10 +13,7 @@ export default function WelcomeGuidePage() {
|
|
|
18
13
|
const isVisible = useSelect(select => {
|
|
19
14
|
const isPageActive = !!select(preferencesStore).get('core/edit-site', 'welcomeGuidePage');
|
|
20
15
|
const isEditorActive = !!select(preferencesStore).get('core/edit-site', 'welcomeGuide');
|
|
21
|
-
|
|
22
|
-
isPage
|
|
23
|
-
} = select(editSiteStore);
|
|
24
|
-
return isPageActive && !isEditorActive && isPage();
|
|
16
|
+
return isPageActive && !isEditorActive;
|
|
25
17
|
}, []);
|
|
26
18
|
if (!isVisible) {
|
|
27
19
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useDispatch","useSelect","Guide","__","store","preferencesStore","
|
|
1
|
+
{"version":3,"names":["useDispatch","useSelect","Guide","__","store","preferencesStore","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","WelcomeGuidePage","toggle","isVisible","select","isPageActive","get","isEditorActive","heading","className","contentLabel","finishButtonText","onFinish","pages","image","autoPlay","loop","muted","width","height","children","src","type","content"],"sources":["@wordpress/edit-site/src/components/welcome-guide/page.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { Guide } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\nexport default function WelcomeGuidePage() {\n\tconst { toggle } = useDispatch( preferencesStore );\n\n\tconst isVisible = useSelect( ( select ) => {\n\t\tconst isPageActive = !! select( preferencesStore ).get(\n\t\t\t'core/edit-site',\n\t\t\t'welcomeGuidePage'\n\t\t);\n\t\tconst isEditorActive = !! select( preferencesStore ).get(\n\t\t\t'core/edit-site',\n\t\t\t'welcomeGuide'\n\t\t);\n\t\treturn isPageActive && ! isEditorActive;\n\t}, [] );\n\n\tif ( ! isVisible ) {\n\t\treturn null;\n\t}\n\n\tconst heading = __( 'Editing a page' );\n\n\treturn (\n\t\t<Guide\n\t\t\tclassName=\"edit-site-welcome-guide guide-page\"\n\t\t\tcontentLabel={ heading }\n\t\t\tfinishButtonText={ __( 'Continue' ) }\n\t\t\tonFinish={ () => toggle( 'core/edit-site', 'welcomeGuidePage' ) }\n\t\t\tpages={ [\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<video\n\t\t\t\t\t\t\tclassName=\"edit-site-welcome-guide__video\"\n\t\t\t\t\t\t\tautoPlay\n\t\t\t\t\t\t\tloop\n\t\t\t\t\t\t\tmuted\n\t\t\t\t\t\t\twidth=\"312\"\n\t\t\t\t\t\t\theight=\"240\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<source\n\t\t\t\t\t\t\t\tsrc=\"https://s.w.org/images/block-editor/editing-your-page.mp4\"\n\t\t\t\t\t\t\t\ttype=\"video/mp4\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</video>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-site-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ heading }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-site-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'It’s now possible to edit page content in the site editor. To customise other parts of the page like the header and footer switch to editing the template using the settings sidebar.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t] }\n\t\t/>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,wBAAwB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAEnE,eAAe,SAASC,gBAAgBA,CAAA,EAAG;EAC1C,MAAM;IAAEC;EAAO,CAAC,GAAGb,WAAW,CAAEK,gBAAiB,CAAC;EAElD,MAAMS,SAAS,GAAGb,SAAS,CAAIc,MAAM,IAAM;IAC1C,MAAMC,YAAY,GAAG,CAAC,CAAED,MAAM,CAAEV,gBAAiB,CAAC,CAACY,GAAG,CACrD,gBAAgB,EAChB,kBACD,CAAC;IACD,MAAMC,cAAc,GAAG,CAAC,CAAEH,MAAM,CAAEV,gBAAiB,CAAC,CAACY,GAAG,CACvD,gBAAgB,EAChB,cACD,CAAC;IACD,OAAOD,YAAY,IAAI,CAAEE,cAAc;EACxC,CAAC,EAAE,EAAG,CAAC;EAEP,IAAK,CAAEJ,SAAS,EAAG;IAClB,OAAO,IAAI;EACZ;EAEA,MAAMK,OAAO,GAAGhB,EAAE,CAAE,gBAAiB,CAAC;EAEtC,oBACCI,IAAA,CAACL,KAAK;IACLkB,SAAS,EAAC,oCAAoC;IAC9CC,YAAY,EAAGF,OAAS;IACxBG,gBAAgB,EAAGnB,EAAE,CAAE,UAAW,CAAG;IACrCoB,QAAQ,EAAGA,CAAA,KAAMV,MAAM,CAAE,gBAAgB,EAAE,kBAAmB,CAAG;IACjEW,KAAK,EAAG,CACP;MACCC,KAAK,eACJlB,IAAA;QACCa,SAAS,EAAC,gCAAgC;QAC1CM,QAAQ;QACRC,IAAI;QACJC,KAAK;QACLC,KAAK,EAAC,KAAK;QACXC,MAAM,EAAC,KAAK;QAAAC,QAAA,eAEZxB,IAAA;UACCyB,GAAG,EAAC,2DAA2D;UAC/DC,IAAI,EAAC;QAAW,CAChB;MAAC,CACI,CACP;MACDC,OAAO,eACNvB,KAAA,CAAAF,SAAA;QAAAsB,QAAA,gBACCxB,IAAA;UAAIa,SAAS,EAAC,kCAAkC;UAAAW,QAAA,EAC7CZ;QAAO,CACN,CAAC,eACLZ,IAAA;UAAGa,SAAS,EAAC,+BAA+B;UAAAW,QAAA,EACzC5B,EAAE,CACH,uLACD;QAAC,CACC,CAAC;MAAA,CACH;IAEJ,CAAC;EACC,CACH,CAAC;AAEJ","ignoreList":[]}
|
|
@@ -6,21 +6,11 @@ import { Guide } from '@wordpress/components';
|
|
|
6
6
|
import { __ } from '@wordpress/i18n';
|
|
7
7
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
8
8
|
import { store as editorStore } from '@wordpress/editor';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Internal dependencies
|
|
12
|
-
*/
|
|
13
|
-
import useEditedEntityRecord from '../use-edited-entity-record';
|
|
14
9
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
10
|
export default function WelcomeGuideTemplate() {
|
|
16
11
|
const {
|
|
17
12
|
toggle
|
|
18
13
|
} = useDispatch(preferencesStore);
|
|
19
|
-
const {
|
|
20
|
-
isLoaded,
|
|
21
|
-
record
|
|
22
|
-
} = useEditedEntityRecord();
|
|
23
|
-
const isPostTypeTemplate = isLoaded && record.type === 'wp_template';
|
|
24
14
|
const {
|
|
25
15
|
isActive,
|
|
26
16
|
hasPreviousEntity
|
|
@@ -36,7 +26,7 @@ export default function WelcomeGuideTemplate() {
|
|
|
36
26
|
hasPreviousEntity: !!getEditorSettings().onNavigateToPreviousEntityRecord
|
|
37
27
|
};
|
|
38
28
|
}, []);
|
|
39
|
-
const isVisible = isActive &&
|
|
29
|
+
const isVisible = isActive && hasPreviousEntity;
|
|
40
30
|
if (!isVisible) {
|
|
41
31
|
return null;
|
|
42
32
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useDispatch","useSelect","Guide","__","store","preferencesStore","editorStore","
|
|
1
|
+
{"version":3,"names":["useDispatch","useSelect","Guide","__","store","preferencesStore","editorStore","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","WelcomeGuideTemplate","toggle","isActive","hasPreviousEntity","select","getEditorSettings","get","onNavigateToPreviousEntityRecord","isVisible","heading","className","contentLabel","finishButtonText","onFinish","pages","image","autoPlay","loop","muted","width","height","children","src","type","content"],"sources":["@wordpress/edit-site/src/components/welcome-guide/template.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { Guide } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as editorStore } from '@wordpress/editor';\n\nexport default function WelcomeGuideTemplate() {\n\tconst { toggle } = useDispatch( preferencesStore );\n\n\tconst { isActive, hasPreviousEntity } = useSelect( ( select ) => {\n\t\tconst { getEditorSettings } = select( editorStore );\n\t\tconst { get } = select( preferencesStore );\n\t\treturn {\n\t\t\tisActive: get( 'core/edit-site', 'welcomeGuideTemplate' ),\n\t\t\thasPreviousEntity:\n\t\t\t\t!! getEditorSettings().onNavigateToPreviousEntityRecord,\n\t\t};\n\t}, [] );\n\tconst isVisible = isActive && hasPreviousEntity;\n\n\tif ( ! isVisible ) {\n\t\treturn null;\n\t}\n\n\tconst heading = __( 'Editing a template' );\n\n\treturn (\n\t\t<Guide\n\t\t\tclassName=\"edit-site-welcome-guide guide-template\"\n\t\t\tcontentLabel={ heading }\n\t\t\tfinishButtonText={ __( 'Continue' ) }\n\t\t\tonFinish={ () =>\n\t\t\t\ttoggle( 'core/edit-site', 'welcomeGuideTemplate' )\n\t\t\t}\n\t\t\tpages={ [\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<video\n\t\t\t\t\t\t\tclassName=\"edit-site-welcome-guide__video\"\n\t\t\t\t\t\t\tautoPlay\n\t\t\t\t\t\t\tloop\n\t\t\t\t\t\t\tmuted\n\t\t\t\t\t\t\twidth=\"312\"\n\t\t\t\t\t\t\theight=\"240\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<source\n\t\t\t\t\t\t\t\tsrc=\"https://s.w.org/images/block-editor/editing-your-template.mp4\"\n\t\t\t\t\t\t\t\ttype=\"video/mp4\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</video>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-site-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ heading }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-site-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'Note that the same template can be used by multiple pages, so any changes made here may affect other pages on the site. To switch back to editing the page content click the ‘Back’ button in the toolbar.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t] }\n\t\t/>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,wBAAwB;AAClE,SAASD,KAAK,IAAIE,WAAW,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAEzD,eAAe,SAASC,oBAAoBA,CAAA,EAAG;EAC9C,MAAM;IAAEC;EAAO,CAAC,GAAGd,WAAW,CAAEK,gBAAiB,CAAC;EAElD,MAAM;IAAEU,QAAQ;IAAEC;EAAkB,CAAC,GAAGf,SAAS,CAAIgB,MAAM,IAAM;IAChE,MAAM;MAAEC;IAAkB,CAAC,GAAGD,MAAM,CAAEX,WAAY,CAAC;IACnD,MAAM;MAAEa;IAAI,CAAC,GAAGF,MAAM,CAAEZ,gBAAiB,CAAC;IAC1C,OAAO;MACNU,QAAQ,EAAEI,GAAG,CAAE,gBAAgB,EAAE,sBAAuB,CAAC;MACzDH,iBAAiB,EAChB,CAAC,CAAEE,iBAAiB,CAAC,CAAC,CAACE;IACzB,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EACP,MAAMC,SAAS,GAAGN,QAAQ,IAAIC,iBAAiB;EAE/C,IAAK,CAAEK,SAAS,EAAG;IAClB,OAAO,IAAI;EACZ;EAEA,MAAMC,OAAO,GAAGnB,EAAE,CAAE,oBAAqB,CAAC;EAE1C,oBACCK,IAAA,CAACN,KAAK;IACLqB,SAAS,EAAC,wCAAwC;IAClDC,YAAY,EAAGF,OAAS;IACxBG,gBAAgB,EAAGtB,EAAE,CAAE,UAAW,CAAG;IACrCuB,QAAQ,EAAGA,CAAA,KACVZ,MAAM,CAAE,gBAAgB,EAAE,sBAAuB,CACjD;IACDa,KAAK,EAAG,CACP;MACCC,KAAK,eACJpB,IAAA;QACCe,SAAS,EAAC,gCAAgC;QAC1CM,QAAQ;QACRC,IAAI;QACJC,KAAK;QACLC,KAAK,EAAC,KAAK;QACXC,MAAM,EAAC,KAAK;QAAAC,QAAA,eAEZ1B,IAAA;UACC2B,GAAG,EAAC,+DAA+D;UACnEC,IAAI,EAAC;QAAW,CAChB;MAAC,CACI,CACP;MACDC,OAAO,eACNzB,KAAA,CAAAF,SAAA;QAAAwB,QAAA,gBACC1B,IAAA;UAAIe,SAAS,EAAC,kCAAkC;UAAAW,QAAA,EAC7CZ;QAAO,CACN,CAAC,eACLd,IAAA;UAAGe,SAAS,EAAC,+BAA+B;UAAAW,QAAA,EACzC/B,EAAE,CACH,4MACD;QAAC,CACC,CAAC;MAAA,CACH;IAEJ,CAAC;EACC,CACH,CAAC;AAEJ","ignoreList":[]}
|
|
@@ -23,7 +23,7 @@ const {
|
|
|
23
23
|
useHistory,
|
|
24
24
|
useLocation
|
|
25
25
|
} = unlock(routerPrivateApis);
|
|
26
|
-
function useGlobalStylesOpenStylesCommands() {
|
|
26
|
+
const getGlobalStylesOpenStylesCommands = () => function useGlobalStylesOpenStylesCommands() {
|
|
27
27
|
const {
|
|
28
28
|
openGeneralSidebar
|
|
29
29
|
} = unlock(useDispatch(editSiteStore));
|
|
@@ -71,8 +71,8 @@ function useGlobalStylesOpenStylesCommands() {
|
|
|
71
71
|
isLoading: false,
|
|
72
72
|
commands
|
|
73
73
|
};
|
|
74
|
-
}
|
|
75
|
-
function useGlobalStylesToggleWelcomeGuideCommands() {
|
|
74
|
+
};
|
|
75
|
+
const getGlobalStylesToggleWelcomeGuideCommands = () => function useGlobalStylesToggleWelcomeGuideCommands() {
|
|
76
76
|
const {
|
|
77
77
|
openGeneralSidebar
|
|
78
78
|
} = unlock(useDispatch(editSiteStore));
|
|
@@ -129,8 +129,8 @@ function useGlobalStylesToggleWelcomeGuideCommands() {
|
|
|
129
129
|
isLoading: false,
|
|
130
130
|
commands
|
|
131
131
|
};
|
|
132
|
-
}
|
|
133
|
-
function useGlobalStylesResetCommands() {
|
|
132
|
+
};
|
|
133
|
+
const getGlobalStylesResetCommands = () => function useGlobalStylesResetCommands() {
|
|
134
134
|
const [canReset, onReset] = useGlobalStylesReset();
|
|
135
135
|
const commands = useMemo(() => {
|
|
136
136
|
if (!canReset) {
|
|
@@ -152,8 +152,8 @@ function useGlobalStylesResetCommands() {
|
|
|
152
152
|
isLoading: false,
|
|
153
153
|
commands
|
|
154
154
|
};
|
|
155
|
-
}
|
|
156
|
-
function useGlobalStylesOpenCssCommands() {
|
|
155
|
+
};
|
|
156
|
+
const getGlobalStylesOpenCssCommands = () => function useGlobalStylesOpenCssCommands() {
|
|
157
157
|
const {
|
|
158
158
|
openGeneralSidebar,
|
|
159
159
|
setEditorCanvasContainerView
|
|
@@ -213,8 +213,8 @@ function useGlobalStylesOpenCssCommands() {
|
|
|
213
213
|
isLoading: false,
|
|
214
214
|
commands
|
|
215
215
|
};
|
|
216
|
-
}
|
|
217
|
-
function useGlobalStylesOpenRevisionsCommands() {
|
|
216
|
+
};
|
|
217
|
+
const getGlobalStylesOpenRevisionsCommands = () => function useGlobalStylesOpenRevisionsCommands() {
|
|
218
218
|
const {
|
|
219
219
|
openGeneralSidebar,
|
|
220
220
|
setEditorCanvasContainerView
|
|
@@ -270,7 +270,7 @@ function useGlobalStylesOpenRevisionsCommands() {
|
|
|
270
270
|
isLoading: false,
|
|
271
271
|
commands
|
|
272
272
|
};
|
|
273
|
-
}
|
|
273
|
+
};
|
|
274
274
|
export function useCommonCommands() {
|
|
275
275
|
const homeUrl = useSelect(select => {
|
|
276
276
|
// Site index.
|
|
@@ -289,23 +289,23 @@ export function useCommonCommands() {
|
|
|
289
289
|
});
|
|
290
290
|
useCommandLoader({
|
|
291
291
|
name: 'core/edit-site/open-styles',
|
|
292
|
-
hook:
|
|
292
|
+
hook: getGlobalStylesOpenStylesCommands()
|
|
293
293
|
});
|
|
294
294
|
useCommandLoader({
|
|
295
295
|
name: 'core/edit-site/toggle-styles-welcome-guide',
|
|
296
|
-
hook:
|
|
296
|
+
hook: getGlobalStylesToggleWelcomeGuideCommands()
|
|
297
297
|
});
|
|
298
298
|
useCommandLoader({
|
|
299
299
|
name: 'core/edit-site/reset-global-styles',
|
|
300
|
-
hook:
|
|
300
|
+
hook: getGlobalStylesResetCommands()
|
|
301
301
|
});
|
|
302
302
|
useCommandLoader({
|
|
303
303
|
name: 'core/edit-site/open-styles-css',
|
|
304
|
-
hook:
|
|
304
|
+
hook: getGlobalStylesOpenCssCommands()
|
|
305
305
|
});
|
|
306
306
|
useCommandLoader({
|
|
307
307
|
name: 'core/edit-site/open-styles-revisions',
|
|
308
|
-
hook:
|
|
308
|
+
hook: getGlobalStylesOpenRevisionsCommands()
|
|
309
309
|
});
|
|
310
310
|
}
|
|
311
311
|
//# sourceMappingURL=use-common-commands.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useMemo","useDispatch","useSelect","__","isRTL","rotateLeft","rotateRight","backup","help","styles","external","brush","useCommandLoader","useCommand","privateApis","blockEditorPrivateApis","routerPrivateApis","store","preferencesStore","coreStore","unlock","editSiteStore","useGlobalStylesReset","useHistory","useLocation","useGlobalStylesOpenStylesCommands","openGeneralSidebar","params","canvas","history","isBlockBasedTheme","select","getCurrentTheme","is_block_theme","commands","name","label","callback","close","postId","push","path","undefined","transition","icon","isLoading","useGlobalStylesToggleWelcomeGuideCommands","set","setTimeout","useGlobalStylesResetCommands","canReset","onReset","useGlobalStylesOpenCssCommands","setEditorCanvasContainerView","canEditCSS","getEntityRecord","__experimentalGetCurrentGlobalStylesId","globalStylesId","globalStyles","_links","useGlobalStylesOpenRevisionsCommands","hasRevisions","count","useCommonCommands","homeUrl","home","window","open","hook"],"sources":["@wordpress/edit-site/src/hooks/commands/use-common-commands.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __, isRTL } from '@wordpress/i18n';\nimport {\n\trotateLeft,\n\trotateRight,\n\tbackup,\n\thelp,\n\tstyles,\n\texternal,\n\tbrush,\n} from '@wordpress/icons';\nimport { useCommandLoader, useCommand } from '@wordpress/commands';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\n\nconst { useGlobalStylesReset } = unlock( blockEditorPrivateApis );\nconst { useHistory, useLocation } = unlock( routerPrivateApis );\n\nfunction useGlobalStylesOpenStylesCommands() {\n\tconst { openGeneralSidebar } = unlock( useDispatch( editSiteStore ) );\n\tconst { params } = useLocation();\n\tconst { canvas = 'view' } = params;\n\tconst history = useHistory();\n\tconst isBlockBasedTheme = useSelect( ( select ) => {\n\t\treturn select( coreStore ).getCurrentTheme().is_block_theme;\n\t}, [] );\n\n\tconst commands = useMemo( () => {\n\t\tif ( ! isBlockBasedTheme ) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn [\n\t\t\t{\n\t\t\t\tname: 'core/edit-site/open-styles',\n\t\t\t\tlabel: __( 'Open styles' ),\n\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\tclose();\n\t\t\t\t\tif ( ! params.postId ) {\n\t\t\t\t\t\thistory.push( {\n\t\t\t\t\t\t\tpath: '/wp_global_styles',\n\t\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t\tif ( params.postId && canvas !== 'edit' ) {\n\t\t\t\t\t\thistory.push(\n\t\t\t\t\t\t\t{ ...params, canvas: 'edit' },\n\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttransition: 'canvas-mode-edit-transition',\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\t\t},\n\t\t\t\ticon: styles,\n\t\t\t},\n\t\t];\n\t}, [ history, openGeneralSidebar, params, canvas, isBlockBasedTheme ] );\n\n\treturn {\n\t\tisLoading: false,\n\t\tcommands,\n\t};\n}\n\nfunction useGlobalStylesToggleWelcomeGuideCommands() {\n\tconst { openGeneralSidebar } = unlock( useDispatch( editSiteStore ) );\n\tconst { params } = useLocation();\n\tconst { canvas = 'view' } = params;\n\tconst { set } = useDispatch( preferencesStore );\n\n\tconst history = useHistory();\n\tconst isBlockBasedTheme = useSelect( ( select ) => {\n\t\treturn select( coreStore ).getCurrentTheme().is_block_theme;\n\t}, [] );\n\n\tconst commands = useMemo( () => {\n\t\tif ( ! isBlockBasedTheme ) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn [\n\t\t\t{\n\t\t\t\tname: 'core/edit-site/toggle-styles-welcome-guide',\n\t\t\t\tlabel: __( 'Learn about styles' ),\n\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\tclose();\n\t\t\t\t\tif ( ! params.postId ) {\n\t\t\t\t\t\thistory.push( {\n\t\t\t\t\t\t\tpath: '/wp_global_styles',\n\t\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t\tif ( params.postId && canvas !== 'edit' ) {\n\t\t\t\t\t\thistory.push(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t...params,\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\tundefined,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttransition: 'canvas-mode-edit-transition',\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\t\t\tset( 'core/edit-site', 'welcomeGuideStyles', true );\n\t\t\t\t\t// sometimes there's a focus loss that happens after some time\n\t\t\t\t\t// that closes the modal, we need to force reopening it.\n\t\t\t\t\tsetTimeout( () => {\n\t\t\t\t\t\tset( 'core/edit-site', 'welcomeGuideStyles', true );\n\t\t\t\t\t}, 500 );\n\t\t\t\t},\n\t\t\t\ticon: help,\n\t\t\t},\n\t\t];\n\t}, [\n\t\thistory,\n\t\topenGeneralSidebar,\n\t\tcanvas,\n\t\tisBlockBasedTheme,\n\t\tset,\n\t\tparams,\n\t] );\n\n\treturn {\n\t\tisLoading: false,\n\t\tcommands,\n\t};\n}\n\nfunction useGlobalStylesResetCommands() {\n\tconst [ canReset, onReset ] = useGlobalStylesReset();\n\tconst commands = useMemo( () => {\n\t\tif ( ! canReset ) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn [\n\t\t\t{\n\t\t\t\tname: 'core/edit-site/reset-global-styles',\n\t\t\t\tlabel: __( 'Reset styles' ),\n\t\t\t\ticon: isRTL() ? rotateRight : rotateLeft,\n\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\tclose();\n\t\t\t\t\tonReset();\n\t\t\t\t},\n\t\t\t},\n\t\t];\n\t}, [ canReset, onReset ] );\n\n\treturn {\n\t\tisLoading: false,\n\t\tcommands,\n\t};\n}\n\nfunction useGlobalStylesOpenCssCommands() {\n\tconst { openGeneralSidebar, setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst { params } = useLocation();\n\tconst { canvas = 'view' } = params;\n\tconst history = useHistory();\n\tconst { canEditCSS } = useSelect( ( select ) => {\n\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\tselect( coreStore );\n\n\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\tconst globalStyles = globalStylesId\n\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\tcanEditCSS: !! globalStyles?._links?.[ 'wp:action-edit-css' ],\n\t\t};\n\t}, [] );\n\n\tconst commands = useMemo( () => {\n\t\tif ( ! canEditCSS ) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn [\n\t\t\t{\n\t\t\t\tname: 'core/edit-site/open-styles-css',\n\t\t\t\tlabel: __( 'Customize CSS' ),\n\t\t\t\ticon: brush,\n\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\tclose();\n\t\t\t\t\tif ( ! params.postId ) {\n\t\t\t\t\t\thistory.push( {\n\t\t\t\t\t\t\tpath: '/wp_global_styles',\n\t\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t\tif ( params.postId && canvas !== 'edit' ) {\n\t\t\t\t\t\thistory.push(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t...params,\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\tundefined,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttransition: 'canvas-mode-edit-transition',\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\t\t\tsetEditorCanvasContainerView( 'global-styles-css' );\n\t\t\t\t},\n\t\t\t},\n\t\t];\n\t}, [\n\t\thistory,\n\t\topenGeneralSidebar,\n\t\tsetEditorCanvasContainerView,\n\t\tcanEditCSS,\n\t\tcanvas,\n\t\tparams,\n\t] );\n\treturn {\n\t\tisLoading: false,\n\t\tcommands,\n\t};\n}\n\nfunction useGlobalStylesOpenRevisionsCommands() {\n\tconst { openGeneralSidebar, setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst { params } = useLocation();\n\tconst { canvas = 'view' } = params;\n\tconst history = useHistory();\n\tconst hasRevisions = useSelect( ( select ) => {\n\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\tselect( coreStore );\n\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\tconst globalStyles = globalStylesId\n\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t: undefined;\n\t\treturn !! globalStyles?._links?.[ 'version-history' ]?.[ 0 ]?.count;\n\t}, [] );\n\n\tconst commands = useMemo( () => {\n\t\tif ( ! hasRevisions ) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn [\n\t\t\t{\n\t\t\t\tname: 'core/edit-site/open-global-styles-revisions',\n\t\t\t\tlabel: __( 'Style revisions' ),\n\t\t\t\ticon: backup,\n\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\tclose();\n\t\t\t\t\tif ( ! params.postId ) {\n\t\t\t\t\t\thistory.push( {\n\t\t\t\t\t\t\tpath: '/wp_global_styles',\n\t\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t\tif ( params.postId && canvas !== 'edit' ) {\n\t\t\t\t\t\thistory.push(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t...params,\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\tundefined,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttransition: 'canvas-mode-edit-transition',\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\t\t\tsetEditorCanvasContainerView( 'global-styles-revisions' );\n\t\t\t\t},\n\t\t\t},\n\t\t];\n\t}, [\n\t\thasRevisions,\n\t\thistory,\n\t\topenGeneralSidebar,\n\t\tsetEditorCanvasContainerView,\n\t\tcanvas,\n\t\tparams,\n\t] );\n\n\treturn {\n\t\tisLoading: false,\n\t\tcommands,\n\t};\n}\n\nexport function useCommonCommands() {\n\tconst homeUrl = useSelect( ( select ) => {\n\t\t// Site index.\n\t\treturn select( coreStore ).getEntityRecord( 'root', '__unstableBase' )\n\t\t\t?.home;\n\t}, [] );\n\n\tuseCommand( {\n\t\tname: 'core/edit-site/view-site',\n\t\tlabel: __( 'View site' ),\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\twindow.open( homeUrl, '_blank' );\n\t\t},\n\t\ticon: external,\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/open-styles',\n\t\thook: useGlobalStylesOpenStylesCommands,\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/toggle-styles-welcome-guide',\n\t\thook: useGlobalStylesToggleWelcomeGuideCommands,\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/reset-global-styles',\n\t\thook: useGlobalStylesResetCommands,\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/open-styles-css',\n\t\thook: useGlobalStylesOpenCssCommands,\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/open-styles-revisions',\n\t\thook: useGlobalStylesOpenRevisionsCommands,\n\t} );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,EAAE,EAAEC,KAAK,QAAQ,iBAAiB;AAC3C,SACCC,UAAU,EACVC,WAAW,EACXC,MAAM,EACNC,IAAI,EACJC,MAAM,EACNC,QAAQ,EACRC,KAAK,QACC,kBAAkB;AACzB,SAASC,gBAAgB,EAAEC,UAAU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AC,EACnEU,IAAI;EACR,CAAC,EAAE,EAAG,CAAC;EAEPpD,UAAU,CAAE;IACXsB,IAAI,EAAE,0BAA0B;IAChCC,KAAK,EAAEjC,EAAE,CAAE,WAAY,CAAC;IACxBkC,QAAQ,EAAEA,CAAE;MAAEC;IAAM,CAAC,KAAM;MAC1BA,KAAK,CAAC,CAAC;MACP4B,MAAM,CAACC,IAAI,CAAEH,OAAO,EAAE,QAAS,CAAC;IACjC,CAAC;IACDpB,IAAI,EAAElC;EACP,CAAE,CAAC;EAEHE,gBAAgB,CAAE;IACjBuB,IAAI,EAAE,4BAA4B;IAClCiC,IAAI,EAAE3C;EACP,CAAE,CAAC;EAEHb,gBAAgB,CAAE;IACjBuB,IAAI,EAAE,4CAA4C;IAClDiC,IAAI,EAAEtB;EACP,CAAE,CAAC;EAEHlC,gBAAgB,CAAE;IACjBuB,IAAI,EAAE,oCAAoC;IAC1CiC,IAAI,EAAEnB;EACP,CAAE,CAAC;EAEHrC,gBAAgB,CAAE;IACjBuB,IAAI,EAAE,gCAAgC;IACtCiC,IAAI,EAAEhB;EACP,CAAE,CAAC;EAEHxC,gBAAgB,CAAE;IACjBuB,IAAI,EAAE,sCAAsC;IAC5CiC,IAAI,EAAER;EACP,CAAE,CAAC;AACJ","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["useMemo","useDispatch","useSelect","__","isRTL","rotateLeft","rotateRight","backup","help","styles","external","brush","useCommandLoader","useCommand","privateApis","blockEditorPrivateApis","routerPrivateApis","store","preferencesStore","coreStore","unlock","editSiteStore","useGlobalStylesReset","useHistory","useLocation","getGlobalStylesOpenStylesCommands","useGlobalStylesOpenStylesCommands","openGeneralSidebar","params","canvas","history","isBlockBasedTheme","select","getCurrentTheme","is_block_theme","commands","name","label","callback","close","postId","push","path","undefined","transition","icon","isLoading","getGlobalStylesToggleWelcomeGuideCommands","useGlobalStylesToggleWelcomeGuideCommands","set","setTimeout","getGlobalStylesResetCommands","useGlobalStylesResetCommands","canReset","onReset","getGlobalStylesOpenCssCommands","useGlobalStylesOpenCssCommands","setEditorCanvasContainerView","canEditCSS","getEntityRecord","__experimentalGetCurrentGlobalStylesId","globalStylesId","globalStyles","_links","getGlobalStylesOpenRevisionsCommands","useGlobalStylesOpenRevisionsCommands","hasRevisions","count","useCommonCommands","homeUrl","home","window","open","hook"],"sources":["@wordpress/edit-site/src/hooks/commands/use-common-commands.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __, isRTL } from '@wordpress/i18n';\nimport {\n\trotateLeft,\n\trotateRight,\n\tbackup,\n\thelp,\n\tstyles,\n\texternal,\n\tbrush,\n} from '@wordpress/icons';\nimport { useCommandLoader, useCommand } from '@wordpress/commands';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\n\nconst { useGlobalStylesReset } = unlock( blockEditorPrivateApis );\nconst { useHistory, useLocation } = unlock( routerPrivateApis );\n\nconst getGlobalStylesOpenStylesCommands = () =>\n\tfunction useGlobalStylesOpenStylesCommands() {\n\t\tconst { openGeneralSidebar } = unlock( useDispatch( editSiteStore ) );\n\t\tconst { params } = useLocation();\n\t\tconst { canvas = 'view' } = params;\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\n\t\tconst commands = useMemo( () => {\n\t\t\tif ( ! isBlockBasedTheme ) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tname: 'core/edit-site/open-styles',\n\t\t\t\t\tlabel: __( 'Open styles' ),\n\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\tclose();\n\t\t\t\t\t\tif ( ! params.postId ) {\n\t\t\t\t\t\t\thistory.push( {\n\t\t\t\t\t\t\t\tpath: '/wp_global_styles',\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}\n\t\t\t\t\t\tif ( params.postId && canvas !== 'edit' ) {\n\t\t\t\t\t\t\thistory.push(\n\t\t\t\t\t\t\t\t{ ...params, canvas: 'edit' },\n\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttransition: 'canvas-mode-edit-transition',\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\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\t\t\t},\n\t\t\t\t\ticon: styles,\n\t\t\t\t},\n\t\t\t];\n\t\t}, [ history, openGeneralSidebar, params, canvas, isBlockBasedTheme ] );\n\n\t\treturn {\n\t\t\tisLoading: false,\n\t\t\tcommands,\n\t\t};\n\t};\n\nconst getGlobalStylesToggleWelcomeGuideCommands = () =>\n\tfunction useGlobalStylesToggleWelcomeGuideCommands() {\n\t\tconst { openGeneralSidebar } = unlock( useDispatch( editSiteStore ) );\n\t\tconst { params } = useLocation();\n\t\tconst { canvas = 'view' } = params;\n\t\tconst { set } = useDispatch( preferencesStore );\n\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\n\t\tconst commands = useMemo( () => {\n\t\t\tif ( ! isBlockBasedTheme ) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tname: 'core/edit-site/toggle-styles-welcome-guide',\n\t\t\t\t\tlabel: __( 'Learn about styles' ),\n\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\tclose();\n\t\t\t\t\t\tif ( ! params.postId ) {\n\t\t\t\t\t\t\thistory.push( {\n\t\t\t\t\t\t\t\tpath: '/wp_global_styles',\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}\n\t\t\t\t\t\tif ( params.postId && canvas !== 'edit' ) {\n\t\t\t\t\t\t\thistory.push(\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t...params,\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\tundefined,\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttransition: 'canvas-mode-edit-transition',\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\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\t\t\t\tset( 'core/edit-site', 'welcomeGuideStyles', true );\n\t\t\t\t\t\t// sometimes there's a focus loss that happens after some time\n\t\t\t\t\t\t// that closes the modal, we need to force reopening it.\n\t\t\t\t\t\tsetTimeout( () => {\n\t\t\t\t\t\t\tset( 'core/edit-site', 'welcomeGuideStyles', true );\n\t\t\t\t\t\t}, 500 );\n\t\t\t\t\t},\n\t\t\t\t\ticon: help,\n\t\t\t\t},\n\t\t\t];\n\t\t}, [\n\t\t\thistory,\n\t\t\topenGeneralSidebar,\n\t\t\tcanvas,\n\t\t\tisBlockBasedTheme,\n\t\t\tset,\n\t\t\tparams,\n\t\t] );\n\n\t\treturn {\n\t\t\tisLoading: false,\n\t\t\tcommands,\n\t\t};\n\t};\n\nconst getGlobalStylesResetCommands = () =>\n\tfunction useGlobalStylesResetCommands() {\n\t\tconst [ canReset, onReset ] = useGlobalStylesReset();\n\t\tconst commands = useMemo( () => {\n\t\t\tif ( ! canReset ) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tname: 'core/edit-site/reset-global-styles',\n\t\t\t\t\tlabel: __( 'Reset styles' ),\n\t\t\t\t\ticon: isRTL() ? rotateRight : rotateLeft,\n\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\tclose();\n\t\t\t\t\t\tonReset();\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t];\n\t\t}, [ canReset, onReset ] );\n\n\t\treturn {\n\t\t\tisLoading: false,\n\t\t\tcommands,\n\t\t};\n\t};\n\nconst getGlobalStylesOpenCssCommands = () =>\n\tfunction useGlobalStylesOpenCssCommands() {\n\t\tconst { openGeneralSidebar, setEditorCanvasContainerView } = unlock(\n\t\t\tuseDispatch( editSiteStore )\n\t\t);\n\t\tconst { params } = useLocation();\n\t\tconst { canvas = 'view' } = params;\n\t\tconst history = useHistory();\n\t\tconst { canEditCSS } = useSelect( ( select ) => {\n\t\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\t\tselect( coreStore );\n\n\t\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\t\tconst globalStyles = globalStylesId\n\t\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t\t: undefined;\n\n\t\t\treturn {\n\t\t\t\tcanEditCSS: !! globalStyles?._links?.[ 'wp:action-edit-css' ],\n\t\t\t};\n\t\t}, [] );\n\n\t\tconst commands = useMemo( () => {\n\t\t\tif ( ! canEditCSS ) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tname: 'core/edit-site/open-styles-css',\n\t\t\t\t\tlabel: __( 'Customize CSS' ),\n\t\t\t\t\ticon: brush,\n\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\tclose();\n\t\t\t\t\t\tif ( ! params.postId ) {\n\t\t\t\t\t\t\thistory.push( {\n\t\t\t\t\t\t\t\tpath: '/wp_global_styles',\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}\n\t\t\t\t\t\tif ( params.postId && canvas !== 'edit' ) {\n\t\t\t\t\t\t\thistory.push(\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t...params,\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\tundefined,\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttransition: 'canvas-mode-edit-transition',\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\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\t\t\t\tsetEditorCanvasContainerView( 'global-styles-css' );\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t];\n\t\t}, [\n\t\t\thistory,\n\t\t\topenGeneralSidebar,\n\t\t\tsetEditorCanvasContainerView,\n\t\t\tcanEditCSS,\n\t\t\tcanvas,\n\t\t\tparams,\n\t\t] );\n\t\treturn {\n\t\t\tisLoading: false,\n\t\t\tcommands,\n\t\t};\n\t};\n\nconst getGlobalStylesOpenRevisionsCommands = () =>\n\tfunction useGlobalStylesOpenRevisionsCommands() {\n\t\tconst { openGeneralSidebar, setEditorCanvasContainerView } = unlock(\n\t\t\tuseDispatch( editSiteStore )\n\t\t);\n\t\tconst { params } = useLocation();\n\t\tconst { canvas = 'view' } = params;\n\t\tconst history = useHistory();\n\t\tconst hasRevisions = useSelect( ( select ) => {\n\t\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\t\tconst globalStyles = globalStylesId\n\t\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t\t: undefined;\n\t\t\treturn !! globalStyles?._links?.[ 'version-history' ]?.[ 0 ]?.count;\n\t\t}, [] );\n\n\t\tconst commands = useMemo( () => {\n\t\t\tif ( ! hasRevisions ) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tname: 'core/edit-site/open-global-styles-revisions',\n\t\t\t\t\tlabel: __( 'Style revisions' ),\n\t\t\t\t\ticon: backup,\n\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\tclose();\n\t\t\t\t\t\tif ( ! params.postId ) {\n\t\t\t\t\t\t\thistory.push( {\n\t\t\t\t\t\t\t\tpath: '/wp_global_styles',\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}\n\t\t\t\t\t\tif ( params.postId && canvas !== 'edit' ) {\n\t\t\t\t\t\t\thistory.push(\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t...params,\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\tundefined,\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttransition: 'canvas-mode-edit-transition',\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\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\t\t\t\tsetEditorCanvasContainerView(\n\t\t\t\t\t\t\t'global-styles-revisions'\n\t\t\t\t\t\t);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t];\n\t\t}, [\n\t\t\thasRevisions,\n\t\t\thistory,\n\t\t\topenGeneralSidebar,\n\t\t\tsetEditorCanvasContainerView,\n\t\t\tcanvas,\n\t\t\tparams,\n\t\t] );\n\n\t\treturn {\n\t\t\tisLoading: false,\n\t\t\tcommands,\n\t\t};\n\t};\n\nexport function useCommonCommands() {\n\tconst homeUrl = useSelect( ( select ) => {\n\t\t// Site index.\n\t\treturn select( coreStore ).getEntityRecord( 'root', '__unstableBase' )\n\t\t\t?.home;\n\t}, [] );\n\n\tuseCommand( {\n\t\tname: 'core/edit-site/view-site',\n\t\tlabel: __( 'View site' ),\n\t\tcallback: ( { close } ) => {\n\t\t\tclose();\n\t\t\twindow.open( homeUrl, '_blank' );\n\t\t},\n\t\ticon: external,\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/open-styles',\n\t\thook: getGlobalStylesOpenStylesCommands(),\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/toggle-styles-welcome-guide',\n\t\thook: getGlobalStylesToggleWelcomeGuideCommands(),\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/reset-global-styles',\n\t\thook: getGlobalStylesResetCommands(),\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/open-styles-css',\n\t\thook: getGlobalStylesOpenCssCommands(),\n\t} );\n\n\tuseCommandLoader( {\n\t\tname: 'core/edit-site/open-styles-revisions',\n\t\thook: getGlobalStylesOpenRevisionsCommands(),\n\t} );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,EAAE,EAAEC,KAAK,QAAQ,iBAAiB;AAC3C,SACCC,UAAU,EACVC,WAAW,EACXC,MAAM,EACNC,IAAI,EACJC,MAAM,EACNC,QAAQ,EACRC,KAAK,QACC,kBAAkB;AACzB,SAASC,gBAAgB,EAAEC,UAAU,QAAQ,qBAAqB;AAClE,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,yBAAyB;AAC/E,SAASD,WAAW,IAAIE,iBAAiB,QAAQ,mBAAmB;AACpE,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,wBAAwB;AAClE,SAASD,KAAK,IAAIE,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASH,KAAK,IAAII,aAAa,QAAQ,aAAa;AAEpD,MAAM;EAAEC;AAAqB,CAAC,GAAGF,MAA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,EAAEA,CAAE;MAAEC;IAAM,CAAC,KAAM;MAC1BA,KAAK,CAAC,CAAC;MACPgC,MAAM,CAACC,IAAI,CAAEH,OAAO,EAAE,QAAS,CAAC;IACjC,CAAC;IACDxB,IAAI,EAAEnC;EACP,CAAE,CAAC;EAEHE,gBAAgB,CAAE;IACjBwB,IAAI,EAAE,4BAA4B;IAClCqC,IAAI,EAAEhD,iCAAiC,CAAC;EACzC,CAAE,CAAC;EAEHb,gBAAgB,CAAE;IACjBwB,IAAI,EAAE,4CAA4C;IAClDqC,IAAI,EAAE1B,yCAAyC,CAAC;EACjD,CAAE,CAAC;EAEHnC,gBAAgB,CAAE;IACjBwB,IAAI,EAAE,oCAAoC;IAC1CqC,IAAI,EAAEtB,4BAA4B,CAAC;EACpC,CAAE,CAAC;EAEHvC,gBAAgB,CAAE;IACjBwB,IAAI,EAAE,gCAAgC;IACtCqC,IAAI,EAAElB,8BAA8B,CAAC;EACtC,CAAE,CAAC;EAEH3C,gBAAgB,CAAE;IACjBwB,IAAI,EAAE,sCAAsC;IAC5CqC,IAAI,EAAET,oCAAoC,CAAC;EAC5C,CAAE,CAAC;AACJ","ignoreList":[]}
|
package/build-module/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["store","blocksStore","registerCoreBlocks","__experimentalGetCoreBlocks","__experimentalRegisterExperimentalCoreBlocks","dispatch","deprecated","createRoot","StrictMode","editorStore","privateApis","editorPrivateApis","preferencesStore","registerLegacyWidgetBlock","registerWidgetGroupBlock","editSiteStore","unlock","App","jsx","_jsx","registerCoreBlockBindingsSources","initializeEditor","id","settings","target","document","getElementById","root","reapplyBlockTypeFilters","coreBlocks","filter","name","setFreeformFallbackBlockName","inserter","globalThis","IS_GUTENBERG_PLUGIN","enableFSEBlocks","setDefaults","welcomeGuide","welcomeGuideStyles","welcomeGuidePage","welcomeGuideTemplate","allowRightClickOverrides","distractionFree","editorMode","fixedToolbar","focusMode","inactivePanels","keepCaretInsideBlock","openPanels","showBlockBreadcrumbs","showListViewByDefault","enableChoosePatternModal","window","__experimentalMediaProcessing","requireApproval","optimizeOnUpload","updateSettings","updateEditorSettings","defaultTemplateTypes","defaultTemplatePartAreas","addEventListener","e","preventDefault","render","children","reinitializeEditor","since","version","default","PluginTemplateSettingPanel","initializePostsDashboard"],"sources":["@wordpress/edit-site/src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalGetCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport { dispatch } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { createRoot, StrictMode } from '@wordpress/element';\nimport {\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\n\n/**\n * Internal dependencies\n */\nimport './hooks';\nimport { store as editSiteStore } from './store';\nimport { unlock } from './lock-unlock';\nimport App from './components/app';\n\nconst { registerCoreBlockBindingsSources } = unlock( editorPrivateApis );\n\n/**\n * Initializes the site editor screen.\n *\n * @param {string} id ID of the root element to render the screen in.\n * @param {Object} settings Editor settings.\n */\nexport function initializeEditor( id, settings ) {\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tdispatch( blocksStore ).reapplyBlockTypeFilters();\n\tconst coreBlocks = __experimentalGetCoreBlocks().filter(\n\t\t( { name } ) => name !== 'core/freeform'\n\t);\n\tregisterCoreBlocks( coreBlocks );\n\tregisterCoreBlockBindingsSources();\n\tdispatch( blocksStore ).setFreeformFallbackBlockName( 'core/html' );\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tregisterWidgetGroupBlock( { inserter: false } );\n\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: true,\n\t\t} );\n\t}\n\n\t// We dispatch actions and update the store synchronously before rendering\n\t// so that we won't trigger unnecessary re-renders with useEffect.\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-site', {\n\t\twelcomeGuide: true,\n\t\twelcomeGuideStyles: true,\n\t\twelcomeGuidePage: true,\n\t\twelcomeGuideTemplate: true,\n\t} );\n\n\tdispatch( preferencesStore ).setDefaults( 'core', {\n\t\tallowRightClickOverrides: true,\n\t\tdistractionFree: false,\n\t\teditorMode: 'visual',\n\t\tfixedToolbar: false,\n\t\tfocusMode: false,\n\t\tinactivePanels: [],\n\t\tkeepCaretInsideBlock: false,\n\t\topenPanels: [ 'post-status' ],\n\t\tshowBlockBreadcrumbs: true,\n\t\tshowListViewByDefault: false,\n\t\tenableChoosePatternModal: true,\n\t} );\n\n\tif ( window.__experimentalMediaProcessing ) {\n\t\tdispatch( preferencesStore ).setDefaults( 'core/media', {\n\t\t\trequireApproval: true,\n\t\t\toptimizeOnUpload: true,\n\t\t} );\n\t}\n\n\tdispatch( editSiteStore ).updateSettings( settings );\n\n\t// Keep the defaultTemplateTypes in the core/editor settings too,\n\t// so that they can be selected with core/editor selectors in any editor.\n\t// This is needed because edit-site doesn't initialize with EditorProvider,\n\t// which internally uses updateEditorSettings as well.\n\tdispatch( editorStore ).updateEditorSettings( {\n\t\tdefaultTemplateTypes: settings.defaultTemplateTypes,\n\t\tdefaultTemplatePartAreas: settings.defaultTemplatePartAreas,\n\t} );\n\n\t// Prevent the default browser action for files dropped outside of dropzones.\n\twindow.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );\n\twindow.addEventListener( 'drop', ( e ) => e.preventDefault(), false );\n\n\troot.render(\n\t\t<StrictMode>\n\t\t\t<App />\n\t\t</StrictMode>\n\t);\n\n\treturn root;\n}\n\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editSite.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\nexport { default as PluginTemplateSettingPanel } from './components/plugin-template-setting-panel';\nexport { store } from './store';\nexport * from './deprecated';\n\n// Temporary: While the posts dashboard is being iterated on\n// it's being built in the same package as the site editor.\nexport { initializePostsDashboard } from './posts';\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD,SACCC,kBAAkB,EAClBC,2BAA2B,EAC3BC,4CAA4C,QACtC,0BAA0B;AACjC,SAASC,QAAQ,QAAQ,iBAAiB;AAC1C,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,UAAU,EAAEC,UAAU,QAAQ,oBAAoB;AAC3D,SACCR,KAAK,IAAIS,WAAW,EACpBC,WAAW,IAAIC,iBAAiB,QAC1B,mBAAmB;AAC1B,SAASX,KAAK,IAAIY,gBAAgB,QAAQ,wBAAwB;AAClE,SACCC,yBAAyB,EACzBC,wBAAwB,QAClB,oBAAoB;;AAE3B;AACA;AACA;AACA,OAAO,SAAS;AAChB,SAASd,KAAK,IAAIe,aAAa,QAAQ,SAAS;AAChD,SAASC,MAAM,QAAQ,eAAe;AACtC,OAAOC,GAAG,MAAM,kBAAkB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEnC,MAAM;EAAEC;AAAiC,CAAC,GAAGJ,MAAM,CAAEL,iBAAkB,CAAC;;AAExE;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASU,gBAAgBA,CAAEC,EAAE,EAAEC,QAAQ,EAAG;EAChD,MAAMC,MAAM,GAAGC,QAAQ,CAACC,cAAc,CAAEJ,EAAG,CAAC;EAC5C,MAAMK,IAAI,GAAGpB,UAAU,CAAEiB,MAAO,CAAC;EAEjCnB,QAAQ,CAAEJ,WAAY,CAAC,CAAC2B,uBAAuB,CAAC,CAAC;EACjD,MAAMC,UAAU,GAAG1B,2BAA2B,CAAC,CAAC,CAAC2B,MAAM,CACtD,CAAE;IAAEC;EAAK,CAAC,KAAMA,IAAI,KAAK,eAC1B,CAAC;EACD7B,kBAAkB,CAAE2B,UAAW,CAAC;EAChCT,gCAAgC,CAAC,CAAC;EAClCf,QAAQ,CAAEJ,WAAY,CAAC,CAAC+B,4BAA4B,CAAE,WAAY,CAAC;EACnEnB,yBAAyB,CAAE;IAAEoB,QAAQ,EAAE;EAAM,CAAE,CAAC;EAChDnB,wBAAwB,CAAE;IAAEmB,QAAQ,EAAE;EAAM,CAAE,CAAC;EAC/C,IAAKC,UAAU,CAACC,mBAAmB,EAAG;IACrC/B,4CAA4C,CAAE;MAC7CgC,eAAe,EAAE;IAClB,CAAE,CAAC;EACJ;;EAEA;EACA;EACA/B,QAAQ,CAAEO,gBAAiB,CAAC,CAACyB,WAAW,CAAE,gBAAgB,EAAE;IAC3DC,YAAY,EAAE,IAAI;IAClBC,kBAAkB,EAAE,IAAI;IACxBC,gBAAgB,EAAE,IAAI;IACtBC,oBAAoB,EAAE;EACvB,CAAE,CAAC;EAEHpC,QAAQ,CAAEO,gBAAiB,CAAC,CAACyB,WAAW,CAAE,MAAM,EAAE;IACjDK,wBAAwB,EAAE,IAAI;IAC9BC,eAAe,EAAE,KAAK;IACtBC,UAAU,EAAE,QAAQ;IACpBC,YAAY,EAAE,KAAK;IACnBC,SAAS,EAAE,KAAK;IAChBC,cAAc,EAAE,EAAE;IAClBC,oBAAoB,EAAE,KAAK;IAC3BC,UAAU,EAAE,CAAE,aAAa,CAAE;IAC7BC,oBAAoB,EAAE,IAAI;IAC1BC,qBAAqB,EAAE,KAAK;IAC5BC,wBAAwB,EAAE;EAC3B,CAAE,CAAC;EAEH,IAAKC,MAAM,CAACC,6BAA6B,EAAG;
|
|
1
|
+
{"version":3,"names":["store","blocksStore","registerCoreBlocks","__experimentalGetCoreBlocks","__experimentalRegisterExperimentalCoreBlocks","dispatch","deprecated","createRoot","StrictMode","editorStore","privateApis","editorPrivateApis","preferencesStore","registerLegacyWidgetBlock","registerWidgetGroupBlock","editSiteStore","unlock","App","jsx","_jsx","registerCoreBlockBindingsSources","initializeEditor","id","settings","target","document","getElementById","root","reapplyBlockTypeFilters","coreBlocks","filter","name","setFreeformFallbackBlockName","inserter","globalThis","IS_GUTENBERG_PLUGIN","enableFSEBlocks","setDefaults","welcomeGuide","welcomeGuideStyles","welcomeGuidePage","welcomeGuideTemplate","allowRightClickOverrides","distractionFree","editorMode","editorTool","fixedToolbar","focusMode","inactivePanels","keepCaretInsideBlock","openPanels","showBlockBreadcrumbs","showListViewByDefault","enableChoosePatternModal","window","__experimentalMediaProcessing","requireApproval","optimizeOnUpload","updateSettings","updateEditorSettings","defaultTemplateTypes","defaultTemplatePartAreas","addEventListener","e","preventDefault","render","children","reinitializeEditor","since","version","default","PluginTemplateSettingPanel","initializePostsDashboard"],"sources":["@wordpress/edit-site/src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalGetCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport { dispatch } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { createRoot, StrictMode } from '@wordpress/element';\nimport {\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\n\n/**\n * Internal dependencies\n */\nimport './hooks';\nimport { store as editSiteStore } from './store';\nimport { unlock } from './lock-unlock';\nimport App from './components/app';\n\nconst { registerCoreBlockBindingsSources } = unlock( editorPrivateApis );\n\n/**\n * Initializes the site editor screen.\n *\n * @param {string} id ID of the root element to render the screen in.\n * @param {Object} settings Editor settings.\n */\nexport function initializeEditor( id, settings ) {\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tdispatch( blocksStore ).reapplyBlockTypeFilters();\n\tconst coreBlocks = __experimentalGetCoreBlocks().filter(\n\t\t( { name } ) => name !== 'core/freeform'\n\t);\n\tregisterCoreBlocks( coreBlocks );\n\tregisterCoreBlockBindingsSources();\n\tdispatch( blocksStore ).setFreeformFallbackBlockName( 'core/html' );\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tregisterWidgetGroupBlock( { inserter: false } );\n\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: true,\n\t\t} );\n\t}\n\n\t// We dispatch actions and update the store synchronously before rendering\n\t// so that we won't trigger unnecessary re-renders with useEffect.\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-site', {\n\t\twelcomeGuide: true,\n\t\twelcomeGuideStyles: true,\n\t\twelcomeGuidePage: true,\n\t\twelcomeGuideTemplate: true,\n\t} );\n\n\tdispatch( preferencesStore ).setDefaults( 'core', {\n\t\tallowRightClickOverrides: true,\n\t\tdistractionFree: false,\n\t\teditorMode: 'visual',\n\t\teditorTool: 'edit',\n\t\tfixedToolbar: false,\n\t\tfocusMode: false,\n\t\tinactivePanels: [],\n\t\tkeepCaretInsideBlock: false,\n\t\topenPanels: [ 'post-status' ],\n\t\tshowBlockBreadcrumbs: true,\n\t\tshowListViewByDefault: false,\n\t\tenableChoosePatternModal: true,\n\t} );\n\n\tif ( window.__experimentalMediaProcessing ) {\n\t\tdispatch( preferencesStore ).setDefaults( 'core/media', {\n\t\t\trequireApproval: true,\n\t\t\toptimizeOnUpload: true,\n\t\t} );\n\t}\n\n\tdispatch( editSiteStore ).updateSettings( settings );\n\n\t// Keep the defaultTemplateTypes in the core/editor settings too,\n\t// so that they can be selected with core/editor selectors in any editor.\n\t// This is needed because edit-site doesn't initialize with EditorProvider,\n\t// which internally uses updateEditorSettings as well.\n\tdispatch( editorStore ).updateEditorSettings( {\n\t\tdefaultTemplateTypes: settings.defaultTemplateTypes,\n\t\tdefaultTemplatePartAreas: settings.defaultTemplatePartAreas,\n\t} );\n\n\t// Prevent the default browser action for files dropped outside of dropzones.\n\twindow.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );\n\twindow.addEventListener( 'drop', ( e ) => e.preventDefault(), false );\n\n\troot.render(\n\t\t<StrictMode>\n\t\t\t<App />\n\t\t</StrictMode>\n\t);\n\n\treturn root;\n}\n\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editSite.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\nexport { default as PluginTemplateSettingPanel } from './components/plugin-template-setting-panel';\nexport { store } from './store';\nexport * from './deprecated';\n\n// Temporary: While the posts dashboard is being iterated on\n// it's being built in the same package as the site editor.\nexport { initializePostsDashboard } from './posts';\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD,SACCC,kBAAkB,EAClBC,2BAA2B,EAC3BC,4CAA4C,QACtC,0BAA0B;AACjC,SAASC,QAAQ,QAAQ,iBAAiB;AAC1C,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,UAAU,EAAEC,UAAU,QAAQ,oBAAoB;AAC3D,SACCR,KAAK,IAAIS,WAAW,EACpBC,WAAW,IAAIC,iBAAiB,QAC1B,mBAAmB;AAC1B,SAASX,KAAK,IAAIY,gBAAgB,QAAQ,wBAAwB;AAClE,SACCC,yBAAyB,EACzBC,wBAAwB,QAClB,oBAAoB;;AAE3B;AACA;AACA;AACA,OAAO,SAAS;AAChB,SAASd,KAAK,IAAIe,aAAa,QAAQ,SAAS;AAChD,SAASC,MAAM,QAAQ,eAAe;AACtC,OAAOC,GAAG,MAAM,kBAAkB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEnC,MAAM;EAAEC;AAAiC,CAAC,GAAGJ,MAAM,CAAEL,iBAAkB,CAAC;;AAExE;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASU,gBAAgBA,CAAEC,EAAE,EAAEC,QAAQ,EAAG;EAChD,MAAMC,MAAM,GAAGC,QAAQ,CAACC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AAwB,EAAE;EAC3B,CAAE,CAAC;EAEH,IAAKC,MAAM,CAACC,6BAA6B,EAAG;IAC3ClD,QAAQ,CAAEO,gBAAiB,CAAC,CAACyB,WAAW,CAAE,YAAY,EAAE;MACvDmB,eAAe,EAAE,IAAI;MACrBC,gBAAgB,EAAE;IACnB,CAAE,CAAC;EACJ;EAEApD,QAAQ,CAAEU,aAAc,CAAC,CAAC2C,cAAc,CAAEnC,QAAS,CAAC;;EAEpD;EACA;EACA;EACA;EACAlB,QAAQ,CAAEI,WAAY,CAAC,CAACkD,oBAAoB,CAAE;IAC7CC,oBAAoB,EAAErC,QAAQ,CAACqC,oBAAoB;IACnDC,wBAAwB,EAAEtC,QAAQ,CAACsC;EACpC,CAAE,CAAC;;EAEH;EACAP,MAAM,CAACQ,gBAAgB,CAAE,UAAU,EAAIC,CAAC,IAAMA,CAAC,CAACC,cAAc,CAAC,CAAC,EAAE,KAAM,CAAC;EACzEV,MAAM,CAACQ,gBAAgB,CAAE,MAAM,EAAIC,CAAC,IAAMA,CAAC,CAACC,cAAc,CAAC,CAAC,EAAE,KAAM,CAAC;EAErErC,IAAI,CAACsC,MAAM,cACV9C,IAAA,CAACX,UAAU;IAAA0D,QAAA,eACV/C,IAAA,CAACF,GAAG,IAAE;EAAC,CACI,CACb,CAAC;EAED,OAAOU,IAAI;AACZ;AAEA,OAAO,SAASwC,kBAAkBA,CAAA,EAAG;EACpC7D,UAAU,CAAE,gCAAgC,EAAE;IAC7C8D,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ;AAEA,SAASC,OAAO,IAAIC,0BAA0B,QAAQ,4CAA4C;AAClG,SAASvE,KAAK,QAAQ,SAAS;AAC/B,cAAc,cAAc;;AAE5B;AACA;AACA,SAASwE,wBAAwB,QAAQ,SAAS","ignoreList":[]}
|
package/build-module/posts.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["store","blocksStore","registerCoreBlocks","__experimentalGetCoreBlocks","__experimentalRegisterExperimentalCoreBlocks","dispatch","createRoot","StrictMode","preferencesStore","registerLegacyWidgetBlock","registerWidgetGroupBlock","editSiteStore","PostsApp","jsx","_jsx","initializePostsDashboard","id","settings","globalThis","IS_GUTENBERG_PLUGIN","target","document","getElementById","root","reapplyBlockTypeFilters","coreBlocks","filter","name","setFreeformFallbackBlockName","inserter","enableFSEBlocks","setDefaults","welcomeGuide","welcomeGuideStyles","welcomeGuidePage","welcomeGuideTemplate","allowRightClickOverrides","distractionFree","editorMode","fixedToolbar","focusMode","inactivePanels","keepCaretInsideBlock","openPanels","showBlockBreadcrumbs","showListViewByDefault","enableChoosePatternModal","updateSettings","window","addEventListener","e","preventDefault","render","children"],"sources":["@wordpress/edit-site/src/posts.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalGetCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport { dispatch } from '@wordpress/data';\nimport { createRoot, StrictMode } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\n\n/**\n * Internal dependencies\n */\nimport './hooks';\nimport { store as editSiteStore } from './store';\n\n/**\n * Internal dependencies\n */\nimport PostsApp from './components/posts-app';\n\n/**\n * Initializes the \"Posts Dashboard\"\n * @param {string} id ID of the root element to render the screen in.\n * @param {Object} settings Editor settings.\n */\nexport function initializePostsDashboard( id, settings ) {\n\tif ( ! globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\treturn;\n\t}\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tdispatch( blocksStore ).reapplyBlockTypeFilters();\n\tconst coreBlocks = __experimentalGetCoreBlocks().filter(\n\t\t( { name } ) => name !== 'core/freeform'\n\t);\n\tregisterCoreBlocks( coreBlocks );\n\tdispatch( blocksStore ).setFreeformFallbackBlockName( 'core/html' );\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tregisterWidgetGroupBlock( { inserter: false } );\n\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: true,\n\t\t} );\n\t}\n\n\t// We dispatch actions and update the store synchronously before rendering\n\t// so that we won't trigger unnecessary re-renders with useEffect.\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-site', {\n\t\twelcomeGuide: true,\n\t\twelcomeGuideStyles: true,\n\t\twelcomeGuidePage: true,\n\t\twelcomeGuideTemplate: true,\n\t} );\n\n\tdispatch( preferencesStore ).setDefaults( 'core', {\n\t\tallowRightClickOverrides: true,\n\t\tdistractionFree: false,\n\t\teditorMode: 'visual',\n\t\tfixedToolbar: false,\n\t\tfocusMode: false,\n\t\tinactivePanels: [],\n\t\tkeepCaretInsideBlock: false,\n\t\topenPanels: [ 'post-status' ],\n\t\tshowBlockBreadcrumbs: true,\n\t\tshowListViewByDefault: false,\n\t\tenableChoosePatternModal: true,\n\t} );\n\n\tdispatch( editSiteStore ).updateSettings( settings );\n\n\t// Prevent the default browser action for files dropped outside of dropzones.\n\twindow.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );\n\twindow.addEventListener( 'drop', ( e ) => e.preventDefault(), false );\n\n\troot.render(\n\t\t<StrictMode>\n\t\t\t<PostsApp />\n\t\t</StrictMode>\n\t);\n\n\treturn root;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD,SACCC,kBAAkB,EAClBC,2BAA2B,EAC3BC,4CAA4C,QACtC,0BAA0B;AACjC,SAASC,QAAQ,QAAQ,iBAAiB;AAC1C,SAASC,UAAU,EAAEC,UAAU,QAAQ,oBAAoB;AAC3D,SAASP,KAAK,IAAIQ,gBAAgB,QAAQ,wBAAwB;AAClE,SACCC,yBAAyB,EAC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WAAW,CAAE,MAAM,EAAE;IACjDK,wBAAwB,EAAE,IAAI;IAC9BC,eAAe,EAAE,KAAK;IACtBC,UAAU,EAAE,QAAQ;IACpBC,YAAY,EAAE,KAAK;IACnBC,SAAS,EAAE,KAAK;IAChBC,cAAc,EAAE,EAAE;IAClBC,oBAAoB,EAAE,KAAK;IAC3BC,UAAU,EAAE,CAAE,aAAa,CAAE;IAC7BC,oBAAoB,EAAE,IAAI;IAC1BC,qBAAqB,EAAE,KAAK;IAC5BC,wBAAwB,EAAE;EAC3B,CAAE,CAAC;
|
|
1
|
+
{"version":3,"names":["store","blocksStore","registerCoreBlocks","__experimentalGetCoreBlocks","__experimentalRegisterExperimentalCoreBlocks","dispatch","createRoot","StrictMode","preferencesStore","registerLegacyWidgetBlock","registerWidgetGroupBlock","editSiteStore","PostsApp","jsx","_jsx","initializePostsDashboard","id","settings","globalThis","IS_GUTENBERG_PLUGIN","target","document","getElementById","root","reapplyBlockTypeFilters","coreBlocks","filter","name","setFreeformFallbackBlockName","inserter","enableFSEBlocks","setDefaults","welcomeGuide","welcomeGuideStyles","welcomeGuidePage","welcomeGuideTemplate","allowRightClickOverrides","distractionFree","editorMode","editorTool","fixedToolbar","focusMode","inactivePanels","keepCaretInsideBlock","openPanels","showBlockBreadcrumbs","showListViewByDefault","enableChoosePatternModal","updateSettings","window","addEventListener","e","preventDefault","render","children"],"sources":["@wordpress/edit-site/src/posts.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalGetCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport { dispatch } from '@wordpress/data';\nimport { createRoot, StrictMode } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\n\n/**\n * Internal dependencies\n */\nimport './hooks';\nimport { store as editSiteStore } from './store';\n\n/**\n * Internal dependencies\n */\nimport PostsApp from './components/posts-app';\n\n/**\n * Initializes the \"Posts Dashboard\"\n * @param {string} id ID of the root element to render the screen in.\n * @param {Object} settings Editor settings.\n */\nexport function initializePostsDashboard( id, settings ) {\n\tif ( ! globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\treturn;\n\t}\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tdispatch( blocksStore ).reapplyBlockTypeFilters();\n\tconst coreBlocks = __experimentalGetCoreBlocks().filter(\n\t\t( { name } ) => name !== 'core/freeform'\n\t);\n\tregisterCoreBlocks( coreBlocks );\n\tdispatch( blocksStore ).setFreeformFallbackBlockName( 'core/html' );\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tregisterWidgetGroupBlock( { inserter: false } );\n\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: true,\n\t\t} );\n\t}\n\n\t// We dispatch actions and update the store synchronously before rendering\n\t// so that we won't trigger unnecessary re-renders with useEffect.\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-site', {\n\t\twelcomeGuide: true,\n\t\twelcomeGuideStyles: true,\n\t\twelcomeGuidePage: true,\n\t\twelcomeGuideTemplate: true,\n\t} );\n\n\tdispatch( preferencesStore ).setDefaults( 'core', {\n\t\tallowRightClickOverrides: true,\n\t\tdistractionFree: false,\n\t\teditorMode: 'visual',\n\t\teditorTool: 'edit',\n\t\tfixedToolbar: false,\n\t\tfocusMode: false,\n\t\tinactivePanels: [],\n\t\tkeepCaretInsideBlock: false,\n\t\topenPanels: [ 'post-status' ],\n\t\tshowBlockBreadcrumbs: true,\n\t\tshowListViewByDefault: false,\n\t\tenableChoosePatternModal: true,\n\t} );\n\n\tdispatch( editSiteStore ).updateSettings( settings );\n\n\t// Prevent the default browser action for files dropped outside of dropzones.\n\twindow.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );\n\twindow.addEventListener( 'drop', ( e ) => e.preventDefault(), false );\n\n\troot.render(\n\t\t<StrictMode>\n\t\t\t<PostsApp />\n\t\t</StrictMode>\n\t);\n\n\treturn root;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD,SACCC,kBAAkB,EAClBC,2BAA2B,EAC3BC,4CAA4C,QACtC,0BAA0B;AACjC,SAASC,QAAQ,QAAQ,iBAAiB;AAC1C,SAASC,UAAU,EAAEC,UAAU,QAAQ,oBAAoB;AAC3D,SAASP,KAAK,IAAIQ,gBAAgB,QAAQ,wBAAwB;AAClE,SACCC,yBAAyB,EACzBC,wBAAwB,QAClB,oBAAoB;;AAE3B;AACA;AACA;AACA,OAAO,SAAS;AAChB,SAASV,KAAK,IAAIW,aAAa,QAAQ,SAAS;;AAEhD;AACA;AACA;AACA,OAAOC,QAAQ,MAAM,wBAAwB;;AAE7C;AACA;AACA;AACA;AACA;AAJA,SAAAC,GAAA,IAAAC,IAAA;AAKA,OAAO,SAASC,wBAAwBA,CAAEC,EAAE,EAAEC,QAAQ,EAAG;EACxD,IAAK,CAAEC,UAAU,CAACC,mBAAmB,EAAG;IACvC;EACD;EACA,MAAMC,MAAM,GAAGC,QAAQ,CAACC,cAAc,CAAEN,EAAG,CAAC;EAC5C,MAAMO,IAAI,GAAGjB,UAAU,CAAEc,MAAO,CAAC;EAEjCf,QAAQ,CAAEJ,WAAY,CAAC,CAACuB,uBAAuB,CAAC,CAAC;EACjD,MAAMC,UAAU,GAAGtB,2BAA2B,CAAC,CAAC,CAACuB,MAAM,CACtD,CAAE;IAAEC;EAAK,CAAC,KAAMA,IAAI,KAAK,eAC1B,CAAC;EACDzB,kBAAkB,CAAEuB,UAAW,CAAC;EAChCpB,QAAQ,CAAEJ,WAAY,CAAC,CAAC2B,4BAA4B,CAAE,WAAY,CAAC;EACnEnB,yBAAyB,CAAE;IAAEoB,QAAQ,EAAE;EAAM,CAA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