@plaso-infi/whiteboard-sdk 0.2.2 → 0.2.4

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.
@@ -123,6 +123,7 @@ type ToolBarWidgetsConfigsT = Partial<FullToolBarWidgetsConfigs>;
123
123
  interface GetSdkInstanceConfigs {
124
124
  /** 当前白板的用户信息 */
125
125
  userInfo: InfiUserInfoT;
126
+ editable?: boolean;
126
127
  /** 用以挂载白板 DOM 的 HTML DOM 元素, 白板相关元素会自动 appendChild 至这个元素之内 */
127
128
  containerDom: HTMLDivElement;
128
129
  /** 是否应用上一次用户偏好(背景设置、工具栏顺序、视野、颜料色板) */
@@ -166,6 +167,13 @@ interface GetSdkInstanceConfigs {
166
167
  * 文件下载配置,enable表示文件下载功能是否开启,preCheck用于获取自定义的文件下载签名
167
168
  */
168
169
  downloadConfig?: DownloadConfigT;
170
+ /**
171
+ * 文件上传配置
172
+ */
173
+ uploadConfig?: {
174
+ /** 是否启用动态ppt */
175
+ enableDynamicPPT?: boolean;
176
+ };
169
177
  /** 向画布内注入拆件能力,插件可以在画布内部显示, */
170
178
  plugins?: InfiWebSdkPlugin[];
171
179
  /**
@@ -173,8 +181,11 @@ interface GetSdkInstanceConfigs {
173
181
  * 尚提供可以切换不同的画布侧环境的配置项入口。后期会移除该配置项,websdk 仅能使用线上环境
174
182
  */
175
183
  env?: 'prod' | 'dev' | 'test';
184
+ getElementLink?: (encodeId: string, id: string) => string;
185
+ /** 链接跳转,返回值为string表示跳转元素id */
186
+ gotoLink?: (link: string) => string | undefined;
176
187
  /**
177
- * 路由配置,包括设置路由history的类型(默认为browser)、标识画布唯一性的search字段(默认为所有search字段)等
188
+ * 路由配置,包括设置路由history的类型(默认为browser)、标识画布唯一性的search联合字段(默认为所有search字段)等
178
189
  */
179
190
  routeConfig?: RouteConfigT;
180
191
  /** 获取画布连接参数的请求函数,画布连接参数为初始化 & 链接服务器使用的加密字符串, 内含应用、白板、用户等信息 */
@@ -189,9 +200,6 @@ interface GetSdkInstanceConfigs {
189
200
  getShadowBoardQuery?: () => Promise<string>;
190
201
  /** 基于 loginName 获取该用户的用户名与头像 url 的方法,由用户提供,方法返回的用户信息用以于白板内作展示 */
191
202
  getUsersInfo: (loginNames: string[]) => Promise<InfiUserInfoT[]>;
192
- getElementLink?: (id: string) => string;
193
- /** 链接跳转,返回值为string表示跳转元素id */
194
- gotoLink?: (link: string) => string | undefined;
195
203
  }
196
204
  type CustomizeUploader = {
197
205
  loaders: {
@@ -269,6 +277,19 @@ type ElementMetaData = {
269
277
  };
270
278
  scale: number;
271
279
  };
280
+ type InsertImageType = {
281
+ /** 图片文件 */
282
+ file: File;
283
+ /** 屏幕位置 */
284
+ screenPosition?: PositionLike;
285
+ /** 文件大小 */
286
+ size?: {
287
+ width: number;
288
+ height: number;
289
+ };
290
+ /** 是否根据画布比例自动缩放 */
291
+ autoSize?: boolean;
292
+ };
272
293
  /** websdk 实例类型声明接口 */
273
294
  interface InfiWebsdkInstanceType {
274
295
  /**
@@ -297,7 +318,13 @@ interface InfiWebsdkInstanceType {
297
318
  * @param url 图片文件url地址
298
319
  * @param name 图片文件名称
299
320
  */
300
- insertImage: (url: string, name: string) => void;
321
+ insertImage(url: string, name: string): void;
322
+ /**
323
+ * 向白板中插入图片文件
324
+ * @param imageInfo 图片文件信息
325
+ * @return 插入成功后返回元素id
326
+ */
327
+ insertImage(imageInfo: InsertImageType): Promise<string | null | undefined>;
301
328
  /**
302
329
  * 向白板中插入文档,支持ppt、pdf、excel、word类型
303
330
  * @param url 文档文件url地址
package/dist/esm/index.js CHANGED
@@ -1 +1 @@
1
- export{F as FULL_TOOLBAR_CONFIG,G as GridType,H as HoverTip,b as Setting,c as SvgIcon,d as SvgManager,I as default,a as getDocumentType,g as getFileType}from"./index-04d33d88.js";import"react";import"react-dom";import"agora-rtc-sdk-ng";
1
+ export{F as FULL_TOOLBAR_CONFIG,G as GridType,H as HoverTip,S as Setting,b as SvgIcon,c as SvgManager,I as default,a as getDocumentType,g as getFileType}from"./index-b3b6111a.js";import"react";import"react-dom";import"agora-rtc-sdk-ng";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plaso-infi/whiteboard-sdk",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -56,9 +56,10 @@
56
56
  "vite-plugin-external": "^4.0.1"
57
57
  },
58
58
  "dependencies": {
59
- "@plasosdk/upime-sdk": "4.6.11",
59
+ "@plasosdk/upime-sdk": "4.6.16",
60
60
  "crypto-js": "^4.1.1",
61
- "hls.js": "^1.4.12"
61
+ "hls.js": "^1.4.12",
62
+ "base-64": "^1.0.0"
62
63
  },
63
64
  "peerDependencies": {
64
65
  "ali-oss": "^6.17.1",