weboffice-js-sdk 2.0.3-beta.11 → 2.0.3-beta.12
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/README.md +12 -2
- package/dist/OfficeSDK.d.ts +17 -0
- package/dist/OfficeSDK.headerBars.d.ts +3 -0
- package/dist/index.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -29,8 +29,12 @@ connect({
|
|
|
29
29
|
signature: '用您的 app id 和 secret 签发的签名',
|
|
30
30
|
token: '用于您系统识别用户请求的 token',
|
|
31
31
|
container: document.querySelector('#shimo-file'), // iframe 挂载的目标容器元素
|
|
32
|
-
lang: 'en' // 未指定此参数时,使用浏览器默认语言
|
|
33
|
-
|
|
32
|
+
lang: 'en', // 未指定此参数时,使用浏览器默认语言
|
|
33
|
+
disableAiEntry: true, // 可选,隐藏 iframe 内 AI 入口
|
|
34
|
+
theme: {
|
|
35
|
+
name: 'light'
|
|
36
|
+
}, // 可选,透传给 iframe 内编辑器主题配置
|
|
37
|
+
userUuid:'您的uuid' // 仅在v2版本回调时需要传入(co-1.3+支持)
|
|
34
38
|
}).then((shimoSDK) => {
|
|
35
39
|
// ...
|
|
36
40
|
})
|
|
@@ -38,6 +42,11 @@ connect({
|
|
|
38
42
|
|
|
39
43
|
参数说明请参考 [docs/interfaces/connectoptions.md](docs/interfaces/ConnectOptions.md)。
|
|
40
44
|
|
|
45
|
+
其中:
|
|
46
|
+
|
|
47
|
+
- `disableAiEntry` 为可选布尔值,透传到 iframe 内 `ShimoSDK` 的 AI 入口开关能力。
|
|
48
|
+
- `theme` 为可选主题对象,宿主侧仅负责透传;未传时 iframe 内仍使用默认主题配置。
|
|
49
|
+
|
|
41
50
|
返回值:
|
|
42
51
|
|
|
43
52
|
```
|
|
@@ -145,6 +154,7 @@ const command = sdk.headerBars.getCommand('custom-export')
|
|
|
145
154
|
// 命令状态(属性读写)
|
|
146
155
|
command.visible = true
|
|
147
156
|
command.disabled = false
|
|
157
|
+
command.active = true
|
|
148
158
|
|
|
149
159
|
// 外层覆盖命令点击回调(优先于 iframe 默认回调)
|
|
150
160
|
command.onCommandClick = async () => {
|
package/dist/OfficeSDK.d.ts
CHANGED
|
@@ -463,6 +463,13 @@ export type EventCallback = (...args: any[]) => any;
|
|
|
463
463
|
export interface SDKToastOptions {
|
|
464
464
|
[key: string]: string | SDKToastOptions | undefined;
|
|
465
465
|
}
|
|
466
|
+
/**
|
|
467
|
+
* 透传给 iframe 编辑器的主题配置。
|
|
468
|
+
* 当前 shimo-js-sdk 仅负责跨 iframe 传输,不在宿主侧约束字段细节。
|
|
469
|
+
*/
|
|
470
|
+
export interface CommonThemeConfig {
|
|
471
|
+
[key: string]: unknown;
|
|
472
|
+
}
|
|
466
473
|
/**
|
|
467
474
|
* iframe 内置加载页配置,只支持可序列化字段。
|
|
468
475
|
*/
|
|
@@ -587,6 +594,16 @@ export interface OfficeSDKOptions extends Omit<ContainerMethods, 'getContainerRe
|
|
|
587
594
|
* 控制 headerbar 组件是否展示,false 表示隐藏。
|
|
588
595
|
*/
|
|
589
596
|
headerBarsVisible?: boolean;
|
|
597
|
+
/**
|
|
598
|
+
* 是否隐藏 iframe 内 AI 入口。
|
|
599
|
+
* 对应 iframe 内 ShimoSDK 的现有 AI 入口开关能力。
|
|
600
|
+
*/
|
|
601
|
+
disableAiEntry?: boolean;
|
|
602
|
+
/**
|
|
603
|
+
* 编辑器主题配置。
|
|
604
|
+
* 该参数会透传到 iframe 内各套件初始化链路;未传时保持 iframe 默认主题。
|
|
605
|
+
*/
|
|
606
|
+
theme?: CommonThemeConfig;
|
|
590
607
|
/**
|
|
591
608
|
* docs 斜杠菜单配置。
|
|
592
609
|
* 仅 docs 文件类型生效;`button.callback` 实际运行在宿主页,
|
|
@@ -5,6 +5,7 @@ export declare const HEADER_BARS_METHOD: {
|
|
|
5
5
|
readonly getCommand: "headerBars.getCommand";
|
|
6
6
|
readonly setCommandVisible: "headerBars.setCommandVisible";
|
|
7
7
|
readonly setCommandDisabled: "headerBars.setCommandDisabled";
|
|
8
|
+
readonly setCommandActive: "headerBars.setCommandActive";
|
|
8
9
|
readonly setCommandSrc: "headerBars.setCommandSrc";
|
|
9
10
|
readonly setCommandLabel: "headerBars.setCommandLabel";
|
|
10
11
|
readonly setCommandEditable: "headerBars.setCommandEditable";
|
|
@@ -20,6 +21,7 @@ export interface HeaderBarsCommandDefinition {
|
|
|
20
21
|
label?: string;
|
|
21
22
|
visible?: boolean;
|
|
22
23
|
disabled?: boolean;
|
|
24
|
+
active?: boolean;
|
|
23
25
|
editable?: boolean;
|
|
24
26
|
type?: 'action' | 'structural';
|
|
25
27
|
renderType?: string;
|
|
@@ -33,6 +35,7 @@ export interface HeaderBarsCommandRef {
|
|
|
33
35
|
readonly id: string;
|
|
34
36
|
visible: boolean;
|
|
35
37
|
disabled: boolean;
|
|
38
|
+
active: boolean;
|
|
36
39
|
src?: string;
|
|
37
40
|
label?: string;
|
|
38
41
|
editable?: boolean;
|