@wordpress/components 25.12.0 → 25.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (342) hide show
  1. package/CHANGELOG.md +65 -0
  2. package/build/angle-picker-control/index.js +0 -1
  3. package/build/angle-picker-control/index.js.map +1 -1
  4. package/build/border-control/border-control-dropdown/component.js +4 -2
  5. package/build/border-control/border-control-dropdown/component.js.map +1 -1
  6. package/build/border-control/border-control-dropdown/hook.js +3 -2
  7. package/build/border-control/border-control-dropdown/hook.js.map +1 -1
  8. package/build/border-control/styles.js +17 -17
  9. package/build/border-control/styles.js.map +1 -1
  10. package/build/checkbox-control/index.js +1 -1
  11. package/build/checkbox-control/index.js.map +1 -1
  12. package/build/checkbox-control/types.js.map +1 -1
  13. package/build/custom-select-control-v2/index.js +87 -0
  14. package/build/custom-select-control-v2/index.js.map +1 -0
  15. package/build/custom-select-control-v2/styles.js +85 -0
  16. package/build/custom-select-control-v2/styles.js.map +1 -0
  17. package/build/custom-select-control-v2/types.js +6 -0
  18. package/build/custom-select-control-v2/types.js.map +1 -0
  19. package/build/date-time/time/timezone.js +11 -2
  20. package/build/date-time/time/timezone.js.map +1 -1
  21. package/build/dimension-control/index.js +2 -0
  22. package/build/dimension-control/index.js.map +1 -1
  23. package/build/dimension-control/types.js.map +1 -1
  24. package/build/dropdown-menu-v2-ariakit/index.js +49 -20
  25. package/build/dropdown-menu-v2-ariakit/index.js.map +1 -1
  26. package/build/dropdown-menu-v2-ariakit/styles.js +82 -59
  27. package/build/dropdown-menu-v2-ariakit/styles.js.map +1 -1
  28. package/build/dropdown-menu-v2-ariakit/types.js.map +1 -1
  29. package/build/focal-point-picker/controls.js +5 -1
  30. package/build/focal-point-picker/controls.js.map +1 -1
  31. package/build/focal-point-picker/index.js +2 -0
  32. package/build/focal-point-picker/index.js.map +1 -1
  33. package/build/focal-point-picker/styles/focal-point-picker-style.js +15 -15
  34. package/build/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
  35. package/build/focal-point-picker/types.js.map +1 -1
  36. package/build/font-size-picker/font-size-picker-select.js +2 -0
  37. package/build/font-size-picker/font-size-picker-select.js.map +1 -1
  38. package/build/font-size-picker/font-size-picker-toggle-group.js +2 -0
  39. package/build/font-size-picker/font-size-picker-toggle-group.js.map +1 -1
  40. package/build/font-size-picker/index.js +6 -1
  41. package/build/font-size-picker/index.js.map +1 -1
  42. package/build/font-size-picker/types.js.map +1 -1
  43. package/build/form-token-field/index.js +6 -2
  44. package/build/form-token-field/index.js.map +1 -1
  45. package/build/form-token-field/token-input.js.map +1 -1
  46. package/build/form-token-field/types.js.map +1 -1
  47. package/build/heading/hook.js +6 -3
  48. package/build/heading/hook.js.map +1 -1
  49. package/build/heading/types.js.map +1 -1
  50. package/build/index.native.js +0 -16
  51. package/build/index.native.js.map +1 -1
  52. package/build/mobile/global-styles-context/utils.native.js +13 -0
  53. package/build/mobile/global-styles-context/utils.native.js.map +1 -1
  54. package/build/mobile/utils/alignments.native.js +1 -1
  55. package/build/mobile/utils/alignments.native.js.map +1 -1
  56. package/build/palette-edit/index.js +21 -1
  57. package/build/palette-edit/index.js.map +1 -1
  58. package/build/private-apis.js +3 -2
  59. package/build/private-apis.js.map +1 -1
  60. package/build/query-controls/author-select.js +3 -1
  61. package/build/query-controls/author-select.js.map +1 -1
  62. package/build/query-controls/category-select.js +3 -1
  63. package/build/query-controls/category-select.js.map +1 -1
  64. package/build/query-controls/index.js +6 -1
  65. package/build/query-controls/index.js.map +1 -1
  66. package/build/query-controls/types.js.map +1 -1
  67. package/build/slot-fill/types.js.map +1 -1
  68. package/build/tabs/index.js +24 -5
  69. package/build/tabs/index.js.map +1 -1
  70. package/build/tabs/tab.js +4 -4
  71. package/build/tabs/tab.js.map +1 -1
  72. package/build/tabs/tabpanel.js +4 -3
  73. package/build/tabs/tabpanel.js.map +1 -1
  74. package/build/tabs/types.js.map +1 -1
  75. package/build/text/types.js.map +1 -1
  76. package/build/toggle-group-control/toggle-group-control/utils.js +17 -17
  77. package/build/toggle-group-control/toggle-group-control/utils.js.map +1 -1
  78. package/build/tools-panel/tools-panel-item/hook.js +16 -12
  79. package/build/tools-panel/tools-panel-item/hook.js.map +1 -1
  80. package/build-module/angle-picker-control/index.js +0 -1
  81. package/build-module/angle-picker-control/index.js.map +1 -1
  82. package/build-module/border-control/border-control-dropdown/component.js +4 -2
  83. package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
  84. package/build-module/border-control/border-control-dropdown/hook.js +3 -2
  85. package/build-module/border-control/border-control-dropdown/hook.js.map +1 -1
  86. package/build-module/border-control/styles.js +17 -17
  87. package/build-module/border-control/styles.js.map +1 -1
  88. package/build-module/checkbox-control/index.js +1 -1
  89. package/build-module/checkbox-control/index.js.map +1 -1
  90. package/build-module/checkbox-control/types.js.map +1 -1
  91. package/build-module/custom-select-control-v2/index.js +74 -0
  92. package/build-module/custom-select-control-v2/index.js.map +1 -0
  93. package/build-module/custom-select-control-v2/styles.js +71 -0
  94. package/build-module/custom-select-control-v2/styles.js.map +1 -0
  95. package/build-module/custom-select-control-v2/types.js +2 -0
  96. package/build-module/custom-select-control-v2/types.js.map +1 -0
  97. package/build-module/date-time/time/timezone.js +11 -2
  98. package/build-module/date-time/time/timezone.js.map +1 -1
  99. package/build-module/dimension-control/index.js +2 -0
  100. package/build-module/dimension-control/index.js.map +1 -1
  101. package/build-module/dimension-control/types.js.map +1 -1
  102. package/build-module/dropdown-menu-v2-ariakit/index.js +46 -18
  103. package/build-module/dropdown-menu-v2-ariakit/index.js.map +1 -1
  104. package/build-module/dropdown-menu-v2-ariakit/styles.js +69 -40
  105. package/build-module/dropdown-menu-v2-ariakit/styles.js.map +1 -1
  106. package/build-module/dropdown-menu-v2-ariakit/types.js.map +1 -1
  107. package/build-module/focal-point-picker/controls.js +5 -1
  108. package/build-module/focal-point-picker/controls.js.map +1 -1
  109. package/build-module/focal-point-picker/index.js +2 -0
  110. package/build-module/focal-point-picker/index.js.map +1 -1
  111. package/build-module/focal-point-picker/styles/focal-point-picker-style.js +15 -15
  112. package/build-module/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
  113. package/build-module/focal-point-picker/types.js.map +1 -1
  114. package/build-module/font-size-picker/font-size-picker-select.js +2 -0
  115. package/build-module/font-size-picker/font-size-picker-select.js.map +1 -1
  116. package/build-module/font-size-picker/font-size-picker-toggle-group.js +2 -0
  117. package/build-module/font-size-picker/font-size-picker-toggle-group.js.map +1 -1
  118. package/build-module/font-size-picker/index.js +6 -1
  119. package/build-module/font-size-picker/index.js.map +1 -1
  120. package/build-module/font-size-picker/types.js.map +1 -1
  121. package/build-module/form-token-field/index.js +6 -2
  122. package/build-module/form-token-field/index.js.map +1 -1
  123. package/build-module/form-token-field/token-input.js.map +1 -1
  124. package/build-module/form-token-field/types.js.map +1 -1
  125. package/build-module/heading/hook.js +6 -3
  126. package/build-module/heading/hook.js.map +1 -1
  127. package/build-module/heading/types.js.map +1 -1
  128. package/build-module/index.native.js +0 -2
  129. package/build-module/index.native.js.map +1 -1
  130. package/build-module/mobile/global-styles-context/utils.native.js +13 -0
  131. package/build-module/mobile/global-styles-context/utils.native.js.map +1 -1
  132. package/build-module/mobile/utils/alignments.native.js +1 -1
  133. package/build-module/mobile/utils/alignments.native.js.map +1 -1
  134. package/build-module/palette-edit/index.js +20 -3
  135. package/build-module/palette-edit/index.js.map +1 -1
  136. package/build-module/private-apis.js +4 -3
  137. package/build-module/private-apis.js.map +1 -1
  138. package/build-module/query-controls/author-select.js +3 -1
  139. package/build-module/query-controls/author-select.js.map +1 -1
  140. package/build-module/query-controls/category-select.js +3 -1
  141. package/build-module/query-controls/category-select.js.map +1 -1
  142. package/build-module/query-controls/index.js +6 -1
  143. package/build-module/query-controls/index.js.map +1 -1
  144. package/build-module/query-controls/types.js.map +1 -1
  145. package/build-module/slot-fill/types.js.map +1 -1
  146. package/build-module/tabs/index.js +25 -6
  147. package/build-module/tabs/index.js.map +1 -1
  148. package/build-module/tabs/tab.js +6 -6
  149. package/build-module/tabs/tab.js.map +1 -1
  150. package/build-module/tabs/tabpanel.js +6 -5
  151. package/build-module/tabs/tabpanel.js.map +1 -1
  152. package/build-module/tabs/types.js.map +1 -1
  153. package/build-module/text/types.js.map +1 -1
  154. package/build-module/toggle-group-control/toggle-group-control/utils.js +17 -17
  155. package/build-module/toggle-group-control/toggle-group-control/utils.js.map +1 -1
  156. package/build-module/tools-panel/tools-panel-item/hook.js +17 -13
  157. package/build-module/tools-panel/tools-panel-item/hook.js.map +1 -1
  158. package/build-style/style-rtl.css +32 -6
  159. package/build-style/style.css +32 -6
  160. package/build-types/angle-picker-control/index.d.ts.map +1 -1
  161. package/build-types/border-control/border-control-dropdown/component.d.ts.map +1 -1
  162. package/build-types/border-control/border-control-dropdown/hook.d.ts +1 -0
  163. package/build-types/border-control/border-control-dropdown/hook.d.ts.map +1 -1
  164. package/build-types/border-control/styles.d.ts +1 -1
  165. package/build-types/border-control/styles.d.ts.map +1 -1
  166. package/build-types/box-control/stories/index.story.d.ts +1944 -0
  167. package/build-types/box-control/stories/index.story.d.ts.map +1 -0
  168. package/build-types/checkbox-control/index.d.ts.map +1 -1
  169. package/build-types/checkbox-control/types.d.ts +3 -2
  170. package/build-types/checkbox-control/types.d.ts.map +1 -1
  171. package/build-types/color-palette/styles.d.ts +4 -1
  172. package/build-types/color-palette/styles.d.ts.map +1 -1
  173. package/build-types/custom-select-control-v2/index.d.ts +6 -0
  174. package/build-types/custom-select-control-v2/index.d.ts.map +1 -0
  175. package/build-types/custom-select-control-v2/stories/index.story.d.ts +19 -0
  176. package/build-types/custom-select-control-v2/stories/index.story.d.ts.map +1 -0
  177. package/build-types/custom-select-control-v2/styles.d.ts +47 -0
  178. package/build-types/custom-select-control-v2/styles.d.ts.map +1 -0
  179. package/build-types/custom-select-control-v2/types.d.ts +57 -0
  180. package/build-types/custom-select-control-v2/types.d.ts.map +1 -0
  181. package/build-types/date-time/date/styles.d.ts +4 -1
  182. package/build-types/date-time/date/styles.d.ts.map +1 -1
  183. package/build-types/date-time/time/timezone.d.ts.map +1 -1
  184. package/build-types/dimension-control/index.d.ts.map +1 -1
  185. package/build-types/dimension-control/types.d.ts +6 -0
  186. package/build-types/dimension-control/types.d.ts.map +1 -1
  187. package/build-types/dropdown-menu-v2-ariakit/index.d.ts +11 -2
  188. package/build-types/dropdown-menu-v2-ariakit/index.d.ts.map +1 -1
  189. package/build-types/dropdown-menu-v2-ariakit/stories/index.story.d.ts.map +1 -1
  190. package/build-types/dropdown-menu-v2-ariakit/styles.d.ts +26 -18
  191. package/build-types/dropdown-menu-v2-ariakit/styles.d.ts.map +1 -1
  192. package/build-types/dropdown-menu-v2-ariakit/types.d.ts +0 -6
  193. package/build-types/dropdown-menu-v2-ariakit/types.d.ts.map +1 -1
  194. package/build-types/focal-point-picker/controls.d.ts +1 -1
  195. package/build-types/focal-point-picker/controls.d.ts.map +1 -1
  196. package/build-types/focal-point-picker/index.d.ts +1 -1
  197. package/build-types/focal-point-picker/index.d.ts.map +1 -1
  198. package/build-types/focal-point-picker/stories/index.story.d.ts +8 -4
  199. package/build-types/focal-point-picker/stories/index.story.d.ts.map +1 -1
  200. package/build-types/focal-point-picker/types.d.ts +7 -0
  201. package/build-types/focal-point-picker/types.d.ts.map +1 -1
  202. package/build-types/font-size-picker/font-size-picker-select.d.ts.map +1 -1
  203. package/build-types/font-size-picker/font-size-picker-toggle-group.d.ts.map +1 -1
  204. package/build-types/font-size-picker/index.d.ts.map +1 -1
  205. package/build-types/font-size-picker/types.d.ts +8 -1
  206. package/build-types/font-size-picker/types.d.ts.map +1 -1
  207. package/build-types/form-token-field/index.d.ts.map +1 -1
  208. package/build-types/form-token-field/token-input.d.ts.map +1 -1
  209. package/build-types/form-token-field/types.d.ts +1 -1
  210. package/build-types/form-token-field/types.d.ts.map +1 -1
  211. package/build-types/heading/component.d.ts +4 -1
  212. package/build-types/heading/component.d.ts.map +1 -1
  213. package/build-types/heading/hook.d.ts.map +1 -1
  214. package/build-types/heading/types.d.ts +20 -1
  215. package/build-types/heading/types.d.ts.map +1 -1
  216. package/build-types/navigation/styles/navigation-styles.d.ts +4 -1
  217. package/build-types/navigation/styles/navigation-styles.d.ts.map +1 -1
  218. package/build-types/palette-edit/index.d.ts +6 -1
  219. package/build-types/palette-edit/index.d.ts.map +1 -1
  220. package/build-types/palette-edit/styles.d.ts +4 -1
  221. package/build-types/palette-edit/styles.d.ts.map +1 -1
  222. package/build-types/private-apis.d.ts.map +1 -1
  223. package/build-types/query-controls/author-select.d.ts +1 -1
  224. package/build-types/query-controls/author-select.d.ts.map +1 -1
  225. package/build-types/query-controls/category-select.d.ts +1 -1
  226. package/build-types/query-controls/category-select.d.ts.map +1 -1
  227. package/build-types/query-controls/index.d.ts +1 -1
  228. package/build-types/query-controls/index.d.ts.map +1 -1
  229. package/build-types/query-controls/types.d.ts +9 -0
  230. package/build-types/query-controls/types.d.ts.map +1 -1
  231. package/build-types/slot-fill/bubbles-virtually/slot.d.ts +1 -1
  232. package/build-types/slot-fill/types.d.ts +16 -6
  233. package/build-types/slot-fill/types.d.ts.map +1 -1
  234. package/build-types/tabs/index.d.ts +3 -2
  235. package/build-types/tabs/index.d.ts.map +1 -1
  236. package/build-types/tabs/stories/index.story.d.ts.map +1 -1
  237. package/build-types/tabs/tab.d.ts +2 -1
  238. package/build-types/tabs/tab.d.ts.map +1 -1
  239. package/build-types/tabs/tabpanel.d.ts +2 -1
  240. package/build-types/tabs/tabpanel.d.ts.map +1 -1
  241. package/build-types/tabs/types.d.ts +8 -3
  242. package/build-types/tabs/types.d.ts.map +1 -1
  243. package/build-types/text/types.d.ts +15 -2
  244. package/build-types/text/types.d.ts.map +1 -1
  245. package/build-types/toggle-group-control/toggle-group-control/utils.d.ts.map +1 -1
  246. package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
  247. package/package.json +19 -19
  248. package/src/angle-picker-control/index.tsx +0 -1
  249. package/src/border-control/border-control-dropdown/component.tsx +3 -1
  250. package/src/border-control/border-control-dropdown/hook.ts +3 -2
  251. package/src/border-control/styles.ts +2 -9
  252. package/src/box-control/stories/index.story.tsx +82 -0
  253. package/src/button/style.scss +10 -2
  254. package/src/checkbox-control/README.md +2 -1
  255. package/src/checkbox-control/index.tsx +8 -6
  256. package/src/checkbox-control/test/__snapshots__/index.tsx.snap +3 -8
  257. package/src/checkbox-control/test/index.tsx +7 -0
  258. package/src/checkbox-control/types.ts +3 -2
  259. package/src/combobox-control/README.md +1 -3
  260. package/src/custom-select-control/test/index.js +367 -35
  261. package/src/custom-select-control-v2/README.md +73 -0
  262. package/src/custom-select-control-v2/index.tsx +99 -0
  263. package/src/custom-select-control-v2/stories/index.story.tsx +149 -0
  264. package/src/custom-select-control-v2/styles.ts +76 -0
  265. package/src/custom-select-control-v2/types.ts +63 -0
  266. package/src/date-time/time/timezone.tsx +15 -3
  267. package/src/dimension-control/index.tsx +2 -0
  268. package/src/dimension-control/test/__snapshots__/index.test.js.snap +2 -2
  269. package/src/dimension-control/types.ts +6 -0
  270. package/src/dropdown-menu-v2-ariakit/README.md +19 -5
  271. package/src/dropdown-menu-v2-ariakit/index.tsx +85 -36
  272. package/src/dropdown-menu-v2-ariakit/stories/index.story.tsx +204 -90
  273. package/src/dropdown-menu-v2-ariakit/styles.ts +165 -117
  274. package/src/dropdown-menu-v2-ariakit/test/index.tsx +5 -10
  275. package/src/dropdown-menu-v2-ariakit/types.ts +0 -7
  276. package/src/focal-point-picker/controls.tsx +4 -0
  277. package/src/focal-point-picker/index.tsx +2 -0
  278. package/src/focal-point-picker/styles/focal-point-picker-style.ts +1 -1
  279. package/src/focal-point-picker/types.ts +7 -0
  280. package/src/font-size-picker/font-size-picker-select.tsx +2 -0
  281. package/src/font-size-picker/font-size-picker-toggle-group.tsx +9 -1
  282. package/src/font-size-picker/index.tsx +11 -3
  283. package/src/font-size-picker/types.ts +8 -1
  284. package/src/form-toggle/style.scss +40 -8
  285. package/src/form-token-field/index.tsx +11 -3
  286. package/src/form-token-field/token-input.tsx +1 -3
  287. package/src/form-token-field/types.ts +1 -0
  288. package/src/heading/README.md +6 -1
  289. package/src/heading/hook.ts +6 -3
  290. package/src/heading/types.ts +23 -1
  291. package/src/index.native.js +0 -2
  292. package/src/mobile/global-styles-context/test/utils.native.js +22 -0
  293. package/src/mobile/global-styles-context/utils.native.js +14 -0
  294. package/src/mobile/link-settings/style.native.scss +0 -17
  295. package/src/mobile/utils/alignments.native.js +1 -0
  296. package/src/navigable-container/README.md +1 -1
  297. package/src/palette-edit/index.tsx +22 -8
  298. package/src/palette-edit/style.scss +2 -2
  299. package/src/palette-edit/test/index.tsx +75 -1
  300. package/src/private-apis.ts +4 -2
  301. package/src/query-controls/author-select.tsx +2 -0
  302. package/src/query-controls/category-select.tsx +2 -0
  303. package/src/query-controls/index.tsx +6 -1
  304. package/src/query-controls/types.ts +9 -0
  305. package/src/search-control/README.md +2 -0
  306. package/src/slot-fill/README.md +1 -1
  307. package/src/slot-fill/types.ts +18 -6
  308. package/src/spinner/README.md +2 -0
  309. package/src/tabs/README.md +4 -4
  310. package/src/tabs/index.tsx +34 -3
  311. package/src/tabs/stories/index.story.tsx +56 -48
  312. package/src/tabs/tab.tsx +7 -7
  313. package/src/tabs/tabpanel.tsx +10 -6
  314. package/src/tabs/test/index.tsx +180 -87
  315. package/src/tabs/types.ts +8 -3
  316. package/src/text/README.md +5 -1
  317. package/src/text/types.ts +15 -2
  318. package/src/toggle-control/README.md +2 -2
  319. package/src/toggle-group-control/test/index.tsx +54 -1
  320. package/src/toggle-group-control/toggle-group-control/utils.ts +15 -20
  321. package/src/tools-panel/tools-panel-item/hook.ts +21 -23
  322. package/tsconfig.tsbuildinfo +1 -1
  323. package/build/mobile/inserter-button/index.native.js +0 -98
  324. package/build/mobile/inserter-button/index.native.js.map +0 -1
  325. package/build/mobile/inserter-button/sparkles.js +0 -23
  326. package/build/mobile/inserter-button/sparkles.js.map +0 -1
  327. package/build/mobile/link-settings/image-link-destinations-screen.native.js +0 -119
  328. package/build/mobile/link-settings/image-link-destinations-screen.native.js.map +0 -1
  329. package/build-module/mobile/inserter-button/index.native.js +0 -89
  330. package/build-module/mobile/inserter-button/index.native.js.map +0 -1
  331. package/build-module/mobile/inserter-button/sparkles.js +0 -15
  332. package/build-module/mobile/inserter-button/sparkles.js.map +0 -1
  333. package/build-module/mobile/link-settings/image-link-destinations-screen.native.js +0 -110
  334. package/build-module/mobile/link-settings/image-link-destinations-screen.native.js.map +0 -1
  335. package/build-types/mobile/inserter-button/sparkles.d.ts +0 -3
  336. package/build-types/mobile/inserter-button/sparkles.d.ts.map +0 -1
  337. package/src/box-control/stories/index.story.js +0 -75
  338. package/src/mobile/inserter-button/README.md +0 -62
  339. package/src/mobile/inserter-button/index.native.js +0 -116
  340. package/src/mobile/inserter-button/sparkles.js +0 -15
  341. package/src/mobile/inserter-button/style.native.scss +0 -72
  342. package/src/mobile/link-settings/image-link-destinations-screen.native.js +0 -152
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/components/src/form-token-field/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type {\n\tComponentPropsWithRef,\n\tMouseEventHandler,\n\tReactNode,\n} from 'react';\n\ntype Messages = {\n\t/**\n\t * The user added a new token.\n\t */\n\tadded: string;\n\t/**\n\t * The user removed an existing token.\n\t */\n\tremoved: string;\n\t/**\n\t * The user focused the button to remove the token.\n\t */\n\tremove: string;\n\t/**\n\t * The user tried to add a token that didn't pass the validation.\n\t */\n\t__experimentalInvalid: string;\n};\n\nexport interface TokenItem {\n\t/**\n\t * The value of the token.\n\t */\n\tvalue: string;\n\t/**\n\t * One of 'error', 'validating', or 'success'. Applies styles to token.\n\t */\n\tstatus?: 'error' | 'success' | 'validating';\n\t/**\n\t * If not falsey, will add a title to the token.\n\t */\n\ttitle?: string;\n\t/**\n\t * When true, renders tokens as without a background.\n\t */\n\tisBorderless?: boolean;\n\t/**\n\t * Function to call when onMouseEnter event triggered on token.\n\t */\n\tonMouseEnter?: MouseEventHandler< HTMLSpanElement >;\n\t/**\n\t * Function to call when onMouseLeave is triggered on token.\n\t */\n\tonMouseLeave?: MouseEventHandler< HTMLSpanElement >;\n}\n\nexport interface FormTokenFieldProps\n\textends Pick<\n\t\tComponentPropsWithRef< 'input' >,\n\t\t'autoCapitalize' | 'autoComplete' | 'className'\n\t> {\n\tlabel?: string;\n\t/**\n\t * An array of strings to present to the user as suggested tokens.\n\t */\n\tsuggestions?: string[];\n\t/**\n\t * The maximum number of suggestions to display at a time.\n\t *\n\t * @default 100\n\t */\n\tmaxSuggestions?: number;\n\t/**\n\t * An array of strings or objects to display as tokens in the field.\n\t * If objects are present in the array, they **must** have a property of `value`.\n\t */\n\tvalue?: ( string | TokenItem )[];\n\t/**\n\t * Function to call to transform tokens for display.\n\t * (In the editor, this is needed to decode HTML entities embedded in tags\n\t * - otherwise entities like `&` in tag names are double-encoded like `&amp;`,\n\t * once by the REST API and once by React).\n\t */\n\tdisplayTransform?: ( token: string ) => string;\n\t/**\n\t * Function to call to transform tokens for saving. The default is to trim the token value.\n\t * This function is also applied when matching suggestions against the current value\n\t * so that matching works correctly with leading or trailing spaces. (In the editor,\n\t * this is needed to remove leading and trailing spaces from tag names, like wp-admin does.\n\t * Otherwise the REST API won't save them.)\n\t *\n\t * @default ( token: string ) => token.trim()\n\t */\n\tsaveTransform?: ( token: string ) => string;\n\t/**\n\t * Function to call when the tokens have changed. An array of new tokens is passed to the callback.\n\t *\n\t */\n\tonChange?: ( tokens: ( string | TokenItem )[] ) => void;\n\t/**\n\t * Function to call when the users types in the input field. It can be used to trigger autocomplete requests.\n\t *\n\t */\n\tonInputChange?: ( input: string ) => void;\n\t/**\n\t * Function to call when the TokenField has been focused on. The event is passed to the callback. Useful for analytics.\n\t *\n\t */\n\tonFocus?: ( event: FocusEvent ) => void;\n\t/**\n\t * When true, renders tokens as without a background.\n\t */\n\tisBorderless?: boolean;\n\t/**\n\t * If passed, `TokenField` will disable ability to add new tokens once number of tokens is greater than or equal to `maxLength`.\n\t */\n\tmaxLength?: number;\n\t/**\n\t * When true, tokens are not able to be added or removed.\n\t */\n\tdisabled?: boolean;\n\t/**\n\t * If passed, the `TokenField` input will show a placeholder string if no value tokens are present.\n\t */\n\tplaceholder?: string;\n\t/**\n\t * If true, will add a token when `TokenField` is focused and `space` is pressed.\n\t */\n\ttokenizeOnSpace?: boolean;\n\t/**\n\t * Allows customizing the messages presented by screen readers in different occasions:\n\t *\n\t * - `added`: The user added a new token.\n\t * - `removed`: The user removed an existing token.\n\t * - `remove` : The user focused the button to remove the token.\n\t * - `__experimentalInvalid`: The user tried to add a token that didn't pass the validation.\n\t */\n\tmessages?: Messages;\n\t/**\n\t * If true, the suggestions list will be always expanded when the input field has the focus.\n\t */\n\t__experimentalExpandOnFocus?: boolean;\n\t/**\n\t * If passed, all introduced values will be validated before being added as tokens.\n\t *\n\t * @default () => true\n\t */\n\t__experimentalValidateInput?: ( token: string ) => boolean;\n\t/**\n\t * If false, the text on how to use the select (ie: _Separate with commas or the Enter key._) will be hidden.\n\t *\n\t * @default true\n\t */\n\t__experimentalShowHowTo?: boolean;\n\t/**\n\t * Deprecated. Use `__next40pxDefaultSize` instead.\n\t *\n\t * @default false\n\t * @deprecated\n\t */\n\t__next36pxDefaultSize?: boolean;\n\t/**\n\t * Start opting into the larger default height that will become the\n\t * default size in a future version.\n\t *\n\t * @default false\n\t */\n\t__next40pxDefaultSize?: boolean;\n\t/**\n\t * If true, the select the first matching suggestion when the user presses\n\t * the Enter key (or space when tokenizeOnSpace is true).\n\t *\n\t * @default false\n\t */\n\t__experimentalAutoSelectFirstMatch?: boolean;\n\t/**\n\t * Custom renderer for suggestions.\n\t */\n\t__experimentalRenderItem?: ( args: { item: string } ) => ReactNode;\n\t/**\n\t * Start opting into the new margin-free styles that will become the default in a future version.\n\t *\n\t * @default false\n\t */\n\t__nextHasNoMarginBottom?: boolean;\n\t/**\n\t * If true, add any incompleteTokenValue as a new token when the field loses focus.\n\t *\n\t * @default false\n\t */\n\ttokenizeOnBlur?: boolean;\n}\n\n/**\n * `T` can be either a `string` or an object which must have a `value` prop as a string.\n */\nexport interface SuggestionsListProps<\n\tT = string | ( Record< string, unknown > & { value: string } ),\n> {\n\tselectedIndex: number;\n\tscrollIntoView: boolean;\n\tmatch: T;\n\tonHover: ( suggestion: T ) => void;\n\tonSelect: ( suggestion: T ) => void;\n\tsuggestions: T[];\n\tdisplayTransform: ( value: T ) => string;\n\tinstanceId: string | number;\n\t__experimentalRenderItem?: ( args: { item: T } ) => ReactNode;\n}\n\nexport interface TokenProps extends TokenItem {\n\tdisplayTransform: ( value: string ) => string;\n\tdisabled: boolean;\n\tonClickRemove: ( { value }: { value: string } ) => void;\n\tmessages: Messages;\n\ttermPosition: number;\n\ttermsCount: number;\n}\n\nexport interface TokenInputProps {\n\tisExpanded: boolean;\n\tinstanceId: string | number;\n\tselectedSuggestionIndex: number;\n\tonChange?: ( { value }: { value: string } ) => void;\n\tvalue: string;\n}\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["@wordpress/components/src/form-token-field/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type {\n\tComponentPropsWithRef,\n\tMouseEventHandler,\n\tReactNode,\n\tFocusEvent,\n} from 'react';\n\ntype Messages = {\n\t/**\n\t * The user added a new token.\n\t */\n\tadded: string;\n\t/**\n\t * The user removed an existing token.\n\t */\n\tremoved: string;\n\t/**\n\t * The user focused the button to remove the token.\n\t */\n\tremove: string;\n\t/**\n\t * The user tried to add a token that didn't pass the validation.\n\t */\n\t__experimentalInvalid: string;\n};\n\nexport interface TokenItem {\n\t/**\n\t * The value of the token.\n\t */\n\tvalue: string;\n\t/**\n\t * One of 'error', 'validating', or 'success'. Applies styles to token.\n\t */\n\tstatus?: 'error' | 'success' | 'validating';\n\t/**\n\t * If not falsey, will add a title to the token.\n\t */\n\ttitle?: string;\n\t/**\n\t * When true, renders tokens as without a background.\n\t */\n\tisBorderless?: boolean;\n\t/**\n\t * Function to call when onMouseEnter event triggered on token.\n\t */\n\tonMouseEnter?: MouseEventHandler< HTMLSpanElement >;\n\t/**\n\t * Function to call when onMouseLeave is triggered on token.\n\t */\n\tonMouseLeave?: MouseEventHandler< HTMLSpanElement >;\n}\n\nexport interface FormTokenFieldProps\n\textends Pick<\n\t\tComponentPropsWithRef< 'input' >,\n\t\t'autoCapitalize' | 'autoComplete' | 'className'\n\t> {\n\tlabel?: string;\n\t/**\n\t * An array of strings to present to the user as suggested tokens.\n\t */\n\tsuggestions?: string[];\n\t/**\n\t * The maximum number of suggestions to display at a time.\n\t *\n\t * @default 100\n\t */\n\tmaxSuggestions?: number;\n\t/**\n\t * An array of strings or objects to display as tokens in the field.\n\t * If objects are present in the array, they **must** have a property of `value`.\n\t */\n\tvalue?: ( string | TokenItem )[];\n\t/**\n\t * Function to call to transform tokens for display.\n\t * (In the editor, this is needed to decode HTML entities embedded in tags\n\t * - otherwise entities like `&` in tag names are double-encoded like `&amp;`,\n\t * once by the REST API and once by React).\n\t */\n\tdisplayTransform?: ( token: string ) => string;\n\t/**\n\t * Function to call to transform tokens for saving. The default is to trim the token value.\n\t * This function is also applied when matching suggestions against the current value\n\t * so that matching works correctly with leading or trailing spaces. (In the editor,\n\t * this is needed to remove leading and trailing spaces from tag names, like wp-admin does.\n\t * Otherwise the REST API won't save them.)\n\t *\n\t * @default ( token: string ) => token.trim()\n\t */\n\tsaveTransform?: ( token: string ) => string;\n\t/**\n\t * Function to call when the tokens have changed. An array of new tokens is passed to the callback.\n\t *\n\t */\n\tonChange?: ( tokens: ( string | TokenItem )[] ) => void;\n\t/**\n\t * Function to call when the users types in the input field. It can be used to trigger autocomplete requests.\n\t *\n\t */\n\tonInputChange?: ( input: string ) => void;\n\t/**\n\t * Function to call when the TokenField has been focused on. The event is passed to the callback. Useful for analytics.\n\t *\n\t */\n\tonFocus?: ( event: FocusEvent ) => void;\n\t/**\n\t * When true, renders tokens as without a background.\n\t */\n\tisBorderless?: boolean;\n\t/**\n\t * If passed, `TokenField` will disable ability to add new tokens once number of tokens is greater than or equal to `maxLength`.\n\t */\n\tmaxLength?: number;\n\t/**\n\t * When true, tokens are not able to be added or removed.\n\t */\n\tdisabled?: boolean;\n\t/**\n\t * If passed, the `TokenField` input will show a placeholder string if no value tokens are present.\n\t */\n\tplaceholder?: string;\n\t/**\n\t * If true, will add a token when `TokenField` is focused and `space` is pressed.\n\t */\n\ttokenizeOnSpace?: boolean;\n\t/**\n\t * Allows customizing the messages presented by screen readers in different occasions:\n\t *\n\t * - `added`: The user added a new token.\n\t * - `removed`: The user removed an existing token.\n\t * - `remove` : The user focused the button to remove the token.\n\t * - `__experimentalInvalid`: The user tried to add a token that didn't pass the validation.\n\t */\n\tmessages?: Messages;\n\t/**\n\t * If true, the suggestions list will be always expanded when the input field has the focus.\n\t */\n\t__experimentalExpandOnFocus?: boolean;\n\t/**\n\t * If passed, all introduced values will be validated before being added as tokens.\n\t *\n\t * @default () => true\n\t */\n\t__experimentalValidateInput?: ( token: string ) => boolean;\n\t/**\n\t * If false, the text on how to use the select (ie: _Separate with commas or the Enter key._) will be hidden.\n\t *\n\t * @default true\n\t */\n\t__experimentalShowHowTo?: boolean;\n\t/**\n\t * Deprecated. Use `__next40pxDefaultSize` instead.\n\t *\n\t * @default false\n\t * @deprecated\n\t */\n\t__next36pxDefaultSize?: boolean;\n\t/**\n\t * Start opting into the larger default height that will become the\n\t * default size in a future version.\n\t *\n\t * @default false\n\t */\n\t__next40pxDefaultSize?: boolean;\n\t/**\n\t * If true, the select the first matching suggestion when the user presses\n\t * the Enter key (or space when tokenizeOnSpace is true).\n\t *\n\t * @default false\n\t */\n\t__experimentalAutoSelectFirstMatch?: boolean;\n\t/**\n\t * Custom renderer for suggestions.\n\t */\n\t__experimentalRenderItem?: ( args: { item: string } ) => ReactNode;\n\t/**\n\t * Start opting into the new margin-free styles that will become the default in a future version.\n\t *\n\t * @default false\n\t */\n\t__nextHasNoMarginBottom?: boolean;\n\t/**\n\t * If true, add any incompleteTokenValue as a new token when the field loses focus.\n\t *\n\t * @default false\n\t */\n\ttokenizeOnBlur?: boolean;\n}\n\n/**\n * `T` can be either a `string` or an object which must have a `value` prop as a string.\n */\nexport interface SuggestionsListProps<\n\tT = string | ( Record< string, unknown > & { value: string } ),\n> {\n\tselectedIndex: number;\n\tscrollIntoView: boolean;\n\tmatch: T;\n\tonHover: ( suggestion: T ) => void;\n\tonSelect: ( suggestion: T ) => void;\n\tsuggestions: T[];\n\tdisplayTransform: ( value: T ) => string;\n\tinstanceId: string | number;\n\t__experimentalRenderItem?: ( args: { item: T } ) => ReactNode;\n}\n\nexport interface TokenProps extends TokenItem {\n\tdisplayTransform: ( value: string ) => string;\n\tdisabled: boolean;\n\tonClickRemove: ( { value }: { value: string } ) => void;\n\tmessages: Messages;\n\ttermPosition: number;\n\ttermsCount: number;\n}\n\nexport interface TokenInputProps {\n\tisExpanded: boolean;\n\tinstanceId: string | number;\n\tselectedSuggestionIndex: number;\n\tonChange?: ( { value }: { value: string } ) => void;\n\tvalue: string;\n}\n"],"mappings":""}
@@ -16,6 +16,9 @@ function useHeading(props) {
16
16
  const {
17
17
  as: asProp,
18
18
  level = 2,
19
+ color = _utils.COLORS.gray[900],
20
+ isBlock = true,
21
+ weight = _utils.CONFIG.fontWeightHeading,
19
22
  ...otherProps
20
23
  } = (0, _context.useContextSystem)(props, 'Heading');
21
24
  const as = asProp || `h${level}`;
@@ -26,10 +29,10 @@ function useHeading(props) {
26
29
  a11yProps['aria-level'] = typeof level === 'string' ? parseInt(level) : level;
27
30
  }
28
31
  const textProps = (0, _text.useText)({
29
- color: _utils.COLORS.gray[900],
32
+ color,
33
+ isBlock,
34
+ weight,
30
35
  size: (0, _fontSize.getHeadingFontSize)(level),
31
- isBlock: true,
32
- weight: _utils.CONFIG.fontWeightHeading,
33
36
  ...otherProps
34
37
  });
35
38
  return {
@@ -1 +1 @@
1
- {"version":3,"names":["_context","require","_text","_fontSize","_utils","useHeading","props","as","asProp","level","otherProps","useContextSystem","a11yProps","role","parseInt","textProps","useText","color","COLORS","gray","size","getHeadingFontSize","isBlock","weight","CONFIG","fontWeightHeading"],"sources":["@wordpress/components/src/heading/hook.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport { useContextSystem } from '../context';\nimport { useText } from '../text';\nimport { getHeadingFontSize } from '../utils/font-size';\nimport { CONFIG, COLORS } from '../utils';\nimport type { HeadingProps } from './types';\n\nexport function useHeading(\n\tprops: WordPressComponentProps< HeadingProps, 'h1' >\n) {\n\tconst {\n\t\tas: asProp,\n\t\tlevel = 2,\n\t\t...otherProps\n\t} = useContextSystem( props, 'Heading' );\n\n\tconst as = ( asProp || `h${ level }` ) as keyof JSX.IntrinsicElements;\n\n\tconst a11yProps: {\n\t\trole?: string;\n\t\t'aria-level'?: number;\n\t} = {};\n\tif ( typeof as === 'string' && as[ 0 ] !== 'h' ) {\n\t\t// If not a semantic `h` element, add a11y props:\n\t\ta11yProps.role = 'heading';\n\t\ta11yProps[ 'aria-level' ] =\n\t\t\ttypeof level === 'string' ? parseInt( level ) : level;\n\t}\n\n\tconst textProps = useText( {\n\t\tcolor: COLORS.gray[ 900 ],\n\t\tsize: getHeadingFontSize( level ),\n\t\tisBlock: true,\n\t\tweight: CONFIG.fontWeightHeading as import('react').CSSProperties[ 'fontWeight' ],\n\t\t...otherProps,\n\t} );\n\n\treturn { ...textProps, ...a11yProps, as };\n}\n"],"mappings":";;;;;;AAIA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAPA;AACA;AACA;;AAQO,SAASI,UAAUA,CACzBC,KAAoD,EACnD;EACD,MAAM;IACLC,EAAE,EAAEC,MAAM;IACVC,KAAK,GAAG,CAAC;IACT,GAAGC;EACJ,CAAC,GAAG,IAAAC,yBAAgB,EAAEL,KAAK,EAAE,SAAU,CAAC;EAExC,MAAMC,EAAE,GAAKC,MAAM,IAAK,IAAIC,KAAO,EAAkC;EAErE,MAAMG,SAGL,GAAG,CAAC,CAAC;EACN,IAAK,OAAOL,EAAE,KAAK,QAAQ,IAAIA,EAAE,CAAE,CAAC,CAAE,KAAK,GAAG,EAAG;IAChD;IACAK,SAAS,CAACC,IAAI,GAAG,SAAS;IAC1BD,SAAS,CAAE,YAAY,CAAE,GACxB,OAAOH,KAAK,KAAK,QAAQ,GAAGK,QAAQ,CAAEL,KAAM,CAAC,GAAGA,KAAK;EACvD;EAEA,MAAMM,SAAS,GAAG,IAAAC,aAAO,EAAE;IAC1BC,KAAK,EAAEC,aAAM,CAACC,IAAI,CAAE,GAAG,CAAE;IACzBC,IAAI,EAAE,IAAAC,4BAAkB,EAAEZ,KAAM,CAAC;IACjCa,OAAO,EAAE,IAAI;IACbC,MAAM,EAAEC,aAAM,CAACC,iBAAkE;IACjF,GAAGf;EACJ,CAAE,CAAC;EAEH,OAAO;IAAE,GAAGK,SAAS;IAAE,GAAGH,SAAS;IAAEL;EAAG,CAAC;AAC1C"}
1
+ {"version":3,"names":["_context","require","_text","_fontSize","_utils","useHeading","props","as","asProp","level","color","COLORS","gray","isBlock","weight","CONFIG","fontWeightHeading","otherProps","useContextSystem","a11yProps","role","parseInt","textProps","useText","size","getHeadingFontSize"],"sources":["@wordpress/components/src/heading/hook.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport { useContextSystem } from '../context';\nimport { useText } from '../text';\nimport { getHeadingFontSize } from '../utils/font-size';\nimport { CONFIG, COLORS } from '../utils';\nimport type { HeadingProps } from './types';\n\nexport function useHeading(\n\tprops: WordPressComponentProps< HeadingProps, 'h1' >\n) {\n\tconst {\n\t\tas: asProp,\n\t\tlevel = 2,\n\t\tcolor = COLORS.gray[ 900 ],\n\t\tisBlock = true,\n\t\tweight = CONFIG.fontWeightHeading as import('react').CSSProperties[ 'fontWeight' ],\n\t\t...otherProps\n\t} = useContextSystem( props, 'Heading' );\n\n\tconst as = ( asProp || `h${ level }` ) as keyof JSX.IntrinsicElements;\n\n\tconst a11yProps: {\n\t\trole?: string;\n\t\t'aria-level'?: number;\n\t} = {};\n\tif ( typeof as === 'string' && as[ 0 ] !== 'h' ) {\n\t\t// If not a semantic `h` element, add a11y props:\n\t\ta11yProps.role = 'heading';\n\t\ta11yProps[ 'aria-level' ] =\n\t\t\ttypeof level === 'string' ? parseInt( level ) : level;\n\t}\n\n\tconst textProps = useText( {\n\t\tcolor,\n\t\tisBlock,\n\t\tweight,\n\t\tsize: getHeadingFontSize( level ),\n\t\t...otherProps,\n\t} );\n\n\treturn { ...textProps, ...a11yProps, as };\n}\n"],"mappings":";;;;;;AAIA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAPA;AACA;AACA;;AAQO,SAASI,UAAUA,CACzBC,KAAoD,EACnD;EACD,MAAM;IACLC,EAAE,EAAEC,MAAM;IACVC,KAAK,GAAG,CAAC;IACTC,KAAK,GAAGC,aAAM,CAACC,IAAI,CAAE,GAAG,CAAE;IAC1BC,OAAO,GAAG,IAAI;IACdC,MAAM,GAAGC,aAAM,CAACC,iBAAkE;IAClF,GAAGC;EACJ,CAAC,GAAG,IAAAC,yBAAgB,EAAEZ,KAAK,EAAE,SAAU,CAAC;EAExC,MAAMC,EAAE,GAAKC,MAAM,IAAK,IAAIC,KAAO,EAAkC;EAErE,MAAMU,SAGL,GAAG,CAAC,CAAC;EACN,IAAK,OAAOZ,EAAE,KAAK,QAAQ,IAAIA,EAAE,CAAE,CAAC,CAAE,KAAK,GAAG,EAAG;IAChD;IACAY,SAAS,CAACC,IAAI,GAAG,SAAS;IAC1BD,SAAS,CAAE,YAAY,CAAE,GACxB,OAAOV,KAAK,KAAK,QAAQ,GAAGY,QAAQ,CAAEZ,KAAM,CAAC,GAAGA,KAAK;EACvD;EAEA,MAAMa,SAAS,GAAG,IAAAC,aAAO,EAAE;IAC1Bb,KAAK;IACLG,OAAO;IACPC,MAAM;IACNU,IAAI,EAAE,IAAAC,4BAAkB,EAAEhB,KAAM,CAAC;IACjC,GAAGQ;EACJ,CAAE,CAAC;EAEH,OAAO;IAAE,GAAGK,SAAS;IAAE,GAAGH,SAAS;IAAEZ;EAAG,CAAC;AAC1C"}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/components/src/heading/types.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type { Props as TextProps } from '../text/types';\n\nexport type HeadingSize =\n\t| 1\n\t| 2\n\t| 3\n\t| 4\n\t| 5\n\t| 6\n\t| '1'\n\t| '2'\n\t| '3'\n\t| '4'\n\t| '5'\n\t| '6';\n\nexport type HeadingProps = Omit< TextProps, 'size' > & {\n\t/**\n\t * Passing any of the heading levels to `level` will both render the correct\n\t * typographic text size as well as the semantic element corresponding to\n\t * the level (`h1` for `1` for example).\n\t *\n\t * @default 2\n\t */\n\tlevel?: HeadingSize;\n};\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["@wordpress/components/src/heading/types.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type { Props as TextProps } from '../text/types';\n\nexport type HeadingSize =\n\t| 1\n\t| 2\n\t| 3\n\t| 4\n\t| 5\n\t| 6\n\t| '1'\n\t| '2'\n\t| '3'\n\t| '4'\n\t| '5'\n\t| '6';\n\nexport type HeadingProps = Omit<\n\tTextProps,\n\t'size' | 'isBlock' | 'color' | 'weight'\n> & {\n\t/**\n\t * Passing any of the heading levels to `level` will both render the correct\n\t * typographic text size as well as the semantic element corresponding to\n\t * the level (`h1` for `1` for example).\n\t *\n\t * @default 2\n\t */\n\tlevel?: HeadingSize;\n\t/**\n\t * Sets `Heading` to have `display: block`. Note: text truncation only works\n\t * when `isBlock` is `false`.\n\t *\n\t * @default true\n\t */\n\tisBlock?: TextProps[ 'isBlock' ];\n\t/**\n\t * Adjusts the text color.\n\t *\n\t * @default '#1e1e1e'\n\t */\n\tcolor?: TextProps[ 'color' ];\n\t/**\n\t * Adjusts font-weight of the text.\n\t *\n\t * @default '600'\n\t */\n\tweight?: TextProps[ 'weight' ];\n};\n"],"mappings":""}
@@ -95,11 +95,9 @@ var _exportNames = {
95
95
  LinkSettings: true,
96
96
  LinkSettingsScreen: true,
97
97
  LinkSettingsNavigation: true,
98
- ImageLinkDestinationsScreen: true,
99
98
  Image: true,
100
99
  IMAGE_DEFAULT_FOCAL_POINT: true,
101
100
  ImageEditingButton: true,
102
- InserterButton: true,
103
101
  setClipboard: true,
104
102
  getClipboard: true,
105
103
  AudioPlayer: true,
@@ -385,18 +383,6 @@ Object.defineProperty(exports, "ImageEditingButton", {
385
383
  return _imageEditingButton.default;
386
384
  }
387
385
  });
388
- Object.defineProperty(exports, "ImageLinkDestinationsScreen", {
389
- enumerable: true,
390
- get: function () {
391
- return _imageLinkDestinationsScreen.default;
392
- }
393
- });
394
- Object.defineProperty(exports, "InserterButton", {
395
- enumerable: true,
396
- get: function () {
397
- return _inserterButton.default;
398
- }
399
- });
400
386
  Object.defineProperty(exports, "KeyboardAvoidingView", {
401
387
  enumerable: true,
402
388
  get: function () {
@@ -890,10 +876,8 @@ var _linkPickerScreen = _interopRequireDefault(require("./mobile/link-picker/lin
890
876
  var _linkSettings = _interopRequireDefault(require("./mobile/link-settings"));
891
877
  var _linkSettingsScreen = _interopRequireDefault(require("./mobile/link-settings/link-settings-screen"));
892
878
  var _linkSettingsNavigation = _interopRequireDefault(require("./mobile/link-settings/link-settings-navigation"));
893
- var _imageLinkDestinationsScreen = _interopRequireDefault(require("./mobile/link-settings/image-link-destinations-screen"));
894
879
  var _image = _interopRequireWildcard(require("./mobile/image"));
895
880
  var _imageEditingButton = _interopRequireDefault(require("./mobile/image/image-editing-button"));
896
- var _inserterButton = _interopRequireDefault(require("./mobile/inserter-button"));
897
881
  var _clipboard = require("./mobile/clipboard");
898
882
  var _audioPlayer = _interopRequireDefault(require("./mobile/audio-player"));
899
883
  var _badge = _interopRequireDefault(require("./mobile/badge"));
@@ -1 +1 @@
1
- {"version":3,"names":["_primitives","require","_colorIndicator","_interopRequireDefault","_colorPalette","_colorPicker","_dashicon","_dropdown","_dropdownMenu","_focalPointPicker","_toolbar","_tooltip","_icon","_spinner","_slotFill","_styleProvider","_baseControl","_utils","_textareaControl","_body","_actions","_button","_text","_interopRequireWildcard","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_externalLink","_textControl","_toggleControl","_sandbox","_searchControl","_selectControl","_rangeControl","_resizableBox","_footerMessageControl","_colorControl","_queryControls","_notice","_list","_radioControl","_unitControl","_utils2","_disabled","_draggable","_withConstrainedTabbing","_withFallbackStyles","_withFilters","_fontSizePicker","_withFocusOutside","_withFocusReturn","_withNotices","_withSpokenMessages","_autocompletionItems","_autocomplete","_bottomSheet","_bottomSheetContext","_bottomSheetSelectControl","_htmlTextInput","_keyboardAvoidingView","_keyboardAwareFlatList","_picker","_cycleSelectControl","_gradient","_colorSettings","_segmentedControl","_focalPointSettingsPanel","_bottomSheetTextControl","_footerMessageLink","_linkPicker","_linkPickerScreen","_linkSettings","_linkSettingsScreen","_linkSettingsNavigation","_imageLinkDestinationsScreen","_image","_imageEditingButton","_inserterButton","_clipboard","_audioPlayer","_badge","_gridicons","_utils3","_alignments","_useUnitConverterToMobile","_globalStylesContext","_utils4","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","newObj","hasPropertyDescriptor","getOwnPropertyDescriptor","desc","set"],"sources":["@wordpress/components/src/index.native.js"],"sourcesContent":["export {\n\tSVG,\n\tPath,\n\tCircle,\n\tPolygon,\n\tRect,\n\tG,\n\tHorizontalRule,\n\tBlockQuotation,\n} from '@wordpress/primitives';\nexport { default as ColorIndicator } from './color-indicator';\nexport { default as ColorPalette } from './color-palette';\nexport { ColorPicker } from './color-picker';\nexport { default as Dashicon } from './dashicon';\nexport { default as Dropdown } from './dropdown';\nexport { default as DropdownMenu } from './dropdown-menu';\nexport { default as FocalPointPicker } from './focal-point-picker';\nexport {\n\tToolbar,\n\tToolbarButton,\n\tToolbarContext as __experimentalToolbarContext,\n\tToolbarDropdownMenu,\n\tToolbarGroup,\n\tToolbarItem,\n} from './toolbar';\nexport { default as Tooltip } from './tooltip';\nexport { default as Icon } from './icon';\nexport { default as Spinner } from './spinner';\nexport {\n\tcreateSlotFill,\n\tSlot,\n\tFill,\n\tProvider as SlotFillProvider,\n} from './slot-fill';\n\nexport { default as __experimentalStyleProvider } from './style-provider';\nexport { default as BaseControl } from './base-control';\nexport { hasSplitBorders as __experimentalHasSplitBorders } from './border-box-control/utils';\nexport { default as TextareaControl } from './textarea-control';\nexport { default as PanelBody } from './panel/body';\nexport { default as PanelActions } from './panel/actions';\nexport { default as Button } from './button';\nexport { default as __experimentalText } from './text';\nexport { default as ExternalLink } from './external-link';\nexport { default as TextControl } from './text-control';\nexport { default as ToggleControl } from './toggle-control';\nexport { default as SandBox } from './sandbox';\nexport { default as SearchControl } from './search-control';\nexport { default as SelectControl } from './select-control';\nexport { default as RangeControl } from './range-control';\nexport { default as ResizableBox } from './resizable-box';\nexport { default as FooterMessageControl } from './footer-message-control';\nexport { default as ColorControl } from './color-control';\nexport { default as QueryControls } from './query-controls';\nexport { default as Notice } from './notice';\nexport { default as NoticeList } from './notice/list';\nexport { default as RadioControl } from './radio-control';\nexport {\n\tdefault as UnitControl,\n\tuseCustomUnits as __experimentalUseCustomUnits,\n} from './unit-control';\nexport {\n\tCSS_UNITS as CSS_UNITS,\n\tfilterUnitsWithSettings as filterUnitsWithSettings,\n} from './unit-control/utils';\nexport { default as Disabled } from './disabled';\nexport { default as Draggable, DraggableTrigger } from './draggable';\n\n// Higher-Order Components.\nexport { default as withConstrainedTabbing } from './higher-order/with-constrained-tabbing';\nexport { default as withFallbackStyles } from './higher-order/with-fallback-styles';\nexport { default as withFilters } from './higher-order/with-filters';\nexport { default as FontSizePicker } from './font-size-picker'; // Intentionally called after slot-fill and withFilters.\nexport { default as withFocusOutside } from './higher-order/with-focus-outside';\nexport { default as withFocusReturn } from './higher-order/with-focus-return';\nexport { default as withNotices } from './higher-order/with-notices';\nexport { default as withSpokenMessages } from './higher-order/with-spoken-messages';\nexport * from './text';\n\n// Mobile Components.\nexport {\n\t__unstableAutocompletionItemsFill,\n\t__unstableAutocompletionItemsSlot,\n} from './mobile/autocompletion-items';\nexport { default as Autocomplete } from './autocomplete';\nexport { default as BottomSheet } from './mobile/bottom-sheet';\nexport {\n\tBottomSheetConsumer,\n\tBottomSheetProvider,\n\tBottomSheetContext,\n} from './mobile/bottom-sheet/bottom-sheet-context';\nexport { default as BottomSheetSelectControl } from './mobile/bottom-sheet-select-control';\nexport { default as HTMLTextInput } from './mobile/html-text-input';\nexport { default as KeyboardAvoidingView } from './mobile/keyboard-avoiding-view';\nexport { default as KeyboardAwareFlatList } from './mobile/keyboard-aware-flat-list';\nexport { default as Picker } from './mobile/picker';\nexport { default as CycleSelectControl } from './mobile/cycle-select-control';\nexport { default as Gradient } from './mobile/gradient';\nexport { default as ColorSettings } from './mobile/color-settings';\nexport { default as SegmentedControls } from './mobile/segmented-control';\nexport { default as FocalPointSettingsPanel } from './mobile/focal-point-settings-panel';\nexport { default as BottomSheetTextControl } from './mobile/bottom-sheet-text-control';\nexport { default as FooterMessageLink } from './mobile/bottom-sheet/footer-message-link/footer-message-link';\nexport { LinkPicker } from './mobile/link-picker';\nexport { default as LinkPickerScreen } from './mobile/link-picker/link-picker-screen';\nexport { default as LinkSettings } from './mobile/link-settings';\nexport { default as LinkSettingsScreen } from './mobile/link-settings/link-settings-screen';\nexport { default as LinkSettingsNavigation } from './mobile/link-settings/link-settings-navigation';\nexport { default as ImageLinkDestinationsScreen } from './mobile/link-settings/image-link-destinations-screen';\nexport { default as SegmentedControl } from './mobile/segmented-control';\nexport { default as Image, IMAGE_DEFAULT_FOCAL_POINT } from './mobile/image';\nexport { default as ImageEditingButton } from './mobile/image/image-editing-button';\nexport { default as InserterButton } from './mobile/inserter-button';\nexport { setClipboard, getClipboard } from './mobile/clipboard';\nexport { default as AudioPlayer } from './mobile/audio-player';\nexport { default as Badge } from './mobile/badge';\nexport { default as Gridicons } from './mobile/gridicons';\n\n// Utils.\nexport { colorsUtils } from './mobile/color-settings/utils';\nexport {\n\tWIDE_ALIGNMENTS,\n\tALIGNMENT_BREAKPOINTS,\n\talignmentHelpers,\n} from './mobile/utils/alignments';\n\n// Hooks.\nexport {\n\tconvertUnitToMobile,\n\tuseConvertUnitToMobile,\n\tgetValueAndUnit,\n} from './mobile/utils/use-unit-converter-to-mobile';\n\nexport {\n\tdefault as GlobalStylesContext,\n\tuseGlobalStyles,\n\twithGlobalStyles,\n\tgetMergedGlobalStyles,\n} from './mobile/global-styles-context';\nexport {\n\tgetGlobalStyles,\n\tgetColorsAndGradients,\n\tuseMobileGlobalStylesColors,\n\tuseEditorColorScheme,\n} from './mobile/global-styles-context/utils';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAArE,GAAA,CAAAkE,GAAA,SAAAK,MAAA,WAAAC,qBAAA,GAAAnF,MAAA,CAAAS,cAAA,IAAAT,MAAA,CAAAoF,wBAAA,WAAAjF,GAAA,IAAA0E,GAAA,QAAA1E,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAuE,GAAA,EAAA1E,GAAA,SAAAkF,IAAA,GAAAF,qBAAA,GAAAnF,MAAA,CAAAoF,wBAAA,CAAAP,GAAA,EAAA1E,GAAA,cAAAkF,IAAA,KAAAA,IAAA,CAAA1E,GAAA,IAAA0E,IAAA,CAAAC,GAAA,KAAAtF,MAAA,CAAAS,cAAA,CAAAyE,MAAA,EAAA/E,GAAA,EAAAkF,IAAA,YAAAH,MAAA,CAAA/E,GAAA,IAAA0E,GAAA,CAAA1E,GAAA,SAAA+E,MAAA,CAAAH,OAAA,GAAAF,GAAA,MAAAG,KAAA,IAAAA,KAAA,CAAAM,GAAA,CAAAT,GAAA,EAAAK,MAAA,YAAAA,MAAA"}
1
+ {"version":3,"names":["_primitives","require","_colorIndicator","_interopRequireDefault","_colorPalette","_colorPicker","_dashicon","_dropdown","_dropdownMenu","_focalPointPicker","_toolbar","_tooltip","_icon","_spinner","_slotFill","_styleProvider","_baseControl","_utils","_textareaControl","_body","_actions","_button","_text","_interopRequireWildcard","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_externalLink","_textControl","_toggleControl","_sandbox","_searchControl","_selectControl","_rangeControl","_resizableBox","_footerMessageControl","_colorControl","_queryControls","_notice","_list","_radioControl","_unitControl","_utils2","_disabled","_draggable","_withConstrainedTabbing","_withFallbackStyles","_withFilters","_fontSizePicker","_withFocusOutside","_withFocusReturn","_withNotices","_withSpokenMessages","_autocompletionItems","_autocomplete","_bottomSheet","_bottomSheetContext","_bottomSheetSelectControl","_htmlTextInput","_keyboardAvoidingView","_keyboardAwareFlatList","_picker","_cycleSelectControl","_gradient","_colorSettings","_segmentedControl","_focalPointSettingsPanel","_bottomSheetTextControl","_footerMessageLink","_linkPicker","_linkPickerScreen","_linkSettings","_linkSettingsScreen","_linkSettingsNavigation","_image","_imageEditingButton","_clipboard","_audioPlayer","_badge","_gridicons","_utils3","_alignments","_useUnitConverterToMobile","_globalStylesContext","_utils4","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","newObj","hasPropertyDescriptor","getOwnPropertyDescriptor","desc","set"],"sources":["@wordpress/components/src/index.native.js"],"sourcesContent":["export {\n\tSVG,\n\tPath,\n\tCircle,\n\tPolygon,\n\tRect,\n\tG,\n\tHorizontalRule,\n\tBlockQuotation,\n} from '@wordpress/primitives';\nexport { default as ColorIndicator } from './color-indicator';\nexport { default as ColorPalette } from './color-palette';\nexport { ColorPicker } from './color-picker';\nexport { default as Dashicon } from './dashicon';\nexport { default as Dropdown } from './dropdown';\nexport { default as DropdownMenu } from './dropdown-menu';\nexport { default as FocalPointPicker } from './focal-point-picker';\nexport {\n\tToolbar,\n\tToolbarButton,\n\tToolbarContext as __experimentalToolbarContext,\n\tToolbarDropdownMenu,\n\tToolbarGroup,\n\tToolbarItem,\n} from './toolbar';\nexport { default as Tooltip } from './tooltip';\nexport { default as Icon } from './icon';\nexport { default as Spinner } from './spinner';\nexport {\n\tcreateSlotFill,\n\tSlot,\n\tFill,\n\tProvider as SlotFillProvider,\n} from './slot-fill';\n\nexport { default as __experimentalStyleProvider } from './style-provider';\nexport { default as BaseControl } from './base-control';\nexport { hasSplitBorders as __experimentalHasSplitBorders } from './border-box-control/utils';\nexport { default as TextareaControl } from './textarea-control';\nexport { default as PanelBody } from './panel/body';\nexport { default as PanelActions } from './panel/actions';\nexport { default as Button } from './button';\nexport { default as __experimentalText } from './text';\nexport { default as ExternalLink } from './external-link';\nexport { default as TextControl } from './text-control';\nexport { default as ToggleControl } from './toggle-control';\nexport { default as SandBox } from './sandbox';\nexport { default as SearchControl } from './search-control';\nexport { default as SelectControl } from './select-control';\nexport { default as RangeControl } from './range-control';\nexport { default as ResizableBox } from './resizable-box';\nexport { default as FooterMessageControl } from './footer-message-control';\nexport { default as ColorControl } from './color-control';\nexport { default as QueryControls } from './query-controls';\nexport { default as Notice } from './notice';\nexport { default as NoticeList } from './notice/list';\nexport { default as RadioControl } from './radio-control';\nexport {\n\tdefault as UnitControl,\n\tuseCustomUnits as __experimentalUseCustomUnits,\n} from './unit-control';\nexport {\n\tCSS_UNITS as CSS_UNITS,\n\tfilterUnitsWithSettings as filterUnitsWithSettings,\n} from './unit-control/utils';\nexport { default as Disabled } from './disabled';\nexport { default as Draggable, DraggableTrigger } from './draggable';\n\n// Higher-Order Components.\nexport { default as withConstrainedTabbing } from './higher-order/with-constrained-tabbing';\nexport { default as withFallbackStyles } from './higher-order/with-fallback-styles';\nexport { default as withFilters } from './higher-order/with-filters';\nexport { default as FontSizePicker } from './font-size-picker'; // Intentionally called after slot-fill and withFilters.\nexport { default as withFocusOutside } from './higher-order/with-focus-outside';\nexport { default as withFocusReturn } from './higher-order/with-focus-return';\nexport { default as withNotices } from './higher-order/with-notices';\nexport { default as withSpokenMessages } from './higher-order/with-spoken-messages';\nexport * from './text';\n\n// Mobile Components.\nexport {\n\t__unstableAutocompletionItemsFill,\n\t__unstableAutocompletionItemsSlot,\n} from './mobile/autocompletion-items';\nexport { default as Autocomplete } from './autocomplete';\nexport { default as BottomSheet } from './mobile/bottom-sheet';\nexport {\n\tBottomSheetConsumer,\n\tBottomSheetProvider,\n\tBottomSheetContext,\n} from './mobile/bottom-sheet/bottom-sheet-context';\nexport { default as BottomSheetSelectControl } from './mobile/bottom-sheet-select-control';\nexport { default as HTMLTextInput } from './mobile/html-text-input';\nexport { default as KeyboardAvoidingView } from './mobile/keyboard-avoiding-view';\nexport { default as KeyboardAwareFlatList } from './mobile/keyboard-aware-flat-list';\nexport { default as Picker } from './mobile/picker';\nexport { default as CycleSelectControl } from './mobile/cycle-select-control';\nexport { default as Gradient } from './mobile/gradient';\nexport { default as ColorSettings } from './mobile/color-settings';\nexport { default as SegmentedControls } from './mobile/segmented-control';\nexport { default as FocalPointSettingsPanel } from './mobile/focal-point-settings-panel';\nexport { default as BottomSheetTextControl } from './mobile/bottom-sheet-text-control';\nexport { default as FooterMessageLink } from './mobile/bottom-sheet/footer-message-link/footer-message-link';\nexport { LinkPicker } from './mobile/link-picker';\nexport { default as LinkPickerScreen } from './mobile/link-picker/link-picker-screen';\nexport { default as LinkSettings } from './mobile/link-settings';\nexport { default as LinkSettingsScreen } from './mobile/link-settings/link-settings-screen';\nexport { default as LinkSettingsNavigation } from './mobile/link-settings/link-settings-navigation';\nexport { default as SegmentedControl } from './mobile/segmented-control';\nexport { default as Image, IMAGE_DEFAULT_FOCAL_POINT } from './mobile/image';\nexport { default as ImageEditingButton } from './mobile/image/image-editing-button';\nexport { setClipboard, getClipboard } from './mobile/clipboard';\nexport { default as AudioPlayer } from './mobile/audio-player';\nexport { default as Badge } from './mobile/badge';\nexport { default as Gridicons } from './mobile/gridicons';\n\n// Utils.\nexport { colorsUtils } from './mobile/color-settings/utils';\nexport {\n\tWIDE_ALIGNMENTS,\n\tALIGNMENT_BREAKPOINTS,\n\talignmentHelpers,\n} from './mobile/utils/alignments';\n\n// Hooks.\nexport {\n\tconvertUnitToMobile,\n\tuseConvertUnitToMobile,\n\tgetValueAndUnit,\n} from './mobile/utils/use-unit-converter-to-mobile';\n\nexport {\n\tdefault as GlobalStylesContext,\n\tuseGlobalStyles,\n\twithGlobalStyles,\n\tgetMergedGlobalStyles,\n} from './mobile/global-styles-context';\nexport {\n\tgetGlobalStyles,\n\tgetColorsAndGradients,\n\tuseMobileGlobalStylesColors,\n\tuseEditorColorScheme,\n} from './mobile/global-styles-context/utils';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAxE,wBAAA4E,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAnE,GAAA,CAAAgE,GAAA,SAAAK,MAAA,WAAAC,qBAAA,GAAAjF,MAAA,CAAAS,cAAA,IAAAT,MAAA,CAAAkF,wBAAA,WAAA/E,GAAA,IAAAwE,GAAA,QAAAxE,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAqE,GAAA,EAAAxE,GAAA,SAAAgF,IAAA,GAAAF,qBAAA,GAAAjF,MAAA,CAAAkF,wBAAA,CAAAP,GAAA,EAAAxE,GAAA,cAAAgF,IAAA,KAAAA,IAAA,CAAAxE,GAAA,IAAAwE,IAAA,CAAAC,GAAA,KAAApF,MAAA,CAAAS,cAAA,CAAAuE,MAAA,EAAA7E,GAAA,EAAAgF,IAAA,YAAAH,MAAA,CAAA7E,GAAA,IAAAwE,GAAA,CAAAxE,GAAA,SAAA6E,MAAA,CAAAH,OAAA,GAAAF,GAAA,MAAAG,KAAA,IAAAA,KAAA,CAAAM,GAAA,CAAAT,GAAA,EAAAK,MAAA,YAAAA,MAAA"}
@@ -203,6 +203,19 @@ function parseStylesVariables(styles, mappedValues, customValues) {
203
203
  const customValuesData = customValues !== null && customValues !== void 0 ? customValues : JSON.parse(stylesBase);
204
204
  stylesBase = stylesBase.replace(regex, (_$1, $2) => {
205
205
  const path = $2.split('--');
206
+
207
+ // Supports cases for variables like var(--wp--custom--color--background)
208
+ if (path[0] === 'color') {
209
+ const colorKey = path[path.length - 1];
210
+ if (mappedValues?.color) {
211
+ const matchedValue = mappedValues.color?.values?.find(({
212
+ slug
213
+ }) => slug === colorKey);
214
+ if (matchedValue) {
215
+ return `${matchedValue?.color}`;
216
+ }
217
+ }
218
+ }
206
219
  if (path.reduce((prev, curr) => prev && prev[curr], customValuesData)) {
207
220
  return getValueFromObjectPath(customValuesData, path);
208
221
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_changeCase","require","_reactNative","_colord","_blockEditor","_compose","_index","BLOCK_STYLE_ATTRIBUTES","exports","BLOCK_STYLE_ATTRIBUTES_MAPPING","textColor","text","background","link","placeholder","PADDING","UNKNOWN_VALUE","DEFAULT_FONT_SIZE","getBlockPaddings","mergedStyle","wrapperPropsStyle","blockStyleAttributes","blockColors","blockPaddings","padding","backgroundColor","undefined","getBlockColors","defaultColors","blockName","baseGlobalStyles","blockStyles","customBlockStyles","style","color","blockGlobalStyles","blocks","Object","entries","forEach","key","value","styleKey","_customBlockStyles$ke","styles","elements","linkColor","isCustomColor","startsWith","mappedColor","values","find","slug","getBlockTypography","fontSizes","typographyStyles","typography","parsedFontSizes","fontSize","lineHeight","parseInt","mappedFontSize","size","getValueFromObjectPath","object","path","fieldName","parseStylesVariables","mappedValues","customValues","stylesBase","variables","variable","regex","RegExp","varRegex","fontSizeRegex","replace","_$1","$2","split","mappedPresetValue","_mappedPresetValue$va","matchedValue","customValuesData","JSON","parse","reduce","prev","curr","slice","length","camelCase","width","height","Dimensions","get","parsedFontSize","getPxFromCssUnit","getMappedValues","features","palette","colors","theme","custom","default","normalizeFontSizes","normalizedFontSizes","dimensions","map","fontSizeObject","sizePx","useMobileGlobalStylesColors","type","colorGradientSettings","useMultipleOriginColorsAndGradients","availableThemeColors","origin","concat","defaultPaletteSetting","defaultPaletteValue","useSettings","defaultPalette","SETTINGS_DEFAULTS","getColorsAndGradients","defaultEditorColors","defaultEditorGradients","rawFeatures","__experimentalGlobalStylesBaseStyles","__experimentalFeatures","gradients","defaultGradients","getGlobalStyles","rawStyles","_features$color$text","_features$color$backg","_features$color$defau","_features$color$defau2","stringify","globalStyles","customLineHeight","spacing","useEditorColorScheme","baseStyle","darkStyle","useGlobalStyles","deviceColorScheme","usePreferredColorSchemeStyle","editorColors","baseColors","editorBackgroundColor","isBackgroundColorDefined","isEditorBackgroundDark","colord","isDark"],"sources":["@wordpress/components/src/mobile/global-styles-context/utils.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { camelCase } from 'change-case';\nimport { Dimensions } from 'react-native';\nimport { colord } from 'colord';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tgetPxFromCssUnit,\n\tuseSettings,\n\tuseMultipleOriginColorsAndGradients,\n\tSETTINGS_DEFAULTS,\n} from '@wordpress/block-editor';\nimport { usePreferredColorSchemeStyle } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { useGlobalStyles } from './index.native';\n\nexport const BLOCK_STYLE_ATTRIBUTES = [\n\t'textColor',\n\t'backgroundColor',\n\t'style',\n\t'color',\n\t'fontSize',\n];\n\n// Mapping style properties name to native.\nconst BLOCK_STYLE_ATTRIBUTES_MAPPING = {\n\ttextColor: 'color',\n\ttext: 'color',\n\tbackground: 'backgroundColor',\n\tlink: 'linkColor',\n\tplaceholder: 'placeholderColor',\n};\n\nconst PADDING = 12; // $solid-border-space\nconst UNKNOWN_VALUE = 'undefined';\nconst DEFAULT_FONT_SIZE = 16;\n\nexport function getBlockPaddings(\n\tmergedStyle,\n\twrapperPropsStyle,\n\tblockStyleAttributes,\n\tblockColors\n) {\n\tconst blockPaddings = {};\n\n\tif (\n\t\t! mergedStyle.padding &&\n\t\t( wrapperPropsStyle?.backgroundColor ||\n\t\t\tblockStyleAttributes?.backgroundColor ||\n\t\t\tblockColors?.backgroundColor )\n\t) {\n\t\tblockPaddings.padding = PADDING;\n\t\treturn blockPaddings;\n\t}\n\n\t// Prevent adding extra paddings to inner blocks without background colors.\n\tif (\n\t\tmergedStyle?.padding &&\n\t\t! wrapperPropsStyle?.backgroundColor &&\n\t\t! blockStyleAttributes?.backgroundColor &&\n\t\t! blockColors?.backgroundColor\n\t) {\n\t\tblockPaddings.padding = undefined;\n\t}\n\n\treturn blockPaddings;\n}\n\nexport function getBlockColors(\n\tblockStyleAttributes,\n\tdefaultColors,\n\tblockName,\n\tbaseGlobalStyles\n) {\n\tconst blockStyles = {};\n\tconst customBlockStyles = blockStyleAttributes?.style?.color || {};\n\tconst blockGlobalStyles = baseGlobalStyles?.blocks?.[ blockName ];\n\n\t// Global styles colors.\n\tif ( blockGlobalStyles?.color ) {\n\t\tObject.entries( blockGlobalStyles.color ).forEach(\n\t\t\t( [ key, value ] ) => {\n\t\t\t\tconst styleKey = BLOCK_STYLE_ATTRIBUTES_MAPPING[ key ];\n\n\t\t\t\tif ( styleKey && value !== UNKNOWN_VALUE ) {\n\t\t\t\t\tconst color = customBlockStyles[ key ] ?? value;\n\t\t\t\t\tblockStyles[ styleKey ] = color;\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t} else if ( baseGlobalStyles?.styles?.color?.text ) {\n\t\tblockStyles[ BLOCK_STYLE_ATTRIBUTES_MAPPING.text ] =\n\t\t\tbaseGlobalStyles?.styles?.color?.text;\n\t}\n\n\t// Global styles elements.\n\tif ( blockGlobalStyles?.elements ) {\n\t\tconst linkColor = blockGlobalStyles.elements?.link?.color?.text;\n\t\tconst styleKey = BLOCK_STYLE_ATTRIBUTES_MAPPING.link;\n\n\t\tif ( styleKey && linkColor && linkColor !== UNKNOWN_VALUE ) {\n\t\t\tblockStyles[ styleKey ] = linkColor;\n\t\t}\n\t}\n\n\t// Custom colors.\n\tObject.entries( blockStyleAttributes ).forEach( ( [ key, value ] ) => {\n\t\tconst isCustomColor = value?.startsWith?.( '#' );\n\t\tlet styleKey = key;\n\n\t\tif ( BLOCK_STYLE_ATTRIBUTES_MAPPING[ styleKey ] ) {\n\t\t\tstyleKey = BLOCK_STYLE_ATTRIBUTES_MAPPING[ styleKey ];\n\t\t}\n\n\t\tif ( ! isCustomColor ) {\n\t\t\tconst mappedColor = Object.values( defaultColors ?? {} ).find(\n\t\t\t\t( { slug } ) => slug === value\n\t\t\t);\n\n\t\t\tif ( mappedColor ) {\n\t\t\t\tblockStyles[ styleKey ] = mappedColor.color;\n\t\t\t}\n\t\t} else {\n\t\t\tblockStyles[ styleKey ] = value;\n\t\t}\n\t} );\n\n\t// Color placeholder.\n\tif ( blockStyles?.color ) {\n\t\tblockStyles[ BLOCK_STYLE_ATTRIBUTES_MAPPING.placeholder ] =\n\t\t\tblockStyles.color;\n\t}\n\n\treturn blockStyles;\n}\n\nexport function getBlockTypography(\n\tblockStyleAttributes,\n\tfontSizes,\n\tblockName,\n\tbaseGlobalStyles\n) {\n\tconst typographyStyles = {};\n\tconst customBlockStyles = blockStyleAttributes?.style?.typography || {};\n\tconst blockGlobalStyles = baseGlobalStyles?.blocks?.[ blockName ];\n\tconst parsedFontSizes = Object.values( fontSizes ?? {} );\n\n\t// Global styles.\n\tif ( blockGlobalStyles?.typography ) {\n\t\tconst fontSize = blockGlobalStyles?.typography?.fontSize;\n\t\tconst lineHeight = blockGlobalStyles?.typography?.lineHeight;\n\n\t\tif ( fontSize ) {\n\t\t\tif ( parseInt( fontSize, 10 ) ) {\n\t\t\t\ttypographyStyles.fontSize = fontSize;\n\t\t\t} else {\n\t\t\t\tconst mappedFontSize = parsedFontSizes.find(\n\t\t\t\t\t( { slug } ) => slug === fontSize\n\t\t\t\t);\n\n\t\t\t\tif ( mappedFontSize ) {\n\t\t\t\t\ttypographyStyles.fontSize = mappedFontSize?.size;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( lineHeight ) {\n\t\t\ttypographyStyles.lineHeight = lineHeight;\n\t\t}\n\t}\n\n\tif ( blockStyleAttributes?.fontSize && baseGlobalStyles ) {\n\t\tconst mappedFontSize = parsedFontSizes.find(\n\t\t\t( { slug } ) => slug === blockStyleAttributes?.fontSize\n\t\t);\n\n\t\tif ( mappedFontSize ) {\n\t\t\ttypographyStyles.fontSize = mappedFontSize?.size;\n\t\t}\n\t}\n\n\t// Custom styles.\n\tif ( customBlockStyles?.fontSize ) {\n\t\ttypographyStyles.fontSize = customBlockStyles?.fontSize;\n\t}\n\n\tif ( customBlockStyles?.lineHeight ) {\n\t\ttypographyStyles.lineHeight = customBlockStyles?.lineHeight;\n\t}\n\n\treturn typographyStyles;\n}\n\n/**\n * Return a value from a certain path of the object.\n * Path is specified as an array of properties, like: [ 'parent', 'child' ].\n *\n * @param {Object} object Input object.\n * @param {Array} path Path to the object property.\n * @return {*} Value of the object property at the specified path.\n */\nconst getValueFromObjectPath = ( object, path ) => {\n\tlet value = object;\n\tpath.forEach( ( fieldName ) => {\n\t\tvalue = value?.[ fieldName ];\n\t} );\n\treturn value;\n};\n\nexport function parseStylesVariables( styles, mappedValues, customValues ) {\n\tlet stylesBase = styles;\n\tconst variables = [ 'preset', 'custom', 'var', 'fontSize' ];\n\n\tif ( ! stylesBase ) {\n\t\treturn styles;\n\t}\n\n\tvariables.forEach( ( variable ) => {\n\t\t// Examples\n\t\t// var(--wp--preset--color--gray)\n\t\t// var(--wp--custom--body--typography--font-family)\n\t\t// var:preset|color|custom-color-2\n\t\tconst regex = new RegExp( `var\\\\(--wp--${ variable }--(.*?)\\\\)`, 'g' );\n\t\tconst varRegex = /\\\"var:preset\\|color\\|(.*?)\\\"/gm;\n\t\tconst fontSizeRegex = /\"fontSize\":\"(.*?)\"/gm;\n\n\t\tif ( variable === 'preset' ) {\n\t\t\tstylesBase = stylesBase.replace( regex, ( _$1, $2 ) => {\n\t\t\t\tconst path = $2.split( '--' );\n\t\t\t\tconst mappedPresetValue = mappedValues[ path[ 0 ] ];\n\t\t\t\tif ( mappedPresetValue && mappedPresetValue.slug ) {\n\t\t\t\t\tconst matchedValue = Object.values(\n\t\t\t\t\t\tmappedPresetValue.values ?? {}\n\t\t\t\t\t).find( ( { slug } ) => slug === path[ 1 ] );\n\t\t\t\t\treturn matchedValue?.[ mappedPresetValue.slug ];\n\t\t\t\t}\n\t\t\t\treturn UNKNOWN_VALUE;\n\t\t\t} );\n\t\t}\n\t\tif ( variable === 'custom' ) {\n\t\t\tconst customValuesData = customValues ?? JSON.parse( stylesBase );\n\t\t\tstylesBase = stylesBase.replace( regex, ( _$1, $2 ) => {\n\t\t\t\tconst path = $2.split( '--' );\n\t\t\t\tif (\n\t\t\t\t\tpath.reduce(\n\t\t\t\t\t\t( prev, curr ) => prev && prev[ curr ],\n\t\t\t\t\t\tcustomValuesData\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\treturn getValueFromObjectPath( customValuesData, path );\n\t\t\t\t}\n\n\t\t\t\t// Check for camelcase properties.\n\t\t\t\treturn getValueFromObjectPath( customValuesData, [\n\t\t\t\t\t...path.slice( 0, path.length - 1 ),\n\t\t\t\t\tcamelCase( path[ path.length - 1 ] ),\n\t\t\t\t] );\n\t\t\t} );\n\t\t}\n\n\t\tif ( variable === 'var' ) {\n\t\t\tstylesBase = stylesBase.replace( varRegex, ( _$1, $2 ) => {\n\t\t\t\tif ( mappedValues?.color ) {\n\t\t\t\t\tconst matchedValue = mappedValues.color?.values?.find(\n\t\t\t\t\t\t( { slug } ) => slug === $2\n\t\t\t\t\t);\n\t\t\t\t\treturn `\"${ matchedValue?.color }\"`;\n\t\t\t\t}\n\t\t\t\treturn UNKNOWN_VALUE;\n\t\t\t} );\n\t\t}\n\n\t\tif ( variable === 'fontSize' ) {\n\t\t\tconst { width, height } = Dimensions.get( 'window' );\n\n\t\t\tstylesBase = stylesBase.replace( fontSizeRegex, ( _$1, $2 ) => {\n\t\t\t\tconst parsedFontSize =\n\t\t\t\t\tgetPxFromCssUnit( $2, {\n\t\t\t\t\t\twidth,\n\t\t\t\t\t\theight,\n\t\t\t\t\t\tfontSize: DEFAULT_FONT_SIZE,\n\t\t\t\t\t} ) || `${ DEFAULT_FONT_SIZE }px`;\n\n\t\t\t\treturn `\"fontSize\":\"${ parsedFontSize }\"`;\n\t\t\t} );\n\t\t}\n\t} );\n\n\treturn JSON.parse( stylesBase );\n}\n\nexport function getMappedValues( features, palette ) {\n\tconst typography = features?.typography;\n\tconst colors = [\n\t\t...( palette?.theme || [] ),\n\t\t...( palette?.custom || [] ),\n\t\t...( palette?.default || [] ),\n\t];\n\n\tconst fontSizes = {\n\t\t...typography?.fontSizes?.theme,\n\t\t...typography?.fontSizes?.custom,\n\t};\n\tconst mappedValues = {\n\t\tcolor: {\n\t\t\tvalues: colors,\n\t\t\tslug: 'color',\n\t\t},\n\t\t'font-size': {\n\t\t\tvalues: fontSizes,\n\t\t\tslug: 'size',\n\t\t},\n\t};\n\treturn mappedValues;\n}\n\n/**\n * Returns the normalized fontSizes to include the sizePx value for each of the different sizes.\n *\n * @param {Object} fontSizes found in global styles.\n * @return {Object} normalized sizes.\n */\nfunction normalizeFontSizes( fontSizes ) {\n\t// Adds normalized PX values for each of the different keys.\n\tif ( ! fontSizes ) {\n\t\treturn fontSizes;\n\t}\n\tconst normalizedFontSizes = {};\n\tconst dimensions = Dimensions.get( 'window' );\n\n\t[ 'default', 'theme', 'custom' ].forEach( ( key ) => {\n\t\tif ( fontSizes[ key ] ) {\n\t\t\tnormalizedFontSizes[ key ] = fontSizes[ key ]?.map(\n\t\t\t\t( fontSizeObject ) => {\n\t\t\t\t\tfontSizeObject.sizePx = getPxFromCssUnit(\n\t\t\t\t\t\tfontSizeObject.size,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\twidth: dimensions.width,\n\t\t\t\t\t\t\theight: dimensions.height,\n\t\t\t\t\t\t\tfontSize: DEFAULT_FONT_SIZE,\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t\treturn fontSizeObject;\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t} );\n\n\treturn normalizedFontSizes;\n}\n\nexport function useMobileGlobalStylesColors( type = 'colors' ) {\n\tconst colorGradientSettings = useMultipleOriginColorsAndGradients();\n\tconst availableThemeColors = colorGradientSettings?.[ type ]?.reduce(\n\t\t( colors, origin ) => colors.concat( origin?.[ type ] ),\n\t\t[]\n\t);\n\t// Default editor colors/gradients if it's not a block-based theme.\n\tconst defaultPaletteSetting =\n\t\ttype === 'colors' ? 'color.palette' : 'color.gradients';\n\tconst [ defaultPaletteValue ] = useSettings( defaultPaletteSetting );\n\t// In edge cases, the default palette might be undefined. To avoid\n\t// exceptions across the editor in that case, we explicitly return\n\t// the default editor colors.\n\tconst defaultPalette = defaultPaletteValue ?? SETTINGS_DEFAULTS.colors;\n\n\treturn availableThemeColors.length >= 1\n\t\t? availableThemeColors\n\t\t: defaultPalette;\n}\n\nexport function getColorsAndGradients(\n\tdefaultEditorColors = [],\n\tdefaultEditorGradients = [],\n\trawFeatures\n) {\n\tconst features = rawFeatures ? JSON.parse( rawFeatures ) : {};\n\n\treturn {\n\t\t__experimentalGlobalStylesBaseStyles: null,\n\t\t__experimentalFeatures: {\n\t\t\tcolor: {\n\t\t\t\t...( ! features?.color\n\t\t\t\t\t? {\n\t\t\t\t\t\t\ttext: true,\n\t\t\t\t\t\t\tbackground: true,\n\t\t\t\t\t\t\tpalette: {\n\t\t\t\t\t\t\t\tdefault: defaultEditorColors,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tgradients: {\n\t\t\t\t\t\t\t\tdefault: defaultEditorGradients,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t }\n\t\t\t\t\t: features?.color ),\n\t\t\t\tdefaultPalette: defaultEditorColors?.length > 0,\n\t\t\t\tdefaultGradients: defaultEditorGradients?.length > 0,\n\t\t\t},\n\t\t},\n\t};\n}\n\nexport function getGlobalStyles( rawStyles, rawFeatures ) {\n\tconst features = rawFeatures ? JSON.parse( rawFeatures ) : {};\n\tconst mappedValues = getMappedValues( features, features?.color?.palette );\n\tconst colors = parseStylesVariables(\n\t\tJSON.stringify( features?.color ),\n\t\tmappedValues\n\t);\n\tconst gradients = parseStylesVariables(\n\t\tJSON.stringify( features?.color?.gradients ),\n\t\tmappedValues\n\t);\n\tconst customValues = parseStylesVariables(\n\t\tJSON.stringify( features?.custom ),\n\t\tmappedValues\n\t);\n\tconst globalStyles = parseStylesVariables(\n\t\trawStyles,\n\t\tmappedValues,\n\t\tcustomValues\n\t);\n\n\tconst fontSizes = normalizeFontSizes( features?.typography?.fontSizes );\n\n\treturn {\n\t\t__experimentalFeatures: {\n\t\t\tcolor: {\n\t\t\t\tpalette: colors?.palette,\n\t\t\t\tgradients,\n\t\t\t\ttext: features?.color?.text ?? true,\n\t\t\t\tbackground: features?.color?.background ?? true,\n\t\t\t\tdefaultPalette: features?.color?.defaultPalette ?? true,\n\t\t\t\tdefaultGradients: features?.color?.defaultGradients ?? true,\n\t\t\t},\n\t\t\ttypography: {\n\t\t\t\tfontSizes,\n\t\t\t\tcustomLineHeight: features?.custom?.[ 'line-height' ],\n\t\t\t},\n\t\t\tspacing: features?.spacing,\n\t\t},\n\t\t__experimentalGlobalStylesBaseStyles: globalStyles,\n\t};\n}\n\n/**\n * Determine and apply appropriate color scheme based on global styles or device's light/dark mode.\n *\n * The function first attempts to retrieve the editor's background color from global styles.\n * If the detected background color is light, light styles are applied, and dark styles otherwise.\n * If no custom background color is defined, styles are applied using the device's dark/light setting.\n *\n * @param {Object} baseStyle - An object representing the base (light theme) styles for the editor.\n * @param {Object} darkStyle - An object representing the additional styles to apply when the editor is in dark mode.\n *\n * @return {Object} - The combined style object that should be applied to the editor.\n */\nexport const useEditorColorScheme = ( baseStyle, darkStyle ) => {\n\tconst globalStyles = useGlobalStyles();\n\n\tconst deviceColorScheme = usePreferredColorSchemeStyle(\n\t\tbaseStyle,\n\t\tdarkStyle\n\t);\n\n\tconst editorColors = globalStyles?.baseColors?.color;\n\tconst editorBackgroundColor = editorColors?.background;\n\n\tconst isBackgroundColorDefined =\n\t\ttypeof editorBackgroundColor !== 'undefined' &&\n\t\teditorBackgroundColor !== 'undefined';\n\n\tif ( isBackgroundColorDefined ) {\n\t\tconst isEditorBackgroundDark = colord( editorBackgroundColor ).isDark();\n\t\treturn isEditorBackgroundDark\n\t\t\t? { ...baseStyle, ...darkStyle }\n\t\t\t: baseStyle;\n\t}\n\n\treturn deviceColorScheme;\n};\n"],"mappings":";;;;;;;;;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAKA,IAAAG,YAAA,GAAAH,OAAA;AAMA,IAAAI,QAAA,GAAAJ,OAAA;AAKA,IAAAK,MAAA,GAAAL,OAAA;AArBA;AACA;AACA;;AAKA;AACA;AACA;;AASA;AACA;AACA;;AAGO,MAAMM,sBAAsB,GAAG,CACrC,WAAW,EACX,iBAAiB,EACjB,OAAO,EACP,OAAO,EACP,UAAU,CACV;;AAED;AAAAC,OAAA,CAAAD,sBAAA,GAAAA,sBAAA;AACA,MAAME,8BAA8B,GAAG;EACtCC,SAAS,EAAE,OAAO;EAClBC,IAAI,EAAE,OAAO;EACbC,UAAU,EAAE,iBAAiB;EAC7BC,IAAI,EAAE,WAAW;EACjBC,WAAW,EAAE;AACd,CAAC;AAED,MAAMC,OAAO,GAAG,EAAE,CAAC,CAAC;AACpB,MAAMC,aAAa,GAAG,WAAW;AACjC,MAAMC,iBAAiB,GAAG,EAAE;AAErB,SAASC,gBAAgBA,CAC/BC,WAAW,EACXC,iBAAiB,EACjBC,oBAAoB,EACpBC,WAAW,EACV;EACD,MAAMC,aAAa,GAAG,CAAC,CAAC;EAExB,IACC,CAAEJ,WAAW,CAACK,OAAO,KACnBJ,iBAAiB,EAAEK,eAAe,IACnCJ,oBAAoB,EAAEI,eAAe,IACrCH,WAAW,EAAEG,eAAe,CAAE,EAC9B;IACDF,aAAa,CAACC,OAAO,GAAGT,OAAO;IAC/B,OAAOQ,aAAa;EACrB;;EAEA;EACA,IACCJ,WAAW,EAA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GAAI;MACxD,CAAC;MACDjF,UAAU,EAAE;QACXF,SAAS;QACTsF,gBAAgB,EAAExC,QAAQ,EAAEI,MAAM,GAAI,aAAa;MACpD,CAAC;MACDqC,OAAO,EAAEzC,QAAQ,EAAEyC;IACpB,CAAC;IACDb,oCAAoC,EAAEW;EACvC,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMG,oBAAoB,GAAGA,CAAEC,SAAS,EAAEC,SAAS,KAAM;EAC/D,MAAML,YAAY,GAAG,IAAAM,sBAAe,EAAC,CAAC;EAEtC,MAAMC,iBAAiB,GAAG,IAAAC,qCAA4B,EACrDJ,SAAS,EACTC,SACD,CAAC;EAED,MAAMI,YAAY,GAAGT,YAAY,EAAEU,UAAU,EAAEnH,KAAK;EACpD,MAAMoH,qBAAqB,GAAGF,YAAY,EAAExI,UAAU;EAEtD,MAAM2I,wBAAwB,GAC7B,OAAOD,qBAAqB,KAAK,WAAW,IAC5CA,qBAAqB,KAAK,WAAW;EAEtC,IAAKC,wBAAwB,EAAG;IAC/B,MAAMC,sBAAsB,GAAG,IAAAC,cAAM,EAAEH,qBAAsB,CAAC,CAACI,MAAM,CAAC,CAAC;IACvE,OAAOF,sBAAsB,GAC1B;MAAE,GAAGT,SAAS;MAAE,GAAGC;IAAU,CAAC,GAC9BD,SAAS;EACb;EAEA,OAAOG,iBAAiB;AACzB,CAAC;AAAC1I,OAAA,CAAAsI,oBAAA,GAAAA,oBAAA"}
1
+ {"version":3,"names":["_changeCase","require","_reactNative","_colord","_blockEditor","_compose","_index","BLOCK_STYLE_ATTRIBUTES","exports","BLOCK_STYLE_ATTRIBUTES_MAPPING","textColor","text","background","link","placeholder","PADDING","UNKNOWN_VALUE","DEFAULT_FONT_SIZE","getBlockPaddings","mergedStyle","wrapperPropsStyle","blockStyleAttributes","blockColors","blockPaddings","padding","backgroundColor","undefined","getBlockColors","defaultColors","blockName","baseGlobalStyles","blockStyles","customBlockStyles","style","color","blockGlobalStyles","blocks","Object","entries","forEach","key","value","styleKey","_customBlockStyles$ke","styles","elements","linkColor","isCustomColor","startsWith","mappedColor","values","find","slug","getBlockTypography","fontSizes","typographyStyles","typography","parsedFontSizes","fontSize","lineHeight","parseInt","mappedFontSize","size","getValueFromObjectPath","object","path","fieldName","parseStylesVariables","mappedValues","customValues","stylesBase","variables","variable","regex","RegExp","varRegex","fontSizeRegex","replace","_$1","$2","split","mappedPresetValue","_mappedPresetValue$va","matchedValue","customValuesData","JSON","parse","colorKey","length","reduce","prev","curr","slice","camelCase","width","height","Dimensions","get","parsedFontSize","getPxFromCssUnit","getMappedValues","features","palette","colors","theme","custom","default","normalizeFontSizes","normalizedFontSizes","dimensions","map","fontSizeObject","sizePx","useMobileGlobalStylesColors","type","colorGradientSettings","useMultipleOriginColorsAndGradients","availableThemeColors","origin","concat","defaultPaletteSetting","defaultPaletteValue","useSettings","defaultPalette","SETTINGS_DEFAULTS","getColorsAndGradients","defaultEditorColors","defaultEditorGradients","rawFeatures","__experimentalGlobalStylesBaseStyles","__experimentalFeatures","gradients","defaultGradients","getGlobalStyles","rawStyles","_features$color$text","_features$color$backg","_features$color$defau","_features$color$defau2","stringify","globalStyles","customLineHeight","spacing","useEditorColorScheme","baseStyle","darkStyle","useGlobalStyles","deviceColorScheme","usePreferredColorSchemeStyle","editorColors","baseColors","editorBackgroundColor","isBackgroundColorDefined","isEditorBackgroundDark","colord","isDark"],"sources":["@wordpress/components/src/mobile/global-styles-context/utils.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { camelCase } from 'change-case';\nimport { Dimensions } from 'react-native';\nimport { colord } from 'colord';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tgetPxFromCssUnit,\n\tuseSettings,\n\tuseMultipleOriginColorsAndGradients,\n\tSETTINGS_DEFAULTS,\n} from '@wordpress/block-editor';\nimport { usePreferredColorSchemeStyle } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { useGlobalStyles } from './index.native';\n\nexport const BLOCK_STYLE_ATTRIBUTES = [\n\t'textColor',\n\t'backgroundColor',\n\t'style',\n\t'color',\n\t'fontSize',\n];\n\n// Mapping style properties name to native.\nconst BLOCK_STYLE_ATTRIBUTES_MAPPING = {\n\ttextColor: 'color',\n\ttext: 'color',\n\tbackground: 'backgroundColor',\n\tlink: 'linkColor',\n\tplaceholder: 'placeholderColor',\n};\n\nconst PADDING = 12; // $solid-border-space\nconst UNKNOWN_VALUE = 'undefined';\nconst DEFAULT_FONT_SIZE = 16;\n\nexport function getBlockPaddings(\n\tmergedStyle,\n\twrapperPropsStyle,\n\tblockStyleAttributes,\n\tblockColors\n) {\n\tconst blockPaddings = {};\n\n\tif (\n\t\t! mergedStyle.padding &&\n\t\t( wrapperPropsStyle?.backgroundColor ||\n\t\t\tblockStyleAttributes?.backgroundColor ||\n\t\t\tblockColors?.backgroundColor )\n\t) {\n\t\tblockPaddings.padding = PADDING;\n\t\treturn blockPaddings;\n\t}\n\n\t// Prevent adding extra paddings to inner blocks without background colors.\n\tif (\n\t\tmergedStyle?.padding &&\n\t\t! wrapperPropsStyle?.backgroundColor &&\n\t\t! blockStyleAttributes?.backgroundColor &&\n\t\t! blockColors?.backgroundColor\n\t) {\n\t\tblockPaddings.padding = undefined;\n\t}\n\n\treturn blockPaddings;\n}\n\nexport function getBlockColors(\n\tblockStyleAttributes,\n\tdefaultColors,\n\tblockName,\n\tbaseGlobalStyles\n) {\n\tconst blockStyles = {};\n\tconst customBlockStyles = blockStyleAttributes?.style?.color || {};\n\tconst blockGlobalStyles = baseGlobalStyles?.blocks?.[ blockName ];\n\n\t// Global styles colors.\n\tif ( blockGlobalStyles?.color ) {\n\t\tObject.entries( blockGlobalStyles.color ).forEach(\n\t\t\t( [ key, value ] ) => {\n\t\t\t\tconst styleKey = BLOCK_STYLE_ATTRIBUTES_MAPPING[ key ];\n\n\t\t\t\tif ( styleKey && value !== UNKNOWN_VALUE ) {\n\t\t\t\t\tconst color = customBlockStyles[ key ] ?? value;\n\t\t\t\t\tblockStyles[ styleKey ] = color;\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t} else if ( baseGlobalStyles?.styles?.color?.text ) {\n\t\tblockStyles[ BLOCK_STYLE_ATTRIBUTES_MAPPING.text ] =\n\t\t\tbaseGlobalStyles?.styles?.color?.text;\n\t}\n\n\t// Global styles elements.\n\tif ( blockGlobalStyles?.elements ) {\n\t\tconst linkColor = blockGlobalStyles.elements?.link?.color?.text;\n\t\tconst styleKey = BLOCK_STYLE_ATTRIBUTES_MAPPING.link;\n\n\t\tif ( styleKey && linkColor && linkColor !== UNKNOWN_VALUE ) {\n\t\t\tblockStyles[ styleKey ] = linkColor;\n\t\t}\n\t}\n\n\t// Custom colors.\n\tObject.entries( blockStyleAttributes ).forEach( ( [ key, value ] ) => {\n\t\tconst isCustomColor = value?.startsWith?.( '#' );\n\t\tlet styleKey = key;\n\n\t\tif ( BLOCK_STYLE_ATTRIBUTES_MAPPING[ styleKey ] ) {\n\t\t\tstyleKey = BLOCK_STYLE_ATTRIBUTES_MAPPING[ styleKey ];\n\t\t}\n\n\t\tif ( ! isCustomColor ) {\n\t\t\tconst mappedColor = Object.values( defaultColors ?? {} ).find(\n\t\t\t\t( { slug } ) => slug === value\n\t\t\t);\n\n\t\t\tif ( mappedColor ) {\n\t\t\t\tblockStyles[ styleKey ] = mappedColor.color;\n\t\t\t}\n\t\t} else {\n\t\t\tblockStyles[ styleKey ] = value;\n\t\t}\n\t} );\n\n\t// Color placeholder.\n\tif ( blockStyles?.color ) {\n\t\tblockStyles[ BLOCK_STYLE_ATTRIBUTES_MAPPING.placeholder ] =\n\t\t\tblockStyles.color;\n\t}\n\n\treturn blockStyles;\n}\n\nexport function getBlockTypography(\n\tblockStyleAttributes,\n\tfontSizes,\n\tblockName,\n\tbaseGlobalStyles\n) {\n\tconst typographyStyles = {};\n\tconst customBlockStyles = blockStyleAttributes?.style?.typography || {};\n\tconst blockGlobalStyles = baseGlobalStyles?.blocks?.[ blockName ];\n\tconst parsedFontSizes = Object.values( fontSizes ?? {} );\n\n\t// Global styles.\n\tif ( blockGlobalStyles?.typography ) {\n\t\tconst fontSize = blockGlobalStyles?.typography?.fontSize;\n\t\tconst lineHeight = blockGlobalStyles?.typography?.lineHeight;\n\n\t\tif ( fontSize ) {\n\t\t\tif ( parseInt( fontSize, 10 ) ) {\n\t\t\t\ttypographyStyles.fontSize = fontSize;\n\t\t\t} else {\n\t\t\t\tconst mappedFontSize = parsedFontSizes.find(\n\t\t\t\t\t( { slug } ) => slug === fontSize\n\t\t\t\t);\n\n\t\t\t\tif ( mappedFontSize ) {\n\t\t\t\t\ttypographyStyles.fontSize = mappedFontSize?.size;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( lineHeight ) {\n\t\t\ttypographyStyles.lineHeight = lineHeight;\n\t\t}\n\t}\n\n\tif ( blockStyleAttributes?.fontSize && baseGlobalStyles ) {\n\t\tconst mappedFontSize = parsedFontSizes.find(\n\t\t\t( { slug } ) => slug === blockStyleAttributes?.fontSize\n\t\t);\n\n\t\tif ( mappedFontSize ) {\n\t\t\ttypographyStyles.fontSize = mappedFontSize?.size;\n\t\t}\n\t}\n\n\t// Custom styles.\n\tif ( customBlockStyles?.fontSize ) {\n\t\ttypographyStyles.fontSize = customBlockStyles?.fontSize;\n\t}\n\n\tif ( customBlockStyles?.lineHeight ) {\n\t\ttypographyStyles.lineHeight = customBlockStyles?.lineHeight;\n\t}\n\n\treturn typographyStyles;\n}\n\n/**\n * Return a value from a certain path of the object.\n * Path is specified as an array of properties, like: [ 'parent', 'child' ].\n *\n * @param {Object} object Input object.\n * @param {Array} path Path to the object property.\n * @return {*} Value of the object property at the specified path.\n */\nconst getValueFromObjectPath = ( object, path ) => {\n\tlet value = object;\n\tpath.forEach( ( fieldName ) => {\n\t\tvalue = value?.[ fieldName ];\n\t} );\n\treturn value;\n};\n\nexport function parseStylesVariables( styles, mappedValues, customValues ) {\n\tlet stylesBase = styles;\n\tconst variables = [ 'preset', 'custom', 'var', 'fontSize' ];\n\n\tif ( ! stylesBase ) {\n\t\treturn styles;\n\t}\n\n\tvariables.forEach( ( variable ) => {\n\t\t// Examples\n\t\t// var(--wp--preset--color--gray)\n\t\t// var(--wp--custom--body--typography--font-family)\n\t\t// var:preset|color|custom-color-2\n\t\tconst regex = new RegExp( `var\\\\(--wp--${ variable }--(.*?)\\\\)`, 'g' );\n\t\tconst varRegex = /\\\"var:preset\\|color\\|(.*?)\\\"/gm;\n\t\tconst fontSizeRegex = /\"fontSize\":\"(.*?)\"/gm;\n\n\t\tif ( variable === 'preset' ) {\n\t\t\tstylesBase = stylesBase.replace( regex, ( _$1, $2 ) => {\n\t\t\t\tconst path = $2.split( '--' );\n\t\t\t\tconst mappedPresetValue = mappedValues[ path[ 0 ] ];\n\t\t\t\tif ( mappedPresetValue && mappedPresetValue.slug ) {\n\t\t\t\t\tconst matchedValue = Object.values(\n\t\t\t\t\t\tmappedPresetValue.values ?? {}\n\t\t\t\t\t).find( ( { slug } ) => slug === path[ 1 ] );\n\t\t\t\t\treturn matchedValue?.[ mappedPresetValue.slug ];\n\t\t\t\t}\n\t\t\t\treturn UNKNOWN_VALUE;\n\t\t\t} );\n\t\t}\n\t\tif ( variable === 'custom' ) {\n\t\t\tconst customValuesData = customValues ?? JSON.parse( stylesBase );\n\t\t\tstylesBase = stylesBase.replace( regex, ( _$1, $2 ) => {\n\t\t\t\tconst path = $2.split( '--' );\n\n\t\t\t\t// Supports cases for variables like var(--wp--custom--color--background)\n\t\t\t\tif ( path[ 0 ] === 'color' ) {\n\t\t\t\t\tconst colorKey = path[ path.length - 1 ];\n\t\t\t\t\tif ( mappedValues?.color ) {\n\t\t\t\t\t\tconst matchedValue = mappedValues.color?.values?.find(\n\t\t\t\t\t\t\t( { slug } ) => slug === colorKey\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif ( matchedValue ) {\n\t\t\t\t\t\t\treturn `${ matchedValue?.color }`;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\tpath.reduce(\n\t\t\t\t\t\t( prev, curr ) => prev && prev[ curr ],\n\t\t\t\t\t\tcustomValuesData\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\treturn getValueFromObjectPath( customValuesData, path );\n\t\t\t\t}\n\n\t\t\t\t// Check for camelcase properties.\n\t\t\t\treturn getValueFromObjectPath( customValuesData, [\n\t\t\t\t\t...path.slice( 0, path.length - 1 ),\n\t\t\t\t\tcamelCase( path[ path.length - 1 ] ),\n\t\t\t\t] );\n\t\t\t} );\n\t\t}\n\n\t\tif ( variable === 'var' ) {\n\t\t\tstylesBase = stylesBase.replace( varRegex, ( _$1, $2 ) => {\n\t\t\t\tif ( mappedValues?.color ) {\n\t\t\t\t\tconst matchedValue = mappedValues.color?.values?.find(\n\t\t\t\t\t\t( { slug } ) => slug === $2\n\t\t\t\t\t);\n\t\t\t\t\treturn `\"${ matchedValue?.color }\"`;\n\t\t\t\t}\n\t\t\t\treturn UNKNOWN_VALUE;\n\t\t\t} );\n\t\t}\n\n\t\tif ( variable === 'fontSize' ) {\n\t\t\tconst { width, height } = Dimensions.get( 'window' );\n\n\t\t\tstylesBase = stylesBase.replace( fontSizeRegex, ( _$1, $2 ) => {\n\t\t\t\tconst parsedFontSize =\n\t\t\t\t\tgetPxFromCssUnit( $2, {\n\t\t\t\t\t\twidth,\n\t\t\t\t\t\theight,\n\t\t\t\t\t\tfontSize: DEFAULT_FONT_SIZE,\n\t\t\t\t\t} ) || `${ DEFAULT_FONT_SIZE }px`;\n\n\t\t\t\treturn `\"fontSize\":\"${ parsedFontSize }\"`;\n\t\t\t} );\n\t\t}\n\t} );\n\n\treturn JSON.parse( stylesBase );\n}\n\nexport function getMappedValues( features, palette ) {\n\tconst typography = features?.typography;\n\tconst colors = [\n\t\t...( palette?.theme || [] ),\n\t\t...( palette?.custom || [] ),\n\t\t...( palette?.default || [] ),\n\t];\n\n\tconst fontSizes = {\n\t\t...typography?.fontSizes?.theme,\n\t\t...typography?.fontSizes?.custom,\n\t};\n\tconst mappedValues = {\n\t\tcolor: {\n\t\t\tvalues: colors,\n\t\t\tslug: 'color',\n\t\t},\n\t\t'font-size': {\n\t\t\tvalues: fontSizes,\n\t\t\tslug: 'size',\n\t\t},\n\t};\n\treturn mappedValues;\n}\n\n/**\n * Returns the normalized fontSizes to include the sizePx value for each of the different sizes.\n *\n * @param {Object} fontSizes found in global styles.\n * @return {Object} normalized sizes.\n */\nfunction normalizeFontSizes( fontSizes ) {\n\t// Adds normalized PX values for each of the different keys.\n\tif ( ! fontSizes ) {\n\t\treturn fontSizes;\n\t}\n\tconst normalizedFontSizes = {};\n\tconst dimensions = Dimensions.get( 'window' );\n\n\t[ 'default', 'theme', 'custom' ].forEach( ( key ) => {\n\t\tif ( fontSizes[ key ] ) {\n\t\t\tnormalizedFontSizes[ key ] = fontSizes[ key ]?.map(\n\t\t\t\t( fontSizeObject ) => {\n\t\t\t\t\tfontSizeObject.sizePx = getPxFromCssUnit(\n\t\t\t\t\t\tfontSizeObject.size,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\twidth: dimensions.width,\n\t\t\t\t\t\t\theight: dimensions.height,\n\t\t\t\t\t\t\tfontSize: DEFAULT_FONT_SIZE,\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t\treturn fontSizeObject;\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t} );\n\n\treturn normalizedFontSizes;\n}\n\nexport function useMobileGlobalStylesColors( type = 'colors' ) {\n\tconst colorGradientSettings = useMultipleOriginColorsAndGradients();\n\tconst availableThemeColors = colorGradientSettings?.[ type ]?.reduce(\n\t\t( colors, origin ) => colors.concat( origin?.[ type ] ),\n\t\t[]\n\t);\n\t// Default editor colors/gradients if it's not a block-based theme.\n\tconst defaultPaletteSetting =\n\t\ttype === 'colors' ? 'color.palette' : 'color.gradients';\n\tconst [ defaultPaletteValue ] = useSettings( defaultPaletteSetting );\n\t// In edge cases, the default palette might be undefined. To avoid\n\t// exceptions across the editor in that case, we explicitly return\n\t// the default editor colors.\n\tconst defaultPalette = defaultPaletteValue ?? SETTINGS_DEFAULTS.colors;\n\n\treturn availableThemeColors.length >= 1\n\t\t? availableThemeColors\n\t\t: defaultPalette;\n}\n\nexport function getColorsAndGradients(\n\tdefaultEditorColors = [],\n\tdefaultEditorGradients = [],\n\trawFeatures\n) {\n\tconst features = rawFeatures ? JSON.parse( rawFeatures ) : {};\n\n\treturn {\n\t\t__experimentalGlobalStylesBaseStyles: null,\n\t\t__experimentalFeatures: {\n\t\t\tcolor: {\n\t\t\t\t...( ! features?.color\n\t\t\t\t\t? {\n\t\t\t\t\t\t\ttext: true,\n\t\t\t\t\t\t\tbackground: true,\n\t\t\t\t\t\t\tpalette: {\n\t\t\t\t\t\t\t\tdefault: defaultEditorColors,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tgradients: {\n\t\t\t\t\t\t\t\tdefault: defaultEditorGradients,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t }\n\t\t\t\t\t: features?.color ),\n\t\t\t\tdefaultPalette: defaultEditorColors?.length > 0,\n\t\t\t\tdefaultGradients: defaultEditorGradients?.length > 0,\n\t\t\t},\n\t\t},\n\t};\n}\n\nexport function getGlobalStyles( rawStyles, rawFeatures ) {\n\tconst features = rawFeatures ? JSON.parse( rawFeatures ) : {};\n\tconst mappedValues = getMappedValues( features, features?.color?.palette );\n\tconst colors = parseStylesVariables(\n\t\tJSON.stringify( features?.color ),\n\t\tmappedValues\n\t);\n\tconst gradients = parseStylesVariables(\n\t\tJSON.stringify( features?.color?.gradients ),\n\t\tmappedValues\n\t);\n\tconst customValues = parseStylesVariables(\n\t\tJSON.stringify( features?.custom ),\n\t\tmappedValues\n\t);\n\tconst globalStyles = parseStylesVariables(\n\t\trawStyles,\n\t\tmappedValues,\n\t\tcustomValues\n\t);\n\n\tconst fontSizes = normalizeFontSizes( features?.typography?.fontSizes );\n\n\treturn {\n\t\t__experimentalFeatures: {\n\t\t\tcolor: {\n\t\t\t\tpalette: colors?.palette,\n\t\t\t\tgradients,\n\t\t\t\ttext: features?.color?.text ?? true,\n\t\t\t\tbackground: features?.color?.background ?? true,\n\t\t\t\tdefaultPalette: features?.color?.defaultPalette ?? true,\n\t\t\t\tdefaultGradients: features?.color?.defaultGradients ?? true,\n\t\t\t},\n\t\t\ttypography: {\n\t\t\t\tfontSizes,\n\t\t\t\tcustomLineHeight: features?.custom?.[ 'line-height' ],\n\t\t\t},\n\t\t\tspacing: features?.spacing,\n\t\t},\n\t\t__experimentalGlobalStylesBaseStyles: globalStyles,\n\t};\n}\n\n/**\n * Determine and apply appropriate color scheme based on global styles or device's light/dark mode.\n *\n * The function first attempts to retrieve the editor's background color from global styles.\n * If the detected background color is light, light styles are applied, and dark styles otherwise.\n * If no custom background color is defined, styles are applied using the device's dark/light setting.\n *\n * @param {Object} baseStyle - An object representing the base (light theme) styles for the editor.\n * @param {Object} darkStyle - An object representing the additional styles to apply when the editor is in dark mode.\n *\n * @return {Object} - The combined style object that should be applied to the editor.\n */\nexport const useEditorColorScheme = ( baseStyle, darkStyle ) => {\n\tconst globalStyles = useGlobalStyles();\n\n\tconst deviceColorScheme = usePreferredColorSchemeStyle(\n\t\tbaseStyle,\n\t\tdarkStyle\n\t);\n\n\tconst editorColors = globalStyles?.baseColors?.color;\n\tconst editorBackgroundColor = editorColors?.background;\n\n\tconst isBackgroundColorDefined =\n\t\ttypeof editorBackgroundColor !== 'undefined' &&\n\t\teditorBackgroundColor !== 'undefined';\n\n\tif ( isBackgroundColorDefined ) {\n\t\tconst isEditorBackgroundDark = colord( editorBackgroundColor ).isDark();\n\t\treturn isEditorBackgroundDark\n\t\t\t? { ...baseStyle, ...darkStyle }\n\t\t\t: baseStyle;\n\t}\n\n\treturn deviceColorScheme;\n};\n"],"mappings":";;;;;;;;;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,G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AAc,qBAAA,cAAAA,qBAAA,GAAI,IAAI;QACvDL,gBAAgB,GAAAM,sBAAA,GAAErC,QAAQ,EAAEnE,KAAK,EAAEkG,gBAAgB,cAAAM,sBAAA,cAAAA,sBAAA,GAAI;MACxD,CAAC;MACDlF,UAAU,EAAE;QACXF,SAAS;QACTuF,gBAAgB,EAAExC,QAAQ,EAAEI,MAAM,GAAI,aAAa;MACpD,CAAC;MACDqC,OAAO,EAAEzC,QAAQ,EAAEyC;IACpB,CAAC;IACDb,oCAAoC,EAAEW;EACvC,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMG,oBAAoB,GAAGA,CAAEC,SAAS,EAAEC,SAAS,KAAM;EAC/D,MAAML,YAAY,GAAG,IAAAM,sBAAe,EAAC,CAAC;EAEtC,MAAMC,iBAAiB,GAAG,IAAAC,qCAA4B,EACrDJ,SAAS,EACTC,SACD,CAAC;EAED,MAAMI,YAAY,GAAGT,YAAY,EAAEU,UAAU,EAAEpH,KAAK;EACpD,MAAMqH,qBAAqB,GAAGF,YAAY,EAAEzI,UAAU;EAEtD,MAAM4I,wBAAwB,GAC7B,OAAOD,qBAAqB,KAAK,WAAW,IAC5CA,qBAAqB,KAAK,WAAW;EAEtC,IAAKC,wBAAwB,EAAG;IAC/B,MAAMC,sBAAsB,GAAG,IAAAC,cAAM,EAAEH,qBAAsB,CAAC,CAACI,MAAM,CAAC,CAAC;IACvE,OAAOF,sBAAsB,GAC1B;MAAE,GAAGT,SAAS;MAAE,GAAGC;IAAU,CAAC,GAC9BD,SAAS;EACb;EAEA,OAAOG,iBAAiB;AACzB,CAAC;AAAC3I,OAAA,CAAAuI,oBAAA,GAAAA,oBAAA"}
@@ -15,7 +15,7 @@ const WIDE_ALIGNMENTS = {
15
15
  full: 'full'
16
16
  },
17
17
  excludeBlocks: ['core/heading'],
18
- notInnerContainers: ['core/separator', 'core/media-text', 'core/pullquote']
18
+ notInnerContainers: ['core/image', 'core/separator', 'core/media-text', 'core/pullquote']
19
19
  };
20
20
  exports.WIDE_ALIGNMENTS = WIDE_ALIGNMENTS;
21
21
  const ALIGNMENT_BREAKPOINTS = {
@@ -1 +1 @@
1
- {"version":3,"names":["_blocks","require","WIDE_ALIGNMENTS","alignments","wide","full","excludeBlocks","notInnerContainers","exports","ALIGNMENT_BREAKPOINTS","large","medium","small","mobile","isFullWidth","align","isWideWidth","isWider","width","breakpoint","isContainerRelated","blockName","includes","hasFullWidthSupport","hasParentFullWidthSupport","blockType","getBlockType","blockAlign","supports","Array","isArray","parent","some","alignmentHelpers"],"sources":["@wordpress/components/src/mobile/utils/alignments.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlockType } from '@wordpress/blocks';\n\nexport const WIDE_ALIGNMENTS = {\n\talignments: {\n\t\twide: 'wide',\n\t\tfull: 'full',\n\t},\n\texcludeBlocks: [ 'core/heading' ],\n\tnotInnerContainers: [\n\t\t'core/separator',\n\t\t'core/media-text',\n\t\t'core/pullquote',\n\t],\n};\n\nexport const ALIGNMENT_BREAKPOINTS = {\n\twide: 1024,\n\tlarge: 820,\n\tmedium: 768,\n\tsmall: 680,\n\tmobile: 480,\n};\n\nconst isFullWidth = ( align ) => align === WIDE_ALIGNMENTS.alignments.full;\n\nconst isWideWidth = ( align ) => align === WIDE_ALIGNMENTS.alignments.wide;\n\nconst isWider = ( width, breakpoint ) =>\n\twidth > ALIGNMENT_BREAKPOINTS[ breakpoint ];\n\nconst isContainerRelated = ( blockName ) => {\n\tif ( WIDE_ALIGNMENTS.notInnerContainers.includes( blockName ) ) {\n\t\treturn false;\n\t}\n\n\tif ( hasFullWidthSupport( blockName ) ) {\n\t\treturn true;\n\t}\n\n\treturn hasParentFullWidthSupport( blockName );\n};\n\n/**\n * Whether the block has support for full width alignment.\n *\n * @param {string} blockName\n * @return {boolean} Return whether the block supports full width alignment.\n */\nfunction hasFullWidthSupport( blockName ) {\n\tconst blockType = getBlockType( blockName );\n\tconst blockAlign = blockType?.supports?.align;\n\treturn (\n\t\t!! Array.isArray( blockAlign ) &&\n\t\tblockAlign.includes( WIDE_ALIGNMENTS.alignments.full )\n\t);\n}\n/**\n * Whether the block's parent has support for full width alignment.\n *\n * @param {string} blockName\n * @return {boolean} Return whether the block's parent supports full width alignment.\n */\nfunction hasParentFullWidthSupport( blockName ) {\n\tconst blockType = getBlockType( blockName );\n\treturn !! blockType?.parent?.some( hasFullWidthSupport );\n}\n\nexport const alignmentHelpers = {\n\tisFullWidth,\n\tisWideWidth,\n\tisWider,\n\tisContainerRelated,\n};\n"],"mappings":";;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGO,MAAMC,eAAe,GAAG;EAC9BC,UAAU,EAAE;IACXC,IAAI,EAAE,MAAM;IACZC,IAAI,EAAE;EACP,CAAC;EACDC,aAAa,EAAE,CAAE,cAAc,CAAE;EACjCC,kBAAkB,EAAE,CACnB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB;AAElB,CAAC;AAACC,OAAA,CAAAN,eAAA,GAAAA,eAAA;AAEK,MAAMO,qBAAqB,GAAG;EACpCL,IAAI,EAAE,IAAI;EACVM,KAAK,EAAE,GAAG;EACVC,MAAM,EAAE,GAAG;EACXC,KAAK,EAAE,GAAG;EACVC,MAAM,EAAE;AACT,CAAC;AAACL,OAAA,CAAAC,qBAAA,GAAAA,qBAAA;AAEF,MAAMK,WAAW,GAAKC,KAAK,IAAMA,KAAK,KAAKb,eAAe,CAACC,UAAU,CAACE,IAAI;AAE1E,MAAMW,WAAW,GAAKD,KAAK,IAAMA,KAAK,KAAKb,eAAe,CAACC,UAAU,CAACC,IAAI;AAE1E,MAAMa,OAAO,GAAGA,CAAEC,KAAK,EAAEC,UAAU,KAClCD,KAAK,GAAGT,qBAAqB,CAAEU,UAAU,CAAE;AAE5C,MAAMC,kBAAkB,GAAKC,SAAS,IAAM;EAC3C,IAAKnB,eAAe,CAACK,kBAAkB,CAACe,QAAQ,CAAED,SAAU,CAAC,EAAG;IAC/D,OAAO,KAAK;EACb;EAEA,IAAKE,mBAAmB,CAAEF,SAAU,CAAC,EAAG;IACvC,OAAO,IAAI;EACZ;EAEA,OAAOG,yBAAyB,CAAEH,SAAU,CAAC;AAC9C,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,SAASE,mBAAmBA,CAAEF,SAAS,EAAG;EACzC,MAAMI,SAAS,GAAG,IAAAC,oBAAY,EAAEL,SAAU,CAAC;EAC3C,MAAMM,UAAU,GAAGF,SAAS,EAAEG,QAAQ,EAAEb,KAAK;EAC7C,OACC,CAAC,CAAEc,KAAK,CAACC,OAAO,CAAEH,UAAW,CAAC,IAC9BA,UAAU,CAACL,QAAQ,CAAEpB,eAAe,CAACC,UAAU,CAACE,IAAK,CAAC;AAExD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASmB,yBAAyBA,CAAEH,SAAS,EAAG;EAC/C,MAAMI,SAAS,GAAG,IAAAC,oBAAY,EAAEL,SAAU,CAAC;EAC3C,OAAO,CAAC,CAAEI,SAAS,EAAEM,MAAM,EAAEC,IAAI,CAAET,mBAAoB,CAAC;AACzD;AAEO,MAAMU,gBAAgB,GAAG;EAC/BnB,WAAW;EACXE,WAAW;EACXC,OAAO;EACPG;AACD,CAAC;AAACZ,OAAA,CAAAyB,gBAAA,GAAAA,gBAAA"}
1
+ {"version":3,"names":["_blocks","require","WIDE_ALIGNMENTS","alignments","wide","full","excludeBlocks","notInnerContainers","exports","ALIGNMENT_BREAKPOINTS","large","medium","small","mobile","isFullWidth","align","isWideWidth","isWider","width","breakpoint","isContainerRelated","blockName","includes","hasFullWidthSupport","hasParentFullWidthSupport","blockType","getBlockType","blockAlign","supports","Array","isArray","parent","some","alignmentHelpers"],"sources":["@wordpress/components/src/mobile/utils/alignments.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlockType } from '@wordpress/blocks';\n\nexport const WIDE_ALIGNMENTS = {\n\talignments: {\n\t\twide: 'wide',\n\t\tfull: 'full',\n\t},\n\texcludeBlocks: [ 'core/heading' ],\n\tnotInnerContainers: [\n\t\t'core/image',\n\t\t'core/separator',\n\t\t'core/media-text',\n\t\t'core/pullquote',\n\t],\n};\n\nexport const ALIGNMENT_BREAKPOINTS = {\n\twide: 1024,\n\tlarge: 820,\n\tmedium: 768,\n\tsmall: 680,\n\tmobile: 480,\n};\n\nconst isFullWidth = ( align ) => align === WIDE_ALIGNMENTS.alignments.full;\n\nconst isWideWidth = ( align ) => align === WIDE_ALIGNMENTS.alignments.wide;\n\nconst isWider = ( width, breakpoint ) =>\n\twidth > ALIGNMENT_BREAKPOINTS[ breakpoint ];\n\nconst isContainerRelated = ( blockName ) => {\n\tif ( WIDE_ALIGNMENTS.notInnerContainers.includes( blockName ) ) {\n\t\treturn false;\n\t}\n\n\tif ( hasFullWidthSupport( blockName ) ) {\n\t\treturn true;\n\t}\n\n\treturn hasParentFullWidthSupport( blockName );\n};\n\n/**\n * Whether the block has support for full width alignment.\n *\n * @param {string} blockName\n * @return {boolean} Return whether the block supports full width alignment.\n */\nfunction hasFullWidthSupport( blockName ) {\n\tconst blockType = getBlockType( blockName );\n\tconst blockAlign = blockType?.supports?.align;\n\treturn (\n\t\t!! Array.isArray( blockAlign ) &&\n\t\tblockAlign.includes( WIDE_ALIGNMENTS.alignments.full )\n\t);\n}\n/**\n * Whether the block's parent has support for full width alignment.\n *\n * @param {string} blockName\n * @return {boolean} Return whether the block's parent supports full width alignment.\n */\nfunction hasParentFullWidthSupport( blockName ) {\n\tconst blockType = getBlockType( blockName );\n\treturn !! blockType?.parent?.some( hasFullWidthSupport );\n}\n\nexport const alignmentHelpers = {\n\tisFullWidth,\n\tisWideWidth,\n\tisWider,\n\tisContainerRelated,\n};\n"],"mappings":";;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGO,MAAMC,eAAe,GAAG;EAC9BC,UAAU,EAAE;IACXC,IAAI,EAAE,MA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CAACE,IAAK,CAAC;AAExD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASmB,yBAAyBA,CAAEH,SAAS,EAAG;EAC/C,MAAMI,SAAS,GAAG,IAAAC,oBAAY,EAAEL,SAAU,CAAC;EAC3C,OAAO,CAAC,CAAEI,SAAS,EAAEM,MAAM,EAAEC,IAAI,CAAET,mBAAoB,CAAC;AACzD;AAEO,MAAMU,gBAAgB,GAAG;EAC/BnB,WAAW;EACXE,WAAW;EACXC,OAAO;EACPG;AACD,CAAC;AAACZ,OAAA,CAAAyB,gBAAA,GAAAA,gBAAA"}
@@ -4,9 +4,11 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
+ exports.DEFAULT_COLOR = void 0;
7
8
  exports.PaletteEdit = PaletteEdit;
8
9
  exports.default = void 0;
9
10
  exports.getNameForPosition = getNameForPosition;
11
+ exports.isTemporaryElement = isTemporaryElement;
10
12
  var _react = require("react");
11
13
  var _classnames = _interopRequireDefault(require("classnames"));
12
14
  var _changeCase = require("change-case");
@@ -41,6 +43,7 @@ var _customGradientPicker = _interopRequireDefault(require("../custom-gradient-p
41
43
  */
42
44
 
43
45
  const DEFAULT_COLOR = '#000';
46
+ exports.DEFAULT_COLOR = DEFAULT_COLOR;
44
47
  function NameInput({
45
48
  value,
46
49
  onChange,
@@ -188,13 +191,30 @@ function Option({
188
191
  popoverProps: popoverProps
189
192
  }));
190
193
  }
194
+
195
+ /**
196
+ * Checks if a color or gradient is a temporary element by testing against default values.
197
+ */
191
198
  function isTemporaryElement(slugPrefix, {
192
199
  slug,
193
200
  color,
194
201
  gradient
195
202
  }) {
196
203
  const regex = new RegExp(`^${slugPrefix}color-([\\d]+)$`);
197
- return regex.test(slug) && (!!color && color === DEFAULT_COLOR || !!gradient && gradient === _constants.DEFAULT_GRADIENT);
204
+
205
+ // If the slug matches the temporary name regex,
206
+ // check if the color or gradient matches the default value.
207
+ if (regex.test(slug)) {
208
+ // The order is important as gradient elements
209
+ // contain a color property.
210
+ if (!!gradient) {
211
+ return gradient === _constants.DEFAULT_GRADIENT;
212
+ }
213
+ if (!!color) {
214
+ return color === DEFAULT_COLOR;
215
+ }
216
+ }
217
+ return false;
198
218
  }
199
219
  function PaletteEditListView({
200
220
  elements,