@wordpress/edit-post 7.35.0 → 8.0.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 (202) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/build/commands/use-commands.js +56 -0
  3. package/build/commands/use-commands.js.map +1 -0
  4. package/build/components/{header/fullscreen-mode-close/index.js → back-button/fullscreen-mode-close.js} +16 -14
  5. package/build/components/back-button/fullscreen-mode-close.js.map +1 -0
  6. package/build/components/back-button/index.js +57 -0
  7. package/build/components/back-button/index.js.map +1 -0
  8. package/build/components/header/header-toolbar/index.native.js +63 -62
  9. package/build/components/header/header-toolbar/index.native.js.map +1 -1
  10. package/build/components/header/index.native.js +2 -2
  11. package/build/components/header/index.native.js.map +1 -1
  12. package/build/components/init-pattern-modal/index.js +50 -43
  13. package/build/components/init-pattern-modal/index.js.map +1 -1
  14. package/build/components/layout/index.js +92 -146
  15. package/build/components/layout/index.js.map +1 -1
  16. package/build/components/layout/index.native.js +28 -21
  17. package/build/components/layout/index.native.js.map +1 -1
  18. package/build/components/layout/use-padding-appender.js.map +1 -0
  19. package/build/components/layout/use-should-iframe.js +46 -0
  20. package/build/components/layout/use-should-iframe.js.map +1 -0
  21. package/build/components/meta-boxes/index.js +10 -9
  22. package/build/components/meta-boxes/index.js.map +1 -1
  23. package/build/components/meta-boxes/meta-boxes-area/index.js +11 -11
  24. package/build/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
  25. package/build/components/more-menu/index.js +49 -0
  26. package/build/components/more-menu/index.js.map +1 -0
  27. package/build/components/{header/more-menu → more-menu}/manage-patterns-menu-item.js +5 -4
  28. package/build/components/more-menu/manage-patterns-menu-item.js.map +1 -0
  29. package/build/components/{header/more-menu → more-menu}/welcome-guide-menu-item.js +2 -2
  30. package/build/components/more-menu/welcome-guide-menu-item.js.map +1 -0
  31. package/build/components/preferences-modal/enable-custom-fields.js +23 -18
  32. package/build/components/preferences-modal/enable-custom-fields.js.map +1 -1
  33. package/build/components/preferences-modal/index.js +4 -4
  34. package/build/components/preferences-modal/index.js.map +1 -1
  35. package/build/components/preferences-modal/meta-boxes-section.js +13 -13
  36. package/build/components/preferences-modal/meta-boxes-section.js.map +1 -1
  37. package/build/components/visual-editor/header.native.js +11 -10
  38. package/build/components/visual-editor/header.native.js.map +1 -1
  39. package/build/components/visual-editor/index.native.js +3 -3
  40. package/build/components/visual-editor/index.native.js.map +1 -1
  41. package/build/components/welcome-guide/default.js +50 -33
  42. package/build/components/welcome-guide/default.js.map +1 -1
  43. package/build/components/welcome-guide/image.js +13 -12
  44. package/build/components/welcome-guide/image.js.map +1 -1
  45. package/build/components/welcome-guide/index.js +2 -2
  46. package/build/components/welcome-guide/index.js.map +1 -1
  47. package/build/components/welcome-guide/template.js +12 -8
  48. package/build/components/welcome-guide/template.js.map +1 -1
  49. package/build/deprecated.js +9 -9
  50. package/build/deprecated.js.map +1 -1
  51. package/build/editor.js +16 -11
  52. package/build/editor.js.map +1 -1
  53. package/build/editor.native.js +18 -12
  54. package/build/editor.native.js.map +1 -1
  55. package/build/index.js +12 -13
  56. package/build/index.js.map +1 -1
  57. package/build/index.native.js +2 -2
  58. package/build/index.native.js.map +1 -1
  59. package/build/store/selectors.js +1 -1
  60. package/build/store/selectors.js.map +1 -1
  61. package/build-module/commands/use-commands.js +49 -0
  62. package/build-module/commands/use-commands.js.map +1 -0
  63. package/build-module/components/{header/fullscreen-mode-close/index.js → back-button/fullscreen-mode-close.js} +16 -14
  64. package/build-module/components/back-button/fullscreen-mode-close.js.map +1 -0
  65. package/build-module/components/back-button/index.js +49 -0
  66. package/build-module/components/back-button/index.js.map +1 -0
  67. package/build-module/components/header/header-toolbar/index.native.js +64 -62
  68. package/build-module/components/header/header-toolbar/index.native.js.map +1 -1
  69. package/build-module/components/header/index.native.js +2 -2
  70. package/build-module/components/header/index.native.js.map +1 -1
  71. package/build-module/components/init-pattern-modal/index.js +52 -43
  72. package/build-module/components/init-pattern-modal/index.js.map +1 -1
  73. package/build-module/components/layout/index.js +97 -149
  74. package/build-module/components/layout/index.js.map +1 -1
  75. package/build-module/components/layout/index.native.js +30 -21
  76. package/build-module/components/layout/index.native.js.map +1 -1
  77. package/build-module/components/layout/use-padding-appender.js.map +1 -0
  78. package/build-module/components/layout/use-should-iframe.js +39 -0
  79. package/build-module/components/layout/use-should-iframe.js.map +1 -0
  80. package/build-module/components/meta-boxes/index.js +12 -9
  81. package/build-module/components/meta-boxes/index.js.map +1 -1
  82. package/build-module/components/meta-boxes/meta-boxes-area/index.js +11 -9
  83. package/build-module/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
  84. package/build-module/components/more-menu/index.js +43 -0
  85. package/build-module/components/more-menu/index.js.map +1 -0
  86. package/build-module/components/{header/more-menu → more-menu}/manage-patterns-menu-item.js +5 -4
  87. package/build-module/components/more-menu/manage-patterns-menu-item.js.map +1 -0
  88. package/build-module/components/{header/more-menu → more-menu}/welcome-guide-menu-item.js +2 -2
  89. package/build-module/components/more-menu/welcome-guide-menu-item.js.map +1 -0
  90. package/build-module/components/preferences-modal/enable-custom-fields.js +25 -18
  91. package/build-module/components/preferences-modal/enable-custom-fields.js.map +1 -1
  92. package/build-module/components/preferences-modal/index.js +4 -4
  93. package/build-module/components/preferences-modal/index.js.map +1 -1
  94. package/build-module/components/preferences-modal/meta-boxes-section.js +14 -13
  95. package/build-module/components/preferences-modal/meta-boxes-section.js.map +1 -1
  96. package/build-module/components/visual-editor/header.native.js +11 -10
  97. package/build-module/components/visual-editor/header.native.js.map +1 -1
  98. package/build-module/components/visual-editor/index.native.js +3 -3
  99. package/build-module/components/visual-editor/index.native.js.map +1 -1
  100. package/build-module/components/welcome-guide/default.js +52 -33
  101. package/build-module/components/welcome-guide/default.js.map +1 -1
  102. package/build-module/components/welcome-guide/image.js +14 -12
  103. package/build-module/components/welcome-guide/image.js.map +1 -1
  104. package/build-module/components/welcome-guide/index.js +2 -2
  105. package/build-module/components/welcome-guide/index.js.map +1 -1
  106. package/build-module/components/welcome-guide/template.js +14 -8
  107. package/build-module/components/welcome-guide/template.js.map +1 -1
  108. package/build-module/deprecated.js +9 -9
  109. package/build-module/deprecated.js.map +1 -1
  110. package/build-module/editor.js +17 -11
  111. package/build-module/editor.js.map +1 -1
  112. package/build-module/editor.native.js +18 -12
  113. package/build-module/editor.native.js.map +1 -1
  114. package/build-module/index.js +10 -7
  115. package/build-module/index.js.map +1 -1
  116. package/build-module/index.native.js +2 -2
  117. package/build-module/index.native.js.map +1 -1
  118. package/build-module/store/selectors.js +1 -1
  119. package/build-module/store/selectors.js.map +1 -1
  120. package/build-style/style-rtl.css +27 -128
  121. package/build-style/style.css +27 -128
  122. package/package.json +32 -32
  123. package/src/commands/use-commands.js +48 -0
  124. package/src/components/{header/fullscreen-mode-close/index.js → back-button/fullscreen-mode-close.js} +1 -1
  125. package/src/components/back-button/index.js +34 -0
  126. package/src/components/{header/fullscreen-mode-close → back-button}/style.scss +16 -2
  127. package/src/components/{header/fullscreen-mode-close/test/index.js → back-button/test/fullscreen-mode-close.js} +1 -1
  128. package/src/components/layout/index.js +85 -194
  129. package/src/components/layout/style.scss +9 -17
  130. package/src/components/layout/use-should-iframe.js +40 -0
  131. package/src/components/{header/more-menu → more-menu}/index.js +2 -2
  132. package/src/index.js +11 -6
  133. package/src/store/selectors.js +8 -5
  134. package/src/style.scss +2 -5
  135. package/src/test/__snapshots__/editor.native.js.snap +72 -0
  136. package/src/test/editor.native.js +77 -0
  137. package/build/components/header/fullscreen-mode-close/index.js.map +0 -1
  138. package/build/components/header/index.js +0 -69
  139. package/build/components/header/index.js.map +0 -1
  140. package/build/components/header/main-dashboard-button/index.js +0 -33
  141. package/build/components/header/main-dashboard-button/index.js.map +0 -1
  142. package/build/components/header/more-menu/index.js +0 -43
  143. package/build/components/header/more-menu/index.js.map +0 -1
  144. package/build/components/header/more-menu/manage-patterns-menu-item.js.map +0 -1
  145. package/build/components/header/more-menu/welcome-guide-menu-item.js.map +0 -1
  146. package/build/components/text-editor/index.js +0 -61
  147. package/build/components/text-editor/index.js.map +0 -1
  148. package/build/components/visual-editor/block-inspector-button.js +0 -55
  149. package/build/components/visual-editor/block-inspector-button.js.map +0 -1
  150. package/build/components/visual-editor/index.js +0 -98
  151. package/build/components/visual-editor/index.js.map +0 -1
  152. package/build/components/visual-editor/use-padding-appender.js.map +0 -1
  153. package/build/hooks/commands/use-common-commands.js +0 -119
  154. package/build/hooks/commands/use-common-commands.js.map +0 -1
  155. package/build/hooks/components/index.js +0 -11
  156. package/build/hooks/components/index.js.map +0 -1
  157. package/build/hooks/index.js +0 -5
  158. package/build/hooks/index.js.map +0 -1
  159. package/build/hooks/validate-multiple-use/index.js +0 -134
  160. package/build/hooks/validate-multiple-use/index.js.map +0 -1
  161. package/build-module/components/header/fullscreen-mode-close/index.js.map +0 -1
  162. package/build-module/components/header/index.js +0 -61
  163. package/build-module/components/header/index.js.map +0 -1
  164. package/build-module/components/header/main-dashboard-button/index.js +0 -26
  165. package/build-module/components/header/main-dashboard-button/index.js.map +0 -1
  166. package/build-module/components/header/more-menu/index.js +0 -35
  167. package/build-module/components/header/more-menu/index.js.map +0 -1
  168. package/build-module/components/header/more-menu/manage-patterns-menu-item.js.map +0 -1
  169. package/build-module/components/header/more-menu/welcome-guide-menu-item.js.map +0 -1
  170. package/build-module/components/text-editor/index.js +0 -54
  171. package/build-module/components/text-editor/index.js.map +0 -1
  172. package/build-module/components/visual-editor/block-inspector-button.js +0 -47
  173. package/build-module/components/visual-editor/block-inspector-button.js.map +0 -1
  174. package/build-module/components/visual-editor/index.js +0 -90
  175. package/build-module/components/visual-editor/index.js.map +0 -1
  176. package/build-module/components/visual-editor/use-padding-appender.js.map +0 -1
  177. package/build-module/hooks/commands/use-common-commands.js +0 -112
  178. package/build-module/hooks/commands/use-common-commands.js.map +0 -1
  179. package/build-module/hooks/components/index.js +0 -8
  180. package/build-module/hooks/components/index.js.map +0 -1
  181. package/build-module/hooks/index.js +0 -6
  182. package/build-module/hooks/index.js.map +0 -1
  183. package/build-module/hooks/validate-multiple-use/index.js +0 -132
  184. package/build-module/hooks/validate-multiple-use/index.js.map +0 -1
  185. package/src/components/header/index.js +0 -53
  186. package/src/components/header/main-dashboard-button/index.js +0 -28
  187. package/src/components/header/style.scss +0 -14
  188. package/src/components/text-editor/index.js +0 -63
  189. package/src/components/text-editor/style.scss +0 -71
  190. package/src/components/visual-editor/block-inspector-button.js +0 -59
  191. package/src/components/visual-editor/index.js +0 -108
  192. package/src/components/visual-editor/style.scss +0 -53
  193. package/src/hooks/commands/use-common-commands.js +0 -126
  194. package/src/hooks/components/index.js +0 -13
  195. package/src/hooks/index.js +0 -5
  196. package/src/hooks/validate-multiple-use/index.js +0 -163
  197. /package/build/components/{visual-editor → layout}/use-padding-appender.js +0 -0
  198. /package/build-module/components/{visual-editor → layout}/use-padding-appender.js +0 -0
  199. /package/src/components/{header/fullscreen-mode-close/test/__snapshots__/index.js.snap → back-button/test/__snapshots__/fullscreen-mode-close.js.snap} +0 -0
  200. /package/src/components/{visual-editor → layout}/use-padding-appender.js +0 -0
  201. /package/src/components/{header/more-menu → more-menu}/manage-patterns-menu-item.js +0 -0
  202. /package/src/components/{header/more-menu → more-menu}/welcome-guide-menu-item.js +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useRegistry","useRefEffect","store","blockEditorStore","isUnmodifiedDefaultBlock","usePaddingAppender","registry","node","onMouseDown","event","target","ownerDocument","defaultView","paddingBottom","parseInt","getComputedStyle","lastChild","lastElementChild","lastChildRect","getBoundingClientRect","clientY","bottom","preventDefault","blockOrder","select","getBlockOrder","lastBlockClientId","length","lastBlock","getBlock","selectBlock","insertDefaultBlock","dispatch","addEventListener","removeEventListener"],"sources":["@wordpress/edit-post/src/components/layout/use-padding-appender.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRegistry } from '@wordpress/data';\nimport { useRefEffect } from '@wordpress/compose';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { isUnmodifiedDefaultBlock } from '@wordpress/blocks';\n\nexport function usePaddingAppender() {\n\tconst registry = useRegistry();\n\treturn useRefEffect(\n\t\t( node ) => {\n\t\t\tfunction onMouseDown( event ) {\n\t\t\t\tif ( event.target !== node ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst { ownerDocument } = node;\n\t\t\t\tconst { defaultView } = ownerDocument;\n\n\t\t\t\tconst paddingBottom = defaultView.parseInt(\n\t\t\t\t\tdefaultView.getComputedStyle( node ).paddingBottom,\n\t\t\t\t\t10\n\t\t\t\t);\n\n\t\t\t\tif ( ! paddingBottom ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Only handle clicks under the last child.\n\t\t\t\tconst lastChild = node.lastElementChild;\n\t\t\t\tif ( ! lastChild ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst lastChildRect = lastChild.getBoundingClientRect();\n\t\t\t\tif ( event.clientY < lastChildRect.bottom ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tevent.preventDefault();\n\n\t\t\t\tconst blockOrder = registry\n\t\t\t\t\t.select( blockEditorStore )\n\t\t\t\t\t.getBlockOrder( '' );\n\t\t\t\tconst lastBlockClientId = blockOrder[ blockOrder.length - 1 ];\n\n\t\t\t\t// Do nothing when only default block appender is present.\n\t\t\t\tif ( ! lastBlockClientId ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst lastBlock = registry\n\t\t\t\t\t.select( blockEditorStore )\n\t\t\t\t\t.getBlock( lastBlockClientId );\n\t\t\t\tconst { selectBlock, insertDefaultBlock } =\n\t\t\t\t\tregistry.dispatch( blockEditorStore );\n\n\t\t\t\tif ( isUnmodifiedDefaultBlock( lastBlock ) ) {\n\t\t\t\t\tselectBlock( lastBlockClientId );\n\t\t\t\t} else {\n\t\t\t\t\tinsertDefaultBlock();\n\t\t\t\t}\n\t\t\t}\n\t\t\tnode.addEventListener( 'mousedown', onMou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CAAED,iBAAiB,EAAG;QAC1B;MACD;MAEA,MAAME,SAAS,GAAGtB,QAAQ,CACxBkB,MAAM,CAAErB,gBAAiB,CAAC,CAC1B0B,QAAQ,CAAEH,iBAAkB,CAAC;MAC/B,MAAM;QAAEI,WAAW;QAAEC;MAAmB,CAAC,GACxCzB,QAAQ,CAAC0B,QAAQ,CAAE7B,gBAAiB,CAAC;MAEtC,IAAKC,wBAAwB,CAAEwB,SAAU,CAAC,EAAG;QAC5CE,WAAW,CAAEJ,iBAAkB,CAAC;MACjC,CAAC,MAAM;QACNK,kBAAkB,CAAC,CAAC;MACrB;IACD;IACAxB,IAAI,CAAC0B,gBAAgB,CAAE,WAAW,EAAEzB,WAAY,CAAC;IACjD,OAAO,MAAM;MACZD,IAAI,CAAC2B,mBAAmB,CAAE,WAAW,EAAE1B,WAAY,CAAC;IACrD,CAAC;EACF,CAAC,EACD,CAAEF,QAAQ,CACX,CAAC;AACF","ignoreList":[]}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { store as editorStore } from '@wordpress/editor';
5
+ import { useSelect } from '@wordpress/data';
6
+ import { store as blocksStore } from '@wordpress/blocks';
7
+
8
+ /**
9
+ * Internal dependencies
10
+ */
11
+ import { store as editPostStore } from '../../store';
12
+ const isGutenbergPlugin = globalThis.IS_GUTENBERG_PLUGIN ? true : false;
13
+ export function useShouldIframe() {
14
+ const {
15
+ isBlockBasedTheme,
16
+ hasV3BlocksOnly,
17
+ isEditingTemplate,
18
+ hasMetaBoxes
19
+ } = useSelect(select => {
20
+ const {
21
+ getEditorSettings,
22
+ getCurrentPostType
23
+ } = select(editorStore);
24
+ const {
25
+ getBlockTypes
26
+ } = select(blocksStore);
27
+ const editorSettings = getEditorSettings();
28
+ return {
29
+ isBlockBasedTheme: editorSettings.__unstableIsBlockBasedTheme,
30
+ hasV3BlocksOnly: getBlockTypes().every(type => {
31
+ return type.apiVersion >= 3;
32
+ }),
33
+ isEditingTemplate: getCurrentPostType() === 'wp_template',
34
+ hasMetaBoxes: select(editPostStore).hasMetaBoxes()
35
+ };
36
+ }, []);
37
+ return (hasV3BlocksOnly || isGutenbergPlugin && isBlockBasedTheme) && !hasMetaBoxes || isEditingTemplate;
38
+ }
39
+ //# sourceMappingURL=use-should-iframe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["store","editorStore","useSelect","blocksStore","editPostStore","isGutenbergPlugin","globalThis","IS_GUTENBERG_PLUGIN","useShouldIframe","isBlockBasedTheme","hasV3BlocksOnly","isEditingTemplate","hasMetaBoxes","select","getEditorSettings","getCurrentPostType","getBlockTypes","editorSettings","__unstableIsBlockBasedTheme","every","type","apiVersion"],"sources":["@wordpress/edit-post/src/components/layout/use-should-iframe.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as editorStore } from '@wordpress/editor';\nimport { useSelect } from '@wordpress/data';\nimport { store as blocksStore } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nconst isGutenbergPlugin = globalThis.IS_GUTENBERG_PLUGIN ? true : false;\n\nexport function useShouldIframe() {\n\tconst {\n\t\tisBlockBasedTheme,\n\t\thasV3BlocksOnly,\n\t\tisEditingTemplate,\n\t\thasMetaBoxes,\n\t} = useSelect( ( select ) => {\n\t\tconst { getEditorSettings, getCurrentPostType } = select( editorStore );\n\t\tconst { getBlockTypes } = select( blocksStore );\n\t\tconst editorSettings = getEditorSettings();\n\t\treturn {\n\t\t\tisBlockBasedTheme: editorSettings.__unstableIsBlockBasedTheme,\n\t\t\thasV3BlocksOnly: getBlockTypes().every( ( type ) => {\n\t\t\t\treturn type.apiVersion >= 3;\n\t\t\t} ),\n\t\t\tisEditingTemplate: getCurrentPostType() === 'wp_template',\n\t\t\thasMetaBoxes: select( editPostStore ).hasMetaBoxes(),\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t( ( hasV3BlocksOnly || ( isGutenbergPlugin && isBlockBasedTheme ) ) &&\n\t\t\t! hasMetaBoxes ) ||\n\t\tisEditingTemplate\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASF,KAAK,IAAIG,WAAW,QAAQ,mBAAmB;;AAExD;AACA;AACA;AACA,SAASH,KAAK,IAAII,aAAa,QAAQ,aAAa;AAEpD,MAAMC,iBAAiB,GAAGC,UAAU,CAACC,mBAAmB,GAAG,IAAI,GAAG,KAAK;AAEvE,OAAO,SAASC,eAAeA,CAAA,EAAG;EACjC,MAAM;IACLC,iBAAiB;IACjBC,eAAe;IACfC,iBAAiB;IACjBC;EACD,CAAC,GAAGV,SAAS,CAAIW,MAAM,IAAM;IAC5B,MAAM;MAAEC,iBAAiB;MAAEC;IAAmB,CAAC,GAAGF,MAAM,CAAEZ,WAAY,CAAC;IACvE,MAAM;MAAEe;IAAc,CAAC,GAAGH,MAAM,CAAEV,WAAY,CAAC;IAC/C,MAAMc,cAAc,GAAGH,iBAAiB,CAAC,CAAC;IAC1C,OAAO;MACNL,iBAAiB,EAAEQ,cAAc,CAACC,2BAA2B;MAC7DR,eAAe,EAAEM,aAAa,CAAC,CAAC,CAACG,KAAK,CAAIC,IAAI,IAAM;QACnD,OAAOA,IAAI,CAACC,UAAU,IAAI,CAAC;MAC5B,CAAE,CAAC;MACHV,iBAAiB,EAAEI,kBAAkB,CAAC,CAAC,KAAK,aAAa;MACzDH,YAAY,EAAEC,MAAM,CAAET,aAAc,CAAC,CAACQ,YAAY,CAAC;IACpD,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,OACG,CAAEF,eAAe,IAAML,iBAAiB,IAAII,iBAAmB,KAChE,CAAEG,YAAY,IACfD,iBAAiB;AAEnB","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- import { createElement, Fragment } from "react";
2
1
  /**
3
2
  * WordPress dependencies
4
3
  */
@@ -12,6 +11,9 @@ import { store as editorStore } from '@wordpress/editor';
12
11
  import MetaBoxesArea from './meta-boxes-area';
13
12
  import MetaBoxVisibility from './meta-box-visibility';
14
13
  import { store as editPostStore } from '../../store';
14
+ import { jsx as _jsx } from "react/jsx-runtime";
15
+ import { Fragment as _Fragment } from "react/jsx-runtime";
16
+ import { jsxs as _jsxs } from "react/jsx-runtime";
15
17
  export default function MetaBoxes({
16
18
  location
17
19
  }) {
@@ -47,13 +49,14 @@ export default function MetaBoxes({
47
49
  if (!areMetaBoxesInitialized) {
48
50
  return null;
49
51
  }
50
- return createElement(Fragment, null, (metaBoxes !== null && metaBoxes !== void 0 ? metaBoxes : []).map(({
51
- id
52
- }) => createElement(MetaBoxVisibility, {
53
- key: id,
54
- id: id
55
- })), createElement(MetaBoxesArea, {
56
- location: location
57
- }));
52
+ return /*#__PURE__*/_jsxs(_Fragment, {
53
+ children: [(metaBoxes !== null && metaBoxes !== void 0 ? metaBoxes : []).map(({
54
+ id
55
+ }) => /*#__PURE__*/_jsx(MetaBoxVisibility, {
56
+ id: id
57
+ }, id)), /*#__PURE__*/_jsx(MetaBoxesArea, {
58
+ location: location
59
+ })]
60
+ });
58
61
  }
59
62
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useSelect","useRegistry","useEffect","store","editorStore","MetaBoxesArea","MetaBoxVisibility","editPostStore","MetaBoxes","location","registry","metaBoxes","areMetaBoxesInitialized","isEditorReady","select","__unstableIsEditorReady","getMetaBoxesPerLocation","_areMetaBoxesInitialized","hasMetaBoxes","length","dispatch","initializeMetaBoxes","createElement","Fragment","map","id","key"],"sources":["@wordpress/edit-post/src/components/meta-boxes/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useRegistry } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport MetaBoxesArea from './meta-boxes-area';\nimport MetaBoxVisibility from './meta-box-visibility';\nimport { store as editPostStore } from '../../store';\n\nexport default function MetaBoxes( { location } ) {\n\tconst registry = useRegistry();\n\tconst { metaBoxes, areMetaBoxesInitialized, isEditorReady } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { __unstableIsEditorReady } = select( editorStore );\n\t\t\tconst {\n\t\t\t\tgetMetaBoxesPerLocation,\n\t\t\t\tareMetaBoxesInitialized: _areMetaBoxesInitialized,\n\t\t\t} = select( editPostStore );\n\t\t\treturn {\n\t\t\t\tmetaBoxes: getMetaBoxesPerLocation( location ),\n\t\t\t\tareMetaBoxesInitialized: _areMetaBoxesInitialized(),\n\t\t\t\tisEditorReady: __unstableIsEditorReady(),\n\t\t\t};\n\t\t},\n\t\t[ location ]\n\t);\n\n\tconst hasMetaBoxes = !! metaBoxes?.length;\n\n\t// When editor is ready, initialize postboxes (wp core script) and metabox\n\t// saving. This initializes all meta box locations, not just this specific\n\t// one.\n\tuseEffect( () => {\n\t\tif ( isEditorReady && hasMetaBoxes && ! areMetaBoxesInitialized ) {\n\t\t\tregistry.dispatch( editPostStore ).initializeMetaBoxes();\n\t\t}\n\t}, [ isEditorReady, hasMetaBoxes, areMetaBoxesInitialized ] );\n\n\tif ( ! areMetaBoxesInitialized ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ ( metaBoxes ?? [] ).map( ( { id } ) => (\n\t\t\t\t<MetaBoxVisibility key={ id } id={ id } />\n\t\t\t) ) }\n\t\t\t<MetaBoxesArea location={ location } />\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;;AAExD;AACA;AACA;AACA,OAAOC,aAAa,MAAM,mBAAmB;AAC7C,OAAOC,iBAAiB,MAAM,uBAAuB;AACrD,SAASH,KAAK,IAAII,aAAa,QAAQ,aAAa;AAEpD,eAAe,SA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,"names":["useSelect","useRegistry","useEffect","store","editorStore","MetaBoxesArea","MetaBoxVisibility","editPostStore","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","MetaBoxes","location","registry","metaBoxes","areMetaBoxesInitialized","isEditorReady","select","__unstableIsEditorReady","getMetaBoxesPerLocation","_areMetaBoxesInitialized","hasMetaBoxes","length","dispatch","initializeMetaBoxes","children","map","id"],"sources":["@wordpress/edit-post/src/components/meta-boxes/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useRegistry } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport MetaBoxesArea from './meta-boxes-area';\nimport MetaBoxVisibility from './meta-box-visibility';\nimport { store as editPostStore } from '../../store';\n\nexport default function MetaBoxes( { location } ) {\n\tconst registry = useRegistry();\n\tconst { metaBoxes, areMetaBoxesInitialized, isEditorReady } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { __unstableIsEditorReady } = select( editorStore );\n\t\t\tconst {\n\t\t\t\tgetMetaBoxesPerLocation,\n\t\t\t\tareMetaBoxesInitialized: _areMetaBoxesInitialized,\n\t\t\t} = select( editPostStore );\n\t\t\treturn {\n\t\t\t\tmetaBoxes: getMetaBoxesPerLocation( location ),\n\t\t\t\tareMetaBoxesInitialized: _areMetaBoxesInitialized(),\n\t\t\t\tisEditorReady: __unstableIsEditorReady(),\n\t\t\t};\n\t\t},\n\t\t[ location ]\n\t);\n\n\tconst hasMetaBoxes = !! metaBoxes?.length;\n\n\t// When editor is ready, initialize postboxes (wp core script) and metabox\n\t// saving. This initializes all meta box locations, not just this specific\n\t// one.\n\tuseEffect( () => {\n\t\tif ( isEditorReady && hasMetaBoxes && ! areMetaBoxesInitialized ) {\n\t\t\tregistry.dispatch( editPostStore ).initializeMetaBoxes();\n\t\t}\n\t}, [ isEditorReady, hasMetaBoxes, areMetaBoxesInitialized ] );\n\n\tif ( ! areMetaBoxesInitialized ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ ( metaBoxes ?? [] ).map( ( { id } ) => (\n\t\t\t\t<MetaBoxVisibility key={ id } id={ id } />\n\t\t\t) ) }\n\t\t\t<MetaBoxesArea location={ location } />\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;;AAExD;AACA;AACA;AACA,OAAOC,aAAa,MAAM,mBAAmB;AAC7C,OAAOC,iBAAiB,MAAM,uBAAuB;AACrD,SAASH,KAAK,IAAII,aAAa,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAErD,eAAe,SAASC,SAASA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACjD,MAAMC,QAAQ,GAAGf,WAAW,CAAC,CAAC;EAC9B,MAAM;IAAEgB,SAAS;IAAEC,uBAAuB;IAAEC;EAAc,CAAC,GAAGnB,SAAS,CACpEoB,MAAM,IAAM;IACb,MAAM;MAAEC;IAAwB,CAAC,GAAGD,MAAM,CAAEhB,WAAY,CAAC;IACzD,MAAM;MACLkB,uBAAuB;MACvBJ,uBAAuB,EAAEK;IAC1B,CAAC,GAAGH,MAAM,CAAEb,aAAc,CAAC;IAC3B,OAAO;MACNU,SAAS,EAAEK,uBAAuB,CAAEP,QAAS,CAAC;MAC9CG,uBAAuB,EAAEK,wBAAwB,CAAC,CAAC;MACnDJ,aAAa,EAAEE,uBAAuB,CAAC;IACxC,CAAC;EACF,CAAC,EACD,CAAEN,QAAQ,CACX,CAAC;EAED,MAAMS,YAAY,GAAG,CAAC,CAAEP,SAAS,EAAEQ,MAAM;;EAEzC;EACA;EACA;EACAvB,SAAS,CAAE,MAAM;IAChB,IAAKiB,aAAa,IAAIK,YAAY,IAAI,CAAEN,uBAAuB,EAAG;MACjEF,QAAQ,CAACU,QAAQ,CAAEnB,aAAc,CAAC,CAACoB,mBAAmB,CAAC,CAAC;IACzD;EACD,CAAC,EAAE,CAAER,aAAa,EAAEK,YAAY,EAAEN,uBAAuB,CAAG,CAAC;EAE7D,IAAK,CAAEA,uBAAuB,EAAG;IAChC,OAAO,IAAI;EACZ;EAEA,oBACCL,KAAA,CAAAF,SAAA;IAAAiB,QAAA,GACG,CAAEX,SAAS,aAATA,SAAS,cAATA,SAAS,GAAI,EAAE,EAAGY,GAAG,CAAE,CAAE;MAAEC;IAAG,CAAC,kBAClCrB,IAAA,CAACH,iBAAiB;MAAYwB,EAAE,EAAGA;IAAI,GAAdA,EAAgB,CACxC,CAAC,eACHrB,IAAA,CAACJ,aAAa;MAACU,QAAQ,EAAGA;IAAU,CAAE,CAAC;EAAA,CACtC,CAAC;AAEL","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- import { createElement } from "react";
2
1
  /**
3
2
  * External dependencies
4
3
  */
@@ -23,6 +22,8 @@ import { store as editPostStore } from '../../../store';
23
22
  * @param {string} props.location metabox location.
24
23
  * @return {Component} The component to be rendered.
25
24
  */
25
+ import { jsx as _jsx } from "react/jsx-runtime";
26
+ import { jsxs as _jsxs } from "react/jsx-runtime";
26
27
  function MetaBoxesArea({
27
28
  location
28
29
  }) {
@@ -45,14 +46,15 @@ function MetaBoxesArea({
45
46
  const classes = clsx('edit-post-meta-boxes-area', `is-${location}`, {
46
47
  'is-loading': isSaving
47
48
  });
48
- return createElement("div", {
49
- className: classes
50
- }, isSaving && createElement(Spinner, null), createElement("div", {
51
- className: "edit-post-meta-boxes-area__container",
52
- ref: container
53
- }), createElement("div", {
54
- className: "edit-post-meta-boxes-area__clear"
55
- }));
49
+ return /*#__PURE__*/_jsxs("div", {
50
+ className: classes,
51
+ children: [isSaving && /*#__PURE__*/_jsx(Spinner, {}), /*#__PURE__*/_jsx("div", {
52
+ className: "edit-post-meta-boxes-area__container",
53
+ ref: container
54
+ }), /*#__PURE__*/_jsx("div", {
55
+ className: "edit-post-meta-boxes-area__clear"
56
+ })]
57
+ });
56
58
  }
57
59
  export default MetaBoxesArea;
58
60
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","useRef","useEffect","Spinner","useSelect","store","editPostStore","MetaBoxesArea","location","container","formRef","current","document","querySelector","appendChild","isSaving","select","isSavingMetaBoxes","classes","createElement","className","ref"],"sources":["@wordpress/edit-post/src/components/meta-boxes/meta-boxes-area/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useRef, useEffect } from '@wordpress/element';\nimport { Spinner } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\n/**\n * Render metabox area.\n *\n * @param {Object} props Component props.\n * @param {string} props.location metabox location.\n * @return {Component} The component to be rendered.\n */\nfunction MetaBoxesArea( { location } ) {\n\tconst container = useRef( null );\n\tconst formRef = useRef( null );\n\n\tuseEffect( () => {\n\t\tformRef.current = document.querySelector(\n\t\t\t'.metabox-location-' + location\n\t\t);\n\n\t\tif ( formRef.current ) {\n\t\t\tcontainer.current.appendChild( formRef.current );\n\t\t}\n\n\t\treturn () => {\n\t\t\tif ( formRef.current ) {\n\t\t\t\tdocument\n\t\t\t\t\t.querySelector( '#metaboxes' )\n\t\t\t\t\t.appendChild( formRef.current );\n\t\t\t}\n\t\t};\n\t}, [ location ] );\n\n\tconst isSaving = useSelect( ( select ) => {\n\t\treturn select( editPostStore ).isSavingMetaBoxes();\n\t}, [] );\n\n\tconst classes = clsx( 'edit-post-meta-boxes-area', `is-${ location }`, {\n\t\t'is-loading': isSaving,\n\t} );\n\n\treturn (\n\t\t<div className={ classes }>\n\t\t\t{ isSaving && <Spinner /> }\n\t\t\t<div\n\t\t\t\tclassName=\"edit-post-meta-boxes-area__container\"\n\t\t\t\tref={ container }\n\t\t\t/>\n\t\t\t<div className=\"edit-post-meta-boxes-area__clear\" />\n\t\t</div>\n\t);\n}\n\nexport default MetaBoxesArea;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,MAAM,EAAEC,SAAS,QAAQ,oBAAoB;AACtD,SAASC,OAAO,QAAQ,uBAAuB;AAC/C,SAASC,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SAASC,KAAK,IAAIC,aAAa,QAAQ,gBAAgB;;AAEvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,aAAaA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACtC,MAAMC,SAAS,GAAGR,MAAM,CAAE,IAAK,CAAC;EAChC,MAAMS,OAAO,GAAGT,MAAM,CAAE,IAAK,CAAC;EAE9BC,SAAS,CAAE,MAAM;IAChBQ,OAAO,CAACC,OAAO,GAAGC,QAAQ,CAACC,aAAa,CACvC,oBAAoB,GAAGL,QACxB,CAAC;IAED,IAAKE,OAAO,CAACC,OAAO,EAAG;MACtBF,SAAS,CAACE,OAAO,CAACG,WAAW,CAAEJ,OAAO,CAACC,OAAQ,CAAC;IACjD;IAEA,OAAO,MAAM;MACZ,IAAKD,OAAO,CAACC,OAAO,EAAG;QACtBC,QAAQ,CACNC,aAAa,CAAE,YAAa,CAAC,CAC7BC,WAAW,CAAEJ,OAAO,CAACC,OAAQ,CAAC;MACjC;IACD,CAAC;EACF,CAAC,EAAE,CAAEH,QAAQ,CAAG,CAAC;EAEjB,MAAMO,QAAQ,GAAGX,SAAS,CAAIY,MAAM,IAAM;IACzC,OAAOA,MAAM,CAAEV,aAAc,CAAC,CAACW,iBAAiB,CAAC,CAAC;EACnD,CAAC,EAAE,EAAG,CAAC;EAEP,MAAMC,OAAO,GAAGlB,IAAI,CAAE,2BAA2B,EAAG,MAAMQ,QAAU,EAAC,EAAE;IACtE,YAAY,EAAEO;EACf,CAAE,CAAC;EAEH,OACCI,aAAA;IAAKC,SAAS,EAAGF;EAAS,GACvBH,QAAQ,IAAII,aAAA,CAAChB,OAAO,MAAE,CAAC,EACzBgB,aAAA;IACCC,SAAS,EAAC,sCAAsC;IAChDC,GAAG,EAAGZ;EAAW,CACjB,CAAC,EACFU,aAAA;IAAKC,SAAS,EAAC;EAAkC,CAAE,CAC/C,CAAC;AAER;AAEA,eAAeb,aAAa","ignoreList":[]}
1
+ {"version":3,"names":["clsx","useRef","useEffect","Spinner","useSelect","store","editPostStore","jsx","_jsx","jsxs","_jsxs","MetaBoxesArea","location","container","formRef","current","document","querySelector","appendChild","isSaving","select","isSavingMetaBoxes","classes","className","children","ref"],"sources":["@wordpress/edit-post/src/components/meta-boxes/meta-boxes-area/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useRef, useEffect } from '@wordpress/element';\nimport { Spinner } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\n/**\n * Render metabox area.\n *\n * @param {Object} props Component props.\n * @param {string} props.location metabox location.\n * @return {Component} The component to be rendered.\n */\nfunction MetaBoxesArea( { location } ) {\n\tconst container = useRef( null );\n\tconst formRef = useRef( null );\n\n\tuseEffect( () => {\n\t\tformRef.current = document.querySelector(\n\t\t\t'.metabox-location-' + location\n\t\t);\n\n\t\tif ( formRef.current ) {\n\t\t\tcontainer.current.appendChild( formRef.current );\n\t\t}\n\n\t\treturn () => {\n\t\t\tif ( formRef.current ) {\n\t\t\t\tdocument\n\t\t\t\t\t.querySelector( '#metaboxes' )\n\t\t\t\t\t.appendChild( formRef.current );\n\t\t\t}\n\t\t};\n\t}, [ location ] );\n\n\tconst isSaving = useSelect( ( select ) => {\n\t\treturn select( editPostStore ).isSavingMetaBoxes();\n\t}, [] );\n\n\tconst classes = clsx( 'edit-post-meta-boxes-area', `is-${ location }`, {\n\t\t'is-loading': isSaving,\n\t} );\n\n\treturn (\n\t\t<div className={ classes }>\n\t\t\t{ isSaving && <Spinner /> }\n\t\t\t<div\n\t\t\t\tclassName=\"edit-post-meta-boxes-area__container\"\n\t\t\t\tref={ container }\n\t\t\t/>\n\t\t\t<div className=\"edit-post-meta-boxes-area__clear\" />\n\t\t</div>\n\t);\n}\n\nexport default MetaBoxesArea;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,MAAM,EAAEC,SAAS,QAAQ,oBAAoB;AACtD,SAASC,OAAO,QAAQ,uBAAuB;AAC/C,SAASC,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SAASC,KAAK,IAAIC,aAAa,QAAQ,gBAAgB;;AAEvD;AACA;AACA;AACA;AACA;AACA;AACA;AANA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAOA,SAASC,aAAaA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACtC,MAAMC,SAAS,GAAGZ,MAAM,CAAE,IAAK,CAAC;EAChC,MAAMa,OAAO,GAAGb,MAAM,CAAE,IAAK,CAAC;EAE9BC,SAAS,CAAE,MAAM;IAChBY,OAAO,CAACC,OAAO,GAAGC,QAAQ,CAACC,aAAa,CACvC,oBAAoB,GAAGL,QACxB,CAAC;IAED,IAAKE,OAAO,CAACC,OAAO,EAAG;MACtBF,SAAS,CAACE,OAAO,CAACG,WAAW,CAAEJ,OAAO,CAACC,OAAQ,CAAC;IACjD;IAEA,OAAO,MAAM;MACZ,IAAKD,OAAO,CAACC,OAAO,EAAG;QACtBC,QAAQ,CACNC,aAAa,CAAE,YAAa,CAAC,CAC7BC,WAAW,CAAEJ,OAAO,CAACC,OAAQ,CAAC;MACjC;IACD,CAAC;EACF,CAAC,EAAE,CAAEH,QAAQ,CAAG,CAAC;EAEjB,MAAMO,QAAQ,GAAGf,SAAS,CAAIgB,MAAM,IAAM;IACzC,OAAOA,MAAM,CAAEd,aAAc,CAAC,CAACe,iBAAiB,CAAC,CAAC;EACnD,CAAC,EAAE,EAAG,CAAC;EAEP,MAAMC,OAAO,GAAGtB,IAAI,CAAE,2BAA2B,EAAG,MAAMY,QAAU,EAAC,EAAE;IACtE,YAAY,EAAEO;EACf,CAAE,CAAC;EAEH,oBACCT,KAAA;IAAKa,SAAS,EAAGD,OAAS;IAAAE,QAAA,GACvBL,QAAQ,iBAAIX,IAAA,CAACL,OAAO,IAAE,CAAC,eACzBK,IAAA;MACCe,SAAS,EAAC,sCAAsC;MAChDE,GAAG,EAAGZ;IAAW,CACjB,CAAC,eACFL,IAAA;MAAKe,SAAS,EAAC;IAAkC,CAAE,CAAC;EAAA,CAChD,CAAC;AAER;AAEA,eAAeZ,aAAa","ignoreList":[]}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { __ } from '@wordpress/i18n';
5
+ import { useViewportMatch } from '@wordpress/compose';
6
+ import { privateApis as editorPrivateApis } from '@wordpress/editor';
7
+ import { PreferenceToggleMenuItem } from '@wordpress/preferences';
8
+ import { displayShortcut } from '@wordpress/keycodes';
9
+
10
+ /**
11
+ * Internal dependencies
12
+ */
13
+ import { unlock } from '../../lock-unlock';
14
+ import ManagePatternsMenuItem from './manage-patterns-menu-item';
15
+ import WelcomeGuideMenuItem from './welcome-guide-menu-item';
16
+ import EditPostPreferencesModal from '../preferences-modal';
17
+ import { jsx as _jsx } from "react/jsx-runtime";
18
+ import { jsxs as _jsxs } from "react/jsx-runtime";
19
+ import { Fragment as _Fragment } from "react/jsx-runtime";
20
+ const {
21
+ ToolsMoreMenuGroup,
22
+ ViewMoreMenuGroup
23
+ } = unlock(editorPrivateApis);
24
+ const MoreMenu = () => {
25
+ const isLargeViewport = useViewportMatch('large');
26
+ return /*#__PURE__*/_jsxs(_Fragment, {
27
+ children: [isLargeViewport && /*#__PURE__*/_jsx(ViewMoreMenuGroup, {
28
+ children: /*#__PURE__*/_jsx(PreferenceToggleMenuItem, {
29
+ scope: "core/edit-post",
30
+ name: "fullscreenMode",
31
+ label: __('Fullscreen mode'),
32
+ info: __('Show and hide the admin user interface'),
33
+ messageActivated: __('Fullscreen mode activated'),
34
+ messageDeactivated: __('Fullscreen mode deactivated'),
35
+ shortcut: displayShortcut.secondary('f')
36
+ })
37
+ }), /*#__PURE__*/_jsxs(ToolsMoreMenuGroup, {
38
+ children: [/*#__PURE__*/_jsx(ManagePatternsMenuItem, {}), /*#__PURE__*/_jsx(WelcomeGuideMenuItem, {})]
39
+ }), /*#__PURE__*/_jsx(EditPostPreferencesModal, {})]
40
+ });
41
+ };
42
+ export default MoreMenu;
43
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["__","useViewportMatch","privateApis","editorPrivateApis","PreferenceToggleMenuItem","displayShortcut","unlock","ManagePatternsMenuItem","WelcomeGuideMenuItem","EditPostPreferencesModal","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","ToolsMoreMenuGroup","ViewMoreMenuGroup","MoreMenu","isLargeViewport","children","scope","name","label","info","messageActivated","messageDeactivated","shortcut","secondary"],"sources":["@wordpress/edit-post/src/components/more-menu/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { PreferenceToggleMenuItem } from '@wordpress/preferences';\nimport { displayShortcut } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport ManagePatternsMenuItem from './manage-patterns-menu-item';\nimport WelcomeGuideMenuItem from './welcome-guide-menu-item';\nimport EditPostPreferencesModal from '../preferences-modal';\n\nconst { ToolsMoreMenuGroup, ViewMoreMenuGroup } = unlock( editorPrivateApis );\n\nconst MoreMenu = () => {\n\tconst isLargeViewport = useViewportMatch( 'large' );\n\n\treturn (\n\t\t<>\n\t\t\t{ isLargeViewport && (\n\t\t\t\t<ViewMoreMenuGroup>\n\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\tscope=\"core/edit-post\"\n\t\t\t\t\t\tname=\"fullscreenMode\"\n\t\t\t\t\t\tlabel={ __( 'Fullscreen mode' ) }\n\t\t\t\t\t\tinfo={ __( 'Show and hide the admin user interface' ) }\n\t\t\t\t\t\tmessageActivated={ __( 'Fullscreen mode activated' ) }\n\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t'Fullscreen mode deactivated'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tshortcut={ displayShortcut.secondary( 'f' ) }\n\t\t\t\t\t/>\n\t\t\t\t</ViewMoreMenuGroup>\n\t\t\t) }\n\t\t\t<ToolsMoreMenuGroup>\n\t\t\t\t<ManagePatternsMenuItem />\n\t\t\t\t<WelcomeGuideMenuItem />\n\t\t\t</ToolsMoreMenuGroup>\n\t\t\t<EditPostPreferencesModal />\n\t\t</>\n\t);\n};\n\nexport default MoreMenu;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;AACpE,SAASC,wBAAwB,QAAQ,wBAAwB;AACjE,SAASC,eAAe,QAAQ,qBAAqB;;AAErD;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,OAAOC,sBAAsB,MAAM,6BAA6B;AAChE,OAAOC,oBAAoB,MAAM,2BAA2B;AAC5D,OAAOC,wBAAwB,MAAM,sBAAsB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAE5D,MAAM;EAAEC,kBAAkB;EAAEC;AAAkB,CAAC,GAAGX,MAAM,CAAEH,iBAAkB,CAAC;AAE7E,MAAMe,QAAQ,GAAGA,CAAA,KAAM;EACtB,MAAMC,eAAe,GAAGlB,gBAAgB,CAAE,OAAQ,CAAC;EAEnD,oBACCY,KAAA,CAAAE,SAAA;IAAAK,QAAA,GACGD,eAAe,iBAChBR,IAAA,CAACM,iBAAiB;MAAAG,QAAA,eACjBT,IAAA,CAACP,wBAAwB;QACxBiB,KAAK,EAAC,gBAAgB;QACtBC,IAAI,EAAC,gBAAgB;QACrBC,KAAK,EAAGvB,EAAE,CAAE,iBAAkB,CAAG;QACjCwB,IAAI,EAAGxB,EAAE,CAAE,wCAAyC,CAAG;QACvDyB,gBAAgB,EAAGzB,EAAE,CAAE,2BAA4B,CAAG;QACtD0B,kBAAkB,EAAG1B,EAAE,CACtB,6BACD,CAAG;QACH2B,QAAQ,EAAGtB,eAAe,CAACuB,SAAS,CAAE,GAAI;MAAG,CAC7C;IAAC,CACgB,CACnB,eACDf,KAAA,CAACG,kBAAkB;MAAAI,QAAA,gBAClBT,IAAA,CAACJ,sBAAsB,IAAE,CAAC,eAC1BI,IAAA,CAACH,oBAAoB,IAAE,CAAC;IAAA,CACL,CAAC,eACrBG,IAAA,CAACF,wBAAwB,IAAE,CAAC;EAAA,CAC3B,CAAC;AAEL,CAAC;AAED,eAAeS,QAAQ","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- import { createElement } from "react";
2
1
  /**
3
2
  * WordPress dependencies
4
3
  */
@@ -7,6 +6,7 @@ import { store as coreStore } from '@wordpress/core-data';
7
6
  import { useSelect } from '@wordpress/data';
8
7
  import { __ } from '@wordpress/i18n';
9
8
  import { addQueryArgs } from '@wordpress/url';
9
+ import { jsx as _jsx } from "react/jsx-runtime";
10
10
  function ManagePatternsMenuItem() {
11
11
  const url = useSelect(select => {
12
12
  const {
@@ -24,10 +24,11 @@ function ManagePatternsMenuItem() {
24
24
  // display the manage patterns link if the user can't access it.
25
25
  return canUser('create', 'templates') ? patternsUrl : defaultUrl;
26
26
  }, []);
27
- return createElement(MenuItem, {
27
+ return /*#__PURE__*/_jsx(MenuItem, {
28
28
  role: "menuitem",
29
- href: url
30
- }, __('Manage patterns'));
29
+ href: url,
30
+ children: __('Manage patterns')
31
+ });
31
32
  }
32
33
  export default ManagePatternsMenuItem;
33
34
  //# sourceMappingURL=manage-patterns-menu-item.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["MenuItem","store","coreStore","useSelect","__","addQueryArgs","jsx","_jsx","ManagePatternsMenuItem","url","select","canUser","defaultUrl","post_type","patternsUrl","path","role","href","children"],"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":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,uBAAuB;AAChD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,YAAY,QAAQ,gBAAgB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE9C,SAASC,sBAAsBA,CAAA,EAAG;EACjC,MAAMC,GAAG,GAAGN,SAAS,CAAIO,MAAM,IAAM;IACpC,MAAM;MAAEC;IAAQ,CAAC,GAAGD,MAAM,CAAER,SAAU,CAAC;IACvC,MAAMU,UAAU,GAAGP,YAAY,CAAE,UAAU,EAAE;MAC5CQ,SAAS,EAAE;IACZ,CAAE,CAAC;IACH,MAAMC,WAAW,GAAGT,YAAY,CAAE,iBAAiB,EAAE;MACpDU,IAAI,EAAE;IACP,CAAE,CAAC;;IAEH;IACA;IACA;IACA,OAAOJ,OAAO,CAAE,QAAQ,EAAE,WAAY,CAAC,GAAGG,WAAW,GAAGF,UAAU;EACnE,CAAC,EAAE,EAAG,CAAC;EAEP,oBACCL,IAAA,CAACP,QAAQ;IAACgB,IAAI,EAAC,UAAU;IAACC,IAAI,EAAGR,GAAK;IAAAS,QAAA,EACnCd,EAAE,CAAE,iBAAkB;EAAC,CAChB,CAAC;AAEb;AAEA,eAAeI,sBAAsB","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- import { createElement } from "react";
2
1
  /**
3
2
  * WordPress dependencies
4
3
  */
@@ -6,9 +5,10 @@ import { useSelect } from '@wordpress/data';
6
5
  import { PreferenceToggleMenuItem } from '@wordpress/preferences';
7
6
  import { __ } from '@wordpress/i18n';
8
7
  import { store as editorStore } from '@wordpress/editor';
8
+ import { jsx as _jsx } from "react/jsx-runtime";
9
9
  export default function WelcomeGuideMenuItem() {
10
10
  const isEditingTemplate = useSelect(select => select(editorStore).getCurrentPostType() === 'wp_template', []);
11
- return createElement(PreferenceToggleMenuItem, {
11
+ return /*#__PURE__*/_jsx(PreferenceToggleMenuItem, {
12
12
  scope: "core/edit-post",
13
13
  name: isEditingTemplate ? 'welcomeGuideTemplate' : 'welcomeGuide',
14
14
  label: __('Welcome Guide')
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useSelect","PreferenceToggleMenuItem","__","store","editorStore","jsx","_jsx","WelcomeGuideMenuItem","isEditingTemplate","select","getCurrentPostType","scope","name","label"],"sources":["@wordpress/edit-post/src/components/more-menu/welcome-guide-menu-item.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { PreferenceToggleMenuItem } from '@wordpress/preferences';\nimport { __ } from '@wordpress/i18n';\nimport { store as editorStore } from '@wordpress/editor';\n\nexport default function WelcomeGuideMenuItem() {\n\tconst isEditingTemplate = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).getCurrentPostType() === 'wp_template',\n\t\t[]\n\t);\n\n\treturn (\n\t\t<PreferenceToggleMenuItem\n\t\t\tscope=\"core/edit-post\"\n\t\t\tname={ isEditingTemplate ? 'welcomeGuideTemplate' : 'welcomeGuide' }\n\t\t\tlabel={ __( 'Welcome Guide' ) }\n\t\t/>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,wBAAwB,QAAQ,wBAAwB;AACjE,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEzD,eAAe,SAASC,oBAAoBA,CAAA,EAAG;EAC9C,MAAMC,iBAAiB,GAAGR,SAAS,CAChCS,MAAM,IACPA,MAAM,CAAEL,WAAY,CAAC,CAACM,kBAAkB,CAAC,CAAC,KAAK,aAAa,EAC7D,EACD,CAAC;EAED,oBACCJ,IAAA,CAACL,wBAAwB;IACxBU,KAAK,EAAC,gBAAgB;IACtBC,IAAI,EAAGJ,iBAAiB,GAAG,sBAAsB,GAAG,cAAgB;IACpEK,KAAK,EAAGX,EAAE,CAAE,eAAgB;EAAG,CAC/B,CAAC;AAEJ","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- import { createElement, Fragment } from "react";
2
1
  /**
3
2
  * WordPress dependencies
4
3
  */
@@ -14,6 +13,9 @@ import { getPathAndQueryString } from '@wordpress/url';
14
13
  * Internal dependencies
15
14
  */
16
15
  import { unlock } from '../../lock-unlock';
16
+ import { jsx as _jsx } from "react/jsx-runtime";
17
+ import { Fragment as _Fragment } from "react/jsx-runtime";
18
+ import { jsxs as _jsxs } from "react/jsx-runtime";
17
19
  const {
18
20
  PreferenceBaseOption
19
21
  } = unlock(preferencesPrivateApis);
@@ -28,31 +30,36 @@ export function CustomFieldsConfirmation({
28
30
  willEnable
29
31
  }) {
30
32
  const [isReloading, setIsReloading] = useState(false);
31
- return createElement(Fragment, null, createElement("p", {
32
- className: "edit-post-preferences-modal__custom-fields-confirmation-message"
33
- }, __('A page reload is required for this change. Make sure your content is saved before reloading.')), createElement(Button, {
34
- className: "edit-post-preferences-modal__custom-fields-confirmation-button",
35
- variant: "secondary",
36
- isBusy: isReloading,
37
- disabled: isReloading,
38
- onClick: () => {
39
- setIsReloading(true);
40
- submitCustomFieldsForm();
41
- }
42
- }, willEnable ? __('Show & Reload Page') : __('Hide & Reload Page')));
33
+ return /*#__PURE__*/_jsxs(_Fragment, {
34
+ children: [/*#__PURE__*/_jsx("p", {
35
+ className: "edit-post-preferences-modal__custom-fields-confirmation-message",
36
+ children: __('A page reload is required for this change. Make sure your content is saved before reloading.')
37
+ }), /*#__PURE__*/_jsx(Button, {
38
+ className: "edit-post-preferences-modal__custom-fields-confirmation-button",
39
+ variant: "secondary",
40
+ isBusy: isReloading,
41
+ disabled: isReloading,
42
+ onClick: () => {
43
+ setIsReloading(true);
44
+ submitCustomFieldsForm();
45
+ },
46
+ children: willEnable ? __('Show & Reload Page') : __('Hide & Reload Page')
47
+ })]
48
+ });
43
49
  }
44
50
  export function EnableCustomFieldsOption({
45
51
  label,
46
52
  areCustomFieldsEnabled
47
53
  }) {
48
54
  const [isChecked, setIsChecked] = useState(areCustomFieldsEnabled);
49
- return createElement(PreferenceBaseOption, {
55
+ return /*#__PURE__*/_jsx(PreferenceBaseOption, {
50
56
  label: label,
51
57
  isChecked: isChecked,
52
- onChange: setIsChecked
53
- }, isChecked !== areCustomFieldsEnabled && createElement(CustomFieldsConfirmation, {
54
- willEnable: isChecked
55
- }));
58
+ onChange: setIsChecked,
59
+ children: isChecked !== areCustomFieldsEnabled && /*#__PURE__*/_jsx(CustomFieldsConfirmation, {
60
+ willEnable: isChecked
61
+ })
62
+ });
56
63
  }
57
64
  export default withSelect(select => ({
58
65
  areCustomFieldsEnabled: !!select(editorStore).getEditorSettings().enableCustomFields
@@ -1 +1 @@
1
- {"version":3,"names":["useState","__","Button","withSelect","store","editorStore","privateApis","preferencesPrivateApis","getPathAndQueryString","unlock","PreferenceBaseOption","submitCustomFieldsForm","customFieldsForm","document","getElementById","querySelector","setAttribute","window","location","href","submit","CustomFieldsConfirmation","willEnable","isReloading","setIsReloading","createElement","Fragment","className","variant","isBusy","disabled","onClick","EnableCustomFieldsOption","label","areCustomFieldsEnabled","isChecked","setIsChecked","onChange","select","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\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":";AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,UAAU,QAAQ,iBAAiB;AAC5C,SAASC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,wBAAwB;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uB,KAAK,EAAGA,KAAO;IACfE,SAAS,EAAGA,SAAW;IACvBE,QAAQ,EAAGD;EAAc,GAEvBD,SAAS,KAAKD,sBAAsB,IACrCT,aAAA,CAACJ,wBAAwB;IAACC,UAAU,EAAGa;EAAW,CAAE,CAEhC,CAAC;AAEzB;AAEA,eAAehC,UAAU,CAAImC,MAAM,KAAQ;EAC1CJ,sBAAsB,EACrB,CAAC,CAAEI,MAAM,CAAEjC,WAAY,CAAC,CAACkC,iBAAiB,CAAC,CAAC,CAACC;AAC/C,CAAC,CAAG,CAAC,CAAER,wBAAyB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["useState","__","Button","withSelect","store","editorStore","privateApis","preferencesPrivateApis","getPathAndQueryString","unlock","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","PreferenceBaseOption","submitCustomFieldsForm","customFieldsForm","document","getElementById","querySelector","setAttribute","window","location","href","submit","CustomFieldsConfirmation","willEnable","isReloading","setIsReloading","children","className","variant","isBusy","disabled","onClick","EnableCustomFieldsOption","label","areCustomFieldsEnabled","isChecked","setIsChecked","onChange","select","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\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":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,UAAU,QAAQ,iBAAiB;A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A,EAAE,CAAE,oBAAqB;IAAC,CACtB,CAAC;EAAA,CACR,CAAC;AAEL;AAEA,OAAO,SAASoC,wBAAwBA,CAAE;EAAEC,KAAK;EAAEC;AAAuB,CAAC,EAAG;EAC7E,MAAM,CAAEC,SAAS,EAAEC,YAAY,CAAE,GAAGzC,QAAQ,CAAEuC,sBAAuB,CAAC;EAEtE,oBACC5B,IAAA,CAACK,oBAAoB;IACpBsB,KAAK,EAAGA,KAAO;IACfE,SAAS,EAAGA,SAAW;IACvBE,QAAQ,EAAGD,YAAc;IAAAV,QAAA,EAEvBS,SAAS,KAAKD,sBAAsB,iBACrC5B,IAAA,CAACgB,wBAAwB;MAACC,UAAU,EAAGY;IAAW,CAAE;EACpD,CACoB,CAAC;AAEzB;AAEA,eAAerC,UAAU,CAAIwC,MAAM,KAAQ;EAC1CJ,sBAAsB,EACrB,CAAC,CAAEI,MAAM,CAAEtC,WAAY,CAAC,CAACuC,iBAAiB,CAAC,CAAC,CAACC;AAC/C,CAAC,CAAG,CAAC,CAAER,wBAAyB,CAAC","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- import { createElement } from "react";
2
1
  /**
3
2
  * WordPress dependencies
4
3
  */
@@ -12,6 +11,7 @@ import { privateApis as editorPrivateApis } from '@wordpress/editor';
12
11
  */
13
12
  import { unlock } from '../../lock-unlock';
14
13
  import MetaBoxesSection from './meta-boxes-section';
14
+ import { jsx as _jsx } from "react/jsx-runtime";
15
15
  const {
16
16
  PreferenceToggleControl
17
17
  } = unlock(preferencesPrivateApis);
@@ -20,17 +20,17 @@ const {
20
20
  } = unlock(editorPrivateApis);
21
21
  export default function EditPostPreferencesModal() {
22
22
  const extraSections = {
23
- general: createElement(MetaBoxesSection, {
23
+ general: /*#__PURE__*/_jsx(MetaBoxesSection, {
24
24
  title: __('Advanced')
25
25
  }),
26
- appearance: createElement(PreferenceToggleControl, {
26
+ appearance: /*#__PURE__*/_jsx(PreferenceToggleControl, {
27
27
  scope: "core/edit-post",
28
28
  featureName: "themeStyles",
29
29
  help: __('Make the editor look like your theme.'),
30
30
  label: __('Use theme styles')
31
31
  })
32
32
  };
33
- return createElement(PreferencesModal, {
33
+ return /*#__PURE__*/_jsx(PreferencesModal, {
34
34
  extraSections: extraSections
35
35
  });
36
36
  }
@@ -1 +1 @@
1
- {"version":3,"names":["__","privateApis","preferencesPrivateApis","editorPrivateApis","unlock","MetaBoxesSection","PreferenceToggleControl","PreferencesModal","EditPostPreferencesModal","extraSections","general","createElement","title","appearance","scope","featureName","help","label"],"sources":["@wordpress/edit-post/src/components/preferences-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\n\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as preferencesPrivateApis } from '@wordpress/preferences';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport MetaBoxesSection from './meta-boxes-section';\n\nconst { PreferenceToggleControl } = unlock( preferencesPrivateApis );\nconst { PreferencesModal } = unlock( editorPrivateApis );\n\nexport default function EditPostPreferencesModal() {\n\tconst extraSections = {\n\t\tgeneral: <MetaBoxesSection title={ __( 'Advanced' ) } />,\n\t\tappearance: (\n\t\t\t<PreferenceToggleControl\n\t\t\t\tscope=\"core/edit-post\"\n\t\t\t\tfeatureName=\"themeStyles\"\n\t\t\t\thelp={ __( 'Make the editor look like your theme.' ) }\n\t\t\t\tlabel={ __( 'Use theme styles' ) }\n\t\t\t/>\n\t\t),\n\t};\n\n\treturn <PreferencesModal extraSections={ extraSections } />;\n}\n"],"mappings":";AAAA;AACA;AACA;;AAEA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,wBAAwB;AAC9E,SAASD,WAAW,IAAIE,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,OAAOC,gBAAgB,MAAM,sBAAsB;AAEnD,MAAM;EAAEC;AAAwB,CAAC,GAAGF,MAAM,CAAEF,sBAAuB,CAAC;AACpE,MAAM;EAAEK;AAAiB,CAAC,GAAGH,MAAM,CAAED,iBAAkB,CAAC;AAExD,eAAe,SAASK,wBAAwBA,CAAA,EAAG;EAClD,MAAMC,aAAa,GAAG;IACrBC,OAAO,EAAEC,aAAA,CAACN,gBAAgB;MAACO,KAAK,EAAGZ,EAAE,CAAE,UAAW;IAAG,CAAE,CAAC;IACxDa,UAAU,EACTF,aAAA,CAACL,uBAAuB;MACvBQ,KAAK,EAAC,gBAAgB;MACtBC,WAAW,EAAC,aAAa;MACzBC,IAAI,EAAGhB,EAAE,CAAE,uCAAwC,CAAG;MACtDiB,KAAK,EAAGjB,EAAE,CAAE,kBAAmB;IAAG,CAClC;EAEH,CAAC;EAED,OAAOW,aAAA,CAACJ,gBAAgB;IAACE,aAAa,EAAGA;EAAe,CAAE,CAAC;AAC5D","ignoreList":[]}
1
+ {"version":3,"names":["__","privateApis","preferencesPrivateApis","editorPrivateApis","unlock","MetaBoxesSection","jsx","_jsx","PreferenceToggleControl","PreferencesModal","EditPostPreferencesModal","extraSections","general","title","appearance","scope","featureName","help","label"],"sources":["@wordpress/edit-post/src/components/preferences-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\n\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as preferencesPrivateApis } from '@wordpress/preferences';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport MetaBoxesSection from './meta-boxes-section';\n\nconst { PreferenceToggleControl } = unlock( preferencesPrivateApis );\nconst { PreferencesModal } = unlock( editorPrivateApis );\n\nexport default function EditPostPreferencesModal() {\n\tconst extraSections = {\n\t\tgeneral: <MetaBoxesSection title={ __( 'Advanced' ) } />,\n\t\tappearance: (\n\t\t\t<PreferenceToggleControl\n\t\t\t\tscope=\"core/edit-post\"\n\t\t\t\tfeatureName=\"themeStyles\"\n\t\t\t\thelp={ __( 'Make the editor look like your theme.' ) }\n\t\t\t\tlabel={ __( 'Use theme styles' ) }\n\t\t\t/>\n\t\t),\n\t};\n\n\treturn <PreferencesModal extraSections={ extraSections } />;\n}\n"],"mappings":"AAAA;AACA;AACA;;AAEA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,wBAAwB;AAC9E,SAASD,WAAW,IAAIE,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,OAAOC,gBAAgB,MAAM,sBAAsB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEpD,MAAM;EAAEC;AAAwB,CAAC,GAAGJ,MAAM,CAAEF,sBAAuB,CAAC;AACpE,MAAM;EAAEO;AAAiB,CAAC,GAAGL,MAAM,CAAED,iBAAkB,CAAC;AAExD,eAAe,SAASO,wBAAwBA,CAAA,EAAG;EAClD,MAAMC,aAAa,GAAG;IACrBC,OAAO,eAAEL,IAAA,CAACF,gBAAgB;MAACQ,KAAK,EAAGb,EAAE,CAAE,UAAW;IAAG,CAAE,CAAC;IACxDc,UAAU,eACTP,IAAA,CAACC,uBAAuB;MACvBO,KAAK,EAAC,gBAAgB;MACtBC,WAAW,EAAC,aAAa;MACzBC,IAAI,EAAGjB,EAAE,CAAE,uCAAwC,CAAG;MACtDkB,KAAK,EAAGlB,EAAE,CAAE,kBAAmB;IAAG,CAClC;EAEH,CAAC;EAED,oBAAOO,IAAA,CAACE,gBAAgB;IAACE,aAAa,EAAGA;EAAe,CAAE,CAAC;AAC5D","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- import { createElement } from "react";
2
1
  /**
3
2
  * WordPress dependencies
4
3
  */
@@ -14,6 +13,8 @@ import EnableCustomFieldsOption from './enable-custom-fields';
14
13
  import EnablePanelOption from './enable-panel';
15
14
  import { store as editPostStore } from '../../store';
16
15
  import { unlock } from '../../lock-unlock';
16
+ import { jsx as _jsx } from "react/jsx-runtime";
17
+ import { jsxs as _jsxs } from "react/jsx-runtime";
17
18
  const {
18
19
  PreferencesModalSection
19
20
  } = unlock(preferencesPrivateApis);
@@ -29,18 +30,18 @@ export function MetaBoxesSection({
29
30
  if (!areCustomFieldsRegistered && thirdPartyMetaBoxes.length === 0) {
30
31
  return null;
31
32
  }
32
- return createElement(PreferencesModalSection, {
33
- ...sectionProps
34
- }, areCustomFieldsRegistered && createElement(EnableCustomFieldsOption, {
35
- label: __('Custom fields')
36
- }), thirdPartyMetaBoxes.map(({
37
- id,
38
- title
39
- }) => createElement(EnablePanelOption, {
40
- key: id,
41
- label: title,
42
- panelName: `meta-box-${id}`
43
- })));
33
+ return /*#__PURE__*/_jsxs(PreferencesModalSection, {
34
+ ...sectionProps,
35
+ children: [areCustomFieldsRegistered && /*#__PURE__*/_jsx(EnableCustomFieldsOption, {
36
+ label: __('Custom fields')
37
+ }), thirdPartyMetaBoxes.map(({
38
+ id,
39
+ title
40
+ }) => /*#__PURE__*/_jsx(EnablePanelOption, {
41
+ label: title,
42
+ panelName: `meta-box-${id}`
43
+ }, id))]
44
+ });
44
45
  }
45
46
  export default withSelect(select => {
46
47
  const {
@@ -1 +1 @@
1
- {"version":3,"names":["__","withSelect","store","editorStore","privateApis","preferencesPrivateApis","EnableCustomFieldsOption","EnablePanelOption","editPostStore","unlock","PreferencesModalSection","MetaBoxesSection","areCustomFieldsRegistered","metaBoxes","sectionProps","thirdPartyMetaBoxes","filter","id","length","createElement","label","map","title","key","panelName","select","getEditorSettings","getAllMetaBoxes","enableCustomFields","undefined"],"sources":["@wordpress/edit-post/src/components/preferences-modal/meta-boxes-section.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { withSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { privateApis as preferencesPrivateApis } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport EnableCustomFieldsOption from './enable-custom-fields';\nimport EnablePanelOption from './enable-panel';\nimport { store as editPostStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { PreferencesModalSection } = unlock( preferencesPrivateApis );\n\nexport function MetaBoxesSection( {\n\tareCustomFieldsRegistered,\n\tmetaBoxes,\n\t...sectionProps\n} ) {\n\t// The 'Custom Fields' meta box is a special case that we handle separately.\n\tconst thirdPartyMetaBoxes = metaBoxes.filter(\n\t\t( { id } ) => id !== 'postcustom'\n\t);\n\n\tif ( ! areCustomFieldsRegistered && thirdPartyMetaBoxes.length === 0 ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PreferencesModalSection { ...sectionProps }>\n\t\t\t{ areCustomFieldsRegistered && (\n\t\t\t\t<EnableCustomFieldsOption label={ __( 'Custom fields' ) } />\n\t\t\t) }\n\t\t\t{ thirdPartyMetaBoxes.map( ( { id, title } ) => (\n\t\t\t\t<EnablePanelOption\n\t\t\t\t\tkey={ id }\n\t\t\t\t\tlabel={ title }\n\t\t\t\t\tpanelName={ `meta-box-${ id }` }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</PreferencesModalSection>\n\t);\n}\n\nexport default withSelect( ( select ) => {\n\tconst { getEditorSettings } = select( editorStore );\n\tconst { getAllMetaBoxes } = select( editPostStore );\n\n\treturn {\n\t\t// This setting should not live in the block editor's store.\n\t\tareCustomFieldsRegistered:\n\t\t\tgetEditorSettings().enableCustomFields !== undefined,\n\t\tmetaBoxes: getAllMetaBoxes(),\n\t};\n} )( MetaBoxesSection );\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,UAAU,QAAQ,iBAAiB;AAC5C,SAASC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,wBAAwB;;AAE9E;AACA;AACA;AACA,OAAOC,wBAAwB,MAAM,wBAAwB;AAC7D,OAAOC,iBAAiB,MAAM,gBAAgB;AAC9C,SAASL,KAAK,IAAIM,aAAa,QAAQ,aAAa;AACpD,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,MAAM;EAAEC;AAAwB,CAAC,GAAGD,MAAM,CAAEJ,sBAAuB,CAAC;AAEpE,OAAO,SAASM,gBAAgBA,CAAE;EACjCC,yBAAyB;EACzBC,SAAS;EACT,GAAGC;AACJ,CAAC,EAAG;EACH;EACA,MAAMC,mBAAmB,GAAGF,SAAS,CAACG,MAAM,CAC3C,CAAE;IAAEC;EAAG,CAAC,KAAMA,EAAE,KAAK,YACtB,CAAC;EAED,IAAK,CAAEL,yBAAyB,IAAIG,mBAAmB,CAACG,MAAM,KAAK,CAAC,EAAG;IACtE,OAAO,IAAI;EACZ;EAEA,OACCC,aAAA,CAACT,uBAAuB;IAAA,GAAMI;EAAY,GACvCF,yBAAyB,IAC1BO,aAAA,CAACb,wBAAwB;IAACc,KAAK,EAAGpB,EAAE,CAAE,eAAgB;EAAG,CAAE,CAC3D,EACCe,mBAAmB,CAACM,GAAG,CAAE,CAAE;IAAEJ,EAAE;IAAEK;EAAM,CAAC,KACzCH,aAAA,CAACZ,iBAAiB;IACjBgB,GAAG,EAAGN,EAAI;IACVG,KAAK,EAAGE,KAAO;IACfE,SAAS,EAAI,YAAYP,EAAI;EAAG,CAChC,CACA,CACsB,CAAC;AAE5B;AAEA,eAAehB,UAAU,CAAIwB,MAAM,IAAM;EACxC,MAAM;IAAEC;EAAkB,CAAC,GAAGD,MAAM,CAAEtB,WAAY,CAAC;EACnD,MAAM;IAAEwB;EAAgB,CAAC,GAAGF,MAAM,CAAEjB,aAAc,CAAC;EAEnD,OAAO;IACN;IACAI,yBAAyB,EACxBc,iBAAiB,CAAC,CAAC,CAACE,kBAAkB,KAAKC,SAAS;IACrDhB,SAAS,EAAEc,eAAe,CAAC;EAC5B,CAAC;AACF,CAAE,CAAC,CAAEhB,gBAAiB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["__","withSelect","store","editorStore","privateApis","preferencesPrivateApis","EnableCustomFieldsOption","EnablePanelOption","editPostStore","unlock","jsx","_jsx","jsxs","_jsxs","PreferencesModalSection","MetaBoxesSection","areCustomFieldsRegistered","metaBoxes","sectionProps","thirdPartyMetaBoxes","filter","id","length","children","label","map","title","panelName","select","getEditorSettings","getAllMetaBoxes","enableCustomFields","undefined"],"sources":["@wordpress/edit-post/src/components/preferences-modal/meta-boxes-section.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { withSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { privateApis as preferencesPrivateApis } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport EnableCustomFieldsOption from './enable-custom-fields';\nimport EnablePanelOption from './enable-panel';\nimport { store as editPostStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { PreferencesModalSection } = unlock( preferencesPrivateApis );\n\nexport function MetaBoxesSection( {\n\tareCustomFieldsRegistered,\n\tmetaBoxes,\n\t...sectionProps\n} ) {\n\t// The 'Custom Fields' meta box is a special case that we handle separately.\n\tconst thirdPartyMetaBoxes = metaBoxes.filter(\n\t\t( { id } ) => id !== 'postcustom'\n\t);\n\n\tif ( ! areCustomFieldsRegistered && thirdPartyMetaBoxes.length === 0 ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PreferencesModalSection { ...sectionProps }>\n\t\t\t{ areCustomFieldsRegistered && (\n\t\t\t\t<EnableCustomFieldsOption label={ __( 'Custom fields' ) } />\n\t\t\t) }\n\t\t\t{ thirdPartyMetaBoxes.map( ( { id, title } ) => (\n\t\t\t\t<EnablePanelOption\n\t\t\t\t\tkey={ id }\n\t\t\t\t\tlabel={ title }\n\t\t\t\t\tpanelName={ `meta-box-${ id }` }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</PreferencesModalSection>\n\t);\n}\n\nexport default withSelect( ( select ) => {\n\tconst { getEditorSettings } = select( editorStore );\n\tconst { getAllMetaBoxes } = select( editPostStore );\n\n\treturn {\n\t\t// This setting should not live in the block editor's store.\n\t\tareCustomFieldsRegistered:\n\t\t\tgetEditorSettings().enableCustomFields !== undefined,\n\t\tmetaBoxes: getAllMetaBoxes(),\n\t};\n} )( MetaBoxesSection );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,UAAU,QAAQ,iBAAiB;AAC5C,SAASC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,wBAAwB;;AAE9E;AACA;AACA;AACA,OAAOC,wBAAwB,MAAM,wBAAwB;AAC7D,OAAOC,iBAAiB,MAAM,gBAAgB;AAC9C,SAASL,KAAK,IAAIM,aAAa,QAAQ,aAAa;AACpD,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAE3C,MAAM;EAAEC;AAAwB,CAAC,GAAGL,MAAM,CAAEJ,sBAAuB,CAAC;AAEpE,OAAO,SAASU,gBAAgBA,CAAE;EACjCC,yBAAyB;EACzBC,SAAS;EACT,GAAGC;AACJ,CAAC,EAAG;EACH;EACA,MAAMC,mBAAmB,GAAGF,SAAS,CAACG,MAAM,CAC3C,CAAE;IAAEC;EAAG,CAAC,KAAMA,EAAE,KAAK,YACtB,CAAC;EAED,IAAK,CAAEL,yBAAyB,IAAIG,mBAAmB,CAACG,MAAM,KAAK,CAAC,EAAG;IACtE,OAAO,IAAI;EACZ;EAEA,oBACCT,KAAA,CAACC,uBAAuB;IAAA,GAAMI,YAAY;IAAAK,QAAA,GACvCP,yBAAyB,iBAC1BL,IAAA,CAACL,wBAAwB;MAACkB,KAAK,EAAGxB,EAAE,CAAE,eAAgB;IAAG,CAAE,CAC3D,EACCmB,mBAAmB,CAACM,GAAG,CAAE,CAAE;MAAEJ,EAAE;MAAEK;IAAM,CAAC,kBACzCf,IAAA,CAACJ,iBAAiB;MAEjBiB,KAAK,EAAGE,KAAO;MACfC,SAAS,EAAI,YAAYN,EAAI;IAAG,GAF1BA,EAGN,CACA,CAAC;EAAA,CACqB,CAAC;AAE5B;AAEA,eAAepB,UAAU,CAAI2B,MAAM,IAAM;EACxC,MAAM;IAAEC;EAAkB,CAAC,GAAGD,MAAM,CAAEzB,WAAY,CAAC;EACnD,MAAM;IAAE2B;EAAgB,CAAC,GAAGF,MAAM,CAAEpB,aAAc,CAAC;EAEnD,OAAO;IACN;IACAQ,yBAAyB,EACxBa,iBAAiB,CAAC,CAAC,CAACE,kBAAkB,KAAKC,SAAS;IACrDf,SAAS,EAAEa,eAAe,CAAC;EAC5B,CAAC;AACF,CAAE,CAAC,CAAEf,gBAAiB,CAAC","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- import { createElement } from "react";
2
1
  /**
3
2
  * External dependencies
4
3
  */
@@ -13,21 +12,23 @@ import { withDispatch, withSelect } from '@wordpress/data';
13
12
  import { compose, withPreferredColorScheme } from '@wordpress/compose';
14
13
  import { PostTitle } from '@wordpress/editor';
15
14
  import { store as blockEditorStore, useEditorWrapperStyles } from '@wordpress/block-editor';
15
+ import { jsx as _jsx } from "react/jsx-runtime";
16
16
  const Header = memo(function EditorHeader({
17
17
  editTitle,
18
18
  setTitleRef,
19
19
  title
20
20
  }) {
21
21
  const [wrapperStyles] = useEditorWrapperStyles();
22
- return createElement(View, {
23
- style: wrapperStyles
24
- }, createElement(PostTitle, {
25
- innerRef: setTitleRef,
26
- title: title,
27
- onUpdate: editTitle,
28
- placeholder: __('Add title'),
29
- accessibilityLabel: "post-title"
30
- }));
22
+ return /*#__PURE__*/_jsx(View, {
23
+ style: wrapperStyles,
24
+ children: /*#__PURE__*/_jsx(PostTitle, {
25
+ innerRef: setTitleRef,
26
+ title: title,
27
+ onUpdate: editTitle,
28
+ placeholder: __('Add title'),
29
+ accessibilityLabel: "post-title"
30
+ })
31
+ });
31
32
  }, (prevProps, nextProps) => prevProps.title === nextProps.title);
32
33
  export default compose([withSelect(select => {
33
34
  const {
@@ -1 +1 @@
1
- {"version":3,"names":["View","memo","__","withDispatch","withSelect","compose","withPreferredColorScheme","PostTitle","store","blockEditorStore","useEditorWrapperStyles","Header","EditorHeader","editTitle","setTitleRef","title","wrapperStyles","createElement","style","innerRef","onUpdate","placeholder","accessibilityLabel","prevProps","nextProps","select","getEditedPostAttribute","dispatch","editPost","clearSelectedBlock"],"sources":["@wordpress/edit-post/src/components/visual-editor/header.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { memo } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { compose, withPreferredColorScheme } from '@wordpress/compose';\nimport { PostTitle } from '@wordpress/editor';\nimport {\n\tstore as blockEditorStore,\n\tuseEditorWrapperStyles,\n} from '@wordpress/block-editor';\n\nconst Header = memo(\n\tfunction EditorHeader( { editTitle, setTitleRef, title } ) {\n\t\tconst [ wrapperStyles ] = useEditorWrapperStyles();\n\t\treturn (\n\t\t\t<View style={ wrapperStyles }>\n\t\t\t\t<PostTitle\n\t\t\t\t\tinnerRef={ setTitleRef }\n\t\t\t\t\ttitle={ title }\n\t\t\t\t\tonUpdate={ editTitle }\n\t\t\t\t\tplaceholder={ __( 'Add title' ) }\n\t\t\t\t\taccessibilityLabel=\"post-title\"\n\t\t\t\t/>\n\t\t\t</View>\n\t\t);\n\t},\n\t( prevProps, nextProps ) => prevProps.title === nextProps.title\n);\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute } = select( 'core/editor' );\n\n\t\treturn {\n\t\t\ttitle: getEditedPostAttribute( 'title' ),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { editPost } = dispatch( 'core/editor' );\n\n\t\tconst { clearSelectedBlock } = dispatch( blockEditorStore );\n\n\t\treturn {\n\t\t\tclearSelectedBlock,\n\t\t\teditTitle( title ) {\n\t\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Ac,CAAC;EAE9C,MAAM;IAAEE;EAAmB,CAAC,GAAGF,QAAQ,CAAElB,gBAAiB,CAAC;EAE3D,OAAO;IACNoB,kBAAkB;IAClBhB,SAASA,CAAEE,KAAK,EAAG;MAClBa,QAAQ,CAAE;QAAEb;MAAM,CAAE,CAAC;IACtB;EACD,CAAC;AACF,CAAE,CAAC,EACHT,wBAAwB,CACvB,CAAC,CAAEK,MAAO,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["View","memo","__","withDispatch","withSelect","compose","withPreferredColorScheme","PostTitle","store","blockEditorStore","useEditorWrapperStyles","jsx","_jsx","Header","EditorHeader","editTitle","setTitleRef","title","wrapperStyles","style","children","innerRef","onUpdate","placeholder","accessibilityLabel","prevProps","nextProps","select","getEditedPostAttribute","dispatch","editPost","clearSelectedBlock"],"sources":["@wordpress/edit-post/src/components/visual-editor/header.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { memo } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { compose, withPreferredColorScheme } from '@wordpress/compose';\nimport { PostTitle } from '@wordpress/editor';\nimport {\n\tstore as blockEditorStore,\n\tuseEditorWrapperStyles,\n} from '@wordpress/block-editor';\n\nconst Header = memo(\n\tfunction EditorHeader( { editTitle, setTitleRef, title } ) {\n\t\tconst [ wrapperStyles ] = useEditorWrapperStyles();\n\t\treturn (\n\t\t\t<View style={ wrapperStyles }>\n\t\t\t\t<PostTitle\n\t\t\t\t\tinnerRef={ setTitleRef }\n\t\t\t\t\ttitle={ title }\n\t\t\t\t\tonUpdate={ editTitle }\n\t\t\t\t\tplaceholder={ __( 'Add title' ) }\n\t\t\t\t\taccessibilityLabel=\"post-title\"\n\t\t\t\t/>\n\t\t\t</View>\n\t\t);\n\t},\n\t( prevProps, nextProps ) => prevProps.title === nextProps.title\n);\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute } = select( 'core/editor' );\n\n\t\treturn {\n\t\t\ttitle: getEditedPostAttribute( 'title' ),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { editPost } = dispatch( 'core/editor' );\n\n\t\tconst { clearSelectedBlock } = dispatch( blockEditorStore );\n\n\t\treturn {\n\t\t\tclearSelectedBlock,\n\t\t\teditTitle( title ) {\n\t\t\t\teditPost( { title } );\n\t\t\t},\n\t\t};\n\t} ),\n\twithPreferredColorScheme,\n] )( Header );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAI,QAAQ,cAAc;;AAEnC;AACA;AACA;AACA,SAASC,IAAI,QAAQ,oBAAoB;AACzC,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,YAAY,EAAEC,UAAU,QAAQ,iBAAiB;AAC1D,SAASC,OAAO,EAAEC,wBAAwB,QAAQ,oBAAoB;AACtE,SAASC,SAAS,QAAQ,mBAAmB;AAC7C,SACCC,KAAK,IAAIC,gBAAgB,EACzBC,sBAAsB,QAChB,yBAAyB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEjC,MAAMC,MAAM,GAAGZ,IAAI,CAClB,SAASa,YAAYA,CAAE;EAAEC,SAAS;EAAEC,WAAW;EAAEC;AAAM,CAAC,EAAG;EAC1D,MAAM,CAAEC,aAAa,CAAE,GAAGR,sBAAsB,CAAC,CAAC;EAClD,oBACCE,IAAA,CAACZ,IAAI;IAACmB,KAAK,EAAGD,aAAe;IAAAE,QAAA,eAC5BR,IAAA,CAACL,SAAS;MACTc,QAAQ,EAAGL,WAAa;MACxBC,KAAK,EAAGA,KAAO;MACfK,QAAQ,EAAGP,SAAW;MACtBQ,WAAW,EAAGrB,EAAE,CAAE,WAAY,CAAG;MACjCsB,kBAAkB,EAAC;IAAY,CAC/B;EAAC,CACG,CAAC;AAET,CAAC,EACD,CAAEC,SAAS,EAAEC,SAAS,KAAMD,SAAS,CAACR,KAAK,KAAKS,SAAS,CAACT,KAC3D,CAAC;AAED,eAAeZ,OAAO,CAAE,CACvBD,UAAU,CAAIuB,MAAM,IAAM;EACzB,MAAM;IAAEC;EAAuB,CAAC,GAAGD,MAAM,CAAE,aAAc,CAAC;EAE1D,OAAO;IACNV,KAAK,EAAEW,sBAAsB,CAAE,OAAQ;EACxC,CAAC;AACF,CAAE,CAAC,EACHzB,YAAY,CAAI0B,QAAQ,IAAM;EAC7B,MAAM;IAAEC;EAAS,CAAC,GAAGD,QAAQ,CAAE,aAAc,CAAC;EAE9C,MAAM;IAAEE;EAAmB,CAAC,GAAGF,QAAQ,CAAEpB,gBAAiB,CAAC;EAE3D,OAAO;IACNsB,kBAAkB;IAClBhB,SAASA,CAAEE,KAAK,EAAG;MAClBa,QAAQ,CAAE;QAAEb;MAAM,CAAE,CAAC;IACtB;EACD,CAAC;AACF,CAAE,CAAC,EACHX,wBAAwB,CACvB,CAAC,CAAEO,MAAO,CAAC","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- import { createElement } from "react";
2
1
  /**
3
2
  * WordPress dependencies
4
3
  */
@@ -9,6 +8,7 @@ import { BlockList } from '@wordpress/block-editor';
9
8
  * Internal dependencies
10
9
  */
11
10
  import Header from './header';
11
+ import { jsx as _jsx } from "react/jsx-runtime";
12
12
  export default class VisualEditor extends Component {
13
13
  constructor(props) {
14
14
  super(props);
@@ -18,7 +18,7 @@ export default class VisualEditor extends Component {
18
18
  const {
19
19
  setTitleRef
20
20
  } = this.props;
21
- return createElement(Header, {
21
+ return /*#__PURE__*/_jsx(Header, {
22
22
  setTitleRef: setTitleRef
23
23
  });
24
24
  }
@@ -26,7 +26,7 @@ export default class VisualEditor extends Component {
26
26
  const {
27
27
  safeAreaBottomInset
28
28
  } = this.props;
29
- return createElement(BlockList, {
29
+ return /*#__PURE__*/_jsx(BlockList, {
30
30
  header: this.renderHeader,
31
31
  safeAreaBottomInset: safeAreaBottomInset
32
32
  });