@wordpress/components 35.0.0 → 35.0.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 (355) hide show
  1. package/CHANGELOG.md +20 -1
  2. package/build/alignment-matrix-control/cell.cjs +1 -1
  3. package/build/alignment-matrix-control/cell.cjs.map +2 -2
  4. package/build/alignment-matrix-control/index.cjs +1 -1
  5. package/build/alignment-matrix-control/index.cjs.map +2 -2
  6. package/build/color-palette/index.cjs +3 -0
  7. package/build/color-palette/index.cjs.map +2 -2
  8. package/build/custom-gradient-picker/gradient-bar/index.cjs.map +2 -2
  9. package/build/draggable/index.cjs +1 -1
  10. package/build/draggable/index.cjs.map +2 -2
  11. package/build/navigable-container/container.cjs +15 -21
  12. package/build/navigable-container/container.cjs.map +2 -2
  13. package/build/unit-control/utils.cjs +33 -35
  14. package/build/unit-control/utils.cjs.map +2 -2
  15. package/build-module/alignment-matrix-control/cell.mjs +1 -1
  16. package/build-module/alignment-matrix-control/cell.mjs.map +2 -2
  17. package/build-module/alignment-matrix-control/index.mjs +1 -1
  18. package/build-module/alignment-matrix-control/index.mjs.map +2 -2
  19. package/build-module/color-palette/index.mjs +3 -0
  20. package/build-module/color-palette/index.mjs.map +2 -2
  21. package/build-module/custom-gradient-picker/gradient-bar/index.mjs.map +2 -2
  22. package/build-module/draggable/index.mjs +1 -1
  23. package/build-module/draggable/index.mjs.map +2 -2
  24. package/build-module/navigable-container/container.mjs +16 -22
  25. package/build-module/navigable-container/container.mjs.map +2 -2
  26. package/build-module/unit-control/utils.mjs +33 -35
  27. package/build-module/unit-control/utils.mjs.map +2 -2
  28. package/build-style/style-rtl.css +41 -10
  29. package/build-style/style.css +41 -10
  30. package/build-types/card/context.d.ts +3 -0
  31. package/build-types/card/context.d.ts.map +1 -0
  32. package/build-types/color-palette/index.d.ts.map +1 -1
  33. package/build-types/custom-gradient-picker/gradient-bar/index.d.ts.map +1 -1
  34. package/build-types/date-time/date/index.d.ts +23 -0
  35. package/build-types/date-time/date/index.d.ts.map +1 -0
  36. package/build-types/date-time/date/styles.d.ts +45 -0
  37. package/build-types/date-time/date/styles.d.ts.map +1 -0
  38. package/build-types/date-time/date/test/index.d.ts +2 -0
  39. package/build-types/date-time/date/test/index.d.ts.map +1 -0
  40. package/build-types/date-time/date/test/use-lilius.d.ts +2 -0
  41. package/build-types/date-time/date/test/use-lilius.d.ts.map +1 -0
  42. package/build-types/date-time/date/use-lilius/index.d.ts +169 -0
  43. package/build-types/date-time/date/use-lilius/index.d.ts.map +1 -0
  44. package/build-types/date-time/time/index.d.ts +27 -0
  45. package/build-types/date-time/time/index.d.ts.map +1 -0
  46. package/build-types/date-time/time/styles.d.ts +93 -0
  47. package/build-types/date-time/time/styles.d.ts.map +1 -0
  48. package/build-types/date-time/time/test/index.d.ts +2 -0
  49. package/build-types/date-time/time/test/index.d.ts.map +1 -0
  50. package/build-types/date-time/time/time-input/index.d.ts +4 -0
  51. package/build-types/date-time/time/time-input/index.d.ts.map +1 -0
  52. package/build-types/date-time/time/time-input/test/index.d.ts +2 -0
  53. package/build-types/date-time/time/time-input/test/index.d.ts.map +1 -0
  54. package/build-types/date-time/time/timezone.d.ts +7 -0
  55. package/build-types/date-time/time/timezone.d.ts.map +1 -0
  56. package/build-types/navigable-container/container.d.ts.map +1 -1
  57. package/build-types/navigation/back-button/index.d.ts +7 -0
  58. package/build-types/navigation/back-button/index.d.ts.map +1 -0
  59. package/build-types/navigation/constants.d.ts +3 -0
  60. package/build-types/navigation/constants.d.ts.map +1 -0
  61. package/build-types/navigation/context.d.ts +4 -0
  62. package/build-types/navigation/context.d.ts.map +1 -0
  63. package/build-types/navigation/group/context.d.ts +7 -0
  64. package/build-types/navigation/group/context.d.ts.map +1 -0
  65. package/build-types/navigation/group/index.d.ts +7 -0
  66. package/build-types/navigation/group/index.d.ts.map +1 -0
  67. package/build-types/navigation/index.d.ts +46 -0
  68. package/build-types/navigation/index.d.ts.map +1 -0
  69. package/build-types/navigation/item/base-content.d.ts +3 -0
  70. package/build-types/navigation/item/base-content.d.ts.map +1 -0
  71. package/build-types/navigation/item/base.d.ts +3 -0
  72. package/build-types/navigation/item/base.d.ts.map +1 -0
  73. package/build-types/navigation/item/index.d.ts +7 -0
  74. package/build-types/navigation/item/index.d.ts.map +1 -0
  75. package/build-types/navigation/item/use-navigation-tree-item.d.ts +3 -0
  76. package/build-types/navigation/item/use-navigation-tree-item.d.ts.map +1 -0
  77. package/build-types/navigation/menu/context.d.ts +7 -0
  78. package/build-types/navigation/menu/context.d.ts.map +1 -0
  79. package/build-types/navigation/menu/index.d.ts +7 -0
  80. package/build-types/navigation/menu/index.d.ts.map +1 -0
  81. package/build-types/navigation/menu/menu-title-search.d.ts +3 -0
  82. package/build-types/navigation/menu/menu-title-search.d.ts.map +1 -0
  83. package/build-types/navigation/menu/menu-title.d.ts +3 -0
  84. package/build-types/navigation/menu/menu-title.d.ts.map +1 -0
  85. package/build-types/navigation/menu/search-no-results-found.d.ts +3 -0
  86. package/build-types/navigation/menu/search-no-results-found.d.ts.map +1 -0
  87. package/build-types/navigation/menu/use-navigation-tree-menu.d.ts +3 -0
  88. package/build-types/navigation/menu/use-navigation-tree-menu.d.ts.map +1 -0
  89. package/build-types/navigation/stories/index.story.d.ts +23 -0
  90. package/build-types/navigation/stories/index.story.d.ts.map +1 -0
  91. package/build-types/navigation/stories/utils/controlled-state.d.ts +7 -0
  92. package/build-types/navigation/stories/utils/controlled-state.d.ts.map +1 -0
  93. package/build-types/navigation/stories/utils/default.d.ts +10 -0
  94. package/build-types/navigation/stories/utils/default.d.ts.map +1 -0
  95. package/build-types/navigation/stories/utils/group.d.ts +10 -0
  96. package/build-types/navigation/stories/utils/group.d.ts.map +1 -0
  97. package/build-types/navigation/stories/utils/hide-if-empty.d.ts +10 -0
  98. package/build-types/navigation/stories/utils/hide-if-empty.d.ts.map +1 -0
  99. package/build-types/navigation/stories/utils/more-examples.d.ts +10 -0
  100. package/build-types/navigation/stories/utils/more-examples.d.ts.map +1 -0
  101. package/build-types/navigation/stories/utils/search.d.ts +10 -0
  102. package/build-types/navigation/stories/utils/search.d.ts.map +1 -0
  103. package/build-types/navigation/styles/navigation-styles.d.ts +55 -0
  104. package/build-types/navigation/styles/navigation-styles.d.ts.map +1 -0
  105. package/build-types/navigation/test/index.d.ts +2 -0
  106. package/build-types/navigation/test/index.d.ts.map +1 -0
  107. package/build-types/navigation/types.d.ts +266 -0
  108. package/build-types/navigation/types.d.ts.map +1 -0
  109. package/build-types/navigation/use-create-navigation-tree.d.ts +15 -0
  110. package/build-types/navigation/use-create-navigation-tree.d.ts.map +1 -0
  111. package/build-types/navigation/use-navigation-tree-nodes.d.ts +10 -0
  112. package/build-types/navigation/use-navigation-tree-nodes.d.ts.map +1 -0
  113. package/build-types/navigation/utils.d.ts +3 -0
  114. package/build-types/navigation/utils.d.ts.map +1 -0
  115. package/build-types/unit-control/utils.d.ts.map +1 -1
  116. package/build-types/validated-form-controls/components/combobox-control.d.ts +2 -2
  117. package/build-types/visually-hidden/test/index.d.ts +2 -0
  118. package/build-types/visually-hidden/test/index.d.ts.map +1 -0
  119. package/package.json +34 -32
  120. package/src/card/card/README.md +4 -4
  121. package/src/checkbox-control/README.md +1 -1
  122. package/src/clipboard-button/README.md +4 -4
  123. package/src/color-palette/index.tsx +5 -0
  124. package/src/color-palette/test/index.tsx +30 -0
  125. package/src/combobox-control/README.md +1 -1
  126. package/src/confirm-dialog/README.md +1 -1
  127. package/src/custom-gradient-picker/gradient-bar/index.tsx +1 -1
  128. package/src/flex/flex/README.md +1 -1
  129. package/src/navigable-container/container.tsx +22 -30
  130. package/src/popover/README.md +1 -1
  131. package/src/scrollable/README.md +1 -1
  132. package/src/tooltip/style.scss +1 -1
  133. package/src/unit-control/utils.ts +33 -52
  134. package/build/mobile/image/constants.cjs +0 -34
  135. package/build/mobile/image/constants.cjs.map +0 -7
  136. package/build-module/mobile/image/constants.mjs +0 -9
  137. package/build-module/mobile/image/constants.mjs.map +0 -7
  138. package/src/autocomplete/autocompleter-ui.native.js +0 -211
  139. package/src/autocomplete/background-view.android.js +0 -25
  140. package/src/autocomplete/background-view.ios.js +0 -23
  141. package/src/autocomplete/style.android.scss +0 -7
  142. package/src/autocomplete/style.native.scss +0 -74
  143. package/src/base-control/index.native.js +0 -14
  144. package/src/button/index.native.js +0 -236
  145. package/src/button/style.native.scss +0 -9
  146. package/src/color-control/index.native.js +0 -24
  147. package/src/color-indicator/index.native.js +0 -80
  148. package/src/color-indicator/style.native.scss +0 -51
  149. package/src/color-palette/index.native.js +0 -360
  150. package/src/color-palette/style.native.scss +0 -49
  151. package/src/color-picker/hsv-color-picker.native.js +0 -88
  152. package/src/color-picker/hue-picker.native.js +0 -198
  153. package/src/color-picker/index.native.js +0 -215
  154. package/src/color-picker/saturation-picker.native.js +0 -167
  155. package/src/color-picker/style.native.scss +0 -87
  156. package/src/custom-gradient-picker/index.native.js +0 -110
  157. package/src/custom-gradient-picker/style.native.scss +0 -3
  158. package/src/dashicon/index.native.js +0 -18
  159. package/src/disabled/index.native.js +0 -10
  160. package/src/draggable/index.native.js +0 -234
  161. package/src/draggable/style.native.scss +0 -3
  162. package/src/draggable/test/index.native.js +0 -138
  163. package/src/dropdown/index.native.js +0 -59
  164. package/src/dropdown-menu/index.native.js +0 -152
  165. package/src/external-link/index.native.js +0 -25
  166. package/src/focal-point-picker/focal-point.native.js +0 -30
  167. package/src/focal-point-picker/index.native.js +0 -281
  168. package/src/focal-point-picker/tooltip/index.native.js +0 -144
  169. package/src/focal-point-picker/tooltip/style.native.scss +0 -42
  170. package/src/font-size-picker/index.native.js +0 -190
  171. package/src/font-size-picker/style.native.scss +0 -6
  172. package/src/footer-message-control/index.native.js +0 -14
  173. package/src/higher-order/with-focus-outside/index.native.js +0 -38
  174. package/src/index.native.js +0 -134
  175. package/src/keyboard-shortcuts/index.native.js +0 -2
  176. package/src/mobile/README.md +0 -3
  177. package/src/mobile/autocompletion-items.native.js +0 -11
  178. package/src/mobile/badge/README.md +0 -31
  179. package/src/mobile/badge/index.native.js +0 -27
  180. package/src/mobile/badge/style.scss +0 -18
  181. package/src/mobile/bottom-sheet/borderStyles.android.scss +0 -8
  182. package/src/mobile/bottom-sheet/borderStyles.ios.scss +0 -9
  183. package/src/mobile/bottom-sheet/bottom-sheet-context.native.js +0 -40
  184. package/src/mobile/bottom-sheet/bottom-sheet-navigation/README.md +0 -101
  185. package/src/mobile/bottom-sheet/bottom-sheet-navigation/bottom-sheet-navigation-context.native.js +0 -16
  186. package/src/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +0 -193
  187. package/src/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +0 -146
  188. package/src/mobile/bottom-sheet/bottom-sheet-navigation/styles.native.scss +0 -11
  189. package/src/mobile/bottom-sheet/bottom-sheet-navigation/test/navigation-container.native.js +0 -197
  190. package/src/mobile/bottom-sheet/button.native.js +0 -19
  191. package/src/mobile/bottom-sheet/cell.native.js +0 -464
  192. package/src/mobile/bottom-sheet/cellStyles.android.scss +0 -15
  193. package/src/mobile/bottom-sheet/cellStyles.ios.scss +0 -19
  194. package/src/mobile/bottom-sheet/chevron-back.native.js +0 -18
  195. package/src/mobile/bottom-sheet/color-cell.native.js +0 -35
  196. package/src/mobile/bottom-sheet/cycle-picker-cell.native.js +0 -31
  197. package/src/mobile/bottom-sheet/footer-message-cell.native.js +0 -23
  198. package/src/mobile/bottom-sheet/footer-message-link/README.md +0 -37
  199. package/src/mobile/bottom-sheet/footer-message-link/footer-message-link.native.js +0 -26
  200. package/src/mobile/bottom-sheet/footer-message-link/styles.native.scss +0 -7
  201. package/src/mobile/bottom-sheet/index.native.js +0 -646
  202. package/src/mobile/bottom-sheet/keyboard-avoiding-view.native.js +0 -125
  203. package/src/mobile/bottom-sheet/link-cell.native.js +0 -35
  204. package/src/mobile/bottom-sheet/link-suggestion-item-cell.native.js +0 -92
  205. package/src/mobile/bottom-sheet/link-suggestion-styles.native.scss +0 -27
  206. package/src/mobile/bottom-sheet/lock-icon/index.native.js +0 -19
  207. package/src/mobile/bottom-sheet/lock-icon/styles.native.scss +0 -8
  208. package/src/mobile/bottom-sheet/nav-bar/README.md +0 -63
  209. package/src/mobile/bottom-sheet/nav-bar/action-button.native.js +0 -30
  210. package/src/mobile/bottom-sheet/nav-bar/apply-button.native.js +0 -53
  211. package/src/mobile/bottom-sheet/nav-bar/back-button.native.js +0 -94
  212. package/src/mobile/bottom-sheet/nav-bar/heading.native.js +0 -33
  213. package/src/mobile/bottom-sheet/nav-bar/index.native.js +0 -23
  214. package/src/mobile/bottom-sheet/nav-bar/styles.native.scss +0 -69
  215. package/src/mobile/bottom-sheet/picker-cell.native.js +0 -40
  216. package/src/mobile/bottom-sheet/radio-cell.native.js +0 -39
  217. package/src/mobile/bottom-sheet/range-cell.native.js +0 -274
  218. package/src/mobile/bottom-sheet/range-cell.native.scss +0 -40
  219. package/src/mobile/bottom-sheet/range-text-input.native.js +0 -248
  220. package/src/mobile/bottom-sheet/ripple.native.js +0 -83
  221. package/src/mobile/bottom-sheet/ripple.native.scss +0 -11
  222. package/src/mobile/bottom-sheet/stepper-cell/index.native.js +0 -264
  223. package/src/mobile/bottom-sheet/stepper-cell/stepper.android.js +0 -78
  224. package/src/mobile/bottom-sheet/stepper-cell/stepper.ios.js +0 -64
  225. package/src/mobile/bottom-sheet/stepper-cell/style.native.scss +0 -89
  226. package/src/mobile/bottom-sheet/styles.native.scss +0 -333
  227. package/src/mobile/bottom-sheet/sub-sheet/README.md +0 -90
  228. package/src/mobile/bottom-sheet/sub-sheet/index.native.js +0 -49
  229. package/src/mobile/bottom-sheet/switch-cell.native.js +0 -75
  230. package/src/mobile/bottom-sheet/test/index.native.js +0 -24
  231. package/src/mobile/bottom-sheet/test/range-cell.native.js +0 -73
  232. package/src/mobile/bottom-sheet-select-control/README.md +0 -97
  233. package/src/mobile/bottom-sheet-select-control/index.native.js +0 -124
  234. package/src/mobile/bottom-sheet-select-control/style.native.scss +0 -3
  235. package/src/mobile/bottom-sheet-text-control/README.md +0 -98
  236. package/src/mobile/bottom-sheet-text-control/index.native.js +0 -104
  237. package/src/mobile/bottom-sheet-text-control/styles.scss +0 -25
  238. package/src/mobile/clipboard/index.native.js +0 -18
  239. package/src/mobile/color-settings/gradient-picker-screen.native.js +0 -37
  240. package/src/mobile/color-settings/index.native.js +0 -88
  241. package/src/mobile/color-settings/palette.screen.native.js +0 -232
  242. package/src/mobile/color-settings/picker-screen.native.js +0 -60
  243. package/src/mobile/color-settings/style.native.scss +0 -62
  244. package/src/mobile/color-settings/utils.native.js +0 -36
  245. package/src/mobile/cycle-select-control/README.md +0 -3
  246. package/src/mobile/cycle-select-control/index.native.js +0 -39
  247. package/src/mobile/dashicons/index.native.js +0 -22
  248. package/src/mobile/focal-point-settings-panel/index.native.js +0 -84
  249. package/src/mobile/focal-point-settings-panel/styles.native.scss +0 -3
  250. package/src/mobile/gradient/index.native.js +0 -188
  251. package/src/mobile/gradient/style.native.scss +0 -8
  252. package/src/mobile/gradient/test/index.native.js +0 -114
  253. package/src/mobile/gridicons/index.native.js +0 -39
  254. package/src/mobile/html-text-input/index.native.js +0 -169
  255. package/src/mobile/html-text-input/style.android.scss +0 -8
  256. package/src/mobile/html-text-input/style.ios.scss +0 -10
  257. package/src/mobile/html-text-input/style.scss +0 -45
  258. package/src/mobile/html-text-input/test/__snapshots__/index.native.js.snap +0 -48
  259. package/src/mobile/html-text-input/test/index.native.js +0 -118
  260. package/src/mobile/image/constants.js +0 -1
  261. package/src/mobile/image/icon-customize.native.js +0 -10
  262. package/src/mobile/image/icon-retry.native.js +0 -11
  263. package/src/mobile/image/image-editing-button.native.js +0 -63
  264. package/src/mobile/image/index.native.js +0 -401
  265. package/src/mobile/image/style.native.scss +0 -179
  266. package/src/mobile/image/utils/index.native.js +0 -58
  267. package/src/mobile/keyboard-avoiding-view/index.android.js +0 -8
  268. package/src/mobile/keyboard-avoiding-view/index.ios.js +0 -143
  269. package/src/mobile/keyboard-avoiding-view/styles.native.scss +0 -9
  270. package/src/mobile/keyboard-aware-flat-list/index.android.js +0 -81
  271. package/src/mobile/keyboard-aware-flat-list/index.ios.js +0 -147
  272. package/src/mobile/keyboard-aware-flat-list/shared.native.js +0 -26
  273. package/src/mobile/keyboard-aware-flat-list/styles.native.scss +0 -8
  274. package/src/mobile/keyboard-aware-flat-list/test/use-keyboard-offset.native.js +0 -203
  275. package/src/mobile/keyboard-aware-flat-list/test/use-scroll-to-section.native.js +0 -142
  276. package/src/mobile/keyboard-aware-flat-list/test/use-scroll.native.js +0 -71
  277. package/src/mobile/keyboard-aware-flat-list/test/use-text-input-caret-position.native.js +0 -82
  278. package/src/mobile/keyboard-aware-flat-list/test/use-text-input-offset.native.js +0 -147
  279. package/src/mobile/keyboard-aware-flat-list/use-keyboard-offset.native.js +0 -87
  280. package/src/mobile/keyboard-aware-flat-list/use-scroll-to-element.native.js +0 -41
  281. package/src/mobile/keyboard-aware-flat-list/use-scroll-to-section.native.js +0 -100
  282. package/src/mobile/keyboard-aware-flat-list/use-scroll.native.js +0 -100
  283. package/src/mobile/keyboard-aware-flat-list/use-text-input-caret-position.native.js +0 -36
  284. package/src/mobile/keyboard-aware-flat-list/use-text-input-offset.native.js +0 -54
  285. package/src/mobile/layout-animation/index.native.js +0 -16
  286. package/src/mobile/link-picker/index.native.js +0 -160
  287. package/src/mobile/link-picker/link-picker-results.native.js +0 -129
  288. package/src/mobile/link-picker/link-picker-screen.native.js +0 -60
  289. package/src/mobile/link-picker/styles.native.scss +0 -45
  290. package/src/mobile/link-picker/test/performance/index.native.js +0 -35
  291. package/src/mobile/link-settings/index.native.js +0 -332
  292. package/src/mobile/link-settings/link-rel.native.js +0 -10
  293. package/src/mobile/link-settings/link-settings-navigation.native.js +0 -50
  294. package/src/mobile/link-settings/link-settings-screen.native.js +0 -44
  295. package/src/mobile/link-settings/style.native.scss +0 -4
  296. package/src/mobile/link-settings/test/edit.native.js +0 -325
  297. package/src/mobile/link-settings/test/link-settings-navigation.native.js +0 -94
  298. package/src/mobile/media-edit/index.native.js +0 -125
  299. package/src/mobile/picker/index.android.js +0 -104
  300. package/src/mobile/picker/index.ios.js +0 -96
  301. package/src/mobile/picker/styles.native.scss +0 -29
  302. package/src/mobile/segmented-control/index.native.js +0 -186
  303. package/src/mobile/segmented-control/style.native.scss +0 -99
  304. package/src/mobile/utils/alignments.native.js +0 -78
  305. package/src/mobile/utils/get-px-from-css-unit.native.js +0 -329
  306. package/src/mobile/utils/index.native.js +0 -12
  307. package/src/mobile/utils/test/get-px-from-css-unit.native.js +0 -172
  308. package/src/mobile/utils/test/index.native.js +0 -134
  309. package/src/mobile/utils/use-is-floating-keyboard.native.js +0 -31
  310. package/src/mobile/utils/use-unit-converter-to-mobile.native.js +0 -90
  311. package/src/notice/index.native.js +0 -123
  312. package/src/notice/list.native.js +0 -55
  313. package/src/notice/style.native.scss +0 -60
  314. package/src/panel/actions.native.js +0 -46
  315. package/src/panel/actions.native.scss +0 -12
  316. package/src/panel/body.native.js +0 -29
  317. package/src/panel/body.native.scss +0 -11
  318. package/src/panel/bottom-separator-cover.native.js +0 -27
  319. package/src/panel/bottom-separator-cover.native.scss +0 -9
  320. package/src/private-apis.native.js +0 -13
  321. package/src/query-controls/index.native.js +0 -103
  322. package/src/radio-control/index.native.js +0 -24
  323. package/src/range-control/index.native.js +0 -73
  324. package/src/resizable-box/index.native.js +0 -32
  325. package/src/resizable-box/style.native.scss +0 -14
  326. package/src/sandbox/index.native.js +0 -392
  327. package/src/sandbox/style.native.scss +0 -7
  328. package/src/search-control/index.native.js +0 -274
  329. package/src/search-control/platform-style.android.scss +0 -57
  330. package/src/search-control/platform-style.ios.scss +0 -43
  331. package/src/search-control/style.native.scss +0 -63
  332. package/src/select-control/index.native.js +0 -41
  333. package/src/slot-fill/index.native.js +0 -25
  334. package/src/spinner/index.native.js +0 -22
  335. package/src/spinner/style.native.scss +0 -4
  336. package/src/style-provider/index.native.js +0 -3
  337. package/src/text/index.native.js +0 -13
  338. package/src/text/styles/emotion-css.native.js +0 -6
  339. package/src/text/styles/font-family.native.js +0 -1
  340. package/src/text/styles/text-mixins.native.js +0 -163
  341. package/src/text-control/index.native.js +0 -41
  342. package/src/textarea-control/index.native.js +0 -26
  343. package/src/toggle-control/index.native.js +0 -31
  344. package/src/toolbar/toolbar/style.native.scss +0 -11
  345. package/src/toolbar/toolbar/toolbar-container.native.js +0 -8
  346. package/src/toolbar/toolbar-button/toolbar-button-container.native.js +0 -8
  347. package/src/toolbar/toolbar-group/style.native.scss +0 -10
  348. package/src/toolbar/toolbar-group/toolbar-group-collapsed.native.js +0 -36
  349. package/src/toolbar/toolbar-group/toolbar-group-container.native.js +0 -26
  350. package/src/toolbar/toolbar-item/index.native.js +0 -17
  351. package/src/tooltip/index.native.js +0 -292
  352. package/src/tooltip/style.native.scss +0 -39
  353. package/src/tooltip/test/index.native.js +0 -98
  354. package/src/unit-control/index.native.js +0 -202
  355. package/src/unit-control/style.native.scss +0 -19
@@ -34,204 +34,202 @@ __export(utils_exports, {
34
34
  });
35
35
  module.exports = __toCommonJS(utils_exports);
36
36
  var import_i18n = require("@wordpress/i18n");
37
- var import_element = require("@wordpress/element");
38
- var isWeb = import_element.Platform.OS === "web";
39
37
  var allUnits = {
40
38
  px: {
41
39
  value: "px",
42
- label: isWeb ? "px" : (0, import_i18n.__)("Pixels (px)"),
40
+ label: "px",
43
41
  a11yLabel: (0, import_i18n.__)("Pixels (px)"),
44
42
  step: 1
45
43
  },
46
44
  "%": {
47
45
  value: "%",
48
- label: isWeb ? "%" : (0, import_i18n.__)("Percentage (%)"),
46
+ label: "%",
49
47
  a11yLabel: (0, import_i18n.__)("Percent (%)"),
50
48
  step: 0.1
51
49
  },
52
50
  em: {
53
51
  value: "em",
54
- label: isWeb ? "em" : (0, import_i18n.__)("Relative to parent font size (em)"),
52
+ label: "em",
55
53
  a11yLabel: (0, import_i18n._x)("ems", "Relative to parent font size (em)"),
56
54
  step: 0.01
57
55
  },
58
56
  rem: {
59
57
  value: "rem",
60
- label: isWeb ? "rem" : (0, import_i18n.__)("Relative to root font size (rem)"),
58
+ label: "rem",
61
59
  a11yLabel: (0, import_i18n._x)("rems", "Relative to root font size (rem)"),
62
60
  step: 0.01
63
61
  },
64
62
  vw: {
65
63
  value: "vw",
66
- label: isWeb ? "vw" : (0, import_i18n.__)("Viewport width (vw)"),
64
+ label: "vw",
67
65
  a11yLabel: (0, import_i18n.__)("Viewport width (vw)"),
68
66
  step: 0.1
69
67
  },
70
68
  vh: {
71
69
  value: "vh",
72
- label: isWeb ? "vh" : (0, import_i18n.__)("Viewport height (vh)"),
70
+ label: "vh",
73
71
  a11yLabel: (0, import_i18n.__)("Viewport height (vh)"),
74
72
  step: 0.1
75
73
  },
76
74
  vmin: {
77
75
  value: "vmin",
78
- label: isWeb ? "vmin" : (0, import_i18n.__)("Viewport smallest dimension (vmin)"),
76
+ label: "vmin",
79
77
  a11yLabel: (0, import_i18n.__)("Viewport smallest dimension (vmin)"),
80
78
  step: 0.1
81
79
  },
82
80
  vmax: {
83
81
  value: "vmax",
84
- label: isWeb ? "vmax" : (0, import_i18n.__)("Viewport largest dimension (vmax)"),
82
+ label: "vmax",
85
83
  a11yLabel: (0, import_i18n.__)("Viewport largest dimension (vmax)"),
86
84
  step: 0.1
87
85
  },
88
86
  ch: {
89
87
  value: "ch",
90
- label: isWeb ? "ch" : (0, import_i18n.__)("Width of the zero (0) character (ch)"),
88
+ label: "ch",
91
89
  a11yLabel: (0, import_i18n.__)("Width of the zero (0) character (ch)"),
92
90
  step: 0.01
93
91
  },
94
92
  ex: {
95
93
  value: "ex",
96
- label: isWeb ? "ex" : (0, import_i18n.__)("x-height of the font (ex)"),
94
+ label: "ex",
97
95
  a11yLabel: (0, import_i18n.__)("x-height of the font (ex)"),
98
96
  step: 0.01
99
97
  },
100
98
  cm: {
101
99
  value: "cm",
102
- label: isWeb ? "cm" : (0, import_i18n.__)("Centimeters (cm)"),
100
+ label: "cm",
103
101
  a11yLabel: (0, import_i18n.__)("Centimeters (cm)"),
104
102
  step: 1e-3
105
103
  },
106
104
  mm: {
107
105
  value: "mm",
108
- label: isWeb ? "mm" : (0, import_i18n.__)("Millimeters (mm)"),
106
+ label: "mm",
109
107
  a11yLabel: (0, import_i18n.__)("Millimeters (mm)"),
110
108
  step: 0.1
111
109
  },
112
110
  in: {
113
111
  value: "in",
114
- label: isWeb ? "in" : (0, import_i18n.__)("Inches (in)"),
112
+ label: "in",
115
113
  a11yLabel: (0, import_i18n.__)("Inches (in)"),
116
114
  step: 1e-3
117
115
  },
118
116
  pc: {
119
117
  value: "pc",
120
- label: isWeb ? "pc" : (0, import_i18n.__)("Picas (pc)"),
118
+ label: "pc",
121
119
  a11yLabel: (0, import_i18n.__)("Picas (pc)"),
122
120
  step: 1
123
121
  },
124
122
  pt: {
125
123
  value: "pt",
126
- label: isWeb ? "pt" : (0, import_i18n.__)("Points (pt)"),
124
+ label: "pt",
127
125
  a11yLabel: (0, import_i18n.__)("Points (pt)"),
128
126
  step: 1
129
127
  },
130
128
  svw: {
131
129
  value: "svw",
132
- label: isWeb ? "svw" : (0, import_i18n.__)("Small viewport width (svw)"),
130
+ label: "svw",
133
131
  a11yLabel: (0, import_i18n.__)("Small viewport width (svw)"),
134
132
  step: 0.1
135
133
  },
136
134
  svh: {
137
135
  value: "svh",
138
- label: isWeb ? "svh" : (0, import_i18n.__)("Small viewport height (svh)"),
136
+ label: "svh",
139
137
  a11yLabel: (0, import_i18n.__)("Small viewport height (svh)"),
140
138
  step: 0.1
141
139
  },
142
140
  svi: {
143
141
  value: "svi",
144
- label: isWeb ? "svi" : (0, import_i18n.__)("Viewport smallest size in the inline direction (svi)"),
142
+ label: "svi",
145
143
  a11yLabel: (0, import_i18n.__)("Small viewport width or height (svi)"),
146
144
  step: 0.1
147
145
  },
148
146
  svb: {
149
147
  value: "svb",
150
- label: isWeb ? "svb" : (0, import_i18n.__)("Viewport smallest size in the block direction (svb)"),
148
+ label: "svb",
151
149
  a11yLabel: (0, import_i18n.__)("Small viewport width or height (svb)"),
152
150
  step: 0.1
153
151
  },
154
152
  svmin: {
155
153
  value: "svmin",
156
- label: isWeb ? "svmin" : (0, import_i18n.__)("Small viewport smallest dimension (svmin)"),
154
+ label: "svmin",
157
155
  a11yLabel: (0, import_i18n.__)("Small viewport smallest dimension (svmin)"),
158
156
  step: 0.1
159
157
  },
160
158
  lvw: {
161
159
  value: "lvw",
162
- label: isWeb ? "lvw" : (0, import_i18n.__)("Large viewport width (lvw)"),
160
+ label: "lvw",
163
161
  a11yLabel: (0, import_i18n.__)("Large viewport width (lvw)"),
164
162
  step: 0.1
165
163
  },
166
164
  lvh: {
167
165
  value: "lvh",
168
- label: isWeb ? "lvh" : (0, import_i18n.__)("Large viewport height (lvh)"),
166
+ label: "lvh",
169
167
  a11yLabel: (0, import_i18n.__)("Large viewport height (lvh)"),
170
168
  step: 0.1
171
169
  },
172
170
  lvi: {
173
171
  value: "lvi",
174
- label: isWeb ? "lvi" : (0, import_i18n.__)("Large viewport width or height (lvi)"),
172
+ label: "lvi",
175
173
  a11yLabel: (0, import_i18n.__)("Large viewport width or height (lvi)"),
176
174
  step: 0.1
177
175
  },
178
176
  lvb: {
179
177
  value: "lvb",
180
- label: isWeb ? "lvb" : (0, import_i18n.__)("Large viewport width or height (lvb)"),
178
+ label: "lvb",
181
179
  a11yLabel: (0, import_i18n.__)("Large viewport width or height (lvb)"),
182
180
  step: 0.1
183
181
  },
184
182
  lvmin: {
185
183
  value: "lvmin",
186
- label: isWeb ? "lvmin" : (0, import_i18n.__)("Large viewport smallest dimension (lvmin)"),
184
+ label: "lvmin",
187
185
  a11yLabel: (0, import_i18n.__)("Large viewport smallest dimension (lvmin)"),
188
186
  step: 0.1
189
187
  },
190
188
  dvw: {
191
189
  value: "dvw",
192
- label: isWeb ? "dvw" : (0, import_i18n.__)("Dynamic viewport width (dvw)"),
190
+ label: "dvw",
193
191
  a11yLabel: (0, import_i18n.__)("Dynamic viewport width (dvw)"),
194
192
  step: 0.1
195
193
  },
196
194
  dvh: {
197
195
  value: "dvh",
198
- label: isWeb ? "dvh" : (0, import_i18n.__)("Dynamic viewport height (dvh)"),
196
+ label: "dvh",
199
197
  a11yLabel: (0, import_i18n.__)("Dynamic viewport height (dvh)"),
200
198
  step: 0.1
201
199
  },
202
200
  dvi: {
203
201
  value: "dvi",
204
- label: isWeb ? "dvi" : (0, import_i18n.__)("Dynamic viewport width or height (dvi)"),
202
+ label: "dvi",
205
203
  a11yLabel: (0, import_i18n.__)("Dynamic viewport width or height (dvi)"),
206
204
  step: 0.1
207
205
  },
208
206
  dvb: {
209
207
  value: "dvb",
210
- label: isWeb ? "dvb" : (0, import_i18n.__)("Dynamic viewport width or height (dvb)"),
208
+ label: "dvb",
211
209
  a11yLabel: (0, import_i18n.__)("Dynamic viewport width or height (dvb)"),
212
210
  step: 0.1
213
211
  },
214
212
  dvmin: {
215
213
  value: "dvmin",
216
- label: isWeb ? "dvmin" : (0, import_i18n.__)("Dynamic viewport smallest dimension (dvmin)"),
214
+ label: "dvmin",
217
215
  a11yLabel: (0, import_i18n.__)("Dynamic viewport smallest dimension (dvmin)"),
218
216
  step: 0.1
219
217
  },
220
218
  dvmax: {
221
219
  value: "dvmax",
222
- label: isWeb ? "dvmax" : (0, import_i18n.__)("Dynamic viewport largest dimension (dvmax)"),
220
+ label: "dvmax",
223
221
  a11yLabel: (0, import_i18n.__)("Dynamic viewport largest dimension (dvmax)"),
224
222
  step: 0.1
225
223
  },
226
224
  svmax: {
227
225
  value: "svmax",
228
- label: isWeb ? "svmax" : (0, import_i18n.__)("Small viewport largest dimension (svmax)"),
226
+ label: "svmax",
229
227
  a11yLabel: (0, import_i18n.__)("Small viewport largest dimension (svmax)"),
230
228
  step: 0.1
231
229
  },
232
230
  lvmax: {
233
231
  value: "lvmax",
234
- label: isWeb ? "lvmax" : (0, import_i18n.__)("Large viewport largest dimension (lvmax)"),
232
+ label: "lvmax",
235
233
  a11yLabel: (0, import_i18n.__)("Large viewport largest dimension (lvmax)"),
236
234
  step: 0.1
237
235
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/unit-control/utils.ts"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport { Platform } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\n\nconst isWeb = Platform.OS === 'web';\nconst allUnits = {\n px: {\n value: 'px',\n label: isWeb ? 'px' : __('Pixels (px)'),\n a11yLabel: __('Pixels (px)'),\n step: 1\n },\n '%': {\n value: '%',\n label: isWeb ? '%' : __('Percentage (%)'),\n a11yLabel: __('Percent (%)'),\n step: 0.1\n },\n em: {\n value: 'em',\n label: isWeb ? 'em' : __('Relative to parent font size (em)'),\n a11yLabel: _x('ems', 'Relative to parent font size (em)'),\n step: 0.01\n },\n rem: {\n value: 'rem',\n label: isWeb ? 'rem' : __('Relative to root font size (rem)'),\n a11yLabel: _x('rems', 'Relative to root font size (rem)'),\n step: 0.01\n },\n vw: {\n value: 'vw',\n label: isWeb ? 'vw' : __('Viewport width (vw)'),\n a11yLabel: __('Viewport width (vw)'),\n step: 0.1\n },\n vh: {\n value: 'vh',\n label: isWeb ? 'vh' : __('Viewport height (vh)'),\n a11yLabel: __('Viewport height (vh)'),\n step: 0.1\n },\n vmin: {\n value: 'vmin',\n label: isWeb ? 'vmin' : __('Viewport smallest dimension (vmin)'),\n a11yLabel: __('Viewport smallest dimension (vmin)'),\n step: 0.1\n },\n vmax: {\n value: 'vmax',\n label: isWeb ? 'vmax' : __('Viewport largest dimension (vmax)'),\n a11yLabel: __('Viewport largest dimension (vmax)'),\n step: 0.1\n },\n ch: {\n value: 'ch',\n label: isWeb ? 'ch' : __('Width of the zero (0) character (ch)'),\n a11yLabel: __('Width of the zero (0) character (ch)'),\n step: 0.01\n },\n ex: {\n value: 'ex',\n label: isWeb ? 'ex' : __('x-height of the font (ex)'),\n a11yLabel: __('x-height of the font (ex)'),\n step: 0.01\n },\n cm: {\n value: 'cm',\n label: isWeb ? 'cm' : __('Centimeters (cm)'),\n a11yLabel: __('Centimeters (cm)'),\n step: 0.001\n },\n mm: {\n value: 'mm',\n label: isWeb ? 'mm' : __('Millimeters (mm)'),\n a11yLabel: __('Millimeters (mm)'),\n step: 0.1\n },\n in: {\n value: 'in',\n label: isWeb ? 'in' : __('Inches (in)'),\n a11yLabel: __('Inches (in)'),\n step: 0.001\n },\n pc: {\n value: 'pc',\n label: isWeb ? 'pc' : __('Picas (pc)'),\n a11yLabel: __('Picas (pc)'),\n step: 1\n },\n pt: {\n value: 'pt',\n label: isWeb ? 'pt' : __('Points (pt)'),\n a11yLabel: __('Points (pt)'),\n step: 1\n },\n svw: {\n value: 'svw',\n label: isWeb ? 'svw' : __('Small viewport width (svw)'),\n a11yLabel: __('Small viewport width (svw)'),\n step: 0.1\n },\n svh: {\n value: 'svh',\n label: isWeb ? 'svh' : __('Small viewport height (svh)'),\n a11yLabel: __('Small viewport height (svh)'),\n step: 0.1\n },\n svi: {\n value: 'svi',\n label: isWeb ? 'svi' : __('Viewport smallest size in the inline direction (svi)'),\n a11yLabel: __('Small viewport width or height (svi)'),\n step: 0.1\n },\n svb: {\n value: 'svb',\n label: isWeb ? 'svb' : __('Viewport smallest size in the block direction (svb)'),\n a11yLabel: __('Small viewport width or height (svb)'),\n step: 0.1\n },\n svmin: {\n value: 'svmin',\n label: isWeb ? 'svmin' : __('Small viewport smallest dimension (svmin)'),\n a11yLabel: __('Small viewport smallest dimension (svmin)'),\n step: 0.1\n },\n lvw: {\n value: 'lvw',\n label: isWeb ? 'lvw' : __('Large viewport width (lvw)'),\n a11yLabel: __('Large viewport width (lvw)'),\n step: 0.1\n },\n lvh: {\n value: 'lvh',\n label: isWeb ? 'lvh' : __('Large viewport height (lvh)'),\n a11yLabel: __('Large viewport height (lvh)'),\n step: 0.1\n },\n lvi: {\n value: 'lvi',\n label: isWeb ? 'lvi' : __('Large viewport width or height (lvi)'),\n a11yLabel: __('Large viewport width or height (lvi)'),\n step: 0.1\n },\n lvb: {\n value: 'lvb',\n label: isWeb ? 'lvb' : __('Large viewport width or height (lvb)'),\n a11yLabel: __('Large viewport width or height (lvb)'),\n step: 0.1\n },\n lvmin: {\n value: 'lvmin',\n label: isWeb ? 'lvmin' : __('Large viewport smallest dimension (lvmin)'),\n a11yLabel: __('Large viewport smallest dimension (lvmin)'),\n step: 0.1\n },\n dvw: {\n value: 'dvw',\n label: isWeb ? 'dvw' : __('Dynamic viewport width (dvw)'),\n a11yLabel: __('Dynamic viewport width (dvw)'),\n step: 0.1\n },\n dvh: {\n value: 'dvh',\n label: isWeb ? 'dvh' : __('Dynamic viewport height (dvh)'),\n a11yLabel: __('Dynamic viewport height (dvh)'),\n step: 0.1\n },\n dvi: {\n value: 'dvi',\n label: isWeb ? 'dvi' : __('Dynamic viewport width or height (dvi)'),\n a11yLabel: __('Dynamic viewport width or height (dvi)'),\n step: 0.1\n },\n dvb: {\n value: 'dvb',\n label: isWeb ? 'dvb' : __('Dynamic viewport width or height (dvb)'),\n a11yLabel: __('Dynamic viewport width or height (dvb)'),\n step: 0.1\n },\n dvmin: {\n value: 'dvmin',\n label: isWeb ? 'dvmin' : __('Dynamic viewport smallest dimension (dvmin)'),\n a11yLabel: __('Dynamic viewport smallest dimension (dvmin)'),\n step: 0.1\n },\n dvmax: {\n value: 'dvmax',\n label: isWeb ? 'dvmax' : __('Dynamic viewport largest dimension (dvmax)'),\n a11yLabel: __('Dynamic viewport largest dimension (dvmax)'),\n step: 0.1\n },\n svmax: {\n value: 'svmax',\n label: isWeb ? 'svmax' : __('Small viewport largest dimension (svmax)'),\n a11yLabel: __('Small viewport largest dimension (svmax)'),\n step: 0.1\n },\n lvmax: {\n value: 'lvmax',\n label: isWeb ? 'lvmax' : __('Large viewport largest dimension (lvmax)'),\n a11yLabel: __('Large viewport largest dimension (lvmax)'),\n step: 0.1\n }\n};\n\n/**\n * An array of all available CSS length units.\n */\nexport const ALL_CSS_UNITS = Object.values(allUnits);\n\n/**\n * Units of measurements. `a11yLabel` is used by screenreaders.\n */\nexport const CSS_UNITS = [allUnits.px, allUnits['%'], allUnits.em, allUnits.rem, allUnits.vw, allUnits.vh];\nexport const DEFAULT_UNIT = allUnits.px;\n\n/**\n * Handles legacy value + unit handling.\n * This component use to manage both incoming value and units separately.\n *\n * Moving forward, ideally the value should be a string that contains both\n * the value and unit, example: '10px'\n *\n * @param rawValue The raw value as a string (may or may not contain the unit)\n * @param fallbackUnit The unit used as a fallback, if not unit is detected in the `value`\n * @param allowedUnits Units to derive from.\n * @return The extracted quantity and unit. The quantity can be `undefined` in case the raw value\n * could not be parsed to a number correctly. The unit can be `undefined` in case the unit parse\n * from the raw value could not be matched against the list of allowed units.\n */\nexport function getParsedQuantityAndUnit(rawValue, fallbackUnit, allowedUnits) {\n const initialValue = fallbackUnit ? `${rawValue ?? ''}${fallbackUnit}` : rawValue;\n return parseQuantityAndUnitFromRawValue(initialValue, allowedUnits);\n}\n\n/**\n * Checks if units are defined.\n *\n * @param units List of units.\n * @return Whether the list actually contains any units.\n */\nexport function hasUnits(units) {\n // Although the `isArray` check shouldn't be necessary (given the signature of\n // this typed function), it's better to stay on the side of caution, since\n // this function may be called from un-typed environments.\n return Array.isArray(units) && !!units.length;\n}\n\n/**\n * Parses a quantity and unit from a raw string value, given a list of allowed\n * units and otherwise falling back to the default unit.\n *\n * @param rawValue The raw value as a string (may or may not contain the unit)\n * @param allowedUnits Units to derive from.\n * @return The extracted quantity and unit. The quantity can be `undefined` in case the raw value\n * could not be parsed to a number correctly. The unit can be `undefined` in case the unit parsed\n * from the raw value could not be matched against the list of allowed units.\n */\nexport function parseQuantityAndUnitFromRawValue(rawValue, allowedUnits = ALL_CSS_UNITS) {\n let trimmedValue;\n let quantityToReturn;\n if (typeof rawValue !== 'undefined' || rawValue === null) {\n trimmedValue = `${rawValue}`.trim();\n const parsedQuantity = parseFloat(trimmedValue);\n quantityToReturn = !isFinite(parsedQuantity) ? undefined : parsedQuantity;\n }\n const unitMatch = trimmedValue?.match(/[\\d.\\-\\+]*\\s*(.*)/);\n const matchedUnit = unitMatch?.[1]?.toLowerCase();\n let unitToReturn;\n if (hasUnits(allowedUnits)) {\n const match = allowedUnits.find(item => item.value === matchedUnit);\n unitToReturn = match?.value;\n } else {\n unitToReturn = DEFAULT_UNIT.value;\n }\n return [quantityToReturn, unitToReturn];\n}\n\n/**\n * Parses quantity and unit from a raw value. Validates parsed value, using fallback\n * value if invalid.\n *\n * @param rawValue The next value.\n * @param allowedUnits Units to derive from.\n * @param fallbackQuantity The fallback quantity, used in case it's not possible to parse a valid quantity from the raw value.\n * @param fallbackUnit The fallback unit, used in case it's not possible to parse a valid unit from the raw value.\n * @return The extracted quantity and unit. The quantity can be `undefined` in case the raw value\n * could not be parsed to a number correctly, and the `fallbackQuantity` was also `undefined`. The\n * unit can be `undefined` only if the unit parsed from the raw value could not be matched against\n * the list of allowed units, the `fallbackQuantity` is also `undefined` and the list of\n * `allowedUnits` is passed empty.\n */\nexport function getValidParsedQuantityAndUnit(rawValue, allowedUnits, fallbackQuantity, fallbackUnit) {\n const [parsedQuantity, parsedUnit] = parseQuantityAndUnitFromRawValue(rawValue, allowedUnits);\n\n // The parsed value from `parseQuantityAndUnitFromRawValue` should now be\n // either a real number or undefined. If undefined, use the fallback value.\n const quantityToReturn = parsedQuantity ?? fallbackQuantity;\n\n // If no unit is parsed from the raw value, or if the fallback unit is not\n // defined, use the first value from the list of allowed units as fallback.\n let unitToReturn = parsedUnit || fallbackUnit;\n if (!unitToReturn && hasUnits(allowedUnits)) {\n unitToReturn = allowedUnits[0].value;\n }\n return [quantityToReturn, unitToReturn];\n}\n\n/**\n * Takes a unit value and finds the matching accessibility label for the\n * unit abbreviation.\n *\n * @param unit Unit value (example: `px`)\n * @return a11y label for the unit abbreviation\n */\nexport function getAccessibleLabelForUnit(unit) {\n const match = ALL_CSS_UNITS.find(item => item.value === unit);\n return match?.a11yLabel ? match?.a11yLabel : match?.value;\n}\n\n/**\n * Filters available units based on values defined a list of allowed unit values.\n *\n * @param allowedUnitValues Collection of allowed unit value strings.\n * @param availableUnits Collection of available unit objects.\n * @return Filtered units.\n */\nexport function filterUnitsWithSettings(allowedUnitValues = [], availableUnits) {\n // Although the `isArray` check shouldn't be necessary (given the signature of\n // this typed function), it's better to stay on the side of caution, since\n // this function may be called from un-typed environments.\n return Array.isArray(availableUnits) ? availableUnits.filter(unit => allowedUnitValues.includes(unit.value)) : [];\n}\n\n/**\n * Custom hook to retrieve and consolidate units setting from add_theme_support().\n * TODO: ideally this hook shouldn't be needed\n * https://github.com/WordPress/gutenberg/pull/31822#discussion_r633280823\n *\n * @param args An object containing units, settingPath & defaultUnits.\n * @param args.units Collection of all potentially available units.\n * @param args.availableUnits Collection of unit value strings for filtering available units.\n * @param args.defaultValues Collection of default values for defined units. Example: `{ px: 350, em: 15 }`.\n *\n * @return Filtered list of units, with their default values updated following the `defaultValues`\n * argument's property.\n */\nexport const useCustomUnits = ({\n units = ALL_CSS_UNITS,\n availableUnits = [],\n defaultValues\n}) => {\n const customUnitsToReturn = filterUnitsWithSettings(availableUnits, units);\n if (!defaultValues) {\n return customUnitsToReturn;\n }\n return customUnitsToReturn.map(unit => {\n const [defaultValue] = defaultValues[unit.value] ? parseQuantityAndUnitFromRawValue(defaultValues[unit.value]) : [];\n return {\n ...unit,\n default: defaultValue\n };\n });\n};\n\n/**\n * Get available units with the unit for the currently selected value\n * prepended if it is not available in the list of units.\n *\n * This is useful to ensure that the current value's unit is always\n * accurately displayed in the UI, even if the intention is to hide\n * the availability of that unit.\n *\n * @param rawValue Selected value to parse.\n * @param legacyUnit Legacy unit value, if rawValue needs it appended.\n * @param units List of available units.\n *\n * @return A collection of units containing the unit for the current value.\n */\nexport function getUnitsWithCurrentUnit(rawValue, legacyUnit, units = ALL_CSS_UNITS) {\n const unitsToReturn = Array.isArray(units) ? [...units] : [];\n const [, currentUnit] = getParsedQuantityAndUnit(rawValue, legacyUnit, ALL_CSS_UNITS);\n if (currentUnit && !unitsToReturn.some(unit => unit.value === currentUnit)) {\n if (allUnits[currentUnit]) {\n unitsToReturn.unshift(allUnits[currentUnit]);\n }\n }\n return unitsToReturn;\n}"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAuB;AACvB,qBAAyB;AAMzB,IAAM,QAAQ,wBAAS,OAAO;AAC9B,IAAM,WAAW;AAAA,EACf,IAAI;AAAA,IACF,OAAO;AAAA,IACP,OAAO,QAAQ,WAAO,gBAAG,aAAa;AAAA,IACtC,eAAW,gBAAG,aAAa;AAAA,IAC3B,MAAM;AAAA,EACR;AAAA,EACA,KAAK;AAAA,IACH,OAAO;AAAA,IACP,OAAO,QAAQ,UAAM,gBAAG,gBAAgB;AAAA,IACxC,eAAW,gBAAG,aAAa;AAAA,IAC3B,MAAM;AAAA,EACR;AAAA,EACA,IAAI;AAAA,IACF,OAAO;AAAA,IACP,OAAO,QAAQ,WAAO,gBAAG,mCAAmC;AAAA,IAC5D,eAAW,gBAAG,OAAO,mCAAmC;AAAA,IACxD,MAAM;AAAA,EACR;AAAA,EACA,KAAK;AAAA,IACH,OAAO;AAAA,IACP,OAAO,QAAQ,YAAQ,gBAAG,kCAAkC;AAAA,IAC5D,eAAW,gBAAG,QAAQ,kCAAkC;AAAA,IACxD,MAAM;AAAA,EACR;AAAA,EACA,IAAI;AAAA,IACF,OAAO;AAAA,IACP,OAAO,QAAQ,WAAO,gBAAG,qBAAqB;AAAA,IAC9C,eAAW,gBAAG,qBAAqB;AAAA,IACnC,MAAM;AAAA,EACR;AAAA,EACA,IAAI;AAAA,IACF,OAAO;AAAA,IACP,OAAO,QAAQ,WAAO,gBAAG,sBAAsB;AAAA,IAC/C,eAAW,gBAAG,sBAAsB;AAAA,IACpC,MAAM;AAAA,EACR;AAAA,EACA,MAAM;AAAA,IACJ,OAAO;AA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*/\n\nconst allUnits = {\n px: {\n value: 'px',\n label: 'px',\n a11yLabel: __('Pixels (px)'),\n step: 1\n },\n '%': {\n value: '%',\n label: '%',\n a11yLabel: __('Percent (%)'),\n step: 0.1\n },\n em: {\n value: 'em',\n label: 'em',\n a11yLabel: _x('ems', 'Relative to parent font size (em)'),\n step: 0.01\n },\n rem: {\n value: 'rem',\n label: 'rem',\n a11yLabel: _x('rems', 'Relative to root font size (rem)'),\n step: 0.01\n },\n vw: {\n value: 'vw',\n label: 'vw',\n a11yLabel: __('Viewport width (vw)'),\n step: 0.1\n },\n vh: {\n value: 'vh',\n label: 'vh',\n a11yLabel: __('Viewport height (vh)'),\n step: 0.1\n },\n vmin: {\n value: 'vmin',\n label: 'vmin',\n a11yLabel: __('Viewport smallest dimension (vmin)'),\n step: 0.1\n },\n vmax: {\n value: 'vmax',\n label: 'vmax',\n a11yLabel: __('Viewport largest dimension (vmax)'),\n step: 0.1\n },\n ch: {\n value: 'ch',\n label: 'ch',\n a11yLabel: __('Width of the zero (0) character (ch)'),\n step: 0.01\n },\n ex: {\n value: 'ex',\n label: 'ex',\n a11yLabel: __('x-height of the font (ex)'),\n step: 0.01\n },\n cm: {\n value: 'cm',\n label: 'cm',\n a11yLabel: __('Centimeters (cm)'),\n step: 0.001\n },\n mm: {\n value: 'mm',\n label: 'mm',\n a11yLabel: __('Millimeters (mm)'),\n step: 0.1\n },\n in: {\n value: 'in',\n label: 'in',\n a11yLabel: __('Inches (in)'),\n step: 0.001\n },\n pc: {\n value: 'pc',\n label: 'pc',\n a11yLabel: __('Picas (pc)'),\n step: 1\n },\n pt: {\n value: 'pt',\n label: 'pt',\n a11yLabel: __('Points (pt)'),\n step: 1\n },\n svw: {\n value: 'svw',\n label: 'svw',\n a11yLabel: __('Small viewport width (svw)'),\n step: 0.1\n },\n svh: {\n value: 'svh',\n label: 'svh',\n a11yLabel: __('Small viewport height (svh)'),\n step: 0.1\n },\n svi: {\n value: 'svi',\n label: 'svi',\n a11yLabel: __('Small viewport width or height (svi)'),\n step: 0.1\n },\n svb: {\n value: 'svb',\n label: 'svb',\n a11yLabel: __('Small viewport width or height (svb)'),\n step: 0.1\n },\n svmin: {\n value: 'svmin',\n label: 'svmin',\n a11yLabel: __('Small viewport smallest dimension (svmin)'),\n step: 0.1\n },\n lvw: {\n value: 'lvw',\n label: 'lvw',\n a11yLabel: __('Large viewport width (lvw)'),\n step: 0.1\n },\n lvh: {\n value: 'lvh',\n label: 'lvh',\n a11yLabel: __('Large viewport height (lvh)'),\n step: 0.1\n },\n lvi: {\n value: 'lvi',\n label: 'lvi',\n a11yLabel: __('Large viewport width or height (lvi)'),\n step: 0.1\n },\n lvb: {\n value: 'lvb',\n label: 'lvb',\n a11yLabel: __('Large viewport width or height (lvb)'),\n step: 0.1\n },\n lvmin: {\n value: 'lvmin',\n label: 'lvmin',\n a11yLabel: __('Large viewport smallest dimension (lvmin)'),\n step: 0.1\n },\n dvw: {\n value: 'dvw',\n label: 'dvw',\n a11yLabel: __('Dynamic viewport width (dvw)'),\n step: 0.1\n },\n dvh: {\n value: 'dvh',\n label: 'dvh',\n a11yLabel: __('Dynamic viewport height (dvh)'),\n step: 0.1\n },\n dvi: {\n value: 'dvi',\n label: 'dvi',\n a11yLabel: __('Dynamic viewport width or height (dvi)'),\n step: 0.1\n },\n dvb: {\n value: 'dvb',\n label: 'dvb',\n a11yLabel: __('Dynamic viewport width or height (dvb)'),\n step: 0.1\n },\n dvmin: {\n value: 'dvmin',\n label: 'dvmin',\n a11yLabel: __('Dynamic viewport smallest dimension (dvmin)'),\n step: 0.1\n },\n dvmax: {\n value: 'dvmax',\n label: 'dvmax',\n a11yLabel: __('Dynamic viewport largest dimension (dvmax)'),\n step: 0.1\n },\n svmax: {\n value: 'svmax',\n label: 'svmax',\n a11yLabel: __('Small viewport largest dimension (svmax)'),\n step: 0.1\n },\n lvmax: {\n value: 'lvmax',\n label: 'lvmax',\n a11yLabel: __('Large viewport largest dimension (lvmax)'),\n step: 0.1\n }\n};\n\n/**\n * An array of all available CSS length units.\n */\nexport const ALL_CSS_UNITS = Object.values(allUnits);\n\n/**\n * Units of measurements. `a11yLabel` is used by screenreaders.\n */\nexport const CSS_UNITS = [allUnits.px, allUnits['%'], allUnits.em, allUnits.rem, allUnits.vw, allUnits.vh];\nexport const DEFAULT_UNIT = allUnits.px;\n\n/**\n * Handles legacy value + unit handling.\n * This component use to manage both incoming value and units separately.\n *\n * Moving forward, ideally the value should be a string that contains both\n * the value and unit, example: '10px'\n *\n * @param rawValue The raw value as a string (may or may not contain the unit)\n * @param fallbackUnit The unit used as a fallback, if not unit is detected in the `value`\n * @param allowedUnits Units to derive from.\n * @return The extracted quantity and unit. The quantity can be `undefined` in case the raw value\n * could not be parsed to a number correctly. The unit can be `undefined` in case the unit parse\n * from the raw value could not be matched against the list of allowed units.\n */\nexport function getParsedQuantityAndUnit(rawValue, fallbackUnit, allowedUnits) {\n const initialValue = fallbackUnit ? `${rawValue ?? ''}${fallbackUnit}` : rawValue;\n return parseQuantityAndUnitFromRawValue(initialValue, allowedUnits);\n}\n\n/**\n * Checks if units are defined.\n *\n * @param units List of units.\n * @return Whether the list actually contains any units.\n */\nexport function hasUnits(units) {\n // Although the `isArray` check shouldn't be necessary (given the signature of\n // this typed function), it's better to stay on the side of caution, since\n // this function may be called from un-typed environments.\n return Array.isArray(units) && !!units.length;\n}\n\n/**\n * Parses a quantity and unit from a raw string value, given a list of allowed\n * units and otherwise falling back to the default unit.\n *\n * @param rawValue The raw value as a string (may or may not contain the unit)\n * @param allowedUnits Units to derive from.\n * @return The extracted quantity and unit. The quantity can be `undefined` in case the raw value\n * could not be parsed to a number correctly. The unit can be `undefined` in case the unit parsed\n * from the raw value could not be matched against the list of allowed units.\n */\nexport function parseQuantityAndUnitFromRawValue(rawValue, allowedUnits = ALL_CSS_UNITS) {\n let trimmedValue;\n let quantityToReturn;\n if (typeof rawValue !== 'undefined' || rawValue === null) {\n trimmedValue = `${rawValue}`.trim();\n const parsedQuantity = parseFloat(trimmedValue);\n quantityToReturn = !isFinite(parsedQuantity) ? undefined : parsedQuantity;\n }\n const unitMatch = trimmedValue?.match(/[\\d.\\-\\+]*\\s*(.*)/);\n const matchedUnit = unitMatch?.[1]?.toLowerCase();\n let unitToReturn;\n if (hasUnits(allowedUnits)) {\n const match = allowedUnits.find(item => item.value === matchedUnit);\n unitToReturn = match?.value;\n } else {\n unitToReturn = DEFAULT_UNIT.value;\n }\n return [quantityToReturn, unitToReturn];\n}\n\n/**\n * Parses quantity and unit from a raw value. Validates parsed value, using fallback\n * value if invalid.\n *\n * @param rawValue The next value.\n * @param allowedUnits Units to derive from.\n * @param fallbackQuantity The fallback quantity, used in case it's not possible to parse a valid quantity from the raw value.\n * @param fallbackUnit The fallback unit, used in case it's not possible to parse a valid unit from the raw value.\n * @return The extracted quantity and unit. The quantity can be `undefined` in case the raw value\n * could not be parsed to a number correctly, and the `fallbackQuantity` was also `undefined`. The\n * unit can be `undefined` only if the unit parsed from the raw value could not be matched against\n * the list of allowed units, the `fallbackQuantity` is also `undefined` and the list of\n * `allowedUnits` is passed empty.\n */\nexport function getValidParsedQuantityAndUnit(rawValue, allowedUnits, fallbackQuantity, fallbackUnit) {\n const [parsedQuantity, parsedUnit] = parseQuantityAndUnitFromRawValue(rawValue, allowedUnits);\n\n // The parsed value from `parseQuantityAndUnitFromRawValue` should now be\n // either a real number or undefined. If undefined, use the fallback value.\n const quantityToReturn = parsedQuantity ?? fallbackQuantity;\n\n // If no unit is parsed from the raw value, or if the fallback unit is not\n // defined, use the first value from the list of allowed units as fallback.\n let unitToReturn = parsedUnit || fallbackUnit;\n if (!unitToReturn && hasUnits(allowedUnits)) {\n unitToReturn = allowedUnits[0].value;\n }\n return [quantityToReturn, unitToReturn];\n}\n\n/**\n * Takes a unit value and finds the matching accessibility label for the\n * unit abbreviation.\n *\n * @param unit Unit value (example: `px`)\n * @return a11y label for the unit abbreviation\n */\nexport function getAccessibleLabelForUnit(unit) {\n const match = ALL_CSS_UNITS.find(item => item.value === unit);\n return match?.a11yLabel ? match?.a11yLabel : match?.value;\n}\n\n/**\n * Filters available units based on values defined a list of allowed unit values.\n *\n * @param allowedUnitValues Collection of allowed unit value strings.\n * @param availableUnits Collection of available unit objects.\n * @return Filtered units.\n */\nexport function filterUnitsWithSettings(allowedUnitValues = [], availableUnits) {\n // Although the `isArray` check shouldn't be necessary (given the signature of\n // this typed function), it's better to stay on the side of caution, since\n // this function may be called from un-typed environments.\n return Array.isArray(availableUnits) ? availableUnits.filter(unit => allowedUnitValues.includes(unit.value)) : [];\n}\n\n/**\n * Custom hook to retrieve and consolidate units setting from add_theme_support().\n * TODO: ideally this hook shouldn't be needed\n * https://github.com/WordPress/gutenberg/pull/31822#discussion_r633280823\n *\n * @param args An object containing units, settingPath & defaultUnits.\n * @param args.units Collection of all potentially available units.\n * @param args.availableUnits Collection of unit value strings for filtering available units.\n * @param args.defaultValues Collection of default values for defined units. Example: `{ px: 350, em: 15 }`.\n *\n * @return Filtered list of units, with their default values updated following the `defaultValues`\n * argument's property.\n */\nexport const useCustomUnits = ({\n units = ALL_CSS_UNITS,\n availableUnits = [],\n defaultValues\n}) => {\n const customUnitsToReturn = filterUnitsWithSettings(availableUnits, units);\n if (!defaultValues) {\n return customUnitsToReturn;\n }\n return customUnitsToReturn.map(unit => {\n const [defaultValue] = defaultValues[unit.value] ? parseQuantityAndUnitFromRawValue(defaultValues[unit.value]) : [];\n return {\n ...unit,\n default: defaultValue\n };\n });\n};\n\n/**\n * Get available units with the unit for the currently selected value\n * prepended if it is not available in the list of units.\n *\n * This is useful to ensure that the current value's unit is always\n * accurately displayed in the UI, even if the intention is to hide\n * the availability of that unit.\n *\n * @param rawValue Selected value to parse.\n * @param legacyUnit Legacy unit value, if rawValue needs it appended.\n * @param units List of available units.\n *\n * @return A collection of units containing the unit for the current value.\n */\nexport function getUnitsWithCurrentUnit(rawValue, legacyUnit, units = ALL_CSS_UNITS) {\n const unitsToReturn = Array.isArray(units) ? [...units] : [];\n const [, currentUnit] = getParsedQuantityAndUnit(rawValue, legacyUnit, ALL_CSS_UNITS);\n if (currentUnit && !unitsToReturn.some(unit => unit.value === currentUnit)) {\n if (allUnits[currentUnit]) {\n unitsToReturn.unshift(allUnits[currentUnit]);\n }\n }\n return unitsToReturn;\n}"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAuB;AAMvB,IAAM,WAAW;AAAA,EACf,IAAI;AAAA,IACF,OAAO;AAAA,IACP,OAAO;AAAA,IACP,eAAW,gBAAG,aAAa;AAAA,IAC3B,MAAM;AAAA,EACR;AAAA,EACA,KAAK;AAAA,IACH,OAAO;AAAA,IACP,OAAO;AAAA,IACP,eAAW,gBAAG,aAAa;AAAA,IAC3B,MAAM;AAAA,EACR;AAAA,EACA,IAAI;AAAA,IACF,OAAO;AAAA,IACP,OAAO;AAAA,IACP,eAAW,gBAAG,OAAO,mCAAmC;AAAA,IACxD,MAAM;AAAA,EACR;AAAA,EACA,KAAK;AAAA,IACH,OAAO;AAAA,IACP,OAAO;AAAA,IACP,eAAW,gBAAG,QAAQ,kCAAkC;AAAA,IACxD,MAAM;AAAA,EACR;AAAA,EACA,IAAI;AAAA,IACF,OAAO;AAAA,IACP,OAAO;AAAA,IACP,eAAW,gBAAG,qBAAqB;AAAA,IACnC,MAAM;AAAA,EACR;AAAA,EACA,IAAI;AAAA,IACF,OAAO;AAAA,IACP,OAAO;AAAA,IACP,eAAW,gBAAG,sBAAsB;AAAA,IACpC,MAAM;AAAA,EACR;AAAA,EACA,MAAM;AAAA,IACJ,OAAO;AAAA,IACP,OAAO;AAAA,IACP,eAAW,gBAAG,oCAAoC;AAAA,IAClD,MAAM;AAAA,EACR;AAAA,EACA,MAAM;AAAA,IACJ,OAAO;AAAA,IACP,OAAO;AAAA,IACP,eAAW,gBAAG,mCAAmC;AAAA,IACj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c,KAAK,UAAQ,KAAK,UAAU,WAAW,GAAG;AAC1E,QAAI,SAAS,WAAW,GAAG;AACzB,oBAAc,QAAQ,SAAS,WAAW,CAAC;AAAA,IAC7C;AAAA,EACF;AACA,SAAO;AACT;",
6
6
  "names": []
7
7
  }
@@ -84,7 +84,7 @@ function registerStyle(hash, css) {
84
84
 
85
85
  // packages/components/src/alignment-matrix-control/style.module.scss
86
86
  if (typeof process === "undefined" || process.env.NODE_ENV !== "test") {
87
- registerStyle("9251e317a9", "._02e2af5803bf5bda__grid-container{aspect-ratio:1;border:1px solid #0000;border-radius:4px;box-sizing:border-box;cursor:var(--wpds-cursor-control,pointer);direction:ltr;display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr);outline:none}.c421f8ed08c23077__grid-row{box-sizing:border-box;display:grid;grid-column:1/-1;grid-template-columns:repeat(3,1fr)}._3af769f755097fdb__cell{align-items:center;appearance:none;border:none;box-sizing:border-box;display:flex;justify-content:center;margin:0;outline:none;padding:0;position:relative}._37ef12d4fb6d6131__point{aspect-ratio:1;border:3px solid;box-sizing:border-box;color:var(--wp-components-color-gray-400,#ccc);contain:strict;display:block;margin:auto;width:6px}._3af769f755097fdb__cell[data-active-item] ._37ef12d4fb6d6131__point{color:var(--wp-components-color-foreground,#1e1e1e);transform:scale(1.6666666667)}._3af769f755097fdb__cell:not([data-active-item]):hover ._37ef12d4fb6d6131__point{color:var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9))}._3af769f755097fdb__cell[data-focus-visible] ._37ef12d4fb6d6131__point{outline:1px solid var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9));outline-offset:1px}@media not (prefers-reduced-motion){._37ef12d4fb6d6131__point{transition-duration:.12s;transition-property:color,transform;transition-timing-function:linear}}");
87
+ registerStyle("0cdd5d4fc6", "._02e2af5803bf5bda__grid-container{aspect-ratio:1;border:1px solid transparent;border-radius:4px;box-sizing:border-box;cursor:var(--wpds-cursor-control,pointer);direction:ltr;display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr);outline:none}.c421f8ed08c23077__grid-row{box-sizing:border-box;display:grid;grid-column:1/-1;grid-template-columns:repeat(3,1fr)}._3af769f755097fdb__cell{align-items:center;appearance:none;border:none;box-sizing:border-box;display:flex;justify-content:center;margin:0;outline:none;padding:0;position:relative}._37ef12d4fb6d6131__point{aspect-ratio:1;border:3px solid;box-sizing:border-box;color:var(--wp-components-color-gray-400,#ccc);contain:strict;display:block;margin:auto;width:6px}._3af769f755097fdb__cell[data-active-item] ._37ef12d4fb6d6131__point{color:var(--wp-components-color-foreground,#1e1e1e);transform:scale(1.6666666667)}._3af769f755097fdb__cell:not([data-active-item]):hover ._37ef12d4fb6d6131__point{color:var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9))}._3af769f755097fdb__cell[data-focus-visible] ._37ef12d4fb6d6131__point{outline:1px solid var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9));outline-offset:1px}@media not (prefers-reduced-motion){._37ef12d4fb6d6131__point{transition-duration:.12s;transition-property:color,transform;transition-timing-function:linear}}");
88
88
  }
89
89
  var style_module_default = { "grid-container": "_02e2af5803bf5bda__grid-container", "grid-row": "c421f8ed08c23077__grid-row", "cell": "_3af769f755097fdb__cell", "point": "_37ef12d4fb6d6131__point" };
90
90
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/alignment-matrix-control/cell.tsx", "../../../style-runtime/src/index.ts", "../../src/alignment-matrix-control/style.module.scss"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * Internal dependencies\n */\nimport { Composite } from '../composite';\nimport Tooltip from '../tooltip';\nimport { VisuallyHidden } from '../visually-hidden';\n\n/**\n * Internal dependencies\n */\nimport { ALIGNMENT_LABEL } from './utils';\nimport styles from './style.module.scss';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport default function Cell({\n id,\n value,\n ...props\n}) {\n return /*#__PURE__*/_jsx(Tooltip, {\n text: ALIGNMENT_LABEL[value],\n children: /*#__PURE__*/_jsxs(Composite.Item, {\n id: id,\n render: /*#__PURE__*/_jsx(\"span\", {\n ...props,\n className: clsx(styles.cell, props.className),\n role: \"gridcell\"\n }),\n children: [/*#__PURE__*/_jsx(VisuallyHidden, {\n children: value\n }), /*#__PURE__*/_jsx(\"span\", {\n className: styles.point,\n role: \"presentation\"\n })]\n })\n });\n}", "const STYLE_HASH_ATTRIBUTE = 'data-wp-hash';\n\n/**\n * Returns the shared style runtime registry.\n *\n * The registry is stored on `globalThis` so separately bundled copies of this\n * package can coordinate through the same document and style maps.\n *\n * @return The shared runtime registry.\n */\nfunction getRuntime() {\n const globalScope = globalThis;\n if (globalScope.__wpStyleRuntime) {\n return globalScope.__wpStyleRuntime;\n }\n globalScope.__wpStyleRuntime = {\n documents: new Map(),\n styles: new Map(),\n injectedStyles: new WeakMap()\n };\n if (typeof document !== 'undefined') {\n registerDocument(document);\n }\n return globalScope.__wpStyleRuntime;\n}\n\n/**\n * Checks whether a document already contains a style tag for a hash.\n *\n * @param targetDocument Document to inspect.\n * @param hash Stable hash for the transformed CSS.\n *\n * @return Whether the style hash already exists in the document.\n */\nfunction documentContainsStyleHash(targetDocument, hash) {\n if (!targetDocument.head) {\n return false;\n }\n for (const style of targetDocument.head.querySelectorAll(`style[${STYLE_HASH_ATTRIBUTE}]`)) {\n if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Injects a registered style into a document, unless that document already\n * contains a style tag for the same hash.\n *\n * @param targetDocument Document to inject the style into.\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nfunction injectStyle(targetDocument, hash, css) {\n if (!targetDocument.head) {\n return;\n }\n const runtime = getRuntime();\n let injectedStyles = runtime.injectedStyles.get(targetDocument);\n if (!injectedStyles) {\n injectedStyles = new Set();\n runtime.injectedStyles.set(targetDocument, injectedStyles);\n }\n if (injectedStyles.has(hash)) {\n return;\n }\n\n // Older generated CSS module output can still inject matching style tags\n // after this document's cache is created, so keep the DOM as the fallback\n // source of truth on cache misses.\n if (documentContainsStyleHash(targetDocument, hash)) {\n injectedStyles.add(hash);\n return;\n }\n const style = targetDocument.createElement('style');\n style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);\n style.appendChild(targetDocument.createTextNode(css));\n targetDocument.head.appendChild(style);\n injectedStyles.add(hash);\n}\n\n/**\n * Registers a document as a style injection target.\n *\n * Existing registered styles are replayed into the document immediately.\n * Documents are reference-counted so multiple providers can safely register the\n * same document without one cleanup removing it while another registration is\n * still active.\n *\n * @param targetDocument Document to receive registered styles.\n * @return Cleanup function that unregisters this document registration.\n */\nexport function registerDocument(targetDocument) {\n const runtime = getRuntime();\n runtime.documents.set(targetDocument, (runtime.documents.get(targetDocument) ?? 0) + 1);\n for (const [hash, css] of runtime.styles) {\n injectStyle(targetDocument, hash, css);\n }\n return () => {\n const count = runtime.documents.get(targetDocument);\n if (count === undefined) {\n return;\n }\n if (count <= 1) {\n runtime.documents.delete(targetDocument);\n return;\n }\n runtime.documents.set(targetDocument, count - 1);\n };\n}\n\n/**\n * Registers a style and injects it into all registered documents.\n *\n * The hash is used as the deduplication key, so calling this repeatedly with\n * the same hash will not add duplicate style tags to a document.\n * Registered styles are retained for the lifetime of the page so they can be\n * replayed into documents that are registered later.\n *\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nexport function registerStyle(hash, css) {\n const runtime = getRuntime();\n runtime.styles.set(hash, css);\n for (const targetDocument of runtime.documents.keys()) {\n injectStyle(targetDocument, hash, css);\n }\n}", "import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"9251e317a9\", \"._02e2af5803bf5bda__grid-container{aspect-ratio:1;border:1px solid #0000;border-radius:4px;box-sizing:border-box;cursor:var(--wpds-cursor-control,pointer);direction:ltr;display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr);outline:none}.c421f8ed08c23077__grid-row{box-sizing:border-box;display:grid;grid-column:1/-1;grid-template-columns:repeat(3,1fr)}._3af769f755097fdb__cell{align-items:center;appearance:none;border:none;box-sizing:border-box;display:flex;justify-content:center;margin:0;outline:none;padding:0;position:relative}._37ef12d4fb6d6131__point{aspect-ratio:1;border:3px solid;box-sizing:border-box;color:var(--wp-components-color-gray-400,#ccc);contain:strict;display:block;margin:auto;width:6px}._3af769f755097fdb__cell[data-active-item] ._37ef12d4fb6d6131__point{color:var(--wp-components-color-foreground,#1e1e1e);transform:scale(1.6666666667)}._3af769f755097fdb__cell:not([data-active-item]):hover ._37ef12d4fb6d6131__point{color:var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9))}._3af769f755097fdb__cell[data-focus-visible] ._37ef12d4fb6d6131__point{outline:1px solid var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9));outline-offset:1px}@media not (prefers-reduced-motion){._37ef12d4fb6d6131__point{transition-duration:.12s;transition-property:color,transform;transition-timing-function:linear}}\");\n}\nexport default {\"grid-container\":\"_02e2af5803bf5bda__grid-container\",\"grid-row\":\"c421f8ed08c23077__grid-row\",\"cell\":\"_3af769f755097fdb__cell\",\"point\":\"_37ef12d4fb6d6131__point\"};\n"],
5
- "mappings": ";AAGA,OAAO,UAAU;AAKjB,SAAS,iBAAiB;AAC1B,OAAO,aAAa;AACpB,SAAS,sBAAsB;AAK/B,SAAS,uBAAuB;;;ACfhC,IAAM,uBAAuB;AAU7B,SAAS,aAAa;AACpB,QAAM,cAAc;AACpB,MAAI,YAAY,kBAAkB;AAChC,WAAO,YAAY;AAAA,EACrB;AACA,cAAY,mBAAmB;AAAA,IAC7B,WAAW,oBAAI,IAAI;AAAA,IACnB,QAAQ,oBAAI,IAAI;AAAA,IAChB,gBAAgB,oBAAI,QAAQ;AAAA,EAC9B;AACA,MAAI,OAAO,aAAa,aAAa;AACnC,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AAQ,UAAU,OAAO,cAAc;AACvC;AAAA,IACF;AACA,YAAQ,UAAU,IAAI,gBAAgB,QAAQ,CAAC;AAAA,EACjD;AACF;AAaO,SAAS,cAAc,MAAM,KAAK;AACvC,QAAM,UAAU,WAAW;AAC3B,UAAQ,OAAO,IAAI,MAAM,GAAG;AAC5B,aAAW,kBAAkB,QAAQ,UAAU,KAAK,GAAG;AACrD,gBAAY,gBAAgB,MAAM,GAAG;AAAA,EACvC;AACF;;;AChIA,IAAI,OAAO,YAAY,eAAe,QAAQ,IAAI,aAAa,QAAQ;AACtE,gBAAc,cAAc,w2CAAw2C;AACr4C;AACA,IAAO,uBAAQ,EAAC,kBAAiB,qCAAoC,YAAW,8BAA6B,QAAO,2BAA0B,SAAQ,2BAA0B;;;AFahL,SAAS,OAAO,MAAM,QAAQ,aAAa;AAC5B,SAAR,KAAsB;AAAA,EAC3B;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAG;AACD,SAAoB,qBAAK,SAAS;AAAA,IAChC,MAAM,gBAAgB,KAAK;AAAA,IAC3B,UAAuB,sBAAM,UAAU,MAAM;AAAA,MAC3C;AAAA,MACA,QAAqB,qBAAK,QAAQ;AAAA,QAChC,GAAG;AAAA,QACH,WAAW,KAAK,qBAAO,MAAM,MAAM,SAAS;AAAA,QAC5C,MAAM;AAAA,MACR,CAAC;AAAA,MACD,UAAU,CAAc,qBAAK,gBAAgB;AAAA,QAC3C,UAAU;AAAA,MACZ,CAAC,GAAgB,qBAAK,QAAQ;AAAA,QAC5B,WAAW,qBAAO;AAAA,QAClB,MAAM;AAAA,MACR,CAAC,CAAC;AAAA,IACJ,CAAC;AAAA,EACH,CAAC;AACH;",
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * Internal dependencies\n */\nimport { Composite } from '../composite';\nimport Tooltip from '../tooltip';\nimport { VisuallyHidden } from '../visually-hidden';\n\n/**\n * Internal dependencies\n */\nimport { ALIGNMENT_LABEL } from './utils';\nimport styles from './style.module.scss';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport default function Cell({\n id,\n value,\n ...props\n}) {\n return /*#__PURE__*/_jsx(Tooltip, {\n text: ALIGNMENT_LABEL[value],\n children: /*#__PURE__*/_jsxs(Composite.Item, {\n id: id,\n render: /*#__PURE__*/_jsx(\"span\", {\n ...props,\n className: clsx(styles.cell, props.className),\n role: \"gridcell\"\n }),\n children: [/*#__PURE__*/_jsx(VisuallyHidden, {\n children: value\n }), /*#__PURE__*/_jsx(\"span\", {\n className: styles.point,\n role: \"presentation\"\n })]\n })\n });\n}", "const STYLE_HASH_ATTRIBUTE = 'data-wp-hash';\n\n/**\n * Returns the shared style runtime registry.\n *\n * The registry is stored on `globalThis` so separately bundled copies of this\n * package can coordinate through the same document and style maps.\n *\n * @return The shared runtime registry.\n */\nfunction getRuntime() {\n const globalScope = globalThis;\n if (globalScope.__wpStyleRuntime) {\n return globalScope.__wpStyleRuntime;\n }\n globalScope.__wpStyleRuntime = {\n documents: new Map(),\n styles: new Map(),\n injectedStyles: new WeakMap()\n };\n if (typeof document !== 'undefined') {\n registerDocument(document);\n }\n return globalScope.__wpStyleRuntime;\n}\n\n/**\n * Checks whether a document already contains a style tag for a hash.\n *\n * @param targetDocument Document to inspect.\n * @param hash Stable hash for the transformed CSS.\n *\n * @return Whether the style hash already exists in the document.\n */\nfunction documentContainsStyleHash(targetDocument, hash) {\n if (!targetDocument.head) {\n return false;\n }\n for (const style of targetDocument.head.querySelectorAll(`style[${STYLE_HASH_ATTRIBUTE}]`)) {\n if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Injects a registered style into a document, unless that document already\n * contains a style tag for the same hash.\n *\n * @param targetDocument Document to inject the style into.\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nfunction injectStyle(targetDocument, hash, css) {\n if (!targetDocument.head) {\n return;\n }\n const runtime = getRuntime();\n let injectedStyles = runtime.injectedStyles.get(targetDocument);\n if (!injectedStyles) {\n injectedStyles = new Set();\n runtime.injectedStyles.set(targetDocument, injectedStyles);\n }\n if (injectedStyles.has(hash)) {\n return;\n }\n\n // Older generated CSS module output can still inject matching style tags\n // after this document's cache is created, so keep the DOM as the fallback\n // source of truth on cache misses.\n if (documentContainsStyleHash(targetDocument, hash)) {\n injectedStyles.add(hash);\n return;\n }\n const style = targetDocument.createElement('style');\n style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);\n style.appendChild(targetDocument.createTextNode(css));\n targetDocument.head.appendChild(style);\n injectedStyles.add(hash);\n}\n\n/**\n * Registers a document as a style injection target.\n *\n * Existing registered styles are replayed into the document immediately.\n * Documents are reference-counted so multiple providers can safely register the\n * same document without one cleanup removing it while another registration is\n * still active.\n *\n * @param targetDocument Document to receive registered styles.\n * @return Cleanup function that unregisters this document registration.\n */\nexport function registerDocument(targetDocument) {\n const runtime = getRuntime();\n runtime.documents.set(targetDocument, (runtime.documents.get(targetDocument) ?? 0) + 1);\n for (const [hash, css] of runtime.styles) {\n injectStyle(targetDocument, hash, css);\n }\n return () => {\n const count = runtime.documents.get(targetDocument);\n if (count === undefined) {\n return;\n }\n if (count <= 1) {\n runtime.documents.delete(targetDocument);\n return;\n }\n runtime.documents.set(targetDocument, count - 1);\n };\n}\n\n/**\n * Registers a style and injects it into all registered documents.\n *\n * The hash is used as the deduplication key, so calling this repeatedly with\n * the same hash will not add duplicate style tags to a document.\n * Registered styles are retained for the lifetime of the page so they can be\n * replayed into documents that are registered later.\n *\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nexport function registerStyle(hash, css) {\n const runtime = getRuntime();\n runtime.styles.set(hash, css);\n for (const targetDocument of runtime.documents.keys()) {\n injectStyle(targetDocument, hash, css);\n }\n}", "import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"0cdd5d4fc6\", \"._02e2af5803bf5bda__grid-container{aspect-ratio:1;border:1px solid transparent;border-radius:4px;box-sizing:border-box;cursor:var(--wpds-cursor-control,pointer);direction:ltr;display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr);outline:none}.c421f8ed08c23077__grid-row{box-sizing:border-box;display:grid;grid-column:1/-1;grid-template-columns:repeat(3,1fr)}._3af769f755097fdb__cell{align-items:center;appearance:none;border:none;box-sizing:border-box;display:flex;justify-content:center;margin:0;outline:none;padding:0;position:relative}._37ef12d4fb6d6131__point{aspect-ratio:1;border:3px solid;box-sizing:border-box;color:var(--wp-components-color-gray-400,#ccc);contain:strict;display:block;margin:auto;width:6px}._3af769f755097fdb__cell[data-active-item] ._37ef12d4fb6d6131__point{color:var(--wp-components-color-foreground,#1e1e1e);transform:scale(1.6666666667)}._3af769f755097fdb__cell:not([data-active-item]):hover ._37ef12d4fb6d6131__point{color:var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9))}._3af769f755097fdb__cell[data-focus-visible] ._37ef12d4fb6d6131__point{outline:1px solid var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9));outline-offset:1px}@media not (prefers-reduced-motion){._37ef12d4fb6d6131__point{transition-duration:.12s;transition-property:color,transform;transition-timing-function:linear}}\");\n}\nexport default {\"grid-container\":\"_02e2af5803bf5bda__grid-container\",\"grid-row\":\"c421f8ed08c23077__grid-row\",\"cell\":\"_3af769f755097fdb__cell\",\"point\":\"_37ef12d4fb6d6131__point\"};\n"],
5
+ "mappings": ";AAGA,OAAO,UAAU;AAKjB,SAAS,iBAAiB;AAC1B,OAAO,aAAa;AACpB,SAAS,sBAAsB;AAK/B,SAAS,uBAAuB;;;ACfhC,IAAM,uBAAuB;AAU7B,SAAS,aAAa;AACpB,QAAM,cAAc;AACpB,MAAI,YAAY,kBAAkB;AAChC,WAAO,YAAY;AAAA,EACrB;AACA,cAAY,mBAAmB;AAAA,IAC7B,WAAW,oBAAI,IAAI;AAAA,IACnB,QAAQ,oB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AAQ,UAAU,IAAI,cAAc;AAClD,QAAI,UAAU,QAAW;AACvB;AAAA,IACF;AACA,QAAI,SAAS,GAAG;AACd,cAAQ,UAAU,OAAO,cAAc;AACvC;AAAA,IACF;AACA,YAAQ,UAAU,IAAI,gBAAgB,QAAQ,CAAC;AAAA,EACjD;AACF;AAaO,SAAS,cAAc,MAAM,KAAK;AACvC,QAAM,UAAU,WAAW;AAC3B,UAAQ,OAAO,IAAI,MAAM,GAAG;AAC5B,aAAW,kBAAkB,QAAQ,UAAU,KAAK,GAAG;AACrD,gBAAY,gBAAgB,MAAM,GAAG;AAAA,EACvC;AACF;;;AChIA,IAAI,OAAO,YAAY,eAAe,QAAQ,IAAI,aAAa,QAAQ;AACtE,gBAAc,cAAc,82CAA82C;AAC34C;AACA,IAAO,uBAAQ,EAAC,kBAAiB,qCAAoC,YAAW,8BAA6B,QAAO,2BAA0B,SAAQ,2BAA0B;;;AFahL,SAAS,OAAO,MAAM,QAAQ,aAAa;AAC5B,SAAR,KAAsB;AAAA,EAC3B;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAG;AACD,SAAoB,qBAAK,SAAS;AAAA,IAChC,MAAM,gBAAgB,KAAK;AAAA,IAC3B,UAAuB,sBAAM,UAAU,MAAM;AAAA,MAC3C;AAAA,MACA,QAAqB,qBAAK,QAAQ;AAAA,QAChC,GAAG;AAAA,QACH,WAAW,KAAK,qBAAO,MAAM,MAAM,SAAS;AAAA,QAC5C,MAAM;AAAA,MACR,CAAC;AAAA,MACD,UAAU,CAAc,qBAAK,gBAAgB;AAAA,QAC3C,UAAU;AAAA,MACZ,CAAC,GAAgB,qBAAK,QAAQ;AAAA,QAC5B,WAAW,qBAAO;AAAA,QAClB,MAAM;AAAA,MACR,CAAC,CAAC;AAAA,IACJ,CAAC;AAAA,EACH,CAAC;AACH;",
6
6
  "names": []
7
7
  }
@@ -87,7 +87,7 @@ function registerStyle(hash, css) {
87
87
 
88
88
  // packages/components/src/alignment-matrix-control/style.module.scss
89
89
  if (typeof process === "undefined" || process.env.NODE_ENV !== "test") {
90
- registerStyle("9251e317a9", "._02e2af5803bf5bda__grid-container{aspect-ratio:1;border:1px solid #0000;border-radius:4px;box-sizing:border-box;cursor:var(--wpds-cursor-control,pointer);direction:ltr;display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr);outline:none}.c421f8ed08c23077__grid-row{box-sizing:border-box;display:grid;grid-column:1/-1;grid-template-columns:repeat(3,1fr)}._3af769f755097fdb__cell{align-items:center;appearance:none;border:none;box-sizing:border-box;display:flex;justify-content:center;margin:0;outline:none;padding:0;position:relative}._37ef12d4fb6d6131__point{aspect-ratio:1;border:3px solid;box-sizing:border-box;color:var(--wp-components-color-gray-400,#ccc);contain:strict;display:block;margin:auto;width:6px}._3af769f755097fdb__cell[data-active-item] ._37ef12d4fb6d6131__point{color:var(--wp-components-color-foreground,#1e1e1e);transform:scale(1.6666666667)}._3af769f755097fdb__cell:not([data-active-item]):hover ._37ef12d4fb6d6131__point{color:var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9))}._3af769f755097fdb__cell[data-focus-visible] ._37ef12d4fb6d6131__point{outline:1px solid var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9));outline-offset:1px}@media not (prefers-reduced-motion){._37ef12d4fb6d6131__point{transition-duration:.12s;transition-property:color,transform;transition-timing-function:linear}}");
90
+ registerStyle("0cdd5d4fc6", "._02e2af5803bf5bda__grid-container{aspect-ratio:1;border:1px solid transparent;border-radius:4px;box-sizing:border-box;cursor:var(--wpds-cursor-control,pointer);direction:ltr;display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr);outline:none}.c421f8ed08c23077__grid-row{box-sizing:border-box;display:grid;grid-column:1/-1;grid-template-columns:repeat(3,1fr)}._3af769f755097fdb__cell{align-items:center;appearance:none;border:none;box-sizing:border-box;display:flex;justify-content:center;margin:0;outline:none;padding:0;position:relative}._37ef12d4fb6d6131__point{aspect-ratio:1;border:3px solid;box-sizing:border-box;color:var(--wp-components-color-gray-400,#ccc);contain:strict;display:block;margin:auto;width:6px}._3af769f755097fdb__cell[data-active-item] ._37ef12d4fb6d6131__point{color:var(--wp-components-color-foreground,#1e1e1e);transform:scale(1.6666666667)}._3af769f755097fdb__cell:not([data-active-item]):hover ._37ef12d4fb6d6131__point{color:var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9))}._3af769f755097fdb__cell[data-focus-visible] ._37ef12d4fb6d6131__point{outline:1px solid var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9));outline-offset:1px}@media not (prefers-reduced-motion){._37ef12d4fb6d6131__point{transition-duration:.12s;transition-property:color,transform;transition-timing-function:linear}}");
91
91
  }
92
92
  var style_module_default = { "grid-container": "_02e2af5803bf5bda__grid-container", "grid-row": "c421f8ed08c23077__grid-row", "cell": "_3af769f755097fdb__cell", "point": "_37ef12d4fb6d6131__point" };
93
93
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/alignment-matrix-control/index.tsx", "../../../style-runtime/src/index.ts", "../../src/alignment-matrix-control/style.module.scss"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, isRTL } from '@wordpress/i18n';\nimport { useInstanceId } from '@wordpress/compose';\nimport { useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport Cell from './cell';\nimport { Composite } from '../composite';\nimport AlignmentMatrixControlIcon from './icon';\nimport { GRID, getItemId, getItemValue } from './utils';\nimport styles from './style.module.scss';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction UnforwardedAlignmentMatrixControl({\n className,\n id,\n label = __('Alignment Matrix Control'),\n defaultValue = 'center center',\n value,\n onChange,\n width = 92,\n ...props\n}) {\n const baseId = useInstanceId(UnforwardedAlignmentMatrixControl, 'alignment-matrix-control', id);\n const setActiveId = useCallback(nextActiveId => {\n const nextValue = getItemValue(baseId, nextActiveId);\n if (nextValue) {\n onChange?.(nextValue);\n }\n }, [baseId, onChange]);\n const classes = clsx('component-alignment-matrix-control', styles['grid-container'], className);\n return /*#__PURE__*/_jsx(Composite, {\n defaultActiveId: getItemId(baseId, defaultValue),\n activeId: getItemId(baseId, value),\n setActiveId: setActiveId,\n rtl: isRTL(),\n render: /*#__PURE__*/_jsx(\"div\", {\n ...props,\n className: classes,\n \"aria-label\": label,\n id: baseId,\n role: \"grid\",\n style: {\n width: `${width}px`\n }\n }),\n children: GRID.map((cells, index) => /*#__PURE__*/_jsx(Composite.Row, {\n render: /*#__PURE__*/_jsx(\"div\", {\n className: styles['grid-row'],\n role: \"row\"\n }),\n children: cells.map(cell => /*#__PURE__*/_jsx(Cell, {\n id: getItemId(baseId, cell),\n value: cell\n }, cell))\n }, index))\n });\n}\n\n/**\n * AlignmentMatrixControl components enable adjustments to horizontal and vertical alignments for UI.\n *\n * ```jsx\n * import { AlignmentMatrixControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const Example = () => {\n * \tconst [ alignment, setAlignment ] = useState( 'center center' );\n *\n * \treturn (\n * \t\t<AlignmentMatrixControl\n * \t\t\tvalue={ alignment }\n * \t\t\tonChange={ setAlignment }\n * \t\t/>\n * \t);\n * };\n * ```\n */\nexport const AlignmentMatrixControl = Object.assign(UnforwardedAlignmentMatrixControl, {\n /**\n * Render an alignment matrix as an icon.\n *\n * ```jsx\n * import { AlignmentMatrixControl } from '@wordpress/components';\n *\n * <Icon icon={<AlignmentMatrixControl.Icon value=\"top left\" />} />\n * ```\n */\n Icon: Object.assign(AlignmentMatrixControlIcon, {\n displayName: 'AlignmentMatrixControl.Icon'\n })\n});\nexport default AlignmentMatrixControl;", "const STYLE_HASH_ATTRIBUTE = 'data-wp-hash';\n\n/**\n * Returns the shared style runtime registry.\n *\n * The registry is stored on `globalThis` so separately bundled copies of this\n * package can coordinate through the same document and style maps.\n *\n * @return The shared runtime registry.\n */\nfunction getRuntime() {\n const globalScope = globalThis;\n if (globalScope.__wpStyleRuntime) {\n return globalScope.__wpStyleRuntime;\n }\n globalScope.__wpStyleRuntime = {\n documents: new Map(),\n styles: new Map(),\n injectedStyles: new WeakMap()\n };\n if (typeof document !== 'undefined') {\n registerDocument(document);\n }\n return globalScope.__wpStyleRuntime;\n}\n\n/**\n * Checks whether a document already contains a style tag for a hash.\n *\n * @param targetDocument Document to inspect.\n * @param hash Stable hash for the transformed CSS.\n *\n * @return Whether the style hash already exists in the document.\n */\nfunction documentContainsStyleHash(targetDocument, hash) {\n if (!targetDocument.head) {\n return false;\n }\n for (const style of targetDocument.head.querySelectorAll(`style[${STYLE_HASH_ATTRIBUTE}]`)) {\n if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Injects a registered style into a document, unless that document already\n * contains a style tag for the same hash.\n *\n * @param targetDocument Document to inject the style into.\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nfunction injectStyle(targetDocument, hash, css) {\n if (!targetDocument.head) {\n return;\n }\n const runtime = getRuntime();\n let injectedStyles = runtime.injectedStyles.get(targetDocument);\n if (!injectedStyles) {\n injectedStyles = new Set();\n runtime.injectedStyles.set(targetDocument, injectedStyles);\n }\n if (injectedStyles.has(hash)) {\n return;\n }\n\n // Older generated CSS module output can still inject matching style tags\n // after this document's cache is created, so keep the DOM as the fallback\n // source of truth on cache misses.\n if (documentContainsStyleHash(targetDocument, hash)) {\n injectedStyles.add(hash);\n return;\n }\n const style = targetDocument.createElement('style');\n style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);\n style.appendChild(targetDocument.createTextNode(css));\n targetDocument.head.appendChild(style);\n injectedStyles.add(hash);\n}\n\n/**\n * Registers a document as a style injection target.\n *\n * Existing registered styles are replayed into the document immediately.\n * Documents are reference-counted so multiple providers can safely register the\n * same document without one cleanup removing it while another registration is\n * still active.\n *\n * @param targetDocument Document to receive registered styles.\n * @return Cleanup function that unregisters this document registration.\n */\nexport function registerDocument(targetDocument) {\n const runtime = getRuntime();\n runtime.documents.set(targetDocument, (runtime.documents.get(targetDocument) ?? 0) + 1);\n for (const [hash, css] of runtime.styles) {\n injectStyle(targetDocument, hash, css);\n }\n return () => {\n const count = runtime.documents.get(targetDocument);\n if (count === undefined) {\n return;\n }\n if (count <= 1) {\n runtime.documents.delete(targetDocument);\n return;\n }\n runtime.documents.set(targetDocument, count - 1);\n };\n}\n\n/**\n * Registers a style and injects it into all registered documents.\n *\n * The hash is used as the deduplication key, so calling this repeatedly with\n * the same hash will not add duplicate style tags to a document.\n * Registered styles are retained for the lifetime of the page so they can be\n * replayed into documents that are registered later.\n *\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nexport function registerStyle(hash, css) {\n const runtime = getRuntime();\n runtime.styles.set(hash, css);\n for (const targetDocument of runtime.documents.keys()) {\n injectStyle(targetDocument, hash, css);\n }\n}", "import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"9251e317a9\", \"._02e2af5803bf5bda__grid-container{aspect-ratio:1;border:1px solid #0000;border-radius:4px;box-sizing:border-box;cursor:var(--wpds-cursor-control,pointer);direction:ltr;display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr);outline:none}.c421f8ed08c23077__grid-row{box-sizing:border-box;display:grid;grid-column:1/-1;grid-template-columns:repeat(3,1fr)}._3af769f755097fdb__cell{align-items:center;appearance:none;border:none;box-sizing:border-box;display:flex;justify-content:center;margin:0;outline:none;padding:0;position:relative}._37ef12d4fb6d6131__point{aspect-ratio:1;border:3px solid;box-sizing:border-box;color:var(--wp-components-color-gray-400,#ccc);contain:strict;display:block;margin:auto;width:6px}._3af769f755097fdb__cell[data-active-item] ._37ef12d4fb6d6131__point{color:var(--wp-components-color-foreground,#1e1e1e);transform:scale(1.6666666667)}._3af769f755097fdb__cell:not([data-active-item]):hover ._37ef12d4fb6d6131__point{color:var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9))}._3af769f755097fdb__cell[data-focus-visible] ._37ef12d4fb6d6131__point{outline:1px solid var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9));outline-offset:1px}@media not (prefers-reduced-motion){._37ef12d4fb6d6131__point{transition-duration:.12s;transition-property:color,transform;transition-timing-function:linear}}\");\n}\nexport default {\"grid-container\":\"_02e2af5803bf5bda__grid-container\",\"grid-row\":\"c421f8ed08c23077__grid-row\",\"cell\":\"_3af769f755097fdb__cell\",\"point\":\"_37ef12d4fb6d6131__point\"};\n"],
5
- "mappings": ";AAGA,OAAO,UAAU;AAKjB,SAAS,IAAI,aAAa;AAC1B,SAAS,qBAAqB;AAC9B,SAAS,mBAAmB;AAK5B,OAAO,UAAU;AACjB,SAAS,iBAAiB;AAC1B,OAAO,gCAAgC;AACvC,SAAS,MAAM,WAAW,oBAAoB;;;AClB9C,IAAM,uBAAuB;AAU7B,SAAS,aAAa;AACpB,QAAM,cAAc;AACpB,MAAI,YAAY,kBAAkB;AAChC,WAAO,YAAY;AAAA,EACrB;AACA,cAAY,mBAAmB;AAAA,IAC7B,WAAW,oBAAI,IAAI;AAAA,IACnB,QAAQ,oBAAI,IAAI;AAAA,IAChB,gBAAgB,oBAAI,QAAQ;AAAA,EAC9B;AACA,MAAI,OAAO,aAAa,aAAa;AACnC,qBAAiB,QAAQ;AAAA,EAC3B;AACA,SAAO,YAAY;AACrB;AAUA,SAAS,0BAA0B,gBAAgB,MAAM;AACvD,MAAI,CAAC,eAAe,MAAM;AACxB,WAAO;AAAA,EACT;AACA,aAAW,SAAS,eAAe,KAAK,iBAAiB,SAAS,oBAAoB,GAAG,GAAG;AAC1F,QAAI,MAAM,aAAa,oBAAoB,MAAM,MAAM;AACrD,aAAO;AAAA,IACT;AAAA,EACF;AACA,SAAO;AACT;AAUA,SAAS,YAAY,gBAAgB,MAAM,KAAK;AAC9C,MAAI,CAAC,eAAe,MAAM;AACxB;AAAA,EACF;A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C;AACH;AAqBO,IAAM,yBAAyB,OAAO,OAAO,mCAAmC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUrF,MAAM,OAAO,OAAO,4BAA4B;AAAA,IAC9C,aAAa;AAAA,EACf,CAAC;AACH,CAAC;AACD,IAAO,mCAAQ;",
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, isRTL } from '@wordpress/i18n';\nimport { useInstanceId } from '@wordpress/compose';\nimport { useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport Cell from './cell';\nimport { Composite } from '../composite';\nimport AlignmentMatrixControlIcon from './icon';\nimport { GRID, getItemId, getItemValue } from './utils';\nimport styles from './style.module.scss';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction UnforwardedAlignmentMatrixControl({\n className,\n id,\n label = __('Alignment Matrix Control'),\n defaultValue = 'center center',\n value,\n onChange,\n width = 92,\n ...props\n}) {\n const baseId = useInstanceId(UnforwardedAlignmentMatrixControl, 'alignment-matrix-control', id);\n const setActiveId = useCallback(nextActiveId => {\n const nextValue = getItemValue(baseId, nextActiveId);\n if (nextValue) {\n onChange?.(nextValue);\n }\n }, [baseId, onChange]);\n const classes = clsx('component-alignment-matrix-control', styles['grid-container'], className);\n return /*#__PURE__*/_jsx(Composite, {\n defaultActiveId: getItemId(baseId, defaultValue),\n activeId: getItemId(baseId, value),\n setActiveId: setActiveId,\n rtl: isRTL(),\n render: /*#__PURE__*/_jsx(\"div\", {\n ...props,\n className: classes,\n \"aria-label\": label,\n id: baseId,\n role: \"grid\",\n style: {\n width: `${width}px`\n }\n }),\n children: GRID.map((cells, index) => /*#__PURE__*/_jsx(Composite.Row, {\n render: /*#__PURE__*/_jsx(\"div\", {\n className: styles['grid-row'],\n role: \"row\"\n }),\n children: cells.map(cell => /*#__PURE__*/_jsx(Cell, {\n id: getItemId(baseId, cell),\n value: cell\n }, cell))\n }, index))\n });\n}\n\n/**\n * AlignmentMatrixControl components enable adjustments to horizontal and vertical alignments for UI.\n *\n * ```jsx\n * import { AlignmentMatrixControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const Example = () => {\n * \tconst [ alignment, setAlignment ] = useState( 'center center' );\n *\n * \treturn (\n * \t\t<AlignmentMatrixControl\n * \t\t\tvalue={ alignment }\n * \t\t\tonChange={ setAlignment }\n * \t\t/>\n * \t);\n * };\n * ```\n */\nexport const AlignmentMatrixControl = Object.assign(UnforwardedAlignmentMatrixControl, {\n /**\n * Render an alignment matrix as an icon.\n *\n * ```jsx\n * import { AlignmentMatrixControl } from '@wordpress/components';\n *\n * <Icon icon={<AlignmentMatrixControl.Icon value=\"top left\" />} />\n * ```\n */\n Icon: Object.assign(AlignmentMatrixControlIcon, {\n displayName: 'AlignmentMatrixControl.Icon'\n })\n});\nexport default AlignmentMatrixControl;", "const STYLE_HASH_ATTRIBUTE = 'data-wp-hash';\n\n/**\n * Returns the shared style runtime registry.\n *\n * The registry is stored on `globalThis` so separately bundled copies of this\n * package can coordinate through the same document and style maps.\n *\n * @return The shared runtime registry.\n */\nfunction getRuntime() {\n const globalScope = globalThis;\n if (globalScope.__wpStyleRuntime) {\n return globalScope.__wpStyleRuntime;\n }\n globalScope.__wpStyleRuntime = {\n documents: new Map(),\n styles: new Map(),\n injectedStyles: new WeakMap()\n };\n if (typeof document !== 'undefined') {\n registerDocument(document);\n }\n return globalScope.__wpStyleRuntime;\n}\n\n/**\n * Checks whether a document already contains a style tag for a hash.\n *\n * @param targetDocument Document to inspect.\n * @param hash Stable hash for the transformed CSS.\n *\n * @return Whether the style hash already exists in the document.\n */\nfunction documentContainsStyleHash(targetDocument, hash) {\n if (!targetDocument.head) {\n return false;\n }\n for (const style of targetDocument.head.querySelectorAll(`style[${STYLE_HASH_ATTRIBUTE}]`)) {\n if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Injects a registered style into a document, unless that document already\n * contains a style tag for the same hash.\n *\n * @param targetDocument Document to inject the style into.\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nfunction injectStyle(targetDocument, hash, css) {\n if (!targetDocument.head) {\n return;\n }\n const runtime = getRuntime();\n let injectedStyles = runtime.injectedStyles.get(targetDocument);\n if (!injectedStyles) {\n injectedStyles = new Set();\n runtime.injectedStyles.set(targetDocument, injectedStyles);\n }\n if (injectedStyles.has(hash)) {\n return;\n }\n\n // Older generated CSS module output can still inject matching style tags\n // after this document's cache is created, so keep the DOM as the fallback\n // source of truth on cache misses.\n if (documentContainsStyleHash(targetDocument, hash)) {\n injectedStyles.add(hash);\n return;\n }\n const style = targetDocument.createElement('style');\n style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);\n style.appendChild(targetDocument.createTextNode(css));\n targetDocument.head.appendChild(style);\n injectedStyles.add(hash);\n}\n\n/**\n * Registers a document as a style injection target.\n *\n * Existing registered styles are replayed into the document immediately.\n * Documents are reference-counted so multiple providers can safely register the\n * same document without one cleanup removing it while another registration is\n * still active.\n *\n * @param targetDocument Document to receive registered styles.\n * @return Cleanup function that unregisters this document registration.\n */\nexport function registerDocument(targetDocument) {\n const runtime = getRuntime();\n runtime.documents.set(targetDocument, (runtime.documents.get(targetDocument) ?? 0) + 1);\n for (const [hash, css] of runtime.styles) {\n injectStyle(targetDocument, hash, css);\n }\n return () => {\n const count = runtime.documents.get(targetDocument);\n if (count === undefined) {\n return;\n }\n if (count <= 1) {\n runtime.documents.delete(targetDocument);\n return;\n }\n runtime.documents.set(targetDocument, count - 1);\n };\n}\n\n/**\n * Registers a style and injects it into all registered documents.\n *\n * The hash is used as the deduplication key, so calling this repeatedly with\n * the same hash will not add duplicate style tags to a document.\n * Registered styles are retained for the lifetime of the page so they can be\n * replayed into documents that are registered later.\n *\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nexport function registerStyle(hash, css) {\n const runtime = getRuntime();\n runtime.styles.set(hash, css);\n for (const targetDocument of runtime.documents.keys()) {\n injectStyle(targetDocument, hash, css);\n }\n}", "import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"0cdd5d4fc6\", \"._02e2af5803bf5bda__grid-container{aspect-ratio:1;border:1px solid transparent;border-radius:4px;box-sizing:border-box;cursor:var(--wpds-cursor-control,pointer);direction:ltr;display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr);outline:none}.c421f8ed08c23077__grid-row{box-sizing:border-box;display:grid;grid-column:1/-1;grid-template-columns:repeat(3,1fr)}._3af769f755097fdb__cell{align-items:center;appearance:none;border:none;box-sizing:border-box;display:flex;justify-content:center;margin:0;outline:none;padding:0;position:relative}._37ef12d4fb6d6131__point{aspect-ratio:1;border:3px solid;box-sizing:border-box;color:var(--wp-components-color-gray-400,#ccc);contain:strict;display:block;margin:auto;width:6px}._3af769f755097fdb__cell[data-active-item] ._37ef12d4fb6d6131__point{color:var(--wp-components-color-foreground,#1e1e1e);transform:scale(1.6666666667)}._3af769f755097fdb__cell:not([data-active-item]):hover ._37ef12d4fb6d6131__point{color:var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9))}._3af769f755097fdb__cell[data-focus-visible] ._37ef12d4fb6d6131__point{outline:1px solid var(--wp-components-color-accent,var(--wp-admin-theme-color,#3858e9));outline-offset:1px}@media not (prefers-reduced-motion){._37ef12d4fb6d6131__point{transition-duration:.12s;transition-property:color,transform;transition-timing-function:linear}}\");\n}\nexport default {\"grid-container\":\"_02e2af5803bf5bda__grid-container\",\"grid-row\":\"c421f8ed08c23077__grid-row\",\"cell\":\"_3af769f755097fdb__cell\",\"point\":\"_37ef12d4fb6d6131__point\"};\n"],
5
+ "mappings": ";AAGA,OAAO,UAAU;AAKjB,SAAS,IAAI,aAAa;AAC1B,SAAS,qBAAqB;AAC9B,SAAS,mBAAmB;AAK5B,OAAO,UA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CAAC;AACrB,QAAM,UAAU,KAAK,sCAAsC,qBAAO,gBAAgB,GAAG,SAAS;AAC9F,SAAoB,qBAAK,WAAW;AAAA,IAClC,iBAAiB,UAAU,QAAQ,YAAY;AAAA,IAC/C,UAAU,UAAU,QAAQ,KAAK;AAAA,IACjC;AAAA,IACA,KAAK,MAAM;AAAA,IACX,QAAqB,qBAAK,OAAO;AAAA,MAC/B,GAAG;AAAA,MACH,WAAW;AAAA,MACX,cAAc;AAAA,MACd,IAAI;AAAA,MACJ,MAAM;AAAA,MACN,OAAO;AAAA,QACL,OAAO,GAAG,KAAK;AAAA,MACjB;AAAA,IACF,CAAC;AAAA,IACD,UAAU,KAAK,IAAI,CAAC,OAAO,UAAuB,qBAAK,UAAU,KAAK;AAAA,MACpE,QAAqB,qBAAK,OAAO;AAAA,QAC/B,WAAW,qBAAO,UAAU;AAAA,QAC5B,MAAM;AAAA,MACR,CAAC;AAAA,MACD,UAAU,MAAM,IAAI,UAAqB,qBAAK,MAAM;AAAA,QAClD,IAAI,UAAU,QAAQ,IAAI;AAAA,QAC1B,OAAO;AAAA,MACT,GAAG,IAAI,CAAC;AAAA,IACV,GAAG,KAAK,CAAC;AAAA,EACX,CAAC;AACH;AAqBO,IAAM,yBAAyB,OAAO,OAAO,mCAAmC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUrF,MAAM,OAAO,OAAO,4BAA4B;AAAA,IAC9C,aAAa;AAAA,EACf,CAAC;AACH,CAAC;AACD,IAAO,mCAAQ;",
6
6
  "names": []
7
7
  }
@@ -178,6 +178,9 @@ function UnforwardedColorPalette(props, forwardedRef) {
178
178
  metaProps,
179
179
  labelProps
180
180
  } = getComputeCircularOptionPickerCommonProps(asButtons, loop, ariaLabel, ariaLabelledby);
181
+ if (disableCustomColors && colors.length === 0 && !actions) {
182
+ return null;
183
+ }
181
184
  return /* @__PURE__ */ _jsxs(VStack, {
182
185
  spacing: 3,
183
186
  ref: forwardedRef,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/color-palette/index.tsx"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\n\nimport { colord, extend } from 'colord';\nimport namesPlugin from 'colord/plugins/names';\nimport a11yPlugin from 'colord/plugins/a11y';\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useCallback, useMemo, useState, forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport Dropdown from '../dropdown';\nimport { ColorPicker } from '../color-picker';\nimport CircularOptionPicker, { getComputeCircularOptionPickerCommonProps } from '../circular-option-picker';\nimport { VStack } from '../v-stack';\nimport { Truncate } from '../truncate';\nimport { ColorHeading } from './styles';\nimport DropdownContentWrapper from '../dropdown/dropdown-content-wrapper';\nimport { extractColorNameFromCurrentValue, isMultiplePaletteArray, normalizeColorValue } from './utils';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nextend([namesPlugin, a11yPlugin]);\nfunction SinglePalette({\n className,\n clearColor,\n colors,\n onChange,\n value,\n selectedSlug,\n ...additionalProps\n}) {\n const colorOptions = useMemo(() => {\n return colors.map(({\n color,\n name,\n slug\n }, index) => {\n const colordColor = colord(color);\n // When a non-empty selectedSlug is provided, selection is decided\n // strictly by slug \u2014 entries without a slug or with a different slug\n // are not selected, even when their color value matches `value`.\n // This correctly handles mixed palettes where some entries have slugs\n // and others don't. Fall back to color value matching otherwise\n // (including when selectedSlug is an empty string).\n const isSelected = selectedSlug ? slug === selectedSlug : value === color;\n return /*#__PURE__*/_jsx(CircularOptionPicker.Option, {\n isSelected: isSelected,\n selectedIconProps: isSelected ? {\n fill: colordColor.contrast() > colordColor.contrast('#000') ? '#fff' : '#000'\n } : {},\n tooltipText: name ||\n // translators: %s: color hex code e.g: \"#f00\".\n sprintf(__('Color code: %s'), color),\n style: {\n backgroundColor: color,\n color\n },\n onClick: isSelected ? clearColor : () => onChange(color, index, slug)\n }, slug ?? `${color}-${index}`);\n });\n }, [colors, value, selectedSlug, onChange, clearColor]);\n return /*#__PURE__*/_jsx(CircularOptionPicker.OptionGroup, {\n className: className,\n options: colorOptions,\n ...additionalProps\n });\n}\nfunction MultiplePalettes({\n className,\n clearColor,\n colors,\n onChange,\n value,\n selectedSlug,\n headingLevel\n}) {\n const instanceId = useInstanceId(MultiplePalettes, 'color-palette');\n if (colors.length === 0) {\n return null;\n }\n return /*#__PURE__*/_jsx(VStack, {\n spacing: 3,\n className: className,\n children: colors.map(({\n name,\n colors: colorPalette\n }, index) => {\n const id = `${instanceId}-${index}`;\n return /*#__PURE__*/_jsxs(VStack, {\n spacing: 2,\n children: [/*#__PURE__*/_jsx(ColorHeading, {\n id: id,\n level: headingLevel,\n children: name\n }), /*#__PURE__*/_jsx(SinglePalette, {\n clearColor: clearColor,\n colors: colorPalette,\n onChange: (newColor, _colorIndex, slug) => onChange(newColor, index, slug),\n value: value,\n selectedSlug: selectedSlug,\n \"aria-labelledby\": id\n })]\n }, index);\n })\n });\n}\nexport function CustomColorPickerDropdown({\n isRenderedInSidebar,\n popoverProps: receivedPopoverProps,\n ...props\n}) {\n const popoverProps = useMemo(() => ({\n shift: true,\n // Disabling resize as it would otherwise cause the popover to show\n // scrollbars while dragging the color picker's handle close to the\n // popover edge.\n resize: false,\n ...(isRenderedInSidebar ? {\n // When in the sidebar: open to the left (stacking),\n // leaving the same gap as the parent popover.\n placement: 'left-start',\n offset: 34\n } : {\n // Default behavior: open below the anchor\n placement: 'bottom',\n offset: 8\n }),\n ...receivedPopoverProps\n }), [isRenderedInSidebar, receivedPopoverProps]);\n return /*#__PURE__*/_jsx(Dropdown, {\n contentClassName: \"components-color-palette__custom-color-dropdown-content\",\n popoverProps: popoverProps,\n ...props\n });\n}\nfunction UnforwardedColorPalette(props, forwardedRef) {\n const {\n asButtons,\n loop,\n clearable = true,\n colors = [],\n disableCustomColors = false,\n enableAlpha = false,\n onChange,\n value,\n selectedSlug,\n __experimentalIsRenderedInSidebar = false,\n headingLevel = 2,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n ...additionalProps\n } = props;\n const [normalizedColorValue, setNormalizedColorValue] = useState(value);\n const clearColor = useCallback(() => onChange(undefined), [onChange]);\n const customColorPaletteCallbackRef = useCallback(node => {\n setNormalizedColorValue(normalizeColorValue(value, node));\n }, [value]);\n const hasMultipleColorOrigins = isMultiplePaletteArray(colors);\n const buttonLabelName = useMemo(() => extractColorNameFromCurrentValue(value, colors, hasMultipleColorOrigins, selectedSlug), [value, colors, hasMultipleColorOrigins, selectedSlug]);\n const renderCustomColorPicker = () => /*#__PURE__*/_jsx(DropdownContentWrapper, {\n paddingSize: \"none\",\n children: /*#__PURE__*/_jsx(ColorPicker, {\n color: normalizedColorValue,\n onChange: color => onChange(color),\n enableAlpha: enableAlpha\n })\n });\n const isHex = value?.startsWith('#');\n\n // Leave hex values as-is. Remove the `var()` wrapper from CSS vars.\n const displayValue = value?.replace(/^var\\((.+)\\)$/, '$1');\n const customColorAccessibleLabel = !!displayValue ? sprintf(\n // translators: 1: The name of the color e.g: \"vivid red\". 2: The color's hex code e.g: \"#f00\".\n __('Custom color picker. The currently selected color is called \"%1$s\" and has a value of \"%2$s\".'), buttonLabelName, displayValue) : __('Custom color picker');\n const paletteCommonProps = {\n clearColor,\n onChange,\n value,\n selectedSlug\n };\n const actions = !!clearable && /*#__PURE__*/_jsx(CircularOptionPicker.ButtonAction, {\n onClick: clearColor,\n accessibleWhenDisabled: true,\n disabled: !value,\n children: __('Clear')\n });\n const {\n metaProps,\n labelProps\n } = getComputeCircularOptionPickerCommonProps(asButtons, loop, ariaLabel, ariaLabelledby);\n return /*#__PURE__*/_jsxs(VStack, {\n spacing: 3,\n ref: forwardedRef,\n ...additionalProps,\n children: [!disableCustomColors && /*#__PURE__*/_jsx(CustomColorPickerDropdown, {\n isRenderedInSidebar: __experimentalIsRenderedInSidebar,\n renderContent: renderCustomColorPicker,\n renderToggle: ({\n isOpen,\n onToggle\n }) => /*#__PURE__*/_jsxs(VStack, {\n className: \"components-color-palette__custom-color-wrapper\",\n spacing: 0,\n children: [/*#__PURE__*/_jsx(\"button\", {\n ref: customColorPaletteCallbackRef,\n className: \"components-color-palette__custom-color-button\",\n \"aria-expanded\": isOpen,\n \"aria-haspopup\": \"true\",\n onClick: onToggle,\n \"aria-label\": customColorAccessibleLabel,\n style: {\n background: value\n },\n type: \"button\"\n }), /*#__PURE__*/_jsxs(VStack, {\n className: \"components-color-palette__custom-color-text-wrapper\",\n spacing: 0.5,\n children: [/*#__PURE__*/_jsx(Truncate, {\n className: \"components-color-palette__custom-color-name\",\n children: value ? buttonLabelName : __('No color selected')\n }), /*#__PURE__*/_jsx(Truncate, {\n className: clsx('components-color-palette__custom-color-value', {\n 'components-color-palette__custom-color-value--is-hex': isHex\n }),\n children: displayValue\n })]\n })]\n })\n }), (colors.length > 0 || actions) && /*#__PURE__*/_jsx(CircularOptionPicker, {\n ...metaProps,\n ...labelProps,\n actions: actions,\n options: hasMultipleColorOrigins ? /*#__PURE__*/_jsx(MultiplePalettes, {\n ...paletteCommonProps,\n headingLevel: headingLevel,\n colors: colors,\n value: value\n }) : /*#__PURE__*/_jsx(SinglePalette, {\n ...paletteCommonProps,\n colors: colors,\n value: value\n })\n })]\n });\n}\n\n/**\n * Allows the user to pick a color from a list of pre-defined color entries.\n *\n * ```jsx\n * import { ColorPalette } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyColorPalette = () => {\n * const [ color, setColor ] = useState ( '#f00' )\n * const colors = [\n * { name: 'red', color: '#f00' },\n * { name: 'white', color: '#fff' },\n * { name: 'blue', color: '#00f' },\n * ];\n * return (\n * <ColorPalette\n * colors={ colors }\n * value={ color }\n * onChange={ ( color ) => setColor( color ) }\n * />\n * );\n * } );\n * ```\n */\nexport const ColorPalette = forwardRef(UnforwardedColorPalette);\nColorPalette.displayName = 'ColorP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C5E,GAAG;AAAA,MACH,GAAG;AAAA,MACH;AAAA,MACA,SAAS,0BAAuC,qBAAK,kBAAkB;AAAA,QACrE,GAAG;AAAA,QACH;AAAA,QACA;AAAA,QACA;AAAA,MACF,CAAC,IAAiB,qBAAK,eAAe;AAAA,QACpC,GAAG;AAAA,QACH;AAAA,QACA;AAAA,MACF,CAAC;AAAA,IACH,CAAC,CAAC;AAAA,EACJ,CAAC;AACH;AA0BO,IAAM,eAAe,WAAW,uBAAuB;AAC9D,aAAa,cAAc;AAC3B,IAAO,wBAAQ;",
4
+ "sourcesContent": ["/**\n * External dependencies\n */\n\nimport { colord, extend } from 'colord';\nimport namesPlugin from 'colord/plugins/names';\nimport a11yPlugin from 'colord/plugins/a11y';\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useCallback, useMemo, useState, forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport Dropdown from '../dropdown';\nimport { ColorPicker } from '../color-picker';\nimport CircularOptionPicker, { getComputeCircularOptionPickerCommonProps } from '../circular-option-picker';\nimport { VStack } from '../v-stack';\nimport { Truncate } from '../truncate';\nimport { ColorHeading } from './styles';\nimport DropdownContentWrapper from '../dropdown/dropdown-content-wrapper';\nimport { extractColorNameFromCurrentValue, isMultiplePaletteArray, normalizeColorValue } from './utils';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nextend([namesPlugin, a11yPlugin]);\nfunction SinglePalette({\n className,\n clearColor,\n colors,\n onChange,\n value,\n selectedSlug,\n ...additionalProps\n}) {\n const colorOptions = useMemo(() => {\n return colors.map(({\n color,\n name,\n slug\n }, index) => {\n const colordColor = colord(color);\n // When a non-empty selectedSlug is provided, selection is decided\n // strictly by slug \u2014 entries without a slug or with a different slug\n // are not selected, even when their color value matches `value`.\n // This correctly handles mixed palettes where some entries have slugs\n // and others don't. Fall back to color value matching otherwise\n // (including when selectedSlug is an empty string).\n const isSelected = selectedSlug ? slug === selectedSlug : value === color;\n return /*#__PURE__*/_jsx(CircularOptionPicker.Option, {\n isSelected: isSelected,\n selectedIconProps: isSelected ? {\n fill: colordColor.contrast() > colordColor.contrast('#000') ? '#fff' : '#000'\n } : {},\n tooltipText: name ||\n // translators: %s: color hex code e.g: \"#f00\".\n sprintf(__('Color code: %s'), color),\n style: {\n backgroundColor: color,\n color\n },\n onClick: isSelected ? clearColor : () => onChange(color, index, slug)\n }, slug ?? `${color}-${index}`);\n });\n }, [colors, value, selectedSlug, onChange, clearColor]);\n return /*#__PURE__*/_jsx(CircularOptionPicker.OptionGroup, {\n className: className,\n options: colorOptions,\n ...additionalProps\n });\n}\nfunction MultiplePalettes({\n className,\n clearColor,\n colors,\n onChange,\n value,\n selectedSlug,\n headingLevel\n}) {\n const instanceId = useInstanceId(MultiplePalettes, 'color-palette');\n if (colors.length === 0) {\n return null;\n }\n return /*#__PURE__*/_jsx(VStack, {\n spacing: 3,\n className: className,\n children: colors.map(({\n name,\n colors: colorPalette\n }, index) => {\n const id = `${instanceId}-${index}`;\n return /*#__PURE__*/_jsxs(VStack, {\n spacing: 2,\n children: [/*#__PURE__*/_jsx(ColorHeading, {\n id: id,\n level: headingLevel,\n children: name\n }), /*#__PURE__*/_jsx(SinglePalette, {\n clearColor: clearColor,\n colors: colorPalette,\n onChange: (newColor, _colorIndex, slug) => onChange(newColor, index, slug),\n value: value,\n selectedSlug: selectedSlug,\n \"aria-labelledby\": id\n })]\n }, index);\n })\n });\n}\nexport function CustomColorPickerDropdown({\n isRenderedInSidebar,\n popoverProps: receivedPopoverProps,\n ...props\n}) {\n const popoverProps = useMemo(() => ({\n shift: true,\n // Disabling resize as it would otherwise cause the popover to show\n // scrollbars while dragging the color picker's handle close to the\n // popover edge.\n resize: false,\n ...(isRenderedInSidebar ? {\n // When in the sidebar: open to the left (stacking),\n // leaving the same gap as the parent popover.\n placement: 'left-start',\n offset: 34\n } : {\n // Default behavior: open below the anchor\n placement: 'bottom',\n offset: 8\n }),\n ...receivedPopoverProps\n }), [isRenderedInSidebar, receivedPopoverProps]);\n return /*#__PURE__*/_jsx(Dropdown, {\n contentClassName: \"components-color-palette__custom-color-dropdown-content\",\n popoverProps: popoverProps,\n ...props\n });\n}\nfunction UnforwardedColorPalette(props, forwardedRef) {\n const {\n asButtons,\n loop,\n clearable = true,\n colors = [],\n disableCustomColors = false,\n enableAlpha = false,\n onChange,\n value,\n selectedSlug,\n __experimentalIsRenderedInSidebar = false,\n headingLevel = 2,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n ...additionalProps\n } = props;\n const [normalizedColorValue, setNormalizedColorValue] = useState(value);\n const clearColor = useCallback(() => onChange(undefined), [onChange]);\n const customColorPaletteCallbackRef = useCallback(node => {\n setNormalizedColorValue(normalizeColorValue(value, node));\n }, [value]);\n const hasMultipleColorOrigins = isMultiplePaletteArray(colors);\n const buttonLabelName = useMemo(() => extractColorNameFromCurrentValue(value, colors, hasMultipleColorOrigins, selectedSlug), [value, colors, hasMultipleColorOrigins, selectedSlug]);\n const renderCustomColorPicker = () => /*#__PURE__*/_jsx(DropdownContentWrapper, {\n paddingSize: \"none\",\n children: /*#__PURE__*/_jsx(ColorPicker, {\n color: normalizedColorValue,\n onChange: color => onChange(color),\n enableAlpha: enableAlpha\n })\n });\n const isHex = value?.startsWith('#');\n\n // Leave hex values as-is. Remove the `var()` wrapper from CSS vars.\n const displayValue = value?.replace(/^var\\((.+)\\)$/, '$1');\n const customColorAccessibleLabel = !!displayValue ? sprintf(\n // translators: 1: The name of the color e.g: \"vivid red\". 2: The color's hex code e.g: \"#f00\".\n __('Custom color picker. The currently selected color is called \"%1$s\" and has a value of \"%2$s\".'), buttonLabelName, displayValue) : __('Custom color picker');\n const paletteCommonProps = {\n clearColor,\n onChange,\n value,\n selectedSlug\n };\n const actions = !!clearable && /*#__PURE__*/_jsx(CircularOptionPicker.ButtonAction, {\n onClick: clearColor,\n accessibleWhenDisabled: true,\n disabled: !value,\n children: __('Clear')\n });\n const {\n metaProps,\n labelProps\n } = getComputeCircularOptionPickerCommonProps(asButtons, loop, ariaLabel, ariaLabelledby);\n\n // If disableCustomColors is true and colors.length is 0, return null to avoid rendering an empty palette wrapper.\n if (disableCustomColors && colors.length === 0 && !actions) {\n return null;\n }\n return /*#__PURE__*/_jsxs(VStack, {\n spacing: 3,\n ref: forwardedRef,\n ...additionalProps,\n children: [!disableCustomColors && /*#__PURE__*/_jsx(CustomColorPickerDropdown, {\n isRenderedInSidebar: __experimentalIsRenderedInSidebar,\n renderContent: renderCustomColorPicker,\n renderToggle: ({\n isOpen,\n onToggle\n }) => /*#__PURE__*/_jsxs(VStack, {\n className: \"components-color-palette__custom-color-wrapper\",\n spacing: 0,\n children: [/*#__PURE__*/_jsx(\"button\", {\n ref: customColorPaletteCallbackRef,\n className: \"components-color-palette__custom-color-button\",\n \"aria-expanded\": isOpen,\n \"aria-haspopup\": \"true\",\n onClick: onToggle,\n \"aria-label\": customColorAccessibleLabel,\n style: {\n background: value\n },\n type: \"button\"\n }), /*#__PURE__*/_jsxs(VStack, {\n className: \"components-color-palette__custom-color-text-wrapper\",\n spacing: 0.5,\n children: [/*#__PURE__*/_jsx(Truncate, {\n className: \"components-color-palette__custom-color-name\",\n children: value ? buttonLabelName : __('No color selected')\n }), /*#__PURE__*/_jsx(Truncate, {\n className: clsx('components-color-palette__custom-color-value', {\n 'components-color-palette__custom-color-value--is-hex': isHex\n }),\n children: displayValue\n })]\n })]\n })\n }), (colors.length > 0 || actions) && /*#__PURE__*/_jsx(CircularOptionPicker, {\n ...metaProps,\n ...labelProps,\n actions: actions,\n options: hasMultipleColorOrigins ? /*#__PURE__*/_jsx(MultiplePalettes, {\n ...paletteCommonProps,\n headingLevel: headingLevel,\n colors: colors,\n value: value\n }) : /*#__PURE__*/_jsx(SinglePalette, {\n ...paletteCommonProps,\n colors: colors,\n value: value\n })\n })]\n });\n}\n\n/**\n * Allows the user to pick a color from a list of pre-defined color entries.\n *\n * ```jsx\n * import { ColorPalette } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyColorPalette = () => {\n * const [ color, setColor ] = useState ( '#f00' )\n * const colors = [\n * { name: 'red', color: '#f00' },\n * { name: 'white', color: '#fff' },\n * { name: 'blue', color: '#00f' },\n * ];\n * return (\n * <ColorPalette\n * colors={ colors }\n * value={ color }\n * onChange={ ( color ) => setColor( color ) }\n * />\n * );\n * } );\n * ```\n */\nexport const ColorPalette = forwardRef(UnforwardedColorPalette);\nColorPalette.displayName = 'ColorPalette';\nexport default ColorPalette;"],
5
+ "mappings": ";AAIA,SAAS,QAAQ,cAAc;AAC/B,OAAO,iBAAiB;AACxB,OAAO,gBAAgB;AACvB,OAAO,UAAU;AAKjB,SAAS,qBAAqB;AAC9B,SAAS,IAAI,eAAe;AAC5B,SAAS,aAAa,SAAS,UAAU,kBAAkB;AAK3D,OAAO,cAAc;AACrB,SAAS,mBAAmB;AAC5B,OAAO,wBAAwB,iDAAiD;AAChF,SAAS,cAAc;AACvB,SAAS,gBAAgB;AACzB,SAAS,oBAAoB;AAC7B,OAAO,4BAA4B;AACnC,SAAS,kCAAkC,wBAAwB,2BAA2B;AAC9F,SAAS,OAAO,MAAM,QAAQ,aAAa;AAC3C,OAAO,CAAC,aAAa,UAAU,CAAC;AAChC,SAAS,cAAc;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAG;AACD,QAAM,eAAe,QAAQ,MAAM;AACjC,WAAO,OAAO,IAAI,CAAC;AAAA,MACjB;AAAA,MACA;AAAA,MACA;AAAA,IACF,GAAG,UAAU;AACX,YAAM,cAAc,OAAO,KAAK;AAOhC,YAAM,aAAa,eAAe,SAAS,eAAe,UAAU;AACpE,aAAoB,qBAAK,qBAAqB,QAAQ;AAAA,QACpD;AAAA,QACA,mBAAmB,aAAa;AAAA,UAC9B,MAAM,YAAY,S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