@astryx-vue/core 0.2.3 → 0.2.4

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 (303) hide show
  1. package/THIRD_PARTY_NOTICES.md +2 -0
  2. package/dist/AlertDialog/index.js +1 -1
  3. package/dist/{AlertDialog-ovx4cBjM.js → AlertDialog-B6UeBCE7.js} +2 -2
  4. package/dist/AppShell/index.d.ts +1 -1
  5. package/dist/AppShell/index.js +1 -1
  6. package/dist/{AppShell-Dd-D4bA2.js → AppShell-CeBmB0Q9.js} +2 -2
  7. package/dist/Avatar/index.d.ts +1 -1
  8. package/dist/Avatar/index.js +1 -1
  9. package/dist/{Avatar-jmHInHwj.js → Avatar-BB4Z4LF1.js} +10 -4
  10. package/dist/AvatarGroup/index.d.ts +1 -1
  11. package/dist/Banner/index.d.ts +1 -1
  12. package/dist/BottomSheet/index.d.ts +2 -2
  13. package/dist/BottomSheet/index.js +3 -2
  14. package/dist/{BottomSheet-Dg95HB1s.js → BottomSheet-BV6vfgGu.js} +82 -22
  15. package/dist/BottomSheet-o7xw-TOi.js +153 -0
  16. package/dist/Breadcrumbs/index.d.ts +2 -2
  17. package/dist/Breadcrumbs/index.js +2 -2
  18. package/dist/{Breadcrumbs-CWGfgLNK.js → Breadcrumbs-D6G7f5WL.js} +1 -1
  19. package/dist/Button/index.d.ts +1 -1
  20. package/dist/ButtonGroup/index.d.ts +1 -1
  21. package/dist/Calendar/index.d.ts +1 -1
  22. package/dist/Calendar/index.js +1 -1
  23. package/dist/{Calendar-CnOsSjMY.js → Calendar-DmTeM7PO.js} +2 -2
  24. package/dist/Card/index.d.ts +1 -1
  25. package/dist/Carousel/index.js +1 -1
  26. package/dist/{Carousel-JA7ilqI_.js → Carousel-CIKrcA2r.js} +1 -1
  27. package/dist/Chat/index.d.ts +1 -1
  28. package/dist/Chat/index.js +1 -1
  29. package/dist/{Chat-C7WrCOE4.js → Chat-BFox3u9D.js} +1 -1
  30. package/dist/CheckboxInput/index.d.ts +1 -1
  31. package/dist/CheckboxList/index.d.ts +1 -1
  32. package/dist/CheckboxList/index.js +1 -1
  33. package/dist/{CheckboxList-CnCGnkZk.js → CheckboxList-BlPf7vPe.js} +4 -4
  34. package/dist/Citation/index.js +1 -1
  35. package/dist/{Citation-CtwrU33I.js → Citation-BG-vg9ia.js} +1 -1
  36. package/dist/ClickableCard/index.d.ts +1 -1
  37. package/dist/Code/index.d.ts +3 -3
  38. package/dist/Code/index.js +4 -4
  39. package/dist/{Code-BvefYRpx.js → Code-XnPuGxey.js} +1 -1
  40. package/dist/{CodeBlock-BZGzYeoL.js → CodeBlock-B2pnEOJY.js} +145 -15
  41. package/dist/Collapsible/index.d.ts +1 -1
  42. package/dist/CommandPalette/index.js +1 -1
  43. package/dist/{CommandPalette-BNbM9T9y.js → CommandPalette-DKgHzmJk.js} +10 -10
  44. package/dist/ComplexSelector/index.js +1 -1
  45. package/dist/{ComplexSelector-LtbLlrcj.js → ComplexSelector-Dv44FFhN.js} +1 -1
  46. package/dist/ContextMenu/index.d.ts +2 -2
  47. package/dist/ContextMenu/index.js +2 -2
  48. package/dist/{ContextMenu-DVQl0xL5.js → ContextMenu-BeJO5HYx.js} +4 -369
  49. package/dist/DateInput/index.d.ts +1 -1
  50. package/dist/DateInput/index.js +1 -1
  51. package/dist/{DateInput-zm8sNc0t.js → DateInput-D4XFAEMp.js} +3 -3
  52. package/dist/DateRangeInput/index.d.ts +1 -1
  53. package/dist/DateRangeInput/index.js +1 -1
  54. package/dist/{DateRangeInput-DlVFzrf7.js → DateRangeInput-Cp6AZfew.js} +2 -2
  55. package/dist/DateTimeInput/index.d.ts +1 -1
  56. package/dist/DateTimeInput/index.js +1 -1
  57. package/dist/{DateTimeInput-C7Z-p6Yd.js → DateTimeInput-B6MPPp76.js} +3 -3
  58. package/dist/Dialog/index.d.ts +1 -1
  59. package/dist/Divider/index.d.ts +1 -1
  60. package/dist/DropdownMenu/index.d.ts +2 -2
  61. package/dist/DropdownMenu/index.js +3 -3
  62. package/dist/{DropdownMenu-BoZChdev.js → DropdownMenu--lnUeJEG.js} +3 -3
  63. package/dist/{DropdownMenu-u1psFjis.js → DropdownMenu-6E9jFdFe.js} +4 -4
  64. package/dist/{DropdownMenuRadioItem.vue-uVM0FD2f.d.ts → DropdownMenuRadioItem.vue-CXEURBcq.d.ts} +1 -1
  65. package/dist/EmptyState/index.js +1 -1
  66. package/dist/{EmptyState-CUJdTYKV.js → EmptyState-0RWymQUS.js} +2 -2
  67. package/dist/FileInput/index.d.ts +1 -1
  68. package/dist/FileInput/index.js +1 -1
  69. package/dist/{FileInput-QdlZn7qK.js → FileInput-DuNwdbAo.js} +1 -1
  70. package/dist/Grid/index.d.ts +1 -1
  71. package/dist/Heading/index.d.ts +2 -2
  72. package/dist/Heading/index.js +1 -1
  73. package/dist/Heading-B9C3LZlS.js +94 -0
  74. package/dist/Indicator/index.d.ts +2 -2
  75. package/dist/InputGroup/index.d.ts +1 -1
  76. package/dist/Item-DrYJL1TG.js +590 -0
  77. package/dist/Lightbox/index.js +1 -1
  78. package/dist/{Lightbox-BSzfqZ-u.js → Lightbox-Br3o0SyQ.js} +1 -1
  79. package/dist/Link/index.d.ts +3 -2
  80. package/dist/Link/index.js +1 -1
  81. package/dist/Link-DCZ6922-.js +196 -0
  82. package/dist/List/index.d.ts +3 -3
  83. package/dist/List/index.js +2 -2
  84. package/dist/{ListItem-pGxvn6QJ.js → ListItem-CcRHWuEm.js} +8 -2
  85. package/dist/Markdown/index.d.ts +2 -2
  86. package/dist/Markdown/index.js +2 -2
  87. package/dist/{Markdown-B6tSqenv.js → Markdown-Bz0R3kNj.js} +274 -30
  88. package/dist/MetadataList/index.js +1 -1
  89. package/dist/{MetadataList-aN1tRn6W.js → MetadataList-CFaocx6j.js} +1 -1
  90. package/dist/MobileNav/index.js +1 -1
  91. package/dist/{MobileNavToggle-fqcSafkc.js → MobileNavToggle-Dh3uLivq.js} +1 -1
  92. package/dist/MoreMenu/index.d.ts +1 -1
  93. package/dist/MoreMenu/index.js +1 -1
  94. package/dist/{MoreMenu-B3brqdK_.js → MoreMenu-B95nRSe8.js} +2 -2
  95. package/dist/MultiSelector/index.d.ts +1 -1
  96. package/dist/MultiSelector/index.js +1 -1
  97. package/dist/{MultiSelector-BD5PMgez.js → MultiSelector-DuF5TECE.js} +4 -4
  98. package/dist/{NavDisclosure-DbYLDXK0.js → NavDisclosure-C6sPZ89n.js} +4 -1
  99. package/dist/NavHeadingSurface-Cb3x9iDx.js +287 -0
  100. package/dist/NavItem/index.d.ts +1 -1
  101. package/dist/NavMenu/index.d.ts +2 -2
  102. package/dist/NavMenu/index.js +4 -3
  103. package/dist/NavMenu-ClIgMaxE.js +176 -0
  104. package/dist/{NavMenuItem-DrwIMHKO.js → NavMenuItem-E7S8gBh-.js} +1 -1
  105. package/dist/NumberInput/index.d.ts +1 -1
  106. package/dist/NumberInput/index.js +1 -1
  107. package/dist/{NumberInput-CBeU4lEl.js → NumberInput-B4IL3s_8.js} +1 -1
  108. package/dist/Outline/index.js +1 -1
  109. package/dist/{Outline--HVMSB6i.js → Outline-DBUuchi9.js} +1 -1
  110. package/dist/OverflowList/index.d.ts +1 -1
  111. package/dist/OverflowList/index.js +1 -1
  112. package/dist/{OverflowList-FMh7r-r_.js → OverflowList-aDd_oem0.js} +3 -3
  113. package/dist/Pagination/index.d.ts +1 -1
  114. package/dist/Pagination/index.js +1 -1
  115. package/dist/{Pagination-DlIvESjx.js → Pagination-CNe9F6Fl.js} +181 -45
  116. package/dist/Popover/index.d.ts +1 -1
  117. package/dist/PowerSearch/index.d.ts +1 -1
  118. package/dist/PowerSearch/index.js +1 -1
  119. package/dist/{PowerSearch-CMG7Rb69.js → PowerSearch-C6U8Sq1Y.js} +13 -13
  120. package/dist/ProgressBar/index.d.ts +2 -2
  121. package/dist/ProgressBar/index.js +1 -1
  122. package/dist/{ProgressBar-DO9Chic6.js → ProgressBar-DF6WZNCI.js} +45 -6
  123. package/dist/Radio/index.d.ts +1 -1
  124. package/dist/RadioList/index.d.ts +1 -1
  125. package/dist/Resizable/index.js +1 -1
  126. package/dist/{Resizable-CXpvj1TZ.js → ResizeHandle-DYy0e3v9.js} +1 -1
  127. package/dist/ScrollableArea/index.d.ts +1 -1
  128. package/dist/SegmentedControl/index.d.ts +1 -1
  129. package/dist/SelectableCard/index.d.ts +1 -1
  130. package/dist/Selector/index.d.ts +1 -1
  131. package/dist/Selector/index.js +1 -1
  132. package/dist/{Selector-BpPnuWH3.js → Selector-5N-hq2nF.js} +3 -3
  133. package/dist/SideNav/index.d.ts +2 -2
  134. package/dist/SideNav/index.js +1 -1
  135. package/dist/{SideNav-D4TupqgE.js → SideNav-CT9lfspi.js} +225 -229
  136. package/dist/Stack/index.d.ts +1 -1
  137. package/dist/Stepper/index.d.ts +1 -1
  138. package/dist/Stepper/index.js +1 -1
  139. package/dist/{Stepper-H-6-T5Ps.js → Stepper-BqhVCgC-.js} +1 -1
  140. package/dist/Switch/index.d.ts +1 -1
  141. package/dist/TabList/index.d.ts +1 -1
  142. package/dist/Table/index.js +1 -1
  143. package/dist/{Table-nqA_njNz.js → Table-CsdH8fCB.js} +4 -4
  144. package/dist/Text/index.d.ts +3 -3
  145. package/dist/Text/index.js +1 -1
  146. package/dist/Text-DIzZw6FA.js +86 -0
  147. package/dist/TextArea/index.d.ts +1 -1
  148. package/dist/TextInput/index.d.ts +1 -1
  149. package/dist/Theme/index.d.ts +3 -3
  150. package/dist/Theme/index.js +2 -2
  151. package/dist/Theme-CtaUWo4g.js +1246 -0
  152. package/dist/Thumbnail/index.js +1 -1
  153. package/dist/{Thumbnail-CXb3m_Hv.js → Thumbnail-BnQwX1cQ.js} +2 -2
  154. package/dist/{TimeField-B3cndWb0.js → TimeField-Biiuv0hB.js} +1 -1
  155. package/dist/TimeInput/index.d.ts +1 -1
  156. package/dist/TimeInput/index.js +1 -1
  157. package/dist/{TimeInput-BHQ_LKGm.js → TimeInput-C9gptCOK.js} +1 -1
  158. package/dist/Timer/index.d.ts +1 -1
  159. package/dist/Timer/index.js +1 -1
  160. package/dist/{Timer-B7GV6hqd.js → Timer-kxzQx3tp.js} +1 -1
  161. package/dist/Timestamp/index.d.ts +1 -1
  162. package/dist/Timestamp/index.js +1 -1
  163. package/dist/{Timestamp-Cfuxbb3i.js → Timestamp-D7bd_nF3.js} +2 -2
  164. package/dist/ToggleButton/index.d.ts +1 -1
  165. package/dist/Token/index.d.ts +1 -1
  166. package/dist/Token/index.js +1 -1
  167. package/dist/{Token-CdVLH0_H.js → Token-D2GsI_Ei.js} +1 -1
  168. package/dist/Tokenizer/index.js +1 -1
  169. package/dist/{Tokenizer-DlD-S_8-.js → Tokenizer-rwzamZg4.js} +3 -3
  170. package/dist/Toolbar/index.d.ts +1 -1
  171. package/dist/Tooltip/index.d.ts +1 -1
  172. package/dist/Tooltip/index.js +1 -1
  173. package/dist/{Tooltip-mp0NMh_Y.js → Tooltip-C2fh9anJ.js} +23 -8
  174. package/dist/TopNav/index.d.ts +1 -1
  175. package/dist/TopNav/index.js +1 -1
  176. package/dist/{TopNav-DzV874G7.js → TopNav-arWFLTBM.js} +112 -42
  177. package/dist/TreeList/index.js +1 -1
  178. package/dist/{TreeList-DEwvlZRV.js → TreeList-C9xvMpJZ.js} +1 -1
  179. package/dist/Typeahead/index.d.ts +2 -2
  180. package/dist/Typeahead/index.js +3 -2
  181. package/dist/Typeahead-_V11btpv.js +499 -0
  182. package/dist/{TypeaheadMenu-CGvo0Tud.js → TypeaheadMenu-BEObzonz.js} +46 -10
  183. package/dist/composables/index.d.ts +2 -2
  184. package/dist/composables/index.js +4 -4
  185. package/dist/composables-CWw6t-RJ.js +520 -0
  186. package/dist/{context-DmOLCubj.js → context-CPh7kE-a.js} +58 -10
  187. package/dist/{index-BRfR0lhb.d.ts → index-12QYAbiz.d.ts} +1 -1
  188. package/dist/{index-DMQG6kdM.d.ts → index-6yB8BtEu.d.ts} +2 -2
  189. package/dist/{index-f4NGT-e2.d.ts → index-B4OOtNP8.d.ts} +3 -3
  190. package/dist/index-BBtJt5_A.d.ts +26 -0
  191. package/dist/{index-Ch6BbxCP.d.ts → index-BH9PzQ1F.d.ts} +13 -8
  192. package/dist/{index-MPcg1Pm4.d.ts → index-BKr7yvVv.d.ts} +1 -1
  193. package/dist/{index-D_UEJIU5.d.ts → index-BPwD6aBv.d.ts} +1 -1
  194. package/dist/{index-D1Twv_fL.d.ts → index-BcZI402h.d.ts} +4 -4
  195. package/dist/{index-C8wDPDcP.d.ts → index-Bi49IrAJ.d.ts} +50 -8
  196. package/dist/{index-B1x05arQ.d.ts → index-BlOIC_AM.d.ts} +1 -1
  197. package/dist/{index-C5p2NeCr.d.ts → index-Blm197N_.d.ts} +11 -2
  198. package/dist/{index-Bu3oXIIS.d.ts → index-BmmdzwT9.d.ts} +6 -0
  199. package/dist/{index-BMn9ghAX.d.ts → index-Bu0Zd1uw.d.ts} +3 -3
  200. package/dist/{index-Ctu32CLv.d.ts → index-BxhJqiZ7.d.ts} +2 -2
  201. package/dist/{index-CA6RbRWx.d.ts → index-By2mSzUA.d.ts} +1 -1
  202. package/dist/{index-HV6W3xCx.d.ts → index-Byar3h1e.d.ts} +1 -1
  203. package/dist/{index-LIyvJTW3.d.ts → index-C3GaPqvJ.d.ts} +84 -8
  204. package/dist/{index-DAiGhkNZ.d.ts → index-CFIXnk5D.d.ts} +1 -1
  205. package/dist/{index-ViSV0RBx.d.ts → index-CI9kyg74.d.ts} +12 -2
  206. package/dist/{index-C-QpeUlQ.d.ts → index-CNjbOgty.d.ts} +2 -2
  207. package/dist/{index-BB5yVIN-.d.ts → index-CUCcYKxl.d.ts} +3 -3
  208. package/dist/{index-Ca8VIE4l.d.ts → index-CVn0GBdB.d.ts} +1 -1
  209. package/dist/{index-xfkEuGLY.d.ts → index-CZeoAr0a.d.ts} +2 -2
  210. package/dist/{index-C2sfHfBw.d.ts → index-D-ezcKaY.d.ts} +3 -3
  211. package/dist/{index-BcJBLWJ0.d.ts → index-DA52oIdw.d.ts} +2 -2
  212. package/dist/{index-D7-WTV6I.d.ts → index-D_nYxnNv.d.ts} +1 -1
  213. package/dist/{index-Cm_TiLXU.d.ts → index-Dgg0bHVM.d.ts} +7 -3
  214. package/dist/index-DxR1FChm.d.ts +158 -0
  215. package/dist/{index-BTAgQRP0.d.ts → index-EtZgovdH.d.ts} +169 -81
  216. package/dist/{index-B9f1rUEv.d.ts → index-XuAAcYiP.d.ts} +1 -1
  217. package/dist/{index-D0TlUOtG.d.ts → index-YmSe1ujk.d.ts} +76 -3
  218. package/dist/{index-BMrggCw-.d.ts → index-bvr3WHvs.d.ts} +1 -1
  219. package/dist/{index-CDDMDHJM.d.ts → index-c67ca7eJ.d.ts} +1 -1
  220. package/dist/{index-D8o50qOE.d.ts → index-cL3q7O4R.d.ts} +32 -3
  221. package/dist/{index-CGZ2xi3r.d.ts → index-eshFLli0.d.ts} +40 -3
  222. package/dist/{index-DkVEBdWa.d.ts → index-fa72tWIU.d.ts} +2 -2
  223. package/dist/{index-COxy6LEW.d.ts → index-gW0HW02U.d.ts} +1 -1
  224. package/dist/{index-foQMNKZO.d.ts → index-hCpxKePE.d.ts} +49 -3
  225. package/dist/{index-DxsKyAxq.d.ts → index-vizlhXVs.d.ts} +131 -2
  226. package/dist/{index-DfgHJE7H.d.ts → index-z3uLM1O6.d.ts} +153 -24
  227. package/dist/index.d.ts +81 -80
  228. package/dist/index.js +118 -115
  229. package/dist/locale/index.d.ts +2 -2
  230. package/dist/locale/index.js +3 -3
  231. package/dist/locale-sLw5Caia.js +917 -0
  232. package/dist/{searchResultMessage-DN0HeRRB.js → searchResultMessage-CCnq-_ce.js} +1 -1
  233. package/dist/syntaxTheme-CwVEcVDk.d.ts +57 -0
  234. package/dist/{syntaxTheme-ClpWALZX.js → syntaxTheme-R7xnu5x5.js} +24 -3
  235. package/dist/{types-Bt-lSgYX.d.ts → types-D9nP_X-c.d.ts} +14 -1
  236. package/dist/{types-CAZY4Xua.d.ts → types-DGYHIu4I.d.ts} +30 -1
  237. package/dist/types-D_J66aPN.d.ts +85 -0
  238. package/dist/types-gKsEkk2g.d.ts +320 -0
  239. package/dist/{useMenuDrillIn-OaEwjK44.js → useMenuDrillIn-BgjJcY3K.js} +1 -1
  240. package/dist/useMenuPress-DUmEy4TB.js +425 -0
  241. package/dist/{composables-DDI08XFF.js → useResizable-B3ahKLoZ.js} +73 -248
  242. package/dist/useTruncation-B5qXQzAP.js +53 -0
  243. package/locales/SOURCE.json +37 -0
  244. package/locales/af-ZA.json +1482 -0
  245. package/locales/ar-SA.json +1482 -0
  246. package/locales/ca-ES.json +1482 -0
  247. package/locales/cs-CZ.json +1482 -0
  248. package/locales/da-DK.json +1482 -0
  249. package/locales/de-DE.json +1482 -0
  250. package/locales/el-GR.json +1482 -0
  251. package/locales/en.json +1646 -0
  252. package/locales/es-ES.json +1482 -0
  253. package/locales/fi-FI.json +1482 -0
  254. package/locales/fr-FR.json +1482 -0
  255. package/locales/he-IL.json +1482 -0
  256. package/locales/hu-HU.json +1482 -0
  257. package/locales/it-IT.json +1482 -0
  258. package/locales/ja-JP.json +1482 -0
  259. package/locales/ko-KR.json +1482 -0
  260. package/locales/nl-NL.json +1482 -0
  261. package/locales/no-NO.json +1482 -0
  262. package/locales/pl-PL.json +1482 -0
  263. package/locales/pt-BR.json +1482 -0
  264. package/locales/pt-PT.json +1482 -0
  265. package/locales/ro-RO.json +1482 -0
  266. package/locales/ru-RU.json +1482 -0
  267. package/locales/sr-SP.json +1482 -0
  268. package/locales/sv-SE.json +1482 -0
  269. package/locales/tr-TR.json +1482 -0
  270. package/locales/uk-UA.json +1482 -0
  271. package/locales/vi-VN.json +1482 -0
  272. package/locales/zh-CN.json +1482 -0
  273. package/locales/zh-TW.json +1482 -0
  274. package/package.json +3 -1
  275. package/styles/bottom-sheet.css +27 -0
  276. package/styles/code.css +62 -0
  277. package/styles/container-reveal.css +104 -0
  278. package/styles/heading.css +47 -0
  279. package/styles/keyboard-hint.css +28 -0
  280. package/styles/link.css +34 -0
  281. package/styles/list.css +88 -1
  282. package/styles/markdown.css +12 -0
  283. package/styles/pagination.css +30 -0
  284. package/styles/progress-bar.css +49 -0
  285. package/styles/side-nav.css +36 -1
  286. package/styles/text.css +18 -0
  287. package/styles/top-nav.css +145 -6
  288. package/styles/typeahead.css +24 -0
  289. package/styles.css +2 -0
  290. package/dist/Heading-Dugosn6j.js +0 -43
  291. package/dist/Item-C1z6gXn8.js +0 -289
  292. package/dist/Link-DqdQZ37C.js +0 -141
  293. package/dist/Text-BHVghsWo.js +0 -53
  294. package/dist/Theme-CejS9MHm.js +0 -447
  295. package/dist/Typeahead-DQ3tmqYe.js +0 -375
  296. package/dist/index-Bqb_Fyju.d.ts +0 -80
  297. package/dist/index-Dg3ZmwEg.d.ts +0 -75
  298. package/dist/locale-CCwVnyMZ.js +0 -42
  299. package/dist/syntaxTheme-Bcs1YMF7.d.ts +0 -38
  300. package/dist/types-jmqqnkKA.d.ts +0 -163
  301. package/dist/useHotkeys-dABSK1o9.js +0 -80
  302. package/dist/useLongPress-Cyxwa73s.js +0 -60
  303. package/dist/{index-BXkNZF3q.d.ts → index-IdK2g5B4.d.ts} +2 -2
@@ -0,0 +1,917 @@
1
+ import { a as useAstryxLocale, s as astryxMessages } from "./context-CPh7kE-a.js";
2
+ import { computed, toValue } from "vue";
3
+ //#region src/locale/format.ts
4
+ const weekdayStart = new Date(2023, 0, 1);
5
+ /** CLDR stand-alone short names. Intl `short` is Sun/Mon, which is not the calendar header. */
6
+ const standaloneShortWeekdays = {
7
+ "en": [
8
+ "Su",
9
+ "Mo",
10
+ "Tu",
11
+ "We",
12
+ "Th",
13
+ "Fr",
14
+ "Sa"
15
+ ],
16
+ "zh-CN": [
17
+ "周日",
18
+ "周一",
19
+ "周二",
20
+ "周三",
21
+ "周四",
22
+ "周五",
23
+ "周六"
24
+ ]
25
+ };
26
+ function standaloneShortWeekdayNames(locale) {
27
+ if (locale === "en" || locale === "zh-CN") return standaloneShortWeekdays[locale];
28
+ return weekdayNames(locale, "short");
29
+ }
30
+ function formatCalendarMonth(year, month, locale) {
31
+ return new Intl.DateTimeFormat(locale, {
32
+ month: "long",
33
+ year: "numeric"
34
+ }).format(new Date(year, month - 1, 1));
35
+ }
36
+ function weekdayNames(locale, style) {
37
+ const formatter = new Intl.DateTimeFormat(locale, { weekday: style });
38
+ return Array.from({ length: 7 }, (_, index) => {
39
+ const date = new Date(weekdayStart);
40
+ date.setDate(weekdayStart.getDate() + index);
41
+ return formatter.format(date);
42
+ });
43
+ }
44
+ //#endregion
45
+ //#region src/locale/icu.ts
46
+ const pluralRules = /* @__PURE__ */ new Map();
47
+ const ordinalRules = /* @__PURE__ */ new Map();
48
+ const numberFormats = /* @__PURE__ */ new Map();
49
+ function rulesFor(locale, ordinal) {
50
+ const cache = ordinal ? ordinalRules : pluralRules;
51
+ let rules = cache.get(locale);
52
+ if (rules == null) {
53
+ rules = new Intl.PluralRules(locale, ordinal ? { type: "ordinal" } : void 0);
54
+ cache.set(locale, rules);
55
+ }
56
+ return rules;
57
+ }
58
+ function numberFor(locale) {
59
+ let format = numberFormats.get(locale);
60
+ if (format == null) {
61
+ format = new Intl.NumberFormat(locale);
62
+ numberFormats.set(locale, format);
63
+ }
64
+ return format;
65
+ }
66
+ /**
67
+ * 解析原版目录里的 ICU MessageFormat。
68
+ * 覆盖 `{name}`、`{name, number}`、`plural`、`selectordinal` 和 `select`。
69
+ * 解析失败时抛错,调用方负责把这个键记进未映射列表。
70
+ */
71
+ function formatIcu(message, values, locale) {
72
+ return render(parseMessage(message), values, locale, void 0);
73
+ }
74
+ function icuPlaceholderNames(message) {
75
+ const names = /* @__PURE__ */ new Set();
76
+ collectNames(parseMessage(message), names);
77
+ return [...names];
78
+ }
79
+ function collectNames(nodes, names) {
80
+ for (const node of nodes) {
81
+ if (node.type === "arg" || node.type === "number" || node.type === "plural" || node.type === "select") names.add(node.name);
82
+ if (node.type === "plural" || node.type === "select") for (const option of node.options) collectNames(option.nodes, names);
83
+ }
84
+ }
85
+ function render(nodes, values, locale, pound) {
86
+ let text = "";
87
+ for (const node of nodes) text += renderNode(node, values, locale, pound);
88
+ return text;
89
+ }
90
+ function renderNode(node, values, locale, pound) {
91
+ if (node.type === "text") return node.value;
92
+ if (node.type === "pound") return pound == null ? "" : numberFor(locale).format(pound);
93
+ if (node.type === "arg") return textValue(values[node.name]);
94
+ if (node.type === "number") {
95
+ const value = numericValue(values[node.name]);
96
+ return value == null ? "" : numberFor(locale).format(value);
97
+ }
98
+ if (node.type === "select") return renderChoice(node.options, selectSelector(values[node.name]), values, locale, pound);
99
+ const value = numericValue(values[node.name]);
100
+ const rounded = value == null ? void 0 : value - node.offset;
101
+ const selector = value == null ? "other" : pluralSelector(value, node.options, locale, node.ordinal);
102
+ return renderChoice(node.options, selector, values, locale, rounded);
103
+ }
104
+ function pluralSelector(value, options, locale, ordinal) {
105
+ const exact = exactSelector(value);
106
+ if (exact != null && options.some((option) => option.selector === exact)) return exact;
107
+ return rulesFor(locale, ordinal).select(value);
108
+ }
109
+ function renderChoice(options, selector, values, locale, pound) {
110
+ const match = options.find((option) => option.selector === selector) ?? options.find((option) => option.selector === "other") ?? options[0];
111
+ return match == null ? "" : render(match.nodes, values, locale, pound);
112
+ }
113
+ function textValue(value) {
114
+ if (value == null) return "";
115
+ return typeof value === "number" ? String(value) : value;
116
+ }
117
+ function numericValue(value) {
118
+ if (typeof value === "number" && Number.isFinite(value)) return value;
119
+ if (typeof value === "string" && value.trim() !== "") {
120
+ const parsed = Number(value);
121
+ if (Number.isFinite(parsed)) return parsed;
122
+ }
123
+ }
124
+ function exactSelector(value) {
125
+ return Number.isInteger(value) ? `=${value}` : void 0;
126
+ }
127
+ function selectSelector(value) {
128
+ if (value == null) return "other";
129
+ return String(value);
130
+ }
131
+ function parseMessage(input) {
132
+ let index = 0;
133
+ function parseNodes(stop, pluralPound) {
134
+ const nodes = [];
135
+ let text = "";
136
+ const flush = () => {
137
+ if (text !== "") {
138
+ nodes.push({
139
+ type: "text",
140
+ value: text
141
+ });
142
+ text = "";
143
+ }
144
+ };
145
+ while (index < input.length) {
146
+ const char = input[index];
147
+ if (char === "'") {
148
+ if (input[index + 1] === "'") {
149
+ text += "'";
150
+ index += 2;
151
+ continue;
152
+ }
153
+ index += 1;
154
+ while (index < input.length && input[index] !== "'") {
155
+ text += input[index];
156
+ index += 1;
157
+ }
158
+ if (input[index] === "'") index += 1;
159
+ continue;
160
+ }
161
+ if (char === "#" && pluralPound) {
162
+ flush();
163
+ nodes.push({ type: "pound" });
164
+ index += 1;
165
+ continue;
166
+ }
167
+ if (char === "{") {
168
+ flush();
169
+ index += 1;
170
+ nodes.push(parseArgument());
171
+ continue;
172
+ }
173
+ if (stop != null && char === stop) {
174
+ flush();
175
+ return nodes;
176
+ }
177
+ text += char;
178
+ index += 1;
179
+ }
180
+ if (stop != null) throw new Error("ICU 消息没有闭合");
181
+ flush();
182
+ return nodes;
183
+ }
184
+ function parseArgument() {
185
+ skipSpace();
186
+ const name = readIdentifier();
187
+ skipSpace();
188
+ if (input[index] === "}") {
189
+ index += 1;
190
+ return {
191
+ type: "arg",
192
+ name
193
+ };
194
+ }
195
+ if (input[index] !== ",") throw new Error(`ICU 参数 ${name} 格式不对`);
196
+ index += 1;
197
+ skipSpace();
198
+ const kind = readIdentifier();
199
+ skipSpace();
200
+ if (kind === "number") {
201
+ if (input[index] === ",") skipNumberStyle();
202
+ expectChar("}");
203
+ index += 1;
204
+ return {
205
+ type: "number",
206
+ name
207
+ };
208
+ }
209
+ if (kind === "plural" || kind === "selectordinal" || kind === "select") {
210
+ expectChar(",");
211
+ index += 1;
212
+ skipSpace();
213
+ let offset = 0;
214
+ if (kind !== "select" && input.startsWith("offset:", index)) {
215
+ index += 7;
216
+ skipSpace();
217
+ offset = readInteger();
218
+ skipSpace();
219
+ }
220
+ const options = [];
221
+ while (index < input.length && input[index] !== "}") {
222
+ skipSpace();
223
+ if (input[index] === "}") break;
224
+ const selector = readSelector();
225
+ skipSpace();
226
+ expectChar("{");
227
+ index += 1;
228
+ const nodes = parseNodes("}", kind !== "select");
229
+ expectChar("}");
230
+ index += 1;
231
+ options.push({
232
+ selector,
233
+ nodes
234
+ });
235
+ }
236
+ expectChar("}");
237
+ index += 1;
238
+ if (options.length === 0) throw new Error(`ICU ${kind} 没有选项`);
239
+ if (kind === "select") return {
240
+ type: "select",
241
+ name,
242
+ options
243
+ };
244
+ return {
245
+ type: "plural",
246
+ name,
247
+ offset,
248
+ ordinal: kind === "selectordinal",
249
+ options
250
+ };
251
+ }
252
+ throw new Error(`不支持的 ICU 类型 ${kind}`);
253
+ }
254
+ function skipNumberStyle() {
255
+ let depth = 0;
256
+ while (index < input.length) {
257
+ const char = input[index];
258
+ if (char === "{") depth += 1;
259
+ else if (char === "}") {
260
+ if (depth === 0) return;
261
+ depth -= 1;
262
+ }
263
+ index += 1;
264
+ }
265
+ throw new Error("ICU number 没有闭合");
266
+ }
267
+ function skipSpace() {
268
+ while (index < input.length && (input[index] === " " || input[index] === "\n" || input[index] === "\r" || input[index] === " ")) index += 1;
269
+ }
270
+ function readIdentifier() {
271
+ const start = index;
272
+ while (index < input.length && /[\w$]/.test(input[index])) index += 1;
273
+ if (start === index) throw new Error("ICU 缺少参数名");
274
+ return input.slice(start, index);
275
+ }
276
+ function readSelector() {
277
+ if (input[index] === "=") {
278
+ index += 1;
279
+ const sign = input[index] === "-" ? "-" : "";
280
+ if (sign) index += 1;
281
+ return `=${sign}${readInteger()}`;
282
+ }
283
+ return readIdentifier();
284
+ }
285
+ function readInteger() {
286
+ const start = index;
287
+ while (index < input.length && input[index] >= "0" && input[index] <= "9") index += 1;
288
+ if (start === index) throw new Error("ICU 缺少数字");
289
+ return Number(input.slice(start, index));
290
+ }
291
+ function expectChar(char) {
292
+ if (input[index] !== char) throw new Error(`ICU 期望 ${char}`);
293
+ }
294
+ return parseNodes(null, false);
295
+ }
296
+ //#endregion
297
+ //#region src/locale/upstreamMap.ts
298
+ const operatorNames = [
299
+ "contains",
300
+ "notContains",
301
+ "startsWith",
302
+ "notStartsWith",
303
+ "endsWith",
304
+ "notEndsWith",
305
+ "is",
306
+ "isNot",
307
+ "equals",
308
+ "notEquals",
309
+ "greaterThan",
310
+ "lessThan",
311
+ "greaterThanOrEqual",
312
+ "lessThanOrEqual",
313
+ "before",
314
+ "after",
315
+ "between",
316
+ "isTrue",
317
+ "isFalse",
318
+ "isAnyOf",
319
+ "isNoneOf"
320
+ ];
321
+ const valueNames = [
322
+ "value",
323
+ "values",
324
+ "time",
325
+ "date",
326
+ "relativeDate",
327
+ "startDate",
328
+ "endDate",
329
+ "entities",
330
+ "searchPlaceholder",
331
+ "enterValuePlaceholder",
332
+ "addValuesPlaceholder",
333
+ "enterNumberPlaceholder",
334
+ "selectValuesPlaceholder"
335
+ ];
336
+ function operatorTargets() {
337
+ return Object.fromEntries(operatorNames.map((name) => [`@astryx.powersearch.operator.${name}`, [{ path: `powerSearch.operators.${name}` }]]));
338
+ }
339
+ function valueTargets() {
340
+ return Object.fromEntries(valueNames.map((name) => [`@astryx.powersearch.valueEditor.${name}`, [{ path: `powerSearch.value.${name}` }]]));
341
+ }
342
+ /**
343
+ * 原版 `@astryx.*` 键到 `AstryxMessages` 字段的对照。
344
+ * 一个键可以填多个字段。占位符对不上的键不会写入,由加载器列出来。
345
+ */
346
+ const upstreamMessageMap = {
347
+ "@astryx.pagination.label": [{ path: "pagination.nav" }],
348
+ "@astryx.pagination.previous": [{ path: "pagination.previous" }],
349
+ "@astryx.pagination.next": [{ path: "pagination.next" }],
350
+ "@astryx.pagination.pageAnnounce": [{
351
+ path: "pagination.page",
352
+ args: ["current"]
353
+ }],
354
+ "@astryx.pagination.itemsPerPage": [{ path: "pagination.perPage" }],
355
+ "@astryx.pagination.count": [{
356
+ path: "pagination.total",
357
+ args: [
358
+ "total",
359
+ "from",
360
+ "to"
361
+ ]
362
+ }],
363
+ "@astryx.pagination.pageOfTotal": [{
364
+ path: "pagination.pageOf",
365
+ args: ["current", "total"]
366
+ }],
367
+ "@astryx.calendar.previousMonth": [{ path: "calendar.previousMonth" }],
368
+ "@astryx.calendar.nextMonth": [{ path: "calendar.nextMonth" }],
369
+ "@astryx.calendar.rangeStartAnnounce": [{
370
+ path: "calendar.rangeStart",
371
+ args: ["date"]
372
+ }],
373
+ "@astryx.calendar.rangeClearedAnnounce": [{
374
+ path: "calendar.rangeCleared",
375
+ args: ["date"]
376
+ }],
377
+ "@astryx.calendar.rangeCompleteAnnounce": [{
378
+ path: "calendar.rangeComplete",
379
+ args: ["start", "end"]
380
+ }],
381
+ "@astryx.calendar.dayRangeStart": [{
382
+ path: "calendar.rangeStartName",
383
+ args: ["date"]
384
+ }],
385
+ "@astryx.calendar.dayRangeEnd": [{
386
+ path: "calendar.rangeEndName",
387
+ args: ["date"]
388
+ }],
389
+ "@astryx.calendar.dayRangeStartAndEnd": [{
390
+ path: "calendar.rangeBoth",
391
+ args: ["date"]
392
+ }],
393
+ "@astryx.carousel.label": [{ path: "carousel.label" }],
394
+ "@astryx.carousel.scrollLeft": [{ path: "carousel.scrollLeft" }],
395
+ "@astryx.carousel.scrollRight": [{ path: "carousel.scrollRight" }],
396
+ "@astryx.carousel.slideLabel": [{
397
+ path: "carousel.slide",
398
+ args: ["current", "total"]
399
+ }],
400
+ "@astryx.chat.status.sending": [{ path: "chat.statusSending" }],
401
+ "@astryx.chat.status.sent": [{ path: "chat.statusSent" }],
402
+ "@astryx.chat.status.delivered": [{ path: "chat.statusDelivered" }],
403
+ "@astryx.chat.status.read": [{ path: "chat.statusRead" }],
404
+ "@astryx.chat.status.failed": [{ path: "chat.statusFailed" }],
405
+ "@astryx.chat.messageAriaLabel": [{
406
+ path: "chat.messageStatus",
407
+ args: ["status"]
408
+ }],
409
+ "@astryx.chat.pastedText.expand": [{ path: "chat.expandPastedText" }],
410
+ "@astryx.chatTypingIndicator.one": [{
411
+ path: "chat.typingOne",
412
+ args: ["name"]
413
+ }],
414
+ "@astryx.chat.composer.placeholder": [{ path: "chat.placeholder" }],
415
+ "@astryx.chat.composerDrawer.label": [{ path: "chat.drawerLabel" }],
416
+ "@astryx.chat.composerInput.label": [{ path: "chat.inputLabel" }],
417
+ "@astryx.chat.speechRecognition.noSpeechDetected": [{ path: "chat.noSpeechDetected" }],
418
+ "@astryx.chatComposerDrawer.expand": [{
419
+ path: "chat.drawerExpand",
420
+ args: ["label"]
421
+ }],
422
+ "@astryx.chatComposerDrawer.collapse": [{
423
+ path: "chat.drawerCollapse",
424
+ args: ["label"]
425
+ }],
426
+ "@astryx.chatDictationButton.startDictation": [{ path: "chat.startDictation" }],
427
+ "@astryx.chatDictationButton.stopDictation": [{ path: "chat.stopDictation" }],
428
+ "@astryx.chatLayout.newMessages": [{ path: "chat.newMessages" }],
429
+ "@astryx.chatLayoutScrollButton.scrollToBottom": [{ path: "chat.scrollToBottom" }],
430
+ "@astryx.chatMessage.messageFrom": [{
431
+ path: "chat.messageFrom",
432
+ args: ["sender"]
433
+ }],
434
+ "@astryx.chatSendButton.stop": [{ path: "chat.stop" }],
435
+ "@astryx.chatSendButton.send": [{ path: "chat.send" }],
436
+ "@astryx.chatToolCalls.error": [{
437
+ path: "chat.toolError",
438
+ args: ["message"]
439
+ }],
440
+ "@astryx.chatToolCalls.groupLabel": [{
441
+ path: "chat.toolGroup",
442
+ args: ["count"]
443
+ }],
444
+ "@astryx.chatToolCalls.status.pending": [{ path: "chat.toolPending" }],
445
+ "@astryx.chatToolCalls.status.running": [{ path: "chat.toolRunning" }],
446
+ "@astryx.chatTriggerMenu.suggestions": [{ path: "chat.suggestions" }],
447
+ "@astryx.citation.label": [{
448
+ path: "citation.label",
449
+ args: ["number", "title"]
450
+ }],
451
+ "@astryx.commandPalette.label": [{ path: "commandPalette.label" }],
452
+ "@astryx.commandPalette.emptySearch": [
453
+ { path: "commandPalette.emptySearch" },
454
+ { path: "powerSearch.empty" },
455
+ { path: "tokenizer.empty" },
456
+ { path: "chat.noResults" }
457
+ ],
458
+ "@astryx.commandPalette.emptyBootstrap": [{ path: "commandPalette.emptyBootstrap" }],
459
+ "@astryx.commandPalette.input.placeholder": [{ path: "commandPalette.placeholder" }],
460
+ "@astryx.commandPalette.list.label": [{ path: "commandPalette.listLabel" }],
461
+ "@astryx.commandPalette.loading": [{ path: "commandPalette.loading" }],
462
+ "@astryx.commandPalette.noResultsFor": [{
463
+ path: "commandPalette.noResultsFor",
464
+ args: ["query"]
465
+ }],
466
+ "@astryx.commandPalette.resultCount": [{
467
+ path: "commandPalette.resultCount",
468
+ args: ["count"]
469
+ }],
470
+ "@astryx.commandPalette.footer.navigate": [{ path: "commandPalette.navigate" }],
471
+ "@astryx.commandPalette.footer.select": [{ path: "commandPalette.select" }],
472
+ "@astryx.commandPalette.footer.close": [{ path: "commandPalette.close" }],
473
+ "@astryx.dateInput.placeholder": [{ path: "dateInput.placeholder" }],
474
+ "@astryx.dateInput.dialogLabel": [{ path: "dateInput.dialogLabel" }],
475
+ "@astryx.dateInput.openCalendar": [{ path: "dateInput.openCalendar" }],
476
+ "@astryx.dateInput.closeCalendar": [{ path: "dateInput.closeCalendar" }],
477
+ "@astryx.dateInput.clear": [
478
+ {
479
+ path: "dateInput.clear",
480
+ args: ["label"]
481
+ },
482
+ {
483
+ path: "dateRangeInput.clear",
484
+ args: ["label"]
485
+ },
486
+ {
487
+ path: "dateTimeInput.clear",
488
+ args: ["label"]
489
+ }
490
+ ],
491
+ "@astryx.dateInput.invalidDate": [{ path: "dateInput.invalidDate" }],
492
+ "@astryx.dateRangeInput.placeholder": [{ path: "dateRangeInput.placeholder" }],
493
+ "@astryx.dateRangeInput.dialogLabel": [{ path: "dateRangeInput.dialogLabel" }],
494
+ "@astryx.dateTimeInput.dateTab": [{ path: "dateTimeInput.dateLabel" }],
495
+ "@astryx.dateTimeInput.timeTab": [{ path: "dateTimeInput.timeLabel" }],
496
+ "@astryx.dateTimeInput.timeHint12h": [{ path: "timeInput.formatHint12" }],
497
+ "@astryx.dateTimeInput.timeHint24h": [{ path: "timeInput.formatHint24" }],
498
+ "@astryx.dropdownMenu.back": [{ path: "dropdownMenu.back" }],
499
+ "@astryx.dropdownMenu.backTo": [{
500
+ path: "dropdownMenu.backTo",
501
+ args: ["parent"]
502
+ }],
503
+ "@astryx.fileInput.placeholder": [{ path: "fileInput.placeholder" }],
504
+ "@astryx.fileInput.placeholderMultiple": [{ path: "fileInput.placeholderMultiple" }],
505
+ "@astryx.fileInput.required": [{ path: "fileInput.required" }],
506
+ "@astryx.fileInput.fileSelected": [{
507
+ path: "fileInput.fileSelected",
508
+ args: ["fileName"]
509
+ }],
510
+ "@astryx.fileInput.filesSelected": [{
511
+ path: "fileInput.filesSelected",
512
+ args: ["count"]
513
+ }],
514
+ "@astryx.fileInput.errorInvalidType": [{
515
+ path: "fileInput.errorType",
516
+ args: ["fileName"]
517
+ }],
518
+ "@astryx.fileInput.errorMaxSize": [{
519
+ path: "fileInput.errorSize",
520
+ args: ["fileName", "maxSize"]
521
+ }],
522
+ "@astryx.fileInput.errorMaxFiles": [{
523
+ path: "fileInput.errorCount",
524
+ args: ["maxFiles"]
525
+ }],
526
+ "@astryx.inputClearButton.tooltip": [
527
+ { path: "fileInput.clear" },
528
+ { path: "selector.clear" },
529
+ { path: "multiSelector.clear" }
530
+ ],
531
+ "@astryx.input.statusButton.error": [{ path: "input.statusError" }],
532
+ "@astryx.input.statusButton.warning": [{ path: "input.statusWarning" }],
533
+ "@astryx.input.statusButton.success": [{ path: "input.statusSuccess" }],
534
+ "@astryx.input.readOnly": [{ path: "selector.readOnly" }, { path: "multiSelector.readOnly" }],
535
+ "@astryx.button.loading": [
536
+ { path: "checkboxList.loading" },
537
+ { path: "selector.loading" },
538
+ { path: "multiSelector.loading" },
539
+ { path: "dateInput.loading" }
540
+ ],
541
+ "@astryx.appShell.skipToContent": [{ path: "layout.skipToContent" }],
542
+ "@astryx.resizable.handle.label": [{ path: "layout.resizeHandle" }],
543
+ "@astryx.resizable.collapsed": [{ path: "layout.collapsed" }],
544
+ "@astryx.appShell.mobileNavigation": [{ path: "layout.mobileNavigation" }],
545
+ "@astryx.lightbox.close": [{ path: "lightbox.close" }],
546
+ "@astryx.lightbox.previous": [{ path: "lightbox.previous" }],
547
+ "@astryx.lightbox.next": [{ path: "lightbox.next" }],
548
+ "@astryx.lightbox.mediaViewer": [{ path: "lightbox.mediaViewer" }],
549
+ "@astryx.lightbox.zoom": [{ path: "lightbox.zoom" }],
550
+ "@astryx.lightbox.zoomedIn": [{ path: "lightbox.zoomedIn" }],
551
+ "@astryx.lightbox.zoomedOut": [{ path: "lightbox.zoomedOut" }],
552
+ "@astryx.lightbox.imagePosition": [{
553
+ path: "lightbox.imagePosition",
554
+ args: ["index", "total"]
555
+ }],
556
+ "@astryx.lightbox.mediaPosition": [{
557
+ path: "lightbox.mediaPosition",
558
+ args: [
559
+ "alt",
560
+ "index",
561
+ "total"
562
+ ]
563
+ }],
564
+ "@astryx.markdownHeadingLinks.copy": [{
565
+ path: "markdown.headingLink",
566
+ args: ["heading"]
567
+ }],
568
+ "@astryx.markdown.taskList": [{ path: "markdown.taskList" }],
569
+ "@astryx.metadataList.showMore": [{ path: "metadataList.showMore" }],
570
+ "@astryx.metadataList.showLess": [{ path: "metadataList.showLess" }],
571
+ "@astryx.multiSelector.selectPlaceholder": [{ path: "multiSelector.placeholder" }],
572
+ "@astryx.multiSelector.searchPlaceholder": [{ path: "multiSelector.search" }],
573
+ "@astryx.multiSelector.empty": [{ path: "multiSelector.empty" }],
574
+ "@astryx.multiSelector.emptySearchResults": [{ path: "multiSelector.emptySearch" }],
575
+ "@astryx.multiSelector.selectAll": [{ path: "multiSelector.selectAll" }],
576
+ "@astryx.multiSelector.resultCount": [{
577
+ path: "multiSelector.resultCount",
578
+ args: ["count"]
579
+ }],
580
+ "@astryx.multiSelector.createOption": [{
581
+ path: "multiSelector.create",
582
+ args: ["query"]
583
+ }, {
584
+ path: "tokenizer.create",
585
+ args: ["query"]
586
+ }],
587
+ "@astryx.multiSelector.optionCreated": [{
588
+ path: "multiSelector.created",
589
+ args: ["label"]
590
+ }],
591
+ "@astryx.table.selection.selectedCount": [{
592
+ path: "table.selectedCount",
593
+ args: ["count"]
594
+ }, {
595
+ path: "multiSelector.selected",
596
+ args: ["count"]
597
+ }],
598
+ "@astryx.sideNav.label": [{ path: "nav.sideNav" }],
599
+ "@astryx.topNav.landmarkLabel": [{ path: "nav.topNav" }],
600
+ "@astryx.mobileNav.navigation": [{ path: "nav.mobileNav" }],
601
+ "@astryx.sideNavCollapseButton.collapseSidebar": [{ path: "nav.collapseSidebar" }],
602
+ "@astryx.sideNavCollapseButton.expandSidebar": [{ path: "nav.expandSidebar" }],
603
+ "@astryx.sideNav.heading.openMenu": [{ path: "nav.openMenu" }],
604
+ "@astryx.mobileNav.toggle.open": [{ path: "nav.openNavigation" }],
605
+ "@astryx.mobileNav.closeNavigation": [{ path: "nav.close" }],
606
+ "@astryx.avatarGroup.overflow": [{
607
+ path: "nav.moreItems",
608
+ args: ["count"]
609
+ }, {
610
+ path: "powerSearch.more",
611
+ args: ["count"]
612
+ }],
613
+ "@astryx.sideNavItem.expand": [{
614
+ path: "nav.expandItem",
615
+ args: ["label"]
616
+ }],
617
+ "@astryx.sideNavItem.collapse": [{
618
+ path: "nav.collapseItem",
619
+ args: ["label"]
620
+ }],
621
+ "@astryx.sideNavItem.submenuLabel": [{
622
+ path: "nav.submenu",
623
+ args: ["label"]
624
+ }],
625
+ "@astryx.numberInput.incrementLabel": [{
626
+ path: "numberInput.increment",
627
+ args: ["label"]
628
+ }],
629
+ "@astryx.numberInput.decrementLabel": [{
630
+ path: "numberInput.decrement",
631
+ args: ["label"]
632
+ }],
633
+ "@astryx.outline.label": [{ path: "outline.label" }],
634
+ "@astryx.powersearch.label": [{ path: "powerSearch.label" }],
635
+ "@astryx.powersearch.placeholder": [{ path: "powerSearch.placeholder" }],
636
+ "@astryx.powersearch.resultCount": [{
637
+ path: "powerSearch.resultCount",
638
+ args: ["count"]
639
+ }],
640
+ "@astryx.powersearch.valueEditor.itemsCount": [{
641
+ path: "powerSearch.itemsCount",
642
+ args: ["count"]
643
+ }],
644
+ "@astryx.powersearch.valueEditor.entitiesCount": [{
645
+ path: "powerSearch.entitiesCount",
646
+ args: ["count"]
647
+ }],
648
+ "@astryx.powersearch.valueEditor.filtersCount": [{
649
+ path: "powerSearch.filtersCount",
650
+ args: ["count"]
651
+ }],
652
+ "@astryx.powersearch.valueEditor.dateRange": [{ path: "powerSearch.dateRange" }],
653
+ "@astryx.powersearch.editor.field": [{ path: "powerSearch.editor.field" }],
654
+ "@astryx.powersearch.editor.operator": [{ path: "powerSearch.editor.operator" }],
655
+ "@astryx.powersearch.editor.addFilter": [{ path: "powerSearch.editor.addFilter" }],
656
+ "@astryx.powersearch.editor.removeFilter": [{ path: "powerSearch.editor.removeFilter" }],
657
+ "@astryx.powersearch.editor.group": [{ path: "powerSearch.editor.group" }],
658
+ "@astryx.powersearch.editor.delete": [{ path: "powerSearch.editor.delete" }],
659
+ "@astryx.powersearch.editor.cancel": [{ path: "powerSearch.editor.cancel" }],
660
+ "@astryx.powersearch.editor.apply": [{ path: "powerSearch.editor.apply" }],
661
+ ...operatorTargets(),
662
+ ...valueTargets(),
663
+ "@astryx.selector.placeholder": [{ path: "selector.placeholder" }],
664
+ "@astryx.selector.searchPlaceholder": [{ path: "selector.search" }],
665
+ "@astryx.selector.empty": [{ path: "selector.empty" }],
666
+ "@astryx.selector.emptySearchResults": [{ path: "selector.emptySearch" }],
667
+ "@astryx.selector.resultCount": [{
668
+ path: "selector.resultCount",
669
+ args: ["count"]
670
+ }],
671
+ "@astryx.stepper.label": [{ path: "stepper.progress" }],
672
+ "@astryx.step.optional": [{ path: "stepper.optional" }],
673
+ "@astryx.stepper.previousStep": [{ path: "stepper.previous" }],
674
+ "@astryx.stepper.nextStep": [{ path: "stepper.next" }],
675
+ "@astryx.step.status.completed": [{ path: "stepper.status.completed" }],
676
+ "@astryx.step.status.warning": [{ path: "stepper.status.warning" }],
677
+ "@astryx.step.status.error": [{ path: "stepper.status.error" }],
678
+ "@astryx.table.label": [{ path: "table.label" }],
679
+ "@astryx.table.noData": [{ path: "table.noData" }],
680
+ "@astryx.table.filter.allPlaceholder": [{ path: "table.filterAll" }],
681
+ "@astryx.table.filter.reset": [{ path: "table.reset" }],
682
+ "@astryx.table.filter.apply": [{ path: "table.apply" }],
683
+ "@astryx.table.selection.selectAllRows": [{ path: "table.selectAllRows" }],
684
+ "@astryx.table.selection.selectRow": [{ path: "table.selectRow" }],
685
+ "@astryx.table.selection.selectRowNamed": [{
686
+ path: "table.selectRowNamed",
687
+ args: ["label"]
688
+ }],
689
+ "@astryx.table.sort.ascending": [{ path: "table.sortAscending" }],
690
+ "@astryx.table.sort.descending": [{ path: "table.sortDescending" }],
691
+ "@astryx.table.sort.clear": [{ path: "table.clearSort" }],
692
+ "@astryx.table.sort.direction.ascending": [{ path: "table.sortedAscending" }],
693
+ "@astryx.table.sort.direction.descending": [{ path: "table.sortedDescending" }],
694
+ "@astryx.table.sort.sortBy": [{
695
+ path: "table.sortBy",
696
+ args: ["label"]
697
+ }],
698
+ "@astryx.table.selection.bulkActionsLabel": [{ path: "table.bulkActionsLabel" }],
699
+ "@astryx.table.selection.clearAll": [{ path: "table.clearAll" }],
700
+ "@astryx.table.pagination.label": [{ path: "table.paginationLabel" }],
701
+ "@astryx.tableGroupedRows.expandGroup": [{
702
+ path: "table.expandGroup",
703
+ args: ["groupKey"]
704
+ }],
705
+ "@astryx.tableGroupedRows.collapseGroup": [{
706
+ path: "table.collapseGroup",
707
+ args: ["groupKey"]
708
+ }],
709
+ "@astryx.tableRowExpansion.expandRow": [{ path: "table.expandRow" }],
710
+ "@astryx.tableRowExpansion.collapseRow": [{ path: "table.collapseRow" }],
711
+ "@astryx.tableRowExpansion.expandAllRows": [{ path: "table.expandAllRows" }],
712
+ "@astryx.tableRowExpansion.collapseAllRows": [{ path: "table.collapseAllRows" }],
713
+ "@astryx.tableRowExpansion.columnHeader": [{ path: "table.rowExpansion" }],
714
+ "@astryx.table.rowStatus.columnHeader": [{ path: "table.rowStatus" }],
715
+ "@astryx.thumbnail.remove": [{
716
+ path: "thumbnail.remove",
717
+ args: ["accessibleName"]
718
+ }],
719
+ "@astryx.thumbnail.open": [{
720
+ path: "thumbnail.open",
721
+ args: ["accessibleName"]
722
+ }],
723
+ "@astryx.thumbnail.fallbackName": [{ path: "thumbnail.fallbackName" }],
724
+ "@astryx.timeInput.placeholder": [{ path: "timeInput.placeholder" }],
725
+ "@astryx.timeInput.clearLabel": [{
726
+ path: "timeInput.clear",
727
+ args: ["label"]
728
+ }],
729
+ "@astryx.timestamp.copyValue": [{
730
+ path: "timestamp.copyValue",
731
+ args: ["value"]
732
+ }],
733
+ "@astryx.timestamp.copy": [{ path: "timestamp.copy" }],
734
+ "@astryx.timestamp.copied": [{ path: "timestamp.copied" }],
735
+ "@astryx.timestamp.detailsLabel": [{ path: "timestamp.detailsLabel" }],
736
+ "@astryx.token.remove": [{
737
+ path: "token.remove",
738
+ args: ["label"]
739
+ }],
740
+ "@astryx.tokenizer.clearAll": [{ path: "tokenizer.clear" }, { path: "powerSearch.clear" }],
741
+ "@astryx.tokenizer.tokenAdded": [{
742
+ path: "tokenizer.added",
743
+ args: ["label"]
744
+ }],
745
+ "@astryx.tokenizer.tokenRemoved": [{
746
+ path: "tokenizer.removed",
747
+ args: ["label"]
748
+ }],
749
+ "@astryx.typeahead.searchPlaceholder": [{ path: "typeahead.placeholder" }],
750
+ "@astryx.typeahead.emptySearchResults": [{ path: "typeahead.empty" }],
751
+ "@astryx.typeahead.loading": [{ path: "typeahead.loading" }],
752
+ "@astryx.typeahead.clearSelection": [{ path: "typeahead.clear" }],
753
+ "@astryx.typeahead.searchResults": [
754
+ { path: "typeahead.results" },
755
+ { path: "tokenizer.results" },
756
+ { path: "powerSearch.results" }
757
+ ],
758
+ "@astryx.treeList.toggleChildren": [{ path: "treeList.toggleChildren" }]
759
+ };
760
+ //#endregion
761
+ //#region src/locale/loadCatalog.ts
762
+ /**
763
+ * 把一份原版 Astryx locale JSON 映射成 `AstryxMessages`。
764
+ * 内置的 `en` 和 `zh-CN` 不会被改掉。返回值要交给 `provideAstryxLocale` 的第二个参数。
765
+ * `unmapped` 列出每一个没写进文案树的键。
766
+ */
767
+ function loadAstryxCatalog(locale, catalog) {
768
+ const messages = cloneMessages(astryxMessages.en);
769
+ const tree = messages;
770
+ const assigned = /* @__PURE__ */ new Set();
771
+ const unmapped = [];
772
+ const present = /* @__PURE__ */ new Set();
773
+ for (const key of Object.keys(catalog).sort()) {
774
+ present.add(key);
775
+ const read = readMessage(catalog[key]);
776
+ if (read.message == null) {
777
+ unmapped.push({
778
+ key,
779
+ message: read.invalid,
780
+ reason: "invalid-entry"
781
+ });
782
+ continue;
783
+ }
784
+ const targets = upstreamMessageMap[key];
785
+ if (targets == null) {
786
+ unmapped.push({
787
+ key,
788
+ message: read.message,
789
+ reason: "no-slot"
790
+ });
791
+ continue;
792
+ }
793
+ if (!writeTargets(tree, assigned, targets, read.message, locale)) unmapped.push({
794
+ key,
795
+ message: read.message,
796
+ reason: failureReason(targets, assigned, read.message)
797
+ });
798
+ }
799
+ const missingKeys = Object.keys(upstreamMessageMap).filter((key) => !present.has(key)).sort();
800
+ const fallbackFields = collectLeaves(tree).filter((path) => !assigned.has(path)).sort();
801
+ unmapped.sort((a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0);
802
+ return {
803
+ locale,
804
+ messages,
805
+ unmapped,
806
+ missingKeys,
807
+ fallbackFields
808
+ };
809
+ }
810
+ function writeTargets(tree, assigned, targets, message, locale) {
811
+ let wrote = false;
812
+ let names;
813
+ try {
814
+ names = icuPlaceholderNames(message);
815
+ } catch {
816
+ return false;
817
+ }
818
+ for (const target of targets) {
819
+ if (assigned.has(target.path)) continue;
820
+ const args = target.args ?? [];
821
+ if (names.some((name) => !args.includes(name))) continue;
822
+ let value;
823
+ try {
824
+ value = target.args == null ? cleanup(formatIcu(message, {}, locale)) : bindMessage(message, target.args, locale);
825
+ } catch {
826
+ continue;
827
+ }
828
+ setPath(tree, target.path, value);
829
+ assigned.add(target.path);
830
+ wrote = true;
831
+ }
832
+ return wrote;
833
+ }
834
+ function failureReason(targets, assigned, message) {
835
+ let names;
836
+ try {
837
+ names = icuPlaceholderNames(message);
838
+ } catch {
839
+ return "unsupported-message";
840
+ }
841
+ const openTargets = targets.filter((target) => !assigned.has(target.path));
842
+ if (openTargets.length === 0) return "slot-taken";
843
+ return openTargets.some((target) => {
844
+ const args = target.args ?? [];
845
+ return names.some((name) => !args.includes(name));
846
+ }) ? "placeholder-mismatch" : "unsupported-message";
847
+ }
848
+ function bindMessage(message, args, locale) {
849
+ return (...values) => {
850
+ const bag = {};
851
+ args.forEach((name, index) => {
852
+ bag[name] = coerce(values[index]);
853
+ });
854
+ return cleanup(formatIcu(message, bag, locale));
855
+ };
856
+ }
857
+ function coerce(value) {
858
+ if (typeof value === "number" || typeof value === "string") return value;
859
+ if (value == null) return void 0;
860
+ return String(value);
861
+ }
862
+ function cleanup(text) {
863
+ return text.replace(/[ \t]{2,}/g, " ").trim();
864
+ }
865
+ function readMessage(entry) {
866
+ if (typeof entry === "string") return { message: entry };
867
+ if (entry != null && typeof entry === "object" && typeof entry.defaultMessage === "string") return { message: entry.defaultMessage };
868
+ return { invalid: JSON.stringify(entry) };
869
+ }
870
+ function cloneMessages(source) {
871
+ return cloneValue(source);
872
+ }
873
+ function cloneValue(value) {
874
+ if (typeof value === "function" || value == null || typeof value !== "object") return value;
875
+ const copy = {};
876
+ for (const [key, child] of Object.entries(value)) copy[key] = cloneValue(child);
877
+ return copy;
878
+ }
879
+ function setPath(tree, path, value) {
880
+ const parts = path.split(".");
881
+ let cursor = tree;
882
+ for (const part of parts.slice(0, -1)) {
883
+ const next = cursor[part];
884
+ if (next == null || typeof next === "function" || typeof next === "string") throw new Error(`消息路径不存在:${path}`);
885
+ cursor = next;
886
+ }
887
+ const leaf = parts[parts.length - 1];
888
+ if (leaf == null || !Object.hasOwn(cursor, leaf)) throw new Error(`消息路径不存在:${path}`);
889
+ cursor[leaf] = value;
890
+ }
891
+ function collectLeaves(tree, prefix = "") {
892
+ const paths = [];
893
+ for (const [key, value] of Object.entries(tree)) {
894
+ const path = prefix === "" ? key : `${prefix}.${key}`;
895
+ if (typeof value === "string" || typeof value === "function") paths.push(path);
896
+ else paths.push(...collectLeaves(value, path));
897
+ }
898
+ return paths;
899
+ }
900
+ //#endregion
901
+ //#region src/locale/useCollator.ts
902
+ /**
903
+ * 按当前语言比较字符串,对应原版的 `useCollator`。
904
+ * 没提供语言时用 `en`。`options` 用 ref 或 computed 包起来,变了才会重建比较器。
905
+ *
906
+ * @example
907
+ * ```ts
908
+ * const collator = useCollator({ numeric: true })
909
+ * items.sort((a, b) => collator.value.compare(a.name, b.name))
910
+ * ```
911
+ */
912
+ function useCollator(options) {
913
+ const locale = useAstryxLocale();
914
+ return computed(() => new Intl.Collator(locale.value, toValue(options)));
915
+ }
916
+ //#endregion
917
+ export { weekdayNames as a, standaloneShortWeekdayNames as i, loadAstryxCatalog as n, formatCalendarMonth as r, useCollator as t };