@wordpress/edit-site 7.3.2-next.v.202608281122.0 → 7.4.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 +17 -1
- package/build/components/add-new-template/add-custom-template-modal-content.cjs +3 -1
- package/build/components/add-new-template/add-custom-template-modal-content.cjs.map +2 -2
- package/build/components/add-new-template/index.cjs +6 -4
- package/build/components/add-new-template/index.cjs.map +2 -2
- package/build/components/add-new-template/utils.cjs +84 -9
- package/build/components/add-new-template/utils.cjs.map +2 -2
- package/build/components/dataviews-actions/index.cjs +2 -55
- package/build/components/dataviews-actions/index.cjs.map +3 -3
- package/build/components/layout/index.cjs +2 -2
- package/build/components/layout/index.cjs.map +2 -2
- package/build/components/more-menu/welcome-guide-menu-item.cjs +10 -2
- package/build/components/more-menu/welcome-guide-menu-item.cjs.map +3 -3
- package/build/components/page-templates/fields.cjs +2 -126
- package/build/components/page-templates/fields.cjs.map +3 -3
- package/build/components/page-templates/index.cjs +46 -230
- package/build/components/page-templates/index.cjs.map +3 -3
- package/build/components/post-list/index.cjs +7 -17
- package/build/components/post-list/index.cjs.map +2 -2
- package/build/components/sidebar-global-styles/index.cjs +2 -2
- package/build/components/sidebar-global-styles/index.cjs.map +2 -2
- package/build/components/sidebar-identity/index.cjs +17 -22
- package/build/components/sidebar-identity/index.cjs.map +2 -2
- package/build/components/sidebar-navigation-item/index.cjs +1 -8
- package/build/components/sidebar-navigation-item/index.cjs.map +2 -2
- package/build/components/sidebar-navigation-screen-templates-browse/content.cjs +34 -72
- package/build/components/sidebar-navigation-screen-templates-browse/content.cjs.map +3 -3
- package/build/components/sidebar-navigation-screen-templates-browse/index.cjs +1 -2
- package/build/components/sidebar-navigation-screen-templates-browse/index.cjs.map +3 -3
- package/build/components/site-editor-routes/templates.cjs +2 -4
- package/build/components/site-editor-routes/templates.cjs.map +3 -3
- package/build/index.cjs +0 -1
- package/build/index.cjs.map +2 -2
- package/build-module/components/add-new-template/add-custom-template-modal-content.mjs +3 -1
- package/build-module/components/add-new-template/add-custom-template-modal-content.mjs.map +2 -2
- package/build-module/components/add-new-template/index.mjs +7 -4
- package/build-module/components/add-new-template/index.mjs.map +2 -2
- package/build-module/components/add-new-template/utils.mjs +84 -9
- package/build-module/components/add-new-template/utils.mjs.map +2 -2
- package/build-module/components/dataviews-actions/index.mjs +1 -53
- package/build-module/components/dataviews-actions/index.mjs.map +2 -2
- package/build-module/components/layout/index.mjs +2 -2
- package/build-module/components/layout/index.mjs.map +2 -2
- package/build-module/components/more-menu/welcome-guide-menu-item.mjs +10 -2
- package/build-module/components/more-menu/welcome-guide-menu-item.mjs.map +2 -2
- package/build-module/components/page-templates/fields.mjs +3 -129
- package/build-module/components/page-templates/fields.mjs.map +3 -3
- package/build-module/components/page-templates/index.mjs +52 -253
- package/build-module/components/page-templates/index.mjs.map +2 -2
- package/build-module/components/post-list/index.mjs +8 -18
- package/build-module/components/post-list/index.mjs.map +2 -2
- package/build-module/components/sidebar-global-styles/index.mjs +2 -2
- package/build-module/components/sidebar-global-styles/index.mjs.map +2 -2
- package/build-module/components/sidebar-identity/index.mjs +17 -22
- package/build-module/components/sidebar-identity/index.mjs.map +2 -2
- package/build-module/components/sidebar-navigation-item/index.mjs +1 -8
- package/build-module/components/sidebar-navigation-item/index.mjs.map +2 -2
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.mjs +42 -75
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.mjs.map +2 -2
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.mjs +1 -2
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.mjs.map +2 -2
- package/build-module/components/site-editor-routes/templates.mjs +2 -4
- package/build-module/components/site-editor-routes/templates.mjs.map +2 -2
- package/build-module/index.mjs +0 -1
- package/build-module/index.mjs.map +2 -2
- package/build-style/style-rtl.css +38 -81
- package/build-style/style.css +38 -81
- package/package.json +41 -38
- package/src/components/add-new-template/add-custom-template-modal-content.jsx +3 -1
- package/src/components/add-new-template/index.jsx +9 -4
- package/src/components/add-new-template/style.scss +8 -21
- package/src/components/add-new-template/utils.js +118 -9
- package/src/components/dataviews-actions/index.js +0 -61
- package/src/components/layout/index.jsx +5 -2
- package/src/components/more-menu/welcome-guide-menu-item.jsx +8 -3
- package/src/components/page-templates/fields.jsx +2 -146
- package/src/components/page-templates/index.jsx +30 -256
- package/src/components/post-list/index.jsx +7 -20
- package/src/components/sidebar-global-styles/index.jsx +7 -5
- package/src/components/sidebar-global-styles/style.scss +6 -0
- package/src/components/sidebar-identity/index.jsx +23 -19
- package/src/components/sidebar-identity/style.scss +7 -0
- package/src/components/sidebar-navigation-item/index.jsx +1 -7
- package/src/components/sidebar-navigation-screen-templates-browse/content.jsx +45 -80
- package/src/components/sidebar-navigation-screen-templates-browse/index.jsx +1 -8
- package/src/components/site-editor-routes/templates.jsx +2 -19
- package/src/components/welcome-guide/style.scss +1 -1
- package/src/index.jsx +0 -1
- package/src/style.scss +1 -1
- package/src/utils/test/get-filtered-template-parts.js +1 -0
- package/build/components/add-new-template-legacy/add-custom-generic-template-modal-content.cjs +0 -107
- package/build/components/add-new-template-legacy/add-custom-generic-template-modal-content.cjs.map +0 -7
- package/build/components/add-new-template-legacy/add-custom-template-modal-content.cjs +0 -327
- package/build/components/add-new-template-legacy/add-custom-template-modal-content.cjs.map +0 -7
- package/build/components/add-new-template-legacy/index.cjs +0 -390
- package/build/components/add-new-template-legacy/index.cjs.map +0 -7
- package/build/components/add-new-template-legacy/utils.cjs +0 -623
- package/build/components/add-new-template-legacy/utils.cjs.map +0 -7
- package/build/components/page-templates/hooks.cjs +0 -94
- package/build/components/page-templates/hooks.cjs.map +0 -7
- package/build/components/page-templates/index-legacy.cjs +0 -167
- package/build/components/page-templates/index-legacy.cjs.map +0 -7
- package/build/components/page-templates/view-utils.cjs +0 -79
- package/build/components/page-templates/view-utils.cjs.map +0 -7
- package/build/components/sidebar-navigation-screen-templates-browse/content-legacy.cjs +0 -78
- package/build/components/sidebar-navigation-screen-templates-browse/content-legacy.cjs.map +0 -7
- package/build-module/components/add-new-template-legacy/add-custom-generic-template-modal-content.mjs +0 -91
- package/build-module/components/add-new-template-legacy/add-custom-generic-template-modal-content.mjs.map +0 -7
- package/build-module/components/add-new-template-legacy/add-custom-template-modal-content.mjs +0 -315
- package/build-module/components/add-new-template-legacy/add-custom-template-modal-content.mjs.map +0 -7
- package/build-module/components/add-new-template-legacy/index.mjs +0 -391
- package/build-module/components/add-new-template-legacy/index.mjs.map +0 -7
- package/build-module/components/add-new-template-legacy/utils.mjs +0 -592
- package/build-module/components/add-new-template-legacy/utils.mjs.map +0 -7
- package/build-module/components/page-templates/hooks.mjs +0 -74
- package/build-module/components/page-templates/hooks.mjs.map +0 -7
- package/build-module/components/page-templates/index-legacy.mjs +0 -136
- package/build-module/components/page-templates/index-legacy.mjs.map +0 -7
- package/build-module/components/page-templates/view-utils.mjs +0 -52
- package/build-module/components/page-templates/view-utils.mjs.map +0 -7
- package/build-module/components/sidebar-navigation-screen-templates-browse/content-legacy.mjs +0 -52
- package/build-module/components/sidebar-navigation-screen-templates-browse/content-legacy.mjs.map +0 -7
- package/src/components/add-new-template-legacy/add-custom-generic-template-modal-content.jsx +0 -85
- package/src/components/add-new-template-legacy/add-custom-template-modal-content.jsx +0 -306
- package/src/components/add-new-template-legacy/index.jsx +0 -440
- package/src/components/add-new-template-legacy/utils.js +0 -757
- package/src/components/page-templates/hooks.js +0 -93
- package/src/components/page-templates/index-legacy.jsx +0 -143
- package/src/components/page-templates/view-utils.js +0 -50
- package/src/components/sidebar-navigation-screen-templates-browse/content-legacy.jsx +0 -52
- package/src/components/sidebar-navigation-screen-templates-browse/style.scss +0 -6
|
@@ -21,69 +21,17 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
21
21
|
var dataviews_actions_exports = {};
|
|
22
22
|
__export(dataviews_actions_exports, {
|
|
23
23
|
useEditPostAction: () => useEditPostAction,
|
|
24
|
-
useQuickEditPostAction: () => useQuickEditPostAction
|
|
25
|
-
useSetActiveTemplateAction: () => useSetActiveTemplateAction
|
|
24
|
+
useQuickEditPostAction: () => useQuickEditPostAction
|
|
26
25
|
});
|
|
27
26
|
module.exports = __toCommonJS(dataviews_actions_exports);
|
|
28
27
|
var import_i18n = require("@wordpress/i18n");
|
|
29
28
|
var import_icons = require("@wordpress/icons");
|
|
30
29
|
var import_element = require("@wordpress/element");
|
|
31
30
|
var import_router = require("@wordpress/router");
|
|
32
|
-
var import_data = require("@wordpress/data");
|
|
33
|
-
var import_core_data = require("@wordpress/core-data");
|
|
34
31
|
var import_url = require("@wordpress/url");
|
|
35
32
|
var import_constants = require("../../utils/constants.cjs");
|
|
36
33
|
var import_lock_unlock = require("../../lock-unlock.cjs");
|
|
37
34
|
var { useLocation, useHistory } = (0, import_lock_unlock.unlock)(import_router.privateApis);
|
|
38
|
-
var useSetActiveTemplateAction = () => {
|
|
39
|
-
const activeTheme = (0, import_data.useSelect)(
|
|
40
|
-
(select) => select(import_core_data.store).getCurrentTheme()
|
|
41
|
-
);
|
|
42
|
-
const { getEntityRecord } = (0, import_data.useSelect)(import_core_data.store);
|
|
43
|
-
const { editEntityRecord, saveEditedEntityRecord } = (0, import_data.useDispatch)(import_core_data.store);
|
|
44
|
-
return (0, import_element.useMemo)(
|
|
45
|
-
() => ({
|
|
46
|
-
id: "set-active-template",
|
|
47
|
-
label(items) {
|
|
48
|
-
return items.some((item) => item._isActive) ? (0, import_i18n.__)("Deactivate") : (0, import_i18n.__)("Activate");
|
|
49
|
-
},
|
|
50
|
-
isPrimary: true,
|
|
51
|
-
icon: import_icons.pencil,
|
|
52
|
-
isEligible(item) {
|
|
53
|
-
if (item.theme !== activeTheme.stylesheet) {
|
|
54
|
-
return false;
|
|
55
|
-
}
|
|
56
|
-
if (typeof item.id !== "number") {
|
|
57
|
-
return item._isActive === false;
|
|
58
|
-
}
|
|
59
|
-
return true;
|
|
60
|
-
},
|
|
61
|
-
async callback(items) {
|
|
62
|
-
const deactivate = items.some((item) => item._isActive);
|
|
63
|
-
const activeTemplates = {
|
|
64
|
-
...await getEntityRecord("root", "site").active_templates ?? {}
|
|
65
|
-
};
|
|
66
|
-
for (const item of items) {
|
|
67
|
-
if (deactivate) {
|
|
68
|
-
delete activeTemplates[item.slug];
|
|
69
|
-
} else {
|
|
70
|
-
activeTemplates[item.slug] = item.id;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
await editEntityRecord("root", "site", void 0, {
|
|
74
|
-
active_templates: activeTemplates
|
|
75
|
-
});
|
|
76
|
-
await saveEditedEntityRecord("root", "site");
|
|
77
|
-
}
|
|
78
|
-
}),
|
|
79
|
-
[
|
|
80
|
-
editEntityRecord,
|
|
81
|
-
saveEditedEntityRecord,
|
|
82
|
-
getEntityRecord,
|
|
83
|
-
activeTheme
|
|
84
|
-
]
|
|
85
|
-
);
|
|
86
|
-
};
|
|
87
35
|
var useEditPostAction = () => {
|
|
88
36
|
const history = useHistory();
|
|
89
37
|
return (0, import_element.useMemo)(
|
|
@@ -137,7 +85,6 @@ var useQuickEditPostAction = () => {
|
|
|
137
85
|
// Annotate the CommonJS export names for ESM import in node:
|
|
138
86
|
0 && (module.exports = {
|
|
139
87
|
useEditPostAction,
|
|
140
|
-
useQuickEditPostAction
|
|
141
|
-
useSetActiveTemplateAction
|
|
88
|
+
useQuickEditPostAction
|
|
142
89
|
});
|
|
143
90
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/dataviews-actions/index.js"],
|
|
4
|
-
"sourcesContent": ["import { __ } from '@wordpress/i18n';\nimport { pencil, drawerRight } from '@wordpress/icons';\nimport { useMemo } from '@wordpress/element';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA
|
|
6
|
-
"names": ["routerPrivateApis"
|
|
4
|
+
"sourcesContent": ["import { __ } from '@wordpress/i18n';\nimport { pencil, drawerRight } from '@wordpress/icons';\nimport { useMemo } from '@wordpress/element';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { addQueryArgs } from '@wordpress/url';\nimport { PATTERN_TYPES } from '../../utils/constants';\nimport { unlock } from '../../lock-unlock';\n\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\n\nexport const useEditPostAction = () => {\n\tconst history = useHistory();\n\treturn useMemo(\n\t\t() => ( {\n\t\t\tid: 'edit-post',\n\t\t\tlabel: __( 'Edit' ),\n\t\t\ticon: pencil,\n\t\t\tisEligible( post ) {\n\t\t\t\tif ( post.status === 'trash' ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t// It's eligible for all post types except theme patterns.\n\t\t\t\treturn post.type !== PATTERN_TYPES.theme;\n\t\t\t},\n\t\t\tcallback( items ) {\n\t\t\t\tconst post = items[ 0 ];\n\t\t\t\thistory.navigate( `/${ post.type }/${ post.id }?canvas=edit` );\n\t\t\t},\n\t\t} ),\n\t\t[ history ]\n\t);\n};\n\nexport const useQuickEditPostAction = () => {\n\tconst history = useHistory();\n\tconst { path, query } = useLocation();\n\treturn useMemo(\n\t\t() => ( {\n\t\t\tid: 'quick-edit',\n\t\t\tlabel: __( 'Quick Edit' ),\n\t\t\ticon: drawerRight,\n\t\t\tisPrimary: true,\n\t\t\tsupportsBulk: true,\n\t\t\tisEligible( post ) {\n\t\t\t\tif ( post.status === 'trash' ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\treturn post.type === 'page';\n\t\t\t},\n\t\t\tcallback( items ) {\n\t\t\t\thistory.navigate(\n\t\t\t\t\taddQueryArgs( path, {\n\t\t\t\t\t\t...query,\n\t\t\t\t\t\tquickEdit: true,\n\t\t\t\t\t\tpostId: items.map( ( item ) => item.id ).join( ',' ),\n\t\t\t\t\t} )\n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,SAAU,KAAK,EAAG,EAAE,KAAM,GAAI;AAAA,UACpD,CAAE;AAAA,QACH;AAAA,MACD;AAAA,IACD;AAAA,IACA,CAAE,SAAS,MAAM,KAAM;AAAA,EACxB;AACD;",
|
|
6
|
+
"names": ["routerPrivateApis"]
|
|
7
7
|
}
|
|
@@ -61,7 +61,7 @@ var import_jsx_runtime = require("react/jsx-runtime");
|
|
|
61
61
|
var { useLocation } = (0, import_lock_unlock.unlock)(import_router.privateApis);
|
|
62
62
|
var { useStyle, UploadProgressSnackbar } = (0, import_lock_unlock.unlock)(import_editor.privateApis);
|
|
63
63
|
var ANIMATION_DURATION = 0.3;
|
|
64
|
-
var CONTENT_COLOR = { background: "#
|
|
64
|
+
var CONTENT_COLOR = { background: "#fcfcfc" };
|
|
65
65
|
function Layout() {
|
|
66
66
|
const { query, name: routeKey, areas, widths } = useLocation();
|
|
67
67
|
const canvas = routeKey === "notfound" ? "view" : query?.canvas ?? "view";
|
|
@@ -277,7 +277,7 @@ function LayoutWithGlobalStylesProvider(props) {
|
|
|
277
277
|
primary: themeColors.primary,
|
|
278
278
|
...CONTENT_COLOR
|
|
279
279
|
},
|
|
280
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_theme.ThemeProvider, { color: themeColors, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Layout, { ...props }) })
|
|
280
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_theme.ThemeProvider, { color: themeColors, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_editor.ErrorBoundary, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Layout, { ...props }) }) })
|
|
281
281
|
}
|
|
282
282
|
)
|
|
283
283
|
] }) });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/layout/index.jsx"],
|
|
4
|
-
"sourcesContent": ["import clsx from 'clsx';\nimport { NavigableRegion, getAdminThemeColors } from '@wordpress/admin-ui';\nimport {\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n\t__unstableUseNavigateRegions as useNavigateRegions,\n\tSlotFillProvider,\n} from '@wordpress/components';\nimport {\n\tuseReducedMotion,\n\tuseViewportMatch,\n\tuseResizeObserver,\n\tusePrevious,\n} from '@wordpress/compose';\nimport { focus } from '@wordpress/dom';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useState, useRef, useEffect, useMemo } from '@wordpress/element';\nimport {\n\tUnsavedChangesWarning,\n\tErrorBoundary,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { ThemeProvider } from '@wordpress/theme';\nimport { PluginArea } from '@wordpress/plugins';\nimport { SnackbarNotices, store as noticesStore } from '@wordpress/notices';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { Tooltip } from '@wordpress/ui';\nimport { SiteHubMobile } from '../site-hub';\nimport ResizableFrame from '../resizable-frame';\nimport { unlock } from '../../lock-unlock';\nimport SaveKeyboardShortcut from '../save-keyboard-shortcut';\nimport { useIsSiteEditorLoading } from './hooks';\nimport useMovingAnimation from './animation';\nimport { SidebarContent, SidebarNavigationProvider } from '../sidebar';\nimport SaveHub from '../save-hub';\nimport SavePanel from '../save-panel';\n\nconst { useLocation } = unlock( routerPrivateApis );\nconst { useStyle, UploadProgressSnackbar } = unlock( editorPrivateApis );\n\nconst ANIMATION_DURATION = 0.3;\nconst CONTENT_COLOR = { background: '#ffffff' };\n\nfunction Layout() {\n\tconst { query, name: routeKey, areas, widths } = useLocation();\n\t// Force canvas to 'view' on notfound route to show the error message and allow navigation.\n\tconst canvas = routeKey === 'notfound' ? 'view' : query?.canvas ?? 'view';\n\tconst showMobileSiteHub = !! areas.mobileContent;\n\tconst hasMobileAreas =\n\t\tareas.mobileSidebar || areas.mobileContent || areas.preview;\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst mobileToggleRef = useRef();\n\tconst sidebarRegionRef = useRef();\n\tconst navigateRegionsProps = useNavigateRegions();\n\tconst disableMotion = useReducedMotion();\n\tconst [ canvasResizer, canvasSize ] = useResizeObserver();\n\tconst isEditorLoading = useIsSiteEditorLoading();\n\tconst [ isResizableFrameOversized, setIsResizableFrameOversized ] =\n\t\tuseState( false );\n\tconst animationRef = useMovingAnimation( {\n\t\ttriggerAnimationOnChange: routeKey + '-' + canvas,\n\t} );\n\n\tconst { showIconLabels } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tshowIconLabels: select( preferencesStore ).get(\n\t\t\t\t'core',\n\t\t\t\t'showIconLabels'\n\t\t\t),\n\t\t};\n\t} );\n\n\tconst backgroundColor = useStyle( 'color.background' );\n\tconst gradientValue = useStyle( 'color.gradient' );\n\tconst previousCanvaMode = usePrevious( canvas );\n\tuseEffect( () => {\n\t\tif ( previousCanvaMode === 'edit' ) {\n\t\t\tconst desktopToggle = sidebarRegionRef.current\n\t\t\t\t? // We're typically expecting the `<DashboardBackButton />` component as the first tabbable element.\n\t\t\t\t focus.tabbable.find( sidebarRegionRef.current )[ 0 ]\n\t\t\t\t: undefined;\n\t\t\t( desktopToggle ?? mobileToggleRef.current )?.focus();\n\t\t}\n\t\t// Should not depend on the previous canvas mode value but the next.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ canvas ] );\n\n\treturn (\n\t\t<>\n\t\t\t<UnsavedChangesWarning />\n\t\t\t{ canvas === 'view' && <SaveKeyboardShortcut /> }\n\t\t\t<div\n\t\t\t\t{ ...navigateRegionsProps }\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\t'edit-site-layout',\n\t\t\t\t\tnavigateRegionsProps.className,\n\t\t\t\t\t{\n\t\t\t\t\t\t'is-full-canvas': canvas === 'edit',\n\t\t\t\t\t\t'show-icon-labels': showIconLabels,\n\t\t\t\t\t}\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t<div className=\"edit-site-layout__content\">\n\t\t\t\t\t{ /*\n\t\t\t\t\t\tThe NavigableRegion must always be rendered and not use\n\t\t\t\t\t\t`inert` otherwise `useNavigateRegions` will fail.\n\t\t\t\t\t*/ }\n\t\t\t\t\t{ ( ! isMobileViewport || ! hasMobileAreas ) && (\n\t\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\t\tref={ sidebarRegionRef }\n\t\t\t\t\t\t\tariaLabel={ __( 'Navigation' ) }\n\t\t\t\t\t\t\tclassName=\"edit-site-layout__sidebar-region\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<AnimatePresence>\n\t\t\t\t\t\t\t\t{ canvas === 'view' && (\n\t\t\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\t\t\tinitial={ { opacity: 0 } }\n\t\t\t\t\t\t\t\t\t\tanimate={ { opacity: 1 } }\n\t\t\t\t\t\t\t\t\t\texit={ { opacity: 0 } }\n\t\t\t\t\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\t\t\t\tduration:\n\t\t\t\t\t\t\t\t\t\t\t\t// Disable transition in mobile to emulate a full page transition.\n\t\t\t\t\t\t\t\t\t\t\t\tdisableMotion ||\n\t\t\t\t\t\t\t\t\t\t\t\tisMobileViewport\n\t\t\t\t\t\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t\t\t\t\t\t: ANIMATION_DURATION,\n\t\t\t\t\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\tclassName=\"edit-site-layout__sidebar\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<SidebarNavigationProvider>\n\t\t\t\t\t\t\t\t\t\t\t<SidebarContent\n\t\t\t\t\t\t\t\t\t\t\t\tshouldAnimate={\n\t\t\t\t\t\t\t\t\t\t\t\t\trouteKey !== 'styles' &&\n\t\t\t\t\t\t\t\t\t\t\t\t\trouteKey !== 'identity'\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\trouteKey={ routeKey }\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ areas.sidebar }\n\t\t\t\t\t\t\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t\t</SidebarContent>\n\t\t\t\t\t\t\t\t\t\t</SidebarNavigationProvider>\n\t\t\t\t\t\t\t\t\t\t<SaveHub />\n\t\t\t\t\t\t\t\t\t\t<SavePanel />\n\t\t\t\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</AnimatePresence>\n\t\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t) }\n\n\t\t\t\t\t<SnackbarNotices className=\"edit-site-layout__snackbar\" />\n\t\t\t\t\t<UploadProgressSnackbar />\n\n\t\t\t\t\t{ isMobileViewport && hasMobileAreas && (\n\t\t\t\t\t\t<div className=\"edit-site-layout__mobile\">\n\t\t\t\t\t\t\t<SidebarNavigationProvider>\n\t\t\t\t\t\t\t\t{ canvas !== 'edit' ? (\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t{ showMobileSiteHub && (\n\t\t\t\t\t\t\t\t\t\t\t<SiteHubMobile\n\t\t\t\t\t\t\t\t\t\t\t\tref={ mobileToggleRef }\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t{ areas.mobileContent ? (\n\t\t\t\t\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t\t\t\t\t * ThemeProvider wraps SidebarContent (rather than\n\t\t\t\t\t\t\t\t\t\t\t * just the content) so the scroll wrapper it renders\n\t\t\t\t\t\t\t\t\t\t\t * inherits the content background tokens. See\n\t\t\t\t\t\t\t\t\t\t\t * `.edit-site-sidebar__screen-wrapper` in style.scss.\n\t\t\t\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\t\t\t\t<ThemeProvider\n\t\t\t\t\t\t\t\t\t\t\t\tcolor={ CONTENT_COLOR }\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t<SidebarContent\n\t\t\t\t\t\t\t\t\t\t\t\t\trouteKey={ routeKey }\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div className=\"edit-site-layout__mobile-content\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tareas.mobileContent\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t</SidebarContent>\n\t\t\t\t\t\t\t\t\t\t\t</ThemeProvider>\n\t\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t\t<SidebarContent\n\t\t\t\t\t\t\t\t\t\t\t\trouteKey={ routeKey }\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ areas.mobileSidebar }\n\t\t\t\t\t\t\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t\t</SidebarContent>\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t<SaveHub />\n\t\t\t\t\t\t\t\t\t\t<SavePanel />\n\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<ThemeProvider color={ CONTENT_COLOR }>\n\t\t\t\t\t\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t\t{ areas.preview }\n\t\t\t\t\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t\t\t\t\t</ThemeProvider>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</SidebarNavigationProvider>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ ! isMobileViewport &&\n\t\t\t\t\t\tareas.content &&\n\t\t\t\t\t\tcanvas !== 'edit' && (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclassName=\"edit-site-layout__area\"\n\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\tmaxWidth: widths?.content,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<ThemeProvider color={ CONTENT_COLOR }>\n\t\t\t\t\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t{ areas.content }\n\t\t\t\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t\t\t\t</ThemeProvider>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\n\t\t\t\t\t{ ! isMobileViewport && areas.edit && canvas !== 'edit' && (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName=\"edit-site-layout__area\"\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\tmaxWidth: widths?.edit,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ThemeProvider color={ CONTENT_COLOR }>\n\t\t\t\t\t\t\t\t<ErrorBoundary>{ areas.edit }</ErrorBoundary>\n\t\t\t\t\t\t\t</ThemeProvider>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ ! isMobileViewport && areas.preview && (\n\t\t\t\t\t\t<div className=\"edit-site-layout__canvas-container\">\n\t\t\t\t\t\t\t{ canvasResizer }\n\t\t\t\t\t\t\t{ !! canvasSize.width && (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t\t\t'edit-site-layout__canvas',\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t'is-right-aligned':\n\t\t\t\t\t\t\t\t\t\t\t\tisResizableFrameOversized,\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tref={ animationRef }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t<ResizableFrame\n\t\t\t\t\t\t\t\t\t\t\tisReady={ ! isEditorLoading }\n\t\t\t\t\t\t\t\t\t\t\tisFullWidth={ canvas === 'edit' }\n\t\t\t\t\t\t\t\t\t\t\tdefaultSize={ {\n\t\t\t\t\t\t\t\t\t\t\t\twidth:\n\t\t\t\t\t\t\t\t\t\t\t\t\tcanvasSize.width -\n\t\t\t\t\t\t\t\t\t\t\t\t\t24 /* $canvas-padding */,\n\t\t\t\t\t\t\t\t\t\t\t\theight: canvasSize.height,\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t\tisOversized={\n\t\t\t\t\t\t\t\t\t\t\t\tisResizableFrameOversized\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tsetIsOversized={\n\t\t\t\t\t\t\t\t\t\t\t\tsetIsResizableFrameOversized\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tinnerContentStyle={ {\n\t\t\t\t\t\t\t\t\t\t\t\tbackground:\n\t\t\t\t\t\t\t\t\t\t\t\t\tgradientValue ??\n\t\t\t\t\t\t\t\t\t\t\t\t\tbackgroundColor,\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<ThemeProvider\n\t\t\t\t\t\t\t\t\t\t\t\tcolor={ CONTENT_COLOR }\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t{ areas.preview }\n\t\t\t\t\t\t\t\t\t\t\t</ThemeProvider>\n\t\t\t\t\t\t\t\t\t\t</ResizableFrame>\n\t\t\t\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default function LayoutWithGlobalStylesProvider( props ) {\n\tconst themeColors = useMemo( getAdminThemeColors, [] );\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tfunction onPluginAreaError( name ) {\n\t\tcreateErrorNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: plugin name */\n\t\t\t\t__(\n\t\t\t\t\t'The \"%s\" plugin has encountered an error and cannot be rendered.'\n\t\t\t\t),\n\t\t\t\tname\n\t\t\t)\n\t\t);\n\t}\n\n\treturn (\n\t\t<SlotFillProvider>\n\t\t\t<Tooltip.Provider>\n\t\t\t\t{ /** This needs to be within the SlotFillProvider */ }\n\t\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t\t\t<ThemeProvider\n\t\t\t\t\tisRoot\n\t\t\t\t\tcolor={ {\n\t\t\t\t\t\tprimary: themeColors.primary,\n\t\t\t\t\t\t...CONTENT_COLOR,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<ThemeProvider color={ themeColors }>\n\t\t\t\t\t\t<Layout { ...props } />\n\t\t\t\t\t</ThemeProvider>\n\t\t\t\t</ThemeProvider>\n\t\t\t</Tooltip.Provider>\n\t\t</SlotFillProvider>\n\t);\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AACjB,sBAAqD;AACrD,wBAKO;AACP,qBAKO;AACP,iBAAsB;AACtB,kBAA4B;AAC5B,qBAAqD;AACrD,oBAIO;AACP,oBAAiD;AACjD,mBAA8B;AAC9B,qBAA2B;AAC3B,qBAAuD;AACvD,kBAAuC;AACvC,yBAA0C;AAC1C,gBAAwB;AACxB,sBAA8B;AAC9B,6BAA2B;AAC3B,yBAAuB;AACvB,oCAAiC;AACjC,mBAAuC;AACvC,uBAA+B;AAC/B,qBAA0D;AAC1D,sBAAoB;AACpB,wBAAsB;
|
|
4
|
+
"sourcesContent": ["import clsx from 'clsx';\nimport { NavigableRegion, getAdminThemeColors } from '@wordpress/admin-ui';\nimport {\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n\t__unstableUseNavigateRegions as useNavigateRegions,\n\tSlotFillProvider,\n} from '@wordpress/components';\nimport {\n\tuseReducedMotion,\n\tuseViewportMatch,\n\tuseResizeObserver,\n\tusePrevious,\n} from '@wordpress/compose';\nimport { focus } from '@wordpress/dom';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useState, useRef, useEffect, useMemo } from '@wordpress/element';\nimport {\n\tUnsavedChangesWarning,\n\tErrorBoundary,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { ThemeProvider } from '@wordpress/theme';\nimport { PluginArea } from '@wordpress/plugins';\nimport { SnackbarNotices, store as noticesStore } from '@wordpress/notices';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { Tooltip } from '@wordpress/ui';\nimport { SiteHubMobile } from '../site-hub';\nimport ResizableFrame from '../resizable-frame';\nimport { unlock } from '../../lock-unlock';\nimport SaveKeyboardShortcut from '../save-keyboard-shortcut';\nimport { useIsSiteEditorLoading } from './hooks';\nimport useMovingAnimation from './animation';\nimport { SidebarContent, SidebarNavigationProvider } from '../sidebar';\nimport SaveHub from '../save-hub';\nimport SavePanel from '../save-panel';\n\nconst { useLocation } = unlock( routerPrivateApis );\nconst { useStyle, UploadProgressSnackbar } = unlock( editorPrivateApis );\n\nconst ANIMATION_DURATION = 0.3;\n// Reset to the default background color.\nconst CONTENT_COLOR = { background: '#fcfcfc' };\n\nfunction Layout() {\n\tconst { query, name: routeKey, areas, widths } = useLocation();\n\t// Force canvas to 'view' on notfound route to show the error message and allow navigation.\n\tconst canvas = routeKey === 'notfound' ? 'view' : query?.canvas ?? 'view';\n\tconst showMobileSiteHub = !! areas.mobileContent;\n\tconst hasMobileAreas =\n\t\tareas.mobileSidebar || areas.mobileContent || areas.preview;\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst mobileToggleRef = useRef();\n\tconst sidebarRegionRef = useRef();\n\tconst navigateRegionsProps = useNavigateRegions();\n\tconst disableMotion = useReducedMotion();\n\tconst [ canvasResizer, canvasSize ] = useResizeObserver();\n\tconst isEditorLoading = useIsSiteEditorLoading();\n\tconst [ isResizableFrameOversized, setIsResizableFrameOversized ] =\n\t\tuseState( false );\n\tconst animationRef = useMovingAnimation( {\n\t\ttriggerAnimationOnChange: routeKey + '-' + canvas,\n\t} );\n\n\tconst { showIconLabels } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tshowIconLabels: select( preferencesStore ).get(\n\t\t\t\t'core',\n\t\t\t\t'showIconLabels'\n\t\t\t),\n\t\t};\n\t} );\n\n\tconst backgroundColor = useStyle( 'color.background' );\n\tconst gradientValue = useStyle( 'color.gradient' );\n\tconst previousCanvaMode = usePrevious( canvas );\n\tuseEffect( () => {\n\t\tif ( previousCanvaMode === 'edit' ) {\n\t\t\tconst desktopToggle = sidebarRegionRef.current\n\t\t\t\t? // We're typically expecting the `<DashboardBackButton />` component as the first tabbable element.\n\t\t\t\t focus.tabbable.find( sidebarRegionRef.current )[ 0 ]\n\t\t\t\t: undefined;\n\t\t\t( desktopToggle ?? mobileToggleRef.current )?.focus();\n\t\t}\n\t\t// Should not depend on the previous canvas mode value but the next.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ canvas ] );\n\n\treturn (\n\t\t<>\n\t\t\t<UnsavedChangesWarning />\n\t\t\t{ canvas === 'view' && <SaveKeyboardShortcut /> }\n\t\t\t<div\n\t\t\t\t{ ...navigateRegionsProps }\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\t'edit-site-layout',\n\t\t\t\t\tnavigateRegionsProps.className,\n\t\t\t\t\t{\n\t\t\t\t\t\t'is-full-canvas': canvas === 'edit',\n\t\t\t\t\t\t'show-icon-labels': showIconLabels,\n\t\t\t\t\t}\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t<div className=\"edit-site-layout__content\">\n\t\t\t\t\t{ /*\n\t\t\t\t\t\tThe NavigableRegion must always be rendered and not use\n\t\t\t\t\t\t`inert` otherwise `useNavigateRegions` will fail.\n\t\t\t\t\t*/ }\n\t\t\t\t\t{ ( ! isMobileViewport || ! hasMobileAreas ) && (\n\t\t\t\t\t\t<NavigableRegion\n\t\t\t\t\t\t\tref={ sidebarRegionRef }\n\t\t\t\t\t\t\tariaLabel={ __( 'Navigation' ) }\n\t\t\t\t\t\t\tclassName=\"edit-site-layout__sidebar-region\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<AnimatePresence>\n\t\t\t\t\t\t\t\t{ canvas === 'view' && (\n\t\t\t\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\t\t\t\tinitial={ { opacity: 0 } }\n\t\t\t\t\t\t\t\t\t\tanimate={ { opacity: 1 } }\n\t\t\t\t\t\t\t\t\t\texit={ { opacity: 0 } }\n\t\t\t\t\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\t\t\t\t\tduration:\n\t\t\t\t\t\t\t\t\t\t\t\t// Disable transition in mobile to emulate a full page transition.\n\t\t\t\t\t\t\t\t\t\t\t\tdisableMotion ||\n\t\t\t\t\t\t\t\t\t\t\t\tisMobileViewport\n\t\t\t\t\t\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t\t\t\t\t\t: ANIMATION_DURATION,\n\t\t\t\t\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\tclassName=\"edit-site-layout__sidebar\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<SidebarNavigationProvider>\n\t\t\t\t\t\t\t\t\t\t\t<SidebarContent\n\t\t\t\t\t\t\t\t\t\t\t\tshouldAnimate={\n\t\t\t\t\t\t\t\t\t\t\t\t\trouteKey !== 'styles' &&\n\t\t\t\t\t\t\t\t\t\t\t\t\trouteKey !== 'identity'\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\trouteKey={ routeKey }\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ areas.sidebar }\n\t\t\t\t\t\t\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t\t</SidebarContent>\n\t\t\t\t\t\t\t\t\t\t</SidebarNavigationProvider>\n\t\t\t\t\t\t\t\t\t\t<SaveHub />\n\t\t\t\t\t\t\t\t\t\t<SavePanel />\n\t\t\t\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</AnimatePresence>\n\t\t\t\t\t\t</NavigableRegion>\n\t\t\t\t\t) }\n\n\t\t\t\t\t<SnackbarNotices className=\"edit-site-layout__snackbar\" />\n\t\t\t\t\t<UploadProgressSnackbar />\n\n\t\t\t\t\t{ isMobileViewport && hasMobileAreas && (\n\t\t\t\t\t\t<div className=\"edit-site-layout__mobile\">\n\t\t\t\t\t\t\t<SidebarNavigationProvider>\n\t\t\t\t\t\t\t\t{ canvas !== 'edit' ? (\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t{ showMobileSiteHub && (\n\t\t\t\t\t\t\t\t\t\t\t<SiteHubMobile\n\t\t\t\t\t\t\t\t\t\t\t\tref={ mobileToggleRef }\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t{ areas.mobileContent ? (\n\t\t\t\t\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t\t\t\t\t * ThemeProvider wraps SidebarContent (rather than\n\t\t\t\t\t\t\t\t\t\t\t * just the content) so the scroll wrapper it renders\n\t\t\t\t\t\t\t\t\t\t\t * inherits the content background tokens. See\n\t\t\t\t\t\t\t\t\t\t\t * `.edit-site-sidebar__screen-wrapper` in style.scss.\n\t\t\t\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\t\t\t\t<ThemeProvider\n\t\t\t\t\t\t\t\t\t\t\t\tcolor={ CONTENT_COLOR }\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t<SidebarContent\n\t\t\t\t\t\t\t\t\t\t\t\t\trouteKey={ routeKey }\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div className=\"edit-site-layout__mobile-content\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tareas.mobileContent\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t</SidebarContent>\n\t\t\t\t\t\t\t\t\t\t\t</ThemeProvider>\n\t\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t\t<SidebarContent\n\t\t\t\t\t\t\t\t\t\t\t\trouteKey={ routeKey }\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ areas.mobileSidebar }\n\t\t\t\t\t\t\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t\t</SidebarContent>\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t<SaveHub />\n\t\t\t\t\t\t\t\t\t\t<SavePanel />\n\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<ThemeProvider color={ CONTENT_COLOR }>\n\t\t\t\t\t\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t\t{ areas.preview }\n\t\t\t\t\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t\t\t\t\t</ThemeProvider>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</SidebarNavigationProvider>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ ! isMobileViewport &&\n\t\t\t\t\t\tareas.content &&\n\t\t\t\t\t\tcanvas !== 'edit' && (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclassName=\"edit-site-layout__area\"\n\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\tmaxWidth: widths?.content,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<ThemeProvider color={ CONTENT_COLOR }>\n\t\t\t\t\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t{ areas.content }\n\t\t\t\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t\t\t\t</ThemeProvider>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\n\t\t\t\t\t{ ! isMobileViewport && areas.edit && canvas !== 'edit' && (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName=\"edit-site-layout__area\"\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\tmaxWidth: widths?.edit,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ThemeProvider color={ CONTENT_COLOR }>\n\t\t\t\t\t\t\t\t<ErrorBoundary>{ areas.edit }</ErrorBoundary>\n\t\t\t\t\t\t\t</ThemeProvider>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ ! isMobileViewport && areas.preview && (\n\t\t\t\t\t\t<div className=\"edit-site-layout__canvas-container\">\n\t\t\t\t\t\t\t{ canvasResizer }\n\t\t\t\t\t\t\t{ !! canvasSize.width && (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t\t\t'edit-site-layout__canvas',\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t'is-right-aligned':\n\t\t\t\t\t\t\t\t\t\t\t\tisResizableFrameOversized,\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tref={ animationRef }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t\t\t\t<ResizableFrame\n\t\t\t\t\t\t\t\t\t\t\tisReady={ ! isEditorLoading }\n\t\t\t\t\t\t\t\t\t\t\tisFullWidth={ canvas === 'edit' }\n\t\t\t\t\t\t\t\t\t\t\tdefaultSize={ {\n\t\t\t\t\t\t\t\t\t\t\t\twidth:\n\t\t\t\t\t\t\t\t\t\t\t\t\tcanvasSize.width -\n\t\t\t\t\t\t\t\t\t\t\t\t\t24 /* $canvas-padding */,\n\t\t\t\t\t\t\t\t\t\t\t\theight: canvasSize.height,\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t\tisOversized={\n\t\t\t\t\t\t\t\t\t\t\t\tisResizableFrameOversized\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tsetIsOversized={\n\t\t\t\t\t\t\t\t\t\t\t\tsetIsResizableFrameOversized\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tinnerContentStyle={ {\n\t\t\t\t\t\t\t\t\t\t\t\tbackground:\n\t\t\t\t\t\t\t\t\t\t\t\t\tgradientValue ??\n\t\t\t\t\t\t\t\t\t\t\t\t\tbackgroundColor,\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<ThemeProvider\n\t\t\t\t\t\t\t\t\t\t\t\tcolor={ CONTENT_COLOR }\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t{ areas.preview }\n\t\t\t\t\t\t\t\t\t\t\t</ThemeProvider>\n\t\t\t\t\t\t\t\t\t\t</ResizableFrame>\n\t\t\t\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default function LayoutWithGlobalStylesProvider( props ) {\n\tconst themeColors = useMemo( getAdminThemeColors, [] );\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tfunction onPluginAreaError( name ) {\n\t\tcreateErrorNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: plugin name */\n\t\t\t\t__(\n\t\t\t\t\t'The \"%s\" plugin has encountered an error and cannot be rendered.'\n\t\t\t\t),\n\t\t\t\tname\n\t\t\t)\n\t\t);\n\t}\n\n\treturn (\n\t\t<SlotFillProvider>\n\t\t\t<Tooltip.Provider>\n\t\t\t\t{ /** This needs to be within the SlotFillProvider */ }\n\t\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t\t\t<ThemeProvider\n\t\t\t\t\tisRoot\n\t\t\t\t\tcolor={ {\n\t\t\t\t\t\tprimary: themeColors.primary,\n\t\t\t\t\t\t...CONTENT_COLOR,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<ThemeProvider color={ themeColors }>\n\t\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t<Layout { ...props } />\n\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t</ThemeProvider>\n\t\t\t\t</ThemeProvider>\n\t\t\t</Tooltip.Provider>\n\t\t</SlotFillProvider>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AACjB,sBAAqD;AACrD,wBAKO;AACP,qBAKO;AACP,iBAAsB;AACtB,kBAA4B;AAC5B,qBAAqD;AACrD,oBAIO;AACP,oBAAiD;AACjD,mBAA8B;AAC9B,qBAA2B;AAC3B,qBAAuD;AACvD,kBAAuC;AACvC,yBAA0C;AAC1C,gBAAwB;AACxB,sBAA8B;AAC9B,6BAA2B;AAC3B,yBAAuB;AACvB,oCAAiC;AACjC,mBAAuC;AACvC,uBAA+B;AAC/B,qBAA0D;AAC1D,sBAAoB;AACpB,wBAAsB;AAuDnB;AArDH,IAAM,EAAE,YAAY,QAAI,2BAAQ,cAAAA,WAAkB;AAClD,IAAM,EAAE,UAAU,uBAAuB,QAAI,2BAAQ,cAAAC,WAAkB;AAEvE,IAAM,qBAAqB;AAE3B,IAAM,gBAAgB,EAAE,YAAY,UAAU;AAE9C,SAAS,SAAS;AACjB,QAAM,EAAE,OAAO,MAAM,UAAU,OAAO,OAAO,IAAI,YAAY;AAE7D,QAAM,SAAS,aAAa,aAAa,SAAS,OAAO,UAAU;AACnE,QAAM,oBAAoB,CAAC,CAAE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ED,mBAAoB;AAAA,sBACnB,YACC,iBACA;AAAA,oBACF;AAAA,oBAEA;AAAA,sBAAC;AAAA;AAAA,wBACA,OAAQ;AAAA,wBAEN,gBAAM;AAAA;AAAA,oBACT;AAAA;AAAA,gBACD,GACD;AAAA;AAAA,YACD;AAAA,aAEF;AAAA,WAEF;AAAA;AAAA,IACD;AAAA,KACD;AAEF;AAEe,SAAR,+BAAiD,OAAQ;AAC/D,QAAM,kBAAc,wBAAS,qCAAqB,CAAC,CAAE;AACrD,QAAM,EAAE,kBAAkB,QAAI,yBAAa,eAAAC,KAAa;AACxD,WAAS,kBAAmB,MAAO;AAClC;AAAA,UACC;AAAA;AAAA,YAEC;AAAA,UACC;AAAA,QACD;AAAA,QACA;AAAA,MACD;AAAA,IACD;AAAA,EACD;AAEA,SACC,4CAAC,sCACA,uDAAC,kBAAQ,UAAR,EAEA;AAAA,gDAAC,6BAAW,SAAU,mBAAoB;AAAA,IAC1C;AAAA,MAAC;AAAA;AAAA,QACA,QAAM;AAAA,QACN,OAAQ;AAAA,UACP,SAAS,YAAY;AAAA,UACrB,GAAG;AAAA,QACJ;AAAA,QAEA,sDAAC,8BAAc,OAAQ,aACtB,sDAAC,+BACA,sDAAC,UAAS,GAAG,OAAQ,GACtB,GACD;AAAA;AAAA,IACD;AAAA,KACD,GACD;AAEF;",
|
|
6
6
|
"names": ["routerPrivateApis", "editorPrivateApis", "useNavigateRegions", "useMovingAnimation", "preferencesStore", "SaveKeyboardShortcut", "clsx", "AnimatePresence", "motion", "SaveHub", "SavePanel", "ResizableFrame", "noticesStore"]
|
|
7
7
|
}
|
|
@@ -25,11 +25,19 @@ __export(welcome_guide_menu_item_exports, {
|
|
|
25
25
|
module.exports = __toCommonJS(welcome_guide_menu_item_exports);
|
|
26
26
|
var import_i18n = require("@wordpress/i18n");
|
|
27
27
|
var import_data = require("@wordpress/data");
|
|
28
|
-
var
|
|
28
|
+
var import_editor = require("@wordpress/editor");
|
|
29
29
|
var import_preferences = require("@wordpress/preferences");
|
|
30
|
+
var import_lock_unlock = require("../../lock-unlock.cjs");
|
|
30
31
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
32
|
+
var { MoreMenuItem } = (0, import_lock_unlock.unlock)(import_editor.privateApis);
|
|
31
33
|
function WelcomeGuideMenuItem() {
|
|
32
34
|
const { toggle } = (0, import_data.useDispatch)(import_preferences.store);
|
|
33
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
35
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
36
|
+
MoreMenuItem,
|
|
37
|
+
{
|
|
38
|
+
onClick: () => toggle("core/edit-site", "welcomeGuide"),
|
|
39
|
+
children: (0, import_i18n.__)("Welcome Guide")
|
|
40
|
+
}
|
|
41
|
+
);
|
|
34
42
|
}
|
|
35
43
|
//# sourceMappingURL=welcome-guide-menu-item.cjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/more-menu/welcome-guide-menu-item.jsx"],
|
|
4
|
-
"sourcesContent": ["import { __ } from '@wordpress/i18n';\nimport { useDispatch } from '@wordpress/data';\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAmB;AACnB,kBAA4B;AAC5B,
|
|
6
|
-
"names": ["preferencesStore"]
|
|
4
|
+
"sourcesContent": ["import { __ } from '@wordpress/i18n';\nimport { useDispatch } from '@wordpress/data';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { unlock } from '../../lock-unlock';\n\nconst { MoreMenuItem } = unlock( editorPrivateApis );\n\nexport default function WelcomeGuideMenuItem() {\n\tconst { toggle } = useDispatch( preferencesStore );\n\n\treturn (\n\t\t<MoreMenuItem\n\t\t\tonClick={ () => toggle( 'core/edit-site', 'welcomeGuide' ) }\n\t\t>\n\t\t\t{ __( 'Welcome Guide' ) }\n\t\t</MoreMenuItem>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAmB;AACnB,kBAA4B;AAC5B,oBAAiD;AACjD,yBAA0C;AAC1C,yBAAuB;AAQrB;AANF,IAAM,EAAE,aAAa,QAAI,2BAAQ,cAAAA,WAAkB;AAEpC,SAAR,uBAAwC;AAC9C,QAAM,EAAE,OAAO,QAAI,yBAAa,mBAAAC,KAAiB;AAEjD,SACC;AAAA,IAAC;AAAA;AAAA,MACA,SAAU,MAAM,OAAQ,kBAAkB,cAAe;AAAA,MAEvD,8BAAI,eAAgB;AAAA;AAAA,EACvB;AAEF;",
|
|
6
|
+
"names": ["editorPrivateApis", "preferencesStore"]
|
|
7
7
|
}
|
|
@@ -30,49 +30,18 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// packages/edit-site/src/components/page-templates/fields.jsx
|
|
31
31
|
var fields_exports = {};
|
|
32
32
|
__export(fields_exports, {
|
|
33
|
-
|
|
34
|
-
authorField: () => authorField,
|
|
35
|
-
descriptionField: () => descriptionField,
|
|
36
|
-
previewField: () => previewField,
|
|
37
|
-
slugField: () => slugField,
|
|
38
|
-
useThemeField: () => useThemeField
|
|
33
|
+
previewField: () => previewField
|
|
39
34
|
});
|
|
40
35
|
module.exports = __toCommonJS(fields_exports);
|
|
41
|
-
var import_clsx = __toESM(require("clsx"));
|
|
42
|
-
var import_components = require("@wordpress/components");
|
|
43
36
|
var import_i18n = require("@wordpress/i18n");
|
|
44
37
|
var import_element = require("@wordpress/element");
|
|
45
|
-
var import_html_entities = require("@wordpress/html-entities");
|
|
46
38
|
var import_blocks = require("@wordpress/blocks");
|
|
47
39
|
var import_block_editor = require("@wordpress/block-editor");
|
|
48
40
|
var import_editor = require("@wordpress/editor");
|
|
49
|
-
var import_core_data = require("@wordpress/core-data");
|
|
50
|
-
var import_data = require("@wordpress/data");
|
|
51
|
-
var import_hooks = require("./hooks.cjs");
|
|
52
|
-
var import_utils = require("../add-new-template/utils.cjs");
|
|
53
41
|
var import_use_pattern_settings = __toESM(require("../page-patterns/use-pattern-settings.cjs"));
|
|
54
42
|
var import_lock_unlock = require("../../lock-unlock.cjs");
|
|
55
43
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
56
|
-
var { Badge: WCBadge } = (0, import_lock_unlock.unlock)(import_components.privateApis);
|
|
57
|
-
var { useEntityRecordsWithPermissions } = (0, import_lock_unlock.unlock)(import_core_data.privateApis);
|
|
58
44
|
var { useStyle } = (0, import_lock_unlock.unlock)(import_editor.privateApis);
|
|
59
|
-
function useAllDefaultTemplateTypes() {
|
|
60
|
-
const defaultTemplateTypes = (0, import_utils.useDefaultTemplateTypes)();
|
|
61
|
-
const { records: staticRecords } = useEntityRecordsWithPermissions(
|
|
62
|
-
"root",
|
|
63
|
-
"registeredTemplate"
|
|
64
|
-
);
|
|
65
|
-
return [
|
|
66
|
-
...defaultTemplateTypes,
|
|
67
|
-
...staticRecords?.filter((record) => !record.is_custom).map((record) => {
|
|
68
|
-
return {
|
|
69
|
-
slug: record.slug,
|
|
70
|
-
title: record.title.rendered,
|
|
71
|
-
description: record.description
|
|
72
|
-
};
|
|
73
|
-
})
|
|
74
|
-
];
|
|
75
|
-
}
|
|
76
45
|
function PreviewField({ item }) {
|
|
77
46
|
const settings = (0, import_use_pattern_settings.default)();
|
|
78
47
|
const backgroundColor = useStyle("color.background") ?? "white";
|
|
@@ -98,101 +67,8 @@ var previewField = {
|
|
|
98
67
|
render: PreviewField,
|
|
99
68
|
enableSorting: false
|
|
100
69
|
};
|
|
101
|
-
var descriptionField = {
|
|
102
|
-
label: (0, import_i18n.__)("Description"),
|
|
103
|
-
id: "description",
|
|
104
|
-
render: window?.__experimentalTemplateActivate ? function RenderDescription({ item }) {
|
|
105
|
-
const defaultTemplateTypes = useAllDefaultTemplateTypes();
|
|
106
|
-
const defaultTemplateType = defaultTemplateTypes.find(
|
|
107
|
-
(type) => type.slug === item.slug
|
|
108
|
-
);
|
|
109
|
-
return item.description ? (0, import_html_entities.decodeEntities)(item.description) : defaultTemplateType?.description;
|
|
110
|
-
} : ({ item }) => {
|
|
111
|
-
return item.description && (0, import_html_entities.decodeEntities)(item.description);
|
|
112
|
-
},
|
|
113
|
-
enableSorting: false,
|
|
114
|
-
enableGlobalSearch: true
|
|
115
|
-
};
|
|
116
|
-
function AuthorField({ item }) {
|
|
117
|
-
const [isImageLoaded, setIsImageLoaded] = (0, import_element.useState)(false);
|
|
118
|
-
const { text, icon, imageUrl } = (0, import_hooks.useAddedBy)(item.type, item.id);
|
|
119
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.__experimentalHStack, { alignment: "left", spacing: 0, children: [
|
|
120
|
-
imageUrl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
121
|
-
"div",
|
|
122
|
-
{
|
|
123
|
-
className: (0, import_clsx.default)("fields-controls__author-avatar", {
|
|
124
|
-
"is-loaded": isImageLoaded
|
|
125
|
-
}),
|
|
126
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
127
|
-
"img",
|
|
128
|
-
{
|
|
129
|
-
onLoad: () => setIsImageLoaded(true),
|
|
130
|
-
alt: "",
|
|
131
|
-
src: imageUrl
|
|
132
|
-
}
|
|
133
|
-
)
|
|
134
|
-
}
|
|
135
|
-
),
|
|
136
|
-
!imageUrl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "fields-controls__author-icon", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Icon, { icon }) }),
|
|
137
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "fields-controls__author-name", children: text })
|
|
138
|
-
] });
|
|
139
|
-
}
|
|
140
|
-
var authorField = {
|
|
141
|
-
label: (0, import_i18n.__)("Author"),
|
|
142
|
-
id: "author",
|
|
143
|
-
getValue: ({ item }) => item.author_text ?? item.author,
|
|
144
|
-
render: AuthorField
|
|
145
|
-
};
|
|
146
|
-
var activeField = {
|
|
147
|
-
label: (0, import_i18n.__)("Status"),
|
|
148
|
-
id: "active",
|
|
149
|
-
type: "boolean",
|
|
150
|
-
getValue: ({ item }) => item._isActive,
|
|
151
|
-
render: function Render({ item }) {
|
|
152
|
-
const activeLabel = item._isCustom ? (0, import_i18n._x)("Active when used", "template") : (0, import_i18n._x)("Active", "template");
|
|
153
|
-
const activeIntent = item._isCustom ? "info" : "success";
|
|
154
|
-
const isActive = item._isActive;
|
|
155
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(WCBadge, { intent: isActive ? activeIntent : "default", children: isActive ? activeLabel : (0, import_i18n._x)("Inactive", "template") });
|
|
156
|
-
}
|
|
157
|
-
};
|
|
158
|
-
var useThemeField = () => {
|
|
159
|
-
const activeTheme = (0, import_data.useSelect)(
|
|
160
|
-
(select) => select(import_core_data.store).getCurrentTheme()
|
|
161
|
-
);
|
|
162
|
-
return (0, import_element.useMemo)(
|
|
163
|
-
() => ({
|
|
164
|
-
label: (0, import_i18n.__)("Compatible Theme"),
|
|
165
|
-
id: "theme",
|
|
166
|
-
getValue: ({ item }) => item.theme,
|
|
167
|
-
render: function Render3({ item }) {
|
|
168
|
-
if (item.theme === activeTheme.stylesheet) {
|
|
169
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(WCBadge, { intent: "success", children: item.theme });
|
|
170
|
-
}
|
|
171
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(WCBadge, { intent: "error", children: item.theme });
|
|
172
|
-
}
|
|
173
|
-
}),
|
|
174
|
-
[activeTheme]
|
|
175
|
-
);
|
|
176
|
-
};
|
|
177
|
-
var slugField = {
|
|
178
|
-
label: (0, import_i18n.__)("Template Type"),
|
|
179
|
-
id: "slug",
|
|
180
|
-
getValue: ({ item }) => item.slug,
|
|
181
|
-
render: function Render2({ item }) {
|
|
182
|
-
const defaultTemplateTypes = useAllDefaultTemplateTypes();
|
|
183
|
-
const defaultTemplateType = defaultTemplateTypes.find(
|
|
184
|
-
(type) => type.slug === item.slug
|
|
185
|
-
);
|
|
186
|
-
return defaultTemplateType?.title || (0, import_i18n._x)("Custom", "template type");
|
|
187
|
-
}
|
|
188
|
-
};
|
|
189
70
|
// Annotate the CommonJS export names for ESM import in node:
|
|
190
71
|
0 && (module.exports = {
|
|
191
|
-
|
|
192
|
-
authorField,
|
|
193
|
-
descriptionField,
|
|
194
|
-
previewField,
|
|
195
|
-
slugField,
|
|
196
|
-
useThemeField
|
|
72
|
+
previewField
|
|
197
73
|
});
|
|
198
74
|
//# sourceMappingURL=fields.cjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/page-templates/fields.jsx"],
|
|
4
|
-
"sourcesContent": ["import
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA
|
|
6
|
-
"names": ["
|
|
4
|
+
"sourcesContent": ["import { __ } from '@wordpress/i18n';\nimport { useMemo } from '@wordpress/element';\nimport { parse } from '@wordpress/blocks';\nimport { BlockPreview } from '@wordpress/block-editor';\nimport {\n\tEditorProvider,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport usePatternSettings from '../page-patterns/use-pattern-settings';\nimport { unlock } from '../../lock-unlock';\n\nconst { useStyle } = unlock( editorPrivateApis );\n\nfunction PreviewField( { item } ) {\n\tconst settings = usePatternSettings();\n\tconst backgroundColor = useStyle( 'color.background' ) ?? 'white';\n\tconst blocks = useMemo( () => {\n\t\treturn parse( item.content.raw );\n\t}, [ item.content.raw ] );\n\n\tconst isEmpty = ! blocks?.length;\n\t// Wrap everything in a block editor provider to ensure 'styles' that are needed\n\t// for the previews are synced between the site editor store and the block editor store.\n\t// Additionally we need to have the `__experimentalBlockPatterns` setting in order to\n\t// render patterns inside the previews.\n\t// TODO: Same approach is used in the patterns list and it becomes obvious that some of\n\t// the block editor settings are needed in context where we don't have the block editor.\n\t// Explore how we can solve this in a better way.\n\treturn (\n\t\t<EditorProvider post={ item } settings={ settings }>\n\t\t\t<div\n\t\t\t\tclassName=\"page-templates-preview-field\"\n\t\t\t\tstyle={ { backgroundColor } }\n\t\t\t>\n\t\t\t\t{ isEmpty && __( 'Empty template' ) }\n\t\t\t\t{ ! isEmpty && (\n\t\t\t\t\t<BlockPreview.Async>\n\t\t\t\t\t\t<BlockPreview blocks={ blocks } />\n\t\t\t\t\t</BlockPreview.Async>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</EditorProvider>\n\t);\n}\n\nexport const previewField = {\n\tlabel: __( 'Preview' ),\n\tid: 'preview',\n\trender: PreviewField,\n\tenableSorting: false,\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAmB;AACnB,qBAAwB;AACxB,oBAAsB;AACtB,0BAA6B;AAC7B,oBAGO;AACP,kCAA+B;AAC/B,yBAAuB;AAqBpB;AAnBH,IAAM,EAAE,SAAS,QAAI,2BAAQ,cAAAA,WAAkB;AAE/C,SAAS,aAAc,EAAE,KAAK,GAAI;AACjC,QAAM,eAAW,4BAAAC,SAAmB;AACpC,QAAM,kBAAkB,SAAU,kBAAmB,KAAK;AAC1D,QAAM,aAAS,wBAAS,MAAM;AAC7B,eAAO,qBAAO,KAAK,QAAQ,GAAI;AAAA,EAChC,GAAG,CAAE,KAAK,QAAQ,GAAI,CAAE;AAExB,QAAM,UAAU,CAAE,QAAQ;AAQ1B,SACC,4CAAC,gCAAe,MAAO,MAAO,UAC7B;AAAA,IAAC;AAAA;AAAA,MACA,WAAU;AAAA,MACV,OAAQ,EAAE,gBAAgB;AAAA,MAExB;AAAA,uBAAW,gBAAI,gBAAiB;AAAA,QAChC,CAAE,WACH,4CAAC,iCAAa,OAAb,EACA,sDAAC,oCAAa,QAAkB,GACjC;AAAA;AAAA;AAAA,EAEF,GACD;AAEF;AAEO,IAAM,eAAe;AAAA,EAC3B,WAAO,gBAAI,SAAU;AAAA,EACrB,IAAI;AAAA,EACJ,QAAQ;AAAA,EACR,eAAe;AAChB;",
|
|
6
|
+
"names": ["editorPrivateApis", "usePatternSettings"]
|
|
7
7
|
}
|