@astryx-vue/core 0.7.13 → 0.7.14
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/dist/AppShell/index.js +1 -1
- package/dist/{AppShell-CqDS_G4G.js → AppShell-CYS8WXJ9.js} +2 -2
- package/dist/Avatar/index.js +1 -1
- package/dist/{Avatar-DJD56XAx.js → Avatar-BLPUC07s.js} +1 -1
- package/dist/AvatarGroup/index.d.ts +1 -1
- package/dist/AvatarGroup/index.js +1 -1
- package/dist/{AvatarGroup-ezWQX5UE.js → AvatarGroup-DkdSw1yf.js} +1 -1
- package/dist/Banner/index.d.ts +1 -1
- package/dist/Banner/index.js +1 -1
- package/dist/{Banner-CswzZPfJ.js → Banner-BAq0N2B5.js} +1 -1
- package/dist/BottomSheet/index.d.ts +1 -1
- package/dist/Breadcrumbs/index.js +1 -1
- package/dist/{Breadcrumbs-CEA0ioO6.js → Breadcrumbs-CbHpqPFH.js} +1 -1
- package/dist/ButtonGroup/index.d.ts +1 -1
- package/dist/Calendar/index.d.ts +1 -1
- package/dist/Calendar/index.js +1 -1
- package/dist/{Calendar-Gx77cbI3.js → Calendar-CJQCND7M.js} +2 -2
- package/dist/Carousel/index.js +1 -1
- package/dist/{Carousel-N9tDxozW.js → Carousel-v8MoIvkj.js} +1 -1
- package/dist/Chat/index.d.ts +1 -1
- package/dist/Chat/index.js +1 -1
- package/dist/{Chat-CTbSrHfV.js → Chat-CZqMkxNN.js} +2 -2
- package/dist/CheckboxInput/index.d.ts +1 -1
- package/dist/CheckboxList/index.d.ts +1 -1
- package/dist/CheckboxList/index.js +1 -1
- package/dist/{CheckboxList-aim5LzZ7.js → CheckboxList-CIbjO5sX.js} +1 -1
- package/dist/Citation/index.js +1 -1
- package/dist/{Citation-D-El27C6.js → Citation-BDHIuvX3.js} +1 -1
- package/dist/ClickableCard/index.d.ts +1 -1
- package/dist/CommandPalette/index.js +1 -1
- package/dist/{CommandPalette-CVukbDIa.js → CommandPalette-DYRnEj8W.js} +2 -2
- package/dist/ComplexSelector/index.js +1 -1
- package/dist/{ComplexSelector-ClGxdYzt.js → ComplexSelector-ClPFa7tt.js} +2 -2
- package/dist/ContextMenu/index.d.ts +1 -1
- package/dist/ContextMenu/index.js +1 -1
- package/dist/{ContextMenu-C4Ov6MeG.js → ContextMenu-C1dNw-kL.js} +2 -2
- package/dist/DateInput/index.d.ts +1 -1
- package/dist/DateInput/index.js +1 -1
- package/dist/{DateInput-C6CD1sCV.js → DateInput-CJ5LZkb3.js} +4 -4
- package/dist/DateRangeInput/index.d.ts +1 -1
- package/dist/DateRangeInput/index.js +1 -1
- package/dist/{DateRangeInput-BUdnZCEa.js → DateRangeInput-CODHgf6A.js} +3 -3
- package/dist/DateTimeInput/index.d.ts +1 -1
- package/dist/DateTimeInput/index.js +1 -1
- package/dist/{DateTimeInput-B9zKC2vp.js → DateTimeInput-BNqYdBps.js} +4 -4
- package/dist/Dialog/index.js +1 -1
- package/dist/{DialogHeader-B-Lz4rB5.js → DialogHeader-BrskbLr4.js} +1 -1
- package/dist/Drawer/index.d.ts +1 -1
- package/dist/Drawer/index.js +1 -1
- package/dist/{Drawer-DjSbpQcy.js → Drawer-CDLPsaoR.js} +1 -1
- package/dist/DropdownMenu/index.js +2 -2
- package/dist/{DropdownMenu-YsxODlV4.js → DropdownMenu-CisXQME2.js} +3 -3
- package/dist/{DropdownMenu-CenkpwtH.js → DropdownMenu-JqLXEqmI.js} +1 -1
- package/dist/Field/index.js +1 -1
- package/dist/FileInput/index.d.ts +1 -1
- package/dist/FileInput/index.js +1 -1
- package/dist/{FileInput-lAMIbbni.js → FileInput-D5aCk6kL.js} +3 -3
- package/dist/Heading/index.d.ts +1 -1
- package/dist/HoverCard/index.d.ts +1 -1
- package/dist/{InputClearButton-CBCi06tn.js → InputClearButton-Dd1GgItq.js} +1 -1
- package/dist/InternationalizationProvider/index.d.ts +1 -1
- package/dist/InternationalizationProvider/index.js +1 -1
- package/dist/{InternationalizationProvider-qkLAE9Gm.js → InternationalizationProvider-DKNYYBp5.js} +3 -3
- package/dist/Lightbox/index.js +1 -1
- package/dist/{Lightbox-DmrWEQY7.js → Lightbox-Bx1uvH61.js} +1 -1
- package/dist/Link/index.js +1 -1
- package/dist/{Link-rT-hDx-e.js → Link-M-Slj9ez.js} +1 -1
- package/dist/Markdown/index.js +1 -1
- package/dist/{Markdown-DNvqv2Mu.js → Markdown-DDpbD0Sq.js} +2 -2
- package/dist/MetadataList/index.js +1 -1
- package/dist/{MetadataList-CzOUB43j.js → MetadataList-sNNwmmXa.js} +1 -1
- package/dist/MobileNav/index.js +1 -1
- package/dist/{MobileNavToggle-DvC9xZIC.js → MobileNavToggle-Bmu1OpEL.js} +1 -1
- package/dist/MoreMenu/index.d.ts +1 -1
- package/dist/MoreMenu/index.js +1 -1
- package/dist/{MoreMenu-Cn8fG326.js → MoreMenu-QWReDavJ.js} +1 -1
- package/dist/MultiSelector/index.d.ts +1 -1
- package/dist/MultiSelector/index.js +1 -1
- package/dist/{MultiSelector-Yi9nnEhy.js → MultiSelector-CFzCvmwp.js} +4 -4
- package/dist/{NavHeadingSurface-Bxyk1qhq.js → NavHeadingSurface-tn7cGNlX.js} +1 -1
- package/dist/NumberInput/index.d.ts +1 -1
- package/dist/NumberInput/index.js +1 -1
- package/dist/{NumberInput-DP7XAtGl.js → NumberInput-D3GJDfEd.js} +2 -2
- package/dist/Outline/index.js +1 -1
- package/dist/{Outline-1Sh26FpE.js → Outline-C6xBCP2y.js} +1 -1
- package/dist/OverflowList/index.d.ts +1 -1
- package/dist/OverflowList/index.js +1 -1
- package/dist/{OverflowList-Cs6SZ_1W.js → OverflowList-BHnarnHA.js} +1 -1
- package/dist/Overlay/index.d.ts +1 -1
- package/dist/Pagination/index.d.ts +1 -1
- package/dist/Pagination/index.js +1 -1
- package/dist/{Pagination-BzHqWFLM.js → Pagination-CQj_wYfI.js} +2 -2
- package/dist/Popover/index.d.ts +1 -1
- package/dist/PowerSearch/index.d.ts +1 -1
- package/dist/PowerSearch/index.js +1 -1
- package/dist/{PowerSearch-CxGjKHKW.js → PowerSearch-CtS6Lb32.js} +13 -13
- package/dist/Radio/index.d.ts +1 -1
- package/dist/RadioList/index.d.ts +1 -1
- package/dist/Resizable/index.d.ts +1 -1
- package/dist/Resizable/index.js +1 -1
- package/dist/{ResizeHandle-DhDxFvOI.js → ResizeHandle-Bxt3HOsd.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 +1 -1
- package/dist/Selector/index.js +1 -1
- package/dist/{Selector-Ao0H26LN.js → Selector-B6BEBXzZ.js} +3 -3
- package/dist/SideNav/index.d.ts +1 -1
- package/dist/SideNav/index.js +1 -1
- package/dist/{SideNav-Dz9uQFO4.js → SideNav-51VcU4uB.js} +3 -3
- package/dist/Spinner/index.js +1 -1
- package/dist/{Spinner-B7xuy3ZA.js → Spinner-D8YW_EgO.js} +1 -1
- package/dist/Stack/index.d.ts +1 -1
- package/dist/Stepper/index.d.ts +1 -1
- package/dist/Stepper/index.js +1 -1
- package/dist/{Stepper-BB-tXsGy.js → Stepper-D_tzl2pr.js} +1 -1
- package/dist/Switch/index.d.ts +1 -1
- package/dist/Switch/index.js +1 -1
- package/dist/{Switch-DSuC0F7H.js → Switch-GIld457S.js} +1 -1
- package/dist/TabList/index.js +1 -1
- package/dist/{TabList-CchZBEPh.js → TabList-B9RRmiqV.js} +1 -1
- package/dist/Table/index.d.ts +1 -1
- package/dist/Table/index.js +1 -1
- package/dist/{Table-BIzY_pTL.js → Table-ChVsEuB0.js} +8 -8
- package/dist/Text/index.d.ts +1 -1
- package/dist/TextArea/index.d.ts +1 -1
- package/dist/TextArea/index.js +1 -1
- package/dist/{TextArea-DpDQCb59.js → TextArea-jled6DMh.js} +2 -2
- package/dist/TextInput/index.d.ts +1 -1
- package/dist/TextInput/index.js +1 -1
- package/dist/{TextInput-CzAq1vnQ.js → TextInput-rdwpMErv.js} +2 -2
- package/dist/Thumbnail/index.js +1 -1
- package/dist/{Thumbnail-CMg6lU2v.js → Thumbnail-BC4-JVWr.js} +2 -2
- package/dist/{TimeField-Dx-kKLOS.js → TimeField-BcGkQvY4.js} +2 -2
- package/dist/TimeInput/index.d.ts +1 -1
- package/dist/TimeInput/index.js +1 -1
- package/dist/{TimeInput-CZZRDp0n.js → TimeInput-DKY6qhOK.js} +1 -1
- package/dist/Timestamp/index.d.ts +1 -1
- package/dist/Timestamp/index.js +1 -1
- package/dist/{Timestamp-DqwJAzCD.js → Timestamp-BPFUaR4k.js} +1 -1
- package/dist/Toast/index.js +1 -1
- package/dist/{Toast-CCbbZ8RK.js → Toast-CN6C5mZ4.js} +1 -1
- 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-DP3bU-8c.js → Token-rBcE4hYh.js} +1 -1
- package/dist/Tokenizer/index.js +1 -1
- package/dist/{Tokenizer-DC2AqiEU.js → Tokenizer-QsHKjPcl.js} +3 -3
- package/dist/Toolbar/index.d.ts +1 -1
- package/dist/Tooltip/index.d.ts +1 -1
- package/dist/TopNav/index.d.ts +1 -1
- package/dist/TopNav/index.js +1 -1
- package/dist/{TopNav-FgHFUA3F.js → TopNav-C9iMSVz_.js} +3 -3
- package/dist/TreeList/index.js +1 -1
- package/dist/{TreeList-rz7FL_GT.js → TreeList-DYJ1e47h.js} +1 -1
- package/dist/Typeahead/index.js +2 -2
- package/dist/{Typeahead-CCiqxJ9T.js → Typeahead-B215VyXn.js} +4 -4
- package/dist/{TypeaheadMenu-By-HLpFy.js → TypeaheadMenu-CafYGgVa.js} +1 -1
- package/dist/composables/index.js +1 -1
- package/dist/{composables-Csqd3fts.js → composables-rlh0LyHP.js} +1 -1
- package/dist/{context-CVUee2tp.js → context-dY6CBI-t.js} +519 -4
- package/dist/{index-DImU6Y2C.d.ts → index-BARe_U6c.d.ts} +1 -1
- package/dist/{index-BgT6mH3U.d.ts → index-BB9acgK8.d.ts} +1 -1
- package/dist/{index-DrwSI1fc.d.ts → index-BLvLFxf2.d.ts} +20 -20
- package/dist/{index-BxWCX2pJ.d.ts → index-BOCb89V9.d.ts} +1 -1
- package/dist/{index-D97pQbua.d.ts → index-BV2D2x_u.d.ts} +1 -1
- package/dist/{index-BDZCJ9ri.d.ts → index-BuubzuE8.d.ts} +2 -2
- package/dist/{index-Dl4Kx5Pl.d.ts → index-C7sam-SB.d.ts} +1 -1
- package/dist/{index-DPocrd8C.d.ts → index-CKpz_Eed.d.ts} +1 -1
- package/dist/{index-DaXzQxos.d.ts → index-CQlZYJRf.d.ts} +1 -1
- package/dist/{index-D_8RGgF1.d.ts → index-CRPSZ4nY.d.ts} +1 -1
- package/dist/{index-CVn0GBdB.d.ts → index-Ca8VIE4l.d.ts} +1 -1
- package/dist/{index-BbArm3_c.d.ts → index-CiL3dwRL.d.ts} +1 -1
- package/dist/{index-GpET2_oj.d.ts → index-Cq31D3fJ.d.ts} +1 -1
- package/dist/{index-BEvmfcQG.d.ts → index-CrJLg510.d.ts} +3 -3
- package/dist/{index-DAMHLkmd.d.ts → index-DB2tQa0s.d.ts} +1 -1
- package/dist/{index-rnFsCdJ7.d.ts → index-Dh04tMFf.d.ts} +1 -1
- package/dist/{index-CkRAvbdh.d.ts → index-FW9Owexp.d.ts} +3 -3
- package/dist/{index-QmmrXztz.d.ts → index-RW8kvEwf.d.ts} +1 -1
- package/dist/index.d.ts +20 -20
- package/dist/index.js +60 -60
- package/dist/loadCatalog-Cr3451_V.js +143 -0
- package/dist/{loadCatalog-yVGfaB20.d.ts → loadCatalog-DNIEPF3f.d.ts} +118 -0
- package/dist/locale/index.d.ts +2 -2
- package/dist/locale/index.js +4 -4
- package/dist/{locale-D4DoSjrL.js → locale-BdA3CTlQ.js} +1 -1
- package/dist/{searchResultMessage-DEyqvflW.js → searchResultMessage-u1rOubPl.js} +1 -1
- package/dist/{upstreamMap-BFXZHlnp.js → upstreamMap-CZUPxbc9.js} +144 -1
- package/dist/{useTranslator-BQ1KFNSZ.js → useTranslator-DZBywLvR.js} +2 -2
- package/package.json +1 -1
- package/dist/loadCatalog-BvoQXMpW.js +0 -424
- package/dist/{index-CHx33xGa.d.ts → index-5FGt4HsB.d.ts} +1 -1
|
@@ -60,6 +60,148 @@ const chatUpstreamMap = {
|
|
|
60
60
|
"@astryx.chatTriggerMenu.suggestions": [{ path: "chat.suggestions" }]
|
|
61
61
|
};
|
|
62
62
|
//#endregion
|
|
63
|
+
//#region src/locale/upstream/comments.ts
|
|
64
|
+
/**
|
|
65
|
+
* 表情选择器、评论和评论输入框。
|
|
66
|
+
* 评论组件还没落地;键先接进来,`useTranslator` 可以按原版键取文案。
|
|
67
|
+
*/
|
|
68
|
+
const commentsUpstreamMap = {
|
|
69
|
+
"@astryx.emojiPicker.frequentlyUsed": [{ path: "emojiPicker.frequentlyUsed" }],
|
|
70
|
+
"@astryx.emojiPicker.groupActivities": [{ path: "emojiPicker.groupActivities" }],
|
|
71
|
+
"@astryx.emojiPicker.groupAnimalsNature": [{ path: "emojiPicker.groupAnimalsNature" }],
|
|
72
|
+
"@astryx.emojiPicker.groupFlags": [{ path: "emojiPicker.groupFlags" }],
|
|
73
|
+
"@astryx.emojiPicker.groupFoodDrink": [{ path: "emojiPicker.groupFoodDrink" }],
|
|
74
|
+
"@astryx.emojiPicker.groupObjects": [{ path: "emojiPicker.groupObjects" }],
|
|
75
|
+
"@astryx.emojiPicker.groupPeopleBody": [{ path: "emojiPicker.groupPeopleBody" }],
|
|
76
|
+
"@astryx.emojiPicker.groupSmileysEmotion": [{ path: "emojiPicker.groupSmileysEmotion" }],
|
|
77
|
+
"@astryx.emojiPicker.groupSymbols": [{ path: "emojiPicker.groupSymbols" }],
|
|
78
|
+
"@astryx.emojiPicker.groupTravelPlaces": [{ path: "emojiPicker.groupTravelPlaces" }],
|
|
79
|
+
"@astryx.emojiPicker.label": [{ path: "emojiPicker.label" }],
|
|
80
|
+
"@astryx.emojiPicker.loadFailed": [{ path: "emojiPicker.loadFailed" }],
|
|
81
|
+
"@astryx.emojiPicker.loading": [{ path: "emojiPicker.loading" }],
|
|
82
|
+
"@astryx.emojiPicker.noResults": [{
|
|
83
|
+
path: "emojiPicker.noResults",
|
|
84
|
+
args: ["query"]
|
|
85
|
+
}],
|
|
86
|
+
"@astryx.emojiPicker.searchLabel": [{ path: "emojiPicker.searchLabel" }],
|
|
87
|
+
"@astryx.emojiPicker.searchResults": [{ path: "emojiPicker.searchResults" }],
|
|
88
|
+
"@astryx.comments.actionsLabel": [{
|
|
89
|
+
path: "comments.actionsLabel",
|
|
90
|
+
args: ["name"]
|
|
91
|
+
}],
|
|
92
|
+
"@astryx.comments.addReaction": [{ path: "comments.addReaction" }],
|
|
93
|
+
"@astryx.comments.agentBadge": [{ path: "comments.agentBadge" }],
|
|
94
|
+
"@astryx.comments.agentLogo": [{
|
|
95
|
+
path: "comments.agentLogo",
|
|
96
|
+
args: ["name"]
|
|
97
|
+
}],
|
|
98
|
+
"@astryx.comments.chooseReaction": [{ path: "comments.chooseReaction" }],
|
|
99
|
+
"@astryx.comments.commentsLabel": [{
|
|
100
|
+
path: "comments.commentsLabel",
|
|
101
|
+
args: ["label"]
|
|
102
|
+
}],
|
|
103
|
+
"@astryx.comments.copyLink": [{ path: "comments.copyLink" }],
|
|
104
|
+
"@astryx.comments.currentVersion": [{ path: "comments.currentVersion" }],
|
|
105
|
+
"@astryx.comments.delete": [{ path: "comments.delete" }],
|
|
106
|
+
"@astryx.comments.deleteDescription": [{
|
|
107
|
+
path: "comments.deleteDescription",
|
|
108
|
+
args: ["name"]
|
|
109
|
+
}],
|
|
110
|
+
"@astryx.comments.deleteFailed": [{ path: "comments.deleteFailed" }],
|
|
111
|
+
"@astryx.comments.deleteFailedRetry": [{ path: "comments.deleteFailedRetry" }],
|
|
112
|
+
"@astryx.comments.deleteTitle": [{ path: "comments.deleteTitle" }],
|
|
113
|
+
"@astryx.comments.edit": [{ path: "comments.edit" }],
|
|
114
|
+
"@astryx.comments.editFailed": [{ path: "comments.editFailed" }],
|
|
115
|
+
"@astryx.comments.editPlaceholder": [{ path: "comments.editPlaceholder" }],
|
|
116
|
+
"@astryx.comments.edited": [{ path: "comments.edited" }],
|
|
117
|
+
"@astryx.comments.editingContext": [{ path: "comments.editingContext" }],
|
|
118
|
+
"@astryx.comments.emptyDescription": [{ path: "comments.emptyDescription" }],
|
|
119
|
+
"@astryx.comments.emptyReadOnlyDescription": [{ path: "comments.emptyReadOnlyDescription" }],
|
|
120
|
+
"@astryx.comments.emptyTitle": [{ path: "comments.emptyTitle" }],
|
|
121
|
+
"@astryx.comments.hideReplies": [{ path: "comments.hideReplies" }],
|
|
122
|
+
"@astryx.comments.historyEmptyDescription": [{ path: "comments.historyEmptyDescription" }],
|
|
123
|
+
"@astryx.comments.historyEmptyTitle": [{ path: "comments.historyEmptyTitle" }],
|
|
124
|
+
"@astryx.comments.historyFailed": [{ path: "comments.historyFailed" }],
|
|
125
|
+
"@astryx.comments.historyLoadFailed": [{ path: "comments.historyLoadFailed" }],
|
|
126
|
+
"@astryx.comments.historyLoading": [{ path: "comments.historyLoading" }],
|
|
127
|
+
"@astryx.comments.historySubtitle": [{
|
|
128
|
+
path: "comments.historySubtitle",
|
|
129
|
+
args: ["name"]
|
|
130
|
+
}],
|
|
131
|
+
"@astryx.comments.historyTitle": [{ path: "comments.historyTitle" }],
|
|
132
|
+
"@astryx.comments.label": [{ path: "comments.label" }],
|
|
133
|
+
"@astryx.comments.linkCopied": [{ path: "comments.linkCopied" }],
|
|
134
|
+
"@astryx.comments.loadFailed": [{ path: "comments.loadFailed" }],
|
|
135
|
+
"@astryx.comments.loadOlder": [{ path: "comments.loadOlder" }],
|
|
136
|
+
"@astryx.comments.loading": [{ path: "comments.loading" }],
|
|
137
|
+
"@astryx.comments.olderFailed": [{ path: "comments.olderFailed" }],
|
|
138
|
+
"@astryx.comments.otherReactors": [{
|
|
139
|
+
path: "comments.otherReactors",
|
|
140
|
+
args: ["count"]
|
|
141
|
+
}],
|
|
142
|
+
"@astryx.comments.outdated": [{ path: "comments.outdated" }],
|
|
143
|
+
"@astryx.comments.postFailed": [{ path: "comments.postFailed" }],
|
|
144
|
+
"@astryx.comments.reactionCelebrate": [{ path: "comments.reactionCelebrate" }],
|
|
145
|
+
"@astryx.comments.reactionCount": [{
|
|
146
|
+
path: "comments.reactionCount",
|
|
147
|
+
args: ["reaction", "count"]
|
|
148
|
+
}],
|
|
149
|
+
"@astryx.comments.reactionFailed": [{ path: "comments.reactionFailed" }],
|
|
150
|
+
"@astryx.comments.reactionLaugh": [{ path: "comments.reactionLaugh" }],
|
|
151
|
+
"@astryx.comments.reactionLike": [{ path: "comments.reactionLike" }],
|
|
152
|
+
"@astryx.comments.reactionLove": [{ path: "comments.reactionLove" }],
|
|
153
|
+
"@astryx.comments.reactionSad": [{ path: "comments.reactionSad" }],
|
|
154
|
+
"@astryx.comments.reactionWow": [{ path: "comments.reactionWow" }],
|
|
155
|
+
"@astryx.comments.reopen": [{ path: "comments.reopen" }],
|
|
156
|
+
"@astryx.comments.reopenFailed": [{ path: "comments.reopenFailed" }],
|
|
157
|
+
"@astryx.comments.reply": [{ path: "comments.reply" }],
|
|
158
|
+
"@astryx.comments.replyFailed": [{ path: "comments.replyFailed" }],
|
|
159
|
+
"@astryx.comments.replyPlaceholder": [{
|
|
160
|
+
path: "comments.replyPlaceholder",
|
|
161
|
+
args: ["name"]
|
|
162
|
+
}],
|
|
163
|
+
"@astryx.comments.replyingContext": [{
|
|
164
|
+
path: "comments.replyingContext",
|
|
165
|
+
args: ["name"]
|
|
166
|
+
}],
|
|
167
|
+
"@astryx.comments.resolve": [{ path: "comments.resolve" }],
|
|
168
|
+
"@astryx.comments.resolveFailed": [{ path: "comments.resolveFailed" }],
|
|
169
|
+
"@astryx.comments.resolved": [{ path: "comments.resolved" }],
|
|
170
|
+
"@astryx.comments.resolvedBy": [{
|
|
171
|
+
path: "comments.resolvedBy",
|
|
172
|
+
args: ["name"]
|
|
173
|
+
}],
|
|
174
|
+
"@astryx.comments.retry": [{ path: "comments.retry" }],
|
|
175
|
+
"@astryx.comments.retryFailed": [{ path: "comments.retryFailed" }],
|
|
176
|
+
"@astryx.comments.sendFailed": [{ path: "comments.sendFailed" }],
|
|
177
|
+
"@astryx.comments.threadLabel": [{
|
|
178
|
+
path: "comments.threadLabel",
|
|
179
|
+
args: ["name"]
|
|
180
|
+
}],
|
|
181
|
+
"@astryx.comments.unread": [{ path: "comments.unread" }],
|
|
182
|
+
"@astryx.comments.unsavedDraft": [{ path: "comments.unsavedDraft" }],
|
|
183
|
+
"@astryx.comments.versionAuthor": [{
|
|
184
|
+
path: "comments.versionAuthor",
|
|
185
|
+
args: ["name"]
|
|
186
|
+
}],
|
|
187
|
+
"@astryx.comments.viewHistory": [{ path: "comments.viewHistory" }],
|
|
188
|
+
"@astryx.comments.viewReplies": [{
|
|
189
|
+
path: "comments.viewReplies",
|
|
190
|
+
args: ["count"]
|
|
191
|
+
}],
|
|
192
|
+
"@astryx.commentComposer.addEmoji": [{ path: "commentComposer.addEmoji" }],
|
|
193
|
+
"@astryx.commentComposer.agents": [{ path: "commentComposer.agents" }],
|
|
194
|
+
"@astryx.commentComposer.attachImages": [{ path: "commentComposer.attachImages" }],
|
|
195
|
+
"@astryx.commentComposer.cancel": [{ path: "commentComposer.cancel" }],
|
|
196
|
+
"@astryx.commentComposer.chooseImages": [{ path: "commentComposer.chooseImages" }],
|
|
197
|
+
"@astryx.commentComposer.imageAlt": [{ path: "commentComposer.imageAlt" }],
|
|
198
|
+
"@astryx.commentComposer.imagesOnly": [{ path: "commentComposer.imagesOnly" }],
|
|
199
|
+
"@astryx.commentComposer.noAgents": [{ path: "commentComposer.noAgents" }],
|
|
200
|
+
"@astryx.commentComposer.placeholder": [{ path: "commentComposer.placeholder" }],
|
|
201
|
+
"@astryx.commentComposer.removeQuote": [{ path: "commentComposer.removeQuote" }],
|
|
202
|
+
"@astryx.commentComposer.uploadFailed": [{ path: "commentComposer.uploadFailed" }]
|
|
203
|
+
};
|
|
204
|
+
//#endregion
|
|
63
205
|
//#region src/locale/upstream/data.ts
|
|
64
206
|
/** 表格。 */
|
|
65
207
|
const dataUpstreamMap = {
|
|
@@ -905,6 +1047,7 @@ const parts = [
|
|
|
905
1047
|
"@astryx.commandPalette.footer.close": [{ path: "commandPalette.close" }]
|
|
906
1048
|
},
|
|
907
1049
|
chatUpstreamMap,
|
|
1050
|
+
commentsUpstreamMap,
|
|
908
1051
|
labUpstreamMap,
|
|
909
1052
|
richtextUpstreamMap
|
|
910
1053
|
];
|
|
@@ -920,7 +1063,7 @@ function mergeParts(list) {
|
|
|
920
1063
|
* 原版 `@astryx.*` 键到 `AstryxMessages` 字段的对照,按组件家族拆在 `upstream/` 下。
|
|
921
1064
|
* 一个键可以填多个字段。占位符对不上的键不会写入,由加载器列出来。
|
|
922
1065
|
*
|
|
923
|
-
* 没写进这里的原版键有两类:一类属于还没移植的包(
|
|
1066
|
+
* 没写进这里的原版键有两类:一类属于还没移植的包(charts、DiffViewer 等),
|
|
924
1067
|
* 另一类在 `scripts/i18n-catalog/coverage.mjs` 里逐条写了理由。
|
|
925
1068
|
*/
|
|
926
1069
|
const upstreamMessageMap = mergeParts(parts);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { s as useAstryxMessages } from "./context-
|
|
2
|
-
import { t as upstreamMessageMap } from "./upstreamMap-
|
|
1
|
+
import { s as useAstryxMessages } from "./context-dY6CBI-t.js";
|
|
2
|
+
import { t as upstreamMessageMap } from "./upstreamMap-CZUPxbc9.js";
|
|
3
3
|
//#region src/locale/useTranslator.ts
|
|
4
4
|
/**
|
|
5
5
|
* 对应原版 Astryx 的 `hooks/useTranslator`。
|
package/package.json
CHANGED
|
@@ -1,424 +0,0 @@
|
|
|
1
|
-
import { c as astryxMessages } from "./context-CVUee2tp.js";
|
|
2
|
-
import { t as upstreamMessageMap } from "./upstreamMap-BFXZHlnp.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 };
|
|
@@ -43,9 +43,9 @@ declare const __VLS_base: import("vue").DefineComponent<TokenProps, {}, {}, {},
|
|
|
43
43
|
onRemove?: ((event: Event) => any) | undefined;
|
|
44
44
|
}>, {
|
|
45
45
|
size: TokenSize;
|
|
46
|
-
color: "default" | "blue" | "cyan" | "gray" | "green" | "orange" | "pink" | "purple" | "red" | "teal" | "yellow";
|
|
47
46
|
disabled: boolean;
|
|
48
47
|
labelHidden: boolean;
|
|
48
|
+
color: "default" | "blue" | "cyan" | "gray" | "green" | "orange" | "pink" | "purple" | "red" | "teal" | "yellow";
|
|
49
49
|
removable: boolean;
|
|
50
50
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
51
51
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|