@univerjs/docs-ui 0.2.12 → 0.2.14
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 +28 -6
- package/lib/es/index.js +8694 -3109
- package/lib/index.css +1 -1
- package/lib/types/basics/__tests__/plain-text.spec.d.ts +16 -0
- package/lib/types/basics/component-tools.d.ts +17 -0
- package/lib/types/basics/const/plugin-name.d.ts +1 -1
- package/lib/types/basics/custom-decoration-factory.d.ts +24 -0
- package/lib/types/basics/custom-range-factory.d.ts +25 -0
- package/lib/types/basics/docs-view-key.d.ts +30 -0
- package/lib/types/basics/paragraph.d.ts +2 -0
- package/lib/types/basics/plain-text.d.ts +11 -0
- package/lib/types/basics/replace.d.ts +20 -0
- package/lib/types/basics/table.d.ts +16 -0
- package/lib/types/commands/commands/__tests__/clipboard.command.spec.d.ts +16 -0
- package/lib/types/commands/commands/__tests__/core-editing.command.spec.d.ts +16 -0
- package/lib/types/commands/commands/__tests__/create-command-test-bed.d.ts +34 -0
- package/lib/types/commands/commands/__tests__/inline-format.command.spec.d.ts +16 -0
- package/lib/types/commands/commands/__tests__/replace-content.command.spec.d.ts +16 -0
- package/lib/types/commands/commands/auto-format.command.d.ts +7 -0
- package/lib/types/commands/commands/break-line.command.d.ts +3 -0
- package/lib/types/commands/commands/clipboard.inner.command.d.ts +16 -0
- package/lib/types/commands/commands/core-editing.command.d.ts +44 -0
- package/lib/types/commands/commands/delete.command.d.ts +19 -0
- package/lib/types/commands/commands/ime-input.command.d.ts +9 -0
- package/lib/types/commands/commands/inline-format.command.d.ts +17 -0
- package/lib/types/commands/commands/list.command.d.ts +42 -0
- package/lib/types/commands/commands/paragraph-align.command.d.ts +18 -0
- package/lib/types/commands/commands/replace-content.command.d.ts +26 -0
- package/lib/types/commands/commands/set-doc-zoom-ratio.command.d.ts +6 -0
- package/lib/types/commands/commands/table/doc-table-create.command.d.ts +10 -0
- package/lib/types/commands/commands/table/doc-table-delete.command.d.ts +10 -0
- package/lib/types/commands/commands/table/doc-table-insert.command.d.ts +34 -0
- package/lib/types/commands/commands/table/doc-table-tab.command.d.ts +5 -0
- package/lib/types/commands/commands/table/table.d.ts +93 -0
- package/lib/types/commands/operations/doc-cursor.operation.d.ts +12 -0
- package/lib/types/commands/operations/select-all.operation.d.ts +5 -0
- package/lib/types/commands/operations/set-doc-zoom-ratio.operation.d.ts +7 -0
- package/lib/types/commands/util.d.ts +9 -0
- package/lib/types/controllers/app-ui-controller.d.ts +1 -6
- package/lib/types/controllers/doc-auto-format.controller.d.ts +1 -1
- package/lib/types/controllers/doc-header-footer.controller.d.ts +6 -5
- package/lib/types/controllers/doc-move-cursor.controller.d.ts +20 -0
- package/lib/types/controllers/menu/menu.d.ts +1 -1
- package/lib/types/controllers/render-controllers/back-scroll.render-controller.d.ts +4 -4
- package/lib/types/controllers/render-controllers/doc-checklist.render-controller.d.ts +3 -3
- package/lib/types/controllers/render-controllers/doc-clipboard.controller.d.ts +14 -0
- package/lib/types/controllers/render-controllers/{contextmenu.render-controller.d.ts → doc-contextmenu.render-controller.d.ts} +3 -5
- package/lib/types/controllers/render-controllers/doc-editor-bridge.controller.d.ts +27 -0
- package/lib/types/controllers/render-controllers/doc-ime-input.controller.d.ts +25 -0
- package/lib/types/controllers/render-controllers/doc-input.controller.d.ts +15 -0
- package/lib/types/controllers/render-controllers/doc-resize.render-controller.d.ts +2 -2
- package/lib/types/controllers/render-controllers/{text-selection.render-controller.d.ts → doc-selection-render.controller.d.ts} +9 -6
- package/lib/types/controllers/render-controllers/doc.render-controller.d.ts +2 -2
- package/lib/types/controllers/render-controllers/zoom.render-controller.d.ts +4 -4
- package/lib/types/docs-ui-plugin.d.ts +1 -1
- package/lib/types/index.d.ts +62 -11
- package/lib/types/services/clipboard/clipboard.service.d.ts +5 -5
- package/lib/types/services/doc-auto-format.service.d.ts +38 -0
- package/lib/types/services/doc-event-manager.service.d.ts +3 -1
- package/lib/types/services/doc-ime-input-manager.service.d.ts +30 -0
- package/lib/types/services/doc-page-layout.service.d.ts +1 -1
- package/lib/types/services/doc-popup-manager.service.d.ts +4 -4
- package/lib/types/services/doc-state-change-manager.service.d.ts +23 -0
- package/lib/types/services/selection/convert-rect-range.d.ts +27 -0
- package/lib/types/services/selection/convert-text-range.d.ts +60 -0
- package/lib/types/services/selection/doc-selection-render.service.d.ts +121 -0
- package/lib/types/services/selection/range-interface.d.ts +19 -0
- package/lib/types/services/selection/rect-range.d.ts +47 -0
- package/lib/types/services/selection/selection-utils.d.ts +26 -0
- package/lib/types/services/selection/text-range.d.ts +63 -0
- package/lib/types/types/const/padding.d.ts +16 -0
- package/lib/types/types/delete-direction.d.ts +19 -0
- package/lib/types/views/paragraph-setting/hook/utils.d.ts +1 -1
- package/lib/umd/index.js +28 -6
- package/package.json +16 -16
- package/lib/types/controllers/clipboard.controller.d.ts +0 -14
- package/lib/types/controllers/doc-editor-bridge.controller.d.ts +0 -23
package/lib/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.univer-panel{padding-top:20px;font-size:var(--font-size-sm)}.univer-options-section{margin-top:10px;padding-bottom:10px}.univer-options-form-item{display:block;margin-bottom:5px}.univer-options-input{width:80%;margin-top:5px}.univer-options-margin-setting{display:flex}.univer-doc-
|
|
1
|
+
.univer-panel{padding-top:20px;font-size:var(--font-size-sm)}.univer-options-section{margin-top:10px;padding-bottom:10px}.univer-options-form-item{display:block;margin-bottom:5px}.univer-options-input{width:80%;margin-top:5px}.univer-options-margin-setting{display:flex}.univer-doc-list-type-picker{display:flex;flex-direction:row;justify-content:space-between;flex-wrap:wrap;padding:var(--padding-sm);width:240px;margin-bottom:-var(--margin-xs)}.univer-doc-list-type-picker-item{width:72px;height:81px;border-radius:4px;border:1px solid rgb(var(--border-color));margin-bottom:var(--margin-xs)}.univer-doc-list-type-picker-item:hover,.univer-doc-list-type-picker-item-active{border:1px solid rgb(var(--blue-400))}.univer-doc-count-bar{display:flex;flex:0 0 260px;justify-content:flex-end}.univer-doc-footer-container{display:flex;flex-direction:row;align-items:center;justify-content:space-between;padding:0 var(--padding-xl)}.univer-paragraph-setting-icon-list{display:flex;width:100%;padding:4px;align-items:center;gap:4px;justify-content:space-between;border:1px solid var(---Grey-200, #e5e5e5);border-radius:var(--radius-m, 6px)}.univer-paragraph-setting-icon-list-item{padding:4px 14px;border-radius:4px;background:none;display:flex;justify-content:center;align-items:center;cursor:pointer}.univer-paragraph-setting-icon-list-item:hover{background:var(--black-6, rgba(30, 34, 43, .06))}.univer-paragraph-setting-icon-list-item.univer-paragraph-setting-icon-list-active{background:var(--black-9, rgba(30, 34, 43, .09))}.univer-paragraph-setting-title{margin-top:var(--margin-base);font-size:13px;color:#1e222b;font-weight:500}.univer-paragraph-setting-label{font-size:12px;margin-top:var(--margin-sm);color:#1e222b;font-weight:400}.univer-paragraph-setting-mt-base{margin-top:var(--margin-base)}.univer-paragraph-setting-flex-col{display:flex;justify-content:space-between;align-items:center}.univer-paragraph-setting-space-line{display:flex;flex-direction:column;gap:6px}.univer-create{padding:20px auto;display:flex;align-content:center;justify-content:space-between}.univer-create-item{display:flex;align-items:center}.univer-create-label{margin-right:5px}.univer-create-input{width:110px}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
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 {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { DocumentDataModel, IUniverInstanceService, Nullable } from '@univerjs/core';
|
|
2
|
+
import { DocBackground, Documents, Engine, IRenderContext, IRenderManagerService, Scene } from '@univerjs/engine-render';
|
|
3
|
+
export interface IDocObjectParam {
|
|
4
|
+
document: Documents;
|
|
5
|
+
docBackground: DocBackground;
|
|
6
|
+
scene: Scene;
|
|
7
|
+
engine: Engine;
|
|
8
|
+
}
|
|
9
|
+
export declare function neoGetDocObject(renderContext: IRenderContext<DocumentDataModel>): {
|
|
10
|
+
document: Documents;
|
|
11
|
+
docBackground: DocBackground;
|
|
12
|
+
scene: Scene;
|
|
13
|
+
engine: Engine;
|
|
14
|
+
};
|
|
15
|
+
/** @deprecated After migrating to `RenderUnit`, use `neoGetDocObject` instead. */
|
|
16
|
+
export declare function getDocObject(univerInstanceService: IUniverInstanceService, renderManagerService: IRenderManagerService): Nullable<IDocObjectParam>;
|
|
17
|
+
export declare function getDocObjectById(unitId: string, renderManagerService: IRenderManagerService): Nullable<IDocObjectParam>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { CustomDecorationType, IAccessor, IMutationInfo } from '@univerjs/core';
|
|
2
|
+
import { IRichTextEditingMutationParams } from '@univerjs/docs';
|
|
3
|
+
import { ITextRangeWithStyle } from '@univerjs/engine-render';
|
|
4
|
+
interface IAddCustomDecorationParam {
|
|
5
|
+
unitId: string;
|
|
6
|
+
ranges: ITextRangeWithStyle[];
|
|
7
|
+
segmentId?: string;
|
|
8
|
+
id: string;
|
|
9
|
+
type: CustomDecorationType;
|
|
10
|
+
}
|
|
11
|
+
export declare function addCustomDecorationFactory(param: IAddCustomDecorationParam): IMutationInfo<IRichTextEditingMutationParams>;
|
|
12
|
+
interface IAddCustomDecorationFactoryParam {
|
|
13
|
+
segmentId?: string;
|
|
14
|
+
id: string;
|
|
15
|
+
type: CustomDecorationType;
|
|
16
|
+
}
|
|
17
|
+
export declare function addCustomDecorationBySelectionFactory(accessor: IAccessor, param: IAddCustomDecorationFactoryParam): false | IMutationInfo<IRichTextEditingMutationParams>;
|
|
18
|
+
export interface IDeleteCustomRangeParam {
|
|
19
|
+
unitId: string;
|
|
20
|
+
id: string;
|
|
21
|
+
segmentId?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare function deleteCustomDecorationFactory(accessor: IAccessor, params: IDeleteCustomRangeParam): false | IMutationInfo<IRichTextEditingMutationParams>;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { CustomRangeType, IAccessor, IAddCustomRangeTextXParam, IDocumentBody, IMutationInfo, ITextRangeParam, Nullable, TextX } from '@univerjs/core';
|
|
2
|
+
import { IRichTextEditingMutationParams } from '@univerjs/docs';
|
|
3
|
+
interface IAddCustomRangeParam extends IAddCustomRangeTextXParam {
|
|
4
|
+
unitId: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function addCustomRangeFactory(accessor: IAccessor, param: IAddCustomRangeParam, body: IDocumentBody): false | IMutationInfo<IRichTextEditingMutationParams>;
|
|
7
|
+
interface IAddCustomRangeFactoryParam {
|
|
8
|
+
rangeId: string;
|
|
9
|
+
rangeType: CustomRangeType;
|
|
10
|
+
wholeEntity?: boolean;
|
|
11
|
+
properties?: Record<string, any>;
|
|
12
|
+
unitId: string;
|
|
13
|
+
selection?: ITextRangeParam;
|
|
14
|
+
}
|
|
15
|
+
export declare function addCustomRangeBySelectionFactory(accessor: IAccessor, param: IAddCustomRangeFactoryParam): false | (IMutationInfo<IRichTextEditingMutationParams> & {
|
|
16
|
+
textX: TextX;
|
|
17
|
+
});
|
|
18
|
+
export interface IDeleteCustomRangeFactoryParams {
|
|
19
|
+
rangeId: string;
|
|
20
|
+
segmentId?: string;
|
|
21
|
+
unitId: string;
|
|
22
|
+
insert?: Nullable<IDocumentBody>;
|
|
23
|
+
}
|
|
24
|
+
export declare function deleteCustomRangeFactory(accessor: IAccessor, params: IDeleteCustomRangeFactoryParams): false | IMutationInfo<IRichTextEditingMutationParams>;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
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 enum DOCS_VIEW_KEY {
|
|
17
|
+
MAIN = "__Document_Render_Main__",
|
|
18
|
+
BACKGROUND = "__Document_Render_Background__"
|
|
19
|
+
}
|
|
20
|
+
export declare enum VIEWPORT_KEY {
|
|
21
|
+
VIEW_MAIN = "viewMain",
|
|
22
|
+
VIEW_TOP = "viewTop",
|
|
23
|
+
VIEW_LEFT = "viewLeft",
|
|
24
|
+
VIEW_LEFT_TOP = "viewLeftTop"
|
|
25
|
+
}
|
|
26
|
+
export declare const DOCS_COMPONENT_BACKGROUND_LAYER_INDEX = 0;
|
|
27
|
+
export declare const DOCS_COMPONENT_MAIN_LAYER_INDEX = 2;
|
|
28
|
+
export declare const DOCS_COMPONENT_HEADER_LAYER_INDEX = 4;
|
|
29
|
+
export declare const DOCS_COMPONENT_DEFAULT_Z_INDEX = 10;
|
|
30
|
+
export declare const NORMAL_TEXT_SELECTION_PLUGIN_NAME = "normalTextSelectionPluginName";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IDocumentBody, IDocumentData } from '@univerjs/core';
|
|
2
|
+
export declare const getPlainText: (text: string) => string;
|
|
3
|
+
/**
|
|
4
|
+
* get plain text from rich-text
|
|
5
|
+
*/
|
|
6
|
+
export declare const getPlainTextFormBody: (body: IDocumentBody) => string;
|
|
7
|
+
/**
|
|
8
|
+
* get plain text from rich-text
|
|
9
|
+
*/
|
|
10
|
+
export declare const getPlainTextFormDocument: (data: IDocumentData) => string;
|
|
11
|
+
export declare function getSelectionText(dataStream: string, start: number, end: number): string;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { DocumentDataModel, IAccessor, IDocumentBody, IMutationInfo, ITextRangeParam, TextX } from '@univerjs/core';
|
|
2
|
+
import { IRichTextEditingMutationParams } from '@univerjs/docs';
|
|
3
|
+
import { ITextRangeWithStyle } from '@univerjs/engine-render';
|
|
4
|
+
export interface IReplaceSelectionFactoryParams {
|
|
5
|
+
unitId: string;
|
|
6
|
+
/**
|
|
7
|
+
* slelection to be replaced, if not provided, use the current selection.
|
|
8
|
+
*/
|
|
9
|
+
selection?: ITextRangeParam;
|
|
10
|
+
/** Body to be inserted at the given position. */
|
|
11
|
+
body: IDocumentBody;
|
|
12
|
+
/**
|
|
13
|
+
* Text ranges to be replaced.
|
|
14
|
+
*/
|
|
15
|
+
textRanges?: ITextRangeWithStyle[];
|
|
16
|
+
doc?: DocumentDataModel;
|
|
17
|
+
}
|
|
18
|
+
export declare function replaceSelectionFactory(accessor: IAccessor, params: IReplaceSelectionFactoryParams): false | (IMutationInfo<IRichTextEditingMutationParams> & {
|
|
19
|
+
textX: TextX;
|
|
20
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Nullable } from '@univerjs/core';
|
|
2
|
+
import { IDocumentSkeletonLine, IDocumentSkeletonPage, IDocumentSkeletonTable } from '@univerjs/engine-render';
|
|
3
|
+
export declare function firstLineInTable(table: IDocumentSkeletonTable): IDocumentSkeletonLine;
|
|
4
|
+
export declare function lastLineInTable(table: IDocumentSkeletonTable): IDocumentSkeletonLine | undefined;
|
|
5
|
+
export declare function findTableAfterLine(line: IDocumentSkeletonLine, page: IDocumentSkeletonPage): IDocumentSkeletonTable | null;
|
|
6
|
+
export declare function findLineBeforeAndAfterTable(table: Nullable<IDocumentSkeletonTable>): {
|
|
7
|
+
lineBeforeTable: null;
|
|
8
|
+
lineAfterTable: null;
|
|
9
|
+
};
|
|
10
|
+
export declare function findBellowCell(cell: IDocumentSkeletonPage): IDocumentSkeletonPage | undefined;
|
|
11
|
+
export declare function findAboveCell(cell: IDocumentSkeletonPage): IDocumentSkeletonPage | undefined;
|
|
12
|
+
export declare function findTableBeforeLine(line: IDocumentSkeletonLine, page: IDocumentSkeletonPage): IDocumentSkeletonTable | null;
|
|
13
|
+
export declare function firstLineInCell(cell: IDocumentSkeletonPage): IDocumentSkeletonLine;
|
|
14
|
+
export declare function lastLineInCell(cell: IDocumentSkeletonPage): IDocumentSkeletonLine | undefined;
|
|
15
|
+
export declare function isFirstLineInCell(line: IDocumentSkeletonLine, cell: IDocumentSkeletonPage): boolean;
|
|
16
|
+
export declare function isLastLineInCell(line: IDocumentSkeletonLine, cell: IDocumentSkeletonPage): boolean;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
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 {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
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 {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Injector, IUniverInstanceService, RxDisposable, Univer, Dependency, DependencyIdentifier, DocumentDataModel, IDocumentData, Nullable } from '@univerjs/core';
|
|
2
|
+
import { DocumentViewModel, IRenderManagerService, DocumentSkeleton, IRender, IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
|
3
|
+
export declare function createCommandTestBed(docData?: IDocumentData, dependencies?: Dependency[]): {
|
|
4
|
+
univer: Univer;
|
|
5
|
+
get: {
|
|
6
|
+
<T>(id: DependencyIdentifier<T>, lookUp?: import('@wendellhu/redi').LookUp): T;
|
|
7
|
+
<T>(id: DependencyIdentifier<T>, quantity: import("@wendellhu/redi").Quantity.MANY, lookUp?: import('@wendellhu/redi').LookUp): T[];
|
|
8
|
+
<T>(id: DependencyIdentifier<T>, quantity: import("@wendellhu/redi").Quantity.OPTIONAL, lookUp?: import('@wendellhu/redi').LookUp): T | null;
|
|
9
|
+
<T>(id: DependencyIdentifier<T>, quantity: import("@wendellhu/redi").Quantity.REQUIRED, lookUp?: import('@wendellhu/redi').LookUp): T;
|
|
10
|
+
<T>(id: DependencyIdentifier<T>, quantity?: import('@wendellhu/redi').Quantity, lookUp?: import('@wendellhu/redi').LookUp): T[] | T | null;
|
|
11
|
+
<T>(id: DependencyIdentifier<T>, quantityOrLookup?: import('@wendellhu/redi').Quantity | import('@wendellhu/redi').LookUp, lookUp?: import('@wendellhu/redi').LookUp): T[] | T | null;
|
|
12
|
+
};
|
|
13
|
+
doc: DocumentDataModel;
|
|
14
|
+
};
|
|
15
|
+
export declare class MockRenderManagerService implements Pick<IRenderManagerService, 'getRenderById'> {
|
|
16
|
+
private readonly _injector;
|
|
17
|
+
constructor(_injector: Injector);
|
|
18
|
+
getRenderById(_unitId: string): Nullable<IRender>;
|
|
19
|
+
}
|
|
20
|
+
export declare class MockDocSkeletonManagerService extends RxDisposable implements IRenderModule {
|
|
21
|
+
private readonly _context;
|
|
22
|
+
private readonly _univerInstanceService;
|
|
23
|
+
private _docViewModel;
|
|
24
|
+
private readonly _currentSkeleton$;
|
|
25
|
+
readonly currentSkeleton$: import('rxjs').Observable<Nullable<DocumentSkeleton>>;
|
|
26
|
+
private readonly _currentSkeletonBefore$;
|
|
27
|
+
readonly currentSkeletonBefore$: import('rxjs').Observable<Nullable<DocumentSkeleton>>;
|
|
28
|
+
constructor(_context: IRenderContext<DocumentDataModel>, _univerInstanceService: IUniverInstanceService);
|
|
29
|
+
dispose(): void;
|
|
30
|
+
private _update;
|
|
31
|
+
getSkeleton(): DocumentSkeleton;
|
|
32
|
+
getViewModel(): DocumentViewModel;
|
|
33
|
+
private _buildDocViewModel;
|
|
34
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
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 {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
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 {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DocumentDataModel, ICommand, IDocumentBody, IDocumentData, ITextRange, JSONXActions, Nullable } from '@univerjs/core';
|
|
2
|
+
import { DocumentViewModel, IRectRangeWithStyle, ITextRangeWithStyle } from '@univerjs/engine-render';
|
|
3
|
+
export declare function getCustomBlockIdsInSelections(body: IDocumentBody, selections: ITextRange[]): string[];
|
|
4
|
+
export interface IInnerPasteCommandParams {
|
|
5
|
+
segmentId: string;
|
|
6
|
+
doc: Partial<IDocumentData>;
|
|
7
|
+
textRanges: ITextRangeWithStyle[];
|
|
8
|
+
}
|
|
9
|
+
export declare const InnerPasteCommand: ICommand<IInnerPasteCommandParams>;
|
|
10
|
+
export declare function getCutActionsFromDocRanges(textRanges: Readonly<Nullable<ITextRangeWithStyle[]>>, rectRanges: Readonly<Nullable<IRectRangeWithStyle[]>>, docDataModel: DocumentDataModel, viewModel: DocumentViewModel, segmentId: string): JSONXActions;
|
|
11
|
+
export interface IInnerCutCommandParams {
|
|
12
|
+
segmentId: string;
|
|
13
|
+
textRanges: ITextRangeWithStyle[];
|
|
14
|
+
selections?: ITextRange[];
|
|
15
|
+
}
|
|
16
|
+
export declare const CutContentCommand: ICommand<IInnerCutCommandParams>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ICommand, IDocumentBody, IDocumentData, ITextRange, UpdateDocsAttributeType } from '@univerjs/core';
|
|
2
|
+
import { ITextRangeWithStyle } from '@univerjs/engine-render';
|
|
3
|
+
import { DeleteDirection } from '../../types/delete-direction';
|
|
4
|
+
export interface IInsertCommandParams {
|
|
5
|
+
unitId: string;
|
|
6
|
+
body: IDocumentBody;
|
|
7
|
+
range: ITextRange;
|
|
8
|
+
segmentId?: string;
|
|
9
|
+
cursorOffset?: number;
|
|
10
|
+
extendLastRange?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const EditorInsertTextCommandId = "doc.command.insert-text";
|
|
13
|
+
/**
|
|
14
|
+
* The command to insert text. The changed range could be non-collapsed, mainly use in line break and normal input.
|
|
15
|
+
*/
|
|
16
|
+
export declare const InsertCommand: ICommand<IInsertCommandParams>;
|
|
17
|
+
export interface IDeleteCommandParams {
|
|
18
|
+
unitId: string;
|
|
19
|
+
range: ITextRange;
|
|
20
|
+
direction: DeleteDirection;
|
|
21
|
+
len?: number;
|
|
22
|
+
segmentId?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The command to delete text, mainly used in BACKSPACE and DELETE when collapsed is true. ONLY handle collapsed range!!!
|
|
26
|
+
*/
|
|
27
|
+
export declare const DeleteCommand: ICommand<IDeleteCommandParams>;
|
|
28
|
+
export interface IUpdateCommandParams {
|
|
29
|
+
unitId: string;
|
|
30
|
+
updateBody: IDocumentBody;
|
|
31
|
+
range: ITextRange;
|
|
32
|
+
coverType: UpdateDocsAttributeType;
|
|
33
|
+
textRanges: ITextRangeWithStyle[];
|
|
34
|
+
segmentId?: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* The command to update text properties, mainly used in BACKSPACE.
|
|
38
|
+
*/
|
|
39
|
+
export declare const UpdateCommand: ICommand<IUpdateCommandParams>;
|
|
40
|
+
export interface ICoverCommandParams {
|
|
41
|
+
unitId: string;
|
|
42
|
+
snapshot?: IDocumentData;
|
|
43
|
+
clearUndoRedoStack?: boolean;
|
|
44
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ICommand, Nullable } from '@univerjs/core';
|
|
2
|
+
import { IRectRangeWithStyle, ITextRangeWithStyle } from '@univerjs/engine-render';
|
|
3
|
+
import { DeleteDirection } from '../../types/delete-direction';
|
|
4
|
+
export interface IDeleteCustomBlockParams {
|
|
5
|
+
direction: DeleteDirection;
|
|
6
|
+
range: ITextRangeWithStyle;
|
|
7
|
+
unitId: string;
|
|
8
|
+
drawingId: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const DeleteCustomBlockCommand: ICommand<IDeleteCustomBlockParams>;
|
|
11
|
+
interface IMergeTwoParagraphParams {
|
|
12
|
+
direction: DeleteDirection;
|
|
13
|
+
range: ITextRangeWithStyle;
|
|
14
|
+
}
|
|
15
|
+
export declare const MergeTwoParagraphCommand: ICommand<IMergeTwoParagraphParams>;
|
|
16
|
+
export declare function getCursorWhenDelete(textRanges: Readonly<Nullable<ITextRangeWithStyle[]>>, rectRanges: readonly IRectRangeWithStyle[]): number;
|
|
17
|
+
export declare const DeleteLeftCommand: ICommand;
|
|
18
|
+
export declare const DeleteRightCommand: ICommand;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ICommand } from '@univerjs/core';
|
|
2
|
+
export interface IIMEInputCommandParams {
|
|
3
|
+
unitId: string;
|
|
4
|
+
newText: string;
|
|
5
|
+
oldTextLen: number;
|
|
6
|
+
isCompositionStart: boolean;
|
|
7
|
+
isCompositionEnd: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const IMEInputCommand: ICommand<IIMEInputCommandParams>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ICommand } from '@univerjs/core';
|
|
2
|
+
export interface ISetInlineFormatCommandParams {
|
|
3
|
+
preCommandId: string;
|
|
4
|
+
value?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const SetInlineFormatBoldCommand: ICommand;
|
|
7
|
+
export declare const SetInlineFormatItalicCommand: ICommand;
|
|
8
|
+
export declare const SetInlineFormatUnderlineCommand: ICommand;
|
|
9
|
+
export declare const SetInlineFormatStrikethroughCommand: ICommand;
|
|
10
|
+
export declare const SetInlineFormatSubscriptCommand: ICommand;
|
|
11
|
+
export declare const SetInlineFormatSuperscriptCommand: ICommand;
|
|
12
|
+
export declare const SetInlineFormatFontSizeCommand: ICommand;
|
|
13
|
+
export declare const SetInlineFormatFontFamilyCommand: ICommand;
|
|
14
|
+
export declare const SetInlineFormatTextColorCommand: ICommand;
|
|
15
|
+
export declare const SetInlineFormatTextBackgroundColorCommand: ICommand;
|
|
16
|
+
export declare const ResetInlineFormatTextBackgroundColorCommand: ICommand;
|
|
17
|
+
export declare const SetInlineFormatCommand: ICommand<ISetInlineFormatCommandParams>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { PresetListType, ICommand, IParagraph, IParagraphRange, ISectionBreak } from '@univerjs/core';
|
|
2
|
+
import { ITextRangeWithStyle } from '@univerjs/engine-render';
|
|
3
|
+
interface IListOperationCommandParams {
|
|
4
|
+
listType: PresetListType;
|
|
5
|
+
}
|
|
6
|
+
export declare const ListOperationCommand: ICommand<IListOperationCommandParams>;
|
|
7
|
+
interface IChangeListTypeCommandParams {
|
|
8
|
+
listType: PresetListType;
|
|
9
|
+
}
|
|
10
|
+
export declare const ChangeListTypeCommand: ICommand<IChangeListTypeCommandParams>;
|
|
11
|
+
export declare enum ChangeListNestingLevelType {
|
|
12
|
+
increase = 1,
|
|
13
|
+
decrease = -1
|
|
14
|
+
}
|
|
15
|
+
interface IChangeListNestingLevelCommandParams {
|
|
16
|
+
type: ChangeListNestingLevelType;
|
|
17
|
+
}
|
|
18
|
+
export declare const ChangeListNestingLevelCommand: ICommand<IChangeListNestingLevelCommandParams>;
|
|
19
|
+
interface IBulletListCommandParams {
|
|
20
|
+
value?: PresetListType;
|
|
21
|
+
}
|
|
22
|
+
export declare const BulletListCommand: ICommand<IBulletListCommandParams>;
|
|
23
|
+
export declare const CheckListCommand: ICommand<IBulletListCommandParams>;
|
|
24
|
+
export interface IToggleCheckListCommandParams {
|
|
25
|
+
index: number;
|
|
26
|
+
segmentId?: string;
|
|
27
|
+
}
|
|
28
|
+
export declare const ToggleCheckListCommand: ICommand<IToggleCheckListCommandParams>;
|
|
29
|
+
interface IOrderListCommandParams {
|
|
30
|
+
value?: PresetListType;
|
|
31
|
+
}
|
|
32
|
+
export declare const OrderListCommand: ICommand<IOrderListCommandParams>;
|
|
33
|
+
interface IQuickListCommandParams {
|
|
34
|
+
listType: PresetListType;
|
|
35
|
+
paragraph: IParagraphRange;
|
|
36
|
+
}
|
|
37
|
+
export declare const QuickListCommand: ICommand<IQuickListCommandParams>;
|
|
38
|
+
export declare function getParagraphsInRange(activeRange: ITextRangeWithStyle, paragraphs: IParagraph[]): IParagraph[];
|
|
39
|
+
export declare function getParagraphsRelative(ranges: ITextRangeWithStyle[], paragraphs: IParagraph[]): IParagraph[];
|
|
40
|
+
export declare function getParagraphsInRanges(ranges: ITextRangeWithStyle[], paragraphs: IParagraph[]): IParagraph[];
|
|
41
|
+
export declare function findNearestSectionBreak(currentIndex: number, sectionBreaks: ISectionBreak[]): ISectionBreak | undefined;
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HorizontalAlign, ICommand } from '@univerjs/core';
|
|
2
|
+
interface IAlignOperationCommandParams {
|
|
3
|
+
alignType: HorizontalAlign;
|
|
4
|
+
}
|
|
5
|
+
export declare const AlignOperationCommand: ICommand<IAlignOperationCommandParams>;
|
|
6
|
+
interface IAlignLeftCommandParams {
|
|
7
|
+
}
|
|
8
|
+
export declare const AlignLeftCommand: ICommand<IAlignLeftCommandParams>;
|
|
9
|
+
interface IAlignCenterCommandParams {
|
|
10
|
+
}
|
|
11
|
+
export declare const AlignCenterCommand: ICommand<IAlignCenterCommandParams>;
|
|
12
|
+
interface IAlignRightCommandParams {
|
|
13
|
+
}
|
|
14
|
+
export declare const AlignRightCommand: ICommand<IAlignRightCommandParams>;
|
|
15
|
+
interface IAlignJustifyCommandParams {
|
|
16
|
+
}
|
|
17
|
+
export declare const AlignJustifyCommand: ICommand<IAlignJustifyCommandParams>;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ICommand, IDocumentBody, ITextRange } from '@univerjs/core';
|
|
2
|
+
import { ITextRangeWithStyle } from '@univerjs/engine-render';
|
|
3
|
+
interface IReplaceContentCommandParams {
|
|
4
|
+
unitId: string;
|
|
5
|
+
body: IDocumentBody;
|
|
6
|
+
textRanges: ITextRangeWithStyle[];
|
|
7
|
+
segmentId?: string;
|
|
8
|
+
options: {
|
|
9
|
+
[key: string]: boolean;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export declare const ReplaceContentCommand: ICommand<IReplaceContentCommandParams>;
|
|
13
|
+
interface ICoverContentCommandParams {
|
|
14
|
+
unitId: string;
|
|
15
|
+
body: IDocumentBody;
|
|
16
|
+
segmentId?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare const CoverContentCommand: ICommand<ICoverContentCommandParams>;
|
|
19
|
+
export interface IReplaceSelectionCommandParams {
|
|
20
|
+
unitId: string;
|
|
21
|
+
selection?: ITextRange;
|
|
22
|
+
body: IDocumentBody;
|
|
23
|
+
textRanges?: ITextRangeWithStyle[];
|
|
24
|
+
}
|
|
25
|
+
export declare const ReplaceSelectionCommand: ICommand<IReplaceSelectionCommandParams>;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ICommand } from '@univerjs/core';
|
|
2
|
+
export declare const CreateDocTableCommandId = "doc.command.create-table";
|
|
3
|
+
export interface ICreateDocTableCommandParams {
|
|
4
|
+
rowCount: number;
|
|
5
|
+
colCount: number;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* The command to create a table at cursor point.
|
|
9
|
+
*/
|
|
10
|
+
export declare const CreateDocTableCommand: ICommand<ICreateDocTableCommandParams>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ICommand } from '@univerjs/core';
|
|
2
|
+
export interface IDocTableDeleteRowsCommandParams {
|
|
3
|
+
}
|
|
4
|
+
export declare const DocTableDeleteRowsCommand: ICommand<IDocTableDeleteRowsCommandParams>;
|
|
5
|
+
export interface IDocTableDeleteColumnsCommandParams {
|
|
6
|
+
}
|
|
7
|
+
export declare const DocTableDeleteColumnsCommand: ICommand<IDocTableDeleteColumnsCommandParams>;
|
|
8
|
+
export interface IDocTableDeleteTableCommandParams {
|
|
9
|
+
}
|
|
10
|
+
export declare const DocTableDeleteTableCommand: ICommand<IDocTableDeleteTableCommandParams>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ICommand } from '@univerjs/core';
|
|
2
|
+
import { INSERT_COLUMN_POSITION, INSERT_ROW_POSITION } from './table';
|
|
3
|
+
export declare const DocTableInsertRowCommandId = "doc.command.table-insert-row";
|
|
4
|
+
export declare const DocTableInsertColumnCommandId = "doc.command.table-insert-column";
|
|
5
|
+
export declare const DocTableInsertRowAboveCommandId = "doc.command.table-insert-row-above";
|
|
6
|
+
export declare const DocTableInsertRowBellowCommandId = "doc.command.table-insert-row-bellow";
|
|
7
|
+
export declare const DocTableInsertColumnLeftCommandId = "doc.command.table-insert-column-left";
|
|
8
|
+
export declare const DocTableInsertColumnRightCommandId = "doc.command.table-insert-column-right";
|
|
9
|
+
export interface IDocTableInsertRowAboveCommandParams {
|
|
10
|
+
}
|
|
11
|
+
export declare const DocTableInsertRowAboveCommand: ICommand<IDocTableInsertRowAboveCommandParams>;
|
|
12
|
+
export interface IDocTableInsertRowBellowCommandParams {
|
|
13
|
+
}
|
|
14
|
+
export declare const DocTableInsertRowBellowCommand: ICommand<IDocTableInsertRowBellowCommandParams>;
|
|
15
|
+
export interface IDocTableInsertColumnLeftCommandParams {
|
|
16
|
+
}
|
|
17
|
+
export declare const DocTableInsertColumnLeftCommand: ICommand<IDocTableInsertColumnLeftCommandParams>;
|
|
18
|
+
export interface IDocTableInsertColumnRightCommandParams {
|
|
19
|
+
}
|
|
20
|
+
export declare const DocTableInsertColumnRightCommand: ICommand<IDocTableInsertColumnRightCommandParams>;
|
|
21
|
+
export interface IDocTableInsertRowCommandParams {
|
|
22
|
+
position: INSERT_ROW_POSITION;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The command to insert table row.
|
|
26
|
+
*/
|
|
27
|
+
export declare const DocTableInsertRowCommand: ICommand<IDocTableInsertRowCommandParams>;
|
|
28
|
+
export interface IDocTableInsertColumnCommandParams {
|
|
29
|
+
position: INSERT_COLUMN_POSITION;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* The command to insert table column.
|
|
33
|
+
*/
|
|
34
|
+
export declare const DocTableInsertColumnCommand: ICommand<IDocTableInsertColumnCommandParams>;
|