@polyv/chat-ui 2.0.0-rc-20250925.2 → 2.1.0-rc-20251023.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 +173 -22
  2. package/index.es.js +18686 -18644
  3. package/index.umd.js +342 -243
  4. package/package.json +1 -1
  5. package/special.d.ts +173 -22
  6. package/special.es.js +18559 -18517
  7. package/special.umd.js +342 -243
package/index.d.ts CHANGED
@@ -1,5 +1,7 @@
1
- import { ChatMsgSource } from '@polyv/chat-sdk';
2
- import { ChatMsgType } from '@polyv/chat-sdk';
1
+ import { ChatMessageUser } from '@polyv/chat';
2
+ import { ChatMsgRewardType } from '@polyv/chat';
3
+ import { ChatMsgSource } from '@polyv/chat';
4
+ import { ChatMsgType } from '@polyv/chat';
3
5
  import { ComponentCustomProperties } from 'vue';
4
6
  import { ComponentOptions } from 'vue';
5
7
  import { ComponentOptionsBase } from 'vue';
@@ -7,37 +9,63 @@ import { ComponentOptionsMixin } from 'vue';
7
9
  import { DefineComponent } from 'vue';
8
10
  import { ExtractComputedReturns } from 'vue/types/v3-component-options';
9
11
  import { ExtractPropTypes } from 'vue';
10
- import { PickChatMsgType } from '@polyv/chat-sdk';
11
- import { PolyvChat } from '@polyv/chat-sdk';
12
+ import { PickChatMsgType } from '@polyv/chat';
13
+ import { PolyvChat } from '@polyv/chat';
14
+ import { SendEmotionImageMsgOptions } from '@polyv/chat';
15
+ import { SendImageMsgOptions } from '@polyv/chat';
16
+ import { SendSpeakMsgOptions } from '@polyv/chat';
12
17
  import { ShallowUnwrapRef } from 'vue';
18
+ import { SystemMsgType } from '@polyv/chat';
13
19
  import { ValidatorFunction } from 'vue-types/dist/types';
14
20
  import { Vue3Instance } from 'vue/types/v3-component-public-instance';
15
21
  import { VueTypeValidableDef } from 'vue-types';
16
22
 
17
23
  declare const __VLS_component: DefineComponent< {
24
+ defaultHeight: VueTypeValidableDef<number, ValidatorFunction<number>> & {
25
+ default: number;
26
+ } & {
27
+ default: number;
28
+ };
29
+ /** 是否显示更多 */
18
30
  showMore: VueTypeValidableDef<boolean, ValidatorFunction<boolean>> & {
19
31
  default: boolean;
20
32
  } & {
21
33
  default: boolean;
22
34
  };
23
35
  }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, Readonly<ExtractPropTypes< {
36
+ defaultHeight: VueTypeValidableDef<number, ValidatorFunction<number>> & {
37
+ default: number;
38
+ } & {
39
+ default: number;
40
+ };
41
+ /** 是否显示更多 */
24
42
  showMore: VueTypeValidableDef<boolean, ValidatorFunction<boolean>> & {
25
43
  default: boolean;
26
44
  } & {
27
45
  default: boolean;
28
46
  };
29
47
  }>>, {
48
+ defaultHeight: number;
30
49
  showMore: boolean;
31
50
  }>;
32
51
 
52
+ declare const __VLS_component_2: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, Readonly<ExtractPropTypes< {}>>, {}>;
53
+
33
54
  declare function __VLS_template(): {
34
55
  attrs: Partial<{}>;
35
56
  slots: {
36
57
  'more-panel'?(_: {}): any;
58
+ 'icon-left-suffix'?(_: {}): any;
59
+ 'icon-right-suffix'?(_: {}): any;
37
60
  'bottom-suffix'?(_: {}): any;
38
61
  };
39
62
  refs: {
40
63
  msgInputBaseRef: (Vue3Instance< {}, Readonly<ExtractPropTypes< {
64
+ defaultHeight: VueTypeValidableDef<number, ValidatorFunction<number>> & {
65
+ default: number;
66
+ } & {
67
+ default: number;
68
+ };
41
69
  showBottom: VueTypeValidableDef<boolean, ValidatorFunction<boolean>> & {
42
70
  default: boolean;
43
71
  } & {
@@ -62,6 +90,11 @@ declare function __VLS_template(): {
62
90
  default: number;
63
91
  };
64
92
  }>>, Readonly<ExtractPropTypes< {
93
+ defaultHeight: VueTypeValidableDef<number, ValidatorFunction<number>> & {
94
+ default: number;
95
+ } & {
96
+ default: number;
97
+ };
65
98
  showBottom: VueTypeValidableDef<boolean, ValidatorFunction<boolean>> & {
66
99
  default: boolean;
67
100
  } & {
@@ -90,17 +123,23 @@ declare function __VLS_template(): {
90
123
  contentList: InputContent[];
91
124
  }) => void;
92
125
  resize: (arg?: void | undefined) => void;
93
- "send-image": (arg?: void | undefined) => void;
94
126
  "system-msg": (arg: {
95
127
  content: string;
96
128
  }) => void;
129
+ "click-send-image": (arg?: void | undefined) => void;
97
130
  }, {
98
131
  disabledInput: boolean;
99
132
  placeholder: string;
100
133
  disabledSubmitBtn: boolean;
101
134
  maxInputTextLength: number;
135
+ defaultHeight: number;
102
136
  showBottom: boolean;
103
137
  }, true, ComponentOptionsBase<any, any, any, any, any, any, any, any, any, any>> & Readonly<Readonly<ExtractPropTypes< {
138
+ defaultHeight: VueTypeValidableDef<number, ValidatorFunction<number>> & {
139
+ default: number;
140
+ } & {
141
+ default: number;
142
+ };
104
143
  showBottom: VueTypeValidableDef<boolean, ValidatorFunction<boolean>> & {
105
144
  default: boolean;
106
145
  } & {
@@ -127,6 +166,11 @@ declare function __VLS_template(): {
127
166
  }>>> & ShallowUnwrapRef< {
128
167
  focusInput: () => void;
129
168
  }> & ExtractComputedReturns< {}> & ComponentCustomProperties & Readonly<ExtractPropTypes< {
169
+ defaultHeight: VueTypeValidableDef<number, ValidatorFunction<number>> & {
170
+ default: number;
171
+ } & {
172
+ default: number;
173
+ };
130
174
  showBottom: VueTypeValidableDef<boolean, ValidatorFunction<boolean>> & {
131
175
  default: boolean;
132
176
  } & {
@@ -164,14 +208,37 @@ declare function __VLS_template(): {
164
208
  rootEl: HTMLDivElement;
165
209
  };
166
210
 
211
+ declare function __VLS_template_2(): {
212
+ attrs: Partial<{}>;
213
+ slots: {
214
+ 'body-suffix'?(_: {}): any;
215
+ suffix?(_: {}): any;
216
+ };
217
+ refs: {};
218
+ rootEl: HTMLDivElement;
219
+ };
220
+
167
221
  declare type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
168
222
 
223
+ declare type __VLS_TemplateResult_2 = ReturnType<typeof __VLS_template_2>;
224
+
169
225
  declare type __VLS_WithTemplateSlots<T, S> = T & {
170
226
  new (): {
171
227
  $scopedSlots: S;
172
228
  };
173
229
  };
174
230
 
231
+ declare type __VLS_WithTemplateSlots_2<T, S> = T & {
232
+ new (): {
233
+ $scopedSlots: S;
234
+ };
235
+ };
236
+
237
+ /**
238
+ * 动画来源
239
+ */
240
+ declare type AnimationSource = 'donate-svga-animation' | 'donate-animation';
241
+
175
242
  export declare const BanList: DefineComponent< {}, {
176
243
  openBanList: () => void;
177
244
  closeBanList: () => void;
@@ -202,23 +269,65 @@ export declare interface ChatGlobalInject {
202
269
  * 在线列表配置
203
270
  */
204
271
  getOnlineConfig?: () => OnlineConfig;
272
+ /**
273
+ * 获取打赏配置
274
+ */
275
+ getDonateConfig?: () => DonateConfig;
205
276
  /**
206
277
  * 获取直播状态
207
278
  */
208
279
  getLiveStatus?: () => string;
280
+ /**
281
+ * 获取是否显示动画
282
+ */
283
+ getAnimationVisible?: (animationSource: AnimationSource) => boolean;
284
+ /**
285
+ * 拦截处理,返回 true 表示终止后续的业务逻辑执行
286
+ */
287
+ interceptClick?: (triggerSource: InterceptTriggerSource) => boolean | Promise<boolean>;
209
288
  }
210
289
 
211
- export declare const ChatMessageInputManager: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
212
-
213
290
  export declare const ChatMessageInputPopup: DefineComponent< {}, {
214
291
  showInputPopup: typeof showInputPopup;
215
292
  closeInputPopup: typeof closeInputPopup;
216
293
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, Readonly<ExtractPropTypes< {}>>, {}>;
217
294
 
218
- export declare const ChatMessageList: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, Readonly<ExtractPropTypes< {}>>, {}>;
295
+ export declare const ChatMessageInputSection: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
296
+
297
+ export declare const ChatMessageList: DefineComponent< {}, {
298
+ setIsOnlySpecialMsg: (value: boolean) => void;
299
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, Readonly<ExtractPropTypes< {}>>, {}>;
219
300
 
220
301
  declare function closeInputPopup(): void;
221
302
 
303
+ export declare const DonateAnimation: DefineComponent< {
304
+ trackCount: VueTypeValidableDef<number, ValidatorFunction<number>> & {
305
+ default: number;
306
+ } & {
307
+ default: number;
308
+ };
309
+ }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, Readonly<ExtractPropTypes< {
310
+ trackCount: VueTypeValidableDef<number, ValidatorFunction<number>> & {
311
+ default: number;
312
+ } & {
313
+ default: number;
314
+ };
315
+ }>>, {
316
+ trackCount: number;
317
+ }>;
318
+
319
+ /**
320
+ * 打赏配置
321
+ */
322
+ declare interface DonateConfig {
323
+ /**
324
+ * 获取打赏 svga 地址
325
+ */
326
+ getSvgaUrl?: (chatMsg: ChatMsgRewardType) => Promise<string | undefined> | string | undefined;
327
+ }
328
+
329
+ export declare const DonateSvgaAnimation: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, Readonly<ExtractPropTypes< {}>>, {}>;
330
+
222
331
  /**
223
332
  * 文字类型,normal-普通文字,nickname-用户昵称,productName-商品名称
224
333
  */
@@ -226,7 +335,7 @@ export declare type EffectTextType = 'normal' | 'nickname' | 'productName' | 'do
226
335
 
227
336
  export declare const GlobalVariable = "PolyvChatUI";
228
337
 
229
- declare interface HistoryConfig {
338
+ export declare interface HistoryConfig {
230
339
  /**
231
340
  * 是否获取企微我的客户的消息
232
341
  * @default false
@@ -257,7 +366,7 @@ export declare interface InputConfig {
257
366
  disabledInput?: boolean;
258
367
  /**
259
368
  * 发送图片开关
260
- * @defualt true
369
+ * @default true
261
370
  */
262
371
  sendImageEnabled?: boolean;
263
372
  /**
@@ -279,6 +388,19 @@ export declare interface InputContentText {
279
388
  content: string;
280
389
  }
281
390
 
391
+ /**
392
+ * 拦截来源
393
+ *
394
+ * send-image: 发送图片
395
+ * emotion-picker: 表情选择
396
+ * chat-quote: 引用回复
397
+ * more-panel: 更多面板
398
+ * click-message-input: 消息输入框
399
+ * focus-message-input: 聚焦输入框
400
+ * click-submit: 点击提交按钮
401
+ */
402
+ export declare type InterceptTriggerSource = 'send-image' | 'emotion-picker' | 'chat-quote' | 'more-panel' | 'click-message-input' | 'focus-message-input' | 'click-submit';
403
+
282
404
  export declare const KickList: DefineComponent< {}, {
283
405
  openKickList: () => void;
284
406
  closeKickList: () => void;
@@ -331,7 +453,7 @@ export declare interface ManageConfig {
331
453
  /**
332
454
  * 私聊用户回调
333
455
  */
334
- askUserCallback?: boolean | ((chatMsg: ChatMsgType) => void);
456
+ askUserCallback?: boolean | ((user: ChatMessageUser) => void);
335
457
  /**
336
458
  * 聊天室全体禁言开关
337
459
  * @default false
@@ -342,10 +464,24 @@ export declare interface ManageConfig {
342
464
  * @default false
343
465
  */
344
466
  pushSpeakMsgToQaEnabled?: boolean;
467
+ /**
468
+ * 到勤名单开关
469
+ */
470
+ attendanceEnabled?: boolean;
471
+ /**
472
+ * 白名单开关
473
+ */
474
+ whiteListEnabled?: boolean;
475
+ /**
476
+ * 下载在线列表开关
477
+ */
478
+ downloadOnlineListEnabled?: boolean;
345
479
  }
346
480
 
347
481
  export declare const ManagerInputControl: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, Readonly<ExtractPropTypes< {}>>, {}>;
348
482
 
483
+ export declare const MemberList: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, Readonly<ExtractPropTypes< {}>>, {}>;
484
+
349
485
  export declare interface MessageConfig {
350
486
  /**
351
487
  * 聊天区通知文本
@@ -404,11 +540,6 @@ export declare interface MessageConfig {
404
540
  * @default false
405
541
  */
406
542
  quoteEnabled?: boolean;
407
- /**
408
- * 回复是否响应聊天室关闭
409
- * @default false
410
- */
411
- quoteResponseChatRoomClosed?: boolean;
412
543
  /**
413
544
  * 消息水平间距
414
545
  * @default { left: 16, right: 16 }
@@ -417,6 +548,14 @@ export declare interface MessageConfig {
417
548
  left: number;
418
549
  right: number;
419
550
  };
551
+ /**
552
+ * 消息容器边界间距
553
+ * @default { top: 0, bottom: 0 }
554
+ */
555
+ messageContainerBoundaryPadding?: {
556
+ top: number;
557
+ bottom: number;
558
+ };
420
559
  /**
421
560
  * 鼠标悬停高亮
422
561
  * @default false
@@ -565,7 +704,7 @@ export declare enum MessageEffectType {
565
704
  }
566
705
 
567
706
  /**
568
- * 消息布局,紧凑布局和宽松布局
707
+ * 消息布局,compact-紧凑布局,loose-宽松布局
569
708
  */
570
709
  export declare type MessageLayout = 'compact' | 'loose';
571
710
 
@@ -574,22 +713,34 @@ export declare type MessageLayout = 'compact' | 'loose';
574
713
  */
575
714
  declare type MsgControlInteraction = 'context-menu' | 'hover' | 'bubble' | 'action-sheet';
576
715
 
577
- declare interface OnlineConfig {
716
+ export declare interface OnlineConfig {
578
717
  /**
579
718
  * 请求获取的在线列表数量
580
719
  * @default 200
581
720
  */
582
721
  requestCount?: number;
722
+ /**
723
+ * 在线人数更新回调
724
+ * @param count 在线人数
725
+ */
726
+ onlineCountCallback?: (count: number) => void;
583
727
  }
584
728
 
585
- export declare const OnlineList: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
586
- "total-change": (arg: number) => void;
587
- }, string, Readonly<ExtractPropTypes< {}>>, {}>;
588
-
589
729
  declare function showInputPopup(): void;
590
730
 
591
731
  export declare const TopingMsgList: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, Readonly<ExtractPropTypes< {}>>, {}>;
592
732
 
593
733
  export declare const useChatGlobalProvide: (injectData: ChatGlobalInject) => void;
594
734
 
735
+ export declare const useSendMsg: () => {
736
+ sendSpeakMsg: (options: SendSpeakMsgOptions) => Promise<void>;
737
+ sendImageMsg: (options: SendImageMsgOptions) => Promise<void>;
738
+ sendEmotionImageMsg: (options: SendEmotionImageMsgOptions) => Promise<void>;
739
+ sendSystemMsg: (content: string, type?: SystemMsgType) => void;
740
+ choiceImageFileSend: () => Promise<void>;
741
+ sendContentList: (contentList: InputContent[], quoteMsg?: ChatMsgType) => Promise<void>;
742
+ };
743
+
744
+ export declare const ViewerInputControl: __VLS_WithTemplateSlots_2<typeof __VLS_component_2, __VLS_TemplateResult_2["slots"]>;
745
+
595
746
  export { }