@wordpress/block-editor 15.3.1-next.6f42e1382.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/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-switcher/index.js +3 -3
- package/build/components/block-switcher/index.js.map +1 -1
- package/build/components/block-variation-transforms/index.js +1 -1
- 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/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 +3 -2
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +55 -1
- package/build/store/reducer.js.map +1 -1
- package/build/utils/block-bindings.js +1 -1
- package/build/utils/block-bindings.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-switcher/index.js +3 -3
- package/build-module/components/block-switcher/index.js.map +1 -1
- package/build-module/components/block-variation-transforms/index.js +1 -1
- 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/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 +3 -2
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +55 -1
- package/build-module/store/reducer.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 -4
- package/build-style/style.css +9 -4
- package/package.json +34 -34
- 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-switcher/index.js +5 -3
- package/src/components/block-toolbar/style.scss +3 -5
- package/src/components/block-variation-transforms/index.js +2 -1
- 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/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 +3 -2
- package/src/store/reducer.js +83 -0
- package/src/store/test/reducer.js +291 -0
- package/src/utils/block-bindings.js +1 -1
package/build/store/reducer.js
CHANGED
|
@@ -2058,7 +2058,7 @@ function getDerivedBlockEditingModesForTree(state, isNavMode = false, treeClient
|
|
|
2058
2058
|
// Use array.from for better back compat. Older versions of the iterator returned
|
|
2059
2059
|
// from `keys()` didn't have the `filter` method.
|
|
2060
2060
|
const unsyncedPatternClientIds = !!window?.__experimentalContentOnlyPatternInsertion ? Array.from(state.blocks.attributes.keys()).filter(clientId => state.blocks.attributes.get(clientId)?.metadata?.patternName) : [];
|
|
2061
|
-
const contentOnlyParents = [...contentOnlyTemplateLockedClientIds, ...unsyncedPatternClientIds];
|
|
2061
|
+
const contentOnlyParents = [...contentOnlyTemplateLockedClientIds, ...unsyncedPatternClientIds, ...(window?.__experimentalContentOnlyPatternInsertion ? templatePartClientIds : [])];
|
|
2062
2062
|
traverseBlockTree(state, treeClientId, block => {
|
|
2063
2063
|
const {
|
|
2064
2064
|
clientId,
|
|
@@ -2348,6 +2348,60 @@ function withDerivedBlockEditingModes(reducer) {
|
|
|
2348
2348
|
}
|
|
2349
2349
|
break;
|
|
2350
2350
|
}
|
|
2351
|
+
case 'UPDATE_BLOCK_ATTRIBUTES':
|
|
2352
|
+
{
|
|
2353
|
+
// Handle unsynced patterns which indicate their contentOnly-ness via
|
|
2354
|
+
// the `attributes.metadata.patternName` property.
|
|
2355
|
+
// Check when this is added or removed and update blockEditingModes.
|
|
2356
|
+
const addedBlocks = [];
|
|
2357
|
+
const removedClientIds = [];
|
|
2358
|
+
for (const clientId of action?.clientIds) {
|
|
2359
|
+
const attributes = action.options?.uniqueByBlock ? action.attributes[clientId] : action.attributes;
|
|
2360
|
+
if (!attributes) {
|
|
2361
|
+
break;
|
|
2362
|
+
}
|
|
2363
|
+
if (
|
|
2364
|
+
// patternName is switching from falsy to truthy, indicating
|
|
2365
|
+
// this block is becoming an unsynced pattern.
|
|
2366
|
+
attributes.metadata?.patternName && !state.blocks.attributes.get(clientId)?.metadata?.patternName) {
|
|
2367
|
+
addedBlocks.push(nextState.blocks.tree.get(clientId));
|
|
2368
|
+
} else if (
|
|
2369
|
+
// patternName is switching from truthy to falsy, this block is becoming
|
|
2370
|
+
// a regular block but was an unsynced pattern.
|
|
2371
|
+
// Check that `metadata` is part of the included attributes, as
|
|
2372
|
+
// `updateBlockAttributes` merges attributes, if it isn't present
|
|
2373
|
+
// the previous `metadata` would be retained.
|
|
2374
|
+
attributes.metadata && !attributes.metadata?.patternName && state.blocks.attributes.get(clientId)?.metadata?.patternName) {
|
|
2375
|
+
// Include it in 'removedClientIds'.
|
|
2376
|
+
removedClientIds.push(clientId);
|
|
2377
|
+
}
|
|
2378
|
+
}
|
|
2379
|
+
if (!addedBlocks?.length && !removedClientIds?.length) {
|
|
2380
|
+
break;
|
|
2381
|
+
}
|
|
2382
|
+
const nextDerivedBlockEditingModes = getDerivedBlockEditingModesUpdates({
|
|
2383
|
+
prevState: state,
|
|
2384
|
+
nextState,
|
|
2385
|
+
addedBlocks,
|
|
2386
|
+
removedClientIds,
|
|
2387
|
+
isNavMode: false
|
|
2388
|
+
});
|
|
2389
|
+
const nextDerivedNavModeBlockEditingModes = getDerivedBlockEditingModesUpdates({
|
|
2390
|
+
prevState: state,
|
|
2391
|
+
nextState,
|
|
2392
|
+
addedBlocks,
|
|
2393
|
+
removedClientIds,
|
|
2394
|
+
isNavMode: true
|
|
2395
|
+
});
|
|
2396
|
+
if (nextDerivedBlockEditingModes || nextDerivedNavModeBlockEditingModes) {
|
|
2397
|
+
return {
|
|
2398
|
+
...nextState,
|
|
2399
|
+
derivedBlockEditingModes: nextDerivedBlockEditingModes !== null && nextDerivedBlockEditingModes !== void 0 ? nextDerivedBlockEditingModes : state.derivedBlockEditingModes,
|
|
2400
|
+
derivedNavModeBlockEditingModes: nextDerivedNavModeBlockEditingModes !== null && nextDerivedNavModeBlockEditingModes !== void 0 ? nextDerivedNavModeBlockEditingModes : state.derivedNavModeBlockEditingModes
|
|
2401
|
+
};
|
|
2402
|
+
}
|
|
2403
|
+
break;
|
|
2404
|
+
}
|
|
2351
2405
|
case 'UPDATE_BLOCK_LIST_SETTINGS':
|
|
2352
2406
|
{
|
|
2353
2407
|
// Handle the addition and removal of contentOnly template locked blocks.
|