@univerjs/docs-ui 1.0.0 → 1.0.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@univerjs/docs-ui",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "private": false,
5
5
  "description": "Editor UI layer for Univer Docs.",
6
6
  "author": "DreamNum Co., Ltd. <developer@univer.ai>",
@@ -68,18 +68,18 @@
68
68
  "rxjs": ">=7.0.0"
69
69
  },
70
70
  "dependencies": {
71
- "@univerjs/core": "1.0.0",
72
- "@univerjs/design": "1.0.0",
73
- "@univerjs/docs": "1.0.0",
74
- "@univerjs/drawing": "1.0.0",
75
- "@univerjs/engine-render": "1.0.0",
76
- "@univerjs/icons": "1.43.0",
77
- "@univerjs/protocol": "1.0.0",
78
- "@univerjs/ui": "1.0.0"
71
+ "@univerjs/core": "1.0.2",
72
+ "@univerjs/design": "1.0.2",
73
+ "@univerjs/docs": "1.0.2",
74
+ "@univerjs/drawing": "1.0.2",
75
+ "@univerjs/engine-render": "1.0.2",
76
+ "@univerjs/icons": "1.43.1",
77
+ "@univerjs/protocol": "1.0.2",
78
+ "@univerjs/ui": "1.0.2"
79
79
  },
80
80
  "devDependencies": {
81
- "@univerjs-infra/shared": "1.0.0",
82
- "@univerjs/docs-drawing": "1.0.0",
81
+ "@univerjs-infra/shared": "1.0.2",
82
+ "@univerjs/docs-drawing": "1.0.2",
83
83
  "jest-canvas-mock": "^2.5.2",
84
84
  "jsdom": "^29.1.1",
85
85
  "postcss": "^8.5.28",
@@ -1,18 +0,0 @@
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 { IDocDrawingPosition, ITransformState, Nullable } from '@univerjs/core';
17
- export declare function docDrawingPositionToTransform(position: IDocDrawingPosition): Nullable<ITransformState>;
18
- export declare function transformToDocDrawingPosition(transform: ITransformState, marginLeft?: number, marginTop?: number): Nullable<IDocDrawingPosition>;
@@ -1,58 +0,0 @@
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 { ICommand, IDocumentBody, IDocumentData, ITextRange, UpdateDocsAttributeType } from '@univerjs/core';
17
- import type { ITextRangeWithStyle } from '@univerjs/engine-render';
18
- import { DeleteDirection } from '../../types/delete-direction';
19
- export interface IInsertCommandParams {
20
- unitId: string;
21
- body: IDocumentBody;
22
- range: ITextRange;
23
- segmentId?: string;
24
- cursorOffset?: number;
25
- }
26
- export declare const EditorInsertTextCommandId = "doc.command.insert-text";
27
- /**
28
- * The command to insert text. The changed range could be non-collapsed, mainly use in line break and normal input.
29
- */
30
- export declare const InsertCommand: ICommand<IInsertCommandParams>;
31
- export interface IDeleteCommandParams {
32
- unitId: string;
33
- range: ITextRange;
34
- direction: DeleteDirection;
35
- len?: number;
36
- segmentId?: string;
37
- }
38
- /**
39
- * The command to delete text, mainly used in BACKSPACE and DELETE when collapsed is true. ONLY handle collapsed range!!!
40
- */
41
- export declare const DeleteCommand: ICommand<IDeleteCommandParams>;
42
- export interface IUpdateCommandParams {
43
- unitId: string;
44
- updateBody: IDocumentBody;
45
- range: ITextRange;
46
- coverType: UpdateDocsAttributeType;
47
- textRanges: ITextRangeWithStyle[];
48
- segmentId?: string;
49
- }
50
- /**
51
- * The command to update text properties, mainly used in BACKSPACE.
52
- */
53
- export declare const UpdateCommand: ICommand<IUpdateCommandParams>;
54
- export interface ICoverCommandParams {
55
- unitId: string;
56
- snapshot?: IDocumentData;
57
- clearUndoRedoStack?: boolean;
58
- }
@@ -1,16 +0,0 @@
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 COMPONENT_PREFIX = "UI_PLUGIN_DOCS";
@@ -1,22 +0,0 @@
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 } from '@univerjs/core';
17
- /**
18
- *
19
- * @param value The initial value of the editor.
20
- * @returns snapshot generated by value.
21
- */
22
- export declare function genSnapShotByValue(id?: string, value?: string): IDocumentData;
@@ -1,20 +0,0 @@
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
- interface IFloatToolbarProps {
17
- avaliableMenus?: string[];
18
- }
19
- export declare function FloatToolbar(props: IFloatToolbarProps): import("react/jsx-runtime").JSX.Element;
20
- export {};
@@ -1,22 +0,0 @@
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 { Meta } from '@storybook/react';
17
- import { FloatToolbar } from './FloatToolbar';
18
- declare const meta: Meta<typeof FloatToolbar>;
19
- export default meta;
20
- export declare const Playground: {
21
- render(): import("react/jsx-runtime").JSX.Element;
22
- };
@@ -1,30 +0,0 @@
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 { PresetListType } from '@univerjs/core';
17
- export interface IListTypePickerBaseProps {
18
- value?: PresetListType;
19
- onChange: (value: PresetListType | undefined) => void;
20
- }
21
- interface IListTypePickerProps extends IListTypePickerBaseProps {
22
- options: {
23
- value: PresetListType;
24
- img: string;
25
- }[];
26
- }
27
- export declare const ListTypePicker: (props: IListTypePickerProps) => import("react/jsx-runtime").JSX.Element;
28
- export declare const OrderListTypePicker: (props: IListTypePickerBaseProps) => import("react/jsx-runtime").JSX.Element;
29
- export declare const BulletListTypePicker: (props: IListTypePickerBaseProps) => import("react/jsx-runtime").JSX.Element;
30
- export {};
@@ -1,18 +0,0 @@
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 { BulletListTypePicker, OrderListTypePicker } from './Picker';
17
- export declare const ORDER_LIST_TYPE_COMPONENT = "UI_PLUGIN_DOCS_ORDER_LIST_TYPE_COMPONENT";
18
- export declare const BULLET_LIST_TYPE_COMPONENT = "UI_PLUGIN_DOCS_BULLET_LIST_TYPE_COMPONENT";
@@ -1,41 +0,0 @@
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 { ITextRangeWithStyle } from '@univerjs/engine-render';
17
- import type { IPopup, IValueOption } from '@univerjs/ui';
18
- import type { IMutiPageParagraphBound } from '../../services/doc-event-manager.service';
19
- import type { IDocBlockMenuTarget } from '../../services/doc-paragraph-menu.service';
20
- import { NamedStyleType } from '@univerjs/core';
21
- export declare function getParagraphMenuIconSizeClass(iconKey: string): string;
22
- export declare function getParagraphMenuPopupDirection(anchorLeft: number, menuWidth?: number, viewportPadding?: number): 'left' | 'right';
23
- export declare const PARAGRAPH_MENU_HOVER_OPEN_DELAY = 260;
24
- export declare function createParagraphMenuHoverOpenScheduler(openMenu: () => void, delay?: number): {
25
- schedule(): void;
26
- cancel: () => void;
27
- openNow(): void;
28
- };
29
- export declare function isEmptyParagraphMenuTarget(dataStream: string, paragraph?: IMutiPageParagraphBound | null | void): boolean;
30
- export declare function getParagraphMenuTargetRange(paragraph?: IMutiPageParagraphBound | null | void): ITextRangeWithStyle | null;
31
- export declare function getParagraphMenuActiveHeadingCommandId(namedStyleType?: NamedStyleType): string;
32
- export declare function getParagraphMenuHiddenHeadingCommandIds(namedStyleType?: NamedStyleType): string[];
33
- export declare function getParagraphMenuCommand(params: IValueOption, targetRange?: ITextRangeWithStyle | null): {
34
- commandId?: string;
35
- params?: object;
36
- };
37
- export declare function shouldShowParagraphSettingMenu(target: IDocBlockMenuTarget | null | undefined): boolean;
38
- export declare const ParagraphMenu: ({ popup }: {
39
- popup: IPopup;
40
- }) => import("react/jsx-runtime").JSX.Element;
41
- export declare function shouldUseInsertBelowRange(commandId: string, params: IValueOption): boolean;
@@ -1,31 +0,0 @@
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 { Meta } from '@storybook/react';
17
- import { SideMenu } from './index';
18
- declare const meta: Meta<typeof SideMenu>;
19
- export default meta;
20
- export declare const SideMenuBasic: {
21
- render(): import("react/jsx-runtime").JSX.Element;
22
- };
23
- export declare const EmptySideMenu: {
24
- render(): import("react/jsx-runtime").JSX.Element;
25
- };
26
- export declare const CustomStyledSideMenu: {
27
- render(): import("react/jsx-runtime").JSX.Element;
28
- };
29
- export declare const MultiLevelSideMenu: {
30
- render(): import("react/jsx-runtime").JSX.Element;
31
- };
@@ -1,41 +0,0 @@
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 interface ISideMenuItem {
17
- text: string;
18
- level: number;
19
- id: string;
20
- isTitle?: boolean;
21
- }
22
- export interface ISideMenuProps {
23
- menus?: ISideMenuItem[];
24
- onClick?: (menu: ISideMenuItem) => void;
25
- className?: string;
26
- style?: React.CSSProperties;
27
- mode?: 'float' | 'side-bar';
28
- maxHeight: number;
29
- activeId?: string;
30
- open?: boolean;
31
- onOpenChange?: (open: boolean) => void;
32
- maxWidth?: number;
33
- wrapperClass?: string;
34
- wrapperStyle?: React.CSSProperties;
35
- iconClass?: string;
36
- iconStyle?: React.CSSProperties;
37
- }
38
- export interface ISideMenuInstance {
39
- scrollTo: (id: string) => void;
40
- }
41
- export declare const SideMenu: import("react").ForwardRefExoticComponent<ISideMenuProps & import("react").RefAttributes<ISideMenuInstance>>;
@@ -1,36 +0,0 @@
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 { Disposable, ICommandService, IConfigService, Injector, IUniverInstanceService } from '@univerjs/core';
17
- import { ComponentManager, ILayoutService, IMenuManagerService, IShortcutService, IUIPartsService } from '@univerjs/ui';
18
- export declare class DocUIController extends Disposable {
19
- protected readonly _injector: Injector;
20
- protected readonly _componentManager: ComponentManager;
21
- protected readonly _commandService: ICommandService;
22
- protected readonly _layoutService: ILayoutService;
23
- protected readonly _menuManagerService: IMenuManagerService;
24
- protected readonly _uiPartsService: IUIPartsService;
25
- protected readonly _univerInstanceService: IUniverInstanceService;
26
- protected readonly _shortcutService: IShortcutService;
27
- protected readonly _configService: IConfigService;
28
- constructor(_injector: Injector, _componentManager: ComponentManager, _commandService: ICommandService, _layoutService: ILayoutService, _menuManagerService: IMenuManagerService, _uiPartsService: IUIPartsService, _univerInstanceService: IUniverInstanceService, _shortcutService: IShortcutService, _configService: IConfigService);
29
- private _initCustomComponents;
30
- private _initUiParts;
31
- private _initMenus;
32
- private _initShortCut;
33
- private _init;
34
- private _initCommands;
35
- private _initFocusHandler;
36
- }
@@ -1,52 +0,0 @@
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 } from '@univerjs/core';
17
- import { FUniver } from '@univerjs/core/facade';
18
- import { FDocument } from './f-document';
19
- /**
20
- * @ignore
21
- */
22
- export interface IFUniverDocsUIMixin {
23
- /**
24
- * Create a new document and get the API handler of that document.
25
- *
26
- * @param {Partial<IDocumentData>} data The snapshot of the document.
27
- * @returns {FDocument} FDocument API instance.
28
- */
29
- createUniverDoc(data: Partial<IDocumentData>): FDocument;
30
- /**
31
- * Get the document API handler by the document id.
32
- *
33
- * @param {string} id The document id.
34
- * @returns {FDocument | null} The document API instance.
35
- */
36
- getUniverDoc(id: string): FDocument | null;
37
- /**
38
- * Get the currently focused Univer document.
39
- *
40
- * @returns {FDocument | null} The currently focused Univer document.
41
- */
42
- getActiveDocument(): FDocument | null;
43
- }
44
- export declare class FUniverDocsUIMixin extends FUniver implements IFUniverDocsUIMixin {
45
- createUniverDoc(data: Partial<IDocumentData>): FDocument;
46
- getActiveDocument(): FDocument | null;
47
- getUniverDoc(id: string): FDocument | null;
48
- }
49
- declare module '@univerjs/core/facade' {
50
- interface FUniver extends IFUniverDocsUIMixin {
51
- }
52
- }
@@ -1,28 +0,0 @@
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 { Disposable } from '@univerjs/core';
17
- export interface IDocContentInsertRange {
18
- unitId: string;
19
- startOffset: number;
20
- endOffset: number;
21
- segmentId?: string;
22
- }
23
- export declare class DocContentInsertService extends Disposable {
24
- private _range;
25
- setInsertRange(range: IDocContentInsertRange): void;
26
- consumeInsertRange(unitId?: string): IDocContentInsertRange | null;
27
- clearInsertRange(): void;
28
- }
@@ -1,50 +0,0 @@
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 { Nullable } from '@univerjs/core';
17
- import type { IDocStateChangeParams } from '@univerjs/docs';
18
- import { ICommandService, IUndoRedoService, IUniverInstanceService, RxDisposable } from '@univerjs/core';
19
- import { DocStateEmitService } from '@univerjs/docs';
20
- import { IRenderManagerService } from '@univerjs/engine-render';
21
- interface IStateCache {
22
- history: IDocStateChangeParams[];
23
- collaboration: IDocStateChangeParams[];
24
- }
25
- export declare class DocStateChangeManagerService extends RxDisposable {
26
- private _undoRedoService;
27
- private readonly _commandService;
28
- private readonly _univerInstanceService;
29
- private readonly _docStateEmitService;
30
- private readonly _renderManagerService;
31
- private readonly _docStateChange$;
32
- readonly docStateChange$: import("rxjs").Observable<Nullable<IDocStateChangeParams>>;
33
- private _historyStateCache;
34
- private _changeStateCache;
35
- private _historyTimer;
36
- private _changeStateCacheTimer;
37
- constructor(_undoRedoService: IUndoRedoService, _commandService: ICommandService, _univerInstanceService: IUniverInstanceService, _docStateEmitService: DocStateEmitService, _renderManagerService: IRenderManagerService);
38
- getStateCache(unitId: string): {
39
- history: IDocStateChangeParams[];
40
- collaboration: IDocStateChangeParams[];
41
- };
42
- setStateCache(unitId: string, cache: IStateCache): void;
43
- private _setChangeState;
44
- private _initialize;
45
- private _listenDocStateChange;
46
- private _cacheChangeState;
47
- private _pushHistory;
48
- private _emitChangeState;
49
- }
50
- export {};
@@ -1,19 +0,0 @@
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 enum DeleteDirection {
17
- LEFT = 0,
18
- RIGHT = 1
19
- }
@@ -1,39 +0,0 @@
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 { IConfirmChildrenProps } from '@univerjs/ui';
17
- import { DocumentFlavor, ModernDocumentWidthMode, PageOrientType } from '@univerjs/core';
18
- export interface IPageSettingsProps {
19
- onClose: () => void;
20
- onConfirm: (settings: IPageSettings) => void;
21
- }
22
- export interface IPageSettings {
23
- mode: DocumentFlavor.TRADITIONAL | DocumentFlavor.MODERN;
24
- modernWidth: ModernDocumentWidthMode;
25
- paperSize: string;
26
- orientation: PageOrientType;
27
- margins: {
28
- top: number;
29
- bottom: number;
30
- left: number;
31
- right: number;
32
- };
33
- pageSize: {
34
- width: number;
35
- height: number;
36
- };
37
- }
38
- export declare function PageSettings(props: IConfirmChildrenProps): import("react/jsx-runtime").JSX.Element;
39
- export declare const PAGE_SETTING_COMPONENT_ID = "docs.component.page-setting";
@@ -1,40 +0,0 @@
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 } from '@univerjs/core';
17
- import type { CSSProperties, ReactNode, RefObject } from 'react';
18
- import type { Editor } from '../../services/editor/editor';
19
- import type { IKeyboardEventConfig } from './hooks';
20
- export interface IRichTextEditorProps {
21
- className?: string;
22
- autoFocus?: boolean;
23
- onFocusChange?: (isFocus: boolean, newValue?: string) => void;
24
- initialValue?: IDocumentData | string;
25
- onClickOutside?: () => void;
26
- keyboardEventConfig?: IKeyboardEventConfig;
27
- moveCursor?: boolean;
28
- style?: CSSProperties;
29
- isSingle?: boolean;
30
- placeholder?: string;
31
- editorId?: string;
32
- onHeightChange?: (height: number) => void;
33
- onChange?: (data: IDocumentData, str: string) => void;
34
- maxHeight?: number;
35
- defaultHeight?: number;
36
- icon?: ReactNode;
37
- editorRef?: RefObject<Editor | null> | ((editor: Editor | null) => void);
38
- noStyle?: boolean;
39
- }
40
- export declare const RichTextEditor: (props: IRichTextEditorProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,16 +0,0 @@
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 DocSideMenu(): import("react/jsx-runtime").JSX.Element | null;