@wordpress/block-editor 15.3.1-next.836ecdcae.0 → 15.3.1-next.a730c9c8c.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/build/autocompleters/block.js +2 -4
- package/build/autocompleters/block.js.map +1 -1
- package/build/components/block-card/index.js +4 -2
- package/build/components/block-card/index.js.map +1 -1
- package/build/components/block-inspector/edit-contents-button.js +54 -0
- package/build/components/block-inspector/edit-contents-button.js.map +1 -0
- package/build/components/block-inspector/index.js +5 -1
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-list/index.js +3 -1
- package/build/components/block-list/index.js.map +1 -1
- package/build/components/block-popover/use-popover-scroll.js +11 -2
- package/build/components/block-popover/use-popover-scroll.js.map +1 -1
- package/build/components/block-switcher/index.js +13 -8
- package/build/components/block-switcher/index.js.map +1 -1
- package/build/components/block-toolbar/index.js +5 -2
- package/build/components/block-toolbar/index.js.map +1 -1
- package/build/components/block-tools/insertion-point.js +10 -0
- package/build/components/block-tools/insertion-point.js.map +1 -1
- package/build/components/block-variation-transforms/index.js +10 -6
- package/build/components/block-variation-transforms/index.js.map +1 -1
- package/build/components/border-radius-control/utils.js.map +1 -1
- package/build/components/global-styles/border-panel.js +6 -6
- package/build/components/global-styles/border-panel.js.map +1 -1
- package/build/components/link-control/search-item.js +30 -12
- package/build/components/link-control/search-item.js.map +1 -1
- package/build/components/url-popover/image-url-input-ui.js +7 -2
- package/build/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build/components/writing-flow/use-clipboard-handler.js +6 -1
- package/build/components/writing-flow/use-clipboard-handler.js.map +1 -1
- package/build/store/private-selectors.js +9 -21
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +114 -0
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +16 -30
- package/build/store/selectors.js.map +1 -1
- package/build/store/utils.js +18 -0
- package/build/store/utils.js.map +1 -1
- package/build/utils/block-bindings.js +1 -1
- package/build/utils/block-bindings.js.map +1 -1
- package/build-module/autocompleters/block.js +3 -5
- package/build-module/autocompleters/block.js.map +1 -1
- package/build-module/components/block-card/index.js +4 -2
- package/build-module/components/block-card/index.js.map +1 -1
- package/build-module/components/block-inspector/edit-contents-button.js +47 -0
- package/build-module/components/block-inspector/edit-contents-button.js.map +1 -0
- package/build-module/components/block-inspector/index.js +5 -1
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-list/index.js +3 -1
- package/build-module/components/block-list/index.js.map +1 -1
- package/build-module/components/block-popover/use-popover-scroll.js +11 -2
- package/build-module/components/block-popover/use-popover-scroll.js.map +1 -1
- package/build-module/components/block-switcher/index.js +13 -8
- package/build-module/components/block-switcher/index.js.map +1 -1
- package/build-module/components/block-toolbar/index.js +5 -2
- package/build-module/components/block-toolbar/index.js.map +1 -1
- package/build-module/components/block-tools/insertion-point.js +11 -1
- package/build-module/components/block-tools/insertion-point.js.map +1 -1
- package/build-module/components/block-variation-transforms/index.js +10 -6
- package/build-module/components/block-variation-transforms/index.js.map +1 -1
- package/build-module/components/border-radius-control/utils.js.map +1 -1
- package/build-module/components/global-styles/border-panel.js +6 -6
- package/build-module/components/global-styles/border-panel.js.map +1 -1
- package/build-module/components/link-control/search-item.js +30 -12
- package/build-module/components/link-control/search-item.js.map +1 -1
- package/build-module/components/url-popover/image-url-input-ui.js +9 -4
- package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build-module/components/writing-flow/use-clipboard-handler.js +6 -1
- package/build-module/components/writing-flow/use-clipboard-handler.js.map +1 -1
- package/build-module/store/private-selectors.js +9 -21
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +114 -0
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +16 -30
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/store/utils.js +17 -0
- package/build-module/store/utils.js.map +1 -1
- package/build-module/utils/block-bindings.js +1 -1
- package/build-module/utils/block-bindings.js.map +1 -1
- package/build-style/style-rtl.css +9 -5
- package/build-style/style.css +9 -5
- package/package.json +34 -34
- package/src/autocompleters/block.js +6 -11
- package/src/components/block-card/index.js +11 -1
- package/src/components/block-inspector/edit-contents-button.js +46 -0
- package/src/components/block-inspector/index.js +6 -1
- package/src/components/block-inspector/style.scss +5 -0
- package/src/components/block-list/index.js +7 -1
- package/src/components/block-popover/use-popover-scroll.js +10 -2
- package/src/components/block-switcher/index.js +13 -4
- package/src/components/block-toolbar/index.js +11 -5
- package/src/components/block-toolbar/style.scss +3 -5
- package/src/components/block-tools/insertion-point.js +19 -1
- package/src/components/block-variation-transforms/index.js +39 -27
- package/src/components/border-radius-control/test/utils.js +71 -0
- package/src/components/border-radius-control/utils.js +1 -0
- package/src/components/global-styles/border-panel.js +7 -6
- package/src/components/link-control/search-item.js +31 -12
- package/src/components/link-control/style.scss +0 -1
- package/src/components/link-control/test/index.js +14 -2
- package/src/components/url-popover/image-url-input-ui.js +18 -2
- package/src/components/writing-flow/use-clipboard-handler.js +6 -0
- package/src/store/private-selectors.js +12 -24
- package/src/store/reducer.js +188 -0
- package/src/store/selectors.js +38 -59
- package/src/store/test/reducer.js +398 -0
- package/src/store/test/selectors.js +65 -192
- package/src/store/utils.js +21 -0
- package/src/utils/block-bindings.js +1 -1
package/build/store/selectors.js
CHANGED
|
@@ -34,7 +34,7 @@ exports.getAllowedBlocks = void 0;
|
|
|
34
34
|
exports.getBlock = getBlock;
|
|
35
35
|
exports.getBlockAttributes = getBlockAttributes;
|
|
36
36
|
exports.getBlockCount = getBlockCount;
|
|
37
|
-
exports.getBlockEditingMode =
|
|
37
|
+
exports.getBlockEditingMode = getBlockEditingMode;
|
|
38
38
|
exports.getBlockHierarchyRootClientId = getBlockHierarchyRootClientId;
|
|
39
39
|
exports.getBlockIndex = getBlockIndex;
|
|
40
40
|
exports.getBlockInsertionPoint = void 0;
|
|
@@ -1965,19 +1965,19 @@ const getInserterItems = exports.getInserterItems = (0, _data.createRegistrySele
|
|
|
1965
1965
|
src: _icons.symbol,
|
|
1966
1966
|
foreground: 'var(--wp-block-synced-color)'
|
|
1967
1967
|
} : _icons.symbol;
|
|
1968
|
-
const
|
|
1968
|
+
const userPattern = (0, _utils.mapUserPattern)(reusableBlock);
|
|
1969
1969
|
const {
|
|
1970
1970
|
time,
|
|
1971
1971
|
count = 0
|
|
1972
|
-
} = getInsertUsage(state,
|
|
1972
|
+
} = getInsertUsage(state, userPattern.name) || {};
|
|
1973
1973
|
const frecency = calculateFrecency(time, count);
|
|
1974
1974
|
return {
|
|
1975
|
-
id,
|
|
1975
|
+
id: userPattern.name,
|
|
1976
1976
|
name: 'core/block',
|
|
1977
1977
|
initialAttributes: {
|
|
1978
1978
|
ref: reusableBlock.id
|
|
1979
1979
|
},
|
|
1980
|
-
title:
|
|
1980
|
+
title: userPattern.title,
|
|
1981
1981
|
icon,
|
|
1982
1982
|
category: 'reusable',
|
|
1983
1983
|
keywords: ['reusable'],
|
|
@@ -1985,11 +1985,14 @@ const getInserterItems = exports.getInserterItems = (0, _data.createRegistrySele
|
|
|
1985
1985
|
utility: 1,
|
|
1986
1986
|
// Deprecated.
|
|
1987
1987
|
frecency,
|
|
1988
|
-
content:
|
|
1989
|
-
|
|
1988
|
+
content: userPattern.content,
|
|
1989
|
+
get blocks() {
|
|
1990
|
+
return (0, _utils.getParsedPattern)(userPattern).blocks;
|
|
1991
|
+
},
|
|
1992
|
+
syncStatus: userPattern.syncStatus
|
|
1990
1993
|
};
|
|
1991
1994
|
};
|
|
1992
|
-
const
|
|
1995
|
+
const patternInserterItems = canInsertBlockTypeUnmemoized(state, 'core/block', rootClientId) ? (0, _lockUnlock.unlock)(select(_constants.STORE_NAME)).getReusableBlocks().map(buildReusableBlockInserterItem) : [];
|
|
1993
1996
|
const buildBlockTypeInserterItem = buildBlockTypeItem(state, {
|
|
1994
1997
|
buildScope: 'inserter'
|
|
1995
1998
|
});
|
|
@@ -2041,7 +2044,7 @@ const getInserterItems = exports.getInserterItems = (0, _data.createRegistrySele
|
|
|
2041
2044
|
noncore: []
|
|
2042
2045
|
});
|
|
2043
2046
|
const sortedBlockTypes = [...coreItems, ...nonCoreItems];
|
|
2044
|
-
return [...sortedBlockTypes, ...
|
|
2047
|
+
return [...sortedBlockTypes, ...patternInserterItems];
|
|
2045
2048
|
}, (state, rootClientId) => [(0, _blocks.getBlockTypes)(), (0, _lockUnlock.unlock)(select(_constants.STORE_NAME)).getReusableBlocks(), state.blocks.order, state.preferences.insertUsage, ...(0, _utils.getInsertBlockTypeDependants)(select)(state, rootClientId)]));
|
|
2046
2049
|
|
|
2047
2050
|
/**
|
|
@@ -2640,7 +2643,7 @@ function __unstableIsWithinBlockOverlay(state, clientId) {
|
|
|
2640
2643
|
* @return {BlockEditingMode} The block editing mode. One of `'disabled'`,
|
|
2641
2644
|
* `'contentOnly'`, or `'default'`.
|
|
2642
2645
|
*/
|
|
2643
|
-
|
|
2646
|
+
function getBlockEditingMode(state, clientId = '') {
|
|
2644
2647
|
// Some selectors that call this provide `null` as the default
|
|
2645
2648
|
// rootClientId, but the default rootClientId is actually `''`.
|
|
2646
2649
|
if (clientId === null) {
|
|
@@ -2663,28 +2666,11 @@ const getBlockEditingMode = exports.getBlockEditingMode = (0, _data.createRegist
|
|
|
2663
2666
|
}
|
|
2664
2667
|
|
|
2665
2668
|
// In normal mode, consider that an explicitly set editing mode takes over.
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
return blockEditingMode;
|
|
2669
|
-
}
|
|
2670
|
-
|
|
2671
|
-
// In normal mode, top level is default mode.
|
|
2672
|
-
if (clientId === '') {
|
|
2673
|
-
return 'default';
|
|
2674
|
-
}
|
|
2675
|
-
const rootClientId = getBlockRootClientId(state, clientId);
|
|
2676
|
-
const templateLock = getTemplateLock(state, rootClientId);
|
|
2677
|
-
// If the parent of the block is contentOnly locked, check whether it's a content block.
|
|
2678
|
-
if (templateLock === 'contentOnly') {
|
|
2679
|
-
const name = getBlockName(state, clientId);
|
|
2680
|
-
const {
|
|
2681
|
-
hasContentRoleAttribute
|
|
2682
|
-
} = (0, _lockUnlock.unlock)(select(_blocks.store));
|
|
2683
|
-
const isContent = hasContentRoleAttribute(name);
|
|
2684
|
-
return isContent ? 'contentOnly' : 'disabled';
|
|
2669
|
+
if (state.blockEditingModes.has(clientId)) {
|
|
2670
|
+
return state.blockEditingModes.get(clientId);
|
|
2685
2671
|
}
|
|
2686
2672
|
return 'default';
|
|
2687
|
-
}
|
|
2673
|
+
}
|
|
2688
2674
|
|
|
2689
2675
|
/**
|
|
2690
2676
|
* Indicates if a block is ungroupable.
|