@wordpress/block-editor 14.7.0 → 14.8.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 (204) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/block-controls/slot.js +6 -3
  3. package/build/components/block-controls/slot.js.map +1 -1
  4. package/build/components/block-inspector/index.js +1 -2
  5. package/build/components/block-inspector/index.js.map +1 -1
  6. package/build/components/block-lock/modal.js +1 -1
  7. package/build/components/block-lock/modal.js.map +1 -1
  8. package/build/components/block-manager/category.js +79 -0
  9. package/build/components/block-manager/category.js.map +1 -0
  10. package/build/components/block-manager/checklist.js +40 -0
  11. package/build/components/block-manager/checklist.js.map +1 -0
  12. package/build/components/block-manager/index.js +108 -0
  13. package/build/components/block-manager/index.js.map +1 -0
  14. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  15. package/build/components/block-settings-menu/index.js.map +1 -1
  16. package/build/components/block-toolbar/index.js +16 -4
  17. package/build/components/block-toolbar/index.js.map +1 -1
  18. package/build/components/block-toolbar/switch-section-style.js +105 -0
  19. package/build/components/block-toolbar/switch-section-style.js.map +1 -0
  20. package/build/components/collab/block-comment-icon-slot.js +2 -6
  21. package/build/components/collab/block-comment-icon-slot.js.map +1 -1
  22. package/build/components/collab/block-comment-icon-toolbar-slot.js +2 -6
  23. package/build/components/collab/block-comment-icon-toolbar-slot.js.map +1 -1
  24. package/build/components/color-palette/with-color-context.js +4 -2
  25. package/build/components/color-palette/with-color-context.js.map +1 -1
  26. package/build/components/font-family/index.js +14 -13
  27. package/build/components/font-family/index.js.map +1 -1
  28. package/build/components/global-styles/use-global-styles-output.js +1 -1
  29. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  30. package/build/components/iframe/index.js +13 -100
  31. package/build/components/iframe/index.js.map +1 -1
  32. package/build/components/iframe/use-scale-canvas.js +377 -0
  33. package/build/components/iframe/use-scale-canvas.js.map +1 -0
  34. package/build/components/image-editor/use-save-image.js +22 -3
  35. package/build/components/image-editor/use-save-image.js.map +1 -1
  36. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js +1 -5
  37. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  38. package/build/components/inserter/category-tabs/index.js +7 -8
  39. package/build/components/inserter/category-tabs/index.js.map +1 -1
  40. package/build/components/inserter-draggable-blocks/index.js +2 -1
  41. package/build/components/inserter-draggable-blocks/index.js.map +1 -1
  42. package/build/components/inspector-controls/slot.js +7 -4
  43. package/build/components/inspector-controls/slot.js.map +1 -1
  44. package/build/components/inspector-controls-tabs/position-controls-panel.js +1 -1
  45. package/build/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
  46. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js +4 -4
  47. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
  48. package/build/components/media-placeholder/index.js +29 -21
  49. package/build/components/media-placeholder/index.js.map +1 -1
  50. package/build/hooks/border.js +3 -3
  51. package/build/hooks/border.js.map +1 -1
  52. package/build/hooks/color.js +1 -1
  53. package/build/hooks/color.js.map +1 -1
  54. package/build/hooks/dimensions.js +2 -2
  55. package/build/hooks/dimensions.js.map +1 -1
  56. package/build/hooks/style.js +6 -6
  57. package/build/hooks/style.js.map +1 -1
  58. package/build/hooks/supports.js +1 -1
  59. package/build/hooks/supports.js.map +1 -1
  60. package/build/hooks/typography.js +1 -1
  61. package/build/hooks/typography.js.map +1 -1
  62. package/build/hooks/utils.js +1 -1
  63. package/build/hooks/utils.js.map +1 -1
  64. package/build/layouts/flex.js +11 -9
  65. package/build/layouts/flex.js.map +1 -1
  66. package/build/private-apis.js +4 -4
  67. package/build/private-apis.js.map +1 -1
  68. package/build/store/private-selectors.js +1 -1
  69. package/build/store/private-selectors.js.map +1 -1
  70. package/build/store/selectors.js +3 -0
  71. package/build/store/selectors.js.map +1 -1
  72. package/build-module/components/block-controls/slot.js +6 -3
  73. package/build-module/components/block-controls/slot.js.map +1 -1
  74. package/build-module/components/block-inspector/index.js +1 -2
  75. package/build-module/components/block-inspector/index.js.map +1 -1
  76. package/build-module/components/block-lock/modal.js +1 -1
  77. package/build-module/components/block-lock/modal.js.map +1 -1
  78. package/build-module/components/block-manager/category.js +71 -0
  79. package/build-module/components/block-manager/category.js.map +1 -0
  80. package/build-module/components/block-manager/checklist.js +32 -0
  81. package/build-module/components/block-manager/checklist.js.map +1 -0
  82. package/build-module/components/block-manager/index.js +102 -0
  83. package/build-module/components/block-manager/index.js.map +1 -0
  84. package/build-module/components/block-settings-menu/block-settings-dropdown.js +2 -2
  85. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  86. package/build-module/components/block-settings-menu/index.js +2 -2
  87. package/build-module/components/block-settings-menu/index.js.map +1 -1
  88. package/build-module/components/block-toolbar/index.js +16 -4
  89. package/build-module/components/block-toolbar/index.js.map +1 -1
  90. package/build-module/components/block-toolbar/switch-section-style.js +97 -0
  91. package/build-module/components/block-toolbar/switch-section-style.js.map +1 -0
  92. package/build-module/components/collab/block-comment-icon-slot.js +2 -6
  93. package/build-module/components/collab/block-comment-icon-slot.js.map +1 -1
  94. package/build-module/components/collab/block-comment-icon-toolbar-slot.js +2 -6
  95. package/build-module/components/collab/block-comment-icon-toolbar-slot.js.map +1 -1
  96. package/build-module/components/color-palette/with-color-context.js +4 -2
  97. package/build-module/components/color-palette/with-color-context.js.map +1 -1
  98. package/build-module/components/font-family/index.js +15 -14
  99. package/build-module/components/font-family/index.js.map +1 -1
  100. package/build-module/components/global-styles/use-global-styles-output.js +1 -1
  101. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  102. package/build-module/components/iframe/index.js +15 -102
  103. package/build-module/components/iframe/index.js.map +1 -1
  104. package/build-module/components/iframe/use-scale-canvas.js +371 -0
  105. package/build-module/components/iframe/use-scale-canvas.js.map +1 -0
  106. package/build-module/components/image-editor/use-save-image.js +22 -3
  107. package/build-module/components/image-editor/use-save-image.js.map +1 -1
  108. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js +1 -5
  109. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  110. package/build-module/components/inserter/category-tabs/index.js +8 -9
  111. package/build-module/components/inserter/category-tabs/index.js.map +1 -1
  112. package/build-module/components/inserter-draggable-blocks/index.js +2 -1
  113. package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
  114. package/build-module/components/inspector-controls/slot.js +7 -4
  115. package/build-module/components/inspector-controls/slot.js.map +1 -1
  116. package/build-module/components/inspector-controls-tabs/position-controls-panel.js +1 -1
  117. package/build-module/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
  118. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js +4 -4
  119. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
  120. package/build-module/components/media-placeholder/index.js +29 -21
  121. package/build-module/components/media-placeholder/index.js.map +1 -1
  122. package/build-module/hooks/border.js +3 -3
  123. package/build-module/hooks/border.js.map +1 -1
  124. package/build-module/hooks/color.js +1 -1
  125. package/build-module/hooks/color.js.map +1 -1
  126. package/build-module/hooks/dimensions.js +2 -2
  127. package/build-module/hooks/dimensions.js.map +1 -1
  128. package/build-module/hooks/style.js +6 -6
  129. package/build-module/hooks/style.js.map +1 -1
  130. package/build-module/hooks/supports.js +1 -1
  131. package/build-module/hooks/supports.js.map +1 -1
  132. package/build-module/hooks/typography.js +1 -1
  133. package/build-module/hooks/typography.js.map +1 -1
  134. package/build-module/hooks/utils.js +1 -1
  135. package/build-module/hooks/utils.js.map +1 -1
  136. package/build-module/layouts/flex.js +11 -9
  137. package/build-module/layouts/flex.js.map +1 -1
  138. package/build-module/private-apis.js +6 -6
  139. package/build-module/private-apis.js.map +1 -1
  140. package/build-module/store/private-selectors.js +1 -1
  141. package/build-module/store/private-selectors.js.map +1 -1
  142. package/build-module/store/selectors.js +3 -0
  143. package/build-module/store/selectors.js.map +1 -1
  144. package/build-style/content-rtl.css +27 -28
  145. package/build-style/content.css +27 -28
  146. package/build-style/style-rtl.css +108 -0
  147. package/build-style/style.css +108 -0
  148. package/package.json +2 -2
  149. package/src/components/block-canvas/style.scss +2 -1
  150. package/src/components/block-controls/slot.js +5 -3
  151. package/src/components/block-inspector/index.js +0 -2
  152. package/src/components/block-lock/modal.js +1 -1
  153. package/src/components/block-manager/category.js +102 -0
  154. package/src/components/block-manager/checklist.js +34 -0
  155. package/src/components/block-manager/index.js +127 -0
  156. package/src/components/block-manager/style.scss +82 -0
  157. package/src/components/block-mover/README.md +15 -8
  158. package/src/components/block-mover/stories/index.story.js +73 -71
  159. package/src/components/block-mover/style.scss +3 -0
  160. package/src/components/block-settings-menu/block-settings-dropdown.js +2 -2
  161. package/src/components/block-settings-menu/index.js +2 -2
  162. package/src/components/block-toolbar/index.js +14 -0
  163. package/src/components/block-toolbar/switch-section-style.js +115 -0
  164. package/src/components/block-tools/style.scss +39 -0
  165. package/src/components/collab/block-comment-icon-slot.js +2 -6
  166. package/src/components/collab/block-comment-icon-toolbar-slot.js +3 -5
  167. package/src/components/color-palette/test/__snapshots__/control.js.snap +2 -2
  168. package/src/components/color-palette/with-color-context.js +25 -7
  169. package/src/components/font-family/index.js +13 -13
  170. package/src/components/global-styles/test/use-global-styles-output.js +1 -1
  171. package/src/components/global-styles/use-global-styles-output.js +1 -1
  172. package/src/components/iframe/content.scss +49 -43
  173. package/src/components/iframe/index.js +14 -171
  174. package/src/components/iframe/use-scale-canvas.js +468 -0
  175. package/src/components/image-editor/use-save-image.js +27 -2
  176. package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +7 -16
  177. package/src/components/inserter/category-tabs/index.js +8 -9
  178. package/src/components/inserter-draggable-blocks/index.js +10 -1
  179. package/src/components/inspector-controls/README.md +2 -0
  180. package/src/components/inspector-controls/slot.js +6 -4
  181. package/src/components/inspector-controls-tabs/position-controls-panel.js +1 -3
  182. package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +10 -10
  183. package/src/components/media-placeholder/index.js +37 -33
  184. package/src/components/provider/test/use-block-sync.js +3 -1
  185. package/src/components/rich-text/content.scss +15 -10
  186. package/src/hooks/border.js +3 -9
  187. package/src/hooks/color.js +1 -1
  188. package/src/hooks/dimensions.js +2 -2
  189. package/src/hooks/style.js +6 -12
  190. package/src/hooks/supports.js +1 -1
  191. package/src/hooks/test/style.js +1 -2
  192. package/src/hooks/typography.js +1 -1
  193. package/src/hooks/utils.js +1 -1
  194. package/src/layouts/flex.js +26 -18
  195. package/src/private-apis.js +6 -6
  196. package/src/store/private-selectors.js +1 -1
  197. package/src/store/selectors.js +3 -0
  198. package/src/store/test/selectors.js +87 -58
  199. package/src/style.scss +1 -0
  200. package/build/components/block-info-slot-fill/index.js +0 -39
  201. package/build/components/block-info-slot-fill/index.js.map +0 -1
  202. package/build-module/components/block-info-slot-fill/index.js +0 -32
  203. package/build-module/components/block-info-slot-fill/index.js.map +0 -1
  204. package/src/components/block-info-slot-fill/index.js +0 -27
@@ -53,9 +53,7 @@ const PositionControlsPanel = () => {
53
53
  };
54
54
 
55
55
  const PositionControls = () => {
56
- const fills = useSlotFills(
57
- InspectorControlsGroups.position.Slot.__unstableName
58
- );
56
+ const fills = useSlotFills( InspectorControlsGroups.position.name );
59
57
  const hasFills = Boolean( fills && fills.length );
60
58
 
61
59
  if ( ! hasFills ) {
@@ -46,18 +46,18 @@ export default function useInspectorControlsTabs( blockName ) {
46
46
 
47
47
  // List View Tab: If there are any fills for the list group add that tab.
48
48
  const listViewDisabled = useIsListViewTabDisabled( blockName );
49
- const listFills = useSlotFills( listGroup.Slot.__unstableName );
49
+ const listFills = useSlotFills( listGroup.name );
50
50
  const hasListFills = ! listViewDisabled && !! listFills && listFills.length;
51
51
 
52
52
  // Styles Tab: Add this tab if there are any fills for block supports
53
53
  // e.g. border, color, spacing, typography, etc.
54
54
  const styleFills = [
55
- ...( useSlotFills( borderGroup.Slot.__unstableName ) || [] ),
56
- ...( useSlotFills( colorGroup.Slot.__unstableName ) || [] ),
57
- ...( useSlotFills( dimensionsGroup.Slot.__unstableName ) || [] ),
58
- ...( useSlotFills( stylesGroup.Slot.__unstableName ) || [] ),
59
- ...( useSlotFills( typographyGroup.Slot.__unstableName ) || [] ),
60
- ...( useSlotFills( effectsGroup.Slot.__unstableName ) || [] ),
55
+ ...( useSlotFills( borderGroup.name ) || [] ),
56
+ ...( useSlotFills( colorGroup.name ) || [] ),
57
+ ...( useSlotFills( dimensionsGroup.name ) || [] ),
58
+ ...( useSlotFills( stylesGroup.name ) || [] ),
59
+ ...( useSlotFills( typographyGroup.name ) || [] ),
60
+ ...( useSlotFills( effectsGroup.name ) || [] ),
61
61
  ];
62
62
  const hasStyleFills = styleFills.length;
63
63
 
@@ -67,12 +67,12 @@ export default function useInspectorControlsTabs( blockName ) {
67
67
  // the advanced controls slot as well to ensure they are rendered.
68
68
  const advancedFills = [
69
69
  ...( useSlotFills( InspectorAdvancedControls.slotName ) || [] ),
70
- ...( useSlotFills( bindingsGroup.Slot.__unstableName ) || [] ),
70
+ ...( useSlotFills( bindingsGroup.name ) || [] ),
71
71
  ];
72
72
 
73
73
  const settingsFills = [
74
- ...( useSlotFills( defaultGroup.Slot.__unstableName ) || [] ),
75
- ...( useSlotFills( positionGroup.Slot.__unstableName ) || [] ),
74
+ ...( useSlotFills( defaultGroup.name ) || [] ),
75
+ ...( useSlotFills( positionGroup.name ) || [] ),
76
76
  ...( hasListFills && hasStyleFills > 1 ? advancedFills : [] ),
77
77
  ];
78
78
 
@@ -239,7 +239,7 @@ export function MediaPlaceholder( {
239
239
  ( block.name === 'core/image' ||
240
240
  block.name === 'core/audio' ||
241
241
  block.name === 'core/video' ) &&
242
- block.attributes.url
242
+ ( block.attributes.url || block.attributes.src )
243
243
  ? [ block ]
244
244
  : recursivelyFindMediaFromBlocks( block.innerBlocks )
245
245
  );
@@ -252,33 +252,37 @@ export function MediaPlaceholder( {
252
252
  }
253
253
 
254
254
  const uploadedMediaList = await Promise.all(
255
- mediaBlocks.map( ( block ) =>
256
- block.attributes.id
257
- ? block.attributes
258
- : new Promise( ( resolve, reject ) => {
259
- window
260
- .fetch( block.attributes.url )
261
- .then( ( response ) => response.blob() )
262
- .then( ( blob ) =>
263
- mediaUpload( {
264
- filesList: [ blob ],
265
- additionalData: {
266
- title: block.attributes.title,
267
- alt_text: block.attributes.alt,
268
- caption: block.attributes.caption,
269
- },
270
- onFileChange: ( [ media ] ) => {
271
- if ( media.id ) {
272
- resolve( media );
273
- }
274
- },
275
- allowedTypes,
276
- onError: reject,
277
- } )
278
- )
279
- .catch( () => resolve( block.attributes.url ) );
280
- } )
281
- )
255
+ mediaBlocks.map( ( block ) => {
256
+ const blockType = block.name.split( '/' )[ 1 ];
257
+ if ( block.attributes.id ) {
258
+ block.attributes.type = blockType;
259
+ return block.attributes;
260
+ }
261
+ return new Promise( ( resolve, reject ) => {
262
+ window
263
+ .fetch( block.attributes.url )
264
+ .then( ( response ) => response.blob() )
265
+ .then( ( blob ) =>
266
+ mediaUpload( {
267
+ filesList: [ blob ],
268
+ additionalData: {
269
+ title: block.attributes.title,
270
+ alt_text: block.attributes.alt,
271
+ caption: block.attributes.caption,
272
+ type: blockType,
273
+ },
274
+ onFileChange: ( [ media ] ) => {
275
+ if ( media.id ) {
276
+ resolve( media );
277
+ }
278
+ },
279
+ allowedTypes,
280
+ onError: reject,
281
+ } )
282
+ )
283
+ .catch( () => resolve( block.attributes.url ) );
284
+ } );
285
+ } )
282
286
  ).catch( ( err ) => onError( err ) );
283
287
 
284
288
  if ( multiple ) {
@@ -288,8 +292,10 @@ export function MediaPlaceholder( {
288
292
  }
289
293
  }
290
294
 
291
- async function onHTMLDrop( HTML ) {
292
- const blocks = pasteHandler( { HTML } );
295
+ async function onDrop( event ) {
296
+ const blocks = pasteHandler( {
297
+ HTML: event.dataTransfer?.getData( 'default' ),
298
+ } );
293
299
  return await handleBlocksDrop( blocks );
294
300
  }
295
301
 
@@ -379,9 +385,7 @@ export function MediaPlaceholder( {
379
385
  return null;
380
386
  }
381
387
 
382
- return (
383
- <DropZone onFilesDrop={ onFilesUpload } onHTMLDrop={ onHTMLDrop } />
384
- );
388
+ return <DropZone onFilesDrop={ onFilesUpload } onDrop={ onDrop } />;
385
389
  };
386
390
 
387
391
  const renderCancelLink = () => {
@@ -22,7 +22,9 @@ jest.mock( '../../../store/actions', () => {
22
22
  ...actions,
23
23
  resetBlocks: jest.fn( actions.resetBlocks ),
24
24
  replaceInnerBlocks: jest.fn( actions.replaceInnerBlocks ),
25
- setHasControlledInnerBlocks: jest.fn( actions.replaceInnerBlocks ),
25
+ setHasControlledInnerBlocks: jest.fn(
26
+ actions.setHasControlledInnerBlocks
27
+ ),
26
28
  };
27
29
  } );
28
30
 
@@ -13,16 +13,6 @@
13
13
  &:focus {
14
14
  // Removes outline added by the browser.
15
15
  outline: none;
16
-
17
- [data-rich-text-format-boundary] {
18
- border-radius: $radius-small;
19
- }
20
- }
21
- }
22
-
23
- .block-editor-rich-text__editable {
24
- > p:first-child {
25
- margin-top: 0;
26
16
  }
27
17
  }
28
18
 
@@ -40,3 +30,18 @@ figcaption.block-editor-rich-text__editable [data-rich-text-placeholder]::before
40
30
  background: rgb(255, 255, 0);
41
31
  }
42
32
  }
33
+
34
+ [data-rich-text-comment],
35
+ [data-rich-text-format-boundary] {
36
+ border-radius: $radius-small;
37
+ }
38
+
39
+ [data-rich-text-comment] {
40
+ background-color: currentColor;
41
+
42
+ span {
43
+ filter: invert(100%);
44
+ color: currentColor;
45
+ padding: 0 2px;
46
+ }
47
+ }
@@ -31,7 +31,7 @@ import {
31
31
  import { store as blockEditorStore } from '../store';
32
32
  import { __ } from '@wordpress/i18n';
33
33
 
34
- export const BORDER_SUPPORT_KEY = '__experimentalBorder';
34
+ export const BORDER_SUPPORT_KEY = 'border';
35
35
  export const SHADOW_SUPPORT_KEY = 'shadow';
36
36
 
37
37
  const getColorByProperty = ( colors, property, value ) => {
@@ -161,14 +161,8 @@ export function BorderPanel( { clientId, name, setAttributes, settings } ) {
161
161
  }
162
162
 
163
163
  const defaultControls = {
164
- ...getBlockSupport( name, [
165
- BORDER_SUPPORT_KEY,
166
- '__experimentalDefaultControls',
167
- ] ),
168
- ...getBlockSupport( name, [
169
- SHADOW_SUPPORT_KEY,
170
- '__experimentalDefaultControls',
171
- ] ),
164
+ ...getBlockSupport( name, [ BORDER_SUPPORT_KEY, 'defaultControls' ] ),
165
+ ...getBlockSupport( name, [ SHADOW_SUPPORT_KEY, 'defaultControls' ] ),
172
166
  };
173
167
 
174
168
  return (
@@ -290,7 +290,7 @@ export function ColorEdit( { clientId, name, setAttributes, settings } ) {
290
290
 
291
291
  const defaultControls = getBlockSupport( name, [
292
292
  COLOR_SUPPORT_KEY,
293
- '__experimentalDefaultControls',
293
+ 'defaultControls',
294
294
  ] );
295
295
 
296
296
  const enableContrastChecking =
@@ -88,11 +88,11 @@ export function DimensionsPanel( { clientId, name, setAttributes, settings } ) {
88
88
 
89
89
  const defaultDimensionsControls = getBlockSupport( name, [
90
90
  DIMENSIONS_SUPPORT_KEY,
91
- '__experimentalDefaultControls',
91
+ 'defaultControls',
92
92
  ] );
93
93
  const defaultSpacingControls = getBlockSupport( name, [
94
94
  SPACING_SUPPORT_KEY,
95
- '__experimentalDefaultControls',
95
+ 'defaultControls',
96
96
  ] );
97
97
  const defaultControls = {
98
98
  ...defaultDimensionsControls,
@@ -98,22 +98,16 @@ function addAttribute( settings ) {
98
98
  * @type {Record<string, string[]>}
99
99
  */
100
100
  const skipSerializationPathsEdit = {
101
- [ `${ BORDER_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [ 'border' ],
102
- [ `${ COLOR_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [
103
- COLOR_SUPPORT_KEY,
104
- ],
105
- [ `${ TYPOGRAPHY_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [
101
+ [ `${ BORDER_SUPPORT_KEY }.skipSerialization` ]: [ 'border' ],
102
+ [ `${ COLOR_SUPPORT_KEY }.skipSerialization` ]: [ COLOR_SUPPORT_KEY ],
103
+ [ `${ TYPOGRAPHY_SUPPORT_KEY }.skipSerialization` ]: [
106
104
  TYPOGRAPHY_SUPPORT_KEY,
107
105
  ],
108
- [ `${ DIMENSIONS_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [
106
+ [ `${ DIMENSIONS_SUPPORT_KEY }.skipSerialization` ]: [
109
107
  DIMENSIONS_SUPPORT_KEY,
110
108
  ],
111
- [ `${ SPACING_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [
112
- SPACING_SUPPORT_KEY,
113
- ],
114
- [ `${ SHADOW_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [
115
- SHADOW_SUPPORT_KEY,
116
- ],
109
+ [ `${ SPACING_SUPPORT_KEY }.skipSerialization` ]: [ SPACING_SUPPORT_KEY ],
110
+ [ `${ SHADOW_SUPPORT_KEY }.skipSerialization` ]: [ SHADOW_SUPPORT_KEY ],
117
111
  };
118
112
 
119
113
  /**
@@ -6,7 +6,7 @@ import { Platform } from '@wordpress/element';
6
6
 
7
7
  const ALIGN_SUPPORT_KEY = 'align';
8
8
  const ALIGN_WIDE_SUPPORT_KEY = 'alignWide';
9
- const BORDER_SUPPORT_KEY = '__experimentalBorder';
9
+ const BORDER_SUPPORT_KEY = 'border';
10
10
  const COLOR_SUPPORT_KEY = 'color';
11
11
  const CUSTOM_CLASS_NAME_SUPPORT_KEY = 'customClassName';
12
12
  const FONT_FAMILY_SUPPORT_KEY = 'typography.fontFamily';
@@ -133,8 +133,7 @@ describe( 'addSaveProps', () => {
133
133
  const applySkipSerialization = ( features ) => {
134
134
  const updatedSettings = { ...blockSettings };
135
135
  Object.keys( features ).forEach( ( key ) => {
136
- updatedSettings.supports[ key ].__experimentalSkipSerialization =
137
- features[ key ];
136
+ updatedSettings.supports[ key ].skipSerialization = features[ key ];
138
137
  } );
139
138
  return updatedSettings;
140
139
  };
@@ -133,7 +133,7 @@ export function TypographyPanel( { clientId, name, setAttributes, settings } ) {
133
133
 
134
134
  const defaultControls = getBlockSupport( name, [
135
135
  TYPOGRAPHY_SUPPORT_KEY,
136
- '__experimentalDefaultControls',
136
+ 'defaultControls',
137
137
  ] );
138
138
 
139
139
  return (
@@ -124,7 +124,7 @@ export function shouldSkipSerialization(
124
124
  feature
125
125
  ) {
126
126
  const support = getBlockSupport( blockNameOrType, featureSet );
127
- const skipSerialization = support?.__experimentalSkipSerialization;
127
+ const skipSerialization = support?.skipSerialization;
128
128
 
129
129
  if ( Array.isArray( skipSerialization ) ) {
130
130
  return skipSerialization.includes( feature );
@@ -66,24 +66,27 @@ export default {
66
66
  onChange,
67
67
  layoutBlockSupport = {},
68
68
  } ) {
69
- const { allowOrientation = true } = layoutBlockSupport;
69
+ const { allowOrientation = true, allowJustification = true } =
70
+ layoutBlockSupport;
70
71
  return (
71
72
  <>
72
73
  <Flex>
73
- <FlexItem>
74
- <FlexLayoutJustifyContentControl
75
- layout={ layout }
76
- onChange={ onChange }
77
- />
78
- </FlexItem>
79
- <FlexItem>
80
- { allowOrientation && (
74
+ { allowJustification && (
75
+ <FlexItem>
76
+ <FlexLayoutJustifyContentControl
77
+ layout={ layout }
78
+ onChange={ onChange }
79
+ />
80
+ </FlexItem>
81
+ ) }
82
+ { allowOrientation && (
83
+ <FlexItem>
81
84
  <OrientationControl
82
85
  layout={ layout }
83
86
  onChange={ onChange }
84
87
  />
85
- ) }
86
- </FlexItem>
88
+ </FlexItem>
89
+ ) }
87
90
  </Flex>
88
91
  <FlexWrapControl layout={ layout } onChange={ onChange } />
89
92
  </>
@@ -94,17 +97,22 @@ export default {
94
97
  onChange,
95
98
  layoutBlockSupport,
96
99
  } ) {
97
- if ( layoutBlockSupport?.allowSwitching ) {
100
+ const { allowVerticalAlignment = true, allowJustification = true } =
101
+ layoutBlockSupport;
102
+
103
+ if ( ! allowJustification && ! allowVerticalAlignment ) {
98
104
  return null;
99
105
  }
100
- const { allowVerticalAlignment = true } = layoutBlockSupport;
106
+
101
107
  return (
102
108
  <BlockControls group="block" __experimentalShareWithChildBlocks>
103
- <FlexLayoutJustifyContentControl
104
- layout={ layout }
105
- onChange={ onChange }
106
- isToolbar
107
- />
109
+ { allowJustification && (
110
+ <FlexLayoutJustifyContentControl
111
+ layout={ layout }
112
+ onChange={ onChange }
113
+ isToolbar
114
+ />
115
+ ) }
108
116
  { allowVerticalAlignment && (
109
117
  <FlexLayoutVerticalAlignmentControl
110
118
  layout={ layout }
@@ -13,11 +13,11 @@ import {
13
13
  normalizeString,
14
14
  } from './components/inserter/search-items';
15
15
  import { PrivateListView } from './components/list-view';
16
- import BlockInfo from './components/block-info-slot-fill';
17
16
  import { useHasBlockToolbar } from './components/block-toolbar/use-has-block-toolbar';
18
17
  import { cleanEmptyObject } from './hooks/utils';
19
18
  import BlockQuickNavigation from './components/block-quick-navigation';
20
19
  import { LayoutStyle } from './components/block-list/layout';
20
+ import BlockManager from './components/block-manager';
21
21
  import { BlockRemovalWarningModal } from './components/block-removal-warning-modal';
22
22
  import {
23
23
  setBackgroundStyleDefaults,
@@ -48,8 +48,8 @@ import { PrivatePublishDateTimePicker } from './components/publish-date-time-pic
48
48
  import useSpacingSizes from './components/spacing-sizes-control/hooks/use-spacing-sizes';
49
49
  import useBlockDisplayTitle from './components/block-title/use-block-display-title';
50
50
  import TabbedSidebar from './components/tabbed-sidebar';
51
- import __unstableCommentIconFill from './components/collab/block-comment-icon-slot';
52
- import __unstableCommentIconToolbarFill from './components/collab/block-comment-icon-toolbar-slot';
51
+ import CommentIconSlotFill from './components/collab/block-comment-icon-slot';
52
+ import CommentIconToolbarSlotFill from './components/collab/block-comment-icon-toolbar-slot';
53
53
  /**
54
54
  * Private @wordpress/block-editor APIs.
55
55
  */
@@ -66,11 +66,11 @@ lock( privateApis, {
66
66
  normalizeString,
67
67
  PrivateListView,
68
68
  ResizableBoxPopover,
69
- BlockInfo,
70
69
  useHasBlockToolbar,
71
70
  cleanEmptyObject,
72
71
  BlockQuickNavigation,
73
72
  LayoutStyle,
73
+ BlockManager,
74
74
  BlockRemovalWarningModal,
75
75
  useLayoutClasses,
76
76
  useLayoutStyles,
@@ -95,6 +95,6 @@ lock( privateApis, {
95
95
  __unstableBlockStyleVariationOverridesWithConfig,
96
96
  setBackgroundStyleDefaults,
97
97
  sectionRootClientIdKey,
98
- __unstableCommentIconFill,
99
- __unstableCommentIconToolbarFill,
98
+ CommentIconSlotFill,
99
+ CommentIconToolbarSlotFill,
100
100
  } );
@@ -330,7 +330,7 @@ function mapUserPattern(
330
330
  id: userPattern.id,
331
331
  type: INSERTER_PATTERN_TYPES.user,
332
332
  title: userPattern.title.raw,
333
- categories: userPattern.wp_pattern_category.map( ( catId ) => {
333
+ categories: userPattern.wp_pattern_category?.map( ( catId ) => {
334
334
  const category = __experimentalUserPatternCategories.find(
335
335
  ( { id } ) => id === catId
336
336
  );
@@ -2774,6 +2774,9 @@ export function isNavigationMode( state ) {
2774
2774
  */
2775
2775
  export const __unstableGetEditorMode = createRegistrySelector(
2776
2776
  ( select ) => ( state ) => {
2777
+ if ( ! window?.__experimentalEditorWriteMode ) {
2778
+ return 'edit';
2779
+ }
2777
2780
  return (
2778
2781
  state.settings.editorTool ??
2779
2782
  select( preferencesStore ).get( 'core', 'editorTool' )
@@ -4615,68 +4615,97 @@ describe( 'getBlockEditingMode', () => {
4615
4615
  ).toBe( 'contentOnly' );
4616
4616
  } );
4617
4617
 
4618
- it( 'in navigation mode, the root section container is default', () => {
4619
- dispatch( preferencesStore ).set( 'core', 'editorTool', 'navigation' );
4620
- expect(
4621
- getBlockEditingMode(
4622
- navigationModeStateWithRootSection,
4623
- 'ef45d5fd-5234-4fd5-ac4f-c3736c7f9337'
4624
- )
4625
- ).toBe( 'default' );
4626
- } );
4618
+ describe( 'navigation mode', () => {
4619
+ const writeModeExperiment = window.__experimentalEditorWriteMode;
4620
+ beforeAll( () => {
4621
+ window.__experimentalEditorWriteMode = true;
4622
+ } );
4623
+ afterAll( () => {
4624
+ window.__experimentalEditorWriteMode = writeModeExperiment;
4625
+ } );
4626
+ it( 'in navigation mode, the root section container is default', () => {
4627
+ dispatch( preferencesStore ).set(
4628
+ 'core',
4629
+ 'editorTool',
4630
+ 'navigation'
4631
+ );
4632
+ expect(
4633
+ getBlockEditingMode(
4634
+ navigationModeStateWithRootSection,
4635
+ 'ef45d5fd-5234-4fd5-ac4f-c3736c7f9337'
4636
+ )
4637
+ ).toBe( 'default' );
4638
+ } );
4627
4639
 
4628
- it( 'in navigation mode, anything outside the section container is disabled', () => {
4629
- dispatch( preferencesStore ).set( 'core', 'editorTool', 'navigation' );
4630
- expect(
4631
- getBlockEditingMode(
4632
- navigationModeStateWithRootSection,
4633
- '6cf70164-9097-4460-bcbf-200560546988'
4634
- )
4635
- ).toBe( 'disabled' );
4636
- } );
4640
+ it( 'in navigation mode, anything outside the section container is disabled', () => {
4641
+ dispatch( preferencesStore ).set(
4642
+ 'core',
4643
+ 'editorTool',
4644
+ 'navigation'
4645
+ );
4646
+ expect(
4647
+ getBlockEditingMode(
4648
+ navigationModeStateWithRootSection,
4649
+ '6cf70164-9097-4460-bcbf-200560546988'
4650
+ )
4651
+ ).toBe( 'disabled' );
4652
+ } );
4637
4653
 
4638
- it( 'in navigation mode, sections are contentOnly', () => {
4639
- dispatch( preferencesStore ).set( 'core', 'editorTool', 'navigation' );
4640
- expect(
4641
- getBlockEditingMode(
4642
- navigationModeStateWithRootSection,
4643
- 'b26fc763-417d-4f01-b81c-2ec61e14a972'
4644
- )
4645
- ).toBe( 'contentOnly' );
4646
- expect(
4647
- getBlockEditingMode(
4648
- navigationModeStateWithRootSection,
4649
- '9b9c5c3f-2e46-4f02-9e14-9fe9515b958f'
4650
- )
4651
- ).toBe( 'contentOnly' );
4652
- } );
4654
+ it( 'in navigation mode, sections are contentOnly', () => {
4655
+ dispatch( preferencesStore ).set(
4656
+ 'core',
4657
+ 'editorTool',
4658
+ 'navigation'
4659
+ );
4660
+ expect(
4661
+ getBlockEditingMode(
4662
+ navigationModeStateWithRootSection,
4663
+ 'b26fc763-417d-4f01-b81c-2ec61e14a972'
4664
+ )
4665
+ ).toBe( 'contentOnly' );
4666
+ expect(
4667
+ getBlockEditingMode(
4668
+ navigationModeStateWithRootSection,
4669
+ '9b9c5c3f-2e46-4f02-9e14-9fe9515b958f'
4670
+ )
4671
+ ).toBe( 'contentOnly' );
4672
+ } );
4653
4673
 
4654
- it( 'in navigation mode, blocks with content attributes within sections are contentOnly', () => {
4655
- dispatch( preferencesStore ).set( 'core', 'editorTool', 'navigation' );
4656
- hasContentRoleAttribute.mockReturnValueOnce( true );
4657
- expect(
4658
- getBlockEditingMode(
4659
- navigationModeStateWithRootSection,
4660
- 'b3247f75-fd94-4fef-97f9-5bfd162cc416'
4661
- )
4662
- ).toBe( 'contentOnly' );
4674
+ it( 'in navigation mode, blocks with content attributes within sections are contentOnly', () => {
4675
+ dispatch( preferencesStore ).set(
4676
+ 'core',
4677
+ 'editorTool',
4678
+ 'navigation'
4679
+ );
4680
+ hasContentRoleAttribute.mockReturnValueOnce( true );
4681
+ expect(
4682
+ getBlockEditingMode(
4683
+ navigationModeStateWithRootSection,
4684
+ 'b3247f75-fd94-4fef-97f9-5bfd162cc416'
4685
+ )
4686
+ ).toBe( 'contentOnly' );
4663
4687
 
4664
- hasContentRoleAttribute.mockReturnValueOnce( true );
4665
- expect(
4666
- getBlockEditingMode(
4667
- navigationModeStateWithRootSection,
4668
- 'e178812d-ce5e-48c7-a945-8ae4ffcbbb7c'
4669
- )
4670
- ).toBe( 'contentOnly' );
4671
- } );
4688
+ hasContentRoleAttribute.mockReturnValueOnce( true );
4689
+ expect(
4690
+ getBlockEditingMode(
4691
+ navigationModeStateWithRootSection,
4692
+ 'e178812d-ce5e-48c7-a945-8ae4ffcbbb7c'
4693
+ )
4694
+ ).toBe( 'contentOnly' );
4695
+ } );
4672
4696
 
4673
- it( 'in navigation mode, blocks without content attributes within sections are disabled', () => {
4674
- dispatch( preferencesStore ).set( 'core', 'editorTool', 'navigation' );
4675
- expect(
4676
- getBlockEditingMode(
4677
- navigationModeStateWithRootSection,
4678
- '9b9c5c3f-2e46-4f02-9e14-9fed515b958s'
4679
- )
4680
- ).toBe( 'disabled' );
4697
+ it( 'in navigation mode, blocks without content attributes within sections are disabled', () => {
4698
+ dispatch( preferencesStore ).set(
4699
+ 'core',
4700
+ 'editorTool',
4701
+ 'navigation'
4702
+ );
4703
+ expect(
4704
+ getBlockEditingMode(
4705
+ navigationModeStateWithRootSection,
4706
+ '9b9c5c3f-2e46-4f02-9e14-9fed515b958s'
4707
+ )
4708
+ ).toBe( 'disabled' );
4709
+ } );
4681
4710
  } );
4682
4711
  } );
package/src/style.scss CHANGED
@@ -10,6 +10,7 @@
10
10
  @import "./components/block-card/style.scss";
11
11
  @import "./components/block-compare/style.scss";
12
12
  @import "./components/block-draggable/style.scss";
13
+ @import "./components/block-manager/style.scss";
13
14
  @import "./components/block-mover/style.scss";
14
15
  @import "./components/block-navigation/style.scss";
15
16
  @import "./components/block-patterns-list/style.scss";
@@ -1,39 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _components = require("@wordpress/components");
8
- var _lockUnlock = require("../../lock-unlock");
9
- var _context = require("../block-edit/context");
10
- var _jsxRuntime = require("react/jsx-runtime");
11
- /**
12
- * WordPress dependencies
13
- */
14
-
15
- /**
16
- * Internal dependencies
17
- */
18
-
19
- const {
20
- createPrivateSlotFill
21
- } = (0, _lockUnlock.unlock)(_components.privateApis);
22
- const {
23
- Fill,
24
- Slot
25
- } = createPrivateSlotFill('BlockInformation');
26
- const BlockInfo = props => {
27
- const context = (0, _context.useBlockEditContext)();
28
- if (!context[_context.mayDisplayControlsKey]) {
29
- return null;
30
- }
31
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(Fill, {
32
- ...props
33
- });
34
- };
35
- BlockInfo.Slot = props => /*#__PURE__*/(0, _jsxRuntime.jsx)(Slot, {
36
- ...props
37
- });
38
- var _default = exports.default = BlockInfo;
39
- //# sourceMappingURL=index.js.map