@univerjs/docs-ui 1.0.0-alpha.1 → 1.0.0-alpha.3

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 (126) hide show
  1. package/lib/cjs/index.js +2544 -1063
  2. package/lib/cjs/locale/ar-SA.js +40 -19
  3. package/lib/cjs/locale/ca-ES.js +39 -18
  4. package/lib/cjs/locale/de-DE.js +40 -19
  5. package/lib/cjs/locale/en-US.js +23 -2
  6. package/lib/cjs/locale/es-ES.js +40 -19
  7. package/lib/cjs/locale/fa-IR.js +40 -19
  8. package/lib/cjs/locale/fr-FR.js +40 -19
  9. package/lib/cjs/locale/id-ID.js +39 -18
  10. package/lib/cjs/locale/it-IT.js +40 -19
  11. package/lib/cjs/locale/ja-JP.js +40 -19
  12. package/lib/cjs/locale/ko-KR.js +40 -19
  13. package/lib/cjs/locale/pl-PL.js +40 -19
  14. package/lib/cjs/locale/pt-BR.js +39 -18
  15. package/lib/cjs/locale/ru-RU.js +40 -19
  16. package/lib/cjs/locale/sk-SK.js +40 -19
  17. package/lib/cjs/locale/vi-VN.js +40 -19
  18. package/lib/cjs/locale/zh-CN.js +23 -2
  19. package/lib/cjs/locale/zh-HK.js +23 -2
  20. package/lib/cjs/locale/zh-TW.js +23 -2
  21. package/lib/es/index.js +2474 -1070
  22. package/lib/es/locale/ar-SA.js +40 -19
  23. package/lib/es/locale/ca-ES.js +39 -18
  24. package/lib/es/locale/de-DE.js +40 -19
  25. package/lib/es/locale/en-US.js +23 -2
  26. package/lib/es/locale/es-ES.js +40 -19
  27. package/lib/es/locale/fa-IR.js +40 -19
  28. package/lib/es/locale/fr-FR.js +40 -19
  29. package/lib/es/locale/id-ID.js +39 -18
  30. package/lib/es/locale/it-IT.js +40 -19
  31. package/lib/es/locale/ja-JP.js +40 -19
  32. package/lib/es/locale/ko-KR.js +40 -19
  33. package/lib/es/locale/pl-PL.js +40 -19
  34. package/lib/es/locale/pt-BR.js +39 -18
  35. package/lib/es/locale/ru-RU.js +40 -19
  36. package/lib/es/locale/sk-SK.js +40 -19
  37. package/lib/es/locale/vi-VN.js +40 -19
  38. package/lib/es/locale/zh-CN.js +23 -2
  39. package/lib/es/locale/zh-HK.js +23 -2
  40. package/lib/es/locale/zh-TW.js +23 -2
  41. package/lib/index.css +8 -0
  42. package/lib/index.js +2474 -1070
  43. package/lib/locale/ar-SA.js +40 -19
  44. package/lib/locale/ca-ES.js +39 -18
  45. package/lib/locale/de-DE.js +40 -19
  46. package/lib/locale/en-US.js +23 -2
  47. package/lib/locale/es-ES.js +40 -19
  48. package/lib/locale/fa-IR.js +40 -19
  49. package/lib/locale/fr-FR.js +40 -19
  50. package/lib/locale/id-ID.js +39 -18
  51. package/lib/locale/it-IT.js +40 -19
  52. package/lib/locale/ja-JP.js +40 -19
  53. package/lib/locale/ko-KR.js +40 -19
  54. package/lib/locale/pl-PL.js +40 -19
  55. package/lib/locale/pt-BR.js +39 -18
  56. package/lib/locale/ru-RU.js +40 -19
  57. package/lib/locale/sk-SK.js +40 -19
  58. package/lib/locale/vi-VN.js +40 -19
  59. package/lib/locale/zh-CN.js +23 -2
  60. package/lib/locale/zh-HK.js +23 -2
  61. package/lib/locale/zh-TW.js +23 -2
  62. package/lib/types/commands/commands/break-line.command.d.ts +4 -3
  63. package/lib/types/commands/commands/doc-block-move.command.d.ts +13 -1
  64. package/lib/types/commands/commands/doc-delete.command.d.ts +6 -2
  65. package/lib/types/commands/commands/doc-header-footer.command.d.ts +4 -9
  66. package/lib/types/commands/commands/doc-horizontal-line.command.d.ts +1 -0
  67. package/lib/types/commands/commands/doc-paragraph-setting.command.d.ts +1 -2
  68. package/lib/types/commands/commands/replace-content.command.d.ts +2 -1
  69. package/lib/types/commands/commands/table/doc-table-create.command.d.ts +2 -1
  70. package/lib/types/commands/operations/doc-section-setting-panel.operation.d.ts +17 -0
  71. package/lib/types/controllers/doc-header-footer.controller.d.ts +0 -8
  72. package/lib/types/controllers/doc-section-setting.controller.d.ts +24 -0
  73. package/lib/types/controllers/render-controllers/doc-input.controller.d.ts +4 -1
  74. package/lib/types/controllers/render-controllers/doc-selection-render.controller.d.ts +5 -1
  75. package/lib/types/controllers/render-controllers/doc.render-controller.d.ts +4 -1
  76. package/lib/types/controllers/render-controllers/zoom.render-controller.d.ts +3 -1
  77. package/lib/types/controllers/ui.controller.d.ts +4 -1
  78. package/lib/types/embed-docs-custom-block-bleed.d.ts +30 -0
  79. package/lib/types/embed-docs-custom-block-refresh.d.ts +28 -0
  80. package/lib/types/embed-docs-custom-block-scroll.d.ts +19 -0
  81. package/lib/types/embed-host-anchor.d.ts +45 -0
  82. package/lib/types/index.d.ts +19 -4
  83. package/lib/types/locale/en-US.d.ts +17 -0
  84. package/lib/types/menu/context-menu.d.ts +1 -0
  85. package/lib/types/menu/menu.d.ts +2 -1
  86. package/lib/types/services/clipboard/clipboard.service.d.ts +7 -3
  87. package/lib/types/services/clipboard/doc-paste-mutation-adapter.service.d.ts +47 -0
  88. package/lib/types/services/clipboard/html-to-udm/converter.d.ts +1 -0
  89. package/lib/types/services/doc-embed-integration.service.d.ts +63 -0
  90. package/lib/types/services/doc-paragraph-menu.service.d.ts +1 -1
  91. package/lib/types/services/doc-popup-manager.service.d.ts +2 -0
  92. package/lib/types/services/docs-render.service.d.ts +1 -1
  93. package/lib/types/services/float-menu.service.d.ts +1 -0
  94. package/lib/types/services/index.d.ts +1 -0
  95. package/lib/types/services/selection/convert-text-range.d.ts +3 -0
  96. package/lib/types/services/selection/doc-selection-render.service.d.ts +18 -4
  97. package/lib/types/shortcuts/core-editing.shortcut.d.ts +1 -0
  98. package/lib/types/utils/section-header-footer.d.ts +26 -0
  99. package/lib/types/views/ParagraphMenu.d.ts +8 -3
  100. package/lib/types/views/paragraph-setting/hook/utils.d.ts +13 -3
  101. package/lib/types/views/paragraph-setting/line-spacing.d.ts +6 -18
  102. package/lib/types/views/section-setting/Setting.d.ts +16 -0
  103. package/lib/types/views/section-setting/component-name.d.ts +16 -0
  104. package/lib/types/views/section-setting/index.d.ts +16 -0
  105. package/lib/types/views/section-setting/use-section-setting.d.ts +43 -0
  106. package/lib/umd/index.js +9 -10
  107. package/lib/umd/locale/ar-SA.js +1 -1
  108. package/lib/umd/locale/ca-ES.js +1 -1
  109. package/lib/umd/locale/de-DE.js +1 -1
  110. package/lib/umd/locale/en-US.js +1 -1
  111. package/lib/umd/locale/es-ES.js +1 -1
  112. package/lib/umd/locale/fa-IR.js +1 -1
  113. package/lib/umd/locale/fr-FR.js +1 -1
  114. package/lib/umd/locale/id-ID.js +1 -1
  115. package/lib/umd/locale/it-IT.js +1 -1
  116. package/lib/umd/locale/ja-JP.js +1 -1
  117. package/lib/umd/locale/ko-KR.js +1 -1
  118. package/lib/umd/locale/pl-PL.js +1 -1
  119. package/lib/umd/locale/pt-BR.js +1 -1
  120. package/lib/umd/locale/ru-RU.js +1 -1
  121. package/lib/umd/locale/sk-SK.js +1 -1
  122. package/lib/umd/locale/vi-VN.js +1 -1
  123. package/lib/umd/locale/zh-CN.js +1 -1
  124. package/lib/umd/locale/zh-HK.js +1 -1
  125. package/lib/umd/locale/zh-TW.js +1 -1
  126. package/package.json +11 -12
@@ -55,6 +55,7 @@ const locale = { "docs-ui": {
55
55
  deleteTable: "Xóa bảng"
56
56
  },
57
57
  headerFooter: {
58
+ linkToPrevious: "Link to previous",
58
59
  header: "Đầu trang",
59
60
  footer: "Chân trang",
60
61
  panel: "Cài đặt đầu trang và chân trang",
@@ -66,17 +67,23 @@ const locale = { "docs-ui": {
66
67
  disableText: "Cài đặt đầu trang và chân trang không khả dụng"
67
68
  },
68
69
  placeholder: {
69
- heading1: "Heading 1",
70
- heading2: "Heading 2",
71
- heading3: "Heading 3",
72
- heading4: "Heading 4",
73
- heading5: "Heading 5",
74
- normalText: "Type text or press \"/\" for commands",
75
- listItem: "Item"
70
+ heading1: "Tiêu đề 1",
71
+ heading2: "Tiêu đề 2",
72
+ heading3: "Tiêu đề 3",
73
+ heading4: "Tiêu đề 4",
74
+ heading5: "Tiêu đề 5",
75
+ normalText: "Nhập văn bản hoặc nhấn \"/\" để dùng lệnh",
76
+ listItem: "Mục"
76
77
  },
77
78
  doc: {
78
- menu: { paragraphSetting: "Paragraph Setting" },
79
- slider: { paragraphSetting: "Paragraph Setting" },
79
+ menu: {
80
+ paragraphSetting: "Paragraph Setting",
81
+ sectionSetting: "Section Settings"
82
+ },
83
+ slider: {
84
+ paragraphSetting: "Paragraph Setting",
85
+ sectionSetting: "Section Settings"
86
+ },
80
87
  paragraphSetting: {
81
88
  alignment: "Alignment",
82
89
  indentation: "Indentation",
@@ -92,6 +99,20 @@ const locale = { "docs-ui": {
92
99
  atLeast: "At Least (px)",
93
100
  exactly: "Exactly (px)",
94
101
  fixedValue: "Fixed Value(px)"
102
+ },
103
+ sectionSetting: {
104
+ selectedSections: "{0} sections selected",
105
+ columnCount: "Column count",
106
+ columnGap: "Column gap",
107
+ columnSeparator: "Separator",
108
+ none: "None",
109
+ betweenColumns: "Between columns",
110
+ sectionStart: "Section start",
111
+ unspecified: "Unspecified",
112
+ continuous: "Continuous",
113
+ nextPage: "Next page",
114
+ evenPage: "Even page",
115
+ oddPage: "Odd page"
95
116
  }
96
117
  },
97
118
  rightClick: {
@@ -105,16 +126,16 @@ const locale = { "docs-ui": {
105
126
  insertBellow: "Chèn dưới"
106
127
  },
107
128
  paragraphMenu: {
108
- alignAndIndent: "Align and indent",
109
- align: "Align",
110
- indent: "Indent",
111
- color: "Colors",
112
- increase: "Increase",
113
- decrease: "Decrease",
114
- increaseIndent: "Increase indent",
115
- decreaseIndent: "Decrease indent",
116
- defaultTextColor: "Default text color",
117
- noBackground: "No background"
129
+ alignAndIndent: "Căn chỉnh và thụt lề",
130
+ align: "Căn chỉnh",
131
+ indent: "Thụt lề",
132
+ color: "Màu sắc",
133
+ increase: "Tăng",
134
+ decrease: "Giảm",
135
+ increaseIndent: "Tăng thụt lề",
136
+ decreaseIndent: "Giảm thụt lề",
137
+ defaultTextColor: "Màu văn bản mặc định",
138
+ noBackground: "Không có nền"
118
139
  },
119
140
  "page-settings": {
120
141
  "document-setting": "Cài đặt tài liệu",
@@ -55,6 +55,7 @@ const locale = { "docs-ui": {
55
55
  deleteTable: "删除表格"
56
56
  },
57
57
  headerFooter: {
58
+ linkToPrevious: "链接到上一节",
58
59
  header: "页眉",
59
60
  footer: "页脚",
60
61
  panel: "页眉页脚设置",
@@ -75,8 +76,14 @@ const locale = { "docs-ui": {
75
76
  listItem: "项目"
76
77
  },
77
78
  doc: {
78
- menu: { paragraphSetting: "段落设置" },
79
- slider: { paragraphSetting: "段落设置" },
79
+ menu: {
80
+ paragraphSetting: "段落设置",
81
+ sectionSetting: "节设置"
82
+ },
83
+ slider: {
84
+ paragraphSetting: "段落设置",
85
+ sectionSetting: "节设置"
86
+ },
80
87
  paragraphSetting: {
81
88
  alignment: "对齐方式",
82
89
  indentation: "缩进",
@@ -92,6 +99,20 @@ const locale = { "docs-ui": {
92
99
  atLeast: "至少值(px)",
93
100
  exactly: "固定值(px)",
94
101
  fixedValue: "固定值(px)"
102
+ },
103
+ sectionSetting: {
104
+ selectedSections: "已选择 {0} 个节",
105
+ columnCount: "栏数",
106
+ columnGap: "栏间距",
107
+ columnSeparator: "分隔线",
108
+ none: "无",
109
+ betweenColumns: "栏间分隔线",
110
+ sectionStart: "节起始位置",
111
+ unspecified: "未指定",
112
+ continuous: "连续",
113
+ nextPage: "下一页",
114
+ evenPage: "偶数页",
115
+ oddPage: "奇数页"
95
116
  }
96
117
  },
97
118
  rightClick: {
@@ -55,6 +55,7 @@ const locale = { "docs-ui": {
55
55
  deleteTable: "Delete table"
56
56
  },
57
57
  headerFooter: {
58
+ linkToPrevious: "連結到上一節",
58
59
  header: "頁眉",
59
60
  footer: "頁腳",
60
61
  panel: "頁眉頁腳設置",
@@ -75,8 +76,14 @@ const locale = { "docs-ui": {
75
76
  listItem: "項目"
76
77
  },
77
78
  doc: {
78
- menu: { paragraphSetting: "Paragraph Setting" },
79
- slider: { paragraphSetting: "Paragraph Setting" },
79
+ menu: {
80
+ paragraphSetting: "Paragraph Setting",
81
+ sectionSetting: "Section Settings"
82
+ },
83
+ slider: {
84
+ paragraphSetting: "Paragraph Setting",
85
+ sectionSetting: "Section Settings"
86
+ },
80
87
  paragraphSetting: {
81
88
  alignment: "Alignment",
82
89
  indentation: "Indentation",
@@ -92,6 +99,20 @@ const locale = { "docs-ui": {
92
99
  atLeast: "At Least (px)",
93
100
  exactly: "Exactly (px)",
94
101
  fixedValue: "Fixed Value(px)"
102
+ },
103
+ sectionSetting: {
104
+ selectedSections: "{0} sections selected",
105
+ columnCount: "Column count",
106
+ columnGap: "Column gap",
107
+ columnSeparator: "Separator",
108
+ none: "None",
109
+ betweenColumns: "Between columns",
110
+ sectionStart: "Section start",
111
+ unspecified: "Unspecified",
112
+ continuous: "Continuous",
113
+ nextPage: "Next page",
114
+ evenPage: "Even page",
115
+ oddPage: "Odd page"
95
116
  }
96
117
  },
97
118
  rightClick: {
@@ -55,6 +55,7 @@ const locale = { "docs-ui": {
55
55
  deleteTable: "刪除表格"
56
56
  },
57
57
  headerFooter: {
58
+ linkToPrevious: "連結到上一節",
58
59
  header: "頁眉",
59
60
  footer: "頁腳",
60
61
  panel: "頁眉頁腳設置",
@@ -75,8 +76,14 @@ const locale = { "docs-ui": {
75
76
  listItem: "項目"
76
77
  },
77
78
  doc: {
78
- menu: { paragraphSetting: "Paragraph Setting" },
79
- slider: { paragraphSetting: "Paragraph Setting" },
79
+ menu: {
80
+ paragraphSetting: "Paragraph Setting",
81
+ sectionSetting: "Section Settings"
82
+ },
83
+ slider: {
84
+ paragraphSetting: "Paragraph Setting",
85
+ sectionSetting: "Section Settings"
86
+ },
80
87
  paragraphSetting: {
81
88
  alignment: "Alignment",
82
89
  indentation: "Indentation",
@@ -92,6 +99,20 @@ const locale = { "docs-ui": {
92
99
  atLeast: "At Least (px)",
93
100
  exactly: "Exactly (px)",
94
101
  fixedValue: "Fixed Value(px)"
102
+ },
103
+ sectionSetting: {
104
+ selectedSections: "{0} sections selected",
105
+ columnCount: "Column count",
106
+ columnGap: "Column gap",
107
+ columnSeparator: "Separator",
108
+ none: "None",
109
+ betweenColumns: "Between columns",
110
+ sectionStart: "Section start",
111
+ unspecified: "Unspecified",
112
+ continuous: "Continuous",
113
+ nextPage: "Next page",
114
+ evenPage: "Even page",
115
+ oddPage: "Odd page"
95
116
  }
96
117
  },
97
118
  rightClick: {
@@ -13,11 +13,12 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { ICommand, IParagraph, IParagraphBorder, ITextRangeParam } from '@univerjs/core';
17
- export declare function generateParagraphs(dataStream: string, prevParagraph?: IParagraph, borderBottom?: IParagraphBorder): IParagraph[];
16
+ import type { ICommand, IParagraphBorder, ITextRangeParam } from '@univerjs/core';
17
+ import { generateParagraphs } from '@univerjs/docs';
18
+ export { generateParagraphs };
18
19
  interface IBreakLineCommandParams {
19
20
  horizontalLine?: IParagraphBorder;
21
+ insertionMode?: 'split-paragraph' | 'insert-gap';
20
22
  textRange?: ITextRangeParam;
21
23
  }
22
24
  export declare const BreakLineCommand: ICommand<IBreakLineCommandParams>;
23
- export {};
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { ICommand, IDocumentData } from '@univerjs/core';
16
+ import type { ICommand, IDocumentData, JSONXActions } from '@univerjs/core';
17
17
  export interface IMoveDocBlockCommandParams {
18
18
  unitId?: string;
19
19
  sourceRange: {
@@ -29,6 +29,17 @@ export interface IMoveDocBlockActionResult {
29
29
  endOffset: number;
30
30
  };
31
31
  }
32
+ export interface IMoveDocBlockTextChange {
33
+ movedRange: {
34
+ startOffset: number;
35
+ endOffset: number;
36
+ };
37
+ sourceRange: {
38
+ startOffset: number;
39
+ endOffset: number;
40
+ };
41
+ targetOffset: number;
42
+ }
32
43
  export declare const MoveDocBlockCommand: ICommand<IMoveDocBlockCommandParams>;
33
44
  export declare function buildMoveDocBlockActions(params: {
34
45
  documentData: IDocumentData;
@@ -38,3 +49,4 @@ export declare function buildMoveDocBlockActions(params: {
38
49
  };
39
50
  targetOffset: number;
40
51
  }): IMoveDocBlockActionResult;
52
+ export declare function buildReplaceDocumentBodyActions(previousDocumentData: IDocumentData, nextDocumentData: IDocumentData, move?: IMoveDocBlockTextChange): JSONXActions | null;
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { ICommand, IDocumentBody, Nullable } from '@univerjs/core';
16
+ import type { ICommand, IDocumentBlockRange, IDocumentBody, IMultiCommand, Nullable } from '@univerjs/core';
17
17
  import type { IRectRangeWithStyle, ITextRangeWithStyle } from '@univerjs/engine-render';
18
18
  import { DeleteDirection } from '@univerjs/core';
19
19
  export interface IDeleteCustomBlockParams {
@@ -33,5 +33,9 @@ export declare function getCursorWhenDelete(textRanges: Readonly<Nullable<ITextR
33
33
  export declare function isDeleteOffsetInsideBlockRange(body: IDocumentBody, offset: number): boolean;
34
34
  export declare const DeleteLeftCommand: ICommand;
35
35
  export declare const DeleteRightCommand: ICommand;
36
- export declare const DeleteCurrentParagraphCommand: ICommand;
36
+ export interface IDeleteCurrentParagraphCommandParams {
37
+ unitId?: string;
38
+ blockRange?: IDocumentBlockRange;
39
+ }
40
+ export declare const DeleteCurrentParagraphCommand: IMultiCommand<IDeleteCurrentParagraphCommandParams>;
37
41
  export {};
@@ -14,18 +14,13 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import type { ICommand } from '@univerjs/core';
17
- import { BooleanNumber } from '@univerjs/core';
18
- import { HeaderFooterType } from '../../controllers/doc-header-footer.controller';
19
- export interface IHeaderFooterProps {
20
- marginHeader?: number;
21
- marginFooter?: number;
22
- useFirstPageHeaderFooter?: BooleanNumber;
23
- evenAndOddHeaders?: BooleanNumber;
24
- }
17
+ import type { IHeaderFooterProps } from '@univerjs/docs';
18
+ import { HeaderFooterType } from '@univerjs/docs';
25
19
  export interface ICoreHeaderFooterParams {
26
20
  unitId: string;
27
21
  createType?: HeaderFooterType;
28
22
  segmentId?: string;
23
+ sectionId?: string;
29
24
  headerFooterProps?: IHeaderFooterProps;
30
25
  }
31
26
  export declare const CoreHeaderFooterCommandId = "doc.command.core-header-footer";
@@ -37,7 +32,7 @@ interface IOpenHeaderFooterPanelParams {
37
32
  }
38
33
  export declare const OpenHeaderFooterPanelCommand: ICommand<IOpenHeaderFooterPanelParams>;
39
34
  interface ICloseHeaderFooterParams {
40
- unitId: string;
35
+ unitId?: string;
41
36
  }
42
37
  export declare const CloseHeaderFooterCommand: ICommand<ICloseHeaderFooterParams>;
43
38
  export {};
@@ -15,6 +15,7 @@
15
15
  */
16
16
  import type { ICommand, ITextRangeParam } from '@univerjs/core';
17
17
  interface IHorizontalCommandParams {
18
+ insertionMode?: 'split-paragraph' | 'insert-gap';
18
19
  insertRange?: ITextRangeParam;
19
20
  }
20
21
  export declare const HorizontalLineCommand: ICommand<IHorizontalCommandParams>;
@@ -15,7 +15,6 @@
15
15
  */
16
16
  import type { ICommand, IParagraphStyle } from '@univerjs/core';
17
17
  export interface IDocParagraphSettingCommandParams {
18
- paragraph: Partial<Pick<IParagraphStyle, 'hanging' | 'horizontalAlign' | 'spaceBelow' | 'spaceAbove' | 'indentEnd' | 'indentStart' | 'lineSpacing' | 'indentFirstLine' | 'snapToGrid' | 'spacingRule'>>;
19
- sections?: Record<string, any>;
18
+ paragraph?: Partial<Pick<IParagraphStyle, 'hanging' | 'horizontalAlign' | 'spaceBelow' | 'spaceAbove' | 'indentEnd' | 'indentStart' | 'lineSpacing' | 'indentFirstLine' | 'snapToGrid' | 'spacingRule'>>;
20
19
  }
21
20
  export declare const DocParagraphSettingCommand: ICommand<IDocParagraphSettingCommandParams>;
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { ICommand, IDocumentBody, IDocumentData, ITextRange } from '@univerjs/core';
16
+ import type { ICommand, IDocumentBody, IDocumentData, ITextRange, JSONXActions } from '@univerjs/core';
17
17
  import type { ITextRangeWithStyle } from '@univerjs/engine-render';
18
18
  export interface IReplaceSnapshotCommandParams {
19
19
  unitId: string;
@@ -25,6 +25,7 @@ export interface IReplaceSnapshotCommandParams {
25
25
  };
26
26
  }
27
27
  export declare const ReplaceSnapshotCommand: ICommand<IReplaceSnapshotCommandParams>;
28
+ export declare function buildReplaceSnapshotActions(previousSnapshot: IDocumentData, snapshot: IDocumentData): JSONXActions | null;
28
29
  interface IReplaceContentCommandParams {
29
30
  unitId: string;
30
31
  body: IDocumentBody;
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { ICommand, IParagraph, ISectionBreak, ITextRun } from '@univerjs/core';
16
+ import type { ICommand, IDocumentBody, IParagraph, ISectionBreak, ITextRun } from '@univerjs/core';
17
17
  export declare const CreateDocTableCommandId = "doc.command.create-table";
18
18
  export interface ICreateDocTableCommandParams {
19
19
  rowCount: number;
@@ -49,6 +49,7 @@ export declare function shouldCreateParagraphBeforeTable(body: {
49
49
  export declare function normalizeTableInsertOffset(body: {
50
50
  dataStream: string;
51
51
  }, startOffset: number): number;
52
+ export declare function canInsertTableAtOffset(body: Pick<IDocumentBody, 'tables' | 'blockRanges' | 'customBlocks'>, offset: number): boolean;
52
53
  /**
53
54
  * The command to create a table at cursor point.
54
55
  */
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type { ICommand } from '@univerjs/core';
17
+ export declare const DocSectionSettingPanelOperation: ICommand;
@@ -20,14 +20,6 @@ import { DocSkeletonManagerService } from '@univerjs/docs';
20
20
  import { IRenderManagerService } from '@univerjs/engine-render';
21
21
  import { IEditorService } from '../services/editor/editor-manager.service';
22
22
  import { DocSelectionRenderService } from '../services/selection/doc-selection-render.service';
23
- export declare enum HeaderFooterType {
24
- FIRST_PAGE_HEADER = 0,
25
- FIRST_PAGE_FOOTER = 1,
26
- DEFAULT_HEADER = 2,
27
- DEFAULT_FOOTER = 3,
28
- EVEN_PAGE_HEADER = 4,
29
- EVEN_PAGE_FOOTER = 5
30
- }
31
23
  export declare class DocHeaderFooterController extends Disposable implements IRenderModule {
32
24
  private readonly _context;
33
25
  private readonly _commandService;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { Disposable } from '@univerjs/core';
17
+ import { ISidebarService } from '@univerjs/ui';
18
+ export declare class DocSectionSettingController extends Disposable {
19
+ private readonly _sidebarService;
20
+ private readonly _panelId;
21
+ constructor(_sidebarService: ISidebarService);
22
+ openPanel(): void;
23
+ closePanel(): void;
24
+ }
@@ -18,6 +18,7 @@ import type { IRenderContext, IRenderModule } from '@univerjs/engine-render';
18
18
  import { Disposable, ICommandService } from '@univerjs/core';
19
19
  import { DocSkeletonManagerService } from '@univerjs/docs';
20
20
  import { DocMenuStyleService } from '../../services/doc-menu-style.service';
21
+ import { IDocEmbedInteractionBoundaryService, IDocEmbedRuntimeFocusCoordinator } from '../../services/doc-embed-integration.service';
21
22
  import { DocSelectionRenderService } from '../../services/selection/doc-selection-render.service';
22
23
  export declare class DocInputController extends Disposable implements IRenderModule {
23
24
  private readonly _context;
@@ -25,9 +26,11 @@ export declare class DocInputController extends Disposable implements IRenderMod
25
26
  private readonly _docSkeletonManagerService;
26
27
  private readonly _commandService;
27
28
  private readonly _docMenuStyleService;
29
+ private readonly _embedRuntimeFocusCoordinator?;
28
30
  private _onInputSubscription;
29
- constructor(_context: IRenderContext<DocumentDataModel>, _docSelectionRenderService: DocSelectionRenderService, _docSkeletonManagerService: DocSkeletonManagerService, _commandService: ICommandService, _docMenuStyleService: DocMenuStyleService);
31
+ constructor(_context: IRenderContext<DocumentDataModel>, _docSelectionRenderService: DocSelectionRenderService, _docSkeletonManagerService: DocSkeletonManagerService, _commandService: ICommandService, _docMenuStyleService: DocMenuStyleService, _embedInteractionBoundaryService?: IDocEmbedInteractionBoundaryService, _embedRuntimeFocusCoordinator?: IDocEmbedRuntimeFocusCoordinator | undefined);
30
32
  dispose(): void;
31
33
  private _init;
32
34
  private _initialNormalInput;
35
+ private _isEmbedChildInputActive;
33
36
  }
@@ -17,6 +17,7 @@ import type { DocumentDataModel } from '@univerjs/core';
17
17
  import type { IRenderContext, IRenderModule } from '@univerjs/engine-render';
18
18
  import { Disposable, ICommandService, IUniverInstanceService } from '@univerjs/core';
19
19
  import { DocSelectionManagerService, DocSkeletonManagerService } from '@univerjs/docs';
20
+ import { IDocEmbedInteractionBoundaryService, IDocEmbedRuntimeFocusCoordinator } from '../../services/doc-embed-integration.service';
20
21
  import { IEditorService } from '../../services/editor/editor-manager.service';
21
22
  import { DocSelectionRenderService } from '../../services/selection/doc-selection-render.service';
22
23
  export declare class DocSelectionRenderController extends Disposable implements IRenderModule {
@@ -27,8 +28,9 @@ export declare class DocSelectionRenderController extends Disposable implements
27
28
  private readonly _docSelectionRenderService;
28
29
  private readonly _docSkeletonManagerService;
29
30
  private readonly _docSelectionManagerService;
31
+ private readonly _embedRuntimeFocusCoordinator?;
30
32
  private _loadedMap;
31
- constructor(_context: IRenderContext<DocumentDataModel>, _commandService: ICommandService, _editorService: IEditorService, _instanceSrv: IUniverInstanceService, _docSelectionRenderService: DocSelectionRenderService, _docSkeletonManagerService: DocSkeletonManagerService, _docSelectionManagerService: DocSelectionManagerService);
33
+ constructor(_context: IRenderContext<DocumentDataModel>, _commandService: ICommandService, _editorService: IEditorService, _instanceSrv: IUniverInstanceService, _docSelectionRenderService: DocSelectionRenderService, _docSkeletonManagerService: DocSkeletonManagerService, _docSelectionManagerService: DocSelectionManagerService, _embedInteractionBoundaryService?: IDocEmbedInteractionBoundaryService, _embedRuntimeFocusCoordinator?: IDocEmbedRuntimeFocusCoordinator | undefined);
32
34
  private _initialize;
33
35
  private _init;
34
36
  private _refreshListener;
@@ -37,6 +39,8 @@ export declare class DocSelectionRenderController extends Disposable implements
37
39
  private _getTransformCoordForDocumentOffset;
38
40
  private _isEditorReadOnly;
39
41
  private _setEditorFocus;
42
+ private _isEmbedInteractionEvent;
43
+ private _isEmbedChildInteractionActive;
40
44
  private _commandExecutedListener;
41
45
  private _skeletonListener;
42
46
  }
@@ -19,6 +19,7 @@ import { ICommandService, IUniverInstanceService, RxDisposable, ThemeService } f
19
19
  import { DocSelectionManagerService, DocSkeletonManagerService } from '@univerjs/docs';
20
20
  import { IRenderManagerService } from '@univerjs/engine-render';
21
21
  import { DocPageLayoutService } from '../../services/doc-page-layout.service';
22
+ import { DocViewScaleService } from '../../services/doc-view-scale';
22
23
  import { IEditorService } from '../../services/editor/editor-manager.service';
23
24
  import { DocSelectionRenderService } from '../../services/selection/doc-selection-render.service';
24
25
  export declare class DocRenderController extends RxDisposable implements IRenderModule {
@@ -31,10 +32,12 @@ export declare class DocRenderController extends RxDisposable implements IRender
31
32
  private readonly _univerInstanceService;
32
33
  private readonly _docPageLayoutService;
33
34
  private readonly _textSelectionManagerService;
35
+ private readonly _docViewScaleService;
34
36
  private readonly _themeService;
35
- constructor(_context: IRenderContext<DocumentDataModel>, _commandService: ICommandService, _docSelectionRenderService: DocSelectionRenderService, _docSkeletonManagerService: DocSkeletonManagerService, _editorService: IEditorService, _renderManagerService: IRenderManagerService, _univerInstanceService: IUniverInstanceService, _docPageLayoutService: DocPageLayoutService, _textSelectionManagerService: DocSelectionManagerService, _themeService: ThemeService);
37
+ constructor(_context: IRenderContext<DocumentDataModel>, _commandService: ICommandService, _docSelectionRenderService: DocSelectionRenderService, _docSkeletonManagerService: DocSkeletonManagerService, _editorService: IEditorService, _renderManagerService: IRenderManagerService, _univerInstanceService: IUniverInstanceService, _docPageLayoutService: DocPageLayoutService, _textSelectionManagerService: DocSelectionManagerService, _docViewScaleService: DocViewScaleService, _themeService: ThemeService);
36
38
  reRender(unitId: string): void;
37
39
  private _addNewRender;
40
+ private _shouldEnableHorizontalScrollBar;
38
41
  private _addComponent;
39
42
  private _initRenderRefresh;
40
43
  private _create;
@@ -19,6 +19,7 @@ import { Disposable, DocumentFlavor, ICommandService, IContextService, IUniverIn
19
19
  import { DocSelectionManagerService, DocSkeletonManagerService } from '@univerjs/docs';
20
20
  import { IRenderManagerService } from '@univerjs/engine-render';
21
21
  import { DocPageLayoutService } from '../../services/doc-page-layout.service';
22
+ import { IDocEmbedInteractionBoundaryService } from '../../services/doc-embed-integration.service';
22
23
  import { DocViewScaleService } from '../../services/doc-view-scale';
23
24
  import { IEditorService } from '../../services/editor/editor-manager.service';
24
25
  export declare function shouldHandleDocWheelZoom(event: Pick<IWheelEvent, 'ctrlKey' | 'metaKey'>, focusingDoc: boolean, _documentFlavor?: DocumentFlavor): boolean;
@@ -33,10 +34,11 @@ export declare class DocZoomRenderController extends Disposable implements IRend
33
34
  private readonly _docPageLayoutService;
34
35
  private readonly _renderManagerService;
35
36
  private readonly _docViewScaleService;
37
+ private readonly _embedInteractionBoundaryService?;
36
38
  private _isSheetEditor;
37
39
  private _initTimer;
38
40
  private _updateTimer;
39
- constructor(_context: IRenderContext<DocumentDataModel>, _contextService: IContextService, _docSkeletonManagerService: DocSkeletonManagerService, _univerInstanceService: IUniverInstanceService, _commandService: ICommandService, _textSelectionManagerService: DocSelectionManagerService, _editorService: IEditorService, _docPageLayoutService: DocPageLayoutService, _renderManagerService: IRenderManagerService, _docViewScaleService: DocViewScaleService);
41
+ constructor(_context: IRenderContext<DocumentDataModel>, _contextService: IContextService, _docSkeletonManagerService: DocSkeletonManagerService, _univerInstanceService: IUniverInstanceService, _commandService: ICommandService, _textSelectionManagerService: DocSelectionManagerService, _editorService: IEditorService, _docPageLayoutService: DocPageLayoutService, _renderManagerService: IRenderManagerService, _docViewScaleService: DocViewScaleService, _embedInteractionBoundaryService?: IDocEmbedInteractionBoundaryService | undefined);
40
42
  dispose(): void;
41
43
  private _initSkeletonListener;
42
44
  private _initCommandExecutedListener;
@@ -15,6 +15,7 @@
15
15
  */
16
16
  import { Disposable, ICommandService, IConfigService, Injector, IUniverInstanceService } from '@univerjs/core';
17
17
  import { ILayoutService, IMenuManagerService, IShortcutService, IUIPartsService } from '@univerjs/ui';
18
+ import { IDocEmbedInteractionBoundaryService, IDocEmbedRuntimeFocusCoordinator } from '../services/doc-embed-integration.service';
18
19
  export declare class DocUIController extends Disposable {
19
20
  protected readonly _injector: Injector;
20
21
  protected readonly _commandService: ICommandService;
@@ -24,11 +25,13 @@ export declare class DocUIController extends Disposable {
24
25
  protected readonly _univerInstanceService: IUniverInstanceService;
25
26
  protected readonly _shortcutService: IShortcutService;
26
27
  protected readonly _configService: IConfigService;
27
- constructor(_injector: Injector, _commandService: ICommandService, _layoutService: ILayoutService, _menuManagerService: IMenuManagerService, _uiPartsService: IUIPartsService, _univerInstanceService: IUniverInstanceService, _shortcutService: IShortcutService, _configService: IConfigService);
28
+ protected readonly _embedRuntimeFocusCoordinator?: IDocEmbedRuntimeFocusCoordinator | undefined;
29
+ constructor(_injector: Injector, _commandService: ICommandService, _layoutService: ILayoutService, _menuManagerService: IMenuManagerService, _uiPartsService: IUIPartsService, _univerInstanceService: IUniverInstanceService, _shortcutService: IShortcutService, _configService: IConfigService, _embedInteractionBoundaryService?: IDocEmbedInteractionBoundaryService, _embedRuntimeFocusCoordinator?: IDocEmbedRuntimeFocusCoordinator | undefined);
28
30
  private _initUiParts;
29
31
  private _initMenus;
30
32
  private _initShortCut;
31
33
  private _init;
32
34
  private _initCommands;
33
35
  private _initFocusHandler;
36
+ private _shouldPreserveEmbedFocus;
34
37
  }
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export interface IDocsCustomBlockBleedViewport {
17
+ bleedLeft: number;
18
+ bleedRight: number;
19
+ bleedWidth: number;
20
+ contentWidth: number;
21
+ virtualWidth: number;
22
+ }
23
+ export interface IDocsCustomBlockBleedViewportHint {
24
+ bleedLeft?: number;
25
+ bleedWidth?: number;
26
+ }
27
+ export declare function createDefaultDocsTableLikeCustomBlockBleedViewport(): IDocsCustomBlockBleedViewport;
28
+ export declare function resolveDocsTableLikeCustomBlockBleedViewport(root: HTMLElement, contentWidth: number, hint?: IDocsCustomBlockBleedViewportHint): IDocsCustomBlockBleedViewport;
29
+ export declare function resolveDocsTableLikeCustomBlockContentWidth(authoritativeContentWidth: number | undefined, fallbackContentWidth: number): number;
30
+ export declare function resolveDocsTableLikeCustomBlockContentHeight(authoritativeContentHeight: number | undefined, fallbackContentHeight: number): number;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export declare function collectDocsTableLikeEmbedChildUnitIds(drawings: Record<string, unknown> | undefined, resolveChildUnitId?: (data: Record<string, unknown>) => string | undefined): Set<string>;
17
+ export declare function getCommandUnitId(commandParams: unknown): string | undefined;
18
+ export declare function shouldRefreshDocsCustomBlockSizeForCommand(params: {
19
+ commandId?: string;
20
+ childUnitIds: Set<string>;
21
+ commandParams: unknown;
22
+ hostUnitId: string;
23
+ }): boolean;
24
+ export interface IDocsCustomBlockSizeRefreshScheduler {
25
+ dispose: () => void;
26
+ schedule: () => void;
27
+ }
28
+ export declare function createDocsCustomBlockSizeRefreshScheduler(refresh: () => void): IDocsCustomBlockSizeRefreshScheduler;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export interface IDocsTableLikeCustomBlockScrollOptions {
17
+ maxScrollLeft?: number;
18
+ }
19
+ export declare function scrollDocsTableLikeCustomBlockLive(event: WheelEvent, live: HTMLElement, options?: IDocsTableLikeCustomBlockScrollOptions): boolean;