@wordpress/edit-site 6.0.0 → 6.1.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/add-new-page/index.js +2 -1
- package/build/components/add-new-page/index.js.map +1 -1
- package/build/components/app/index.js +17 -1
- package/build/components/app/index.js.map +1 -1
- package/build/components/editor/index.js +55 -69
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor/use-editor-title.js +39 -0
- package/build/components/editor/use-editor-title.js.map +1 -0
- package/build/components/global-styles/font-library-modal/installed-fonts.js +1 -0
- package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build/components/global-styles/screen-css.js +1 -1
- package/build/components/global-styles/screen-css.js.map +1 -1
- package/build/components/global-styles/screen-revisions/index.js +4 -23
- package/build/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js +1 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build/components/global-styles/shadows-edit-panel.js +1 -0
- package/build/components/global-styles/shadows-edit-panel.js.map +1 -1
- package/build/components/global-styles/variations/variation.js +11 -16
- package/build/components/global-styles/variations/variation.js.map +1 -1
- package/build/components/global-styles/variations/variations-color.js +2 -1
- package/build/components/global-styles/variations/variations-color.js.map +1 -1
- package/build/components/global-styles/variations/variations-typography.js +1 -0
- package/build/components/global-styles/variations/variations-typography.js.map +1 -1
- package/build/components/global-styles-sidebar/index.js +2 -0
- package/build/components/global-styles-sidebar/index.js.map +1 -1
- package/build/components/layout/index.js +23 -95
- package/build/components/layout/index.js.map +1 -1
- package/build/components/page/header.js +1 -0
- package/build/components/page/header.js.map +1 -1
- package/build/components/page-patterns/header.js +2 -1
- package/build/components/page-patterns/header.js.map +1 -1
- package/build/components/page-patterns/index.js +5 -5
- package/build/components/page-patterns/index.js.map +1 -1
- package/build/components/pagination/index.js +17 -8
- package/build/components/pagination/index.js.map +1 -1
- package/build/components/posts-app/index.js +50 -0
- package/build/components/posts-app/index.js.map +1 -0
- package/build/components/sidebar-dataviews/dataview-item.js +6 -2
- package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build/components/sidebar-navigation-screen/index.js +1 -1
- package/build/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +1 -0
- package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +1 -0
- package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/category-item.js +1 -1
- package/build/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/index.js +1 -1
- package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build/components/site-hub/index.js +38 -128
- package/build/components/site-hub/index.js.map +1 -1
- package/build/hooks/commands/use-set-command-context.js +53 -0
- package/build/hooks/commands/use-set-command-context.js.map +1 -0
- package/build/hooks/push-changes-to-global-styles/index.js +3 -2
- package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +20 -88
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
- package/build/index.js +15 -2
- package/build/index.js.map +1 -1
- package/build/posts.js +34 -0
- package/build/posts.js.map +1 -0
- package/build/store/private-actions.js +33 -18
- package/build/store/private-actions.js.map +1 -1
- package/build-module/components/add-new-page/index.js +2 -1
- package/build-module/components/add-new-page/index.js.map +1 -1
- package/build-module/components/app/index.js +17 -1
- package/build-module/components/app/index.js.map +1 -1
- package/build-module/components/editor/index.js +55 -69
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor/use-editor-title.js +31 -0
- package/build-module/components/editor/use-editor-title.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js +1 -0
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build-module/components/global-styles/screen-css.js +1 -1
- package/build-module/components/global-styles/screen-css.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/index.js +4 -23
- package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +1 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build-module/components/global-styles/shadows-edit-panel.js +1 -0
- package/build-module/components/global-styles/shadows-edit-panel.js.map +1 -1
- package/build-module/components/global-styles/variations/variation.js +11 -16
- package/build-module/components/global-styles/variations/variation.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-color.js +3 -2
- package/build-module/components/global-styles/variations/variations-color.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-typography.js +1 -0
- package/build-module/components/global-styles/variations/variations-typography.js.map +1 -1
- package/build-module/components/global-styles-sidebar/index.js +2 -0
- package/build-module/components/global-styles-sidebar/index.js.map +1 -1
- package/build-module/components/layout/index.js +27 -99
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/page/header.js +1 -0
- package/build-module/components/page/header.js.map +1 -1
- package/build-module/components/page-patterns/header.js +2 -1
- package/build-module/components/page-patterns/header.js.map +1 -1
- package/build-module/components/page-patterns/index.js +5 -5
- package/build-module/components/page-patterns/index.js.map +1 -1
- package/build-module/components/pagination/index.js +17 -8
- package/build-module/components/pagination/index.js.map +1 -1
- package/build-module/components/posts-app/index.js +43 -0
- package/build-module/components/posts-app/index.js.map +1 -0
- package/build-module/components/sidebar-dataviews/dataview-item.js +6 -2
- package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/category-item.js +2 -2
- package/build-module/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build-module/components/site-hub/index.js +40 -130
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/hooks/commands/use-set-command-context.js +46 -0
- package/build-module/hooks/commands/use-set-command-context.js.map +1 -0
- package/build-module/hooks/push-changes-to-global-styles/index.js +3 -2
- package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +19 -86
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
- package/build-module/index.js +8 -2
- package/build-module/index.js.map +1 -1
- package/build-module/posts.js +27 -0
- package/build-module/posts.js.map +1 -0
- package/build-module/store/private-actions.js +33 -18
- package/build-module/store/private-actions.js.map +1 -1
- package/build-style/posts-rtl.css +1707 -0
- package/build-style/posts.css +1707 -0
- package/build-style/style-rtl.css +59 -104
- package/build-style/style.css +59 -104
- package/package.json +41 -41
- package/src/components/add-new-page/index.js +2 -1
- package/src/components/app/index.js +17 -1
- package/src/components/block-editor/style.scss +11 -0
- package/src/components/editor/index.js +69 -103
- package/src/components/editor/style.scss +1 -5
- package/src/components/editor/use-editor-title.js +35 -0
- package/src/components/global-styles/font-library-modal/installed-fonts.js +1 -0
- package/src/components/global-styles/screen-css.js +1 -1
- package/src/components/global-styles/screen-revisions/index.js +4 -24
- package/src/components/global-styles/screen-revisions/revisions-buttons.js +1 -1
- package/src/components/global-styles/screen-revisions/style.scss +4 -8
- package/src/components/global-styles/shadows-edit-panel.js +1 -0
- package/src/components/global-styles/style.scss +1 -7
- package/src/components/global-styles/variations/variation.js +14 -19
- package/src/components/global-styles/variations/variations-color.js +12 -4
- package/src/components/global-styles/variations/variations-typography.js +5 -1
- package/src/components/global-styles-sidebar/index.js +2 -0
- package/src/components/global-styles-sidebar/style.scss +0 -1
- package/src/components/layout/index.js +41 -137
- package/src/components/layout/style.scss +18 -58
- package/src/components/page/header.js +1 -0
- package/src/components/page/style.scss +6 -0
- package/src/components/page-patterns/header.js +8 -2
- package/src/components/page-patterns/index.js +15 -12
- package/src/components/page-patterns/style.scss +6 -0
- package/src/components/pagination/index.js +21 -16
- package/src/components/posts-app/index.js +39 -0
- package/src/components/sidebar/style.scss +4 -4
- package/src/components/sidebar-dataviews/dataview-item.js +6 -2
- package/src/components/sidebar-navigation-screen/index.js +1 -1
- package/src/components/sidebar-navigation-screen/style.scss +2 -2
- package/src/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +1 -0
- package/src/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +1 -0
- package/src/components/sidebar-navigation-screen-patterns/category-item.js +11 -2
- package/src/components/sidebar-navigation-screen-patterns/index.js +5 -1
- package/src/components/site-hub/index.js +55 -146
- package/src/components/site-hub/style.scss +1 -4
- package/src/components/site-icon/style.scss +0 -4
- package/src/hooks/commands/use-set-command-context.js +37 -0
- package/src/hooks/push-changes-to-global-styles/index.js +3 -2
- package/src/hooks/use-theme-style-variations/test/use-theme-style-variations-by-property.js +1 -875
- package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +29 -117
- package/src/index.js +10 -2
- package/src/posts.js +29 -0
- package/src/posts.scss +46 -0
- package/src/store/private-actions.js +58 -30
- package/build/components/block-editor/block-inspector-button.js +0 -57
- package/build/components/block-editor/block-inspector-button.js.map +0 -1
- package/build/components/block-editor/inserter-media-categories.js +0 -183
- package/build/components/block-editor/inserter-media-categories.js.map +0 -1
- package/build/components/template-part-converter/convert-to-regular.js +0 -38
- package/build/components/template-part-converter/convert-to-regular.js.map +0 -1
- package/build/components/template-part-converter/convert-to-template-part.js +0 -84
- package/build/components/template-part-converter/convert-to-template-part.js.map +0 -1
- package/build/components/template-part-converter/index.js +0 -67
- package/build/components/template-part-converter/index.js.map +0 -1
- package/build-module/components/block-editor/block-inspector-button.js +0 -50
- package/build-module/components/block-editor/block-inspector-button.js.map +0 -1
- package/build-module/components/block-editor/inserter-media-categories.js +0 -177
- package/build-module/components/block-editor/inserter-media-categories.js.map +0 -1
- package/build-module/components/template-part-converter/convert-to-regular.js +0 -31
- package/build-module/components/template-part-converter/convert-to-regular.js.map +0 -1
- package/build-module/components/template-part-converter/convert-to-template-part.js +0 -79
- package/build-module/components/template-part-converter/convert-to-template-part.js.map +0 -1
- package/build-module/components/template-part-converter/index.js +0 -59
- package/build-module/components/template-part-converter/index.js.map +0 -1
- package/src/components/block-editor/block-inspector-button.js +0 -60
- package/src/components/block-editor/inserter-media-categories.js +0 -227
- package/src/components/template-part-converter/convert-to-regular.js +0 -32
- package/src/components/template-part-converter/convert-to-template-part.js +0 -78
- package/src/components/template-part-converter/index.js +0 -59
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,7 @@ var _data = require("@wordpress/data");
|
|
|
10
10
|
var _element = require("@wordpress/element");
|
|
11
11
|
var _coreData = require("@wordpress/core-data");
|
|
12
12
|
var _notices = require("@wordpress/notices");
|
|
13
|
+
var _htmlEntities = require("@wordpress/html-entities");
|
|
13
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
15
|
/**
|
|
15
16
|
* WordPress dependencies
|
|
@@ -45,7 +46,7 @@ function AddNewPageModal({
|
|
|
45
46
|
onSave(newPage);
|
|
46
47
|
createSuccessNotice((0, _i18n.sprintf)(
|
|
47
48
|
// translators: %s: Title of the created template e.g: "Category".
|
|
48
|
-
(0, _i18n.__)('"%s" successfully created.'), newPage.title?.rendered || title), {
|
|
49
|
+
(0, _i18n.__)('"%s" successfully created.'), (0, _htmlEntities.decodeEntities)(newPage.title?.rendered || title)), {
|
|
49
50
|
type: 'snackbar'
|
|
50
51
|
});
|
|
51
52
|
} catch (error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_i18n","_data","_element","_coreData","_notices","_jsxRuntime","AddNewPageModal","onSave","onClose","isCreatingPage","setIsCreatingPage","useState","title","setTitle","saveEntityRecord","useDispatch","coreStore","createErrorNotice","createSuccessNotice","noticesStore","createPage","event","preventDefault","newPage","status","slug","__","throwOnError","sprintf","rendered","type","error","errorMessage","message","code","jsx","Modal","onRequestClose","children","onSubmit","jsxs","__experimentalVStack","spacing","TextControl","__next40pxDefaultSize","label","onChange","placeholder","value","__experimentalHStack","justify","Button","variant","onClick","isBusy"],"sources":["@wordpress/edit-site/src/components/add-new-page/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\tModal,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tTextControl,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useDispatch } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as noticesStore } from '@wordpress/notices';\n\nexport default function AddNewPageModal( { onSave, onClose } ) {\n\tconst [ isCreatingPage, setIsCreatingPage ] = useState( false );\n\tconst [ title, setTitle ] = useState( '' );\n\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\tconst { createErrorNotice, createSuccessNotice } =\n\t\tuseDispatch( noticesStore );\n\n\tasync function createPage( event ) {\n\t\tevent.preventDefault();\n\n\t\tif ( isCreatingPage ) {\n\t\t\treturn;\n\t\t}\n\t\tsetIsCreatingPage( true );\n\t\ttry {\n\t\t\tconst newPage = await saveEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t'page',\n\t\t\t\t{\n\t\t\t\t\tstatus: 'draft',\n\t\t\t\t\ttitle,\n\t\t\t\t\tslug: title || __( 'No title' ),\n\t\t\t\t},\n\t\t\t\t{ throwOnError: true }\n\t\t\t);\n\n\t\t\tonSave( newPage );\n\n\t\t\tcreateSuccessNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t// translators: %s: Title of the created template e.g: \"Category\".\n\t\t\t\t\t__( '\"%s\" successfully created.' ),\n\t\t\t\t\
|
|
1
|
+
{"version":3,"names":["_components","require","_i18n","_data","_element","_coreData","_notices","_htmlEntities","_jsxRuntime","AddNewPageModal","onSave","onClose","isCreatingPage","setIsCreatingPage","useState","title","setTitle","saveEntityRecord","useDispatch","coreStore","createErrorNotice","createSuccessNotice","noticesStore","createPage","event","preventDefault","newPage","status","slug","__","throwOnError","sprintf","decodeEntities","rendered","type","error","errorMessage","message","code","jsx","Modal","onRequestClose","children","onSubmit","jsxs","__experimentalVStack","spacing","TextControl","__next40pxDefaultSize","label","onChange","placeholder","value","__experimentalHStack","justify","Button","variant","onClick","isBusy"],"sources":["@wordpress/edit-site/src/components/add-new-page/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\tModal,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tTextControl,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useDispatch } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { decodeEntities } from '@wordpress/html-entities';\n\nexport default function AddNewPageModal( { onSave, onClose } ) {\n\tconst [ isCreatingPage, setIsCreatingPage ] = useState( false );\n\tconst [ title, setTitle ] = useState( '' );\n\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\tconst { createErrorNotice, createSuccessNotice } =\n\t\tuseDispatch( noticesStore );\n\n\tasync function createPage( event ) {\n\t\tevent.preventDefault();\n\n\t\tif ( isCreatingPage ) {\n\t\t\treturn;\n\t\t}\n\t\tsetIsCreatingPage( true );\n\t\ttry {\n\t\t\tconst newPage = await saveEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t'page',\n\t\t\t\t{\n\t\t\t\t\tstatus: 'draft',\n\t\t\t\t\ttitle,\n\t\t\t\t\tslug: title || __( 'No title' ),\n\t\t\t\t},\n\t\t\t\t{ throwOnError: true }\n\t\t\t);\n\n\t\t\tonSave( newPage );\n\n\t\t\tcreateSuccessNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t// translators: %s: Title of the created template e.g: \"Category\".\n\t\t\t\t\t__( '\"%s\" successfully created.' ),\n\t\t\t\t\tdecodeEntities( newPage.title?.rendered || title )\n\t\t\t\t),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t} catch ( error ) {\n\t\t\tconst errorMessage =\n\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t? error.message\n\t\t\t\t\t: __( 'An error occurred while creating the page.' );\n\n\t\t\tcreateErrorNotice( errorMessage, {\n\t\t\t\ttype: 'snackbar',\n\t\t\t} );\n\t\t} finally {\n\t\t\tsetIsCreatingPage( false );\n\t\t}\n\t}\n\n\treturn (\n\t\t<Modal title={ __( 'Draft a new page' ) } onRequestClose={ onClose }>\n\t\t\t<form onSubmit={ createPage }>\n\t\t\t\t<VStack spacing={ 3 }>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tlabel={ __( 'Page title' ) }\n\t\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\t\tplaceholder={ __( 'No title' ) }\n\t\t\t\t\t\tvalue={ title }\n\t\t\t\t\t/>\n\t\t\t\t\t<HStack spacing={ 2 } justify=\"end\">\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\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;UAChCuB,KAAK,EAAGrC;QAAO,CACf,CAAC,eACF,IAAAP,WAAA,CAAAoC,IAAA,EAAC5C,WAAA,CAAAqD,oBAAM;UAACP,OAAO,EAAG,CAAG;UAACQ,OAAO,EAAC,KAAK;UAAAZ,QAAA,gBAClC,IAAAlC,WAAA,CAAA+B,GAAA,EAACvC,WAAA,CAAAuD,MAAM;YACNP,qBAAqB;YACrBQ,OAAO,EAAC,UAAU;YAClBC,OAAO,EAAG9C,OAAS;YAAA+B,QAAA,EAEjB,IAAAb,QAAE,EAAE,QAAS;UAAC,CACT,CAAC,eACT,IAAArB,WAAA,CAAA+B,GAAA,EAACvC,WAAA,CAAAuD,MAAM;YACNP,qBAAqB;YACrBQ,OAAO,EAAC,SAAS;YACjBtB,IAAI,EAAC,QAAQ;YACbwB,MAAM,EAAG9C,cAAgB;YACzB,iBAAgBA,cAAgB;YAAA8B,QAAA,EAE9B,IAAAb,QAAE,EAAE,cAAe;UAAC,CACf,CAAC;QAAA,CACF,CAAC;MAAA,CACF;IAAC,CACJ;EAAC,CACD,CAAC;AAEV","ignoreList":[]}
|
|
@@ -14,6 +14,11 @@ var _plugins = require("@wordpress/plugins");
|
|
|
14
14
|
var _router = require("@wordpress/router");
|
|
15
15
|
var _layout = _interopRequireDefault(require("../layout"));
|
|
16
16
|
var _lockUnlock = require("../../lock-unlock");
|
|
17
|
+
var _useCommonCommands = require("../../hooks/commands/use-common-commands");
|
|
18
|
+
var _useEditModeCommands = require("../../hooks/commands/use-edit-mode-commands");
|
|
19
|
+
var _useInitEditedEntityFromUrl = _interopRequireDefault(require("../sync-state-with-url/use-init-edited-entity-from-url"));
|
|
20
|
+
var _router2 = _interopRequireDefault(require("../layout/router"));
|
|
21
|
+
var _useSetCommandContext = _interopRequireDefault(require("../../hooks/commands/use-set-command-context"));
|
|
17
22
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
23
|
/**
|
|
19
24
|
* WordPress dependencies
|
|
@@ -29,6 +34,17 @@ const {
|
|
|
29
34
|
const {
|
|
30
35
|
GlobalStylesProvider
|
|
31
36
|
} = (0, _lockUnlock.unlock)(_editor.privateApis);
|
|
37
|
+
function AppLayout() {
|
|
38
|
+
// This ensures the edited entity id and type are initialized properly.
|
|
39
|
+
(0, _useInitEditedEntityFromUrl.default)();
|
|
40
|
+
(0, _useEditModeCommands.useEditModeCommands)();
|
|
41
|
+
(0, _useCommonCommands.useCommonCommands)();
|
|
42
|
+
(0, _useSetCommandContext.default)();
|
|
43
|
+
const route = (0, _router2.default)();
|
|
44
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_layout.default, {
|
|
45
|
+
route: route
|
|
46
|
+
});
|
|
47
|
+
}
|
|
32
48
|
function App() {
|
|
33
49
|
const {
|
|
34
50
|
createErrorNotice
|
|
@@ -40,7 +56,7 @@ function App() {
|
|
|
40
56
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.SlotFillProvider, {
|
|
41
57
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(GlobalStylesProvider, {
|
|
42
58
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.UnsavedChangesWarning, {}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(RouterProvider, {
|
|
43
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
59
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(AppLayout, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_plugins.PluginArea, {
|
|
44
60
|
onError: onPluginAreaError
|
|
45
61
|
})]
|
|
46
62
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_editor","_notices","_data","_i18n","_plugins","_router","_layout","_interopRequireDefault","_lockUnlock","_jsxRuntime","RouterProvider","unlock","routerPrivateApis","GlobalStylesProvider","editorPrivateApis","App","createErrorNotice","useDispatch","noticesStore","onPluginAreaError","name","sprintf","__","
|
|
1
|
+
{"version":3,"names":["_components","require","_editor","_notices","_data","_i18n","_plugins","_router","_layout","_interopRequireDefault","_lockUnlock","_useCommonCommands","_useEditModeCommands","_useInitEditedEntityFromUrl","_router2","_useSetCommandContext","_jsxRuntime","RouterProvider","unlock","routerPrivateApis","GlobalStylesProvider","editorPrivateApis","AppLayout","useInitEditedEntityFromURL","useEditModeCommands","useCommonCommands","useSetCommandContext","route","useLayoutAreas","jsx","default","App","createErrorNotice","useDispatch","noticesStore","onPluginAreaError","name","sprintf","__","SlotFillProvider","children","jsxs","UnsavedChangesWarning","PluginArea","onError"],"sources":["@wordpress/edit-site/src/components/app/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SlotFillProvider } from '@wordpress/components';\nimport {\n\tUnsavedChangesWarning,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { useDispatch } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { PluginArea } from '@wordpress/plugins';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport Layout from '../layout';\nimport { unlock } from '../../lock-unlock';\nimport { useCommonCommands } from '../../hooks/commands/use-common-commands';\nimport { useEditModeCommands } from '../../hooks/commands/use-edit-mode-commands';\nimport useInitEditedEntityFromURL from '../sync-state-with-url/use-init-edited-entity-from-url';\nimport useLayoutAreas from '../layout/router';\nimport useSetCommandContext from '../../hooks/commands/use-set-command-context';\n\nconst { RouterProvider } = unlock( routerPrivateApis );\nconst { GlobalStylesProvider } = unlock( editorPrivateApis );\n\nfunction AppLayout() {\n\t// This ensures the edited entity id and type are initialized properly.\n\tuseInitEditedEntityFromURL();\n\tuseEditModeCommands();\n\tuseCommonCommands();\n\tuseSetCommandContext();\n\tconst route = useLayoutAreas();\n\n\treturn <Layout route={ route } />;\n}\n\nexport default function App() {\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\n\tfunction onPluginAreaError( name ) {\n\t\tcreateErrorNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: plugin name */\n\t\t\t\t__(\n\t\t\t\t\t'The \"%s\" plugin has encountered an error and cannot be rendered.'\n\t\t\t\t),\n\t\t\t\tname\n\t\t\t)\n\t\t);\n\t}\n\n\treturn (\n\t\t<SlotFillProvider>\n\t\t\t<GlobalStylesProvider>\n\t\t\t\t<UnsavedChangesWarning />\n\t\t\t\t<RouterProvider>\n\t\t\t\t\t<AppLayout />\n\t\t\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t\t\t</RouterProvider>\n\t\t\t</GlobalStylesProvider>\n\t\t</SlotFillProvider>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAIA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAKA,IAAAO,OAAA,GAAAC,sBAAA,CAAAR,OAAA;AACA,IAAAS,WAAA,GAAAT,OAAA;AACA,IAAAU,kBAAA,GAAAV,OAAA;AACA,IAAAW,oBAAA,GAAAX,OAAA;AACA,IAAAY,2BAAA,GAAAJ,sBAAA,CAAAR,OAAA;AACA,IAAAa,QAAA,GAAAL,sBAAA,CAAAR,OAAA;AACA,IAAAc,qBAAA,GAAAN,sBAAA,CAAAR,OAAA;AAAgF,IAAAe,WAAA,GAAAf,OAAA;AAvBhF;AACA;AACA;;AAYA;AACA;AACA;;AASA,MAAM;EAAEgB;AAAe,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AACtD,MAAM;EAAEC;AAAqB,CAAC,GAAG,IAAAF,kBAAM,EAAEG,mBAAkB,CAAC;AAE5D,SAASC,SAASA,CAAA,EAAG;EACpB;EACA,IAAAC,mCAA0B,EAAC,CAAC;EAC5B,IAAAC,wCAAmB,EAAC,CAAC;EACrB,IAAAC,oCAAiB,EAAC,CAAC;EACnB,IAAAC,6BAAoB,EAAC,CAAC;EACtB,MAAMC,KAAK,GAAG,IAAAC,gBAAc,EAAC,CAAC;EAE9B,oBAAO,IAAAZ,WAAA,CAAAa,GAAA,EAACrB,OAAA,CAAAsB,OAAM;IAACH,KAAK,EAAGA;EAAO,CAAE,CAAC;AAClC;AAEe,SAASI,GAAGA,CAAA,EAAG;EAC7B,MAAM;IAAEC;EAAkB,CAAC,GAAG,IAAAC,iBAAW,EAAEC,cAAa,CAAC;EAEzD,SAASC,iBAAiBA,CAAEC,IAAI,EAAG;IAClCJ,iBAAiB,CAChB,IAAAK,aAAO,GACN;IACA,IAAAC,QAAE,EACD,kEACD,CAAC,EACDF,IACD,CACD,CAAC;EACF;EAEA,oBACC,IAAApB,WAAA,CAAAa,GAAA,EAAC7B,WAAA,CAAAuC,gBAAgB;IAAAC,QAAA,eAChB,IAAAxB,WAAA,CAAAyB,IAAA,EAACrB,oBAAoB;MAAAoB,QAAA,gBACpB,IAAAxB,WAAA,CAAAa,GAAA,EAAC3B,OAAA,CAAAwC,qBAAqB,IAAE,CAAC,eACzB,IAAA1B,WAAA,CAAAyB,IAAA,EAACxB,cAAc;QAAAuB,QAAA,gBACd,IAAAxB,WAAA,CAAAa,GAAA,EAACP,SAAS,IAAE,CAAC,eACb,IAAAN,WAAA,CAAAa,GAAA,EAACvB,QAAA,CAAAqC,UAAU;UAACC,OAAO,EAAGT;QAAmB,CAAE,CAAC;MAAA,CAC7B,CAAC;IAAA,CACI;EAAC,CACN,CAAC;AAErB","ignoreList":[]}
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.default =
|
|
7
|
+
exports.default = EditSiteEditor;
|
|
8
8
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
9
9
|
var _data = require("@wordpress/data");
|
|
10
10
|
var _components = require("@wordpress/components");
|
|
@@ -17,15 +17,12 @@ var _element = require("@wordpress/element");
|
|
|
17
17
|
var _notices = require("@wordpress/notices");
|
|
18
18
|
var _router = require("@wordpress/router");
|
|
19
19
|
var _preferences = require("@wordpress/preferences");
|
|
20
|
+
var _htmlEntities = require("@wordpress/html-entities");
|
|
20
21
|
var _welcomeGuide = _interopRequireDefault(require("../welcome-guide"));
|
|
21
22
|
var _store = require("../../store");
|
|
22
23
|
var _globalStylesRenderer = require("../global-styles-renderer");
|
|
23
|
-
var _useTitle = _interopRequireDefault(require("../routes/use-title"));
|
|
24
24
|
var _canvasLoader = _interopRequireDefault(require("../canvas-loader"));
|
|
25
25
|
var _lockUnlock = require("../../lock-unlock");
|
|
26
|
-
var _useEditedEntityRecord = _interopRequireDefault(require("../use-edited-entity-record"));
|
|
27
|
-
var _constants = require("../../utils/constants");
|
|
28
|
-
var _templatePartConverter = _interopRequireDefault(require("../template-part-converter"));
|
|
29
26
|
var _useSiteEditorSettings = require("../block-editor/use-site-editor-settings");
|
|
30
27
|
var _pluginTemplateSettingPanel = _interopRequireDefault(require("../plugin-template-setting-panel"));
|
|
31
28
|
var _globalStylesSidebar = _interopRequireDefault(require("../global-styles-sidebar"));
|
|
@@ -33,7 +30,9 @@ var _isPreviewingTheme2 = require("../../utils/is-previewing-theme");
|
|
|
33
30
|
var _editorCanvasContainer = require("../editor-canvas-container");
|
|
34
31
|
var _saveButton = _interopRequireDefault(require("../save-button"));
|
|
35
32
|
var _moreMenu = _interopRequireDefault(require("../more-menu"));
|
|
33
|
+
var _siteIcon = _interopRequireDefault(require("../site-icon"));
|
|
36
34
|
var _useEditorIframeProps = _interopRequireDefault(require("../block-editor/use-editor-iframe-props"));
|
|
35
|
+
var _useEditorTitle = _interopRequireDefault(require("./use-editor-title"));
|
|
37
36
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
38
37
|
/**
|
|
39
38
|
* External dependencies
|
|
@@ -48,9 +47,8 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
48
47
|
*/
|
|
49
48
|
|
|
50
49
|
const {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
Sidebar
|
|
50
|
+
Editor,
|
|
51
|
+
BackButton
|
|
54
52
|
} = (0, _lockUnlock.unlock)(_editor.privateApis);
|
|
55
53
|
const {
|
|
56
54
|
useHistory
|
|
@@ -58,21 +56,14 @@ const {
|
|
|
58
56
|
const {
|
|
59
57
|
BlockKeyboardShortcuts
|
|
60
58
|
} = (0, _lockUnlock.unlock)(_blockLibrary.privateApis);
|
|
61
|
-
function
|
|
59
|
+
function EditSiteEditor({
|
|
62
60
|
isLoading
|
|
63
61
|
}) {
|
|
64
62
|
const {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
const {
|
|
70
|
-
type: editedPostType
|
|
71
|
-
} = editedPost;
|
|
72
|
-
const {
|
|
73
|
-
context,
|
|
74
|
-
contextPost,
|
|
75
|
-
editorMode,
|
|
63
|
+
editedPostType,
|
|
64
|
+
editedPostId,
|
|
65
|
+
contextPostType,
|
|
66
|
+
contextPostId,
|
|
76
67
|
canvasMode,
|
|
77
68
|
isEditingPage,
|
|
78
69
|
supportsGlobalStyles,
|
|
@@ -83,26 +74,25 @@ function Editor({
|
|
|
83
74
|
const {
|
|
84
75
|
getEditedPostContext,
|
|
85
76
|
getCanvasMode,
|
|
86
|
-
isPage
|
|
77
|
+
isPage,
|
|
78
|
+
getEditedPostType,
|
|
79
|
+
getEditedPostId
|
|
87
80
|
} = (0, _lockUnlock.unlock)(select(_store.store));
|
|
88
81
|
const {
|
|
89
82
|
get
|
|
90
83
|
} = select(_preferences.store);
|
|
91
84
|
const {
|
|
92
|
-
getEntityRecord,
|
|
93
85
|
getCurrentTheme
|
|
94
86
|
} = select(_coreData.store);
|
|
95
|
-
const {
|
|
96
|
-
getEditorMode
|
|
97
|
-
} = select(_editor.store);
|
|
98
87
|
const _context = getEditedPostContext();
|
|
99
88
|
|
|
100
89
|
// The currently selected entity to display.
|
|
101
90
|
// Typically template or template part in the site editor.
|
|
102
91
|
return {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
92
|
+
editedPostType: getEditedPostType(),
|
|
93
|
+
editedPostId: getEditedPostId(),
|
|
94
|
+
contextPostType: _context?.postId ? _context.postType : undefined,
|
|
95
|
+
contextPostId: _context?.postId ? _context.postId : undefined,
|
|
106
96
|
canvasMode: getCanvasMode(),
|
|
107
97
|
isEditingPage: isPage(),
|
|
108
98
|
supportsGlobalStyles: getCurrentTheme()?.is_block_theme,
|
|
@@ -111,24 +101,12 @@ function Editor({
|
|
|
111
101
|
currentPostIsTrashed: select(_editor.store).getCurrentPostAttribute('status') === 'trash'
|
|
112
102
|
};
|
|
113
103
|
}, []);
|
|
104
|
+
(0, _useEditorTitle.default)();
|
|
114
105
|
const _isPreviewingTheme = (0, _isPreviewingTheme2.isPreviewingTheme)();
|
|
115
106
|
const hasDefaultEditorCanvasView = !(0, _editorCanvasContainer.useHasEditorCanvasContainer)();
|
|
116
107
|
const iframeProps = (0, _useEditorIframeProps.default)();
|
|
117
|
-
const isViewMode = canvasMode === 'view';
|
|
118
108
|
const isEditMode = canvasMode === 'edit';
|
|
119
|
-
const
|
|
120
|
-
const postWithTemplate = !!context?.postId;
|
|
121
|
-
let title;
|
|
122
|
-
if (hasLoadedPost) {
|
|
123
|
-
var _POST_TYPE_LABELS$edi;
|
|
124
|
-
title = (0, _i18n.sprintf)(
|
|
125
|
-
// translators: A breadcrumb trail for the Admin document title. %1$s: title of template being edited, %2$s: type of template (Template or Template Part).
|
|
126
|
-
(0, _i18n.__)('%1$s ‹ %2$s'), getTitle(), (_POST_TYPE_LABELS$edi = _constants.POST_TYPE_LABELS[editedPostType]) !== null && _POST_TYPE_LABELS$edi !== void 0 ? _POST_TYPE_LABELS$edi : _constants.POST_TYPE_LABELS[_constants.TEMPLATE_POST_TYPE]);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
// Only announce the title once the editor is ready to prevent "Replace"
|
|
130
|
-
// action in <URLQueryController> from double-announcing.
|
|
131
|
-
(0, _useTitle.default)(hasLoadedPost && title);
|
|
109
|
+
const postWithTemplate = !!contextPostId;
|
|
132
110
|
const loadingProgressId = (0, _compose.useInstanceId)(_canvasLoader.default, 'edit-site-editor__loading-progress');
|
|
133
111
|
const settings = (0, _useSiteEditorSettings.useSpecificEditorSettings)();
|
|
134
112
|
const styles = (0, _element.useMemo)(() => [...settings.styles, {
|
|
@@ -137,6 +115,9 @@ function Editor({
|
|
|
137
115
|
|
|
138
116
|
css: `body{${canvasMode === 'view' ? `min-height: 100vh; ${currentPostIsTrashed ? '' : 'cursor: pointer;'}` : ''}}}`
|
|
139
117
|
}], [settings.styles, canvasMode, currentPostIsTrashed]);
|
|
118
|
+
const {
|
|
119
|
+
setCanvasMode
|
|
120
|
+
} = (0, _lockUnlock.unlock)((0, _data.useDispatch)(_store.store));
|
|
140
121
|
const {
|
|
141
122
|
createSuccessNotice
|
|
142
123
|
} = (0, _data.useDispatch)(_notices.store);
|
|
@@ -157,7 +138,7 @@ function Editor({
|
|
|
157
138
|
const _title = typeof newItem.title === 'string' ? newItem.title : newItem.title?.rendered;
|
|
158
139
|
createSuccessNotice((0, _i18n.sprintf)(
|
|
159
140
|
// translators: %s: Title of the created post e.g: "Post 1".
|
|
160
|
-
(0, _i18n.__)('"%s" successfully created.'), _title), {
|
|
141
|
+
(0, _i18n.__)('"%s" successfully created.'), (0, _htmlEntities.decodeEntities)(_title)), {
|
|
161
142
|
type: 'snackbar',
|
|
162
143
|
id: 'duplicate-post-action',
|
|
163
144
|
actions: [{
|
|
@@ -175,35 +156,40 @@ function Editor({
|
|
|
175
156
|
break;
|
|
176
157
|
}
|
|
177
158
|
}, [history, createSuccessNotice]);
|
|
178
|
-
const isReady = !isLoading
|
|
159
|
+
const isReady = !isLoading;
|
|
179
160
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
180
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_globalStylesRenderer.GlobalStylesRenderer, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.EditorKeyboardShortcutsRegister, {}), isEditMode && /*#__PURE__*/(0, _jsxRuntime.jsx)(BlockKeyboardShortcuts, {}),
|
|
161
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_globalStylesRenderer.GlobalStylesRenderer, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.EditorKeyboardShortcutsRegister, {}), isEditMode && /*#__PURE__*/(0, _jsxRuntime.jsx)(BlockKeyboardShortcuts, {}), !isReady ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_canvasLoader.default, {
|
|
181
162
|
id: loadingProgressId
|
|
182
|
-
}) : null, isEditMode && /*#__PURE__*/(0, _jsxRuntime.jsx)(_welcomeGuide.default, {}),
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
}), isReady && /*#__PURE__*/(0, _jsxRuntime.jsxs)(EditorProvider, {
|
|
187
|
-
post: postWithTemplate ? contextPost : editedPost,
|
|
188
|
-
__unstableTemplate: postWithTemplate ? editedPost : undefined,
|
|
163
|
+
}) : null, isEditMode && /*#__PURE__*/(0, _jsxRuntime.jsx)(_welcomeGuide.default, {}), isReady && /*#__PURE__*/(0, _jsxRuntime.jsxs)(Editor, {
|
|
164
|
+
postType: postWithTemplate ? contextPostType : editedPostType,
|
|
165
|
+
postId: postWithTemplate ? contextPostId : editedPostId,
|
|
166
|
+
templateId: postWithTemplate ? editedPostId : undefined,
|
|
189
167
|
settings: settings,
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
168
|
+
className: (0, _clsx.default)('edit-site-editor__editor-interface', {
|
|
169
|
+
'show-icon-labels': showIconLabels
|
|
170
|
+
}),
|
|
171
|
+
styles: styles,
|
|
172
|
+
enableRegionNavigation: false,
|
|
173
|
+
customSaveButton: _isPreviewingTheme && /*#__PURE__*/(0, _jsxRuntime.jsx)(_saveButton.default, {
|
|
174
|
+
size: "compact"
|
|
175
|
+
}),
|
|
176
|
+
forceDisableBlockTools: !hasDefaultEditorCanvasView,
|
|
177
|
+
title: !hasDefaultEditorCanvasView ? (0, _editorCanvasContainer.getEditorCanvasContainerTitle)(editorCanvasView) : undefined,
|
|
178
|
+
iframeProps: iframeProps,
|
|
179
|
+
onActionPerformed: onActionPerformed,
|
|
180
|
+
extraSidebarPanels: !isEditingPage && /*#__PURE__*/(0, _jsxRuntime.jsx)(_pluginTemplateSettingPanel.default.Slot, {}),
|
|
181
|
+
children: [isEditMode && /*#__PURE__*/(0, _jsxRuntime.jsx)(BackButton, {
|
|
182
|
+
children: ({
|
|
183
|
+
length
|
|
184
|
+
}) => length <= 1 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
185
|
+
label: (0, _i18n.__)('Open Navigation'),
|
|
186
|
+
className: "edit-site-layout__view-mode-toggle",
|
|
187
|
+
onClick: () => setCanvasMode('view'),
|
|
188
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_siteIcon.default, {
|
|
189
|
+
className: "edit-site-layout__view-mode-toggle-icon"
|
|
190
|
+
})
|
|
191
|
+
})
|
|
192
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_moreMenu.default, {}), supportsGlobalStyles && /*#__PURE__*/(0, _jsxRuntime.jsx)(_globalStylesSidebar.default, {})]
|
|
207
193
|
})]
|
|
208
194
|
});
|
|
209
195
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_data","_components","_compose","_editor","_i18n","_coreData","_blockLibrary","_element","_notices","_router","_preferences","_welcomeGuide","_store","_globalStylesRenderer","_useTitle","_canvasLoader","_lockUnlock","_useEditedEntityRecord","_constants","_templatePartConverter","_useSiteEditorSettings","_pluginTemplateSettingPanel","_globalStylesSidebar","_isPreviewingTheme2","_editorCanvasContainer","_saveButton","_moreMenu","_useEditorIframeProps","_jsxRuntime","EditorInterface","ExperimentalEditorProvider","EditorProvider","Sidebar","unlock","editorPrivateApis","useHistory","routerPrivateApis","BlockKeyboardShortcuts","blockLibraryPrivateApis","Editor","isLoading","record","editedPost","getTitle","isLoaded","hasLoadedPost","useEditedEntityRecord","type","editedPostType","context","contextPost","editorMode","canvasMode","isEditingPage","supportsGlobalStyles","showIconLabels","editorCanvasView","currentPostIsTrashed","useSelect","select","getEditedPostContext","getCanvasMode","isPage","editSiteStore","get","preferencesStore","getEntityRecord","getCurrentTheme","coreDataStore","getEditorMode","editorStore","_context","postId","postType","undefined","is_block_theme","getEditorCanvasContainerView","getCurrentPostAttribute","_isPreviewingTheme","isPreviewingTheme","hasDefaultEditorCanvasView","useHasEditorCanvasContainer","iframeProps","useEditorIframeProps","isViewMode","isEditMode","showVisualEditor","postWithTemplate","title","_POST_TYPE_LABELS$edi","sprintf","__","POST_TYPE_LABELS","TEMPLATE_POST_TYPE","useTitle","loadingProgressId","useInstanceId","CanvasLoader","settings","useSpecificEditorSettings","styles","useMemo","css","createSuccessNotice","useDispatch","noticesStore","history","onActionPerformed","useCallback","actionId","items","push","newItem","_title","rendered","id","actions","label","onClick","canvas","isReady","jsxs","Fragment","children","jsx","GlobalStylesRenderer","EditorKeyboardShortcutsRegister","default","Notice","status","isDismissible","post","__unstableTemplate","useSubRegistry","className","clsx","enableRegionNavigation","customSaveButton","size","forceDisableBlockTools","getEditorCanvasContainerTitle","extraPanels","Slot"],"sources":["@wordpress/edit-site/src/components/editor/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { Notice } from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport {\n\tEditorKeyboardShortcutsRegister,\n\tprivateApis as editorPrivateApis,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { privateApis as blockLibraryPrivateApis } from '@wordpress/block-library';\nimport { useCallback, useMemo } from '@wordpress/element';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport WelcomeGuide from '../welcome-guide';\nimport { store as editSiteStore } from '../../store';\nimport { GlobalStylesRenderer } from '../global-styles-renderer';\nimport useTitle from '../routes/use-title';\nimport CanvasLoader from '../canvas-loader';\nimport { unlock } from '../../lock-unlock';\nimport useEditedEntityRecord from '../use-edited-entity-record';\nimport { POST_TYPE_LABELS, TEMPLATE_POST_TYPE } from '../../utils/constants';\nimport TemplatePartConverter from '../template-part-converter';\nimport { useSpecificEditorSettings } from '../block-editor/use-site-editor-settings';\nimport PluginTemplateSettingPanel from '../plugin-template-setting-panel';\nimport GlobalStylesSidebar from '../global-styles-sidebar';\nimport { isPreviewingTheme } from '../../utils/is-previewing-theme';\nimport {\n\tgetEditorCanvasContainerTitle,\n\tuseHasEditorCanvasContainer,\n} from '../editor-canvas-container';\nimport SaveButton from '../save-button';\nimport SiteEditorMoreMenu from '../more-menu';\nimport useEditorIframeProps from '../block-editor/use-editor-iframe-props';\n\nconst {\n\tEditorInterface,\n\tExperimentalEditorProvider: EditorProvider,\n\tSidebar,\n} = unlock( editorPrivateApis );\nconst { useHistory } = unlock( routerPrivateApis );\nconst { BlockKeyboardShortcuts } = unlock( blockLibraryPrivateApis );\n\nexport default function Editor( { isLoading } ) {\n\tconst {\n\t\trecord: editedPost,\n\t\tgetTitle,\n\t\tisLoaded: hasLoadedPost,\n\t} = useEditedEntityRecord();\n\tconst { type: editedPostType } = editedPost;\n\tconst {\n\t\tcontext,\n\t\tcontextPost,\n\t\teditorMode,\n\t\tcanvasMode,\n\t\tisEditingPage,\n\t\tsupportsGlobalStyles,\n\t\tshowIconLabels,\n\t\teditorCanvasView,\n\t\tcurrentPostIsTrashed,\n\t} = useSelect( ( select ) => {\n\t\tconst { getEditedPostContext, getCanvasMode, isPage } = unlock(\n\t\t\tselect( editSiteStore )\n\t\t);\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { getEntityRecord, getCurrentTheme } = select( coreDataStore );\n\t\tconst { getEditorMode } = select( editorStore );\n\t\tconst _context = getEditedPostContext();\n\n\t\t// The currently selected entity to display.\n\t\t// Typically template or template part in the site editor.\n\t\treturn {\n\t\t\tcontext: _context,\n\t\t\tcontextPost: _context?.postId\n\t\t\t\t? getEntityRecord(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t_context.postType,\n\t\t\t\t\t\t_context.postId\n\t\t\t\t )\n\t\t\t\t: undefined,\n\t\t\teditorMode: getEditorMode(),\n\t\t\tcanvasMode: getCanvasMode(),\n\t\t\tisEditingPage: isPage(),\n\t\t\tsupportsGlobalStyles: getCurrentTheme()?.is_block_theme,\n\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\teditorCanvasView: unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t).getEditorCanvasContainerView(),\n\t\t\tcurrentPostIsTrashed:\n\t\t\t\tselect( editorStore ).getCurrentPostAttribute( 'status' ) ===\n\t\t\t\t'trash',\n\t\t};\n\t}, [] );\n\tconst _isPreviewingTheme = isPreviewingTheme();\n\tconst hasDefaultEditorCanvasView = ! useHasEditorCanvasContainer();\n\tconst iframeProps = useEditorIframeProps();\n\n\tconst isViewMode = canvasMode === 'view';\n\tconst isEditMode = canvasMode === 'edit';\n\tconst showVisualEditor = isViewMode || editorMode === 'visual';\n\tconst postWithTemplate = !! context?.postId;\n\n\tlet title;\n\tif ( hasLoadedPost ) {\n\t\ttitle = sprintf(\n\t\t\t// translators: A breadcrumb trail for the Admin document title. %1$s: title of template being edited, %2$s: type of template (Template or Template Part).\n\t\t\t__( '%1$s ‹ %2$s' ),\n\t\t\tgetTitle(),\n\t\t\tPOST_TYPE_LABELS[ editedPostType ] ??\n\t\t\t\tPOST_TYPE_LABELS[ TEMPLATE_POST_TYPE ]\n\t\t);\n\t}\n\n\t// Only announce the title once the editor is ready to prevent \"Replace\"\n\t// action in <URLQueryController> from double-announcing.\n\tuseTitle( hasLoadedPost && title );\n\n\tconst loadingProgressId = useInstanceId(\n\t\tCanvasLoader,\n\t\t'edit-site-editor__loading-progress'\n\t);\n\n\tconst settings = useSpecificEditorSettings();\n\tconst styles = useMemo(\n\t\t() => [\n\t\t\t...settings.styles,\n\t\t\t{\n\t\t\t\t// Forming a \"block formatting context\" to prevent margin collapsing.\n\t\t\t\t// @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context\n\n\t\t\t\tcss: `body{${\n\t\t\t\t\tcanvasMode === 'view'\n\t\t\t\t\t\t? `min-height: 100vh; ${\n\t\t\t\t\t\t\t\tcurrentPostIsTrashed ? '' : 'cursor: pointer;'\n\t\t\t\t\t\t }`\n\t\t\t\t\t\t: ''\n\t\t\t\t}}}`,\n\t\t\t},\n\t\t],\n\t\t[ settings.styles, canvasMode, currentPostIsTrashed ]\n\t);\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\tconst history = useHistory();\n\tconst onActionPerformed = useCallback(\n\t\t( actionId, items ) => {\n\t\t\tswitch ( actionId ) {\n\t\t\t\tcase 'move-to-trash':\n\t\t\t\tcase 'delete-post':\n\t\t\t\t\t{\n\t\t\t\t\t\thistory.push( {\n\t\t\t\t\t\t\tpostType: items[ 0 ].type,\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'duplicate-post':\n\t\t\t\t\t{\n\t\t\t\t\t\tconst newItem = items[ 0 ];\n\t\t\t\t\t\tconst _title =\n\t\t\t\t\t\t\ttypeof newItem.title === 'string'\n\t\t\t\t\t\t\t\t? newItem.title\n\t\t\t\t\t\t\t\t: newItem.title?.rendered;\n\t\t\t\t\t\tcreateSuccessNotice(\n\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t// translators: %s: Title of the created post e.g: \"Post 1\".\n\t\t\t\t\t\t\t\t__( '\"%s\" successfully created.' ),\n\t\t\t\t\t\t\t\t_title\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\t\t\tid: 'duplicate-post-action',\n\t\t\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlabel: __( 'Edit' ),\n\t\t\t\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\t\t\t\thistory.push( {\n\t\t\t\t\t\t\t\t\t\t\t\tpostId: newItem.id,\n\t\t\t\t\t\t\t\t\t\t\t\tpostType: newItem.type,\n\t\t\t\t\t\t\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t},\n\t\t[ history, createSuccessNotice ]\n\t);\n\n\tconst isReady =\n\t\t! isLoading &&\n\t\t( ( postWithTemplate && !! contextPost && !! editedPost ) ||\n\t\t\t( ! postWithTemplate && !! editedPost ) );\n\n\treturn (\n\t\t<>\n\t\t\t<GlobalStylesRenderer />\n\t\t\t<EditorKeyboardShortcutsRegister />\n\t\t\t{ isEditMode && <BlockKeyboardShortcuts /> }\n\t\t\t{ showVisualEditor && <TemplatePartConverter /> }\n\t\t\t{ ! isReady ? <CanvasLoader id={ loadingProgressId } /> : null }\n\t\t\t{ isEditMode && <WelcomeGuide /> }\n\t\t\t{ hasLoadedPost && ! editedPost && (\n\t\t\t\t<Notice status=\"warning\" isDismissible={ false }>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t\"You attempted to edit an item that doesn't exist. Perhaps it was deleted?\"\n\t\t\t\t\t) }\n\t\t\t\t</Notice>\n\t\t\t) }\n\t\t\t{ isReady && (\n\t\t\t\t<EditorProvider\n\t\t\t\t\tpost={ postWithTemplate ? contextPost : editedPost }\n\t\t\t\t\t__unstableTemplate={\n\t\t\t\t\t\tpostWithTemplate ? editedPost : undefined\n\t\t\t\t\t}\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t>\n\t\t\t\t\t<SiteEditorMoreMenu />\n\t\t\t\t\t<EditorInterface\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'edit-site-editor__interface-skeleton',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'show-icon-labels': showIconLabels,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tstyles={ styles }\n\t\t\t\t\t\tenableRegionNavigation={ false }\n\t\t\t\t\t\tcustomSaveButton={\n\t\t\t\t\t\t\t_isPreviewingTheme && <SaveButton size=\"compact\" />\n\t\t\t\t\t\t}\n\t\t\t\t\t\tforceDisableBlockTools={ ! hasDefaultEditorCanvasView }\n\t\t\t\t\t\ttitle={\n\t\t\t\t\t\t\t! hasDefaultEditorCanvasView\n\t\t\t\t\t\t\t\t? getEditorCanvasContainerTitle(\n\t\t\t\t\t\t\t\t\t\teditorCanvasView\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\tiframeProps={ iframeProps }\n\t\t\t\t\t/>\n\t\t\t\t\t<Sidebar\n\t\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t\t\textraPanels={\n\t\t\t\t\t\t\t! isEditingPage && (\n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A,CAAAgG,GAAA,EAACvG,2BAAA,CAAA0G,OAA0B,CAACe,IAAI,IAAE;MAEnC,CACD,CAAC,EACAxF,oBAAoB,iBAAI,IAAA1B,WAAA,CAAAgG,GAAA,EAACtG,oBAAA,CAAAyG,OAAmB,IAAE,CAAC;IAAA,CAClC,CAChB;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_data","_components","_compose","_editor","_i18n","_coreData","_blockLibrary","_element","_notices","_router","_preferences","_htmlEntities","_welcomeGuide","_store","_globalStylesRenderer","_canvasLoader","_lockUnlock","_useSiteEditorSettings","_pluginTemplateSettingPanel","_globalStylesSidebar","_isPreviewingTheme2","_editorCanvasContainer","_saveButton","_moreMenu","_siteIcon","_useEditorIframeProps","_useEditorTitle","_jsxRuntime","Editor","BackButton","unlock","editorPrivateApis","useHistory","routerPrivateApis","BlockKeyboardShortcuts","blockLibraryPrivateApis","EditSiteEditor","isLoading","editedPostType","editedPostId","contextPostType","contextPostId","canvasMode","isEditingPage","supportsGlobalStyles","showIconLabels","editorCanvasView","currentPostIsTrashed","useSelect","select","getEditedPostContext","getCanvasMode","isPage","getEditedPostType","getEditedPostId","editSiteStore","get","preferencesStore","getCurrentTheme","coreDataStore","_context","postId","postType","undefined","is_block_theme","getEditorCanvasContainerView","editorStore","getCurrentPostAttribute","useEditorTitle","_isPreviewingTheme","isPreviewingTheme","hasDefaultEditorCanvasView","useHasEditorCanvasContainer","iframeProps","useEditorIframeProps","isEditMode","postWithTemplate","loadingProgressId","useInstanceId","CanvasLoader","settings","useSpecificEditorSettings","styles","useMemo","css","setCanvasMode","useDispatch","createSuccessNotice","noticesStore","history","onActionPerformed","useCallback","actionId","items","push","type","newItem","_title","title","rendered","sprintf","__","decodeEntities","id","actions","label","onClick","canvas","isReady","jsxs","Fragment","children","jsx","GlobalStylesRenderer","EditorKeyboardShortcutsRegister","default","templateId","className","clsx","enableRegionNavigation","customSaveButton","size","forceDisableBlockTools","getEditorCanvasContainerTitle","extraSidebarPanels","Slot","length","Button"],"sources":["@wordpress/edit-site/src/components/editor/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { Button } from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport {\n\tEditorKeyboardShortcutsRegister,\n\tprivateApis as editorPrivateApis,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { privateApis as blockLibraryPrivateApis } from '@wordpress/block-library';\nimport { useCallback, useMemo } from '@wordpress/element';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport WelcomeGuide from '../welcome-guide';\nimport { store as editSiteStore } from '../../store';\nimport { GlobalStylesRenderer } from '../global-styles-renderer';\nimport CanvasLoader from '../canvas-loader';\nimport { unlock } from '../../lock-unlock';\nimport { useSpecificEditorSettings } from '../block-editor/use-site-editor-settings';\nimport PluginTemplateSettingPanel from '../plugin-template-setting-panel';\nimport GlobalStylesSidebar from '../global-styles-sidebar';\nimport { isPreviewingTheme } from '../../utils/is-previewing-theme';\nimport {\n\tgetEditorCanvasContainerTitle,\n\tuseHasEditorCanvasContainer,\n} from '../editor-canvas-container';\nimport SaveButton from '../save-button';\nimport SiteEditorMoreMenu from '../more-menu';\nimport SiteIcon from '../site-icon';\nimport useEditorIframeProps from '../block-editor/use-editor-iframe-props';\nimport useEditorTitle from './use-editor-title';\n\nconst { Editor, BackButton } = unlock( editorPrivateApis );\nconst { useHistory } = unlock( routerPrivateApis );\nconst { BlockKeyboardShortcuts } = unlock( blockLibraryPrivateApis );\n\nexport default function EditSiteEditor( { isLoading } ) {\n\tconst {\n\t\teditedPostType,\n\t\teditedPostId,\n\t\tcontextPostType,\n\t\tcontextPostId,\n\t\tcanvasMode,\n\t\tisEditingPage,\n\t\tsupportsGlobalStyles,\n\t\tshowIconLabels,\n\t\teditorCanvasView,\n\t\tcurrentPostIsTrashed,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetEditedPostContext,\n\t\t\tgetCanvasMode,\n\t\t\tisPage,\n\t\t\tgetEditedPostType,\n\t\t\tgetEditedPostId,\n\t\t} = unlock( select( editSiteStore ) );\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { getCurrentTheme } = select( coreDataStore );\n\t\tconst _context = getEditedPostContext();\n\n\t\t// The currently selected entity to display.\n\t\t// Typically template or template part in the site editor.\n\t\treturn {\n\t\t\teditedPostType: getEditedPostType(),\n\t\t\teditedPostId: getEditedPostId(),\n\t\t\tcontextPostType: _context?.postId ? _context.postType : undefined,\n\t\t\tcontextPostId: _context?.postId ? _context.postId : undefined,\n\t\t\tcanvasMode: getCanvasMode(),\n\t\t\tisEditingPage: isPage(),\n\t\t\tsupportsGlobalStyles: getCurrentTheme()?.is_block_theme,\n\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\teditorCanvasView: unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t).getEditorCanvasContainerView(),\n\t\t\tcurrentPostIsTrashed:\n\t\t\t\tselect( editorStore ).getCurrentPostAttribute( 'status' ) ===\n\t\t\t\t'trash',\n\t\t};\n\t}, [] );\n\tuseEditorTitle();\n\tconst _isPreviewingTheme = isPreviewingTheme();\n\tconst hasDefaultEditorCanvasView = ! useHasEditorCanvasContainer();\n\tconst iframeProps = useEditorIframeProps();\n\tconst isEditMode = canvasMode === 'edit';\n\tconst postWithTemplate = !! contextPostId;\n\tconst loadingProgressId = useInstanceId(\n\t\tCanvasLoader,\n\t\t'edit-site-editor__loading-progress'\n\t);\n\n\tconst settings = useSpecificEditorSettings();\n\tconst styles = useMemo(\n\t\t() => [\n\t\t\t...settings.styles,\n\t\t\t{\n\t\t\t\t// Forming a \"block formatting context\" to prevent margin collapsing.\n\t\t\t\t// @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context\n\n\t\t\t\tcss: `body{${\n\t\t\t\t\tcanvasMode === 'view'\n\t\t\t\t\t\t? `min-height: 100vh; ${\n\t\t\t\t\t\t\t\tcurrentPostIsTrashed ? '' : 'cursor: pointer;'\n\t\t\t\t\t\t }`\n\t\t\t\t\t\t: ''\n\t\t\t\t}}}`,\n\t\t\t},\n\t\t],\n\t\t[ settings.styles, canvasMode, currentPostIsTrashed ]\n\t);\n\tconst { setCanvasMode } = unlock( useDispatch( editSiteStore ) );\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\tconst history = useHistory();\n\tconst onActionPerformed = useCallback(\n\t\t( actionId, items ) => {\n\t\t\tswitch ( actionId ) {\n\t\t\t\tcase 'move-to-trash':\n\t\t\t\tcase 'delete-post':\n\t\t\t\t\t{\n\t\t\t\t\t\thistory.push( {\n\t\t\t\t\t\t\tpostType: items[ 0 ].type,\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'duplicate-post':\n\t\t\t\t\t{\n\t\t\t\t\t\tconst newItem = items[ 0 ];\n\t\t\t\t\t\tconst _title =\n\t\t\t\t\t\t\ttypeof newItem.title === 'string'\n\t\t\t\t\t\t\t\t? newItem.title\n\t\t\t\t\t\t\t\t: newItem.title?.rendered;\n\t\t\t\t\t\tcreateSuccessNotice(\n\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t// translators: %s: Title of the created post e.g: \"Post 1\".\n\t\t\t\t\t\t\t\t__( '\"%s\" successfully created.' ),\n\t\t\t\t\t\t\t\tdecodeEntities( _title )\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\t\t\tid: 'duplicate-post-action',\n\t\t\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlabel: __( 'Edit' ),\n\t\t\t\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\t\t\t\thistory.push( {\n\t\t\t\t\t\t\t\t\t\t\t\tpostId: newItem.id,\n\t\t\t\t\t\t\t\t\t\t\t\tpostType: newItem.type,\n\t\t\t\t\t\t\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t},\n\t\t[ history, createSuccessNotice ]\n\t);\n\n\tconst isReady = ! isLoading;\n\n\treturn (\n\t\t<>\n\t\t\t<GlobalStylesRenderer />\n\t\t\t<EditorKeyboardShortcutsRegister />\n\t\t\t{ isEditMode && <BlockKeyboardShortcuts /> }\n\t\t\t{ ! isReady ? <CanvasLoader id={ loadingProgressId } /> : null }\n\t\t\t{ isEditMode && <WelcomeGuide /> }\n\t\t\t{ isReady && (\n\t\t\t\t<Editor\n\t\t\t\t\tpostType={\n\t\t\t\t\t\tpostWithTemplate ? contextPostType : editedPostType\n\t\t\t\t\t}\n\t\t\t\t\tpostId={ postWithTemplate ? contextPostId : editedPostId }\n\t\t\t\t\ttemplateId={ postWithTemplate ? editedPostId : undefined }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t\tclassName={ clsx( 'edit-site-editor__editor-interface', {\n\t\t\t\t\t\t'show-icon-labels': showIconLabels,\n\t\t\t\t\t} ) }\n\t\t\t\t\tstyles={ styles }\n\t\t\t\t\tenableRegionNavigation={ false }\n\t\t\t\t\tcustomSaveButton={\n\t\t\t\t\t\t_isPreviewingTheme && <SaveButton size=\"compact\" />\n\t\t\t\t\t}\n\t\t\t\t\tforceDisableBlockTools={ ! hasDefaultEditorCanvasView }\n\t\t\t\t\ttitle={\n\t\t\t\t\t\t! hasDefaultEditorCanvasView\n\t\t\t\t\t\t\t? getEditorCanvasContainerTitle( editorCanvasView )\n\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t}\n\t\t\t\t\tiframeProps={ iframeProps }\n\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t\textraSidebarPanels={\n\t\t\t\t\t\t! isEditingPage && <PluginTemplateSettingPanel.Slot />\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t{ isEditMode && (\n\t\t\t\t\t\t<BackButton>\n\t\t\t\t\t\t\t{ ( { length } ) =>\n\t\t\t\t\t\t\t\tlength <= 1 && (\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Open Navigation' ) }\n\t\t\t\t\t\t\t\t\t\tclassName=\"edit-site-layout__view-mode-toggle\"\n\t\t\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\t\t\tsetCanvasMode( 'view' )\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<SiteIcon className=\"edit-site-layout__view-mode-toggle-icon\" />\n\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</BackButton>\n\t\t\t\t\t) }\n\t\t\t\t\t<SiteEditorMoreMenu />\n\t\t\t\t\t{ supportsGlobalStyles && <GlobalStylesSidebar /> }\n\t\t\t\t</Editor>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAKA,IAA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S,EAAC,oCAAoC;UAC9CX,OAAO,EAAGA,CAAA,KACTrB,aAAa,CAAE,MAAO,CACtB;UAAA0B,QAAA,eAED,IAAApF,WAAA,CAAAqF,GAAA,EAACxF,SAAA,CAAA2F,OAAQ;YAACE,SAAS,EAAC;UAAyC,CAAE;QAAC,CACzD;MACR,CAES,CACZ,eACD,IAAA1F,WAAA,CAAAqF,GAAA,EAACzF,SAAA,CAAA4F,OAAkB,IAAE,CAAC,EACpBvE,oBAAoB,iBAAI,IAAAjB,WAAA,CAAAqF,GAAA,EAAC7F,oBAAA,CAAAgG,OAAmB,IAAE,CAAC;IAAA,CAC1C,CACR;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _i18n = require("@wordpress/i18n");
|
|
9
|
+
var _useEditedEntityRecord = _interopRequireDefault(require("../use-edited-entity-record"));
|
|
10
|
+
var _useTitle = _interopRequireDefault(require("../routes/use-title"));
|
|
11
|
+
var _constants = require("../../utils/constants");
|
|
12
|
+
/**
|
|
13
|
+
* WordPress dependencies
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Internal dependencies
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
function useEditorTitle() {
|
|
21
|
+
const {
|
|
22
|
+
record: editedPost,
|
|
23
|
+
getTitle,
|
|
24
|
+
isLoaded: hasLoadedPost
|
|
25
|
+
} = (0, _useEditedEntityRecord.default)();
|
|
26
|
+
let title;
|
|
27
|
+
if (hasLoadedPost) {
|
|
28
|
+
var _POST_TYPE_LABELS$edi;
|
|
29
|
+
title = (0, _i18n.sprintf)(
|
|
30
|
+
// translators: A breadcrumb trail for the Admin document title. %1$s: title of template being edited, %2$s: type of template (Template or Template Part).
|
|
31
|
+
(0, _i18n.__)('%1$s ‹ %2$s'), getTitle(), (_POST_TYPE_LABELS$edi = _constants.POST_TYPE_LABELS[editedPost.type]) !== null && _POST_TYPE_LABELS$edi !== void 0 ? _POST_TYPE_LABELS$edi : _constants.POST_TYPE_LABELS[_constants.TEMPLATE_POST_TYPE]);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Only announce the title once the editor is ready to prevent "Replace"
|
|
35
|
+
// action in <URLQueryController> from double-announcing.
|
|
36
|
+
(0, _useTitle.default)(hasLoadedPost && title);
|
|
37
|
+
}
|
|
38
|
+
var _default = exports.default = useEditorTitle;
|
|
39
|
+
//# sourceMappingURL=use-editor-title.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_i18n","require","_useEditedEntityRecord","_interopRequireDefault","_useTitle","_constants","useEditorTitle","record","editedPost","getTitle","isLoaded","hasLoadedPost","useEditedEntityRecord","title","_POST_TYPE_LABELS$edi","sprintf","__","POST_TYPE_LABELS","type","TEMPLATE_POST_TYPE","useTitle","_default","exports","default"],"sources":["@wordpress/edit-site/src/components/editor/use-editor-title.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport useEditedEntityRecord from '../use-edited-entity-record';\nimport useTitle from '../routes/use-title';\nimport { POST_TYPE_LABELS, TEMPLATE_POST_TYPE } from '../../utils/constants';\n\nfunction useEditorTitle() {\n\tconst {\n\t\trecord: editedPost,\n\t\tgetTitle,\n\t\tisLoaded: hasLoadedPost,\n\t} = useEditedEntityRecord();\n\tlet title;\n\tif ( hasLoadedPost ) {\n\t\ttitle = sprintf(\n\t\t\t// translators: A breadcrumb trail for the Admin document title. %1$s: title of template being edited, %2$s: type of template (Template or Template Part).\n\t\t\t__( '%1$s ‹ %2$s' ),\n\t\t\tgetTitle(),\n\t\t\tPOST_TYPE_LABELS[ editedPost.type ] ??\n\t\t\t\tPOST_TYPE_LABELS[ TEMPLATE_POST_TYPE ]\n\t\t);\n\t}\n\n\t// Only announce the title once the editor is ready to prevent \"Replace\"\n\t// action in <URLQueryController> from double-announcing.\n\tuseTitle( hasLoadedPost && title );\n}\n\nexport default useEditorTitle;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,sBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,SAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AAVA;AACA;AACA;;AAGA;AACA;AACA;;AAKA,SAASK,cAAcA,CAAA,EAAG;EACzB,MAAM;IACLC,MAAM,EAAEC,UAAU;IAClBC,QAAQ;IACRC,QAAQ,EAAEC;EACX,CAAC,GAAG,IAAAC,8BAAqB,EAAC,CAAC;EAC3B,IAAIC,KAAK;EACT,IAAKF,aAAa,EAAG;IAAA,IAAAG,qBAAA;IACpBD,KAAK,GAAG,IAAAE,aAAO;IACd;IACA,IAAAC,QAAE,EAAE,aAAc,CAAC,EACnBP,QAAQ,CAAC,CAAC,GAAAK,qBAAA,GACVG,2BAAgB,CAAET,UAAU,CAACU,IAAI,CAAE,cAAAJ,qBAAA,cAAAA,qBAAA,GAClCG,2BAAgB,CAAEE,6BAAkB,CACtC,CAAC;EACF;;EAEA;EACA;EACA,IAAAC,iBAAQ,EAAET,aAAa,IAAIE,KAAM,CAAC;AACnC;AAAC,IAAAQ,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcjB,cAAc","ignoreList":[]}
|
|
@@ -259,6 +259,7 @@ function ConfirmDeleteDialog({
|
|
|
259
259
|
confirmButtonText: (0, _i18n.__)('Delete'),
|
|
260
260
|
onCancel: handleCancelUninstall,
|
|
261
261
|
onConfirm: handleConfirmUninstall,
|
|
262
|
+
size: "medium",
|
|
262
263
|
children: font && (0, _i18n.sprintf)( /* translators: %s: Name of the font. */
|
|
263
264
|
(0, _i18n.__)('Are you sure you want to delete "%s" font and all its variants and assets?'), font.name)
|
|
264
265
|
});
|