@plaso-infi/whiteboard-sdk 0.0.13 → 0.1.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.
@@ -1,6 +1,40 @@
1
1
  type DocumentType = 'ppt' | 'pdf' | 'excel' | 'word';
2
2
  type FileType = 'image' | 'document' | 'video' | 'audio';
3
3
 
4
+ type WebsdkEngineType = {
5
+ customFoldableTools?: SdkPluginSlotType[];
6
+ };
7
+ /** 在使用画布插件提供给外部的插件 UI 容器,如果需要插件在画布右上方出现功能入口,可以参考本类型声明来书写你的插件代码 */
8
+ type SdkPluginSlotType = {
9
+ /** 画布 svg 通用使用规范名称 */
10
+ icon: string;
11
+ /** 插件名称,会给予 hover tooltip 展示字段名 */
12
+ name: string;
13
+ /** 插件 key,需要保证唯一 */
14
+ key: string;
15
+ /**
16
+ * 可以基于画布自带的 popup 面板进行插件内容的承载;在给入这个配置组件后,
17
+ * 在画布点击插件入口时,会自动弹出 popup 来承载这个配置组件
18
+ */
19
+ SubWinContent?: React.FC<{
20
+ closeSubWin: CB;
21
+ } & any>;
22
+ };
23
+ interface InfiSdkPluginType {
24
+ pluginId: string;
25
+ /** 插件初始化逻辑,可以选择在这里加载 SdkPluginSlotType 来在画布右上角显示你的插件 */
26
+ init(): void;
27
+ /** 插件销毁逻辑,该方法在画布销毁时会被自动执行 */
28
+ destroy(): void;
29
+ }
30
+ interface ISdkPluginConstructor {
31
+ new (websdkEngine: WebsdkEngineType): InfiSdkPluginType;
32
+ }
33
+ type InfiWebSdkPlugin = {
34
+ pluginConstructor: ISdkPluginConstructor;
35
+ beforeInit?: (plugin: InfiSdkPluginType) => void;
36
+ };
37
+
4
38
  type Viewbox = {
5
39
  left: number;
6
40
  top: number;
@@ -189,11 +223,12 @@ interface GetSdkInstanceConfigs {
189
223
  };
190
224
  customizeUploaders?: CustomizeUploader;
191
225
  /**
192
- * 各项功能开关
193
- *
226
+ * 画布内各项功能开关:可以显示/隐藏部分功能的 UI 入口
194
227
  * - toolbarConfig:用于配置左侧工具栏中显示的工具,不配置时显示默认工具
195
228
  */
196
229
  toolbarWidgetsConfigs?: ToolBarWidgetsConfigsT;
230
+ /** 向画布内注入拆件能力,插件可以在画布内部显示, */
231
+ plugins?: InfiWebSdkPlugin[];
197
232
  }
198
233
  type CustomizeUploader = {
199
234
  loaders: {
@@ -246,4 +281,4 @@ declare function getDocumentType(ext: string): DocumentType | undefined;
246
281
 
247
282
  declare const FULL_TOOLBAR_CONFIG: Record<ToolBarType, boolean>;
248
283
 
249
- export { type CustomizeUploader, FULL_TOOLBAR_CONFIG, type GetSdkInstanceConfigs, type InfiWebsdkInstanceType, type ToolBarType, InfiWebsdk as default, getDocumentType, getFileType };
284
+ export { type CustomizeUploader, FULL_TOOLBAR_CONFIG, type GetSdkInstanceConfigs, type InfiSdkPluginType, type InfiWebSdkPlugin, type InfiWebsdkInstanceType, type SdkPluginSlotType, 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-3cce7b93.js");exports.FULL_TOOLBAR_CONFIG=e.FULL_TOOLBAR_CONFIG,exports.default=e.InfiWebsdk,exports.getDocumentType=e.getDocumentType,exports.getFileType=e.getFileType;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./index-ae933cc5.js");require("react"),require("react-dom"),exports.FULL_TOOLBAR_CONFIG=e.FULL_TOOLBAR_CONFIG,exports.default=e.InfiWebsdk,exports.getDocumentType=e.getDocumentType,exports.getFileType=e.getFileType;