@univerjs/docs-ui 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 +28 -6
- package/lib/es/index.js +9750 -4046
- package/lib/index.css +1 -1
- package/lib/locale/en-US.json +3 -1
- package/lib/locale/ru-RU.json +3 -1
- package/lib/locale/vi-VN.json +3 -1
- package/lib/locale/zh-CN.json +3 -1
- package/lib/locale/zh-TW.json +3 -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/default-univer-doc-config.d.ts +0 -34
- 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/interfaces/component-config/i-doc-ui-plugin-config.d.ts +15 -8
- 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/doc-paragraph-setting.command.d.ts +4 -1
- 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 +2 -19
- package/lib/types/controllers/config.schema.d.ts +12 -0
- package/lib/types/controllers/doc-auto-format.controller.d.ts +1 -1
- package/lib/types/controllers/doc-container-ui-controller.d.ts +5 -5
- 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/doc-paragraph-setting.controller.d.ts +2 -0
- package/lib/types/controllers/doc-ui.controller.d.ts +5 -6
- package/lib/types/controllers/menu/context-menu.d.ts +2 -0
- package/lib/types/controllers/menu/menu.d.ts +1 -1
- package/lib/types/controllers/menu.schema.d.ts +2 -0
- 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 +4 -3
- package/lib/types/index.d.ts +62 -10
- package/lib/types/locale/zh-CN.d.ts +2 -0
- package/lib/types/services/clipboard/clipboard.service.d.ts +5 -6
- package/lib/types/services/clipboard/html-to-udm/converter.d.ts +2 -0
- 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 +13 -5
- 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/doc-container/DocContainer.d.ts +1 -1
- package/lib/types/views/paragraph-setting/hook/utils.d.ts +6 -2
- package/lib/umd/index.js +28 -6
- package/package.json +17 -17
- package/lib/types/controllers/clipboard.controller.d.ts +0 -14
- package/lib/types/controllers/doc-editor-bridge.controller.d.ts +0 -23
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { DOC_RANGE_TYPE, RANGE_DIRECTION, Nullable } from '@univerjs/core';
|
|
2
|
+
import { Rect, Documents, DocumentSkeleton, INodePosition, IPoint, ISuccinctDocRangeParam, ITextSelectionStyle, Scene, ThinScene } from '@univerjs/engine-render';
|
|
3
|
+
import { IDocRange } from './range-interface';
|
|
4
|
+
export declare const TEXT_RANGE_LAYER_INDEX = 3;
|
|
5
|
+
export declare function cursorConvertToTextRange(scene: Scene, range: ISuccinctDocRangeParam, docSkeleton: DocumentSkeleton, document: Documents): Nullable<TextRange>;
|
|
6
|
+
export declare function getAnchorBounding(pointsGroup: IPoint[][]): {
|
|
7
|
+
left: number;
|
|
8
|
+
top: number;
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
};
|
|
12
|
+
export declare function getLineBounding(pointsGroup: IPoint[][]): {
|
|
13
|
+
left: number;
|
|
14
|
+
right: number;
|
|
15
|
+
top: number;
|
|
16
|
+
bottom: number;
|
|
17
|
+
}[];
|
|
18
|
+
export declare class TextRange implements IDocRange {
|
|
19
|
+
private _scene;
|
|
20
|
+
private _document;
|
|
21
|
+
private _docSkeleton;
|
|
22
|
+
anchorNodePosition?: Nullable<INodePosition>;
|
|
23
|
+
focusNodePosition?: Nullable<INodePosition>;
|
|
24
|
+
style: ITextSelectionStyle;
|
|
25
|
+
private _segmentId;
|
|
26
|
+
private _segmentPage;
|
|
27
|
+
rangeType: DOC_RANGE_TYPE;
|
|
28
|
+
private _current;
|
|
29
|
+
private _rangeShape;
|
|
30
|
+
private _anchorShape;
|
|
31
|
+
private _cursorList;
|
|
32
|
+
private _anchorBlinkTimer;
|
|
33
|
+
constructor(_scene: ThinScene, _document: Documents, _docSkeleton: DocumentSkeleton, anchorNodePosition?: Nullable<INodePosition>, focusNodePosition?: Nullable<INodePosition>, style?: ITextSelectionStyle, _segmentId?: string, _segmentPage?: number);
|
|
34
|
+
private _anchorBlink;
|
|
35
|
+
get startOffset(): number | undefined;
|
|
36
|
+
get endOffset(): number | undefined;
|
|
37
|
+
get collapsed(): boolean;
|
|
38
|
+
get startNodePosition(): INodePosition | null;
|
|
39
|
+
get endNodePosition(): Nullable<INodePosition>;
|
|
40
|
+
get direction(): RANGE_DIRECTION;
|
|
41
|
+
get segmentId(): string;
|
|
42
|
+
get segmentPage(): number;
|
|
43
|
+
getAbsolutePosition(): {
|
|
44
|
+
left: number;
|
|
45
|
+
top: number;
|
|
46
|
+
width: number;
|
|
47
|
+
height: number;
|
|
48
|
+
} | undefined;
|
|
49
|
+
getAnchor(): Nullable<Rect<import('@univerjs/engine-render').IRectProps>>;
|
|
50
|
+
activeStatic(): void;
|
|
51
|
+
deactivateStatic(): void;
|
|
52
|
+
isActive(): boolean;
|
|
53
|
+
activate(): void;
|
|
54
|
+
deactivate(): void;
|
|
55
|
+
dispose(): void;
|
|
56
|
+
isIntersection(compareRange: TextRange): boolean;
|
|
57
|
+
refresh(): void;
|
|
58
|
+
private _isEmpty;
|
|
59
|
+
private _isCollapsed;
|
|
60
|
+
private _createOrUpdateRange;
|
|
61
|
+
private _createOrUpdateAnchor;
|
|
62
|
+
private _setCursorList;
|
|
63
|
+
}
|
|
@@ -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 declare const DOC_VERTICAL_PADDING = 4;
|
|
@@ -0,0 +1,19 @@
|
|
|
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 DeleteDirection {
|
|
17
|
+
LEFT = 0,
|
|
18
|
+
RIGHT = 1
|
|
19
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React, Component } from 'react';
|
|
2
|
-
import { IUniverDocsUIConfig } from '../../
|
|
2
|
+
import { IUniverDocsUIConfig } from '../../controllers/config.schema';
|
|
3
3
|
interface IBaseDocContainerProps {
|
|
4
4
|
config: IUniverDocsUIConfig;
|
|
5
5
|
changeLocale: (locale: string) => void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { IParagraph } from '@univerjs/core';
|
|
1
|
+
import { SpacingRule, IParagraph, ISectionBreak } from '@univerjs/core';
|
|
2
2
|
export declare const useCurrentParagraph: () => IParagraph[];
|
|
3
|
+
export declare const useCurrentSections: (currentParagraphs: IParagraph[]) => ISectionBreak[];
|
|
3
4
|
export declare const useFirstParagraphHorizontalAlign: (paragraph: IParagraph[], defaultValue: string) => readonly [string, (v: string) => Promise<boolean>];
|
|
4
5
|
export declare const useFirstParagraphIndentStart: (paragraph: IParagraph[]) => readonly [number, (v: number) => Promise<boolean>];
|
|
5
6
|
export declare const useFirstParagraphIndentEnd: (paragraph: IParagraph[]) => readonly [number, (v: number) => Promise<boolean>];
|
|
@@ -7,4 +8,7 @@ export declare const useFirstParagraphIndentFirstLine: (paragraph: IParagraph[])
|
|
|
7
8
|
export declare const useFirstParagraphIndentHanging: (paragraph: IParagraph[]) => readonly [number, (v: number) => Promise<boolean>];
|
|
8
9
|
export declare const useFirstParagraphIndentSpaceAbove: (paragraph: IParagraph[]) => readonly [number, (v: number) => Promise<boolean>];
|
|
9
10
|
export declare const useFirstParagraphSpaceBelow: (paragraph: IParagraph[]) => readonly [number, (v: number) => Promise<boolean>];
|
|
10
|
-
export declare const useFirstParagraphLineSpacing: (paragraph: IParagraph[]) =>
|
|
11
|
+
export declare const useFirstParagraphLineSpacing: (paragraph: IParagraph[]) => {
|
|
12
|
+
lineSpacing: readonly [number, (v: number) => Promise<void>];
|
|
13
|
+
spacingRule: readonly [SpacingRule, (v: SpacingRule) => Promise<void>];
|
|
14
|
+
};
|