@ones-editor/editor 2.0.8-beta.1 → 2.1.0-beta.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 (193) hide show
  1. package/@ones-editor/block-menu/src/block-menu-button/drag-preview/element-to-data-url.d.ts +1 -1
  2. package/@ones-editor/block-menu/src/block-menu-button/index.d.ts +4 -15
  3. package/@ones-editor/block-menu/src/block-menu-button/menu-button/index.d.ts +23 -0
  4. package/@ones-editor/callout-block/package.json +11 -0
  5. package/@ones-editor/callout-block/src/callout-block/callout-block-content.d.ts +3 -0
  6. package/@ones-editor/callout-block/src/callout-block/callout-block-doc.d.ts +2 -0
  7. package/@ones-editor/callout-block/src/callout-block/callout-block.d.ts +3 -0
  8. package/@ones-editor/callout-block/src/callout-block/callout-converter-interceptor.d.ts +8 -0
  9. package/@ones-editor/callout-block/src/callout-block/callout-input-handler.d.ts +11 -0
  10. package/@ones-editor/callout-block/src/callout-block/callout-last-callout-payload.d.ts +9 -0
  11. package/@ones-editor/callout-block/src/callout-block/callout-options.d.ts +2 -0
  12. package/@ones-editor/callout-block/src/callout-block/callout-properties.d.ts +2 -0
  13. package/@ones-editor/callout-block/src/callout-block/callout-quick-menu-item-filter.d.ts +7 -0
  14. package/@ones-editor/callout-block/src/callout-block/command-items/bg-color-item.d.ts +22 -0
  15. package/@ones-editor/callout-block/src/callout-block/command-items/delete-icon-item.d.ts +4 -0
  16. package/@ones-editor/callout-block/src/callout-block/command-items/preset-item.d.ts +16 -0
  17. package/@ones-editor/callout-block/src/callout-block/converter.d.ts +3 -0
  18. package/@ones-editor/callout-block/src/callout-block/helper.d.ts +4 -0
  19. package/@ones-editor/callout-block/src/callout-block/index.d.ts +1 -0
  20. package/@ones-editor/callout-block/src/callout-block/types.d.ts +9 -0
  21. package/@ones-editor/callout-block/src/index.d.ts +3 -0
  22. package/@ones-editor/callout-block/src/locale/en-us.d.ts +12 -0
  23. package/@ones-editor/callout-block/src/locale/index.d.ts +1 -0
  24. package/@ones-editor/callout-block/src/locale/ja-jp.d.ts +12 -0
  25. package/@ones-editor/callout-block/src/locale/zh-cn.d.ts +12 -0
  26. package/@ones-editor/comments/src/text-comments/comments-command-provider.d.ts +4 -3
  27. package/@ones-editor/context-menu/src/helper/command-items.d.ts +1 -0
  28. package/@ones-editor/core/src/core/blocks/common/block-wrapper.d.ts +2 -1
  29. package/@ones-editor/core/src/core/blocks/common/execute-block-command.d.ts +2 -2
  30. package/@ones-editor/core/src/core/blocks/common/insert-empty-block.d.ts +3 -2
  31. package/@ones-editor/core/src/core/blocks/embed-blocks/embed-block/common.d.ts +1 -0
  32. package/@ones-editor/core/src/core/blocks/embed-blocks/embed-block/index.d.ts +1 -0
  33. package/@ones-editor/core/src/core/command-providers/commands/index.d.ts +2 -0
  34. package/@ones-editor/core/src/core/command-providers/commands/inject-source.d.ts +3 -0
  35. package/@ones-editor/core/src/core/command-providers/commands/merge-commands.d.ts +3 -0
  36. package/@ones-editor/core/src/core/command-providers/commands/range-commands.d.ts +3 -3
  37. package/@ones-editor/core/src/core/command-providers/editor-command-providers.d.ts +4 -3
  38. package/@ones-editor/core/src/core/composition/editor-input.d.ts +3 -3
  39. package/@ones-editor/core/src/core/containers/children.d.ts +5 -2
  40. package/@ones-editor/core/src/core/containers/element.d.ts +1 -0
  41. package/@ones-editor/core/src/core/doc/container.d.ts +2 -2
  42. package/@ones-editor/core/src/core/doc/doc.d.ts +1 -1
  43. package/@ones-editor/core/src/core/editor/actions/insert-doc/insert-doc.d.ts +1 -1
  44. package/@ones-editor/core/src/core/editor-doc/editor-doc.d.ts +1 -1
  45. package/@ones-editor/core/src/core/editor-doc/handle-block-data-changed.d.ts +2 -1
  46. package/@ones-editor/core/src/core/types.d.ts +82 -25
  47. package/@ones-editor/core/src/core/undo-manager/undo-manager.d.ts +2 -0
  48. package/@ones-editor/core/src/helper/hovering-block.d.ts +3 -1
  49. package/@ones-editor/core/src/i18n/en-us.d.ts +1 -0
  50. package/@ones-editor/core/src/i18n/i18n.d.ts +3 -0
  51. package/@ones-editor/core/src/i18n/ja-jp.d.ts +1 -0
  52. package/@ones-editor/core/src/i18n/zh-cn.d.ts +1 -0
  53. package/@ones-editor/core/src/utils/clipboard.d.ts +6 -4
  54. package/@ones-editor/core/src/utils/data-url.d.ts +1 -0
  55. package/@ones-editor/drop-target/src/drop-indicator.d.ts +5 -4
  56. package/@ones-editor/drop-target/src/drop-target.d.ts +2 -1
  57. package/@ones-editor/drop-target/src/find-drop-target.d.ts +1 -1
  58. package/@ones-editor/drop-target/src/index.d.ts +2 -1
  59. package/@ones-editor/embed-block-helper/src/block-resizer/index.d.ts +2 -0
  60. package/@ones-editor/file/src/file-embed/card/index.d.ts +1 -1
  61. package/@ones-editor/file/src/types.d.ts +1 -0
  62. package/@ones-editor/graph-embed/src/config/index.d.ts +1 -0
  63. package/@ones-editor/graph-embed/src/helper/graph-base.d.ts +1 -1
  64. package/@ones-editor/graph-embed/src/helper/graph-block-commands.d.ts +3 -1
  65. package/@ones-editor/heading-collapse/src/heading-collapse-button/heading-utils.d.ts +2 -1
  66. package/@ones-editor/heading-collapse/src/index.d.ts +1 -0
  67. package/@ones-editor/image-embed/src/drag-drop/handle-drop-over.d.ts +1 -4
  68. package/@ones-editor/image-embed/src/drag-drop/handle-drop.d.ts +3 -2
  69. package/@ones-editor/image-embed/src/hovering-toolbar/index.d.ts +22 -0
  70. package/@ones-editor/image-embed/src/image-dom/download-image.d.ts +2 -0
  71. package/@ones-editor/image-embed/src/image-object.d.ts +3 -0
  72. package/@ones-editor/image-embed/src/index.d.ts +5 -1
  73. package/@ones-editor/image-embed/src/types.d.ts +1 -0
  74. package/@ones-editor/input-handlers/src/index.d.ts +4 -1
  75. package/@ones-editor/input-handlers/src/markdown-shortcuts/converter-interceptors.d.ts +12 -0
  76. package/@ones-editor/input-handlers/src/markdown-shortcuts/match-block-convert.d.ts +9 -1
  77. package/@ones-editor/{column-block → layout-block}/package.json +1 -1
  78. package/@ones-editor/layout-block/src/block-drop.d.ts +3 -0
  79. package/@ones-editor/layout-block/src/caption.d.ts +8 -0
  80. package/@ones-editor/layout-block/src/child-containers.d.ts +3 -0
  81. package/@ones-editor/layout-block/src/column-resizer/index.d.ts +2 -0
  82. package/@ones-editor/layout-block/src/command-filter.d.ts +7 -0
  83. package/@ones-editor/layout-block/src/constants.d.ts +32 -0
  84. package/@ones-editor/layout-block/src/index.d.ts +6 -0
  85. package/@ones-editor/layout-block/src/layout-creator/index.d.ts +27 -0
  86. package/@ones-editor/layout-block/src/layout-operations.d.ts +11 -0
  87. package/@ones-editor/layout-block/src/locale/en-us.d.ts +10 -0
  88. package/@ones-editor/layout-block/src/locale/index.d.ts +1 -0
  89. package/@ones-editor/layout-block/src/locale/ja-jp.d.ts +10 -0
  90. package/@ones-editor/layout-block/src/locale/zh-cn.d.ts +10 -0
  91. package/@ones-editor/layout-block/src/options.d.ts +2 -0
  92. package/@ones-editor/layout-block/src/percent-bar.d.ts +3 -0
  93. package/@ones-editor/layout-block/src/selection.d.ts +5 -0
  94. package/@ones-editor/layout-block/src/toolbar.d.ts +33 -0
  95. package/@ones-editor/layout-block/src/types.d.ts +17 -0
  96. package/@ones-editor/layout-block/src/utils.d.ts +6 -0
  97. package/@ones-editor/media-embed/src/core/hovering-toolbar/index.d.ts +22 -0
  98. package/@ones-editor/misc/src/image.d.ts +2 -1
  99. package/@ones-editor/misc/src/re-auth/index.d.ts +7 -2
  100. package/@ones-editor/misc/src/re-auth/locale/en-us.d.ts +1 -0
  101. package/@ones-editor/misc/src/re-auth/locale/ja-jp.d.ts +1 -0
  102. package/@ones-editor/misc/src/re-auth/locale/zh-cn.d.ts +1 -0
  103. package/@ones-editor/misc/src/re-auth/ui/toolbar.d.ts +2 -0
  104. package/@ones-editor/paste-special/src/paste-special-handler.d.ts +1 -0
  105. package/@ones-editor/sharedb-doc/src/doc/auth-connection.d.ts +2 -0
  106. package/@ones-editor/sharedb-doc/src/doc/sharedb-client.d.ts +1 -1
  107. package/@ones-editor/sharedb-doc/src/doc/sharedb-doc.d.ts +1 -1
  108. package/@ones-editor/table-block/src/commands/table-block-commands.d.ts +4 -3
  109. package/@ones-editor/table-block/src/index.d.ts +1 -0
  110. package/@ones-editor/table-block/src/table-block/doc-table-grid.d.ts +1 -0
  111. package/@ones-editor/table-block/src/table-block/table-creator/index.d.ts +1 -1
  112. package/@ones-editor/table-block/src/table-block/table-grid.d.ts +1 -0
  113. package/@ones-editor/text-commands/src/text-command-provider.d.ts +4 -3
  114. package/@ones-editor/text-commands/src/text-commands.d.ts +3 -3
  115. package/@ones-editor/to-docx/src/doc2other/colors.d.ts +7 -1
  116. package/@ones-editor/to-docx/src/doc2other/core.d.ts +2 -0
  117. package/@ones-editor/to-docx/src/doc2other/layout.d.ts +10 -0
  118. package/@ones-editor/toc/src/build-toc.d.ts +1 -0
  119. package/@ones-editor/tsconfig.tsbuildinfo +1 -1
  120. package/@ones-editor/ui/src/block-menu/block-command-providers.d.ts +10 -0
  121. package/@ones-editor/{block-menu → ui}/src/block-menu/index.d.ts +3 -1
  122. package/@ones-editor/ui/src/index.d.ts +7 -7
  123. package/@ones-editor/ui/src/providers/abstract-providers.d.ts +19 -0
  124. package/@ones-editor/ui/src/providers/align-dropdown.d.ts +10 -0
  125. package/@ones-editor/ui/src/{toolbar/commands → providers}/align.d.ts +4 -4
  126. package/@ones-editor/ui/src/providers/block-hook-provider.d.ts +16 -0
  127. package/@ones-editor/ui/src/providers/heading.d.ts +13 -0
  128. package/@ones-editor/ui/src/providers/insert-above.d.ts +9 -0
  129. package/@ones-editor/ui/src/providers/insert-after.d.ts +9 -0
  130. package/@ones-editor/ui/src/providers/insert-box-provider.d.ts +12 -0
  131. package/@ones-editor/ui/src/providers/insert-group.d.ts +7 -0
  132. package/@ones-editor/ui/src/providers/insert-menu.d.ts +16 -0
  133. package/@ones-editor/ui/src/providers/link.d.ts +17 -0
  134. package/@ones-editor/ui/src/providers/list.d.ts +13 -0
  135. package/@ones-editor/ui/src/providers/paragraph.d.ts +8 -0
  136. package/@ones-editor/ui/src/providers/proxy-provider.d.ts +9 -0
  137. package/@ones-editor/ui/src/providers/quoted.d.ts +10 -0
  138. package/@ones-editor/ui/src/providers/text-fixed-provider.d.ts +16 -0
  139. package/@ones-editor/ui/src/providers/text-styles.d.ts +9 -0
  140. package/@ones-editor/ui/src/providers/turn-into.d.ts +9 -0
  141. package/@ones-editor/ui/src/providers/utils/add-section.d.ts +2 -0
  142. package/@ones-editor/ui/src/{quick-menu → providers/utils}/basic-commands.d.ts +1 -2
  143. package/@ones-editor/ui/src/providers/utils/inject-block-options.d.ts +5 -0
  144. package/@ones-editor/ui/src/quick-menu/index.d.ts +5 -10
  145. package/@ones-editor/ui/src/quick-menu/quick-command-providers.d.ts +10 -0
  146. package/@ones-editor/ui/src/quick-menu/types.d.ts +1 -0
  147. package/@ones-editor/ui/src/toolbar/text-commands.d.ts +2 -2
  148. package/@ones-editor/ui/src/toolbar/toolbar-handler.d.ts +2 -0
  149. package/@ones-editor/ui-base/src/color-palette/color-palette.d.ts +2 -1
  150. package/@ones-editor/ui-base/src/color-palette/create-palette.d.ts +8 -0
  151. package/@ones-editor/ui-base/src/color-palette/index.d.ts +2 -2
  152. package/@ones-editor/ui-base/src/command-bar/command-bar.d.ts +2 -2
  153. package/@ones-editor/ui-base/src/command-bar/types.d.ts +2 -0
  154. package/@ones-editor/ui-base/src/emoji-item/emoji-item.d.ts +19 -0
  155. package/@ones-editor/ui-base/src/emoji-item/index.d.ts +2 -0
  156. package/@ones-editor/ui-base/src/emoji-palette/emoji-content.d.ts +21 -0
  157. package/@ones-editor/ui-base/src/emoji-palette/emoji-data.d.ts +60 -0
  158. package/@ones-editor/ui-base/src/emoji-palette/emoji-navigation.d.ts +16 -0
  159. package/@ones-editor/ui-base/src/emoji-palette/emoji-search.d.ts +11 -0
  160. package/@ones-editor/ui-base/src/emoji-palette/index.d.ts +23 -0
  161. package/@ones-editor/ui-base/src/emoji-palette/types.d.ts +0 -0
  162. package/@ones-editor/ui-base/src/icons/index.d.ts +20 -1
  163. package/@ones-editor/ui-base/src/index.d.ts +1 -0
  164. package/@ones-editor/ui-base/src/input/create-input.d.ts +1 -0
  165. package/@ones-editor/ui-base/src/locale/en-us.d.ts +20 -0
  166. package/@ones-editor/ui-base/src/locale/ja-jp.d.ts +20 -0
  167. package/@ones-editor/ui-base/src/locale/zh-cn.d.ts +20 -0
  168. package/dist/index.d.ts +2 -1
  169. package/dist/index.js +128530 -842
  170. package/dist/lang/en-us.d.ts +1 -0
  171. package/dist/lang/ja-jp.d.ts +1 -0
  172. package/dist/lang/zh-cn.d.ts +1 -0
  173. package/dist/types.d.ts +3 -2
  174. package/package.json +3 -3
  175. package/@ones-editor/block-menu/src/block-menu/items/block-command-items.d.ts +0 -3
  176. package/@ones-editor/block-menu/src/block-menu/items/index.d.ts +0 -5
  177. package/@ones-editor/block-menu/src/block-menu/items/insert-block-items/index.d.ts +0 -5
  178. package/@ones-editor/block-menu/src/block-menu/items/text-styles/text-style-item.d.ts +0 -30
  179. package/@ones-editor/block-menu/src/block-menu/items/types.d.ts +0 -5
  180. package/@ones-editor/column-block/src/child-containers.d.ts +0 -2
  181. package/@ones-editor/column-block/src/columns-options.d.ts +0 -2
  182. package/@ones-editor/column-block/src/columns-properties.d.ts +0 -15
  183. package/@ones-editor/column-block/src/index.d.ts +0 -4
  184. package/@ones-editor/column-block/src/types.d.ts +0 -11
  185. package/@ones-editor/ui/src/quick-menu/basic-menu-items.d.ts +0 -16
  186. package/@ones-editor/ui/src/quick-menu/inline-box-items.d.ts +0 -8
  187. package/@ones-editor/ui/src/quick-menu/insert-empty-block.d.ts +0 -4
  188. package/@ones-editor/ui/src/quick-menu/order.d.ts +0 -1
  189. package/@ones-editor/ui/src/quick-menu/quick-menu-items.d.ts +0 -7
  190. package/@ones-editor/ui/src/toolbar/commands/paragraph.d.ts +0 -11
  191. package/@ones-editor/ui/src/toolbar/commands/turn-into.d.ts +0 -10
  192. package/@ones-editor/ui/src/toolbar/merge-commands.d.ts +0 -2
  193. /package/@ones-editor/{block-menu → ui}/src/block-menu/standard-block-actions/hook.d.ts +0 -0
@@ -0,0 +1,32 @@
1
+ /**
2
+ * 名称
3
+ */
4
+ export declare const LAYOUT_NAME = "LayoutBlock";
5
+ /**
6
+ * 快捷键
7
+ */
8
+ export declare const LAYOUT_SHORTCUT_ID = "insert-layout";
9
+ /**
10
+ * 快捷键提示
11
+ */
12
+ export declare const LAYOUT_SHORTCUT_SUBTEXT = "/column";
13
+ export declare const LAYOUT_BLOCK_TYPE = "layout";
14
+ /**
15
+ * 最大分栏数
16
+ */
17
+ export declare const MAX_LAYOUT_COLUMNS = 6;
18
+ /**
19
+ * 最小分栏数
20
+ */
21
+ export declare const MIN_LAYOUT_COLUMNS = 2;
22
+ /**
23
+ * 分栏最小宽度,百分比
24
+ */
25
+ export declare const MIN_LAYOUT_WIDTH_PERCENT = 0.08;
26
+ export declare const DROP_BLOCK_TYPE_BLACK_LIST: string[];
27
+ /**
28
+ * custom dom
29
+ */
30
+ export declare const LAYOUT_SEPARATOR_CLASS_NAME = "layout-separator";
31
+ export declare const LAYOUT_COLUMN_CONTAINER_CLASS_NAME = "layout-column-container";
32
+ export declare const LAYOUT_SEPARATOR_INDEX_ATTRIBUTE_KEY = "layoutSeparatorIndex";
@@ -0,0 +1,6 @@
1
+ import './locale';
2
+ import './layout-styles.scss';
3
+ import { LayoutKindBlock } from './types';
4
+ export declare const LayoutBlock: LayoutKindBlock;
5
+ export { isLayoutBlock } from './utils';
6
+ export * from './caption';
@@ -0,0 +1,27 @@
1
+ import { Closeable, CommandItem } from '../../../../@ones-editor/core';
2
+ import { CreateLayoutData } from '../types';
3
+ declare class LayoutCreatorItem implements CommandItem, CreateLayoutData {
4
+ id: string;
5
+ name: string;
6
+ colCount?: number | undefined;
7
+ classPrefix: {
8
+ container: string;
9
+ title: string;
10
+ column: string;
11
+ };
12
+ element: HTMLElement;
13
+ closeable: Closeable | null;
14
+ columnsArray: number[];
15
+ constructor();
16
+ setCloseable: (closeable: Closeable) => void;
17
+ destroy: () => void;
18
+ createLayoutCreatorElement(): HTMLDivElement;
19
+ handleCreatorClick: (event: MouseEvent) => void;
20
+ handleCreatorLeave: () => void;
21
+ handleLayoutCreatorColumnEnter: (event: MouseEvent) => void;
22
+ highlightLayoutCreatorColumn: (colIndex: number) => void;
23
+ setColumnClassByIndex: (column: HTMLElement | null, index: number, targetIndex: number) => void;
24
+ showCreateLayoutCount: (colIndex: number) => void;
25
+ }
26
+ export declare function getLayoutCreatorItem(): LayoutCreatorItem;
27
+ export {};
@@ -0,0 +1,11 @@
1
+ import { BlockElement, OnesEditor, InsertEmptyBlockOptions, BlockPathComponent, DocBlock } from '../../../@ones-editor/core';
2
+ export declare function handleInsertEmptyBlock(editor: OnesEditor, options: InsertEmptyBlockOptions): Promise<BlockElement>;
3
+ export declare function createLayout(editor: OnesEditor, col: number | (BlockElement | DocBlock)[], path: BlockPathComponent, dataOverriding?: (DocBlock | undefined)[]): BlockElement;
4
+ export declare function selectContainer(editor: OnesEditor, layoutBlockElement: BlockElement, startContainerID: string, endContainerID?: string): void;
5
+ export declare function reorderColumns(editor: OnesEditor, layoutBlock: BlockElement, sourceContainerID: string, position: number): void;
6
+ export declare function combineLayoutBlock(editor: OnesEditor, from: BlockElement, to: BlockElement, position?: number): void;
7
+ export declare function addColumn(editor: OnesEditor, targetBlock: BlockElement, options?: {
8
+ sourceBlock?: BlockElement;
9
+ position?: number;
10
+ }): import("@ones-editor/core").ContainerElement | undefined;
11
+ export declare function deleteColumn(editor: OnesEditor, columnContainerID: string, layoutBlock: BlockElement): void;
@@ -0,0 +1,10 @@
1
+ declare const _default: {
2
+ layout: {
3
+ title: string;
4
+ columnDrag: string;
5
+ insertColumn: string;
6
+ selectColumn: string;
7
+ currentCols: string;
8
+ };
9
+ };
10
+ export default _default;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
1
+ declare const _default: {
2
+ layout: {
3
+ title: string;
4
+ columnDrag: string;
5
+ insertColumn: string;
6
+ selectColumn: string;
7
+ currentCols: string;
8
+ };
9
+ };
10
+ export default _default;
@@ -0,0 +1,10 @@
1
+ declare const _default: {
2
+ layout: {
3
+ title: string;
4
+ columnDrag: string;
5
+ insertColumn: string;
6
+ selectColumn: string;
7
+ currentCols: string;
8
+ };
9
+ };
10
+ export default _default;
@@ -0,0 +1,2 @@
1
+ import { LayoutKindBlock } from './types';
2
+ export declare const getLayoutOptions: Exclude<LayoutKindBlock['getOptions'], undefined>;
@@ -0,0 +1,3 @@
1
+ import { ContainerElement, OnesEditor } from '../../../@ones-editor/core';
2
+ import { LayoutDocBlock } from './types';
3
+ export declare function createPercentBar(editor: OnesEditor, container: ContainerElement, layoutData: LayoutDocBlock, index: number): void;
@@ -0,0 +1,5 @@
1
+ import { LayoutKindBlock } from './types';
2
+ export declare const updateSelection: LayoutKindBlock['updateSelection'];
3
+ export declare const clearSelection: LayoutKindBlock['clearSelection'];
4
+ export declare const getSelectedContainers: LayoutKindBlock['getSelectedContainers'];
5
+ export declare const getTextToolbarReferenceClient: LayoutKindBlock['getTextToolbarReferenceClient'];
@@ -0,0 +1,33 @@
1
+ import { OnesEditor, BlockElement, AutoScroll, OnesEditorCustom, ContainerElement } from '../../../@ones-editor/core';
2
+ import { Instance } from 'tippy.js';
3
+ export declare function createSeparatorContainer(editor: OnesEditor, blockElement: BlockElement, index: number): HTMLDivElement;
4
+ export declare function createActionBar(editor: OnesEditor, containerID: string, _blockElement: BlockElement, columnRemovable?: boolean): {
5
+ actionBarContainer: HTMLDivElement;
6
+ tippyInstance?: undefined;
7
+ } | {
8
+ actionBarContainer: HTMLDivElement;
9
+ tippyInstance: Instance<import("tippy.js").Props>;
10
+ };
11
+ export declare function elementToDataUrl(editor: OnesEditor, element: HTMLElement): Promise<string>;
12
+ export declare class OnesEditorCustomLayoutDragHandler implements OnesEditorCustom {
13
+ private editor;
14
+ activeLayoutBlock?: BlockElement;
15
+ columnContainer?: ContainerElement;
16
+ draggingContainer?: HTMLElement;
17
+ autoScroll?: AutoScroll;
18
+ startPosition?: {
19
+ x: number;
20
+ y: number;
21
+ };
22
+ get separators(): HTMLElement[] | undefined;
23
+ get draggingContainerIndex(): number | undefined;
24
+ constructor(editor: OnesEditor);
25
+ destroy(): void;
26
+ private handleMouseDown;
27
+ private previewShouldScale;
28
+ private initContainerPreview;
29
+ private handleDragStart;
30
+ private handleDrag;
31
+ private handleDragEnd;
32
+ private getClosetSeparator;
33
+ }
@@ -0,0 +1,17 @@
1
+ import { ComplexKindBlock, DocBlock, OnesEditor } from '../../../@ones-editor/core';
2
+ export interface LayoutDocBlock extends DocBlock {
3
+ children: string[];
4
+ colsWidth: number[];
5
+ }
6
+ export type LayoutKindBlock = ComplexKindBlock;
7
+ export type LayoutDropData = {
8
+ isValidColumnDragging: boolean;
9
+ position: number;
10
+ };
11
+ export interface CreateLayoutData {
12
+ colCount?: number;
13
+ }
14
+ export interface EditorConfigLayoutOptions {
15
+ onColumnCreated?: (editor: OnesEditor, count: number) => void;
16
+ onColumnWidthChange?: (editor: OnesEditor, count: number, index: number, colsWidth: number[]) => void;
17
+ }
@@ -0,0 +1,6 @@
1
+ import { BlockElement, ContainerElement, DocBlock, DocObject, OnesEditor } from '../../../@ones-editor/core';
2
+ export declare function isBlockElement(item: unknown): item is BlockElement;
3
+ export declare function isLayoutBlock(block: BlockElement): boolean;
4
+ export declare function flattenLayoutBlockIfExists(_docObject: DocObject, containerID?: string): DocBlock[];
5
+ export declare function currentCaptionInRootContainer(editor: OnesEditor): boolean;
6
+ export declare function getClosetLayoutContainer(block: BlockElement | undefined): ContainerElement | undefined;
@@ -0,0 +1,22 @@
1
+ import { BlockCommands, BlockElement, CommandItem, OnesEditor } from '../../../../../@ones-editor/core';
2
+ import type { CommandItemType } from '../../../../../@ones-editor/core';
3
+ export default class ImageHoveringToolbarCommands implements BlockCommands {
4
+ protected editor: OnesEditor;
5
+ protected block: BlockElement;
6
+ group: string;
7
+ constructor(editor: OnesEditor, block: BlockElement);
8
+ _commands: ({
9
+ id: string;
10
+ name: string;
11
+ icon: string;
12
+ type?: undefined;
13
+ } | {
14
+ id: string;
15
+ name: string;
16
+ type: CommandItemType;
17
+ icon?: undefined;
18
+ })[];
19
+ private createIconItem;
20
+ get commands(): CommandItem[];
21
+ executeCommand(editor: OnesEditor, block: BlockElement, item: CommandItem): void;
22
+ }
@@ -1,2 +1,3 @@
1
- export declare function convertImageSrcToPng(src: string): Promise<Blob>;
1
+ export declare function convertImageSrcToPng(src: string, backgroundColor?: string): Promise<Blob>;
2
2
  export declare function convertImageFileToPng(file: File): Promise<Blob>;
3
+ export declare function downloadImageAsPng(downloadUrl: string, prefix?: string, backgroundColor?: string): Promise<void>;
@@ -1,14 +1,19 @@
1
1
  import { TypedEmitter } from 'tiny-typed-emitter';
2
- import type { OnesEditor, OnesEditorCustom, OnesEditorDocCallbacks } from '../../../../@ones-editor/core';
2
+ import { OnesEditor, OnesEditorCustom, OnesEditorDocCallbacks } from '../../../../@ones-editor/core';
3
3
  import ReAuthToolbar from './ui/toolbar';
4
4
  import './locale';
5
5
  type EventCallback = (() => void) | undefined;
6
6
  declare const DOC_RE_AUTH_KEYS = "doc-re-auth-event";
7
- declare class DocReAuthCallbacks extends TypedEmitter implements OnesEditorCustom, OnesEditorDocCallbacks {
7
+ type ReAuthEvent = {
8
+ tokenExpired: () => void;
9
+ };
10
+ declare class DocReAuthCallbacks extends TypedEmitter<ReAuthEvent> implements OnesEditorCustom, OnesEditorDocCallbacks {
8
11
  private editor;
9
12
  private authErrorCallback;
10
13
  private authRecoverCallback;
14
+ reAuthToolbar: ReAuthToolbar;
11
15
  constructor(editor: OnesEditor);
16
+ handleReAuth: () => void;
12
17
  addAuthListen(event: 'authError' | 'authRecover', callback: EventCallback): void;
13
18
  removeListeners(): void;
14
19
  destroy: () => void;
@@ -1,6 +1,7 @@
1
1
  declare const _default: {
2
2
  authError: {
3
3
  tips: string;
4
+ successTips: string;
4
5
  };
5
6
  };
6
7
  export default _default;
@@ -1,6 +1,7 @@
1
1
  declare const _default: {
2
2
  authError: {
3
3
  tips: string;
4
+ successTips: string;
4
5
  };
5
6
  };
6
7
  export default _default;
@@ -1,6 +1,7 @@
1
1
  declare const _default: {
2
2
  authError: {
3
3
  tips: string;
4
+ successTips: string;
4
5
  };
5
6
  };
6
7
  export default _default;
@@ -4,7 +4,9 @@ export default class ReAuthToolbar {
4
4
  private editor;
5
5
  private isShown;
6
6
  private currentBlock;
7
+ private fixedToolbar;
7
8
  constructor(editor: OnesEditor);
8
9
  render(block: BlockElement, onExit?: () => void): void;
10
+ succeedRender: () => void;
9
11
  destroy(): void;
10
12
  }
@@ -6,6 +6,7 @@ export default class PasteSpecialHandler implements OnesEditorInputHandler {
6
6
  lastUndoAction: OnesEditorUndoAction | null;
7
7
  lastPos: BlockPosition | null;
8
8
  event: ClipboardEvent | null;
9
+ order: number;
9
10
  constructor(editor: OnesEditor);
10
11
  destroy(): void;
11
12
  handleChanged(editor: OnesEditor, action: OnesEditorUndoAction): void;
@@ -28,6 +28,8 @@ export declare class AuthConnection {
28
28
  logout(): Promise<void>;
29
29
  init(auth: AuthMessage): Promise<void>;
30
30
  reConnect(token: string): Promise<void>;
31
+ _autoReAuth(): Promise<void>;
32
+ autoReAuth(): Promise<void>;
31
33
  handleAuthError(): Promise<void>;
32
34
  reAuth: () => Promise<void>;
33
35
  private emitPermissionError;
@@ -54,5 +54,5 @@ export default class ShareDBClient {
54
54
  recognizeLink(url: string): Promise<LinkDetails>;
55
55
  private getResourceId;
56
56
  buildResourceUrl(resourceId: string, options?: BuildResourceUrlOptions): string;
57
- reAuth(): void;
57
+ reAuth(auto?: boolean): void;
58
58
  }
@@ -107,5 +107,5 @@ export default class ShareDBDoc extends EventCallbacks<ShareDBDocCallbacks> impl
107
107
  recognizeLink(url: string): Promise<import("../types").LinkDetails>;
108
108
  parseHistoryData(historyData: OnesEditorDocHistoryData, handler: OnesEditorHistoryDataParseHandler): void;
109
109
  getServerMeta(): OnesEditorDocServerMeta;
110
- triggerReAuth(): void;
110
+ triggerReAuth(auto?: boolean): void;
111
111
  }
@@ -1,9 +1,10 @@
1
- import { BlockCommandItem, BlockElement, CommandParams, CommandResult, OnesEditor, OnesEditorCommandProvider, SelectionRange } from '../../../../@ones-editor/core';
1
+ import { CommandItem, BlockElement, CommandParams, CommandResult, OnesEditor, OnesEditorCommandProvider, SelectionRange } from '../../../../@ones-editor/core';
2
2
  declare const TableCommands: readonly ["table/merge-cells", "table/split-cell", "table/insert-column", "table/insert-row", "table/delete-rows", "table/delete-columns", "table/delete"];
3
3
  export type TableCommand = typeof TableCommands[number];
4
4
  export default class TableBlockCommandProvider implements OnesEditorCommandProvider {
5
5
  id: string;
6
- getAvailableCommands(editor: OnesEditor, block: BlockElement, range: SelectionRange): BlockCommandItem[];
7
- executeCommand(editor: OnesEditor, block: BlockElement, range: SelectionRange, command: BlockCommandItem, params: CommandParams, result: CommandResult): boolean;
6
+ groupIndex: number;
7
+ getAvailableCommands(editor: OnesEditor, block: BlockElement, range: SelectionRange): CommandItem[];
8
+ executeCommand(editor: OnesEditor, block: BlockElement, range: SelectionRange, command: CommandItem, params: CommandParams, result?: CommandResult): boolean;
8
9
  }
9
10
  export {};
@@ -5,3 +5,4 @@ import './table-style.scss';
5
5
  import TableShortcuts from './table-block/table-shortcuts';
6
6
  export * from './types';
7
7
  export { TableBlock, TableBlockCommandProvider, TableShortcuts, includeBigTable };
8
+ export type { CreateTableData } from './table-block/table-creator';
@@ -5,6 +5,7 @@ export interface DocTableCellData {
5
5
  col: number;
6
6
  colSpan: number;
7
7
  rowSpan: number;
8
+ background?: string;
8
9
  virtual?: boolean;
9
10
  }
10
11
  export declare class DocTableRow {
@@ -1,5 +1,5 @@
1
1
  import { Closeable, CommandItem, InsertEmptyBlockOptions, OnesEditor } from '../../../../../@ones-editor/core';
2
- interface CreateTableData {
2
+ export interface CreateTableData {
3
3
  colCount?: number;
4
4
  rowCount?: number;
5
5
  }
@@ -6,6 +6,7 @@ export declare class TableCell implements DocTableCellData {
6
6
  col: number;
7
7
  colSpan: number;
8
8
  rowSpan: number;
9
+ background?: string;
9
10
  virtual?: boolean;
10
11
  table: HTMLTableElement;
11
12
  constructor(table: HTMLTableElement, cellData: DocTableCellData);
@@ -1,14 +1,15 @@
1
- import { BlockCommandItem, BlockElement, CommandParams, CommandResult, DocBlockTextAttributes, OnesEditor, OnesEditorCommandProvider, SelectionRange } from '../../../@ones-editor/core';
1
+ import { BlockElement, CommandItem, CommandParams, CommandResult, DocBlockTextAttributes, OnesEditor, OnesEditorCommandProvider, SelectionRange } from '../../../@ones-editor/core';
2
2
  export default class TextCommandProvider implements OnesEditorCommandProvider {
3
3
  private editor;
4
4
  id: string;
5
+ groupIndex: number;
5
6
  private emptyTextBlockAttributes;
6
7
  private colorItem;
7
8
  constructor(editor: OnesEditor);
8
9
  destroy(): void;
9
10
  private updateButtonColor;
10
- getAvailableCommands(editor: OnesEditor, block: BlockElement, range: SelectionRange): BlockCommandItem[];
11
- executeCommand(editor: OnesEditor, block: BlockElement, range: SelectionRange, item: BlockCommandItem, params: CommandParams, result: CommandResult): boolean;
11
+ getAvailableCommands(editor: OnesEditor, block: BlockElement, range: SelectionRange): CommandItem[];
12
+ executeCommand(editor: OnesEditor, block: BlockElement, range: SelectionRange, item: CommandItem, params: CommandParams, result?: CommandResult): boolean;
12
13
  private executeCommandOnEmptyText;
13
14
  private getCommandsOnEmptyText;
14
15
  private setCommandsStates;
@@ -1,4 +1,4 @@
1
- import { BlockCommandItem, BlockElement, CommandParams, CommandResult, OnesEditor, SelectionRange } from '../../../@ones-editor/core';
2
- export declare function getStandardEmptyStyleCommands(editor: OnesEditor, block: BlockElement): BlockCommandItem[];
3
- export declare function getAvailableStyleCommands(editor: OnesEditor, block: BlockElement, range: SelectionRange): BlockCommandItem[];
1
+ import { CommandItem, BlockElement, CommandParams, CommandResult, OnesEditor, SelectionRange } from '../../../@ones-editor/core';
2
+ export declare function getStandardEmptyStyleCommands(editor: OnesEditor, block: BlockElement): CommandItem[];
3
+ export declare function getAvailableStyleCommands(editor: OnesEditor, block: BlockElement, range: SelectionRange): CommandItem[];
4
4
  export declare function executeStyleCommand(editor: OnesEditor, block: BlockElement, range: SelectionRange, command: string, params: CommandParams, result: CommandResult): boolean;
@@ -6,10 +6,16 @@ export declare function styleColorToColor(color: string | undefined): "d83931" |
6
6
  * @param color
7
7
  * @returns
8
8
  */
9
- export declare function styleBackgroundColorToHighlight(color: string | undefined): "yellow" | "magenta" | "green" | "blue" | "lightGray" | "red" | "darkGreen" | "darkMagenta" | "darkGray" | undefined;
9
+ export declare function styleBackgroundColorToHighlight(color: string | undefined): "green" | "red" | "blue" | "yellow" | "magenta" | "lightGray" | "darkGreen" | "darkMagenta" | "darkGray" | undefined;
10
10
  export declare function styleBackgroundColorToHex(color: string | undefined): "fbbab6" | "ffdcb0" | "fff7a0" | "ceefc5" | "d1ddfb" | "d9cbf8" | "eaeaea" | "fe837c" | "ffbd6a" | "ffe662" | "a8f393" | "98b5ff" | "b394f8" | "b1b1b1" | undefined;
11
11
  /**
12
12
  * 将rgb(rrr,ggg,bbb)格式的颜色转为RRGGBB格式
13
13
  * #RRGGBB 转为 RRGGBB
14
14
  */
15
15
  export declare function colorToHex(color: any): string | undefined;
16
+ /**
17
+ * 判断是否是合法的 Hex 格式颜色值
18
+ * @param color
19
+ * @returns
20
+ */
21
+ export declare function isValidHexColor(color: string): boolean;
@@ -1,5 +1,6 @@
1
1
  import { DocBlock, DocObject } from '../../../../@ones-editor/core';
2
2
  import { CalcCell } from './table';
3
+ import { CalcCol } from './layout';
3
4
  import { BlockObject, CodeObject, ExportState, GetDocByBlockFunc, GetTextsByBoxFunc, MD5Func } from './types';
4
5
  /**
5
6
  * 生成docx/html blocks的接口
@@ -20,6 +21,7 @@ export interface BlocksGenerator {
20
21
  addTableMatrix(colsWidth: number[], matrix: CalcCell[][], data: DocObject): Promise<void>;
21
22
  addVirtualBlock(blockId: string, data: DocObject, maxWidth: number): Promise<void>;
22
23
  addEmptyParagraph(): void;
24
+ addLayoutMatrix(colsWidth: number[], matrix: CalcCol[], data: DocObject): Promise<void>;
23
25
  }
24
26
  export declare function convertBlocksOfDoc(parent: string, // 父节点,暂时只有list block需要这个
25
27
  blocks: DocBlock[], data: DocObject, // 协作笔记里的block数组
@@ -0,0 +1,10 @@
1
+ import { DocBlock } from '../../../../@ones-editor/core';
2
+ export interface CalcCol {
3
+ cellId: string | undefined;
4
+ originalWidth: number;
5
+ width: number;
6
+ }
7
+ /**
8
+ * 处理分栏数据结构:实际就是一行多列的表格数据
9
+ */
10
+ export declare function buildLayoutMatrix(block: DocBlock, maxWidth: number): CalcCol[];
@@ -13,4 +13,5 @@ export declare class OnesEditorToc {
13
13
  private appendBlock;
14
14
  private findParent;
15
15
  static buildToc(editor: OnesEditor, doc: DocObject): OnesEditorToc;
16
+ static isTocContainer(editor: OnesEditor, containerID: string): boolean;
16
17
  }