@wordpress/block-library 9.37.2-next.ba3aee3a2.0 → 9.38.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 (238) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/build/audio/index.cjs +16 -8
  3. package/build/audio/index.cjs.map +2 -2
  4. package/build/block-keyboard-shortcuts/index.cjs +2 -4
  5. package/build/block-keyboard-shortcuts/index.cjs.map +2 -2
  6. package/build/button/index.cjs +17 -8
  7. package/build/button/index.cjs.map +2 -2
  8. package/build/code/index.cjs +3 -1
  9. package/build/code/index.cjs.map +2 -2
  10. package/build/comments-title/edit.cjs +10 -6
  11. package/build/comments-title/edit.cjs.map +2 -2
  12. package/build/cover/index.cjs +20 -10
  13. package/build/cover/index.cjs.map +2 -2
  14. package/build/details/index.cjs +3 -1
  15. package/build/details/index.cjs.map +2 -2
  16. package/build/file/index.cjs +19 -9
  17. package/build/file/index.cjs.map +2 -2
  18. package/build/heading/block.json +1 -3
  19. package/build/heading/deprecated.cjs +101 -5
  20. package/build/heading/deprecated.cjs.map +3 -3
  21. package/build/heading/edit.cjs +20 -41
  22. package/build/heading/edit.cjs.map +3 -3
  23. package/build/heading/index.cjs +3 -1
  24. package/build/heading/index.cjs.map +2 -2
  25. package/build/heading/save.cjs +2 -16
  26. package/build/heading/save.cjs.map +3 -3
  27. package/build/heading/transforms.cjs +16 -3
  28. package/build/heading/transforms.cjs.map +2 -2
  29. package/build/image/image.cjs +3 -3
  30. package/build/image/image.cjs.map +2 -2
  31. package/build/image/index.cjs +33 -17
  32. package/build/image/index.cjs.map +2 -2
  33. package/build/list-item/index.cjs +3 -1
  34. package/build/list-item/index.cjs.map +2 -2
  35. package/build/media-text/index.cjs +30 -15
  36. package/build/media-text/index.cjs.map +2 -2
  37. package/build/more/block.json +1 -0
  38. package/build/more/index.cjs +3 -1
  39. package/build/more/index.cjs.map +2 -2
  40. package/build/navigation/edit/index.cjs +7 -6
  41. package/build/navigation/edit/index.cjs.map +2 -2
  42. package/build/navigation/edit/responsive-wrapper.cjs +7 -4
  43. package/build/navigation/edit/responsive-wrapper.cjs.map +2 -2
  44. package/build/navigation/edit/use-create-overlay.cjs +2 -0
  45. package/build/navigation/edit/use-create-overlay.cjs.map +2 -2
  46. package/build/navigation-link/edit.cjs +8 -58
  47. package/build/navigation-link/edit.cjs.map +3 -3
  48. package/build/navigation-link/index.cjs +13 -8
  49. package/build/navigation-link/index.cjs.map +2 -2
  50. package/build/navigation-link/shared/index.cjs +11 -2
  51. package/build/navigation-link/shared/index.cjs.map +2 -2
  52. package/build/navigation-link/shared/invalid-draft-display.cjs +82 -0
  53. package/build/navigation-link/shared/invalid-draft-display.cjs.map +7 -0
  54. package/build/navigation-link/shared/use-enable-link-status-validation.cjs +50 -0
  55. package/build/navigation-link/shared/use-enable-link-status-validation.cjs.map +7 -0
  56. package/build/navigation-link/shared/use-is-invalid-link.cjs +64 -0
  57. package/build/navigation-link/shared/use-is-invalid-link.cjs.map +7 -0
  58. package/build/navigation-overlay-close/block.json +1 -4
  59. package/build/navigation-overlay-close/index.cjs +3 -25
  60. package/build/navigation-overlay-close/index.cjs.map +3 -3
  61. package/build/navigation-submenu/edit.cjs +36 -18
  62. package/build/navigation-submenu/edit.cjs.map +2 -2
  63. package/build/navigation-submenu/index.cjs +15 -8
  64. package/build/navigation-submenu/index.cjs.map +2 -2
  65. package/build/nextpage/block.json +1 -0
  66. package/build/paragraph/index.cjs +3 -1
  67. package/build/paragraph/index.cjs.map +2 -2
  68. package/build/paragraph/transforms.cjs +14 -3
  69. package/build/paragraph/transforms.cjs.map +3 -3
  70. package/build/preformatted/index.cjs +3 -1
  71. package/build/preformatted/index.cjs.map +2 -2
  72. package/build/pullquote/index.cjs +7 -3
  73. package/build/pullquote/index.cjs.map +2 -2
  74. package/build/search/index.cjs +10 -5
  75. package/build/search/index.cjs.map +2 -2
  76. package/build/social-link/index.cjs +13 -7
  77. package/build/social-link/index.cjs.map +2 -2
  78. package/build/table-of-contents/hooks.cjs +1 -1
  79. package/build/table-of-contents/hooks.cjs.map +1 -1
  80. package/build/template-part/edit/utils/get-template-part-icon.cjs.map +1 -1
  81. package/build/utils/is-within-overlay.cjs +52 -0
  82. package/build/utils/is-within-overlay.cjs.map +7 -0
  83. package/build/verse/index.cjs +3 -1
  84. package/build/verse/index.cjs.map +2 -2
  85. package/build/video/index.cjs +20 -10
  86. package/build/video/index.cjs.map +2 -2
  87. package/build-module/audio/index.mjs +16 -8
  88. package/build-module/audio/index.mjs.map +2 -2
  89. package/build-module/block-keyboard-shortcuts/index.mjs +2 -4
  90. package/build-module/block-keyboard-shortcuts/index.mjs.map +2 -2
  91. package/build-module/button/index.mjs +17 -8
  92. package/build-module/button/index.mjs.map +2 -2
  93. package/build-module/code/index.mjs +3 -1
  94. package/build-module/code/index.mjs.map +2 -2
  95. package/build-module/comments-title/edit.mjs +10 -6
  96. package/build-module/comments-title/edit.mjs.map +2 -2
  97. package/build-module/cover/index.mjs +20 -10
  98. package/build-module/cover/index.mjs.map +2 -2
  99. package/build-module/details/index.mjs +3 -1
  100. package/build-module/details/index.mjs.map +2 -2
  101. package/build-module/file/index.mjs +19 -9
  102. package/build-module/file/index.mjs.map +2 -2
  103. package/build-module/heading/block.json +1 -3
  104. package/build-module/heading/deprecated.mjs +101 -5
  105. package/build-module/heading/deprecated.mjs.map +2 -2
  106. package/build-module/heading/edit.mjs +22 -46
  107. package/build-module/heading/edit.mjs.map +2 -2
  108. package/build-module/heading/index.mjs +3 -1
  109. package/build-module/heading/index.mjs.map +2 -2
  110. package/build-module/heading/save.mjs +2 -6
  111. package/build-module/heading/save.mjs.map +2 -2
  112. package/build-module/heading/transforms.mjs +16 -3
  113. package/build-module/heading/transforms.mjs.map +2 -2
  114. package/build-module/image/image.mjs +3 -3
  115. package/build-module/image/image.mjs.map +2 -2
  116. package/build-module/image/index.mjs +33 -17
  117. package/build-module/image/index.mjs.map +2 -2
  118. package/build-module/list-item/index.mjs +3 -1
  119. package/build-module/list-item/index.mjs.map +2 -2
  120. package/build-module/media-text/index.mjs +30 -15
  121. package/build-module/media-text/index.mjs.map +2 -2
  122. package/build-module/more/block.json +1 -0
  123. package/build-module/more/index.mjs +3 -1
  124. package/build-module/more/index.mjs.map +2 -2
  125. package/build-module/navigation/edit/index.mjs +7 -6
  126. package/build-module/navigation/edit/index.mjs.map +2 -2
  127. package/build-module/navigation/edit/responsive-wrapper.mjs +7 -4
  128. package/build-module/navigation/edit/responsive-wrapper.mjs.map +2 -2
  129. package/build-module/navigation/edit/use-create-overlay.mjs +2 -0
  130. package/build-module/navigation/edit/use-create-overlay.mjs.map +2 -2
  131. package/build-module/navigation-link/edit.mjs +12 -60
  132. package/build-module/navigation-link/edit.mjs.map +2 -2
  133. package/build-module/navigation-link/index.mjs +13 -8
  134. package/build-module/navigation-link/index.mjs.map +2 -2
  135. package/build-module/navigation-link/shared/index.mjs +7 -1
  136. package/build-module/navigation-link/shared/index.mjs.map +2 -2
  137. package/build-module/navigation-link/shared/invalid-draft-display.mjs +47 -0
  138. package/build-module/navigation-link/shared/invalid-draft-display.mjs.map +7 -0
  139. package/build-module/navigation-link/shared/use-enable-link-status-validation.mjs +25 -0
  140. package/build-module/navigation-link/shared/use-enable-link-status-validation.mjs.map +7 -0
  141. package/build-module/navigation-link/shared/use-is-invalid-link.mjs +39 -0
  142. package/build-module/navigation-link/shared/use-is-invalid-link.mjs.map +7 -0
  143. package/build-module/navigation-overlay-close/block.json +1 -4
  144. package/build-module/navigation-overlay-close/index.mjs +3 -25
  145. package/build-module/navigation-overlay-close/index.mjs.map +2 -2
  146. package/build-module/navigation-submenu/edit.mjs +40 -19
  147. package/build-module/navigation-submenu/edit.mjs.map +2 -2
  148. package/build-module/navigation-submenu/index.mjs +15 -8
  149. package/build-module/navigation-submenu/index.mjs.map +2 -2
  150. package/build-module/nextpage/block.json +1 -0
  151. package/build-module/paragraph/index.mjs +3 -1
  152. package/build-module/paragraph/index.mjs.map +2 -2
  153. package/build-module/paragraph/transforms.mjs +2 -1
  154. package/build-module/paragraph/transforms.mjs.map +2 -2
  155. package/build-module/preformatted/index.mjs +3 -1
  156. package/build-module/preformatted/index.mjs.map +2 -2
  157. package/build-module/pullquote/index.mjs +7 -3
  158. package/build-module/pullquote/index.mjs.map +2 -2
  159. package/build-module/search/index.mjs +10 -5
  160. package/build-module/search/index.mjs.map +2 -2
  161. package/build-module/social-link/index.mjs +13 -7
  162. package/build-module/social-link/index.mjs.map +2 -2
  163. package/build-module/table-of-contents/hooks.mjs +1 -1
  164. package/build-module/table-of-contents/hooks.mjs.map +1 -1
  165. package/build-module/template-part/edit/utils/get-template-part-icon.mjs.map +1 -1
  166. package/build-module/utils/is-within-overlay.mjs +27 -0
  167. package/build-module/utils/is-within-overlay.mjs.map +7 -0
  168. package/build-module/verse/index.mjs +3 -1
  169. package/build-module/verse/index.mjs.map +2 -2
  170. package/build-module/video/index.mjs +20 -10
  171. package/build-module/video/index.mjs.map +2 -2
  172. package/build-style/navigation/style-rtl.css +1 -16
  173. package/build-style/navigation/style.css +1 -16
  174. package/build-style/style-rtl.css +1 -16
  175. package/build-style/style.css +1 -16
  176. package/package.json +37 -38
  177. package/src/audio/index.js +13 -7
  178. package/src/block-keyboard-shortcuts/index.js +4 -7
  179. package/src/breadcrumbs/index.php +6 -3
  180. package/src/button/index.js +15 -8
  181. package/src/code/index.js +2 -1
  182. package/src/comments-title/edit.js +10 -7
  183. package/src/comments-title/index.php +7 -8
  184. package/src/cover/index.js +17 -8
  185. package/src/details/index.js +2 -1
  186. package/src/file/index.js +15 -8
  187. package/src/heading/block.json +1 -3
  188. package/src/heading/deprecated.js +118 -5
  189. package/src/heading/edit.js +6 -32
  190. package/src/heading/edit.native.js +17 -2
  191. package/src/heading/index.js +2 -1
  192. package/src/heading/save.js +2 -11
  193. package/src/heading/transforms.js +16 -3
  194. package/src/image/image.js +38 -40
  195. package/src/image/index.js +29 -16
  196. package/src/list-item/index.js +2 -1
  197. package/src/media-text/index.js +27 -14
  198. package/src/more/block.json +1 -0
  199. package/src/more/index.js +2 -1
  200. package/src/navigation/edit/index.js +9 -4
  201. package/src/navigation/edit/responsive-wrapper.js +15 -8
  202. package/src/navigation/edit/test/use-create-overlay.js +12 -0
  203. package/src/navigation/edit/use-create-overlay.js +2 -0
  204. package/src/navigation/index.php +74 -24
  205. package/src/navigation/style.scss +2 -18
  206. package/src/navigation-link/edit.js +11 -97
  207. package/src/navigation-link/index.js +13 -8
  208. package/src/navigation-link/index.php +17 -29
  209. package/src/navigation-link/shared/helpers.php +46 -0
  210. package/src/navigation-link/shared/index.js +3 -0
  211. package/src/navigation-link/shared/invalid-draft-display.js +63 -0
  212. package/src/navigation-link/shared/test/use-enable-link-status-validation.test.js +127 -0
  213. package/src/navigation-link/shared/use-enable-link-status-validation.js +40 -0
  214. package/src/navigation-link/shared/use-is-invalid-link.js +72 -0
  215. package/src/navigation-overlay-close/block.json +1 -4
  216. package/src/navigation-overlay-close/index.js +2 -37
  217. package/src/navigation-overlay-close/index.php +37 -1
  218. package/src/navigation-submenu/edit.js +49 -24
  219. package/src/navigation-submenu/index.js +13 -8
  220. package/src/navigation-submenu/index.php +25 -18
  221. package/src/nextpage/block.json +1 -0
  222. package/src/paragraph/index.js +2 -1
  223. package/src/paragraph/transforms.js +3 -1
  224. package/src/preformatted/index.js +2 -1
  225. package/src/pullquote/index.js +5 -3
  226. package/src/query-title/index.php +2 -2
  227. package/src/search/index.js +7 -5
  228. package/src/social-link/index.js +12 -7
  229. package/src/table-of-contents/hooks.js +1 -1
  230. package/src/template-part/edit/utils/get-template-part-icon.js +1 -1
  231. package/src/utils/is-within-overlay.js +54 -0
  232. package/src/verse/index.js +2 -1
  233. package/src/video/index.js +17 -9
  234. package/build/navigation-overlay-close/save.cjs +0 -67
  235. package/build/navigation-overlay-close/save.cjs.map +0 -7
  236. package/build-module/navigation-overlay-close/save.mjs +0 -46
  237. package/build-module/navigation-overlay-close/save.mjs.map +0 -7
  238. package/src/navigation-overlay-close/save.js +0 -44
@@ -6,7 +6,9 @@ import { createBlock, getBlockAttributes } from '@wordpress/blocks';
6
6
  /**
7
7
  * Internal dependencies
8
8
  */
9
- import { name } from './block.json';
9
+ import metadata from './block.json';
10
+
11
+ const { name } = metadata;
10
12
 
11
13
  const transforms = {
12
14
  from: [
@@ -48,7 +48,8 @@ if ( window.__experimentalContentOnlyInspectorFields ) {
48
48
  {
49
49
  id: 'content',
50
50
  label: __( 'Content' ),
51
- type: 'richtext',
51
+ type: 'text',
52
+ Edit: 'rich-text', // TODO: replace with custom component
52
53
  },
53
54
  ];
54
55
  settings[ formKey ] = {
@@ -45,16 +45,18 @@ if ( window.__experimentalContentOnlyInspectorFields ) {
45
45
  {
46
46
  id: 'value',
47
47
  label: __( 'Content' ),
48
- type: 'richtext',
48
+ type: 'text',
49
+ Edit: 'rich-text', // TODO: replace with custom component
49
50
  },
50
51
  {
51
52
  id: 'citation',
52
53
  label: __( 'Citation' ),
53
- type: 'richtext',
54
+ type: 'text',
55
+ Edit: 'rich-text', // TODO: replace with custom component
54
56
  },
55
57
  ];
56
58
  settings[ formKey ] = {
57
- fields: [ 'value' ],
59
+ fields: [ 'value', 'citation' ],
58
60
  };
59
61
  }
60
62
 
@@ -48,7 +48,7 @@ function render_block_core_query_title( $attributes, $content, $block ) {
48
48
  if ( isset( $attributes['showSearchTerm'] ) && $attributes['showSearchTerm'] ) {
49
49
  $title = sprintf(
50
50
  /* translators: %s is the search term. */
51
- __( 'Search results for: "%s"' ),
51
+ __( 'Search results for: “%s”' ),
52
52
  get_search_query()
53
53
  );
54
54
  }
@@ -66,7 +66,7 @@ function render_block_core_query_title( $attributes, $content, $block ) {
66
66
  if ( $show_prefix ) {
67
67
  $title = sprintf(
68
68
  /* translators: %s is the post type name. */
69
- __( 'Post Type: "%s"' ),
69
+ __( 'Post Type: “%s”' ),
70
70
  $post_type_name
71
71
  );
72
72
  } else {
@@ -35,22 +35,24 @@ if ( window.__experimentalContentOnlyInspectorFields ) {
35
35
  {
36
36
  id: 'label',
37
37
  label: __( 'Label' ),
38
- type: 'richtext',
39
- shownByDefault: true,
38
+ type: 'text',
39
+ Edit: 'rich-text', // TODO: replace with custom component
40
40
  },
41
41
  {
42
42
  id: 'buttonText',
43
43
  label: __( 'Button text' ),
44
- type: 'richtext',
44
+ type: 'text',
45
+ Edit: 'rich-text', // TODO: replace with custom component
45
46
  },
46
47
  {
47
48
  id: 'placeholder',
48
49
  label: __( 'Placeholder' ),
49
- type: 'richtext',
50
+ type: 'text',
51
+ Edit: 'rich-text', // TODO: replace with custom component
50
52
  },
51
53
  ];
52
54
  settings[ formKey ] = {
53
- fields: [ 'label' ],
55
+ fields: [ 'label', 'buttonText', 'placeholder' ],
54
56
  };
55
57
  }
56
58
 
@@ -31,20 +31,25 @@ if ( window.__experimentalContentOnlyInspectorFields ) {
31
31
  {
32
32
  id: 'link',
33
33
  label: __( 'Link' ),
34
- type: 'link',
35
- mapping: {
36
- href: 'url',
37
- rel: 'rel',
38
- },
34
+ type: 'url',
35
+ Edit: 'link', // TODO: replace with custom component
36
+ getValue: ( { item } ) => ( {
37
+ url: item.url,
38
+ rel: item.rel,
39
+ } ),
40
+ setValue: ( { value } ) => ( {
41
+ url: value.url,
42
+ rel: value.rel,
43
+ } ),
39
44
  },
40
45
  {
41
46
  id: 'label',
42
47
  label: __( 'Label' ),
43
- type: 'richtext',
48
+ type: 'text',
44
49
  },
45
50
  ];
46
51
  settings[ formKey ] = {
47
- fields: [ 'link' ],
52
+ fields: [ 'link', 'label' ],
48
53
  };
49
54
  }
50
55
 
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import fastDeepEqual from 'fast-deep-equal/es6';
4
+ import fastDeepEqual from 'fast-deep-equal/es6/index.js';
5
5
 
6
6
  /**
7
7
  * WordPress dependencies
@@ -12,7 +12,7 @@ import {
12
12
  /**
13
13
  * Helper function to retrieve the corresponding icon by area name or icon name.
14
14
  *
15
- * @param {string} areaOrIconName The area name (e.g., 'header', 'overlay') or icon name (e.g., 'menu').
15
+ * @param {string} areaOrIconName The area name (e.g., 'header', 'navigation-overlay') or icon name (e.g., 'menu').
16
16
  *
17
17
  * @return {Object} The corresponding icon.
18
18
  */
@@ -0,0 +1,54 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { select } from '@wordpress/data';
5
+ import { store as coreStore } from '@wordpress/core-data';
6
+
7
+ /**
8
+ * Internal dependencies
9
+ */
10
+ import { NAVIGATION_OVERLAY_TEMPLATE_PART_AREA } from '../navigation/constants';
11
+
12
+ /**
13
+ * Checks if the current editing context is within a navigation overlay template part.
14
+ *
15
+ * This utility exists because @wordpress/block-library cannot depend on @wordpress/editor
16
+ * as a package dependency. Blocks can be loaded into non-post block editors, so we must
17
+ * access the 'core/editor' store by string literal rather than importing it.
18
+ *
19
+ * React components should wrap this in useSelect for reactivity. Non-React contexts
20
+ * (like filter callbacks) can call this directly.
21
+ *
22
+ * @return {boolean} True if editing a navigation overlay template part, false otherwise.
23
+ */
24
+ export function isWithinNavigationOverlay() {
25
+ // @wordpress/block-library should not depend on @wordpress/editor.
26
+ // Blocks can be loaded into a *non-post* block editor, so to avoid
27
+ // declaring @wordpress/editor as a dependency, we must access its
28
+ // store by string.
29
+ // eslint-disable-next-line @wordpress/data-no-store-string-literals
30
+ const editorStore = select( 'core/editor' );
31
+
32
+ // Return false if the editor store is not available.
33
+ if ( ! editorStore ) {
34
+ return false;
35
+ }
36
+
37
+ const { getCurrentPostType, getCurrentPostId } = editorStore;
38
+ const { getEditedEntityRecord } = select( coreStore );
39
+
40
+ const postType = getCurrentPostType?.();
41
+ const postId = getCurrentPostId?.();
42
+
43
+ if ( postType === 'wp_template_part' && postId ) {
44
+ const templatePart = getEditedEntityRecord(
45
+ 'postType',
46
+ 'wp_template_part',
47
+ postId
48
+ );
49
+
50
+ return templatePart?.area === NAVIGATION_OVERLAY_TEMPLATE_PART_AREA;
51
+ }
52
+
53
+ return false;
54
+ }
@@ -50,7 +50,8 @@ if ( window.__experimentalContentOnlyInspectorFields ) {
50
50
  {
51
51
  id: 'content',
52
52
  label: __( 'Content' ),
53
- type: 'richtext',
53
+ type: 'text',
54
+ Edit: 'rich-text', // TODO: replace with custom component
54
55
  },
55
56
  ];
56
57
  settings[ formKey ] = {
@@ -43,25 +43,33 @@ if ( window.__experimentalContentOnlyInspectorFields ) {
43
43
  id: 'video',
44
44
  label: __( 'Video' ),
45
45
  type: 'media',
46
- mapping: {
47
- id: 'id',
48
- url: 'src',
49
- caption: 'caption',
50
- poster: 'poster',
51
- },
52
- args: {
46
+ Edit: {
47
+ control: 'media', // TODO: replace with custom component
53
48
  allowedTypes: [ 'video' ],
54
49
  multiple: false,
55
50
  },
51
+ getValue: ( { item } ) => ( {
52
+ id: item.id,
53
+ url: item.src,
54
+ caption: item.caption,
55
+ poster: item.poster,
56
+ } ),
57
+ setValue: ( { value } ) => ( {
58
+ id: value.id,
59
+ src: value.url,
60
+ caption: value.caption,
61
+ poster: value.poster,
62
+ } ),
56
63
  },
57
64
  {
58
65
  id: 'caption',
59
66
  label: __( 'Caption' ),
60
- type: 'richtext',
67
+ type: 'text',
68
+ Edit: 'rich-text', // TODO: replace with custom component
61
69
  },
62
70
  ];
63
71
  settings[ formKey ] = {
64
- fields: [ 'video' ],
72
+ fields: [ 'video', 'caption' ],
65
73
  };
66
74
  }
67
75
 
@@ -1,67 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // packages/block-library/src/navigation-overlay-close/save.js
21
- var save_exports = {};
22
- __export(save_exports, {
23
- default: () => NavigationOverlayCloseSave
24
- });
25
- module.exports = __toCommonJS(save_exports);
26
- var import_block_editor = require("@wordpress/block-editor");
27
- var import_jsx_runtime = require("react/jsx-runtime");
28
- var saveBlockProps = import_block_editor.useBlockProps.save;
29
- function NavigationOverlayCloseSave({ attributes }) {
30
- const { displayMode, text } = attributes;
31
- const showIcon = displayMode === "icon" || displayMode === "both";
32
- const showText = displayMode === "text" || displayMode === "both";
33
- const blockProps = saveBlockProps({
34
- className: "wp-block-navigation-overlay-close"
35
- });
36
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
37
- "button",
38
- {
39
- ...blockProps,
40
- type: "button",
41
- "aria-label": !showText ? "Close" : void 0,
42
- children: [
43
- showIcon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
44
- "svg",
45
- {
46
- xmlns: "http://www.w3.org/2000/svg",
47
- viewBox: "0 0 24 24",
48
- width: "24",
49
- height: "24",
50
- "aria-hidden": "true",
51
- focusable: "false",
52
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M13 11.8l6.1-6.3-1.1-1-6.1 6.2-6.1-6.2-1.1 1 6.1 6.3-6.5 6.7 1.1 1 6.5-6.6 6.5 6.6 1.1-1z" })
53
- }
54
- ),
55
- showText && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
56
- import_block_editor.RichText.Content,
57
- {
58
- tagName: "span",
59
- value: text,
60
- className: "wp-block-navigation-overlay-close__text"
61
- }
62
- )
63
- ]
64
- }
65
- );
66
- }
67
- //# sourceMappingURL=save.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/navigation-overlay-close/save.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useBlockProps, RichText } from '@wordpress/block-editor';\n\nconst saveBlockProps = useBlockProps.save;\n\nexport default function NavigationOverlayCloseSave( { attributes } ) {\n\tconst { displayMode, text } = attributes;\n\tconst showIcon = displayMode === 'icon' || displayMode === 'both';\n\tconst showText = displayMode === 'text' || displayMode === 'both';\n\n\tconst blockProps = saveBlockProps( {\n\t\tclassName: 'wp-block-navigation-overlay-close',\n\t} );\n\n\treturn (\n\t\t<button\n\t\t\t{ ...blockProps }\n\t\t\ttype=\"button\"\n\t\t\taria-label={ ! showText ? 'Close' : undefined }\n\t\t>\n\t\t\t{ showIcon && (\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\twidth=\"24\"\n\t\t\t\t\theight=\"24\"\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\tfocusable=\"false\"\n\t\t\t\t>\n\t\t\t\t\t<path d=\"M13 11.8l6.1-6.3-1.1-1-6.1 6.2-6.1-6.2-1.1 1 6.1 6.3-6.5 6.7 1.1 1 6.5-6.6 6.5 6.6 1.1-1z\" />\n\t\t\t\t</svg>\n\t\t\t) }\n\t\t\t{ showText && (\n\t\t\t\t<RichText.Content\n\t\t\t\t\ttagName=\"span\"\n\t\t\t\t\tvalue={ text }\n\t\t\t\t\tclassName=\"wp-block-navigation-overlay-close__text\"\n\t\t\t\t/>\n\t\t\t) }\n\t\t</button>\n\t);\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,0BAAwC;AActC;AAZF,IAAM,iBAAiB,kCAAc;AAEtB,SAAR,2BAA6C,EAAE,WAAW,GAAI;AACpE,QAAM,EAAE,aAAa,KAAK,IAAI;AAC9B,QAAM,WAAW,gBAAgB,UAAU,gBAAgB;AAC3D,QAAM,WAAW,gBAAgB,UAAU,gBAAgB;AAE3D,QAAM,aAAa,eAAgB;AAAA,IAClC,WAAW;AAAA,EACZ,CAAE;AAEF,SACC;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACL,MAAK;AAAA,MACL,cAAa,CAAE,WAAW,UAAU;AAAA,MAElC;AAAA,oBACD;AAAA,UAAC;AAAA;AAAA,YACA,OAAM;AAAA,YACN,SAAQ;AAAA,YACR,OAAM;AAAA,YACN,QAAO;AAAA,YACP,eAAY;AAAA,YACZ,WAAU;AAAA,YAEV,sDAAC,UAAK,GAAE,6FAA4F;AAAA;AAAA,QACrG;AAAA,QAEC,YACD;AAAA,UAAC,6BAAS;AAAA,UAAT;AAAA,YACA,SAAQ;AAAA,YACR,OAAQ;AAAA,YACR,WAAU;AAAA;AAAA,QACX;AAAA;AAAA;AAAA,EAEF;AAEF;",
6
- "names": []
7
- }
@@ -1,46 +0,0 @@
1
- // packages/block-library/src/navigation-overlay-close/save.js
2
- import { useBlockProps, RichText } from "@wordpress/block-editor";
3
- import { jsx, jsxs } from "react/jsx-runtime";
4
- var saveBlockProps = useBlockProps.save;
5
- function NavigationOverlayCloseSave({ attributes }) {
6
- const { displayMode, text } = attributes;
7
- const showIcon = displayMode === "icon" || displayMode === "both";
8
- const showText = displayMode === "text" || displayMode === "both";
9
- const blockProps = saveBlockProps({
10
- className: "wp-block-navigation-overlay-close"
11
- });
12
- return /* @__PURE__ */ jsxs(
13
- "button",
14
- {
15
- ...blockProps,
16
- type: "button",
17
- "aria-label": !showText ? "Close" : void 0,
18
- children: [
19
- showIcon && /* @__PURE__ */ jsx(
20
- "svg",
21
- {
22
- xmlns: "http://www.w3.org/2000/svg",
23
- viewBox: "0 0 24 24",
24
- width: "24",
25
- height: "24",
26
- "aria-hidden": "true",
27
- focusable: "false",
28
- children: /* @__PURE__ */ jsx("path", { d: "M13 11.8l6.1-6.3-1.1-1-6.1 6.2-6.1-6.2-1.1 1 6.1 6.3-6.5 6.7 1.1 1 6.5-6.6 6.5 6.6 1.1-1z" })
29
- }
30
- ),
31
- showText && /* @__PURE__ */ jsx(
32
- RichText.Content,
33
- {
34
- tagName: "span",
35
- value: text,
36
- className: "wp-block-navigation-overlay-close__text"
37
- }
38
- )
39
- ]
40
- }
41
- );
42
- }
43
- export {
44
- NavigationOverlayCloseSave as default
45
- };
46
- //# sourceMappingURL=save.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/navigation-overlay-close/save.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useBlockProps, RichText } from '@wordpress/block-editor';\n\nconst saveBlockProps = useBlockProps.save;\n\nexport default function NavigationOverlayCloseSave( { attributes } ) {\n\tconst { displayMode, text } = attributes;\n\tconst showIcon = displayMode === 'icon' || displayMode === 'both';\n\tconst showText = displayMode === 'text' || displayMode === 'both';\n\n\tconst blockProps = saveBlockProps( {\n\t\tclassName: 'wp-block-navigation-overlay-close',\n\t} );\n\n\treturn (\n\t\t<button\n\t\t\t{ ...blockProps }\n\t\t\ttype=\"button\"\n\t\t\taria-label={ ! showText ? 'Close' : undefined }\n\t\t>\n\t\t\t{ showIcon && (\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\twidth=\"24\"\n\t\t\t\t\theight=\"24\"\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\tfocusable=\"false\"\n\t\t\t\t>\n\t\t\t\t\t<path d=\"M13 11.8l6.1-6.3-1.1-1-6.1 6.2-6.1-6.2-1.1 1 6.1 6.3-6.5 6.7 1.1 1 6.5-6.6 6.5 6.6 1.1-1z\" />\n\t\t\t\t</svg>\n\t\t\t) }\n\t\t\t{ showText && (\n\t\t\t\t<RichText.Content\n\t\t\t\t\ttagName=\"span\"\n\t\t\t\t\tvalue={ text }\n\t\t\t\t\tclassName=\"wp-block-navigation-overlay-close__text\"\n\t\t\t\t/>\n\t\t\t) }\n\t\t</button>\n\t);\n}\n"],
5
- "mappings": ";AAGA,SAAS,eAAe,gBAAgB;AActC,SAcG,KAdH;AAZF,IAAM,iBAAiB,cAAc;AAEtB,SAAR,2BAA6C,EAAE,WAAW,GAAI;AACpE,QAAM,EAAE,aAAa,KAAK,IAAI;AAC9B,QAAM,WAAW,gBAAgB,UAAU,gBAAgB;AAC3D,QAAM,WAAW,gBAAgB,UAAU,gBAAgB;AAE3D,QAAM,aAAa,eAAgB;AAAA,IAClC,WAAW;AAAA,EACZ,CAAE;AAEF,SACC;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACL,MAAK;AAAA,MACL,cAAa,CAAE,WAAW,UAAU;AAAA,MAElC;AAAA,oBACD;AAAA,UAAC;AAAA;AAAA,YACA,OAAM;AAAA,YACN,SAAQ;AAAA,YACR,OAAM;AAAA,YACN,QAAO;AAAA,YACP,eAAY;AAAA,YACZ,WAAU;AAAA,YAEV,8BAAC,UAAK,GAAE,6FAA4F;AAAA;AAAA,QACrG;AAAA,QAEC,YACD;AAAA,UAAC,SAAS;AAAA,UAAT;AAAA,YACA,SAAQ;AAAA,YACR,OAAQ;AAAA,YACR,WAAU;AAAA;AAAA,QACX;AAAA;AAAA;AAAA,EAEF;AAEF;",
6
- "names": []
7
- }
@@ -1,44 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { useBlockProps, RichText } from '@wordpress/block-editor';
5
-
6
- const saveBlockProps = useBlockProps.save;
7
-
8
- export default function NavigationOverlayCloseSave( { attributes } ) {
9
- const { displayMode, text } = attributes;
10
- const showIcon = displayMode === 'icon' || displayMode === 'both';
11
- const showText = displayMode === 'text' || displayMode === 'both';
12
-
13
- const blockProps = saveBlockProps( {
14
- className: 'wp-block-navigation-overlay-close',
15
- } );
16
-
17
- return (
18
- <button
19
- { ...blockProps }
20
- type="button"
21
- aria-label={ ! showText ? 'Close' : undefined }
22
- >
23
- { showIcon && (
24
- <svg
25
- xmlns="http://www.w3.org/2000/svg"
26
- viewBox="0 0 24 24"
27
- width="24"
28
- height="24"
29
- aria-hidden="true"
30
- focusable="false"
31
- >
32
- <path d="M13 11.8l6.1-6.3-1.1-1-6.1 6.2-6.1-6.2-1.1 1 6.1 6.3-6.5 6.7 1.1 1 6.5-6.6 6.5 6.6 1.1-1z" />
33
- </svg>
34
- ) }
35
- { showText && (
36
- <RichText.Content
37
- tagName="span"
38
- value={ text }
39
- className="wp-block-navigation-overlay-close__text"
40
- />
41
- ) }
42
- </button>
43
- );
44
- }