@wordpress/edit-post 8.2.0 → 8.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/components/back-button/fullscreen-mode-close.js +2 -13
  3. package/build/components/back-button/fullscreen-mode-close.js.map +1 -1
  4. package/build/components/init-pattern-modal/index.js +2 -11
  5. package/build/components/init-pattern-modal/index.js.map +1 -1
  6. package/build/components/layout/index.js +12 -5
  7. package/build/components/layout/index.js.map +1 -1
  8. package/build/components/more-menu/manage-patterns-menu-item.js +4 -1
  9. package/build/components/more-menu/manage-patterns-menu-item.js.map +1 -1
  10. package/build/components/preferences-modal/enable-custom-fields.js +1 -1
  11. package/build/components/preferences-modal/enable-custom-fields.js.map +1 -1
  12. package/build/editor.native.js +0 -7
  13. package/build/editor.native.js.map +1 -1
  14. package/build/index.js +7 -1
  15. package/build/index.js.map +1 -1
  16. package/build/store/private-selectors.js +6 -2
  17. package/build/store/private-selectors.js.map +1 -1
  18. package/build-module/components/back-button/fullscreen-mode-close.js +2 -13
  19. package/build-module/components/back-button/fullscreen-mode-close.js.map +1 -1
  20. package/build-module/components/init-pattern-modal/index.js +2 -12
  21. package/build-module/components/init-pattern-modal/index.js.map +1 -1
  22. package/build-module/components/layout/index.js +12 -5
  23. package/build-module/components/layout/index.js.map +1 -1
  24. package/build-module/components/more-menu/manage-patterns-menu-item.js +4 -1
  25. package/build-module/components/more-menu/manage-patterns-menu-item.js.map +1 -1
  26. package/build-module/components/preferences-modal/enable-custom-fields.js +1 -1
  27. package/build-module/components/preferences-modal/enable-custom-fields.js.map +1 -1
  28. package/build-module/editor.native.js +0 -7
  29. package/build-module/editor.native.js.map +1 -1
  30. package/build-module/index.js +7 -1
  31. package/build-module/index.js.map +1 -1
  32. package/build-module/store/private-selectors.js +6 -2
  33. package/build-module/store/private-selectors.js.map +1 -1
  34. package/build-style/style-rtl.css +6 -10
  35. package/build-style/style.css +6 -10
  36. package/package.json +31 -31
  37. package/src/components/back-button/fullscreen-mode-close.js +3 -11
  38. package/src/components/back-button/style.scss +0 -4
  39. package/src/components/init-pattern-modal/index.js +1 -11
  40. package/src/components/layout/index.js +15 -3
  41. package/src/components/layout/style.scss +0 -5
  42. package/src/components/more-menu/manage-patterns-menu-item.js +6 -1
  43. package/src/components/preferences-modal/enable-custom-fields.js +1 -1
  44. package/src/components/preferences-modal/test/__snapshots__/enable-custom-fields.js.snap +4 -4
  45. package/src/components/preferences-modal/test/__snapshots__/meta-boxes-section.js.snap +3 -3
  46. package/src/editor.native.js +0 -5
  47. package/src/index.js +9 -2
  48. package/src/store/private-selectors.js +7 -2
  49. package/src/style.scss +4 -2
package/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 8.4.0 (2024-07-24)
6
+
7
+ ## 8.3.0 (2024-07-10)
8
+
5
9
  ## 8.2.0 (2024-06-26)
6
10
 
7
11
  ## 8.1.0 (2024-06-15)
@@ -14,7 +14,6 @@ var _icons = require("@wordpress/icons");
14
14
  var _editor = require("@wordpress/editor");
15
15
  var _coreData = require("@wordpress/core-data");
16
16
  var _compose = require("@wordpress/compose");
17
- var _store = require("../../store");
18
17
  var _jsxRuntime = require("react/jsx-runtime");
19
18
  /**
20
19
  * External dependencies
@@ -24,10 +23,6 @@ var _jsxRuntime = require("react/jsx-runtime");
24
23
  * WordPress dependencies
25
24
  */
26
25
 
27
- /**
28
- * Internal dependencies
29
- */
30
-
31
26
  function FullscreenModeClose({
32
27
  showTooltip,
33
28
  icon,
@@ -36,7 +31,6 @@ function FullscreenModeClose({
36
31
  }) {
37
32
  var _postType$labels$view;
38
33
  const {
39
- isActive,
40
34
  isRequestingSiteIcon,
41
35
  postType,
42
36
  siteIconUrl
@@ -44,9 +38,6 @@ function FullscreenModeClose({
44
38
  const {
45
39
  getCurrentPostType
46
40
  } = select(_editor.store);
47
- const {
48
- isFeatureActive
49
- } = select(_store.store);
50
41
  const {
51
42
  getEntityRecord,
52
43
  getPostType,
@@ -55,14 +46,13 @@ function FullscreenModeClose({
55
46
  const siteData = getEntityRecord('root', '__unstableBase', undefined) || {};
56
47
  const _postType = initialPost?.type || getCurrentPostType();
57
48
  return {
58
- isActive: isFeatureActive('fullscreenMode'),
59
49
  isRequestingSiteIcon: isResolving('getEntityRecord', ['root', '__unstableBase', undefined]),
60
50
  postType: getPostType(_postType),
61
51
  siteIconUrl: siteData.site_icon_url
62
52
  };
63
53
  }, []);
64
54
  const disableMotion = (0, _compose.useReducedMotion)();
65
- if (!isActive || !postType) {
55
+ if (!postType) {
66
56
  return null;
67
57
  }
68
58
  let buttonIcon = /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Icon, {
@@ -97,8 +87,7 @@ function FullscreenModeClose({
97
87
  icon: icon
98
88
  });
99
89
  }
100
- const classes = (0, _clsx.default)({
101
- 'edit-post-fullscreen-mode-close': true,
90
+ const classes = (0, _clsx.default)('edit-post-fullscreen-mode-close', {
102
91
  'has-icon': siteIconUrl
103
92
  });
104
93
  const buttonHref = href !== null && href !== void 0 ? href : (0, _url.addQueryArgs)('edit.php', {
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_data","_components","_i18n","_url","_icons","_editor","_coreData","_compose","_store","_jsxRuntime","FullscreenModeClose","showTooltip","icon","href","initialPost","_postType$labels$view","isActive","isRequestingSiteIcon","postType","siteIconUrl","useSelect","select","getCurrentPostType","editorStore","isFeatureActive","editPostStore","getEntityRecord","getPostType","isResolving","coreStore","siteData","undefined","_postType","type","site_icon_url","disableMotion","useReducedMotion","buttonIcon","jsx","Icon","size","wordpress","effect","expand","scale","transition","duration","__unstableMotion","img","variants","alt","__","className","src","classes","clsx","buttonHref","addQueryArgs","post_type","slug","buttonLabel","labels","view_items","div","whileHover","children","Button","label","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/back-button/fullscreen-mode-close.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tButton,\n\tIcon,\n\t__unstableMotion as motion,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { addQueryArgs } from '@wordpress/url';\nimport { wordpress } from '@wordpress/icons';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useReducedMotion } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nfunction FullscreenModeClose( { showTooltip, icon, href, initialPost } ) {\n\tconst { isActive, isRequestingSiteIcon, postType, siteIconUrl } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getCurrentPostType } = select( editorStore );\n\t\t\tconst { isFeatureActive } = select( editPostStore );\n\t\t\tconst { getEntityRecord, getPostType, isResolving } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst siteData =\n\t\t\t\tgetEntityRecord( 'root', '__unstableBase', undefined ) || {};\n\t\t\tconst _postType = initialPost?.type || getCurrentPostType();\n\t\t\treturn {\n\t\t\t\tisActive: isFeatureActive( 'fullscreenMode' ),\n\t\t\t\tisRequestingSiteIcon: isResolving( 'getEntityRecord', [\n\t\t\t\t\t'root',\n\t\t\t\t\t'__unstableBase',\n\t\t\t\t\tundefined,\n\t\t\t\t] ),\n\t\t\t\tpostType: getPostType( _postType ),\n\t\t\t\tsiteIconUrl: siteData.site_icon_url,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst disableMotion = useReducedMotion();\n\n\tif ( ! isActive || ! postType ) {\n\t\treturn null;\n\t}\n\n\tlet buttonIcon = <Icon size=\"36px\" icon={ wordpress } />;\n\n\tconst effect = {\n\t\texpand: {\n\t\t\tscale: 1.25,\n\t\t\ttransition: { type: 'tween', duration: '0.3' },\n\t\t},\n\t};\n\n\tif ( siteIconUrl ) {\n\t\tbuttonIcon = (\n\t\t\t<motion.img\n\t\t\t\tvariants={ ! disableMotion && effect }\n\t\t\t\talt={ __( 'Site Icon' ) }\n\t\t\t\tclassName=\"edit-post-fullscreen-mode-close_site-icon\"\n\t\t\t\tsrc={ siteIconUrl }\n\t\t\t/>\n\t\t);\n\t}\n\n\tif ( isRequestingSiteIcon ) {\n\t\tbuttonIcon = null;\n\t}\n\n\t// Override default icon if custom icon is provided via props.\n\tif ( icon ) {\n\t\tbuttonIcon = <Icon size=\"36px\" icon={ icon } />;\n\t}\n\n\tconst classes = clsx( {\n\t\t'edit-post-fullscreen-mode-close': true,\n\t\t'has-icon': siteIconUrl,\n\t} );\n\n\tconst buttonHref =\n\t\thref ??\n\t\taddQueryArgs( 'edit.php', {\n\t\t\tpost_type: postType.slug,\n\t\t} );\n\n\tconst buttonLabel = postType?.labels?.view_items ?? __( 'Back' );\n\n\treturn (\n\t\t<motion.div whileHover=\"expand\">\n\t\t\t<Button\n\t\t\t\tclassName={ classes }\n\t\t\t\thref={ buttonHref }\n\t\t\t\tlabel={ buttonLabel }\n\t\t\t\tshowTooltip={ showTooltip }\n\t\t\t>\n\t\t\t\t{ buttonIcon }\n\t\t\t</Button>\n\t\t</motion.div>\n\t);\n}\n\nexport default FullscreenModeClose;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAKA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AAKA,IAAAS,MAAA,GAAAT,OAAA;AAAqD,IAAAU,WAAA,GAAAV,OAAA;AAxBrD;AACA;AACA;;AAGA;AACA;AACA;;AAcA;AACA;AACA;;AAGA,SAASW,mBAAmBA,CAAE;EAAEC,WAAW;EAA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Y;MACnBW,KAAK,EAAGP,WAAa;MACrBjD,WAAW,EAAGA,WAAa;MAAAsD,QAAA,EAEzB5B;IAAU,CACL;EAAC,CACE,CAAC;AAEf;AAAC,IAAA+B,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc5D,mBAAmB","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_data","_components","_i18n","_url","_icons","_editor","_coreData","_compose","_jsxRuntime","FullscreenModeClose","showTooltip","icon","href","initialPost","_postType$labels$view","isRequestingSiteIcon","postType","siteIconUrl","useSelect","select","getCurrentPostType","editorStore","getEntityRecord","getPostType","isResolving","coreStore","siteData","undefined","_postType","type","site_icon_url","disableMotion","useReducedMotion","buttonIcon","jsx","Icon","size","wordpress","effect","expand","scale","transition","duration","__unstableMotion","img","variants","alt","__","className","src","classes","clsx","buttonHref","addQueryArgs","post_type","slug","buttonLabel","labels","view_items","div","whileHover","children","Button","label","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/back-button/fullscreen-mode-close.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tButton,\n\tIcon,\n\t__unstableMotion as motion,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { addQueryArgs } from '@wordpress/url';\nimport { wordpress } from '@wordpress/icons';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useReducedMotion } from '@wordpress/compose';\n\nfunction FullscreenModeClose( { showTooltip, icon, href, initialPost } ) {\n\tconst { isRequestingSiteIcon, postType, siteIconUrl } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getCurrentPostType } = select( editorStore );\n\t\t\tconst { getEntityRecord, getPostType, isResolving } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst siteData =\n\t\t\t\tgetEntityRecord( 'root', '__unstableBase', undefined ) || {};\n\t\t\tconst _postType = initialPost?.type || getCurrentPostType();\n\t\t\treturn {\n\t\t\t\tisRequestingSiteIcon: isResolving( 'getEntityRecord', [\n\t\t\t\t\t'root',\n\t\t\t\t\t'__unstableBase',\n\t\t\t\t\tundefined,\n\t\t\t\t] ),\n\t\t\t\tpostType: getPostType( _postType ),\n\t\t\t\tsiteIconUrl: siteData.site_icon_url,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst disableMotion = useReducedMotion();\n\n\tif ( ! postType ) {\n\t\treturn null;\n\t}\n\n\tlet buttonIcon = <Icon size=\"36px\" icon={ wordpress } />;\n\n\tconst effect = {\n\t\texpand: {\n\t\t\tscale: 1.25,\n\t\t\ttransition: { type: 'tween', duration: '0.3' },\n\t\t},\n\t};\n\n\tif ( siteIconUrl ) {\n\t\tbuttonIcon = (\n\t\t\t<motion.img\n\t\t\t\tvariants={ ! disableMotion && effect }\n\t\t\t\talt={ __( 'Site Icon' ) }\n\t\t\t\tclassName=\"edit-post-fullscreen-mode-close_site-icon\"\n\t\t\t\tsrc={ siteIconUrl }\n\t\t\t/>\n\t\t);\n\t}\n\n\tif ( isRequestingSiteIcon ) {\n\t\tbuttonIcon = null;\n\t}\n\n\t// Override default icon if custom icon is provided via props.\n\tif ( icon ) {\n\t\tbuttonIcon = <Icon size=\"36px\" icon={ icon } />;\n\t}\n\n\tconst classes = clsx( 'edit-post-fullscreen-mode-close', {\n\t\t'has-icon': siteIconUrl,\n\t} );\n\n\tconst buttonHref =\n\t\thref ??\n\t\taddQueryArgs( 'edit.php', {\n\t\t\tpost_type: postType.slug,\n\t\t} );\n\n\tconst buttonLabel = postType?.labels?.view_items ?? __( 'Back' );\n\n\treturn (\n\t\t<motion.div whileHover=\"expand\">\n\t\t\t<Button\n\t\t\t\tclassName={ classes }\n\t\t\t\thref={ buttonHref }\n\t\t\t\tlabel={ buttonLabel }\n\t\t\t\tshowTooltip={ showTooltip }\n\t\t\t>\n\t\t\t\t{ buttonIcon }\n\t\t\t</Button>\n\t\t</motion.div>\n\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AA,cAAAA,qBAAA,GAAI,IAAAiC,QAAE,EAAE,MAAO,CAAC;EAEhE,oBACC,IAAAvC,WAAA,CAAA0B,GAAA,EAACjC,WAAA,CAAA0C,gBAAM,CAACgB,GAAG;IAACC,UAAU,EAAC,QAAQ;IAAAC,QAAA,eAC9B,IAAArD,WAAA,CAAA0B,GAAA,EAACjC,WAAA,CAAA6D,MAAM;MACNd,SAAS,EAAGE,OAAS;MACrBtC,IAAI,EAAGwC,UAAY;MACnBW,KAAK,EAAGP,WAAa;MACrB9C,WAAW,EAAGA,WAAa;MAAAmD,QAAA,EAEzB5B;IAAU,CACL;EAAC,CACE,CAAC;AAEf;AAAC,IAAA+B,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEczD,mBAAmB","ignoreList":[]}
@@ -9,20 +9,11 @@ var _i18n = require("@wordpress/i18n");
9
9
  var _components = require("@wordpress/components");
10
10
  var _element = require("@wordpress/element");
11
11
  var _editor = require("@wordpress/editor");
12
- var _blockEditor = require("@wordpress/block-editor");
13
- var _lockUnlock = require("../../lock-unlock");
14
12
  var _jsxRuntime = require("react/jsx-runtime");
15
13
  /**
16
14
  * WordPress dependencies
17
15
  */
18
16
 
19
- /**
20
- * Internal dependencies
21
- */
22
-
23
- const {
24
- ReusableBlocksRenameHint
25
- } = (0, _lockUnlock.unlock)(_blockEditor.privateApis);
26
17
  function InitPatternModal() {
27
18
  const {
28
19
  editPost
@@ -81,7 +72,7 @@ function InitPatternModal() {
81
72
  className: "patterns-create-modal__name-input",
82
73
  __nextHasNoMarginBottom: true,
83
74
  __next40pxDefaultSize: true
84
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(ReusableBlocksRenameHint, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToggleControl, {
75
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToggleControl, {
85
76
  label: (0, _i18n._x)('Synced', 'pattern (singular)'),
86
77
  help: (0, _i18n.__)('Sync this pattern across multiple locations.'),
87
78
  checked: !syncType,
@@ -94,7 +85,7 @@ function InitPatternModal() {
94
85
  variant: "primary",
95
86
  type: "submit",
96
87
  disabled: !title,
97
- __experimentalIsFocusable: true,
88
+ accessibleWhenDisabled: true,
98
89
  children: (0, _i18n.__)('Create')
99
90
  })
100
91
  })]
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_i18n","_components","_element","_editor","_blockEditor","_lockUnlock","_jsxRuntime","ReusableBlocksRenameHint","unlock","blockEditorPrivateApis","InitPatternModal","editPost","useDispatch","editorStore","isModalOpen","setIsModalOpen","useState","syncType","setSyncType","undefined","title","setTitle","postType","isNewPost","useSelect","select","getEditedPostAttribute","isCleanNewPost","useEffect","jsx","Fragment","children","Modal","__","onRequestClose","overlayClassName","onSubmit","event","preventDefault","meta","wp_pattern_sync_status","jsxs","__experimentalVStack","spacing","TextControl","label","value","onChange","placeholder","className","__nextHasNoMarginBottom","__next40pxDefaultSize","ToggleControl","_x","help","checked","__experimentalHStack","justify","Button","variant","type","disabled","__experimentalIsFocusable"],"sources":["@wordpress/edit-post/src/components/init-pattern-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\tModal,\n\tButton,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tToggleControl,\n\tTextControl,\n} from '@wordpress/components';\nimport { useEffect, useState } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\n\nimport { unlock } from '../../lock-unlock';\n\nconst { ReusableBlocksRenameHint } = unlock( blockEditorPrivateApis );\n\nexport default function InitPatternModal() {\n\tconst { editPost } = useDispatch( editorStore );\n\tconst [ isModalOpen, setIsModalOpen ] = useState( false );\n\tconst [ syncType, setSyncType ] = useState( undefined );\n\tconst [ title, setTitle ] = useState( '' );\n\n\tconst { postType, isNewPost } = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute, isCleanNewPost } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\tpostType: getEditedPostAttribute( 'type' ),\n\t\t\tisNewPost: isCleanNewPost(),\n\t\t};\n\t}, [] );\n\n\tuseEffect( () => {\n\t\tif ( isNewPost && postType === 'wp_block' ) {\n\t\t\tsetIsModalOpen( true );\n\t\t}\n\t\t// We only want the modal to open when the page is first loaded.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [] );\n\n\tif ( postType !== 'wp_block' || ! isNewPost ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ isModalOpen && (\n\t\t\t\t<Modal\n\t\t\t\t\ttitle={ __( 'Create pattern' ) }\n\t\t\t\t\tonRequestClose={ () => {\n\t\t\t\t\t\tsetIsModalOpen( false );\n\t\t\t\t\t} }\n\t\t\t\t\toverlayClassName=\"reusable-blocks-menu-items__convert-modal\"\n\t\t\t\t>\n\t\t\t\t\t<form\n\t\t\t\t\t\tonSubmit={ ( event ) => {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tsetIsModalOpen( false );\n\t\t\t\t\t\t\teditPost( {\n\t\t\t\t\t\t\t\ttitle,\n\t\t\t\t\t\t\t\tmeta: {\n\t\t\t\t\t\t\t\t\twp_pattern_sync_status: syncType,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t<VStack spacing=\"5\">\n\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\t\t\t\tvalue={ title }\n\t\t\t\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\t\t\t\tplaceholder={ __( 'My pattern' ) }\n\t\t\t\t\t\t\t\tclassName=\"patterns-create-modal__name-input\"\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<ReusableBlocksRenameHint />\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\tlabel={ _x( 'Synced', 'pattern (singular)' ) }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Sync this pattern across multiple locations.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tchecked={ ! syncType }\n\t\t\t\t\t\t\t\tonChange={ () => {\n\t\t\t\t\t\t\t\t\tsetSyncType(\n\t\t\t\t\t\t\t\t\t\t! syncType ? 'unsynced' : undefined\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\t<HStack justify=\"right\">\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\t\t\tdisabled={ ! title }\n\t\t\t\t\t\t\t\t\t__experimentalIsFocusable\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Create' ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t</form>\n\t\t\t\t</Modal>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAQA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAMA,IAAAM,WAAA,GAAAN,OAAA;AAA2C,IAAAO,WAAA,GAAAP,OAAA;AArB3C;AACA;AACA;;AAeA;AACA;AACA;;AAIA,MAAM;EAAEQ;AAAyB,CAAC,GAAG,IAAAC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AuB,GAAA,EAAC5B,WAAA,CAAAyD,MAAM;cACNC,OAAO,EAAC,SAAS;cACjBC,IAAI,EAAC,QAAQ;cACbC,QAAQ,EAAG,CAAEzC,KAAO;cACpB0C,yBAAyB;cAAA/B,QAAA,EAEvB,IAAAE,QAAE,EAAE,QAAS;YAAC,CACT;UAAC,CACF,CAAC;QAAA,CACF;MAAC,CACJ;IAAC,CACD;EACP,CACA,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["_data","require","_i18n","_components","_element","_editor","_jsxRuntime","InitPatternModal","editPost","useDispatch","editorStore","isModalOpen","setIsModalOpen","useState","syncType","setSyncType","undefined","title","setTitle","postType","isNewPost","useSelect","select","getEditedPostAttribute","isCleanNewPost","useEffect","jsx","Fragment","children","Modal","__","onRequestClose","overlayClassName","onSubmit","event","preventDefault","meta","wp_pattern_sync_status","jsxs","__experimentalVStack","spacing","TextControl","label","value","onChange","placeholder","className","__nextHasNoMarginBottom","__next40pxDefaultSize","ToggleControl","_x","help","checked","__experimentalHStack","justify","Button","variant","type","disabled","accessibleWhenDisabled"],"sources":["@wordpress/edit-post/src/components/init-pattern-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\tModal,\n\tButton,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tToggleControl,\n\tTextControl,\n} from '@wordpress/components';\nimport { useEffect, useState } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\n\nexport default function InitPatternModal() {\n\tconst { editPost } = useDispatch( editorStore );\n\tconst [ isModalOpen, setIsModalOpen ] = useState( false );\n\tconst [ syncType, setSyncType ] = useState( undefined );\n\tconst [ title, setTitle ] = useState( '' );\n\n\tconst { postType, isNewPost } = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute, isCleanNewPost } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\tpostType: getEditedPostAttribute( 'type' ),\n\t\t\tisNewPost: isCleanNewPost(),\n\t\t};\n\t}, [] );\n\n\tuseEffect( () => {\n\t\tif ( isNewPost && postType === 'wp_block' ) {\n\t\t\tsetIsModalOpen( true );\n\t\t}\n\t\t// We only want the modal to open when the page is first loaded.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [] );\n\n\tif ( postType !== 'wp_block' || ! isNewPost ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ isModalOpen && (\n\t\t\t\t<Modal\n\t\t\t\t\ttitle={ __( 'Create pattern' ) }\n\t\t\t\t\tonRequestClose={ () => {\n\t\t\t\t\t\tsetIsModalOpen( false );\n\t\t\t\t\t} }\n\t\t\t\t\toverlayClassName=\"reusable-blocks-menu-items__convert-modal\"\n\t\t\t\t>\n\t\t\t\t\t<form\n\t\t\t\t\t\tonSubmit={ ( event ) => {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tsetIsModalOpen( false );\n\t\t\t\t\t\t\teditPost( {\n\t\t\t\t\t\t\t\ttitle,\n\t\t\t\t\t\t\t\tmeta: {\n\t\t\t\t\t\t\t\t\twp_pattern_sync_status: syncType,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t<VStack spacing=\"5\">\n\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\t\t\t\tvalue={ title }\n\t\t\t\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\t\t\t\tplaceholder={ __( 'My pattern' ) }\n\t\t\t\t\t\t\t\tclassName=\"patterns-create-modal__name-input\"\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\tlabel={ _x( 'Synced', 'pattern (singular)' ) }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Sync this pattern across multiple locations.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tchecked={ ! syncType }\n\t\t\t\t\t\t\t\tonChange={ () => {\n\t\t\t\t\t\t\t\t\tsetSyncType(\n\t\t\t\t\t\t\t\t\t\t! syncType ? 'unsynced' : undefined\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\t<HStack justify=\"right\">\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\t\t\tdisabled={ ! title }\n\t\t\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Create' ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t</form>\n\t\t\t\t</Modal>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAQA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAAyD,IAAAK,WAAA,GAAAL,OAAA;AAdzD;AACA;AACA;;AAce,SAASM,gBAAgBA,CAAA,EAAG;EAC1C,MAAM;IAAEC;EAAS,CAAC,GAAG,IAAAC,iBAAW,EAAEC,aAAY,CAAC;EAC/C,MAAM,CAAEC,WAAW,EAAEC,cAAc,CAAE,GAAG,IAAAC,iBAAQ,EAAE,KAAM,CAAC;EACzD,MAAM,CAAEC,QAAQ,EAAEC,WAAW,CAAE,GAAG,IAAAF,iBAAQ,EAAEG,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AA,eAEH,IAAAtB,WAAA,CAAAgC,IAAA,EAACnC,WAAA,CAAAoC,oBAAM;UAACC,OAAO,EAAC,GAAG;UAAAZ,QAAA,gBAClB,IAAAtB,WAAA,CAAAoB,GAAA,EAACvB,WAAA,CAAAsC,WAAW;YACXC,KAAK,EAAG,IAAAZ,QAAE,EAAE,MAAO,CAAG;YACtBa,KAAK,EAAG1B,KAAO;YACf2B,QAAQ,EAAG1B,QAAU;YACrB2B,WAAW,EAAG,IAAAf,QAAE,EAAE,YAAa,CAAG;YAClCgB,SAAS,EAAC,mCAAmC;YAC7CC,uBAAuB;YACvBC,qBAAqB;UAAA,CACrB,CAAC,eACF,IAAA1C,WAAA,CAAAoB,GAAA,EAACvB,WAAA,CAAA8C,aAAa;YACbP,KAAK,EAAG,IAAAQ,QAAE,EAAE,QAAQ,EAAE,oBAAqB,CAAG;YAC9CC,IAAI,EAAG,IAAArB,QAAE,EACR,8CACD,CAAG;YACHsB,OAAO,EAAG,CAAEtC,QAAU;YACtB8B,QAAQ,EAAGA,CAAA,KAAM;cAChB7B,WAAW,CACV,CAAED,QAAQ,GAAG,UAAU,GAAGE,SAC3B,CAAC;YACF;UAAG,CACH,CAAC,eACF,IAAAV,WAAA,CAAAoB,GAAA,EAACvB,WAAA,CAAAkD,oBAAM;YAACC,OAAO,EAAC,OAAO;YAAA1B,QAAA,eACtB,IAAAtB,WAAA,CAAAoB,GAAA,EAACvB,WAAA,CAAAoD,MAAM;cACNC,OAAO,EAAC,SAAS;cACjBC,IAAI,EAAC,QAAQ;cACbC,QAAQ,EAAG,CAAEzC,KAAO;cACpB0C,sBAAsB;cAAA/B,QAAA,EAEpB,IAAAE,QAAE,EAAE,QAAS;YAAC,CACT;UAAC,CACF,CAAC;QAAA,CACF;MAAC,CACJ;IAAC,CACD;EACP,CACA,CAAC;AAEL","ignoreList":[]}
@@ -21,6 +21,7 @@ var _url = require("@wordpress/url");
21
21
  var _htmlEntities = require("@wordpress/html-entities");
22
22
  var _coreData = require("@wordpress/core-data");
23
23
  var _components = require("@wordpress/components");
24
+ var _compose = require("@wordpress/compose");
24
25
  var _backButton = _interopRequireDefault(require("../back-button"));
25
26
  var _editorInitialization = _interopRequireDefault(require("../editor-initialization"));
26
27
  var _keyboardShortcuts = _interopRequireDefault(require("../keyboard-shortcuts"));
@@ -120,7 +121,9 @@ function useEditorStyles() {
120
121
  // bottom, there needs to be room to scroll up.
121
122
  if (!isZoomedOutView && !hasMetaBoxes && renderingMode === 'post-only' && !DESIGN_POST_TYPES.includes(postType)) {
122
123
  return [...baseStyles, {
123
- css: 'body{padding-bottom: 40vh}'
124
+ // Should override global styles padding, so ensure 0-1-0
125
+ // specificity.
126
+ css: ':root :where(body){padding-bottom: 40vh}'
124
127
  }];
125
128
  }
126
129
  return baseStyles;
@@ -171,7 +174,10 @@ function Layout({
171
174
  } = select(_coreData.store);
172
175
  const supportsTemplateMode = settings.supportsTemplateMode;
173
176
  const isViewable = (_getPostType$viewable = getPostType(currentPost.postType)?.viewable) !== null && _getPostType$viewable !== void 0 ? _getPostType$viewable : false;
174
- const canViewTemplate = canUser('read', 'templates');
177
+ const canViewTemplate = canUser('read', {
178
+ kind: 'postType',
179
+ name: 'wp_template'
180
+ });
175
181
  return {
176
182
  mode: select(_editor.store).getEditorMode(),
177
183
  isFullscreenActive: select(_store.store).isFeatureActive('fullscreenMode'),
@@ -254,6 +260,9 @@ function Layout({
254
260
  id: initialPostId
255
261
  };
256
262
  }, [initialPostType, initialPostId]);
263
+ const backButton = (0, _compose.useViewportMatch)('medium') && isFullscreenActive ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_backButton.default, {
264
+ initialPost: initialPost
265
+ }) : null;
257
266
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.SlotFillProvider, {
258
267
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_editor.ErrorBoundary, {
259
268
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_commands.CommandMenu, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_welcomeGuide.default, {
@@ -291,9 +300,7 @@ function Layout({
291
300
  hasHistory: hasHistory
292
301
  }), /*#__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, {
293
302
  onError: onPluginAreaError
294
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_moreMenu.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_backButton.default, {
295
- initialPost: initialPost
296
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.EditorSnackbars, {})]
303
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_moreMenu.default, {}), backButton, /*#__PURE__*/(0, _jsxRuntime.jsx)(_editor.EditorSnackbars, {})]
297
304
  })]
298
305
  })
299
306
  });
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_editor","_data","_blockEditor","_plugins","_i18n","_element","_notices","_preferences","_commands","_coreCommands","_blockLibrary","_url","_htmlEntities","_coreData","_components","_backButton","_editorInitialization","_keyboardShortcuts","_initPatternModal","_browserUrl","_metaBoxes","_moreMenu","_welcomeGuide","_store","_lockUnlock","_useCommands","_usePaddingAppender","_useShouldIframe","_useNavigateToEntityRecord","_jsxRuntime","getLayoutStyles","unlock","blockEditorPrivateApis","useCommands","coreCommandsPrivateApis","useCommandContext","commandsPrivateApis","Editor","FullscreenMode","editorPrivateApis","BlockKeyboardShortcuts","blockLibraryPrivateApis","DESIGN_POST_TYPES","useEditorStyles","hasThemeStyleSupport","editorSettings","isZoomedOutView","hasMetaBoxes","renderingMode","postType","useSelect","select","__unstableGetEditorMode","blockEditorStore","getCurrentPostType","getRenderingMode","editorStore","_postType","editPostStore","isFeatureActive","getEditorSettings","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","includes","Layout","postId","initialPostId","initialPostType","settings","initialEdits","useEditPostCommands","paddingAppenderRef","usePaddingAppender","shouldIframe","useShouldIframe","createErrorNotice","useDispatch","noticesStore","currentPost","onNavigateToEntityRecord","onNavigateToPreviousEntityRecord","useNavigateToEntityRecord","mode","isFullscreenActive","hasActiveMetaboxes","hasBlockSelected","showIconLabels","isDistractionFree","showMetaBoxes","hasHistory","isEditingTemplate","isWelcomeGuideVisible","templateId","_getPostType$viewable","get","preferencesStore","getEditedPostTemplateId","canUser","getPostType","coreStore","supportsTemplateMode","isViewable","viewable","canViewTemplate","getEditorMode","getBlockSelectionStart","commandContext","defaultRenderingMode","document","body","classList","add","remove","className","clsx","onPluginAreaError","name","sprintf","__","createSuccessNotice","onActionPerformed","useCallback","actionId","items","location","href","addQueryArgs","trashed","post_type","type","ids","id","newItem","title","rendered","decodeEntities","actions","label","onClick","post","action","initialPost","jsx","SlotFillProvider","children","jsxs","ErrorBoundary","CommandMenu","default","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 { useCallback, useMemo } from '@wordpress/element';\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 { SlotFillProvider } from '@wordpress/components';\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 } = 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() {\n\tconst {\n\t\thasThemeStyleSupport,\n\t\teditorSettings,\n\t\tisZoomedOutView,\n\t\thasMetaBoxes,\n\t\trenderingMode,\n\t\tpostType,\n\t} = useSelect( ( select ) => {\n\t\tconst { __unstableGetEditorMode } = select( blockEditorStore );\n\t\tconst { getCurrentPostType, getRenderingMode } = select( editorStore );\n\t\tconst _postType = getCurrentPostType();\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\tisZoomedOutView: __unstableGetEditorMode() === 'zoom-out',\n\t\t\thasMetaBoxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\trenderingMode: getRenderingMode(),\n\t\t\tpostType: _postType,\n\t\t};\n\t}, [] );\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\t// Add a constant padding for the typewriter effect. When typing at the\n\t\t// bottom, there needs to be room to scroll up.\n\t\tif (\n\t\t\t! isZoomedOutView &&\n\t\t\t! hasMetaBoxes &&\n\t\t\trenderingMode === 'post-only' &&\n\t\t\t! DESIGN_POST_TYPES.includes( postType )\n\t\t) {\n\t\t\treturn [\n\t\t\t\t...baseStyles,\n\t\t\t\t{\n\t\t\t\t\tcss: 'body{padding-bottom: 40vh}',\n\t\t\t\t},\n\t\t\t];\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\tpostType,\n\t] );\n}\n\nfunction Layout( {\n\tpostId: initialPostId,\n\tpostType: initialPostType,\n\tsettings,\n\tinitialEdits,\n} ) {\n\tuseCommands();\n\tuseEditPostCommands();\n\tconst paddingAppenderRef = usePaddingAppender();\n\tconst shouldIframe = useShouldIframe();\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst {\n\t\tcurrentPost,\n\t\tonNavigateToEntityRecord,\n\t\tonNavigateToPreviousEntityRecord,\n\t} = useNavigateToEntityRecord(\n\t\tinitialPostId,\n\t\tinitialPostType,\n\t\t'post-only'\n\t);\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\tisEditingTemplate,\n\t\tisWelcomeGuideVisible,\n\t\ttemplateId,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst { isFeatureActive, 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( currentPost.postType )?.viewable ?? false;\n\t\t\tconst canViewTemplate = canUser( 'read', 'templates' );\n\n\t\t\treturn {\n\t\t\t\tmode: select( editorStore ).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\tselect( editorStore ).getRenderingMode() === 'post-only',\n\t\t\t\tisEditingTemplate:\n\t\t\t\t\tselect( editorStore ).getCurrentPostType() ===\n\t\t\t\t\t'wp_template',\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\tcurrentPost.postType !== 'wp_template'\n\t\t\t\t\t\t? getEditedPostTemplateId()\n\t\t\t\t\t\t: null,\n\t\t\t};\n\t\t},\n\t\t[ settings.supportsTemplateMode, currentPost.postType ]\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();\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 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 e.g: \"Post 1\".\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\treturn (\n\t\t<SlotFillProvider>\n\t\t\t<ErrorBoundary>\n\t\t\t\t<CommandMenu />\n\t\t\t\t<WelcomeGuide postType={ currentPost.postType } />\n\t\t\t\t<Editor\n\t\t\t\t\tsettings={ editorSettings }\n\t\t\t\t\tinitialEdits={ initialEdits }\n\t\t\t\t\tpostType={ currentPost.postType }\n\t\t\t\t\tpostId={ currentPost.postId }\n\t\t\t\t\ttemplateId={ templateId }\n\t\t\t\t\tclassName={ className }\n\t\t\t\t\tstyles={ styles }\n\t\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\t\tcontentRef={ paddingAppenderRef }\n\t\t\t\t\tdisableIframe={ ! shouldIframe }\n\t\t\t\t\t// We should auto-focus the canvas (title) on load.\n\t\t\t\t\t// eslint-disable-next-line jsx-a11y/no-autofocus\n\t\t\t\t\tautoFocus={ ! isWelcomeGuideVisible }\n\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t\textraSidebarPanels={\n\t\t\t\t\t\t! isEditingTemplate && <MetaBoxes location=\"side\" />\n\t\t\t\t\t}\n\t\t\t\t\textraContent={\n\t\t\t\t\t\t! isDistractionFree &&\n\t\t\t\t\t\tshowMetaBoxes && (\n\t\t\t\t\t\t\t<div className=\"edit-post-layout__metaboxes\">\n\t\t\t\t\t\t\t\t<MetaBoxes location=\"normal\" />\n\t\t\t\t\t\t\t\t<MetaBoxes location=\"advanced\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t<PostLockedModal />\n\t\t\t\t\t<EditorInitialization />\n\t\t\t\t\t<FullscreenMode isActive={ isFullscreenActive } />\n\t\t\t\t\t<BrowserURL hasHistory={ hasHistory } />\n\t\t\t\t\t<UnsavedChangesWarning />\n\t\t\t\t\t<AutosaveMonitor />\n\t\t\t\t\t<LocalAutosaveMonitor />\n\t\t\t\t\t<EditPostKeyboardShortcuts />\n\t\t\t\t\t<EditorKeyboardShortcutsRegister />\n\t\t\t\t\t<BlockKeyboardShortcuts />\n\t\t\t\t\t<InitPatternModal />\n\t\t\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t\t\t\t<PostEditorMoreMenu />\n\t\t\t\t\t<BackButton initialPost={ initialPost } />\n\t\t\t\t\t<EditorSnackbars />\n\t\t\t\t</Editor>\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,O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C9I,WAAA,CAAAoJ,OAAU;UAAC3D,UAAU,EAAGA;QAAY,CAAE,CAAC,eACxC,IAAA/E,WAAA,CAAAoI,GAAA,EAACjK,OAAA,CAAAgL,qBAAqB,IAAE,CAAC,eACzB,IAAAnJ,WAAA,CAAAoI,GAAA,EAACjK,OAAA,CAAAiL,eAAe,IAAE,CAAC,eACnB,IAAApJ,WAAA,CAAAoI,GAAA,EAACjK,OAAA,CAAAkL,oBAAoB,IAAE,CAAC,eACxB,IAAArJ,WAAA,CAAAoI,GAAA,EAAChJ,kBAAA,CAAAsJ,OAAyB,IAAE,CAAC,eAC7B,IAAA1I,WAAA,CAAAoI,GAAA,EAACjK,OAAA,CAAAmL,+BAA+B,IAAE,CAAC,eACnC,IAAAtJ,WAAA,CAAAoI,GAAA,EAACzH,sBAAsB,IAAE,CAAC,eAC1B,IAAAX,WAAA,CAAAoI,GAAA,EAAC/I,iBAAA,CAAAqJ,OAAgB,IAAE,CAAC,eACpB,IAAA1I,WAAA,CAAAoI,GAAA,EAAC9J,QAAA,CAAAiL,UAAU;UAACC,OAAO,EAAG/C;QAAmB,CAAE,CAAC,eAC5C,IAAAzG,WAAA,CAAAoI,GAAA,EAAC5I,SAAA,CAAAkJ,OAAkB,IAAE,CAAC,eACtB,IAAA1I,WAAA,CAAAoI,GAAA,EAAClJ,WAAA,CAAAwJ,OAAU;UAACP,WAAW,EAAGA;QAAa,CAAE,CAAC,eAC1C,IAAAnI,WAAA,CAAAoI,GAAA,EAACjK,OAAA,CAAAsL,eAAe,IAAE,CAAC;MAAA,CACZ,CAAC;IAAA,CACK;EAAC,CACC,CAAC;AAErB;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAjB,OAAA,GAEcpF,MAAM","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_editor","_data","_blockEditor","_plugins","_i18n","_element","_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","editorPrivateApis","BlockKeyboardShortcuts","blockLibraryPrivateApis","DESIGN_POST_TYPES","useEditorStyles","hasThemeStyleSupport","editorSettings","isZoomedOutView","hasMetaBoxes","renderingMode","postType","useSelect","select","__unstableGetEditorMode","blockEditorStore","getCurrentPostType","getRenderingMode","editorStore","_postType","editPostStore","isFeatureActive","getEditorSettings","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","includes","Layout","postId","initialPostId","initialPostType","settings","initialEdits","useEditPostCommands","paddingAppenderRef","usePaddingAppender","shouldIframe","useShouldIframe","createErrorNotice","useDispatch","noticesStore","currentPost","onNavigateToEntityRecord","onNavigateToPreviousEntityRecord","useNavigateToEntityRecord","mode","isFullscreenActive","hasActiveMetaboxes","hasBlockSelected","showIconLabels","isDistractionFree","showMetaBoxes","hasHistory","isEditingTemplate","isWelcomeGuideVisible","templateId","_getPostType$viewable","get","preferencesStore","getEditedPostTemplateId","canUser","getPostType","coreStore","supportsTemplateMode","isViewable","viewable","canViewTemplate","kind","name","getEditorMode","getBlockSelectionStart","commandContext","defaultRenderingMode","document","body","classList","add","remove","className","clsx","onPluginAreaError","sprintf","__","createSuccessNotice","onActionPerformed","useCallback","actionId","items","location","href","addQueryArgs","trashed","post_type","type","ids","id","newItem","title","rendered","decodeEntities","actions","label","onClick","post","action","initialPost","backButton","useViewportMatch","jsx","default","SlotFillProvider","children","jsxs","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 { useCallback, useMemo } from '@wordpress/element';\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 { SlotFillProvider } from '@wordpress/components';\nimport { useViewportMatch } 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 } = 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() {\n\tconst {\n\t\thasThemeStyleSupport,\n\t\teditorSettings,\n\t\tisZoomedOutView,\n\t\thasMetaBoxes,\n\t\trenderingMode,\n\t\tpostType,\n\t} = useSelect( ( select ) => {\n\t\tconst { __unstableGetEditorMode } = select( blockEditorStore );\n\t\tconst { getCurrentPostType, getRenderingMode } = select( editorStore );\n\t\tconst _postType = getCurrentPostType();\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\tisZoomedOutView: __unstableGetEditorMode() === 'zoom-out',\n\t\t\thasMetaBoxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\trenderingMode: getRenderingMode(),\n\t\t\tpostType: _postType,\n\t\t};\n\t}, [] );\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\t// Add a constant padding for the typewriter effect. When typing at the\n\t\t// bottom, there needs to be room to scroll up.\n\t\tif (\n\t\t\t! isZoomedOutView &&\n\t\t\t! hasMetaBoxes &&\n\t\t\trenderingMode === 'post-only' &&\n\t\t\t! DESIGN_POST_TYPES.includes( postType )\n\t\t) {\n\t\t\treturn [\n\t\t\t\t...baseStyles,\n\t\t\t\t{\n\t\t\t\t\t// Should override global styles padding, so ensure 0-1-0\n\t\t\t\t\t// specificity.\n\t\t\t\t\tcss: ':root :where(body){padding-bottom: 40vh}',\n\t\t\t\t},\n\t\t\t];\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\tpostType,\n\t] );\n}\n\nfunction Layout( {\n\tpostId: initialPostId,\n\tpostType: initialPostType,\n\tsettings,\n\tinitialEdits,\n} ) {\n\tuseCommands();\n\tuseEditPostCommands();\n\tconst paddingAppenderRef = usePaddingAppender();\n\tconst shouldIframe = useShouldIframe();\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst {\n\t\tcurrentPost,\n\t\tonNavigateToEntityRecord,\n\t\tonNavigateToPreviousEntityRecord,\n\t} = useNavigateToEntityRecord(\n\t\tinitialPostId,\n\t\tinitialPostType,\n\t\t'post-only'\n\t);\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\tisEditingTemplate,\n\t\tisWelcomeGuideVisible,\n\t\ttemplateId,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst { isFeatureActive, 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( currentPost.postType )?.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\n\t\t\treturn {\n\t\t\t\tmode: select( editorStore ).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\tselect( editorStore ).getRenderingMode() === 'post-only',\n\t\t\t\tisEditingTemplate:\n\t\t\t\t\tselect( editorStore ).getCurrentPostType() ===\n\t\t\t\t\t'wp_template',\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\tcurrentPost.postType !== 'wp_template'\n\t\t\t\t\t\t? getEditedPostTemplateId()\n\t\t\t\t\t\t: null,\n\t\t\t};\n\t\t},\n\t\t[ settings.supportsTemplateMode, currentPost.postType ]\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();\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 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 e.g: \"Post 1\".\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={ currentPost.postType } />\n\t\t\t\t<Editor\n\t\t\t\t\tsettings={ editorSettings }\n\t\t\t\t\tinitialEdits={ initialEdits }\n\t\t\t\t\tpostType={ currentPost.postType }\n\t\t\t\t\tpostId={ currentPost.postId }\n\t\t\t\t\ttemplateId={ templateId }\n\t\t\t\t\tclassName={ className }\n\t\t\t\t\tstyles={ styles }\n\t\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\t\tcontentRef={ paddingAppenderRef }\n\t\t\t\t\tdisableIframe={ ! shouldIframe }\n\t\t\t\t\t// We should auto-focus the canvas (title) on load.\n\t\t\t\t\t// eslint-disable-next-line jsx-a11y/no-autofocus\n\t\t\t\t\tautoFocus={ ! isWelcomeGuideVisible }\n\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t\textraSidebarPanels={\n\t\t\t\t\t\t! isEditingTemplate && <MetaBoxes location=\"side\" />\n\t\t\t\t\t}\n\t\t\t\t\textraContent={\n\t\t\t\t\t\t! isDistractionFree &&\n\t\t\t\t\t\tshowMetaBoxes && (\n\t\t\t\t\t\t\t<div className=\"edit-post-layout__metaboxes\">\n\t\t\t\t\t\t\t\t<MetaBoxes location=\"normal\" />\n\t\t\t\t\t\t\t\t<MetaBoxes location=\"advanced\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t<PostLockedModal />\n\t\t\t\t\t<EditorInitialization />\n\t\t\t\t\t<FullscreenMode isActive={ isFullscreenActive } />\n\t\t\t\t\t<BrowserURL hasHistory={ hasHistory } />\n\t\t\t\t\t<UnsavedChangesWarning />\n\t\t\t\t\t<AutosaveMonitor />\n\t\t\t\t\t<LocalAutosaveMonitor />\n\t\t\t\t\t<EditPostKeyboardShortcuts />\n\t\t\t\t\t<EditorKeyboardShortcutsRegister />\n\t\t\t\t\t<BlockKeyboardShortcuts />\n\t\t\t\t\t<InitPatternModal />\n\t\t\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t\t\t\t<PostEditorMoreMenu />\n\t\t\t\t\t{ backButton }\n\t\t\t\t\t<EditorSnackbars />\n\t\t\t\t</Editor>\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;AACA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,YAAA,GAAAR,OAAA;AACA,IAAAS,SAAA,GAAAT,OAAA;AAIA,IAAAU,aAAA,GAAAV,OAAA;AACA,IAAAW,aAAA,GAAAX,OAAA;AACA,IAAAY,IAAA,GAAAZ,OAAA;AACA,IAAAa,aAAA,GAAAb,OAAA;AACA,IAAAc,SAAA,GAAAd,OAAA;AACA,IAAAe,WAAA,GAAAf,OAAA;AACA,IAAAgB,QAAA,GAAAhB,OAAA;AAKA,IAAAiB,WAAA,GAAAlB,sBAAA,CAAAC,OAAA;AACA,IAAAkB,qBAAA,GAAAnB,sBAAA,CAAAC,OAAA;AACA,IAAAmB,kBAAA,GAAApB,sBAAA,CAAAC,OAAA;AACA,IAAAoB,iBAAA,GAAArB,sBAAA,CAAAC,OAAA;AACA,IAAAqB,WAAA,GAAAtB,sBAAA,CAAAC,OAAA;AACA,IAAAsB,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AAAuI,GAAA,EAAC5H,sBAAsB,IAAE,CAAC,eAC1B,IAAAX,WAAA,CAAAuI,GAAA,EAAClJ,iBAAA,CAAAmJ,OAAgB,IAAE,CAAC,eACpB,IAAAxI,WAAA,CAAAuI,GAAA,EAAClK,QAAA,CAAAqL,UAAU;UAACC,OAAO,EAAGhD;QAAmB,CAAE,CAAC,eAC5C,IAAA3G,WAAA,CAAAuI,GAAA,EAAC/I,SAAA,CAAAgJ,OAAkB,IAAE,CAAC,EACpBH,UAAU,eACZ,IAAArI,WAAA,CAAAuI,GAAA,EAACrK,OAAA,CAAA0L,eAAe,IAAE,CAAC;MAAA,CACZ,CAAC;IAAA,CACK;EAAC,CACC,CAAC;AAErB;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAtB,OAAA,GAEclF,MAAM","ignoreList":[]}
@@ -29,7 +29,10 @@ function ManagePatternsMenuItem() {
29
29
  // The site editor and templates both check whether the user has
30
30
  // edit_theme_options capabilities. We can leverage that here and not
31
31
  // display the manage patterns link if the user can't access it.
32
- return canUser('create', 'templates') ? patternsUrl : defaultUrl;
32
+ return canUser('create', {
33
+ kind: 'postType',
34
+ name: 'wp_template'
35
+ }) ? patternsUrl : defaultUrl;
33
36
  }, []);
34
37
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.MenuItem, {
35
38
  role: "menuitem",
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_coreData","_data","_i18n","_url","_jsxRuntime","ManagePatternsMenuItem","url","useSelect","select","canUser","coreStore","defaultUrl","addQueryArgs","post_type","patternsUrl","path","jsx","MenuItem","role","href","children","__","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/more-menu/manage-patterns-menu-item.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { MenuItem } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { addQueryArgs } from '@wordpress/url';\n\nfunction ManagePatternsMenuItem() {\n\tconst url = useSelect( ( select ) => {\n\t\tconst { canUser } = select( coreStore );\n\t\tconst defaultUrl = addQueryArgs( 'edit.php', {\n\t\t\tpost_type: 'wp_block',\n\t\t} );\n\t\tconst patternsUrl = addQueryArgs( 'site-editor.php', {\n\t\t\tpath: '/patterns',\n\t\t} );\n\n\t\t// The site editor and templates both check whether the user has\n\t\t// edit_theme_options capabilities. We can leverage that here and not\n\t\t// display the manage patterns link if the user can't access it.\n\t\treturn canUser( 'create', 'templates' ) ? patternsUrl : defaultUrl;\n\t}, [] );\n\n\treturn (\n\t\t<MenuItem role=\"menuitem\" href={ url }>\n\t\t\t{ __( 'Manage patterns' ) }\n\t\t</MenuItem>\n\t);\n}\n\nexport default ManagePatternsMenuItem;\n"],"mappings":";;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AAA8C,IAAAK,WAAA,GAAAL,OAAA;AAP9C;AACA;AACA;;AAOA,SAASM,sBAAsBA,CAAA,EAAG;EACjC,MAAMC,GAAG,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACpC,MAAM;MAAEC;IAAQ,CAAC,GAAGD,MAAM,CAAEE,eAAU,CAAC;IACvC,MAAMC,UAAU,GAAG,IAAAC,iBAAY,EAAE,UAAU,EAAE;MAC5CC,SAAS,EAAE;IACZ,CAAE,CAAC;IACH,MAAMC,WAAW,GAAG,IAAAF,iBAAY,EAAE,iBAAiB,EAAE;MACpDG,IAAI,EAAE;IACP,CAAE,CAAC;;IAEH;IACA;IACA;IACA,OAAON,OAAO,CAAE,QAAQ,EAAE,WAAY,CAAC,GAAGK,WAAW,GAAGH,UAAU;EACnE,CAAC,EAAE,EAAG,CAAC;EAEP,oBACC,IAAAP,WAAA,CAAAY,GAAA,EAAClB,WAAA,CAAAmB,QAAQ;IAACC,IAAI,EAAC,UAAU;IAACC,IAAI,EAAGb,GAAK;IAAAc,QAAA,EACnC,IAAAC,QAAE,EAAE,iBAAkB;EAAC,CAChB,CAAC;AAEb;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcnB,sBAAsB","ignoreList":[]}
1
+ {"version":3,"names":["_components","require","_coreData","_data","_i18n","_url","_jsxRuntime","ManagePatternsMenuItem","url","useSelect","select","canUser","coreStore","defaultUrl","addQueryArgs","post_type","patternsUrl","path","kind","name","jsx","MenuItem","role","href","children","__","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/more-menu/manage-patterns-menu-item.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { MenuItem } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { addQueryArgs } from '@wordpress/url';\n\nfunction ManagePatternsMenuItem() {\n\tconst url = useSelect( ( select ) => {\n\t\tconst { canUser } = select( coreStore );\n\t\tconst defaultUrl = addQueryArgs( 'edit.php', {\n\t\t\tpost_type: 'wp_block',\n\t\t} );\n\t\tconst patternsUrl = addQueryArgs( 'site-editor.php', {\n\t\t\tpath: '/patterns',\n\t\t} );\n\n\t\t// The site editor and templates both check whether the user has\n\t\t// edit_theme_options capabilities. We can leverage that here and not\n\t\t// display the manage patterns link if the user can't access it.\n\t\treturn canUser( 'create', {\n\t\t\tkind: 'postType',\n\t\t\tname: 'wp_template',\n\t\t} )\n\t\t\t? patternsUrl\n\t\t\t: defaultUrl;\n\t}, [] );\n\n\treturn (\n\t\t<MenuItem role=\"menuitem\" href={ url }>\n\t\t\t{ __( 'Manage patterns' ) }\n\t\t</MenuItem>\n\t);\n}\n\nexport default ManagePatternsMenuItem;\n"],"mappings":";;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AAA8C,IAAAK,WAAA,GAAAL,OAAA;AAP9C;AACA;AACA;;AAOA,SAASM,sBAAsBA,CAAA,EAAG;EACjC,MAAMC,GAAG,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACpC,MAAM;MAAEC;IAAQ,CAAC,GAAGD,MAAM,CAAEE,eAAU,CAAC;IACvC,MAAMC,UAAU,GAAG,IAAAC,iBAAY,EAAE,UAAU,EAAE;MAC5CC,SAAS,EAAE;IACZ,CAAE,CAAC;IACH,MAAMC,WAAW,GAAG,IAAAF,iBAAY,EAAE,iBAAiB,EAAE;MACpDG,IAAI,EAAE;IACP,CAAE,CAAC;;IAEH;IACA;IACA;IACA,OAAON,OAAO,CAAE,QAAQ,EAAE;MACzBO,IAAI,EAAE,UAAU;MAChBC,IAAI,EAAE;IACP,CAAE,CAAC,GACAH,WAAW,GACXH,UAAU;EACd,CAAC,EAAE,EAAG,CAAC;EAEP,oBACC,IAAAP,WAAA,CAAAc,GAAA,EAACpB,WAAA,CAAAqB,QAAQ;IAACC,IAAI,EAAC,UAAU;IAACC,IAAI,EAAGf,GAAK;IAAAgB,QAAA,EACnC,IAAAC,QAAE,EAAE,iBAAkB;EAAC,CAChB,CAAC;AAEb;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcrB,sBAAsB","ignoreList":[]}
@@ -45,7 +45,7 @@ function CustomFieldsConfirmation({
45
45
  className: "edit-post-preferences-modal__custom-fields-confirmation-button",
46
46
  variant: "secondary",
47
47
  isBusy: isReloading,
48
- __experimentalIsFocusable: true,
48
+ accessibleWhenDisabled: true,
49
49
  disabled: isReloading,
50
50
  onClick: () => {
51
51
  setIsReloading(true);
@@ -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","variant","isBusy","__experimentalIsFocusable","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\tclassName=\"edit-post-preferences-modal__custom-fields-confirmation-button\"\n\t\t\t\tvariant=\"secondary\"\n\t\t\t\tisBusy={ isReloading }\n\t\t\t\t__experimentalIsFocusable\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,CAC/C,2BACD,CAAC;;EAED;EACAF,gBAAgB,CACdG,aAAa,CAAE,2BAA4B,CAAC,CAC5CC,YAAY,CAAE,OAAO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,iBACrC,IAAAlC,WAAA,CAAAuB,GAAA,EAACR,wBAAwB;MAACC,UAAU,EAAGmB;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","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\tclassName=\"edit-post-preferences-modal__custom-fields-confirmation-button\"\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,IA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B,QAAA,EAEDN,UAAU,GACT,IAAAS,QAAE,EAAE,oBAAqB,CAAC,GAC1B,IAAAA,QAAE,EAAE,oBAAqB;IAAC,CACtB,CAAC;EAAA,CACR,CAAC;AAEL;AAEO,SAASO,wBAAwBA,CAAE;EAAEC,KAAK;EAAEC;AAAuB,CAAC,EAAG;EAC7E,MAAM,CAAEC,SAAS,EAAEC,YAAY,CAAE,GAAG,IAAAjB,iBAAQ,EAAEe,sBAAuB,CAAC;EAEtE,oBACC,IAAAlC,WAAA,CAAAuB,GAAA,EAACtB,oBAAoB;IACpBgC,KAAK,EAAGA,KAAO;IACfE,SAAS,EAAGA,SAAW;IACvBE,QAAQ,EAAGD,YAAc;IAAAd,QAAA,EAEvBa,SAAS,KAAKD,sBAAsB,iBACrC,IAAAlC,WAAA,CAAAuB,GAAA,EAACR,wBAAwB;MAACC,UAAU,EAAGmB;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":[]}
@@ -33,13 +33,6 @@ var _jsxRuntime = require("react/jsx-runtime");
33
33
  class Editor extends _element.Component {
34
34
  constructor(props) {
35
35
  super(...arguments);
36
-
37
- // need to set this globally to avoid race with deprecations
38
- // defaulting to true to avoid issues with a not-yet-cached value
39
- const {
40
- galleryWithImageBlocks = true
41
- } = props;
42
- window.wp.galleryBlockV2Enabled = galleryWithImageBlocks;
43
36
  if (props.initialHtmlModeEnabled && props.mode === 'visual') {
44
37
  // Enable html mode if the initial mode the parent wants it but we're not already in it.
45
38
  this.props.switchEditorMode('text');
@@ -1 +1 @@
1
- {"version":3,"names":["_memize","_interopRequireDefault","require","_reactNative","_reactNativeGestureHandler","_element","_editor","_blocks","_data","_compose","_reactNativeBridge","_components","_coreData","_layout","_jsxRuntime","Editor","Component","constructor","props","arguments","galleryWithImageBlocks","window","wp","galleryBlockV2Enabled","initialHtmlModeEnabled","mode","switchEditorMode","getEditorSettings","memize","maxSize","setTitleRef","bind","settings","isRTL","I18nManager","componentDidMount","editEntityRecord","postType","postId","subscriptionParentSetFocusOnTitle","subscribeSetFocusOnTitle","postTitleRef","focus","focusTitleWhenAvailable","subscriptionParentFeaturedImageIdNativeUpdated","subscribeFeaturedImageIdNativeUpdated","payload","featured_media","featuredImageId","undoIgnore","componentWillUnmount","remove","titleRef","render","initialEdits","post","initialHtml","editorSettings","normalizedPost","id","title","raw","initialTitle","content","serialize","parse","type","status","meta","jsx","GestureHandlerRootView","style","flex","children","SlotFillProvider","EditorProvider","useSubRegistry","ErrorBoundary","default","_default","exports","compose","withSelect","select","getEditorMode","editorStore","withDispatch","dispatch","coreStore"],"sources":["@wordpress/edit-post/src/editor.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport memize from 'memize';\nimport { I18nManager } from 'react-native';\nimport { GestureHandlerRootView } from 'react-native-gesture-handler';\n\n/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport {\n\tEditorProvider,\n\tErrorBoundary,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { parse, serialize } from '@wordpress/blocks';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\nimport {\n\tsubscribeSetFocusOnTitle,\n\tsubscribeFeaturedImageIdNativeUpdated,\n} from '@wordpress/react-native-bridge';\nimport { SlotFillProvider } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport Layout from './components/layout';\n\nclass Editor extends Component {\n\tconstructor( props ) {\n\t\tsuper( ...arguments );\n\n\t\t// need to set this globally to avoid race with deprecations\n\t\t// defaulting to true to avoid issues with a not-yet-cached value\n\t\tconst { galleryWithImageBlocks = true } = props;\n\t\twindow.wp.galleryBlockV2Enabled = galleryWithImageBlocks;\n\n\t\tif ( props.initialHtmlModeEnabled && props.mode === 'visual' ) {\n\t\t\t// Enable html mode if the initial mode the parent wants it but we're not already in it.\n\t\t\tthis.props.switchEditorMode( 'text' );\n\t\t}\n\n\t\tthis.getEditorSettings = memize( this.getEditorSettings, {\n\t\t\tmaxSize: 1,\n\t\t} );\n\n\t\tthis.setTitleRef = this.setTitleRef.bind( this );\n\t}\n\n\tgetEditorSettings( settings ) {\n\t\tsettings = {\n\t\t\t...settings,\n\t\t\tisRTL: I18nManager.isRTL,\n\t\t};\n\n\t\treturn settings;\n\t}\n\n\tcomponentDidMount() {\n\t\tconst { editEntityRecord, postType, postId } = this.props;\n\n\t\tthis.subscriptionParentSetFocusOnTitle = subscribeSetFocusOnTitle(\n\t\t\t() => {\n\t\t\t\tif ( this.postTitleRef ) {\n\t\t\t\t\tthis.postTitleRef.focus();\n\t\t\t\t} else {\n\t\t\t\t\t// If the post title ref is not available, we postpone setting focus to when it's available.\n\t\t\t\t\tthis.focusTitleWhenAvailable = true;\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentFeaturedImageIdNativeUpdated =\n\t\t\tsubscribeFeaturedImageIdNativeUpdated( ( payload ) => {\n\t\t\t\teditEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\tpostId,\n\t\t\t\t\t{ featured_media: payload.featuredImageId },\n\t\t\t\t\t{\n\t\t\t\t\t\tundoIgnore: true,\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t} );\n\t}\n\n\tcomponentWillUnmount() {\n\t\tif ( this.subscriptionParentSetFocusOnTitle ) {\n\t\t\tthis.subscriptionParentSetFocusOnTitle.remove();\n\t\t}\n\n\t\tif ( this.subscribeFeaturedImageIdNativeUpdated ) {\n\t\t\tthis.subscribeFeaturedImageIdNativeUpdated.remove();\n\t\t}\n\t}\n\n\tsetTitleRef( titleRef ) {\n\t\tif ( this.focusTitleWhenAvailable && ! this.postTitleRef ) {\n\t\t\tthis.focusTitleWhenAvailable = false;\n\t\t\ttitleRef.focus();\n\t\t}\n\n\t\tthis.postTitleRef = titleRef;\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tsettings,\n\t\t\tinitialEdits,\n\t\t\tpost,\n\t\t\tpostId,\n\t\t\tpostType,\n\t\t\tfeaturedImageId,\n\t\t\tinitialHtml,\n\t\t\t...props\n\t\t} = this.props;\n\n\t\tconst editorSettings = this.getEditorSettings( settings );\n\n\t\tconst normalizedPost = post || {\n\t\t\tid: postId,\n\t\t\ttitle: {\n\t\t\t\traw: props.initialTitle || '',\n\t\t\t},\n\t\t\tfeatured_media: featuredImageId,\n\t\t\tcontent: {\n\t\t\t\t// Make sure the post content is in sync with gutenberg store\n\t\t\t\t// to avoid marking the post as modified when simply loaded\n\t\t\t\t// For now, let's assume: serialize( parse( html ) ) !== html.\n\t\t\t\traw: serialize( parse( initialHtml || '' ) ),\n\t\t\t},\n\t\t\ttype: postType,\n\t\t\tstatus: 'draft',\n\t\t\tmeta: [],\n\t\t};\n\n\t\treturn (\n\t\t\t<GestureHandlerRootView style={ { flex: 1 } }>\n\t\t\t\t<SlotFillProvider>\n\t\t\t\t\t<EditorProvider\n\t\t\t\t\t\tsettings={ editorSettings }\n\t\t\t\t\t\tpost={ normalizedPost }\n\t\t\t\t\t\tinitialEdits={ initialEdits }\n\t\t\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t>\n\t\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t<Layout setTitleRef={ this.setTitleRef } />\n\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t</EditorProvider>\n\t\t\t\t</SlotFillProvider>\n\t\t\t</GestureHandlerRootView>\n\t\t);\n\t}\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst { getEditorMode } = select( editorStore );\n\n\t\treturn {\n\t\t\tmode: getEditorMode(),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { switchEditorMode } = dispatch( editorStore );\n\t\tconst { editEntityRecord } = dispatch( coreStore );\n\t\treturn {\n\t\t\tswitchEditorMode,\n\t\t\teditEntityRecord,\n\t\t};\n\t} ),\n] )( Editor );\n"],"mappings":";;;;;;;AAGA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,0BAAA,GAAAF,OAAA;AAKA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAKA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,kBAAA,GAAAR,OAAA;AAIA,IAAAS,WAAA,GAAAT,OAAA;AACA,IAAAU,SAAA,GAAAV,OAAA;AAKA,IAAAW,OAAA,GAAAZ,sBAAA,CAAAC,OAAA;AAAyC,IAAAY,WAAA,GAAAZ,OAAA;AA7BzC;AACA;AACA;;AAKA;AACA;AACA;;AAiBA;AACA;AACA;;AAGA,MAAMa,MAAM,SAASC,kBAAS,CAAC;EAC9BC,WAAWA,CAAEC,KAAK,EAAG;IACpB,KAAK,CAAE,GAAGC,SAAU,CAAC;;IAErB;IACA;IACA,MAAM;MAAEC,sBAAsB,GAAG;IAAK,CAAC,GAAGF,KAAK;IAC/CG,MAAM,CAACC,EAAE,CAACC,qBAAqB,GAAGH,sBAAsB;IAExD,IAAKF,KAAK,CAACM,sBAAsB,IAAIN,KAAK,CAACO,IAAI,KAAK,QAAQ,EAAG;MAC9D;MACA,IAAI,CAACP,KAAK,CAACQ,gBAAgB,CAAE,MAAO,CAAC;IACtC;IAEA,IAAI,CAACC,iBAAiB,GAAG,IAAAC,eAAM,EAAE,IAAI,CAACD,iBAAiB,EAAE;MACxDE,OAAO,EAAE;IACV,CAAE,CAAC;I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AChD,WAAW,EAAG,IAAI,CAACA;YAAa,CAAE;UAAC,CAC7B;QAAC,CACD;MAAC,CACA;IAAC,CACI,CAAC;EAE3B;AACD;AAAC,IAAAiD,QAAA,GAAAC,OAAA,CAAAF,OAAA,GAEc,IAAAG,gBAAO,EAAE,CACvB,IAAAC,gBAAU,EAAIC,MAAM,IAAM;EACzB,MAAM;IAAEC;EAAc,CAAC,GAAGD,MAAM,CAAEE,aAAY,CAAC;EAE/C,OAAO;IACN5D,IAAI,EAAE2D,aAAa,CAAC;EACrB,CAAC;AACF,CAAE,CAAC,EACH,IAAAE,kBAAY,EAAIC,QAAQ,IAAM;EAC7B,MAAM;IAAE7D;EAAiB,CAAC,GAAG6D,QAAQ,CAAEF,aAAY,CAAC;EACpD,MAAM;IAAEjD;EAAiB,CAAC,GAAGmD,QAAQ,CAAEC,eAAU,CAAC;EAClD,OAAO;IACN9D,gBAAgB;IAChBU;EACD,CAAC;AACF,CAAE,CAAC,CACF,CAAC,CAAErB,MAAO,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_memize","_interopRequireDefault","require","_reactNative","_reactNativeGestureHandler","_element","_editor","_blocks","_data","_compose","_reactNativeBridge","_components","_coreData","_layout","_jsxRuntime","Editor","Component","constructor","props","arguments","initialHtmlModeEnabled","mode","switchEditorMode","getEditorSettings","memize","maxSize","setTitleRef","bind","settings","isRTL","I18nManager","componentDidMount","editEntityRecord","postType","postId","subscriptionParentSetFocusOnTitle","subscribeSetFocusOnTitle","postTitleRef","focus","focusTitleWhenAvailable","subscriptionParentFeaturedImageIdNativeUpdated","subscribeFeaturedImageIdNativeUpdated","payload","featured_media","featuredImageId","undoIgnore","componentWillUnmount","remove","titleRef","render","initialEdits","post","initialHtml","editorSettings","normalizedPost","id","title","raw","initialTitle","content","serialize","parse","type","status","meta","jsx","GestureHandlerRootView","style","flex","children","SlotFillProvider","EditorProvider","useSubRegistry","ErrorBoundary","default","_default","exports","compose","withSelect","select","getEditorMode","editorStore","withDispatch","dispatch","coreStore"],"sources":["@wordpress/edit-post/src/editor.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport memize from 'memize';\nimport { I18nManager } from 'react-native';\nimport { GestureHandlerRootView } from 'react-native-gesture-handler';\n\n/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport {\n\tEditorProvider,\n\tErrorBoundary,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { parse, serialize } from '@wordpress/blocks';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\nimport {\n\tsubscribeSetFocusOnTitle,\n\tsubscribeFeaturedImageIdNativeUpdated,\n} from '@wordpress/react-native-bridge';\nimport { SlotFillProvider } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport Layout from './components/layout';\n\nclass Editor extends Component {\n\tconstructor( props ) {\n\t\tsuper( ...arguments );\n\n\t\tif ( props.initialHtmlModeEnabled && props.mode === 'visual' ) {\n\t\t\t// Enable html mode if the initial mode the parent wants it but we're not already in it.\n\t\t\tthis.props.switchEditorMode( 'text' );\n\t\t}\n\n\t\tthis.getEditorSettings = memize( this.getEditorSettings, {\n\t\t\tmaxSize: 1,\n\t\t} );\n\n\t\tthis.setTitleRef = this.setTitleRef.bind( this );\n\t}\n\n\tgetEditorSettings( settings ) {\n\t\tsettings = {\n\t\t\t...settings,\n\t\t\tisRTL: I18nManager.isRTL,\n\t\t};\n\n\t\treturn settings;\n\t}\n\n\tcomponentDidMount() {\n\t\tconst { editEntityRecord, postType, postId } = this.props;\n\n\t\tthis.subscriptionParentSetFocusOnTitle = subscribeSetFocusOnTitle(\n\t\t\t() => {\n\t\t\t\tif ( this.postTitleRef ) {\n\t\t\t\t\tthis.postTitleRef.focus();\n\t\t\t\t} else {\n\t\t\t\t\t// If the post title ref is not available, we postpone setting focus to when it's available.\n\t\t\t\t\tthis.focusTitleWhenAvailable = true;\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentFeaturedImageIdNativeUpdated =\n\t\t\tsubscribeFeaturedImageIdNativeUpdated( ( payload ) => {\n\t\t\t\teditEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\tpostId,\n\t\t\t\t\t{ featured_media: payload.featuredImageId },\n\t\t\t\t\t{\n\t\t\t\t\t\tundoIgnore: true,\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t} );\n\t}\n\n\tcomponentWillUnmount() {\n\t\tif ( this.subscriptionParentSetFocusOnTitle ) {\n\t\t\tthis.subscriptionParentSetFocusOnTitle.remove();\n\t\t}\n\n\t\tif ( this.subscribeFeaturedImageIdNativeUpdated ) {\n\t\t\tthis.subscribeFeaturedImageIdNativeUpdated.remove();\n\t\t}\n\t}\n\n\tsetTitleRef( titleRef ) {\n\t\tif ( this.focusTitleWhenAvailable && ! this.postTitleRef ) {\n\t\t\tthis.focusTitleWhenAvailable = false;\n\t\t\ttitleRef.focus();\n\t\t}\n\n\t\tthis.postTitleRef = titleRef;\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tsettings,\n\t\t\tinitialEdits,\n\t\t\tpost,\n\t\t\tpostId,\n\t\t\tpostType,\n\t\t\tfeaturedImageId,\n\t\t\tinitialHtml,\n\t\t\t...props\n\t\t} = this.props;\n\n\t\tconst editorSettings = this.getEditorSettings( settings );\n\n\t\tconst normalizedPost = post || {\n\t\t\tid: postId,\n\t\t\ttitle: {\n\t\t\t\traw: props.initialTitle || '',\n\t\t\t},\n\t\t\tfeatured_media: featuredImageId,\n\t\t\tcontent: {\n\t\t\t\t// Make sure the post content is in sync with gutenberg store\n\t\t\t\t// to avoid marking the post as modified when simply loaded\n\t\t\t\t// For now, let's assume: serialize( parse( html ) ) !== html.\n\t\t\t\traw: serialize( parse( initialHtml || '' ) ),\n\t\t\t},\n\t\t\ttype: postType,\n\t\t\tstatus: 'draft',\n\t\t\tmeta: [],\n\t\t};\n\n\t\treturn (\n\t\t\t<GestureHandlerRootView style={ { flex: 1 } }>\n\t\t\t\t<SlotFillProvider>\n\t\t\t\t\t<EditorProvider\n\t\t\t\t\t\tsettings={ editorSettings }\n\t\t\t\t\t\tpost={ normalizedPost }\n\t\t\t\t\t\tinitialEdits={ initialEdits }\n\t\t\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t>\n\t\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t<Layout setTitleRef={ this.setTitleRef } />\n\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t</EditorProvider>\n\t\t\t\t</SlotFillProvider>\n\t\t\t</GestureHandlerRootView>\n\t\t);\n\t}\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst { getEditorMode } = select( editorStore );\n\n\t\treturn {\n\t\t\tmode: getEditorMode(),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { switchEditorMode } = dispatch( editorStore );\n\t\tconst { editEntityRecord } = dispatch( coreStore );\n\t\treturn {\n\t\t\tswitchEditorMode,\n\t\t\teditEntityRecord,\n\t\t};\n\t} ),\n] )( Editor );\n"],"mappings":";;;;;;;AAGA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,0BAAA,GAAAF,OAAA;AAKA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAKA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,kBAAA,GAAAR,OAAA;AAIA,IAAAS,WAAA,GAAAT,OAAA;AACA,IAAAU,SAAA,GAAAV,OAAA;AAKA,IAAAW,OAAA,GAAAZ,sBAAA,CAAAC,OAAA;AAAyC,IAAAY,WAAA,GAAAZ,OAAA;AA7BzC;AACA;AACA;;AAKA;AACA;AACA;;AAiBA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AAA2D,gBAAgB;QAAAD,QAAA,eAChB,IAAAvD,WAAA,CAAAmD,GAAA,EAAC3D,OAAA,CAAAiE,cAAc;UACd3C,QAAQ,EAAGyB,cAAgB;UAC3BF,IAAI,EAAGG,cAAgB;UACvBJ,YAAY,EAAGA,YAAc;UAC7BsB,cAAc,EAAG,KAAO;UAAA,GACnBtD,KAAK;UAAAmD,QAAA,eAEV,IAAAvD,WAAA,CAAAmD,GAAA,EAAC3D,OAAA,CAAAmE,aAAa;YAAAJ,QAAA,eACb,IAAAvD,WAAA,CAAAmD,GAAA,EAACpD,OAAA,CAAA6D,OAAM;cAAChD,WAAW,EAAG,IAAI,CAACA;YAAa,CAAE;UAAC,CAC7B;QAAC,CACD;MAAC,CACA;IAAC,CACI,CAAC;EAE3B;AACD;AAAC,IAAAiD,QAAA,GAAAC,OAAA,CAAAF,OAAA,GAEc,IAAAG,gBAAO,EAAE,CACvB,IAAAC,gBAAU,EAAIC,MAAM,IAAM;EACzB,MAAM;IAAEC;EAAc,CAAC,GAAGD,MAAM,CAAEE,aAAY,CAAC;EAE/C,OAAO;IACN5D,IAAI,EAAE2D,aAAa,CAAC;EACrB,CAAC;AACF,CAAE,CAAC,EACH,IAAAE,kBAAY,EAAIC,QAAQ,IAAM;EAC7B,MAAM;IAAE7D;EAAiB,CAAC,GAAG6D,QAAQ,CAAEF,aAAY,CAAC;EACpD,MAAM;IAAEjD;EAAiB,CAAC,GAAGmD,QAAQ,CAAEC,eAAU,CAAC;EAClD,OAAO;IACN9D,gBAAgB;IAChBU;EACD,CAAC;AACF,CAAE,CAAC,CACF,CAAC,CAAEjB,MAAO,CAAC","ignoreList":[]}
package/build/index.js CHANGED
@@ -60,7 +60,10 @@ Object.keys(_deprecated2).forEach(function (key) {
60
60
  */
61
61
 
62
62
  const {
63
- BackButton: __experimentalMainDashboardButton
63
+ BackButton: __experimentalMainDashboardButton,
64
+ registerDefaultActions,
65
+ registerCoreBlockBindingsSources,
66
+ bootstrapBlockBindingsSourcesFromServer
64
67
  } = (0, _lockUnlock.unlock)(_editor.privateApis);
65
68
 
66
69
  /**
@@ -106,6 +109,8 @@ function initializeEditor(id, postType, postId, settings, initialEdits) {
106
109
  (0, _data.dispatch)(_editor.store).setIsListViewOpened(true);
107
110
  }
108
111
  (0, _blockLibrary.registerCoreBlocks)();
112
+ bootstrapBlockBindingsSourcesFromServer(settings?.blockBindingsSources);
113
+ registerCoreBlockBindingsSources();
109
114
  (0, _widgets.registerLegacyWidgetBlock)({
110
115
  inserter: false
111
116
  });
@@ -117,6 +122,7 @@ function initializeEditor(id, postType, postId, settings, initialEdits) {
117
122
  enableFSEBlocks: settings.__unstableEnableFullSiteEditingBlocks
118
123
  });
119
124
  }
125
+ registerDefaultActions();
120
126
 
121
127
  // Show a console log warning if the browser is not in Standards rendering mode.
122
128
  const documentMode = document.compatMode === 'CSS1Compat' ? 'Standards' : 'Quirks';