@univerjs/docs-ui 1.0.0-alpha.7 → 1.0.0-alpha.8

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 (101) hide show
  1. package/lib/cjs/index.js +747 -371
  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 +66 -53
  20. package/lib/cjs/locale/zh-TW.js +48 -35
  21. package/lib/es/index.js +750 -329
  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 +66 -53
  40. package/lib/es/locale/zh-TW.js +48 -35
  41. package/lib/index.css +4 -0
  42. package/lib/index.js +750 -329
  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 +66 -53
  61. package/lib/locale/zh-TW.js +48 -35
  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/clipboard.inner.command.d.ts +2 -0
  65. package/lib/types/commands/commands/replace-content.command.d.ts +10 -14
  66. package/lib/types/commands/operations/insert-break.operation.d.ts +21 -0
  67. package/lib/types/controllers/doc-move-cursor.controller.d.ts +0 -1
  68. package/lib/types/controllers/doc-section-setting.controller.d.ts +4 -1
  69. package/lib/types/controllers/render-controllers/doc-paragraph-placeholder.render-controller.d.ts +11 -2
  70. package/lib/types/index.d.ts +10 -10
  71. package/lib/types/locale/en-US.d.ts +13 -0
  72. package/lib/types/menu/menu.d.ts +13 -0
  73. package/lib/types/services/clipboard/clipboard.service.d.ts +11 -2
  74. package/lib/types/services/clipboard/doc-paste-mutation-adapter.service.d.ts +6 -1
  75. package/lib/types/services/editor/editor-manager.service.d.ts +1 -0
  76. package/lib/types/services/editor/editor.d.ts +7 -26
  77. package/lib/types/services/selection/doc-selection-render.service.d.ts +0 -3
  78. package/lib/types/views/paragraph-setting/hook/utils.d.ts +2 -0
  79. package/lib/types/views/rich-text-editor/hooks/use-keyboard-event.d.ts +2 -1
  80. package/lib/types/views/section-setting/use-section-setting.d.ts +33 -2
  81. package/lib/umd/index.js +11 -10
  82. package/lib/umd/locale/ar-SA.js +1 -1
  83. package/lib/umd/locale/ca-ES.js +1 -1
  84. package/lib/umd/locale/de-DE.js +1 -1
  85. package/lib/umd/locale/en-US.js +1 -1
  86. package/lib/umd/locale/es-ES.js +1 -1
  87. package/lib/umd/locale/fa-IR.js +1 -1
  88. package/lib/umd/locale/fr-FR.js +1 -1
  89. package/lib/umd/locale/id-ID.js +1 -1
  90. package/lib/umd/locale/it-IT.js +1 -1
  91. package/lib/umd/locale/ja-JP.js +1 -1
  92. package/lib/umd/locale/ko-KR.js +1 -1
  93. package/lib/umd/locale/pl-PL.js +1 -1
  94. package/lib/umd/locale/pt-BR.js +1 -1
  95. package/lib/umd/locale/ru-RU.js +1 -1
  96. package/lib/umd/locale/sk-SK.js +1 -1
  97. package/lib/umd/locale/vi-VN.js +1 -1
  98. package/lib/umd/locale/zh-CN.js +1 -1
  99. package/lib/umd/locale/zh-HK.js +1 -1
  100. package/lib/umd/locale/zh-TW.js +1 -1
  101. package/package.json +9 -9
@@ -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;
@@ -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;
@@ -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 {};
@@ -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,4 @@ 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
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>;
@@ -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 {
@@ -24,6 +24,7 @@ import { Editor } from './editor';
24
24
  export interface IEditorRenderConfig {
25
25
  canvasStyle: IEditorCanvasStyle;
26
26
  scrollBar?: boolean;
27
+ backScrollOffset?: number;
27
28
  }
28
29
  export interface IEditorSetValueParam {
29
30
  editorUnitId: string;
@@ -91,11 +91,11 @@ export declare class Editor extends Disposable implements IEditor {
91
91
  private _listenSelection;
92
92
  isFocus(): boolean;
93
93
  /**
94
- * @deprecated use `IEditorService.focus` as instead. this is for internal usage.
94
+ * Focus the input element directly. This is for internal usage.
95
95
  */
96
96
  focus(): void;
97
97
  /**
98
- * @deprecated use `IEditorService.blur` as instead. this is for internal usage.
98
+ * Blur the input element directly. This is for internal usage.
99
99
  */
100
100
  blur(): void;
101
101
  select(): void;
@@ -109,15 +109,12 @@ export declare class Editor extends Disposable implements IEditor {
109
109
  replaceText(text: string, resetCursor?: boolean | ITextRangeWithStyle[]): void;
110
110
  clearUndoRedoHistory(): void;
111
111
  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
112
  get cancelDefaultResizeListener(): boolean | undefined;
113
+ getRenderConfig(): {
114
+ backScrollOffset?: number | undefined;
115
+ canvasStyle: IEditorCanvasStyle;
116
+ scrollBar: boolean | undefined;
117
+ };
121
118
  get render(): IRender;
122
119
  isReadOnly(): boolean;
123
120
  getBoundingClientRect(): DOMRect;
@@ -125,22 +122,6 @@ export declare class Editor extends Disposable implements IEditor {
125
122
  isVisible(): boolean | undefined;
126
123
  getSkeleton(): import("@univerjs/engine-render").DocumentSkeleton | undefined;
127
124
  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
125
  private _getDocDataModel;
145
126
  private _getEditorId;
146
127
  }
@@ -106,9 +106,6 @@ export declare class DocSelectionRenderService extends RxDisposable implements I
106
106
  hasFocus(): boolean;
107
107
  focus(): void;
108
108
  blur(): void;
109
- /**
110
- * @deprecated
111
- */
112
109
  deactivate(): void;
113
110
  __handleDblClick(evt: IPointerEvent | IMouseEvent): void;
114
111
  __handleTripleClick(evt: IPointerEvent | IMouseEvent): void;
@@ -19,12 +19,14 @@ export declare function resolveParagraphsForSettingPanel(paragraphs: IParagraph[
19
19
  paragraphStyle: import("@univerjs/core").IParagraphStyle;
20
20
  startIndex: number;
21
21
  paragraphId: string;
22
+ styleId?: string;
22
23
  bullet?: import("@univerjs/core").IBullet;
23
24
  }[];
24
25
  export declare const useCurrentParagraph: () => import("@univerjs/core").IParagraphRange[] | {
25
26
  paragraphStyle: import("@univerjs/core").IParagraphStyle;
26
27
  startIndex: number;
27
28
  paragraphId: string;
29
+ styleId?: string;
28
30
  bullet?: import("@univerjs/core").IBullet;
29
31
  }[];
30
32
  export declare const useFirstParagraphHorizontalAlign: (paragraph: IParagraph[], defaultValue: string) => readonly [string, (v: string) => Promise<boolean>];
@@ -13,12 +13,13 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { KeyCode, MetaKeys } from '@univerjs/ui';
16
+ import type { KeyCode, MetaKeys, NativeTextEditorShortcutBehavior } from '@univerjs/ui';
17
17
  import type { Editor } from '../../../services/editor/editor';
18
18
  export interface IKeyboardEventConfig {
19
19
  keyCodes: {
20
20
  keyCode: KeyCode;
21
21
  metaKey?: MetaKeys;
22
+ nativeTextEditorBehavior?: NativeTextEditorShortcutBehavior;
22
23
  }[];
23
24
  handler: (keyCode: KeyCode, metaKey?: MetaKeys) => void;
24
25
  }
@@ -15,29 +15,60 @@
15
15
  */
16
16
  import type { DocumentDataModel, IDocumentStyle, ISectionBreak, ITextRangeParam } from '@univerjs/core';
17
17
  import type { IDocumentSectionUpdate } from '@univerjs/docs';
18
- import { ColumnSeparatorType, SectionType } from '@univerjs/core';
18
+ import { ColumnSeparatorType, PageOrientType, SectionType } from '@univerjs/core';
19
19
  export interface ISectionSettingValues {
20
20
  columnCount: number | undefined;
21
21
  columnGap: number | undefined;
22
22
  separatorType: ColumnSeparatorType | undefined;
23
23
  sectionType: SectionType | undefined;
24
+ pageWidth: number | undefined;
25
+ pageHeight: number | undefined;
26
+ pageOrient: PageOrientType | undefined;
27
+ marginTop: number | undefined;
28
+ marginBottom: number | undefined;
29
+ marginLeft: number | undefined;
30
+ marginRight: number | undefined;
31
+ pageNumberStart: number | undefined;
24
32
  }
25
- export declare function getSectionSettingValues(sections: ISectionBreak[]): ISectionSettingValues;
33
+ export declare function getSectionSettingValues(sections: ISectionBreak[], documentStyle: IDocumentStyle): ISectionSettingValues;
26
34
  export declare function createSectionColumnUpdates(sections: ISectionBreak[], documentStyle: IDocumentStyle, change: {
27
35
  columnCount: number;
28
36
  } | {
29
37
  columnGap: number;
30
38
  }): IDocumentSectionUpdate[];
39
+ export declare function createSectionOrientationUpdates(sections: ISectionBreak[], documentStyle: IDocumentStyle, pageOrient: PageOrientType): IDocumentSectionUpdate[];
31
40
  export declare function getSelectedSections(documentDataModel: DocumentDataModel, ranges: Readonly<ITextRangeParam[]>): ISectionBreak[];
32
41
  export declare function useSectionSetting(): {
42
+ selectSection(sectionId: string): void;
33
43
  setColumnCount(value: number): Promise<boolean>;
34
44
  setColumnGap(value: number): Promise<boolean>;
35
45
  setSeparatorType(value: ColumnSeparatorType): Promise<boolean>;
36
46
  setSectionType(value: SectionType): Promise<boolean>;
47
+ setPageWidth(value: number): Promise<boolean>;
48
+ setPageHeight(value: number): Promise<boolean>;
49
+ setPageOrient(value: PageOrientType): Promise<boolean>;
50
+ setMarginTop(value: number): Promise<boolean>;
51
+ setMarginBottom(value: number): Promise<boolean>;
52
+ setMarginLeft(value: number): Promise<boolean>;
53
+ setMarginRight(value: number): Promise<boolean>;
54
+ setPageNumberStart(value: number): Promise<boolean>;
37
55
  columnCount: number | undefined;
38
56
  columnGap: number | undefined;
39
57
  separatorType: ColumnSeparatorType | undefined;
40
58
  sectionType: SectionType | undefined;
59
+ pageWidth: number | undefined;
60
+ pageHeight: number | undefined;
61
+ pageOrient: PageOrientType | undefined;
62
+ marginTop: number | undefined;
63
+ marginBottom: number | undefined;
64
+ marginLeft: number | undefined;
65
+ marginRight: number | undefined;
66
+ pageNumberStart: number | undefined;
41
67
  valid: boolean;
42
68
  selectedCount: number;
69
+ sectionOptions: {
70
+ label: string;
71
+ value: string;
72
+ }[];
73
+ selectedSectionId: string | undefined;
43
74
  };