@wordpress/block-editor 15.11.1-next.v.0 → 15.12.1-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 +2 -0
- package/build/components/block-breadcrumb/index.cjs +10 -2
- package/build/components/block-breadcrumb/index.cjs.map +2 -2
- package/build/components/block-inspector/index.cjs +11 -11
- package/build/components/block-inspector/index.cjs.map +3 -3
- package/build/components/block-list/block.cjs +6 -3
- package/build/components/block-list/block.cjs.map +3 -3
- package/build/components/block-list/index.cjs +26 -18
- package/build/components/block-list/index.cjs.map +2 -2
- package/build/components/block-list/use-block-props/use-selected-block-event-handlers.cjs +2 -6
- package/build/components/block-list/use-block-props/use-selected-block-event-handlers.cjs.map +2 -2
- package/build/components/block-list/use-in-between-inserter.cjs +4 -4
- package/build/components/block-list/use-in-between-inserter.cjs.map +2 -2
- package/build/components/block-settings-menu/block-settings-dropdown.cjs +10 -7
- package/build/components/block-settings-menu/block-settings-dropdown.cjs.map +2 -2
- package/build/components/block-settings-menu-controls/edit-section-menu-item.cjs +1 -1
- package/build/components/block-settings-menu-controls/edit-section-menu-item.cjs.map +2 -2
- package/build/components/block-settings-menu-controls/index.cjs +10 -15
- package/build/components/block-settings-menu-controls/index.cjs.map +2 -2
- package/build/components/block-toolbar/block-toolbar-icon.cjs +6 -4
- package/build/components/block-toolbar/block-toolbar-icon.cjs.map +2 -2
- package/build/components/block-toolbar/index.cjs +1 -1
- package/build/components/block-toolbar/index.cjs.map +2 -2
- package/build/components/block-variation-transforms/index.cjs +1 -2
- package/build/components/block-variation-transforms/index.cjs.map +2 -2
- package/build/components/block-visibility/modal.cjs +5 -92
- package/build/components/block-visibility/modal.cjs.map +2 -2
- package/build/components/inserter/index.cjs +1 -0
- package/build/components/inserter/index.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/index.cjs +2 -2
- package/build/components/inspector-controls-tabs/index.cjs.map +3 -3
- package/build/components/inspector-controls-tabs/styles-tab.cjs +4 -4
- package/build/components/inspector-controls-tabs/styles-tab.cjs.map +2 -2
- package/build/components/media-replace-flow/index.cjs +2 -2
- package/build/components/media-replace-flow/index.cjs.map +2 -2
- package/build/components/rich-text/index.cjs +1 -1
- package/build/components/rich-text/index.cjs.map +2 -2
- package/build/components/use-block-display-information/index.cjs +1 -1
- package/build/components/use-block-display-information/index.cjs.map +2 -2
- package/build/components/writing-flow/index.cjs +2 -0
- package/build/components/writing-flow/index.cjs.map +2 -2
- package/build/components/writing-flow/use-arrow-nav.cjs +3 -0
- package/build/components/writing-flow/use-arrow-nav.cjs.map +2 -2
- package/build/components/writing-flow/use-drag-selection.cjs +2 -1
- package/build/components/writing-flow/use-drag-selection.cjs.map +2 -2
- package/build/components/writing-flow/use-preview-mode-nav.cjs +92 -0
- package/build/components/writing-flow/use-preview-mode-nav.cjs.map +7 -0
- package/build/hooks/anchor.cjs +1 -1
- package/build/hooks/anchor.cjs.map +1 -1
- package/build/hooks/block-renaming.cjs +1 -1
- package/build/hooks/block-renaming.cjs.map +2 -2
- package/build/hooks/custom-css.cjs +1 -1
- package/build/hooks/custom-css.cjs.map +2 -2
- package/build/hooks/grid-visualizer.cjs +42 -5
- package/build/hooks/grid-visualizer.cjs.map +3 -3
- package/build/hooks/index.cjs +0 -2
- package/build/hooks/index.cjs.map +3 -3
- package/build/hooks/layout-child.cjs +41 -5
- package/build/hooks/layout-child.cjs.map +3 -3
- package/build/private-apis.cjs +2 -0
- package/build/private-apis.cjs.map +3 -3
- package/build/store/actions.cjs +5 -0
- package/build/store/actions.cjs.map +2 -2
- package/build/store/private-selectors.cjs +1 -1
- package/build/store/private-selectors.cjs.map +2 -2
- package/build/store/reducer.cjs +5 -7
- package/build/store/reducer.cjs.map +2 -2
- package/build/store/selectors.cjs +15 -0
- package/build/store/selectors.cjs.map +2 -2
- package/build/utils/fit-text-utils.cjs +17 -7
- package/build/utils/fit-text-utils.cjs.map +2 -2
- package/build-module/components/block-breadcrumb/index.mjs +10 -2
- package/build-module/components/block-breadcrumb/index.mjs.map +2 -2
- package/build-module/components/block-inspector/index.mjs +12 -11
- package/build-module/components/block-inspector/index.mjs.map +2 -2
- package/build-module/components/block-list/block.mjs +6 -3
- package/build-module/components/block-list/block.mjs.map +3 -3
- package/build-module/components/block-list/index.mjs +26 -18
- package/build-module/components/block-list/index.mjs.map +2 -2
- package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.mjs +2 -6
- package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.mjs.map +2 -2
- package/build-module/components/block-list/use-in-between-inserter.mjs +4 -4
- package/build-module/components/block-list/use-in-between-inserter.mjs.map +2 -2
- package/build-module/components/block-settings-menu/block-settings-dropdown.mjs +10 -7
- package/build-module/components/block-settings-menu/block-settings-dropdown.mjs.map +2 -2
- package/build-module/components/block-settings-menu-controls/edit-section-menu-item.mjs +1 -1
- package/build-module/components/block-settings-menu-controls/edit-section-menu-item.mjs.map +2 -2
- package/build-module/components/block-settings-menu-controls/index.mjs +10 -15
- package/build-module/components/block-settings-menu-controls/index.mjs.map +2 -2
- package/build-module/components/block-toolbar/block-toolbar-icon.mjs +6 -4
- package/build-module/components/block-toolbar/block-toolbar-icon.mjs.map +2 -2
- package/build-module/components/block-toolbar/index.mjs +1 -1
- package/build-module/components/block-toolbar/index.mjs.map +2 -2
- package/build-module/components/block-variation-transforms/index.mjs +1 -2
- package/build-module/components/block-variation-transforms/index.mjs.map +2 -2
- package/build-module/components/block-visibility/modal.mjs +5 -92
- package/build-module/components/block-visibility/modal.mjs.map +2 -2
- package/build-module/components/inserter/index.mjs +1 -0
- package/build-module/components/inserter/index.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/index.mjs +2 -2
- package/build-module/components/inspector-controls-tabs/index.mjs.map +2 -2
- package/build-module/components/inspector-controls-tabs/styles-tab.mjs +4 -4
- package/build-module/components/inspector-controls-tabs/styles-tab.mjs.map +2 -2
- package/build-module/components/media-replace-flow/index.mjs +2 -2
- package/build-module/components/media-replace-flow/index.mjs.map +2 -2
- package/build-module/components/rich-text/index.mjs +1 -1
- package/build-module/components/rich-text/index.mjs.map +2 -2
- package/build-module/components/use-block-display-information/index.mjs +1 -1
- package/build-module/components/use-block-display-information/index.mjs.map +2 -2
- package/build-module/components/writing-flow/index.mjs +2 -0
- package/build-module/components/writing-flow/index.mjs.map +2 -2
- package/build-module/components/writing-flow/use-arrow-nav.mjs +3 -0
- package/build-module/components/writing-flow/use-arrow-nav.mjs.map +2 -2
- package/build-module/components/writing-flow/use-drag-selection.mjs +2 -1
- package/build-module/components/writing-flow/use-drag-selection.mjs.map +2 -2
- package/build-module/components/writing-flow/use-preview-mode-nav.mjs +67 -0
- package/build-module/components/writing-flow/use-preview-mode-nav.mjs.map +7 -0
- package/build-module/hooks/anchor.mjs +1 -1
- package/build-module/hooks/anchor.mjs.map +1 -1
- package/build-module/hooks/block-renaming.mjs +1 -1
- package/build-module/hooks/block-renaming.mjs.map +2 -2
- package/build-module/hooks/custom-css.mjs +1 -1
- package/build-module/hooks/custom-css.mjs.map +2 -2
- package/build-module/hooks/grid-visualizer.mjs +20 -5
- package/build-module/hooks/grid-visualizer.mjs.map +2 -2
- package/build-module/hooks/index.mjs +0 -2
- package/build-module/hooks/index.mjs.map +2 -2
- package/build-module/hooks/layout-child.mjs +31 -5
- package/build-module/hooks/layout-child.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 +5 -0
- package/build-module/store/actions.mjs.map +2 -2
- package/build-module/store/private-selectors.mjs +1 -1
- package/build-module/store/private-selectors.mjs.map +2 -2
- package/build-module/store/reducer.mjs +5 -7
- package/build-module/store/reducer.mjs.map +2 -2
- package/build-module/store/selectors.mjs +15 -0
- package/build-module/store/selectors.mjs.map +2 -2
- package/build-module/utils/fit-text-utils.mjs +17 -7
- package/build-module/utils/fit-text-utils.mjs.map +2 -2
- package/build-style/content-rtl.css +10 -0
- package/build-style/content.css +10 -0
- package/package.json +39 -39
- package/src/components/block-breadcrumb/index.js +6 -1
- package/src/components/block-inspector/index.js +20 -21
- package/src/components/block-list/block.js +5 -2
- package/src/components/block-list/content.scss +11 -0
- package/src/components/block-list/index.js +25 -17
- package/src/components/block-list/use-block-props/use-selected-block-event-handlers.js +2 -7
- package/src/components/block-list/use-in-between-inserter.js +8 -6
- package/src/components/block-settings-menu/block-settings-dropdown.js +11 -6
- package/src/components/block-settings-menu-controls/edit-section-menu-item.js +1 -7
- package/src/components/block-settings-menu-controls/index.js +14 -16
- package/src/components/block-toolbar/block-toolbar-icon.js +6 -10
- package/src/components/block-toolbar/index.js +1 -7
- package/src/components/block-variation-transforms/index.js +1 -4
- package/src/components/inserter/index.js +1 -0
- package/src/components/inserter/stories/index.story.jsx +31 -24
- package/src/components/inspector-controls/last-item.js +29 -0
- package/src/components/inspector-controls-tabs/index.js +1 -1
- package/src/components/inspector-controls-tabs/styles-tab.js +10 -11
- package/src/components/media-replace-flow/index.js +3 -3
- package/src/components/rich-text/index.js +1 -1
- package/src/components/use-block-display-information/index.js +1 -5
- package/src/components/writing-flow/index.js +2 -0
- package/src/components/writing-flow/use-arrow-nav.js +5 -0
- package/src/components/writing-flow/use-drag-selection.js +7 -1
- package/src/components/writing-flow/use-preview-mode-nav.js +102 -0
- package/src/hooks/anchor.js +1 -1
- package/src/hooks/block-renaming.js +5 -2
- package/src/hooks/custom-css.js +1 -1
- package/src/hooks/grid-visualizer.js +23 -4
- package/src/hooks/index.js +0 -2
- package/src/hooks/layout-child.js +39 -3
- package/src/private-apis.js +2 -0
- package/src/store/actions.js +7 -0
- package/src/store/private-selectors.js +0 -1
- package/src/store/reducer.js +11 -18
- package/src/store/selectors.js +25 -0
- package/src/store/test/reducer.js +258 -266
- package/src/utils/fit-text-utils.js +24 -8
- package/build/components/content-lock/index.cjs +0 -31
- package/build/components/content-lock/index.cjs.map +0 -7
- package/build/components/content-lock/modify-content-lock-menu-item.cjs +0 -70
- package/build/components/content-lock/modify-content-lock-menu-item.cjs.map +0 -7
- package/build/hooks/content-lock-ui.cjs +0 -68
- package/build/hooks/content-lock-ui.cjs.map +0 -7
- package/build-module/components/content-lock/index.mjs +0 -6
- package/build-module/components/content-lock/index.mjs.map +0 -7
- package/build-module/components/content-lock/modify-content-lock-menu-item.mjs +0 -45
- package/build-module/components/content-lock/modify-content-lock-menu-item.mjs.map +0 -7
- package/build-module/hooks/content-lock-ui.mjs +0 -47
- package/build-module/hooks/content-lock-ui.mjs.map +0 -7
- package/src/components/content-lock/index.js +0 -1
- package/src/components/content-lock/modify-content-lock-menu-item.js +0 -67
- package/src/hooks/content-lock-ui.js +0 -76
package/src/store/actions.js
CHANGED
|
@@ -248,6 +248,13 @@ export const selectPreviousBlock =
|
|
|
248
248
|
const firstParentClientId = select.getBlockRootClientId( clientId );
|
|
249
249
|
if ( firstParentClientId ) {
|
|
250
250
|
dispatch.selectBlock( firstParentClientId, -1 );
|
|
251
|
+
} else {
|
|
252
|
+
// Fallback to next block when no previous block and no parent
|
|
253
|
+
const nextBlockClientId =
|
|
254
|
+
select.getNextBlockClientId( clientId );
|
|
255
|
+
if ( nextBlockClientId ) {
|
|
256
|
+
dispatch.selectBlock( nextBlockClientId, 0 );
|
|
257
|
+
}
|
|
251
258
|
}
|
|
252
259
|
}
|
|
253
260
|
};
|
package/src/store/reducer.js
CHANGED
|
@@ -2283,22 +2283,17 @@ function getDerivedBlockEditingModesForTree( state, treeClientId = '' ) {
|
|
|
2283
2283
|
|
|
2284
2284
|
// Use array.from for better back compat. Older versions of the iterator returned
|
|
2285
2285
|
// from `keys()` didn't have the `filter` method.
|
|
2286
|
-
const unsyncedPatternClientIds =
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
( clientId )
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
)
|
|
2294
|
-
: [];
|
|
2286
|
+
const unsyncedPatternClientIds = isIsolatedEditor
|
|
2287
|
+
? []
|
|
2288
|
+
: Array.from( state.blocks.attributes.keys() ).filter(
|
|
2289
|
+
( clientId ) =>
|
|
2290
|
+
state.blocks.attributes.get( clientId )?.metadata
|
|
2291
|
+
?.patternName
|
|
2292
|
+
);
|
|
2295
2293
|
const contentOnlyParents = [
|
|
2296
2294
|
...contentOnlyTemplateLockedClientIds,
|
|
2297
2295
|
...unsyncedPatternClientIds,
|
|
2298
|
-
...(
|
|
2299
|
-
! isIsolatedEditor
|
|
2300
|
-
? templatePartClientIds
|
|
2301
|
-
: [] ),
|
|
2296
|
+
...( isIsolatedEditor ? [] : templatePartClientIds ),
|
|
2302
2297
|
];
|
|
2303
2298
|
|
|
2304
2299
|
traverseBlockTree( state, treeClientId, ( block ) => {
|
|
@@ -2323,11 +2318,9 @@ function getDerivedBlockEditingModesForTree( state, treeClientId = '' ) {
|
|
|
2323
2318
|
return;
|
|
2324
2319
|
}
|
|
2325
2320
|
|
|
2326
|
-
//
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
return;
|
|
2330
|
-
}
|
|
2321
|
+
// Disable blocks that are outside of the edited section.
|
|
2322
|
+
derivedBlockEditingModes.set( clientId, 'disabled' );
|
|
2323
|
+
return;
|
|
2331
2324
|
}
|
|
2332
2325
|
|
|
2333
2326
|
// If the block already has an explicit block editing mode set,
|
package/src/store/selectors.js
CHANGED
|
@@ -1681,6 +1681,11 @@ const canInsertBlockTypeUnmemoized = (
|
|
|
1681
1681
|
blockName,
|
|
1682
1682
|
rootClientId = null
|
|
1683
1683
|
) => {
|
|
1684
|
+
// Disable insertion in preview mode.
|
|
1685
|
+
if ( state.settings.isPreviewMode ) {
|
|
1686
|
+
return false;
|
|
1687
|
+
}
|
|
1688
|
+
|
|
1684
1689
|
if ( ! isBlockVisibleInTheInserter( state, blockName, rootClientId ) ) {
|
|
1685
1690
|
return false;
|
|
1686
1691
|
}
|
|
@@ -1868,6 +1873,11 @@ export function canInsertBlocks( state, clientIds, rootClientId = null ) {
|
|
|
1868
1873
|
* @return {boolean} Whether the given block is allowed to be removed.
|
|
1869
1874
|
*/
|
|
1870
1875
|
export function canRemoveBlock( state, clientId ) {
|
|
1876
|
+
// Disable removal in preview mode.
|
|
1877
|
+
if ( state.settings.isPreviewMode ) {
|
|
1878
|
+
return false;
|
|
1879
|
+
}
|
|
1880
|
+
|
|
1871
1881
|
const attributes = getBlockAttributes( state, clientId );
|
|
1872
1882
|
if ( attributes === null ) {
|
|
1873
1883
|
return true;
|
|
@@ -1930,6 +1940,11 @@ export function canRemoveBlocks( state, clientIds ) {
|
|
|
1930
1940
|
* @return {boolean} Whether the given block is allowed to be moved.
|
|
1931
1941
|
*/
|
|
1932
1942
|
export function canMoveBlock( state, clientId ) {
|
|
1943
|
+
// Disable moving in preview mode.
|
|
1944
|
+
if ( state.settings.isPreviewMode ) {
|
|
1945
|
+
return false;
|
|
1946
|
+
}
|
|
1947
|
+
|
|
1933
1948
|
const attributes = getBlockAttributes( state, clientId );
|
|
1934
1949
|
if ( attributes === null ) {
|
|
1935
1950
|
return true;
|
|
@@ -1991,6 +2006,11 @@ export function canMoveBlocks( state, clientIds ) {
|
|
|
1991
2006
|
* @return {boolean} Whether the given block is allowed to be edited.
|
|
1992
2007
|
*/
|
|
1993
2008
|
export function canEditBlock( state, clientId ) {
|
|
2009
|
+
// Disable editing in preview mode.
|
|
2010
|
+
if ( state.settings.isPreviewMode ) {
|
|
2011
|
+
return false;
|
|
2012
|
+
}
|
|
2013
|
+
|
|
1994
2014
|
const attributes = getBlockAttributes( state, clientId );
|
|
1995
2015
|
if ( attributes === null ) {
|
|
1996
2016
|
return true;
|
|
@@ -2011,6 +2031,11 @@ export function canEditBlock( state, clientId ) {
|
|
|
2011
2031
|
* @return {boolean} Whether a given block type can be locked/unlocked.
|
|
2012
2032
|
*/
|
|
2013
2033
|
export function canLockBlockType( state, nameOrType ) {
|
|
2034
|
+
// Disable locking in preview mode.
|
|
2035
|
+
if ( state.settings.isPreviewMode ) {
|
|
2036
|
+
return false;
|
|
2037
|
+
}
|
|
2038
|
+
|
|
2014
2039
|
if ( ! hasBlockSupport( nameOrType, 'lock', true ) ) {
|
|
2015
2040
|
return false;
|
|
2016
2041
|
}
|