@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
|
@@ -13,7 +13,7 @@ import { store as preferencesStore } from '@wordpress/preferences';
|
|
|
13
13
|
/**
|
|
14
14
|
* Internal dependencies
|
|
15
15
|
*/
|
|
16
|
-
import { isFiltered, checkAllowListRecursive, checkAllowList, getAllPatternsDependants, getInsertBlockTypeDependants, getParsedPattern, getGrammar } from './utils';
|
|
16
|
+
import { isFiltered, checkAllowListRecursive, checkAllowList, getAllPatternsDependants, getInsertBlockTypeDependants, getParsedPattern, getGrammar, mapUserPattern } from './utils';
|
|
17
17
|
import { orderBy } from '../utils/sorting';
|
|
18
18
|
import { STORE_NAME } from './constants';
|
|
19
19
|
import { unlock } from '../lock-unlock';
|
|
@@ -1857,19 +1857,19 @@ export const getInserterItems = createRegistrySelector(select => createSelector(
|
|
|
1857
1857
|
src: symbol,
|
|
1858
1858
|
foreground: 'var(--wp-block-synced-color)'
|
|
1859
1859
|
} : symbol;
|
|
1860
|
-
const
|
|
1860
|
+
const userPattern = mapUserPattern(reusableBlock);
|
|
1861
1861
|
const {
|
|
1862
1862
|
time,
|
|
1863
1863
|
count = 0
|
|
1864
|
-
} = getInsertUsage(state,
|
|
1864
|
+
} = getInsertUsage(state, userPattern.name) || {};
|
|
1865
1865
|
const frecency = calculateFrecency(time, count);
|
|
1866
1866
|
return {
|
|
1867
|
-
id,
|
|
1867
|
+
id: userPattern.name,
|
|
1868
1868
|
name: 'core/block',
|
|
1869
1869
|
initialAttributes: {
|
|
1870
1870
|
ref: reusableBlock.id
|
|
1871
1871
|
},
|
|
1872
|
-
title:
|
|
1872
|
+
title: userPattern.title,
|
|
1873
1873
|
icon,
|
|
1874
1874
|
category: 'reusable',
|
|
1875
1875
|
keywords: ['reusable'],
|
|
@@ -1877,11 +1877,14 @@ export const getInserterItems = createRegistrySelector(select => createSelector(
|
|
|
1877
1877
|
utility: 1,
|
|
1878
1878
|
// Deprecated.
|
|
1879
1879
|
frecency,
|
|
1880
|
-
content:
|
|
1881
|
-
|
|
1880
|
+
content: userPattern.content,
|
|
1881
|
+
get blocks() {
|
|
1882
|
+
return getParsedPattern(userPattern).blocks;
|
|
1883
|
+
},
|
|
1884
|
+
syncStatus: userPattern.syncStatus
|
|
1882
1885
|
};
|
|
1883
1886
|
};
|
|
1884
|
-
const
|
|
1887
|
+
const patternInserterItems = canInsertBlockTypeUnmemoized(state, 'core/block', rootClientId) ? unlock(select(STORE_NAME)).getReusableBlocks().map(buildReusableBlockInserterItem) : [];
|
|
1885
1888
|
const buildBlockTypeInserterItem = buildBlockTypeItem(state, {
|
|
1886
1889
|
buildScope: 'inserter'
|
|
1887
1890
|
});
|
|
@@ -1933,7 +1936,7 @@ export const getInserterItems = createRegistrySelector(select => createSelector(
|
|
|
1933
1936
|
noncore: []
|
|
1934
1937
|
});
|
|
1935
1938
|
const sortedBlockTypes = [...coreItems, ...nonCoreItems];
|
|
1936
|
-
return [...sortedBlockTypes, ...
|
|
1939
|
+
return [...sortedBlockTypes, ...patternInserterItems];
|
|
1937
1940
|
}, (state, rootClientId) => [getBlockTypes(), unlock(select(STORE_NAME)).getReusableBlocks(), state.blocks.order, state.preferences.insertUsage, ...getInsertBlockTypeDependants(select)(state, rootClientId)]));
|
|
1938
1941
|
|
|
1939
1942
|
/**
|
|
@@ -2531,7 +2534,7 @@ export function __unstableIsWithinBlockOverlay(state, clientId) {
|
|
|
2531
2534
|
* @return {BlockEditingMode} The block editing mode. One of `'disabled'`,
|
|
2532
2535
|
* `'contentOnly'`, or `'default'`.
|
|
2533
2536
|
*/
|
|
2534
|
-
export
|
|
2537
|
+
export function getBlockEditingMode(state, clientId = '') {
|
|
2535
2538
|
// Some selectors that call this provide `null` as the default
|
|
2536
2539
|
// rootClientId, but the default rootClientId is actually `''`.
|
|
2537
2540
|
if (clientId === null) {
|
|
@@ -2554,28 +2557,11 @@ export const getBlockEditingMode = createRegistrySelector(select => (state, clie
|
|
|
2554
2557
|
}
|
|
2555
2558
|
|
|
2556
2559
|
// In normal mode, consider that an explicitly set editing mode takes over.
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
return blockEditingMode;
|
|
2560
|
-
}
|
|
2561
|
-
|
|
2562
|
-
// In normal mode, top level is default mode.
|
|
2563
|
-
if (clientId === '') {
|
|
2564
|
-
return 'default';
|
|
2565
|
-
}
|
|
2566
|
-
const rootClientId = getBlockRootClientId(state, clientId);
|
|
2567
|
-
const templateLock = getTemplateLock(state, rootClientId);
|
|
2568
|
-
// If the parent of the block is contentOnly locked, check whether it's a content block.
|
|
2569
|
-
if (templateLock === 'contentOnly') {
|
|
2570
|
-
const name = getBlockName(state, clientId);
|
|
2571
|
-
const {
|
|
2572
|
-
hasContentRoleAttribute
|
|
2573
|
-
} = unlock(select(blocksStore));
|
|
2574
|
-
const isContent = hasContentRoleAttribute(name);
|
|
2575
|
-
return isContent ? 'contentOnly' : 'disabled';
|
|
2560
|
+
if (state.blockEditingModes.has(clientId)) {
|
|
2561
|
+
return state.blockEditingModes.get(clientId);
|
|
2576
2562
|
}
|
|
2577
2563
|
return 'default';
|
|
2578
|
-
}
|
|
2564
|
+
}
|
|
2579
2565
|
|
|
2580
2566
|
/**
|
|
2581
2567
|
* Indicates if a block is ungroupable.
|