@wordpress/edit-site 3.0.22 → 3.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/add-new-template/new-template-part.js +4 -1
- package/build/components/add-new-template/new-template-part.js.map +1 -1
- package/build/components/editor/index.js +11 -1
- package/build/components/editor/index.js.map +1 -1
- package/build/components/error-boundary/index.js +11 -27
- package/build/components/error-boundary/index.js.map +1 -1
- package/build/components/error-boundary/warning.js +70 -0
- package/build/components/error-boundary/warning.js.map +1 -0
- package/build/components/global-styles/screen-background-color.js +8 -9
- package/build/components/global-styles/screen-background-color.js.map +1 -1
- package/build/components/global-styles/screen-link-color.js +6 -10
- package/build/components/global-styles/screen-link-color.js.map +1 -1
- package/build/components/global-styles/screen-text-color.js +6 -10
- package/build/components/global-styles/screen-text-color.js.map +1 -1
- package/build/components/header/more-menu/index.js +68 -39
- package/build/components/header/more-menu/index.js.map +1 -1
- package/build/{plugins → components/header/more-menu}/site-export.js +0 -0
- package/build/components/header/more-menu/site-export.js.map +1 -0
- package/build/{plugins → components/header/more-menu}/welcome-guide-menu-item.js +1 -1
- package/build/components/header/more-menu/welcome-guide-menu-item.js.map +1 -0
- package/build/components/header/tools-more-menu-group/index.js +1 -5
- package/build/components/header/tools-more-menu-group/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/config.js +45 -0
- package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -0
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +56 -0
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -0
- package/build/components/keyboard-shortcut-help-modal/index.js +137 -0
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -0
- package/build/components/keyboard-shortcut-help-modal/shortcut.js +65 -0
- package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -0
- package/build/components/keyboard-shortcuts/index.js +9 -0
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/list/added-by.js +51 -50
- package/build/components/list/added-by.js.map +1 -1
- package/build/components/routes/redirect-to-homepage.js +106 -0
- package/build/components/routes/redirect-to-homepage.js.map +1 -0
- package/build/components/template-part-converter/convert-to-template-part.js +4 -1
- package/build/components/template-part-converter/convert-to-template-part.js.map +1 -1
- package/build/components/url-query-controller/index.js +1 -38
- package/build/components/url-query-controller/index.js.map +1 -1
- package/build/index.js +23 -4
- package/build/index.js.map +1 -1
- package/build/store/actions.js +7 -25
- package/build/store/actions.js.map +1 -1
- package/build-module/components/add-new-template/new-template-part.js +4 -1
- package/build-module/components/add-new-template/new-template-part.js.map +1 -1
- package/build-module/components/editor/index.js +11 -1
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/error-boundary/index.js +9 -26
- package/build-module/components/error-boundary/index.js.map +1 -1
- package/build-module/components/error-boundary/warning.js +60 -0
- package/build-module/components/error-boundary/warning.js.map +1 -0
- package/build-module/components/global-styles/screen-background-color.js +8 -10
- package/build-module/components/global-styles/screen-background-color.js.map +1 -1
- package/build-module/components/global-styles/screen-link-color.js +7 -11
- package/build-module/components/global-styles/screen-link-color.js.map +1 -1
- package/build-module/components/global-styles/screen-text-color.js +7 -11
- package/build-module/components/global-styles/screen-text-color.js.map +1 -1
- package/build-module/components/header/more-menu/index.js +65 -40
- package/build-module/components/header/more-menu/index.js.map +1 -1
- package/build-module/{plugins → components/header/more-menu}/site-export.js +0 -0
- package/build-module/components/header/more-menu/site-export.js.map +1 -0
- package/build-module/{plugins → components/header/more-menu}/welcome-guide-menu-item.js +1 -1
- package/build-module/components/header/more-menu/welcome-guide-menu-item.js.map +1 -0
- package/build-module/components/header/tools-more-menu-group/index.js +2 -5
- package/build-module/components/header/tools-more-menu-group/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js +36 -0
- package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -0
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +44 -0
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -0
- package/build-module/components/keyboard-shortcut-help-modal/index.js +120 -0
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -0
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +58 -0
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -0
- package/build-module/components/keyboard-shortcuts/index.js +9 -0
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/list/added-by.js +52 -51
- package/build-module/components/list/added-by.js.map +1 -1
- package/build-module/components/routes/redirect-to-homepage.js +94 -0
- package/build-module/components/routes/redirect-to-homepage.js.map +1 -0
- package/build-module/components/template-part-converter/convert-to-template-part.js +4 -1
- package/build-module/components/template-part-converter/convert-to-template-part.js.map +1 -1
- package/build-module/components/url-query-controller/index.js +3 -40
- package/build-module/components/url-query-controller/index.js.map +1 -1
- package/build-module/index.js +20 -3
- package/build-module/index.js.map +1 -1
- package/build-module/store/actions.js +7 -23
- package/build-module/store/actions.js.map +1 -1
- package/build-style/style-rtl.css +55 -5
- package/build-style/style.css +55 -5
- package/package.json +9 -9
- package/src/components/add-new-template/new-template-part.js +7 -1
- package/src/components/block-editor/style.scss +6 -6
- package/src/components/editor/index.js +14 -0
- package/src/components/error-boundary/index.js +11 -28
- package/src/components/error-boundary/warning.js +59 -0
- package/src/components/global-styles/screen-background-color.js +6 -9
- package/src/components/global-styles/screen-link-color.js +6 -14
- package/src/components/global-styles/screen-text-color.js +6 -14
- package/src/components/header/more-menu/index.js +103 -44
- package/src/{plugins → components/header/more-menu}/site-export.js +0 -0
- package/src/{plugins → components/header/more-menu}/welcome-guide-menu-item.js +1 -1
- package/src/components/header/tools-more-menu-group/index.js +2 -7
- package/src/components/keyboard-shortcut-help-modal/config.js +27 -0
- package/src/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +41 -0
- package/src/components/keyboard-shortcut-help-modal/index.js +135 -0
- package/src/components/keyboard-shortcut-help-modal/shortcut.js +73 -0
- package/src/components/keyboard-shortcut-help-modal/style.scss +66 -0
- package/src/components/keyboard-shortcuts/index.js +10 -0
- package/src/components/list/added-by.js +57 -63
- package/src/components/routes/redirect-to-homepage.js +94 -0
- package/src/components/template-part-converter/convert-to-template-part.js +6 -1
- package/src/components/url-query-controller/index.js +3 -35
- package/src/index.js +25 -2
- package/src/store/actions.js +7 -35
- package/src/store/test/actions.js +0 -90
- package/src/style.scss +1 -0
- package/build/plugins/index.js +0 -28
- package/build/plugins/index.js.map +0 -1
- package/build/plugins/site-export.js.map +0 -1
- package/build/plugins/welcome-guide-menu-item.js.map +0 -1
- package/build-module/plugins/index.js +0 -20
- package/build-module/plugins/index.js.map +0 -1
- package/build-module/plugins/site-export.js.map +0 -1
- package/build-module/plugins/welcome-guide-menu-item.js.map +0 -1
- package/src/plugins/index.js +0 -24
|
@@ -66,8 +66,11 @@ function NewTemplatePart(_ref) {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
try {
|
|
69
|
+
// Currently template parts only allow latin chars.
|
|
70
|
+
// Fallback slug will receive suffix by default.
|
|
71
|
+
const cleanSlug = (0, _lodash.kebabCase)(title).replace(/[^\w-]+/g, '') || 'wp-custom-part';
|
|
69
72
|
const templatePart = await saveEntityRecord('postType', 'wp_template_part', {
|
|
70
|
-
slug:
|
|
73
|
+
slug: cleanSlug,
|
|
71
74
|
title,
|
|
72
75
|
content: '',
|
|
73
76
|
area
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/add-new-template/new-template-part.js"],"names":["NewTemplatePart","postType","history","isModalOpen","setIsModalOpen","createErrorNotice","noticesStore","saveEntityRecord","coreStore","getLastEntitySaveError","createTemplatePart","title","area","type","templatePart","slug","content","lastEntitySaveError","id","push","postId","error","errorMessage","message","code","labels","add_new"],"mappings":";;;;;;;;;AAQA;;AALA;;AAMA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAnBA;AACA;AACA;;AAGA;AACA;AACA;;AAQA;AACA;AACA;AAIe,SAASA,eAAT,OAAyC;AAAA,MAAf;AAAEC,IAAAA;AAAF,GAAe;AACvD,QAAMC,OAAO,GAAG,yBAAhB;AACA,QAAM,CAAEC,WAAF,EAAeC,cAAf,IAAkC,uBAAU,KAAV,CAAxC;AACA,QAAM;AAAEC,IAAAA;AAAF,MAAwB,uBAAaC,cAAb,CAA9B;AACA,QAAM;AAAEC,IAAAA;AAAF,MAAuB,uBAAaC,eAAb,CAA7B;AACA,QAAM;AAAEC,IAAAA;AAAF,MAA6B,qBAAWD,eAAX,CAAnC;;AAEA,iBAAeE,kBAAf,QAAqD;AAAA,QAAlB;AAAEC,MAAAA,KAAF;AAASC,MAAAA;AAAT,KAAkB;;AACpD,QAAK,CAAED,KAAP,EAAe;AACdN,MAAAA,iBAAiB,CAAE,cAAI,uBAAJ,CAAF,EAAiC;AACjDQ,QAAAA,IAAI,EAAE;AAD2C,OAAjC,CAAjB;AAGA;AACA;;AAED,QAAI;AACH,YAAMC,YAAY,GAAG,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/add-new-template/new-template-part.js"],"names":["NewTemplatePart","postType","history","isModalOpen","setIsModalOpen","createErrorNotice","noticesStore","saveEntityRecord","coreStore","getLastEntitySaveError","createTemplatePart","title","area","type","cleanSlug","replace","templatePart","slug","content","lastEntitySaveError","id","push","postId","error","errorMessage","message","code","labels","add_new"],"mappings":";;;;;;;;;AAQA;;AALA;;AAMA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAnBA;AACA;AACA;;AAGA;AACA;AACA;;AAQA;AACA;AACA;AAIe,SAASA,eAAT,OAAyC;AAAA,MAAf;AAAEC,IAAAA;AAAF,GAAe;AACvD,QAAMC,OAAO,GAAG,yBAAhB;AACA,QAAM,CAAEC,WAAF,EAAeC,cAAf,IAAkC,uBAAU,KAAV,CAAxC;AACA,QAAM;AAAEC,IAAAA;AAAF,MAAwB,uBAAaC,cAAb,CAA9B;AACA,QAAM;AAAEC,I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AAAA,IAAI,EAAE;AAAR,OAAhB,CAAjB;AAEAT,MAAAA,cAAc,CAAE,KAAF,CAAd;AACA;AACD;;AAED,SACC,qDACC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAC,SADT;AAEC,IAAA,OAAO,EAAG,MAAM;AACfA,MAAAA,cAAc,CAAE,IAAF,CAAd;AACA;AAJF,KAMGH,QAAQ,CAAC0B,MAAT,CAAgBC,OANnB,CADD,EASGzB,WAAW,IACZ,4BAAC,gCAAD;AACC,IAAA,UAAU,EAAG,MAAMC,cAAc,CAAE,KAAF,CADlC;AAEC,IAAA,QAAQ,EAAGM;AAFZ,IAVF,CADD;AAkBA","sourcesContent":["/**\n * External dependencies\n */\nimport { kebabCase } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { useHistory } from '../routes';\nimport CreateTemplatePartModal from '../create-template-part-modal';\n\nexport default function NewTemplatePart( { postType } ) {\n\tconst history = useHistory();\n\tconst [ isModalOpen, setIsModalOpen ] = useState( false );\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\tconst { getLastEntitySaveError } = useSelect( coreStore );\n\n\tasync function createTemplatePart( { title, area } ) {\n\t\tif ( ! title ) {\n\t\t\tcreateErrorNotice( __( 'Title is not defined.' ), {\n\t\t\t\ttype: 'snackbar',\n\t\t\t} );\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\t// Currently template parts only allow latin chars.\n\t\t\t// Fallback slug will receive suffix by default.\n\t\t\tconst cleanSlug =\n\t\t\t\tkebabCase( title ).replace( /[^\\w-]+/g, '' ) ||\n\t\t\t\t'wp-custom-part';\n\n\t\t\tconst templatePart = await saveEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t'wp_template_part',\n\t\t\t\t{\n\t\t\t\t\tslug: cleanSlug,\n\t\t\t\t\ttitle,\n\t\t\t\t\tcontent: '',\n\t\t\t\t\tarea,\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tconst lastEntitySaveError = getLastEntitySaveError(\n\t\t\t\t'postType',\n\t\t\t\t'wp_template_part',\n\t\t\t\ttemplatePart.id\n\t\t\t);\n\t\t\tif ( lastEntitySaveError ) {\n\t\t\t\tthrow lastEntitySaveError;\n\t\t\t}\n\n\t\t\tsetIsModalOpen( false );\n\n\t\t\t// Navigate to the created template part editor.\n\t\t\thistory.push( {\n\t\t\t\tpostId: templatePart.id,\n\t\t\t\tpostType: templatePart.type,\n\t\t\t} );\n\n\t\t\t// TODO: Add a success notice?\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: __(\n\t\t\t\t\t\t\t'An error occurred while creating the template part.'\n\t\t\t\t\t );\n\n\t\t\tcreateErrorNotice( errorMessage, { type: 'snackbar' } );\n\n\t\t\tsetIsModalOpen( false );\n\t\t}\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<Button\n\t\t\t\tvariant=\"primary\"\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tsetIsModalOpen( true );\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ postType.labels.add_new }\n\t\t\t</Button>\n\t\t\t{ isModalOpen && (\n\t\t\t\t<CreateTemplatePartModal\n\t\t\t\t\tcloseModal={ () => setIsModalOpen( false ) }\n\t\t\t\t\tonCreate={ createTemplatePart }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"]}
|
|
@@ -120,6 +120,9 @@ function Editor(_ref) {
|
|
|
120
120
|
setPage,
|
|
121
121
|
setIsInserterOpened
|
|
122
122
|
} = (0, _data.useDispatch)(_store.store);
|
|
123
|
+
const {
|
|
124
|
+
enableComplementaryArea
|
|
125
|
+
} = (0, _data.useDispatch)(_interface.store);
|
|
123
126
|
const [isEntitiesSavedStatesOpen, setIsEntitiesSavedStatesOpen] = (0, _element.useState)(false);
|
|
124
127
|
const openEntitiesSavedStates = (0, _element.useCallback)(() => setIsEntitiesSavedStatesOpen(true), []);
|
|
125
128
|
const closeEntitiesSavedStates = (0, _element.useCallback)(() => {
|
|
@@ -142,7 +145,14 @@ function Editor(_ref) {
|
|
|
142
145
|
} else {
|
|
143
146
|
document.body.classList.remove('is-navigation-sidebar-open');
|
|
144
147
|
}
|
|
145
|
-
}, [isNavigationOpen]);
|
|
148
|
+
}, [isNavigationOpen]);
|
|
149
|
+
(0, _element.useEffect)(function openGlobalStylesOnLoad() {
|
|
150
|
+
const searchParams = new URLSearchParams(window.location.search);
|
|
151
|
+
|
|
152
|
+
if (searchParams.get('styles') === 'open') {
|
|
153
|
+
enableComplementaryArea('core/edit-site', 'edit-site/global-styles');
|
|
154
|
+
}
|
|
155
|
+
}, [enableComplementaryArea]); // Don't render the Editor until the settings are set and loaded
|
|
146
156
|
|
|
147
157
|
const isReady = (settings === null || settings === void 0 ? void 0 : settings.siteUrl) && templateType !== undefined && entityId !== undefined;
|
|
148
158
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/editor/index.js"],"names":["interfaceLabels","secondarySidebar","drawer","Editor","onError","isInserterOpen","isListViewOpen","sidebarIsOpened","settings","entityId","templateType","page","template","templateResolved","isNavigationOpen","previousShortcut","nextShortcut","select","isInserterOpened","isListViewOpened","getSettings","getEditedPostType","getEditedPostId","getPage","isNavigationOpened","editSiteStore","hasFinishedResolution","getEntityRecord","coreStore","postType","postId","interfaceStore","getActiveComplementaryArea","name","keyboardShortcutsStore","getAllShortcutKeyCombinations","setPage","setIsInserterOpened","isEntitiesSavedStatesOpen","setIsEntitiesSavedStatesOpen","openEntitiesSavedStates","closeEntitiesSavedStates","blockContext","context","queryContext","newQueryContext","document","body","classList","add","remove","isReady","siteUrl","undefined","previous","next"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAKA;;AACA;;AACA;;AAQA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAzCA;AACA;AACA;;AAuBA;AACA;AACA;AAgBA,MAAMA,eAAe,GAAG;AACvBC,EAAAA,gBAAgB,EAAE,cAAI,eAAJ,CADK;AAEvBC,EAAAA,MAAM,EAAE,cAAI,oBAAJ;AAFe,CAAxB;;AAKA,SAASC,MAAT,OAA+B;AAAA,MAAd;AAAEC,IAAAA;AAAF,GAAc;AAC9B,QAAM;AACLC,IAAAA,cADK;AAELC,IAAAA,cAFK;AAGLC,IAAAA,eAHK;AAILC,IAAAA,QAJK;AAKLC,IAAAA,QALK;AAMLC,IAAAA,YANK;AAOLC,IAAAA,IAPK;AAQLC,IAAAA,QARK;AASLC,IAAAA,gBATK;AAULC,IAAAA,gBAVK;AAWLC,IAAAA,gBAXK;AAYLC,IAAAA;AAZK,MAaF,qBAAaC,MAAF,IAAc;AAC5B,UAAM;AACLC,MAAAA,gBADK;AAELC,MAAAA,gBAFK;AAGLC,MAAAA,WAHK;AAILC,MAAAA,iBAJK;AAKLC,MAAAA,eALK;AAMLC,MAAAA,OANK;AAOLC,MAAAA;AAPK,QAQFP,MAAM,CAAEQ,YAAF,CARV;AASA,UAAM;AAAEC,MAAAA,qBAAF;AAAyBC,MAAAA;AAAzB,QAA6CV,MAAM,CAAEW,eAAF,CAAzD;AACA,UAAMC,QAAQ,GAAGR,iBAAiB,EAAlC;AACA,UAAMS,MAAM,GAAGR,eAAe,EAA9B,CAZ4B,CAc5B;;AACA,WAAO;AACNjB,MAAAA,cAAc,EAAEa,gBAAgB,EAD1B;AAENZ,MAAAA,cAAc,EAAEa,gBAAgB,EAF1B;AAGNZ,MAAAA,eAAe,EAAE,CAAC,CAAEU,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EACtB+B;AAFF,MAxBD,CApBF;AAmDC,IAAA,OAAO,EACN,qDACGF,yBAAyB,GAC1B,4BAAC,2BAAD;AACC,MAAA,KAAK,EACJG;AAFF,MAD0B,GAO1B;AAAK,MAAA,SAAS,EAAC;AAAf,OACC,4BAAC,kBAAD;AACC,MAAA,OAAO,EAAC,WADT;AAEC,MAAA,SAAS,EAAC,4CAFX;AAGC,MAAA,OAAO,EACND,uBAJF;AAMC,uBACC;AAPF,OAUG,cACD,iBADC,CAVH,CADD,CARF,CApDF;AA+EC,IAAA,MAAM,EAAG,4BAAC,4BAAD,OA/EV;AAgFC,IAAA,SAAS,EAAG;AACXc,MAAAA,QAAQ,EAAEvC,gBADC;AAEXwC,MAAAA,IAAI,EAAEvC;AAFK;AAhFb,IAHD,EAwFC,4BAAC,qBAAD,OAxFD,EAyFC,4BAAC,mBAAD,CAAS,IAAT,OAzFD,EA0FC,4BAAC,mBAAD,OA1FD,CAFD,CADD,CALD,CADD,CADD,CAHF,CADD;AAkHA;;eACcb,M","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useState, useMemo, useCallback } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Popover, Button, Notice } from '@wordpress/components';\nimport { EntityProvider, store as coreStore } from '@wordpress/core-data';\nimport { BlockContextProvider, BlockBreadcrumb } from '@wordpress/block-editor';\nimport {\n\tInterfaceSkeleton,\n\tComplementaryArea,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport {\n\tEditorNotices,\n\tEditorSnackbars,\n\tEntitiesSavedStates,\n} from '@wordpress/editor';\nimport { __ } from '@wordpress/i18n';\nimport { PluginArea } from '@wordpress/plugins';\nimport {\n\tShortcutProvider,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\n\n/**\n * Internal dependencies\n */\nimport Header from '../header';\nimport { SidebarComplementaryAreaFills } from '../sidebar';\nimport NavigationSidebar from '../navigation-sidebar';\nimport BlockEditor from '../block-editor';\nimport KeyboardShortcuts from '../keyboard-shortcuts';\nimport URLQueryController from '../url-query-controller';\nimport InserterSidebar from '../secondary-sidebar/inserter-sidebar';\nimport ListViewSidebar from '../secondary-sidebar/list-view-sidebar';\nimport ErrorBoundary from '../error-boundary';\nimport WelcomeGuide from '../welcome-guide';\nimport { store as editSiteStore } from '../../store';\nimport { GlobalStylesRenderer } from './global-styles-renderer';\nimport { GlobalStylesProvider } from '../global-styles/global-styles-provider';\nimport useTitle from '../routes/use-title';\n\nconst interfaceLabels = {\n\tsecondarySidebar: __( 'Block Library' ),\n\tdrawer: __( 'Navigation Sidebar' ),\n};\n\nfunction Editor( { onError } ) {\n\tconst {\n\t\tisInserterOpen,\n\t\tisListViewOpen,\n\t\tsidebarIsOpened,\n\t\tsettings,\n\t\tentityId,\n\t\ttemplateType,\n\t\tpage,\n\t\ttemplate,\n\t\ttemplateResolved,\n\t\tisNavigationOpen,\n\t\tpreviousShortcut,\n\t\tnextShortcut,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tisInserterOpened,\n\t\t\tisListViewOpened,\n\t\t\tgetSettings,\n\t\t\tgetEditedPostType,\n\t\t\tgetEditedPostId,\n\t\t\tgetPage,\n\t\t\tisNavigationOpened,\n\t\t} = select( editSiteStore );\n\t\tconst { hasFinishedResolution, getEntityRecord } = select( coreStore );\n\t\tconst postType = getEditedPostType();\n\t\tconst postId = getEditedPostId();\n\n\t\t// The currently selected entity to display. Typically template or template part.\n\t\treturn {\n\t\t\tisInserterOpen: isInserterOpened(),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tsidebarIsOpened: !! select(\n\t\t\t\tinterfaceStore\n\t\t\t).getActiveComplementaryArea( editSiteStore.name ),\n\t\t\tsettings: getSettings(),\n\t\t\ttemplateType: postType,\n\t\t\tpage: getPage(),\n\t\t\ttemplate: postId\n\t\t\t\t? getEntityRecord( 'postType', postType, postId )\n\t\t\t\t: null,\n\t\t\ttemplateResolved: postId\n\t\t\t\t? hasFinishedResolution( 'getEntityRecord', [\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\tpostType,\n\t\t\t\t\t\tpostId,\n\t\t\t\t ] )\n\t\t\t\t: false,\n\t\t\tentityId: postId,\n\t\t\tisNavigationOpen: isNavigationOpened(),\n\t\t\tpreviousShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/edit-site/previous-region' ),\n\t\t\tnextShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/edit-site/next-region' ),\n\t\t};\n\t}, [] );\n\tconst { setPage, setIsInserterOpened } = useDispatch( editSiteStore );\n\n\tconst [\n\t\tisEntitiesSavedStatesOpen,\n\t\tsetIsEntitiesSavedStatesOpen,\n\t] = useState( false );\n\tconst openEntitiesSavedStates = useCallback(\n\t\t() => setIsEntitiesSavedStatesOpen( true ),\n\t\t[]\n\t);\n\tconst closeEntitiesSavedStates = useCallback( () => {\n\t\tsetIsEntitiesSavedStatesOpen( false );\n\t}, [] );\n\n\tconst blockContext = useMemo(\n\t\t() => ( {\n\t\t\t...page?.context,\n\t\t\tqueryContext: [\n\t\t\t\tpage?.context.queryContext || { page: 1 },\n\t\t\t\t( newQueryContext ) =>\n\t\t\t\t\tsetPage( {\n\t\t\t\t\t\t...page,\n\t\t\t\t\t\tcontext: {\n\t\t\t\t\t\t\t...page?.context,\n\t\t\t\t\t\t\tqueryContext: {\n\t\t\t\t\t\t\t\t...page?.context.queryContext,\n\t\t\t\t\t\t\t\t...newQueryContext,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t} ),\n\t\t\t],\n\t\t} ),\n\t\t[ page?.context ]\n\t);\n\n\tuseEffect( () => {\n\t\tif ( isNavigationOpen ) {\n\t\t\tdocument.body.classList.add( 'is-navigation-sidebar-open' );\n\t\t} else {\n\t\t\tdocument.body.classList.remove( 'is-navigation-sidebar-open' );\n\t\t}\n\t}, [ isNavigationOpen ] );\n\n\t// Don't render the Editor until the settings are set and loaded\n\tconst isReady =\n\t\tsettings?.siteUrl &&\n\t\ttemplateType !== undefined &&\n\t\tentityId !== undefined;\n\n\tconst secondarySidebar = () => {\n\t\tif ( isInserterOpen ) {\n\t\t\treturn <InserterSidebar />;\n\t\t}\n\t\tif ( isListViewOpen ) {\n\t\t\treturn <ListViewSidebar />;\n\t\t}\n\t\treturn null;\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( isReady && __( 'Editor (beta)' ) );\n\n\treturn (\n\t\t<>\n\t\t\t<URLQueryController />\n\t\t\t{ isReady && (\n\t\t\t\t<ShortcutProvider>\n\t\t\t\t\t<EntityProvider kind=\"root\" type=\"site\">\n\t\t\t\t\t\t<EntityProvider\n\t\t\t\t\t\t\tkind=\"postType\"\n\t\t\t\t\t\t\ttype={ templateType }\n\t\t\t\t\t\t\tid={ entityId }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<GlobalStylesProvider>\n\t\t\t\t\t\t\t\t<BlockContextProvider value={ blockContext }>\n\t\t\t\t\t\t\t\t\t<GlobalStylesRenderer />\n\t\t\t\t\t\t\t\t\t<ErrorBoundary onError={ onError }>\n\t\t\t\t\t\t\t\t\t\t<KeyboardShortcuts.Register />\n\t\t\t\t\t\t\t\t\t\t<SidebarComplementaryAreaFills />\n\t\t\t\t\t\t\t\t\t\t<InterfaceSkeleton\n\t\t\t\t\t\t\t\t\t\t\tlabels={ interfaceLabels }\n\t\t\t\t\t\t\t\t\t\t\tsecondarySidebar={ secondarySidebar() }\n\t\t\t\t\t\t\t\t\t\t\tsidebar={\n\t\t\t\t\t\t\t\t\t\t\t\tsidebarIsOpened && (\n\t\t\t\t\t\t\t\t\t\t\t\t\t<ComplementaryArea.Slot scope=\"core/edit-site\" />\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tdrawer={\n\t\t\t\t\t\t\t\t\t\t\t\t<NavigationSidebar.Slot />\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\theader={\n\t\t\t\t\t\t\t\t\t\t\t\t<Header\n\t\t\t\t\t\t\t\t\t\t\t\t\topenEntitiesSavedStates={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\topenEntitiesSavedStates\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tnotices={ <EditorSnackbars /> }\n\t\t\t\t\t\t\t\t\t\t\tcontent={\n\t\t\t\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<EditorNotices />\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ template && (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<BlockEditor\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetIsInserterOpen={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetIsInserterOpened\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ templateResolved &&\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t! template &&\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsettings?.siteUrl &&\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tentityId && (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Notice\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstatus=\"warning\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tisDismissible={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\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\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</Notice>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t\t<KeyboardShortcuts\n\t\t\t\t\t\t\t\t\t\t\t\t\t\topenEntitiesSavedStates={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\topenEntitiesSavedStates\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tactions={\n\t\t\t\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ isEntitiesSavedStatesOpen ? (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<EntitiesSavedStates\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tclose={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcloseEntitiesSavedStates\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div className=\"edit-site-editor__toggle-save-panel\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"edit-site-editor__toggle-save-panel-button\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\topenEntitiesSavedStates\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\taria-expanded={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'Open save panel'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tfooter={ <BlockBreadcrumb /> }\n\t\t\t\t\t\t\t\t\t\t\tshortcuts={ {\n\t\t\t\t\t\t\t\t\t\t\t\tprevious: previousShortcut,\n\t\t\t\t\t\t\t\t\t\t\t\tnext: nextShortcut,\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\t<WelcomeGuide />\n\t\t\t\t\t\t\t\t\t\t<Popover.Slot />\n\t\t\t\t\t\t\t\t\t\t<PluginArea />\n\t\t\t\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t\t\t\t</BlockContextProvider>\n\t\t\t\t\t\t\t</GlobalStylesProvider>\n\t\t\t\t\t\t</EntityProvider>\n\t\t\t\t\t</EntityProvider>\n\t\t\t\t</ShortcutProvider>\n\t\t\t) }\n\t\t</>\n\t);\n}\nexport default Editor;\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/editor/index.js"],"names":["interfaceLabels","secondarySidebar","drawer","Editor","onError","isInserterOpen","isListViewOpen","sidebarIsOpened","settings","entityId","templateType","page","template","templateResolved","isNavigationOpen","previousShortcut","nextShortcut","select","isInserterOpened","isListViewOpened","getSettings","getEditedPostType","getEditedPostId","getPage","isNavigationOpened","editSiteStore","hasFinishedResolution","getEntityRecord","coreStore","postType","postId","interfaceStore","getActiveComplementaryArea","name","keyboardShortcutsStore","getAllShortcutKeyCombinations","setPage","setIsInserterOpened","enableComplementaryArea","isEntitiesSavedStatesOpen","setIsEntitiesSavedStatesOpen","openEntitiesSavedStates","closeEntitiesSavedStates","blockContext","context","queryContext","newQueryContext","document","body","classList","add","remove","openGlobalStylesOnLoad","searchParams","URLSearchParams","window","location","search","get","isReady","siteUrl","undefined","previous","next"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAKA;;AACA;;AACA;;AAQA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAzCA;AACA;AACA;;AAuBA;AACA;AACA;AAgBA,MAAMA,eAAe,GAAG;AACvBC,EAAAA,gBAAgB,EAAE,cAAI,eAAJ,CADK;AAEvBC,EAAAA,MAAM,EAAE,cAAI,oBAAJ;AAFe,CAAxB;;AAKA,SAASC,MAAT,OAA+B;AAAA,MAAd;AAAEC,IAAAA;AAAF,GAAc;AAC9B,QAAM;AACLC,IAAAA,cADK;AAELC,IAAAA,cAFK;AAGLC,IAAAA,eAHK;AAILC,IAAAA,QAJK;AAKLC,IAAAA,QALK;AAMLC,IAAAA,YANK;AAOLC,IAAAA,IAPK;AAQLC,IAAAA,QARK;AASLC,IAAAA,gBATK;AAULC,IAAAA,gBAVK;AAWLC,IAAAA,gBAXK;AAYLC,IAAAA;AAZK,MAaF,qBAAaC,MAAF,IAAc;AAC5B,UAAM;AACLC,MAAAA,gBADK;AAELC,MAAAA,gBAFK;AAGLC,MAA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C;AAEXgD,MAAAA,IAAI,EAAE/C;AAFK;AAhFb,IAHD,EAwFC,4BAAC,qBAAD,OAxFD,EAyFC,4BAAC,mBAAD,CAAS,IAAT,OAzFD,EA0FC,4BAAC,mBAAD,OA1FD,CAFD,CADD,CALD,CADD,CADD,CAHF,CADD;AAkHA;;eACcb,M","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useState, useMemo, useCallback } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Popover, Button, Notice } from '@wordpress/components';\nimport { EntityProvider, store as coreStore } from '@wordpress/core-data';\nimport { BlockContextProvider, BlockBreadcrumb } from '@wordpress/block-editor';\nimport {\n\tInterfaceSkeleton,\n\tComplementaryArea,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport {\n\tEditorNotices,\n\tEditorSnackbars,\n\tEntitiesSavedStates,\n} from '@wordpress/editor';\nimport { __ } from '@wordpress/i18n';\nimport { PluginArea } from '@wordpress/plugins';\nimport {\n\tShortcutProvider,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\n\n/**\n * Internal dependencies\n */\nimport Header from '../header';\nimport { SidebarComplementaryAreaFills } from '../sidebar';\nimport NavigationSidebar from '../navigation-sidebar';\nimport BlockEditor from '../block-editor';\nimport KeyboardShortcuts from '../keyboard-shortcuts';\nimport URLQueryController from '../url-query-controller';\nimport InserterSidebar from '../secondary-sidebar/inserter-sidebar';\nimport ListViewSidebar from '../secondary-sidebar/list-view-sidebar';\nimport ErrorBoundary from '../error-boundary';\nimport WelcomeGuide from '../welcome-guide';\nimport { store as editSiteStore } from '../../store';\nimport { GlobalStylesRenderer } from './global-styles-renderer';\nimport { GlobalStylesProvider } from '../global-styles/global-styles-provider';\nimport useTitle from '../routes/use-title';\n\nconst interfaceLabels = {\n\tsecondarySidebar: __( 'Block Library' ),\n\tdrawer: __( 'Navigation Sidebar' ),\n};\n\nfunction Editor( { onError } ) {\n\tconst {\n\t\tisInserterOpen,\n\t\tisListViewOpen,\n\t\tsidebarIsOpened,\n\t\tsettings,\n\t\tentityId,\n\t\ttemplateType,\n\t\tpage,\n\t\ttemplate,\n\t\ttemplateResolved,\n\t\tisNavigationOpen,\n\t\tpreviousShortcut,\n\t\tnextShortcut,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tisInserterOpened,\n\t\t\tisListViewOpened,\n\t\t\tgetSettings,\n\t\t\tgetEditedPostType,\n\t\t\tgetEditedPostId,\n\t\t\tgetPage,\n\t\t\tisNavigationOpened,\n\t\t} = select( editSiteStore );\n\t\tconst { hasFinishedResolution, getEntityRecord } = select( coreStore );\n\t\tconst postType = getEditedPostType();\n\t\tconst postId = getEditedPostId();\n\n\t\t// The currently selected entity to display. Typically template or template part.\n\t\treturn {\n\t\t\tisInserterOpen: isInserterOpened(),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tsidebarIsOpened: !! select(\n\t\t\t\tinterfaceStore\n\t\t\t).getActiveComplementaryArea( editSiteStore.name ),\n\t\t\tsettings: getSettings(),\n\t\t\ttemplateType: postType,\n\t\t\tpage: getPage(),\n\t\t\ttemplate: postId\n\t\t\t\t? getEntityRecord( 'postType', postType, postId )\n\t\t\t\t: null,\n\t\t\ttemplateResolved: postId\n\t\t\t\t? hasFinishedResolution( 'getEntityRecord', [\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\tpostType,\n\t\t\t\t\t\tpostId,\n\t\t\t\t ] )\n\t\t\t\t: false,\n\t\t\tentityId: postId,\n\t\t\tisNavigationOpen: isNavigationOpened(),\n\t\t\tpreviousShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/edit-site/previous-region' ),\n\t\t\tnextShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/edit-site/next-region' ),\n\t\t};\n\t}, [] );\n\tconst { setPage, setIsInserterOpened } = useDispatch( editSiteStore );\n\tconst { enableComplementaryArea } = useDispatch( interfaceStore );\n\n\tconst [\n\t\tisEntitiesSavedStatesOpen,\n\t\tsetIsEntitiesSavedStatesOpen,\n\t] = useState( false );\n\tconst openEntitiesSavedStates = useCallback(\n\t\t() => setIsEntitiesSavedStatesOpen( true ),\n\t\t[]\n\t);\n\tconst closeEntitiesSavedStates = useCallback( () => {\n\t\tsetIsEntitiesSavedStatesOpen( false );\n\t}, [] );\n\n\tconst blockContext = useMemo(\n\t\t() => ( {\n\t\t\t...page?.context,\n\t\t\tqueryContext: [\n\t\t\t\tpage?.context.queryContext || { page: 1 },\n\t\t\t\t( newQueryContext ) =>\n\t\t\t\t\tsetPage( {\n\t\t\t\t\t\t...page,\n\t\t\t\t\t\tcontext: {\n\t\t\t\t\t\t\t...page?.context,\n\t\t\t\t\t\t\tqueryContext: {\n\t\t\t\t\t\t\t\t...page?.context.queryContext,\n\t\t\t\t\t\t\t\t...newQueryContext,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t} ),\n\t\t\t],\n\t\t} ),\n\t\t[ page?.context ]\n\t);\n\n\tuseEffect( () => {\n\t\tif ( isNavigationOpen ) {\n\t\t\tdocument.body.classList.add( 'is-navigation-sidebar-open' );\n\t\t} else {\n\t\t\tdocument.body.classList.remove( 'is-navigation-sidebar-open' );\n\t\t}\n\t}, [ isNavigationOpen ] );\n\n\tuseEffect(\n\t\tfunction openGlobalStylesOnLoad() {\n\t\t\tconst searchParams = new URLSearchParams( window.location.search );\n\t\t\tif ( searchParams.get( 'styles' ) === 'open' ) {\n\t\t\t\tenableComplementaryArea(\n\t\t\t\t\t'core/edit-site',\n\t\t\t\t\t'edit-site/global-styles'\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\t[ enableComplementaryArea ]\n\t);\n\n\t// Don't render the Editor until the settings are set and loaded\n\tconst isReady =\n\t\tsettings?.siteUrl &&\n\t\ttemplateType !== undefined &&\n\t\tentityId !== undefined;\n\n\tconst secondarySidebar = () => {\n\t\tif ( isInserterOpen ) {\n\t\t\treturn <InserterSidebar />;\n\t\t}\n\t\tif ( isListViewOpen ) {\n\t\t\treturn <ListViewSidebar />;\n\t\t}\n\t\treturn null;\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( isReady && __( 'Editor (beta)' ) );\n\n\treturn (\n\t\t<>\n\t\t\t<URLQueryController />\n\t\t\t{ isReady && (\n\t\t\t\t<ShortcutProvider>\n\t\t\t\t\t<EntityProvider kind=\"root\" type=\"site\">\n\t\t\t\t\t\t<EntityProvider\n\t\t\t\t\t\t\tkind=\"postType\"\n\t\t\t\t\t\t\ttype={ templateType }\n\t\t\t\t\t\t\tid={ entityId }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<GlobalStylesProvider>\n\t\t\t\t\t\t\t\t<BlockContextProvider value={ blockContext }>\n\t\t\t\t\t\t\t\t\t<GlobalStylesRenderer />\n\t\t\t\t\t\t\t\t\t<ErrorBoundary onError={ onError }>\n\t\t\t\t\t\t\t\t\t\t<KeyboardShortcuts.Register />\n\t\t\t\t\t\t\t\t\t\t<SidebarComplementaryAreaFills />\n\t\t\t\t\t\t\t\t\t\t<InterfaceSkeleton\n\t\t\t\t\t\t\t\t\t\t\tlabels={ interfaceLabels }\n\t\t\t\t\t\t\t\t\t\t\tsecondarySidebar={ secondarySidebar() }\n\t\t\t\t\t\t\t\t\t\t\tsidebar={\n\t\t\t\t\t\t\t\t\t\t\t\tsidebarIsOpened && (\n\t\t\t\t\t\t\t\t\t\t\t\t\t<ComplementaryArea.Slot scope=\"core/edit-site\" />\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tdrawer={\n\t\t\t\t\t\t\t\t\t\t\t\t<NavigationSidebar.Slot />\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\theader={\n\t\t\t\t\t\t\t\t\t\t\t\t<Header\n\t\t\t\t\t\t\t\t\t\t\t\t\topenEntitiesSavedStates={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\topenEntitiesSavedStates\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tnotices={ <EditorSnackbars /> }\n\t\t\t\t\t\t\t\t\t\t\tcontent={\n\t\t\t\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<EditorNotices />\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ template && (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<BlockEditor\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetIsInserterOpen={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetIsInserterOpened\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ templateResolved &&\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t! template &&\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsettings?.siteUrl &&\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tentityId && (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Notice\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstatus=\"warning\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tisDismissible={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\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\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</Notice>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t\t<KeyboardShortcuts\n\t\t\t\t\t\t\t\t\t\t\t\t\t\topenEntitiesSavedStates={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\topenEntitiesSavedStates\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tactions={\n\t\t\t\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ isEntitiesSavedStatesOpen ? (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<EntitiesSavedStates\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tclose={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcloseEntitiesSavedStates\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div className=\"edit-site-editor__toggle-save-panel\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"edit-site-editor__toggle-save-panel-button\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\topenEntitiesSavedStates\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\taria-expanded={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'Open save panel'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tfooter={ <BlockBreadcrumb /> }\n\t\t\t\t\t\t\t\t\t\t\tshortcuts={ {\n\t\t\t\t\t\t\t\t\t\t\t\tprevious: previousShortcut,\n\t\t\t\t\t\t\t\t\t\t\t\tnext: nextShortcut,\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\t<WelcomeGuide />\n\t\t\t\t\t\t\t\t\t\t<Popover.Slot />\n\t\t\t\t\t\t\t\t\t\t<PluginArea />\n\t\t\t\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t\t\t\t</BlockContextProvider>\n\t\t\t\t\t\t\t</GlobalStylesProvider>\n\t\t\t\t\t\t</EntityProvider>\n\t\t\t\t\t</EntityProvider>\n\t\t\t\t</ShortcutProvider>\n\t\t\t) }\n\t\t</>\n\t);\n}\nexport default Editor;\n"]}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
@@ -9,27 +11,15 @@ var _element = require("@wordpress/element");
|
|
|
9
11
|
|
|
10
12
|
var _i18n = require("@wordpress/i18n");
|
|
11
13
|
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
var _blockEditor = require("@wordpress/block-editor");
|
|
15
|
-
|
|
16
|
-
var _compose = require("@wordpress/compose");
|
|
14
|
+
var _warning = _interopRequireDefault(require("./warning"));
|
|
17
15
|
|
|
18
16
|
/**
|
|
19
17
|
* WordPress dependencies
|
|
20
18
|
*/
|
|
21
|
-
function CopyButton(_ref) {
|
|
22
|
-
let {
|
|
23
|
-
text,
|
|
24
|
-
children
|
|
25
|
-
} = _ref;
|
|
26
|
-
const ref = (0, _compose.useCopyToClipboard)(text);
|
|
27
|
-
return (0, _element.createElement)(_components.Button, {
|
|
28
|
-
variant: "secondary",
|
|
29
|
-
ref: ref
|
|
30
|
-
}, children);
|
|
31
|
-
}
|
|
32
19
|
|
|
20
|
+
/**
|
|
21
|
+
* Internal dependencies
|
|
22
|
+
*/
|
|
33
23
|
class ErrorBoundary extends _element.Component {
|
|
34
24
|
constructor() {
|
|
35
25
|
super(...arguments);
|
|
@@ -58,17 +48,11 @@ class ErrorBoundary extends _element.Component {
|
|
|
58
48
|
return this.props.children;
|
|
59
49
|
}
|
|
60
50
|
|
|
61
|
-
return (0, _element.createElement)(
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
variant: "secondary"
|
|
67
|
-
}, (0, _i18n.__)('Attempt Recovery')), (0, _element.createElement)(CopyButton, {
|
|
68
|
-
key: "copy-error",
|
|
69
|
-
text: error.stack
|
|
70
|
-
}, (0, _i18n.__)('Copy Error'))]
|
|
71
|
-
}, (0, _i18n.__)('The editor has encountered an unexpected error.'));
|
|
51
|
+
return (0, _element.createElement)(_warning.default, {
|
|
52
|
+
message: (0, _i18n.__)('The editor has encountered an unexpected error.'),
|
|
53
|
+
error: error,
|
|
54
|
+
reboot: this.reboot
|
|
55
|
+
});
|
|
72
56
|
}
|
|
73
57
|
|
|
74
58
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/error-boundary/index.js"],"names":["
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/error-boundary/index.js"],"names":["ErrorBoundary","Component","constructor","arguments","reboot","bind","state","error","getDerivedStateFromError","props","onError","render","children"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AATA;AACA;AACA;;AAIA;AACA;AACA;AAGe,MAAMA,aAAN,SAA4BC,kBAA5B,CAAsC;AACpDC,EAAAA,WAAW,GAAG;AACb,UAAO,GAAGC,SAAV;AAEA,SAAKC,MAAL,GAAc,KAAKA,MAAL,CAAYC,IAAZ,CAAkB,IAAlB,CAAd;AAEA,SAAKC,KAAL,GAAa;AACZC,MAAAA,KAAK,EAAE;AADK,KAAb;AAGA;;AAE8B,SAAxBC,wBAAwB,CAAED,KAAF,EAAU;AACxC,WAAO;AAAEA,MAAAA;AAAF,KAAP;AACA;;AAEDH,EAAAA,MAAM,GAAG;AACR,SAAKK,KAAL,CAAWC,OAAX;AACA;;AAEDC,EAAAA,MAAM,GAAG;AACR,UAAM;AAAEJ,MAAAA;AAAF,QAAY,KAAKD,KAAvB;;AACA,QAAK,CAAEC,KAAP,EAAe;AACd,aAAO,KAAKE,KAAL,CAAWG,QAAlB;AACA;;AAED,WACC,4BAAC,gBAAD;AACC,MAAA,OAAO,EAAG,cACT,iDADS,CADX;AAIC,MAAA,KAAK,EAAGL,KAJT;AAKC,MAAA,MAAM,EAAG,KAAKH;AALf,MADD;AASA;;AAlCmD","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport ErrorBoundaryWarning from './warning';\n\nexport default class ErrorBoundary extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.reboot = this.reboot.bind( this );\n\n\t\tthis.state = {\n\t\t\terror: null,\n\t\t};\n\t}\n\n\tstatic getDerivedStateFromError( error ) {\n\t\treturn { error };\n\t}\n\n\treboot() {\n\t\tthis.props.onError();\n\t}\n\n\trender() {\n\t\tconst { error } = this.state;\n\t\tif ( ! error ) {\n\t\t\treturn this.props.children;\n\t\t}\n\n\t\treturn (\n\t\t\t<ErrorBoundaryWarning\n\t\t\t\tmessage={ __(\n\t\t\t\t\t'The editor has encountered an unexpected error.'\n\t\t\t\t) }\n\t\t\t\terror={ error }\n\t\t\t\treboot={ this.reboot }\n\t\t\t/>\n\t\t);\n\t}\n}\n"]}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = ErrorBoundaryWarning;
|
|
7
|
+
|
|
8
|
+
var _element = require("@wordpress/element");
|
|
9
|
+
|
|
10
|
+
var _i18n = require("@wordpress/i18n");
|
|
11
|
+
|
|
12
|
+
var _components = require("@wordpress/components");
|
|
13
|
+
|
|
14
|
+
var _blockEditor = require("@wordpress/block-editor");
|
|
15
|
+
|
|
16
|
+
var _compose = require("@wordpress/compose");
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* WordPress dependencies
|
|
20
|
+
*/
|
|
21
|
+
function CopyButton(_ref) {
|
|
22
|
+
let {
|
|
23
|
+
text,
|
|
24
|
+
children
|
|
25
|
+
} = _ref;
|
|
26
|
+
const ref = (0, _compose.useCopyToClipboard)(text);
|
|
27
|
+
return (0, _element.createElement)(_components.Button, {
|
|
28
|
+
variant: "secondary",
|
|
29
|
+
ref: ref
|
|
30
|
+
}, children);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function ErrorBoundaryWarning(_ref2) {
|
|
34
|
+
let {
|
|
35
|
+
message,
|
|
36
|
+
error,
|
|
37
|
+
reboot,
|
|
38
|
+
dashboardLink
|
|
39
|
+
} = _ref2;
|
|
40
|
+
const actions = [];
|
|
41
|
+
|
|
42
|
+
if (reboot) {
|
|
43
|
+
actions.push((0, _element.createElement)(_components.Button, {
|
|
44
|
+
key: "recovery",
|
|
45
|
+
onClick: reboot,
|
|
46
|
+
variant: "secondary"
|
|
47
|
+
}, (0, _i18n.__)('Attempt Recovery')));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (error) {
|
|
51
|
+
actions.push((0, _element.createElement)(CopyButton, {
|
|
52
|
+
key: "copy-error",
|
|
53
|
+
text: error.stack
|
|
54
|
+
}, (0, _i18n.__)('Copy Error')));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (dashboardLink) {
|
|
58
|
+
actions.push((0, _element.createElement)(_components.Button, {
|
|
59
|
+
key: "back-to-dashboard",
|
|
60
|
+
variant: "secondary",
|
|
61
|
+
href: dashboardLink
|
|
62
|
+
}, (0, _i18n.__)('Back to dashboard')));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return (0, _element.createElement)(_blockEditor.Warning, {
|
|
66
|
+
className: "editor-error-boundary",
|
|
67
|
+
actions: actions
|
|
68
|
+
}, message);
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=warning.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/error-boundary/warning.js"],"names":["CopyButton","text","children","ref","ErrorBoundaryWarning","message","error","reboot","dashboardLink","actions","push","stack"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AANA;AACA;AACA;AAMA,SAASA,UAAT,OAA0C;AAAA,MAArB;AAAEC,IAAAA,IAAF;AAAQC,IAAAA;AAAR,GAAqB;AACzC,QAAMC,GAAG,GAAG,iCAAoBF,IAApB,CAAZ;AACA,SACC,4BAAC,kBAAD;AAAQ,IAAA,OAAO,EAAC,WAAhB;AAA4B,IAAA,GAAG,EAAGE;AAAlC,KACGD,QADH,CADD;AAKA;;AAEc,SAASE,oBAAT,QAKX;AAAA,MAL0C;AAC7CC,IAAAA,OAD6C;AAE7CC,IAAAA,KAF6C;AAG7CC,IAAAA,MAH6C;AAI7CC,IAAAA;AAJ6C,GAK1C;AACH,QAAMC,OAAO,GAAG,EAAhB;;AAEA,MAAKF,MAAL,EAAc;AACbE,IAAAA,OAAO,CAACC,IAAR,CACC,4BAAC,kBAAD;AAAQ,MAAA,GAAG,EAAC,UAAZ;AAAuB,MAAA,OAAO,EAAGH,MAAjC;AAA0C,MAAA,OAAO,EAAC;AAAlD,OACG,cAAI,kBAAJ,CADH,CADD;AAKA;;AAED,MAAKD,KAAL,EAAa;AACZG,IAAAA,OAAO,CAACC,IAAR,CACC,4BAAC,UAAD;AAAY,MAAA,GAAG,EAAC,YAAhB;AAA6B,MAAA,IAAI,EAAGJ,KAAK,CAACK;AAA1C,OACG,cAAI,YAAJ,CADH,CADD;AAKA;;AAED,MAAKH,aAAL,EAAqB;AACpBC,IAAAA,OAAO,CAACC,IAAR,CACC,4BAAC,kBAAD;AACC,MAAA,GAAG,EAAC,mBADL;AAEC,MAAA,OAAO,EAAC,WAFT;AAGC,MAAA,IAAI,EAAGF;AAHR,OAKG,cAAI,mBAAJ,CALH,CADD;AASA;;AAED,SACC,4BAAC,oBAAD;AAAS,IAAA,SAAS,EAAC,uBAAnB;AAA2C,IAAA,OAAO,EAAGC;AAArD,KACGJ,OADH,CADD;AAKA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { Warning } from '@wordpress/block-editor';\nimport { useCopyToClipboard } from '@wordpress/compose';\n\nfunction CopyButton( { text, children } ) {\n\tconst ref = useCopyToClipboard( text );\n\treturn (\n\t\t<Button variant=\"secondary\" ref={ ref }>\n\t\t\t{ children }\n\t\t</Button>\n\t);\n}\n\nexport default function ErrorBoundaryWarning( {\n\tmessage,\n\terror,\n\treboot,\n\tdashboardLink,\n} ) {\n\tconst actions = [];\n\n\tif ( reboot ) {\n\t\tactions.push(\n\t\t\t<Button key=\"recovery\" onClick={ reboot } variant=\"secondary\">\n\t\t\t\t{ __( 'Attempt Recovery' ) }\n\t\t\t</Button>\n\t\t);\n\t}\n\n\tif ( error ) {\n\t\tactions.push(\n\t\t\t<CopyButton key=\"copy-error\" text={ error.stack }>\n\t\t\t\t{ __( 'Copy Error' ) }\n\t\t\t</CopyButton>\n\t\t);\n\t}\n\n\tif ( dashboardLink ) {\n\t\tactions.push(\n\t\t\t<Button\n\t\t\t\tkey=\"back-to-dashboard\"\n\t\t\t\tvariant=\"secondary\"\n\t\t\t\thref={ dashboardLink }\n\t\t\t>\n\t\t\t\t{ __( 'Back to dashboard' ) }\n\t\t\t</Button>\n\t\t);\n\t}\n\n\treturn (\n\t\t<Warning className=\"editor-error-boundary\" actions={ actions }>\n\t\t\t{ message }\n\t\t</Warning>\n\t);\n}\n"]}
|
|
@@ -9,6 +9,8 @@ exports.default = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _element = require("@wordpress/element");
|
|
11
11
|
|
|
12
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
+
|
|
12
14
|
var _i18n = require("@wordpress/i18n");
|
|
13
15
|
|
|
14
16
|
var _blockEditor = require("@wordpress/block-editor");
|
|
@@ -48,7 +50,6 @@ function ScreenBackgroundColor(_ref) {
|
|
|
48
50
|
return null;
|
|
49
51
|
}
|
|
50
52
|
|
|
51
|
-
const settings = [];
|
|
52
53
|
let backgroundSettings = {};
|
|
53
54
|
|
|
54
55
|
if (hasBackgroundColor) {
|
|
@@ -75,17 +76,15 @@ function ScreenBackgroundColor(_ref) {
|
|
|
75
76
|
}
|
|
76
77
|
}
|
|
77
78
|
|
|
78
|
-
|
|
79
|
-
...gradientSettings
|
|
80
|
-
|
|
81
|
-
});
|
|
79
|
+
const controlProps = { ...backgroundSettings,
|
|
80
|
+
...gradientSettings
|
|
81
|
+
};
|
|
82
82
|
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_header.default, {
|
|
83
83
|
back: parentMenu + '/colors',
|
|
84
84
|
title: (0, _i18n.__)('Background'),
|
|
85
85
|
description: (0, _i18n.__)('Set a background color or gradient for the whole website.')
|
|
86
|
-
}), (0, _element.createElement)(_blockEditor.
|
|
87
|
-
|
|
88
|
-
settings: settings,
|
|
86
|
+
}), (0, _element.createElement)(_blockEditor.__experimentalColorGradientControl, (0, _extends2.default)({
|
|
87
|
+
className: "edit-site-screen-background-color__control",
|
|
89
88
|
colors: colorsPerOrigin,
|
|
90
89
|
gradients: gradientsPerOrigin,
|
|
91
90
|
disableCustomColors: !areCustomSolidsEnabled,
|
|
@@ -94,7 +93,7 @@ function ScreenBackgroundColor(_ref) {
|
|
|
94
93
|
showTitle: false,
|
|
95
94
|
enableAlpha: true,
|
|
96
95
|
__experimentalIsRenderedInSidebar: true
|
|
97
|
-
}));
|
|
96
|
+
}, controlProps)));
|
|
98
97
|
}
|
|
99
98
|
|
|
100
99
|
var _default = ScreenBackgroundColor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-background-color.js"],"names":["ScreenBackgroundColor","name","parentMenu","undefined","supports","solids","gradients","areCustomSolidsEnabled","areCustomGradientsEnabled","colorsPerOrigin","gradientsPerOrigin","isBackgroundEnabled","hasBackgroundColor","includes","length","hasGradientColor","backgroundColor","setBackgroundColor","userBackgroundColor","gradient","setGradient","userGradient","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-background-color.js"],"names":["ScreenBackgroundColor","name","parentMenu","undefined","supports","solids","gradients","areCustomSolidsEnabled","areCustomGradientsEnabled","colorsPerOrigin","gradientsPerOrigin","isBackgroundEnabled","hasBackgroundColor","includes","length","hasGradientColor","backgroundColor","setBackgroundColor","userBackgroundColor","gradient","setGradient","userGradient","backgroundSettings","colorValue","onColorChange","clearable","gradientSettings","gradientValue","onGradientChange","controlProps"],"mappings":";;;;;;;;;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AA,iCAAiC;AATlC,KAUMqB,YAVN,EARD,CADD;AAuBA;;eAEc7B,qB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { __experimentalColorGradientControl as ColorGradientControl } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport ScreenHeader from './header';\nimport {\n\tgetSupportedGlobalStylesPanels,\n\tuseColorsPerOrigin,\n\tuseGradientsPerOrigin,\n\tuseSetting,\n\tuseStyle,\n} from './hooks';\n\nfunction ScreenBackgroundColor( { name } ) {\n\tconst parentMenu = name === undefined ? '' : '/blocks/' + name;\n\tconst supports = getSupportedGlobalStylesPanels( name );\n\tconst [ solids ] = useSetting( 'color.palette', name );\n\tconst [ gradients ] = useSetting( 'color.gradients', name );\n\tconst [ areCustomSolidsEnabled ] = useSetting( 'color.custom', name );\n\tconst [ areCustomGradientsEnabled ] = useSetting(\n\t\t'color.customGradient',\n\t\tname\n\t);\n\n\tconst colorsPerOrigin = useColorsPerOrigin( name );\n\tconst gradientsPerOrigin = useGradientsPerOrigin( name );\n\n\tconst [ isBackgroundEnabled ] = useSetting( 'color.background', name );\n\n\tconst hasBackgroundColor =\n\t\tsupports.includes( 'backgroundColor' ) &&\n\t\tisBackgroundEnabled &&\n\t\t( solids.length > 0 || areCustomSolidsEnabled );\n\tconst hasGradientColor =\n\t\tsupports.includes( 'background' ) &&\n\t\t( gradients.length > 0 || areCustomGradientsEnabled );\n\tconst [ backgroundColor, setBackgroundColor ] = useStyle(\n\t\t'color.background',\n\t\tname\n\t);\n\tconst [ userBackgroundColor ] = useStyle(\n\t\t'color.background',\n\t\tname,\n\t\t'user'\n\t);\n\tconst [ gradient, setGradient ] = useStyle( 'color.gradient', name );\n\tconst [ userGradient ] = useStyle( 'color.gradient', name, 'user' );\n\n\tif ( ! hasBackgroundColor && ! hasGradientColor ) {\n\t\treturn null;\n\t}\n\n\tlet backgroundSettings = {};\n\tif ( hasBackgroundColor ) {\n\t\tbackgroundSettings = {\n\t\t\tcolorValue: backgroundColor,\n\t\t\tonColorChange: setBackgroundColor,\n\t\t};\n\t\tif ( backgroundColor ) {\n\t\t\tbackgroundSettings.clearable =\n\t\t\t\tbackgroundColor === userBackgroundColor;\n\t\t}\n\t}\n\n\tlet gradientSettings = {};\n\tif ( hasGradientColor ) {\n\t\tgradientSettings = {\n\t\t\tgradientValue: gradient,\n\t\t\tonGradientChange: setGradient,\n\t\t};\n\t\tif ( gradient ) {\n\t\t\tgradientSettings.clearable = gradient === userGradient;\n\t\t}\n\t}\n\n\tconst controlProps = {\n\t\t...backgroundSettings,\n\t\t...gradientSettings,\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\tback={ parentMenu + '/colors' }\n\t\t\t\ttitle={ __( 'Background' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Set a background color or gradient for the whole website.'\n\t\t\t\t) }\n\t\t\t/>\n\t\t\t<ColorGradientControl\n\t\t\t\tclassName=\"edit-site-screen-background-color__control\"\n\t\t\t\tcolors={ colorsPerOrigin }\n\t\t\t\tgradients={ gradientsPerOrigin }\n\t\t\t\tdisableCustomColors={ ! areCustomSolidsEnabled }\n\t\t\t\tdisableCustomGradients={ ! areCustomGradientsEnabled }\n\t\t\t\t__experimentalHasMultipleOrigins\n\t\t\t\tshowTitle={ false }\n\t\t\t\tenableAlpha\n\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t{ ...controlProps }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport default ScreenBackgroundColor;\n"]}
|
|
@@ -42,25 +42,21 @@ function ScreenLinkColor(_ref) {
|
|
|
42
42
|
return null;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
const settings = [{
|
|
46
|
-
colorValue: linkColor,
|
|
47
|
-
onColorChange: setLinkColor,
|
|
48
|
-
label: (0, _i18n.__)('Link color'),
|
|
49
|
-
clearable: linkColor === userLinkColor
|
|
50
|
-
}];
|
|
51
45
|
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_header.default, {
|
|
52
46
|
back: parentMenu + '/colors',
|
|
53
47
|
title: (0, _i18n.__)('Links'),
|
|
54
48
|
description: (0, _i18n.__)('Set the default color used for links across the site.')
|
|
55
|
-
}), (0, _element.createElement)(_blockEditor.
|
|
56
|
-
|
|
57
|
-
settings: settings,
|
|
49
|
+
}), (0, _element.createElement)(_blockEditor.__experimentalColorGradientControl, {
|
|
50
|
+
className: "edit-site-screen-link-color__control",
|
|
58
51
|
colors: colorsPerOrigin,
|
|
59
52
|
disableCustomColors: !areCustomSolidsEnabled,
|
|
60
53
|
__experimentalHasMultipleOrigins: true,
|
|
61
54
|
showTitle: false,
|
|
62
55
|
enableAlpha: true,
|
|
63
|
-
__experimentalIsRenderedInSidebar: true
|
|
56
|
+
__experimentalIsRenderedInSidebar: true,
|
|
57
|
+
colorValue: linkColor,
|
|
58
|
+
onColorChange: setLinkColor,
|
|
59
|
+
clearable: linkColor === userLinkColor
|
|
64
60
|
}));
|
|
65
61
|
}
|
|
66
62
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-link-color.js"],"names":["ScreenLinkColor","name","parentMenu","undefined","supports","solids","areCustomSolidsEnabled","colorsPerOrigin","isLinkEnabled","hasLinkColor","includes","length","linkColor","setLinkColor","userLinkColor"
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-link-color.js"],"names":["ScreenLinkColor","name","parentMenu","undefined","supports","solids","areCustomSolidsEnabled","colorsPerOrigin","isLinkEnabled","hasLinkColor","includes","length","linkColor","setLinkColor","userLinkColor"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AAVA;AACA;AACA;;AAIA;AACA;AACA;AASA,SAASA,eAAT,OAAqC;AAAA,MAAX;AAAEC,IAAAA;AAAF,GAAW;AACpC,QAAMC,UAAU,GAAGD,IAAI,KAAKE,SAAT,GAAqB,EAArB,GA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ies\n */\nimport { __ } from '@wordpress/i18n';\nimport { __experimentalColorGradientControl as ColorGradientControl } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport ScreenHeader from './header';\nimport {\n\tgetSupportedGlobalStylesPanels,\n\tuseSetting,\n\tuseStyle,\n\tuseColorsPerOrigin,\n} from './hooks';\n\nfunction ScreenLinkColor( { name } ) {\n\tconst parentMenu = name === undefined ? '' : '/blocks/' + name;\n\tconst supports = getSupportedGlobalStylesPanels( name );\n\tconst [ solids ] = useSetting( 'color.palette', name );\n\tconst [ areCustomSolidsEnabled ] = useSetting( 'color.custom', name );\n\n\tconst colorsPerOrigin = useColorsPerOrigin( name );\n\n\tconst [ isLinkEnabled ] = useSetting( 'color.link', name );\n\n\tconst hasLinkColor =\n\t\tsupports.includes( 'linkColor' ) &&\n\t\tisLinkEnabled &&\n\t\t( solids.length > 0 || areCustomSolidsEnabled );\n\n\tconst [ linkColor, setLinkColor ] = useStyle(\n\t\t'elements.link.color.text',\n\t\tname\n\t);\n\tconst [ userLinkColor ] = useStyle(\n\t\t'elements.link.color.text',\n\t\tname,\n\t\t'user'\n\t);\n\n\tif ( ! hasLinkColor ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\tback={ parentMenu + '/colors' }\n\t\t\t\ttitle={ __( 'Links' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Set the default color used for links across the site.'\n\t\t\t\t) }\n\t\t\t/>\n\t\t\t<ColorGradientControl\n\t\t\t\tclassName=\"edit-site-screen-link-color__control\"\n\t\t\t\tcolors={ colorsPerOrigin }\n\t\t\t\tdisableCustomColors={ ! areCustomSolidsEnabled }\n\t\t\t\t__experimentalHasMultipleOrigins\n\t\t\t\tshowTitle={ false }\n\t\t\t\tenableAlpha\n\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\tcolorValue={ linkColor }\n\t\t\t\tonColorChange={ setLinkColor }\n\t\t\t\tclearable={ linkColor === userLinkColor }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport default ScreenLinkColor;\n"]}
|
|
@@ -42,25 +42,21 @@ function ScreenTextColor(_ref) {
|
|
|
42
42
|
return null;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
const settings = [{
|
|
46
|
-
colorValue: color,
|
|
47
|
-
onColorChange: setColor,
|
|
48
|
-
label: (0, _i18n.__)('Text color'),
|
|
49
|
-
clearable: color === userColor
|
|
50
|
-
}];
|
|
51
45
|
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_header.default, {
|
|
52
46
|
back: parentMenu + '/colors',
|
|
53
47
|
title: (0, _i18n.__)('Text'),
|
|
54
48
|
description: (0, _i18n.__)('Set the default color used for text across the site.')
|
|
55
|
-
}), (0, _element.createElement)(_blockEditor.
|
|
56
|
-
|
|
57
|
-
settings: settings,
|
|
49
|
+
}), (0, _element.createElement)(_blockEditor.__experimentalColorGradientControl, {
|
|
50
|
+
className: "edit-site-screen-text-color__control",
|
|
58
51
|
colors: colorsPerOrigin,
|
|
59
52
|
disableCustomColors: !areCustomSolidsEnabled,
|
|
60
53
|
__experimentalHasMultipleOrigins: true,
|
|
61
54
|
showTitle: false,
|
|
62
55
|
enableAlpha: true,
|
|
63
|
-
__experimentalIsRenderedInSidebar: true
|
|
56
|
+
__experimentalIsRenderedInSidebar: true,
|
|
57
|
+
colorValue: color,
|
|
58
|
+
onColorChange: setColor,
|
|
59
|
+
clearable: color === userColor
|
|
64
60
|
}));
|
|
65
61
|
}
|
|
66
62
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-text-color.js"],"names":["ScreenTextColor","name","parentMenu","undefined","supports","solids","areCustomSolidsEnabled","isTextEnabled","colorsPerOrigin","hasTextColor","includes","length","color","setColor","userColor"
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/global-styles/screen-text-color.js"],"names":["ScreenTextColor","name","parentMenu","undefined","supports","solids","areCustomSolidsEnabled","isTextEnabled","colorsPerOrigin","hasTextColor","includes","length","color","setColor","userColor"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AAVA;AACA;AACA;;AAIA;AACA;AACA;AASA,SAASA,eAAT,OAAqC;AAAA,MAAX;AAAEC,IAAAA;AAAF,GAAW;AACpC,QAAMC,UAAU,GAAGD,IAAI,KAAKE,SAAT,GAAqB,EAArB,GAA0B,aAAaF,IAA1D;AACA,QAAMG,QAAQ,GAAG,2CAAgCH,IAAhC,CAAjB;AACA,QAAM,CAAEI,MAAF,IAAa,uBAAY,eAAZ,EAA6BJ,IAA7B,CAAnB;AACA,QAAM,CAAEK,sBAAF,IAA6B,uBAAY,cAAZ,EAA4BL,IAA5B,CAAnC;AACA,QAAM,CAAEM,aAAF,IAAoB,uBAAY,YAAZ,EAA0BN,IAA1B,CAA1B;AAEA,QAAMO,eAAe,GAAG,+BAAoBP,IAApB,CAAxB;AAEA,QAAMQ,YAAY,GACjBL,QAAQ,CAACM,QAAT,CAAmB,OAAnB,KACAH,aADA,KAEEF,MAAM,CAACM,MAAP,GAAgB,CAAhB,IAAqBL,sBAFvB,CADD;AAKA,QAAM,CAAEM,KAAF,EAASC,QAAT,IAAsB,qBAAU,YAAV,EAAwBZ,IAAxB,CAA5B;AACA,QAAM,CAAEa,SAAF,IAAgB,qBAAU,YAAV,EAAwBb,IAAxB,EAA8B,MAA9B,CAAtB;;AAEA,MAAK,CAAEQ,YAAP,EAAsB;AACrB,WAAO,IAAP;AACA;;AAED,SACC,qDACC,4BAAC,eAAD;AACC,IAAA,IAAI,EAAGP,UAAU,GAAG,SADrB;AAEC,IAAA,KAAK,EAAG,cAAI,MAAJ,CAFT;AAGC,IAAA,WAAW,EAAG,cACb,sDADa;AAHf,IADD,EAQC,4BAAC,+CAAD;AACC,IAAA,SAAS,EAAC,sCADX;AAEC,IAAA,MAAM,EAAGM,eAFV;AAGC,IAAA,mBAAmB,EAAG,CAAEF,sBAHzB;AAIC,IAAA,gCAAgC,MAJjC;AAKC,IAAA,SAAS,EAAG,KALb;AAMC,IAAA,WAAW,MANZ;AAOC,IAAA,iCAAiC,MAPlC;AAQC,IAAA,UAAU,EAAGM,KARd;AASC,IAAA,aAAa,EAAGC,QATjB;AAUC,IAAA,SAAS,EAAGD,KAAK,KAAKE;AAVvB,IARD,CADD;AAuBA;;eAEcd,e","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { __experimentalColorGradientControl as ColorGradientControl } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport ScreenHeader from './header';\nimport {\n\tgetSupportedGlobalStylesPanels,\n\tuseSetting,\n\tuseStyle,\n\tuseColorsPerOrigin,\n} from './hooks';\n\nfunction ScreenTextColor( { name } ) {\n\tconst parentMenu = name === undefined ? '' : '/blocks/' + name;\n\tconst supports = getSupportedGlobalStylesPanels( name );\n\tconst [ solids ] = useSetting( 'color.palette', name );\n\tconst [ areCustomSolidsEnabled ] = useSetting( 'color.custom', name );\n\tconst [ isTextEnabled ] = useSetting( 'color.text', name );\n\n\tconst colorsPerOrigin = useColorsPerOrigin( name );\n\n\tconst hasTextColor =\n\t\tsupports.includes( 'color' ) &&\n\t\tisTextEnabled &&\n\t\t( solids.length > 0 || areCustomSolidsEnabled );\n\n\tconst [ color, setColor ] = useStyle( 'color.text', name );\n\tconst [ userColor ] = useStyle( 'color.text', name, 'user' );\n\n\tif ( ! hasTextColor ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<ScreenHeader\n\t\t\t\tback={ parentMenu + '/colors' }\n\t\t\t\ttitle={ __( 'Text' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Set the default color used for text across the site.'\n\t\t\t\t) }\n\t\t\t/>\n\t\t\t<ColorGradientControl\n\t\t\t\tclassName=\"edit-site-screen-text-color__control\"\n\t\t\t\tcolors={ colorsPerOrigin }\n\t\t\t\tdisableCustomColors={ ! areCustomSolidsEnabled }\n\t\t\t\t__experimentalHasMultipleOrigins\n\t\t\t\tshowTitle={ false }\n\t\t\t\tenableAlpha\n\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\tcolorValue={ color }\n\t\t\t\tonColorChange={ setColor }\n\t\t\t\tclearable={ color === userColor }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport default ScreenTextColor;\n"]}
|