@wordpress/block-editor 12.17.0 → 12.18.1

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 (421) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +32 -0
  3. package/build/components/block-draggable/index.js +11 -3
  4. package/build/components/block-draggable/index.js.map +1 -1
  5. package/build/components/block-edit/context.js +3 -1
  6. package/build/components/block-edit/context.js.map +1 -1
  7. package/build/components/block-edit/index.js +4 -2
  8. package/build/components/block-edit/index.js.map +1 -1
  9. package/build/components/block-editing-mode/index.js +6 -3
  10. package/build/components/block-editing-mode/index.js.map +1 -1
  11. package/build/components/block-inspector/index.js +5 -2
  12. package/build/components/block-inspector/index.js.map +1 -1
  13. package/build/components/block-list/block.js +4 -3
  14. package/build/components/block-list/block.js.map +1 -1
  15. package/build/components/block-list/block.native.js +9 -5
  16. package/build/components/block-list/block.native.js.map +1 -1
  17. package/build/components/block-list/index.js +30 -4
  18. package/build/components/block-list/index.js.map +1 -1
  19. package/build/components/block-list/private-block-context.js +1 -1
  20. package/build/components/block-list/private-block-context.js.map +1 -1
  21. package/build/components/block-list/use-in-between-inserter.js +1 -1
  22. package/build/components/block-list/use-in-between-inserter.js.map +1 -1
  23. package/build/components/block-lock/toolbar.js +8 -2
  24. package/build/components/block-lock/toolbar.js.map +1 -1
  25. package/build/components/block-popover/inbetween.js +15 -3
  26. package/build/components/block-popover/inbetween.js.map +1 -1
  27. package/build/components/block-preview/auto.js +1 -1
  28. package/build/components/block-preview/auto.js.map +1 -1
  29. package/build/components/block-removal-warning-modal/index.js +3 -2
  30. package/build/components/block-removal-warning-modal/index.js.map +1 -1
  31. package/build/components/block-settings-menu/block-settings-dropdown.js +2 -4
  32. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  33. package/build/components/block-switcher/block-transformations-menu.js +12 -1
  34. package/build/components/block-switcher/block-transformations-menu.js.map +1 -1
  35. package/build/components/block-switcher/index.js +119 -90
  36. package/build/components/block-switcher/index.js.map +1 -1
  37. package/build/components/block-tools/insertion-point.js +10 -3
  38. package/build/components/block-tools/insertion-point.js.map +1 -1
  39. package/build/components/dimensions-tool/aspect-ratio-tool.js +2 -1
  40. package/build/components/dimensions-tool/aspect-ratio-tool.js.map +1 -1
  41. package/build/components/font-sizes/fluid-utils.js +7 -1
  42. package/build/components/font-sizes/fluid-utils.js.map +1 -1
  43. package/build/components/global-styles/border-panel.js +5 -14
  44. package/build/components/global-styles/border-panel.js.map +1 -1
  45. package/build/components/global-styles/dimensions-panel.js +30 -5
  46. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  47. package/build/components/global-styles/effects-panel.js +7 -1
  48. package/build/components/global-styles/effects-panel.js.map +1 -1
  49. package/build/components/global-styles/hooks.js +11 -8
  50. package/build/components/global-styles/hooks.js.map +1 -1
  51. package/build/components/global-styles/typography-panel.js +31 -14
  52. package/build/components/global-styles/typography-panel.js.map +1 -1
  53. package/build/components/global-styles/use-global-styles-output.js +6 -0
  54. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  55. package/build/components/iframe/get-compatibility-styles.js +99 -0
  56. package/build/components/iframe/get-compatibility-styles.js.map +1 -0
  57. package/build/components/iframe/index.js +2 -3
  58. package/build/components/iframe/index.js.map +1 -1
  59. package/build/components/index.js +16 -2
  60. package/build/components/index.js.map +1 -1
  61. package/build/components/index.native.js +16 -2
  62. package/build/components/index.native.js.map +1 -1
  63. package/build/components/inspector-controls/groups.js +2 -0
  64. package/build/components/inspector-controls/groups.js.map +1 -1
  65. package/build/components/inspector-controls-tabs/styles-tab.js +3 -0
  66. package/build/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  67. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js +3 -2
  68. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
  69. package/build/components/link-control/link-preview.js +30 -26
  70. package/build/components/link-control/link-preview.js.map +1 -1
  71. package/build/components/link-control/search-input.js +1 -9
  72. package/build/components/link-control/search-input.js.map +1 -1
  73. package/build/components/list-view/block-contents.js +3 -1
  74. package/build/components/list-view/block-contents.js.map +1 -1
  75. package/build/components/list-view/block.js +10 -1
  76. package/build/components/list-view/block.js.map +1 -1
  77. package/build/components/list-view/branch.js +29 -8
  78. package/build/components/list-view/branch.js.map +1 -1
  79. package/build/components/list-view/drop-indicator.js +100 -32
  80. package/build/components/list-view/drop-indicator.js.map +1 -1
  81. package/build/components/list-view/index.js +52 -4
  82. package/build/components/list-view/index.js.map +1 -1
  83. package/build/components/list-view/leaf.js +2 -2
  84. package/build/components/list-view/leaf.js.map +1 -1
  85. package/build/components/list-view/use-list-view-block-indexes.js +30 -0
  86. package/build/components/list-view/use-list-view-block-indexes.js.map +1 -0
  87. package/build/components/list-view/use-list-view-drop-zone.js +56 -5
  88. package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
  89. package/build/components/list-view/utils.js +92 -0
  90. package/build/components/list-view/utils.js.map +1 -1
  91. package/build/components/provider/index.js +1 -1
  92. package/build/components/provider/index.js.map +1 -1
  93. package/build/components/recursion-provider/index.js +21 -0
  94. package/build/components/recursion-provider/index.js.map +1 -1
  95. package/build/components/rich-text/index.js +30 -6
  96. package/build/components/rich-text/index.js.map +1 -1
  97. package/build/components/rich-text/native/index.native.js +9 -9
  98. package/build/components/rich-text/native/index.native.js.map +1 -1
  99. package/build/components/use-block-drop-zone/index.js +30 -7
  100. package/build/components/use-block-drop-zone/index.js.map +1 -1
  101. package/build/components/use-on-block-drop/index.js +50 -8
  102. package/build/components/use-on-block-drop/index.js.map +1 -1
  103. package/build/hooks/block-hooks.js +5 -14
  104. package/build/hooks/block-hooks.js.map +1 -1
  105. package/build/hooks/content-lock-ui.js +17 -42
  106. package/build/hooks/content-lock-ui.js.map +1 -1
  107. package/build/hooks/dimensions.js +71 -1
  108. package/build/hooks/dimensions.js.map +1 -1
  109. package/build/hooks/effects.js +66 -0
  110. package/build/hooks/effects.js.map +1 -0
  111. package/build/hooks/index.js +17 -4
  112. package/build/hooks/index.js.map +1 -1
  113. package/build/hooks/index.native.js +13 -0
  114. package/build/hooks/index.native.js.map +1 -1
  115. package/build/hooks/style.js +9 -2
  116. package/build/hooks/style.js.map +1 -1
  117. package/build/hooks/supports.js +2 -1
  118. package/build/hooks/supports.js.map +1 -1
  119. package/build/hooks/typography.native.js +2 -2
  120. package/build/hooks/typography.native.js.map +1 -1
  121. package/build/hooks/use-bindings-attributes.js +115 -0
  122. package/build/hooks/use-bindings-attributes.js.map +1 -0
  123. package/build/hooks/use-shadow-props.js +46 -0
  124. package/build/hooks/use-shadow-props.js.map +1 -0
  125. package/build/hooks/utils.js +12 -7
  126. package/build/hooks/utils.js.map +1 -1
  127. package/build/index.js +14 -0
  128. package/build/index.js.map +1 -1
  129. package/build/store/actions.js +10 -6
  130. package/build/store/actions.js.map +1 -1
  131. package/build/store/index.js +2 -0
  132. package/build/store/index.js.map +1 -1
  133. package/build/store/private-actions.js +37 -0
  134. package/build/store/private-actions.js.map +1 -1
  135. package/build/store/private-selectors.js +60 -9
  136. package/build/store/private-selectors.js.map +1 -1
  137. package/build/store/reducer.js +44 -3
  138. package/build/store/reducer.js.map +1 -1
  139. package/build/store/resolvers.js +27 -0
  140. package/build/store/resolvers.js.map +1 -0
  141. package/build/store/selectors.js +94 -56
  142. package/build/store/selectors.js.map +1 -1
  143. package/build/store/utils.js +5 -26
  144. package/build/store/utils.js.map +1 -1
  145. package/build/utils/index.js +0 -16
  146. package/build/utils/index.js.map +1 -1
  147. package/build/utils/math.js +13 -0
  148. package/build/utils/math.js.map +1 -1
  149. package/build/utils/object.js +17 -0
  150. package/build/utils/object.js.map +1 -1
  151. package/build/utils/transform-styles/index.js +37 -27
  152. package/build/utils/transform-styles/index.js.map +1 -1
  153. package/build-module/components/block-draggable/index.js +11 -3
  154. package/build-module/components/block-draggable/index.js.map +1 -1
  155. package/build-module/components/block-edit/context.js +1 -0
  156. package/build-module/components/block-edit/context.js.map +1 -1
  157. package/build-module/components/block-edit/index.js +5 -3
  158. package/build-module/components/block-edit/index.js.map +1 -1
  159. package/build-module/components/block-editing-mode/index.js +7 -4
  160. package/build-module/components/block-editing-mode/index.js.map +1 -1
  161. package/build-module/components/block-inspector/index.js +5 -2
  162. package/build-module/components/block-inspector/index.js.map +1 -1
  163. package/build-module/components/block-list/block.js +6 -5
  164. package/build-module/components/block-list/block.js.map +1 -1
  165. package/build-module/components/block-list/block.native.js +11 -7
  166. package/build-module/components/block-list/block.native.js.map +1 -1
  167. package/build-module/components/block-list/index.js +31 -5
  168. package/build-module/components/block-list/index.js.map +1 -1
  169. package/build-module/components/block-list/private-block-context.js +1 -1
  170. package/build-module/components/block-list/private-block-context.js.map +1 -1
  171. package/build-module/components/block-list/use-in-between-inserter.js +1 -1
  172. package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
  173. package/build-module/components/block-lock/toolbar.js +8 -2
  174. package/build-module/components/block-lock/toolbar.js.map +1 -1
  175. package/build-module/components/block-popover/inbetween.js +15 -3
  176. package/build-module/components/block-popover/inbetween.js.map +1 -1
  177. package/build-module/components/block-preview/auto.js +3 -3
  178. package/build-module/components/block-preview/auto.js.map +1 -1
  179. package/build-module/components/block-removal-warning-modal/index.js +3 -2
  180. package/build-module/components/block-removal-warning-modal/index.js.map +1 -1
  181. package/build-module/components/block-settings-menu/block-settings-dropdown.js +2 -4
  182. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  183. package/build-module/components/block-switcher/block-transformations-menu.js +12 -1
  184. package/build-module/components/block-switcher/block-transformations-menu.js.map +1 -1
  185. package/build-module/components/block-switcher/index.js +116 -86
  186. package/build-module/components/block-switcher/index.js.map +1 -1
  187. package/build-module/components/block-tools/insertion-point.js +10 -3
  188. package/build-module/components/block-tools/insertion-point.js.map +1 -1
  189. package/build-module/components/dimensions-tool/aspect-ratio-tool.js +2 -1
  190. package/build-module/components/dimensions-tool/aspect-ratio-tool.js.map +1 -1
  191. package/build-module/components/font-sizes/fluid-utils.js +7 -1
  192. package/build-module/components/font-sizes/fluid-utils.js.map +1 -1
  193. package/build-module/components/global-styles/border-panel.js +5 -14
  194. package/build-module/components/global-styles/border-panel.js.map +1 -1
  195. package/build-module/components/global-styles/dimensions-panel.js +30 -5
  196. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  197. package/build-module/components/global-styles/effects-panel.js +7 -1
  198. package/build-module/components/global-styles/effects-panel.js.map +1 -1
  199. package/build-module/components/global-styles/hooks.js +11 -8
  200. package/build-module/components/global-styles/hooks.js.map +1 -1
  201. package/build-module/components/global-styles/typography-panel.js +32 -15
  202. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  203. package/build-module/components/global-styles/use-global-styles-output.js +6 -0
  204. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  205. package/build-module/components/iframe/get-compatibility-styles.js +93 -0
  206. package/build-module/components/iframe/get-compatibility-styles.js.map +1 -0
  207. package/build-module/components/iframe/index.js +2 -3
  208. package/build-module/components/iframe/index.js.map +1 -1
  209. package/build-module/components/index.js +1 -1
  210. package/build-module/components/index.js.map +1 -1
  211. package/build-module/components/index.native.js +1 -1
  212. package/build-module/components/index.native.js.map +1 -1
  213. package/build-module/components/inspector-controls/groups.js +2 -0
  214. package/build-module/components/inspector-controls/groups.js.map +1 -1
  215. package/build-module/components/inspector-controls-tabs/styles-tab.js +3 -0
  216. package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  217. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js +3 -2
  218. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
  219. package/build-module/components/link-control/link-preview.js +32 -28
  220. package/build-module/components/link-control/link-preview.js.map +1 -1
  221. package/build-module/components/link-control/search-input.js +1 -8
  222. package/build-module/components/link-control/search-input.js.map +1 -1
  223. package/build-module/components/list-view/block-contents.js +3 -1
  224. package/build-module/components/list-view/block-contents.js.map +1 -1
  225. package/build-module/components/list-view/block.js +10 -1
  226. package/build-module/components/list-view/block.js.map +1 -1
  227. package/build-module/components/list-view/branch.js +30 -9
  228. package/build-module/components/list-view/branch.js.map +1 -1
  229. package/build-module/components/list-view/drop-indicator.js +99 -32
  230. package/build-module/components/list-view/drop-indicator.js.map +1 -1
  231. package/build-module/components/list-view/index.js +54 -6
  232. package/build-module/components/list-view/index.js.map +1 -1
  233. package/build-module/components/list-view/leaf.js +2 -2
  234. package/build-module/components/list-view/leaf.js.map +1 -1
  235. package/build-module/components/list-view/use-list-view-block-indexes.js +23 -0
  236. package/build-module/components/list-view/use-list-view-block-indexes.js.map +1 -0
  237. package/build-module/components/list-view/use-list-view-drop-zone.js +58 -7
  238. package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
  239. package/build-module/components/list-view/utils.js +91 -0
  240. package/build-module/components/list-view/utils.js.map +1 -1
  241. package/build-module/components/provider/index.js +1 -1
  242. package/build-module/components/provider/index.js.map +1 -1
  243. package/build-module/components/recursion-provider/index.js +17 -0
  244. package/build-module/components/recursion-provider/index.js.map +1 -1
  245. package/build-module/components/rich-text/index.js +30 -6
  246. package/build-module/components/rich-text/index.js.map +1 -1
  247. package/build-module/components/rich-text/native/index.native.js +9 -9
  248. package/build-module/components/rich-text/native/index.native.js.map +1 -1
  249. package/build-module/components/use-block-drop-zone/index.js +31 -8
  250. package/build-module/components/use-block-drop-zone/index.js.map +1 -1
  251. package/build-module/components/use-on-block-drop/index.js +51 -9
  252. package/build-module/components/use-on-block-drop/index.js.map +1 -1
  253. package/build-module/hooks/block-hooks.js +5 -14
  254. package/build-module/hooks/block-hooks.js.map +1 -1
  255. package/build-module/hooks/content-lock-ui.js +19 -43
  256. package/build-module/hooks/content-lock-ui.js.map +1 -1
  257. package/build-module/hooks/dimensions.js +70 -2
  258. package/build-module/hooks/dimensions.js.map +1 -1
  259. package/build-module/hooks/effects.js +51 -0
  260. package/build-module/hooks/effects.js.map +1 -0
  261. package/build-module/hooks/index.js +5 -3
  262. package/build-module/hooks/index.js.map +1 -1
  263. package/build-module/hooks/index.native.js +1 -0
  264. package/build-module/hooks/index.native.js.map +1 -1
  265. package/build-module/hooks/style.js +9 -2
  266. package/build-module/hooks/style.js.map +1 -1
  267. package/build-module/hooks/supports.js +2 -1
  268. package/build-module/hooks/supports.js.map +1 -1
  269. package/build-module/hooks/typography.native.js +2 -2
  270. package/build-module/hooks/typography.native.js.map +1 -1
  271. package/build-module/hooks/use-bindings-attributes.js +112 -0
  272. package/build-module/hooks/use-bindings-attributes.js.map +1 -0
  273. package/build-module/hooks/use-shadow-props.js +39 -0
  274. package/build-module/hooks/use-shadow-props.js.map +1 -0
  275. package/build-module/hooks/utils.js +14 -9
  276. package/build-module/hooks/utils.js.map +1 -1
  277. package/build-module/index.js +1 -1
  278. package/build-module/index.js.map +1 -1
  279. package/build-module/store/actions.js +10 -6
  280. package/build-module/store/actions.js.map +1 -1
  281. package/build-module/store/index.js +2 -0
  282. package/build-module/store/index.js.map +1 -1
  283. package/build-module/store/private-actions.js +35 -0
  284. package/build-module/store/private-actions.js.map +1 -1
  285. package/build-module/store/private-selectors.js +53 -8
  286. package/build-module/store/private-selectors.js.map +1 -1
  287. package/build-module/store/reducer.js +43 -3
  288. package/build-module/store/reducer.js.map +1 -1
  289. package/build-module/store/resolvers.js +20 -0
  290. package/build-module/store/resolvers.js.map +1 -0
  291. package/build-module/store/selectors.js +89 -52
  292. package/build-module/store/selectors.js.map +1 -1
  293. package/build-module/store/utils.js +3 -23
  294. package/build-module/store/utils.js.map +1 -1
  295. package/build-module/utils/index.js +0 -1
  296. package/build-module/utils/index.js.map +1 -1
  297. package/build-module/utils/math.js +12 -0
  298. package/build-module/utils/math.js.map +1 -1
  299. package/build-module/utils/object.js +16 -0
  300. package/build-module/utils/object.js.map +1 -1
  301. package/build-module/utils/transform-styles/index.js +36 -27
  302. package/build-module/utils/transform-styles/index.js.map +1 -1
  303. package/build-style/content-rtl.css +33 -16
  304. package/build-style/content.css +33 -16
  305. package/build-style/default-editor-styles-rtl.css +1 -1
  306. package/build-style/default-editor-styles.css +1 -1
  307. package/build-style/style-rtl.css +169 -114
  308. package/build-style/style.css +169 -114
  309. package/package.json +31 -31
  310. package/src/components/block-canvas/style.scss +8 -1
  311. package/src/components/block-draggable/index.js +16 -5
  312. package/src/components/block-edit/context.js +1 -0
  313. package/src/components/block-edit/index.js +4 -0
  314. package/src/components/block-editing-mode/index.js +12 -7
  315. package/src/components/block-inspector/index.js +5 -2
  316. package/src/components/block-list/block.js +5 -4
  317. package/src/components/block-list/block.native.js +13 -3
  318. package/src/components/block-list/content.scss +34 -5
  319. package/src/components/block-list/index.js +52 -16
  320. package/src/components/block-list/private-block-context.js +1 -1
  321. package/src/components/block-list/use-in-between-inserter.js +1 -2
  322. package/src/components/block-lock/toolbar.js +10 -2
  323. package/src/components/block-popover/inbetween.js +22 -2
  324. package/src/components/block-preview/auto.js +3 -3
  325. package/src/components/block-removal-warning-modal/index.js +3 -2
  326. package/src/components/block-settings-menu/block-settings-dropdown.js +2 -7
  327. package/src/components/block-switcher/block-transformations-menu.js +18 -1
  328. package/src/components/block-switcher/index.js +133 -111
  329. package/src/components/block-switcher/style.scss +6 -4
  330. package/src/components/block-switcher/test/index.js +113 -230
  331. package/src/components/block-toolbar/style.scss +22 -18
  332. package/src/components/block-tools/insertion-point.js +15 -2
  333. package/src/components/block-tools/style.scss +8 -7
  334. package/src/components/dimensions-tool/aspect-ratio-tool.js +4 -1
  335. package/src/components/font-sizes/fluid-utils.js +8 -2
  336. package/src/components/font-sizes/test/fluid-utils.js +9 -0
  337. package/src/components/global-styles/border-panel.js +7 -17
  338. package/src/components/global-styles/dimensions-panel.js +50 -1
  339. package/src/components/global-styles/effects-panel.js +16 -1
  340. package/src/components/global-styles/hooks.js +11 -6
  341. package/src/components/global-styles/typography-panel.js +45 -13
  342. package/src/components/global-styles/use-global-styles-output.js +6 -0
  343. package/src/components/iframe/get-compatibility-styles.js +120 -0
  344. package/src/components/iframe/index.js +2 -3
  345. package/src/components/index.js +4 -2
  346. package/src/components/index.native.js +4 -2
  347. package/src/components/inspector-controls/groups.js +2 -0
  348. package/src/components/inspector-controls-tabs/styles-tab.js +1 -0
  349. package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +2 -0
  350. package/src/components/link-control/link-preview.js +31 -55
  351. package/src/components/link-control/search-input.js +1 -9
  352. package/src/components/link-control/style.scss +31 -85
  353. package/src/components/link-control/test/index.js +2 -1
  354. package/src/components/list-view/block-contents.js +5 -1
  355. package/src/components/list-view/block.js +9 -0
  356. package/src/components/list-view/branch.js +30 -10
  357. package/src/components/list-view/drop-indicator.js +139 -46
  358. package/src/components/list-view/index.js +74 -3
  359. package/src/components/list-view/leaf.js +2 -2
  360. package/src/components/list-view/style.scss +102 -13
  361. package/src/components/list-view/test/use-list-view-drop-zone.js +4 -0
  362. package/src/components/list-view/test/utils.js +218 -1
  363. package/src/components/list-view/use-list-view-block-indexes.js +29 -0
  364. package/src/components/list-view/use-list-view-drop-zone.js +78 -6
  365. package/src/components/list-view/utils.js +116 -0
  366. package/src/components/provider/index.js +3 -1
  367. package/src/components/recursion-provider/README.md +2 -2
  368. package/src/components/recursion-provider/index.js +17 -0
  369. package/src/components/rich-text/index.js +48 -10
  370. package/src/components/rich-text/native/index.native.js +10 -10
  371. package/src/components/use-block-drop-zone/index.js +60 -19
  372. package/src/components/use-block-drop-zone/test/index.js +32 -61
  373. package/src/components/use-on-block-drop/index.js +92 -11
  374. package/src/hooks/block-hooks.js +5 -17
  375. package/src/hooks/content-lock-ui.js +15 -55
  376. package/src/hooks/dimensions.js +74 -3
  377. package/src/hooks/effects.js +57 -0
  378. package/src/hooks/index.js +4 -2
  379. package/src/hooks/index.native.js +1 -0
  380. package/src/hooks/style.js +12 -0
  381. package/src/hooks/supports.js +2 -0
  382. package/src/hooks/test/effects.js +39 -0
  383. package/src/hooks/typography.native.js +2 -2
  384. package/src/hooks/use-bindings-attributes.js +148 -0
  385. package/src/hooks/use-shadow-props.js +37 -0
  386. package/src/hooks/utils.js +30 -10
  387. package/src/index.js +2 -0
  388. package/src/store/actions.js +9 -4
  389. package/src/store/index.js +2 -0
  390. package/src/store/private-actions.js +32 -0
  391. package/src/store/private-selectors.js +78 -21
  392. package/src/store/reducer.js +49 -2
  393. package/src/store/resolvers.js +17 -0
  394. package/src/store/selectors.js +169 -161
  395. package/src/store/test/registry-selectors.js +431 -0
  396. package/src/store/test/selectors.js +14 -400
  397. package/src/store/utils.js +10 -33
  398. package/src/style.scss +0 -1
  399. package/src/utils/index.js +0 -1
  400. package/src/utils/math.js +12 -0
  401. package/src/utils/object.js +16 -0
  402. package/src/utils/transform-styles/index.js +52 -37
  403. package/tsconfig.tsbuildinfo +1 -1
  404. package/build/components/iframe/use-compatibility-styles.js +0 -100
  405. package/build/components/iframe/use-compatibility-styles.js.map +0 -1
  406. package/build/hooks/custom-fields.js +0 -106
  407. package/build/hooks/custom-fields.js.map +0 -1
  408. package/build/utils/block-variation-transforms.js +0 -42
  409. package/build/utils/block-variation-transforms.js.map +0 -1
  410. package/build-module/components/iframe/use-compatibility-styles.js +0 -94
  411. package/build-module/components/iframe/use-compatibility-styles.js.map +0 -1
  412. package/build-module/hooks/custom-fields.js +0 -99
  413. package/build-module/hooks/custom-fields.js.map +0 -1
  414. package/build-module/utils/block-variation-transforms.js +0 -35
  415. package/build-module/utils/block-variation-transforms.js.map +0 -1
  416. package/src/components/block-switcher/test/__snapshots__/index.js.snap +0 -116
  417. package/src/components/contrast-checker/style.scss +0 -3
  418. package/src/components/iframe/use-compatibility-styles.js +0 -122
  419. package/src/hooks/custom-fields.js +0 -115
  420. package/src/utils/block-variation-transforms.js +0 -38
  421. package/src/utils/test/block-variation-transforms.js +0 -94
@@ -1,26 +1,3 @@
1
- /**
2
- * Internal dependencies
3
- */
4
- import { INSERTER_PATTERN_TYPES } from '../components/inserter/block-patterns-tab/utils';
5
- const EMPTY_ARRAY = [];
6
- export function getUserPatterns(state) {
7
- var _state$settings$__exp, _state$settings$__exp2;
8
- const userPatterns = (_state$settings$__exp = state?.settings?.__experimentalReusableBlocks) !== null && _state$settings$__exp !== void 0 ? _state$settings$__exp : EMPTY_ARRAY;
9
- const userPatternCategories = (_state$settings$__exp2 = state?.settings?.__experimentalUserPatternCategories) !== null && _state$settings$__exp2 !== void 0 ? _state$settings$__exp2 : [];
10
- const categories = new Map();
11
- userPatternCategories.forEach(userCategory => categories.set(userCategory.id, userCategory));
12
- return userPatterns.map(userPattern => {
13
- return {
14
- name: `core/block/${userPattern.id}`,
15
- id: userPattern.id,
16
- type: INSERTER_PATTERN_TYPES.user,
17
- title: userPattern.title.raw,
18
- categories: userPattern.wp_pattern_category.map(catId => categories && categories.get(catId) ? categories.get(catId).slug : catId),
19
- content: userPattern.content.raw,
20
- syncStatus: userPattern.wp_pattern_sync_status
21
- };
22
- });
23
- }
24
1
  export const checkAllowList = (list, item, defaultResult = null) => {
25
2
  if (typeof list === 'boolean') {
26
3
  return list;
@@ -53,4 +30,7 @@ export const checkAllowListRecursive = (blocks, allowedBlockTypes) => {
53
30
  }
54
31
  return true;
55
32
  };
33
+ export const getAllPatternsDependants = state => {
34
+ return [state.settings.__experimentalBlockPatterns, state.settings.__experimentalUserPatternCategories, state.settings.__experimentalReusableBlocks, state.settings.__experimentalFetchBlockPatterns, state.blockPatterns];
35
+ };
56
36
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["INSERTER_PATTERN_TYPES","EMPTY_ARRAY","getUserPatterns","state","_state$settings$__exp","_state$settings$__exp2","userPatterns","settings","__experimentalReusableBlocks","userPatternCategories","__experimentalUserPatternCategories","categories","Map","forEach","userCategory","set","id","map","userPattern","name","type","user","title","raw","wp_pattern_category","catId","get","slug","content","syncStatus","wp_pattern_sync_status","checkAllowList","list","item","defaultResult","Array","isArray","includes","checkAllowListRecursive","blocks","allowedBlockTypes","blocksQueue","length","block","shift","isAllowed","blockName","innerBlocks","innerBlock","push"],"sources":["@wordpress/block-editor/src/store/utils.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { INSERTER_PATTERN_TYPES } from '../components/inserter/block-patterns-tab/utils';\n\nconst EMPTY_ARRAY = [];\n\nexport function getUserPatterns( state ) {\n\tconst userPatterns =\n\t\tstate?.settings?.__experimentalReusableBlocks ?? EMPTY_ARRAY;\n\tconst userPatternCategories =\n\t\tstate?.settings?.__experimentalUserPatternCategories ?? [];\n\tconst categories = new Map();\n\tuserPatternCategories.forEach( ( userCategory ) =>\n\t\tcategories.set( userCategory.id, userCategory )\n\t);\n\treturn userPatterns.map( ( userPattern ) => {\n\t\treturn {\n\t\t\tname: `core/block/${ userPattern.id }`,\n\t\t\tid: userPattern.id,\n\t\t\ttype: INSERTER_PATTERN_TYPES.user,\n\t\t\ttitle: userPattern.title.raw,\n\t\t\tcategories: userPattern.wp_pattern_category.map( ( catId ) =>\n\t\t\t\tcategories && categories.get( catId )\n\t\t\t\t\t? categories.get( catId ).slug\n\t\t\t\t\t: catId\n\t\t\t),\n\t\t\tcontent: userPattern.content.raw,\n\t\t\tsyncStatus: userPattern.wp_pattern_sync_status,\n\t\t};\n\t} );\n}\n\nexport const checkAllowList = ( list, item, defaultResult = null ) => {\n\tif ( typeof list === 'boolean' ) {\n\t\treturn list;\n\t}\n\tif ( Array.isArray( list ) ) {\n\t\t// TODO: when there is a canonical way to detect that we are editing a post\n\t\t// the following check should be changed to something like:\n\t\t// if ( list.includes( 'core/post-content' ) && getEditorMode() === 'post-content' && item === null )\n\t\tif ( list.includes( 'core/post-content' ) && item === null ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn list.includes( item );\n\t}\n\treturn defaultResult;\n};\n\nexport const checkAllowListRecursive = ( blocks, allowedBlockTypes ) => {\n\tif ( typeof allowedBlockTypes === 'boolean' ) {\n\t\treturn allowedBlockTypes;\n\t}\n\n\tconst blocksQueue = [ ...blocks ];\n\twhile ( blocksQueue.length > 0 ) {\n\t\tconst block = blocksQueue.shift();\n\n\t\tconst isAllowed = checkAllowList(\n\t\t\tallowedBlockTypes,\n\t\t\tblock.name || block.blockName,\n\t\t\ttrue\n\t\t);\n\t\tif ( ! isAllowed ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tblock.innerBlocks?.forEach( ( innerBlock ) => {\n\t\t\tblocksQueue.push( innerBlock );\n\t\t} );\n\t}\n\n\treturn true;\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,sBAAsB,QAAQ,iDAAiD;AAExF,MAAMC,WAAW,GAAG,EAAE;AAEtB,OAAO,SAASC,eAAeA,CAAEC,KAAK,EAAG;EAAA,IAAAC,qBAAA,EAAAC,sBAAA;EACxC,MAAMC,YAAY,IAAAF,qBAAA,GACjBD,KAAK,EAAEI,QAAQ,EAAEC,4BAA4B,cAAAJ,qBAAA,cAAAA,qBAAA,GAAIH,WAAW;EAC7D,MAAMQ,qBAAqB,IAAAJ,sBAAA,GAC1BF,KAAK,EAAEI,QAAQ,EAAEG,mCAAmC,cAAAL,sBAAA,cAAAA,sBAAA,GAAI,EAAE;EAC3D,MAAMM,UAAU,GAAG,IAAIC,GAAG,CAAC,CAAC;EAC5BH,qBAAqB,CAACI,OAAO,CAAIC,YAAY,IAC5CH,UAAU,CAACI,GAAG,CAAED,YAAY,CAACE,EAAE,EAAEF,YAAa,CAC/C,CAAC;EACD,OAAOR,YAAY,CAACW,GAAG,CAAIC,WAAW,IAAM;IAC3C,OAAO;MACNC,IAAI,EAAG,cAAcD,WAAW,CAACF,EAAI,EAAC;MACtCA,EAAE,EAAEE,WAAW,CAACF,EAAE;MAClBI,IAAI,EAAEpB,sBAAsB,CAACqB,IAAI;MACjCC,KAAK,EAAEJ,WAAW,CAACI,KAAK,CAACC,GAAG;MAC5BZ,UAAU,EAAEO,WAAW,CAACM,mBAAmB,CAACP,GAAG,CAAIQ,KAAK,IACvDd,UAAU,IAAIA,UAAU,CAACe,GAAG,CAAED,KAAM,CAAC,GAClCd,UAAU,CAACe,GAAG,CAAED,KAAM,CAAC,CAACE,IAAI,GAC5BF,KACJ,CAAC;MACDG,OAAO,EAAEV,WAAW,CAACU,OAAO,CAACL,GAAG;MAChCM,UAAU,EAAEX,WAAW,CAACY;IACzB,CAAC;EACF,CAAE,CAAC;AACJ;AAEA,OAAO,MAAMC,cAAc,GAAGA,CAAEC,IAAI,EAAEC,IAAI,EAAEC,aAAa,GAAG,IAAI,KAAM;EACrE,IAAK,OAAOF,IAAI,KAAK,SAAS,EAAG;IAChC,OAAOA,IAAI;EACZ;EACA,IAAKG,KAAK,CAACC,OAAO,CAAEJ,IAAK,CAAC,EAAG;IAC5B;IACA;IACA;IACA,IAAKA,IAAI,CAACK,QAAQ,CAAE,mBAAoB,CAAC,IAAIJ,IAAI,KAAK,IAAI,EAAG;MAC5D,OAAO,IAAI;IACZ;IACA,OAAOD,IAAI,CAACK,QAAQ,CAAEJ,IAAK,CAAC;EAC7B;EACA,OAAOC,aAAa;AACrB,CAAC;AAED,OAAO,MAAMI,uBAAuB,GAAGA,CAAEC,MAAM,EAAEC,iBAAiB,KAAM;EACvE,IAAK,OAAOA,iBAAiB,KAAK,SAAS,EAAG;IAC7C,OAAOA,iBAAiB;EACzB;EAEA,MAAMC,WAAW,GAAG,CAAE,GAAGF,MAAM,CAAE;EACjC,OAAQE,WAAW,CAACC,MAAM,GAAG,CAAC,EAAG;IAChC,MAAMC,KAAK,GAAGF,WAAW,CAACG,KAAK,CAAC,CAAC;IAEjC,MAAMC,SAAS,GAAGd,cAAc,CAC/BS,iBAAiB,EACjBG,KAAK,CAACxB,IAAI,IAAIwB,KAAK,CAACG,SAAS,EAC7B,IACD,CAAC;IACD,IAAK,CAAED,SAAS,EAAG;MAClB,OAAO,KAAK;IACb;IAEAF,KAAK,CAACI,WAAW,EAAElC,OAAO,CAAImC,UAAU,IAAM;MAC7CP,WAAW,CAACQ,IAAI,CAAED,UAAW,CAAC;IAC/B,CAAE,CAAC;EACJ;EAEA,OAAO,IAAI;AACZ,CAAC"}
1
+ {"version":3,"names":["checkAllowList","list","item","defaultResult","Array","isArray","includes","checkAllowListRecursive","blocks","allowedBlockTypes","blocksQueue","length","block","shift","isAllowed","name","blockName","innerBlocks","forEach","innerBlock","push","getAllPatternsDependants","state","settings","__experimentalBlockPatterns","__experimentalUserPatternCategories","__experimentalReusableBlocks","__experimentalFetchBlockPatterns","blockPatterns"],"sources":["@wordpress/block-editor/src/store/utils.js"],"sourcesContent":["export const checkAllowList = ( list, item, defaultResult = null ) => {\n\tif ( typeof list === 'boolean' ) {\n\t\treturn list;\n\t}\n\tif ( Array.isArray( list ) ) {\n\t\t// TODO: when there is a canonical way to detect that we are editing a post\n\t\t// the following check should be changed to something like:\n\t\t// if ( list.includes( 'core/post-content' ) && getEditorMode() === 'post-content' && item === null )\n\t\tif ( list.includes( 'core/post-content' ) && item === null ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn list.includes( item );\n\t}\n\treturn defaultResult;\n};\n\nexport const checkAllowListRecursive = ( blocks, allowedBlockTypes ) => {\n\tif ( typeof allowedBlockTypes === 'boolean' ) {\n\t\treturn allowedBlockTypes;\n\t}\n\n\tconst blocksQueue = [ ...blocks ];\n\twhile ( blocksQueue.length > 0 ) {\n\t\tconst block = blocksQueue.shift();\n\n\t\tconst isAllowed = checkAllowList(\n\t\t\tallowedBlockTypes,\n\t\t\tblock.name || block.blockName,\n\t\t\ttrue\n\t\t);\n\t\tif ( ! isAllowed ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tblock.innerBlocks?.forEach( ( innerBlock ) => {\n\t\t\tblocksQueue.push( innerBlock );\n\t\t} );\n\t}\n\n\treturn true;\n};\n\nexport const getAllPatternsDependants = ( state ) => {\n\treturn [\n\t\tstate.settings.__experimentalBlockPatterns,\n\t\tstate.settings.__experimentalUserPatternCategories,\n\t\tstate.settings.__experimentalReusableBlocks,\n\t\tstate.settings.__experimentalFetchBlockPatterns,\n\t\tstate.blockPatterns,\n\t];\n};\n"],"mappings":"AAAA,OAAO,MAAMA,cAAc,GAAGA,CAAEC,IAAI,EAAEC,IAAI,EAAEC,aAAa,GAAG,I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nB;AACF,CAAC"}
@@ -1,4 +1,3 @@
1
1
  export { default as transformStyles } from './transform-styles';
2
- export * from './block-variation-transforms';
3
2
  export { default as getPxFromCssUnit } from './get-px-from-css-unit';
4
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["default","transformStyles","getPxFromCssUnit"],"sources":["@wordpress/block-editor/src/utils/index.js"],"sourcesContent":["export { default as transformStyles } from './transform-styles';\nexport * from './block-variation-transforms';\nexport { default as getPxFromCssUnit } from './get-px-from-css-unit';\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,eAAe,QAAQ,oBAAoB;AAC/D,cAAc,8BAA8B;AAC5C,SAASD,OAAO,IAAIE,gBAAgB,QAAQ,wBAAwB"}
1
+ {"version":3,"names":["default","transformStyles","getPxFromCssUnit"],"sources":["@wordpress/block-editor/src/utils/index.js"],"sourcesContent":["export { default as transformStyles } from './transform-styles';\nexport { default as getPxFromCssUnit } from './get-px-from-css-unit';\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,eAAe,QAAQ,oBAAoB;AAC/D,SAASD,OAAO,IAAIE,gBAAgB,QAAQ,wBAAwB"}
@@ -90,4 +90,16 @@ export function getDistanceToNearestEdge(point, rect, allowedEdges = ['top', 'bo
90
90
  export function isPointContainedByRect(point, rect) {
91
91
  return rect.left <= point.x && rect.right >= point.x && rect.top <= point.y && rect.bottom >= point.y;
92
92
  }
93
+
94
+ /**
95
+ * Is the point within the top and bottom boundaries of the rectangle.
96
+ *
97
+ * @param {WPPoint} point The point.
98
+ * @param {DOMRect} rect The rectangle.
99
+ *
100
+ * @return {boolean} True if the point is within top and bottom of rectangle, false otherwise.
101
+ */
102
+ export function isPointWithinTopAndBottomBoundariesOfRect(point, rect) {
103
+ return rect.top <= point.y && rect.bottom >= point.y;
104
+ }
93
105
  //# sourceMappingURL=math.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["getDistanceFromPointToEdge","point","rect","edge","isHorizontal","x","y","pointLateralPosition","pointForwardPosition","edgeStart","left","top","edgeEnd","right","bottom","edgeForwardPosition","edgeLateralPosition","Math","sqrt","getDistanceToNearestEdge","allowedEdges","candidateDistance","candidateEdge","forEach","distance","undefined","isPointContainedByRect"],"sources":["@wordpress/block-editor/src/utils/math.js"],"sourcesContent":["/**\n * A string representing the name of an edge.\n *\n * @typedef {'top'|'right'|'bottom'|'left'} WPEdgeName\n */\n\n/**\n * @typedef {Object} WPPoint\n * @property {number} x The horizontal position.\n * @property {number} y The vertical position.\n */\n\n/**\n * Given a point, a DOMRect and the name of an edge, returns the distance to\n * that edge of the rect.\n *\n * This function works for edges that are horizontal or vertical (e.g. not\n * rotated), the following terms are used so that the function works in both\n * orientations:\n *\n * - Forward, meaning the axis running horizontally when an edge is vertical\n * and vertically when an edge is horizontal.\n * - Lateral, meaning the axis running vertically when an edge is vertical\n * and horizontally when an edge is horizontal.\n *\n * @param {WPPoint} point The point to measure distance from.\n * @param {DOMRect} rect A DOM Rect containing edge positions.\n * @param {WPEdgeName} edge The edge to measure to.\n */\nexport function getDistanceFromPointToEdge( point, rect, edge ) {\n\tconst isHorizontal = edge === 'top' || edge === 'bottom';\n\tconst { x, y } = point;\n\tconst pointLateralPosition = isHorizontal ? x : y;\n\tconst pointForwardPosition = isHorizontal ? y : x;\n\tconst edgeStart = isHorizontal ? rect.left : rect.top;\n\tconst edgeEnd = isHorizontal ? rect.right : rect.bottom;\n\tconst edgeForwardPosition = rect[ edge ];\n\n\t// Measure the straight line distance to the edge of the rect, when the\n\t// point is adjacent to the edge.\n\t// Else, if the point is positioned diagonally to the edge of the rect,\n\t// measure diagonally to the nearest corner that the edge meets.\n\tlet edgeLateralPosition;\n\tif (\n\t\tpointLateralPosition >= edgeStart &&\n\t\tpointLateralPosition <= edgeEnd\n\t) {\n\t\tedgeLateralPosition = pointLateralPosition;\n\t} else if ( pointLateralPosition < edgeEnd ) {\n\t\tedgeLateralPosition = edgeStart;\n\t} else {\n\t\tedgeLateralPosition = edgeEnd;\n\t}\n\n\treturn Math.sqrt(\n\t\t( pointLateralPosition - edgeLateralPosition ) ** 2 +\n\t\t\t( pointForwardPosition - edgeForwardPosition ) ** 2\n\t);\n}\n\n/**\n * Given a point, a DOMRect and a list of allowed edges returns the name of and\n * distance to the nearest edge.\n *\n * @param {WPPoint} point The point to measure distance from.\n * @param {DOMRect} rect A DOM Rect containing edge positions.\n * @param {WPEdgeName[]} allowedEdges A list of the edges included in the\n * calculation. Defaults to all edges.\n *\n * @return {[number, string]} An array where the first value is the distance\n * and a second is the edge name.\n */\nexport function getDistanceToNearestEdge(\n\tpoint,\n\trect,\n\tallowedEdges = [ 'top', 'bottom', 'left', 'right' ]\n) {\n\tlet candidateDistance;\n\tlet candidateEdge;\n\n\tallowedEdges.forEach( ( edge ) => {\n\t\tconst distance = getDistanceFromPointToEdge( point, rect, edge );\n\n\t\tif ( candidateDistance === undefined || distance < candidateDistance ) {\n\t\t\tcandidateDistance = distance;\n\t\t\tcandidateEdge = edge;\n\t\t}\n\t} );\n\n\treturn [ candidateDistance, candidateEdge ];\n}\n\n/**\n * Is the point contained by the rectangle.\n *\n * @param {WPPoint} point The point.\n * @param {DOMRect} rect The rectangle.\n *\n * @return {boolean} True if the point is contained by the rectangle, false otherwise.\n */\nexport function isPointContainedByRect( point, rect ) {\n\treturn (\n\t\trect.left <= point.x &&\n\t\trect.right >= point.x &&\n\t\trect.top <= point.y &&\n\t\trect.bottom >= point.y\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,0BAA0BA,CAAEC,KAAK,EAAEC,IAAI,EAAEC,IAAI,EAAG;EAC/D,MAAMC,YAAY,GAAGD,IAAI,KAAK,KAAK,IAAIA,IAAI,KAAK,QAAQ;EACxD,MAAM;IAAEE,CAAC;IAAEC;EAAE,CAAC,GAAG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AQ;MAC5BF,aAAa,GAAGnB,IAAI;IACrB;EACD,CAAE,CAAC;EAEH,OAAO,CAAEkB,iBAAiB,EAAEC,aAAa,CAAE;AAC5C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASI,sBAAsBA,CAAEzB,KAAK,EAAEC,IAAI,EAAG;EACrD,OACCA,IAAI,CAACQ,IAAI,IAAIT,KAAK,CAACI,CAAC,IACpBH,IAAI,CAACW,KAAK,IAAIZ,KAAK,CAACI,CAAC,IACrBH,IAAI,CAACS,GAAG,IAAIV,KAAK,CAACK,CAAC,IACnBJ,IAAI,CAACY,MAAM,IAAIb,KAAK,CAACK,CAAC;AAExB"}
1
+ {"version":3,"names":["getDistanceFromPointToEdge","point","rect","edge","isHorizontal","x","y","pointLateralPosition","pointForwardPosition","edgeStart","left","top","edgeEnd","right","bottom","edgeForwardPosition","edgeLateralPosition","Math","sqrt","getDistanceToNearestEdge","allowedEdges","candidateDistance","candidateEdge","forEach","distance","undefined","isPointContainedByRect","isPointWithinTopAndBottomBoundariesOfRect"],"sources":["@wordpress/block-editor/src/utils/math.js"],"sourcesContent":["/**\n * A string representing the name of an edge.\n *\n * @typedef {'top'|'right'|'bottom'|'left'} WPEdgeName\n */\n\n/**\n * @typedef {Object} WPPoint\n * @property {number} x The horizontal position.\n * @property {number} y The vertical position.\n */\n\n/**\n * Given a point, a DOMRect and the name of an edge, returns the distance to\n * that edge of the rect.\n *\n * This function works for edges that are horizontal or vertical (e.g. not\n * rotated), the following terms are used so that the function works in both\n * orientations:\n *\n * - Forward, meaning the axis running horizontally when an edge is vertical\n * and vertically when an edge is horizontal.\n * - Lateral, meaning the axis running vertically when an edge is vertical\n * and horizontally when an edge is horizontal.\n *\n * @param {WPPoint} point The point to measure distance from.\n * @param {DOMRect} rect A DOM Rect containing edge positions.\n * @param {WPEdgeName} edge The edge to measure to.\n */\nexport function getDistanceFromPointToEdge( point, rect, edge ) {\n\tconst isHorizontal = edge === 'top' || edge === 'bottom';\n\tconst { x, y } = point;\n\tconst pointLateralPosition = isHorizontal ? x : y;\n\tconst pointForwardPosition = isHorizontal ? y : x;\n\tconst edgeStart = isHorizontal ? rect.left : rect.top;\n\tconst edgeEnd = isHorizontal ? rect.right : rect.bottom;\n\tconst edgeForwardPosition = rect[ edge ];\n\n\t// Measure the straight line distance to the edge of the rect, when the\n\t// point is adjacent to the edge.\n\t// Else, if the point is positioned diagonally to the edge of the rect,\n\t// measure diagonally to the nearest corner that the edge meets.\n\tlet edgeLateralPosition;\n\tif (\n\t\tpointLateralPosition >= edgeStart &&\n\t\tpointLateralPosition <= edgeEnd\n\t) {\n\t\tedgeLateralPosition = pointLateralPosition;\n\t} else if ( pointLateralPosition < edgeEnd ) {\n\t\tedgeLateralPosition = edgeStart;\n\t} else {\n\t\tedgeLateralPosition = edgeEnd;\n\t}\n\n\treturn Math.sqrt(\n\t\t( pointLateralPosition - edgeLateralPosition ) ** 2 +\n\t\t\t( pointForwardPosition - edgeForwardPosition ) ** 2\n\t);\n}\n\n/**\n * Given a point, a DOMRect and a list of allowed edges returns the name of and\n * distance to the nearest edge.\n *\n * @param {WPPoint} point The point to measure distance from.\n * @param {DOMRect} rect A DOM Rect containing edge positions.\n * @param {WPEdgeName[]} allowedEdges A list of the edges included in the\n * calculation. Defaults to all edges.\n *\n * @return {[number, string]} An array where the first value is the distance\n * and a second is the edge name.\n */\nexport function getDistanceToNearestEdge(\n\tpoint,\n\trect,\n\tallowedEdges = [ 'top', 'bottom', 'left', 'right' ]\n) {\n\tlet candidateDistance;\n\tlet candidateEdge;\n\n\tallowedEdges.forEach( ( edge ) => {\n\t\tconst distance = getDistanceFromPointToEdge( point, rect, edge );\n\n\t\tif ( candidateDistance === undefined || distance < candidateDistance ) {\n\t\t\tcandidateDistance = distance;\n\t\t\tcandidateEdge = edge;\n\t\t}\n\t} );\n\n\treturn [ candidateDistance, candidateEdge ];\n}\n\n/**\n * Is the point contained by the rectangle.\n *\n * @param {WPPoint} point The point.\n * @param {DOMRect} rect The rectangle.\n *\n * @return {boolean} True if the point is contained by the rectangle, false otherwise.\n */\nexport function isPointContainedByRect( point, rect ) {\n\treturn (\n\t\trect.left <= point.x &&\n\t\trect.right >= point.x &&\n\t\trect.top <= point.y &&\n\t\trect.bottom >= point.y\n\t);\n}\n\n/**\n * Is the point within the top and bottom boundaries of the rectangle.\n *\n * @param {WPPoint} point The point.\n * @param {DOMRect} rect The rectangle.\n *\n * @return {boolean} True if the point is within top and bottom of rectangle, false otherwise.\n */\nexport function isPointWithinTopAndBottomBoundariesOfRect( point, rect ) {\n\treturn rect.top <= point.y && rect.bottom >= point.y;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,0BAA0BA,CAAEC,KAAK,EAAEC,IAAI,EAAEC,IAAI,EAAG;EAC/D,MAAMC,YAAY,GAAGD,IAAI,KAAK,KAAK,IAAIA,IAAI,KAAK,QAAQ;EACxD,MAAM;IAAEE,CAAC;IAAEC;EAAE,CAAC,GAAGL,KAAK;EACtB,MAAMM,oBAAoB,GAAGH,YAAY,GAAGC,CAAC,GAAGC,CAAC;EACjD,MAAME,oBAAoB,GAAGJ,YAAY,GAAGE,CAAC,GAAGD,CAAC;EACjD,MAAMI,SAAS,GAAGL,YAAY,GAAGF,IAAI,CAACQ,IAAI,GAAGR,IAAI,CAACS,GAAG;EACrD,MAAMC,OAAO,GAAGR,YAAY,GAAGF,IAAI,CAACW,KAAK,GAAGX,IAAI,CAACY,MAAM;EACvD,MAAMC,mBAAmB,GAAGb,IAAI,CAAEC,IAAI,CAAE;;EAExC;EACA;EACA;EACA;EACA,IAAIa,mBAAmB;EACvB,IACCT,oBAAoB,IAAIE,SAAS,IACjCF,oBAAoB,IAAIK,OAAO,EAC9B;IACDI,mBAAmB,GAAGT,oBA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CAAyCA,CAAE1B,KAAK,EAAEC,IAAI,EAAG;EACxE,OAAOA,IAAI,CAACS,GAAG,IAAIV,KAAK,CAACK,CAAC,IAAIJ,IAAI,CAACY,MAAM,IAAIb,KAAK,CAACK,CAAC;AACrD"}
@@ -51,4 +51,20 @@ export const getValueFromObjectPath = (object, path, defaultValue) => {
51
51
  });
52
52
  return (_value = value) !== null && _value !== void 0 ? _value : defaultValue;
53
53
  };
54
+
55
+ /**
56
+ * Helper util to filter out objects with duplicate values for a given property.
57
+ *
58
+ * @param {Object[]} array Array of objects to filter.
59
+ * @param {string} property Property to filter unique values by.
60
+ *
61
+ * @return {Object[]} Array of objects with unique values for the specified property.
62
+ */
63
+ export function uniqByProperty(array, property) {
64
+ const seen = new Set();
65
+ return array.filter(item => {
66
+ const value = item[property];
67
+ return seen.has(value) ? false : seen.add(value);
68
+ });
69
+ }
54
70
  //# sourceMappingURL=object.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["setImmutably","object","path","value","Array","isArray","leaf","pop","prev","key","lvl","getValueFromObjectPath","defaultValue","_value","arrayPath","split","forEach","fieldName"],"sources":["@wordpress/block-editor/src/utils/object.js"],"sourcesContent":["/**\n * Immutably sets a value inside an object. Like `lodash#set`, but returning a\n * new object. Treats nullish initial values as empty objects. Clones any\n * nested objects. Supports arrays, too.\n *\n * @param {Object} object Object to set a value in.\n * @param {number|string|Array} path Path in the object to modify.\n * @param {*} value New value to set.\n * @return {Object} Cloned object with the new value set.\n */\nexport function setImmutably( object, path, value ) {\n\t// Normalize path\n\tpath = Array.isArray( path ) ? [ ...path ] : [ path ];\n\n\t// Shallowly clone the base of the object\n\tobject = Array.isArray( object ) ? [ ...object ] : { ...object };\n\n\tconst leaf = path.pop();\n\n\t// Traverse object from root to leaf, shallowly cloning at each level\n\tlet prev = object;\n\tfor ( const key of path ) {\n\t\tconst lvl = prev[ key ];\n\t\tprev = prev[ key ] = Array.isArray( lvl ) ? [ ...lvl ] : { ...lvl };\n\t}\n\n\tprev[ leaf ] = value;\n\n\treturn object;\n}\n\n/**\n * Helper util to return a value from a certain path of the object.\n * Path is specified as either:\n * - a string of properties, separated by dots, for example: \"x.y\".\n * - an array of properties, for example `[ 'x', 'y' ]`.\n * You can also specify a default value in case the result is nullish.\n *\n * @param {Object} object Input object.\n * @param {string|Array} path Path to the object property.\n * @param {*} defaultValue Default value if the value at the specified path is nullish.\n * @return {*} Value of the object property at the specified path.\n */\nexport const getValueFromObjectPath = ( object, path, defaultValue ) => {\n\tconst arrayPath = Array.isArray( path ) ? path : path.split( '.' );\n\tlet value = object;\n\tarrayPath.forEach( ( fieldName ) => {\n\t\tvalue = value?.[ fieldName ];\n\t} );\n\treturn value ?? defaultValue;\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,YAAYA,CAAEC,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAG;EACnD;EACAD,IAAI,GAAGE,KAAK,CAACC,OAAO,CAAEH,IAAK,CAAC,GAAG,CAAE,GAAGA,IAAI,CAAE,GAAG,CAAEA,IAAI,CAAE;;EAErD;EACAD,MAAM,GAAGG,KAAK,CAACC,OAAO,CAAEJ,MAAO,CAAC,GAAG,CAAE,GAAGA,MAAM,CAAE,GAAG;IAAE,GAAGA;EAAO,CAAC;EAEhE,MAAMK,IAAI,GAAGJ,IAAI,CAACK,GAAG,CAAC,CAAC;;EAEvB;EACA,IAAIC,IAAI,GAAGP,MAAM;EACjB,KAAM,MAAMQ,GAAG,IAAIP,IAAI,EAAG;IACzB,MAAMQ,GAAG,GAAGF,IAAI,CAAEC,GAAG,CAAE;IACvBD,IAAI,GAAGA,IAAI,CAAEC,GAAG,CAAE,GAAGL,KAAK,CAACC,OAAO,CAAEK,GAAI,CAAC,GAAG,CAAE,GAAGA,GAAG,CAAE,GAAG;MAAE,GAAGA;IAAI,CAAC;EACpE;EAEAF,IAAI,CAAEF,IAAI,CAAE,GAAGH,KAAK;EAEpB,OAAOF,MAAM;AACd;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMU,sBAAsB,GAAGA,CAAEV,MAAM,EAAEC,IAAI,EAAEU,YAAY,KAAM;EAAA,IAAAC,MAAA;EACvE,MAAMC,SAAS,GAAGV,KAAK,CAACC,OAAO,CAAEH,IAAK,CAAC,GAAGA,IAAI,GAAGA,IAAI,CAACa,KAAK,CAAE,GAAI,CAAC;EAClE,IAAIZ,KAAK,GAAGF,MAAM;EAClBa,SAAS,CAACE,OAAO,CAAIC,SAAS,IAAM;IACnCd,KAAK,GAAGA,KAAK,GAAIc,SAAS,CAAE;EAC7B,CAAE,CAAC;EACH,QAAAJ,MAAA,GAAOV,KAAK,cAAAU,MAAA,cAAAA,MAAA,GAAID,YAAY;AAC7B,CAAC"}
1
+ {"version":3,"names":["setImmutably","object","path","value","Array","isArray","leaf","pop","prev","key","lvl","getValueFromObjectPath","defaultValue","_value","arrayPath","split","forEach","fieldName","uniqByProperty","array","property","seen","Set","filter","item","has","add"],"sources":["@wordpress/block-editor/src/utils/object.js"],"sourcesContent":["/**\n * Immutably sets a value inside an object. Like `lodash#set`, but returning a\n * new object. Treats nullish initial values as empty objects. Clones any\n * nested objects. Supports arrays, too.\n *\n * @param {Object} object Object to set a value in.\n * @param {number|string|Array} path Path in the object to modify.\n * @param {*} value New value to set.\n * @return {Object} Cloned object with the new value set.\n */\nexport function setImmutably( object, path, value ) {\n\t// Normalize path\n\tpath = Array.isArray( path ) ? [ ...path ] : [ path ];\n\n\t// Shallowly clone the base of the object\n\tobject = Array.isArray( object ) ? [ ...object ] : { ...object };\n\n\tconst leaf = path.pop();\n\n\t// Traverse object from root to leaf, shallowly cloning at each level\n\tlet prev = object;\n\tfor ( const key of path ) {\n\t\tconst lvl = prev[ key ];\n\t\tprev = prev[ key ] = Array.isArray( lvl ) ? [ ...lvl ] : { ...lvl };\n\t}\n\n\tprev[ leaf ] = value;\n\n\treturn object;\n}\n\n/**\n * Helper util to return a value from a certain path of the object.\n * Path is specified as either:\n * - a string of properties, separated by dots, for example: \"x.y\".\n * - an array of properties, for example `[ 'x', 'y' ]`.\n * You can also specify a default value in case the result is nullish.\n *\n * @param {Object} object Input object.\n * @param {string|Array} path Path to the object property.\n * @param {*} defaultValue Default value if the value at the specified path is nullish.\n * @return {*} Value of the object property at the specified path.\n */\nexport const getValueFromObjectPath = ( object, path, defaultValue ) => {\n\tconst arrayPath = Array.isArray( path ) ? path : path.split( '.' );\n\tlet value = object;\n\tarrayPath.forEach( ( fieldName ) => {\n\t\tvalue = value?.[ fieldName ];\n\t} );\n\treturn value ?? defaultValue;\n};\n\n/**\n * Helper util to filter out objects with duplicate values for a given property.\n *\n * @param {Object[]} array Array of objects to filter.\n * @param {string} property Property to filter unique values by.\n *\n * @return {Object[]} Array of objects with unique values for the specified property.\n */\nexport function uniqByProperty( array, property ) {\n\tconst seen = new Set();\n\treturn array.filter( ( item ) => {\n\t\tconst value = item[ property ];\n\t\treturn seen.has( value ) ? false : seen.add( value );\n\t} );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,YAAYA,CAAEC,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAG;EACnD;EACAD,IAAI,GAAGE,KAAK,CAACC,OAAO,CAAEH,IAAK,CAAC,GAAG,CAAE,GAAGA,IAAI,CAAE,GAAG,CAAEA,IAAI,CAAE;;EAErD;EACAD,MAAM,GAAGG,KAAK,CAACC,OAAO,CAAEJ,MAAO,CAAC,GAAG,CAAE,GAAGA,MAAM,CAAE,GAAG;IAAE,GAAGA;EAAO,CAAC;EAEhE,MAAMK,IAAI,GAAGJ,IAAI,CAACK,GAAG,CAAC,CAAC;;EAEvB;EACA,IAAIC,IAAI,GAAGP,MAAM;EACjB,KAAM,MAAMQ,GAAG,IAAIP,IAAI,EAAG;IACzB,MAAMQ,GAAG,GAAGF,IAAI,CAAEC,GAAG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rl from 'postcss-urlrebase';
7
+ const transformStylesCache = new WeakMap();
8
+ function transformStyle({
9
+ css,
10
+ ignoredSelectors = [],
11
+ baseURL
12
+ }, wrapperSelector = '') {
13
+ // When there is no wrapper selector or base URL, there is no need
14
+ // to transform the CSS. This is most cases because in the default
15
+ // iframed editor, no wrapping is needed, and not many styles
16
+ // provide a base URL.
17
+ if (!wrapperSelector && !baseURL) {
18
+ return css;
19
+ }
20
+ try {
21
+ return postcss([wrapperSelector && wrap(wrapperSelector, {
22
+ ignoredSelectors: [...ignoredSelectors, wrapperSelector]
23
+ }), baseURL && rebaseUrl({
24
+ rootUrl: baseURL
25
+ })].filter(Boolean)).process(css, {}).css; // use sync PostCSS API
26
+ } catch (error) {
27
+ if (error instanceof CssSyntaxError) {
28
+ // eslint-disable-next-line no-console
29
+ console.warn('wp.blockEditor.transformStyles Failed to transform CSS.', error.message + '\n' + error.showSourceCode(false));
30
+ } else {
31
+ // eslint-disable-next-line no-console
32
+ console.warn('wp.blockEditor.transformStyles Failed to transform CSS.', error);
33
+ }
34
+ return null;
35
+ }
36
+ }
7
37
 
8
38
  /**
9
39
  * Applies a series of CSS rule transforms to wrap selectors inside a given class and/or rewrite URLs depending on the parameters passed.
@@ -18,34 +48,13 @@ import rebaseUrl from 'postcss-urlrebase';
18
48
  * @return {Array} converted rules.
19
49
  */
20
50
  const transformStyles = (styles, wrapperSelector = '') => {
21
- return styles.map(({
22
- css,
23
- ignoredSelectors = [],
24
- baseURL
25
- }) => {
26
- // When there is no wrapper selector or base URL, there is no need
27
- // to transform the CSS. This is most cases because in the default
28
- // iframed editor, no wrapping is needed, and not many styles
29
- // provide a base URL.
30
- if (!wrapperSelector && !baseURL) {
31
- return css;
32
- }
33
- try {
34
- return postcss([wrapperSelector && wrap(wrapperSelector, {
35
- ignoredSelectors: [...ignoredSelectors, wrapperSelector]
36
- }), baseURL && rebaseUrl({
37
- rootUrl: baseURL
38
- })].filter(Boolean)).process(css, {}).css; // use sync PostCSS API
39
- } catch (error) {
40
- if (error instanceof CssSyntaxError) {
41
- // eslint-disable-next-line no-console
42
- console.warn('wp.blockEditor.transformStyles Failed to transform CSS.', error.message + '\n' + error.showSourceCode(false));
43
- } else {
44
- // eslint-disable-next-line no-console
45
- console.warn('wp.blockEditor.transformStyles Failed to transform CSS.', error);
46
- }
47
- return null;
51
+ return styles.map(style => {
52
+ if (transformStylesCache.has(style)) {
53
+ return transformStylesCache.get(style);
48
54
  }
55
+ const transformedStyle = transformStyle(style, wrapperSelector);
56
+ transformStylesCache.set(style, transformedStyle);
57
+ return transformedStyle;
49
58
  });
50
59
  };
51
60
  export default transformStyles;
@@ -1 +1 @@
1
- {"version":3,"names":["postcss","CssSyntaxError","wrap","rebaseUrl","transformStyles","styles","wrapperSelector","map","css","ignoredSelectors","baseURL","rootUrl","filter","Boolean","process","error","console","warn","message","showSourceCode"],"sources":["@wordpress/block-editor/src/utils/transform-styles/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport postcss, { CssSyntaxError } from 'postcss';\nimport wrap from 'postcss-prefixwrap';\nimport rebaseUrl from 'postcss-urlrebase';\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 * @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 * @param {EditorStyle[]} styles CSS rules.\n * @param {string} wrapperSelector Wrapper selector.\n * @return {Array} converted rules.\n */\nconst transformStyles = ( styles, wrapperSelector = '' ) => {\n\treturn styles.map( ( { css, ignoredSelectors = [], baseURL } ) => {\n\t\t// When there is no wrapper selector or base URL, there is no need\n\t\t// to transform the CSS. This is most cases because in the default\n\t\t// iframed editor, no wrapping is needed, and not many styles\n\t\t// provide a base URL.\n\t\tif ( ! wrapperSelector && ! baseURL ) {\n\t\t\treturn css;\n\t\t}\n\n\t\ttry {\n\t\t\treturn postcss(\n\t\t\t\t[\n\t\t\t\t\twrapperSelector &&\n\t\t\t\t\t\twrap( wrapperSelector, {\n\t\t\t\t\t\t\tignoredSelectors: [\n\t\t\t\t\t\t\t\t...ignoredSelectors,\n\t\t\t\t\t\t\t\twrapperSelector,\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t} ),\n\t\t\t\t\tbaseURL && rebaseUrl( { rootUrl: baseURL } ),\n\t\t\t\t].filter( Boolean )\n\t\t\t).process( css, {} ).css; // use sync PostCSS API\n\t\t} catch ( error ) {\n\t\t\tif ( error instanceof CssSyntaxError ) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.warn(\n\t\t\t\t\t'wp.blockEditor.transformStyles Failed to transform CSS.',\n\t\t\t\t\terror.message + '\\n' + error.showSourceCode( false )\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.warn(\n\t\t\t\t\t'wp.blockEditor.transformStyles Failed to transform CSS.',\n\t\t\t\t\terror\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\t} );\n};\n\nexport default transformStyles;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,OAAO,IAAIC,cAAc,QAAQ,SAAS;AACjD,OAAOC,IAAI,MAAM,oBAAoB;AACrC,OAAOC,SAAS,MAAM,mBAAmB;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,eAAe,GAAGA,CAAEC,MAAM,EAAEC,eAAe,GAAG,EAAE,KAAM;EAC3D,OAAOD,MAAM,CAACE,GAAG,CAAE,CAAE;IAAEC,GAAG;IAAEC,gBAAgB,GAAG,EAAE;IAAEC;EAAQ,CAAC,KAAM;IACjE;IACA;IACA;IACA;IACA,IAAK,CAAEJ,eAAe,IAAI,CAAEI,OAAO,EAAG;MACrC,OAAOF,GAAG;IACX;IAEA,IAAI;MACH,OAAOR,OAAO,CACb,CACCM,eAAe,IACdJ,IAAI,CAAEI,eAAe,EAAE;QACtBG,gBAAgB,EAAE,CACjB,GAAGA,gBAAgB,EACnBH,eAAe;MAEjB,CAAE,CAAC,EACJI,OAAO,IAAIP,SAAS,CAAE;QAAEQ,OAAO,EAAED;MAAQ,CAAE,CAAC,CAC5C,CAACE,MAAM,CAAEC,OAAQ,CACnB,CAAC,CAACC,OAAO,CAAEN,GAAG,EAAE,CAAC,CAAE,CAAC,CAACA,GAAG,CAAC,CAAC;IAC3B,CAAC,CAAC,OAAQO,KAAK,EAAG;MACjB,IAAKA,KAAK,YAAYd,cAAc,EAAG;QACtC;QACAe,OAAO,CAACC,IAAI,CACX,yDAAyD,EACzDF,KAAK,CAACG,OAAO,GAAG,IAAI,GAAGH,KAAK,CAACI,cAAc,CAAE,KAAM,CACpD,CAAC;MACF,CAAC,MAAM;QACN;QACAH,OAAO,CAACC,IAAI,CACX,yDAAyD,EACzDF,KACD,CAAC;MACF;MAEA,OAAO,IAAI;IACZ;EACD,CAAE,CAAC;AACJ,CAAC;AAED,eAAeX,eAAe"}
1
+ {"version":3,"names":["postcss","CssSyntaxError","wrap","rebaseUrl","transformStylesCache","WeakMap","transformStyle","css","ignoredSelectors","baseURL","wrapperSelector","rootUrl","filter","Boolean","process","error","console","warn","message","showSourceCode","transformStyles","styles","map","style","has","get","transformedStyle","set"],"sources":["@wordpress/block-editor/src/utils/transform-styles/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport postcss, { CssSyntaxError } from 'postcss';\nimport wrap from 'postcss-prefixwrap';\nimport rebaseUrl from 'postcss-urlrebase';\n\nconst transformStylesCache = new WeakMap();\n\nfunction transformStyle(\n\t{ css, ignoredSelectors = [], baseURL },\n\twrapperSelector = ''\n) {\n\t// When there is no wrapper selector or 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\treturn postcss(\n\t\t\t[\n\t\t\t\twrapperSelector &&\n\t\t\t\t\twrap( wrapperSelector, {\n\t\t\t\t\t\tignoredSelectors: [\n\t\t\t\t\t\t\t...ignoredSelectors,\n\t\t\t\t\t\t\twrapperSelector,\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 * 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 * @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 * @param {EditorStyle[]} styles CSS rules.\n * @param {string} wrapperSelector Wrapper selector.\n * @return {Array} converted rules.\n */\nconst transformStyles = ( styles, wrapperSelector = '' ) => {\n\treturn styles.map( ( style ) => {\n\t\tif ( transformStylesCache.has( style ) ) {\n\t\t\treturn transformStylesCache.get( style );\n\t\t}\n\n\t\tconst transformedStyle = transformStyle( style, wrapperSelector );\n\t\ttransformStylesCache.set( style, transformedStyle );\n\t\treturn transformedStyle;\n\t} );\n};\n\nexport default transformStyles;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,OAAO,IAAIC,cAAc,QAAQ,SAAS;AACjD,OAAOC,IAAI,MAA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oBAAoB,CAACqB,GAAG,CAAEF,KAAM,CAAC;IACzC;IAEA,MAAMG,gBAAgB,GAAGpB,cAAc,CAAEiB,KAAK,EAAEb,eAAgB,CAAC;IACjEN,oBAAoB,CAACuB,GAAG,CAAEJ,KAAK,EAAEG,gBAAiB,CAAC;IACnD,OAAOA,gBAAgB;EACxB,CAAE,CAAC;AACJ,CAAC;AAED,eAAeN,eAAe"}
@@ -97,7 +97,7 @@
97
97
  --wp-block-synced-color: #7a00df;
98
98
  --wp-block-synced-color--rgb: 122, 0, 223;
99
99
  }
100
- @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
100
+ @media (min-resolution: 192dpi) {
101
101
  :root {
102
102
  --wp-admin-border-width-focus: 1.5px;
103
103
  }
@@ -183,12 +183,12 @@ _::-webkit-full-page-media, _:future, :root .has-multi-selection .block-editor-b
183
183
  }
184
184
  .block-editor-block-list__layout .block-editor-block-list__block.is-highlighted,
185
185
  .block-editor-block-list__layout .block-editor-block-list__block.is-highlighted ~ .is-multi-selected, .block-editor-block-list__layout.is-navigate-mode .block-editor-block-list__block.is-selected,
186
- .block-editor-block-list__layout .block-editor-block-list__block:not([contenteditable]):focus {
186
+ .block-editor-block-list__layout .block-editor-block-list__block:not([contenteditable=true]):focus {
187
187
  outline: none;
188
188
  }
189
189
  .block-editor-block-list__layout .block-editor-block-list__block.is-highlighted::after,
190
190
  .block-editor-block-list__layout .block-editor-block-list__block.is-highlighted ~ .is-multi-selected::after, .block-editor-block-list__layout.is-navigate-mode .block-editor-block-list__block.is-selected::after,
191
- .block-editor-block-list__layout .block-editor-block-list__block:not([contenteditable]):focus::after {
191
+ .block-editor-block-list__layout .block-editor-block-list__block:not([contenteditable=true]):focus::after {
192
192
  content: "";
193
193
  position: absolute;
194
194
  z-index: 1;
@@ -203,7 +203,7 @@ _::-webkit-full-page-media, _:future, :root .has-multi-selection .block-editor-b
203
203
  }
204
204
  .is-dark-theme .block-editor-block-list__layout .block-editor-block-list__block.is-highlighted::after,
205
205
  .is-dark-theme .block-editor-block-list__layout .block-editor-block-list__block.is-highlighted ~ .is-multi-selected::after, .is-dark-theme .block-editor-block-list__layout.is-navigate-mode .block-editor-block-list__block.is-selected::after,
206
- .is-dark-theme .block-editor-block-list__layout .block-editor-block-list__block:not([contenteditable]):focus::after {
206
+ .is-dark-theme .block-editor-block-list__layout .block-editor-block-list__block:not([contenteditable=true]):focus::after {
207
207
  box-shadow: 0 0 0 var(--wp-admin-border-width-focus) #fff;
208
208
  }
209
209
  .block-editor-block-list__layout .is-block-moving-mode.block-editor-block-list__block.is-selected::after {
@@ -264,10 +264,6 @@ _::-webkit-full-page-media, _:future, :root .has-multi-selection .block-editor-b
264
264
  margin: 0 0 12px 0;
265
265
  width: 100%;
266
266
  }
267
- .block-editor-block-list__layout .block-editor-block-list__block .components-with-notices-ui .components-notice {
268
- margin-right: 0;
269
- margin-left: 0;
270
- }
271
267
  .block-editor-block-list__layout .block-editor-block-list__block .components-with-notices-ui .components-notice .components-notice__content {
272
268
  font-size: 13px;
273
269
  }
@@ -340,6 +336,27 @@ _::-webkit-full-page-media, _:future, :root .has-multi-selection .block-editor-b
340
336
  border-radius: 2px;
341
337
  }
342
338
 
339
+ .is-template-locked:hover .block-editor-block-list__block.is-editing-disabled > .block-editor-block-list__block:not(.is-editing-disabled):not(.is-selected):not(.has-child-selected)::after, .is-template-locked:hover:has(> .block-editor-block-list__block.is-editing-disabled) > .block-editor-block-list__block:not(.is-editing-disabled):not(.is-selected):not(.has-child-selected)::after,
340
+ .block-editor-block-list__block:hover .block-editor-block-list__block.is-editing-disabled > .block-editor-block-list__block:not(.is-editing-disabled):not(.is-selected):not(.has-child-selected)::after,
341
+ .block-editor-block-list__block:hover:has(> .block-editor-block-list__block.is-editing-disabled) > .block-editor-block-list__block:not(.is-editing-disabled):not(.is-selected):not(.has-child-selected)::after {
342
+ content: "";
343
+ border-style: dotted;
344
+ position: absolute;
345
+ pointer-events: none;
346
+ top: 1px;
347
+ right: 1px;
348
+ left: 1px;
349
+ bottom: 1px;
350
+ border: 1px dotted var(--wp-admin-theme-color);
351
+ border-radius: 1px;
352
+ }
353
+ .is-template-locked:hover .block-editor-block-list__block.is-editing-disabled > .block-editor-block-list__block:not(.is-editing-disabled):not(.is-selected):not(.has-child-selected).is-hovered::after, .is-template-locked:hover:has(> .block-editor-block-list__block.is-editing-disabled) > .block-editor-block-list__block:not(.is-editing-disabled):not(.is-selected):not(.has-child-selected).is-hovered::after,
354
+ .block-editor-block-list__block:hover .block-editor-block-list__block.is-editing-disabled > .block-editor-block-list__block:not(.is-editing-disabled):not(.is-selected):not(.has-child-selected).is-hovered::after,
355
+ .block-editor-block-list__block:hover:has(> .block-editor-block-list__block.is-editing-disabled) > .block-editor-block-list__block:not(.is-editing-disabled):not(.is-selected):not(.has-child-selected).is-hovered::after {
356
+ background: rgba(var(--wp-admin-theme-color--rgb), 0.1);
357
+ border: none;
358
+ }
359
+
343
360
  .is-focus-mode .block-editor-block-list__block:not(.has-child-selected) {
344
361
  opacity: 0.2;
345
362
  transition: opacity 0.1s linear;
@@ -948,7 +965,7 @@ body.admin-color-light {
948
965
  --wp-admin-theme-color-darker-20--rgb: 0, 97, 135;
949
966
  --wp-admin-border-width-focus: 2px;
950
967
  }
951
- @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
968
+ @media (min-resolution: 192dpi) {
952
969
  body.admin-color-light {
953
970
  --wp-admin-border-width-focus: 1.5px;
954
971
  }
@@ -963,7 +980,7 @@ body.admin-color-modern {
963
980
  --wp-admin-theme-color-darker-20--rgb: 24, 58, 214;
964
981
  --wp-admin-border-width-focus: 2px;
965
982
  }
966
- @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
983
+ @media (min-resolution: 192dpi) {
967
984
  body.admin-color-modern {
968
985
  --wp-admin-border-width-focus: 1.5px;
969
986
  }
@@ -978,7 +995,7 @@ body.admin-color-blue {
978
995
  --wp-admin-theme-color-darker-20--rgb: 6, 64, 84;
979
996
  --wp-admin-border-width-focus: 2px;
980
997
  }
981
- @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
998
+ @media (min-resolution: 192dpi) {
982
999
  body.admin-color-blue {
983
1000
  --wp-admin-border-width-focus: 1.5px;
984
1001
  }
@@ -993,7 +1010,7 @@ body.admin-color-coffee {
993
1010
  --wp-admin-theme-color-darker-20--rgb: 43, 39, 36;
994
1011
  --wp-admin-border-width-focus: 2px;
995
1012
  }
996
- @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
1013
+ @media (min-resolution: 192dpi) {
997
1014
  body.admin-color-coffee {
998
1015
  --wp-admin-border-width-focus: 1.5px;
999
1016
  }
@@ -1008,7 +1025,7 @@ body.admin-color-ectoplasm {
1008
1025
  --wp-admin-theme-color-darker-20--rgb: 58, 44, 77;
1009
1026
  --wp-admin-border-width-focus: 2px;
1010
1027
  }
1011
- @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
1028
+ @media (min-resolution: 192dpi) {
1012
1029
  body.admin-color-ectoplasm {
1013
1030
  --wp-admin-border-width-focus: 1.5px;
1014
1031
  }
@@ -1023,7 +1040,7 @@ body.admin-color-midnight {
1023
1040
  --wp-admin-theme-color-darker-20--rgb: 208, 44, 33;
1024
1041
  --wp-admin-border-width-focus: 2px;
1025
1042
  }
1026
- @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
1043
+ @media (min-resolution: 192dpi) {
1027
1044
  body.admin-color-midnight {
1028
1045
  --wp-admin-border-width-focus: 1.5px;
1029
1046
  }
@@ -1038,7 +1055,7 @@ body.admin-color-ocean {
1038
1055
  --wp-admin-theme-color-darker-20--rgb: 76, 96, 102;
1039
1056
  --wp-admin-border-width-focus: 2px;
1040
1057
  }
1041
- @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
1058
+ @media (min-resolution: 192dpi) {
1042
1059
  body.admin-color-ocean {
1043
1060
  --wp-admin-border-width-focus: 1.5px;
1044
1061
  }
@@ -1053,7 +1070,7 @@ body.admin-color-sunrise {
1053
1070
  --wp-admin-theme-color-darker-20--rgb: 195, 105, 34;
1054
1071
  --wp-admin-border-width-focus: 2px;
1055
1072
  }
1056
- @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
1073
+ @media (min-resolution: 192dpi) {
1057
1074
  body.admin-color-sunrise {
1058
1075
  --wp-admin-border-width-focus: 1.5px;
1059
1076
  }
@@ -97,7 +97,7 @@
97
97
  --wp-block-synced-color: #7a00df;
98
98
  --wp-block-synced-color--rgb: 122, 0, 223;
99
99
  }
100
- @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
100
+ @media (min-resolution: 192dpi) {
101
101
  :root {
102
102
  --wp-admin-border-width-focus: 1.5px;
103
103
  }
@@ -183,12 +183,12 @@ _::-webkit-full-page-media, _:future, :root .has-multi-selection .block-editor-b
183
183
  }
184
184
  .block-editor-block-list__layout .block-editor-block-list__block.is-highlighted,
185
185
  .block-editor-block-list__layout .block-editor-block-list__block.is-highlighted ~ .is-multi-selected, .block-editor-block-list__layout.is-navigate-mode .block-editor-block-list__block.is-selected,
186
- .block-editor-block-list__layout .block-editor-block-list__block:not([contenteditable]):focus {
186
+ .block-editor-block-list__layout .block-editor-block-list__block:not([contenteditable=true]):focus {
187
187
  outline: none;
188
188
  }
189
189
  .block-editor-block-list__layout .block-editor-block-list__block.is-highlighted::after,
190
190
  .block-editor-block-list__layout .block-editor-block-list__block.is-highlighted ~ .is-multi-selected::after, .block-editor-block-list__layout.is-navigate-mode .block-editor-block-list__block.is-selected::after,
191
- .block-editor-block-list__layout .block-editor-block-list__block:not([contenteditable]):focus::after {
191
+ .block-editor-block-list__layout .block-editor-block-list__block:not([contenteditable=true]):focus::after {
192
192
  content: "";
193
193
  position: absolute;
194
194
  z-index: 1;
@@ -203,7 +203,7 @@ _::-webkit-full-page-media, _:future, :root .has-multi-selection .block-editor-b
203
203
  }
204
204
  .is-dark-theme .block-editor-block-list__layout .block-editor-block-list__block.is-highlighted::after,
205
205
  .is-dark-theme .block-editor-block-list__layout .block-editor-block-list__block.is-highlighted ~ .is-multi-selected::after, .is-dark-theme .block-editor-block-list__layout.is-navigate-mode .block-editor-block-list__block.is-selected::after,
206
- .is-dark-theme .block-editor-block-list__layout .block-editor-block-list__block:not([contenteditable]):focus::after {
206
+ .is-dark-theme .block-editor-block-list__layout .block-editor-block-list__block:not([contenteditable=true]):focus::after {
207
207
  box-shadow: 0 0 0 var(--wp-admin-border-width-focus) #fff;
208
208
  }
209
209
  .block-editor-block-list__layout .is-block-moving-mode.block-editor-block-list__block.is-selected::after {
@@ -264,10 +264,6 @@ _::-webkit-full-page-media, _:future, :root .has-multi-selection .block-editor-b
264
264
  margin: 0 0 12px 0;
265
265
  width: 100%;
266
266
  }
267
- .block-editor-block-list__layout .block-editor-block-list__block .components-with-notices-ui .components-notice {
268
- margin-left: 0;
269
- margin-right: 0;
270
- }
271
267
  .block-editor-block-list__layout .block-editor-block-list__block .components-with-notices-ui .components-notice .components-notice__content {
272
268
  font-size: 13px;
273
269
  }
@@ -340,6 +336,27 @@ _::-webkit-full-page-media, _:future, :root .has-multi-selection .block-editor-b
340
336
  border-radius: 2px;
341
337
  }
342
338
 
339
+ .is-template-locked:hover .block-editor-block-list__block.is-editing-disabled > .block-editor-block-list__block:not(.is-editing-disabled):not(.is-selected):not(.has-child-selected)::after, .is-template-locked:hover:has(> .block-editor-block-list__block.is-editing-disabled) > .block-editor-block-list__block:not(.is-editing-disabled):not(.is-selected):not(.has-child-selected)::after,
340
+ .block-editor-block-list__block:hover .block-editor-block-list__block.is-editing-disabled > .block-editor-block-list__block:not(.is-editing-disabled):not(.is-selected):not(.has-child-selected)::after,
341
+ .block-editor-block-list__block:hover:has(> .block-editor-block-list__block.is-editing-disabled) > .block-editor-block-list__block:not(.is-editing-disabled):not(.is-selected):not(.has-child-selected)::after {
342
+ content: "";
343
+ border-style: dotted;
344
+ position: absolute;
345
+ pointer-events: none;
346
+ top: 1px;
347
+ left: 1px;
348
+ right: 1px;
349
+ bottom: 1px;
350
+ border: 1px dotted var(--wp-admin-theme-color);
351
+ border-radius: 1px;
352
+ }
353
+ .is-template-locked:hover .block-editor-block-list__block.is-editing-disabled > .block-editor-block-list__block:not(.is-editing-disabled):not(.is-selected):not(.has-child-selected).is-hovered::after, .is-template-locked:hover:has(> .block-editor-block-list__block.is-editing-disabled) > .block-editor-block-list__block:not(.is-editing-disabled):not(.is-selected):not(.has-child-selected).is-hovered::after,
354
+ .block-editor-block-list__block:hover .block-editor-block-list__block.is-editing-disabled > .block-editor-block-list__block:not(.is-editing-disabled):not(.is-selected):not(.has-child-selected).is-hovered::after,
355
+ .block-editor-block-list__block:hover:has(> .block-editor-block-list__block.is-editing-disabled) > .block-editor-block-list__block:not(.is-editing-disabled):not(.is-selected):not(.has-child-selected).is-hovered::after {
356
+ background: rgba(var(--wp-admin-theme-color--rgb), 0.1);
357
+ border: none;
358
+ }
359
+
343
360
  .is-focus-mode .block-editor-block-list__block:not(.has-child-selected) {
344
361
  opacity: 0.2;
345
362
  transition: opacity 0.1s linear;
@@ -948,7 +965,7 @@ body.admin-color-light {
948
965
  --wp-admin-theme-color-darker-20--rgb: 0, 97, 135;
949
966
  --wp-admin-border-width-focus: 2px;
950
967
  }
951
- @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
968
+ @media (min-resolution: 192dpi) {
952
969
  body.admin-color-light {
953
970
  --wp-admin-border-width-focus: 1.5px;
954
971
  }
@@ -963,7 +980,7 @@ body.admin-color-modern {
963
980
  --wp-admin-theme-color-darker-20--rgb: 24, 58, 214;
964
981
  --wp-admin-border-width-focus: 2px;
965
982
  }
966
- @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
983
+ @media (min-resolution: 192dpi) {
967
984
  body.admin-color-modern {
968
985
  --wp-admin-border-width-focus: 1.5px;
969
986
  }
@@ -978,7 +995,7 @@ body.admin-color-blue {
978
995
  --wp-admin-theme-color-darker-20--rgb: 6, 64, 84;
979
996
  --wp-admin-border-width-focus: 2px;
980
997
  }
981
- @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
998
+ @media (min-resolution: 192dpi) {
982
999
  body.admin-color-blue {
983
1000
  --wp-admin-border-width-focus: 1.5px;
984
1001
  }
@@ -993,7 +1010,7 @@ body.admin-color-coffee {
993
1010
  --wp-admin-theme-color-darker-20--rgb: 43, 39, 36;
994
1011
  --wp-admin-border-width-focus: 2px;
995
1012
  }
996
- @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
1013
+ @media (min-resolution: 192dpi) {
997
1014
  body.admin-color-coffee {
998
1015
  --wp-admin-border-width-focus: 1.5px;
999
1016
  }
@@ -1008,7 +1025,7 @@ body.admin-color-ectoplasm {
1008
1025
  --wp-admin-theme-color-darker-20--rgb: 58, 44, 77;
1009
1026
  --wp-admin-border-width-focus: 2px;
1010
1027
  }
1011
- @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
1028
+ @media (min-resolution: 192dpi) {
1012
1029
  body.admin-color-ectoplasm {
1013
1030
  --wp-admin-border-width-focus: 1.5px;
1014
1031
  }
@@ -1023,7 +1040,7 @@ body.admin-color-midnight {
1023
1040
  --wp-admin-theme-color-darker-20--rgb: 208, 44, 33;
1024
1041
  --wp-admin-border-width-focus: 2px;
1025
1042
  }
1026
- @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
1043
+ @media (min-resolution: 192dpi) {
1027
1044
  body.admin-color-midnight {
1028
1045
  --wp-admin-border-width-focus: 1.5px;
1029
1046
  }
@@ -1038,7 +1055,7 @@ body.admin-color-ocean {
1038
1055
  --wp-admin-theme-color-darker-20--rgb: 76, 96, 102;
1039
1056
  --wp-admin-border-width-focus: 2px;
1040
1057
  }
1041
- @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
1058
+ @media (min-resolution: 192dpi) {
1042
1059
  body.admin-color-ocean {
1043
1060
  --wp-admin-border-width-focus: 1.5px;
1044
1061
  }
@@ -1053,7 +1070,7 @@ body.admin-color-sunrise {
1053
1070
  --wp-admin-theme-color-darker-20--rgb: 195, 105, 34;
1054
1071
  --wp-admin-border-width-focus: 2px;
1055
1072
  }
1056
- @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
1073
+ @media (min-resolution: 192dpi) {
1057
1074
  body.admin-color-sunrise {
1058
1075
  --wp-admin-border-width-focus: 1.5px;
1059
1076
  }
@@ -97,7 +97,7 @@
97
97
  --wp-block-synced-color: #7a00df;
98
98
  --wp-block-synced-color--rgb: 122, 0, 223;
99
99
  }
100
- @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
100
+ @media (min-resolution: 192dpi) {
101
101
  :root {
102
102
  --wp-admin-border-width-focus: 1.5px;
103
103
  }
@@ -97,7 +97,7 @@
97
97
  --wp-block-synced-color: #7a00df;
98
98
  --wp-block-synced-color--rgb: 122, 0, 223;
99
99
  }
100
- @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
100
+ @media (min-resolution: 192dpi) {
101
101
  :root {
102
102
  --wp-admin-border-width-focus: 1.5px;
103
103
  }