@plaso-infi/whiteboard-sdk 0.3.6 → 0.3.7
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/dist/cjs/icon_map-9087bb65-6921ebb1.js +1 -0
- package/dist/cjs/index-00a77edf.js +73 -0
- package/dist/cjs/index-71d065be-5a1a94e1.js +1 -0
- package/dist/cjs/index.css +9605 -5915
- package/dist/cjs/index.d.ts +151 -9
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/{pdf_lib-d16d4772-d1ffe69d.js → pdf_lib-34b34de5-c5a10efc.js} +1 -1
- package/dist/esm/icon_map-9087bb65-ae7f7233.js +1 -0
- package/dist/esm/index-19157454.js +73 -0
- package/dist/esm/index-71d065be-097dbe57.js +1 -0
- package/dist/esm/index.css +9605 -5915
- package/dist/esm/index.d.ts +151 -9
- package/dist/esm/index.js +1 -1
- package/dist/esm/{pdf_lib-d16d4772-013af186.js → pdf_lib-34b34de5-ae40f469.js} +1 -1
- package/package.json +82 -82
- package/dist/cjs/icon_map-d4f70006-f419f217.js +0 -1
- package/dist/cjs/index-6cfde135-10c103e1.js +0 -1
- package/dist/cjs/index-beeb77d9.js +0 -73
- package/dist/esm/icon_map-d4f70006-b891d201.js +0 -1
- package/dist/esm/index-089e91a9.js +0 -73
- package/dist/esm/index-6cfde135-3cdae581.js +0 -1
- /package/dist/cjs/{hls-81040335-e754d7a1.js → hls-1b43194c-5300d181.js} +0 -0
- /package/dist/esm/{hls-81040335-528656c3.js → hls-1b43194c-9ef50c83.js} +0 -0
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import React$1
|
|
1
|
+
import * as React$1 from 'react';
|
|
2
|
+
import React__default, { FC, CSSProperties } from 'react';
|
|
2
3
|
|
|
3
4
|
type PositionLike = {
|
|
4
5
|
x: number;
|
|
@@ -19,6 +20,13 @@ type ViewRect = {
|
|
|
19
20
|
};
|
|
20
21
|
type BorderBox = Omit<Viewbox, 'scale'>;
|
|
21
22
|
|
|
23
|
+
type eventHandler<E> = (evt: E) => void;
|
|
24
|
+
interface EventManagerT<ET = any> {
|
|
25
|
+
subscribe<T extends keyof ET>(topic: T, cb: eventHandler<ET[T]>): CB;
|
|
26
|
+
once<T extends keyof ET>(topic: T, cb: eventHandler<ET[T]>): CB;
|
|
27
|
+
publish<T extends keyof ET>(topic: T, evt: ET[T]): void;
|
|
28
|
+
}
|
|
29
|
+
|
|
22
30
|
type DocumentType = 'ppt' | 'pdf' | 'excel' | 'word';
|
|
23
31
|
type FileType = 'image' | 'document' | 'video' | 'audio';
|
|
24
32
|
|
|
@@ -121,6 +129,17 @@ type RouteConfigT = {
|
|
|
121
129
|
boardCompositeKey?: string[];
|
|
122
130
|
};
|
|
123
131
|
type ToolBarWidgetsConfigsT = Partial<FullToolBarWidgetsConfigs>;
|
|
132
|
+
type CanUploadInfo = {
|
|
133
|
+
canUpload: boolean;
|
|
134
|
+
reason?: string;
|
|
135
|
+
};
|
|
136
|
+
declare enum UploadFailedCode {
|
|
137
|
+
EXCEEDS_STORAGE_LIMIT = 1
|
|
138
|
+
}
|
|
139
|
+
type UploadRejectInfo = {
|
|
140
|
+
code: UploadFailedCode;
|
|
141
|
+
message?: string;
|
|
142
|
+
};
|
|
124
143
|
/** 获取白板 websdk 实例的配置参数 */
|
|
125
144
|
interface GetSdkInstanceConfigs {
|
|
126
145
|
/** 当前白板的用户信息 */
|
|
@@ -136,7 +155,7 @@ interface GetSdkInstanceConfigs {
|
|
|
136
155
|
* 画布左上角的标题栏插槽,React 组件 maxHeight 为 48px; 与画布自带的搜索、下载等 UI 毗邻
|
|
137
156
|
* 通常可以用于展示 logo 或呈现 “返回” 按键等。
|
|
138
157
|
*/
|
|
139
|
-
titleSlot?: React.ReactNode;
|
|
158
|
+
titleSlot?: (w?: number, cb?: (w: number) => void) => React.ReactNode;
|
|
140
159
|
/**
|
|
141
160
|
* 画布右上角的 UI 插槽,React 组件 maxHeight 为 48px; 与画布自身的在线成员展示等 UI 毗邻
|
|
142
161
|
*/
|
|
@@ -152,6 +171,30 @@ interface GetSdkInstanceConfigs {
|
|
|
152
171
|
laserMode?: boolean;
|
|
153
172
|
/** 默认的画布网格设置,会被用户自己的使用习惯数据覆盖 */
|
|
154
173
|
defaultGrid?: GridType;
|
|
174
|
+
/**
|
|
175
|
+
* 画布内默认画笔偏好,包括颜色、粗细、不透明度等
|
|
176
|
+
* @param lineColor 画布颜色,Hex 数值,e.g. 0xff0000
|
|
177
|
+
* @param lineWidth 画笔粗细 [0, 30] 之间
|
|
178
|
+
* @param lineOpacity 马克笔不透明度 [0.1, 1]
|
|
179
|
+
* 注:
|
|
180
|
+
* - 请确保设置的颜色是画布默认颜色,包括:0xffffff, 0xfef445, 0xfac710, 0xf24726, 0xe6e6e6, 0xcee741, 0x8fd14f, 0xda0063,
|
|
181
|
+
* 0x808080, 0x12cdd4, 0x0ca789, 0x9510ac, 0x1a1a1a, 0x2d9bf0, 0x414bb2, 0x652cb3
|
|
182
|
+
* - pen 及 mark 的默认配置数组长度应 <= 3。
|
|
183
|
+
* - 手机或大屏模式下,仅第一个配置有效。
|
|
184
|
+
*
|
|
185
|
+
* **TODO: 后续会增加配置项以控制:默认画笔样式是否会被 websdk 用户自己的画笔使用行为记录覆盖**
|
|
186
|
+
**/
|
|
187
|
+
defaultDrawStyles?: {
|
|
188
|
+
pen?: {
|
|
189
|
+
lineColor?: number;
|
|
190
|
+
lineWidth?: number;
|
|
191
|
+
}[];
|
|
192
|
+
mark?: {
|
|
193
|
+
lineColor?: number;
|
|
194
|
+
lineWidth?: number;
|
|
195
|
+
lineOpacity?: number;
|
|
196
|
+
}[];
|
|
197
|
+
};
|
|
155
198
|
};
|
|
156
199
|
/** 进入画布时,如果给入该值,则会向 x:0, y:0 处插入模板内容,并尝试移动视野至该位置 */
|
|
157
200
|
initTemplate?: string | {
|
|
@@ -194,6 +237,7 @@ interface GetSdkInstanceConfigs {
|
|
|
194
237
|
* - normal: 常规模式,PC、Laptop、PAD 上推荐使用本模式
|
|
195
238
|
*/
|
|
196
239
|
displayMode?: 'bigScreen' | 'normal' | 'phone';
|
|
240
|
+
meetingConfigs: MeetingConfigs;
|
|
197
241
|
getElementLink?: (encodeId: string, id: string) => string;
|
|
198
242
|
/** 链接跳转,返回值为string表示跳转元素id */
|
|
199
243
|
gotoLink?: (link: string) => string | undefined;
|
|
@@ -209,6 +253,8 @@ interface GetSdkInstanceConfigs {
|
|
|
209
253
|
getShadowBoardQuery?: () => Promise<string>;
|
|
210
254
|
/** 基于 loginName 获取该用户的用户名与头像 url 的方法,由用户提供,方法返回的用户信息用以于白板内作展示 */
|
|
211
255
|
getUsersInfo: (loginNames: string[]) => Promise<InfiUserInfoT[]>;
|
|
256
|
+
/** 上传文件出错时的回调 */
|
|
257
|
+
onUploadFailed?: (info: UploadRejectInfo) => void;
|
|
212
258
|
}
|
|
213
259
|
type CustomizeUploader = {
|
|
214
260
|
loaders: {
|
|
@@ -276,6 +322,18 @@ declare enum GridType {
|
|
|
276
322
|
LINE = 1,
|
|
277
323
|
DOT = 2
|
|
278
324
|
}
|
|
325
|
+
type PreferencesType = Partial<{
|
|
326
|
+
gridType: GridType;
|
|
327
|
+
palette: number[];
|
|
328
|
+
toolBar: string[];
|
|
329
|
+
toolBox: string[];
|
|
330
|
+
view: {
|
|
331
|
+
x: number;
|
|
332
|
+
y: number;
|
|
333
|
+
height: number;
|
|
334
|
+
width: number;
|
|
335
|
+
};
|
|
336
|
+
}>;
|
|
279
337
|
type ElementMetaData = {
|
|
280
338
|
id: string;
|
|
281
339
|
elementType: number;
|
|
@@ -444,10 +502,28 @@ interface InfiWebsdkInstanceType {
|
|
|
444
502
|
useElementsInfo(info: any[], position: PositionLike): Promise<void>;
|
|
445
503
|
/** 销毁白板 sdk 实例 */
|
|
446
504
|
destroy: () => Promise<void>;
|
|
505
|
+
/** 开启快捷键 */
|
|
506
|
+
enableShortCut: () => void;
|
|
507
|
+
/** 关闭快捷键 */
|
|
508
|
+
disableShortCut: () => void;
|
|
447
509
|
}
|
|
448
510
|
type ShadowViewDataT = {
|
|
449
511
|
viewData?: [number, number, number, number];
|
|
450
512
|
};
|
|
513
|
+
interface InternalWebSdkInsT extends InfiWebsdkInstanceType {
|
|
514
|
+
init: () => Promise<void>;
|
|
515
|
+
routeConfig: RouteConfigT;
|
|
516
|
+
configs: GetSdkInstanceConfigs;
|
|
517
|
+
update: () => void;
|
|
518
|
+
anchorElement?: string;
|
|
519
|
+
evtBus: EventManagerT<InnerWebsdkEventTypeMap>;
|
|
520
|
+
getQueryString: () => Promise<string>;
|
|
521
|
+
preCreditCheck: () => Promise<AiCheckInfo>;
|
|
522
|
+
userPreference: PreferencesType;
|
|
523
|
+
setUserPreferences(userPreference: PreferencesType, needRefresh?: boolean): Promise<void>;
|
|
524
|
+
/** 上传文件前回调函数 */
|
|
525
|
+
beforeUpload?: () => Promise<boolean>;
|
|
526
|
+
}
|
|
451
527
|
type WebsdkEventTypeMap = {
|
|
452
528
|
/** 白板未完成初始化 */
|
|
453
529
|
not_initialized: void;
|
|
@@ -471,6 +547,10 @@ type WebsdkEventTypeMap = {
|
|
|
471
547
|
connectId: string;
|
|
472
548
|
};
|
|
473
549
|
};
|
|
550
|
+
type InnerWebsdkEventTypeMap = {
|
|
551
|
+
/** sdk dom状态更新 */
|
|
552
|
+
update_state: undefined;
|
|
553
|
+
} & WebsdkEventTypeMap;
|
|
474
554
|
/** Infi 白板 websdk 全局对象,引入 min.js 后即会挂载至 window 对象上 */
|
|
475
555
|
interface InfiWebSdkType {
|
|
476
556
|
/**
|
|
@@ -481,10 +561,72 @@ interface InfiWebSdkType {
|
|
|
481
561
|
*/
|
|
482
562
|
getSdkInstance: (configs: GetSdkInstanceConfigs) => GetSdkInstanceReturnType;
|
|
483
563
|
readonly version: string;
|
|
484
|
-
}
|
|
564
|
+
}
|
|
565
|
+
type MeetingId = string;
|
|
566
|
+
type MeetingJoinerId = string;
|
|
567
|
+
declare enum MeetingStatus {
|
|
568
|
+
/** 待开始 */
|
|
569
|
+
PENDING = 0,
|
|
570
|
+
/** 已开始 */
|
|
571
|
+
ON_GOING = 1,
|
|
572
|
+
/** 已结束 */
|
|
573
|
+
ENDED = 2,
|
|
574
|
+
/** 已取消 */
|
|
575
|
+
CANCELED = 3
|
|
576
|
+
}
|
|
577
|
+
declare enum DefaultForceFollow {
|
|
578
|
+
No = 0,
|
|
579
|
+
Yes = 1
|
|
580
|
+
}
|
|
581
|
+
declare enum DefaultPerm {
|
|
582
|
+
SameWithSdk = 0,
|
|
583
|
+
Edit = 1,
|
|
584
|
+
Comment = 2,
|
|
585
|
+
View = 3
|
|
586
|
+
}
|
|
587
|
+
/** 静态会议 interface */
|
|
588
|
+
interface StaticMeetingData {
|
|
589
|
+
id: MeetingId;
|
|
590
|
+
title: string;
|
|
591
|
+
host: string;
|
|
592
|
+
planJoiners: MeetingJoinerId[];
|
|
593
|
+
planStart: number;
|
|
594
|
+
planEnd: number;
|
|
595
|
+
status?: MeetingStatus;
|
|
596
|
+
joined?: boolean;
|
|
597
|
+
coHosts: string[];
|
|
598
|
+
openAhead: number;
|
|
599
|
+
defaultForceFollow: DefaultForceFollow;
|
|
600
|
+
defaultPerm: DefaultPerm;
|
|
601
|
+
}
|
|
602
|
+
type EditMeetingCmpProp = {
|
|
603
|
+
data: StaticMeetingData | null;
|
|
604
|
+
onSubmit: (data: StaticMeetingData) => Promise<void>;
|
|
605
|
+
onFormChanged: (dirty: boolean) => void;
|
|
606
|
+
getCurServerTime: () => number;
|
|
607
|
+
};
|
|
608
|
+
type AddMemberCmpProp = {
|
|
609
|
+
curJoiners: string[];
|
|
610
|
+
onSubmit: (joiners: string[]) => void;
|
|
611
|
+
onCancel: () => void;
|
|
612
|
+
listAll: boolean;
|
|
613
|
+
getMeetingLink(): void;
|
|
614
|
+
};
|
|
615
|
+
type MeetingConfigs = {
|
|
616
|
+
/** 是否能在会议中查看成员列表,及是否可以直接添加参会人员 */
|
|
617
|
+
couldCheckMemberList?: boolean;
|
|
618
|
+
/** 是否可以发起会议 */
|
|
619
|
+
couldCreateMeeting?: boolean;
|
|
620
|
+
EditMeetingCmp?: FC<EditMeetingCmpProp>;
|
|
621
|
+
AddMemberCmp?: FC<AddMemberCmpProp>;
|
|
622
|
+
};
|
|
485
623
|
|
|
486
624
|
declare const InfiWebsdk: InfiWebSdkType;
|
|
487
625
|
|
|
626
|
+
declare const SDKContext: React$1.Context<{
|
|
627
|
+
websdkIns: InternalWebSdkInsT;
|
|
628
|
+
}>;
|
|
629
|
+
|
|
488
630
|
/**
|
|
489
631
|
* 根据文件后缀获取文件类型
|
|
490
632
|
* @param ext
|
|
@@ -500,19 +642,19 @@ declare function getDocumentType(ext: string): DocumentType | undefined;
|
|
|
500
642
|
|
|
501
643
|
declare const FULL_TOOLBAR_CONFIG: Record<ToolBarType, boolean>;
|
|
502
644
|
|
|
503
|
-
declare const Setting:
|
|
645
|
+
declare const Setting: React__default.FC<{
|
|
504
646
|
showHistory?: boolean;
|
|
505
647
|
}>;
|
|
506
648
|
|
|
507
649
|
type PropT = {
|
|
508
650
|
className?: string;
|
|
509
|
-
style?:
|
|
651
|
+
style?: React__default.CSSProperties;
|
|
510
652
|
title?: string;
|
|
511
653
|
icon: string;
|
|
512
654
|
onClick?: any;
|
|
513
655
|
[key: string]: any;
|
|
514
656
|
};
|
|
515
|
-
declare const SvgIcon:
|
|
657
|
+
declare const SvgIcon: React__default.FC<PropT>;
|
|
516
658
|
|
|
517
659
|
type HoverTipPropsT = {
|
|
518
660
|
content: string;
|
|
@@ -524,13 +666,13 @@ type HoverTipPropsT = {
|
|
|
524
666
|
allowShow?: boolean;
|
|
525
667
|
customStyle?: CSSProperties;
|
|
526
668
|
tipContainerStyle?: CSSProperties;
|
|
527
|
-
children:
|
|
669
|
+
children: React__default.ReactNode;
|
|
528
670
|
};
|
|
529
671
|
type HoverTipRefT = {
|
|
530
672
|
rootRef: HTMLDivElement | null;
|
|
531
673
|
};
|
|
532
674
|
/** 注意:仅在pc端使用 */
|
|
533
|
-
declare const HoverTip:
|
|
675
|
+
declare const HoverTip: React__default.ForwardRefExoticComponent<HoverTipPropsT & React__default.RefAttributes<HoverTipRefT>>;
|
|
534
676
|
|
|
535
677
|
interface Icon {
|
|
536
678
|
[key: string]: string;
|
|
@@ -574,4 +716,4 @@ declare class SvgManager {
|
|
|
574
716
|
/** 官方提供分组讨论插件,基于 websdk plugin 配置项引入后,会使得画布开启分组讨论功能 */
|
|
575
717
|
declare const GroupTalkPlugin: ISdkPluginConstructor;
|
|
576
718
|
|
|
577
|
-
export { type ComponentProps, type CustomizeUploader, FULL_TOOLBAR_CONFIG, type GetSdkInstanceConfigs, GridType, GroupTalkPlugin, HoverTip, type InfiSdkPluginType, type InfiUserInfoT, type InfiWebSdkPlugin, type InfiWebsdkInstanceType, type SdkBottomRightPluginSlotType, type SdkPluginSlotType, Setting, SvgIcon, SvgManager, type ToolBarType, type WebsdkEngineType, InfiWebsdk as default, getDocumentType, getFileType };
|
|
719
|
+
export { type AddMemberCmpProp, type CanUploadInfo, type ComponentProps, type CustomizeUploader, DefaultPerm, type EditMeetingCmpProp, FULL_TOOLBAR_CONFIG, type GetSdkInstanceConfigs, GridType, GroupTalkPlugin, HoverTip, type InfiSdkPluginType, type InfiUserInfoT, type InfiWebSdkPlugin, type InfiWebsdkInstanceType, type MeetingConfigs, SDKContext, type SdkBottomRightPluginSlotType, type SdkPluginSlotType, Setting, SvgIcon, SvgManager, type ToolBarType, type UploadRejectInfo, type WebsdkEngineType, InfiWebsdk as default, getDocumentType, getFileType };
|
package/dist/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./index-00a77edf.js");require("react"),require("react-dom"),require("agora-rtc-sdk-ng"),Object.defineProperty(exports,"DefaultPerm",{enumerable:!0,get:function(){return e.DefaultPerm}}),exports.FULL_TOOLBAR_CONFIG=e.FULL_TOOLBAR_CONFIG,Object.defineProperty(exports,"GridType",{enumerable:!0,get:function(){return e.GridType}}),exports.GroupTalkPlugin=e.GroupTalkPlugin,exports.HoverTip=e.HoverTip,exports.SDKContext=e.SDKContext,exports.Setting=e.Setting,exports.SvgIcon=e.SvgIcon,exports.SvgManager=e.SvgManager,exports.default=e.InfiWebsdk,exports.getDocumentType=e.getDocumentType,exports.getFileType=e.getFileType;
|