@wordpress/block-editor 15.12.0 → 15.12.2-next.v.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 +6 -0
- package/build/components/block-allowed-blocks/modal.cjs +1 -1
- package/build/components/block-allowed-blocks/modal.cjs.map +2 -2
- package/build/components/block-inspector/index.cjs +9 -9
- package/build/components/block-inspector/index.cjs.map +3 -3
- package/build/components/block-removal-warning-modal/index.cjs +30 -5
- package/build/components/block-removal-warning-modal/index.cjs.map +3 -3
- package/build/components/block-visibility/use-block-visibility.cjs +14 -29
- package/build/components/block-visibility/use-block-visibility.cjs.map +2 -2
- package/build/components/global-styles/hooks.cjs +7 -0
- package/build/components/global-styles/hooks.cjs.map +2 -2
- package/build/components/global-styles/typography-panel.cjs +71 -3
- package/build/components/global-styles/typography-panel.cjs.map +3 -3
- package/build/components/grid/grid-visualizer.cjs +49 -13
- package/build/components/grid/grid-visualizer.cjs.map +2 -2
- package/build/components/iframe/index.cjs +3 -1
- package/build/components/iframe/index.cjs.map +2 -2
- package/build/components/iframe/use-scale-canvas.cjs +1 -0
- package/build/components/iframe/use-scale-canvas.cjs.map +2 -2
- package/build/components/inspector-controls/last-item.cjs +41 -0
- package/build/components/inspector-controls/last-item.cjs.map +7 -0
- package/build/components/inspector-controls-tabs/styles-tab.cjs +3 -3
- package/build/components/inspector-controls-tabs/styles-tab.cjs.map +2 -2
- package/build/components/link-control/index.cjs +73 -2
- package/build/components/link-control/index.cjs.map +3 -3
- package/build/components/link-control/is-url-like.cjs +15 -3
- package/build/components/link-control/is-url-like.cjs.map +2 -2
- package/build/components/link-control/search-input.cjs +4 -1
- package/build/components/link-control/search-input.cjs.map +2 -2
- package/build/components/link-control/use-search-handler.cjs +1 -1
- package/build/components/link-control/use-search-handler.cjs.map +2 -2
- package/build/components/provider/use-block-sync.cjs +60 -8
- package/build/components/provider/use-block-sync.cjs.map +2 -2
- package/build/components/text-indent-control/index.cjs +121 -0
- package/build/components/text-indent-control/index.cjs.map +7 -0
- package/build/components/url-input/index.cjs +22 -2
- package/build/components/url-input/index.cjs.map +3 -3
- package/build/components/url-popover/image-url-input-ui.cjs +1 -1
- package/build/components/url-popover/image-url-input-ui.cjs.map +2 -2
- package/build/components/writing-flow/use-arrow-nav.cjs +0 -3
- package/build/components/writing-flow/use-arrow-nav.cjs.map +2 -2
- package/build/hooks/anchor.cjs +1 -1
- package/build/hooks/anchor.cjs.map +1 -1
- package/build/hooks/aria-label.cjs +2 -1
- package/build/hooks/aria-label.cjs.map +2 -2
- package/build/hooks/grid-visualizer.cjs +59 -6
- package/build/hooks/grid-visualizer.cjs.map +3 -3
- package/build/hooks/layout-child.cjs +47 -6
- package/build/hooks/layout-child.cjs.map +3 -3
- package/build/hooks/typography.cjs +2 -0
- package/build/hooks/typography.cjs.map +2 -2
- package/build/hooks/utils.cjs +4 -0
- package/build/hooks/utils.cjs.map +2 -2
- package/build/private-apis.cjs +2 -0
- package/build/private-apis.cjs.map +3 -3
- package/build/store/actions.cjs +2 -2
- package/build/store/actions.cjs.map +2 -2
- package/build-module/components/block-allowed-blocks/modal.mjs +2 -2
- package/build-module/components/block-allowed-blocks/modal.mjs.map +2 -2
- package/build-module/components/block-inspector/index.mjs +10 -9
- package/build-module/components/block-inspector/index.mjs.map +2 -2
- package/build-module/components/block-removal-warning-modal/index.mjs +34 -7
- package/build-module/components/block-removal-warning-modal/index.mjs.map +2 -2
- package/build-module/components/block-visibility/use-block-visibility.mjs +14 -29
- package/build-module/components/block-visibility/use-block-visibility.mjs.map +2 -2
- package/build-module/components/global-styles/hooks.mjs +7 -0
- package/build-module/components/global-styles/hooks.mjs.map +2 -2
- package/build-module/components/global-styles/typography-panel.mjs +73 -4
- package/build-module/components/global-styles/typography-panel.mjs.map +2 -2
- package/build-module/components/grid/grid-visualizer.mjs +50 -14
- package/build-module/components/grid/grid-visualizer.mjs.map +2 -2
- package/build-module/components/iframe/index.mjs +9 -2
- package/build-module/components/iframe/index.mjs.map +2 -2
- package/build-module/components/iframe/use-scale-canvas.mjs +1 -0
- package/build-module/components/iframe/use-scale-canvas.mjs.map +2 -2
- package/build-module/components/inspector-controls/last-item.mjs +23 -0
- package/build-module/components/inspector-controls/last-item.mjs.map +7 -0
- package/build-module/components/inspector-controls-tabs/styles-tab.mjs +3 -3
- package/build-module/components/inspector-controls-tabs/styles-tab.mjs.map +2 -2
- package/build-module/components/link-control/index.mjs +74 -3
- package/build-module/components/link-control/index.mjs.map +2 -2
- package/build-module/components/link-control/is-url-like.mjs +10 -3
- package/build-module/components/link-control/is-url-like.mjs.map +2 -2
- package/build-module/components/link-control/search-input.mjs +4 -1
- package/build-module/components/link-control/search-input.mjs.map +2 -2
- package/build-module/components/link-control/use-search-handler.mjs +2 -2
- package/build-module/components/link-control/use-search-handler.mjs.map +2 -2
- package/build-module/components/provider/use-block-sync.mjs +60 -8
- package/build-module/components/provider/use-block-sync.mjs.map +2 -2
- package/build-module/components/text-indent-control/index.mjs +110 -0
- package/build-module/components/text-indent-control/index.mjs.map +7 -0
- package/build-module/components/url-input/index.mjs +24 -4
- package/build-module/components/url-input/index.mjs.map +2 -2
- package/build-module/components/url-popover/image-url-input-ui.mjs +2 -2
- package/build-module/components/url-popover/image-url-input-ui.mjs.map +2 -2
- package/build-module/components/writing-flow/use-arrow-nav.mjs +0 -3
- package/build-module/components/writing-flow/use-arrow-nav.mjs.map +2 -2
- package/build-module/hooks/anchor.mjs +1 -1
- package/build-module/hooks/anchor.mjs.map +1 -1
- package/build-module/hooks/aria-label.mjs +2 -1
- package/build-module/hooks/aria-label.mjs.map +2 -2
- package/build-module/hooks/grid-visualizer.mjs +37 -6
- package/build-module/hooks/grid-visualizer.mjs.map +2 -2
- package/build-module/hooks/layout-child.mjs +37 -6
- package/build-module/hooks/layout-child.mjs.map +2 -2
- package/build-module/hooks/typography.mjs +2 -0
- package/build-module/hooks/typography.mjs.map +2 -2
- package/build-module/hooks/utils.mjs +4 -0
- package/build-module/hooks/utils.mjs.map +2 -2
- package/build-module/private-apis.mjs +2 -0
- package/build-module/private-apis.mjs.map +2 -2
- package/build-module/store/actions.mjs +2 -2
- package/build-module/store/actions.mjs.map +2 -2
- package/package.json +39 -39
- package/src/components/block-allowed-blocks/modal.js +2 -2
- package/src/components/block-inspector/index.js +19 -17
- package/src/components/block-removal-warning-modal/index.js +55 -19
- package/src/components/block-switcher/block-transformations-menu.native.js +1 -0
- package/src/components/block-toolbar/test/__snapshots__/block-toolbar-menu.native.js.snap +4 -6
- package/src/components/block-toolbar/test/block-toolbar-menu.native.js +2 -2
- package/src/components/block-visibility/use-block-visibility.js +17 -32
- package/src/components/global-styles/hooks.js +10 -0
- package/src/components/global-styles/typography-panel.js +78 -1
- package/src/components/grid/grid-visualizer.js +58 -12
- package/src/components/iframe/index.js +12 -2
- package/src/components/iframe/use-scale-canvas.js +1 -0
- package/src/components/inserter/menu.native.js +1 -0
- package/src/components/inspector-controls/last-item.js +29 -0
- package/src/components/inspector-controls-tabs/styles-tab.js +3 -3
- package/src/components/link-control/index.js +160 -3
- package/src/components/link-control/is-url-like.js +43 -8
- package/src/components/link-control/search-input.js +7 -0
- package/src/components/link-control/test/index.js +260 -0
- package/src/components/link-control/test/is-url-like.js +49 -1
- package/src/components/link-control/use-search-handler.js +2 -2
- package/src/components/provider/test/use-block-sync.js +105 -0
- package/src/components/provider/use-block-sync.js +118 -9
- package/src/components/text-indent-control/index.js +138 -0
- package/src/components/url-input/index.js +21 -2
- package/src/components/url-popover/image-url-input-ui.js +2 -2
- package/src/components/writing-flow/use-arrow-nav.js +0 -4
- package/src/hooks/anchor.js +1 -1
- package/src/hooks/aria-label.js +9 -1
- package/src/hooks/grid-visualizer.js +63 -24
- package/src/hooks/layout-child.js +45 -3
- package/src/hooks/typography.js +2 -0
- package/src/hooks/utils.js +4 -0
- package/src/private-apis.js +2 -0
- package/src/store/actions.js +8 -6
|
@@ -10,42 +10,81 @@ import { useSelect } from '@wordpress/data';
|
|
|
10
10
|
*/
|
|
11
11
|
import { GridVisualizer, useGridLayoutSync } from '../components/grid';
|
|
12
12
|
import { store as blockEditorStore } from '../store';
|
|
13
|
+
import { unlock } from '../lock-unlock';
|
|
14
|
+
import useBlockVisibility from '../components/block-visibility/use-block-visibility';
|
|
15
|
+
import { deviceTypeKey } from '../store/private-keys';
|
|
16
|
+
import { BLOCK_VISIBILITY_VIEWPORTS } from '../components/block-visibility/constants';
|
|
13
17
|
|
|
14
18
|
function GridLayoutSync( props ) {
|
|
15
19
|
useGridLayoutSync( props );
|
|
16
20
|
}
|
|
17
21
|
|
|
18
22
|
function GridTools( { clientId, layout } ) {
|
|
19
|
-
const isVisible =
|
|
20
|
-
(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
const { isVisible, blockVisibility, deviceType, isAnyAncestorHidden } =
|
|
24
|
+
useSelect(
|
|
25
|
+
( select ) => {
|
|
26
|
+
const {
|
|
27
|
+
isBlockSelected,
|
|
28
|
+
hasSelectedInnerBlock,
|
|
29
|
+
isDraggingBlocks,
|
|
30
|
+
getTemplateLock,
|
|
31
|
+
getBlockEditingMode,
|
|
32
|
+
getBlockAttributes,
|
|
33
|
+
getSettings,
|
|
34
|
+
} = select( blockEditorStore );
|
|
27
35
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
// These calls are purposely ordered from least expensive to most expensive.
|
|
37
|
+
// Hides the visualizer in cases where the user is not or cannot interact with it.
|
|
38
|
+
// Also hide if a child block is selected, because layout-child.js will render
|
|
39
|
+
// the visualizer in that case (with proper childGridClientId handling).
|
|
40
|
+
if (
|
|
41
|
+
( ! isDraggingBlocks() && ! isBlockSelected( clientId ) ) ||
|
|
42
|
+
getTemplateLock( clientId ) ||
|
|
43
|
+
getBlockEditingMode( clientId ) !== 'default' ||
|
|
44
|
+
hasSelectedInnerBlock( clientId )
|
|
45
|
+
) {
|
|
46
|
+
return { isVisible: false };
|
|
47
|
+
}
|
|
37
48
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
49
|
+
const { isBlockParentHiddenAtViewport } = unlock(
|
|
50
|
+
select( blockEditorStore )
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
const attributes = getBlockAttributes( clientId );
|
|
54
|
+
const settings = getSettings();
|
|
55
|
+
const currentDeviceType =
|
|
56
|
+
settings?.[ deviceTypeKey ]?.toLowerCase() ||
|
|
57
|
+
BLOCK_VISIBILITY_VIEWPORTS.desktop.value;
|
|
58
|
+
|
|
59
|
+
return {
|
|
60
|
+
isVisible: true,
|
|
61
|
+
blockVisibility: attributes?.metadata?.blockVisibility,
|
|
62
|
+
deviceType: currentDeviceType,
|
|
63
|
+
isAnyAncestorHidden: isBlockParentHiddenAtViewport(
|
|
64
|
+
clientId,
|
|
65
|
+
currentDeviceType
|
|
66
|
+
),
|
|
67
|
+
};
|
|
68
|
+
},
|
|
69
|
+
[ clientId ]
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
const { isBlockCurrentlyHidden } = useBlockVisibility( {
|
|
73
|
+
blockVisibility,
|
|
74
|
+
deviceType,
|
|
75
|
+
} );
|
|
42
76
|
|
|
43
77
|
return (
|
|
44
78
|
<>
|
|
45
79
|
<GridLayoutSync clientId={ clientId } />
|
|
46
|
-
{ isVisible &&
|
|
47
|
-
|
|
48
|
-
|
|
80
|
+
{ isVisible &&
|
|
81
|
+
! isBlockCurrentlyHidden &&
|
|
82
|
+
! isAnyAncestorHidden && (
|
|
83
|
+
<GridVisualizer
|
|
84
|
+
clientId={ clientId }
|
|
85
|
+
parentLayout={ layout }
|
|
86
|
+
/>
|
|
87
|
+
) }
|
|
49
88
|
</>
|
|
50
89
|
);
|
|
51
90
|
}
|
|
@@ -16,6 +16,9 @@ import {
|
|
|
16
16
|
GridItemResizer,
|
|
17
17
|
GridItemMovers,
|
|
18
18
|
} from '../components/grid';
|
|
19
|
+
import useBlockVisibility from '../components/block-visibility/use-block-visibility';
|
|
20
|
+
import { deviceTypeKey } from '../store/private-keys';
|
|
21
|
+
import { BLOCK_VISIBILITY_VIEWPORTS } from '../components/block-visibility/constants';
|
|
19
22
|
|
|
20
23
|
// Used for generating the instance ID
|
|
21
24
|
const LAYOUT_CHILD_BLOCK_PROPS_REFERENCE = {};
|
|
@@ -199,12 +202,21 @@ function GridTools( {
|
|
|
199
202
|
isManualPlacement,
|
|
200
203
|
parentLayout,
|
|
201
204
|
} ) {
|
|
202
|
-
const {
|
|
205
|
+
const {
|
|
206
|
+
rootClientId,
|
|
207
|
+
isVisible,
|
|
208
|
+
parentBlockVisibility,
|
|
209
|
+
blockBlockVisibility,
|
|
210
|
+
deviceType,
|
|
211
|
+
isChildBlockAGrid,
|
|
212
|
+
} = useSelect(
|
|
203
213
|
( select ) => {
|
|
204
214
|
const {
|
|
205
215
|
getBlockRootClientId,
|
|
206
216
|
getBlockEditingMode,
|
|
207
217
|
getTemplateLock,
|
|
218
|
+
getBlockAttributes,
|
|
219
|
+
getSettings,
|
|
208
220
|
} = select( blockEditorStore );
|
|
209
221
|
|
|
210
222
|
const _rootClientId = getBlockRootClientId( clientId );
|
|
@@ -219,21 +231,50 @@ function GridTools( {
|
|
|
219
231
|
};
|
|
220
232
|
}
|
|
221
233
|
|
|
234
|
+
const parentAttributes = getBlockAttributes( _rootClientId );
|
|
235
|
+
const blockAttributes = getBlockAttributes( clientId );
|
|
236
|
+
const settings = getSettings();
|
|
237
|
+
|
|
222
238
|
return {
|
|
223
239
|
rootClientId: _rootClientId,
|
|
224
240
|
isVisible: true,
|
|
241
|
+
parentBlockVisibility:
|
|
242
|
+
parentAttributes?.metadata?.blockVisibility,
|
|
243
|
+
blockBlockVisibility:
|
|
244
|
+
blockAttributes?.metadata?.blockVisibility,
|
|
245
|
+
deviceType:
|
|
246
|
+
settings?.[ deviceTypeKey ]?.toLowerCase() ||
|
|
247
|
+
BLOCK_VISIBILITY_VIEWPORTS.desktop.value,
|
|
248
|
+
// Check if the selected child block is itself a grid.
|
|
249
|
+
isChildBlockAGrid: blockAttributes?.layout?.type === 'grid',
|
|
225
250
|
};
|
|
226
251
|
},
|
|
227
252
|
[ clientId ]
|
|
228
253
|
);
|
|
229
254
|
|
|
255
|
+
const { isBlockCurrentlyHidden: isParentBlockCurrentlyHidden } =
|
|
256
|
+
useBlockVisibility( {
|
|
257
|
+
blockVisibility: parentBlockVisibility,
|
|
258
|
+
deviceType,
|
|
259
|
+
} );
|
|
260
|
+
|
|
261
|
+
const { isBlockCurrentlyHidden: isBlockItselfCurrentlyHidden } =
|
|
262
|
+
useBlockVisibility( {
|
|
263
|
+
blockVisibility: blockBlockVisibility,
|
|
264
|
+
deviceType,
|
|
265
|
+
} );
|
|
266
|
+
|
|
230
267
|
// Use useState() instead of useRef() so that GridItemResizer updates when ref is set.
|
|
231
268
|
const [ resizerBounds, setResizerBounds ] = useState();
|
|
232
269
|
|
|
233
|
-
|
|
270
|
+
const childGridClientId = isChildBlockAGrid ? clientId : undefined;
|
|
271
|
+
|
|
272
|
+
if ( ! isVisible || isParentBlockCurrentlyHidden ) {
|
|
234
273
|
return null;
|
|
235
274
|
}
|
|
236
275
|
|
|
276
|
+
const showResizer = allowSizingOnChildren && ! isBlockItselfCurrentlyHidden;
|
|
277
|
+
|
|
237
278
|
function updateLayout( layout ) {
|
|
238
279
|
setAttributes( {
|
|
239
280
|
style: {
|
|
@@ -252,8 +293,9 @@ function GridTools( {
|
|
|
252
293
|
clientId={ rootClientId }
|
|
253
294
|
contentRef={ setResizerBounds }
|
|
254
295
|
parentLayout={ parentLayout }
|
|
296
|
+
childGridClientId={ childGridClientId }
|
|
255
297
|
/>
|
|
256
|
-
{
|
|
298
|
+
{ showResizer && (
|
|
257
299
|
<GridItemResizer
|
|
258
300
|
clientId={ clientId }
|
|
259
301
|
// Don't allow resizing beyond the grid visualizer.
|
package/src/hooks/typography.js
CHANGED
|
@@ -31,6 +31,7 @@ function omit( object, keys ) {
|
|
|
31
31
|
const LETTER_SPACING_SUPPORT_KEY = 'typography.__experimentalLetterSpacing';
|
|
32
32
|
const TEXT_TRANSFORM_SUPPORT_KEY = 'typography.__experimentalTextTransform';
|
|
33
33
|
const TEXT_DECORATION_SUPPORT_KEY = 'typography.__experimentalTextDecoration';
|
|
34
|
+
const TEXT_INDENT_SUPPORT_KEY = 'typography.textIndent';
|
|
34
35
|
const TEXT_COLUMNS_SUPPORT_KEY = 'typography.textColumns';
|
|
35
36
|
const FONT_STYLE_SUPPORT_KEY = 'typography.__experimentalFontStyle';
|
|
36
37
|
const FONT_WEIGHT_SUPPORT_KEY = 'typography.__experimentalFontWeight';
|
|
@@ -45,6 +46,7 @@ export const TYPOGRAPHY_SUPPORT_KEYS = [
|
|
|
45
46
|
TEXT_ALIGN_SUPPORT_KEY,
|
|
46
47
|
TEXT_COLUMNS_SUPPORT_KEY,
|
|
47
48
|
TEXT_DECORATION_SUPPORT_KEY,
|
|
49
|
+
TEXT_INDENT_SUPPORT_KEY,
|
|
48
50
|
WRITING_MODE_SUPPORT_KEY,
|
|
49
51
|
TEXT_TRANSFORM_SUPPORT_KEY,
|
|
50
52
|
LETTER_SPACING_SUPPORT_KEY,
|
package/src/hooks/utils.js
CHANGED
|
@@ -252,6 +252,7 @@ export function useBlockSettings( name, parentLayout ) {
|
|
|
252
252
|
textAlign,
|
|
253
253
|
textColumns,
|
|
254
254
|
textDecoration,
|
|
255
|
+
textIndent,
|
|
255
256
|
writingMode,
|
|
256
257
|
textTransform,
|
|
257
258
|
letterSpacing,
|
|
@@ -313,6 +314,7 @@ export function useBlockSettings( name, parentLayout ) {
|
|
|
313
314
|
'typography.textAlign',
|
|
314
315
|
'typography.textColumns',
|
|
315
316
|
'typography.textDecoration',
|
|
317
|
+
'typography.textIndent',
|
|
316
318
|
'typography.writingMode',
|
|
317
319
|
'typography.textTransform',
|
|
318
320
|
'typography.letterSpacing',
|
|
@@ -412,6 +414,7 @@ export function useBlockSettings( name, parentLayout ) {
|
|
|
412
414
|
textAlign,
|
|
413
415
|
textColumns,
|
|
414
416
|
textDecoration,
|
|
417
|
+
textIndent,
|
|
415
418
|
textTransform,
|
|
416
419
|
letterSpacing,
|
|
417
420
|
writingMode,
|
|
@@ -464,6 +467,7 @@ export function useBlockSettings( name, parentLayout ) {
|
|
|
464
467
|
textAlign,
|
|
465
468
|
textColumns,
|
|
466
469
|
textDecoration,
|
|
470
|
+
textIndent,
|
|
467
471
|
textTransform,
|
|
468
472
|
letterSpacing,
|
|
469
473
|
writingMode,
|
package/src/private-apis.js
CHANGED
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
normalizeString,
|
|
14
14
|
} from './components/inserter/search-items';
|
|
15
15
|
import { PrivateListView } from './components/list-view';
|
|
16
|
+
import InspectorControlsLastItem from './components/inspector-controls/last-item';
|
|
16
17
|
import { useHasBlockToolbar } from './components/block-toolbar/use-has-block-toolbar';
|
|
17
18
|
import { cleanEmptyObject } from './hooks/utils';
|
|
18
19
|
import BlockQuickNavigation from './components/block-quick-navigation';
|
|
@@ -79,6 +80,7 @@ lock( privateApis, {
|
|
|
79
80
|
normalizeString,
|
|
80
81
|
PrivateListView,
|
|
81
82
|
ResizableBoxPopover,
|
|
83
|
+
InspectorControlsLastItem,
|
|
82
84
|
useHasBlockToolbar,
|
|
83
85
|
cleanEmptyObject,
|
|
84
86
|
BlockQuickNavigation,
|
package/src/store/actions.js
CHANGED
|
@@ -517,11 +517,12 @@ export function moveBlockToPosition(
|
|
|
517
517
|
* Only allowed blocks are inserted. The action may fail silently for blocks that are not allowed or if
|
|
518
518
|
* a templateLock is active on the block list.
|
|
519
519
|
*
|
|
520
|
-
* @param {Object}
|
|
521
|
-
* @param {?number}
|
|
522
|
-
* @param {?string}
|
|
523
|
-
* @param {?boolean}
|
|
524
|
-
* @param {
|
|
520
|
+
* @param {Object} block Block object to insert.
|
|
521
|
+
* @param {?number} index Index at which block should be inserted.
|
|
522
|
+
* @param {?string} rootClientId Optional root client ID of block list on which to insert.
|
|
523
|
+
* @param {?boolean} updateSelection If true block selection will be updated. If false, block selection will not change. Defaults to true.
|
|
524
|
+
* @param {0|-1|null} initialPosition Initial focus position. Setting it to null prevent focusing the inserted block.
|
|
525
|
+
* @param {?Object} meta Optional Meta values to be passed to the action object.
|
|
525
526
|
*
|
|
526
527
|
* @return {Object} Action object.
|
|
527
528
|
*/
|
|
@@ -530,6 +531,7 @@ export function insertBlock(
|
|
|
530
531
|
index,
|
|
531
532
|
rootClientId,
|
|
532
533
|
updateSelection,
|
|
534
|
+
initialPosition,
|
|
533
535
|
meta
|
|
534
536
|
) {
|
|
535
537
|
return insertBlocks(
|
|
@@ -537,7 +539,7 @@ export function insertBlock(
|
|
|
537
539
|
index,
|
|
538
540
|
rootClientId,
|
|
539
541
|
updateSelection,
|
|
540
|
-
|
|
542
|
+
initialPosition,
|
|
541
543
|
meta
|
|
542
544
|
);
|
|
543
545
|
}
|