@vunk/plus 1.13.1 → 1.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (540) hide show
  1. package/ant/_util/BaseInput.d.ts +56 -0
  2. package/ant/_util/BaseInputInner.d.ts +65 -0
  3. package/ant/_util/BaseMixin.d.ts +7 -0
  4. package/ant/_util/EventInterface.d.ts +18 -0
  5. package/ant/_util/KeyCode.d.ts +436 -0
  6. package/ant/_util/Portal.d.ts +14 -0
  7. package/ant/_util/PortalWrapper.d.ts +41 -0
  8. package/ant/_util/canUseDom.d.ts +2 -0
  9. package/ant/_util/classNames.d.ts +2 -0
  10. package/ant/_util/collapseMotion.d.ts +3 -0
  11. package/ant/_util/colors.d.ts +13 -0
  12. package/ant/_util/copy-to-clipboard/index.d.ts +8 -0
  13. package/ant/_util/copy-to-clipboard/toggle-selection.d.ts +2 -0
  14. package/ant/_util/createContext.d.ts +5 -0
  15. package/ant/_util/createRef.d.ts +10 -0
  16. package/ant/_util/cssinjs/Cache.d.ts +11 -0
  17. package/ant/_util/cssinjs/Keyframes.d.ts +9 -0
  18. package/ant/_util/cssinjs/StyleContext.d.ts +508 -0
  19. package/ant/_util/cssinjs/hooks/useCacheToken.d.ts +40 -0
  20. package/ant/_util/cssinjs/hooks/useGlobalCache.d.ts +3 -0
  21. package/ant/_util/cssinjs/hooks/useHMR.d.ts +3 -0
  22. package/ant/_util/cssinjs/hooks/useStyleRegister/cacheMapUtil.d.ts +14 -0
  23. package/ant/_util/cssinjs/hooks/useStyleRegister/index.d.ts +68 -0
  24. package/ant/_util/cssinjs/index.d.ts +195 -0
  25. package/ant/_util/cssinjs/linters/contentQuotesLinter.d.ts +3 -0
  26. package/ant/_util/cssinjs/linters/hashedAnimationLinter.d.ts +3 -0
  27. package/ant/_util/cssinjs/linters/index.d.ts +6 -0
  28. package/ant/_util/cssinjs/linters/interface.d.ts +8 -0
  29. package/ant/_util/cssinjs/linters/legacyNotSelectorLinter.d.ts +3 -0
  30. package/ant/_util/cssinjs/linters/logicalPropertiesLinter.d.ts +3 -0
  31. package/ant/_util/cssinjs/linters/parentSelectorLinter.d.ts +3 -0
  32. package/ant/_util/cssinjs/linters/utils.d.ts +2 -0
  33. package/ant/_util/cssinjs/theme/Theme.d.ts +11 -0
  34. package/ant/_util/cssinjs/theme/ThemeCache.d.ts +20 -0
  35. package/ant/_util/cssinjs/theme/createTheme.d.ts +6 -0
  36. package/ant/_util/cssinjs/theme/index.d.ts +4 -0
  37. package/ant/_util/cssinjs/theme/interface.d.ts +2 -0
  38. package/ant/_util/cssinjs/transformers/interface.d.ts +4 -0
  39. package/ant/_util/cssinjs/transformers/legacyLogicalProperties.d.ts +12 -0
  40. package/ant/_util/cssinjs/transformers/px2rem.d.ts +20 -0
  41. package/ant/_util/cssinjs/util.d.ts +8 -0
  42. package/ant/_util/firstNotUndefined.d.ts +2 -0
  43. package/ant/_util/gapSize.d.ts +3 -0
  44. package/ant/_util/getScrollBarSize.d.ts +5 -0
  45. package/ant/_util/hooks/_vueuse/resolveUnref.d.ts +5 -0
  46. package/ant/_util/hooks/_vueuse/types.d.ts +114 -0
  47. package/ant/_util/hooks/_vueuse/unrefElement.d.ts +13 -0
  48. package/ant/_util/hooks/useBreakpoint.d.ts +4 -0
  49. package/ant/_util/hooks/useFlexGapSupport.d.ts +2 -0
  50. package/ant/_util/hooks/useMergedState.d.ts +7 -0
  51. package/ant/_util/hooks/useRefs.d.ts +7 -0
  52. package/ant/_util/hooks/useScrollLocker.d.ts +6 -0
  53. package/ant/_util/hooks/useState.d.ts +2 -0
  54. package/ant/_util/isValid.d.ts +2 -0
  55. package/ant/_util/omit.d.ts +2 -0
  56. package/ant/_util/pickAttrs.d.ts +11 -0
  57. package/ant/_util/placements.d.ts +65 -0
  58. package/ant/_util/props-util/index.d.ts +33 -0
  59. package/ant/_util/props-util/initDefaultProps.d.ts +6 -0
  60. package/ant/_util/raf.d.ts +5 -0
  61. package/ant/_util/responsiveObserve.d.ts +21 -0
  62. package/ant/_util/setStyle.d.ts +12 -0
  63. package/ant/_util/statusUtils.d.ts +6 -0
  64. package/ant/_util/styleChecker.d.ts +4 -0
  65. package/ant/_util/transButton.d.ts +34 -0
  66. package/ant/_util/transition.d.ts +18 -0
  67. package/ant/_util/type.d.ts +62 -0
  68. package/ant/_util/util.d.ts +18 -0
  69. package/ant/_util/vnode.d.ts +11 -0
  70. package/ant/_util/vue-types/index.d.ts +12 -0
  71. package/ant/_util/warning.d.ts +6 -0
  72. package/ant/_util/wave/WaveEffect.d.ts +6 -0
  73. package/ant/_util/wave/index.d.ts +13 -0
  74. package/ant/_util/wave/style.d.ts +6 -0
  75. package/ant/_util/wave/useWave.d.ts +4 -0
  76. package/ant/_util/wave/util.d.ts +3 -0
  77. package/ant/button/LoadingIcon.d.ts +12 -0
  78. package/ant/button/button-group.d.ts +33 -0
  79. package/ant/button/button.d.ts +112 -0
  80. package/ant/button/buttonTypes.d.ts +58 -0
  81. package/ant/button/index.d.ts +12 -0
  82. package/ant/button/style/group.d.ts +4 -0
  83. package/ant/button/style/index.d.ts +10 -0
  84. package/ant/calendar/style/index.d.ts +21 -0
  85. package/ant/config-provider/DisabledContext.d.ts +4 -0
  86. package/ant/config-provider/SizeContext.d.ts +4 -0
  87. package/ant/config-provider/context.d.ts +208 -0
  88. package/ant/config-provider/cssVariables.d.ts +3 -0
  89. package/ant/config-provider/hooks/useConfigInject.d.ts +37 -0
  90. package/ant/config-provider/hooks/useTheme.d.ts +3 -0
  91. package/ant/config-provider/index.d.ts +290 -0
  92. package/ant/config-provider/renderEmpty.d.ts +8 -0
  93. package/ant/config-provider/style/index.d.ts +3 -0
  94. package/ant/date-picker/style/index.d.ts +35 -0
  95. package/ant/empty/empty.d.ts +2 -0
  96. package/ant/empty/index.d.ts +86 -0
  97. package/ant/empty/simple.d.ts +2 -0
  98. package/ant/empty/style/index.d.ts +5 -0
  99. package/ant/flex/index.d.ts +142 -0
  100. package/ant/flex/interface.d.ts +36 -0
  101. package/ant/flex/style/index.d.ts +29 -0
  102. package/ant/flex/utils.d.ts +6 -0
  103. package/ant/form/ErrorList.d.ts +21 -0
  104. package/ant/form/Form.d.ts +772 -0
  105. package/ant/form/FormItem.d.ts +191 -0
  106. package/ant/form/FormItemContext.d.ts +32 -0
  107. package/ant/form/FormItemInput.d.ts +44 -0
  108. package/ant/form/FormItemLabel.d.ts +19 -0
  109. package/ant/form/context.d.ts +35 -0
  110. package/ant/form/index.d.ts +16 -0
  111. package/ant/form/interface.d.ts +171 -0
  112. package/ant/form/style/explain.d.ts +4 -0
  113. package/ant/form/style/index.d.ts +7 -0
  114. package/ant/form/useForm.d.ts +45 -0
  115. package/ant/form/utils/asyncUtil.d.ts +2 -0
  116. package/ant/form/utils/messages.d.ts +47 -0
  117. package/ant/form/utils/typeUtil.d.ts +1 -0
  118. package/ant/form/utils/useDebounce.d.ts +2 -0
  119. package/ant/form/utils/validateUtil.d.ts +6 -0
  120. package/ant/form/utils/valueUtil.d.ts +15 -0
  121. package/ant/grid/Col.d.ts +116 -0
  122. package/ant/grid/Row.d.ts +77 -0
  123. package/ant/grid/context.d.ts +11 -0
  124. package/ant/grid/index.d.ts +10 -0
  125. package/ant/grid/style/index.d.ts +2 -0
  126. package/ant/image/PreviewGroup.d.ts +37 -0
  127. package/ant/image/index.d.ts +71 -0
  128. package/ant/image/style/index.d.ts +21 -0
  129. package/ant/index.cjs +203 -0
  130. package/ant/index.d.ts +27 -0
  131. package/ant/index.mjs +20993 -0
  132. package/ant/input/ClearableLabeledInput.d.ts +151 -0
  133. package/ant/input/Group.d.ts +24 -0
  134. package/ant/input/Input.d.ts +191 -0
  135. package/ant/input/Password.d.ts +217 -0
  136. package/ant/input/ResizableTextArea.d.ts +215 -0
  137. package/ant/input/Search.d.ts +195 -0
  138. package/ant/input/TextArea.d.ts +217 -0
  139. package/ant/input/calculateNodeHeight.d.ts +9 -0
  140. package/ant/input/index.d.ts +15 -0
  141. package/ant/input/inputProps.d.ts +207 -0
  142. package/ant/input/style/index.d.ts +30 -0
  143. package/ant/input/util.d.ts +2 -0
  144. package/ant/locale/LocaleReceiver.d.ts +35 -0
  145. package/ant/locale/en_US.d.ts +3 -0
  146. package/ant/locale/index.d.ts +91 -0
  147. package/ant/locale-provider/LocaleReceiver.d.ts +3 -0
  148. package/ant/locale-provider/index.d.ts +3 -0
  149. package/ant/modal/locale.d.ts +7 -0
  150. package/ant/modal/style/index.d.ts +32 -0
  151. package/ant/progress/Circle.d.ts +168 -0
  152. package/ant/progress/Line.d.ts +205 -0
  153. package/ant/progress/Steps.d.ts +168 -0
  154. package/ant/progress/index.d.ts +204 -0
  155. package/ant/progress/progress.d.ts +117 -0
  156. package/ant/progress/props.d.ts +79 -0
  157. package/ant/progress/style/index.d.ts +4 -0
  158. package/ant/progress/utils.d.ts +13 -0
  159. package/ant/space/Compact.d.ts +119 -0
  160. package/ant/space/style/compact.d.ts +8 -0
  161. package/ant/space/style/index.d.ts +5 -0
  162. package/ant/style/compact-item-vertical.d.ts +4 -0
  163. package/ant/style/compact-item.d.ts +18 -0
  164. package/ant/style/index.d.ts +13 -0
  165. package/ant/style/motion/collapse.d.ts +4 -0
  166. package/ant/style/motion/fade.d.ts +7 -0
  167. package/ant/style/motion/index.d.ts +6 -0
  168. package/ant/style/motion/motion.d.ts +2 -0
  169. package/ant/style/motion/move.d.ts +15 -0
  170. package/ant/style/motion/slide.d.ts +15 -0
  171. package/ant/style/motion/zoom.d.ts +19 -0
  172. package/ant/style/operationUnit.d.ts +3 -0
  173. package/ant/style/placementArrow.d.ts +19 -0
  174. package/ant/style/presetColor.d.ts +16 -0
  175. package/ant/style/roundedArrow.d.ts +2 -0
  176. package/ant/theme/index.d.ts +23 -0
  177. package/ant/theme/interface/alias.d.ts +115 -0
  178. package/ant/theme/interface/components.d.ts +32 -0
  179. package/ant/theme/interface/index.d.ts +13 -0
  180. package/ant/theme/interface/maps/colors.d.ts +350 -0
  181. package/ant/theme/interface/maps/font.d.ts +44 -0
  182. package/ant/theme/interface/maps/index.d.ts +17 -0
  183. package/ant/theme/interface/maps/size.d.ts +63 -0
  184. package/ant/theme/interface/maps/style.d.ts +37 -0
  185. package/ant/theme/interface/presetColors.d.ts +8 -0
  186. package/ant/theme/interface/seeds.d.ts +163 -0
  187. package/ant/theme/internal.d.ts +49 -0
  188. package/ant/theme/themes/ColorMap.d.ts +15 -0
  189. package/ant/theme/themes/compact/genCompactSizeMapToken.d.ts +2 -0
  190. package/ant/theme/themes/compact/index.d.ts +4 -0
  191. package/ant/theme/themes/dark/colorAlgorithm.d.ts +2 -0
  192. package/ant/theme/themes/dark/colors.d.ts +3 -0
  193. package/ant/theme/themes/dark/index.d.ts +4 -0
  194. package/ant/theme/themes/default/colorAlgorithm.d.ts +2 -0
  195. package/ant/theme/themes/default/colors.d.ts +3 -0
  196. package/ant/theme/themes/default/index.d.ts +2 -0
  197. package/ant/theme/themes/seed.d.ts +4 -0
  198. package/ant/theme/themes/shared/genColorMapToken.d.ts +8 -0
  199. package/ant/theme/themes/shared/genCommonMapToken.d.ts +2 -0
  200. package/ant/theme/themes/shared/genControlHeight.d.ts +3 -0
  201. package/ant/theme/themes/shared/genFontMapToken.d.ts +3 -0
  202. package/ant/theme/themes/shared/genFontSizes.d.ts +4 -0
  203. package/ant/theme/themes/shared/genRadius.d.ts +3 -0
  204. package/ant/theme/themes/shared/genSizeMapToken.d.ts +2 -0
  205. package/ant/theme/util/alias.d.ts +12 -0
  206. package/ant/theme/util/genComponentStyleHook.d.ts +26 -0
  207. package/ant/theme/util/getAlphaColor.d.ts +2 -0
  208. package/ant/theme/util/statistic.d.ts +18 -0
  209. package/ant/tooltip/Tooltip.d.ts +228 -0
  210. package/ant/tooltip/abstractTooltipProps.d.ts +73 -0
  211. package/ant/tooltip/index.d.ts +245 -0
  212. package/ant/tooltip/style/index.d.ts +8 -0
  213. package/ant/tooltip/util.d.ts +6 -0
  214. package/ant/typography/Base.d.ts +200 -0
  215. package/ant/typography/Editable.d.ts +49 -0
  216. package/ant/typography/Link.d.ts +51 -0
  217. package/ant/typography/Paragraph.d.ts +51 -0
  218. package/ant/typography/Text.d.ts +51 -0
  219. package/ant/typography/Title.d.ts +48 -0
  220. package/ant/typography/Typography.d.ts +24 -0
  221. package/ant/typography/index.d.ts +17 -0
  222. package/ant/typography/style/index.d.ts +9 -0
  223. package/ant/typography/style/mixins.d.ts +9 -0
  224. package/ant/typography/util.d.ts +11 -0
  225. package/ant/upload/Dragger.d.ts +393 -0
  226. package/ant/upload/Upload.d.ts +396 -0
  227. package/ant/upload/UploadList/ListItem.d.ts +339 -0
  228. package/ant/upload/UploadList/index.d.ts +232 -0
  229. package/ant/upload/index.d.ts +1460 -0
  230. package/ant/upload/interface.d.ts +355 -0
  231. package/ant/upload/style/dragger.d.ts +4 -0
  232. package/ant/upload/style/index.d.ts +10 -0
  233. package/ant/upload/style/list.d.ts +4 -0
  234. package/ant/upload/style/motion.d.ts +4 -0
  235. package/ant/upload/style/picture.d.ts +5 -0
  236. package/ant/upload/style/rtl.d.ts +4 -0
  237. package/ant/upload/utils.d.ts +8 -0
  238. package/ant/vc-align/Align.d.ts +45 -0
  239. package/ant/vc-align/hooks/useBuffer.d.ts +3 -0
  240. package/ant/vc-align/interface.d.ts +56 -0
  241. package/ant/vc-align/util.d.ts +4 -0
  242. package/ant/vc-dialog/Content.d.ts +181 -0
  243. package/ant/vc-dialog/Dialog.d.ts +169 -0
  244. package/ant/vc-dialog/DialogWrap.d.ts +165 -0
  245. package/ant/vc-dialog/IDialogPropTypes.d.ts +79 -0
  246. package/ant/vc-dialog/Mask.d.ts +14 -0
  247. package/ant/vc-dialog/index.d.ts +4 -0
  248. package/ant/vc-dialog/util.d.ts +6 -0
  249. package/ant/vc-image/index.d.ts +3 -0
  250. package/ant/vc-image/src/Image.d.ts +114 -0
  251. package/ant/vc-image/src/Preview.d.ts +292 -0
  252. package/ant/vc-image/src/PreviewGroup.d.ts +79 -0
  253. package/ant/vc-image/src/getFixScaleEleTransPosition.d.ts +16 -0
  254. package/ant/vc-image/src/hooks/useFrameSetState.d.ts +3 -0
  255. package/ant/vc-input/BaseInput.d.ts +97 -0
  256. package/ant/vc-input/Input.d.ts +192 -0
  257. package/ant/vc-input/inputProps.d.ts +169 -0
  258. package/ant/vc-input/utils/commonUtils.d.ts +8 -0
  259. package/ant/vc-progress/index.d.ts +5 -0
  260. package/ant/vc-progress/src/Circle.d.ts +41 -0
  261. package/ant/vc-progress/src/Line.d.ts +40 -0
  262. package/ant/vc-progress/src/common.d.ts +5 -0
  263. package/ant/vc-progress/src/index.d.ts +86 -0
  264. package/ant/vc-progress/src/types.d.ts +25 -0
  265. package/ant/vc-resize-observer/index.d.ts +25 -0
  266. package/ant/vc-tooltip/index.d.ts +2 -0
  267. package/ant/vc-tooltip/src/Content.d.ts +17 -0
  268. package/ant/vc-tooltip/src/Tooltip.d.ts +141 -0
  269. package/ant/vc-tooltip/src/placements.d.ts +111 -0
  270. package/ant/vc-trigger/Popup/Mask.d.ts +14 -0
  271. package/ant/vc-trigger/Popup/MobilePopupInner.d.ts +103 -0
  272. package/ant/vc-trigger/Popup/PopupInner.d.ts +98 -0
  273. package/ant/vc-trigger/Popup/index.d.ts +104 -0
  274. package/ant/vc-trigger/Popup/interface.d.ts +151 -0
  275. package/ant/vc-trigger/Popup/useStretchStyle.d.ts +4 -0
  276. package/ant/vc-trigger/Popup/useVisibleStatus.d.ts +15 -0
  277. package/ant/vc-trigger/Trigger.d.ts +282 -0
  278. package/ant/vc-trigger/context.d.ts +11 -0
  279. package/ant/vc-trigger/index.d.ts +6 -0
  280. package/ant/vc-trigger/interface.d.ts +175 -0
  281. package/ant/vc-trigger/utils/alignUtil.d.ts +3 -0
  282. package/ant/vc-trigger/utils/motionUtil.d.ts +12 -0
  283. package/ant/vc-upload/AjaxUploader.d.ts +108 -0
  284. package/ant/vc-upload/Upload.d.ts +108 -0
  285. package/ant/vc-upload/attr-accept.d.ts +3 -0
  286. package/ant/vc-upload/index.d.ts +4 -0
  287. package/ant/vc-upload/interface.d.ts +79 -0
  288. package/ant/vc-upload/request.d.ts +4 -0
  289. package/ant/vc-upload/traverseFileTree.d.ts +14 -0
  290. package/ant/vc-upload/uid.d.ts +1 -0
  291. package/ant/vc-util/Dom/contains.d.ts +1 -0
  292. package/ant/vc-util/Dom/css.d.ts +22 -0
  293. package/ant/vc-util/Dom/dynamicCSS.d.ts +20 -0
  294. package/ant/vc-util/Dom/isVisible.d.ts +2 -0
  295. package/ant/vc-util/Dom/scrollLocker.d.ts +12 -0
  296. package/ant/vc-util/devWarning.d.ts +4 -0
  297. package/ant/vc-util/get.d.ts +1 -0
  298. package/ant/vc-util/set.d.ts +1 -0
  299. package/ant/vc-util/warning.d.ts +7 -0
  300. package/ant/version/index.d.ts +2 -0
  301. package/antx/_util/__tests__/warning.test.d.ts +1 -0
  302. package/antx/_util/cssinjs/Cache.d.ts +11 -0
  303. package/antx/_util/cssinjs/Keyframes.d.ts +9 -0
  304. package/antx/_util/cssinjs/StyleContext.d.ts +508 -0
  305. package/antx/_util/cssinjs/hooks/useCSSVarRegister.d.ts +20 -0
  306. package/antx/_util/cssinjs/hooks/useCacheToken.d.ts +40 -0
  307. package/antx/_util/cssinjs/hooks/useGlobalCache.d.ts +6 -0
  308. package/antx/_util/cssinjs/hooks/useHMR.d.ts +3 -0
  309. package/antx/_util/cssinjs/hooks/useStyleRegister/cacheMapUtil.d.ts +14 -0
  310. package/antx/_util/cssinjs/hooks/useStyleRegister/index.d.ts +69 -0
  311. package/antx/_util/cssinjs/index.d.ts +197 -0
  312. package/antx/_util/cssinjs/linters/contentQuotesLinter.d.ts +3 -0
  313. package/antx/_util/cssinjs/linters/hashedAnimationLinter.d.ts +3 -0
  314. package/antx/_util/cssinjs/linters/index.d.ts +6 -0
  315. package/antx/_util/cssinjs/linters/interface.d.ts +8 -0
  316. package/antx/_util/cssinjs/linters/legacyNotSelectorLinter.d.ts +3 -0
  317. package/antx/_util/cssinjs/linters/logicalPropertiesLinter.d.ts +3 -0
  318. package/antx/_util/cssinjs/linters/parentSelectorLinter.d.ts +3 -0
  319. package/antx/_util/cssinjs/linters/utils.d.ts +2 -0
  320. package/antx/_util/cssinjs/theme/Theme.d.ts +11 -0
  321. package/antx/_util/cssinjs/theme/ThemeCache.d.ts +20 -0
  322. package/antx/_util/cssinjs/theme/createTheme.d.ts +6 -0
  323. package/antx/_util/cssinjs/theme/index.d.ts +4 -0
  324. package/antx/_util/cssinjs/theme/interface.d.ts +2 -0
  325. package/antx/_util/cssinjs/transformers/interface.d.ts +4 -0
  326. package/antx/_util/cssinjs/transformers/legacyLogicalProperties.d.ts +12 -0
  327. package/antx/_util/cssinjs/transformers/px2rem.d.ts +20 -0
  328. package/antx/_util/cssinjs/util.d.ts +28 -0
  329. package/antx/_util/cssinjs-utils/_util/hooks/useUniqueMemo.d.ts +5 -0
  330. package/antx/_util/cssinjs-utils/hooks/useCSP.d.ts +8 -0
  331. package/antx/_util/cssinjs-utils/hooks/usePrefix.d.ts +11 -0
  332. package/antx/_util/cssinjs-utils/hooks/useToken.d.ts +21 -0
  333. package/antx/_util/cssinjs-utils/index.d.ts +6 -0
  334. package/antx/_util/cssinjs-utils/interface/components.d.ts +10 -0
  335. package/antx/_util/cssinjs-utils/interface/index.d.ts +3 -0
  336. package/antx/_util/cssinjs-utils/util/calc/CSSCalculator.d.ts +15 -0
  337. package/antx/_util/cssinjs-utils/util/calc/NumCalculator.d.ts +11 -0
  338. package/antx/_util/cssinjs-utils/util/calc/calculator.d.ts +30 -0
  339. package/antx/_util/cssinjs-utils/util/calc/index.d.ts +5 -0
  340. package/antx/_util/cssinjs-utils/util/genStyleUtils.d.ts +116 -0
  341. package/antx/_util/cssinjs-utils/util/getCompVarPrefix.d.ts +2 -0
  342. package/antx/_util/cssinjs-utils/util/getComponentToken.d.ts +9 -0
  343. package/antx/_util/cssinjs-utils/util/getDefaultComponentToken.d.ts +5 -0
  344. package/antx/_util/cssinjs-utils/util/maxmin.d.ts +8 -0
  345. package/antx/_util/cssinjs-utils/util/statistic.d.ts +20 -0
  346. package/antx/_util/getScrollBarSize.d.ts +5 -0
  347. package/antx/_util/getValue.d.ts +2 -0
  348. package/antx/_util/hooks/use-event-callback.d.ts +1 -0
  349. package/antx/_util/hooks/use-state.d.ts +2 -0
  350. package/antx/_util/hooks/use-x-component-config.d.ts +4 -0
  351. package/antx/_util/hooks/useMergedState.d.ts +7 -0
  352. package/antx/_util/motion.d.ts +3 -0
  353. package/antx/_util/pick-attrs.d.ts +11 -0
  354. package/antx/_util/setStyle.d.ts +12 -0
  355. package/antx/_util/transition.d.ts +29 -0
  356. package/antx/_util/type.d.ts +62 -0
  357. package/antx/_util/warning.d.ts +47 -0
  358. package/antx/attachments/Attachments.vue.d.ts +16 -0
  359. package/antx/attachments/DropArea.vue.d.ts +4 -0
  360. package/antx/attachments/FileList/AudioIcon.vue.d.ts +3 -0
  361. package/antx/attachments/FileList/FileList.vue.d.ts +4 -0
  362. package/antx/attachments/FileList/FileListCard.vue.d.ts +6 -0
  363. package/antx/attachments/FileList/Progress.vue.d.ts +103 -0
  364. package/antx/attachments/FileList/VideoIcon.vue.d.ts +3 -0
  365. package/antx/attachments/FileList/index.d.ts +3 -0
  366. package/antx/attachments/PlaceholderUploader.vue.d.ts +6 -0
  367. package/antx/attachments/SilentUploader.vue.d.ts +6 -0
  368. package/antx/attachments/constants.d.ts +9 -0
  369. package/antx/attachments/context.d.ts +21 -0
  370. package/antx/attachments/index.d.ts +26 -0
  371. package/antx/attachments/interface.d.ts +130 -0
  372. package/antx/attachments/style/fileCard.d.ts +4 -0
  373. package/antx/attachments/style/index.d.ts +9 -0
  374. package/antx/attachments/util.d.ts +3 -0
  375. package/antx/components.d.ts +4 -0
  376. package/antx/hooks.d.ts +8 -0
  377. package/antx/index.cjs +78 -0
  378. package/antx/index.d.ts +10 -0
  379. package/antx/index.mjs +6015 -0
  380. package/antx/sender/Sender.vue.d.ts +48 -0
  381. package/antx/sender/SenderHeader.vue.d.ts +13 -0
  382. package/antx/sender/StopLoading.vue.d.ts +6 -0
  383. package/antx/sender/components/ActionButton/context.d.ts +21 -0
  384. package/antx/sender/components/ActionButton/index.vue.d.ts +13 -0
  385. package/antx/sender/components/ClearButton.vue.d.ts +4 -0
  386. package/antx/sender/components/LoadingButton.vue.d.ts +4 -0
  387. package/antx/sender/components/SendButton.vue.d.ts +4 -0
  388. package/antx/sender/components/SpeechButton/RecordingIcon.vue.d.ts +4 -0
  389. package/antx/sender/components/SpeechButton/index.vue.d.ts +4 -0
  390. package/antx/sender/context.d.ts +21 -0
  391. package/antx/sender/index.d.ts +82 -0
  392. package/antx/sender/interface.d.ts +145 -0
  393. package/antx/sender/style/header.d.ts +4 -0
  394. package/antx/sender/style/index.d.ts +9 -0
  395. package/antx/sender/useSpeech.d.ts +16 -0
  396. package/antx/theme/components.d.ts +8 -0
  397. package/antx/theme/cssinjs-utils.d.ts +14 -0
  398. package/antx/theme/genStyleUtils.d.ts +27 -0
  399. package/antx/theme/index.d.ts +2 -0
  400. package/antx/theme/patch-antd.d.ts +28 -0
  401. package/antx/theme/useToken.d.ts +19 -0
  402. package/antx/transition-collapse/TransitionCollapse.vue.d.ts +17 -0
  403. package/antx/transition-collapse/index.d.ts +6 -0
  404. package/antx/transition-collapse/style/index.d.ts +6 -0
  405. package/antx/type-utility.d.ts +1 -0
  406. package/antx/use-x-agent/index.d.ts +4 -0
  407. package/antx/use-x-agent/use-x-agent.d.ts +34 -0
  408. package/antx/use-x-chat/index.d.ts +4 -0
  409. package/antx/use-x-chat/use-x-chat.d.ts +54 -0
  410. package/antx/use-x-chat/useSyncState.d.ts +4 -0
  411. package/antx/version/index.d.ts +2 -0
  412. package/antx/x-provider/context.d.ts +84 -0
  413. package/antx/x-provider/hooks/use-x-provider-context.d.ts +9 -0
  414. package/antx/x-provider/index.d.ts +5 -0
  415. package/antx/x-provider/index.vue.d.ts +13 -0
  416. package/antx/x-request/index.d.ts +6 -0
  417. package/antx/x-request/x-fetch.d.ts +18 -0
  418. package/antx/x-request/x-request.d.ts +89 -0
  419. package/antx/x-stream/index.d.ts +4 -0
  420. package/antx/x-stream/x-stream.d.ts +32 -0
  421. package/components/agent-chat-provider/index.cjs +1 -1
  422. package/components/agent-chat-provider/index.mjs +1 -3
  423. package/components/agent-chat-provider/src/index.vue.d.ts +3 -3
  424. package/components/agent-chat-provider/src/types.d.ts +1 -1
  425. package/components/agent-chat-provider/src/use.d.ts +2 -2
  426. package/components/avatar/index.mjs +2 -2
  427. package/components/avatar/src/index.vue.d.ts +2 -121
  428. package/components/broadcasting-markdown/index.cjs +3 -3
  429. package/components/broadcasting-markdown/index.mjs +2 -5
  430. package/components/broadcasting-markdown/src/ctx.d.ts +2 -2
  431. package/components/broadcasting-markdown/src/howler-speech.vue.d.ts +6 -6
  432. package/components/broadcasting-markdown/src/index.vue.d.ts +33 -33
  433. package/components/broadcasting-markdown/src/paragraph.vue.d.ts +1 -1
  434. package/components/broadcasting-markdown/src/use.d.ts +1 -1
  435. package/components/bubble-list/index.cjs +1 -1
  436. package/components/bubble-list/index.mjs +5 -5
  437. package/components/bubble-list/src/core/index.vue.d.ts +7 -7
  438. package/components/bubble-list/src/ctx.d.ts +2 -2
  439. package/components/bubble-list/src/index.vue.d.ts +5 -4
  440. package/components/bubble-templates/index.mjs +2 -2
  441. package/components/chat-independent/index.mjs +4 -4
  442. package/components/chat-independent/src/index.vue.d.ts +1 -1
  443. package/components/components.css +1 -1
  444. package/components/drawer/index.mjs +1 -1
  445. package/components/drawer/src/ctx.d.ts +37 -31
  446. package/components/drawer/src/index.vue.d.ts +87 -77
  447. package/components/file-viewer/index.cjs +1 -0
  448. package/components/file-viewer/index.d.ts +4 -0
  449. package/components/file-viewer/index.mjs +130 -0
  450. package/components/file-viewer/src/ctx.d.ts +69 -0
  451. package/components/file-viewer/src/index.vue.d.ts +108 -0
  452. package/components/file-viewer/src/types.d.ts +3 -0
  453. package/components/lottie-animation/index.mjs +2 -2
  454. package/components/lottie-animation/src/index.vue.d.ts +1 -1
  455. package/components/metahuman-broadcasting/index.mjs +2 -2
  456. package/components/metahuman-broadcasting/src/ctx.d.ts +2 -2
  457. package/components/metahuman-broadcasting/src/index.vue.d.ts +4 -4
  458. package/components/monaco-editor/index.cjs +1 -1
  459. package/components/monaco-editor/index.mjs +52 -48
  460. package/components/monaco-editor/src/ctx.d.ts +3 -3
  461. package/components/monaco-editor/src/index.vue.d.ts +5 -5
  462. package/components/pixi-frame/index.cjs +1 -1
  463. package/components/pixi-frame/index.mjs +25 -25
  464. package/components/pixi-frame/src/apng.vue.d.ts +10 -10
  465. package/components/pixi-frame/src/bitmap-generator.vue.d.ts +7 -7
  466. package/components/pixi-frame/src/bitmap.vue.d.ts +12 -12
  467. package/components/pixi-frame/src/buffer-image.vue.d.ts +13 -13
  468. package/components/pixi-frame/src/core.vue.d.ts +12 -12
  469. package/components/pixi-frame/src/ctx.d.ts +5 -5
  470. package/components/pixi-frame/src/index.vue.d.ts +81 -81
  471. package/components/pixi-frame/src/video.vue.d.ts +10 -10
  472. package/components/recorder-button/index.cjs +1 -1
  473. package/components/recorder-button/index.mjs +75 -75
  474. package/components/recorder-button/src/ctx.d.ts +3 -3
  475. package/components/recorder-button/src/index.vue.d.ts +114 -197
  476. package/components/routes-menu-content/index.cjs +1 -1
  477. package/components/routes-menu-content/index.mjs +12 -12
  478. package/components/routes-menu-content/src/ctx.d.ts +1 -1
  479. package/components/routes-menu-content/src/index.vue.d.ts +58 -99
  480. package/components/routes-menu-content/src/item/core/ctx.d.ts +1 -1
  481. package/components/routes-menu-content/src/item/core/index.vue.d.ts +40 -81
  482. package/components/routes-menu-content/src/item/index.vue.d.ts +56 -97
  483. package/components/scrollbar/index.mjs +4 -4
  484. package/components/scrollbar/src/index.vue.d.ts +35 -34
  485. package/components/scrollbar/src/util.d.ts +1 -1
  486. package/components/sender/index.cjs +1 -1
  487. package/components/sender/index.mjs +7 -7
  488. package/components/sender/src/SenderHeader.vue.d.ts +2 -2
  489. package/components/sender/src/ctx.d.ts +9 -9
  490. package/components/sender/src/index.vue.d.ts +28 -28
  491. package/components/speech-button/index.cjs +1 -1
  492. package/components/speech-button/index.mjs +1 -1
  493. package/components/speech-button/src/ctx.d.ts +1 -1
  494. package/components/speech-button/src/index.vue.d.ts +3 -3
  495. package/components/table-columns/src/ctx.d.ts +2 -2
  496. package/components/table-columns/src/el-ctx.d.ts +2 -2
  497. package/components/table-columns/src/index.vue.d.ts +6 -6
  498. package/components/table-columns/src/types.d.ts +3 -4
  499. package/components/tables-v1/index.cjs +1 -1
  500. package/components/tables-v1/index.mjs +3 -3
  501. package/components/tables-v1/src/ctx.d.ts +69 -74
  502. package/components/tables-v1/src/el-ctx.d.ts +24 -24
  503. package/components/tables-v1/src/index.vue.d.ts +54 -313
  504. package/components/tables-v1-checkbox/index.cjs +31 -35
  505. package/components/tables-v1-checkbox/index.mjs +1239 -1042
  506. package/components/tables-v1-checkbox/src/ctx.d.ts +68 -73
  507. package/components/tables-v1-checkbox/src/index.vue.d.ts +274 -542
  508. package/components/text/index.mjs +3 -3
  509. package/components/text/src/ctx.d.ts +39 -246
  510. package/components/text/src/index.vue.d.ts +98 -509
  511. package/components/thinking/index.mjs +5 -5
  512. package/components/thinking/src/ctx.d.ts +3 -3
  513. package/components/thinking/src/index.vue.d.ts +8 -8
  514. package/components/typing-markdown/index.mjs +2 -2
  515. package/components/typing-markdown/src/ctx.d.ts +3 -3
  516. package/components/typing-markdown/src/index.vue.d.ts +6 -6
  517. package/components/vditor/index.cjs +1 -1
  518. package/components/vditor/index.mjs +2 -2
  519. package/components/vditor/src/ctx.d.ts +2 -2
  520. package/components/vditor/src/handle-fullscreen.vue.d.ts +3 -3
  521. package/components/vditor/src/handle-value.vue.d.ts +3 -3
  522. package/components/vditor/src/index.vue.d.ts +10 -10
  523. package/components/xgplayer/index.mjs +5 -5
  524. package/composables/recorder/index.cjs +1 -1
  525. package/composables/recorder/index.mjs +3214 -3099
  526. package/element/bubble/index.cjs +2 -2
  527. package/element/bubble/index.mjs +57 -57
  528. package/element/index.css +1 -1
  529. package/element/thinking/index.cjs +1 -1
  530. package/element/thinking/index.mjs +63 -69
  531. package/icons/end/index.cjs +1 -1
  532. package/icons/end/index.mjs +3 -3
  533. package/icons/keyboard/index.cjs +1 -1
  534. package/icons/keyboard/index.mjs +3 -3
  535. package/icons/start/index.cjs +1 -1
  536. package/icons/start/index.mjs +3 -3
  537. package/icons/voice/index.cjs +1 -1
  538. package/icons/voice/index.mjs +3 -3
  539. package/index.css +2 -2
  540. package/package.json +16 -1
@@ -0,0 +1,54 @@
1
+ import { XAgent } from '../use-x-agent';
2
+ import { type SSEOutput, XStreamOptions } from '../x-stream';
3
+ import { XRequestParams } from '../x-request';
4
+ import type { AnyObject } from '../_util/type';
5
+ export type SimpleType = string | number | boolean | object;
6
+ export type MessageStatus = 'local' | 'loading' | 'success' | 'error';
7
+ type RequestPlaceholderFn<Message extends SimpleType> = (message: Message, info: {
8
+ messages: Message[];
9
+ }) => Message;
10
+ type RequestFallbackFn<Message extends SimpleType> = (message: Message, info: {
11
+ error: Error;
12
+ messages: Message[];
13
+ }) => Message | Promise<Message>;
14
+ type TransformMessageFn<Message, Output> = (info: {
15
+ originMessage?: Message;
16
+ chunk: Output;
17
+ chunks: Output[];
18
+ status: MessageStatus;
19
+ }) => Message;
20
+ type RequestParams<Message> = Omit<XRequestParams, 'message'> & {
21
+ message: Message;
22
+ } & AnyObject;
23
+ export interface XChatConfig<AgentMessage extends SimpleType = string, BubbleMessage extends SimpleType = AgentMessage, Input = AgentMessage, Output = AgentMessage> {
24
+ agent?: XAgent<AgentMessage, Input, Output>;
25
+ defaultMessages?: DefaultMessageInfo<AgentMessage>[];
26
+ /** Convert agent message to bubble usage message type */
27
+ parser?: (message: AgentMessage) => BubbleMessage | BubbleMessage[];
28
+ requestPlaceholder?: AgentMessage | RequestPlaceholderFn<AgentMessage>;
29
+ requestFallback?: AgentMessage | RequestFallbackFn<AgentMessage>;
30
+ transformMessage?: TransformMessageFn<AgentMessage, Output>;
31
+ transformStream?: XStreamOptions<AgentMessage>['transformStream'];
32
+ resolveAbortController?: (abortController: AbortController) => void;
33
+ }
34
+ export interface MessageInfo<Message extends SimpleType> {
35
+ id: number | string;
36
+ message: Message;
37
+ status: MessageStatus;
38
+ }
39
+ export type DefaultMessageInfo<Message extends SimpleType> = Pick<MessageInfo<Message>, 'message'> & Partial<Omit<MessageInfo<Message>, 'message'>>;
40
+ export type RequestResultObject<Message> = {
41
+ message: Message | Message[];
42
+ status: MessageStatus;
43
+ };
44
+ export type StandardRequestResult<Message extends SimpleType> = Omit<RequestResultObject<Message>, 'message' | 'status'> & {
45
+ message: Message;
46
+ status?: MessageStatus;
47
+ };
48
+ export default function useXChat<AgentMessage extends SimpleType = string, ParsedMessage extends SimpleType = AgentMessage, Input = RequestParams<AgentMessage>, Output = SSEOutput>(config: XChatConfig<AgentMessage, ParsedMessage, Input, Output>): {
49
+ readonly onRequest: (value: SimpleType | RequestParams<AgentMessage> | Input) => void;
50
+ readonly messages: import("vue").Ref<MessageInfo<AgentMessage>[], MessageInfo<AgentMessage>[]>;
51
+ readonly parsedMessages: import("vue").ComputedRef<MessageInfo<ParsedMessage>[]>;
52
+ readonly setMessages: (updater: MessageInfo<AgentMessage>[] | ((prev: MessageInfo<AgentMessage>[]) => MessageInfo<AgentMessage>[])) => void;
53
+ };
54
+ export {};
@@ -0,0 +1,4 @@
1
+ import type { Ref } from 'vue';
2
+ type Updater<T> = (prev: T) => T;
3
+ export default function useSyncState<T>(defaultState: T, onChange: (newValue: T, prevValue: T) => void): [Ref<T>, (updater: T | Updater<T>) => void];
4
+ export {};
@@ -0,0 +1,2 @@
1
+ declare const _default: "1.6.0";
2
+ export default _default;
@@ -0,0 +1,84 @@
1
+ import { type AnyObject } from '../_util/type';
2
+ import { type ComputedRef, type CSSProperties } from 'vue';
3
+ import type { ConfigProviderProps as OriAntdConfigProviderProps } from '@vunk/plus/ant';
4
+ import type { SenderProps } from '../sender/interface';
5
+ interface ActionsProps {
6
+ }
7
+ interface AttachmentsProps {
8
+ }
9
+ interface BubbleProps {
10
+ }
11
+ interface ConversationsProps {
12
+ }
13
+ interface PromptsProps {
14
+ }
15
+ interface SuggestionProps {
16
+ }
17
+ interface ThoughtChainProps {
18
+ }
19
+ interface WelcomeProps {
20
+ }
21
+ export interface AntdConfigProviderProps {
22
+ iconPrefixCls?: OriAntdConfigProviderProps['iconPrefixCls'];
23
+ getTargetContainer?: OriAntdConfigProviderProps['getTargetContainer'];
24
+ getPopupContainer?: OriAntdConfigProviderProps['getPopupContainer'];
25
+ prefixCls?: OriAntdConfigProviderProps['prefixCls'];
26
+ getPrefixCls?: OriAntdConfigProviderProps['getPrefixCls'];
27
+ renderEmpty?: OriAntdConfigProviderProps['renderEmpty'];
28
+ transformCellText?: OriAntdConfigProviderProps['transformCellText'];
29
+ csp?: OriAntdConfigProviderProps['csp'];
30
+ input?: OriAntdConfigProviderProps['input'];
31
+ autoInsertSpaceInButton?: OriAntdConfigProviderProps['autoInsertSpaceInButton'];
32
+ locale?: OriAntdConfigProviderProps['locale'];
33
+ pageHeader?: OriAntdConfigProviderProps['pageHeader'];
34
+ componentSize?: OriAntdConfigProviderProps['componentSize'];
35
+ componentDisabled?: OriAntdConfigProviderProps['componentDisabled'];
36
+ direction?: OriAntdConfigProviderProps['direction'];
37
+ space?: OriAntdConfigProviderProps['space'];
38
+ virtual?: OriAntdConfigProviderProps['virtual'];
39
+ dropdownMatchSelectWidth?: OriAntdConfigProviderProps['dropdownMatchSelectWidth'];
40
+ form?: OriAntdConfigProviderProps['form'];
41
+ pagination?: OriAntdConfigProviderProps['pagination'];
42
+ theme?: OriAntdConfigProviderProps['theme'];
43
+ select?: OriAntdConfigProviderProps['select'];
44
+ wave?: OriAntdConfigProviderProps['wave'];
45
+ }
46
+ export interface XComponentStyleConfig {
47
+ classNames: Record<string, string>;
48
+ styles: Record<string, CSSProperties>;
49
+ className: string;
50
+ style: CSSProperties;
51
+ }
52
+ export type DefaultPickType = keyof XComponentStyleConfig;
53
+ export type ComponentStyleConfig<CompProps extends AnyObject, PickType extends keyof CompProps = DefaultPickType> = Pick<CompProps, PickType | DefaultPickType>;
54
+ export interface XComponentsConfig {
55
+ actions?: ComponentStyleConfig<ActionsProps>;
56
+ bubble?: ComponentStyleConfig<BubbleProps>;
57
+ conversations?: ComponentStyleConfig<ConversationsProps>;
58
+ prompts?: ComponentStyleConfig<PromptsProps>;
59
+ sender?: ComponentStyleConfig<SenderProps>;
60
+ suggestion?: ComponentStyleConfig<SuggestionProps>;
61
+ thoughtChain?: ComponentStyleConfig<ThoughtChainProps>;
62
+ attachments?: ComponentStyleConfig<AttachmentsProps>;
63
+ welcome?: ComponentStyleConfig<WelcomeProps>;
64
+ }
65
+ export type XProviderProps = XComponentsConfig & AntdConfigProviderProps & {};
66
+ export declare const globalXProviderApi: import("vue").ShallowRef<XProviderProps, XProviderProps>;
67
+ export declare const useXProviderContextProvider: (value: ComputedRef<XProviderProps>) => void;
68
+ export declare const useXProviderContextInject: () => ComputedRef<XProviderProps>;
69
+ export declare const XProviderContextProvider: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
70
+ value: {
71
+ type: import("vue").PropType<XProviderProps>;
72
+ default: XProviderProps;
73
+ };
74
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
75
+ [key: string]: any;
76
+ }>[], {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
77
+ value: {
78
+ type: import("vue").PropType<XProviderProps>;
79
+ default: XProviderProps;
80
+ };
81
+ }>> & Readonly<{}>, {
82
+ value: XProviderProps;
83
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
84
+ export default XProviderContextProvider;
@@ -0,0 +1,9 @@
1
+ export declare const defaultPrefixCls = "ant";
2
+ declare function useXProviderContext(): {
3
+ theme: import("vue").ComputedRef<import("@vunk/plus/ant/config-provider/context").ThemeConfig>;
4
+ getPrefixCls: (suffixCls?: string, customizePrefixCls?: string) => string;
5
+ direction: import("vue").ComputedRef<"ltr" | "rtl">;
6
+ csp: import("vue").ComputedRef<import("@vunk/plus/ant/config-provider").CSPConfig>;
7
+ iconPrefixCls: import("vue").ComputedRef<string>;
8
+ };
9
+ export default useXProviderContext;
@@ -0,0 +1,5 @@
1
+ import useXProviderContext, { defaultPrefixCls } from './hooks/use-x-provider-context';
2
+ import XProvider from './index.vue';
3
+ export type { XProviderProps } from './context';
4
+ export { XProvider, defaultPrefixCls, useXProviderContext };
5
+ export default XProvider;
@@ -0,0 +1,13 @@
1
+ import type { XProviderProps } from './context';
2
+ type __VLS_Slots = {
3
+ default(props?: any): any;
4
+ };
5
+ declare const __VLS_base: import("vue").DefineComponent<XProviderProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<XProviderProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
6
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
7
+ declare const _default: typeof __VLS_export;
8
+ export default _default;
9
+ type __VLS_WithSlots<T, S> = T & {
10
+ new (): {
11
+ $slots: S;
12
+ };
13
+ };
@@ -0,0 +1,6 @@
1
+ import XFetch from './x-fetch';
2
+ import XRequest from './x-request';
3
+ export type { XFetchMiddlewares, XFetchOptions, XFetchType } from './x-fetch';
4
+ export type { XRequestBaseOptions, XRequestOptions, XRequestParams, XRequestCallbacks, XRequestFunction } from './x-request';
5
+ export { XFetch, XRequest };
6
+ export default XRequest;
@@ -0,0 +1,18 @@
1
+ export interface XFetchMiddlewares {
2
+ onRequest?: (...ags: Parameters<typeof fetch>) => Promise<Parameters<typeof fetch>>;
3
+ onResponse?: (response: Response) => Promise<Response>;
4
+ }
5
+ export interface XFetchOptions extends RequestInit {
6
+ /**
7
+ * @description A typeof fetch function
8
+ * @default globalThis.fetch
9
+ */
10
+ fetch?: typeof fetch;
11
+ /**
12
+ * @description Middleware for request and response
13
+ */
14
+ middlewares?: XFetchMiddlewares;
15
+ }
16
+ export type XFetchType = (baseURL: Parameters<typeof fetch>[0], options?: XFetchOptions) => Promise<Response>;
17
+ declare const XFetch: XFetchType;
18
+ export default XFetch;
@@ -0,0 +1,89 @@
1
+ import type { SSEOutput, XStreamOptions } from '../x-stream';
2
+ import type { XFetchOptions } from './x-fetch';
3
+ import type { AnyObject } from '../_util/type';
4
+ import { MaybeRefOrGetter } from 'vue';
5
+ export interface XRequestBaseOptions {
6
+ /**
7
+ * @description Base URL, e.g., 'https://api.example.com/v1/chat'
8
+ */
9
+ baseURL: string;
10
+ /**
11
+ * @description Model name, e.g., 'gpt-3.5-turbo'
12
+ */
13
+ model?: string;
14
+ /**
15
+ * @warning 🔥🔥 Its dangerously!
16
+ *
17
+ * Enabling the dangerouslyApiKey option can be dangerous because it exposes
18
+ * your secret API credentials in the client-side code. Web browsers are inherently
19
+ * less secure than server environments, any user with access to the browser can
20
+ * potentially inspect, extract, and misuse these credentials. This could lead to
21
+ * unauthorized access using your credentials and potentially compromise sensitive
22
+ * data or functionality.
23
+ */
24
+ dangerouslyApiKey?: string;
25
+ }
26
+ interface XRequestCustomOptions {
27
+ /**
28
+ * @description Custom fetch
29
+ */
30
+ fetch?: XFetchOptions['fetch'];
31
+ }
32
+ export type XRequestOptions = XRequestBaseOptions & XRequestCustomOptions;
33
+ type XRequestMessageContent = string | AnyObject;
34
+ interface XRequestMessage extends AnyObject {
35
+ role?: string;
36
+ content?: XRequestMessageContent;
37
+ }
38
+ /**
39
+ * Compatible with the parameters of OpenAI's chat.completions.create,
40
+ * with plans to support more parameters and adapters in the future
41
+ */
42
+ export interface XRequestParams {
43
+ /**
44
+ * @description Model name, e.g., 'gpt-3.5-turbo'
45
+ * @default XRequestOptions.model
46
+ */
47
+ model?: string;
48
+ /**
49
+ * @description Indicates whether to use streaming for the response
50
+ */
51
+ stream?: boolean;
52
+ /**
53
+ * @description The messages to be sent to the model
54
+ */
55
+ messages?: XRequestMessage[];
56
+ }
57
+ export interface XRequestCallbacks<Output> {
58
+ /**
59
+ * @description Callback when the request is successful
60
+ */
61
+ onSuccess: (chunks: Output[]) => void;
62
+ /**
63
+ * @description Callback when the request fails
64
+ */
65
+ onError: (error: Error) => void;
66
+ /**
67
+ * @description Callback when the request is updated
68
+ */
69
+ onUpdate: (chunk: Output) => void;
70
+ /**
71
+ * @description Callback monitoring and control the stream
72
+ */
73
+ onStream?: (abortController: AbortController) => void;
74
+ }
75
+ export type XRequestFunction<Input = AnyObject, Output = SSEOutput> = (params: XRequestParams & Input, callbacks: XRequestCallbacks<Output>, transformStream?: XStreamOptions<Output>['transformStream']) => Promise<void>;
76
+ declare class XRequestClass {
77
+ readonly baseURL: any;
78
+ readonly model: any;
79
+ private defaultHeaders;
80
+ private customOptions;
81
+ private constructor();
82
+ static init(options: XRequestOptions): XRequestClass;
83
+ create: <Input = AnyObject, Output = SSEOutput>(params: XRequestParams & Input, callbacks?: XRequestCallbacks<Output>, transformStream?: XStreamOptions<Output>["transformStream"]) => Promise<void>;
84
+ private customResponseHandler;
85
+ private sseResponseHandler;
86
+ private jsonResponseHandler;
87
+ }
88
+ declare const XRequest: (options: MaybeRefOrGetter<XRequestOptions>) => import("vue").ComputedRef<XRequestClass>;
89
+ export default XRequest;
@@ -0,0 +1,4 @@
1
+ import XStream from './x-stream';
2
+ export type { SSEFields, SSEOutput, XStreamOptions } from './x-stream';
3
+ export { XStream };
4
+ export default XStream;
@@ -0,0 +1,32 @@
1
+ /**
2
+ * @link https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#fields
3
+ */
4
+ export type SSEFields = 'data' | 'event' | 'id' | 'retry';
5
+ /**
6
+ * @example
7
+ * const sseObject = {
8
+ * event: 'delta',
9
+ * data: '{ key: "world!" }',
10
+ * };
11
+ */
12
+ export type SSEOutput = Partial<Record<SSEFields, any>>;
13
+ export interface XStreamOptions<Output> {
14
+ /**
15
+ * @description Readable stream of binary data
16
+ * @link https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream
17
+ */
18
+ readableStream: ReadableStream<Uint8Array>;
19
+ /**
20
+ * @description Support customizable transformStream to transform streams
21
+ * @default sseTransformStream
22
+ * @link https://developer.mozilla.org/en-US/docs/Web/API/TransformStream
23
+ */
24
+ transformStream?: TransformStream<string, Output>;
25
+ }
26
+ type XReadableStream<R = SSEOutput> = ReadableStream<R> & AsyncGenerator<R>;
27
+ /**
28
+ * @description Transform Uint8Array binary stream to {@link SSEOutput} by default
29
+ * @warning The `XStream` only support the `utf-8` encoding. More encoding support maybe in the future.
30
+ */
31
+ declare function XStream<Output = SSEOutput>(options: XStreamOptions<Output>): XReadableStream<Output>;
32
+ export default XStream;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const p=require("vue"),U=require("@vunk/shared/fetch"),C=require("ant-design-x-vue");async function O(e,t){return U.restFetch.reader({url:"/application/chat_message/69e23792-8162-11f0-8a7b-dee062287042",onmessage:e},{headers:{authorization:"application-8259214f7c6f2777658809d71bdfada3"},data:t})}var d=(e=>(e.User="user",e.Assistant="assistant",e.Broadcasting="broadcasting",e))(d||{});const M=[{label:"用户",value:"user",isMarkdown:!1,placement:"end",templateType:"VkMarkdown"},{label:"AI 助手",value:"assistant",isMarkdown:!0,placement:"start",typing:!0,templateType:"VkMarkdown"}],b=M.reduce((e,t)=>(e[t.value]=t,e),{}),_="vk_agent_chat_inject_key";function P(e){return C.useXAgent({request:e})}function L(e,t,s){const[n]=P(e),o=C.useXChat({agent:n.value,parser:t}),f=r=>{const v=s(r);o.onRequest(v)},h=p.computed(()=>o.parsedMessages.value.map(r=>({key:r.id,...b[r.message.role],...r.message}))),c={agent:n,chat:o,simplicity:{onRequest:f,items:h}};return p.provide(_,c),c}function x(){const e=p.inject(_,null);if(!e)throw new Error("useAgentChat must be used within a provider");return e}const g=p.defineComponent({name:"VkAgentChatProvider",props:{request:{type:Function},parser:{type:Function},formatSend:{type:Function}},emits:{load:null},setup(e,{slots:t,emit:s}){const n=(a,c)=>{const{message:r}=a,{onSuccess:v,onUpdate:S}=c,V=[];if(!r?.content)return;let k="";const q=d.Assistant;let w="",m="start",y=!0,A=!1;const u=()=>{const l={role:q,content:k,thinkingContent:w,thinkingStatus:m,seviceLoading:y,seviceEnd:A};S(l),V.push(l)},j=()=>{v(V)};u(),O(l=>{let i={content:"",reasoning_content:""};typeof l.data=="string"&&(i=JSON.parse(l.data)),i.reasoning_content&&(w+=i.reasoning_content,m="thinking",y=!1,u()),i.content&&(k+=i.content,y=!1,u()),w&&i.content&&(m="end",u()),i.is_end&&(A=!0,u(),j())},{message:r?.content})},o=a=>[{...a,role:a.role??d.User,content:a.content??"",loading:a.seviceLoading}],f=a=>({role:d.User,content:a}),h=L(e.request??n,e.parser??o,e.formatSend??f);return s("load",h),t.default}});class F{views=[];getViews(){return this.views}createView(t){this.views.push(t)}upsertView(t,s={}){let n=this.getLastUpdatingView(t.type);return n?(n.content+=t.content,n.updating=t.updating,s.onUpdate?.(n)):(n=t,this.createView(n),s.onCreate?.(n)),n}getPrevView(t){const s=this.views.indexOf(t);if(s>0)return this.views[s-1]}getLastUpdatingView(t){return this.views.findLast(s=>s.updating&&s.type===t)}allViewUpdated(){this.views.forEach(t=>{t.updating=!1})}}const T=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));g.install=e=>{e.component(g.name||"VkAgentChatProvider",g)};exports.ChatAgentInjectKey=_;exports.MessageViewManager=F;exports.Role=d;exports.VkAgentChatProvider=g;exports.__VkAgentChatProvider=T;exports.default=g;exports.roleMap=b;exports.roleOptions=M;exports.useAgentChat=x;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const p=require("vue"),U=require("@vunk/shared/fetch"),C=require("@vunk/plus/antx");async function O(e,t){return U.restFetch.reader({url:"/application/chat_message/69e23792-8162-11f0-8a7b-dee062287042",onmessage:e},{headers:{authorization:"application-8259214f7c6f2777658809d71bdfada3"},data:t})}var d=(e=>(e.User="user",e.Assistant="assistant",e.Broadcasting="broadcasting",e))(d||{});const M=[{label:"用户",value:"user",isMarkdown:!1,placement:"end",templateType:"VkMarkdown"},{label:"AI 助手",value:"assistant",isMarkdown:!0,placement:"start",typing:!0,templateType:"VkMarkdown"}],b=M.reduce((e,t)=>(e[t.value]=t,e),{}),_="vk_agent_chat_inject_key";function P(e){return C.useXAgent({request:e})}function x(e,t,s){const[n]=P(e),o=C.useXChat({agent:n.value,parser:t}),f=r=>{const v=s(r);o.onRequest(v)},h=p.computed(()=>o.parsedMessages.value.map(r=>({key:r.id,...b[r.message.role],...r.message}))),c={agent:n,chat:o,simplicity:{onRequest:f,items:h}};return p.provide(_,c),c}function L(){const e=p.inject(_,null);if(!e)throw new Error("useAgentChat must be used within a provider");return e}const g=p.defineComponent({name:"VkAgentChatProvider",props:{request:{type:Function},parser:{type:Function},formatSend:{type:Function}},emits:{load:null},setup(e,{slots:t,emit:s}){const n=(a,c)=>{const{message:r}=a,{onSuccess:v,onUpdate:S}=c,V=[];if(!r?.content)return;let k="";const q=d.Assistant;let w="",m="start",y=!0,A=!1;const u=()=>{const l={role:q,content:k,thinkingContent:w,thinkingStatus:m,seviceLoading:y,seviceEnd:A};S(l),V.push(l)},j=()=>{v(V)};u(),O(l=>{let i={content:"",reasoning_content:""};typeof l.data=="string"&&(i=JSON.parse(l.data)),i.reasoning_content&&(w+=i.reasoning_content,m="thinking",y=!1,u()),i.content&&(k+=i.content,y=!1,u()),w&&i.content&&(m="end",u()),i.is_end&&(A=!0,u(),j())},{message:r?.content})},o=a=>[{...a,role:a.role??d.User,content:a.content??"",loading:a.seviceLoading}],f=a=>({role:d.User,content:a}),h=x(e.request??n,e.parser??o,e.formatSend??f);return s("load",h),t.default}});class F{views=[];getViews(){return this.views}createView(t){this.views.push(t)}upsertView(t,s={}){let n=this.getLastUpdatingView(t.type);return n?(n.content+=t.content,n.updating=t.updating,s.onUpdate?.(n)):(n=t,this.createView(n),s.onCreate?.(n)),n}getPrevView(t){const s=this.views.indexOf(t);if(s>0)return this.views[s-1]}getLastUpdatingView(t){return this.views.findLast(s=>s.updating&&s.type===t)}allViewUpdated(){this.views.forEach(t=>{t.updating=!1})}}const T=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));g.install=e=>{e.component(g.name||"VkAgentChatProvider",g)};exports.ChatAgentInjectKey=_;exports.MessageViewManager=F;exports.Role=d;exports.VkAgentChatProvider=g;exports.__VkAgentChatProvider=T;exports.default=g;exports.roleMap=b;exports.roleOptions=M;exports.useAgentChat=L;
@@ -1,6 +1,6 @@
1
1
  import { computed as b, provide as S, inject as U, defineComponent as j } from "vue";
2
2
  import { restFetch as q } from "@vunk/shared/fetch";
3
- import { useXChat as P, useXAgent as x } from "ant-design-x-vue";
3
+ import { useXChat as P, useXAgent as x } from "@vunk/plus/antx";
4
4
  async function L(e, t) {
5
5
  return q.reader({
6
6
  url: "/application/chat_message/69e23792-8162-11f0-8a7b-dee062287042",
@@ -32,13 +32,11 @@ const O = [
32
32
  ], F = O.reduce((e, t) => (e[t.value] = t, e), {}), V = "vk_agent_chat_inject_key";
33
33
  function E(e) {
34
34
  return x({
35
- // @ts-expect-error ant-design-x-vue generic type mismatch
36
35
  request: e
37
36
  });
38
37
  }
39
38
  function T(e, t, s) {
40
39
  const [n] = E(e), o = P({
41
- // @ts-expect-error ant-design-x-vue generic type mismatch
42
40
  agent: n.value,
43
41
  // Convert AgentMessage to BubbleMessage
44
42
  parser: t
@@ -12,8 +12,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
12
12
  formatSend: {
13
13
  type: PropType<AnyFunc>;
14
14
  };
15
- }>, import("vue").Slot<any> | undefined, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
16
- load: null;
15
+ }>, import("vue").Slot<any>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
16
+ load: any;
17
17
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
18
18
  request: {
19
19
  type: PropType<AnyFunc>;
@@ -25,5 +25,5 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
25
25
  type: PropType<AnyFunc>;
26
26
  };
27
27
  }>> & Readonly<{
28
- onLoad?: ((...args: any[]) => any) | undefined;
28
+ onLoad?: (...args: any) => any;
29
29
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -1,7 +1,7 @@
1
1
  import type { __VkBubbleTemplates } from '@vunk/plus/components/bubble-templates';
2
2
  import type { BubbleProps } from '@vunk/plus/element/bubble';
3
3
  import type { MaybeArray, Media, NormalObject } from '@vunk/shared';
4
- import type { RequestFn, SSEOutput, useXChat, XAgent, XRequestParams } from 'ant-design-x-vue';
4
+ import type { RequestFn, SSEOutput, useXChat, XAgent, XRequestParams } from '@vunk/plus/antx';
5
5
  import type { ComputedRef } from 'vue';
6
6
  import type { MessageView } from './MessageView';
7
7
  export type RequestParams<Message> = Omit<XRequestParams, 'message'> & {
@@ -1,6 +1,6 @@
1
- import type { SSEOutput } from 'ant-design-x-vue';
1
+ import type { SSEOutput } from '@vunk/plus/antx';
2
2
  import type { AgentChatContext, AgentMessage, formatSend, Parser, Request, RequestParams } from './types';
3
- import { useXAgent } from 'ant-design-x-vue';
3
+ import { useXAgent } from '@vunk/plus/antx';
4
4
  export declare function useAgent(request: Request): ReturnType<typeof useXAgent<AgentMessage, RequestParams<AgentMessage>, AgentMessage & SSEOutput>>;
5
5
  export declare function initAgentChat(request: Request, parser: Parser, formatSend: formatSend): AgentChatContext;
6
6
  export declare function useAgentChat(): AgentChatContext;
@@ -1,5 +1,5 @@
1
1
  import { ElAvatar as r } from "element-plus";
2
- import { defineComponent as n, resolveComponent as a, createBlock as l, openBlock as s, normalizeStyle as c, withCtx as p, renderSlot as m } from "vue";
2
+ import { defineComponent as n, resolveComponent as a, openBlock as l, createBlock as s, normalizeStyle as c, withCtx as p, renderSlot as m } from "vue";
3
3
  import { _ as d } from "../_plugin-vue_export-helper-CHgC5LLL.mjs";
4
4
  const f = {
5
5
  background: {
@@ -18,7 +18,7 @@ const f = {
18
18
  });
19
19
  function i(o, k, v, A, b, y) {
20
20
  const e = a("ElAvatar");
21
- return s(), l(e, {
21
+ return l(), s(e, {
22
22
  style: c({
23
23
  background: o.background,
24
24
  color: o.color
@@ -1,122 +1,3 @@
1
- declare const _default: typeof __VLS_export;
1
+ import { defineComponent } from 'vue';
2
+ declare const _default: ReturnType<typeof defineComponent>;
2
3
  export default _default;
3
- declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
- readonly size: import("element-plus/es/utils/index.mjs").EpPropFinalized<readonly [NumberConstructor, StringConstructor], "" | "small" | "default" | "large", number, "", boolean>;
5
- readonly shape: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, "circle" | "square", unknown, "circle", boolean>;
6
- readonly icon: {
7
- readonly type: import("vue").PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | ((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component))[], unknown, unknown>>;
8
- readonly required: false;
9
- readonly validator: ((val: unknown) => boolean) | undefined;
10
- __epPropKey: true;
11
- };
12
- readonly src: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
13
- readonly alt: StringConstructor;
14
- readonly srcSet: StringConstructor;
15
- readonly fit: import("element-plus/es/utils/index.mjs").EpPropFinalized<(new (...args: any[]) => "fill" | "contain" | "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | "none" | "cover" | "scale-down") | (() => ObjectFitProperty) | ((new (...args: any[]) => "fill" | "contain" | "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | "none" | "cover" | "scale-down") | (() => ObjectFitProperty))[], unknown, unknown, "cover", boolean>;
16
- } & {
17
- background: never;
18
- color: never;
19
- }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
20
- readonly size: import("element-plus/es/utils/index.mjs").EpPropFinalized<readonly [NumberConstructor, StringConstructor], "" | "small" | "default" | "large", number, "", boolean>;
21
- readonly shape: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, "circle" | "square", unknown, "circle", boolean>;
22
- readonly icon: {
23
- readonly type: import("vue").PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | ((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component))[], unknown, unknown>>;
24
- readonly required: false;
25
- readonly validator: ((val: unknown) => boolean) | undefined;
26
- __epPropKey: true;
27
- };
28
- readonly src: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
29
- readonly alt: StringConstructor;
30
- readonly srcSet: StringConstructor;
31
- readonly fit: import("element-plus/es/utils/index.mjs").EpPropFinalized<(new (...args: any[]) => "fill" | "contain" | "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | "none" | "cover" | "scale-down") | (() => ObjectFitProperty) | ((new (...args: any[]) => "fill" | "contain" | "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | "none" | "cover" | "scale-down") | (() => ObjectFitProperty))[], unknown, unknown, "cover", boolean>;
32
- } & {
33
- background: never;
34
- color: never;
35
- }>> & Readonly<{}>, {
36
- readonly size: import("element-plus/es/utils/index.mjs").EpPropMergeType<readonly [NumberConstructor, StringConstructor], "" | "default" | "small" | "large", number>;
37
- readonly shape: import("element-plus/es/utils/index.mjs").EpPropMergeType<StringConstructor, "circle" | "square", unknown>;
38
- readonly src: string;
39
- readonly fit: any;
40
- }, {}, {
41
- ElAvatar: import("element-plus/es/utils/index.mjs").SFCWithInstall<{
42
- new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
43
- readonly size: import("element-plus/es/utils/index.mjs").EpPropFinalized<readonly [NumberConstructor, StringConstructor], "" | "small" | "default" | "large", number, "", boolean>;
44
- readonly shape: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, "circle" | "square", unknown, "circle", boolean>;
45
- readonly icon: {
46
- readonly type: import("vue").PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | ((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component))[], unknown, unknown>>;
47
- readonly required: false;
48
- readonly validator: ((val: unknown) => boolean) | undefined;
49
- __epPropKey: true;
50
- };
51
- readonly src: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
52
- readonly alt: StringConstructor;
53
- readonly srcSet: StringConstructor;
54
- readonly fit: import("element-plus/es/utils/index.mjs").EpPropFinalized<(new (...args: any[]) => "fill" | "contain" | "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | "none" | "cover" | "scale-down") | (() => any) | ((new (...args: any[]) => "fill" | "contain" | "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | "none" | "cover" | "scale-down") | (() => any))[], unknown, unknown, "cover", boolean>;
55
- }>> & {
56
- onError?: ((evt: Event) => any) | undefined;
57
- }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
58
- error: (evt: Event) => void;
59
- }, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, {
60
- readonly size: import("element-plus/es/utils/index.mjs").EpPropMergeType<readonly [NumberConstructor, StringConstructor], "" | "small" | "default" | "large", number>;
61
- readonly shape: import("element-plus/es/utils/index.mjs").EpPropMergeType<StringConstructor, "circle" | "square", unknown>;
62
- readonly src: string;
63
- readonly fit: import("element-plus/es/utils/index.mjs").EpPropMergeType<(new (...args: any[]) => "fill" | "contain" | "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | "none" | "cover" | "scale-down") | (() => any) | ((new (...args: any[]) => "fill" | "contain" | "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | "none" | "cover" | "scale-down") | (() => any))[], unknown, unknown>;
64
- }, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
65
- P: {};
66
- B: {};
67
- D: {};
68
- C: {};
69
- M: {};
70
- Defaults: {};
71
- }, Readonly<import("vue").ExtractPropTypes<{
72
- readonly size: import("element-plus/es/utils/index.mjs").EpPropFinalized<readonly [NumberConstructor, StringConstructor], "" | "small" | "default" | "large", number, "", boolean>;
73
- readonly shape: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, "circle" | "square", unknown, "circle", boolean>;
74
- readonly icon: {
75
- readonly type: import("vue").PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | ((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component))[], unknown, unknown>>;
76
- readonly required: false;
77
- readonly validator: ((val: unknown) => boolean) | undefined;
78
- __epPropKey: true;
79
- };
80
- readonly src: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
81
- readonly alt: StringConstructor;
82
- readonly srcSet: StringConstructor;
83
- readonly fit: import("element-plus/es/utils/index.mjs").EpPropFinalized<(new (...args: any[]) => "fill" | "contain" | "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | "none" | "cover" | "scale-down") | (() => any) | ((new (...args: any[]) => "fill" | "contain" | "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | "none" | "cover" | "scale-down") | (() => any))[], unknown, unknown, "cover", boolean>;
84
- }>> & {
85
- onError?: ((evt: Event) => any) | undefined;
86
- }, {}, {}, {}, {}, {
87
- readonly size: import("element-plus/es/utils/index.mjs").EpPropMergeType<readonly [NumberConstructor, StringConstructor], "" | "small" | "default" | "large", number>;
88
- readonly shape: import("element-plus/es/utils/index.mjs").EpPropMergeType<StringConstructor, "circle" | "square", unknown>;
89
- readonly src: string;
90
- readonly fit: import("element-plus/es/utils/index.mjs").EpPropMergeType<(new (...args: any[]) => "fill" | "contain" | "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | "none" | "cover" | "scale-down") | (() => any) | ((new (...args: any[]) => "fill" | "contain" | "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | "none" | "cover" | "scale-down") | (() => any))[], unknown, unknown>;
91
- }>;
92
- __isFragment?: never;
93
- __isTeleport?: never;
94
- __isSuspense?: never;
95
- } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
96
- readonly size: import("element-plus/es/utils/index.mjs").EpPropFinalized<readonly [NumberConstructor, StringConstructor], "" | "small" | "default" | "large", number, "", boolean>;
97
- readonly shape: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, "circle" | "square", unknown, "circle", boolean>;
98
- readonly icon: {
99
- readonly type: import("vue").PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | ((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component))[], unknown, unknown>>;
100
- readonly required: false;
101
- readonly validator: ((val: unknown) => boolean) | undefined;
102
- __epPropKey: true;
103
- };
104
- readonly src: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
105
- readonly alt: StringConstructor;
106
- readonly srcSet: StringConstructor;
107
- readonly fit: import("element-plus/es/utils/index.mjs").EpPropFinalized<(new (...args: any[]) => "fill" | "contain" | "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | "none" | "cover" | "scale-down") | (() => any) | ((new (...args: any[]) => "fill" | "contain" | "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | "none" | "cover" | "scale-down") | (() => any))[], unknown, unknown, "cover", boolean>;
108
- }>> & {
109
- onError?: ((evt: Event) => any) | undefined;
110
- }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
111
- error: (evt: Event) => void;
112
- }, string, {
113
- readonly size: import("element-plus/es/utils/index.mjs").EpPropMergeType<readonly [NumberConstructor, StringConstructor], "" | "small" | "default" | "large", number>;
114
- readonly shape: import("element-plus/es/utils/index.mjs").EpPropMergeType<StringConstructor, "circle" | "square", unknown>;
115
- readonly src: string;
116
- readonly fit: import("element-plus/es/utils/index.mjs").EpPropMergeType<(new (...args: any[]) => "fill" | "contain" | "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | "none" | "cover" | "scale-down") | (() => any) | ((new (...args: any[]) => "fill" | "contain" | "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | "none" | "cover" | "scale-down") | (() => any))[], unknown, unknown>;
117
- }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
118
- $slots: {
119
- default?(_: {}): any;
120
- };
121
- })>;
122
- }, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -1,5 +1,5 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const A=require("@sapphire/async-queue"),E=require("@vunk/plus/components/typing-markdown"),F=require("@vunk/core"),B=require("@vunk/core/composables"),C=require("@vunk/shared/data/blob"),y=require("@vunk/shared/enum"),t=require("vue"),M=require("@vunk/shared/function"),_=require("howler"),H=require("@vunk/shared/promise"),x=require("consola"),L=require("../_plugin-vue_export-helper-BHFhmbuH.js");function N(e){return e.replace(/!\[.*?\]\(.*?\)/g,"").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/^#{1,6}\s+/gm,"").replace(/\*\*(.*?)\*\*/g,"$1").replace(/__(.*?)__/g,"$1").replace(/\*(.*?)\*/g,"$1").replace(/_(.*?)_/g,"$1").replace(/`(.*?)`/g,"$1").replace(/```[\s\S]*?```/g,"").replace(/\n{2,}/g,`
2
- `).replace(/-{3,}/g,"").replace(/^\s*-\s+/gm,"").replace(/\|/g,"").trim()}function P(e){return N(e)}var c=(e=>(e.initial="initial",e.processing="processing",e.pending="pending",e.fulfilled="fulfilled",e.rejected="rejected",e))(c||{});const k=y.TickerStatus,$={render:{type:Function,default:P},data:{type:Array,default:void 0},source:{type:String,default:""},delay:{type:Number,default:0},separators:{type:Array,default:()=>[`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const A=require("@sapphire/async-queue"),E=require("@vunk/plus/components/typing-markdown"),F=require("@vunk/core"),B=require("@vunk/core/composables"),C=require("@vunk/shared/data/blob"),m=require("@vunk/shared/enum"),t=require("vue"),M=require("@vunk/shared/function"),_=require("howler"),H=require("@vunk/shared/promise"),x=require("consola"),L=require("../_plugin-vue_export-helper-BHFhmbuH.js");function N(e){return e.replace(/!\[.*?\]\(.*?\)/g,"").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/^#{1,6}\s+/gm,"").replace(/\*\*(.*?)\*\*/g,"$1").replace(/__(.*?)__/g,"$1").replace(/\*(.*?)\*/g,"$1").replace(/_(.*?)_/g,"$1").replace(/`(.*?)`/g,"$1").replace(/```[\s\S]*?```/g,"").replace(/\n{2,}/g,`
2
+ `).replace(/-{3,}/g,"").replace(/^\s*-\s+/gm,"").replace(/\|/g,"").trim()}function P(e){return N(e)}var c=(e=>(e.initial="initial",e.processing="processing",e.pending="pending",e.fulfilled="fulfilled",e.rejected="rejected",e))(c||{});const k=m.TickerStatus,$={render:{type:Function,default:P},data:{type:Array,default:void 0},source:{type:String,default:""},delay:{type:Number,default:0},separators:{type:Array,default:()=>[`
3
3
 
4
4
  `,`
5
- `]},keepRead:{type:Boolean,default:!1},textToSpeech:{type:Function,default:void 0},processing:{type:Function,default:M.noop},status:{type:String,default:y.TickerStatus.pending},paragraphMinlength:{type:Number,default:20},disabled:{type:Boolean,default:!1}},D={setData:e=>e,"update:status":e=>!0,paragraphLoad:e=>!0,complete:()=>!0},O={data:{type:Object,default:()=>({})},deferred:{type:Object,required:!0},render:{type:Function,default:P}},R={setData:e=>e,load:e=>!0},U=Object.freeze(Object.defineProperty({__proto__:null,emits:D,paragraphEmits:R,paragraphProps:O,props:$},Symbol.toStringTag,{value:"Module"}));Howler.autoUnlock=!1;const V=_.Howl.prototype.play;_.Howl.prototype.play=function(e){const s=window.WeixinJSBridge;return s&&s.invoke("getNetworkType",{},()=>{this.playing(e)||V.call(this,e)},!1),V.call(this,e)};function q(e,s){const a=t.shallowRef(null),n=t.computed({get:()=>e.status,set:d=>{s("update:status",d)}}),l=d=>d?(a.value&&a.value.unload(),new _.Howl({src:[d],format:["mp3","wav","aac"],onplay:()=>{n.value=y.TickerStatus.playing},onpause:()=>{n.value=y.TickerStatus.paused},onend:()=>{n.value=y.TickerStatus.stopped,setTimeout(()=>{a.value&&(a.value.unload(),a.value=null)},400)},onstop:()=>{n.value=y.TickerStatus.stopped},onloaderror:(u,p)=>{n.value=y.TickerStatus.failed,s("error",p)},onplayerror:(u,p)=>{n.value=y.TickerStatus.failed,s("error",p)}})):null,o=t.computed(()=>e.source);return t.watch(()=>o.value,d=>{d&&(a.value=l(d))},{immediate:!0}),t.onBeforeUnmount(()=>{a.value&&(a.value.unload(),a.value=null)}),t.watchEffect(()=>{n.value===k.play?a.value?a.value.play():console.warn("warn: No sound instance available for play"):n.value===k.pause?a.value?.pause():n.value===k.stop&&a.value?.stop()}),{url:o,broadcast:n,sound:a}}const I=t.defineComponent({__name:"howler-speech",props:{source:{type:String,default:""},status:{type:String,default:y.TickerStatus.pending}},emits:{"update:status":null,load:null,error:null},setup(e,{emit:s}){const a=e,n=s;return a.source?q(a,n):n("update:status",y.TickerStatus.stopped),t.onMounted(()=>{n("load")}),(l,o)=>t.renderSlot(l.$slots,"default",{status:e.status})}}),z=t.defineComponent({__name:"paragraph",props:{enable:{type:Boolean,default:!0},status:{type:String,default:c.initial},processing:{type:Function,default:M.noop}},emits:["update:status"],setup(e,{emit:s}){const a=e,n=s,l=t.shallowRef(),o=B.useDeferred();t.onMounted(async()=>{n("update:status",c.processing),await a.processing?.(),o.resolve()}),o.promise.catch(()=>{n("update:status",c.rejected)}),t.watch(()=>a.enable,async u=>{u?d():l.value=void 0},{immediate:!0});async function d(){const u=new H.Deferred;await o.promise,n("update:status",c.pending),u.promise.then(()=>{n("update:status",c.fulfilled)}).catch(async p=>{x.consola.error("error",p),n("update:status",c.rejected)}),l.value=void 0,t.nextTick(()=>{l.value=u})}return(u,p)=>e.enable&&l.value?t.renderSlot(u.$slots,"default",{key:0,deferred:l.value}):t.createCommentVNode("",!0)}});function J(e){const{source:s,currentIndex:a,sortedSeparators:n,paragraphMinlength:l,lastParagraph:o}=e,d=[],u=[];for(const p of n){const g=p.length;if(s.slice(a-g,a)!==p)continue;const h=o?.end??0,f=a,S=s.slice(h,f);if(o&&p.length>=S.length){o.status===c.initial&&d.push({end:f,value:s.slice(o.start,f),separator:p});continue}S.length>l&&u.push({start:h,separator:p,end:f,status:c.initial,value:S,broadcast:k.play})}return{mergeActions:d,appendActions:u}}function Q(e){const{source:s,currentIndex:a,lastParagraph:n}=e;if(n?.end===a)return{type:"none"};const l=n?.end??0,o=a;return n&&n.status===c.initial&&n.separator===""?{type:"merge",data:{end:o,value:s.slice(n.start,o),separator:""}}:{type:"append",data:{start:l,separator:"",end:o,status:c.initial,value:s.slice(l,o),broadcast:k.play}}}const W=t.defineComponent({name:"VkBroadcastingMarkdown",components:{ParagraphView:z,HowlerSpeechView:I,VkTypingMarkdown:E.VkTypingMarkdown},props:$,emits:D,setup(e,{emit:s}){const[a,n]=B.useDataComputed({default:[]},e,s),l=new A.AsyncQueue,o=r=>{const i=a.value.length;i===0&&(r.broadcast=e.status),n({k:i,v:r})},d=async r=>{if(!e.textToSpeech)return;const i=e.render(r.value);if(e.separators.includes(i)||!i)return;const v=e.textToSpeech(i);return await l.wait(),v.then(async m=>{m instanceof Blob&&(r.blob=m,r.url=await C.blobToDataURL(m)),typeof m=="string"&&(r.url=m)}).then(async()=>{await e.processing?.(r),l.shift()})},u=t.ref(0),p=t.computed(()=>u.value>=e.source.length),g=t.computed(()=>e.disabled?e.source:a.value.filter(r=>r.status===c.fulfilled||r.status===c.pending).map(r=>r.value).join("")),w=t.computed(()=>[...e.separators].sort((r,i)=>r.length-i.length));t.watch(p,r=>{e.disabled||!r&&h()},{immediate:!0});function h(){const r=a.value.at(-1),i=J({source:e.source,currentIndex:u.value,sortedSeparators:w.value,paragraphMinlength:e.paragraphMinlength,lastParagraph:r});if(i.mergeActions.forEach(v=>{r&&(r.end=v.end,r.value=v.value,r.separator=v.separator)}),i.appendActions.forEach(v=>{o(v)}),u.value<e.source.length)u.value++,setTimeout(h,e.delay);else{if(e.keepRead){setTimeout(h,e.delay);return}const v=a.value.at(-1),m=Q({source:e.source,currentIndex:u.value,lastParagraph:v});if(m.type==="none")return;if(m.type==="merge"){if(!v)return;v.end=m.data.end,v.value=m.data.value,v.separator=m.data.separator;return}o(m.data)}}function f(r){const i=a.value[r-1];return i?i.status===c.fulfilled:!0}function S(r){return f(r)}const T=t.computed(()=>a.value.find(r=>r.status===c.pending));t.watch(()=>e.status,()=>{e.status===y.TickerStatus.stop&&a.value.forEach(r=>{r.broadcast!==y.TickerStatus.stopped&&(r.broadcast=k.stop)}),T.value&&T.value.broadcast!==e.status&&(T.value.broadcast=e.status)},{immediate:!0});function j(r,i){r.status===c.pending&&s("update:status",i)}return{theData:a,ParagraphStatus:c,fulfilledTextValue:g,processingParagraph:d,setData:F.setData,Broadcast:k,isParagraphEnabled:S,TickerStatus:y.TickerStatus,handleParagraphStatus:j}}});function G(e,s,a,n,l,o){const d=t.resolveComponent("VkTypingMarkdown"),u=t.resolveComponent("HowlerSpeechView"),p=t.resolveComponent("ParagraphView");return t.openBlock(),t.createElementBlock(t.Fragment,null,[t.renderSlot(e.$slots,"default",{paragraphs:e.theData},()=>[t.createVNode(d,{source:e.fulfilledTextValue},null,8,["source"])]),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.theData,(g,w)=>(t.openBlock(),t.createBlock(p,{key:g.value,status:g.status,"onUpdate:status":h=>g.status=h,enable:e.isParagraphEnabled(w),processing:()=>e.processingParagraph(g)},{default:t.withCtx(({deferred:h})=>[t.renderSlot(e.$slots,"paragraph",{data:g,deferred:h},()=>[t.createVNode(u,{status:g.broadcast,"onUpdate:status":[f=>g.broadcast=f,f=>{e.handleParagraphStatus(g,f),f===e.TickerStatus.stopped&&h.resolve(!0),w===e.theData.length-1&&f===e.TickerStatus.stopped&&e.$emit("complete")}],source:g.url,onError:f=>h.reject(f),onLoad:f=>e.$emit("paragraphLoad",{data:g,deferred:h})},null,8,["status","onUpdate:status","source","onError","onLoad"])])]),_:2},1032,["status","onUpdate:status","enable","processing"]))),128))],64)}const b=L._export_sfc(W,[["render",G]]),K=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));b.install=e=>{e.component(b.name||"VkBroadcastingMarkdown",b)};exports.Broadcast=k;exports.ParagraphStatus=c;exports.VkBroadcastingMarkdown=b;exports._VkBroadcastingMarkdownCtx=U;exports.__VkBroadcastingMarkdown=K;exports.default=b;exports.defaultRender=P;exports.useHowlerParagraph=q;
5
+ `]},keepRead:{type:Boolean,default:!1},textToSpeech:{type:Function,default:void 0},processing:{type:Function,default:M.noop},status:{type:String,default:m.TickerStatus.pending},paragraphMinlength:{type:Number,default:20},disabled:{type:Boolean,default:!1}},D={setData:e=>e,"update:status":e=>!0,paragraphLoad:e=>!0,complete:()=>!0},O={data:{type:Object,default:()=>({})},deferred:{type:Object,required:!0},render:{type:Function,default:P}},R={setData:e=>e,load:e=>!0},U=Object.freeze(Object.defineProperty({__proto__:null,emits:D,paragraphEmits:R,paragraphProps:O,props:$},Symbol.toStringTag,{value:"Module"}));Howler.autoUnlock=!1;const V=_.Howl.prototype.play;_.Howl.prototype.play=function(e){const o=window.WeixinJSBridge;return o&&o.invoke("getNetworkType",{},()=>{this.playing(e)||V.call(this,e)},!1),V.call(this,e)};function q(e,o){const a=t.shallowRef(null),n=t.computed({get:()=>e.status,set:d=>{o("update:status",d)}}),l=d=>d?(a.value&&a.value.unload(),new _.Howl({src:[d],format:["mp3","wav","aac"],onplay:()=>{n.value=m.TickerStatus.playing},onpause:()=>{n.value=m.TickerStatus.paused},onend:()=>{n.value=m.TickerStatus.stopped,setTimeout(()=>{a.value&&(a.value.unload(),a.value=null)},400)},onstop:()=>{n.value=m.TickerStatus.stopped},onloaderror:(u,p)=>{n.value=m.TickerStatus.failed,o("error",p)},onplayerror:(u,p)=>{n.value=m.TickerStatus.failed,o("error",p)}})):null,s=t.computed(()=>e.source);return t.watch(()=>s.value,d=>{d&&(a.value=l(d))},{immediate:!0}),t.onBeforeUnmount(()=>{a.value&&(a.value.unload(),a.value=null)}),t.watchEffect(()=>{n.value===k.play?a.value?a.value.play():console.warn("warn: No sound instance available for play"):n.value===k.pause?a.value?.pause():n.value===k.stop&&a.value?.stop()}),{url:s,broadcast:n,sound:a}}const I=t.defineComponent({__name:"howler-speech",props:{source:{type:String,default:""},status:{type:String,default:m.TickerStatus.pending}},emits:{"update:status":null,load:null,error:null},setup(e,{emit:o}){const a=e,n=o;return a.source?q(a,n):n("update:status",m.TickerStatus.stopped),t.onMounted(()=>{n("load")}),(l,s)=>t.renderSlot(l.$slots,"default",{status:e.status})}}),z=t.defineComponent({__name:"paragraph",props:{enable:{type:Boolean,default:!0},status:{type:String,default:c.initial},processing:{type:Function,default:M.noop}},emits:["update:status"],setup(e,{emit:o}){const a=e,n=o,l=t.shallowRef(),s=B.useDeferred();t.onMounted(async()=>{n("update:status",c.processing),await a.processing?.(),s.resolve()}),s.promise.catch(()=>{n("update:status",c.rejected)}),t.watch(()=>a.enable,async u=>{u?d():l.value=void 0},{immediate:!0});async function d(){const u=new H.Deferred;await s.promise,n("update:status",c.pending),u.promise.then(()=>{n("update:status",c.fulfilled)}).catch(async p=>{x.consola.error("error",p),n("update:status",c.rejected)}),l.value=void 0,t.nextTick(()=>{l.value=u})}return(u,p)=>e.enable&&l.value?t.renderSlot(u.$slots,"default",{deferred:l.value},void 0,void 0,0):t.createCommentVNode("",!0)}});function J(e){const{source:o,currentIndex:a,sortedSeparators:n,paragraphMinlength:l,lastParagraph:s}=e,d=[],u=[];for(const p of n){const g=p.length;if(o.slice(a-g,a)!==p)continue;const v=s?.end??0,f=a,S=o.slice(v,f);if(s&&p.length>=S.length){s.status===c.initial&&d.push({end:f,value:o.slice(s.start,f),separator:p});continue}S.length>l&&u.push({start:v,separator:p,end:f,status:c.initial,value:S,broadcast:k.play})}return{mergeActions:d,appendActions:u}}function Q(e){const{source:o,currentIndex:a,lastParagraph:n}=e;if(n?.end===a)return{type:"none"};const l=n?.end??0,s=a;return n&&n.status===c.initial&&n.separator===""?{type:"merge",data:{end:s,value:o.slice(n.start,s),separator:""}}:{type:"append",data:{start:l,separator:"",end:s,status:c.initial,value:o.slice(l,s),broadcast:k.play}}}const W=t.defineComponent({name:"VkBroadcastingMarkdown",components:{ParagraphView:z,HowlerSpeechView:I,VkTypingMarkdown:E.VkTypingMarkdown},props:$,emits:D,setup(e,{emit:o}){const[a,n]=B.useDataComputed({default:[]},e,o),l=new A.AsyncQueue,s=r=>{const i=a.value.length;i===0&&(r.broadcast=e.status),n({k:i,v:r})},d=async r=>{if(!e.textToSpeech)return;const i=e.render(r.value);if(e.separators.includes(i)||!i)return;const h=e.textToSpeech(i);return await l.wait(),h.then(async y=>{y instanceof Blob&&(r.blob=y,r.url=await C.blobToDataURL(y)),typeof y=="string"&&(r.url=y)}).then(async()=>{await e.processing?.(r),l.shift()})},u=t.ref(0),p=t.computed(()=>u.value>=e.source.length),g=t.computed(()=>e.disabled?e.source:a.value.filter(r=>r.status===c.fulfilled||r.status===c.pending).map(r=>r.value).join("")),w=t.computed(()=>[...e.separators].sort((r,i)=>r.length-i.length));t.watch(p,r=>{e.disabled||!r&&v()},{immediate:!0});function v(){const r=a.value.at(-1),i=J({source:e.source,currentIndex:u.value,sortedSeparators:w.value,paragraphMinlength:e.paragraphMinlength,lastParagraph:r});if(i.mergeActions.forEach(h=>{r&&(r.end=h.end,r.value=h.value,r.separator=h.separator)}),i.appendActions.forEach(h=>{s(h)}),u.value<e.source.length)u.value++,setTimeout(v,e.delay);else{if(e.keepRead){setTimeout(v,e.delay);return}const h=a.value.at(-1),y=Q({source:e.source,currentIndex:u.value,lastParagraph:h});if(y.type==="none")return;if(y.type==="merge"){if(!h)return;h.end=y.data.end,h.value=y.data.value,h.separator=y.data.separator;return}s(y.data)}}function f(r){const i=a.value[r-1];return i?i.status===c.fulfilled:!0}function S(r){return f(r)}const T=t.computed(()=>a.value.find(r=>r.status===c.pending));t.watch(()=>e.status,()=>{e.status===m.TickerStatus.stop&&a.value.forEach(r=>{r.broadcast!==m.TickerStatus.stopped&&(r.broadcast=k.stop)}),T.value&&T.value.broadcast!==e.status&&(T.value.broadcast=e.status)},{immediate:!0});function j(r,i){r.status===c.pending&&o("update:status",i)}return{theData:a,ParagraphStatus:c,fulfilledTextValue:g,processingParagraph:d,setData:F.setData,Broadcast:k,isParagraphEnabled:S,TickerStatus:m.TickerStatus,handleParagraphStatus:j}}});function G(e,o,a,n,l,s){const d=t.resolveComponent("VkTypingMarkdown"),u=t.resolveComponent("HowlerSpeechView"),p=t.resolveComponent("ParagraphView");return t.openBlock(),t.createElementBlock(t.Fragment,null,[t.renderSlot(e.$slots,"default",{paragraphs:e.theData},()=>[t.createVNode(d,{source:e.fulfilledTextValue},null,8,["source"])]),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.theData,(g,w)=>(t.openBlock(),t.createBlock(p,{key:g.value,status:g.status,"onUpdate:status":v=>g.status=v,enable:e.isParagraphEnabled(w),processing:()=>e.processingParagraph(g)},{default:t.withCtx(({deferred:v})=>[t.renderSlot(e.$slots,"paragraph",{data:g,deferred:v},()=>[t.createVNode(u,{status:g.broadcast,"onUpdate:status":[f=>g.broadcast=f,f=>{e.handleParagraphStatus(g,f),f===e.TickerStatus.stopped&&v.resolve(!0),w===e.theData.length-1&&f===e.TickerStatus.stopped&&e.$emit("complete")}],source:g.url,onError:f=>v.reject(f),onLoad:f=>e.$emit("paragraphLoad",{data:g,deferred:v})},null,8,["status","onUpdate:status","source","onError","onLoad"])])]),_:2},1032,["status","onUpdate:status","enable","processing"]))),128))],64)}const b=L._export_sfc(W,[["render",G]]),K=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));b.install=e=>{e.component(b.name||"VkBroadcastingMarkdown",b)};exports.Broadcast=k;exports.ParagraphStatus=c;exports.VkBroadcastingMarkdown=b;exports._VkBroadcastingMarkdownCtx=U;exports.__VkBroadcastingMarkdown=K;exports.default=b;exports.defaultRender=P;exports.useHowlerParagraph=q;