@wordpress/edit-post 8.12.0 → 8.12.1-next.082ed6819.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/build/components/browser-url/index.js +2 -3
  2. package/build/components/browser-url/index.js.map +1 -1
  3. package/build/components/layout/index.js +8 -11
  4. package/build/components/layout/index.js.map +1 -1
  5. package/build/components/meta-boxes/meta-box-visibility.js +10 -24
  6. package/build/components/meta-boxes/meta-box-visibility.js.map +1 -1
  7. package/build/components/preferences-modal/enable-custom-fields.js +5 -7
  8. package/build/components/preferences-modal/enable-custom-fields.js.map +1 -1
  9. package/build/components/preferences-modal/enable-panel.js +27 -19
  10. package/build/components/preferences-modal/enable-panel.js.map +1 -1
  11. package/build/store/index.js +0 -3
  12. package/build/store/index.js.map +1 -1
  13. package/build/store/selectors.js +6 -3
  14. package/build/store/selectors.js.map +1 -1
  15. package/build-module/components/browser-url/index.js +2 -3
  16. package/build-module/components/browser-url/index.js.map +1 -1
  17. package/build-module/components/layout/index.js +8 -11
  18. package/build-module/components/layout/index.js.map +1 -1
  19. package/build-module/components/meta-boxes/meta-box-visibility.js +11 -25
  20. package/build-module/components/meta-boxes/meta-box-visibility.js.map +1 -1
  21. package/build-module/components/preferences-modal/enable-custom-fields.js +6 -7
  22. package/build-module/components/preferences-modal/enable-custom-fields.js.map +1 -1
  23. package/build-module/components/preferences-modal/enable-panel.js +27 -19
  24. package/build-module/components/preferences-modal/enable-panel.js.map +1 -1
  25. package/build-module/store/index.js +0 -3
  26. package/build-module/store/index.js.map +1 -1
  27. package/build-module/store/selectors.js +6 -3
  28. package/build-module/store/selectors.js.map +1 -1
  29. package/package.json +29 -29
  30. package/src/components/browser-url/index.js +2 -3
  31. package/src/components/layout/index.js +11 -7
  32. package/src/components/meta-boxes/meta-box-visibility.js +14 -23
  33. package/src/components/preferences-modal/enable-custom-fields.js +5 -7
  34. package/src/components/preferences-modal/enable-panel.js +27 -17
  35. package/src/components/preferences-modal/test/enable-custom-fields.js +22 -13
  36. package/src/store/index.js +0 -3
  37. package/src/store/selectors.js +7 -4
  38. package/build/store/private-selectors.js +0 -62
  39. package/build/store/private-selectors.js.map +0 -1
  40. package/build-module/store/private-selectors.js +0 -55
  41. package/build-module/store/private-selectors.js.map +0 -1
  42. package/src/store/private-selectors.js +0 -61
@@ -36,13 +36,12 @@ class BrowserURL extends _element.Component {
36
36
  componentDidUpdate(prevProps) {
37
37
  const {
38
38
  postId,
39
- postStatus,
40
- hasHistory
39
+ postStatus
41
40
  } = this.props;
42
41
  const {
43
42
  historyId
44
43
  } = this.state;
45
- if ((postId !== prevProps.postId || postId !== historyId) && postStatus !== 'auto-draft' && postId && !hasHistory) {
44
+ if ((postId !== prevProps.postId || postId !== historyId) && postStatus !== 'auto-draft' && postId) {
46
45
  this.setBrowserURL(postId);
47
46
  }
48
47
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_data","_url","_editor","getPostEditURL","postId","addQueryArgs","post","action","BrowserURL","Component","constructor","arguments","state","historyId","componentDidUpdate","prevProps","postStatus","hasHistory","props","setBrowserURL","window","history","replaceState","id","setState","render","exports","_default","default","withSelect","select","getCurrentPost","editorStore","status","type","isTemplate","includes","wp_id"],"sources":["@wordpress/edit-post/src/components/browser-url/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { withSelect } from '@wordpress/data';\nimport { addQueryArgs } from '@wordpress/url';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Returns the Post's Edit URL.\n *\n * @param {number} postId Post ID.\n *\n * @return {string} Post edit URL.\n */\nexport function getPostEditURL( postId ) {\n\treturn addQueryArgs( 'post.php', { post: postId, action: 'edit' } );\n}\n\nexport class BrowserURL extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.state = {\n\t\t\thistoryId: null,\n\t\t};\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tconst { postId, postStatus, hasHistory } = this.props;\n\t\tconst { historyId } = this.state;\n\n\t\tif (\n\t\t\t( postId !== prevProps.postId || postId !== historyId ) &&\n\t\t\tpostStatus !== 'auto-draft' &&\n\t\t\tpostId &&\n\t\t\t! hasHistory\n\t\t) {\n\t\t\tthis.setBrowserURL( postId );\n\t\t}\n\t}\n\n\t/**\n\t * Replaces the browser URL with a post editor link for the given post ID.\n\t *\n\t * Note it is important that, since this function may be called when the\n\t * editor first loads, the result generated `getPostEditURL` matches that\n\t * produced by the server. Otherwise, the URL will change unexpectedly.\n\t *\n\t * @param {number} postId Post ID for which to generate post editor URL.\n\t */\n\tsetBrowserURL( postId ) {\n\t\twindow.history.replaceState(\n\t\t\t{ id: postId },\n\t\t\t'Post ' + postId,\n\t\t\tgetPostEditURL( postId )\n\t\t);\n\n\t\tthis.setState( () => ( {\n\t\t\thistoryId: postId,\n\t\t} ) );\n\t}\n\n\trender() {\n\t\treturn null;\n\t}\n}\n\nexport default withSelect( ( select ) => {\n\tconst { getCurrentPost } = select( editorStore );\n\tconst post = getCurrentPost();\n\tlet { id, status, type } = post;\n\tconst isTemplate = [ 'wp_template', 'wp_template_part' ].includes( type );\n\tif ( isTemplate ) {\n\t\tid = post.wp_id;\n\t}\n\n\treturn {\n\t\tpostId: id,\n\t\tpostStatus: status,\n\t};\n} )( BrowserURL );\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,IAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AANA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASI,cAAcA,CAAEC,MAAM,EAAG;EACxC,OAAO,IAAAC,iBAAY,EAAE,UAAU,EAAE;IAAEC,IAAI,EAAEF,MAAM;IAAEG,MAAM,EAAE;EAAO,CAAE,CAAC;AACpE;AAEO,MAAMC,UAAU,SAASC,kBAAS,CAAC;EACzCC,WAAWA,C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IAAK,CAAC;EACzE,IAAKC,UAAU,EAAG;IACjBZ,EAAE,GAAGjB,IAAI,CAAC+B,KAAK;EAChB;EAEA,OAAO;IACNjC,MAAM,EAAEmB,EAAE;IACVP,UAAU,EAAEiB;EACb,CAAC;AACF,CAAE,CAAC,CAAEzB,UAAW,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_element","require","_data","_url","_editor","getPostEditURL","postId","addQueryArgs","post","action","BrowserURL","Component","constructor","arguments","state","historyId","componentDidUpdate","prevProps","postStatus","props","setBrowserURL","window","history","replaceState","id","setState","render","exports","_default","default","withSelect","select","getCurrentPost","editorStore","status","type","isTemplate","includes","wp_id"],"sources":["@wordpress/edit-post/src/components/browser-url/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { withSelect } from '@wordpress/data';\nimport { addQueryArgs } from '@wordpress/url';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Returns the Post's Edit URL.\n *\n * @param {number} postId Post ID.\n *\n * @return {string} Post edit URL.\n */\nexport function getPostEditURL( postId ) {\n\treturn addQueryArgs( 'post.php', { post: postId, action: 'edit' } );\n}\n\nexport class BrowserURL extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.state = {\n\t\t\thistoryId: null,\n\t\t};\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tconst { postId, postStatus } = this.props;\n\t\tconst { historyId } = this.state;\n\n\t\tif (\n\t\t\t( postId !== prevProps.postId || postId !== historyId ) &&\n\t\t\tpostStatus !== 'auto-draft' &&\n\t\t\tpostId\n\t\t) {\n\t\t\tthis.setBrowserURL( postId );\n\t\t}\n\t}\n\n\t/**\n\t * Replaces the browser URL with a post editor link for the given post ID.\n\t *\n\t * Note it is important that, since this function may be called when the\n\t * editor first loads, the result generated `getPostEditURL` matches that\n\t * produced by the server. Otherwise, the URL will change unexpectedly.\n\t *\n\t * @param {number} postId Post ID for which to generate post editor URL.\n\t */\n\tsetBrowserURL( postId ) {\n\t\twindow.history.replaceState(\n\t\t\t{ id: postId },\n\t\t\t'Post ' + postId,\n\t\t\tgetPostEditURL( postId )\n\t\t);\n\n\t\tthis.setState( () => ( {\n\t\t\thistoryId: postId,\n\t\t} ) );\n\t}\n\n\trender() {\n\t\treturn null;\n\t}\n}\n\nexport default withSelect( ( select ) => {\n\tconst { getCurrentPost } = select( editorStore );\n\tconst post = getCurrentPost();\n\tlet { id, status, type } = post;\n\tconst isTemplate = [ 'wp_template', 'wp_template_part' ].includes( type );\n\tif ( isTemplate ) {\n\t\tid = post.wp_id;\n\t}\n\n\treturn {\n\t\tpostId: id,\n\t\tpostStatus: status,\n\t};\n} )( BrowserURL );\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,IAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AANA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASI,cAAcA,CAAEC,MAAM,EAAG;EACxC,OAAO,IAAAC,iBAAY,EAAE,UAAU,EAAE;IAAEC,IAAI,EAAEF,MAAM;IAAEG,MAAM,EAAE;EAAO,CAAE,CAAC;AACpE;AAEO,MAAMC,UAAU,SAASC,kBAAS,CAAC;EACzCC,WAAWA,CAAA,EAAG;IACb,KAAK,CAAE,GAAGC,SAAU,CAAC;IAErB,IAAI,CAACC,KAAK,GAAG;MACZC,SAAS,EAAE;IACZ,CAAC;EACF;EAEAC,kBAAkBA,CAAEC,SAAS,EAAG;IAC/B,MAAM;MAAEX,MAAM;MAAEY;IAAW,CAAC,GAAG,IAAI,CAACC,KAAK;IACzC,MAAM;MAAEJ;IAAU,CAAC,GAAG,IAAI,CAACD,KAAK;IAEhC,IACC,CAAER,MAAM,KAAKW,SAAS,CAACX,MAAM,IAAIA,MAAM,KAAKS,SAAS,KACrDG,UAAU,KAAK,YAAY,IAC3BZ,MAAM,EACL;MACD,IAAI,CAACc,aAAa,CAAEd,MAAO,CAAC;IAC7B;EACD;;EAEA;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACCc,aAAaA,CAAEd,MAAM,EAAG;IACvBe,MAAM,CAACC,OAAO,CAACC,YAAY,CAC1B;MAAEC,EAAE,EAAElB;IAAO,CAAC,EACd,OAAO,GAAGA,MAAM,EAChBD,cAAc,CAAEC,MAAO,CACxB,CAAC;IAED,IAAI,CAACmB,QAAQ,CAAE,OAAQ;MACtBV,SAAS,EAAET;IACZ,CAAC,CAAG,CAAC;EACN;EAEAoB,MAAMA,CAAA,EAAG;IACR,OAAO,IAAI;EACZ;AACD;AAACC,OAAA,CAAAjB,UAAA,GAAAA,UAAA;AAAA,IAAAkB,QAAA,GAAAD,OAAA,CAAAE,OAAA,GAEc,IAAAC,gBAAU,EAAIC,MAAM,IAAM;EACxC,MAAM;IAAEC;EAAe,CAAC,GAAGD,MAAM,CAAEE,aAAY,CAAC;EAChD,MAAMzB,IAAI,GAAGwB,cAAc,CAAC,CAAC;EAC7B,IAAI;IAAER,EAAE;IAAEU,MAAM;IAAEC;EAAK,CAAC,GAAG3B,IAAI;EAC/B,MAAM4B,UAAU,GAAG,CAAE,aAAa,EAAE,kBAAkB,CAAE,CAACC,QAAQ,CAAEF,IAAK,CAAC;EACzE,IAAKC,UAAU,EAAG;IACjBZ,EAAE,GAAGhB,IAAI,CAAC8B,KAAK;EAChB;EAEA,OAAO;IACNhC,MAAM,EAAEkB,EAAE;IACVN,UAAU,EAAEgB;EACb,CAAC;AACF,CAAE,CAAC,CAAExB,UAAW,CAAC","ignoreList":[]}
@@ -343,7 +343,6 @@ function Layout({
343
343
  showIconLabels,
344
344
  isDistractionFree,
345
345
  showMetaBoxes,
346
- hasHistory,
347
346
  isWelcomeGuideVisible,
348
347
  templateId,
349
348
  enablePaddingAppender
@@ -353,13 +352,13 @@ function Layout({
353
352
  get
354
353
  } = select(_preferences.store);
355
354
  const {
356
- isFeatureActive,
357
- getEditedPostTemplateId
358
- } = (0, _lockUnlock.unlock)(select(_store.store));
355
+ isFeatureActive
356
+ } = select(_store.store);
359
357
  const {
360
358
  canUser,
361
- getPostType
362
- } = select(_coreData.store);
359
+ getPostType,
360
+ getTemplateId
361
+ } = (0, _lockUnlock.unlock)(select(_coreData.store));
363
362
  const supportsTemplateMode = settings.supportsTemplateMode;
364
363
  const isViewable = (_getPostType$viewable = getPostType(currentPostType)?.viewable) !== null && _getPostType$viewable !== void 0 ? _getPostType$viewable : false;
365
364
  const canViewTemplate = canUser('read', {
@@ -383,10 +382,10 @@ function Layout({
383
382
  isDistractionFree: get('core', 'distractionFree'),
384
383
  showMetaBoxes: !DESIGN_POST_TYPES.includes(currentPostType) && !isZoomOut(),
385
384
  isWelcomeGuideVisible: isFeatureActive('welcomeGuide'),
386
- templateId: supportsTemplateMode && isViewable && canViewTemplate && !isEditingTemplate ? getEditedPostTemplateId() : null,
385
+ templateId: supportsTemplateMode && isViewable && canViewTemplate && !isEditingTemplate ? getTemplateId(currentPostType, currentPostId) : null,
387
386
  enablePaddingAppender: !isZoomOut() && isRenderingPostOnly && !DESIGN_POST_TYPES.includes(currentPostType)
388
387
  };
389
- }, [currentPostType, isEditingTemplate, settings.supportsTemplateMode]);
388
+ }, [currentPostType, currentPostId, isEditingTemplate, settings.supportsTemplateMode]);
390
389
  const [paddingAppenderRef, paddingStyle] = (0, _usePaddingAppender.usePaddingAppender)(enablePaddingAppender);
391
390
 
392
391
  // Set the right context for the command palette
@@ -493,9 +492,7 @@ function Layout({
493
492
  }),
494
493
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.PostLockedModal, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_editorInitialization.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(FullscreenMode, {
495
494
  isActive: isFullscreenActive
496
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_browserUrl.default, {
497
- hasHistory: hasHistory
498
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.UnsavedChangesWarning, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.AutosaveMonitor, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.LocalAutosaveMonitor, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_keyboardShortcuts.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.EditorKeyboardShortcutsRegister, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(BlockKeyboardShortcuts, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_initPatternModal.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_plugins.PluginArea, {
495
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_browserUrl.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.UnsavedChangesWarning, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.AutosaveMonitor, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.LocalAutosaveMonitor, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_keyboardShortcuts.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.EditorKeyboardShortcutsRegister, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(BlockKeyboardShortcuts, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_initPatternModal.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_plugins.PluginArea, {
499
496
  onError: onPluginAreaError
500
497
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_moreMenu.default, {}), backButton, /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.EditorSnackbars, {})]
501
498
  })
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_editor","_data","_blockEditor","_plugins","_i18n","_element","_icons","_notices","_preferences","_commands","_coreCommands","_blockLibrary","_url","_htmlEntities","_coreData","_components","_compose","_backButton","_editorInitialization","_keyboardShortcuts","_initPatternModal","_browserUrl","_metaBoxes","_moreMenu","_welcomeGuide","_store","_lockUnlock","_useCommands","_usePaddingAppender","_useShouldIframe","_useNavigateToEntityRecord","_jsxRuntime","getLayoutStyles","unlock","blockEditorPrivateApis","useCommands","coreCommandsPrivateApis","useCommandContext","commandsPrivateApis","Editor","FullscreenMode","NavigableRegion","editorPrivateApis","BlockKeyboardShortcuts","blockLibraryPrivateApis","DESIGN_POST_TYPES","useEditorStyles","additionalStyles","hasThemeStyleSupport","editorSettings","useSelect","select","editPostStore","isFeatureActive","editorStore","getEditorSettings","addedStyles","join","useMemo","_editorSettings$style","_editorSettings$defau","_editorSettings$style2","_editorSettings$style3","presetStyles","styles","filter","style","__unstableType","defaultEditorStyles","hasThemeStyles","length","disableLayoutStyles","push","css","selector","hasBlockGapSupport","hasFallbackGapSupport","fallbackGapValue","baseStyles","MetaBoxesMain","isLegacy","isOpen","openHeight","hasAnyVisible","get","preferencesStore","isMetaBoxLocationVisible","set","setPreference","useDispatch","metaBoxesMainRef","useRef","isShort","useMediaQuery","min","max","setHeightConstraints","useState","effectSizeConstraints","useRefEffect","node","container","closest","noticeLists","querySelectorAll","resizeHandle","querySelector","deriveConstraints","fullHeight","offsetHeight","nextMax","element","nextMin","observer","window","ResizeObserver","observe","disconnect","separatorRef","separatorHelpId","useId","isUntouched","setIsUntouched","applyHeight","candidateHeight","isPersistent","isInstant","nextHeight","Math","current","ariaValueNow","getAriaValueNow","updateSize","height","width","contents","jsxs","className","clsx","hidden","children","jsx","default","location","isAutoHeight","undefined","usedMax","round","usedAriaValueNow","toggle","onSeparatorKeyDown","event","delta","ArrowUp","ArrowDown","key","pane","resizable","fromHeight","preventDefault","paneLabel","__","Pane","paneProps","ResizableBox","as","ref","defaultSize","minHeight","maxHeight","enable","top","right","bottom","left","topLeft","topRight","bottomRight","bottomLeft","handleClasses","handleComponent","Fragment","Tooltip","text","role","onKeyDown","VisuallyHidden","id","onPointerDown","pointerId","target","setPointerCapture","onResizeStart","direction","elementRef","onResize","state","onResizeStop","onClick","Icon","icon","chevronUp","chevronDown","Layout","postId","initialPostId","postType","initialPostType","settings","initialEdits","useEditPostCommands","shouldIframe","useShouldIframe","createErrorNotice","noticesStore","currentPost","currentPostId","currentPostType","onNavigateToEntityRecord","onNavigateToPreviousEntityRecord","useNavigateToEntityRecord","isEditingTemplate","mode","isFullscreenActive","hasActiveMetaboxes","hasBlockSelected","showIconLabels","isDistractionFree","showMetaBoxes","hasHistory","isWelcomeGuideVisible","templateId","enablePaddingAppender","_getPostType$viewable","getEditedPostTemplateId","canUser","getPostType","coreStore","supportsTemplateMode","isViewable","viewable","canViewTemplate","kind","name","isZoomOut","blockEditorStore","getEditorMode","getRenderingMode","isRenderingPostOnly","hasMetaBoxes","getBlockSelectionStart","includes","paddingAppenderRef","paddingStyle","usePaddingAppender","commandContext","defaultRenderingMode","document","body","classList","add","remove","navigateRegionsProps","useNavigateRegions","onPluginAreaError","sprintf","createSuccessNotice","onActionPerformed","useCallback","actionId","items","href","addQueryArgs","trashed","post_type","type","ids","newItem","title","rendered","decodeEntities","actions","label","post","action","initialPost","backButton","useViewportMatch","SlotFillProvider","ErrorBoundary","CommandMenu","forceIsDirty","contentRef","disableIframe","autoFocus","extraSidebarPanels","extraContent","PostLockedModal","isActive","UnsavedChangesWarning","AutosaveMonitor","LocalAutosaveMonitor","EditorKeyboardShortcutsRegister","PluginArea","onError","EditorSnackbars","_default","exports"],"sources":["@wordpress/edit-post/src/components/layout/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAutosaveMonitor,\n\tLocalAutosaveMonitor,\n\tUnsavedChangesWarning,\n\tEditorKeyboardShortcutsRegister,\n\tEditorSnackbars,\n\tErrorBoundary,\n\tPostLockedModal,\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { PluginArea } from '@wordpress/plugins';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tuseCallback,\n\tuseMemo,\n\tuseId,\n\tuseRef,\n\tuseState,\n} from '@wordpress/element';\nimport { chevronDown, chevronUp } from '@wordpress/icons';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tCommandMenu,\n\tprivateApis as commandsPrivateApis,\n} from '@wordpress/commands';\nimport { privateApis as coreCommandsPrivateApis } from '@wordpress/core-commands';\nimport { privateApis as blockLibraryPrivateApis } from '@wordpress/block-library';\nimport { addQueryArgs } from '@wordpress/url';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tIcon,\n\tResizableBox,\n\tSlotFillProvider,\n\tTooltip,\n\tVisuallyHidden,\n\t__unstableUseNavigateRegions as useNavigateRegions,\n} from '@wordpress/components';\nimport {\n\tuseMediaQuery,\n\tuseRefEffect,\n\tuseViewportMatch,\n} from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BackButton from '../back-button';\nimport EditorInitialization from '../editor-initialization';\nimport EditPostKeyboardShortcuts from '../keyboard-shortcuts';\nimport InitPatternModal from '../init-pattern-modal';\nimport BrowserURL from '../browser-url';\nimport MetaBoxes from '../meta-boxes';\nimport PostEditorMoreMenu from '../more-menu';\nimport WelcomeGuide from '../welcome-guide';\nimport { store as editPostStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport useEditPostCommands from '../../commands/use-commands';\nimport { usePaddingAppender } from './use-padding-appender';\nimport { useShouldIframe } from './use-should-iframe';\nimport useNavigateToEntityRecord from '../../hooks/use-navigate-to-entity-record';\n\nconst { getLayoutStyles } = unlock( blockEditorPrivateApis );\nconst { useCommands } = unlock( coreCommandsPrivateApis );\nconst { useCommandContext } = unlock( commandsPrivateApis );\nconst { Editor, FullscreenMode, NavigableRegion } = unlock( editorPrivateApis );\nconst { BlockKeyboardShortcuts } = unlock( blockLibraryPrivateApis );\nconst DESIGN_POST_TYPES = [\n\t'wp_template',\n\t'wp_template_part',\n\t'wp_block',\n\t'wp_navigation',\n];\n\nfunction useEditorStyles( ...additionalStyles ) {\n\tconst { hasThemeStyleSupport, editorSettings } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\thasThemeStyleSupport:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'themeStyles' ),\n\t\t\teditorSettings: select( editorStore ).getEditorSettings(),\n\t\t};\n\t}, [] );\n\n\tconst addedStyles = additionalStyles.join( '\\n' );\n\n\t// Compute the default styles.\n\treturn useMemo( () => {\n\t\tconst presetStyles =\n\t\t\teditorSettings.styles?.filter(\n\t\t\t\t( style ) =>\n\t\t\t\t\tstyle.__unstableType && style.__unstableType !== 'theme'\n\t\t\t) ?? [];\n\n\t\tconst defaultEditorStyles = [\n\t\t\t...( editorSettings?.defaultEditorStyles ?? [] ),\n\t\t\t...presetStyles,\n\t\t];\n\n\t\t// Has theme styles if the theme supports them and if some styles were not preset styles (in which case they're theme styles).\n\t\tconst hasThemeStyles =\n\t\t\thasThemeStyleSupport &&\n\t\t\tpresetStyles.length !== ( editorSettings.styles?.length ?? 0 );\n\n\t\t// If theme styles are not present or displayed, ensure that\n\t\t// base layout styles are still present in the editor.\n\t\tif ( ! editorSettings.disableLayoutStyles && ! hasThemeStyles ) {\n\t\t\tdefaultEditorStyles.push( {\n\t\t\t\tcss: getLayoutStyles( {\n\t\t\t\t\tstyle: {},\n\t\t\t\t\tselector: 'body',\n\t\t\t\t\thasBlockGapSupport: false,\n\t\t\t\t\thasFallbackGapSupport: true,\n\t\t\t\t\tfallbackGapValue: '0.5em',\n\t\t\t\t} ),\n\t\t\t} );\n\t\t}\n\n\t\tconst baseStyles = hasThemeStyles\n\t\t\t? editorSettings.styles ?? []\n\t\t\t: defaultEditorStyles;\n\n\t\tif ( addedStyles ) {\n\t\t\treturn [ ...baseStyles, { css: addedStyles } ];\n\t\t}\n\n\t\treturn baseStyles;\n\t}, [\n\t\teditorSettings.defaultEditorStyles,\n\t\teditorSettings.disableLayoutStyles,\n\t\teditorSettings.styles,\n\t\thasThemeStyleSupport,\n\t\taddedStyles,\n\t] );\n}\n\n/**\n * @param {Object} props\n * @param {boolean} props.isLegacy True when the editor canvas is not in an iframe.\n */\nfunction MetaBoxesMain( { isLegacy } ) {\n\tconst [ isOpen, openHeight, hasAnyVisible ] = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { isMetaBoxLocationVisible } = select( editPostStore );\n\t\treturn [\n\t\t\tget( 'core/edit-post', 'metaBoxesMainIsOpen' ),\n\t\t\tget( 'core/edit-post', 'metaBoxesMainOpenHeight' ),\n\t\t\tisMetaBoxLocationVisible( 'normal' ) ||\n\t\t\t\tisMetaBoxLocationVisible( 'advanced' ) ||\n\t\t\t\tisMetaBoxLocationVisible( 'side' ),\n\t\t];\n\t}, [] );\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\tconst metaBoxesMainRef = useRef();\n\tconst isShort = useMediaQuery( '(max-height: 549px)' );\n\n\tconst [ { min, max }, setHeightConstraints ] = useState( () => ( {} ) );\n\t// Keeps the resizable area’s size constraints updated taking into account\n\t// editor notices. The constraints are also used to derive the value for the\n\t// aria-valuenow attribute on the seperator.\n\tconst effectSizeConstraints = useRefEffect( ( node ) => {\n\t\tconst container = node.closest(\n\t\t\t'.interface-interface-skeleton__content'\n\t\t);\n\t\tconst noticeLists = container.querySelectorAll(\n\t\t\t':scope > .components-notice-list'\n\t\t);\n\t\tconst resizeHandle = container.querySelector(\n\t\t\t'.edit-post-meta-boxes-main__presenter'\n\t\t);\n\t\tconst deriveConstraints = () => {\n\t\t\tconst fullHeight = container.offsetHeight;\n\t\t\tlet nextMax = fullHeight;\n\t\t\tfor ( const element of noticeLists ) {\n\t\t\t\tnextMax -= element.offsetHeight;\n\t\t\t}\n\t\t\tconst nextMin = resizeHandle.offsetHeight;\n\t\t\tsetHeightConstraints( { min: nextMin, max: nextMax } );\n\t\t};\n\t\tconst observer = new window.ResizeObserver( deriveConstraints );\n\t\tobserver.observe( container );\n\t\tfor ( const element of noticeLists ) {\n\t\t\tobserver.observe( element );\n\t\t}\n\t\treturn () => observer.disconnect();\n\t}, [] );\n\n\tconst separatorRef = useRef();\n\tconst separatorHelpId = useId();\n\n\tconst [ isUntouched, setIsUntouched ] = useState( true );\n\tconst applyHeight = ( candidateHeight, isPersistent, isInstant ) => {\n\t\tconst nextHeight = Math.min( max, Math.max( min, candidateHeight ) );\n\t\tif ( isPersistent ) {\n\t\t\tsetPreference(\n\t\t\t\t'core/edit-post',\n\t\t\t\t'metaBoxesMainOpenHeight',\n\t\t\t\tnextHeight\n\t\t\t);\n\t\t} else {\n\t\t\tseparatorRef.current.ariaValueNow = getAriaValueNow( nextHeight );\n\t\t}\n\t\tif ( isInstant ) {\n\t\t\tmetaBoxesMainRef.current.updateSize( {\n\t\t\t\theight: nextHeight,\n\t\t\t\t// Oddly, when the event that triggered this was not from the mouse (e.g. keydown),\n\t\t\t\t// if `width` is left unspecified a subsequent drag gesture applies a fixed\n\t\t\t\t// width and the pane fails to widen/narrow with parent width changes from\n\t\t\t\t// sidebars opening/closing or window resizes.\n\t\t\t\twidth: 'auto',\n\t\t\t} );\n\t\t}\n\t};\n\n\tif ( ! hasAnyVisible ) {\n\t\treturn;\n\t}\n\n\tconst contents = (\n\t\t<div\n\t\t\tclassName={ clsx(\n\t\t\t\t// The class name 'edit-post-layout__metaboxes' is retained because some plugins use it.\n\t\t\t\t'edit-post-layout__metaboxes',\n\t\t\t\t! isLegacy && 'edit-post-meta-boxes-main__liner'\n\t\t\t) }\n\t\t\thidden={ ! isLegacy && isShort && ! isOpen }\n\t\t>\n\t\t\t<MetaBoxes location=\"normal\" />\n\t\t\t<MetaBoxes location=\"advanced\" />\n\t\t</div>\n\t);\n\n\tif ( isLegacy ) {\n\t\treturn contents;\n\t}\n\n\tconst isAutoHeight = openHeight === undefined;\n\tlet usedMax = '50%'; // Approximation before max has a value.\n\tif ( max !== undefined ) {\n\t\t// Halves the available max height until a user height is set.\n\t\tusedMax = isAutoHeight && isUntouched ? max / 2 : max;\n\t}\n\n\tconst getAriaValueNow = ( height ) =>\n\t\tMath.round( ( ( height - min ) / ( max - min ) ) * 100 );\n\tconst usedAriaValueNow =\n\t\tmax === undefined || isAutoHeight ? 50 : getAriaValueNow( openHeight );\n\n\tconst toggle = () =>\n\t\tsetPreference( 'core/edit-post', 'metaBoxesMainIsOpen', ! isOpen );\n\n\t// TODO: Support more/all keyboard interactions from the window splitter pattern:\n\t// https://www.w3.org/WAI/ARIA/apg/patterns/windowsplitter/\n\tconst onSeparatorKeyDown = ( event ) => {\n\t\tconst delta = { ArrowUp: 20, ArrowDown: -20 }[ event.key ];\n\t\tif ( delta ) {\n\t\t\tconst pane = metaBoxesMainRef.current.resizable;\n\t\t\tconst fromHeight = isAutoHeight ? pane.offsetHeight : openHeight;\n\t\t\tconst nextHeight = delta + fromHeight;\n\t\t\tapplyHeight( nextHeight, true, true );\n\t\t\tevent.preventDefault();\n\t\t}\n\t};\n\tconst className = 'edit-post-meta-boxes-main';\n\tconst paneLabel = __( 'Meta Boxes' );\n\tlet Pane, paneProps;\n\tif ( isShort ) {\n\t\tPane = NavigableRegion;\n\t\tpaneProps = {\n\t\t\tclassName: clsx( className, 'is-toggle-only' ),\n\t\t};\n\t} else {\n\t\tPane = ResizableBox;\n\t\tpaneProps = /** @type {Parameters<typeof ResizableBox>[0]} */ ( {\n\t\t\tas: NavigableRegion,\n\t\t\tref: metaBoxesMainRef,\n\t\t\tclassName: clsx( className, 'is-resizable' ),\n\t\t\tdefaultSize: { height: openHeight },\n\t\t\tminHeight: min,\n\t\t\tmaxHeight: usedMax,\n\t\t\tenable: {\n\t\t\t\ttop: true,\n\t\t\t\tright: false,\n\t\t\t\tbottom: false,\n\t\t\t\tleft: false,\n\t\t\t\ttopLeft: false,\n\t\t\t\ttopRight: false,\n\t\t\t\tbottomRight: false,\n\t\t\t\tbottomLeft: false,\n\t\t\t},\n\t\t\thandleClasses: { top: 'edit-post-meta-boxes-main__presenter' },\n\t\t\thandleComponent: {\n\t\t\t\ttop: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<Tooltip text={ __( 'Drag to resize' ) }>\n\t\t\t\t\t\t\t<button // eslint-disable-line jsx-a11y/role-supports-aria-props\n\t\t\t\t\t\t\t\tref={ separatorRef }\n\t\t\t\t\t\t\t\trole=\"separator\" // eslint-disable-line jsx-a11y/no-interactive-element-to-noninteractive-role\n\t\t\t\t\t\t\t\taria-valuenow={ usedAriaValueNow }\n\t\t\t\t\t\t\t\taria-label={ __( 'Drag to resize' ) }\n\t\t\t\t\t\t\t\taria-describedby={ separatorHelpId }\n\t\t\t\t\t\t\t\tonKeyDown={ onSeparatorKeyDown }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t\t<VisuallyHidden id={ separatorHelpId }>\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'Use up and down arrow keys to resize the meta box panel.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\t// Avoids hiccups while dragging over objects like iframes and ensures that\n\t\t\t// the event to end the drag is captured by the target (resize handle)\n\t\t\t// whether or not it’s under the pointer.\n\t\t\tonPointerDown: ( { pointerId, target } ) => {\n\t\t\t\ttarget.setPointerCapture( pointerId );\n\t\t\t},\n\t\t\tonResizeStart: ( event, direction, elementRef ) => {\n\t\t\t\tif ( isAutoHeight ) {\n\t\t\t\t\t// Sets the starting height to avoid visual jumps in height and\n\t\t\t\t\t// aria-valuenow being `NaN` for the first (few) resize events.\n\t\t\t\t\tapplyHeight( elementRef.offsetHeight, false, true );\n\t\t\t\t\tsetIsUntouched( false );\n\t\t\t\t}\n\t\t\t},\n\t\t\tonResize: () =>\n\t\t\t\tapplyHeight( metaBoxesMainRef.current.state.height ),\n\t\t\tonResizeStop: () =>\n\t\t\t\tapplyHeight( metaBoxesMainRef.current.state.height, true ),\n\t\t} );\n\t}\n\n\treturn (\n\t\t<Pane aria-label={ paneLabel } { ...paneProps }>\n\t\t\t{ isShort ? (\n\t\t\t\t<button\n\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\tclassName=\"edit-post-meta-boxes-main__presenter\"\n\t\t\t\t\tonClick={ toggle }\n\t\t\t\t>\n\t\t\t\t\t{ paneLabel }\n\t\t\t\t\t<Icon icon={ isOpen ? chevronUp : chevronDown } />\n\t\t\t\t</button>\n\t\t\t) : (\n\t\t\t\t<meta ref={ effectSizeConstraints } />\n\t\t\t) }\n\t\t\t{ contents }\n\t\t</Pane>\n\t);\n}\n\nfunction Layout( {\n\tpostId: initialPostId,\n\tpostType: initialPostType,\n\tsettings,\n\tinitialEdits,\n} ) {\n\tuseCommands();\n\tuseEditPostCommands();\n\tconst shouldIframe = useShouldIframe();\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst {\n\t\tcurrentPost: { postId: currentPostId, postType: currentPostType },\n\t\tonNavigateToEntityRecord,\n\t\tonNavigateToPreviousEntityRecord,\n\t} = useNavigateToEntityRecord(\n\t\tinitialPostId,\n\t\tinitialPostType,\n\t\t'post-only'\n\t);\n\tconst isEditingTemplate = currentPostType === 'wp_template';\n\tconst {\n\t\tmode,\n\t\tisFullscreenActive,\n\t\thasActiveMetaboxes,\n\t\thasBlockSelected,\n\t\tshowIconLabels,\n\t\tisDistractionFree,\n\t\tshowMetaBoxes,\n\t\thasHistory,\n\t\tisWelcomeGuideVisible,\n\t\ttemplateId,\n\t\tenablePaddingAppender,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst { isFeatureActive, getEditedPostTemplateId } = unlock(\n\t\t\t\tselect( editPostStore )\n\t\t\t);\n\t\t\tconst { canUser, getPostType } = select( coreStore );\n\n\t\t\tconst supportsTemplateMode = settings.supportsTemplateMode;\n\t\t\tconst isViewable =\n\t\t\t\tgetPostType( currentPostType )?.viewable ?? false;\n\t\t\tconst canViewTemplate = canUser( 'read', {\n\t\t\t\tkind: 'postType',\n\t\t\t\tname: 'wp_template',\n\t\t\t} );\n\t\t\tconst { isZoomOut } = unlock( select( blockEditorStore ) );\n\t\t\tconst { getEditorMode, getRenderingMode } = select( editorStore );\n\t\t\tconst isRenderingPostOnly = getRenderingMode() === 'post-only';\n\n\t\t\treturn {\n\t\t\t\tmode: getEditorMode(),\n\t\t\t\tisFullscreenActive:\n\t\t\t\t\tselect( editPostStore ).isFeatureActive( 'fullscreenMode' ),\n\t\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\t\thasBlockSelected:\n\t\t\t\t\t!! select( blockEditorStore ).getBlockSelectionStart(),\n\t\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\t\tshowMetaBoxes:\n\t\t\t\t\t! DESIGN_POST_TYPES.includes( currentPostType ) &&\n\t\t\t\t\t! isZoomOut(),\n\t\t\t\tisWelcomeGuideVisible: isFeatureActive( 'welcomeGuide' ),\n\t\t\t\ttemplateId:\n\t\t\t\t\tsupportsTemplateMode &&\n\t\t\t\t\tisViewable &&\n\t\t\t\t\tcanViewTemplate &&\n\t\t\t\t\t! isEditingTemplate\n\t\t\t\t\t\t? getEditedPostTemplateId()\n\t\t\t\t\t\t: null,\n\t\t\t\tenablePaddingAppender:\n\t\t\t\t\t! isZoomOut() &&\n\t\t\t\t\tisRenderingPostOnly &&\n\t\t\t\t\t! DESIGN_POST_TYPES.includes( currentPostType ),\n\t\t\t};\n\t\t},\n\t\t[ currentPostType, isEditingTemplate, settings.supportsTemplateMode ]\n\t);\n\tconst [ paddingAppenderRef, paddingStyle ] = usePaddingAppender(\n\t\tenablePaddingAppender\n\t);\n\n\t// Set the right context for the command palette\n\tconst commandContext = hasBlockSelected\n\t\t? 'block-selection-edit'\n\t\t: 'entity-edit';\n\tuseCommandContext( commandContext );\n\tconst editorSettings = useMemo(\n\t\t() => ( {\n\t\t\t...settings,\n\t\t\tonNavigateToEntityRecord,\n\t\t\tonNavigateToPreviousEntityRecord,\n\t\t\tdefaultRenderingMode: 'post-only',\n\t\t} ),\n\t\t[ settings, onNavigateToEntityRecord, onNavigateToPreviousEntityRecord ]\n\t);\n\tconst styles = useEditorStyles( paddingStyle );\n\n\t// We need to add the show-icon-labels class to the body element so it is applied to modals.\n\tif ( showIconLabels ) {\n\t\tdocument.body.classList.add( 'show-icon-labels' );\n\t} else {\n\t\tdocument.body.classList.remove( 'show-icon-labels' );\n\t}\n\n\tconst navigateRegionsProps = useNavigateRegions();\n\n\tconst className = clsx( 'edit-post-layout', 'is-mode-' + mode, {\n\t\t'has-metaboxes': hasActiveMetaboxes,\n\t} );\n\n\tfunction onPluginAreaError( name ) {\n\t\tcreateErrorNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: plugin name */\n\t\t\t\t__(\n\t\t\t\t\t'The \"%s\" plugin has encountered an error and cannot be rendered.'\n\t\t\t\t),\n\t\t\t\tname\n\t\t\t)\n\t\t);\n\t}\n\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\n\tconst onActionPerformed = useCallback(\n\t\t( actionId, items ) => {\n\t\t\tswitch ( actionId ) {\n\t\t\t\tcase 'move-to-trash':\n\t\t\t\t\t{\n\t\t\t\t\t\tdocument.location.href = addQueryArgs( 'edit.php', {\n\t\t\t\t\t\t\ttrashed: 1,\n\t\t\t\t\t\t\tpost_type: items[ 0 ].type,\n\t\t\t\t\t\t\tids: items[ 0 ].id,\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'duplicate-post':\n\t\t\t\t\t{\n\t\t\t\t\t\tconst newItem = items[ 0 ];\n\t\t\t\t\t\tconst title =\n\t\t\t\t\t\t\ttypeof newItem.title === 'string'\n\t\t\t\t\t\t\t\t? newItem.title\n\t\t\t\t\t\t\t\t: newItem.title?.rendered;\n\t\t\t\t\t\tcreateSuccessNotice(\n\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t// translators: %s: Title of the created post or template, e.g: \"Hello world\".\n\t\t\t\t\t\t\t\t__( '\"%s\" successfully created.' ),\n\t\t\t\t\t\t\t\tdecodeEntities( title )\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\t\t\tid: 'duplicate-post-action',\n\t\t\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlabel: __( 'Edit' ),\n\t\t\t\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\t\t\t\tconst postId = newItem.id;\n\t\t\t\t\t\t\t\t\t\t\tdocument.location.href =\n\t\t\t\t\t\t\t\t\t\t\t\taddQueryArgs( 'post.php', {\n\t\t\t\t\t\t\t\t\t\t\t\t\tpost: postId,\n\t\t\t\t\t\t\t\t\t\t\t\t\taction: 'edit',\n\t\t\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t},\n\t\t[ createSuccessNotice ]\n\t);\n\n\tconst initialPost = useMemo( () => {\n\t\treturn {\n\t\t\ttype: initialPostType,\n\t\t\tid: initialPostId,\n\t\t};\n\t}, [ initialPostType, initialPostId ] );\n\n\tconst backButton =\n\t\tuseViewportMatch( 'medium' ) && isFullscreenActive ? (\n\t\t\t<BackButton initialPost={ initialPost } />\n\t\t) : null;\n\n\treturn (\n\t\t<SlotFillProvider>\n\t\t\t<ErrorBoundary>\n\t\t\t\t<CommandMenu />\n\t\t\t\t<WelcomeGuide postType={ currentPostType } />\n\t\t\t\t<div\n\t\t\t\t\tclassName={ navigateRegionsProps.className }\n\t\t\t\t\t{ ...navigateRegionsProps }\n\t\t\t\t\tref={ navigateRegionsProps.ref }\n\t\t\t\t>\n\t\t\t\t\t<Editor\n\t\t\t\t\t\tsettings={ editorSettings }\n\t\t\t\t\t\tinitialEdits={ initialEdits }\n\t\t\t\t\t\tpostType={ currentPostType }\n\t\t\t\t\t\tpostId={ currentPostId }\n\t\t\t\t\t\ttemplateId={ templateId }\n\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t\tstyles={ styles }\n\t\t\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\t\t\tcontentRef={ paddingAppenderRef }\n\t\t\t\t\t\tdisableIframe={ ! shouldIframe }\n\t\t\t\t\t\t// We should auto-focus the canvas (title) on load.\n\t\t\t\t\t\t// eslint-disable-next-line jsx-a11y/no-autofocus\n\t\t\t\t\t\tautoFocus={ ! isWelcomeGuideVisible }\n\t\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t\t\textraSidebarPanels={\n\t\t\t\t\t\t\tshowMetaBoxes && <MetaBoxes location=\"side\" />\n\t\t\t\t\t\t}\n\t\t\t\t\t\textraContent={\n\t\t\t\t\t\t\t! isDistractionFree &&\n\t\t\t\t\t\t\tshowMetaBoxes && (\n\t\t\t\t\t\t\t\t<MetaBoxesMain isLegacy={ ! shouldIframe } />\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<PostLockedModal />\n\t\t\t\t\t\t<EditorInitialization />\n\t\t\t\t\t\t<FullscreenMode isActive={ isFullscreenActive } />\n\t\t\t\t\t\t<BrowserURL hasHistory={ hasHistory } />\n\t\t\t\t\t\t<UnsavedChangesWarning />\n\t\t\t\t\t\t<AutosaveMonitor />\n\t\t\t\t\t\t<LocalAutosaveMonitor />\n\t\t\t\t\t\t<EditPostKeyboardShortcuts />\n\t\t\t\t\t\t<EditorKeyboardShortcutsRegister />\n\t\t\t\t\t\t<BlockKeyboardShortcuts />\n\t\t\t\t\t\t<InitPatternModal />\n\t\t\t\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t\t\t\t\t<PostEditorMoreMenu />\n\t\t\t\t\t\t{ backButton }\n\t\t\t\t\t\t<EditorSnackbars />\n\t\t\t\t\t</Editor>\n\t\t\t\t</div>\n\t\t\t</ErrorBoundary>\n\t\t</SlotFillProvider>\n\t);\n}\n\nexport default Layout;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,OAAA,GAAAD,OAAA;AAWA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAIA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AAOA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,YAAA,GAAAT,OAAA;AACA,IAAAU,SAAA,GAAAV,OAAA;AAIA,IAAAW,aAAA,GAAAX,OAAA;AACA,IAAAY,aAAA,GAAAZ,OAAA;AACA,IAAAa,IAAA,GAAAb,OAAA;AACA,IAAAc,aAAA,GAAAd,OAAA;AACA,IAAAe,SAAA,GAAAf,OAAA;AACA,IAAAgB,WAAA,GAAAhB,OAAA;AAQA,IAAAiB,QAAA,GAAAjB,OAAA;AASA,IAAAkB,WAAA,GAAAnB,sBAAA,CAAAC,OAAA;AACA,IAAAmB,qBAAA,GAAApB,sBAAA,CAAAC,OAAA;AACA,IAAAoB,kBAAA,GAAArB,sBAAA,CAAAC,OAAA;AACA,IAAAqB,iBAAA,GAAAtB,sBAAA,CAAAC,OAAA;AACA,IAAAsB,WAAA,GAAAvB,sBAAA,CAAAC,OAAA;AACA,IAAAuB,UAAA,GAAAxB,sBAAA,CAAAC,OAAA;AACA,IAAAwB,SAAA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AAC,eAClD,IAAAhM,WAAA,CAAA8G,GAAA,EAACxH,WAAA,CAAAyH,OAAU;YAACuF,UAAU,EAAGA;UAAY,CAAE,CAAC,eACxC,IAAAtM,WAAA,CAAA8G,GAAA,EAAC7I,OAAA,CAAA2S,qBAAqB,IAAE,CAAC,eACzB,IAAA5Q,WAAA,CAAA8G,GAAA,EAAC7I,OAAA,CAAA4S,eAAe,IAAE,CAAC,eACnB,IAAA7Q,WAAA,CAAA8G,GAAA,EAAC7I,OAAA,CAAA6S,oBAAoB,IAAE,CAAC,eACxB,IAAA9Q,WAAA,CAAA8G,GAAA,EAAC1H,kBAAA,CAAA2H,OAAyB,IAAE,CAAC,eAC7B,IAAA/G,WAAA,CAAA8G,GAAA,EAAC7I,OAAA,CAAA8S,+BAA+B,IAAE,CAAC,eACnC,IAAA/Q,WAAA,CAAA8G,GAAA,EAAClG,sBAAsB,IAAE,CAAC,eAC1B,IAAAZ,WAAA,CAAA8G,GAAA,EAACzH,iBAAA,CAAA0H,OAAgB,IAAE,CAAC,eACpB,IAAA/G,WAAA,CAAA8G,GAAA,EAAC1I,QAAA,CAAA4S,UAAU;YAACC,OAAO,EAAGxC;UAAmB,CAAE,CAAC,eAC5C,IAAAzO,WAAA,CAAA8G,GAAA,EAACtH,SAAA,CAAAuH,OAAkB,IAAE,CAAC,EACpBgJ,UAAU,eACZ,IAAA/P,WAAA,CAAA8G,GAAA,EAAC7I,OAAA,CAAAiT,eAAe,IAAE,CAAC;QAAA,CACZ;MAAC,CACL,CAAC;IAAA,CACQ;EAAC,CACC,CAAC;AAErB;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAArK,OAAA,GAEc6D,MAAM","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_editor","_data","_blockEditor","_plugins","_i18n","_element","_icons","_notices","_preferences","_commands","_coreCommands","_blockLibrary","_url","_htmlEntities","_coreData","_components","_compose","_backButton","_editorInitialization","_keyboardShortcuts","_initPatternModal","_browserUrl","_metaBoxes","_moreMenu","_welcomeGuide","_store","_lockUnlock","_useCommands","_usePaddingAppender","_useShouldIframe","_useNavigateToEntityRecord","_jsxRuntime","getLayoutStyles","unlock","blockEditorPrivateApis","useCommands","coreCommandsPrivateApis","useCommandContext","commandsPrivateApis","Editor","FullscreenMode","NavigableRegion","editorPrivateApis","BlockKeyboardShortcuts","blockLibraryPrivateApis","DESIGN_POST_TYPES","useEditorStyles","additionalStyles","hasThemeStyleSupport","editorSettings","useSelect","select","editPostStore","isFeatureActive","editorStore","getEditorSettings","addedStyles","join","useMemo","_editorSettings$style","_editorSettings$defau","_editorSettings$style2","_editorSettings$style3","presetStyles","styles","filter","style","__unstableType","defaultEditorStyles","hasThemeStyles","length","disableLayoutStyles","push","css","selector","hasBlockGapSupport","hasFallbackGapSupport","fallbackGapValue","baseStyles","MetaBoxesMain","isLegacy","isOpen","openHeight","hasAnyVisible","get","preferencesStore","isMetaBoxLocationVisible","set","setPreference","useDispatch","metaBoxesMainRef","useRef","isShort","useMediaQuery","min","max","setHeightConstraints","useState","effectSizeConstraints","useRefEffect","node","container","closest","noticeLists","querySelectorAll","resizeHandle","querySelector","deriveConstraints","fullHeight","offsetHeight","nextMax","element","nextMin","observer","window","ResizeObserver","observe","disconnect","separatorRef","separatorHelpId","useId","isUntouched","setIsUntouched","applyHeight","candidateHeight","isPersistent","isInstant","nextHeight","Math","current","ariaValueNow","getAriaValueNow","updateSize","height","width","contents","jsxs","className","clsx","hidden","children","jsx","default","location","isAutoHeight","undefined","usedMax","round","usedAriaValueNow","toggle","onSeparatorKeyDown","event","delta","ArrowUp","ArrowDown","key","pane","resizable","fromHeight","preventDefault","paneLabel","__","Pane","paneProps","ResizableBox","as","ref","defaultSize","minHeight","maxHeight","enable","top","right","bottom","left","topLeft","topRight","bottomRight","bottomLeft","handleClasses","handleComponent","Fragment","Tooltip","text","role","onKeyDown","VisuallyHidden","id","onPointerDown","pointerId","target","setPointerCapture","onResizeStart","direction","elementRef","onResize","state","onResizeStop","onClick","Icon","icon","chevronUp","chevronDown","Layout","postId","initialPostId","postType","initialPostType","settings","initialEdits","useEditPostCommands","shouldIframe","useShouldIframe","createErrorNotice","noticesStore","currentPost","currentPostId","currentPostType","onNavigateToEntityRecord","onNavigateToPreviousEntityRecord","useNavigateToEntityRecord","isEditingTemplate","mode","isFullscreenActive","hasActiveMetaboxes","hasBlockSelected","showIconLabels","isDistractionFree","showMetaBoxes","isWelcomeGuideVisible","templateId","enablePaddingAppender","_getPostType$viewable","canUser","getPostType","getTemplateId","coreStore","supportsTemplateMode","isViewable","viewable","canViewTemplate","kind","name","isZoomOut","blockEditorStore","getEditorMode","getRenderingMode","isRenderingPostOnly","hasMetaBoxes","getBlockSelectionStart","includes","paddingAppenderRef","paddingStyle","usePaddingAppender","commandContext","defaultRenderingMode","document","body","classList","add","remove","navigateRegionsProps","useNavigateRegions","onPluginAreaError","sprintf","createSuccessNotice","onActionPerformed","useCallback","actionId","items","href","addQueryArgs","trashed","post_type","type","ids","newItem","title","rendered","decodeEntities","actions","label","post","action","initialPost","backButton","useViewportMatch","SlotFillProvider","ErrorBoundary","CommandMenu","forceIsDirty","contentRef","disableIframe","autoFocus","extraSidebarPanels","extraContent","PostLockedModal","isActive","UnsavedChangesWarning","AutosaveMonitor","LocalAutosaveMonitor","EditorKeyboardShortcutsRegister","PluginArea","onError","EditorSnackbars","_default","exports"],"sources":["@wordpress/edit-post/src/components/layout/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAutosaveMonitor,\n\tLocalAutosaveMonitor,\n\tUnsavedChangesWarning,\n\tEditorKeyboardShortcutsRegister,\n\tEditorSnackbars,\n\tErrorBoundary,\n\tPostLockedModal,\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { PluginArea } from '@wordpress/plugins';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tuseCallback,\n\tuseMemo,\n\tuseId,\n\tuseRef,\n\tuseState,\n} from '@wordpress/element';\nimport { chevronDown, chevronUp } from '@wordpress/icons';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tCommandMenu,\n\tprivateApis as commandsPrivateApis,\n} from '@wordpress/commands';\nimport { privateApis as coreCommandsPrivateApis } from '@wordpress/core-commands';\nimport { privateApis as blockLibraryPrivateApis } from '@wordpress/block-library';\nimport { addQueryArgs } from '@wordpress/url';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tIcon,\n\tResizableBox,\n\tSlotFillProvider,\n\tTooltip,\n\tVisuallyHidden,\n\t__unstableUseNavigateRegions as useNavigateRegions,\n} from '@wordpress/components';\nimport {\n\tuseMediaQuery,\n\tuseRefEffect,\n\tuseViewportMatch,\n} from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BackButton from '../back-button';\nimport EditorInitialization from '../editor-initialization';\nimport EditPostKeyboardShortcuts from '../keyboard-shortcuts';\nimport InitPatternModal from '../init-pattern-modal';\nimport BrowserURL from '../browser-url';\nimport MetaBoxes from '../meta-boxes';\nimport PostEditorMoreMenu from '../more-menu';\nimport WelcomeGuide from '../welcome-guide';\nimport { store as editPostStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport useEditPostCommands from '../../commands/use-commands';\nimport { usePaddingAppender } from './use-padding-appender';\nimport { useShouldIframe } from './use-should-iframe';\nimport useNavigateToEntityRecord from '../../hooks/use-navigate-to-entity-record';\n\nconst { getLayoutStyles } = unlock( blockEditorPrivateApis );\nconst { useCommands } = unlock( coreCommandsPrivateApis );\nconst { useCommandContext } = unlock( commandsPrivateApis );\nconst { Editor, FullscreenMode, NavigableRegion } = unlock( editorPrivateApis );\nconst { BlockKeyboardShortcuts } = unlock( blockLibraryPrivateApis );\nconst DESIGN_POST_TYPES = [\n\t'wp_template',\n\t'wp_template_part',\n\t'wp_block',\n\t'wp_navigation',\n];\n\nfunction useEditorStyles( ...additionalStyles ) {\n\tconst { hasThemeStyleSupport, editorSettings } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\thasThemeStyleSupport:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'themeStyles' ),\n\t\t\teditorSettings: select( editorStore ).getEditorSettings(),\n\t\t};\n\t}, [] );\n\n\tconst addedStyles = additionalStyles.join( '\\n' );\n\n\t// Compute the default styles.\n\treturn useMemo( () => {\n\t\tconst presetStyles =\n\t\t\teditorSettings.styles?.filter(\n\t\t\t\t( style ) =>\n\t\t\t\t\tstyle.__unstableType && style.__unstableType !== 'theme'\n\t\t\t) ?? [];\n\n\t\tconst defaultEditorStyles = [\n\t\t\t...( editorSettings?.defaultEditorStyles ?? [] ),\n\t\t\t...presetStyles,\n\t\t];\n\n\t\t// Has theme styles if the theme supports them and if some styles were not preset styles (in which case they're theme styles).\n\t\tconst hasThemeStyles =\n\t\t\thasThemeStyleSupport &&\n\t\t\tpresetStyles.length !== ( editorSettings.styles?.length ?? 0 );\n\n\t\t// If theme styles are not present or displayed, ensure that\n\t\t// base layout styles are still present in the editor.\n\t\tif ( ! editorSettings.disableLayoutStyles && ! hasThemeStyles ) {\n\t\t\tdefaultEditorStyles.push( {\n\t\t\t\tcss: getLayoutStyles( {\n\t\t\t\t\tstyle: {},\n\t\t\t\t\tselector: 'body',\n\t\t\t\t\thasBlockGapSupport: false,\n\t\t\t\t\thasFallbackGapSupport: true,\n\t\t\t\t\tfallbackGapValue: '0.5em',\n\t\t\t\t} ),\n\t\t\t} );\n\t\t}\n\n\t\tconst baseStyles = hasThemeStyles\n\t\t\t? editorSettings.styles ?? []\n\t\t\t: defaultEditorStyles;\n\n\t\tif ( addedStyles ) {\n\t\t\treturn [ ...baseStyles, { css: addedStyles } ];\n\t\t}\n\n\t\treturn baseStyles;\n\t}, [\n\t\teditorSettings.defaultEditorStyles,\n\t\teditorSettings.disableLayoutStyles,\n\t\teditorSettings.styles,\n\t\thasThemeStyleSupport,\n\t\taddedStyles,\n\t] );\n}\n\n/**\n * @param {Object} props\n * @param {boolean} props.isLegacy True when the editor canvas is not in an iframe.\n */\nfunction MetaBoxesMain( { isLegacy } ) {\n\tconst [ isOpen, openHeight, hasAnyVisible ] = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { isMetaBoxLocationVisible } = select( editPostStore );\n\t\treturn [\n\t\t\tget( 'core/edit-post', 'metaBoxesMainIsOpen' ),\n\t\t\tget( 'core/edit-post', 'metaBoxesMainOpenHeight' ),\n\t\t\tisMetaBoxLocationVisible( 'normal' ) ||\n\t\t\t\tisMetaBoxLocationVisible( 'advanced' ) ||\n\t\t\t\tisMetaBoxLocationVisible( 'side' ),\n\t\t];\n\t}, [] );\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\tconst metaBoxesMainRef = useRef();\n\tconst isShort = useMediaQuery( '(max-height: 549px)' );\n\n\tconst [ { min, max }, setHeightConstraints ] = useState( () => ( {} ) );\n\t// Keeps the resizable area’s size constraints updated taking into account\n\t// editor notices. The constraints are also used to derive the value for the\n\t// aria-valuenow attribute on the seperator.\n\tconst effectSizeConstraints = useRefEffect( ( node ) => {\n\t\tconst container = node.closest(\n\t\t\t'.interface-interface-skeleton__content'\n\t\t);\n\t\tconst noticeLists = container.querySelectorAll(\n\t\t\t':scope > .components-notice-list'\n\t\t);\n\t\tconst resizeHandle = container.querySelector(\n\t\t\t'.edit-post-meta-boxes-main__presenter'\n\t\t);\n\t\tconst deriveConstraints = () => {\n\t\t\tconst fullHeight = container.offsetHeight;\n\t\t\tlet nextMax = fullHeight;\n\t\t\tfor ( const element of noticeLists ) {\n\t\t\t\tnextMax -= element.offsetHeight;\n\t\t\t}\n\t\t\tconst nextMin = resizeHandle.offsetHeight;\n\t\t\tsetHeightConstraints( { min: nextMin, max: nextMax } );\n\t\t};\n\t\tconst observer = new window.ResizeObserver( deriveConstraints );\n\t\tobserver.observe( container );\n\t\tfor ( const element of noticeLists ) {\n\t\t\tobserver.observe( element );\n\t\t}\n\t\treturn () => observer.disconnect();\n\t}, [] );\n\n\tconst separatorRef = useRef();\n\tconst separatorHelpId = useId();\n\n\tconst [ isUntouched, setIsUntouched ] = useState( true );\n\tconst applyHeight = ( candidateHeight, isPersistent, isInstant ) => {\n\t\tconst nextHeight = Math.min( max, Math.max( min, candidateHeight ) );\n\t\tif ( isPersistent ) {\n\t\t\tsetPreference(\n\t\t\t\t'core/edit-post',\n\t\t\t\t'metaBoxesMainOpenHeight',\n\t\t\t\tnextHeight\n\t\t\t);\n\t\t} else {\n\t\t\tseparatorRef.current.ariaValueNow = getAriaValueNow( nextHeight );\n\t\t}\n\t\tif ( isInstant ) {\n\t\t\tmetaBoxesMainRef.current.updateSize( {\n\t\t\t\theight: nextHeight,\n\t\t\t\t// Oddly, when the event that triggered this was not from the mouse (e.g. keydown),\n\t\t\t\t// if `width` is left unspecified a subsequent drag gesture applies a fixed\n\t\t\t\t// width and the pane fails to widen/narrow with parent width changes from\n\t\t\t\t// sidebars opening/closing or window resizes.\n\t\t\t\twidth: 'auto',\n\t\t\t} );\n\t\t}\n\t};\n\n\tif ( ! hasAnyVisible ) {\n\t\treturn;\n\t}\n\n\tconst contents = (\n\t\t<div\n\t\t\tclassName={ clsx(\n\t\t\t\t// The class name 'edit-post-layout__metaboxes' is retained because some plugins use it.\n\t\t\t\t'edit-post-layout__metaboxes',\n\t\t\t\t! isLegacy && 'edit-post-meta-boxes-main__liner'\n\t\t\t) }\n\t\t\thidden={ ! isLegacy && isShort && ! isOpen }\n\t\t>\n\t\t\t<MetaBoxes location=\"normal\" />\n\t\t\t<MetaBoxes location=\"advanced\" />\n\t\t</div>\n\t);\n\n\tif ( isLegacy ) {\n\t\treturn contents;\n\t}\n\n\tconst isAutoHeight = openHeight === undefined;\n\tlet usedMax = '50%'; // Approximation before max has a value.\n\tif ( max !== undefined ) {\n\t\t// Halves the available max height until a user height is set.\n\t\tusedMax = isAutoHeight && isUntouched ? max / 2 : max;\n\t}\n\n\tconst getAriaValueNow = ( height ) =>\n\t\tMath.round( ( ( height - min ) / ( max - min ) ) * 100 );\n\tconst usedAriaValueNow =\n\t\tmax === undefined || isAutoHeight ? 50 : getAriaValueNow( openHeight );\n\n\tconst toggle = () =>\n\t\tsetPreference( 'core/edit-post', 'metaBoxesMainIsOpen', ! isOpen );\n\n\t// TODO: Support more/all keyboard interactions from the window splitter pattern:\n\t// https://www.w3.org/WAI/ARIA/apg/patterns/windowsplitter/\n\tconst onSeparatorKeyDown = ( event ) => {\n\t\tconst delta = { ArrowUp: 20, ArrowDown: -20 }[ event.key ];\n\t\tif ( delta ) {\n\t\t\tconst pane = metaBoxesMainRef.current.resizable;\n\t\t\tconst fromHeight = isAutoHeight ? pane.offsetHeight : openHeight;\n\t\t\tconst nextHeight = delta + fromHeight;\n\t\t\tapplyHeight( nextHeight, true, true );\n\t\t\tevent.preventDefault();\n\t\t}\n\t};\n\tconst className = 'edit-post-meta-boxes-main';\n\tconst paneLabel = __( 'Meta Boxes' );\n\tlet Pane, paneProps;\n\tif ( isShort ) {\n\t\tPane = NavigableRegion;\n\t\tpaneProps = {\n\t\t\tclassName: clsx( className, 'is-toggle-only' ),\n\t\t};\n\t} else {\n\t\tPane = ResizableBox;\n\t\tpaneProps = /** @type {Parameters<typeof ResizableBox>[0]} */ ( {\n\t\t\tas: NavigableRegion,\n\t\t\tref: metaBoxesMainRef,\n\t\t\tclassName: clsx( className, 'is-resizable' ),\n\t\t\tdefaultSize: { height: openHeight },\n\t\t\tminHeight: min,\n\t\t\tmaxHeight: usedMax,\n\t\t\tenable: {\n\t\t\t\ttop: true,\n\t\t\t\tright: false,\n\t\t\t\tbottom: false,\n\t\t\t\tleft: false,\n\t\t\t\ttopLeft: false,\n\t\t\t\ttopRight: false,\n\t\t\t\tbottomRight: false,\n\t\t\t\tbottomLeft: false,\n\t\t\t},\n\t\t\thandleClasses: { top: 'edit-post-meta-boxes-main__presenter' },\n\t\t\thandleComponent: {\n\t\t\t\ttop: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<Tooltip text={ __( 'Drag to resize' ) }>\n\t\t\t\t\t\t\t<button // eslint-disable-line jsx-a11y/role-supports-aria-props\n\t\t\t\t\t\t\t\tref={ separatorRef }\n\t\t\t\t\t\t\t\trole=\"separator\" // eslint-disable-line jsx-a11y/no-interactive-element-to-noninteractive-role\n\t\t\t\t\t\t\t\taria-valuenow={ usedAriaValueNow }\n\t\t\t\t\t\t\t\taria-label={ __( 'Drag to resize' ) }\n\t\t\t\t\t\t\t\taria-describedby={ separatorHelpId }\n\t\t\t\t\t\t\t\tonKeyDown={ onSeparatorKeyDown }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t\t<VisuallyHidden id={ separatorHelpId }>\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'Use up and down arrow keys to resize the meta box panel.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\t// Avoids hiccups while dragging over objects like iframes and ensures that\n\t\t\t// the event to end the drag is captured by the target (resize handle)\n\t\t\t// whether or not it’s under the pointer.\n\t\t\tonPointerDown: ( { pointerId, target } ) => {\n\t\t\t\ttarget.setPointerCapture( pointerId );\n\t\t\t},\n\t\t\tonResizeStart: ( event, direction, elementRef ) => {\n\t\t\t\tif ( isAutoHeight ) {\n\t\t\t\t\t// Sets the starting height to avoid visual jumps in height and\n\t\t\t\t\t// aria-valuenow being `NaN` for the first (few) resize events.\n\t\t\t\t\tapplyHeight( elementRef.offsetHeight, false, true );\n\t\t\t\t\tsetIsUntouched( false );\n\t\t\t\t}\n\t\t\t},\n\t\t\tonResize: () =>\n\t\t\t\tapplyHeight( metaBoxesMainRef.current.state.height ),\n\t\t\tonResizeStop: () =>\n\t\t\t\tapplyHeight( metaBoxesMainRef.current.state.height, true ),\n\t\t} );\n\t}\n\n\treturn (\n\t\t<Pane aria-label={ paneLabel } { ...paneProps }>\n\t\t\t{ isShort ? (\n\t\t\t\t<button\n\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\tclassName=\"edit-post-meta-boxes-main__presenter\"\n\t\t\t\t\tonClick={ toggle }\n\t\t\t\t>\n\t\t\t\t\t{ paneLabel }\n\t\t\t\t\t<Icon icon={ isOpen ? chevronUp : chevronDown } />\n\t\t\t\t</button>\n\t\t\t) : (\n\t\t\t\t<meta ref={ effectSizeConstraints } />\n\t\t\t) }\n\t\t\t{ contents }\n\t\t</Pane>\n\t);\n}\n\nfunction Layout( {\n\tpostId: initialPostId,\n\tpostType: initialPostType,\n\tsettings,\n\tinitialEdits,\n} ) {\n\tuseCommands();\n\tuseEditPostCommands();\n\tconst shouldIframe = useShouldIframe();\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst {\n\t\tcurrentPost: { postId: currentPostId, postType: currentPostType },\n\t\tonNavigateToEntityRecord,\n\t\tonNavigateToPreviousEntityRecord,\n\t} = useNavigateToEntityRecord(\n\t\tinitialPostId,\n\t\tinitialPostType,\n\t\t'post-only'\n\t);\n\tconst isEditingTemplate = currentPostType === 'wp_template';\n\tconst {\n\t\tmode,\n\t\tisFullscreenActive,\n\t\thasActiveMetaboxes,\n\t\thasBlockSelected,\n\t\tshowIconLabels,\n\t\tisDistractionFree,\n\t\tshowMetaBoxes,\n\t\tisWelcomeGuideVisible,\n\t\ttemplateId,\n\t\tenablePaddingAppender,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst { isFeatureActive } = select( editPostStore );\n\t\t\tconst { canUser, getPostType, getTemplateId } = unlock(\n\t\t\t\tselect( coreStore )\n\t\t\t);\n\n\t\t\tconst supportsTemplateMode = settings.supportsTemplateMode;\n\t\t\tconst isViewable =\n\t\t\t\tgetPostType( currentPostType )?.viewable ?? false;\n\t\t\tconst canViewTemplate = canUser( 'read', {\n\t\t\t\tkind: 'postType',\n\t\t\t\tname: 'wp_template',\n\t\t\t} );\n\t\t\tconst { isZoomOut } = unlock( select( blockEditorStore ) );\n\t\t\tconst { getEditorMode, getRenderingMode } = select( editorStore );\n\t\t\tconst isRenderingPostOnly = getRenderingMode() === 'post-only';\n\n\t\t\treturn {\n\t\t\t\tmode: getEditorMode(),\n\t\t\t\tisFullscreenActive:\n\t\t\t\t\tselect( editPostStore ).isFeatureActive( 'fullscreenMode' ),\n\t\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\t\thasBlockSelected:\n\t\t\t\t\t!! select( blockEditorStore ).getBlockSelectionStart(),\n\t\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\t\tshowMetaBoxes:\n\t\t\t\t\t! DESIGN_POST_TYPES.includes( currentPostType ) &&\n\t\t\t\t\t! isZoomOut(),\n\t\t\t\tisWelcomeGuideVisible: isFeatureActive( 'welcomeGuide' ),\n\t\t\t\ttemplateId:\n\t\t\t\t\tsupportsTemplateMode &&\n\t\t\t\t\tisViewable &&\n\t\t\t\t\tcanViewTemplate &&\n\t\t\t\t\t! isEditingTemplate\n\t\t\t\t\t\t? getTemplateId( currentPostType, currentPostId )\n\t\t\t\t\t\t: null,\n\t\t\t\tenablePaddingAppender:\n\t\t\t\t\t! isZoomOut() &&\n\t\t\t\t\tisRenderingPostOnly &&\n\t\t\t\t\t! DESIGN_POST_TYPES.includes( currentPostType ),\n\t\t\t};\n\t\t},\n\t\t[\n\t\t\tcurrentPostType,\n\t\t\tcurrentPostId,\n\t\t\tisEditingTemplate,\n\t\t\tsettings.supportsTemplateMode,\n\t\t]\n\t);\n\tconst [ paddingAppenderRef, paddingStyle ] = usePaddingAppender(\n\t\tenablePaddingAppender\n\t);\n\n\t// Set the right context for the command palette\n\tconst commandContext = hasBlockSelected\n\t\t? 'block-selection-edit'\n\t\t: 'entity-edit';\n\tuseCommandContext( commandContext );\n\tconst editorSettings = useMemo(\n\t\t() => ( {\n\t\t\t...settings,\n\t\t\tonNavigateToEntityRecord,\n\t\t\tonNavigateToPreviousEntityRecord,\n\t\t\tdefaultRenderingMode: 'post-only',\n\t\t} ),\n\t\t[ settings, onNavigateToEntityRecord, onNavigateToPreviousEntityRecord ]\n\t);\n\tconst styles = useEditorStyles( paddingStyle );\n\n\t// We need to add the show-icon-labels class to the body element so it is applied to modals.\n\tif ( showIconLabels ) {\n\t\tdocument.body.classList.add( 'show-icon-labels' );\n\t} else {\n\t\tdocument.body.classList.remove( 'show-icon-labels' );\n\t}\n\n\tconst navigateRegionsProps = useNavigateRegions();\n\n\tconst className = clsx( 'edit-post-layout', 'is-mode-' + mode, {\n\t\t'has-metaboxes': hasActiveMetaboxes,\n\t} );\n\n\tfunction onPluginAreaError( name ) {\n\t\tcreateErrorNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: plugin name */\n\t\t\t\t__(\n\t\t\t\t\t'The \"%s\" plugin has encountered an error and cannot be rendered.'\n\t\t\t\t),\n\t\t\t\tname\n\t\t\t)\n\t\t);\n\t}\n\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\n\tconst onActionPerformed = useCallback(\n\t\t( actionId, items ) => {\n\t\t\tswitch ( actionId ) {\n\t\t\t\tcase 'move-to-trash':\n\t\t\t\t\t{\n\t\t\t\t\t\tdocument.location.href = addQueryArgs( 'edit.php', {\n\t\t\t\t\t\t\ttrashed: 1,\n\t\t\t\t\t\t\tpost_type: items[ 0 ].type,\n\t\t\t\t\t\t\tids: items[ 0 ].id,\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'duplicate-post':\n\t\t\t\t\t{\n\t\t\t\t\t\tconst newItem = items[ 0 ];\n\t\t\t\t\t\tconst title =\n\t\t\t\t\t\t\ttypeof newItem.title === 'string'\n\t\t\t\t\t\t\t\t? newItem.title\n\t\t\t\t\t\t\t\t: newItem.title?.rendered;\n\t\t\t\t\t\tcreateSuccessNotice(\n\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t// translators: %s: Title of the created post or template, e.g: \"Hello world\".\n\t\t\t\t\t\t\t\t__( '\"%s\" successfully created.' ),\n\t\t\t\t\t\t\t\tdecodeEntities( title )\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\t\t\tid: 'duplicate-post-action',\n\t\t\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlabel: __( 'Edit' ),\n\t\t\t\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\t\t\t\tconst postId = newItem.id;\n\t\t\t\t\t\t\t\t\t\t\tdocument.location.href =\n\t\t\t\t\t\t\t\t\t\t\t\taddQueryArgs( 'post.php', {\n\t\t\t\t\t\t\t\t\t\t\t\t\tpost: postId,\n\t\t\t\t\t\t\t\t\t\t\t\t\taction: 'edit',\n\t\t\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t},\n\t\t[ createSuccessNotice ]\n\t);\n\n\tconst initialPost = useMemo( () => {\n\t\treturn {\n\t\t\ttype: initialPostType,\n\t\t\tid: initialPostId,\n\t\t};\n\t}, [ initialPostType, initialPostId ] );\n\n\tconst backButton =\n\t\tuseViewportMatch( 'medium' ) && isFullscreenActive ? (\n\t\t\t<BackButton initialPost={ initialPost } />\n\t\t) : null;\n\n\treturn (\n\t\t<SlotFillProvider>\n\t\t\t<ErrorBoundary>\n\t\t\t\t<CommandMenu />\n\t\t\t\t<WelcomeGuide postType={ currentPostType } />\n\t\t\t\t<div\n\t\t\t\t\tclassName={ navigateRegionsProps.className }\n\t\t\t\t\t{ ...navigateRegionsProps }\n\t\t\t\t\tref={ navigateRegionsProps.ref }\n\t\t\t\t>\n\t\t\t\t\t<Editor\n\t\t\t\t\t\tsettings={ editorSettings }\n\t\t\t\t\t\tinitialEdits={ initialEdits }\n\t\t\t\t\t\tpostType={ currentPostType }\n\t\t\t\t\t\tpostId={ currentPostId }\n\t\t\t\t\t\ttemplateId={ templateId }\n\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t\tstyles={ styles }\n\t\t\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\t\t\tcontentRef={ paddingAppenderRef }\n\t\t\t\t\t\tdisableIframe={ ! shouldIframe }\n\t\t\t\t\t\t// We should auto-focus the canvas (title) on load.\n\t\t\t\t\t\t// eslint-disable-next-line jsx-a11y/no-autofocus\n\t\t\t\t\t\tautoFocus={ ! isWelcomeGuideVisible }\n\t\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t\t\textraSidebarPanels={\n\t\t\t\t\t\t\tshowMetaBoxes && <MetaBoxes location=\"side\" />\n\t\t\t\t\t\t}\n\t\t\t\t\t\textraContent={\n\t\t\t\t\t\t\t! isDistractionFree &&\n\t\t\t\t\t\t\tshowMetaBoxes && (\n\t\t\t\t\t\t\t\t<MetaBoxesMain isLegacy={ ! shouldIframe } />\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<PostLockedModal />\n\t\t\t\t\t\t<EditorInitialization />\n\t\t\t\t\t\t<FullscreenMode isActive={ isFullscreenActive } />\n\t\t\t\t\t\t<BrowserURL />\n\t\t\t\t\t\t<UnsavedChangesWarning />\n\t\t\t\t\t\t<AutosaveMonitor />\n\t\t\t\t\t\t<LocalAutosaveMonitor />\n\t\t\t\t\t\t<EditPostKeyboardShortcuts />\n\t\t\t\t\t\t<EditorKeyboardShortcutsRegister />\n\t\t\t\t\t\t<BlockKeyboardShortcuts />\n\t\t\t\t\t\t<InitPatternModal />\n\t\t\t\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t\t\t\t\t<PostEditorMoreMenu />\n\t\t\t\t\t\t{ backButton }\n\t\t\t\t\t\t<EditorSnackbars />\n\t\t\t\t\t</Editor>\n\t\t\t\t</div>\n\t\t\t</ErrorBoundary>\n\t\t</SlotFillProvider>\n\t);\n}\n\nexport default Layout;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,OAAA,GAAAD,OAAA;AAWA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAIA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AAOA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,YAAA,GAAAT,OAAA;AACA,IAAAU,SAAA,GAAAV,OAAA;AAIA,IAAAW,aAAA,GAAAX,OAAA;AACA,IAAAY,aAAA,GAAAZ,OAAA;AACA,IAAAa,IAAA,GAAAb,OAAA;AACA,IAAAc,aAAA,GAAAd,OAAA;AACA,IAAAe,SAAA,GAAAf,OAAA;AACA,IAAAgB,WAAA,GAAAhB,OAAA;AAQA,IAAAiB,QAAA,GAAAjB,OAAA;AASA,IAAAkB,WAAA,GAAAnB,sBAAA,CAAAC,OAAA;AACA,IAAAmB,qBAAA,GAAApB,sBAAA,CAAAC,OAAA;AACA,IAAAoB,kBAAA,GAAArB,sBAAA,CAAAC,OAAA;AACA,IAAAqB,iBAAA,GAAAtB,sBAAA,CAAAC,OAAA;AACA,IAAAsB,WAAA,GAAAvB,sBAAA,CAAAC,OAAA;AACA,IAAAuB,UAAA,GAAAxB,sBAAA,CAAAC,OAAA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Ac;YAACiQ,QAAQ,EAAG1E;UAAoB,CAAE,CAAC,eAClD,IAAAhM,WAAA,CAAA8G,GAAA,EAACxH,WAAA,CAAAyH,OAAU,IAAE,CAAC,eACd,IAAA/G,WAAA,CAAA8G,GAAA,EAAC7I,OAAA,CAAA0S,qBAAqB,IAAE,CAAC,eACzB,IAAA3Q,WAAA,CAAA8G,GAAA,EAAC7I,OAAA,CAAA2S,eAAe,IAAE,CAAC,eACnB,IAAA5Q,WAAA,CAAA8G,GAAA,EAAC7I,OAAA,CAAA4S,oBAAoB,IAAE,CAAC,eACxB,IAAA7Q,WAAA,CAAA8G,GAAA,EAAC1H,kBAAA,CAAA2H,OAAyB,IAAE,CAAC,eAC7B,IAAA/G,WAAA,CAAA8G,GAAA,EAAC7I,OAAA,CAAA6S,+BAA+B,IAAE,CAAC,eACnC,IAAA9Q,WAAA,CAAA8G,GAAA,EAAClG,sBAAsB,IAAE,CAAC,eAC1B,IAAAZ,WAAA,CAAA8G,GAAA,EAACzH,iBAAA,CAAA0H,OAAgB,IAAE,CAAC,eACpB,IAAA/G,WAAA,CAAA8G,GAAA,EAAC1I,QAAA,CAAA2S,UAAU;YAACC,OAAO,EAAGxC;UAAmB,CAAE,CAAC,eAC5C,IAAAxO,WAAA,CAAA8G,GAAA,EAACtH,SAAA,CAAAuH,OAAkB,IAAE,CAAC,EACpB+I,UAAU,eACZ,IAAA9P,WAAA,CAAA8G,GAAA,EAAC7I,OAAA,CAAAgT,eAAe,IAAE,CAAC;QAAA,CACZ;MAAC,CACL,CAAC;IAAA,CACQ;EAAC,CACC,CAAC;AAErB;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAApK,OAAA,GAEc6D,MAAM","ignoreList":[]}
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = void 0;
6
+ exports.default = MetaBoxVisibility;
7
7
  var _element = require("@wordpress/element");
8
8
  var _data = require("@wordpress/data");
9
9
  var _editor = require("@wordpress/editor");
@@ -11,20 +11,13 @@ var _editor = require("@wordpress/editor");
11
11
  * WordPress dependencies
12
12
  */
13
13
 
14
- class MetaBoxVisibility extends _element.Component {
15
- componentDidMount() {
16
- this.updateDOM();
17
- }
18
- componentDidUpdate(prevProps) {
19
- if (this.props.isVisible !== prevProps.isVisible) {
20
- this.updateDOM();
21
- }
22
- }
23
- updateDOM() {
24
- const {
25
- id,
26
- isVisible
27
- } = this.props;
14
+ function MetaBoxVisibility({
15
+ id
16
+ }) {
17
+ const isVisible = (0, _data.useSelect)(select => {
18
+ return select(_editor.store).isEditorPanelEnabled(`meta-box-${id}`);
19
+ }, [id]);
20
+ (0, _element.useEffect)(() => {
28
21
  const element = document.getElementById(id);
29
22
  if (!element) {
30
23
  return;
@@ -34,14 +27,7 @@ class MetaBoxVisibility extends _element.Component {
34
27
  } else {
35
28
  element.classList.add('is-hidden');
36
29
  }
37
- }
38
- render() {
39
- return null;
40
- }
30
+ }, [id, isVisible]);
31
+ return null;
41
32
  }
42
- var _default = exports.default = (0, _data.withSelect)((select, {
43
- id
44
- }) => ({
45
- isVisible: select(_editor.store).isEditorPanelEnabled(`meta-box-${id}`)
46
- }))(MetaBoxVisibility);
47
33
  //# sourceMappingURL=meta-box-visibility.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_data","_editor","MetaBoxVisibility","Component","componentDidMount","updateDOM","componentDidUpdate","prevProps","props","isVisible","id","element","document","getElementById","classList","remove","add","render","_default","exports","default","withSelect","select","editorStore","isEditorPanelEnabled"],"sources":["@wordpress/edit-post/src/components/meta-boxes/meta-box-visibility.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { withSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\n\nclass MetaBoxVisibility extends Component {\n\tcomponentDidMount() {\n\t\tthis.updateDOM();\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tif ( this.props.isVisible !== prevProps.isVisible ) {\n\t\t\tthis.updateDOM();\n\t\t}\n\t}\n\n\tupdateDOM() {\n\t\tconst { id, isVisible } = this.props;\n\n\t\tconst element = document.getElementById( id );\n\t\tif ( ! element ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isVisible ) {\n\t\t\telement.classList.remove( 'is-hidden' );\n\t\t} else {\n\t\t\telement.classList.add( 'is-hidden' );\n\t\t}\n\t}\n\n\trender() {\n\t\treturn null;\n\t}\n}\n\nexport default withSelect( ( select, { id } ) => ( {\n\tisVisible: select( editorStore ).isEditorPanelEnabled( `meta-box-${ id }` ),\n} ) )( MetaBoxVisibility );\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AALA;AACA;AACA;;AAKA,MAAMG,iBAAiB,SAASC,kBAAS,CAAC;EACzCC,iBAAiBA,CAAA,EAAG;IACnB,IAAI,CAACC,SAAS,CAAC,CAAC;EACjB;EAEAC,kBAAkBA,CAAEC,SAAS,EAAG;IAC/B,IAAK,IAAI,CAACC,KAAK,CAACC,SAAS,KAAKF,SAAS,CAACE,SAAS,EAAG;MACnD,IAAI,CAACJ,SAAS,CAAC,CAAC;IACjB;EACD;EAEAA,SAASA,CAAA,EAAG;IACX,MAAM;MAAEK,EAAE;MAAED;IAAU,CAAC,GAAG,IAAI,CAACD,KAAK;IAEpC,MAAMG,OAAO,GAAGC,QAAQ,CAACC,cAAc,CAAEH,EAAG,CAAC;IAC7C,IAAK,CAAEC,OAAO,EAAG;MAChB;IACD;IAEA,IAAKF,SAAS,EAAG;MAChBE,OAAO,CAACG,SAAS,CAACC,MAAM,CAAE,WAAY,CAAC;IACxC,CAAC,MAAM;MACNJ,OAAO,CAACG,SAAS,CAACE,GAAG,CAAE,WAAY,CAAC;IACrC;EACD;EAEAC,MAAMA,CAAA,EAAG;IACR,OAAO,IAAI;EACZ;AACD;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc,IAAAC,gBAAU,EAAE,CAAEC,MAAM,EAAE;EAAEZ;AAAG,CAAC,MAAQ;EAClDD,SAAS,EAAEa,MAAM,CAAEC,aAAY,CAAC,CAACC,oBAAoB,CAAE,YAAad,EAAE,EAAI;AAC3E,CAAC,CAAG,CAAC,CAAER,iBAAkB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_element","require","_data","_editor","MetaBoxVisibility","id","isVisible","useSelect","select","editorStore","isEditorPanelEnabled","useEffect","element","document","getElementById","classList","remove","add"],"sources":["@wordpress/edit-post/src/components/meta-boxes/meta-box-visibility.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\n\nexport default function MetaBoxVisibility( { id } ) {\n\tconst isVisible = useSelect(\n\t\t( select ) => {\n\t\t\treturn select( editorStore ).isEditorPanelEnabled(\n\t\t\t\t`meta-box-${ id }`\n\t\t\t);\n\t\t},\n\t\t[ id ]\n\t);\n\n\tuseEffect( () => {\n\t\tconst element = document.getElementById( id );\n\t\tif ( ! element ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isVisible ) {\n\t\t\telement.classList.remove( 'is-hidden' );\n\t\t} else {\n\t\t\telement.classList.add( 'is-hidden' );\n\t\t}\n\t}, [ id, isVisible ] );\n\n\treturn null;\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AALA;AACA;AACA;;AAKe,SAASG,iBAAiBA,CAAE;EAAEC;AAAG,CAAC,EAAG;EACnD,MAAMC,SAAS,GAAG,IAAAC,eAAS,EACxBC,MAAM,IAAM;IACb,OAAOA,MAAM,CAAEC,aAAY,CAAC,CAACC,oBAAoB,CAChD,YAAaL,EAAE,EAChB,CAAC;EACF,CAAC,EACD,CAAEA,EAAE,CACL,CAAC;EAED,IAAAM,kBAAS,EAAE,MAAM;IAChB,MAAMC,OAAO,GAAGC,QAAQ,CAACC,cAAc,CAAET,EAAG,CAAC;IAC7C,IAAK,CAAEO,OAAO,EAAG;MAChB;IACD;IAEA,IAAKN,SAAS,EAAG;MAChBM,OAAO,CAACG,SAAS,CAACC,MAAM,CAAE,WAAY,CAAC;IACxC,CAAC,MAAM;MACNJ,OAAO,CAACG,SAAS,CAACE,GAAG,CAAE,WAAY,CAAC;IACrC;EACD,CAAC,EAAE,CAAEZ,EAAE,EAAEC,SAAS,CAAG,CAAC;EAEtB,OAAO,IAAI;AACZ","ignoreList":[]}
@@ -4,8 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.CustomFieldsConfirmation = CustomFieldsConfirmation;
7
- exports.EnableCustomFieldsOption = EnableCustomFieldsOption;
8
- exports.default = void 0;
7
+ exports.default = EnableCustomFieldsOption;
9
8
  var _element = require("@wordpress/element");
10
9
  var _i18n = require("@wordpress/i18n");
11
10
  var _components = require("@wordpress/components");
@@ -56,9 +55,11 @@ function CustomFieldsConfirmation({
56
55
  });
57
56
  }
58
57
  function EnableCustomFieldsOption({
59
- label,
60
- areCustomFieldsEnabled
58
+ label
61
59
  }) {
60
+ const areCustomFieldsEnabled = (0, _data.useSelect)(select => {
61
+ return !!select(_editor.store).getEditorSettings().enableCustomFields;
62
+ }, []);
62
63
  const [isChecked, setIsChecked] = (0, _element.useState)(areCustomFieldsEnabled);
63
64
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(PreferenceBaseOption, {
64
65
  label: label,
@@ -69,7 +70,4 @@ function EnableCustomFieldsOption({
69
70
  })
70
71
  });
71
72
  }
72
- var _default = exports.default = (0, _data.withSelect)(select => ({
73
- areCustomFieldsEnabled: !!select(_editor.store).getEditorSettings().enableCustomFields
74
- }))(EnableCustomFieldsOption);
75
73
  //# sourceMappingURL=enable-custom-fields.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_i18n","_components","_data","_editor","_preferences","_url","_lockUnlock","_jsxRuntime","PreferenceBaseOption","unlock","preferencesPrivateApis","submitCustomFieldsForm","customFieldsForm","document","getElementById","querySelector","setAttribute","getPathAndQueryString","window","location","href","submit","CustomFieldsConfirmation","willEnable","isReloading","setIsReloading","useState","jsxs","Fragment","children","jsx","className","__","Button","__next40pxDefaultSize","variant","isBusy","accessibleWhenDisabled","disabled","onClick","EnableCustomFieldsOption","label","areCustomFieldsEnabled","isChecked","setIsChecked","onChange","_default","exports","default","withSelect","select","editorStore","getEditorSettings","enableCustomFields"],"sources":["@wordpress/edit-post/src/components/preferences-modal/enable-custom-fields.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { withSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { privateApis as preferencesPrivateApis } from '@wordpress/preferences';\nimport { getPathAndQueryString } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { PreferenceBaseOption } = unlock( preferencesPrivateApis );\n\nfunction submitCustomFieldsForm() {\n\tconst customFieldsForm = document.getElementById(\n\t\t'toggle-custom-fields-form'\n\t);\n\n\t// Ensure the referrer values is up to update with any\n\tcustomFieldsForm\n\t\t.querySelector( '[name=\"_wp_http_referer\"]' )\n\t\t.setAttribute( 'value', getPathAndQueryString( window.location.href ) );\n\n\tcustomFieldsForm.submit();\n}\n\nexport function CustomFieldsConfirmation( { willEnable } ) {\n\tconst [ isReloading, setIsReloading ] = useState( false );\n\treturn (\n\t\t<>\n\t\t\t<p className=\"edit-post-preferences-modal__custom-fields-confirmation-message\">\n\t\t\t\t{ __(\n\t\t\t\t\t'A page reload is required for this change. Make sure your content is saved before reloading.'\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<Button\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tvariant=\"secondary\"\n\t\t\t\tisBusy={ isReloading }\n\t\t\t\taccessibleWhenDisabled\n\t\t\t\tdisabled={ isReloading }\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tsetIsReloading( true );\n\t\t\t\t\tsubmitCustomFieldsForm();\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ willEnable\n\t\t\t\t\t? __( 'Show & Reload Page' )\n\t\t\t\t\t: __( 'Hide & Reload Page' ) }\n\t\t\t</Button>\n\t\t</>\n\t);\n}\n\nexport function EnableCustomFieldsOption( { label, areCustomFieldsEnabled } ) {\n\tconst [ isChecked, setIsChecked ] = useState( areCustomFieldsEnabled );\n\n\treturn (\n\t\t<PreferenceBaseOption\n\t\t\tlabel={ label }\n\t\t\tisChecked={ isChecked }\n\t\t\tonChange={ setIsChecked }\n\t\t>\n\t\t\t{ isChecked !== areCustomFieldsEnabled && (\n\t\t\t\t<CustomFieldsConfirmation willEnable={ isChecked } />\n\t\t\t) }\n\t\t</PreferenceBaseOption>\n\t);\n}\n\nexport default withSelect( ( select ) => ( {\n\tareCustomFieldsEnabled:\n\t\t!! select( editorStore ).getEditorSettings().enableCustomFields,\n} ) )( EnableCustomFieldsOption );\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,IAAA,GAAAN,OAAA;AAKA,IAAAO,WAAA,GAAAP,OAAA;AAA2C,IAAAQ,WAAA,GAAAR,OAAA;AAd3C;AACA;AACA;;AASA;AACA;AACA;;AAGA,MAAM;EAAES;AAAqB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAEjE,SAASC,sBAAsBA,CAAA,EAAG;EACjC,MAAMC,gBAAgB,GAAGC,QAAQ,CAACC,cAAc,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AAS,EAAGA,SAAW;IACvBE,QAAQ,EAAGD,YAAc;IAAAf,QAAA,EAEvBc,SAAS,KAAKD,sBAAsB,iBACrC,IAAAnC,WAAA,CAAAuB,GAAA,EAACR,wBAAwB;MAACC,UAAU,EAAGoB;IAAW,CAAE;EACpD,CACoB,CAAC;AAEzB;AAAC,IAAAG,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc,IAAAC,gBAAU,EAAIC,MAAM,KAAQ;EAC1CR,sBAAsB,EACrB,CAAC,CAAEQ,MAAM,CAAEC,aAAY,CAAC,CAACC,iBAAiB,CAAC,CAAC,CAACC;AAC/C,CAAC,CAAG,CAAC,CAAEb,wBAAyB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_element","require","_i18n","_components","_data","_editor","_preferences","_url","_lockUnlock","_jsxRuntime","PreferenceBaseOption","unlock","preferencesPrivateApis","submitCustomFieldsForm","customFieldsForm","document","getElementById","querySelector","setAttribute","getPathAndQueryString","window","location","href","submit","CustomFieldsConfirmation","willEnable","isReloading","setIsReloading","useState","jsxs","Fragment","children","jsx","className","__","Button","__next40pxDefaultSize","variant","isBusy","accessibleWhenDisabled","disabled","onClick","EnableCustomFieldsOption","label","areCustomFieldsEnabled","useSelect","select","editorStore","getEditorSettings","enableCustomFields","isChecked","setIsChecked","onChange"],"sources":["@wordpress/edit-post/src/components/preferences-modal/enable-custom-fields.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { privateApis as preferencesPrivateApis } from '@wordpress/preferences';\nimport { getPathAndQueryString } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { PreferenceBaseOption } = unlock( preferencesPrivateApis );\n\nfunction submitCustomFieldsForm() {\n\tconst customFieldsForm = document.getElementById(\n\t\t'toggle-custom-fields-form'\n\t);\n\n\t// Ensure the referrer values is up to update with any\n\tcustomFieldsForm\n\t\t.querySelector( '[name=\"_wp_http_referer\"]' )\n\t\t.setAttribute( 'value', getPathAndQueryString( window.location.href ) );\n\n\tcustomFieldsForm.submit();\n}\n\nexport function CustomFieldsConfirmation( { willEnable } ) {\n\tconst [ isReloading, setIsReloading ] = useState( false );\n\treturn (\n\t\t<>\n\t\t\t<p className=\"edit-post-preferences-modal__custom-fields-confirmation-message\">\n\t\t\t\t{ __(\n\t\t\t\t\t'A page reload is required for this change. Make sure your content is saved before reloading.'\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<Button\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tvariant=\"secondary\"\n\t\t\t\tisBusy={ isReloading }\n\t\t\t\taccessibleWhenDisabled\n\t\t\t\tdisabled={ isReloading }\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tsetIsReloading( true );\n\t\t\t\t\tsubmitCustomFieldsForm();\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ willEnable\n\t\t\t\t\t? __( 'Show & Reload Page' )\n\t\t\t\t\t: __( 'Hide & Reload Page' ) }\n\t\t\t</Button>\n\t\t</>\n\t);\n}\n\nexport default function EnableCustomFieldsOption( { label } ) {\n\tconst areCustomFieldsEnabled = useSelect( ( select ) => {\n\t\treturn !! select( editorStore ).getEditorSettings().enableCustomFields;\n\t}, [] );\n\tconst [ isChecked, setIsChecked ] = useState( areCustomFieldsEnabled );\n\n\treturn (\n\t\t<PreferenceBaseOption\n\t\t\tlabel={ label }\n\t\t\tisChecked={ isChecked }\n\t\t\tonChange={ setIsChecked }\n\t\t>\n\t\t\t{ isChecked !== areCustomFieldsEnabled && (\n\t\t\t\t<CustomFieldsConfirmation willEnable={ isChecked } />\n\t\t\t) }\n\t\t</PreferenceBaseOption>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,I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C;MACzB,CAAG;MAAAkB,QAAA,EAEDN,UAAU,GACT,IAAAS,QAAE,EAAE,oBAAqB,CAAC,GAC1B,IAAAA,QAAE,EAAE,oBAAqB;IAAC,CACtB,CAAC;EAAA,CACR,CAAC;AAEL;AAEe,SAASQ,wBAAwBA,CAAE;EAAEC;AAAM,CAAC,EAAG;EAC7D,MAAMC,sBAAsB,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACvD,OAAO,CAAC,CAAEA,MAAM,CAAEC,aAAY,CAAC,CAACC,iBAAiB,CAAC,CAAC,CAACC,kBAAkB;EACvE,CAAC,EAAE,EAAG,CAAC;EACP,MAAM,CAAEC,SAAS,EAAEC,YAAY,CAAE,GAAG,IAAAvB,iBAAQ,EAAEgB,sBAAuB,CAAC;EAEtE,oBACC,IAAAnC,WAAA,CAAAuB,GAAA,EAACtB,oBAAoB;IACpBiC,KAAK,EAAGA,KAAO;IACfO,SAAS,EAAGA,SAAW;IACvBE,QAAQ,EAAGD,YAAc;IAAApB,QAAA,EAEvBmB,SAAS,KAAKN,sBAAsB,iBACrC,IAAAnC,WAAA,CAAAuB,GAAA,EAACR,wBAAwB;MAACC,UAAU,EAAGyB;IAAW,CAAE;EACpD,CACoB,CAAC;AAEzB","ignoreList":[]}
@@ -3,12 +3,12 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = void 0;
7
- var _compose = require("@wordpress/compose");
6
+ exports.default = EnablePanelOption;
8
7
  var _data = require("@wordpress/data");
9
8
  var _editor = require("@wordpress/editor");
10
9
  var _preferences = require("@wordpress/preferences");
11
10
  var _lockUnlock = require("../../lock-unlock");
11
+ var _jsxRuntime = require("react/jsx-runtime");
12
12
  /**
13
13
  * WordPress dependencies
14
14
  */
@@ -20,22 +20,30 @@ var _lockUnlock = require("../../lock-unlock");
20
20
  const {
21
21
  PreferenceBaseOption
22
22
  } = (0, _lockUnlock.unlock)(_preferences.privateApis);
23
- var _default = exports.default = (0, _compose.compose)((0, _data.withSelect)((select, {
24
- panelName
25
- }) => {
23
+ function EnablePanelOption(props) {
26
24
  const {
27
- isEditorPanelEnabled,
28
- isEditorPanelRemoved
29
- } = select(_editor.store);
30
- return {
31
- isRemoved: isEditorPanelRemoved(panelName),
32
- isChecked: isEditorPanelEnabled(panelName)
33
- };
34
- }), (0, _compose.ifCondition)(({
35
- isRemoved
36
- }) => !isRemoved), (0, _data.withDispatch)((dispatch, {
37
- panelName
38
- }) => ({
39
- onChange: () => dispatch(_editor.store).toggleEditorPanelEnabled(panelName)
40
- })))(PreferenceBaseOption);
25
+ toggleEditorPanelEnabled
26
+ } = (0, _data.useDispatch)(_editor.store);
27
+ const {
28
+ isChecked,
29
+ isRemoved
30
+ } = (0, _data.useSelect)(select => {
31
+ const {
32
+ isEditorPanelEnabled,
33
+ isEditorPanelRemoved
34
+ } = select(_editor.store);
35
+ return {
36
+ isChecked: isEditorPanelEnabled(props.panelName),
37
+ isRemoved: isEditorPanelRemoved(props.panelName)
38
+ };
39
+ }, [props.panelName]);
40
+ if (isRemoved) {
41
+ return null;
42
+ }
43
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(PreferenceBaseOption, {
44
+ isChecked: isChecked,
45
+ onChange: () => toggleEditorPanelEnabled(props.panelName),
46
+ ...props
47
+ });
48
+ }
41
49
  //# sourceMappingURL=enable-panel.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_compose","require","_data","_editor","_preferences","_lockUnlock","PreferenceBaseOption","unlock","preferencesPrivateApis","_default","exports","default","compose","withSelect","select","panelName","isEditorPanelEnabled","isEditorPanelRemoved","editorStore","isRemoved","isChecked","ifCondition","withDispatch","dispatch","onChange","toggleEditorPanelEnabled"],"sources":["@wordpress/edit-post/src/components/preferences-modal/enable-panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { compose, ifCondition } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { privateApis as preferencesPrivateApis } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { PreferenceBaseOption } = unlock( preferencesPrivateApis );\n\nexport default compose(\n\twithSelect( ( select, { panelName } ) => {\n\t\tconst { isEditorPanelEnabled, isEditorPanelRemoved } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\tisRemoved: isEditorPanelRemoved( panelName ),\n\t\t\tisChecked: isEditorPanelEnabled( panelName ),\n\t\t};\n\t} ),\n\tifCondition( ( { isRemoved } ) => ! isRemoved ),\n\twithDispatch( ( dispatch, { panelName } ) => ( {\n\t\tonChange: () =>\n\t\t\tdispatch( editorStore ).toggleEditorPanelEnabled( panelName ),\n\t} ) )\n)( PreferenceBaseOption );\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAKA,IAAAI,WAAA,GAAAJ,OAAA;AAXA;AACA;AACA;;AAMA;AACA;AACA;;AAGA,MAAM;EAAEK;AAAqB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEnD,IAAAC,gBAAO,EACrB,IAAAC,gBAAU,EAAE,CAAEC,MAAM,EAAE;EAAEC;AAAU,CAAC,KAAM;EACxC,MAAM;IAAEC,oBAAoB;IAAEC;EAAqB,CAAC,GACnDH,MAAM,CAAEI,aAAY,CAAC;EACtB,OAAO;IACNC,SAAS,EAAEF,oBAAoB,CAAEF,SAAU,CAAC;IAC5CK,SAAS,EAAEJ,oBAAoB,CAAED,SAAU;EAC5C,CAAC;AACF,CAAE,CAAC,EACH,IAAAM,oBAAW,EAAE,CAAE;EAAEF;AAAU,CAAC,KAAM,CAAEA,SAAU,CAAC,EAC/C,IAAAG,kBAAY,EAAE,CAAEC,QAAQ,EAAE;EAAER;AAAU,CAAC,MAAQ;EAC9CS,QAAQ,EAAEA,CAAA,KACTD,QAAQ,CAAEL,aAAY,CAAC,CAACO,wBAAwB,CAAEV,SAAU;AAC9D,CAAC,CAAG,CACL,CAAC,CAAET,oBAAqB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_data","require","_editor","_preferences","_lockUnlock","_jsxRuntime","PreferenceBaseOption","unlock","preferencesPrivateApis","EnablePanelOption","props","toggleEditorPanelEnabled","useDispatch","editorStore","isChecked","isRemoved","useSelect","select","isEditorPanelEnabled","isEditorPanelRemoved","panelName","jsx","onChange"],"sources":["@wordpress/edit-post/src/components/preferences-modal/enable-panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { privateApis as preferencesPrivateApis } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { PreferenceBaseOption } = unlock( preferencesPrivateApis );\n\nexport default function EnablePanelOption( props ) {\n\tconst { toggleEditorPanelEnabled } = useDispatch( editorStore );\n\tconst { isChecked, isRemoved } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { isEditorPanelEnabled, isEditorPanelRemoved } =\n\t\t\t\tselect( editorStore );\n\t\t\treturn {\n\t\t\t\tisChecked: isEditorPanelEnabled( props.panelName ),\n\t\t\t\tisRemoved: isEditorPanelRemoved( props.panelName ),\n\t\t\t};\n\t\t},\n\t\t[ props.panelName ]\n\t);\n\n\tif ( isRemoved ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PreferenceBaseOption\n\t\t\tisChecked={ isChecked }\n\t\t\tonChange={ () => toggleEditorPanelEnabled( props.panelName ) }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAKA,IAAAG,WAAA,GAAAH,OAAA;AAA2C,IAAAI,WAAA,GAAAJ,OAAA;AAV3C;AACA;AACA;;AAKA;AACA;AACA;;AAGA,MAAM;EAAEK;AAAqB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAElD,SAASC,iBAAiBA,CAAEC,KAAK,EAAG;EAClD,MAAM;IAAEC;EAAyB,CAAC,GAAG,IAAAC,iBAAW,EAAEC,aAAY,CAAC;EAC/D,MAAM;IAAEC,SAAS;IAAEC;EAAU,CAAC,GAAG,IAAAC,eAAS,EACvCC,MAAM,IAAM;IACb,MAAM;MAAEC,oBAAoB;MAAEC;IAAqB,CAAC,GACnDF,MAAM,CAAEJ,aAAY,CAAC;IACtB,OAAO;MACNC,SAAS,EAAEI,oBAAoB,CAAER,KAAK,CAACU,SAAU,CAAC;MAClDL,SAAS,EAAEI,oBAAoB,CAAET,KAAK,CAACU,SAAU;IAClD,CAAC;EACF,CAAC,EACD,CAAEV,KAAK,CAACU,SAAS,CAClB,CAAC;EAED,IAAKL,SAAS,EAAG;IAChB,OAAO,IAAI;EACZ;EAEA,oBACC,IAAAV,WAAA,CAAAgB,GAAA,EAACf,oBAAoB;IACpBQ,SAAS,EAAGA,SAAW;IACvBQ,QAAQ,EAAGA,CAAA,KAAMX,wBAAwB,CAAED,KAAK,CAACU,SAAU,CAAG;IAAA,GACzDV;EAAK,CACV,CAAC;AAEJ","ignoreList":[]}
@@ -9,9 +9,7 @@ var _data = require("@wordpress/data");
9
9
  var _reducer = _interopRequireDefault(require("./reducer"));
10
10
  var actions = _interopRequireWildcard(require("./actions"));
11
11
  var selectors = _interopRequireWildcard(require("./selectors"));
12
- var privateSelectors = _interopRequireWildcard(require("./private-selectors"));
13
12
  var _constants = require("./constants");
14
- var _lockUnlock = require("../lock-unlock");
15
13
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
16
14
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
17
15
  /**
@@ -35,5 +33,4 @@ const store = exports.store = (0, _data.createReduxStore)(_constants.STORE_NAME,
35
33
  selectors
36
34
  });
37
35
  (0, _data.register)(store);
38
- (0, _lockUnlock.unlock)(store).registerPrivateSelectors(privateSelectors);
39
36
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_reducer","_interopRequireDefault","actions","_interopRequireWildcard","selectors","privateSelectors","_constants","_lockUnlock","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","store","exports","createReduxStore","STORE_NAME","reducer","register","unlock","registerPrivateSelectors"],"sources":["@wordpress/edit-post/src/store/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createReduxStore, register } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport reducer from './reducer';\nimport * as actions from './actions';\nimport * as selectors from './selectors';\nimport * as privateSelectors from './private-selectors';\nimport { STORE_NAME } from './constants';\nimport { unlock } from '../lock-unlock';\n\n/**\n * Store definition for the edit post namespace.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore\n *\n * @type {Object}\n */\nexport const store = createReduxStore( STORE_NAME, {\n\treducer,\n\tactions,\n\tselectors,\n} );\nregister( store );\nunlock( store ).registerPrivateSelectors( privateSelectors );\n"],"mappings":";;;;;;;AAGA,IAAA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AN,CAAA,CAAAH,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAe,GAAA,CAAAlB,CAAA,EAAAQ,CAAA,GAAAA,CAAA;AAbxC;AACA;AACA;;AAGA;AACA;AACA;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMW,KAAK,GAAAC,OAAA,CAAAD,KAAA,GAAG,IAAAE,sBAAgB,EAAEC,qBAAU,EAAE;EAClDC,OAAO,EAAPA,gBAAO;EACP9B,OAAO;EACPE;AACD,CAAE,CAAC;AACH,IAAA6B,cAAQ,EAAEL,KAAM,CAAC;AACjB,IAAAM,kBAAM,EAAEN,KAAM,CAAC,CAACO,wBAAwB,CAAE9B,gBAAiB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_data","require","_reducer","_interopRequireDefault","actions","_interopRequireWildcard","selectors","_constants","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","store","exports","createReduxStore","STORE_NAME","reducer","register"],"sources":["@wordpress/edit-post/src/store/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createReduxStore, register } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport reducer from './reducer';\nimport * as actions from './actions';\nimport * as selectors from './selectors';\nimport { STORE_NAME } from './constants';\n\n/**\n * Store definition for the edit post namespace.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore\n *\n * @type {Object}\n */\nexport const store = createReduxStore( STORE_NAME, {\n\treducer,\n\tactions,\n\tselectors,\n} );\nregister( store );\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAC,uBAAA,CAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAD,uBAAA,CAAAJ,OAAA;AACA,IAAAM,UAAA,G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qBAAU,EAAE;EAClDC,OAAO,EAAPA,gBAAO;EACP5B,OAAO;EACPE;AACD,CAAE,CAAC;AACH,IAAA2B,cAAQ,EAAEL,KAAM,CAAC","ignoreList":[]}
@@ -21,7 +21,6 @@ var _coreData = require("@wordpress/core-data");
21
21
  var _editor = require("@wordpress/editor");
22
22
  var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
23
23
  var _lockUnlock = require("../lock-unlock");
24
- var _privateSelectors = require("./private-selectors");
25
24
  /**
26
25
  * WordPress dependencies
27
26
  */
@@ -502,8 +501,12 @@ function areMetaBoxesInitialized(state) {
502
501
  *
503
502
  * @return {Object?} Post Template.
504
503
  */
505
- const getEditedPostTemplate = exports.getEditedPostTemplate = (0, _data.createRegistrySelector)(select => state => {
506
- const templateId = (0, _privateSelectors.getEditedPostTemplateId)(state);
504
+ const getEditedPostTemplate = exports.getEditedPostTemplate = (0, _data.createRegistrySelector)(select => () => {
505
+ const {
506
+ id: postId,
507
+ type: postType
508
+ } = select(_editor.store).getCurrentPost();
509
+ const templateId = (0, _lockUnlock.unlock)(select(_coreData.store)).getTemplateId(postType, postId);
507
510
  if (!templateId) {
508
511
  return undefined;
509
512
  }