@univerjs/docs 0.1.0-beta.4 → 0.1.1

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.
Files changed (36) hide show
  1. package/lib/cjs/index.js +1 -2
  2. package/lib/es/index.js +1167 -2121
  3. package/lib/types/commands/commands/ime-input.command.d.ts +2 -5
  4. package/lib/types/commands/commands/list.command.d.ts +4 -4
  5. package/lib/types/commands/mutations/core-editing.mutation.d.ts +10 -4
  6. package/lib/types/commands/operations/text-selection.operation.d.ts +3 -2
  7. package/lib/types/controllers/ime-input.controller.d.ts +3 -5
  8. package/lib/types/controllers/text-selection.controller.d.ts +3 -9
  9. package/lib/types/index.d.ts +8 -4
  10. package/lib/types/services/doc-skeleton-manager.service.d.ts +6 -3
  11. package/lib/types/services/doc-state-change-manager.service.d.ts +45 -0
  12. package/lib/types/services/doc-view-model-manager.service.d.ts +3 -2
  13. package/lib/types/services/ime-input-manager.service.d.ts +11 -0
  14. package/lib/types/services/text-selection-manager.service.d.ts +4 -3
  15. package/lib/umd/index.js +1 -2
  16. package/package.json +24 -15
  17. package/lib/types/commands/commands/clipboard.command.d.ts +0 -20
  18. package/lib/types/controllers/clipboard.controller.d.ts +0 -29
  19. package/lib/types/controllers/doc-render.controller.d.ts +0 -27
  20. package/lib/types/controllers/floating-object.controller.d.ts +0 -33
  21. package/lib/types/controllers/page-render.controller.d.ts +0 -25
  22. package/lib/types/controllers/zoom.controller.d.ts +0 -36
  23. package/lib/types/services/clipboard/__test__/html-and-udm-convert.spec.d.ts +0 -16
  24. package/lib/types/services/clipboard/clipboard.service.d.ts +0 -55
  25. package/lib/types/services/clipboard/copy-content-cache.d.ts +0 -25
  26. package/lib/types/services/clipboard/html-to-udm/converter.d.ts +0 -30
  27. package/lib/types/services/clipboard/html-to-udm/parse-node-style.d.ts +0 -17
  28. package/lib/types/services/clipboard/html-to-udm/parse-to-dom.d.ts +0 -16
  29. package/lib/types/services/clipboard/html-to-udm/paste-plugins/plugin-lark.d.ts +0 -18
  30. package/lib/types/services/clipboard/html-to-udm/paste-plugins/plugin-word.d.ts +0 -18
  31. package/lib/types/services/clipboard/html-to-udm/paste-plugins/type.d.ts +0 -30
  32. package/lib/types/services/clipboard/html-to-udm/utils.d.ts +0 -18
  33. package/lib/types/services/clipboard/udm-to-html/convertor.d.ts +0 -19
  34. package/lib/types/shortcuts/core-editing.shortcut.d.ts +0 -19
  35. package/lib/types/shortcuts/cursor.shortcut.d.ts +0 -25
  36. package/lib/types/views/doc-canvas-view.d.ts +0 -34
@@ -1,25 +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
- import type { IDocumentBody } from '@univerjs/core';
17
- export declare function genId(): string;
18
- export declare function extractId(html: string): string | null;
19
- export declare class CopyContentCache {
20
- private _cache;
21
- set(id: string, clipboardData: IDocumentBody): void;
22
- get(id: string): IDocumentBody | undefined;
23
- clear(): void;
24
- }
25
- export declare const copyContentCache: CopyContentCache;
@@ -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
- import type { IDocumentBody } from '@univerjs/core';
17
- import type { IPastePlugin } from './paste-plugins/type';
18
- /**
19
- * Convert html strings into data structures in univer, IDocumentBody.
20
- * Support plug-in, add custom rules,
21
- */
22
- export declare class HtmlToUDMService {
23
- private static _pluginList;
24
- static use(plugin: IPastePlugin): void;
25
- private _styleCache;
26
- private _styleRules;
27
- private _afterProcessRules;
28
- convert(html: string): IDocumentBody;
29
- private _process;
30
- }
@@ -1,17 +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
- import type { ITextStyle } from '@univerjs/core';
17
- export declare function extractNodeStyle(node: HTMLElement): ITextStyle;
@@ -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 default function parseToDom(rawHtml: string): Element | null;
@@ -1,18 +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
- import type { IPastePlugin } from './type';
17
- declare const wordPastePlugin: IPastePlugin;
18
- export default wordPastePlugin;
@@ -1,18 +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
- import type { IPastePlugin } from './type';
17
- declare const wordPastePlugin: IPastePlugin;
18
- export default wordPastePlugin;
@@ -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
- import type { IDocumentBody, ITextStyle } from '@univerjs/core';
17
- export interface IStyleRule {
18
- filter: string | string[] | ((node: HTMLElement) => boolean);
19
- getStyle(node: HTMLElement): ITextStyle;
20
- }
21
- export interface IAfterProcessRule {
22
- filter: string | string[] | ((node: HTMLElement) => boolean);
23
- handler(doc: IDocumentBody, node: HTMLElement): void;
24
- }
25
- export interface IPastePlugin {
26
- name: string;
27
- checkPasteType(html: string): boolean;
28
- stylesRules: IStyleRule[];
29
- afterProcessRules: IAfterProcessRule[];
30
- }
@@ -1,18 +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
- import type { IParagraphStyle, Nullable } from '@univerjs/core';
17
- export declare function getParagraphStyle(el: HTMLElement): Nullable<IParagraphStyle>;
18
- export declare function ptToPixel(pt: number): number;
@@ -1,19 +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
- import type { IDocumentBody } from '@univerjs/core';
17
- export declare class UDMToHtmlService {
18
- convert(bodyList: IDocumentBody[]): string;
19
- }
@@ -1,19 +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
- import type { IShortcutItem } from '@univerjs/ui';
17
- export declare const BreakLineShortcut: IShortcutItem;
18
- export declare const DeleteLeftShortcut: IShortcutItem;
19
- export declare const DeleteRightShortcut: IShortcutItem;
@@ -1,25 +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
- import type { IShortcutItem } from '@univerjs/ui';
17
- export declare const MoveCursorUpShortcut: IShortcutItem;
18
- export declare const MoveCursorDownShortcut: IShortcutItem;
19
- export declare const MoveCursorLeftShortcut: IShortcutItem;
20
- export declare const MoveCursorRightShortcut: IShortcutItem;
21
- export declare const MoveSelectionUpShortcut: IShortcutItem;
22
- export declare const MoveSelectionDownShortcut: IShortcutItem;
23
- export declare const MoveSelectionLeftShortcut: IShortcutItem;
24
- export declare const MoveSelectionRightShortcut: IShortcutItem;
25
- export declare const SelectAllShortcut: IShortcutItem;
@@ -1,34 +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
- import { IConfigService, IUniverInstanceService, RxDisposable } from '@univerjs/core';
17
- import type { RenderManagerService } from '@univerjs/engine-render';
18
- import { DocViewModelManagerService } from '../services/doc-view-model-manager.service';
19
- export declare class DocCanvasView extends RxDisposable {
20
- private readonly _renderManagerService;
21
- private readonly _configService;
22
- private readonly _currentUniverService;
23
- private readonly _docViewModelManagerService;
24
- private _scene;
25
- private _currentDocumentModel;
26
- private _loadedMap;
27
- private readonly _fps$;
28
- readonly fps$: import("rxjs").Observable<string>;
29
- constructor(_renderManagerService: RenderManagerService, _configService: IConfigService, _currentUniverService: IUniverInstanceService, _docViewModelManagerService: DocViewModelManagerService);
30
- private _initialize;
31
- dispose(): void;
32
- private _addNewRender;
33
- private _addComponent;
34
- }