@ones-editor/editor 2.3.4 → 2.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/@ones-editor/callout-block/src/callout-block/callout-block-content.d.ts +3 -2
- package/@ones-editor/callout-block/src/callout-block/callout-icon.d.ts +13 -0
- package/@ones-editor/callout-block/src/callout-block/helper.d.ts +4 -2
- package/@ones-editor/callout-block/src/locale/en-us.d.ts +3 -0
- package/@ones-editor/callout-block/src/locale/ja-jp.d.ts +3 -0
- package/@ones-editor/callout-block/src/locale/zh-cn.d.ts +3 -0
- package/@ones-editor/comments/src/index.d.ts +1 -0
- package/@ones-editor/comments/src/types.d.ts +5 -0
- package/@ones-editor/core/src/core/blocks/text-blocks/text-block/to-plain-html.d.ts +2 -2
- package/@ones-editor/core/src/core/composition/index.d.ts +1 -0
- package/@ones-editor/core/src/core/doc/doc.d.ts +0 -1
- package/@ones-editor/core/src/core/editor-doc/editor-doc.d.ts +0 -1
- package/@ones-editor/core/src/core/types.d.ts +12 -3
- package/@ones-editor/core/src/utils/dom.d.ts +1 -0
- package/@ones-editor/drawio-embed/src/lang/en-us.d.ts +5 -0
- package/@ones-editor/drawio-embed/src/lang/ja-jp.d.ts +5 -0
- package/@ones-editor/drawio-embed/src/lang/zh-cn.d.ts +5 -0
- package/@ones-editor/embed-block-helper/src/block-resizer/index.d.ts +6 -1
- package/@ones-editor/exclusive-block/src/index.d.ts +2 -0
- package/@ones-editor/graph-embed/src/command.d.ts +9 -0
- package/@ones-editor/graph-embed/src/config/index.d.ts +9 -1
- package/@ones-editor/graph-embed/src/flowchart/flowchart-embed.d.ts +1 -1
- package/@ones-editor/graph-embed/src/flowchart/flowchart-helper.d.ts +2 -1
- package/@ones-editor/graph-embed/src/flowchart/flowchart.d.ts +11 -3
- package/@ones-editor/graph-embed/src/helper/graph-base.d.ts +29 -23
- package/@ones-editor/graph-embed/src/helper/graph-block-commands.d.ts +3 -4
- package/@ones-editor/graph-embed/src/helper/graph-dom/code-editor.d.ts +4 -0
- package/@ones-editor/graph-embed/src/helper/graph-dom/draw-dom.d.ts +16 -0
- package/@ones-editor/graph-embed/src/helper/graph-dom/layout-dom.d.ts +25 -0
- package/@ones-editor/graph-embed/src/helper/graph-dom/view-select.d.ts +22 -0
- package/@ones-editor/graph-embed/src/helper/graph-exclusive-handler.d.ts +13 -0
- package/@ones-editor/graph-embed/src/helper/graph-quick-commands.d.ts +3 -0
- package/@ones-editor/graph-embed/src/helper/utils.d.ts +4 -0
- package/@ones-editor/graph-embed/src/index.d.ts +3 -2
- package/@ones-editor/graph-embed/src/lang/en-us.d.ts +11 -6
- package/@ones-editor/graph-embed/src/lang/ja-jp.d.ts +11 -6
- package/@ones-editor/graph-embed/src/lang/zh-cn.d.ts +11 -6
- package/@ones-editor/graph-embed/src/mermaid/mermaid-embed.d.ts +1 -1
- package/@ones-editor/graph-embed/src/mermaid/mermaid-helper.d.ts +1 -0
- package/@ones-editor/graph-embed/src/mermaid/mermaid.d.ts +12 -4
- package/@ones-editor/graph-embed/src/plantuml/plantuml-embed.d.ts +1 -1
- package/@ones-editor/graph-embed/src/plantuml/plantuml-helper.d.ts +2 -1
- package/@ones-editor/graph-embed/src/plantuml/plantuml.d.ts +11 -3
- package/@ones-editor/graph-embed/src/types.d.ts +41 -0
- package/@ones-editor/html-to-doc/src/html-to-doc/normal-html/figcaption.d.ts +1 -0
- package/@ones-editor/html-to-doc/src/html-to-doc/normal-html/font-size.d.ts +1 -0
- package/@ones-editor/html-to-doc/src/html-to-doc/normal-html/text-color.d.ts +1 -0
- package/@ones-editor/html-to-doc/src/html-to-doc/normal-html/underline.d.ts +1 -0
- package/@ones-editor/image-embed/src/types.d.ts +0 -1
- package/@ones-editor/main-toolbar/package.json +7 -0
- package/@ones-editor/main-toolbar/src/index.d.ts +18 -0
- package/@ones-editor/main-toolbar/src/items/comment.d.ts +8 -0
- package/@ones-editor/main-toolbar/src/items/find.d.ts +8 -0
- package/@ones-editor/main-toolbar/src/items/font-style.d.ts +40 -0
- package/@ones-editor/main-toolbar/src/items/image.d.ts +8 -0
- package/@ones-editor/main-toolbar/src/items/index.d.ts +17 -0
- package/@ones-editor/main-toolbar/src/items/insert.d.ts +12 -0
- package/@ones-editor/main-toolbar/src/items/link.d.ts +11 -0
- package/@ones-editor/main-toolbar/src/items/list.d.ts +29 -0
- package/@ones-editor/main-toolbar/src/items/more-item.d.ts +20 -0
- package/@ones-editor/main-toolbar/src/items/paragraph.d.ts +14 -0
- package/@ones-editor/main-toolbar/src/items/quote.d.ts +11 -0
- package/@ones-editor/main-toolbar/src/items/separator.d.ts +7 -0
- package/@ones-editor/main-toolbar/src/items/text-align.d.ts +21 -0
- package/@ones-editor/main-toolbar/src/items/text-color.d.ts +49 -0
- package/@ones-editor/main-toolbar/src/items/undo.d.ts +18 -0
- package/@ones-editor/main-toolbar/src/locale/en-us.d.ts +9 -0
- package/@ones-editor/main-toolbar/src/locale/index.d.ts +1 -0
- package/@ones-editor/main-toolbar/src/locale/ja-jp.d.ts +9 -0
- package/@ones-editor/main-toolbar/src/locale/zh-cn.d.ts +9 -0
- package/@ones-editor/main-toolbar/src/types.d.ts +5 -0
- package/@ones-editor/markdown-to-doc/src/custom/tag.d.ts +8 -0
- package/@ones-editor/markdown-to-doc/src/index.d.ts +1 -0
- package/@ones-editor/markdown-to-doc/src/tokens/inline-tokens/custom-tag.d.ts +4 -0
- package/@ones-editor/markdown-to-doc/src/tokens/inline-tokens/font-size.d.ts +2 -0
- package/@ones-editor/markdown-to-doc/src/tokens/inline-tokens/html.d.ts +2 -0
- package/@ones-editor/markdown-to-doc/src/tokens/inline-tokens/text-color.d.ts +2 -0
- package/@ones-editor/misc/src/index.d.ts +0 -1
- package/@ones-editor/misc/src/re-auth/index.d.ts +0 -23
- package/@ones-editor/sharedb-doc/src/doc/auth-connection.d.ts +41 -31
- package/@ones-editor/sharedb-doc/src/doc/auto-renew-token.d.ts +16 -0
- package/@ones-editor/sharedb-doc/src/doc/connection-status.d.ts +19 -0
- package/@ones-editor/sharedb-doc/src/doc/edit-status.d.ts +13 -0
- package/@ones-editor/sharedb-doc/src/doc/sharedb-client.d.ts +6 -13
- package/@ones-editor/sharedb-doc/src/doc/sharedb-doc.d.ts +4 -4
- package/@ones-editor/sharedb-doc/src/types.d.ts +20 -5
- package/@ones-editor/toc/src/toc-embed/render-toc.d.ts +1 -1
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/@ones-editor/ui/src/emoji-popup/emoji-popup.d.ts +21 -0
- package/@ones-editor/ui/src/emoji-popup/index.d.ts +8 -0
- package/@ones-editor/ui/src/index.d.ts +1 -0
- package/@ones-editor/ui/src/locale/en-us.d.ts +1 -0
- package/@ones-editor/ui/src/locale/ja-jp.d.ts +1 -0
- package/@ones-editor/ui/src/locale/zh-cn.d.ts +1 -0
- package/@ones-editor/ui/src/providers/emoji.d.ts +12 -0
- package/@ones-editor/ui/src/providers/insert-menu.d.ts +2 -2
- package/@ones-editor/ui/src/providers/utils/add-section.d.ts +9 -0
- package/@ones-editor/ui/src/providers/utils/index.d.ts +2 -0
- package/@ones-editor/ui/src/quick-menu/index.d.ts +2 -1
- package/@ones-editor/ui/src/quick-menu/quick-command-providers.d.ts +3 -3
- package/@ones-editor/ui/src/quick-menu/types.d.ts +2 -2
- package/@ones-editor/ui/src/toolbar/toolbar-handler.d.ts +2 -0
- package/@ones-editor/ui-base/src/auto-suggest/auto-suggest-menu.d.ts +3 -0
- package/@ones-editor/ui-base/src/auto-suggest/auto-suggest.d.ts +2 -0
- package/@ones-editor/ui-base/src/color-button/color-button.d.ts +1 -0
- package/@ones-editor/ui-base/src/command-bar/command-bar.d.ts +2 -1
- package/@ones-editor/ui-base/src/command-bar/fixed-toolbar.d.ts +1 -0
- package/@ones-editor/ui-base/src/dialog/alert-dialog.d.ts +19 -0
- package/@ones-editor/ui-base/src/dialog/confirm-dialog.d.ts +20 -0
- package/@ones-editor/ui-base/src/dialog/dialog-button.d.ts +10 -0
- package/@ones-editor/ui-base/src/dialog/dialog-check.d.ts +15 -0
- package/@ones-editor/ui-base/src/dialog/dialog-input.d.ts +9 -0
- package/@ones-editor/ui-base/src/dialog/dialog-radio.d.ts +12 -0
- package/@ones-editor/ui-base/src/dialog/index.d.ts +15 -0
- package/@ones-editor/ui-base/src/dialog/modal-dialog.d.ts +21 -0
- package/@ones-editor/ui-base/src/dialog/popup-dialog.d.ts +31 -0
- package/@ones-editor/ui-base/src/dialog/standard-dialog.d.ts +25 -0
- package/@ones-editor/ui-base/src/dialog/standard-modal-dialog.d.ts +7 -0
- package/@ones-editor/ui-base/src/dialog/standard-popup-dialog.d.ts +17 -0
- package/@ones-editor/ui-base/src/dialog/types.d.ts +1 -0
- package/@ones-editor/ui-base/src/dropdown/index.d.ts +1 -0
- package/@ones-editor/ui-base/src/emoji-item/emoji-item.d.ts +1 -2
- package/@ones-editor/ui-base/src/emoji-palette/default-emoji-palette.d.ts +3 -0
- package/@ones-editor/ui-base/src/emoji-palette/index.d.ts +10 -13
- package/@ones-editor/ui-base/src/emoji-palette/types.d.ts +10 -0
- package/@ones-editor/ui-base/src/index.d.ts +2 -0
- package/@ones-editor/ui-base/src/locale/en-us.d.ts +5 -0
- package/@ones-editor/ui-base/src/locale/ja-jp.d.ts +5 -0
- package/@ones-editor/ui-base/src/locale/zh-cn.d.ts +5 -0
- package/@ones-editor/versions/src/types.d.ts +1 -0
- package/@ones-editor/versions/src/version-dialog/versions-dropdown.d.ts +2 -0
- package/dist/custom/image-preview-handler.d.ts +11 -0
- package/dist/error-handler/error-info-bar.d.ts +18 -0
- package/dist/error-handler/index.d.ts +37 -0
- package/dist/index.d.ts +63 -2
- package/dist/index.js +7986 -4215
- package/dist/lang/en-us.d.ts +9 -0
- package/dist/lang/ja-jp.d.ts +9 -0
- package/dist/lang/zh-cn.d.ts +9 -0
- package/dist/types.d.ts +32 -6
- package/package.json +1 -2
- package/@ones-editor/graph-embed/assets/index.d.ts +0 -2
- package/@ones-editor/graph-embed/types/index.d.ts +0 -16
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import type { OnesEditor, BlockPath, BlockElement } from '../../../../@ones-editor/core';
|
|
1
|
+
import type { OnesEditor, BlockPath, BlockElement, BlockContentElement, DocBlock } from '../../../../@ones-editor/core';
|
|
2
2
|
import type { DocCalloutBlockData } from './types';
|
|
3
|
-
export declare function createCalloutBlockContent(editor: OnesEditor, path: BlockPath, blockElement: BlockElement, blockData: DocCalloutBlockData):
|
|
3
|
+
export declare function createCalloutBlockContent(editor: OnesEditor, path: BlockPath, blockElement: BlockElement, blockData: DocCalloutBlockData): BlockContentElement;
|
|
4
|
+
export declare function handleUpdateCalloutBlock(editor: OnesEditor, block: BlockElement, blockData: DocBlock): boolean;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { OnesEditor, OnesEditorCustom } from '../../../../@ones-editor/core';
|
|
2
|
+
export declare class CalloutIcon implements OnesEditorCustom {
|
|
3
|
+
private editor;
|
|
4
|
+
private blockId;
|
|
5
|
+
private iconElement;
|
|
6
|
+
private constructor();
|
|
7
|
+
private handleSelectEmoji;
|
|
8
|
+
private handleIconClick;
|
|
9
|
+
render(parent: HTMLElement, icon: string): void;
|
|
10
|
+
updateIcon(icon: string): void;
|
|
11
|
+
destroy(): void;
|
|
12
|
+
static get(editor: OnesEditor, blockId: string): CalloutIcon;
|
|
13
|
+
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { DocBlock } from '../../../../@ones-editor/core';
|
|
2
|
-
import { ColorId } from './types';
|
|
1
|
+
import { BlockElement, DocBlock, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
+
import { CalloutBlockPayload, ColorId } from './types';
|
|
3
3
|
export declare function checkBlockAllowInCallout(block: DocBlock): boolean;
|
|
4
4
|
export declare function getHexBackgroundColor(backgroundColor: ColorId): string;
|
|
5
|
+
export declare function getCalloutBlockData(editor: OnesEditor, block: BlockElement): import("./types").DocCalloutBlockData;
|
|
6
|
+
export declare function updateCalloutBlockData(editor: OnesEditor, block: BlockElement, blockPayload: Partial<CalloutBlockPayload>): void;
|
|
@@ -2,6 +2,7 @@ import { OnesEditorComments } from './comments';
|
|
|
2
2
|
import './style.scss';
|
|
3
3
|
import CommentsCommandProvider from './text-comments/comments-command-provider';
|
|
4
4
|
import './locale';
|
|
5
|
+
export { activeComment } from './comments-helper';
|
|
5
6
|
export * from './types';
|
|
6
7
|
export { OnesEditorCommentsRender } from './comments-render';
|
|
7
8
|
export { OnesEditorCommentPlaceholderHandler } from './comment-placeholder-handler';
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { DocObject, LocalDoc, OnesEditor, OnesEditorComment } from '../../../@ones-editor/core';
|
|
2
|
+
type EditorEvents = {
|
|
3
|
+
onPreviewImage?: (editor: OnesEditor, img: HTMLImageElement) => void;
|
|
4
|
+
};
|
|
2
5
|
export type CommentData = {
|
|
3
6
|
[p in string]: unknown;
|
|
4
7
|
};
|
|
@@ -18,6 +21,7 @@ export interface OnesEditorCommentOptions {
|
|
|
18
21
|
onUpdateLayout?: (editor: OnesEditor, data: CommentData) => void;
|
|
19
22
|
onCommentCountChange?: (count: number) => void;
|
|
20
23
|
onCommentEditorClick?: (editor: OnesEditor, event: MouseEvent) => void;
|
|
24
|
+
events?: EditorEvents;
|
|
21
25
|
componentsOptions?: {
|
|
22
26
|
[index: string]: unknown;
|
|
23
27
|
};
|
|
@@ -59,3 +63,4 @@ export interface MiniCommentGroup {
|
|
|
59
63
|
commentIds: CommentIds;
|
|
60
64
|
}
|
|
61
65
|
export type MiniCommentGroups = MiniCommentGroup[];
|
|
66
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DocBlock, DocObject } from '../../../doc';
|
|
2
2
|
import { OnesEditor } from '../../../types';
|
|
3
|
-
export declare function textBlockToHtml(editor: OnesEditor,
|
|
3
|
+
export declare function textBlockToHtml(editor: OnesEditor, blockData: DocBlock, doc: DocObject): string;
|
|
@@ -132,7 +132,6 @@ export interface OnesEditorDocCallbacks {
|
|
|
132
132
|
onCustomMessage?: (msg: unknown) => void;
|
|
133
133
|
onStatusChanged?: (status: OnesEditorDocStatus) => void;
|
|
134
134
|
onError?: (error: Error) => void;
|
|
135
|
-
onAuthRecover?: () => void;
|
|
136
135
|
}
|
|
137
136
|
export interface UploadResourceOptions {
|
|
138
137
|
onProgress?: (progress: number) => void;
|
|
@@ -34,7 +34,6 @@ export default class EditorDoc extends EventCallbacks<OnesEditorDocCallbacks> im
|
|
|
34
34
|
onCustomMessage(msg: unknown): void;
|
|
35
35
|
onStatusChanged(status: OnesEditorDocStatus): void;
|
|
36
36
|
onError(error: Error): void;
|
|
37
|
-
onAuthRecover(): void;
|
|
38
37
|
uploadResource(file: File, options?: UploadResourceOptions): Promise<UploadResourceResult>;
|
|
39
38
|
addResources(resourceIds: string[]): Promise<string[]>;
|
|
40
39
|
buildResourceUrl(resourceId: string, options?: BuildResourceUrlOptions): string;
|
|
@@ -93,7 +93,6 @@ export interface EmbedOptions {
|
|
|
93
93
|
}
|
|
94
94
|
export interface Embed {
|
|
95
95
|
embedType: string;
|
|
96
|
-
adjustableMinHeight?: number;
|
|
97
96
|
createEmbedContent: (editor: OnesEditor, content: BlockContentElement, block: DocEmbedBlock, path: BlockPath, container: ContainerElement, blockElement: BlockElement) => void;
|
|
98
97
|
convertTo?: (editor: OnesEditor, blockData: DocEmbedBlock, doc: DocObject, type: 'text' | 'html' | 'markdown') => string;
|
|
99
98
|
getBlockProperties?: (editor: OnesEditor, block: BlockElement) => BlockProperties;
|
|
@@ -158,6 +157,7 @@ export interface CommandItem {
|
|
|
158
157
|
setCloseable?: (closeable: Closeable) => void;
|
|
159
158
|
beforePopup?: (parent: unknown) => void;
|
|
160
159
|
switchable?: boolean;
|
|
160
|
+
hidden?: boolean;
|
|
161
161
|
/**
|
|
162
162
|
* defaults to true
|
|
163
163
|
*/
|
|
@@ -729,7 +729,7 @@ export interface OnesEditorCommandProvider {
|
|
|
729
729
|
id: string;
|
|
730
730
|
groupIndex?: number;
|
|
731
731
|
getAvailableCommands: (editor: OnesEditor, block: BlockElement, range: SelectionRange, params?: CommandParams) => CommandItem[];
|
|
732
|
-
getInsertCommands?: (editor: OnesEditor, containerId: string) => CommandItem[];
|
|
732
|
+
getInsertCommands?: (editor: OnesEditor, containerId: string, params?: CommandParams) => CommandItem[];
|
|
733
733
|
executeInsertCommand?: (editor: OnesEditor, containerId: string, blockIndex: number, item: CommandItemWithSource, params: CommandParams, result?: CommandResult) => boolean;
|
|
734
734
|
executeRangeCommand?: (editor: OnesEditor, range: SelectionRange, command: CommandItemWithSource, params: CommandParams, result?: CommandResult) => boolean;
|
|
735
735
|
executeCommand?: (editor: OnesEditor, block: BlockElement, range: SelectionRange, item: CommandItemWithSource, params: CommandParams, result?: CommandResult) => boolean;
|
|
@@ -751,7 +751,7 @@ export interface OnesEditorCommandProviders {
|
|
|
751
751
|
registerCommandProvider: (provider: OnesEditorCommandProvider) => void;
|
|
752
752
|
getCommandProviders: () => OnesEditorCommandProvider[];
|
|
753
753
|
getCommandProvider: (id: string) => OnesEditorCommandProvider;
|
|
754
|
-
getCommands: (range: SelectionRange) => CommandItemWithSource[];
|
|
754
|
+
getCommands: (range: SelectionRange, params?: CommandParams) => CommandItemWithSource[];
|
|
755
755
|
executeCommand: (range: SelectionRange, item: CommandItemWithSource, params: CommandParams) => {
|
|
756
756
|
[index: string]: CommandResult;
|
|
757
757
|
};
|
|
@@ -777,3 +777,12 @@ export interface MobileClient {
|
|
|
777
777
|
virtualViewportOffsetTop: number;
|
|
778
778
|
isAndroidApp: boolean;
|
|
779
779
|
}
|
|
780
|
+
export interface UploadResourceErrorDialogOptions {
|
|
781
|
+
id?: string;
|
|
782
|
+
allowRetry: boolean;
|
|
783
|
+
onOk: (dialog: unknown) => void;
|
|
784
|
+
onClose: () => void;
|
|
785
|
+
}
|
|
786
|
+
export interface ErrorHandler extends OnesEditorCustom {
|
|
787
|
+
showUploadResourceErrorDialog(options?: UploadResourceErrorDialogOptions): unknown;
|
|
788
|
+
}
|
|
@@ -40,4 +40,5 @@ export declare function getElementFromPoint(x: number, y: number, options?: {
|
|
|
40
40
|
export declare function createMouseEventFromTouchEvent(event: TouchEvent, type: 'mousedown' | 'mousemove' | 'mouseup' | 'click'): MouseEvent;
|
|
41
41
|
export declare function ensureIsMobileEvent(events: MouseEvent | TouchEvent): events is TouchEvent;
|
|
42
42
|
export declare function bindDbClick(editor: OnesEditor, elem: HTMLElement, handler: (event: MouseEvent) => void): () => void;
|
|
43
|
+
export declare function bindPreventSelect(elem: HTMLElement, callback?: (event: Event) => void): () => void;
|
|
43
44
|
export {};
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { BlockElement, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
2
|
import { BlockResizer } from '../../../../@ones-editor/block-resizer';
|
|
3
|
+
interface EmbedBlockResizerOptions {
|
|
4
|
+
maxHeight?: number;
|
|
5
|
+
minHeight?: number;
|
|
6
|
+
}
|
|
3
7
|
export declare class EmbedBlockResizer {
|
|
4
8
|
private editor;
|
|
5
9
|
private resizing;
|
|
@@ -13,5 +17,6 @@ export declare class EmbedBlockResizer {
|
|
|
13
17
|
tryEnableResizer(block: BlockElement): void;
|
|
14
18
|
disableResizer(): void;
|
|
15
19
|
static get(editor: OnesEditor): EmbedBlockResizer;
|
|
16
|
-
static register(editor: OnesEditor, block: BlockElement): EmbedBlockResizer;
|
|
20
|
+
static register(editor: OnesEditor, block: BlockElement, options?: EmbedBlockResizerOptions): EmbedBlockResizer;
|
|
17
21
|
}
|
|
22
|
+
export {};
|
|
@@ -2,6 +2,8 @@ import { OnesEditorExclusiveBlock } from './exclusive-block';
|
|
|
2
2
|
import BlockExclusiveHook from './exclusive-block-hook';
|
|
3
3
|
import './exclusive-block-styles.scss';
|
|
4
4
|
import './locale';
|
|
5
|
+
import { ExclusiveBlockMessage } from './types';
|
|
6
|
+
export type { ExclusiveBlockMessage };
|
|
5
7
|
export { isExclusiveBlock } from './exclusive-dom';
|
|
6
8
|
export { exclusiveBlock, unexclusiveBlock } from './exclusive-block';
|
|
7
9
|
export { BlockExclusiveHook, OnesEditorExclusiveBlock };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AddMenuCommand, QuickMenuCommandBetween, QuickMenuCommandInline, QuickMenuCommandParams, QuickMenuCommandProvider } from '../../../@ones-editor/ui';
|
|
2
|
+
import { CommandItem, OnesEditor } from '../../../@ones-editor/core';
|
|
3
|
+
export declare class GraphCommandProvider implements QuickMenuCommandProvider {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
getCommands: (editor: OnesEditor, params?: QuickMenuCommandParams) => CommandItem[];
|
|
7
|
+
checkCommandId: (id: string) => boolean;
|
|
8
|
+
executeCommand: (editor: OnesEditor, item: CommandItem, params: QuickMenuCommandInline | QuickMenuCommandBetween | AddMenuCommand) => Promise<null>;
|
|
9
|
+
}
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
+
import { GraphType } from '../types';
|
|
1
2
|
export declare const MERMAID_SCRIPTS = "https://cdn.jsdelivr.net/npm/mermaid@9.0.1/dist/mermaid.min.js";
|
|
2
3
|
export declare const FLOWCHART_SCRIPTS: string[];
|
|
3
4
|
export declare const PLANTUML_PRE = "https://www.plantuml.com/plantuml/svg";
|
|
4
|
-
export declare const GRAPH_MIN_HEIGHT =
|
|
5
|
+
export declare const GRAPH_MIN_HEIGHT = 150;
|
|
6
|
+
export declare const GRAPH_MAX_HEIGHT = 1000;
|
|
7
|
+
export declare const GRAPH_DEFAULT_HEIGHT = 300;
|
|
8
|
+
export declare const DEFAULT_FLEX = 0.5;
|
|
9
|
+
export declare const MIN_FLEX = 0.3;
|
|
10
|
+
export declare const IMAGE_CLASS_NAME = "graph-embed-image";
|
|
11
|
+
export declare const DRAG_RANGE = 10;
|
|
12
|
+
export declare const GraphDocumentUrl: Record<GraphType, string>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { OnesEditor } from '../../../../@ones-editor/core';
|
|
2
2
|
import '../../types/window.d';
|
|
3
|
+
export declare const FLOWCHART_TYPE = "flowchart";
|
|
3
4
|
export declare function flowchartCodeToSvgStr(editor: OnesEditor, flowDataCode: string): Promise<string>;
|
|
4
5
|
export declare function flowchartCodeToObjectUrl(editor: OnesEditor, flowChartCode: string): Promise<string>;
|
|
5
6
|
export declare function flowchartCodeToResourceId(editor: OnesEditor, flowChartCode: string): Promise<string>;
|
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { OnesEditor, DocEmbedBlock, BlockElement } from '../../../../@ones-editor/core';
|
|
2
2
|
import GraphBase from '../helper/graph-base';
|
|
3
|
+
import { StandardGraphData, GraphType } from '../types';
|
|
3
4
|
export declare class FlowChartInstance extends GraphBase {
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
static graphType: GraphType;
|
|
6
|
+
protected graphType: GraphType;
|
|
7
|
+
static get(editor: OnesEditor, id: string): FlowChartInstance;
|
|
6
8
|
protected code2ObjectUrl(code: string): Promise<string>;
|
|
7
9
|
protected code2ResourceId(code: string): Promise<string>;
|
|
10
|
+
static createEmptyEmbedData: () => {
|
|
11
|
+
flowchartText: string;
|
|
12
|
+
src: string;
|
|
13
|
+
};
|
|
14
|
+
protected createGraphEmbedData: (block: BlockElement, data: Partial<StandardGraphData>) => import("@ones-editor/core").DocEmbedData;
|
|
15
|
+
protected getGraphData: (blockData: DocEmbedBlock) => StandardGraphData;
|
|
8
16
|
destroy(): void;
|
|
9
17
|
}
|
|
@@ -1,29 +1,35 @@
|
|
|
1
|
-
import { BlockProperties } from '../../../../@ones-editor/core';
|
|
2
|
-
import
|
|
3
|
-
import type { GraphType, GraphEmbedBlockProperties } from './graph-block-commands';
|
|
1
|
+
import { OnesEditor, BlockContentElement, DocEmbedBlock, BlockElement, DocEmbedData, BlockProperties } from '../../../../@ones-editor/core';
|
|
2
|
+
import { StandardGraphData, GraphType } from '../types';
|
|
4
3
|
export default abstract class GraphBase {
|
|
5
|
-
private graphType;
|
|
6
|
-
private codeEmbedDataKey;
|
|
7
4
|
protected editor: OnesEditor;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
private _status;
|
|
12
|
-
constructor(editor: OnesEditor, graphType: GraphType, codeEmbedDataKey: string);
|
|
5
|
+
protected abstract graphType: GraphType;
|
|
6
|
+
static graphType: GraphType;
|
|
7
|
+
static createEmptyEmbedData: () => Record<string, string>;
|
|
13
8
|
protected abstract code2ObjectUrl(code: string): Promise<string>;
|
|
14
9
|
protected abstract code2ResourceId(code: string): Promise<string>;
|
|
15
|
-
protected
|
|
16
|
-
protected
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
10
|
+
protected abstract createGraphEmbedData(block: BlockElement, data: Partial<StandardGraphData>): DocEmbedData;
|
|
11
|
+
protected abstract getGraphData(blockData: DocEmbedBlock): StandardGraphData;
|
|
12
|
+
private layout?;
|
|
13
|
+
private viewSelect?;
|
|
14
|
+
private drawHandler?;
|
|
15
|
+
private get block();
|
|
16
|
+
constructor(editor: OnesEditor);
|
|
17
|
+
private handleExclusiveBlock;
|
|
18
|
+
private handleReadonlyChanged;
|
|
19
|
+
destroy(): void;
|
|
20
|
+
private updateLayoutData;
|
|
21
|
+
private handleInputChange;
|
|
22
|
+
private handleFlexChange;
|
|
23
|
+
private getRealView;
|
|
27
24
|
private hasChanged;
|
|
28
|
-
private
|
|
25
|
+
private handleBlockFocus;
|
|
26
|
+
private handleClick;
|
|
27
|
+
private handleSelectionChanged;
|
|
28
|
+
private handleInputFocusChange;
|
|
29
|
+
createEmbedContent(blockContent: BlockContentElement, blockData: DocEmbedBlock): void;
|
|
30
|
+
private updateHeight;
|
|
31
|
+
private updateLayout;
|
|
32
|
+
private updateDraw;
|
|
33
|
+
updateEmbedContent(content: BlockContentElement, block: DocEmbedBlock): Promise<void>;
|
|
34
|
+
getBlockProperties(block: BlockElement): BlockProperties;
|
|
29
35
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { BlockElement } from '../../../../@ones-editor/core';
|
|
2
2
|
import type { OnesEditor } from '../../../../@ones-editor/core';
|
|
3
|
-
import { CommandId
|
|
4
|
-
|
|
5
|
-
export type GraphEmbedBlockProperties
|
|
6
|
-
export declare function getGraphEmbedBlockProperties(editor: OnesEditor, block: BlockElement, type: 'mermaid' | 'flowchart' | 'plantuml', properties?: GraphEmbedBlockProperties): {
|
|
3
|
+
import { CommandId } from '../../../../@ones-editor/embed-block-helper';
|
|
4
|
+
import { GraphType, GraphEmbedBlockProperties } from '../types';
|
|
5
|
+
export declare function getGraphEmbedBlockProperties(editor: OnesEditor, block: BlockElement, type: GraphType, properties?: GraphEmbedBlockProperties): {
|
|
7
6
|
abstract: string;
|
|
8
7
|
blockCommands: {
|
|
9
8
|
'hovering-toolbar': import("@ones-editor/embed-block-helper").StandardEmbedBlockCommands<CommandId>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { BlockElement } from '../../../../../@ones-editor/core';
|
|
2
|
+
export type OnChange = (codeValue: string) => void;
|
|
3
|
+
export declare const createCodeEditor: (parent: HTMLElement, codeValue: string, onChange: OnChange, onActiveChange: (focused: boolean) => void) => void;
|
|
4
|
+
export declare const getCodeEditor: (block: BlockElement) => HTMLTextAreaElement;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { OnesEditor } from '../../../../../@ones-editor/core';
|
|
2
|
+
export declare class DrawHandler {
|
|
3
|
+
private editor;
|
|
4
|
+
private parent;
|
|
5
|
+
private image?;
|
|
6
|
+
constructor(editor: OnesEditor, parent: HTMLElement);
|
|
7
|
+
private bindImage;
|
|
8
|
+
private handleImageError;
|
|
9
|
+
private handleImageLoad;
|
|
10
|
+
private setStatus;
|
|
11
|
+
private get status();
|
|
12
|
+
createEmptyContent(): void;
|
|
13
|
+
createErrorContent: () => void;
|
|
14
|
+
updateDraw(src?: string): void;
|
|
15
|
+
destroy(): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { DragDrop } from '../../../../../@ones-editor/core';
|
|
2
|
+
import { TypedEmitter } from 'tiny-typed-emitter';
|
|
3
|
+
interface GraphLayoutCallback {
|
|
4
|
+
'flexChange': (flex: number) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare class GraphLayout extends TypedEmitter<GraphLayoutCallback> {
|
|
7
|
+
private parent;
|
|
8
|
+
graphContent: HTMLElement;
|
|
9
|
+
constructor(parent: HTMLElement, leftEl: HTMLElement, rightEl: HTMLElement, flex: number);
|
|
10
|
+
bindMouseMove(): void;
|
|
11
|
+
unbindMouseMove(): void;
|
|
12
|
+
handleMouseMove: (event: MouseEvent) => void;
|
|
13
|
+
destroy(): void;
|
|
14
|
+
getLeftElement(): HTMLElement;
|
|
15
|
+
getRightElement(): HTMLElement;
|
|
16
|
+
handleDrag: (drag: DragDrop<unknown>, event: MouseEvent | TouchEvent) => void;
|
|
17
|
+
handleDragEnd: (drag: DragDrop<unknown>, event: MouseEvent | TouchEvent) => void;
|
|
18
|
+
private hideLeft;
|
|
19
|
+
private hideRight;
|
|
20
|
+
showRight(): void;
|
|
21
|
+
showLeft(): void;
|
|
22
|
+
showBoth(flex: number): void;
|
|
23
|
+
changeLayout(flex: number): void;
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { TypedEmitter } from 'tiny-typed-emitter';
|
|
2
|
+
export declare enum ViewId {
|
|
3
|
+
Both = "both",
|
|
4
|
+
Draw = "draw",
|
|
5
|
+
Code = "code",
|
|
6
|
+
Select = "select"
|
|
7
|
+
}
|
|
8
|
+
interface ViewSelectCallback {
|
|
9
|
+
'viewChange': (viewSelect: ViewSelect) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare class ViewSelect extends TypedEmitter<ViewSelectCallback> {
|
|
12
|
+
private fixedToolbar;
|
|
13
|
+
selectedView: ViewId;
|
|
14
|
+
constructor(parent: HTMLElement);
|
|
15
|
+
private handleSelected;
|
|
16
|
+
setSelectedView(view: ViewId): void;
|
|
17
|
+
disable(): void;
|
|
18
|
+
enable(): void;
|
|
19
|
+
private createItems;
|
|
20
|
+
destroy(): void;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { OnesEditor, OnesEditorCustom, OnesEditorDocCallbacks } from '../../../../@ones-editor/core';
|
|
2
|
+
import { TypedEmitter } from 'tiny-typed-emitter';
|
|
3
|
+
type OnExclusiveBlock = (blockId: string, exclusive: boolean) => void;
|
|
4
|
+
export declare class GraphExclusiveHandler extends TypedEmitter<{
|
|
5
|
+
onExclusiveBlock: OnExclusiveBlock;
|
|
6
|
+
}> implements OnesEditorCustom, OnesEditorDocCallbacks {
|
|
7
|
+
private editor;
|
|
8
|
+
constructor(editor: OnesEditor);
|
|
9
|
+
destroy(): void;
|
|
10
|
+
onCustomMessage: (msg: unknown) => void;
|
|
11
|
+
static get(editor: OnesEditor): GraphExclusiveHandler;
|
|
12
|
+
}
|
|
13
|
+
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import MermaidEmbed from './mermaid/mermaid-embed';
|
|
2
2
|
import FlowChartEmbed from './flowchart/flowchart-embed';
|
|
3
3
|
import PlantumlEmbed from './plantuml/plantuml-embed';
|
|
4
|
+
import { GraphCommandProvider } from './command';
|
|
4
5
|
import './common.scss';
|
|
5
|
-
export { MermaidEmbed, PlantumlEmbed, FlowChartEmbed, };
|
|
6
|
-
export * from '
|
|
6
|
+
export { MermaidEmbed, PlantumlEmbed, FlowChartEmbed, GraphCommandProvider, };
|
|
7
|
+
export * from './types';
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
graph: {
|
|
3
|
-
invalid: string;
|
|
4
3
|
empty: string;
|
|
5
|
-
|
|
6
|
-
comment: string;
|
|
7
|
-
help: string;
|
|
4
|
+
readonlyEmpty: string;
|
|
8
5
|
errorTips: string;
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
help: string;
|
|
7
|
+
plantuml: string;
|
|
8
|
+
mermaid: string;
|
|
9
|
+
flowchart: string;
|
|
10
|
+
command: {
|
|
11
|
+
name: string;
|
|
12
|
+
bothShow: string;
|
|
13
|
+
codeShow: string;
|
|
14
|
+
drawShow: string;
|
|
15
|
+
};
|
|
11
16
|
};
|
|
12
17
|
};
|
|
13
18
|
export default _default;
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
graph: {
|
|
3
|
-
invalid: string;
|
|
4
3
|
empty: string;
|
|
5
|
-
|
|
6
|
-
comment: string;
|
|
7
|
-
help: string;
|
|
4
|
+
readonlyEmpty: string;
|
|
8
5
|
errorTips: string;
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
help: string;
|
|
7
|
+
plantuml: string;
|
|
8
|
+
mermaid: string;
|
|
9
|
+
flowchart: string;
|
|
10
|
+
command: {
|
|
11
|
+
name: string;
|
|
12
|
+
bothShow: string;
|
|
13
|
+
codeShow: string;
|
|
14
|
+
drawShow: string;
|
|
15
|
+
};
|
|
11
16
|
};
|
|
12
17
|
};
|
|
13
18
|
export default _default;
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
graph: {
|
|
3
|
-
invalid: string;
|
|
4
3
|
empty: string;
|
|
5
|
-
|
|
6
|
-
comment: string;
|
|
7
|
-
help: string;
|
|
4
|
+
readonlyEmpty: string;
|
|
8
5
|
errorTips: string;
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
help: string;
|
|
7
|
+
plantuml: string;
|
|
8
|
+
mermaid: string;
|
|
9
|
+
flowchart: string;
|
|
10
|
+
command: {
|
|
11
|
+
name: string;
|
|
12
|
+
bothShow: string;
|
|
13
|
+
codeShow: string;
|
|
14
|
+
drawShow: string;
|
|
15
|
+
};
|
|
11
16
|
};
|
|
12
17
|
};
|
|
13
18
|
export default _default;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
+
export declare const MERMAID_TYPE = "mermaid";
|
|
2
3
|
export declare function mermaidCodeToSvg(editor: OnesEditor, code: string): Promise<string>;
|
|
3
4
|
export declare function mermaidCodeToObjectUrl(editor: OnesEditor, code: string): Promise<string>;
|
|
4
5
|
export declare function mermaidCodeToResourceId(editor: OnesEditor, code: string): Promise<string>;
|
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { OnesEditor, DocEmbedBlock, BlockElement } from '../../../../@ones-editor/core';
|
|
2
2
|
import GraphBase from '../helper/graph-base';
|
|
3
|
+
import { GraphType, StandardGraphData } from '../types';
|
|
3
4
|
export declare class MermaidInstance extends GraphBase {
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
static graphType: GraphType;
|
|
6
|
+
protected graphType: GraphType;
|
|
7
|
+
static get(editor: OnesEditor, id: string): MermaidInstance;
|
|
8
|
+
static destroyCustom(editor: OnesEditor, id: string): void;
|
|
6
9
|
code2ObjectUrl(code: string): Promise<string>;
|
|
7
10
|
code2ResourceId(code: string): Promise<string>;
|
|
8
|
-
|
|
11
|
+
static createEmptyEmbedData: () => {
|
|
12
|
+
mermaidText: string;
|
|
13
|
+
src: string;
|
|
14
|
+
};
|
|
15
|
+
protected createGraphEmbedData: (block: BlockElement, data: Partial<StandardGraphData>) => import("@ones-editor/core").DocEmbedData;
|
|
16
|
+
protected getGraphData: (blockData: DocEmbedBlock) => StandardGraphData;
|
|
9
17
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
+
export declare const PLANTUML_TYPE = "plantuml";
|
|
2
3
|
export declare function plantumlCodeToUrl(editor: OnesEditor, plantumlText: string): string;
|
|
3
4
|
export declare function plantumlUrlToResourceId(editor: OnesEditor, url: string): Promise<string>;
|