@ones-editor/editor 0.0.3-beta.7 → 0.0.3-beta.71
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.
- package/@ones-editor/auto-link/package.json +8 -0
- package/@ones-editor/auto-link/src/index.d.ts +3 -0
- package/@ones-editor/block-locker/src/hook.d.ts +1 -0
- package/@ones-editor/block-locker/src/i18n/en-US.d.ts +8 -0
- package/@ones-editor/block-locker/src/i18n/index.d.ts +1 -0
- package/@ones-editor/block-locker/src/i18n/zh-CN.d.ts +8 -0
- package/@ones-editor/block-locker/src/index.d.ts +4 -1
- package/@ones-editor/block-locker/src/paste-handler.d.ts +4 -0
- package/@ones-editor/block-menu/src/block-menu/items/block-command-items.d.ts +1 -1
- package/@ones-editor/block-menu/src/block-menu/items/insert-block-items/index.d.ts +1 -1
- package/@ones-editor/block-menu/src/block-menu-button/drag-drop/find-preview-element.d.ts +1 -1
- package/@ones-editor/block-menu/src/block-menu-button/drag-preview/index.d.ts +1 -1
- package/@ones-editor/code-block/src/code-block/caption/caption-input-handler.d.ts +2 -2
- package/@ones-editor/code-block/src/code-block/child-container.d.ts +2 -2
- package/@ones-editor/code-block/src/code-block/code-caret.d.ts +7 -0
- package/@ones-editor/code-block/src/code-block/code-copy.d.ts +4 -0
- package/@ones-editor/code-block/src/code-block/create-empty-code.d.ts +2 -2
- package/@ones-editor/code-block/src/code-block/index.d.ts +3 -1
- package/@ones-editor/code-block/src/code-block/settings/index.d.ts +3 -0
- package/@ones-editor/comments/src/actions/add-comment-to-block.d.ts +3 -2
- package/@ones-editor/comments/src/actions/add-comment-to-text-block.d.ts +2 -1
- package/@ones-editor/comments/src/actions/editor-add-comment.d.ts +2 -0
- package/@ones-editor/comments/src/comment-item/comment-item.d.ts +1 -0
- package/@ones-editor/comments/src/comments/comments.d.ts +5 -4
- package/@ones-editor/comments/src/comments-helper/utils.d.ts +1 -1
- package/@ones-editor/comments/src/comments-list/arrange-items.d.ts +1 -1
- package/@ones-editor/comments/src/comments-list/comments-list.d.ts +2 -10
- package/@ones-editor/comments/src/comments-list/group-item.d.ts +1 -0
- package/@ones-editor/comments/src/comments-list/group-list.d.ts +1 -1
- package/@ones-editor/comments/src/comments-list/mini-comment/mini-comments-list.d.ts +1 -4
- package/@ones-editor/comments/src/comments-list/mobile-comments-list/mobile-comments-list.d.ts +2 -2
- package/@ones-editor/comments/src/index.d.ts +1 -0
- package/@ones-editor/comments/src/types.d.ts +11 -4
- package/@ones-editor/core/src/core/blocks/block-anchor/create-block-anchor.d.ts +1 -0
- package/@ones-editor/core/src/core/blocks/common/block-dom.d.ts +1 -0
- package/@ones-editor/core/src/core/blocks/text-blocks/index.d.ts +1 -0
- package/@ones-editor/core/src/core/blocks/text-blocks/text-block/to-markdown.d.ts +3 -0
- package/@ones-editor/core/src/core/blocks/text-blocks/text-block/to-plain-html.d.ts +3 -0
- package/@ones-editor/core/src/core/blocks/text-blocks/text-block/to-plain-text.d.ts +3 -0
- package/@ones-editor/core/src/core/composition/clipboard/copy.d.ts +3 -2
- package/@ones-editor/core/src/core/composition/editor-input.d.ts +3 -0
- package/@ones-editor/core/src/core/composition/index.d.ts +1 -1
- package/@ones-editor/core/src/core/converter/block-to-html.d.ts +2 -2
- package/@ones-editor/core/src/core/converter/block-to-markdown.d.ts +2 -2
- package/@ones-editor/core/src/core/converter/block-to-text.d.ts +2 -2
- package/@ones-editor/core/src/core/doc/doc.d.ts +6 -2
- package/@ones-editor/core/src/core/doc/to-plain-text.d.ts +1 -0
- package/@ones-editor/core/src/core/editor/actions/auto-insert-block.d.ts +2 -2
- package/@ones-editor/core/src/core/editor/actions/break-text-block.d.ts +2 -0
- package/@ones-editor/core/src/core/editor/actions/delete-block-text.d.ts +2 -2
- package/@ones-editor/core/src/core/editor/actions/focus-to-end.d.ts +0 -1
- package/@ones-editor/core/src/core/editor/actions/insert-block.d.ts +2 -2
- package/@ones-editor/core/src/core/editor/actions/insert-text.d.ts +2 -2
- package/@ones-editor/core/src/core/editor-doc/editor-doc.d.ts +5 -3
- package/@ones-editor/core/src/core/index.d.ts +1 -0
- package/@ones-editor/core/src/core/input-handler/input-handler.d.ts +3 -0
- package/@ones-editor/core/src/core/input-handler/remove-quoted.d.ts +2 -0
- package/@ones-editor/core/src/core/selection/actions/index.d.ts +2 -2
- package/@ones-editor/core/src/core/selection/actions/select-all.d.ts +3 -1
- package/@ones-editor/core/src/core/selection/actions/select-block.d.ts +2 -0
- package/@ones-editor/core/src/core/selection/actions/word-offset.d.ts +1 -1
- package/@ones-editor/core/src/core/selection/editor-selection.d.ts +3 -2
- package/@ones-editor/core/src/core/selection/index.d.ts +1 -0
- package/@ones-editor/core/src/core/selection/range/simple-range.d.ts +2 -1
- package/@ones-editor/core/src/core/settings/index.d.ts +3 -3
- package/@ones-editor/core/src/core/types.d.ts +29 -18
- package/@ones-editor/core/src/i18n/i18n.d.ts +36 -0
- package/@ones-editor/core/src/local-doc/index.d.ts +6 -2
- package/@ones-editor/core/src/utils/dom-scroll.d.ts +3 -1
- package/@ones-editor/core/src/utils/dom.d.ts +2 -0
- package/@ones-editor/core/src/utils/file.d.ts +1 -0
- package/@ones-editor/core/src/utils/logger/index.d.ts +9 -0
- package/@ones-editor/drawio-embed/src/helper/index.d.ts +3 -3
- package/@ones-editor/drawio-embed/types/index.d.ts +2 -2
- package/@ones-editor/drop-target/src/drop-indicator.d.ts +1 -0
- package/@ones-editor/drop-target/src/drop-target.d.ts +1 -1
- package/@ones-editor/drop-target/src/handlers/drag-file.d.ts +8 -0
- package/@ones-editor/e2e/cypress/support/commands.d.ts +6 -0
- package/@ones-editor/e2e/src/block-menu/case.d.ts +17 -0
- package/@ones-editor/e2e/src/block-menu/menu.cy.d.ts +1 -0
- package/@ones-editor/e2e/src/data.d.ts +32 -7
- package/@ones-editor/embed-block-helper/src/block-properties/embed-block-properties.d.ts +2 -1
- package/@ones-editor/exclusive-block/package.json +6 -0
- package/@ones-editor/exclusive-block/src/exclusive-block-hook.d.ts +6 -0
- package/@ones-editor/exclusive-block/src/exclusive-block.d.ts +22 -0
- package/@ones-editor/exclusive-block/src/exclusive-dom.d.ts +5 -0
- package/@ones-editor/exclusive-block/src/handle-remote-exclusive-message.d.ts +3 -0
- package/@ones-editor/exclusive-block/src/index.d.ts +5 -0
- package/@ones-editor/exclusive-block/src/types.d.ts +7 -0
- package/@ones-editor/graph-embed/src/helper/graph-base.d.ts +3 -2
- package/@ones-editor/graph-embed/src/helper/graph-block-commands.d.ts +3 -2
- package/@ones-editor/heading-collapse/src/heading-collapse-button/drop-handler.d.ts +1 -1
- package/@ones-editor/image-embed/package.json +2 -1
- package/@ones-editor/image-embed/src/drag-drop/drag-handler.d.ts +4 -0
- package/@ones-editor/image-embed/src/drag-drop/handle-drop-over.d.ts +5 -1
- package/@ones-editor/image-embed/src/drag-drop/handle-drop.d.ts +1 -1
- package/@ones-editor/image-embed/src/empty-image-converter.d.ts +5 -0
- package/@ones-editor/image-embed/src/index.d.ts +2 -1
- package/@ones-editor/input-handlers/src/enforce-with-document-title/types.d.ts +1 -0
- package/@ones-editor/input-handlers/src/i18n/en-us.d.ts +1 -0
- package/@ones-editor/input-handlers/src/i18n/zh-cn.d.ts +1 -0
- package/@ones-editor/input-handlers/src/markdown-shortcuts/table-converter.d.ts +2 -0
- package/@ones-editor/list-block/src/converter/convert-list-to.d.ts +2 -0
- package/@ones-editor/list-block/src/converter/convert-to-list.d.ts +14 -0
- package/@ones-editor/list-block/src/converter/index.d.ts +2 -14
- package/@ones-editor/list-block/src/drop/index.d.ts +1 -1
- package/@ones-editor/list-block/src/index.d.ts +3 -2
- package/@ones-editor/list-block/src/level/change-multi-levels.d.ts +2 -0
- package/@ones-editor/list-block/src/level/decrease-level.d.ts +1 -0
- package/@ones-editor/list-block/src/mindmap/index.d.ts +1 -1
- package/@ones-editor/list-block/src/mindmap/to-mindmap/index.d.ts +1 -1
- package/@ones-editor/list-block/src/types.d.ts +2 -1
- package/@ones-editor/list-block/src/utils/list-brother.d.ts +3 -1
- package/@ones-editor/markdown-to-doc/src/markdown-to-doc.d.ts +1 -0
- package/@ones-editor/markdown-to-doc/src/tokens/block-tokens/latex.d.ts +4 -0
- package/@ones-editor/markdown-to-doc/src/tokens/block-tokens/paragraph.d.ts +1 -0
- package/@ones-editor/mathjax/package.json +3 -0
- package/@ones-editor/mathjax/src/index.d.ts +2 -1
- package/@ones-editor/mathjax/src/mathjax-box/convert-mathjax.d.ts +5 -0
- package/@ones-editor/mathjax/src/mathjax-box/mathjax-editor.d.ts +2 -2
- package/@ones-editor/media-embed/src/core/media-embed.d.ts +3 -1
- package/@ones-editor/mention/src/block-mention.d.ts +1 -1
- package/@ones-editor/mention/src/dom/mention-button.d.ts +1 -1
- package/@ones-editor/mention/src/mention.d.ts +1 -0
- package/@ones-editor/mobile-helper/package.json +9 -0
- package/@ones-editor/mobile-helper/src/index.d.ts +11 -0
- package/@ones-editor/paste-handler/src/paste-handler.d.ts +1 -1
- package/@ones-editor/paste-special/src/paste-special-handler.d.ts +2 -2
- package/@ones-editor/scroll-container/src/dom-utils.d.ts +9 -0
- package/@ones-editor/scroll-container/src/index.d.ts +8 -18
- package/@ones-editor/scroll-container/src/observer/container-resize-observer.d.ts +2 -1
- package/@ones-editor/scroll-container/src/observer/locating-resize-observer.d.ts +13 -0
- package/@ones-editor/scroll-container/src/scroll-listener.d.ts +3 -0
- package/@ones-editor/scroll-container/src/types.d.ts +1 -0
- package/@ones-editor/sharedb-doc/src/doc/auth-connection.d.ts +3 -3
- package/@ones-editor/sharedb-doc/src/doc/sharedb-client.d.ts +3 -3
- package/@ones-editor/sharedb-doc/src/doc/sharedb-doc.d.ts +6 -1
- package/@ones-editor/sharedb-doc/src/index.d.ts +1 -0
- package/@ones-editor/sharedb-doc/src/types.d.ts +3 -2
- package/@ones-editor/table-block/src/constant/index.d.ts +1 -0
- package/@ones-editor/table-block/src/locale/en-us.d.ts +5 -0
- package/@ones-editor/table-block/src/locale/zh-cn.d.ts +5 -0
- package/@ones-editor/table-block/src/table-block/border-bar/table-row-column-toolbar.d.ts +1 -0
- package/@ones-editor/table-block/src/table-block/convert-table-to.d.ts +2 -0
- package/@ones-editor/table-block/src/table-block/doc-table-data.d.ts +1 -1
- package/@ones-editor/table-block/src/table-block/selection-range.d.ts +2 -1
- package/@ones-editor/table-block/src/table-block/table-creator/index.d.ts +1 -1
- package/@ones-editor/table-block/src/table-block/table-resize/resize-gripper.d.ts +1 -1
- package/@ones-editor/table-block/src/table-block/table-scroll-events.d.ts +1 -0
- package/@ones-editor/table-block/src/types.d.ts +2 -0
- package/@ones-editor/templates/package.json +9 -0
- package/@ones-editor/templates/src/index.d.ts +4 -0
- package/@ones-editor/templates/src/locale/en-us.d.ts +9 -0
- package/@ones-editor/templates/src/locale/index.d.ts +1 -0
- package/@ones-editor/templates/src/locale/zh-cn.d.ts +9 -0
- package/@ones-editor/templates/src/templates/select-template.d.ts +7 -0
- package/@ones-editor/templates/src/templates/types.d.ts +14 -0
- package/@ones-editor/text-commands/src/locale/en-us.d.ts +1 -0
- package/@ones-editor/text-commands/src/locale/zh-cn.d.ts +1 -0
- package/@ones-editor/text-commands/src/text-command-provider.d.ts +1 -0
- package/@ones-editor/toc/src/heading-scroll/index.d.ts +22 -0
- package/@ones-editor/toc/src/heading-scroll/utils.d.ts +7 -0
- package/@ones-editor/toc/src/index.d.ts +1 -0
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/@ones-editor/ui/src/index.d.ts +3 -3
- package/@ones-editor/ui/src/locale/en-us.d.ts +2 -0
- package/@ones-editor/ui/src/locale/zh-cn.d.ts +2 -0
- package/@ones-editor/ui/src/quick-menu/basic-commands.d.ts +5 -0
- package/@ones-editor/ui/src/quick-menu/basic-menu-items.d.ts +10 -10
- package/@ones-editor/ui/src/quick-menu/index.d.ts +6 -0
- package/@ones-editor/ui/src/quick-menu/inline-box-items.d.ts +8 -14
- package/@ones-editor/ui/src/toolbar/box-only.d.ts +2 -0
- package/@ones-editor/ui/src/toolbar/commands/paragraph.d.ts +1 -0
- package/@ones-editor/ui/src/toolbar/toolbar-handler.d.ts +3 -1
- package/@ones-editor/ui/src/tooltips/index.d.ts +4 -0
- package/@ones-editor/ui-base/src/auto-suggest/auto-suggest-menu.d.ts +2 -1
- package/@ones-editor/ui-base/src/auto-suggest/auto-suggest.d.ts +4 -1
- package/@ones-editor/ui-base/src/auto-suggest/index.d.ts +2 -1
- package/@ones-editor/ui-base/src/auto-suggest/should-focus-to-editor.d.ts +2 -0
- package/@ones-editor/ui-base/src/command-bar/command-bar.d.ts +4 -1
- package/@ones-editor/ui-base/src/command-bar/types.d.ts +6 -0
- package/@ones-editor/ui-base/src/dialog/index.d.ts +1 -0
- package/@ones-editor/ui-base/src/dialog/manual-close-dialog.d.ts +1 -1
- package/@ones-editor/ui-base/src/dialog/types.d.ts +4 -0
- package/@ones-editor/ui-base/src/index.d.ts +1 -0
- package/@ones-editor/ui-base/src/input/create-input.d.ts +1 -0
- package/@ones-editor/ui-base/src/item-shortcuts/index.d.ts +1 -0
- package/@ones-editor/ui-base/src/list/drop-down-filterable-list.d.ts +2 -2
- package/@ones-editor/ui-base/src/locale/en-us.d.ts +1 -0
- package/@ones-editor/ui-base/src/locale/zh-cn.d.ts +1 -0
- package/@ones-editor/versions/src/types.d.ts +1 -0
- package/@ones-editor/versions/src/version-dialog/index.d.ts +3 -1
- package/@ones-editor/webpage-embed/src/ui/dialog.d.ts +2 -2
- package/@ones-editor/webpage-embed/src/webpage-embed/webpage-items.d.ts +2 -0
- package/dist/comments/create-comment-editor.d.ts +4 -7
- package/dist/comments/local-doc-comments-provider.d.ts +18 -0
- package/dist/comments/{comments-provider.d.ts → sharedb-doc-comments-provider.d.ts} +3 -6
- package/dist/index.d.ts +15 -3
- package/dist/index.js +240 -285
- package/dist/lang/en-us.d.ts +14 -0
- package/dist/lang/index.d.ts +1 -0
- package/dist/lang/zh-cn.d.ts +14 -0
- package/dist/types.d.ts +24 -2
- package/package.json +3 -1
- package/@ones-editor/e2e/src/block-menu/menu-list.cy.d.ts +0 -0
- package/@ones-editor/list-block/src/command/covert-to-list.d.ts +0 -3
- /package/@ones-editor/block-menu/src/block-menu-button/{drag-drop → drag-preview}/element-to-data-url.d.ts +0 -0
|
@@ -6,14 +6,15 @@ export type GraphType = 'mermaid' | 'flowchart' | 'plantuml';
|
|
|
6
6
|
export type GraphEmbedBlockProperties = StandardEmbedBlockProperties<PresetCommandId>;
|
|
7
7
|
declare class GraphBlockCommands extends StandardEmbedBlockCommands<PresetCommandId> {
|
|
8
8
|
editor: OnesEditor;
|
|
9
|
+
block: BlockElement;
|
|
9
10
|
graphType: GraphType;
|
|
10
11
|
properties?: GraphEmbedBlockProperties | undefined;
|
|
11
12
|
group: string;
|
|
12
13
|
_commands: CommandItem[];
|
|
13
|
-
constructor(editor: OnesEditor, graphType: GraphType, properties?: GraphEmbedBlockProperties | undefined);
|
|
14
|
+
constructor(editor: OnesEditor, block: BlockElement, graphType: GraphType, properties?: GraphEmbedBlockProperties | undefined);
|
|
14
15
|
executeCommand(editor: OnesEditor, block: BlockElement, item: CommandItem): void;
|
|
15
16
|
}
|
|
16
|
-
export declare function getGraphEmbedBlockProperties(editor: OnesEditor, type: 'mermaid' | 'flowchart' | 'plantuml', properties?: GraphEmbedBlockProperties): {
|
|
17
|
+
export declare function getGraphEmbedBlockProperties(editor: OnesEditor, block: BlockElement, type: 'mermaid' | 'flowchart' | 'plantuml', properties?: GraphEmbedBlockProperties): {
|
|
17
18
|
blockCommands: {
|
|
18
19
|
'hovering-toolbar': GraphBlockCommands;
|
|
19
20
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DropHandler } from '../../../../@ones-editor/drop-target';
|
|
2
2
|
import { OnesEditor, BlockElement, ContainerElement } from '../../../../@ones-editor/core';
|
|
3
3
|
export default class HeadingBlockDropHandler implements DropHandler {
|
|
4
|
-
handleDrop(editor: OnesEditor,
|
|
4
|
+
handleDrop(editor: OnesEditor, dragData: BlockElement | File[], targetContainer: ContainerElement, blockIndex: number): boolean | undefined;
|
|
5
5
|
}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { OnesEditor } from '../../../../@ones-editor/core';
|
|
2
2
|
export default class OnesEditorImageDragHandler {
|
|
3
3
|
private editor;
|
|
4
|
+
img: HTMLImageElement;
|
|
5
|
+
private dragContainer;
|
|
6
|
+
private startPosition;
|
|
4
7
|
constructor(editor: OnesEditor);
|
|
5
8
|
destroy(): void;
|
|
6
9
|
handleDragStart: (event: DragEvent) => Promise<void>;
|
|
10
|
+
handleDrag: (e: DragEvent) => void;
|
|
7
11
|
handleDragEnd: () => void;
|
|
8
12
|
}
|
|
9
13
|
declare global {
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import { BlockElement, DragObject, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
2
|
import { ImageDragInsertPos } from './types';
|
|
3
|
-
export declare function
|
|
3
|
+
export declare function getDragInsertPos(editor: OnesEditor, block: BlockElement, images: HTMLElement[], x: number, y?: number): {
|
|
4
|
+
rect: DOMRect;
|
|
5
|
+
data: number;
|
|
6
|
+
};
|
|
7
|
+
export declare function handleDropOver(editor: OnesEditor, block: BlockElement, dragObject: DragObject | null, x: number, y: number): ImageDragInsertPos | undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { BlockElement, DragObject, DropInsertPos, DropOptions, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
-
export declare function handleDrop(editor: OnesEditor, block: BlockElement,
|
|
2
|
+
export declare function handleDrop(editor: OnesEditor, block: BlockElement, dragData: DragObject | File[], insertPos: DropInsertPos, options: DropOptions): boolean | undefined;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { OnesEditor, OnesEditorInputHandler } from '../../../@ones-editor/core';
|
|
2
|
+
declare class EmptyImageConverterInputHandler implements OnesEditorInputHandler {
|
|
3
|
+
handleAfterInsertText(editor: OnesEditor, containerId: string, blockIndex: number, offset: number, text: string): boolean;
|
|
4
|
+
}
|
|
5
|
+
export default EmptyImageConverterInputHandler;
|
|
@@ -2,8 +2,9 @@ import { Embed } from '../../../@ones-editor/core';
|
|
|
2
2
|
import { ImageObject } from './image-object';
|
|
3
3
|
import './image-embed-style.scss';
|
|
4
4
|
import './locale';
|
|
5
|
+
import EmptyImageConverterInputHandler from './empty-image-converter';
|
|
5
6
|
export * from './shortcuts';
|
|
6
7
|
export * from './types';
|
|
7
8
|
export { ImageObject };
|
|
8
9
|
declare const ImageEmbed: Embed;
|
|
9
|
-
export { ImageEmbed };
|
|
10
|
+
export { ImageEmbed, EmptyImageConverterInputHandler };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BlockElement, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
+
import { DocListBlock, ListBlockType } from '../types';
|
|
3
|
+
type ConvertToListData = {
|
|
4
|
+
listType?: ListBlockType;
|
|
5
|
+
};
|
|
6
|
+
export declare function findNearestList(srcBlock: BlockElement, type: ListBlockType): BlockElement | null;
|
|
7
|
+
export declare function convertToList(editor: OnesEditor, srcBlock: BlockElement, options: {
|
|
8
|
+
offset: number;
|
|
9
|
+
data?: ConvertToListData;
|
|
10
|
+
}): {
|
|
11
|
+
blockData: DocListBlock;
|
|
12
|
+
onConverted: (editor: OnesEditor, block: BlockElement) => void;
|
|
13
|
+
} | null;
|
|
14
|
+
export {};
|
|
@@ -1,14 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
type ConvertToListData = {
|
|
4
|
-
listType?: ListBlockType;
|
|
5
|
-
};
|
|
6
|
-
export declare function findNearestList(srcBlock: BlockElement, type: ListBlockType): BlockElement | null;
|
|
7
|
-
export declare function convertToList(editor: OnesEditor, srcBlock: BlockElement, options: {
|
|
8
|
-
offset: number;
|
|
9
|
-
data?: ConvertToListData;
|
|
10
|
-
}): {
|
|
11
|
-
blockData: DocListBlock;
|
|
12
|
-
onConverted: (editor: OnesEditor, block: BlockElement) => void;
|
|
13
|
-
} | null;
|
|
14
|
-
export {};
|
|
1
|
+
export * from './convert-to-list';
|
|
2
|
+
export * from './convert-list-to';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { OnesEditor, BlockElement, DragObject, DropInsertPos, DropOptions } from '../../../../@ones-editor/core';
|
|
2
|
-
export declare function handleListDrop(editor: OnesEditor, block: BlockElement,
|
|
2
|
+
export declare function handleListDrop(editor: OnesEditor, block: BlockElement, dragData: DragObject | File[], insertPos: DropInsertPos, options: DropOptions): boolean;
|
|
@@ -2,8 +2,9 @@ import { TextKindBlock } from '../../../@ones-editor/core';
|
|
|
2
2
|
import OnesEditorListMindmap from './mindmap';
|
|
3
3
|
import './lang';
|
|
4
4
|
import './style.scss';
|
|
5
|
+
import { getListAllNextBrothers } from './utils/list-brother';
|
|
6
|
+
import { resetListStart } from './start/reset-list-start';
|
|
5
7
|
export { type ListOptions } from './types';
|
|
6
8
|
declare const ListBlock: TextKindBlock;
|
|
7
|
-
export * from './command/covert-to-list';
|
|
8
9
|
export * from './keyboard/to-text-block';
|
|
9
|
-
export { ListBlock, OnesEditorListMindmap, };
|
|
10
|
+
export { ListBlock, OnesEditorListMindmap, resetListStart, getListAllNextBrothers, };
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { BlockElement, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
+
export declare function canDecreaseListBlockLevel(editor: OnesEditor, block: BlockElement): boolean;
|
|
2
3
|
export declare function decreaseListBlockLevel(editor: OnesEditor, block: BlockElement): boolean;
|
|
@@ -2,7 +2,7 @@ import { BlockElement, OnesEditor, OnesEditorCustom } from '../../../../@ones-ed
|
|
|
2
2
|
import './mindmap.scss';
|
|
3
3
|
export default class OnesEditorListMindmap implements OnesEditorCustom {
|
|
4
4
|
private editor;
|
|
5
|
-
toMindmapButton:
|
|
5
|
+
toMindmapButton: HTMLElement;
|
|
6
6
|
currentBlock: BlockElement | null;
|
|
7
7
|
constructor(editor: OnesEditor);
|
|
8
8
|
static get(editor: OnesEditor): OnesEditorListMindmap | null;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { OnesEditor } from '../../../../../@ones-editor/core';
|
|
2
|
-
export declare function createToMindmapButton(editor: OnesEditor):
|
|
2
|
+
export declare function createToMindmapButton(editor: OnesEditor): HTMLDivElement;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { BlockElement, CommandItem, DocBlock, OnesEditor } from '../../../@ones-editor/core';
|
|
1
|
+
import { BlockElement, CommandItem, DocBlock, DocBlockText, OnesEditor } from '../../../@ones-editor/core';
|
|
2
2
|
export interface DocListBlock extends DocBlock {
|
|
3
|
+
text: DocBlockText;
|
|
3
4
|
level: number;
|
|
4
5
|
start: number;
|
|
5
6
|
ordered: boolean;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { BlockElement } from '../../../../@ones-editor/core';
|
|
2
|
-
export declare function getListPrevBrother(block: BlockElement
|
|
2
|
+
export declare function getListPrevBrother(block: BlockElement, options?: {
|
|
3
|
+
ignoreGroupId: boolean;
|
|
4
|
+
}): BlockElement | null;
|
|
3
5
|
export declare function getListNextBrother(block: BlockElement): BlockElement | null;
|
|
4
6
|
export declare function getListAllPrevBrothers(block: BlockElement): BlockElement[];
|
|
5
7
|
export declare function getListAllNextBrothers(block: BlockElement): BlockElement[];
|
|
@@ -2,3 +2,4 @@ import { marked } from 'marked';
|
|
|
2
2
|
import { DocBlock } from '../../../../../@ones-editor/core';
|
|
3
3
|
import { TokenToBlockOptions } from '../base';
|
|
4
4
|
export declare function paragraphToBlocks(token: marked.Tokens.Paragraph, options: TokenToBlockOptions): DocBlock[];
|
|
5
|
+
export declare function textToBlocks(token: marked.Tokens.Text, options: TokenToBlockOptions): DocBlock[];
|
|
@@ -3,4 +3,5 @@ import { createEmptyMathjaxBox, editMathjaxBox } from './mathjax-box/mathjax-box
|
|
|
3
3
|
import MathjaxEmbed from './mathjax-embed';
|
|
4
4
|
import './mathjax-style.scss';
|
|
5
5
|
import './locale';
|
|
6
|
-
|
|
6
|
+
import ConvertEmptyMathjaxBoxInputHandler from './mathjax-box/convert-mathjax';
|
|
7
|
+
export { MathjaxBox, MathjaxEmbed, createEmptyMathjaxBox, editMathjaxBox, ConvertEmptyMathjaxBoxInputHandler, };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { OnesEditor, OnesEditorInputHandler } from '../../../../@ones-editor/core';
|
|
2
|
+
declare class ConvertEmptyMathjaxBoxInputHandler implements OnesEditorInputHandler {
|
|
3
|
+
handleAfterInsertText(editor: OnesEditor, containerId: string, blockIndex: number, offset: number, text: string): boolean;
|
|
4
|
+
}
|
|
5
|
+
export default ConvertEmptyMathjaxBoxInputHandler;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
-
export type
|
|
3
|
-
export declare function editMathjax(editor: OnesEditor, elem: HTMLElement, tex: string,
|
|
2
|
+
export type OnEditChange = (tex: string, end: boolean) => void;
|
|
3
|
+
export declare function editMathjax(editor: OnesEditor, elem: HTMLElement, tex: string, onChange: OnEditChange): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InsertEmptyBlockOptions, DocEmbedBlock, DocEmbedData } from '../../../../@ones-editor/core';
|
|
1
|
+
import { InsertEmptyBlockOptions, DocEmbedBlock, DocEmbedData, DocObject } from '../../../../@ones-editor/core';
|
|
2
2
|
import type { Embed, OnesEditor, BlockContentElement, BlockElement } from '../../../../@ones-editor/core';
|
|
3
3
|
import { MediaType } from '../constant';
|
|
4
4
|
import { Media } from './media';
|
|
@@ -20,10 +20,12 @@ export declare abstract class MediaEmbed implements Embed {
|
|
|
20
20
|
icon: string;
|
|
21
21
|
order: number;
|
|
22
22
|
group: string;
|
|
23
|
+
subText: string;
|
|
23
24
|
}[];
|
|
24
25
|
handleInsertEmptyEmbed: (editor: OnesEditor, options: InsertEmptyBlockOptions) => Promise<BlockElement | null>;
|
|
25
26
|
};
|
|
26
27
|
createEmbedContent(editor: OnesEditor, content: BlockContentElement, blockData: DocEmbedBlock<DocEmbedData>): void;
|
|
27
28
|
handleUpdateBlock(editor: OnesEditor, block: BlockElement, blockData: DocEmbedBlock<DocEmbedData>): boolean;
|
|
28
29
|
handleDeleteBlock(editor: OnesEditor, block: BlockElement): void;
|
|
30
|
+
convertTo(editor: OnesEditor, blockData: DocEmbedBlock, doc: DocObject, type: 'html' | 'text' | 'markdown'): string;
|
|
29
31
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { OnesEditorCustom, OnesEditor } from '../../../@ones-editor/core';
|
|
2
2
|
export default class OnesEditorBlockMention implements OnesEditorCustom {
|
|
3
3
|
private editor;
|
|
4
|
-
mentionButton:
|
|
4
|
+
mentionButton: HTMLElement;
|
|
5
5
|
constructor(editor: OnesEditor);
|
|
6
6
|
private shouldBlockShowMention;
|
|
7
7
|
private handleHoveringBlock;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
-
export declare function createMentionButton(editor: OnesEditor):
|
|
2
|
+
export declare function createMentionButton(editor: OnesEditor): HTMLDivElement;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { OnesEditor, OnesEditorCustom } from '../../../@ones-editor/core';
|
|
2
|
+
export declare class OnesEditorMobileHelper implements OnesEditorCustom {
|
|
3
|
+
private editor;
|
|
4
|
+
private longPressTimeout;
|
|
5
|
+
constructor(editor: OnesEditor);
|
|
6
|
+
destroy(): void;
|
|
7
|
+
handleSelectionChange: () => void;
|
|
8
|
+
handleLongPress: (event: TouchEvent) => void;
|
|
9
|
+
handleTouchStart: (event: TouchEvent) => void;
|
|
10
|
+
handleTouchEnd: (event: TouchEvent) => void;
|
|
11
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OnesEditor, OnesEditorDocs, OnesEditorInputHandler } from '../../../@ones-editor/core';
|
|
2
2
|
export default class OnesEditorPasteHandler implements OnesEditorInputHandler {
|
|
3
3
|
constructor(editor: OnesEditor);
|
|
4
|
-
handleBeforePaste(editor: OnesEditor, event: ClipboardEvent, docs: OnesEditorDocs): Promise<boolean>;
|
|
4
|
+
handleBeforePaste(editor: OnesEditor, event: ClipboardEvent | null, docs: OnesEditorDocs): Promise<boolean>;
|
|
5
5
|
handleInsertImages(editor: OnesEditor, images: File[]): Promise<void>;
|
|
6
6
|
}
|
|
@@ -8,7 +8,7 @@ export default class PasteSpecialHandler implements OnesEditorInputHandler {
|
|
|
8
8
|
constructor(editor: OnesEditor);
|
|
9
9
|
destroy(): void;
|
|
10
10
|
handleChanged(editor: OnesEditor, action: OnesEditorUndoAction): void;
|
|
11
|
-
handleBeforePaste(editor: OnesEditor, event: ClipboardEvent): Promise<boolean>;
|
|
12
|
-
handleAfterPaste(editor: OnesEditor, event: ClipboardEvent, docs: OnesEditorDocs): Promise<boolean>;
|
|
11
|
+
handleBeforePaste(editor: OnesEditor, event: ClipboardEvent | null): Promise<boolean>;
|
|
12
|
+
handleAfterPaste(editor: OnesEditor, event: ClipboardEvent | null, docs: OnesEditorDocs): Promise<boolean>;
|
|
13
13
|
handlePasteSpecial: (doc: DocObject) => void;
|
|
14
14
|
}
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import { ScrollAreaElement, ScrollContainerElement, ScrollCore } from './common-types';
|
|
2
|
+
export declare function getElementScale(element: Element): number;
|
|
3
|
+
export declare function getSizeAsScale(element: HTMLElement, num: number): number;
|
|
2
4
|
export declare function getScrollWrapPaddingSize(scrollWrap: ScrollAreaElement): {
|
|
3
5
|
paddingBottom: number;
|
|
4
6
|
paddingTop: number;
|
|
5
7
|
paddingLeft: number;
|
|
6
8
|
paddingRight: number;
|
|
7
9
|
};
|
|
10
|
+
export declare function getElementScrollSize(scrollContainer: Element): {
|
|
11
|
+
scrollLeft: number;
|
|
12
|
+
scrollWidth: number;
|
|
13
|
+
clientWidth: number;
|
|
14
|
+
clientHeight: number;
|
|
15
|
+
};
|
|
16
|
+
export declare function getElementOffset(element: HTMLElement, key: 'offsetLeft' | 'offsetTop' | 'offsetWidth' | 'offsetHeight'): number;
|
|
8
17
|
export declare function getOriginBoundaryData(scrollCore: ScrollCore, scrollContainer: ScrollContainerElement): {
|
|
9
18
|
originWidth: number;
|
|
10
19
|
maxLeft: number;
|
|
@@ -3,29 +3,19 @@ import { ScrollContainerOptions } from './types';
|
|
|
3
3
|
export * from './types';
|
|
4
4
|
export interface ChildEvents {
|
|
5
5
|
scroll: (scrollContainer: ScrollContainer) => void;
|
|
6
|
+
resize: (scrollContainer: ScrollContainer) => void;
|
|
6
7
|
}
|
|
7
8
|
export declare class ScrollContainer extends TypedEmitter<ChildEvents> {
|
|
8
|
-
private
|
|
9
|
-
private
|
|
10
|
-
private scrollContainerElement
|
|
11
|
-
constructor(options: ScrollContainerOptions);
|
|
9
|
+
private scrollListener?;
|
|
10
|
+
private options?;
|
|
11
|
+
private scrollContainerElement?;
|
|
12
12
|
get rootElement(): HTMLElement;
|
|
13
13
|
get contentElement(): HTMLElement;
|
|
14
|
-
get scrollOptions():
|
|
15
|
-
|
|
16
|
-
safeLeftSpace?: number | undefined;
|
|
17
|
-
barFloatWindowBottom?: number | undefined;
|
|
18
|
-
parentContainer: Element;
|
|
19
|
-
locatingContainer: Element;
|
|
20
|
-
parentElement: HTMLElement;
|
|
21
|
-
childElement: HTMLElement;
|
|
22
|
-
paddingTop?: number | undefined;
|
|
23
|
-
paddingLeft?: number | undefined;
|
|
24
|
-
paddingBottom?: number | undefined;
|
|
25
|
-
paddingRight?: number | undefined;
|
|
26
|
-
};
|
|
14
|
+
get scrollOptions(): ScrollContainerOptions;
|
|
15
|
+
init: (options: ScrollContainerOptions) => void;
|
|
27
16
|
private handleContainerScroll;
|
|
17
|
+
private handleResize;
|
|
28
18
|
private handleBaseListenerDestroy;
|
|
29
19
|
destroy(): void;
|
|
30
20
|
}
|
|
31
|
-
export declare function createScrollContainer(
|
|
21
|
+
export declare function createScrollContainer(): ScrollContainer;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ScrollContainerElement, ScrollCore } from '../common-types';
|
|
2
2
|
export declare class ContainerResizeObserver {
|
|
3
3
|
private scrollCore;
|
|
4
|
+
private callback;
|
|
4
5
|
private resizeObserver;
|
|
5
|
-
constructor(scrollCore: ScrollCore);
|
|
6
|
+
constructor(scrollCore: ScrollCore, callback: (scrollContainer: ScrollContainerElement) => void);
|
|
6
7
|
private get containers();
|
|
7
8
|
private handleResizeEntry;
|
|
8
9
|
private handleContentResize;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ScrollContainerElement, ScrollCore } from '../common-types';
|
|
2
|
+
export declare class LocatingContainerResizeObserver {
|
|
3
|
+
private scrollCore;
|
|
4
|
+
private callback;
|
|
5
|
+
private resizeObserver;
|
|
6
|
+
private scrollContainersMap;
|
|
7
|
+
constructor(scrollCore: ScrollCore, callback: (scrollContainer: ScrollContainerElement) => void);
|
|
8
|
+
private handleResizeEntry;
|
|
9
|
+
private handleResize;
|
|
10
|
+
bind(scrollContainer: ScrollContainerElement): void;
|
|
11
|
+
unbind(scrollContainer: ScrollContainerElement): void;
|
|
12
|
+
destroy(): void;
|
|
13
|
+
}
|
|
@@ -4,6 +4,7 @@ import { ScrollContainerOptions } from './types';
|
|
|
4
4
|
import './ui/bar.scss';
|
|
5
5
|
interface ChildEvents {
|
|
6
6
|
scroll: (scrollCore: ScrollListener, scrollContainerElement: ScrollContainerElement) => void;
|
|
7
|
+
resize: (scrollCore: ScrollListener, scrollContainerElement: ScrollContainerElement) => void;
|
|
7
8
|
}
|
|
8
9
|
export declare class ScrollListener extends TypedEmitter<ChildEvents> implements ScrollCore {
|
|
9
10
|
private parentContainer;
|
|
@@ -12,11 +13,13 @@ export declare class ScrollListener extends TypedEmitter<ChildEvents> implements
|
|
|
12
13
|
private containerScrollObserver;
|
|
13
14
|
private parentContainerScrollObserver;
|
|
14
15
|
private scrollWrapResizeObserve;
|
|
16
|
+
private locatingContainerResizeObserver;
|
|
15
17
|
private isWindowEventBind;
|
|
16
18
|
containers: ScrollCore['containers'];
|
|
17
19
|
constructor(parentContainer: ParentContainerElement);
|
|
18
20
|
private load;
|
|
19
21
|
private handleScrollContainerScroll;
|
|
22
|
+
private handleResize;
|
|
20
23
|
getParentScrollContainer(): Element;
|
|
21
24
|
private handleIntersection;
|
|
22
25
|
private handleWindowEffect;
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
import { Connection, Doc } from 'sharedb/lib/client';
|
|
3
3
|
import ReconnectingWebSocket, { Event } from 'reconnecting-websocket';
|
|
4
4
|
import { EventEmitter } from 'events';
|
|
5
|
-
import { AuthMessage,
|
|
5
|
+
import { AuthMessage, ReauthFunc } from '../types';
|
|
6
6
|
import './sharedb-ext';
|
|
7
7
|
export declare class AuthConnection {
|
|
8
8
|
url: string;
|
|
9
|
-
private
|
|
9
|
+
private reauthFunc?;
|
|
10
10
|
connection?: Connection;
|
|
11
11
|
ws?: ReconnectingWebSocket;
|
|
12
12
|
retryCount: number;
|
|
13
13
|
events: EventEmitter;
|
|
14
14
|
token: string | null;
|
|
15
15
|
resourceToken: string | null;
|
|
16
|
-
constructor(url: string,
|
|
16
|
+
constructor(url: string, reauthFunc?: ReauthFunc | undefined);
|
|
17
17
|
getBaseURL(): string;
|
|
18
18
|
getBase64BaseURL(): string;
|
|
19
19
|
auth(auth: AuthMessage): Promise<{
|
|
@@ -3,14 +3,14 @@ import { Doc } from 'sharedb/lib/client';
|
|
|
3
3
|
import { Event } from 'reconnecting-websocket';
|
|
4
4
|
import type { AxiosResponse } from 'axios';
|
|
5
5
|
import { AuthConnection } from './auth-connection';
|
|
6
|
-
import { EditorDoc,
|
|
6
|
+
import { EditorDoc, ReauthFunc, AuthMessage, OnProgress, EditorOp, LinkDetails } from '../types';
|
|
7
7
|
export default class ShareDBClient {
|
|
8
8
|
connection: AuthConnection;
|
|
9
9
|
auth: AuthMessage;
|
|
10
10
|
private doc;
|
|
11
|
-
private
|
|
11
|
+
private reauthFunc?;
|
|
12
12
|
clientId: string;
|
|
13
|
-
constructor(auth: AuthMessage, serverUrl: string,
|
|
13
|
+
constructor(auth: AuthMessage, serverUrl: string, reauthFunc?: ReauthFunc);
|
|
14
14
|
editorServer(): string;
|
|
15
15
|
close(logout: boolean): void;
|
|
16
16
|
on(event: 'open' | 'close' | 'error', callback: (event: Event | Error) => void): void;
|
|
@@ -11,13 +11,18 @@ export default class ShareDBDoc extends EventCallbacks<ShareDBDocCallbacks> impl
|
|
|
11
11
|
remoteCaretHandler: RemoteCaretsHandler;
|
|
12
12
|
batching: number;
|
|
13
13
|
status: OnesEditorDocStatus;
|
|
14
|
-
|
|
14
|
+
disableLogout: boolean;
|
|
15
|
+
destroyed: boolean;
|
|
16
|
+
constructor(client: ShareDBClient, doc: Doc, disableLogout?: boolean);
|
|
15
17
|
beginBatchUpdate(): number;
|
|
16
18
|
endBatchUpdate(): number;
|
|
17
19
|
static load(options: ShareDBDocOptions): Promise<ShareDBDoc>;
|
|
18
20
|
private handleNothingPending;
|
|
19
21
|
private handleCreate;
|
|
20
22
|
private handleDel;
|
|
23
|
+
private handleReload;
|
|
24
|
+
private handleReset;
|
|
25
|
+
private handleWriteConflictError;
|
|
21
26
|
private setStatus;
|
|
22
27
|
initEvents(): void;
|
|
23
28
|
clearEvents(): void;
|
|
@@ -62,14 +62,15 @@ export declare const FileExtError: {
|
|
|
62
62
|
};
|
|
63
63
|
export declare const AuthHeader = "x-live-editor-token";
|
|
64
64
|
export declare const BaseURLHeader = "x-live-editor-base-url";
|
|
65
|
-
export type
|
|
65
|
+
export type ReauthFunc = () => Promise<AuthMessage>;
|
|
66
66
|
export type OnProgress = (percentage: number) => void;
|
|
67
67
|
export interface ShareDBDocOptions {
|
|
68
68
|
auth: AuthMessage;
|
|
69
69
|
serverUrl: string;
|
|
70
|
-
|
|
70
|
+
reauthFunc?: ReauthFunc;
|
|
71
71
|
autoCreateDoc?: boolean;
|
|
72
72
|
templateData?: EditorDoc;
|
|
73
|
+
disableLogout?: boolean;
|
|
73
74
|
}
|
|
74
75
|
export interface EditorOp {
|
|
75
76
|
c: string;
|
|
@@ -6,6 +6,11 @@ declare const _default: {
|
|
|
6
6
|
mergeCell: string;
|
|
7
7
|
splitCell: string;
|
|
8
8
|
tableConfigKey: string;
|
|
9
|
+
deleteTable: string;
|
|
10
|
+
insertCol: string;
|
|
11
|
+
insertRow: string;
|
|
12
|
+
deleteCol: string;
|
|
13
|
+
deleteRow: string;
|
|
9
14
|
tableConfig: {
|
|
10
15
|
rowTitle: string;
|
|
11
16
|
colTitle: string;
|
|
@@ -6,6 +6,11 @@ declare const _default: {
|
|
|
6
6
|
mergeCell: string;
|
|
7
7
|
splitCell: string;
|
|
8
8
|
tableConfigKey: string;
|
|
9
|
+
deleteTable: string;
|
|
10
|
+
insertCol: string;
|
|
11
|
+
insertRow: string;
|
|
12
|
+
deleteCol: string;
|
|
13
|
+
deleteRow: string;
|
|
9
14
|
tableConfig: {
|
|
10
15
|
rowTitle: string;
|
|
11
16
|
colTitle: string;
|