@wordpress/block-editor 15.16.0 → 15.17.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 (157) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/autocomplete/index.cjs +1 -2
  3. package/build/components/autocomplete/index.cjs.map +3 -3
  4. package/build/components/block-list/block-crash-warning.cjs +4 -2
  5. package/build/components/block-list/block-crash-warning.cjs.map +2 -2
  6. package/build/components/block-list/block-html.cjs +6 -2
  7. package/build/components/block-list/block-html.cjs.map +2 -2
  8. package/build/components/block-mover/button.cjs +4 -3
  9. package/build/components/block-mover/button.cjs.map +2 -2
  10. package/build/components/block-mover/index.cjs +1 -8
  11. package/build/components/block-mover/index.cjs.map +2 -2
  12. package/build/components/copy-handler/index.cjs.map +2 -2
  13. package/build/components/iframe/get-compatibility-styles.cjs +1 -1
  14. package/build/components/iframe/get-compatibility-styles.cjs.map +2 -2
  15. package/build/components/inserter/media-tab/hooks.cjs +1 -1
  16. package/build/components/inserter/media-tab/hooks.cjs.map +2 -2
  17. package/build/components/link-control/link-preview.cjs +3 -1
  18. package/build/components/link-control/link-preview.cjs.map +2 -2
  19. package/build/components/link-control/search-input.cjs +1 -1
  20. package/build/components/link-control/search-input.cjs.map +2 -2
  21. package/build/components/link-picker/link-preview.cjs +2 -1
  22. package/build/components/link-picker/link-preview.cjs.map +3 -3
  23. package/build/components/preset-input-control/index.cjs +7 -4
  24. package/build/components/preset-input-control/index.cjs.map +2 -2
  25. package/build/components/rich-text/event-listeners/index.cjs.map +2 -2
  26. package/build/components/rich-text/index.cjs +1 -1
  27. package/build/components/rich-text/index.cjs.map +2 -2
  28. package/build/components/rich-text/input-event.cjs +3 -3
  29. package/build/components/rich-text/input-event.cjs.map +2 -2
  30. package/build/components/spacing-sizes-control/utils.cjs +1 -1
  31. package/build/components/spacing-sizes-control/utils.cjs.map +2 -2
  32. package/build/components/use-on-block-drop/index.cjs +1 -1
  33. package/build/components/use-on-block-drop/index.cjs.map +2 -2
  34. package/build/components/use-paste-styles/index.cjs +2 -2
  35. package/build/components/use-paste-styles/index.cjs.map +2 -2
  36. package/build/components/writing-flow/use-selection-observer.cjs +23 -1
  37. package/build/components/writing-flow/use-selection-observer.cjs.map +2 -2
  38. package/build/hooks/block-style-variation.cjs +5 -6
  39. package/build/hooks/block-style-variation.cjs.map +3 -3
  40. package/build/hooks/index.cjs +2 -2
  41. package/build/hooks/index.cjs.map +2 -2
  42. package/build/hooks/style.cjs +54 -52
  43. package/build/hooks/style.cjs.map +2 -2
  44. package/build/private-apis.cjs +1 -1
  45. package/build/private-apis.cjs.map +1 -1
  46. package/build/store/actions.cjs +0 -8
  47. package/build/store/actions.cjs.map +2 -2
  48. package/build/store/reducer.cjs +52 -53
  49. package/build/store/reducer.cjs.map +2 -2
  50. package/build/store/selectors.cjs +12 -13
  51. package/build/store/selectors.cjs.map +2 -2
  52. package/build/store/utils.cjs +1 -1
  53. package/build/store/utils.cjs.map +2 -2
  54. package/build/utils/pasting.cjs +1 -1
  55. package/build/utils/pasting.cjs.map +2 -2
  56. package/build-module/components/autocomplete/index.mjs +1 -2
  57. package/build-module/components/autocomplete/index.mjs.map +2 -2
  58. package/build-module/components/block-list/block-crash-warning.mjs +4 -2
  59. package/build-module/components/block-list/block-crash-warning.mjs.map +2 -2
  60. package/build-module/components/block-list/block-html.mjs +7 -3
  61. package/build-module/components/block-list/block-html.mjs.map +2 -2
  62. package/build-module/components/block-mover/button.mjs +4 -3
  63. package/build-module/components/block-mover/button.mjs.map +2 -2
  64. package/build-module/components/block-mover/index.mjs +1 -8
  65. package/build-module/components/block-mover/index.mjs.map +2 -2
  66. package/build-module/components/copy-handler/index.mjs.map +2 -2
  67. package/build-module/components/iframe/get-compatibility-styles.mjs +1 -1
  68. package/build-module/components/iframe/get-compatibility-styles.mjs.map +2 -2
  69. package/build-module/components/inserter/media-tab/hooks.mjs +1 -1
  70. package/build-module/components/inserter/media-tab/hooks.mjs.map +2 -2
  71. package/build-module/components/link-control/link-preview.mjs +3 -1
  72. package/build-module/components/link-control/link-preview.mjs.map +2 -2
  73. package/build-module/components/link-control/search-input.mjs +1 -1
  74. package/build-module/components/link-control/search-input.mjs.map +2 -2
  75. package/build-module/components/link-picker/link-preview.mjs +2 -1
  76. package/build-module/components/link-picker/link-preview.mjs.map +2 -2
  77. package/build-module/components/preset-input-control/index.mjs +7 -4
  78. package/build-module/components/preset-input-control/index.mjs.map +2 -2
  79. package/build-module/components/rich-text/event-listeners/index.mjs.map +2 -2
  80. package/build-module/components/rich-text/index.mjs +2 -2
  81. package/build-module/components/rich-text/index.mjs.map +2 -2
  82. package/build-module/components/rich-text/input-event.mjs +2 -2
  83. package/build-module/components/rich-text/input-event.mjs.map +2 -2
  84. package/build-module/components/spacing-sizes-control/utils.mjs +1 -1
  85. package/build-module/components/spacing-sizes-control/utils.mjs.map +2 -2
  86. package/build-module/components/use-on-block-drop/index.mjs +1 -1
  87. package/build-module/components/use-on-block-drop/index.mjs.map +2 -2
  88. package/build-module/components/use-paste-styles/index.mjs +2 -2
  89. package/build-module/components/use-paste-styles/index.mjs.map +2 -2
  90. package/build-module/components/writing-flow/use-selection-observer.mjs +23 -1
  91. package/build-module/components/writing-flow/use-selection-observer.mjs.map +2 -2
  92. package/build-module/hooks/block-style-variation.mjs +4 -5
  93. package/build-module/hooks/block-style-variation.mjs.map +2 -2
  94. package/build-module/hooks/index.mjs +2 -2
  95. package/build-module/hooks/index.mjs.map +2 -2
  96. package/build-module/hooks/style.mjs +54 -52
  97. package/build-module/hooks/style.mjs.map +2 -2
  98. package/build-module/private-apis.mjs +2 -2
  99. package/build-module/private-apis.mjs.map +1 -1
  100. package/build-module/store/actions.mjs +0 -8
  101. package/build-module/store/actions.mjs.map +2 -2
  102. package/build-module/store/reducer.mjs +52 -53
  103. package/build-module/store/reducer.mjs.map +2 -2
  104. package/build-module/store/selectors.mjs +12 -13
  105. package/build-module/store/selectors.mjs.map +2 -2
  106. package/build-module/store/utils.mjs +1 -1
  107. package/build-module/store/utils.mjs.map +2 -2
  108. package/build-module/utils/pasting.mjs +1 -1
  109. package/build-module/utils/pasting.mjs.map +2 -2
  110. package/build-style/style-rtl.css +0 -7
  111. package/build-style/style.css +0 -7
  112. package/package.json +38 -39
  113. package/src/autocompleters/style.scss +0 -8
  114. package/src/components/autocomplete/index.js +1 -2
  115. package/src/components/block-draggable/test/helpers.native.js +1 -1
  116. package/src/components/block-list/block-crash-warning.js +3 -1
  117. package/src/components/block-list/block-crash-warning.native.js +3 -1
  118. package/src/components/block-list/block-html.js +13 -3
  119. package/src/components/block-mover/button.js +7 -4
  120. package/src/components/block-mover/index.js +1 -8
  121. package/src/components/copy-handler/index.js +1 -0
  122. package/src/components/iframe/get-compatibility-styles.js +1 -1
  123. package/src/components/inserter/media-tab/hooks.js +1 -1
  124. package/src/components/link-control/README.md +2 -2
  125. package/src/components/link-control/link-preview.js +3 -1
  126. package/src/components/link-control/search-input.js +1 -1
  127. package/src/components/link-picker/link-preview.js +2 -1
  128. package/src/components/preset-input-control/index.js +10 -4
  129. package/src/components/preset-input-control/test/index.js +70 -0
  130. package/src/components/rich-text/event-listeners/index.js +1 -0
  131. package/src/components/rich-text/index.js +1 -1
  132. package/src/components/rich-text/index.native.js +1 -1
  133. package/src/components/rich-text/input-event.js +1 -1
  134. package/src/components/rich-text/input-event.native.js +1 -1
  135. package/src/components/rich-text/native/index.native.js +18 -17
  136. package/src/components/spacing-sizes-control/utils.js +1 -1
  137. package/src/components/use-on-block-drop/index.js +1 -1
  138. package/src/components/use-paste-styles/index.js +2 -2
  139. package/src/components/writing-flow/use-selection-observer.js +39 -1
  140. package/src/hooks/block-style-variation.js +3 -4
  141. package/src/hooks/index.js +1 -1
  142. package/src/hooks/style.js +75 -61
  143. package/src/private-apis.js +2 -2
  144. package/src/store/actions.js +0 -8
  145. package/src/store/reducer.js +62 -67
  146. package/src/store/selectors.js +31 -21
  147. package/src/store/test/private-selectors.js +44 -41
  148. package/src/store/test/reducer.js +159 -88
  149. package/src/store/test/registry-selectors.js +1 -1
  150. package/src/store/test/selectors.js +265 -200
  151. package/src/store/utils.js +1 -1
  152. package/src/utils/pasting.js +1 -1
  153. package/build/autocompleters/link.cjs +0 -81
  154. package/build/autocompleters/link.cjs.map +0 -7
  155. package/build-module/autocompleters/link.mjs +0 -50
  156. package/build-module/autocompleters/link.mjs.map +0 -7
  157. package/src/autocompleters/link.js +0 -63
@@ -285,7 +285,7 @@ describe( 'state', () => {
285
285
  'chicken-child': {},
286
286
  } )
287
287
  ),
288
- controlledInnerBlocks: {},
288
+ controlledInnerBlocks: new Set(),
289
289
  blockEditingModes: new Map(),
290
290
  } );
291
291
 
@@ -344,7 +344,7 @@ describe( 'state', () => {
344
344
  chicken: '',
345
345
  } )
346
346
  ),
347
- controlledInnerBlocks: {},
347
+ controlledInnerBlocks: new Set(),
348
348
  blockEditingModes: new Map(),
349
349
  } );
350
350
  expect( state.tree.get( 'chicken' ) ).not.toBe(
@@ -387,7 +387,7 @@ describe( 'state', () => {
387
387
  chicken: {},
388
388
  } )
389
389
  ),
390
- controlledInnerBlocks: {},
390
+ controlledInnerBlocks: new Set(),
391
391
  blockEditingModes: new Map(),
392
392
  } );
393
393
 
@@ -446,7 +446,7 @@ describe( 'state', () => {
446
446
  chicken: '',
447
447
  } )
448
448
  ),
449
- controlledInnerBlocks: {},
449
+ controlledInnerBlocks: new Set(),
450
450
  blockEditingModes: new Map(),
451
451
  } );
452
452
  expect( state.tree.get( 'chicken' ) ).not.toBe(
@@ -518,7 +518,7 @@ describe( 'state', () => {
518
518
  } )
519
519
  ),
520
520
  tree: new Map(),
521
- controlledInnerBlocks: {},
521
+ controlledInnerBlocks: new Set(),
522
522
  blockEditingModes: new Map(),
523
523
  } );
524
524
 
@@ -613,7 +613,7 @@ describe( 'state', () => {
613
613
  [ newChildBlockId3 ]: 'chicken',
614
614
  } )
615
615
  ),
616
- controlledInnerBlocks: {},
616
+ controlledInnerBlocks: new Set(),
617
617
  blockEditingModes: new Map(),
618
618
  } );
619
619
 
@@ -689,7 +689,7 @@ describe( 'state', () => {
689
689
  chicken: {},
690
690
  } )
691
691
  ),
692
- controlledInnerBlocks: {},
692
+ controlledInnerBlocks: new Set(),
693
693
  blockEditingModes: new Map(),
694
694
  } );
695
695
 
@@ -742,7 +742,7 @@ describe( 'state', () => {
742
742
  [ newChildBlockId ]: 'chicken',
743
743
  } )
744
744
  ),
745
- controlledInnerBlocks: {},
745
+ controlledInnerBlocks: new Set(),
746
746
  blockEditingModes: new Map(),
747
747
  } );
748
748
 
@@ -764,7 +764,7 @@ describe( 'state', () => {
764
764
  isPersistentChange: true,
765
765
  isIgnoredChange: false,
766
766
  tree: new Map(),
767
- controlledInnerBlocks: {},
767
+ controlledInnerBlocks: new Set(),
768
768
  blockEditingModes: new Map(),
769
769
  } );
770
770
  } );
@@ -2259,7 +2259,9 @@ describe( 'state', () => {
2259
2259
  hasControlledInnerBlocks: true,
2260
2260
  } );
2261
2261
 
2262
- expect( state.controlledInnerBlocks.chicken ).toBe( true );
2262
+ expect( state.controlledInnerBlocks.has( 'chicken' ) ).toBe(
2263
+ true
2264
+ );
2263
2265
  // The previous content of the block should be removed
2264
2266
  expect( state.byClientId.child ).toBeUndefined();
2265
2267
  expect( state.tree.get( 'child' ) ).toBeUndefined();
@@ -2296,9 +2298,7 @@ describe( 'state', () => {
2296
2298
  'paragraph-id': [],
2297
2299
  } )
2298
2300
  ),
2299
- controlledInnerBlocks: {
2300
- 'reusable-id': true,
2301
- },
2301
+ controlledInnerBlocks: new Set( [ 'reusable-id' ] ),
2302
2302
  parents: new Map(
2303
2303
  Object.entries( {
2304
2304
  'group-id': '',
@@ -2421,9 +2421,9 @@ describe( 'state', () => {
2421
2421
  clientId: 'chicken',
2422
2422
  hasControlledInnerBlocks: true,
2423
2423
  } );
2424
- expect( withControlled.controlledInnerBlocks.chicken ).toBe(
2425
- true
2426
- );
2424
+ expect(
2425
+ withControlled.controlledInnerBlocks.has( 'chicken' )
2426
+ ).toBe( true );
2427
2427
 
2428
2428
  const state = blocks( withControlled, {
2429
2429
  type: 'RESET_BLOCKS',
@@ -2437,7 +2437,9 @@ describe( 'state', () => {
2437
2437
  ],
2438
2438
  } );
2439
2439
 
2440
- expect( state.controlledInnerBlocks.chicken ).toBe( true );
2440
+ expect( state.controlledInnerBlocks.has( 'chicken' ) ).toBe(
2441
+ true
2442
+ );
2441
2443
  } );
2442
2444
 
2443
2445
  it( 'should preserve controlledInnerBlocks blocks across RESET_BLOCKS', () => {
@@ -2499,7 +2501,9 @@ describe( 'state', () => {
2499
2501
  ],
2500
2502
  } );
2501
2503
 
2502
- expect( state.controlledInnerBlocks.chicken ).toBe( true );
2504
+ expect( state.controlledInnerBlocks.has( 'chicken' ) ).toBe(
2505
+ true
2506
+ );
2503
2507
  expect(
2504
2508
  getBlocks( { blocks: state }, 'chicken' ).map(
2505
2509
  ( b ) => b.clientId
@@ -2656,7 +2660,9 @@ describe( 'state', () => {
2656
2660
  hasControlledInnerBlocks: true,
2657
2661
  } );
2658
2662
 
2659
- expect( state.controlledInnerBlocks.chicken ).toBe( true );
2663
+ expect( state.controlledInnerBlocks.has( 'chicken' ) ).toBe(
2664
+ true
2665
+ );
2660
2666
  // The order and byClientId Maps should be the same
2661
2667
  // reference because the block has no inner blocks to
2662
2668
  // remove, so REPLACE_INNER_BLOCKS should be skipped.
@@ -3385,7 +3391,7 @@ describe( 'state', () => {
3385
3391
 
3386
3392
  describe( 'blockListSettings', () => {
3387
3393
  it( 'should add new settings', () => {
3388
- const original = deepFreeze( {} );
3394
+ const original = deepFreeze( new Map() );
3389
3395
 
3390
3396
  const state = blockListSettings( original, {
3391
3397
  type: 'UPDATE_BLOCK_LIST_SETTINGS',
@@ -3395,19 +3401,29 @@ describe( 'state', () => {
3395
3401
  },
3396
3402
  } );
3397
3403
 
3398
- expect( state ).toEqual( {
3399
- '9db792c6-a25a-495d-adbd-97d56a4c4189': {
3400
- allowedBlocks: [ 'core/paragraph' ],
3401
- },
3402
- } );
3404
+ expect( state ).toEqual(
3405
+ new Map( [
3406
+ [
3407
+ '9db792c6-a25a-495d-adbd-97d56a4c4189',
3408
+ {
3409
+ allowedBlocks: [ 'core/paragraph' ],
3410
+ },
3411
+ ],
3412
+ ] )
3413
+ );
3403
3414
  } );
3404
3415
 
3405
3416
  it( 'should return same reference if updated as the same', () => {
3406
- const original = deepFreeze( {
3407
- '9db792c6-a25a-495d-adbd-97d56a4c4189': {
3408
- allowedBlocks: [ 'core/paragraph' ],
3409
- },
3410
- } );
3417
+ const original = deepFreeze(
3418
+ new Map( [
3419
+ [
3420
+ '9db792c6-a25a-495d-adbd-97d56a4c4189',
3421
+ {
3422
+ allowedBlocks: [ 'core/paragraph' ],
3423
+ },
3424
+ ],
3425
+ ] )
3426
+ );
3411
3427
 
3412
3428
  const state = blockListSettings( original, {
3413
3429
  type: 'UPDATE_BLOCK_LIST_SETTINGS',
@@ -3421,7 +3437,7 @@ describe( 'state', () => {
3421
3437
  } );
3422
3438
 
3423
3439
  it( 'should return same reference if updated settings not assigned and id not exists', () => {
3424
- const original = deepFreeze( {} );
3440
+ const original = deepFreeze( new Map() );
3425
3441
 
3426
3442
  const state = blockListSettings( original, {
3427
3443
  type: 'UPDATE_BLOCK_LIST_SETTINGS',
@@ -3432,14 +3448,22 @@ describe( 'state', () => {
3432
3448
  } );
3433
3449
 
3434
3450
  it( 'should update the settings of a block', () => {
3435
- const original = deepFreeze( {
3436
- '9db792c6-a25a-495d-adbd-97d56a4c4189': {
3437
- allowedBlocks: [ 'core/paragraph' ],
3438
- },
3439
- 'afd1cb17-2c08-4e7a-91be-007ba7ddc3a1': {
3440
- allowedBlocks: true,
3441
- },
3442
- } );
3451
+ const original = deepFreeze(
3452
+ new Map( [
3453
+ [
3454
+ '9db792c6-a25a-495d-adbd-97d56a4c4189',
3455
+ {
3456
+ allowedBlocks: [ 'core/paragraph' ],
3457
+ },
3458
+ ],
3459
+ [
3460
+ 'afd1cb17-2c08-4e7a-91be-007ba7ddc3a1',
3461
+ {
3462
+ allowedBlocks: true,
3463
+ },
3464
+ ],
3465
+ ] )
3466
+ );
3443
3467
 
3444
3468
  const state = blockListSettings( original, {
3445
3469
  type: 'UPDATE_BLOCK_LIST_SETTINGS',
@@ -3449,40 +3473,61 @@ describe( 'state', () => {
3449
3473
  },
3450
3474
  } );
3451
3475
 
3452
- expect( state ).toEqual( {
3453
- '9db792c6-a25a-495d-adbd-97d56a4c4189': {
3454
- allowedBlocks: [ 'core/list' ],
3455
- },
3456
- 'afd1cb17-2c08-4e7a-91be-007ba7ddc3a1': {
3457
- allowedBlocks: true,
3458
- },
3459
- } );
3476
+ expect( state ).toEqual(
3477
+ new Map( [
3478
+ [
3479
+ '9db792c6-a25a-495d-adbd-97d56a4c4189',
3480
+ {
3481
+ allowedBlocks: [ 'core/list' ],
3482
+ },
3483
+ ],
3484
+ [
3485
+ 'afd1cb17-2c08-4e7a-91be-007ba7ddc3a1',
3486
+ {
3487
+ allowedBlocks: true,
3488
+ },
3489
+ ],
3490
+ ] )
3491
+ );
3460
3492
  } );
3461
3493
 
3462
3494
  it( 'should remove existing settings if updated settings not assigned', () => {
3463
- const original = deepFreeze( {
3464
- '9db792c6-a25a-495d-adbd-97d56a4c4189': {
3465
- allowedBlocks: [ 'core/paragraph' ],
3466
- },
3467
- } );
3495
+ const original = deepFreeze(
3496
+ new Map( [
3497
+ [
3498
+ '9db792c6-a25a-495d-adbd-97d56a4c4189',
3499
+ {
3500
+ allowedBlocks: [ 'core/paragraph' ],
3501
+ },
3502
+ ],
3503
+ ] )
3504
+ );
3468
3505
 
3469
3506
  const state = blockListSettings( original, {
3470
3507
  type: 'UPDATE_BLOCK_LIST_SETTINGS',
3471
3508
  clientId: '9db792c6-a25a-495d-adbd-97d56a4c4189',
3472
3509
  } );
3473
3510
 
3474
- expect( state ).toEqual( {} );
3511
+ expect( state ).toEqual( new Map() );
3475
3512
  } );
3476
3513
 
3477
3514
  it( 'should remove the settings of a block when it is replaced', () => {
3478
- const original = deepFreeze( {
3479
- '9db792c6-a25a-495d-adbd-97d56a4c4189': {
3480
- allowedBlocks: [ 'core/paragraph' ],
3481
- },
3482
- 'afd1cb17-2c08-4e7a-91be-007ba7ddc3a1': {
3483
- allowedBlocks: true,
3484
- },
3485
- } );
3515
+ const original = deepFreeze(
3516
+ new Map( [
3517
+ [
3518
+ '9db792c6-a25a-495d-adbd-97d56a4c4189',
3519
+ {
3520
+ allowedBlocks: [ 'core/paragraph' ],
3521
+ },
3522
+ ],
3523
+ [
3524
+ 'afd1cb17-2c08-4e7a-91be-007ba7ddc3a1',
3525
+ {
3526
+ allowedBlocks: true,
3527
+ },
3528
+ ],
3529
+ ] )
3530
+ );
3486
3531
 
3487
3532
  const state = blockListSettings( original, {
3488
3533
  type: 'REPLACE_BLOCKS',
@@ -3490,22 +3535,35 @@ describe( 'state', () => {
3490
3535
  blocks: [],
3491
3536
  } );
3492
3537
 
3493
- expect( state ).toEqual( {
3494
- '9db792c6-a25a-495d-adbd-97d56a4c4189': {
3495
- allowedBlocks: [ 'core/paragraph' ],
3496
- },
3497
- } );
3538
+ expect( state ).toEqual(
3539
+ new Map( [
3540
+ [
3541
+ '9db792c6-a25a-495d-adbd-97d56a4c4189',
3542
+ {
3543
+ allowedBlocks: [ 'core/paragraph' ],
3544
+ },
3545
+ ],
3546
+ ] )
3547
+ );
3498
3548
  } );
3499
3549
 
3500
3550
  it( 'should preserve the settings of a block when its clientId is reused in replacement', () => {
3501
- const original = deepFreeze( {
3502
- '9db792c6-a25a-495d-adbd-97d56a4c4189': {
3503
- allowedBlocks: [ 'core/paragraph' ],
3504
- },
3505
- 'afd1cb17-2c08-4e7a-91be-007ba7ddc3a1': {
3506
- allowedBlocks: true,
3507
- },
3508
- } );
3551
+ const original = deepFreeze(
3552
+ new Map( [
3553
+ [
3554
+ '9db792c6-a25a-495d-adbd-97d56a4c4189',
3555
+ {
3556
+ allowedBlocks: [ 'core/paragraph' ],
3557
+ },
3558
+ ],
3559
+ [
3560
+ 'afd1cb17-2c08-4e7a-91be-007ba7ddc3a1',
3561
+ {
3562
+ allowedBlocks: true,
3563
+ },
3564
+ ],
3565
+ ] )
3566
+ );
3509
3567
 
3510
3568
  const state = blockListSettings( original, {
3511
3569
  type: 'REPLACE_BLOCKS',
@@ -3518,29 +3576,42 @@ describe( 'state', () => {
3518
3576
  ],
3519
3577
  } );
3520
3578
 
3521
- expect( state ).toEqual( {
3522
- '9db792c6-a25a-495d-adbd-97d56a4c4189': {
3523
- allowedBlocks: [ 'core/paragraph' ],
3524
- },
3525
- 'afd1cb17-2c08-4e7a-91be-007ba7ddc3a1': {
3526
- allowedBlocks: true,
3527
- },
3528
- } );
3579
+ expect( state ).toEqual(
3580
+ new Map( [
3581
+ [
3582
+ '9db792c6-a25a-495d-adbd-97d56a4c4189',
3583
+ {
3584
+ allowedBlocks: [ 'core/paragraph' ],
3585
+ },
3586
+ ],
3587
+ [
3588
+ 'afd1cb17-2c08-4e7a-91be-007ba7ddc3a1',
3589
+ {
3590
+ allowedBlocks: true,
3591
+ },
3592
+ ],
3593
+ ] )
3594
+ );
3529
3595
  } );
3530
3596
 
3531
3597
  it( 'should remove the settings of a block when it is removed', () => {
3532
- const original = deepFreeze( {
3533
- 'afd1cb17-2c08-4e7a-91be-007ba7ddc3a1': {
3534
- allowedBlocks: true,
3535
- },
3536
- } );
3598
+ const original = deepFreeze(
3599
+ new Map( [
3600
+ [
3601
+ 'afd1cb17-2c08-4e7a-91be-007ba7ddc3a1',
3602
+ {
3603
+ allowedBlocks: true,
3604
+ },
3605
+ ],
3606
+ ] )
3607
+ );
3537
3608
 
3538
3609
  const state = blockListSettings( original, {
3539
3610
  type: 'REMOVE_BLOCKS',
3540
3611
  clientIds: [ 'afd1cb17-2c08-4e7a-91be-007ba7ddc3a1' ],
3541
3612
  } );
3542
3613
 
3543
- expect( state ).toEqual( {} );
3614
+ expect( state ).toEqual( new Map() );
3544
3615
  } );
3545
3616
  } );
3546
3617
 
@@ -104,7 +104,7 @@ describe( 'selectors', () => {
104
104
  expect(
105
105
  select( store ).__experimentalGetAllowedPatterns( {
106
106
  blocks: { byClientId: new Map() },
107
- blockListSettings: {},
107
+ blockListSettings: new Map(),
108
108
  settings: {
109
109
  __experimentalBlockPatterns: [
110
110
  {