@univerjs/docs-ui 1.0.0-alpha.1 → 1.0.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +2544 -1063
- package/lib/cjs/locale/ar-SA.js +40 -19
- package/lib/cjs/locale/ca-ES.js +39 -18
- package/lib/cjs/locale/de-DE.js +40 -19
- package/lib/cjs/locale/en-US.js +23 -2
- package/lib/cjs/locale/es-ES.js +40 -19
- package/lib/cjs/locale/fa-IR.js +40 -19
- package/lib/cjs/locale/fr-FR.js +40 -19
- package/lib/cjs/locale/id-ID.js +39 -18
- package/lib/cjs/locale/it-IT.js +40 -19
- package/lib/cjs/locale/ja-JP.js +40 -19
- package/lib/cjs/locale/ko-KR.js +40 -19
- package/lib/cjs/locale/pl-PL.js +40 -19
- package/lib/cjs/locale/pt-BR.js +39 -18
- package/lib/cjs/locale/ru-RU.js +40 -19
- package/lib/cjs/locale/sk-SK.js +40 -19
- package/lib/cjs/locale/vi-VN.js +40 -19
- package/lib/cjs/locale/zh-CN.js +23 -2
- package/lib/cjs/locale/zh-HK.js +23 -2
- package/lib/cjs/locale/zh-TW.js +23 -2
- package/lib/es/index.js +2474 -1070
- package/lib/es/locale/ar-SA.js +40 -19
- package/lib/es/locale/ca-ES.js +39 -18
- package/lib/es/locale/de-DE.js +40 -19
- package/lib/es/locale/en-US.js +23 -2
- package/lib/es/locale/es-ES.js +40 -19
- package/lib/es/locale/fa-IR.js +40 -19
- package/lib/es/locale/fr-FR.js +40 -19
- package/lib/es/locale/id-ID.js +39 -18
- package/lib/es/locale/it-IT.js +40 -19
- package/lib/es/locale/ja-JP.js +40 -19
- package/lib/es/locale/ko-KR.js +40 -19
- package/lib/es/locale/pl-PL.js +40 -19
- package/lib/es/locale/pt-BR.js +39 -18
- package/lib/es/locale/ru-RU.js +40 -19
- package/lib/es/locale/sk-SK.js +40 -19
- package/lib/es/locale/vi-VN.js +40 -19
- package/lib/es/locale/zh-CN.js +23 -2
- package/lib/es/locale/zh-HK.js +23 -2
- package/lib/es/locale/zh-TW.js +23 -2
- package/lib/index.css +8 -0
- package/lib/index.js +2474 -1070
- package/lib/locale/ar-SA.js +40 -19
- package/lib/locale/ca-ES.js +39 -18
- package/lib/locale/de-DE.js +40 -19
- package/lib/locale/en-US.js +23 -2
- package/lib/locale/es-ES.js +40 -19
- package/lib/locale/fa-IR.js +40 -19
- package/lib/locale/fr-FR.js +40 -19
- package/lib/locale/id-ID.js +39 -18
- package/lib/locale/it-IT.js +40 -19
- package/lib/locale/ja-JP.js +40 -19
- package/lib/locale/ko-KR.js +40 -19
- package/lib/locale/pl-PL.js +40 -19
- package/lib/locale/pt-BR.js +39 -18
- package/lib/locale/ru-RU.js +40 -19
- package/lib/locale/sk-SK.js +40 -19
- package/lib/locale/vi-VN.js +40 -19
- package/lib/locale/zh-CN.js +23 -2
- package/lib/locale/zh-HK.js +23 -2
- package/lib/locale/zh-TW.js +23 -2
- package/lib/types/commands/commands/break-line.command.d.ts +4 -3
- package/lib/types/commands/commands/doc-block-move.command.d.ts +13 -1
- package/lib/types/commands/commands/doc-delete.command.d.ts +6 -2
- package/lib/types/commands/commands/doc-header-footer.command.d.ts +4 -9
- package/lib/types/commands/commands/doc-horizontal-line.command.d.ts +1 -0
- package/lib/types/commands/commands/doc-paragraph-setting.command.d.ts +1 -2
- package/lib/types/commands/commands/replace-content.command.d.ts +2 -1
- package/lib/types/commands/commands/table/doc-table-create.command.d.ts +2 -1
- package/lib/types/commands/operations/doc-section-setting-panel.operation.d.ts +17 -0
- package/lib/types/controllers/doc-header-footer.controller.d.ts +0 -8
- package/lib/types/controllers/doc-section-setting.controller.d.ts +24 -0
- package/lib/types/controllers/render-controllers/doc-input.controller.d.ts +4 -1
- package/lib/types/controllers/render-controllers/doc-selection-render.controller.d.ts +5 -1
- package/lib/types/controllers/render-controllers/doc.render-controller.d.ts +4 -1
- package/lib/types/controllers/render-controllers/zoom.render-controller.d.ts +3 -1
- package/lib/types/controllers/ui.controller.d.ts +4 -1
- package/lib/types/embed-docs-custom-block-bleed.d.ts +30 -0
- package/lib/types/embed-docs-custom-block-refresh.d.ts +28 -0
- package/lib/types/embed-docs-custom-block-scroll.d.ts +19 -0
- package/lib/types/embed-host-anchor.d.ts +45 -0
- package/lib/types/index.d.ts +19 -4
- package/lib/types/locale/en-US.d.ts +17 -0
- package/lib/types/menu/context-menu.d.ts +1 -0
- package/lib/types/menu/menu.d.ts +2 -1
- package/lib/types/services/clipboard/clipboard.service.d.ts +7 -3
- package/lib/types/services/clipboard/doc-paste-mutation-adapter.service.d.ts +47 -0
- package/lib/types/services/clipboard/html-to-udm/converter.d.ts +1 -0
- package/lib/types/services/doc-embed-integration.service.d.ts +63 -0
- package/lib/types/services/doc-paragraph-menu.service.d.ts +1 -1
- package/lib/types/services/doc-popup-manager.service.d.ts +2 -0
- package/lib/types/services/docs-render.service.d.ts +1 -1
- package/lib/types/services/float-menu.service.d.ts +1 -0
- package/lib/types/services/index.d.ts +1 -0
- package/lib/types/services/selection/convert-text-range.d.ts +3 -0
- package/lib/types/services/selection/doc-selection-render.service.d.ts +18 -4
- package/lib/types/shortcuts/core-editing.shortcut.d.ts +1 -0
- package/lib/types/utils/section-header-footer.d.ts +26 -0
- package/lib/types/views/ParagraphMenu.d.ts +8 -3
- package/lib/types/views/paragraph-setting/hook/utils.d.ts +13 -3
- package/lib/types/views/paragraph-setting/line-spacing.d.ts +6 -18
- package/lib/types/views/section-setting/Setting.d.ts +16 -0
- package/lib/types/views/section-setting/component-name.d.ts +16 -0
- package/lib/types/views/section-setting/index.d.ts +16 -0
- package/lib/types/views/section-setting/use-section-setting.d.ts +43 -0
- package/lib/umd/index.js +9 -10
- package/lib/umd/locale/ar-SA.js +1 -1
- package/lib/umd/locale/ca-ES.js +1 -1
- package/lib/umd/locale/de-DE.js +1 -1
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/es-ES.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/id-ID.js +1 -1
- package/lib/umd/locale/it-IT.js +1 -1
- package/lib/umd/locale/ja-JP.js +1 -1
- package/lib/umd/locale/ko-KR.js +1 -1
- package/lib/umd/locale/pl-PL.js +1 -1
- package/lib/umd/locale/pt-BR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/sk-SK.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-HK.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +11 -12
|
@@ -0,0 +1,45 @@
|
|
|
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 { UniverInstanceType } from '@univerjs/core';
|
|
17
|
+
import { DocumentFlavor } from '@univerjs/core';
|
|
18
|
+
export interface IDocsCustomBlockRenderViewportParams {
|
|
19
|
+
childType?: UniverInstanceType;
|
|
20
|
+
contentHeight?: number;
|
|
21
|
+
contentWidth?: number;
|
|
22
|
+
docsLeft?: number;
|
|
23
|
+
documentFlavor?: DocumentFlavor;
|
|
24
|
+
fallbackHeight?: number;
|
|
25
|
+
fallbackWidth?: number;
|
|
26
|
+
pageMarginLeft?: number;
|
|
27
|
+
pageMarginRight?: number;
|
|
28
|
+
pageWidth?: number;
|
|
29
|
+
scale?: number;
|
|
30
|
+
visibleCanvasHeight?: number;
|
|
31
|
+
visibleCanvasLeft?: number;
|
|
32
|
+
visibleCanvasWidth?: number;
|
|
33
|
+
}
|
|
34
|
+
export interface IDocsCustomBlockLayoutViewport {
|
|
35
|
+
bleedLeft?: number;
|
|
36
|
+
bleedWidth?: number;
|
|
37
|
+
contentHeight?: number;
|
|
38
|
+
contentWidth?: number;
|
|
39
|
+
height: number;
|
|
40
|
+
layoutWidth?: number;
|
|
41
|
+
offsetLeft?: number;
|
|
42
|
+
viewportHeight?: number;
|
|
43
|
+
width: number;
|
|
44
|
+
}
|
|
45
|
+
export declare function resolveDocsCustomBlockRenderViewport(params: IDocsCustomBlockRenderViewportParams): IDocsCustomBlockLayoutViewport;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -31,8 +31,8 @@ export type { IInnerCutCommandParams } from './commands/commands/clipboard.inner
|
|
|
31
31
|
export { getCustomBlockIdsInSelections, getCutActionsFromDocRanges } from './commands/commands/clipboard.inner.command';
|
|
32
32
|
export { buildMoveDocBlockActions, MoveDocBlockCommand } from './commands/commands/doc-block-move.command';
|
|
33
33
|
export type { IMoveDocBlockCommandParams } from './commands/commands/doc-block-move.command';
|
|
34
|
-
export { DeleteCustomBlockCommand, DeleteLeftCommand, DeleteRightCommand, MergeTwoParagraphCommand, } from './commands/commands/doc-delete.command';
|
|
35
|
-
export type { IDeleteCustomBlockParams } from './commands/commands/doc-delete.command';
|
|
34
|
+
export { DeleteCurrentParagraphCommand, DeleteCustomBlockCommand, DeleteLeftCommand, DeleteRightCommand, MergeTwoParagraphCommand, } from './commands/commands/doc-delete.command';
|
|
35
|
+
export type { IDeleteCurrentParagraphCommandParams, IDeleteCustomBlockParams } from './commands/commands/doc-delete.command';
|
|
36
36
|
export { getCursorWhenDelete } from './commands/commands/doc-delete.command';
|
|
37
37
|
export { HorizontalLineCommand } from './commands/commands/doc-horizontal-line.command';
|
|
38
38
|
export { DocSelectAllCommand } from './commands/commands/doc-select-all.command';
|
|
@@ -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 {
|
|
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';
|
|
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>;
|
package/lib/types/menu/menu.d.ts
CHANGED
|
@@ -18,6 +18,8 @@ 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;
|
|
22
|
+
export declare function disableMenuWhenHeaderFooterEditing(accessor: IAccessor): Observable<boolean>;
|
|
21
23
|
export declare function disableMenuWhenNoDocRange(accessor: IAccessor): Observable<boolean>;
|
|
22
24
|
export declare function isTextRangeInAnyBlockRange(document: Nullable<DocumentDataModel>, range: ITextRangeParam): boolean;
|
|
23
25
|
export declare function hideMenuWhenSelectionInBlockRange(accessor: IAccessor): Observable<boolean>;
|
|
@@ -49,7 +51,6 @@ export declare function HorizontalLineFactory(accessor: IAccessor): IMenuButtonI
|
|
|
49
51
|
export declare function OrderListMenuItemFactory(accessor: IAccessor): IMenuSelectorItem<LocaleKey, PresetListType | undefined, PresetListType | undefined>;
|
|
50
52
|
export declare function BulletListMenuItemFactory(accessor: IAccessor): IMenuSelectorItem<LocaleKey, PresetListType | undefined, PresetListType | undefined>;
|
|
51
53
|
export declare function CheckListMenuItemFactory(accessor: IAccessor): IMenuButtonItem<LocaleKey>;
|
|
52
|
-
export declare function DocSwitchModeMenuItemFactory(accessor: IAccessor): IMenuButtonItem<LocaleKey>;
|
|
53
54
|
export declare function ResetTextColorMenuItemFactory(accessor: IAccessor): IMenuButtonItem<LocaleKey>;
|
|
54
55
|
export declare function ResetBackgroundColorMenuItemFactory(accessor: IAccessor): IMenuButtonItem<LocaleKey>;
|
|
55
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
|
+
}
|
|
@@ -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;
|
|
@@ -68,7 +68,7 @@ export declare class DocParagraphMenuService extends Disposable implements IRend
|
|
|
68
68
|
private _docSkeletonManagerService;
|
|
69
69
|
private _floatMenuService;
|
|
70
70
|
private _docSelectionRenderService;
|
|
71
|
-
private
|
|
71
|
+
private _paragraphMenu;
|
|
72
72
|
private readonly _activeTarget$;
|
|
73
73
|
readonly activeTarget$: import("rxjs").Observable<IDocBlockMenuTarget | null>;
|
|
74
74
|
private readonly _slashMenuRequest$;
|
|
@@ -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
|
}
|
|
@@ -17,5 +17,6 @@ export { default as PastePluginLark } from './clipboard/html-to-udm/paste-plugin
|
|
|
17
17
|
export { default as PastePluginUniver } from './clipboard/html-to-udm/paste-plugins/plugin-univer';
|
|
18
18
|
export { default as PastePluginWord } from './clipboard/html-to-udm/paste-plugins/plugin-word';
|
|
19
19
|
export { type IPastePlugin } from './clipboard/html-to-udm/paste-plugins/type';
|
|
20
|
+
export type { IDocBlockMenuTarget } from './doc-paragraph-menu.service';
|
|
20
21
|
export { calcDocFitToWidthScale, DocViewScaleService, normalizeDocFitToWidthOptions, resolveDocFitBaseWidth, resolveDocViewScale } from './doc-view-scale';
|
|
21
22
|
export type { ICalcDocFitToWidthScaleParams, IResolveDocFitBaseWidthParams } from './doc-view-scale';
|
|
@@ -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
|
}
|
|
@@ -18,3 +18,4 @@ export declare const BreakLineShortcut: IShortcutItem;
|
|
|
18
18
|
export declare const SoftBreakLineShortcut: IShortcutItem;
|
|
19
19
|
export declare const DeleteLeftShortcut: IShortcutItem;
|
|
20
20
|
export declare const DeleteRightShortcut: IShortcutItem;
|
|
21
|
+
export declare const CloseHeaderFooterShortcut: IShortcutItem;
|
|
@@ -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
|
|
28
|
-
|
|
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): {
|
|
@@ -52,6 +55,7 @@ export declare function getParagraphMenuResolvedCommand(option: IValueOption, ta
|
|
|
52
55
|
commandId?: string;
|
|
53
56
|
params?: object;
|
|
54
57
|
};
|
|
58
|
+
export declare function getParagraphMenuCommandParams(commandId: string | undefined, commandParams: Record<string, unknown> | undefined, target: IDocBlockMenuTarget | null | undefined, unitId: string): Record<string, unknown> | undefined;
|
|
55
59
|
export declare function shouldShowParagraphSettingMenu(target: IDocBlockMenuTarget | null | undefined): boolean;
|
|
56
60
|
export declare function getParagraphMenuHiddenItemIds(menuType: string, target: IDocBlockMenuTarget | null | undefined, namedStyleType?: NamedStyleType): string[];
|
|
57
61
|
export declare function unwrapBlockRangeBody(documentBody: IDocumentBody, blockRange: IDocumentBlockRange): {
|
|
@@ -62,6 +66,7 @@ export declare function unwrapBlockRangeBody(documentBody: IDocumentBody, blockR
|
|
|
62
66
|
collapsed: boolean;
|
|
63
67
|
};
|
|
64
68
|
};
|
|
69
|
+
export declare function buildUnwrapBlockRangeActions(previousBody: IDocumentBody, nextBody: IDocumentBody, blockRange: IDocumentBlockRange): JSONXActions | null;
|
|
65
70
|
export declare function getParagraphFormattingRange(target: IDocBlockMenuTarget | null | undefined, paragraph?: IMutiPageParagraphBound | null): ITextRangeWithStyle | null;
|
|
66
71
|
export declare function getParagraphMenuCommandTargetRange(commandId: string | undefined, targetRange?: ITextRangeWithStyle | null, formattingRange?: ITextRangeWithStyle | null): ITextRangeWithStyle | null | undefined;
|
|
67
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 {
|
|
16
|
+
import type { IDocumentBody, IDocumentStyle, IParagraph } from '@univerjs/core';
|
|
17
17
|
import { SpacingRule } from '@univerjs/core';
|
|
18
|
-
export declare
|
|
19
|
-
|
|
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,29 +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 {
|
|
16
|
+
import type { IDocumentSkeletonLine } from '@univerjs/engine-render';
|
|
17
|
+
import type { LocaleKey } from '../../locale/types';
|
|
17
18
|
import { SpacingRule } from '@univerjs/core';
|
|
18
19
|
interface ILineSpacingMetrics {
|
|
19
20
|
glyphLineHeight: number;
|
|
20
21
|
renderedLineHeight: number;
|
|
21
22
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
paddingTop?: number;
|
|
25
|
-
paddingBottom?: number;
|
|
26
|
-
divides?: Array<{
|
|
27
|
-
glyphGroup?: Array<{
|
|
28
|
-
bBox?: {
|
|
29
|
-
ba?: number;
|
|
30
|
-
bd?: number;
|
|
31
|
-
};
|
|
32
|
-
}>;
|
|
33
|
-
}>;
|
|
34
|
-
}
|
|
35
|
-
export declare function getLineSpacingRuleOptions(localeService: LocaleService): {
|
|
36
|
-
label: string;
|
|
23
|
+
export declare const LINE_SPACING_RULE_OPTIONS: Array<{
|
|
24
|
+
label: LocaleKey;
|
|
37
25
|
value: string;
|
|
38
|
-
}
|
|
26
|
+
}>;
|
|
39
27
|
export declare function getLineSpacingInputConfig(spacingRule: SpacingRule): {
|
|
40
28
|
readonly min: 1;
|
|
41
29
|
readonly max: 5;
|
|
@@ -46,6 +34,6 @@ export declare function getLineSpacingInputConfig(spacingRule: SpacingRule): {
|
|
|
46
34
|
};
|
|
47
35
|
export declare function convertStoredLineSpacingToDisplayValue(lineSpacing: number, spacingRule: SpacingRule): number;
|
|
48
36
|
export declare function convertDisplayLineSpacingToStoredValue(lineSpacing: number, spacingRule: SpacingRule): number;
|
|
49
|
-
export declare function getLineSpacingMetrics(lineNode?:
|
|
37
|
+
export declare function getLineSpacingMetrics(lineNode?: IDocumentSkeletonLine): ILineSpacingMetrics | null;
|
|
50
38
|
export declare function convertLineSpacingForRuleChange(currentStoredValue: number, currentRule: SpacingRule, nextRule: SpacingRule, metrics?: ILineSpacingMetrics | null): number;
|
|
51
39
|
export {};
|
|
@@ -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;
|