@plaso-infi/whiteboard-sdk 0.1.8 → 0.2.0
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-3588278e-1e3a5503.js +1 -0
- package/dist/cjs/index-302250cc-ecade100.js +1 -0
- package/dist/cjs/index-f96b4a50.js +80 -0
- package/dist/cjs/index.css +2475 -1286
- package/dist/cjs/index.d.ts +110 -9
- package/dist/cjs/index.js +1 -1
- package/dist/esm/icon_map-3588278e-28a10ae2.js +1 -0
- package/dist/esm/index-302250cc-ed69f579.js +1 -0
- package/dist/esm/index-ae9c8b77.js +80 -0
- package/dist/esm/index.css +2475 -1286
- package/dist/esm/index.d.ts +110 -9
- package/dist/esm/index.js +1 -1
- package/dist/worker/decoder.worker.js +1 -0
- package/package.json +80 -81
- package/dist/cjs/AgoraRTC_N-production-8fab1a06.js +0 -2
- package/dist/cjs/index-1d264621.js +0 -89
- package/dist/cjs/index-2bd0357d-a5de2a3d.js +0 -1
- package/dist/esm/AgoraRTC_N-production-f20a13c3.js +0 -2
- package/dist/esm/index-2bd0357d-49ebae15.js +0 -1
- package/dist/esm/index-714d8d98.js +0 -89
- package/dist/worker/gif.worker.js +0 -15
- /package/dist/cjs/{hls-cfb0bbec-abad5f20.js → hls-e0a51e69-76de2844.js} +0 -0
- /package/dist/cjs/{pdf_lib-64ad77bb-e7be60df.js → pdf_lib-24f922b4-8eba27c5.js} +0 -0
- /package/dist/esm/{hls-cfb0bbec-7b22a1d3.js → hls-e0a51e69-5ec32c80.js} +0 -0
- /package/dist/esm/{pdf_lib-64ad77bb-df93a3f6.js → pdf_lib-24f922b4-448200f8.js} +0 -0
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,11 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import React$1 from 'react';
|
|
1
|
+
import React$1, { FC, CSSProperties } from 'react';
|
|
3
2
|
|
|
4
3
|
type DocumentType = 'ppt' | 'pdf' | 'excel' | 'word';
|
|
5
4
|
type FileType = 'image' | 'document' | 'video' | 'audio';
|
|
6
5
|
|
|
7
6
|
type WebsdkEngineType = {
|
|
8
7
|
customFoldableTools?: SdkPluginSlotType[];
|
|
8
|
+
customBottomRightTools?: SdkBottomRightPluginSlotType[];
|
|
9
|
+
};
|
|
10
|
+
type ComponentProps = {
|
|
11
|
+
iconClassName?: string;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* 提供给外部放置右下方自定义工具的插件,可参考该声明书写你的代码
|
|
15
|
+
*/
|
|
16
|
+
type SdkBottomRightPluginSlotType = {
|
|
17
|
+
/** 插件 key,需要保证唯一 */
|
|
18
|
+
key: string;
|
|
19
|
+
/** 插件名称,会给予 hover tooltip 展示字段名,不存在则不展示 */
|
|
20
|
+
name?: string;
|
|
21
|
+
/** 图标,可以是自定义组件也可以是画布提供的 svg */
|
|
22
|
+
icon: string | FC<ComponentProps>;
|
|
23
|
+
/** 点击行为 */
|
|
24
|
+
onClick?: CB;
|
|
25
|
+
/** 类名 */
|
|
26
|
+
className?: string;
|
|
27
|
+
/** 样式 */
|
|
28
|
+
style?: CSSProperties;
|
|
9
29
|
};
|
|
10
30
|
/** 在使用画布插件提供给外部的插件 UI 容器,如果需要插件在画布右上方出现功能入口,可以参考本类型声明来书写你的插件代码 */
|
|
11
31
|
type SdkPluginSlotType = {
|
|
@@ -38,6 +58,16 @@ type InfiWebSdkPlugin = {
|
|
|
38
58
|
beforeInit?: (plugin: InfiSdkPluginType) => void;
|
|
39
59
|
};
|
|
40
60
|
|
|
61
|
+
declare enum GridType {
|
|
62
|
+
NONE = 0,
|
|
63
|
+
LINE = 1,
|
|
64
|
+
DOT = 2
|
|
65
|
+
}
|
|
66
|
+
type PreDownloadInfo = any;
|
|
67
|
+
type DownloadConfigT = {
|
|
68
|
+
enable: boolean;
|
|
69
|
+
preCheck?: (event: string) => Promise<PreDownloadInfo>;
|
|
70
|
+
};
|
|
41
71
|
type Viewbox = {
|
|
42
72
|
left: number;
|
|
43
73
|
top: number;
|
|
@@ -53,8 +83,6 @@ type ViewRect = {
|
|
|
53
83
|
};
|
|
54
84
|
/** websdk 实例类型声明接口 */
|
|
55
85
|
interface InfiWebsdkInstanceType {
|
|
56
|
-
/** 白板背景类型 */
|
|
57
|
-
gridType: GridType;
|
|
58
86
|
/**
|
|
59
87
|
* 设置是否可以编辑
|
|
60
88
|
* @param couldEdit true: 可编辑; false: 只读
|
|
@@ -102,7 +130,7 @@ interface InfiWebsdkInstanceType {
|
|
|
102
130
|
*/
|
|
103
131
|
insertAudio: (url: string, name: string) => void;
|
|
104
132
|
/** 获取当前白板的画布视野信息 */
|
|
105
|
-
getCurrentViewData: () => Viewbox;
|
|
133
|
+
getCurrentViewData: () => Viewbox | undefined;
|
|
106
134
|
/**
|
|
107
135
|
* 启用/关闭演讲者模式
|
|
108
136
|
* @param en 启用/关闭
|
|
@@ -147,7 +175,7 @@ interface InfiWebsdkInstanceType {
|
|
|
147
175
|
*/
|
|
148
176
|
requestShadowUserViewData(loginName: string): Promise<ShadowViewDataT | null>;
|
|
149
177
|
/** 销毁白板 sdk 实例 */
|
|
150
|
-
destroy: () => void
|
|
178
|
+
destroy: () => Promise<void>;
|
|
151
179
|
}
|
|
152
180
|
type ShadowViewDataT = {
|
|
153
181
|
viewData?: [number, number, number, number];
|
|
@@ -169,8 +197,6 @@ type WebsdkEventTypeMap = {
|
|
|
169
197
|
resource_ready: void;
|
|
170
198
|
/** 演讲模式状态更新 */
|
|
171
199
|
presentation_change: boolean;
|
|
172
|
-
/** 白板背景更新 */
|
|
173
|
-
grid_type_change: GridType;
|
|
174
200
|
};
|
|
175
201
|
/** 当前白板的用户信息 */
|
|
176
202
|
interface UserInfoT {
|
|
@@ -205,6 +231,8 @@ type ToolBarWidgetsConfigsT = Partial<FullToolBarWidgetsConfigs>;
|
|
|
205
231
|
interface GetSdkInstanceConfigs {
|
|
206
232
|
/** 获取画布连接参数的请求函数,画布连接参数为初始化 & 链接服务器使用的加密字符串, 内含应用、白板、用户等信息 */
|
|
207
233
|
getQueryString: () => Promise<string>;
|
|
234
|
+
/** 获取AI 鉴权所必要参数 boardId, userId, appid, ts, sign, key */
|
|
235
|
+
getAiCheckInfo?: () => Promise<AiCheckInfo>;
|
|
208
236
|
/**
|
|
209
237
|
* 启用画布影子链接能力,影子链接会额外建立一条链接,用以将其他 recordId 对应画布内的内容同步到当前的画布中
|
|
210
238
|
* 但需要注意的是,通过影子链接同步过来的元素全部都都处于静止状态,无法选中,无法编辑,但是可以进行文档翻页等
|
|
@@ -217,6 +245,8 @@ interface GetSdkInstanceConfigs {
|
|
|
217
245
|
containerDom: HTMLDivElement;
|
|
218
246
|
/** 基于 loginName 获取该用户的用户名与头像 url 的方法,由用户提供,方法返回的用户信息用以于白板内作展示 */
|
|
219
247
|
getUsersInfo: (loginNames: string[]) => Promise<UserInfoT[]>;
|
|
248
|
+
/** 是否应用上一次用户偏好(背景设置、工具栏顺序、视野、颜料色板) */
|
|
249
|
+
preferenceConfigs?: object;
|
|
220
250
|
/** 画布天然提供若干 UI 插槽,分别位于画布页面的左上角与右上角,目前仅支持基于 React 实现 */
|
|
221
251
|
uiSlots?: {
|
|
222
252
|
/**
|
|
@@ -250,6 +280,10 @@ interface GetSdkInstanceConfigs {
|
|
|
250
280
|
* - toolbarConfig:用于配置左侧工具栏中显示的工具,不配置时显示默认工具
|
|
251
281
|
*/
|
|
252
282
|
toolbarWidgetsConfigs?: ToolBarWidgetsConfigsT;
|
|
283
|
+
/**
|
|
284
|
+
* 文件下载配置,enable表示文件下载功能是否开启,preCheck用于获取自定义的文件下载签名
|
|
285
|
+
*/
|
|
286
|
+
downloadConfig?: DownloadConfigT;
|
|
253
287
|
/** 向画布内注入拆件能力,插件可以在画布内部显示, */
|
|
254
288
|
plugins?: InfiWebSdkPlugin[];
|
|
255
289
|
/**
|
|
@@ -291,6 +325,44 @@ interface InfiWebSdkType {
|
|
|
291
325
|
getSdkInstance: (configs: GetSdkInstanceConfigs) => GetSdkInstanceReturnType;
|
|
292
326
|
readonly version: string;
|
|
293
327
|
}
|
|
328
|
+
interface AiCheckInfo {
|
|
329
|
+
/** AI操作次数 */
|
|
330
|
+
inPackageRemain: number;
|
|
331
|
+
/** 其他来源AI操作次数,比如团队购买次数 */
|
|
332
|
+
outPackageRemain: number;
|
|
333
|
+
/** 鉴权信息,boardId,userId,appid,ts,sign,key,modal?,event? */
|
|
334
|
+
extraInfo: AiCheckExtraInfo | {
|
|
335
|
+
[x: string]: unknown;
|
|
336
|
+
};
|
|
337
|
+
}
|
|
338
|
+
type AiCheckExtraInfo = {
|
|
339
|
+
/**
|
|
340
|
+
* 应用 ID,可于开发者门户/应用管理中查看 appId。使用白板 sdk 的必要参数之一。如若错误则不能使用白板
|
|
341
|
+
*
|
|
342
|
+
* **注:**
|
|
343
|
+
* 此信息为敏感信息,请尽量不要写在前端项目中
|
|
344
|
+
*/
|
|
345
|
+
appId: string;
|
|
346
|
+
/** 登入的用户 ID,同一 userId,画布侧会视为同一个用户 */
|
|
347
|
+
userId: string;
|
|
348
|
+
/** 白板 ID,用于唯一标识画布 */
|
|
349
|
+
boardId: string;
|
|
350
|
+
/** 当前时间戳。*/
|
|
351
|
+
ts: number;
|
|
352
|
+
/** 16 位 uuid,用于标识本次操作 */
|
|
353
|
+
key: string;
|
|
354
|
+
/**
|
|
355
|
+
* 通过加密算法加密的 AI 鉴权所需参数
|
|
356
|
+
*
|
|
357
|
+
* **注:**
|
|
358
|
+
* 请尽量让服务端生成该参数,在前端代码中生成该参数相当于直接暴露了加密算法
|
|
359
|
+
**/
|
|
360
|
+
sign: string;
|
|
361
|
+
/** 事件类型,AI 鉴权场景就是默认值 'ai' */
|
|
362
|
+
event: string;
|
|
363
|
+
/** 大数据模型,当前默认值 wenxin' */
|
|
364
|
+
model: string;
|
|
365
|
+
};
|
|
294
366
|
|
|
295
367
|
declare const InfiWebsdk: InfiWebSdkType;
|
|
296
368
|
|
|
@@ -321,10 +393,33 @@ type PropT = {
|
|
|
321
393
|
};
|
|
322
394
|
declare const SvgIcon: React$1.FC<PropT>;
|
|
323
395
|
|
|
396
|
+
type HoverTipPropsT = {
|
|
397
|
+
content: string;
|
|
398
|
+
placement?: 'top' | 'left' | 'bottom' | 'right' | 'leftBottom';
|
|
399
|
+
/** hoverTip 的样式数据 */
|
|
400
|
+
className?: string;
|
|
401
|
+
rootClass?: string;
|
|
402
|
+
/** 是否允许显示,默认为 true */
|
|
403
|
+
allowShow?: boolean;
|
|
404
|
+
customStyle?: CSSProperties;
|
|
405
|
+
tipContainerStyle?: CSSProperties;
|
|
406
|
+
children: React$1.ReactNode;
|
|
407
|
+
};
|
|
408
|
+
type HoverTipRefT = {
|
|
409
|
+
rootRef: HTMLDivElement | null;
|
|
410
|
+
};
|
|
411
|
+
/** 注意:仅在pc端使用 */
|
|
412
|
+
declare const HoverTip: React$1.ForwardRefExoticComponent<HoverTipPropsT & React$1.RefAttributes<HoverTipRefT>>;
|
|
413
|
+
|
|
324
414
|
interface Icon {
|
|
325
415
|
[key: string]: string;
|
|
326
416
|
}
|
|
327
417
|
declare class SvgManager {
|
|
418
|
+
/**
|
|
419
|
+
* 一般用于在项目初始化的时候统一加载资源,功能跟 add 方法一样
|
|
420
|
+
* 存在的意义是增加语义化
|
|
421
|
+
* @param icons svg 的id和内容的map
|
|
422
|
+
*/
|
|
328
423
|
static load(icons: Icon): void;
|
|
329
424
|
/**
|
|
330
425
|
* 批量添加svg资源,如果在当前 svgContainer 发现 id 相等的<symbol>内容会被替换
|
|
@@ -340,6 +435,11 @@ declare class SvgManager {
|
|
|
340
435
|
* @returns undefined
|
|
341
436
|
*/
|
|
342
437
|
static replace(icons: Icon, svgContainer?: SVGElement): void;
|
|
438
|
+
/**
|
|
439
|
+
* 生成 symbol map
|
|
440
|
+
* @param icons icons svg 的id和内容的map
|
|
441
|
+
* @returns Icon
|
|
442
|
+
*/
|
|
343
443
|
static createSymbolMap(icons: {
|
|
344
444
|
[type: string]: string;
|
|
345
445
|
}): {};
|
|
@@ -347,6 +447,7 @@ declare class SvgManager {
|
|
|
347
447
|
private static _createSvgContainer;
|
|
348
448
|
private static _createDomByHtmlString;
|
|
349
449
|
private static _findBodySvgContainer;
|
|
450
|
+
private static _isSymbol;
|
|
350
451
|
}
|
|
351
452
|
|
|
352
|
-
export { type CustomizeUploader, FULL_TOOLBAR_CONFIG, type GetSdkInstanceConfigs, type InfiSdkPluginType, type InfiWebSdkPlugin, type InfiWebsdkInstanceType, type SdkPluginSlotType, Setting, SvgIcon, SvgManager, type ToolBarType, type WebsdkEngineType, InfiWebsdk as default, getDocumentType, getFileType };
|
|
453
|
+
export { type ComponentProps, type CustomizeUploader, FULL_TOOLBAR_CONFIG, type GetSdkInstanceConfigs, HoverTip, type InfiSdkPluginType, type InfiWebSdkPlugin, type InfiWebsdkInstanceType, type SdkBottomRightPluginSlotType, type SdkPluginSlotType, Setting, SvgIcon, SvgManager, type ToolBarType, 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-f96b4a50.js");require("react"),require("react-dom"),require("agora-rtc-sdk-ng"),exports.FULL_TOOLBAR_CONFIG=e.FULL_TOOLBAR_CONFIG,exports.HoverTip=e.HoverTip,exports.Setting=e.Setting,exports.SvgIcon=e.SvgIcon,exports.SvgManager=e.SvgManager,exports.default=e.InfiWebsdk,exports.getDocumentType=e.getDocumentType,exports.getFileType=e.getFileType;
|