@wordpress/edit-post 8.31.1-next.f56bd8138.0 → 8.32.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.js +74 -32
- package/build/components/back-button/fullscreen-mode-close.js.map +1 -1
- package/build/components/layout/index.js +1 -1
- package/build/components/layout/index.js.map +1 -1
- package/build-module/components/back-button/fullscreen-mode-close.js +76 -34
- package/build-module/components/back-button/fullscreen-mode-close.js.map +1 -1
- package/build-module/components/layout/index.js +1 -1
- package/build-module/components/layout/index.js.map +1 -1
- package/build-style/style-rtl.css +72 -52
- package/build-style/style.css +72 -52
- package/package.json +30 -30
- package/src/components/back-button/fullscreen-mode-close.js +79 -25
- package/src/components/back-button/style.scss +70 -42
- package/src/components/layout/index.js +1 -1
- package/src/components/back-button/test/__snapshots__/fullscreen-mode-close.js.snap +0 -26
- package/src/components/back-button/test/fullscreen-mode-close.js +0 -92
package/CHANGELOG.md
CHANGED
|
@@ -23,6 +23,28 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
23
23
|
* WordPress dependencies
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
|
+
const siteIconVariants = {
|
|
27
|
+
edit: {
|
|
28
|
+
clipPath: 'inset(0% round 0px)'
|
|
29
|
+
},
|
|
30
|
+
hover: {
|
|
31
|
+
clipPath: 'inset( 22% round 2px )'
|
|
32
|
+
},
|
|
33
|
+
tap: {
|
|
34
|
+
clipPath: 'inset(0% round 0px)'
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
const toggleHomeIconVariants = {
|
|
38
|
+
edit: {
|
|
39
|
+
opacity: 0,
|
|
40
|
+
scale: 0.2
|
|
41
|
+
},
|
|
42
|
+
hover: {
|
|
43
|
+
opacity: 1,
|
|
44
|
+
scale: 1,
|
|
45
|
+
clipPath: 'inset( 22% round 2px )'
|
|
46
|
+
}
|
|
47
|
+
};
|
|
26
48
|
function FullscreenModeClose({
|
|
27
49
|
showTooltip,
|
|
28
50
|
icon,
|
|
@@ -50,43 +72,43 @@ function FullscreenModeClose({
|
|
|
50
72
|
postType: getPostType(_postType),
|
|
51
73
|
siteIconUrl: siteData.site_icon_url
|
|
52
74
|
};
|
|
53
|
-
}, []);
|
|
75
|
+
}, [initialPost?.type]);
|
|
54
76
|
const disableMotion = (0, _compose.useReducedMotion)();
|
|
77
|
+
const transition = {
|
|
78
|
+
duration: disableMotion ? 0 : 0.2
|
|
79
|
+
};
|
|
55
80
|
if (!postType) {
|
|
56
81
|
return null;
|
|
57
82
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
if (siteIconUrl) {
|
|
72
|
-
buttonIcon = /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__unstableMotion.img, {
|
|
73
|
-
variants: !disableMotion && effect,
|
|
83
|
+
|
|
84
|
+
// Create SiteIcon equivalent structure exactly like edit-site
|
|
85
|
+
let siteIconContent;
|
|
86
|
+
if (isRequestingSiteIcon && !siteIconUrl) {
|
|
87
|
+
siteIconContent = /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
88
|
+
className: "edit-post-fullscreen-mode-close-site-icon__image"
|
|
89
|
+
});
|
|
90
|
+
} else if (siteIconUrl) {
|
|
91
|
+
siteIconContent = /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
92
|
+
className: "edit-post-fullscreen-mode-close-site-icon__image",
|
|
74
93
|
alt: (0, _i18n.__)('Site Icon'),
|
|
75
|
-
className: "edit-post-fullscreen-mode-close_site-icon",
|
|
76
94
|
src: siteIconUrl
|
|
77
95
|
});
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
|
|
96
|
+
} else {
|
|
97
|
+
siteIconContent = /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Icon, {
|
|
98
|
+
className: "edit-post-fullscreen-mode-close-site-icon__icon",
|
|
99
|
+
icon: _icons.wordpress,
|
|
100
|
+
size: 48
|
|
101
|
+
});
|
|
81
102
|
}
|
|
82
103
|
|
|
83
104
|
// Override default icon if custom icon is provided via props.
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
105
|
+
const buttonIcon = icon ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Icon, {
|
|
106
|
+
size: "36px",
|
|
107
|
+
icon: icon
|
|
108
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
109
|
+
className: "edit-post-fullscreen-mode-close-site-icon",
|
|
110
|
+
children: siteIconContent
|
|
111
|
+
});
|
|
90
112
|
const classes = (0, _clsx.default)('edit-post-fullscreen-mode-close', {
|
|
91
113
|
'has-icon': siteIconUrl
|
|
92
114
|
});
|
|
@@ -94,16 +116,36 @@ function FullscreenModeClose({
|
|
|
94
116
|
post_type: postType.slug
|
|
95
117
|
});
|
|
96
118
|
const buttonLabel = (_postType$labels$view = postType?.labels?.view_items) !== null && _postType$labels$view !== void 0 ? _postType$labels$view : (0, _i18n.__)('Back');
|
|
97
|
-
return /*#__PURE__*/(0, _jsxRuntime.
|
|
98
|
-
|
|
99
|
-
|
|
119
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__unstableMotion.div, {
|
|
120
|
+
className: "edit-post-fullscreen-mode-close__view-mode-toggle",
|
|
121
|
+
animate: "edit",
|
|
122
|
+
initial: "edit",
|
|
123
|
+
whileHover: "hover",
|
|
124
|
+
whileTap: "tap",
|
|
125
|
+
transition: transition,
|
|
126
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
100
127
|
__next40pxDefaultSize: true,
|
|
101
128
|
className: classes,
|
|
102
129
|
href: buttonHref,
|
|
103
130
|
label: buttonLabel,
|
|
104
131
|
showTooltip: showTooltip,
|
|
105
|
-
|
|
106
|
-
|
|
132
|
+
tooltipPosition: "middle right",
|
|
133
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__unstableMotion.div, {
|
|
134
|
+
variants: !disableMotion && siteIconVariants,
|
|
135
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
136
|
+
className: "edit-post-fullscreen-mode-close__view-mode-toggle-icon",
|
|
137
|
+
children: buttonIcon
|
|
138
|
+
})
|
|
139
|
+
})
|
|
140
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__unstableMotion.div, {
|
|
141
|
+
className: (0, _clsx.default)('edit-post-fullscreen-mode-close__back-icon', {
|
|
142
|
+
'has-site-icon': siteIconUrl
|
|
143
|
+
}),
|
|
144
|
+
variants: !disableMotion && toggleHomeIconVariants,
|
|
145
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Icon, {
|
|
146
|
+
icon: _icons.arrowUpLeft
|
|
147
|
+
})
|
|
148
|
+
})]
|
|
107
149
|
});
|
|
108
150
|
}
|
|
109
151
|
var _default = exports.default = FullscreenModeClose;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_data","_components","_i18n","_url","_icons","_editor","_coreData","_compose","_jsxRuntime","FullscreenModeClose","showTooltip","icon","href","initialPost","_postType$labels$view","isRequestingSiteIcon","postType","siteIconUrl","useSelect","select","getCurrentPostType","editorStore","getEntityRecord","getPostType","isResolving","coreStore","siteData","undefined","_postType","type","site_icon_url","disableMotion","useReducedMotion","
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_data","_components","_i18n","_url","_icons","_editor","_coreData","_compose","_jsxRuntime","siteIconVariants","edit","clipPath","hover","tap","toggleHomeIconVariants","opacity","scale","FullscreenModeClose","showTooltip","icon","href","initialPost","_postType$labels$view","isRequestingSiteIcon","postType","siteIconUrl","useSelect","select","getCurrentPostType","editorStore","getEntityRecord","getPostType","isResolving","coreStore","siteData","undefined","_postType","type","site_icon_url","disableMotion","useReducedMotion","transition","duration","siteIconContent","jsx","className","alt","__","src","Icon","wordpress","size","buttonIcon","children","classes","clsx","buttonHref","addQueryArgs","post_type","slug","buttonLabel","labels","view_items","jsxs","__unstableMotion","div","animate","initial","whileHover","whileTap","Button","__next40pxDefaultSize","label","tooltipPosition","variants","arrowUpLeft","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/back-button/fullscreen-mode-close.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tButton,\n\tIcon,\n\t__unstableMotion as motion,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { addQueryArgs } from '@wordpress/url';\nimport { wordpress, arrowUpLeft } from '@wordpress/icons';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useReducedMotion } from '@wordpress/compose';\n\nconst siteIconVariants = {\n\tedit: {\n\t\tclipPath: 'inset(0% round 0px)',\n\t},\n\thover: {\n\t\tclipPath: 'inset( 22% round 2px )',\n\t},\n\ttap: {\n\t\tclipPath: 'inset(0% round 0px)',\n\t},\n};\n\nconst toggleHomeIconVariants = {\n\tedit: {\n\t\topacity: 0,\n\t\tscale: 0.2,\n\t},\n\thover: {\n\t\topacity: 1,\n\t\tscale: 1,\n\t\tclipPath: 'inset( 22% round 2px )',\n\t},\n};\n\nfunction FullscreenModeClose( { showTooltip, icon, href, initialPost } ) {\n\tconst { isRequestingSiteIcon, postType, siteIconUrl } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getCurrentPostType } = select( editorStore );\n\t\t\tconst { getEntityRecord, getPostType, isResolving } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst siteData =\n\t\t\t\tgetEntityRecord( 'root', '__unstableBase', undefined ) || {};\n\t\t\tconst _postType = initialPost?.type || getCurrentPostType();\n\t\t\treturn {\n\t\t\t\tisRequestingSiteIcon: isResolving( 'getEntityRecord', [\n\t\t\t\t\t'root',\n\t\t\t\t\t'__unstableBase',\n\t\t\t\t\tundefined,\n\t\t\t\t] ),\n\t\t\t\tpostType: getPostType( _postType ),\n\t\t\t\tsiteIconUrl: siteData.site_icon_url,\n\t\t\t};\n\t\t},\n\t\t[ initialPost?.type ]\n\t);\n\n\tconst disableMotion = useReducedMotion();\n\tconst transition = {\n\t\tduration: disableMotion ? 0 : 0.2,\n\t};\n\n\tif ( ! postType ) {\n\t\treturn null;\n\t}\n\n\t// Create SiteIcon equivalent structure exactly like edit-site\n\tlet siteIconContent;\n\tif ( isRequestingSiteIcon && ! siteIconUrl ) {\n\t\tsiteIconContent = (\n\t\t\t<div className=\"edit-post-fullscreen-mode-close-site-icon__image\" />\n\t\t);\n\t} else if ( siteIconUrl ) {\n\t\tsiteIconContent = (\n\t\t\t<img\n\t\t\t\tclassName=\"edit-post-fullscreen-mode-close-site-icon__image\"\n\t\t\t\talt={ __( 'Site Icon' ) }\n\t\t\t\tsrc={ siteIconUrl }\n\t\t\t/>\n\t\t);\n\t} else {\n\t\tsiteIconContent = (\n\t\t\t<Icon\n\t\t\t\tclassName=\"edit-post-fullscreen-mode-close-site-icon__icon\"\n\t\t\t\ticon={ wordpress }\n\t\t\t\tsize={ 48 }\n\t\t\t/>\n\t\t);\n\t}\n\n\t// Override default icon if custom icon is provided via props.\n\tconst buttonIcon = icon ? (\n\t\t<Icon size=\"36px\" icon={ icon } />\n\t) : (\n\t\t<div className=\"edit-post-fullscreen-mode-close-site-icon\">\n\t\t\t{ siteIconContent }\n\t\t</div>\n\t);\n\n\tconst classes = clsx( 'edit-post-fullscreen-mode-close', {\n\t\t'has-icon': siteIconUrl,\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<motion.div\n\t\t\tclassName=\"edit-post-fullscreen-mode-close__view-mode-toggle\"\n\t\t\tanimate=\"edit\"\n\t\t\tinitial=\"edit\"\n\t\t\twhileHover=\"hover\"\n\t\t\twhileTap=\"tap\"\n\t\t\ttransition={ transition }\n\t\t>\n\t\t\t<Button\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tclassName={ classes }\n\t\t\t\thref={ buttonHref }\n\t\t\t\tlabel={ buttonLabel }\n\t\t\t\tshowTooltip={ showTooltip }\n\t\t\t\ttooltipPosition=\"middle right\"\n\t\t\t>\n\t\t\t\t<motion.div variants={ ! disableMotion && siteIconVariants }>\n\t\t\t\t\t<div className=\"edit-post-fullscreen-mode-close__view-mode-toggle-icon\">\n\t\t\t\t\t\t{ buttonIcon }\n\t\t\t\t\t</div>\n\t\t\t\t</motion.div>\n\t\t\t</Button>\n\t\t\t<motion.div\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\t'edit-post-fullscreen-mode-close__back-icon',\n\t\t\t\t\t{\n\t\t\t\t\t\t'has-site-icon': siteIconUrl,\n\t\t\t\t\t}\n\t\t\t\t) }\n\t\t\t\tvariants={ ! disableMotion && toggleHomeIconVariants }\n\t\t\t>\n\t\t\t\t<Icon icon={ arrowUpLeft } />\n\t\t\t</motion.div>\n\t\t</motion.div>\n\t);\n}\n\nexport default FullscreenModeClose;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAKA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AAAsD,IAAAS,WAAA,GAAAT,OAA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;MAAa,CAAE;IAAC,CAClB,CAAC;EAAA,CACF,CAAC;AAEf;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc7D,mBAAmB","ignoreList":[]}
|
|
@@ -518,7 +518,7 @@ function Layout({
|
|
|
518
518
|
const title = typeof newItem.title === 'string' ? newItem.title : newItem.title?.rendered;
|
|
519
519
|
createSuccessNotice((0, _i18n.sprintf)(
|
|
520
520
|
// translators: %s: Title of the created post or template, e.g: "Hello world".
|
|
521
|
-
(0, _i18n.__)('"%s" successfully created.'), (0, _htmlEntities.decodeEntities)(title)), {
|
|
521
|
+
(0, _i18n.__)('"%s" successfully created.'), (0, _htmlEntities.decodeEntities)(title) || (0, _i18n.__)('(no title)')), {
|
|
522
522
|
type: 'snackbar',
|
|
523
523
|
id: 'duplicate-post-action',
|
|
524
524
|
actions: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_editor","_data","_blockEditor","_plugins","_i18n","_element","_icons","_notices","_preferences","_commands","_blockLibrary","_url","_htmlEntities","_coreData","_components","_compose","_backButton","_editorInitialization","_keyboardShortcuts","_initPatternModal","_browserUrl","_metaBoxes","_moreMenu","_welcomeGuide","_store","_lockUnlock","_useCommands","_usePaddingAppender","_useShouldIframe","_useNavigateToEntityRecord","_useMetaBoxInitialization","_jsxRuntime","getLayoutStyles","unlock","blockEditorPrivateApis","useCommandContext","commandsPrivateApis","Editor","FullscreenMode","NavigableRegion","editorPrivateApis","BlockKeyboardShortcuts","blockLibraryPrivateApis","DESIGN_POST_TYPES","useEditorStyles","additionalStyles","hasThemeStyleSupport","editorSettings","useSelect","select","editPostStore","isFeatureActive","editorStore","getEditorSettings","addedStyles","join","useMemo","_editorSettings$style","_editorSettings$defau","_editorSettings$style2","_editorSettings$style3","presetStyles","styles","filter","style","__unstableType","defaultEditorStyles","hasThemeStyles","length","disableLayoutStyles","push","css","selector","hasBlockGapSupport","hasFallbackGapSupport","fallbackGapValue","baseStyles","MetaBoxesMain","isLegacy","isOpen","openHeight","hasAnyVisible","get","preferencesStore","isMetaBoxLocationVisible","set","setPreference","useDispatch","metaBoxesMainRef","useRef","isShort","useMediaQuery","min","max","setHeightConstraints","useState","effectSizeConstraints","useRefEffect","node","container","closest","noticeLists","querySelectorAll","resizeHandle","querySelector","deriveConstraints","fullHeight","offsetHeight","nextMax","element","nextMin","observer","window","ResizeObserver","observe","disconnect","resizeDataRef","separatorRef","separatorHelpId","useId","applyHeight","candidateHeight","isPersistent","isInstant","Math","current","ariaValueNow","getAriaValueNow","updateSize","height","width","getRenderValues","useEvent","useEffect","fresh","undefined","usedOpenHeight","usedHeight","contents","jsxs","className","hidden","children","jsx","default","location","isAutoHeight","round","usedAriaValueNow","persistIsOpen","to","onSeparatorKeyDown","event","delta","ArrowUp","ArrowDown","key","pane","resizable","fromHeight","nextHeight","preventDefault","paneLabel","__","toggle","onClick","detail","isToggleInferred","onMouseDown","stopPropagation","onTouchStart","Icon","icon","chevronUp","chevronDown","separator","Fragment","Tooltip","text","ref","role","onKeyDown","VisuallyHidden","id","paneProps","as","defaultSize","minHeight","maxHeight","enable","top","handleClasses","handleComponent","onPointerDown","pointerId","target","parentElement","contains","setPointerCapture","onResizeStart","timeStamp","direction","elementRef","classList","add","maxDelta","onResize","newDelta","abs","state","onResizeStop","remove","duration","wasSeparator","nextIsOpen","ResizableBox","Layout","postId","initialPostId","postType","initialPostType","settings","initialEdits","useEditPostCommands","shouldIframe","useShouldIframe","createErrorNotice","noticesStore","currentPost","currentPostId","currentPostType","onNavigateToEntityRecord","onNavigateToPreviousEntityRecord","useNavigateToEntityRecord","isEditingTemplate","mode","isFullscreenActive","hasResolvedMode","hasActiveMetaboxes","hasBlockSelected","showIconLabels","isDistractionFree","showMetaBoxes","isWelcomeGuideVisible","templateId","enablePaddingAppender","isDevicePreview","_getPostType$viewable","hasMetaBoxes","canUser","getPostType","getTemplateId","coreStore","supportsTemplateMode","isViewable","viewable","canViewTemplate","kind","name","getBlockSelectionStart","isZoomOut","blockEditorStore","getEditorMode","getRenderingMode","getDefaultRenderingMode","getDeviceType","isRenderingPostOnly","isNotDesignPostType","includes","isDirectlyEditingPattern","_templateId","defaultMode","useMetaBoxInitialization","editableResolvedTemplateId","getTemplateAutoDraftId","paddingAppenderRef","paddingStyle","usePaddingAppender","commandContext","defaultRenderingMode","document","body","navigateRegionsProps","useNavigateRegions","clsx","onPluginAreaError","sprintf","createSuccessNotice","onActionPerformed","useCallback","actionId","items","href","addQueryArgs","trashed","post_type","type","ids","newItem","title","rendered","decodeEntities","actions","label","post","action","initialPost","backButton","useViewportMatch","SlotFillProvider","ErrorBoundary","canCopyContent","forceIsDirty","contentRef","disableIframe","autoFocus","extraSidebarPanels","extraContent","PostLockedModal","isActive","UnsavedChangesWarning","AutosaveMonitor","LocalAutosaveMonitor","EditorKeyboardShortcutsRegister","PluginArea","onError","EditorSnackbars","_default","exports"],"sources":["@wordpress/edit-post/src/components/layout/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAutosaveMonitor,\n\tLocalAutosaveMonitor,\n\tUnsavedChangesWarning,\n\tEditorKeyboardShortcutsRegister,\n\tEditorSnackbars,\n\tErrorBoundary,\n\tPostLockedModal,\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { PluginArea } from '@wordpress/plugins';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tuseCallback,\n\tuseEffect,\n\tuseMemo,\n\tuseId,\n\tuseRef,\n\tuseState,\n} from '@wordpress/element';\nimport { chevronDown, chevronUp } from '@wordpress/icons';\nimport { 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,\n\tResizableBox,\n\tSlotFillProvider,\n\tTooltip,\n\tVisuallyHidden,\n\t__unstableUseNavigateRegions as useNavigateRegions,\n} from '@wordpress/components';\nimport {\n\tuseEvent,\n\tuseMediaQuery,\n\tuseRefEffect,\n\tuseViewportMatch,\n} from '@wordpress/compose';\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 { usePaddingAppender } from './use-padding-appender';\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 { getLayoutStyles } = unlock( blockEditorPrivateApis );\nconst { useCommandContext } = unlock( commandsPrivateApis );\nconst { Editor, FullscreenMode, NavigableRegion } = unlock( 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\t'wp_registered_template',\n];\n\nfunction useEditorStyles( ...additionalStyles ) {\n\tconst { hasThemeStyleSupport, editorSettings } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\thasThemeStyleSupport:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'themeStyles' ),\n\t\t\teditorSettings: select( editorStore ).getEditorSettings(),\n\t\t};\n\t}, [] );\n\n\tconst addedStyles = additionalStyles.join( '\\n' );\n\n\t// Compute the default styles.\n\treturn useMemo( () => {\n\t\tconst presetStyles =\n\t\t\teditorSettings.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...( editorSettings?.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 !== ( editorSettings.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 ( ! editorSettings.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\tconst baseStyles = hasThemeStyles\n\t\t\t? editorSettings.styles ?? []\n\t\t\t: defaultEditorStyles;\n\n\t\tif ( addedStyles ) {\n\t\t\treturn [ ...baseStyles, { css: addedStyles } ];\n\t\t}\n\n\t\treturn baseStyles;\n\t}, [\n\t\teditorSettings.defaultEditorStyles,\n\t\teditorSettings.disableLayoutStyles,\n\t\teditorSettings.styles,\n\t\thasThemeStyleSupport,\n\t\taddedStyles,\n\t] );\n}\n\n/**\n * @param {Object} props\n * @param {boolean} props.isLegacy True when the editor canvas is not in an iframe.\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\tconst metaBoxesMainRef = useRef();\n\tconst isShort = useMediaQuery( '(max-height: 549px)' );\n\n\tconst [ { min, 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 noticeLists = container.querySelectorAll(\n\t\t\t':scope > .components-notice-list'\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\tfor ( const element of noticeLists ) {\n\t\t\t\tnextMax -= element.offsetHeight;\n\t\t\t}\n\t\t\tconst nextMin = resizeHandle.offsetHeight;\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\tfor ( const element of noticeLists ) {\n\t\t\tobserver.observe( element );\n\t\t}\n\t\treturn () => observer.disconnect();\n\t}, [] );\n\n\tconst resizeDataRef = useRef( {} );\n\tconst separatorRef = useRef();\n\tconst separatorHelpId = useId();\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 * @param {boolean} isInstant Whether to update the height in the DOM.\n\t */\n\tconst applyHeight = (\n\t\tcandidateHeight = 'auto',\n\t\tisPersistent,\n\t\tisInstant\n\t) => {\n\t\tif ( candidateHeight === 'auto' ) {\n\t\t\tisPersistent = false; // Just in case — “auto” should never persist.\n\t\t} else {\n\t\t\tcandidateHeight = Math.min( max, Math.max( min, candidateHeight ) );\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// Updates aria-valuenow only when not persisting the value because otherwise\n\t\t// it's done by the render that persisting the value causes.\n\t\telse if ( ! isShort ) {\n\t\t\tseparatorRef.current.ariaValueNow =\n\t\t\t\tgetAriaValueNow( candidateHeight );\n\t\t}\n\t\tif ( isInstant ) {\n\t\t\tmetaBoxesMainRef.current.updateSize( {\n\t\t\t\theight: candidateHeight,\n\t\t\t\t// Oddly, when the event that triggered this was not from the mouse (e.g. keydown),\n\t\t\t\t// if `width` is left unspecified a subsequent drag gesture applies a fixed\n\t\t\t\t// width and the pane fails to widen/narrow with parent width changes from\n\t\t\t\t// sidebars opening/closing or window resizes.\n\t\t\t\twidth: 'auto',\n\t\t\t} );\n\t\t}\n\t};\n\tconst getRenderValues = useEvent( () => ( { isOpen, openHeight, min } ) );\n\t// Sets the height to 'auto' when not resizable (isShort) and to the\n\t// preferred height when resizable.\n\tuseEffect( () => {\n\t\tconst fresh = getRenderValues();\n\t\t// Tests for `min` having a value to skip the first render.\n\t\tif ( fresh.min !== undefined && metaBoxesMainRef.current ) {\n\t\t\tconst usedOpenHeight = isShort ? 'auto' : fresh.openHeight;\n\t\t\tconst usedHeight = fresh.isOpen ? usedOpenHeight : fresh.min;\n\t\t\tapplyHeight( usedHeight, false, true );\n\t\t}\n\t}, [ isShort ] );\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={ ! 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 getAriaValueNow = ( height ) =>\n\t\tMath.round( ( ( height - min ) / ( max - min ) ) * 100 );\n\tconst usedAriaValueNow =\n\t\tmax === undefined || isAutoHeight ? 50 : getAriaValueNow( openHeight );\n\n\tconst persistIsOpen = ( to = ! isOpen ) =>\n\t\tsetPreference( 'core/edit-post', 'metaBoxesMainIsOpen', to );\n\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 onSeparatorKeyDown = ( event ) => {\n\t\tconst delta = { ArrowUp: 20, ArrowDown: -20 }[ event.key ];\n\t\tif ( delta ) {\n\t\t\tconst pane = metaBoxesMainRef.current.resizable;\n\t\t\tconst fromHeight = isAutoHeight ? pane.offsetHeight : openHeight;\n\t\t\tconst nextHeight = delta + fromHeight;\n\t\t\tapplyHeight( nextHeight, true, true );\n\t\t\tpersistIsOpen( nextHeight > min );\n\t\t\tevent.preventDefault();\n\t\t}\n\t};\n\tconst paneLabel = __( 'Meta Boxes' );\n\n\tconst toggle = (\n\t\t<button\n\t\t\taria-expanded={ isOpen }\n\t\t\tonClick={ ( { detail } ) => {\n\t\t\t\tconst { isToggleInferred } = resizeDataRef.current;\n\t\t\t\tif ( isShort || ! detail || isToggleInferred ) {\n\t\t\t\t\tpersistIsOpen();\n\t\t\t\t\tconst usedOpenHeight = isShort ? 'auto' : openHeight;\n\t\t\t\t\tconst usedHeight = isOpen ? min : usedOpenHeight;\n\t\t\t\t\tapplyHeight( usedHeight, false, true );\n\t\t\t\t}\n\t\t\t} }\n\t\t\t// Prevents resizing in short viewports.\n\t\t\t{ ...( isShort && {\n\t\t\t\tonMouseDown: ( event ) => event.stopPropagation(),\n\t\t\t\tonTouchStart: ( event ) => event.stopPropagation(),\n\t\t\t} ) }\n\t\t>\n\t\t\t{ paneLabel }\n\t\t\t<Icon icon={ isOpen ? chevronUp : chevronDown } />\n\t\t</button>\n\t);\n\n\tconst separator = ! isShort && (\n\t\t<>\n\t\t\t<Tooltip text={ __( 'Drag to resize' ) }>\n\t\t\t\t<button // eslint-disable-line jsx-a11y/role-supports-aria-props\n\t\t\t\t\tref={ separatorRef }\n\t\t\t\t\trole=\"separator\" // eslint-disable-line jsx-a11y/no-interactive-element-to-noninteractive-role\n\t\t\t\t\taria-valuenow={ usedAriaValueNow }\n\t\t\t\t\taria-label={ __( 'Drag to resize' ) }\n\t\t\t\t\taria-describedby={ separatorHelpId }\n\t\t\t\t\tonKeyDown={ onSeparatorKeyDown }\n\t\t\t\t/>\n\t\t\t</Tooltip>\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 panel.'\n\t\t\t\t) }\n\t\t\t</VisuallyHidden>\n\t\t</>\n\t);\n\n\tconst paneProps = /** @type {Parameters<typeof ResizableBox>[0]} */ ( {\n\t\tas: NavigableRegion,\n\t\tref: metaBoxesMainRef,\n\t\tclassName: 'edit-post-meta-boxes-main',\n\t\tdefaultSize: { height: isOpen ? openHeight : 0 },\n\t\tminHeight: min,\n\t\tmaxHeight: max,\n\t\tenable: { top: true },\n\t\thandleClasses: { top: 'edit-post-meta-boxes-main__presenter' },\n\t\thandleComponent: {\n\t\t\ttop: (\n\t\t\t\t<>\n\t\t\t\t\t{ toggle }\n\t\t\t\t\t{ separator }\n\t\t\t\t</>\n\t\t\t),\n\t\t},\n\t\t// Avoids hiccups while dragging over objects like iframes and ensures that\n\t\t// the event to end the drag is captured by the target (resize handle)\n\t\t// whether or not it’s under the pointer.\n\t\tonPointerDown: ( { pointerId, target } ) => {\n\t\t\tif ( separatorRef.current?.parentElement.contains( target ) ) {\n\t\t\t\ttarget.setPointerCapture( pointerId );\n\t\t\t}\n\t\t},\n\t\tonResizeStart: ( { timeStamp }, direction, elementRef ) => {\n\t\t\tif ( isAutoHeight ) {\n\t\t\t\t// Sets the starting height to avoid visual jumps in height and\n\t\t\t\t// aria-valuenow being `NaN` for the first (few) resize events.\n\t\t\t\tapplyHeight( elementRef.offsetHeight, false, true );\n\t\t\t}\n\t\t\telementRef.classList.add( 'is-resizing' );\n\t\t\tresizeDataRef.current = { timeStamp, maxDelta: 0 };\n\t\t},\n\t\tonResize: ( event, direction, elementRef, delta ) => {\n\t\t\tconst { maxDelta } = resizeDataRef.current;\n\t\t\tconst newDelta = Math.abs( delta.height );\n\t\t\tresizeDataRef.current.maxDelta = Math.max( maxDelta, newDelta );\n\t\t\tapplyHeight( metaBoxesMainRef.current.state.height );\n\t\t},\n\t\tonResizeStop: ( event, direction, elementRef ) => {\n\t\t\telementRef.classList.remove( 'is-resizing' );\n\t\t\tconst duration = event.timeStamp - resizeDataRef.current.timeStamp;\n\t\t\tconst wasSeparator = event.target === separatorRef.current;\n\t\t\tconst { maxDelta } = resizeDataRef.current;\n\t\t\tconst isToggleInferred =\n\t\t\t\tmaxDelta < 1 || ( duration < 144 && maxDelta < 5 );\n\t\t\tif ( isShort || ( ! wasSeparator && isToggleInferred ) ) {\n\t\t\t\tresizeDataRef.current.isToggleInferred = true;\n\t\t\t} else {\n\t\t\t\tconst { height } = metaBoxesMainRef.current.state;\n\t\t\t\tconst nextIsOpen = height > min;\n\t\t\t\tpersistIsOpen( nextIsOpen );\n\t\t\t\t// Persists height only if still open. This is so that when closed by a drag the\n\t\t\t\t// prior height can be restored by the toggle button instead of having to drag\n\t\t\t\t// the pane open again. Also, if already closed, a click on the separator won’t\n\t\t\t\t// persist the height as the minimum.\n\t\t\t\tif ( nextIsOpen ) {\n\t\t\t\t\tapplyHeight( height, true );\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t} );\n\n\treturn (\n\t\t<ResizableBox aria-label={ paneLabel } { ...paneProps }>\n\t\t\t<meta ref={ effectSizeConstraints } />\n\t\t\t{ contents }\n\t\t</ResizableBox>\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\tenablePaddingAppender,\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 {\n\t\t\t\tgetEditorMode,\n\t\t\t\tgetRenderingMode,\n\t\t\t\tgetDefaultRenderingMode,\n\t\t\t\tgetDeviceType,\n\t\t\t} = unlock( select( editorStore ) );\n\t\t\tconst isRenderingPostOnly = getRenderingMode() === 'post-only';\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\tenablePaddingAppender:\n\t\t\t\t\t! isZoomOut() && isRenderingPostOnly && isNotDesignPostType,\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\tconst editableResolvedTemplateId = useSelect(\n\t\t( select ) => {\n\t\t\tif ( typeof templateId !== 'string' ) {\n\t\t\t\treturn templateId;\n\t\t\t}\n\t\t\treturn unlock( select( coreStore ) ).getTemplateAutoDraftId(\n\t\t\t\ttemplateId\n\t\t\t);\n\t\t},\n\t\t[ templateId ]\n\t);\n\tconst [ paddingAppenderRef, paddingStyle ] = usePaddingAppender(\n\t\tenablePaddingAppender\n\t);\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 editorSettings = useMemo(\n\t\t() => ( {\n\t\t\t...settings,\n\t\t\tonNavigateToEntityRecord,\n\t\t\tonNavigateToPreviousEntityRecord,\n\t\t\tdefaultRenderingMode: 'post-only',\n\t\t} ),\n\t\t[ settings, onNavigateToEntityRecord, onNavigateToPreviousEntityRecord ]\n\t);\n\tconst styles = useEditorStyles( paddingStyle );\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 )\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<ErrorBoundary canCopyContent>\n\t\t\t\t<WelcomeGuide postType={ currentPostType } />\n\t\t\t\t<div\n\t\t\t\t\tclassName={ navigateRegionsProps.className }\n\t\t\t\t\t{ ...navigateRegionsProps }\n\t\t\t\t\tref={ navigateRegionsProps.ref }\n\t\t\t\t>\n\t\t\t\t\t<Editor\n\t\t\t\t\t\tsettings={ editorSettings }\n\t\t\t\t\t\tinitialEdits={ initialEdits }\n\t\t\t\t\t\tpostType={ currentPostType }\n\t\t\t\t\t\tpostId={ currentPostId }\n\t\t\t\t\t\ttemplateId={ editableResolvedTemplateId }\n\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t\tstyles={ styles }\n\t\t\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\t\t\tcontentRef={ paddingAppenderRef }\n\t\t\t\t\t\tdisableIframe={ ! shouldIframe }\n\t\t\t\t\t\t// We should auto-focus the canvas (title) on load.\n\t\t\t\t\t\t// eslint-disable-next-line jsx-a11y/no-autofocus\n\t\t\t\t\t\tautoFocus={ ! isWelcomeGuideVisible }\n\t\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t\t\textraSidebarPanels={\n\t\t\t\t\t\t\tshowMetaBoxes && <MetaBoxes location=\"side\" />\n\t\t\t\t\t\t}\n\t\t\t\t\t\textraContent={\n\t\t\t\t\t\t\t! isDistractionFree &&\n\t\t\t\t\t\t\tshowMetaBoxes && (\n\t\t\t\t\t\t\t\t<MetaBoxesMain\n\t\t\t\t\t\t\t\t\tisLegacy={\n\t\t\t\t\t\t\t\t\t\t! shouldIframe || 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>\n\t\t\t\t\t\t<PostLockedModal />\n\t\t\t\t\t\t<EditorInitialization />\n\t\t\t\t\t\t<FullscreenMode isActive={ isFullscreenActive } />\n\t\t\t\t\t\t<BrowserURL />\n\t\t\t\t\t\t<UnsavedChangesWarning />\n\t\t\t\t\t\t<AutosaveMonitor />\n\t\t\t\t\t\t<LocalAutosaveMonitor />\n\t\t\t\t\t\t<EditPostKeyboardShortcuts />\n\t\t\t\t\t\t<EditorKeyboardShortcutsRegister />\n\t\t\t\t\t\t<BlockKeyboardShortcuts />\n\t\t\t\t\t\t<InitPatternModal />\n\t\t\t\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t\t\t\t\t<PostEditorMoreMenu />\n\t\t\t\t\t\t{ backButton }\n\t\t\t\t\t\t<EditorSnackbars />\n\t\t\t\t\t</Editor>\n\t\t\t\t</div>\n\t\t\t</ErrorBoundary>\n\t\t</SlotFillProvider>\n\t);\n}\n\nexport default Layout;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,OAAA,GAAAD,OAAA;AAWA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAIA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AAQA,IAAAO,MAAA,GAAAP,OAAA;AACA,IA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A,EAAC/I,OAAA,CAAAmU,+BAA+B,IAAE,CAAC,eACnC,IAAApS,WAAA,CAAAgH,GAAA,EAACtG,sBAAsB,IAAE,CAAC,eAC1B,IAAAV,WAAA,CAAAgH,GAAA,EAAC5H,iBAAA,CAAA6H,OAAgB,IAAE,CAAC,eACpB,IAAAjH,WAAA,CAAAgH,GAAA,EAAC5I,QAAA,CAAAiU,UAAU;YAACC,OAAO,EAAGxC;UAAmB,CAAE,CAAC,eAC5C,IAAA9P,WAAA,CAAAgH,GAAA,EAACzH,SAAA,CAAA0H,OAAkB,IAAE,CAAC,EACpBmK,UAAU,eACZ,IAAApR,WAAA,CAAAgH,GAAA,EAAC/I,OAAA,CAAAsU,eAAe,IAAE,CAAC;QAAA,CACZ;MAAC,CACL,CAAC;IAAA,CACQ;EAAC,CACC,CAAC;AAErB;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAxL,OAAA,GAEcwE,MAAM","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_editor","_data","_blockEditor","_plugins","_i18n","_element","_icons","_notices","_preferences","_commands","_blockLibrary","_url","_htmlEntities","_coreData","_components","_compose","_backButton","_editorInitialization","_keyboardShortcuts","_initPatternModal","_browserUrl","_metaBoxes","_moreMenu","_welcomeGuide","_store","_lockUnlock","_useCommands","_usePaddingAppender","_useShouldIframe","_useNavigateToEntityRecord","_useMetaBoxInitialization","_jsxRuntime","getLayoutStyles","unlock","blockEditorPrivateApis","useCommandContext","commandsPrivateApis","Editor","FullscreenMode","NavigableRegion","editorPrivateApis","BlockKeyboardShortcuts","blockLibraryPrivateApis","DESIGN_POST_TYPES","useEditorStyles","additionalStyles","hasThemeStyleSupport","editorSettings","useSelect","select","editPostStore","isFeatureActive","editorStore","getEditorSettings","addedStyles","join","useMemo","_editorSettings$style","_editorSettings$defau","_editorSettings$style2","_editorSettings$style3","presetStyles","styles","filter","style","__unstableType","defaultEditorStyles","hasThemeStyles","length","disableLayoutStyles","push","css","selector","hasBlockGapSupport","hasFallbackGapSupport","fallbackGapValue","baseStyles","MetaBoxesMain","isLegacy","isOpen","openHeight","hasAnyVisible","get","preferencesStore","isMetaBoxLocationVisible","set","setPreference","useDispatch","metaBoxesMainRef","useRef","isShort","useMediaQuery","min","max","setHeightConstraints","useState","effectSizeConstraints","useRefEffect","node","container","closest","noticeLists","querySelectorAll","resizeHandle","querySelector","deriveConstraints","fullHeight","offsetHeight","nextMax","element","nextMin","observer","window","ResizeObserver","observe","disconnect","resizeDataRef","separatorRef","separatorHelpId","useId","applyHeight","candidateHeight","isPersistent","isInstant","Math","current","ariaValueNow","getAriaValueNow","updateSize","height","width","getRenderValues","useEvent","useEffect","fresh","undefined","usedOpenHeight","usedHeight","contents","jsxs","className","hidden","children","jsx","default","location","isAutoHeight","round","usedAriaValueNow","persistIsOpen","to","onSeparatorKeyDown","event","delta","ArrowUp","ArrowDown","key","pane","resizable","fromHeight","nextHeight","preventDefault","paneLabel","__","toggle","onClick","detail","isToggleInferred","onMouseDown","stopPropagation","onTouchStart","Icon","icon","chevronUp","chevronDown","separator","Fragment","Tooltip","text","ref","role","onKeyDown","VisuallyHidden","id","paneProps","as","defaultSize","minHeight","maxHeight","enable","top","handleClasses","handleComponent","onPointerDown","pointerId","target","parentElement","contains","setPointerCapture","onResizeStart","timeStamp","direction","elementRef","classList","add","maxDelta","onResize","newDelta","abs","state","onResizeStop","remove","duration","wasSeparator","nextIsOpen","ResizableBox","Layout","postId","initialPostId","postType","initialPostType","settings","initialEdits","useEditPostCommands","shouldIframe","useShouldIframe","createErrorNotice","noticesStore","currentPost","currentPostId","currentPostType","onNavigateToEntityRecord","onNavigateToPreviousEntityRecord","useNavigateToEntityRecord","isEditingTemplate","mode","isFullscreenActive","hasResolvedMode","hasActiveMetaboxes","hasBlockSelected","showIconLabels","isDistractionFree","showMetaBoxes","isWelcomeGuideVisible","templateId","enablePaddingAppender","isDevicePreview","_getPostType$viewable","hasMetaBoxes","canUser","getPostType","getTemplateId","coreStore","supportsTemplateMode","isViewable","viewable","canViewTemplate","kind","name","getBlockSelectionStart","isZoomOut","blockEditorStore","getEditorMode","getRenderingMode","getDefaultRenderingMode","getDeviceType","isRenderingPostOnly","isNotDesignPostType","includes","isDirectlyEditingPattern","_templateId","defaultMode","useMetaBoxInitialization","editableResolvedTemplateId","getTemplateAutoDraftId","paddingAppenderRef","paddingStyle","usePaddingAppender","commandContext","defaultRenderingMode","document","body","navigateRegionsProps","useNavigateRegions","clsx","onPluginAreaError","sprintf","createSuccessNotice","onActionPerformed","useCallback","actionId","items","href","addQueryArgs","trashed","post_type","type","ids","newItem","title","rendered","decodeEntities","actions","label","post","action","initialPost","backButton","useViewportMatch","SlotFillProvider","ErrorBoundary","canCopyContent","forceIsDirty","contentRef","disableIframe","autoFocus","extraSidebarPanels","extraContent","PostLockedModal","isActive","UnsavedChangesWarning","AutosaveMonitor","LocalAutosaveMonitor","EditorKeyboardShortcutsRegister","PluginArea","onError","EditorSnackbars","_default","exports"],"sources":["@wordpress/edit-post/src/components/layout/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAutosaveMonitor,\n\tLocalAutosaveMonitor,\n\tUnsavedChangesWarning,\n\tEditorKeyboardShortcutsRegister,\n\tEditorSnackbars,\n\tErrorBoundary,\n\tPostLockedModal,\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { PluginArea } from '@wordpress/plugins';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tuseCallback,\n\tuseEffect,\n\tuseMemo,\n\tuseId,\n\tuseRef,\n\tuseState,\n} from '@wordpress/element';\nimport { chevronDown, chevronUp } from '@wordpress/icons';\nimport { 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,\n\tResizableBox,\n\tSlotFillProvider,\n\tTooltip,\n\tVisuallyHidden,\n\t__unstableUseNavigateRegions as useNavigateRegions,\n} from '@wordpress/components';\nimport {\n\tuseEvent,\n\tuseMediaQuery,\n\tuseRefEffect,\n\tuseViewportMatch,\n} from '@wordpress/compose';\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 { usePaddingAppender } from './use-padding-appender';\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 { getLayoutStyles } = unlock( blockEditorPrivateApis );\nconst { useCommandContext } = unlock( commandsPrivateApis );\nconst { Editor, FullscreenMode, NavigableRegion } = unlock( 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\t'wp_registered_template',\n];\n\nfunction useEditorStyles( ...additionalStyles ) {\n\tconst { hasThemeStyleSupport, editorSettings } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\thasThemeStyleSupport:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'themeStyles' ),\n\t\t\teditorSettings: select( editorStore ).getEditorSettings(),\n\t\t};\n\t}, [] );\n\n\tconst addedStyles = additionalStyles.join( '\\n' );\n\n\t// Compute the default styles.\n\treturn useMemo( () => {\n\t\tconst presetStyles =\n\t\t\teditorSettings.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...( editorSettings?.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 !== ( editorSettings.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 ( ! editorSettings.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\tconst baseStyles = hasThemeStyles\n\t\t\t? editorSettings.styles ?? []\n\t\t\t: defaultEditorStyles;\n\n\t\tif ( addedStyles ) {\n\t\t\treturn [ ...baseStyles, { css: addedStyles } ];\n\t\t}\n\n\t\treturn baseStyles;\n\t}, [\n\t\teditorSettings.defaultEditorStyles,\n\t\teditorSettings.disableLayoutStyles,\n\t\teditorSettings.styles,\n\t\thasThemeStyleSupport,\n\t\taddedStyles,\n\t] );\n}\n\n/**\n * @param {Object} props\n * @param {boolean} props.isLegacy True when the editor canvas is not in an iframe.\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\tconst metaBoxesMainRef = useRef();\n\tconst isShort = useMediaQuery( '(max-height: 549px)' );\n\n\tconst [ { min, 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 noticeLists = container.querySelectorAll(\n\t\t\t':scope > .components-notice-list'\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\tfor ( const element of noticeLists ) {\n\t\t\t\tnextMax -= element.offsetHeight;\n\t\t\t}\n\t\t\tconst nextMin = resizeHandle.offsetHeight;\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\tfor ( const element of noticeLists ) {\n\t\t\tobserver.observe( element );\n\t\t}\n\t\treturn () => observer.disconnect();\n\t}, [] );\n\n\tconst resizeDataRef = useRef( {} );\n\tconst separatorRef = useRef();\n\tconst separatorHelpId = useId();\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 * @param {boolean} isInstant Whether to update the height in the DOM.\n\t */\n\tconst applyHeight = (\n\t\tcandidateHeight = 'auto',\n\t\tisPersistent,\n\t\tisInstant\n\t) => {\n\t\tif ( candidateHeight === 'auto' ) {\n\t\t\tisPersistent = false; // Just in case — “auto” should never persist.\n\t\t} else {\n\t\t\tcandidateHeight = Math.min( max, Math.max( min, candidateHeight ) );\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// Updates aria-valuenow only when not persisting the value because otherwise\n\t\t// it's done by the render that persisting the value causes.\n\t\telse if ( ! isShort ) {\n\t\t\tseparatorRef.current.ariaValueNow =\n\t\t\t\tgetAriaValueNow( candidateHeight );\n\t\t}\n\t\tif ( isInstant ) {\n\t\t\tmetaBoxesMainRef.current.updateSize( {\n\t\t\t\theight: candidateHeight,\n\t\t\t\t// Oddly, when the event that triggered this was not from the mouse (e.g. keydown),\n\t\t\t\t// if `width` is left unspecified a subsequent drag gesture applies a fixed\n\t\t\t\t// width and the pane fails to widen/narrow with parent width changes from\n\t\t\t\t// sidebars opening/closing or window resizes.\n\t\t\t\twidth: 'auto',\n\t\t\t} );\n\t\t}\n\t};\n\tconst getRenderValues = useEvent( () => ( { isOpen, openHeight, min } ) );\n\t// Sets the height to 'auto' when not resizable (isShort) and to the\n\t// preferred height when resizable.\n\tuseEffect( () => {\n\t\tconst fresh = getRenderValues();\n\t\t// Tests for `min` having a value to skip the first render.\n\t\tif ( fresh.min !== undefined && metaBoxesMainRef.current ) {\n\t\t\tconst usedOpenHeight = isShort ? 'auto' : fresh.openHeight;\n\t\t\tconst usedHeight = fresh.isOpen ? usedOpenHeight : fresh.min;\n\t\t\tapplyHeight( usedHeight, false, true );\n\t\t}\n\t}, [ isShort ] );\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={ ! 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 getAriaValueNow = ( height ) =>\n\t\tMath.round( ( ( height - min ) / ( max - min ) ) * 100 );\n\tconst usedAriaValueNow =\n\t\tmax === undefined || isAutoHeight ? 50 : getAriaValueNow( openHeight );\n\n\tconst persistIsOpen = ( to = ! isOpen ) =>\n\t\tsetPreference( 'core/edit-post', 'metaBoxesMainIsOpen', to );\n\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 onSeparatorKeyDown = ( event ) => {\n\t\tconst delta = { ArrowUp: 20, ArrowDown: -20 }[ event.key ];\n\t\tif ( delta ) {\n\t\t\tconst pane = metaBoxesMainRef.current.resizable;\n\t\t\tconst fromHeight = isAutoHeight ? pane.offsetHeight : openHeight;\n\t\t\tconst nextHeight = delta + fromHeight;\n\t\t\tapplyHeight( nextHeight, true, true );\n\t\t\tpersistIsOpen( nextHeight > min );\n\t\t\tevent.preventDefault();\n\t\t}\n\t};\n\tconst paneLabel = __( 'Meta Boxes' );\n\n\tconst toggle = (\n\t\t<button\n\t\t\taria-expanded={ isOpen }\n\t\t\tonClick={ ( { detail } ) => {\n\t\t\t\tconst { isToggleInferred } = resizeDataRef.current;\n\t\t\t\tif ( isShort || ! detail || isToggleInferred ) {\n\t\t\t\t\tpersistIsOpen();\n\t\t\t\t\tconst usedOpenHeight = isShort ? 'auto' : openHeight;\n\t\t\t\t\tconst usedHeight = isOpen ? min : usedOpenHeight;\n\t\t\t\t\tapplyHeight( usedHeight, false, true );\n\t\t\t\t}\n\t\t\t} }\n\t\t\t// Prevents resizing in short viewports.\n\t\t\t{ ...( isShort && {\n\t\t\t\tonMouseDown: ( event ) => event.stopPropagation(),\n\t\t\t\tonTouchStart: ( event ) => event.stopPropagation(),\n\t\t\t} ) }\n\t\t>\n\t\t\t{ paneLabel }\n\t\t\t<Icon icon={ isOpen ? chevronUp : chevronDown } />\n\t\t</button>\n\t);\n\n\tconst separator = ! isShort && (\n\t\t<>\n\t\t\t<Tooltip text={ __( 'Drag to resize' ) }>\n\t\t\t\t<button // eslint-disable-line jsx-a11y/role-supports-aria-props\n\t\t\t\t\tref={ separatorRef }\n\t\t\t\t\trole=\"separator\" // eslint-disable-line jsx-a11y/no-interactive-element-to-noninteractive-role\n\t\t\t\t\taria-valuenow={ usedAriaValueNow }\n\t\t\t\t\taria-label={ __( 'Drag to resize' ) }\n\t\t\t\t\taria-describedby={ separatorHelpId }\n\t\t\t\t\tonKeyDown={ onSeparatorKeyDown }\n\t\t\t\t/>\n\t\t\t</Tooltip>\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 panel.'\n\t\t\t\t) }\n\t\t\t</VisuallyHidden>\n\t\t</>\n\t);\n\n\tconst paneProps = /** @type {Parameters<typeof ResizableBox>[0]} */ ( {\n\t\tas: NavigableRegion,\n\t\tref: metaBoxesMainRef,\n\t\tclassName: 'edit-post-meta-boxes-main',\n\t\tdefaultSize: { height: isOpen ? openHeight : 0 },\n\t\tminHeight: min,\n\t\tmaxHeight: max,\n\t\tenable: { top: true },\n\t\thandleClasses: { top: 'edit-post-meta-boxes-main__presenter' },\n\t\thandleComponent: {\n\t\t\ttop: (\n\t\t\t\t<>\n\t\t\t\t\t{ toggle }\n\t\t\t\t\t{ separator }\n\t\t\t\t</>\n\t\t\t),\n\t\t},\n\t\t// Avoids hiccups while dragging over objects like iframes and ensures that\n\t\t// the event to end the drag is captured by the target (resize handle)\n\t\t// whether or not it’s under the pointer.\n\t\tonPointerDown: ( { pointerId, target } ) => {\n\t\t\tif ( separatorRef.current?.parentElement.contains( target ) ) {\n\t\t\t\ttarget.setPointerCapture( pointerId );\n\t\t\t}\n\t\t},\n\t\tonResizeStart: ( { timeStamp }, direction, elementRef ) => {\n\t\t\tif ( isAutoHeight ) {\n\t\t\t\t// Sets the starting height to avoid visual jumps in height and\n\t\t\t\t// aria-valuenow being `NaN` for the first (few) resize events.\n\t\t\t\tapplyHeight( elementRef.offsetHeight, false, true );\n\t\t\t}\n\t\t\telementRef.classList.add( 'is-resizing' );\n\t\t\tresizeDataRef.current = { timeStamp, maxDelta: 0 };\n\t\t},\n\t\tonResize: ( event, direction, elementRef, delta ) => {\n\t\t\tconst { maxDelta } = resizeDataRef.current;\n\t\t\tconst newDelta = Math.abs( delta.height );\n\t\t\tresizeDataRef.current.maxDelta = Math.max( maxDelta, newDelta );\n\t\t\tapplyHeight( metaBoxesMainRef.current.state.height );\n\t\t},\n\t\tonResizeStop: ( event, direction, elementRef ) => {\n\t\t\telementRef.classList.remove( 'is-resizing' );\n\t\t\tconst duration = event.timeStamp - resizeDataRef.current.timeStamp;\n\t\t\tconst wasSeparator = event.target === separatorRef.current;\n\t\t\tconst { maxDelta } = resizeDataRef.current;\n\t\t\tconst isToggleInferred =\n\t\t\t\tmaxDelta < 1 || ( duration < 144 && maxDelta < 5 );\n\t\t\tif ( isShort || ( ! wasSeparator && isToggleInferred ) ) {\n\t\t\t\tresizeDataRef.current.isToggleInferred = true;\n\t\t\t} else {\n\t\t\t\tconst { height } = metaBoxesMainRef.current.state;\n\t\t\t\tconst nextIsOpen = height > min;\n\t\t\t\tpersistIsOpen( nextIsOpen );\n\t\t\t\t// Persists height only if still open. This is so that when closed by a drag the\n\t\t\t\t// prior height can be restored by the toggle button instead of having to drag\n\t\t\t\t// the pane open again. Also, if already closed, a click on the separator won’t\n\t\t\t\t// persist the height as the minimum.\n\t\t\t\tif ( nextIsOpen ) {\n\t\t\t\t\tapplyHeight( height, true );\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t} );\n\n\treturn (\n\t\t<ResizableBox aria-label={ paneLabel } { ...paneProps }>\n\t\t\t<meta ref={ effectSizeConstraints } />\n\t\t\t{ contents }\n\t\t</ResizableBox>\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\tenablePaddingAppender,\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 {\n\t\t\t\tgetEditorMode,\n\t\t\t\tgetRenderingMode,\n\t\t\t\tgetDefaultRenderingMode,\n\t\t\t\tgetDeviceType,\n\t\t\t} = unlock( select( editorStore ) );\n\t\t\tconst isRenderingPostOnly = getRenderingMode() === 'post-only';\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\tenablePaddingAppender:\n\t\t\t\t\t! isZoomOut() && isRenderingPostOnly && isNotDesignPostType,\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\tconst editableResolvedTemplateId = useSelect(\n\t\t( select ) => {\n\t\t\tif ( typeof templateId !== 'string' ) {\n\t\t\t\treturn templateId;\n\t\t\t}\n\t\t\treturn unlock( select( coreStore ) ).getTemplateAutoDraftId(\n\t\t\t\ttemplateId\n\t\t\t);\n\t\t},\n\t\t[ templateId ]\n\t);\n\tconst [ paddingAppenderRef, paddingStyle ] = usePaddingAppender(\n\t\tenablePaddingAppender\n\t);\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 editorSettings = useMemo(\n\t\t() => ( {\n\t\t\t...settings,\n\t\t\tonNavigateToEntityRecord,\n\t\t\tonNavigateToPreviousEntityRecord,\n\t\t\tdefaultRenderingMode: 'post-only',\n\t\t} ),\n\t\t[ settings, onNavigateToEntityRecord, onNavigateToPreviousEntityRecord ]\n\t);\n\tconst styles = useEditorStyles( paddingStyle );\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<ErrorBoundary canCopyContent>\n\t\t\t\t<WelcomeGuide postType={ currentPostType } />\n\t\t\t\t<div\n\t\t\t\t\tclassName={ navigateRegionsProps.className }\n\t\t\t\t\t{ ...navigateRegionsProps }\n\t\t\t\t\tref={ navigateRegionsProps.ref }\n\t\t\t\t>\n\t\t\t\t\t<Editor\n\t\t\t\t\t\tsettings={ editorSettings }\n\t\t\t\t\t\tinitialEdits={ initialEdits }\n\t\t\t\t\t\tpostType={ currentPostType }\n\t\t\t\t\t\tpostId={ currentPostId }\n\t\t\t\t\t\ttemplateId={ editableResolvedTemplateId }\n\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t\tstyles={ styles }\n\t\t\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\t\t\tcontentRef={ paddingAppenderRef }\n\t\t\t\t\t\tdisableIframe={ ! shouldIframe }\n\t\t\t\t\t\t// We should auto-focus the canvas (title) on load.\n\t\t\t\t\t\t// eslint-disable-next-line jsx-a11y/no-autofocus\n\t\t\t\t\t\tautoFocus={ ! isWelcomeGuideVisible }\n\t\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t\t\textraSidebarPanels={\n\t\t\t\t\t\t\tshowMetaBoxes && <MetaBoxes location=\"side\" />\n\t\t\t\t\t\t}\n\t\t\t\t\t\textraContent={\n\t\t\t\t\t\t\t! isDistractionFree &&\n\t\t\t\t\t\t\tshowMetaBoxes && (\n\t\t\t\t\t\t\t\t<MetaBoxesMain\n\t\t\t\t\t\t\t\t\tisLegacy={\n\t\t\t\t\t\t\t\t\t\t! shouldIframe || 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>\n\t\t\t\t\t\t<PostLockedModal />\n\t\t\t\t\t\t<EditorInitialization />\n\t\t\t\t\t\t<FullscreenMode isActive={ isFullscreenActive } />\n\t\t\t\t\t\t<BrowserURL />\n\t\t\t\t\t\t<UnsavedChangesWarning />\n\t\t\t\t\t\t<AutosaveMonitor />\n\t\t\t\t\t\t<LocalAutosaveMonitor />\n\t\t\t\t\t\t<EditPostKeyboardShortcuts />\n\t\t\t\t\t\t<EditorKeyboardShortcutsRegister />\n\t\t\t\t\t\t<BlockKeyboardShortcuts />\n\t\t\t\t\t\t<InitPatternModal />\n\t\t\t\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t\t\t\t\t<PostEditorMoreMenu />\n\t\t\t\t\t\t{ backButton }\n\t\t\t\t\t\t<EditorSnackbars />\n\t\t\t\t\t</Editor>\n\t\t\t\t</div>\n\t\t\t</ErrorBoundary>\n\t\t</SlotFillProvider>\n\t);\n}\n\nexport default Layout;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,OAAA,GAAAD,OAAA;AAWA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAIA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,QAAA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AA,CAAAgH,GAAA,EAAC7H,kBAAA,CAAA8H,OAAyB,IAAE,CAAC,eAC7B,IAAAjH,WAAA,CAAAgH,GAAA,EAAC/I,OAAA,CAAAmU,+BAA+B,IAAE,CAAC,eACnC,IAAApS,WAAA,CAAAgH,GAAA,EAACtG,sBAAsB,IAAE,CAAC,eAC1B,IAAAV,WAAA,CAAAgH,GAAA,EAAC5H,iBAAA,CAAA6H,OAAgB,IAAE,CAAC,eACpB,IAAAjH,WAAA,CAAAgH,GAAA,EAAC5I,QAAA,CAAAiU,UAAU;YAACC,OAAO,EAAGxC;UAAmB,CAAE,CAAC,eAC5C,IAAA9P,WAAA,CAAAgH,GAAA,EAACzH,SAAA,CAAA0H,OAAkB,IAAE,CAAC,EACpBmK,UAAU,eACZ,IAAApR,WAAA,CAAAgH,GAAA,EAAC/I,OAAA,CAAAsU,eAAe,IAAE,CAAC;QAAA,CACZ;MAAC,CACL,CAAC;IAAA,CACQ;EAAC,CACC,CAAC;AAErB;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAxL,OAAA,GAEcwE,MAAM","ignoreList":[]}
|
|
@@ -10,11 +10,33 @@ import { useSelect } from '@wordpress/data';
|
|
|
10
10
|
import { Button, Icon, __unstableMotion as motion } from '@wordpress/components';
|
|
11
11
|
import { __ } from '@wordpress/i18n';
|
|
12
12
|
import { addQueryArgs } from '@wordpress/url';
|
|
13
|
-
import { wordpress } from '@wordpress/icons';
|
|
13
|
+
import { wordpress, arrowUpLeft } from '@wordpress/icons';
|
|
14
14
|
import { store as editorStore } from '@wordpress/editor';
|
|
15
15
|
import { store as coreStore } from '@wordpress/core-data';
|
|
16
16
|
import { useReducedMotion } from '@wordpress/compose';
|
|
17
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
|
+
const siteIconVariants = {
|
|
19
|
+
edit: {
|
|
20
|
+
clipPath: 'inset(0% round 0px)'
|
|
21
|
+
},
|
|
22
|
+
hover: {
|
|
23
|
+
clipPath: 'inset( 22% round 2px )'
|
|
24
|
+
},
|
|
25
|
+
tap: {
|
|
26
|
+
clipPath: 'inset(0% round 0px)'
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
const toggleHomeIconVariants = {
|
|
30
|
+
edit: {
|
|
31
|
+
opacity: 0,
|
|
32
|
+
scale: 0.2
|
|
33
|
+
},
|
|
34
|
+
hover: {
|
|
35
|
+
opacity: 1,
|
|
36
|
+
scale: 1,
|
|
37
|
+
clipPath: 'inset( 22% round 2px )'
|
|
38
|
+
}
|
|
39
|
+
};
|
|
18
40
|
function FullscreenModeClose({
|
|
19
41
|
showTooltip,
|
|
20
42
|
icon,
|
|
@@ -42,43 +64,43 @@ function FullscreenModeClose({
|
|
|
42
64
|
postType: getPostType(_postType),
|
|
43
65
|
siteIconUrl: siteData.site_icon_url
|
|
44
66
|
};
|
|
45
|
-
}, []);
|
|
67
|
+
}, [initialPost?.type]);
|
|
46
68
|
const disableMotion = useReducedMotion();
|
|
69
|
+
const transition = {
|
|
70
|
+
duration: disableMotion ? 0 : 0.2
|
|
71
|
+
};
|
|
47
72
|
if (!postType) {
|
|
48
73
|
return null;
|
|
49
74
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
if (siteIconUrl) {
|
|
64
|
-
buttonIcon = /*#__PURE__*/_jsx(motion.img, {
|
|
65
|
-
variants: !disableMotion && effect,
|
|
75
|
+
|
|
76
|
+
// Create SiteIcon equivalent structure exactly like edit-site
|
|
77
|
+
let siteIconContent;
|
|
78
|
+
if (isRequestingSiteIcon && !siteIconUrl) {
|
|
79
|
+
siteIconContent = /*#__PURE__*/_jsx("div", {
|
|
80
|
+
className: "edit-post-fullscreen-mode-close-site-icon__image"
|
|
81
|
+
});
|
|
82
|
+
} else if (siteIconUrl) {
|
|
83
|
+
siteIconContent = /*#__PURE__*/_jsx("img", {
|
|
84
|
+
className: "edit-post-fullscreen-mode-close-site-icon__image",
|
|
66
85
|
alt: __('Site Icon'),
|
|
67
|
-
className: "edit-post-fullscreen-mode-close_site-icon",
|
|
68
86
|
src: siteIconUrl
|
|
69
87
|
});
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
|
|
88
|
+
} else {
|
|
89
|
+
siteIconContent = /*#__PURE__*/_jsx(Icon, {
|
|
90
|
+
className: "edit-post-fullscreen-mode-close-site-icon__icon",
|
|
91
|
+
icon: wordpress,
|
|
92
|
+
size: 48
|
|
93
|
+
});
|
|
73
94
|
}
|
|
74
95
|
|
|
75
96
|
// Override default icon if custom icon is provided via props.
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
97
|
+
const buttonIcon = icon ? /*#__PURE__*/_jsx(Icon, {
|
|
98
|
+
size: "36px",
|
|
99
|
+
icon: icon
|
|
100
|
+
}) : /*#__PURE__*/_jsx("div", {
|
|
101
|
+
className: "edit-post-fullscreen-mode-close-site-icon",
|
|
102
|
+
children: siteIconContent
|
|
103
|
+
});
|
|
82
104
|
const classes = clsx('edit-post-fullscreen-mode-close', {
|
|
83
105
|
'has-icon': siteIconUrl
|
|
84
106
|
});
|
|
@@ -86,16 +108,36 @@ function FullscreenModeClose({
|
|
|
86
108
|
post_type: postType.slug
|
|
87
109
|
});
|
|
88
110
|
const buttonLabel = (_postType$labels$view = postType?.labels?.view_items) !== null && _postType$labels$view !== void 0 ? _postType$labels$view : __('Back');
|
|
89
|
-
return /*#__PURE__*/
|
|
90
|
-
|
|
91
|
-
|
|
111
|
+
return /*#__PURE__*/_jsxs(motion.div, {
|
|
112
|
+
className: "edit-post-fullscreen-mode-close__view-mode-toggle",
|
|
113
|
+
animate: "edit",
|
|
114
|
+
initial: "edit",
|
|
115
|
+
whileHover: "hover",
|
|
116
|
+
whileTap: "tap",
|
|
117
|
+
transition: transition,
|
|
118
|
+
children: [/*#__PURE__*/_jsx(Button, {
|
|
92
119
|
__next40pxDefaultSize: true,
|
|
93
120
|
className: classes,
|
|
94
121
|
href: buttonHref,
|
|
95
122
|
label: buttonLabel,
|
|
96
123
|
showTooltip: showTooltip,
|
|
97
|
-
|
|
98
|
-
|
|
124
|
+
tooltipPosition: "middle right",
|
|
125
|
+
children: /*#__PURE__*/_jsx(motion.div, {
|
|
126
|
+
variants: !disableMotion && siteIconVariants,
|
|
127
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
128
|
+
className: "edit-post-fullscreen-mode-close__view-mode-toggle-icon",
|
|
129
|
+
children: buttonIcon
|
|
130
|
+
})
|
|
131
|
+
})
|
|
132
|
+
}), /*#__PURE__*/_jsx(motion.div, {
|
|
133
|
+
className: clsx('edit-post-fullscreen-mode-close__back-icon', {
|
|
134
|
+
'has-site-icon': siteIconUrl
|
|
135
|
+
}),
|
|
136
|
+
variants: !disableMotion && toggleHomeIconVariants,
|
|
137
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
138
|
+
icon: arrowUpLeft
|
|
139
|
+
})
|
|
140
|
+
})]
|
|
99
141
|
});
|
|
100
142
|
}
|
|
101
143
|
export default FullscreenModeClose;
|