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