@officesdk/editor-sdk-core 0.0.0-12 → 0.0.0-13
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 +89 -173
- package/types/docs.d.ts +89 -173
- package/types/docx.d.ts +125 -189
- package/types/pdf.d.ts +90 -174
- package/types/presentation.d.ts +90 -174
- package/types/shared.d.ts +89 -173
- package/types/sheet.d.ts +118 -178
- package/types/table.d.ts +89 -173
package/types/pdf.d.ts
CHANGED
|
@@ -394,27 +394,6 @@ export declare interface EditorContent<Delta = EditorDelta> {
|
|
|
394
394
|
addChangeListener: (listener: (change: Delta) => void) => () => void;
|
|
395
395
|
}
|
|
396
396
|
|
|
397
|
-
/**
|
|
398
|
-
* 右键菜单栏二级以下的菜单入口
|
|
399
|
-
*/
|
|
400
|
-
export declare type EditorContextMenuEntryButton<TName extends string> = EditorMenuEntryButton<TName>;
|
|
401
|
-
|
|
402
|
-
/**
|
|
403
|
-
* 右键菜单栏一级菜单配置,此处用于定义一级菜单的操作入口,
|
|
404
|
-
* 右键菜单栏一级菜单指点击右键弹出菜单时的菜单项
|
|
405
|
-
*/
|
|
406
|
-
export declare type EditorContextMenuEntryConfig<TName extends string> = EditorMenuEntryConfig<TName>;
|
|
407
|
-
|
|
408
|
-
/**
|
|
409
|
-
* 右键菜单栏功能按钮配置
|
|
410
|
-
*/
|
|
411
|
-
export declare type EditorContextMenuFeatureButton<TName extends string> = EditorMenuFeatureButton<TName>;
|
|
412
|
-
|
|
413
|
-
/**
|
|
414
|
-
* 右键菜单栏按钮配置
|
|
415
|
-
*/
|
|
416
|
-
export declare type EditorContextMenuFeatureButtonConfig<TName extends string> = EditorMenuFeatureButtonConfig<TName>;
|
|
417
|
-
|
|
418
397
|
/**
|
|
419
398
|
* 右键菜单栏相关配置
|
|
420
399
|
* 右键菜单栏是指的编辑器中点击右键弹出的菜单栏。目前等于菜单栏配置,可扩展
|
|
@@ -608,120 +587,109 @@ export declare interface EditorLocalUploadableFile extends EditorBaseUploadableF
|
|
|
608
587
|
}
|
|
609
588
|
|
|
610
589
|
/**
|
|
611
|
-
*
|
|
590
|
+
* 基础菜单项配置,所有菜单项类型都包含这些属性
|
|
612
591
|
*/
|
|
613
|
-
|
|
614
|
-
/**
|
|
615
|
-
* 按钮名称
|
|
616
|
-
*/
|
|
617
|
-
name: string;
|
|
618
|
-
/**
|
|
619
|
-
* 链接
|
|
620
|
-
*/
|
|
621
|
-
type: 'link';
|
|
622
|
-
/**
|
|
623
|
-
* 按钮文本
|
|
624
|
-
*/
|
|
625
|
-
text: string;
|
|
592
|
+
declare interface EditorMenuBaseMenuItemConfig<TName extends string> {
|
|
626
593
|
/**
|
|
627
|
-
*
|
|
594
|
+
* 菜单项的唯一标识,用以确定配置的是哪个菜单
|
|
628
595
|
*/
|
|
629
|
-
|
|
630
|
-
} | {
|
|
596
|
+
name: TName;
|
|
631
597
|
/**
|
|
632
|
-
*
|
|
598
|
+
* 菜单项类型
|
|
633
599
|
*/
|
|
634
|
-
|
|
600
|
+
type?: EditorMenuItemType;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
/**
|
|
604
|
+
* 按钮菜单项配置
|
|
605
|
+
*/
|
|
606
|
+
export declare interface EditorMenuButtonMenuItemConfig<TName extends string> extends EditorMenuBaseMenuItemConfig<TName> {
|
|
607
|
+
type?: 'button';
|
|
635
608
|
/**
|
|
636
|
-
*
|
|
609
|
+
* 是否禁用菜单项,禁用后菜单项依旧显示不过变为灰色,不可点击
|
|
637
610
|
*/
|
|
638
|
-
|
|
611
|
+
disabled?: boolean;
|
|
639
612
|
/**
|
|
640
|
-
*
|
|
613
|
+
* 菜单项显示文本,修改该值可以替换此菜单项默认显示文案
|
|
641
614
|
*/
|
|
642
|
-
label
|
|
615
|
+
label?: string;
|
|
643
616
|
/**
|
|
644
|
-
*
|
|
617
|
+
* 菜单项图标,可以是 base64 的图片信息,也可以是图片 url
|
|
618
|
+
* 配置为空字符串则可以隐藏菜单项默认的图标
|
|
645
619
|
*/
|
|
646
620
|
icon?: string;
|
|
647
621
|
/**
|
|
648
|
-
*
|
|
622
|
+
* 菜单项点击事件,接受一个函数,可以自定义点击事件
|
|
649
623
|
*/
|
|
650
|
-
callback
|
|
651
|
-
}
|
|
624
|
+
callback?: () => void;
|
|
625
|
+
}
|
|
652
626
|
|
|
653
627
|
/**
|
|
654
|
-
*
|
|
628
|
+
* 编辑器菜单配置类型
|
|
629
|
+
* 联合类型,表示可以是任意一种菜单项配置
|
|
655
630
|
*/
|
|
656
|
-
export declare
|
|
657
|
-
|
|
631
|
+
export declare type EditorMenuEntryConfig<TName extends string> = EditorMenuHiddenMenuItemConfig<TName> | EditorMenuButtonMenuItemConfig<TName> | EditorMenuLinkMenuItemConfig<TName> | EditorMenuEntryMenuItemConfig<TName>;
|
|
632
|
+
|
|
633
|
+
/**
|
|
634
|
+
* 子菜单入口配置
|
|
635
|
+
*/
|
|
636
|
+
export declare interface EditorMenuEntryMenuItemConfig<TName extends string> extends EditorMenuBaseMenuItemConfig<TName> {
|
|
637
|
+
type?: 'entry';
|
|
658
638
|
/**
|
|
659
|
-
*
|
|
639
|
+
* 是否禁用菜单项,禁用后菜单项依旧显示不过变为灰色,不可点击
|
|
660
640
|
*/
|
|
661
|
-
|
|
641
|
+
disabled?: boolean;
|
|
662
642
|
/**
|
|
663
|
-
*
|
|
643
|
+
* 菜单项显示文本,修改该值可以替换此菜单项默认显示文案
|
|
644
|
+
*/
|
|
645
|
+
label?: string;
|
|
646
|
+
/**
|
|
647
|
+
* 菜单项图标,可以是 base64 的图片信息,也可以是图片 url
|
|
648
|
+
* 配置为空字符串则可以隐藏菜单项默认的图标
|
|
664
649
|
*/
|
|
665
650
|
icon?: string;
|
|
666
651
|
/**
|
|
667
|
-
*
|
|
652
|
+
* 下一级菜单配置,下一级菜单配置项和上一级相同
|
|
653
|
+
* 如果下一级仍然是 entry 类型,可以无限向下扩展
|
|
668
654
|
*/
|
|
669
|
-
children?:
|
|
655
|
+
children?: EditorMenuEntryConfig<TName>[];
|
|
670
656
|
}
|
|
671
657
|
|
|
672
658
|
/**
|
|
673
|
-
*
|
|
674
|
-
* 一级菜单在鼠标悬停时展示二级列表
|
|
659
|
+
* 隐藏菜单项配置
|
|
675
660
|
*/
|
|
676
|
-
export declare interface
|
|
677
|
-
/**
|
|
678
|
-
* 一级菜单名称
|
|
679
|
-
*/
|
|
680
|
-
name: string;
|
|
681
|
-
/**
|
|
682
|
-
* 二级菜单定义,定一个二维数组,用于定义二级菜单的结构,
|
|
683
|
-
* 将第一层数组中的所有按钮放到一个区域内用分隔符隔开,
|
|
684
|
-
* 第二层数组为按钮的定义,可以是功能按钮也可以是一个下拉入口。
|
|
685
|
-
*/
|
|
686
|
-
children: Array<EditorMenuFeatureButton<TName> | EditorMenuEntryButton<TName>>[];
|
|
687
|
-
/**
|
|
688
|
-
* 是否隐藏一级菜单
|
|
689
|
-
*/
|
|
661
|
+
export declare interface EditorMenuHiddenMenuItemConfig<TName extends string> extends EditorMenuBaseMenuItemConfig<TName> {
|
|
690
662
|
type?: 'hidden';
|
|
691
663
|
}
|
|
692
664
|
|
|
693
665
|
/**
|
|
694
|
-
*
|
|
666
|
+
* 菜单项类型
|
|
695
667
|
*/
|
|
696
|
-
export declare type
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
668
|
+
export declare type EditorMenuItemType = 'hidden' | 'button' | 'link' | 'entry';
|
|
669
|
+
|
|
670
|
+
/**
|
|
671
|
+
* 链接菜单项配置
|
|
672
|
+
*/
|
|
673
|
+
export declare interface EditorMenuLinkMenuItemConfig<TName extends string> extends EditorMenuBaseMenuItemConfig<TName> {
|
|
674
|
+
type?: 'link';
|
|
701
675
|
/**
|
|
702
|
-
*
|
|
676
|
+
* 是否禁用菜单项,禁用后菜单项依旧显示不过变为灰色,不可点击
|
|
703
677
|
*/
|
|
704
|
-
|
|
705
|
-
} | {
|
|
706
|
-
type: 'button';
|
|
678
|
+
disabled?: boolean;
|
|
707
679
|
/**
|
|
708
|
-
*
|
|
680
|
+
* 菜单项显示文本,修改该值可以替换此菜单项默认显示文案
|
|
709
681
|
*/
|
|
710
|
-
|
|
682
|
+
label?: string;
|
|
711
683
|
/**
|
|
712
|
-
*
|
|
684
|
+
* 菜单项图标,可以是 base64 的图片信息,也可以是图片 url
|
|
685
|
+
* 配置为空字符串则可以隐藏菜单项默认的图标
|
|
713
686
|
*/
|
|
714
|
-
|
|
687
|
+
icon?: string;
|
|
715
688
|
/**
|
|
716
|
-
*
|
|
689
|
+
* 跳转链接地址
|
|
717
690
|
*/
|
|
718
|
-
|
|
719
|
-
}
|
|
720
|
-
|
|
721
|
-
/**
|
|
722
|
-
* 菜单栏按钮配置
|
|
723
|
-
*/
|
|
724
|
-
export declare type EditorMenuFeatureButtonConfig<TName extends string> = Record<TName, EditorMenuFeatureButton<TName>>;
|
|
691
|
+
url?: string;
|
|
692
|
+
}
|
|
725
693
|
|
|
726
694
|
/**
|
|
727
695
|
* 菜单栏相关配置,目前菜单栏不是所有套件都支持,
|
|
@@ -729,25 +697,26 @@ export declare type EditorMenuFeatureButtonConfig<TName extends string> = Record
|
|
|
729
697
|
*/
|
|
730
698
|
export declare interface EditorMenuOptions<TName extends string> {
|
|
731
699
|
/**
|
|
732
|
-
*
|
|
700
|
+
* 菜单栏是否隐藏,设置为true, 则整个菜单栏不显示
|
|
733
701
|
*/
|
|
734
702
|
hidden?: boolean;
|
|
735
703
|
/**
|
|
736
|
-
*
|
|
704
|
+
* 是否禁用菜单栏所有功能。设置为true,菜单栏依旧显示,但所有菜单项为灰色不可点击
|
|
737
705
|
*/
|
|
738
706
|
disabled?: boolean;
|
|
739
707
|
/**
|
|
740
|
-
*
|
|
708
|
+
* 菜单栏一级菜单配置,指显示在菜单栏上的菜单项。
|
|
741
709
|
*/
|
|
742
710
|
entries?: EditorMenuEntryConfig<TName>[];
|
|
743
711
|
/**
|
|
744
712
|
* 菜单栏功能按钮配置
|
|
713
|
+
* TODO 此配置目前没有用到,后续看是保留还是和custom合并
|
|
745
714
|
*/
|
|
746
|
-
features?:
|
|
715
|
+
features?: EditorMenuEntryConfig<TName>[];
|
|
747
716
|
/**
|
|
748
717
|
* 自定义按钮配置
|
|
749
718
|
*/
|
|
750
|
-
custom?:
|
|
719
|
+
custom?: EditorMenuEntryConfig<TName>[];
|
|
751
720
|
}
|
|
752
721
|
|
|
753
722
|
/**
|
|
@@ -1110,43 +1079,15 @@ export declare interface EditorTextOptions<Color = string> {
|
|
|
1110
1079
|
}
|
|
1111
1080
|
|
|
1112
1081
|
/**
|
|
1113
|
-
*
|
|
1082
|
+
* 工具栏功能按钮配置(包括内置按钮和自定义按钮)
|
|
1114
1083
|
*/
|
|
1115
|
-
export declare interface
|
|
1084
|
+
export declare interface EditorToolbarFeatureButton<TName extends string> {
|
|
1116
1085
|
/**
|
|
1117
|
-
*
|
|
1086
|
+
* 按钮的唯一标识,用以确定配置的是哪个按钮。
|
|
1118
1087
|
*/
|
|
1119
|
-
name:
|
|
1120
|
-
/**
|
|
1121
|
-
* 按钮点击事件
|
|
1122
|
-
*/
|
|
1123
|
-
callback: () => void;
|
|
1124
|
-
/**
|
|
1125
|
-
* 按钮在工具栏中的位置,默认添加到工具栏所有按钮后面
|
|
1126
|
-
*/
|
|
1127
|
-
index?: number;
|
|
1128
|
-
}
|
|
1129
|
-
|
|
1130
|
-
/**
|
|
1131
|
-
* 工具栏自定义按钮配置
|
|
1132
|
-
*/
|
|
1133
|
-
export declare interface EditorToolbarCustomButtonConfig {
|
|
1134
|
-
/**
|
|
1135
|
-
* 按钮配置
|
|
1136
|
-
*/
|
|
1137
|
-
[key: string]: EditorToolbarCustomButton;
|
|
1138
|
-
}
|
|
1139
|
-
|
|
1140
|
-
/**
|
|
1141
|
-
* 工具栏内置功能按钮配置
|
|
1142
|
-
*/
|
|
1143
|
-
export declare interface EditorToolbarFeatureButton<ToolButtonName extends string = EditorToolbarFeatureButtonName> {
|
|
1144
|
-
/**
|
|
1145
|
-
* 按钮类型
|
|
1146
|
-
*/
|
|
1147
|
-
name: ToolButtonName;
|
|
1088
|
+
name: TName;
|
|
1148
1089
|
/**
|
|
1149
|
-
*
|
|
1090
|
+
* 按钮标签(显示文本)一般工具栏上的按钮不会显示文本,如果需要显示文本,配置此项。
|
|
1150
1091
|
*/
|
|
1151
1092
|
label?: string;
|
|
1152
1093
|
/**
|
|
@@ -1154,63 +1095,38 @@ export declare interface EditorToolbarFeatureButton<ToolButtonName extends strin
|
|
|
1154
1095
|
*/
|
|
1155
1096
|
icon?: string;
|
|
1156
1097
|
/**
|
|
1157
|
-
*
|
|
1098
|
+
* 按钮是否隐藏,设置为true则隐藏按钮
|
|
1158
1099
|
*/
|
|
1159
1100
|
hidden?: boolean;
|
|
1160
1101
|
/**
|
|
1161
|
-
*
|
|
1102
|
+
* 按钮是否禁用,设置为true则变为灰色不可点击
|
|
1162
1103
|
*/
|
|
1163
1104
|
disabled?: boolean;
|
|
1164
1105
|
/**
|
|
1165
|
-
*
|
|
1106
|
+
* 按钮点击事件.接受一个函数,可以自定义点击事件。
|
|
1107
|
+
*/
|
|
1108
|
+
callback?: () => void;
|
|
1109
|
+
/**
|
|
1110
|
+
* 按钮提示文本,鼠标悬浮到按钮上时显示的tooltip文字
|
|
1166
1111
|
*/
|
|
1167
1112
|
tooltip?: string;
|
|
1113
|
+
/**
|
|
1114
|
+
* 按钮在工具栏中位置,不设置则按照默认位置
|
|
1115
|
+
*/
|
|
1116
|
+
index?: number;
|
|
1168
1117
|
}
|
|
1169
1118
|
|
|
1170
1119
|
/**
|
|
1171
1120
|
* 工具栏内置功能按钮配置
|
|
1172
1121
|
*/
|
|
1173
|
-
export declare type EditorToolbarFeatureButtonConfig<
|
|
1174
|
-
[key in
|
|
1122
|
+
export declare type EditorToolbarFeatureButtonConfig<TName extends string> = {
|
|
1123
|
+
[key in TName]?: EditorToolbarFeatureButton<key>;
|
|
1175
1124
|
};
|
|
1176
1125
|
|
|
1177
|
-
/**
|
|
1178
|
-
* 工具栏内置功能按钮
|
|
1179
|
-
*/
|
|
1180
|
-
export declare type EditorToolbarFeatureButtonName =
|
|
1181
|
-
/**
|
|
1182
|
-
* 加粗
|
|
1183
|
-
*/
|
|
1184
|
-
'bold'
|
|
1185
|
-
/**
|
|
1186
|
-
* 斜体
|
|
1187
|
-
*/
|
|
1188
|
-
| 'italic'
|
|
1189
|
-
/**
|
|
1190
|
-
* 下划线
|
|
1191
|
-
*/
|
|
1192
|
-
| 'underline'
|
|
1193
|
-
/**
|
|
1194
|
-
* 删除线
|
|
1195
|
-
*/
|
|
1196
|
-
| 'strikethrough'
|
|
1197
|
-
/**
|
|
1198
|
-
* 插入图片
|
|
1199
|
-
*/
|
|
1200
|
-
| 'insertImage'
|
|
1201
|
-
/**
|
|
1202
|
-
* 插入链接
|
|
1203
|
-
*/
|
|
1204
|
-
| 'insertLink'
|
|
1205
|
-
/**
|
|
1206
|
-
* 限制编辑
|
|
1207
|
-
*/
|
|
1208
|
-
| 'restriction';
|
|
1209
|
-
|
|
1210
1126
|
/**
|
|
1211
1127
|
* 工具栏相关设置,可以控制工具栏的显示内容
|
|
1212
1128
|
*/
|
|
1213
|
-
export declare interface EditorToolbarOptions<
|
|
1129
|
+
export declare interface EditorToolbarOptions<TName extends string> {
|
|
1214
1130
|
/**
|
|
1215
1131
|
* 控制工具栏显隐状态
|
|
1216
1132
|
*/
|
|
@@ -1222,11 +1138,11 @@ export declare interface EditorToolbarOptions<ToolButtonName extends string = Ed
|
|
|
1222
1138
|
/**
|
|
1223
1139
|
* 现有按钮的功能配置
|
|
1224
1140
|
*/
|
|
1225
|
-
features?: EditorToolbarFeatureButtonConfig<
|
|
1141
|
+
features?: EditorToolbarFeatureButtonConfig<TName>;
|
|
1226
1142
|
/**
|
|
1227
1143
|
* 自定义按钮
|
|
1228
1144
|
*/
|
|
1229
|
-
custom?:
|
|
1145
|
+
custom?: EditorToolbarFeatureButtonConfig<string>;
|
|
1230
1146
|
}
|
|
1231
1147
|
|
|
1232
1148
|
export declare type EditorUploadableFile = EditorLocalUploadableFile;
|
|
@@ -1432,7 +1348,7 @@ export declare type PdfMenuEntryConfig = EditorMenuEntryConfig<PdfMenuFeatureBut
|
|
|
1432
1348
|
/**
|
|
1433
1349
|
* 传统文档工具栏功能按钮
|
|
1434
1350
|
*/
|
|
1435
|
-
export declare type PdfMenuFeatureButtonConfig =
|
|
1351
|
+
export declare type PdfMenuFeatureButtonConfig = EditorMenuEntryConfig<PdfMenuFeatureButtonName>;
|
|
1436
1352
|
|
|
1437
1353
|
/**
|
|
1438
1354
|
* pdf 工具栏内置功能按钮
|