@wordpress/edit-site 7.0.0 → 7.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/canvas-loader/index.cjs +8 -3
- package/build/components/canvas-loader/index.cjs.map +3 -3
- package/build/components/editor/use-editor-title.cjs +1 -2
- package/build/components/editor/use-editor-title.cjs.map +3 -3
- package/build/components/save-button/index.cjs +3 -3
- package/build/components/save-button/index.cjs.map +3 -3
- package/build/components/save-panel/index.cjs +7 -4
- package/build/components/save-panel/index.cjs.map +3 -3
- package/build/components/sidebar-navigation-screen-patterns/index.cjs +3 -2
- package/build/components/sidebar-navigation-screen-patterns/index.cjs.map +3 -3
- package/build/components/site-editor-routes/styles.cjs +17 -12
- package/build/components/site-editor-routes/styles.cjs.map +2 -2
- package/build-module/components/canvas-loader/index.mjs +9 -7
- package/build-module/components/canvas-loader/index.mjs.map +2 -2
- package/build-module/components/editor/use-editor-title.mjs +5 -3
- package/build-module/components/editor/use-editor-title.mjs.map +2 -2
- package/build-module/components/save-button/index.mjs +6 -6
- package/build-module/components/save-button/index.mjs.map +2 -2
- package/build-module/components/save-panel/index.mjs +9 -7
- package/build-module/components/save-panel/index.mjs.map +2 -2
- package/build-module/components/sidebar-navigation-screen-patterns/index.mjs +2 -1
- package/build-module/components/sidebar-navigation-screen-patterns/index.mjs.map +2 -2
- package/build-module/components/site-editor-routes/styles.mjs +17 -12
- package/build-module/components/site-editor-routes/styles.mjs.map +2 -2
- package/build-style/style-rtl.css +19 -8
- package/build-style/style.css +19 -8
- package/package.json +48 -49
- package/src/components/canvas-loader/index.js +6 -10
- package/src/components/canvas-loader/style.scss +3 -4
- package/src/components/editor/use-editor-title.js +5 -3
- package/src/components/save-button/index.js +6 -6
- package/src/components/save-panel/index.js +9 -7
- package/src/components/sidebar-navigation-screen-patterns/index.js +2 -1
- package/src/components/site-editor-routes/styles.js +19 -11
package/CHANGELOG.md
CHANGED
|
@@ -29,11 +29,9 @@ var import_data = require("@wordpress/data");
|
|
|
29
29
|
var import_editor = require("@wordpress/editor");
|
|
30
30
|
var import_lock_unlock = require("../../lock-unlock.cjs");
|
|
31
31
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
32
|
-
var { Theme } = (0, import_lock_unlock.unlock)(import_components.privateApis);
|
|
33
32
|
var { useStyle } = (0, import_lock_unlock.unlock)(import_editor.privateApis);
|
|
34
33
|
function CanvasLoader({ id }) {
|
|
35
34
|
const textColor = useStyle("color.text");
|
|
36
|
-
const backgroundColor = useStyle("color.background");
|
|
37
35
|
const { elapsed, total } = (0, import_data.useSelect)((select) => {
|
|
38
36
|
const selectorsByStatus = select(import_core_data.store).countSelectorsByStatus();
|
|
39
37
|
const resolving = selectorsByStatus.resolving ?? 0;
|
|
@@ -43,6 +41,13 @@ function CanvasLoader({ id }) {
|
|
|
43
41
|
total: finished + resolving
|
|
44
42
|
};
|
|
45
43
|
}, []);
|
|
46
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
44
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
45
|
+
"div",
|
|
46
|
+
{
|
|
47
|
+
className: "edit-site-canvas-loader",
|
|
48
|
+
style: textColor ? { "--color": textColor } : void 0,
|
|
49
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.ProgressBar, { id, max: total, value: elapsed })
|
|
50
|
+
}
|
|
51
|
+
);
|
|
47
52
|
}
|
|
48
53
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/canvas-loader/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,
|
|
6
|
-
"names": ["
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { ProgressBar } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { useStyle } = unlock( editorPrivateApis );\n\nexport default function CanvasLoader( { id } ) {\n\tconst textColor = useStyle( 'color.text' );\n\tconst { elapsed, total } = useSelect( ( select ) => {\n\t\tconst selectorsByStatus = select( coreStore ).countSelectorsByStatus();\n\t\tconst resolving = selectorsByStatus.resolving ?? 0;\n\t\tconst finished = selectorsByStatus.finished ?? 0;\n\t\treturn {\n\t\t\telapsed: finished,\n\t\t\ttotal: finished + resolving,\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<div\n\t\t\tclassName=\"edit-site-canvas-loader\"\n\t\t\tstyle={ textColor ? { '--color': textColor } : undefined }\n\t\t>\n\t\t\t<ProgressBar id={ id } max={ total } value={ elapsed } />\n\t\t</div>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAA4B;AAC5B,uBAAmC;AACnC,kBAA0B;AAC1B,oBAAiD;AAKjD,yBAAuB;AAqBpB;AAnBH,IAAM,EAAE,SAAS,QAAI,2BAAQ,cAAAA,WAAkB;AAEhC,SAAR,aAA+B,EAAE,GAAG,GAAI;AAC9C,QAAM,YAAY,SAAU,YAAa;AACzC,QAAM,EAAE,SAAS,MAAM,QAAI,uBAAW,CAAE,WAAY;AACnD,UAAM,oBAAoB,OAAQ,iBAAAC,KAAU,EAAE,uBAAuB;AACrE,UAAM,YAAY,kBAAkB,aAAa;AACjD,UAAM,WAAW,kBAAkB,YAAY;AAC/C,WAAO;AAAA,MACN,SAAS;AAAA,MACT,OAAO,WAAW;AAAA,IACnB;AAAA,EACD,GAAG,CAAC,CAAE;AAEN,SACC;AAAA,IAAC;AAAA;AAAA,MACA,WAAU;AAAA,MACV,OAAQ,YAAY,EAAE,WAAW,UAAU,IAAI;AAAA,MAE/C,sDAAC,iCAAY,IAAU,KAAM,OAAQ,OAAQ,SAAU;AAAA;AAAA,EACxD;AAEF;",
|
|
6
|
+
"names": ["editorPrivateApis", "coreStore"]
|
|
7
7
|
}
|
|
@@ -37,11 +37,10 @@ var import_i18n = require("@wordpress/i18n");
|
|
|
37
37
|
var import_data = require("@wordpress/data");
|
|
38
38
|
var import_core_data = require("@wordpress/core-data");
|
|
39
39
|
var import_html_entities = require("@wordpress/html-entities");
|
|
40
|
-
var import_editor = require("@wordpress/editor");
|
|
41
40
|
var import_use_title = __toESM(require("../routes/use-title.cjs"));
|
|
42
41
|
var import_constants = require("../../utils/constants.cjs");
|
|
43
42
|
var import_lock_unlock = require("../../lock-unlock.cjs");
|
|
44
|
-
var { getTemplateInfo } = (0, import_lock_unlock.unlock)(
|
|
43
|
+
var { getTemplateInfo } = (0, import_lock_unlock.unlock)(import_core_data.privateApis);
|
|
45
44
|
function useEditorTitle(postType, postId) {
|
|
46
45
|
const { title, isLoaded } = (0, import_data.useSelect)(
|
|
47
46
|
(select) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/editor/use-editor-title.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { _x, sprintf } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAA4B;AAC5B,kBAA0B;AAC1B,
|
|
6
|
-
"names": ["
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { _x, sprintf } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport {\n\tstore as coreStore,\n\tprivateApis as coreDataPrivateApis,\n} from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport useTitle from '../routes/use-title';\nimport { POST_TYPE_LABELS, TEMPLATE_POST_TYPE } from '../../utils/constants';\nimport { unlock } from '../../lock-unlock';\n\nconst { getTemplateInfo } = unlock( coreDataPrivateApis );\n\nfunction useEditorTitle( postType, postId ) {\n\tconst { title, isLoaded } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetEditedEntityRecord,\n\t\t\t\tgetCurrentTheme,\n\t\t\t\thasFinishedResolution,\n\t\t\t} = select( coreStore );\n\n\t\t\tif ( ! postId ) {\n\t\t\t\treturn { isLoaded: false };\n\t\t\t}\n\n\t\t\tconst _record = getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId\n\t\t\t);\n\n\t\t\tconst { default_template_types: templateTypes = [] } =\n\t\t\t\tgetCurrentTheme() ?? {};\n\n\t\t\tconst templateInfo = getTemplateInfo( {\n\t\t\t\ttemplate: _record,\n\t\t\t\ttemplateTypes,\n\t\t\t} );\n\n\t\t\tconst _isLoaded = hasFinishedResolution( 'getEditedEntityRecord', [\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId,\n\t\t\t] );\n\n\t\t\treturn {\n\t\t\t\ttitle: templateInfo.title,\n\t\t\t\tisLoaded: _isLoaded,\n\t\t\t};\n\t\t},\n\t\t[ postType, postId ]\n\t);\n\n\tlet editorTitle;\n\tif ( isLoaded ) {\n\t\teditorTitle = sprintf(\n\t\t\t// translators: A breadcrumb trail for the Admin document title. 1: title of template being edited, 2: type of template (Template or Template Part).\n\t\t\t_x( '%1$s ‹ %2$s', 'breadcrumb trail' ),\n\t\t\tdecodeEntities( title ),\n\t\t\tPOST_TYPE_LABELS[ postType ] ??\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( isLoaded && editorTitle );\n}\n\nexport default useEditorTitle;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAA4B;AAC5B,kBAA0B;AAC1B,uBAGO;AACP,2BAA+B;AAK/B,uBAAqB;AACrB,uBAAqD;AACrD,yBAAuB;AAEvB,IAAM,EAAE,gBAAgB,QAAI,2BAAQ,iBAAAA,WAAoB;AAExD,SAAS,eAAgB,UAAU,QAAS;AAC3C,QAAM,EAAE,OAAO,SAAS,QAAI;AAAA,IAC3B,CAAE,WAAY;AACb,YAAM;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,MACD,IAAI,OAAQ,iBAAAC,KAAU;AAEtB,UAAK,CAAE,QAAS;AACf,eAAO,EAAE,UAAU,MAAM;AAAA,MAC1B;AAEA,YAAM,UAAU;AAAA,QACf;AAAA,QACA;AAAA,QACA;AAAA,MACD;AAEA,YAAM,EAAE,wBAAwB,gBAAgB,CAAC,EAAE,IAClD,gBAAgB,KAAK,CAAC;AAEvB,YAAM,eAAe,gBAAiB;AAAA,QACrC,UAAU;AAAA,QACV;AAAA,MACD,CAAE;AAEF,YAAM,YAAY,sBAAuB,yBAAyB;AAAA,QACjE;AAAA,QACA;AAAA,QACA;AAAA,MACD,CAAE;AAEF,aAAO;AAAA,QACN,OAAO,aAAa;AAAA,QACpB,UAAU;AAAA,MACX;AAAA,IACD;AAAA,IACA,CAAE,UAAU,MAAO;AAAA,EACpB;AAEA,MAAI;AACJ,MAAK,UAAW;AACf,sBAAc;AAAA;AAAA,UAEb,gBAAI,eAAe,kBAAmB;AAAA,UACtC,qCAAgB,KAAM;AAAA,MACtB,kCAAkB,QAAS,KAC1B,kCAAkB,mCAAmB;AAAA,IACvC;AAAA,EACD;AAIA,uBAAAC,SAAU,YAAY,WAAY;AACnC;AAEA,IAAO,2BAAQ;",
|
|
6
|
+
"names": ["coreDataPrivateApis", "coreStore", "useTitle"]
|
|
7
7
|
}
|
|
@@ -29,12 +29,12 @@ var import_i18n = require("@wordpress/i18n");
|
|
|
29
29
|
var import_core_data = require("@wordpress/core-data");
|
|
30
30
|
var import_keycodes = require("@wordpress/keycodes");
|
|
31
31
|
var import_router = require("@wordpress/router");
|
|
32
|
-
var import_editor = require("@wordpress/editor");
|
|
33
32
|
var import_store = require("../../store/index.cjs");
|
|
34
33
|
var import_is_previewing_theme = require("../../utils/is-previewing-theme.cjs");
|
|
35
34
|
var import_lock_unlock = require("../../lock-unlock.cjs");
|
|
36
35
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
37
36
|
var { useLocation } = (0, import_lock_unlock.unlock)(import_router.privateApis);
|
|
37
|
+
var { useEntitiesSavedStatesIsDirty } = (0, import_lock_unlock.unlock)(import_core_data.privateApis);
|
|
38
38
|
function SaveButton({
|
|
39
39
|
className = "edit-site-save-button__button",
|
|
40
40
|
variant = "primary",
|
|
@@ -46,8 +46,8 @@ function SaveButton({
|
|
|
46
46
|
}) {
|
|
47
47
|
const { params } = useLocation();
|
|
48
48
|
const { setIsSaveViewOpened } = (0, import_data.useDispatch)(import_store.store);
|
|
49
|
-
const { saveDirtyEntities } = (0, import_lock_unlock.unlock)((0, import_data.useDispatch)(
|
|
50
|
-
const { dirtyEntityRecords } =
|
|
49
|
+
const { saveDirtyEntities } = (0, import_lock_unlock.unlock)((0, import_data.useDispatch)(import_core_data.store));
|
|
50
|
+
const { dirtyEntityRecords } = useEntitiesSavedStatesIsDirty();
|
|
51
51
|
const { isSaving, isSaveViewOpen, previewingThemeName } = (0, import_data.useSelect)(
|
|
52
52
|
(select) => {
|
|
53
53
|
const { isSavingEntityRecord, isResolving } = select(import_core_data.store);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/save-button/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Button } from '@wordpress/components';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAuC;AACvC,wBAAuB;AACvB,kBAAgC;AAChC,
|
|
6
|
-
"names": ["routerPrivateApis", "
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Button } from '@wordpress/components';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport {\n\tstore as coreStore,\n\tprivateApis as coreDataPrivateApis,\n} from '@wordpress/core-data';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport {\n\tcurrentlyPreviewingTheme,\n\tisPreviewingTheme,\n} from '../../utils/is-previewing-theme';\nimport { unlock } from '../../lock-unlock';\n\nconst { useLocation } = unlock( routerPrivateApis );\nconst { useEntitiesSavedStatesIsDirty } = unlock( coreDataPrivateApis );\n\nexport default function SaveButton( {\n\tclassName = 'edit-site-save-button__button',\n\tvariant = 'primary',\n\tshowTooltip = true,\n\tshowReviewMessage,\n\ticon,\n\tsize,\n\t__next40pxDefaultSize = false,\n} ) {\n\tconst { params } = useLocation();\n\tconst { setIsSaveViewOpened } = useDispatch( editSiteStore );\n\tconst { saveDirtyEntities } = unlock( useDispatch( coreStore ) );\n\tconst { dirtyEntityRecords } = useEntitiesSavedStatesIsDirty();\n\tconst { isSaving, isSaveViewOpen, previewingThemeName } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { isSavingEntityRecord, isResolving } = select( coreStore );\n\t\t\tconst { isSaveViewOpened } = select( editSiteStore );\n\t\t\tconst isActivatingTheme = isResolving( 'activateTheme' );\n\t\t\tconst currentlyPreviewingThemeId = currentlyPreviewingTheme();\n\t\t\treturn {\n\t\t\t\tisSaving:\n\t\t\t\t\tdirtyEntityRecords.some( ( record ) =>\n\t\t\t\t\t\tisSavingEntityRecord(\n\t\t\t\t\t\t\trecord.kind,\n\t\t\t\t\t\t\trecord.name,\n\t\t\t\t\t\t\trecord.key\n\t\t\t\t\t\t)\n\t\t\t\t\t) || isActivatingTheme,\n\t\t\t\tisSaveViewOpen: isSaveViewOpened(),\n\t\t\t\t// Do not call `getTheme` with null, it will cause a request to\n\t\t\t\t// the server.\n\t\t\t\tpreviewingThemeName: currentlyPreviewingThemeId\n\t\t\t\t\t? select( coreStore ).getTheme( currentlyPreviewingThemeId )\n\t\t\t\t\t\t\t?.name?.rendered\n\t\t\t\t\t: undefined,\n\t\t\t};\n\t\t},\n\t\t[ dirtyEntityRecords ]\n\t);\n\tconst hasDirtyEntities = !! dirtyEntityRecords.length;\n\tlet isOnlyCurrentEntityDirty;\n\t// Check if the current entity is the only entity with changes.\n\t// We have some extra logic for `wp_global_styles` for now, that\n\t// is used in navigation sidebar.\n\tif ( dirtyEntityRecords.length === 1 ) {\n\t\tif ( params.postId ) {\n\t\t\tisOnlyCurrentEntityDirty =\n\t\t\t\t`${ dirtyEntityRecords[ 0 ].key }` === params.postId &&\n\t\t\t\tdirtyEntityRecords[ 0 ].name === params.postType;\n\t\t} else if ( params.path?.includes( 'wp_global_styles' ) ) {\n\t\t\tisOnlyCurrentEntityDirty =\n\t\t\t\tdirtyEntityRecords[ 0 ].name === 'globalStyles';\n\t\t}\n\t}\n\tconst disabled =\n\t\tisSaving || ( ! hasDirtyEntities && ! isPreviewingTheme() );\n\tconst getLabel = () => {\n\t\tif ( isPreviewingTheme() ) {\n\t\t\tif ( isSaving ) {\n\t\t\t\treturn sprintf(\n\t\t\t\t\t/* translators: %s: The name of theme to be activated. */\n\t\t\t\t\t__( 'Activating %s' ),\n\t\t\t\t\tpreviewingThemeName\n\t\t\t\t);\n\t\t\t} else if ( disabled ) {\n\t\t\t\treturn __( 'Saved' );\n\t\t\t} else if ( hasDirtyEntities ) {\n\t\t\t\treturn sprintf(\n\t\t\t\t\t/* translators: %s: The name of theme to be activated. */\n\t\t\t\t\t__( 'Activate %s & Save' ),\n\t\t\t\t\tpreviewingThemeName\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn sprintf(\n\t\t\t\t/* translators: %s: The name of theme to be activated. */\n\t\t\t\t__( 'Activate %s' ),\n\t\t\t\tpreviewingThemeName\n\t\t\t);\n\t\t}\n\t\tif ( isSaving ) {\n\t\t\treturn __( 'Saving' );\n\t\t}\n\t\tif ( disabled ) {\n\t\t\treturn __( 'Saved' );\n\t\t}\n\t\tif ( ! isOnlyCurrentEntityDirty && showReviewMessage ) {\n\t\t\treturn sprintf(\n\t\t\t\t// translators: %d: number of unsaved changes (number).\n\t\t\t\t_n(\n\t\t\t\t\t'Review %d change…',\n\t\t\t\t\t'Review %d changes…',\n\t\t\t\t\tdirtyEntityRecords.length\n\t\t\t\t),\n\t\t\t\tdirtyEntityRecords.length\n\t\t\t);\n\t\t}\n\t\treturn __( 'Save' );\n\t};\n\tconst label = getLabel();\n\tconst onClick = isOnlyCurrentEntityDirty\n\t\t? () => saveDirtyEntities( { dirtyEntityRecords } )\n\t\t: () => setIsSaveViewOpened( true );\n\treturn (\n\t\t<Button\n\t\t\tvariant={ variant }\n\t\t\tclassName={ className }\n\t\t\taria-disabled={ disabled }\n\t\t\taria-expanded={ isSaveViewOpen }\n\t\t\tisBusy={ isSaving }\n\t\t\tonClick={ disabled ? undefined : onClick }\n\t\t\tlabel={ label }\n\t\t\t/*\n\t\t\t * We want the tooltip to show the keyboard shortcut only when the\n\t\t\t * button does something, i.e. when it's not disabled.\n\t\t\t */\n\t\t\tshortcut={ disabled ? undefined : displayShortcut.primary( 's' ) }\n\t\t\t/*\n\t\t\t * Displaying the keyboard shortcut conditionally makes the tooltip\n\t\t\t * itself show conditionally. This would trigger a full-rerendering\n\t\t\t * of the button that we want to avoid. By setting `showTooltip`,\n\t\t\t * the tooltip is always rendered even when there's no keyboard shortcut.\n\t\t\t */\n\t\t\tshowTooltip={ showTooltip }\n\t\t\ticon={ icon }\n\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\tsize={ size }\n\t\t>\n\t\t\t{ label }\n\t\t</Button>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAuC;AACvC,wBAAuB;AACvB,kBAAgC;AAChC,uBAGO;AACP,sBAAgC;AAChC,oBAAiD;AAKjD,mBAAuC;AACvC,iCAGO;AACP,yBAAuB;AA4GrB;AA1GF,IAAM,EAAE,YAAY,QAAI,2BAAQ,cAAAA,WAAkB;AAClD,IAAM,EAAE,8BAA8B,QAAI,2BAAQ,iBAAAC,WAAoB;AAEvD,SAAR,WAA6B;AAAA,EACnC,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,cAAc;AAAA,EACd;AAAA,EACA;AAAA,EACA;AAAA,EACA,wBAAwB;AACzB,GAAI;AACH,QAAM,EAAE,OAAO,IAAI,YAAY;AAC/B,QAAM,EAAE,oBAAoB,QAAI,yBAAa,aAAAC,KAAc;AAC3D,QAAM,EAAE,kBAAkB,QAAI,+BAAQ,yBAAa,iBAAAC,KAAU,CAAE;AAC/D,QAAM,EAAE,mBAAmB,IAAI,8BAA8B;AAC7D,QAAM,EAAE,UAAU,gBAAgB,oBAAoB,QAAI;AAAA,IACzD,CAAE,WAAY;AACb,YAAM,EAAE,sBAAsB,YAAY,IAAI,OAAQ,iBAAAA,KAAU;AAChE,YAAM,EAAE,iBAAiB,IAAI,OAAQ,aAAAD,KAAc;AACnD,YAAM,oBAAoB,YAAa,eAAgB;AACvD,YAAM,iCAA6B,qDAAyB;AAC5D,aAAO;AAAA,QACN,UACC,mBAAmB;AAAA,UAAM,CAAE,WAC1B;AAAA,YACC,OAAO;AAAA,YACP,OAAO;AAAA,YACP,OAAO;AAAA,UACR;AAAA,QACD,KAA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,EACnB;AACA,QAAM,QAAQ,SAAS;AACvB,QAAM,UAAU,2BACb,MAAM,kBAAmB,EAAE,mBAAmB,CAAE,IAChD,MAAM,oBAAqB,IAAK;AACnC,SACC;AAAA,IAAC;AAAA;AAAA,MACA;AAAA,MACA;AAAA,MACA,iBAAgB;AAAA,MAChB,iBAAgB;AAAA,MAChB,QAAS;AAAA,MACT,SAAU,WAAW,SAAY;AAAA,MACjC;AAAA,MAKA,UAAW,WAAW,SAAY,gCAAgB,QAAS,GAAI;AAAA,MAO/D;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MAEE;AAAA;AAAA,EACH;AAEF;",
|
|
6
|
+
"names": ["routerPrivateApis", "coreDataPrivateApis", "editSiteStore", "coreStore"]
|
|
7
7
|
}
|
|
@@ -36,7 +36,6 @@ module.exports = __toCommonJS(save_panel_exports);
|
|
|
36
36
|
var import_clsx = __toESM(require("clsx"));
|
|
37
37
|
var import_admin_ui = require("@wordpress/admin-ui");
|
|
38
38
|
var import_components = require("@wordpress/components");
|
|
39
|
-
var import_editor = require("@wordpress/editor");
|
|
40
39
|
var import_data = require("@wordpress/data");
|
|
41
40
|
var import_i18n = require("@wordpress/i18n");
|
|
42
41
|
var import_core_data = require("@wordpress/core-data");
|
|
@@ -48,14 +47,18 @@ var import_use_activate_theme = require("../../utils/use-activate-theme.cjs");
|
|
|
48
47
|
var import_use_actual_current_theme = require("../../utils/use-actual-current-theme.cjs");
|
|
49
48
|
var import_is_previewing_theme = require("../../utils/is-previewing-theme.cjs");
|
|
50
49
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
51
|
-
var { EntitiesSavedStatesExtensible } = (0, import_lock_unlock.unlock)(import_editor.privateApis);
|
|
52
50
|
var { useLocation } = (0, import_lock_unlock.unlock)(import_router.privateApis);
|
|
51
|
+
var {
|
|
52
|
+
EntitiesSavedStatesExtensible,
|
|
53
|
+
EntitiesSavedStates,
|
|
54
|
+
useEntitiesSavedStatesIsDirty
|
|
55
|
+
} = (0, import_lock_unlock.unlock)(import_core_data.privateApis);
|
|
53
56
|
var EntitiesSavedStatesForPreview = ({
|
|
54
57
|
onClose,
|
|
55
58
|
renderDialog,
|
|
56
59
|
variant
|
|
57
60
|
}) => {
|
|
58
|
-
const isDirtyProps =
|
|
61
|
+
const isDirtyProps = useEntitiesSavedStatesIsDirty();
|
|
59
62
|
let activateSaveLabel, successNoticeContent;
|
|
60
63
|
if (isDirtyProps.isDirty) {
|
|
61
64
|
activateSaveLabel = (0, import_i18n.__)("Activate & Save");
|
|
@@ -110,7 +113,7 @@ var _EntitiesSavedStates = ({ onClose, renderDialog, variant }) => {
|
|
|
110
113
|
);
|
|
111
114
|
}
|
|
112
115
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
113
|
-
|
|
116
|
+
EntitiesSavedStates,
|
|
114
117
|
{
|
|
115
118
|
close: onClose,
|
|
116
119
|
renderDialog,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/save-panel/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { NavigableRegion } from '@wordpress/admin-ui';\nimport { Button, Modal } from '@wordpress/components';\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,sBAAgC;AAChC,wBAA8B;AAC9B,
|
|
6
|
-
"names": ["routerPrivateApis", "coreStore", "editSiteStore", "clsx"]
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { NavigableRegion } from '@wordpress/admin-ui';\nimport { Button, Modal } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tstore as coreStore,\n\tprivateApis as coreDataPrivateApis,\n} from '@wordpress/core-data';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport { useActivateTheme } from '../../utils/use-activate-theme';\nimport { useActualCurrentTheme } from '../../utils/use-actual-current-theme';\nimport { isPreviewingTheme } from '../../utils/is-previewing-theme';\n\nconst { useLocation } = unlock( routerPrivateApis );\nconst {\n\tEntitiesSavedStatesExtensible,\n\tEntitiesSavedStates,\n\tuseEntitiesSavedStatesIsDirty,\n} = unlock( coreDataPrivateApis );\n\nconst EntitiesSavedStatesForPreview = ( {\n\tonClose,\n\trenderDialog,\n\tvariant,\n} ) => {\n\tconst isDirtyProps = useEntitiesSavedStatesIsDirty();\n\tlet activateSaveLabel, successNoticeContent;\n\tif ( isDirtyProps.isDirty ) {\n\t\tactivateSaveLabel = __( 'Activate & Save' );\n\t\tsuccessNoticeContent = __( 'Theme activated and site updated.' );\n\t} else {\n\t\tactivateSaveLabel = __( 'Activate' );\n\t\tsuccessNoticeContent = __( 'Theme activated.' );\n\t}\n\n\tconst currentTheme = useActualCurrentTheme();\n\n\tconst previewingTheme = useSelect(\n\t\t( select ) => select( coreStore ).getCurrentTheme(),\n\t\t[]\n\t);\n\n\tconst additionalPrompt = (\n\t\t<p>\n\t\t\t{ sprintf(\n\t\t\t\t/* translators: 1: The name of active theme, 2: The name of theme to be activated. */\n\t\t\t\t__(\n\t\t\t\t\t'Saving your changes will change your active theme from %1$s to %2$s.'\n\t\t\t\t),\n\t\t\t\tcurrentTheme?.name?.rendered ?? '...',\n\t\t\t\tpreviewingTheme?.name?.rendered ?? '...'\n\t\t\t) }\n\t\t</p>\n\t);\n\n\tconst activateTheme = useActivateTheme();\n\tconst onSave = async () => {\n\t\tawait activateTheme();\n\t};\n\n\treturn (\n\t\t<EntitiesSavedStatesExtensible\n\t\t\t{ ...{\n\t\t\t\t...isDirtyProps,\n\t\t\t\tadditionalPrompt,\n\t\t\t\tclose: onClose,\n\t\t\t\tonSave,\n\t\t\t\tsaveEnabled: true,\n\t\t\t\tsaveLabel: activateSaveLabel,\n\t\t\t\trenderDialog,\n\t\t\t\tvariant,\n\t\t\t\tsuccessNoticeContent,\n\t\t\t} }\n\t\t/>\n\t);\n};\n\nconst _EntitiesSavedStates = ( { onClose, renderDialog, variant } ) => {\n\tif ( isPreviewingTheme() ) {\n\t\treturn (\n\t\t\t<EntitiesSavedStatesForPreview\n\t\t\t\tonClose={ onClose }\n\t\t\t\trenderDialog={ renderDialog }\n\t\t\t\tvariant={ variant }\n\t\t\t/>\n\t\t);\n\t}\n\treturn (\n\t\t<EntitiesSavedStates\n\t\t\tclose={ onClose }\n\t\t\trenderDialog={ renderDialog }\n\t\t\tvariant={ variant }\n\t\t/>\n\t);\n};\n\nexport default function SavePanel() {\n\tconst { query } = useLocation();\n\tconst { canvas = 'view' } = query;\n\tconst { isSaveViewOpen, isDirty, isSaving } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\t__experimentalGetDirtyEntityRecords,\n\t\t\tisSavingEntityRecord,\n\t\t\tisResolving,\n\t\t} = select( coreStore );\n\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\tconst isActivatingTheme = isResolving( 'activateTheme' );\n\t\tconst { isSaveViewOpened } = unlock( select( editSiteStore ) );\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\tisSaveViewOpen: isSaveViewOpened(),\n\t\t\tisDirty: dirtyEntityRecords.length > 0,\n\t\t\tisSaving:\n\t\t\t\tdirtyEntityRecords.some( ( record ) =>\n\t\t\t\t\tisSavingEntityRecord( record.kind, record.name, record.key )\n\t\t\t\t) || isActivatingTheme,\n\t\t};\n\t}, [] );\n\tconst { setIsSaveViewOpened } = useDispatch( editSiteStore );\n\tconst onClose = () => setIsSaveViewOpened( false );\n\tuseEffect( () => {\n\t\tsetIsSaveViewOpened( false );\n\t}, [ canvas, setIsSaveViewOpened ] );\n\n\tif ( canvas === 'view' ) {\n\t\treturn isSaveViewOpen ? (\n\t\t\t<Modal\n\t\t\t\tclassName=\"edit-site-save-panel__modal\"\n\t\t\t\tonRequestClose={ onClose }\n\t\t\t\ttitle={ __( 'Review changes' ) }\n\t\t\t\tsize=\"small\"\n\t\t\t>\n\t\t\t\t<_EntitiesSavedStates onClose={ onClose } variant=\"inline\" />\n\t\t\t</Modal>\n\t\t) : null;\n\t}\n\tconst activateSaveEnabled = isPreviewingTheme() || isDirty;\n\tconst disabled = isSaving || ! activateSaveEnabled;\n\treturn (\n\t\t<NavigableRegion\n\t\t\tclassName={ clsx( 'edit-site-layout__actions', {\n\t\t\t\t'is-entity-save-view-open': isSaveViewOpen,\n\t\t\t} ) }\n\t\t\tariaLabel={ __( 'Save panel' ) }\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName={ clsx( 'edit-site-editor__toggle-save-panel', {\n\t\t\t\t\t'screen-reader-text': isSaveViewOpen,\n\t\t\t\t} ) }\n\t\t\t>\n\t\t\t\t<Button\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tclassName=\"edit-site-editor__toggle-save-panel-button\"\n\t\t\t\t\tonClick={ () => setIsSaveViewOpened( true ) }\n\t\t\t\t\taria-haspopup=\"dialog\"\n\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Open save panel' ) }\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t\t{ isSaveViewOpen && (\n\t\t\t\t<_EntitiesSavedStates onClose={ onClose } renderDialog />\n\t\t\t) }\n\t\t</NavigableRegion>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,sBAAgC;AAChC,wBA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K;AACnD,QAAM,WAAW,YAAY,CAAE;AAC/B,SACC;AAAA,IAAC;AAAA;AAAA,MACA,eAAY,YAAAC,SAAM,6BAA6B;AAAA,QAC9C,4BAA4B;AAAA,MAC7B,CAAE;AAAA,MACF,eAAY,gBAAI,YAAa;AAAA,MAE7B;AAAA;AAAA,UAAC;AAAA;AAAA,YACA,eAAY,YAAAA,SAAM,uCAAuC;AAAA,cACxD,sBAAsB;AAAA,YACvB,CAAE;AAAA,YAEF;AAAA,cAAC;AAAA;AAAA,gBACA,uBAAqB;AAAA,gBACrB,SAAQ;AAAA,gBACR,WAAU;AAAA,gBACV,SAAU,MAAM,oBAAqB,IAAK;AAAA,gBAC1C,iBAAc;AAAA,gBACd;AAAA,gBACA,wBAAsB;AAAA,gBAEpB,8BAAI,iBAAkB;AAAA;AAAA,YACzB;AAAA;AAAA,QACD;AAAA,QACE,kBACD,4CAAC,wBAAqB,SAAoB,cAAY,MAAC;AAAA;AAAA;AAAA,EAEzD;AAEF;",
|
|
6
|
+
"names": ["routerPrivateApis", "coreDataPrivateApis", "coreStore", "editSiteStore", "clsx"]
|
|
7
7
|
}
|
|
@@ -34,11 +34,11 @@ __export(sidebar_navigation_screen_patterns_exports, {
|
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(sidebar_navigation_screen_patterns_exports);
|
|
36
36
|
var import_components = require("@wordpress/components");
|
|
37
|
-
var import_editor = require("@wordpress/editor");
|
|
38
37
|
var import_element = require("@wordpress/element");
|
|
39
38
|
var import_i18n = require("@wordpress/i18n");
|
|
40
39
|
var import_icons = require("@wordpress/icons");
|
|
41
40
|
var import_router = require("@wordpress/router");
|
|
41
|
+
var import_core_data = require("@wordpress/core-data");
|
|
42
42
|
var import_views = require("@wordpress/views");
|
|
43
43
|
var import_sidebar_navigation_screen = __toESM(require("../sidebar-navigation-screen/index.cjs"));
|
|
44
44
|
var import_category_item = __toESM(require("./category-item.cjs"));
|
|
@@ -49,6 +49,7 @@ var import_lock_unlock = require("../../lock-unlock.cjs");
|
|
|
49
49
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
50
50
|
var VIEW_CONFIG_FIELDS = ["view_list"];
|
|
51
51
|
var { useLocation } = (0, import_lock_unlock.unlock)(import_router.privateApis);
|
|
52
|
+
var { getTemplatePartIcon } = (0, import_lock_unlock.unlock)(import_core_data.privateApis);
|
|
52
53
|
function CategoriesGroup({
|
|
53
54
|
templatePartViews,
|
|
54
55
|
patternViews,
|
|
@@ -62,7 +63,7 @@ function CategoriesGroup({
|
|
|
62
63
|
import_category_item.default,
|
|
63
64
|
{
|
|
64
65
|
count: templatePartCounts[view.slug],
|
|
65
|
-
icon:
|
|
66
|
+
icon: getTemplatePartIcon(
|
|
66
67
|
view.slug === import_constants.TEMPLATE_PART_ALL_AREAS_CATEGORY ? void 0 : view.slug
|
|
67
68
|
),
|
|
68
69
|
label: view.title,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/sidebar-navigation-screen-patterns/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalItem as Item,\n} from '@wordpress/components';\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAGO;AACP,
|
|
6
|
-
"names": ["routerPrivateApis", "ItemGroup", "CategoryItem", "useTemplatePartAreas", "usePatternCategories", "SidebarNavigationScreen", "Item"]
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalItem as Item,\n} from '@wordpress/components';\nimport { useMemo } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { file } from '@wordpress/icons';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { privateApis as coreDataPrivateApis } from '@wordpress/core-data';\nimport { useViewConfig } from '@wordpress/views';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport CategoryItem from './category-item';\nimport {\n\tPATTERN_DEFAULT_CATEGORY,\n\tPATTERN_TYPES,\n\tTEMPLATE_PART_POST_TYPE,\n\tTEMPLATE_PART_ALL_AREAS_CATEGORY,\n} from '../../utils/constants';\nimport usePatternCategories from './use-pattern-categories';\nimport useTemplatePartAreas from './use-template-part-areas';\nimport { unlock } from '../../lock-unlock';\n\nconst VIEW_CONFIG_FIELDS = [ 'view_list' ];\n\nconst { useLocation } = unlock( routerPrivateApis );\nconst { getTemplatePartIcon } = unlock( coreDataPrivateApis );\n\nfunction CategoriesGroup( {\n\ttemplatePartViews,\n\tpatternViews,\n\ttemplatePartCounts,\n\tpatternCounts,\n\tcurrentCategory,\n\tcurrentType,\n} ) {\n\treturn (\n\t\t<ItemGroup className=\"edit-site-sidebar-navigation-screen-patterns__group\">\n\t\t\t{ templatePartViews?.map( ( view ) => (\n\t\t\t\t<CategoryItem\n\t\t\t\t\tkey={ view.slug }\n\t\t\t\t\tcount={ templatePartCounts[ view.slug ] }\n\t\t\t\t\ticon={ getTemplatePartIcon(\n\t\t\t\t\t\tview.slug === TEMPLATE_PART_ALL_AREAS_CATEGORY\n\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t: view.slug\n\t\t\t\t\t) }\n\t\t\t\t\tlabel={ view.title }\n\t\t\t\t\tid={ view.slug }\n\t\t\t\t\ttype={ TEMPLATE_PART_POST_TYPE }\n\t\t\t\t\tisActive={\n\t\t\t\t\t\tcurrentCategory === view.slug &&\n\t\t\t\t\t\tcurrentType === TEMPLATE_PART_POST_TYPE\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t\t<div className=\"edit-site-sidebar-navigation-screen-patterns__divider\" />\n\t\t\t{ patternViews?.map( ( view ) => (\n\t\t\t\t<CategoryItem\n\t\t\t\t\tkey={ view.slug }\n\t\t\t\t\tcount={ patternCounts[ view.slug ] }\n\t\t\t\t\tlabel={ view.title }\n\t\t\t\t\ticon={ file }\n\t\t\t\t\tid={ view.slug }\n\t\t\t\t\ttype={ PATTERN_TYPES.user }\n\t\t\t\t\tisActive={\n\t\t\t\t\t\tcurrentCategory === `${ view.slug }` &&\n\t\t\t\t\t\tcurrentType === PATTERN_TYPES.user\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</ItemGroup>\n\t);\n}\n\nexport default function SidebarNavigationScreenPatterns( { backPath } ) {\n\tconst {\n\t\tquery: { postType = 'wp_block', categoryId },\n\t} = useLocation();\n\tconst currentCategory =\n\t\tcategoryId ||\n\t\t( postType === PATTERN_TYPES.user\n\t\t\t? PATTERN_DEFAULT_CATEGORY\n\t\t\t: TEMPLATE_PART_ALL_AREAS_CATEGORY );\n\n\tconst { view_list: templatePartViews } = useViewConfig( {\n\t\tkind: 'postType',\n\t\tname: TEMPLATE_PART_POST_TYPE,\n\t\tfields: VIEW_CONFIG_FIELDS,\n\t} );\n\tconst { view_list: patternViews } = useViewConfig( {\n\t\tkind: 'postType',\n\t\tname: PATTERN_TYPES.user,\n\t\tfields: VIEW_CONFIG_FIELDS,\n\t} );\n\n\tconst { templatePartAreas, isLoading, hasTemplateParts } =\n\t\tuseTemplatePartAreas();\n\tconst templatePartCounts = useMemo( () => {\n\t\tconst counts = { [ TEMPLATE_PART_ALL_AREAS_CATEGORY ]: 0 };\n\t\tObject.entries( templatePartAreas ).forEach(\n\t\t\t( [ area, { templateParts } ] ) => {\n\t\t\t\tconst count = templateParts?.length || 0;\n\t\t\t\tcounts[ area ] = count;\n\t\t\t\tcounts[ TEMPLATE_PART_ALL_AREAS_CATEGORY ] += count;\n\t\t\t}\n\t\t);\n\t\treturn counts;\n\t}, [ templatePartAreas ] );\n\tconst { patternCategories } = usePatternCategories();\n\tconst patternCounts = useMemo( () => {\n\t\tconst counts = {};\n\t\tpatternCategories.forEach( ( cat ) => {\n\t\t\tcounts[ cat.name ] = cat.count;\n\t\t} );\n\t\treturn counts;\n\t}, [ patternCategories ] );\n\n\tconst hasPatterns = patternCounts[ PATTERN_DEFAULT_CATEGORY ] > 0;\n\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\ttitle={ __( 'Patterns' ) }\n\t\t\tdescription={ __(\n\t\t\t\t'Manage what patterns are available when editing the site.'\n\t\t\t) }\n\t\t\tisRoot={ ! backPath }\n\t\t\tbackPath={ backPath }\n\t\t\tcontent={\n\t\t\t\t<>\n\t\t\t\t\t{ isLoading && __( 'Loading items…' ) }\n\t\t\t\t\t{ ! isLoading && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{ ! hasTemplateParts && ! hasPatterns && (\n\t\t\t\t\t\t\t\t<ItemGroup className=\"edit-site-sidebar-navigation-screen-patterns__group\">\n\t\t\t\t\t\t\t\t\t<Item>{ __( 'No items found' ) }</Item>\n\t\t\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<CategoriesGroup\n\t\t\t\t\t\t\t\ttemplatePartViews={ templatePartViews }\n\t\t\t\t\t\t\t\tpatternViews={ patternViews }\n\t\t\t\t\t\t\t\ttemplatePartCounts={ templatePartCounts }\n\t\t\t\t\t\t\t\tpatternCounts={ patternCounts }\n\t\t\t\t\t\t\t\tcurrentCategory={ currentCategory }\n\t\t\t\t\t\t\t\tcurrentType={ postType }\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</>\n\t\t\t}\n\t\t/>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAGO;AACP,qBAAwB;AACxB,kBAAmB;AACnB,mBAAqB;AACrB,oBAAiD;AACjD,uBAAmD;AACnD,mBAA8B;AAK9B,uCAAoC;AACpC,2BAAyB;AACzB,uBAKO;AACP,oCAA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;AAAA,YAAC;AAAA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA,aAAc;AAAA;AAAA,UACf;AAAA,WACD;AAAA,SAEF;AAAA;AAAA,EAEF;AAEF;",
|
|
6
|
+
"names": ["routerPrivateApis", "coreDataPrivateApis", "ItemGroup", "CategoryItem", "useTemplatePartAreas", "usePatternCategories", "SidebarNavigationScreen", "Item"]
|
|
7
7
|
}
|
|
@@ -42,11 +42,11 @@ var import_sidebar_navigation_screen_global_styles = __toESM(require("../sidebar
|
|
|
42
42
|
var import_sidebar_global_styles = __toESM(require("../sidebar-global-styles/index.cjs"));
|
|
43
43
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
44
44
|
var { useLocation, useHistory } = (0, import_lock_unlock.unlock)(import_router.privateApis);
|
|
45
|
-
var { StyleBookPreview } = (0, import_lock_unlock.unlock)(import_editor.privateApis);
|
|
46
|
-
function
|
|
45
|
+
var { StyleBookPreview, useGlobalStyles } = (0, import_lock_unlock.unlock)(import_editor.privateApis);
|
|
46
|
+
function StyleBookPreviewArea({ siteData }) {
|
|
47
47
|
const { path, query } = useLocation();
|
|
48
48
|
const history = useHistory();
|
|
49
|
-
const
|
|
49
|
+
const { user: userConfig } = useGlobalStyles();
|
|
50
50
|
const section = query.section ?? "/";
|
|
51
51
|
const onChangeSection = (updatedSection) => {
|
|
52
52
|
history.navigate(
|
|
@@ -55,15 +55,20 @@ function StylesPreviewArea({ siteData }) {
|
|
|
55
55
|
})
|
|
56
56
|
);
|
|
57
57
|
};
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
58
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
59
|
+
StyleBookPreview,
|
|
60
|
+
{
|
|
61
|
+
path: section,
|
|
62
|
+
onPathChange: onChangeSection,
|
|
63
|
+
settings: siteData.editorSettings,
|
|
64
|
+
userConfig
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
function StylesPreviewArea({ siteData }) {
|
|
69
|
+
const { query } = useLocation();
|
|
70
|
+
if (query.preview === "stylebook") {
|
|
71
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyleBookPreviewArea, { siteData });
|
|
67
72
|
}
|
|
68
73
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_editor2.default, {});
|
|
69
74
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/site-editor-routes/styles.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport Editor from '../editor';\nimport { unlock } from '../../lock-unlock';\nimport SidebarNavigationScreenGlobalStyles from '../sidebar-navigation-screen-global-styles';\nimport SidebarGlobalStyles from '../sidebar-global-styles';\n\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\nconst { StyleBookPreview } = unlock( editorPrivateApis );\n\nfunction
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAAiD;AACjD,oBAAiD;AACjD,iBAA6B;AAK7B,IAAAA,iBAAmB;AACnB,yBAAuB;AACvB,qDAAgD;AAChD,mCAAgC;
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport Editor from '../editor';\nimport { unlock } from '../../lock-unlock';\nimport SidebarNavigationScreenGlobalStyles from '../sidebar-navigation-screen-global-styles';\nimport SidebarGlobalStyles from '../sidebar-global-styles';\n\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\nconst { StyleBookPreview, useGlobalStyles } = unlock( editorPrivateApis );\n\nfunction StyleBookPreviewArea( { siteData } ) {\n\tconst { path, query } = useLocation();\n\tconst history = useHistory();\n\tconst { user: userConfig } = useGlobalStyles();\n\n\t// Get section from URL query params\n\tconst section = query.section ?? '/';\n\tconst onChangeSection = ( updatedSection ) => {\n\t\thistory.navigate(\n\t\t\taddQueryArgs( path, {\n\t\t\t\tsection: updatedSection,\n\t\t\t} )\n\t\t);\n\t};\n\n\treturn (\n\t\t<StyleBookPreview\n\t\t\tpath={ section }\n\t\t\tonPathChange={ onChangeSection }\n\t\t\tsettings={ siteData.editorSettings }\n\t\t\t// Without userConfig the preview falls back to the static `settings` styles and unsaved global styles edits are not shown.\n\t\t\tuserConfig={ userConfig }\n\t\t/>\n\t);\n}\n\nfunction StylesPreviewArea( { siteData } ) {\n\tconst { query } = useLocation();\n\n\tif ( query.preview === 'stylebook' ) {\n\t\treturn <StyleBookPreviewArea siteData={ siteData } />;\n\t}\n\n\treturn <Editor />;\n}\n\nexport const stylesRoute = {\n\tname: 'styles',\n\tpath: '/styles',\n\tareas: {\n\t\tcontent: <SidebarGlobalStyles />,\n\t\tsidebar: <SidebarNavigationScreenGlobalStyles backPath=\"/\" />,\n\t\tpreview: ( { siteData } ) => (\n\t\t\t<StylesPreviewArea siteData={ siteData } />\n\t\t),\n\t\tmobileContent: <SidebarGlobalStyles />,\n\t},\n\twidths: {\n\t\tcontent: 380,\n\t},\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAAiD;AACjD,oBAAiD;AACjD,iBAA6B;AAK7B,IAAAA,iBAAmB;AACnB,yBAAuB;AACvB,qDAAgD;AAChD,mCAAgC;AAqB9B;AAnBF,IAAM,EAAE,aAAa,WAAW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
// packages/edit-site/src/components/canvas-loader/index.js
|
|
2
|
-
import {
|
|
3
|
-
privateApis as componentsPrivateApis,
|
|
4
|
-
ProgressBar
|
|
5
|
-
} from "@wordpress/components";
|
|
2
|
+
import { ProgressBar } from "@wordpress/components";
|
|
6
3
|
import { store as coreStore } from "@wordpress/core-data";
|
|
7
4
|
import { useSelect } from "@wordpress/data";
|
|
8
5
|
import { privateApis as editorPrivateApis } from "@wordpress/editor";
|
|
9
6
|
import { unlock } from "../../lock-unlock.mjs";
|
|
10
7
|
import { jsx } from "react/jsx-runtime";
|
|
11
|
-
var { Theme } = unlock(componentsPrivateApis);
|
|
12
8
|
var { useStyle } = unlock(editorPrivateApis);
|
|
13
9
|
function CanvasLoader({ id }) {
|
|
14
10
|
const textColor = useStyle("color.text");
|
|
15
|
-
const backgroundColor = useStyle("color.background");
|
|
16
11
|
const { elapsed, total } = useSelect((select) => {
|
|
17
12
|
const selectorsByStatus = select(coreStore).countSelectorsByStatus();
|
|
18
13
|
const resolving = selectorsByStatus.resolving ?? 0;
|
|
@@ -22,7 +17,14 @@ function CanvasLoader({ id }) {
|
|
|
22
17
|
total: finished + resolving
|
|
23
18
|
};
|
|
24
19
|
}, []);
|
|
25
|
-
return /* @__PURE__ */ jsx(
|
|
20
|
+
return /* @__PURE__ */ jsx(
|
|
21
|
+
"div",
|
|
22
|
+
{
|
|
23
|
+
className: "edit-site-canvas-loader",
|
|
24
|
+
style: textColor ? { "--color": textColor } : void 0,
|
|
25
|
+
children: /* @__PURE__ */ jsx(ProgressBar, { id, max: total, value: elapsed })
|
|
26
|
+
}
|
|
27
|
+
);
|
|
26
28
|
}
|
|
27
29
|
export {
|
|
28
30
|
CanvasLoader as default
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/canvas-loader/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {
|
|
5
|
-
"mappings": ";AAGA
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { ProgressBar } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { useStyle } = unlock( editorPrivateApis );\n\nexport default function CanvasLoader( { id } ) {\n\tconst textColor = useStyle( 'color.text' );\n\tconst { elapsed, total } = useSelect( ( select ) => {\n\t\tconst selectorsByStatus = select( coreStore ).countSelectorsByStatus();\n\t\tconst resolving = selectorsByStatus.resolving ?? 0;\n\t\tconst finished = selectorsByStatus.finished ?? 0;\n\t\treturn {\n\t\t\telapsed: finished,\n\t\t\ttotal: finished + resolving,\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<div\n\t\t\tclassName=\"edit-site-canvas-loader\"\n\t\t\tstyle={ textColor ? { '--color': textColor } : undefined }\n\t\t>\n\t\t\t<ProgressBar id={ id } max={ total } value={ elapsed } />\n\t\t</div>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,mBAAmB;AAC5B,SAAS,SAAS,iBAAiB;AACnC,SAAS,iBAAiB;AAC1B,SAAS,eAAe,yBAAyB;AAKjD,SAAS,cAAc;AAqBpB;AAnBH,IAAM,EAAE,SAAS,IAAI,OAAQ,iBAAkB;AAEhC,SAAR,aAA+B,EAAE,GAAG,GAAI;AAC9C,QAAM,YAAY,SAAU,YAAa;AACzC,QAAM,EAAE,SAAS,MAAM,IAAI,UAAW,CAAE,WAAY;AACnD,UAAM,oBAAoB,OAAQ,SAAU,EAAE,uBAAuB;AACrE,UAAM,YAAY,kBAAkB,aAAa;AACjD,UAAM,WAAW,kBAAkB,YAAY;AAC/C,WAAO;AAAA,MACN,SAAS;AAAA,MACT,OAAO,WAAW;AAAA,IACnB;AAAA,EACD,GAAG,CAAC,CAAE;AAEN,SACC;AAAA,IAAC;AAAA;AAAA,MACA,WAAU;AAAA,MACV,OAAQ,YAAY,EAAE,WAAW,UAAU,IAAI;AAAA,MAE/C,8BAAC,eAAY,IAAU,KAAM,OAAQ,OAAQ,SAAU;AAAA;AAAA,EACxD;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
// packages/edit-site/src/components/editor/use-editor-title.js
|
|
2
2
|
import { _x, sprintf } from "@wordpress/i18n";
|
|
3
3
|
import { useSelect } from "@wordpress/data";
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
store as coreStore,
|
|
6
|
+
privateApis as coreDataPrivateApis
|
|
7
|
+
} from "@wordpress/core-data";
|
|
5
8
|
import { decodeEntities } from "@wordpress/html-entities";
|
|
6
|
-
import { privateApis as editorPrivateApis } from "@wordpress/editor";
|
|
7
9
|
import useTitle from "../routes/use-title.mjs";
|
|
8
10
|
import { POST_TYPE_LABELS, TEMPLATE_POST_TYPE } from "../../utils/constants.mjs";
|
|
9
11
|
import { unlock } from "../../lock-unlock.mjs";
|
|
10
|
-
var { getTemplateInfo } = unlock(
|
|
12
|
+
var { getTemplateInfo } = unlock(coreDataPrivateApis);
|
|
11
13
|
function useEditorTitle(postType, postId) {
|
|
12
14
|
const { title, isLoaded } = useSelect(
|
|
13
15
|
(select) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/editor/use-editor-title.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { _x, sprintf } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport {
|
|
5
|
-
"mappings": ";AAGA,SAAS,IAAI,eAAe;AAC5B,SAAS,iBAAiB;AAC1B,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { _x, sprintf } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport {\n\tstore as coreStore,\n\tprivateApis as coreDataPrivateApis,\n} from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport useTitle from '../routes/use-title';\nimport { POST_TYPE_LABELS, TEMPLATE_POST_TYPE } from '../../utils/constants';\nimport { unlock } from '../../lock-unlock';\n\nconst { getTemplateInfo } = unlock( coreDataPrivateApis );\n\nfunction useEditorTitle( postType, postId ) {\n\tconst { title, isLoaded } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetEditedEntityRecord,\n\t\t\t\tgetCurrentTheme,\n\t\t\t\thasFinishedResolution,\n\t\t\t} = select( coreStore );\n\n\t\t\tif ( ! postId ) {\n\t\t\t\treturn { isLoaded: false };\n\t\t\t}\n\n\t\t\tconst _record = getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId\n\t\t\t);\n\n\t\t\tconst { default_template_types: templateTypes = [] } =\n\t\t\t\tgetCurrentTheme() ?? {};\n\n\t\t\tconst templateInfo = getTemplateInfo( {\n\t\t\t\ttemplate: _record,\n\t\t\t\ttemplateTypes,\n\t\t\t} );\n\n\t\t\tconst _isLoaded = hasFinishedResolution( 'getEditedEntityRecord', [\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId,\n\t\t\t] );\n\n\t\t\treturn {\n\t\t\t\ttitle: templateInfo.title,\n\t\t\t\tisLoaded: _isLoaded,\n\t\t\t};\n\t\t},\n\t\t[ postType, postId ]\n\t);\n\n\tlet editorTitle;\n\tif ( isLoaded ) {\n\t\teditorTitle = sprintf(\n\t\t\t// translators: A breadcrumb trail for the Admin document title. 1: title of template being edited, 2: type of template (Template or Template Part).\n\t\t\t_x( '%1$s ‹ %2$s', 'breadcrumb trail' ),\n\t\t\tdecodeEntities( title ),\n\t\t\tPOST_TYPE_LABELS[ postType ] ??\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( isLoaded && editorTitle );\n}\n\nexport default useEditorTitle;\n"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,IAAI,eAAe;AAC5B,SAAS,iBAAiB;AAC1B;AAAA,EACC,SAAS;AAAA,EACT,eAAe;AAAA,OACT;AACP,SAAS,sBAAsB;AAK/B,OAAO,cAAc;AACrB,SAAS,kBAAkB,0BAA0B;AACrD,SAAS,cAAc;AAEvB,IAAM,EAAE,gBAAgB,IAAI,OAAQ,mBAAoB;AAExD,SAAS,eAAgB,UAAU,QAAS;AAC3C,QAAM,EAAE,OAAO,SAAS,IAAI;AAAA,IAC3B,CAAE,WAAY;AACb,YAAM;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,MACD,IAAI,OAAQ,SAAU;AAEtB,UAAK,CAAE,QAAS;AACf,eAAO,EAAE,UAAU,MAAM;AAAA,MAC1B;AAEA,YAAM,UAAU;AAAA,QACf;AAAA,QACA;AAAA,QACA;AAAA,MACD;AAEA,YAAM,EAAE,wBAAwB,gBAAgB,CAAC,EAAE,IAClD,gBAAgB,KAAK,CAAC;AAEvB,YAAM,eAAe,gBAAiB;AAAA,QACrC,UAAU;AAAA,QACV;AAAA,MACD,CAAE;AAEF,YAAM,YAAY,sBAAuB,yBAAyB;AAAA,QACjE;AAAA,QACA;AAAA,QACA;AAAA,MACD,CAAE;AAEF,aAAO;AAAA,QACN,OAAO,aAAa;AAAA,QACpB,UAAU;AAAA,MACX;AAAA,IACD;AAAA,IACA,CAAE,UAAU,MAAO;AAAA,EACpB;AAEA,MAAI;AACJ,MAAK,UAAW;AACf,kBAAc;AAAA;AAAA,MAEb,GAAI,eAAe,kBAAmB;AAAA,MACtC,eAAgB,KAAM;AAAA,MACtB,iBAAkB,QAAS,KAC1B,iBAAkB,kBAAmB;AAAA,IACvC;AAAA,EACD;AAIA,WAAU,YAAY,WAAY;AACnC;AAEA,IAAO,2BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
import { useSelect, useDispatch } from "@wordpress/data";
|
|
3
3
|
import { Button } from "@wordpress/components";
|
|
4
4
|
import { __, _n, sprintf } from "@wordpress/i18n";
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
store as coreStore,
|
|
7
|
+
privateApis as coreDataPrivateApis
|
|
8
|
+
} from "@wordpress/core-data";
|
|
6
9
|
import { displayShortcut } from "@wordpress/keycodes";
|
|
7
10
|
import { privateApis as routerPrivateApis } from "@wordpress/router";
|
|
8
|
-
import {
|
|
9
|
-
useEntitiesSavedStatesIsDirty,
|
|
10
|
-
store as editorStore
|
|
11
|
-
} from "@wordpress/editor";
|
|
12
11
|
import { store as editSiteStore } from "../../store/index.mjs";
|
|
13
12
|
import {
|
|
14
13
|
currentlyPreviewingTheme,
|
|
@@ -17,6 +16,7 @@ import {
|
|
|
17
16
|
import { unlock } from "../../lock-unlock.mjs";
|
|
18
17
|
import { jsx } from "react/jsx-runtime";
|
|
19
18
|
var { useLocation } = unlock(routerPrivateApis);
|
|
19
|
+
var { useEntitiesSavedStatesIsDirty } = unlock(coreDataPrivateApis);
|
|
20
20
|
function SaveButton({
|
|
21
21
|
className = "edit-site-save-button__button",
|
|
22
22
|
variant = "primary",
|
|
@@ -28,7 +28,7 @@ function SaveButton({
|
|
|
28
28
|
}) {
|
|
29
29
|
const { params } = useLocation();
|
|
30
30
|
const { setIsSaveViewOpened } = useDispatch(editSiteStore);
|
|
31
|
-
const { saveDirtyEntities } = unlock(useDispatch(
|
|
31
|
+
const { saveDirtyEntities } = unlock(useDispatch(coreStore));
|
|
32
32
|
const { dirtyEntityRecords } = useEntitiesSavedStatesIsDirty();
|
|
33
33
|
const { isSaving, isSaveViewOpen, previewingThemeName } = useSelect(
|
|
34
34
|
(select) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/save-button/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Button } from '@wordpress/components';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport {
|
|
5
|
-
"mappings": ";AAGA,SAAS,WAAW,mBAAmB;AACvC,SAAS,cAAc;AACvB,SAAS,IAAI,IAAI,eAAe;AAChC,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Button } from '@wordpress/components';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport {\n\tstore as coreStore,\n\tprivateApis as coreDataPrivateApis,\n} from '@wordpress/core-data';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport {\n\tcurrentlyPreviewingTheme,\n\tisPreviewingTheme,\n} from '../../utils/is-previewing-theme';\nimport { unlock } from '../../lock-unlock';\n\nconst { useLocation } = unlock( routerPrivateApis );\nconst { useEntitiesSavedStatesIsDirty } = unlock( coreDataPrivateApis );\n\nexport default function SaveButton( {\n\tclassName = 'edit-site-save-button__button',\n\tvariant = 'primary',\n\tshowTooltip = true,\n\tshowReviewMessage,\n\ticon,\n\tsize,\n\t__next40pxDefaultSize = false,\n} ) {\n\tconst { params } = useLocation();\n\tconst { setIsSaveViewOpened } = useDispatch( editSiteStore );\n\tconst { saveDirtyEntities } = unlock( useDispatch( coreStore ) );\n\tconst { dirtyEntityRecords } = useEntitiesSavedStatesIsDirty();\n\tconst { isSaving, isSaveViewOpen, previewingThemeName } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { isSavingEntityRecord, isResolving } = select( coreStore );\n\t\t\tconst { isSaveViewOpened } = select( editSiteStore );\n\t\t\tconst isActivatingTheme = isResolving( 'activateTheme' );\n\t\t\tconst currentlyPreviewingThemeId = currentlyPreviewingTheme();\n\t\t\treturn {\n\t\t\t\tisSaving:\n\t\t\t\t\tdirtyEntityRecords.some( ( record ) =>\n\t\t\t\t\t\tisSavingEntityRecord(\n\t\t\t\t\t\t\trecord.kind,\n\t\t\t\t\t\t\trecord.name,\n\t\t\t\t\t\t\trecord.key\n\t\t\t\t\t\t)\n\t\t\t\t\t) || isActivatingTheme,\n\t\t\t\tisSaveViewOpen: isSaveViewOpened(),\n\t\t\t\t// Do not call `getTheme` with null, it will cause a request to\n\t\t\t\t// the server.\n\t\t\t\tpreviewingThemeName: currentlyPreviewingThemeId\n\t\t\t\t\t? select( coreStore ).getTheme( currentlyPreviewingThemeId )\n\t\t\t\t\t\t\t?.name?.rendered\n\t\t\t\t\t: undefined,\n\t\t\t};\n\t\t},\n\t\t[ dirtyEntityRecords ]\n\t);\n\tconst hasDirtyEntities = !! dirtyEntityRecords.length;\n\tlet isOnlyCurrentEntityDirty;\n\t// Check if the current entity is the only entity with changes.\n\t// We have some extra logic for `wp_global_styles` for now, that\n\t// is used in navigation sidebar.\n\tif ( dirtyEntityRecords.length === 1 ) {\n\t\tif ( params.postId ) {\n\t\t\tisOnlyCurrentEntityDirty =\n\t\t\t\t`${ dirtyEntityRecords[ 0 ].key }` === params.postId &&\n\t\t\t\tdirtyEntityRecords[ 0 ].name === params.postType;\n\t\t} else if ( params.path?.includes( 'wp_global_styles' ) ) {\n\t\t\tisOnlyCurrentEntityDirty =\n\t\t\t\tdirtyEntityRecords[ 0 ].name === 'globalStyles';\n\t\t}\n\t}\n\tconst disabled =\n\t\tisSaving || ( ! hasDirtyEntities && ! isPreviewingTheme() );\n\tconst getLabel = () => {\n\t\tif ( isPreviewingTheme() ) {\n\t\t\tif ( isSaving ) {\n\t\t\t\treturn sprintf(\n\t\t\t\t\t/* translators: %s: The name of theme to be activated. */\n\t\t\t\t\t__( 'Activating %s' ),\n\t\t\t\t\tpreviewingThemeName\n\t\t\t\t);\n\t\t\t} else if ( disabled ) {\n\t\t\t\treturn __( 'Saved' );\n\t\t\t} else if ( hasDirtyEntities ) {\n\t\t\t\treturn sprintf(\n\t\t\t\t\t/* translators: %s: The name of theme to be activated. */\n\t\t\t\t\t__( 'Activate %s & Save' ),\n\t\t\t\t\tpreviewingThemeName\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn sprintf(\n\t\t\t\t/* translators: %s: The name of theme to be activated. */\n\t\t\t\t__( 'Activate %s' ),\n\t\t\t\tpreviewingThemeName\n\t\t\t);\n\t\t}\n\t\tif ( isSaving ) {\n\t\t\treturn __( 'Saving' );\n\t\t}\n\t\tif ( disabled ) {\n\t\t\treturn __( 'Saved' );\n\t\t}\n\t\tif ( ! isOnlyCurrentEntityDirty && showReviewMessage ) {\n\t\t\treturn sprintf(\n\t\t\t\t// translators: %d: number of unsaved changes (number).\n\t\t\t\t_n(\n\t\t\t\t\t'Review %d change…',\n\t\t\t\t\t'Review %d changes…',\n\t\t\t\t\tdirtyEntityRecords.length\n\t\t\t\t),\n\t\t\t\tdirtyEntityRecords.length\n\t\t\t);\n\t\t}\n\t\treturn __( 'Save' );\n\t};\n\tconst label = getLabel();\n\tconst onClick = isOnlyCurrentEntityDirty\n\t\t? () => saveDirtyEntities( { dirtyEntityRecords } )\n\t\t: () => setIsSaveViewOpened( true );\n\treturn (\n\t\t<Button\n\t\t\tvariant={ variant }\n\t\t\tclassName={ className }\n\t\t\taria-disabled={ disabled }\n\t\t\taria-expanded={ isSaveViewOpen }\n\t\t\tisBusy={ isSaving }\n\t\t\tonClick={ disabled ? undefined : onClick }\n\t\t\tlabel={ label }\n\t\t\t/*\n\t\t\t * We want the tooltip to show the keyboard shortcut only when the\n\t\t\t * button does something, i.e. when it's not disabled.\n\t\t\t */\n\t\t\tshortcut={ disabled ? undefined : displayShortcut.primary( 's' ) }\n\t\t\t/*\n\t\t\t * Displaying the keyboard shortcut conditionally makes the tooltip\n\t\t\t * itself show conditionally. This would trigger a full-rerendering\n\t\t\t * of the button that we want to avoid. By setting `showTooltip`,\n\t\t\t * the tooltip is always rendered even when there's no keyboard shortcut.\n\t\t\t */\n\t\t\tshowTooltip={ showTooltip }\n\t\t\ticon={ icon }\n\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\tsize={ size }\n\t\t>\n\t\t\t{ label }\n\t\t</Button>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,WAAW,mBAAmB;AACvC,SAAS,cAAc;AACvB,SAAS,IAAI,IAAI,eAAe;AAChC;AAAA,EACC,SAAS;AAAA,EACT,eAAe;AAAA,OACT;AACP,SAAS,uBAAuB;AAChC,SAAS,eAAe,yBAAyB;AAKjD,SAAS,SAAS,qBAAqB;AACvC;AAAA,EACC;AAAA,EACA;AAAA,OACM;AACP,SAAS,cAAc;AA4GrB;AA1GF,IAAM,EAAE,YAAY,IAAI,OAAQ,iBAAkB;AAClD,IAAM,EAAE,8BAA8B,IAAI,OAAQ,mBAAoB;AAEvD,SAAR,WAA6B;AAAA,EACnC,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,cAAc;AAAA,EACd;AAAA,EACA;AAAA,EACA;AAAA,EACA,wBAAwB;AACzB,GAAI;AACH,QAAM,EAAE,OAAO,IAAI,YAAY;AAC/B,QAAM,EAAE,oBAAoB,IAAI,YAAa,aAAc;AAC3D,QAAM,EAAE,kBAAkB,IAAI,OAAQ,YAAa,SAAU,CAAE;AAC/D,QAAM,EAAE,mBAAmB,IAAI,8BAA8B;AAC7D,QAAM,EAAE,UAAU,gBAAgB,oBAAoB,IAAI;AAAA,IACzD,CAAE,WAAY;AACb,YAAM,EAAE,sBAAsB,YAAY,IAAI,OAAQ,SAAU;AAChE,YAAM,EAAE,iBAAiB,IAAI,OAAQ,aAAc;AACnD,YAAM,oBAAoB,YAAa,eAAgB;AACvD,YAAM,6BAA6B,yBAAyB;AAC5D,aAAO;AAAA,QACN,UACC,mBAAmB;AAAA,UAAM,CAAE,WAC1B;AAAA,YACC,OAAO;AAAA,YACP,OAAO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