@univerjs/docs-ui 1.0.0-alpha.2 → 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 (120) hide show
  1. package/lib/cjs/index.js +1924 -480
  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 +1845 -476
  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 +1845 -476
  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-header-footer.command.d.ts +1 -0
  65. package/lib/types/commands/commands/doc-horizontal-line.command.d.ts +1 -0
  66. package/lib/types/commands/commands/doc-paragraph-setting.command.d.ts +1 -2
  67. package/lib/types/commands/commands/replace-content.command.d.ts +2 -1
  68. package/lib/types/commands/operations/doc-section-setting-panel.operation.d.ts +17 -0
  69. package/lib/types/controllers/doc-section-setting.controller.d.ts +24 -0
  70. package/lib/types/controllers/render-controllers/doc-input.controller.d.ts +4 -1
  71. package/lib/types/controllers/render-controllers/doc-selection-render.controller.d.ts +5 -1
  72. package/lib/types/controllers/render-controllers/doc.render-controller.d.ts +4 -1
  73. package/lib/types/controllers/render-controllers/zoom.render-controller.d.ts +3 -1
  74. package/lib/types/controllers/ui.controller.d.ts +4 -1
  75. package/lib/types/embed-docs-custom-block-bleed.d.ts +30 -0
  76. package/lib/types/embed-docs-custom-block-refresh.d.ts +28 -0
  77. package/lib/types/embed-docs-custom-block-scroll.d.ts +19 -0
  78. package/lib/types/embed-host-anchor.d.ts +45 -0
  79. package/lib/types/index.d.ts +16 -1
  80. package/lib/types/locale/en-US.d.ts +17 -0
  81. package/lib/types/menu/context-menu.d.ts +1 -0
  82. package/lib/types/menu/menu.d.ts +1 -1
  83. package/lib/types/services/clipboard/clipboard.service.d.ts +7 -3
  84. package/lib/types/services/clipboard/doc-paste-mutation-adapter.service.d.ts +47 -0
  85. package/lib/types/services/clipboard/html-to-udm/converter.d.ts +1 -0
  86. package/lib/types/services/doc-embed-integration.service.d.ts +63 -0
  87. package/lib/types/services/doc-popup-manager.service.d.ts +2 -0
  88. package/lib/types/services/docs-render.service.d.ts +1 -1
  89. package/lib/types/services/float-menu.service.d.ts +1 -0
  90. package/lib/types/services/selection/convert-text-range.d.ts +3 -0
  91. package/lib/types/services/selection/doc-selection-render.service.d.ts +18 -4
  92. package/lib/types/utils/section-header-footer.d.ts +26 -0
  93. package/lib/types/views/ParagraphMenu.d.ts +7 -3
  94. package/lib/types/views/paragraph-setting/hook/utils.d.ts +13 -3
  95. package/lib/types/views/paragraph-setting/line-spacing.d.ts +4 -4
  96. package/lib/types/views/section-setting/Setting.d.ts +16 -0
  97. package/lib/types/views/section-setting/component-name.d.ts +16 -0
  98. package/lib/types/views/section-setting/index.d.ts +16 -0
  99. package/lib/types/views/section-setting/use-section-setting.d.ts +43 -0
  100. package/lib/umd/index.js +9 -9
  101. package/lib/umd/locale/ar-SA.js +1 -1
  102. package/lib/umd/locale/ca-ES.js +1 -1
  103. package/lib/umd/locale/de-DE.js +1 -1
  104. package/lib/umd/locale/en-US.js +1 -1
  105. package/lib/umd/locale/es-ES.js +1 -1
  106. package/lib/umd/locale/fa-IR.js +1 -1
  107. package/lib/umd/locale/fr-FR.js +1 -1
  108. package/lib/umd/locale/id-ID.js +1 -1
  109. package/lib/umd/locale/it-IT.js +1 -1
  110. package/lib/umd/locale/ja-JP.js +1 -1
  111. package/lib/umd/locale/ko-KR.js +1 -1
  112. package/lib/umd/locale/pl-PL.js +1 -1
  113. package/lib/umd/locale/pt-BR.js +1 -1
  114. package/lib/umd/locale/ru-RU.js +1 -1
  115. package/lib/umd/locale/sk-SK.js +1 -1
  116. package/lib/umd/locale/vi-VN.js +1 -1
  117. package/lib/umd/locale/zh-CN.js +1 -1
  118. package/lib/umd/locale/zh-HK.js +1 -1
  119. package/lib/umd/locale/zh-TW.js +1 -1
  120. package/package.json +10 -11
@@ -67,24 +67,36 @@ export { SetDocZoomRatioOperation } from './commands/operations/set-doc-zoom-rat
67
67
  export type { ISetDocZoomRatioOperationParams } from './commands/operations/set-doc-zoom-ratio.operation';
68
68
  export { getCommandSkeleton } from './commands/util';
69
69
  export type { DocFitAlign, DocFitMode, DocFitTarget, IDocFitToWidthOptions, IUniverDocsUIConfig } from './config/config';
70
- export { DEFAULT_DOC_FIT_TO_WIDTH_OPTIONS } from './config/config';
70
+ export { DEFAULT_DOC_FIT_TO_WIDTH_OPTIONS, DOCS_UI_PLUGIN_CONFIG_KEY } from './config/config';
71
71
  export { DocBackScrollRenderController } from './controllers/render-controllers/back-scroll.render-controller';
72
72
  export { DocParagraphPlaceholderRenderController, } from './controllers/render-controllers/doc-paragraph-placeholder.render-controller';
73
73
  export { DocRenderController } from './controllers/render-controllers/doc.render-controller';
74
74
  export { DocUIController } from './controllers/ui.controller';
75
+ export { createDefaultDocsTableLikeCustomBlockBleedViewport, resolveDocsTableLikeCustomBlockBleedViewport, resolveDocsTableLikeCustomBlockContentHeight, resolveDocsTableLikeCustomBlockContentWidth, } from './embed-docs-custom-block-bleed';
76
+ export type { IDocsCustomBlockBleedViewport, IDocsCustomBlockBleedViewportHint } from './embed-docs-custom-block-bleed';
77
+ export { collectDocsTableLikeEmbedChildUnitIds, createDocsCustomBlockSizeRefreshScheduler, shouldRefreshDocsCustomBlockSizeForCommand } from './embed-docs-custom-block-refresh';
78
+ export { scrollDocsTableLikeCustomBlockLive } from './embed-docs-custom-block-scroll';
79
+ export type { IDocsTableLikeCustomBlockScrollOptions } from './embed-docs-custom-block-scroll';
80
+ export { resolveDocsCustomBlockRenderViewport } from './embed-host-anchor';
81
+ export type { IDocsCustomBlockLayoutViewport, IDocsCustomBlockRenderViewportParams } from './embed-host-anchor';
75
82
  export { AlignMenuItemFactory, BackgroundColorSelectorMenuItemFactory, BoldMenuItemFactory, disableMenuWhenHeaderFooterEditing, FLOAT_TEXT_STYLE_MENU_ID, FLOAT_TOOLBAR_MENU_POSITION, FloatTextStyleMenuItemFactory, FontFamilySelectorMenuItemFactory, FontSizeSelectorMenuItemFactory, hideMenuWhenSelectionInBlockRange, isTextRangeInAnyBlockRange, ItalicMenuItemFactory, StrikeThroughMenuItemFactory, TextColorSelectorMenuItemFactory, UnderlineMenuItemFactory, } from './menu/menu';
76
83
  export { DOC_CONTENT_INSERT_MENU_ID, DOC_PARAGRAPH_T_ALIGN_MENU_ID, DOC_PARAGRAPH_T_COLORS_MENU_ID, DOC_PARAGRAPH_T_DIVIDER_MENU_ID, DOC_PARAGRAPH_T_EDIT_MENU_ID, DOC_PARAGRAPH_T_INSERT_BELOW_MENU_ID, DOC_PARAGRAPH_T_INSERT_MENU_ID, DOC_TABLE_BLOCK_MENU_ID, EMPTY_PARAGRAPH_MENU_ID, getDocBlockRangeMenuId, INSERT_BELLOW_MENU_ID, ParagraphMenuInsertBelowSubmenuItemFactory, } from './menu/paragraph-menu';
77
84
  export { menuSchema as DocsUIMenuSchema } from './menu/schema';
78
85
  export { UniverDocsUIPlugin } from './plugin';
79
86
  export * from './services';
80
87
  export { IDocClipboardService } from './services/clipboard/clipboard.service';
88
+ export { DocClipboardPasteAdapterService, IDocClipboardPasteAdapterService, } from './services/clipboard/doc-paste-mutation-adapter.service';
89
+ export type { IDocClipboardPasteAdapter, IDocClipboardPasteCustomBlockMapping, IDocClipboardPasteMutationInfoParams, IDocClipboardPasteMutationInfos, } from './services/clipboard/doc-paste-mutation-adapter.service';
81
90
  export { convertBodyToHtml } from './services/clipboard/udm-to-html/convertor';
82
91
  export { DocHtmlExportService } from './services/clipboard/udm-to-html/doc-html-export.service';
83
92
  export type { DocHtmlExportTransformer } from './services/clipboard/udm-to-html/doc-html-export.service';
84
93
  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';
85
96
  export { DocEventManagerService, getListMarkerFallbackBound, getListParagraphContextMenuHit, } from './services/doc-event-manager.service';
86
97
  export type { IBulletBound, IMutiPageParagraphBound } from './services/doc-event-manager.service';
87
98
  export { DocIMEInputManagerService } from './services/doc-ime-input-manager.service';
99
+ export { DocPageLayoutService } from './services/doc-page-layout.service';
88
100
  export { DocParagraphMenuService } from './services/doc-paragraph-menu.service';
89
101
  export { calcDocRangePositions, DocCanvasPopManagerService } from './services/doc-popup-manager.service';
90
102
  export { DocPrintInterceptorService } from './services/doc-print-interceptor.service';
@@ -92,6 +104,7 @@ export type { IDocPrintComponentContext, IDocPrintContext } from './services/doc
92
104
  export { DocsRenderService } from './services/docs-render.service';
93
105
  export { Editor } from './services/editor/editor';
94
106
  export { EditorService, IEditorService } from './services/editor/editor-manager.service';
107
+ export { DocFloatMenuService } from './services/float-menu.service';
95
108
  export { isInSameTableCell, isValidRectRange, NodePositionConvertToRectRange, } from './services/selection/convert-rect-range';
96
109
  export { NodePositionConvertToCursor } from './services/selection/convert-text-range';
97
110
  export { getOneTextSelectionRange } from './services/selection/convert-text-range';
@@ -107,3 +120,5 @@ export { createEditorUndoRedoKeyboardConfig, executeEditorUndoRedoCommand, useEd
107
120
  export type { ICreateEditorUndoRedoKeyboardConfigOptions, IExecuteEditorUndoRedoCommandOptions, IKeyboardEventConfig, } from './views/rich-text-editor/hooks';
108
121
  export { RichTextEditor } from './views/RichTextEditor';
109
122
  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';
@@ -77,6 +77,7 @@ declare const locale: {
77
77
  header: string;
78
78
  footer: string;
79
79
  panel: string;
80
+ linkToPrevious: string;
80
81
  firstPageCheckBox: string;
81
82
  oddEvenCheckBox: string;
82
83
  headerTopMargin: string;
@@ -96,9 +97,11 @@ declare const locale: {
96
97
  doc: {
97
98
  menu: {
98
99
  paragraphSetting: string;
100
+ sectionSetting: string;
99
101
  };
100
102
  slider: {
101
103
  paragraphSetting: string;
104
+ sectionSetting: string;
102
105
  };
103
106
  paragraphSetting: {
104
107
  alignment: string;
@@ -116,6 +119,20 @@ declare const locale: {
116
119
  exactly: string;
117
120
  fixedValue: string;
118
121
  };
122
+ sectionSetting: {
123
+ selectedSections: string;
124
+ columnCount: string;
125
+ columnGap: string;
126
+ columnSeparator: string;
127
+ none: string;
128
+ betweenColumns: string;
129
+ sectionStart: string;
130
+ unspecified: string;
131
+ continuous: string;
132
+ nextPage: string;
133
+ evenPage: string;
134
+ oddPage: string;
135
+ };
119
136
  };
120
137
  rightClick: {
121
138
  copy: string;
@@ -23,6 +23,7 @@ export declare function PasteMenuFactory(accessor: IAccessor): IMenuButtonItem<L
23
23
  export declare function DeleteMenuFactory(accessor: IAccessor): IMenuButtonItem<LocaleKey>;
24
24
  export declare const TABLE_INSERT_MENU_ID = "doc.menu.table-insert";
25
25
  export declare function TableInsertMenuItemFactory(accessor: IAccessor): IMenuSelectorItem<LocaleKey>;
26
+ export declare function SectionSettingMenuFactory(accessor: IAccessor): IMenuButtonItem<LocaleKey>;
26
27
  export declare function InsertRowBeforeMenuItemFactory(accessor: IAccessor): IMenuButtonItem<LocaleKey>;
27
28
  export declare function InsertRowAfterMenuItemFactory(accessor: IAccessor): IMenuButtonItem<LocaleKey>;
28
29
  export declare function InsertColumnLeftMenuItemFactory(accessor: IAccessor): IMenuButtonItem<LocaleKey>;
@@ -18,6 +18,7 @@ import type { IMenuButtonItem, IMenuItem, IMenuSelectorItem } from '@univerjs/ui
18
18
  import type { LocaleKey } from '../locale/types';
19
19
  import { HorizontalAlign, NamedStyleType, PresetListType } from '@univerjs/core';
20
20
  import { Observable } from 'rxjs';
21
+ export declare function shouldSuppressDocMenuStateRefresh(accessor: IAccessor): boolean;
21
22
  export declare function disableMenuWhenHeaderFooterEditing(accessor: IAccessor): Observable<boolean>;
22
23
  export declare function disableMenuWhenNoDocRange(accessor: IAccessor): Observable<boolean>;
23
24
  export declare function isTextRangeInAnyBlockRange(document: Nullable<DocumentDataModel>, range: ITextRangeParam): boolean;
@@ -50,7 +51,6 @@ export declare function HorizontalLineFactory(accessor: IAccessor): IMenuButtonI
50
51
  export declare function OrderListMenuItemFactory(accessor: IAccessor): IMenuSelectorItem<LocaleKey, PresetListType | undefined, PresetListType | undefined>;
51
52
  export declare function BulletListMenuItemFactory(accessor: IAccessor): IMenuSelectorItem<LocaleKey, PresetListType | undefined, PresetListType | undefined>;
52
53
  export declare function CheckListMenuItemFactory(accessor: IAccessor): IMenuButtonItem<LocaleKey>;
53
- export declare function DocSwitchModeMenuItemFactory(accessor: IAccessor): IMenuButtonItem<LocaleKey>;
54
54
  export declare function ResetTextColorMenuItemFactory(accessor: IAccessor): IMenuButtonItem<LocaleKey>;
55
55
  export declare function ResetBackgroundColorMenuItemFactory(accessor: IAccessor): IMenuButtonItem<LocaleKey>;
56
56
  export declare function BackgroundColorSelectorMenuItemFactory(accessor: IAccessor): IMenuSelectorItem<LocaleKey, string, string | undefined>;
@@ -13,16 +13,19 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { IDisposable, IDocumentBody } from '@univerjs/core';
16
+ import type { IDisposable, IDocumentBody, IDocumentData } from '@univerjs/core';
17
17
  import type { IRectRangeWithStyle, ITextRangeWithStyle } from '@univerjs/engine-render';
18
- import { Disposable, ICommandService, ILogService, IUniverInstanceService, SliceBodyType } from '@univerjs/core';
18
+ import { Disposable, ICommandService, ILogService, ImageSourceType, IUniverInstanceService, SliceBodyType } from '@univerjs/core';
19
19
  import { DocSelectionManagerService } from '@univerjs/docs';
20
- import { ImageSourceType } from '@univerjs/drawing';
21
20
  import { IClipboardInterfaceService } from '@univerjs/ui';
22
21
  import { DocHtmlExportService } from './udm-to-html/doc-html-export.service';
23
22
  export interface IClipboardPropertyItem {
24
23
  }
24
+ export interface IDocClipboardCopyDocDataContext {
25
+ sourceDocuments: IDocumentData[];
26
+ }
25
27
  export interface IDocClipboardHook {
28
+ onCopyDocData?(doc: Partial<IDocumentData>, context: IDocClipboardCopyDocDataContext): Partial<IDocumentData>;
26
29
  onCopyProperty?(start: number, end: number): IClipboardPropertyItem;
27
30
  onCopyContent?(start: number, end: number): string;
28
31
  onBeforePaste?: (body: IDocumentBody) => IDocumentBody;
@@ -68,6 +71,7 @@ export declare class DocClipboardService extends Disposable implements IDocClipb
68
71
  private _paste;
69
72
  private _setClipboardData;
70
73
  addClipboardHook(hook: IDocClipboardHook): IDisposable;
74
+ private _applyCopyDocDataHooks;
71
75
  private _getDocumentBodyInRanges;
72
76
  private _genDocDataFromClipboardItems;
73
77
  private _genDocDataFromHtmlAndText;
@@ -0,0 +1,47 @@
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 { IDisposable, IDocumentBody, IDocumentData, IDrawingParam, IMutationInfo } from '@univerjs/core';
17
+ export interface IDocClipboardPasteCustomBlockMapping {
18
+ sourceBlockId: string;
19
+ targetBlockId: string;
20
+ sourceDrawing: IDrawingParam;
21
+ targetDrawing: IDrawingParam;
22
+ }
23
+ export interface IDocClipboardPasteMutationInfoParams {
24
+ unitId: string;
25
+ segmentId: string;
26
+ doc: Partial<IDocumentData>;
27
+ sourceBody: IDocumentBody;
28
+ targetBody: IDocumentBody;
29
+ customBlockMappings: IDocClipboardPasteCustomBlockMapping[];
30
+ }
31
+ export interface IDocClipboardPasteMutationInfos {
32
+ redoMutations: IMutationInfo[];
33
+ undoMutations: IMutationInfo[];
34
+ }
35
+ export interface IDocClipboardPasteAdapter {
36
+ getPasteMutationInfos?: (params: IDocClipboardPasteMutationInfoParams) => IDocClipboardPasteMutationInfos | null | undefined;
37
+ }
38
+ export interface IDocClipboardPasteAdapterService {
39
+ registerAdapter(adapter: IDocClipboardPasteAdapter): IDisposable;
40
+ getPasteMutationInfos(params: IDocClipboardPasteMutationInfoParams): IDocClipboardPasteMutationInfos;
41
+ }
42
+ export declare const IDocClipboardPasteAdapterService: import("@wendellhu/redi").IdentifierDecorator<IDocClipboardPasteAdapterService>;
43
+ export declare class DocClipboardPasteAdapterService implements IDocClipboardPasteAdapterService {
44
+ private readonly _adapters;
45
+ registerAdapter(adapter: IDocClipboardPasteAdapter): IDisposable;
46
+ getPasteMutationInfos(params: IDocClipboardPasteMutationInfoParams): IDocClipboardPasteMutationInfos;
47
+ }
@@ -29,6 +29,7 @@ export declare class HtmlToUDMService {
29
29
  private _listStack;
30
30
  private _lastParagraphIndex;
31
31
  private _createParagraphId;
32
+ private _createSectionId;
32
33
  convert(html: string, metaConfig?: {
33
34
  unitId?: string;
34
35
  }): Partial<IDocumentData>;
@@ -0,0 +1,63 @@
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 { IDisposable } from '@univerjs/core';
17
+ import { Subject } from 'rxjs';
18
+ export declare const DOC_EMBED_INTERACTION_BOUNDARY_OWNER_ATTRIBUTE = "data-embed-interaction-boundary-owner";
19
+ export declare const EMBED_INTERACTION_BOUNDARY_OWNER_ATTRIBUTE = "data-embed-interaction-boundary-owner";
20
+ export interface IDocEmbedInteractionBoundaryService {
21
+ contains(embedId: string | undefined, target: EventTarget | null | undefined, event?: Event): boolean;
22
+ hasRecentInteraction(ownerDocument?: Document): boolean;
23
+ hasRecentInteractionFor?(embedId: string | undefined, ownerDocument?: Document): boolean;
24
+ }
25
+ export interface IDocEmbedRuntimeFocusCoordinator {
26
+ isChildUnitRuntimeEvent(unitId: string | undefined, target: EventTarget | null | undefined, event?: Event): boolean;
27
+ isChildUnitInActiveSession(unitId: string | undefined): boolean;
28
+ shouldSuppressHostInteraction(unitId: string | undefined, target?: EventTarget | null, event?: Event): boolean;
29
+ }
30
+ export declare class EmbedInteractionBoundaryService implements IDocEmbedInteractionBoundaryService {
31
+ private readonly _roots;
32
+ registerOwnedElement(embedId: string, element: HTMLElement): IDisposable;
33
+ contains(embedId: string | undefined, target: EventTarget | null | undefined): boolean;
34
+ hasRecentInteraction(): boolean;
35
+ hasRecentInteractionFor(): boolean;
36
+ }
37
+ export declare const IDocEmbedInteractionBoundaryService: typeof EmbedInteractionBoundaryService;
38
+ export declare class EmbedRuntimeFocusCoordinator implements IDocEmbedRuntimeFocusCoordinator {
39
+ private readonly _leases;
40
+ private readonly _elements;
41
+ readonly runtimeSessionChanged$: Subject<void>;
42
+ acquireLease(options: {
43
+ embedId?: string;
44
+ role: string;
45
+ owner?: string;
46
+ childUnitId?: string;
47
+ hostUnitId?: string;
48
+ }): IDisposable;
49
+ registerElement(options: {
50
+ embedId: string;
51
+ role: string;
52
+ element: HTMLElement;
53
+ }): IDisposable;
54
+ registerRuntimeScope(_options: {
55
+ embedId: string;
56
+ hostUnitId?: string;
57
+ childUnitId?: string;
58
+ }): IDisposable;
59
+ isChildUnitRuntimeEvent(_unitId: string | undefined, target: EventTarget | null | undefined): boolean;
60
+ isChildUnitInActiveSession(unitId: string | undefined): boolean;
61
+ shouldSuppressHostInteraction(unitId: string | undefined, target?: EventTarget | null): boolean;
62
+ }
63
+ export declare const IDocEmbedRuntimeFocusCoordinator: typeof EmbedRuntimeFocusCoordinator;
@@ -40,6 +40,7 @@ export declare class DocCanvasPopManagerService extends Disposable {
40
40
  private readonly _univerInstanceService;
41
41
  private readonly _commandService;
42
42
  constructor(_globalPopupManagerService: ICanvasPopupService, _renderManagerService: IRenderManagerService, _univerInstanceService: IUniverInstanceService, _commandService: ICommandService);
43
+ private _shouldUpdateForCommand;
43
44
  private _createRectPositionObserver;
44
45
  private _createObjectPositionObserver;
45
46
  private _createRangePositionObserver;
@@ -59,4 +60,5 @@ export declare class DocCanvasPopManagerService extends Disposable {
59
60
  * @returns disposable
60
61
  */
61
62
  attachPopupToRange(range: ITextRangeParam, popup: IDocCanvasPopup, unitId: string): INeedCheckDisposable;
63
+ private _resolveEmbeddedPopupInjector;
62
64
  }
@@ -17,7 +17,6 @@ import type { DocumentFlavor } from '@univerjs/core';
17
17
  import type { ICanvasColorService } from '@univerjs/engine-render';
18
18
  import { IUniverInstanceService, RxDisposable } from '@univerjs/core';
19
19
  import { IRenderManagerService } from '@univerjs/engine-render';
20
- export { resolveDocRenderBackground as resolveDocsCanvasBackground } from './doc-render-background';
21
20
  export declare function getDocsCanvasBackgroundColor(documentFlavor?: DocumentFlavor, canvasColorService?: ICanvasColorService, editorBackgroundColor?: string, isEditor?: boolean): string;
22
21
  export declare class DocsRenderService extends RxDisposable {
23
22
  private readonly _instanceSrv;
@@ -26,5 +25,6 @@ export declare class DocsRenderService extends RxDisposable {
26
25
  private _init;
27
26
  private _createRenderer;
28
27
  private _createRenderWithId;
28
+ private _syncRendererCanvas;
29
29
  private _disposeRenderer;
30
30
  }
@@ -34,6 +34,7 @@ export declare class DocFloatMenuService extends Disposable implements IRenderMo
34
34
  start: number;
35
35
  end: number;
36
36
  }>;
37
+ hideFloatMenu(): void;
37
38
  private _registerFloatMenu;
38
39
  private _initSelectionChange;
39
40
  private _hideFloatMenu;
@@ -67,6 +67,9 @@ export declare class NodePositionConvertToCursor {
67
67
  contentBoxPointGroup: IPoint[][];
68
68
  cursorList: ITextRange[];
69
69
  };
70
+ private _getCaretGlyph;
71
+ private _findTextLikeGlyph;
72
+ private _isNonInlineEmbedCustomBlockGlyph;
70
73
  private _isValidPosition;
71
74
  private _resetCurrentNodePositionState;
72
75
  private _setNodePositionState;
@@ -18,6 +18,7 @@ import type { IDocSelectionInnerParam, IMouseEvent, INodePosition, IPointerEvent
18
18
  import { ILogService, IUniverInstanceService, RxDisposable } from '@univerjs/core';
19
19
  import { DocSkeletonManagerService } from '@univerjs/docs';
20
20
  import { ILayoutService } from '@univerjs/ui';
21
+ import { IDocEmbedInteractionBoundaryService, IDocEmbedRuntimeFocusCoordinator } from '../doc-embed-integration.service';
21
22
  import { TextRange } from './text-range';
22
23
  export interface IEditorInputConfig {
23
24
  event: Event | CompositionEvent | KeyboardEvent;
@@ -31,6 +32,8 @@ export declare class DocSelectionRenderService extends RxDisposable implements I
31
32
  private readonly _logService;
32
33
  private readonly _univerInstanceService;
33
34
  private readonly _docSkeletonManagerService;
35
+ private readonly _embedInteractionBoundaryService?;
36
+ private readonly _embedRuntimeFocusCoordinator?;
34
37
  private readonly _onInputBefore$;
35
38
  readonly onInputBefore$: import("rxjs").Observable<Nullable<IEditorInputConfig>>;
36
39
  private readonly _onKeydown$;
@@ -68,6 +71,11 @@ export declare class DocSelectionRenderService extends RxDisposable implements I
68
71
  private _focusNodePosition;
69
72
  private _currentSegmentId;
70
73
  private _currentSegmentPage;
74
+ private readonly _segmentContext$;
75
+ readonly segmentContext$: import("rxjs").Observable<{
76
+ segmentId: string;
77
+ segmentPage: number;
78
+ }>;
71
79
  private _selectionStyle;
72
80
  private _onPointerEvent;
73
81
  private _viewPortObserverMap;
@@ -78,7 +86,7 @@ export declare class DocSelectionRenderService extends RxDisposable implements I
78
86
  get isOnPointerEvent(): boolean;
79
87
  get isFocusing(): boolean;
80
88
  get canFocusing(): boolean;
81
- constructor(_context: IRenderContext<DocumentDataModel>, _layoutService: ILayoutService, _logService: ILogService, _univerInstanceService: IUniverInstanceService, _docSkeletonManagerService: DocSkeletonManagerService);
89
+ constructor(_context: IRenderContext<DocumentDataModel>, _layoutService: ILayoutService, _logService: ILogService, _univerInstanceService: IUniverInstanceService, _docSkeletonManagerService: DocSkeletonManagerService, _embedInteractionBoundaryService?: IDocEmbedInteractionBoundaryService | undefined, _embedRuntimeFocusCoordinator?: IDocEmbedRuntimeFocusCoordinator | undefined);
82
90
  private _listenCurrentUnitChange;
83
91
  get activeViewPort(): import("@univerjs/engine-render").Viewport;
84
92
  setSegment(id: string): void;
@@ -92,9 +100,6 @@ export declare class DocSelectionRenderService extends RxDisposable implements I
92
100
  }): void;
93
101
  setCursorManually(evtOffsetX: number, evtOffsetY: number): void;
94
102
  sync(): void;
95
- /**
96
- * @deprecated
97
- */
98
103
  activate(x: number, y: number, force?: boolean): void;
99
104
  hasFocus(): boolean;
100
105
  focus(): void;
@@ -121,6 +126,7 @@ export declare class DocSelectionRenderService extends RxDisposable implements I
121
126
  private _registerContainer;
122
127
  private _initInput;
123
128
  private _ensureHostContainer;
129
+ private _getOwnerDocument;
124
130
  private _getNodePosition;
125
131
  private _interactTextRanges;
126
132
  private _interactRectRanges;
@@ -148,7 +154,15 @@ export declare class DocSelectionRenderService extends RxDisposable implements I
148
154
  __attachScrollEvent(): void;
149
155
  private _initInputEvents;
150
156
  private _eventHandle;
157
+ private _shouldSuppressHostHiddenEditorEvent;
158
+ private _stopEmbedOwnedEditorShortcutPropagation;
151
159
  private _getTransformCoordForDocumentOffset;
152
160
  private _findNodeByCoord;
161
+ private _shouldPreserveExternalFocus;
162
+ private _containsCurrentEmbedRuntimeElement;
163
+ private _getCurrentEmbedOwner;
164
+ private _getElementEmbedOwner;
165
+ private _containsOwnEditorElement;
166
+ private _containsCurrentLayoutElement;
153
167
  private _detachEvent;
154
168
  }
@@ -0,0 +1,26 @@
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 { IDocumentData, IDocumentStyle, ISectionBreak } from '@univerjs/core';
17
+ import type { IDocumentSkeletonPage } from '@univerjs/engine-render';
18
+ export interface IDocPageSectionContext {
19
+ sectionId?: string;
20
+ sectionIndex: number;
21
+ sections: ISectionBreak[];
22
+ section?: ISectionBreak;
23
+ /** Effective config after applying the owning section over document defaults. */
24
+ config: IDocumentStyle & Partial<ISectionBreak>;
25
+ }
26
+ export declare function getDocPageSectionContext(snapshot: IDocumentData, page?: Pick<IDocumentSkeletonPage, 'sectionId'>): IDocPageSectionContext;
@@ -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 { IDocumentBlockRange, IDocumentBody } from '@univerjs/core';
16
+ import type { IDocumentBlockRange, IDocumentBody, JSONXActions } from '@univerjs/core';
17
17
  import type { IDocBlockMoveValidationContext } from '@univerjs/docs';
18
18
  import type { ITextRangeWithStyle } from '@univerjs/engine-render';
19
19
  import type { IPopup, IValueOption } from '@univerjs/ui';
@@ -24,8 +24,11 @@ import { NamedStyleType } from '@univerjs/core';
24
24
  import { DocBlockMoveValidatorService } from '@univerjs/docs';
25
25
  import { ILayoutService } from '@univerjs/ui';
26
26
  import { DocParagraphMenuService } from '../services/doc-paragraph-menu.service';
27
- export { DOC_PARAGRAPH_MENU_COMPONENT_KEY, DOC_TABLE_BLOCK_MENU_COMPONENT_KEY } from './paragraph-menu/component-keys';
28
- export declare function getParagraphMenuPopupDirection(anchorLeft: number, menuWidth?: number, viewportPadding?: number): 'left' | 'right';
27
+ export declare function getParagraphMenuPopupDirection(anchorLeft: number, menuWidth?: number, viewportPadding?: number, options?: {
28
+ anchorRight?: number;
29
+ direction?: 'ltr' | 'rtl';
30
+ viewportWidth?: number;
31
+ }): 'left' | 'right';
29
32
  export declare const PARAGRAPH_MENU_HOVER_OPEN_DELAY = 800;
30
33
  export declare function shouldExecuteParagraphMenuMove(validatorService: Pick<DocBlockMoveValidatorService, 'canMoveBlock'>, context: IDocBlockMoveValidationContext): boolean;
31
34
  export declare function createParagraphMenuHoverOpenScheduler(openMenu: () => void, delay?: number): {
@@ -63,6 +66,7 @@ export declare function unwrapBlockRangeBody(documentBody: IDocumentBody, blockR
63
66
  collapsed: boolean;
64
67
  };
65
68
  };
69
+ export declare function buildUnwrapBlockRangeActions(previousBody: IDocumentBody, nextBody: IDocumentBody, blockRange: IDocumentBlockRange): JSONXActions | null;
66
70
  export declare function getParagraphFormattingRange(target: IDocBlockMenuTarget | null | undefined, paragraph?: IMutiPageParagraphBound | null): ITextRangeWithStyle | null;
67
71
  export declare function getParagraphMenuCommandTargetRange(commandId: string | undefined, targetRange?: ITextRangeWithStyle | null, formattingRange?: ITextRangeWithStyle | null): ITextRangeWithStyle | null | undefined;
68
72
  export declare function finishParagraphMenuCommand(docParagraphMenuService: Pick<DocParagraphMenuService, 'hideParagraphMenu'> | null | undefined, layoutService: Pick<ILayoutService, 'focus'>, hideMenu: () => void): void;
@@ -13,10 +13,20 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { IParagraph, ISectionBreak } from '@univerjs/core';
16
+ import type { IDocumentBody, IDocumentStyle, IParagraph } from '@univerjs/core';
17
17
  import { SpacingRule } from '@univerjs/core';
18
- export declare const useCurrentParagraph: () => import("@univerjs/core").IParagraphRange[];
19
- export declare const useCurrentSections: (currentParagraphs: IParagraph[]) => ISectionBreak[];
18
+ export declare function resolveParagraphsForSettingPanel(paragraphs: IParagraph[], body: IDocumentBody, documentStyle: IDocumentStyle): {
19
+ paragraphStyle: import("@univerjs/core").IParagraphStyle;
20
+ startIndex: number;
21
+ paragraphId: string;
22
+ bullet?: import("@univerjs/core").IBullet;
23
+ }[];
24
+ export declare const useCurrentParagraph: () => import("@univerjs/core").IParagraphRange[] | {
25
+ paragraphStyle: import("@univerjs/core").IParagraphStyle;
26
+ startIndex: number;
27
+ paragraphId: string;
28
+ bullet?: import("@univerjs/core").IBullet;
29
+ }[];
20
30
  export declare const useFirstParagraphHorizontalAlign: (paragraph: IParagraph[], defaultValue: string) => readonly [string, (v: string) => Promise<boolean>];
21
31
  export declare const useFirstParagraphIndentStart: (paragraph: IParagraph[]) => readonly [number, (v: number) => Promise<boolean>];
22
32
  export declare const useFirstParagraphIndentEnd: (paragraph: IParagraph[]) => readonly [number, (v: number) => Promise<boolean>];
@@ -13,17 +13,17 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { LocaleService } from '@univerjs/core';
17
16
  import type { IDocumentSkeletonLine } from '@univerjs/engine-render';
17
+ import type { LocaleKey } from '../../locale/types';
18
18
  import { SpacingRule } from '@univerjs/core';
19
19
  interface ILineSpacingMetrics {
20
20
  glyphLineHeight: number;
21
21
  renderedLineHeight: number;
22
22
  }
23
- export declare function getLineSpacingRuleOptions(localeService: LocaleService): {
24
- label: string;
23
+ export declare const LINE_SPACING_RULE_OPTIONS: Array<{
24
+ label: LocaleKey;
25
25
  value: string;
26
- }[];
26
+ }>;
27
27
  export declare function getLineSpacingInputConfig(spacingRule: SpacingRule): {
28
28
  readonly min: 1;
29
29
  readonly max: 5;
@@ -0,0 +1,16 @@
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 SectionSetting(): import("react").JSX.Element | null;
@@ -0,0 +1,16 @@
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 const DOC_SECTION_SETTING_COMPONENT = "doc_ui_section-setting-panel";
@@ -0,0 +1,16 @@
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 SectionSettingIndex(): import("react").JSX.Element;
@@ -0,0 +1,43 @@
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 { DocumentDataModel, IDocumentStyle, ISectionBreak, ITextRangeParam } from '@univerjs/core';
17
+ import type { IDocumentSectionUpdate } from '@univerjs/docs';
18
+ import { ColumnSeparatorType, SectionType } from '@univerjs/core';
19
+ export interface ISectionSettingValues {
20
+ columnCount: number | undefined;
21
+ columnGap: number | undefined;
22
+ separatorType: ColumnSeparatorType | undefined;
23
+ sectionType: SectionType | undefined;
24
+ }
25
+ export declare function getSectionSettingValues(sections: ISectionBreak[]): ISectionSettingValues;
26
+ export declare function createSectionColumnUpdates(sections: ISectionBreak[], documentStyle: IDocumentStyle, change: {
27
+ columnCount: number;
28
+ } | {
29
+ columnGap: number;
30
+ }): IDocumentSectionUpdate[];
31
+ export declare function getSelectedSections(documentDataModel: DocumentDataModel, ranges: Readonly<ITextRangeParam[]>): ISectionBreak[];
32
+ export declare function useSectionSetting(): {
33
+ setColumnCount(value: number): Promise<boolean>;
34
+ setColumnGap(value: number): Promise<boolean>;
35
+ setSeparatorType(value: ColumnSeparatorType): Promise<boolean>;
36
+ setSectionType(value: SectionType): Promise<boolean>;
37
+ columnCount: number | undefined;
38
+ columnGap: number | undefined;
39
+ separatorType: ColumnSeparatorType | undefined;
40
+ sectionType: SectionType | undefined;
41
+ valid: boolean;
42
+ selectedCount: number;
43
+ };