@wordpress/block-editor 12.19.2 → 12.19.4

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 (148) hide show
  1. package/build/components/block-edit/context.js +2 -1
  2. package/build/components/block-edit/context.js.map +1 -1
  3. package/build/components/block-edit/index.js +8 -3
  4. package/build/components/block-edit/index.js.map +1 -1
  5. package/build/components/block-inspector/index.js +5 -4
  6. package/build/components/block-inspector/index.js.map +1 -1
  7. package/build/components/block-preview/index.js +4 -0
  8. package/build/components/block-preview/index.js.map +1 -1
  9. package/build/components/block-tools/insertion-point.js +4 -1
  10. package/build/components/block-tools/insertion-point.js.map +1 -1
  11. package/build/components/global-styles/advanced-panel.js +5 -10
  12. package/build/components/global-styles/advanced-panel.js.map +1 -1
  13. package/build/components/global-styles/border-panel.js +21 -8
  14. package/build/components/global-styles/border-panel.js.map +1 -1
  15. package/build/components/global-styles/index.js +6 -0
  16. package/build/components/global-styles/index.js.map +1 -1
  17. package/build/components/global-styles/shadow-panel-components.js +80 -23
  18. package/build/components/global-styles/shadow-panel-components.js.map +1 -1
  19. package/build/components/inserter/media-tab/media-preview.js +1 -1
  20. package/build/components/inserter/media-tab/media-preview.js.map +1 -1
  21. package/build/components/inspector-controls-tabs/styles-tab.js +1 -1
  22. package/build/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  23. package/build/components/link-control/link-preview.js +4 -1
  24. package/build/components/link-control/link-preview.js.map +1 -1
  25. package/build/components/rich-text/index.js +52 -28
  26. package/build/components/rich-text/index.js.map +1 -1
  27. package/build/components/rich-text/use-enter.js +3 -0
  28. package/build/components/rich-text/use-enter.js.map +1 -1
  29. package/build/components/rich-text/use-paste-handler.js +25 -26
  30. package/build/components/rich-text/use-paste-handler.js.map +1 -1
  31. package/build/hooks/background.js +4 -2
  32. package/build/hooks/background.js.map +1 -1
  33. package/build/hooks/block-hooks.js +8 -6
  34. package/build/hooks/block-hooks.js.map +1 -1
  35. package/build/hooks/border.js +6 -4
  36. package/build/hooks/border.js.map +1 -1
  37. package/build/hooks/use-bindings-attributes.js +2 -4
  38. package/build/hooks/use-bindings-attributes.js.map +1 -1
  39. package/build/private-apis.js +5 -1
  40. package/build/private-apis.js.map +1 -1
  41. package/build/store/index.js +0 -2
  42. package/build/store/index.js.map +1 -1
  43. package/build/store/private-actions.js +0 -10
  44. package/build/store/private-actions.js.map +1 -1
  45. package/build/store/private-keys.js +8 -0
  46. package/build/store/private-keys.js.map +1 -0
  47. package/build/store/private-selectors.js +6 -17
  48. package/build/store/private-selectors.js.map +1 -1
  49. package/build/store/reducer.js +1 -24
  50. package/build/store/reducer.js.map +1 -1
  51. package/build/store/selectors.js +7 -12
  52. package/build/store/selectors.js.map +1 -1
  53. package/build/store/utils.js +7 -2
  54. package/build/store/utils.js.map +1 -1
  55. package/build-module/components/block-edit/context.js +1 -0
  56. package/build-module/components/block-edit/context.js.map +1 -1
  57. package/build-module/components/block-edit/index.js +9 -4
  58. package/build-module/components/block-edit/index.js.map +1 -1
  59. package/build-module/components/block-inspector/index.js +6 -5
  60. package/build-module/components/block-inspector/index.js.map +1 -1
  61. package/build-module/components/block-preview/index.js +4 -0
  62. package/build-module/components/block-preview/index.js.map +1 -1
  63. package/build-module/components/block-tools/insertion-point.js +4 -1
  64. package/build-module/components/block-tools/insertion-point.js.map +1 -1
  65. package/build-module/components/global-styles/advanced-panel.js +6 -11
  66. package/build-module/components/global-styles/advanced-panel.js.map +1 -1
  67. package/build-module/components/global-styles/border-panel.js +22 -10
  68. package/build-module/components/global-styles/border-panel.js.map +1 -1
  69. package/build-module/components/global-styles/index.js +1 -1
  70. package/build-module/components/global-styles/index.js.map +1 -1
  71. package/build-module/components/global-styles/shadow-panel-components.js +82 -24
  72. package/build-module/components/global-styles/shadow-panel-components.js.map +1 -1
  73. package/build-module/components/inserter/media-tab/media-preview.js +1 -1
  74. package/build-module/components/inserter/media-tab/media-preview.js.map +1 -1
  75. package/build-module/components/inspector-controls-tabs/styles-tab.js +2 -2
  76. package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  77. package/build-module/components/link-control/link-preview.js +5 -2
  78. package/build-module/components/link-control/link-preview.js.map +1 -1
  79. package/build-module/components/rich-text/index.js +52 -29
  80. package/build-module/components/rich-text/index.js.map +1 -1
  81. package/build-module/components/rich-text/use-enter.js +3 -0
  82. package/build-module/components/rich-text/use-enter.js.map +1 -1
  83. package/build-module/components/rich-text/use-paste-handler.js +25 -26
  84. package/build-module/components/rich-text/use-paste-handler.js.map +1 -1
  85. package/build-module/hooks/background.js +4 -2
  86. package/build-module/hooks/background.js.map +1 -1
  87. package/build-module/hooks/block-hooks.js +8 -6
  88. package/build-module/hooks/block-hooks.js.map +1 -1
  89. package/build-module/hooks/border.js +7 -5
  90. package/build-module/hooks/border.js.map +1 -1
  91. package/build-module/hooks/use-bindings-attributes.js +3 -5
  92. package/build-module/hooks/use-bindings-attributes.js.map +1 -1
  93. package/build-module/private-apis.js +5 -1
  94. package/build-module/private-apis.js.map +1 -1
  95. package/build-module/store/index.js +0 -2
  96. package/build-module/store/index.js.map +1 -1
  97. package/build-module/store/private-actions.js +0 -9
  98. package/build-module/store/private-actions.js.map +1 -1
  99. package/build-module/store/private-keys.js +2 -0
  100. package/build-module/store/private-keys.js.map +1 -0
  101. package/build-module/store/private-selectors.js +5 -12
  102. package/build-module/store/private-selectors.js.map +1 -1
  103. package/build-module/store/reducer.js +1 -24
  104. package/build-module/store/reducer.js.map +1 -1
  105. package/build-module/store/selectors.js +8 -13
  106. package/build-module/store/selectors.js.map +1 -1
  107. package/build-module/store/utils.js +6 -2
  108. package/build-module/store/utils.js.map +1 -1
  109. package/build-style/style-rtl.css +47 -24
  110. package/build-style/style.css +47 -24
  111. package/package.json +7 -7
  112. package/src/components/block-edit/context.js +1 -0
  113. package/src/components/block-edit/index.js +5 -1
  114. package/src/components/block-inspector/index.js +7 -5
  115. package/src/components/block-preview/index.js +6 -1
  116. package/src/components/block-toolbar/style.scss +11 -6
  117. package/src/components/block-tools/insertion-point.js +6 -1
  118. package/src/components/global-styles/advanced-panel.js +6 -12
  119. package/src/components/global-styles/border-panel.js +33 -22
  120. package/src/components/global-styles/index.js +5 -1
  121. package/src/components/global-styles/shadow-panel-components.js +92 -23
  122. package/src/components/global-styles/style.scss +33 -20
  123. package/src/components/inserter/media-tab/media-preview.js +6 -1
  124. package/src/components/inspector-controls-tabs/styles-tab.js +2 -2
  125. package/src/components/link-control/link-preview.js +9 -2
  126. package/src/components/link-control/style.scss +9 -0
  127. package/src/components/rich-text/index.js +74 -44
  128. package/src/components/rich-text/use-enter.js +4 -0
  129. package/src/components/rich-text/use-paste-handler.js +26 -25
  130. package/src/components/url-popover/style.scss +1 -0
  131. package/src/hooks/background.js +5 -2
  132. package/src/hooks/block-hooks.js +10 -5
  133. package/src/hooks/block-hooks.scss +6 -0
  134. package/src/hooks/border.js +16 -4
  135. package/src/hooks/use-bindings-attributes.js +5 -7
  136. package/src/private-apis.js +4 -0
  137. package/src/store/index.js +0 -2
  138. package/src/store/private-actions.js +0 -10
  139. package/src/store/private-keys.js +1 -0
  140. package/src/store/private-selectors.js +4 -15
  141. package/src/store/reducer.js +0 -25
  142. package/src/store/selectors.js +7 -15
  143. package/src/store/utils.js +7 -2
  144. package/build/store/resolvers.js +0 -27
  145. package/build/store/resolvers.js.map +0 -1
  146. package/build-module/store/resolvers.js +0 -20
  147. package/build-module/store/resolvers.js.map +0 -1
  148. package/src/store/resolvers.js +0 -17
@@ -1,3 +1,7 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import { selectBlockPatternsKey } from './private-keys';
1
5
  export const checkAllowList = (list, item, defaultResult = null) => {
2
6
  if (typeof list === 'boolean') {
3
7
  return list;
@@ -30,7 +34,7 @@ export const checkAllowListRecursive = (blocks, allowedBlockTypes) => {
30
34
  }
31
35
  return true;
32
36
  };
33
- export const getAllPatternsDependants = state => {
34
- return [state.settings.__experimentalBlockPatterns, state.settings.__experimentalUserPatternCategories, state.settings.__experimentalReusableBlocks, state.settings.__experimentalFetchBlockPatterns, state.blockPatterns];
37
+ export const getAllPatternsDependants = select => state => {
38
+ return [state.settings.__experimentalBlockPatterns, state.settings.__experimentalUserPatternCategories, state.settings.__experimentalReusableBlocks, state.settings[selectBlockPatternsKey]?.(select), state.blockPatterns];
35
39
  };
36
40
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["checkAllowList","list","item","defaultResult","Array","isArray","includes","checkAllowListRecursive","blocks","allowedBlockTypes","blocksQueue","length","block","shift","isAllowed","name","blockName","innerBlocks","forEach","innerBlock","push","getAllPatternsDependants","state","settings","__experimentalBlockPatterns","__experimentalUserPatternCategories","__experimentalReusableBlocks","__experimentalFetchBlockPatterns","blockPatterns"],"sources":["@wordpress/block-editor/src/store/utils.js"],"sourcesContent":["export const checkAllowList = ( list, item, defaultResult = null ) => {\n\tif ( typeof list === 'boolean' ) {\n\t\treturn list;\n\t}\n\tif ( Array.isArray( list ) ) {\n\t\t// TODO: when there is a canonical way to detect that we are editing a post\n\t\t// the following check should be changed to something like:\n\t\t// if ( list.includes( 'core/post-content' ) && getEditorMode() === 'post-content' && item === null )\n\t\tif ( list.includes( 'core/post-content' ) && item === null ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn list.includes( item );\n\t}\n\treturn defaultResult;\n};\n\nexport const checkAllowListRecursive = ( blocks, allowedBlockTypes ) => {\n\tif ( typeof allowedBlockTypes === 'boolean' ) {\n\t\treturn allowedBlockTypes;\n\t}\n\n\tconst blocksQueue = [ ...blocks ];\n\twhile ( blocksQueue.length > 0 ) {\n\t\tconst block = blocksQueue.shift();\n\n\t\tconst isAllowed = checkAllowList(\n\t\t\tallowedBlockTypes,\n\t\t\tblock.name || block.blockName,\n\t\t\ttrue\n\t\t);\n\t\tif ( ! isAllowed ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tblock.innerBlocks?.forEach( ( innerBlock ) => {\n\t\t\tblocksQueue.push( innerBlock );\n\t\t} );\n\t}\n\n\treturn true;\n};\n\nexport const getAllPatternsDependants = ( state ) => {\n\treturn [\n\t\tstate.settings.__experimentalBlockPatterns,\n\t\tstate.settings.__experimentalUserPatternCategories,\n\t\tstate.settings.__experimentalReusableBlocks,\n\t\tstate.settings.__experimentalFetchBlockPatterns,\n\t\tstate.blockPatterns,\n\t];\n};\n"],"mappings":"AAAA,OAAO,MAAMA,cAAc,GAAGA,CAAEC,IAAI,EAAEC,IAAI,EAAEC,aAAa,GAAG,IAAI,KAAM;EACrE,IAAK,OAAOF,IAAI,KAAK,SAAS,EAAG;IAChC,OAAOA,IAAI;EACZ;EACA,IAAKG,KAAK,CAACC,OAAO,CAAEJ,IAAK,CAAC,EAAG;IAC5B;IACA;IACA;IACA,IAAKA,IAAI,CAACK,QAAQ,CAAE,mBAAoB,CAAC,IAAIJ,IAAI,KAAK,IAAI,EAAG;MAC5D,OAAO,IAAI;IACZ;IACA,OAAOD,IAAI,CAACK,QAAQ,CAAEJ,IAAK,CAAC;EAC7B;EACA,OAAOC,aAAa;AACrB,CAAC;AAED,OAAO,MAAMI,uBAAuB,GAAGA,CAAEC,MAAM,EAAEC,iBAAiB,KAAM;EACvE,IAAK,OAAOA,iBAAiB,KAAK,SAAS,EAAG;IAC7C,OAAOA,iBAAiB;EACzB;EAEA,MAAMC,WAAW,GAAG,CAAE,GAAGF,MAAM,CAAE;EACjC,OAAQE,WAAW,CAACC,MAAM,GAAG,CAAC,EAAG;IAChC,MAAMC,KAAK,GAAGF,WAAW,CAACG,KAAK,CAAC,CAAC;IAEjC,MAAMC,SAAS,GAAGd,cAAc,CAC/BS,iBAAiB,EACjBG,KAAK,CAACG,IAAI,IAAIH,KAAK,CAACI,SAAS,EAC7B,IACD,CAAC;IACD,IAAK,CAAEF,SAAS,EAAG;MAClB,OAAO,KAAK;IACb;IAEAF,KAAK,CAACK,WAAW,EAAEC,OAAO,CAAIC,UAAU,IAAM;MAC7CT,WAAW,CAACU,IAAI,CAAED,UAAW,CAAC;IAC/B,CAAE,CAAC;EACJ;EAEA,OAAO,IAAI;AACZ,CAAC;AAED,OAAO,MAAME,wBAAwB,GAAKC,KAAK,IAAM;EACpD,OAAO,CACNA,KAAK,CAACC,QAAQ,CAACC,2BAA2B,EAC1CF,KAAK,CAACC,QAAQ,CAACE,mCAAmC,EAClDH,KAAK,CAACC,QAAQ,CAACG,4BAA4B,EAC3CJ,KAAK,CAACC,QAAQ,CAACI,gCAAgC,EAC/CL,KAAK,CAACM,aAAa,CACnB;AACF,CAAC"}
1
+ {"version":3,"names":["selectBlockPatternsKey","checkAllowList","list","item","defaultResult","Array","isArray","includes","checkAllowListRecursive","blocks","allowedBlockTypes","blocksQueue","length","block","shift","isAllowed","name","blockName","innerBlocks","forEach","innerBlock","push","getAllPatternsDependants","select","state","settings","__experimentalBlockPatterns","__experimentalUserPatternCategories","__experimentalReusableBlocks","blockPatterns"],"sources":["@wordpress/block-editor/src/store/utils.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { selectBlockPatternsKey } from './private-keys';\n\nexport const checkAllowList = ( list, item, defaultResult = null ) => {\n\tif ( typeof list === 'boolean' ) {\n\t\treturn list;\n\t}\n\tif ( Array.isArray( list ) ) {\n\t\t// TODO: when there is a canonical way to detect that we are editing a post\n\t\t// the following check should be changed to something like:\n\t\t// if ( list.includes( 'core/post-content' ) && getEditorMode() === 'post-content' && item === null )\n\t\tif ( list.includes( 'core/post-content' ) && item === null ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn list.includes( item );\n\t}\n\treturn defaultResult;\n};\n\nexport const checkAllowListRecursive = ( blocks, allowedBlockTypes ) => {\n\tif ( typeof allowedBlockTypes === 'boolean' ) {\n\t\treturn allowedBlockTypes;\n\t}\n\n\tconst blocksQueue = [ ...blocks ];\n\twhile ( blocksQueue.length > 0 ) {\n\t\tconst block = blocksQueue.shift();\n\n\t\tconst isAllowed = checkAllowList(\n\t\t\tallowedBlockTypes,\n\t\t\tblock.name || block.blockName,\n\t\t\ttrue\n\t\t);\n\t\tif ( ! isAllowed ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tblock.innerBlocks?.forEach( ( innerBlock ) => {\n\t\t\tblocksQueue.push( innerBlock );\n\t\t} );\n\t}\n\n\treturn true;\n};\n\nexport const getAllPatternsDependants = ( select ) => ( state ) => {\n\treturn [\n\t\tstate.settings.__experimentalBlockPatterns,\n\t\tstate.settings.__experimentalUserPatternCategories,\n\t\tstate.settings.__experimentalReusableBlocks,\n\t\tstate.settings[ selectBlockPatternsKey ]?.( select ),\n\t\tstate.blockPatterns,\n\t];\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,sBAAsB,QAAQ,gBAAgB;AAEvD,OAAO,MAAMC,cAAc,GAAGA,CAAEC,IAAI,EAAEC,IAAI,EAAEC,aAAa,GAAG,IAAI,KAAM;EACrE,IAAK,OAAOF,IAAI,KAAK,SAAS,EAAG;IAChC,OAAOA,IAAI;EACZ;EACA,IAAKG,KAAK,CAACC,OAAO,CAAEJ,IAAK,CAAC,EAAG;IAC5B;IACA;IACA;IACA,IAAKA,IAAI,CAACK,QAAQ,CAAE,mBAAoB,CAAC,IAAIJ,IAAI,KAAK,IAAI,EAAG;MAC5D,OAAO,IAAI;IACZ;IACA,OAAOD,IAAI,CAACK,QAAQ,CAAEJ,IAAK,CAAC;EAC7B;EACA,OAAOC,aAAa;AACrB,CAAC;AAED,OAAO,MAAMI,uBAAuB,GAAGA,CAAEC,MAAM,EAAEC,iBAAiB,KAAM;EACvE,IAAK,OAAOA,iBAAiB,KAAK,SAAS,EAAG;IAC7C,OAAOA,iBAAiB;EACzB;EAEA,MAAMC,WAAW,GAAG,CAAE,GAAGF,MAAM,CAAE;EACjC,OAAQE,WAAW,CAACC,MAAM,GAAG,CAAC,EAAG;IAChC,MAAMC,KAAK,GAAGF,WAAW,CAACG,KAAK,CAAC,CAAC;IAEjC,MAAMC,SAAS,GAAGd,cAAc,CAC/BS,iBAAiB,EACjBG,KAAK,CAACG,IAAI,IAAIH,KAAK,CAACI,SAAS,EAC7B,IACD,CAAC;IACD,IAAK,CAAEF,SAAS,EAAG;MAClB,OAAO,KAAK;IACb;IAEAF,KAAK,CAACK,WAAW,EAAEC,OAAO,CAAIC,UAAU,IAAM;MAC7CT,WAAW,CAACU,IAAI,CAAED,UAAW,CAAC;IAC/B,CAAE,CAAC;EACJ;EAEA,OAAO,IAAI;AACZ,CAAC;AAED,OAAO,MAAME,wBAAwB,GAAKC,MAAM,IAAQC,KAAK,IAAM;EAClE,OAAO,CACNA,KAAK,CAACC,QAAQ,CAACC,2BAA2B,EAC1CF,KAAK,CAACC,QAAQ,CAACE,mCAAmC,EAClDH,KAAK,CAACC,QAAQ,CAACG,4BAA4B,EAC3CJ,KAAK,CAACC,QAAQ,CAAEzB,sBAAsB,CAAE,GAAIuB,MAAO,CAAC,EACpDC,KAAK,CAACK,aAAa,CACnB;AACF,CAAC"}
@@ -1550,6 +1550,17 @@ iframe[name=editor-canvas].has-editor-padding {
1550
1550
  width: 230px;
1551
1551
  }
1552
1552
 
1553
+ .block-editor-global-styles__shadow__list {
1554
+ display: flex;
1555
+ gap: 12px;
1556
+ flex-wrap: wrap;
1557
+ padding-bottom: 8px;
1558
+ }
1559
+
1560
+ .block-editor-global-styles__clear-shadow {
1561
+ text-align: left;
1562
+ }
1563
+
1553
1564
  .block-editor-global-styles-filters-panel__dropdown,
1554
1565
  .block-editor-global-styles__shadow-dropdown {
1555
1566
  display: block;
@@ -1565,21 +1576,27 @@ iframe[name=editor-canvas].has-editor-padding {
1565
1576
  background-color: #f0f0f0;
1566
1577
  }
1567
1578
 
1568
- .block-editor-global-styles__shadow-indicator-wrapper {
1569
- padding: 6px;
1570
- display: flex;
1571
- align-items: center;
1572
- justify-content: center;
1573
- }
1574
-
1575
1579
  .block-editor-global-styles__shadow-indicator {
1576
1580
  color: #2f2f2f;
1577
1581
  border: #e0e0e0 1px solid;
1578
1582
  border-radius: 2px;
1579
1583
  cursor: pointer;
1580
1584
  padding: 0;
1581
- height: 24px;
1582
- width: 24px;
1585
+ height: 26px;
1586
+ width: 26px;
1587
+ box-sizing: border-box;
1588
+ transform: scale(1);
1589
+ transition: transform 0.1s ease;
1590
+ will-change: transform;
1591
+ }
1592
+ .block-editor-global-styles__shadow-indicator:focus {
1593
+ border: 2px solid #757575;
1594
+ }
1595
+ .block-editor-global-styles__shadow-indicator:hover {
1596
+ transform: scale(1.2);
1597
+ }
1598
+ .block-editor-global-styles__shadow-indicator.unset {
1599
+ background: linear-gradient(45deg, transparent 48%, #ddd 48%, #ddd 52%, transparent 52%);
1583
1600
  }
1584
1601
 
1585
1602
  .block-editor-global-styles-advanced-panel__custom-css-input textarea {
@@ -1587,16 +1604,6 @@ iframe[name=editor-canvas].has-editor-padding {
1587
1604
  direction: ltr;
1588
1605
  }
1589
1606
 
1590
- .block-editor-global-styles-advanced-panel__custom-css-validation-wrapper {
1591
- position: absolute;
1592
- bottom: 16px;
1593
- left: 24px;
1594
- }
1595
-
1596
- .block-editor-global-styles-advanced-panel__custom-css-validation-icon {
1597
- fill: #cc1818;
1598
- }
1599
-
1600
1607
  .block-editor-height-control {
1601
1608
  border: 0;
1602
1609
  margin: 0;
@@ -1804,6 +1811,13 @@ iframe[name=editor-canvas].has-editor-padding {
1804
1811
  .show-icon-labels .block-editor-link-control .components-button.has-icon::before {
1805
1812
  content: attr(aria-label);
1806
1813
  }
1814
+ .show-icon-labels .block-editor-link-control .block-editor-link-control__search-item-top {
1815
+ gap: 8px;
1816
+ }
1817
+ .show-icon-labels .block-editor-link-control .block-editor-link-control__search-item-top .components-button.has-icon {
1818
+ min-width: inherit;
1819
+ width: min-content;
1820
+ }
1807
1821
 
1808
1822
  .block-editor-link-control__search-input-wrapper {
1809
1823
  margin-bottom: 8px;
@@ -3135,6 +3149,7 @@ iframe[name=editor-canvas].has-editor-padding {
3135
3149
  text-overflow: ellipsis;
3136
3150
  white-space: nowrap;
3137
3151
  margin-left: 8px;
3152
+ min-width: 150px;
3138
3153
  max-width: 350px;
3139
3154
  }
3140
3155
  .block-editor-url-popover__link-viewer-url.has-invalid-link {
@@ -3179,6 +3194,11 @@ iframe[name=editor-canvas].has-editor-padding {
3179
3194
  .block-editor-hooks__block-hooks .components-toggle-control .components-h-stack .components-h-stack {
3180
3195
  flex-direction: row;
3181
3196
  }
3197
+ .block-editor-hooks__block-hooks .block-editor-hooks__block-hooks-helptext {
3198
+ color: #757575;
3199
+ font-size: 12px;
3200
+ margin-bottom: 16px;
3201
+ }
3182
3202
 
3183
3203
  .block-editor-hooks__background__inspector-media-replace-container {
3184
3204
  position: relative;
@@ -3531,16 +3551,14 @@ iframe[name=editor-canvas].has-editor-padding {
3531
3551
  }
3532
3552
  .show-icon-labels .block-editor-block-mover .block-editor-block-mover__move-button-container {
3533
3553
  width: auto;
3554
+ position: relative;
3534
3555
  }
3535
3556
  @media (min-width: 600px) {
3536
- .show-icon-labels .block-editor-block-mover .block-editor-block-mover__move-button-container {
3537
- position: relative;
3538
- }
3539
- .show-icon-labels .block-editor-block-mover .block-editor-block-mover__move-button-container::before {
3557
+ .show-icon-labels .block-editor-block-mover:not(.is-horizontal) .block-editor-block-mover__move-button-container::before {
3540
3558
  content: "";
3541
3559
  height: 1px;
3542
3560
  width: 100%;
3543
- background: #1e1e1e;
3561
+ background: #e0e0e0;
3544
3562
  position: absolute;
3545
3563
  top: 50%;
3546
3564
  right: 50%;
@@ -3548,6 +3566,11 @@ iframe[name=editor-canvas].has-editor-padding {
3548
3566
  margin-top: -0.5px;
3549
3567
  }
3550
3568
  }
3569
+ @media (min-width: 782px) {
3570
+ .show-icon-labels .block-editor-block-mover:not(.is-horizontal) .block-editor-block-mover__move-button-container::before {
3571
+ background: #1e1e1e;
3572
+ }
3573
+ }
3551
3574
  .show-icon-labels .block-editor-block-mover.is-horizontal .block-editor-block-mover__move-button-container,
3552
3575
  .show-icon-labels .block-editor-block-mover.is-horizontal .block-editor-block-mover-button {
3553
3576
  padding-right: 6px;
@@ -1550,6 +1550,17 @@ iframe[name=editor-canvas].has-editor-padding {
1550
1550
  width: 230px;
1551
1551
  }
1552
1552
 
1553
+ .block-editor-global-styles__shadow__list {
1554
+ display: flex;
1555
+ gap: 12px;
1556
+ flex-wrap: wrap;
1557
+ padding-bottom: 8px;
1558
+ }
1559
+
1560
+ .block-editor-global-styles__clear-shadow {
1561
+ text-align: right;
1562
+ }
1563
+
1553
1564
  .block-editor-global-styles-filters-panel__dropdown,
1554
1565
  .block-editor-global-styles__shadow-dropdown {
1555
1566
  display: block;
@@ -1565,21 +1576,27 @@ iframe[name=editor-canvas].has-editor-padding {
1565
1576
  background-color: #f0f0f0;
1566
1577
  }
1567
1578
 
1568
- .block-editor-global-styles__shadow-indicator-wrapper {
1569
- padding: 6px;
1570
- display: flex;
1571
- align-items: center;
1572
- justify-content: center;
1573
- }
1574
-
1575
1579
  .block-editor-global-styles__shadow-indicator {
1576
1580
  color: #2f2f2f;
1577
1581
  border: #e0e0e0 1px solid;
1578
1582
  border-radius: 2px;
1579
1583
  cursor: pointer;
1580
1584
  padding: 0;
1581
- height: 24px;
1582
- width: 24px;
1585
+ height: 26px;
1586
+ width: 26px;
1587
+ box-sizing: border-box;
1588
+ transform: scale(1);
1589
+ transition: transform 0.1s ease;
1590
+ will-change: transform;
1591
+ }
1592
+ .block-editor-global-styles__shadow-indicator:focus {
1593
+ border: 2px solid #757575;
1594
+ }
1595
+ .block-editor-global-styles__shadow-indicator:hover {
1596
+ transform: scale(1.2);
1597
+ }
1598
+ .block-editor-global-styles__shadow-indicator.unset {
1599
+ background: linear-gradient(-45deg, transparent 48%, #ddd 48%, #ddd 52%, transparent 52%);
1583
1600
  }
1584
1601
 
1585
1602
  .block-editor-global-styles-advanced-panel__custom-css-input textarea {
@@ -1588,16 +1605,6 @@ iframe[name=editor-canvas].has-editor-padding {
1588
1605
  direction: ltr;
1589
1606
  }
1590
1607
 
1591
- .block-editor-global-styles-advanced-panel__custom-css-validation-wrapper {
1592
- position: absolute;
1593
- bottom: 16px;
1594
- right: 24px;
1595
- }
1596
-
1597
- .block-editor-global-styles-advanced-panel__custom-css-validation-icon {
1598
- fill: #cc1818;
1599
- }
1600
-
1601
1608
  .block-editor-height-control {
1602
1609
  border: 0;
1603
1610
  margin: 0;
@@ -1805,6 +1812,13 @@ iframe[name=editor-canvas].has-editor-padding {
1805
1812
  .show-icon-labels .block-editor-link-control .components-button.has-icon::before {
1806
1813
  content: attr(aria-label);
1807
1814
  }
1815
+ .show-icon-labels .block-editor-link-control .block-editor-link-control__search-item-top {
1816
+ gap: 8px;
1817
+ }
1818
+ .show-icon-labels .block-editor-link-control .block-editor-link-control__search-item-top .components-button.has-icon {
1819
+ min-width: inherit;
1820
+ width: min-content;
1821
+ }
1808
1822
 
1809
1823
  .block-editor-link-control__search-input-wrapper {
1810
1824
  margin-bottom: 8px;
@@ -3136,6 +3150,7 @@ iframe[name=editor-canvas].has-editor-padding {
3136
3150
  text-overflow: ellipsis;
3137
3151
  white-space: nowrap;
3138
3152
  margin-right: 8px;
3153
+ min-width: 150px;
3139
3154
  max-width: 350px;
3140
3155
  }
3141
3156
  .block-editor-url-popover__link-viewer-url.has-invalid-link {
@@ -3180,6 +3195,11 @@ iframe[name=editor-canvas].has-editor-padding {
3180
3195
  .block-editor-hooks__block-hooks .components-toggle-control .components-h-stack .components-h-stack {
3181
3196
  flex-direction: row;
3182
3197
  }
3198
+ .block-editor-hooks__block-hooks .block-editor-hooks__block-hooks-helptext {
3199
+ color: #757575;
3200
+ font-size: 12px;
3201
+ margin-bottom: 16px;
3202
+ }
3183
3203
 
3184
3204
  .block-editor-hooks__background__inspector-media-replace-container {
3185
3205
  position: relative;
@@ -3532,16 +3552,14 @@ iframe[name=editor-canvas].has-editor-padding {
3532
3552
  }
3533
3553
  .show-icon-labels .block-editor-block-mover .block-editor-block-mover__move-button-container {
3534
3554
  width: auto;
3555
+ position: relative;
3535
3556
  }
3536
3557
  @media (min-width: 600px) {
3537
- .show-icon-labels .block-editor-block-mover .block-editor-block-mover__move-button-container {
3538
- position: relative;
3539
- }
3540
- .show-icon-labels .block-editor-block-mover .block-editor-block-mover__move-button-container::before {
3558
+ .show-icon-labels .block-editor-block-mover:not(.is-horizontal) .block-editor-block-mover__move-button-container::before {
3541
3559
  content: "";
3542
3560
  height: 1px;
3543
3561
  width: 100%;
3544
- background: #1e1e1e;
3562
+ background: #e0e0e0;
3545
3563
  position: absolute;
3546
3564
  top: 50%;
3547
3565
  left: 50%;
@@ -3549,6 +3567,11 @@ iframe[name=editor-canvas].has-editor-padding {
3549
3567
  margin-top: -0.5px;
3550
3568
  }
3551
3569
  }
3570
+ @media (min-width: 782px) {
3571
+ .show-icon-labels .block-editor-block-mover:not(.is-horizontal) .block-editor-block-mover__move-button-container::before {
3572
+ background: #1e1e1e;
3573
+ }
3574
+ }
3552
3575
  .show-icon-labels .block-editor-block-mover.is-horizontal .block-editor-block-mover__move-button-container,
3553
3576
  .show-icon-labels .block-editor-block-mover.is-horizontal .block-editor-block-mover-button {
3554
3577
  padding-left: 6px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-editor",
3
- "version": "12.19.2",
3
+ "version": "12.19.4",
4
4
  "description": "Generic block editor.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -38,9 +38,9 @@
38
38
  "@wordpress/a11y": "^3.51.1",
39
39
  "@wordpress/api-fetch": "^6.48.1",
40
40
  "@wordpress/blob": "^3.51.1",
41
- "@wordpress/blocks": "^12.28.2",
42
- "@wordpress/commands": "^0.22.2",
43
- "@wordpress/components": "^26.0.2",
41
+ "@wordpress/blocks": "^12.28.4",
42
+ "@wordpress/commands": "^0.22.3",
43
+ "@wordpress/components": "^26.0.3",
44
44
  "@wordpress/compose": "^6.28.1",
45
45
  "@wordpress/data": "^9.21.1",
46
46
  "@wordpress/date": "^4.51.1",
@@ -51,12 +51,12 @@
51
51
  "@wordpress/hooks": "^3.51.1",
52
52
  "@wordpress/html-entities": "^3.51.1",
53
53
  "@wordpress/i18n": "^4.51.1",
54
- "@wordpress/icons": "^9.42.1",
54
+ "@wordpress/icons": "^9.42.2",
55
55
  "@wordpress/is-shallow-equal": "^4.51.1",
56
56
  "@wordpress/keyboard-shortcuts": "^4.28.1",
57
57
  "@wordpress/keycodes": "^3.51.1",
58
58
  "@wordpress/notices": "^4.19.1",
59
- "@wordpress/preferences": "^3.28.2",
59
+ "@wordpress/preferences": "^3.28.3",
60
60
  "@wordpress/private-apis": "^0.33.1",
61
61
  "@wordpress/rich-text": "^6.28.2",
62
62
  "@wordpress/style-engine": "^1.34.1",
@@ -87,5 +87,5 @@
87
87
  "publishConfig": {
88
88
  "access": "public"
89
89
  },
90
- "gitHead": "730beb7fd33d3382d6032c3f33e451625a0fcf36"
90
+ "gitHead": "864c1c553cb284def3bd5c907998da45f5c143ea"
91
91
  }
@@ -6,6 +6,7 @@ import { createContext, useContext } from '@wordpress/element';
6
6
  export const mayDisplayControlsKey = Symbol( 'mayDisplayControls' );
7
7
  export const mayDisplayParentControlsKey = Symbol( 'mayDisplayParentControls' );
8
8
  export const blockEditingModeKey = Symbol( 'blockEditingMode' );
9
+ export const blockBindingsKey = Symbol( 'blockBindings' );
9
10
 
10
11
  export const DEFAULT_BLOCK_EDIT_CONTEXT = {
11
12
  name: '',
@@ -14,6 +14,7 @@ import {
14
14
  mayDisplayControlsKey,
15
15
  mayDisplayParentControlsKey,
16
16
  blockEditingModeKey,
17
+ blockBindingsKey,
17
18
  } from './context';
18
19
 
19
20
  /**
@@ -41,7 +42,8 @@ export default function BlockEdit( {
41
42
  attributes = {},
42
43
  __unstableLayoutClassNames,
43
44
  } = props;
44
- const { layout = null } = attributes;
45
+ const { layout = null, metadata = {} } = attributes;
46
+ const { bindings } = metadata;
45
47
  const layoutSupport =
46
48
  hasBlockSupport( name, 'layout', false ) ||
47
49
  hasBlockSupport( name, '__experimentalLayout', false );
@@ -62,6 +64,7 @@ export default function BlockEdit( {
62
64
  [ mayDisplayControlsKey ]: mayDisplayControls,
63
65
  [ mayDisplayParentControlsKey ]: mayDisplayParentControls,
64
66
  [ blockEditingModeKey ]: blockEditingMode,
67
+ [ blockBindingsKey ]: bindings,
65
68
  } ),
66
69
  [
67
70
  name,
@@ -73,6 +76,7 @@ export default function BlockEdit( {
73
76
  mayDisplayControls,
74
77
  mayDisplayParentControls,
75
78
  blockEditingMode,
79
+ bindings,
76
80
  ]
77
81
  ) }
78
82
  >
@@ -30,7 +30,7 @@ import PositionControls from '../inspector-controls-tabs/position-controls-panel
30
30
  import useBlockInspectorAnimationSettings from './useBlockInspectorAnimationSettings';
31
31
  import BlockInfo from '../block-info-slot-fill';
32
32
  import BlockQuickNavigation from '../block-quick-navigation';
33
- import { getBorderPanelLabel } from '../../hooks/border';
33
+ import { useBorderPanelLabel } from '../../hooks/border';
34
34
 
35
35
  function BlockInspectorLockedBlocks( { topLevelLockedBlock } ) {
36
36
  const contentClientIds = useSelect(
@@ -116,6 +116,10 @@ const BlockInspector = ( { showNoBlockSelectedMessage = true } ) => {
116
116
  selectedBlockClientId
117
117
  );
118
118
 
119
+ const borderPanelLabel = useBorderPanelLabel( {
120
+ blockName: selectedBlockName,
121
+ } );
122
+
119
123
  if ( count > 1 ) {
120
124
  return (
121
125
  <div className="block-editor-block-inspector">
@@ -140,9 +144,7 @@ const BlockInspector = ( { showNoBlockSelectedMessage = true } ) => {
140
144
  />
141
145
  <InspectorControls.Slot
142
146
  group="border"
143
- label={ getBorderPanelLabel( {
144
- blockName: selectedBlockName,
145
- } ) }
147
+ label={ borderPanelLabel }
146
148
  />
147
149
  <InspectorControls.Slot group="styles" />
148
150
  </>
@@ -251,7 +253,7 @@ const BlockInspectorSingleBlock = ( { clientId, blockName } ) => {
251
253
  [ blockName ]
252
254
  );
253
255
  const blockInformation = useBlockDisplayInformation( clientId );
254
- const borderPanelLabel = getBorderPanelLabel( { blockName } );
256
+ const borderPanelLabel = useBorderPanelLabel( { blockName } );
255
257
 
256
258
  return (
257
259
  <div className="block-editor-block-inspector">
@@ -54,7 +54,11 @@ export function BlockPreview( {
54
54
  []
55
55
  );
56
56
  const settings = useMemo(
57
- () => ( { ...originalSettings, __unstableIsPreviewMode: true } ),
57
+ () => ( {
58
+ ...originalSettings,
59
+ focusMode: false, // Disable "Spotlight mode".
60
+ __unstableIsPreviewMode: true,
61
+ } ),
58
62
  [ originalSettings ]
59
63
  );
60
64
  const renderedBlocks = useMemo(
@@ -117,6 +121,7 @@ export function useBlockPreview( { blocks, props = {}, layout } ) {
117
121
  () => ( {
118
122
  ...originalSettings,
119
123
  styles: undefined, // Clear styles included by the parent settings, as they are already output by the parent's EditorStyles.
124
+ focusMode: false, // Disable "Spotlight mode".
120
125
  __unstableIsPreviewMode: true,
121
126
  } ),
122
127
  [ originalSettings ]
@@ -207,17 +207,18 @@
207
207
  }
208
208
  }
209
209
 
210
- .block-editor-block-mover .block-editor-block-mover__move-button-container {
211
- width: auto;
212
-
213
- @include break-small() {
210
+ .block-editor-block-mover {
211
+ .block-editor-block-mover__move-button-container {
212
+ width: auto;
214
213
  position: relative;
214
+ }
215
215
 
216
- &::before {
216
+ &:not(.is-horizontal) .block-editor-block-mover__move-button-container::before {
217
+ @include break-small() {
217
218
  content: "";
218
219
  height: $border-width;
219
220
  width: 100%;
220
- background: $gray-900;
221
+ background: $gray-200;
221
222
  position: absolute;
222
223
  top: 50%;
223
224
  left: 50%;
@@ -226,6 +227,10 @@
226
227
  transform: translate(-50%, 0);
227
228
  margin-top: -$border-width * 0.5;
228
229
  }
230
+
231
+ @include break-medium {
232
+ background: $gray-900;
233
+ }
229
234
  }
230
235
  }
231
236
 
@@ -81,11 +81,16 @@ function InbetweenInsertionPointPopover( {
81
81
  isInserterShown: insertionPoint?.__unstableWithInserter,
82
82
  };
83
83
  }, [] );
84
+ const { getBlockEditingMode } = useSelect( blockEditorStore );
84
85
 
85
86
  const disableMotion = useReducedMotion();
86
87
 
87
88
  function onClick( event ) {
88
- if ( event.target === ref.current && nextClientId ) {
89
+ if (
90
+ event.target === ref.current &&
91
+ nextClientId &&
92
+ getBlockEditingMode( nextClientId ) !== 'disabled'
93
+ ) {
89
94
  selectBlock( nextClientId, -1 );
90
95
  }
91
96
  }
@@ -3,12 +3,11 @@
3
3
  */
4
4
  import {
5
5
  TextareaControl,
6
- Tooltip,
6
+ Notice,
7
7
  __experimentalVStack as VStack,
8
8
  } from '@wordpress/components';
9
9
  import { useState } from '@wordpress/element';
10
10
  import { __ } from '@wordpress/i18n';
11
- import { Icon, info } from '@wordpress/icons';
12
11
 
13
12
  /**
14
13
  * Internal dependencies
@@ -58,6 +57,11 @@ export default function AdvancedPanel( {
58
57
 
59
58
  return (
60
59
  <VStack spacing={ 3 }>
60
+ { cssError && (
61
+ <Notice status="error" onRemove={ () => setCSSError( null ) }>
62
+ { cssError }
63
+ </Notice>
64
+ ) }
61
65
  <TextareaControl
62
66
  label={ __( 'Additional CSS' ) }
63
67
  __nextHasNoMarginBottom
@@ -67,16 +71,6 @@ export default function AdvancedPanel( {
67
71
  className="block-editor-global-styles-advanced-panel__custom-css-input"
68
72
  spellCheck={ false }
69
73
  />
70
- { cssError && (
71
- <Tooltip text={ cssError }>
72
- <div className="block-editor-global-styles-advanced-panel__custom-css-validation-wrapper">
73
- <Icon
74
- icon={ info }
75
- className="block-editor-global-styles-advanced-panel__custom-css-validation-icon"
76
- />
77
- </div>
78
- </Tooltip>
79
- ) }
80
74
  </VStack>
81
75
  );
82
76
  }
@@ -21,23 +21,24 @@ import { useColorsPerOrigin } from './hooks';
21
21
  import { getValueFromVariable, TOOLSPANEL_DROPDOWNMENU_PROPS } from './utils';
22
22
  import { overrideOrigins } from '../../store/get-block-settings';
23
23
  import { setImmutably } from '../../utils/object';
24
- import { getBorderPanelLabel } from '../../hooks/border';
25
- import { ShadowPopover } from './shadow-panel-components';
24
+ import { useBorderPanelLabel } from '../../hooks/border';
25
+ import { ShadowPopover, useShadowPresets } from './shadow-panel-components';
26
26
 
27
- function useHasShadowControl( settings ) {
28
- return !! settings?.shadow;
27
+ export function useHasBorderPanel( settings ) {
28
+ const controls = Object.values( useHasBorderPanelControls( settings ) );
29
+ return controls.some( Boolean );
29
30
  }
30
31
 
31
- export function useHasBorderPanel( settings ) {
32
- const controls = [
33
- useHasBorderColorControl( settings ),
34
- useHasBorderRadiusControl( settings ),
35
- useHasBorderStyleControl( settings ),
36
- useHasBorderWidthControl( settings ),
37
- useHasShadowControl( settings ),
38
- ];
32
+ export function useHasBorderPanelControls( settings ) {
33
+ const controls = {
34
+ hasBorderColor: useHasBorderColorControl( settings ),
35
+ hasBorderRadius: useHasBorderRadiusControl( settings ),
36
+ hasBorderStyle: useHasBorderStyleControl( settings ),
37
+ hasBorderWidth: useHasBorderWidthControl( settings ),
38
+ hasShadow: useHasShadowControl( settings ),
39
+ };
39
40
 
40
- return controls.some( Boolean );
41
+ return controls;
41
42
  }
42
43
 
43
44
  function useHasBorderColorControl( settings ) {
@@ -56,6 +57,11 @@ function useHasBorderWidthControl( settings ) {
56
57
  return settings?.border?.width;
57
58
  }
58
59
 
60
+ function useHasShadowControl( settings ) {
61
+ const shadows = useShadowPresets( settings );
62
+ return !! settings?.shadow && shadows.length > 0;
63
+ }
64
+
59
65
  function BorderToolsPanel( {
60
66
  resetAllFilter,
61
67
  onChange,
@@ -215,14 +221,16 @@ export default function BorderPanel( {
215
221
  const showBorderByDefault =
216
222
  defaultControls?.color || defaultControls?.width;
217
223
 
218
- const label = getBorderPanelLabel( {
224
+ const hasBorderControl =
225
+ showBorderColor ||
226
+ showBorderStyle ||
227
+ showBorderWidth ||
228
+ showBorderRadius;
229
+
230
+ const label = useBorderPanelLabel( {
219
231
  blockName: name,
220
232
  hasShadowControl,
221
- hasBorderControl:
222
- showBorderColor ||
223
- showBorderStyle ||
224
- showBorderWidth ||
225
- showBorderRadius,
233
+ hasBorderControl,
226
234
  } );
227
235
 
228
236
  return (
@@ -280,9 +288,12 @@ export default function BorderPanel( {
280
288
  isShownByDefault={ defaultControls.shadow }
281
289
  panelId={ panelId }
282
290
  >
283
- <BaseControl.VisualLabel as="legend">
284
- { __( 'Shadow' ) }
285
- </BaseControl.VisualLabel>
291
+ { hasBorderControl ? (
292
+ <BaseControl.VisualLabel as="legend">
293
+ { __( 'Shadow' ) }
294
+ </BaseControl.VisualLabel>
295
+ ) : null }
296
+
286
297
  <ItemGroup isBordered isSeparated>
287
298
  <ShadowPopover
288
299
  shadow={ shadow }
@@ -19,7 +19,11 @@ export {
19
19
  default as DimensionsPanel,
20
20
  useHasDimensionsPanel,
21
21
  } from './dimensions-panel';
22
- export { default as BorderPanel, useHasBorderPanel } from './border-panel';
22
+ export {
23
+ default as BorderPanel,
24
+ useHasBorderPanel,
25
+ useHasBorderPanelControls,
26
+ } from './border-panel';
23
27
  export { default as ColorPanel, useHasColorPanel } from './color-panel';
24
28
  export { default as FiltersPanel, useHasFiltersPanel } from './filters-panel';
25
29
  export {