@wordpress/edit-post 8.49.1 → 8.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/CHANGELOG.md +2 -0
- package/build/components/back-button/fullscreen-mode-close.cjs +21 -121
- package/build/components/back-button/fullscreen-mode-close.cjs.map +3 -3
- package/build/components/layout/index.cjs +6 -6
- package/build/components/layout/index.cjs.map +2 -2
- package/build/index.cjs +3 -1
- package/build/index.cjs.map +2 -2
- package/build-module/components/back-button/fullscreen-mode-close.mjs +23 -123
- package/build-module/components/back-button/fullscreen-mode-close.mjs.map +2 -2
- package/build-module/components/layout/index.mjs +6 -6
- package/build-module/components/layout/index.mjs.map +2 -2
- package/build-module/index.mjs +3 -1
- package/build-module/index.mjs.map +2 -2
- package/build-style/classic-rtl.css +6 -0
- package/build-style/classic.css +6 -0
- package/build-style/style-rtl.css +24 -99
- package/build-style/style.css +24 -99
- package/package.json +34 -34
- package/src/components/back-button/fullscreen-mode-close.js +14 -139
- package/src/components/back-button/style.scss +9 -49
- package/src/components/layout/index.js +4 -5
- package/src/components/preferences-modal/test/__snapshots__/enable-custom-fields.js.snap +16 -148
- package/src/components/preferences-modal/test/__snapshots__/meta-boxes-section.js.snap +24 -117
- package/src/index.js +3 -1
- package/src/style.scss +13 -6
- package/build-style/experimental-omnibar-rtl.css +0 -50
- package/build-style/experimental-omnibar.css +0 -50
- package/src/experimental-omnibar.scss +0 -67
|
@@ -1,147 +1,47 @@
|
|
|
1
1
|
// packages/edit-post/src/components/back-button/fullscreen-mode-close.js
|
|
2
|
-
import clsx from "clsx";
|
|
3
2
|
import { useSelect } from "@wordpress/data";
|
|
4
|
-
import {
|
|
5
|
-
Button,
|
|
6
|
-
Icon as WCIcon,
|
|
7
|
-
__unstableMotion as motion
|
|
8
|
-
} from "@wordpress/components";
|
|
3
|
+
import { Button, Icon as WCIcon } from "@wordpress/components";
|
|
9
4
|
import { __, isRTL } from "@wordpress/i18n";
|
|
10
5
|
import { addQueryArgs } from "@wordpress/url";
|
|
11
|
-
import {
|
|
12
|
-
wordpress,
|
|
13
|
-
arrowUpLeft,
|
|
14
|
-
arrowUpRight,
|
|
15
|
-
chevronLeft,
|
|
16
|
-
chevronRight
|
|
17
|
-
} from "@wordpress/icons";
|
|
6
|
+
import { chevronLeft, chevronRight } from "@wordpress/icons";
|
|
18
7
|
import { store as editorStore } from "@wordpress/editor";
|
|
19
8
|
import { store as coreStore } from "@wordpress/core-data";
|
|
20
|
-
import { useReducedMotion } from "@wordpress/compose";
|
|
21
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
22
|
-
var siteIconVariants = {
|
|
23
|
-
edit: {
|
|
24
|
-
clipPath: "inset(0% round 0px)"
|
|
25
|
-
},
|
|
26
|
-
hover: {
|
|
27
|
-
clipPath: "inset( 22% round 2px )"
|
|
28
|
-
},
|
|
29
|
-
tap: {
|
|
30
|
-
clipPath: "inset(0% round 0px)"
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
var toggleHomeIconVariants = {
|
|
34
|
-
edit: {
|
|
35
|
-
opacity: 0,
|
|
36
|
-
scale: 0.2
|
|
37
|
-
},
|
|
38
|
-
hover: {
|
|
39
|
-
opacity: 1,
|
|
40
|
-
scale: 1,
|
|
41
|
-
clipPath: "inset( 22% round 2px )"
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
10
|
function FullscreenModeClose({ showTooltip, icon, href, initialPost }) {
|
|
45
|
-
const
|
|
11
|
+
const postType = useSelect(
|
|
46
12
|
(select) => {
|
|
47
13
|
const { getCurrentPostType } = select(editorStore);
|
|
48
|
-
const {
|
|
49
|
-
|
|
50
|
-
const _postType = initialPost?.type || getCurrentPostType();
|
|
51
|
-
return {
|
|
52
|
-
isRequestingSiteIcon: isResolving("getEntityRecord", [
|
|
53
|
-
"root",
|
|
54
|
-
"__unstableBase",
|
|
55
|
-
void 0
|
|
56
|
-
]),
|
|
57
|
-
postType: getPostType(_postType),
|
|
58
|
-
siteIconUrl: siteData.site_icon_url
|
|
59
|
-
};
|
|
14
|
+
const { getPostType } = select(coreStore);
|
|
15
|
+
return getPostType(initialPost?.type || getCurrentPostType());
|
|
60
16
|
},
|
|
61
17
|
[initialPost?.type]
|
|
62
18
|
);
|
|
63
|
-
const disableMotion = useReducedMotion();
|
|
64
|
-
const transition = {
|
|
65
|
-
duration: disableMotion ? 0 : 0.2
|
|
66
|
-
};
|
|
67
19
|
if (!postType) {
|
|
68
20
|
return null;
|
|
69
21
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
22
|
+
const buttonHref = href ?? addQueryArgs("edit.php", {
|
|
23
|
+
post_type: postType.slug
|
|
24
|
+
});
|
|
25
|
+
const buttonLabel = postType?.labels?.view_items ?? __("Back");
|
|
26
|
+
return /* @__PURE__ */ jsxs("div", { className: "edit-post-fullscreen-mode-close__view-mode-toggle", children: [
|
|
27
|
+
/* @__PURE__ */ jsx(
|
|
28
|
+
Button,
|
|
76
29
|
{
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
30
|
+
__next40pxDefaultSize: true,
|
|
31
|
+
className: "edit-post-fullscreen-mode-close",
|
|
32
|
+
href: buttonHref,
|
|
33
|
+
label: buttonLabel,
|
|
34
|
+
showTooltip,
|
|
35
|
+
tooltipPosition: "bottom"
|
|
80
36
|
}
|
|
81
|
-
)
|
|
82
|
-
|
|
83
|
-
siteIconContent = /* @__PURE__ */ jsx(
|
|
37
|
+
),
|
|
38
|
+
/* @__PURE__ */ jsx("div", { className: "edit-post-fullscreen-mode-close__back-icon", children: /* @__PURE__ */ jsx(
|
|
84
39
|
WCIcon,
|
|
85
40
|
{
|
|
86
|
-
|
|
87
|
-
icon: wordpress,
|
|
88
|
-
size: 48
|
|
41
|
+
icon: icon ?? (isRTL() ? chevronRight : chevronLeft)
|
|
89
42
|
}
|
|
90
|
-
)
|
|
91
|
-
}
|
|
92
|
-
const buttonIcon = icon ? /* @__PURE__ */ jsx(WCIcon, { size: "36px", icon }) : /* @__PURE__ */ jsx("div", { className: "edit-post-fullscreen-mode-close-site-icon", children: siteIconContent });
|
|
93
|
-
const classes = clsx("edit-post-fullscreen-mode-close", {
|
|
94
|
-
"has-icon": siteIconUrl
|
|
95
|
-
});
|
|
96
|
-
const buttonHref = href ?? addQueryArgs("edit.php", {
|
|
97
|
-
post_type: postType.slug
|
|
98
|
-
});
|
|
99
|
-
const buttonLabel = postType?.labels?.view_items ?? __("Back");
|
|
100
|
-
const hasAdminBarInEditor = window.__experimentalAdminBarInEditor;
|
|
101
|
-
return /* @__PURE__ */ jsxs(
|
|
102
|
-
motion.div,
|
|
103
|
-
{
|
|
104
|
-
className: "edit-post-fullscreen-mode-close__view-mode-toggle",
|
|
105
|
-
animate: "edit",
|
|
106
|
-
initial: "edit",
|
|
107
|
-
whileHover: "hover",
|
|
108
|
-
whileTap: "tap",
|
|
109
|
-
transition,
|
|
110
|
-
children: [
|
|
111
|
-
/* @__PURE__ */ jsx(
|
|
112
|
-
Button,
|
|
113
|
-
{
|
|
114
|
-
__next40pxDefaultSize: true,
|
|
115
|
-
className: classes,
|
|
116
|
-
href: buttonHref,
|
|
117
|
-
label: buttonLabel,
|
|
118
|
-
showTooltip,
|
|
119
|
-
tooltipPosition: "bottom",
|
|
120
|
-
children: !hasAdminBarInEditor && /* @__PURE__ */ jsx(
|
|
121
|
-
motion.div,
|
|
122
|
-
{
|
|
123
|
-
variants: !disableMotion && siteIconVariants,
|
|
124
|
-
children: /* @__PURE__ */ jsx("div", { className: "edit-post-fullscreen-mode-close__view-mode-toggle-icon", children: buttonIcon })
|
|
125
|
-
}
|
|
126
|
-
)
|
|
127
|
-
}
|
|
128
|
-
),
|
|
129
|
-
hasAdminBarInEditor ? /* @__PURE__ */ jsx("div", { className: "edit-post-fullscreen-mode-close__back-icon", children: /* @__PURE__ */ jsx(WCIcon, { icon: isRTL() ? chevronRight : chevronLeft }) }) : /* @__PURE__ */ jsx(
|
|
130
|
-
motion.div,
|
|
131
|
-
{
|
|
132
|
-
className: clsx(
|
|
133
|
-
"edit-post-fullscreen-mode-close__back-icon",
|
|
134
|
-
{
|
|
135
|
-
"has-site-icon": siteIconUrl
|
|
136
|
-
}
|
|
137
|
-
),
|
|
138
|
-
variants: !disableMotion && toggleHomeIconVariants,
|
|
139
|
-
children: /* @__PURE__ */ jsx(WCIcon, { icon: isRTL() ? arrowUpRight : arrowUpLeft })
|
|
140
|
-
}
|
|
141
|
-
)
|
|
142
|
-
]
|
|
143
|
-
}
|
|
144
|
-
);
|
|
43
|
+
) })
|
|
44
|
+
] });
|
|
145
45
|
}
|
|
146
46
|
var fullscreen_mode_close_default = FullscreenModeClose;
|
|
147
47
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/back-button/fullscreen-mode-close.js"],
|
|
4
|
-
"sourcesContent": ["/**\n *
|
|
5
|
-
"mappings": ";AAGA,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { Button, Icon as WCIcon } from '@wordpress/components';\nimport { __, isRTL } from '@wordpress/i18n';\nimport { addQueryArgs } from '@wordpress/url';\nimport { chevronLeft, chevronRight } from '@wordpress/icons';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\n\nfunction FullscreenModeClose( { showTooltip, icon, href, initialPost } ) {\n\tconst postType = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getCurrentPostType } = select( editorStore );\n\t\t\tconst { getPostType } = select( coreStore );\n\t\t\treturn getPostType( initialPost?.type || getCurrentPostType() );\n\t\t},\n\t\t[ initialPost?.type ]\n\t);\n\n\tif ( ! postType ) {\n\t\treturn null;\n\t}\n\n\tconst buttonHref =\n\t\thref ??\n\t\taddQueryArgs( 'edit.php', {\n\t\t\tpost_type: postType.slug,\n\t\t} );\n\n\tconst buttonLabel = postType?.labels?.view_items ?? __( 'Back' );\n\n\treturn (\n\t\t<div className=\"edit-post-fullscreen-mode-close__view-mode-toggle\">\n\t\t\t<Button\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tclassName=\"edit-post-fullscreen-mode-close\"\n\t\t\t\thref={ buttonHref }\n\t\t\t\tlabel={ buttonLabel }\n\t\t\t\tshowTooltip={ showTooltip }\n\t\t\t\ttooltipPosition=\"bottom\"\n\t\t\t/>\n\t\t\t<div className=\"edit-post-fullscreen-mode-close__back-icon\">\n\t\t\t\t<WCIcon\n\t\t\t\t\ticon={ icon ?? ( isRTL() ? chevronRight : chevronLeft ) }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nexport default FullscreenModeClose;\n"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,iBAAiB;AAC1B,SAAS,QAAQ,QAAQ,cAAc;AACvC,SAAS,IAAI,aAAa;AAC1B,SAAS,oBAAoB;AAC7B,SAAS,aAAa,oBAAoB;AAC1C,SAAS,SAAS,mBAAmB;AACrC,SAAS,SAAS,iBAAiB;AAyBjC,SACC,KADD;AAvBF,SAAS,oBAAqB,EAAE,aAAa,MAAM,MAAM,YAAY,GAAI;AACxE,QAAM,WAAW;AAAA,IAChB,CAAE,WAAY;AACb,YAAM,EAAE,mBAAmB,IAAI,OAAQ,WAAY;AACnD,YAAM,EAAE,YAAY,IAAI,OAAQ,SAAU;AAC1C,aAAO,YAAa,aAAa,QAAQ,mBAAmB,CAAE;AAAA,IAC/D;AAAA,IACA,CAAE,aAAa,IAAK;AAAA,EACrB;AAEA,MAAK,CAAE,UAAW;AACjB,WAAO;AAAA,EACR;AAEA,QAAM,aACL,QACA,aAAc,YAAY;AAAA,IACzB,WAAW,SAAS;AAAA,EACrB,CAAE;AAEH,QAAM,cAAc,UAAU,QAAQ,cAAc,GAAI,MAAO;AAE/D,SACC,qBAAC,SAAI,WAAU,qDACd;AAAA;AAAA,MAAC;AAAA;AAAA,QACA,uBAAqB;AAAA,QACrB,WAAU;AAAA,QACV,MAAO;AAAA,QACP,OAAQ;AAAA,QACR;AAAA,QACA,iBAAgB;AAAA;AAAA,IACjB;AAAA,IACA,oBAAC,SAAI,WAAU,8CACd;AAAA,MAAC;AAAA;AAAA,QACA,MAAO,SAAU,MAAM,IAAI,eAAe;AAAA;AAAA,IAC3C,GACD;AAAA,KACD;AAEF;AAEA,IAAO,gCAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -322,8 +322,7 @@ function Layout({
|
|
|
322
322
|
isDistractionFree,
|
|
323
323
|
showMetaBoxes,
|
|
324
324
|
isWelcomeGuideVisible,
|
|
325
|
-
templateId
|
|
326
|
-
isDevicePreview
|
|
325
|
+
templateId
|
|
327
326
|
} = useSelect(
|
|
328
327
|
(select) => {
|
|
329
328
|
const { get } = select(preferencesStore);
|
|
@@ -340,7 +339,9 @@ function Layout({
|
|
|
340
339
|
const { getBlockSelectionStart, isZoomOut } = unlock(
|
|
341
340
|
select(blockEditorStore)
|
|
342
341
|
);
|
|
343
|
-
const { getEditorMode, getDefaultRenderingMode
|
|
342
|
+
const { getEditorMode, getDefaultRenderingMode } = unlock(
|
|
343
|
+
select(editorStore)
|
|
344
|
+
);
|
|
344
345
|
const isNotDesignPostType = !DESIGN_POST_TYPES.includes(currentPostType);
|
|
345
346
|
const isDirectlyEditingPattern = currentPostType === "wp_block" && !onNavigateToPreviousEntityRecord;
|
|
346
347
|
const _templateId = getTemplateId(currentPostType, currentPostId);
|
|
@@ -355,8 +356,7 @@ function Layout({
|
|
|
355
356
|
isDistractionFree: get("core", "distractionFree"),
|
|
356
357
|
showMetaBoxes: isNotDesignPostType && !isZoomOut() || isDirectlyEditingPattern,
|
|
357
358
|
isWelcomeGuideVisible: isFeatureActive("welcomeGuide"),
|
|
358
|
-
templateId: supportsTemplateMode && isViewable && canViewTemplate && !isEditingTemplate ? _templateId : null
|
|
359
|
-
isDevicePreview: getDeviceType() !== "Desktop"
|
|
359
|
+
templateId: supportsTemplateMode && isViewable && canViewTemplate && !isEditingTemplate ? _templateId : null
|
|
360
360
|
};
|
|
361
361
|
},
|
|
362
362
|
[
|
|
@@ -477,7 +477,7 @@ function Layout({
|
|
|
477
477
|
extraContent: !isDistractionFree && showMetaBoxes && /* @__PURE__ */ jsx(
|
|
478
478
|
MetaBoxesMain,
|
|
479
479
|
{
|
|
480
|
-
isLegacy:
|
|
480
|
+
isLegacy: !shouldIframe
|
|
481
481
|
}
|
|
482
482
|
),
|
|
483
483
|
children: [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/layout/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 {\n\tAutosaveMonitor,\n\tLocalAutosaveMonitor,\n\tUnsavedChangesWarning,\n\tEditorKeyboardShortcutsRegister,\n\tErrorBoundary,\n\tPostLockedModal,\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { getLayoutStyles } from '@wordpress/global-styles-engine';\nimport { PluginArea } from '@wordpress/plugins';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tuseCallback,\n\tuseMemo,\n\tuseId,\n\tuseRef,\n\tuseState,\n} from '@wordpress/element';\nimport { chevronDown, chevronUp } from '@wordpress/icons';\nimport { SnackbarNotices, store as noticesStore } from '@wordpress/notices';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { privateApis as commandsPrivateApis } from '@wordpress/commands';\nimport { privateApis as blockLibraryPrivateApis } from '@wordpress/block-library';\nimport { addQueryArgs } from '@wordpress/url';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tIcon as WCIcon,\n\tSlotFillProvider,\n\t__unstableUseNavigateRegions as useNavigateRegions,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport {\n\tuseMediaQuery,\n\tuseMergeRefs,\n\tuseRefEffect,\n\tuseViewportMatch,\n} from '@wordpress/compose';\nimport { Tooltip, VisuallyHidden } from '@wordpress/ui';\n\n/**\n * Internal dependencies\n */\nimport BackButton from '../back-button';\nimport EditorInitialization from '../editor-initialization';\nimport EditPostKeyboardShortcuts from '../keyboard-shortcuts';\nimport InitPatternModal from '../init-pattern-modal';\nimport BrowserURL from '../browser-url';\nimport MetaBoxes from '../meta-boxes';\nimport PostEditorMoreMenu from '../more-menu';\nimport WelcomeGuide from '../welcome-guide';\nimport { store as editPostStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport useEditPostCommands from '../../commands/use-commands';\nimport { useShouldIframe } from './use-should-iframe';\nimport useNavigateToEntityRecord from '../../hooks/use-navigate-to-entity-record';\nimport { useMetaBoxInitialization } from '../meta-boxes/use-meta-box-initialization';\n\nconst { useCommandContext } = unlock( commandsPrivateApis );\n/** @type {{} & {useDrag: import('@use-gesture/react').useDrag}} */\nconst { useDrag } = unlock( componentsPrivateApis );\nconst { Editor, FullscreenMode, UploadProgressSnackbar } =\n\tunlock( editorPrivateApis );\nconst { BlockKeyboardShortcuts } = unlock( blockLibraryPrivateApis );\nconst DESIGN_POST_TYPES = [\n\t'wp_template',\n\t'wp_template_part',\n\t'wp_block',\n\t'wp_navigation',\n];\n\nfunction useEditorStyles( settings ) {\n\tconst { hasThemeStyleSupport } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\thasThemeStyleSupport:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'themeStyles' ),\n\t\t};\n\t}, [] );\n\n\t// Compute the default styles.\n\treturn useMemo( () => {\n\t\tconst presetStyles =\n\t\t\tsettings.styles?.filter(\n\t\t\t\t( style ) =>\n\t\t\t\t\tstyle.__unstableType && style.__unstableType !== 'theme'\n\t\t\t) ?? [];\n\n\t\tconst defaultEditorStyles = [\n\t\t\t...( settings?.defaultEditorStyles ?? [] ),\n\t\t\t...presetStyles,\n\t\t];\n\n\t\t// Has theme styles if the theme supports them and if some styles were not preset styles (in which case they're theme styles).\n\t\tconst hasThemeStyles =\n\t\t\thasThemeStyleSupport &&\n\t\t\tpresetStyles.length !== ( settings.styles?.length ?? 0 );\n\n\t\t// If theme styles are not present or displayed, ensure that\n\t\t// base layout styles are still present in the editor.\n\t\tif ( ! settings.disableLayoutStyles && ! hasThemeStyles ) {\n\t\t\tdefaultEditorStyles.push( {\n\t\t\t\tcss: getLayoutStyles( {\n\t\t\t\t\tstyle: {},\n\t\t\t\t\tselector: 'body',\n\t\t\t\t\thasBlockGapSupport: false,\n\t\t\t\t\thasFallbackGapSupport: true,\n\t\t\t\t\tfallbackGapValue: '0.5em',\n\t\t\t\t} ),\n\t\t\t} );\n\t\t}\n\n\t\treturn hasThemeStyles ? settings.styles ?? [] : defaultEditorStyles;\n\t}, [\n\t\tsettings.defaultEditorStyles,\n\t\tsettings.disableLayoutStyles,\n\t\tsettings.styles,\n\t\thasThemeStyleSupport,\n\t] );\n}\n\n/**\n * @param {Object} props\n * @param {boolean} props.isLegacy True for device previews where split view is disabled.\n */\nfunction MetaBoxesMain( { isLegacy } ) {\n\tconst [ isOpen, openHeight, hasAnyVisible ] = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { isMetaBoxLocationVisible } = select( editPostStore );\n\t\treturn [\n\t\t\t!! get( 'core/edit-post', 'metaBoxesMainIsOpen' ),\n\t\t\tget( 'core/edit-post', 'metaBoxesMainOpenHeight' ),\n\t\t\tisMetaBoxLocationVisible( 'normal' ) ||\n\t\t\t\tisMetaBoxLocationVisible( 'advanced' ) ||\n\t\t\t\tisMetaBoxLocationVisible( 'side' ),\n\t\t];\n\t}, [] );\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst isShort = useMediaQuery( '(max-height: 549px)' );\n\n\tconst [ { min = 0, max }, setHeightConstraints ] = useState( () => ( {} ) );\n\t// Keeps the resizable area’s size constraints updated taking into account\n\t// editor notices. The constraints are also used to derive the value for the\n\t// aria-valuenow attribute on the separator.\n\tconst effectSizeConstraints = useRefEffect( ( node ) => {\n\t\tconst container = node.closest(\n\t\t\t'.interface-interface-skeleton__content'\n\t\t);\n\t\tif ( ! container ) {\n\t\t\treturn;\n\t\t}\n\t\tconst noticeContainer = container.querySelector(\n\t\t\t':scope > .notices-inline-notices-wrapper'\n\t\t);\n\t\tconst resizeHandle = container.querySelector(\n\t\t\t'.edit-post-meta-boxes-main__presenter'\n\t\t);\n\t\tconst deriveConstraints = () => {\n\t\t\tconst fullHeight = container.offsetHeight;\n\t\t\tlet nextMax = fullHeight;\n\t\t\tif ( noticeContainer ) {\n\t\t\t\tnextMax -= noticeContainer.offsetHeight;\n\t\t\t}\n\t\t\tconst nextMin = resizeHandle?.offsetHeight ?? 0;\n\t\t\tsetHeightConstraints( { min: nextMin, max: nextMax } );\n\t\t};\n\t\tconst observer = new window.ResizeObserver( deriveConstraints );\n\t\tobserver.observe( container );\n\t\tif ( noticeContainer ) {\n\t\t\tobserver.observe( noticeContainer );\n\t\t}\n\t\treturn () => observer.disconnect();\n\t}, [] );\n\tconst metaBoxesMainRef = useRef();\n\tconst setMainRefs = useMergeRefs( [\n\t\tmetaBoxesMainRef,\n\t\teffectSizeConstraints,\n\t] );\n\n\tconst separatorRef = useRef();\n\tconst separatorHelpId = useId();\n\n\tconst heightRef = useRef();\n\n\tconst getAriaValueNow = ( height ) =>\n\t\tMath.round( ( ( height - min ) / ( max - min ) ) * 100 );\n\tconst persistIsOpen = ( to = ! isOpen ) =>\n\t\tsetPreference( 'core/edit-post', 'metaBoxesMainIsOpen', to );\n\n\t/**\n\t * @param {number|'auto'} [candidateHeight] Height in pixels or 'auto'.\n\t * @param {boolean} isPersistent Whether to persist the height in preferences.\n\t */\n\tconst applyHeight = ( candidateHeight = 'auto', isPersistent ) => {\n\t\tlet styleHeight;\n\t\tif ( candidateHeight === 'auto' ) {\n\t\t\tisPersistent = false; // Just in case — “auto” should never persist.\n\t\t\tstyleHeight = candidateHeight;\n\t\t} else {\n\t\t\tcandidateHeight = Math.min( max, Math.max( min, candidateHeight ) );\n\t\t\theightRef.current = candidateHeight;\n\t\t\tstyleHeight = `${ candidateHeight }px`;\n\t\t}\n\t\tif ( isPersistent ) {\n\t\t\tsetPreference(\n\t\t\t\t'core/edit-post',\n\t\t\t\t'metaBoxesMainOpenHeight',\n\t\t\t\tcandidateHeight\n\t\t\t);\n\t\t}\n\t\t// Applies imperative DOM updates only when not persisting the value\n\t\t// because otherwise it's done by the subsequent render.\n\t\telse {\n\t\t\tmetaBoxesMainRef.current.style.height = styleHeight;\n\t\t\tif ( ! isShort ) {\n\t\t\t\tseparatorRef.current.ariaValueNow =\n\t\t\t\t\tgetAriaValueNow( candidateHeight );\n\t\t\t}\n\t\t}\n\t};\n\n\t// useDrag includes keyboard support with arrow keys emulating a drag.\n\t// TODO: Support more/all keyboard interactions from the window splitter pattern:\n\t// https://www.w3.org/WAI/ARIA/apg/patterns/windowsplitter/\n\tconst bindDragGesture = useDrag(\n\t\t( { movement, first, last, memo, tap, args } ) => {\n\t\t\tconst pane = metaBoxesMainRef.current;\n\t\t\tconst [ , yMovement ] = movement;\n\t\t\tif ( first ) {\n\t\t\t\tpane.classList.add( 'is-resizing' );\n\t\t\t\tlet fromHeight = heightRef.current ?? pane.offsetHeight;\n\t\t\t\tif ( isOpen ) {\n\t\t\t\t\t// Starts from max in case shortening the window has imposed it.\n\t\t\t\t\tif ( fromHeight > max ) {\n\t\t\t\t\t\tfromHeight = max;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tfromHeight = min;\n\t\t\t\t}\n\t\t\t\tapplyHeight( fromHeight - yMovement );\n\t\t\t\treturn { fromHeight };\n\t\t\t}\n\n\t\t\tif ( ! first && ! last && ! tap ) {\n\t\t\t\tapplyHeight( memo.fromHeight - yMovement );\n\t\t\t\treturn memo;\n\t\t\t}\n\t\t\t// Here, `last === true` – it’s the final event of the gesture.\n\n\t\t\tpane.classList.remove( 'is-resizing' );\n\t\t\tif ( tap ) {\n\t\t\t\tconst [ onTap ] = args;\n\t\t\t\tonTap?.();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst nextIsOpen = heightRef.current > min;\n\t\t\tpersistIsOpen( nextIsOpen );\n\t\t\t// Persists height only if still open. This is so that when closed by a drag the\n\t\t\t// prior height can be restored by the toggle button instead of having to drag\n\t\t\t// the pane open again.\n\t\t\tapplyHeight( heightRef.current, nextIsOpen );\n\t\t},\n\t\t{ keyboardDisplacement: 20, filterTaps: true }\n\t);\n\n\tif ( ! hasAnyVisible ) {\n\t\treturn;\n\t}\n\n\tconst contents = (\n\t\t<div\n\t\t\t// The class name 'edit-post-layout__metaboxes' is retained because some plugins use it.\n\t\t\tclassName=\"edit-post-layout__metaboxes edit-post-meta-boxes-main__liner\"\n\t\t\thidden={ ! isLegacy && ! isOpen }\n\t\t>\n\t\t\t<MetaBoxes location=\"normal\" />\n\t\t\t<MetaBoxes location=\"advanced\" />\n\t\t</div>\n\t);\n\n\tif ( isLegacy ) {\n\t\treturn contents;\n\t}\n\n\tconst isAutoHeight = openHeight === undefined;\n\tconst usedOpenHeight = isShort ? 'auto' : openHeight;\n\tconst usedHeight = isOpen ? usedOpenHeight : min;\n\n\tconst usedAriaValueNow =\n\t\tmax === undefined || isAutoHeight ? 50 : getAriaValueNow( usedHeight );\n\n\tconst paneLabel = __( 'Meta Boxes' );\n\n\t// The toggle button. It also resizes when the viewport is tall to provide\n\t// a larger hit area than the small separator button.\n\tconst toggle = (\n\t\t<button\n\t\t\taria-expanded={ isOpen }\n\t\t\t// Toggles for all clicks when short and only keyboard “clicks” when\n\t\t\t// resizable because pointer input is handled by the drag gesture.\n\t\t\tonClick={ ( { detail } ) => {\n\t\t\t\tif ( isShort || ! detail ) {\n\t\t\t\t\tpersistIsOpen();\n\t\t\t\t}\n\t\t\t} }\n\t\t\t// Passes a toggle callback that the drag gesture handler calls when\n\t\t\t// it interprets the input as a click/tap.\n\t\t\t{ ...( ! isShort && bindDragGesture( persistIsOpen ) ) }\n\t\t>\n\t\t\t{ paneLabel }\n\t\t\t<WCIcon icon={ isOpen ? chevronUp : chevronDown } />\n\t\t</button>\n\t);\n\n\t// The separator button that provides a11y for resizing.\n\tconst separator = ! isShort && (\n\t\t<>\n\t\t\t<Tooltip.Root>\n\t\t\t\t<Tooltip.Trigger\n\t\t\t\t\trender={\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\tref={ separatorRef }\n\t\t\t\t\t\t\trole=\"separator\" // eslint-disable-line jsx-a11y/no-interactive-element-to-noninteractive-role\n\t\t\t\t\t\t\taria-valuenow={ usedAriaValueNow }\n\t\t\t\t\t\t\taria-label={ __( 'Drag to resize' ) }\n\t\t\t\t\t\t\taria-describedby={ separatorHelpId }\n\t\t\t\t\t\t\t{ ...bindDragGesture() }\n\t\t\t\t\t\t/>\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t<Tooltip.Popup>{ __( 'Drag to resize' ) }</Tooltip.Popup>\n\t\t\t</Tooltip.Root>\n\t\t\t<VisuallyHidden id={ separatorHelpId }>\n\t\t\t\t{ __(\n\t\t\t\t\t'Use up and down arrow keys to resize the meta box pane.'\n\t\t\t\t) }\n\t\t\t</VisuallyHidden>\n\t\t</>\n\t);\n\n\treturn (\n\t\t<NavigableRegion\n\t\t\tariaLabel={ paneLabel }\n\t\t\tref={ setMainRefs }\n\t\t\tclassName={ clsx(\n\t\t\t\t'edit-post-meta-boxes-main',\n\t\t\t\t! isShort && 'is-resizable'\n\t\t\t) }\n\t\t\tstyle={ { height: usedHeight } }\n\t\t>\n\t\t\t<div className=\"edit-post-meta-boxes-main__presenter\">\n\t\t\t\t{ toggle }\n\t\t\t\t{ separator }\n\t\t\t</div>\n\t\t\t{ contents }\n\t\t</NavigableRegion>\n\t);\n}\n\nfunction Layout( {\n\tpostId: initialPostId,\n\tpostType: initialPostType,\n\tsettings,\n\tinitialEdits,\n} ) {\n\tuseEditPostCommands();\n\tconst shouldIframe = useShouldIframe();\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst {\n\t\tcurrentPost: { postId: currentPostId, postType: currentPostType },\n\t\tonNavigateToEntityRecord,\n\t\tonNavigateToPreviousEntityRecord,\n\t} = useNavigateToEntityRecord(\n\t\tinitialPostId,\n\t\tinitialPostType,\n\t\t'post-only'\n\t);\n\tconst isEditingTemplate = currentPostType === 'wp_template';\n\tconst {\n\t\tmode,\n\t\tisFullscreenActive,\n\t\thasResolvedMode,\n\t\thasActiveMetaboxes,\n\t\thasBlockSelected,\n\t\tshowIconLabels,\n\t\tisDistractionFree,\n\t\tshowMetaBoxes,\n\t\tisWelcomeGuideVisible,\n\t\ttemplateId,\n\t\tisDevicePreview,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst { isFeatureActive, hasMetaBoxes } = select( editPostStore );\n\t\t\tconst { canUser, getPostType, getTemplateId } = unlock(\n\t\t\t\tselect( coreStore )\n\t\t\t);\n\n\t\t\tconst supportsTemplateMode = settings.supportsTemplateMode;\n\t\t\tconst isViewable =\n\t\t\t\tgetPostType( currentPostType )?.viewable ?? false;\n\t\t\tconst canViewTemplate = canUser( 'read', {\n\t\t\t\tkind: 'postType',\n\t\t\t\tname: 'wp_template',\n\t\t\t} );\n\t\t\tconst { getBlockSelectionStart, isZoomOut } = unlock(\n\t\t\t\tselect( blockEditorStore )\n\t\t\t);\n\t\t\tconst { getEditorMode, getDefaultRenderingMode, getDeviceType } =\n\t\t\t\tunlock( select( editorStore ) );\n\t\t\tconst isNotDesignPostType =\n\t\t\t\t! DESIGN_POST_TYPES.includes( currentPostType );\n\t\t\tconst isDirectlyEditingPattern =\n\t\t\t\tcurrentPostType === 'wp_block' &&\n\t\t\t\t! onNavigateToPreviousEntityRecord;\n\t\t\tconst _templateId = getTemplateId( currentPostType, currentPostId );\n\t\t\tconst defaultMode = getDefaultRenderingMode( currentPostType );\n\n\t\t\treturn {\n\t\t\t\tmode: getEditorMode(),\n\t\t\t\tisFullscreenActive: isFeatureActive( 'fullscreenMode' ),\n\t\t\t\thasActiveMetaboxes: hasMetaBoxes(),\n\t\t\t\thasResolvedMode:\n\t\t\t\t\tdefaultMode === 'template-locked'\n\t\t\t\t\t\t? !! _templateId\n\t\t\t\t\t\t: defaultMode !== undefined,\n\t\t\t\thasBlockSelected: !! getBlockSelectionStart(),\n\t\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\t\tshowMetaBoxes:\n\t\t\t\t\t( isNotDesignPostType && ! isZoomOut() ) ||\n\t\t\t\t\tisDirectlyEditingPattern,\n\t\t\t\tisWelcomeGuideVisible: isFeatureActive( 'welcomeGuide' ),\n\t\t\t\ttemplateId:\n\t\t\t\t\tsupportsTemplateMode &&\n\t\t\t\t\tisViewable &&\n\t\t\t\t\tcanViewTemplate &&\n\t\t\t\t\t! isEditingTemplate\n\t\t\t\t\t\t? _templateId\n\t\t\t\t\t\t: null,\n\t\t\t\tisDevicePreview: getDeviceType() !== 'Desktop',\n\t\t\t};\n\t\t},\n\t\t[\n\t\t\tcurrentPostType,\n\t\t\tcurrentPostId,\n\t\t\tisEditingTemplate,\n\t\t\tsettings.supportsTemplateMode,\n\t\t\tonNavigateToPreviousEntityRecord,\n\t\t]\n\t);\n\n\tuseMetaBoxInitialization( hasActiveMetaboxes && hasResolvedMode );\n\n\t// Set the right context for the command palette\n\tconst commandContext = hasBlockSelected\n\t\t? 'block-selection-edit'\n\t\t: 'entity-edit';\n\tuseCommandContext( commandContext );\n\tconst styles = useEditorStyles( settings );\n\tconst editorSettings = useMemo(\n\t\t() => ( {\n\t\t\t...settings,\n\t\t\tstyles,\n\t\t\tonNavigateToEntityRecord,\n\t\t\tonNavigateToPreviousEntityRecord,\n\t\t} ),\n\t\t[\n\t\t\tsettings,\n\t\t\tstyles,\n\t\t\tonNavigateToEntityRecord,\n\t\t\tonNavigateToPreviousEntityRecord,\n\t\t]\n\t);\n\n\t// We need to add the show-icon-labels class to the body element so it is applied to modals.\n\tif ( showIconLabels ) {\n\t\tdocument.body.classList.add( 'show-icon-labels' );\n\t} else {\n\t\tdocument.body.classList.remove( 'show-icon-labels' );\n\t}\n\n\tconst navigateRegionsProps = useNavigateRegions();\n\n\tconst className = clsx( 'edit-post-layout', 'is-mode-' + mode, {\n\t\t'has-metaboxes': hasActiveMetaboxes,\n\t} );\n\n\tfunction onPluginAreaError( name ) {\n\t\tcreateErrorNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: plugin name */\n\t\t\t\t__(\n\t\t\t\t\t'The \"%s\" plugin has encountered an error and cannot be rendered.'\n\t\t\t\t),\n\t\t\t\tname\n\t\t\t)\n\t\t);\n\t}\n\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\n\tconst onActionPerformed = useCallback(\n\t\t( actionId, items ) => {\n\t\t\tswitch ( actionId ) {\n\t\t\t\tcase 'move-to-trash':\n\t\t\t\t\t{\n\t\t\t\t\t\tdocument.location.href = addQueryArgs( 'edit.php', {\n\t\t\t\t\t\t\ttrashed: 1,\n\t\t\t\t\t\t\tpost_type: items[ 0 ].type,\n\t\t\t\t\t\t\tids: items[ 0 ].id,\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'duplicate-post':\n\t\t\t\t\t{\n\t\t\t\t\t\tconst newItem = items[ 0 ];\n\t\t\t\t\t\tconst title =\n\t\t\t\t\t\t\ttypeof newItem.title === 'string'\n\t\t\t\t\t\t\t\t? newItem.title\n\t\t\t\t\t\t\t\t: newItem.title?.rendered;\n\t\t\t\t\t\tcreateSuccessNotice(\n\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t// translators: %s: Title of the created post or template, e.g: \"Hello world\".\n\t\t\t\t\t\t\t\t__( '\"%s\" successfully created.' ),\n\t\t\t\t\t\t\t\tdecodeEntities( title ) || __( '(no title)' )\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\t\t\tid: 'duplicate-post-action',\n\t\t\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlabel: __( 'Edit' ),\n\t\t\t\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\t\t\t\tconst postId = newItem.id;\n\t\t\t\t\t\t\t\t\t\t\tdocument.location.href =\n\t\t\t\t\t\t\t\t\t\t\t\taddQueryArgs( 'post.php', {\n\t\t\t\t\t\t\t\t\t\t\t\t\tpost: postId,\n\t\t\t\t\t\t\t\t\t\t\t\t\taction: 'edit',\n\t\t\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t},\n\t\t[ createSuccessNotice ]\n\t);\n\n\tconst initialPost = useMemo( () => {\n\t\treturn {\n\t\t\ttype: initialPostType,\n\t\t\tid: initialPostId,\n\t\t};\n\t}, [ initialPostType, initialPostId ] );\n\n\tconst backButton =\n\t\tuseViewportMatch( 'medium' ) && isFullscreenActive ? (\n\t\t\t<BackButton initialPost={ initialPost } />\n\t\t) : null;\n\n\treturn (\n\t\t<SlotFillProvider>\n\t\t\t<Tooltip.Provider>\n\t\t\t\t<ErrorBoundary canCopyContent>\n\t\t\t\t\t<WelcomeGuide postType={ currentPostType } />\n\t\t\t\t\t<div { ...navigateRegionsProps }>\n\t\t\t\t\t\t<Editor\n\t\t\t\t\t\t\tsettings={ editorSettings }\n\t\t\t\t\t\t\tinitialEdits={ initialEdits }\n\t\t\t\t\t\t\tpostType={ currentPostType }\n\t\t\t\t\t\t\tpostId={ currentPostId }\n\t\t\t\t\t\t\ttemplateId={ templateId }\n\t\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\t\t\t\tdisableIframe={ ! shouldIframe }\n\t\t\t\t\t\t\t// We should auto-focus the canvas (title) on load.\n\t\t\t\t\t\t\t// eslint-disable-next-line jsx-a11y/no-autofocus\n\t\t\t\t\t\t\tautoFocus={ ! isWelcomeGuideVisible }\n\t\t\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t\t\t\textraSidebarPanels={\n\t\t\t\t\t\t\t\tshowMetaBoxes && <MetaBoxes location=\"side\" />\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\textraContent={\n\t\t\t\t\t\t\t\t! isDistractionFree &&\n\t\t\t\t\t\t\t\tshowMetaBoxes && (\n\t\t\t\t\t\t\t\t\t<MetaBoxesMain\n\t\t\t\t\t\t\t\t\t\tisLegacy={ isDevicePreview }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<PostLockedModal />\n\t\t\t\t\t\t\t<EditorInitialization />\n\t\t\t\t\t\t\t<FullscreenMode isActive={ isFullscreenActive } />\n\t\t\t\t\t\t\t<BrowserURL />\n\t\t\t\t\t\t\t<UnsavedChangesWarning />\n\t\t\t\t\t\t\t<AutosaveMonitor />\n\t\t\t\t\t\t\t<LocalAutosaveMonitor />\n\t\t\t\t\t\t\t<EditPostKeyboardShortcuts />\n\t\t\t\t\t\t\t<EditorKeyboardShortcutsRegister />\n\t\t\t\t\t\t\t<BlockKeyboardShortcuts />\n\t\t\t\t\t\t\t{ currentPostType === 'wp_block' && (\n\t\t\t\t\t\t\t\t<InitPatternModal />\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t\t\t\t\t\t<PostEditorMoreMenu />\n\t\t\t\t\t\t\t{ backButton }\n\t\t\t\t\t\t\t<SnackbarNotices className=\"edit-post-layout__snackbar\" />\n\t\t\t\t\t\t\t<UploadProgressSnackbar />\n\t\t\t\t\t\t</Editor>\n\t\t\t\t\t</div>\n\t\t\t\t</ErrorBoundary>\n\t\t\t</Tooltip.Provider>\n\t\t</SlotFillProvider>\n\t);\n}\n\nexport default Layout;\n"],
|
|
5
|
-
"mappings": ";AAGA,OAAO,UAAU;AAKjB,SAAS,uBAAuB;AAChC;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS;AAAA,EACT,eAAe;AAAA,OACT;AACP,SAAS,WAAW,mBAAmB;AACvC,SAAS,SAAS,wBAAwB;AAC1C,SAAS,uBAAuB;AAChC,SAAS,kBAAkB;AAC3B,SAAS,IAAI,eAAe;AAC5B;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,aAAa,iBAAiB;AACvC,SAAS,iBAAiB,SAAS,oBAAoB;AACvD,SAAS,SAAS,wBAAwB;AAC1C,SAAS,eAAe,2BAA2B;AACnD,SAAS,eAAe,+BAA+B;AACvD,SAAS,oBAAoB;AAC7B,SAAS,sBAAsB;AAC/B,SAAS,SAAS,iBAAiB;AACnC;AAAA,EACC,QAAQ;AAAA,EACR;AAAA,EACA,gCAAgC;AAAA,EAChC,eAAe;AAAA,OACT;AACP;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,SAAS,sBAAsB;AAKxC,OAAO,gBAAgB;AACvB,OAAO,0BAA0B;AACjC,OAAO,+BAA+B;AACtC,OAAO,sBAAsB;AAC7B,OAAO,gBAAgB;AACvB,OAAO,eAAe;AACtB,OAAO,wBAAwB;AAC/B,OAAO,kBAAkB;AACzB,SAAS,SAAS,qB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,cACL,iBAAgB;AAAA,cAChB,cAAa,GAAI,gBAAiB;AAAA,cAClC,oBAAmB;AAAA,cACjB,GAAG,gBAAgB;AAAA;AAAA,UACtB;AAAA;AAAA,MAEF;AAAA,MACA,oBAAC,QAAQ,OAAR,EAAgB,aAAI,gBAAiB,GAAG;AAAA,OAC1C;AAAA,IACA,oBAAC,kBAAe,IAAK,iBAClB;AAAA,MACD;AAAA,IACD,GACD;AAAA,KACD;AAGD,SACC;AAAA,IAAC;AAAA;AAAA,MACA,WAAY;AAAA,MACZ,KAAM;AAAA,MACN,WAAY;AAAA,QACX;AAAA,QACA,CAAE,WAAW;AAAA,MACd;AAAA,MACA,OAAQ,EAAE,QAAQ,WAAW;AAAA,MAE7B;AAAA,6BAAC,SAAI,WAAU,wCACZ;AAAA;AAAA,UACA;AAAA,WACH;AAAA,QACE;AAAA;AAAA;AAAA,EACH;AAEF;AAEA,SAAS,OAAQ;AAAA,EAChB,QAAQ;AAAA,EACR,UAAU;AAAA,EACV;AAAA,EACA;AACD,GAAI;AACH,sBAAoB;AACpB,QAAM,eAAe,gBAAgB;AACrC,QAAM,EAAE,kBAAkB,IAAI,YAAa,YAAa;AACxD,QAAM;AAAA,IACL,aAAa,EAAE,QAAQ,eAAe,UAAU,gBAAgB;AAAA,IAChE;AAAA,IACA;AAAA,EACD,IAAI;AAAA,IACH;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACA,QAAM,oBAAoB,oBAAoB;AAC9C,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { NavigableRegion } from '@wordpress/admin-ui';\nimport {\n\tAutosaveMonitor,\n\tLocalAutosaveMonitor,\n\tUnsavedChangesWarning,\n\tEditorKeyboardShortcutsRegister,\n\tErrorBoundary,\n\tPostLockedModal,\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { getLayoutStyles } from '@wordpress/global-styles-engine';\nimport { PluginArea } from '@wordpress/plugins';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tuseCallback,\n\tuseMemo,\n\tuseId,\n\tuseRef,\n\tuseState,\n} from '@wordpress/element';\nimport { chevronDown, chevronUp } from '@wordpress/icons';\nimport { SnackbarNotices, store as noticesStore } from '@wordpress/notices';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { privateApis as commandsPrivateApis } from '@wordpress/commands';\nimport { privateApis as blockLibraryPrivateApis } from '@wordpress/block-library';\nimport { addQueryArgs } from '@wordpress/url';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tIcon as WCIcon,\n\tSlotFillProvider,\n\t__unstableUseNavigateRegions as useNavigateRegions,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport {\n\tuseMediaQuery,\n\tuseMergeRefs,\n\tuseRefEffect,\n\tuseViewportMatch,\n} from '@wordpress/compose';\nimport { Tooltip, VisuallyHidden } from '@wordpress/ui';\n\n/**\n * Internal dependencies\n */\nimport BackButton from '../back-button';\nimport EditorInitialization from '../editor-initialization';\nimport EditPostKeyboardShortcuts from '../keyboard-shortcuts';\nimport InitPatternModal from '../init-pattern-modal';\nimport BrowserURL from '../browser-url';\nimport MetaBoxes from '../meta-boxes';\nimport PostEditorMoreMenu from '../more-menu';\nimport WelcomeGuide from '../welcome-guide';\nimport { store as editPostStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport useEditPostCommands from '../../commands/use-commands';\nimport { useShouldIframe } from './use-should-iframe';\nimport useNavigateToEntityRecord from '../../hooks/use-navigate-to-entity-record';\nimport { useMetaBoxInitialization } from '../meta-boxes/use-meta-box-initialization';\n\nconst { useCommandContext } = unlock( commandsPrivateApis );\n/** @type {{} & {useDrag: import('@use-gesture/react').useDrag}} */\nconst { useDrag } = unlock( componentsPrivateApis );\nconst { Editor, FullscreenMode, UploadProgressSnackbar } =\n\tunlock( editorPrivateApis );\nconst { BlockKeyboardShortcuts } = unlock( blockLibraryPrivateApis );\nconst DESIGN_POST_TYPES = [\n\t'wp_template',\n\t'wp_template_part',\n\t'wp_block',\n\t'wp_navigation',\n];\n\nfunction useEditorStyles( settings ) {\n\tconst { hasThemeStyleSupport } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\thasThemeStyleSupport:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'themeStyles' ),\n\t\t};\n\t}, [] );\n\n\t// Compute the default styles.\n\treturn useMemo( () => {\n\t\tconst presetStyles =\n\t\t\tsettings.styles?.filter(\n\t\t\t\t( style ) =>\n\t\t\t\t\tstyle.__unstableType && style.__unstableType !== 'theme'\n\t\t\t) ?? [];\n\n\t\tconst defaultEditorStyles = [\n\t\t\t...( settings?.defaultEditorStyles ?? [] ),\n\t\t\t...presetStyles,\n\t\t];\n\n\t\t// Has theme styles if the theme supports them and if some styles were not preset styles (in which case they're theme styles).\n\t\tconst hasThemeStyles =\n\t\t\thasThemeStyleSupport &&\n\t\t\tpresetStyles.length !== ( settings.styles?.length ?? 0 );\n\n\t\t// If theme styles are not present or displayed, ensure that\n\t\t// base layout styles are still present in the editor.\n\t\tif ( ! settings.disableLayoutStyles && ! hasThemeStyles ) {\n\t\t\tdefaultEditorStyles.push( {\n\t\t\t\tcss: getLayoutStyles( {\n\t\t\t\t\tstyle: {},\n\t\t\t\t\tselector: 'body',\n\t\t\t\t\thasBlockGapSupport: false,\n\t\t\t\t\thasFallbackGapSupport: true,\n\t\t\t\t\tfallbackGapValue: '0.5em',\n\t\t\t\t} ),\n\t\t\t} );\n\t\t}\n\n\t\treturn hasThemeStyles ? settings.styles ?? [] : defaultEditorStyles;\n\t}, [\n\t\tsettings.defaultEditorStyles,\n\t\tsettings.disableLayoutStyles,\n\t\tsettings.styles,\n\t\thasThemeStyleSupport,\n\t] );\n}\n\n/**\n * @param {Object} props\n * @param {boolean} props.isLegacy True for device previews where split view is disabled.\n */\nfunction MetaBoxesMain( { isLegacy } ) {\n\tconst [ isOpen, openHeight, hasAnyVisible ] = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { isMetaBoxLocationVisible } = select( editPostStore );\n\t\treturn [\n\t\t\t!! get( 'core/edit-post', 'metaBoxesMainIsOpen' ),\n\t\t\tget( 'core/edit-post', 'metaBoxesMainOpenHeight' ),\n\t\t\tisMetaBoxLocationVisible( 'normal' ) ||\n\t\t\t\tisMetaBoxLocationVisible( 'advanced' ) ||\n\t\t\t\tisMetaBoxLocationVisible( 'side' ),\n\t\t];\n\t}, [] );\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst isShort = useMediaQuery( '(max-height: 549px)' );\n\n\tconst [ { min = 0, max }, setHeightConstraints ] = useState( () => ( {} ) );\n\t// Keeps the resizable area’s size constraints updated taking into account\n\t// editor notices. The constraints are also used to derive the value for the\n\t// aria-valuenow attribute on the separator.\n\tconst effectSizeConstraints = useRefEffect( ( node ) => {\n\t\tconst container = node.closest(\n\t\t\t'.interface-interface-skeleton__content'\n\t\t);\n\t\tif ( ! container ) {\n\t\t\treturn;\n\t\t}\n\t\tconst noticeContainer = container.querySelector(\n\t\t\t':scope > .notices-inline-notices-wrapper'\n\t\t);\n\t\tconst resizeHandle = container.querySelector(\n\t\t\t'.edit-post-meta-boxes-main__presenter'\n\t\t);\n\t\tconst deriveConstraints = () => {\n\t\t\tconst fullHeight = container.offsetHeight;\n\t\t\tlet nextMax = fullHeight;\n\t\t\tif ( noticeContainer ) {\n\t\t\t\tnextMax -= noticeContainer.offsetHeight;\n\t\t\t}\n\t\t\tconst nextMin = resizeHandle?.offsetHeight ?? 0;\n\t\t\tsetHeightConstraints( { min: nextMin, max: nextMax } );\n\t\t};\n\t\tconst observer = new window.ResizeObserver( deriveConstraints );\n\t\tobserver.observe( container );\n\t\tif ( noticeContainer ) {\n\t\t\tobserver.observe( noticeContainer );\n\t\t}\n\t\treturn () => observer.disconnect();\n\t}, [] );\n\tconst metaBoxesMainRef = useRef();\n\tconst setMainRefs = useMergeRefs( [\n\t\tmetaBoxesMainRef,\n\t\teffectSizeConstraints,\n\t] );\n\n\tconst separatorRef = useRef();\n\tconst separatorHelpId = useId();\n\n\tconst heightRef = useRef();\n\n\tconst getAriaValueNow = ( height ) =>\n\t\tMath.round( ( ( height - min ) / ( max - min ) ) * 100 );\n\tconst persistIsOpen = ( to = ! isOpen ) =>\n\t\tsetPreference( 'core/edit-post', 'metaBoxesMainIsOpen', to );\n\n\t/**\n\t * @param {number|'auto'} [candidateHeight] Height in pixels or 'auto'.\n\t * @param {boolean} isPersistent Whether to persist the height in preferences.\n\t */\n\tconst applyHeight = ( candidateHeight = 'auto', isPersistent ) => {\n\t\tlet styleHeight;\n\t\tif ( candidateHeight === 'auto' ) {\n\t\t\tisPersistent = false; // Just in case — “auto” should never persist.\n\t\t\tstyleHeight = candidateHeight;\n\t\t} else {\n\t\t\tcandidateHeight = Math.min( max, Math.max( min, candidateHeight ) );\n\t\t\theightRef.current = candidateHeight;\n\t\t\tstyleHeight = `${ candidateHeight }px`;\n\t\t}\n\t\tif ( isPersistent ) {\n\t\t\tsetPreference(\n\t\t\t\t'core/edit-post',\n\t\t\t\t'metaBoxesMainOpenHeight',\n\t\t\t\tcandidateHeight\n\t\t\t);\n\t\t}\n\t\t// Applies imperative DOM updates only when not persisting the value\n\t\t// because otherwise it's done by the subsequent render.\n\t\telse {\n\t\t\tmetaBoxesMainRef.current.style.height = styleHeight;\n\t\t\tif ( ! isShort ) {\n\t\t\t\tseparatorRef.current.ariaValueNow =\n\t\t\t\t\tgetAriaValueNow( candidateHeight );\n\t\t\t}\n\t\t}\n\t};\n\n\t// useDrag includes keyboard support with arrow keys emulating a drag.\n\t// TODO: Support more/all keyboard interactions from the window splitter pattern:\n\t// https://www.w3.org/WAI/ARIA/apg/patterns/windowsplitter/\n\tconst bindDragGesture = useDrag(\n\t\t( { movement, first, last, memo, tap, args } ) => {\n\t\t\tconst pane = metaBoxesMainRef.current;\n\t\t\tconst [ , yMovement ] = movement;\n\t\t\tif ( first ) {\n\t\t\t\tpane.classList.add( 'is-resizing' );\n\t\t\t\tlet fromHeight = heightRef.current ?? pane.offsetHeight;\n\t\t\t\tif ( isOpen ) {\n\t\t\t\t\t// Starts from max in case shortening the window has imposed it.\n\t\t\t\t\tif ( fromHeight > max ) {\n\t\t\t\t\t\tfromHeight = max;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tfromHeight = min;\n\t\t\t\t}\n\t\t\t\tapplyHeight( fromHeight - yMovement );\n\t\t\t\treturn { fromHeight };\n\t\t\t}\n\n\t\t\tif ( ! first && ! last && ! tap ) {\n\t\t\t\tapplyHeight( memo.fromHeight - yMovement );\n\t\t\t\treturn memo;\n\t\t\t}\n\t\t\t// Here, `last === true` – it’s the final event of the gesture.\n\n\t\t\tpane.classList.remove( 'is-resizing' );\n\t\t\tif ( tap ) {\n\t\t\t\tconst [ onTap ] = args;\n\t\t\t\tonTap?.();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst nextIsOpen = heightRef.current > min;\n\t\t\tpersistIsOpen( nextIsOpen );\n\t\t\t// Persists height only if still open. This is so that when closed by a drag the\n\t\t\t// prior height can be restored by the toggle button instead of having to drag\n\t\t\t// the pane open again.\n\t\t\tapplyHeight( heightRef.current, nextIsOpen );\n\t\t},\n\t\t{ keyboardDisplacement: 20, filterTaps: true }\n\t);\n\n\tif ( ! hasAnyVisible ) {\n\t\treturn;\n\t}\n\n\tconst contents = (\n\t\t<div\n\t\t\t// The class name 'edit-post-layout__metaboxes' is retained because some plugins use it.\n\t\t\tclassName=\"edit-post-layout__metaboxes edit-post-meta-boxes-main__liner\"\n\t\t\thidden={ ! isLegacy && ! isOpen }\n\t\t>\n\t\t\t<MetaBoxes location=\"normal\" />\n\t\t\t<MetaBoxes location=\"advanced\" />\n\t\t</div>\n\t);\n\n\tif ( isLegacy ) {\n\t\treturn contents;\n\t}\n\n\tconst isAutoHeight = openHeight === undefined;\n\tconst usedOpenHeight = isShort ? 'auto' : openHeight;\n\tconst usedHeight = isOpen ? usedOpenHeight : min;\n\n\tconst usedAriaValueNow =\n\t\tmax === undefined || isAutoHeight ? 50 : getAriaValueNow( usedHeight );\n\n\tconst paneLabel = __( 'Meta Boxes' );\n\n\t// The toggle button. It also resizes when the viewport is tall to provide\n\t// a larger hit area than the small separator button.\n\tconst toggle = (\n\t\t<button\n\t\t\taria-expanded={ isOpen }\n\t\t\t// Toggles for all clicks when short and only keyboard “clicks” when\n\t\t\t// resizable because pointer input is handled by the drag gesture.\n\t\t\tonClick={ ( { detail } ) => {\n\t\t\t\tif ( isShort || ! detail ) {\n\t\t\t\t\tpersistIsOpen();\n\t\t\t\t}\n\t\t\t} }\n\t\t\t// Passes a toggle callback that the drag gesture handler calls when\n\t\t\t// it interprets the input as a click/tap.\n\t\t\t{ ...( ! isShort && bindDragGesture( persistIsOpen ) ) }\n\t\t>\n\t\t\t{ paneLabel }\n\t\t\t<WCIcon icon={ isOpen ? chevronUp : chevronDown } />\n\t\t</button>\n\t);\n\n\t// The separator button that provides a11y for resizing.\n\tconst separator = ! isShort && (\n\t\t<>\n\t\t\t<Tooltip.Root>\n\t\t\t\t<Tooltip.Trigger\n\t\t\t\t\trender={\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\tref={ separatorRef }\n\t\t\t\t\t\t\trole=\"separator\" // eslint-disable-line jsx-a11y/no-interactive-element-to-noninteractive-role\n\t\t\t\t\t\t\taria-valuenow={ usedAriaValueNow }\n\t\t\t\t\t\t\taria-label={ __( 'Drag to resize' ) }\n\t\t\t\t\t\t\taria-describedby={ separatorHelpId }\n\t\t\t\t\t\t\t{ ...bindDragGesture() }\n\t\t\t\t\t\t/>\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t<Tooltip.Popup>{ __( 'Drag to resize' ) }</Tooltip.Popup>\n\t\t\t</Tooltip.Root>\n\t\t\t<VisuallyHidden id={ separatorHelpId }>\n\t\t\t\t{ __(\n\t\t\t\t\t'Use up and down arrow keys to resize the meta box pane.'\n\t\t\t\t) }\n\t\t\t</VisuallyHidden>\n\t\t</>\n\t);\n\n\treturn (\n\t\t<NavigableRegion\n\t\t\tariaLabel={ paneLabel }\n\t\t\tref={ setMainRefs }\n\t\t\tclassName={ clsx(\n\t\t\t\t'edit-post-meta-boxes-main',\n\t\t\t\t! isShort && 'is-resizable'\n\t\t\t) }\n\t\t\tstyle={ { height: usedHeight } }\n\t\t>\n\t\t\t<div className=\"edit-post-meta-boxes-main__presenter\">\n\t\t\t\t{ toggle }\n\t\t\t\t{ separator }\n\t\t\t</div>\n\t\t\t{ contents }\n\t\t</NavigableRegion>\n\t);\n}\n\nfunction Layout( {\n\tpostId: initialPostId,\n\tpostType: initialPostType,\n\tsettings,\n\tinitialEdits,\n} ) {\n\tuseEditPostCommands();\n\tconst shouldIframe = useShouldIframe();\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst {\n\t\tcurrentPost: { postId: currentPostId, postType: currentPostType },\n\t\tonNavigateToEntityRecord,\n\t\tonNavigateToPreviousEntityRecord,\n\t} = useNavigateToEntityRecord(\n\t\tinitialPostId,\n\t\tinitialPostType,\n\t\t'post-only'\n\t);\n\tconst isEditingTemplate = currentPostType === 'wp_template';\n\tconst {\n\t\tmode,\n\t\tisFullscreenActive,\n\t\thasResolvedMode,\n\t\thasActiveMetaboxes,\n\t\thasBlockSelected,\n\t\tshowIconLabels,\n\t\tisDistractionFree,\n\t\tshowMetaBoxes,\n\t\tisWelcomeGuideVisible,\n\t\ttemplateId,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst { isFeatureActive, hasMetaBoxes } = select( editPostStore );\n\t\t\tconst { canUser, getPostType, getTemplateId } = unlock(\n\t\t\t\tselect( coreStore )\n\t\t\t);\n\n\t\t\tconst supportsTemplateMode = settings.supportsTemplateMode;\n\t\t\tconst isViewable =\n\t\t\t\tgetPostType( currentPostType )?.viewable ?? false;\n\t\t\tconst canViewTemplate = canUser( 'read', {\n\t\t\t\tkind: 'postType',\n\t\t\t\tname: 'wp_template',\n\t\t\t} );\n\t\t\tconst { getBlockSelectionStart, isZoomOut } = unlock(\n\t\t\t\tselect( blockEditorStore )\n\t\t\t);\n\t\t\tconst { getEditorMode, getDefaultRenderingMode } = unlock(\n\t\t\t\tselect( editorStore )\n\t\t\t);\n\t\t\tconst isNotDesignPostType =\n\t\t\t\t! DESIGN_POST_TYPES.includes( currentPostType );\n\t\t\tconst isDirectlyEditingPattern =\n\t\t\t\tcurrentPostType === 'wp_block' &&\n\t\t\t\t! onNavigateToPreviousEntityRecord;\n\t\t\tconst _templateId = getTemplateId( currentPostType, currentPostId );\n\t\t\tconst defaultMode = getDefaultRenderingMode( currentPostType );\n\n\t\t\treturn {\n\t\t\t\tmode: getEditorMode(),\n\t\t\t\tisFullscreenActive: isFeatureActive( 'fullscreenMode' ),\n\t\t\t\thasActiveMetaboxes: hasMetaBoxes(),\n\t\t\t\thasResolvedMode:\n\t\t\t\t\tdefaultMode === 'template-locked'\n\t\t\t\t\t\t? !! _templateId\n\t\t\t\t\t\t: defaultMode !== undefined,\n\t\t\t\thasBlockSelected: !! getBlockSelectionStart(),\n\t\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\t\tshowMetaBoxes:\n\t\t\t\t\t( isNotDesignPostType && ! isZoomOut() ) ||\n\t\t\t\t\tisDirectlyEditingPattern,\n\t\t\t\tisWelcomeGuideVisible: isFeatureActive( 'welcomeGuide' ),\n\t\t\t\ttemplateId:\n\t\t\t\t\tsupportsTemplateMode &&\n\t\t\t\t\tisViewable &&\n\t\t\t\t\tcanViewTemplate &&\n\t\t\t\t\t! isEditingTemplate\n\t\t\t\t\t\t? _templateId\n\t\t\t\t\t\t: null,\n\t\t\t};\n\t\t},\n\t\t[\n\t\t\tcurrentPostType,\n\t\t\tcurrentPostId,\n\t\t\tisEditingTemplate,\n\t\t\tsettings.supportsTemplateMode,\n\t\t\tonNavigateToPreviousEntityRecord,\n\t\t]\n\t);\n\n\tuseMetaBoxInitialization( hasActiveMetaboxes && hasResolvedMode );\n\n\t// Set the right context for the command palette\n\tconst commandContext = hasBlockSelected\n\t\t? 'block-selection-edit'\n\t\t: 'entity-edit';\n\tuseCommandContext( commandContext );\n\tconst styles = useEditorStyles( settings );\n\tconst editorSettings = useMemo(\n\t\t() => ( {\n\t\t\t...settings,\n\t\t\tstyles,\n\t\t\tonNavigateToEntityRecord,\n\t\t\tonNavigateToPreviousEntityRecord,\n\t\t} ),\n\t\t[\n\t\t\tsettings,\n\t\t\tstyles,\n\t\t\tonNavigateToEntityRecord,\n\t\t\tonNavigateToPreviousEntityRecord,\n\t\t]\n\t);\n\n\t// We need to add the show-icon-labels class to the body element so it is applied to modals.\n\tif ( showIconLabels ) {\n\t\tdocument.body.classList.add( 'show-icon-labels' );\n\t} else {\n\t\tdocument.body.classList.remove( 'show-icon-labels' );\n\t}\n\n\tconst navigateRegionsProps = useNavigateRegions();\n\n\tconst className = clsx( 'edit-post-layout', 'is-mode-' + mode, {\n\t\t'has-metaboxes': hasActiveMetaboxes,\n\t} );\n\n\tfunction onPluginAreaError( name ) {\n\t\tcreateErrorNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: plugin name */\n\t\t\t\t__(\n\t\t\t\t\t'The \"%s\" plugin has encountered an error and cannot be rendered.'\n\t\t\t\t),\n\t\t\t\tname\n\t\t\t)\n\t\t);\n\t}\n\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\n\tconst onActionPerformed = useCallback(\n\t\t( actionId, items ) => {\n\t\t\tswitch ( actionId ) {\n\t\t\t\tcase 'move-to-trash':\n\t\t\t\t\t{\n\t\t\t\t\t\tdocument.location.href = addQueryArgs( 'edit.php', {\n\t\t\t\t\t\t\ttrashed: 1,\n\t\t\t\t\t\t\tpost_type: items[ 0 ].type,\n\t\t\t\t\t\t\tids: items[ 0 ].id,\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'duplicate-post':\n\t\t\t\t\t{\n\t\t\t\t\t\tconst newItem = items[ 0 ];\n\t\t\t\t\t\tconst title =\n\t\t\t\t\t\t\ttypeof newItem.title === 'string'\n\t\t\t\t\t\t\t\t? newItem.title\n\t\t\t\t\t\t\t\t: newItem.title?.rendered;\n\t\t\t\t\t\tcreateSuccessNotice(\n\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t// translators: %s: Title of the created post or template, e.g: \"Hello world\".\n\t\t\t\t\t\t\t\t__( '\"%s\" successfully created.' ),\n\t\t\t\t\t\t\t\tdecodeEntities( title ) || __( '(no title)' )\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\t\t\tid: 'duplicate-post-action',\n\t\t\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlabel: __( 'Edit' ),\n\t\t\t\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\t\t\t\tconst postId = newItem.id;\n\t\t\t\t\t\t\t\t\t\t\tdocument.location.href =\n\t\t\t\t\t\t\t\t\t\t\t\taddQueryArgs( 'post.php', {\n\t\t\t\t\t\t\t\t\t\t\t\t\tpost: postId,\n\t\t\t\t\t\t\t\t\t\t\t\t\taction: 'edit',\n\t\t\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t},\n\t\t[ createSuccessNotice ]\n\t);\n\n\tconst initialPost = useMemo( () => {\n\t\treturn {\n\t\t\ttype: initialPostType,\n\t\t\tid: initialPostId,\n\t\t};\n\t}, [ initialPostType, initialPostId ] );\n\n\tconst backButton =\n\t\tuseViewportMatch( 'medium' ) && isFullscreenActive ? (\n\t\t\t<BackButton initialPost={ initialPost } />\n\t\t) : null;\n\n\treturn (\n\t\t<SlotFillProvider>\n\t\t\t<Tooltip.Provider>\n\t\t\t\t<ErrorBoundary canCopyContent>\n\t\t\t\t\t<WelcomeGuide postType={ currentPostType } />\n\t\t\t\t\t<div { ...navigateRegionsProps }>\n\t\t\t\t\t\t<Editor\n\t\t\t\t\t\t\tsettings={ editorSettings }\n\t\t\t\t\t\t\tinitialEdits={ initialEdits }\n\t\t\t\t\t\t\tpostType={ currentPostType }\n\t\t\t\t\t\t\tpostId={ currentPostId }\n\t\t\t\t\t\t\ttemplateId={ templateId }\n\t\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\t\t\t\tdisableIframe={ ! shouldIframe }\n\t\t\t\t\t\t\t// We should auto-focus the canvas (title) on load.\n\t\t\t\t\t\t\t// eslint-disable-next-line jsx-a11y/no-autofocus\n\t\t\t\t\t\t\tautoFocus={ ! isWelcomeGuideVisible }\n\t\t\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t\t\t\textraSidebarPanels={\n\t\t\t\t\t\t\t\tshowMetaBoxes && <MetaBoxes location=\"side\" />\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\textraContent={\n\t\t\t\t\t\t\t\t! isDistractionFree &&\n\t\t\t\t\t\t\t\tshowMetaBoxes && (\n\t\t\t\t\t\t\t\t\t<MetaBoxesMain\n\t\t\t\t\t\t\t\t\t\tisLegacy={ ! shouldIframe }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<PostLockedModal />\n\t\t\t\t\t\t\t<EditorInitialization />\n\t\t\t\t\t\t\t<FullscreenMode isActive={ isFullscreenActive } />\n\t\t\t\t\t\t\t<BrowserURL />\n\t\t\t\t\t\t\t<UnsavedChangesWarning />\n\t\t\t\t\t\t\t<AutosaveMonitor />\n\t\t\t\t\t\t\t<LocalAutosaveMonitor />\n\t\t\t\t\t\t\t<EditPostKeyboardShortcuts />\n\t\t\t\t\t\t\t<EditorKeyboardShortcutsRegister />\n\t\t\t\t\t\t\t<BlockKeyboardShortcuts />\n\t\t\t\t\t\t\t{ currentPostType === 'wp_block' && (\n\t\t\t\t\t\t\t\t<InitPatternModal />\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t\t\t\t\t\t<PostEditorMoreMenu />\n\t\t\t\t\t\t\t{ backButton }\n\t\t\t\t\t\t\t<SnackbarNotices className=\"edit-post-layout__snackbar\" />\n\t\t\t\t\t\t\t<UploadProgressSnackbar />\n\t\t\t\t\t\t</Editor>\n\t\t\t\t\t</div>\n\t\t\t\t</ErrorBoundary>\n\t\t\t</Tooltip.Provider>\n\t\t</SlotFillProvider>\n\t);\n}\n\nexport default Layout;\n"],
|
|
5
|
+
"mappings": ";AAGA,OAAO,UAAU;AAKjB,SAAS,uBAAuB;AAChC;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS;AAAA,EACT,eAAe;AAAA,OACT;AACP,SAAS,WAAW,mBAAmB;AACvC,SAAS,SAAS,wBAAwB;AAC1C,SAAS,uBAAuB;AAChC,SAAS,kBAAkB;AAC3B,SAAS,IAAI,eAAe;AAC5B;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,aAAa,iBAAiB;AACvC,SA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cACC,CAAE,qBACF,iBACC;AAAA,UAAC;AAAA;AAAA,YACA,UAAW,CAAE;AAAA;AAAA,QACd;AAAA,QAIF;AAAA,8BAAC,mBAAgB;AAAA,UACjB,oBAAC,wBAAqB;AAAA,UACtB,oBAAC,kBAAe,UAAW,oBAAqB;AAAA,UAChD,oBAAC,cAAW;AAAA,UACZ,oBAAC,yBAAsB;AAAA,UACvB,oBAAC,mBAAgB;AAAA,UACjB,oBAAC,wBAAqB;AAAA,UACtB,oBAAC,6BAA0B;AAAA,UAC3B,oBAAC,mCAAgC;AAAA,UACjC,oBAAC,0BAAuB;AAAA,UACtB,oBAAoB,cACrB,oBAAC,oBAAiB;AAAA,UAEnB,oBAAC,cAAW,SAAU,mBAAoB;AAAA,UAC1C,oBAAC,sBAAmB;AAAA,UAClB;AAAA,UACF,oBAAC,mBAAgB,WAAU,8BAA6B;AAAA,UACxD,oBAAC,0BAAuB;AAAA;AAAA;AAAA,IACzB,GACD;AAAA,KACD,GACD,GACD;AAEF;AAEA,IAAO,iBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/build-module/index.mjs
CHANGED
|
@@ -55,7 +55,9 @@ function initializeEditor(id, postType, postId, settings, initialEdits) {
|
|
|
55
55
|
enableChoosePatternModal: true,
|
|
56
56
|
isPublishSidebarEnabled: true,
|
|
57
57
|
showCollaborationCursor: false,
|
|
58
|
-
|
|
58
|
+
showCollaborationJoinNotifications: true,
|
|
59
|
+
showCollaborationLeaveNotifications: true,
|
|
60
|
+
showCollaborationPostSaveNotifications: true
|
|
59
61
|
});
|
|
60
62
|
if (window.__clientSideMediaProcessing) {
|
|
61
63
|
dispatch(preferencesStore).setDefaults("core/media", {
|
|
@@ -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__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport deprecated from '@wordpress/deprecated';\nimport { createRoot, StrictMode } from '@wordpress/element';\nimport { dispatch, resolveSelect, select } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\nimport {\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport apiFetch from '@wordpress/api-fetch';\n\n/**\n * Internal dependencies\n */\nimport Layout from './components/layout';\nimport { unlock } from './lock-unlock';\n\nconst {\n\tBackButton: __experimentalMainDashboardButton,\n\tregisterCoreBlockBindingsSources,\n} = unlock( editorPrivateApis );\n\nconst { enablePreloadMultiUse, clearPreloadedData } = unlock(\n\tapiFetch.privateApis\n);\n\n/**\n * Initializes and returns an instance of Editor.\n *\n * @param {string} id Unique identifier for editor instance.\n * @param {string} postType Post type of the post to edit.\n * @param {Object} postId ID of the post to edit.\n * @param {?Object} settings Editor settings object.\n * @param {Object} initialEdits Programmatic edits to apply initially, to be\n * considered as non-user-initiated (bypass for\n * unsaved changes prompt).\n */\nexport function initializeEditor(\n\tid,\n\tpostType,\n\tpostId,\n\tsettings,\n\tinitialEdits\n) {\n\tconst isMediumOrBigger = window.matchMedia( '(min-width: 782px)' ).matches;\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-post', {\n\t\tfullscreenMode: true,\n\t\tthemeStyles: true,\n\t\twelcomeGuide: true,\n\t\twelcomeGuideTemplate: true,\n\t} );\n\n\tdispatch( preferencesStore ).setDefaults( 'core', {\n\t\tallowRightClickOverrides: true,\n\t\teditorMode: 'visual',\n\t\teditorTool: 'edit',\n\t\tfixedToolbar: false,\n\t\thiddenBlockTypes: [],\n\t\tinactivePanels: [],\n\t\topenPanels: [ 'post-status' ],\n\t\tshowBlockBreadcrumbs: true,\n\t\tshowIconLabels: false,\n\t\tshowListViewByDefault: false,\n\t\tenableChoosePatternModal: true,\n\t\tisPublishSidebarEnabled: true,\n\t\tshowCollaborationCursor: false,\n\t\tshowCollaborationNotifications: 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( blocksStore ).reapplyBlockTypeFilters();\n\n\t// Check if the block list view should be open by default.\n\t// If `distractionFree` mode is enabled, the block list view should not be open.\n\t// This behavior is disabled for small viewports.\n\tif (\n\t\tisMediumOrBigger &&\n\t\tselect( preferencesStore ).get( 'core', 'showListViewByDefault' ) &&\n\t\t! select( preferencesStore ).get( 'core', 'distractionFree' )\n\t) {\n\t\tdispatch( editorStore ).setIsListViewOpened( true );\n\t}\n\n\tregisterCoreBlocks();\n\tregisterCoreBlockBindingsSources();\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tregisterWidgetGroupBlock( { inserter: false } );\n\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: settings.__unstableEnableFullSiteEditingBlocks,\n\t\t} );\n\t}\n\n\t// Show a console log warning if the browser is not in Standards rendering mode.\n\tconst documentMode =\n\t\tdocument.compatMode === 'CSS1Compat' ? 'Standards' : 'Quirks';\n\tif ( documentMode !== 'Standards' ) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn(\n\t\t\t\"Your browser is using Quirks Mode. \\nThis can cause rendering issues such as blocks overlaying meta boxes in the editor. Quirks Mode can be triggered by PHP errors or HTML code appearing before the opening <!DOCTYPE html>. Try checking the raw page source or your site's PHP error log and resolving errors there, removing any HTML before the doctype, or disabling plugins.\"\n\t\t);\n\t}\n\n\t// This is a temporary fix for a couple of issues specific to Webkit on iOS.\n\t// Without this hack the browser scrolls the mobile toolbar off-screen.\n\t// Once supported in Safari we can replace this in favor of preventScroll.\n\t// For details see issue #18632 and PR #18686\n\t// Specifically, we scroll `interface-interface-skeleton__body` to enable a fixed top toolbar.\n\t// But Mobile Safari forces the `html` element to scroll upwards, hiding the toolbar.\n\n\tconst isIphone = window.navigator.userAgent.indexOf( 'iPhone' ) !== -1;\n\tif ( isIphone ) {\n\t\twindow.addEventListener( 'scroll', ( event ) => {\n\t\t\tconst editorScrollContainer = document.getElementsByClassName(\n\t\t\t\t'interface-interface-skeleton__body'\n\t\t\t)[ 0 ];\n\t\t\tif ( event.target === document ) {\n\t\t\t\t// Scroll element into view by scrolling the editor container by the same amount\n\t\t\t\t// that Mobile Safari tried to scroll the html element upwards.\n\t\t\t\tif ( window.scrollY > 100 ) {\n\t\t\t\t\teditorScrollContainer.scrollTop =\n\t\t\t\t\t\teditorScrollContainer.scrollTop + window.scrollY;\n\t\t\t\t}\n\t\t\t\t// Undo unwanted scroll on html element, but only in the visual editor.\n\t\t\t\tif (\n\t\t\t\t\tdocument.getElementsByClassName( 'is-mode-visual' )[ 0 ]\n\t\t\t\t) {\n\t\t\t\t\twindow.scrollTo( 0, 0 );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\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\t// Drive the resolvers whose data `createPreloadingMiddleware`\n\t// already has cached so every metadata entry they touch is\n\t// `finished` by the time React mounts — no `setTimeout(0)`\n\t// resolution dance on first render. Multi-use lets a single\n\t// preloaded URL back several selectors (e.g. /wp/v2/settings GET +\n\t// OPTIONS serves `getEntitiesConfig`, `canUser`, `getEntityRecord`).\n\tenablePreloadMultiUse();\n\tconst preloadedResolutions = preloadResolutions( postType, postId );\n\n\tpreloadedResolutions.finally( () => {\n\t\t// Anything not consumed by the kickoff falls through to a real\n\t\t// network request from here on. `clearPreloadedData` logs which\n\t\t// preload entries (if any) were never served.\n\t\tclearPreloadedData();\n\t\tif ( postType && postId ) {\n\t\t\tconst post = select( coreDataStore ).getEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId\n\t\t\t);\n\t\t\tif ( post ) {\n\t\t\t\tdispatch( editorStore ).setupEditor(\n\t\t\t\t\tpost,\n\t\t\t\t\tinitialEdits,\n\t\t\t\t\tsettings.template\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\troot.render(\n\t\t\t<StrictMode>\n\t\t\t\t<Layout\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t\tpostId={ postId }\n\t\t\t\t\tpostType={ postType }\n\t\t\t\t\tinitialEdits={ initialEdits }\n\t\t\t\t/>\n\t\t\t</StrictMode>\n\t\t);\n\t} );\n\n\treturn root;\n}\n\n/**\n * Drive resolvers to completion against the preload cache before React\n * mounts. Two phases: known-up-front args (post id + type), then args\n * derived from phase-1 state (post slug → template, current global\n * styles id → record + canUser).\n *\n * @param {string} postType Current post type.\n * @param {number} postId Current post id.\n * @return {Promise<void>} Resolves when the kickoff resolvers settle.\n */\nasync function preloadResolutions( postType, postId ) {\n\tconst core = resolveSelect( coreDataStore );\n\tconst coreSelect = select( coreDataStore );\n\n\ttry {\n\t\tawait Promise.all( [\n\t\t\tcore.getCurrentUser(),\n\t\t\tcore.getEntitiesConfig( 'postType' ),\n\t\t\tcore.getEntitiesConfig( 'taxonomy' ),\n\t\t\tcore.getEntitiesConfig( 'root' ),\n\t\t\tcore.getEntityRecords( 'root', 'taxonomy' ),\n\t\t\tcore.getCurrentTheme(),\n\t\t\t// Forward-resolver alias of `getCurrentTheme` with its own\n\t\t\t// resolution metadata, so it needs a separate kick.\n\t\t\tcore.getThemeSupports(),\n\t\t\tcore.getBlockPatternCategories(),\n\t\t\tcore.__experimentalGetCurrentGlobalStylesId(),\n\t\t\tcore.__experimentalGetCurrentThemeBaseGlobalStyles(),\n\t\t\tcore.__experimentalGetCurrentThemeGlobalStylesVariations(),\n\t\t\tcore.getEntityRecord( 'root', '__unstableBase' ),\n\t\t\tcore.getEntityRecord( 'root', 'site' ),\n\t\t\tcore.canUser( 'read', { kind: 'root', name: 'site' } ),\n\t\t\tcore.canUser( 'create', { kind: 'postType', name: 'attachment' } ),\n\t\t\tcore.canUser( 'create', { kind: 'postType', name: 'page' } ),\n\t\t\tcore.canUser( 'create', { kind: 'postType', name: 'wp_block' } ),\n\t\t\tcore.canUser( 'create', {\n\t\t\t\tkind: 'postType',\n\t\t\t\tname: 'wp_template',\n\t\t\t} ),\n\t\t\t// Per-post resolvers. `getPostType` and `getEditedEntityRecord`\n\t\t\t// are shorthand/forward-resolver aliases with their own\n\t\t\t// resolution metadata, so they need separate kicks.\n\t\t\t...( postType && postId\n\t\t\t\t? [\n\t\t\t\t\t\tcore.getPostType( postType ),\n\t\t\t\t\t\tcore.getEntityRecord( 'postType', postType, postId ),\n\t\t\t\t\t\tcore.getEditedEntityRecord(\n\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\tpostType,\n\t\t\t\t\t\t\tpostId\n\t\t\t\t\t\t),\n\t\t\t\t\t\tcore.getAutosaves( postType, postId ),\n\t\t\t\t\t\tcore.getDefaultTemplateId( { slug: 'front-page' } ),\n\t\t\t\t\t\tcore.canUser( 'create', {\n\t\t\t\t\t\t\tkind: 'postType',\n\t\t\t\t\t\t\tname: postType,\n\t\t\t\t\t\t} ),\n\t\t\t\t ]\n\t\t\t\t: [] ),\n\t\t] );\n\n\t\t// Phase 2: read derived data out of state.\n\t\tconst tasks = [];\n\t\tconst globalStylesId =\n\t\t\tcoreSelect.__experimentalGetCurrentGlobalStylesId();\n\t\tif ( globalStylesId ) {\n\t\t\ttasks.push(\n\t\t\t\tcore.getEntityRecord( 'root', 'globalStyles', globalStylesId ),\n\t\t\t\tcore.canUser( 'read', {\n\t\t\t\t\tkind: 'root',\n\t\t\t\t\tname: 'globalStyles',\n\t\t\t\t\tid: globalStylesId,\n\t\t\t\t} )\n\t\t\t);\n\t\t}\n\n\t\tif ( postType && postId ) {\n\t\t\tconst post = coreSelect.getEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId\n\t\t\t);\n\t\t\tif ( post ) {\n\t\t\t\t// Mirrors core-data's `getDefaultTemplate` slug formula.\n\t\t\t\tlet slug = 'page' === postType ? 'page' : 'single-' + postType;\n\t\t\t\tif ( post.slug ) {\n\t\t\t\t\tslug += '-' + post.slug;\n\t\t\t\t}\n\t\t\t\ttasks.push( core.getDefaultTemplateId( { slug } ) );\n\n\t\t\t\tif ( post.author ) {\n\t\t\t\t\ttasks.push(\n\t\t\t\t\t\tcore.getUser( post.author, {\n\t\t\t\t\t\t\tcontext: 'view',\n\t\t\t\t\t\t\t_fields: 'id,name',\n\t\t\t\t\t\t} )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( tasks.length ) {\n\t\t\tawait Promise.all( tasks );\n\t\t}\n\t} catch {\n\t\t// Resolver failures here would also surface on demand; don't block render.\n\t}\n}\n\n/**\n * Used to reinitialize the editor after an error. Now it's a deprecated noop function.\n */\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editPost.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\nexport { default as __experimentalFullscreenModeClose } from './components/back-button/fullscreen-mode-close';\nexport { __experimentalMainDashboardButton };\nexport { store } from './store';\nexport * from './deprecated';\n"],
|
|
5
|
-
"mappings": ";AAGA,SAAS,SAAS,mBAAmB;AACrC;AAAA,EACC;AAAA,EACA;AAAA,OACM;AACP,OAAO,gBAAgB;AACvB,SAAS,YAAY,kBAAkB;AACvC,SAAS,UAAU,eAAe,cAAc;AAChD,SAAS,SAAS,wBAAwB;AAC1C;AAAA,EACC;AAAA,EACA;AAAA,OACM;AACP;AAAA,EACC,SAAS;AAAA,EACT,eAAe;AAAA,OACT;AACP,SAAS,SAAS,qBAAqB;AACvC,OAAO,cAAc;AAKrB,OAAO,YAAY;AACnB,SAAS,cAAc;
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport deprecated from '@wordpress/deprecated';\nimport { createRoot, StrictMode } from '@wordpress/element';\nimport { dispatch, resolveSelect, select } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\nimport {\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport apiFetch from '@wordpress/api-fetch';\n\n/**\n * Internal dependencies\n */\nimport Layout from './components/layout';\nimport { unlock } from './lock-unlock';\n\nconst {\n\tBackButton: __experimentalMainDashboardButton,\n\tregisterCoreBlockBindingsSources,\n} = unlock( editorPrivateApis );\n\nconst { enablePreloadMultiUse, clearPreloadedData } = unlock(\n\tapiFetch.privateApis\n);\n\n/**\n * Initializes and returns an instance of Editor.\n *\n * @param {string} id Unique identifier for editor instance.\n * @param {string} postType Post type of the post to edit.\n * @param {Object} postId ID of the post to edit.\n * @param {?Object} settings Editor settings object.\n * @param {Object} initialEdits Programmatic edits to apply initially, to be\n * considered as non-user-initiated (bypass for\n * unsaved changes prompt).\n */\nexport function initializeEditor(\n\tid,\n\tpostType,\n\tpostId,\n\tsettings,\n\tinitialEdits\n) {\n\tconst isMediumOrBigger = window.matchMedia( '(min-width: 782px)' ).matches;\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-post', {\n\t\tfullscreenMode: true,\n\t\tthemeStyles: true,\n\t\twelcomeGuide: true,\n\t\twelcomeGuideTemplate: true,\n\t} );\n\n\tdispatch( preferencesStore ).setDefaults( 'core', {\n\t\tallowRightClickOverrides: true,\n\t\teditorMode: 'visual',\n\t\teditorTool: 'edit',\n\t\tfixedToolbar: false,\n\t\thiddenBlockTypes: [],\n\t\tinactivePanels: [],\n\t\topenPanels: [ 'post-status' ],\n\t\tshowBlockBreadcrumbs: true,\n\t\tshowIconLabels: false,\n\t\tshowListViewByDefault: false,\n\t\tenableChoosePatternModal: true,\n\t\tisPublishSidebarEnabled: 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( blocksStore ).reapplyBlockTypeFilters();\n\n\t// Check if the block list view should be open by default.\n\t// If `distractionFree` mode is enabled, the block list view should not be open.\n\t// This behavior is disabled for small viewports.\n\tif (\n\t\tisMediumOrBigger &&\n\t\tselect( preferencesStore ).get( 'core', 'showListViewByDefault' ) &&\n\t\t! select( preferencesStore ).get( 'core', 'distractionFree' )\n\t) {\n\t\tdispatch( editorStore ).setIsListViewOpened( true );\n\t}\n\n\tregisterCoreBlocks();\n\tregisterCoreBlockBindingsSources();\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tregisterWidgetGroupBlock( { inserter: false } );\n\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: settings.__unstableEnableFullSiteEditingBlocks,\n\t\t} );\n\t}\n\n\t// Show a console log warning if the browser is not in Standards rendering mode.\n\tconst documentMode =\n\t\tdocument.compatMode === 'CSS1Compat' ? 'Standards' : 'Quirks';\n\tif ( documentMode !== 'Standards' ) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn(\n\t\t\t\"Your browser is using Quirks Mode. \\nThis can cause rendering issues such as blocks overlaying meta boxes in the editor. Quirks Mode can be triggered by PHP errors or HTML code appearing before the opening <!DOCTYPE html>. Try checking the raw page source or your site's PHP error log and resolving errors there, removing any HTML before the doctype, or disabling plugins.\"\n\t\t);\n\t}\n\n\t// This is a temporary fix for a couple of issues specific to Webkit on iOS.\n\t// Without this hack the browser scrolls the mobile toolbar off-screen.\n\t// Once supported in Safari we can replace this in favor of preventScroll.\n\t// For details see issue #18632 and PR #18686\n\t// Specifically, we scroll `interface-interface-skeleton__body` to enable a fixed top toolbar.\n\t// But Mobile Safari forces the `html` element to scroll upwards, hiding the toolbar.\n\n\tconst isIphone = window.navigator.userAgent.indexOf( 'iPhone' ) !== -1;\n\tif ( isIphone ) {\n\t\twindow.addEventListener( 'scroll', ( event ) => {\n\t\t\tconst editorScrollContainer = document.getElementsByClassName(\n\t\t\t\t'interface-interface-skeleton__body'\n\t\t\t)[ 0 ];\n\t\t\tif ( event.target === document ) {\n\t\t\t\t// Scroll element into view by scrolling the editor container by the same amount\n\t\t\t\t// that Mobile Safari tried to scroll the html element upwards.\n\t\t\t\tif ( window.scrollY > 100 ) {\n\t\t\t\t\teditorScrollContainer.scrollTop =\n\t\t\t\t\t\teditorScrollContainer.scrollTop + window.scrollY;\n\t\t\t\t}\n\t\t\t\t// Undo unwanted scroll on html element, but only in the visual editor.\n\t\t\t\tif (\n\t\t\t\t\tdocument.getElementsByClassName( 'is-mode-visual' )[ 0 ]\n\t\t\t\t) {\n\t\t\t\t\twindow.scrollTo( 0, 0 );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\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\t// Drive the resolvers whose data `createPreloadingMiddleware`\n\t// already has cached so every metadata entry they touch is\n\t// `finished` by the time React mounts — no `setTimeout(0)`\n\t// resolution dance on first render. Multi-use lets a single\n\t// preloaded URL back several selectors (e.g. /wp/v2/settings GET +\n\t// OPTIONS serves `getEntitiesConfig`, `canUser`, `getEntityRecord`).\n\tenablePreloadMultiUse();\n\tconst preloadedResolutions = preloadResolutions( postType, postId );\n\n\tpreloadedResolutions.finally( () => {\n\t\t// Anything not consumed by the kickoff falls through to a real\n\t\t// network request from here on. `clearPreloadedData` logs which\n\t\t// preload entries (if any) were never served.\n\t\tclearPreloadedData();\n\t\tif ( postType && postId ) {\n\t\t\tconst post = select( coreDataStore ).getEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId\n\t\t\t);\n\t\t\tif ( post ) {\n\t\t\t\tdispatch( editorStore ).setupEditor(\n\t\t\t\t\tpost,\n\t\t\t\t\tinitialEdits,\n\t\t\t\t\tsettings.template\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\troot.render(\n\t\t\t<StrictMode>\n\t\t\t\t<Layout\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t\tpostId={ postId }\n\t\t\t\t\tpostType={ postType }\n\t\t\t\t\tinitialEdits={ initialEdits }\n\t\t\t\t/>\n\t\t\t</StrictMode>\n\t\t);\n\t} );\n\n\treturn root;\n}\n\n/**\n * Drive resolvers to completion against the preload cache before React\n * mounts. Two phases: known-up-front args (post id + type), then args\n * derived from phase-1 state (post slug → template, current global\n * styles id → record + canUser).\n *\n * @param {string} postType Current post type.\n * @param {number} postId Current post id.\n * @return {Promise<void>} Resolves when the kickoff resolvers settle.\n */\nasync function preloadResolutions( postType, postId ) {\n\tconst core = resolveSelect( coreDataStore );\n\tconst coreSelect = select( coreDataStore );\n\n\ttry {\n\t\tawait Promise.all( [\n\t\t\tcore.getCurrentUser(),\n\t\t\tcore.getEntitiesConfig( 'postType' ),\n\t\t\tcore.getEntitiesConfig( 'taxonomy' ),\n\t\t\tcore.getEntitiesConfig( 'root' ),\n\t\t\tcore.getEntityRecords( 'root', 'taxonomy' ),\n\t\t\tcore.getCurrentTheme(),\n\t\t\t// Forward-resolver alias of `getCurrentTheme` with its own\n\t\t\t// resolution metadata, so it needs a separate kick.\n\t\t\tcore.getThemeSupports(),\n\t\t\tcore.getBlockPatternCategories(),\n\t\t\tcore.__experimentalGetCurrentGlobalStylesId(),\n\t\t\tcore.__experimentalGetCurrentThemeBaseGlobalStyles(),\n\t\t\tcore.__experimentalGetCurrentThemeGlobalStylesVariations(),\n\t\t\tcore.getEntityRecord( 'root', '__unstableBase' ),\n\t\t\tcore.getEntityRecord( 'root', 'site' ),\n\t\t\tcore.canUser( 'read', { kind: 'root', name: 'site' } ),\n\t\t\tcore.canUser( 'create', { kind: 'postType', name: 'attachment' } ),\n\t\t\tcore.canUser( 'create', { kind: 'postType', name: 'page' } ),\n\t\t\tcore.canUser( 'create', { kind: 'postType', name: 'wp_block' } ),\n\t\t\tcore.canUser( 'create', {\n\t\t\t\tkind: 'postType',\n\t\t\t\tname: 'wp_template',\n\t\t\t} ),\n\t\t\t// Per-post resolvers. `getPostType` and `getEditedEntityRecord`\n\t\t\t// are shorthand/forward-resolver aliases with their own\n\t\t\t// resolution metadata, so they need separate kicks.\n\t\t\t...( postType && postId\n\t\t\t\t? [\n\t\t\t\t\t\tcore.getPostType( postType ),\n\t\t\t\t\t\tcore.getEntityRecord( 'postType', postType, postId ),\n\t\t\t\t\t\tcore.getEditedEntityRecord(\n\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\tpostType,\n\t\t\t\t\t\t\tpostId\n\t\t\t\t\t\t),\n\t\t\t\t\t\tcore.getAutosaves( postType, postId ),\n\t\t\t\t\t\tcore.getDefaultTemplateId( { slug: 'front-page' } ),\n\t\t\t\t\t\tcore.canUser( 'create', {\n\t\t\t\t\t\t\tkind: 'postType',\n\t\t\t\t\t\t\tname: postType,\n\t\t\t\t\t\t} ),\n\t\t\t\t ]\n\t\t\t\t: [] ),\n\t\t] );\n\n\t\t// Phase 2: read derived data out of state.\n\t\tconst tasks = [];\n\t\tconst globalStylesId =\n\t\t\tcoreSelect.__experimentalGetCurrentGlobalStylesId();\n\t\tif ( globalStylesId ) {\n\t\t\ttasks.push(\n\t\t\t\tcore.getEntityRecord( 'root', 'globalStyles', globalStylesId ),\n\t\t\t\tcore.canUser( 'read', {\n\t\t\t\t\tkind: 'root',\n\t\t\t\t\tname: 'globalStyles',\n\t\t\t\t\tid: globalStylesId,\n\t\t\t\t} )\n\t\t\t);\n\t\t}\n\n\t\tif ( postType && postId ) {\n\t\t\tconst post = coreSelect.getEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId\n\t\t\t);\n\t\t\tif ( post ) {\n\t\t\t\t// Mirrors core-data's `getDefaultTemplate` slug formula.\n\t\t\t\tlet slug = 'page' === postType ? 'page' : 'single-' + postType;\n\t\t\t\tif ( post.slug ) {\n\t\t\t\t\tslug += '-' + post.slug;\n\t\t\t\t}\n\t\t\t\ttasks.push( core.getDefaultTemplateId( { slug } ) );\n\n\t\t\t\tif ( post.author ) {\n\t\t\t\t\ttasks.push(\n\t\t\t\t\t\tcore.getUser( post.author, {\n\t\t\t\t\t\t\tcontext: 'view',\n\t\t\t\t\t\t\t_fields: 'id,name',\n\t\t\t\t\t\t} )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( tasks.length ) {\n\t\t\tawait Promise.all( tasks );\n\t\t}\n\t} catch {\n\t\t// Resolver failures here would also surface on demand; don't block render.\n\t}\n}\n\n/**\n * Used to reinitialize the editor after an error. Now it's a deprecated noop function.\n */\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editPost.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\nexport { default as __experimentalFullscreenModeClose } from './components/back-button/fullscreen-mode-close';\nexport { __experimentalMainDashboardButton };\nexport { store } from './store';\nexport * from './deprecated';\n"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,SAAS,mBAAmB;AACrC;AA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KAAM;AAAA,IAC1B;AAAA,EACD,QAAQ;AAAA,EAER;AACD;AAKO,SAAS,qBAAqB;AACpC,aAAY,kCAAkC;AAAA,IAC7C,OAAO;AAAA,IACP,SAAS;AAAA,EACV,CAAE;AACH;",
|
|
6
6
|
"names": ["default"]
|
|
7
7
|
}
|
|
@@ -67,6 +67,12 @@
|
|
|
67
67
|
/**
|
|
68
68
|
* Focus styles.
|
|
69
69
|
*/
|
|
70
|
+
/**
|
|
71
|
+
* Standard focus rings for the WordPress Design System.
|
|
72
|
+
*
|
|
73
|
+
* Apply `outset-ring__focus` inside the relevant pseudo-class at the call site,
|
|
74
|
+
* e.g. `&:focus { @include outset-ring__focus(); }`.
|
|
75
|
+
*/
|
|
70
76
|
/**
|
|
71
77
|
* Applies editor left position to the selector passed as argument
|
|
72
78
|
*/
|
package/build-style/classic.css
CHANGED
|
@@ -67,6 +67,12 @@
|
|
|
67
67
|
/**
|
|
68
68
|
* Focus styles.
|
|
69
69
|
*/
|
|
70
|
+
/**
|
|
71
|
+
* Standard focus rings for the WordPress Design System.
|
|
72
|
+
*
|
|
73
|
+
* Apply `outset-ring__focus` inside the relevant pseudo-class at the call site,
|
|
74
|
+
* e.g. `&:focus { @include outset-ring__focus(); }`.
|
|
75
|
+
*/
|
|
70
76
|
/**
|
|
71
77
|
* Applies editor left position to the selector passed as argument
|
|
72
78
|
*/
|