@wordpress/block-editor 15.3.1-next.a730c9c8c.0 → 15.4.1-next.f56bd8138.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 (52) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/block-inspector/index.js +110 -95
  3. package/build/components/block-inspector/index.js.map +1 -1
  4. package/build/components/block-switcher/index.js +4 -3
  5. package/build/components/block-switcher/index.js.map +1 -1
  6. package/build/components/inspector-controls-tabs/content-tab.js +34 -0
  7. package/build/components/inspector-controls-tabs/content-tab.js.map +1 -0
  8. package/build/components/inspector-controls-tabs/index.js +12 -2
  9. package/build/components/inspector-controls-tabs/index.js.map +1 -1
  10. package/build/components/inspector-controls-tabs/styles-tab.js +24 -21
  11. package/build/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  12. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js +9 -5
  13. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
  14. package/build/components/inspector-controls-tabs/utils.js +7 -1
  15. package/build/components/inspector-controls-tabs/utils.js.map +1 -1
  16. package/build/components/rich-text/index.js +4 -1
  17. package/build/components/rich-text/index.js.map +1 -1
  18. package/build/private-apis.js +3 -1
  19. package/build/private-apis.js.map +1 -1
  20. package/build/store/actions.js +3 -2
  21. package/build/store/actions.js.map +1 -1
  22. package/build-module/components/block-inspector/index.js +110 -95
  23. package/build-module/components/block-inspector/index.js.map +1 -1
  24. package/build-module/components/block-switcher/index.js +4 -3
  25. package/build-module/components/block-switcher/index.js.map +1 -1
  26. package/build-module/components/inspector-controls-tabs/content-tab.js +26 -0
  27. package/build-module/components/inspector-controls-tabs/content-tab.js.map +1 -0
  28. package/build-module/components/inspector-controls-tabs/index.js +13 -3
  29. package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
  30. package/build-module/components/inspector-controls-tabs/styles-tab.js +24 -21
  31. package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  32. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js +10 -6
  33. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
  34. package/build-module/components/inspector-controls-tabs/utils.js +7 -1
  35. package/build-module/components/inspector-controls-tabs/utils.js.map +1 -1
  36. package/build-module/components/rich-text/index.js +4 -1
  37. package/build-module/components/rich-text/index.js.map +1 -1
  38. package/build-module/private-apis.js +3 -1
  39. package/build-module/private-apis.js.map +1 -1
  40. package/build-module/store/actions.js +3 -2
  41. package/build-module/store/actions.js.map +1 -1
  42. package/package.json +34 -34
  43. package/src/components/block-inspector/index.js +134 -114
  44. package/src/components/block-switcher/index.js +8 -3
  45. package/src/components/inspector-controls-tabs/content-tab.js +24 -0
  46. package/src/components/inspector-controls-tabs/index.js +8 -1
  47. package/src/components/inspector-controls-tabs/styles-tab.js +33 -21
  48. package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +19 -6
  49. package/src/components/inspector-controls-tabs/utils.js +8 -1
  50. package/src/components/rich-text/index.js +8 -1
  51. package/src/private-apis.js +2 -0
  52. package/src/store/actions.js +3 -2
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { cog, styles, listView } from '@wordpress/icons';
4
+ import { cog, styles, listView, page } from '@wordpress/icons';
5
5
  import { __ } from '@wordpress/i18n';
6
6
 
7
7
  export const TAB_SETTINGS = {
@@ -18,6 +18,13 @@ export const TAB_STYLES = {
18
18
  icon: styles,
19
19
  };
20
20
 
21
+ export const TAB_CONTENT = {
22
+ name: 'content',
23
+ title: __( 'Content' ),
24
+ value: 'content',
25
+ icon: page,
26
+ };
27
+
21
28
  export const TAB_LIST_VIEW = {
22
29
  name: 'list',
23
30
  title: __( 'List View' ),
@@ -253,8 +253,15 @@ export function RichTextWrapper(
253
253
  blockContext,
254
254
  ]
255
255
  );
256
+ const isInsidePatternOverrides = !! blockContext?.[ 'pattern/overrides' ];
257
+ const hasOverrideEnabled =
258
+ blockBindings?.__default?.source === 'core/pattern-overrides';
256
259
 
257
- const shouldDisableEditing = readOnly || disableBoundBlock;
260
+ const shouldDisableForPattern =
261
+ isInsidePatternOverrides && ! hasOverrideEnabled;
262
+
263
+ const shouldDisableEditing =
264
+ readOnly || disableBoundBlock || shouldDisableForPattern;
258
265
 
259
266
  const { getSelectionStart, getSelectionEnd, getBlockRootClientId } =
260
267
  useSelect( blockEditorStore );
@@ -53,6 +53,7 @@ import TabbedSidebar from './components/tabbed-sidebar';
53
53
  import CommentIconSlotFill from './components/collab/block-comment-icon-slot';
54
54
  import CommentIconToolbarSlotFill from './components/collab/block-comment-icon-toolbar-slot';
55
55
  import HTMLElementControl from './components/html-element-control';
56
+ import { useBlockElement } from './components/block-list/use-block-props/use-block-refs';
56
57
  /**
57
58
  * Private @wordpress/block-editor APIs.
58
59
  */
@@ -103,4 +104,5 @@ lock( privateApis, {
103
104
  CommentIconToolbarSlotFill,
104
105
  mediaEditKey,
105
106
  essentialFormatKey,
107
+ useBlockElement,
106
108
  } );
@@ -1876,12 +1876,13 @@ export function toggleBlockHighlight( clientId, isHighlighted ) {
1876
1876
  * Action that "flashes" the block with a given `clientId` by rhythmically highlighting it.
1877
1877
  *
1878
1878
  * @param {string} clientId Target block client ID.
1879
+ * @param {number} timeout Duration in milliseconds to keep the highlight. Defaults to 150ms.
1879
1880
  */
1880
1881
  export const flashBlock =
1881
- ( clientId ) =>
1882
+ ( clientId, timeout = 150 ) =>
1882
1883
  async ( { dispatch } ) => {
1883
1884
  dispatch( toggleBlockHighlight( clientId, true ) );
1884
- await new Promise( ( resolve ) => setTimeout( resolve, 150 ) );
1885
+ await new Promise( ( resolve ) => setTimeout( resolve, timeout ) );
1885
1886
  dispatch( toggleBlockHighlight( clientId, false ) );
1886
1887
  };
1887
1888