changeset 22 | 8c2e4d02f4ef |
parent 21 | 48c4eec2b7e6 |
21:48c4eec2b7e6 | 22:8c2e4d02f4ef |
---|---|
93 switchEditorMode: () => (switchEditorMode), |
93 switchEditorMode: () => (switchEditorMode), |
94 toggleDistractionFree: () => (toggleDistractionFree), |
94 toggleDistractionFree: () => (toggleDistractionFree), |
95 toggleEditorPanelEnabled: () => (toggleEditorPanelEnabled), |
95 toggleEditorPanelEnabled: () => (toggleEditorPanelEnabled), |
96 toggleEditorPanelOpened: () => (toggleEditorPanelOpened), |
96 toggleEditorPanelOpened: () => (toggleEditorPanelOpened), |
97 toggleFeature: () => (toggleFeature), |
97 toggleFeature: () => (toggleFeature), |
98 toggleFullscreenMode: () => (toggleFullscreenMode), |
|
98 togglePinnedPluginItem: () => (togglePinnedPluginItem), |
99 togglePinnedPluginItem: () => (togglePinnedPluginItem), |
99 togglePublishSidebar: () => (togglePublishSidebar), |
100 togglePublishSidebar: () => (togglePublishSidebar), |
100 updatePreferredStyleVariations: () => (updatePreferredStyleVariations) |
101 updatePreferredStyleVariations: () => (updatePreferredStyleVariations) |
101 }); |
102 }); |
102 |
103 |
132 isPluginSidebarOpened: () => (isPluginSidebarOpened), |
133 isPluginSidebarOpened: () => (isPluginSidebarOpened), |
133 isPublishSidebarOpened: () => (isPublishSidebarOpened), |
134 isPublishSidebarOpened: () => (isPublishSidebarOpened), |
134 isSavingMetaBoxes: () => (selectors_isSavingMetaBoxes) |
135 isSavingMetaBoxes: () => (selectors_isSavingMetaBoxes) |
135 }); |
136 }); |
136 |
137 |
137 ;// CONCATENATED MODULE: external ["wp","blocks"] |
138 ;// external ["wp","blocks"] |
138 const external_wp_blocks_namespaceObject = window["wp"]["blocks"]; |
139 const external_wp_blocks_namespaceObject = window["wp"]["blocks"]; |
139 ;// CONCATENATED MODULE: external ["wp","blockLibrary"] |
140 ;// external ["wp","blockLibrary"] |
140 const external_wp_blockLibrary_namespaceObject = window["wp"]["blockLibrary"]; |
141 const external_wp_blockLibrary_namespaceObject = window["wp"]["blockLibrary"]; |
141 ;// CONCATENATED MODULE: external ["wp","deprecated"] |
142 ;// external ["wp","deprecated"] |
142 const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"]; |
143 const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"]; |
143 var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject); |
144 var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject); |
144 ;// CONCATENATED MODULE: external ["wp","element"] |
145 ;// external ["wp","element"] |
145 const external_wp_element_namespaceObject = window["wp"]["element"]; |
146 const external_wp_element_namespaceObject = window["wp"]["element"]; |
146 ;// CONCATENATED MODULE: external ["wp","data"] |
147 ;// external ["wp","data"] |
147 const external_wp_data_namespaceObject = window["wp"]["data"]; |
148 const external_wp_data_namespaceObject = window["wp"]["data"]; |
148 ;// CONCATENATED MODULE: external ["wp","preferences"] |
149 ;// external ["wp","preferences"] |
149 const external_wp_preferences_namespaceObject = window["wp"]["preferences"]; |
150 const external_wp_preferences_namespaceObject = window["wp"]["preferences"]; |
150 ;// CONCATENATED MODULE: external ["wp","widgets"] |
151 ;// external ["wp","widgets"] |
151 const external_wp_widgets_namespaceObject = window["wp"]["widgets"]; |
152 const external_wp_widgets_namespaceObject = window["wp"]["widgets"]; |
152 ;// CONCATENATED MODULE: external ["wp","editor"] |
153 ;// external ["wp","editor"] |
153 const external_wp_editor_namespaceObject = window["wp"]["editor"]; |
154 const external_wp_editor_namespaceObject = window["wp"]["editor"]; |
154 ;// CONCATENATED MODULE: external ["wp","components"] |
155 ;// ./node_modules/clsx/dist/clsx.mjs |
156 function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f)}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}/* harmony default export */ const dist_clsx = (clsx); |
|
157 ;// external ["wp","blockEditor"] |
|
158 const external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"]; |
|
159 ;// external ["wp","plugins"] |
|
160 const external_wp_plugins_namespaceObject = window["wp"]["plugins"]; |
|
161 ;// external ["wp","i18n"] |
|
162 const external_wp_i18n_namespaceObject = window["wp"]["i18n"]; |
|
163 ;// external ["wp","primitives"] |
|
164 const external_wp_primitives_namespaceObject = window["wp"]["primitives"]; |
|
165 ;// external "ReactJSXRuntime" |
|
166 const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"]; |
|
167 ;// ./node_modules/@wordpress/icons/build-module/library/chevron-up.js |
|
168 /** |
|
169 * WordPress dependencies |
|
170 */ |
|
171 |
|
172 |
|
173 const chevronUp = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { |
|
174 viewBox: "0 0 24 24", |
|
175 xmlns: "http://www.w3.org/2000/svg", |
|
176 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { |
|
177 d: "M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z" |
|
178 }) |
|
179 }); |
|
180 /* harmony default export */ const chevron_up = (chevronUp); |
|
181 |
|
182 ;// ./node_modules/@wordpress/icons/build-module/library/chevron-down.js |
|
183 /** |
|
184 * WordPress dependencies |
|
185 */ |
|
186 |
|
187 |
|
188 const chevronDown = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { |
|
189 viewBox: "0 0 24 24", |
|
190 xmlns: "http://www.w3.org/2000/svg", |
|
191 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { |
|
192 d: "M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z" |
|
193 }) |
|
194 }); |
|
195 /* harmony default export */ const chevron_down = (chevronDown); |
|
196 |
|
197 ;// external ["wp","notices"] |
|
198 const external_wp_notices_namespaceObject = window["wp"]["notices"]; |
|
199 ;// external ["wp","commands"] |
|
200 const external_wp_commands_namespaceObject = window["wp"]["commands"]; |
|
201 ;// external ["wp","coreCommands"] |
|
202 const external_wp_coreCommands_namespaceObject = window["wp"]["coreCommands"]; |
|
203 ;// external ["wp","url"] |
|
204 const external_wp_url_namespaceObject = window["wp"]["url"]; |
|
205 ;// external ["wp","htmlEntities"] |
|
206 const external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"]; |
|
207 ;// external ["wp","coreData"] |
|
208 const external_wp_coreData_namespaceObject = window["wp"]["coreData"]; |
|
209 ;// external ["wp","components"] |
|
155 const external_wp_components_namespaceObject = window["wp"]["components"]; |
210 const external_wp_components_namespaceObject = window["wp"]["components"]; |
156 ;// CONCATENATED MODULE: external ["wp","coreData"] |
211 ;// external ["wp","compose"] |
157 const external_wp_coreData_namespaceObject = window["wp"]["coreData"]; |
212 const external_wp_compose_namespaceObject = window["wp"]["compose"]; |
158 ;// CONCATENATED MODULE: external ["wp","commands"] |
213 ;// ./node_modules/@wordpress/icons/build-module/library/wordpress.js |
159 const external_wp_commands_namespaceObject = window["wp"]["commands"]; |
|
160 ;// CONCATENATED MODULE: ./node_modules/clsx/dist/clsx.mjs |
|
161 function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f)}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}/* harmony default export */ const dist_clsx = (clsx); |
|
162 ;// CONCATENATED MODULE: external ["wp","blockEditor"] |
|
163 const external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"]; |
|
164 ;// CONCATENATED MODULE: external ["wp","plugins"] |
|
165 const external_wp_plugins_namespaceObject = window["wp"]["plugins"]; |
|
166 ;// CONCATENATED MODULE: external ["wp","i18n"] |
|
167 const external_wp_i18n_namespaceObject = window["wp"]["i18n"]; |
|
168 ;// CONCATENATED MODULE: external ["wp","notices"] |
|
169 const external_wp_notices_namespaceObject = window["wp"]["notices"]; |
|
170 ;// CONCATENATED MODULE: external ["wp","coreCommands"] |
|
171 const external_wp_coreCommands_namespaceObject = window["wp"]["coreCommands"]; |
|
172 ;// CONCATENATED MODULE: external ["wp","url"] |
|
173 const external_wp_url_namespaceObject = window["wp"]["url"]; |
|
174 ;// CONCATENATED MODULE: external ["wp","htmlEntities"] |
|
175 const external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"]; |
|
176 ;// CONCATENATED MODULE: external ["wp","primitives"] |
|
177 const external_wp_primitives_namespaceObject = window["wp"]["primitives"]; |
|
178 ;// CONCATENATED MODULE: external "ReactJSXRuntime" |
|
179 const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"]; |
|
180 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/wordpress.js |
|
181 /** |
214 /** |
182 * WordPress dependencies |
215 * WordPress dependencies |
183 */ |
216 */ |
184 |
217 |
185 |
218 |
190 d: "M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z" |
223 d: "M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z" |
191 }) |
224 }) |
192 }); |
225 }); |
193 /* harmony default export */ const library_wordpress = (wordpress); |
226 /* harmony default export */ const library_wordpress = (wordpress); |
194 |
227 |
195 ;// CONCATENATED MODULE: external ["wp","compose"] |
228 ;// ./node_modules/@wordpress/edit-post/build-module/components/back-button/fullscreen-mode-close.js |
196 const external_wp_compose_namespaceObject = window["wp"]["compose"]; |
229 /** |
197 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/store/reducer.js |
230 * External dependencies |
231 */ |
|
232 |
|
233 |
|
234 /** |
|
235 * WordPress dependencies |
|
236 */ |
|
237 |
|
238 |
|
239 |
|
240 |
|
241 |
|
242 |
|
243 |
|
244 |
|
245 |
|
246 function FullscreenModeClose({ |
|
247 showTooltip, |
|
248 icon, |
|
249 href, |
|
250 initialPost |
|
251 }) { |
|
252 var _postType$labels$view; |
|
253 const { |
|
254 isRequestingSiteIcon, |
|
255 postType, |
|
256 siteIconUrl |
|
257 } = (0,external_wp_data_namespaceObject.useSelect)(select => { |
|
258 const { |
|
259 getCurrentPostType |
|
260 } = select(external_wp_editor_namespaceObject.store); |
|
261 const { |
|
262 getEntityRecord, |
|
263 getPostType, |
|
264 isResolving |
|
265 } = select(external_wp_coreData_namespaceObject.store); |
|
266 const siteData = getEntityRecord('root', '__unstableBase', undefined) || {}; |
|
267 const _postType = initialPost?.type || getCurrentPostType(); |
|
268 return { |
|
269 isRequestingSiteIcon: isResolving('getEntityRecord', ['root', '__unstableBase', undefined]), |
|
270 postType: getPostType(_postType), |
|
271 siteIconUrl: siteData.site_icon_url |
|
272 }; |
|
273 }, []); |
|
274 const disableMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)(); |
|
275 if (!postType) { |
|
276 return null; |
|
277 } |
|
278 let buttonIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { |
|
279 size: "36px", |
|
280 icon: library_wordpress |
|
281 }); |
|
282 const effect = { |
|
283 expand: { |
|
284 scale: 1.25, |
|
285 transition: { |
|
286 type: 'tween', |
|
287 duration: '0.3' |
|
288 } |
|
289 } |
|
290 }; |
|
291 if (siteIconUrl) { |
|
292 buttonIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableMotion.img, { |
|
293 variants: !disableMotion && effect, |
|
294 alt: (0,external_wp_i18n_namespaceObject.__)('Site Icon'), |
|
295 className: "edit-post-fullscreen-mode-close_site-icon", |
|
296 src: siteIconUrl |
|
297 }); |
|
298 } |
|
299 if (isRequestingSiteIcon) { |
|
300 buttonIcon = null; |
|
301 } |
|
302 |
|
303 // Override default icon if custom icon is provided via props. |
|
304 if (icon) { |
|
305 buttonIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { |
|
306 size: "36px", |
|
307 icon: icon |
|
308 }); |
|
309 } |
|
310 const classes = dist_clsx('edit-post-fullscreen-mode-close', { |
|
311 'has-icon': siteIconUrl |
|
312 }); |
|
313 const buttonHref = href !== null && href !== void 0 ? href : (0,external_wp_url_namespaceObject.addQueryArgs)('edit.php', { |
|
314 post_type: postType.slug |
|
315 }); |
|
316 const buttonLabel = (_postType$labels$view = postType?.labels?.view_items) !== null && _postType$labels$view !== void 0 ? _postType$labels$view : (0,external_wp_i18n_namespaceObject.__)('Back'); |
|
317 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableMotion.div, { |
|
318 whileHover: "expand", |
|
319 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { |
|
320 __next40pxDefaultSize: true, |
|
321 className: classes, |
|
322 href: buttonHref, |
|
323 label: buttonLabel, |
|
324 showTooltip: showTooltip, |
|
325 children: buttonIcon |
|
326 }) |
|
327 }); |
|
328 } |
|
329 /* harmony default export */ const fullscreen_mode_close = (FullscreenModeClose); |
|
330 |
|
331 ;// external ["wp","privateApis"] |
|
332 const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"]; |
|
333 ;// ./node_modules/@wordpress/edit-post/build-module/lock-unlock.js |
|
334 /** |
|
335 * WordPress dependencies |
|
336 */ |
|
337 |
|
338 const { |
|
339 lock, |
|
340 unlock |
|
341 } = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/edit-post'); |
|
342 |
|
343 ;// ./node_modules/@wordpress/edit-post/build-module/components/back-button/index.js |
|
344 /** |
|
345 * WordPress dependencies |
|
346 */ |
|
347 |
|
348 |
|
349 |
|
350 /** |
|
351 * Internal dependencies |
|
352 */ |
|
353 |
|
354 |
|
355 |
|
356 const { |
|
357 BackButton: BackButtonFill |
|
358 } = unlock(external_wp_editor_namespaceObject.privateApis); |
|
359 const slideX = { |
|
360 hidden: { |
|
361 x: '-100%' |
|
362 }, |
|
363 distractionFreeInactive: { |
|
364 x: 0 |
|
365 }, |
|
366 hover: { |
|
367 x: 0, |
|
368 transition: { |
|
369 type: 'tween', |
|
370 delay: 0.2 |
|
371 } |
|
372 } |
|
373 }; |
|
374 function BackButton({ |
|
375 initialPost |
|
376 }) { |
|
377 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BackButtonFill, { |
|
378 children: ({ |
|
379 length |
|
380 }) => length <= 1 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableMotion.div, { |
|
381 variants: slideX, |
|
382 transition: { |
|
383 type: 'tween', |
|
384 delay: 0.8 |
|
385 }, |
|
386 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(fullscreen_mode_close, { |
|
387 showTooltip: true, |
|
388 initialPost: initialPost |
|
389 }) |
|
390 }) |
|
391 }); |
|
392 } |
|
393 /* harmony default export */ const back_button = (BackButton); |
|
394 |
|
395 ;// ./node_modules/@wordpress/edit-post/build-module/store/constants.js |
|
396 /** |
|
397 * The identifier for the data store. |
|
398 * |
|
399 * @type {string} |
|
400 */ |
|
401 const STORE_NAME = 'core/edit-post'; |
|
402 |
|
403 /** |
|
404 * CSS selector string for the admin bar view post link anchor tag. |
|
405 * |
|
406 * @type {string} |
|
407 */ |
|
408 const VIEW_AS_LINK_SELECTOR = '#wp-admin-bar-view a'; |
|
409 |
|
410 /** |
|
411 * CSS selector string for the admin bar preview post link anchor tag. |
|
412 * |
|
413 * @type {string} |
|
414 */ |
|
415 const VIEW_AS_PREVIEW_LINK_SELECTOR = '#wp-admin-bar-preview a'; |
|
416 |
|
417 ;// ./node_modules/@wordpress/edit-post/build-module/components/editor-initialization/listener-hooks.js |
|
418 /** |
|
419 * WordPress dependencies |
|
420 */ |
|
421 |
|
422 |
|
423 |
|
424 |
|
425 /** |
|
426 * Internal dependencies |
|
427 */ |
|
428 |
|
429 |
|
430 /** |
|
431 * This listener hook monitors any change in permalink and updates the view |
|
432 * post link in the admin bar. |
|
433 */ |
|
434 const useUpdatePostLinkListener = () => { |
|
435 const { |
|
436 newPermalink |
|
437 } = (0,external_wp_data_namespaceObject.useSelect)(select => ({ |
|
438 newPermalink: select(external_wp_editor_namespaceObject.store).getCurrentPost().link |
|
439 }), []); |
|
440 const nodeToUpdateRef = (0,external_wp_element_namespaceObject.useRef)(); |
|
441 (0,external_wp_element_namespaceObject.useEffect)(() => { |
|
442 nodeToUpdateRef.current = document.querySelector(VIEW_AS_PREVIEW_LINK_SELECTOR) || document.querySelector(VIEW_AS_LINK_SELECTOR); |
|
443 }, []); |
|
444 (0,external_wp_element_namespaceObject.useEffect)(() => { |
|
445 if (!newPermalink || !nodeToUpdateRef.current) { |
|
446 return; |
|
447 } |
|
448 nodeToUpdateRef.current.setAttribute('href', newPermalink); |
|
449 }, [newPermalink]); |
|
450 }; |
|
451 |
|
452 ;// ./node_modules/@wordpress/edit-post/build-module/components/editor-initialization/index.js |
|
453 /** |
|
454 * Internal dependencies |
|
455 */ |
|
456 |
|
457 |
|
458 /** |
|
459 * Data component used for initializing the editor and re-initializes |
|
460 * when postId changes or on unmount. |
|
461 * |
|
462 * @return {null} This is a data component so does not render any ui. |
|
463 */ |
|
464 function EditorInitialization() { |
|
465 useUpdatePostLinkListener(); |
|
466 return null; |
|
467 } |
|
468 |
|
469 ;// external ["wp","keyboardShortcuts"] |
|
470 const external_wp_keyboardShortcuts_namespaceObject = window["wp"]["keyboardShortcuts"]; |
|
471 ;// ./node_modules/@wordpress/edit-post/build-module/store/reducer.js |
|
198 /** |
472 /** |
199 * WordPress dependencies |
473 * WordPress dependencies |
200 */ |
474 */ |
201 |
475 |
202 |
476 |
280 }); |
554 }); |
281 /* harmony default export */ const reducer = ((0,external_wp_data_namespaceObject.combineReducers)({ |
555 /* harmony default export */ const reducer = ((0,external_wp_data_namespaceObject.combineReducers)({ |
282 metaBoxes |
556 metaBoxes |
283 })); |
557 })); |
284 |
558 |
285 ;// CONCATENATED MODULE: external ["wp","apiFetch"] |
559 ;// external ["wp","apiFetch"] |
286 const external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"]; |
560 const external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"]; |
287 var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject); |
561 var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject); |
288 ;// CONCATENATED MODULE: external ["wp","hooks"] |
562 ;// external ["wp","hooks"] |
289 const external_wp_hooks_namespaceObject = window["wp"]["hooks"]; |
563 const external_wp_hooks_namespaceObject = window["wp"]["hooks"]; |
290 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/utils/meta-boxes.js |
564 ;// ./node_modules/@wordpress/edit-post/build-module/utils/meta-boxes.js |
291 /** |
565 /** |
292 * Function returning the current Meta Boxes DOM Node in the editor |
566 * Function returning the current Meta Boxes DOM Node in the editor |
293 * whether the meta box area is opened or not. |
567 * whether the meta box area is opened or not. |
294 * If the MetaBox Area is visible returns it, and returns the original container instead. |
568 * If the MetaBox Area is visible returns it, and returns the original container instead. |
295 * |
569 * |
303 return area; |
577 return area; |
304 } |
578 } |
305 return document.querySelector('#metaboxes .metabox-location-' + location); |
579 return document.querySelector('#metaboxes .metabox-location-' + location); |
306 }; |
580 }; |
307 |
581 |
308 ;// CONCATENATED MODULE: external ["wp","privateApis"] |
582 ;// ./node_modules/@wordpress/edit-post/build-module/store/actions.js |
309 const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"]; |
|
310 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/lock-unlock.js |
|
311 /** |
583 /** |
312 * WordPress dependencies |
584 * WordPress dependencies |
313 */ |
585 */ |
314 |
586 |
315 const { |
587 |
316 lock, |
|
317 unlock |
|
318 } = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/edit-post'); |
|
319 |
|
320 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/store/actions.js |
|
321 /** |
|
322 * WordPress dependencies |
|
323 */ |
|
324 |
588 |
325 |
589 |
326 |
590 |
327 |
591 |
328 |
592 |
764 window.postboxes.add_postbox_toggles(postType); |
1028 window.postboxes.add_postbox_toggles(postType); |
765 } |
1029 } |
766 actions_metaBoxesInitialized = true; |
1030 actions_metaBoxesInitialized = true; |
767 |
1031 |
768 // Save metaboxes on save completion, except for autosaves. |
1032 // Save metaboxes on save completion, except for autosaves. |
769 (0,external_wp_hooks_namespaceObject.addFilter)('editor.__unstableSavePost', 'core/edit-post/save-metaboxes', (previous, options) => previous.then(() => { |
1033 (0,external_wp_hooks_namespaceObject.addAction)('editor.savePost', 'core/edit-post/save-metaboxes', async (post, options) => { |
770 if (options.isAutosave) { |
1034 if (!options.isAutosave && select.hasMetaBoxes()) { |
771 return; |
1035 await dispatch.requestMetaBoxUpdates(); |
772 } |
1036 } |
773 if (!select.hasMetaBoxes()) { |
1037 }); |
774 return; |
|
775 } |
|
776 return dispatch.requestMetaBoxUpdates(); |
|
777 })); |
|
778 dispatch({ |
1038 dispatch({ |
779 type: 'META_BOXES_INITIALIZED' |
1039 type: 'META_BOXES_INITIALIZED' |
780 }); |
1040 }); |
781 }; |
1041 }; |
782 |
1042 |
795 alternative: "dispatch( 'core/editor').toggleDistractionFree" |
1055 alternative: "dispatch( 'core/editor').toggleDistractionFree" |
796 }); |
1056 }); |
797 registry.dispatch(external_wp_editor_namespaceObject.store).toggleDistractionFree(); |
1057 registry.dispatch(external_wp_editor_namespaceObject.store).toggleDistractionFree(); |
798 }; |
1058 }; |
799 |
1059 |
800 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/store/selectors.js |
1060 /** |
1061 * Action that toggles the Fullscreen Mode view option. |
|
1062 */ |
|
1063 const toggleFullscreenMode = () => ({ |
|
1064 registry |
|
1065 }) => { |
|
1066 const isFullscreen = registry.select(external_wp_preferences_namespaceObject.store).get('core/edit-post', 'fullscreenMode'); |
|
1067 registry.dispatch(external_wp_preferences_namespaceObject.store).toggle('core/edit-post', 'fullscreenMode'); |
|
1068 registry.dispatch(external_wp_notices_namespaceObject.store).createInfoNotice(isFullscreen ? (0,external_wp_i18n_namespaceObject.__)('Fullscreen mode deactivated.') : (0,external_wp_i18n_namespaceObject.__)('Fullscreen mode activated.'), { |
|
1069 id: 'core/edit-post/toggle-fullscreen-mode/notice', |
|
1070 type: 'snackbar', |
|
1071 actions: [{ |
|
1072 label: (0,external_wp_i18n_namespaceObject.__)('Undo'), |
|
1073 onClick: () => { |
|
1074 registry.dispatch(external_wp_preferences_namespaceObject.store).toggle('core/edit-post', 'fullscreenMode'); |
|
1075 } |
|
1076 }] |
|
1077 }); |
|
1078 }; |
|
1079 |
|
1080 ;// ./node_modules/@wordpress/edit-post/build-module/store/selectors.js |
|
801 /** |
1081 /** |
802 * WordPress dependencies |
1082 * WordPress dependencies |
803 */ |
1083 */ |
804 |
1084 |
805 |
1085 |
1122 */ |
1402 */ |
1123 const isMetaBoxLocationVisible = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, location) => { |
1403 const isMetaBoxLocationVisible = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, location) => { |
1124 return isMetaBoxLocationActive(state, location) && getMetaBoxesPerLocation(state, location)?.some(({ |
1404 return isMetaBoxLocationActive(state, location) && getMetaBoxesPerLocation(state, location)?.some(({ |
1125 id |
1405 id |
1126 }) => { |
1406 }) => { |
1127 return select(external_wp_editor_namespaceObject.store).isEditorPanelEnabled(state, `meta-box-${id}`); |
1407 return select(external_wp_editor_namespaceObject.store).isEditorPanelEnabled(`meta-box-${id}`); |
1128 }); |
1408 }); |
1129 }); |
1409 }); |
1130 |
1410 |
1131 /** |
1411 /** |
1132 * Returns true if there is an active meta box in the given location, or false |
1412 * Returns true if there is an active meta box in the given location, or false |
1234 const __experimentalGetInsertionPoint = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => { |
1514 const __experimentalGetInsertionPoint = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => { |
1235 external_wp_deprecated_default()(`select( 'core/edit-post' ).__experimentalGetInsertionPoint`, { |
1515 external_wp_deprecated_default()(`select( 'core/edit-post' ).__experimentalGetInsertionPoint`, { |
1236 since: '6.5', |
1516 since: '6.5', |
1237 version: '6.7' |
1517 version: '6.7' |
1238 }); |
1518 }); |
1239 return unlock(select(external_wp_editor_namespaceObject.store)).getInsertionPoint(); |
1519 return unlock(select(external_wp_editor_namespaceObject.store)).getInserter(); |
1240 }); |
1520 }); |
1241 |
1521 |
1242 /** |
1522 /** |
1243 * Returns true if the list view is opened. |
1523 * Returns true if the list view is opened. |
1244 * |
1524 * |
1279 } |
1559 } |
1280 |
1560 |
1281 /** |
1561 /** |
1282 * Retrieves the template of the currently edited post. |
1562 * Retrieves the template of the currently edited post. |
1283 * |
1563 * |
1284 * @return {Object?} Post Template. |
1564 * @return {?Object} Post Template. |
1285 */ |
1565 */ |
1286 const getEditedPostTemplate = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => { |
1566 const getEditedPostTemplate = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => { |
1287 const { |
1567 const { |
1288 id: postId, |
1568 id: postId, |
1289 type: postType, |
1569 type: postType |
1290 slug |
|
1291 } = select(external_wp_editor_namespaceObject.store).getCurrentPost(); |
1570 } = select(external_wp_editor_namespaceObject.store).getCurrentPost(); |
1292 const { |
1571 const templateId = unlock(select(external_wp_coreData_namespaceObject.store)).getTemplateId(postType, postId); |
1293 getSite, |
1572 if (!templateId) { |
1294 getEditedEntityRecord, |
1573 return undefined; |
1295 getEntityRecords |
1574 } |
1296 } = select(external_wp_coreData_namespaceObject.store); |
1575 return select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord('postType', 'wp_template', templateId); |
1297 const siteSettings = getSite(); |
|
1298 // First check if the current page is set as the posts page. |
|
1299 const isPostsPage = +postId === siteSettings?.page_for_posts; |
|
1300 if (isPostsPage) { |
|
1301 const defaultTemplateId = select(external_wp_coreData_namespaceObject.store).getDefaultTemplateId({ |
|
1302 slug: 'home' |
|
1303 }); |
|
1304 return getEditedEntityRecord('postType', 'wp_template', defaultTemplateId); |
|
1305 } |
|
1306 const currentTemplate = select(external_wp_editor_namespaceObject.store).getEditedPostAttribute('template'); |
|
1307 if (currentTemplate) { |
|
1308 const templateWithSameSlug = getEntityRecords('postType', 'wp_template', { |
|
1309 per_page: -1 |
|
1310 })?.find(template => template.slug === currentTemplate); |
|
1311 if (!templateWithSameSlug) { |
|
1312 return templateWithSameSlug; |
|
1313 } |
|
1314 return getEditedEntityRecord('postType', 'wp_template', templateWithSameSlug.id); |
|
1315 } |
|
1316 let slugToCheck; |
|
1317 // In `draft` status we might not have a slug available, so we use the `single` |
|
1318 // post type templates slug(ex page, single-post, single-product etc..). |
|
1319 // Pages do not need the `single` prefix in the slug to be prioritized |
|
1320 // through template hierarchy. |
|
1321 if (slug) { |
|
1322 slugToCheck = postType === 'page' ? `${postType}-${slug}` : `single-${postType}-${slug}`; |
|
1323 } else { |
|
1324 slugToCheck = postType === 'page' ? 'page' : `single-${postType}`; |
|
1325 } |
|
1326 const defaultTemplateId = select(external_wp_coreData_namespaceObject.store).getDefaultTemplateId({ |
|
1327 slug: slugToCheck |
|
1328 }); |
|
1329 return defaultTemplateId ? select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord('postType', 'wp_template', defaultTemplateId) : null; |
|
1330 }); |
1576 }); |
1331 |
1577 |
1332 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/store/constants.js |
1578 ;// ./node_modules/@wordpress/edit-post/build-module/store/index.js |
1333 /** |
|
1334 * The identifier for the data store. |
|
1335 * |
|
1336 * @type {string} |
|
1337 */ |
|
1338 const STORE_NAME = 'core/edit-post'; |
|
1339 |
|
1340 /** |
|
1341 * CSS selector string for the admin bar view post link anchor tag. |
|
1342 * |
|
1343 * @type {string} |
|
1344 */ |
|
1345 const VIEW_AS_LINK_SELECTOR = '#wp-admin-bar-view a'; |
|
1346 |
|
1347 /** |
|
1348 * CSS selector string for the admin bar preview post link anchor tag. |
|
1349 * |
|
1350 * @type {string} |
|
1351 */ |
|
1352 const VIEW_AS_PREVIEW_LINK_SELECTOR = '#wp-admin-bar-preview a'; |
|
1353 |
|
1354 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/store/index.js |
|
1355 /** |
1579 /** |
1356 * WordPress dependencies |
1580 * WordPress dependencies |
1357 */ |
1581 */ |
1358 |
1582 |
1359 |
1583 |
1377 actions: actions_namespaceObject, |
1601 actions: actions_namespaceObject, |
1378 selectors: selectors_namespaceObject |
1602 selectors: selectors_namespaceObject |
1379 }); |
1603 }); |
1380 (0,external_wp_data_namespaceObject.register)(store); |
1604 (0,external_wp_data_namespaceObject.register)(store); |
1381 |
1605 |
1382 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/back-button/fullscreen-mode-close.js |
1606 ;// ./node_modules/@wordpress/edit-post/build-module/components/keyboard-shortcuts/index.js |
1383 /** |
|
1384 * External dependencies |
|
1385 */ |
|
1386 |
|
1387 |
|
1388 /** |
|
1389 * WordPress dependencies |
|
1390 */ |
|
1391 |
|
1392 |
|
1393 |
|
1394 |
|
1395 |
|
1396 |
|
1397 |
|
1398 |
|
1399 |
|
1400 /** |
|
1401 * Internal dependencies |
|
1402 */ |
|
1403 |
|
1404 |
|
1405 function FullscreenModeClose({ |
|
1406 showTooltip, |
|
1407 icon, |
|
1408 href, |
|
1409 initialPost |
|
1410 }) { |
|
1411 var _postType$labels$view; |
|
1412 const { |
|
1413 isActive, |
|
1414 isRequestingSiteIcon, |
|
1415 postType, |
|
1416 siteIconUrl |
|
1417 } = (0,external_wp_data_namespaceObject.useSelect)(select => { |
|
1418 const { |
|
1419 getCurrentPostType |
|
1420 } = select(external_wp_editor_namespaceObject.store); |
|
1421 const { |
|
1422 isFeatureActive |
|
1423 } = select(store); |
|
1424 const { |
|
1425 getEntityRecord, |
|
1426 getPostType, |
|
1427 isResolving |
|
1428 } = select(external_wp_coreData_namespaceObject.store); |
|
1429 const siteData = getEntityRecord('root', '__unstableBase', undefined) || {}; |
|
1430 const _postType = initialPost?.type || getCurrentPostType(); |
|
1431 return { |
|
1432 isActive: isFeatureActive('fullscreenMode'), |
|
1433 isRequestingSiteIcon: isResolving('getEntityRecord', ['root', '__unstableBase', undefined]), |
|
1434 postType: getPostType(_postType), |
|
1435 siteIconUrl: siteData.site_icon_url |
|
1436 }; |
|
1437 }, []); |
|
1438 const disableMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)(); |
|
1439 if (!isActive || !postType) { |
|
1440 return null; |
|
1441 } |
|
1442 let buttonIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { |
|
1443 size: "36px", |
|
1444 icon: library_wordpress |
|
1445 }); |
|
1446 const effect = { |
|
1447 expand: { |
|
1448 scale: 1.25, |
|
1449 transition: { |
|
1450 type: 'tween', |
|
1451 duration: '0.3' |
|
1452 } |
|
1453 } |
|
1454 }; |
|
1455 if (siteIconUrl) { |
|
1456 buttonIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableMotion.img, { |
|
1457 variants: !disableMotion && effect, |
|
1458 alt: (0,external_wp_i18n_namespaceObject.__)('Site Icon'), |
|
1459 className: "edit-post-fullscreen-mode-close_site-icon", |
|
1460 src: siteIconUrl |
|
1461 }); |
|
1462 } |
|
1463 if (isRequestingSiteIcon) { |
|
1464 buttonIcon = null; |
|
1465 } |
|
1466 |
|
1467 // Override default icon if custom icon is provided via props. |
|
1468 if (icon) { |
|
1469 buttonIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { |
|
1470 size: "36px", |
|
1471 icon: icon |
|
1472 }); |
|
1473 } |
|
1474 const classes = dist_clsx({ |
|
1475 'edit-post-fullscreen-mode-close': true, |
|
1476 'has-icon': siteIconUrl |
|
1477 }); |
|
1478 const buttonHref = href !== null && href !== void 0 ? href : (0,external_wp_url_namespaceObject.addQueryArgs)('edit.php', { |
|
1479 post_type: postType.slug |
|
1480 }); |
|
1481 const buttonLabel = (_postType$labels$view = postType?.labels?.view_items) !== null && _postType$labels$view !== void 0 ? _postType$labels$view : (0,external_wp_i18n_namespaceObject.__)('Back'); |
|
1482 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableMotion.div, { |
|
1483 whileHover: "expand", |
|
1484 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { |
|
1485 className: classes, |
|
1486 href: buttonHref, |
|
1487 label: buttonLabel, |
|
1488 showTooltip: showTooltip, |
|
1489 children: buttonIcon |
|
1490 }) |
|
1491 }); |
|
1492 } |
|
1493 /* harmony default export */ const fullscreen_mode_close = (FullscreenModeClose); |
|
1494 |
|
1495 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/back-button/index.js |
|
1496 /** |
|
1497 * WordPress dependencies |
|
1498 */ |
|
1499 |
|
1500 |
|
1501 |
|
1502 /** |
|
1503 * Internal dependencies |
|
1504 */ |
|
1505 |
|
1506 |
|
1507 |
|
1508 const { |
|
1509 BackButton: BackButtonFill |
|
1510 } = unlock(external_wp_editor_namespaceObject.privateApis); |
|
1511 const slideX = { |
|
1512 hidden: { |
|
1513 x: '-100%' |
|
1514 }, |
|
1515 distractionFreeInactive: { |
|
1516 x: 0 |
|
1517 }, |
|
1518 hover: { |
|
1519 x: 0, |
|
1520 transition: { |
|
1521 type: 'tween', |
|
1522 delay: 0.2 |
|
1523 } |
|
1524 } |
|
1525 }; |
|
1526 function BackButton({ |
|
1527 initialPost |
|
1528 }) { |
|
1529 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BackButtonFill, { |
|
1530 children: ({ |
|
1531 length |
|
1532 }) => length <= 1 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableMotion.div, { |
|
1533 variants: slideX, |
|
1534 transition: { |
|
1535 type: 'tween', |
|
1536 delay: 0.8 |
|
1537 }, |
|
1538 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(fullscreen_mode_close, { |
|
1539 showTooltip: true, |
|
1540 initialPost: initialPost |
|
1541 }) |
|
1542 }) |
|
1543 }); |
|
1544 } |
|
1545 /* harmony default export */ const back_button = (BackButton); |
|
1546 |
|
1547 ;// CONCATENATED MODULE: external ["wp","keyboardShortcuts"] |
|
1548 const external_wp_keyboardShortcuts_namespaceObject = window["wp"]["keyboardShortcuts"]; |
|
1549 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/keyboard-shortcuts/index.js |
|
1550 /** |
1607 /** |
1551 * WordPress dependencies |
1608 * WordPress dependencies |
1552 */ |
1609 */ |
1553 |
1610 |
1554 |
1611 |
1559 * Internal dependencies |
1616 * Internal dependencies |
1560 */ |
1617 */ |
1561 |
1618 |
1562 function KeyboardShortcuts() { |
1619 function KeyboardShortcuts() { |
1563 const { |
1620 const { |
1564 toggleFeature |
1621 toggleFullscreenMode |
1565 } = (0,external_wp_data_namespaceObject.useDispatch)(store); |
1622 } = (0,external_wp_data_namespaceObject.useDispatch)(store); |
1566 const { |
1623 const { |
1567 registerShortcut |
1624 registerShortcut |
1568 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_keyboardShortcuts_namespaceObject.store); |
1625 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_keyboardShortcuts_namespaceObject.store); |
1569 (0,external_wp_element_namespaceObject.useEffect)(() => { |
1626 (0,external_wp_element_namespaceObject.useEffect)(() => { |
1570 registerShortcut({ |
1627 registerShortcut({ |
1571 name: 'core/edit-post/toggle-fullscreen', |
1628 name: 'core/edit-post/toggle-fullscreen', |
1572 category: 'global', |
1629 category: 'global', |
1573 description: (0,external_wp_i18n_namespaceObject.__)('Toggle fullscreen mode.'), |
1630 description: (0,external_wp_i18n_namespaceObject.__)('Enable or disable fullscreen mode.'), |
1574 keyCombination: { |
1631 keyCombination: { |
1575 modifier: 'secondary', |
1632 modifier: 'secondary', |
1576 character: 'f' |
1633 character: 'f' |
1577 } |
1634 } |
1578 }); |
1635 }); |
1579 }, []); |
1636 }, []); |
1580 (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/edit-post/toggle-fullscreen', () => { |
1637 (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/edit-post/toggle-fullscreen', () => { |
1581 toggleFeature('fullscreenMode'); |
1638 toggleFullscreenMode(); |
1582 }); |
1639 }); |
1583 return null; |
1640 return null; |
1584 } |
1641 } |
1585 /* harmony default export */ const keyboard_shortcuts = (KeyboardShortcuts); |
1642 /* harmony default export */ const keyboard_shortcuts = (KeyboardShortcuts); |
1586 |
1643 |
1587 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/init-pattern-modal/index.js |
1644 ;// ./node_modules/@wordpress/edit-post/build-module/components/init-pattern-modal/index.js |
1588 /** |
1645 /** |
1589 * WordPress dependencies |
1646 * WordPress dependencies |
1590 */ |
1647 */ |
1591 |
1648 |
1592 |
1649 |
1593 |
1650 |
1594 |
1651 |
1595 |
1652 |
1596 |
1653 |
1597 |
|
1598 /** |
|
1599 * Internal dependencies |
|
1600 */ |
|
1601 |
|
1602 |
|
1603 |
|
1604 |
|
1605 |
|
1606 const { |
|
1607 ReusableBlocksRenameHint |
|
1608 } = unlock(external_wp_blockEditor_namespaceObject.privateApis); |
|
1609 function InitPatternModal() { |
1654 function InitPatternModal() { |
1610 const { |
1655 const { |
1611 editPost |
1656 editPost |
1612 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_editor_namespaceObject.store); |
1657 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_editor_namespaceObject.store); |
1613 const [isModalOpen, setIsModalOpen] = (0,external_wp_element_namespaceObject.useState)(false); |
|
1614 const [syncType, setSyncType] = (0,external_wp_element_namespaceObject.useState)(undefined); |
1658 const [syncType, setSyncType] = (0,external_wp_element_namespaceObject.useState)(undefined); |
1615 const [title, setTitle] = (0,external_wp_element_namespaceObject.useState)(''); |
1659 const [title, setTitle] = (0,external_wp_element_namespaceObject.useState)(''); |
1616 const { |
1660 const { |
1617 postType, |
1661 postType, |
1618 isNewPost |
1662 isNewPost |
1624 return { |
1668 return { |
1625 postType: getEditedPostAttribute('type'), |
1669 postType: getEditedPostAttribute('type'), |
1626 isNewPost: isCleanNewPost() |
1670 isNewPost: isCleanNewPost() |
1627 }; |
1671 }; |
1628 }, []); |
1672 }, []); |
1629 (0,external_wp_element_namespaceObject.useEffect)(() => { |
1673 const [isModalOpen, setIsModalOpen] = (0,external_wp_element_namespaceObject.useState)(() => isNewPost && postType === 'wp_block'); |
1630 if (isNewPost && postType === 'wp_block') { |
|
1631 setIsModalOpen(true); |
|
1632 } |
|
1633 // We only want the modal to open when the page is first loaded. |
|
1634 // eslint-disable-next-line react-hooks/exhaustive-deps |
|
1635 }, []); |
|
1636 if (postType !== 'wp_block' || !isNewPost) { |
1674 if (postType !== 'wp_block' || !isNewPost) { |
1637 return null; |
1675 return null; |
1638 } |
1676 } |
1639 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { |
1677 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { |
1640 children: isModalOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, { |
1678 children: isModalOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, { |
1662 onChange: setTitle, |
1700 onChange: setTitle, |
1663 placeholder: (0,external_wp_i18n_namespaceObject.__)('My pattern'), |
1701 placeholder: (0,external_wp_i18n_namespaceObject.__)('My pattern'), |
1664 className: "patterns-create-modal__name-input", |
1702 className: "patterns-create-modal__name-input", |
1665 __nextHasNoMarginBottom: true, |
1703 __nextHasNoMarginBottom: true, |
1666 __next40pxDefaultSize: true |
1704 __next40pxDefaultSize: true |
1667 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ReusableBlocksRenameHint, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { |
1705 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { |
1706 __nextHasNoMarginBottom: true, |
|
1668 label: (0,external_wp_i18n_namespaceObject._x)('Synced', 'pattern (singular)'), |
1707 label: (0,external_wp_i18n_namespaceObject._x)('Synced', 'pattern (singular)'), |
1669 help: (0,external_wp_i18n_namespaceObject.__)('Sync this pattern across multiple locations.'), |
1708 help: (0,external_wp_i18n_namespaceObject.__)('Sync this pattern across multiple locations.'), |
1670 checked: !syncType, |
1709 checked: !syncType, |
1671 onChange: () => { |
1710 onChange: () => { |
1672 setSyncType(!syncType ? 'unsynced' : undefined); |
1711 setSyncType(!syncType ? 'unsynced' : undefined); |
1673 } |
1712 } |
1674 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHStack, { |
1713 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHStack, { |
1675 justify: "right", |
1714 justify: "right", |
1676 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { |
1715 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { |
1716 __next40pxDefaultSize: true, |
|
1677 variant: "primary", |
1717 variant: "primary", |
1678 type: "submit", |
1718 type: "submit", |
1679 disabled: !title, |
1719 disabled: !title, |
1680 __experimentalIsFocusable: true, |
1720 accessibleWhenDisabled: true, |
1681 children: (0,external_wp_i18n_namespaceObject.__)('Create') |
1721 children: (0,external_wp_i18n_namespaceObject.__)('Create') |
1682 }) |
1722 }) |
1683 })] |
1723 })] |
1684 }) |
1724 }) |
1685 }) |
1725 }) |
1686 }) |
1726 }) |
1687 }); |
1727 }); |
1688 } |
1728 } |
1689 |
1729 |
1690 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/browser-url/index.js |
1730 ;// ./node_modules/@wordpress/edit-post/build-module/components/browser-url/index.js |
1691 /** |
1731 /** |
1692 * WordPress dependencies |
1732 * WordPress dependencies |
1693 */ |
1733 */ |
1694 |
1734 |
1695 |
1735 |
1705 */ |
1745 */ |
1706 function getPostEditURL(postId) { |
1746 function getPostEditURL(postId) { |
1707 return (0,external_wp_url_namespaceObject.addQueryArgs)('post.php', { |
1747 return (0,external_wp_url_namespaceObject.addQueryArgs)('post.php', { |
1708 post: postId, |
1748 post: postId, |
1709 action: 'edit' |
1749 action: 'edit' |
1710 }); |
|
1711 } |
|
1712 |
|
1713 /** |
|
1714 * Returns the Post's Trashed URL. |
|
1715 * |
|
1716 * @param {number} postId Post ID. |
|
1717 * @param {string} postType Post Type. |
|
1718 * |
|
1719 * @return {string} Post trashed URL. |
|
1720 */ |
|
1721 function getPostTrashedURL(postId, postType) { |
|
1722 return (0,external_wp_url_namespaceObject.addQueryArgs)('edit.php', { |
|
1723 trashed: 1, |
|
1724 post_type: postType, |
|
1725 ids: postId |
|
1726 }); |
1750 }); |
1727 } |
1751 } |
1728 class BrowserURL extends external_wp_element_namespaceObject.Component { |
1752 class BrowserURL extends external_wp_element_namespaceObject.Component { |
1729 constructor() { |
1753 constructor() { |
1730 super(...arguments); |
1754 super(...arguments); |
1733 }; |
1757 }; |
1734 } |
1758 } |
1735 componentDidUpdate(prevProps) { |
1759 componentDidUpdate(prevProps) { |
1736 const { |
1760 const { |
1737 postId, |
1761 postId, |
1738 postStatus, |
1762 postStatus |
1739 postType, |
|
1740 isSavingPost, |
|
1741 hasHistory |
|
1742 } = this.props; |
1763 } = this.props; |
1743 const { |
1764 const { |
1744 historyId |
1765 historyId |
1745 } = this.state; |
1766 } = this.state; |
1746 |
1767 if ((postId !== prevProps.postId || postId !== historyId) && postStatus !== 'auto-draft' && postId) { |
1747 // Posts are still dirty while saving so wait for saving to finish |
|
1748 // to avoid the unsaved changes warning when trashing posts. |
|
1749 if (postStatus === 'trash' && !isSavingPost) { |
|
1750 this.setTrashURL(postId, postType); |
|
1751 return; |
|
1752 } |
|
1753 if ((postId !== prevProps.postId || postId !== historyId) && postStatus !== 'auto-draft' && postId && !hasHistory) { |
|
1754 this.setBrowserURL(postId); |
1768 this.setBrowserURL(postId); |
1755 } |
1769 } |
1756 } |
|
1757 |
|
1758 /** |
|
1759 * Navigates the browser to the post trashed URL to show a notice about the trashed post. |
|
1760 * |
|
1761 * @param {number} postId Post ID. |
|
1762 * @param {string} postType Post Type. |
|
1763 */ |
|
1764 setTrashURL(postId, postType) { |
|
1765 window.location.href = getPostTrashedURL(postId, postType); |
|
1766 } |
1770 } |
1767 |
1771 |
1768 /** |
1772 /** |
1769 * Replaces the browser URL with a post editor link for the given post ID. |
1773 * Replaces the browser URL with a post editor link for the given post ID. |
1770 * |
1774 * |
1786 return null; |
1790 return null; |
1787 } |
1791 } |
1788 } |
1792 } |
1789 /* harmony default export */ const browser_url = ((0,external_wp_data_namespaceObject.withSelect)(select => { |
1793 /* harmony default export */ const browser_url = ((0,external_wp_data_namespaceObject.withSelect)(select => { |
1790 const { |
1794 const { |
1791 getCurrentPost, |
1795 getCurrentPost |
1792 isSavingPost |
|
1793 } = select(external_wp_editor_namespaceObject.store); |
1796 } = select(external_wp_editor_namespaceObject.store); |
1794 const post = getCurrentPost(); |
1797 const post = getCurrentPost(); |
1795 let { |
1798 let { |
1796 id, |
1799 id, |
1797 status, |
1800 status, |
1801 if (isTemplate) { |
1804 if (isTemplate) { |
1802 id = post.wp_id; |
1805 id = post.wp_id; |
1803 } |
1806 } |
1804 return { |
1807 return { |
1805 postId: id, |
1808 postId: id, |
1806 postStatus: status, |
1809 postStatus: status |
1807 postType: type, |
|
1808 isSavingPost: isSavingPost() |
|
1809 }; |
1810 }; |
1810 })(BrowserURL)); |
1811 })(BrowserURL)); |
1811 |
1812 |
1812 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/meta-boxes/meta-boxes-area/index.js |
1813 ;// ./node_modules/@wordpress/edit-post/build-module/components/meta-boxes/meta-boxes-area/index.js |
1813 /** |
1814 /** |
1814 * External dependencies |
1815 * External dependencies |
1815 */ |
1816 */ |
1816 |
1817 |
1817 |
1818 |
1832 * |
1833 * |
1833 * @param {Object} props Component props. |
1834 * @param {Object} props Component props. |
1834 * @param {string} props.location metabox location. |
1835 * @param {string} props.location metabox location. |
1835 * @return {Component} The component to be rendered. |
1836 * @return {Component} The component to be rendered. |
1836 */ |
1837 */ |
1837 |
|
1838 |
1838 |
1839 function MetaBoxesArea({ |
1839 function MetaBoxesArea({ |
1840 location |
1840 location |
1841 }) { |
1841 }) { |
1842 const container = (0,external_wp_element_namespaceObject.useRef)(null); |
1842 const container = (0,external_wp_element_namespaceObject.useRef)(null); |
1868 })] |
1868 })] |
1869 }); |
1869 }); |
1870 } |
1870 } |
1871 /* harmony default export */ const meta_boxes_area = (MetaBoxesArea); |
1871 /* harmony default export */ const meta_boxes_area = (MetaBoxesArea); |
1872 |
1872 |
1873 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/meta-boxes/meta-box-visibility.js |
1873 ;// ./node_modules/@wordpress/edit-post/build-module/components/meta-boxes/meta-box-visibility.js |
1874 /** |
1874 /** |
1875 * WordPress dependencies |
1875 * WordPress dependencies |
1876 */ |
1876 */ |
1877 |
1877 |
1878 |
1878 |
1879 |
1879 |
1880 class MetaBoxVisibility extends external_wp_element_namespaceObject.Component { |
1880 function MetaBoxVisibility({ |
1881 componentDidMount() { |
1881 id |
1882 this.updateDOM(); |
1882 }) { |
1883 } |
1883 const isVisible = (0,external_wp_data_namespaceObject.useSelect)(select => { |
1884 componentDidUpdate(prevProps) { |
1884 return select(external_wp_editor_namespaceObject.store).isEditorPanelEnabled(`meta-box-${id}`); |
1885 if (this.props.isVisible !== prevProps.isVisible) { |
1885 }, [id]); |
1886 this.updateDOM(); |
1886 (0,external_wp_element_namespaceObject.useEffect)(() => { |
1887 } |
|
1888 } |
|
1889 updateDOM() { |
|
1890 const { |
|
1891 id, |
|
1892 isVisible |
|
1893 } = this.props; |
|
1894 const element = document.getElementById(id); |
1887 const element = document.getElementById(id); |
1895 if (!element) { |
1888 if (!element) { |
1896 return; |
1889 return; |
1897 } |
1890 } |
1898 if (isVisible) { |
1891 if (isVisible) { |
1899 element.classList.remove('is-hidden'); |
1892 element.classList.remove('is-hidden'); |
1900 } else { |
1893 } else { |
1901 element.classList.add('is-hidden'); |
1894 element.classList.add('is-hidden'); |
1902 } |
1895 } |
1903 } |
1896 }, [id, isVisible]); |
1904 render() { |
1897 return null; |
1905 return null; |
1898 } |
1906 } |
1899 |
1907 } |
1900 ;// ./node_modules/@wordpress/edit-post/build-module/components/meta-boxes/index.js |
1908 /* harmony default export */ const meta_box_visibility = ((0,external_wp_data_namespaceObject.withSelect)((select, { |
|
1909 id |
|
1910 }) => ({ |
|
1911 isVisible: select(external_wp_editor_namespaceObject.store).isEditorPanelEnabled(`meta-box-${id}`) |
|
1912 }))(MetaBoxVisibility)); |
|
1913 |
|
1914 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/meta-boxes/index.js |
|
1915 /** |
1901 /** |
1916 * WordPress dependencies |
1902 * WordPress dependencies |
1917 */ |
1903 */ |
1918 |
1904 |
1919 |
1905 |
1920 |
|
1921 |
|
1922 /** |
1906 /** |
1923 * Internal dependencies |
1907 * Internal dependencies |
1924 */ |
1908 */ |
1925 |
|
1926 |
|
1927 |
1909 |
1928 |
1910 |
1929 |
1911 |
1930 |
1912 |
1931 function MetaBoxes({ |
1913 function MetaBoxes({ |
1932 location |
1914 location |
1933 }) { |
1915 }) { |
1934 const registry = (0,external_wp_data_namespaceObject.useRegistry)(); |
1916 const metaBoxes = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getMetaBoxesPerLocation(location), [location]); |
1935 const { |
|
1936 metaBoxes, |
|
1937 areMetaBoxesInitialized, |
|
1938 isEditorReady |
|
1939 } = (0,external_wp_data_namespaceObject.useSelect)(select => { |
|
1940 const { |
|
1941 __unstableIsEditorReady |
|
1942 } = select(external_wp_editor_namespaceObject.store); |
|
1943 const { |
|
1944 getMetaBoxesPerLocation, |
|
1945 areMetaBoxesInitialized: _areMetaBoxesInitialized |
|
1946 } = select(store); |
|
1947 return { |
|
1948 metaBoxes: getMetaBoxesPerLocation(location), |
|
1949 areMetaBoxesInitialized: _areMetaBoxesInitialized(), |
|
1950 isEditorReady: __unstableIsEditorReady() |
|
1951 }; |
|
1952 }, [location]); |
|
1953 const hasMetaBoxes = !!metaBoxes?.length; |
|
1954 |
|
1955 // When editor is ready, initialize postboxes (wp core script) and metabox |
|
1956 // saving. This initializes all meta box locations, not just this specific |
|
1957 // one. |
|
1958 (0,external_wp_element_namespaceObject.useEffect)(() => { |
|
1959 if (isEditorReady && hasMetaBoxes && !areMetaBoxesInitialized) { |
|
1960 registry.dispatch(store).initializeMetaBoxes(); |
|
1961 } |
|
1962 }, [isEditorReady, hasMetaBoxes, areMetaBoxesInitialized]); |
|
1963 if (!areMetaBoxesInitialized) { |
|
1964 return null; |
|
1965 } |
|
1966 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { |
1917 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { |
1967 children: [(metaBoxes !== null && metaBoxes !== void 0 ? metaBoxes : []).map(({ |
1918 children: [(metaBoxes !== null && metaBoxes !== void 0 ? metaBoxes : []).map(({ |
1968 id |
1919 id |
1969 }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(meta_box_visibility, { |
1920 }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MetaBoxVisibility, { |
1970 id: id |
1921 id: id |
1971 }, id)), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(meta_boxes_area, { |
1922 }, id)), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(meta_boxes_area, { |
1972 location: location |
1923 location: location |
1973 })] |
1924 })] |
1974 }); |
1925 }); |
1975 } |
1926 } |
1976 |
1927 |
1977 ;// CONCATENATED MODULE: external ["wp","keycodes"] |
1928 ;// external ["wp","keycodes"] |
1978 const external_wp_keycodes_namespaceObject = window["wp"]["keycodes"]; |
1929 const external_wp_keycodes_namespaceObject = window["wp"]["keycodes"]; |
1979 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/more-menu/manage-patterns-menu-item.js |
1930 ;// ./node_modules/@wordpress/edit-post/build-module/components/more-menu/manage-patterns-menu-item.js |
1980 /** |
1931 /** |
1981 * WordPress dependencies |
1932 * WordPress dependencies |
1982 */ |
1933 */ |
1983 |
1934 |
1984 |
1935 |
1999 }); |
1950 }); |
2000 |
1951 |
2001 // The site editor and templates both check whether the user has |
1952 // The site editor and templates both check whether the user has |
2002 // edit_theme_options capabilities. We can leverage that here and not |
1953 // edit_theme_options capabilities. We can leverage that here and not |
2003 // display the manage patterns link if the user can't access it. |
1954 // display the manage patterns link if the user can't access it. |
2004 return canUser('create', 'templates') ? patternsUrl : defaultUrl; |
1955 return canUser('create', { |
1956 kind: 'postType', |
|
1957 name: 'wp_template' |
|
1958 }) ? patternsUrl : defaultUrl; |
|
2005 }, []); |
1959 }, []); |
2006 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { |
1960 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { |
2007 role: "menuitem", |
1961 role: "menuitem", |
2008 href: url, |
1962 href: url, |
2009 children: (0,external_wp_i18n_namespaceObject.__)('Manage patterns') |
1963 children: (0,external_wp_i18n_namespaceObject.__)('Manage patterns') |
2010 }); |
1964 }); |
2011 } |
1965 } |
2012 /* harmony default export */ const manage_patterns_menu_item = (ManagePatternsMenuItem); |
1966 /* harmony default export */ const manage_patterns_menu_item = (ManagePatternsMenuItem); |
2013 |
1967 |
2014 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/more-menu/welcome-guide-menu-item.js |
1968 ;// ./node_modules/@wordpress/edit-post/build-module/components/more-menu/welcome-guide-menu-item.js |
2015 /** |
1969 /** |
2016 * WordPress dependencies |
1970 * WordPress dependencies |
2017 */ |
1971 */ |
2018 |
1972 |
2019 |
1973 |
2027 name: isEditingTemplate ? 'welcomeGuideTemplate' : 'welcomeGuide', |
1981 name: isEditingTemplate ? 'welcomeGuideTemplate' : 'welcomeGuide', |
2028 label: (0,external_wp_i18n_namespaceObject.__)('Welcome Guide') |
1982 label: (0,external_wp_i18n_namespaceObject.__)('Welcome Guide') |
2029 }); |
1983 }); |
2030 } |
1984 } |
2031 |
1985 |
2032 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/enable-custom-fields.js |
1986 ;// ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/enable-custom-fields.js |
2033 /** |
1987 /** |
2034 * WordPress dependencies |
1988 * WordPress dependencies |
2035 */ |
1989 */ |
2036 |
1990 |
2037 |
1991 |
2042 |
1996 |
2043 |
1997 |
2044 /** |
1998 /** |
2045 * Internal dependencies |
1999 * Internal dependencies |
2046 */ |
2000 */ |
2047 |
|
2048 |
|
2049 |
2001 |
2050 |
2002 |
2051 const { |
2003 const { |
2052 PreferenceBaseOption |
2004 PreferenceBaseOption |
2053 } = unlock(external_wp_preferences_namespaceObject.privateApis); |
2005 } = unlock(external_wp_preferences_namespaceObject.privateApis); |
2065 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { |
2017 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { |
2066 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { |
2018 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { |
2067 className: "edit-post-preferences-modal__custom-fields-confirmation-message", |
2019 className: "edit-post-preferences-modal__custom-fields-confirmation-message", |
2068 children: (0,external_wp_i18n_namespaceObject.__)('A page reload is required for this change. Make sure your content is saved before reloading.') |
2020 children: (0,external_wp_i18n_namespaceObject.__)('A page reload is required for this change. Make sure your content is saved before reloading.') |
2069 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { |
2021 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { |
2070 className: "edit-post-preferences-modal__custom-fields-confirmation-button", |
2022 __next40pxDefaultSize: true, |
2071 variant: "secondary", |
2023 variant: "secondary", |
2072 isBusy: isReloading, |
2024 isBusy: isReloading, |
2073 __experimentalIsFocusable: true, |
2025 accessibleWhenDisabled: true, |
2074 disabled: isReloading, |
2026 disabled: isReloading, |
2075 onClick: () => { |
2027 onClick: () => { |
2076 setIsReloading(true); |
2028 setIsReloading(true); |
2077 submitCustomFieldsForm(); |
2029 submitCustomFieldsForm(); |
2078 }, |
2030 }, |
2079 children: willEnable ? (0,external_wp_i18n_namespaceObject.__)('Show & Reload Page') : (0,external_wp_i18n_namespaceObject.__)('Hide & Reload Page') |
2031 children: willEnable ? (0,external_wp_i18n_namespaceObject.__)('Show & Reload Page') : (0,external_wp_i18n_namespaceObject.__)('Hide & Reload Page') |
2080 })] |
2032 })] |
2081 }); |
2033 }); |
2082 } |
2034 } |
2083 function EnableCustomFieldsOption({ |
2035 function EnableCustomFieldsOption({ |
2084 label, |
2036 label |
2085 areCustomFieldsEnabled |
|
2086 }) { |
2037 }) { |
2038 const areCustomFieldsEnabled = (0,external_wp_data_namespaceObject.useSelect)(select => { |
|
2039 return !!select(external_wp_editor_namespaceObject.store).getEditorSettings().enableCustomFields; |
|
2040 }, []); |
|
2087 const [isChecked, setIsChecked] = (0,external_wp_element_namespaceObject.useState)(areCustomFieldsEnabled); |
2041 const [isChecked, setIsChecked] = (0,external_wp_element_namespaceObject.useState)(areCustomFieldsEnabled); |
2088 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferenceBaseOption, { |
2042 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferenceBaseOption, { |
2089 label: label, |
2043 label: label, |
2090 isChecked: isChecked, |
2044 isChecked: isChecked, |
2091 onChange: setIsChecked, |
2045 onChange: setIsChecked, |
2092 children: isChecked !== areCustomFieldsEnabled && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CustomFieldsConfirmation, { |
2046 children: isChecked !== areCustomFieldsEnabled && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CustomFieldsConfirmation, { |
2093 willEnable: isChecked |
2047 willEnable: isChecked |
2094 }) |
2048 }) |
2095 }); |
2049 }); |
2096 } |
2050 } |
2097 /* harmony default export */ const enable_custom_fields = ((0,external_wp_data_namespaceObject.withSelect)(select => ({ |
2051 |
2098 areCustomFieldsEnabled: !!select(external_wp_editor_namespaceObject.store).getEditorSettings().enableCustomFields |
2052 ;// ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/enable-panel.js |
2099 }))(EnableCustomFieldsOption)); |
|
2100 |
|
2101 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/enable-panel.js |
|
2102 /** |
2053 /** |
2103 * WordPress dependencies |
2054 * WordPress dependencies |
2104 */ |
2055 */ |
2105 |
2056 |
2106 |
2057 |
2107 |
2058 |
2108 |
2059 |
2109 |
|
2110 /** |
2060 /** |
2111 * Internal dependencies |
2061 * Internal dependencies |
2112 */ |
2062 */ |
2063 |
|
2113 |
2064 |
2114 const { |
2065 const { |
2115 PreferenceBaseOption: enable_panel_PreferenceBaseOption |
2066 PreferenceBaseOption: enable_panel_PreferenceBaseOption |
2116 } = unlock(external_wp_preferences_namespaceObject.privateApis); |
2067 } = unlock(external_wp_preferences_namespaceObject.privateApis); |
2117 /* harmony default export */ const enable_panel = ((0,external_wp_compose_namespaceObject.compose)((0,external_wp_data_namespaceObject.withSelect)((select, { |
2068 function EnablePanelOption(props) { |
2118 panelName |
|
2119 }) => { |
|
2120 const { |
2069 const { |
2121 isEditorPanelEnabled, |
2070 toggleEditorPanelEnabled |
2122 isEditorPanelRemoved |
2071 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_editor_namespaceObject.store); |
2123 } = select(external_wp_editor_namespaceObject.store); |
2072 const { |
2124 return { |
2073 isChecked, |
2125 isRemoved: isEditorPanelRemoved(panelName), |
2074 isRemoved |
2126 isChecked: isEditorPanelEnabled(panelName) |
2075 } = (0,external_wp_data_namespaceObject.useSelect)(select => { |
2127 }; |
2076 const { |
2128 }), (0,external_wp_compose_namespaceObject.ifCondition)(({ |
2077 isEditorPanelEnabled, |
2129 isRemoved |
2078 isEditorPanelRemoved |
2130 }) => !isRemoved), (0,external_wp_data_namespaceObject.withDispatch)((dispatch, { |
2079 } = select(external_wp_editor_namespaceObject.store); |
2131 panelName |
2080 return { |
2132 }) => ({ |
2081 isChecked: isEditorPanelEnabled(props.panelName), |
2133 onChange: () => dispatch(external_wp_editor_namespaceObject.store).toggleEditorPanelEnabled(panelName) |
2082 isRemoved: isEditorPanelRemoved(props.panelName) |
2134 })))(enable_panel_PreferenceBaseOption)); |
2083 }; |
2135 |
2084 }, [props.panelName]); |
2136 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/meta-boxes-section.js |
2085 if (isRemoved) { |
2086 return null; |
|
2087 } |
|
2088 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(enable_panel_PreferenceBaseOption, { |
|
2089 isChecked: isChecked, |
|
2090 onChange: () => toggleEditorPanelEnabled(props.panelName), |
|
2091 ...props |
|
2092 }); |
|
2093 } |
|
2094 |
|
2095 ;// ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/meta-boxes-section.js |
|
2137 /** |
2096 /** |
2138 * WordPress dependencies |
2097 * WordPress dependencies |
2139 */ |
2098 */ |
2140 |
2099 |
2141 |
2100 |
2143 |
2102 |
2144 |
2103 |
2145 /** |
2104 /** |
2146 * Internal dependencies |
2105 * Internal dependencies |
2147 */ |
2106 */ |
2148 |
|
2149 |
2107 |
2150 |
2108 |
2151 |
2109 |
2152 |
2110 |
2153 |
2111 |
2166 if (!areCustomFieldsRegistered && thirdPartyMetaBoxes.length === 0) { |
2124 if (!areCustomFieldsRegistered && thirdPartyMetaBoxes.length === 0) { |
2167 return null; |
2125 return null; |
2168 } |
2126 } |
2169 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(PreferencesModalSection, { |
2127 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(PreferencesModalSection, { |
2170 ...sectionProps, |
2128 ...sectionProps, |
2171 children: [areCustomFieldsRegistered && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(enable_custom_fields, { |
2129 children: [areCustomFieldsRegistered && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EnableCustomFieldsOption, { |
2172 label: (0,external_wp_i18n_namespaceObject.__)('Custom fields') |
2130 label: (0,external_wp_i18n_namespaceObject.__)('Custom fields') |
2173 }), thirdPartyMetaBoxes.map(({ |
2131 }), thirdPartyMetaBoxes.map(({ |
2174 id, |
2132 id, |
2175 title |
2133 title |
2176 }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(enable_panel, { |
2134 }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EnablePanelOption, { |
2177 label: title, |
2135 label: title, |
2178 panelName: `meta-box-${id}` |
2136 panelName: `meta-box-${id}` |
2179 }, id))] |
2137 }, id))] |
2180 }); |
2138 }); |
2181 } |
2139 } |
2191 areCustomFieldsRegistered: getEditorSettings().enableCustomFields !== undefined, |
2149 areCustomFieldsRegistered: getEditorSettings().enableCustomFields !== undefined, |
2192 metaBoxes: getAllMetaBoxes() |
2150 metaBoxes: getAllMetaBoxes() |
2193 }; |
2151 }; |
2194 })(MetaBoxesSection)); |
2152 })(MetaBoxesSection)); |
2195 |
2153 |
2196 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/index.js |
2154 ;// ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/index.js |
2197 /** |
2155 /** |
2198 * WordPress dependencies |
2156 * WordPress dependencies |
2199 */ |
2157 */ |
2200 |
2158 |
2201 |
2159 |
2229 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferencesModal, { |
2187 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferencesModal, { |
2230 extraSections: extraSections |
2188 extraSections: extraSections |
2231 }); |
2189 }); |
2232 } |
2190 } |
2233 |
2191 |
2234 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/more-menu/index.js |
2192 ;// ./node_modules/@wordpress/edit-post/build-module/components/more-menu/index.js |
2235 /** |
2193 /** |
2236 * WordPress dependencies |
2194 * WordPress dependencies |
2237 */ |
2195 */ |
2238 |
2196 |
2239 |
2197 |
2242 |
2200 |
2243 |
2201 |
2244 /** |
2202 /** |
2245 * Internal dependencies |
2203 * Internal dependencies |
2246 */ |
2204 */ |
2247 |
|
2248 |
|
2249 |
2205 |
2250 |
2206 |
2251 |
2207 |
2252 |
2208 |
2253 |
2209 |
2262 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, { |
2218 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, { |
2263 scope: "core/edit-post", |
2219 scope: "core/edit-post", |
2264 name: "fullscreenMode", |
2220 name: "fullscreenMode", |
2265 label: (0,external_wp_i18n_namespaceObject.__)('Fullscreen mode'), |
2221 label: (0,external_wp_i18n_namespaceObject.__)('Fullscreen mode'), |
2266 info: (0,external_wp_i18n_namespaceObject.__)('Show and hide the admin user interface'), |
2222 info: (0,external_wp_i18n_namespaceObject.__)('Show and hide the admin user interface'), |
2267 messageActivated: (0,external_wp_i18n_namespaceObject.__)('Fullscreen mode activated'), |
2223 messageActivated: (0,external_wp_i18n_namespaceObject.__)('Fullscreen mode activated.'), |
2268 messageDeactivated: (0,external_wp_i18n_namespaceObject.__)('Fullscreen mode deactivated'), |
2224 messageDeactivated: (0,external_wp_i18n_namespaceObject.__)('Fullscreen mode deactivated.'), |
2269 shortcut: external_wp_keycodes_namespaceObject.displayShortcut.secondary('f') |
2225 shortcut: external_wp_keycodes_namespaceObject.displayShortcut.secondary('f') |
2270 }) |
2226 }) |
2271 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(ToolsMoreMenuGroup, { |
2227 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(ToolsMoreMenuGroup, { |
2272 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(manage_patterns_menu_item, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideMenuItem, {})] |
2228 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(manage_patterns_menu_item, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideMenuItem, {})] |
2273 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditPostPreferencesModal, {})] |
2229 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditPostPreferencesModal, {})] |
2274 }); |
2230 }); |
2275 }; |
2231 }; |
2276 /* harmony default export */ const more_menu = (MoreMenu); |
2232 /* harmony default export */ const more_menu = (MoreMenu); |
2277 |
2233 |
2278 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/welcome-guide/image.js |
2234 ;// ./node_modules/@wordpress/edit-post/build-module/components/welcome-guide/image.js |
2279 |
|
2280 |
2235 |
2281 function WelcomeGuideImage({ |
2236 function WelcomeGuideImage({ |
2282 nonAnimatedSrc, |
2237 nonAnimatedSrc, |
2283 animatedSrc |
2238 animatedSrc |
2284 }) { |
2239 }) { |
2294 alt: "" |
2249 alt: "" |
2295 })] |
2250 })] |
2296 }); |
2251 }); |
2297 } |
2252 } |
2298 |
2253 |
2299 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/welcome-guide/default.js |
2254 ;// ./node_modules/@wordpress/edit-post/build-module/components/welcome-guide/default.js |
2300 /** |
2255 /** |
2301 * WordPress dependencies |
2256 * WordPress dependencies |
2302 */ |
2257 */ |
2303 |
2258 |
2304 |
2259 |
2306 |
2261 |
2307 |
2262 |
2308 /** |
2263 /** |
2309 * Internal dependencies |
2264 * Internal dependencies |
2310 */ |
2265 */ |
2311 |
|
2312 |
|
2313 |
2266 |
2314 |
2267 |
2315 |
2268 |
2316 function WelcomeGuideDefault() { |
2269 function WelcomeGuideDefault() { |
2317 const { |
2270 const { |
2318 toggleFeature |
2271 toggleFeature |
2319 } = (0,external_wp_data_namespaceObject.useDispatch)(store); |
2272 } = (0,external_wp_data_namespaceObject.useDispatch)(store); |
2320 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Guide, { |
2273 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Guide, { |
2321 className: "edit-post-welcome-guide", |
2274 className: "edit-post-welcome-guide", |
2322 contentLabel: (0,external_wp_i18n_namespaceObject.__)('Welcome to the block editor'), |
2275 contentLabel: (0,external_wp_i18n_namespaceObject.__)('Welcome to the editor'), |
2323 finishButtonText: (0,external_wp_i18n_namespaceObject.__)('Get started'), |
2276 finishButtonText: (0,external_wp_i18n_namespaceObject.__)('Get started'), |
2324 onFinish: () => toggleFeature('welcomeGuide'), |
2277 onFinish: () => toggleFeature('welcomeGuide'), |
2325 pages: [{ |
2278 pages: [{ |
2326 image: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideImage, { |
2279 image: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideImage, { |
2327 nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-canvas.svg", |
2280 nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-canvas.svg", |
2328 animatedSrc: "https://s.w.org/images/block-editor/welcome-canvas.gif" |
2281 animatedSrc: "https://s.w.org/images/block-editor/welcome-canvas.gif" |
2329 }), |
2282 }), |
2330 content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { |
2283 content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { |
2331 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", { |
2284 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", { |
2332 className: "edit-post-welcome-guide__heading", |
2285 className: "edit-post-welcome-guide__heading", |
2333 children: (0,external_wp_i18n_namespaceObject.__)('Welcome to the block editor') |
2286 children: (0,external_wp_i18n_namespaceObject.__)('Welcome to the editor') |
2334 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { |
2287 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { |
2335 className: "edit-post-welcome-guide__text", |
2288 className: "edit-post-welcome-guide__text", |
2336 children: (0,external_wp_i18n_namespaceObject.__)('In the WordPress editor, each paragraph, image, or video is presented as a distinct “block” of content.') |
2289 children: (0,external_wp_i18n_namespaceObject.__)('In the WordPress editor, each paragraph, image, or video is presented as a distinct “block” of content.') |
2337 })] |
2290 })] |
2338 }) |
2291 }) |
2342 animatedSrc: "https://s.w.org/images/block-editor/welcome-editor.gif" |
2295 animatedSrc: "https://s.w.org/images/block-editor/welcome-editor.gif" |
2343 }), |
2296 }), |
2344 content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { |
2297 content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { |
2345 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", { |
2298 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", { |
2346 className: "edit-post-welcome-guide__heading", |
2299 className: "edit-post-welcome-guide__heading", |
2347 children: (0,external_wp_i18n_namespaceObject.__)('Make each block your own') |
2300 children: (0,external_wp_i18n_namespaceObject.__)('Customize each block') |
2348 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { |
2301 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { |
2349 className: "edit-post-welcome-guide__text", |
2302 className: "edit-post-welcome-guide__text", |
2350 children: (0,external_wp_i18n_namespaceObject.__)('Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected.') |
2303 children: (0,external_wp_i18n_namespaceObject.__)('Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected.') |
2351 })] |
2304 })] |
2352 }) |
2305 }) |
2356 animatedSrc: "https://s.w.org/images/block-editor/welcome-library.gif" |
2309 animatedSrc: "https://s.w.org/images/block-editor/welcome-library.gif" |
2357 }), |
2310 }), |
2358 content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { |
2311 content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { |
2359 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", { |
2312 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", { |
2360 className: "edit-post-welcome-guide__heading", |
2313 className: "edit-post-welcome-guide__heading", |
2361 children: (0,external_wp_i18n_namespaceObject.__)('Get to know the block library') |
2314 children: (0,external_wp_i18n_namespaceObject.__)('Explore all blocks') |
2362 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { |
2315 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { |
2363 className: "edit-post-welcome-guide__text", |
2316 className: "edit-post-welcome-guide__text", |
2364 children: (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('All of the blocks available to you live in the block library. You’ll find it wherever you see the <InserterIconImage /> icon.'), { |
2317 children: (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('All of the blocks available to you live in the block library. You’ll find it wherever you see the <InserterIconImage /> icon.'), { |
2365 InserterIconImage: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { |
2318 InserterIconImage: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { |
2366 alt: (0,external_wp_i18n_namespaceObject.__)('inserter'), |
2319 alt: (0,external_wp_i18n_namespaceObject.__)('inserter'), |
2375 animatedSrc: "https://s.w.org/images/block-editor/welcome-documentation.gif" |
2328 animatedSrc: "https://s.w.org/images/block-editor/welcome-documentation.gif" |
2376 }), |
2329 }), |
2377 content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { |
2330 content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { |
2378 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", { |
2331 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", { |
2379 className: "edit-post-welcome-guide__heading", |
2332 className: "edit-post-welcome-guide__heading", |
2380 children: (0,external_wp_i18n_namespaceObject.__)('Learn how to use the block editor') |
2333 children: (0,external_wp_i18n_namespaceObject.__)('Learn more') |
2381 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("p", { |
2334 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { |
2382 className: "edit-post-welcome-guide__text", |
2335 className: "edit-post-welcome-guide__text", |
2383 children: [(0,external_wp_i18n_namespaceObject.__)('New to the block editor? Want to learn more about using it? '), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, { |
2336 children: (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)("New to the block editor? Want to learn more about using it? <a>Here's a detailed guide.</a>"), { |
2384 href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/documentation/article/wordpress-block-editor/'), |
2337 a: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, { |
2385 children: (0,external_wp_i18n_namespaceObject.__)("Here's a detailed guide.") |
2338 href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/documentation/article/wordpress-block-editor/') |
2386 })] |
2339 }) |
2340 }) |
|
2387 })] |
2341 })] |
2388 }) |
2342 }) |
2389 }] |
2343 }] |
2390 }); |
2344 }); |
2391 } |
2345 } |
2392 |
2346 |
2393 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/welcome-guide/template.js |
2347 ;// ./node_modules/@wordpress/edit-post/build-module/components/welcome-guide/template.js |
2394 /** |
2348 /** |
2395 * WordPress dependencies |
2349 * WordPress dependencies |
2396 */ |
2350 */ |
2397 |
2351 |
2398 |
2352 |
2399 |
2353 |
2400 |
2354 |
2401 /** |
2355 /** |
2402 * Internal dependencies |
2356 * Internal dependencies |
2403 */ |
2357 */ |
2404 |
|
2405 |
|
2406 |
2358 |
2407 |
2359 |
2408 |
2360 |
2409 function WelcomeGuideTemplate() { |
2361 function WelcomeGuideTemplate() { |
2410 const { |
2362 const { |
2431 }) |
2383 }) |
2432 }] |
2384 }] |
2433 }); |
2385 }); |
2434 } |
2386 } |
2435 |
2387 |
2436 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/welcome-guide/index.js |
2388 ;// ./node_modules/@wordpress/edit-post/build-module/components/welcome-guide/index.js |
2437 /** |
2389 /** |
2438 * WordPress dependencies |
2390 * WordPress dependencies |
2439 */ |
2391 */ |
2440 |
2392 |
2441 |
2393 |
2442 |
|
2443 /** |
2394 /** |
2444 * Internal dependencies |
2395 * Internal dependencies |
2445 */ |
2396 */ |
2446 |
2397 |
2447 |
2398 |
2448 |
2399 |
2449 |
2400 |
2450 function WelcomeGuide() { |
2401 function WelcomeGuide({ |
2402 postType |
|
2403 }) { |
|
2451 const { |
2404 const { |
2452 isActive, |
2405 isActive, |
2453 isEditingTemplate |
2406 isEditingTemplate |
2454 } = (0,external_wp_data_namespaceObject.useSelect)(select => { |
2407 } = (0,external_wp_data_namespaceObject.useSelect)(select => { |
2455 const { |
2408 const { |
2456 isFeatureActive |
2409 isFeatureActive |
2457 } = select(store); |
2410 } = select(store); |
2458 const { |
2411 const _isEditingTemplate = postType === 'wp_template'; |
2459 getCurrentPostType |
|
2460 } = select(external_wp_editor_namespaceObject.store); |
|
2461 const _isEditingTemplate = getCurrentPostType() === 'wp_template'; |
|
2462 const feature = _isEditingTemplate ? 'welcomeGuideTemplate' : 'welcomeGuide'; |
2412 const feature = _isEditingTemplate ? 'welcomeGuideTemplate' : 'welcomeGuide'; |
2463 return { |
2413 return { |
2464 isActive: isFeatureActive(feature), |
2414 isActive: isFeatureActive(feature), |
2465 isEditingTemplate: _isEditingTemplate |
2415 isEditingTemplate: _isEditingTemplate |
2466 }; |
2416 }; |
2467 }, []); |
2417 }, [postType]); |
2468 if (!isActive) { |
2418 if (!isActive) { |
2469 return null; |
2419 return null; |
2470 } |
2420 } |
2471 return isEditingTemplate ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideTemplate, {}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideDefault, {}); |
2421 return isEditingTemplate ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideTemplate, {}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideDefault, {}); |
2472 } |
2422 } |
2473 |
2423 |
2474 ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/fullscreen.js |
2424 ;// ./node_modules/@wordpress/icons/build-module/library/fullscreen.js |
2475 /** |
2425 /** |
2476 * WordPress dependencies |
2426 * WordPress dependencies |
2477 */ |
2427 */ |
2478 |
2428 |
2479 |
2429 |
2484 d: "M6 4a2 2 0 0 0-2 2v3h1.5V6a.5.5 0 0 1 .5-.5h3V4H6Zm3 14.5H6a.5.5 0 0 1-.5-.5v-3H4v3a2 2 0 0 0 2 2h3v-1.5Zm6 1.5v-1.5h3a.5.5 0 0 0 .5-.5v-3H20v3a2 2 0 0 1-2 2h-3Zm3-16a2 2 0 0 1 2 2v3h-1.5V6a.5.5 0 0 0-.5-.5h-3V4h3Z" |
2434 d: "M6 4a2 2 0 0 0-2 2v3h1.5V6a.5.5 0 0 1 .5-.5h3V4H6Zm3 14.5H6a.5.5 0 0 1-.5-.5v-3H4v3a2 2 0 0 0 2 2h3v-1.5Zm6 1.5v-1.5h3a.5.5 0 0 0 .5-.5v-3H20v3a2 2 0 0 1-2 2h-3Zm3-16a2 2 0 0 1 2 2v3h-1.5V6a.5.5 0 0 0-.5-.5h-3V4h3Z" |
2485 }) |
2435 }) |
2486 }); |
2436 }); |
2487 /* harmony default export */ const library_fullscreen = (fullscreen); |
2437 /* harmony default export */ const library_fullscreen = (fullscreen); |
2488 |
2438 |
2489 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/commands/use-commands.js |
2439 ;// ./node_modules/@wordpress/edit-post/build-module/commands/use-commands.js |
2490 /** |
2440 /** |
2491 * WordPress dependencies |
2441 * WordPress dependencies |
2492 */ |
2442 */ |
2493 |
2443 |
2494 |
2444 |
2534 }); |
2484 }); |
2535 } |
2485 } |
2536 }); |
2486 }); |
2537 } |
2487 } |
2538 |
2488 |
2539 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/layout/use-padding-appender.js |
2489 ;// ./node_modules/@wordpress/edit-post/build-module/components/layout/use-padding-appender.js |
2540 /** |
2490 /** |
2541 * WordPress dependencies |
2491 * WordPress dependencies |
2542 */ |
2492 */ |
2543 |
2493 |
2544 |
2494 |
2545 |
2495 |
2546 |
2496 |
2547 function usePaddingAppender() { |
2497 |
2498 // Ruleset to add space for the typewriter effect. When typing in the last |
|
2499 // block, there needs to be room to scroll up. |
|
2500 const CSS = ':root :where(.editor-styles-wrapper)::after {content: ""; display: block; height: 40vh;}'; |
|
2501 function usePaddingAppender(enabled) { |
|
2548 const registry = (0,external_wp_data_namespaceObject.useRegistry)(); |
2502 const registry = (0,external_wp_data_namespaceObject.useRegistry)(); |
2549 return (0,external_wp_compose_namespaceObject.useRefEffect)(node => { |
2503 const effect = (0,external_wp_compose_namespaceObject.useRefEffect)(node => { |
2550 function onMouseDown(event) { |
2504 function onMouseDown(event) { |
2551 if (event.target !== node) { |
2505 if (event.target !== node && |
2552 return; |
2506 // Tests for the parent element because in the iframed editor if the click is |
2553 } |
2507 // below the padding the target will be the parent element (html) and should |
2554 const { |
2508 // still be treated as intent to append. |
2555 ownerDocument |
2509 event.target !== node.parentElement) { |
2556 } = node; |
|
2557 const { |
|
2558 defaultView |
|
2559 } = ownerDocument; |
|
2560 const pseudoHeight = defaultView.parseInt(defaultView.getComputedStyle(node, ':after').height, 10); |
|
2561 if (!pseudoHeight) { |
|
2562 return; |
2510 return; |
2563 } |
2511 } |
2564 |
2512 |
2565 // Only handle clicks under the last child. |
2513 // Only handle clicks under the last child. |
2566 const lastChild = node.lastElementChild; |
2514 const lastChild = node.lastElementChild; |
2569 } |
2517 } |
2570 const lastChildRect = lastChild.getBoundingClientRect(); |
2518 const lastChildRect = lastChild.getBoundingClientRect(); |
2571 if (event.clientY < lastChildRect.bottom) { |
2519 if (event.clientY < lastChildRect.bottom) { |
2572 return; |
2520 return; |
2573 } |
2521 } |
2574 event.stopPropagation(); |
2522 event.preventDefault(); |
2575 const blockOrder = registry.select(external_wp_blockEditor_namespaceObject.store).getBlockOrder(''); |
2523 const blockOrder = registry.select(external_wp_blockEditor_namespaceObject.store).getBlockOrder(''); |
2576 const lastBlockClientId = blockOrder[blockOrder.length - 1]; |
2524 const lastBlockClientId = blockOrder[blockOrder.length - 1]; |
2577 const lastBlock = registry.select(external_wp_blockEditor_namespaceObject.store).getBlock(lastBlockClientId); |
2525 const lastBlock = registry.select(external_wp_blockEditor_namespaceObject.store).getBlock(lastBlockClientId); |
2578 const { |
2526 const { |
2579 selectBlock, |
2527 selectBlock, |
2583 selectBlock(lastBlockClientId); |
2531 selectBlock(lastBlockClientId); |
2584 } else { |
2532 } else { |
2585 insertDefaultBlock(); |
2533 insertDefaultBlock(); |
2586 } |
2534 } |
2587 } |
2535 } |
2588 node.addEventListener('mousedown', onMouseDown); |
2536 const { |
2537 ownerDocument |
|
2538 } = node; |
|
2539 // Adds the listener on the document so that in the iframed editor clicks below the |
|
2540 // padding can be handled as they too should be treated as intent to append. |
|
2541 ownerDocument.addEventListener('mousedown', onMouseDown); |
|
2589 return () => { |
2542 return () => { |
2590 node.removeEventListener('mousedown', onMouseDown); |
2543 ownerDocument.removeEventListener('mousedown', onMouseDown); |
2591 }; |
2544 }; |
2592 }, [registry]); |
2545 }, [registry]); |
2593 } |
2546 return enabled ? [effect, CSS] : []; |
2594 |
2547 } |
2595 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/layout/use-should-iframe.js |
2548 |
2549 ;// ./node_modules/@wordpress/edit-post/build-module/components/layout/use-should-iframe.js |
|
2596 /** |
2550 /** |
2597 * WordPress dependencies |
2551 * WordPress dependencies |
2598 */ |
2552 */ |
2553 |
|
2599 |
2554 |
2600 |
2555 |
2601 |
2556 |
2602 |
2557 |
2603 /** |
2558 /** |
2604 * Internal dependencies |
2559 * Internal dependencies |
2605 */ |
2560 */ |
2606 |
2561 |
2607 const isGutenbergPlugin = false ? 0 : false; |
2562 const isGutenbergPlugin = false ? 0 : false; |
2608 function useShouldIframe() { |
2563 function useShouldIframe() { |
2609 const { |
2564 return (0,external_wp_data_namespaceObject.useSelect)(select => { |
2610 isBlockBasedTheme, |
|
2611 hasV3BlocksOnly, |
|
2612 isEditingTemplate, |
|
2613 hasMetaBoxes |
|
2614 } = (0,external_wp_data_namespaceObject.useSelect)(select => { |
|
2615 const { |
2565 const { |
2616 getEditorSettings, |
2566 getEditorSettings, |
2617 getCurrentPostType |
2567 getCurrentPostType, |
2568 getDeviceType |
|
2618 } = select(external_wp_editor_namespaceObject.store); |
2569 } = select(external_wp_editor_namespaceObject.store); |
2619 const { |
2570 return ( |
2620 getBlockTypes |
2571 // If the theme is block based and the Gutenberg plugin is active, |
2621 } = select(external_wp_blocks_namespaceObject.store); |
2572 // we ALWAYS use the iframe for consistency across the post and site |
2622 const editorSettings = getEditorSettings(); |
2573 // editor. |
2623 return { |
2574 isGutenbergPlugin && getEditorSettings().__unstableIsBlockBasedTheme || |
2624 isBlockBasedTheme: editorSettings.__unstableIsBlockBasedTheme, |
2575 // We also still want to iframe all the special |
2625 hasV3BlocksOnly: getBlockTypes().every(type => { |
2576 // editor features and modes such as device previews, zoom out, and |
2626 return type.apiVersion >= 3; |
2577 // template/pattern editing. |
2627 }), |
2578 getDeviceType() !== 'Desktop' || ['wp_template', 'wp_block'].includes(getCurrentPostType()) || unlock(select(external_wp_blockEditor_namespaceObject.store)).isZoomOut() || |
2628 isEditingTemplate: getCurrentPostType() === 'wp_template', |
2579 // Finally, still iframe the editor if all blocks are v3 (which means |
2629 hasMetaBoxes: select(store).hasMetaBoxes() |
2580 // they are marked as iframe-compatible). |
2630 }; |
2581 select(external_wp_blocks_namespaceObject.store).getBlockTypes().every(type => type.apiVersion >= 3) |
2582 ); |
|
2631 }, []); |
2583 }, []); |
2632 return (hasV3BlocksOnly || isGutenbergPlugin && isBlockBasedTheme) && !hasMetaBoxes || isEditingTemplate; |
2584 } |
2633 } |
2585 |
2634 |
2586 ;// ./node_modules/@wordpress/edit-post/build-module/hooks/use-navigate-to-entity-record.js |
2635 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/layout/index.js |
|
2636 /** |
|
2637 * External dependencies |
|
2638 */ |
|
2639 |
|
2640 |
|
2641 /** |
|
2642 * WordPress dependencies |
|
2643 */ |
|
2644 |
|
2645 |
|
2646 |
|
2647 |
|
2648 |
|
2649 |
|
2650 |
|
2651 |
|
2652 |
|
2653 |
|
2654 |
|
2655 |
|
2656 |
|
2657 |
|
2658 /** |
|
2659 * Internal dependencies |
|
2660 */ |
|
2661 |
|
2662 |
|
2663 |
|
2664 |
|
2665 |
|
2666 |
|
2667 |
|
2668 |
|
2669 |
|
2670 |
|
2671 |
|
2672 |
|
2673 |
|
2674 |
|
2675 |
|
2676 const { |
|
2677 getLayoutStyles |
|
2678 } = unlock(external_wp_blockEditor_namespaceObject.privateApis); |
|
2679 const { |
|
2680 useCommands: layout_useCommands |
|
2681 } = unlock(external_wp_coreCommands_namespaceObject.privateApis); |
|
2682 const { |
|
2683 useCommandContext |
|
2684 } = unlock(external_wp_commands_namespaceObject.privateApis); |
|
2685 const { |
|
2686 EditorInterface, |
|
2687 FullscreenMode, |
|
2688 Sidebar |
|
2689 } = unlock(external_wp_editor_namespaceObject.privateApis); |
|
2690 const { |
|
2691 BlockKeyboardShortcuts |
|
2692 } = unlock(external_wp_blockLibrary_namespaceObject.privateApis); |
|
2693 const DESIGN_POST_TYPES = ['wp_template', 'wp_template_part', 'wp_block', 'wp_navigation']; |
|
2694 function useEditorStyles() { |
|
2695 const { |
|
2696 hasThemeStyleSupport, |
|
2697 editorSettings, |
|
2698 isZoomedOutView, |
|
2699 renderingMode, |
|
2700 postType |
|
2701 } = (0,external_wp_data_namespaceObject.useSelect)(select => { |
|
2702 const { |
|
2703 __unstableGetEditorMode |
|
2704 } = select(external_wp_blockEditor_namespaceObject.store); |
|
2705 const { |
|
2706 getCurrentPostType, |
|
2707 getRenderingMode |
|
2708 } = select(external_wp_editor_namespaceObject.store); |
|
2709 const _postType = getCurrentPostType(); |
|
2710 return { |
|
2711 hasThemeStyleSupport: select(store).isFeatureActive('themeStyles'), |
|
2712 editorSettings: select(external_wp_editor_namespaceObject.store).getEditorSettings(), |
|
2713 isZoomedOutView: __unstableGetEditorMode() === 'zoom-out', |
|
2714 renderingMode: getRenderingMode(), |
|
2715 postType: _postType |
|
2716 }; |
|
2717 }, []); |
|
2718 |
|
2719 // Compute the default styles. |
|
2720 return (0,external_wp_element_namespaceObject.useMemo)(() => { |
|
2721 var _editorSettings$style, _editorSettings$style2, _editorSettings$style3; |
|
2722 const presetStyles = (_editorSettings$style = editorSettings.styles?.filter(style => style.__unstableType && style.__unstableType !== 'theme')) !== null && _editorSettings$style !== void 0 ? _editorSettings$style : []; |
|
2723 const defaultEditorStyles = [...editorSettings.defaultEditorStyles, ...presetStyles]; |
|
2724 |
|
2725 // Has theme styles if the theme supports them and if some styles were not preset styles (in which case they're theme styles). |
|
2726 const hasThemeStyles = hasThemeStyleSupport && presetStyles.length !== ((_editorSettings$style2 = editorSettings.styles?.length) !== null && _editorSettings$style2 !== void 0 ? _editorSettings$style2 : 0); |
|
2727 |
|
2728 // If theme styles are not present or displayed, ensure that |
|
2729 // base layout styles are still present in the editor. |
|
2730 if (!editorSettings.disableLayoutStyles && !hasThemeStyles) { |
|
2731 defaultEditorStyles.push({ |
|
2732 css: getLayoutStyles({ |
|
2733 style: {}, |
|
2734 selector: 'body', |
|
2735 hasBlockGapSupport: false, |
|
2736 hasFallbackGapSupport: true, |
|
2737 fallbackGapValue: '0.5em' |
|
2738 }) |
|
2739 }); |
|
2740 } |
|
2741 const baseStyles = hasThemeStyles ? (_editorSettings$style3 = editorSettings.styles) !== null && _editorSettings$style3 !== void 0 ? _editorSettings$style3 : [] : defaultEditorStyles; |
|
2742 |
|
2743 // Add a space for the typewriter effect. When typing in the last block, |
|
2744 // there needs to be room to scroll up. |
|
2745 if (!isZoomedOutView && renderingMode === 'post-only' && !DESIGN_POST_TYPES.includes(postType)) { |
|
2746 return [...baseStyles, { |
|
2747 css: ':root :where(.editor-styles-wrapper)::after {content: ""; display: block; height: 40vh;}' |
|
2748 }]; |
|
2749 } |
|
2750 return baseStyles; |
|
2751 }, [editorSettings.defaultEditorStyles, editorSettings.disableLayoutStyles, editorSettings.styles, hasThemeStyleSupport, postType]); |
|
2752 } |
|
2753 function Layout({ |
|
2754 initialPost |
|
2755 }) { |
|
2756 layout_useCommands(); |
|
2757 useCommands(); |
|
2758 const paddingAppenderRef = usePaddingAppender(); |
|
2759 const shouldIframe = useShouldIframe(); |
|
2760 const { |
|
2761 createErrorNotice |
|
2762 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); |
|
2763 const { |
|
2764 mode, |
|
2765 isFullscreenActive, |
|
2766 hasActiveMetaboxes, |
|
2767 hasBlockSelected, |
|
2768 showIconLabels, |
|
2769 isDistractionFree, |
|
2770 showMetaBoxes, |
|
2771 hasHistory, |
|
2772 isEditingTemplate, |
|
2773 isWelcomeGuideVisible |
|
2774 } = (0,external_wp_data_namespaceObject.useSelect)(select => { |
|
2775 const { |
|
2776 get |
|
2777 } = select(external_wp_preferences_namespaceObject.store); |
|
2778 const { |
|
2779 getEditorSettings |
|
2780 } = select(external_wp_editor_namespaceObject.store); |
|
2781 const { |
|
2782 isFeatureActive |
|
2783 } = select(store); |
|
2784 return { |
|
2785 mode: select(external_wp_editor_namespaceObject.store).getEditorMode(), |
|
2786 isFullscreenActive: select(store).isFeatureActive('fullscreenMode'), |
|
2787 hasActiveMetaboxes: select(store).hasMetaBoxes(), |
|
2788 hasBlockSelected: !!select(external_wp_blockEditor_namespaceObject.store).getBlockSelectionStart(), |
|
2789 showIconLabels: get('core', 'showIconLabels'), |
|
2790 isDistractionFree: get('core', 'distractionFree'), |
|
2791 showMetaBoxes: select(external_wp_editor_namespaceObject.store).getRenderingMode() === 'post-only', |
|
2792 hasHistory: !!getEditorSettings().onNavigateToPreviousEntityRecord, |
|
2793 isEditingTemplate: select(external_wp_editor_namespaceObject.store).getCurrentPostType() === 'wp_template', |
|
2794 isWelcomeGuideVisible: isFeatureActive('welcomeGuide') |
|
2795 }; |
|
2796 }, []); |
|
2797 |
|
2798 // Set the right context for the command palette |
|
2799 const commandContext = hasBlockSelected ? 'block-selection-edit' : 'entity-edit'; |
|
2800 useCommandContext(commandContext); |
|
2801 const styles = useEditorStyles(); |
|
2802 |
|
2803 // We need to add the show-icon-labels class to the body element so it is applied to modals. |
|
2804 if (showIconLabels) { |
|
2805 document.body.classList.add('show-icon-labels'); |
|
2806 } else { |
|
2807 document.body.classList.remove('show-icon-labels'); |
|
2808 } |
|
2809 const className = dist_clsx('edit-post-layout', 'is-mode-' + mode, { |
|
2810 'has-metaboxes': hasActiveMetaboxes |
|
2811 }); |
|
2812 function onPluginAreaError(name) { |
|
2813 createErrorNotice((0,external_wp_i18n_namespaceObject.sprintf)( /* translators: %s: plugin name */ |
|
2814 (0,external_wp_i18n_namespaceObject.__)('The "%s" plugin has encountered an error and cannot be rendered.'), name)); |
|
2815 } |
|
2816 const { |
|
2817 createSuccessNotice |
|
2818 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); |
|
2819 const onActionPerformed = (0,external_wp_element_namespaceObject.useCallback)((actionId, items) => { |
|
2820 switch (actionId) { |
|
2821 case 'move-to-trash': |
|
2822 { |
|
2823 document.location.href = (0,external_wp_url_namespaceObject.addQueryArgs)('edit.php', { |
|
2824 trashed: 1, |
|
2825 post_type: items[0].type, |
|
2826 ids: items[0].id |
|
2827 }); |
|
2828 } |
|
2829 break; |
|
2830 case 'duplicate-post': |
|
2831 { |
|
2832 const newItem = items[0]; |
|
2833 const title = typeof newItem.title === 'string' ? newItem.title : newItem.title?.rendered; |
|
2834 createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)( |
|
2835 // translators: %s: Title of the created post e.g: "Post 1". |
|
2836 (0,external_wp_i18n_namespaceObject.__)('"%s" successfully created.'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title)), { |
|
2837 type: 'snackbar', |
|
2838 id: 'duplicate-post-action', |
|
2839 actions: [{ |
|
2840 label: (0,external_wp_i18n_namespaceObject.__)('Edit'), |
|
2841 onClick: () => { |
|
2842 const postId = newItem.id; |
|
2843 document.location.href = (0,external_wp_url_namespaceObject.addQueryArgs)('post.php', { |
|
2844 post: postId, |
|
2845 action: 'edit' |
|
2846 }); |
|
2847 } |
|
2848 }] |
|
2849 }); |
|
2850 } |
|
2851 break; |
|
2852 } |
|
2853 }, [createSuccessNotice]); |
|
2854 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { |
|
2855 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FullscreenMode, { |
|
2856 isActive: isFullscreenActive |
|
2857 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(browser_url, { |
|
2858 hasHistory: hasHistory |
|
2859 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.UnsavedChangesWarning, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.AutosaveMonitor, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.LocalAutosaveMonitor, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(keyboard_shortcuts, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.EditorKeyboardShortcutsRegister, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockKeyboardShortcuts, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuide, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InitPatternModal, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_plugins_namespaceObject.PluginArea, { |
|
2860 onError: onPluginAreaError |
|
2861 }), !isDistractionFree && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Sidebar, { |
|
2862 onActionPerformed: onActionPerformed, |
|
2863 extraPanels: !isEditingTemplate && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MetaBoxes, { |
|
2864 location: "side" |
|
2865 }) |
|
2866 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(more_menu, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(back_button, { |
|
2867 initialPost: initialPost |
|
2868 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.EditorSnackbars, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditorInterface, { |
|
2869 className: className, |
|
2870 styles: styles, |
|
2871 forceIsDirty: hasActiveMetaboxes, |
|
2872 contentRef: paddingAppenderRef, |
|
2873 disableIframe: !shouldIframe |
|
2874 // We should auto-focus the canvas (title) on load. |
|
2875 // eslint-disable-next-line jsx-a11y/no-autofocus |
|
2876 , |
|
2877 autoFocus: !isWelcomeGuideVisible, |
|
2878 children: !isDistractionFree && showMetaBoxes && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { |
|
2879 className: "edit-post-layout__metaboxes", |
|
2880 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MetaBoxes, { |
|
2881 location: "normal" |
|
2882 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MetaBoxes, { |
|
2883 location: "advanced" |
|
2884 })] |
|
2885 }) |
|
2886 })] |
|
2887 }); |
|
2888 } |
|
2889 /* harmony default export */ const layout = (Layout); |
|
2890 |
|
2891 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/editor-initialization/listener-hooks.js |
|
2892 /** |
|
2893 * WordPress dependencies |
|
2894 */ |
|
2895 |
|
2896 |
|
2897 |
|
2898 |
|
2899 /** |
|
2900 * Internal dependencies |
|
2901 */ |
|
2902 |
|
2903 |
|
2904 /** |
|
2905 * This listener hook monitors any change in permalink and updates the view |
|
2906 * post link in the admin bar. |
|
2907 */ |
|
2908 const useUpdatePostLinkListener = () => { |
|
2909 const { |
|
2910 newPermalink |
|
2911 } = (0,external_wp_data_namespaceObject.useSelect)(select => ({ |
|
2912 newPermalink: select(external_wp_editor_namespaceObject.store).getCurrentPost().link |
|
2913 }), []); |
|
2914 const nodeToUpdate = (0,external_wp_element_namespaceObject.useRef)(); |
|
2915 (0,external_wp_element_namespaceObject.useEffect)(() => { |
|
2916 nodeToUpdate.current = document.querySelector(VIEW_AS_PREVIEW_LINK_SELECTOR) || document.querySelector(VIEW_AS_LINK_SELECTOR); |
|
2917 }, []); |
|
2918 (0,external_wp_element_namespaceObject.useEffect)(() => { |
|
2919 if (!newPermalink || !nodeToUpdate.current) { |
|
2920 return; |
|
2921 } |
|
2922 nodeToUpdate.current.setAttribute('href', newPermalink); |
|
2923 }, [newPermalink]); |
|
2924 }; |
|
2925 |
|
2926 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/components/editor-initialization/index.js |
|
2927 /** |
|
2928 * Internal dependencies |
|
2929 */ |
|
2930 |
|
2931 |
|
2932 /** |
|
2933 * Data component used for initializing the editor and re-initializes |
|
2934 * when postId changes or on unmount. |
|
2935 * |
|
2936 * @return {null} This is a data component so does not render any ui. |
|
2937 */ |
|
2938 function EditorInitialization() { |
|
2939 useUpdatePostLinkListener(); |
|
2940 return null; |
|
2941 } |
|
2942 |
|
2943 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/hooks/use-navigate-to-entity-record.js |
|
2944 /** |
2587 /** |
2945 * WordPress dependencies |
2588 * WordPress dependencies |
2946 */ |
2589 */ |
2947 |
2590 |
2948 |
2591 |
3023 onNavigateToEntityRecord, |
2666 onNavigateToEntityRecord, |
3024 onNavigateToPreviousEntityRecord: postHistory.length > 1 ? onNavigateToPreviousEntityRecord : undefined |
2667 onNavigateToPreviousEntityRecord: postHistory.length > 1 ? onNavigateToPreviousEntityRecord : undefined |
3025 }; |
2668 }; |
3026 } |
2669 } |
3027 |
2670 |
3028 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/editor.js |
2671 ;// ./node_modules/@wordpress/edit-post/build-module/components/meta-boxes/use-meta-box-initialization.js |
3029 /** |
2672 /** |
3030 * WordPress dependencies |
2673 * WordPress dependencies |
3031 */ |
2674 */ |
3032 |
2675 |
3033 |
2676 |
3034 |
2677 |
3035 |
2678 |
3036 |
|
3037 |
|
3038 |
|
3039 /** |
2679 /** |
3040 * Internal dependencies |
2680 * Internal dependencies |
3041 */ |
2681 */ |
3042 |
2682 |
3043 |
2683 |
2684 /** |
|
2685 * Initializes WordPress `postboxes` script and the logic for saving meta boxes. |
|
2686 * |
|
2687 * @param { boolean } enabled |
|
2688 */ |
|
2689 const useMetaBoxInitialization = enabled => { |
|
2690 const isEnabledAndEditorReady = (0,external_wp_data_namespaceObject.useSelect)(select => enabled && select(external_wp_editor_namespaceObject.store).__unstableIsEditorReady(), [enabled]); |
|
2691 const { |
|
2692 initializeMetaBoxes |
|
2693 } = (0,external_wp_data_namespaceObject.useDispatch)(store); |
|
2694 // The effect has to rerun when the editor is ready because initializeMetaBoxes |
|
2695 // will noop until then. |
|
2696 (0,external_wp_element_namespaceObject.useEffect)(() => { |
|
2697 if (isEnabledAndEditorReady) { |
|
2698 initializeMetaBoxes(); |
|
2699 } |
|
2700 }, [isEnabledAndEditorReady, initializeMetaBoxes]); |
|
2701 }; |
|
2702 |
|
2703 ;// ./node_modules/@wordpress/edit-post/build-module/components/layout/index.js |
|
2704 /** |
|
2705 * External dependencies |
|
2706 */ |
|
2707 |
|
2708 |
|
2709 /** |
|
2710 * WordPress dependencies |
|
2711 */ |
|
2712 |
|
2713 |
|
2714 |
|
2715 |
|
2716 |
|
2717 |
|
2718 |
|
2719 |
|
2720 |
|
2721 |
|
2722 |
|
2723 |
|
2724 |
|
2725 |
|
2726 |
|
2727 |
|
2728 |
|
2729 |
|
2730 /** |
|
2731 * Internal dependencies |
|
2732 */ |
|
2733 |
|
2734 |
|
2735 |
|
2736 |
|
2737 |
|
2738 |
|
2739 |
|
2740 |
|
2741 |
|
2742 |
|
2743 |
|
3044 |
2744 |
3045 |
2745 |
3046 |
2746 |
3047 |
2747 |
3048 |
2748 |
3049 const { |
2749 const { |
3050 ExperimentalEditorProvider |
2750 getLayoutStyles |
2751 } = unlock(external_wp_blockEditor_namespaceObject.privateApis); |
|
2752 const { |
|
2753 useCommands: layout_useCommands |
|
2754 } = unlock(external_wp_coreCommands_namespaceObject.privateApis); |
|
2755 const { |
|
2756 useCommandContext |
|
2757 } = unlock(external_wp_commands_namespaceObject.privateApis); |
|
2758 const { |
|
2759 Editor, |
|
2760 FullscreenMode, |
|
2761 NavigableRegion |
|
3051 } = unlock(external_wp_editor_namespaceObject.privateApis); |
2762 } = unlock(external_wp_editor_namespaceObject.privateApis); |
3052 function Editor({ |
2763 const { |
2764 BlockKeyboardShortcuts |
|
2765 } = unlock(external_wp_blockLibrary_namespaceObject.privateApis); |
|
2766 const DESIGN_POST_TYPES = ['wp_template', 'wp_template_part', 'wp_block', 'wp_navigation']; |
|
2767 function useEditorStyles(...additionalStyles) { |
|
2768 const { |
|
2769 hasThemeStyleSupport, |
|
2770 editorSettings |
|
2771 } = (0,external_wp_data_namespaceObject.useSelect)(select => { |
|
2772 return { |
|
2773 hasThemeStyleSupport: select(store).isFeatureActive('themeStyles'), |
|
2774 editorSettings: select(external_wp_editor_namespaceObject.store).getEditorSettings() |
|
2775 }; |
|
2776 }, []); |
|
2777 const addedStyles = additionalStyles.join('\n'); |
|
2778 |
|
2779 // Compute the default styles. |
|
2780 return (0,external_wp_element_namespaceObject.useMemo)(() => { |
|
2781 var _editorSettings$style, _editorSettings$defau, _editorSettings$style2, _editorSettings$style3; |
|
2782 const presetStyles = (_editorSettings$style = editorSettings.styles?.filter(style => style.__unstableType && style.__unstableType !== 'theme')) !== null && _editorSettings$style !== void 0 ? _editorSettings$style : []; |
|
2783 const defaultEditorStyles = [...((_editorSettings$defau = editorSettings?.defaultEditorStyles) !== null && _editorSettings$defau !== void 0 ? _editorSettings$defau : []), ...presetStyles]; |
|
2784 |
|
2785 // Has theme styles if the theme supports them and if some styles were not preset styles (in which case they're theme styles). |
|
2786 const hasThemeStyles = hasThemeStyleSupport && presetStyles.length !== ((_editorSettings$style2 = editorSettings.styles?.length) !== null && _editorSettings$style2 !== void 0 ? _editorSettings$style2 : 0); |
|
2787 |
|
2788 // If theme styles are not present or displayed, ensure that |
|
2789 // base layout styles are still present in the editor. |
|
2790 if (!editorSettings.disableLayoutStyles && !hasThemeStyles) { |
|
2791 defaultEditorStyles.push({ |
|
2792 css: getLayoutStyles({ |
|
2793 style: {}, |
|
2794 selector: 'body', |
|
2795 hasBlockGapSupport: false, |
|
2796 hasFallbackGapSupport: true, |
|
2797 fallbackGapValue: '0.5em' |
|
2798 }) |
|
2799 }); |
|
2800 } |
|
2801 const baseStyles = hasThemeStyles ? (_editorSettings$style3 = editorSettings.styles) !== null && _editorSettings$style3 !== void 0 ? _editorSettings$style3 : [] : defaultEditorStyles; |
|
2802 if (addedStyles) { |
|
2803 return [...baseStyles, { |
|
2804 css: addedStyles |
|
2805 }]; |
|
2806 } |
|
2807 return baseStyles; |
|
2808 }, [editorSettings.defaultEditorStyles, editorSettings.disableLayoutStyles, editorSettings.styles, hasThemeStyleSupport, addedStyles]); |
|
2809 } |
|
2810 |
|
2811 /** |
|
2812 * @param {Object} props |
|
2813 * @param {boolean} props.isLegacy True when the editor canvas is not in an iframe. |
|
2814 */ |
|
2815 function MetaBoxesMain({ |
|
2816 isLegacy |
|
2817 }) { |
|
2818 const [isOpen, openHeight, hasAnyVisible] = (0,external_wp_data_namespaceObject.useSelect)(select => { |
|
2819 const { |
|
2820 get |
|
2821 } = select(external_wp_preferences_namespaceObject.store); |
|
2822 const { |
|
2823 isMetaBoxLocationVisible |
|
2824 } = select(store); |
|
2825 return [get('core/edit-post', 'metaBoxesMainIsOpen'), get('core/edit-post', 'metaBoxesMainOpenHeight'), isMetaBoxLocationVisible('normal') || isMetaBoxLocationVisible('advanced') || isMetaBoxLocationVisible('side')]; |
|
2826 }, []); |
|
2827 const { |
|
2828 set: setPreference |
|
2829 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_preferences_namespaceObject.store); |
|
2830 const metaBoxesMainRef = (0,external_wp_element_namespaceObject.useRef)(); |
|
2831 const isShort = (0,external_wp_compose_namespaceObject.useMediaQuery)('(max-height: 549px)'); |
|
2832 const [{ |
|
2833 min, |
|
2834 max |
|
2835 }, setHeightConstraints] = (0,external_wp_element_namespaceObject.useState)(() => ({})); |
|
2836 // Keeps the resizable area’s size constraints updated taking into account |
|
2837 // editor notices. The constraints are also used to derive the value for the |
|
2838 // aria-valuenow attribute on the separator. |
|
2839 const effectSizeConstraints = (0,external_wp_compose_namespaceObject.useRefEffect)(node => { |
|
2840 const container = node.closest('.interface-interface-skeleton__content'); |
|
2841 const noticeLists = container.querySelectorAll(':scope > .components-notice-list'); |
|
2842 const resizeHandle = container.querySelector('.edit-post-meta-boxes-main__presenter'); |
|
2843 const deriveConstraints = () => { |
|
2844 const fullHeight = container.offsetHeight; |
|
2845 let nextMax = fullHeight; |
|
2846 for (const element of noticeLists) { |
|
2847 nextMax -= element.offsetHeight; |
|
2848 } |
|
2849 const nextMin = resizeHandle.offsetHeight; |
|
2850 setHeightConstraints({ |
|
2851 min: nextMin, |
|
2852 max: nextMax |
|
2853 }); |
|
2854 }; |
|
2855 const observer = new window.ResizeObserver(deriveConstraints); |
|
2856 observer.observe(container); |
|
2857 for (const element of noticeLists) { |
|
2858 observer.observe(element); |
|
2859 } |
|
2860 return () => observer.disconnect(); |
|
2861 }, []); |
|
2862 const separatorRef = (0,external_wp_element_namespaceObject.useRef)(); |
|
2863 const separatorHelpId = (0,external_wp_element_namespaceObject.useId)(); |
|
2864 const [isUntouched, setIsUntouched] = (0,external_wp_element_namespaceObject.useState)(true); |
|
2865 const applyHeight = (candidateHeight, isPersistent, isInstant) => { |
|
2866 const nextHeight = Math.min(max, Math.max(min, candidateHeight)); |
|
2867 if (isPersistent) { |
|
2868 setPreference('core/edit-post', 'metaBoxesMainOpenHeight', nextHeight); |
|
2869 } else { |
|
2870 separatorRef.current.ariaValueNow = getAriaValueNow(nextHeight); |
|
2871 } |
|
2872 if (isInstant) { |
|
2873 metaBoxesMainRef.current.updateSize({ |
|
2874 height: nextHeight, |
|
2875 // Oddly, when the event that triggered this was not from the mouse (e.g. keydown), |
|
2876 // if `width` is left unspecified a subsequent drag gesture applies a fixed |
|
2877 // width and the pane fails to widen/narrow with parent width changes from |
|
2878 // sidebars opening/closing or window resizes. |
|
2879 width: 'auto' |
|
2880 }); |
|
2881 } |
|
2882 }; |
|
2883 if (!hasAnyVisible) { |
|
2884 return; |
|
2885 } |
|
2886 const contents = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { |
|
2887 className: dist_clsx( |
|
2888 // The class name 'edit-post-layout__metaboxes' is retained because some plugins use it. |
|
2889 'edit-post-layout__metaboxes', !isLegacy && 'edit-post-meta-boxes-main__liner'), |
|
2890 hidden: !isLegacy && isShort && !isOpen, |
|
2891 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MetaBoxes, { |
|
2892 location: "normal" |
|
2893 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MetaBoxes, { |
|
2894 location: "advanced" |
|
2895 })] |
|
2896 }); |
|
2897 if (isLegacy) { |
|
2898 return contents; |
|
2899 } |
|
2900 const isAutoHeight = openHeight === undefined; |
|
2901 let usedMax = '50%'; // Approximation before max has a value. |
|
2902 if (max !== undefined) { |
|
2903 // Halves the available max height until a user height is set. |
|
2904 usedMax = isAutoHeight && isUntouched ? max / 2 : max; |
|
2905 } |
|
2906 const getAriaValueNow = height => Math.round((height - min) / (max - min) * 100); |
|
2907 const usedAriaValueNow = max === undefined || isAutoHeight ? 50 : getAriaValueNow(openHeight); |
|
2908 const toggle = () => setPreference('core/edit-post', 'metaBoxesMainIsOpen', !isOpen); |
|
2909 |
|
2910 // TODO: Support more/all keyboard interactions from the window splitter pattern: |
|
2911 // https://www.w3.org/WAI/ARIA/apg/patterns/windowsplitter/ |
|
2912 const onSeparatorKeyDown = event => { |
|
2913 const delta = { |
|
2914 ArrowUp: 20, |
|
2915 ArrowDown: -20 |
|
2916 }[event.key]; |
|
2917 if (delta) { |
|
2918 const pane = metaBoxesMainRef.current.resizable; |
|
2919 const fromHeight = isAutoHeight ? pane.offsetHeight : openHeight; |
|
2920 const nextHeight = delta + fromHeight; |
|
2921 applyHeight(nextHeight, true, true); |
|
2922 event.preventDefault(); |
|
2923 } |
|
2924 }; |
|
2925 const className = 'edit-post-meta-boxes-main'; |
|
2926 const paneLabel = (0,external_wp_i18n_namespaceObject.__)('Meta Boxes'); |
|
2927 let Pane, paneProps; |
|
2928 if (isShort) { |
|
2929 Pane = NavigableRegion; |
|
2930 paneProps = { |
|
2931 className: dist_clsx(className, 'is-toggle-only') |
|
2932 }; |
|
2933 } else { |
|
2934 Pane = external_wp_components_namespaceObject.ResizableBox; |
|
2935 paneProps = /** @type {Parameters<typeof ResizableBox>[0]} */{ |
|
2936 as: NavigableRegion, |
|
2937 ref: metaBoxesMainRef, |
|
2938 className: dist_clsx(className, 'is-resizable'), |
|
2939 defaultSize: { |
|
2940 height: openHeight |
|
2941 }, |
|
2942 minHeight: min, |
|
2943 maxHeight: usedMax, |
|
2944 enable: { |
|
2945 top: true, |
|
2946 right: false, |
|
2947 bottom: false, |
|
2948 left: false, |
|
2949 topLeft: false, |
|
2950 topRight: false, |
|
2951 bottomRight: false, |
|
2952 bottomLeft: false |
|
2953 }, |
|
2954 handleClasses: { |
|
2955 top: 'edit-post-meta-boxes-main__presenter' |
|
2956 }, |
|
2957 handleComponent: { |
|
2958 top: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { |
|
2959 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Tooltip, { |
|
2960 text: (0,external_wp_i18n_namespaceObject.__)('Drag to resize'), |
|
2961 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("button", { |
|
2962 // eslint-disable-line jsx-a11y/role-supports-aria-props |
|
2963 ref: separatorRef, |
|
2964 role: "separator" // eslint-disable-line jsx-a11y/no-interactive-element-to-noninteractive-role |
|
2965 , |
|
2966 "aria-valuenow": usedAriaValueNow, |
|
2967 "aria-label": (0,external_wp_i18n_namespaceObject.__)('Drag to resize'), |
|
2968 "aria-describedby": separatorHelpId, |
|
2969 onKeyDown: onSeparatorKeyDown |
|
2970 }) |
|
2971 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { |
|
2972 id: separatorHelpId, |
|
2973 children: (0,external_wp_i18n_namespaceObject.__)('Use up and down arrow keys to resize the meta box panel.') |
|
2974 })] |
|
2975 }) |
|
2976 }, |
|
2977 // Avoids hiccups while dragging over objects like iframes and ensures that |
|
2978 // the event to end the drag is captured by the target (resize handle) |
|
2979 // whether or not it’s under the pointer. |
|
2980 onPointerDown: ({ |
|
2981 pointerId, |
|
2982 target |
|
2983 }) => { |
|
2984 if (separatorRef.current.parentElement.contains(target)) { |
|
2985 target.setPointerCapture(pointerId); |
|
2986 } |
|
2987 }, |
|
2988 onResizeStart: (event, direction, elementRef) => { |
|
2989 if (isAutoHeight) { |
|
2990 // Sets the starting height to avoid visual jumps in height and |
|
2991 // aria-valuenow being `NaN` for the first (few) resize events. |
|
2992 applyHeight(elementRef.offsetHeight, false, true); |
|
2993 setIsUntouched(false); |
|
2994 } |
|
2995 }, |
|
2996 onResize: () => applyHeight(metaBoxesMainRef.current.state.height), |
|
2997 onResizeStop: () => applyHeight(metaBoxesMainRef.current.state.height, true) |
|
2998 }; |
|
2999 } |
|
3000 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Pane, { |
|
3001 "aria-label": paneLabel, |
|
3002 ...paneProps, |
|
3003 children: [isShort ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("button", { |
|
3004 "aria-expanded": isOpen, |
|
3005 className: "edit-post-meta-boxes-main__presenter", |
|
3006 onClick: toggle, |
|
3007 children: [paneLabel, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { |
|
3008 icon: isOpen ? chevron_up : chevron_down |
|
3009 })] |
|
3010 }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("meta", { |
|
3011 ref: effectSizeConstraints |
|
3012 }), contents] |
|
3013 }); |
|
3014 } |
|
3015 function Layout({ |
|
3053 postId: initialPostId, |
3016 postId: initialPostId, |
3054 postType: initialPostType, |
3017 postType: initialPostType, |
3055 settings, |
3018 settings, |
3056 initialEdits, |
3019 initialEdits |
3057 ...props |
|
3058 }) { |
3020 }) { |
3021 layout_useCommands(); |
|
3022 useCommands(); |
|
3023 const shouldIframe = useShouldIframe(); |
|
3059 const { |
3024 const { |
3060 currentPost, |
3025 createErrorNotice |
3026 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); |
|
3027 const { |
|
3028 currentPost: { |
|
3029 postId: currentPostId, |
|
3030 postType: currentPostType |
|
3031 }, |
|
3061 onNavigateToEntityRecord, |
3032 onNavigateToEntityRecord, |
3062 onNavigateToPreviousEntityRecord |
3033 onNavigateToPreviousEntityRecord |
3063 } = useNavigateToEntityRecord(initialPostId, initialPostType, 'post-only'); |
3034 } = useNavigateToEntityRecord(initialPostId, initialPostType, 'post-only'); |
3035 const isEditingTemplate = currentPostType === 'wp_template'; |
|
3064 const { |
3036 const { |
3065 post, |
3037 mode, |
3066 template |
3038 isFullscreenActive, |
3039 hasResolvedMode, |
|
3040 hasActiveMetaboxes, |
|
3041 hasBlockSelected, |
|
3042 showIconLabels, |
|
3043 isDistractionFree, |
|
3044 showMetaBoxes, |
|
3045 isWelcomeGuideVisible, |
|
3046 templateId, |
|
3047 enablePaddingAppender, |
|
3048 isDevicePreview |
|
3067 } = (0,external_wp_data_namespaceObject.useSelect)(select => { |
3049 } = (0,external_wp_data_namespaceObject.useSelect)(select => { |
3068 var _getPostType$viewable; |
3050 var _getPostType$viewable; |
3069 const { |
3051 const { |
3070 getEditedPostTemplate |
3052 get |
3053 } = select(external_wp_preferences_namespaceObject.store); |
|
3054 const { |
|
3055 isFeatureActive, |
|
3056 hasMetaBoxes |
|
3071 } = select(store); |
3057 } = select(store); |
3072 const { |
3058 const { |
3073 getEntityRecord, |
3059 canUser, |
3074 getPostType, |
3060 getPostType, |
3075 canUser |
3061 getTemplateId |
3076 } = select(external_wp_coreData_namespaceObject.store); |
3062 } = unlock(select(external_wp_coreData_namespaceObject.store)); |
3063 const supportsTemplateMode = settings.supportsTemplateMode; |
|
3064 const isViewable = (_getPostType$viewable = getPostType(currentPostType)?.viewable) !== null && _getPostType$viewable !== void 0 ? _getPostType$viewable : false; |
|
3065 const canViewTemplate = canUser('read', { |
|
3066 kind: 'postType', |
|
3067 name: 'wp_template' |
|
3068 }); |
|
3077 const { |
3069 const { |
3078 getEditorSettings |
3070 getBlockSelectionStart, |
3079 } = select(external_wp_editor_namespaceObject.store); |
3071 isZoomOut |
3080 const postObject = getEntityRecord('postType', currentPost.postType, currentPost.postId); |
3072 } = unlock(select(external_wp_blockEditor_namespaceObject.store)); |
3081 const supportsTemplateMode = getEditorSettings().supportsTemplateMode; |
3073 const { |
3082 const isViewable = (_getPostType$viewable = getPostType(currentPost.postType)?.viewable) !== null && _getPostType$viewable !== void 0 ? _getPostType$viewable : false; |
3074 getEditorMode, |
3083 const canViewTemplate = canUser('read', 'templates'); |
3075 getRenderingMode, |
3076 getDefaultRenderingMode, |
|
3077 getDeviceType |
|
3078 } = unlock(select(external_wp_editor_namespaceObject.store)); |
|
3079 const isRenderingPostOnly = getRenderingMode() === 'post-only'; |
|
3080 const isNotDesignPostType = !DESIGN_POST_TYPES.includes(currentPostType); |
|
3081 const isDirectlyEditingPattern = currentPostType === 'wp_block' && !onNavigateToPreviousEntityRecord; |
|
3082 const _templateId = getTemplateId(currentPostType, currentPostId); |
|
3083 const defaultMode = getDefaultRenderingMode(currentPostType); |
|
3084 return { |
3084 return { |
3085 template: supportsTemplateMode && isViewable && canViewTemplate && currentPost.postType !== 'wp_template' ? getEditedPostTemplate() : null, |
3085 mode: getEditorMode(), |
3086 post: postObject |
3086 isFullscreenActive: isFeatureActive('fullscreenMode'), |
3087 hasActiveMetaboxes: hasMetaBoxes(), |
|
3088 hasResolvedMode: defaultMode === 'template-locked' ? !!_templateId : defaultMode !== undefined, |
|
3089 hasBlockSelected: !!getBlockSelectionStart(), |
|
3090 showIconLabels: get('core', 'showIconLabels'), |
|
3091 isDistractionFree: get('core', 'distractionFree'), |
|
3092 showMetaBoxes: isNotDesignPostType && !isZoomOut() || isDirectlyEditingPattern, |
|
3093 isWelcomeGuideVisible: isFeatureActive('welcomeGuide'), |
|
3094 templateId: supportsTemplateMode && isViewable && canViewTemplate && !isEditingTemplate ? _templateId : null, |
|
3095 enablePaddingAppender: !isZoomOut() && isRenderingPostOnly && isNotDesignPostType, |
|
3096 isDevicePreview: getDeviceType() !== 'Desktop' |
|
3087 }; |
3097 }; |
3088 }, [currentPost.postType, currentPost.postId]); |
3098 }, [currentPostType, currentPostId, isEditingTemplate, settings.supportsTemplateMode, onNavigateToPreviousEntityRecord]); |
3099 useMetaBoxInitialization(hasActiveMetaboxes && hasResolvedMode); |
|
3100 const [paddingAppenderRef, paddingStyle] = usePaddingAppender(enablePaddingAppender); |
|
3101 |
|
3102 // Set the right context for the command palette |
|
3103 const commandContext = hasBlockSelected ? 'block-selection-edit' : 'entity-edit'; |
|
3104 useCommandContext(commandContext); |
|
3089 const editorSettings = (0,external_wp_element_namespaceObject.useMemo)(() => ({ |
3105 const editorSettings = (0,external_wp_element_namespaceObject.useMemo)(() => ({ |
3090 ...settings, |
3106 ...settings, |
3091 onNavigateToEntityRecord, |
3107 onNavigateToEntityRecord, |
3092 onNavigateToPreviousEntityRecord, |
3108 onNavigateToPreviousEntityRecord, |
3093 defaultRenderingMode: 'post-only' |
3109 defaultRenderingMode: 'post-only' |
3094 }), [settings, onNavigateToEntityRecord, onNavigateToPreviousEntityRecord]); |
3110 }), [settings, onNavigateToEntityRecord, onNavigateToPreviousEntityRecord]); |
3111 const styles = useEditorStyles(paddingStyle); |
|
3112 |
|
3113 // We need to add the show-icon-labels class to the body element so it is applied to modals. |
|
3114 if (showIconLabels) { |
|
3115 document.body.classList.add('show-icon-labels'); |
|
3116 } else { |
|
3117 document.body.classList.remove('show-icon-labels'); |
|
3118 } |
|
3119 const navigateRegionsProps = (0,external_wp_components_namespaceObject.__unstableUseNavigateRegions)(); |
|
3120 const className = dist_clsx('edit-post-layout', 'is-mode-' + mode, { |
|
3121 'has-metaboxes': hasActiveMetaboxes |
|
3122 }); |
|
3123 function onPluginAreaError(name) { |
|
3124 createErrorNotice((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: plugin name */ |
|
3125 (0,external_wp_i18n_namespaceObject.__)('The "%s" plugin has encountered an error and cannot be rendered.'), name)); |
|
3126 } |
|
3127 const { |
|
3128 createSuccessNotice |
|
3129 } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); |
|
3130 const onActionPerformed = (0,external_wp_element_namespaceObject.useCallback)((actionId, items) => { |
|
3131 switch (actionId) { |
|
3132 case 'move-to-trash': |
|
3133 { |
|
3134 document.location.href = (0,external_wp_url_namespaceObject.addQueryArgs)('edit.php', { |
|
3135 trashed: 1, |
|
3136 post_type: items[0].type, |
|
3137 ids: items[0].id |
|
3138 }); |
|
3139 } |
|
3140 break; |
|
3141 case 'duplicate-post': |
|
3142 { |
|
3143 const newItem = items[0]; |
|
3144 const title = typeof newItem.title === 'string' ? newItem.title : newItem.title?.rendered; |
|
3145 createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)( |
|
3146 // translators: %s: Title of the created post or template, e.g: "Hello world". |
|
3147 (0,external_wp_i18n_namespaceObject.__)('"%s" successfully created.'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title)), { |
|
3148 type: 'snackbar', |
|
3149 id: 'duplicate-post-action', |
|
3150 actions: [{ |
|
3151 label: (0,external_wp_i18n_namespaceObject.__)('Edit'), |
|
3152 onClick: () => { |
|
3153 const postId = newItem.id; |
|
3154 document.location.href = (0,external_wp_url_namespaceObject.addQueryArgs)('post.php', { |
|
3155 post: postId, |
|
3156 action: 'edit' |
|
3157 }); |
|
3158 } |
|
3159 }] |
|
3160 }); |
|
3161 } |
|
3162 break; |
|
3163 } |
|
3164 }, [createSuccessNotice]); |
|
3095 const initialPost = (0,external_wp_element_namespaceObject.useMemo)(() => { |
3165 const initialPost = (0,external_wp_element_namespaceObject.useMemo)(() => { |
3096 return { |
3166 return { |
3097 type: initialPostType, |
3167 type: initialPostType, |
3098 id: initialPostId |
3168 id: initialPostId |
3099 }; |
3169 }; |
3100 }, [initialPostType, initialPostId]); |
3170 }, [initialPostType, initialPostId]); |
3101 if (!post) { |
3171 const backButton = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium') && isFullscreenActive ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(back_button, { |
3102 return null; |
3172 initialPost: initialPost |
3103 } |
3173 }) : null; |
3104 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SlotFillProvider, { |
3174 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SlotFillProvider, { |
3105 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(ExperimentalEditorProvider, { |
3175 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_editor_namespaceObject.ErrorBoundary, { |
3106 settings: editorSettings, |
3176 canCopyContent: true, |
3107 post: post, |
3177 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_commands_namespaceObject.CommandMenu, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuide, { |
3108 initialEdits: initialEdits, |
3178 postType: currentPostType |
3109 useSubRegistry: false, |
3179 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { |
3110 __unstableTemplate: template, |
3180 className: navigateRegionsProps.className, |
3111 ...props, |
3181 ...navigateRegionsProps, |
3112 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_editor_namespaceObject.ErrorBoundary, { |
3182 ref: navigateRegionsProps.ref, |
3113 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_commands_namespaceObject.CommandMenu, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditorInitialization, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(layout, { |
3183 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Editor, { |
3114 initialPost: initialPost |
3184 settings: editorSettings, |
3115 })] |
3185 initialEdits: initialEdits, |
3116 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.PostLockedModal, {})] |
3186 postType: currentPostType, |
3187 postId: currentPostId, |
|
3188 templateId: templateId, |
|
3189 className: className, |
|
3190 styles: styles, |
|
3191 forceIsDirty: hasActiveMetaboxes, |
|
3192 contentRef: paddingAppenderRef, |
|
3193 disableIframe: !shouldIframe |
|
3194 // We should auto-focus the canvas (title) on load. |
|
3195 // eslint-disable-next-line jsx-a11y/no-autofocus |
|
3196 , |
|
3197 autoFocus: !isWelcomeGuideVisible, |
|
3198 onActionPerformed: onActionPerformed, |
|
3199 extraSidebarPanels: showMetaBoxes && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MetaBoxes, { |
|
3200 location: "side" |
|
3201 }), |
|
3202 extraContent: !isDistractionFree && showMetaBoxes && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MetaBoxesMain, { |
|
3203 isLegacy: !shouldIframe || isDevicePreview |
|
3204 }), |
|
3205 children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.PostLockedModal, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditorInitialization, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FullscreenMode, { |
|
3206 isActive: isFullscreenActive |
|
3207 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(browser_url, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.UnsavedChangesWarning, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.AutosaveMonitor, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.LocalAutosaveMonitor, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(keyboard_shortcuts, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.EditorKeyboardShortcutsRegister, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockKeyboardShortcuts, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InitPatternModal, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_plugins_namespaceObject.PluginArea, { |
|
3208 onError: onPluginAreaError |
|
3209 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(more_menu, {}), backButton, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.EditorSnackbars, {})] |
|
3210 }) |
|
3211 })] |
|
3117 }) |
3212 }) |
3118 }); |
3213 }); |
3119 } |
3214 } |
3120 /* harmony default export */ const editor = (Editor); |
3215 /* harmony default export */ const layout = (Layout); |
3121 |
3216 |
3122 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/deprecated.js |
3217 ;// ./node_modules/@wordpress/edit-post/build-module/deprecated.js |
3123 /** |
3218 /** |
3124 * WordPress dependencies |
3219 * WordPress dependencies |
3125 */ |
3220 */ |
3126 |
3221 |
3127 |
3222 |
3263 return PluginPostExcerpt; |
3358 return PluginPostExcerpt; |
3264 } |
3359 } |
3265 |
3360 |
3266 /* eslint-enable jsdoc/require-param */ |
3361 /* eslint-enable jsdoc/require-param */ |
3267 |
3362 |
3268 ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/index.js |
3363 ;// ./node_modules/@wordpress/edit-post/build-module/index.js |
3269 /** |
3364 /** |
3270 * WordPress dependencies |
3365 * WordPress dependencies |
3271 */ |
3366 */ |
3272 |
3367 |
3273 |
3368 |
3283 */ |
3378 */ |
3284 |
3379 |
3285 |
3380 |
3286 |
3381 |
3287 const { |
3382 const { |
3288 BackButton: __experimentalMainDashboardButton |
3383 BackButton: __experimentalMainDashboardButton, |
3384 registerCoreBlockBindingsSources |
|
3289 } = unlock(external_wp_editor_namespaceObject.privateApis); |
3385 } = unlock(external_wp_editor_namespaceObject.privateApis); |
3290 |
3386 |
3291 /** |
3387 /** |
3292 * Initializes and returns an instance of Editor. |
3388 * Initializes and returns an instance of Editor. |
3293 * |
3389 * |
3310 welcomeGuideTemplate: true |
3406 welcomeGuideTemplate: true |
3311 }); |
3407 }); |
3312 (0,external_wp_data_namespaceObject.dispatch)(external_wp_preferences_namespaceObject.store).setDefaults('core', { |
3408 (0,external_wp_data_namespaceObject.dispatch)(external_wp_preferences_namespaceObject.store).setDefaults('core', { |
3313 allowRightClickOverrides: true, |
3409 allowRightClickOverrides: true, |
3314 editorMode: 'visual', |
3410 editorMode: 'visual', |
3411 editorTool: 'edit', |
|
3315 fixedToolbar: false, |
3412 fixedToolbar: false, |
3316 hiddenBlockTypes: [], |
3413 hiddenBlockTypes: [], |
3317 inactivePanels: [], |
3414 inactivePanels: [], |
3318 openPanels: ['post-status'], |
3415 openPanels: ['post-status'], |
3319 showBlockBreadcrumbs: true, |
3416 showBlockBreadcrumbs: true, |
3320 showIconLabels: false, |
3417 showIconLabels: false, |
3321 showListViewByDefault: false, |
3418 showListViewByDefault: false, |
3419 enableChoosePatternModal: true, |
|
3322 isPublishSidebarEnabled: true |
3420 isPublishSidebarEnabled: true |
3323 }); |
3421 }); |
3422 if (window.__experimentalMediaProcessing) { |
|
3423 (0,external_wp_data_namespaceObject.dispatch)(external_wp_preferences_namespaceObject.store).setDefaults('core/media', { |
|
3424 requireApproval: true, |
|
3425 optimizeOnUpload: true |
|
3426 }); |
|
3427 } |
|
3324 (0,external_wp_data_namespaceObject.dispatch)(external_wp_blocks_namespaceObject.store).reapplyBlockTypeFilters(); |
3428 (0,external_wp_data_namespaceObject.dispatch)(external_wp_blocks_namespaceObject.store).reapplyBlockTypeFilters(); |
3325 |
3429 |
3326 // Check if the block list view should be open by default. |
3430 // Check if the block list view should be open by default. |
3327 // If `distractionFree` mode is enabled, the block list view should not be open. |
3431 // If `distractionFree` mode is enabled, the block list view should not be open. |
3328 // This behavior is disabled for small viewports. |
3432 // This behavior is disabled for small viewports. |
3329 if (isMediumOrBigger && (0,external_wp_data_namespaceObject.select)(external_wp_preferences_namespaceObject.store).get('core', 'showListViewByDefault') && !(0,external_wp_data_namespaceObject.select)(external_wp_preferences_namespaceObject.store).get('core', 'distractionFree')) { |
3433 if (isMediumOrBigger && (0,external_wp_data_namespaceObject.select)(external_wp_preferences_namespaceObject.store).get('core', 'showListViewByDefault') && !(0,external_wp_data_namespaceObject.select)(external_wp_preferences_namespaceObject.store).get('core', 'distractionFree')) { |
3330 (0,external_wp_data_namespaceObject.dispatch)(external_wp_editor_namespaceObject.store).setIsListViewOpened(true); |
3434 (0,external_wp_data_namespaceObject.dispatch)(external_wp_editor_namespaceObject.store).setIsListViewOpened(true); |
3331 } |
3435 } |
3332 (0,external_wp_blockLibrary_namespaceObject.registerCoreBlocks)(); |
3436 (0,external_wp_blockLibrary_namespaceObject.registerCoreBlocks)(); |
3437 registerCoreBlockBindingsSources(); |
|
3333 (0,external_wp_widgets_namespaceObject.registerLegacyWidgetBlock)({ |
3438 (0,external_wp_widgets_namespaceObject.registerLegacyWidgetBlock)({ |
3334 inserter: false |
3439 inserter: false |
3335 }); |
3440 }); |
3336 (0,external_wp_widgets_namespaceObject.registerWidgetGroupBlock)({ |
3441 (0,external_wp_widgets_namespaceObject.registerWidgetGroupBlock)({ |
3337 inserter: false |
3442 inserter: false |
3371 } |
3476 } |
3372 |
3477 |
3373 // Prevent the default browser action for files dropped outside of dropzones. |
3478 // Prevent the default browser action for files dropped outside of dropzones. |
3374 window.addEventListener('dragover', e => e.preventDefault(), false); |
3479 window.addEventListener('dragover', e => e.preventDefault(), false); |
3375 window.addEventListener('drop', e => e.preventDefault(), false); |
3480 window.addEventListener('drop', e => e.preventDefault(), false); |
3376 root.render( /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(editor, { |
3481 root.render(/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.StrictMode, { |
3377 settings: settings, |
3482 children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(layout, { |
3378 postId: postId, |
3483 settings: settings, |
3379 postType: postType, |
3484 postId: postId, |
3380 initialEdits: initialEdits |
3485 postType: postType, |
3486 initialEdits: initialEdits |
|
3487 }) |
|
3381 })); |
3488 })); |
3382 return root; |
3489 return root; |
3383 } |
3490 } |
3384 |
3491 |
3385 /** |
3492 /** |