@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/shared.d.ts
CHANGED
|
@@ -356,27 +356,6 @@ export declare interface EditorContent<Delta = EditorDelta> {
|
|
|
356
356
|
addChangeListener: (listener: (change: Delta) => void) => () => void;
|
|
357
357
|
}
|
|
358
358
|
|
|
359
|
-
/**
|
|
360
|
-
* 右键菜单栏二级以下的菜单入口
|
|
361
|
-
*/
|
|
362
|
-
export declare type EditorContextMenuEntryButton<TName extends string> = EditorMenuEntryButton<TName>;
|
|
363
|
-
|
|
364
|
-
/**
|
|
365
|
-
* 右键菜单栏一级菜单配置,此处用于定义一级菜单的操作入口,
|
|
366
|
-
* 右键菜单栏一级菜单指点击右键弹出菜单时的菜单项
|
|
367
|
-
*/
|
|
368
|
-
export declare type EditorContextMenuEntryConfig<TName extends string> = EditorMenuEntryConfig<TName>;
|
|
369
|
-
|
|
370
|
-
/**
|
|
371
|
-
* 右键菜单栏功能按钮配置
|
|
372
|
-
*/
|
|
373
|
-
export declare type EditorContextMenuFeatureButton<TName extends string> = EditorMenuFeatureButton<TName>;
|
|
374
|
-
|
|
375
|
-
/**
|
|
376
|
-
* 右键菜单栏按钮配置
|
|
377
|
-
*/
|
|
378
|
-
export declare type EditorContextMenuFeatureButtonConfig<TName extends string> = EditorMenuFeatureButtonConfig<TName>;
|
|
379
|
-
|
|
380
359
|
/**
|
|
381
360
|
* 右键菜单栏相关配置
|
|
382
361
|
* 右键菜单栏是指的编辑器中点击右键弹出的菜单栏。目前等于菜单栏配置,可扩展
|
|
@@ -570,120 +549,137 @@ export declare interface EditorLocalUploadableFile extends EditorBaseUploadableF
|
|
|
570
549
|
}
|
|
571
550
|
|
|
572
551
|
/**
|
|
573
|
-
*
|
|
552
|
+
* 基础菜单项配置,所有菜单项类型都包含这些属性
|
|
574
553
|
*/
|
|
575
|
-
export declare
|
|
576
|
-
/**
|
|
577
|
-
* 按钮名称
|
|
578
|
-
*/
|
|
579
|
-
name: string;
|
|
554
|
+
export declare interface EditorMenuBaseMenuItemConfig<TName extends string> {
|
|
580
555
|
/**
|
|
581
|
-
*
|
|
556
|
+
* 菜单项的唯一标识,用以确定配置的是哪个菜单
|
|
582
557
|
*/
|
|
583
|
-
|
|
584
|
-
/**
|
|
585
|
-
* 按钮文本
|
|
586
|
-
*/
|
|
587
|
-
text: string;
|
|
588
|
-
/**
|
|
589
|
-
* 链接地址
|
|
590
|
-
*/
|
|
591
|
-
url: string;
|
|
592
|
-
} | {
|
|
558
|
+
name: TName;
|
|
593
559
|
/**
|
|
594
|
-
*
|
|
560
|
+
* 菜单项类型
|
|
595
561
|
*/
|
|
596
|
-
|
|
562
|
+
type: EditorMenuItemType;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
/**
|
|
566
|
+
* 按钮菜单项配置
|
|
567
|
+
*/
|
|
568
|
+
export declare interface EditorMenuButtonMenuItemConfig<TName extends string> extends EditorMenuBaseMenuItemConfig<TName> {
|
|
569
|
+
type: 'button';
|
|
597
570
|
/**
|
|
598
|
-
*
|
|
571
|
+
* 是否禁用菜单项,禁用后菜单项依旧显示不过变为灰色,不可点击
|
|
599
572
|
*/
|
|
600
|
-
|
|
573
|
+
disabled?: boolean;
|
|
601
574
|
/**
|
|
602
|
-
*
|
|
575
|
+
* 菜单项显示文本,修改该值可以替换此菜单项默认显示文案
|
|
603
576
|
*/
|
|
604
|
-
label
|
|
577
|
+
label?: string;
|
|
605
578
|
/**
|
|
606
|
-
*
|
|
579
|
+
* 菜单项图标,可以是 base64 的图片信息,也可以是图片 url
|
|
580
|
+
* 配置为空字符串则可以隐藏菜单项默认的图标
|
|
607
581
|
*/
|
|
608
582
|
icon?: string;
|
|
609
583
|
/**
|
|
610
|
-
*
|
|
584
|
+
* 菜单项点击事件,接受一个函数,可以自定义点击事件
|
|
611
585
|
*/
|
|
612
|
-
callback
|
|
613
|
-
}
|
|
586
|
+
callback?: () => void;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
/**
|
|
590
|
+
* 编辑器菜单配置类型
|
|
591
|
+
* 联合类型,表示可以是任意一种菜单项配置
|
|
592
|
+
*/
|
|
593
|
+
export declare type EditorMenuEntryConfig<TName extends string> = EditorMenuHiddenMenuItemConfig<TName> | EditorMenuButtonMenuItemConfig<TName> | EditorMenuLinkMenuItemConfig<TName> | EditorMenuEntryMenuItemConfig<TName>;
|
|
614
594
|
|
|
615
595
|
/**
|
|
616
|
-
*
|
|
596
|
+
* 子菜单入口配置
|
|
617
597
|
*/
|
|
618
|
-
export declare interface
|
|
598
|
+
export declare interface EditorMenuEntryMenuItemConfig<TName extends string> extends EditorMenuBaseMenuItemConfig<TName> {
|
|
619
599
|
type: 'entry';
|
|
620
600
|
/**
|
|
621
|
-
*
|
|
601
|
+
* 是否禁用菜单项,禁用后菜单项依旧显示不过变为灰色,不可点击
|
|
622
602
|
*/
|
|
623
|
-
|
|
603
|
+
disabled?: boolean;
|
|
604
|
+
/**
|
|
605
|
+
* 菜单项显示文本,修改该值可以替换此菜单项默认显示文案
|
|
606
|
+
*/
|
|
607
|
+
label?: string;
|
|
624
608
|
/**
|
|
625
|
-
*
|
|
609
|
+
* 菜单项图标,可以是 base64 的图片信息,也可以是图片 url
|
|
610
|
+
* 配置为空字符串则可以隐藏菜单项默认的图标
|
|
626
611
|
*/
|
|
627
612
|
icon?: string;
|
|
628
613
|
/**
|
|
629
|
-
*
|
|
614
|
+
* 下一级菜单配置,下一级菜单配置项和上一级相同
|
|
615
|
+
* 如果下一级仍然是 entry 类型,可以无限向下扩展
|
|
630
616
|
*/
|
|
631
|
-
children?:
|
|
617
|
+
children?: EditorMenuEntryConfig<TName>[];
|
|
632
618
|
}
|
|
633
619
|
|
|
634
620
|
/**
|
|
635
|
-
*
|
|
636
|
-
* 一级菜单在鼠标悬停时展示二级列表
|
|
621
|
+
* 菜单功能按钮配置
|
|
637
622
|
*/
|
|
638
|
-
export declare interface
|
|
623
|
+
export declare interface EditorMenuFeatureConfig {
|
|
639
624
|
/**
|
|
640
|
-
*
|
|
625
|
+
* 是否隐藏菜单项,设置为true则隐藏菜单项
|
|
641
626
|
*/
|
|
642
|
-
|
|
643
|
-
/**
|
|
644
|
-
* 二级菜单定义,定一个二维数组,用于定义二级菜单的结构,
|
|
645
|
-
* 将第一层数组中的所有按钮放到一个区域内用分隔符隔开,
|
|
646
|
-
* 第二层数组为按钮的定义,可以是功能按钮也可以是一个下拉入口。
|
|
647
|
-
*/
|
|
648
|
-
children: Array<EditorMenuFeatureButton<TName> | EditorMenuEntryButton<TName>>[];
|
|
627
|
+
hidden?: boolean;
|
|
649
628
|
/**
|
|
650
|
-
*
|
|
629
|
+
* 是否禁用菜单项,设置为true则变为灰色不可点击
|
|
651
630
|
*/
|
|
652
|
-
|
|
631
|
+
disabled?: boolean;
|
|
653
632
|
}
|
|
654
633
|
|
|
655
634
|
/**
|
|
656
|
-
*
|
|
635
|
+
* 菜单功能按钮配置
|
|
657
636
|
*/
|
|
658
|
-
export declare
|
|
637
|
+
export declare interface EditorMenuFeatureConfig {
|
|
659
638
|
/**
|
|
660
|
-
*
|
|
639
|
+
* 是否隐藏菜单项,设置为true则隐藏菜单项
|
|
661
640
|
*/
|
|
662
|
-
|
|
641
|
+
hidden?: boolean;
|
|
663
642
|
/**
|
|
664
|
-
*
|
|
643
|
+
* 是否禁用菜单项,设置为true则变为灰色不可点击
|
|
665
644
|
*/
|
|
666
|
-
|
|
667
|
-
}
|
|
668
|
-
|
|
645
|
+
disabled?: boolean;
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
/**
|
|
649
|
+
* 隐藏菜单项配置
|
|
650
|
+
*/
|
|
651
|
+
export declare interface EditorMenuHiddenMenuItemConfig<TName extends string> extends EditorMenuBaseMenuItemConfig<TName> {
|
|
652
|
+
type: 'hidden';
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
/**
|
|
656
|
+
* 菜单项类型
|
|
657
|
+
*/
|
|
658
|
+
export declare type EditorMenuItemType = 'hidden' | 'button' | 'link' | 'entry';
|
|
659
|
+
|
|
660
|
+
/**
|
|
661
|
+
* 链接菜单项配置
|
|
662
|
+
*/
|
|
663
|
+
export declare interface EditorMenuLinkMenuItemConfig<TName extends string> extends EditorMenuBaseMenuItemConfig<TName> {
|
|
664
|
+
type: 'link';
|
|
669
665
|
/**
|
|
670
|
-
*
|
|
666
|
+
* 是否禁用菜单项,禁用后菜单项依旧显示不过变为灰色,不可点击
|
|
671
667
|
*/
|
|
672
|
-
|
|
668
|
+
disabled?: boolean;
|
|
673
669
|
/**
|
|
674
|
-
*
|
|
670
|
+
* 菜单项显示文本,修改该值可以替换此菜单项默认显示文案
|
|
675
671
|
*/
|
|
676
|
-
|
|
672
|
+
text?: string;
|
|
677
673
|
/**
|
|
678
|
-
*
|
|
674
|
+
* 菜单项图标,可以是 base64 的图片信息,也可以是图片 url
|
|
675
|
+
* 配置为空字符串则可以隐藏菜单项默认的图标
|
|
679
676
|
*/
|
|
680
677
|
icon?: string;
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
export declare type EditorMenuFeatureButtonConfig<TName extends string> = Record<TName, EditorMenuFeatureButton<TName>>;
|
|
678
|
+
/**
|
|
679
|
+
* 跳转链接地址
|
|
680
|
+
*/
|
|
681
|
+
url?: string;
|
|
682
|
+
}
|
|
687
683
|
|
|
688
684
|
/**
|
|
689
685
|
* 菜单栏相关配置,目前菜单栏不是所有套件都支持,
|
|
@@ -691,25 +687,26 @@ export declare type EditorMenuFeatureButtonConfig<TName extends string> = Record
|
|
|
691
687
|
*/
|
|
692
688
|
export declare interface EditorMenuOptions<TName extends string> {
|
|
693
689
|
/**
|
|
694
|
-
*
|
|
690
|
+
* 菜单栏是否隐藏,设置为true, 则整个菜单栏不显示
|
|
695
691
|
*/
|
|
696
692
|
hidden?: boolean;
|
|
697
693
|
/**
|
|
698
|
-
*
|
|
694
|
+
* 是否禁用菜单栏所有功能。设置为true,菜单栏依旧显示,但所有菜单项为灰色不可点击
|
|
699
695
|
*/
|
|
700
696
|
disabled?: boolean;
|
|
701
697
|
/**
|
|
702
|
-
*
|
|
698
|
+
* 菜单栏一级菜单配置,指显示在菜单栏上的菜单项。
|
|
703
699
|
*/
|
|
704
700
|
entries?: EditorMenuEntryConfig<TName>[];
|
|
705
701
|
/**
|
|
706
702
|
* 菜单栏功能按钮配置
|
|
703
|
+
* TODO 此配置目前没有用到,后续看是保留还是和custom合并
|
|
707
704
|
*/
|
|
708
|
-
features?:
|
|
705
|
+
features?: Record<TName, EditorMenuFeatureConfig>;
|
|
709
706
|
/**
|
|
710
707
|
* 自定义按钮配置
|
|
711
708
|
*/
|
|
712
|
-
custom?:
|
|
709
|
+
custom?: (EditorMenuButtonMenuItemConfig<string> | EditorMenuLinkMenuItemConfig<string>)[];
|
|
713
710
|
}
|
|
714
711
|
|
|
715
712
|
/**
|
|
@@ -1072,43 +1069,15 @@ export declare interface EditorTextOptions<Color = string> {
|
|
|
1072
1069
|
}
|
|
1073
1070
|
|
|
1074
1071
|
/**
|
|
1075
|
-
*
|
|
1076
|
-
*/
|
|
1077
|
-
export declare interface EditorToolbarCustomButton extends Omit<EditorToolbarFeatureButton, 'name'> {
|
|
1078
|
-
/**
|
|
1079
|
-
* 自定义按钮名称
|
|
1080
|
-
*/
|
|
1081
|
-
name: string;
|
|
1082
|
-
/**
|
|
1083
|
-
* 按钮点击事件
|
|
1084
|
-
*/
|
|
1085
|
-
callback: () => void;
|
|
1086
|
-
/**
|
|
1087
|
-
* 按钮在工具栏中的位置,默认添加到工具栏所有按钮后面
|
|
1088
|
-
*/
|
|
1089
|
-
index?: number;
|
|
1090
|
-
}
|
|
1091
|
-
|
|
1092
|
-
/**
|
|
1093
|
-
* 工具栏自定义按钮配置
|
|
1094
|
-
*/
|
|
1095
|
-
export declare interface EditorToolbarCustomButtonConfig {
|
|
1096
|
-
/**
|
|
1097
|
-
* 按钮配置
|
|
1098
|
-
*/
|
|
1099
|
-
[key: string]: EditorToolbarCustomButton;
|
|
1100
|
-
}
|
|
1101
|
-
|
|
1102
|
-
/**
|
|
1103
|
-
* 工具栏内置功能按钮配置
|
|
1072
|
+
* 工具栏功能按钮配置(包括内置按钮和自定义按钮)
|
|
1104
1073
|
*/
|
|
1105
|
-
export declare interface EditorToolbarFeatureButton<
|
|
1074
|
+
export declare interface EditorToolbarFeatureButton<TName extends string> {
|
|
1106
1075
|
/**
|
|
1107
|
-
*
|
|
1076
|
+
* 按钮的唯一标识,用以确定配置的是哪个按钮。
|
|
1108
1077
|
*/
|
|
1109
|
-
name:
|
|
1078
|
+
name: TName;
|
|
1110
1079
|
/**
|
|
1111
|
-
*
|
|
1080
|
+
* 按钮标签(显示文本)一般工具栏上的按钮不会显示文本,如果需要显示文本,配置此项。
|
|
1112
1081
|
*/
|
|
1113
1082
|
label?: string;
|
|
1114
1083
|
/**
|
|
@@ -1116,63 +1085,38 @@ export declare interface EditorToolbarFeatureButton<ToolButtonName extends strin
|
|
|
1116
1085
|
*/
|
|
1117
1086
|
icon?: string;
|
|
1118
1087
|
/**
|
|
1119
|
-
*
|
|
1088
|
+
* 按钮是否隐藏,设置为true则隐藏按钮
|
|
1120
1089
|
*/
|
|
1121
1090
|
hidden?: boolean;
|
|
1122
1091
|
/**
|
|
1123
|
-
*
|
|
1092
|
+
* 按钮是否禁用,设置为true则变为灰色不可点击
|
|
1124
1093
|
*/
|
|
1125
1094
|
disabled?: boolean;
|
|
1126
1095
|
/**
|
|
1127
|
-
*
|
|
1096
|
+
* 按钮点击事件.接受一个函数,可以自定义点击事件。
|
|
1097
|
+
*/
|
|
1098
|
+
callback?: () => void;
|
|
1099
|
+
/**
|
|
1100
|
+
* 按钮提示文本,鼠标悬浮到按钮上时显示的tooltip文字
|
|
1128
1101
|
*/
|
|
1129
1102
|
tooltip?: string;
|
|
1103
|
+
/**
|
|
1104
|
+
* 按钮在工具栏中位置,不设置则按照默认位置
|
|
1105
|
+
*/
|
|
1106
|
+
index?: number;
|
|
1130
1107
|
}
|
|
1131
1108
|
|
|
1132
1109
|
/**
|
|
1133
1110
|
* 工具栏内置功能按钮配置
|
|
1134
1111
|
*/
|
|
1135
|
-
export declare type EditorToolbarFeatureButtonConfig<
|
|
1136
|
-
[key in
|
|
1112
|
+
export declare type EditorToolbarFeatureButtonConfig<TName extends string> = {
|
|
1113
|
+
[key in TName]?: EditorToolbarFeatureButton<key>;
|
|
1137
1114
|
};
|
|
1138
1115
|
|
|
1139
|
-
/**
|
|
1140
|
-
* 工具栏内置功能按钮
|
|
1141
|
-
*/
|
|
1142
|
-
export declare type EditorToolbarFeatureButtonName =
|
|
1143
|
-
/**
|
|
1144
|
-
* 加粗
|
|
1145
|
-
*/
|
|
1146
|
-
'bold'
|
|
1147
|
-
/**
|
|
1148
|
-
* 斜体
|
|
1149
|
-
*/
|
|
1150
|
-
| 'italic'
|
|
1151
|
-
/**
|
|
1152
|
-
* 下划线
|
|
1153
|
-
*/
|
|
1154
|
-
| 'underline'
|
|
1155
|
-
/**
|
|
1156
|
-
* 删除线
|
|
1157
|
-
*/
|
|
1158
|
-
| 'strikethrough'
|
|
1159
|
-
/**
|
|
1160
|
-
* 插入图片
|
|
1161
|
-
*/
|
|
1162
|
-
| 'insertImage'
|
|
1163
|
-
/**
|
|
1164
|
-
* 插入链接
|
|
1165
|
-
*/
|
|
1166
|
-
| 'insertLink'
|
|
1167
|
-
/**
|
|
1168
|
-
* 限制编辑
|
|
1169
|
-
*/
|
|
1170
|
-
| 'restriction';
|
|
1171
|
-
|
|
1172
1116
|
/**
|
|
1173
1117
|
* 工具栏相关设置,可以控制工具栏的显示内容
|
|
1174
1118
|
*/
|
|
1175
|
-
export declare interface EditorToolbarOptions<
|
|
1119
|
+
export declare interface EditorToolbarOptions<TName extends string> {
|
|
1176
1120
|
/**
|
|
1177
1121
|
* 控制工具栏显隐状态
|
|
1178
1122
|
*/
|
|
@@ -1184,11 +1128,11 @@ export declare interface EditorToolbarOptions<ToolButtonName extends string = Ed
|
|
|
1184
1128
|
/**
|
|
1185
1129
|
* 现有按钮的功能配置
|
|
1186
1130
|
*/
|
|
1187
|
-
features?: EditorToolbarFeatureButtonConfig<
|
|
1131
|
+
features?: EditorToolbarFeatureButtonConfig<TName>;
|
|
1188
1132
|
/**
|
|
1189
1133
|
* 自定义按钮
|
|
1190
1134
|
*/
|
|
1191
|
-
custom?:
|
|
1135
|
+
custom?: EditorToolbarFeatureButtonConfig<string>;
|
|
1192
1136
|
}
|
|
1193
1137
|
|
|
1194
1138
|
export declare type EditorUploadableFile = EditorLocalUploadableFile;
|