@astryx-vue/core 0.2.2 → 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.
- package/THIRD_PARTY_NOTICES.md +4 -0
- package/dist/AlertDialog/index.js +1 -1
- package/dist/{AlertDialog-ovx4cBjM.js → AlertDialog-B6UeBCE7.js} +2 -2
- package/dist/AppShell/index.js +1 -1
- package/dist/{AppShell-Cb41gIAj.js → AppShell-CeBmB0Q9.js} +2 -2
- package/dist/Avatar/index.d.ts +1 -1
- package/dist/Avatar/index.js +1 -1
- package/dist/{Avatar-jmHInHwj.js → Avatar-BB4Z4LF1.js} +10 -4
- package/dist/AvatarGroup/index.d.ts +1 -1
- package/dist/Banner/index.d.ts +1 -1
- package/dist/BottomSheet/index.d.ts +2 -2
- package/dist/BottomSheet/index.js +3 -2
- package/dist/{BottomSheet-Dg95HB1s.js → BottomSheet-BV6vfgGu.js} +82 -22
- package/dist/BottomSheet-o7xw-TOi.js +153 -0
- package/dist/Breadcrumbs/index.d.ts +3 -2
- package/dist/Breadcrumbs/index.js +3 -2
- package/dist/{Breadcrumbs-CTQ7fjDn.js → Breadcrumbs-D6G7f5WL.js} +13 -8
- package/dist/Button/index.d.ts +1 -1
- package/dist/ButtonGroup/index.d.ts +1 -1
- package/dist/Calendar/index.d.ts +2 -2
- package/dist/Calendar/index.js +1 -1
- package/dist/Calendar-DmTeM7PO.js +656 -0
- package/dist/Carousel/index.js +1 -1
- package/dist/{Carousel-X0cuQkvg.js → Carousel-CIKrcA2r.js} +2 -2
- package/dist/Chat/index.d.ts +1 -1
- package/dist/Chat/index.js +1 -1
- package/dist/{Chat-M0tiGrNT.js → Chat-BFox3u9D.js} +3 -3
- package/dist/CheckboxIndicator/index.js +1 -1
- package/dist/CheckboxIndicator-D37cm2Rh.js +68 -0
- package/dist/CheckboxInput/index.d.ts +1 -1
- package/dist/CheckboxInput/index.js +1 -1
- package/dist/{CheckboxInput-CMsEE1_4.js → CheckboxInput-25Q8ItH-.js} +10 -9
- package/dist/CheckboxList/index.d.ts +1 -1
- package/dist/CheckboxList/index.js +1 -1
- package/dist/{CheckboxList-BbCPiend.js → CheckboxList-BlPf7vPe.js} +78 -25
- package/dist/Citation/index.js +1 -1
- package/dist/{Citation-C1veUk5p.js → Citation-BG-vg9ia.js} +2 -2
- package/dist/ClickableCard/index.d.ts +1 -1
- package/dist/Code/index.d.ts +3 -3
- package/dist/Code/index.js +4 -4
- package/dist/{Code-yb_KOFtJ.js → Code-XnPuGxey.js} +3 -2
- package/dist/{CodeBlock-DesTJAkm.js → CodeBlock-B2pnEOJY.js} +146 -16
- package/dist/Collapsible/index.js +1 -1
- package/dist/{Collapsible-BestK35V.js → Collapsible-3YerR-FO.js} +1 -1
- package/dist/CommandPalette/index.js +1 -1
- package/dist/{CommandPalette-BArt97V8.js → CommandPalette-DKgHzmJk.js} +10 -10
- package/dist/ComplexSelector/index.d.ts +1 -1
- package/dist/ComplexSelector/index.js +1 -1
- package/dist/{ComplexSelector-CAoig1RK.js → ComplexSelector-Dv44FFhN.js} +3 -3
- package/dist/ContextMenu/index.d.ts +3 -2
- package/dist/ContextMenu/index.js +3 -2
- package/dist/{ContextMenu-9Im6i43E.js → ContextMenu-BeJO5HYx.js} +206 -423
- package/dist/DateInput/index.d.ts +2 -2
- package/dist/DateInput/index.js +1 -1
- package/dist/DateInput-D4XFAEMp.js +743 -0
- package/dist/DateRangeInput/index.d.ts +1 -1
- package/dist/DateRangeInput/index.js +1 -1
- package/dist/{DateRangeInput-DwDy3eRo.js → DateRangeInput-Cp6AZfew.js} +54 -19
- package/dist/DateTimeInput/index.d.ts +1 -1
- package/dist/DateTimeInput/index.js +1 -1
- package/dist/{DateTimeInput-BYiaC9bn.js → DateTimeInput-B6MPPp76.js} +54 -15
- package/dist/Divider/index.d.ts +1 -1
- package/dist/DropdownMenu/index.d.ts +3 -3
- package/dist/DropdownMenu/index.js +4 -3
- package/dist/{DropdownMenu-Dh-WAHKb.js → DropdownMenu--lnUeJEG.js} +309 -64
- package/dist/DropdownMenu-6E9jFdFe.js +325 -0
- package/dist/DropdownMenuRadioItem.vue-CXEURBcq.d.ts +564 -0
- package/dist/EmptyState/index.js +1 -1
- package/dist/{EmptyState-CUJdTYKV.js → EmptyState-0RWymQUS.js} +2 -2
- package/dist/FileInput/index.d.ts +1 -1
- package/dist/FileInput/index.js +1 -1
- package/dist/{FileInput-DLO6V12n.js → FileInput-DuNwdbAo.js} +2 -2
- package/dist/Grid/index.d.ts +1 -1
- package/dist/Heading/index.d.ts +2 -2
- package/dist/Heading/index.js +1 -1
- package/dist/Heading-B9C3LZlS.js +94 -0
- package/dist/Icon/index.d.ts +4 -3
- package/dist/Icon/index.js +2 -2
- package/dist/{Icon-CJKjdJy-.js → Icon-bteSId7T.js} +113 -18
- package/dist/Indicator/index.d.ts +3 -0
- package/dist/Indicator/index.js +2 -0
- package/dist/InputGroup/index.d.ts +2 -2
- package/dist/InputGroup/index.js +3 -2
- package/dist/InputGroup-BzR6JRZb.js +129 -0
- package/dist/Item-DrYJL1TG.js +590 -0
- package/dist/Lightbox/index.js +1 -1
- package/dist/{Lightbox-CdFCS_EA.js → Lightbox-Br3o0SyQ.js} +2 -2
- package/dist/Link/index.d.ts +3 -2
- package/dist/Link/index.js +1 -1
- package/dist/Link-DCZ6922-.js +196 -0
- package/dist/List/index.d.ts +3 -3
- package/dist/List/index.js +2 -2
- package/dist/{ListItem-pGxvn6QJ.js → ListItem-CcRHWuEm.js} +8 -2
- package/dist/Markdown/index.d.ts +2 -2
- package/dist/Markdown/index.js +2 -2
- package/dist/{Markdown-BqKloI3w.js → Markdown-Bz0R3kNj.js} +280 -33
- package/dist/MetadataList/index.js +1 -1
- package/dist/{MetadataList-CvZkmisf.js → MetadataList-CFaocx6j.js} +1 -1
- package/dist/MobileNav/index.js +1 -1
- package/dist/{MobileNavToggle-Bwi0qXXM.js → MobileNavToggle-Dh3uLivq.js} +1 -1
- package/dist/MoreMenu/index.d.ts +1 -1
- package/dist/MoreMenu/index.js +1 -1
- package/dist/{MoreMenu-BwJaJrkB.js → MoreMenu-B95nRSe8.js} +3 -3
- package/dist/MultiSelector/index.d.ts +2 -2
- package/dist/MultiSelector/index.js +1 -1
- package/dist/{MultiSelector-C-ETfFy_.js → MultiSelector-DuF5TECE.js} +304 -122
- package/dist/{NavDisclosure-DHrSNRDR.js → NavDisclosure-C6sPZ89n.js} +5 -2
- package/dist/NavHeadingSurface-Cb3x9iDx.js +287 -0
- package/dist/NavMenu/index.d.ts +2 -2
- package/dist/NavMenu/index.js +4 -3
- package/dist/NavMenu-ClIgMaxE.js +176 -0
- package/dist/{NavMenuItem-B-k7olt5.js → NavMenuItem-E7S8gBh-.js} +1 -1
- package/dist/NumberInput/index.d.ts +1 -1
- package/dist/NumberInput/index.js +1 -1
- package/dist/{NumberInput-DjetVB8O.js → NumberInput-B4IL3s_8.js} +1 -1
- package/dist/Outline/index.js +1 -1
- package/dist/{Outline-Bz9c-u5y.js → Outline-DBUuchi9.js} +1 -1
- package/dist/OverflowList/index.d.ts +1 -1
- package/dist/OverflowList/index.js +1 -1
- package/dist/{OverflowList-ED-KN9Y5.js → OverflowList-aDd_oem0.js} +3 -3
- package/dist/Pagination/index.d.ts +1 -1
- package/dist/Pagination/index.js +1 -1
- package/dist/{Pagination-Cb66HMEf.js → Pagination-CNe9F6Fl.js} +181 -45
- package/dist/Popover/index.js +1 -1
- package/dist/{Popover-Crhk9PNP.js → Popover-D7zqpFwU.js} +1 -1
- package/dist/PowerSearch/index.d.ts +1 -1
- package/dist/PowerSearch/index.js +1 -1
- package/dist/{PowerSearch-CjU8y4mi.js → PowerSearch-C6U8Sq1Y.js} +16 -16
- package/dist/ProgressBar/index.d.ts +2 -2
- package/dist/ProgressBar/index.js +1 -1
- package/dist/{ProgressBar-DO9Chic6.js → ProgressBar-DF6WZNCI.js} +45 -6
- package/dist/Radio/index.d.ts +1 -1
- package/dist/Radio/index.js +1 -1
- package/dist/{RadioGroup-BqjdSCfJ.js → RadioGroup-CBqUPq_L.js} +16 -8
- package/dist/RadioList/index.d.ts +1 -1
- package/dist/RadioList/index.js +1 -1
- package/dist/{RadioList-DI8ujXcT.js → RadioList-CPOJn9Th.js} +1 -1
- package/dist/Resizable/index.js +1 -1
- package/dist/{Resizable-D-TBCg0Y.js → ResizeHandle-DYy0e3v9.js} +1 -1
- package/dist/ScrollableArea/index.d.ts +1 -1
- package/dist/SelectableCard/index.d.ts +1 -1
- package/dist/Selector/index.d.ts +2 -2
- package/dist/Selector/index.js +1 -1
- package/dist/Selector-5N-hq2nF.js +618 -0
- package/dist/SideNav/index.d.ts +2 -2
- package/dist/SideNav/index.js +1 -1
- package/dist/{SideNav-DonEfiAx.js → SideNav-CT9lfspi.js} +226 -230
- package/dist/Stepper/index.js +1 -1
- package/dist/{Stepper-D2ZIcUNx.js → Stepper-BqhVCgC-.js} +1 -1
- package/dist/Switch/index.d.ts +1 -1
- package/dist/TabList/index.js +1 -1
- package/dist/{TabList-D3F-stq-.js → TabList-BlzkrObv.js} +2 -2
- package/dist/Table/index.js +1 -1
- package/dist/{Table-CrP2Uffq.js → Table-CsdH8fCB.js} +7 -7
- package/dist/Text/index.d.ts +3 -3
- package/dist/Text/index.js +1 -1
- package/dist/Text-DIzZw6FA.js +86 -0
- package/dist/TextArea/index.d.ts +1 -1
- package/dist/TextInput/index.d.ts +1 -1
- package/dist/Theme/index.d.ts +3 -2
- package/dist/Theme/index.js +2 -2
- package/dist/Theme-CtaUWo4g.js +1246 -0
- package/dist/Thumbnail/index.js +1 -1
- package/dist/{Thumbnail-BC5JGPGZ.js → Thumbnail-BnQwX1cQ.js} +3 -3
- package/dist/{TimeField-DpHFrNv0.js → TimeField-Biiuv0hB.js} +2 -2
- package/dist/TimeInput/index.d.ts +1 -1
- package/dist/TimeInput/index.js +1 -1
- package/dist/{TimeInput-DJLV0_4z.js → TimeInput-C9gptCOK.js} +1 -1
- package/dist/Timer/index.d.ts +1 -1
- package/dist/Timer/index.js +1 -1
- package/dist/{Timer-B7GV6hqd.js → Timer-kxzQx3tp.js} +1 -1
- package/dist/Timestamp/index.d.ts +1 -1
- package/dist/Timestamp/index.js +1 -1
- package/dist/{Timestamp-GKNjjt5g.js → Timestamp-D7bd_nF3.js} +3 -3
- package/dist/ToggleButton/index.d.ts +1 -1
- package/dist/Token/index.d.ts +1 -1
- package/dist/Token/index.js +1 -1
- package/dist/{Token-Chu_eCVs.js → Token-D2GsI_Ei.js} +2 -2
- package/dist/Tokenizer/index.d.ts +1 -1
- package/dist/Tokenizer/index.js +1 -1
- package/dist/{Tokenizer-DRDpvQ_l.js → Tokenizer-rwzamZg4.js} +4 -4
- package/dist/Toolbar/index.d.ts +1 -1
- package/dist/Tooltip/index.d.ts +1 -1
- package/dist/Tooltip/index.js +1 -1
- package/dist/{Tooltip-mp0NMh_Y.js → Tooltip-C2fh9anJ.js} +23 -8
- package/dist/TopNav/index.d.ts +1 -1
- package/dist/TopNav/index.js +1 -1
- package/dist/{TopNav-CEyWddtA.js → TopNav-arWFLTBM.js} +113 -43
- package/dist/TreeList/index.js +1 -1
- package/dist/{TreeList-COS8US8e.js → TreeList-C9xvMpJZ.js} +2 -2
- package/dist/Typeahead/index.d.ts +2 -2
- package/dist/Typeahead/index.js +3 -2
- package/dist/Typeahead-_V11btpv.js +499 -0
- package/dist/{TypeaheadMenu-CGvo0Tud.js → TypeaheadMenu-BEObzonz.js} +46 -10
- package/dist/{context-O2Vb8cJl.js → colorMode-CBgdgDSn.js} +1 -7
- package/dist/composables/index.d.ts +2 -2
- package/dist/composables/index.js +12 -7
- package/dist/composables-CWw6t-RJ.js +520 -0
- package/dist/{context-CiKncNSH.js → context-CPh7kE-a.js} +140 -18
- package/dist/context-Cws_tXTr.js +7 -0
- package/dist/context-D5-MwxnN.js +4 -0
- package/dist/{index-CJlBAXwj.d.ts → index-12QYAbiz.d.ts} +41 -4
- package/dist/{index-Cs5pcwY3.d.ts → index-6yB8BtEu.d.ts} +3 -3
- package/dist/{index-C7mxUcDR.d.ts → index-B4OOtNP8.d.ts} +2 -2
- package/dist/index-BBtJt5_A.d.ts +26 -0
- package/dist/{index-CRizexSC.d.ts → index-BH9PzQ1F.d.ts} +13 -73
- package/dist/index-BPwD6aBv.d.ts +83 -0
- package/dist/{index-DOUEn7V0.d.ts → index-BcZI402h.d.ts} +64 -5
- package/dist/{index-C8wDPDcP.d.ts → index-Bi49IrAJ.d.ts} +50 -8
- package/dist/{index-DimuSES0.d.ts → index-BlOIC_AM.d.ts} +3 -1
- package/dist/{index-C5p2NeCr.d.ts → index-Blm197N_.d.ts} +11 -2
- package/dist/{index-Bu3oXIIS.d.ts → index-BmmdzwT9.d.ts} +6 -0
- package/dist/{index-kVhSuA9t.d.ts → index-BxhJqiZ7.d.ts} +6 -6
- package/dist/{index-HV6W3xCx.d.ts → index-Byar3h1e.d.ts} +1 -1
- package/dist/{index-qiZtHnGK.d.ts → index-C3GaPqvJ.d.ts} +123 -8
- package/dist/{index-D4I_obqR.d.ts → index-CFIXnk5D.d.ts} +1 -1
- package/dist/{index-cGagYM1g.d.ts → index-CI9kyg74.d.ts} +11 -1
- package/dist/{index-D-ZuubCK.d.ts → index-CUCcYKxl.d.ts} +1 -1
- package/dist/{index-DWH_HzXi.d.ts → index-ChWlKHjc.d.ts} +1 -1
- package/dist/{index-DGXviOlp.d.ts → index-D-ezcKaY.d.ts} +30 -4
- package/dist/{index-Cm_TiLXU.d.ts → index-Dgg0bHVM.d.ts} +7 -3
- package/dist/index-DxR1FChm.d.ts +158 -0
- package/dist/{index-DNRBbwp_.d.ts → index-EtZgovdH.d.ts} +842 -107
- package/dist/{index-BHqRH7QW.d.ts → index-FEy8qFSD.d.ts} +2 -2
- package/dist/index-XuAAcYiP.d.ts +77 -0
- package/dist/{index-D0TlUOtG.d.ts → index-YmSe1ujk.d.ts} +76 -3
- package/dist/{index-BMrggCw-.d.ts → index-bvr3WHvs.d.ts} +1 -1
- package/dist/{index-CDDMDHJM.d.ts → index-c67ca7eJ.d.ts} +1 -1
- package/dist/{index-c_TaW8mM.d.ts → index-cL3q7O4R.d.ts} +31 -2
- package/dist/{index-CGZ2xi3r.d.ts → index-eshFLli0.d.ts} +40 -3
- package/dist/{index-DsyKhauk.d.ts → index-hCpxKePE.d.ts} +48 -2
- package/dist/{index-u5ozu0G7.d.ts → index-vP0EtrJJ.d.ts} +13 -3
- package/dist/{index-B1TG2GPS.d.ts → index-vizlhXVs.d.ts} +246 -45
- package/dist/{index-DfgHJE7H.d.ts → index-z3uLM1O6.d.ts} +153 -24
- package/dist/index.d.ts +82 -80
- package/dist/index.js +127 -116
- package/dist/locale/index.d.ts +2 -2
- package/dist/locale/index.js +3 -3
- package/dist/locale-sLw5Caia.js +917 -0
- package/dist/searchResultMessage-CCnq-_ce.js +94 -0
- package/dist/semantic-CKH9XVqa.d.ts +54 -0
- package/dist/syntaxTheme-CwVEcVDk.d.ts +57 -0
- package/dist/{syntaxTheme-ClpWALZX.js → syntaxTheme-R7xnu5x5.js} +24 -3
- package/dist/{types-pnljWjEE.d.ts → types-CwyibrRB.d.ts} +12 -11
- package/dist/{types-Bt-lSgYX.d.ts → types-D9nP_X-c.d.ts} +14 -1
- package/dist/{types-CAZY4Xua.d.ts → types-DGYHIu4I.d.ts} +30 -1
- package/dist/types-D_J66aPN.d.ts +85 -0
- package/dist/types-gKsEkk2g.d.ts +320 -0
- package/dist/{useAnchoredListbox-7W90Ny-9.js → useAnchoredListbox-BN9LQnon.js} +1 -1
- package/dist/useDatePresentation-C07PnOCw.js +21 -0
- package/dist/{useMonthGrid-CmJsZTcB.js → useDateRange-CIXoE_8k.js} +1 -42
- package/dist/useDisclosureHandle-Df3HhAfC.js +24 -0
- package/dist/{useDismiss-CAiHU6QD.js → useDismiss-Cj8x_51F.js} +8 -4
- package/dist/useFieldControlState-voICDrys.js +18 -0
- package/dist/useHandleRef-6cdKugm8.js +17 -0
- package/dist/useIndicator-i1NORM7W.js +147 -0
- package/dist/useMenuDrillIn-BgjJcY3K.js +520 -0
- package/dist/useMenuPress-DUmEy4TB.js +425 -0
- package/dist/useMonthGrid-fGHSSrFc.js +43 -0
- package/dist/usePendingChange-ib-h8FZK.js +25 -0
- package/dist/{composables-CVfjp9h4.js → useResizable-B3ahKLoZ.js} +74 -152
- package/dist/useSubmenuMode-CZN9qrUo.js +37 -0
- package/dist/useTruncation-B5qXQzAP.js +53 -0
- package/locales/SOURCE.json +37 -0
- package/locales/af-ZA.json +1482 -0
- package/locales/ar-SA.json +1482 -0
- package/locales/ca-ES.json +1482 -0
- package/locales/cs-CZ.json +1482 -0
- package/locales/da-DK.json +1482 -0
- package/locales/de-DE.json +1482 -0
- package/locales/el-GR.json +1482 -0
- package/locales/en.json +1646 -0
- package/locales/es-ES.json +1482 -0
- package/locales/fi-FI.json +1482 -0
- package/locales/fr-FR.json +1482 -0
- package/locales/he-IL.json +1482 -0
- package/locales/hu-HU.json +1482 -0
- package/locales/it-IT.json +1482 -0
- package/locales/ja-JP.json +1482 -0
- package/locales/ko-KR.json +1482 -0
- package/locales/nl-NL.json +1482 -0
- package/locales/no-NO.json +1482 -0
- package/locales/pl-PL.json +1482 -0
- package/locales/pt-BR.json +1482 -0
- package/locales/pt-PT.json +1482 -0
- package/locales/ro-RO.json +1482 -0
- package/locales/ru-RU.json +1482 -0
- package/locales/sr-SP.json +1482 -0
- package/locales/sv-SE.json +1482 -0
- package/locales/tr-TR.json +1482 -0
- package/locales/uk-UA.json +1482 -0
- package/locales/vi-VN.json +1482 -0
- package/locales/zh-CN.json +1482 -0
- package/locales/zh-TW.json +1482 -0
- package/package.json +7 -1
- package/styles/bottom-sheet.css +27 -0
- package/styles/calendar.css +38 -3
- package/styles/check-indicator.css +17 -0
- package/styles/checkbox-indicator.css +29 -10
- package/styles/checkbox-input.css +0 -11
- package/styles/code.css +62 -0
- package/styles/container-reveal.css +104 -0
- package/styles/date-input.css +48 -0
- package/styles/dropdown-menu.css +163 -0
- package/styles/field.css +48 -0
- package/styles/heading.css +47 -0
- package/styles/icon.css +51 -3
- package/styles/input-group.css +32 -3
- package/styles/keyboard-hint.css +28 -0
- package/styles/link.css +34 -0
- package/styles/list.css +88 -1
- package/styles/markdown.css +12 -0
- package/styles/multi-selector.css +26 -0
- package/styles/pagination.css +30 -0
- package/styles/progress-bar.css +49 -0
- package/styles/radio-indicator.css +90 -0
- package/styles/radio.css +9 -42
- package/styles/selector.css +112 -14
- package/styles/side-nav.css +36 -1
- package/styles/text.css +18 -0
- package/styles/top-nav.css +145 -6
- package/styles/typeahead.css +24 -0
- package/styles.css +4 -0
- package/dist/Calendar-BFaI5AMv.js +0 -352
- package/dist/CheckboxIndicator-DdJmksHt.js +0 -52
- package/dist/DateInput-BLocxqC3.js +0 -376
- package/dist/DropdownMenu-Ddfr-aEC.js +0 -164
- package/dist/Heading-Dugosn6j.js +0 -43
- package/dist/InputGroup-ChrFVxzV.js +0 -42
- package/dist/Item-C1z6gXn8.js +0 -289
- package/dist/Link-DqdQZ37C.js +0 -141
- package/dist/Selector-DE2IEFML.js +0 -468
- package/dist/Text-BHVghsWo.js +0 -53
- package/dist/Theme-BuUiiJNr.js +0 -429
- package/dist/Typeahead-P7cCqtaQ.js +0 -375
- package/dist/index-Bgv4ZmBl.d.ts +0 -72
- package/dist/index-DN7MXPHM.d.ts +0 -398
- package/dist/index-Dg3ZmwEg.d.ts +0 -75
- package/dist/index-IbUN4M8V.d.ts +0 -40
- package/dist/index-jdjcb3Js.d.ts +0 -80
- package/dist/locale-Cpk_nrLA.js +0 -18
- package/dist/syntaxTheme-Bcs1YMF7.d.ts +0 -38
- package/dist/types-DDAAT1Xd.d.ts +0 -285
- package/dist/useGridRovingFocus-DQQAOYH5.js +0 -99
- package/dist/useHotkeys-dABSK1o9.js +0 -80
- package/dist/useLongPress-Cyxwa73s.js +0 -60
- package/dist/{index-BUXNRekN.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 };
|