@astryx-vue/core 0.2.6 → 0.4.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 (524) hide show
  1. package/THIRD_PARTY_NOTICES.md +9 -0
  2. package/dist/AlertDialog/index.js +1 -1
  3. package/dist/{AlertDialog-BBhl5P1X.js → AlertDialog-C2inDZWG.js} +13 -7
  4. package/dist/AppShell/index.d.ts +1 -1
  5. package/dist/AppShell/index.js +1 -1
  6. package/dist/{AppShell-mrflO0Uy.js → AppShell-CumzH-8z.js} +3 -3
  7. package/dist/Avatar/index.d.ts +1 -1
  8. package/dist/Avatar/index.js +1 -1
  9. package/dist/{Avatar-pPZ4dI_s.js → Avatar-BW0TE8t9.js} +47 -34
  10. package/dist/AvatarGroup/index.d.ts +1 -1
  11. package/dist/AvatarGroup/index.js +1 -1
  12. package/dist/{AvatarGroup-B--NQSB3.js → AvatarGroup-DLC_FFR5.js} +57 -13
  13. package/dist/Banner/index.d.ts +1 -1
  14. package/dist/Banner/index.js +1 -1
  15. package/dist/{Banner-GbGxrqQO.js → Banner-C5VAwo4D.js} +68 -34
  16. package/dist/Blockquote/index.js +1 -1
  17. package/dist/Blockquote-DRoKdcxZ.js +27 -0
  18. package/dist/BottomSheet/index.d.ts +1 -1
  19. package/dist/BottomSheet/index.js +2 -2
  20. package/dist/{BottomSheet-eJ3FzTBD.js → BottomSheet-B4sc3F1S.js} +288 -140
  21. package/dist/{BottomSheet-DIVwbGr3.js → BottomSheet-m54uCMJN.js} +20 -4
  22. package/dist/Breadcrumbs/index.d.ts +2 -2
  23. package/dist/Breadcrumbs/index.js +2 -2
  24. package/dist/Breadcrumbs-CTaz7Kh4.js +223 -0
  25. package/dist/Button/index.d.ts +1 -1
  26. package/dist/Button/index.js +1 -1
  27. package/dist/{Button-B6Hj_O_s.js → Button-ONOoHdkg.js} +25 -15
  28. package/dist/ButtonGroup/index.d.ts +1 -1
  29. package/dist/ButtonGroup/index.js +1 -1
  30. package/dist/ButtonGroup-DnkSZ9a5.js +87 -0
  31. package/dist/{ButtonTooltip-nWWrth8j.js → ButtonTooltip-CNKOQHYR.js} +7 -4
  32. package/dist/Calendar/index.d.ts +1 -1
  33. package/dist/Calendar/index.js +1 -1
  34. package/dist/{Calendar-B7vIowKq.js → Calendar-BAqzzQm2.js} +5 -5
  35. package/dist/Card/index.d.ts +2 -2
  36. package/dist/Card/index.js +1 -1
  37. package/dist/{Card-HAjZQg2s.js → Card-B-I24X9S.js} +2 -0
  38. package/dist/Carousel/index.js +1 -1
  39. package/dist/{Carousel-DAkOa7KK.js → Carousel-DXC22UWq.js} +50 -33
  40. package/dist/Chat/index.d.ts +1 -1
  41. package/dist/Chat/index.js +1 -1
  42. package/dist/{Chat-DVoI6UOA.js → Chat-BdJW6IX5.js} +152 -83
  43. package/dist/CheckboxIndicator/index.js +1 -1
  44. package/dist/{CheckboxIndicator-D37cm2Rh.js → CheckboxIndicator-fH4d-JE1.js} +9 -3
  45. package/dist/CheckboxInput/index.d.ts +1 -1
  46. package/dist/CheckboxInput/index.js +1 -1
  47. package/dist/{CheckboxInput-BS9J6edf.js → CheckboxInput-DJHCbwgC.js} +19 -11
  48. package/dist/CheckboxList/index.d.ts +1 -1
  49. package/dist/CheckboxList/index.js +1 -1
  50. package/dist/{CheckboxList-CX1i_jVP.js → CheckboxList-BdZIP4_J.js} +155 -38
  51. package/dist/Citation/index.js +1 -1
  52. package/dist/{Citation-Djgwa0ko.js → Citation-DbZn2vms.js} +8 -3
  53. package/dist/ClickableCard/index.d.ts +1 -1
  54. package/dist/ClickableCard/index.js +1 -1
  55. package/dist/{ClickableCard-Bhds4RRe.js → ClickableCard-ChAfiw9T.js} +10 -7
  56. package/dist/Code/index.d.ts +1 -1
  57. package/dist/Code/index.js +3 -3
  58. package/dist/{Code-XnPuGxey.js → Code-Bg7GBdxy.js} +2 -1
  59. package/dist/{CodeBlock-BUM3czCS.js → CodeBlock-Caaflp7C.js} +7 -3
  60. package/dist/Collapsible/index.d.ts +1 -1
  61. package/dist/Collapsible/index.js +1 -1
  62. package/dist/{Collapsible-Cov3Pyq5.js → Collapsible-Bdj0WYpb.js} +13 -11
  63. package/dist/CommandPalette/index.d.ts +1 -1
  64. package/dist/CommandPalette/index.js +1 -1
  65. package/dist/{CommandPalette-D6wYS30d.js → CommandPalette-C_MClfAg.js} +146 -62
  66. package/dist/ComplexSelector/index.d.ts +1 -1
  67. package/dist/ComplexSelector/index.js +1 -1
  68. package/dist/{ComplexSelector-Bil81sfq.js → ComplexSelector-BeVQaqRf.js} +94 -22
  69. package/dist/ContextMenu/index.d.ts +2 -2
  70. package/dist/ContextMenu/index.js +2 -2
  71. package/dist/{ContextMenu-DdLJnxNN.js → ContextMenu-C6hPYvYz.js} +299 -179
  72. package/dist/DateInput/index.d.ts +1 -1
  73. package/dist/DateInput/index.js +1 -1
  74. package/dist/{DateInput-u2XKccpK.js → DateInput-BjLdmYor.js} +567 -76
  75. package/dist/DateRangeInput/index.d.ts +1 -1
  76. package/dist/DateRangeInput/index.js +1 -1
  77. package/dist/{DateRangeInput-u7LhH6up.js → DateRangeInput-Br3wVEfD.js} +99 -28
  78. package/dist/DateTimeInput/index.d.ts +1 -1
  79. package/dist/DateTimeInput/index.js +1 -1
  80. package/dist/DateTimeInput-CAZBwoRe.js +562 -0
  81. package/dist/Dialog/index.d.ts +1 -1
  82. package/dist/Dialog/index.js +2 -2
  83. package/dist/{Dialog-BiOSKQso.js → Dialog-Dce4Y97V.js} +28 -11
  84. package/dist/{Dialog-FGHfDu5M.js → Dialog-fhyxB00e.js} +32 -5
  85. package/dist/Divider/index.d.ts +1 -1
  86. package/dist/Divider/index.js +1 -1
  87. package/dist/{Divider-BtwnL18I.js → Divider-mOZ6vIQw.js} +5 -1
  88. package/dist/DropdownMenu/index.d.ts +2 -2
  89. package/dist/DropdownMenu/index.js +3 -3
  90. package/dist/{DropdownMenu-SM_BEOgM.js → DropdownMenu-BdGmQVb1.js} +85 -57
  91. package/dist/{DropdownMenu-BEasdJ6R.js → DropdownMenu-BzQrNV9C.js} +481 -264
  92. package/dist/{DropdownMenuRadioItem.vue-CXEURBcq.d.ts → DropdownMenuRadioItem.vue-Qd-8Rg4Q.d.ts} +236 -230
  93. package/dist/EmptyState/index.js +1 -1
  94. package/dist/{EmptyState-C_GH7IV5.js → EmptyState-CmOQf2SH.js} +2 -2
  95. package/dist/Field/index.d.ts +4 -3
  96. package/dist/Field/index.js +4 -3
  97. package/dist/{Field-D5gUEGw4.js → Field--OEsLBfE.js} +4 -3
  98. package/dist/{FieldInfoTip-Ds-sW_jY.js → FieldInfoTip-gxsnfkZw.js} +3 -3
  99. package/dist/{FieldLabel-BNeXRuGH.js → FieldLabel-jxIiWgLw.js} +12 -7
  100. package/dist/FieldStatus/index.d.ts +1 -1
  101. package/dist/FileInput/index.d.ts +1 -1
  102. package/dist/FileInput/index.js +1 -1
  103. package/dist/{FileInput-BpdiO1V8.js → FileInput-B_pUxB0Y.js} +106 -29
  104. package/dist/FormLayout/index.d.ts +1 -1
  105. package/dist/FormLayout/index.js +1 -1
  106. package/dist/{FormLayout-D47FjiOq.js → FormLayout-B9dUB6Ps.js} +1 -1
  107. package/dist/Heading/index.d.ts +1 -1
  108. package/dist/Heading/index.js +1 -1
  109. package/dist/{Heading-BnwWEWkp.js → Heading-BzBunfN7.js} +1 -1
  110. package/dist/HoverCard/index.js +1 -1
  111. package/dist/{HoverCard-ycY50pRN.js → HoverCard-BpJhT0sn.js} +35 -22
  112. package/dist/Icon/index.d.ts +4 -4
  113. package/dist/Icon/index.js +1 -1
  114. package/dist/{Icon-bteSId7T.js → Icon-KDnUyY7f.js} +12 -20
  115. package/dist/IconButton/index.js +1 -1
  116. package/dist/{IconButton-DDNgNl7B.js → IconButton-DI-XBbtV.js} +1 -1
  117. package/dist/Indicator/index.d.ts +2 -2
  118. package/dist/Indicator/index.js +2 -1
  119. package/dist/InputClearButton-CwXPan8c.js +40 -0
  120. package/dist/InputGroup/index.d.ts +1 -1
  121. package/dist/InputGroup/index.js +2 -2
  122. package/dist/{InputGroup-CA03Smrs.js → InputGroup-DiiocoIW.js} +2 -2
  123. package/dist/InternationalizationProvider/index.d.ts +1 -1
  124. package/dist/InternationalizationProvider/index.js +1 -1
  125. package/dist/{InternationalizationProvider-DJay_w3B.js → InternationalizationProvider-kBapgKAQ.js} +5 -9
  126. package/dist/{Item-KhFKX9St.js → Item-DWMIjN8n.js} +34 -9
  127. package/dist/Kbd/index.js +1 -1
  128. package/dist/{Kbd-BB-Dw6zE.js → Kbd-CV3LO2Ge.js} +18 -2
  129. package/dist/LayerContentBoundary-CvsKxwwm.js +27 -0
  130. package/dist/LayerProvider/index.js +1 -1
  131. package/dist/{LayerProvider-D9NsQFzL.js → LayerProvider-B6zpMBWC.js} +15 -3
  132. package/dist/Layout/index.d.ts +1 -1
  133. package/dist/Layout/index.js +2 -2
  134. package/dist/{Layout-9X6eCUoY.js → Layout-JJRCG7Mf.js} +1 -1
  135. package/dist/{LayoutPanel-DeOh00p5.js → LayoutPanel-zM5vjrKS.js} +15 -8
  136. package/dist/Lightbox/index.js +1 -1
  137. package/dist/{Lightbox-DTF9EdTG.js → Lightbox-D8wyPgMK.js} +8 -6
  138. package/dist/Link/index.d.ts +2 -2
  139. package/dist/Link/index.js +1 -1
  140. package/dist/{Link-BqHCtiyt.js → Link-DweIpOtN.js} +29 -12
  141. package/dist/List/index.d.ts +1 -1
  142. package/dist/List/index.js +2 -2
  143. package/dist/{ListItem-8RWT8XAG.js → ListItem-BQXMu1Tb.js} +1 -1
  144. package/dist/Markdown/index.d.ts +5 -2
  145. package/dist/Markdown/index.js +5 -2
  146. package/dist/Markdown/parser/index.d.ts +4 -0
  147. package/dist/Markdown/parser/index.js +3 -0
  148. package/dist/Markdown/plugin-protocol/index.d.ts +35 -0
  149. package/dist/Markdown/plugin-protocol/index.js +107 -0
  150. package/dist/Markdown/plugin-renderer/index.d.ts +31 -0
  151. package/dist/Markdown/plugin-renderer/index.js +42 -0
  152. package/dist/{Markdown-2CVyZDuB.js → Markdown-DhVfOvXk.js} +195 -484
  153. package/dist/MediaTheme-DlLqYhDy.js +433 -0
  154. package/dist/MetadataList/index.js +1 -1
  155. package/dist/{MetadataList-B-OelQlt.js → MetadataList-CEYceIlN.js} +15 -7
  156. package/dist/MobileNav/index.js +1 -1
  157. package/dist/{MobileNavToggle-C3dkrM98.js → MobileNavToggle-pdoJFZHx.js} +60 -19
  158. package/dist/MoreMenu/index.d.ts +1 -1
  159. package/dist/MoreMenu/index.js +1 -1
  160. package/dist/{MoreMenu-D1WFGqGU.js → MoreMenu-CFNqSRev.js} +87 -67
  161. package/dist/MultiSelector/index.d.ts +1 -1
  162. package/dist/MultiSelector/index.js +1 -1
  163. package/dist/MultiSelector-DuVatmq5.js +1456 -0
  164. package/dist/{NavDisclosure-C_fugrQ3.js → NavDisclosure-Bq9DTZLO.js} +29 -7
  165. package/dist/{NavHeadingSurface-B3yJspSN.js → NavHeadingSurface-C4v_MtkX.js} +29 -26
  166. package/dist/NavItem/index.d.ts +1 -1
  167. package/dist/NavItem/index.js +2 -2
  168. package/dist/{NavItem-BBIGSvDj.js → NavItem-BPb3yfgz.js} +17 -4
  169. package/dist/NavMenu/index.d.ts +1 -1
  170. package/dist/NavMenu/index.js +3 -3
  171. package/dist/{NavMenu-ThXguZAz.js → NavMenu-BYIDzjix.js} +42 -15
  172. package/dist/{NavMenuItem-BvJNsDFC.js → NavMenuItem-D3FO90GR.js} +14 -12
  173. package/dist/NumberInput/index.d.ts +1 -1
  174. package/dist/NumberInput/index.js +1 -1
  175. package/dist/NumberInput-B0vzOg3N.js +727 -0
  176. package/dist/Outline/index.d.ts +2 -2
  177. package/dist/Outline/index.js +2 -2
  178. package/dist/{Outline-755h-lMP.js → Outline-CfGv2F1o.js} +91 -6
  179. package/dist/OverflowList/index.d.ts +2 -2
  180. package/dist/OverflowList/index.js +1 -1
  181. package/dist/{OverflowList-NmrSMbxb.js → OverflowList-BgRLZ3dh.js} +23 -6
  182. package/dist/Pagination/index.d.ts +1 -1
  183. package/dist/Pagination/index.js +1 -1
  184. package/dist/{Pagination-Cc4BrjQg.js → Pagination-Bfe12018.js} +2 -2
  185. package/dist/PickerWheel-CSwUYfes.js +69 -0
  186. package/dist/Popover/index.d.ts +1 -1
  187. package/dist/Popover/index.js +1 -1
  188. package/dist/{Popover-CtoBfVlD.js → Popover-78dFjTb9.js} +28 -17
  189. package/dist/PowerSearch/index.d.ts +1 -1
  190. package/dist/PowerSearch/index.js +1 -1
  191. package/dist/{PowerSearch-DHoiObLn.js → PowerSearch-BoAMdFaT.js} +776 -586
  192. package/dist/ProgressBar/index.d.ts +1 -1
  193. package/dist/ProgressBar/index.js +1 -1
  194. package/dist/{ProgressBar-CVLzdoBK.js → ProgressBar-VP4JS7vm.js} +10 -7
  195. package/dist/Radio/index.d.ts +1 -1
  196. package/dist/Radio/index.js +1 -1
  197. package/dist/{RadioGroup-Bfu6JSNV.js → RadioGroup-BIipql-L.js} +94 -26
  198. package/dist/RadioList/index.d.ts +1 -1
  199. package/dist/RadioList/index.js +1 -1
  200. package/dist/{RadioList-xY1cwLdZ.js → RadioList-GyhgBg4j.js} +57 -8
  201. package/dist/Resizable/index.d.ts +1 -1
  202. package/dist/Resizable/index.js +1 -1
  203. package/dist/{ResizeHandle-q4nD_586.js → ResizeHandle-TPlUCAHD.js} +103 -50
  204. package/dist/ScrollableArea/index.d.ts +1 -1
  205. package/dist/ScrollableArea/index.js +1 -1
  206. package/dist/{ScrollableArea-CJiaALHm.js → ScrollableArea-0u6RWtGG.js} +14 -3
  207. package/dist/Scrollbars/index.d.ts +2 -0
  208. package/dist/Scrollbars/index.js +3 -0
  209. package/dist/Scrollbars-D_93hJYK.js +75 -0
  210. package/dist/SegmentedControl/index.js +1 -1
  211. package/dist/{SegmentedControl-ChHmFrrC.js → SegmentedControl-D1wWGBZo.js} +11 -5
  212. package/dist/SelectableCard/index.d.ts +1 -1
  213. package/dist/SelectableCard/index.js +1 -1
  214. package/dist/{SelectableCard-Bj5s_tIN.js → SelectableCard-BEqnhPaX.js} +17 -12
  215. package/dist/Selector/index.d.ts +1 -1
  216. package/dist/Selector/index.js +1 -1
  217. package/dist/Selector-CPISLzp7.js +1049 -0
  218. package/dist/SideNav/index.d.ts +1 -1
  219. package/dist/SideNav/index.js +1 -1
  220. package/dist/{SideNav-Dtv8eA2j.js → SideNav-CN2QeAtY.js} +64 -41
  221. package/dist/Slider/index.d.ts +1 -1
  222. package/dist/Slider/index.js +1 -1
  223. package/dist/{Slider-DWobsPgm.js → Slider-pdC0jpHu.js} +172 -46
  224. package/dist/Spinner/index.js +1 -1
  225. package/dist/Spinner-DdVUadii.js +200 -0
  226. package/dist/Stack/index.d.ts +1 -1
  227. package/dist/Stack/index.js +2 -2
  228. package/dist/{Stack-CjQEavuq.js → Stack-Bb_h60t3.js} +10 -3
  229. package/dist/{Stack-D_Bhs-3r.js → Stack-Bp-XN9J4.js} +20 -9
  230. package/dist/StatusDot/index.d.ts +1 -1
  231. package/dist/StatusDot/index.js +1 -1
  232. package/dist/{StatusDot-BPUhMOff.js → StatusDot-BS_ohXhd.js} +8 -4
  233. package/dist/Stepper/index.d.ts +1 -1
  234. package/dist/Stepper/index.js +1 -1
  235. package/dist/{Stepper-CE8dHysu.js → Stepper-CyaSRSdu.js} +101 -79
  236. package/dist/Switch/index.d.ts +1 -1
  237. package/dist/Switch/index.js +1 -1
  238. package/dist/{Switch-DaVPRxvN.js → Switch-Z2Vfiiic.js} +38 -22
  239. package/dist/TabList/index.d.ts +2 -2
  240. package/dist/TabList/index.js +1 -1
  241. package/dist/{TabList-DIkK9sgK.js → TabList-DRqP0Hrv.js} +205 -63
  242. package/dist/Table/index.d.ts +3 -3
  243. package/dist/Table/index.js +1 -1
  244. package/dist/{Table-hqZMmzfU.js → Table-BcrrylMX.js} +727 -448
  245. package/dist/Text/index.d.ts +2 -2
  246. package/dist/Text/index.js +1 -1
  247. package/dist/{Text-CV3LmscH.js → Text-CmTOgYXf.js} +1 -1
  248. package/dist/TextArea/index.d.ts +1 -1
  249. package/dist/TextArea/index.js +1 -1
  250. package/dist/{TextArea-Ab5Sw60T.js → TextArea-DA9CCG_J.js} +104 -50
  251. package/dist/TextInput/index.d.ts +1 -1
  252. package/dist/TextInput/index.js +1 -1
  253. package/dist/{TextInput-zFT1_qgI.js → TextInput-CI96einV.js} +71 -38
  254. package/dist/Theme/index.d.ts +3 -3
  255. package/dist/Theme/index.js +3 -2
  256. package/dist/Theme-BbDT8B_C.js +2125 -0
  257. package/dist/Thumbnail/index.js +1 -1
  258. package/dist/{Thumbnail-C3NnJUFG.js → Thumbnail-B2ZAY59J.js} +13 -10
  259. package/dist/{TimeField-ByiJKBRM.js → TimeField-CpAgja9D.js} +299 -40
  260. package/dist/TimeInput/index.d.ts +1 -1
  261. package/dist/TimeInput/index.js +1 -1
  262. package/dist/{TimeInput-S8n946tp.js → TimeInput-Bw_lHS4M.js} +78 -9
  263. package/dist/Timer/index.d.ts +1 -1
  264. package/dist/Timer/index.js +1 -1
  265. package/dist/{Timer-avMQk5DN.js → Timer-CH7GsEVu.js} +1 -1
  266. package/dist/Timestamp/index.d.ts +1 -1
  267. package/dist/Timestamp/index.js +1 -1
  268. package/dist/{Timestamp-xpQKCk0d.js → Timestamp-BFNuoTZ0.js} +5 -5
  269. package/dist/Toast/index.d.ts +1 -1
  270. package/dist/Toast/index.js +1 -1
  271. package/dist/Toast-DwnPjx6j.js +685 -0
  272. package/dist/ToggleButton/index.d.ts +1 -1
  273. package/dist/ToggleButton/index.js +1 -1
  274. package/dist/{ToggleButton-B-C-Q7XP.js → ToggleButton-cLjh9W-x.js} +5 -4
  275. package/dist/Token/index.d.ts +1 -1
  276. package/dist/Token/index.js +1 -1
  277. package/dist/{Token-DsntTYhQ.js → Token-BfS4vi__.js} +32 -17
  278. package/dist/Tokenizer/index.d.ts +1 -1
  279. package/dist/Tokenizer/index.js +1 -1
  280. package/dist/{Tokenizer-41p035dX.js → Tokenizer-Ci3E5bvP.js} +109 -23
  281. package/dist/Toolbar/index.d.ts +2 -2
  282. package/dist/Toolbar/index.js +1 -1
  283. package/dist/{Toolbar-BrgvvTCk.js → Toolbar-C0pMWL4S.js} +1 -1
  284. package/dist/Tooltip/index.d.ts +1 -1
  285. package/dist/Tooltip/index.js +1 -1
  286. package/dist/{Tooltip-C4Vaqd3G.js → Tooltip-sAM8i1eO.js} +23 -19
  287. package/dist/TopNav/index.d.ts +1 -1
  288. package/dist/TopNav/index.js +1 -1
  289. package/dist/{TopNav-CeSeEMX3.js → TopNav-gW59zp1o.js} +16 -15
  290. package/dist/TreeList/index.d.ts +1 -1
  291. package/dist/TreeList/index.js +1 -1
  292. package/dist/{TreeList-BUz-KZJd.js → TreeList-DaoI7zaH.js} +124 -41
  293. package/dist/Typeahead/index.d.ts +1 -1
  294. package/dist/Typeahead/index.js +2 -2
  295. package/dist/{Typeahead-k3xhFxkr.js → Typeahead-D4JjvjK4.js} +125 -26
  296. package/dist/{TypeaheadMenu-DBW6rHeO.js → TypeaheadMenu-BQlMrfqX.js} +141 -51
  297. package/dist/{announce-Cnio10Wk.js → announce-B210eJVf.js} +17 -2
  298. package/dist/characterReferences-BJ-jLhsR.js +65 -0
  299. package/dist/characters-rcDbGt71.d.ts +29 -0
  300. package/dist/characters-wTnzjkkR.js +58 -0
  301. package/dist/{colorMode-CBgdgDSn.js → colorMode-BxqfDP4P.js} +1 -4
  302. package/dist/composables/index.d.ts +5 -4
  303. package/dist/composables/index.js +23 -18
  304. package/dist/{composables-CbKx9C1Y.js → composables-Bc02zKAO.js} +167 -197
  305. package/dist/context-B6UElI5X.js +5 -0
  306. package/dist/{context-Cfjh8te1.js → context-Cfml4jaK.js} +5 -3
  307. package/dist/{context-iABt_ueM.js → context-DWfi56sq.js} +451 -122
  308. package/dist/context-IvbU9c3T.js +8 -0
  309. package/dist/context-pjBxaMSh.js +28 -0
  310. package/dist/fieldParts--SyRZVQG.js +44 -0
  311. package/dist/fieldParts-LXpQMKE8.d.ts +27 -0
  312. package/dist/{focus-CpficIgf.js → focus-l8jVTcqd.js} +1 -1
  313. package/dist/hoverIntent-DMHGb85c.js +115 -0
  314. package/dist/{index-Cde5JvtX.d.ts → index-B-nESNam.d.ts} +8 -7
  315. package/dist/{index-CsNi1I8j.d.ts → index-B08-Uxhv.d.ts} +4 -2
  316. package/dist/{index-Cn-sSds-.d.ts → index-B56j4eI2.d.ts} +24 -1
  317. package/dist/{index-BJMJ09K-.d.ts → index-BEZ4ezJk.d.ts} +1 -1
  318. package/dist/{index-DeQwYJbg.d.ts → index-BNaRK-s5.d.ts} +10 -1
  319. package/dist/{index-CQCTKjIO.d.ts → index-BO9TY87G.d.ts} +5 -4
  320. package/dist/{index-BJSxFVXH.d.ts → index-BQEJj72c.d.ts} +21 -8
  321. package/dist/{index-BXk7Wng7.d.ts → index-BULhhnGf.d.ts} +1 -1
  322. package/dist/{index-D97pQbua.d.ts → index-BV2D2x_u.d.ts} +1 -1
  323. package/dist/{index-BPYzIIYn.d.ts → index-BZKgbyN9.d.ts} +2 -2
  324. package/dist/index-BkUkm6Al.d.ts +11 -0
  325. package/dist/{index-ClNU2Th8.d.ts → index-Bn-v89Vt.d.ts} +10 -6
  326. package/dist/{index-Bu8NA2SD.d.ts → index-BnEhvmdR.d.ts} +16 -7
  327. package/dist/index-Bo-ofFyg.d.ts +166 -0
  328. package/dist/{index-i0tNFWfz.d.ts → index-BqhgeAT4.d.ts} +2 -0
  329. package/dist/{index-DWh2WC8W.d.ts → index-C4Cjz6OK.d.ts} +2 -2
  330. package/dist/{index-B7yhzGUT.d.ts → index-C7sam-SB.d.ts} +2 -2
  331. package/dist/{index-BrJzFA5X.d.ts → index-C90l2rH1.d.ts} +1 -1
  332. package/dist/{index-vP0EtrJJ.d.ts → index-C9gAlDt_.d.ts} +6 -3
  333. package/dist/{index-csA1lH_0.d.ts → index-CJ6ajsUC.d.ts} +2 -2
  334. package/dist/{index-CY-KvZ9B.d.ts → index-CK-Dbh0f.d.ts} +1 -1
  335. package/dist/index-CKUfpmFL.d.ts +375 -0
  336. package/dist/{index-DXpSFlPG.d.ts → index-CKgBTAzC.d.ts} +4 -4
  337. package/dist/{index-EFqQF2Bx.d.ts → index-CPtDjmcX.d.ts} +4 -4
  338. package/dist/{index-12QYAbiz.d.ts → index-CRrSHbok.d.ts} +3 -2
  339. package/dist/{index-DG52Bg0W.d.ts → index-CTf3SK0b.d.ts} +6 -0
  340. package/dist/{index-BNy3SW4S.d.ts → index-CTjkJP4x.d.ts} +32 -3
  341. package/dist/{index-Ca8VIE4l.d.ts → index-CVn0GBdB.d.ts} +1 -1
  342. package/dist/{index-YKCx03zD.d.ts → index-CdvmnNMH.d.ts} +1 -1
  343. package/dist/{index-BUEPz7BL.d.ts → index-CikMzeab.d.ts} +3 -3
  344. package/dist/{index-CdtZjkmG.d.ts → index-CpNlPLBF.d.ts} +183 -129
  345. package/dist/{index-N7OVZ38M.d.ts → index-Cs1xsHKi.d.ts} +28 -16
  346. package/dist/{index-Cyb9Du5Z.d.ts → index-CtTGt6Dv.d.ts} +1 -1
  347. package/dist/{index-HV6W3xCx.d.ts → index-D05JGsT3.d.ts} +5 -2
  348. package/dist/{index-CsTbMVDS.d.ts → index-D0_HsuC3.d.ts} +4 -4
  349. package/dist/{index-BgT6mH3U.d.ts → index-D7ShT2c-.d.ts} +1 -1
  350. package/dist/{index-CkKPMIeX.d.ts → index-D7XRtUTY.d.ts} +9 -0
  351. package/dist/{index-TntQsADQ.d.ts → index-DEm3kRBO.d.ts} +4 -3
  352. package/dist/{index-DamRHh1i.d.ts → index-DLAG3m9W.d.ts} +11 -1
  353. package/dist/{index-DUnDGFQE.d.ts → index-DNA2l1RN.d.ts} +1 -1
  354. package/dist/{index-WnUY4Kxu.d.ts → index-DRJZ-v1E.d.ts} +4 -4
  355. package/dist/{index-DYp2RWkM.d.ts → index-DY8Wph-A.d.ts} +3 -3
  356. package/dist/{index-B1WJxt-n.d.ts → index-DfC05uKG.d.ts} +17 -7
  357. package/dist/{index-C5e-7Obr.d.ts → index-Dj1_1t3j.d.ts} +19 -6
  358. package/dist/{index-jW-mP58D.d.ts → index-Dr4b_oji.d.ts} +22 -15
  359. package/dist/{index-uKnRGtzi.d.ts → index-Ds201-d2.d.ts} +18 -4
  360. package/dist/{index-DIXAzTKL.d.ts → index-DxxudRgB.d.ts} +1 -1
  361. package/dist/{index-DQmK3Lq_.d.ts → index-IfsSCj8J.d.ts} +19 -6
  362. package/dist/{index-B1eCxBCY.d.ts → index-TXcNH86P.d.ts} +1 -1
  363. package/dist/{index-XuAAcYiP.d.ts → index-f3d9cVtj.d.ts} +1 -1
  364. package/dist/index-fAZaRruV.d.ts +125 -0
  365. package/dist/{index-D5N9ikrS.d.ts → index-hCpxKePE.d.ts} +1 -1
  366. package/dist/{index-T2FOcOuI.d.ts → index-jOwU3YoR.d.ts} +400 -90
  367. package/dist/{index-DdGck82Y.d.ts → index-pNtfr-RW.d.ts} +2 -2
  368. package/dist/{index-BhpAUzUr.d.ts → index-unAZVFGz.d.ts} +2 -2
  369. package/dist/index.d.ts +84 -77
  370. package/dist/index.js +151 -134
  371. package/dist/inlineSize-BNe8wggI.js +66 -0
  372. package/dist/inputPresentation-BOyHkCDr.js +62 -0
  373. package/dist/interactionModality-ACpTMhak.js +44 -0
  374. package/dist/isApplePlatform-B1ju6F5B.js +27 -0
  375. package/dist/isRenderable-BnKHIqfd.js +21 -0
  376. package/dist/layerDepth-CNDh-IHb.js +181 -0
  377. package/dist/link-DuuA2eCL.js +30 -0
  378. package/dist/{loadCatalog-BGHKG_9N.d.ts → loadCatalog-DlLFZreI.d.ts} +281 -7
  379. package/dist/loadCatalog-eopw74qb.js +424 -0
  380. package/dist/locale/index.d.ts +2 -2
  381. package/dist/locale/index.js +4 -3
  382. package/dist/locale-CabGJlGp.js +343 -0
  383. package/dist/modalOutlet-CUOcrhIu.js +56 -0
  384. package/dist/optionAction-Cg7xQLUA.d.ts +6 -0
  385. package/dist/{power-search-DrDfcoL1.d.ts → power-search-gHLIYXs5.d.ts} +2 -0
  386. package/dist/protocol-DHxY0NI8.js +113 -0
  387. package/dist/protocol-RSeMzAN1.d.ts +238 -0
  388. package/dist/publicParser-B0MRoikr.d.ts +141 -0
  389. package/dist/publicParser-uHC_T0Fo.js +895 -0
  390. package/dist/resizableChannel-3vivrEcT.js +20 -0
  391. package/dist/safeUrl-CsvfcZ9m.js +54 -0
  392. package/dist/scopedProvide-C-Df7c15.js +30 -0
  393. package/dist/scrollKeyboardDelegation-D7cumnOl.js +238 -0
  394. package/dist/scrollLock-C3aT4-0z.js +102 -0
  395. package/dist/{searchResultMessage-hXXNOFJP.js → searchResultMessage-mCpJBvra.js} +5 -14
  396. package/dist/{semantic-CKH9XVqa.d.ts → semantic-BF_AjLvk.d.ts} +6 -3
  397. package/dist/slug-C65CUsf9.js +32 -0
  398. package/dist/syntaxContext-DmIfNNtb.js +4 -0
  399. package/dist/triggerVariant-BsL8jMHs.js +16 -0
  400. package/dist/{types-0Q_SJv_F.d.ts → types-Bb7OGivY.d.ts} +6 -1
  401. package/dist/{types-H4Bbbxiw.d.ts → types-BnNTzEnd.d.ts} +1 -1
  402. package/dist/{types-CwyibrRB.d.ts → types-C5GQ2KCK.d.ts} +23 -3
  403. package/dist/{types-BBWrcHMD.d.ts → types-Ckih2YJi.d.ts} +3 -2
  404. package/dist/{types-gKsEkk2g.d.ts → types-CsqwQkf1.d.ts} +143 -10
  405. package/dist/upstreamMap-xr3gvREu.js +731 -0
  406. package/dist/{useAnchoredListbox-DwztMNjP.js → useAnchoredListbox-DGxxKHZb.js} +2 -2
  407. package/dist/{useAsyncSource-xpQovjV_.d.ts → useAsyncSource-aGzrvRkI.d.ts} +3 -0
  408. package/dist/{useClickableContainer-DyNpnSEa.js → useClickableContainer-CdGp_Cev.js} +1 -1
  409. package/dist/{useClipboard-BDfbEsWd.js → useClipboard-Dk8cS810.js} +1 -1
  410. package/dist/useHoverLayerDismiss-kYJ_NqL4.js +27 -0
  411. package/dist/{useIndicator-i1NORM7W.js → useIndicator-MZmfBWid.js} +5 -23
  412. package/dist/{useInputContainer-CpgDe2-4.js → useInputContainer-CLcYrby4.js} +1 -1
  413. package/dist/{useInputStatusIcon-DBOwxV4x.js → useInputStatusIcon-DAE7PExr.js} +1 -1
  414. package/dist/useLayerMountTarget-BmZyeKWE.js +156 -0
  415. package/dist/{useListFocus-D0iOJl39.js → useListFocus-ChxLg0b4.js} +3 -2
  416. package/dist/{useMenuDrillIn-DzKGkTho.js → useMenuDrillIn-DhUnPvKs.js} +6 -5
  417. package/dist/useMenuHover-Djreu23i.js +170 -0
  418. package/dist/useMenuPress-8foxY8z4.js +764 -0
  419. package/dist/{useMergedRefs-CfHHlCsn.js → useMergedRefs-Cb6_w93m.js} +24 -4
  420. package/dist/{useNumberField-4-dIGVed.js → useNumberField-Dk1BE3-K.js} +3 -3
  421. package/dist/useOptionActionGrid-CkJcuvaU.js +97 -0
  422. package/dist/{usePositionedLayer-Cru9_00b.js → usePositionedLayer-B7cvG-_v.js} +43 -49
  423. package/dist/usePressFeedback-BJCpjEpv.js +319 -0
  424. package/dist/{useResizable-DDwPpPe6.d.ts → useResizable-1MHPNaRD.d.ts} +19 -1
  425. package/dist/{useResizable-B3ahKLoZ.js → useResizable-I3BCiLSL.js} +72 -40
  426. package/dist/useResolvedLabelHidden-B2rlWiaI.js +30 -0
  427. package/dist/{useRestoreFocus-Djw9RUIf.js → useRestoreFocus-XEKs5-gp.js} +49 -7
  428. package/dist/useScrollOverflow-DuMoGXmm.js +67 -0
  429. package/dist/useScrollableArea-BE8b3qm7.js +222 -0
  430. package/dist/useScrollbars-C2NJ6Qwq.js +43 -0
  431. package/dist/{useTimeValue-6ufHM15W.js → useTimeValue-BJd0xBhG.js} +4 -22
  432. package/dist/useTranslator-BmWt2BBt.js +35 -0
  433. package/dist/{useTypeahead-PAK8lMYz.js → useTypeahead-BvtflkRk.js} +4 -5
  434. package/dist/utils/index.d.ts +3 -0
  435. package/dist/utils/index.js +5 -0
  436. package/dist/{utils-D33VQDnk.js → utils-ClVseK2w.js} +29 -2
  437. package/dist/utils-z3Q6BGIJ.js +819 -0
  438. package/locales/SOURCE.json +1 -1
  439. package/package.json +24 -3
  440. package/reset.css +364 -1
  441. package/styles/avatar-group.css +9 -1
  442. package/styles/badge.css +8 -5
  443. package/styles/banner.css +124 -26
  444. package/styles/blockquote.css +1 -0
  445. package/styles/bordered-control.css +1 -1
  446. package/styles/bottom-sheet.css +74 -6
  447. package/styles/breadcrumbs.css +16 -2
  448. package/styles/button-group.css +3 -1
  449. package/styles/button.css +53 -11
  450. package/styles/card.css +1 -1
  451. package/styles/chat.css +16 -6
  452. package/styles/checkbox-input.css +10 -0
  453. package/styles/clickable-card.css +10 -3
  454. package/styles/collapsible.css +12 -5
  455. package/styles/command-palette.css +29 -14
  456. package/styles/complex-selector.css +22 -5
  457. package/styles/context-menu.css +3 -3
  458. package/styles/date-input.css +111 -1
  459. package/styles/dialog-header.css +4 -1
  460. package/styles/dialog.css +7 -0
  461. package/styles/dropdown-menu.css +12 -3
  462. package/styles/field.css +5 -0
  463. package/styles/form-layout.css +1 -0
  464. package/styles/heading.css +18 -8
  465. package/styles/icon.css +4 -0
  466. package/styles/kbd.css +1 -1
  467. package/styles/layer.css +72 -0
  468. package/styles/list.css +9 -2
  469. package/styles/metadata-list.css +1 -0
  470. package/styles/mobile-nav.css +4 -1
  471. package/styles/multi-selector.css +48 -1
  472. package/styles/nav-item.css +9 -2
  473. package/styles/nav-menu.css +12 -2
  474. package/styles/number-input.css +9 -1
  475. package/styles/overflow-list.css +1 -1
  476. package/styles/popover.css +2 -1
  477. package/styles/power-search.css +5 -3
  478. package/styles/pressable.css +63 -22
  479. package/styles/progress-bar.css +15 -3
  480. package/styles/radio.css +16 -0
  481. package/styles/resize-handle.css +42 -0
  482. package/styles/scrollbars.css +28 -0
  483. package/styles/segmented-control.css +12 -4
  484. package/styles/selector.css +53 -1
  485. package/styles/side-nav.css +19 -0
  486. package/styles/slider.css +4 -3
  487. package/styles/spinner.css +48 -42
  488. package/styles/stepper.css +58 -4
  489. package/styles/switch.css +26 -0
  490. package/styles/tab-list.css +132 -3
  491. package/styles/table.css +88 -10
  492. package/styles/text-area.css +1 -1
  493. package/styles/text-input.css +1 -1
  494. package/styles/text.css +6 -6
  495. package/styles/thumbnail.css +11 -3
  496. package/styles/time-input.css +8 -0
  497. package/styles/toast.css +37 -3
  498. package/styles/token.css +2 -2
  499. package/styles/tokenizer.css +1 -1
  500. package/styles/toolbar.css +4 -1
  501. package/styles/tree-list.css +1 -1
  502. package/styles/typeahead.css +34 -1
  503. package/styles.css +1 -0
  504. package/dist/Blockquote-DFqBv_oJ.js +0 -18
  505. package/dist/Breadcrumbs-DPVaziH4.js +0 -141
  506. package/dist/ButtonGroup-ySQWanDP.js +0 -125
  507. package/dist/DateTimeInput-DHp683jZ.js +0 -268
  508. package/dist/MultiSelector-BeV98x7X.js +0 -988
  509. package/dist/NumberInput-AZ9x3oja.js +0 -473
  510. package/dist/Selector-DuVozKNq.js +0 -675
  511. package/dist/Spinner-9cYUCnDy.js +0 -84
  512. package/dist/Theme-CtaUWo4g.js +0 -1246
  513. package/dist/Toast-BuqIZV5z.js +0 -322
  514. package/dist/context-4PuqD1Ic.js +0 -4
  515. package/dist/context-D5-MwxnN.js +0 -4
  516. package/dist/index-BH9PzQ1F.d.ts +0 -87
  517. package/dist/link-C4_WogdF.js +0 -18
  518. package/dist/loadCatalog-CXKqEB9s.js +0 -877
  519. package/dist/locale-DgkZEMTn.js +0 -105
  520. package/dist/platform-B_9W_aHW.js +0 -33
  521. package/dist/scrollLock-BzIvIimL.js +0 -42
  522. package/dist/useMenuPress-D-FRNrBW.js +0 -573
  523. package/dist/useScrollableArea-DDk_CluT.js +0 -172
  524. /package/dist/{index-lgvUFSCO.d.ts → index-CryFtTT6.d.ts} +0 -0
@@ -1,877 +0,0 @@
1
- import { s as astryxMessages } from "./context-iABt_ueM.js";
2
- //#region src/locale/icu.ts
3
- const pluralRules = /* @__PURE__ */ new Map();
4
- const ordinalRules = /* @__PURE__ */ new Map();
5
- const numberFormats = /* @__PURE__ */ new Map();
6
- function rulesFor(locale, ordinal) {
7
- const cache = ordinal ? ordinalRules : pluralRules;
8
- let rules = cache.get(locale);
9
- if (rules == null) {
10
- rules = new Intl.PluralRules(locale, ordinal ? { type: "ordinal" } : void 0);
11
- cache.set(locale, rules);
12
- }
13
- return rules;
14
- }
15
- function numberFor(locale) {
16
- let format = numberFormats.get(locale);
17
- if (format == null) {
18
- format = new Intl.NumberFormat(locale);
19
- numberFormats.set(locale, format);
20
- }
21
- return format;
22
- }
23
- /**
24
- * 解析原版目录里的 ICU MessageFormat。
25
- * 覆盖 `{name}`、`{name, number}`、`plural`、`selectordinal` 和 `select`。
26
- * 解析失败时抛错,调用方负责把这个键记进未映射列表。
27
- */
28
- function formatIcu(message, values, locale) {
29
- return render(parseMessage(message), values, locale, void 0);
30
- }
31
- function icuPlaceholderNames(message) {
32
- const names = /* @__PURE__ */ new Set();
33
- collectNames(parseMessage(message), names);
34
- return [...names];
35
- }
36
- function collectNames(nodes, names) {
37
- for (const node of nodes) {
38
- if (node.type === "arg" || node.type === "number" || node.type === "plural" || node.type === "select") names.add(node.name);
39
- if (node.type === "plural" || node.type === "select") for (const option of node.options) collectNames(option.nodes, names);
40
- }
41
- }
42
- function render(nodes, values, locale, pound) {
43
- let text = "";
44
- for (const node of nodes) text += renderNode(node, values, locale, pound);
45
- return text;
46
- }
47
- function renderNode(node, values, locale, pound) {
48
- if (node.type === "text") return node.value;
49
- if (node.type === "pound") return pound == null ? "" : numberFor(locale).format(pound);
50
- if (node.type === "arg") return textValue(values[node.name]);
51
- if (node.type === "number") {
52
- const value = numericValue(values[node.name]);
53
- return value == null ? "" : numberFor(locale).format(value);
54
- }
55
- if (node.type === "select") return renderChoice(node.options, selectSelector(values[node.name]), values, locale, pound);
56
- const value = numericValue(values[node.name]);
57
- const rounded = value == null ? void 0 : value - node.offset;
58
- const selector = value == null ? "other" : pluralSelector(value, node.options, locale, node.ordinal);
59
- return renderChoice(node.options, selector, values, locale, rounded);
60
- }
61
- function pluralSelector(value, options, locale, ordinal) {
62
- const exact = exactSelector(value);
63
- if (exact != null && options.some((option) => option.selector === exact)) return exact;
64
- return rulesFor(locale, ordinal).select(value);
65
- }
66
- function renderChoice(options, selector, values, locale, pound) {
67
- const match = options.find((option) => option.selector === selector) ?? options.find((option) => option.selector === "other") ?? options[0];
68
- return match == null ? "" : render(match.nodes, values, locale, pound);
69
- }
70
- function textValue(value) {
71
- if (value == null) return "";
72
- return typeof value === "number" ? String(value) : value;
73
- }
74
- function numericValue(value) {
75
- if (typeof value === "number" && Number.isFinite(value)) return value;
76
- if (typeof value === "string" && value.trim() !== "") {
77
- const parsed = Number(value);
78
- if (Number.isFinite(parsed)) return parsed;
79
- }
80
- }
81
- function exactSelector(value) {
82
- return Number.isInteger(value) ? `=${value}` : void 0;
83
- }
84
- function selectSelector(value) {
85
- if (value == null) return "other";
86
- return String(value);
87
- }
88
- function parseMessage(input) {
89
- let index = 0;
90
- function parseNodes(stop, pluralPound) {
91
- const nodes = [];
92
- let text = "";
93
- const flush = () => {
94
- if (text !== "") {
95
- nodes.push({
96
- type: "text",
97
- value: text
98
- });
99
- text = "";
100
- }
101
- };
102
- while (index < input.length) {
103
- const char = input[index];
104
- if (char === "'") {
105
- if (input[index + 1] === "'") {
106
- text += "'";
107
- index += 2;
108
- continue;
109
- }
110
- index += 1;
111
- while (index < input.length && input[index] !== "'") {
112
- text += input[index];
113
- index += 1;
114
- }
115
- if (input[index] === "'") index += 1;
116
- continue;
117
- }
118
- if (char === "#" && pluralPound) {
119
- flush();
120
- nodes.push({ type: "pound" });
121
- index += 1;
122
- continue;
123
- }
124
- if (char === "{") {
125
- flush();
126
- index += 1;
127
- nodes.push(parseArgument());
128
- continue;
129
- }
130
- if (stop != null && char === stop) {
131
- flush();
132
- return nodes;
133
- }
134
- text += char;
135
- index += 1;
136
- }
137
- if (stop != null) throw new Error("ICU 消息没有闭合");
138
- flush();
139
- return nodes;
140
- }
141
- function parseArgument() {
142
- skipSpace();
143
- const name = readIdentifier();
144
- skipSpace();
145
- if (input[index] === "}") {
146
- index += 1;
147
- return {
148
- type: "arg",
149
- name
150
- };
151
- }
152
- if (input[index] !== ",") throw new Error(`ICU 参数 ${name} 格式不对`);
153
- index += 1;
154
- skipSpace();
155
- const kind = readIdentifier();
156
- skipSpace();
157
- if (kind === "number") {
158
- if (input[index] === ",") skipNumberStyle();
159
- expectChar("}");
160
- index += 1;
161
- return {
162
- type: "number",
163
- name
164
- };
165
- }
166
- if (kind === "plural" || kind === "selectordinal" || kind === "select") {
167
- expectChar(",");
168
- index += 1;
169
- skipSpace();
170
- let offset = 0;
171
- if (kind !== "select" && input.startsWith("offset:", index)) {
172
- index += 7;
173
- skipSpace();
174
- offset = readInteger();
175
- skipSpace();
176
- }
177
- const options = [];
178
- while (index < input.length && input[index] !== "}") {
179
- skipSpace();
180
- if (input[index] === "}") break;
181
- const selector = readSelector();
182
- skipSpace();
183
- expectChar("{");
184
- index += 1;
185
- const nodes = parseNodes("}", kind !== "select");
186
- expectChar("}");
187
- index += 1;
188
- options.push({
189
- selector,
190
- nodes
191
- });
192
- }
193
- expectChar("}");
194
- index += 1;
195
- if (options.length === 0) throw new Error(`ICU ${kind} 没有选项`);
196
- if (kind === "select") return {
197
- type: "select",
198
- name,
199
- options
200
- };
201
- return {
202
- type: "plural",
203
- name,
204
- offset,
205
- ordinal: kind === "selectordinal",
206
- options
207
- };
208
- }
209
- throw new Error(`不支持的 ICU 类型 ${kind}`);
210
- }
211
- function skipNumberStyle() {
212
- let depth = 0;
213
- while (index < input.length) {
214
- const char = input[index];
215
- if (char === "{") depth += 1;
216
- else if (char === "}") {
217
- if (depth === 0) return;
218
- depth -= 1;
219
- }
220
- index += 1;
221
- }
222
- throw new Error("ICU number 没有闭合");
223
- }
224
- function skipSpace() {
225
- while (index < input.length && (input[index] === " " || input[index] === "\n" || input[index] === "\r" || input[index] === " ")) index += 1;
226
- }
227
- function readIdentifier() {
228
- const start = index;
229
- while (index < input.length && /[\w$]/.test(input[index])) index += 1;
230
- if (start === index) throw new Error("ICU 缺少参数名");
231
- return input.slice(start, index);
232
- }
233
- function readSelector() {
234
- if (input[index] === "=") {
235
- index += 1;
236
- const sign = input[index] === "-" ? "-" : "";
237
- if (sign) index += 1;
238
- return `=${sign}${readInteger()}`;
239
- }
240
- return readIdentifier();
241
- }
242
- function readInteger() {
243
- const start = index;
244
- while (index < input.length && input[index] >= "0" && input[index] <= "9") index += 1;
245
- if (start === index) throw new Error("ICU 缺少数字");
246
- return Number(input.slice(start, index));
247
- }
248
- function expectChar(char) {
249
- if (input[index] !== char) throw new Error(`ICU 期望 ${char}`);
250
- }
251
- return parseNodes(null, false);
252
- }
253
- //#endregion
254
- //#region src/locale/upstreamMap.ts
255
- const operatorNames = [
256
- "contains",
257
- "notContains",
258
- "startsWith",
259
- "notStartsWith",
260
- "endsWith",
261
- "notEndsWith",
262
- "is",
263
- "isNot",
264
- "equals",
265
- "notEquals",
266
- "greaterThan",
267
- "lessThan",
268
- "greaterThanOrEqual",
269
- "lessThanOrEqual",
270
- "before",
271
- "after",
272
- "between",
273
- "isTrue",
274
- "isFalse",
275
- "isAnyOf",
276
- "isNoneOf"
277
- ];
278
- const valueNames = [
279
- "value",
280
- "values",
281
- "time",
282
- "date",
283
- "relativeDate",
284
- "startDate",
285
- "endDate",
286
- "entities",
287
- "searchPlaceholder",
288
- "enterValuePlaceholder",
289
- "addValuesPlaceholder",
290
- "enterNumberPlaceholder",
291
- "selectValuesPlaceholder"
292
- ];
293
- function operatorTargets() {
294
- return Object.fromEntries(operatorNames.map((name) => [`@astryx.powersearch.operator.${name}`, [{ path: `powerSearch.operators.${name}` }]]));
295
- }
296
- function valueTargets() {
297
- return Object.fromEntries(valueNames.map((name) => [`@astryx.powersearch.valueEditor.${name}`, [{ path: `powerSearch.value.${name}` }]]));
298
- }
299
- /**
300
- * 原版 `@astryx.*` 键到 `AstryxMessages` 字段的对照。
301
- * 一个键可以填多个字段。占位符对不上的键不会写入,由加载器列出来。
302
- */
303
- const upstreamMessageMap = {
304
- "@astryx.pagination.label": [{ path: "pagination.nav" }],
305
- "@astryx.pagination.previous": [{ path: "pagination.previous" }],
306
- "@astryx.pagination.next": [{ path: "pagination.next" }],
307
- "@astryx.pagination.pageAnnounce": [{
308
- path: "pagination.page",
309
- args: ["current"]
310
- }],
311
- "@astryx.pagination.itemsPerPage": [{ path: "pagination.perPage" }],
312
- "@astryx.pagination.count": [{
313
- path: "pagination.total",
314
- args: [
315
- "total",
316
- "from",
317
- "to"
318
- ]
319
- }],
320
- "@astryx.pagination.pageOfTotal": [{
321
- path: "pagination.pageOf",
322
- args: ["current", "total"]
323
- }],
324
- "@astryx.calendar.previousMonth": [{ path: "calendar.previousMonth" }],
325
- "@astryx.calendar.nextMonth": [{ path: "calendar.nextMonth" }],
326
- "@astryx.calendar.rangeStartAnnounce": [{
327
- path: "calendar.rangeStart",
328
- args: ["date"]
329
- }],
330
- "@astryx.calendar.rangeClearedAnnounce": [{
331
- path: "calendar.rangeCleared",
332
- args: ["date"]
333
- }],
334
- "@astryx.calendar.rangeCompleteAnnounce": [{
335
- path: "calendar.rangeComplete",
336
- args: ["start", "end"]
337
- }],
338
- "@astryx.calendar.dayRangeStart": [{
339
- path: "calendar.rangeStartName",
340
- args: ["date"]
341
- }],
342
- "@astryx.calendar.dayRangeEnd": [{
343
- path: "calendar.rangeEndName",
344
- args: ["date"]
345
- }],
346
- "@astryx.calendar.dayRangeStartAndEnd": [{
347
- path: "calendar.rangeBoth",
348
- args: ["date"]
349
- }],
350
- "@astryx.carousel.label": [{ path: "carousel.label" }],
351
- "@astryx.carousel.scrollLeft": [{ path: "carousel.scrollLeft" }],
352
- "@astryx.carousel.scrollRight": [{ path: "carousel.scrollRight" }],
353
- "@astryx.carousel.slideLabel": [{
354
- path: "carousel.slide",
355
- args: ["current", "total"]
356
- }],
357
- "@astryx.chat.status.sending": [{ path: "chat.statusSending" }],
358
- "@astryx.chat.status.sent": [{ path: "chat.statusSent" }],
359
- "@astryx.chat.status.delivered": [{ path: "chat.statusDelivered" }],
360
- "@astryx.chat.status.read": [{ path: "chat.statusRead" }],
361
- "@astryx.chat.status.failed": [{ path: "chat.statusFailed" }],
362
- "@astryx.chat.messageAriaLabel": [{
363
- path: "chat.messageStatus",
364
- args: ["status"]
365
- }],
366
- "@astryx.chat.pastedText.expand": [{ path: "chat.expandPastedText" }],
367
- "@astryx.chatTypingIndicator.one": [{
368
- path: "chat.typingOne",
369
- args: ["name"]
370
- }],
371
- "@astryx.chat.composer.placeholder": [{ path: "chat.placeholder" }],
372
- "@astryx.chat.composerDrawer.label": [{ path: "chat.drawerLabel" }],
373
- "@astryx.chat.composerInput.label": [{ path: "chat.inputLabel" }],
374
- "@astryx.chat.speechRecognition.noSpeechDetected": [{ path: "chat.noSpeechDetected" }],
375
- "@astryx.chatComposerDrawer.expand": [{
376
- path: "chat.drawerExpand",
377
- args: ["label"]
378
- }],
379
- "@astryx.chatComposerDrawer.collapse": [{
380
- path: "chat.drawerCollapse",
381
- args: ["label"]
382
- }],
383
- "@astryx.chatDictationButton.startDictation": [{ path: "chat.startDictation" }],
384
- "@astryx.chatDictationButton.stopDictation": [{ path: "chat.stopDictation" }],
385
- "@astryx.chatLayout.newMessages": [{ path: "chat.newMessages" }],
386
- "@astryx.chatLayoutScrollButton.scrollToBottom": [{ path: "chat.scrollToBottom" }],
387
- "@astryx.chatMessage.messageFrom": [{
388
- path: "chat.messageFrom",
389
- args: ["sender"]
390
- }],
391
- "@astryx.chatSendButton.stop": [{ path: "chat.stop" }],
392
- "@astryx.chatSendButton.send": [{ path: "chat.send" }],
393
- "@astryx.chatToolCalls.error": [{
394
- path: "chat.toolError",
395
- args: ["message"]
396
- }],
397
- "@astryx.chatToolCalls.groupLabel": [{
398
- path: "chat.toolGroup",
399
- args: ["count"]
400
- }],
401
- "@astryx.chatToolCalls.status.pending": [{ path: "chat.toolPending" }],
402
- "@astryx.chatToolCalls.status.running": [{ path: "chat.toolRunning" }],
403
- "@astryx.chatTriggerMenu.suggestions": [{ path: "chat.suggestions" }],
404
- "@astryx.citation.label": [{
405
- path: "citation.label",
406
- args: ["number", "title"]
407
- }],
408
- "@astryx.commandPalette.label": [{ path: "commandPalette.label" }],
409
- "@astryx.commandPalette.emptySearch": [
410
- { path: "commandPalette.emptySearch" },
411
- { path: "powerSearch.empty" },
412
- { path: "tokenizer.empty" },
413
- { path: "chat.noResults" }
414
- ],
415
- "@astryx.commandPalette.emptyBootstrap": [{ path: "commandPalette.emptyBootstrap" }],
416
- "@astryx.commandPalette.input.placeholder": [{ path: "commandPalette.placeholder" }],
417
- "@astryx.commandPalette.input.label": [{ path: "commandPalette.inputLabel" }],
418
- "@astryx.commandPalette.list.label": [{ path: "commandPalette.listLabel" }],
419
- "@astryx.commandPalette.loading": [{ path: "commandPalette.loading" }],
420
- "@astryx.commandPalette.noResultsFor": [{
421
- path: "commandPalette.noResultsFor",
422
- args: ["query"]
423
- }],
424
- "@astryx.commandPalette.resultCount": [{
425
- path: "commandPalette.resultCount",
426
- args: ["count"]
427
- }],
428
- "@astryx.commandPalette.footer.navigate": [{ path: "commandPalette.navigate" }],
429
- "@astryx.commandPalette.footer.select": [{ path: "commandPalette.select" }],
430
- "@astryx.commandPalette.footer.close": [{ path: "commandPalette.close" }],
431
- "@astryx.dateInput.placeholder": [{ path: "dateInput.placeholder" }],
432
- "@astryx.dateInput.dialogLabel": [{ path: "dateInput.dialogLabel" }],
433
- "@astryx.dateInput.openCalendar": [{ path: "dateInput.openCalendar" }],
434
- "@astryx.dateInput.closeCalendar": [{ path: "dateInput.closeCalendar" }],
435
- "@astryx.dateInput.clear": [
436
- {
437
- path: "dateInput.clear",
438
- args: ["label"]
439
- },
440
- {
441
- path: "dateRangeInput.clear",
442
- args: ["label"]
443
- },
444
- {
445
- path: "dateTimeInput.clear",
446
- args: ["label"]
447
- }
448
- ],
449
- "@astryx.dateInput.invalidDate": [{ path: "dateInput.invalidDate" }],
450
- "@astryx.dateRangeInput.placeholder": [{ path: "dateRangeInput.placeholder" }],
451
- "@astryx.dateRangeInput.dialogLabel": [{ path: "dateRangeInput.dialogLabel" }],
452
- "@astryx.dateTimeInput.dateTab": [{ path: "dateTimeInput.dateLabel" }],
453
- "@astryx.dateTimeInput.timeTab": [{ path: "dateTimeInput.timeLabel" }],
454
- "@astryx.dateTimeInput.timeHint12h": [{ path: "timeInput.formatHint12" }],
455
- "@astryx.dateTimeInput.timeHint24h": [{ path: "timeInput.formatHint24" }],
456
- "@astryx.dropdownMenu.back": [{ path: "dropdownMenu.back" }],
457
- "@astryx.dropdownMenu.backTo": [{
458
- path: "dropdownMenu.backTo",
459
- args: ["parent"]
460
- }],
461
- "@astryx.fileInput.placeholder": [{ path: "fileInput.placeholder" }],
462
- "@astryx.fileInput.placeholderMultiple": [{ path: "fileInput.placeholderMultiple" }],
463
- "@astryx.fileInput.required": [{ path: "fileInput.required" }],
464
- "@astryx.fileInput.fileSelected": [{
465
- path: "fileInput.fileSelected",
466
- args: ["fileName"]
467
- }],
468
- "@astryx.fileInput.filesSelected": [{
469
- path: "fileInput.filesSelected",
470
- args: ["count"]
471
- }],
472
- "@astryx.fileInput.errorInvalidType": [{
473
- path: "fileInput.errorType",
474
- args: ["fileName"]
475
- }],
476
- "@astryx.fileInput.errorMaxSize": [{
477
- path: "fileInput.errorSize",
478
- args: ["fileName", "maxSize"]
479
- }],
480
- "@astryx.fileInput.errorMaxFiles": [{
481
- path: "fileInput.errorCount",
482
- args: ["maxFiles"]
483
- }],
484
- "@astryx.selector.clearLabel": [{
485
- path: "selector.clearField",
486
- args: ["label"]
487
- }],
488
- "@astryx.multiSelector.clearAll": [{
489
- path: "multiSelector.clearAll",
490
- args: ["label"]
491
- }],
492
- "@astryx.tabList.label": [{ path: "tabList.label" }],
493
- "@astryx.inputClearButton.tooltip": [
494
- { path: "fileInput.clear" },
495
- { path: "selector.clear" },
496
- { path: "multiSelector.clear" }
497
- ],
498
- "@astryx.input.statusButton.error": [{ path: "input.statusError" }],
499
- "@astryx.input.statusButton.warning": [{ path: "input.statusWarning" }],
500
- "@astryx.input.statusButton.success": [{ path: "input.statusSuccess" }],
501
- "@astryx.input.readOnly": [{ path: "selector.readOnly" }, { path: "multiSelector.readOnly" }],
502
- "@astryx.button.loading": [
503
- { path: "checkboxList.loading" },
504
- { path: "selector.loading" },
505
- { path: "multiSelector.loading" },
506
- { path: "dateInput.loading" }
507
- ],
508
- "@astryx.appShell.skipToContent": [{ path: "layout.skipToContent" }],
509
- "@astryx.resizable.handle.label": [{ path: "layout.resizeHandle" }],
510
- "@astryx.resizable.collapsed": [{ path: "layout.collapsed" }],
511
- "@astryx.appShell.mobileNavigation": [{ path: "layout.mobileNavigation" }],
512
- "@astryx.lightbox.close": [{ path: "lightbox.close" }],
513
- "@astryx.lightbox.previous": [{ path: "lightbox.previous" }],
514
- "@astryx.lightbox.next": [{ path: "lightbox.next" }],
515
- "@astryx.lightbox.mediaViewer": [{ path: "lightbox.mediaViewer" }],
516
- "@astryx.lightbox.zoom": [{ path: "lightbox.zoom" }],
517
- "@astryx.lightbox.zoomedIn": [{ path: "lightbox.zoomedIn" }],
518
- "@astryx.lightbox.zoomedOut": [{ path: "lightbox.zoomedOut" }],
519
- "@astryx.lightbox.imagePosition": [{
520
- path: "lightbox.imagePosition",
521
- args: ["index", "total"]
522
- }],
523
- "@astryx.lightbox.mediaPosition": [{
524
- path: "lightbox.mediaPosition",
525
- args: [
526
- "alt",
527
- "index",
528
- "total"
529
- ]
530
- }],
531
- "@astryx.markdownHeadingLinks.copy": [{
532
- path: "markdown.headingLink",
533
- args: ["heading"]
534
- }],
535
- "@astryx.markdown.taskList": [{ path: "markdown.taskList" }],
536
- "@astryx.metadataList.showMore": [{ path: "metadataList.showMore" }],
537
- "@astryx.metadataList.showLess": [{ path: "metadataList.showLess" }],
538
- "@astryx.multiSelector.selectPlaceholder": [{ path: "multiSelector.placeholder" }],
539
- "@astryx.multiSelector.searchPlaceholder": [{ path: "multiSelector.search" }],
540
- "@astryx.multiSelector.empty": [{ path: "multiSelector.empty" }],
541
- "@astryx.multiSelector.emptySearchResults": [{ path: "multiSelector.emptySearch" }],
542
- "@astryx.multiSelector.selectAll": [{ path: "multiSelector.selectAll" }],
543
- "@astryx.multiSelector.resultCount": [{
544
- path: "multiSelector.resultCount",
545
- args: ["count"]
546
- }],
547
- "@astryx.multiSelector.createOption": [{
548
- path: "multiSelector.create",
549
- args: ["query"]
550
- }, {
551
- path: "tokenizer.create",
552
- args: ["query"]
553
- }],
554
- "@astryx.multiSelector.optionCreated": [{
555
- path: "multiSelector.created",
556
- args: ["label"]
557
- }],
558
- "@astryx.table.selection.selectedCount": [{
559
- path: "table.selectedCount",
560
- args: ["count"]
561
- }, {
562
- path: "multiSelector.selected",
563
- args: ["count"]
564
- }],
565
- "@astryx.sideNav.label": [{ path: "nav.sideNav" }],
566
- "@astryx.topNav.landmarkLabel": [{ path: "nav.topNav" }],
567
- "@astryx.mobileNav.navigation": [{ path: "nav.mobileNav" }],
568
- "@astryx.sideNavCollapseButton.collapseSidebar": [{ path: "nav.collapseSidebar" }],
569
- "@astryx.sideNavCollapseButton.expandSidebar": [{ path: "nav.expandSidebar" }],
570
- "@astryx.sideNav.heading.openMenu": [{ path: "nav.openMenu" }],
571
- "@astryx.mobileNav.toggle.open": [{ path: "nav.openNavigation" }],
572
- "@astryx.mobileNav.closeNavigation": [{ path: "nav.close" }],
573
- "@astryx.avatarGroup.overflow": [{
574
- path: "nav.avatarOverflow",
575
- args: ["count"]
576
- }],
577
- "@astryx.avatar.nameWithStatus": [{
578
- path: "nav.avatarNameWithStatus",
579
- args: ["name", "status"]
580
- }],
581
- "@astryx.sideNavItem.expand": [{
582
- path: "nav.expandItem",
583
- args: ["label"]
584
- }],
585
- "@astryx.sideNavItem.collapse": [{
586
- path: "nav.collapseItem",
587
- args: ["label"]
588
- }],
589
- "@astryx.sideNavItem.submenuLabel": [{
590
- path: "nav.submenu",
591
- args: ["label"]
592
- }],
593
- "@astryx.numberInput.incrementLabel": [{
594
- path: "numberInput.increment",
595
- args: ["label"]
596
- }],
597
- "@astryx.numberInput.decrementLabel": [{
598
- path: "numberInput.decrement",
599
- args: ["label"]
600
- }],
601
- "@astryx.outline.label": [{ path: "outline.label" }],
602
- "@astryx.powersearch.label": [{ path: "powerSearch.label" }],
603
- "@astryx.powersearch.placeholder": [{ path: "powerSearch.placeholder" }],
604
- "@astryx.powersearch.resultCount": [{
605
- path: "powerSearch.resultCount",
606
- args: ["count"]
607
- }],
608
- "@astryx.powersearch.valueEditor.itemsCount": [{
609
- path: "powerSearch.itemsCount",
610
- args: ["count"]
611
- }],
612
- "@astryx.powersearch.valueEditor.entitiesCount": [{
613
- path: "powerSearch.entitiesCount",
614
- args: ["count"]
615
- }],
616
- "@astryx.powersearch.valueEditor.filtersCount": [{
617
- path: "powerSearch.filtersCount",
618
- args: ["count"]
619
- }],
620
- "@astryx.powersearch.valueEditor.dateRange": [{ path: "powerSearch.dateRange" }],
621
- "@astryx.powersearch.editor.field": [{ path: "powerSearch.editor.field" }],
622
- "@astryx.powersearch.editor.operator": [{ path: "powerSearch.editor.operator" }],
623
- "@astryx.powersearch.editor.addFilter": [{ path: "powerSearch.editor.addFilter" }],
624
- "@astryx.powersearch.editor.removeFilter": [{ path: "powerSearch.editor.removeFilter" }],
625
- "@astryx.powersearch.editor.group": [{ path: "powerSearch.editor.group" }],
626
- "@astryx.powersearch.editor.delete": [{ path: "powerSearch.editor.delete" }],
627
- "@astryx.powersearch.editor.cancel": [{ path: "powerSearch.editor.cancel" }],
628
- "@astryx.powersearch.editor.apply": [{ path: "powerSearch.editor.apply" }],
629
- ...operatorTargets(),
630
- ...valueTargets(),
631
- "@astryx.selector.placeholder": [{ path: "selector.placeholder" }],
632
- "@astryx.selector.searchPlaceholder": [{ path: "selector.search" }],
633
- "@astryx.selector.empty": [{ path: "selector.empty" }],
634
- "@astryx.selector.emptySearchResults": [{ path: "selector.emptySearch" }],
635
- "@astryx.selector.resultCount": [{
636
- path: "selector.resultCount",
637
- args: ["count"]
638
- }],
639
- "@astryx.stepper.label": [{ path: "stepper.progress" }],
640
- "@astryx.step.optional": [{ path: "stepper.optional" }],
641
- "@astryx.stepper.previousStep": [{ path: "stepper.previous" }],
642
- "@astryx.stepper.nextStep": [{ path: "stepper.next" }],
643
- "@astryx.step.status.completed": [{ path: "stepper.status.completed" }],
644
- "@astryx.step.status.warning": [{ path: "stepper.status.warning" }],
645
- "@astryx.step.status.error": [{ path: "stepper.status.error" }],
646
- "@astryx.table.label": [{ path: "table.label" }],
647
- "@astryx.table.noData": [{ path: "table.noData" }],
648
- "@astryx.table.filter.allPlaceholder": [{ path: "table.filterAll" }],
649
- "@astryx.table.filter.reset": [{ path: "table.reset" }],
650
- "@astryx.table.filter.apply": [{ path: "table.apply" }],
651
- "@astryx.table.selection.selectAllRows": [{ path: "table.selectAllRows" }],
652
- "@astryx.table.selection.selectRow": [{ path: "table.selectRow" }],
653
- "@astryx.table.selection.selectRowNamed": [{
654
- path: "table.selectRowNamed",
655
- args: ["label"]
656
- }],
657
- "@astryx.table.sort.ascending": [{ path: "table.sortAscending" }],
658
- "@astryx.table.sort.descending": [{ path: "table.sortDescending" }],
659
- "@astryx.table.sort.clear": [{ path: "table.clearSort" }],
660
- "@astryx.table.sort.direction.ascending": [{ path: "table.sortedAscending" }],
661
- "@astryx.table.sort.direction.descending": [{ path: "table.sortedDescending" }],
662
- "@astryx.table.sort.sortBy": [{
663
- path: "table.sortBy",
664
- args: ["label"]
665
- }],
666
- "@astryx.table.selection.bulkActionsLabel": [{ path: "table.bulkActionsLabel" }],
667
- "@astryx.table.selection.clearAll": [{ path: "table.clearAll" }],
668
- "@astryx.table.pagination.label": [{ path: "table.paginationLabel" }],
669
- "@astryx.table.pagination.labelAbove": [{
670
- path: "table.paginationLabelAbove",
671
- args: ["label"]
672
- }],
673
- "@astryx.table.pagination.labelBelow": [{
674
- path: "table.paginationLabelBelow",
675
- args: ["label"]
676
- }],
677
- "@astryx.tableGroupedRows.expandGroup": [{
678
- path: "table.expandGroup",
679
- args: ["groupKey"]
680
- }],
681
- "@astryx.tableGroupedRows.collapseGroup": [{
682
- path: "table.collapseGroup",
683
- args: ["groupKey"]
684
- }],
685
- "@astryx.tableRowExpansion.expandRow": [{ path: "table.expandRow" }],
686
- "@astryx.tableRowExpansion.collapseRow": [{ path: "table.collapseRow" }],
687
- "@astryx.tableRowExpansion.expandAllRows": [{ path: "table.expandAllRows" }],
688
- "@astryx.tableRowExpansion.collapseAllRows": [{ path: "table.collapseAllRows" }],
689
- "@astryx.tableRowExpansion.columnHeader": [{ path: "table.rowExpansion" }],
690
- "@astryx.table.rowStatus.columnHeader": [{ path: "table.rowStatus" }],
691
- "@astryx.thumbnail.remove": [{
692
- path: "thumbnail.remove",
693
- args: ["accessibleName"]
694
- }],
695
- "@astryx.thumbnail.open": [{
696
- path: "thumbnail.open",
697
- args: ["accessibleName"]
698
- }],
699
- "@astryx.thumbnail.fallbackName": [{ path: "thumbnail.fallbackName" }],
700
- "@astryx.timeInput.placeholder": [{ path: "timeInput.placeholder" }],
701
- "@astryx.timeInput.clearLabel": [{
702
- path: "timeInput.clear",
703
- args: ["label"]
704
- }],
705
- "@astryx.timestamp.copyValue": [{
706
- path: "timestamp.copyValue",
707
- args: ["value"]
708
- }],
709
- "@astryx.timestamp.copy": [{ path: "timestamp.copy" }],
710
- "@astryx.timestamp.copied": [{ path: "timestamp.copied" }],
711
- "@astryx.timestamp.detailsLabel": [{ path: "timestamp.detailsLabel" }],
712
- "@astryx.token.remove": [{
713
- path: "token.remove",
714
- args: ["label"]
715
- }],
716
- "@astryx.tokenizer.clearAll": [{ path: "tokenizer.clear" }, { path: "powerSearch.clear" }],
717
- "@astryx.tokenizer.tokenAdded": [{
718
- path: "tokenizer.added",
719
- args: ["label"]
720
- }],
721
- "@astryx.tokenizer.tokenRemoved": [{
722
- path: "tokenizer.removed",
723
- args: ["label"]
724
- }],
725
- "@astryx.typeahead.searchPlaceholder": [{ path: "typeahead.placeholder" }],
726
- "@astryx.typeahead.emptySearchResults": [{ path: "typeahead.empty" }],
727
- "@astryx.typeahead.loading": [{ path: "typeahead.loading" }],
728
- "@astryx.typeahead.clearSelection": [{ path: "typeahead.clear" }],
729
- "@astryx.typeahead.searchResults": [
730
- { path: "typeahead.results" },
731
- { path: "tokenizer.results" },
732
- { path: "powerSearch.results" }
733
- ],
734
- "@astryx.treeList.toggleChildren": [{ path: "treeList.toggleChildren" }]
735
- };
736
- //#endregion
737
- //#region src/locale/loadCatalog.ts
738
- /**
739
- * 把一份原版 Astryx locale JSON 映射成 `AstryxMessages`。
740
- * 内置的 `en` 和 `zh-CN` 不会被改掉。返回值要交给 `provideAstryxLocale` 的第二个参数。
741
- * `unmapped` 列出每一个没写进文案树的键。
742
- */
743
- function loadAstryxCatalog(locale, catalog) {
744
- const messages = cloneMessages(astryxMessages.en);
745
- const tree = messages;
746
- const assigned = /* @__PURE__ */ new Set();
747
- const unmapped = [];
748
- const present = /* @__PURE__ */ new Set();
749
- for (const key of Object.keys(catalog).sort()) {
750
- present.add(key);
751
- const read = readMessage(catalog[key]);
752
- if (read.message == null) {
753
- unmapped.push({
754
- key,
755
- message: read.invalid,
756
- reason: "invalid-entry"
757
- });
758
- continue;
759
- }
760
- const targets = upstreamMessageMap[key];
761
- if (targets == null) {
762
- unmapped.push({
763
- key,
764
- message: read.message,
765
- reason: "no-slot"
766
- });
767
- continue;
768
- }
769
- if (!writeTargets(tree, assigned, targets, read.message, locale)) unmapped.push({
770
- key,
771
- message: read.message,
772
- reason: failureReason(targets, assigned, read.message)
773
- });
774
- }
775
- const missingKeys = Object.keys(upstreamMessageMap).filter((key) => !present.has(key)).sort();
776
- const fallbackFields = collectLeaves(tree).filter((path) => !assigned.has(path)).sort();
777
- unmapped.sort((a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0);
778
- return {
779
- locale,
780
- messages,
781
- unmapped,
782
- missingKeys,
783
- fallbackFields
784
- };
785
- }
786
- function writeTargets(tree, assigned, targets, message, locale) {
787
- let wrote = false;
788
- let names;
789
- try {
790
- names = icuPlaceholderNames(message);
791
- } catch {
792
- return false;
793
- }
794
- for (const target of targets) {
795
- if (assigned.has(target.path)) continue;
796
- const args = target.args ?? [];
797
- if (names.some((name) => !args.includes(name))) continue;
798
- let value;
799
- try {
800
- value = target.args == null ? cleanup(formatIcu(message, {}, locale)) : bindMessage(message, target.args, locale);
801
- } catch {
802
- continue;
803
- }
804
- setPath(tree, target.path, value);
805
- assigned.add(target.path);
806
- wrote = true;
807
- }
808
- return wrote;
809
- }
810
- function failureReason(targets, assigned, message) {
811
- let names;
812
- try {
813
- names = icuPlaceholderNames(message);
814
- } catch {
815
- return "unsupported-message";
816
- }
817
- const openTargets = targets.filter((target) => !assigned.has(target.path));
818
- if (openTargets.length === 0) return "slot-taken";
819
- return openTargets.some((target) => {
820
- const args = target.args ?? [];
821
- return names.some((name) => !args.includes(name));
822
- }) ? "placeholder-mismatch" : "unsupported-message";
823
- }
824
- function bindMessage(message, args, locale) {
825
- return (...values) => {
826
- const bag = {};
827
- args.forEach((name, index) => {
828
- bag[name] = coerce(values[index]);
829
- });
830
- return cleanup(formatIcu(message, bag, locale));
831
- };
832
- }
833
- function coerce(value) {
834
- if (typeof value === "number" || typeof value === "string") return value;
835
- if (value == null) return void 0;
836
- return String(value);
837
- }
838
- function cleanup(text) {
839
- return text.replace(/[ \t]{2,}/g, " ").trim();
840
- }
841
- function readMessage(entry) {
842
- if (typeof entry === "string") return { message: entry };
843
- if (entry != null && typeof entry === "object" && typeof entry.defaultMessage === "string") return { message: entry.defaultMessage };
844
- return { invalid: JSON.stringify(entry) };
845
- }
846
- function cloneMessages(source) {
847
- return cloneValue(source);
848
- }
849
- function cloneValue(value) {
850
- if (typeof value === "function" || value == null || typeof value !== "object") return value;
851
- const copy = {};
852
- for (const [key, child] of Object.entries(value)) copy[key] = cloneValue(child);
853
- return copy;
854
- }
855
- function setPath(tree, path, value) {
856
- const parts = path.split(".");
857
- let cursor = tree;
858
- for (const part of parts.slice(0, -1)) {
859
- const next = cursor[part];
860
- if (next == null || typeof next === "function" || typeof next === "string") throw new Error(`消息路径不存在:${path}`);
861
- cursor = next;
862
- }
863
- const leaf = parts[parts.length - 1];
864
- if (leaf == null || !Object.hasOwn(cursor, leaf)) throw new Error(`消息路径不存在:${path}`);
865
- cursor[leaf] = value;
866
- }
867
- function collectLeaves(tree, prefix = "") {
868
- const paths = [];
869
- for (const [key, value] of Object.entries(tree)) {
870
- const path = prefix === "" ? key : `${prefix}.${key}`;
871
- if (typeof value === "string" || typeof value === "function") paths.push(path);
872
- else paths.push(...collectLeaves(value, path));
873
- }
874
- return paths;
875
- }
876
- //#endregion
877
- export { icuPlaceholderNames as i, upstreamMessageMap as n, formatIcu as r, loadAstryxCatalog as t };