@polyv/chat-ui 2.0.0-rc-20250925.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.
package/package.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "@polyv/chat-ui",
3
+ "version": "2.0.0-rc-20250925.1",
4
+ "main": "./index.es.js",
5
+ "dependencies": {},
6
+ "types": "./index.d.ts"
7
+ }
package/special.d.ts ADDED
@@ -0,0 +1,590 @@
1
+ import { ChatMsgSource } from '@polyv/chat-sdk';
2
+ import { ChatMsgType } from '@polyv/chat-sdk';
3
+ import { ComponentCustomProperties } from 'vue';
4
+ import { ComponentOptions } from 'vue';
5
+ import { ComponentOptionsBase } from 'vue';
6
+ import { ComponentOptionsMixin } from 'vue';
7
+ import { DefineComponent } from 'vue';
8
+ import { ExtractComputedReturns } from 'vue/types/v3-component-options';
9
+ import { ExtractPropTypes } from 'vue';
10
+ import { PickChatMsgType } from '@polyv/chat-sdk';
11
+ import { PolyvChat } from '@polyv/chat-sdk';
12
+ import { ShallowUnwrapRef } from 'vue';
13
+ import { ValidatorFunction } from 'vue-types/dist/types';
14
+ import { Vue3Instance } from 'vue/types/v3-component-public-instance';
15
+ import { VueTypeValidableDef } from '../../../../../../node_modules/vue-types';
16
+
17
+ declare const __VLS_component: DefineComponent< {
18
+ showMore: VueTypeValidableDef<boolean, ValidatorFunction<boolean>> & {
19
+ default: boolean;
20
+ } & {
21
+ default: boolean;
22
+ };
23
+ }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, Readonly<ExtractPropTypes< {
24
+ showMore: VueTypeValidableDef<boolean, ValidatorFunction<boolean>> & {
25
+ default: boolean;
26
+ } & {
27
+ default: boolean;
28
+ };
29
+ }>>, {
30
+ showMore: boolean;
31
+ }>;
32
+
33
+ declare function __VLS_template(): {
34
+ attrs: Partial<{}>;
35
+ slots: {
36
+ 'more-panel'?(_: {}): any;
37
+ 'bottom-suffix'?(_: {}): any;
38
+ };
39
+ refs: {
40
+ msgInputBaseRef: (Vue3Instance< {}, Readonly<ExtractPropTypes< {
41
+ showBottom: VueTypeValidableDef<boolean, ValidatorFunction<boolean>> & {
42
+ default: boolean;
43
+ } & {
44
+ default: boolean;
45
+ };
46
+ placeholder: VueTypeValidableDef<string, ValidatorFunction<string>> & {
47
+ default: string;
48
+ };
49
+ disabledInput: VueTypeValidableDef<boolean, ValidatorFunction<boolean>> & {
50
+ default: boolean;
51
+ } & {
52
+ default: boolean;
53
+ };
54
+ disabledSubmitBtn: VueTypeValidableDef<boolean, ValidatorFunction<boolean>> & {
55
+ default: boolean;
56
+ } & {
57
+ default: boolean;
58
+ };
59
+ maxInputTextLength: VueTypeValidableDef<number, ValidatorFunction<number>> & {
60
+ default: number;
61
+ } & {
62
+ default: number;
63
+ };
64
+ }>>, Readonly<ExtractPropTypes< {
65
+ showBottom: VueTypeValidableDef<boolean, ValidatorFunction<boolean>> & {
66
+ default: boolean;
67
+ } & {
68
+ default: boolean;
69
+ };
70
+ placeholder: VueTypeValidableDef<string, ValidatorFunction<string>> & {
71
+ default: string;
72
+ };
73
+ disabledInput: VueTypeValidableDef<boolean, ValidatorFunction<boolean>> & {
74
+ default: boolean;
75
+ } & {
76
+ default: boolean;
77
+ };
78
+ disabledSubmitBtn: VueTypeValidableDef<boolean, ValidatorFunction<boolean>> & {
79
+ default: boolean;
80
+ } & {
81
+ default: boolean;
82
+ };
83
+ maxInputTextLength: VueTypeValidableDef<number, ValidatorFunction<number>> & {
84
+ default: number;
85
+ } & {
86
+ default: number;
87
+ };
88
+ }>>, {
89
+ submit: (arg: {
90
+ contentList: InputContent[];
91
+ }) => void;
92
+ resize: (arg?: void | undefined) => void;
93
+ "send-image": (arg?: void | undefined) => void;
94
+ "system-msg": (arg: {
95
+ content: string;
96
+ }) => void;
97
+ }, {
98
+ disabledInput: boolean;
99
+ placeholder: string;
100
+ disabledSubmitBtn: boolean;
101
+ maxInputTextLength: number;
102
+ showBottom: boolean;
103
+ }, true, ComponentOptionsBase<any, any, any, any, any, any, any, any, any, any>> & Readonly<Readonly<ExtractPropTypes< {
104
+ showBottom: VueTypeValidableDef<boolean, ValidatorFunction<boolean>> & {
105
+ default: boolean;
106
+ } & {
107
+ default: boolean;
108
+ };
109
+ placeholder: VueTypeValidableDef<string, ValidatorFunction<string>> & {
110
+ default: string;
111
+ };
112
+ disabledInput: VueTypeValidableDef<boolean, ValidatorFunction<boolean>> & {
113
+ default: boolean;
114
+ } & {
115
+ default: boolean;
116
+ };
117
+ disabledSubmitBtn: VueTypeValidableDef<boolean, ValidatorFunction<boolean>> & {
118
+ default: boolean;
119
+ } & {
120
+ default: boolean;
121
+ };
122
+ maxInputTextLength: VueTypeValidableDef<number, ValidatorFunction<number>> & {
123
+ default: number;
124
+ } & {
125
+ default: number;
126
+ };
127
+ }>>> & ShallowUnwrapRef< {
128
+ focusInput: () => void;
129
+ }> & ExtractComputedReturns< {}> & ComponentCustomProperties & Readonly<ExtractPropTypes< {
130
+ showBottom: VueTypeValidableDef<boolean, ValidatorFunction<boolean>> & {
131
+ default: boolean;
132
+ } & {
133
+ default: boolean;
134
+ };
135
+ placeholder: VueTypeValidableDef<string, ValidatorFunction<string>> & {
136
+ default: string;
137
+ };
138
+ disabledInput: VueTypeValidableDef<boolean, ValidatorFunction<boolean>> & {
139
+ default: boolean;
140
+ } & {
141
+ default: boolean;
142
+ };
143
+ disabledSubmitBtn: VueTypeValidableDef<boolean, ValidatorFunction<boolean>> & {
144
+ default: boolean;
145
+ } & {
146
+ default: boolean;
147
+ };
148
+ maxInputTextLength: VueTypeValidableDef<number, ValidatorFunction<number>> & {
149
+ default: number;
150
+ } & {
151
+ default: number;
152
+ };
153
+ }>> & {
154
+ $scopedSlots: {
155
+ 'panel-suffix'?(_: {}): any;
156
+ 'icon-left'?(_: {}): any;
157
+ 'icon-left-suffix'?(_: {}): any;
158
+ 'icon-right-suffix'?(_: {}): any;
159
+ input?(_: {}): any;
160
+ 'bottom-suffix'?(_: {}): any;
161
+ };
162
+ }) | null;
163
+ };
164
+ rootEl: HTMLDivElement;
165
+ };
166
+
167
+ declare type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
168
+
169
+ declare type __VLS_WithTemplateSlots<T, S> = T & {
170
+ new (): {
171
+ $scopedSlots: S;
172
+ };
173
+ };
174
+
175
+ export declare const BanList: DefineComponent< {}, {
176
+ openBanList: () => void;
177
+ closeBanList: () => void;
178
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, Readonly<ExtractPropTypes< {}>>, {}>;
179
+
180
+ export declare interface ChatGlobalInject {
181
+ /**
182
+ * 获取聊天室实例对象
183
+ */
184
+ getChatTarget: () => PolyvChat;
185
+ /**
186
+ * 获取消息配置
187
+ */
188
+ getMessageConfig?: () => MessageConfig;
189
+ /**
190
+ * 获取输入框配置
191
+ */
192
+ getInputConfig?: () => InputConfig;
193
+ /**
194
+ * 获取管理配置
195
+ */
196
+ getManageConfig?: () => ManageConfig | boolean;
197
+ /**
198
+ * 获取历史记录配置
199
+ */
200
+ getHistoryConfig?: () => HistoryConfig;
201
+ /**
202
+ * 在线列表配置
203
+ */
204
+ getOnlineConfig?: () => OnlineConfig;
205
+ /**
206
+ * 获取直播状态
207
+ */
208
+ getLiveStatus?: () => string;
209
+ }
210
+
211
+ export declare const ChatMessageInputManager: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
212
+
213
+ export declare const ChatMessageInputPopup: DefineComponent< {}, {
214
+ showInputPopup: typeof showInputPopup;
215
+ closeInputPopup: typeof closeInputPopup;
216
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, Readonly<ExtractPropTypes< {}>>, {}>;
217
+
218
+ export declare const ChatMessageList: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, Readonly<ExtractPropTypes< {}>>, {}>;
219
+
220
+ declare function closeInputPopup(): void;
221
+
222
+ /**
223
+ * 文字类型,normal-普通文字,nickname-用户昵称,productName-商品名称
224
+ */
225
+ export declare type EffectTextType = 'normal' | 'nickname' | 'productName' | 'donateName';
226
+
227
+ export declare const GlobalVariable = "PolyvChatUISpecial";
228
+
229
+ declare interface HistoryConfig {
230
+ /**
231
+ * 是否获取企微我的客户的消息
232
+ * @default false
233
+ */
234
+ workWechatMyCustomerHistory?: boolean;
235
+ }
236
+
237
+ export declare interface InputConfig {
238
+ /**
239
+ * 聊天室输入框占位符
240
+ * @default ''
241
+ */
242
+ inputPlaceholder?: string;
243
+ /**
244
+ * 黄脸表情开关
245
+ * @default true
246
+ */
247
+ faceEmotionEnabled?: boolean;
248
+ /**
249
+ * 图片表情开关
250
+ * @default true
251
+ */
252
+ imageEmotionEnabled?: boolean;
253
+ /**
254
+ * 是否禁用输入框
255
+ * @default false
256
+ */
257
+ disabledInput?: boolean;
258
+ /**
259
+ * 发送图片开关
260
+ * @defualt true
261
+ */
262
+ sendImageEnabled?: boolean;
263
+ /**
264
+ * 输入框遮罩文案
265
+ * @default ''
266
+ */
267
+ inputMaskPlaceholder?: string;
268
+ }
269
+
270
+ export declare type InputContent = InputContentText | InputContentImage;
271
+
272
+ export declare interface InputContentImage {
273
+ type: 'img';
274
+ file: File;
275
+ }
276
+
277
+ export declare interface InputContentText {
278
+ type: 'text';
279
+ content: string;
280
+ }
281
+
282
+ export declare const KickList: DefineComponent< {}, {
283
+ openKickList: () => void;
284
+ closeKickList: () => void;
285
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, Readonly<ExtractPropTypes< {}>>, {}>;
286
+
287
+ /**
288
+ * 管理配置
289
+ */
290
+ export declare interface ManageConfig {
291
+ /**
292
+ * 删除消息开关
293
+ * @default false
294
+ */
295
+ deleteMsgEnabled?: boolean;
296
+ /**
297
+ * 清空消息开关
298
+ * @default false
299
+ */
300
+ clearMsgEnabled?: boolean;
301
+ /**
302
+ * 禁言用户开关
303
+ * @default false
304
+ */
305
+ banUserEnabled?: boolean;
306
+ /**
307
+ * 禁言 ip 开关
308
+ * @default false
309
+ */
310
+ banIpEnabled?: boolean;
311
+ /**
312
+ * 踢出用户开关
313
+ * @default false
314
+ */
315
+ kickUserEnabled?: boolean;
316
+ /**
317
+ * 课堂激励开关
318
+ * @default false
319
+ */
320
+ motivationLikeEnabled?: boolean;
321
+ /**
322
+ * 置顶消息开关
323
+ * @default false
324
+ */
325
+ topMsgEnabled?: boolean;
326
+ /**
327
+ * 私聊用户开关
328
+ * @default false
329
+ */
330
+ askUserEnabled?: boolean;
331
+ /**
332
+ * 私聊用户回调
333
+ */
334
+ askUserCallback?: boolean | ((chatMsg: ChatMsgType) => void);
335
+ /**
336
+ * 聊天室全体禁言开关
337
+ * @default false
338
+ */
339
+ chatSwitchEnabled?: boolean;
340
+ /**
341
+ * 推送观众发言消息到问答开关
342
+ * @default false
343
+ */
344
+ pushSpeakMsgToQaEnabled?: boolean;
345
+ }
346
+
347
+ export declare const ManagerInputControl: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, Readonly<ExtractPropTypes< {}>>, {}>;
348
+
349
+ export declare interface MessageConfig {
350
+ /**
351
+ * 聊天区通知文本
352
+ * @default ''
353
+ */
354
+ introductionText?: string;
355
+ /**
356
+ * 需要隐藏的消息来源
357
+ * @default []
358
+ */
359
+ hideSources?: ChatMsgSource[];
360
+ /**
361
+ * 隐藏消息处理
362
+ * @default {}
363
+ */
364
+ hideMessage?: {
365
+ [msgSource in ChatMsgSource]?: (chatMsg: PickChatMsgType<msgSource>) => boolean;
366
+ };
367
+ /**
368
+ * 是否显示消息时间
369
+ * @default true
370
+ */
371
+ showMessageTime?: boolean;
372
+ /**
373
+ * 消息布局
374
+ * @default compact
375
+ */
376
+ messageLayout?: MessageLayout;
377
+ /**
378
+ * 是否显示消息的用户头像
379
+ * @default true
380
+ */
381
+ showUserAvatar?: boolean;
382
+ /**
383
+ * 是否显示普通观众的头衔
384
+ * @default false
385
+ */
386
+ showOrdinaryActor?: boolean;
387
+ /**
388
+ * 翻译开关
389
+ * @default false
390
+ */
391
+ translateEnabled?: boolean;
392
+ /**
393
+ * 复制文本消息开关
394
+ * @default false
395
+ */
396
+ copySpeakEnabled?: boolean;
397
+ /**
398
+ * 引用回复开关
399
+ * @default false
400
+ */
401
+ quoteEnabled?: boolean;
402
+ /**
403
+ * 回复是否响应聊天室关闭
404
+ * @default false
405
+ */
406
+ quoteResponseChatRoomClosed?: boolean;
407
+ /**
408
+ * 消息水平间距
409
+ * @default { left: 16, right: 16 }
410
+ */
411
+ messageHorizontalSpacing?: {
412
+ left: number;
413
+ right: number;
414
+ };
415
+ /**
416
+ * 鼠标悬停高亮
417
+ * @default false
418
+ */
419
+ hoverHighlight?: boolean;
420
+ /**
421
+ * 消息操作交互类型
422
+ * @default 'context-menu'
423
+ */
424
+ messageControlInteraction?: MsgControlInteraction;
425
+ /**
426
+ * 是否显示图片预览图标
427
+ * @default false
428
+ */
429
+ imagePreviewIcon?: boolean;
430
+ /**
431
+ * 自己发言消息对齐方式,仅 loose 宽松模式下生效
432
+ * @default 'left'
433
+ */
434
+ selfMsgAlign?: 'left' | 'right';
435
+ /**
436
+ * 点击消息回调
437
+ * @default {}
438
+ */
439
+ clickMsgCallback?: {
440
+ [msgSource in ChatMsgSource]?: (chatMsg: PickChatMsgType<msgSource>) => void;
441
+ };
442
+ /**
443
+ * 自定义消息渲染内容
444
+ * @default {}
445
+ */
446
+ customMessageRender?: {
447
+ [ChatMsgSource.Redpaper]?: ComponentOptions<any>;
448
+ };
449
+ /**
450
+ * 消息大小开关
451
+ * @default false
452
+ */
453
+ messageSizeEnabled?: boolean;
454
+ /**
455
+ * 是否显示虚拟人的头衔
456
+ * @default false
457
+ */
458
+ showDummyActor?: boolean;
459
+ /**
460
+ * 只看主持人开关
461
+ * @default false
462
+ */
463
+ onlySpecialMsgEnabled?: boolean;
464
+ /**
465
+ * 消息自动翻译开关
466
+ * @default false
467
+ */
468
+ autoTranslateEnabled?: boolean;
469
+ }
470
+
471
+ /**
472
+ * 消息特效数据
473
+ */
474
+ export declare interface MessageEffectData {
475
+ id: string;
476
+ /**
477
+ * 特效类型
478
+ */
479
+ effectType: MessageEffectType;
480
+ /**
481
+ * 昵称列表
482
+ */
483
+ nicknames: string[];
484
+ /**
485
+ * 昵称数量
486
+ */
487
+ nicknameCount: number;
488
+ /**
489
+ * 目标 id
490
+ */
491
+ targetId: string | number;
492
+ /**
493
+ * 目标名称
494
+ */
495
+ targetName: string;
496
+ /**
497
+ * 目标数量
498
+ */
499
+ targetCount?: number;
500
+ /**
501
+ * 目标图片
502
+ */
503
+ targetImage?: string;
504
+ /**
505
+ * 商品类消息的商品类型
506
+ */
507
+ productType?: string;
508
+ /**
509
+ * 字符串模板
510
+ */
511
+ strTemplate: string;
512
+ }
513
+
514
+ /**
515
+ * 消息特效文字节点
516
+ */
517
+ export declare interface MessageEffectTextItem {
518
+ /**
519
+ * 文字类型
520
+ */
521
+ textType: EffectTextType;
522
+ /**
523
+ * 文字内容
524
+ */
525
+ text: string;
526
+ /**
527
+ * 数量
528
+ */
529
+ count?: number;
530
+ /**
531
+ * 图片
532
+ */
533
+ image?: string;
534
+ }
535
+
536
+ /**
537
+ * 消息特效类型
538
+ */
539
+ export declare enum MessageEffectType {
540
+ /**
541
+ * 用户访问
542
+ */
543
+ JoinVisit = "JoinVisit",
544
+ /**
545
+ * 商品点击
546
+ */
547
+ ProductClick = "ProductClick",
548
+ /**
549
+ * 商品下单
550
+ */
551
+ ProductBuy = "ProductBuy",
552
+ /**
553
+ * 用户签到
554
+ */
555
+ CheckIn = "CheckIn",
556
+ /**
557
+ * 打赏
558
+ */
559
+ Donate = "Donate"
560
+ }
561
+
562
+ /**
563
+ * 消息布局,紧凑布局和宽松布局
564
+ */
565
+ export declare type MessageLayout = 'compact' | 'loose';
566
+
567
+ /**
568
+ * 消息操作交互类型
569
+ */
570
+ declare type MsgControlInteraction = 'context-menu' | 'hover' | 'bubble' | 'action-sheet';
571
+
572
+ declare interface OnlineConfig {
573
+ /**
574
+ * 请求获取的在线列表数量
575
+ * @default 200
576
+ */
577
+ requestCount?: number;
578
+ }
579
+
580
+ export declare const OnlineList: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
581
+ "total-change": (arg: number) => void;
582
+ }, string, Readonly<ExtractPropTypes< {}>>, {}>;
583
+
584
+ declare function showInputPopup(): void;
585
+
586
+ export declare const TopingMsgList: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, Readonly<ExtractPropTypes< {}>>, {}>;
587
+
588
+ export declare const useChatGlobalProvide: (injectData: ChatGlobalInject) => void;
589
+
590
+ export { }