@astryx-vue/core 0.2.6 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD_PARTY_NOTICES.md +9 -0
- package/dist/AlertDialog/index.js +1 -1
- package/dist/{AlertDialog-BBhl5P1X.js → AlertDialog-C2inDZWG.js} +13 -7
- package/dist/AppShell/index.d.ts +1 -1
- package/dist/AppShell/index.js +1 -1
- package/dist/{AppShell-mrflO0Uy.js → AppShell-CumzH-8z.js} +3 -3
- package/dist/Avatar/index.d.ts +1 -1
- package/dist/Avatar/index.js +1 -1
- package/dist/{Avatar-pPZ4dI_s.js → Avatar-BW0TE8t9.js} +47 -34
- package/dist/AvatarGroup/index.d.ts +1 -1
- package/dist/AvatarGroup/index.js +1 -1
- package/dist/{AvatarGroup-B--NQSB3.js → AvatarGroup-DLC_FFR5.js} +57 -13
- package/dist/Banner/index.d.ts +1 -1
- package/dist/Banner/index.js +1 -1
- package/dist/{Banner-GbGxrqQO.js → Banner-C5VAwo4D.js} +68 -34
- package/dist/Blockquote/index.js +1 -1
- package/dist/Blockquote-DRoKdcxZ.js +27 -0
- package/dist/BottomSheet/index.d.ts +1 -1
- package/dist/BottomSheet/index.js +2 -2
- package/dist/{BottomSheet-eJ3FzTBD.js → BottomSheet-B4sc3F1S.js} +288 -140
- package/dist/{BottomSheet-DIVwbGr3.js → BottomSheet-m54uCMJN.js} +20 -4
- package/dist/Breadcrumbs/index.d.ts +2 -2
- package/dist/Breadcrumbs/index.js +2 -2
- package/dist/Breadcrumbs-CTaz7Kh4.js +223 -0
- package/dist/Button/index.d.ts +1 -1
- package/dist/Button/index.js +1 -1
- package/dist/{Button-B6Hj_O_s.js → Button-ONOoHdkg.js} +25 -15
- package/dist/ButtonGroup/index.d.ts +1 -1
- package/dist/ButtonGroup/index.js +1 -1
- package/dist/ButtonGroup-DnkSZ9a5.js +87 -0
- package/dist/{ButtonTooltip-nWWrth8j.js → ButtonTooltip-CNKOQHYR.js} +7 -4
- package/dist/Calendar/index.d.ts +1 -1
- package/dist/Calendar/index.js +1 -1
- package/dist/{Calendar-B7vIowKq.js → Calendar-BAqzzQm2.js} +5 -5
- package/dist/Card/index.d.ts +2 -2
- package/dist/Card/index.js +1 -1
- package/dist/{Card-HAjZQg2s.js → Card-B-I24X9S.js} +2 -0
- package/dist/Carousel/index.js +1 -1
- package/dist/{Carousel-DAkOa7KK.js → Carousel-DXC22UWq.js} +50 -33
- package/dist/Chat/index.d.ts +1 -1
- package/dist/Chat/index.js +1 -1
- package/dist/{Chat-DVoI6UOA.js → Chat-BdJW6IX5.js} +152 -83
- package/dist/CheckboxIndicator/index.js +1 -1
- package/dist/{CheckboxIndicator-D37cm2Rh.js → CheckboxIndicator-fH4d-JE1.js} +9 -3
- package/dist/CheckboxInput/index.d.ts +1 -1
- package/dist/CheckboxInput/index.js +1 -1
- package/dist/{CheckboxInput-BS9J6edf.js → CheckboxInput-DJHCbwgC.js} +19 -11
- package/dist/CheckboxList/index.d.ts +1 -1
- package/dist/CheckboxList/index.js +1 -1
- package/dist/{CheckboxList-CX1i_jVP.js → CheckboxList-BdZIP4_J.js} +155 -38
- package/dist/Citation/index.js +1 -1
- package/dist/{Citation-Djgwa0ko.js → Citation-DbZn2vms.js} +8 -3
- package/dist/ClickableCard/index.d.ts +1 -1
- package/dist/ClickableCard/index.js +1 -1
- package/dist/{ClickableCard-Bhds4RRe.js → ClickableCard-ChAfiw9T.js} +10 -7
- package/dist/Code/index.d.ts +1 -1
- package/dist/Code/index.js +3 -3
- package/dist/{Code-XnPuGxey.js → Code-Bg7GBdxy.js} +2 -1
- package/dist/{CodeBlock-BUM3czCS.js → CodeBlock-Caaflp7C.js} +7 -3
- package/dist/Collapsible/index.d.ts +1 -1
- package/dist/Collapsible/index.js +1 -1
- package/dist/{Collapsible-Cov3Pyq5.js → Collapsible-Bdj0WYpb.js} +13 -11
- package/dist/CommandPalette/index.d.ts +1 -1
- package/dist/CommandPalette/index.js +1 -1
- package/dist/{CommandPalette-D6wYS30d.js → CommandPalette-C_MClfAg.js} +146 -62
- package/dist/ComplexSelector/index.d.ts +1 -1
- package/dist/ComplexSelector/index.js +1 -1
- package/dist/{ComplexSelector-Bil81sfq.js → ComplexSelector-BeVQaqRf.js} +94 -22
- package/dist/ContextMenu/index.d.ts +2 -2
- package/dist/ContextMenu/index.js +2 -2
- package/dist/{ContextMenu-DdLJnxNN.js → ContextMenu-C6hPYvYz.js} +299 -179
- package/dist/DateInput/index.d.ts +1 -1
- package/dist/DateInput/index.js +1 -1
- package/dist/{DateInput-u2XKccpK.js → DateInput-BjLdmYor.js} +567 -76
- package/dist/DateRangeInput/index.d.ts +1 -1
- package/dist/DateRangeInput/index.js +1 -1
- package/dist/{DateRangeInput-u7LhH6up.js → DateRangeInput-Br3wVEfD.js} +99 -28
- package/dist/DateTimeInput/index.d.ts +1 -1
- package/dist/DateTimeInput/index.js +1 -1
- package/dist/DateTimeInput-CAZBwoRe.js +562 -0
- package/dist/Dialog/index.d.ts +1 -1
- package/dist/Dialog/index.js +2 -2
- package/dist/{Dialog-BiOSKQso.js → Dialog-Dce4Y97V.js} +28 -11
- package/dist/{Dialog-FGHfDu5M.js → Dialog-fhyxB00e.js} +32 -5
- package/dist/Divider/index.d.ts +1 -1
- package/dist/Divider/index.js +1 -1
- package/dist/{Divider-BtwnL18I.js → Divider-mOZ6vIQw.js} +5 -1
- package/dist/DropdownMenu/index.d.ts +2 -2
- package/dist/DropdownMenu/index.js +3 -3
- package/dist/{DropdownMenu-SM_BEOgM.js → DropdownMenu-BdGmQVb1.js} +85 -57
- package/dist/{DropdownMenu-BEasdJ6R.js → DropdownMenu-BzQrNV9C.js} +481 -264
- package/dist/{DropdownMenuRadioItem.vue-CXEURBcq.d.ts → DropdownMenuRadioItem.vue-Qd-8Rg4Q.d.ts} +236 -230
- package/dist/EmptyState/index.js +1 -1
- package/dist/{EmptyState-C_GH7IV5.js → EmptyState-CmOQf2SH.js} +2 -2
- package/dist/Field/index.d.ts +4 -3
- package/dist/Field/index.js +4 -3
- package/dist/{Field-D5gUEGw4.js → Field--OEsLBfE.js} +4 -3
- package/dist/{FieldInfoTip-Ds-sW_jY.js → FieldInfoTip-gxsnfkZw.js} +3 -3
- package/dist/{FieldLabel-BNeXRuGH.js → FieldLabel-jxIiWgLw.js} +12 -7
- package/dist/FieldStatus/index.d.ts +1 -1
- package/dist/FileInput/index.d.ts +1 -1
- package/dist/FileInput/index.js +1 -1
- package/dist/{FileInput-BpdiO1V8.js → FileInput-B_pUxB0Y.js} +106 -29
- package/dist/FormLayout/index.d.ts +1 -1
- package/dist/FormLayout/index.js +1 -1
- package/dist/{FormLayout-D47FjiOq.js → FormLayout-B9dUB6Ps.js} +1 -1
- package/dist/Heading/index.d.ts +1 -1
- package/dist/Heading/index.js +1 -1
- package/dist/{Heading-BnwWEWkp.js → Heading-BzBunfN7.js} +1 -1
- package/dist/HoverCard/index.js +1 -1
- package/dist/{HoverCard-ycY50pRN.js → HoverCard-BpJhT0sn.js} +35 -22
- package/dist/Icon/index.d.ts +4 -4
- package/dist/Icon/index.js +1 -1
- package/dist/{Icon-bteSId7T.js → Icon-KDnUyY7f.js} +12 -20
- package/dist/IconButton/index.js +1 -1
- package/dist/{IconButton-DDNgNl7B.js → IconButton-DI-XBbtV.js} +1 -1
- package/dist/Indicator/index.d.ts +2 -2
- package/dist/Indicator/index.js +2 -1
- package/dist/InputClearButton-CwXPan8c.js +40 -0
- package/dist/InputGroup/index.d.ts +1 -1
- package/dist/InputGroup/index.js +2 -2
- package/dist/{InputGroup-CA03Smrs.js → InputGroup-DiiocoIW.js} +2 -2
- package/dist/InternationalizationProvider/index.d.ts +1 -1
- package/dist/InternationalizationProvider/index.js +1 -1
- package/dist/{InternationalizationProvider-DJay_w3B.js → InternationalizationProvider-kBapgKAQ.js} +5 -9
- package/dist/{Item-KhFKX9St.js → Item-DWMIjN8n.js} +34 -9
- package/dist/Kbd/index.js +1 -1
- package/dist/{Kbd-BB-Dw6zE.js → Kbd-CV3LO2Ge.js} +18 -2
- package/dist/LayerContentBoundary-CvsKxwwm.js +27 -0
- package/dist/LayerProvider/index.js +1 -1
- package/dist/{LayerProvider-D9NsQFzL.js → LayerProvider-B6zpMBWC.js} +15 -3
- package/dist/Layout/index.d.ts +1 -1
- package/dist/Layout/index.js +2 -2
- package/dist/{Layout-9X6eCUoY.js → Layout-JJRCG7Mf.js} +1 -1
- package/dist/{LayoutPanel-DeOh00p5.js → LayoutPanel-zM5vjrKS.js} +15 -8
- package/dist/Lightbox/index.js +1 -1
- package/dist/{Lightbox-DTF9EdTG.js → Lightbox-D8wyPgMK.js} +8 -6
- package/dist/Link/index.d.ts +2 -2
- package/dist/Link/index.js +1 -1
- package/dist/{Link-BqHCtiyt.js → Link-DweIpOtN.js} +29 -12
- package/dist/List/index.d.ts +1 -1
- package/dist/List/index.js +2 -2
- package/dist/{ListItem-8RWT8XAG.js → ListItem-BQXMu1Tb.js} +1 -1
- package/dist/Markdown/index.d.ts +5 -2
- package/dist/Markdown/index.js +5 -2
- package/dist/Markdown/parser/index.d.ts +4 -0
- package/dist/Markdown/parser/index.js +3 -0
- package/dist/Markdown/plugin-protocol/index.d.ts +35 -0
- package/dist/Markdown/plugin-protocol/index.js +107 -0
- package/dist/Markdown/plugin-renderer/index.d.ts +31 -0
- package/dist/Markdown/plugin-renderer/index.js +42 -0
- package/dist/{Markdown-2CVyZDuB.js → Markdown-DhVfOvXk.js} +195 -484
- package/dist/MediaTheme-DlLqYhDy.js +433 -0
- package/dist/MetadataList/index.js +1 -1
- package/dist/{MetadataList-B-OelQlt.js → MetadataList-CEYceIlN.js} +15 -7
- package/dist/MobileNav/index.js +1 -1
- package/dist/{MobileNavToggle-C3dkrM98.js → MobileNavToggle-pdoJFZHx.js} +60 -19
- package/dist/MoreMenu/index.d.ts +1 -1
- package/dist/MoreMenu/index.js +1 -1
- package/dist/{MoreMenu-D1WFGqGU.js → MoreMenu-CFNqSRev.js} +87 -67
- package/dist/MultiSelector/index.d.ts +1 -1
- package/dist/MultiSelector/index.js +1 -1
- package/dist/MultiSelector-DuVatmq5.js +1456 -0
- package/dist/{NavDisclosure-C_fugrQ3.js → NavDisclosure-Bq9DTZLO.js} +29 -7
- package/dist/{NavHeadingSurface-B3yJspSN.js → NavHeadingSurface-C4v_MtkX.js} +29 -26
- package/dist/NavItem/index.d.ts +1 -1
- package/dist/NavItem/index.js +2 -2
- package/dist/{NavItem-BBIGSvDj.js → NavItem-BPb3yfgz.js} +17 -4
- package/dist/NavMenu/index.d.ts +1 -1
- package/dist/NavMenu/index.js +3 -3
- package/dist/{NavMenu-ThXguZAz.js → NavMenu-BYIDzjix.js} +42 -15
- package/dist/{NavMenuItem-BvJNsDFC.js → NavMenuItem-D3FO90GR.js} +14 -12
- package/dist/NumberInput/index.d.ts +1 -1
- package/dist/NumberInput/index.js +1 -1
- package/dist/NumberInput-B0vzOg3N.js +727 -0
- package/dist/Outline/index.d.ts +2 -2
- package/dist/Outline/index.js +2 -2
- package/dist/{Outline-755h-lMP.js → Outline-CfGv2F1o.js} +91 -6
- package/dist/OverflowList/index.d.ts +2 -2
- package/dist/OverflowList/index.js +1 -1
- package/dist/{OverflowList-NmrSMbxb.js → OverflowList-BgRLZ3dh.js} +23 -6
- package/dist/Pagination/index.d.ts +1 -1
- package/dist/Pagination/index.js +1 -1
- package/dist/{Pagination-Cc4BrjQg.js → Pagination-Bfe12018.js} +2 -2
- package/dist/PickerWheel-CSwUYfes.js +69 -0
- package/dist/Popover/index.d.ts +1 -1
- package/dist/Popover/index.js +1 -1
- package/dist/{Popover-CtoBfVlD.js → Popover-78dFjTb9.js} +28 -17
- package/dist/PowerSearch/index.d.ts +1 -1
- package/dist/PowerSearch/index.js +1 -1
- package/dist/{PowerSearch-DHoiObLn.js → PowerSearch-BoAMdFaT.js} +776 -586
- package/dist/ProgressBar/index.d.ts +1 -1
- package/dist/ProgressBar/index.js +1 -1
- package/dist/{ProgressBar-CVLzdoBK.js → ProgressBar-VP4JS7vm.js} +10 -7
- package/dist/Radio/index.d.ts +1 -1
- package/dist/Radio/index.js +1 -1
- package/dist/{RadioGroup-Bfu6JSNV.js → RadioGroup-BIipql-L.js} +94 -26
- package/dist/RadioList/index.d.ts +1 -1
- package/dist/RadioList/index.js +1 -1
- package/dist/{RadioList-xY1cwLdZ.js → RadioList-GyhgBg4j.js} +57 -8
- package/dist/Resizable/index.d.ts +1 -1
- package/dist/Resizable/index.js +1 -1
- package/dist/{ResizeHandle-q4nD_586.js → ResizeHandle-TPlUCAHD.js} +103 -50
- package/dist/ScrollableArea/index.d.ts +1 -1
- package/dist/ScrollableArea/index.js +1 -1
- package/dist/{ScrollableArea-CJiaALHm.js → ScrollableArea-0u6RWtGG.js} +14 -3
- package/dist/Scrollbars/index.d.ts +2 -0
- package/dist/Scrollbars/index.js +3 -0
- package/dist/Scrollbars-D_93hJYK.js +75 -0
- package/dist/SegmentedControl/index.js +1 -1
- package/dist/{SegmentedControl-ChHmFrrC.js → SegmentedControl-D1wWGBZo.js} +11 -5
- package/dist/SelectableCard/index.d.ts +1 -1
- package/dist/SelectableCard/index.js +1 -1
- package/dist/{SelectableCard-Bj5s_tIN.js → SelectableCard-BEqnhPaX.js} +17 -12
- package/dist/Selector/index.d.ts +1 -1
- package/dist/Selector/index.js +1 -1
- package/dist/Selector-CPISLzp7.js +1049 -0
- package/dist/SideNav/index.d.ts +1 -1
- package/dist/SideNav/index.js +1 -1
- package/dist/{SideNav-Dtv8eA2j.js → SideNav-CN2QeAtY.js} +64 -41
- package/dist/Slider/index.d.ts +1 -1
- package/dist/Slider/index.js +1 -1
- package/dist/{Slider-DWobsPgm.js → Slider-pdC0jpHu.js} +172 -46
- package/dist/Spinner/index.js +1 -1
- package/dist/Spinner-DdVUadii.js +200 -0
- package/dist/Stack/index.d.ts +1 -1
- package/dist/Stack/index.js +2 -2
- package/dist/{Stack-CjQEavuq.js → Stack-Bb_h60t3.js} +10 -3
- package/dist/{Stack-D_Bhs-3r.js → Stack-Bp-XN9J4.js} +20 -9
- package/dist/StatusDot/index.d.ts +1 -1
- package/dist/StatusDot/index.js +1 -1
- package/dist/{StatusDot-BPUhMOff.js → StatusDot-BS_ohXhd.js} +8 -4
- package/dist/Stepper/index.d.ts +1 -1
- package/dist/Stepper/index.js +1 -1
- package/dist/{Stepper-CE8dHysu.js → Stepper-CyaSRSdu.js} +101 -79
- package/dist/Switch/index.d.ts +1 -1
- package/dist/Switch/index.js +1 -1
- package/dist/{Switch-DaVPRxvN.js → Switch-Z2Vfiiic.js} +38 -22
- package/dist/TabList/index.d.ts +2 -2
- package/dist/TabList/index.js +1 -1
- package/dist/{TabList-DIkK9sgK.js → TabList-DRqP0Hrv.js} +205 -63
- package/dist/Table/index.d.ts +3 -3
- package/dist/Table/index.js +1 -1
- package/dist/{Table-hqZMmzfU.js → Table-BcrrylMX.js} +727 -448
- package/dist/Text/index.d.ts +2 -2
- package/dist/Text/index.js +1 -1
- package/dist/{Text-CV3LmscH.js → Text-CmTOgYXf.js} +1 -1
- package/dist/TextArea/index.d.ts +1 -1
- package/dist/TextArea/index.js +1 -1
- package/dist/{TextArea-Ab5Sw60T.js → TextArea-DA9CCG_J.js} +104 -50
- package/dist/TextInput/index.d.ts +1 -1
- package/dist/TextInput/index.js +1 -1
- package/dist/{TextInput-zFT1_qgI.js → TextInput-CI96einV.js} +71 -38
- package/dist/Theme/index.d.ts +3 -3
- package/dist/Theme/index.js +3 -2
- package/dist/Theme-BbDT8B_C.js +2125 -0
- package/dist/Thumbnail/index.js +1 -1
- package/dist/{Thumbnail-C3NnJUFG.js → Thumbnail-B2ZAY59J.js} +13 -10
- package/dist/{TimeField-ByiJKBRM.js → TimeField-CpAgja9D.js} +299 -40
- package/dist/TimeInput/index.d.ts +1 -1
- package/dist/TimeInput/index.js +1 -1
- package/dist/{TimeInput-S8n946tp.js → TimeInput-Bw_lHS4M.js} +78 -9
- package/dist/Timer/index.d.ts +1 -1
- package/dist/Timer/index.js +1 -1
- package/dist/{Timer-avMQk5DN.js → Timer-CH7GsEVu.js} +1 -1
- package/dist/Timestamp/index.d.ts +1 -1
- package/dist/Timestamp/index.js +1 -1
- package/dist/{Timestamp-xpQKCk0d.js → Timestamp-BFNuoTZ0.js} +5 -5
- package/dist/Toast/index.d.ts +1 -1
- package/dist/Toast/index.js +1 -1
- package/dist/Toast-DwnPjx6j.js +685 -0
- package/dist/ToggleButton/index.d.ts +1 -1
- package/dist/ToggleButton/index.js +1 -1
- package/dist/{ToggleButton-B-C-Q7XP.js → ToggleButton-cLjh9W-x.js} +5 -4
- package/dist/Token/index.d.ts +1 -1
- package/dist/Token/index.js +1 -1
- package/dist/{Token-DsntTYhQ.js → Token-BfS4vi__.js} +32 -17
- package/dist/Tokenizer/index.d.ts +1 -1
- package/dist/Tokenizer/index.js +1 -1
- package/dist/{Tokenizer-41p035dX.js → Tokenizer-Ci3E5bvP.js} +109 -23
- package/dist/Toolbar/index.d.ts +2 -2
- package/dist/Toolbar/index.js +1 -1
- package/dist/{Toolbar-BrgvvTCk.js → Toolbar-C0pMWL4S.js} +1 -1
- package/dist/Tooltip/index.d.ts +1 -1
- package/dist/Tooltip/index.js +1 -1
- package/dist/{Tooltip-C4Vaqd3G.js → Tooltip-sAM8i1eO.js} +23 -19
- package/dist/TopNav/index.d.ts +1 -1
- package/dist/TopNav/index.js +1 -1
- package/dist/{TopNav-CeSeEMX3.js → TopNav-gW59zp1o.js} +16 -15
- package/dist/TreeList/index.d.ts +1 -1
- package/dist/TreeList/index.js +1 -1
- package/dist/{TreeList-BUz-KZJd.js → TreeList-DaoI7zaH.js} +124 -41
- package/dist/Typeahead/index.d.ts +1 -1
- package/dist/Typeahead/index.js +2 -2
- package/dist/{Typeahead-k3xhFxkr.js → Typeahead-D4JjvjK4.js} +125 -26
- package/dist/{TypeaheadMenu-DBW6rHeO.js → TypeaheadMenu-BQlMrfqX.js} +141 -51
- package/dist/{announce-Cnio10Wk.js → announce-B210eJVf.js} +17 -2
- package/dist/characterReferences-BJ-jLhsR.js +65 -0
- package/dist/characters-rcDbGt71.d.ts +29 -0
- package/dist/characters-wTnzjkkR.js +58 -0
- package/dist/{colorMode-CBgdgDSn.js → colorMode-BxqfDP4P.js} +1 -4
- package/dist/composables/index.d.ts +5 -4
- package/dist/composables/index.js +23 -18
- package/dist/{composables-CbKx9C1Y.js → composables-Bc02zKAO.js} +167 -197
- package/dist/context-B6UElI5X.js +5 -0
- package/dist/{context-Cfjh8te1.js → context-Cfml4jaK.js} +5 -3
- package/dist/{context-iABt_ueM.js → context-DWfi56sq.js} +451 -122
- package/dist/context-IvbU9c3T.js +8 -0
- package/dist/context-pjBxaMSh.js +28 -0
- package/dist/fieldParts--SyRZVQG.js +44 -0
- package/dist/fieldParts-LXpQMKE8.d.ts +27 -0
- package/dist/{focus-CpficIgf.js → focus-l8jVTcqd.js} +1 -1
- package/dist/hoverIntent-DMHGb85c.js +115 -0
- package/dist/{index-Cde5JvtX.d.ts → index-B-nESNam.d.ts} +8 -7
- package/dist/{index-CsNi1I8j.d.ts → index-B08-Uxhv.d.ts} +4 -2
- package/dist/{index-Cn-sSds-.d.ts → index-B56j4eI2.d.ts} +24 -1
- package/dist/{index-BJMJ09K-.d.ts → index-BEZ4ezJk.d.ts} +1 -1
- package/dist/{index-DeQwYJbg.d.ts → index-BNaRK-s5.d.ts} +10 -1
- package/dist/{index-CQCTKjIO.d.ts → index-BO9TY87G.d.ts} +5 -4
- package/dist/{index-BJSxFVXH.d.ts → index-BQEJj72c.d.ts} +21 -8
- package/dist/{index-BXk7Wng7.d.ts → index-BULhhnGf.d.ts} +1 -1
- package/dist/{index-D97pQbua.d.ts → index-BV2D2x_u.d.ts} +1 -1
- package/dist/{index-BPYzIIYn.d.ts → index-BZKgbyN9.d.ts} +2 -2
- package/dist/index-BkUkm6Al.d.ts +11 -0
- package/dist/{index-ClNU2Th8.d.ts → index-Bn-v89Vt.d.ts} +10 -6
- package/dist/{index-Bu8NA2SD.d.ts → index-BnEhvmdR.d.ts} +16 -7
- package/dist/index-Bo-ofFyg.d.ts +166 -0
- package/dist/{index-i0tNFWfz.d.ts → index-BqhgeAT4.d.ts} +2 -0
- package/dist/{index-DWh2WC8W.d.ts → index-C4Cjz6OK.d.ts} +2 -2
- package/dist/{index-B7yhzGUT.d.ts → index-C7sam-SB.d.ts} +2 -2
- package/dist/{index-BrJzFA5X.d.ts → index-C90l2rH1.d.ts} +1 -1
- package/dist/{index-vP0EtrJJ.d.ts → index-C9gAlDt_.d.ts} +6 -3
- package/dist/{index-csA1lH_0.d.ts → index-CJ6ajsUC.d.ts} +2 -2
- package/dist/{index-CY-KvZ9B.d.ts → index-CK-Dbh0f.d.ts} +1 -1
- package/dist/index-CKUfpmFL.d.ts +375 -0
- package/dist/{index-DXpSFlPG.d.ts → index-CKgBTAzC.d.ts} +4 -4
- package/dist/{index-EFqQF2Bx.d.ts → index-CPtDjmcX.d.ts} +4 -4
- package/dist/{index-12QYAbiz.d.ts → index-CRrSHbok.d.ts} +3 -2
- package/dist/{index-DG52Bg0W.d.ts → index-CTf3SK0b.d.ts} +6 -0
- package/dist/{index-BNy3SW4S.d.ts → index-CTjkJP4x.d.ts} +32 -3
- package/dist/{index-Ca8VIE4l.d.ts → index-CVn0GBdB.d.ts} +1 -1
- package/dist/{index-YKCx03zD.d.ts → index-CdvmnNMH.d.ts} +1 -1
- package/dist/{index-BUEPz7BL.d.ts → index-CikMzeab.d.ts} +3 -3
- package/dist/{index-CdtZjkmG.d.ts → index-CpNlPLBF.d.ts} +183 -129
- package/dist/{index-N7OVZ38M.d.ts → index-Cs1xsHKi.d.ts} +28 -16
- package/dist/{index-Cyb9Du5Z.d.ts → index-CtTGt6Dv.d.ts} +1 -1
- package/dist/{index-HV6W3xCx.d.ts → index-D05JGsT3.d.ts} +5 -2
- package/dist/{index-CsTbMVDS.d.ts → index-D0_HsuC3.d.ts} +4 -4
- package/dist/{index-BgT6mH3U.d.ts → index-D7ShT2c-.d.ts} +1 -1
- package/dist/{index-CkKPMIeX.d.ts → index-D7XRtUTY.d.ts} +9 -0
- package/dist/{index-TntQsADQ.d.ts → index-DEm3kRBO.d.ts} +4 -3
- package/dist/{index-DamRHh1i.d.ts → index-DLAG3m9W.d.ts} +11 -1
- package/dist/{index-DUnDGFQE.d.ts → index-DNA2l1RN.d.ts} +1 -1
- package/dist/{index-WnUY4Kxu.d.ts → index-DRJZ-v1E.d.ts} +4 -4
- package/dist/{index-DYp2RWkM.d.ts → index-DY8Wph-A.d.ts} +3 -3
- package/dist/{index-B1WJxt-n.d.ts → index-DfC05uKG.d.ts} +17 -7
- package/dist/{index-C5e-7Obr.d.ts → index-Dj1_1t3j.d.ts} +19 -6
- package/dist/{index-jW-mP58D.d.ts → index-Dr4b_oji.d.ts} +22 -15
- package/dist/{index-uKnRGtzi.d.ts → index-Ds201-d2.d.ts} +18 -4
- package/dist/{index-DIXAzTKL.d.ts → index-DxxudRgB.d.ts} +1 -1
- package/dist/{index-DQmK3Lq_.d.ts → index-IfsSCj8J.d.ts} +19 -6
- package/dist/{index-B1eCxBCY.d.ts → index-TXcNH86P.d.ts} +1 -1
- package/dist/{index-XuAAcYiP.d.ts → index-f3d9cVtj.d.ts} +1 -1
- package/dist/index-fAZaRruV.d.ts +125 -0
- package/dist/{index-D5N9ikrS.d.ts → index-hCpxKePE.d.ts} +1 -1
- package/dist/{index-T2FOcOuI.d.ts → index-jOwU3YoR.d.ts} +400 -90
- package/dist/{index-DdGck82Y.d.ts → index-pNtfr-RW.d.ts} +2 -2
- package/dist/{index-BhpAUzUr.d.ts → index-unAZVFGz.d.ts} +2 -2
- package/dist/index.d.ts +84 -77
- package/dist/index.js +151 -134
- package/dist/inlineSize-BNe8wggI.js +66 -0
- package/dist/inputPresentation-BOyHkCDr.js +62 -0
- package/dist/interactionModality-ACpTMhak.js +44 -0
- package/dist/isApplePlatform-B1ju6F5B.js +27 -0
- package/dist/isRenderable-BnKHIqfd.js +21 -0
- package/dist/layerDepth-CNDh-IHb.js +181 -0
- package/dist/link-DuuA2eCL.js +30 -0
- package/dist/{loadCatalog-BGHKG_9N.d.ts → loadCatalog-DlLFZreI.d.ts} +281 -7
- package/dist/loadCatalog-eopw74qb.js +424 -0
- package/dist/locale/index.d.ts +2 -2
- package/dist/locale/index.js +4 -3
- package/dist/locale-CabGJlGp.js +343 -0
- package/dist/modalOutlet-CUOcrhIu.js +56 -0
- package/dist/optionAction-Cg7xQLUA.d.ts +6 -0
- package/dist/{power-search-DrDfcoL1.d.ts → power-search-gHLIYXs5.d.ts} +2 -0
- package/dist/protocol-DHxY0NI8.js +113 -0
- package/dist/protocol-RSeMzAN1.d.ts +238 -0
- package/dist/publicParser-B0MRoikr.d.ts +141 -0
- package/dist/publicParser-uHC_T0Fo.js +895 -0
- package/dist/resizableChannel-3vivrEcT.js +20 -0
- package/dist/safeUrl-CsvfcZ9m.js +54 -0
- package/dist/scopedProvide-C-Df7c15.js +30 -0
- package/dist/scrollKeyboardDelegation-D7cumnOl.js +238 -0
- package/dist/scrollLock-C3aT4-0z.js +102 -0
- package/dist/{searchResultMessage-hXXNOFJP.js → searchResultMessage-mCpJBvra.js} +5 -14
- package/dist/{semantic-CKH9XVqa.d.ts → semantic-BF_AjLvk.d.ts} +6 -3
- package/dist/slug-C65CUsf9.js +32 -0
- package/dist/syntaxContext-DmIfNNtb.js +4 -0
- package/dist/triggerVariant-BsL8jMHs.js +16 -0
- package/dist/{types-0Q_SJv_F.d.ts → types-Bb7OGivY.d.ts} +6 -1
- package/dist/{types-H4Bbbxiw.d.ts → types-BnNTzEnd.d.ts} +1 -1
- package/dist/{types-CwyibrRB.d.ts → types-C5GQ2KCK.d.ts} +23 -3
- package/dist/{types-BBWrcHMD.d.ts → types-Ckih2YJi.d.ts} +3 -2
- package/dist/{types-gKsEkk2g.d.ts → types-CsqwQkf1.d.ts} +143 -10
- package/dist/upstreamMap-xr3gvREu.js +731 -0
- package/dist/{useAnchoredListbox-DwztMNjP.js → useAnchoredListbox-DGxxKHZb.js} +2 -2
- package/dist/{useAsyncSource-xpQovjV_.d.ts → useAsyncSource-aGzrvRkI.d.ts} +3 -0
- package/dist/{useClickableContainer-DyNpnSEa.js → useClickableContainer-CdGp_Cev.js} +1 -1
- package/dist/{useClipboard-BDfbEsWd.js → useClipboard-Dk8cS810.js} +1 -1
- package/dist/useHoverLayerDismiss-kYJ_NqL4.js +27 -0
- package/dist/{useIndicator-i1NORM7W.js → useIndicator-MZmfBWid.js} +5 -23
- package/dist/{useInputContainer-CpgDe2-4.js → useInputContainer-CLcYrby4.js} +1 -1
- package/dist/{useInputStatusIcon-DBOwxV4x.js → useInputStatusIcon-DAE7PExr.js} +1 -1
- package/dist/useLayerMountTarget-BmZyeKWE.js +156 -0
- package/dist/{useListFocus-D0iOJl39.js → useListFocus-ChxLg0b4.js} +3 -2
- package/dist/{useMenuDrillIn-DzKGkTho.js → useMenuDrillIn-DhUnPvKs.js} +6 -5
- package/dist/useMenuHover-Djreu23i.js +170 -0
- package/dist/useMenuPress-8foxY8z4.js +764 -0
- package/dist/{useMergedRefs-CfHHlCsn.js → useMergedRefs-Cb6_w93m.js} +24 -4
- package/dist/{useNumberField-4-dIGVed.js → useNumberField-Dk1BE3-K.js} +3 -3
- package/dist/useOptionActionGrid-CkJcuvaU.js +97 -0
- package/dist/{usePositionedLayer-Cru9_00b.js → usePositionedLayer-B7cvG-_v.js} +43 -49
- package/dist/usePressFeedback-BJCpjEpv.js +319 -0
- package/dist/{useResizable-DDwPpPe6.d.ts → useResizable-1MHPNaRD.d.ts} +19 -1
- package/dist/{useResizable-B3ahKLoZ.js → useResizable-I3BCiLSL.js} +72 -40
- package/dist/useResolvedLabelHidden-B2rlWiaI.js +30 -0
- package/dist/{useRestoreFocus-Djw9RUIf.js → useRestoreFocus-XEKs5-gp.js} +49 -7
- package/dist/useScrollOverflow-DuMoGXmm.js +67 -0
- package/dist/useScrollableArea-BE8b3qm7.js +222 -0
- package/dist/useScrollbars-C2NJ6Qwq.js +43 -0
- package/dist/{useTimeValue-6ufHM15W.js → useTimeValue-BJd0xBhG.js} +4 -22
- package/dist/useTranslator-BmWt2BBt.js +35 -0
- package/dist/{useTypeahead-PAK8lMYz.js → useTypeahead-BvtflkRk.js} +4 -5
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.js +5 -0
- package/dist/{utils-D33VQDnk.js → utils-ClVseK2w.js} +29 -2
- package/dist/utils-z3Q6BGIJ.js +819 -0
- package/locales/SOURCE.json +1 -1
- package/package.json +24 -3
- package/reset.css +364 -1
- package/styles/avatar-group.css +9 -1
- package/styles/badge.css +8 -5
- package/styles/banner.css +124 -26
- package/styles/blockquote.css +1 -0
- package/styles/bordered-control.css +1 -1
- package/styles/bottom-sheet.css +74 -6
- package/styles/breadcrumbs.css +16 -2
- package/styles/button-group.css +3 -1
- package/styles/button.css +53 -11
- package/styles/card.css +1 -1
- package/styles/chat.css +16 -6
- package/styles/checkbox-input.css +10 -0
- package/styles/clickable-card.css +10 -3
- package/styles/collapsible.css +12 -5
- package/styles/command-palette.css +29 -14
- package/styles/complex-selector.css +22 -5
- package/styles/context-menu.css +3 -3
- package/styles/date-input.css +111 -1
- package/styles/dialog-header.css +4 -1
- package/styles/dialog.css +7 -0
- package/styles/dropdown-menu.css +12 -3
- package/styles/field.css +5 -0
- package/styles/form-layout.css +1 -0
- package/styles/heading.css +18 -8
- package/styles/icon.css +4 -0
- package/styles/kbd.css +1 -1
- package/styles/layer.css +72 -0
- package/styles/list.css +9 -2
- package/styles/metadata-list.css +1 -0
- package/styles/mobile-nav.css +4 -1
- package/styles/multi-selector.css +48 -1
- package/styles/nav-item.css +9 -2
- package/styles/nav-menu.css +12 -2
- package/styles/number-input.css +9 -1
- package/styles/overflow-list.css +1 -1
- package/styles/popover.css +2 -1
- package/styles/power-search.css +5 -3
- package/styles/pressable.css +63 -22
- package/styles/progress-bar.css +15 -3
- package/styles/radio.css +16 -0
- package/styles/resize-handle.css +42 -0
- package/styles/scrollbars.css +28 -0
- package/styles/segmented-control.css +12 -4
- package/styles/selector.css +53 -1
- package/styles/side-nav.css +19 -0
- package/styles/slider.css +4 -3
- package/styles/spinner.css +48 -42
- package/styles/stepper.css +58 -4
- package/styles/switch.css +26 -0
- package/styles/tab-list.css +132 -3
- package/styles/table.css +88 -10
- package/styles/text-area.css +1 -1
- package/styles/text-input.css +1 -1
- package/styles/text.css +6 -6
- package/styles/thumbnail.css +11 -3
- package/styles/time-input.css +8 -0
- package/styles/toast.css +37 -3
- package/styles/token.css +2 -2
- package/styles/tokenizer.css +1 -1
- package/styles/toolbar.css +4 -1
- package/styles/tree-list.css +1 -1
- package/styles/typeahead.css +34 -1
- package/styles.css +1 -0
- package/dist/Blockquote-DFqBv_oJ.js +0 -18
- package/dist/Breadcrumbs-DPVaziH4.js +0 -141
- package/dist/ButtonGroup-ySQWanDP.js +0 -125
- package/dist/DateTimeInput-DHp683jZ.js +0 -268
- package/dist/MultiSelector-BeV98x7X.js +0 -988
- package/dist/NumberInput-AZ9x3oja.js +0 -473
- package/dist/Selector-DuVozKNq.js +0 -675
- package/dist/Spinner-9cYUCnDy.js +0 -84
- package/dist/Theme-CtaUWo4g.js +0 -1246
- package/dist/Toast-BuqIZV5z.js +0 -322
- package/dist/context-4PuqD1Ic.js +0 -4
- package/dist/context-D5-MwxnN.js +0 -4
- package/dist/index-BH9PzQ1F.d.ts +0 -87
- package/dist/link-C4_WogdF.js +0 -18
- package/dist/loadCatalog-CXKqEB9s.js +0 -877
- package/dist/locale-DgkZEMTn.js +0 -105
- package/dist/platform-B_9W_aHW.js +0 -33
- package/dist/scrollLock-BzIvIimL.js +0 -42
- package/dist/useMenuPress-D-FRNrBW.js +0 -573
- package/dist/useScrollableArea-DDk_CluT.js +0 -172
- /package/dist/{index-lgvUFSCO.d.ts → index-CryFtTT6.d.ts} +0 -0
|
@@ -0,0 +1,424 @@
|
|
|
1
|
+
import { c as astryxMessages } from "./context-DWfi56sq.js";
|
|
2
|
+
import { t as upstreamMessageMap } from "./upstreamMap-xr3gvREu.js";
|
|
3
|
+
//#region src/locale/icu.ts
|
|
4
|
+
const pluralRules = /* @__PURE__ */ new Map();
|
|
5
|
+
const ordinalRules = /* @__PURE__ */ new Map();
|
|
6
|
+
const numberFormats = /* @__PURE__ */ new Map();
|
|
7
|
+
function rulesFor(locale, ordinal) {
|
|
8
|
+
const cache = ordinal ? ordinalRules : pluralRules;
|
|
9
|
+
let rules = cache.get(locale);
|
|
10
|
+
if (rules == null) {
|
|
11
|
+
rules = new Intl.PluralRules(locale, ordinal ? { type: "ordinal" } : void 0);
|
|
12
|
+
cache.set(locale, rules);
|
|
13
|
+
}
|
|
14
|
+
return rules;
|
|
15
|
+
}
|
|
16
|
+
function numberFor(locale) {
|
|
17
|
+
let format = numberFormats.get(locale);
|
|
18
|
+
if (format == null) {
|
|
19
|
+
format = new Intl.NumberFormat(locale);
|
|
20
|
+
numberFormats.set(locale, format);
|
|
21
|
+
}
|
|
22
|
+
return format;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* 解析原版目录里的 ICU MessageFormat。
|
|
26
|
+
* 覆盖 `{name}`、`{name, number}`、`plural`、`selectordinal` 和 `select`。
|
|
27
|
+
* 解析失败时抛错,调用方负责把这个键记进未映射列表。
|
|
28
|
+
*/
|
|
29
|
+
function formatIcu(message, values, locale) {
|
|
30
|
+
return render(parseMessage(message), values, locale, void 0);
|
|
31
|
+
}
|
|
32
|
+
function icuPlaceholderNames(message) {
|
|
33
|
+
return Object.keys(icuArgumentKinds(message));
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* 每个占位符名字用到的写法,已排序去重。
|
|
37
|
+
* 译文和原文的这张表一致,说明两边收同样的值;字面文字和占位符顺序不算在内。
|
|
38
|
+
* 解析失败时抛错。
|
|
39
|
+
*/
|
|
40
|
+
function icuArgumentKinds(message) {
|
|
41
|
+
const kinds = /* @__PURE__ */ new Map();
|
|
42
|
+
collectKinds(parseMessage(message), kinds);
|
|
43
|
+
return Object.fromEntries([...kinds].map(([name, set]) => [name, [...set].sort()]));
|
|
44
|
+
}
|
|
45
|
+
function collectKinds(nodes, kinds) {
|
|
46
|
+
for (const node of nodes) {
|
|
47
|
+
if (node.type === "text" || node.type === "pound") continue;
|
|
48
|
+
const kind = node.type === "arg" ? "argument" : node.type === "plural" && node.ordinal ? "selectordinal" : node.type;
|
|
49
|
+
const set = kinds.get(node.name) ?? /* @__PURE__ */ new Set();
|
|
50
|
+
set.add(kind);
|
|
51
|
+
kinds.set(node.name, set);
|
|
52
|
+
if (node.type === "plural" || node.type === "select") for (const option of node.options) collectKinds(option.nodes, kinds);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function render(nodes, values, locale, pound) {
|
|
56
|
+
let text = "";
|
|
57
|
+
for (const node of nodes) text += renderNode(node, values, locale, pound);
|
|
58
|
+
return text;
|
|
59
|
+
}
|
|
60
|
+
function renderNode(node, values, locale, pound) {
|
|
61
|
+
if (node.type === "text") return node.value;
|
|
62
|
+
if (node.type === "pound") return pound == null ? "" : numberFor(locale).format(pound);
|
|
63
|
+
if (node.type === "arg") return textValue(values[node.name]);
|
|
64
|
+
if (node.type === "number") {
|
|
65
|
+
const value = numericValue(values[node.name]);
|
|
66
|
+
return value == null ? "" : numberFor(locale).format(value);
|
|
67
|
+
}
|
|
68
|
+
if (node.type === "select") return renderChoice(node.options, selectSelector(values[node.name]), values, locale, pound);
|
|
69
|
+
const value = numericValue(values[node.name]);
|
|
70
|
+
const rounded = value == null ? void 0 : value - node.offset;
|
|
71
|
+
const selector = value == null ? "other" : pluralSelector(value, node.options, locale, node.ordinal);
|
|
72
|
+
return renderChoice(node.options, selector, values, locale, rounded);
|
|
73
|
+
}
|
|
74
|
+
function pluralSelector(value, options, locale, ordinal) {
|
|
75
|
+
const exact = exactSelector(value);
|
|
76
|
+
if (exact != null && options.some((option) => option.selector === exact)) return exact;
|
|
77
|
+
return rulesFor(locale, ordinal).select(value);
|
|
78
|
+
}
|
|
79
|
+
function renderChoice(options, selector, values, locale, pound) {
|
|
80
|
+
const match = options.find((option) => option.selector === selector) ?? options.find((option) => option.selector === "other") ?? options[0];
|
|
81
|
+
return match == null ? "" : render(match.nodes, values, locale, pound);
|
|
82
|
+
}
|
|
83
|
+
function textValue(value) {
|
|
84
|
+
if (value == null) return "";
|
|
85
|
+
return typeof value === "number" ? String(value) : value;
|
|
86
|
+
}
|
|
87
|
+
function numericValue(value) {
|
|
88
|
+
if (typeof value === "number" && Number.isFinite(value)) return value;
|
|
89
|
+
if (typeof value === "string" && value.trim() !== "") {
|
|
90
|
+
const parsed = Number(value);
|
|
91
|
+
if (Number.isFinite(parsed)) return parsed;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
function exactSelector(value) {
|
|
95
|
+
return Number.isInteger(value) ? `=${value}` : void 0;
|
|
96
|
+
}
|
|
97
|
+
function selectSelector(value) {
|
|
98
|
+
if (value == null) return "other";
|
|
99
|
+
return String(value);
|
|
100
|
+
}
|
|
101
|
+
function startsQuote(next, pluralPound) {
|
|
102
|
+
return next === "{" || next === "}" || next === "<" || next === ">" || pluralPound && next === "#";
|
|
103
|
+
}
|
|
104
|
+
function parseMessage(input) {
|
|
105
|
+
let index = 0;
|
|
106
|
+
function parseNodes(stop, pluralPound) {
|
|
107
|
+
const nodes = [];
|
|
108
|
+
let text = "";
|
|
109
|
+
const flush = () => {
|
|
110
|
+
if (text !== "") {
|
|
111
|
+
nodes.push({
|
|
112
|
+
type: "text",
|
|
113
|
+
value: text
|
|
114
|
+
});
|
|
115
|
+
text = "";
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
while (index < input.length) {
|
|
119
|
+
const char = input[index];
|
|
120
|
+
if (char === "'") {
|
|
121
|
+
const next = input[index + 1];
|
|
122
|
+
if (next === "'") {
|
|
123
|
+
text += "'";
|
|
124
|
+
index += 2;
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
if (!startsQuote(next, pluralPound)) {
|
|
128
|
+
text += "'";
|
|
129
|
+
index += 1;
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
index += 1;
|
|
133
|
+
while (index < input.length) {
|
|
134
|
+
if (input[index] === "'") {
|
|
135
|
+
if (input[index + 1] === "'") {
|
|
136
|
+
text += "'";
|
|
137
|
+
index += 2;
|
|
138
|
+
continue;
|
|
139
|
+
}
|
|
140
|
+
index += 1;
|
|
141
|
+
break;
|
|
142
|
+
}
|
|
143
|
+
text += input[index];
|
|
144
|
+
index += 1;
|
|
145
|
+
}
|
|
146
|
+
continue;
|
|
147
|
+
}
|
|
148
|
+
if (char === "#" && pluralPound) {
|
|
149
|
+
flush();
|
|
150
|
+
nodes.push({ type: "pound" });
|
|
151
|
+
index += 1;
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
if (char === "{") {
|
|
155
|
+
flush();
|
|
156
|
+
index += 1;
|
|
157
|
+
nodes.push(parseArgument());
|
|
158
|
+
continue;
|
|
159
|
+
}
|
|
160
|
+
if (stop != null && char === stop) {
|
|
161
|
+
flush();
|
|
162
|
+
return nodes;
|
|
163
|
+
}
|
|
164
|
+
text += char;
|
|
165
|
+
index += 1;
|
|
166
|
+
}
|
|
167
|
+
if (stop != null) throw new Error("ICU 消息没有闭合");
|
|
168
|
+
flush();
|
|
169
|
+
return nodes;
|
|
170
|
+
}
|
|
171
|
+
function parseArgument() {
|
|
172
|
+
skipSpace();
|
|
173
|
+
const name = readIdentifier();
|
|
174
|
+
skipSpace();
|
|
175
|
+
if (input[index] === "}") {
|
|
176
|
+
index += 1;
|
|
177
|
+
return {
|
|
178
|
+
type: "arg",
|
|
179
|
+
name
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
if (input[index] !== ",") throw new Error(`ICU 参数 ${name} 格式不对`);
|
|
183
|
+
index += 1;
|
|
184
|
+
skipSpace();
|
|
185
|
+
const kind = readIdentifier();
|
|
186
|
+
skipSpace();
|
|
187
|
+
if (kind === "number") {
|
|
188
|
+
if (input[index] === ",") skipNumberStyle();
|
|
189
|
+
expectChar("}");
|
|
190
|
+
index += 1;
|
|
191
|
+
return {
|
|
192
|
+
type: "number",
|
|
193
|
+
name
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
if (kind === "plural" || kind === "selectordinal" || kind === "select") {
|
|
197
|
+
expectChar(",");
|
|
198
|
+
index += 1;
|
|
199
|
+
skipSpace();
|
|
200
|
+
let offset = 0;
|
|
201
|
+
if (kind !== "select" && input.startsWith("offset:", index)) {
|
|
202
|
+
index += 7;
|
|
203
|
+
skipSpace();
|
|
204
|
+
offset = readInteger();
|
|
205
|
+
skipSpace();
|
|
206
|
+
}
|
|
207
|
+
const options = [];
|
|
208
|
+
while (index < input.length && input[index] !== "}") {
|
|
209
|
+
skipSpace();
|
|
210
|
+
if (input[index] === "}") break;
|
|
211
|
+
const selector = readSelector();
|
|
212
|
+
skipSpace();
|
|
213
|
+
expectChar("{");
|
|
214
|
+
index += 1;
|
|
215
|
+
const nodes = parseNodes("}", kind !== "select");
|
|
216
|
+
expectChar("}");
|
|
217
|
+
index += 1;
|
|
218
|
+
options.push({
|
|
219
|
+
selector,
|
|
220
|
+
nodes
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
expectChar("}");
|
|
224
|
+
index += 1;
|
|
225
|
+
if (options.length === 0) throw new Error(`ICU ${kind} 没有选项`);
|
|
226
|
+
if (kind === "select") return {
|
|
227
|
+
type: "select",
|
|
228
|
+
name,
|
|
229
|
+
options
|
|
230
|
+
};
|
|
231
|
+
return {
|
|
232
|
+
type: "plural",
|
|
233
|
+
name,
|
|
234
|
+
offset,
|
|
235
|
+
ordinal: kind === "selectordinal",
|
|
236
|
+
options
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
throw new Error(`不支持的 ICU 类型 ${kind}`);
|
|
240
|
+
}
|
|
241
|
+
function skipNumberStyle() {
|
|
242
|
+
let depth = 0;
|
|
243
|
+
while (index < input.length) {
|
|
244
|
+
const char = input[index];
|
|
245
|
+
if (char === "{") depth += 1;
|
|
246
|
+
else if (char === "}") {
|
|
247
|
+
if (depth === 0) return;
|
|
248
|
+
depth -= 1;
|
|
249
|
+
}
|
|
250
|
+
index += 1;
|
|
251
|
+
}
|
|
252
|
+
throw new Error("ICU number 没有闭合");
|
|
253
|
+
}
|
|
254
|
+
function skipSpace() {
|
|
255
|
+
while (index < input.length && (input[index] === " " || input[index] === "\n" || input[index] === "\r" || input[index] === " ")) index += 1;
|
|
256
|
+
}
|
|
257
|
+
function readIdentifier() {
|
|
258
|
+
const start = index;
|
|
259
|
+
while (index < input.length && /[\w$]/.test(input[index])) index += 1;
|
|
260
|
+
if (start === index) throw new Error("ICU 缺少参数名");
|
|
261
|
+
return input.slice(start, index);
|
|
262
|
+
}
|
|
263
|
+
function readSelector() {
|
|
264
|
+
if (input[index] === "=") {
|
|
265
|
+
index += 1;
|
|
266
|
+
const sign = input[index] === "-" ? "-" : "";
|
|
267
|
+
if (sign) index += 1;
|
|
268
|
+
return `=${sign}${readInteger()}`;
|
|
269
|
+
}
|
|
270
|
+
return readIdentifier();
|
|
271
|
+
}
|
|
272
|
+
function readInteger() {
|
|
273
|
+
const start = index;
|
|
274
|
+
while (index < input.length && input[index] >= "0" && input[index] <= "9") index += 1;
|
|
275
|
+
if (start === index) throw new Error("ICU 缺少数字");
|
|
276
|
+
return Number(input.slice(start, index));
|
|
277
|
+
}
|
|
278
|
+
function expectChar(char) {
|
|
279
|
+
if (input[index] !== char) throw new Error(`ICU 期望 ${char}`);
|
|
280
|
+
}
|
|
281
|
+
return parseNodes(null, false);
|
|
282
|
+
}
|
|
283
|
+
//#endregion
|
|
284
|
+
//#region src/locale/loadCatalog.ts
|
|
285
|
+
/**
|
|
286
|
+
* 把一份原版 Astryx locale JSON 映射成 `AstryxMessages`。
|
|
287
|
+
* 内置的 `en` 和 `zh-CN` 不会被改掉。返回值要交给 `provideAstryxLocale` 的第二个参数。
|
|
288
|
+
* `unmapped` 列出每一个没写进文案树的键。
|
|
289
|
+
*/
|
|
290
|
+
function loadAstryxCatalog(locale, catalog) {
|
|
291
|
+
const messages = cloneMessages(astryxMessages.en);
|
|
292
|
+
const tree = messages;
|
|
293
|
+
const assigned = /* @__PURE__ */ new Set();
|
|
294
|
+
const unmapped = [];
|
|
295
|
+
const present = /* @__PURE__ */ new Set();
|
|
296
|
+
for (const key of Object.keys(catalog).sort()) {
|
|
297
|
+
present.add(key);
|
|
298
|
+
const read = readMessage(catalog[key]);
|
|
299
|
+
if (read.message == null) {
|
|
300
|
+
unmapped.push({
|
|
301
|
+
key,
|
|
302
|
+
message: read.invalid,
|
|
303
|
+
reason: "invalid-entry"
|
|
304
|
+
});
|
|
305
|
+
continue;
|
|
306
|
+
}
|
|
307
|
+
const targets = upstreamMessageMap[key];
|
|
308
|
+
if (targets == null) {
|
|
309
|
+
unmapped.push({
|
|
310
|
+
key,
|
|
311
|
+
message: read.message,
|
|
312
|
+
reason: "no-slot"
|
|
313
|
+
});
|
|
314
|
+
continue;
|
|
315
|
+
}
|
|
316
|
+
if (!writeTargets(tree, assigned, targets, read.message, locale)) unmapped.push({
|
|
317
|
+
key,
|
|
318
|
+
message: read.message,
|
|
319
|
+
reason: failureReason(targets, assigned, read.message)
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
const missingKeys = Object.keys(upstreamMessageMap).filter((key) => !present.has(key)).sort();
|
|
323
|
+
const fallbackFields = collectLeaves(tree).filter((path) => !assigned.has(path)).sort();
|
|
324
|
+
unmapped.sort((a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0);
|
|
325
|
+
return {
|
|
326
|
+
locale,
|
|
327
|
+
messages,
|
|
328
|
+
unmapped,
|
|
329
|
+
missingKeys,
|
|
330
|
+
fallbackFields
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
function writeTargets(tree, assigned, targets, message, locale) {
|
|
334
|
+
let wrote = false;
|
|
335
|
+
let names;
|
|
336
|
+
try {
|
|
337
|
+
names = icuPlaceholderNames(message);
|
|
338
|
+
} catch {
|
|
339
|
+
return false;
|
|
340
|
+
}
|
|
341
|
+
for (const target of targets) {
|
|
342
|
+
if (assigned.has(target.path)) continue;
|
|
343
|
+
const args = target.args ?? [];
|
|
344
|
+
if (names.some((name) => !args.includes(name))) continue;
|
|
345
|
+
let value;
|
|
346
|
+
try {
|
|
347
|
+
value = target.args == null ? cleanup(formatIcu(message, {}, locale)) : bindMessage(message, target.args, locale);
|
|
348
|
+
} catch {
|
|
349
|
+
continue;
|
|
350
|
+
}
|
|
351
|
+
setPath(tree, target.path, value);
|
|
352
|
+
assigned.add(target.path);
|
|
353
|
+
wrote = true;
|
|
354
|
+
}
|
|
355
|
+
return wrote;
|
|
356
|
+
}
|
|
357
|
+
function failureReason(targets, assigned, message) {
|
|
358
|
+
let names;
|
|
359
|
+
try {
|
|
360
|
+
names = icuPlaceholderNames(message);
|
|
361
|
+
} catch {
|
|
362
|
+
return "unsupported-message";
|
|
363
|
+
}
|
|
364
|
+
const openTargets = targets.filter((target) => !assigned.has(target.path));
|
|
365
|
+
if (openTargets.length === 0) return "slot-taken";
|
|
366
|
+
return openTargets.some((target) => {
|
|
367
|
+
const args = target.args ?? [];
|
|
368
|
+
return names.some((name) => !args.includes(name));
|
|
369
|
+
}) ? "placeholder-mismatch" : "unsupported-message";
|
|
370
|
+
}
|
|
371
|
+
function bindMessage(message, args, locale) {
|
|
372
|
+
return (...values) => {
|
|
373
|
+
const bag = {};
|
|
374
|
+
args.forEach((name, index) => {
|
|
375
|
+
bag[name] = coerce(values[index]);
|
|
376
|
+
});
|
|
377
|
+
return cleanup(formatIcu(message, bag, locale));
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
function coerce(value) {
|
|
381
|
+
if (typeof value === "number" || typeof value === "string") return value;
|
|
382
|
+
if (value == null) return void 0;
|
|
383
|
+
return String(value);
|
|
384
|
+
}
|
|
385
|
+
function cleanup(text) {
|
|
386
|
+
return text.replace(/[ \t]{2,}/g, " ").trim();
|
|
387
|
+
}
|
|
388
|
+
function readMessage(entry) {
|
|
389
|
+
if (typeof entry === "string") return { message: entry };
|
|
390
|
+
if (entry != null && typeof entry === "object" && typeof entry.defaultMessage === "string") return { message: entry.defaultMessage };
|
|
391
|
+
return { invalid: JSON.stringify(entry) };
|
|
392
|
+
}
|
|
393
|
+
function cloneMessages(source) {
|
|
394
|
+
return cloneValue(source);
|
|
395
|
+
}
|
|
396
|
+
function cloneValue(value) {
|
|
397
|
+
if (typeof value === "function" || value == null || typeof value !== "object") return value;
|
|
398
|
+
const copy = {};
|
|
399
|
+
for (const [key, child] of Object.entries(value)) copy[key] = cloneValue(child);
|
|
400
|
+
return copy;
|
|
401
|
+
}
|
|
402
|
+
function setPath(tree, path, value) {
|
|
403
|
+
const parts = path.split(".");
|
|
404
|
+
let cursor = tree;
|
|
405
|
+
for (const part of parts.slice(0, -1)) {
|
|
406
|
+
const next = cursor[part];
|
|
407
|
+
if (next == null || typeof next === "function" || typeof next === "string") throw new Error(`消息路径不存在:${path}`);
|
|
408
|
+
cursor = next;
|
|
409
|
+
}
|
|
410
|
+
const leaf = parts[parts.length - 1];
|
|
411
|
+
if (leaf == null || !Object.hasOwn(cursor, leaf)) throw new Error(`消息路径不存在:${path}`);
|
|
412
|
+
cursor[leaf] = value;
|
|
413
|
+
}
|
|
414
|
+
function collectLeaves(tree, prefix = "") {
|
|
415
|
+
const paths = [];
|
|
416
|
+
for (const [key, value] of Object.entries(tree)) {
|
|
417
|
+
const path = prefix === "" ? key : `${prefix}.${key}`;
|
|
418
|
+
if (typeof value === "string" || typeof value === "function") paths.push(path);
|
|
419
|
+
else paths.push(...collectLeaves(value, path));
|
|
420
|
+
}
|
|
421
|
+
return paths;
|
|
422
|
+
}
|
|
423
|
+
//#endregion
|
|
424
|
+
export { formatIcu as n, icuPlaceholderNames as r, loadAstryxCatalog as t };
|
package/dist/locale/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as UseLocaleReturn, c as formatCalendarMonth, d as astryxMessagesKey, f as normalizeLocale, g as AstryxLocale, h as useAstryxMessages, i as useTranslator, l as weekdayNames, m as useAstryxLocale, n as TranslatorValues, o as useLocale, p as provideAstryxLocale, r as UseTranslatorReturn, s as useCollator, t as Translator, u as astryxLocaleKey } from "../index-
|
|
2
|
-
import { a as UnmappedUpstreamReason, i as UnmappedUpstreamEntry, n as AstryxUpstreamMessage, o as loadAstryxCatalog, r as LoadedAstryxLocale, s as AstryxMessages, t as AstryxUpstreamCatalog } from "../loadCatalog-
|
|
1
|
+
import { a as UseLocaleReturn, c as formatCalendarMonth, d as astryxMessagesKey, f as normalizeLocale, g as AstryxLocale, h as useAstryxMessages, i as useTranslator, l as weekdayNames, m as useAstryxLocale, n as TranslatorValues, o as useLocale, p as provideAstryxLocale, r as UseTranslatorReturn, s as useCollator, t as Translator, u as astryxLocaleKey } from "../index-CKgBTAzC.js";
|
|
2
|
+
import { a as UnmappedUpstreamReason, i as UnmappedUpstreamEntry, n as AstryxUpstreamMessage, o as loadAstryxCatalog, r as LoadedAstryxLocale, s as AstryxMessages, t as AstryxUpstreamCatalog } from "../loadCatalog-DlLFZreI.js";
|
|
3
3
|
export { type AstryxLocale, type AstryxMessages, type AstryxUpstreamCatalog, type AstryxUpstreamMessage, type LoadedAstryxLocale, type Translator, type TranslatorValues, type UnmappedUpstreamEntry, type UnmappedUpstreamReason, type UseLocaleReturn, type UseTranslatorReturn, astryxLocaleKey, astryxMessagesKey, formatCalendarMonth, loadAstryxCatalog, normalizeLocale, provideAstryxLocale, useAstryxLocale, useAstryxMessages, useCollator, useLocale, useTranslator, weekdayNames };
|
package/dist/locale/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import {
|
|
3
|
-
import { t as loadAstryxCatalog } from "../loadCatalog-
|
|
1
|
+
import { a as provideAstryxLocale, i as normalizeLocale, n as astryxMessagesKey, o as useAstryxLocale, s as useAstryxMessages, t as astryxLocaleKey } from "../context-DWfi56sq.js";
|
|
2
|
+
import { a as weekdayNames, n as useCollator, r as formatCalendarMonth, t as useLocale } from "../locale-CabGJlGp.js";
|
|
3
|
+
import { t as loadAstryxCatalog } from "../loadCatalog-eopw74qb.js";
|
|
4
|
+
import { t as useTranslator } from "../useTranslator-BmWt2BBt.js";
|
|
4
5
|
export { astryxLocaleKey, astryxMessagesKey, formatCalendarMonth, loadAstryxCatalog, normalizeLocale, provideAstryxLocale, useAstryxLocale, useAstryxMessages, useCollator, useLocale, useTranslator, weekdayNames };
|