@ones-editor/editor 0.0.3-beta.99 → 0.0.4

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 (202) hide show
  1. package/@ones-editor/block-locker/src/hook.d.ts +1 -1
  2. package/@ones-editor/block-locker/src/i18n/ja-JP.d.ts +8 -0
  3. package/@ones-editor/block-menu/src/block-menu/index.d.ts +2 -1
  4. package/@ones-editor/block-menu/src/block-menu/items/insert-block-items/index.d.ts +3 -2
  5. package/@ones-editor/block-menu/src/block-menu/items/text-styles/text-style-item.d.ts +3 -0
  6. package/@ones-editor/block-menu/src/block-menu-button/drag-drop/drag-handler.d.ts +5 -4
  7. package/@ones-editor/block-menu/src/block-menu-button/drag-preview/index.d.ts +2 -2
  8. package/@ones-editor/block-menu/src/locale/en-us.d.ts +4 -0
  9. package/@ones-editor/block-menu/src/locale/ja-jp.d.ts +25 -0
  10. package/@ones-editor/block-menu/src/locale/zh-cn.d.ts +4 -0
  11. package/@ones-editor/block-resizer/src/index.d.ts +1 -0
  12. package/@ones-editor/code-block/src/index.d.ts +1 -0
  13. package/@ones-editor/comments/src/comment-input-handler/paste-handler.d.ts +5 -0
  14. package/@ones-editor/comments/src/comment-item/comment-item.d.ts +1 -0
  15. package/@ones-editor/comments/src/comment-item/mobile-comment-item/mobile-comment-item.d.ts +1 -0
  16. package/@ones-editor/comments/src/comments-helper/active-comment.d.ts +1 -1
  17. package/@ones-editor/comments/src/comments-list/comments-list.d.ts +1 -1
  18. package/@ones-editor/comments/src/comments-list/group-list.d.ts +2 -2
  19. package/@ones-editor/comments/src/comments-list/mini-comment/group-list.d.ts +1 -0
  20. package/@ones-editor/comments/src/locale/en-us.d.ts +2 -0
  21. package/@ones-editor/comments/src/locale/ja-jp.d.ts +3 -0
  22. package/@ones-editor/comments/src/locale/zh-cn.d.ts +3 -0
  23. package/@ones-editor/comments/src/text-comments/comments-command-provider.d.ts +1 -0
  24. package/@ones-editor/comments/src/types.d.ts +3 -0
  25. package/@ones-editor/core/src/core/block-renderers/standard-block-render.d.ts +2 -0
  26. package/@ones-editor/core/src/core/boxes/anchor-box/index.d.ts +3 -0
  27. package/@ones-editor/core/src/core/boxes/editor-boxes.d.ts +1 -0
  28. package/@ones-editor/core/src/core/boxes/image-box/index.d.ts +3 -0
  29. package/@ones-editor/core/src/core/boxes/index.d.ts +3 -1
  30. package/@ones-editor/core/src/core/composition/editor-input.d.ts +4 -3
  31. package/@ones-editor/core/src/core/containers/root-container.d.ts +1 -0
  32. package/@ones-editor/core/src/core/data-converter/editor-data-converter.d.ts +4 -2
  33. package/@ones-editor/core/src/core/doc/doc.d.ts +6 -1
  34. package/@ones-editor/core/src/core/editor/actions/add-text-attribute.d.ts +2 -2
  35. package/@ones-editor/core/src/core/editor/actions/insert-text.d.ts +1 -0
  36. package/@ones-editor/core/src/core/editor/actions/is-writable.d.ts +1 -1
  37. package/@ones-editor/core/src/core/editor-doc/editor-doc.d.ts +5 -1
  38. package/@ones-editor/core/src/core/input-handler/input-handler.d.ts +2 -2
  39. package/@ones-editor/core/src/core/selection/select-handler.d.ts +5 -1
  40. package/@ones-editor/core/src/core/types.d.ts +21 -7
  41. package/@ones-editor/core/src/core/undo-manager/actions/action.d.ts +4 -1
  42. package/@ones-editor/core/src/i18n/en-us.d.ts +3 -0
  43. package/@ones-editor/core/src/i18n/i18n.d.ts +12 -2
  44. package/@ones-editor/core/src/i18n/ja-jp.d.ts +3 -0
  45. package/@ones-editor/core/src/i18n/zh-cn.d.ts +3 -0
  46. package/@ones-editor/core/src/local-doc/index.d.ts +5 -1
  47. package/@ones-editor/core/src/utils/abbreviation.d.ts +27 -0
  48. package/@ones-editor/core/src/utils/client.d.ts +1 -0
  49. package/@ones-editor/core/src/utils/dom.d.ts +1 -0
  50. package/@ones-editor/core/src/utils/index.d.ts +2 -0
  51. package/@ones-editor/core/src/utils/overflow-text.d.ts +1 -0
  52. package/@ones-editor/drawio-embed/src/drawio-embed.d.ts +1 -0
  53. package/@ones-editor/drawio-embed/src/helper/index.d.ts +13 -7
  54. package/@ones-editor/drawio-embed/src/lang/en-us.d.ts +9 -4
  55. package/@ones-editor/drawio-embed/src/lang/index.d.ts +1 -1
  56. package/@ones-editor/drawio-embed/src/lang/ja-jp.d.ts +12 -0
  57. package/@ones-editor/drawio-embed/src/lang/zh-cn.d.ts +9 -4
  58. package/@ones-editor/drawio-embed/types/index.d.ts +1 -1
  59. package/@ones-editor/drop-target/src/drop-target.d.ts +2 -0
  60. package/@ones-editor/embed-block-helper/src/index.d.ts +1 -0
  61. package/@ones-editor/embed-block-helper/src/locale/en-us.d.ts +7 -0
  62. package/@ones-editor/embed-block-helper/src/locale/index.d.ts +1 -0
  63. package/@ones-editor/embed-block-helper/src/locale/ja-jp.d.ts +7 -0
  64. package/@ones-editor/embed-block-helper/src/locale/zh-cn.d.ts +7 -0
  65. package/@ones-editor/exclusive-block/src/exclusive-block-hook.d.ts +1 -1
  66. package/@ones-editor/exclusive-block/src/exclusive-dom.d.ts +1 -1
  67. package/@ones-editor/exclusive-block/src/index.d.ts +2 -0
  68. package/@ones-editor/exclusive-block/src/locale/en-us.d.ts +7 -0
  69. package/@ones-editor/exclusive-block/src/locale/index.d.ts +1 -0
  70. package/@ones-editor/exclusive-block/src/locale/ja-jp.d.ts +7 -0
  71. package/@ones-editor/exclusive-block/src/locale/zh-cn.d.ts +7 -0
  72. package/@ones-editor/file/src/index.d.ts +1 -0
  73. package/@ones-editor/file/src/locale/en-us.d.ts +12 -0
  74. package/@ones-editor/file/src/locale/index.d.ts +1 -0
  75. package/@ones-editor/file/src/locale/ja-jp.d.ts +12 -0
  76. package/@ones-editor/file/src/locale/zh-cn.d.ts +12 -0
  77. package/@ones-editor/file/src/types.d.ts +2 -1
  78. package/@ones-editor/find-dialog/src/doc/doc-handler.d.ts +15 -0
  79. package/@ones-editor/find-dialog/src/find-dialog.d.ts +4 -1
  80. package/@ones-editor/find-dialog/src/highlights/highligh-text.d.ts +3 -0
  81. package/@ones-editor/find-dialog/src/highlights/highlight-dom.d.ts +1 -0
  82. package/@ones-editor/find-dialog/src/locale/ja-jp.d.ts +13 -0
  83. package/@ones-editor/graph-embed/assets/index.d.ts +2 -0
  84. package/@ones-editor/graph-embed/src/helper/graph-base.d.ts +6 -1
  85. package/@ones-editor/graph-embed/src/helper/graph-block-commands.d.ts +1 -0
  86. package/@ones-editor/graph-embed/src/lang/en-us.d.ts +3 -0
  87. package/@ones-editor/graph-embed/src/lang/ja-jp.d.ts +3 -0
  88. package/@ones-editor/graph-embed/src/lang/zh-cn.d.ts +3 -0
  89. package/@ones-editor/heading-collapse/src/index.d.ts +1 -0
  90. package/@ones-editor/heading-collapse/src/locale/en-us.d.ts +7 -0
  91. package/@ones-editor/heading-collapse/src/locale/index.d.ts +1 -0
  92. package/@ones-editor/heading-collapse/src/locale/ja-jp.d.ts +7 -0
  93. package/@ones-editor/heading-collapse/src/locale/zh-cn.d.ts +7 -0
  94. package/@ones-editor/html-to-doc/src/html-to-doc/normal-html/code.d.ts +1 -0
  95. package/@ones-editor/image-embed/src/drag-drop/drag-handler.d.ts +6 -3
  96. package/@ones-editor/image-embed/src/image-data.d.ts +4 -2
  97. package/@ones-editor/image-embed/src/image-file.d.ts +0 -1
  98. package/@ones-editor/image-embed/src/image-object.d.ts +1 -0
  99. package/@ones-editor/image-embed/src/index.d.ts +3 -1
  100. package/@ones-editor/image-embed/src/locale/en-us.d.ts +1 -0
  101. package/@ones-editor/image-embed/src/locale/ja-jp.d.ts +17 -0
  102. package/@ones-editor/image-embed/src/locale/zh-cn.d.ts +1 -0
  103. package/@ones-editor/image-embed/src/shortcuts/image-clipboard-data.d.ts +5 -3
  104. package/@ones-editor/image-embed/src/shortcuts/index.d.ts +2 -2
  105. package/@ones-editor/image-embed/src/types.d.ts +1 -1
  106. package/@ones-editor/input-handlers/src/i18n/ja-jp.d.ts +11 -0
  107. package/@ones-editor/input-handlers/src/index.d.ts +2 -2
  108. package/@ones-editor/input-handlers/src/markdown-shortcuts/index.d.ts +2 -1
  109. package/@ones-editor/input-handlers/src/markdown-shortcuts/match-block-convert.d.ts +1 -0
  110. package/@ones-editor/list-block/src/index.d.ts +7 -4
  111. package/@ones-editor/list-block/src/keyboard/shortcut.d.ts +3 -0
  112. package/@ones-editor/list-block/src/lang/ja-jp.d.ts +21 -0
  113. package/@ones-editor/list-block/src/mindmap/to-mindmap/index.d.ts +2 -0
  114. package/@ones-editor/list-block/src/utils/list-parent.d.ts +1 -0
  115. package/@ones-editor/mathjax/src/locale/ja-jp.d.ts +7 -0
  116. package/@ones-editor/mathjax/src/mathjax-box/mathjax-editor.d.ts +16 -0
  117. package/@ones-editor/media-embed/src/core/media.d.ts +1 -0
  118. package/@ones-editor/media-embed/src/core/video-resizer.d.ts +1 -0
  119. package/@ones-editor/media-embed/src/locale/ja-jp.d.ts +19 -0
  120. package/@ones-editor/media-embed/src/utils/file.d.ts +0 -1
  121. package/@ones-editor/mention/src/index.d.ts +1 -0
  122. package/@ones-editor/mention/src/locale/en-us.d.ts +6 -0
  123. package/@ones-editor/mention/src/locale/index.d.ts +1 -0
  124. package/@ones-editor/mention/src/locale/ja-jp.d.ts +6 -0
  125. package/@ones-editor/mention/src/locale/zh-cn.d.ts +6 -0
  126. package/@ones-editor/mention/src/mention.d.ts +1 -0
  127. package/@ones-editor/paste-handler/src/text-data-converter.d.ts +2 -2
  128. package/@ones-editor/paste-special/src/index.d.ts +1 -0
  129. package/@ones-editor/paste-special/src/locale/en-us.d.ts +8 -0
  130. package/@ones-editor/paste-special/src/locale/index.d.ts +1 -0
  131. package/@ones-editor/paste-special/src/locale/ja-jp.d.ts +8 -0
  132. package/@ones-editor/paste-special/src/locale/zh-cn.d.ts +8 -0
  133. package/@ones-editor/scroll-container/src/dom-utils.d.ts +0 -1
  134. package/@ones-editor/scroll-container/src/types.d.ts +2 -1
  135. package/@ones-editor/scroll-container/src/utils.d.ts +1 -0
  136. package/@ones-editor/sharedb-doc/src/doc/op-parser/parse-handler.d.ts +25 -0
  137. package/@ones-editor/sharedb-doc/src/doc/sharedb-doc.d.ts +6 -2
  138. package/@ones-editor/table-block/src/locale/ja-jp.d.ts +27 -0
  139. package/@ones-editor/table-block/src/table-block/border-bar/table-border-bar-handler.d.ts +14 -1
  140. package/@ones-editor/table-block/src/table-block/border-bar/table-border-bar-scroll.d.ts +2 -0
  141. package/@ones-editor/table-block/src/table-block/border-bar/table-border-bar.d.ts +2 -1
  142. package/@ones-editor/table-block/src/table-block/doc-change-handler.d.ts +2 -0
  143. package/@ones-editor/table-block/src/table-block/doc-table-data.d.ts +1 -1
  144. package/@ones-editor/table-block/src/table-block/table-scroll-events.d.ts +1 -0
  145. package/@ones-editor/table-block/src/types.d.ts +4 -1
  146. package/@ones-editor/templates/src/locale/ja-jp.d.ts +9 -0
  147. package/@ones-editor/text-commands/src/index.d.ts +2 -1
  148. package/@ones-editor/text-commands/src/locale/en-us.d.ts +0 -14
  149. package/@ones-editor/text-commands/src/locale/ja-jp.d.ts +13 -0
  150. package/@ones-editor/text-commands/src/locale/zh-cn.d.ts +0 -14
  151. package/@ones-editor/text-commands/src/shortcut-handler.d.ts +2 -0
  152. package/@ones-editor/text-commands/src/text-command-provider.d.ts +0 -1
  153. package/@ones-editor/to-docx/src/doc2other/core.d.ts +1 -1
  154. package/@ones-editor/toc/src/build-toc.d.ts +4 -2
  155. package/@ones-editor/toc/src/heading-scroll/index.d.ts +2 -2
  156. package/@ones-editor/toc/src/index.d.ts +1 -0
  157. package/@ones-editor/toc/src/locale/ja-jp.d.ts +6 -0
  158. package/@ones-editor/toc/src/toc-provider.d.ts +2 -1
  159. package/@ones-editor/toc/src/types.d.ts +3 -0
  160. package/@ones-editor/tsconfig.tsbuildinfo +1 -1
  161. package/@ones-editor/ui/src/index.d.ts +5 -3
  162. package/@ones-editor/ui/src/locale/en-us.d.ts +10 -20
  163. package/@ones-editor/ui/src/locale/ja-jp.d.ts +43 -0
  164. package/@ones-editor/ui/src/locale/zh-cn.d.ts +2 -12
  165. package/@ones-editor/ui/src/quick-menu/basic-menu-items.d.ts +3 -0
  166. package/@ones-editor/ui/src/quick-menu/quick-menu-items.d.ts +4 -1
  167. package/@ones-editor/ui/src/toolbar/helper.d.ts +1 -1
  168. package/@ones-editor/ui/src/tooltips/index.d.ts +1 -0
  169. package/@ones-editor/ui-base/src/auto-suggest/auto-suggest-menu.d.ts +10 -4
  170. package/@ones-editor/ui-base/src/auto-suggest/auto-suggest.d.ts +5 -0
  171. package/@ones-editor/ui-base/src/command-bar/command-bar.d.ts +5 -2
  172. package/@ones-editor/ui-base/src/command-bar/manual-command-bar.d.ts +2 -1
  173. package/@ones-editor/ui-base/src/command-bar/types.d.ts +7 -3
  174. package/@ones-editor/ui-base/src/components/button.d.ts +1 -1
  175. package/@ones-editor/ui-base/src/components/checkbox.d.ts +3 -0
  176. package/@ones-editor/ui-base/src/components/index.d.ts +2 -0
  177. package/@ones-editor/ui-base/src/components/loading.d.ts +2 -0
  178. package/@ones-editor/ui-base/src/dropdown/index.d.ts +3 -0
  179. package/@ones-editor/ui-base/src/icons/index.d.ts +6 -1
  180. package/@ones-editor/ui-base/src/locale/ja-jp.d.ts +1 -1
  181. package/@ones-editor/ui-base/src/locale/zh-cn.d.ts +1 -1
  182. package/@ones-editor/versions/src/history-doc/history-doc.d.ts +2 -1
  183. package/@ones-editor/versions/src/locale/en-us.d.ts +25 -1
  184. package/@ones-editor/versions/src/locale/ja-jp.d.ts +44 -0
  185. package/@ones-editor/versions/src/locale/zh-cn.d.ts +25 -1
  186. package/@ones-editor/versions/src/types.d.ts +3 -1
  187. package/@ones-editor/versions/src/version-dialog/index.d.ts +6 -1
  188. package/@ones-editor/versions/src/version-dialog/size-limit-textarea.d.ts +2 -0
  189. package/@ones-editor/versions/src/version-dialog/version-info-header.d.ts +1 -1
  190. package/@ones-editor/versions/src/version-dialog/version-list.d.ts +7 -1
  191. package/@ones-editor/versions/src/version-dialog/versions-dropdown.d.ts +1 -0
  192. package/@ones-editor/webpage-embed/src/locale/en-us.d.ts +6 -0
  193. package/@ones-editor/webpage-embed/src/locale/ja-jp.d.ts +27 -0
  194. package/@ones-editor/webpage-embed/src/locale/zh-cn.d.ts +6 -0
  195. package/@ones-editor/webpage-embed/src/types.d.ts +1 -0
  196. package/dist/comments/create-comment-editor.d.ts +1 -1
  197. package/dist/index.d.ts +8 -1
  198. package/dist/index.js +273 -196
  199. package/dist/types.d.ts +4 -1
  200. package/dist/versions/versions-provider.d.ts +1 -1
  201. package/package.json +2 -1
  202. package/@ones-editor/block-menu/src/icons/index.d.ts +0 -4
@@ -2,7 +2,7 @@ import { BlockCommands, BlockElement, BlockPath, CommandItem, ContainerElement,
2
2
  export default class BlockLockerHook implements OnesEditorBlockHook {
3
3
  create(editor: OnesEditor, path: BlockPath, container: ContainerElement, blockElement: BlockElement, blockData: DocBlock): void;
4
4
  update(editor: OnesEditor, path: BlockPath, container: ContainerElement, blockElement: BlockElement, blockData: DocBlock): void;
5
- writable(editor: OnesEditor, blockElement: BlockElement): boolean | undefined;
5
+ writable(editor: OnesEditor, blockElement: BlockElement | BlockElement[]): boolean | undefined;
6
6
  commands(editor: OnesEditor, blockElement: BlockElement): BlockCommands;
7
7
  executeCommand: (editor: OnesEditor, blockElement: BlockElement, item: CommandItem) => void;
8
8
  }
@@ -0,0 +1,8 @@
1
+ declare const _default: {
2
+ locker: {
3
+ lock: string;
4
+ unlock: string;
5
+ lockedBy: string;
6
+ };
7
+ };
8
+ export default _default;
@@ -1,11 +1,12 @@
1
1
  import { BlockElement, OnesEditor, CommandItem } from '../../../../@ones-editor/core';
2
+ import type { ManualShowCommandBarOptions } from '../../../../@ones-editor/ui-base';
2
3
  export default class BlockMenu {
3
4
  private editor;
4
5
  private menu;
5
6
  currentBlock: BlockElement | null;
6
7
  private commandBlock;
7
8
  constructor(editor: OnesEditor);
8
- show(target: HTMLElement): void;
9
+ show(target: HTMLElement, options?: ManualShowCommandBarOptions): void;
9
10
  isInMenu(eventTarget: EventTarget | null): boolean;
10
11
  handleShow: () => void;
11
12
  handleClose: () => void;
@@ -1,4 +1,5 @@
1
1
  import { BlockElement, OnesEditor } from '../../../../../../@ones-editor/core';
2
- import { BlockMenuItem } from '../types';
3
- export declare function getAllInsertBlockItems(editor: OnesEditor, source: 'insert-block' | 'insert-block-before'): BlockMenuItem[];
2
+ import type { GetAllQuickMenuItemsOptions } from '../../../../../../@ones-editor/ui';
3
+ import type { BlockMenuItem } from '../types';
4
+ export declare function getAllInsertBlockItems(editor: OnesEditor, source: 'insert-block' | 'insert-block-before', options?: GetAllQuickMenuItemsOptions): BlockMenuItem[];
4
5
  export declare function executeInsertBlockCommand(editor: OnesEditor, block: BlockElement, item: BlockMenuItem, insertAbove?: boolean): Promise<BlockElement | null> | undefined;
@@ -8,6 +8,7 @@ export interface ParagraphBlockAttribute extends DocBlock {
8
8
  ordered?: boolean;
9
9
  }
10
10
  export type TextStyleItemOptions = {
11
+ fromEmbed?: boolean;
11
12
  onAfterStyleItemClick?: () => void;
12
13
  };
13
14
  export default class TextStyleItem implements BlockMenuItem {
@@ -18,10 +19,12 @@ export default class TextStyleItem implements BlockMenuItem {
18
19
  id: string;
19
20
  name: string;
20
21
  element: HTMLElement;
22
+ private textStylesTooltips;
21
23
  constructor(editor: OnesEditor, block: BlockElement, options: TextStyleItemOptions);
22
24
  createItemElement(editor: OnesEditor, block: BlockElement): HTMLDivElement;
23
25
  private createHeadingItemElement;
24
26
  private createListItemElement;
25
27
  createItem(id: string, icon: string, parent: HTMLElement, active?: boolean): void;
26
28
  handleClick: (editor: OnesEditor, event: Event) => void;
29
+ private calcTextStyleItemTooltipsEnum;
27
30
  }
@@ -5,16 +5,17 @@ export default class BlockMenuButtonDragHandler {
5
5
  private editor;
6
6
  private button;
7
7
  dragPreview: DragPreviewImage;
8
- autoScroll: AutoScroll;
8
+ autoScroll: AutoScroll | undefined;
9
9
  oldPos: {
10
10
  x: number;
11
11
  y: number;
12
12
  };
13
13
  constructor(editor: OnesEditor, button: OnesEditorBlockMenuButton);
14
14
  destroy(): void;
15
- handleDragStart: (event: DragEvent) => void;
16
- handleDrag: (event: DragEvent) => void;
17
- handleDragEnd: () => void;
15
+ handleMouseDown: (event: MouseEvent) => void;
16
+ handleDragStart: (event: MouseEvent) => void;
17
+ handleDrag: (event: MouseEvent) => void;
18
+ handleDragEnd: (event: MouseEvent) => void;
18
19
  }
19
20
  declare global {
20
21
  interface Window {
@@ -4,7 +4,7 @@ export declare class DragPreviewImage {
4
4
  private startPosition;
5
5
  constructor(editor: OnesEditor);
6
6
  private dragContainer;
7
- handleDragStart: (e: DragEvent, preview: HTMLElement) => Promise<void>;
8
- handleDrag: (e: DragEvent) => void;
7
+ handleDragStart: (e: MouseEvent, preview: HTMLElement) => Promise<void>;
8
+ handleDrag: (e: MouseEvent) => void;
9
9
  handleDragEnd: () => void;
10
10
  }
@@ -11,10 +11,14 @@ declare const _default: {
11
11
  command: {
12
12
  insertAbove: string;
13
13
  insertAfter: string;
14
+ copy: string;
15
+ cut: string;
16
+ delete: string;
14
17
  };
15
18
  button: {
16
19
  searchPlaceholder: string;
17
20
  tips: string;
21
+ insertTips: string;
18
22
  };
19
23
  };
20
24
  };
@@ -0,0 +1,25 @@
1
+ declare const _default: {
2
+ blockMenu: {
3
+ section: {
4
+ basics: string;
5
+ system: string;
6
+ styles: string;
7
+ common: string;
8
+ actions: string;
9
+ thirdParty: string;
10
+ };
11
+ command: {
12
+ insertAbove: string;
13
+ insertAfter: string;
14
+ copy: string;
15
+ cut: string;
16
+ delete: string;
17
+ };
18
+ button: {
19
+ searchPlaceholder: string;
20
+ tips: string;
21
+ insertTips: string;
22
+ };
23
+ };
24
+ };
25
+ export default _default;
@@ -11,10 +11,14 @@ declare const _default: {
11
11
  command: {
12
12
  insertAbove: string;
13
13
  insertAfter: string;
14
+ copy: string;
15
+ cut: string;
16
+ delete: string;
14
17
  };
15
18
  button: {
16
19
  searchPlaceholder: string;
17
20
  tips: string;
21
+ insertTips: string;
18
22
  };
19
23
  };
20
24
  };
@@ -19,6 +19,7 @@ export declare class BlockResizer extends TypedEmitter<BlockResizerEvents> {
19
19
  enableResize(block: BlockElement, resizableElement?: HTMLElement): void;
20
20
  disableResize(): void;
21
21
  update(block: BlockElement, resizableElement?: HTMLElement): void;
22
+ updateResizer(): void;
22
23
  getBlock(): BlockElement | null;
23
24
  destroy(): void;
24
25
  private getResizableElement;
@@ -2,3 +2,4 @@ import { CodeBlock, CodeLineBlock, CodeTextDecorator } from './code-block';
2
2
  import './locale';
3
3
  export * from './code-block/types';
4
4
  export { CodeBlock, CodeLineBlock, CodeTextDecorator };
5
+ export { isCodeBlock } from './code-block/code-block-dom';
@@ -0,0 +1,5 @@
1
+ import { DocObject } from '../../../../@ones-editor/core';
2
+ import type { OnesEditor, OnesEditorInputHandler } from '../../../../@ones-editor/core';
3
+ export declare class CommentPasteHandler implements OnesEditorInputHandler {
4
+ handleBeforePasteDoc(editor: OnesEditor, doc: DocObject): Promise<boolean>;
5
+ }
@@ -23,6 +23,7 @@ export declare class CommentItem {
23
23
  get doc(): import("@ones-editor/core").DocObject;
24
24
  private createRoot;
25
25
  private createMoreMenu;
26
+ private createAvatar;
26
27
  private createItem;
27
28
  private handleMore;
28
29
  private handleMoreMenuItemShow;
@@ -10,6 +10,7 @@ export declare class MobileCommentItem {
10
10
  private components;
11
11
  constructor(editor: OnesEditor, commentsProvider: OnesEditorCommentsProvider, comment: OnesEditorComment);
12
12
  private get doc();
13
+ private createAvatar;
13
14
  createItem(): {
14
15
  mobileCommentEditor: CommentEditor;
15
16
  };
@@ -1,2 +1,2 @@
1
1
  import { OnesEditor } from '../../../../@ones-editor/core';
2
- export declare function activeComment(editor: OnesEditor, commentId: string): void;
2
+ export declare function activeComment(editor: OnesEditor, commentId: string, direction?: 'prev' | 'next'): void;
@@ -20,7 +20,7 @@ export default class CommentsList extends TypedEmitter<CommentsListEvents> imple
20
20
  createList(): CommentGroupList;
21
21
  handleSelectionOnComment: () => void;
22
22
  updateCommentCount: () => void;
23
- handleActiveItemChanged: () => void;
23
+ handleActiveItemChanged: (index: number, direction?: 'prev' | 'next') => void;
24
24
  handleItemLayoutUpdated: () => void;
25
25
  show(groupId?: string): void;
26
26
  hide(): void;
@@ -4,7 +4,7 @@ import { CommentGroupItem } from './group-item';
4
4
  import ListBase from './list-base';
5
5
  import { CommentGroupItemHandlers } from './handler';
6
6
  export interface CommentGroupListEvents {
7
- activeItemChanged: (index: number) => void;
7
+ activeItemChanged: (index: number, direction?: 'prev' | 'next') => void;
8
8
  itemLayoutUpdated: () => void;
9
9
  selectionOnComment: () => void;
10
10
  commentCountChanged: () => void;
@@ -21,7 +21,7 @@ export default class CommentGroupList extends ListBase<CommentWithChildren, Comm
21
21
  insertItem(data: CommentWithChildren, options?: {
22
22
  active: boolean;
23
23
  }): CommentGroupItem | null;
24
- setActiveItem(index: number): void;
24
+ setActiveItem(index: number, direction?: 'prev' | 'next'): void;
25
25
  get activeIndex(): number;
26
26
  get activeItem(): CommentGroupItem | null;
27
27
  findGroupItem: (groupId: string) => CommentGroupItem | undefined;
@@ -6,6 +6,7 @@ export declare class MiniGroupList extends ListBase<MiniCommentGroup, MiniGroupI
6
6
  protected editor: OnesEditor;
7
7
  protected commentsProvider: OnesEditorCommentsProvider;
8
8
  constructor(editor: OnesEditor, commentsProvider: OnesEditorCommentsProvider, parent: HTMLElement);
9
+ private fixListOps;
9
10
  protected createItem(data: MiniCommentGroup): MiniGroupItem;
10
11
  protected findInsertPos(): number;
11
12
  private handleDocChanged;
@@ -17,6 +17,8 @@ declare const _default: {
17
17
  isLast: string;
18
18
  more: string;
19
19
  comment: string;
20
+ command: string;
21
+ quickMenuCommand: string;
20
22
  };
21
23
  };
22
24
  export default _default;
@@ -15,7 +15,10 @@ declare const _default: {
15
15
  replyTitle: string;
16
16
  isFirst: string;
17
17
  isLast: string;
18
+ more: string;
18
19
  comment: string;
20
+ command: string;
21
+ quickMenuCommand: string;
19
22
  };
20
23
  };
21
24
  export default _default;
@@ -15,7 +15,10 @@ declare const _default: {
15
15
  replyTitle: string;
16
16
  isFirst: string;
17
17
  isLast: string;
18
+ more: string;
18
19
  comment: string;
20
+ command: string;
21
+ quickMenuCommand: string;
19
22
  };
20
23
  };
21
24
  export default _default;
@@ -7,5 +7,6 @@ export default class CommentsCommandProvider implements OnesEditorCommandProvide
7
7
  id: string;
8
8
  constructor(provider: OnesEditorCommentsProvider, editorComments: OnesEditorComments);
9
9
  getAvailableCommands(editor: OnesEditor, block: BlockElement, range: SelectionRange): BlockCommandItem[];
10
+ hideToolbar(editor: OnesEditor): void;
10
11
  executeRangeCommand(editor: OnesEditor, range: SelectionRange, command: BlockCommandItemWithSource, params: CommandParams, result: CommandResult): boolean;
11
12
  }
@@ -18,6 +18,9 @@ export interface OnesEditorCommentOptions {
18
18
  onUpdateLayout?: (editor: OnesEditor, data: CommentData) => void;
19
19
  onCommentCountChange?: (count: number) => void;
20
20
  onCommentEditorClick?: (editor: OnesEditor, event: MouseEvent) => void;
21
+ componentsOptions?: {
22
+ [index: string]: unknown;
23
+ };
21
24
  }
22
25
  export interface OnesEditorCommentsEvents {
23
26
  onCreateComment: (commentId: string, local: boolean) => void;
@@ -1,6 +1,8 @@
1
1
  import AttributeMap from 'quill-delta/dist/AttributeMap';
2
2
  import { DocBlock } from '../doc';
3
3
  import { BlockElement, BlockPath, OnesEditor, OnesEditorBlockRenderer, OnesEditorBlockRenderResult } from '../types';
4
+ export type CSSCustomProperties = Record<`--${string}`, string>;
5
+ export type CSSStyles = Partial<CSSStyleDeclaration> & CSSCustomProperties;
4
6
  export declare class StandardBlockRenderer implements OnesEditorBlockRenderer {
5
7
  renderText(editor: OnesEditor, path: BlockPath, attributes: AttributeMap): OnesEditorBlockRenderResult;
6
8
  renderBlock(editor: OnesEditor, path: BlockPath, blockData: DocBlock): OnesEditorBlockRenderResult;
@@ -0,0 +1,3 @@
1
+ import type { Box } from '../../types';
2
+ declare const AnchorBox: Box;
3
+ export default AnchorBox;
@@ -7,4 +7,5 @@ export default class EditorBoxes {
7
7
  registerBoxClass(boxClass: Box): void;
8
8
  getBoxClass(type: string): Box;
9
9
  createBox(blockContent: BlockContentElement, box: DocBox): BoxElement;
10
+ forEach(callback: (blockClass: Box) => void): void;
10
11
  }
@@ -0,0 +1,3 @@
1
+ import { Box } from '../../types';
2
+ declare const ImageBox: Box;
3
+ export default ImageBox;
@@ -1,4 +1,6 @@
1
1
  import TextBox from './text-box';
2
2
  import BrBox from './br-box';
3
3
  import EditorBoxes from './editor-boxes';
4
- export { EditorBoxes, TextBox, BrBox };
4
+ import ImageBox from './image-box';
5
+ import AnchorBox from './anchor-box';
6
+ export { EditorBoxes, TextBox, BrBox, ImageBox, AnchorBox };
@@ -1,4 +1,4 @@
1
- import { OnesEditorInput, OnesEditor, OnesEditorInputHandler, OnesEditorUndoAction, RemoteChangeType } from '../types';
1
+ import { OnesEditorInput, OnesEditor, OnesEditorInputHandler, OnesEditorUndoAction, RemoteChangeType, PasteOptions } from '../types';
2
2
  import { DocObject } from '../doc';
3
3
  export interface EditorInputCallbacks {
4
4
  onInsertText: (event: Event, text: string) => void;
@@ -10,7 +10,7 @@ export interface EditorInputCallbacks {
10
10
  onFocus: () => void;
11
11
  onBlur: () => void;
12
12
  onPaste: (event: ClipboardEvent) => void;
13
- onPasteText: (text: string) => void;
13
+ onPasteText: (text: string, options?: PasteOptions) => void;
14
14
  onCopy: (event: ClipboardEvent) => void;
15
15
  onCut: (event: ClipboardEvent) => void;
16
16
  addHandler: (handler: OnesEditorInputHandler) => void;
@@ -29,6 +29,7 @@ export declare class EditorInput implements OnesEditorInput {
29
29
  destroy(): void;
30
30
  getInput(): HTMLInputElement;
31
31
  focus(): void;
32
+ handleDocumentClick: (event: MouseEvent) => void;
32
33
  handleDocumentSelectionChange: () => void;
33
34
  handleEditorSelectionChanged: () => void;
34
35
  handleReadonlyChanged: () => void;
@@ -39,7 +40,7 @@ export declare class EditorInput implements OnesEditorInput {
39
40
  handleCopy: (event: ClipboardEvent) => void;
40
41
  handleCut: (event: ClipboardEvent) => void;
41
42
  handlePaste: (event: ClipboardEvent) => void;
42
- handlePasteText: (text: string) => void;
43
+ handlePasteText: (text: string, options?: PasteOptions) => void;
43
44
  handleChanged(action: OnesEditorUndoAction): void;
44
45
  handleRemoteChanged(type: RemoteChangeType): void;
45
46
  addHandler(handler: OnesEditorInputHandler): void;
@@ -1,3 +1,4 @@
1
+ import ResizeObserver from 'resize-observer-polyfill';
1
2
  import { OnesEditor, ContainerElement, BlockElement } from '../types';
2
3
  export declare class RootContainer {
3
4
  private editor;
@@ -1,7 +1,9 @@
1
- import { OnesEditor, OnesEditorDataConverter, OnesEditorDocs } from '../types';
1
+ import { OnesEditor, OnesEditorDataConverter, OnesEditorDocs, PasteOptions } from '../types';
2
2
  export default class EditorDataConverter implements OnesEditorDataConverter {
3
3
  private converters;
4
+ private converterTypes;
4
5
  constructor();
5
- fromData(editor: OnesEditor, data: DataTransfer): Promise<OnesEditorDocs | undefined>;
6
+ private prepareData;
7
+ fromData(editor: OnesEditor, data: DataTransfer, options?: PasteOptions): Promise<OnesEditorDocs | undefined>;
6
8
  addConverter(converter: OnesEditorDataConverter): void;
7
9
  }
@@ -186,6 +186,7 @@ export interface RecognizeLinkResult {
186
186
  }
187
187
  export interface InsertBlockOptions {
188
188
  noScroll?: boolean;
189
+ noFocus?: boolean;
189
190
  }
190
191
  export type UpdateBlockOptions = InsertBlockOptions;
191
192
  export interface OnesEditorDoc {
@@ -193,12 +194,16 @@ export interface OnesEditorDoc {
193
194
  unregisterCallback: (callbacks: OnesEditorDocCallbacks) => void;
194
195
  toJSON: () => DocObject;
195
196
  getContainerBlocks: (containerId: string) => DocBlock[];
197
+ findContainerBlocks: (containerId: string) => DocBlock[] | null;
196
198
  getBlockData: (containerId: string, blockIndex: number) => DocBlock;
197
199
  localUpdateBlockText: (containerId: string, blockIndex: number, actions: DocBlockTextActions, options?: UpdateBlockOptions) => DocBlockText;
198
200
  localUpdateBlockData: (containerId: string, blockIndex: number, delta: DocBlockDelta, newRange: OnesEditorDocRange) => DocBlock;
199
201
  localInsertBlock: (containerId: string, blockIndex: number, data: DocBlock, newRange: OnesEditorDocRange, options?: InsertBlockOptions) => DocBlock;
200
202
  localDeleteBlock: (containerId: string, blockIndex: number, newRange: OnesEditorDocRange) => DocBlock;
201
- localInsertChildContainer: (containerId: string, blocks: DocBlock[]) => void;
203
+ localInsertChildContainers: (containers: {
204
+ containerId: string;
205
+ blocks: DocBlock[];
206
+ }[]) => void;
202
207
  localDeleteChildContainers: (containerIds: string[]) => void;
203
208
  addResources: (resourceIds: string[]) => Promise<string[]>;
204
209
  uploadResource: (file: File, options?: UploadResourceOptions) => Promise<UploadResourceResult>;
@@ -1,4 +1,4 @@
1
- import { BlockElement, OnesEditor, SimpleSelectionRange } from '../../types';
1
+ import { BlockElement, OnesEditor, SelectionRange, SimpleSelectionRange } from '../../types';
2
2
  import { DocBlockText } from '../../doc';
3
3
  export declare function editorRemoveTextAttribute(editor: OnesEditor, block: BlockElement, range: SimpleSelectionRange, attributeName: string): DocBlockText;
4
4
  export declare function editorAddTextAttribute(editor: OnesEditor, block: BlockElement, range: SimpleSelectionRange, attributeName: string, value: boolean | string | number): DocBlockText;
@@ -7,4 +7,4 @@ export type SetEmptyTextBlockColor = (editor: OnesEditor, blockId: string, type:
7
7
  export declare function editorRangeSetColor(editor: OnesEditor, type: 'color' | 'backgroundColor', value: number | null, emptyBlockFun: SetEmptyTextBlockColor): void;
8
8
  export declare function editorRangeClearColor(editor: OnesEditor, value: 'clearAll' | 'clearColor' | 'clearBackground', emptyBlockFun: SetEmptyTextBlockColor): void;
9
9
  export type GetEmptyTextBlockColor = (editor: OnesEditor, blockId: string) => [number | null, number | null];
10
- export declare function editorRangeGetColor(editor: OnesEditor, emptyBlockFun: GetEmptyTextBlockColor): [number | null, number | null];
10
+ export declare function editorRangeGetColor(editor: OnesEditor, range: SelectionRange, emptyBlockFun: GetEmptyTextBlockColor): [number | null, number | null];
@@ -1,5 +1,6 @@
1
1
  import { OnesEditor, BlockElement, InsertTextOptions } from '../../types';
2
2
  import { DocBlockText, DocBox } from '../../doc';
3
+ export declare function getTextAttributes(editor: OnesEditor, containerId: string, blockIndex: number, offset: number): import("quill-delta/dist/AttributeMap").default | undefined;
3
4
  export declare function editorInsertTextToBlock(editor: OnesEditor, block: BlockElement, offset: number, text: string | DocBlockText, options?: InsertTextOptions): DocBlockText;
4
5
  export declare function editorInsertBoxToBlock(editor: OnesEditor, block: BlockElement, offset: number, boxData: DocBox): DocBlockText;
5
6
  export declare function editorInsertTextToBlockEx(editor: OnesEditor, text: string | DocBlockText, containerId: string, blockIndex: number, offset: number): DocBlockText;
@@ -1,3 +1,3 @@
1
1
  import { BlockElement, OnesEditor } from '../../types';
2
- export declare function editorIsBlockWritable(editor: OnesEditor, block: BlockElement): boolean;
2
+ export declare function editorIsBlockWritable(editor: OnesEditor, block: BlockElement | BlockElement[]): boolean;
3
3
  export declare function editorIsWritable(editor: OnesEditor): boolean;
@@ -12,6 +12,7 @@ export default class EditorDoc extends EventCallbacks<OnesEditorDocCallbacks> im
12
12
  toJSON(): DocObject;
13
13
  getVersionHelper(): import("../doc").OnesEditorDocVersionHelper | undefined;
14
14
  getContainerBlocks(containerId: string): DocBlock[];
15
+ findContainerBlocks(containerId: string): DocBlock[] | null;
15
16
  getBlockData(containerId: string, blockIndex: number): DocBlock;
16
17
  verifyBlockWritable(containerId: string, blockIndex: number): void;
17
18
  localUpdateBlockText(containerId: string, blockIndex: number, actions: DocBlockTextActions, options?: UpdateBlockOptions): DocBlockText;
@@ -19,7 +20,10 @@ export default class EditorDoc extends EventCallbacks<OnesEditorDocCallbacks> im
19
20
  localInsertBlock(containerId: string, blockIndex: number, data: DocBlock, newRange: OnesEditorDocRange, options?: InsertBlockOptions): DocBlock;
20
21
  localDeleteBlock(containerId: string, blockIndex: number, newRange: OnesEditorDocRange): DocBlock;
21
22
  localDeleteChildContainers(containerIds: string[]): void;
22
- localInsertChildContainer(containerId: string, blocks: DocBlock[]): void;
23
+ localInsertChildContainers(containers: {
24
+ containerId: string;
25
+ blocks: DocBlock[];
26
+ }[]): void;
23
27
  onRequestReload(reason: string): void;
24
28
  onUpdateBlockText(containerId: string, blockIndex: number, actions: DocBlockTextActions, local: boolean): void;
25
29
  onUpdateBlockData(containerId: string, blockIndex: number, delta: DocBlockDelta, local: boolean): void;
@@ -1,5 +1,5 @@
1
1
  import { EditorInputCallbacks } from '../composition/editor-input';
2
- import { OnesEditor, OnesEditorInputHandler, OnesEditorUndoAction, RemoteChangeType } from '../types';
2
+ import { OnesEditor, OnesEditorInputHandler, OnesEditorUndoAction, RemoteChangeType, PasteOptions } from '../types';
3
3
  import { DocObject } from '../doc';
4
4
  export declare class EditorInputHandlers implements EditorInputCallbacks {
5
5
  editor: OnesEditor;
@@ -14,7 +14,7 @@ export declare class EditorInputHandlers implements EditorInputCallbacks {
14
14
  onCopy(event: ClipboardEvent): void;
15
15
  onCut(event: ClipboardEvent): void;
16
16
  onPaste(event: ClipboardEvent): void;
17
- onPasteText: (text: string) => Promise<void>;
17
+ onPasteText: (text: string, options?: PasteOptions) => Promise<void>;
18
18
  onFocus(): void;
19
19
  onBlur(): void;
20
20
  addHandler(handler: OnesEditorInputHandler): void;
@@ -1,13 +1,17 @@
1
1
  import { OnesEditorSelectionHandler, BlockPosition, OnesEditor } from '../types';
2
+ import { AutoScroll } from '../../utils';
2
3
  export declare class EditorSelectionHandler implements OnesEditorSelectionHandler {
3
4
  editor: OnesEditor;
4
5
  startPos: BlockPosition | null;
5
6
  lastCaretRect: DOMRect;
6
7
  mouseDownEvent: MouseEvent | null;
8
+ autoScroll: AutoScroll | null;
7
9
  constructor(editor: OnesEditor);
8
10
  isSelecting(): boolean;
9
11
  stopSelection(): void;
10
- handleMouseDown: (event: MouseEvent) => void;
12
+ handleMouseDown: (event: MouseEvent, options: {
13
+ autoScroll: boolean;
14
+ }) => void;
11
15
  handleMouseMove: (event: MouseEvent) => void;
12
16
  handleMouseUp: (event: MouseEvent) => void;
13
17
  handleDblClick(event: MouseEvent): void;
@@ -56,6 +56,7 @@ export interface BoxCommands {
56
56
  }
57
57
  export interface BoxProperties {
58
58
  boxCommands?: Record<string, BoxCommands>;
59
+ abstract?: string;
59
60
  }
60
61
  export interface Box {
61
62
  boxType: string;
@@ -107,8 +108,9 @@ export interface DeleteBlockEventOptions {
107
108
  }
108
109
  export type CommandItemType = 'normal' | 'separator' | 'section';
109
110
  export type CommandItemState = 'disabled' | 'checked' | 'selected';
111
+ export type CloseReason = 'selectionChange' | 'clickItem' | 'clickBackground' | 'cancelBar' | 'fromHover' | 'switchItem' | null;
110
112
  export interface Closeable {
111
- close: () => void;
113
+ close: (reason: CloseReason) => void;
112
114
  click: (item: CommandItem, target: HTMLElement) => void;
113
115
  }
114
116
  export type CommandItemChildrenPlacement = 'auto' | 'top' | 'left' | 'right' | 'bottom' | 'auto-start' | 'auto-end' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'right-start' | 'right-end' | 'left-start' | 'left-end';
@@ -132,8 +134,10 @@ export interface CommandItem {
132
134
  manualShowChildren?: boolean;
133
135
  childrenPlacement?: CommandItemChildrenPlacement;
134
136
  childrenOffset?: [number, number];
137
+ childArrow?: boolean;
135
138
  subText?: string;
136
139
  defaultCheckedChildren?: string[];
140
+ ellipsisTooltip?: string;
137
141
  disableTooltip?: boolean;
138
142
  disableReason?: string;
139
143
  setCloseable?: (closeable: Closeable) => void;
@@ -343,10 +347,10 @@ export interface OnesEditorBlockRenderers {
343
347
  export type OnesEditorDocSource = 'text/html' | 'text/office-html' | 'text/plain' | 'text/markdown' | 'image/*' | 'text/x-ones-editor-doc' | '*';
344
348
  export type OnesEditorDocs = Partial<Record<OnesEditorDocSource, DocObject>>;
345
349
  export interface OnesEditorDataConverter {
346
- fromData: (editor: OnesEditor, data: DataTransfer) => Promise<OnesEditorDocs | undefined>;
350
+ fromData: (editor: OnesEditor, data: DataTransfer, options?: PasteOptions) => Promise<OnesEditorDocs | undefined>;
347
351
  }
348
352
  export interface OnesEditorDataConverters {
349
- fromData: (editor: OnesEditor, data: DataTransfer) => Promise<OnesEditorDocs | undefined>;
353
+ fromData: (editor: OnesEditor, data: DataTransfer, options?: PasteOptions) => Promise<OnesEditorDocs | undefined>;
350
354
  addConverter: (converter: OnesEditorDataConverter) => void;
351
355
  }
352
356
  export interface BreakTextOptions {
@@ -369,6 +373,7 @@ export interface OnesEditorEvents {
369
373
  'afterClearSelection': (editor: OnesEditor) => void;
370
374
  'blur': (editor: OnesEditor) => void;
371
375
  'focus': (editor: OnesEditor) => void;
376
+ 'containerRemount': (editor: OnesEditor, containerId: string) => void;
372
377
  }
373
378
  export interface OnesEditorSettingsProvider {
374
379
  getItem: (key: string) => string | null;
@@ -381,6 +386,7 @@ export interface OnesEditorOptionalOptions {
381
386
  components?: OnesEditorComponents;
382
387
  colors?: string[];
383
388
  scrollContainer?: HTMLElement;
389
+ enableComments?: boolean;
384
390
  settingsProvider?: OnesEditorSettingsProvider;
385
391
  }
386
392
  export interface OnesEditorOptions {
@@ -388,6 +394,7 @@ export interface OnesEditorOptions {
388
394
  componentsOptions: {
389
395
  [index: string]: unknown;
390
396
  };
397
+ enableComments?: boolean;
391
398
  scrollContainer?: HTMLElement;
392
399
  }
393
400
  export interface OnesEditorComponents {
@@ -481,7 +488,7 @@ export interface OnesEditor extends TypedEmitter<OnesEditorEvents> {
481
488
  tryFocusToChildSimpleBlock?: boolean;
482
489
  }) => void;
483
490
  isWritable: () => boolean;
484
- isBlockWritable: (block: BlockElement) => boolean;
491
+ isBlockWritable: (block: BlockElement | BlockElement[]) => boolean;
485
492
  reload: () => void;
486
493
  getChildContainerData: (childContainerId: string) => DocBlocks;
487
494
  createChildContainer: (path: BlockPath, parentElement: HTMLElement, childContainerId: string) => ContainerElement;
@@ -553,6 +560,9 @@ export interface OnesEditorSelection {
553
560
  to: (type: 'text' | 'markdown' | 'html') => string;
554
561
  }
555
562
  export type RemoteChangeType = 'UpdateBlockText' | 'UpdateBlockData' | 'InsertBlock' | 'DeleteBlock' | 'InsertChildContainer' | 'DeleteChildContainer';
563
+ export type PasteOptions = {
564
+ toPlainText?: boolean;
565
+ };
556
566
  export interface OnesEditorInput {
557
567
  readonly inputElement: HTMLInputElement;
558
568
  destroy: () => void;
@@ -564,7 +574,7 @@ export interface OnesEditorInput {
564
574
  handleKeyDown: (event: KeyboardEvent) => void;
565
575
  handleChanged: (action: OnesEditorUndoAction) => void;
566
576
  handleRemoteChanged: (type: RemoteChangeType) => void;
567
- handlePasteText: (text: string) => void;
577
+ handlePasteText: (text: string, options?: PasteOptions) => void;
568
578
  addHandler: (handler: OnesEditorInputHandler) => void;
569
579
  removeHandler: (handler: OnesEditorInputHandler) => void;
570
580
  defaultInsertText: (editor: OnesEditor, containerId: string, blockIndex: number, offset: number, text: string) => void;
@@ -573,7 +583,9 @@ export interface OnesEditorInput {
573
583
  export interface OnesEditorSelectionHandler {
574
584
  isSelecting: () => boolean;
575
585
  stopSelection: () => void;
576
- handleMouseDown: (event: MouseEvent) => void;
586
+ handleMouseDown: (event: MouseEvent, options: {
587
+ autoScroll: boolean;
588
+ }) => void;
577
589
  handleMouseMove: (event: MouseEvent) => void;
578
590
  handleMouseUp: (event: MouseEvent) => void;
579
591
  handleDblClick: (event: MouseEvent) => void;
@@ -584,6 +596,7 @@ export interface OnesEditorCaret {
584
596
  visible: () => boolean;
585
597
  }
586
598
  export interface OnesEditorInputHandler {
599
+ order?: number;
587
600
  handleBeforeInsertText?: (editor: OnesEditor, containerId: string, blockIndex: number, offset: number, text: string) => boolean;
588
601
  handleAfterInsertText?: (editor: OnesEditor, containerId: string, blockIndex: number, offset: number, text: string) => boolean;
589
602
  handleBeforeKeyDown?: (editor: OnesEditor, event: KeyboardEvent) => boolean;
@@ -616,6 +629,7 @@ export interface OnesEditorBoxes {
616
629
  registerBoxClass: (boxClass: Box) => void;
617
630
  getBoxClass: (type: string) => Box;
618
631
  createBox: (blockContent: BlockContentElement, box: DocBox) => BoxElement;
632
+ forEach: (callback: (boxClass: Box) => void) => void;
619
633
  }
620
634
  export interface OnesEditorInsertions {
621
635
  registerInsertionClass: (insertionClass: Insertion) => void;
@@ -662,6 +676,6 @@ export interface EditorDocLocalActionCallbacks {
662
676
  export interface OnesEditorBlockHook {
663
677
  create?: (editor: OnesEditor, path: BlockPath, container: ContainerElement, blockElement: BlockElement, blockData: DocBlock) => void;
664
678
  update?: (editor: OnesEditor, path: BlockPath, container: ContainerElement, blockElement: BlockElement, blockData: DocBlock) => void;
665
- writable?: (editor: OnesEditor, blockElement: BlockElement) => boolean | undefined;
679
+ writable?: (editor: OnesEditor, blockElement: BlockElement | BlockElement[]) => boolean | undefined;
666
680
  commands?: (editor: OnesEditor, blockElement: BlockElement) => BlockCommands;
667
681
  }