@wordpress/edit-site 6.50.0 → 6.50.1-next.v.202607070741.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/build/components/editor/index.cjs +33 -101
- package/build/components/editor/index.cjs.map +3 -3
- package/build/components/layout/index.cjs +12 -14
- package/build/components/layout/index.cjs.map +3 -3
- package/build/components/page-patterns/fields.cjs +0 -36
- package/build/components/page-patterns/fields.cjs.map +2 -2
- package/build/components/page-patterns/index.cjs +4 -15
- package/build/components/page-patterns/index.cjs.map +2 -2
- package/build/components/save-panel/index.cjs +1 -2
- package/build/components/save-panel/index.cjs.map +2 -2
- package/build/components/site-hub/index.cjs +24 -155
- package/build/components/site-hub/index.cjs.map +3 -3
- package/build/index.cjs +3 -1
- package/build/index.cjs.map +2 -2
- package/build-module/components/editor/index.mjs +36 -104
- package/build-module/components/editor/index.mjs.map +2 -2
- package/build-module/components/layout/index.mjs +12 -14
- package/build-module/components/layout/index.mjs.map +2 -2
- package/build-module/components/page-patterns/fields.mjs +2 -41
- package/build-module/components/page-patterns/fields.mjs.map +2 -2
- package/build-module/components/page-patterns/index.mjs +5 -16
- package/build-module/components/page-patterns/index.mjs.map +2 -2
- package/build-module/components/save-panel/index.mjs +1 -2
- package/build-module/components/save-panel/index.mjs.map +2 -2
- package/build-module/components/site-hub/index.mjs +27 -158
- package/build-module/components/site-hub/index.mjs.map +2 -2
- package/build-module/index.mjs +3 -1
- package/build-module/index.mjs.map +2 -2
- package/build-style/style-rtl.css +71 -189
- package/build-style/style.css +71 -189
- package/package.json +48 -48
- package/src/components/editor/index.js +18 -101
- package/src/components/editor/style.scss +8 -19
- package/src/components/layout/index.js +12 -15
- package/src/components/layout/style.scss +5 -7
- package/src/components/page-patterns/fields.js +2 -50
- package/src/components/page-patterns/index.js +5 -23
- package/src/components/page-patterns/style.scss +1 -1
- package/src/components/save-panel/index.js +1 -2
- package/src/components/sidebar/style.scss +2 -0
- package/src/components/sidebar-global-styles/style.scss +7 -4
- package/src/components/sidebar-navigation-screen/style.scss +1 -1
- package/src/components/site-hub/index.js +7 -141
- package/src/components/site-hub/style.scss +0 -72
- package/src/index.js +3 -1
- package/src/style.scss +14 -11
- package/build/components/site-icon/index.cjs +0 -73
- package/build/components/site-icon/index.cjs.map +0 -7
- package/build-module/components/site-icon/index.mjs +0 -42
- package/build-module/components/site-icon/index.mjs.map +0 -7
- package/build-style/experimental-omnibar-rtl.css +0 -103
- package/build-style/experimental-omnibar.css +0 -103
- package/src/components/site-icon/index.js +0 -51
- package/src/components/site-icon/style.scss +0 -41
- package/src/experimental-omnibar.scss +0 -75
|
@@ -78,9 +78,8 @@ var EntitiesSavedStatesForPreview = ({
|
|
|
78
78
|
previewingTheme?.name?.rendered ?? "..."
|
|
79
79
|
) });
|
|
80
80
|
const activateTheme = (0, import_use_activate_theme.useActivateTheme)();
|
|
81
|
-
const onSave = async (
|
|
81
|
+
const onSave = async () => {
|
|
82
82
|
await activateTheme();
|
|
83
|
-
return values;
|
|
84
83
|
};
|
|
85
84
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
86
85
|
EntitiesSavedStatesExtensible,
|
|
@@ -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 {\n\tEntitiesSavedStates,\n\tuseEntitiesSavedStatesIsDirty,\n\tprivateApis,\n} from '@wordpress/editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as coreStore } 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 { EntitiesSavedStatesExtensible } = unlock( privateApis );\nconst { useLocation } = unlock( routerPrivateApis );\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 (
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,sBAAgC;AAChC,wBAA8B;AAC9B,oBAIO;AACP,kBAAuC;AACvC,kBAA4B;AAC5B,uBAAmC;AACnC,oBAAiD;AACjD,qBAA0B;AAK1B,mBAAuC;AACvC,yBAAuB;AACvB,gCAAiC;AACjC,sCAAsC;AACtC,iCAAkC;AA4BhC;AA1BF,IAAM,EAAE,8BAA8B,QAAI,2BAAQ,yBAAY;AAC9D,IAAM,EAAE,YAAY,QAAI,2BAAQ,cAAAA,WAAkB;AAElD,IAAM,gCAAgC,CAAE;AAAA,EACvC;AAAA,EACA;AAAA,EACA;AACD,MAAO;AACN,QAAM,mBAAe,6CAA8B;AACnD,MAAI,mBAAmB;AACvB,MAAK,aAAa,SAAU;AAC3B,4BAAoB,gBAAI,iBAAkB;AAC1C,+BAAuB,gBAAI,mCAAoC;AAAA,EAChE,OAAO;AACN,4BAAoB,gBAAI,UAAW;AACnC,+BAAuB,gBAAI,kBAAmB;AAAA,EAC/C;AAEA,QAAM,mBAAe,uDAAsB;AAE3C,QAAM,sBAAkB;AAAA,IACvB,CAAE,WAAY,OAAQ,iBAAAC,KAAU,EAAE,gBAAgB;AAAA,IAClD,CAAC;AAAA,EACF;AAEA,QAAM,mBACL,4CAAC,OACE;AAAA;AAAA,QAED;AAAA,MACC;AAAA,IACD;AAAA,IACA,cAAc,MAAM,YAAY;AAAA,IAChC,iBAAiB,MAAM,YAAY;AAAA,EACpC,GACD;AAGD,QAAM,oBAAgB,4CAAiB;AACvC,QAAM,SAAS,
|
|
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 {\n\tEntitiesSavedStates,\n\tuseEntitiesSavedStatesIsDirty,\n\tprivateApis,\n} from '@wordpress/editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as coreStore } 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 { EntitiesSavedStatesExtensible } = unlock( privateApis );\nconst { useLocation } = unlock( routerPrivateApis );\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,wBAA8B;AAC9B,oBAIO;AACP,kBAAuC;AACvC,kBAA4B;AAC5B,uBAAmC;AACnC,oBAAiD;AACjD,qBAA0B;AAK1B,mBAAuC;AACvC,yBAAuB;AACvB,gCAAiC;AACjC,sCAAsC;AACtC,iCAAkC;AA4BhC;AA1BF,IAAM,EAAE,8BAA8B,QAAI,2BAAQ,yBAAY;AAC9D,IAAM,EAAE,YAAY,QAAI,2BAAQ,cAAAA,WAAkB;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,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
6
|
"names": ["routerPrivateApis", "coreStore", "editSiteStore", "clsx"]
|
|
7
7
|
}
|
|
@@ -30,8 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// packages/edit-site/src/components/site-hub/index.js
|
|
31
31
|
var site_hub_exports = {};
|
|
32
32
|
__export(site_hub_exports, {
|
|
33
|
-
SiteHubMobile: () => SiteHubMobile
|
|
34
|
-
default: () => site_hub_default
|
|
33
|
+
SiteHubMobile: () => SiteHubMobile
|
|
35
34
|
});
|
|
36
35
|
module.exports = __toCommonJS(site_hub_exports);
|
|
37
36
|
var import_clsx = __toESM(require("clsx"));
|
|
@@ -39,132 +38,36 @@ var import_data = require("@wordpress/data");
|
|
|
39
38
|
var import_components = require("@wordpress/components");
|
|
40
39
|
var import_i18n = require("@wordpress/i18n");
|
|
41
40
|
var import_core_data = require("@wordpress/core-data");
|
|
42
|
-
var import_html_entities = require("@wordpress/html-entities");
|
|
43
41
|
var import_element = require("@wordpress/element");
|
|
44
42
|
var import_icons = require("@wordpress/icons");
|
|
45
|
-
var import_commands = require("@wordpress/commands");
|
|
46
|
-
var import_keycodes = require("@wordpress/keycodes");
|
|
47
|
-
var import_ui = require("@wordpress/ui");
|
|
48
|
-
var import_url = require("@wordpress/url");
|
|
49
43
|
var import_router = require("@wordpress/router");
|
|
50
44
|
var import_store = require("../../store/index.cjs");
|
|
51
|
-
var import_site_icon = __toESM(require("../site-icon/index.cjs"));
|
|
52
45
|
var import_lock_unlock = require("../../lock-unlock.cjs");
|
|
53
46
|
var import_sidebar = require("../sidebar/index.cjs");
|
|
54
47
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
55
48
|
var { useLocation, useHistory } = (0, import_lock_unlock.unlock)(import_router.privateApis);
|
|
56
|
-
var SiteHub = (0, import_element.memo)(
|
|
57
|
-
(0, import_element.forwardRef)(({ isTransparent }, ref) => {
|
|
58
|
-
const { dashboardLink, homeUrl, siteTitle } = (0, import_data.useSelect)((select) => {
|
|
59
|
-
const { getSettings } = (0, import_lock_unlock.unlock)(select(import_store.store));
|
|
60
|
-
const { getEntityRecord } = select(import_core_data.store);
|
|
61
|
-
const _site = getEntityRecord("root", "site");
|
|
62
|
-
return {
|
|
63
|
-
dashboardLink: getSettings().__experimentalDashboardLink,
|
|
64
|
-
homeUrl: getEntityRecord("root", "__unstableBase")?.home,
|
|
65
|
-
siteTitle: !_site?.title && !!_site?.url ? (0, import_url.filterURLForDisplay)(_site?.url) : _site?.title
|
|
66
|
-
};
|
|
67
|
-
}, []);
|
|
68
|
-
const { open: openCommandCenter } = (0, import_data.useDispatch)(import_commands.store);
|
|
69
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "edit-site-site-hub", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalHStack, { justify: "flex-start", spacing: "0", children: [
|
|
70
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
71
|
-
"div",
|
|
72
|
-
{
|
|
73
|
-
className: (0, import_clsx.default)(
|
|
74
|
-
"edit-site-site-hub__view-mode-toggle-container",
|
|
75
|
-
{
|
|
76
|
-
"has-transparent-background": isTransparent
|
|
77
|
-
}
|
|
78
|
-
),
|
|
79
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
80
|
-
import_components.Button,
|
|
81
|
-
{
|
|
82
|
-
__next40pxDefaultSize: true,
|
|
83
|
-
ref,
|
|
84
|
-
href: dashboardLink,
|
|
85
|
-
label: (0, import_i18n.__)("Go to the Dashboard"),
|
|
86
|
-
className: "edit-site-layout__view-mode-toggle",
|
|
87
|
-
style: {
|
|
88
|
-
transform: "scale(0.5333) translateX(-4px)",
|
|
89
|
-
// Offset to position the icon 12px from viewport edge
|
|
90
|
-
borderRadius: 4
|
|
91
|
-
},
|
|
92
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_site_icon.default, { className: "edit-site-layout__view-mode-toggle-icon" })
|
|
93
|
-
}
|
|
94
|
-
)
|
|
95
|
-
}
|
|
96
|
-
),
|
|
97
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalHStack, { children: [
|
|
98
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "edit-site-site-hub__title", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
99
|
-
import_components.Button,
|
|
100
|
-
{
|
|
101
|
-
__next40pxDefaultSize: true,
|
|
102
|
-
variant: "link",
|
|
103
|
-
href: homeUrl,
|
|
104
|
-
target: "_blank",
|
|
105
|
-
children: [
|
|
106
|
-
(0, import_html_entities.decodeEntities)(siteTitle),
|
|
107
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.VisuallyHidden, {
|
|
108
|
-
render: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {}),
|
|
109
|
-
/* translators: accessibility text */
|
|
110
|
-
children: (0, import_i18n.__)("(opens in a new tab)")
|
|
111
|
-
})
|
|
112
|
-
]
|
|
113
|
-
}
|
|
114
|
-
) }),
|
|
115
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
116
|
-
import_components.__experimentalHStack,
|
|
117
|
-
{
|
|
118
|
-
spacing: 0,
|
|
119
|
-
expanded: false,
|
|
120
|
-
className: "edit-site-site-hub__actions",
|
|
121
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
122
|
-
import_components.Button,
|
|
123
|
-
{
|
|
124
|
-
size: "compact",
|
|
125
|
-
className: "edit-site-site-hub_toggle-command-center",
|
|
126
|
-
icon: import_icons.search,
|
|
127
|
-
onClick: () => openCommandCenter(),
|
|
128
|
-
label: (0, import_i18n.__)("Open command palette"),
|
|
129
|
-
shortcut: import_keycodes.displayShortcut.primary("k")
|
|
130
|
-
}
|
|
131
|
-
)
|
|
132
|
-
}
|
|
133
|
-
)
|
|
134
|
-
] })
|
|
135
|
-
] }) });
|
|
136
|
-
})
|
|
137
|
-
);
|
|
138
|
-
var site_hub_default = SiteHub;
|
|
139
49
|
var SiteHubMobile = (0, import_element.memo)(
|
|
140
50
|
(0, import_element.forwardRef)(({ isTransparent }, ref) => {
|
|
141
51
|
const { path } = useLocation();
|
|
142
52
|
const history = useHistory();
|
|
143
53
|
const { navigate } = (0, import_element.useContext)(import_sidebar.SidebarNavigationContext);
|
|
144
|
-
const hasAdminBarInEditor = window.__experimentalAdminBarInEditor;
|
|
145
54
|
const {
|
|
146
55
|
dashboardLink,
|
|
147
|
-
homeUrl,
|
|
148
|
-
siteTitle,
|
|
149
56
|
isBlockTheme,
|
|
150
57
|
isClassicThemeWithStyleBookSupport
|
|
151
58
|
} = (0, import_data.useSelect)((select) => {
|
|
152
59
|
const { getSettings } = (0, import_lock_unlock.unlock)(select(import_store.store));
|
|
153
|
-
const {
|
|
154
|
-
const _site = getEntityRecord("root", "site");
|
|
60
|
+
const { getCurrentTheme } = select(import_core_data.store);
|
|
155
61
|
const currentTheme = getCurrentTheme();
|
|
156
62
|
const settings = getSettings();
|
|
157
63
|
const supportsEditorStyles = currentTheme?.theme_supports["editor-styles"];
|
|
158
64
|
const hasThemeJson = settings.supportsLayout;
|
|
159
65
|
return {
|
|
160
66
|
dashboardLink: settings.__experimentalDashboardLink,
|
|
161
|
-
homeUrl: getEntityRecord("root", "__unstableBase")?.home,
|
|
162
|
-
siteTitle: !_site?.title && !!_site?.url ? (0, import_url.filterURLForDisplay)(_site?.url) : _site?.title,
|
|
163
67
|
isBlockTheme: currentTheme?.is_block_theme,
|
|
164
68
|
isClassicThemeWithStyleBookSupport: !currentTheme?.is_block_theme && (supportsEditorStyles || hasThemeJson)
|
|
165
69
|
};
|
|
166
70
|
}, []);
|
|
167
|
-
const { open: openCommandCenter } = (0, import_data.useDispatch)(import_commands.store);
|
|
168
71
|
let backPath;
|
|
169
72
|
if (path !== "/") {
|
|
170
73
|
if (isBlockTheme || isClassicThemeWithStyleBookSupport) {
|
|
@@ -181,71 +84,37 @@ var SiteHubMobile = (0, import_element.memo)(
|
|
|
181
84
|
navigate("back");
|
|
182
85
|
} : void 0
|
|
183
86
|
};
|
|
184
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "edit-site-site-hub", children: /* @__PURE__ */ (0, import_jsx_runtime.
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
"edit-site-site-hub__view-mode-toggle-container",
|
|
190
|
-
{
|
|
191
|
-
"has-transparent-background": isTransparent
|
|
192
|
-
}
|
|
193
|
-
),
|
|
194
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
195
|
-
import_components.Button,
|
|
196
|
-
{
|
|
197
|
-
__next40pxDefaultSize: true,
|
|
198
|
-
ref,
|
|
199
|
-
className: "edit-site-layout__view-mode-toggle",
|
|
200
|
-
style: {
|
|
201
|
-
transform: "scale(0.5)",
|
|
202
|
-
borderRadius: 4
|
|
203
|
-
},
|
|
204
|
-
...backButtonProps,
|
|
205
|
-
children: hasAdminBarInEditor ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
206
|
-
import_icons.Icon,
|
|
207
|
-
{
|
|
208
|
-
icon: (0, import_i18n.isRTL)() ? import_icons.arrowUpRight : import_icons.arrowUpLeft,
|
|
209
|
-
size: 48
|
|
210
|
-
}
|
|
211
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_site_icon.default, { className: "edit-site-layout__view-mode-toggle-icon" })
|
|
212
|
-
}
|
|
213
|
-
)
|
|
214
|
-
}
|
|
215
|
-
),
|
|
216
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalHStack, { children: [
|
|
217
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "edit-site-site-hub__title", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
218
|
-
import_components.Button,
|
|
87
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "edit-site-site-hub", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.__experimentalHStack, { justify: "flex-start", spacing: "0", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
88
|
+
"div",
|
|
89
|
+
{
|
|
90
|
+
className: (0, import_clsx.default)(
|
|
91
|
+
"edit-site-site-hub__view-mode-toggle-container",
|
|
219
92
|
{
|
|
220
|
-
|
|
221
|
-
variant: "link",
|
|
222
|
-
href: homeUrl,
|
|
223
|
-
target: "_blank",
|
|
224
|
-
label: (0, import_i18n.__)("View site (opens in a new tab)"),
|
|
225
|
-
children: (0, import_html_entities.decodeEntities)(siteTitle)
|
|
93
|
+
"has-transparent-background": isTransparent
|
|
226
94
|
}
|
|
227
|
-
)
|
|
228
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
229
|
-
import_components.
|
|
95
|
+
),
|
|
96
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
97
|
+
import_components.Button,
|
|
230
98
|
{
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
className: "edit-site-
|
|
99
|
+
__next40pxDefaultSize: true,
|
|
100
|
+
ref,
|
|
101
|
+
className: "edit-site-layout__view-mode-toggle",
|
|
102
|
+
style: {
|
|
103
|
+
transform: "scale(0.5)",
|
|
104
|
+
borderRadius: 4
|
|
105
|
+
},
|
|
106
|
+
...backButtonProps,
|
|
234
107
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
235
|
-
|
|
108
|
+
import_icons.Icon,
|
|
236
109
|
{
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
icon: import_icons.search,
|
|
240
|
-
onClick: () => openCommandCenter(),
|
|
241
|
-
label: (0, import_i18n.__)("Open command palette"),
|
|
242
|
-
shortcut: import_keycodes.displayShortcut.primary("k")
|
|
110
|
+
icon: (0, import_i18n.isRTL)() ? import_icons.chevronRight : import_icons.chevronLeft,
|
|
111
|
+
size: 48
|
|
243
112
|
}
|
|
244
113
|
)
|
|
245
114
|
}
|
|
246
115
|
)
|
|
247
|
-
|
|
248
|
-
|
|
116
|
+
}
|
|
117
|
+
) }) });
|
|
249
118
|
})
|
|
250
119
|
);
|
|
251
120
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/site-hub/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
6
|
-
"names": ["routerPrivateApis", "editSiteStore", "coreStore", "
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { Button, __experimentalHStack as HStack } from '@wordpress/components';\nimport { __, isRTL } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { memo, forwardRef, useContext } from '@wordpress/element';\nimport { Icon, chevronLeft, chevronRight } from '@wordpress/icons';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport { SidebarNavigationContext } from '../sidebar';\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\n\nexport const SiteHubMobile = memo(\n\tforwardRef( ( { isTransparent }, ref ) => {\n\t\tconst { path } = useLocation();\n\t\tconst history = useHistory();\n\t\tconst { navigate } = useContext( SidebarNavigationContext );\n\n\t\tconst {\n\t\t\tdashboardLink,\n\t\t\tisBlockTheme,\n\t\t\tisClassicThemeWithStyleBookSupport,\n\t\t} = useSelect( ( select ) => {\n\t\t\tconst { getSettings } = unlock( select( editSiteStore ) );\n\t\t\tconst { getCurrentTheme } = select( coreStore );\n\t\t\tconst currentTheme = getCurrentTheme();\n\t\t\tconst settings = getSettings();\n\t\t\tconst supportsEditorStyles =\n\t\t\t\tcurrentTheme?.theme_supports[ 'editor-styles' ];\n\t\t\t// This is a temp solution until the has_theme_json value is available for the current theme.\n\t\t\tconst hasThemeJson = settings.supportsLayout;\n\n\t\t\treturn {\n\t\t\t\tdashboardLink: settings.__experimentalDashboardLink,\n\t\t\t\tisBlockTheme: currentTheme?.is_block_theme,\n\t\t\t\tisClassicThemeWithStyleBookSupport:\n\t\t\t\t\t! currentTheme?.is_block_theme &&\n\t\t\t\t\t( supportsEditorStyles || hasThemeJson ),\n\t\t\t};\n\t\t}, [] );\n\n\t\tlet backPath;\n\n\t\t// If the current path is not the root page, find a page to back to.\n\t\tif ( path !== '/' ) {\n\t\t\tif ( isBlockTheme || isClassicThemeWithStyleBookSupport ) {\n\t\t\t\t// If the current theme is a block theme or a classic theme that supports StyleBook,\n\t\t\t\t// back to the Design screen.\n\t\t\t\tbackPath = '/';\n\t\t\t} else if ( path !== '/pattern' ) {\n\t\t\t\t// If the current theme is a classic theme that does not support StyleBook,\n\t\t\t\t// back to the Patterns page.\n\t\t\t\tbackPath = '/pattern';\n\t\t\t}\n\t\t}\n\n\t\tconst backButtonProps = {\n\t\t\thref: !! backPath ? undefined : dashboardLink,\n\t\t\tlabel: !! backPath\n\t\t\t\t? __( 'Go to Site Editor' )\n\t\t\t\t: __( 'Go to the Dashboard' ),\n\t\t\tonClick: !! backPath\n\t\t\t\t? () => {\n\t\t\t\t\t\thistory.navigate( backPath );\n\t\t\t\t\t\tnavigate( 'back' );\n\t\t\t\t }\n\t\t\t\t: undefined,\n\t\t};\n\n\t\treturn (\n\t\t\t<div className=\"edit-site-site-hub\">\n\t\t\t\t<HStack justify=\"flex-start\" spacing=\"0\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'edit-site-site-hub__view-mode-toggle-container',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'has-transparent-background': isTransparent,\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\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\tclassName=\"edit-site-layout__view-mode-toggle\"\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\ttransform: 'scale(0.5)',\n\t\t\t\t\t\t\t\tborderRadius: 4,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t{ ...backButtonProps }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\ticon={ isRTL() ? chevronRight : chevronLeft }\n\t\t\t\t\t\t\t\tsize={ 48 }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</div>\n\t\t\t\t</HStack>\n\t\t\t</div>\n\t\t);\n\t} )\n);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,kBAA0B;AAC1B,wBAAuD;AACvD,kBAA0B;AAC1B,uBAAmC;AACnC,qBAA6C;AAC7C,mBAAgD;AAChD,oBAAiD;AAKjD,mBAAuC;AACvC,yBAAuB;AACvB,qBAAyC;AAiFlC;AAhFP,IAAM,EAAE,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AAAA,UACA;AAAA,YACC,8BAA8B;AAAA,UAC/B;AAAA,QACD;AAAA,QAEA;AAAA,UAAC;AAAA;AAAA,YACA,uBAAqB;AAAA,YACrB;AAAA,YACA,WAAU;AAAA,YACV,OAAQ;AAAA,cACP,WAAW;AAAA,cACX,cAAc;AAAA,YACf;AAAA,YACE,GAAG;AAAA,YAEL;AAAA,cAAC;AAAA;AAAA,gBACA,UAAO,mBAAM,IAAI,4BAAe;AAAA,gBAChC,MAAO;AAAA;AAAA,YACR;AAAA;AAAA,QACD;AAAA;AAAA,IACD,GACD,GACD;AAAA,EAEF,CAAE;AACH;",
|
|
6
|
+
"names": ["routerPrivateApis", "editSiteStore", "coreStore", "HStack", "clsx"]
|
|
7
7
|
}
|
package/build/index.cjs
CHANGED
|
@@ -90,7 +90,9 @@ function initializeEditor(id, settings) {
|
|
|
90
90
|
showListViewByDefault: false,
|
|
91
91
|
enableChoosePatternModal: true,
|
|
92
92
|
showCollaborationCursor: false,
|
|
93
|
-
|
|
93
|
+
showCollaborationJoinNotifications: true,
|
|
94
|
+
showCollaborationLeaveNotifications: true,
|
|
95
|
+
showCollaborationPostSaveNotifications: true
|
|
94
96
|
});
|
|
95
97
|
if (window.__clientSideMediaProcessing) {
|
|
96
98
|
(0, import_data.dispatch)(import_preferences.store).setDefaults("core/media", {
|
package/build/index.cjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalGetCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport { dispatch } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { createRoot, StrictMode } from '@wordpress/element';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from './store';\nimport { unlock } from './lock-unlock';\nimport App from './components/app';\n\nconst { registerCoreBlockBindingsSources } = unlock( editorPrivateApis );\n\n/**\n * Initializes the site editor screen.\n *\n * @param {string} id ID of the root element to render the screen in.\n * @param {Object} settings Editor settings.\n */\nexport function initializeEditor( id, settings ) {\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tdispatch( blocksStore ).reapplyBlockTypeFilters();\n\tconst coreBlocks = __experimentalGetCoreBlocks().filter(\n\t\t( { name } ) => name !== 'core/freeform'\n\t);\n\tregisterCoreBlocks( coreBlocks );\n\tregisterCoreBlockBindingsSources();\n\tdispatch( blocksStore ).setFreeformFallbackBlockName( 'core/html' );\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tregisterWidgetGroupBlock( { inserter: false } );\n\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: true,\n\t\t} );\n\t}\n\n\t// We dispatch actions and update the store synchronously before rendering\n\t// so that we won't trigger unnecessary re-renders with useEffect.\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-site', {\n\t\twelcomeGuide: true,\n\t\twelcomeGuideStyles: true,\n\t\twelcomeGuidePage: true,\n\t\twelcomeGuideTemplate: true,\n\t} );\n\n\tdispatch( preferencesStore ).setDefaults( 'core', {\n\t\tallowRightClickOverrides: true,\n\t\tdistractionFree: false,\n\t\teditorMode: 'visual',\n\t\teditorTool: 'edit',\n\t\tfixedToolbar: false,\n\t\tfocusMode: false,\n\t\tinactivePanels: [],\n\t\tkeepCaretInsideBlock: false,\n\t\topenPanels: [ 'post-status' ],\n\t\tshowBlockBreadcrumbs: true,\n\t\tshowListViewByDefault: false,\n\t\tenableChoosePatternModal: true,\n\t\tshowCollaborationCursor: false,\n\t\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAAqC;AACrC,2BAIO;AACP,kBAAyB;AACzB,wBAAuB;AACvB,qBAAuC;AACvC,oBAAiD;AACjD,yBAA0C;AAC1C,qBAGO;AAKP,mBAAuC;AACvC,yBAAuB;AACvB,iBAAgB;
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalGetCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport { dispatch } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { createRoot, StrictMode } from '@wordpress/element';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from './store';\nimport { unlock } from './lock-unlock';\nimport App from './components/app';\n\nconst { registerCoreBlockBindingsSources } = unlock( editorPrivateApis );\n\n/**\n * Initializes the site editor screen.\n *\n * @param {string} id ID of the root element to render the screen in.\n * @param {Object} settings Editor settings.\n */\nexport function initializeEditor( id, settings ) {\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tdispatch( blocksStore ).reapplyBlockTypeFilters();\n\tconst coreBlocks = __experimentalGetCoreBlocks().filter(\n\t\t( { name } ) => name !== 'core/freeform'\n\t);\n\tregisterCoreBlocks( coreBlocks );\n\tregisterCoreBlockBindingsSources();\n\tdispatch( blocksStore ).setFreeformFallbackBlockName( 'core/html' );\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tregisterWidgetGroupBlock( { inserter: false } );\n\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: true,\n\t\t} );\n\t}\n\n\t// We dispatch actions and update the store synchronously before rendering\n\t// so that we won't trigger unnecessary re-renders with useEffect.\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-site', {\n\t\twelcomeGuide: true,\n\t\twelcomeGuideStyles: true,\n\t\twelcomeGuidePage: true,\n\t\twelcomeGuideTemplate: true,\n\t} );\n\n\tdispatch( preferencesStore ).setDefaults( 'core', {\n\t\tallowRightClickOverrides: true,\n\t\tdistractionFree: false,\n\t\teditorMode: 'visual',\n\t\teditorTool: 'edit',\n\t\tfixedToolbar: false,\n\t\tfocusMode: false,\n\t\tinactivePanels: [],\n\t\tkeepCaretInsideBlock: false,\n\t\topenPanels: [ 'post-status' ],\n\t\tshowBlockBreadcrumbs: true,\n\t\tshowListViewByDefault: false,\n\t\tenableChoosePatternModal: true,\n\t\tshowCollaborationCursor: false,\n\t\tshowCollaborationJoinNotifications: true,\n\t\tshowCollaborationLeaveNotifications: true,\n\t\tshowCollaborationPostSaveNotifications: true,\n\t} );\n\n\tif ( window.__clientSideMediaProcessing ) {\n\t\tdispatch( preferencesStore ).setDefaults( 'core/media', {\n\t\t\trequireApproval: true,\n\t\t\toptimizeOnUpload: true,\n\t\t} );\n\t}\n\n\tdispatch( editSiteStore ).updateSettings( settings );\n\n\t// Prevent the default browser action for files dropped outside of dropzones.\n\twindow.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );\n\twindow.addEventListener( 'drop', ( e ) => e.preventDefault(), false );\n\n\troot.render(\n\t\t<StrictMode>\n\t\t\t<App />\n\t\t</StrictMode>\n\t);\n\n\treturn root;\n}\n\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editSite.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\nexport { default as PluginTemplateSettingPanel } from './components/plugin-template-setting-panel';\nexport { store } from './store';\nexport * from './deprecated';\n"],
|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ACtB,YAAY,CAAE,aAAc;AAAA,IAC5B,sBAAsB;AAAA,IACtB,uBAAuB;AAAA,IACvB,0BAA0B;AAAA,IAC1B,yBAAyB;AAAA,IACzB,oCAAoC;AAAA,IACpC,qCAAqC;AAAA,IACrC,wCAAwC;AAAA,EACzC,CAAE;AAEF,MAAK,OAAO,6BAA8B;AACzC,8BAAU,mBAAAA,KAAiB,EAAE,YAAa,cAAc;AAAA,MACvD,iBAAiB;AAAA,MACjB,kBAAkB;AAAA,IACnB,CAAE;AAAA,EACH;AAEA,4BAAU,aAAAC,KAAc,EAAE,eAAgB,QAAS;AAGnD,SAAO,iBAAkB,YAAY,CAAE,MAAO,EAAE,eAAe,GAAG,KAAM;AACxE,SAAO,iBAAkB,QAAQ,CAAE,MAAO,EAAE,eAAe,GAAG,KAAM;AAEpE,OAAK;AAAA,IACJ,4CAAC,6BACA,sDAAC,WAAAC,SAAA,EAAI,GACN;AAAA,EACD;AAEA,SAAO;AACR;AAEO,SAAS,qBAAqB;AACpC,wBAAAC,SAAY,kCAAkC;AAAA,IAC7C,OAAO;AAAA,IACP,SAAS;AAAA,EACV,CAAE;AACH;",
|
|
6
6
|
"names": ["import_store", "editorPrivateApis", "blocksStore", "preferencesStore", "editSiteStore", "App", "deprecated"]
|
|
7
7
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
// packages/edit-site/src/components/editor/index.js
|
|
2
|
-
import clsx from "clsx";
|
|
3
2
|
import { useDispatch, useSelect } from "@wordpress/data";
|
|
4
|
-
import { Button
|
|
5
|
-
import { useInstanceId
|
|
3
|
+
import { Button } from "@wordpress/components";
|
|
4
|
+
import { useInstanceId } from "@wordpress/compose";
|
|
6
5
|
import {
|
|
7
6
|
EditorKeyboardShortcutsRegister,
|
|
8
7
|
privateApis as editorPrivateApis,
|
|
@@ -15,7 +14,7 @@ import { useCallback } from "@wordpress/element";
|
|
|
15
14
|
import { store as noticesStore } from "@wordpress/notices";
|
|
16
15
|
import { privateApis as routerPrivateApis } from "@wordpress/router";
|
|
17
16
|
import { decodeEntities } from "@wordpress/html-entities";
|
|
18
|
-
import { Icon,
|
|
17
|
+
import { Icon, chevronLeft, chevronRight } from "@wordpress/icons";
|
|
19
18
|
import { store as blockEditorStore } from "@wordpress/block-editor";
|
|
20
19
|
import { addQueryArgs } from "@wordpress/url";
|
|
21
20
|
import WelcomeGuide from "../welcome-guide/index.mjs";
|
|
@@ -27,7 +26,6 @@ import { isPreviewingTheme } from "../../utils/is-previewing-theme.mjs";
|
|
|
27
26
|
import SaveButton from "../save-button/index.mjs";
|
|
28
27
|
import SavePanel from "../save-panel/index.mjs";
|
|
29
28
|
import SiteEditorMoreMenu from "../more-menu/index.mjs";
|
|
30
|
-
import SiteIcon from "../site-icon/index.mjs";
|
|
31
29
|
import useEditorIframeProps from "../block-editor/use-editor-iframe-props.mjs";
|
|
32
30
|
import { ViewportSync } from "../block-editor/use-viewport-sync.mjs";
|
|
33
31
|
import useEditorTitle from "./use-editor-title.mjs";
|
|
@@ -42,28 +40,6 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
42
40
|
var { Editor, BackButton } = unlock(editorPrivateApis);
|
|
43
41
|
var { useHistory, useLocation } = unlock(routerPrivateApis);
|
|
44
42
|
var { BlockKeyboardShortcuts } = unlock(blockLibraryPrivateApis);
|
|
45
|
-
var toggleHomeIconVariants = {
|
|
46
|
-
edit: {
|
|
47
|
-
opacity: 0,
|
|
48
|
-
scale: 0.2
|
|
49
|
-
},
|
|
50
|
-
hover: {
|
|
51
|
-
opacity: 1,
|
|
52
|
-
scale: 1,
|
|
53
|
-
clipPath: "inset( 22% round 2px )"
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
var siteIconVariants = {
|
|
57
|
-
edit: {
|
|
58
|
-
clipPath: "inset(0% round 0px)"
|
|
59
|
-
},
|
|
60
|
-
hover: {
|
|
61
|
-
clipPath: "inset( 22% round 2px )"
|
|
62
|
-
},
|
|
63
|
-
tap: {
|
|
64
|
-
clipPath: "inset(0% round 0px)"
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
43
|
function getListPathForPostType(postType) {
|
|
68
44
|
switch (postType) {
|
|
69
45
|
case "navigation":
|
|
@@ -96,7 +72,6 @@ function getNavigationPath(location, postType) {
|
|
|
96
72
|
return addQueryArgs(path, { canvas: void 0 });
|
|
97
73
|
}
|
|
98
74
|
function EditSiteEditor({ isHomeRoute = false }) {
|
|
99
|
-
const disableMotion = useReducedMotion();
|
|
100
75
|
const location = useLocation();
|
|
101
76
|
const history = useHistory();
|
|
102
77
|
const { canvas = "view" } = location.query;
|
|
@@ -105,14 +80,10 @@ function EditSiteEditor({ isHomeRoute = false }) {
|
|
|
105
80
|
const entity = useResolveEditedEntity();
|
|
106
81
|
useSyncDeprecatedEntityIntoState(entity);
|
|
107
82
|
const { postType, postId, context } = entity;
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
isBlockBasedTheme: getCurrentTheme()?.is_block_theme,
|
|
113
|
-
hasSiteIcon: !!siteData?.site_icon_url
|
|
114
|
-
};
|
|
115
|
-
}, []);
|
|
83
|
+
const isBlockBasedTheme = useSelect(
|
|
84
|
+
(select) => select(coreDataStore).getCurrentTheme()?.is_block_theme,
|
|
85
|
+
[]
|
|
86
|
+
);
|
|
116
87
|
const postWithTemplate = !!context?.postId;
|
|
117
88
|
useEditorTitle(
|
|
118
89
|
postWithTemplate ? context.postType : postType,
|
|
@@ -180,10 +151,6 @@ function EditSiteEditor({ isHomeRoute = false }) {
|
|
|
180
151
|
]
|
|
181
152
|
);
|
|
182
153
|
const isReady = !isLoading;
|
|
183
|
-
const transition = {
|
|
184
|
-
duration: disableMotion ? 0 : 0.2
|
|
185
|
-
};
|
|
186
|
-
const hasAdminBarInEditor = window.__experimentalAdminBarInEditor;
|
|
187
154
|
return !isBlockBasedTheme && isHomeRoute ? /* @__PURE__ */ jsx(SitePreview, {}) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
188
155
|
/* @__PURE__ */ jsx(EditorKeyboardShortcutsRegister, {}),
|
|
189
156
|
isEditMode && /* @__PURE__ */ jsx(BlockKeyboardShortcuts, {}),
|
|
@@ -209,71 +176,36 @@ function EditSiteEditor({ isHomeRoute = false }) {
|
|
|
209
176
|
extraSidebarPanels: !postWithTemplate && /* @__PURE__ */ jsx(PluginTemplateSettingPanel.Slot, {}),
|
|
210
177
|
children: [
|
|
211
178
|
isEditMode && /* @__PURE__ */ jsx(ViewportSync, {}),
|
|
212
|
-
isEditMode && /* @__PURE__ */ jsx(BackButton, { children: ({ length }) => length <= 1 && /* @__PURE__ */ jsxs(
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
showTooltip: true,
|
|
228
|
-
tooltipPosition: "middle right",
|
|
229
|
-
onClick: () => {
|
|
230
|
-
resetZoomLevel();
|
|
231
|
-
setCurrentRevisionId(null);
|
|
232
|
-
history.navigate(
|
|
233
|
-
getNavigationPath(
|
|
234
|
-
location,
|
|
235
|
-
postWithTemplate ? context.postType : postType
|
|
236
|
-
),
|
|
237
|
-
{
|
|
238
|
-
transition: "canvas-mode-view-transition"
|
|
239
|
-
}
|
|
240
|
-
);
|
|
241
|
-
},
|
|
242
|
-
children: !hasAdminBarInEditor && /* @__PURE__ */ jsx(
|
|
243
|
-
motion.div,
|
|
244
|
-
{
|
|
245
|
-
variants: !disableMotion && siteIconVariants,
|
|
246
|
-
children: /* @__PURE__ */ jsx(SiteIcon, { className: "edit-site-editor__view-mode-toggle-icon" })
|
|
247
|
-
}
|
|
248
|
-
)
|
|
249
|
-
}
|
|
250
|
-
),
|
|
251
|
-
hasAdminBarInEditor ? /* @__PURE__ */ jsx("div", { className: "edit-site-editor__back-icon", children: /* @__PURE__ */ jsx(
|
|
252
|
-
Icon,
|
|
253
|
-
{
|
|
254
|
-
icon: isRTL() ? arrowUpRight : arrowUpLeft
|
|
255
|
-
}
|
|
256
|
-
) }) : /* @__PURE__ */ jsx(
|
|
257
|
-
motion.div,
|
|
258
|
-
{
|
|
259
|
-
className: clsx(
|
|
260
|
-
"edit-site-editor__back-icon",
|
|
261
|
-
{
|
|
262
|
-
"has-site-icon": hasSiteIcon
|
|
263
|
-
}
|
|
179
|
+
isEditMode && /* @__PURE__ */ jsx(BackButton, { children: ({ length }) => length <= 1 && /* @__PURE__ */ jsxs("div", { className: "edit-site-editor__view-mode-toggle", children: [
|
|
180
|
+
/* @__PURE__ */ jsx(
|
|
181
|
+
Button,
|
|
182
|
+
{
|
|
183
|
+
__next40pxDefaultSize: true,
|
|
184
|
+
label: __("Open Navigation"),
|
|
185
|
+
showTooltip: true,
|
|
186
|
+
tooltipPosition: "middle right",
|
|
187
|
+
onClick: () => {
|
|
188
|
+
resetZoomLevel();
|
|
189
|
+
setCurrentRevisionId(null);
|
|
190
|
+
history.navigate(
|
|
191
|
+
getNavigationPath(
|
|
192
|
+
location,
|
|
193
|
+
postWithTemplate ? context.postType : postType
|
|
264
194
|
),
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
195
|
+
{
|
|
196
|
+
transition: "canvas-mode-view-transition"
|
|
197
|
+
}
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
),
|
|
202
|
+
/* @__PURE__ */ jsx("div", { className: "edit-site-editor__back-icon", children: /* @__PURE__ */ jsx(
|
|
203
|
+
Icon,
|
|
204
|
+
{
|
|
205
|
+
icon: isRTL() ? chevronRight : chevronLeft
|
|
206
|
+
}
|
|
207
|
+
) })
|
|
208
|
+
] }) }),
|
|
277
209
|
/* @__PURE__ */ jsx(SiteEditorMoreMenu, {})
|
|
278
210
|
]
|
|
279
211
|
}
|