@wordpress/block-editor 14.5.0 → 14.6.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 (431) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +0 -8
  3. package/build/autocompleters/block.js +13 -5
  4. package/build/autocompleters/block.js.map +1 -1
  5. package/build/components/block-canvas/index.js +10 -0
  6. package/build/components/block-canvas/index.js.map +1 -1
  7. package/build/components/block-card/index.js +2 -2
  8. package/build/components/block-card/index.js.map +1 -1
  9. package/build/components/block-full-height-alignment-control/index.js +1 -1
  10. package/build/components/block-full-height-alignment-control/index.js.map +1 -1
  11. package/build/components/block-list/block.js +1 -1
  12. package/build/components/block-list/block.js.map +1 -1
  13. package/build/components/block-list/block.native.js +1 -7
  14. package/build/components/block-list/block.native.js.map +1 -1
  15. package/build/components/block-list/index.js +5 -5
  16. package/build/components/block-list/index.js.map +1 -1
  17. package/build/components/block-list/use-block-props/index.js +1 -2
  18. package/build/components/block-list/use-block-props/index.js.map +1 -1
  19. package/build/components/block-list/use-block-props/use-focus-first-element.js +4 -3
  20. package/build/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
  21. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js +3 -6
  22. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
  23. package/build/components/block-list/use-in-between-inserter.js +1 -1
  24. package/build/components/block-list/use-in-between-inserter.js.map +1 -1
  25. package/build/components/block-patterns-paging/index.js +1 -1
  26. package/build/components/block-patterns-paging/index.js.map +1 -1
  27. package/build/components/block-popover/index.js +2 -45
  28. package/build/components/block-popover/index.js.map +1 -1
  29. package/build/components/block-preview/index.js +2 -2
  30. package/build/components/block-preview/index.js.map +1 -1
  31. package/build/components/block-settings-menu/block-settings-dropdown.js +5 -0
  32. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  33. package/build/components/block-settings-menu/index.js +4 -3
  34. package/build/components/block-settings-menu/index.js.map +1 -1
  35. package/build/components/block-toolbar/change-design.js +122 -0
  36. package/build/components/block-toolbar/change-design.js.map +1 -0
  37. package/build/components/block-toolbar/index.js +19 -7
  38. package/build/components/block-toolbar/index.js.map +1 -1
  39. package/build/components/block-tools/index.js +4 -10
  40. package/build/components/block-tools/index.js.map +1 -1
  41. package/build/components/block-tools/insertion-point.js +4 -3
  42. package/build/components/block-tools/insertion-point.js.map +1 -1
  43. package/build/components/block-tools/use-show-block-tools.js +3 -9
  44. package/build/components/block-tools/use-show-block-tools.js.map +1 -1
  45. package/build/components/block-tools/zoom-out-mode-inserters.js +20 -29
  46. package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  47. package/build/components/block-variation-transforms/index.js +2 -2
  48. package/build/components/block-variation-transforms/index.js.map +1 -1
  49. package/build/components/block-vertical-alignment-control/ui.js +6 -10
  50. package/build/components/block-vertical-alignment-control/ui.js.map +1 -1
  51. package/build/components/border-radius-control/linked-button.js +7 -10
  52. package/build/components/border-radius-control/linked-button.js.map +1 -1
  53. package/build/components/collab/block-comment-icon-slot.js +18 -0
  54. package/build/components/collab/block-comment-icon-slot.js.map +1 -0
  55. package/build/components/collab/block-comment-icon-toolbar-slot.js +18 -0
  56. package/build/components/collab/block-comment-icon-toolbar-slot.js.map +1 -0
  57. package/build/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +7 -1
  58. package/build/components/colors-gradients/use-multiple-origin-colors-and-gradients.js.map +1 -1
  59. package/build/components/convert-to-group-buttons/toolbar.js +4 -4
  60. package/build/components/convert-to-group-buttons/toolbar.js.map +1 -1
  61. package/build/components/global-styles/color-panel.js +1 -4
  62. package/build/components/global-styles/color-panel.js.map +1 -1
  63. package/build/components/global-styles/use-global-styles-context.native.js +6 -0
  64. package/build/components/global-styles/use-global-styles-context.native.js.map +1 -1
  65. package/build/components/iframe/index.js +17 -22
  66. package/build/components/iframe/index.js.map +1 -1
  67. package/build/components/image-size-control/index.js +61 -20
  68. package/build/components/image-size-control/index.js.map +1 -1
  69. package/build/components/inner-blocks/index.js +9 -5
  70. package/build/components/inner-blocks/index.js.map +1 -1
  71. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js +2 -2
  72. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  73. package/build/components/inserter/block-patterns-tab/patterns-filter.js +1 -1
  74. package/build/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
  75. package/build/components/inserter/category-tabs/index.js +15 -2
  76. package/build/components/inserter/category-tabs/index.js.map +1 -1
  77. package/build/components/inserter/menu.js +4 -2
  78. package/build/components/inserter/menu.js.map +1 -1
  79. package/build/components/inserter-button/index.native.js +1 -1
  80. package/build/components/inserter-button/index.native.js.map +1 -1
  81. package/build/components/inspector-controls-tabs/index.js +0 -2
  82. package/build/components/inspector-controls-tabs/index.js.map +1 -1
  83. package/build/components/inspector-controls-tabs/utils.js +3 -6
  84. package/build/components/inspector-controls-tabs/utils.js.map +1 -1
  85. package/build/components/link-control/link-preview.js +12 -9
  86. package/build/components/link-control/link-preview.js.map +1 -1
  87. package/build/components/list-view/appender.js +4 -3
  88. package/build/components/list-view/appender.js.map +1 -1
  89. package/build/components/list-view/branch.js +6 -5
  90. package/build/components/list-view/branch.js.map +1 -1
  91. package/build/components/list-view/index.js +1 -2
  92. package/build/components/list-view/index.js.map +1 -1
  93. package/build/components/provider/index.js +1 -1
  94. package/build/components/provider/index.js.map +1 -1
  95. package/build/components/rich-text/event-listeners/index.js +3 -1
  96. package/build/components/rich-text/event-listeners/index.js.map +1 -1
  97. package/build/components/rich-text/index.native.js +2 -6
  98. package/build/components/rich-text/index.native.js.map +1 -1
  99. package/build/components/spacing-sizes-control/index.js +2 -2
  100. package/build/components/spacing-sizes-control/index.js.map +1 -1
  101. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +3 -3
  102. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  103. package/build/components/spacing-sizes-control/linked-button.js +1 -5
  104. package/build/components/spacing-sizes-control/linked-button.js.map +1 -1
  105. package/build/components/tool-selector/index.js +1 -4
  106. package/build/components/tool-selector/index.js.map +1 -1
  107. package/build/components/url-input/index.js +1 -1
  108. package/build/components/url-input/index.js.map +1 -1
  109. package/build/components/use-block-commands/index.js +1 -1
  110. package/build/components/use-block-commands/index.js.map +1 -1
  111. package/build/components/use-block-drop-zone/index.js +5 -5
  112. package/build/components/use-block-drop-zone/index.js.map +1 -1
  113. package/build/components/use-block-drop-zone/index.native.js +0 -1
  114. package/build/components/use-block-drop-zone/index.native.js.map +1 -1
  115. package/build/components/use-moving-animation/index.js +1 -3
  116. package/build/components/use-moving-animation/index.js.map +1 -1
  117. package/build/components/use-settings/index.js +1 -3
  118. package/build/components/use-settings/index.js.map +1 -1
  119. package/build/components/writing-flow/index.js +5 -3
  120. package/build/components/writing-flow/index.js.map +1 -1
  121. package/build/components/writing-flow/use-tab-nav.js +2 -3
  122. package/build/components/writing-flow/use-tab-nav.js.map +1 -1
  123. package/build/hooks/block-bindings.js +19 -8
  124. package/build/hooks/block-bindings.js.map +1 -1
  125. package/build/hooks/contrast-checker.js +0 -1
  126. package/build/hooks/contrast-checker.js.map +1 -1
  127. package/build/hooks/duotone.js +2 -2
  128. package/build/hooks/duotone.js.map +1 -1
  129. package/build/hooks/style.js +4 -1
  130. package/build/hooks/style.js.map +1 -1
  131. package/build/hooks/use-zoom-out.js +13 -22
  132. package/build/hooks/use-zoom-out.js.map +1 -1
  133. package/build/index.js +0 -7
  134. package/build/index.js.map +1 -1
  135. package/build/private-apis.js +6 -3
  136. package/build/private-apis.js.map +1 -1
  137. package/build/store/actions.js +2 -33
  138. package/build/store/actions.js.map +1 -1
  139. package/build/store/defaults.js +1 -1
  140. package/build/store/defaults.js.map +1 -1
  141. package/build/store/private-actions.js +57 -8
  142. package/build/store/private-actions.js.map +1 -1
  143. package/build/store/private-selectors.js +9 -21
  144. package/build/store/private-selectors.js.map +1 -1
  145. package/build/store/reducer.js +16 -6
  146. package/build/store/reducer.js.map +1 -1
  147. package/build/store/selectors.js +44 -7
  148. package/build/store/selectors.js.map +1 -1
  149. package/build/utils/dom.js +16 -1
  150. package/build/utils/dom.js.map +1 -1
  151. package/build/utils/get-font-styles-and-weights.js +1 -1
  152. package/build/utils/get-font-styles-and-weights.js.map +1 -1
  153. package/build/utils/transform-styles/index.js +4 -3
  154. package/build/utils/transform-styles/index.js.map +1 -1
  155. package/build-module/autocompleters/block.js +14 -6
  156. package/build-module/autocompleters/block.js.map +1 -1
  157. package/build-module/components/block-canvas/index.js +11 -1
  158. package/build-module/components/block-canvas/index.js.map +1 -1
  159. package/build-module/components/block-card/index.js +3 -3
  160. package/build-module/components/block-card/index.js.map +1 -1
  161. package/build-module/components/block-full-height-alignment-control/index.js +1 -1
  162. package/build-module/components/block-full-height-alignment-control/index.js.map +1 -1
  163. package/build-module/components/block-list/block.js +1 -1
  164. package/build-module/components/block-list/block.js.map +1 -1
  165. package/build-module/components/block-list/block.native.js +1 -7
  166. package/build-module/components/block-list/block.native.js.map +1 -1
  167. package/build-module/components/block-list/index.js +5 -5
  168. package/build-module/components/block-list/index.js.map +1 -1
  169. package/build-module/components/block-list/use-block-props/index.js +1 -2
  170. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  171. package/build-module/components/block-list/use-block-props/use-focus-first-element.js +4 -3
  172. package/build-module/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
  173. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js +3 -6
  174. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
  175. package/build-module/components/block-list/use-in-between-inserter.js +1 -1
  176. package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
  177. package/build-module/components/block-patterns-paging/index.js +1 -1
  178. package/build-module/components/block-patterns-paging/index.js.map +1 -1
  179. package/build-module/components/block-popover/index.js +2 -45
  180. package/build-module/components/block-popover/index.js.map +1 -1
  181. package/build-module/components/block-preview/index.js +2 -2
  182. package/build-module/components/block-preview/index.js.map +1 -1
  183. package/build-module/components/block-settings-menu/block-settings-dropdown.js +5 -0
  184. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  185. package/build-module/components/block-settings-menu/index.js +5 -4
  186. package/build-module/components/block-settings-menu/index.js.map +1 -1
  187. package/build-module/components/block-toolbar/change-design.js +114 -0
  188. package/build-module/components/block-toolbar/change-design.js.map +1 -0
  189. package/build-module/components/block-toolbar/index.js +19 -7
  190. package/build-module/components/block-toolbar/index.js.map +1 -1
  191. package/build-module/components/block-tools/index.js +4 -10
  192. package/build-module/components/block-tools/index.js.map +1 -1
  193. package/build-module/components/block-tools/insertion-point.js +4 -3
  194. package/build-module/components/block-tools/insertion-point.js.map +1 -1
  195. package/build-module/components/block-tools/use-show-block-tools.js +3 -9
  196. package/build-module/components/block-tools/use-show-block-tools.js.map +1 -1
  197. package/build-module/components/block-tools/zoom-out-mode-inserters.js +20 -29
  198. package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  199. package/build-module/components/block-variation-transforms/index.js +2 -2
  200. package/build-module/components/block-variation-transforms/index.js.map +1 -1
  201. package/build-module/components/block-vertical-alignment-control/ui.js +6 -10
  202. package/build-module/components/block-vertical-alignment-control/ui.js.map +1 -1
  203. package/build-module/components/border-radius-control/linked-button.js +8 -11
  204. package/build-module/components/border-radius-control/linked-button.js.map +1 -1
  205. package/build-module/components/collab/block-comment-icon-slot.js +11 -0
  206. package/build-module/components/collab/block-comment-icon-slot.js.map +1 -0
  207. package/build-module/components/collab/block-comment-icon-toolbar-slot.js +11 -0
  208. package/build-module/components/collab/block-comment-icon-toolbar-slot.js.map +1 -0
  209. package/build-module/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +7 -1
  210. package/build-module/components/colors-gradients/use-multiple-origin-colors-and-gradients.js.map +1 -1
  211. package/build-module/components/convert-to-group-buttons/toolbar.js +4 -4
  212. package/build-module/components/convert-to-group-buttons/toolbar.js.map +1 -1
  213. package/build-module/components/global-styles/color-panel.js +2 -5
  214. package/build-module/components/global-styles/color-panel.js.map +1 -1
  215. package/build-module/components/global-styles/use-global-styles-context.native.js +6 -0
  216. package/build-module/components/global-styles/use-global-styles-context.native.js.map +1 -1
  217. package/build-module/components/iframe/index.js +17 -22
  218. package/build-module/components/iframe/index.js.map +1 -1
  219. package/build-module/components/image-size-control/index.js +62 -21
  220. package/build-module/components/image-size-control/index.js.map +1 -1
  221. package/build-module/components/inner-blocks/index.js +9 -5
  222. package/build-module/components/inner-blocks/index.js.map +1 -1
  223. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js +2 -2
  224. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  225. package/build-module/components/inserter/block-patterns-tab/patterns-filter.js +1 -1
  226. package/build-module/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
  227. package/build-module/components/inserter/category-tabs/index.js +15 -2
  228. package/build-module/components/inserter/category-tabs/index.js.map +1 -1
  229. package/build-module/components/inserter/menu.js +5 -3
  230. package/build-module/components/inserter/menu.js.map +1 -1
  231. package/build-module/components/inserter-button/index.native.js +1 -1
  232. package/build-module/components/inserter-button/index.native.js.map +1 -1
  233. package/build-module/components/inspector-controls-tabs/index.js +0 -2
  234. package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
  235. package/build-module/components/inspector-controls-tabs/utils.js +3 -6
  236. package/build-module/components/inspector-controls-tabs/utils.js.map +1 -1
  237. package/build-module/components/link-control/link-preview.js +13 -10
  238. package/build-module/components/link-control/link-preview.js.map +1 -1
  239. package/build-module/components/list-view/appender.js +4 -3
  240. package/build-module/components/list-view/appender.js.map +1 -1
  241. package/build-module/components/list-view/branch.js +7 -6
  242. package/build-module/components/list-view/branch.js.map +1 -1
  243. package/build-module/components/list-view/index.js +1 -2
  244. package/build-module/components/list-view/index.js.map +1 -1
  245. package/build-module/components/provider/index.js +1 -1
  246. package/build-module/components/provider/index.js.map +1 -1
  247. package/build-module/components/rich-text/event-listeners/index.js +4 -2
  248. package/build-module/components/rich-text/event-listeners/index.js.map +1 -1
  249. package/build-module/components/rich-text/index.native.js +2 -6
  250. package/build-module/components/rich-text/index.native.js.map +1 -1
  251. package/build-module/components/spacing-sizes-control/index.js +3 -3
  252. package/build-module/components/spacing-sizes-control/index.js.map +1 -1
  253. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +4 -4
  254. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  255. package/build-module/components/spacing-sizes-control/linked-button.js +2 -6
  256. package/build-module/components/spacing-sizes-control/linked-button.js.map +1 -1
  257. package/build-module/components/tool-selector/index.js +1 -4
  258. package/build-module/components/tool-selector/index.js.map +1 -1
  259. package/build-module/components/url-input/index.js +1 -1
  260. package/build-module/components/url-input/index.js.map +1 -1
  261. package/build-module/components/use-block-commands/index.js +1 -1
  262. package/build-module/components/use-block-commands/index.js.map +1 -1
  263. package/build-module/components/use-block-drop-zone/index.js +5 -5
  264. package/build-module/components/use-block-drop-zone/index.js.map +1 -1
  265. package/build-module/components/use-block-drop-zone/index.native.js +0 -1
  266. package/build-module/components/use-block-drop-zone/index.native.js.map +1 -1
  267. package/build-module/components/use-moving-animation/index.js +1 -3
  268. package/build-module/components/use-moving-animation/index.js.map +1 -1
  269. package/build-module/components/use-settings/index.js +1 -3
  270. package/build-module/components/use-settings/index.js.map +1 -1
  271. package/build-module/components/writing-flow/index.js +5 -3
  272. package/build-module/components/writing-flow/index.js.map +1 -1
  273. package/build-module/components/writing-flow/use-tab-nav.js +2 -3
  274. package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
  275. package/build-module/hooks/block-bindings.js +20 -9
  276. package/build-module/hooks/block-bindings.js.map +1 -1
  277. package/build-module/hooks/contrast-checker.js +0 -1
  278. package/build-module/hooks/contrast-checker.js.map +1 -1
  279. package/build-module/hooks/duotone.js +2 -2
  280. package/build-module/hooks/duotone.js.map +1 -1
  281. package/build-module/hooks/style.js +4 -1
  282. package/build-module/hooks/style.js.map +1 -1
  283. package/build-module/hooks/use-zoom-out.js +15 -23
  284. package/build-module/hooks/use-zoom-out.js.map +1 -1
  285. package/build-module/index.js +1 -1
  286. package/build-module/index.js.map +1 -1
  287. package/build-module/private-apis.js +7 -5
  288. package/build-module/private-apis.js.map +1 -1
  289. package/build-module/store/actions.js +2 -33
  290. package/build-module/store/actions.js.map +1 -1
  291. package/build-module/store/defaults.js +1 -1
  292. package/build-module/store/defaults.js.map +1 -1
  293. package/build-module/store/private-actions.js +54 -7
  294. package/build-module/store/private-actions.js.map +1 -1
  295. package/build-module/store/private-selectors.js +9 -20
  296. package/build-module/store/private-selectors.js.map +1 -1
  297. package/build-module/store/reducer.js +16 -6
  298. package/build-module/store/reducer.js.map +1 -1
  299. package/build-module/store/selectors.js +45 -8
  300. package/build-module/store/selectors.js.map +1 -1
  301. package/build-module/utils/dom.js +16 -1
  302. package/build-module/utils/dom.js.map +1 -1
  303. package/build-module/utils/get-font-styles-and-weights.js +2 -2
  304. package/build-module/utils/get-font-styles-and-weights.js.map +1 -1
  305. package/build-module/utils/transform-styles/index.js +3 -2
  306. package/build-module/utils/transform-styles/index.js.map +1 -1
  307. package/build-style/content-rtl.css +9 -4
  308. package/build-style/content.css +9 -4
  309. package/build-style/style-rtl.css +33 -22
  310. package/build-style/style.css +33 -22
  311. package/build-types/utils/dom.d.ts.map +1 -1
  312. package/package.json +33 -32
  313. package/src/autocompleters/block.js +16 -7
  314. package/src/components/block-canvas/index.js +17 -1
  315. package/src/components/block-canvas/style.scss +2 -0
  316. package/src/components/block-card/index.js +3 -3
  317. package/src/components/block-full-height-alignment-control/index.js +1 -1
  318. package/src/components/block-inspector/style.scss +0 -6
  319. package/src/components/block-list/block.js +1 -2
  320. package/src/components/block-list/block.native.js +0 -4
  321. package/src/components/block-list/content.scss +1 -1
  322. package/src/components/block-list/index.js +4 -4
  323. package/src/components/block-list/use-block-props/index.js +0 -2
  324. package/src/components/block-list/use-block-props/use-focus-first-element.js +5 -3
  325. package/src/components/block-list/use-block-props/use-selected-block-event-handlers.js +7 -20
  326. package/src/components/block-list/use-in-between-inserter.js +1 -1
  327. package/src/components/block-patterns-list/stories/fixtures.js +834 -0
  328. package/src/components/block-patterns-list/stories/index.story.js +81 -0
  329. package/src/components/block-patterns-list/style.scss +2 -0
  330. package/src/components/block-patterns-paging/index.js +1 -1
  331. package/src/components/block-popover/index.js +0 -62
  332. package/src/components/block-preview/index.js +2 -2
  333. package/src/components/block-settings-menu/block-settings-dropdown.js +4 -0
  334. package/src/components/block-settings-menu/index.js +3 -0
  335. package/src/components/block-toolbar/change-design.js +133 -0
  336. package/src/components/block-toolbar/index.js +25 -8
  337. package/src/components/block-toolbar/style.scss +16 -0
  338. package/src/components/block-tools/index.js +4 -17
  339. package/src/components/block-tools/insertion-point.js +4 -3
  340. package/src/components/block-tools/style.scss +0 -20
  341. package/src/components/block-tools/use-show-block-tools.js +0 -13
  342. package/src/components/block-tools/zoom-out-mode-inserters.js +25 -40
  343. package/src/components/block-variation-transforms/index.js +2 -2
  344. package/src/components/block-vertical-alignment-control/ui.js +11 -15
  345. package/src/components/border-radius-control/linked-button.js +9 -11
  346. package/src/components/collab/block-comment-icon-slot.js +12 -0
  347. package/src/components/collab/block-comment-icon-toolbar-slot.js +12 -0
  348. package/src/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +7 -1
  349. package/src/components/convert-to-group-buttons/toolbar.js +4 -4
  350. package/src/components/global-styles/color-panel.js +2 -10
  351. package/src/components/global-styles/test/use-global-styles-context.native.js +1 -0
  352. package/src/components/global-styles/use-global-styles-context.native.js +6 -0
  353. package/src/components/iframe/content.scss +4 -9
  354. package/src/components/iframe/index.js +31 -34
  355. package/src/components/iframe/style.scss +2 -3
  356. package/src/components/image-size-control/index.js +74 -43
  357. package/src/components/image-size-control/test/index.js +5 -63
  358. package/src/components/inner-blocks/index.js +12 -6
  359. package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +2 -3
  360. package/src/components/inserter/block-patterns-tab/patterns-filter.js +1 -1
  361. package/src/components/inserter/category-tabs/index.js +16 -2
  362. package/src/components/inserter/menu.js +6 -4
  363. package/src/components/inserter/style.scss +13 -0
  364. package/src/components/inserter-button/index.native.js +1 -1
  365. package/src/components/inspector-controls-tabs/index.js +1 -6
  366. package/src/components/inspector-controls-tabs/utils.js +0 -3
  367. package/src/components/link-control/link-preview.js +15 -8
  368. package/src/components/link-control/test/index.js +63 -24
  369. package/src/components/list-view/appender.js +5 -6
  370. package/src/components/list-view/branch.js +8 -6
  371. package/src/components/list-view/index.js +1 -2
  372. package/src/components/provider/index.js +1 -3
  373. package/src/components/provider/test/experimental-provider.js +43 -1
  374. package/src/components/rich-text/event-listeners/index.js +4 -2
  375. package/src/components/rich-text/index.native.js +0 -2
  376. package/src/components/spacing-sizes-control/index.js +3 -3
  377. package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +4 -4
  378. package/src/components/spacing-sizes-control/linked-button.js +2 -12
  379. package/src/components/tool-selector/index.js +1 -5
  380. package/src/components/url-input/index.js +1 -1
  381. package/src/components/use-block-commands/index.js +1 -1
  382. package/src/components/use-block-drop-zone/index.js +5 -5
  383. package/src/components/use-block-drop-zone/index.native.js +0 -1
  384. package/src/components/use-moving-animation/index.js +0 -1
  385. package/src/components/use-settings/index.js +0 -1
  386. package/src/components/writing-flow/index.js +5 -3
  387. package/src/components/writing-flow/use-tab-nav.js +1 -2
  388. package/src/hooks/block-bindings.js +48 -31
  389. package/src/hooks/contrast-checker.js +0 -1
  390. package/src/hooks/duotone.js +2 -2
  391. package/src/hooks/style.js +7 -3
  392. package/src/hooks/use-zoom-out.js +14 -34
  393. package/src/index.js +0 -1
  394. package/src/private-apis.js +6 -3
  395. package/src/store/actions.js +3 -52
  396. package/src/store/defaults.js +2 -1
  397. package/src/store/private-actions.js +71 -8
  398. package/src/store/private-selectors.js +9 -19
  399. package/src/store/reducer.js +25 -11
  400. package/src/store/selectors.js +59 -8
  401. package/src/store/test/actions.js +41 -0
  402. package/src/store/test/reducer.js +23 -0
  403. package/src/utils/dom.js +22 -2
  404. package/src/utils/get-font-styles-and-weights.js +2 -2
  405. package/src/utils/transform-styles/index.js +3 -2
  406. package/tsconfig.tsbuildinfo +1 -1
  407. package/build/components/block-list/use-block-props/use-zoom-out-mode-exit.js +0 -57
  408. package/build/components/block-list/use-block-props/use-zoom-out-mode-exit.js.map +0 -1
  409. package/build/components/block-toolbar/shuffle.js +0 -110
  410. package/build/components/block-toolbar/shuffle.js.map +0 -1
  411. package/build/components/block-tools/zoom-out-popover.js +0 -58
  412. package/build/components/block-tools/zoom-out-popover.js.map +0 -1
  413. package/build/components/block-tools/zoom-out-toolbar.js +0 -132
  414. package/build/components/block-tools/zoom-out-toolbar.js.map +0 -1
  415. package/build/components/block-vertical-alignment-control/icons.js +0 -48
  416. package/build/components/block-vertical-alignment-control/icons.js.map +0 -1
  417. package/build-module/components/block-list/use-block-props/use-zoom-out-mode-exit.js +0 -51
  418. package/build-module/components/block-list/use-block-props/use-zoom-out-mode-exit.js.map +0 -1
  419. package/build-module/components/block-toolbar/shuffle.js +0 -103
  420. package/build-module/components/block-toolbar/shuffle.js.map +0 -1
  421. package/build-module/components/block-tools/zoom-out-popover.js +0 -49
  422. package/build-module/components/block-tools/zoom-out-popover.js.map +0 -1
  423. package/build-module/components/block-tools/zoom-out-toolbar.js +0 -124
  424. package/build-module/components/block-tools/zoom-out-toolbar.js.map +0 -1
  425. package/build-module/components/block-vertical-alignment-control/icons.js +0 -41
  426. package/build-module/components/block-vertical-alignment-control/icons.js.map +0 -1
  427. package/src/components/block-list/use-block-props/use-zoom-out-mode-exit.js +0 -65
  428. package/src/components/block-toolbar/shuffle.js +0 -111
  429. package/src/components/block-tools/zoom-out-popover.js +0 -47
  430. package/src/components/block-tools/zoom-out-toolbar.js +0 -135
  431. package/src/components/block-vertical-alignment-control/icons.js +0 -34
@@ -103,6 +103,17 @@ function isElementVisible(element) {
103
103
  return true;
104
104
  }
105
105
 
106
+ /**
107
+ * Checks if the element is scrollable.
108
+ *
109
+ * @param {Element} element Element.
110
+ * @return {boolean} True if the element is scrollable.
111
+ */
112
+ function isScrollable(element) {
113
+ const style = window.getComputedStyle(element);
114
+ return style.overflowX === 'auto' || style.overflowX === 'scroll' || style.overflowY === 'auto' || style.overflowY === 'scroll';
115
+ }
116
+
106
117
  /**
107
118
  * Returns the rect of the element including all visible nested elements.
108
119
  *
@@ -130,7 +141,11 @@ export function getVisibleElementBounds(element) {
130
141
  while (currentElement = stack.pop()) {
131
142
  for (const child of currentElement.children) {
132
143
  if (isElementVisible(child)) {
133
- const childBounds = child.getBoundingClientRect();
144
+ let childBounds = child.getBoundingClientRect();
145
+ // If the parent is scrollable, use parent's scrollable bounds.
146
+ if (isScrollable(currentElement)) {
147
+ childBounds = currentElement.getBoundingClientRect();
148
+ }
134
149
  bounds = rectUnion(bounds, childBounds);
135
150
  stack.push(child);
136
151
  }
@@ -1 +1 @@
1
- {"version":3,"names":["BLOCK_SELECTOR","APPENDER_SELECTOR","BLOCK_APPENDER_CLASS","isInSameBlock","a","b","closest","isInsideRootBlock","blockElement","element","parentBlock","join","getBlockClientId","node","nodeType","ELEMENT_NODE","parentNode","elementNode","blockNode","id","slice","length","rectUnion","rect1","rect2","left","Math","min","right","max","bottom","top","window","DOMRectReadOnly","isElementVisible","viewport","ownerDocument","defaultView","classList","contains","bounds","getBoundingClientRect","width","height","checkVisibility","opacityProperty","contentVisibilityAuto","visibilityProperty","style","getComputedStyle","display","visibility","opacity","getVisibleElementBounds","stack","currentElement","pop","child","children","childBounds","push","innerWidth"],"sources":["@wordpress/block-editor/src/utils/dom.js"],"sourcesContent":["const BLOCK_SELECTOR = '.block-editor-block-list__block';\nconst APPENDER_SELECTOR = '.block-list-appender';\nconst BLOCK_APPENDER_CLASS = '.block-editor-button-block-appender';\n\n/**\n * Returns true if two elements are contained within the same block.\n *\n * @param {Element} a First element.\n * @param {Element} b Second element.\n *\n * @return {boolean} Whether elements are in the same block.\n */\nexport function isInSameBlock( a, b ) {\n\treturn a.closest( BLOCK_SELECTOR ) === b.closest( BLOCK_SELECTOR );\n}\n\n/**\n * Returns true if an element is considered part of the block and not its inner\n * blocks or appender.\n *\n * @param {Element} blockElement Block container element.\n * @param {Element} element Element.\n *\n * @return {boolean} Whether an element is considered part of the block and not\n * its inner blocks or appender.\n */\nexport function isInsideRootBlock( blockElement, element ) {\n\tconst parentBlock = element.closest(\n\t\t[ BLOCK_SELECTOR, APPENDER_SELECTOR, BLOCK_APPENDER_CLASS ].join( ',' )\n\t);\n\treturn parentBlock === blockElement;\n}\n\n/**\n * Finds the block client ID given any DOM node inside the block.\n *\n * @param {Node?} node DOM node.\n *\n * @return {string|undefined} Client ID or undefined if the node is not part of\n * a block.\n */\nexport function getBlockClientId( node ) {\n\twhile ( node && node.nodeType !== node.ELEMENT_NODE ) {\n\t\tnode = node.parentNode;\n\t}\n\n\tif ( ! node ) {\n\t\treturn;\n\t}\n\n\tconst elementNode = /** @type {Element} */ ( node );\n\tconst blockNode = elementNode.closest( BLOCK_SELECTOR );\n\n\tif ( ! blockNode ) {\n\t\treturn;\n\t}\n\n\treturn blockNode.id.slice( 'block-'.length );\n}\n\n/**\n * Calculates the union of two rectangles.\n *\n * @param {DOMRect} rect1 First rectangle.\n * @param {DOMRect} rect2 Second rectangle.\n * @return {DOMRect} Union of the two rectangles.\n */\nexport function rectUnion( rect1, rect2 ) {\n\tconst left = Math.min( rect1.left, rect2.left );\n\tconst right = Math.max( rect1.right, rect2.right );\n\tconst bottom = Math.max( rect1.bottom, rect2.bottom );\n\tconst top = Math.min( rect1.top, rect2.top );\n\n\treturn new window.DOMRectReadOnly( left, top, right - left, bottom - top );\n}\n\n/**\n * Returns whether an element is visible.\n *\n * @param {Element} element Element.\n * @return {boolean} Whether the element is visible.\n */\nfunction isElementVisible( element ) {\n\tconst viewport = element.ownerDocument.defaultView;\n\tif ( ! viewport ) {\n\t\treturn false;\n\t}\n\n\t// Check for <VisuallyHidden> component.\n\tif ( element.classList.contains( 'components-visually-hidden' ) ) {\n\t\treturn false;\n\t}\n\n\tconst bounds = element.getBoundingClientRect();\n\tif ( bounds.width === 0 || bounds.height === 0 ) {\n\t\treturn false;\n\t}\n\n\t// Older browsers, e.g. Safari < 17.4 may not support the `checkVisibility` method.\n\tif ( element.checkVisibility ) {\n\t\treturn element.checkVisibility?.( {\n\t\t\topacityProperty: true,\n\t\t\tcontentVisibilityAuto: true,\n\t\t\tvisibilityProperty: true,\n\t\t} );\n\t}\n\n\tconst style = viewport.getComputedStyle( element );\n\n\tif (\n\t\tstyle.display === 'none' ||\n\t\tstyle.visibility === 'hidden' ||\n\t\tstyle.opacity === '0'\n\t) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n\n/**\n * Returns the rect of the element including all visible nested elements.\n *\n * Visible nested elements, including elements that overflow the parent, are\n * taken into account.\n *\n * This function is useful for calculating the visible area of a block that\n * contains nested elements that overflow the block, e.g. the Navigation block,\n * which can contain overflowing Submenu blocks.\n *\n * The returned rect represents the full extent of the element and its visible\n * children, which may extend beyond the viewport.\n *\n * @param {Element} element Element.\n * @return {DOMRect} Bounding client rect of the element and its visible children.\n */\nexport function getVisibleElementBounds( element ) {\n\tconst viewport = element.ownerDocument.defaultView;\n\tif ( ! viewport ) {\n\t\treturn new window.DOMRectReadOnly();\n\t}\n\n\tlet bounds = element.getBoundingClientRect();\n\n\tconst stack = [ element ];\n\tlet currentElement;\n\n\twhile ( ( currentElement = stack.pop() ) ) {\n\t\tfor ( const child of currentElement.children ) {\n\t\t\tif ( isElementVisible( child ) ) {\n\t\t\t\tconst childBounds = child.getBoundingClientRect();\n\t\t\t\tbounds = rectUnion( bounds, childBounds );\n\t\t\t\tstack.push( child );\n\t\t\t}\n\t\t}\n\t}\n\n\t/*\n\t * Take into account the outer horizontal limits of the container in which\n\t * an element is supposed to be \"visible\". For example, if an element is\n\t * positioned -10px to the left of the window x value (0), this function\n\t * discounts the negative overhang because it's not visible and therefore\n\t * not to be counted in the visibility calculations. Top and bottom values\n\t * are not accounted for to accommodate vertical scroll.\n\t */\n\tconst left = Math.max( bounds.left, 0 );\n\tconst right = Math.min( bounds.right, viewport.innerWidth );\n\tbounds = new window.DOMRectReadOnly(\n\t\tleft,\n\t\tbounds.top,\n\t\tright - left,\n\t\tbounds.height\n\t);\n\n\treturn bounds;\n}\n"],"mappings":"AAAA,MAAMA,cAAc,GAAG,iCAAiC;AACxD,MAAMC,iBAAiB,GAAG,sBAAsB;AAChD,MAAMC,oBAAoB,GAAG,qCAAqC;;AAElE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,aAAaA,CAAEC,CAAC,EAAEC,CAAC,EAAG;EACrC,OAAOD,CAAC,CAACE,OAAO,CAAEN,cAAe,CAAC,KAAKK,CAAC,CAACC,OAAO,CAAEN,cAAe,CAAC;AACnE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASO,iBAAiBA,CAAEC,YAAY,EAAEC,OAAO,EAAG;EAC1D,MAAMC,WAAW,GAAGD,OAAO,CAACH,OAAO,CAClC,CAAEN,cAAc,EAAEC,iBAAiB,EAAEC,oBAAoB,CAAE,CAACS,IAAI,CAAE,GAAI,CACvE,CAAC;EACD,OAAOD,WAAW,KAAKF,YAAY;AACpC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASI,gBAAgBA,CAAEC,IAAI,EAAG;EACxC,OAAQA,IAAI,IAAIA,IAAI,CAACC,QAAQ,KAAKD,IAAI,CAACE,YAAY,EAAG;IACrDF,IAAI,GAAGA,IAAI,CAACG,UAAU;EACvB;EAEA,IAAK,CAAEH,IAAI,EAAG;IACb;EACD;EAEA,MAAMI,WAAW,GAAG,sBAAyBJ,IAAM;EACnD,MAAMK,SAAS,GAAGD,WAAW,CAACX,OAAO,CAAEN,cAAe,CAAC;EAEvD,IAAK,CAAEkB,SAAS,EAAG;IAClB;EACD;EAEA,OAAOA,SAAS,CAACC,EAAE,CAACC,KAAK,CAAE,Q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AGF,IAAI,CAACC,GAAG,CAAEa,MAAM,CAACZ,KAAK,EAAEO,QAAQ,CAAC0B,UAAW,CAAC;EAC3DrB,MAAM,GAAG,IAAIR,MAAM,CAACC,eAAe,CAClCR,IAAI,EACJe,MAAM,CAACT,GAAG,EACVH,KAAK,GAAGH,IAAI,EACZe,MAAM,CAACG,MACR,CAAC;EAED,OAAOH,MAAM;AACd","ignoreList":[]}
1
+ {"version":3,"names":["BLOCK_SELECTOR","APPENDER_SELECTOR","BLOCK_APPENDER_CLASS","isInSameBlock","a","b","closest","isInsideRootBlock","blockElement","element","parentBlock","join","getBlockClientId","node","nodeType","ELEMENT_NODE","parentNode","elementNode","blockNode","id","slice","length","rectUnion","rect1","rect2","left","Math","min","right","max","bottom","top","window","DOMRectReadOnly","isElementVisible","viewport","ownerDocument","defaultView","classList","contains","bounds","getBoundingClientRect","width","height","checkVisibility","opacityProperty","contentVisibilityAuto","visibilityProperty","style","getComputedStyle","display","visibility","opacity","isScrollable","overflowX","overflowY","getVisibleElementBounds","stack","currentElement","pop","child","children","childBounds","push","innerWidth"],"sources":["@wordpress/block-editor/src/utils/dom.js"],"sourcesContent":["const BLOCK_SELECTOR = '.block-editor-block-list__block';\nconst APPENDER_SELECTOR = '.block-list-appender';\nconst BLOCK_APPENDER_CLASS = '.block-editor-button-block-appender';\n\n/**\n * Returns true if two elements are contained within the same block.\n *\n * @param {Element} a First element.\n * @param {Element} b Second element.\n *\n * @return {boolean} Whether elements are in the same block.\n */\nexport function isInSameBlock( a, b ) {\n\treturn a.closest( BLOCK_SELECTOR ) === b.closest( BLOCK_SELECTOR );\n}\n\n/**\n * Returns true if an element is considered part of the block and not its inner\n * blocks or appender.\n *\n * @param {Element} blockElement Block container element.\n * @param {Element} element Element.\n *\n * @return {boolean} Whether an element is considered part of the block and not\n * its inner blocks or appender.\n */\nexport function isInsideRootBlock( blockElement, element ) {\n\tconst parentBlock = element.closest(\n\t\t[ BLOCK_SELECTOR, APPENDER_SELECTOR, BLOCK_APPENDER_CLASS ].join( ',' )\n\t);\n\treturn parentBlock === blockElement;\n}\n\n/**\n * Finds the block client ID given any DOM node inside the block.\n *\n * @param {Node?} node DOM node.\n *\n * @return {string|undefined} Client ID or undefined if the node is not part of\n * a block.\n */\nexport function getBlockClientId( node ) {\n\twhile ( node && node.nodeType !== node.ELEMENT_NODE ) {\n\t\tnode = node.parentNode;\n\t}\n\n\tif ( ! node ) {\n\t\treturn;\n\t}\n\n\tconst elementNode = /** @type {Element} */ ( node );\n\tconst blockNode = elementNode.closest( BLOCK_SELECTOR );\n\n\tif ( ! blockNode ) {\n\t\treturn;\n\t}\n\n\treturn blockNode.id.slice( 'block-'.length );\n}\n\n/**\n * Calculates the union of two rectangles.\n *\n * @param {DOMRect} rect1 First rectangle.\n * @param {DOMRect} rect2 Second rectangle.\n * @return {DOMRect} Union of the two rectangles.\n */\nexport function rectUnion( rect1, rect2 ) {\n\tconst left = Math.min( rect1.left, rect2.left );\n\tconst right = Math.max( rect1.right, rect2.right );\n\tconst bottom = Math.max( rect1.bottom, rect2.bottom );\n\tconst top = Math.min( rect1.top, rect2.top );\n\n\treturn new window.DOMRectReadOnly( left, top, right - left, bottom - top );\n}\n\n/**\n * Returns whether an element is visible.\n *\n * @param {Element} element Element.\n * @return {boolean} Whether the element is visible.\n */\nfunction isElementVisible( element ) {\n\tconst viewport = element.ownerDocument.defaultView;\n\tif ( ! viewport ) {\n\t\treturn false;\n\t}\n\n\t// Check for <VisuallyHidden> component.\n\tif ( element.classList.contains( 'components-visually-hidden' ) ) {\n\t\treturn false;\n\t}\n\n\tconst bounds = element.getBoundingClientRect();\n\tif ( bounds.width === 0 || bounds.height === 0 ) {\n\t\treturn false;\n\t}\n\n\t// Older browsers, e.g. Safari < 17.4 may not support the `checkVisibility` method.\n\tif ( element.checkVisibility ) {\n\t\treturn element.checkVisibility?.( {\n\t\t\topacityProperty: true,\n\t\t\tcontentVisibilityAuto: true,\n\t\t\tvisibilityProperty: true,\n\t\t} );\n\t}\n\n\tconst style = viewport.getComputedStyle( element );\n\n\tif (\n\t\tstyle.display === 'none' ||\n\t\tstyle.visibility === 'hidden' ||\n\t\tstyle.opacity === '0'\n\t) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n\n/**\n * Checks if the element is scrollable.\n *\n * @param {Element} element Element.\n * @return {boolean} True if the element is scrollable.\n */\nfunction isScrollable( element ) {\n\tconst style = window.getComputedStyle( element );\n\treturn (\n\t\tstyle.overflowX === 'auto' ||\n\t\tstyle.overflowX === 'scroll' ||\n\t\tstyle.overflowY === 'auto' ||\n\t\tstyle.overflowY === 'scroll'\n\t);\n}\n\n/**\n * Returns the rect of the element including all visible nested elements.\n *\n * Visible nested elements, including elements that overflow the parent, are\n * taken into account.\n *\n * This function is useful for calculating the visible area of a block that\n * contains nested elements that overflow the block, e.g. the Navigation block,\n * which can contain overflowing Submenu blocks.\n *\n * The returned rect represents the full extent of the element and its visible\n * children, which may extend beyond the viewport.\n *\n * @param {Element} element Element.\n * @return {DOMRect} Bounding client rect of the element and its visible children.\n */\nexport function getVisibleElementBounds( element ) {\n\tconst viewport = element.ownerDocument.defaultView;\n\n\tif ( ! viewport ) {\n\t\treturn new window.DOMRectReadOnly();\n\t}\n\n\tlet bounds = element.getBoundingClientRect();\n\tconst stack = [ element ];\n\tlet currentElement;\n\n\twhile ( ( currentElement = stack.pop() ) ) {\n\t\tfor ( const child of currentElement.children ) {\n\t\t\tif ( isElementVisible( child ) ) {\n\t\t\t\tlet childBounds = child.getBoundingClientRect();\n\t\t\t\t// If the parent is scrollable, use parent's scrollable bounds.\n\t\t\t\tif ( isScrollable( currentElement ) ) {\n\t\t\t\t\tchildBounds = currentElement.getBoundingClientRect();\n\t\t\t\t}\n\t\t\t\tbounds = rectUnion( bounds, childBounds );\n\t\t\t\tstack.push( child );\n\t\t\t}\n\t\t}\n\t}\n\n\t/*\n\t * Take into account the outer horizontal limits of the container in which\n\t * an element is supposed to be \"visible\". For example, if an element is\n\t * positioned -10px to the left of the window x value (0), this function\n\t * discounts the negative overhang because it's not visible and therefore\n\t * not to be counted in the visibility calculations. Top and bottom values\n\t * are not accounted for to accommodate vertical scroll.\n\t */\n\tconst left = Math.max( bounds.left, 0 );\n\tconst right = Math.min( bounds.right, viewport.innerWidth );\n\tbounds = new window.DOMRectReadOnly(\n\t\tleft,\n\t\tbounds.top,\n\t\tright - left,\n\t\tbounds.height\n\t);\n\n\treturn bounds;\n}\n"],"mappings":"AAAA,MAAMA,cAAc,GAAG,iCAAiC;AACxD,MAAMC,iBAAiB,GAAG,sBAAsB;AAChD,MAAMC,oBAAoB,GAAG,qCAAqC;;AAElE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,aAAaA,CAAEC,CAAC,EAAEC,CAAC,EAAG;EACrC,OAAOD,CAAC,CAACE,OAAO,CAAEN,cAAe,CAAC,KAAKK,CAAC,CAACC,OAAO,CAAEN,cAAe,CAAC;AACnE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASO,iBAAiBA,CAAEC,YAAY,EAAEC,OAAO,EAAG;EAC1D,MAAMC,WAAW,GAAGD,OAAO,CAACH,OAAO,CAClC,CAAEN,cAAc,EAAEC,iBAAiB,EAAEC,oBAAoB,CAAE,CAACS,IAAI,CAAE,GAAI,CACvE,CAAC;EACD,OAAOD,WAAW,KAAKF,YAAY;AACpC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASI,gBAAgBA,CAAEC,IAAI,EAAG;EACxC,OAAQA,IAAI,IAAIA,IAAI,CAACC,QAAQ,KAAKD,IAAI,CAACE,YAAY,EAAG;IACrDF,IAAI,GAAGA,IAAI,CAACG,UAAU;EACvB;EAEA,IAAK,CAAEH,IAAI,EAAG;IACb;EACD;EAEA,MAAMI,WAAW,GAAG,sBAAyBJ,IAAM;EACnD,MAAMK,SAAS,GAAGD,WAAW,CAACX,OAAO,CAAEN,cAAe,CAAC;EAEvD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ACG,QAAQ,EAAG;MAC9C,IAAK3B,gBAAgB,CAAE0B,KAAM,CAAC,EAAG;QAChC,IAAIE,WAAW,GAAGF,KAAK,CAACnB,qBAAqB,CAAC,CAAC;QAC/C;QACA,IAAKY,YAAY,CAAEK,cAAe,CAAC,EAAG;UACrCI,WAAW,GAAGJ,cAAc,CAACjB,qBAAqB,CAAC,CAAC;QACrD;QACAD,MAAM,GAAGlB,SAAS,CAAEkB,MAAM,EAAEsB,WAAY,CAAC;QACzCL,KAAK,CAACM,IAAI,CAAEH,KAAM,CAAC;MACpB;IACD;EACD;;EAEA;AACD;AACA;AACA;AACA;AACA;AACA;AACA;EACC,MAAMnC,IAAI,GAAGC,IAAI,CAACG,GAAG,CAAEW,MAAM,CAACf,IAAI,EAAE,CAAE,CAAC;EACvC,MAAMG,KAAK,GAAGF,IAAI,CAACC,GAAG,CAAEa,MAAM,CAACZ,KAAK,EAAEO,QAAQ,CAAC6B,UAAW,CAAC;EAC3DxB,MAAM,GAAG,IAAIR,MAAM,CAACC,eAAe,CAClCR,IAAI,EACJe,MAAM,CAACT,GAAG,EACVH,KAAK,GAAGH,IAAI,EACZe,MAAM,CAACG,MACR,CAAC;EAED,OAAOH,MAAM;AACd","ignoreList":[]}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { _x, __, sprintf } from '@wordpress/i18n';
4
+ import { _x, sprintf } from '@wordpress/i18n';
5
5
 
6
6
  /**
7
7
  * Internal dependencies
@@ -138,7 +138,7 @@ export function getFontStylesAndWeights(fontFamilyFaces) {
138
138
  value: weightValue
139
139
  }) => {
140
140
  const optionName = styleValue === 'normal' ? weightName : sprintf(/* translators: 1: Font weight name. 2: Font style name. */
141
- __('%1$s %2$s'), weightName, styleName);
141
+ _x('%1$s %2$s', 'font'), weightName, styleName);
142
142
  combinedStyleAndWeightOptions.push({
143
143
  key: `${styleValue}-${weightValue}`,
144
144
  name: optionName,
@@ -1 +1 @@
1
- {"version":3,"names":["_x","__","sprintf","formatFontStyle","formatFontWeight","FONT_STYLES","name","value","FONT_WEIGHTS","getFontStylesAndWeights","fontFamilyFaces","fontStyles","fontWeights","combinedStyleAndWeightOptions","isSystemFont","length","isVariableFont","forEach","face","fontWeight","test","trim","startValue","endValue","split","parseInt","slice","i","fontWeightValue","toString","some","weight","push","fontStyle","Object","keys","style","styleName","styleValue","weightName","weightValue","optionName","key"],"sources":["@wordpress/block-editor/src/utils/get-font-styles-and-weights.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { _x, __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { formatFontStyle } from './format-font-style';\nimport { formatFontWeight } from './format-font-weight';\n\nconst FONT_STYLES = [\n\t{\n\t\tname: _x( 'Regular', 'font style' ),\n\t\tvalue: 'normal',\n\t},\n\t{\n\t\tname: _x( 'Italic', 'font style' ),\n\t\tvalue: 'italic',\n\t},\n];\n\nconst FONT_WEIGHTS = [\n\t{\n\t\tname: _x( 'Thin', 'font weight' ),\n\t\tvalue: '100',\n\t},\n\t{\n\t\tname: _x( 'Extra Light', 'font weight' ),\n\t\tvalue: '200',\n\t},\n\t{\n\t\tname: _x( 'Light', 'font weight' ),\n\t\tvalue: '300',\n\t},\n\t{\n\t\tname: _x( 'Regular', 'font weight' ),\n\t\tvalue: '400',\n\t},\n\t{\n\t\tname: _x( 'Medium', 'font weight' ),\n\t\tvalue: '500',\n\t},\n\t{\n\t\tname: _x( 'Semi Bold', 'font weight' ),\n\t\tvalue: '600',\n\t},\n\t{\n\t\tname: _x( 'Bold', 'font weight' ),\n\t\tvalue: '700',\n\t},\n\t{\n\t\tname: _x( 'Extra Bold', 'font weight' ),\n\t\tvalue: '800',\n\t},\n\t{\n\t\tname: _x( 'Black', 'font weight' ),\n\t\tvalue: '900',\n\t},\n\t{\n\t\tname: _x( 'Extra Black', 'font weight' ),\n\t\tvalue: '1000',\n\t},\n];\n\n/**\n * Builds a list of font style and weight options based on font family faces.\n * Defaults to the standard font styles and weights if no font family faces are provided.\n *\n * @param {Array} fontFamilyFaces font family faces array\n * @return {Object} new object with combined and separated font style and weight properties\n */\nexport function getFontStylesAndWeights( fontFamilyFaces ) {\n\tlet fontStyles = [];\n\tlet fontWeights = [];\n\tconst combinedStyleAndWeightOptions = [];\n\tconst isSystemFont = ! fontFamilyFaces || fontFamilyFaces?.length === 0;\n\tlet isVariableFont = false;\n\n\tfontFamilyFaces?.forEach( ( face ) => {\n\t\t// Check for variable font by looking for a space in the font weight value. e.g. \"100 900\"\n\t\tif (\n\t\t\t'string' === typeof face.fontWeight &&\n\t\t\t/\\s/.test( face.fontWeight.trim() )\n\t\t) {\n\t\t\tisVariableFont = true;\n\n\t\t\t// Find font weight start and end values.\n\t\t\tlet [ startValue, endValue ] = face.fontWeight.split( ' ' );\n\t\t\tstartValue = parseInt( startValue.slice( 0, 1 ) );\n\t\t\tif ( endValue === '1000' ) {\n\t\t\t\tendValue = 10;\n\t\t\t} else {\n\t\t\t\tendValue = parseInt( endValue.slice( 0, 1 ) );\n\t\t\t}\n\n\t\t\t// Create font weight options for available variable weights.\n\t\t\tfor ( let i = startValue; i <= endValue; i++ ) {\n\t\t\t\tconst fontWeightValue = `${ i.toString() }00`;\n\t\t\t\tif (\n\t\t\t\t\t! fontWeights.some(\n\t\t\t\t\t\t( weight ) => weight.value === fontWeightValue\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\tfontWeights.push( formatFontWeight( fontWeightValue ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Format font style and weight values.\n\t\tconst fontWeight = formatFontWeight(\n\t\t\t'number' === typeof face.fontWeight\n\t\t\t\t? face.fontWeight.toString()\n\t\t\t\t: face.fontWeight\n\t\t);\n\t\tconst fontStyle = formatFontStyle( face.fontStyle );\n\n\t\t// Create font style and font weight lists without duplicates.\n\t\tif ( fontStyle && Object.keys( fontStyle ).length ) {\n\t\t\tif (\n\t\t\t\t! fontStyles.some(\n\t\t\t\t\t( style ) => style.value === fontStyle.value\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tfontStyles.push( fontStyle );\n\t\t\t}\n\t\t}\n\n\t\tif ( fontWeight && Object.keys( fontWeight ).length ) {\n\t\t\tif (\n\t\t\t\t! fontWeights.some(\n\t\t\t\t\t( weight ) => weight.value === fontWeight.value\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tif ( ! isVariableFont ) {\n\t\t\t\t\tfontWeights.push( fontWeight );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} );\n\n\t// If there is no font weight of 600 or above, then include faux bold as an option.\n\tif ( ! fontWeights.some( ( weight ) => weight.value >= '600' ) ) {\n\t\tfontWeights.push( {\n\t\t\tname: _x( 'Bold', 'font weight' ),\n\t\t\tvalue: '700',\n\t\t} );\n\t}\n\n\t// If there is no italic font style, then include faux italic as an option.\n\tif ( ! fontStyles.some( ( style ) => style.value === 'italic' ) ) {\n\t\tfontStyles.push( {\n\t\t\tname: _x( 'Italic', 'font style' ),\n\t\t\tvalue: 'italic',\n\t\t} );\n\t}\n\n\t// Use default font styles and weights for system fonts.\n\tif ( isSystemFont ) {\n\t\tfontStyles = FONT_STYLES;\n\t\tfontWeights = FONT_WEIGHTS;\n\t}\n\n\t// Use default styles and weights if there are no available styles or weights from the provided font faces.\n\tfontStyles = fontStyles.length === 0 ? FONT_STYLES : fontStyles;\n\tfontWeights = fontWeights.length === 0 ? FONT_WEIGHTS : fontWeights;\n\n\t// Generate combined font style and weight options for available fonts.\n\tfontStyles.forEach( ( { name: styleName, value: styleValue } ) => {\n\t\tfontWeights.forEach( ( { name: weightName, value: weightValue } ) => {\n\t\t\tconst optionName =\n\t\t\t\tstyleValue === 'normal'\n\t\t\t\t\t? weightName\n\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t/* translators: 1: Font weight name. 2: Font style name. */\n\t\t\t\t\t\t\t__( '%1$s %2$s' ),\n\t\t\t\t\t\t\tweightName,\n\t\t\t\t\t\t\tstyleName\n\t\t\t\t\t );\n\n\t\t\tcombinedStyleAndWeightOptions.push( {\n\t\t\t\tkey: `${ styleValue }-${ weightValue }`,\n\t\t\t\tname: optionName,\n\t\t\t\tstyle: {\n\t\t\t\t\tfontStyle: styleValue,\n\t\t\t\t\tfontWeight: weightValue,\n\t\t\t\t},\n\t\t\t} );\n\t\t} );\n\t} );\n\n\treturn {\n\t\tfontStyles,\n\t\tfontWeights,\n\t\tcombinedStyleAndWeightOptions,\n\t\tisSystemFont,\n\t\tisVariableFont,\n\t};\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;;AAEjD;AACA;AACA;AACA,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASC,gBAAgB,QAAQ,sBAAsB;AAEvD,MAAMC,WAAW,GAAG,CACnB;EACCC,IAAI,EAAEN,EAAE,CAAE,SAAS,EAAE,YAAa,CAAC;EACnCO,KAAK,EAAE;AACR,CAAC,EACD;EACCD,IAAI,EAAEN,EAAE,CAAE,QAAQ,EAAE,YAAa,CAAC;EAClCO,KAAK,EAAE;AACR,CAAC,CACD;AAED,MAAMC,YAAY,GAAG,CACpB;EACCF,IAAI,EAAEN,EAAE,CAAE,MAAM,EAAE,aAAc,CAAC;EACjCO,KAAK,EAAE;AACR,CAAC,EACD;EACCD,IAAI,EAAEN,EAAE,CAAE,aAAa,EAAE,aAAc,CAAC;EACxCO,KAAK,EAAE;AACR,CAAC,EACD;EACCD,IAAI,EAAEN,EAAE,CAAE,OAAO,EAAE,aAAc,CAAC;EAClCO,KAAK,EAAE;AACR,CAAC,EACD;EACCD,IAAI,EAAEN,EAAE,CAAE,SAAS,EAAE,aAAc,CAAC;EACpCO,KAAK,EAAE;AACR,CAAC,EACD;EACCD,IAAI,EAAEN,EAAE,CAAE,QAAQ,EAAE,aAAc,CAAC;EACnCO,KAAK,EAAE;AACR,CAAC,EACD;EACCD,IAAI,EAAEN,EAAE,CAAE,WAAW,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EK,UAAU;UACrBnB,UAAU,EAAEqB;QACb;MACD,CAAE,CAAC;IACJ,CAAE,CAAC;EACJ,CAAE,CAAC;EAEH,OAAO;IACN7B,UAAU;IACVC,WAAW;IACXC,6BAA6B;IAC7BC,YAAY;IACZE;EACD,CAAC;AACF","ignoreList":[]}
1
+ {"version":3,"names":["_x","sprintf","formatFontStyle","formatFontWeight","FONT_STYLES","name","value","FONT_WEIGHTS","getFontStylesAndWeights","fontFamilyFaces","fontStyles","fontWeights","combinedStyleAndWeightOptions","isSystemFont","length","isVariableFont","forEach","face","fontWeight","test","trim","startValue","endValue","split","parseInt","slice","i","fontWeightValue","toString","some","weight","push","fontStyle","Object","keys","style","styleName","styleValue","weightName","weightValue","optionName","key"],"sources":["@wordpress/block-editor/src/utils/get-font-styles-and-weights.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { _x, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { formatFontStyle } from './format-font-style';\nimport { formatFontWeight } from './format-font-weight';\n\nconst FONT_STYLES = [\n\t{\n\t\tname: _x( 'Regular', 'font style' ),\n\t\tvalue: 'normal',\n\t},\n\t{\n\t\tname: _x( 'Italic', 'font style' ),\n\t\tvalue: 'italic',\n\t},\n];\n\nconst FONT_WEIGHTS = [\n\t{\n\t\tname: _x( 'Thin', 'font weight' ),\n\t\tvalue: '100',\n\t},\n\t{\n\t\tname: _x( 'Extra Light', 'font weight' ),\n\t\tvalue: '200',\n\t},\n\t{\n\t\tname: _x( 'Light', 'font weight' ),\n\t\tvalue: '300',\n\t},\n\t{\n\t\tname: _x( 'Regular', 'font weight' ),\n\t\tvalue: '400',\n\t},\n\t{\n\t\tname: _x( 'Medium', 'font weight' ),\n\t\tvalue: '500',\n\t},\n\t{\n\t\tname: _x( 'Semi Bold', 'font weight' ),\n\t\tvalue: '600',\n\t},\n\t{\n\t\tname: _x( 'Bold', 'font weight' ),\n\t\tvalue: '700',\n\t},\n\t{\n\t\tname: _x( 'Extra Bold', 'font weight' ),\n\t\tvalue: '800',\n\t},\n\t{\n\t\tname: _x( 'Black', 'font weight' ),\n\t\tvalue: '900',\n\t},\n\t{\n\t\tname: _x( 'Extra Black', 'font weight' ),\n\t\tvalue: '1000',\n\t},\n];\n\n/**\n * Builds a list of font style and weight options based on font family faces.\n * Defaults to the standard font styles and weights if no font family faces are provided.\n *\n * @param {Array} fontFamilyFaces font family faces array\n * @return {Object} new object with combined and separated font style and weight properties\n */\nexport function getFontStylesAndWeights( fontFamilyFaces ) {\n\tlet fontStyles = [];\n\tlet fontWeights = [];\n\tconst combinedStyleAndWeightOptions = [];\n\tconst isSystemFont = ! fontFamilyFaces || fontFamilyFaces?.length === 0;\n\tlet isVariableFont = false;\n\n\tfontFamilyFaces?.forEach( ( face ) => {\n\t\t// Check for variable font by looking for a space in the font weight value. e.g. \"100 900\"\n\t\tif (\n\t\t\t'string' === typeof face.fontWeight &&\n\t\t\t/\\s/.test( face.fontWeight.trim() )\n\t\t) {\n\t\t\tisVariableFont = true;\n\n\t\t\t// Find font weight start and end values.\n\t\t\tlet [ startValue, endValue ] = face.fontWeight.split( ' ' );\n\t\t\tstartValue = parseInt( startValue.slice( 0, 1 ) );\n\t\t\tif ( endValue === '1000' ) {\n\t\t\t\tendValue = 10;\n\t\t\t} else {\n\t\t\t\tendValue = parseInt( endValue.slice( 0, 1 ) );\n\t\t\t}\n\n\t\t\t// Create font weight options for available variable weights.\n\t\t\tfor ( let i = startValue; i <= endValue; i++ ) {\n\t\t\t\tconst fontWeightValue = `${ i.toString() }00`;\n\t\t\t\tif (\n\t\t\t\t\t! fontWeights.some(\n\t\t\t\t\t\t( weight ) => weight.value === fontWeightValue\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\tfontWeights.push( formatFontWeight( fontWeightValue ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Format font style and weight values.\n\t\tconst fontWeight = formatFontWeight(\n\t\t\t'number' === typeof face.fontWeight\n\t\t\t\t? face.fontWeight.toString()\n\t\t\t\t: face.fontWeight\n\t\t);\n\t\tconst fontStyle = formatFontStyle( face.fontStyle );\n\n\t\t// Create font style and font weight lists without duplicates.\n\t\tif ( fontStyle && Object.keys( fontStyle ).length ) {\n\t\t\tif (\n\t\t\t\t! fontStyles.some(\n\t\t\t\t\t( style ) => style.value === fontStyle.value\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tfontStyles.push( fontStyle );\n\t\t\t}\n\t\t}\n\n\t\tif ( fontWeight && Object.keys( fontWeight ).length ) {\n\t\t\tif (\n\t\t\t\t! fontWeights.some(\n\t\t\t\t\t( weight ) => weight.value === fontWeight.value\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tif ( ! isVariableFont ) {\n\t\t\t\t\tfontWeights.push( fontWeight );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} );\n\n\t// If there is no font weight of 600 or above, then include faux bold as an option.\n\tif ( ! fontWeights.some( ( weight ) => weight.value >= '600' ) ) {\n\t\tfontWeights.push( {\n\t\t\tname: _x( 'Bold', 'font weight' ),\n\t\t\tvalue: '700',\n\t\t} );\n\t}\n\n\t// If there is no italic font style, then include faux italic as an option.\n\tif ( ! fontStyles.some( ( style ) => style.value === 'italic' ) ) {\n\t\tfontStyles.push( {\n\t\t\tname: _x( 'Italic', 'font style' ),\n\t\t\tvalue: 'italic',\n\t\t} );\n\t}\n\n\t// Use default font styles and weights for system fonts.\n\tif ( isSystemFont ) {\n\t\tfontStyles = FONT_STYLES;\n\t\tfontWeights = FONT_WEIGHTS;\n\t}\n\n\t// Use default styles and weights if there are no available styles or weights from the provided font faces.\n\tfontStyles = fontStyles.length === 0 ? FONT_STYLES : fontStyles;\n\tfontWeights = fontWeights.length === 0 ? FONT_WEIGHTS : fontWeights;\n\n\t// Generate combined font style and weight options for available fonts.\n\tfontStyles.forEach( ( { name: styleName, value: styleValue } ) => {\n\t\tfontWeights.forEach( ( { name: weightName, value: weightValue } ) => {\n\t\t\tconst optionName =\n\t\t\t\tstyleValue === 'normal'\n\t\t\t\t\t? weightName\n\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t/* translators: 1: Font weight name. 2: Font style name. */\n\t\t\t\t\t\t\t_x( '%1$s %2$s', 'font' ),\n\t\t\t\t\t\t\tweightName,\n\t\t\t\t\t\t\tstyleName\n\t\t\t\t\t );\n\n\t\t\tcombinedStyleAndWeightOptions.push( {\n\t\t\t\tkey: `${ styleValue }-${ weightValue }`,\n\t\t\t\tname: optionName,\n\t\t\t\tstyle: {\n\t\t\t\t\tfontStyle: styleValue,\n\t\t\t\t\tfontWeight: weightValue,\n\t\t\t\t},\n\t\t\t} );\n\t\t} );\n\t} );\n\n\treturn {\n\t\tfontStyles,\n\t\tfontWeights,\n\t\tcombinedStyleAndWeightOptions,\n\t\tisSystemFont,\n\t\tisVariableFont,\n\t};\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;;AAE7C;AACA;AACA;AACA,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASC,gBAAgB,QAAQ,sBAAsB;AAEvD,MAAMC,WAAW,GAAG,CACnB;EACCC,IAAI,EAAEL,EAAE,CAAE,SAAS,EAAE,YAAa,CAAC;EACnCM,KAAK,EAAE;AACR,CAAC,EACD;EACCD,IAAI,EAAEL,EAAE,CAAE,QAAQ,EAAE,YAAa,CAAC;EAClCM,KAAK,EAAE;AACR,CAAC,CACD;AAED,MAAMC,YAAY,GAAG,CACpB;EACCF,IAAI,EAAEL,EAAE,CAAE,MAAM,EAAE,aAAc,CAAC;EACjCM,KAAK,EAAE;AACR,CAAC,EACD;EACCD,IAAI,EAAEL,EAAE,CAAE,aAAa,EAAE,aAAc,CAAC;EACxCM,KAAK,EAAE;AACR,CAAC,EACD;EACCD,IAAI,EAAEL,EAAE,CAAE,OAAO,EAAE,aAAc,CAAC;EAClCM,KAAK,EAAE;AACR,CAAC,EACD;EACCD,IAAI,EAAEL,EAAE,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,WAAW,EAAE,MAAO,CAAC,EACzBsC,UAAU,EACVF,SACA,CAAC;MAELxB,6BAA6B,CAACmB,IAAI,CAAE;QACnCU,GAAG,EAAE,GAAIJ,UAAU,IAAME,WAAW,EAAG;QACvClC,IAAI,EAAEmC,UAAU;QAChBL,KAAK,EAAE;UACNH,SAAS,EAAEK,UAAU;UACrBnB,UAAU,EAAEqB;QACb;MACD,CAAE,CAAC;IACJ,CAAE,CAAC;EACJ,CAAE,CAAC;EAEH,OAAO;IACN7B,UAAU;IACVC,WAAW;IACXC,6BAA6B;IAC7BC,YAAY;IACZE;EACD,CAAC;AACF","ignoreList":[]}
@@ -2,7 +2,8 @@
2
2
  * External dependencies
3
3
  */
4
4
  import * as parsel from 'parsel-js';
5
- import postcss, { CssSyntaxError } from 'postcss';
5
+ import Processor from 'postcss/lib/processor';
6
+ import CssSyntaxError from 'postcss/lib/css-syntax-error';
6
7
  import prefixSelector from 'postcss-prefix-selector';
7
8
  import rebaseUrl from 'postcss-urlrebase';
8
9
  const cacheByWrapperSelector = new Map();
@@ -98,7 +99,7 @@ function transformStyle({
98
99
  try {
99
100
  var _transformOptions$ign;
100
101
  const excludedSelectors = [...ignoredSelectors, ...((_transformOptions$ign = transformOptions?.ignoredSelectors) !== null && _transformOptions$ign !== void 0 ? _transformOptions$ign : []), wrapperSelector];
101
- return postcss([wrapperSelector && prefixSelector({
102
+ return new Processor([wrapperSelector && prefixSelector({
102
103
  prefix: wrapperSelector,
103
104
  transform(prefix, selector, prefixedSelector) {
104
105
  // For backwards compatibility, don't use the `exclude` option
@@ -1 +1 @@
1
- {"version":3,"names":["parsel","postcss","CssSyntaxError","prefixSelector","rebaseUrl","cacheByWrapperSelector","Map","ROOT_SELECTOR_TOKENS","type","content","prefixRootSelector","prefix","selector","tokenized","tokenize","lastRootIndex","findLastIndex","some","rootSelector","insertionPoint","i","length","tokenizedPrefix","splice","stringify","transformStyle","css","ignoredSelectors","baseURL","wrapperSelector","transformOptions","_transformOptions$ign","excludedSelectors","transform","prefixedSelector","excludedSelector","RegExp","match","includes","hasRootSelector","startsWith","rootUrl","filter","Boolean","process","error","console","warn","message","showSourceCode","transformStyles","styles","cache","get","WeakMap","set","map","style"],"sources":["@wordpress/block-editor/src/utils/transform-styles/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as parsel from 'parsel-js';\nimport postcss, { CssSyntaxError } from 'postcss';\nimport prefixSelector from 'postcss-prefix-selector';\nimport rebaseUrl from 'postcss-urlrebase';\n\nconst cacheByWrapperSelector = new Map();\n\nconst ROOT_SELECTOR_TOKENS = [\n\t{ type: 'type', content: 'body' },\n\t{ type: 'type', content: 'html' },\n\t{ type: 'pseudo-class', content: ':root' },\n\t{ type: 'pseudo-class', content: ':where(body)' },\n\t{ type: 'pseudo-class', content: ':where(:root)' },\n\t{ type: 'pseudo-class', content: ':where(html)' },\n];\n\n/**\n * Prefixes root selectors in a way that ensures consistent specificity.\n * This requires special handling, since prefixing a classname before\n * html, body, or :root will generally result in an invalid selector.\n *\n * Some libraries will simply replace the root selector with the prefix\n * instead, but this results in inconsistent specificity.\n *\n * This function instead inserts the prefix after the root tags but before\n * any other part of the selector. This results in consistent specificity:\n * - If a `:where()` selector is used for the prefix, all selectors output\n * by `transformStyles` will have no specificity increase.\n * - If a classname, id, or something else is used as the prefix, all selectors\n * will have the same specificity bump when transformed.\n *\n * @param {string} prefix The prefix.\n * @param {string} selector The selector.\n *\n * @return {string} The prefixed root selector.\n */\nfunction prefixRootSelector( prefix, selector ) {\n\t// Use a tokenizer, since regular expressions are unreliable.\n\tconst tokenized = parsel.tokenize( selector );\n\n\t// Find the last token that contains a root selector by walking back\n\t// through the tokens.\n\tconst lastRootIndex = tokenized.findLastIndex( ( { content, type } ) => {\n\t\treturn ROOT_SELECTOR_TOKENS.some(\n\t\t\t( rootSelector ) =>\n\t\t\t\tcontent === rootSelector.content && type === rootSelector.type\n\t\t);\n\t} );\n\n\t// Walk forwards to find the combinator after the last root.\n\t// This is where the root ends and the rest of the selector begins,\n\t// and the index to insert before.\n\t// Doing it this way takes into account that a root selector like\n\t// 'body' may have additional id/class/pseudo-class/attribute-selector\n\t// parts chained to it, which is difficult to quantify using a regex.\n\tlet insertionPoint = -1;\n\tfor ( let i = lastRootIndex + 1; i < tokenized.length; i++ ) {\n\t\tif ( tokenized[ i ].type === 'combinator' ) {\n\t\t\tinsertionPoint = i;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t// Tokenize and insert the prefix with a ' ' combinator before it.\n\tconst tokenizedPrefix = parsel.tokenize( prefix );\n\ttokenized.splice(\n\t\t// Insert at the insertion point, or the end.\n\t\tinsertionPoint === -1 ? tokenized.length : insertionPoint,\n\t\t0,\n\t\t{\n\t\t\ttype: 'combinator',\n\t\t\tcontent: ' ',\n\t\t},\n\t\t...tokenizedPrefix\n\t);\n\n\treturn parsel.stringify( tokenized );\n}\n\nfunction transformStyle(\n\t{ css, ignoredSelectors = [], baseURL },\n\twrapperSelector = '',\n\ttransformOptions\n) {\n\t// When there is no wrapper selector and no base URL, there is no need\n\t// to transform the CSS. This is most cases because in the default\n\t// iframed editor, no wrapping is needed, and not many styles\n\t// provide a base URL.\n\tif ( ! wrapperSelector && ! baseURL ) {\n\t\treturn css;\n\t}\n\n\ttry {\n\t\tconst excludedSelectors = [\n\t\t\t...ignoredSelectors,\n\t\t\t...( transformOptions?.ignoredSelectors ?? [] ),\n\t\t\twrapperSelector,\n\t\t];\n\n\t\treturn postcss(\n\t\t\t[\n\t\t\t\twrapperSelector &&\n\t\t\t\t\tprefixSelector( {\n\t\t\t\t\t\tprefix: wrapperSelector,\n\t\t\t\t\t\ttransform( prefix, selector, prefixedSelector ) {\n\t\t\t\t\t\t\t// For backwards compatibility, don't use the `exclude` option\n\t\t\t\t\t\t\t// of postcss-prefix-selector, instead handle it here to match\n\t\t\t\t\t\t\t// the behavior of the old library (postcss-prefix-wrap) that\n\t\t\t\t\t\t\t// `transformStyle` previously used.\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\texcludedSelectors.some( ( excludedSelector ) =>\n\t\t\t\t\t\t\t\t\texcludedSelector instanceof RegExp\n\t\t\t\t\t\t\t\t\t\t? selector.match( excludedSelector )\n\t\t\t\t\t\t\t\t\t\t: selector.includes( excludedSelector )\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\treturn selector;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst hasRootSelector = ROOT_SELECTOR_TOKENS.some(\n\t\t\t\t\t\t\t\t( rootSelector ) =>\n\t\t\t\t\t\t\t\t\tselector.startsWith( rootSelector.content )\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t// Reorganize root selectors such that the root part comes before the prefix,\n\t\t\t\t\t\t\t// but the prefix still comes before the remaining part of the selector.\n\t\t\t\t\t\t\tif ( hasRootSelector ) {\n\t\t\t\t\t\t\t\treturn prefixRootSelector( prefix, selector );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn prefixedSelector;\n\t\t\t\t\t\t},\n\t\t\t\t\t} ),\n\t\t\t\tbaseURL && rebaseUrl( { rootUrl: baseURL } ),\n\t\t\t].filter( Boolean )\n\t\t).process( css, {} ).css; // use sync PostCSS API\n\t} catch ( error ) {\n\t\tif ( error instanceof CssSyntaxError ) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.warn(\n\t\t\t\t'wp.blockEditor.transformStyles Failed to transform CSS.',\n\t\t\t\terror.message + '\\n' + error.showSourceCode( false )\n\t\t\t);\n\t\t} else {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.warn(\n\t\t\t\t'wp.blockEditor.transformStyles Failed to transform CSS.',\n\t\t\t\terror\n\t\t\t);\n\t\t}\n\n\t\treturn null;\n\t}\n}\n\n/**\n * @typedef {Object} EditorStyle\n * @property {string} css the CSS block(s), as a single string.\n * @property {?string} baseURL the base URL to be used as the reference when rewritting urls.\n * @property {?string[]} ignoredSelectors the selectors not to wrap.\n */\n\n/**\n * @typedef {Object} TransformOptions\n * @property {?string[]} ignoredSelectors the selectors not to wrap.\n */\n\n/**\n * Applies a series of CSS rule transforms to wrap selectors inside a given class and/or rewrite URLs depending on the parameters passed.\n *\n * @param {EditorStyle[]} styles CSS rules.\n * @param {string} wrapperSelector Wrapper selector.\n * @param {TransformOptions} transformOptions Additional options for style transformation.\n * @return {Array} converted rules.\n */\nconst transformStyles = ( styles, wrapperSelector = '', transformOptions ) => {\n\tlet cache = cacheByWrapperSelector.get( wrapperSelector );\n\tif ( ! cache ) {\n\t\tcache = new WeakMap();\n\t\tcacheByWrapperSelector.set( wrapperSelector, cache );\n\t}\n\treturn styles.map( ( style ) => {\n\t\tlet css = cache.get( style );\n\t\tif ( ! css ) {\n\t\t\tcss = transformStyle( style, wrapperSelector, transformOptions );\n\t\t\tcache.set( style, css );\n\t\t}\n\t\treturn css;\n\t} );\n};\n\nexport default transformStyles;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,KAAKA,MAAM,MAAM,WAAW;AACnC,OAAOC,OAAO,IAAIC,cAAc,QAAQ,SAAS;AACjD,OAAOC,cAAc,MAAM,yBAAyB;AACpD,OAAOC,SAAS,MAAM,mBAAmB;AAEzC,MAAMC,sBAAsB,GAAG,IAAIC,GAAG,CAAC,CAAC;AAExC,MAAMC,oBAAoB,GAAG,CAC5B;EAAEC,IAAI,EAAE,MAAM;EAAEC,OAAO,EAAE;AAAO,CAAC,EACjC;EAAED,IAAI,EAAE,MAAM;EAAEC,OAAO,EAAE;AAAO,CAAC,EACjC;EAAED,IAAI,EAAE,cAAc;EAAEC,OAAO,EAAE;AAAQ,CAAC,EAC1C;EAAED,IAAI,EAAE,cAAc;EAAEC,OAAO,EAAE;AAAe,CAAC,EACjD;EAAED,IAAI,EAAE,cAAc;EAAEC,OAAO,EAAE;AAAgB,CAAC,EAClD;EAAED,IAAI,EAAE,cAAc;EAAEC,OAAO,EAAE;AAAe,CAAC,CACjD;;AAED;AACA;AACA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C,IAAI,CACX,yDAAyD,EACzDF,KAAK,CAACG,OAAO,GAAG,IAAI,GAAGH,KAAK,CAACI,cAAc,CAAE,KAAM,CACpD,CAAC;IACF,CAAC,MAAM;MACN;MACAH,OAAO,CAACC,IAAI,CACX,yDAAyD,EACzDF,KACD,CAAC;IACF;IAEA,OAAO,IAAI;EACZ;AACD;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMK,eAAe,GAAGA,CAAEC,MAAM,EAAEtB,eAAe,GAAG,EAAE,EAAEC,gBAAgB,KAAM;EAC7E,IAAIsB,KAAK,GAAG/C,sBAAsB,CAACgD,GAAG,CAAExB,eAAgB,CAAC;EACzD,IAAK,CAAEuB,KAAK,EAAG;IACdA,KAAK,GAAG,IAAIE,OAAO,CAAC,CAAC;IACrBjD,sBAAsB,CAACkD,GAAG,CAAE1B,eAAe,EAAEuB,KAAM,CAAC;EACrD;EACA,OAAOD,MAAM,CAACK,GAAG,CAAIC,KAAK,IAAM;IAC/B,IAAI/B,GAAG,GAAG0B,KAAK,CAACC,GAAG,CAAEI,KAAM,CAAC;IAC5B,IAAK,CAAE/B,GAAG,EAAG;MACZA,GAAG,GAAGD,cAAc,CAAEgC,KAAK,EAAE5B,eAAe,EAAEC,gBAAiB,CAAC;MAChEsB,KAAK,CAACG,GAAG,CAAEE,KAAK,EAAE/B,GAAI,CAAC;IACxB;IACA,OAAOA,GAAG;EACX,CAAE,CAAC;AACJ,CAAC;AAED,eAAewB,eAAe","ignoreList":[]}
1
+ {"version":3,"names":["parsel","Processor","CssSyntaxError","prefixSelector","rebaseUrl","cacheByWrapperSelector","Map","ROOT_SELECTOR_TOKENS","type","content","prefixRootSelector","prefix","selector","tokenized","tokenize","lastRootIndex","findLastIndex","some","rootSelector","insertionPoint","i","length","tokenizedPrefix","splice","stringify","transformStyle","css","ignoredSelectors","baseURL","wrapperSelector","transformOptions","_transformOptions$ign","excludedSelectors","transform","prefixedSelector","excludedSelector","RegExp","match","includes","hasRootSelector","startsWith","rootUrl","filter","Boolean","process","error","console","warn","message","showSourceCode","transformStyles","styles","cache","get","WeakMap","set","map","style"],"sources":["@wordpress/block-editor/src/utils/transform-styles/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as parsel from 'parsel-js';\nimport Processor from 'postcss/lib/processor';\nimport CssSyntaxError from 'postcss/lib/css-syntax-error';\nimport prefixSelector from 'postcss-prefix-selector';\nimport rebaseUrl from 'postcss-urlrebase';\n\nconst cacheByWrapperSelector = new Map();\n\nconst ROOT_SELECTOR_TOKENS = [\n\t{ type: 'type', content: 'body' },\n\t{ type: 'type', content: 'html' },\n\t{ type: 'pseudo-class', content: ':root' },\n\t{ type: 'pseudo-class', content: ':where(body)' },\n\t{ type: 'pseudo-class', content: ':where(:root)' },\n\t{ type: 'pseudo-class', content: ':where(html)' },\n];\n\n/**\n * Prefixes root selectors in a way that ensures consistent specificity.\n * This requires special handling, since prefixing a classname before\n * html, body, or :root will generally result in an invalid selector.\n *\n * Some libraries will simply replace the root selector with the prefix\n * instead, but this results in inconsistent specificity.\n *\n * This function instead inserts the prefix after the root tags but before\n * any other part of the selector. This results in consistent specificity:\n * - If a `:where()` selector is used for the prefix, all selectors output\n * by `transformStyles` will have no specificity increase.\n * - If a classname, id, or something else is used as the prefix, all selectors\n * will have the same specificity bump when transformed.\n *\n * @param {string} prefix The prefix.\n * @param {string} selector The selector.\n *\n * @return {string} The prefixed root selector.\n */\nfunction prefixRootSelector( prefix, selector ) {\n\t// Use a tokenizer, since regular expressions are unreliable.\n\tconst tokenized = parsel.tokenize( selector );\n\n\t// Find the last token that contains a root selector by walking back\n\t// through the tokens.\n\tconst lastRootIndex = tokenized.findLastIndex( ( { content, type } ) => {\n\t\treturn ROOT_SELECTOR_TOKENS.some(\n\t\t\t( rootSelector ) =>\n\t\t\t\tcontent === rootSelector.content && type === rootSelector.type\n\t\t);\n\t} );\n\n\t// Walk forwards to find the combinator after the last root.\n\t// This is where the root ends and the rest of the selector begins,\n\t// and the index to insert before.\n\t// Doing it this way takes into account that a root selector like\n\t// 'body' may have additional id/class/pseudo-class/attribute-selector\n\t// parts chained to it, which is difficult to quantify using a regex.\n\tlet insertionPoint = -1;\n\tfor ( let i = lastRootIndex + 1; i < tokenized.length; i++ ) {\n\t\tif ( tokenized[ i ].type === 'combinator' ) {\n\t\t\tinsertionPoint = i;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t// Tokenize and insert the prefix with a ' ' combinator before it.\n\tconst tokenizedPrefix = parsel.tokenize( prefix );\n\ttokenized.splice(\n\t\t// Insert at the insertion point, or the end.\n\t\tinsertionPoint === -1 ? tokenized.length : insertionPoint,\n\t\t0,\n\t\t{\n\t\t\ttype: 'combinator',\n\t\t\tcontent: ' ',\n\t\t},\n\t\t...tokenizedPrefix\n\t);\n\n\treturn parsel.stringify( tokenized );\n}\n\nfunction transformStyle(\n\t{ css, ignoredSelectors = [], baseURL },\n\twrapperSelector = '',\n\ttransformOptions\n) {\n\t// When there is no wrapper selector and no base URL, there is no need\n\t// to transform the CSS. This is most cases because in the default\n\t// iframed editor, no wrapping is needed, and not many styles\n\t// provide a base URL.\n\tif ( ! wrapperSelector && ! baseURL ) {\n\t\treturn css;\n\t}\n\n\ttry {\n\t\tconst excludedSelectors = [\n\t\t\t...ignoredSelectors,\n\t\t\t...( transformOptions?.ignoredSelectors ?? [] ),\n\t\t\twrapperSelector,\n\t\t];\n\n\t\treturn new Processor(\n\t\t\t[\n\t\t\t\twrapperSelector &&\n\t\t\t\t\tprefixSelector( {\n\t\t\t\t\t\tprefix: wrapperSelector,\n\t\t\t\t\t\ttransform( prefix, selector, prefixedSelector ) {\n\t\t\t\t\t\t\t// For backwards compatibility, don't use the `exclude` option\n\t\t\t\t\t\t\t// of postcss-prefix-selector, instead handle it here to match\n\t\t\t\t\t\t\t// the behavior of the old library (postcss-prefix-wrap) that\n\t\t\t\t\t\t\t// `transformStyle` previously used.\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\texcludedSelectors.some( ( excludedSelector ) =>\n\t\t\t\t\t\t\t\t\texcludedSelector instanceof RegExp\n\t\t\t\t\t\t\t\t\t\t? selector.match( excludedSelector )\n\t\t\t\t\t\t\t\t\t\t: selector.includes( excludedSelector )\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\treturn selector;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst hasRootSelector = ROOT_SELECTOR_TOKENS.some(\n\t\t\t\t\t\t\t\t( rootSelector ) =>\n\t\t\t\t\t\t\t\t\tselector.startsWith( rootSelector.content )\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t// Reorganize root selectors such that the root part comes before the prefix,\n\t\t\t\t\t\t\t// but the prefix still comes before the remaining part of the selector.\n\t\t\t\t\t\t\tif ( hasRootSelector ) {\n\t\t\t\t\t\t\t\treturn prefixRootSelector( prefix, selector );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn prefixedSelector;\n\t\t\t\t\t\t},\n\t\t\t\t\t} ),\n\t\t\t\tbaseURL && rebaseUrl( { rootUrl: baseURL } ),\n\t\t\t].filter( Boolean )\n\t\t).process( css, {} ).css; // use sync PostCSS API\n\t} catch ( error ) {\n\t\tif ( error instanceof CssSyntaxError ) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.warn(\n\t\t\t\t'wp.blockEditor.transformStyles Failed to transform CSS.',\n\t\t\t\terror.message + '\\n' + error.showSourceCode( false )\n\t\t\t);\n\t\t} else {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.warn(\n\t\t\t\t'wp.blockEditor.transformStyles Failed to transform CSS.',\n\t\t\t\terror\n\t\t\t);\n\t\t}\n\n\t\treturn null;\n\t}\n}\n\n/**\n * @typedef {Object} EditorStyle\n * @property {string} css the CSS block(s), as a single string.\n * @property {?string} baseURL the base URL to be used as the reference when rewritting urls.\n * @property {?string[]} ignoredSelectors the selectors not to wrap.\n */\n\n/**\n * @typedef {Object} TransformOptions\n * @property {?string[]} ignoredSelectors the selectors not to wrap.\n */\n\n/**\n * Applies a series of CSS rule transforms to wrap selectors inside a given class and/or rewrite URLs depending on the parameters passed.\n *\n * @param {EditorStyle[]} styles CSS rules.\n * @param {string} wrapperSelector Wrapper selector.\n * @param {TransformOptions} transformOptions Additional options for style transformation.\n * @return {Array} converted rules.\n */\nconst transformStyles = ( styles, wrapperSelector = '', transformOptions ) => {\n\tlet cache = cacheByWrapperSelector.get( wrapperSelector );\n\tif ( ! cache ) {\n\t\tcache = new WeakMap();\n\t\tcacheByWrapperSelector.set( wrapperSelector, cache );\n\t}\n\treturn styles.map( ( style ) => {\n\t\tlet css = cache.get( style );\n\t\tif ( ! css ) {\n\t\t\tcss = transformStyle( style, wrapperSelector, transformOptions );\n\t\t\tcache.set( style, css );\n\t\t}\n\t\treturn css;\n\t} );\n};\n\nexport default transformStyles;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,KAAKA,MAAM,MAAM,WAAW;AACnC,OAAOC,SAAS,MAAM,uBAAuB;AAC7C,OAAOC,cAAc,MAAM,8BAA8B;AACzD,OAAOC,cAAc,MAAM,yBAAyB;AACpD,OAAOC,SAAS,MAAM,mBAAmB;AAEzC,MAAMC,sBAAsB,GAAG,IAAIC,GAAG,CAAC,CAAC;AAExC,MAAMC,oBAAoB,GAAG,CAC5B;EAAEC,IAAI,EAAE,MAAM;EAAEC,OAAO,EAAE;AAAO,CAAC,EACjC;EAAED,IAAI,EAAE,MAAM;EAAEC,OAAO,EAAE;AAAO,CAAC,EACjC;EAAED,IAAI,EAAE,cAAc;EAAEC,OAAO,EAAE;AAAQ,CAAC,EAC1C;EAAED,IAAI,EAAE,cAAc;EAAEC,OAAO,EAAE;AAAe,CAAC,EACjD;EAAED,IAAI,EAAE,cAAc;EAAEC,OAAO,EAAE;AAAgB,CAAC,EAClD;EAAED,IAAI,EAAE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AG;IACjB,IAAKA,KAAK,YAAY3C,cAAc,EAAG;MACtC;MACA4C,OAAO,CAACC,IAAI,CACX,yDAAyD,EACzDF,KAAK,CAACG,OAAO,GAAG,IAAI,GAAGH,KAAK,CAACI,cAAc,CAAE,KAAM,CACpD,CAAC;IACF,CAAC,MAAM;MACN;MACAH,OAAO,CAACC,IAAI,CACX,yDAAyD,EACzDF,KACD,CAAC;IACF;IAEA,OAAO,IAAI;EACZ;AACD;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMK,eAAe,GAAGA,CAAEC,MAAM,EAAEtB,eAAe,GAAG,EAAE,EAAEC,gBAAgB,KAAM;EAC7E,IAAIsB,KAAK,GAAG/C,sBAAsB,CAACgD,GAAG,CAAExB,eAAgB,CAAC;EACzD,IAAK,CAAEuB,KAAK,EAAG;IACdA,KAAK,GAAG,IAAIE,OAAO,CAAC,CAAC;IACrBjD,sBAAsB,CAACkD,GAAG,CAAE1B,eAAe,EAAEuB,KAAM,CAAC;EACrD;EACA,OAAOD,MAAM,CAACK,GAAG,CAAIC,KAAK,IAAM;IAC/B,IAAI/B,GAAG,GAAG0B,KAAK,CAACC,GAAG,CAAEI,KAAM,CAAC;IAC5B,IAAK,CAAE/B,GAAG,EAAG;MACZA,GAAG,GAAGD,cAAc,CAAEgC,KAAK,EAAE5B,eAAe,EAAEC,gBAAiB,CAAC;MAChEsB,KAAK,CAACG,GAAG,CAAEE,KAAK,EAAE/B,GAAI,CAAC;IACxB;IACA,OAAOA,GAAG;EACX,CAAE,CAAC;AACJ,CAAC;AAED,eAAewB,eAAe","ignoreList":[]}
@@ -155,7 +155,7 @@
155
155
  }
156
156
  /* stylelint-disable -- Stylelint is disabled to allow the hack to work. */
157
157
  _::-webkit-full-page-media, _:future, :root .block-editor-block-list__layout::selection,
158
- _::-webkit-full-page-media, _:future, :root .has-multi-selection .block-editor-block-list__layout::selection {
158
+ _::-webkit-full-page-media, _:future, :root [data-has-multi-selection=true] .block-editor-block-list__layout::selection {
159
159
  background-color: transparent;
160
160
  }
161
161
 
@@ -772,12 +772,11 @@ _::-webkit-full-page-media, _:future, :root .has-multi-selection .block-editor-b
772
772
 
773
773
  .block-editor-iframe__body {
774
774
  position: relative;
775
- border: 0.01px solid transparent;
776
775
  }
777
776
 
778
777
  .block-editor-iframe__html {
779
778
  transform-origin: top center;
780
- transition: all 400ms cubic-bezier(0.46, 0.03, 0.52, 0.96), transform 0s scale 0s;
779
+ transition: all 400ms cubic-bezier(0.46, 0.03, 0.52, 0.96), transform 0s, scale 0s, padding 0s;
781
780
  }
782
781
  @media (prefers-reduced-motion: reduce) {
783
782
  .block-editor-iframe__html {
@@ -788,9 +787,15 @@ _::-webkit-full-page-media, _:future, :root .has-multi-selection .block-editor-b
788
787
  .block-editor-iframe__html.zoom-out-animation {
789
788
  transition: all 400ms cubic-bezier(0.46, 0.03, 0.52, 0.96), transform 0s;
790
789
  }
790
+ @media (prefers-reduced-motion: reduce) {
791
+ .block-editor-iframe__html.zoom-out-animation {
792
+ transition-duration: 0s;
793
+ transition-delay: 0s;
794
+ }
795
+ }
791
796
 
792
797
  .block-editor-iframe__html.is-zoomed-out {
793
- transform: translateX(calc(-1*(( var(--wp-block-editor-iframe-zoom-out-outer-container-width) - var(--wp-block-editor-iframe-zoom-out-container-width, 100vw)) / 2 / var(--wp-block-editor-iframe-zoom-out-scale))));
798
+ transform: translateX(calc(-1*((var(--wp-block-editor-iframe-zoom-out-scale-container-width) - var(--wp-block-editor-iframe-zoom-out-container-width, 100vw)) / 2 / var(--wp-block-editor-iframe-zoom-out-scale))));
794
799
  scale: var(--wp-block-editor-iframe-zoom-out-scale);
795
800
  background-color: #ddd;
796
801
  margin-bottom: calc(-1 * calc(calc(var(--wp-block-editor-iframe-zoom-out-content-height) * (1 - var(--wp-block-editor-iframe-zoom-out-scale))) + calc(2 * var(--wp-block-editor-iframe-zoom-out-frame-size) / var(--wp-block-editor-iframe-zoom-out-scale)) + 2px));
@@ -155,7 +155,7 @@
155
155
  }
156
156
  /* stylelint-disable -- Stylelint is disabled to allow the hack to work. */
157
157
  _::-webkit-full-page-media, _:future, :root .block-editor-block-list__layout::selection,
158
- _::-webkit-full-page-media, _:future, :root .has-multi-selection .block-editor-block-list__layout::selection {
158
+ _::-webkit-full-page-media, _:future, :root [data-has-multi-selection=true] .block-editor-block-list__layout::selection {
159
159
  background-color: transparent;
160
160
  }
161
161
 
@@ -772,12 +772,11 @@ _::-webkit-full-page-media, _:future, :root .has-multi-selection .block-editor-b
772
772
 
773
773
  .block-editor-iframe__body {
774
774
  position: relative;
775
- border: 0.01px solid transparent;
776
775
  }
777
776
 
778
777
  .block-editor-iframe__html {
779
778
  transform-origin: top center;
780
- transition: all 400ms cubic-bezier(0.46, 0.03, 0.52, 0.96), transform 0s scale 0s;
779
+ transition: all 400ms cubic-bezier(0.46, 0.03, 0.52, 0.96), transform 0s, scale 0s, padding 0s;
781
780
  }
782
781
  @media (prefers-reduced-motion: reduce) {
783
782
  .block-editor-iframe__html {
@@ -788,9 +787,15 @@ _::-webkit-full-page-media, _:future, :root .has-multi-selection .block-editor-b
788
787
  .block-editor-iframe__html.zoom-out-animation {
789
788
  transition: all 400ms cubic-bezier(0.46, 0.03, 0.52, 0.96), transform 0s;
790
789
  }
790
+ @media (prefers-reduced-motion: reduce) {
791
+ .block-editor-iframe__html.zoom-out-animation {
792
+ transition-duration: 0s;
793
+ transition-delay: 0s;
794
+ }
795
+ }
791
796
 
792
797
  .block-editor-iframe__html.is-zoomed-out {
793
- transform: translateX(calc(( var(--wp-block-editor-iframe-zoom-out-outer-container-width) - var(--wp-block-editor-iframe-zoom-out-container-width, 100vw)) / 2 / var(--wp-block-editor-iframe-zoom-out-scale)));
798
+ transform: translateX(calc((var(--wp-block-editor-iframe-zoom-out-scale-container-width) - var(--wp-block-editor-iframe-zoom-out-container-width, 100vw)) / 2 / var(--wp-block-editor-iframe-zoom-out-scale)));
794
799
  scale: var(--wp-block-editor-iframe-zoom-out-scale);
795
800
  background-color: #ddd;
796
801
  margin-bottom: calc(-1 * calc(calc(var(--wp-block-editor-iframe-zoom-out-content-height) * (1 - var(--wp-block-editor-iframe-zoom-out-scale))) + calc(2 * var(--wp-block-editor-iframe-zoom-out-frame-size) / var(--wp-block-editor-iframe-zoom-out-scale)) + 2px));
@@ -279,6 +279,13 @@ iframe[name=editor-canvas] {
279
279
  height: 100%;
280
280
  display: block;
281
281
  background-color: transparent;
282
+ transition: all 400ms cubic-bezier(0.46, 0.03, 0.52, 0.96);
283
+ }
284
+ @media (prefers-reduced-motion: reduce) {
285
+ iframe[name=editor-canvas] {
286
+ transition-duration: 0s;
287
+ transition-delay: 0s;
288
+ }
282
289
  }
283
290
 
284
291
  .block-editor-block-icon {
@@ -339,12 +346,6 @@ iframe[name=editor-canvas] {
339
346
  border-top: 1px solid #ddd;
340
347
  }
341
348
 
342
- .block-editor-block-inspector__tab-item {
343
- flex: 1 1 0px;
344
- display: flex;
345
- justify-content: center;
346
- }
347
-
348
349
  /**
349
350
  * Insertion Point.
350
351
  */
@@ -493,20 +494,6 @@ iframe[name=editor-canvas] {
493
494
  right: 50%;
494
495
  }
495
496
 
496
- .zoom-out-toolbar .block-editor-block-mover-button.block-editor-block-mover-button:focus-visible::before,
497
- .zoom-out-toolbar .zoom-out-toolbar-button:focus::before,
498
- .zoom-out-toolbar .block-editor-block-toolbar-shuffle:focus::before,
499
- .zoom-out-toolbar .block-selection-button_drag-handle:focus::before {
500
- box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
501
- }
502
- .zoom-out-toolbar .block-editor-block-mover {
503
- background: none;
504
- border: none;
505
- }
506
- .zoom-out-toolbar .zoom-out-toolbar-button {
507
- height: 40px;
508
- }
509
-
510
497
  .block-editor-block-lock-modal {
511
498
  z-index: 1000001;
512
499
  }
@@ -884,6 +871,7 @@ iframe[name=editor-canvas] {
884
871
  height: 100%;
885
872
  scroll-margin-top: 24px;
886
873
  scroll-margin-bottom: 56px;
874
+ outline: 0;
887
875
  }
888
876
  .block-editor-block-patterns-list__item .block-editor-block-patterns-list__item-title {
889
877
  flex-grow: 1;
@@ -1841,7 +1829,6 @@ iframe[name=editor-canvas] {
1841
1829
  .block-editor-iframe__container {
1842
1830
  width: 100%;
1843
1831
  height: 100%;
1844
- overflow-x: hidden;
1845
1832
  }
1846
1833
 
1847
1834
  .block-editor-iframe__scale-container {
@@ -1849,7 +1836,7 @@ iframe[name=editor-canvas] {
1849
1836
  }
1850
1837
 
1851
1838
  .block-editor-iframe__scale-container.is-zoomed-out {
1852
- width: var(--wp-block-editor-iframe-zoom-out-outer-container-width, 100vw);
1839
+ width: var(--wp-block-editor-iframe-zoom-out-scale-container-width, 100vw);
1853
1840
  position: absolute;
1854
1841
  left: 0;
1855
1842
  }
@@ -3596,6 +3583,22 @@ div.block-editor-bindings__panel button:hover .block-editor-bindings__item span
3596
3583
  margin-right: 6px;
3597
3584
  }
3598
3585
 
3586
+ .block-editor-block-toolbar-change-design-content-wrapper {
3587
+ padding: 12px;
3588
+ width: 320px;
3589
+ }
3590
+ .block-editor-block-toolbar-change-design-content-wrapper .block-editor-block-patterns-list {
3591
+ display: grid;
3592
+ grid-template-columns: 1fr 1fr;
3593
+ grid-gap: 12px;
3594
+ }
3595
+ .block-editor-block-toolbar-change-design-content-wrapper .block-editor-block-patterns-list .block-editor-block-patterns-list__list-item {
3596
+ margin-bottom: 0;
3597
+ }
3598
+ .block-editor-block-toolbar-change-design-content-wrapper .block-editor-block-patterns-list .block-editor-inserter__media-list__list-item {
3599
+ min-height: 100px;
3600
+ }
3601
+
3599
3602
  .block-editor-inserter {
3600
3603
  display: inline-block;
3601
3604
  background: none;
@@ -3710,6 +3713,7 @@ div.block-editor-bindings__panel button:hover .block-editor-bindings__item span
3710
3713
  }
3711
3714
 
3712
3715
  .block-editor-inserter__panel-header {
3716
+ position: relative;
3713
3717
  display: inline-flex;
3714
3718
  align-items: center;
3715
3719
  padding: 16px 16px 0;
@@ -3846,6 +3850,13 @@ div.block-editor-bindings__panel button:hover .block-editor-bindings__item span
3846
3850
  margin-top: 24px;
3847
3851
  }
3848
3852
 
3853
+ .block-editor-inserter__patterns-filter-help {
3854
+ padding: 16px;
3855
+ border-top: 1px solid #ddd;
3856
+ color: #757575;
3857
+ min-width: 280px;
3858
+ }
3859
+
3849
3860
  .block-editor-inserter__media-list,
3850
3861
  .block-editor-block-patterns-list {
3851
3862
  overflow-y: auto;
@@ -279,6 +279,13 @@ iframe[name=editor-canvas] {
279
279
  height: 100%;
280
280
  display: block;
281
281
  background-color: transparent;
282
+ transition: all 400ms cubic-bezier(0.46, 0.03, 0.52, 0.96);
283
+ }
284
+ @media (prefers-reduced-motion: reduce) {
285
+ iframe[name=editor-canvas] {
286
+ transition-duration: 0s;
287
+ transition-delay: 0s;
288
+ }
282
289
  }
283
290
 
284
291
  .block-editor-block-icon {
@@ -339,12 +346,6 @@ iframe[name=editor-canvas] {
339
346
  border-top: 1px solid #ddd;
340
347
  }
341
348
 
342
- .block-editor-block-inspector__tab-item {
343
- flex: 1 1 0px;
344
- display: flex;
345
- justify-content: center;
346
- }
347
-
348
349
  /**
349
350
  * Insertion Point.
350
351
  */
@@ -493,20 +494,6 @@ iframe[name=editor-canvas] {
493
494
  left: 50%;
494
495
  }
495
496
 
496
- .zoom-out-toolbar .block-editor-block-mover-button.block-editor-block-mover-button:focus-visible::before,
497
- .zoom-out-toolbar .zoom-out-toolbar-button:focus::before,
498
- .zoom-out-toolbar .block-editor-block-toolbar-shuffle:focus::before,
499
- .zoom-out-toolbar .block-selection-button_drag-handle:focus::before {
500
- box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
501
- }
502
- .zoom-out-toolbar .block-editor-block-mover {
503
- background: none;
504
- border: none;
505
- }
506
- .zoom-out-toolbar .zoom-out-toolbar-button {
507
- height: 40px;
508
- }
509
-
510
497
  .block-editor-block-lock-modal {
511
498
  z-index: 1000001;
512
499
  }
@@ -884,6 +871,7 @@ iframe[name=editor-canvas] {
884
871
  height: 100%;
885
872
  scroll-margin-top: 24px;
886
873
  scroll-margin-bottom: 56px;
874
+ outline: 0;
887
875
  }
888
876
  .block-editor-block-patterns-list__item .block-editor-block-patterns-list__item-title {
889
877
  flex-grow: 1;
@@ -1842,7 +1830,6 @@ iframe[name=editor-canvas] {
1842
1830
  .block-editor-iframe__container {
1843
1831
  width: 100%;
1844
1832
  height: 100%;
1845
- overflow-x: hidden;
1846
1833
  }
1847
1834
 
1848
1835
  .block-editor-iframe__scale-container {
@@ -1850,7 +1837,7 @@ iframe[name=editor-canvas] {
1850
1837
  }
1851
1838
 
1852
1839
  .block-editor-iframe__scale-container.is-zoomed-out {
1853
- width: var(--wp-block-editor-iframe-zoom-out-outer-container-width, 100vw);
1840
+ width: var(--wp-block-editor-iframe-zoom-out-scale-container-width, 100vw);
1854
1841
  position: absolute;
1855
1842
  right: 0;
1856
1843
  }
@@ -3597,6 +3584,22 @@ div.block-editor-bindings__panel button:hover .block-editor-bindings__item span
3597
3584
  margin-left: 6px;
3598
3585
  }
3599
3586
 
3587
+ .block-editor-block-toolbar-change-design-content-wrapper {
3588
+ padding: 12px;
3589
+ width: 320px;
3590
+ }
3591
+ .block-editor-block-toolbar-change-design-content-wrapper .block-editor-block-patterns-list {
3592
+ display: grid;
3593
+ grid-template-columns: 1fr 1fr;
3594
+ grid-gap: 12px;
3595
+ }
3596
+ .block-editor-block-toolbar-change-design-content-wrapper .block-editor-block-patterns-list .block-editor-block-patterns-list__list-item {
3597
+ margin-bottom: 0;
3598
+ }
3599
+ .block-editor-block-toolbar-change-design-content-wrapper .block-editor-block-patterns-list .block-editor-inserter__media-list__list-item {
3600
+ min-height: 100px;
3601
+ }
3602
+
3600
3603
  .block-editor-inserter {
3601
3604
  display: inline-block;
3602
3605
  background: none;
@@ -3711,6 +3714,7 @@ div.block-editor-bindings__panel button:hover .block-editor-bindings__item span
3711
3714
  }
3712
3715
 
3713
3716
  .block-editor-inserter__panel-header {
3717
+ position: relative;
3714
3718
  display: inline-flex;
3715
3719
  align-items: center;
3716
3720
  padding: 16px 16px 0;
@@ -3847,6 +3851,13 @@ div.block-editor-bindings__panel button:hover .block-editor-bindings__item span
3847
3851
  margin-top: 24px;
3848
3852
  }
3849
3853
 
3854
+ .block-editor-inserter__patterns-filter-help {
3855
+ padding: 16px;
3856
+ border-top: 1px solid #ddd;
3857
+ color: #757575;
3858
+ min-width: 280px;
3859
+ }
3860
+
3850
3861
  .block-editor-inserter__media-list,
3851
3862
  .block-editor-block-patterns-list {
3852
3863
  overflow-y: auto;
@@ -1 +1 @@
1
- {"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../src/utils/dom.js"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH,iCALW,OAAO,KACP,OAAO,GAEN,OAAO,CAIlB;AAED;;;;;;;;;GASG;AACH,gDANW,OAAO,WACP,OAAO,GAEN,OAAO,CAQlB;AAED;;;;;;;GAOG;AACH,uCALW,IAAI,OAAC,GAEJ,MAAM,GAAC,SAAS,CAoB3B;AAED;;;;;;GAMG;AACH,iCAJW,OAAO,SACP,OAAO,GACN,OAAO,CASlB;AA8CD;;;;;;;;;;;;;;;GAeG;AACH,iDAHW,OAAO,GACN,OAAO,CAyClB"}
1
+ {"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../src/utils/dom.js"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH,iCALW,OAAO,KACP,OAAO,GAEN,OAAO,CAIlB;AAED;;;;;;;;;GASG;AACH,gDANW,OAAO,WACP,OAAO,GAEN,OAAO,CAQlB;AAED;;;;;;;GAOG;AACH,uCALW,IAAI,OAAC,GAEJ,MAAM,GAAC,SAAS,CAoB3B;AAED;;;;;;GAMG;AACH,iCAJW,OAAO,SACP,OAAO,GACN,OAAO,CASlB;AA8DD;;;;;;;;;;;;;;;GAeG;AACH,iDAHW,OAAO,GACN,OAAO,CA6ClB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-editor",
3
- "version": "14.5.0",
3
+ "version": "14.6.0",
4
4
  "description": "Generic block editor.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -36,36 +36,36 @@
36
36
  "@emotion/react": "^11.7.1",
37
37
  "@emotion/styled": "^11.6.0",
38
38
  "@react-spring/web": "^9.4.5",
39
- "@wordpress/a11y": "^4.10.0",
40
- "@wordpress/api-fetch": "^7.10.0",
41
- "@wordpress/blob": "^4.10.0",
42
- "@wordpress/block-serialization-default-parser": "^5.10.0",
43
- "@wordpress/blocks": "^13.10.0",
44
- "@wordpress/commands": "^1.10.0",
45
- "@wordpress/components": "^28.10.0",
46
- "@wordpress/compose": "^7.10.0",
47
- "@wordpress/data": "^10.10.0",
48
- "@wordpress/date": "^5.10.0",
49
- "@wordpress/deprecated": "^4.10.0",
50
- "@wordpress/dom": "^4.10.0",
51
- "@wordpress/element": "^6.10.0",
52
- "@wordpress/escape-html": "^3.10.0",
53
- "@wordpress/hooks": "^4.10.0",
54
- "@wordpress/html-entities": "^4.10.0",
55
- "@wordpress/i18n": "^5.10.0",
56
- "@wordpress/icons": "^10.10.0",
57
- "@wordpress/is-shallow-equal": "^5.10.0",
58
- "@wordpress/keyboard-shortcuts": "^5.10.0",
59
- "@wordpress/keycodes": "^4.10.0",
60
- "@wordpress/notices": "^5.10.0",
61
- "@wordpress/preferences": "^4.10.0",
62
- "@wordpress/private-apis": "^1.10.0",
63
- "@wordpress/rich-text": "^7.10.0",
64
- "@wordpress/style-engine": "^2.10.0",
65
- "@wordpress/token-list": "^3.10.0",
66
- "@wordpress/url": "^4.10.0",
67
- "@wordpress/warning": "^3.10.0",
68
- "@wordpress/wordcount": "^4.10.0",
39
+ "@wordpress/a11y": "*",
40
+ "@wordpress/api-fetch": "*",
41
+ "@wordpress/blob": "*",
42
+ "@wordpress/block-serialization-default-parser": "*",
43
+ "@wordpress/blocks": "*",
44
+ "@wordpress/commands": "*",
45
+ "@wordpress/components": "*",
46
+ "@wordpress/compose": "*",
47
+ "@wordpress/data": "*",
48
+ "@wordpress/date": "*",
49
+ "@wordpress/deprecated": "*",
50
+ "@wordpress/dom": "*",
51
+ "@wordpress/element": "*",
52
+ "@wordpress/escape-html": "*",
53
+ "@wordpress/hooks": "*",
54
+ "@wordpress/html-entities": "*",
55
+ "@wordpress/i18n": "*",
56
+ "@wordpress/icons": "*",
57
+ "@wordpress/is-shallow-equal": "*",
58
+ "@wordpress/keyboard-shortcuts": "*",
59
+ "@wordpress/keycodes": "*",
60
+ "@wordpress/notices": "*",
61
+ "@wordpress/preferences": "*",
62
+ "@wordpress/private-apis": "*",
63
+ "@wordpress/rich-text": "*",
64
+ "@wordpress/style-engine": "*",
65
+ "@wordpress/token-list": "*",
66
+ "@wordpress/url": "*",
67
+ "@wordpress/warning": "*",
68
+ "@wordpress/wordcount": "*",
69
69
  "change-case": "^4.1.2",
70
70
  "clsx": "^2.1.1",
71
71
  "colord": "^2.7.0",
@@ -88,5 +88,6 @@
88
88
  "publishConfig": {
89
89
  "access": "public"
90
90
  },
91
- "gitHead": "ab34a7ac935fd1478eac63b596242d83270897ee"
91
+ "wpScript": true,
92
+ "gitHead": "dcf4613b33b0eda14e203ac30f700ed0db70347f"
92
93
  }