@univerjs/docs-ui 0.2.5 → 0.2.7

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 (43) hide show
  1. package/lib/cjs/index.js +7 -4
  2. package/lib/es/index.js +3360 -2035
  3. package/lib/index.css +1 -1
  4. package/lib/locale/en-US.json +38 -0
  5. package/lib/locale/ru-RU.json +39 -1
  6. package/lib/locale/vi-VN.json +39 -1
  7. package/lib/locale/zh-CN.json +40 -2
  8. package/lib/locale/zh-TW.json +39 -1
  9. package/lib/types/basics/interfaces/component-config/i-doc-ui-plugin-config.d.ts +2 -0
  10. package/lib/types/commands/commands/doc-paragraph-setting.command.d.ts +4 -0
  11. package/lib/types/commands/commands/doc-tab.command.d.ts +8 -0
  12. package/lib/types/commands/operations/doc-create-table.operation.d.ts +3 -0
  13. package/lib/types/commands/operations/doc-paragraph-setting-panel.operation.d.ts +3 -0
  14. package/lib/types/components/list-type-picker/index.d.ts +18 -0
  15. package/lib/types/components/list-type-picker/picker.d.ts +17 -0
  16. package/lib/types/controllers/doc-auto-format.controller.d.ts +11 -0
  17. package/lib/types/controllers/doc-header-footer.controller.d.ts +0 -1
  18. package/lib/types/controllers/doc-paragraph-setting.controller.d.ts +11 -0
  19. package/lib/types/controllers/doc-table.controller.d.ts +12 -0
  20. package/lib/types/controllers/doc-ui.controller.d.ts +12 -10
  21. package/lib/types/controllers/menu/context-menu.d.ts +11 -1
  22. package/lib/types/controllers/menu/menu.d.ts +9 -4
  23. package/lib/types/controllers/render-controllers/doc-checklist.render-controller.d.ts +15 -0
  24. package/lib/types/controllers/render-controllers/doc.render-controller.d.ts +3 -2
  25. package/lib/types/controllers/render-controllers/zoom.render-controller.d.ts +3 -3
  26. package/lib/types/docs-ui-plugin.d.ts +6 -3
  27. package/lib/types/index.d.ts +2 -0
  28. package/lib/types/locale/zh-CN.d.ts +38 -0
  29. package/lib/types/services/clipboard/clipboard.service.d.ts +2 -2
  30. package/lib/types/services/clipboard/copy-content-cache.d.ts +3 -3
  31. package/lib/types/services/clipboard/html-to-udm/converter.d.ts +5 -2
  32. package/lib/types/services/clipboard/html-to-udm/paste-plugins/type.d.ts +2 -2
  33. package/lib/types/services/clipboard/udm-to-html/convertor.d.ts +1 -1
  34. package/lib/types/services/doc-hover-manager.service.d.ts +3 -1
  35. package/lib/types/shortcuts/format.shortcut.d.ts +4 -0
  36. package/lib/types/views/paragraph-setting/Setting.d.ts +17 -0
  37. package/lib/types/views/paragraph-setting/hook/utils.d.ts +11 -0
  38. package/lib/types/views/paragraph-setting/index.d.ts +3 -0
  39. package/lib/types/views/table/create/TableCreate.d.ts +11 -0
  40. package/lib/types/views/table/create/component-name.d.ts +16 -0
  41. package/lib/umd/index.js +7 -4
  42. package/package.json +18 -15
  43. /package/lib/types/{controllers/shortcut → shortcuts}/toolbar.shortcut.d.ts +0 -0
@@ -33,15 +33,33 @@ declare const locale: {
33
33
  main: string;
34
34
  right: string;
35
35
  };
36
+ table: {
37
+ main: string;
38
+ insert: string;
39
+ colCount: string;
40
+ rowCount: string;
41
+ };
36
42
  resetColor: string;
37
43
  order: string;
38
44
  unorder: string;
45
+ checklist: string;
39
46
  alignLeft: string;
40
47
  alignCenter: string;
41
48
  alignRight: string;
42
49
  alignJustify: string;
43
50
  headerFooter: string;
44
51
  };
52
+ table: {
53
+ insert: string;
54
+ insertRowAbove: string;
55
+ insertRowBelow: string;
56
+ insertColumnLeft: string;
57
+ insertColumnRight: string;
58
+ delete: string;
59
+ deleteRows: string;
60
+ deleteColumns: string;
61
+ deleteTable: string;
62
+ };
45
63
  headerFooter: {
46
64
  header: string;
47
65
  footer: string;
@@ -53,5 +71,25 @@ declare const locale: {
53
71
  closeHeaderFooter: string;
54
72
  disableText: string;
55
73
  };
74
+ doc: {
75
+ menu: {
76
+ paragraphSetting: string;
77
+ };
78
+ slider: {
79
+ paragraphSetting: string;
80
+ };
81
+ paragraphSetting: {
82
+ alignment: string;
83
+ indentation: string;
84
+ left: string;
85
+ right: string;
86
+ firstLine: string;
87
+ hanging: string;
88
+ spacing: string;
89
+ before: string;
90
+ after: string;
91
+ lineSpace: string;
92
+ };
93
+ };
56
94
  };
57
95
  export default locale;
@@ -37,7 +37,7 @@ export declare class DocClipboardService extends Disposable implements IDocClipb
37
37
  private _setClipboardData;
38
38
  addClipboardHook(hook: IDocClipboardHook): IDisposable;
39
39
  private _getDocumentBodyInRanges;
40
- private _generateBodyFromClipboardItems;
40
+ private _genDocDataFromClipboardItems;
41
41
  private _generateBody;
42
- private _generateBodyFromHtmlAndText;
42
+ private _genDocDataFromHtmlAndText;
43
43
  }
@@ -1,11 +1,11 @@
1
- import { IDocumentBody } from '@univerjs/core';
1
+ import { IDocumentData } from '@univerjs/core';
2
2
 
3
3
  export declare function genId(): string;
4
4
  export declare function extractId(html: string): string | null;
5
5
  export declare class CopyContentCache {
6
6
  private _cache;
7
- set(id: string, clipboardData: IDocumentBody): void;
8
- get(id: string): IDocumentBody | undefined;
7
+ set(id: string, clipboardData: Partial<IDocumentData>): void;
8
+ get(id: string): Partial<IDocumentData> | undefined;
9
9
  clear(): void;
10
10
  }
11
11
  export declare const copyContentCache: CopyContentCache;
@@ -1,4 +1,4 @@
1
- import { IDocumentBody } from '@univerjs/core';
1
+ import { IDocumentData } from '@univerjs/core';
2
2
  import { IPastePlugin } from './paste-plugins/type';
3
3
 
4
4
  /**
@@ -8,9 +8,12 @@ import { IPastePlugin } from './paste-plugins/type';
8
8
  export declare class HtmlToUDMService {
9
9
  private static _pluginList;
10
10
  static use(plugin: IPastePlugin): void;
11
+ private _tableCache;
11
12
  private _styleCache;
12
13
  private _styleRules;
13
14
  private _afterProcessRules;
14
- convert(html: string): IDocumentBody;
15
+ convert(html: string): Partial<IDocumentData>;
15
16
  private _process;
17
+ private _processBeforeTable;
18
+ private _processAfterTable;
16
19
  }
@@ -1,4 +1,4 @@
1
- import { IDocumentBody, ITextStyle } from '@univerjs/core';
1
+ import { IDocumentData, ITextStyle } from '@univerjs/core';
2
2
 
3
3
  export interface IStyleRule {
4
4
  filter: string | string[] | ((node: HTMLElement) => boolean);
@@ -6,7 +6,7 @@ export interface IStyleRule {
6
6
  }
7
7
  export interface IAfterProcessRule {
8
8
  filter: string | string[] | ((node: HTMLElement) => boolean);
9
- handler(doc: IDocumentBody, node: HTMLElement): void;
9
+ handler(doc: Partial<IDocumentData>, node: HTMLElement): void;
10
10
  }
11
11
  export interface IPastePlugin {
12
12
  name: string;
@@ -2,7 +2,7 @@ import { IDocumentBody, ITextRun } from '@univerjs/core';
2
2
 
3
3
  export declare function covertTextRunToHtml(dataStream: string, textRun: ITextRun): string;
4
4
  export declare function getBodySliceHtml(body: IDocumentBody, startIndex: number, endIndex: number): string;
5
- export declare function convertBodyToHtml(body: IDocumentBody, withParagraphInfo?: boolean): string;
5
+ export declare function convertBodyToHtml(body: IDocumentBody): string;
6
6
  export declare class UDMToHtmlService {
7
7
  convert(bodyList: IDocumentBody[]): string;
8
8
  }
@@ -1,4 +1,4 @@
1
- import { ICustomRange, Nullable, Disposable, IUniverInstanceService } from '@univerjs/core';
1
+ import { ICustomRange, IParagraph, Nullable, Disposable, IUniverInstanceService } from '@univerjs/core';
2
2
  import { IMouseEvent, IPointerEvent, IRenderManagerService } from '@univerjs/engine-render';
3
3
 
4
4
  export declare class DocHoverManagerService extends Disposable {
@@ -8,6 +8,8 @@ export declare class DocHoverManagerService extends Disposable {
8
8
  readonly activeCustomRanges$: import('rxjs').Observable<ICustomRange[]>;
9
9
  private readonly _activeIndex$;
10
10
  readonly activeIndex$: import('rxjs').Observable<Nullable<number>>;
11
+ private readonly _bullet$;
12
+ readonly bullet$: import('rxjs').Observable<Nullable<IParagraph>>;
11
13
  private _scrolling;
12
14
  constructor(_univerInstanceService: IUniverInstanceService, _renderManagerService: IRenderManagerService);
13
15
  private _getTransformCoordForDocumentOffset;
@@ -0,0 +1,4 @@
1
+ import { IShortcutItem } from '@univerjs/ui';
2
+
3
+ export declare const TabShortCut: IShortcutItem;
4
+ export declare const ShiftTabShortCut: IShortcutItem;
@@ -0,0 +1,17 @@
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 * as React from 'react';
17
+ export declare function ParagraphSetting(): React.JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { IParagraph } from '@univerjs/core';
2
+
3
+ export declare const useCurrentParagraph: () => IParagraph[];
4
+ export declare const useFirstParagraphHorizontalAlign: (paragraph: IParagraph[], defaultValue: string) => readonly [string, (v: string) => Promise<boolean>];
5
+ export declare const useFirstParagraphIndentStart: (paragraph: IParagraph[]) => readonly [number, (v: number) => Promise<boolean>];
6
+ export declare const useFirstParagraphIndentEnd: (paragraph: IParagraph[]) => readonly [number, (v: number) => Promise<boolean>];
7
+ export declare const useFirstParagraphIndentFirstLine: (paragraph: IParagraph[]) => readonly [number, (v: number) => Promise<boolean>];
8
+ export declare const useFirstParagraphIndentHanging: (paragraph: IParagraph[]) => readonly [number, (v: number) => Promise<boolean>];
9
+ export declare const useFirstParagraphIndentSpaceAbove: (paragraph: IParagraph[]) => readonly [number, (v: number) => Promise<boolean>];
10
+ export declare const useFirstParagraphSpaceBelow: (paragraph: IParagraph[]) => readonly [number, (v: number) => Promise<boolean>];
11
+ export declare const useFirstParagraphLineSpacing: (paragraph: IParagraph[]) => readonly [number, (v: number) => Promise<boolean>];
@@ -0,0 +1,3 @@
1
+ import { default as React } from 'react';
2
+
3
+ export declare function ParagraphSettingIndex(): React.JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { default as React } from 'react';
2
+
3
+ interface IDocCreateTableConfirmProps {
4
+ handleRowColChange: (rowCount: number, colCount: number) => void;
5
+ tableCreateParams: {
6
+ rowCount: number;
7
+ colCount: number;
8
+ };
9
+ }
10
+ export declare const DocCreateTableConfirm: ({ handleRowColChange, tableCreateParams, }: IDocCreateTableConfirmProps) => React.JSX.Element;
11
+ export {};
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Inc.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export declare const COMPONENT_DOC_CREATE_TABLE_CONFIRM = "COMPONENT_DOC_CREATE_TABLE_CONFIRM";