@officesdk/editor-sdk-core 0.0.0-alpha.8 → 0.0.1

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.
Files changed (112) hide show
  1. package/cjs/docs/comments.js +3 -0
  2. package/cjs/docs/discuss.js +3 -0
  3. package/cjs/docs/index.js +1 -1
  4. package/cjs/docs/outline.js +3 -0
  5. package/cjs/docs/sdk.js +1 -1
  6. package/cjs/docs/sidebar.js +3 -0
  7. package/cjs/docs/theme.js +3 -0
  8. package/cjs/docx/sdk.js +1 -1
  9. package/cjs/docx/theme.js +1 -1
  10. package/cjs/form/sdk.js +1 -1
  11. package/cjs/form/ui.js +1 -1
  12. package/cjs/presentation/index.js +1 -1
  13. package/cjs/presentation/sdk.js +1 -1
  14. package/cjs/presentation/slide-theme.js +3 -0
  15. package/cjs/presentation/theme.js +1 -1
  16. package/cjs/shared/attachment.js +11 -1
  17. package/cjs/shared/editor.js +1 -1
  18. package/cjs/shared/file-picker.js +1 -1
  19. package/cjs/shared/fonts.js +16 -1
  20. package/cjs/shared/history.js +1 -1
  21. package/cjs/shared/http.js +1 -1
  22. package/cjs/shared/i18n.js +1 -1
  23. package/cjs/shared/index.js +4 -2
  24. package/cjs/shared/spell-check.js +3 -0
  25. package/cjs/shared/theme/base-types.js +1 -1
  26. package/cjs/shared/theme/components/dropdown.js +1 -1
  27. package/cjs/shared/theme/components/index.js +2 -1
  28. package/cjs/shared/theme/components/input.js +1 -1
  29. package/cjs/shared/theme/components/menu.js +3 -0
  30. package/cjs/shared/theme/components/slider.js +1 -1
  31. package/cjs/shared/theme/components/tab.js +1 -1
  32. package/cjs/shared/theme/components/toast.js +1 -1
  33. package/cjs/shared/theme/components/toolbar-button.js +1 -1
  34. package/cjs/shared/theme/components/tooltip.js +1 -1
  35. package/cjs/shared/theme/index.js +1 -1
  36. package/cjs/shared/toolbar.js +1 -1
  37. package/cjs/shared/version.js +1 -1
  38. package/cjs/sheet/form.js +1 -1
  39. package/cjs/sheet/history.js +1 -1
  40. package/cjs/sheet/index.js +1 -1
  41. package/cjs/sheet/render.js +1 -1
  42. package/cjs/sheet/sdk.js +1 -1
  43. package/cjs/sheet/sheet-tab.js +1 -1
  44. package/cjs/table/field.js +1 -1
  45. package/cjs/table/history.js +1 -1
  46. package/cjs/table/index.js +1 -1
  47. package/cjs/table/record.js +3 -0
  48. package/cjs/table/sdk.js +1 -1
  49. package/cjs/table/snapshot.js +1 -1
  50. package/cjs/table/view.js +1 -1
  51. package/esm/docs/comments.js +2 -0
  52. package/esm/docs/discuss.js +2 -0
  53. package/esm/docs/index.js +1 -1
  54. package/esm/docs/outline.js +2 -0
  55. package/esm/docs/sdk.js +1 -1
  56. package/esm/docs/sidebar.js +2 -0
  57. package/esm/docs/theme.js +2 -0
  58. package/esm/docx/sdk.js +1 -1
  59. package/esm/docx/theme.js +1 -1
  60. package/esm/form/sdk.js +1 -1
  61. package/esm/form/ui.js +1 -1
  62. package/esm/presentation/index.js +1 -1
  63. package/esm/presentation/sdk.js +1 -1
  64. package/esm/presentation/slide-theme.js +2 -0
  65. package/esm/presentation/theme.js +1 -1
  66. package/esm/shared/attachment.js +10 -2
  67. package/esm/shared/editor.js +1 -1
  68. package/esm/shared/file-picker.js +1 -1
  69. package/esm/shared/fonts.js +15 -2
  70. package/esm/shared/history.js +1 -1
  71. package/esm/shared/http.js +1 -1
  72. package/esm/shared/i18n.js +1 -1
  73. package/esm/shared/index.js +2 -1
  74. package/esm/shared/spell-check.js +2 -0
  75. package/esm/shared/theme/base-types.js +1 -1
  76. package/esm/shared/theme/components/dropdown.js +1 -1
  77. package/esm/shared/theme/components/index.js +2 -1
  78. package/esm/shared/theme/components/input.js +1 -1
  79. package/esm/shared/theme/components/menu.js +2 -0
  80. package/esm/shared/theme/components/slider.js +1 -1
  81. package/esm/shared/theme/components/tab.js +1 -1
  82. package/esm/shared/theme/components/toast.js +1 -1
  83. package/esm/shared/theme/components/toolbar-button.js +1 -1
  84. package/esm/shared/theme/components/tooltip.js +1 -1
  85. package/esm/shared/theme/index.js +1 -1
  86. package/esm/shared/toolbar.js +1 -1
  87. package/esm/shared/version.js +1 -1
  88. package/esm/sheet/form.js +1 -1
  89. package/esm/sheet/history.js +1 -1
  90. package/esm/sheet/index.js +1 -1
  91. package/esm/sheet/render.js +1 -1
  92. package/esm/sheet/sdk.js +1 -1
  93. package/esm/sheet/sheet-tab.js +1 -1
  94. package/esm/table/field.js +1 -1
  95. package/esm/table/history.js +1 -1
  96. package/esm/table/index.js +1 -1
  97. package/esm/table/record.js +2 -0
  98. package/esm/table/sdk.js +1 -1
  99. package/esm/table/snapshot.js +1 -1
  100. package/esm/table/view.js +1 -1
  101. package/package.json +1 -1
  102. package/types/combine.d.ts +975 -115
  103. package/types/diagram.d.ts +520 -82
  104. package/types/docs.d.ts +718 -78
  105. package/types/docx.d.ts +522 -84
  106. package/types/form.d.ts +529 -89
  107. package/types/mindmap.d.ts +520 -82
  108. package/types/pdf.d.ts +520 -82
  109. package/types/presentation.d.ts +599 -89
  110. package/types/shared.d.ts +520 -82
  111. package/types/sheet.d.ts +579 -105
  112. package/types/table.d.ts +632 -82
package/types/table.d.ts CHANGED
@@ -1,3 +1,17 @@
1
+ /**
2
+ * 编辑文件检查器
3
+ */
4
+ export declare abstract class AbstractedEditorFileChecker {
5
+ /**
6
+ * 检查文件是否符合限制
7
+ * @param files
8
+ * @returns 返回符合的files
9
+ */
10
+ check?: (files: EditorPickedFile[], options?: {
11
+ type: 'image' | 'video' | 'audio' | 'attachment';
12
+ }) => EditorPickedFile[];
13
+ }
14
+
1
15
  export declare abstract class AbstractedEditorFileUploader {
2
16
  /**
3
17
  * 开始上传
@@ -164,6 +178,12 @@ export declare interface BorderColors {
164
178
  disabled: string;
165
179
  }
166
180
 
181
+ export declare interface BorderConfig {
182
+ color?: string;
183
+ radius?: string;
184
+ width?: string;
185
+ }
186
+
167
187
  /** 圆角配置 */
168
188
  export declare interface BorderRadiusConfig {
169
189
  /** 无圆角 0px */
@@ -220,6 +240,8 @@ export declare interface ButtonBaseSizeStyles {
220
240
  borderRadius: string;
221
241
  /** 字重 */
222
242
  fontWeight: string | number;
243
+ /** 间距 */
244
+ gap?: string;
223
245
  }
224
246
 
225
247
  /** Button 完整配置 */
@@ -438,12 +460,16 @@ export declare interface CommonThemeConfig {
438
460
  radio: RadioConfig;
439
461
  /** 复选框 */
440
462
  checkbox: CheckboxConfig;
463
+ /** 下拉框 */
464
+ dropdown: DropdownConfig;
465
+ /** 下拉框按钮 */
466
+ dropdownButton: DropdownButtonConfig;
467
+ /** 菜单 */
468
+ menu: MenuConfig;
441
469
  /** 开关 */
442
470
  switch: SwitchConfig;
443
471
  /** 按钮 */
444
472
  button: ButtonConfig;
445
- /** 下拉框 */
446
- dropdown: DropdownConfig;
447
473
  /** 标签页 */
448
474
  tab: TabConfig;
449
475
  /** 滑块 */
@@ -529,82 +555,65 @@ export declare interface DecorateColors {
529
555
  april: string;
530
556
  }
531
557
 
532
- /** Dropdown 箭头图标配置 */
533
- export declare interface DropdownArrowIconConfig extends IconConfig {
534
- /** 展开状态旋转角度 */
535
- expandedRotateAngel: string;
536
- }
537
-
538
- /** Dropdown 完整配置 */
539
- export declare interface DropdownConfig {
540
- /** 图标配置集合 */
541
- icons: DropdownIconsConfig;
542
- /** 普通下拉框(按钮触发器) */
543
- button: DropdownVariantStyles;
544
- /** 输入框下拉框(输入框触发器) */
545
- input: DropdownVariantStyles;
546
- /** 大尺寸配置 */
547
- large: DropdownSizeStyles;
548
- }
549
-
550
- /** Dropdown 图标集合配置 */
551
- export declare interface DropdownIconsConfig {
552
- /** 下拉箭头图标 */
553
- arrow: DropdownArrowIconConfig;
554
- /** 选中图标 */
555
- check: IconConfig;
558
+ /** Dropdown 按钮配置 */
559
+ export declare interface DropdownButtonConfig {
560
+ /** 颜色 */
561
+ color: StateStyles;
562
+ /** 背景 */
563
+ background: StateStyles;
564
+ /** 无边框背景 */
565
+ frameLessBackground: StateStyles;
566
+ /** 边框颜色 */
567
+ borderColor: StateStyles;
568
+ /** 图标 */
569
+ icon: {
570
+ size: IconSize;
571
+ /** 透明度 */
572
+ opacity: StateStyles;
573
+ };
574
+ /** 指示器 */
575
+ indicator: IconConfig & {
576
+ /** 旋转角度 */
577
+ rotate: string;
578
+ /** 透明度 */
579
+ opacity: StateStyles;
580
+ };
581
+ /** 尺寸 */
582
+ size: {
583
+ /** 大尺寸 */
584
+ large: DropdownButtonSizeStyles;
585
+ /** 中尺寸 */
586
+ medium: DropdownButtonSizeStyles;
587
+ /** 小尺寸 */
588
+ small: DropdownButtonSizeStyles;
589
+ };
556
590
  }
557
591
 
558
- /** Dropdown 菜单项样式 */
559
- export declare interface DropdownMenuItemStyles extends Omit<BackgroundStateStyles, 'backgroundActive'> {
560
- /** 选中背景 */
561
- backgroundSelected: string;
562
- /** 文字颜色 */
563
- color: string;
564
- /** 禁用文字颜色 */
565
- colorDisabled: string;
566
- /** 菜单项内边距 */
592
+ /** Dropdown 按钮尺寸 */
593
+ export declare interface DropdownButtonSizeStyles {
567
594
  padding: string;
568
- }
569
-
570
- /** Dropdown 菜单容器样式 */
571
- export declare interface DropdownMenuStyles {
572
- /** 背景色 */
573
- background: string;
574
- /** 边框色 */
575
- borderColor: string;
576
- /** 圆角 */
595
+ fontSize: string;
596
+ height: string;
597
+ gap: string;
577
598
  borderRadius: string;
578
- /** 内边距 */
579
- padding: string;
580
- /** 阴影 */
581
- boxShadow: string;
582
- /** 最大高度 */
583
- maxHeight: string;
584
- }
585
-
586
- /** Dropdown 尺寸配置 */
587
- export declare interface DropdownSizeStyles extends ButtonBaseSizeStyles {
588
- /** 图标尺寸 */
589
599
  iconSize: IconSize;
600
+ indicatorSize: IconSize;
590
601
  }
591
602
 
592
- /** Dropdown 触发器样式(按钮或输入框触发器) */
593
- export declare interface DropdownTriggerStyles extends BorderStateStyles, BackgroundStateStyles, ShadowStateStyles {
594
- /** 文字颜色 */
595
- color: string;
596
- /** 禁用文字颜色 */
597
- colorDisabled: string;
598
- }
599
-
600
- /** Dropdown 变体样式 */
601
- export declare interface DropdownVariantStyles {
602
- /** 触发器样式 */
603
- trigger: DropdownTriggerStyles;
604
- /** 菜单容器样式 */
605
- menu: DropdownMenuStyles;
606
- /** 菜单项样式 */
607
- menuItem: DropdownMenuItemStyles;
603
+ /**
604
+ * Dropdown 下拉框配置
605
+ */
606
+ export declare interface DropdownConfig {
607
+ /** 阴影 */
608
+ boxShadow: string;
609
+ /** 内边距 */
610
+ padding: string;
611
+ /** 圆角 */
612
+ borderRadius: string;
613
+ /** 边框 */
614
+ border: string;
615
+ /** 背景 */
616
+ background: string;
608
617
  }
609
618
 
610
619
  /**
@@ -823,6 +832,10 @@ export declare interface EditorAttachmentOptions {
823
832
  * 附件选择器
824
833
  */
825
834
  picker?: EditorFilePicker;
835
+ /**
836
+ * 文件检查器
837
+ */
838
+ checker?: AbstractedEditorFileChecker;
826
839
  /**
827
840
  * 附件上传器
828
841
  */
@@ -1255,6 +1268,14 @@ export declare type EditorContextMenuOptions<TName extends string> = EditorMenuO
1255
1268
  */
1256
1269
  export declare type EditorCopyOptions = EditorLogicFeatureConfig;
1257
1270
 
1271
+ /**
1272
+ * 日期格式
1273
+ * - `YYYY/MM/DD` 年/月/日(简繁中文、韩语、日语默认)
1274
+ * - `MM/DD/YYYY` 月/日/年(英语默认)
1275
+ * - `DD/MM/YYYY` 日/月/年(其他语言默认)
1276
+ */
1277
+ export declare type EditorDateFormat = 'YYYY/MM/DD' | 'MM/DD/YYYY' | 'DD/MM/YYYY';
1278
+
1258
1279
  /**
1259
1280
  * 编辑器解密选项接口
1260
1281
  * 用于配置编辑器中需要解密的内容的相关选项
@@ -1432,11 +1453,31 @@ export declare interface EditorFilePicker {
1432
1453
  }
1433
1454
 
1434
1455
  export declare interface EditorFilePickerOpenOptions {
1456
+ /**
1457
+ * 文件类型限制
1458
+ */
1435
1459
  mimeTypes?: string[];
1460
+ /**
1461
+ * 最大文件尺寸限制
1462
+ */
1436
1463
  maxSize?: number;
1464
+ /**
1465
+ * 文件后缀限制
1466
+ */
1437
1467
  extensions?: string[];
1468
+ /**
1469
+ * 是否支持多选
1470
+ */
1438
1471
  multiple?: boolean;
1472
+ /**
1473
+ * 是否为选择文件夹
1474
+ */
1439
1475
  directory?: boolean;
1476
+ /**
1477
+ * 文件选择器接受的文件类型,如 'image/*' 表示接受所有图片文件
1478
+ * 如果指定了该配置,则不会再由extensions生成accept
1479
+ */
1480
+ accept?: string;
1440
1481
  }
1441
1482
 
1442
1483
  export declare interface EditorFollowMode {
@@ -1549,9 +1590,32 @@ export declare interface EditorFontsOptions {
1549
1590
  */
1550
1591
  list?: EditorFontsList;
1551
1592
  /**
1552
- * 是否只使用本地字体,如果为 true,则不会从服务器获取字体列表。
1593
+ * 字体列表中隐藏不可用的字体,包含外部传入的以及各套件内置的字体
1594
+ * 不可用的定义:非本地已安装且不支持下载
1595
+ */
1596
+ hideUnavailableFonts?: boolean;
1597
+ /**
1598
+ * 字体下载监听器注册函数,当字体状态发生变化时调用提供的回调函数。
1599
+ * 回调函数暂时没有参数,后续可以根据需要添加参数,例如提供变化的字体信息等。
1600
+ * @param listener
1601
+ * @returns
1553
1602
  */
1554
- useLocalFontsOnly?: boolean;
1603
+ registerFontLoadListener?: (listener: (options: FontLoadListenerOptions) => void) => void;
1604
+ /**
1605
+ * 下载字体的函数,接受字体族名称和一个可选的配置对象作为参数。
1606
+ * 配置对象可以包含以下回调函数:
1607
+ * - onProgress: 在下载过程中调用,提供下载进度(0 到 1 之间的数字)。
1608
+ * - onComplete: 在下载完成时调用。
1609
+ * - onError: 在下载过程中发生错误时调用,提供错误对象。
1610
+ * @param fontFamily
1611
+ * @param option
1612
+ * @returns
1613
+ */
1614
+ download?: (fontFamily: string, option?: {
1615
+ onProgress?: (progress: number) => void;
1616
+ onComplete?: () => void;
1617
+ onError?: (error: Error) => void;
1618
+ }) => void;
1555
1619
  }
1556
1620
 
1557
1621
  /**
@@ -1579,20 +1643,61 @@ export declare interface EditorHistory {
1579
1643
  hide: () => void;
1580
1644
  }
1581
1645
 
1582
- export declare type EditorHistoryOptions = EditorFeatureConfig;
1646
+ export declare interface EditorHistoryLimitations {
1647
+ /** 单个文件可还原的最近历史记录数量 */
1648
+ getHistoryLimitRevertNum?: () => number | undefined;
1649
+ /** 文件历史保留天数 */
1650
+ getHistoryLimitAllTime?: () => number | undefined;
1651
+ }
1652
+
1653
+ export declare type EditorHistoryOptions = EditorFeatureConfig & {
1654
+ limitations?: EditorHistoryLimitations;
1655
+ };
1583
1656
 
1584
1657
  /**
1585
1658
  * i18n 相关设置
1586
1659
  */
1587
1660
  export declare interface EditorI18nOptions {
1588
1661
  /**
1589
- * 语言,默认使用浏览器当前环境中的语言
1662
+ * 语言代码
1663
+ * 默认读取浏览器/设备语言并在支持的列表中匹配
1664
+ * 匹配规则:优先精确匹配,其次模糊匹配 language 部分,Fallback 为 en-US
1590
1665
  */
1591
- language?: string;
1666
+ language?: EditorLanguage;
1592
1667
  /**
1593
1668
  * 文本方向,默认根据语言自动适配
1594
1669
  */
1595
1670
  direction?: 'ltr' | 'rtl';
1671
+ /**
1672
+ * 时区设置(包含 ID、偏移量、标签)
1673
+ * 默认读取浏览器/设备时区,如无法匹配则根据语言推测
1674
+ * Fallback 为 { id: 'Europe/London', offset: 0, label: 'London' }
1675
+ */
1676
+ timezone?: EditorTimezoneInfo;
1677
+ /**
1678
+ * 日期格式
1679
+ * 默认根据语言自动匹配:
1680
+ * - 简繁中文、韩语、日语:YYYY/MM/DD
1681
+ * - 英语:MM/DD/YYYY
1682
+ * - 其他语言:DD/MM/YYYY
1683
+ * 用户手动设置后将保存并优先使用用户设置
1684
+ */
1685
+ dateFormat?: EditorDateFormat;
1686
+ /**
1687
+ * 时间格式
1688
+ * 默认使用 24 小时制
1689
+ * 注意:部分语言(如德语、法语、意大利语、俄语)不支持 12 小时制
1690
+ * 用户手动设置后将保存并优先使用用户设置
1691
+ */
1692
+ timeFormat?: EditorTimeFormat;
1693
+ /**
1694
+ * 周起始日
1695
+ * 默认根据语言自动匹配:
1696
+ * - 英语、阿拉伯语:星期日
1697
+ * - 其他语言:星期一
1698
+ * 用户手动设置后将保存并优先使用用户设置
1699
+ */
1700
+ weekStartDay?: EditorWeekStartDay;
1596
1701
  }
1597
1702
 
1598
1703
  export declare type EditorImageCropPoint = 'nw' | 'north' | 'ne' | 'west' | 'center' | 'east' | 'sw' | 'south' | 'se';
@@ -1637,6 +1742,27 @@ export declare interface EditorImportOptions {
1637
1742
  }>;
1638
1743
  }
1639
1744
 
1745
+ /**
1746
+ * 支持的语言代码
1747
+ * - `zh-CN` 简体中文
1748
+ * - `zh-TW` 繁体中文(含 zh-HK, zh-MO)
1749
+ * - `en-US` 英语
1750
+ * - `ja-JP` 日语
1751
+ * - `ko-KR` 韩语
1752
+ * - `es-ES` 西班牙语
1753
+ * - `pt-PT` 葡萄牙语
1754
+ * - `de-DE` 德语
1755
+ * - `fr-FR` 法语
1756
+ * - `it-IT` 意大利语
1757
+ * - `ru-RU` 俄语
1758
+ * - `id-ID` 印度尼西亚语
1759
+ * - `vi-VN` 越南语
1760
+ * - `th-TH` 泰语
1761
+ * - `ms-MY` 马来语
1762
+ * - `ar-SA` 阿拉伯语
1763
+ */
1764
+ export declare type EditorLanguage = 'zh-CN' | 'zh-TW' | 'en-US' | 'ja-JP' | 'ko-KR' | 'es-ES' | 'pt-PT' | 'de-DE' | 'fr-FR' | 'it-IT' | 'ru-RU' | 'id-ID' | 'vi-VN' | 'th-TH' | 'ms-MY' | 'ar-SA';
1765
+
1640
1766
  /**
1641
1767
  * 链接配置,抽象打开链接等操作
1642
1768
  */
@@ -2186,7 +2312,11 @@ export declare interface EditorOptions {
2186
2312
  /**
2187
2313
  * 编辑器主题相关设置
2188
2314
  */
2189
- theme: EditorThemeOptions;
2315
+ theme?: EditorThemeOptions;
2316
+ /**
2317
+ * 编辑器拼写检查相关设置
2318
+ */
2319
+ spellCheck?: EditorSpellCheckOptions;
2190
2320
  }
2191
2321
 
2192
2322
  /**
@@ -2506,6 +2636,49 @@ export declare interface EditorSocket {
2506
2636
  connected: boolean;
2507
2637
  }
2508
2638
 
2639
+ export declare interface EditorSpellCheckDictionaryFileConfig {
2640
+ /** 词典文件的 aff 文件路径 */
2641
+ aff: string;
2642
+ /** 词典文件的 dic 文件路径 */
2643
+ dic: string;
2644
+ }
2645
+
2646
+ /**
2647
+ * 拼写检查相关配置
2648
+ */
2649
+ export declare interface EditorSpellCheckOptions extends EditorFeatureConfig {
2650
+ /**
2651
+ * 拼写检查功能配置
2652
+ */
2653
+ spellCheck?: {
2654
+ /**
2655
+ * 拼写检查功能是否被禁用
2656
+ */
2657
+ disabled?: boolean;
2658
+ /**
2659
+ * 拼写检查所需要的字典文件 CDN 域名
2660
+ */
2661
+ dictionaryCDNHost?: string;
2662
+ /**
2663
+ * 自定义拼写检查词典, 用于覆盖内置的默认词典
2664
+ */
2665
+ customDictionary?: Partial<Record<EditorLanguage, EditorSpellCheckDictionaryFileConfig>>;
2666
+ };
2667
+ /**
2668
+ * 语法检查功能配置
2669
+ */
2670
+ grammarCheck?: {
2671
+ /**
2672
+ * 语法检查功能是否被禁用
2673
+ */
2674
+ disabled?: boolean;
2675
+ /**
2676
+ * 拼写检查API的URL,必须使用绝对路径
2677
+ */
2678
+ url?: string;
2679
+ };
2680
+ }
2681
+
2509
2682
  /**
2510
2683
  * 编辑器在 `standard` 模式下的权限模式
2511
2684
  * - `editor` 编辑模式
@@ -2648,6 +2821,59 @@ export declare interface EditorThemeOptions<TExtensions = object> extends Common
2648
2821
  extensions?: TExtensions;
2649
2822
  }
2650
2823
 
2824
+ /**
2825
+ * 时间格式
2826
+ * - `24h` 24 小时制(默认)
2827
+ * - `12h` 12 小时制(部分语言不支持)
2828
+ */
2829
+ export declare type EditorTimeFormat = '24h' | '12h';
2830
+
2831
+ /**
2832
+ * 支持的时区 IANA ID
2833
+ *
2834
+ * 覆盖范围: UTC-12 到 UTC+12,共 34 个全球主要城市时区
2835
+ *
2836
+ * 注意事项:
2837
+ * - 所有时区 ID 均为 IANA 时区数据库标准标识符
2838
+ * - Etc/GMT+12 表示 UTC-12(Etc/GMT 时区符号与 UTC 相反)
2839
+ * - 不包括已弃用或非标准时区标识符
2840
+ *
2841
+ * @see https://www.iana.org/time-zones
2842
+ */
2843
+ export declare type EditorTimezoneId = 'Etc/GMT+12' | 'Pacific/Pago_Pago' | 'Pacific/Honolulu' | 'America/Anchorage' | 'America/Los_Angeles' | 'America/Denver' | 'America/Mexico_City' | 'America/New_York' | 'America/Santiago' | 'America/Sao_Paulo' | 'Atlantic/South_Georgia' | 'Atlantic/Cape_Verde' | 'Europe/London' | 'Europe/Lisbon' | 'Europe/Paris' | 'Europe/Berlin' | 'Europe/Rome' | 'Europe/Madrid' | 'Africa/Cairo' | 'Europe/Moscow' | 'Asia/Riyadh' | 'Asia/Dubai' | 'Asia/Karachi' | 'Asia/Dhaka' | 'Asia/Bangkok' | 'Asia/Jakarta' | 'Asia/Ho_Chi_Minh' | 'Asia/Shanghai' | 'Asia/Kuala_Lumpur' | 'Asia/Tokyo' | 'Asia/Seoul' | 'Australia/Sydney' | 'Pacific/Guadalcanal' | 'Pacific/Auckland';
2844
+
2845
+ /**
2846
+ * 时区信息
2847
+ */
2848
+ export declare interface EditorTimezoneInfo {
2849
+ /**
2850
+ * IANA 时区 ID
2851
+ *
2852
+ * 标准的 IANA 时区数据库标识符
2853
+ *
2854
+ * @example 'Asia/Shanghai', 'America/New_York', 'Europe/London'
2855
+ */
2856
+ id: EditorTimezoneId;
2857
+ /**
2858
+ * UTC 偏移量(小时,标准时间)
2859
+ *
2860
+ * - 正数:东半球,如 `8` 表示 UTC+8(北京)
2861
+ * - 负数:西半球,如 `-5` 表示 UTC-5(纽约标准时间)
2862
+ * - 零:格林威治标准时间
2863
+ *
2864
+ * 注意:此值为标准时间,不包含夏令时调整
2865
+ */
2866
+ offset: number;
2867
+ /**
2868
+ * 时区标签(英文)
2869
+ *
2870
+ * 用于 UI 显示的城市或地区名称
2871
+ *
2872
+ * @example 'Shanghai', 'New York', 'London'
2873
+ */
2874
+ label: string;
2875
+ }
2876
+
2651
2877
  /**
2652
2878
  * 工具栏功能按钮配置(包括内置按钮和自定义按钮)
2653
2879
  */
@@ -2711,6 +2937,16 @@ export declare interface EditorToolbarOptions<TName extends string> {
2711
2937
  * 如果不配置则按照套件的默认方式挂载。
2712
2938
  */
2713
2939
  container?: HTMLElement;
2940
+ /**
2941
+ * 工具栏样式
2942
+ * 各套件可自行扩展,目前支持背景色配置
2943
+ */
2944
+ style?: {
2945
+ /**
2946
+ * 背景色
2947
+ */
2948
+ backgroundColor?: string;
2949
+ };
2714
2950
  }
2715
2951
 
2716
2952
  /**
@@ -2924,9 +3160,11 @@ export declare interface EditorUserOptions {
2924
3160
  export declare interface EditorVersion {
2925
3161
  /**
2926
3162
  * 保存版本
2927
- * @param name 版本名称
3163
+ * @param options 版本名称
2928
3164
  */
2929
- createRevision: (name?: string) => void;
3165
+ createRevision: (options?: string | {
3166
+ name: string;
3167
+ }) => void;
2930
3168
  /**
2931
3169
  * 显示版本(侧边栏或其他形式)
2932
3170
  * 区别于历史侧边栏,在应用表格里表现为打开历史侧边栏切换到版本 tab
@@ -2939,7 +3177,14 @@ export declare interface EditorVersion {
2939
3177
  hide?: () => void;
2940
3178
  }
2941
3179
 
2942
- export declare type EditorVersionOptions = EditorFeatureConfig;
3180
+ export declare interface EditorVersionLimitations {
3181
+ /** 单个文件可保存/还原的版本(快照)数量 */
3182
+ getHistoryLimitVersionNum?: () => number | undefined;
3183
+ }
3184
+
3185
+ export declare type EditorVersionOptions = EditorFeatureConfig & {
3186
+ limitations?: EditorVersionLimitations;
3187
+ };
2943
3188
 
2944
3189
  /**
2945
3190
  * 编辑器外部水印信息
@@ -2969,6 +3214,13 @@ export declare type EditorWatermarkResource = {
2969
3214
  url: string;
2970
3215
  };
2971
3216
 
3217
+ /**
3218
+ * 周起始日
3219
+ * - `sunday` 星期日(英语、阿拉伯语默认)
3220
+ * - `monday` 星期一(其他语言默认)
3221
+ */
3222
+ export declare type EditorWeekStartDay = 'sunday' | 'monday';
3223
+
2972
3224
  /**
2973
3225
  * 错误信息接口
2974
3226
  * 定义了表格组件中可能发生的错误信息结构
@@ -3053,6 +3305,35 @@ export declare interface FontFamilyConfig {
3053
3305
  base: string;
3054
3306
  }
3055
3307
 
3308
+ /**
3309
+ * 字体下载事件类型
3310
+ */
3311
+ export declare enum FontLoadEventType {
3312
+ DownloadStart = "downloadStart",
3313
+ DownloadProgress = "downloadProgress",
3314
+ DownloadComplete = "downloadComplete",
3315
+ DownloadError = "downloadError"
3316
+ }
3317
+
3318
+ /**
3319
+ * 字体下载事件监听器参数,根据事件类型提供不同的属性
3320
+ */
3321
+ export declare type FontLoadListenerOptions = {
3322
+ type: FontLoadEventType.DownloadStart;
3323
+ id: string;
3324
+ } | {
3325
+ type: FontLoadEventType.DownloadComplete;
3326
+ id: string;
3327
+ } | {
3328
+ type: FontLoadEventType.DownloadProgress;
3329
+ id: string;
3330
+ progress: number;
3331
+ } | {
3332
+ type: FontLoadEventType.DownloadError;
3333
+ id: string;
3334
+ error: Error;
3335
+ };
3336
+
3056
3337
  /** 字号配置 */
3057
3338
  export declare interface FontSizeConfig {
3058
3339
  /** 超小字号 */
@@ -3239,6 +3520,16 @@ export declare interface HTTPProxy {
3239
3520
  * @returns
3240
3521
  */
3241
3522
  create: (id: string) => Promise<HTTPProxy>;
3523
+ /**
3524
+ * 凭证更新器,用于套件内部主动发起更新凭证操作
3525
+ * 例如:页面可见性发生变化时,在pull请求发起之前
3526
+ */
3527
+ credentials?: {
3528
+ /**
3529
+ * 更新凭证
3530
+ */
3531
+ update: () => Promise<void>;
3532
+ };
3242
3533
  }
3243
3534
 
3244
3535
  /**
@@ -3438,6 +3729,8 @@ export declare interface InputStateColorStyles {
3438
3729
  textColorNormal: string;
3439
3730
  /** 禁用文字颜色 */
3440
3731
  textColorDisabled: string;
3732
+ /** 只读文字颜色 */
3733
+ textColorReadOnly: string;
3441
3734
  }
3442
3735
 
3443
3736
  /** Input 状态样式配置 */
@@ -3544,6 +3837,102 @@ export declare interface MentionInfo {
3544
3837
  top?: number;
3545
3838
  }
3546
3839
 
3840
+ /** 菜单配置 */
3841
+ export declare interface MenuConfig {
3842
+ /** 菜单项配置 */
3843
+ menuItem: MenuItemConfig;
3844
+ /** 子菜单 */
3845
+ subMenu: {
3846
+ /** 子菜单弹出位置偏移 */
3847
+ popupOffset: number[];
3848
+ };
3849
+ /** 边框 */
3850
+ border: BorderConfig;
3851
+ /** 阴影 */
3852
+ boxShadow: Pick<StateStyles, 'normal' | 'hover'>;
3853
+ /** 分割线 */
3854
+ divider: {
3855
+ background: string;
3856
+ height: string;
3857
+ margin: string;
3858
+ };
3859
+ /** 分组标题 */
3860
+ groupTitle: {
3861
+ fontSize: string;
3862
+ fontWeight: string;
3863
+ color: string;
3864
+ };
3865
+ }
3866
+
3867
+ /** 菜单项配置 */
3868
+ export declare interface MenuItemConfig {
3869
+ /** 背景 */
3870
+ background: {
3871
+ normal: string;
3872
+ hover: string;
3873
+ active: string;
3874
+ disabled: string;
3875
+ };
3876
+ /** 边框 */
3877
+ border: BorderConfig;
3878
+ /** 布局 */
3879
+ layout: {
3880
+ /** 内边距 */
3881
+ padding: string;
3882
+ /** 间距 */
3883
+ gap: string;
3884
+ };
3885
+ /** 图标 */
3886
+ icon: {
3887
+ size: IconSize;
3888
+ };
3889
+ /** 标签 */
3890
+ label: {
3891
+ /** 颜色 */
3892
+ color: StateStyles;
3893
+ };
3894
+ /** 描述文本 */
3895
+ description: {
3896
+ /** 颜色 */
3897
+ color: StateStyles;
3898
+ };
3899
+ /** 激活图标 */
3900
+ activeIcon: {
3901
+ url: string;
3902
+ };
3903
+ /** 下一级菜单图标 */
3904
+ nextLevelIcon: {
3905
+ url: string;
3906
+ };
3907
+ /** 尺寸 */
3908
+ size: {
3909
+ /** 小尺寸 */
3910
+ small: MenuItemSizeStyles;
3911
+ /** 中尺寸 */
3912
+ medium: MenuItemSizeStyles;
3913
+ /** 大尺寸 */
3914
+ large: MenuItemSizeStyles;
3915
+ };
3916
+ }
3917
+
3918
+ /** 菜单项尺寸样式 */
3919
+ export declare interface MenuItemSizeStyles {
3920
+ label: {
3921
+ fontSize: string;
3922
+ maxWidth: string;
3923
+ };
3924
+ description: {
3925
+ fontSize: string;
3926
+ maxWidth: string;
3927
+ };
3928
+ activeIcon: {
3929
+ size: IconSize;
3930
+ };
3931
+ nextLevelIcon: {
3932
+ size: IconSize;
3933
+ };
3934
+ }
3935
+
3547
3936
  /** 带透明度状态的图标配置 */
3548
3937
  export declare interface OpacityIconConfig extends IconConfig {
3549
3938
  /** 默认透明度 */
@@ -3890,6 +4279,7 @@ export declare interface SliderSizeStyles {
3890
4279
  thumbSize: string;
3891
4280
  /** 滑块偏移(距离边缘的间距) */
3892
4281
  thumbOffset: string;
4282
+ borderWidth: string;
3893
4283
  }
3894
4284
 
3895
4285
  /** Slider 滑块(圆点)样式 */
@@ -3904,6 +4294,8 @@ export declare interface SliderTrackStyles {
3904
4294
  backgroundDisabled: string;
3905
4295
  /** 已填充部分背景 */
3906
4296
  filledBackground: string;
4297
+ /** 已填充部分禁用状态背景 */
4298
+ filledBackgroundDisabled: string;
3907
4299
  /** 高度 */
3908
4300
  height: string;
3909
4301
  /** 宽度 */
@@ -3925,6 +4317,22 @@ export declare interface Speaker {
3925
4317
  avatar: string;
3926
4318
  }
3927
4319
 
4320
+ /** 通用状态样式 */
4321
+ export declare interface StateStyles {
4322
+ /** 默认颜色 */
4323
+ normal: string;
4324
+ /** 悬停文字颜色 */
4325
+ hover: string;
4326
+ /** 激活/聚焦文字颜色 */
4327
+ active: string;
4328
+ /** 禁用文字颜色 */
4329
+ disabled: string;
4330
+ /** 只读颜色 */
4331
+ readonly?: string;
4332
+ /** 错误颜色 */
4333
+ error?: string;
4334
+ }
4335
+
3928
4336
  /**
3929
4337
  * 表格编辑器状态枚举
3930
4338
  * 定义了表格编辑器可能处于的各种状态
@@ -4062,7 +4470,18 @@ export declare interface SyncStatusDelegation {
4062
4470
  /** Tab 完整配置 */
4063
4471
  export declare interface TabConfig {
4064
4472
  /** 线性标签页(仅下边框) */
4065
- line: TabVariantStyles;
4473
+ line: {
4474
+ backgroundColor: string;
4475
+ item: TabStateStyles & {
4476
+ /** 选中底部线条宽度/高度 */
4477
+ bottomActiveWidth: string;
4478
+ /** 选中底部线条圆角 */
4479
+ bottomActiveBorderRadius: string;
4480
+ /** 选中底部线条背景颜色 */
4481
+ bottomActiveBackgroundColor: string;
4482
+ };
4483
+ layout: TabLayoutStyles;
4484
+ };
4066
4485
  /** 面性标签页(带所有边框) */
4067
4486
  card: TabVariantStyles;
4068
4487
  /** 大尺寸配置 */
@@ -4280,6 +4699,17 @@ export declare type TableFieldContextMenuFeatureButtonName =
4280
4699
 
4281
4700
  export declare type TableFieldContextMenuOptions = EditorMenuOptions<TableFieldContextMenuFeatureButtonName>;
4282
4701
 
4702
+ /**
4703
+ * 字段数量限制配置
4704
+ */
4705
+ export declare interface TableFieldLimitationOptions {
4706
+ /**
4707
+ * 获取单个数据表支持的最大字段数
4708
+ * @returns 最大字段数,undefined 表示使用内部默认值
4709
+ */
4710
+ getMaxFieldCount?: () => number | undefined;
4711
+ }
4712
+
4283
4713
  /**
4284
4714
  * 表格字段配置选项
4285
4715
  */
@@ -4397,6 +4827,10 @@ export declare interface TableFieldOptions {
4397
4827
  */
4398
4828
  disabled?: boolean;
4399
4829
  };
4830
+ /**
4831
+ * 字段数量限制
4832
+ */
4833
+ limitations?: TableFieldLimitationOptions;
4400
4834
  }
4401
4835
 
4402
4836
  export declare interface TableFormOptions {
@@ -4463,6 +4897,33 @@ export declare interface TableHistoryOptions extends EditorHistoryOptions {
4463
4897
  * @default false
4464
4898
  */
4465
4899
  disabled?: boolean;
4900
+ /**
4901
+ * 单元格历史记录卡点限制
4902
+ */
4903
+ limitations?: {
4904
+ /**
4905
+ * 获取单元格历史可查看的最大天数
4906
+ * 返回 0 表示不限制;返回 undefined 表示使用内部默认值
4907
+ * @returns 最大天数
4908
+ */
4909
+ getMaxCellHistoryDays?: () => number | undefined;
4910
+ };
4911
+ };
4912
+ /**
4913
+ * 行历史记录配置
4914
+ */
4915
+ rowHistory?: {
4916
+ /**
4917
+ * 行历史记录卡点限制
4918
+ */
4919
+ limitations?: {
4920
+ /**
4921
+ * 获取行动态历史可查看的最大天数
4922
+ * 返回 0 表示不限制;返回 undefined 表示使用内部默认值
4923
+ * @returns 最大天数
4924
+ */
4925
+ getMaxRowHistoryDays?: () => number | undefined;
4926
+ };
4466
4927
  };
4467
4928
  }
4468
4929
 
@@ -4616,6 +5077,27 @@ export declare interface TablePasteOptions extends EditorPasteOptions {
4616
5077
  limitations?: TablePasteLimitationOptions;
4617
5078
  }
4618
5079
 
5080
+ /**
5081
+ * 记录数量限制配置
5082
+ */
5083
+ export declare interface TableRecordLimitationOptions {
5084
+ /**
5085
+ * 获取单个数据表支持的最大行数
5086
+ * @returns 最大行数,undefined 表示使用内部默认值
5087
+ */
5088
+ getMaxRowCount?: () => number | undefined;
5089
+ }
5090
+
5091
+ /**
5092
+ * 记录/行配置选项
5093
+ */
5094
+ export declare interface TableRecordOptions {
5095
+ /**
5096
+ * 记录数量限制
5097
+ */
5098
+ limitations?: TableRecordLimitationOptions;
5099
+ }
5100
+
4619
5101
  export declare interface TableRenderOptions {
4620
5102
  /** 当前 table Guid */
4621
5103
  table?: string;
@@ -4752,6 +5234,10 @@ export declare interface TableSDKOptions extends TableEditorOptions {
4752
5234
  * 初始化页面渲染的时候需要的配置
4753
5235
  */
4754
5236
  render?: TableRenderOptions;
5237
+ /**
5238
+ * 记录/行配置
5239
+ */
5240
+ record?: TableRecordOptions;
4755
5241
  }
4756
5242
 
4757
5243
  export declare interface TableSelection {
@@ -4894,6 +5380,17 @@ export declare interface TableShortcutsOptions extends EditorShortcutOptions {
4894
5380
  disabledShortcuts?: TableShortcutsFeatureType[];
4895
5381
  }
4896
5382
 
5383
+ /**
5384
+ * 版本数量限制配置
5385
+ */
5386
+ export declare interface TableSnapshotLimitationOptions {
5387
+ /**
5388
+ * 获取单个数据表支持的最大手动保存版本数量
5389
+ * @returns 最大版本数量,undefined 表示使用内部默认值
5390
+ */
5391
+ getMaxSnapshot?: () => number | undefined;
5392
+ }
5393
+
4897
5394
  /**
4898
5395
  * 表格快照配置
4899
5396
  * 应用表格在预览指定版本时会显示 Header 用于显示创建时间等信息,预览模式时需要隐藏
@@ -4907,6 +5404,10 @@ export declare interface TableSnapshotOptions {
4907
5404
  * 是否禁用快照头部
4908
5405
  */
4909
5406
  disableSnapshotHeader?: boolean;
5407
+ /**
5408
+ * 版本数量限制
5409
+ */
5410
+ limitations?: TableSnapshotLimitationOptions;
4910
5411
  }
4911
5412
 
4912
5413
  /**
@@ -5320,6 +5821,32 @@ export declare type TableViewContextMenuFeatureButtonName = GridMenuItemName | K
5320
5821
 
5321
5822
  export declare type TableViewContextMenuOptions = EditorMenuOptions<TableViewContextMenuFeatureButtonName>;
5322
5823
 
5824
+ /**
5825
+ * 视图数量限制配置
5826
+ */
5827
+ export declare interface TableViewLimitationOptions {
5828
+ /**
5829
+ * 获取单个数据表支持的最大锁定视图数量
5830
+ * @returns 最大锁定视图数量,undefined 表示使用内部默认值
5831
+ */
5832
+ getMaxLockedView?: () => number | undefined;
5833
+ /**
5834
+ * 获取单个数据表支持的最大个人视图数量
5835
+ * @returns 最大个人视图数量,undefined 表示使用内部默认值
5836
+ */
5837
+ getMaxPersonalView?: () => number | undefined;
5838
+ /**
5839
+ * 获取单个数据表支持的最大甘特视图数量
5840
+ * @returns 最大甘特视图数量,undefined 表示使用内部默认值
5841
+ */
5842
+ getMaxGanttView?: () => number | undefined;
5843
+ /**
5844
+ * 获取单个数据表支持的最大日历视图数量
5845
+ * @returns 最大日历视图数量,undefined 表示使用内部默认值
5846
+ */
5847
+ getMaxCalendarView?: () => number | undefined;
5848
+ }
5849
+
5323
5850
  /**
5324
5851
  * 表格视图配置选项
5325
5852
  */
@@ -5419,6 +5946,10 @@ export declare interface TableViewOptions {
5419
5946
  disableLayoutConfig?: boolean;
5420
5947
  };
5421
5948
  };
5949
+ /**
5950
+ * 视图数量限制
5951
+ */
5952
+ limitations?: TableViewLimitationOptions;
5422
5953
  }
5423
5954
 
5424
5955
  export declare interface TableWindow {
@@ -5448,8 +5979,10 @@ export declare interface TabStateStyles extends BackgroundStateStyles, BorderSta
5448
5979
  export declare interface TabVariantStyles {
5449
5980
  /** Tab 项状态样式 */
5450
5981
  item: TabStateStyles;
5451
- /** 布局样式 */
5982
+ /** 布局 */
5452
5983
  layout: TabLayoutStyles;
5984
+ /** tab条背景颜色 */
5985
+ backgroundColor: string;
5453
5986
  }
5454
5987
 
5455
5988
  export declare interface TemplateProps {
@@ -5560,6 +6093,10 @@ export declare interface ToastConfig extends ToastBaseStyles {
5560
6093
  error: ToastVariantStyles;
5561
6094
  /** 警告提示样式 */
5562
6095
  warn: ToastVariantStyles;
6096
+ /** 严重警告样式 */
6097
+ critical: ToastVariantStyles;
6098
+ /** 加载提示样式 */
6099
+ loading: ToastVariantStyles;
5563
6100
  /** 偏移量 */
5564
6101
  offset: {
5565
6102
  /** 垂直偏移量 */
@@ -5567,6 +6104,10 @@ export declare interface ToastConfig extends ToastBaseStyles {
5567
6104
  /** 水平偏移量 */
5568
6105
  horizontal: string;
5569
6106
  };
6107
+ /** 关闭按钮 */
6108
+ closeButton: {
6109
+ icon: Pick<IconConfig, 'url'>;
6110
+ };
5570
6111
  }
5571
6112
 
5572
6113
  /**
@@ -5638,6 +6179,11 @@ export declare interface ToastVariantStyles {
5638
6179
  borderColor: string;
5639
6180
  /** 图标配置 */
5640
6181
  icon: IconConfig;
6182
+ /** 消息 */
6183
+ message: {
6184
+ /** 颜色 */
6185
+ color: string;
6186
+ };
5641
6187
  }
5642
6188
 
5643
6189
  /** ToolbarButton 背景状态样式 */
@@ -5683,6 +6229,8 @@ export declare interface ToolbarButtonLayout {
5683
6229
  padding: string;
5684
6230
  /** 整体高度 */
5685
6231
  height: string;
6232
+ /** 整体圆角 */
6233
+ borderRadius: string;
5686
6234
  /** 内容布局 */
5687
6235
  content: {
5688
6236
  padding: string;
@@ -5777,6 +6325,8 @@ export declare interface TooltipStyleConfig {
5777
6325
  lineHeight: string;
5778
6326
  /** 字重 */
5779
6327
  fontWeight: number;
6328
+ /** 最大宽度 */
6329
+ maxWidth?: string;
5780
6330
  }
5781
6331
 
5782
6332
  /** Tooltip White 风格配置 */