@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/form.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
  * 开始上传
@@ -98,6 +112,12 @@ export declare interface BorderColors {
98
112
  disabled: string;
99
113
  }
100
114
 
115
+ export declare interface BorderConfig {
116
+ color?: string;
117
+ radius?: string;
118
+ width?: string;
119
+ }
120
+
101
121
  /** 圆角配置 */
102
122
  export declare interface BorderRadiusConfig {
103
123
  /** 无圆角 0px */
@@ -154,6 +174,8 @@ export declare interface ButtonBaseSizeStyles {
154
174
  borderRadius: string;
155
175
  /** 字重 */
156
176
  fontWeight: string | number;
177
+ /** 间距 */
178
+ gap?: string;
157
179
  }
158
180
 
159
181
  /** Button 完整配置 */
@@ -361,12 +383,16 @@ export declare interface CommonThemeConfig {
361
383
  radio: RadioConfig;
362
384
  /** 复选框 */
363
385
  checkbox: CheckboxConfig;
386
+ /** 下拉框 */
387
+ dropdown: DropdownConfig;
388
+ /** 下拉框按钮 */
389
+ dropdownButton: DropdownButtonConfig;
390
+ /** 菜单 */
391
+ menu: MenuConfig;
364
392
  /** 开关 */
365
393
  switch: SwitchConfig;
366
394
  /** 按钮 */
367
395
  button: ButtonConfig;
368
- /** 下拉框 */
369
- dropdown: DropdownConfig;
370
396
  /** 标签页 */
371
397
  tab: TabConfig;
372
398
  /** 滑块 */
@@ -434,82 +460,65 @@ export declare interface DecorateColors {
434
460
  april: string;
435
461
  }
436
462
 
437
- /** Dropdown 箭头图标配置 */
438
- export declare interface DropdownArrowIconConfig extends IconConfig {
439
- /** 展开状态旋转角度 */
440
- expandedRotateAngel: string;
441
- }
442
-
443
- /** Dropdown 完整配置 */
444
- export declare interface DropdownConfig {
445
- /** 图标配置集合 */
446
- icons: DropdownIconsConfig;
447
- /** 普通下拉框(按钮触发器) */
448
- button: DropdownVariantStyles;
449
- /** 输入框下拉框(输入框触发器) */
450
- input: DropdownVariantStyles;
451
- /** 大尺寸配置 */
452
- large: DropdownSizeStyles;
453
- }
454
-
455
- /** Dropdown 图标集合配置 */
456
- export declare interface DropdownIconsConfig {
457
- /** 下拉箭头图标 */
458
- arrow: DropdownArrowIconConfig;
459
- /** 选中图标 */
460
- check: IconConfig;
463
+ /** Dropdown 按钮配置 */
464
+ export declare interface DropdownButtonConfig {
465
+ /** 颜色 */
466
+ color: StateStyles;
467
+ /** 背景 */
468
+ background: StateStyles;
469
+ /** 无边框背景 */
470
+ frameLessBackground: StateStyles;
471
+ /** 边框颜色 */
472
+ borderColor: StateStyles;
473
+ /** 图标 */
474
+ icon: {
475
+ size: IconSize;
476
+ /** 透明度 */
477
+ opacity: StateStyles;
478
+ };
479
+ /** 指示器 */
480
+ indicator: IconConfig & {
481
+ /** 旋转角度 */
482
+ rotate: string;
483
+ /** 透明度 */
484
+ opacity: StateStyles;
485
+ };
486
+ /** 尺寸 */
487
+ size: {
488
+ /** 大尺寸 */
489
+ large: DropdownButtonSizeStyles;
490
+ /** 中尺寸 */
491
+ medium: DropdownButtonSizeStyles;
492
+ /** 小尺寸 */
493
+ small: DropdownButtonSizeStyles;
494
+ };
461
495
  }
462
496
 
463
- /** Dropdown 菜单项样式 */
464
- export declare interface DropdownMenuItemStyles extends Omit<BackgroundStateStyles, 'backgroundActive'> {
465
- /** 选中背景 */
466
- backgroundSelected: string;
467
- /** 文字颜色 */
468
- color: string;
469
- /** 禁用文字颜色 */
470
- colorDisabled: string;
471
- /** 菜单项内边距 */
497
+ /** Dropdown 按钮尺寸 */
498
+ export declare interface DropdownButtonSizeStyles {
472
499
  padding: string;
473
- }
474
-
475
- /** Dropdown 菜单容器样式 */
476
- export declare interface DropdownMenuStyles {
477
- /** 背景色 */
478
- background: string;
479
- /** 边框色 */
480
- borderColor: string;
481
- /** 圆角 */
500
+ fontSize: string;
501
+ height: string;
502
+ gap: string;
482
503
  borderRadius: string;
483
- /** 内边距 */
484
- padding: string;
485
- /** 阴影 */
486
- boxShadow: string;
487
- /** 最大高度 */
488
- maxHeight: string;
489
- }
490
-
491
- /** Dropdown 尺寸配置 */
492
- export declare interface DropdownSizeStyles extends ButtonBaseSizeStyles {
493
- /** 图标尺寸 */
494
504
  iconSize: IconSize;
505
+ indicatorSize: IconSize;
495
506
  }
496
507
 
497
- /** Dropdown 触发器样式(按钮或输入框触发器) */
498
- export declare interface DropdownTriggerStyles extends BorderStateStyles, BackgroundStateStyles, ShadowStateStyles {
499
- /** 文字颜色 */
500
- color: string;
501
- /** 禁用文字颜色 */
502
- colorDisabled: string;
503
- }
504
-
505
- /** Dropdown 变体样式 */
506
- export declare interface DropdownVariantStyles {
507
- /** 触发器样式 */
508
- trigger: DropdownTriggerStyles;
509
- /** 菜单容器样式 */
510
- menu: DropdownMenuStyles;
511
- /** 菜单项样式 */
512
- menuItem: DropdownMenuItemStyles;
508
+ /**
509
+ * Dropdown 下拉框配置
510
+ */
511
+ export declare interface DropdownConfig {
512
+ /** 阴影 */
513
+ boxShadow: string;
514
+ /** 内边距 */
515
+ padding: string;
516
+ /** 圆角 */
517
+ borderRadius: string;
518
+ /** 边框 */
519
+ border: string;
520
+ /** 背景 */
521
+ background: string;
513
522
  }
514
523
 
515
524
  /**
@@ -728,6 +737,10 @@ export declare interface EditorAttachmentOptions {
728
737
  * 附件选择器
729
738
  */
730
739
  picker?: EditorFilePicker;
740
+ /**
741
+ * 文件检查器
742
+ */
743
+ checker?: AbstractedEditorFileChecker;
731
744
  /**
732
745
  * 附件上传器
733
746
  */
@@ -1160,6 +1173,14 @@ export declare type EditorContextMenuOptions<TName extends string> = EditorMenuO
1160
1173
  */
1161
1174
  export declare type EditorCopyOptions = EditorLogicFeatureConfig;
1162
1175
 
1176
+ /**
1177
+ * 日期格式
1178
+ * - `YYYY/MM/DD` 年/月/日(简繁中文、韩语、日语默认)
1179
+ * - `MM/DD/YYYY` 月/日/年(英语默认)
1180
+ * - `DD/MM/YYYY` 日/月/年(其他语言默认)
1181
+ */
1182
+ export declare type EditorDateFormat = 'YYYY/MM/DD' | 'MM/DD/YYYY' | 'DD/MM/YYYY';
1183
+
1163
1184
  /**
1164
1185
  * 编辑器解密选项接口
1165
1186
  * 用于配置编辑器中需要解密的内容的相关选项
@@ -1337,11 +1358,31 @@ export declare interface EditorFilePicker {
1337
1358
  }
1338
1359
 
1339
1360
  export declare interface EditorFilePickerOpenOptions {
1361
+ /**
1362
+ * 文件类型限制
1363
+ */
1340
1364
  mimeTypes?: string[];
1365
+ /**
1366
+ * 最大文件尺寸限制
1367
+ */
1341
1368
  maxSize?: number;
1369
+ /**
1370
+ * 文件后缀限制
1371
+ */
1342
1372
  extensions?: string[];
1373
+ /**
1374
+ * 是否支持多选
1375
+ */
1343
1376
  multiple?: boolean;
1377
+ /**
1378
+ * 是否为选择文件夹
1379
+ */
1344
1380
  directory?: boolean;
1381
+ /**
1382
+ * 文件选择器接受的文件类型,如 'image/*' 表示接受所有图片文件
1383
+ * 如果指定了该配置,则不会再由extensions生成accept
1384
+ */
1385
+ accept?: string;
1345
1386
  }
1346
1387
 
1347
1388
  export declare interface EditorFollowMode {
@@ -1454,9 +1495,32 @@ export declare interface EditorFontsOptions {
1454
1495
  */
1455
1496
  list?: EditorFontsList;
1456
1497
  /**
1457
- * 是否只使用本地字体,如果为 true,则不会从服务器获取字体列表。
1498
+ * 字体列表中隐藏不可用的字体,包含外部传入的以及各套件内置的字体
1499
+ * 不可用的定义:非本地已安装且不支持下载
1500
+ */
1501
+ hideUnavailableFonts?: boolean;
1502
+ /**
1503
+ * 字体下载监听器注册函数,当字体状态发生变化时调用提供的回调函数。
1504
+ * 回调函数暂时没有参数,后续可以根据需要添加参数,例如提供变化的字体信息等。
1505
+ * @param listener
1506
+ * @returns
1458
1507
  */
1459
- useLocalFontsOnly?: boolean;
1508
+ registerFontLoadListener?: (listener: (options: FontLoadListenerOptions) => void) => void;
1509
+ /**
1510
+ * 下载字体的函数,接受字体族名称和一个可选的配置对象作为参数。
1511
+ * 配置对象可以包含以下回调函数:
1512
+ * - onProgress: 在下载过程中调用,提供下载进度(0 到 1 之间的数字)。
1513
+ * - onComplete: 在下载完成时调用。
1514
+ * - onError: 在下载过程中发生错误时调用,提供错误对象。
1515
+ * @param fontFamily
1516
+ * @param option
1517
+ * @returns
1518
+ */
1519
+ download?: (fontFamily: string, option?: {
1520
+ onProgress?: (progress: number) => void;
1521
+ onComplete?: () => void;
1522
+ onError?: (error: Error) => void;
1523
+ }) => void;
1460
1524
  }
1461
1525
 
1462
1526
  /**
@@ -1484,20 +1548,61 @@ export declare interface EditorHistory {
1484
1548
  hide: () => void;
1485
1549
  }
1486
1550
 
1487
- export declare type EditorHistoryOptions = EditorFeatureConfig;
1551
+ export declare interface EditorHistoryLimitations {
1552
+ /** 单个文件可还原的最近历史记录数量 */
1553
+ getHistoryLimitRevertNum?: () => number | undefined;
1554
+ /** 文件历史保留天数 */
1555
+ getHistoryLimitAllTime?: () => number | undefined;
1556
+ }
1557
+
1558
+ export declare type EditorHistoryOptions = EditorFeatureConfig & {
1559
+ limitations?: EditorHistoryLimitations;
1560
+ };
1488
1561
 
1489
1562
  /**
1490
1563
  * i18n 相关设置
1491
1564
  */
1492
1565
  export declare interface EditorI18nOptions {
1493
1566
  /**
1494
- * 语言,默认使用浏览器当前环境中的语言
1567
+ * 语言代码
1568
+ * 默认读取浏览器/设备语言并在支持的列表中匹配
1569
+ * 匹配规则:优先精确匹配,其次模糊匹配 language 部分,Fallback 为 en-US
1495
1570
  */
1496
- language?: string;
1571
+ language?: EditorLanguage;
1497
1572
  /**
1498
1573
  * 文本方向,默认根据语言自动适配
1499
1574
  */
1500
1575
  direction?: 'ltr' | 'rtl';
1576
+ /**
1577
+ * 时区设置(包含 ID、偏移量、标签)
1578
+ * 默认读取浏览器/设备时区,如无法匹配则根据语言推测
1579
+ * Fallback 为 { id: 'Europe/London', offset: 0, label: 'London' }
1580
+ */
1581
+ timezone?: EditorTimezoneInfo;
1582
+ /**
1583
+ * 日期格式
1584
+ * 默认根据语言自动匹配:
1585
+ * - 简繁中文、韩语、日语:YYYY/MM/DD
1586
+ * - 英语:MM/DD/YYYY
1587
+ * - 其他语言:DD/MM/YYYY
1588
+ * 用户手动设置后将保存并优先使用用户设置
1589
+ */
1590
+ dateFormat?: EditorDateFormat;
1591
+ /**
1592
+ * 时间格式
1593
+ * 默认使用 24 小时制
1594
+ * 注意:部分语言(如德语、法语、意大利语、俄语)不支持 12 小时制
1595
+ * 用户手动设置后将保存并优先使用用户设置
1596
+ */
1597
+ timeFormat?: EditorTimeFormat;
1598
+ /**
1599
+ * 周起始日
1600
+ * 默认根据语言自动匹配:
1601
+ * - 英语、阿拉伯语:星期日
1602
+ * - 其他语言:星期一
1603
+ * 用户手动设置后将保存并优先使用用户设置
1604
+ */
1605
+ weekStartDay?: EditorWeekStartDay;
1501
1606
  }
1502
1607
 
1503
1608
  export declare type EditorImageCropPoint = 'nw' | 'north' | 'ne' | 'west' | 'center' | 'east' | 'sw' | 'south' | 'se';
@@ -1542,6 +1647,27 @@ export declare interface EditorImportOptions {
1542
1647
  }>;
1543
1648
  }
1544
1649
 
1650
+ /**
1651
+ * 支持的语言代码
1652
+ * - `zh-CN` 简体中文
1653
+ * - `zh-TW` 繁体中文(含 zh-HK, zh-MO)
1654
+ * - `en-US` 英语
1655
+ * - `ja-JP` 日语
1656
+ * - `ko-KR` 韩语
1657
+ * - `es-ES` 西班牙语
1658
+ * - `pt-PT` 葡萄牙语
1659
+ * - `de-DE` 德语
1660
+ * - `fr-FR` 法语
1661
+ * - `it-IT` 意大利语
1662
+ * - `ru-RU` 俄语
1663
+ * - `id-ID` 印度尼西亚语
1664
+ * - `vi-VN` 越南语
1665
+ * - `th-TH` 泰语
1666
+ * - `ms-MY` 马来语
1667
+ * - `ar-SA` 阿拉伯语
1668
+ */
1669
+ 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';
1670
+
1545
1671
  /**
1546
1672
  * 链接配置,抽象打开链接等操作
1547
1673
  */
@@ -2091,7 +2217,11 @@ export declare interface EditorOptions {
2091
2217
  /**
2092
2218
  * 编辑器主题相关设置
2093
2219
  */
2094
- theme: EditorThemeOptions;
2220
+ theme?: EditorThemeOptions;
2221
+ /**
2222
+ * 编辑器拼写检查相关设置
2223
+ */
2224
+ spellCheck?: EditorSpellCheckOptions;
2095
2225
  }
2096
2226
 
2097
2227
  /**
@@ -2411,6 +2541,49 @@ export declare interface EditorSocket {
2411
2541
  connected: boolean;
2412
2542
  }
2413
2543
 
2544
+ export declare interface EditorSpellCheckDictionaryFileConfig {
2545
+ /** 词典文件的 aff 文件路径 */
2546
+ aff: string;
2547
+ /** 词典文件的 dic 文件路径 */
2548
+ dic: string;
2549
+ }
2550
+
2551
+ /**
2552
+ * 拼写检查相关配置
2553
+ */
2554
+ export declare interface EditorSpellCheckOptions extends EditorFeatureConfig {
2555
+ /**
2556
+ * 拼写检查功能配置
2557
+ */
2558
+ spellCheck?: {
2559
+ /**
2560
+ * 拼写检查功能是否被禁用
2561
+ */
2562
+ disabled?: boolean;
2563
+ /**
2564
+ * 拼写检查所需要的字典文件 CDN 域名
2565
+ */
2566
+ dictionaryCDNHost?: string;
2567
+ /**
2568
+ * 自定义拼写检查词典, 用于覆盖内置的默认词典
2569
+ */
2570
+ customDictionary?: Partial<Record<EditorLanguage, EditorSpellCheckDictionaryFileConfig>>;
2571
+ };
2572
+ /**
2573
+ * 语法检查功能配置
2574
+ */
2575
+ grammarCheck?: {
2576
+ /**
2577
+ * 语法检查功能是否被禁用
2578
+ */
2579
+ disabled?: boolean;
2580
+ /**
2581
+ * 拼写检查API的URL,必须使用绝对路径
2582
+ */
2583
+ url?: string;
2584
+ };
2585
+ }
2586
+
2414
2587
  /**
2415
2588
  * 编辑器在 `standard` 模式下的权限模式
2416
2589
  * - `editor` 编辑模式
@@ -2553,6 +2726,59 @@ export declare interface EditorThemeOptions<TExtensions = object> extends Common
2553
2726
  extensions?: TExtensions;
2554
2727
  }
2555
2728
 
2729
+ /**
2730
+ * 时间格式
2731
+ * - `24h` 24 小时制(默认)
2732
+ * - `12h` 12 小时制(部分语言不支持)
2733
+ */
2734
+ export declare type EditorTimeFormat = '24h' | '12h';
2735
+
2736
+ /**
2737
+ * 支持的时区 IANA ID
2738
+ *
2739
+ * 覆盖范围: UTC-12 到 UTC+12,共 34 个全球主要城市时区
2740
+ *
2741
+ * 注意事项:
2742
+ * - 所有时区 ID 均为 IANA 时区数据库标准标识符
2743
+ * - Etc/GMT+12 表示 UTC-12(Etc/GMT 时区符号与 UTC 相反)
2744
+ * - 不包括已弃用或非标准时区标识符
2745
+ *
2746
+ * @see https://www.iana.org/time-zones
2747
+ */
2748
+ 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';
2749
+
2750
+ /**
2751
+ * 时区信息
2752
+ */
2753
+ export declare interface EditorTimezoneInfo {
2754
+ /**
2755
+ * IANA 时区 ID
2756
+ *
2757
+ * 标准的 IANA 时区数据库标识符
2758
+ *
2759
+ * @example 'Asia/Shanghai', 'America/New_York', 'Europe/London'
2760
+ */
2761
+ id: EditorTimezoneId;
2762
+ /**
2763
+ * UTC 偏移量(小时,标准时间)
2764
+ *
2765
+ * - 正数:东半球,如 `8` 表示 UTC+8(北京)
2766
+ * - 负数:西半球,如 `-5` 表示 UTC-5(纽约标准时间)
2767
+ * - 零:格林威治标准时间
2768
+ *
2769
+ * 注意:此值为标准时间,不包含夏令时调整
2770
+ */
2771
+ offset: number;
2772
+ /**
2773
+ * 时区标签(英文)
2774
+ *
2775
+ * 用于 UI 显示的城市或地区名称
2776
+ *
2777
+ * @example 'Shanghai', 'New York', 'London'
2778
+ */
2779
+ label: string;
2780
+ }
2781
+
2556
2782
  /**
2557
2783
  * 工具栏功能按钮配置(包括内置按钮和自定义按钮)
2558
2784
  */
@@ -2616,6 +2842,16 @@ export declare interface EditorToolbarOptions<TName extends string> {
2616
2842
  * 如果不配置则按照套件的默认方式挂载。
2617
2843
  */
2618
2844
  container?: HTMLElement;
2845
+ /**
2846
+ * 工具栏样式
2847
+ * 各套件可自行扩展,目前支持背景色配置
2848
+ */
2849
+ style?: {
2850
+ /**
2851
+ * 背景色
2852
+ */
2853
+ backgroundColor?: string;
2854
+ };
2619
2855
  }
2620
2856
 
2621
2857
  /**
@@ -2829,9 +3065,11 @@ export declare interface EditorUserOptions {
2829
3065
  export declare interface EditorVersion {
2830
3066
  /**
2831
3067
  * 保存版本
2832
- * @param name 版本名称
3068
+ * @param options 版本名称
2833
3069
  */
2834
- createRevision: (name?: string) => void;
3070
+ createRevision: (options?: string | {
3071
+ name: string;
3072
+ }) => void;
2835
3073
  /**
2836
3074
  * 显示版本(侧边栏或其他形式)
2837
3075
  * 区别于历史侧边栏,在应用表格里表现为打开历史侧边栏切换到版本 tab
@@ -2844,7 +3082,14 @@ export declare interface EditorVersion {
2844
3082
  hide?: () => void;
2845
3083
  }
2846
3084
 
2847
- export declare type EditorVersionOptions = EditorFeatureConfig;
3085
+ export declare interface EditorVersionLimitations {
3086
+ /** 单个文件可保存/还原的版本(快照)数量 */
3087
+ getHistoryLimitVersionNum?: () => number | undefined;
3088
+ }
3089
+
3090
+ export declare type EditorVersionOptions = EditorFeatureConfig & {
3091
+ limitations?: EditorVersionLimitations;
3092
+ };
2848
3093
 
2849
3094
  /**
2850
3095
  * 编辑器外部水印信息
@@ -2874,6 +3119,13 @@ export declare type EditorWatermarkResource = {
2874
3119
  url: string;
2875
3120
  };
2876
3121
 
3122
+ /**
3123
+ * 周起始日
3124
+ * - `sunday` 星期日(英语、阿拉伯语默认)
3125
+ * - `monday` 星期一(其他语言默认)
3126
+ */
3127
+ export declare type EditorWeekStartDay = 'sunday' | 'monday';
3128
+
2877
3129
  export declare interface FileLinkParams {
2878
3130
  /**
2879
3131
  * 文件guid
@@ -2945,6 +3197,35 @@ export declare interface FontFamilyConfig {
2945
3197
  base: string;
2946
3198
  }
2947
3199
 
3200
+ /**
3201
+ * 字体下载事件类型
3202
+ */
3203
+ export declare enum FontLoadEventType {
3204
+ DownloadStart = "downloadStart",
3205
+ DownloadProgress = "downloadProgress",
3206
+ DownloadComplete = "downloadComplete",
3207
+ DownloadError = "downloadError"
3208
+ }
3209
+
3210
+ /**
3211
+ * 字体下载事件监听器参数,根据事件类型提供不同的属性
3212
+ */
3213
+ export declare type FontLoadListenerOptions = {
3214
+ type: FontLoadEventType.DownloadStart;
3215
+ id: string;
3216
+ } | {
3217
+ type: FontLoadEventType.DownloadComplete;
3218
+ id: string;
3219
+ } | {
3220
+ type: FontLoadEventType.DownloadProgress;
3221
+ id: string;
3222
+ progress: number;
3223
+ } | {
3224
+ type: FontLoadEventType.DownloadError;
3225
+ id: string;
3226
+ error: Error;
3227
+ };
3228
+
2948
3229
  /** 字号配置 */
2949
3230
  export declare interface FontSizeConfig {
2950
3231
  /** 超小字号 */
@@ -3047,6 +3328,10 @@ export declare interface FormUIOptions extends EditorUiOptions {
3047
3328
  * 隐藏通知相关的表单设置(填写提醒、订阅更新)
3048
3329
  */
3049
3330
  hiddenNotification?: boolean;
3331
+ /**
3332
+ * 限制单个表单的最大提交份数
3333
+ */
3334
+ submissionLimitedCount?: number;
3050
3335
  };
3051
3336
  /**
3052
3337
  * 填写页相关UI配置
@@ -3165,6 +3450,16 @@ export declare interface HTTPProxy {
3165
3450
  * @returns
3166
3451
  */
3167
3452
  create: (id: string) => Promise<HTTPProxy>;
3453
+ /**
3454
+ * 凭证更新器,用于套件内部主动发起更新凭证操作
3455
+ * 例如:页面可见性发生变化时,在pull请求发起之前
3456
+ */
3457
+ credentials?: {
3458
+ /**
3459
+ * 更新凭证
3460
+ */
3461
+ update: () => Promise<void>;
3462
+ };
3168
3463
  }
3169
3464
 
3170
3465
  /**
@@ -3364,6 +3659,8 @@ export declare interface InputStateColorStyles {
3364
3659
  textColorNormal: string;
3365
3660
  /** 禁用文字颜色 */
3366
3661
  textColorDisabled: string;
3662
+ /** 只读文字颜色 */
3663
+ textColorReadOnly: string;
3367
3664
  }
3368
3665
 
3369
3666
  /** Input 状态样式配置 */
@@ -3509,6 +3806,102 @@ export declare interface MentionInfo {
3509
3806
  top?: number;
3510
3807
  }
3511
3808
 
3809
+ /** 菜单配置 */
3810
+ export declare interface MenuConfig {
3811
+ /** 菜单项配置 */
3812
+ menuItem: MenuItemConfig;
3813
+ /** 子菜单 */
3814
+ subMenu: {
3815
+ /** 子菜单弹出位置偏移 */
3816
+ popupOffset: number[];
3817
+ };
3818
+ /** 边框 */
3819
+ border: BorderConfig;
3820
+ /** 阴影 */
3821
+ boxShadow: Pick<StateStyles, 'normal' | 'hover'>;
3822
+ /** 分割线 */
3823
+ divider: {
3824
+ background: string;
3825
+ height: string;
3826
+ margin: string;
3827
+ };
3828
+ /** 分组标题 */
3829
+ groupTitle: {
3830
+ fontSize: string;
3831
+ fontWeight: string;
3832
+ color: string;
3833
+ };
3834
+ }
3835
+
3836
+ /** 菜单项配置 */
3837
+ export declare interface MenuItemConfig {
3838
+ /** 背景 */
3839
+ background: {
3840
+ normal: string;
3841
+ hover: string;
3842
+ active: string;
3843
+ disabled: string;
3844
+ };
3845
+ /** 边框 */
3846
+ border: BorderConfig;
3847
+ /** 布局 */
3848
+ layout: {
3849
+ /** 内边距 */
3850
+ padding: string;
3851
+ /** 间距 */
3852
+ gap: string;
3853
+ };
3854
+ /** 图标 */
3855
+ icon: {
3856
+ size: IconSize;
3857
+ };
3858
+ /** 标签 */
3859
+ label: {
3860
+ /** 颜色 */
3861
+ color: StateStyles;
3862
+ };
3863
+ /** 描述文本 */
3864
+ description: {
3865
+ /** 颜色 */
3866
+ color: StateStyles;
3867
+ };
3868
+ /** 激活图标 */
3869
+ activeIcon: {
3870
+ url: string;
3871
+ };
3872
+ /** 下一级菜单图标 */
3873
+ nextLevelIcon: {
3874
+ url: string;
3875
+ };
3876
+ /** 尺寸 */
3877
+ size: {
3878
+ /** 小尺寸 */
3879
+ small: MenuItemSizeStyles;
3880
+ /** 中尺寸 */
3881
+ medium: MenuItemSizeStyles;
3882
+ /** 大尺寸 */
3883
+ large: MenuItemSizeStyles;
3884
+ };
3885
+ }
3886
+
3887
+ /** 菜单项尺寸样式 */
3888
+ export declare interface MenuItemSizeStyles {
3889
+ label: {
3890
+ fontSize: string;
3891
+ maxWidth: string;
3892
+ };
3893
+ description: {
3894
+ fontSize: string;
3895
+ maxWidth: string;
3896
+ };
3897
+ activeIcon: {
3898
+ size: IconSize;
3899
+ };
3900
+ nextLevelIcon: {
3901
+ size: IconSize;
3902
+ };
3903
+ }
3904
+
3512
3905
  /** 带透明度状态的图标配置 */
3513
3906
  export declare interface OpacityIconConfig extends IconConfig {
3514
3907
  /** 默认透明度 */
@@ -3770,6 +4163,7 @@ export declare interface SliderSizeStyles {
3770
4163
  thumbSize: string;
3771
4164
  /** 滑块偏移(距离边缘的间距) */
3772
4165
  thumbOffset: string;
4166
+ borderWidth: string;
3773
4167
  }
3774
4168
 
3775
4169
  /** Slider 滑块(圆点)样式 */
@@ -3784,6 +4178,8 @@ export declare interface SliderTrackStyles {
3784
4178
  backgroundDisabled: string;
3785
4179
  /** 已填充部分背景 */
3786
4180
  filledBackground: string;
4181
+ /** 已填充部分禁用状态背景 */
4182
+ filledBackgroundDisabled: string;
3787
4183
  /** 高度 */
3788
4184
  height: string;
3789
4185
  /** 宽度 */
@@ -3805,6 +4201,22 @@ export declare interface Speaker {
3805
4201
  avatar: string;
3806
4202
  }
3807
4203
 
4204
+ /** 通用状态样式 */
4205
+ export declare interface StateStyles {
4206
+ /** 默认颜色 */
4207
+ normal: string;
4208
+ /** 悬停文字颜色 */
4209
+ hover: string;
4210
+ /** 激活/聚焦文字颜色 */
4211
+ active: string;
4212
+ /** 禁用文字颜色 */
4213
+ disabled: string;
4214
+ /** 只读颜色 */
4215
+ readonly?: string;
4216
+ /** 错误颜色 */
4217
+ error?: string;
4218
+ }
4219
+
3808
4220
  /** Switch 完整配置 */
3809
4221
  export declare interface SwitchConfig {
3810
4222
  /** 关闭状态样式 */
@@ -3921,7 +4333,18 @@ export declare interface SyncStatusDelegation {
3921
4333
  /** Tab 完整配置 */
3922
4334
  export declare interface TabConfig {
3923
4335
  /** 线性标签页(仅下边框) */
3924
- line: TabVariantStyles;
4336
+ line: {
4337
+ backgroundColor: string;
4338
+ item: TabStateStyles & {
4339
+ /** 选中底部线条宽度/高度 */
4340
+ bottomActiveWidth: string;
4341
+ /** 选中底部线条圆角 */
4342
+ bottomActiveBorderRadius: string;
4343
+ /** 选中底部线条背景颜色 */
4344
+ bottomActiveBackgroundColor: string;
4345
+ };
4346
+ layout: TabLayoutStyles;
4347
+ };
3925
4348
  /** 面性标签页(带所有边框) */
3926
4349
  card: TabVariantStyles;
3927
4350
  /** 大尺寸配置 */
@@ -3945,8 +4368,10 @@ export declare interface TabStateStyles extends BackgroundStateStyles, BorderSta
3945
4368
  export declare interface TabVariantStyles {
3946
4369
  /** Tab 项状态样式 */
3947
4370
  item: TabStateStyles;
3948
- /** 布局样式 */
4371
+ /** 布局 */
3949
4372
  layout: TabLayoutStyles;
4373
+ /** tab条背景颜色 */
4374
+ backgroundColor: string;
3950
4375
  }
3951
4376
 
3952
4377
  /** Text Button 变体配置(在基础变体上扩展带背景色的引导样式) */
@@ -4027,6 +4452,10 @@ export declare interface ToastConfig extends ToastBaseStyles {
4027
4452
  error: ToastVariantStyles;
4028
4453
  /** 警告提示样式 */
4029
4454
  warn: ToastVariantStyles;
4455
+ /** 严重警告样式 */
4456
+ critical: ToastVariantStyles;
4457
+ /** 加载提示样式 */
4458
+ loading: ToastVariantStyles;
4030
4459
  /** 偏移量 */
4031
4460
  offset: {
4032
4461
  /** 垂直偏移量 */
@@ -4034,6 +4463,10 @@ export declare interface ToastConfig extends ToastBaseStyles {
4034
4463
  /** 水平偏移量 */
4035
4464
  horizontal: string;
4036
4465
  };
4466
+ /** 关闭按钮 */
4467
+ closeButton: {
4468
+ icon: Pick<IconConfig, 'url'>;
4469
+ };
4037
4470
  }
4038
4471
 
4039
4472
  /**
@@ -4105,6 +4538,11 @@ export declare interface ToastVariantStyles {
4105
4538
  borderColor: string;
4106
4539
  /** 图标配置 */
4107
4540
  icon: IconConfig;
4541
+ /** 消息 */
4542
+ message: {
4543
+ /** 颜色 */
4544
+ color: string;
4545
+ };
4108
4546
  }
4109
4547
 
4110
4548
  /** ToolbarButton 背景状态样式 */
@@ -4150,6 +4588,8 @@ export declare interface ToolbarButtonLayout {
4150
4588
  padding: string;
4151
4589
  /** 整体高度 */
4152
4590
  height: string;
4591
+ /** 整体圆角 */
4592
+ borderRadius: string;
4153
4593
  /** 内容布局 */
4154
4594
  content: {
4155
4595
  padding: string;
@@ -4244,6 +4684,8 @@ export declare interface TooltipStyleConfig {
4244
4684
  lineHeight: string;
4245
4685
  /** 字重 */
4246
4686
  fontWeight: number;
4687
+ /** 最大宽度 */
4688
+ maxWidth?: string;
4247
4689
  }
4248
4690
 
4249
4691
  /** Tooltip White 风格配置 */
@@ -4332,15 +4774,13 @@ export declare interface UnauthedFormSDK {
4332
4774
  export declare interface UnauthedFormSDKOption {
4333
4775
  container: HTMLElement;
4334
4776
  /** 主题相关设置 */
4335
- theme: EditorThemeOptions;
4336
- filePicker?: EditorAttachmentOptions['picker'];
4337
- fileUploader?: EditorAttachmentOptions['uploader'];
4338
- /** 填写页无图片/附件的预览、下载等操作,也不存在权限判断,仅有对文件类型的限制,故简化配置项 */
4339
- uploadLimitations?: Pick<EditorAttachmentOptions, 'image' | 'attachment' | 'video' | 'audio' | 'cloudFile'>;
4777
+ theme?: EditorThemeOptions;
4778
+ /** i18n 相关设置 */
4779
+ i18n?: EditorI18nOptions;
4780
+ attachment?: EditorAttachmentOptions;
4781
+ link?: EditorLinkOptions;
4340
4782
  http?: HTTPProxy;
4341
4783
  ui?: Pick<FormUIOptions, 'fillPage'>;
4342
- generateUrl?: EditorLinkOptions['generate'];
4343
- parseUrl?: EditorLinkOptions['parse'];
4344
4784
  /** 设置微信分享卡片样式,SaaS的填写页需要传入,其他页面不需要 */
4345
4785
  updateWechatSnippet?: (snippet: {
4346
4786
  title: string;