@officesdk/editor-sdk-core 0.0.0-12 → 0.0.0-14
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/cjs/docx/context-menu.js +1 -1
- package/cjs/docx/index.js +1 -1
- package/cjs/docx/menu.js +1 -1
- package/cjs/pdf/menu.js +1 -1
- package/cjs/presentation/menu.js +1 -1
- package/cjs/shared/context-menu.js +1 -1
- package/cjs/shared/index.js +1 -1
- package/cjs/shared/menu.js +1 -1
- package/cjs/shared/toolbar.js +1 -1
- package/cjs/sheet/index.js +1 -1
- package/cjs/sheet/menu.js +1 -1
- package/cjs/sheet/sdk.js +1 -1
- package/cjs/sheet/toolbar.js +3 -0
- package/esm/docx/context-menu.js +1 -1
- package/esm/docx/index.js +1 -1
- package/esm/docx/menu.js +1 -1
- package/esm/pdf/menu.js +1 -1
- package/esm/presentation/menu.js +1 -1
- package/esm/shared/context-menu.js +1 -1
- package/esm/shared/index.js +1 -1
- package/esm/shared/menu.js +1 -1
- package/esm/shared/toolbar.js +1 -1
- package/esm/sheet/index.js +1 -1
- package/esm/sheet/menu.js +1 -1
- package/esm/sheet/sdk.js +1 -1
- package/esm/sheet/toolbar.js +2 -0
- package/package.json +1 -1
- package/types/diagram.d.ts +110 -166
- package/types/docs.d.ts +110 -166
- package/types/docx.d.ts +146 -182
- package/types/pdf.d.ts +111 -167
- package/types/presentation.d.ts +112 -168
- package/types/shared.d.ts +110 -166
- package/types/sheet.d.ts +139 -171
- package/types/table.d.ts +110 -166
package/types/docs.d.ts
CHANGED
|
@@ -548,27 +548,6 @@ export declare interface EditorContent<Delta = EditorDelta> {
|
|
|
548
548
|
addChangeListener: (listener: (change: Delta) => void) => () => void;
|
|
549
549
|
}
|
|
550
550
|
|
|
551
|
-
/**
|
|
552
|
-
* 右键菜单栏二级以下的菜单入口
|
|
553
|
-
*/
|
|
554
|
-
export declare type EditorContextMenuEntryButton<TName extends string> = EditorMenuEntryButton<TName>;
|
|
555
|
-
|
|
556
|
-
/**
|
|
557
|
-
* 右键菜单栏一级菜单配置,此处用于定义一级菜单的操作入口,
|
|
558
|
-
* 右键菜单栏一级菜单指点击右键弹出菜单时的菜单项
|
|
559
|
-
*/
|
|
560
|
-
export declare type EditorContextMenuEntryConfig<TName extends string> = EditorMenuEntryConfig<TName>;
|
|
561
|
-
|
|
562
|
-
/**
|
|
563
|
-
* 右键菜单栏功能按钮配置
|
|
564
|
-
*/
|
|
565
|
-
export declare type EditorContextMenuFeatureButton<TName extends string> = EditorMenuFeatureButton<TName>;
|
|
566
|
-
|
|
567
|
-
/**
|
|
568
|
-
* 右键菜单栏按钮配置
|
|
569
|
-
*/
|
|
570
|
-
export declare type EditorContextMenuFeatureButtonConfig<TName extends string> = EditorMenuFeatureButtonConfig<TName>;
|
|
571
|
-
|
|
572
551
|
/**
|
|
573
552
|
* 右键菜单栏相关配置
|
|
574
553
|
* 右键菜单栏是指的编辑器中点击右键弹出的菜单栏。目前等于菜单栏配置,可扩展
|
|
@@ -762,120 +741,137 @@ export declare interface EditorLocalUploadableFile extends EditorBaseUploadableF
|
|
|
762
741
|
}
|
|
763
742
|
|
|
764
743
|
/**
|
|
765
|
-
*
|
|
744
|
+
* 基础菜单项配置,所有菜单项类型都包含这些属性
|
|
766
745
|
*/
|
|
767
|
-
export declare
|
|
768
|
-
/**
|
|
769
|
-
* 按钮名称
|
|
770
|
-
*/
|
|
771
|
-
name: string;
|
|
746
|
+
export declare interface EditorMenuBaseMenuItemConfig<TName extends string> {
|
|
772
747
|
/**
|
|
773
|
-
*
|
|
748
|
+
* 菜单项的唯一标识,用以确定配置的是哪个菜单
|
|
774
749
|
*/
|
|
775
|
-
|
|
776
|
-
/**
|
|
777
|
-
* 按钮文本
|
|
778
|
-
*/
|
|
779
|
-
text: string;
|
|
780
|
-
/**
|
|
781
|
-
* 链接地址
|
|
782
|
-
*/
|
|
783
|
-
url: string;
|
|
784
|
-
} | {
|
|
750
|
+
name: TName;
|
|
785
751
|
/**
|
|
786
|
-
*
|
|
752
|
+
* 菜单项类型
|
|
787
753
|
*/
|
|
788
|
-
|
|
754
|
+
type: EditorMenuItemType;
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
/**
|
|
758
|
+
* 按钮菜单项配置
|
|
759
|
+
*/
|
|
760
|
+
export declare interface EditorMenuButtonMenuItemConfig<TName extends string> extends EditorMenuBaseMenuItemConfig<TName> {
|
|
761
|
+
type: 'button';
|
|
789
762
|
/**
|
|
790
|
-
*
|
|
763
|
+
* 是否禁用菜单项,禁用后菜单项依旧显示不过变为灰色,不可点击
|
|
791
764
|
*/
|
|
792
|
-
|
|
765
|
+
disabled?: boolean;
|
|
793
766
|
/**
|
|
794
|
-
*
|
|
767
|
+
* 菜单项显示文本,修改该值可以替换此菜单项默认显示文案
|
|
795
768
|
*/
|
|
796
|
-
label
|
|
769
|
+
label?: string;
|
|
797
770
|
/**
|
|
798
|
-
*
|
|
771
|
+
* 菜单项图标,可以是 base64 的图片信息,也可以是图片 url
|
|
772
|
+
* 配置为空字符串则可以隐藏菜单项默认的图标
|
|
799
773
|
*/
|
|
800
774
|
icon?: string;
|
|
801
775
|
/**
|
|
802
|
-
*
|
|
776
|
+
* 菜单项点击事件,接受一个函数,可以自定义点击事件
|
|
803
777
|
*/
|
|
804
|
-
callback
|
|
805
|
-
}
|
|
778
|
+
callback?: () => void;
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
/**
|
|
782
|
+
* 编辑器菜单配置类型
|
|
783
|
+
* 联合类型,表示可以是任意一种菜单项配置
|
|
784
|
+
*/
|
|
785
|
+
export declare type EditorMenuEntryConfig<TName extends string> = EditorMenuHiddenMenuItemConfig<TName> | EditorMenuButtonMenuItemConfig<TName> | EditorMenuLinkMenuItemConfig<TName> | EditorMenuEntryMenuItemConfig<TName>;
|
|
806
786
|
|
|
807
787
|
/**
|
|
808
|
-
*
|
|
788
|
+
* 子菜单入口配置
|
|
809
789
|
*/
|
|
810
|
-
export declare interface
|
|
790
|
+
export declare interface EditorMenuEntryMenuItemConfig<TName extends string> extends EditorMenuBaseMenuItemConfig<TName> {
|
|
811
791
|
type: 'entry';
|
|
812
792
|
/**
|
|
813
|
-
*
|
|
793
|
+
* 是否禁用菜单项,禁用后菜单项依旧显示不过变为灰色,不可点击
|
|
814
794
|
*/
|
|
815
|
-
|
|
795
|
+
disabled?: boolean;
|
|
796
|
+
/**
|
|
797
|
+
* 菜单项显示文本,修改该值可以替换此菜单项默认显示文案
|
|
798
|
+
*/
|
|
799
|
+
label?: string;
|
|
816
800
|
/**
|
|
817
|
-
*
|
|
801
|
+
* 菜单项图标,可以是 base64 的图片信息,也可以是图片 url
|
|
802
|
+
* 配置为空字符串则可以隐藏菜单项默认的图标
|
|
818
803
|
*/
|
|
819
804
|
icon?: string;
|
|
820
805
|
/**
|
|
821
|
-
*
|
|
806
|
+
* 下一级菜单配置,下一级菜单配置项和上一级相同
|
|
807
|
+
* 如果下一级仍然是 entry 类型,可以无限向下扩展
|
|
822
808
|
*/
|
|
823
|
-
children?:
|
|
809
|
+
children?: EditorMenuEntryConfig<TName>[];
|
|
824
810
|
}
|
|
825
811
|
|
|
826
812
|
/**
|
|
827
|
-
*
|
|
828
|
-
* 一级菜单在鼠标悬停时展示二级列表
|
|
813
|
+
* 菜单功能按钮配置
|
|
829
814
|
*/
|
|
830
|
-
export declare interface
|
|
815
|
+
export declare interface EditorMenuFeatureConfig {
|
|
831
816
|
/**
|
|
832
|
-
*
|
|
817
|
+
* 是否隐藏菜单项,设置为true则隐藏菜单项
|
|
833
818
|
*/
|
|
834
|
-
|
|
835
|
-
/**
|
|
836
|
-
* 二级菜单定义,定一个二维数组,用于定义二级菜单的结构,
|
|
837
|
-
* 将第一层数组中的所有按钮放到一个区域内用分隔符隔开,
|
|
838
|
-
* 第二层数组为按钮的定义,可以是功能按钮也可以是一个下拉入口。
|
|
839
|
-
*/
|
|
840
|
-
children: Array<EditorMenuFeatureButton<TName> | EditorMenuEntryButton<TName>>[];
|
|
819
|
+
hidden?: boolean;
|
|
841
820
|
/**
|
|
842
|
-
*
|
|
821
|
+
* 是否禁用菜单项,设置为true则变为灰色不可点击
|
|
843
822
|
*/
|
|
844
|
-
|
|
823
|
+
disabled?: boolean;
|
|
845
824
|
}
|
|
846
825
|
|
|
847
826
|
/**
|
|
848
|
-
*
|
|
827
|
+
* 菜单功能按钮配置
|
|
849
828
|
*/
|
|
850
|
-
export declare
|
|
829
|
+
export declare interface EditorMenuFeatureConfig {
|
|
851
830
|
/**
|
|
852
|
-
*
|
|
831
|
+
* 是否隐藏菜单项,设置为true则隐藏菜单项
|
|
853
832
|
*/
|
|
854
|
-
|
|
833
|
+
hidden?: boolean;
|
|
855
834
|
/**
|
|
856
|
-
*
|
|
835
|
+
* 是否禁用菜单项,设置为true则变为灰色不可点击
|
|
857
836
|
*/
|
|
858
|
-
|
|
859
|
-
}
|
|
860
|
-
|
|
837
|
+
disabled?: boolean;
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
/**
|
|
841
|
+
* 隐藏菜单项配置
|
|
842
|
+
*/
|
|
843
|
+
export declare interface EditorMenuHiddenMenuItemConfig<TName extends string> extends EditorMenuBaseMenuItemConfig<TName> {
|
|
844
|
+
type: 'hidden';
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
/**
|
|
848
|
+
* 菜单项类型
|
|
849
|
+
*/
|
|
850
|
+
export declare type EditorMenuItemType = 'hidden' | 'button' | 'link' | 'entry';
|
|
851
|
+
|
|
852
|
+
/**
|
|
853
|
+
* 链接菜单项配置
|
|
854
|
+
*/
|
|
855
|
+
export declare interface EditorMenuLinkMenuItemConfig<TName extends string> extends EditorMenuBaseMenuItemConfig<TName> {
|
|
856
|
+
type: 'link';
|
|
861
857
|
/**
|
|
862
|
-
*
|
|
858
|
+
* 是否禁用菜单项,禁用后菜单项依旧显示不过变为灰色,不可点击
|
|
863
859
|
*/
|
|
864
|
-
|
|
860
|
+
disabled?: boolean;
|
|
865
861
|
/**
|
|
866
|
-
*
|
|
862
|
+
* 菜单项显示文本,修改该值可以替换此菜单项默认显示文案
|
|
867
863
|
*/
|
|
868
|
-
|
|
864
|
+
text?: string;
|
|
869
865
|
/**
|
|
870
|
-
*
|
|
866
|
+
* 菜单项图标,可以是 base64 的图片信息,也可以是图片 url
|
|
867
|
+
* 配置为空字符串则可以隐藏菜单项默认的图标
|
|
871
868
|
*/
|
|
872
869
|
icon?: string;
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
export declare type EditorMenuFeatureButtonConfig<TName extends string> = Record<TName, EditorMenuFeatureButton<TName>>;
|
|
870
|
+
/**
|
|
871
|
+
* 跳转链接地址
|
|
872
|
+
*/
|
|
873
|
+
url?: string;
|
|
874
|
+
}
|
|
879
875
|
|
|
880
876
|
/**
|
|
881
877
|
* 菜单栏相关配置,目前菜单栏不是所有套件都支持,
|
|
@@ -883,25 +879,26 @@ export declare type EditorMenuFeatureButtonConfig<TName extends string> = Record
|
|
|
883
879
|
*/
|
|
884
880
|
export declare interface EditorMenuOptions<TName extends string> {
|
|
885
881
|
/**
|
|
886
|
-
*
|
|
882
|
+
* 菜单栏是否隐藏,设置为true, 则整个菜单栏不显示
|
|
887
883
|
*/
|
|
888
884
|
hidden?: boolean;
|
|
889
885
|
/**
|
|
890
|
-
*
|
|
886
|
+
* 是否禁用菜单栏所有功能。设置为true,菜单栏依旧显示,但所有菜单项为灰色不可点击
|
|
891
887
|
*/
|
|
892
888
|
disabled?: boolean;
|
|
893
889
|
/**
|
|
894
|
-
*
|
|
890
|
+
* 菜单栏一级菜单配置,指显示在菜单栏上的菜单项。
|
|
895
891
|
*/
|
|
896
892
|
entries?: EditorMenuEntryConfig<TName>[];
|
|
897
893
|
/**
|
|
898
894
|
* 菜单栏功能按钮配置
|
|
895
|
+
* TODO 此配置目前没有用到,后续看是保留还是和custom合并
|
|
899
896
|
*/
|
|
900
|
-
features?:
|
|
897
|
+
features?: Record<TName, EditorMenuFeatureConfig>;
|
|
901
898
|
/**
|
|
902
899
|
* 自定义按钮配置
|
|
903
900
|
*/
|
|
904
|
-
custom?:
|
|
901
|
+
custom?: (EditorMenuButtonMenuItemConfig<string> | EditorMenuLinkMenuItemConfig<string>)[];
|
|
905
902
|
}
|
|
906
903
|
|
|
907
904
|
/**
|
|
@@ -1264,43 +1261,15 @@ export declare interface EditorTextOptions<Color = string> {
|
|
|
1264
1261
|
}
|
|
1265
1262
|
|
|
1266
1263
|
/**
|
|
1267
|
-
*
|
|
1268
|
-
*/
|
|
1269
|
-
export declare interface EditorToolbarCustomButton extends Omit<EditorToolbarFeatureButton, 'name'> {
|
|
1270
|
-
/**
|
|
1271
|
-
* 自定义按钮名称
|
|
1272
|
-
*/
|
|
1273
|
-
name: string;
|
|
1274
|
-
/**
|
|
1275
|
-
* 按钮点击事件
|
|
1276
|
-
*/
|
|
1277
|
-
callback: () => void;
|
|
1278
|
-
/**
|
|
1279
|
-
* 按钮在工具栏中的位置,默认添加到工具栏所有按钮后面
|
|
1280
|
-
*/
|
|
1281
|
-
index?: number;
|
|
1282
|
-
}
|
|
1283
|
-
|
|
1284
|
-
/**
|
|
1285
|
-
* 工具栏自定义按钮配置
|
|
1286
|
-
*/
|
|
1287
|
-
export declare interface EditorToolbarCustomButtonConfig {
|
|
1288
|
-
/**
|
|
1289
|
-
* 按钮配置
|
|
1290
|
-
*/
|
|
1291
|
-
[key: string]: EditorToolbarCustomButton;
|
|
1292
|
-
}
|
|
1293
|
-
|
|
1294
|
-
/**
|
|
1295
|
-
* 工具栏内置功能按钮配置
|
|
1264
|
+
* 工具栏功能按钮配置(包括内置按钮和自定义按钮)
|
|
1296
1265
|
*/
|
|
1297
|
-
export declare interface EditorToolbarFeatureButton<
|
|
1266
|
+
export declare interface EditorToolbarFeatureButton<TName extends string> {
|
|
1298
1267
|
/**
|
|
1299
|
-
*
|
|
1268
|
+
* 按钮的唯一标识,用以确定配置的是哪个按钮。
|
|
1300
1269
|
*/
|
|
1301
|
-
name:
|
|
1270
|
+
name: TName;
|
|
1302
1271
|
/**
|
|
1303
|
-
*
|
|
1272
|
+
* 按钮标签(显示文本)一般工具栏上的按钮不会显示文本,如果需要显示文本,配置此项。
|
|
1304
1273
|
*/
|
|
1305
1274
|
label?: string;
|
|
1306
1275
|
/**
|
|
@@ -1308,63 +1277,38 @@ export declare interface EditorToolbarFeatureButton<ToolButtonName extends strin
|
|
|
1308
1277
|
*/
|
|
1309
1278
|
icon?: string;
|
|
1310
1279
|
/**
|
|
1311
|
-
*
|
|
1280
|
+
* 按钮是否隐藏,设置为true则隐藏按钮
|
|
1312
1281
|
*/
|
|
1313
1282
|
hidden?: boolean;
|
|
1314
1283
|
/**
|
|
1315
|
-
*
|
|
1284
|
+
* 按钮是否禁用,设置为true则变为灰色不可点击
|
|
1316
1285
|
*/
|
|
1317
1286
|
disabled?: boolean;
|
|
1318
1287
|
/**
|
|
1319
|
-
*
|
|
1288
|
+
* 按钮点击事件.接受一个函数,可以自定义点击事件。
|
|
1289
|
+
*/
|
|
1290
|
+
callback?: () => void;
|
|
1291
|
+
/**
|
|
1292
|
+
* 按钮提示文本,鼠标悬浮到按钮上时显示的tooltip文字
|
|
1320
1293
|
*/
|
|
1321
1294
|
tooltip?: string;
|
|
1295
|
+
/**
|
|
1296
|
+
* 按钮在工具栏中位置,不设置则按照默认位置
|
|
1297
|
+
*/
|
|
1298
|
+
index?: number;
|
|
1322
1299
|
}
|
|
1323
1300
|
|
|
1324
1301
|
/**
|
|
1325
1302
|
* 工具栏内置功能按钮配置
|
|
1326
1303
|
*/
|
|
1327
|
-
export declare type EditorToolbarFeatureButtonConfig<
|
|
1328
|
-
[key in
|
|
1304
|
+
export declare type EditorToolbarFeatureButtonConfig<TName extends string> = {
|
|
1305
|
+
[key in TName]?: EditorToolbarFeatureButton<key>;
|
|
1329
1306
|
};
|
|
1330
1307
|
|
|
1331
|
-
/**
|
|
1332
|
-
* 工具栏内置功能按钮
|
|
1333
|
-
*/
|
|
1334
|
-
export declare type EditorToolbarFeatureButtonName =
|
|
1335
|
-
/**
|
|
1336
|
-
* 加粗
|
|
1337
|
-
*/
|
|
1338
|
-
'bold'
|
|
1339
|
-
/**
|
|
1340
|
-
* 斜体
|
|
1341
|
-
*/
|
|
1342
|
-
| 'italic'
|
|
1343
|
-
/**
|
|
1344
|
-
* 下划线
|
|
1345
|
-
*/
|
|
1346
|
-
| 'underline'
|
|
1347
|
-
/**
|
|
1348
|
-
* 删除线
|
|
1349
|
-
*/
|
|
1350
|
-
| 'strikethrough'
|
|
1351
|
-
/**
|
|
1352
|
-
* 插入图片
|
|
1353
|
-
*/
|
|
1354
|
-
| 'insertImage'
|
|
1355
|
-
/**
|
|
1356
|
-
* 插入链接
|
|
1357
|
-
*/
|
|
1358
|
-
| 'insertLink'
|
|
1359
|
-
/**
|
|
1360
|
-
* 限制编辑
|
|
1361
|
-
*/
|
|
1362
|
-
| 'restriction';
|
|
1363
|
-
|
|
1364
1308
|
/**
|
|
1365
1309
|
* 工具栏相关设置,可以控制工具栏的显示内容
|
|
1366
1310
|
*/
|
|
1367
|
-
export declare interface EditorToolbarOptions<
|
|
1311
|
+
export declare interface EditorToolbarOptions<TName extends string> {
|
|
1368
1312
|
/**
|
|
1369
1313
|
* 控制工具栏显隐状态
|
|
1370
1314
|
*/
|
|
@@ -1376,11 +1320,11 @@ export declare interface EditorToolbarOptions<ToolButtonName extends string = Ed
|
|
|
1376
1320
|
/**
|
|
1377
1321
|
* 现有按钮的功能配置
|
|
1378
1322
|
*/
|
|
1379
|
-
features?: EditorToolbarFeatureButtonConfig<
|
|
1323
|
+
features?: EditorToolbarFeatureButtonConfig<TName>;
|
|
1380
1324
|
/**
|
|
1381
1325
|
* 自定义按钮
|
|
1382
1326
|
*/
|
|
1383
|
-
custom?:
|
|
1327
|
+
custom?: EditorToolbarFeatureButtonConfig<string>;
|
|
1384
1328
|
}
|
|
1385
1329
|
|
|
1386
1330
|
export declare type EditorUploadableFile = EditorLocalUploadableFile;
|