@vunk/plus 1.3.0 → 1.3.2

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 (109) hide show
  1. package/components/SendOutlined.mjs +1 -1
  2. package/components/agent-chat-provider/index.d.ts +7 -0
  3. package/components/agent-chat-provider/src/api.d.ts +3 -0
  4. package/components/agent-chat-provider/src/const-roles.d.ts +8 -0
  5. package/components/agent-chat-provider/src/const.d.ts +1 -0
  6. package/components/agent-chat-provider/src/index.vue.d.ts +47 -0
  7. package/components/agent-chat-provider/src/types.d.ts +37 -0
  8. package/components/agent-chat-provider/src/use.d.ts +29 -0
  9. package/components/avatar/index.d.ts +4 -0
  10. package/components/avatar/src/ctx.d.ts +18 -0
  11. package/components/avatar/src/index.vue.d.ts +121 -0
  12. package/components/avatar/src/types.d.ts +1 -0
  13. package/components/broadcasting-markdown/index.d.ts +5 -0
  14. package/components/broadcasting-markdown/index.mjs +32 -16
  15. package/components/broadcasting-markdown/src/const.d.ts +18 -0
  16. package/components/broadcasting-markdown/src/ctx.d.ts +101 -0
  17. package/components/broadcasting-markdown/src/custom-speech.vue.d.ts +117 -0
  18. package/components/broadcasting-markdown/src/index.vue.d.ts +502 -0
  19. package/components/broadcasting-markdown/src/paragraph.vue.d.ts +78 -0
  20. package/components/broadcasting-markdown/src/speech-error.vue.d.ts +60 -0
  21. package/components/broadcasting-markdown/src/types.d.ts +17 -0
  22. package/components/broadcasting-markdown/src/use.d.ts +3 -0
  23. package/components/broadcasting-markdown/src/web-speech.vue.d.ts +110 -0
  24. package/components/bubble-list/index.d.ts +5 -0
  25. package/components/bubble-list/index.mjs +2 -316
  26. package/components/bubble-list/src/ctx.d.ts +30 -0
  27. package/components/bubble-list/src/index.vue.d.ts +952 -0
  28. package/components/bubble-list/src/types.d.ts +4 -0
  29. package/components/bubble-templates/index.d.ts +4 -0
  30. package/components/bubble-templates/index.mjs +2 -161
  31. package/components/bubble-templates/src/index.vue.d.ts +656 -0
  32. package/components/bubble-templates/src/types.d.ts +30 -0
  33. package/components/chat-independent/index.d.ts +4 -0
  34. package/components/chat-independent/index.mjs +42 -34
  35. package/components/chat-independent/src/const.d.ts +13 -0
  36. package/components/chat-independent/src/ctx.d.ts +20 -0
  37. package/components/chat-independent/src/index.vue.d.ts +2413 -0
  38. package/components/chat-independent/src/types.d.ts +13 -0
  39. package/components/index.d.ts +0 -0
  40. package/components/index.mjs +0 -35979
  41. package/components/lottie-animation/index.d.ts +4 -0
  42. package/components/lottie-animation/src/ctx.d.ts +10 -0
  43. package/components/lottie-animation/src/index.vue.d.ts +21 -0
  44. package/components/lottie-animation/src/types.d.ts +4 -0
  45. package/components/monaco-editor/index.d.ts +5 -0
  46. package/components/monaco-editor/src/ctx.d.ts +23 -0
  47. package/components/monaco-editor/src/index.vue.d.ts +40 -0
  48. package/components/monaco-editor/src/types.d.ts +1 -0
  49. package/components/monaco-environment/index.d.ts +4 -0
  50. package/components/monaco-environment/src/ctx.d.ts +8 -0
  51. package/components/monaco-environment/src/index.vue.d.ts +2 -0
  52. package/components/monaco-environment/src/types.d.ts +1 -0
  53. package/components/recorder-button/index.d.ts +4 -0
  54. package/components/recorder-button/src/ctx.d.ts +40 -0
  55. package/components/recorder-button/src/index.vue.d.ts +303 -0
  56. package/components/recorder-button/src/speech-to-text.d.ts +1 -0
  57. package/components/recorder-button/src/types.d.ts +7 -0
  58. package/components/routes-menu-content/index.d.ts +4 -0
  59. package/components/routes-menu-content/src/ctx.d.ts +17 -0
  60. package/components/routes-menu-content/src/index.vue.d.ts +472 -0
  61. package/components/routes-menu-content/src/item/core/ctx.d.ts +18 -0
  62. package/components/routes-menu-content/src/item/core/index.vue.d.ts +307 -0
  63. package/components/routes-menu-content/src/item/ctx.d.ts +14 -0
  64. package/components/routes-menu-content/src/item/index.vue.d.ts +438 -0
  65. package/components/routes-menu-content/src/types.d.ts +1 -0
  66. package/components/sender/index.d.ts +4 -0
  67. package/components/sender/index.mjs +1 -1
  68. package/components/sender/src/SenderHeader.vue.d.ts +256 -0
  69. package/components/sender/src/ctx.d.ts +58 -0
  70. package/components/sender/src/index.vue.d.ts +778 -0
  71. package/components/sender/src/types.d.ts +1 -0
  72. package/components/speech-button/index.d.ts +4 -0
  73. package/components/speech-button/index.mjs +1 -1
  74. package/components/speech-button/src/LoadingIcon.vue.d.ts +2 -0
  75. package/components/speech-button/src/RecordingIcon.vue.d.ts +2 -0
  76. package/components/speech-button/src/ctx.d.ts +10 -0
  77. package/components/speech-button/src/index.vue.d.ts +22 -0
  78. package/components/speech-button/src/types.d.ts +1 -0
  79. package/components/table-columns/index.d.ts +5 -0
  80. package/components/table-columns/src/ctx.d.ts +66 -0
  81. package/components/table-columns/src/el-ctx.d.ts +63 -0
  82. package/components/table-columns/src/index.vue.d.ts +282 -0
  83. package/components/table-columns/src/types.d.ts +21 -0
  84. package/components/tables-v1/index.d.ts +5 -0
  85. package/components/tables-v1/src/ctx.d.ts +281 -0
  86. package/components/tables-v1/src/el-ctx.d.ts +269 -0
  87. package/components/tables-v1/src/index.vue.d.ts +3014 -0
  88. package/components/tables-v1/src/types.d.ts +4 -0
  89. package/components/tables-v1-checkbox/index.d.ts +5 -0
  90. package/components/tables-v1-checkbox/src/ctx.d.ts +321 -0
  91. package/components/tables-v1-checkbox/src/index.vue.d.ts +3796 -0
  92. package/components/tables-v1-checkbox/src/types.d.ts +1 -0
  93. package/components/typing-markdown/index.d.ts +4 -0
  94. package/components/typing-markdown/index.mjs +2 -2
  95. package/components/typing-markdown/src/core.d.ts +2 -0
  96. package/components/typing-markdown/src/ctx.d.ts +33 -0
  97. package/components/typing-markdown/src/index.vue.d.ts +57 -0
  98. package/components/typing-markdown/src/types.d.ts +1 -0
  99. package/components/vditor/index.d.ts +5 -0
  100. package/components/vditor/src/ctx.d.ts +37 -0
  101. package/components/vditor/src/handle-fullscreen.vue.d.ts +18 -0
  102. package/components/vditor/src/handle-value.vue.d.ts +18 -0
  103. package/components/vditor/src/index.vue.d.ts +144 -0
  104. package/components/vditor/src/types.d.ts +9 -0
  105. package/components/vditor/src/use.d.ts +4 -0
  106. package/index.css +0 -38
  107. package/package.json +1 -7
  108. package/components/bubble-list/index.css +0 -18
  109. package/components/bubble-templates/index.css +0 -18
@@ -0,0 +1,78 @@
1
+ import type { AnyFunc } from '@vunk/shared';
2
+ import { Deferred } from '@vunk/shared/promise';
3
+ import { type PropType } from 'vue';
4
+ import { ParagraphStatus } from './const';
5
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
6
+ enable: {
7
+ type: BooleanConstructor;
8
+ default: boolean;
9
+ };
10
+ status: {
11
+ type: PropType<ParagraphStatus>;
12
+ default: ParagraphStatus;
13
+ };
14
+ pause: {
15
+ type: BooleanConstructor;
16
+ default: boolean;
17
+ };
18
+ processing: {
19
+ type: PropType<AnyFunc>;
20
+ default: AnyFunc;
21
+ };
22
+ }>, {
23
+ props: import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
24
+ enable: {
25
+ type: BooleanConstructor;
26
+ default: boolean;
27
+ };
28
+ status: {
29
+ type: PropType<ParagraphStatus>;
30
+ default: ParagraphStatus;
31
+ };
32
+ pause: {
33
+ type: BooleanConstructor;
34
+ default: boolean;
35
+ };
36
+ processing: {
37
+ type: PropType<AnyFunc>;
38
+ default: AnyFunc;
39
+ };
40
+ }>> & Readonly<{
41
+ "onUpdate:status"?: ((...args: any[]) => any) | undefined;
42
+ }> & {}>;
43
+ emit: (event: "update:status", ...args: any[]) => void;
44
+ theDef: import("vue").ShallowRef<Deferred<any> | undefined, Deferred<any> | undefined>;
45
+ processingDef: {
46
+ _ref: import("vue").ShallowRef<unknown, unknown>;
47
+ readonly value: unknown;
48
+ promise: Promise<unknown>;
49
+ resolve: import("@vunk/core").AnyFunc;
50
+ reject: (reason?: any) => void;
51
+ };
52
+ init: () => Promise<void>;
53
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:status"[], "update:status", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
54
+ enable: {
55
+ type: BooleanConstructor;
56
+ default: boolean;
57
+ };
58
+ status: {
59
+ type: PropType<ParagraphStatus>;
60
+ default: ParagraphStatus;
61
+ };
62
+ pause: {
63
+ type: BooleanConstructor;
64
+ default: boolean;
65
+ };
66
+ processing: {
67
+ type: PropType<AnyFunc>;
68
+ default: AnyFunc;
69
+ };
70
+ }>> & Readonly<{
71
+ "onUpdate:status"?: ((...args: any[]) => any) | undefined;
72
+ }>, {
73
+ processing: AnyFunc;
74
+ pause: boolean;
75
+ enable: boolean;
76
+ status: ParagraphStatus;
77
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
78
+ export default _default;
@@ -0,0 +1,60 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {
2
+ readonly CloseBold: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
3
+ readonly ElIcon: import("element-plus/es/utils").SFCWithInstall<{
4
+ new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
5
+ readonly size: {
6
+ readonly type: import("vue").PropType<import("element-plus").ButtonType<(new (...args: any[]) => string | number) | (() => string | number) | ((new (...args: any[]) => string | number) | (() => string | number))[], unknown, unknown>>;
7
+ readonly required: false;
8
+ readonly validator: ((val: unknown) => boolean) | undefined;
9
+ __epPropKey: true;
10
+ };
11
+ readonly color: {
12
+ readonly type: import("vue").PropType<string>;
13
+ readonly required: false;
14
+ readonly validator: ((val: unknown) => boolean) | undefined;
15
+ __epPropKey: true;
16
+ };
17
+ }>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, {}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
18
+ P: {};
19
+ B: {};
20
+ D: {};
21
+ C: {};
22
+ M: {};
23
+ Defaults: {};
24
+ }, Readonly<import("vue").ExtractPropTypes<{
25
+ readonly size: {
26
+ readonly type: import("vue").PropType<import("element-plus").ButtonType<(new (...args: any[]) => string | number) | (() => string | number) | ((new (...args: any[]) => string | number) | (() => string | number))[], unknown, unknown>>;
27
+ readonly required: false;
28
+ readonly validator: ((val: unknown) => boolean) | undefined;
29
+ __epPropKey: true;
30
+ };
31
+ readonly color: {
32
+ readonly type: import("vue").PropType<string>;
33
+ readonly required: false;
34
+ readonly validator: ((val: unknown) => boolean) | undefined;
35
+ __epPropKey: true;
36
+ };
37
+ }>>, {}, {}, {}, {}, {}>;
38
+ __isFragment?: undefined;
39
+ __isTeleport?: undefined;
40
+ __isSuspense?: undefined;
41
+ } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
42
+ readonly size: {
43
+ readonly type: import("vue").PropType<import("element-plus").ButtonType<(new (...args: any[]) => string | number) | (() => string | number) | ((new (...args: any[]) => string | number) | (() => string | number))[], unknown, unknown>>;
44
+ readonly required: false;
45
+ readonly validator: ((val: unknown) => boolean) | undefined;
46
+ __epPropKey: true;
47
+ };
48
+ readonly color: {
49
+ readonly type: import("vue").PropType<string>;
50
+ readonly required: false;
51
+ readonly validator: ((val: unknown) => boolean) | undefined;
52
+ __epPropKey: true;
53
+ };
54
+ }>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
55
+ $slots: {
56
+ default?(_: {}): any;
57
+ };
58
+ })>;
59
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
60
+ export default _default;
@@ -0,0 +1,17 @@
1
+ import type { Broadcast, ParagraphStatus } from './const';
2
+ export interface Paragraph {
3
+ value: string;
4
+ status: ParagraphStatus;
5
+ start: number;
6
+ end: number;
7
+ separator: string;
8
+ broadcast: Broadcast;
9
+ /**
10
+ * @description 语音合成的 url
11
+ */
12
+ url?: string;
13
+ }
14
+ /**
15
+ * @returns Audio URL
16
+ */
17
+ export type TextToSpeech = (text: string) => Promise<string>;
@@ -0,0 +1,3 @@
1
+ export declare function useVoices(): {
2
+ voices: import("vue").ShallowRef<SpeechSynthesisVoice[], SpeechSynthesisVoice[]>;
3
+ };
@@ -0,0 +1,110 @@
1
+ import type { Deferred } from '@vunk/shared/promise';
2
+ import type { PropType } from 'vue';
3
+ import type { Paragraph } from './types';
4
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
5
+ voice: {
6
+ type: PropType<SpeechSynthesisVoice>;
7
+ required: false;
8
+ };
9
+ data: {
10
+ type: PropType<Paragraph>;
11
+ default: () => {};
12
+ };
13
+ deferred: {
14
+ type: PropType<Deferred<any>>;
15
+ required: true;
16
+ };
17
+ pause: {
18
+ type: BooleanConstructor;
19
+ default: boolean;
20
+ };
21
+ render: {
22
+ type: PropType<(text: string) => string>;
23
+ required: true;
24
+ };
25
+ }>, (() => null) | (() => false | JSX.Element), {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
26
+ voice: {
27
+ type: PropType<SpeechSynthesisVoice>;
28
+ required: false;
29
+ };
30
+ data: {
31
+ type: PropType<Paragraph>;
32
+ default: () => {};
33
+ };
34
+ deferred: {
35
+ type: PropType<Deferred<any>>;
36
+ required: true;
37
+ };
38
+ pause: {
39
+ type: BooleanConstructor;
40
+ default: boolean;
41
+ };
42
+ render: {
43
+ type: PropType<(text: string) => string>;
44
+ required: true;
45
+ };
46
+ }>> & Readonly<{}>, {
47
+ pause: boolean;
48
+ data: Paragraph;
49
+ }, {}, {
50
+ SpeechError: import("vue").DefineComponent<{}, {
51
+ readonly CloseBold: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
52
+ readonly ElIcon: import("element-plus/es/utils").SFCWithInstall<{
53
+ new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
54
+ readonly size: {
55
+ readonly type: PropType<import("element-plus").ButtonType<(new (...args: any[]) => string | number) | (() => string | number) | ((new (...args: any[]) => string | number) | (() => string | number))[], unknown, unknown>>;
56
+ readonly required: false;
57
+ readonly validator: ((val: unknown) => boolean) | undefined;
58
+ __epPropKey: true;
59
+ };
60
+ readonly color: {
61
+ readonly type: PropType<string>;
62
+ readonly required: false;
63
+ readonly validator: ((val: unknown) => boolean) | undefined;
64
+ __epPropKey: true;
65
+ };
66
+ }>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, {}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
67
+ P: {};
68
+ B: {};
69
+ D: {};
70
+ C: {};
71
+ M: {};
72
+ Defaults: {};
73
+ }, Readonly<import("vue").ExtractPropTypes<{
74
+ readonly size: {
75
+ readonly type: PropType<import("element-plus").ButtonType<(new (...args: any[]) => string | number) | (() => string | number) | ((new (...args: any[]) => string | number) | (() => string | number))[], unknown, unknown>>;
76
+ readonly required: false;
77
+ readonly validator: ((val: unknown) => boolean) | undefined;
78
+ __epPropKey: true;
79
+ };
80
+ readonly color: {
81
+ readonly type: PropType<string>;
82
+ readonly required: false;
83
+ readonly validator: ((val: unknown) => boolean) | undefined;
84
+ __epPropKey: true;
85
+ };
86
+ }>>, {}, {}, {}, {}, {}>;
87
+ __isFragment?: undefined;
88
+ __isTeleport?: undefined;
89
+ __isSuspense?: undefined;
90
+ } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
91
+ readonly size: {
92
+ readonly type: PropType<import("element-plus").ButtonType<(new (...args: any[]) => string | number) | (() => string | number) | ((new (...args: any[]) => string | number) | (() => string | number))[], unknown, unknown>>;
93
+ readonly required: false;
94
+ readonly validator: ((val: unknown) => boolean) | undefined;
95
+ __epPropKey: true;
96
+ };
97
+ readonly color: {
98
+ readonly type: PropType<string>;
99
+ readonly required: false;
100
+ readonly validator: ((val: unknown) => boolean) | undefined;
101
+ __epPropKey: true;
102
+ };
103
+ }>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
104
+ $slots: {
105
+ default?(_: {}): any;
106
+ };
107
+ })>;
108
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
109
+ }, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
110
+ export default _default;
@@ -0,0 +1,5 @@
1
+ import VkBubbleList from './src/index.vue';
2
+ export * as __VkBubbleList from './src/types';
3
+ export { Role } from '@vunk/plus/components/agent-chat-provider';
4
+ export { VkBubbleList, };
5
+ export default VkBubbleList;
@@ -1,326 +1,12 @@
1
- import { createElementBlock, openBlock, createStaticVNode, defineComponent, ref, computed, watch, nextTick, normalizeStyle, normalizeClass, createCommentVNode, Fragment, renderList, createBlock, createSlots, withCtx, renderSlot, unref, createVNode, onMounted, onBeforeUnmount, mergeProps } from 'vue';
1
+ import { defineComponent, createBlock, openBlock, unref, withCtx, createVNode, mergeProps } from 'vue';
2
2
  import { VkBubbleTemplates } from '@vunk/plus/components/bubble-templates';
3
3
  import { VkRenderer } from '@vunk/core/components/renderer';
4
4
  import { VkRendererTemplateInstancesProvider } from '@vunk/core/components/renderer-template-instances-provider';
5
5
  import { ElAutoResizer } from 'element-plus';
6
- import { _ as _export_sfc, B as Bubble, E as ElIcon, a as arrow_down_bold_default } from '../index.mjs';
6
+ import { BubbleList } from 'vue-element-plus-x';
7
7
  import { noop } from '@vunk/shared/function';
8
8
  export { Role } from '@vunk/plus/components/agent-chat-provider';
9
9
 
10
- const _sfc_main$2 = {};
11
- const _hoisted_1 = {
12
- xmlns: "http://www.w3.org/2000/svg",
13
- "xmlns:xlink": "http://www.w3.org/1999/xlink",
14
- version: "1.1",
15
- width: "704",
16
- height: "704",
17
- viewBox: "0 0 704 704"
18
- };
19
- function _sfc_render(_ctx, _cache) {
20
- return openBlock(), createElementBlock("svg", _hoisted_1, _cache[0] || (_cache[0] = [createStaticVNode('<defs><filter id="master_svg0_62_10054" filterUnits="objectBoundingBox" color-interpolation-filters="sRGB" x="-0.030120481927710843" y="-0.030120481927710843" width="1.0602409638554218" height="1.0602409638554218"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"></feBlend><feGaussianBlur stdDeviation="5" result="effect1_foregroundBlur"></feGaussianBlur></filter><linearGradient id="master_svg1_62_10082" x1="0.5" y1="-0.13192443549633026" x2="0.42319029569625854" y2="1.368432641029358"><stop offset="9.145302325487137%" stop-color="currentColor" stop-opacity="1"></stop><stop offset="13.636428117752075%" stop-color="currentColor" stop-opacity="0.07539999485015869"></stop><stop offset="16.968481242656708%" stop-color="currentColor" stop-opacity="0"></stop></linearGradient></defs><g transform="matrix(0,1,-1,0,704,-664)" filter="url(#master_svg0_62_10054)"><path d="M1016,684C1199.359,684,1348,535.359,1348,352C1348,168.641,1199.359,20,1016,20C832.641,20,684,168.641,684,352C684,535.359,832.641,684,1016,684ZM1016,32C1192.731,32,1336,175.269,1336,352C1336,528.731,1192.731,672,1016,672C839.269,672,696,528.731,696,352C696,175.269,839.269,32,1016,32Z" fill-rule="evenodd" fill="url(#master_svg1_62_10082)" fill-opacity="1"></path></g>', 2)]));
21
- }
22
- const loadingBg = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render]]);
23
-
24
- const useScrollDetector = (elementRef) => {
25
- const hasVertical = ref(false);
26
- const hasHorizontal = ref(false);
27
- const check = () => {
28
- const el = elementRef.value;
29
- if (!el) return;
30
- hasVertical.value = el.scrollHeight > el.clientHeight;
31
- hasHorizontal.value = el.scrollWidth > el.clientWidth;
32
- };
33
- onMounted(() => {
34
- check();
35
- const observer = new ResizeObserver(check);
36
- observer.observe(elementRef.value);
37
- onBeforeUnmount(() => observer.disconnect());
38
- });
39
- return {
40
- hasVertical,
41
- // 是否有纵向滚动条
42
- hasHorizontal,
43
- // 是否有横向滚动条
44
- check
45
- // 检查滚动条状态
46
- };
47
- };
48
- const threshold = 20;
49
- const _sfc_main$1 = /* @__PURE__ */ defineComponent({
50
- __name: "index",
51
- props: {
52
- list: {
53
- default: () => []
54
- },
55
- maxHeight: {
56
- default: "500px"
57
- },
58
- triggerIndices: {
59
- default: "only-last"
60
- },
61
- alwaysShowScrollbar: {
62
- type: Boolean,
63
- default: false
64
- },
65
- backButtonThreshold: {
66
- default: 80
67
- },
68
- showBackButton: {
69
- type: Boolean,
70
- default: true
71
- },
72
- backButtonPosition: {
73
- default: () => {
74
- return {
75
- bottom: "20px",
76
- left: "calc(50% - 19px)"
77
- };
78
- }
79
- },
80
- btnLoading: {
81
- type: Boolean,
82
- default: true
83
- },
84
- btnColor: {
85
- default: "#409EFF"
86
- },
87
- btnIconSize: {
88
- default: 24
89
- }
90
- },
91
- emits: ["complete"],
92
- setup(__props, {
93
- expose: __expose,
94
- emit: __emit
95
- }) {
96
- const props = __props;
97
- const emits = __emit;
98
- const scrollContainer = ref(null);
99
- const {
100
- hasVertical
101
- } = useScrollDetector(scrollContainer);
102
- const stopAutoScrollToBottom = ref(false);
103
- const lastScrollTop = ref(0);
104
- const accumulatedScrollUpDistance = ref(0);
105
- const resizeObserver = ref(null);
106
- const showBackToBottom = ref(false);
107
- const effectiveTriggerIndices = computed(() => {
108
- if (props.triggerIndices === "only-last") {
109
- const triggerIndices = props.list.filter((item) => item.typing).map((_, index) => index);
110
- return triggerIndices.length > 0 ? [triggerIndices[triggerIndices.length - 1]] : [];
111
- } else if (props.triggerIndices === "all") {
112
- return props.list.map((_, index) => index);
113
- } else if (Array.isArray(props.triggerIndices)) {
114
- const validIndices = getValidIndices(props.list, props.triggerIndices);
115
- return validIndices.length > 0 ? [validIndices[validIndices.length - 1]] : [];
116
- }
117
- return [];
118
- });
119
- function getValidIndices(list, indices) {
120
- const validIndices = [];
121
- for (let i = 0; i < indices.length; i++) {
122
- const index = indices[i];
123
- if (index < 0 || index >= list.length || !list[index].typing) ;
124
- else {
125
- validIndices.push(index);
126
- }
127
- }
128
- return validIndices;
129
- }
130
- watch(() => props.list.length, () => {
131
- if (props.list && props.list.length > 0) {
132
- nextTick(() => {
133
- autoScroll();
134
- });
135
- }
136
- }, {
137
- immediate: true
138
- });
139
- function scrollToTop() {
140
- stopAutoScrollToBottom.value = true;
141
- nextTick(() => {
142
- scrollContainer.value.scrollTop = 0;
143
- });
144
- }
145
- function scrollToBottom() {
146
- try {
147
- if (scrollContainer.value && scrollContainer.value.scrollHeight) {
148
- nextTick(() => {
149
- scrollContainer.value.scrollTop = scrollContainer.value.scrollHeight;
150
- });
151
- }
152
- } catch (error) {
153
- }
154
- }
155
- function scrollToBubble(index) {
156
- const container = scrollContainer.value;
157
- if (!container) return;
158
- const bubbles = container.querySelectorAll(".el-bubble");
159
- if (index >= bubbles.length) return;
160
- stopAutoScrollToBottom.value = true;
161
- const targetBubble = bubbles[index];
162
- const containerRect = container.getBoundingClientRect();
163
- const bubbleRect = targetBubble.getBoundingClientRect();
164
- const scrollPosition = bubbleRect.top - containerRect.top + container.scrollTop;
165
- container.scrollTo({
166
- top: scrollPosition,
167
- behavior: "smooth"
168
- });
169
- }
170
- function autoScroll() {
171
- if (scrollContainer.value) {
172
- const listBubbles = scrollContainer.value.querySelectorAll(".el-bubble-content-wrapper");
173
- if (resizeObserver.value) {
174
- resizeObserver.value.disconnect();
175
- }
176
- const lastItem = listBubbles[listBubbles.length - 1];
177
- if (lastItem) {
178
- resizeObserver.value = new ResizeObserver(() => {
179
- if (!stopAutoScrollToBottom.value) {
180
- scrollToBottom();
181
- }
182
- });
183
- resizeObserver.value.observe(lastItem);
184
- }
185
- }
186
- }
187
- function handleBubbleComplete(index, instance) {
188
- if (effectiveTriggerIndices.value.includes(index)) {
189
- emits("complete", instance, index);
190
- }
191
- }
192
- function handleScroll() {
193
- if (scrollContainer.value) {
194
- const {
195
- scrollTop,
196
- scrollHeight,
197
- clientHeight
198
- } = scrollContainer.value;
199
- const distanceToBottom = scrollHeight - (scrollTop + clientHeight);
200
- showBackToBottom.value = props.showBackButton && distanceToBottom > props.backButtonThreshold;
201
- const isCloseToBottom = scrollTop + clientHeight >= scrollHeight - 30;
202
- const isScrollingUp = lastScrollTop.value > scrollTop;
203
- const isScrollingDown = lastScrollTop.value < scrollTop;
204
- const scrollDelta = lastScrollTop.value - scrollTop;
205
- lastScrollTop.value = scrollTop;
206
- if (isScrollingUp) {
207
- accumulatedScrollUpDistance.value += scrollDelta;
208
- if (accumulatedScrollUpDistance.value >= threshold) {
209
- if (!stopAutoScrollToBottom.value) {
210
- stopAutoScrollToBottom.value = true;
211
- }
212
- accumulatedScrollUpDistance.value = 0;
213
- }
214
- } else {
215
- accumulatedScrollUpDistance.value = 0;
216
- }
217
- if (isScrollingDown && isCloseToBottom) {
218
- if (stopAutoScrollToBottom.value) {
219
- stopAutoScrollToBottom.value = false;
220
- }
221
- }
222
- }
223
- }
224
- __expose({
225
- scrollToTop,
226
- scrollToBottom,
227
- scrollToBubble
228
- });
229
- return (_ctx, _cache) => {
230
- const _component_el_icon = ElIcon;
231
- return openBlock(), createElementBlock("div", {
232
- ref_key: "scrollContainer",
233
- ref: scrollContainer,
234
- class: normalizeClass(["el-bubble-list", {
235
- "always-scrollbar": props.alwaysShowScrollbar
236
- }]),
237
- style: normalizeStyle({
238
- "--el-bubble-list-max-height": `${_ctx.maxHeight}`,
239
- "--el-bubble-list-btn-size": `${props.btnIconSize}px`
240
- }),
241
- onScroll: handleScroll
242
- }, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.list, (item, index) => {
243
- return openBlock(), createBlock(Bubble, {
244
- key: index,
245
- content: item.content,
246
- placement: item.placement,
247
- loading: item.loading,
248
- shape: item.shape,
249
- variant: item.variant,
250
- "is-markdown": item.isMarkdown,
251
- "is-fog": item.isFog,
252
- typing: item.typing,
253
- "max-width": item.maxWidth,
254
- avatar: item.avatar,
255
- "avatar-size": item.avatarSize,
256
- "avatar-gap": item.avatarGap,
257
- "avatar-shape": item.avatarShape,
258
- "avatar-icon": item.avatarIcon,
259
- "avatar-src-set": item.avatarSrcSet,
260
- "avatar-alt": item.avatarAlt,
261
- "avatar-fit": item.avatarFit,
262
- "no-style": item.noStyle,
263
- onFinish: (instance) => handleBubbleComplete(index, instance)
264
- }, createSlots({
265
- _: 2
266
- }, [_ctx.$slots.avatar ? {
267
- name: "avatar",
268
- fn: withCtx(() => [renderSlot(_ctx.$slots, "avatar", {
269
- item
270
- }, void 0, true)]),
271
- key: "0"
272
- } : void 0, _ctx.$slots.header ? {
273
- name: "header",
274
- fn: withCtx(() => [renderSlot(_ctx.$slots, "header", {
275
- item
276
- }, void 0, true)]),
277
- key: "1"
278
- } : void 0, _ctx.$slots.content ? {
279
- name: "content",
280
- fn: withCtx(() => [renderSlot(_ctx.$slots, "content", {
281
- item
282
- }, void 0, true)]),
283
- key: "2"
284
- } : void 0, _ctx.$slots.footer ? {
285
- name: "footer",
286
- fn: withCtx(() => [renderSlot(_ctx.$slots, "footer", {
287
- item
288
- }, void 0, true)]),
289
- key: "3"
290
- } : void 0, _ctx.$slots.loading ? {
291
- name: "loading",
292
- fn: withCtx(() => [renderSlot(_ctx.$slots, "loading", {
293
- item
294
- }, void 0, true)]),
295
- key: "4"
296
- } : void 0]), 1032, ["content", "placement", "loading", "shape", "variant", "is-markdown", "is-fog", "typing", "max-width", "avatar", "avatar-size", "avatar-gap", "avatar-shape", "avatar-icon", "avatar-src-set", "avatar-alt", "avatar-fit", "no-style", "onFinish"]);
297
- }), 128)), unref(showBackToBottom) && unref(hasVertical) ? (openBlock(), createElementBlock("div", {
298
- key: 0,
299
- class: normalizeClass(["el-bubble-list-default-back-button", {
300
- "el-bubble-list-back-to-bottom-solt": _ctx.$slots.backToBottom
301
- }]),
302
- style: normalizeStyle({
303
- bottom: _ctx.backButtonPosition.bottom,
304
- left: _ctx.backButtonPosition.left
305
- }),
306
- onClick: scrollToBottom
307
- }, [renderSlot(_ctx.$slots, "backToBottom", {}, () => [createVNode(_component_el_icon, {
308
- class: "el-bubble-list-back-to-bottom-icon",
309
- style: normalizeStyle({
310
- color: props.btnColor
311
- })
312
- }, {
313
- default: withCtx(() => [createVNode(unref(arrow_down_bold_default)), props.btnLoading ? (openBlock(), createBlock(loadingBg, {
314
- key: 0,
315
- class: "back-to-bottom-loading-svg-bg"
316
- })) : createCommentVNode("", true)]),
317
- _: 1
318
- }, 8, ["style"])], true)], 6)) : createCommentVNode("", true)], 38);
319
- };
320
- }
321
- });
322
- const BubbleList = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-a7a18fd5"]]);
323
-
324
10
  const props = {
325
11
  items: {
326
12
  type: Array,
@@ -0,0 +1,30 @@
1
+ import type { __VkBroadcastingMarkdown } from '@vunk/plus/components/broadcasting-markdown';
2
+ import type { AnyFunc } from '@vunk/shared';
3
+ import type { PropType } from 'vue';
4
+ export declare const props: {
5
+ items: {
6
+ type: {
7
+ (arrayLength: number): import("./types").Item[];
8
+ (...items: import("./types").Item[]): import("./types").Item[];
9
+ new (arrayLength: number): import("./types").Item[];
10
+ new (...items: import("./types").Item[]): import("./types").Item[];
11
+ isArray(arg: any): arg is any[];
12
+ readonly prototype: any[];
13
+ from<T>(arrayLike: ArrayLike<T>): T[];
14
+ from<T_1, U>(arrayLike: ArrayLike<T_1>, mapfn: (v: T_1, k: number) => U, thisArg?: any): U[];
15
+ from<T_2>(iterable: Iterable<T_2> | ArrayLike<T_2>): T_2[];
16
+ from<T_3, U_1>(iterable: Iterable<T_3> | ArrayLike<T_3>, mapfn: (v: T_3, k: number) => U_1, thisArg?: any): U_1[];
17
+ of<T_4>(...items: T_4[]): T_4[];
18
+ readonly [Symbol.species]: ArrayConstructor;
19
+ };
20
+ default: () => never[];
21
+ };
22
+ elRef: {
23
+ type: PropType<AnyFunc>;
24
+ default: AnyFunc;
25
+ };
26
+ textToSpeech: {
27
+ type: PropType<__VkBroadcastingMarkdown.TextToSpeech>;
28
+ };
29
+ };
30
+ export declare const emits: {};