@polyv/chat-ui 2.2.0-rc-20251113.1 → 2.3.0-rc-20251204.1

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 (7) hide show
  1. package/index.d.ts +287 -40
  2. package/index.es.js +21648 -14675
  3. package/index.umd.js +451 -167
  4. package/package.json +1 -1
  5. package/special.d.ts +215 -39
  6. package/special.es.js +20492 -14088
  7. package/special.umd.js +440 -159
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polyv/chat-ui",
3
- "version": "2.2.0-rc-20251113.1",
3
+ "version": "2.3.0-rc-20251204.1",
4
4
  "main": "./index.es.js",
5
5
  "dependencies": {},
6
6
  "types": "./index.d.ts"
package/special.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ChatMessageUser } from '@polyv/chat';
1
+ import { AskMsgType } from '@polyv/chat';
2
2
  import { ChatMsgRewardType } from '@polyv/chat';
3
3
  import { ChatMsgSource } from '@polyv/chat';
4
4
  import { ChatMsgType } from '@polyv/chat';
@@ -21,9 +21,35 @@ import { ShallowUnwrapRef } from 'vue';
21
21
  import { SystemMsgType } from '@polyv/chat';
22
22
  import { ValidatorFunction } from 'vue-types/dist/types';
23
23
  import { Vue3Instance } from 'vue/types/v3-component-public-instance';
24
- import { VueTypeValidableDef } from '../../../../../../node_modules/vue-types';
24
+ import { VueTypeValidableDef } from '../../../../../../../node_modules/vue-types';
25
+ import { VueTypeValidableDef as VueTypeValidableDef_2 } from '../../../../../../node_modules/vue-types';
26
+ import { VueTypeValidableDef as VueTypeValidableDef_3 } from '../../../../../node_modules/vue-types';
25
27
 
26
28
  declare const __VLS_component: DefineComponent< {
29
+ /**
30
+ * 是否显示发送图片图标
31
+ * @default false
32
+ */
33
+ showSendImage: VueTypeValidableDef<boolean, ValidatorFunction<boolean>> & {
34
+ default: boolean;
35
+ } & {
36
+ default: boolean;
37
+ };
38
+ }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, Readonly<ExtractPropTypes< {
39
+ /**
40
+ * 是否显示发送图片图标
41
+ * @default false
42
+ */
43
+ showSendImage: VueTypeValidableDef<boolean, ValidatorFunction<boolean>> & {
44
+ default: boolean;
45
+ } & {
46
+ default: boolean;
47
+ };
48
+ }>>, {
49
+ showSendImage: boolean;
50
+ }>;
51
+
52
+ declare const __VLS_component_2: DefineComponent< {
27
53
  defaultHeight: VueTypeValidableDef<number, ValidatorFunction<number>> & {
28
54
  default: number;
29
55
  } & {
@@ -52,9 +78,17 @@ defaultHeight: number;
52
78
  showMore: boolean;
53
79
  }>;
54
80
 
55
- declare const __VLS_component_2: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, Readonly<ExtractPropTypes< {}>>, {}>;
56
-
57
81
  declare function __VLS_template(): {
82
+ attrs: Partial<{}>;
83
+ slots: {
84
+ 'body-suffix'?(_: {}): any;
85
+ suffix?(_: {}): any;
86
+ };
87
+ refs: {};
88
+ rootEl: HTMLDivElement;
89
+ };
90
+
91
+ declare function __VLS_template_2(): {
58
92
  attrs: Partial<{}>;
59
93
  slots: {
60
94
  'more-panel'?(_: {}): any;
@@ -64,6 +98,7 @@ declare function __VLS_template(): {
64
98
  };
65
99
  refs: {
66
100
  msgInputBaseRef: (Vue3Instance< {}, Readonly<ExtractPropTypes< {
101
+ resizeStorageKey: VueTypeValidableDef<string, ValidatorFunction<string>>;
67
102
  defaultHeight: VueTypeValidableDef<number, ValidatorFunction<number>> & {
68
103
  default: number;
69
104
  } & {
@@ -74,6 +109,11 @@ declare function __VLS_template(): {
74
109
  } & {
75
110
  default: boolean;
76
111
  };
112
+ showSendImage: VueTypeValidableDef<boolean, ValidatorFunction<boolean>> & {
113
+ default: boolean;
114
+ } & {
115
+ default: boolean;
116
+ };
77
117
  placeholder: VueTypeValidableDef<string, ValidatorFunction<string>> & {
78
118
  default: string;
79
119
  };
@@ -92,7 +132,18 @@ declare function __VLS_template(): {
92
132
  } & {
93
133
  default: number;
94
134
  };
135
+ showFaceEmotion: VueTypeValidableDef<boolean, ValidatorFunction<boolean>> & {
136
+ default: boolean;
137
+ } & {
138
+ default: boolean;
139
+ };
140
+ showImageEmotion: VueTypeValidableDef<boolean, ValidatorFunction<boolean>> & {
141
+ default: boolean;
142
+ } & {
143
+ default: boolean;
144
+ };
95
145
  }>>, Readonly<ExtractPropTypes< {
146
+ resizeStorageKey: VueTypeValidableDef<string, ValidatorFunction<string>>;
96
147
  defaultHeight: VueTypeValidableDef<number, ValidatorFunction<number>> & {
97
148
  default: number;
98
149
  } & {
@@ -103,6 +154,11 @@ declare function __VLS_template(): {
103
154
  } & {
104
155
  default: boolean;
105
156
  };
157
+ showSendImage: VueTypeValidableDef<boolean, ValidatorFunction<boolean>> & {
158
+ default: boolean;
159
+ } & {
160
+ default: boolean;
161
+ };
106
162
  placeholder: VueTypeValidableDef<string, ValidatorFunction<string>> & {
107
163
  default: string;
108
164
  };
@@ -121,6 +177,16 @@ declare function __VLS_template(): {
121
177
  } & {
122
178
  default: number;
123
179
  };
180
+ showFaceEmotion: VueTypeValidableDef<boolean, ValidatorFunction<boolean>> & {
181
+ default: boolean;
182
+ } & {
183
+ default: boolean;
184
+ };
185
+ showImageEmotion: VueTypeValidableDef<boolean, ValidatorFunction<boolean>> & {
186
+ default: boolean;
187
+ } & {
188
+ default: boolean;
189
+ };
124
190
  }>>, {
125
191
  submit: (arg: {
126
192
  contentList: InputContent[];
@@ -132,12 +198,16 @@ declare function __VLS_template(): {
132
198
  "click-send-image": (arg?: void | undefined) => void;
133
199
  }, {
134
200
  disabledInput: boolean;
201
+ showSendImage: boolean;
135
202
  placeholder: string;
203
+ showFaceEmotion: boolean;
204
+ showImageEmotion: boolean;
136
205
  disabledSubmitBtn: boolean;
137
206
  maxInputTextLength: number;
138
207
  defaultHeight: number;
139
208
  showBottom: boolean;
140
209
  }, true, ComponentOptionsBase<any, any, any, any, any, any, any, any, any, any>> & Readonly<Readonly<ExtractPropTypes< {
210
+ resizeStorageKey: VueTypeValidableDef<string, ValidatorFunction<string>>;
141
211
  defaultHeight: VueTypeValidableDef<number, ValidatorFunction<number>> & {
142
212
  default: number;
143
213
  } & {
@@ -148,6 +218,11 @@ declare function __VLS_template(): {
148
218
  } & {
149
219
  default: boolean;
150
220
  };
221
+ showSendImage: VueTypeValidableDef<boolean, ValidatorFunction<boolean>> & {
222
+ default: boolean;
223
+ } & {
224
+ default: boolean;
225
+ };
151
226
  placeholder: VueTypeValidableDef<string, ValidatorFunction<string>> & {
152
227
  default: string;
153
228
  };
@@ -166,9 +241,20 @@ declare function __VLS_template(): {
166
241
  } & {
167
242
  default: number;
168
243
  };
244
+ showFaceEmotion: VueTypeValidableDef<boolean, ValidatorFunction<boolean>> & {
245
+ default: boolean;
246
+ } & {
247
+ default: boolean;
248
+ };
249
+ showImageEmotion: VueTypeValidableDef<boolean, ValidatorFunction<boolean>> & {
250
+ default: boolean;
251
+ } & {
252
+ default: boolean;
253
+ };
169
254
  }>>> & ShallowUnwrapRef< {
170
255
  focusInput: () => void;
171
256
  }> & ExtractComputedReturns< {}> & ComponentCustomProperties & Readonly<ExtractPropTypes< {
257
+ resizeStorageKey: VueTypeValidableDef<string, ValidatorFunction<string>>;
172
258
  defaultHeight: VueTypeValidableDef<number, ValidatorFunction<number>> & {
173
259
  default: number;
174
260
  } & {
@@ -179,6 +265,11 @@ declare function __VLS_template(): {
179
265
  } & {
180
266
  default: boolean;
181
267
  };
268
+ showSendImage: VueTypeValidableDef<boolean, ValidatorFunction<boolean>> & {
269
+ default: boolean;
270
+ } & {
271
+ default: boolean;
272
+ };
182
273
  placeholder: VueTypeValidableDef<string, ValidatorFunction<string>> & {
183
274
  default: string;
184
275
  };
@@ -197,6 +288,16 @@ declare function __VLS_template(): {
197
288
  } & {
198
289
  default: number;
199
290
  };
291
+ showFaceEmotion: VueTypeValidableDef<boolean, ValidatorFunction<boolean>> & {
292
+ default: boolean;
293
+ } & {
294
+ default: boolean;
295
+ };
296
+ showImageEmotion: VueTypeValidableDef<boolean, ValidatorFunction<boolean>> & {
297
+ default: boolean;
298
+ } & {
299
+ default: boolean;
300
+ };
200
301
  }>> & {
201
302
  $scopedSlots: {
202
303
  'panel-suffix'?(_: {}): any;
@@ -207,20 +308,11 @@ declare function __VLS_template(): {
207
308
  'bottom-suffix'?(_: {}): any;
208
309
  };
209
310
  }) | null;
311
+ morePanelRef: HTMLDivElement;
210
312
  };
211
313
  rootEl: HTMLDivElement;
212
314
  };
213
315
 
214
- declare function __VLS_template_2(): {
215
- attrs: Partial<{}>;
216
- slots: {
217
- 'body-suffix'?(_: {}): any;
218
- suffix?(_: {}): any;
219
- };
220
- refs: {};
221
- rootEl: HTMLDivElement;
222
- };
223
-
224
316
  declare type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
225
317
 
226
318
  declare type __VLS_TemplateResult_2 = ReturnType<typeof __VLS_template_2>;
@@ -242,16 +334,48 @@ declare type __VLS_WithTemplateSlots_2<T, S> = T & {
242
334
  */
243
335
  declare type AnimationSource = 'donate-animation' | 'chat-like' | 'special-effect-animation';
244
336
 
337
+ /**
338
+ * 提问配置
339
+ */
340
+ declare interface AskConfig {
341
+ /**
342
+ * 提问欢迎语
343
+ * @default ''
344
+ */
345
+ askWelcomeText?: string;
346
+ /**
347
+ * 显示在线状态
348
+ * @default false
349
+ */
350
+ showOnlineStatus?: boolean;
351
+ /**
352
+ * 提问新消息回调
353
+ */
354
+ onNewAskMessage?: (askMsg: AskMsgType) => void;
355
+ }
356
+
245
357
  export declare const BanList: DefineComponent< {}, {
246
358
  openBanList: () => void;
247
359
  closeBanList: () => void;
248
360
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, Readonly<ExtractPropTypes< {}>>, {}>;
249
361
 
362
+ export declare interface BaseConfig {
363
+ /**
364
+ * 是否隐藏昵称
365
+ * @default false
366
+ */
367
+ hideNickname?: boolean;
368
+ }
369
+
250
370
  export declare interface ChatGlobalInject {
251
371
  /**
252
372
  * 获取聊天室实例对象
253
373
  */
254
374
  getChatTarget: () => PolyvChat;
375
+ /**
376
+ * 获取基础配置
377
+ */
378
+ getBaseConfig?: () => BaseConfig;
255
379
  /**
256
380
  * 获取消息配置
257
381
  */
@@ -292,18 +416,26 @@ export declare interface ChatGlobalInject {
292
416
  * 获取是否显示动画
293
417
  */
294
418
  getAnimationVisible?: (animationSource: AnimationSource) => boolean;
419
+ /**
420
+ * 获取提问配置
421
+ */
422
+ getAskConfig?: () => AskConfig;
295
423
  /**
296
424
  * 拦截处理,返回 true 表示终止后续的业务逻辑执行
297
425
  */
298
426
  interceptClick?: (triggerSource: InterceptTriggerSource) => boolean | Promise<boolean>;
299
427
  }
300
428
 
429
+ export declare const ChatMessageInputControl: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
430
+
301
431
  export declare const ChatMessageInputPopup: DefineComponent< {}, {
302
432
  showInputPopup: typeof showInputPopup;
303
433
  closeInputPopup: typeof closeInputPopup;
304
- }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, Readonly<ExtractPropTypes< {}>>, {}>;
434
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
435
+ "visible-change": (arg: boolean) => void;
436
+ }, string, Readonly<ExtractPropTypes< {}>>, {}>;
305
437
 
306
- export declare const ChatMessageInputSection: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
438
+ export declare const ChatMessageInputSection: __VLS_WithTemplateSlots_2<typeof __VLS_component_2, __VLS_TemplateResult_2["slots"]>;
307
439
 
308
440
  export declare const ChatMessageList: DefineComponent< {}, {
309
441
  setIsOnlySpecialMsg: (value: boolean) => void;
@@ -312,13 +444,13 @@ setIsOnlySpecialMsg: (value: boolean) => void;
312
444
  declare function closeInputPopup(): void;
313
445
 
314
446
  export declare const DonateAnimation: DefineComponent< {
315
- trackCount: VueTypeValidableDef<number, ValidatorFunction<number>> & {
447
+ trackCount: VueTypeValidableDef_2<number, ValidatorFunction<number>> & {
316
448
  default: number;
317
449
  } & {
318
450
  default: number;
319
451
  };
320
452
  }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, Readonly<ExtractPropTypes< {
321
- trackCount: VueTypeValidableDef<number, ValidatorFunction<number>> & {
453
+ trackCount: VueTypeValidableDef_2<number, ValidatorFunction<number>> & {
322
454
  default: number;
323
455
  } & {
324
456
  default: number;
@@ -350,14 +482,14 @@ export declare interface HistoryConfig {
350
482
  * @default false
351
483
  */
352
484
  workWechatMyCustomerHistory?: boolean;
485
+ /**
486
+ * 是否获取聊天历史消息
487
+ * @default true
488
+ */
489
+ getChatHistory?: boolean;
353
490
  }
354
491
 
355
492
  export declare interface InputConfig {
356
- /**
357
- * 聊天室输入框占位符
358
- * @default ''
359
- */
360
- inputPlaceholder?: string;
361
493
  /**
362
494
  * 黄脸表情开关
363
495
  * @default true
@@ -374,15 +506,29 @@ export declare interface InputConfig {
374
506
  */
375
507
  disabledInput?: boolean;
376
508
  /**
377
- * 发送图片开关
509
+ * 输入框遮罩文案
510
+ * @default ''
511
+ */
512
+ inputMaskPlaceholder?: string;
513
+ /**
514
+ * 聊天室输入框占位符
515
+ * @default ''
516
+ */
517
+ chatInputPlaceholder?: string;
518
+ /**
519
+ * 聊天区发送图片开关
378
520
  * @default true
379
521
  */
380
- sendImageEnabled?: boolean;
522
+ sendChatImageEnabled?: boolean;
381
523
  /**
382
- * 输入框遮罩文案
524
+ * 提问区输入框占位符
383
525
  * @default ''
384
526
  */
385
- inputMaskPlaceholder?: string;
527
+ askInputPlaceholder?: string;
528
+ /**
529
+ * 提问区发送图片开关
530
+ */
531
+ sendAskImageEnabled?: boolean;
386
532
  }
387
533
 
388
534
  export declare type InputContent = InputContentText | InputContentImage;
@@ -486,10 +632,6 @@ export declare interface ManageConfig {
486
632
  * @default false
487
633
  */
488
634
  askUserEnabled?: boolean;
489
- /**
490
- * 私聊用户回调
491
- */
492
- askUserCallback?: boolean | ((user: ChatMessageUser) => void);
493
635
  /**
494
636
  * 聊天室全体禁言开关
495
637
  * @default false
@@ -514,9 +656,23 @@ export declare interface ManageConfig {
514
656
  downloadOnlineListEnabled?: boolean;
515
657
  }
516
658
 
517
- export declare const ManagerInputControl: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, Readonly<ExtractPropTypes< {}>>, {}>;
518
-
519
- export declare const MemberList: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, Readonly<ExtractPropTypes< {}>>, {}>;
659
+ export declare const MemberList: DefineComponent< {
660
+ showTop: VueTypeValidableDef_3<boolean, ValidatorFunction<boolean>> & {
661
+ default: boolean;
662
+ } & {
663
+ default: boolean;
664
+ };
665
+ }, {
666
+ openRulePopup: typeof openRulePopup;
667
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, Readonly<ExtractPropTypes< {
668
+ showTop: VueTypeValidableDef_3<boolean, ValidatorFunction<boolean>> & {
669
+ default: boolean;
670
+ } & {
671
+ default: boolean;
672
+ };
673
+ }>>, {
674
+ showTop: boolean;
675
+ }>;
520
676
 
521
677
  export declare interface MessageConfig {
522
678
  /**
@@ -524,6 +680,11 @@ export declare interface MessageConfig {
524
680
  * @default ''
525
681
  */
526
682
  introductionText?: string;
683
+ /**
684
+ * 聊天区系统消息
685
+ * @default ''
686
+ */
687
+ systemText?: string;
527
688
  /**
528
689
  * 是否显示聊天室空数据提示
529
690
  * @default false
@@ -775,6 +936,21 @@ export declare interface OnlineConfig {
775
936
  * @default 200
776
937
  */
777
938
  requestCount?: number;
939
+ /**
940
+ * 搜索在线列表开关
941
+ * @default true
942
+ */
943
+ searchEnabled?: boolean;
944
+ /**
945
+ * 规则开关
946
+ * @default false
947
+ */
948
+ ruleEnabled?: boolean;
949
+ /**
950
+ * 轮训间隔,单位:毫秒
951
+ * @default 10000
952
+ */
953
+ pollingTime?: number;
778
954
  /**
779
955
  * 在线人数更新回调
780
956
  * @param count 在线人数
@@ -782,14 +958,16 @@ export declare interface OnlineConfig {
782
958
  onlineCountCallback?: (count: number) => void;
783
959
  }
784
960
 
961
+ declare function openRulePopup(): void;
962
+
785
963
  export declare const RunwayEffect: DefineComponent< {
786
- left: VueTypeValidableDef<number, ValidatorFunction<number>> & {
964
+ left: VueTypeValidableDef_2<number, ValidatorFunction<number>> & {
787
965
  default: number;
788
966
  } & {
789
967
  default: number;
790
968
  };
791
969
  }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, Readonly<ExtractPropTypes< {
792
- left: VueTypeValidableDef<number, ValidatorFunction<number>> & {
970
+ left: VueTypeValidableDef_2<number, ValidatorFunction<number>> & {
793
971
  default: number;
794
972
  } & {
795
973
  default: number;
@@ -833,7 +1011,7 @@ setIsOnlySpecialMsg: (value: boolean) => void;
833
1011
  toggleOnlySpecialMsg: () => void;
834
1012
  }>;
835
1013
 
836
- export declare const useSendMsg: () => {
1014
+ export declare const useSendChatMsg: () => {
837
1015
  sendSpeakMsg: (options: SendSpeakMsgOptions) => Promise<void>;
838
1016
  sendImageMsg: (options: SendImageMsgOptions) => Promise<void>;
839
1017
  sendEmotionImageMsg: (options: SendEmotionImageMsgOptions) => Promise<void>;
@@ -853,6 +1031,4 @@ showSpecialEffect: () => void;
853
1031
  hideSpecialEffect: () => void;
854
1032
  }>;
855
1033
 
856
- export declare const ViewerInputControl: __VLS_WithTemplateSlots_2<typeof __VLS_component_2, __VLS_TemplateResult_2["slots"]>;
857
-
858
1034
  export { }