@univerjs/docs-ui 1.0.0-alpha.2 → 1.0.0-alpha.4
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 +2333 -789
- package/lib/cjs/locale/ar-SA.js +41 -19
- package/lib/cjs/locale/ca-ES.js +40 -18
- package/lib/cjs/locale/de-DE.js +41 -19
- package/lib/cjs/locale/en-US.js +24 -2
- package/lib/cjs/locale/es-ES.js +41 -19
- package/lib/cjs/locale/fa-IR.js +41 -19
- package/lib/cjs/locale/fr-FR.js +41 -19
- package/lib/cjs/locale/id-ID.js +40 -18
- package/lib/cjs/locale/it-IT.js +41 -19
- package/lib/cjs/locale/ja-JP.js +41 -19
- package/lib/cjs/locale/ko-KR.js +41 -19
- package/lib/cjs/locale/pl-PL.js +41 -19
- package/lib/cjs/locale/pt-BR.js +40 -18
- package/lib/cjs/locale/ru-RU.js +41 -19
- package/lib/cjs/locale/sk-SK.js +41 -19
- package/lib/cjs/locale/vi-VN.js +41 -19
- package/lib/cjs/locale/zh-CN.js +24 -2
- package/lib/cjs/locale/zh-HK.js +24 -2
- package/lib/cjs/locale/zh-TW.js +24 -2
- package/lib/es/index.js +2254 -782
- package/lib/es/locale/ar-SA.js +41 -19
- package/lib/es/locale/ca-ES.js +40 -18
- package/lib/es/locale/de-DE.js +41 -19
- package/lib/es/locale/en-US.js +24 -2
- package/lib/es/locale/es-ES.js +41 -19
- package/lib/es/locale/fa-IR.js +41 -19
- package/lib/es/locale/fr-FR.js +41 -19
- package/lib/es/locale/id-ID.js +40 -18
- package/lib/es/locale/it-IT.js +41 -19
- package/lib/es/locale/ja-JP.js +41 -19
- package/lib/es/locale/ko-KR.js +41 -19
- package/lib/es/locale/pl-PL.js +41 -19
- package/lib/es/locale/pt-BR.js +40 -18
- package/lib/es/locale/ru-RU.js +41 -19
- package/lib/es/locale/sk-SK.js +41 -19
- package/lib/es/locale/vi-VN.js +41 -19
- package/lib/es/locale/zh-CN.js +24 -2
- package/lib/es/locale/zh-HK.js +24 -2
- package/lib/es/locale/zh-TW.js +24 -2
- package/lib/index.css +8 -0
- package/lib/index.js +2254 -782
- package/lib/locale/ar-SA.js +41 -19
- package/lib/locale/ca-ES.js +40 -18
- package/lib/locale/de-DE.js +41 -19
- package/lib/locale/en-US.js +24 -2
- package/lib/locale/es-ES.js +41 -19
- package/lib/locale/fa-IR.js +41 -19
- package/lib/locale/fr-FR.js +41 -19
- package/lib/locale/id-ID.js +40 -18
- package/lib/locale/it-IT.js +41 -19
- package/lib/locale/ja-JP.js +41 -19
- package/lib/locale/ko-KR.js +41 -19
- package/lib/locale/pl-PL.js +41 -19
- package/lib/locale/pt-BR.js +40 -18
- package/lib/locale/ru-RU.js +41 -19
- package/lib/locale/sk-SK.js +41 -19
- package/lib/locale/vi-VN.js +41 -19
- package/lib/locale/zh-CN.js +24 -2
- package/lib/locale/zh-HK.js +24 -2
- package/lib/locale/zh-TW.js +24 -2
- package/lib/types/commands/commands/break-line.command.d.ts +4 -3
- package/lib/types/commands/commands/clipboard.inner.command.d.ts +1 -2
- package/lib/types/commands/commands/doc-block-move.command.d.ts +13 -1
- package/lib/types/commands/commands/doc-header-footer.command.d.ts +1 -0
- 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/{basics/transform-position.d.ts → commands/operations/doc-section-setting-panel.operation.d.ts} +2 -3
- 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 +17 -3
- package/lib/types/locale/en-US.d.ts +20 -0
- package/lib/types/menu/context-menu.d.ts +1 -0
- package/lib/types/menu/menu.d.ts +1 -1
- package/lib/types/plugin.d.ts +3 -4
- 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-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 +2 -4
- package/lib/types/services/selection/convert-text-range.d.ts +3 -0
- package/lib/types/services/selection/doc-selection-render.service.d.ts +19 -4
- package/lib/types/utils/section-header-footer.d.ts +26 -0
- package/lib/types/views/ParagraphMenu.d.ts +7 -3
- package/lib/types/views/float-toolbar/FloatToolbar.d.ts +1 -0
- package/lib/types/views/paragraph-setting/hook/utils.d.ts +13 -3
- package/lib/types/views/paragraph-setting/line-spacing.d.ts +4 -4
- 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 -9
- 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
package/lib/types/index.d.ts
CHANGED
|
@@ -19,7 +19,6 @@ export { getDocObject, getDocObjectById, neoGetDocObject } from './basics/compon
|
|
|
19
19
|
export { addCustomDecorationBySelectionFactory, addCustomDecorationFactory, deleteCustomDecorationFactory, } from './basics/custom-decoration-factory';
|
|
20
20
|
export * from './basics/docs-view-key';
|
|
21
21
|
export { hasParagraphInTable } from './basics/paragraph';
|
|
22
|
-
export { docDrawingPositionToTransform, transformToDocDrawingPosition } from './basics/transform-position';
|
|
23
22
|
export { AfterSpaceCommand, EnterCommand, TabCommand } from './commands/commands/auto-format.command';
|
|
24
23
|
export type { ITabCommandParams } from './commands/commands/auto-format.command';
|
|
25
24
|
export { BreakLineCommand } from './commands/commands/break-line.command';
|
|
@@ -28,7 +27,7 @@ export { DocCopyCommand, DocCutCommand, DocPasteCommand } from './commands/comma
|
|
|
28
27
|
export { CutContentCommand, InnerPasteCommand } from './commands/commands/clipboard.inner.command';
|
|
29
28
|
export type { IInnerPasteCommandParams } from './commands/commands/clipboard.inner.command';
|
|
30
29
|
export type { IInnerCutCommandParams } from './commands/commands/clipboard.inner.command';
|
|
31
|
-
export {
|
|
30
|
+
export { getCutActionsFromDocRanges } from './commands/commands/clipboard.inner.command';
|
|
32
31
|
export { buildMoveDocBlockActions, MoveDocBlockCommand } from './commands/commands/doc-block-move.command';
|
|
33
32
|
export type { IMoveDocBlockCommandParams } from './commands/commands/doc-block-move.command';
|
|
34
33
|
export { DeleteCurrentParagraphCommand, DeleteCustomBlockCommand, DeleteLeftCommand, DeleteRightCommand, MergeTwoParagraphCommand, } from './commands/commands/doc-delete.command';
|
|
@@ -67,24 +66,36 @@ export { SetDocZoomRatioOperation } from './commands/operations/set-doc-zoom-rat
|
|
|
67
66
|
export type { ISetDocZoomRatioOperationParams } from './commands/operations/set-doc-zoom-ratio.operation';
|
|
68
67
|
export { getCommandSkeleton } from './commands/util';
|
|
69
68
|
export type { DocFitAlign, DocFitMode, DocFitTarget, IDocFitToWidthOptions, IUniverDocsUIConfig } from './config/config';
|
|
70
|
-
export { DEFAULT_DOC_FIT_TO_WIDTH_OPTIONS } from './config/config';
|
|
69
|
+
export { DEFAULT_DOC_FIT_TO_WIDTH_OPTIONS, DOCS_UI_PLUGIN_CONFIG_KEY } from './config/config';
|
|
71
70
|
export { DocBackScrollRenderController } from './controllers/render-controllers/back-scroll.render-controller';
|
|
72
71
|
export { DocParagraphPlaceholderRenderController, } from './controllers/render-controllers/doc-paragraph-placeholder.render-controller';
|
|
73
72
|
export { DocRenderController } from './controllers/render-controllers/doc.render-controller';
|
|
74
73
|
export { DocUIController } from './controllers/ui.controller';
|
|
74
|
+
export { createDefaultDocsTableLikeCustomBlockBleedViewport, resolveDocsTableLikeCustomBlockBleedViewport, resolveDocsTableLikeCustomBlockContentHeight, resolveDocsTableLikeCustomBlockContentWidth, } from './embed-docs-custom-block-bleed';
|
|
75
|
+
export type { IDocsCustomBlockBleedViewport, IDocsCustomBlockBleedViewportHint } from './embed-docs-custom-block-bleed';
|
|
76
|
+
export { collectDocsTableLikeEmbedChildUnitIds, createDocsCustomBlockSizeRefreshScheduler, shouldRefreshDocsCustomBlockSizeForCommand } from './embed-docs-custom-block-refresh';
|
|
77
|
+
export { scrollDocsTableLikeCustomBlockLive } from './embed-docs-custom-block-scroll';
|
|
78
|
+
export type { IDocsTableLikeCustomBlockScrollOptions } from './embed-docs-custom-block-scroll';
|
|
79
|
+
export { resolveDocsCustomBlockRenderViewport } from './embed-host-anchor';
|
|
80
|
+
export type { IDocsCustomBlockLayoutViewport, IDocsCustomBlockRenderViewportParams } from './embed-host-anchor';
|
|
75
81
|
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
82
|
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
83
|
export { menuSchema as DocsUIMenuSchema } from './menu/schema';
|
|
78
84
|
export { UniverDocsUIPlugin } from './plugin';
|
|
79
85
|
export * from './services';
|
|
80
86
|
export { IDocClipboardService } from './services/clipboard/clipboard.service';
|
|
87
|
+
export { DocClipboardPasteAdapterService, IDocClipboardPasteAdapterService, } from './services/clipboard/doc-paste-mutation-adapter.service';
|
|
88
|
+
export type { IDocClipboardPasteAdapter, IDocClipboardPasteCustomBlockMapping, IDocClipboardPasteMutationInfoParams, IDocClipboardPasteMutationInfos, } from './services/clipboard/doc-paste-mutation-adapter.service';
|
|
81
89
|
export { convertBodyToHtml } from './services/clipboard/udm-to-html/convertor';
|
|
82
90
|
export { DocHtmlExportService } from './services/clipboard/udm-to-html/doc-html-export.service';
|
|
83
91
|
export type { DocHtmlExportTransformer } from './services/clipboard/udm-to-html/doc-html-export.service';
|
|
84
92
|
export { DocAutoFormatService } from './services/doc-auto-format.service';
|
|
93
|
+
export { DOC_EMBED_INTERACTION_BOUNDARY_OWNER_ATTRIBUTE, IDocEmbedInteractionBoundaryService, IDocEmbedRuntimeFocusCoordinator } from './services/doc-embed-integration.service';
|
|
94
|
+
export type { IDocEmbedInteractionBoundaryService as IDocEmbedInteractionBoundaryServiceType, IDocEmbedRuntimeFocusCoordinator as IDocEmbedRuntimeFocusCoordinatorType } from './services/doc-embed-integration.service';
|
|
85
95
|
export { DocEventManagerService, getListMarkerFallbackBound, getListParagraphContextMenuHit, } from './services/doc-event-manager.service';
|
|
86
96
|
export type { IBulletBound, IMutiPageParagraphBound } from './services/doc-event-manager.service';
|
|
87
97
|
export { DocIMEInputManagerService } from './services/doc-ime-input-manager.service';
|
|
98
|
+
export { DocPageLayoutService } from './services/doc-page-layout.service';
|
|
88
99
|
export { DocParagraphMenuService } from './services/doc-paragraph-menu.service';
|
|
89
100
|
export { calcDocRangePositions, DocCanvasPopManagerService } from './services/doc-popup-manager.service';
|
|
90
101
|
export { DocPrintInterceptorService } from './services/doc-print-interceptor.service';
|
|
@@ -92,6 +103,7 @@ export type { IDocPrintComponentContext, IDocPrintContext } from './services/doc
|
|
|
92
103
|
export { DocsRenderService } from './services/docs-render.service';
|
|
93
104
|
export { Editor } from './services/editor/editor';
|
|
94
105
|
export { EditorService, IEditorService } from './services/editor/editor-manager.service';
|
|
106
|
+
export { DocFloatMenuService } from './services/float-menu.service';
|
|
95
107
|
export { isInSameTableCell, isValidRectRange, NodePositionConvertToRectRange, } from './services/selection/convert-rect-range';
|
|
96
108
|
export { NodePositionConvertToCursor } from './services/selection/convert-text-range';
|
|
97
109
|
export { getOneTextSelectionRange } from './services/selection/convert-text-range';
|
|
@@ -107,3 +119,5 @@ export { createEditorUndoRedoKeyboardConfig, executeEditorUndoRedoCommand, useEd
|
|
|
107
119
|
export type { ICreateEditorUndoRedoKeyboardConfigOptions, IExecuteEditorUndoRedoCommandOptions, IKeyboardEventConfig, } from './views/rich-text-editor/hooks';
|
|
108
120
|
export { RichTextEditor } from './views/RichTextEditor';
|
|
109
121
|
export type { IRichTextEditorProps } from './views/RichTextEditor';
|
|
122
|
+
export { createDocsCustomBlockInsertMutation, createDocsCustomBlockRemoveMutation, createEmbedDocsCustomBlockData, createInsertCustomBlockActions, createRemoveCustomBlockActions, EMBED_DOCS_CUSTOM_BLOCK_DEFAULT_COMPONENT_KEY, isSheetLikeDocsCustomBlockChildType, resolveDocsCustomBlockSize } from '@univerjs/docs';
|
|
123
|
+
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;
|
|
@@ -94,11 +95,16 @@ declare const locale: {
|
|
|
94
95
|
listItem: string;
|
|
95
96
|
};
|
|
96
97
|
doc: {
|
|
98
|
+
blockMenu: {
|
|
99
|
+
dragBlock: string;
|
|
100
|
+
};
|
|
97
101
|
menu: {
|
|
98
102
|
paragraphSetting: string;
|
|
103
|
+
sectionSetting: string;
|
|
99
104
|
};
|
|
100
105
|
slider: {
|
|
101
106
|
paragraphSetting: string;
|
|
107
|
+
sectionSetting: string;
|
|
102
108
|
};
|
|
103
109
|
paragraphSetting: {
|
|
104
110
|
alignment: string;
|
|
@@ -116,6 +122,20 @@ declare const locale: {
|
|
|
116
122
|
exactly: string;
|
|
117
123
|
fixedValue: string;
|
|
118
124
|
};
|
|
125
|
+
sectionSetting: {
|
|
126
|
+
selectedSections: string;
|
|
127
|
+
columnCount: string;
|
|
128
|
+
columnGap: string;
|
|
129
|
+
columnSeparator: string;
|
|
130
|
+
none: string;
|
|
131
|
+
betweenColumns: string;
|
|
132
|
+
sectionStart: string;
|
|
133
|
+
unspecified: string;
|
|
134
|
+
continuous: string;
|
|
135
|
+
nextPage: string;
|
|
136
|
+
evenPage: string;
|
|
137
|
+
oddPage: string;
|
|
138
|
+
};
|
|
119
139
|
};
|
|
120
140
|
rightClick: {
|
|
121
141
|
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,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>;
|
package/lib/types/plugin.d.ts
CHANGED
|
@@ -14,25 +14,24 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { IUniverDocsUIConfig } from './config/config';
|
|
17
|
-
import { ICommandService, IConfigService,
|
|
17
|
+
import { ICommandService, IConfigService, Injector, Plugin } from '@univerjs/core';
|
|
18
18
|
import { IRenderManagerService } from '@univerjs/engine-render';
|
|
19
19
|
export declare class UniverDocsUIPlugin extends Plugin {
|
|
20
20
|
private readonly _config;
|
|
21
21
|
_injector: Injector;
|
|
22
22
|
private readonly _renderManagerSrv;
|
|
23
23
|
private _commandService;
|
|
24
|
-
private _logService;
|
|
25
24
|
private readonly _configService;
|
|
26
25
|
static pluginName: string;
|
|
27
26
|
static packageName: string;
|
|
28
27
|
static version: string;
|
|
29
|
-
constructor(_config: Partial<IUniverDocsUIConfig> | undefined, _injector: Injector, _renderManagerSrv: IRenderManagerService, _commandService: ICommandService,
|
|
28
|
+
constructor(_config: Partial<IUniverDocsUIConfig> | undefined, _injector: Injector, _renderManagerSrv: IRenderManagerService, _commandService: ICommandService, _configService: IConfigService);
|
|
30
29
|
onReady(): void;
|
|
31
30
|
onRendered(): void;
|
|
32
31
|
private _initCommand;
|
|
33
32
|
private _initializeShortcut;
|
|
34
33
|
private _initDependencies;
|
|
35
|
-
private
|
|
34
|
+
private _initAutoFocus;
|
|
36
35
|
private _initRenderBasics;
|
|
37
36
|
private _initRenderModules;
|
|
38
37
|
}
|
|
@@ -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;
|
|
@@ -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,24 +17,22 @@ import type { DocumentDataModel, IDisposable, Nullable } from '@univerjs/core';
|
|
|
17
17
|
import type { IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
|
18
18
|
import { Disposable, IUniverInstanceService } from '@univerjs/core';
|
|
19
19
|
import { DocSelectionManagerService } from '@univerjs/docs';
|
|
20
|
-
import { ComponentManager } from '@univerjs/ui';
|
|
21
20
|
import { DocCanvasPopManagerService } from './doc-popup-manager.service';
|
|
22
21
|
import { DocSelectionRenderService } from './selection/doc-selection-render.service';
|
|
23
22
|
export declare class DocFloatMenuService extends Disposable implements IRenderModule {
|
|
24
23
|
private _context;
|
|
25
24
|
private readonly _docSelectionManagerService;
|
|
26
25
|
private readonly _docCanvasPopManagerService;
|
|
27
|
-
private readonly _componentManager;
|
|
28
26
|
private readonly _univerInstanceService;
|
|
29
27
|
private readonly _docSelectionRenderService;
|
|
30
28
|
private _floatMenu;
|
|
31
|
-
constructor(_context: IRenderContext<DocumentDataModel>, _docSelectionManagerService: DocSelectionManagerService, _docCanvasPopManagerService: DocCanvasPopManagerService,
|
|
29
|
+
constructor(_context: IRenderContext<DocumentDataModel>, _docSelectionManagerService: DocSelectionManagerService, _docCanvasPopManagerService: DocCanvasPopManagerService, _univerInstanceService: IUniverInstanceService, _docSelectionRenderService: DocSelectionRenderService);
|
|
32
30
|
get floatMenu(): Nullable<{
|
|
33
31
|
disposable: IDisposable;
|
|
34
32
|
start: number;
|
|
35
33
|
end: number;
|
|
36
34
|
}>;
|
|
37
|
-
|
|
35
|
+
hideFloatMenu(): void;
|
|
38
36
|
private _initSelectionChange;
|
|
39
37
|
private _hideFloatMenu;
|
|
40
38
|
private _showFloatMenu;
|
|
@@ -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;
|
|
@@ -140,6 +146,7 @@ export declare class DocSelectionRenderService extends RxDisposable implements I
|
|
|
140
146
|
private _isEmpty;
|
|
141
147
|
private _getCanvasOffset;
|
|
142
148
|
private _updateInputPosition;
|
|
149
|
+
private _tryMoving;
|
|
143
150
|
private _moving;
|
|
144
151
|
private _hasVisibleSelectionRanges;
|
|
145
152
|
private _shouldSnapBackwardFocusToGlyphStart;
|
|
@@ -148,7 +155,15 @@ export declare class DocSelectionRenderService extends RxDisposable implements I
|
|
|
148
155
|
__attachScrollEvent(): void;
|
|
149
156
|
private _initInputEvents;
|
|
150
157
|
private _eventHandle;
|
|
158
|
+
private _shouldSuppressHostHiddenEditorEvent;
|
|
159
|
+
private _stopEmbedOwnedEditorShortcutPropagation;
|
|
151
160
|
private _getTransformCoordForDocumentOffset;
|
|
152
161
|
private _findNodeByCoord;
|
|
162
|
+
private _shouldPreserveExternalFocus;
|
|
163
|
+
private _containsCurrentEmbedRuntimeElement;
|
|
164
|
+
private _getCurrentEmbedOwner;
|
|
165
|
+
private _getElementEmbedOwner;
|
|
166
|
+
private _containsOwnEditorElement;
|
|
167
|
+
private _containsCurrentLayoutElement;
|
|
153
168
|
private _detachEvent;
|
|
154
169
|
}
|
|
@@ -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): {
|
|
@@ -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;
|
|
@@ -17,6 +17,7 @@ import type { IMenuManagerService as IMenuManagerServiceType, IMenuSchema } from
|
|
|
17
17
|
interface IFloatToolbarProps {
|
|
18
18
|
avaliableMenus?: string[];
|
|
19
19
|
}
|
|
20
|
+
export declare const FLOAT_MENU_COMPONENT_KEY = "univer.doc.float-menu";
|
|
20
21
|
export declare function resolveFloatToolbarMenus(menuManagerService: IMenuManagerServiceType, avaliableMenus: string[]): {
|
|
21
22
|
menus: IMenuSchema[];
|
|
22
23
|
extraMenus: IMenuSchema[];
|
|
@@ -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,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
|
|
24
|
-
label:
|
|
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";
|