@univerjs/docs 0.2.11 → 0.2.13
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 +1 -5
- package/lib/es/index.js +180 -4376
- package/lib/types/commands/mutations/core-editing.mutation.d.ts +1 -1
- package/lib/types/{types/enums/delete-direction.d.ts → controllers/config.schema.d.ts} +5 -3
- package/lib/types/controllers/custom-range.controller.d.ts +2 -2
- package/lib/types/doc-plugin.d.ts +5 -5
- package/lib/types/index.d.ts +8 -50
- package/lib/types/services/doc-interceptor/doc-interceptor.service.d.ts +1 -1
- package/lib/types/services/doc-selection-manager.service.d.ts +56 -0
- package/lib/types/services/doc-state-emit.service.d.ts +27 -0
- package/lib/umd/index.js +1 -5
- package/package.json +10 -9
- package/lib/types/basics/__tests__/plain-text.spec.d.ts +0 -16
- package/lib/types/basics/component-tools.d.ts +0 -17
- package/lib/types/basics/custom-decoration-factory.d.ts +0 -23
- package/lib/types/basics/custom-range-factory.d.ts +0 -23
- package/lib/types/basics/custom-range.d.ts +0 -5
- package/lib/types/basics/docs-view-key.d.ts +0 -30
- package/lib/types/basics/paragraph.d.ts +0 -2
- package/lib/types/basics/plain-text.d.ts +0 -9
- package/lib/types/basics/replace.d.ts +0 -13
- package/lib/types/basics/retain-delete-params.d.ts +0 -6
- package/lib/types/basics/selection.d.ts +0 -22
- package/lib/types/basics/table.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/clipboard.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/core-editing.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/create-command-test-bed.d.ts +0 -34
- package/lib/types/commands/commands/__tests__/inline-format.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/mock-text-selection-render-manager.d.ts +0 -9
- package/lib/types/commands/commands/__tests__/replace-content.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/auto-format.command.d.ts +0 -7
- package/lib/types/commands/commands/break-line.command.d.ts +0 -3
- package/lib/types/commands/commands/clipboard.inner.command.d.ts +0 -16
- package/lib/types/commands/commands/core-editing.command.d.ts +0 -43
- package/lib/types/commands/commands/delete.command.d.ts +0 -19
- package/lib/types/commands/commands/ime-input.command.d.ts +0 -9
- package/lib/types/commands/commands/inline-format.command.d.ts +0 -17
- package/lib/types/commands/commands/list.command.d.ts +0 -42
- package/lib/types/commands/commands/paragraph-align.command.d.ts +0 -18
- package/lib/types/commands/commands/replace-content.command.d.ts +0 -26
- package/lib/types/commands/commands/set-doc-zoom-ratio.command.d.ts +0 -6
- package/lib/types/commands/commands/table/doc-table-create.command.d.ts +0 -10
- package/lib/types/commands/commands/table/doc-table-delete.command.d.ts +0 -10
- package/lib/types/commands/commands/table/doc-table-insert.command.d.ts +0 -34
- package/lib/types/commands/commands/table/doc-table-tab.command.d.ts +0 -5
- package/lib/types/commands/commands/table/table.d.ts +0 -94
- package/lib/types/commands/operations/cursor.operation.d.ts +0 -12
- package/lib/types/commands/operations/select-all.operation.d.ts +0 -5
- package/lib/types/commands/operations/set-doc-zoom-ratio.operation.d.ts +0 -7
- package/lib/types/commands/util.d.ts +0 -9
- package/lib/types/controllers/ime-input.controller.d.ts +0 -25
- package/lib/types/controllers/move-cursor.controller.d.ts +0 -20
- package/lib/types/controllers/normal-input.controller.d.ts +0 -13
- package/lib/types/services/doc-auto-format.service.d.ts +0 -37
- package/lib/types/services/doc-custom-range.service.d.ts +0 -19
- package/lib/types/services/doc-state-change-manager.service.d.ts +0 -34
- package/lib/types/services/ime-input-manager.service.d.ts +0 -28
- package/lib/types/services/text-selection-manager.service.d.ts +0 -55
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { ICustomRange, ITextRange, DataStreamTreeTokenType } from '@univerjs/core';
|
|
2
|
-
export declare function isCustomRangeSplitSymbol(text: string): text is DataStreamTreeTokenType.CUSTOM_RANGE_START | DataStreamTreeTokenType.CUSTOM_RANGE_END;
|
|
3
|
-
export declare function isIntersecting(line1Start: number, line1End: number, line2Start: number, line2End: number): boolean;
|
|
4
|
-
export declare function shouldDeleteCustomRange(deleteStart: number, deleteLen: number, customRange: ICustomRange, dataStream: string): boolean;
|
|
5
|
-
export declare function getCustomRangesInterestsWithRange(range: ITextRange, customRanges: ICustomRange[]): ICustomRange[];
|
|
@@ -1,30 +0,0 @@
|
|
|
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";
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { IDocumentBody, IDocumentData } from '@univerjs/core';
|
|
2
|
-
/**
|
|
3
|
-
* get plain text from rich-text
|
|
4
|
-
*/
|
|
5
|
-
export declare const getPlainTextFormBody: (body: IDocumentBody) => string;
|
|
6
|
-
/**
|
|
7
|
-
* get plain text from rich-text
|
|
8
|
-
*/
|
|
9
|
-
export declare const getPlainTextFormDocument: (data: IDocumentData) => string;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { IAccessor, IDeleteAction, IDocumentBody, IMutationInfo, IRetainAction, ITextRange, ITextRangeParam } from '@univerjs/core';
|
|
2
|
-
import { ITextRangeWithStyle } from '@univerjs/engine-render';
|
|
3
|
-
import { IRichTextEditingMutationParams } from '../commands/mutations/core-editing.mutation';
|
|
4
|
-
export declare function getRetainAndDeleteAndExcludeLineBreak(selection: ITextRange, body: IDocumentBody, segmentId?: string, memoryCursor?: number, preserveLineBreak?: boolean): Array<IRetainAction | IDeleteAction>;
|
|
5
|
-
export interface IReplaceSelectionFactoryParams {
|
|
6
|
-
unitId: string;
|
|
7
|
-
selection?: ITextRangeParam;
|
|
8
|
-
originBody?: IDocumentBody;
|
|
9
|
-
/** Body to be inserted at the given position. */
|
|
10
|
-
body: IDocumentBody;
|
|
11
|
-
textRanges?: ITextRangeWithStyle[];
|
|
12
|
-
}
|
|
13
|
-
export declare function replaceSelectionFactory(accessor: IAccessor, params: IReplaceSelectionFactoryParams): false | IMutationInfo<IRichTextEditingMutationParams>;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { IDeleteAction, IDocumentBody, IRetainAction, ITextRange } from '@univerjs/core';
|
|
2
|
-
export declare function getRetainAndDeleteFromReplace(range: ITextRange, segmentId: string | undefined, memoryCursor: number, body: IDocumentBody): {
|
|
3
|
-
dos: (IRetainAction | IDeleteAction)[];
|
|
4
|
-
cursor: number;
|
|
5
|
-
retain: number;
|
|
6
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { IDocumentBody, ITextRange, Nullable } from '@univerjs/core';
|
|
2
|
-
import { DeleteDirection } from '../types/enums/delete-direction';
|
|
3
|
-
export declare function makeSelection(startOffset: number, endOffset?: number): ITextRange;
|
|
4
|
-
export declare function normalizeSelection(selection: ITextRange): ITextRange;
|
|
5
|
-
export declare function getSelectionWithSymbolMax(selection: ITextRange, body: IDocumentBody): {
|
|
6
|
-
startOffset: number;
|
|
7
|
-
endOffset: number;
|
|
8
|
-
};
|
|
9
|
-
export declare function getSelectionWithNoSymbolSide(selection: ITextRange, body: IDocumentBody): {
|
|
10
|
-
startOffset: number;
|
|
11
|
-
endOffset: number;
|
|
12
|
-
};
|
|
13
|
-
export declare function getDeleteSelection<T extends ITextRange>(selection: T, body: IDocumentBody, direction?: DeleteDirection): T;
|
|
14
|
-
export declare function getInsertSelection<T extends ITextRange>(selection: T, body: IDocumentBody): T;
|
|
15
|
-
/**
|
|
16
|
-
* Ensure custom-range has a correct order,
|
|
17
|
-
* when range contains range, it won't be present as intersect. <br/>
|
|
18
|
-
* For Example `\s1\s2 text \s1\s2` is not allowed, expect `\s1\s2 text \s2\s1`
|
|
19
|
-
*/
|
|
20
|
-
export declare function getSelectionForAddCustomRange(selection: ITextRange, body: IDocumentBody): Nullable<ITextRange>;
|
|
21
|
-
export declare function getSelectionText(dataStream: string, start: number, end: number): string;
|
|
22
|
-
export declare function isSegmentIntersects(start: number, end: number, start2: number, end2: number): boolean;
|
|
@@ -1,16 +0,0 @@
|
|
|
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;
|
|
@@ -1,16 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,16 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { Dependency, DependencyIdentifier, DocumentDataModel, IDocumentData, Nullable, Injector, IUniverInstanceService, RxDisposable, Univer } from '@univerjs/core';
|
|
2
|
-
import { DocumentSkeleton, IRender, IRenderContext, IRenderModule, DocumentViewModel, IRenderManagerService } from '@univerjs/engine-render';
|
|
3
|
-
export declare function createCommandTestBed(workbookData?: IDocumentData, dependencies?: Dependency[]): {
|
|
4
|
-
univer: Univer;
|
|
5
|
-
get: {
|
|
6
|
-
<T>(id: DependencyIdentifier<T>, lookUp?: import('@univerjs/core').LookUp): T;
|
|
7
|
-
<T>(id: DependencyIdentifier<T>, quantity: import("@univerjs/core").Quantity.MANY, lookUp?: import('@univerjs/core').LookUp): T[];
|
|
8
|
-
<T>(id: DependencyIdentifier<T>, quantity: import("@univerjs/core").Quantity.OPTIONAL, lookUp?: import('@univerjs/core').LookUp): T | null;
|
|
9
|
-
<T>(id: DependencyIdentifier<T>, quantity: import("@univerjs/core").Quantity.REQUIRED, lookUp?: import('@univerjs/core').LookUp): T;
|
|
10
|
-
<T>(id: DependencyIdentifier<T>, quantity?: import('@univerjs/core').Quantity, lookUp?: import('@univerjs/core').LookUp): T[] | T | null;
|
|
11
|
-
<T>(id: DependencyIdentifier<T>, quantityOrLookup?: import('@univerjs/core').Quantity | import('@univerjs/core').LookUp, lookUp?: import('@univerjs/core').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
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Nullable } from '@univerjs/core';
|
|
2
|
-
import { ITextSelectionInnerParam } from '@univerjs/engine-render';
|
|
3
|
-
export declare class TextSelectionRenderManager {
|
|
4
|
-
private readonly _textSelectionInner$;
|
|
5
|
-
readonly textSelectionInner$: import('rxjs').Observable<Nullable<ITextSelectionInnerParam>>;
|
|
6
|
-
removeAllRanges(): void;
|
|
7
|
-
addDocRanges(): void;
|
|
8
|
-
}
|
|
9
|
-
export declare const ITextSelectionRenderManager: import('@univerjs/core').IdentifierDecorator<TextSelectionRenderManager>;
|
|
@@ -1,16 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { DocumentDataModel, ICommand, IDocumentBody, IDocumentData, ITextRange, JSONXActions, Nullable } from '@univerjs/core';
|
|
2
|
-
import { DocumentViewModel, ITextRangeWithStyle, RectRange, TextRange } 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<(ITextRange | TextRange)[]>>, rectRanges: Readonly<Nullable<RectRange[]>>, 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>;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { ICommand, IDocumentBody, IDocumentData, ITextRange, UpdateDocsAttributeType } from '@univerjs/core';
|
|
2
|
-
import { ITextRangeWithStyle } from '@univerjs/engine-render';
|
|
3
|
-
import { DeleteDirection } from '../../types/enums/delete-direction';
|
|
4
|
-
export interface IInsertCommandParams {
|
|
5
|
-
unitId: string;
|
|
6
|
-
body: IDocumentBody;
|
|
7
|
-
range: ITextRange;
|
|
8
|
-
segmentId?: string;
|
|
9
|
-
cursorOffset?: number;
|
|
10
|
-
}
|
|
11
|
-
export declare const EditorInsertTextCommandId = "doc.command.insert-text";
|
|
12
|
-
/**
|
|
13
|
-
* The command to insert text. The changed range could be non-collapsed, mainly use in line break and normal input.
|
|
14
|
-
*/
|
|
15
|
-
export declare const InsertCommand: ICommand<IInsertCommandParams>;
|
|
16
|
-
export interface IDeleteCommandParams {
|
|
17
|
-
unitId: string;
|
|
18
|
-
range: ITextRange;
|
|
19
|
-
direction: DeleteDirection;
|
|
20
|
-
len?: number;
|
|
21
|
-
segmentId?: string;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* The command to delete text, mainly used in BACKSPACE and DELETE when collapsed is true. ONLY handle collapsed range!!!
|
|
25
|
-
*/
|
|
26
|
-
export declare const DeleteCommand: ICommand<IDeleteCommandParams>;
|
|
27
|
-
export interface IUpdateCommandParams {
|
|
28
|
-
unitId: string;
|
|
29
|
-
updateBody: IDocumentBody;
|
|
30
|
-
range: ITextRange;
|
|
31
|
-
coverType: UpdateDocsAttributeType;
|
|
32
|
-
textRanges: ITextRangeWithStyle[];
|
|
33
|
-
segmentId?: string;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* The command to update text properties, mainly used in BACKSPACE.
|
|
37
|
-
*/
|
|
38
|
-
export declare const UpdateCommand: ICommand<IUpdateCommandParams>;
|
|
39
|
-
export interface ICoverCommandParams {
|
|
40
|
-
unitId: string;
|
|
41
|
-
snapshot?: IDocumentData;
|
|
42
|
-
clearUndoRedoStack?: boolean;
|
|
43
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ICommand, Nullable } from '@univerjs/core';
|
|
2
|
-
import { IActiveTextRange, RectRange, TextRange } from '@univerjs/engine-render';
|
|
3
|
-
import { DeleteDirection } from '../../types/enums/delete-direction';
|
|
4
|
-
export interface IDeleteCustomBlockParams {
|
|
5
|
-
direction: DeleteDirection;
|
|
6
|
-
range: IActiveTextRange;
|
|
7
|
-
unitId: string;
|
|
8
|
-
drawingId: string;
|
|
9
|
-
}
|
|
10
|
-
export declare const DeleteCustomBlockCommand: ICommand<IDeleteCustomBlockParams>;
|
|
11
|
-
interface IMergeTwoParagraphParams {
|
|
12
|
-
direction: DeleteDirection;
|
|
13
|
-
range: IActiveTextRange;
|
|
14
|
-
}
|
|
15
|
-
export declare const MergeTwoParagraphCommand: ICommand<IMergeTwoParagraphParams>;
|
|
16
|
-
export declare function getCursorWhenDelete(textRanges: Readonly<Nullable<TextRange[]>>, rectRanges: readonly RectRange[]): number;
|
|
17
|
-
export declare const DeleteLeftCommand: ICommand;
|
|
18
|
-
export declare const DeleteRightCommand: ICommand;
|
|
19
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
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>;
|
|
@@ -1,17 +0,0 @@
|
|
|
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>;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { ICommand, IParagraph, IParagraphRange, ISectionBreak, PresetListType } from '@univerjs/core';
|
|
2
|
-
import { IActiveTextRange, IDocRange } 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: IActiveTextRange, paragraphs: IParagraph[]): IParagraph[];
|
|
39
|
-
export declare function getParagraphsRelative(ranges: IDocRange[], paragraphs: IParagraph[]): IParagraph[];
|
|
40
|
-
export declare function getParagraphsInRanges(ranges: IDocRange[], paragraphs: IParagraph[]): IParagraph[];
|
|
41
|
-
export declare function findNearestSectionBreak(currentIndex: number, sectionBreaks: ISectionBreak[]): ISectionBreak | undefined;
|
|
42
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ICommand, HorizontalAlign } 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 {};
|
|
@@ -1,26 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,10 +0,0 @@
|
|
|
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>;
|
|
@@ -1,10 +0,0 @@
|
|
|
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>;
|
|
@@ -1,34 +0,0 @@
|
|
|
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>;
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { IParagraph, ISectionBreak, ITable, ITableCell, ITableColumn, ITableRow, Nullable } from '@univerjs/core';
|
|
2
|
-
import { DocumentViewModel, RectRange, TextRange } from '@univerjs/engine-render';
|
|
3
|
-
import { ITextActiveRange } from '../../../services/text-selection-manager.service';
|
|
4
|
-
export declare enum INSERT_ROW_POSITION {
|
|
5
|
-
ABOVE = 0,
|
|
6
|
-
BELLOW = 1
|
|
7
|
-
}
|
|
8
|
-
export declare enum INSERT_COLUMN_POSITION {
|
|
9
|
-
LEFT = 0,
|
|
10
|
-
RIGHT = 1
|
|
11
|
-
}
|
|
12
|
-
export declare function genEmptyTable(rowCount: number, colCount: number): {
|
|
13
|
-
dataStream: string;
|
|
14
|
-
paragraphs: IParagraph[];
|
|
15
|
-
sectionBreaks: ISectionBreak[];
|
|
16
|
-
};
|
|
17
|
-
export declare function getEmptyTableCell(): ITableCell;
|
|
18
|
-
export declare function getEmptyTableRow(col: number): ITableRow;
|
|
19
|
-
export declare function getTableColumn(width: number): ITableColumn;
|
|
20
|
-
export declare function genTableSource(rowCount: number, colCount: number, pageContentWidth: number): ITable;
|
|
21
|
-
interface IRangeInfo {
|
|
22
|
-
startOffset: number;
|
|
23
|
-
endOffset: number;
|
|
24
|
-
segmentId: string;
|
|
25
|
-
}
|
|
26
|
-
export declare function getRangeInfoFromRanges(textRange: Nullable<TextRange>, rectRanges: Readonly<Nullable<RectRange[]>>): Nullable<IRangeInfo>;
|
|
27
|
-
export declare function getInsertRowBody(col: number): {
|
|
28
|
-
dataStream: string;
|
|
29
|
-
paragraphs: IParagraph[];
|
|
30
|
-
sectionBreaks: ISectionBreak[];
|
|
31
|
-
};
|
|
32
|
-
export declare function getInsertColumnBody(): {
|
|
33
|
-
dataStream: string;
|
|
34
|
-
paragraphs: IParagraph[];
|
|
35
|
-
sectionBreaks: ISectionBreak[];
|
|
36
|
-
};
|
|
37
|
-
export declare function getInsertRowActionsParams(rangeInfo: IRangeInfo, position: INSERT_ROW_POSITION, viewModel: DocumentViewModel): {
|
|
38
|
-
offset: number;
|
|
39
|
-
colCount: number;
|
|
40
|
-
tableId: string;
|
|
41
|
-
insertRowIndex: number;
|
|
42
|
-
} | null;
|
|
43
|
-
export declare function getInsertColumnActionsParams(rangeInfo: IRangeInfo, position: INSERT_COLUMN_POSITION, viewModel: DocumentViewModel): {
|
|
44
|
-
offsets: number[];
|
|
45
|
-
tableId: string;
|
|
46
|
-
columnIndex: number;
|
|
47
|
-
rowCount: number;
|
|
48
|
-
} | null;
|
|
49
|
-
export declare function getColumnWidths(pageWidth: number, tableColumns: ITableColumn[], insertColumnIndex: number): {
|
|
50
|
-
widths: number[];
|
|
51
|
-
newColWidth: number;
|
|
52
|
-
};
|
|
53
|
-
export declare function getDeleteRowsActionsParams(rangeInfo: IRangeInfo, viewModel: DocumentViewModel): {
|
|
54
|
-
tableId: string;
|
|
55
|
-
rowIndexes: number[];
|
|
56
|
-
offset: number;
|
|
57
|
-
len: number;
|
|
58
|
-
cursor: number;
|
|
59
|
-
selectWholeTable: boolean;
|
|
60
|
-
} | null;
|
|
61
|
-
interface IRetainDeleteOffset {
|
|
62
|
-
retain: number;
|
|
63
|
-
delete: number;
|
|
64
|
-
}
|
|
65
|
-
export declare function getDeleteColumnsActionParams(rangeInfo: IRangeInfo, viewModel: DocumentViewModel): {
|
|
66
|
-
offsets: IRetainDeleteOffset[];
|
|
67
|
-
tableId: string;
|
|
68
|
-
columnIndexes: number[];
|
|
69
|
-
cursor: number;
|
|
70
|
-
selectWholeTable: boolean;
|
|
71
|
-
rowCount: number;
|
|
72
|
-
} | null;
|
|
73
|
-
export declare function getDeleteTableActionParams(rangeInfo: IRangeInfo, viewModel: DocumentViewModel): {
|
|
74
|
-
tableId: string;
|
|
75
|
-
offset: number;
|
|
76
|
-
len: number;
|
|
77
|
-
cursor: number;
|
|
78
|
-
} | null;
|
|
79
|
-
export declare function getDeleteRowContentActionParams(rangeInfo: IRangeInfo, viewModel: DocumentViewModel): {
|
|
80
|
-
offsets: IRetainDeleteOffset[];
|
|
81
|
-
tableId: string;
|
|
82
|
-
cursor: number;
|
|
83
|
-
rowCount: number;
|
|
84
|
-
} | null;
|
|
85
|
-
export interface IOffsets {
|
|
86
|
-
startOffset: number;
|
|
87
|
-
endOffset: number;
|
|
88
|
-
}
|
|
89
|
-
export declare enum CellPosition {
|
|
90
|
-
NEXT = 0,
|
|
91
|
-
PREV = 1
|
|
92
|
-
}
|
|
93
|
-
export declare function getCellOffsets(viewModel: DocumentViewModel, range: ITextActiveRange, position: CellPosition): Nullable<IOffsets>;
|
|
94
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Direction, IOperation } from '@univerjs/core';
|
|
2
|
-
export interface IMoveCursorOperationParams {
|
|
3
|
-
direction: Direction;
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* The operation to move cursor in the current document.
|
|
7
|
-
*/
|
|
8
|
-
export declare const MoveCursorOperation: IOperation<IMoveCursorOperationParams>;
|
|
9
|
-
/**
|
|
10
|
-
* The operation to move selection in the current document.
|
|
11
|
-
*/
|
|
12
|
-
export declare const MoveSelectionOperation: IOperation<IMoveCursorOperationParams>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { IAccessor, IOperation } from '@univerjs/core';
|
|
2
|
-
export interface ISetDocZoomRatioOperationParams {
|
|
3
|
-
zoomRatio: number;
|
|
4
|
-
unitId: string;
|
|
5
|
-
}
|
|
6
|
-
export declare const SetDocZoomRatioUndoMutationFactory: (accessor: IAccessor, params: ISetDocZoomRatioOperationParams) => ISetDocZoomRatioOperationParams;
|
|
7
|
-
export declare const SetDocZoomRatioOperation: IOperation<ISetDocZoomRatioOperationParams>;
|