@ones-editor/editor 2.1.7 → 2.1.8
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/comments/src/comments-helper/old-version-comment.d.ts +16 -0
- package/@ones-editor/comments/src/index.d.ts +3 -0
- package/@ones-editor/core/src/core/blocks/common/block-properties.d.ts +9 -9
- package/@ones-editor/core/src/core/blocks/complex-blocks/child-blocks.d.ts +2 -1
- package/@ones-editor/core/src/core/blocks/complex-blocks/complex-block-helper.d.ts +2 -1
- package/@ones-editor/core/src/core/blocks/text-blocks/base/child.d.ts +2 -7
- package/@ones-editor/core/src/core/doc/doc.d.ts +3 -0
- package/@ones-editor/core/src/core/types.d.ts +11 -2
- package/@ones-editor/sharedb-doc/src/doc/sharedb-client-base.d.ts +24 -0
- package/@ones-editor/sharedb-doc/src/doc/sharedb-client.d.ts +4 -1
- package/@ones-editor/sharedb-doc/src/doc/sharedb-local-doc.d.ts +17 -0
- package/@ones-editor/sharedb-doc/src/index.d.ts +8 -1
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/@ones-editor/ui/src/index.d.ts +5 -2
- package/@ones-editor/ui/src/readonly-toolbar/add-comment-to-old-doc.d.ts +23 -0
- package/@ones-editor/ui/src/readonly-toolbar/index.d.ts +30 -0
- package/@ones-editor/ui/src/readonly-toolbar/types.d.ts +12 -0
- package/@ones-editor/ui/src/toolbar/link-commands.d.ts +7 -0
- package/dist/comments/local-doc-comments-provider.d.ts +2 -1
- package/dist/index.d.ts +57 -1
- package/dist/index.js +16930 -16041
- package/package.json +1 -1
|
@@ -12,7 +12,10 @@ import { InlineBoxCommandProvider } from './quick-menu/inline-box-items';
|
|
|
12
12
|
import './locale';
|
|
13
13
|
import type { OnesEditorToolbarBase } from './toolbar/types';
|
|
14
14
|
import type { QuickMenuItem } from './quick-menu';
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
import { ReadonlyToolbar } from './readonly-toolbar';
|
|
16
|
+
import { ReadonlyToolbarCommandProvider, ReadonlyCommandOptions } from './readonly-toolbar/types';
|
|
17
|
+
import { AddCommentToOldDocCommandProvider } from './readonly-toolbar/add-comment-to-old-doc';
|
|
18
|
+
export type { QuickMenuItemFilter, QuickMenuCommandParams, QuickMenuCommandProvider, QuickMenuCommandBetween, AddMenuCommand, QuickMenuCommandInline, GetAllQuickMenuItemsOptions, OnesEditorToolbarBase, ReadonlyToolbarCommandProvider, ReadonlyCommandOptions, };
|
|
19
|
+
export { OnesEditorToolbar, OnesEditorQuickMenu, OnesEditorTooltip, getAllQuickMenuItems, QuickMenuItem, editLink, TextStyleShortcuts, getToolbar, getHeadingMenuOptions, BasicCommands, GroupOrder, isSelectBoxOnly, InlineBoxCommandProvider, getReferenceClientRect, ReadonlyToolbar, AddCommentToOldDocCommandProvider, };
|
|
17
20
|
export { createTextButton } from './text-button';
|
|
18
21
|
export { mergeCommands } from './toolbar/merge-commands';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { BlockElement, CommandItem, OnesEditor, OnesEditorBlockHook, SelectionRange, TextBlockContentChild } from '../../../../@ones-editor/core';
|
|
2
|
+
import { ReadonlyCommandOptions, ReadonlyToolbarCommandProvider } from './types';
|
|
3
|
+
export declare class AddCommentToOldDocCommandProvider implements ReadonlyToolbarCommandProvider, OnesEditorBlockHook {
|
|
4
|
+
private editor;
|
|
5
|
+
private version;
|
|
6
|
+
private localCreatedComments;
|
|
7
|
+
constructor(editor: OnesEditor, version: number);
|
|
8
|
+
onCreateComment(commentId: string, local: boolean): Promise<void>;
|
|
9
|
+
onDeleteComment(commentId: string, local: boolean): Promise<void>;
|
|
10
|
+
onUpdateComment(commentId: string, local: boolean): Promise<void>;
|
|
11
|
+
hideToolbar(editor: OnesEditor): void;
|
|
12
|
+
commands(editor: OnesEditor, blockElement: BlockElement, child: TextBlockContentChild | null): {
|
|
13
|
+
group: string;
|
|
14
|
+
commands: {
|
|
15
|
+
id: string;
|
|
16
|
+
name: string;
|
|
17
|
+
icon: string;
|
|
18
|
+
}[];
|
|
19
|
+
executeCommand: (editor: OnesEditor, block: BlockElement, item: CommandItem, child: TextBlockContentChild | null) => void;
|
|
20
|
+
} | undefined;
|
|
21
|
+
getTextCommands(editor: OnesEditor, range: SelectionRange): CommandItem[];
|
|
22
|
+
executeCommand(editor: OnesEditor, command: CommandItem, options: ReadonlyCommandOptions): void;
|
|
23
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/// <reference types="lodash" />
|
|
2
|
+
import { BlockElement, CommandItem, OnesEditor, OnesEditorCustom, SelectionRange, TextBlockContentChild } from '../../../../@ones-editor/core';
|
|
3
|
+
import { AbstractCommandBar, ManualToolbar } from '../../../../@ones-editor/ui-base';
|
|
4
|
+
import type { ReadonlyToolbarCommandProvider } from './types';
|
|
5
|
+
export declare class ReadonlyToolbar implements OnesEditorCustom {
|
|
6
|
+
private editor;
|
|
7
|
+
toolbar: ManualToolbar;
|
|
8
|
+
toolbarType: 'text' | 'object';
|
|
9
|
+
mouseDown: boolean;
|
|
10
|
+
hoveringBlock: BlockElement | null;
|
|
11
|
+
hoveringTextChild: TextBlockContentChild | null;
|
|
12
|
+
oldRange: SelectionRange | null;
|
|
13
|
+
providers: ReadonlyToolbarCommandProvider[];
|
|
14
|
+
constructor(editor: OnesEditor);
|
|
15
|
+
destroy(): void;
|
|
16
|
+
addProvider(provider: ReadonlyToolbarCommandProvider): void;
|
|
17
|
+
isInBlock(block: BlockElement, event: MouseEvent): boolean;
|
|
18
|
+
handleButtonClick: (toolbar: AbstractCommandBar, item: CommandItem) => void;
|
|
19
|
+
handleClose: () => void;
|
|
20
|
+
handleClosing: (bar: unknown, event: MouseEvent) => boolean;
|
|
21
|
+
bindEvents(): void;
|
|
22
|
+
unbindEvents(): void;
|
|
23
|
+
handleDocumentMouseDown: (event: MouseEvent) => void;
|
|
24
|
+
handleDocumentMouseUp: () => void;
|
|
25
|
+
handleSelectionChange: import("lodash").DebouncedFunc<(editor: OnesEditor) => void>;
|
|
26
|
+
private handleHoveringBlockChildChange;
|
|
27
|
+
groupCommands: (allCommands: CommandItem[]) => CommandItem[];
|
|
28
|
+
showTextToolbar(reason: string): void;
|
|
29
|
+
showObjectToolbar(event: MouseEvent | null): void;
|
|
30
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BlockElement, CommandItem, OnesEditor, SelectionRange, TextBlockContentChild } from '../../../../@ones-editor/core';
|
|
2
|
+
import { CommandBar } from '../../../../@ones-editor/ui-base';
|
|
3
|
+
export interface ReadonlyCommandOptions {
|
|
4
|
+
hoveringBlock: BlockElement | null;
|
|
5
|
+
hoveringTextChild: TextBlockContentChild | null;
|
|
6
|
+
bar: CommandBar;
|
|
7
|
+
}
|
|
8
|
+
export interface ReadonlyToolbarCommandProvider {
|
|
9
|
+
getTextCommands?: (editor: OnesEditor, range: SelectionRange) => CommandItem[];
|
|
10
|
+
destroy?: () => void;
|
|
11
|
+
executeCommand: (editor: OnesEditor, command: CommandItem, options: ReadonlyCommandOptions) => void;
|
|
12
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BlockCommands, BlockElement, CommandItem, OnesEditor, OnesEditorBlockHook, TextBlockContentChild } from '../../../../@ones-editor/core';
|
|
2
|
+
export declare class LinkCommands implements OnesEditorBlockHook {
|
|
3
|
+
private editor;
|
|
4
|
+
constructor(editor: OnesEditor);
|
|
5
|
+
commands(editor: OnesEditor, block: BlockElement, child: TextBlockContentChild | null): BlockCommands | undefined;
|
|
6
|
+
executeCommand: (editor: OnesEditor, block: BlockElement, item: CommandItem, child: TextBlockContentChild | null) => void;
|
|
7
|
+
}
|
|
@@ -3,7 +3,8 @@ import { DocObject, LocalDoc, OnesEditor, OnesEditorComment, OnesEditorDoc } fro
|
|
|
3
3
|
export default class LocalDocCommentsProvider implements OnesEditorCommentsProvider {
|
|
4
4
|
private editor;
|
|
5
5
|
private localDoc;
|
|
6
|
-
private
|
|
6
|
+
private _listeners;
|
|
7
|
+
private _doc;
|
|
7
8
|
constructor(editor: OnesEditor, localDoc: OnesEditorDoc);
|
|
8
9
|
get doc(): DocObject;
|
|
9
10
|
getComments(): OnesEditorComment[];
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import { OnesEditor, DocObject, OnesEditorDoc } from '../@ones-editor/core';
|
|
1
|
+
import { OnesEditor, DocObject, OnesEditorDoc, OnesEditorBlockRenderer } from '../@ones-editor/core';
|
|
2
|
+
import { RemoteCaretsDecorator } from '../@ones-editor/sharedb-doc';
|
|
3
|
+
import { TableBlockCommandProvider } from '../@ones-editor/table-block';
|
|
4
|
+
import { CodeTextDecorator } from '../@ones-editor/code-block';
|
|
2
5
|
import * as OnesEditorIcons from '../@ones-editor/ui-base/src/icons';
|
|
6
|
+
import { BlockExclusiveHook } from '../@ones-editor/exclusive-block';
|
|
3
7
|
import { OnesEditorVersionsDialog, VersionDialogOptions } from '../@ones-editor/versions';
|
|
4
8
|
import ShareDBDocVersionsProvider from './versions/versions-provider';
|
|
5
9
|
import { CreateLocalEditorOptions, CreateOnesEditorOptions } from './types';
|
|
@@ -33,6 +37,58 @@ export * from 'tiny-typed-emitter';
|
|
|
33
37
|
export { ShareDBDocVersionsProvider, OnesEditorIcons };
|
|
34
38
|
export type { FileBoxData, FileEmbedData } from '../@ones-editor/file';
|
|
35
39
|
export { type DocListBlock } from '../@ones-editor/list-block';
|
|
40
|
+
export declare function getDefaultOnesEditorOptions(options: CreateOnesEditorOptions): {
|
|
41
|
+
id: string | undefined;
|
|
42
|
+
scrollContainer: HTMLElement | undefined;
|
|
43
|
+
enableComments: boolean | undefined;
|
|
44
|
+
enableContextMenu: boolean | undefined;
|
|
45
|
+
components: {
|
|
46
|
+
blocks: import("@ones-editor/core").Block[];
|
|
47
|
+
embeds: import("@ones-editor/core").Embed[];
|
|
48
|
+
boxes: import("@ones-editor/core").Box[];
|
|
49
|
+
commandProviders: (import("@ones-editor/core").OnesEditorCommandProvider | TableBlockCommandProvider)[];
|
|
50
|
+
decorators: (RemoteCaretsDecorator | CodeTextDecorator)[];
|
|
51
|
+
insertions: import("@ones-editor/core").Insertion[];
|
|
52
|
+
blockHooks: (import("@ones-editor/core").OnesEditorBlockHook | BlockExclusiveHook)[];
|
|
53
|
+
textRenders: OnesEditorBlockRenderer[];
|
|
54
|
+
options: {
|
|
55
|
+
drawIO?: import("@ones-editor/drawio-embed").DrawIoOptions | undefined;
|
|
56
|
+
media?: import("@ones-editor/media-embed").MediaEmbedOptions | undefined;
|
|
57
|
+
mermaid?: import("@ones-editor/graph-embed").MermaidEmbedOptions | undefined;
|
|
58
|
+
flowchart?: import("@ones-editor/graph-embed").FlowCharEmbedOptions | undefined;
|
|
59
|
+
plantuml?: import("@ones-editor/graph-embed").PlantumlEmbedOptions | undefined;
|
|
60
|
+
remoteCarets?: import("./types").RemoteCaretsOptions | undefined;
|
|
61
|
+
table?: import("@ones-editor/table-block").TableOptions | undefined;
|
|
62
|
+
image?: import("@ones-editor/image-embed").ImageOptions | undefined;
|
|
63
|
+
webpage?: import("@ones-editor/webpage-embed").WebpageOptions | undefined;
|
|
64
|
+
mention?: import("@ones-editor/mention").MentionOptions | undefined;
|
|
65
|
+
comment?: import("@ones-editor/comments").OnesEditorCommentOptions | undefined;
|
|
66
|
+
list?: import("@ones-editor/list-block").ListOptions | undefined;
|
|
67
|
+
quickMenu?: import("@ones-editor/ui/src/quick-menu").QuickMenuOptions | undefined;
|
|
68
|
+
templates?: import("@ones-editor/templates").TemplateOptions | undefined;
|
|
69
|
+
custom?: Record<string, unknown> | undefined;
|
|
70
|
+
popover?: import("@ones-editor/ui-base").PopoverOptions | undefined;
|
|
71
|
+
findDialog?: import("@ones-editor/ui-base").FindDialogOptions | undefined;
|
|
72
|
+
file?: import("@ones-editor/file").FileOptions | undefined;
|
|
73
|
+
code?: import("@ones-editor/code-block").CodeBlockExternalOptions | undefined;
|
|
74
|
+
mathjax?: import("@ones-editor/mathjax").MathjaxOptions | undefined;
|
|
75
|
+
link?: import("@ones-editor/ui/src/link-popup").LinkOptions | undefined;
|
|
76
|
+
columns?: import("@ones-editor/layout-block/src/types").EditorConfigLayoutOptions | undefined;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
shortcuts: import("@ones-editor/core").ShortcutRecords[];
|
|
80
|
+
colors: string[];
|
|
81
|
+
};
|
|
36
82
|
export declare function createOnesEditor(root: HTMLElement, options: CreateOnesEditorOptions): Promise<OnesEditor>;
|
|
37
83
|
export declare function createLocalEditor(root: HTMLElement, docData: DocObject | OnesEditorDoc, options: CreateLocalEditorOptions): Promise<OnesEditor>;
|
|
38
84
|
export declare function showDocVersions(editor: OnesEditor, options: VersionDialogOptions, serverUrl: string): Promise<OnesEditorVersionsDialog>;
|
|
85
|
+
export interface ShowDocVersionsOptions2 {
|
|
86
|
+
serverUrl: string;
|
|
87
|
+
appId: string;
|
|
88
|
+
docId: string;
|
|
89
|
+
token: string;
|
|
90
|
+
userId: string;
|
|
91
|
+
displayName: string;
|
|
92
|
+
options?: VersionDialogOptions;
|
|
93
|
+
}
|
|
94
|
+
export declare function showDocVersions2(parent: HTMLElement, options: ShowDocVersionsOptions2): Promise<OnesEditorVersionsDialog>;
|