@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
package/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 8.0.0 (2024-05-31)
6
+
7
+ ### Breaking Changes
8
+
9
+ - Variables like `process.env.IS_GUTENBERG_PLUGIN` have been replaced by `globalThis.IS_GUTENBERG_PLUGIN`. Build systems using `process.env` should be updated ([#61486](https://github.com/WordPress/gutenberg/pull/61486)).
10
+ - Increase the minimum required Node.js version to v18.12.0 matching long-term support releases ([#31270](https://github.com/WordPress/gutenberg/pull/61930)). Learn more about [Node.js releases](https://nodejs.org/en/about/previous-releases).
11
+
5
12
  ## 7.35.0 (2024-05-16)
6
13
 
7
14
  ### Internal
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = useCommands;
7
+ var _data = require("@wordpress/data");
8
+ var _i18n = require("@wordpress/i18n");
9
+ var _icons = require("@wordpress/icons");
10
+ var _commands = require("@wordpress/commands");
11
+ var _preferences = require("@wordpress/preferences");
12
+ var _notices = require("@wordpress/notices");
13
+ /**
14
+ * WordPress dependencies
15
+ */
16
+
17
+ function useCommands() {
18
+ const {
19
+ isFullscreen
20
+ } = (0, _data.useSelect)(select => {
21
+ const {
22
+ get
23
+ } = select(_preferences.store);
24
+ return {
25
+ isFullscreen: get('core/edit-post', 'fullscreenMode')
26
+ };
27
+ }, []);
28
+ const {
29
+ toggle
30
+ } = (0, _data.useDispatch)(_preferences.store);
31
+ const {
32
+ createInfoNotice
33
+ } = (0, _data.useDispatch)(_notices.store);
34
+ (0, _commands.useCommand)({
35
+ name: 'core/toggle-fullscreen-mode',
36
+ label: isFullscreen ? (0, _i18n.__)('Exit fullscreen') : (0, _i18n.__)('Enter fullscreen'),
37
+ icon: _icons.fullscreen,
38
+ callback: ({
39
+ close
40
+ }) => {
41
+ toggle('core/edit-post', 'fullscreenMode');
42
+ close();
43
+ createInfoNotice(isFullscreen ? (0, _i18n.__)('Fullscreen off.') : (0, _i18n.__)('Fullscreen on.'), {
44
+ id: 'core/edit-post/toggle-fullscreen-mode/notice',
45
+ type: 'snackbar',
46
+ actions: [{
47
+ label: (0, _i18n.__)('Undo'),
48
+ onClick: () => {
49
+ toggle('core/edit-post', 'fullscreenMode');
50
+ }
51
+ }]
52
+ });
53
+ }
54
+ });
55
+ }
56
+ //# sourceMappingURL=use-commands.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_data","require","_i18n","_icons","_commands","_preferences","_notices","useCommands","isFullscreen","useSelect","select","get","preferencesStore","toggle","useDispatch","createInfoNotice","noticesStore","useCommand","name","label","__","icon","fullscreen","callback","close","id","type","actions","onClick"],"sources":["@wordpress/edit-post/src/commands/use-commands.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { fullscreen } from '@wordpress/icons';\nimport { useCommand } from '@wordpress/commands';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as noticesStore } from '@wordpress/notices';\n\nexport default function useCommands() {\n\tconst { isFullscreen } = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\n\t\treturn {\n\t\t\tisFullscreen: get( 'core/edit-post', 'fullscreenMode' ),\n\t\t};\n\t}, [] );\n\tconst { toggle } = useDispatch( preferencesStore );\n\tconst { createInfoNotice } = useDispatch( noticesStore );\n\n\tuseCommand( {\n\t\tname: 'core/toggle-fullscreen-mode',\n\t\tlabel: isFullscreen\n\t\t\t? __( 'Exit fullscreen' )\n\t\t\t: __( 'Enter fullscreen' ),\n\t\ticon: fullscreen,\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggle( 'core/edit-post', 'fullscreenMode' );\n\t\t\tclose();\n\t\t\tcreateInfoNotice(\n\t\t\t\tisFullscreen ? __( 'Fullscreen off.' ) : __( 'Fullscreen on.' ),\n\t\t\t\t{\n\t\t\t\t\tid: 'core/edit-post/toggle-fullscreen-mode/notice',\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tactions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\ttoggle( 'core/edit-post', 'fullscreenMode' );\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\t} );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,QAA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ports.default = void 0;
8
- var _react = require("react");
9
8
  var _clsx = _interopRequireDefault(require("clsx"));
10
9
  var _data = require("@wordpress/data");
11
10
  var _components = require("@wordpress/components");
@@ -15,7 +14,8 @@ var _icons = require("@wordpress/icons");
15
14
  var _editor = require("@wordpress/editor");
16
15
  var _coreData = require("@wordpress/core-data");
17
16
  var _compose = require("@wordpress/compose");
18
- var _store = require("../../../store");
17
+ var _store = require("../../store");
18
+ var _jsxRuntime = require("react/jsx-runtime");
19
19
  /**
20
20
  * External dependencies
21
21
  */
@@ -65,7 +65,7 @@ function FullscreenModeClose({
65
65
  if (!isActive || !postType) {
66
66
  return null;
67
67
  }
68
- let buttonIcon = (0, _react.createElement)(_components.Icon, {
68
+ let buttonIcon = /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Icon, {
69
69
  size: "36px",
70
70
  icon: _icons.wordpress
71
71
  });
@@ -79,7 +79,7 @@ function FullscreenModeClose({
79
79
  }
80
80
  };
81
81
  if (siteIconUrl) {
82
- buttonIcon = (0, _react.createElement)(_components.__unstableMotion.img, {
82
+ buttonIcon = /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__unstableMotion.img, {
83
83
  variants: !disableMotion && effect,
84
84
  alt: (0, _i18n.__)('Site Icon'),
85
85
  className: "edit-post-fullscreen-mode-close_site-icon",
@@ -92,7 +92,7 @@ function FullscreenModeClose({
92
92
 
93
93
  // Override default icon if custom icon is provided via props.
94
94
  if (icon) {
95
- buttonIcon = (0, _react.createElement)(_components.Icon, {
95
+ buttonIcon = /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Icon, {
96
96
  size: "36px",
97
97
  icon: icon
98
98
  });
@@ -105,14 +105,16 @@ function FullscreenModeClose({
105
105
  post_type: postType.slug
106
106
  });
107
107
  const buttonLabel = (_postType$labels$view = postType?.labels?.view_items) !== null && _postType$labels$view !== void 0 ? _postType$labels$view : (0, _i18n.__)('Back');
108
- return (0, _react.createElement)(_components.__unstableMotion.div, {
109
- whileHover: "expand"
110
- }, (0, _react.createElement)(_components.Button, {
111
- className: classes,
112
- href: buttonHref,
113
- label: buttonLabel,
114
- showTooltip: showTooltip
115
- }, buttonIcon));
108
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__unstableMotion.div, {
109
+ whileHover: "expand",
110
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
111
+ className: classes,
112
+ href: buttonHref,
113
+ label: buttonLabel,
114
+ showTooltip: showTooltip,
115
+ children: buttonIcon
116
+ })
117
+ });
116
118
  }
117
119
  var _default = exports.default = FullscreenModeClose;
118
- //# sourceMappingURL=index.js.map
120
+ //# sourceMappingURL=fullscreen-mode-close.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_data","_components","_i18n","_url","_icons","_editor","_coreData","_compose","_store","_jsxRuntime","FullscreenModeClose","showTooltip","icon","href","initialPost","_postType$labels$view","isActive","isRequestingSiteIcon","postType","siteIconUrl","useSelect","select","getCurrentPostType","editorStore","isFeatureActive","editPostStore","getEntityRecord","getPostType","isResolving","coreStore","siteData","undefined","_postType","type","site_icon_url","disableMotion","useReducedMotion","buttonIcon","jsx","Icon","size","wordpress","effect","expand","scale","transition","duration","__unstableMotion","img","variants","alt","__","className","src","classes","clsx","buttonHref","addQueryArgs","post_type","slug","buttonLabel","labels","view_items","div","whileHover","children","Button","label","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/back-button/fullscreen-mode-close.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tButton,\n\tIcon,\n\t__unstableMotion as motion,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { addQueryArgs } from '@wordpress/url';\nimport { wordpress } from '@wordpress/icons';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useReducedMotion } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nfunction FullscreenModeClose( { showTooltip, icon, href, initialPost } ) {\n\tconst { isActive, isRequestingSiteIcon, postType, siteIconUrl } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getCurrentPostType } = select( editorStore );\n\t\t\tconst { isFeatureActive } = select( editPostStore );\n\t\t\tconst { getEntityRecord, getPostType, isResolving } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst siteData =\n\t\t\t\tgetEntityRecord( 'root', '__unstableBase', undefined ) || {};\n\t\t\tconst _postType = initialPost?.type || getCurrentPostType();\n\t\t\treturn {\n\t\t\t\tisActive: isFeatureActive( 'fullscreenMode' ),\n\t\t\t\tisRequestingSiteIcon: isResolving( 'getEntityRecord', [\n\t\t\t\t\t'root',\n\t\t\t\t\t'__unstableBase',\n\t\t\t\t\tundefined,\n\t\t\t\t] ),\n\t\t\t\tpostType: getPostType( _postType ),\n\t\t\t\tsiteIconUrl: siteData.site_icon_url,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst disableMotion = useReducedMotion();\n\n\tif ( ! isActive || ! postType ) {\n\t\treturn null;\n\t}\n\n\tlet buttonIcon = <Icon size=\"36px\" icon={ wordpress } />;\n\n\tconst effect = {\n\t\texpand: {\n\t\t\tscale: 1.25,\n\t\t\ttransition: { type: 'tween', duration: '0.3' },\n\t\t},\n\t};\n\n\tif ( siteIconUrl ) {\n\t\tbuttonIcon = (\n\t\t\t<motion.img\n\t\t\t\tvariants={ ! disableMotion && effect }\n\t\t\t\talt={ __( 'Site Icon' ) }\n\t\t\t\tclassName=\"edit-post-fullscreen-mode-close_site-icon\"\n\t\t\t\tsrc={ siteIconUrl }\n\t\t\t/>\n\t\t);\n\t}\n\n\tif ( isRequestingSiteIcon ) {\n\t\tbuttonIcon = null;\n\t}\n\n\t// Override default icon if custom icon is provided via props.\n\tif ( icon ) {\n\t\tbuttonIcon = <Icon size=\"36px\" icon={ icon } />;\n\t}\n\n\tconst classes = clsx( {\n\t\t'edit-post-fullscreen-mode-close': true,\n\t\t'has-icon': siteIconUrl,\n\t} );\n\n\tconst buttonHref =\n\t\thref ??\n\t\taddQueryArgs( 'edit.php', {\n\t\t\tpost_type: postType.slug,\n\t\t} );\n\n\tconst buttonLabel = postType?.labels?.view_items ?? __( 'Back' );\n\n\treturn (\n\t\t<motion.div whileHover=\"expand\">\n\t\t\t<Button\n\t\t\t\tclassName={ classes }\n\t\t\t\thref={ buttonHref }\n\t\t\t\tlabel={ buttonLabel }\n\t\t\t\tshowTooltip={ showTooltip }\n\t\t\t>\n\t\t\t\t{ buttonIcon }\n\t\t\t</Button>\n\t\t</motion.div>\n\t);\n}\n\nexport default FullscreenModeClose;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAKA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AAKA,IAAAS,MAAA,GAAAT,OAAA;AAAqD,IAAAU,WAAA,GAAAV,OAAA;AAxBrD;AACA;AACA;;AAGA;AACA;AACA;;AAcA;AACA;AACA;;AAGA,SAASW,mBAAmBA,CAAE;EAAEC,WAAW;EAAEC,IAAI;EAAEC,IAAI;EAAEC;AAAY,CAAC,EAAG;EAAA,IAAAC,qBAAA;EACxE,MAAM;IAAEC,QAAQ;IAAEC,oBAAoB;IAAEC,QAAQ;IAAEC;EAAY,CAAC,GAAG,IAAAC,eAAS,EACxEC,MAAM,IAAM;IACb,MAAM;MAAEC;IAAmB,CAAC,GAAGD,MAAM,CAAEE,aAAY,CAAC;IACpD,MAAM;MAAEC;IAAgB,CAAC,GAAGH,MAAM,CAAEI,YAAc,CA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GAAG,EAAGlC;IAAa,CACnB,CACD;EACF;EAEA,IAAKF,oBAAoB,EAAG;IAC3BoB,UAAU,GAAG,IAAI;EAClB;;EAEA;EACA,IAAKzB,IAAI,EAAG;IACXyB,UAAU,gBAAG,IAAA5B,WAAA,CAAA6B,GAAA,EAACrC,WAAA,CAAAsC,IAAI;MAACC,IAAI,EAAC,MAAM;MAAC5B,IAAI,EAAGA;IAAM,CAAE,CAAC;EAChD;EAEA,MAAM0C,OAAO,GAAG,IAAAC,aAAI,EAAE;IACrB,iCAAiC,EAAE,IAAI;IACvC,UAAU,EAAEpC;EACb,CAAE,CAAC;EAEH,MAAMqC,UAAU,GACf3C,IAAI,aAAJA,IAAI,cAAJA,IAAI,GACJ,IAAA4C,iBAAY,EAAE,UAAU,EAAE;IACzBC,SAAS,EAAExC,QAAQ,CAACyC;EACrB,CAAE,CAAC;EAEJ,MAAMC,WAAW,IAAA7C,qBAAA,GAAGG,QAAQ,EAAE2C,MAAM,EAAEC,UAAU,cAAA/C,qBAAA,cAAAA,qBAAA,GAAI,IAAAoC,QAAE,EAAE,MAAO,CAAC;EAEhE,oBACC,IAAA1C,WAAA,CAAA6B,GAAA,EAACrC,WAAA,CAAA8C,gBAAM,CAACgB,GAAG;IAACC,UAAU,EAAC,QAAQ;IAAAC,QAAA,eAC9B,IAAAxD,WAAA,CAAA6B,GAAA,EAACrC,WAAA,CAAAiE,MAAM;MACNd,SAAS,EAAGE,OAAS;MACrBzC,IAAI,EAAG2C,UAAY;MACnBW,KAAK,EAAGP,WAAa;MACrBjD,WAAW,EAAGA,WAAa;MAAAsD,QAAA,EAEzB5B;IAAU,CACL;EAAC,CACE,CAAC;AAEf;AAAC,IAAA+B,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc5D,mBAAmB","ignoreList":[]}
@@ -0,0 +1,57 @@
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 _editor = require("@wordpress/editor");
9
+ var _components = require("@wordpress/components");
10
+ var _fullscreenModeClose = _interopRequireDefault(require("./fullscreen-mode-close"));
11
+ var _lockUnlock = require("../../lock-unlock");
12
+ var _jsxRuntime = require("react/jsx-runtime");
13
+ /**
14
+ * WordPress dependencies
15
+ */
16
+
17
+ /**
18
+ * Internal dependencies
19
+ */
20
+
21
+ const {
22
+ BackButton: BackButtonFill
23
+ } = (0, _lockUnlock.unlock)(_editor.privateApis);
24
+ const slideX = {
25
+ hidden: {
26
+ x: '-100%'
27
+ },
28
+ distractionFreeInactive: {
29
+ x: 0
30
+ },
31
+ hover: {
32
+ x: 0,
33
+ transition: {
34
+ type: 'tween',
35
+ delay: 0.2
36
+ }
37
+ }
38
+ };
39
+ function BackButton({
40
+ initialPost
41
+ }) {
42
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(BackButtonFill, {
43
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__unstableMotion.div, {
44
+ variants: slideX,
45
+ transition: {
46
+ type: 'tween',
47
+ delay: 0.8
48
+ },
49
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_fullscreenModeClose.default, {
50
+ showTooltip: true,
51
+ initialPost: initialPost
52
+ })
53
+ })
54
+ });
55
+ }
56
+ var _default = exports.default = BackButton;
57
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_editor","require","_components","_fullscreenModeClose","_interopRequireDefault","_lockUnlock","_jsxRuntime","BackButton","BackButtonFill","unlock","editorPrivateApis","slideX","hidden","x","distractionFreeInactive","hover","transition","type","delay","initialPost","jsx","children","__unstableMotion","div","variants","default","showTooltip","_default","exports"],"sources":["@wordpress/edit-post/src/components/back-button/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { __unstableMotion as motion } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport FullscreenModeClose from './fullscreen-mode-close';\nimport { unlock } from '../../lock-unlock';\n\nconst { BackButton: BackButtonFill } = unlock( editorPrivateApis );\n\nconst slideX = {\n\thidden: { x: '-100%' },\n\tdistractionFreeInactive: { x: 0 },\n\thover: { x: 0, transition: { type: 'tween', delay: 0.2 } },\n};\n\nfunction BackButton( { initialPost } ) {\n\treturn (\n\t\t<BackButtonFill>\n\t\t\t<motion.div\n\t\t\t\tvariants={ slideX }\n\t\t\t\ttransition={ { type: 'tween', delay: 0.8 } }\n\t\t\t>\n\t\t\t\t<FullscreenModeClose showTooltip initialPost={ initialPost } />\n\t\t\t</motion.div>\n\t\t</BackButtonFill>\n\t);\n}\n\nexport default BackButton;\n"],"mappings":";;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAKA,IAAAE,oBAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAA2C,IAAAK,WAAA,GAAAL,OAAA;AAV3C;AACA;AACA;;AAIA;AACA;AACA;;AAIA,MAAM;EAAEM,UAAU,EAAEC;AAAe,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAElE,MAAMC,MAAM,GAAG;EACdC,MAAM,EAAE;IAAEC,CAAC,EAAE;EAAQ,CAAC;EACtBC,uBAAuB,EAAE;IAAED,CAAC,EAAE;EAAE,CAAC;EACjCE,KAAK,EAAE;IAAEF,CAAC,EAAE,CAAC;IAAEG,UAAU,EAAE;MAAEC,IAAI,EAAE,OAAO;MAAEC,KAAK,EAAE;IAAI;EAAE;AAC1D,CAAC;AAED,SAASX,UAAUA,CAAE;EAAEY;AAAY,CAAC,EAAG;EACtC,oBACC,IAAAb,WAAA,CAAAc,GAAA,EAACZ,cAAc;IAAAa,QAAA,eACd,IAAAf,WAAA,CAAAc,GAAA,EAAClB,WAAA,CAAAoB,gBAAM,CAACC,GAAG;MACVC,QAAQ,EAAGb,MAAQ;MACnBK,UAAU,EAAG;QAAEC,IAAI,EAAE,OAAO;QAAEC,KAAK,EAAE;MAAI,CAAG;MAAAG,QAAA,eAE5C,IAAAf,WAAA,CAAAc,GAAA,EAACjB,oBAAA,CAAAsB,OAAmB;QAACC,WAAW;QAACP,WAAW,EAAGA;MAAa,CAAE;IAAC,CACpD;EAAC,CACE,CAAC;AAEnB;AAAC,IAAAQ,QAAA,GAAAC,OAAA,CAAAH,OAAA,GAEclB,UAAU","ignoreList":[]}
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = void 0;
8
- var _react = require("react");
9
8
  var _reactNative = require("react-native");
10
9
  var _element = require("@wordpress/element");
11
10
  var _compose = require("@wordpress/compose");
@@ -20,6 +19,7 @@ var _blocks = require("@wordpress/blocks");
20
19
  var _reactNativeBridge = require("@wordpress/react-native-bridge");
21
20
  var _style = _interopRequireDefault(require("./style.scss"));
22
21
  var _store = require("../../../store");
22
+ var _jsxRuntime = require("react/jsx-runtime");
23
23
  /**
24
24
  * External dependencies
25
25
  */
@@ -88,43 +88,41 @@ function HeaderToolbar({
88
88
  inserterMethod: 'quick-inserter'
89
89
  });
90
90
  }, [insertBlock]);
91
- const renderMediaButtons = (0, _react.createElement)(_components.ToolbarGroup, null, (0, _react.createElement)(_components.ToolbarButton, {
92
- key: "imageButton",
93
- title: (0, _i18n.__)('Image'),
94
- icon: _icons.media,
95
- onClick: onInsertBlock('core/image'),
96
- testID: "insert-image-button",
97
- extraProps: {
98
- hint: (0, _i18n.__)('Insert Image Block')
99
- }
100
- }), (0, _react.createElement)(_components.ToolbarButton, {
101
- key: "videoButton",
102
- title: (0, _i18n.__)('Video'),
103
- icon: _icons.video,
104
- onClick: onInsertBlock('core/video'),
105
- testID: "insert-video-button",
106
- extraProps: {
107
- hint: (0, _i18n.__)('Insert Video Block')
108
- }
109
- }), (0, _react.createElement)(_components.ToolbarButton, {
110
- key: "galleryButton",
111
- title: (0, _i18n.__)('Gallery'),
112
- icon: _icons.gallery,
113
- onClick: onInsertBlock('core/gallery'),
114
- testID: "insert-gallery-button",
115
- extraProps: {
116
- hint: (0, _i18n.__)('Insert Gallery Block')
117
- }
118
- }), (0, _react.createElement)(_components.ToolbarButton, {
119
- key: "audioButton",
120
- title: (0, _i18n.__)('Audio'),
121
- icon: _icons.audio,
122
- onClick: onInsertBlock('core/audio'),
123
- testID: "insert-audio-button",
124
- extraProps: {
125
- hint: (0, _i18n.__)('Insert Audio Block')
126
- }
127
- }));
91
+ const renderMediaButtons = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.ToolbarGroup, {
92
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarButton, {
93
+ title: (0, _i18n.__)('Image'),
94
+ icon: _icons.media,
95
+ onClick: onInsertBlock('core/image'),
96
+ testID: "insert-image-button",
97
+ extraProps: {
98
+ hint: (0, _i18n.__)('Insert Image Block')
99
+ }
100
+ }, "imageButton"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarButton, {
101
+ title: (0, _i18n.__)('Video'),
102
+ icon: _icons.video,
103
+ onClick: onInsertBlock('core/video'),
104
+ testID: "insert-video-button",
105
+ extraProps: {
106
+ hint: (0, _i18n.__)('Insert Video Block')
107
+ }
108
+ }, "videoButton"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarButton, {
109
+ title: (0, _i18n.__)('Gallery'),
110
+ icon: _icons.gallery,
111
+ onClick: onInsertBlock('core/gallery'),
112
+ testID: "insert-gallery-button",
113
+ extraProps: {
114
+ hint: (0, _i18n.__)('Insert Gallery Block')
115
+ }
116
+ }, "galleryButton"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarButton, {
117
+ title: (0, _i18n.__)('Audio'),
118
+ icon: _icons.audio,
119
+ onClick: onInsertBlock('core/audio'),
120
+ testID: "insert-audio-button",
121
+ extraProps: {
122
+ hint: (0, _i18n.__)('Insert Audio Block')
123
+ }
124
+ }, "audioButton")]
125
+ });
128
126
 
129
127
  /* translators: accessibility text for the editor toolbar */
130
128
  const toolbarAriaLabel = (0, _i18n.__)('Document tools');
@@ -132,33 +130,36 @@ function HeaderToolbar({
132
130
  const showKeyboardButtonStyles = [(0, _compose.usePreferredColorSchemeStyle)(_style.default['header-toolbar__keyboard-hide-container'], _style.default['header-toolbar__keyboard-hide-container--dark']), shadowStyle, {
133
131
  shadowColor: _element.Platform.isAndroid ? _style.default['header-toolbar__keyboard-hide-shadow--solid'].color : shadowColor.color
134
132
  }];
135
- return (0, _react.createElement)(_reactNative.View, {
133
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
136
134
  ref: anchorNodeRef,
137
135
  testID: toolbarAriaLabel,
138
136
  accessibilityLabel: toolbarAriaLabel,
139
- style: containerStyle
140
- }, (0, _react.createElement)(_reactNative.ScrollView, {
141
- ref: scrollViewRef,
142
- onContentSizeChange: scrollToStart,
143
- horizontal: true,
144
- showsHorizontalScrollIndicator: false,
145
- keyboardShouldPersistTaps: "always",
146
- alwaysBounceHorizontal: false,
147
- contentContainerStyle: _style.default['header-toolbar__scrollable-content']
148
- }, (0, _react.createElement)(_blockEditor.Inserter, {
149
- disabled: !showInserter
150
- }), noContentSelected && renderMediaButtons, (0, _react.createElement)(_blockEditor.BlockToolbar, {
151
- anchorNodeRef: anchorNodeRef.current
152
- })), showKeyboardHideButton && (0, _react.createElement)(_components.ToolbarGroup, {
153
- passedStyle: showKeyboardButtonStyles
154
- }, (0, _react.createElement)(_components.ToolbarButton, {
155
- title: (0, _i18n.__)('Hide keyboard'),
156
- icon: _icons.keyboardClose,
157
- onClick: onHideKeyboard,
158
- extraProps: {
159
- hint: (0, _i18n.__)('Tap to hide the keyboard')
160
- }
161
- })));
137
+ style: containerStyle,
138
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.ScrollView, {
139
+ ref: scrollViewRef,
140
+ onContentSizeChange: scrollToStart,
141
+ horizontal: true,
142
+ showsHorizontalScrollIndicator: false,
143
+ keyboardShouldPersistTaps: "always",
144
+ alwaysBounceHorizontal: false,
145
+ contentContainerStyle: _style.default['header-toolbar__scrollable-content'],
146
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.Inserter, {
147
+ disabled: !showInserter
148
+ }), noContentSelected && renderMediaButtons, /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.BlockToolbar, {
149
+ anchorNodeRef: anchorNodeRef.current
150
+ })]
151
+ }), showKeyboardHideButton && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarGroup, {
152
+ passedStyle: showKeyboardButtonStyles,
153
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarButton, {
154
+ title: (0, _i18n.__)('Hide keyboard'),
155
+ icon: _icons.keyboardClose,
156
+ onClick: onHideKeyboard,
157
+ extraProps: {
158
+ hint: (0, _i18n.__)('Tap to hide the keyboard')
159
+ }
160
+ })
161
+ })]
162
+ });
162
163
  }
163
164
  var _default = exports.default = (0, _compose.compose)([(0, _data.withSelect)(select => {
164
165
  const {
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_element","_compose","_data","_viewport","_i18n","_blockEditor","_components","_icons","_editor","_blocks","_reactNativeBridge","_style","_interopRequireDefault","_store","shadowStyle","shadowOffset","width","height","shadowOpacity","shadowRadius","elevation","HeaderToolbar","hasRedo","hasUndo","redo","undo","showInserter","showKeyboardHideButton","insertBlock","onHideKeyboard","isRTL","noContentSelected","anchorNodeRef","useRef","containerStyle","usePreferredColorSchemeStyle","styles","borderTopWidth","StyleSheet","hairlineWidth","useEffect","onUndoSubscription","subscribeOnUndoPressed","onRedoSubscription","subscribeOnRedoPressed","remove","toggleUndoButton","toggleRedoButton","scrollViewRef","scrollToStart","Platform","isAndroid","current","scrollToEnd","scrollTo","x","onInsertBlock","useCallback","blockType","createBlock","undefined","source","inserterMethod","renderMediaButtons","_react","createElement","ToolbarGroup","ToolbarButton","key","title","__","icon","imageIcon","onClick","testID","extraProps","hint","videoIcon","galleryIcon","audioIcon","toolbarAriaLabel","shadowColor","showKeyboardButtonStyles","color","View","ref","accessibilityLabel","style","ScrollView","onContentSizeChange","horizontal","showsHorizontalScrollIndicator","keyboardShouldPersistTaps","alwaysBounceHorizontal","contentContainerStyle","Inserter","disabled","BlockToolbar","passedStyle","keyboardClose","_default","exports","default","compose","withSelect","select","getBlockRootClientId","getBlockSelectionEnd","hasInserterItems","hasSelectedBlock","blockEditorStore","getEditorSettings","editorStore","isAnyBlockSelected","hasEditorRedo","hasEditorUndo","editPostStore","getEditorMode","richEditingEnabled","isTextModeEnabled","getSettings","withDispatch","dispatch","clearSelectedBlock","togglePostTitleSelection","withViewportMatch","isLargeViewport"],"sources":["@wordpress/edit-post/src/components/header/header-toolbar/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { ScrollView, StyleSheet, View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { useCallback, useRef, useEffect, Platform } from '@wordpress/element';\nimport { compose, usePreferredColorSchemeStyle } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { withViewportMatch } from '@wordpress/viewport';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tInserter,\n\tBlockToolbar,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { ToolbarGroup, ToolbarButton } from '@wordpress/components';\nimport {\n\tkeyboardClose,\n\taudio as audioIcon,\n\tmedia as imageIcon,\n\tvideo as videoIcon,\n\tgallery as galleryIcon,\n} from '@wordpress/icons';\nimport { store as editorStore } from '@wordpress/editor';\nimport { createBlock } from '@wordpress/blocks';\nimport {\n\ttoggleUndoButton,\n\ttoggleRedoButton,\n\tsubscribeOnUndoPressed,\n\tsubscribeOnRedoPressed,\n} from '@wordpress/react-native-bridge';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\nimport { store as editPostStore } from '../../../store';\n\nconst shadowStyle = {\n\tshadowOffset: { width: 2, height: 2 },\n\tshadowOpacity: 1,\n\tshadowRadius: 6,\n\televation: 18,\n};\n\nfunction HeaderToolbar( {\n\thasRedo,\n\thasUndo,\n\tredo,\n\tundo,\n\tshowInserter,\n\tshowKeyboardHideButton,\n\tinsertBlock,\n\tonHideKeyboard,\n\tisRTL,\n\tnoContentSelected,\n} ) {\n\tconst anchorNodeRef = useRef();\n\n\tconst containerStyle = [\n\t\tusePreferredColorSchemeStyle(\n\t\t\tstyles[ 'header-toolbar__container' ],\n\t\t\tstyles[ 'header-toolbar__container--dark' ]\n\t\t),\n\t\t{ borderTopWidth: StyleSheet.hairlineWidth },\n\t];\n\n\tuseEffect( () => {\n\t\tconst onUndoSubscription = subscribeOnUndoPressed( undo );\n\t\tconst onRedoSubscription = subscribeOnRedoPressed( redo );\n\n\t\treturn () => {\n\t\t\tonUndoSubscription?.remove();\n\t\t\tonRedoSubscription?.remove();\n\t\t};\n\t}, [ undo, redo ] );\n\n\tuseEffect( () => {\n\t\ttoggleUndoButton( ! hasUndo );\n\t}, [ hasUndo ] );\n\n\tuseEffect( () => {\n\t\ttoggleRedoButton( ! hasRedo );\n\t}, [ hasRedo ] );\n\n\tconst scrollViewRef = useRef( null );\n\tconst scrollToStart = () => {\n\t\t// scrollview doesn't seem to automatically adjust to RTL on Android so, scroll to end when Android\n\t\tif ( Platform.isAndroid && isRTL ) {\n\t\t\tscrollViewRef.current.scrollToEnd();\n\t\t} else {\n\t\t\tscrollViewRef.current.scrollTo( { x: 0 } );\n\t\t}\n\t};\n\n\tconst onInsertBlock = useCallback(\n\t\t( blockType ) => () => {\n\t\t\tinsertBlock( createBlock( blockType ), undefined, undefined, true, {\n\t\t\t\tsource: 'inserter_menu',\n\t\t\t\tinserterMethod: 'quick-inserter',\n\t\t\t} );\n\t\t},\n\t\t[ insertBlock ]\n\t);\n\n\tconst renderMediaButtons = (\n\t\t<ToolbarGroup>\n\t\t\t<ToolbarButton\n\t\t\t\tkey=\"imageButton\"\n\t\t\t\ttitle={ __( 'Image' ) }\n\t\t\t\ticon={ imageIcon }\n\t\t\t\tonClick={ onInsertBlock( 'core/image' ) }\n\t\t\t\ttestID=\"insert-image-button\"\n\t\t\t\textraProps={ {\n\t\t\t\t\thint: __( 'Insert Image Block' ),\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<ToolbarButton\n\t\t\t\tkey=\"videoButton\"\n\t\t\t\ttitle={ __( 'Video' ) }\n\t\t\t\ticon={ videoIcon }\n\t\t\t\tonClick={ onInsertBlock( 'core/video' ) }\n\t\t\t\ttestID=\"insert-video-button\"\n\t\t\t\textraProps={ {\n\t\t\t\t\thint: __( 'Insert Video Block' ),\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<ToolbarButton\n\t\t\t\tkey=\"galleryButton\"\n\t\t\t\ttitle={ __( 'Gallery' ) }\n\t\t\t\ticon={ galleryIcon }\n\t\t\t\tonClick={ onInsertBlock( 'core/gallery' ) }\n\t\t\t\ttestID=\"insert-gallery-button\"\n\t\t\t\textraProps={ {\n\t\t\t\t\thint: __( 'Insert Gallery Block' ),\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<ToolbarButton\n\t\t\t\tkey=\"audioButton\"\n\t\t\t\ttitle={ __( 'Audio' ) }\n\t\t\t\ticon={ audioIcon }\n\t\t\t\tonClick={ onInsertBlock( 'core/audio' ) }\n\t\t\t\ttestID=\"insert-audio-button\"\n\t\t\t\textraProps={ {\n\t\t\t\t\thint: __( 'Insert Audio Block' ),\n\t\t\t\t} }\n\t\t\t/>\n\t\t</ToolbarGroup>\n\t);\n\n\t/* translators: accessibility text for the editor toolbar */\n\tconst toolbarAriaLabel = __( 'Document tools' );\n\n\tconst shadowColor = usePreferredColorSchemeStyle(\n\t\tstyles[ 'header-toolbar__keyboard-hide-shadow--light' ],\n\t\tstyles[ 'header-toolbar__keyboard-hide-shadow--dark' ]\n\t);\n\tconst showKeyboardButtonStyles = [\n\t\tusePreferredColorSchemeStyle(\n\t\t\tstyles[ 'header-toolbar__keyboard-hide-container' ],\n\t\t\tstyles[ 'header-toolbar__keyboard-hide-container--dark' ]\n\t\t),\n\t\tshadowStyle,\n\t\t{\n\t\t\tshadowColor: Platform.isAndroid\n\t\t\t\t? styles[ 'header-toolbar__keyboard-hide-shadow--solid' ].color\n\t\t\t\t: shadowColor.color,\n\t\t},\n\t];\n\n\treturn (\n\t\t<View\n\t\t\tref={ anchorNodeRef }\n\t\t\ttestID={ toolbarAriaLabel }\n\t\t\taccessibilityLabel={ toolbarAriaLabel }\n\t\t\tstyle={ containerStyle }\n\t\t>\n\t\t\t<ScrollView\n\t\t\t\tref={ scrollViewRef }\n\t\t\t\tonContentSizeChange={ scrollToStart }\n\t\t\t\thorizontal\n\t\t\t\tshowsHorizontalScrollIndicator={ false }\n\t\t\t\tkeyboardShouldPersistTaps=\"always\"\n\t\t\t\talwaysBounceHorizontal={ false }\n\t\t\t\tcontentContainerStyle={\n\t\t\t\t\tstyles[ 'header-toolbar__scrollable-content' ]\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t<Inserter disabled={ ! showInserter } />\n\n\t\t\t\t{ noContentSelected && renderMediaButtons }\n\t\t\t\t<BlockToolbar anchorNodeRef={ anchorNodeRef.current } />\n\t\t\t</ScrollView>\n\t\t\t{ showKeyboardHideButton && (\n\t\t\t\t<ToolbarGroup passedStyle={ showKeyboardButtonStyles }>\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\ttitle={ __( 'Hide keyboard' ) }\n\t\t\t\t\t\ticon={ keyboardClose }\n\t\t\t\t\t\tonClick={ onHideKeyboard }\n\t\t\t\t\t\textraProps={ {\n\t\t\t\t\t\t\thint: __( 'Tap to hide the keyboard' ),\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</ToolbarGroup>\n\t\t\t) }\n\t\t</View>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetBlockRootClientId,\n\t\t\tgetBlockSelectionEnd,\n\t\t\thasInserterItems,\n\t\t\thasSelectedBlock,\n\t\t} = select( blockEditorStore );\n\t\tconst { getEditorSettings } = select( editorStore );\n\t\tconst isAnyBlockSelected = hasSelectedBlock();\n\t\treturn {\n\t\t\thasRedo: select( editorStore ).hasEditorRedo(),\n\t\t\thasUndo: select( editorStore ).hasEditorUndo(),\n\t\t\t// This setting (richEditingEnabled) should not live in the block editor's setting.\n\t\t\tshowInserter:\n\t\t\t\tselect( editPostStore ).getEditorMode() === 'visual' &&\n\t\t\t\tgetEditorSettings().richEditingEnabled &&\n\t\t\t\thasInserterItems(\n\t\t\t\t\tgetBlockRootClientId( getBlockSelectionEnd() )\n\t\t\t\t),\n\t\t\tisTextModeEnabled:\n\t\t\t\tselect( editPostStore ).getEditorMode() === 'text',\n\t\t\tisRTL: select( blockEditorStore ).getSettings().isRTL,\n\t\t\tnoContentSelected: ! isAnyBlockSelected,\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { clearSelectedBlock, insertBlock } =\n\t\t\tdispatch( blockEditorStore );\n\t\tconst { togglePostTitleSelection } = dispatch( editorStore );\n\n\t\treturn {\n\t\t\tredo: dispatch( editorStore ).redo,\n\t\t\tundo: dispatch( editorStore ).undo,\n\t\t\tonHideKeyboard() {\n\t\t\t\tclearSelectedBlock();\n\t\t\t\ttogglePostTitleSelection( false );\n\t\t\t},\n\t\t\tinsertBlock,\n\t\t};\n\t} ),\n\twithViewportMatch( { isLargeViewport: 'medium' } ),\n] )( HeaderToolbar );\n"],"mappings":";;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AAKA,IAAAO,WAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;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AQ,CAAEV,aAAY,CAAC,CAACvF,IAAI;IAClCI,cAAcA,CAAA,EAAG;MAChB8F,kBAAkB,CAAC,CAAC;MACpBC,wBAAwB,CAAE,KAAM,CAAC;IAClC,CAAC;IACDhG;EACD,CAAC;AACF,CAAE,CAAC,EACH,IAAAiG,2BAAiB,EAAE;EAAEC,eAAe,EAAE;AAAS,CAAE,CAAC,CACjD,CAAC,CAAEzG,aAAc,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","_element","_compose","_data","_viewport","_i18n","_blockEditor","_components","_icons","_editor","_blocks","_reactNativeBridge","_style","_interopRequireDefault","_store","_jsxRuntime","shadowStyle","shadowOffset","width","height","shadowOpacity","shadowRadius","elevation","HeaderToolbar","hasRedo","hasUndo","redo","undo","showInserter","showKeyboardHideButton","insertBlock","onHideKeyboard","isRTL","noContentSelected","anchorNodeRef","useRef","containerStyle","usePreferredColorSchemeStyle","styles","borderTopWidth","StyleSheet","hairlineWidth","useEffect","onUndoSubscription","subscribeOnUndoPressed","onRedoSubscription","subscribeOnRedoPressed","remove","toggleUndoButton","toggleRedoButton","scrollViewRef","scrollToStart","Platform","isAndroid","current","scrollToEnd","scrollTo","x","onInsertBlock","useCallback","blockType","createBlock","undefined","source","inserterMethod","renderMediaButtons","jsxs","ToolbarGroup","children","jsx","ToolbarButton","title","__","icon","imageIcon","onClick","testID","extraProps","hint","videoIcon","galleryIcon","audioIcon","toolbarAriaLabel","shadowColor","showKeyboardButtonStyles","color","View","ref","accessibilityLabel","style","ScrollView","onContentSizeChange","horizontal","showsHorizontalScrollIndicator","keyboardShouldPersistTaps","alwaysBounceHorizontal","contentContainerStyle","Inserter","disabled","BlockToolbar","passedStyle","keyboardClose","_default","exports","default","compose","withSelect","select","getBlockRootClientId","getBlockSelectionEnd","hasInserterItems","hasSelectedBlock","blockEditorStore","getEditorSettings","editorStore","isAnyBlockSelected","hasEditorRedo","hasEditorUndo","editPostStore","getEditorMode","richEditingEnabled","isTextModeEnabled","getSettings","withDispatch","dispatch","clearSelectedBlock","togglePostTitleSelection","withViewportMatch","isLargeViewport"],"sources":["@wordpress/edit-post/src/components/header/header-toolbar/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { ScrollView, StyleSheet, View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { useCallback, useRef, useEffect, Platform } from '@wordpress/element';\nimport { compose, usePreferredColorSchemeStyle } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { withViewportMatch } from '@wordpress/viewport';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tInserter,\n\tBlockToolbar,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { ToolbarGroup, ToolbarButton } from '@wordpress/components';\nimport {\n\tkeyboardClose,\n\taudio as audioIcon,\n\tmedia as imageIcon,\n\tvideo as videoIcon,\n\tgallery as galleryIcon,\n} from '@wordpress/icons';\nimport { store as editorStore } from '@wordpress/editor';\nimport { createBlock } from '@wordpress/blocks';\nimport {\n\ttoggleUndoButton,\n\ttoggleRedoButton,\n\tsubscribeOnUndoPressed,\n\tsubscribeOnRedoPressed,\n} from '@wordpress/react-native-bridge';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\nimport { store as editPostStore } from '../../../store';\n\nconst shadowStyle = {\n\tshadowOffset: { width: 2, height: 2 },\n\tshadowOpacity: 1,\n\tshadowRadius: 6,\n\televation: 18,\n};\n\nfunction HeaderToolbar( {\n\thasRedo,\n\thasUndo,\n\tredo,\n\tundo,\n\tshowInserter,\n\tshowKeyboardHideButton,\n\tinsertBlock,\n\tonHideKeyboard,\n\tisRTL,\n\tnoContentSelected,\n} ) {\n\tconst anchorNodeRef = useRef();\n\n\tconst containerStyle = [\n\t\tusePreferredColorSchemeStyle(\n\t\t\tstyles[ 'header-toolbar__container' ],\n\t\t\tstyles[ 'header-toolbar__container--dark' ]\n\t\t),\n\t\t{ borderTopWidth: StyleSheet.hairlineWidth },\n\t];\n\n\tuseEffect( () => {\n\t\tconst onUndoSubscription = subscribeOnUndoPressed( undo );\n\t\tconst onRedoSubscription = subscribeOnRedoPressed( redo );\n\n\t\treturn () => {\n\t\t\tonUndoSubscription?.remove();\n\t\t\tonRedoSubscription?.remove();\n\t\t};\n\t}, [ undo, redo ] );\n\n\tuseEffect( () => {\n\t\ttoggleUndoButton( ! hasUndo );\n\t}, [ hasUndo ] );\n\n\tuseEffect( () => {\n\t\ttoggleRedoButton( ! hasRedo );\n\t}, [ hasRedo ] );\n\n\tconst scrollViewRef = useRef( null );\n\tconst scrollToStart = () => {\n\t\t// scrollview doesn't seem to automatically adjust to RTL on Android so, scroll to end when Android\n\t\tif ( Platform.isAndroid && isRTL ) {\n\t\t\tscrollViewRef.current.scrollToEnd();\n\t\t} else {\n\t\t\tscrollViewRef.current.scrollTo( { x: 0 } );\n\t\t}\n\t};\n\n\tconst onInsertBlock = useCallback(\n\t\t( blockType ) => () => {\n\t\t\tinsertBlock( createBlock( blockType ), undefined, undefined, true, {\n\t\t\t\tsource: 'inserter_menu',\n\t\t\t\tinserterMethod: 'quick-inserter',\n\t\t\t} );\n\t\t},\n\t\t[ insertBlock ]\n\t);\n\n\tconst renderMediaButtons = (\n\t\t<ToolbarGroup>\n\t\t\t<ToolbarButton\n\t\t\t\tkey=\"imageButton\"\n\t\t\t\ttitle={ __( 'Image' ) }\n\t\t\t\ticon={ imageIcon }\n\t\t\t\tonClick={ onInsertBlock( 'core/image' ) }\n\t\t\t\ttestID=\"insert-image-button\"\n\t\t\t\textraProps={ {\n\t\t\t\t\thint: __( 'Insert Image Block' ),\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<ToolbarButton\n\t\t\t\tkey=\"videoButton\"\n\t\t\t\ttitle={ __( 'Video' ) }\n\t\t\t\ticon={ videoIcon }\n\t\t\t\tonClick={ onInsertBlock( 'core/video' ) }\n\t\t\t\ttestID=\"insert-video-button\"\n\t\t\t\textraProps={ {\n\t\t\t\t\thint: __( 'Insert Video Block' ),\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<ToolbarButton\n\t\t\t\tkey=\"galleryButton\"\n\t\t\t\ttitle={ __( 'Gallery' ) }\n\t\t\t\ticon={ galleryIcon }\n\t\t\t\tonClick={ onInsertBlock( 'core/gallery' ) }\n\t\t\t\ttestID=\"insert-gallery-button\"\n\t\t\t\textraProps={ {\n\t\t\t\t\thint: __( 'Insert Gallery Block' ),\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<ToolbarButton\n\t\t\t\tkey=\"audioButton\"\n\t\t\t\ttitle={ __( 'Audio' ) }\n\t\t\t\ticon={ audioIcon }\n\t\t\t\tonClick={ onInsertBlock( 'core/audio' ) }\n\t\t\t\ttestID=\"insert-audio-button\"\n\t\t\t\textraProps={ {\n\t\t\t\t\thint: __( 'Insert Audio Block' ),\n\t\t\t\t} }\n\t\t\t/>\n\t\t</ToolbarGroup>\n\t);\n\n\t/* translators: accessibility text for the editor toolbar */\n\tconst toolbarAriaLabel = __( 'Document tools' );\n\n\tconst shadowColor = usePreferredColorSchemeStyle(\n\t\tstyles[ 'header-toolbar__keyboard-hide-shadow--light' ],\n\t\tstyles[ 'header-toolbar__keyboard-hide-shadow--dark' ]\n\t);\n\tconst showKeyboardButtonStyles = [\n\t\tusePreferredColorSchemeStyle(\n\t\t\tstyles[ 'header-toolbar__keyboard-hide-container' ],\n\t\t\tstyles[ 'header-toolbar__keyboard-hide-container--dark' ]\n\t\t),\n\t\tshadowStyle,\n\t\t{\n\t\t\tshadowColor: Platform.isAndroid\n\t\t\t\t? styles[ 'header-toolbar__keyboard-hide-shadow--solid' ].color\n\t\t\t\t: shadowColor.color,\n\t\t},\n\t];\n\n\treturn (\n\t\t<View\n\t\t\tref={ anchorNodeRef }\n\t\t\ttestID={ toolbarAriaLabel }\n\t\t\taccessibilityLabel={ toolbarAriaLabel }\n\t\t\tstyle={ containerStyle }\n\t\t>\n\t\t\t<ScrollView\n\t\t\t\tref={ scrollViewRef }\n\t\t\t\tonContentSizeChange={ scrollToStart }\n\t\t\t\thorizontal\n\t\t\t\tshowsHorizontalScrollIndicator={ false }\n\t\t\t\tkeyboardShouldPersistTaps=\"always\"\n\t\t\t\talwaysBounceHorizontal={ false }\n\t\t\t\tcontentContainerStyle={\n\t\t\t\t\tstyles[ 'header-toolbar__scrollable-content' ]\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t<Inserter disabled={ ! showInserter } />\n\n\t\t\t\t{ noContentSelected && renderMediaButtons }\n\t\t\t\t<BlockToolbar anchorNodeRef={ anchorNodeRef.current } />\n\t\t\t</ScrollView>\n\t\t\t{ showKeyboardHideButton && (\n\t\t\t\t<ToolbarGroup passedStyle={ showKeyboardButtonStyles }>\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\ttitle={ __( 'Hide keyboard' ) }\n\t\t\t\t\t\ticon={ keyboardClose }\n\t\t\t\t\t\tonClick={ onHideKeyboard }\n\t\t\t\t\t\textraProps={ {\n\t\t\t\t\t\t\thint: __( 'Tap to hide the keyboard' ),\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</ToolbarGroup>\n\t\t\t) }\n\t\t</View>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetBlockRootClientId,\n\t\t\tgetBlockSelectionEnd,\n\t\t\thasInserterItems,\n\t\t\thasSelectedBlock,\n\t\t} = select( blockEditorStore );\n\t\tconst { getEditorSettings } = select( editorStore );\n\t\tconst isAnyBlockSelected = hasSelectedBlock();\n\t\treturn {\n\t\t\thasRedo: select( editorStore ).hasEditorRedo(),\n\t\t\thasUndo: select( editorStore ).hasEditorUndo(),\n\t\t\t// This setting (richEditingEnabled) should not live in the block editor's setting.\n\t\t\tshowInserter:\n\t\t\t\tselect( editPostStore ).getEditorMode() === 'visual' &&\n\t\t\t\tgetEditorSettings().richEditingEnabled &&\n\t\t\t\thasInserterItems(\n\t\t\t\t\tgetBlockRootClientId( getBlockSelectionEnd() )\n\t\t\t\t),\n\t\t\tisTextModeEnabled:\n\t\t\t\tselect( editPostStore ).getEditorMode() === 'text',\n\t\t\tisRTL: select( blockEditorStore ).getSettings().isRTL,\n\t\t\tnoContentSelected: ! isAnyBlockSelected,\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { clearSelectedBlock, insertBlock } =\n\t\t\tdispatch( blockEditorStore );\n\t\tconst { togglePostTitleSelection } = dispatch( editorStore );\n\n\t\treturn {\n\t\t\tredo: dispatch( editorStore ).redo,\n\t\t\tundo: dispatch( editorStore ).undo,\n\t\t\tonHideKeyboard() {\n\t\t\t\tclearSelectedBlock();\n\t\t\t\ttogglePostTitleSelection( false );\n\t\t\t},\n\t\t\tinsertBlock,\n\t\t};\n\t} ),\n\twithViewportMatch( { isLargeViewport: 'medium' } ),\n] )( HeaderToolbar );\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AAKA,IAAAO,WAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AAOA,IAAAS,OAAA,GAAAT,OAAA;AACA,IAAAU,OAAA,GAAAV,OAAA;AACA,IAAAW,kBAAA,GAAAX,OAAA;AAUA,IAAAY,MAAA,GAAAC,sBAAA,CAAAb,OAAA;AACA,IAAAc,MAAA,GAAAd,OAAA;AAAwD,IAAAe,WAAA,GAAAf,OAAA;AAvCxD;AACA;AACA;;AAGA;AACA;AACA;;AA4BA;AACA;AACA;;AAIA,MAAMgB,WAAW,GAAG;EACnBC,YAAY,EAAE;IAAEC,KAAK,EAAE,CAAC;IAAEC,MAAM,EAAE;EAAE,CAAC;EACrCC,aAAa,EAAE,CAAC;EAChBC,YAAY,EAAE,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"__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = void 0;
8
- var _react = require("react");
9
8
  var _reactNative = require("react-native");
10
9
  var _element = require("@wordpress/element");
11
10
  require("@wordpress/editor");
12
11
  var _headerToolbar = _interopRequireDefault(require("./header-toolbar"));
12
+ var _jsxRuntime = require("react/jsx-runtime");
13
13
  /**
14
14
  * External dependencies
15
15
  */
@@ -50,7 +50,7 @@ class Header extends _element.Component {
50
50
  });
51
51
  }
52
52
  render() {
53
- return (0, _react.createElement)(_headerToolbar.default, {
53
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_headerToolbar.default, {
54
54
  showKeyboardHideButton: this.state.isKeyboardVisible
55
55
  });
56
56
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_element","_headerToolbar","_interopRequireDefault","Header","Component","constructor","arguments","keyboardDidShow","bind","keyboardDidHide","state","isKeyboardVisible","componentDidMount","keyboardShowSubscription","Keyboard","addListener","keyboardHideSubscription","componentWillUnmount","remove","setState","render","_react","createElement","default","showKeyboardHideButton","exports"],"sources":["@wordpress/edit-post/src/components/header/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { Keyboard } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport HeaderToolbar from './header-toolbar';\n\nexport default class Header extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.keyboardDidShow = this.keyboardDidShow.bind( this );\n\t\tthis.keyboardDidHide = this.keyboardDidHide.bind( this );\n\n\t\tthis.state = {\n\t\t\tisKeyboardVisible: false,\n\t\t};\n\t}\n\n\tcomponentDidMount() {\n\t\tthis.keyboardShowSubscription = Keyboard.addListener(\n\t\t\t'keyboardDidShow',\n\t\t\tthis.keyboardDidShow\n\t\t);\n\t\tthis.keyboardHideSubscription = Keyboard.addListener(\n\t\t\t'keyboardDidHide',\n\t\t\tthis.keyboardDidHide\n\t\t);\n\t}\n\n\tcomponentWillUnmount() {\n\t\tthis.keyboardShowSubscription.remove();\n\t\tthis.keyboardHideSubscription.remove();\n\t}\n\n\tkeyboardDidShow() {\n\t\tthis.setState( { isKeyboardVisible: true } );\n\t}\n\n\tkeyboardDidHide() {\n\t\tthis.setState( { isKeyboardVisible: false } );\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<HeaderToolbar\n\t\t\t\tshowKeyboardHideButton={ this.state.isKeyboardVisible }\n\t\t\t/>\n\t\t);\n\t}\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACAA,OAAA;AAKA,IAAAE,cAAA,GAAAC,sBAAA,CAAAH,OAAA;AAdA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;;AAGe,MAAMI,MAAM,SAASC,kBAAS,CAAC;EAC7CC,WAAWA,CAAA,EAAG;IACb,KAAK,CAAE,GAAGC,SAAU,CAAC;IAErB,IAAI,CAACC,eAAe,GAAG,IAAI,CAACA,eAAe,CAACC,IAAI,CAAE,IAAK,CAAC;IACxD,IAAI,CAACC,eAAe,GAAG,IAAI,CAACA,eAAe,CAACD,IAAI,CAAE,IAAK,CAAC;IAExD,IAAI,CAACE,KAAK,GAAG;MACZC,iBAAiB,EAAE;IACpB,CAAC;EACF;EAEAC,iBAAiBA,CAAA,EAAG;IACnB,IAAI,CAACC,wBAAwB,GAAGC,qBAAQ,CAACC,WAAW,CACnD,iBAAiB,EACjB,IAAI,CAACR,eACN,CAAC;IACD,IAAI,CAACS,wBAAwB,GAAGF,qBAAQ,CAACC,WAAW,CACnD,iBAAiB,EACjB,IAAI,CAACN,eACN,CAAC;EACF;EAEAQ,oBAAoBA,CAAA,EAAG;IACtB,IAAI,CAACJ,wBAAwB,CAACK,MAAM,CAAC,CAAC;IACtC,IAAI,CAACF,wBAAwB,CAACE,MAAM,CAAC,CAAC;EACvC;EAEAX,eAAeA,CAAA,EAAG;IACjB,IAAI,CAACY,QAAQ,CAAE;MAAER,iBAAiB,EAAE;IAAK,CAAE,CAAC;EAC7C;EAEAF,eAAeA,CAAA,EAAG;IACjB,IAAI,CAACU,QAAQ,CAAE;MAAER,iBAAiB,EAAE;IAAM,CAAE,CAAC;EAC9C;EAEAS,MAAMA,CAAA,EAAG;IACR,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACrB,cAAA,CAAAsB,OAAa;MACbC,sBAAsB,EAAG,IAAI,CAACd,KAAK,CAACC;IAAmB,CACvD,CAAC;EAEJ;AACD;AAACc,OAAA,CAAAF,OAAA,GAAApB,MAAA","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","_element","_headerToolbar","_interopRequireDefault","_jsxRuntime","Header","Component","constructor","arguments","keyboardDidShow","bind","keyboardDidHide","state","isKeyboardVisible","componentDidMount","keyboardShowSubscription","Keyboard","addListener","keyboardHideSubscription","componentWillUnmount","remove","setState","render","jsx","default","showKeyboardHideButton","exports"],"sources":["@wordpress/edit-post/src/components/header/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { Keyboard } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport HeaderToolbar from './header-toolbar';\n\nexport default class Header extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.keyboardDidShow = this.keyboardDidShow.bind( this );\n\t\tthis.keyboardDidHide = this.keyboardDidHide.bind( this );\n\n\t\tthis.state = {\n\t\t\tisKeyboardVisible: false,\n\t\t};\n\t}\n\n\tcomponentDidMount() {\n\t\tthis.keyboardShowSubscription = Keyboard.addListener(\n\t\t\t'keyboardDidShow',\n\t\t\tthis.keyboardDidShow\n\t\t);\n\t\tthis.keyboardHideSubscription = Keyboard.addListener(\n\t\t\t'keyboardDidHide',\n\t\t\tthis.keyboardDidHide\n\t\t);\n\t}\n\n\tcomponentWillUnmount() {\n\t\tthis.keyboardShowSubscription.remove();\n\t\tthis.keyboardHideSubscription.remove();\n\t}\n\n\tkeyboardDidShow() {\n\t\tthis.setState( { isKeyboardVisible: true } );\n\t}\n\n\tkeyboardDidHide() {\n\t\tthis.setState( { isKeyboardVisible: false } );\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<HeaderToolbar\n\t\t\t\tshowKeyboardHideButton={ this.state.isKeyboardVisible }\n\t\t\t/>\n\t\t);\n\t}\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACAA,OAAA;AAKA,IAAAE,cAAA,GAAAC,sBAAA,CAAAH,OAAA;AAA6C,IAAAI,WAAA,GAAAJ,OAAA;AAd7C;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;;AAGe,MAAMK,MAAM,SAASC,kBAAS,CAAC;EAC7CC,WAAWA,CAAA,EAAG;IACb,KAAK,CAAE,GAAGC,SAAU,CAAC;IAErB,IAAI,CAACC,eAAe,GAAG,IAAI,CAACA,eAAe,CAACC,IAAI,CAAE,IAAK,CAAC;IACxD,IAAI,CAACC,eAAe,GAAG,IAAI,CAACA,eAAe,CAACD,IAAI,CAAE,IAAK,CAAC;IAExD,IAAI,CAACE,KAAK,GAAG;MACZC,iBAAiB,EAAE;IACpB,CAAC;EACF;EAEAC,iBAAiBA,CAAA,EAAG;IACnB,IAAI,CAACC,wBAAwB,GAAGC,qBAAQ,CAACC,WAAW,CACnD,iBAAiB,EACjB,IAAI,CAACR,eACN,CAAC;IACD,IAAI,CAACS,wBAAwB,GAAGF,qBAAQ,CAACC,WAAW,CACnD,iBAAiB,EACjB,IAAI,CAACN,eACN,CAAC;EACF;EAEAQ,oBAAoBA,CAAA,EAAG;IACtB,IAAI,CAACJ,wBAAwB,CAACK,MAAM,CAAC,CAAC;IACtC,IAAI,CAACF,wBAAwB,CAACE,MAAM,CAAC,CAAC;EACvC;EAEAX,eAAeA,CAAA,EAAG;IACjB,IAAI,CAACY,QAAQ,CAAE;MAAER,iBAAiB,EAAE;IAAK,CAAE,CAAC;EAC7C;EAEAF,eAAeA,CAAA,EAAG;IACjB,IAAI,CAACU,QAAQ,CAAE;MAAER,iBAAiB,EAAE;IAAM,CAAE,CAAC;EAC9C;EAEAS,MAAMA,CAAA,EAAG;IACR,oBACC,IAAAlB,WAAA,CAAAmB,GAAA,EAACrB,cAAA,CAAAsB,OAAa;MACbC,sBAAsB,EAAG,IAAI,CAACb,KAAK,CAACC;IAAmB,CACvD,CAAC;EAEJ;AACD;AAACa,OAAA,CAAAF,OAAA,GAAAnB,MAAA","ignoreList":[]}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = InitPatternModal;
7
- var _react = require("react");
8
7
  var _data = require("@wordpress/data");
9
8
  var _i18n = require("@wordpress/i18n");
10
9
  var _components = require("@wordpress/components");
@@ -12,6 +11,7 @@ var _element = require("@wordpress/element");
12
11
  var _editor = require("@wordpress/editor");
13
12
  var _blockEditor = require("@wordpress/block-editor");
14
13
  var _lockUnlock = require("../../lock-unlock");
14
+ var _jsxRuntime = require("react/jsx-runtime");
15
15
  /**
16
16
  * WordPress dependencies
17
17
  */
@@ -53,47 +53,54 @@ function InitPatternModal() {
53
53
  if (postType !== 'wp_block' || !isNewPost) {
54
54
  return null;
55
55
  }
56
- return (0, _react.createElement)(_react.Fragment, null, isModalOpen && (0, _react.createElement)(_components.Modal, {
57
- title: (0, _i18n.__)('Create pattern'),
58
- onRequestClose: () => {
59
- setIsModalOpen(false);
60
- },
61
- overlayClassName: "reusable-blocks-menu-items__convert-modal"
62
- }, (0, _react.createElement)("form", {
63
- onSubmit: event => {
64
- event.preventDefault();
65
- setIsModalOpen(false);
66
- editPost({
67
- title,
68
- meta: {
69
- wp_pattern_sync_status: syncType
70
- }
71
- });
72
- }
73
- }, (0, _react.createElement)(_components.__experimentalVStack, {
74
- spacing: "5"
75
- }, (0, _react.createElement)(_components.TextControl, {
76
- label: (0, _i18n.__)('Name'),
77
- value: title,
78
- onChange: setTitle,
79
- placeholder: (0, _i18n.__)('My pattern'),
80
- className: "patterns-create-modal__name-input",
81
- __nextHasNoMarginBottom: true,
82
- __next40pxDefaultSize: true
83
- }), (0, _react.createElement)(ReusableBlocksRenameHint, null), (0, _react.createElement)(_components.ToggleControl, {
84
- label: (0, _i18n._x)('Synced', 'Option that makes an individual pattern synchronized'),
85
- help: (0, _i18n.__)('Sync this pattern across multiple locations.'),
86
- checked: !syncType,
87
- onChange: () => {
88
- setSyncType(!syncType ? 'unsynced' : undefined);
89
- }
90
- }), (0, _react.createElement)(_components.__experimentalHStack, {
91
- justify: "right"
92
- }, (0, _react.createElement)(_components.Button, {
93
- variant: "primary",
94
- type: "submit",
95
- disabled: !title,
96
- __experimentalIsFocusable: true
97
- }, (0, _i18n.__)('Create')))))));
56
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
57
+ children: isModalOpen && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Modal, {
58
+ title: (0, _i18n.__)('Create pattern'),
59
+ onRequestClose: () => {
60
+ setIsModalOpen(false);
61
+ },
62
+ overlayClassName: "reusable-blocks-menu-items__convert-modal",
63
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("form", {
64
+ onSubmit: event => {
65
+ event.preventDefault();
66
+ setIsModalOpen(false);
67
+ editPost({
68
+ title,
69
+ meta: {
70
+ wp_pattern_sync_status: syncType
71
+ }
72
+ });
73
+ },
74
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalVStack, {
75
+ spacing: "5",
76
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.TextControl, {
77
+ label: (0, _i18n.__)('Name'),
78
+ value: title,
79
+ onChange: setTitle,
80
+ placeholder: (0, _i18n.__)('My pattern'),
81
+ className: "patterns-create-modal__name-input",
82
+ __nextHasNoMarginBottom: true,
83
+ __next40pxDefaultSize: true
84
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(ReusableBlocksRenameHint, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToggleControl, {
85
+ label: (0, _i18n._x)('Synced', 'Option that makes an individual pattern synchronized'),
86
+ help: (0, _i18n.__)('Sync this pattern across multiple locations.'),
87
+ checked: !syncType,
88
+ onChange: () => {
89
+ setSyncType(!syncType ? 'unsynced' : undefined);
90
+ }
91
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalHStack, {
92
+ justify: "right",
93
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
94
+ variant: "primary",
95
+ type: "submit",
96
+ disabled: !title,
97
+ __experimentalIsFocusable: true,
98
+ children: (0, _i18n.__)('Create')
99
+ })
100
+ })]
101
+ })
102
+ })
103
+ })
104
+ });
98
105
  }
99
106
  //# sourceMappingURL=index.js.map