@wordpress/block-library 8.3.2 → 8.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (193) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/button/edit.js +3 -1
  3. package/build/button/edit.js.map +1 -1
  4. package/build/button/index.js +17 -6
  5. package/build/button/index.js.map +1 -1
  6. package/build/cover/edit/index.js +3 -2
  7. package/build/cover/edit/index.js.map +1 -1
  8. package/build/file/index.js +10 -1
  9. package/build/file/index.js.map +1 -1
  10. package/build/image/image.js +21 -15
  11. package/build/image/image.js.map +1 -1
  12. package/build/latest-comments/edit.js +6 -2
  13. package/build/latest-comments/edit.js.map +1 -1
  14. package/build/latest-comments/index.js +13 -0
  15. package/build/latest-comments/index.js.map +1 -1
  16. package/build/navigation/edit/index.js +2 -28
  17. package/build/navigation/edit/index.js.map +1 -1
  18. package/build/navigation/edit/menu-inspector-controls.js +5 -6
  19. package/build/navigation/edit/menu-inspector-controls.js.map +1 -1
  20. package/build/navigation/edit/navigation-menu-selector.js +14 -11
  21. package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
  22. package/build/navigation/edit/unsaved-inner-blocks.js +4 -5
  23. package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  24. package/build/navigation/edit/use-create-navigation-menu.js +11 -2
  25. package/build/navigation/edit/use-create-navigation-menu.js.map +1 -1
  26. package/build/navigation/use-navigation-menu.js +1 -1
  27. package/build/navigation/use-navigation-menu.js.map +1 -1
  28. package/build/navigation-link/edit.js +4 -0
  29. package/build/navigation-link/edit.js.map +1 -1
  30. package/build/navigation-link/link-ui.js +1 -0
  31. package/build/navigation-link/link-ui.js.map +1 -1
  32. package/build/navigation-submenu/edit.js +4 -0
  33. package/build/navigation-submenu/edit.js.map +1 -1
  34. package/build/page-list/edit.js +5 -4
  35. package/build/page-list/edit.js.map +1 -1
  36. package/build/page-list/use-convert-to-navigation-links.js +61 -5
  37. package/build/page-list/use-convert-to-navigation-links.js.map +1 -1
  38. package/build/post-excerpt/edit.js +49 -3
  39. package/build/post-excerpt/edit.js.map +1 -1
  40. package/build/post-excerpt/index.js +4 -0
  41. package/build/post-excerpt/index.js.map +1 -1
  42. package/build/post-featured-image/dimension-controls.js +52 -1
  43. package/build/post-featured-image/dimension-controls.js.map +1 -1
  44. package/build/post-featured-image/edit.js +9 -4
  45. package/build/post-featured-image/edit.js.map +1 -1
  46. package/build/post-featured-image/index.js +3 -0
  47. package/build/post-featured-image/index.js.map +1 -1
  48. package/build/{experiments.js → private-apis.js} +3 -3
  49. package/build/private-apis.js.map +1 -0
  50. package/build/site-logo/edit.js +7 -11
  51. package/build/site-logo/edit.js.map +1 -1
  52. package/build/table/edit.js +3 -3
  53. package/build/table/edit.js.map +1 -1
  54. package/build/table-of-contents/utils.js +1 -1
  55. package/build/table-of-contents/utils.js.map +1 -1
  56. package/build/verse/index.js +6 -0
  57. package/build/verse/index.js.map +1 -1
  58. package/build-module/button/edit.js +2 -1
  59. package/build-module/button/edit.js.map +1 -1
  60. package/build-module/button/index.js +17 -6
  61. package/build-module/button/index.js.map +1 -1
  62. package/build-module/cover/edit/index.js +3 -2
  63. package/build-module/cover/edit/index.js.map +1 -1
  64. package/build-module/file/index.js +10 -1
  65. package/build-module/file/index.js.map +1 -1
  66. package/build-module/image/image.js +21 -15
  67. package/build-module/image/image.js.map +1 -1
  68. package/build-module/latest-comments/edit.js +6 -2
  69. package/build-module/latest-comments/edit.js.map +1 -1
  70. package/build-module/latest-comments/index.js +13 -0
  71. package/build-module/latest-comments/index.js.map +1 -1
  72. package/build-module/navigation/edit/index.js +3 -29
  73. package/build-module/navigation/edit/index.js.map +1 -1
  74. package/build-module/navigation/edit/menu-inspector-controls.js +5 -5
  75. package/build-module/navigation/edit/menu-inspector-controls.js.map +1 -1
  76. package/build-module/navigation/edit/navigation-menu-selector.js +14 -10
  77. package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
  78. package/build-module/navigation/edit/unsaved-inner-blocks.js +4 -5
  79. package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  80. package/build-module/navigation/edit/use-create-navigation-menu.js +11 -2
  81. package/build-module/navigation/edit/use-create-navigation-menu.js.map +1 -1
  82. package/build-module/navigation/use-navigation-menu.js +1 -1
  83. package/build-module/navigation/use-navigation-menu.js.map +1 -1
  84. package/build-module/navigation-link/edit.js +4 -0
  85. package/build-module/navigation-link/edit.js.map +1 -1
  86. package/build-module/navigation-link/link-ui.js +1 -0
  87. package/build-module/navigation-link/link-ui.js.map +1 -1
  88. package/build-module/navigation-submenu/edit.js +4 -0
  89. package/build-module/navigation-submenu/edit.js.map +1 -1
  90. package/build-module/page-list/edit.js +5 -4
  91. package/build-module/page-list/edit.js.map +1 -1
  92. package/build-module/page-list/use-convert-to-navigation-links.js +61 -5
  93. package/build-module/page-list/use-convert-to-navigation-links.js.map +1 -1
  94. package/build-module/post-excerpt/edit.js +52 -5
  95. package/build-module/post-excerpt/edit.js.map +1 -1
  96. package/build-module/post-excerpt/index.js +4 -0
  97. package/build-module/post-excerpt/index.js.map +1 -1
  98. package/build-module/post-featured-image/dimension-controls.js +52 -1
  99. package/build-module/post-featured-image/dimension-controls.js.map +1 -1
  100. package/build-module/post-featured-image/edit.js +9 -4
  101. package/build-module/post-featured-image/edit.js.map +1 -1
  102. package/build-module/post-featured-image/index.js +3 -0
  103. package/build-module/post-featured-image/index.js.map +1 -1
  104. package/build-module/{experiments.js → private-apis.js} +2 -2
  105. package/build-module/private-apis.js.map +1 -0
  106. package/build-module/site-logo/edit.js +7 -11
  107. package/build-module/site-logo/edit.js.map +1 -1
  108. package/build-module/table/edit.js +3 -3
  109. package/build-module/table/edit.js.map +1 -1
  110. package/build-module/table-of-contents/utils.js +1 -1
  111. package/build-module/table-of-contents/utils.js.map +1 -1
  112. package/build-module/verse/index.js +6 -0
  113. package/build-module/verse/index.js.map +1 -1
  114. package/build-style/avatar/style-rtl.css +3 -0
  115. package/build-style/avatar/style.css +3 -0
  116. package/build-style/button/editor-rtl.css +31 -0
  117. package/build-style/button/editor.css +31 -0
  118. package/build-style/button/style-rtl.css +31 -0
  119. package/build-style/button/style.css +31 -0
  120. package/build-style/classic-rtl.css +5 -0
  121. package/build-style/classic.css +5 -0
  122. package/build-style/editor-rtl.css +36 -1
  123. package/build-style/editor.css +36 -1
  124. package/build-style/file/style-rtl.css +1 -0
  125. package/build-style/file/style.css +1 -0
  126. package/build-style/image/editor-rtl.css +1 -0
  127. package/build-style/image/editor.css +1 -0
  128. package/build-style/image/style-rtl.css +6 -2
  129. package/build-style/image/style.css +6 -0
  130. package/build-style/latest-comments/style-rtl.css +18 -5
  131. package/build-style/latest-comments/style.css +18 -5
  132. package/build-style/quote/style-rtl.css +5 -5
  133. package/build-style/quote/style.css +5 -5
  134. package/build-style/style-rtl.css +64 -12
  135. package/build-style/style.css +64 -10
  136. package/build-types/table-of-contents/utils.d.ts +1 -1
  137. package/package.json +30 -30
  138. package/src/avatar/index.php +67 -63
  139. package/src/avatar/style.scss +3 -0
  140. package/src/button/block.json +17 -6
  141. package/src/button/edit.js +2 -1
  142. package/src/button/editor.scss +36 -0
  143. package/src/button/style.scss +37 -1
  144. package/src/classic.scss +5 -0
  145. package/src/cover/edit/index.js +4 -1
  146. package/src/editor.scss +5 -0
  147. package/src/file/block.json +10 -1
  148. package/src/file/style.scss +1 -0
  149. package/src/image/editor.scss +1 -0
  150. package/src/image/image.js +32 -27
  151. package/src/image/style.scss +13 -0
  152. package/src/latest-comments/block.json +13 -0
  153. package/src/latest-comments/edit.js +9 -2
  154. package/src/latest-comments/style.scss +25 -7
  155. package/src/navigation/edit/index.js +1 -30
  156. package/src/navigation/edit/menu-inspector-controls.js +3 -4
  157. package/src/navigation/edit/navigation-menu-selector.js +12 -26
  158. package/src/navigation/edit/test/navigation-menu-selector.js +638 -0
  159. package/src/navigation/edit/unsaved-inner-blocks.js +29 -36
  160. package/src/navigation/edit/use-create-navigation-menu.js +13 -1
  161. package/src/navigation/index.php +8 -6
  162. package/src/navigation/use-navigation-menu.js +1 -1
  163. package/src/navigation-link/edit.js +3 -0
  164. package/src/navigation-link/link-ui.js +1 -0
  165. package/src/navigation-submenu/edit.js +3 -0
  166. package/src/page-list/edit.js +6 -5
  167. package/src/page-list/index.php +4 -4
  168. package/src/page-list/test/convert-to-links-modal.js +134 -0
  169. package/src/page-list/use-convert-to-navigation-links.js +64 -4
  170. package/src/post-excerpt/block.json +4 -0
  171. package/src/post-excerpt/edit.js +72 -7
  172. package/src/post-excerpt/index.php +29 -5
  173. package/src/post-featured-image/block.json +3 -0
  174. package/src/post-featured-image/dimension-controls.js +64 -2
  175. package/src/post-featured-image/edit.js +18 -6
  176. package/src/post-featured-image/index.php +25 -9
  177. package/src/post-title/index.php +3 -3
  178. package/src/{experiments.js → private-apis.js} +1 -1
  179. package/src/quote/style.scss +2 -2
  180. package/src/site-logo/edit.js +3 -6
  181. package/src/table/edit.js +3 -3
  182. package/src/table-of-contents/utils.ts +1 -1
  183. package/src/template-part/index.php +1 -1
  184. package/src/verse/block.json +6 -0
  185. package/tsconfig.json +24 -1
  186. package/tsconfig.tsbuildinfo +1 -1
  187. package/build/experiments.js.map +0 -1
  188. package/build/navigation/leaf-more-menu.js +0 -95
  189. package/build/navigation/leaf-more-menu.js.map +0 -1
  190. package/build-module/experiments.js.map +0 -1
  191. package/build-module/navigation/leaf-more-menu.js +0 -76
  192. package/build-module/navigation/leaf-more-menu.js.map +0 -1
  193. package/src/navigation/leaf-more-menu.js +0 -93
@@ -49,7 +49,7 @@ const scaleHelp = {
49
49
 
50
50
  const DimensionControls = ( {
51
51
  clientId,
52
- attributes: { width, height, scale, sizeSlug },
52
+ attributes: { aspectRatio, width, height, scale, sizeSlug },
53
53
  setAttributes,
54
54
  imageSizeOptions = [],
55
55
  } ) => {
@@ -72,6 +72,68 @@ const DimensionControls = ( {
72
72
  const scaleLabel = _x( 'Scale', 'Image scaling options' );
73
73
  return (
74
74
  <InspectorControls group="dimensions">
75
+ <ToolsPanelItem
76
+ hasValue={ () => !! aspectRatio }
77
+ label={ __( 'Aspect ratio' ) }
78
+ onDeselect={ () => setAttributes( { aspectRatio: undefined } ) }
79
+ resetAllFilter={ () => ( {
80
+ aspectRatio: undefined,
81
+ } ) }
82
+ isShownByDefault={ true }
83
+ panelId={ clientId }
84
+ >
85
+ <SelectControl
86
+ __nextHasNoMarginBottom
87
+ label={ __( 'Aspect ratio' ) }
88
+ value={ aspectRatio }
89
+ options={ [
90
+ // These should use the same values as AspectRatioDropdown in @wordpress/block-editor
91
+ {
92
+ label: __( 'Original' ),
93
+ value: 'auto',
94
+ },
95
+ {
96
+ label: __( 'Square' ),
97
+ value: '1',
98
+ },
99
+ {
100
+ label: __( '16:10' ),
101
+ value: '16/10',
102
+ },
103
+ {
104
+ label: __( '16:9' ),
105
+ value: '16/9',
106
+ },
107
+ {
108
+ label: __( '4:3' ),
109
+ value: '4/3',
110
+ },
111
+ {
112
+ label: __( '3:2' ),
113
+ value: '3/2',
114
+ },
115
+ {
116
+ label: __( '10:16' ),
117
+ value: '10/16',
118
+ },
119
+ {
120
+ label: __( '9:16' ),
121
+ value: '9/16',
122
+ },
123
+ {
124
+ label: __( '3:4' ),
125
+ value: '3/4',
126
+ },
127
+ {
128
+ label: __( '2:3' ),
129
+ value: '2/3',
130
+ },
131
+ ] }
132
+ onChange={ ( nextAspectRatio ) =>
133
+ setAttributes( { aspectRatio: nextAspectRatio } )
134
+ }
135
+ />
136
+ </ToolsPanelItem>
75
137
  <ToolsPanelItem
76
138
  className="single-column"
77
139
  hasValue={ () => !! height }
@@ -116,7 +178,7 @@ const DimensionControls = ( {
116
178
  units={ units }
117
179
  />
118
180
  </ToolsPanelItem>
119
- { !! height && (
181
+ { ( height || aspectRatio ) && (
120
182
  <ToolsPanelItem
121
183
  hasValue={ () => !! scale && scale !== DEFAULT_SCALE }
122
184
  label={ scaleLabel }
@@ -50,8 +50,16 @@ export default function PostFeaturedImageEdit( {
50
50
  context: { postId, postType: postTypeSlug, queryId },
51
51
  } ) {
52
52
  const isDescendentOfQueryLoop = Number.isFinite( queryId );
53
- const { isLink, height, width, scale, sizeSlug, rel, linkTarget } =
54
- attributes;
53
+ const {
54
+ isLink,
55
+ aspectRatio,
56
+ height,
57
+ width,
58
+ scale,
59
+ sizeSlug,
60
+ rel,
61
+ linkTarget,
62
+ } = attributes;
55
63
  const [ featuredImage, setFeaturedImage ] = useEntityProp(
56
64
  'postType',
57
65
  postTypeSlug,
@@ -89,7 +97,7 @@ export default function PostFeaturedImageEdit( {
89
97
  } ) );
90
98
 
91
99
  const blockProps = useBlockProps( {
92
- style: { width, height },
100
+ style: { width, height, aspectRatio },
93
101
  } );
94
102
  const borderProps = useBorderProps( attributes );
95
103
 
@@ -101,7 +109,10 @@ export default function PostFeaturedImageEdit( {
101
109
  borderProps.className
102
110
  ) }
103
111
  withIllustration={ true }
104
- style={ borderProps.style }
112
+ style={ {
113
+ ...blockProps.style,
114
+ ...borderProps.style,
115
+ } }
105
116
  >
106
117
  { content }
107
118
  </Placeholder>
@@ -218,8 +229,9 @@ export default function PostFeaturedImageEdit( {
218
229
  const label = __( 'Add a featured image' );
219
230
  const imageStyles = {
220
231
  ...borderProps.style,
221
- height,
222
- objectFit: height && scale,
232
+ height: ( !! aspectRatio && '100%' ) || height,
233
+ width: !! aspectRatio && '100%',
234
+ objectFit: !! ( height || aspectRatio ) && scale,
223
235
  };
224
236
 
225
237
  /**
@@ -42,11 +42,20 @@ function render_block_core_post_featured_image( $attributes, $content, $block )
42
42
  }
43
43
  }
44
44
 
45
- if ( ! empty( $attributes['height'] ) ) {
46
- $extra_styles = "height:{$attributes['height']};";
47
- if ( ! empty( $attributes['scale'] ) ) {
48
- $extra_styles .= "object-fit:{$attributes['scale']};";
49
- }
45
+ $extra_styles = '';
46
+
47
+ // Aspect ratio with a height set needs to override the default width/height.
48
+ if ( ! empty( $attributes['aspectRatio'] ) ) {
49
+ $extra_styles .= 'width:100%;height:100%;';
50
+ } elseif ( ! empty( $attributes['height'] ) ) {
51
+ $extra_styles .= "height:{$attributes['height']};";
52
+ }
53
+
54
+ if ( ! empty( $attributes['scale'] ) ) {
55
+ $extra_styles .= "object-fit:{$attributes['scale']};";
56
+ }
57
+
58
+ if ( ! empty( $extra_styles ) ) {
50
59
  $attr['style'] = empty( $attr['style'] ) ? $extra_styles : $attr['style'] . $extra_styles;
51
60
  }
52
61
 
@@ -71,12 +80,19 @@ function render_block_core_post_featured_image( $attributes, $content, $block )
71
80
  $featured_image = $featured_image . $overlay_markup;
72
81
  }
73
82
 
74
- $width = ! empty( $attributes['width'] ) ? esc_attr( safecss_filter_attr( 'width:' . $attributes['width'] ) ) . ';' : '';
75
- $height = ! empty( $attributes['height'] ) ? esc_attr( safecss_filter_attr( 'height:' . $attributes['height'] ) ) . ';' : '';
76
- if ( ! $height && ! $width ) {
83
+ $aspect_ratio = ! empty( $attributes['aspectRatio'] )
84
+ ? esc_attr( safecss_filter_attr( 'aspect-ratio:' . $attributes['aspectRatio'] ) ) . ';'
85
+ : '';
86
+ $width = ! empty( $attributes['width'] )
87
+ ? esc_attr( safecss_filter_attr( 'width:' . $attributes['width'] ) ) . ';'
88
+ : '';
89
+ $height = ! empty( $attributes['height'] )
90
+ ? esc_attr( safecss_filter_attr( 'height:' . $attributes['height'] ) ) . ';'
91
+ : '';
92
+ if ( ! $height && ! $width && ! $aspect_ratio ) {
77
93
  $wrapper_attributes = get_block_wrapper_attributes();
78
94
  } else {
79
- $wrapper_attributes = get_block_wrapper_attributes( array( 'style' => $width . $height ) );
95
+ $wrapper_attributes = get_block_wrapper_attributes( array( 'style' => $aspect_ratio . $width . $height ) );
80
96
  }
81
97
  return "<figure {$wrapper_attributes}>{$featured_image}</figure>";
82
98
  }
@@ -19,8 +19,8 @@ function render_block_core_post_title( $attributes, $content, $block ) {
19
19
  return '';
20
20
  }
21
21
 
22
- $post_ID = $block->context['postId'];
23
- $title = get_the_title();
22
+ $post = get_post( $block->context['postId'] );
23
+ $title = get_the_title( $post );
24
24
 
25
25
  if ( ! $title ) {
26
26
  return '';
@@ -33,7 +33,7 @@ function render_block_core_post_title( $attributes, $content, $block ) {
33
33
 
34
34
  if ( isset( $attributes['isLink'] ) && $attributes['isLink'] ) {
35
35
  $rel = ! empty( $attributes['rel'] ) ? 'rel="' . esc_attr( $attributes['rel'] ) . '"' : '';
36
- $title = sprintf( '<a href="%1$s" target="%2$s" %3$s>%4$s</a>', get_the_permalink( $post_ID ), esc_attr( $attributes['linkTarget'] ), $rel, $title );
36
+ $title = sprintf( '<a href="%1$s" target="%2$s" %3$s>%4$s</a>', get_the_permalink( $post ), esc_attr( $attributes['linkTarget'] ), $rel, $title );
37
37
  }
38
38
 
39
39
  $classes = array();
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/experiments';
4
+ import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';
5
5
 
6
6
  export const { lock, unlock } =
7
7
  __dangerousOptInToUnstableAPIsOnlyForCoreModules(
@@ -2,8 +2,8 @@
2
2
  box-sizing: border-box;
3
3
  overflow-wrap: break-word; // Break long strings of text without spaces so they don't overflow the block.
4
4
  // .is-style-large and .is-large are kept for backwards compatibility. The :not pseudo-class is used to enable switching styles. See PR #37580.
5
- &.is-style-large:not(.is-style-plain),
6
- &.is-large:not(.is-style-plain) {
5
+ &.is-style-large:where(:not(.is-style-plain)),
6
+ &.is-large:where(:not(.is-style-plain)) {
7
7
  margin-bottom: 1em;
8
8
  padding: 0 1em;
9
9
 
@@ -78,18 +78,15 @@ const SiteLogo = ( {
78
78
  'is-transient': isBlobURL( logoUrl ),
79
79
  } );
80
80
  const { imageEditing, maxWidth, title } = useSelect( ( select ) => {
81
- const { getSettings } = select( blockEditorStore );
81
+ const settings = select( blockEditorStore ).getSettings();
82
82
  const siteEntities = select( coreStore ).getEntityRecord(
83
83
  'root',
84
84
  '__unstableBase'
85
85
  );
86
86
  return {
87
87
  title: siteEntities?.name,
88
- ...Object.fromEntries(
89
- Object.entries( getSettings() ).filter( ( [ key ] ) =>
90
- [ 'imageEditing', 'maxWidth' ].includes( key )
91
- )
92
- ),
88
+ imageEditing: settings.imageEditing,
89
+ maxWidth: settings.maxWidth,
93
90
  };
94
91
  }, [] );
95
92
 
package/src/table/edit.js CHANGED
@@ -398,7 +398,7 @@ function TableEdit( {
398
398
  },
399
399
  ];
400
400
 
401
- const renderedSections = [ 'head', 'body', 'foot' ].map( ( name ) => (
401
+ const renderedSections = sections.map( ( name ) => (
402
402
  <TSection name={ name } key={ name }>
403
403
  { attributes[ name ].map( ( { cells }, rowIndex ) => (
404
404
  <tr key={ rowIndex }>
@@ -428,7 +428,7 @@ function TableEdit( {
428
428
  rowSpan={ rowspan }
429
429
  value={ content }
430
430
  onChange={ onChange }
431
- unstableOnFocus={ () => {
431
+ onFocus={ () => {
432
432
  setSelectedCell( {
433
433
  sectionName: name,
434
434
  rowIndex,
@@ -530,7 +530,7 @@ function TableEdit( {
530
530
  setAttributes( { caption: value } )
531
531
  }
532
532
  // Deselect the selected table cell when the caption is focused.
533
- unstableOnFocus={ () => setSelectedCell() }
533
+ onFocus={ () => setSelectedCell() }
534
534
  __unstableOnSplitAtEnd={ () =>
535
535
  insertBlocksAfter(
536
536
  createBlock( getDefaultBlockName() )
@@ -18,7 +18,7 @@ export interface NestedHeadingData {
18
18
  * Takes a flat list of heading parameters and nests them based on each header's
19
19
  * immediate parent's level.
20
20
  *
21
- * @param headingList The flat list of headings to nest.
21
+ * @param headingList The flat list of headings to nest.
22
22
  *
23
23
  * @return The nested list of headings.
24
24
  */
@@ -22,7 +22,7 @@ function render_block_core_template_part( $attributes ) {
22
22
  if (
23
23
  isset( $attributes['slug'] ) &&
24
24
  isset( $attributes['theme'] ) &&
25
- wp_get_theme()->get_stylesheet() === $attributes['theme']
25
+ get_stylesheet() === $attributes['theme']
26
26
  ) {
27
27
  $template_part_id = $attributes['theme'] . '//' . $attributes['slug'];
28
28
  $template_part_query = new WP_Query(
@@ -47,6 +47,12 @@
47
47
  "spacing": {
48
48
  "margin": true,
49
49
  "padding": true
50
+ },
51
+ "__experimentalBorder": {
52
+ "radius": true,
53
+ "width": true,
54
+ "color": true,
55
+ "style": true
50
56
  }
51
57
  },
52
58
  "style": "wp-block-verse",
package/tsconfig.json CHANGED
@@ -6,6 +6,29 @@
6
6
  "types": [ "gutenberg-env" ],
7
7
  "strictNullChecks": true
8
8
  },
9
- "references": [ { "path": "../element" } ],
9
+ "references": [
10
+ { "path": "../a11y" },
11
+ { "path": "../api-fetch" },
12
+ { "path": "../autop" },
13
+ { "path": "../blob" },
14
+ { "path": "../block-editor" },
15
+ { "path": "../components" },
16
+ { "path": "../compose" },
17
+ { "path": "../core-data" },
18
+ { "path": "../data" },
19
+ { "path": "../date" },
20
+ { "path": "../deprecated" },
21
+ { "path": "../dom" },
22
+ { "path": "../element" },
23
+ { "path": "../escape-html" },
24
+ { "path": "../private-apis" },
25
+ { "path": "../hooks" },
26
+ { "path": "../html-entities" },
27
+ { "path": "../i18n" },
28
+ { "path": "../icons" },
29
+ { "path": "../keycodes" },
30
+ { "path": "../primitives" },
31
+ { "path": "../url" }
32
+ ],
10
33
  "include": [ "src/**/*.ts", "src/**/*.tsx" ]
11
34
  }
@@ -1 +1 @@
1
- {"program":{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","./src/table-of-contents/utils.ts","../element/node_modules/@types/react/global.d.ts","../../node_modules/csstype/index.d.ts","../../node_modules/@types/prop-types/index.d.ts","../../node_modules/@types/scheduler/tracing.d.ts","../element/node_modules/@types/react/index.d.ts","../element/build-types/react.d.ts","../element/build-types/create-interpolate-element.d.ts","../../node_modules/@types/react/index.d.ts","../../node_modules/@types/react-dom/index.d.ts","../../node_modules/@types/react-dom/client.d.ts","../element/build-types/react-platform.d.ts","../element/build-types/utils.d.ts","../element/build-types/platform.d.ts","../element/build-types/serialize.d.ts","../element/build-types/raw-html.d.ts","../element/build-types/index.d.ts","./src/table-of-contents/list.tsx","../../typings/gutenberg-env/index.d.ts","../../node_modules/@types/react/global.d.ts"],"fileInfos":[{"version":"aa9fb4c70f369237c2f45f9d969c9a59e0eae9a192962eb48581fe864aa609db","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","e21c071ca3e1b4a815d5f04a7475adcaeea5d64367e840dd0154096d705c3940","eb75e89d63b3b72dd9ca8b0cac801cecae5be352307c004adeaa60bc9d6df51f","2cc028cd0bdb35b1b5eb723d84666a255933fffbea607f72cbd0c7c7b4bee144",{"version":"e54c8715a4954cfdc66cd69489f2b725c09ebf37492dbd91cff0a1688b1159e8","affectsGlobalScope":true},{"version":"51b8b27c21c066bf877646e320bf6a722b80d1ade65e686923cd9d4494aef1ca","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"2c8c5ee58f30e7c944e04ab1fb5506fdbb4dd507c9efa6972cf4b91cec90c503","affectsGlobalScope":true},{"version":"2bb4b3927299434052b37851a47bf5c39764f2ba88a888a107b32262e9292b7c","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"df9c8a72ca8b0ed62f5470b41208a0587f0f73f0a7db28e5a1272cf92537518e","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"93544ca2f26a48716c1b6c5091842cad63129daac422dfa4bc52460465f22bb1","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"1b3fe904465430e030c93239a348f05e1be80640d91f2f004c3512c2c2c89f34","affectsGlobalScope":true},{"version":"7435b75fdf3509622e79622dbe5091cf4b09688410ee2034e4fc17d0c99d0862","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"9f1817f7c3f02f6d56e0f403b927e90bb133f371dcebc36fa7d6d208ef6899da","affectsGlobalScope":true},{"version":"cd6efb9467a8b6338ece2e2855e37765700f2cd061ca54b01b33878cf5c7677e","affectsGlobalScope":true},{"version":"fb4416144c1bf0323ccbc9afb0ab289c07312214e8820ad17d709498c865a3fe","affectsGlobalScope":true},{"version":"5b0ca94ec819d68d33da516306c15297acec88efeb0ae9e2b39f71dbd9685ef7","affectsGlobalScope":true},{"version":"4632665b87204bb1caa8b44d165bce0c50dfab177df5b561b345a567cabacf9a","affectsGlobalScope":true},"b748401d3c3ec6955b1d189492122c36b69e2127e2fe2ee515591e463af5cc8b",{"version":"bbdf156fea2fabed31a569445835aeedcc33643d404fcbaa54541f06c109df3f","affectsGlobalScope":true},"381899b8d1d4c1be716f18cb5242ba39f66f4b1e31d45af62a32a99f8edcb39d","f7b46d22a307739c145e5fddf537818038fdfffd580d79ed717f4d4d37249380","f5a8b384f182b3851cec3596ccc96cb7464f8d3469f48c74bf2befb782a19de5",{"version":"5917af4ff931b050dba49a1dedd9c00f15f7b3dc4345ad8491bfacd2ec68ed32","affectsGlobalScope":true},"6fb72c65c5af8c4ed7d41afecd1ebb463d1e074291ae5e8a187d0922fd40f59b","e47b8ec56eb49bc1c53c9012daa9874de14ad0c5da442485aec333571c74b526",{"version":"5917af4ff931b050dba49a1dedd9c00f15f7b3dc4345ad8491bfacd2ec68ed32","affectsGlobalScope":true},"e4dd91dd4789a109aab51d8a0569a282369fcda9ba6f2b2297bc61bacfb1a042","83e27bbd7304ea67f9afa1535f1d4fdb15866089f0d893c784cbb5b1c6fb3386","3f92e5a12ec6b30d7de129e9283a6a3e0e7a988457074950ec1e983812c2f2ff","d2d9e98a2b167079474768593e1e7125fc3db055add8fbdb5977e3d05a8a3696","6462da67490105ba7d98cf312c2faf8794c425781128b161ea8394d66502eec8","62359da52b6c8d00c50c2e50738fac82e902f916fdf458d8159e7edb1c60c3a8","1e0ac21bc775686383ea8c8e48bd98b385e6195b25c85525a7affd08a2cd38b9","0449615e1ed03c7d54fc435a63b7ef0cb4e5cea5ac40c9a63280a46f7eeae0ff","6a32e965fda149787817aefc75730a8d028cac8c8f15af547214e009c2c55172",{"version":"f254c1abf6bb4c92633159831f924588908da902aa5e04ae45c39bd001f62e2e","affectsGlobalScope":true}],"options":{"allowSyntheticDefaultImports":true,"composite":true,"declaration":true,"declarationDir":"./build-types","declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":false,"importsNotUsedAsValues":2,"jsx":1,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"rootDir":"./src","strict":true,"strictNullChecks":true,"target":99},"fileIdsList":[[50],[47,48,49,64],[45,61],[51],[51,52,56,57,58,59,60],[54,55],[50,51],[46,47,48,49]],"referencedMap":[[55,1],[54,1],[53,2],[62,3],[52,4],[61,5],[60,1],[56,6],[51,1],[59,7],[50,8]],"exportedModulesMap":[[55,1],[54,1],[53,2],[62,3],[52,4],[61,5],[60,1],[56,6],[51,1],[59,7],[50,8]],"semanticDiagnosticsPerFile":[48,55,54,53,49,47,10,12,11,2,13,14,15,16,17,18,19,20,3,4,24,21,22,23,25,26,27,5,28,29,30,31,6,32,33,34,35,7,40,36,37,38,39,8,41,42,43,1,9,44,62,45,52,61,58,60,56,51,59,57,46,50,63]},"version":"4.4.2"}
1
+ {"program":{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","./src/table-of-contents/utils.ts","../element/node_modules/@types/react/global.d.ts","../../node_modules/csstype/index.d.ts","../../node_modules/@types/prop-types/index.d.ts","../../node_modules/@types/scheduler/tracing.d.ts","../element/node_modules/@types/react/index.d.ts","../element/build-types/react.d.ts","../element/build-types/create-interpolate-element.d.ts","../../node_modules/@types/react/index.d.ts","../../node_modules/@types/react-dom/index.d.ts","../../node_modules/@types/react-dom/client.d.ts","../element/build-types/react-platform.d.ts","../element/build-types/utils.d.ts","../element/build-types/platform.d.ts","../element/build-types/serialize.d.ts","../element/build-types/raw-html.d.ts","../element/build-types/index.d.ts","./src/table-of-contents/list.tsx","../../typings/gutenberg-env/index.d.ts","../../node_modules/@types/react/global.d.ts"],"fileInfos":[{"version":"aa9fb4c70f369237c2f45f9d969c9a59e0eae9a192962eb48581fe864aa609db","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","e21c071ca3e1b4a815d5f04a7475adcaeea5d64367e840dd0154096d705c3940","eb75e89d63b3b72dd9ca8b0cac801cecae5be352307c004adeaa60bc9d6df51f","2cc028cd0bdb35b1b5eb723d84666a255933fffbea607f72cbd0c7c7b4bee144",{"version":"e54c8715a4954cfdc66cd69489f2b725c09ebf37492dbd91cff0a1688b1159e8","affectsGlobalScope":true},{"version":"51b8b27c21c066bf877646e320bf6a722b80d1ade65e686923cd9d4494aef1ca","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"2c8c5ee58f30e7c944e04ab1fb5506fdbb4dd507c9efa6972cf4b91cec90c503","affectsGlobalScope":true},{"version":"2bb4b3927299434052b37851a47bf5c39764f2ba88a888a107b32262e9292b7c","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"df9c8a72ca8b0ed62f5470b41208a0587f0f73f0a7db28e5a1272cf92537518e","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"93544ca2f26a48716c1b6c5091842cad63129daac422dfa4bc52460465f22bb1","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"1b3fe904465430e030c93239a348f05e1be80640d91f2f004c3512c2c2c89f34","affectsGlobalScope":true},{"version":"7435b75fdf3509622e79622dbe5091cf4b09688410ee2034e4fc17d0c99d0862","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"9f1817f7c3f02f6d56e0f403b927e90bb133f371dcebc36fa7d6d208ef6899da","affectsGlobalScope":true},{"version":"cd6efb9467a8b6338ece2e2855e37765700f2cd061ca54b01b33878cf5c7677e","affectsGlobalScope":true},{"version":"fb4416144c1bf0323ccbc9afb0ab289c07312214e8820ad17d709498c865a3fe","affectsGlobalScope":true},{"version":"5b0ca94ec819d68d33da516306c15297acec88efeb0ae9e2b39f71dbd9685ef7","affectsGlobalScope":true},{"version":"4632665b87204bb1caa8b44d165bce0c50dfab177df5b561b345a567cabacf9a","affectsGlobalScope":true},"c19a5ece4a6877a6afa5e1a9608c3051f9da73e73bcc164386812ef6d5e5f227",{"version":"bbdf156fea2fabed31a569445835aeedcc33643d404fcbaa54541f06c109df3f","affectsGlobalScope":true},"381899b8d1d4c1be716f18cb5242ba39f66f4b1e31d45af62a32a99f8edcb39d","f7b46d22a307739c145e5fddf537818038fdfffd580d79ed717f4d4d37249380","f5a8b384f182b3851cec3596ccc96cb7464f8d3469f48c74bf2befb782a19de5",{"version":"5917af4ff931b050dba49a1dedd9c00f15f7b3dc4345ad8491bfacd2ec68ed32","affectsGlobalScope":true},"6fb72c65c5af8c4ed7d41afecd1ebb463d1e074291ae5e8a187d0922fd40f59b","e47b8ec56eb49bc1c53c9012daa9874de14ad0c5da442485aec333571c74b526",{"version":"5917af4ff931b050dba49a1dedd9c00f15f7b3dc4345ad8491bfacd2ec68ed32","affectsGlobalScope":true},"e4dd91dd4789a109aab51d8a0569a282369fcda9ba6f2b2297bc61bacfb1a042","83e27bbd7304ea67f9afa1535f1d4fdb15866089f0d893c784cbb5b1c6fb3386","3f92e5a12ec6b30d7de129e9283a6a3e0e7a988457074950ec1e983812c2f2ff","d2d9e98a2b167079474768593e1e7125fc3db055add8fbdb5977e3d05a8a3696","6462da67490105ba7d98cf312c2faf8794c425781128b161ea8394d66502eec8","62359da52b6c8d00c50c2e50738fac82e902f916fdf458d8159e7edb1c60c3a8","1e0ac21bc775686383ea8c8e48bd98b385e6195b25c85525a7affd08a2cd38b9","0449615e1ed03c7d54fc435a63b7ef0cb4e5cea5ac40c9a63280a46f7eeae0ff","6a32e965fda149787817aefc75730a8d028cac8c8f15af547214e009c2c55172",{"version":"7b1b47a00ea238e04189f6a4796282ea252bf4f3afce92cdeaed4fe01c669a40","affectsGlobalScope":true}],"options":{"allowSyntheticDefaultImports":true,"composite":true,"declaration":true,"declarationDir":"./build-types","declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":false,"importsNotUsedAsValues":2,"jsx":1,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"rootDir":"./src","strict":true,"strictNullChecks":true,"target":99},"fileIdsList":[[50],[47,48,49,64],[45,61],[51],[51,52,56,57,58,59,60],[54,55],[50,51],[46,47,48,49]],"referencedMap":[[55,1],[54,1],[53,2],[62,3],[52,4],[61,5],[60,1],[56,6],[51,1],[59,7],[50,8]],"exportedModulesMap":[[55,1],[54,1],[53,2],[62,3],[52,4],[61,5],[60,1],[56,6],[51,1],[59,7],[50,8]],"semanticDiagnosticsPerFile":[48,55,54,53,49,47,10,12,11,2,13,14,15,16,17,18,19,20,3,4,24,21,22,23,25,26,27,5,28,29,30,31,6,32,33,34,35,7,40,36,37,38,39,8,41,42,43,1,9,44,62,45,52,61,58,60,56,51,59,57,46,50,63]},"version":"4.4.2"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/experiments.js"],"names":["lock","unlock"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;AAGO,MAAM;AAAEA,EAAAA,IAAF;AAAQC,EAAAA;AAAR,IACZ,mEACC,8GADD,EAEC,0BAFD,CADM","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/experiments';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.',\n\t\t'@wordpress/block-library'\n\t);\n"]}
@@ -1,95 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.LeafMoreMenu = void 0;
9
-
10
- var _element = require("@wordpress/element");
11
-
12
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
-
14
- var _blocks = require("@wordpress/blocks");
15
-
16
- var _icons = require("@wordpress/icons");
17
-
18
- var _components = require("@wordpress/components");
19
-
20
- var _data = require("@wordpress/data");
21
-
22
- var _blockEditor = require("@wordpress/block-editor");
23
-
24
- var _i18n = require("@wordpress/i18n");
25
-
26
- /**
27
- * WordPress dependencies
28
- */
29
- const POPOVER_PROPS = {
30
- className: 'block-editor-block-settings-menu__popover',
31
- position: 'bottom right',
32
- variant: 'toolbar'
33
- };
34
-
35
- const LeafMoreMenu = props => {
36
- const {
37
- clientId,
38
- block
39
- } = props;
40
- const {
41
- insertBlock,
42
- replaceBlock,
43
- removeBlocks,
44
- replaceInnerBlocks
45
- } = (0, _data.useDispatch)(_blockEditor.store);
46
- const label = (0, _i18n.sprintf)(
47
- /* translators: %s: block name */
48
- (0, _i18n.__)('Remove %s'), (0, _blockEditor.BlockTitle)({
49
- clientId,
50
- maximumLength: 25
51
- }));
52
- return (0, _element.createElement)(_components.DropdownMenu, (0, _extends2.default)({
53
- icon: _icons.moreVertical,
54
- label: (0, _i18n.__)('Options'),
55
- className: "block-editor-block-settings-menu",
56
- popoverProps: POPOVER_PROPS,
57
- noIcons: true
58
- }, props), _ref => {
59
- let {
60
- onClose
61
- } = _ref;
62
- return (0, _element.createElement)(_components.MenuGroup, null, (0, _element.createElement)(_components.MenuItem, {
63
- icon: _icons.addSubmenu,
64
- onClick: () => {
65
- const updateSelectionOnInsert = false;
66
- const newLink = (0, _blocks.createBlock)('core/navigation-link');
67
-
68
- if (block.name === 'core/navigation-submenu') {
69
- insertBlock(newLink, block.innerBlocks.length, clientId, updateSelectionOnInsert);
70
- } else {
71
- // Convert to a submenu if the block currently isn't one.
72
- const newSubmenu = (0, _blocks.createBlock)('core/navigation-submenu', block.attributes, block.innerBlocks); // The following must happen as two independent actions.
73
- // Why? Because the offcanvas editor relies on the getLastInsertedBlocksClientIds
74
- // selector to determine which block is "active". As the UX needs the newLink to be
75
- // the "active" block it must be the last block to be inserted.
76
- // Therefore the Submenu is first created and **then** the newLink is inserted
77
- // thus ensuring it is the last inserted block.
78
-
79
- replaceBlock(clientId, newSubmenu);
80
- replaceInnerBlocks(newSubmenu.clientId, [newLink], updateSelectionOnInsert);
81
- }
82
-
83
- onClose();
84
- }
85
- }, (0, _i18n.__)('Add submenu item')), (0, _element.createElement)(_components.MenuItem, {
86
- onClick: () => {
87
- removeBlocks([clientId], false);
88
- onClose();
89
- }
90
- }, label));
91
- });
92
- };
93
-
94
- exports.LeafMoreMenu = LeafMoreMenu;
95
- //# sourceMappingURL=leaf-more-menu.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/navigation/leaf-more-menu.js"],"names":["POPOVER_PROPS","className","position","variant","LeafMoreMenu","props","clientId","block","insertBlock","replaceBlock","removeBlocks","replaceInnerBlocks","blockEditorStore","label","maximumLength","moreVertical","onClose","addSubmenu","updateSelectionOnInsert","newLink","name","innerBlocks","length","newSubmenu","attributes"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AARA;AACA;AACA;AAQA,MAAMA,aAAa,GAAG;AACrBC,EAAAA,SAAS,EAAE,2CADU;AAErBC,EAAAA,QAAQ,EAAE,cAFW;AAGrBC,EAAAA,OAAO,EAAE;AAHY,CAAtB;;AAMO,MAAMC,YAAY,GAAKC,KAAF,IAAa;AACxC,QAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,MAAsBF,KAA5B;AAEA,QAAM;AAAEG,IAAAA,WAAF;AAAeC,IAAAA,YAAf;AAA6BC,IAAAA,YAA7B;AAA2CC,IAAAA;AAA3C,MACL,uBAAaC,kBAAb,CADD;AAGA,QAAMC,KAAK,GAAG;AACb;AACA,gBAAI,WAAJ,CAFa,EAGb,6BAAY;AAAEP,IAAAA,QAAF;AAAYQ,IAAAA,aAAa,EAAE;AAA3B,GAAZ,CAHa,CAAd;AAMA,SACC,4BAAC,wBAAD;AACC,IAAA,IAAI,EAAGC,mBADR;AAEC,IAAA,KAAK,EAAG,cAAI,SAAJ,CAFT;AAGC,IAAA,SAAS,EAAC,kCAHX;AAIC,IAAA,YAAY,EAAGf,aAJhB;AAKC,IAAA,OAAO;AALR,KAMMK,KANN,GAQG;AAAA,QAAE;AAAEW,MAAAA;AAAF,KAAF;AAAA,WACD,4BAAC,qBAAD,QACC,4BAAC,oBAAD;AACC,MAAA,IAAI,EAAGC,iBADR;AAEC,MAAA,OAAO,EAAG,MAAM;AACf,cAAMC,uBAAuB,GAAG,KAAhC;AACA,cAAMC,OAAO,GAAG,yBACf,sBADe,CAAhB;;AAGA,YAAKZ,KAAK,CAACa,IAAN,KAAe,yBAApB,EAAgD;AAC/CZ,UAAAA,WAAW,CACVW,OADU,EAEVZ,KAAK,CAACc,WAAN,CAAkBC,MAFR,EAGVhB,QAHU,EAIVY,uBAJU,CAAX;AAMA,SAPD,MAOO;AACN;AACA,gBAAMK,UAAU,GAAG,yBAClB,yBADkB,EAElBhB,KAAK,CAACiB,UAFY,EAGlBjB,KAAK,CAACc,WAHY,CAAnB,CAFM,CAQN;AACA;AACA;AACA;AACA;AACA;;AACAZ,UAAAA,YAAY,CAAEH,QAAF,EAAYiB,UAAZ,CAAZ;AAEAZ,UAAAA,kBAAkB,CACjBY,UAAU,CAACjB,QADM,EAEjB,CAAEa,OAAF,CAFiB,EAGjBD,uBAHiB,CAAlB;AAKA;;AACDF,QAAAA,OAAO;AACP;AArCF,OAuCG,cAAI,kBAAJ,CAvCH,CADD,EA0CC,4BAAC,oBAAD;AACC,MAAA,OAAO,EAAG,MAAM;AACfN,QAAAA,YAAY,CAAE,CAAEJ,QAAF,CAAF,EAAgB,KAAhB,CAAZ;AACAU,QAAAA,OAAO;AACP;AAJF,OAMGH,KANH,CA1CD,CADC;AAAA,GARH,CADD;AAgEA,CA5EM","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createBlock } from '@wordpress/blocks';\nimport { addSubmenu, moreVertical } from '@wordpress/icons';\nimport { DropdownMenu, MenuItem, MenuGroup } from '@wordpress/components';\nimport { useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore, BlockTitle } from '@wordpress/block-editor';\nimport { __, sprintf } from '@wordpress/i18n';\n\nconst POPOVER_PROPS = {\n\tclassName: 'block-editor-block-settings-menu__popover',\n\tposition: 'bottom right',\n\tvariant: 'toolbar',\n};\n\nexport const LeafMoreMenu = ( props ) => {\n\tconst { clientId, block } = props;\n\n\tconst { insertBlock, replaceBlock, removeBlocks, replaceInnerBlocks } =\n\t\tuseDispatch( blockEditorStore );\n\n\tconst label = sprintf(\n\t\t/* translators: %s: block name */\n\t\t__( 'Remove %s' ),\n\t\tBlockTitle( { clientId, maximumLength: 25 } )\n\t);\n\n\treturn (\n\t\t<DropdownMenu\n\t\t\ticon={ moreVertical }\n\t\t\tlabel={ __( 'Options' ) }\n\t\t\tclassName=\"block-editor-block-settings-menu\"\n\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\tnoIcons\n\t\t\t{ ...props }\n\t\t>\n\t\t\t{ ( { onClose } ) => (\n\t\t\t\t<MenuGroup>\n\t\t\t\t\t<MenuItem\n\t\t\t\t\t\ticon={ addSubmenu }\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tconst updateSelectionOnInsert = false;\n\t\t\t\t\t\t\tconst newLink = createBlock(\n\t\t\t\t\t\t\t\t'core/navigation-link'\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tif ( block.name === 'core/navigation-submenu' ) {\n\t\t\t\t\t\t\t\tinsertBlock(\n\t\t\t\t\t\t\t\t\tnewLink,\n\t\t\t\t\t\t\t\t\tblock.innerBlocks.length,\n\t\t\t\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t\t\t\tupdateSelectionOnInsert\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// Convert to a submenu if the block currently isn't one.\n\t\t\t\t\t\t\t\tconst newSubmenu = createBlock(\n\t\t\t\t\t\t\t\t\t'core/navigation-submenu',\n\t\t\t\t\t\t\t\t\tblock.attributes,\n\t\t\t\t\t\t\t\t\tblock.innerBlocks\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t// The following must happen as two independent actions.\n\t\t\t\t\t\t\t\t// Why? Because the offcanvas editor relies on the getLastInsertedBlocksClientIds\n\t\t\t\t\t\t\t\t// selector to determine which block is \"active\". As the UX needs the newLink to be\n\t\t\t\t\t\t\t\t// the \"active\" block it must be the last block to be inserted.\n\t\t\t\t\t\t\t\t// Therefore the Submenu is first created and **then** the newLink is inserted\n\t\t\t\t\t\t\t\t// thus ensuring it is the last inserted block.\n\t\t\t\t\t\t\t\treplaceBlock( clientId, newSubmenu );\n\n\t\t\t\t\t\t\t\treplaceInnerBlocks(\n\t\t\t\t\t\t\t\t\tnewSubmenu.clientId,\n\t\t\t\t\t\t\t\t\t[ newLink ],\n\t\t\t\t\t\t\t\t\tupdateSelectionOnInsert\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Add submenu item' ) }\n\t\t\t\t\t</MenuItem>\n\t\t\t\t\t<MenuItem\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tremoveBlocks( [ clientId ], false );\n\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ label }\n\t\t\t\t\t</MenuItem>\n\t\t\t\t</MenuGroup>\n\t\t\t) }\n\t\t</DropdownMenu>\n\t);\n};\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/experiments.js"],"names":["__dangerousOptInToUnstableAPIsOnlyForCoreModules","lock","unlock"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gDAAT,QAAiE,wBAAjE;AAEA,OAAO,MAAM;AAAEC,EAAAA,IAAF;AAAQC,EAAAA;AAAR,IACZF,gDAAgD,CAC/C,8GAD+C,EAE/C,0BAF+C,CAD1C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/experiments';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.',\n\t\t'@wordpress/block-library'\n\t);\n"]}
@@ -1,76 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
- import { createElement } from "@wordpress/element";
3
-
4
- /**
5
- * WordPress dependencies
6
- */
7
- import { createBlock } from '@wordpress/blocks';
8
- import { addSubmenu, moreVertical } from '@wordpress/icons';
9
- import { DropdownMenu, MenuItem, MenuGroup } from '@wordpress/components';
10
- import { useDispatch } from '@wordpress/data';
11
- import { store as blockEditorStore, BlockTitle } from '@wordpress/block-editor';
12
- import { __, sprintf } from '@wordpress/i18n';
13
- const POPOVER_PROPS = {
14
- className: 'block-editor-block-settings-menu__popover',
15
- position: 'bottom right',
16
- variant: 'toolbar'
17
- };
18
- export const LeafMoreMenu = props => {
19
- const {
20
- clientId,
21
- block
22
- } = props;
23
- const {
24
- insertBlock,
25
- replaceBlock,
26
- removeBlocks,
27
- replaceInnerBlocks
28
- } = useDispatch(blockEditorStore);
29
- const label = sprintf(
30
- /* translators: %s: block name */
31
- __('Remove %s'), BlockTitle({
32
- clientId,
33
- maximumLength: 25
34
- }));
35
- return createElement(DropdownMenu, _extends({
36
- icon: moreVertical,
37
- label: __('Options'),
38
- className: "block-editor-block-settings-menu",
39
- popoverProps: POPOVER_PROPS,
40
- noIcons: true
41
- }, props), _ref => {
42
- let {
43
- onClose
44
- } = _ref;
45
- return createElement(MenuGroup, null, createElement(MenuItem, {
46
- icon: addSubmenu,
47
- onClick: () => {
48
- const updateSelectionOnInsert = false;
49
- const newLink = createBlock('core/navigation-link');
50
-
51
- if (block.name === 'core/navigation-submenu') {
52
- insertBlock(newLink, block.innerBlocks.length, clientId, updateSelectionOnInsert);
53
- } else {
54
- // Convert to a submenu if the block currently isn't one.
55
- const newSubmenu = createBlock('core/navigation-submenu', block.attributes, block.innerBlocks); // The following must happen as two independent actions.
56
- // Why? Because the offcanvas editor relies on the getLastInsertedBlocksClientIds
57
- // selector to determine which block is "active". As the UX needs the newLink to be
58
- // the "active" block it must be the last block to be inserted.
59
- // Therefore the Submenu is first created and **then** the newLink is inserted
60
- // thus ensuring it is the last inserted block.
61
-
62
- replaceBlock(clientId, newSubmenu);
63
- replaceInnerBlocks(newSubmenu.clientId, [newLink], updateSelectionOnInsert);
64
- }
65
-
66
- onClose();
67
- }
68
- }, __('Add submenu item')), createElement(MenuItem, {
69
- onClick: () => {
70
- removeBlocks([clientId], false);
71
- onClose();
72
- }
73
- }, label));
74
- });
75
- };
76
- //# sourceMappingURL=leaf-more-menu.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/navigation/leaf-more-menu.js"],"names":["createBlock","addSubmenu","moreVertical","DropdownMenu","MenuItem","MenuGroup","useDispatch","store","blockEditorStore","BlockTitle","__","sprintf","POPOVER_PROPS","className","position","variant","LeafMoreMenu","props","clientId","block","insertBlock","replaceBlock","removeBlocks","replaceInnerBlocks","label","maximumLength","onClose","updateSelectionOnInsert","newLink","name","innerBlocks","length","newSubmenu","attributes"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,WAAT,QAA4B,mBAA5B;AACA,SAASC,UAAT,EAAqBC,YAArB,QAAyC,kBAAzC;AACA,SAASC,YAAT,EAAuBC,QAAvB,EAAiCC,SAAjC,QAAkD,uBAAlD;AACA,SAASC,WAAT,QAA4B,iBAA5B;AACA,SAASC,KAAK,IAAIC,gBAAlB,EAAoCC,UAApC,QAAsD,yBAAtD;AACA,SAASC,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AAEA,MAAMC,aAAa,GAAG;AACrBC,EAAAA,SAAS,EAAE,2CADU;AAErBC,EAAAA,QAAQ,EAAE,cAFW;AAGrBC,EAAAA,OAAO,EAAE;AAHY,CAAtB;AAMA,OAAO,MAAMC,YAAY,GAAKC,KAAF,IAAa;AACxC,QAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,MAAsBF,KAA5B;AAEA,QAAM;AAAEG,IAAAA,WAAF;AAAeC,IAAAA,YAAf;AAA6BC,IAAAA,YAA7B;AAA2CC,IAAAA;AAA3C,MACLjB,WAAW,CAAEE,gBAAF,CADZ;AAGA,QAAMgB,KAAK,GAAGb,OAAO;AACpB;AACAD,EAAAA,EAAE,CAAE,WAAF,CAFkB,EAGpBD,UAAU,CAAE;AAAES,IAAAA,QAAF;AAAYO,IAAAA,aAAa,EAAE;AAA3B,GAAF,CAHU,CAArB;AAMA,SACC,cAAC,YAAD;AACC,IAAA,IAAI,EAAGvB,YADR;AAEC,IAAA,KAAK,EAAGQ,EAAE,CAAE,SAAF,CAFX;AAGC,IAAA,SAAS,EAAC,kCAHX;AAIC,IAAA,YAAY,EAAGE,aAJhB;AAKC,IAAA,OAAO;AALR,KAMMK,KANN,GAQG;AAAA,QAAE;AAAES,MAAAA;AAAF,KAAF;AAAA,WACD,cAAC,SAAD,QACC,cAAC,QAAD;AACC,MAAA,IAAI,EAAGzB,UADR;AAEC,MAAA,OAAO,EAAG,MAAM;AACf,cAAM0B,uBAAuB,GAAG,KAAhC;AACA,cAAMC,OAAO,GAAG5B,WAAW,CAC1B,sBAD0B,CAA3B;;AAGA,YAAKmB,KAAK,CAACU,IAAN,KAAe,yBAApB,EAAgD;AAC/CT,UAAAA,WAAW,CACVQ,OADU,EAEVT,KAAK,CAACW,WAAN,CAAkBC,MAFR,EAGVb,QAHU,EAIVS,uBAJU,CAAX;AAMA,SAPD,MAOO;AACN;AACA,gBAAMK,UAAU,GAAGhC,WAAW,CAC7B,yBAD6B,EAE7BmB,KAAK,CAACc,UAFuB,EAG7Bd,KAAK,CAACW,WAHuB,CAA9B,CAFM,CAQN;AACA;AACA;AACA;AACA;AACA;;AACAT,UAAAA,YAAY,CAAEH,QAAF,EAAYc,UAAZ,CAAZ;AAEAT,UAAAA,kBAAkB,CACjBS,UAAU,CAACd,QADM,EAEjB,CAAEU,OAAF,CAFiB,EAGjBD,uBAHiB,CAAlB;AAKA;;AACDD,QAAAA,OAAO;AACP;AArCF,OAuCGhB,EAAE,CAAE,kBAAF,CAvCL,CADD,EA0CC,cAAC,QAAD;AACC,MAAA,OAAO,EAAG,MAAM;AACfY,QAAAA,YAAY,CAAE,CAAEJ,QAAF,CAAF,EAAgB,KAAhB,CAAZ;AACAQ,QAAAA,OAAO;AACP;AAJF,OAMGF,KANH,CA1CD,CADC;AAAA,GARH,CADD;AAgEA,CA5EM","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createBlock } from '@wordpress/blocks';\nimport { addSubmenu, moreVertical } from '@wordpress/icons';\nimport { DropdownMenu, MenuItem, MenuGroup } from '@wordpress/components';\nimport { useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore, BlockTitle } from '@wordpress/block-editor';\nimport { __, sprintf } from '@wordpress/i18n';\n\nconst POPOVER_PROPS = {\n\tclassName: 'block-editor-block-settings-menu__popover',\n\tposition: 'bottom right',\n\tvariant: 'toolbar',\n};\n\nexport const LeafMoreMenu = ( props ) => {\n\tconst { clientId, block } = props;\n\n\tconst { insertBlock, replaceBlock, removeBlocks, replaceInnerBlocks } =\n\t\tuseDispatch( blockEditorStore );\n\n\tconst label = sprintf(\n\t\t/* translators: %s: block name */\n\t\t__( 'Remove %s' ),\n\t\tBlockTitle( { clientId, maximumLength: 25 } )\n\t);\n\n\treturn (\n\t\t<DropdownMenu\n\t\t\ticon={ moreVertical }\n\t\t\tlabel={ __( 'Options' ) }\n\t\t\tclassName=\"block-editor-block-settings-menu\"\n\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\tnoIcons\n\t\t\t{ ...props }\n\t\t>\n\t\t\t{ ( { onClose } ) => (\n\t\t\t\t<MenuGroup>\n\t\t\t\t\t<MenuItem\n\t\t\t\t\t\ticon={ addSubmenu }\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tconst updateSelectionOnInsert = false;\n\t\t\t\t\t\t\tconst newLink = createBlock(\n\t\t\t\t\t\t\t\t'core/navigation-link'\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tif ( block.name === 'core/navigation-submenu' ) {\n\t\t\t\t\t\t\t\tinsertBlock(\n\t\t\t\t\t\t\t\t\tnewLink,\n\t\t\t\t\t\t\t\t\tblock.innerBlocks.length,\n\t\t\t\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t\t\t\tupdateSelectionOnInsert\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// Convert to a submenu if the block currently isn't one.\n\t\t\t\t\t\t\t\tconst newSubmenu = createBlock(\n\t\t\t\t\t\t\t\t\t'core/navigation-submenu',\n\t\t\t\t\t\t\t\t\tblock.attributes,\n\t\t\t\t\t\t\t\t\tblock.innerBlocks\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t// The following must happen as two independent actions.\n\t\t\t\t\t\t\t\t// Why? Because the offcanvas editor relies on the getLastInsertedBlocksClientIds\n\t\t\t\t\t\t\t\t// selector to determine which block is \"active\". As the UX needs the newLink to be\n\t\t\t\t\t\t\t\t// the \"active\" block it must be the last block to be inserted.\n\t\t\t\t\t\t\t\t// Therefore the Submenu is first created and **then** the newLink is inserted\n\t\t\t\t\t\t\t\t// thus ensuring it is the last inserted block.\n\t\t\t\t\t\t\t\treplaceBlock( clientId, newSubmenu );\n\n\t\t\t\t\t\t\t\treplaceInnerBlocks(\n\t\t\t\t\t\t\t\t\tnewSubmenu.clientId,\n\t\t\t\t\t\t\t\t\t[ newLink ],\n\t\t\t\t\t\t\t\t\tupdateSelectionOnInsert\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Add submenu item' ) }\n\t\t\t\t\t</MenuItem>\n\t\t\t\t\t<MenuItem\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tremoveBlocks( [ clientId ], false );\n\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ label }\n\t\t\t\t\t</MenuItem>\n\t\t\t\t</MenuGroup>\n\t\t\t) }\n\t\t</DropdownMenu>\n\t);\n};\n"]}