@univerjs/docs-ui 1.0.0-alpha.7 → 1.0.0-beta.0

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 (108) hide show
  1. package/lib/cjs/index.js +1373 -1166
  2. package/lib/cjs/locale/ar-SA.js +39 -26
  3. package/lib/cjs/locale/ca-ES.js +39 -26
  4. package/lib/cjs/locale/de-DE.js +39 -26
  5. package/lib/cjs/locale/en-US.js +14 -1
  6. package/lib/cjs/locale/es-ES.js +39 -26
  7. package/lib/cjs/locale/fa-IR.js +41 -28
  8. package/lib/cjs/locale/fr-FR.js +42 -29
  9. package/lib/cjs/locale/id-ID.js +39 -26
  10. package/lib/cjs/locale/it-IT.js +39 -26
  11. package/lib/cjs/locale/ja-JP.js +39 -26
  12. package/lib/cjs/locale/ko-KR.js +39 -26
  13. package/lib/cjs/locale/pl-PL.js +38 -25
  14. package/lib/cjs/locale/pt-BR.js +39 -26
  15. package/lib/cjs/locale/ru-RU.js +39 -26
  16. package/lib/cjs/locale/sk-SK.js +39 -26
  17. package/lib/cjs/locale/vi-VN.js +60 -47
  18. package/lib/cjs/locale/zh-CN.js +14 -1
  19. package/lib/cjs/locale/zh-HK.js +68 -55
  20. package/lib/cjs/locale/zh-TW.js +50 -37
  21. package/lib/es/index.js +1376 -1124
  22. package/lib/es/locale/ar-SA.js +39 -26
  23. package/lib/es/locale/ca-ES.js +39 -26
  24. package/lib/es/locale/de-DE.js +39 -26
  25. package/lib/es/locale/en-US.js +14 -1
  26. package/lib/es/locale/es-ES.js +39 -26
  27. package/lib/es/locale/fa-IR.js +41 -28
  28. package/lib/es/locale/fr-FR.js +42 -29
  29. package/lib/es/locale/id-ID.js +39 -26
  30. package/lib/es/locale/it-IT.js +39 -26
  31. package/lib/es/locale/ja-JP.js +39 -26
  32. package/lib/es/locale/ko-KR.js +39 -26
  33. package/lib/es/locale/pl-PL.js +38 -25
  34. package/lib/es/locale/pt-BR.js +39 -26
  35. package/lib/es/locale/ru-RU.js +39 -26
  36. package/lib/es/locale/sk-SK.js +39 -26
  37. package/lib/es/locale/vi-VN.js +60 -47
  38. package/lib/es/locale/zh-CN.js +14 -1
  39. package/lib/es/locale/zh-HK.js +68 -55
  40. package/lib/es/locale/zh-TW.js +50 -37
  41. package/lib/index.css +15 -1
  42. package/lib/index.js +1376 -1124
  43. package/lib/locale/ar-SA.js +39 -26
  44. package/lib/locale/ca-ES.js +39 -26
  45. package/lib/locale/de-DE.js +39 -26
  46. package/lib/locale/en-US.js +14 -1
  47. package/lib/locale/es-ES.js +39 -26
  48. package/lib/locale/fa-IR.js +41 -28
  49. package/lib/locale/fr-FR.js +42 -29
  50. package/lib/locale/id-ID.js +39 -26
  51. package/lib/locale/it-IT.js +39 -26
  52. package/lib/locale/ja-JP.js +39 -26
  53. package/lib/locale/ko-KR.js +39 -26
  54. package/lib/locale/pl-PL.js +38 -25
  55. package/lib/locale/pt-BR.js +39 -26
  56. package/lib/locale/ru-RU.js +39 -26
  57. package/lib/locale/sk-SK.js +39 -26
  58. package/lib/locale/vi-VN.js +60 -47
  59. package/lib/locale/zh-CN.js +14 -1
  60. package/lib/locale/zh-HK.js +68 -55
  61. package/lib/locale/zh-TW.js +50 -37
  62. package/lib/types/basics/component-tools.d.ts +3 -5
  63. package/lib/types/basics/doc-custom-range-chrome.d.ts +31 -0
  64. package/lib/types/commands/commands/break-line.command.d.ts +5 -1
  65. package/lib/types/commands/commands/clipboard.inner.command.d.ts +2 -0
  66. package/lib/types/commands/commands/doc-horizontal-line.command.d.ts +2 -1
  67. package/lib/types/commands/commands/replace-content.command.d.ts +10 -14
  68. package/lib/types/commands/operations/insert-break.operation.d.ts +21 -0
  69. package/lib/types/controllers/doc-move-cursor.controller.d.ts +0 -1
  70. package/lib/types/controllers/doc-section-setting.controller.d.ts +4 -1
  71. package/lib/types/controllers/render-controllers/doc-paragraph-placeholder.render-controller.d.ts +11 -2
  72. package/lib/types/embed-docs-custom-block-bleed.d.ts +2 -0
  73. package/lib/types/embed-host-anchor.d.ts +2 -0
  74. package/lib/types/index.d.ts +10 -11
  75. package/lib/types/locale/en-US.d.ts +13 -0
  76. package/lib/types/menu/menu.d.ts +13 -0
  77. package/lib/types/menu/paragraph-menu.d.ts +1 -1
  78. package/lib/types/services/clipboard/clipboard.service.d.ts +11 -2
  79. package/lib/types/services/clipboard/doc-paste-mutation-adapter.service.d.ts +6 -1
  80. package/lib/types/services/editor/editor-manager.service.d.ts +2 -0
  81. package/lib/types/services/editor/editor.d.ts +9 -26
  82. package/lib/types/services/selection/doc-selection-render.service.d.ts +0 -3
  83. package/lib/types/views/RichTextEditor.d.ts +2 -0
  84. package/lib/types/views/paragraph-setting/hook/utils.d.ts +2 -0
  85. package/lib/types/views/rich-text-editor/hooks/use-editor.d.ts +1 -0
  86. package/lib/types/views/rich-text-editor/hooks/use-keyboard-event.d.ts +2 -1
  87. package/lib/types/views/section-setting/use-section-setting.d.ts +33 -2
  88. package/lib/umd/index.js +11 -10
  89. package/lib/umd/locale/ar-SA.js +1 -1
  90. package/lib/umd/locale/ca-ES.js +1 -1
  91. package/lib/umd/locale/de-DE.js +1 -1
  92. package/lib/umd/locale/en-US.js +1 -1
  93. package/lib/umd/locale/es-ES.js +1 -1
  94. package/lib/umd/locale/fa-IR.js +1 -1
  95. package/lib/umd/locale/fr-FR.js +1 -1
  96. package/lib/umd/locale/id-ID.js +1 -1
  97. package/lib/umd/locale/it-IT.js +1 -1
  98. package/lib/umd/locale/ja-JP.js +1 -1
  99. package/lib/umd/locale/ko-KR.js +1 -1
  100. package/lib/umd/locale/pl-PL.js +1 -1
  101. package/lib/umd/locale/pt-BR.js +1 -1
  102. package/lib/umd/locale/ru-RU.js +1 -1
  103. package/lib/umd/locale/sk-SK.js +1 -1
  104. package/lib/umd/locale/vi-VN.js +1 -1
  105. package/lib/umd/locale/zh-CN.js +1 -1
  106. package/lib/umd/locale/zh-HK.js +1 -1
  107. package/lib/umd/locale/zh-TW.js +1 -1
  108. package/package.json +10 -10
@@ -14,23 +14,30 @@ const locale = { "docs-ui": {
14
14
  textColor: { main: "文字顏色" },
15
15
  fillColor: { main: "文字背景色" },
16
16
  table: {
17
- main: "Table",
18
- insert: "Insert Table",
19
- colCount: "Column count",
20
- rowCount: "Row count"
17
+ main: "表格",
18
+ insert: "插入表格",
19
+ colCount: "欄數",
20
+ rowCount: "列數"
21
21
  },
22
22
  resetColor: "重置顏色",
23
23
  order: "有序列表",
24
24
  unorder: "無序列表",
25
25
  checklist: "任務列表",
26
- documentFlavor: "现代模式",
26
+ documentFlavor: "現代模式",
27
27
  alignLeft: "左對齊",
28
28
  alignCenter: "居中對齊",
29
29
  alignRight: "右對齊",
30
30
  alignJustify: "兩端對齊",
31
- horizontalLine: "Horizontal line",
31
+ horizontalLine: "水平線",
32
32
  headerFooter: "頁眉頁腳",
33
33
  pageSetup: "頁面設置",
34
+ breaks: "分隔符",
35
+ columnBreak: "分欄符",
36
+ sectionBreakNextPage: "分節符(下一頁)",
37
+ sectionBreakContinuous: "分節符(連續)",
38
+ sectionBreakNextColumn: "分節符(下一欄)",
39
+ sectionBreakEvenPage: "分節符(偶數頁)",
40
+ sectionBreakOddPage: "分節符(奇數頁)",
34
41
  heading: {
35
42
  tooltip: "標題",
36
43
  normal: "普通文字",
@@ -78,42 +85,48 @@ const locale = { "docs-ui": {
78
85
  doc: {
79
86
  blockMenu: { dragBlock: "拖曳區塊" },
80
87
  menu: {
81
- paragraphSetting: "Paragraph Setting",
82
- sectionSetting: "Section Settings"
88
+ paragraphSetting: "段落設定",
89
+ sectionSetting: "節設定"
83
90
  },
84
91
  slider: {
85
- paragraphSetting: "Paragraph Setting",
86
- sectionSetting: "Section Settings"
92
+ paragraphSetting: "段落設定",
93
+ sectionSetting: "節設定"
87
94
  },
88
95
  paragraphSetting: {
89
- alignment: "Alignment",
90
- indentation: "Indentation",
91
- left: "Left",
92
- right: "Right",
93
- firstLine: "First Line",
94
- hanging: "Hanging",
95
- spacing: "Spacing",
96
- before: "Before",
97
- after: "After",
98
- lineSpace: "Line Space",
99
- multiSpace: "Multi Space",
100
- atLeast: "At Least (px)",
101
- exactly: "Exactly (px)",
102
- fixedValue: "Fixed Value(px)"
96
+ alignment: "對齊方式",
97
+ indentation: "縮排",
98
+ left: "左",
99
+ right: "右",
100
+ firstLine: "第一行",
101
+ hanging: "凸排",
102
+ spacing: "間距",
103
+ before: "段前",
104
+ after: "段後",
105
+ lineSpace: "行距",
106
+ multiSpace: "多倍行距",
107
+ atLeast: "至少 (px)",
108
+ exactly: "固定值 (px)",
109
+ fixedValue: "固定值 (px)"
103
110
  },
104
111
  sectionSetting: {
105
- selectedSections: "{0} sections selected",
106
- columnCount: "Column count",
107
- columnGap: "Column gap",
108
- columnSeparator: "Separator",
109
- none: "None",
110
- betweenColumns: "Between columns",
111
- sectionStart: "Section start",
112
- unspecified: "Unspecified",
113
- continuous: "Continuous",
114
- nextPage: "Next page",
115
- evenPage: "Even page",
116
- oddPage: "Odd page"
112
+ selectedSections: "已選取 {0} 個節",
113
+ multipleValues: "多個值",
114
+ columnCount: "欄數",
115
+ columnGap: "欄間距",
116
+ columnSeparator: "分隔線",
117
+ none: "無",
118
+ betweenColumns: "欄之間",
119
+ sectionStart: "節起始位置",
120
+ unspecified: "未指定",
121
+ continuous: "接續本頁",
122
+ nextColumn: "下一欄",
123
+ nextPage: "下一頁",
124
+ evenPage: "偶數頁",
125
+ oddPage: "奇數頁",
126
+ pageSetup: "頁面設定",
127
+ pageWidth: "頁面寬度",
128
+ pageHeight: "頁面高度",
129
+ pageNumberStart: "起始頁碼"
117
130
  }
118
131
  },
119
132
  rightClick: {
@@ -139,7 +152,7 @@ const locale = { "docs-ui": {
139
152
  noBackground: "無背景色"
140
153
  },
141
154
  "page-settings": {
142
- "document-setting": "文檔設置",
155
+ "document-setting": "文件設定",
143
156
  mode: "模式",
144
157
  "modern-mode": "現代模式",
145
158
  "classic-mode": "經典模式",
@@ -13,20 +13,18 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { DocumentDataModel, IUniverInstanceService, Nullable } from '@univerjs/core';
17
- import type { DocBackground, Documents, Engine, IRenderContext, IRenderManagerService, Scene } from '@univerjs/engine-render';
16
+ import type { DocumentDataModel, Nullable } from '@univerjs/core';
17
+ import type { DocBackground, Documents, Engine, IRender, IRenderContext, IRenderManagerService, Scene } from '@univerjs/engine-render';
18
18
  export interface IDocObjectParam {
19
19
  document: Documents;
20
20
  docBackground: DocBackground;
21
21
  scene: Scene;
22
22
  engine: Engine;
23
23
  }
24
- export declare function neoGetDocObject(renderContext: IRenderContext<DocumentDataModel>): {
24
+ export declare function neoGetDocObject(renderContext: IRender | IRenderContext<DocumentDataModel>): {
25
25
  document: Documents;
26
26
  docBackground: DocBackground;
27
27
  scene: Scene;
28
28
  engine: Engine;
29
29
  };
30
- /** @deprecated After migrating to `RenderUnit`, use `neoGetDocObject` instead. */
31
- export declare function getDocObject(univerInstanceService: IUniverInstanceService, renderManagerService: IRenderManagerService): Nullable<IDocObjectParam>;
32
30
  export declare function getDocObjectById(unitId: string, renderManagerService: IRenderManagerService): Nullable<IDocObjectParam>;
@@ -0,0 +1,31 @@
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 { ThemeService } from '@univerjs/core';
17
+ import type { UniverRenderingContext } from '@univerjs/engine-render';
18
+ export declare const DOC_CUSTOM_RANGE_CHROME_RADIUS = 1;
19
+ export declare const DOC_CUSTOM_RANGE_CHROME_BACKGROUND_ALPHA = 0.07;
20
+ export interface IDocCustomRangeChromeRect {
21
+ bottom: number;
22
+ left: number;
23
+ right: number;
24
+ top: number;
25
+ }
26
+ export interface IDocCustomRangeChromeTheme {
27
+ background: string;
28
+ border: string;
29
+ }
30
+ export declare function resolveDocCustomRangeChromeTheme(themeService: ThemeService): IDocCustomRangeChromeTheme;
31
+ export declare function drawDocCustomRangeChrome(ctx: Pick<UniverRenderingContext, 'beginPath' | 'fill' | 'fillStyle' | 'lineWidth' | 'restore' | 'roundRect' | 'save' | 'stroke' | 'strokeStyle'>, rect: IDocCustomRangeChromeRect, theme: IDocCustomRangeChromeTheme): void;
@@ -16,9 +16,13 @@
16
16
  import type { ICommand, IParagraphBorder, ITextRangeParam } from '@univerjs/core';
17
17
  import { generateParagraphs } from '@univerjs/docs';
18
18
  export { generateParagraphs };
19
+ export declare enum BreakLineInsertionMode {
20
+ SplitParagraph = "split-paragraph",
21
+ InsertGap = "insert-gap"
22
+ }
19
23
  interface IBreakLineCommandParams {
20
24
  horizontalLine?: IParagraphBorder;
21
- insertionMode?: 'split-paragraph' | 'insert-gap';
25
+ insertionMode?: BreakLineInsertionMode;
22
26
  textRange?: ITextRangeParam;
23
27
  }
24
28
  export declare const BreakLineCommand: ICommand<IBreakLineCommandParams>;
@@ -15,10 +15,12 @@
15
15
  */
16
16
  import type { DocumentDataModel, ICommand, IDocumentData, ITextRange, JSONXActions, Nullable } from '@univerjs/core';
17
17
  import type { DocumentViewModel, IRectRangeWithStyle, ITextRangeWithStyle } from '@univerjs/engine-render';
18
+ import type { IDocClipboardPasteCustomRangeMapping } from '../../services/clipboard/doc-paste-mutation-adapter.service';
18
19
  export interface IInnerPasteCommandParams {
19
20
  segmentId: string;
20
21
  doc: Partial<IDocumentData>;
21
22
  textRanges: ITextRangeWithStyle[];
23
+ customRangeMappings?: IDocClipboardPasteCustomRangeMapping[];
22
24
  }
23
25
  export declare const InnerPasteCommand: ICommand<IInnerPasteCommandParams>;
24
26
  export declare function getCutActionsFromDocRanges(textRanges: Readonly<Nullable<ITextRangeWithStyle[]>>, rectRanges: Readonly<Nullable<IRectRangeWithStyle[]>>, docDataModel: DocumentDataModel, viewModel: DocumentViewModel, segmentId: string): JSONXActions;
@@ -14,8 +14,9 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import type { ICommand, ITextRangeParam } from '@univerjs/core';
17
+ import { BreakLineInsertionMode } from './break-line.command';
17
18
  interface IHorizontalCommandParams {
18
- insertionMode?: 'split-paragraph' | 'insert-gap';
19
+ insertionMode?: BreakLineInsertionMode;
19
20
  insertRange?: ITextRangeParam;
20
21
  }
21
22
  export declare const HorizontalLineCommand: ICommand<IHorizontalCommandParams>;
@@ -26,19 +26,6 @@ export interface IReplaceSnapshotCommandParams {
26
26
  }
27
27
  export declare const ReplaceSnapshotCommand: ICommand<IReplaceSnapshotCommandParams>;
28
28
  export declare function buildReplaceSnapshotActions(previousSnapshot: IDocumentData, snapshot: IDocumentData): JSONXActions | null;
29
- interface IReplaceContentCommandParams {
30
- unitId: string;
31
- body: IDocumentBody;
32
- textRanges: ITextRangeWithStyle[];
33
- segmentId?: string;
34
- options: {
35
- [key: string]: boolean;
36
- };
37
- }
38
- /**
39
- * @deprecated please use ReplaceSnapshotCommand instead.
40
- */
41
- export declare const ReplaceContentCommand: ICommand<IReplaceContentCommandParams>;
42
29
  interface ICoverContentCommandParams {
43
30
  unitId: string;
44
31
  body: IDocumentBody;
@@ -53,5 +40,14 @@ export interface IReplaceSelectionCommandParams {
53
40
  textRanges?: ITextRangeWithStyle[];
54
41
  }
55
42
  export declare const ReplaceSelectionCommand: ICommand<IReplaceSelectionCommandParams>;
56
- export declare const ReplaceTextRunsCommand: ICommand<IReplaceContentCommandParams>;
43
+ interface IReplaceTextRunsCommandParams {
44
+ unitId: string;
45
+ body: IDocumentBody;
46
+ textRanges: ITextRangeWithStyle[];
47
+ segmentId?: string;
48
+ options: {
49
+ [key: string]: boolean;
50
+ };
51
+ }
52
+ export declare const ReplaceTextRunsCommand: ICommand<IReplaceTextRunsCommandParams>;
57
53
  export {};
@@ -0,0 +1,21 @@
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, SectionType } from '@univerjs/core';
17
+ export interface IInsertDocumentSectionBreakOperationParams {
18
+ sectionType: SectionType;
19
+ }
20
+ export declare const InsertDocumentColumnBreakOperation: ICommand;
21
+ export declare const InsertDocumentSectionBreakOperation: ICommand<IInsertDocumentSectionBreakOperationParams>;
@@ -67,5 +67,4 @@ export declare class DocMoveCursorController extends Disposable {
67
67
  private _getDistanceToColumnGroupColumn;
68
68
  private _isColumnGroupContentPage;
69
69
  private _scrollToFocusNodePosition;
70
- private _getDocObject;
71
70
  }
@@ -14,11 +14,14 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { Disposable } from '@univerjs/core';
17
+ import { DocSelectionManagerService } from '@univerjs/docs';
17
18
  import { ISidebarService } from '@univerjs/ui';
18
19
  export declare class DocSectionSettingController extends Disposable {
19
20
  private readonly _sidebarService;
21
+ private readonly _selectionManager;
20
22
  private readonly _panelId;
21
- constructor(_sidebarService: ISidebarService);
23
+ constructor(_sidebarService: ISidebarService, _selectionManager: DocSelectionManagerService);
22
24
  openPanel(): void;
23
25
  closePanel(): void;
26
+ navigateToSectionEnd(unitId: string, sectionStart: number, sectionEnd: number): void;
24
27
  }
@@ -14,11 +14,15 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import type { DocumentDataModel, IDocumentBody, Nullable } from '@univerjs/core';
17
- import type { IDocumentSkeletonPage, IRenderContext, IRenderModule } from '@univerjs/engine-render';
17
+ import type { IDocumentSkeletonPage, IRenderContext, IRenderModule, UniverRenderingContext } from '@univerjs/engine-render';
18
18
  import type { IUniverDocsUIConfig } from '../../config/config';
19
19
  import { Disposable, IConfigService, LocaleService } from '@univerjs/core';
20
20
  import { DocSelectionManagerService } from '@univerjs/docs';
21
21
  export interface IParagraphPlaceholderLayout {
22
+ clipBottom?: number;
23
+ clipLeft?: number;
24
+ clipRight?: number;
25
+ clipTop?: number;
22
26
  fontFamily: string;
23
27
  fontSize: number;
24
28
  fontWeight: string;
@@ -36,6 +40,10 @@ interface IParagraphPlaceholderLocale {
36
40
  listItem: string;
37
41
  normalText: string;
38
42
  }
43
+ interface IParagraphPlaceholderLayoutOptions {
44
+ docsLeft?: number;
45
+ unitId?: string;
46
+ }
39
47
  export declare class DocParagraphPlaceholderRenderController extends Disposable implements IRenderModule {
40
48
  private readonly _context;
41
49
  private readonly _localeService;
@@ -47,5 +55,6 @@ export declare class DocParagraphPlaceholderRenderController extends Disposable
47
55
  private _getLocale;
48
56
  }
49
57
  export declare function shouldRenderParagraphPlaceholder(documentModel: DocumentDataModel, unitId: string, config?: Nullable<IUniverDocsUIConfig>): boolean;
50
- export declare function getParagraphPlaceholderLayouts(page: IDocumentSkeletonPage, body: IDocumentBody, locale: IParagraphPlaceholderLocale, pageLeft?: number, pageTop?: number, activeOffset?: number): IParagraphPlaceholderLayout[];
58
+ export declare function getParagraphPlaceholderLayouts(page: IDocumentSkeletonPage, body: IDocumentBody, locale: IParagraphPlaceholderLocale, pageLeft?: number, pageTop?: number, activeOffset?: number, options?: IParagraphPlaceholderLayoutOptions): IParagraphPlaceholderLayout[];
59
+ export declare function drawParagraphPlaceholders(ctx: UniverRenderingContext, placeholders: IParagraphPlaceholderLayout[]): void;
51
60
  export {};
@@ -21,8 +21,10 @@ export interface IDocsCustomBlockBleedViewport {
21
21
  virtualWidth: number;
22
22
  }
23
23
  export interface IDocsCustomBlockBleedViewportHint {
24
+ authoritativeContentWidth?: boolean;
24
25
  bleedLeft?: number;
25
26
  bleedWidth?: number;
27
+ viewScale?: number;
26
28
  }
27
29
  export declare function createDefaultDocsTableLikeCustomBlockBleedViewport(): IDocsCustomBlockBleedViewport;
28
30
  export declare function resolveDocsTableLikeCustomBlockBleedViewport(root: HTMLElement, contentWidth: number, hint?: IDocsCustomBlockBleedViewportHint): IDocsCustomBlockBleedViewport;
@@ -39,6 +39,8 @@ export interface IDocsCustomBlockLayoutViewport {
39
39
  height: number;
40
40
  layoutWidth?: number;
41
41
  offsetLeft?: number;
42
+ pageContentWidth?: number;
43
+ viewScale?: number;
42
44
  viewportHeight?: number;
43
45
  width: number;
44
46
  }
@@ -15,8 +15,10 @@
15
15
  */
16
16
  import './global.css';
17
17
  export type { IDocObjectParam } from './basics/component-tools';
18
- export { getDocObject, getDocObjectById, neoGetDocObject } from './basics/component-tools';
18
+ export { getDocObjectById, neoGetDocObject } from './basics/component-tools';
19
19
  export { addCustomDecorationBySelectionFactory, addCustomDecorationFactory, deleteCustomDecorationFactory, } from './basics/custom-decoration-factory';
20
+ export { DOC_CUSTOM_RANGE_CHROME_BACKGROUND_ALPHA, DOC_CUSTOM_RANGE_CHROME_RADIUS, drawDocCustomRangeChrome, resolveDocCustomRangeChromeTheme, } from './basics/doc-custom-range-chrome';
21
+ export type { IDocCustomRangeChromeRect, IDocCustomRangeChromeTheme, } from './basics/doc-custom-range-chrome';
20
22
  export * from './basics/docs-view-key';
21
23
  export { hasParagraphInTable } from './basics/paragraph';
22
24
  export { AfterSpaceCommand, EnterCommand, TabCommand } from './commands/commands/auto-format.command';
@@ -31,7 +33,7 @@ export { getCutActionsFromDocRanges } from './commands/commands/clipboard.inner.
31
33
  export { buildMoveDocBlockActions, MoveDocBlockCommand } from './commands/commands/doc-block-move.command';
32
34
  export type { IMoveDocBlockCommandParams } from './commands/commands/doc-block-move.command';
33
35
  export { DeleteCurrentParagraphCommand, DeleteCustomBlockCommand, DeleteLeftCommand, DeleteRightCommand, MergeTwoParagraphCommand, } from './commands/commands/doc-delete.command';
34
- export type { IDeleteCurrentParagraphCommandParams, IDeleteCustomBlockParams } from './commands/commands/doc-delete.command';
36
+ export type { IDeleteCurrentParagraphCommandParams, IDeleteCustomBlockParams, } from './commands/commands/doc-delete.command';
35
37
  export { getCursorWhenDelete } from './commands/commands/doc-delete.command';
36
38
  export { HorizontalLineCommand } from './commands/commands/doc-horizontal-line.command';
37
39
  export { DocSelectAllCommand } from './commands/commands/doc-select-all.command';
@@ -44,7 +46,7 @@ export { BulletListCommand, ChangeListNestingLevelCommand, ChangeListTypeCommand
44
46
  export { ChangeListNestingLevelType } from './commands/commands/list.command';
45
47
  export { AlignCenterCommand, AlignJustifyCommand, AlignLeftCommand, AlignOperationCommand, AlignRightCommand, } from './commands/commands/paragraph-align.command';
46
48
  export { ReplaceTextRunsCommand } from './commands/commands/replace-content.command';
47
- export { CoverContentCommand, ReplaceContentCommand, ReplaceSelectionCommand, ReplaceSnapshotCommand, } from './commands/commands/replace-content.command';
49
+ export { CoverContentCommand, ReplaceSelectionCommand, ReplaceSnapshotCommand, } from './commands/commands/replace-content.command';
48
50
  export type { IReplaceSelectionCommandParams, IReplaceSnapshotCommandParams, } from './commands/commands/replace-content.command';
49
51
  export { SetDocZoomRatioCommand } from './commands/commands/set-doc-zoom-ratio.command';
50
52
  export { SetParagraphNamedStyleCommand } from './commands/commands/set-heading.command';
@@ -73,7 +75,7 @@ export { DocRenderController } from './controllers/render-controllers/doc.render
73
75
  export { DocUIController } from './controllers/ui.controller';
74
76
  export { createDefaultDocsTableLikeCustomBlockBleedViewport, resolveDocsTableLikeCustomBlockBleedViewport, resolveDocsTableLikeCustomBlockContentHeight, resolveDocsTableLikeCustomBlockContentWidth, } from './embed-docs-custom-block-bleed';
75
77
  export type { IDocsCustomBlockBleedViewport, IDocsCustomBlockBleedViewportHint } from './embed-docs-custom-block-bleed';
76
- export { collectDocsTableLikeEmbedChildUnitIds, createDocsCustomBlockSizeRefreshScheduler, shouldRefreshDocsCustomBlockSizeForCommand } from './embed-docs-custom-block-refresh';
78
+ export { collectDocsTableLikeEmbedChildUnitIds, createDocsCustomBlockSizeRefreshScheduler, shouldRefreshDocsCustomBlockSizeForCommand, } from './embed-docs-custom-block-refresh';
77
79
  export { scrollDocsTableLikeCustomBlockLive } from './embed-docs-custom-block-scroll';
78
80
  export type { IDocsTableLikeCustomBlockScrollOptions } from './embed-docs-custom-block-scroll';
79
81
  export { resolveDocsCustomBlockRenderViewport } from './embed-host-anchor';
@@ -84,15 +86,14 @@ export { menuSchema as DocsUIMenuSchema } from './menu/schema';
84
86
  export { UniverDocsUIPlugin } from './plugin';
85
87
  export * from './services';
86
88
  export { IDocClipboardService } from './services/clipboard/clipboard.service';
87
- export type { IDocClipboardHook } from './services/clipboard/clipboard.service';
89
+ export type { IDocClipboardCopyContentContext, IDocClipboardHook, IDocClipboardPasteContext, } from './services/clipboard/clipboard.service';
88
90
  export { DocClipboardPasteAdapterService, IDocClipboardPasteAdapterService, } from './services/clipboard/doc-paste-mutation-adapter.service';
89
- export type { IDocClipboardPasteAdapter, IDocClipboardPasteBlockRangeMapping, IDocClipboardPasteCustomBlockMapping, IDocClipboardPasteMutationInfoParams, IDocClipboardPasteMutationInfos, } from './services/clipboard/doc-paste-mutation-adapter.service';
91
+ export type { IDocClipboardPasteAdapter, IDocClipboardPasteBlockRangeMapping, IDocClipboardPasteCustomBlockMapping, IDocClipboardPasteCustomRangeMapping, IDocClipboardPasteMutationInfoParams, IDocClipboardPasteMutationInfos, } from './services/clipboard/doc-paste-mutation-adapter.service';
90
92
  export { convertBodyToHtml } from './services/clipboard/udm-to-html/convertor';
91
93
  export { DocHtmlExportService } from './services/clipboard/udm-to-html/doc-html-export.service';
92
94
  export type { DocHtmlExportTransformer } from './services/clipboard/udm-to-html/doc-html-export.service';
93
95
  export { DocAutoFormatService } from './services/doc-auto-format.service';
94
- export { DOC_EMBED_INTERACTION_BOUNDARY_OWNER_ATTRIBUTE, IDocEmbedInteractionBoundaryService, IDocEmbedRuntimeFocusCoordinator } from './services/doc-embed-integration.service';
95
- export type { IDocEmbedInteractionBoundaryService as IDocEmbedInteractionBoundaryServiceType, IDocEmbedRuntimeFocusCoordinator as IDocEmbedRuntimeFocusCoordinatorType } from './services/doc-embed-integration.service';
96
+ export { DOC_EMBED_INTERACTION_BOUNDARY_OWNER_ATTRIBUTE, IDocEmbedInteractionBoundaryService, IDocEmbedRuntimeFocusCoordinator, } from './services/doc-embed-integration.service';
96
97
  export { DocEventManagerService, getListMarkerFallbackBound, getListParagraphContextMenuHit, } from './services/doc-event-manager.service';
97
98
  export type { IBulletBound, IMutiPageParagraphBound } from './services/doc-event-manager.service';
98
99
  export { DocIMEInputManagerService } from './services/doc-ime-input-manager.service';
@@ -112,7 +113,7 @@ export type { IEditorInputConfig } from './services/selection/doc-selection-rend
112
113
  export { DocSelectionRenderService } from './services/selection/doc-selection-render.service';
113
114
  export type { IDocRange } from './services/selection/range-interface';
114
115
  export { convertPositionsToRectRanges, RectRange } from './services/selection/rect-range';
115
- export { getCanvasOffsetByEngine } from './services/selection/selection-utils';
116
+ export { getCanvasOffsetByEngine, getTextRangeFromCharIndex } from './services/selection/selection-utils';
116
117
  export { getAnchorBounding, getLineBounding, TEXT_RANGE_LAYER_INDEX, TextRange } from './services/selection/text-range';
117
118
  export { whenDocAndEditorFocused } from './shortcuts/utils';
118
119
  export { DOC_VERTICAL_PADDING } from './types/const/padding';
@@ -120,5 +121,3 @@ export { createEditorUndoRedoKeyboardConfig, executeEditorUndoRedoCommand, useEd
120
121
  export type { ICreateEditorUndoRedoKeyboardConfigOptions, IExecuteEditorUndoRedoCommandOptions, IKeyboardEventConfig, } from './views/rich-text-editor/hooks';
121
122
  export { RichTextEditor } from './views/RichTextEditor';
122
123
  export type { IRichTextEditorProps } from './views/RichTextEditor';
123
- export { createDocsCustomBlockInsertMutation, createDocsCustomBlockRemoveMutation, createEmbedDocsCustomBlockData, createInsertCustomBlockActions, createRemoveCustomBlockActions, EMBED_DOCS_CUSTOM_BLOCK_DEFAULT_COMPONENT_KEY, isSheetLikeDocsCustomBlockChildType, resolveDocsCustomBlockSize } from '@univerjs/docs';
124
- export type { IDocsCustomBlockMutationParams, IEmbedDocsCustomBlockData } from '@univerjs/docs';
@@ -50,6 +50,13 @@ declare const locale: {
50
50
  horizontalLine: string;
51
51
  headerFooter: string;
52
52
  pageSetup: string;
53
+ breaks: string;
54
+ columnBreak: string;
55
+ sectionBreakNextPage: string;
56
+ sectionBreakContinuous: string;
57
+ sectionBreakNextColumn: string;
58
+ sectionBreakEvenPage: string;
59
+ sectionBreakOddPage: string;
53
60
  heading: {
54
61
  tooltip: string;
55
62
  normal: string;
@@ -124,6 +131,7 @@ declare const locale: {
124
131
  };
125
132
  sectionSetting: {
126
133
  selectedSections: string;
134
+ multipleValues: string;
127
135
  columnCount: string;
128
136
  columnGap: string;
129
137
  columnSeparator: string;
@@ -132,9 +140,14 @@ declare const locale: {
132
140
  sectionStart: string;
133
141
  unspecified: string;
134
142
  continuous: string;
143
+ nextColumn: string;
135
144
  nextPage: string;
136
145
  evenPage: string;
137
146
  oddPage: string;
147
+ pageSetup: string;
148
+ pageWidth: string;
149
+ pageHeight: string;
150
+ pageNumberStart: string;
138
151
  };
139
152
  };
140
153
  rightClick: {
@@ -41,6 +41,19 @@ export declare const FLOAT_TOOLBAR_MENU_POSITION = "doc.menu.float-toolbar";
41
41
  export declare function FloatTextStyleMenuItemFactory(accessor: IAccessor): IMenuSelectorItem<LocaleKey, string | number>;
42
42
  export declare function TextColorSelectorMenuItemFactory(accessor: IAccessor): IMenuSelectorItem<LocaleKey, string, string | undefined>;
43
43
  export declare function HeaderFooterMenuItemFactory(accessor: IAccessor): IMenuButtonItem<LocaleKey>;
44
+ export declare const DOC_BREAKS_MENU_ID = "doc.menu.breaks";
45
+ export declare const DOC_SECTION_BREAK_NEXT_PAGE_MENU_ID = "doc.menu.section-break.next-page";
46
+ export declare const DOC_SECTION_BREAK_CONTINUOUS_MENU_ID = "doc.menu.section-break.continuous";
47
+ export declare const DOC_SECTION_BREAK_NEXT_COLUMN_MENU_ID = "doc.menu.section-break.next-column";
48
+ export declare const DOC_SECTION_BREAK_EVEN_PAGE_MENU_ID = "doc.menu.section-break.even-page";
49
+ export declare const DOC_SECTION_BREAK_ODD_PAGE_MENU_ID = "doc.menu.section-break.odd-page";
50
+ export declare function BreaksMenuFactory(accessor: IAccessor): IMenuItem<LocaleKey>;
51
+ export declare function InsertColumnBreakMenuFactory(accessor: IAccessor): IMenuButtonItem<LocaleKey>;
52
+ export declare function InsertNextPageSectionBreakMenuFactory(accessor: IAccessor): IMenuButtonItem<LocaleKey>;
53
+ export declare function InsertContinuousSectionBreakMenuFactory(accessor: IAccessor): IMenuButtonItem<LocaleKey>;
54
+ export declare function InsertNextColumnSectionBreakMenuFactory(accessor: IAccessor): IMenuButtonItem<LocaleKey>;
55
+ export declare function InsertEvenPageSectionBreakMenuFactory(accessor: IAccessor): IMenuButtonItem<LocaleKey>;
56
+ export declare function InsertOddPageSectionBreakMenuFactory(accessor: IAccessor): IMenuButtonItem<LocaleKey>;
44
57
  export declare const TableIcon = "GridIcon";
45
58
  export declare const TABLE_MENU_ID = "doc.menu.table";
46
59
  export declare function TableMenuFactory(accessor: IAccessor): IMenuItem<LocaleKey>;
@@ -18,7 +18,7 @@ import type { IMenuButtonItem, IMenuItem, IMenuSelectorItem } from '@univerjs/ui
18
18
  import type { LocaleKey } from '../locale/types';
19
19
  export declare const TEXT_COLORS: string[];
20
20
  export declare const TEXT_COLOR_SWATCH_ICONS: readonly ["DocParagraphTextColorSwatchIcon.0", "DocParagraphTextColorSwatchIcon.1", "DocParagraphTextColorSwatchIcon.2", "DocParagraphTextColorSwatchIcon.3", "DocParagraphTextColorSwatchIcon.4", "DocParagraphTextColorSwatchIcon.5", "DocParagraphTextColorSwatchIcon.6"];
21
- export declare const BACKGROUND_COLOR_SWATCH_ICONS: readonly ["DocParagraphBackgroundColorSwatchIcon.0", "DocParagraphBackgroundColorSwatchIcon.1", "DocParagraphBackgroundColorSwatchIcon.2", "DocParagraphBackgroundColorSwatchIcon.3", "DocParagraphBackgroundColorSwatchIcon.4", "DocParagraphBackgroundColorSwatchIcon.5", "DocParagraphBackgroundColorSwatchIcon.6", "DocParagraphBackgroundColorSwatchIcon.7", "DocParagraphBackgroundColorSwatchIcon.8", "DocParagraphBackgroundColorSwatchIcon.9", "DocParagraphBackgroundColorSwatchIcon.10", "DocParagraphBackgroundColorSwatchIcon.11", "DocParagraphBackgroundColorSwatchIcon.12", "DocParagraphBackgroundColorSwatchIcon.13", "DocParagraphBackgroundColorSwatchIcon.14", "DocParagraphBackgroundColorSwatchIcon.15"];
21
+ export declare const BACKGROUND_COLOR_SWATCH_ICONS: readonly ["DocParagraphBackgroundColorSwatchIcon.0", "DocParagraphBackgroundColorSwatchIcon.1", "DocParagraphBackgroundColorSwatchIcon.2", "DocParagraphBackgroundColorSwatchIcon.3", "DocParagraphBackgroundColorSwatchIcon.4", "DocParagraphBackgroundColorSwatchIcon.5", "DocParagraphBackgroundColorSwatchIcon.6", "DocParagraphBackgroundColorSwatchIcon.7", "DocParagraphBackgroundColorSwatchIcon.8", "DocParagraphBackgroundColorSwatchIcon.9", "DocParagraphBackgroundColorSwatchIcon.10", "DocParagraphBackgroundColorSwatchIcon.11", "DocParagraphBackgroundColorSwatchIcon.12", "DocParagraphBackgroundColorSwatchIcon.13", "DocParagraphBackgroundColorSwatchIcon.14"];
22
22
  export declare function H1HeadingMenuItemFactory(accessor: IAccessor): IMenuItem<LocaleKey>;
23
23
  export declare function H2HeadingMenuItemFactory(accessor: IAccessor): IMenuItem<LocaleKey>;
24
24
  export declare function H3HeadingMenuItemFactory(accessor: IAccessor): IMenuItem<LocaleKey>;
@@ -24,11 +24,20 @@ export interface IClipboardPropertyItem {
24
24
  export interface IDocClipboardCopyDocDataContext {
25
25
  sourceDocuments: IDocumentData[];
26
26
  }
27
+ export interface IDocClipboardCopyContentContext {
28
+ body: IDocumentBody;
29
+ segmentId?: string;
30
+ unitId: string;
31
+ }
32
+ export interface IDocClipboardPasteContext {
33
+ documentData: Partial<IDocumentData>;
34
+ targetUnitId: string;
35
+ }
27
36
  export interface IDocClipboardHook {
28
37
  onCopyDocData?(doc: Partial<IDocumentData>, context: IDocClipboardCopyDocDataContext): Partial<IDocumentData>;
29
38
  onCopyProperty?(start: number, end: number): IClipboardPropertyItem;
30
- onCopyContent?(start: number, end: number): string;
31
- onBeforePaste?: (body: IDocumentBody) => IDocumentBody;
39
+ onCopyContent?(start: number, end: number, context: IDocClipboardCopyContentContext): string;
40
+ onBeforePaste?: (body: IDocumentBody, context: IDocClipboardPasteContext) => IDocumentBody;
32
41
  onBeforePasteImage?: (file: File) => Promise<{
33
42
  source: string;
34
43
  imageSourceType: ImageSourceType;
@@ -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 { IDisposable, IDocumentBlockRange, IDocumentBody, IDocumentData, IDrawingParam, IMutationInfo } from '@univerjs/core';
16
+ import type { ICustomRange, IDisposable, IDocumentBlockRange, IDocumentBody, IDocumentData, IDrawingParam, IMutationInfo } from '@univerjs/core';
17
17
  export interface IDocClipboardPasteCustomBlockMapping {
18
18
  sourceBlockId: string;
19
19
  targetBlockId: string;
@@ -24,6 +24,10 @@ export interface IDocClipboardPasteBlockRangeMapping {
24
24
  sourceBlockRange: IDocumentBlockRange;
25
25
  targetBlockRange: IDocumentBlockRange;
26
26
  }
27
+ export interface IDocClipboardPasteCustomRangeMapping {
28
+ sourceRange: ICustomRange;
29
+ targetRange: ICustomRange;
30
+ }
27
31
  export interface IDocClipboardPasteMutationInfoParams {
28
32
  unitId: string;
29
33
  segmentId: string;
@@ -31,6 +35,7 @@ export interface IDocClipboardPasteMutationInfoParams {
31
35
  sourceBody: IDocumentBody;
32
36
  targetBody: IDocumentBody;
33
37
  blockRangeMappings: IDocClipboardPasteBlockRangeMapping[];
38
+ customRangeMappings?: IDocClipboardPasteCustomRangeMapping[];
34
39
  customBlockMappings: IDocClipboardPasteCustomBlockMapping[];
35
40
  }
36
41
  export interface IDocClipboardPasteMutationInfos {
@@ -23,7 +23,9 @@ import { IRenderManagerService } from '@univerjs/engine-render';
23
23
  import { Editor } from './editor';
24
24
  export interface IEditorRenderConfig {
25
25
  canvasStyle: IEditorCanvasStyle;
26
+ preserveHostFocus?: boolean;
26
27
  scrollBar?: boolean;
28
+ backScrollOffset?: number;
27
29
  }
28
30
  export interface IEditorSetValueParam {
29
31
  editorUnitId: string;
@@ -55,6 +55,8 @@ export interface IEditorCanvasStyle {
55
55
  }
56
56
  export interface IEditorConfigParams {
57
57
  initialSnapshot: IDocumentData;
58
+ /** Keep the globally focused unit on the editor's host while this editor receives input focus. */
59
+ preserveHostFocus?: boolean;
58
60
  cancelDefaultResizeListener?: boolean;
59
61
  canvasStyle?: IEditorCanvasStyle;
60
62
  autofocus?: boolean;
@@ -91,11 +93,11 @@ export declare class Editor extends Disposable implements IEditor {
91
93
  private _listenSelection;
92
94
  isFocus(): boolean;
93
95
  /**
94
- * @deprecated use `IEditorService.focus` as instead. this is for internal usage.
96
+ * Focus the input element directly. This is for internal usage.
95
97
  */
96
98
  focus(): void;
97
99
  /**
98
- * @deprecated use `IEditorService.blur` as instead. this is for internal usage.
100
+ * Blur the input element directly. This is for internal usage.
99
101
  */
100
102
  blur(): void;
101
103
  select(): void;
@@ -109,15 +111,12 @@ export declare class Editor extends Disposable implements IEditor {
109
111
  replaceText(text: string, resetCursor?: boolean | ITextRangeWithStyle[]): void;
110
112
  clearUndoRedoHistory(): void;
111
113
  dispose(): void;
112
- /**
113
- * @deprecated use getEditorId.
114
- */
115
- get editorUnitId(): string | undefined;
116
- /**
117
- * @deprecated @TODO: @JOCS remove this in the future.
118
- */
119
- get params(): IEditorOptions;
120
114
  get cancelDefaultResizeListener(): boolean | undefined;
115
+ getRenderConfig(): {
116
+ backScrollOffset?: number | undefined;
117
+ canvasStyle: IEditorCanvasStyle;
118
+ scrollBar: boolean | undefined;
119
+ };
121
120
  get render(): IRender;
122
121
  isReadOnly(): boolean;
123
122
  getBoundingClientRect(): DOMRect;
@@ -125,22 +124,6 @@ export declare class Editor extends Disposable implements IEditor {
125
124
  isVisible(): boolean | undefined;
126
125
  getSkeleton(): import("@univerjs/engine-render").DocumentSkeleton | undefined;
127
126
  isSheetEditor(): boolean;
128
- /**
129
- * @deprecated use getDocumentData.
130
- */
131
- getValue(): string;
132
- /**
133
- * @deprecated use getDocumentData.
134
- */
135
- getBody(): import("@univerjs/core").IDocumentBody | undefined;
136
- /**
137
- * @deprecated.
138
- */
139
- update(param: Partial<IEditorOptions>): void;
140
- /**
141
- * @deprecated.
142
- */
143
- updateCanvasStyle(): void;
144
127
  private _getDocDataModel;
145
128
  private _getEditorId;
146
129
  }