@wordpress/block-editor 15.3.1-next.a730c9c8c.0 → 15.4.1-next.233ccab9b.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.
- package/CHANGELOG.md +2 -0
- package/build/components/block-inspector/index.js +110 -95
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-switcher/index.js +4 -3
- package/build/components/block-switcher/index.js.map +1 -1
- package/build/components/inspector-controls-tabs/content-tab.js +34 -0
- package/build/components/inspector-controls-tabs/content-tab.js.map +1 -0
- package/build/components/inspector-controls-tabs/index.js +12 -2
- package/build/components/inspector-controls-tabs/index.js.map +1 -1
- package/build/components/inspector-controls-tabs/styles-tab.js +24 -21
- package/build/components/inspector-controls-tabs/styles-tab.js.map +1 -1
- package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js +9 -5
- package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
- package/build/components/inspector-controls-tabs/utils.js +7 -1
- package/build/components/inspector-controls-tabs/utils.js.map +1 -1
- package/build/components/rich-text/index.js +4 -1
- package/build/components/rich-text/index.js.map +1 -1
- package/build/private-apis.js +3 -1
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +3 -2
- package/build/store/actions.js.map +1 -1
- package/build-module/components/block-inspector/index.js +110 -95
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-switcher/index.js +4 -3
- package/build-module/components/block-switcher/index.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/content-tab.js +26 -0
- package/build-module/components/inspector-controls-tabs/content-tab.js.map +1 -0
- package/build-module/components/inspector-controls-tabs/index.js +13 -3
- package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/styles-tab.js +24 -21
- package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js +10 -6
- package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/utils.js +7 -1
- package/build-module/components/inspector-controls-tabs/utils.js.map +1 -1
- package/build-module/components/rich-text/index.js +4 -1
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/private-apis.js +3 -1
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js +3 -2
- package/build-module/store/actions.js.map +1 -1
- package/package.json +34 -34
- package/src/components/block-inspector/index.js +134 -114
- package/src/components/block-switcher/index.js +8 -3
- package/src/components/inspector-controls-tabs/content-tab.js +24 -0
- package/src/components/inspector-controls-tabs/index.js +8 -1
- package/src/components/inspector-controls-tabs/styles-tab.js +33 -21
- package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +19 -6
- package/src/components/inspector-controls-tabs/utils.js +8 -1
- package/src/components/rich-text/index.js +8 -1
- package/src/private-apis.js +2 -0
- 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
|
|
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 );
|
package/src/private-apis.js
CHANGED
|
@@ -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
|
} );
|
package/src/store/actions.js
CHANGED
|
@@ -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,
|
|
1885
|
+
await new Promise( ( resolve ) => setTimeout( resolve, timeout ) );
|
|
1885
1886
|
dispatch( toggleBlockHighlight( clientId, false ) );
|
|
1886
1887
|
};
|
|
1887
1888
|
|