@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.
Files changed (65) hide show
  1. package/build/components/block-card/index.js +4 -2
  2. package/build/components/block-card/index.js.map +1 -1
  3. package/build/components/block-inspector/edit-contents-button.js +54 -0
  4. package/build/components/block-inspector/edit-contents-button.js.map +1 -0
  5. package/build/components/block-inspector/index.js +5 -1
  6. package/build/components/block-inspector/index.js.map +1 -1
  7. package/build/components/block-switcher/index.js +3 -3
  8. package/build/components/block-switcher/index.js.map +1 -1
  9. package/build/components/block-variation-transforms/index.js +1 -1
  10. package/build/components/block-variation-transforms/index.js.map +1 -1
  11. package/build/components/border-radius-control/utils.js.map +1 -1
  12. package/build/components/global-styles/border-panel.js +6 -6
  13. package/build/components/global-styles/border-panel.js.map +1 -1
  14. package/build/components/url-popover/image-url-input-ui.js +7 -2
  15. package/build/components/url-popover/image-url-input-ui.js.map +1 -1
  16. package/build/components/writing-flow/use-clipboard-handler.js +6 -1
  17. package/build/components/writing-flow/use-clipboard-handler.js.map +1 -1
  18. package/build/store/private-selectors.js +3 -2
  19. package/build/store/private-selectors.js.map +1 -1
  20. package/build/store/reducer.js +55 -1
  21. package/build/store/reducer.js.map +1 -1
  22. package/build/utils/block-bindings.js +1 -1
  23. package/build/utils/block-bindings.js.map +1 -1
  24. package/build-module/components/block-card/index.js +4 -2
  25. package/build-module/components/block-card/index.js.map +1 -1
  26. package/build-module/components/block-inspector/edit-contents-button.js +47 -0
  27. package/build-module/components/block-inspector/edit-contents-button.js.map +1 -0
  28. package/build-module/components/block-inspector/index.js +5 -1
  29. package/build-module/components/block-inspector/index.js.map +1 -1
  30. package/build-module/components/block-switcher/index.js +3 -3
  31. package/build-module/components/block-switcher/index.js.map +1 -1
  32. package/build-module/components/block-variation-transforms/index.js +1 -1
  33. package/build-module/components/block-variation-transforms/index.js.map +1 -1
  34. package/build-module/components/border-radius-control/utils.js.map +1 -1
  35. package/build-module/components/global-styles/border-panel.js +6 -6
  36. package/build-module/components/global-styles/border-panel.js.map +1 -1
  37. package/build-module/components/url-popover/image-url-input-ui.js +9 -4
  38. package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
  39. package/build-module/components/writing-flow/use-clipboard-handler.js +6 -1
  40. package/build-module/components/writing-flow/use-clipboard-handler.js.map +1 -1
  41. package/build-module/store/private-selectors.js +3 -2
  42. package/build-module/store/private-selectors.js.map +1 -1
  43. package/build-module/store/reducer.js +55 -1
  44. package/build-module/store/reducer.js.map +1 -1
  45. package/build-module/utils/block-bindings.js +1 -1
  46. package/build-module/utils/block-bindings.js.map +1 -1
  47. package/build-style/style-rtl.css +9 -4
  48. package/build-style/style.css +9 -4
  49. package/package.json +34 -34
  50. package/src/components/block-card/index.js +11 -1
  51. package/src/components/block-inspector/edit-contents-button.js +46 -0
  52. package/src/components/block-inspector/index.js +6 -1
  53. package/src/components/block-inspector/style.scss +5 -0
  54. package/src/components/block-switcher/index.js +5 -3
  55. package/src/components/block-toolbar/style.scss +3 -5
  56. package/src/components/block-variation-transforms/index.js +2 -1
  57. package/src/components/border-radius-control/test/utils.js +71 -0
  58. package/src/components/border-radius-control/utils.js +1 -0
  59. package/src/components/global-styles/border-panel.js +7 -6
  60. package/src/components/url-popover/image-url-input-ui.js +18 -2
  61. package/src/components/writing-flow/use-clipboard-handler.js +6 -0
  62. package/src/store/private-selectors.js +3 -2
  63. package/src/store/reducer.js +83 -0
  64. package/src/store/test/reducer.js +291 -0
  65. package/src/utils/block-bindings.js +1 -1
@@ -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.