@ones-editor/editor 0.0.3-beta.6 → 0.0.3-beta.60

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 (208) hide show
  1. package/@ones-editor/auto-link/package.json +8 -0
  2. package/@ones-editor/auto-link/src/index.d.ts +3 -0
  3. package/@ones-editor/block-locker/src/i18n/en-US.d.ts +8 -0
  4. package/@ones-editor/block-locker/src/i18n/index.d.ts +1 -0
  5. package/@ones-editor/block-locker/src/i18n/zh-CN.d.ts +8 -0
  6. package/@ones-editor/block-locker/src/index.d.ts +2 -0
  7. package/@ones-editor/block-menu/src/block-menu/index.d.ts +1 -0
  8. package/@ones-editor/block-menu/src/block-menu/items/insert-block-items/index.d.ts +1 -1
  9. package/@ones-editor/block-menu/src/block-menu-button/drag-drop/find-preview-element.d.ts +1 -1
  10. package/@ones-editor/block-menu/src/block-menu-button/drag-preview/index.d.ts +1 -1
  11. package/@ones-editor/code-block/src/code-block/caption/caption-input-handler.d.ts +2 -2
  12. package/@ones-editor/code-block/src/code-block/code-caret.d.ts +7 -0
  13. package/@ones-editor/code-block/src/code-block/code-copy.d.ts +4 -0
  14. package/@ones-editor/code-block/src/code-block/create-empty-code.d.ts +2 -2
  15. package/@ones-editor/code-block/src/code-block/index.d.ts +3 -1
  16. package/@ones-editor/code-block/src/code-block/settings/index.d.ts +3 -0
  17. package/@ones-editor/comments/src/actions/add-comment-to-block.d.ts +3 -2
  18. package/@ones-editor/comments/src/actions/add-comment-to-text-block.d.ts +2 -1
  19. package/@ones-editor/comments/src/actions/editor-add-comment.d.ts +2 -0
  20. package/@ones-editor/comments/src/comment-item/comment-item.d.ts +1 -0
  21. package/@ones-editor/comments/src/comments/comments.d.ts +4 -3
  22. package/@ones-editor/comments/src/comments-helper/utils.d.ts +1 -1
  23. package/@ones-editor/comments/src/comments-list/arrange-items.d.ts +1 -1
  24. package/@ones-editor/comments/src/comments-list/comments-list.d.ts +0 -8
  25. package/@ones-editor/comments/src/comments-list/group-item.d.ts +1 -0
  26. package/@ones-editor/comments/src/comments-list/group-list.d.ts +1 -1
  27. package/@ones-editor/comments/src/comments-list/mini-comment/mini-comments-list.d.ts +0 -3
  28. package/@ones-editor/comments/src/index.d.ts +1 -0
  29. package/@ones-editor/comments/src/types.d.ts +10 -4
  30. package/@ones-editor/core/src/core/blocks/block-anchor/create-block-anchor.d.ts +1 -0
  31. package/@ones-editor/core/src/core/blocks/text-blocks/index.d.ts +1 -0
  32. package/@ones-editor/core/src/core/blocks/text-blocks/text-block/to-markdown.d.ts +3 -0
  33. package/@ones-editor/core/src/core/blocks/text-blocks/text-block/to-plain-html.d.ts +3 -0
  34. package/@ones-editor/core/src/core/blocks/text-blocks/text-block/to-plain-text.d.ts +3 -0
  35. package/@ones-editor/core/src/core/composition/clipboard/copy.d.ts +3 -2
  36. package/@ones-editor/core/src/core/composition/editor-input.d.ts +3 -0
  37. package/@ones-editor/core/src/core/composition/index.d.ts +1 -1
  38. package/@ones-editor/core/src/core/converter/block-to-doc.d.ts +1 -1
  39. package/@ones-editor/core/src/core/converter/block-to-html.d.ts +2 -2
  40. package/@ones-editor/core/src/core/converter/block-to-markdown.d.ts +2 -2
  41. package/@ones-editor/core/src/core/converter/block-to-text.d.ts +2 -2
  42. package/@ones-editor/core/src/core/converter/selected-block-to-doc.d.ts +3 -1
  43. package/@ones-editor/core/src/core/doc/doc.d.ts +6 -2
  44. package/@ones-editor/core/src/core/doc/rich-text/insert-text.d.ts +2 -1
  45. package/@ones-editor/core/src/core/doc/to-plain-text.d.ts +1 -0
  46. package/@ones-editor/core/src/core/editor/actions/auto-insert-block.d.ts +2 -2
  47. package/@ones-editor/core/src/core/editor/actions/break-text-block.d.ts +2 -0
  48. package/@ones-editor/core/src/core/editor/actions/delete-block-text.d.ts +2 -2
  49. package/@ones-editor/core/src/core/editor/actions/focus-to-end.d.ts +0 -1
  50. package/@ones-editor/core/src/core/editor/actions/insert-block.d.ts +2 -2
  51. package/@ones-editor/core/src/core/editor/actions/insert-text.d.ts +2 -2
  52. package/@ones-editor/core/src/core/editor/editor-dom/dom-events.d.ts +3 -3
  53. package/@ones-editor/core/src/core/editor-doc/editor-doc.d.ts +4 -3
  54. package/@ones-editor/core/src/core/index.d.ts +1 -0
  55. package/@ones-editor/core/src/core/input-handler/input-handler.d.ts +3 -0
  56. package/@ones-editor/core/src/core/input-handler/remove-quoted.d.ts +2 -0
  57. package/@ones-editor/core/src/core/selection/actions/index.d.ts +2 -2
  58. package/@ones-editor/core/src/core/selection/actions/select-all.d.ts +3 -1
  59. package/@ones-editor/core/src/core/selection/actions/select-block.d.ts +2 -0
  60. package/@ones-editor/core/src/core/selection/actions/word-offset.d.ts +1 -1
  61. package/@ones-editor/core/src/core/selection/editor-selection.d.ts +3 -2
  62. package/@ones-editor/core/src/core/selection/index.d.ts +1 -0
  63. package/@ones-editor/core/src/core/types.d.ts +36 -15
  64. package/@ones-editor/core/src/i18n/i18n.d.ts +36 -0
  65. package/@ones-editor/core/src/local-doc/index.d.ts +6 -2
  66. package/@ones-editor/core/src/utils/dom-scroll.d.ts +3 -1
  67. package/@ones-editor/core/src/utils/file.d.ts +3 -0
  68. package/@ones-editor/core/src/utils/logger/index.d.ts +1 -0
  69. package/@ones-editor/drop-target/src/drop-indicator.d.ts +1 -0
  70. package/@ones-editor/drop-target/src/drop-target.d.ts +1 -1
  71. package/@ones-editor/drop-target/src/handlers/drag-file.d.ts +8 -0
  72. package/@ones-editor/e2e/cypress/support/commands.d.ts +25 -0
  73. package/@ones-editor/e2e/cypress/support/e2e.d.ts +1 -0
  74. package/@ones-editor/e2e/cypress.config.d.ts +3 -0
  75. package/@ones-editor/e2e/package.json +13 -0
  76. package/@ones-editor/e2e/src/block-menu/case.d.ts +17 -0
  77. package/@ones-editor/e2e/src/block-menu/menu.cy.d.ts +1 -0
  78. package/@ones-editor/e2e/src/data.d.ts +131 -0
  79. package/@ones-editor/e2e/src/input-handlers/case.d.ts +10 -0
  80. package/@ones-editor/e2e/src/input-handlers/shortcut.cy.d.ts +1 -0
  81. package/@ones-editor/e2e/src/list-block/case.d.ts +8 -0
  82. package/@ones-editor/e2e/src/list-block/list.cy.d.ts +1 -0
  83. package/@ones-editor/e2e/src/toc/case.d.ts +5 -0
  84. package/@ones-editor/e2e/src/toc/toc.cy.d.ts +1 -0
  85. package/@ones-editor/embed-block-helper/src/block-properties/embed-block-properties.d.ts +1 -0
  86. package/@ones-editor/file/package.json +8 -0
  87. package/@ones-editor/file/src/file-box/index.d.ts +4 -0
  88. package/@ones-editor/file/src/file-embed/card/file-icon.d.ts +1 -0
  89. package/@ones-editor/file/src/file-embed/card/index.d.ts +6 -0
  90. package/@ones-editor/file/src/file-embed/download-file.d.ts +2 -0
  91. package/@ones-editor/file/src/file-embed/index.d.ts +4 -0
  92. package/@ones-editor/file/src/index.d.ts +3 -0
  93. package/@ones-editor/file/src/types.d.ts +22 -0
  94. package/@ones-editor/find-dialog/src/find-dialog.d.ts +0 -1
  95. package/@ones-editor/graph-embed/src/helper/graph-base.d.ts +1 -0
  96. package/@ones-editor/heading-collapse/src/heading-collapse-button/drop-handler.d.ts +1 -1
  97. package/@ones-editor/image-embed/package.json +2 -1
  98. package/@ones-editor/image-embed/src/drag-drop/drag-handler.d.ts +4 -0
  99. package/@ones-editor/image-embed/src/drag-drop/handle-drop-over.d.ts +5 -1
  100. package/@ones-editor/image-embed/src/drag-drop/handle-drop.d.ts +1 -1
  101. package/@ones-editor/image-embed/src/empty-image-converter.d.ts +5 -0
  102. package/@ones-editor/image-embed/src/index.d.ts +2 -1
  103. package/@ones-editor/input-handlers/src/enforce-with-document-title/types.d.ts +1 -0
  104. package/@ones-editor/input-handlers/src/i18n/en-us.d.ts +1 -0
  105. package/@ones-editor/input-handlers/src/i18n/zh-cn.d.ts +1 -0
  106. package/@ones-editor/input-handlers/src/markdown-shortcuts/table-converter.d.ts +2 -0
  107. package/@ones-editor/list-block/src/converter/convert-list-to.d.ts +2 -0
  108. package/@ones-editor/list-block/src/converter/convert-to-list.d.ts +14 -0
  109. package/@ones-editor/list-block/src/converter/index.d.ts +2 -14
  110. package/@ones-editor/list-block/src/drop/index.d.ts +1 -1
  111. package/@ones-editor/list-block/src/index.d.ts +3 -2
  112. package/@ones-editor/list-block/src/level/change-multi-levels.d.ts +2 -0
  113. package/@ones-editor/list-block/src/level/decrease-level.d.ts +1 -0
  114. package/@ones-editor/list-block/src/mindmap/index.d.ts +1 -1
  115. package/@ones-editor/list-block/src/mindmap/to-mindmap/index.d.ts +1 -1
  116. package/@ones-editor/list-block/src/types.d.ts +2 -1
  117. package/@ones-editor/markdown-to-doc/src/markdown-to-doc.d.ts +1 -0
  118. package/@ones-editor/markdown-to-doc/src/tokens/block-tokens/latex.d.ts +4 -0
  119. package/@ones-editor/markdown-to-doc/src/tokens/block-tokens/paragraph.d.ts +1 -0
  120. package/@ones-editor/mathjax/package.json +3 -0
  121. package/@ones-editor/mathjax/src/index.d.ts +2 -1
  122. package/@ones-editor/mathjax/src/mathjax-box/convert-mathjax.d.ts +5 -0
  123. package/@ones-editor/mathjax/src/mathjax-box/mathjax-editor.d.ts +2 -2
  124. package/@ones-editor/media-embed/src/core/media-embed.d.ts +3 -1
  125. package/@ones-editor/mention/src/block-mention.d.ts +1 -1
  126. package/@ones-editor/mention/src/dom/mention-button.d.ts +1 -1
  127. package/@ones-editor/mention/src/mention.d.ts +1 -0
  128. package/@ones-editor/mobile-helper/package.json +9 -0
  129. package/@ones-editor/mobile-helper/src/index.d.ts +11 -0
  130. package/@ones-editor/paste-handler/src/paste-handler.d.ts +1 -1
  131. package/@ones-editor/paste-special/src/paste-special-handler.d.ts +2 -2
  132. package/@ones-editor/scroll-container/src/dom-utils.d.ts +9 -0
  133. package/@ones-editor/scroll-container/src/index.d.ts +8 -18
  134. package/@ones-editor/scroll-container/src/observer/container-resize-observer.d.ts +2 -1
  135. package/@ones-editor/scroll-container/src/observer/locating-resize-observer.d.ts +13 -0
  136. package/@ones-editor/scroll-container/src/scroll-listener.d.ts +3 -0
  137. package/@ones-editor/scroll-container/src/types.d.ts +1 -0
  138. package/@ones-editor/sharedb-doc/src/doc/auth-connection.d.ts +3 -3
  139. package/@ones-editor/sharedb-doc/src/doc/sharedb-client.d.ts +3 -3
  140. package/@ones-editor/sharedb-doc/src/doc/sharedb-doc.d.ts +6 -1
  141. package/@ones-editor/sharedb-doc/src/index.d.ts +1 -0
  142. package/@ones-editor/sharedb-doc/src/types.d.ts +3 -2
  143. package/@ones-editor/table-block/src/constant/index.d.ts +1 -0
  144. package/@ones-editor/table-block/src/locale/en-us.d.ts +5 -0
  145. package/@ones-editor/table-block/src/locale/zh-cn.d.ts +5 -0
  146. package/@ones-editor/table-block/src/table-block/convert-table-to.d.ts +2 -0
  147. package/@ones-editor/table-block/src/table-block/doc-table-data.d.ts +1 -1
  148. package/@ones-editor/table-block/src/table-block/table-creator/index.d.ts +1 -1
  149. package/@ones-editor/table-block/src/table-block/table-resize/resize-gripper.d.ts +1 -1
  150. package/@ones-editor/table-block/src/table-block/table-scroll-events.d.ts +1 -0
  151. package/@ones-editor/table-block/src/types.d.ts +2 -0
  152. package/@ones-editor/templates/package.json +9 -0
  153. package/@ones-editor/templates/src/index.d.ts +4 -0
  154. package/@ones-editor/templates/src/locale/en-us.d.ts +9 -0
  155. package/@ones-editor/templates/src/locale/index.d.ts +1 -0
  156. package/@ones-editor/templates/src/locale/zh-cn.d.ts +9 -0
  157. package/@ones-editor/templates/src/templates/select-template.d.ts +7 -0
  158. package/@ones-editor/templates/src/templates/types.d.ts +14 -0
  159. package/@ones-editor/text-commands/src/locale/en-us.d.ts +1 -0
  160. package/@ones-editor/text-commands/src/locale/zh-cn.d.ts +1 -0
  161. package/@ones-editor/toc/src/heading-scroll/index.d.ts +22 -0
  162. package/@ones-editor/toc/src/heading-scroll/utils.d.ts +7 -0
  163. package/@ones-editor/toc/src/index.d.ts +1 -0
  164. package/@ones-editor/tsconfig.tsbuildinfo +1 -1
  165. package/@ones-editor/ui/src/index.d.ts +4 -3
  166. package/@ones-editor/ui/src/locale/en-us.d.ts +2 -0
  167. package/@ones-editor/ui/src/locale/zh-cn.d.ts +2 -0
  168. package/@ones-editor/ui/src/quick-menu/basic-commands.d.ts +5 -0
  169. package/@ones-editor/ui/src/quick-menu/basic-menu-items.d.ts +10 -12
  170. package/@ones-editor/ui/src/quick-menu/index.d.ts +4 -6
  171. package/@ones-editor/ui/src/quick-menu/inline-box-items.d.ts +8 -14
  172. package/@ones-editor/ui/src/quick-menu/insert-empty-block.d.ts +4 -2
  173. package/@ones-editor/ui/src/quick-menu/types.d.ts +24 -1
  174. package/@ones-editor/ui/src/toolbar/box-only.d.ts +2 -0
  175. package/@ones-editor/ui/src/toolbar/commands/paragraph.d.ts +1 -0
  176. package/@ones-editor/ui/src/toolbar/toolbar-handler.d.ts +2 -2
  177. package/@ones-editor/ui/src/tooltips/index.d.ts +4 -0
  178. package/@ones-editor/ui-base/src/auto-suggest/auto-suggest-menu.d.ts +2 -1
  179. package/@ones-editor/ui-base/src/auto-suggest/auto-suggest.d.ts +1 -1
  180. package/@ones-editor/ui-base/src/auto-suggest/index.d.ts +2 -1
  181. package/@ones-editor/ui-base/src/auto-suggest/should-focus-to-editor.d.ts +2 -0
  182. package/@ones-editor/ui-base/src/command-bar/command-bar.d.ts +2 -1
  183. package/@ones-editor/ui-base/src/command-bar/types.d.ts +5 -0
  184. package/@ones-editor/ui-base/src/dialog/index.d.ts +1 -0
  185. package/@ones-editor/ui-base/src/dialog/manual-close-dialog.d.ts +1 -1
  186. package/@ones-editor/ui-base/src/dialog/types.d.ts +4 -0
  187. package/@ones-editor/ui-base/src/index.d.ts +1 -0
  188. package/@ones-editor/ui-base/src/input/create-input.d.ts +1 -0
  189. package/@ones-editor/ui-base/src/item-shortcuts/index.d.ts +1 -0
  190. package/@ones-editor/ui-base/src/list/drop-down-filterable-list.d.ts +2 -2
  191. package/@ones-editor/ui-base/src/locale/en-us.d.ts +1 -0
  192. package/@ones-editor/ui-base/src/locale/zh-cn.d.ts +1 -0
  193. package/@ones-editor/versions/src/types.d.ts +1 -0
  194. package/@ones-editor/versions/src/version-dialog/index.d.ts +3 -1
  195. package/@ones-editor/webpage-embed/src/ui/dialog.d.ts +2 -2
  196. package/@ones-editor/webpage-embed/src/webpage-embed/webpage-items.d.ts +2 -0
  197. package/dist/comments/create-comment-editor.d.ts +4 -7
  198. package/dist/comments/local-doc-comments-provider.d.ts +18 -0
  199. package/dist/comments/{comments-provider.d.ts → sharedb-doc-comments-provider.d.ts} +3 -6
  200. package/dist/index.d.ts +13 -3
  201. package/dist/index.js +226 -207
  202. package/dist/lang/en-us.d.ts +13 -0
  203. package/dist/lang/index.d.ts +1 -0
  204. package/dist/lang/zh-cn.d.ts +13 -0
  205. package/dist/types.d.ts +25 -4
  206. package/package.json +6 -1
  207. package/@ones-editor/list-block/src/command/covert-to-list.d.ts +0 -3
  208. /package/@ones-editor/block-menu/src/block-menu-button/{drag-drop → drag-preview}/element-to-data-url.d.ts +0 -0
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "@ones-editor/auto-link",
3
+ "version": "1.0.0",
4
+ "license": "MIT",
5
+ "type": "module",
6
+ "main": "./src/index.ts",
7
+ "types": "src/index.d.ts"
8
+ }
@@ -0,0 +1,3 @@
1
+ import { ShortcutRecords } from '../../../@ones-editor/core';
2
+ declare const AutoLinkShortcuts: ShortcutRecords;
3
+ export { AutoLinkShortcuts, };
@@ -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;
@@ -0,0 +1 @@
1
+ export {};
@@ -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,3 +1,5 @@
1
1
  import BlockLockerHook from './hook';
2
2
  import './style.scss';
3
+ import './i18n';
4
+ export * from './helper';
3
5
  export { BlockLockerHook };
@@ -8,6 +8,7 @@ export default class BlockMenu {
8
8
  show(target: HTMLElement): void;
9
9
  isInMenu(eventTarget: EventTarget | null): boolean;
10
10
  handleShow: () => void;
11
+ handleClose: () => void;
11
12
  handleItemClick: (bar: unknown, item: CommandItem) => void;
12
13
  setBlock(block: BlockElement): void;
13
14
  close: () => void;
@@ -1,4 +1,4 @@
1
1
  import { BlockElement, OnesEditor } from '../../../../../../@ones-editor/core';
2
2
  import { BlockMenuItem } from '../types';
3
- export declare function getAllInsertBlockItems(editor: OnesEditor): BlockMenuItem[];
3
+ export declare function getAllInsertBlockItems(editor: OnesEditor, source: 'insert-block' | 'insert-block-before'): BlockMenuItem[];
4
4
  export declare function executeInsertBlockCommand(editor: OnesEditor, block: BlockElement, item: BlockMenuItem, insertAbove?: boolean): Promise<BlockElement | null> | undefined;
@@ -1,2 +1,2 @@
1
- import type { BlockElement } from '../../../../../@ones-editor/core';
1
+ import { BlockElement } from '../../../../../@ones-editor/core';
2
2
  export declare function findPreviewElement(block: BlockElement): HTMLElement;
@@ -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, pendingUrl: string | PromiseLike<string>) => Promise<void>;
7
+ handleDragStart: (e: DragEvent, preview: HTMLElement) => Promise<void>;
8
8
  handleDrag: (e: DragEvent) => void;
9
9
  handleDragEnd: () => void;
10
10
  }
@@ -1,8 +1,8 @@
1
- import { OnesEditor, OnesEditorCustom, OnesEditorInputHandler } from '../../../../../@ones-editor/core';
1
+ import { OnesEditor, OnesEditorCustom, OnesEditorDocs, OnesEditorInputHandler } from '../../../../../@ones-editor/core';
2
2
  export default class CodeBlockCaptionInputHandler implements OnesEditorInputHandler, OnesEditorCustom {
3
3
  constructor(editor: OnesEditor);
4
4
  destroy(): void;
5
5
  handleBeforeKeyDown(editor: OnesEditor, event: KeyboardEvent): boolean;
6
- handleBeforePaste(editor: OnesEditor, event: ClipboardEvent): Promise<boolean>;
6
+ handleBeforePaste(editor: OnesEditor, event: ClipboardEvent | null, docs: OnesEditorDocs): Promise<boolean>;
7
7
  static init(editor: OnesEditor): void;
8
8
  }
@@ -0,0 +1,7 @@
1
+ import { OnesEditor, OnesEditorCustom } from '../../../../@ones-editor/core';
2
+ export default class OnesEditorCodeCaret implements OnesEditorCustom {
3
+ private editor;
4
+ constructor(editor: OnesEditor);
5
+ destroy(): void;
6
+ handleSelectionChange: () => void;
7
+ }
@@ -0,0 +1,4 @@
1
+ import { DocObject, OnesEditor, OnesEditorInputHandler } from '../../../../@ones-editor/core';
2
+ export default class CopyCodeInputHandler implements OnesEditorInputHandler {
3
+ handleBeforeCopy(editor: OnesEditor, event: ClipboardEvent, doc: DocObject): boolean | DocObject | undefined;
4
+ }
@@ -1,6 +1,6 @@
1
1
  import { OnesEditor } from '../../../../@ones-editor/core';
2
2
  import { DocCodeBlockData } from './code-block-data';
3
- export declare function createEmptyCode(editor: OnesEditor): {
3
+ export declare function createEmptyCode(editor: OnesEditor): Promise<{
4
4
  blockData: DocCodeBlockData;
5
5
  focusBlockId: string;
6
- };
6
+ }>;
@@ -1,4 +1,6 @@
1
1
  import CodeBlock, { CodeLineBlock } from './code-block';
2
+ import OnesEditorCodeCaret from './code-caret';
3
+ import CopyCodeInputHandler from './code-copy';
2
4
  import CodeShortcuts from './code-shortcuts';
3
5
  import CodeTextDecorator from './code-text-decorate';
4
- export { CodeBlock, CodeLineBlock, CodeTextDecorator, CodeShortcuts };
6
+ export { CodeBlock, CodeLineBlock, CodeTextDecorator, CodeShortcuts, CopyCodeInputHandler, OnesEditorCodeCaret };
@@ -0,0 +1,3 @@
1
+ import { OnesEditor } from '../../../../../@ones-editor/core';
2
+ export declare function getDefaultLanguage(editor: OnesEditor): Promise<string>;
3
+ export declare function setDefaultLanguage(editor: OnesEditor, lang: string): Promise<void>;
@@ -1,3 +1,4 @@
1
- import { BlockElement, OnesEditor } from '../../../../@ones-editor/core';
1
+ import { BlockElement, OnesEditor, OnesEditorComment } from '../../../../@ones-editor/core';
2
2
  import { OnesEditorCommentsProvider } from '../types';
3
- export declare function addCommentToBlock(editor: OnesEditor, block: BlockElement, provider: OnesEditorCommentsProvider): import("@ones-editor/core").OnesEditorComment;
3
+ export declare function updateCommentToBlock(editor: OnesEditor, block: BlockElement, comment: OnesEditorComment): void;
4
+ export declare function addCommentToBlock(editor: OnesEditor, block: BlockElement, provider: OnesEditorCommentsProvider): OnesEditorComment;
@@ -1,3 +1,4 @@
1
- import { OnesEditor, OnesEditorComment, SelectionRange } from '../../../../@ones-editor/core';
1
+ import { OnesEditor, OnesEditorComment, SelectedBlock, SelectionRange } from '../../../../@ones-editor/core';
2
2
  import { OnesEditorCommentsProvider } from '../types';
3
+ export declare function addCommentToSelectedTextBlock(editor: OnesEditor, selectedBlock: SelectedBlock, comment: OnesEditorComment): void;
3
4
  export declare function addCommentToTextBlocks(editor: OnesEditor, range: SelectionRange, provider: OnesEditorCommentsProvider): OnesEditorComment;
@@ -0,0 +1,2 @@
1
+ import { OnesEditor } from '../../../../@ones-editor/core';
2
+ export declare function editorAddComment(editor: OnesEditor): void;
@@ -34,6 +34,7 @@ export declare class CommentItem {
34
34
  getCommentEditor: () => CommentEditor;
35
35
  reloadDoc(): void;
36
36
  edit(): void;
37
+ handleReadonlyChanged: (editor: OnesEditor) => void;
37
38
  destroy(): void;
38
39
  }
39
40
  export {};
@@ -3,17 +3,18 @@ import { OnesEditorCommentsProvider } from '../types';
3
3
  export default class OnesEditorComments {
4
4
  private editor;
5
5
  private provider;
6
- private root;
7
6
  private commentList;
8
7
  private mobileCommentList;
9
8
  private miniCommentList;
10
- constructor(editor: OnesEditor, provider: OnesEditorCommentsProvider, parent?: HTMLElement);
9
+ constructor(editor: OnesEditor, provider: OnesEditorCommentsProvider);
10
+ private get commentOptions();
11
+ get commentProvider(): OnesEditorCommentsProvider;
11
12
  get isMobile(): boolean;
13
+ private getCommentRoot;
12
14
  destroy(): void;
13
15
  private showComment;
14
16
  showCommentList: (groupId?: string) => void;
15
17
  private handleCommentListClose;
16
18
  private handleOnSelectComment;
17
- private handleMiniCommentClose;
18
19
  private handleMiniCommentItemClick;
19
20
  }
@@ -1,6 +1,5 @@
1
1
  import { OnesEditorComment, OnesEditor } from '../../../../@ones-editor/core';
2
2
  export declare function isChildComment(comment: OnesEditorComment): boolean;
3
- export declare function getCommentsRoot(): HTMLDivElement;
4
3
  export declare function getCommentItemCountInGroupItem(groupItemRoot: HTMLElement, commentItemCls?: string): number;
5
4
  export declare function getClosestCommentItemId(element: HTMLElement): string | null;
6
5
  export declare function addGroupActionToElement(element: HTMLElement, action: string): void;
@@ -8,3 +7,4 @@ export declare function getClosestGroupItemActionElement(element: HTMLElement):
8
7
  export declare function getActionFromActionElement(actionElement: HTMLElement): string;
9
8
  export declare function isDisabledActionElement(actionElement: HTMLElement): boolean;
10
9
  export declare function getBlockIdByGroupId(editor: OnesEditor, commentId: string): string | null;
10
+ export declare function getAllCommentInCommentElement(element: HTMLElement): string[];
@@ -1,3 +1,3 @@
1
1
  import { OnesEditor } from '../../../../@ones-editor/core';
2
2
  import type { CommentGroupItem } from './group-item';
3
- export declare function arrangeItems(editor: OnesEditor, items: CommentGroupItem[], activeItem: CommentGroupItem | null): void;
3
+ export declare function arrangeItems(editor: OnesEditor, items: CommentGroupItem[], activeItem: CommentGroupItem | null, fixTop?: number): void;
@@ -3,14 +3,12 @@ import { TypedEmitter } from 'tiny-typed-emitter';
3
3
  import { OnesEditorCommentsEvents, OnesEditorCommentsProvider } from '../types';
4
4
  import CommentGroupList from './group-list';
5
5
  interface CommentsListEvents {
6
- onCommentListClose: () => void;
7
6
  onSelectComment: () => void;
8
7
  }
9
8
  export default class CommentsList extends TypedEmitter<CommentsListEvents> implements OnesEditorCommentsEvents {
10
9
  private editor;
11
10
  private commentsProvider;
12
11
  private root;
13
- private header;
14
12
  private groupsContainer;
15
13
  private list;
16
14
  constructor(editor: OnesEditor, commentsProvider: OnesEditorCommentsProvider, parent: HTMLElement);
@@ -19,13 +17,7 @@ export default class CommentsList extends TypedEmitter<CommentsListEvents> imple
19
17
  onCreateComment(commentId: string, local: boolean): void;
20
18
  onDeleteComment(commentId: string, local: boolean): void;
21
19
  onUpdateComment(commentId: string, local: boolean): void;
22
- createHeader(): {
23
- header: HTMLDivElement;
24
- count: HTMLSpanElement;
25
- closeButton: HTMLButtonElement;
26
- };
27
20
  createList(): CommentGroupList;
28
- handleCloseButtonClick: () => void;
29
21
  handleSelectionOnComment: () => void;
30
22
  updateCommentCount: () => void;
31
23
  handleActiveItemChanged: () => void;
@@ -33,6 +33,7 @@ export declare class CommentGroupItem extends TypedEmitter<CommentGroupItemEvent
33
33
  handleUpdateChildComment(comment: OnesEditorComment): void;
34
34
  handleUpdateMainComment(comment: OnesEditorComment): void;
35
35
  deleteMainComment(commentId: OnesEditorComment['id']): void;
36
+ handleReadonlyChanged: (editor: OnesEditor) => void;
36
37
  edit(): void;
37
38
  destroy(): void;
38
39
  private handleResize;
@@ -6,7 +6,6 @@ import { CommentGroupItemHandlers } from './handler';
6
6
  export interface CommentGroupListEvents {
7
7
  activeItemChanged: (index: number) => void;
8
8
  itemLayoutUpdated: () => void;
9
- itemCountClicked: () => void;
10
9
  selectionOnComment: () => void;
11
10
  commentCountChanged: () => void;
12
11
  }
@@ -32,6 +31,7 @@ export default class CommentGroupList extends ListBase<CommentWithChildren, Comm
32
31
  handleEditorResize: () => void;
33
32
  handleDocChanged: () => void;
34
33
  handleItemResize: () => void;
34
+ handleScroll: (event: WheelEvent) => void;
35
35
  updateGroupItemSwitch: () => void;
36
36
  private updateComments;
37
37
  }
@@ -11,15 +11,12 @@ export declare class MiniCommentsList extends TypedEmitter<MiniCommentsListEvent
11
11
  private commentsProvider;
12
12
  list: MiniGroupList;
13
13
  root: HTMLElement;
14
- header: HTMLElement;
15
14
  constructor(editor: OnesEditor, commentsProvider: OnesEditorCommentsProvider, parent: HTMLElement);
16
15
  onCreateComment(commentId: string, local: boolean): void;
17
16
  onDeleteComment(commentId: string, local: boolean): void;
18
17
  onUpdateComment(commentId: string, local: boolean): void;
19
- private createHeader;
20
18
  private createList;
21
19
  private handleListContainerClick;
22
- private closeMiniComment;
23
20
  show(): void;
24
21
  hide(): void;
25
22
  destroy(): void;
@@ -8,3 +8,4 @@ export { OnesEditorComments };
8
8
  export type { CommentItem } from './comment-item';
9
9
  export type { CommentGroupItem } from './comments-list/group-item';
10
10
  export { removeCommentFromBlock } from './actions/remove-comment-from-block';
11
+ export { editorAddComment } from './actions/editor-add-comment';
@@ -1,14 +1,21 @@
1
1
  import { DocObject, LocalDoc, OnesEditor, OnesEditorComment } from '../../../@ones-editor/core';
2
- import { AuthMessage } from '../../../@ones-editor/sharedb-doc';
3
2
  export type CommentData = {
4
3
  [p in string]: unknown;
5
4
  };
5
+ export interface OnesEditorCommentController {
6
+ showCommentList: () => void;
7
+ }
8
+ export type CommentRootType = keyof Pick<OnesEditorCommentOptions, 'container' | 'miniContainer' | 'mobileContainer'>;
6
9
  export interface OnesEditorCommentOptions {
7
- hideHeader?: boolean;
10
+ controller: OnesEditorCommentController;
11
+ container?: HTMLElement;
12
+ miniContainer?: HTMLElement;
13
+ mobileContainer?: HTMLElement;
8
14
  disableReply?: boolean;
9
15
  disableEdit?: boolean;
10
- onUpdateLayout?: (editor: OnesEditor, data: CommentData) => void;
11
16
  pullThreshold?: number;
17
+ onUpdateLayout?: (editor: OnesEditor, data: CommentData) => void;
18
+ onCommentCountChange?: (count: number) => void;
12
19
  }
13
20
  export interface OnesEditorCommentsEvents {
14
21
  onCreateComment: (commentId: string, local: boolean) => void;
@@ -16,7 +23,6 @@ export interface OnesEditorCommentsEvents {
16
23
  onUpdateComment: (commentId: string, local: boolean) => void;
17
24
  }
18
25
  export interface OnesEditorCommentsProvider {
19
- getAuth: () => AuthMessage;
20
26
  getComments: () => OnesEditorComment[];
21
27
  getComment: (id: string) => OnesEditorComment;
22
28
  getCommentDoc: (commentId: string) => DocObject;
@@ -1,3 +1,4 @@
1
1
  import { BlockElement, OnesEditor } from '../../types';
2
2
  import './anchor.scss';
3
3
  export declare function createBlockAnchor(editor: OnesEditor, block: BlockElement, id: string, refClientRect?: DOMRect): HTMLElement;
4
+ export declare function createBlockCaretAnchor(editor: OnesEditor, block: BlockElement, offset: number, id: string): HTMLElement;
@@ -1,4 +1,5 @@
1
1
  import TextBlock, { updateTextBlockContent } from './text-block';
2
2
  export * from './base/child';
3
3
  export * from './base/text-offset';
4
+ export * from './base/block-text';
4
5
  export { TextBlock, updateTextBlockContent, };
@@ -0,0 +1,3 @@
1
+ import { DocBlock, DocObject } from '../../../doc';
2
+ import { OnesEditor } from '../../../types';
3
+ export declare function textBlockToMarkdown(editor: OnesEditor, blockData: DocBlock, doc: DocObject): string;
@@ -0,0 +1,3 @@
1
+ import { DocBlockText, DocObject } from '../../../doc';
2
+ import { OnesEditor } from '../../../types';
3
+ export declare function textBlockToHtml(editor: OnesEditor, ops: DocBlockText, doc: DocObject): string;
@@ -0,0 +1,3 @@
1
+ import { DocBlockText, DocObject } from '../../../doc';
2
+ import { OnesEditor } from '../../../types';
3
+ export declare function textBlockToText(editor: OnesEditor, ops: DocBlockText, doc: DocObject): string;
@@ -1,7 +1,8 @@
1
1
  import { DocObject } from '../../doc';
2
2
  import { BlockElement, OnesEditor } from '../../types';
3
- export declare function docToPlainText(editor: OnesEditor, doc: DocObject): string;
3
+ export declare function injectDocToHtmlFragment(htmlFragment: string, doc: DocObject): string;
4
4
  export declare function addMetaToDoc(editor: OnesEditor, doc: DocObject): void;
5
- export declare function editorCopy(editor: OnesEditor, event: ClipboardEvent): void;
5
+ export type BeforeCopyCallback = (editor: OnesEditor, event: ClipboardEvent, doc: DocObject) => DocObject | boolean | undefined;
6
+ export declare function editorCopy(editor: OnesEditor, event: ClipboardEvent, beforeCopy?: BeforeCopyCallback): void;
6
7
  export declare function editorCopyWithoutEvent(editor: OnesEditor): void;
7
8
  export declare function editorCopyBlock(editor: OnesEditor, block: BlockElement): Promise<boolean>;
@@ -10,6 +10,8 @@ export interface EditorInputCallbacks {
10
10
  onFocus: () => void;
11
11
  onBlur: () => void;
12
12
  onPaste: (event: ClipboardEvent) => void;
13
+ onPasteText: (text: string) => void;
14
+ onCopy: (event: ClipboardEvent) => void;
13
15
  addHandler: (handler: OnesEditorInputHandler) => void;
14
16
  removeHandler: (handler: OnesEditorInputHandler) => void;
15
17
  defaultInsertText: (editor: OnesEditor, containerId: string, blockIndex: number, offset: number, text: string) => void;
@@ -36,6 +38,7 @@ export declare class EditorInput implements OnesEditorInput {
36
38
  handleCopy: (event: ClipboardEvent) => void;
37
39
  handleCut: (event: ClipboardEvent) => void;
38
40
  handlePaste: (event: ClipboardEvent) => void;
41
+ handlePasteText: (text: string) => void;
39
42
  handleChanged(action: OnesEditorUndoAction): void;
40
43
  handleRemoteChanged(type: RemoteChangeType): void;
41
44
  addHandler(handler: OnesEditorInputHandler): void;
@@ -1 +1 @@
1
- export { editorCopyBlock } from './clipboard/copy';
1
+ export { editorCopyBlock, addMetaToDoc, injectDocToHtmlFragment } from './clipboard/copy';
@@ -1,3 +1,3 @@
1
1
  import { DocObject } from '../doc';
2
2
  import { BlockElement, OnesEditor } from '../types';
3
- export declare function blockToDoc(editor: OnesEditor, block: BlockElement): DocObject;
3
+ export declare function blockToDoc(editor: OnesEditor, block: BlockElement, ignoreLockInfo?: boolean): DocObject;
@@ -1,3 +1,3 @@
1
1
  import { DocBlock, DocObject } from '../doc';
2
- import { OnesEditor } from '../types';
3
- export declare function blockToHtml(editor: OnesEditor, blockData: DocBlock, doc: DocObject): string;
2
+ import { BlockPath, OnesEditor } from '../types';
3
+ export declare function blockToHtml(editor: OnesEditor, blockData: DocBlock, doc: DocObject, path: BlockPath): string;
@@ -1,3 +1,3 @@
1
1
  import { DocBlock, DocObject } from '../doc';
2
- import { OnesEditor } from '../types';
3
- export declare function blockToMarkdown(editor: OnesEditor, blockData: DocBlock, doc: DocObject): string;
2
+ import { BlockPath, OnesEditor } from '../types';
3
+ export declare function blockToMarkdown(editor: OnesEditor, blockData: DocBlock, doc: DocObject, path: BlockPath): string;
@@ -1,3 +1,3 @@
1
1
  import { DocBlock, DocObject } from '../doc';
2
- import { OnesEditor } from '../types';
3
- export declare function blockToText(editor: OnesEditor, blockData: DocBlock, doc: DocObject): string;
2
+ import { BlockPath, OnesEditor } from '../types';
3
+ export declare function blockToText(editor: OnesEditor, blockData: DocBlock, doc: DocObject, path: BlockPath): string;
@@ -1,3 +1,5 @@
1
1
  import { DocObject } from '../doc';
2
2
  import { OnesEditor, SelectedBlock } from '../types';
3
- export declare function selectedBlockToDoc(editor: OnesEditor, selectedBlock: SelectedBlock): DocObject;
3
+ export declare function selectedBlockToDoc(editor: OnesEditor, selectedBlock: SelectedBlock, options?: {
4
+ ignoreLockInfo: boolean;
5
+ }): DocObject;
@@ -179,15 +179,19 @@ export interface RecognizeLinkResult {
179
179
  providerName?: string;
180
180
  url: string;
181
181
  }
182
+ export interface InsertBlockOptions {
183
+ noScroll?: boolean;
184
+ }
185
+ export type UpdateBlockOptions = InsertBlockOptions;
182
186
  export interface OnesEditorDoc {
183
187
  registerCallback: (callbacks: OnesEditorDocCallbacks) => void;
184
188
  unregisterCallback: (callbacks: OnesEditorDocCallbacks) => void;
185
189
  toJSON: () => DocObject;
186
190
  getContainerBlocks: (containerId: string) => DocBlock[];
187
191
  getBlockData: (containerId: string, blockIndex: number) => DocBlock;
188
- localUpdateBlockText: (containerId: string, blockIndex: number, actions: DocBlockTextActions) => DocBlockText;
192
+ localUpdateBlockText: (containerId: string, blockIndex: number, actions: DocBlockTextActions, options?: UpdateBlockOptions) => DocBlockText;
189
193
  localUpdateBlockData: (containerId: string, blockIndex: number, delta: DocBlockDelta, newRange: OnesEditorDocRange) => DocBlock;
190
- localInsertBlock: (containerId: string, blockIndex: number, data: DocBlock, newRange: OnesEditorDocRange) => DocBlock;
194
+ localInsertBlock: (containerId: string, blockIndex: number, data: DocBlock, newRange: OnesEditorDocRange, options?: InsertBlockOptions) => DocBlock;
191
195
  localDeleteBlock: (containerId: string, blockIndex: number, newRange: OnesEditorDocRange) => DocBlock;
192
196
  localInsertChildContainer: (containerId: string, blocks: DocBlock[]) => void;
193
197
  localDeleteChildContainers: (containerIds: string[]) => void;
@@ -1,3 +1,4 @@
1
- import { DocBlockText, DocBlockTextActions, DocBlockTextAttributes } from '../doc';
1
+ import { DocBlockText, DocBlockTextActions, DocBlockTextAttributes, DocBox, DocBlockTextOp } from '../doc';
2
2
  export declare function insertText(richText: DocBlockText, offset: number, text: string | DocBlockText, attributes: DocBlockTextAttributes | null): DocBlockText;
3
+ export declare function createBoxOp(boxData: DocBox): DocBlockTextOp;
3
4
  export declare function createInsertOps(offset: number, text: string | DocBlockText, attributes: DocBlockTextAttributes | null): DocBlockTextActions;
@@ -3,3 +3,4 @@ export declare const FILL_CHAR = "\u200B";
3
3
  export declare function toPlainText(ops: Op[], options?: {
4
4
  boxReplacement: string;
5
5
  }): string;
6
+ export declare function toPlainTextKeepLength(ops: Op[]): string;
@@ -1,3 +1,3 @@
1
- import { DocBlock, OnesEditorDocRange } from '../../doc';
1
+ import { InsertBlockOptions, DocBlock, OnesEditorDocRange } from '../../doc';
2
2
  import { OnesEditor } from '../../types';
3
- export declare function editorAutoInsertBlock(editor: OnesEditor, blockData: DocBlock, containerId?: string, blockIndex?: number, newRange?: OnesEditorDocRange): import("../../types").BlockElement;
3
+ export declare function editorAutoInsertBlock(editor: OnesEditor, blockData: DocBlock, containerId?: string, blockIndex?: number, newRange?: OnesEditorDocRange, insertBlockOptions?: InsertBlockOptions): import("../../types").BlockElement;
@@ -1,6 +1,8 @@
1
1
  import { BlockElement, BreakTextOptions, OnesEditor } from '../../types';
2
+ import { DocBlockAttributes } from '../../doc';
2
3
  export interface BreakTextBlockResult {
3
4
  block: BlockElement;
4
5
  newBlock: BlockElement;
5
6
  }
7
+ export declare function copyBlockAttributes(editor: OnesEditor, block: BlockElement): DocBlockAttributes;
6
8
  export declare function editorBreakTextBlock(editor: OnesEditor, block: BlockElement, offset: number, options?: BreakTextOptions): BreakTextBlockResult;
@@ -1,2 +1,2 @@
1
- import { OnesEditor, BlockElement } from '../../types';
2
- export declare function editorDeleteBlockText(editor: OnesEditor, block: BlockElement, offset: number, count: number): number;
1
+ import { OnesEditor, BlockElement, InsertTextOptions } from '../../types';
2
+ export declare function editorDeleteBlockText(editor: OnesEditor, block: BlockElement, offset: number, count: number, options?: InsertTextOptions): number;
@@ -1,3 +1,2 @@
1
1
  import { OnesEditor } from '../../types';
2
- export declare function editorSelectEnd(editor: OnesEditor): void;
3
2
  export declare function editorFocusToEnd(editor: OnesEditor): void;
@@ -1,3 +1,3 @@
1
- import { DocBlock, OnesEditorDocRange } from '../../doc';
1
+ import { DocBlock, InsertBlockOptions, OnesEditorDocRange } from '../../doc';
2
2
  import { OnesEditor, BlockElement } from '../../types';
3
- export declare function editorInsertBlock(editor: OnesEditor, containerId: string, blockIndex: number, blockData: DocBlock, newRange: OnesEditorDocRange): BlockElement;
3
+ export declare function editorInsertBlock(editor: OnesEditor, containerId: string, blockIndex: number, blockData: DocBlock, newRange: OnesEditorDocRange, options?: InsertBlockOptions): BlockElement;
@@ -1,6 +1,6 @@
1
- import { OnesEditor, BlockElement } from '../../types';
1
+ import { OnesEditor, BlockElement, InsertTextOptions } from '../../types';
2
2
  import { DocBlockText, DocBox } from '../../doc';
3
- export declare function editorInsertTextToBlock(editor: OnesEditor, block: BlockElement, offset: number, text: string | DocBlockText): DocBlockText;
3
+ export declare function editorInsertTextToBlock(editor: OnesEditor, block: BlockElement, offset: number, text: string | DocBlockText, options?: InsertTextOptions): DocBlockText;
4
4
  export declare function editorInsertBoxToBlock(editor: OnesEditor, block: BlockElement, offset: number, boxData: DocBox): DocBlockText;
5
5
  export declare function editorInsertTextToBlockEx(editor: OnesEditor, text: string | DocBlockText, containerId: string, blockIndex: number, offset: number): DocBlockText;
6
6
  export declare function editorInsertText(editor: OnesEditor, text: string | DocBlockText): void;
@@ -1,5 +1,5 @@
1
1
  import { OnesEditor } from '../../types';
2
- export type DomEventCallback = (editor: OnesEditor, event: Event, data: unknown) => void;
2
+ export type DomEventCallback<T = Event> = (editor: OnesEditor, event: T, data: unknown) => void;
3
3
  declare class DomEventHandler {
4
4
  editor: OnesEditor;
5
5
  dom: Element | Document | Window;
@@ -12,10 +12,10 @@ declare class DomEventHandler {
12
12
  }
13
13
  export declare class EditorDomEvents {
14
14
  private editor;
15
- handlers: Map<Element | Document | Window, DomEventHandler[]>;
15
+ handlers: Map<Document | Element | Window, DomEventHandler[]>;
16
16
  constructor(editor: OnesEditor);
17
17
  destroy(): void;
18
- addEventListener(element: Element | Document | Window, eventName: string, eventHandler: DomEventCallback, data?: unknown): void;
18
+ addEventListener<T = Event>(element: Element | Document | Window, eventName: string, eventHandler: DomEventCallback<T>, data?: unknown): void;
19
19
  removeEventListener(element: Element | Document | Window | null, eventName: string | null, eventHandler: DomEventCallback): void;
20
20
  removeAllListeners(element: Element | Document | Window, eventName?: string): void;
21
21
  }
@@ -1,5 +1,5 @@
1
1
  import { EditorDocLocalActionCallbacks, OnesEditor } from '../types';
2
- import { BuildResourceUrlOptions, DocBlock, DocBlockDelta, DocBlockText, DocBlockTextActions, DocObject, OnesEditorDoc, OnesEditorDocCallbacks, OnesEditorDocRange, OnesEditorDocServerMeta, OnesEditorDocStatus, UploadResourceOptions, UploadResourceResult } from '../doc';
2
+ import { BuildResourceUrlOptions, InsertBlockOptions, DocBlock, DocBlockDelta, DocBlockText, DocBlockTextActions, DocObject, OnesEditorDoc, OnesEditorDocCallbacks, OnesEditorDocRange, OnesEditorDocServerMeta, OnesEditorDocStatus, UploadResourceOptions, UploadResourceResult, UpdateBlockOptions } from '../doc';
3
3
  import { EventCallbacks } from '../../utils';
4
4
  export default class EditorDoc extends EventCallbacks<OnesEditorDocCallbacks> implements OnesEditorDoc, OnesEditorDocCallbacks {
5
5
  private editor;
@@ -13,9 +13,9 @@ export default class EditorDoc extends EventCallbacks<OnesEditorDocCallbacks> im
13
13
  getVersionHelper(): import("../doc").OnesEditorDocVersionHelper | undefined;
14
14
  getContainerBlocks(containerId: string): DocBlock[];
15
15
  getBlockData(containerId: string, blockIndex: number): DocBlock;
16
- localUpdateBlockText(containerId: string, blockIndex: number, actions: DocBlockTextActions): DocBlockText;
16
+ localUpdateBlockText(containerId: string, blockIndex: number, actions: DocBlockTextActions, options?: UpdateBlockOptions): DocBlockText;
17
17
  localUpdateBlockData(containerId: string, blockIndex: number, delta: DocBlockDelta, newRange: OnesEditorDocRange): DocBlock;
18
- localInsertBlock(containerId: string, blockIndex: number, data: DocBlock, newRange: OnesEditorDocRange): DocBlock;
18
+ localInsertBlock(containerId: string, blockIndex: number, data: DocBlock, newRange: OnesEditorDocRange, options?: InsertBlockOptions): DocBlock;
19
19
  localDeleteBlock(containerId: string, blockIndex: number, newRange: OnesEditorDocRange): DocBlock;
20
20
  localDeleteChildContainers(containerIds: string[]): void;
21
21
  localInsertChildContainer(containerId: string, blocks: DocBlock[]): void;
@@ -38,4 +38,5 @@ export default class EditorDoc extends EventCallbacks<OnesEditorDocCallbacks> im
38
38
  getRemoteUsers(): import("../doc").OnesEditorRemoteUsers;
39
39
  destroy(): void;
40
40
  getServerMeta(): OnesEditorDocServerMeta;
41
+ reset(doc: OnesEditorDoc): void;
41
42
  }
@@ -7,6 +7,7 @@ export * from './decorators';
7
7
  export * from './doc';
8
8
  export * from './editor';
9
9
  export * from './selection';
10
+ export * from './selection/actions';
10
11
  export * from './keyboard';
11
12
  export * from './converter';
12
13
  export * from './command-providers';
@@ -11,7 +11,9 @@ export declare class EditorInputHandlers implements EditorInputCallbacks {
11
11
  onRemoteChanged(type: RemoteChangeType): void;
12
12
  onCompositionStart(event: Event): void;
13
13
  onUpdateCompositionText(event: Event, text: string, end: boolean): void;
14
+ onCopy(event: ClipboardEvent): void;
14
15
  onPaste(event: ClipboardEvent): void;
16
+ onPasteText: (text: string) => Promise<void>;
15
17
  onFocus(): void;
16
18
  onBlur(): void;
17
19
  addHandler(handler: OnesEditorInputHandler): void;
@@ -23,5 +25,6 @@ export declare class EditorInputHandlers implements EditorInputCallbacks {
23
25
  defaultInsertText(editor: OnesEditor, containerId: string, blockIndex: number, offset: number, text: string): void;
24
26
  defaultHandleKeydown(editor: OnesEditor, event: KeyboardEvent): boolean;
25
27
  pasteDoc(doc: DocObject): Promise<void>;
28
+ private pasteDocs;
26
29
  destroy(): void;
27
30
  }
@@ -0,0 +1,2 @@
1
+ import { BlockElement, OnesEditor } from '../types';
2
+ export declare function removeQuoted(editor: OnesEditor, block: BlockElement): boolean;
@@ -22,5 +22,5 @@ import { editorMovePageUp } from './move-page-up';
22
22
  import { editorMovePageDown } from './move-page-down';
23
23
  import { editorSelectPageUp } from './select-page-up';
24
24
  import { editorSelectPageDown } from './select-page-down';
25
- import { editorSelectAll } from './select-all';
26
- export { editorMoveLeft, editorMoveRight, editorMoveUp, editorMoveDown, editorSelectDown, editorSelectUp, editorSelectLeft, editorSelectRight, editorMoveWordLeft, editorMoveWordEnd, editorSelectWordLeft, editorSelectWordEnd, editorMoveHome, editorMoveEnd, editorSelectHome, editorSelectEnd, editorMovePageUp, editorMovePageDown, editorSelectPageUp, editorSelectPageDown, editorSelectLineHome, editorSelectLineEnd, editorMoveLineHome, editorMoveLineEnd, editorSelectAll, };
25
+ import { editorSelectAll, editorSelectContainer, isContainerSelectedAllChildBlocks } from './select-all';
26
+ export { editorMoveLeft, editorMoveRight, editorMoveUp, editorMoveDown, editorSelectDown, editorSelectUp, editorSelectLeft, editorSelectRight, editorMoveWordLeft, editorMoveWordEnd, editorSelectWordLeft, editorSelectWordEnd, editorMoveHome, editorMoveEnd, editorSelectHome, editorSelectEnd, editorMovePageUp, editorMovePageDown, editorSelectPageUp, editorSelectPageDown, editorSelectLineHome, editorSelectLineEnd, editorMoveLineHome, editorMoveLineEnd, editorSelectAll, editorSelectContainer, isContainerSelectedAllChildBlocks, };
@@ -1,2 +1,4 @@
1
- import { OnesEditor } from '../../types';
1
+ import { ContainerElement, OnesEditor, SimpleSelectionRange } from '../../types';
2
+ export declare function isContainerSelectedAllChildBlocks(container: ContainerElement, range: SimpleSelectionRange): boolean;
2
3
  export declare function editorSelectAll(editor: OnesEditor): boolean;
4
+ export declare function editorSelectContainer(editor: OnesEditor, container: ContainerElement): void;
@@ -0,0 +1,2 @@
1
+ import { OnesEditor } from '../../types';
2
+ export declare function editorSelectBlock(editor: OnesEditor): void;
@@ -1,3 +1,3 @@
1
1
  import { OnesEditor, SimpleBlockPosition } from '../../types';
2
2
  export declare function editorGetWordLeftPos(editor: OnesEditor, type: 'move' | 'select'): SimpleBlockPosition | null;
3
- export declare function editorGetWordEndPos(editor: OnesEditor, type: 'move' | 'select'): SimpleBlockPosition | null;
3
+ export declare function editorGetWordRightPos(editor: OnesEditor, type: 'move' | 'select'): SimpleBlockPosition | null;