@wordpress/edit-post 7.35.0 → 8.0.1

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 (204) 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 +59 -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 +93 -155
  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 +24 -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 +51 -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 +98 -158
  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 +26 -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 +41 -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/init-pattern-modal/index.js +1 -4
  129. package/src/components/layout/index.js +88 -202
  130. package/src/components/layout/style.scss +9 -17
  131. package/src/components/layout/use-should-iframe.js +40 -0
  132. package/src/components/{header/more-menu → more-menu}/index.js +2 -2
  133. package/src/components/preferences-modal/enable-custom-fields.js +1 -0
  134. package/src/index.js +11 -6
  135. package/src/store/selectors.js +8 -5
  136. package/src/style.scss +2 -5
  137. package/src/test/__snapshots__/editor.native.js.snap +72 -0
  138. package/src/test/editor.native.js +77 -0
  139. package/build/components/header/fullscreen-mode-close/index.js.map +0 -1
  140. package/build/components/header/index.js +0 -69
  141. package/build/components/header/index.js.map +0 -1
  142. package/build/components/header/main-dashboard-button/index.js +0 -33
  143. package/build/components/header/main-dashboard-button/index.js.map +0 -1
  144. package/build/components/header/more-menu/index.js +0 -43
  145. package/build/components/header/more-menu/index.js.map +0 -1
  146. package/build/components/header/more-menu/manage-patterns-menu-item.js.map +0 -1
  147. package/build/components/header/more-menu/welcome-guide-menu-item.js.map +0 -1
  148. package/build/components/text-editor/index.js +0 -61
  149. package/build/components/text-editor/index.js.map +0 -1
  150. package/build/components/visual-editor/block-inspector-button.js +0 -55
  151. package/build/components/visual-editor/block-inspector-button.js.map +0 -1
  152. package/build/components/visual-editor/index.js +0 -98
  153. package/build/components/visual-editor/index.js.map +0 -1
  154. package/build/components/visual-editor/use-padding-appender.js.map +0 -1
  155. package/build/hooks/commands/use-common-commands.js +0 -119
  156. package/build/hooks/commands/use-common-commands.js.map +0 -1
  157. package/build/hooks/components/index.js +0 -11
  158. package/build/hooks/components/index.js.map +0 -1
  159. package/build/hooks/index.js +0 -5
  160. package/build/hooks/index.js.map +0 -1
  161. package/build/hooks/validate-multiple-use/index.js +0 -134
  162. package/build/hooks/validate-multiple-use/index.js.map +0 -1
  163. package/build-module/components/header/fullscreen-mode-close/index.js.map +0 -1
  164. package/build-module/components/header/index.js +0 -61
  165. package/build-module/components/header/index.js.map +0 -1
  166. package/build-module/components/header/main-dashboard-button/index.js +0 -26
  167. package/build-module/components/header/main-dashboard-button/index.js.map +0 -1
  168. package/build-module/components/header/more-menu/index.js +0 -35
  169. package/build-module/components/header/more-menu/index.js.map +0 -1
  170. package/build-module/components/header/more-menu/manage-patterns-menu-item.js.map +0 -1
  171. package/build-module/components/header/more-menu/welcome-guide-menu-item.js.map +0 -1
  172. package/build-module/components/text-editor/index.js +0 -54
  173. package/build-module/components/text-editor/index.js.map +0 -1
  174. package/build-module/components/visual-editor/block-inspector-button.js +0 -47
  175. package/build-module/components/visual-editor/block-inspector-button.js.map +0 -1
  176. package/build-module/components/visual-editor/index.js +0 -90
  177. package/build-module/components/visual-editor/index.js.map +0 -1
  178. package/build-module/components/visual-editor/use-padding-appender.js.map +0 -1
  179. package/build-module/hooks/commands/use-common-commands.js +0 -112
  180. package/build-module/hooks/commands/use-common-commands.js.map +0 -1
  181. package/build-module/hooks/components/index.js +0 -8
  182. package/build-module/hooks/components/index.js.map +0 -1
  183. package/build-module/hooks/index.js +0 -6
  184. package/build-module/hooks/index.js.map +0 -1
  185. package/build-module/hooks/validate-multiple-use/index.js +0 -132
  186. package/build-module/hooks/validate-multiple-use/index.js.map +0 -1
  187. package/src/components/header/index.js +0 -53
  188. package/src/components/header/main-dashboard-button/index.js +0 -28
  189. package/src/components/header/style.scss +0 -14
  190. package/src/components/text-editor/index.js +0 -63
  191. package/src/components/text-editor/style.scss +0 -71
  192. package/src/components/visual-editor/block-inspector-button.js +0 -59
  193. package/src/components/visual-editor/index.js +0 -108
  194. package/src/components/visual-editor/style.scss +0 -53
  195. package/src/hooks/commands/use-common-commands.js +0 -126
  196. package/src/hooks/components/index.js +0 -13
  197. package/src/hooks/index.js +0 -5
  198. package/src/hooks/validate-multiple-use/index.js +0 -163
  199. /package/build/components/{visual-editor → layout}/use-padding-appender.js +0 -0
  200. /package/build-module/components/{visual-editor → layout}/use-padding-appender.js +0 -0
  201. /package/src/components/{header/fullscreen-mode-close/test/__snapshots__/index.js.snap → back-button/test/__snapshots__/fullscreen-mode-close.js.snap} +0 -0
  202. /package/src/components/{visual-editor → layout}/use-padding-appender.js +0 -0
  203. /package/src/components/{header/more-menu → more-menu}/manage-patterns-menu-item.js +0 -0
  204. /package/src/components/{header/more-menu → more-menu}/welcome-guide-menu-item.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_reactNativeSafeArea","_interopRequireDefault","_element","_data","_blockEditor","_compose","_components","_editor","_reactNativeBridge","_style","_style2","_header","_visualEditor","Layout","Component","constructor","arguments","onSafeAreaInsetsUpdate","bind","onRootViewLayout","state","rootViewHeight","safeAreaInsets","top","bottom","right","left","SafeArea","getSafeAreaInsetsForRootView","then","componentDidMount","_isMounted","safeAreaSubscription","addEventListener","componentWillUnmount","remove","result","setState","event","setHeightState","height","nativeEvent","layout","sendNativeEditorDidLayout","renderHTML","globalStyles","props","_react","createElement","HTMLTextInput","parentHeight","style","renderVisual","isReady","default","setTitleRef","render","getStylesFromColorScheme","mode","isHtmlView","marginBottom","Platform","OS","headerToolbarStyles","containerStyles","styles","container","containerDark","toolbarKeyboardAvoidingViewStyle","toolbarKeyboardAvoidingView","backgroundColor","editorStyles","background","backgroundDark","Tooltip","Slot","SafeAreaView","onLayout","AutosaveMonitor","disableIntervalChecks","OfflineStatus","View","FloatingToolbar","NoticeList","flex","flexBasis","KeyboardAvoidingView","withAnimatedHeight","Fragment","__unstableAutocompletionItemsSlot","BottomSheetSettings","_default","exports","compose","withSelect","select","__unstableIsEditorReady","isEditorReady","getEditorMode","editorStore","getSettings","blockEditorStore","__experimentalGlobalStylesBaseStyles","color","withPreferredColorScheme"],"sources":["@wordpress/edit-post/src/components/layout/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { Platform, SafeAreaView, View } from 'react-native';\nimport SafeArea from 'react-native-safe-area';\n\n/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { withSelect } from '@wordpress/data';\nimport {\n\tBottomSheetSettings,\n\tFloatingToolbar,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { compose, withPreferredColorScheme } from '@wordpress/compose';\nimport {\n\tHTMLTextInput,\n\tKeyboardAvoidingView,\n\tNoticeList,\n\tTooltip,\n\t__unstableAutocompletionItemsSlot as AutocompletionItemsSlot,\n} from '@wordpress/components';\nimport {\n\tAutosaveMonitor,\n\tOfflineStatus,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { sendNativeEditorDidLayout } from '@wordpress/react-native-bridge';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\nimport headerToolbarStyles from '../header/header-toolbar/style.scss';\nimport Header from '../header';\nimport VisualEditor from '../visual-editor';\n\nclass Layout extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.onSafeAreaInsetsUpdate = this.onSafeAreaInsetsUpdate.bind( this );\n\t\tthis.onRootViewLayout = this.onRootViewLayout.bind( this );\n\n\t\tthis.state = {\n\t\t\trootViewHeight: 0,\n\t\t\tsafeAreaInsets: { top: 0, bottom: 0, right: 0, left: 0 },\n\t\t};\n\n\t\tSafeArea.getSafeAreaInsetsForRootView().then(\n\t\t\tthis.onSafeAreaInsetsUpdate\n\t\t);\n\t}\n\n\tcomponentDidMount() {\n\t\tthis._isMounted = true;\n\t\tthis.safeAreaSubscription = SafeArea.addEventListener(\n\t\t\t'safeAreaInsetsForRootViewDidChange',\n\t\t\tthis.onSafeAreaInsetsUpdate\n\t\t);\n\t}\n\n\tcomponentWillUnmount() {\n\t\tthis.safeAreaSubscription?.remove();\n\t\tthis._isMounted = false;\n\t}\n\n\tonSafeAreaInsetsUpdate( result ) {\n\t\tconst { safeAreaInsets } = result;\n\t\tif ( this._isMounted ) {\n\t\t\tthis.setState( { safeAreaInsets } );\n\t\t}\n\t}\n\n\tonRootViewLayout( event ) {\n\t\tif ( this._isMounted ) {\n\t\t\tthis.setHeightState( event );\n\t\t}\n\t}\n\n\tsetHeightState( event ) {\n\t\tconst { height } = event.nativeEvent.layout;\n\t\tif ( height !== this.state.rootViewHeight ) {\n\t\t\tthis.setState(\n\t\t\t\t{ rootViewHeight: height },\n\t\t\t\tsendNativeEditorDidLayout\n\t\t\t);\n\t\t}\n\t}\n\n\trenderHTML() {\n\t\tconst { globalStyles } = this.props;\n\t\treturn (\n\t\t\t<HTMLTextInput\n\t\t\t\tparentHeight={ this.state.rootViewHeight }\n\t\t\t\tstyle={ globalStyles }\n\t\t\t/>\n\t\t);\n\t}\n\n\trenderVisual() {\n\t\tconst { isReady } = this.props;\n\n\t\tif ( ! isReady ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn <VisualEditor setTitleRef={ this.props.setTitleRef } />;\n\t}\n\n\trender() {\n\t\tconst { getStylesFromColorScheme, mode, globalStyles } = this.props;\n\n\t\tconst isHtmlView = mode === 'text';\n\n\t\t// Add a margin view at the bottom for the header.\n\t\tconst marginBottom =\n\t\t\tPlatform.OS === 'android' && ! isHtmlView\n\t\t\t\t? headerToolbarStyles[ 'header-toolbar__container' ].height\n\t\t\t\t: 0;\n\n\t\tconst containerStyles = getStylesFromColorScheme(\n\t\t\tstyles.container,\n\t\t\tstyles.containerDark\n\t\t);\n\n\t\tconst toolbarKeyboardAvoidingViewStyle = {\n\t\t\t...styles.toolbarKeyboardAvoidingView,\n\t\t\tleft: this.state.safeAreaInsets.left,\n\t\t\tright: this.state.safeAreaInsets.right,\n\t\t\tbottom: this.state.safeAreaInsets.bottom,\n\t\t\tbackgroundColor: containerStyles.backgroundColor,\n\t\t};\n\n\t\tconst editorStyles = [\n\t\t\tgetStylesFromColorScheme(\n\t\t\t\tstyles.background,\n\t\t\t\tstyles.backgroundDark\n\t\t\t),\n\t\t\tglobalStyles?.background && {\n\t\t\t\tbackgroundColor: globalStyles.background,\n\t\t\t},\n\t\t];\n\n\t\treturn (\n\t\t\t<Tooltip.Slot>\n\t\t\t\t<SafeAreaView\n\t\t\t\t\tstyle={ containerStyles }\n\t\t\t\t\tonLayout={ this.onRootViewLayout }\n\t\t\t\t>\n\t\t\t\t\t<AutosaveMonitor disableIntervalChecks />\n\t\t\t\t\t<OfflineStatus />\n\t\t\t\t\t<View style={ editorStyles }>\n\t\t\t\t\t\t{ isHtmlView ? this.renderHTML() : this.renderVisual() }\n\t\t\t\t\t\t{ ! isHtmlView && Platform.OS === 'android' && (\n\t\t\t\t\t\t\t<FloatingToolbar />\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<NoticeList />\n\t\t\t\t\t</View>\n\t\t\t\t\t<View\n\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\tflex: 0,\n\t\t\t\t\t\t\tflexBasis: marginBottom,\n\t\t\t\t\t\t\theight: marginBottom,\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t\t{ ! isHtmlView && (\n\t\t\t\t\t\t<KeyboardAvoidingView\n\t\t\t\t\t\t\tparentHeight={ this.state.rootViewHeight }\n\t\t\t\t\t\t\tstyle={ toolbarKeyboardAvoidingViewStyle }\n\t\t\t\t\t\t\twithAnimatedHeight\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ Platform.OS === 'ios' && (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<AutocompletionItemsSlot />\n\t\t\t\t\t\t\t\t\t<FloatingToolbar />\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<Header />\n\t\t\t\t\t\t\t<BottomSheetSettings />\n\t\t\t\t\t\t</KeyboardAvoidingView>\n\t\t\t\t\t) }\n\t\t\t\t\t{ Platform.OS === 'android' && <AutocompletionItemsSlot /> }\n\t\t\t\t</SafeAreaView>\n\t\t\t</Tooltip.Slot>\n\t\t);\n\t}\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst { __unstableIsEditorReady: isEditorReady, getEditorMode } =\n\t\t\tselect( editorStore );\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst globalStyles =\n\t\t\tgetSettings()?.__experimentalGlobalStylesBaseStyles?.color;\n\n\t\treturn {\n\t\t\tisReady: isEditorReady(),\n\t\t\tmode: getEditorMode(),\n\t\t\tglobalStyles,\n\t\t};\n\t} ),\n\twithPreferredColorScheme,\n] )( Layout );\n"],"mappings":";;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,oBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAKA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAKA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AAOA,IAAAQ,OAAA,GAAAR,OAAA;AAKA,IAAAS,kBAAA,GAAAT,OAAA;AAKA,IAAAU,MAAA,GAAAR,sBAAA,CAAAF,OAAA;AACA,IAAAW,OAAA,GAAAT,sBAAA,CAAAF,OAAA;AACA,IAAAY,OAAA,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W,CAAC,CAAC,EAAEE,oCAAoC,EAAEC,KAAK;EAE3D,OAAO;IACNlD,OAAO,EAAE4C,aAAa,CAAC,CAAC;IACxBvC,IAAI,EAAEwC,aAAa,CAAC,CAAC;IACrBrD;EACD,CAAC;AACF,CAAE,CAAC,EACH2D,iCAAwB,CACvB,CAAC,CAAE3F,MAAO,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","_reactNativeSafeArea","_interopRequireDefault","_element","_data","_blockEditor","_compose","_components","_editor","_reactNativeBridge","_style","_style2","_header","_visualEditor","_jsxRuntime","Layout","Component","constructor","arguments","onSafeAreaInsetsUpdate","bind","onRootViewLayout","state","rootViewHeight","safeAreaInsets","top","bottom","right","left","SafeArea","getSafeAreaInsetsForRootView","then","componentDidMount","_isMounted","safeAreaSubscription","addEventListener","componentWillUnmount","remove","result","setState","event","setHeightState","height","nativeEvent","layout","sendNativeEditorDidLayout","renderHTML","globalStyles","props","jsx","HTMLTextInput","parentHeight","style","renderVisual","isReady","default","setTitleRef","render","getStylesFromColorScheme","mode","isHtmlView","marginBottom","Platform","OS","headerToolbarStyles","containerStyles","styles","container","containerDark","toolbarKeyboardAvoidingViewStyle","toolbarKeyboardAvoidingView","backgroundColor","editorStyles","background","backgroundDark","Tooltip","Slot","children","jsxs","SafeAreaView","onLayout","AutosaveMonitor","disableIntervalChecks","OfflineStatus","View","FloatingToolbar","NoticeList","flex","flexBasis","KeyboardAvoidingView","withAnimatedHeight","Fragment","__unstableAutocompletionItemsSlot","BottomSheetSettings","_default","exports","compose","withSelect","select","__unstableIsEditorReady","isEditorReady","getEditorMode","editorStore","getSettings","blockEditorStore","__experimentalGlobalStylesBaseStyles","color","withPreferredColorScheme"],"sources":["@wordpress/edit-post/src/components/layout/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { Platform, SafeAreaView, View } from 'react-native';\nimport SafeArea from 'react-native-safe-area';\n\n/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { withSelect } from '@wordpress/data';\nimport {\n\tBottomSheetSettings,\n\tFloatingToolbar,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { compose, withPreferredColorScheme } from '@wordpress/compose';\nimport {\n\tHTMLTextInput,\n\tKeyboardAvoidingView,\n\tNoticeList,\n\tTooltip,\n\t__unstableAutocompletionItemsSlot as AutocompletionItemsSlot,\n} from '@wordpress/components';\nimport {\n\tAutosaveMonitor,\n\tOfflineStatus,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { sendNativeEditorDidLayout } from '@wordpress/react-native-bridge';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\nimport headerToolbarStyles from '../header/header-toolbar/style.scss';\nimport Header from '../header';\nimport VisualEditor from '../visual-editor';\n\nclass Layout extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.onSafeAreaInsetsUpdate = this.onSafeAreaInsetsUpdate.bind( this );\n\t\tthis.onRootViewLayout = this.onRootViewLayout.bind( this );\n\n\t\tthis.state = {\n\t\t\trootViewHeight: 0,\n\t\t\tsafeAreaInsets: { top: 0, bottom: 0, right: 0, left: 0 },\n\t\t};\n\n\t\tSafeArea.getSafeAreaInsetsForRootView().then(\n\t\t\tthis.onSafeAreaInsetsUpdate\n\t\t);\n\t}\n\n\tcomponentDidMount() {\n\t\tthis._isMounted = true;\n\t\tthis.safeAreaSubscription = SafeArea.addEventListener(\n\t\t\t'safeAreaInsetsForRootViewDidChange',\n\t\t\tthis.onSafeAreaInsetsUpdate\n\t\t);\n\t}\n\n\tcomponentWillUnmount() {\n\t\tthis.safeAreaSubscription?.remove();\n\t\tthis._isMounted = false;\n\t}\n\n\tonSafeAreaInsetsUpdate( result ) {\n\t\tconst { safeAreaInsets } = result;\n\t\tif ( this._isMounted ) {\n\t\t\tthis.setState( { safeAreaInsets } );\n\t\t}\n\t}\n\n\tonRootViewLayout( event ) {\n\t\tif ( this._isMounted ) {\n\t\t\tthis.setHeightState( event );\n\t\t}\n\t}\n\n\tsetHeightState( event ) {\n\t\tconst { height } = event.nativeEvent.layout;\n\t\tif ( height !== this.state.rootViewHeight ) {\n\t\t\tthis.setState(\n\t\t\t\t{ rootViewHeight: height },\n\t\t\t\tsendNativeEditorDidLayout\n\t\t\t);\n\t\t}\n\t}\n\n\trenderHTML() {\n\t\tconst { globalStyles } = this.props;\n\t\treturn (\n\t\t\t<HTMLTextInput\n\t\t\t\tparentHeight={ this.state.rootViewHeight }\n\t\t\t\tstyle={ globalStyles }\n\t\t\t/>\n\t\t);\n\t}\n\n\trenderVisual() {\n\t\tconst { isReady } = this.props;\n\n\t\tif ( ! isReady ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn <VisualEditor setTitleRef={ this.props.setTitleRef } />;\n\t}\n\n\trender() {\n\t\tconst { getStylesFromColorScheme, mode, globalStyles } = this.props;\n\n\t\tconst isHtmlView = mode === 'text';\n\n\t\t// Add a margin view at the bottom for the header.\n\t\tconst marginBottom =\n\t\t\tPlatform.OS === 'android' && ! isHtmlView\n\t\t\t\t? headerToolbarStyles[ 'header-toolbar__container' ].height\n\t\t\t\t: 0;\n\n\t\tconst containerStyles = getStylesFromColorScheme(\n\t\t\tstyles.container,\n\t\t\tstyles.containerDark\n\t\t);\n\n\t\tconst toolbarKeyboardAvoidingViewStyle = {\n\t\t\t...styles.toolbarKeyboardAvoidingView,\n\t\t\tleft: this.state.safeAreaInsets.left,\n\t\t\tright: this.state.safeAreaInsets.right,\n\t\t\tbottom: this.state.safeAreaInsets.bottom,\n\t\t\tbackgroundColor: containerStyles.backgroundColor,\n\t\t};\n\n\t\tconst editorStyles = [\n\t\t\tgetStylesFromColorScheme(\n\t\t\t\tstyles.background,\n\t\t\t\tstyles.backgroundDark\n\t\t\t),\n\t\t\tglobalStyles?.background && {\n\t\t\t\tbackgroundColor: globalStyles.background,\n\t\t\t},\n\t\t];\n\n\t\treturn (\n\t\t\t<Tooltip.Slot>\n\t\t\t\t<SafeAreaView\n\t\t\t\t\tstyle={ containerStyles }\n\t\t\t\t\tonLayout={ this.onRootViewLayout }\n\t\t\t\t>\n\t\t\t\t\t<AutosaveMonitor disableIntervalChecks />\n\t\t\t\t\t<OfflineStatus />\n\t\t\t\t\t<View style={ editorStyles }>\n\t\t\t\t\t\t{ isHtmlView ? this.renderHTML() : this.renderVisual() }\n\t\t\t\t\t\t{ ! isHtmlView && Platform.OS === 'android' && (\n\t\t\t\t\t\t\t<FloatingToolbar />\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<NoticeList />\n\t\t\t\t\t</View>\n\t\t\t\t\t<View\n\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\tflex: 0,\n\t\t\t\t\t\t\tflexBasis: marginBottom,\n\t\t\t\t\t\t\theight: marginBottom,\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t\t{ ! isHtmlView && (\n\t\t\t\t\t\t<KeyboardAvoidingView\n\t\t\t\t\t\t\tparentHeight={ this.state.rootViewHeight }\n\t\t\t\t\t\t\tstyle={ toolbarKeyboardAvoidingViewStyle }\n\t\t\t\t\t\t\twithAnimatedHeight\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ Platform.OS === 'ios' && (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<AutocompletionItemsSlot />\n\t\t\t\t\t\t\t\t\t<FloatingToolbar />\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<Header />\n\t\t\t\t\t\t\t<BottomSheetSettings />\n\t\t\t\t\t\t</KeyboardAvoidingView>\n\t\t\t\t\t) }\n\t\t\t\t\t{ Platform.OS === 'android' && <AutocompletionItemsSlot /> }\n\t\t\t\t</SafeAreaView>\n\t\t\t</Tooltip.Slot>\n\t\t);\n\t}\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst { __unstableIsEditorReady: isEditorReady, getEditorMode } =\n\t\t\tselect( editorStore );\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst globalStyles =\n\t\t\tgetSettings()?.__experimentalGlobalStylesBaseStyles?.color;\n\n\t\treturn {\n\t\t\tisReady: isEditorReady(),\n\t\t\tmode: getEditorMode(),\n\t\t\tglobalStyles,\n\t\t};\n\t} ),\n\twithPreferredColorScheme,\n] )( Layout );\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,oBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAKA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAKA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AAOA,IAAAQ,OAAA,GAAAR,OAAA;AAKA,IAAAS,kBAAA,GAAAT,OAAA;AAKA,IAAAU,MAAA,GAAAR,sBAAA,CAAAF,OAAA;AACA,IAAAW,OAAA,GAAAT,sBAAA,CAAAF,OAAA;AACA,IAAAY,OAAA,GAAAV,sBAAA,CAAAF,OAAA;AACA,IAAAa,aAAA,GAAAX,sBAAA,CAAAF,OAAA;AAA4C,IAAAc,WAAA,GAAAd,OAAA;AArC5C;AACA;AACA;;AAIA;AACA;AACA;;AAuBA;AACA;AACA;;AAMA,MAAMe,MAAM,SAASC,kBAAS,CAAC;EAC9BC,WAAWA,CAAA,EAAG;IACb,KAAK,CAAE,GAAGC,SAAU,CAAC;IAErB,IAAI,CAACC,sBAAsB,GAAG,IAAI,CAACA,sBAAsB,CAACC,IAAI,CAAE,IAAK,CAAC;IACtE,IAAI,CAACC,gBAAgB,GAAG,IAAI,CAACA,gBAAgB,CAACD,IAAI,CAAE,IAAK,CAAC;IAE1D,IAAI,CAACE,KAAK,GAAG;MACZC,cAAc,EAAE,CAAC;MACjBC,cAAc,EAAE;QAAEC,GAAG,EAAE,CAAC;QAAEC,MAAM,EAAE,CAAC;QAAEC,KAAK,EAAE,CAAC;QAAEC,IAAI,EAAE;MAAE;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Ad,QAAA,gBACC,IAAA/D,WAAA,CAAAmC,GAAA,EAAC1C,WAAA,CAAAqF,iCAAuB,IAAE,CAAC,eAC3B,IAAA9E,WAAA,CAAAmC,GAAA,EAAC5C,YAAA,CAAAgF,eAAe,IAAE,CAAC;UAAA,CAClB,CACF,eACD,IAAAvE,WAAA,CAAAmC,GAAA,EAACrC,OAAA,CAAA2C,OAAM,IAAE,CAAC,eACV,IAAAzC,WAAA,CAAAmC,GAAA,EAAC5C,YAAA,CAAAwF,mBAAmB,IAAE,CAAC;QAAA,CACF,CACtB,EACC/B,qBAAQ,CAACC,EAAE,KAAK,SAAS,iBAAI,IAAAjD,WAAA,CAAAmC,GAAA,EAAC1C,WAAA,CAAAqF,iCAAuB,IAAE,CAAC;MAAA,CAC7C;IAAC,CACF,CAAC;EAEjB;AACD;AAAC,IAAAE,QAAA,GAAAC,OAAA,CAAAxC,OAAA,GAEc,IAAAyC,gBAAO,EAAE,CACvB,IAAAC,gBAAU,EAAIC,MAAM,IAAM;EACzB,MAAM;IAAEC,uBAAuB,EAAEC,aAAa;IAAEC;EAAc,CAAC,GAC9DH,MAAM,CAAEI,aAAY,CAAC;EACtB,MAAM;IAAEC;EAAY,CAAC,GAAGL,MAAM,CAAEM,kBAAiB,CAAC;EAClD,MAAMzD,YAAY,GACjBwD,WAAW,CAAC,CAAC,EAAEE,oCAAoC,EAAEC,KAAK;EAE3D,OAAO;IACNpD,OAAO,EAAE8C,aAAa,CAAC,CAAC;IACxBzC,IAAI,EAAE0C,aAAa,CAAC,CAAC;IACrBtD;EACD,CAAC;AACF,CAAE,CAAC,EACH4D,iCAAwB,CACvB,CAAC,CAAE5F,MAAO,CAAC","ignoreList":[]}
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_data","require","_compose","_blockEditor","_blocks","usePaddingAppender","registry","useRegistry","useRefEffect","node","onMouseDown","event","target","ownerDocument","defaultView","paddingBottom","parseInt","getComputedStyle","lastChild","lastElementChild","lastChildRect","getBoundingClientRect","clientY","bottom","preventDefault","blockOrder","select","blockEditorStore","getBlockOrder","lastBlockClientId","length","lastBlock","getBlock","selectBlock","insertDefaultBlock","dispatch","isUnmodifiedDefaultBlock","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', onMouseDown );\n\t\t\treturn () => {\n\t\t\t\tnode.removeEventListener( 'mousedown', onMouseDown );\n\t\t\t};\n\t\t},\n\t\t[ registry ]\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AANA;AACA;AACA;;AAMO,SAASI,kBAAkBA,CAAA,EAAG;EACpC,MAAMC,QAAQ,GAAG,IAAAC,iBAAW,EAAC,CAAC;EAC9B,OAAO,IAAAC,qBAAY,EAChBC,IAAI,IAAM;IACX,SAASC,WAAWA,CAAEC,KAAK,EAAG;MAC7B,IAAKA,KAAK,CAACC,MAAM,KAAKH,IAAI,EAAG;QAC5B;MACD;MAEA,MAAM;QAAEI;MAAc,CAAC,GAAGJ,IAAI;MAC9B,MAAM;QAAEK;MAAY,CAAC,GAAGD,aAAa;MAErC,MAAME,aAAa,GAAGD,WAAW,CAACE,QAAQ,CACzCF,WAAW,CAACG,gBAAgB,CAAER,IAAK,CAAC,CAACM,aAAa,EAClD,EACD,CAAC;MAED,IAAK,CAAEA,aAAa,EAAG;QACtB;MACD;;MAEA;MACA,MAAMG,SAAS,GAAGT,IAAI,CAACU,gBAAgB;MACvC,IAAK,CAAED,SAAS,EAAG;QAClB;MACD;MAEA,MAAME,aAAa,GAAGF,SAAS,CAACG,qBAAqB,CAAC,CAAC;MACvD,IAAKV,KAAK,CAACW,OAAO,GAAGF,aAAa,CAACG,MAAM,EAAG;QAC3C;MACD;MAEAZ,KAAK,CAACa,cAAc,CAAC,CAAC;MAEtB,MAAMC,UAAU,GAAGnB,QAAQ,CACzBoB,MAAM,CAAEC,kBAAiB,CAAC,CAC1BC,aAAa,CAAE,EAAG,CAAC;MACrB,MAAMC,iBAAiB,GAAGJ,UAAU,CAAEA,UAAU,CAACK,MAAM,GAAG,CAAC,CAAE;;MAE7D;MACA,IAAK,CAAED,iBAAiB,EAAG;QAC1B;MACD;MAEA,MAAME,SAAS,GAAGzB,QAAQ,CACxBoB,MAAM,CAAEC,kBAAiB,CAAC,CAC1BK,QAAQ,CAAEH,iBAAkB,CAAC;MAC/B,MAAM;QAAEI,WAAW;QAAEC;MAAmB,CAAC,GACxC5B,QAAQ,CAAC6B,QAAQ,CAAER,kBAAiB,CAAC;MAEtC,IAAK,IAAAS,gCAAwB,EAAEL,SAAU,CAAC,EAAG;QAC5CE,WAAW,CAAEJ,iBAAkB,CAAC;MACjC,CAAC,MAAM;QACNK,kBAAkB,CAAC,CAAC;MACrB;IACD;IACAzB,IAAI,CAAC4B,gBAAgB,CAAE,WAAW,EAAE3B,WAAY,CAAC;IACjD,OAAO,MAAM;MACZD,IAAI,CAAC6B,mBAAmB,CAAE,WAAW,EAAE5B,WAAY,CAAC;IACrD,CAAC;EACF,CAAC,EACD,CAAEJ,QAAQ,CACX,CAAC;AACF","ignoreList":[]}
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useShouldIframe = useShouldIframe;
7
+ var _editor = require("@wordpress/editor");
8
+ var _data = require("@wordpress/data");
9
+ var _blocks = require("@wordpress/blocks");
10
+ var _store = require("../../store");
11
+ /**
12
+ * WordPress dependencies
13
+ */
14
+
15
+ /**
16
+ * Internal dependencies
17
+ */
18
+
19
+ const isGutenbergPlugin = globalThis.IS_GUTENBERG_PLUGIN ? true : false;
20
+ function useShouldIframe() {
21
+ const {
22
+ isBlockBasedTheme,
23
+ hasV3BlocksOnly,
24
+ isEditingTemplate,
25
+ hasMetaBoxes
26
+ } = (0, _data.useSelect)(select => {
27
+ const {
28
+ getEditorSettings,
29
+ getCurrentPostType
30
+ } = select(_editor.store);
31
+ const {
32
+ getBlockTypes
33
+ } = select(_blocks.store);
34
+ const editorSettings = getEditorSettings();
35
+ return {
36
+ isBlockBasedTheme: editorSettings.__unstableIsBlockBasedTheme,
37
+ hasV3BlocksOnly: getBlockTypes().every(type => {
38
+ return type.apiVersion >= 3;
39
+ }),
40
+ isEditingTemplate: getCurrentPostType() === 'wp_template',
41
+ hasMetaBoxes: select(_store.store).hasMetaBoxes()
42
+ };
43
+ }, []);
44
+ return (hasV3BlocksOnly || isGutenbergPlugin && isBlockBasedTheme) && !hasMetaBoxes || isEditingTemplate;
45
+ }
46
+ //# sourceMappingURL=use-should-iframe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_editor","require","_data","_blocks","_store","isGutenbergPlugin","globalThis","IS_GUTENBERG_PLUGIN","useShouldIframe","isBlockBasedTheme","hasV3BlocksOnly","isEditingTemplate","hasMetaBoxes","useSelect","select","getEditorSettings","getCurrentPostType","editorStore","getBlockTypes","blocksStore","editorSettings","__unstableIsBlockBasedTheme","every","type","apiVersion","editPostStore"],"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":";;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAKA,IAAAG,MAAA,GAAAH,OAAA;AAVA;AACA;AACA;;AAKA;AACA;AACA;;AAGA,MAAMI,iBAAiB,GAAGC,UAAU,CAACC,mBAAmB,GAAG,IAAI,GAAG,KAAK;AAEhE,SAASC,eAAeA,CAAA,EAAG;EACjC,MAAM;IACLC,iBAAiB;IACjBC,eAAe;IACfC,iBAAiB;IACjBC;EACD,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAC5B,MAAM;MAAEC,iBAAiB;MAAEC;IAAmB,CAAC,GAAGF,MAAM,CAAEG,aAAY,CAAC;IACvE,MAAM;MAAEC;IAAc,CAAC,GAAGJ,MAAM,CAAEK,aAAY,CAAC;IAC/C,MAAMC,cAAc,GAAGL,iBAAiB,CAAC,CAAC;IAC1C,OAAO;MACNN,iBAAiB,EAAEW,cAAc,CAACC,2BAA2B;MAC7DX,eAAe,EAAEQ,aAAa,CAAC,CAAC,CAACI,KAAK,CAAIC,IAAI,IAAM;QACnD,OAAOA,IAAI,CAACC,UAAU,IAAI,CAAC;MAC5B,CAAE,CAAC;MACHb,iBAAiB,EAAEK,kBAAkB,CAAC,CAAC,KAAK,aAAa;MACzDJ,YAAY,EAAEE,MAAM,CAAEW,YAAc,CAAC,CAACb,YAAY,CAAC;IACpD,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,OACG,CAAEF,eAAe,IAAML,iBAAiB,IAAII,iBAAmB,KAChE,CAAEG,YAAY,IACfD,iBAAiB;AAEnB","ignoreList":[]}
@@ -5,13 +5,13 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = MetaBoxes;
8
- var _react = require("react");
9
8
  var _data = require("@wordpress/data");
10
9
  var _element = require("@wordpress/element");
11
10
  var _editor = require("@wordpress/editor");
12
11
  var _metaBoxesArea = _interopRequireDefault(require("./meta-boxes-area"));
13
12
  var _metaBoxVisibility = _interopRequireDefault(require("./meta-box-visibility"));
14
13
  var _store = require("../../store");
14
+ var _jsxRuntime = require("react/jsx-runtime");
15
15
  /**
16
16
  * WordPress dependencies
17
17
  */
@@ -55,13 +55,14 @@ function MetaBoxes({
55
55
  if (!areMetaBoxesInitialized) {
56
56
  return null;
57
57
  }
58
- return (0, _react.createElement)(_react.Fragment, null, (metaBoxes !== null && metaBoxes !== void 0 ? metaBoxes : []).map(({
59
- id
60
- }) => (0, _react.createElement)(_metaBoxVisibility.default, {
61
- key: id,
62
- id: id
63
- })), (0, _react.createElement)(_metaBoxesArea.default, {
64
- location: location
65
- }));
58
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
59
+ children: [(metaBoxes !== null && metaBoxes !== void 0 ? metaBoxes : []).map(({
60
+ id
61
+ }) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_metaBoxVisibility.default, {
62
+ id: id
63
+ }, id)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_metaBoxesArea.default, {
64
+ location: location
65
+ })]
66
+ });
66
67
  }
67
68
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_element","_editor","_metaBoxesArea","_interopRequireDefault","_metaBoxVisibility","_store","MetaBoxes","location","registry","useRegistry","metaBoxes","areMetaBoxesInitialized","isEditorReady","useSelect","select","__unstableIsEditorReady","editorStore","getMetaBoxesPerLocation","_areMetaBoxesInitialized","editPostStore","hasMetaBoxes","length","useEffect","dispatch","initializeMetaBoxes","_react","createElement","Fragment","map","id","default","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":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAKA,IAAAG,cAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,kBAAA,GAAAD,sBAAA,CAAAJ,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AAZA;AACA;AACA;;AAKA;AACA;AACA;;AAKe,SAASO,SAASA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACjD,MAAMC,QAAQ,GAAG,IAAAC,iBAAW,EAAC,CAAC;EAC9B,MAAM;IAAEC,SAAS;IAAEC,uBAAuB;IAAEC;EAAc,CAAC,GAAG,IAAAC,eAAS,EACpEC,MAAM,IAAM;IACb,MAAM;MAAEC;IAAwB,CAAC,GAAGD,MAAM,CAAEE,aAAY,CAAC;IACzD,MAAM;MACLC,uBAAuB;MACvBN,uBAAuB,EAAEO;IAC1B,CAAC,GAAGJ,MAAM,CAAEK,YAAc,CAAC;IAC3B,OAAO;MACNT,SAAS,EAAEO,uBAAuB,CAAEV,QAAS,CAAC;MAC9CI,uBAAuB,EAAEO,wBAAwB,CAAC,CAAC;MACnDN,aAAa,EAAEG,uBAAuB,CAAC;IACxC,CAAC;EACF,CAAC,EACD,CAAER,QAAQ,CACX,CAAC;EAED,MAAMa,YAAY,GAAG,CAAC,CAAEV,SAAS,EAAEW,MAAM;;EAEzC;EACA;EACA;EACA,IAAAC,kBAAS,EAAE,MAAM;IAChB,IAAKV,aAAa,IAAIQ,YAAY,IAAI,CAAET,uBAAuB,EAAG;MACjEH,QAAQ,CAACe,QAAQ,CAAEJ,YAAc,CAAC,CAACK,mBAAmB,CAAC,CAAC;IACzD;EACD,CAAC,EAAE,CAAEZ,aAAa,EAAEQ,YAAY,EAAET,uBAAuB,CAAG,CAAC;EAE7D,IAAK,CAAEA,uBAAuB,EAAG;IAChC,OAAO,IAAI;EACZ;EAEA,OACC,IAAAc,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAE,QAAA,QACG,CAAEjB,SAAS,aAATA,SAAS,cAATA,SAAS,GAAI,EAAE,EAAGkB,GAAG,CAAE,CAAE;IAAEC;EAAG,CAAC,KAClC,IAAAJ,MAAA,CAAAC,aAAA,EAACtB,kBAAA,CAAA0B,OAAiB;IAACC,GAAG,EAAGF,EAAI;IAACA,EAAE,EAAGA;EAAI,CAAE,CACxC,CAAC,EACH,IAAAJ,MAAA,CAAAC,aAAA,EAACxB,cAAA,CAAA4B,OAAa;IAACvB,QAAQ,EAAGA;EAAU,CAAE,CACrC,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["_data","require","_element","_editor","_metaBoxesArea","_interopRequireDefault","_metaBoxVisibility","_store","_jsxRuntime","MetaBoxes","location","registry","useRegistry","metaBoxes","areMetaBoxesInitialized","isEditorReady","useSelect","select","__unstableIsEditorReady","editorStore","getMetaBoxesPerLocation","_areMetaBoxesInitialized","editPostStore","hasMetaBoxes","length","useEffect","dispatch","initializeMetaBoxes","jsxs","Fragment","children","map","id","jsx","default"],"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":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAKA,IAAAG,cAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,kBAAA,GAAAD,sBAAA,CAAAJ,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AAAqD,IAAAO,WAAA,GAAAP,OAAA;AAZrD;AACA;AACA;;AAKA;AACA;AACA;;AAKe,SAASQ,SAASA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACjD,MAAMC,QAAQ,GAAG,IAAAC,iBAAW,EAAC,CAAC;EAC9B,MAAM;IAAE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;AAEL","ignoreList":[]}
@@ -5,12 +5,12 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = void 0;
8
- var _react = require("react");
9
8
  var _clsx = _interopRequireDefault(require("clsx"));
10
9
  var _element = require("@wordpress/element");
11
10
  var _components = require("@wordpress/components");
12
11
  var _data = require("@wordpress/data");
13
12
  var _store = require("../../../store");
13
+ var _jsxRuntime = require("react/jsx-runtime");
14
14
  /**
15
15
  * External dependencies
16
16
  */
@@ -29,8 +29,7 @@ var _store = require("../../../store");
29
29
  * @param {Object} props Component props.
30
30
  * @param {string} props.location metabox location.
31
31
  * @return {Component} The component to be rendered.
32
- */
33
- function MetaBoxesArea({
32
+ */function MetaBoxesArea({
34
33
  location
35
34
  }) {
36
35
  const container = (0, _element.useRef)(null);
@@ -52,14 +51,15 @@ function MetaBoxesArea({
52
51
  const classes = (0, _clsx.default)('edit-post-meta-boxes-area', `is-${location}`, {
53
52
  'is-loading': isSaving
54
53
  });
55
- return (0, _react.createElement)("div", {
56
- className: classes
57
- }, isSaving && (0, _react.createElement)(_components.Spinner, null), (0, _react.createElement)("div", {
58
- className: "edit-post-meta-boxes-area__container",
59
- ref: container
60
- }), (0, _react.createElement)("div", {
61
- className: "edit-post-meta-boxes-area__clear"
62
- }));
54
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
55
+ className: classes,
56
+ children: [isSaving && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Spinner, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
57
+ className: "edit-post-meta-boxes-area__container",
58
+ ref: container
59
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
60
+ className: "edit-post-meta-boxes-area__clear"
61
+ })]
62
+ });
63
63
  }
64
64
  var _default = exports.default = MetaBoxesArea;
65
65
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_components","_data","_store","MetaBoxesArea","location","container","useRef","formRef","useEffect","current","document","querySelector","appendChild","isSaving","useSelect","select","editPostStore","isSavingMetaBoxes","classes","clsx","_react","createElement","className","Spinner","ref","_default","exports","default"],"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":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QA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IAAAH,MAAA,CAAAC,aAAA;IACCC,SAAS,EAAC,sCAAsC;IAChDE,GAAG,EAAGnB;EAAW,CACjB,CAAC,EACF,IAAAe,MAAA,CAAAC,aAAA;IAAKC,SAAS,EAAC;EAAkC,CAAE,CAC/C,CAAC;AAER;AAAC,IAAAG,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcxB,aAAa","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_components","_data","_store","_jsxRuntime","MetaBoxesArea","location","container","useRef","formRef","useEffect","current","document","querySelector","appendChild","isSaving","useSelect","select","editPostStore","isSavingMetaBoxes","classes","clsx","jsxs","className","children","jsx","Spinner","ref","_default","exports","default"],"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":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAJ,OAAA;AAAwD,IAAAK,WAAA,GAAAL,OAAA;AAfxD;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,GACA,SAASM,aAAaA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACtC,MAAMC,SAAS,GAAG,IAAAC,eAAM,EAAE,IAAK,CAAC;EAChC,MAAMC,OAAO,GAAG,IAAAD,eAAM,EAAE,IAAK,CAAC;EAE9B,IAAAE,kBAAS,EAAE,MAAM;IAChBD,OAAO,CAACE,OAAO,GAAGC,QAAQ,CAACC,aAAa,CACvC,oBAAoB,GAAGP,QACxB,CAAC;IAED,IAAKG,OAAO,CAACE,OAAO,EAAG;MACtBJ,SAAS,CAACI,OAAO,CAACG,WAAW,CAAEL,OAAO,CAACE,OAAQ,CAAC;IACjD;IAEA,OAAO,MAAM;MACZ,IAAKF,OAAO,CAACE,OAAO,EAAG;QACtBC,QAAQ,CACNC,aAAa,CAAE,YAAa,CAAC,CAC7BC,WAAW,CAAEL,OAAO,CAACE,OAAQ,CAAC;MACjC;IACD,CAAC;EACF,CAAC,EAAE,CAAEL,QAAQ,CAAG,CAAC;EAEjB,MAAMS,QAAQ,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACzC,OAAOA,MAAM,CAAEC,YAAc,CAAC,CAACC,iBAAiB,CAAC,CAAC;EACnD,CAAC,EAAE,EAAG,CAAC;EAEP,MAAMC,OAAO,GAAG,IAAAC,aAAI,EAAE,2BAA2B,EAAG,MAAMf,QAAU,EAAC,EAAE;IACtE,YAAY,EAAES;EACf,CAAE,CAAC;EAEH,oBACC,IAAAX,WAAA,CAAAkB,IAAA;IAAKC,SAAS,EAAGH,OAAS;IAAAI,QAAA,GACvBT,QAAQ,iBAAI,IAAAX,WAAA,CAAAqB,GAAA,EAACxB,WAAA,CAAAyB,OAAO,IAAE,CAAC,eACzB,IAAAtB,WAAA,CAAAqB,GAAA;MACCF,SAAS,EAAC,sCAAsC;MAChDI,GAAG,EAAGpB;IAAW,CACjB,CAAC,eACF,IAAAH,WAAA,CAAAqB,GAAA;MAAKF,SAAS,EAAC;IAAkC,CAAE,CAAC;EAAA,CAChD,CAAC;AAER;AAAC,IAAAK,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEczB,aAAa","ignoreList":[]}
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = void 0;
8
+ var _i18n = require("@wordpress/i18n");
9
+ var _compose = require("@wordpress/compose");
10
+ var _editor = require("@wordpress/editor");
11
+ var _preferences = require("@wordpress/preferences");
12
+ var _keycodes = require("@wordpress/keycodes");
13
+ var _lockUnlock = require("../../lock-unlock");
14
+ var _managePatternsMenuItem = _interopRequireDefault(require("./manage-patterns-menu-item"));
15
+ var _welcomeGuideMenuItem = _interopRequireDefault(require("./welcome-guide-menu-item"));
16
+ var _preferencesModal = _interopRequireDefault(require("../preferences-modal"));
17
+ var _jsxRuntime = require("react/jsx-runtime");
18
+ /**
19
+ * WordPress dependencies
20
+ */
21
+
22
+ /**
23
+ * Internal dependencies
24
+ */
25
+
26
+ const {
27
+ ToolsMoreMenuGroup,
28
+ ViewMoreMenuGroup
29
+ } = (0, _lockUnlock.unlock)(_editor.privateApis);
30
+ const MoreMenu = () => {
31
+ const isLargeViewport = (0, _compose.useViewportMatch)('large');
32
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
33
+ children: [isLargeViewport && /*#__PURE__*/(0, _jsxRuntime.jsx)(ViewMoreMenuGroup, {
34
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_preferences.PreferenceToggleMenuItem, {
35
+ scope: "core/edit-post",
36
+ name: "fullscreenMode",
37
+ label: (0, _i18n.__)('Fullscreen mode'),
38
+ info: (0, _i18n.__)('Show and hide the admin user interface'),
39
+ messageActivated: (0, _i18n.__)('Fullscreen mode activated'),
40
+ messageDeactivated: (0, _i18n.__)('Fullscreen mode deactivated'),
41
+ shortcut: _keycodes.displayShortcut.secondary('f')
42
+ })
43
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(ToolsMoreMenuGroup, {
44
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_managePatternsMenuItem.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_welcomeGuideMenuItem.default, {})]
45
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_preferencesModal.default, {})]
46
+ });
47
+ };
48
+ var _default = exports.default = MoreMenu;
49
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_i18n","require","_compose","_editor","_preferences","_keycodes","_lockUnlock","_managePatternsMenuItem","_interopRequireDefault","_welcomeGuideMenuItem","_preferencesModal","_jsxRuntime","ToolsMoreMenuGroup","ViewMoreMenuGroup","unlock","editorPrivateApis","MoreMenu","isLargeViewport","useViewportMatch","jsxs","Fragment","children","jsx","PreferenceToggleMenuItem","scope","name","label","__","info","messageActivated","messageDeactivated","shortcut","displayShortcut","secondary","default","_default","exports"],"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":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;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AAoB,IAAE,CAAC;IAAA,CACL,CAAC,eACrB,IAAAvB,WAAA,CAAAW,GAAA,EAACZ,iBAAA,CAAAwB,OAAwB,IAAE,CAAC;EAAA,CAC3B,CAAC;AAEL,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAF,OAAA,GAEalB,QAAQ","ignoreList":[]}
@@ -4,12 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- var _react = require("react");
8
7
  var _components = require("@wordpress/components");
9
8
  var _coreData = require("@wordpress/core-data");
10
9
  var _data = require("@wordpress/data");
11
10
  var _i18n = require("@wordpress/i18n");
12
11
  var _url = require("@wordpress/url");
12
+ var _jsxRuntime = require("react/jsx-runtime");
13
13
  /**
14
14
  * WordPress dependencies
15
15
  */
@@ -31,10 +31,11 @@ function ManagePatternsMenuItem() {
31
31
  // display the manage patterns link if the user can't access it.
32
32
  return canUser('create', 'templates') ? patternsUrl : defaultUrl;
33
33
  }, []);
34
- return (0, _react.createElement)(_components.MenuItem, {
34
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.MenuItem, {
35
35
  role: "menuitem",
36
- href: url
37
- }, (0, _i18n.__)('Manage patterns'));
36
+ href: url,
37
+ children: (0, _i18n.__)('Manage patterns')
38
+ });
38
39
  }
39
40
  var _default = exports.default = ManagePatternsMenuItem;
40
41
  //# sourceMappingURL=manage-patterns-menu-item.js.map
@@ -0,0 +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":[]}
@@ -4,18 +4,18 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = WelcomeGuideMenuItem;
7
- var _react = require("react");
8
7
  var _data = require("@wordpress/data");
9
8
  var _preferences = require("@wordpress/preferences");
10
9
  var _i18n = require("@wordpress/i18n");
11
10
  var _editor = require("@wordpress/editor");
11
+ var _jsxRuntime = require("react/jsx-runtime");
12
12
  /**
13
13
  * WordPress dependencies
14
14
  */
15
15
 
16
16
  function WelcomeGuideMenuItem() {
17
17
  const isEditingTemplate = (0, _data.useSelect)(select => select(_editor.store).getCurrentPostType() === 'wp_template', []);
18
- return (0, _react.createElement)(_preferences.PreferenceToggleMenuItem, {
18
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_preferences.PreferenceToggleMenuItem, {
19
19
  scope: "core/edit-post",
20
20
  name: isEditingTemplate ? 'welcomeGuideTemplate' : 'welcomeGuide',
21
21
  label: (0, _i18n.__)('Welcome Guide')
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_data","require","_preferences","_i18n","_editor","_jsxRuntime","WelcomeGuideMenuItem","isEditingTemplate","useSelect","select","editorStore","getCurrentPostType","jsx","PreferenceToggleMenuItem","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":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAAyD,IAAAI,WAAA,GAAAJ,OAAA;AANzD;AACA;AACA;;AAMe,SAASK,oBAAoBA,CAAA,EAAG;EAC9C,MAAMC,iBAAiB,GAAG,IAAAC,eAAS,EAChCC,MAAM,IACPA,MAAM,CAAEC,aAAY,CAAC,CAACC,kBAAkB,CAAC,CAAC,KAAK,aAAa,EAC7D,EACD,CAAC;EAED,oBACC,IAAAN,WAAA,CAAAO,GAAA,EAACV,YAAA,CAAAW,wBAAwB;IACxBC,KAAK,EAAC,gBAAgB;IACtBC,IAAI,EAAGR,iBAAiB,GAAG,sBAAsB,GAAG,cAAgB;IACpES,KAAK,EAAG,IAAAC,QAAE,EAAE,eAAgB;EAAG,CAC/B,CAAC;AAEJ","ignoreList":[]}
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.CustomFieldsConfirmation = CustomFieldsConfirmation;
7
7
  exports.EnableCustomFieldsOption = EnableCustomFieldsOption;
8
8
  exports.default = void 0;
9
- var _react = require("react");
10
9
  var _element = require("@wordpress/element");
11
10
  var _i18n = require("@wordpress/i18n");
12
11
  var _components = require("@wordpress/components");
@@ -15,6 +14,7 @@ var _editor = require("@wordpress/editor");
15
14
  var _preferences = require("@wordpress/preferences");
16
15
  var _url = require("@wordpress/url");
17
16
  var _lockUnlock = require("../../lock-unlock");
17
+ var _jsxRuntime = require("react/jsx-runtime");
18
18
  /**
19
19
  * WordPress dependencies
20
20
  */
@@ -37,31 +37,37 @@ function CustomFieldsConfirmation({
37
37
  willEnable
38
38
  }) {
39
39
  const [isReloading, setIsReloading] = (0, _element.useState)(false);
40
- return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)("p", {
41
- className: "edit-post-preferences-modal__custom-fields-confirmation-message"
42
- }, (0, _i18n.__)('A page reload is required for this change. Make sure your content is saved before reloading.')), (0, _react.createElement)(_components.Button, {
43
- className: "edit-post-preferences-modal__custom-fields-confirmation-button",
44
- variant: "secondary",
45
- isBusy: isReloading,
46
- disabled: isReloading,
47
- onClick: () => {
48
- setIsReloading(true);
49
- submitCustomFieldsForm();
50
- }
51
- }, willEnable ? (0, _i18n.__)('Show & Reload Page') : (0, _i18n.__)('Hide & Reload Page')));
40
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
41
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
42
+ className: "edit-post-preferences-modal__custom-fields-confirmation-message",
43
+ children: (0, _i18n.__)('A page reload is required for this change. Make sure your content is saved before reloading.')
44
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
45
+ className: "edit-post-preferences-modal__custom-fields-confirmation-button",
46
+ variant: "secondary",
47
+ isBusy: isReloading,
48
+ __experimentalIsFocusable: true,
49
+ disabled: isReloading,
50
+ onClick: () => {
51
+ setIsReloading(true);
52
+ submitCustomFieldsForm();
53
+ },
54
+ children: willEnable ? (0, _i18n.__)('Show & Reload Page') : (0, _i18n.__)('Hide & Reload Page')
55
+ })]
56
+ });
52
57
  }
53
58
  function EnableCustomFieldsOption({
54
59
  label,
55
60
  areCustomFieldsEnabled
56
61
  }) {
57
62
  const [isChecked, setIsChecked] = (0, _element.useState)(areCustomFieldsEnabled);
58
- return (0, _react.createElement)(PreferenceBaseOption, {
63
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(PreferenceBaseOption, {
59
64
  label: label,
60
65
  isChecked: isChecked,
61
- onChange: setIsChecked
62
- }, isChecked !== areCustomFieldsEnabled && (0, _react.createElement)(CustomFieldsConfirmation, {
63
- willEnable: isChecked
64
- }));
66
+ onChange: setIsChecked,
67
+ children: isChecked !== areCustomFieldsEnabled && /*#__PURE__*/(0, _jsxRuntime.jsx)(CustomFieldsConfirmation, {
68
+ willEnable: isChecked
69
+ })
70
+ });
65
71
  }
66
72
  var _default = exports.default = (0, _data.withSelect)(select => ({
67
73
  areCustomFieldsEnabled: !!select(_editor.store).getEditorSettings().enableCustomFields
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_i18n","_components","_data","_editor","_preferences","_url","_lockUnlock","PreferenceBaseOption","unlock","preferencesPrivateApis","submitCustomFieldsForm","customFieldsForm","document","getElementById","querySelector","setAttribute","getPathAndQueryString","window","location","href","submit","CustomFieldsConfirmation","willEnable","isReloading","setIsReloading","useState","_react","createElement","Fragment","className","__","Button","variant","isBusy","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\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,O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AASM,wBAAwBA,CAAE;EAAEC,KAAK;EAAEC;AAAuB,CAAC,EAAG;EAC7E,MAAM,CAAEC,SAAS,EAAEC,YAAY,CAAE,GAAG,IAAAf,iBAAQ,EAAEa,sBAAuB,CAAC;EAEtE,OACC,IAAAZ,MAAA,CAAAC,aAAA,EAACpB,oBAAoB;IACpB8B,KAAK,EAAGA,KAAO;IACfE,SAAS,EAAGA,SAAW;IACvBE,QAAQ,EAAGD;EAAc,GAEvBD,SAAS,KAAKD,sBAAsB,IACrC,IAAAZ,MAAA,CAAAC,aAAA,EAACN,wBAAwB;IAACC,UAAU,EAAGiB;EAAW,CAAE,CAEhC,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","__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,EAAE,IAAAC,0BAAqB,EAAEC,MAAM,CAACC,QAAQ,CAACC,IAAK,CAAE,CAAC;EAExER,gBAAgB,CAACS,MAAM,CAAC,CAAC;AAC1B;AAEO,SAASC,wBAAwBA,CAAE;EAAEC;AAAW,CAAC,EAAG;EAC1D,MAAM,CAAEC,WAAW,EAAEC,cAAc,CAAE,GAAG,IAAAC,iBAAQ,EAAE,KAAM,CAAC;EACzD,oBACC,IAAAnB,WAAA,CAAAoB,IAAA,EAAApB,WAAA,CAAAqB,QAAA;IAAAC,QAAA,gBACC,IAAAtB,WAAA,CAAAuB,GAAA;MAAGC,SAAS,EAAC,iEAAiE;MAAAF,QAAA,EAC3E,IAAAG,QAAE,EACH,8FACD;IAAC,CACC,CAAC,eACJ,IAAAzB,WAAA,CAAAuB,GAAA,EAAC7B,WAAA,CAAAgC,MAAM;MACNF,SAAS,EAAC,gEAAgE;MAC1EG,OAAO,EAAC,WAAW;MACnBC,MAAM,EAAGX,WAAa;MACtBY,yBAAyB;MACzBC,QAAQ,EAAGb,WAAa;MACxBc,OAAO,EAAGA,CAAA,KAAM;QACfb,cAAc,CAAE,IAAK,CAAC;QACtBd,sBAAsB,CAAC,CAAC;MACzB,CAAG;MAAAkB,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":[]}
@@ -5,12 +5,12 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = EditPostPreferencesModal;
8
- var _react = require("react");
9
8
  var _i18n = require("@wordpress/i18n");
10
9
  var _preferences = require("@wordpress/preferences");
11
10
  var _editor = require("@wordpress/editor");
12
11
  var _lockUnlock = require("../../lock-unlock");
13
12
  var _metaBoxesSection = _interopRequireDefault(require("./meta-boxes-section"));
13
+ var _jsxRuntime = require("react/jsx-runtime");
14
14
  /**
15
15
  * WordPress dependencies
16
16
  */
@@ -27,17 +27,17 @@ const {
27
27
  } = (0, _lockUnlock.unlock)(_editor.privateApis);
28
28
  function EditPostPreferencesModal() {
29
29
  const extraSections = {
30
- general: (0, _react.createElement)(_metaBoxesSection.default, {
30
+ general: /*#__PURE__*/(0, _jsxRuntime.jsx)(_metaBoxesSection.default, {
31
31
  title: (0, _i18n.__)('Advanced')
32
32
  }),
33
- appearance: (0, _react.createElement)(PreferenceToggleControl, {
33
+ appearance: /*#__PURE__*/(0, _jsxRuntime.jsx)(PreferenceToggleControl, {
34
34
  scope: "core/edit-post",
35
35
  featureName: "themeStyles",
36
36
  help: (0, _i18n.__)('Make the editor look like your theme.'),
37
37
  label: (0, _i18n.__)('Use theme styles')
38
38
  })
39
39
  };
40
- return (0, _react.createElement)(PreferencesModal, {
40
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(PreferencesModal, {
41
41
  extraSections: extraSections
42
42
  });
43
43
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_preferences","_editor","_lockUnlock","_metaBoxesSection","_interopRequireDefault","PreferenceToggleControl","unlock","preferencesPrivateApis","PreferencesModal","editorPrivateApis","EditPostPreferencesModal","extraSections","general","_react","createElement","default","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":";;;;;;;;AAIA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAKA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAC,sBAAA,CAAAL,OAAA;AAZA;AACA;AACA;;AAMA;AACA;AACA;;AAIA,MAAM;EAAEM;AAAwB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AACpE,MAAM;EAAEC;AAAiB,CAAC,GAAG,IAAAF,kBAAM,EAAEG,mBAAkB,CAAC;AAEzC,SAASC,wBAAwBA,CAAA,EAAG;EAClD,MAAMC,aAAa,GAAG;IACrBC,OAAO,EAAE,IAAAC,MAAA,CAAAC,aAAA,EAACX,iBAAA,CAAAY,OAAgB;MAACC,KAAK,EAAG,IAAAC,QAAE,EAAE,UAAW;IAAG,CAAE,CAAC;IACxDC,UAAU,EACT,IAAAL,MAAA,CAAAC,aAAA,EAACT,uBAAuB;MACvBc,KAAK,EAAC,gBAAgB;MACtBC,WAAW,EAAC,aAAa;MACzBC,IAAI,EAAG,IAAAJ,QAAE,EAAE,uCAAwC,CAAG;MACtDK,KAAK,EAAG,IAAAL,QAAE,EAAE,kBAAmB;IAAG,CAClC;EAEH,CAAC;EAED,OAAO,IAAAJ,MAAA,CAAAC,aAAA,EAACN,gBAAgB;IAACG,aAAa,EAAGA;EAAe,CAAE,CAAC;AAC5D","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_preferences","_editor","_lockUnlock","_metaBoxesSection","_interopRequireDefault","_jsxRuntime","PreferenceToggleControl","unlock","preferencesPrivateApis","PreferencesModal","editorPrivateApis","EditPostPreferencesModal","extraSections","general","jsx","default","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":";;;;;;;AAIA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAKA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAC,sBAAA,CAAAL,OAAA;AAAoD,IAAAM,WAAA,GAAAN,OAAA;AAZpD;AACA;AACA;;AAMA;AACA;AACA;;AAIA,MAAM;EAAEO;AAAwB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AACpE,MAAM;EAAEC;AAAiB,CAAC,GAAG,IAAAF,kBAAM,EAAEG,mBAAkB,CAAC;AAEzC,SAASC,wBAAwBA,CAAA,EAAG;EAClD,MAAMC,aAAa,GAAG;IACrBC,OAAO,eAAE,IAAAR,WAAA,CAAAS,GAAA,EAACX,iBAAA,CAAAY,OAAgB;MAACC,KAAK,EAAG,IAAAC,QAAE,EAAE,UAAW;IAAG,CAAE,CAAC;IACxDC,UAAU,eACT,IAAAb,WAAA,CAAAS,GAAA,EAACR,uBAAuB;MACvBa,KAAK,EAAC,gBAAgB;MACtBC,WAAW,EAAC,aAAa;MACzBC,IAAI,EAAG,IAAAJ,QAAE,EAAE,uCAAwC,CAAG;MACtDK,KAAK,EAAG,IAAAL,QAAE,EAAE,kBAAmB;IAAG,CAClC;EAEH,CAAC;EAED,oBAAO,IAAAZ,WAAA,CAAAS,GAAA,EAACL,gBAAgB;IAACG,aAAa,EAAGA;EAAe,CAAE,CAAC;AAC5D","ignoreList":[]}
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.MetaBoxesSection = MetaBoxesSection;
8
8
  exports.default = void 0;
9
- var _react = require("react");
10
9
  var _i18n = require("@wordpress/i18n");
11
10
  var _data = require("@wordpress/data");
12
11
  var _editor = require("@wordpress/editor");
@@ -15,6 +14,7 @@ var _enableCustomFields = _interopRequireDefault(require("./enable-custom-fields
15
14
  var _enablePanel = _interopRequireDefault(require("./enable-panel"));
16
15
  var _store = require("../../store");
17
16
  var _lockUnlock = require("../../lock-unlock");
17
+ var _jsxRuntime = require("react/jsx-runtime");
18
18
  /**
19
19
  * WordPress dependencies
20
20
  */
@@ -38,18 +38,18 @@ function MetaBoxesSection({
38
38
  if (!areCustomFieldsRegistered && thirdPartyMetaBoxes.length === 0) {
39
39
  return null;
40
40
  }
41
- return (0, _react.createElement)(PreferencesModalSection, {
42
- ...sectionProps
43
- }, areCustomFieldsRegistered && (0, _react.createElement)(_enableCustomFields.default, {
44
- label: (0, _i18n.__)('Custom fields')
45
- }), thirdPartyMetaBoxes.map(({
46
- id,
47
- title
48
- }) => (0, _react.createElement)(_enablePanel.default, {
49
- key: id,
50
- label: title,
51
- panelName: `meta-box-${id}`
52
- })));
41
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(PreferencesModalSection, {
42
+ ...sectionProps,
43
+ children: [areCustomFieldsRegistered && /*#__PURE__*/(0, _jsxRuntime.jsx)(_enableCustomFields.default, {
44
+ label: (0, _i18n.__)('Custom fields')
45
+ }), thirdPartyMetaBoxes.map(({
46
+ id,
47
+ title
48
+ }) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_enablePanel.default, {
49
+ label: title,
50
+ panelName: `meta-box-${id}`
51
+ }, id))]
52
+ });
53
53
  }
54
54
  var _default = exports.default = (0, _data.withSelect)(select => {
55
55
  const {