@ones-editor/editor 0.0.3-beta.99 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/@ones-editor/block-locker/src/hook.d.ts +1 -1
- package/@ones-editor/block-locker/src/i18n/ja-JP.d.ts +8 -0
- package/@ones-editor/block-menu/src/block-menu/index.d.ts +2 -1
- package/@ones-editor/block-menu/src/block-menu/items/insert-block-items/index.d.ts +3 -2
- package/@ones-editor/block-menu/src/block-menu/items/text-styles/text-style-item.d.ts +3 -0
- package/@ones-editor/block-menu/src/block-menu-button/drag-drop/drag-handler.d.ts +5 -4
- package/@ones-editor/block-menu/src/block-menu-button/drag-preview/index.d.ts +2 -2
- package/@ones-editor/block-menu/src/locale/en-us.d.ts +4 -0
- package/@ones-editor/block-menu/src/locale/ja-jp.d.ts +25 -0
- package/@ones-editor/block-menu/src/locale/zh-cn.d.ts +4 -0
- package/@ones-editor/block-resizer/src/index.d.ts +1 -0
- package/@ones-editor/code-block/src/index.d.ts +1 -0
- package/@ones-editor/comments/src/comment-input-handler/paste-handler.d.ts +5 -0
- package/@ones-editor/comments/src/comment-item/comment-item.d.ts +1 -0
- package/@ones-editor/comments/src/comment-item/mobile-comment-item/mobile-comment-item.d.ts +1 -0
- package/@ones-editor/comments/src/comments-helper/active-comment.d.ts +1 -1
- package/@ones-editor/comments/src/comments-list/comments-list.d.ts +1 -1
- package/@ones-editor/comments/src/comments-list/group-list.d.ts +2 -2
- package/@ones-editor/comments/src/comments-list/mini-comment/group-list.d.ts +1 -0
- package/@ones-editor/comments/src/locale/en-us.d.ts +2 -0
- package/@ones-editor/comments/src/locale/ja-jp.d.ts +3 -0
- package/@ones-editor/comments/src/locale/zh-cn.d.ts +3 -0
- package/@ones-editor/comments/src/text-comments/comments-command-provider.d.ts +1 -0
- package/@ones-editor/comments/src/types.d.ts +3 -0
- package/@ones-editor/core/src/core/block-renderers/standard-block-render.d.ts +2 -0
- package/@ones-editor/core/src/core/boxes/anchor-box/index.d.ts +3 -0
- package/@ones-editor/core/src/core/boxes/editor-boxes.d.ts +1 -0
- package/@ones-editor/core/src/core/boxes/image-box/index.d.ts +3 -0
- package/@ones-editor/core/src/core/boxes/index.d.ts +3 -1
- package/@ones-editor/core/src/core/composition/editor-input.d.ts +4 -3
- package/@ones-editor/core/src/core/containers/root-container.d.ts +1 -0
- package/@ones-editor/core/src/core/data-converter/editor-data-converter.d.ts +4 -2
- package/@ones-editor/core/src/core/doc/doc.d.ts +6 -1
- package/@ones-editor/core/src/core/editor/actions/add-text-attribute.d.ts +2 -2
- package/@ones-editor/core/src/core/editor/actions/insert-text.d.ts +1 -0
- package/@ones-editor/core/src/core/editor/actions/is-writable.d.ts +1 -1
- package/@ones-editor/core/src/core/editor-doc/editor-doc.d.ts +5 -1
- package/@ones-editor/core/src/core/input-handler/input-handler.d.ts +2 -2
- package/@ones-editor/core/src/core/selection/select-handler.d.ts +5 -1
- package/@ones-editor/core/src/core/types.d.ts +21 -7
- package/@ones-editor/core/src/core/undo-manager/actions/action.d.ts +4 -1
- package/@ones-editor/core/src/i18n/en-us.d.ts +3 -0
- package/@ones-editor/core/src/i18n/i18n.d.ts +12 -2
- package/@ones-editor/core/src/i18n/ja-jp.d.ts +3 -0
- package/@ones-editor/core/src/i18n/zh-cn.d.ts +3 -0
- package/@ones-editor/core/src/local-doc/index.d.ts +5 -1
- package/@ones-editor/core/src/utils/abbreviation.d.ts +27 -0
- package/@ones-editor/core/src/utils/client.d.ts +1 -0
- package/@ones-editor/core/src/utils/dom.d.ts +1 -0
- package/@ones-editor/core/src/utils/index.d.ts +2 -0
- package/@ones-editor/core/src/utils/overflow-text.d.ts +1 -0
- package/@ones-editor/drawio-embed/src/drawio-embed.d.ts +1 -0
- package/@ones-editor/drawio-embed/src/helper/index.d.ts +13 -7
- package/@ones-editor/drawio-embed/src/lang/en-us.d.ts +9 -4
- package/@ones-editor/drawio-embed/src/lang/index.d.ts +1 -1
- package/@ones-editor/drawio-embed/src/lang/ja-jp.d.ts +12 -0
- package/@ones-editor/drawio-embed/src/lang/zh-cn.d.ts +9 -4
- package/@ones-editor/drawio-embed/types/index.d.ts +1 -1
- package/@ones-editor/drop-target/src/drop-target.d.ts +2 -0
- package/@ones-editor/embed-block-helper/src/index.d.ts +1 -0
- package/@ones-editor/embed-block-helper/src/locale/en-us.d.ts +7 -0
- package/@ones-editor/embed-block-helper/src/locale/index.d.ts +1 -0
- package/@ones-editor/embed-block-helper/src/locale/ja-jp.d.ts +7 -0
- package/@ones-editor/embed-block-helper/src/locale/zh-cn.d.ts +7 -0
- package/@ones-editor/exclusive-block/src/exclusive-block-hook.d.ts +1 -1
- package/@ones-editor/exclusive-block/src/exclusive-dom.d.ts +1 -1
- package/@ones-editor/exclusive-block/src/index.d.ts +2 -0
- package/@ones-editor/exclusive-block/src/locale/en-us.d.ts +7 -0
- package/@ones-editor/exclusive-block/src/locale/index.d.ts +1 -0
- package/@ones-editor/exclusive-block/src/locale/ja-jp.d.ts +7 -0
- package/@ones-editor/exclusive-block/src/locale/zh-cn.d.ts +7 -0
- package/@ones-editor/file/src/index.d.ts +1 -0
- package/@ones-editor/file/src/locale/en-us.d.ts +12 -0
- package/@ones-editor/file/src/locale/index.d.ts +1 -0
- package/@ones-editor/file/src/locale/ja-jp.d.ts +12 -0
- package/@ones-editor/file/src/locale/zh-cn.d.ts +12 -0
- package/@ones-editor/file/src/types.d.ts +2 -1
- package/@ones-editor/find-dialog/src/doc/doc-handler.d.ts +15 -0
- package/@ones-editor/find-dialog/src/find-dialog.d.ts +4 -1
- package/@ones-editor/find-dialog/src/highlights/highligh-text.d.ts +3 -0
- package/@ones-editor/find-dialog/src/highlights/highlight-dom.d.ts +1 -0
- package/@ones-editor/find-dialog/src/locale/ja-jp.d.ts +13 -0
- package/@ones-editor/graph-embed/assets/index.d.ts +2 -0
- package/@ones-editor/graph-embed/src/helper/graph-base.d.ts +6 -1
- package/@ones-editor/graph-embed/src/helper/graph-block-commands.d.ts +1 -0
- package/@ones-editor/graph-embed/src/lang/en-us.d.ts +3 -0
- package/@ones-editor/graph-embed/src/lang/ja-jp.d.ts +3 -0
- package/@ones-editor/graph-embed/src/lang/zh-cn.d.ts +3 -0
- package/@ones-editor/heading-collapse/src/index.d.ts +1 -0
- package/@ones-editor/heading-collapse/src/locale/en-us.d.ts +7 -0
- package/@ones-editor/heading-collapse/src/locale/index.d.ts +1 -0
- package/@ones-editor/heading-collapse/src/locale/ja-jp.d.ts +7 -0
- package/@ones-editor/heading-collapse/src/locale/zh-cn.d.ts +7 -0
- package/@ones-editor/html-to-doc/src/html-to-doc/normal-html/code.d.ts +1 -0
- package/@ones-editor/image-embed/src/drag-drop/drag-handler.d.ts +6 -3
- package/@ones-editor/image-embed/src/image-data.d.ts +4 -2
- package/@ones-editor/image-embed/src/image-file.d.ts +0 -1
- package/@ones-editor/image-embed/src/image-object.d.ts +1 -0
- package/@ones-editor/image-embed/src/index.d.ts +3 -1
- package/@ones-editor/image-embed/src/locale/en-us.d.ts +1 -0
- package/@ones-editor/image-embed/src/locale/ja-jp.d.ts +17 -0
- package/@ones-editor/image-embed/src/locale/zh-cn.d.ts +1 -0
- package/@ones-editor/image-embed/src/shortcuts/image-clipboard-data.d.ts +5 -3
- package/@ones-editor/image-embed/src/shortcuts/index.d.ts +2 -2
- package/@ones-editor/image-embed/src/types.d.ts +1 -1
- package/@ones-editor/input-handlers/src/i18n/ja-jp.d.ts +11 -0
- package/@ones-editor/input-handlers/src/index.d.ts +2 -2
- package/@ones-editor/input-handlers/src/markdown-shortcuts/index.d.ts +2 -1
- package/@ones-editor/input-handlers/src/markdown-shortcuts/match-block-convert.d.ts +1 -0
- package/@ones-editor/list-block/src/index.d.ts +7 -4
- package/@ones-editor/list-block/src/keyboard/shortcut.d.ts +3 -0
- package/@ones-editor/list-block/src/lang/ja-jp.d.ts +21 -0
- package/@ones-editor/list-block/src/mindmap/to-mindmap/index.d.ts +2 -0
- package/@ones-editor/list-block/src/utils/list-parent.d.ts +1 -0
- package/@ones-editor/mathjax/src/locale/ja-jp.d.ts +7 -0
- package/@ones-editor/mathjax/src/mathjax-box/mathjax-editor.d.ts +16 -0
- package/@ones-editor/media-embed/src/core/media.d.ts +1 -0
- package/@ones-editor/media-embed/src/core/video-resizer.d.ts +1 -0
- package/@ones-editor/media-embed/src/locale/ja-jp.d.ts +19 -0
- package/@ones-editor/media-embed/src/utils/file.d.ts +0 -1
- package/@ones-editor/mention/src/index.d.ts +1 -0
- package/@ones-editor/mention/src/locale/en-us.d.ts +6 -0
- package/@ones-editor/mention/src/locale/index.d.ts +1 -0
- package/@ones-editor/mention/src/locale/ja-jp.d.ts +6 -0
- package/@ones-editor/mention/src/locale/zh-cn.d.ts +6 -0
- package/@ones-editor/mention/src/mention.d.ts +1 -0
- package/@ones-editor/paste-handler/src/text-data-converter.d.ts +2 -2
- package/@ones-editor/paste-special/src/index.d.ts +1 -0
- package/@ones-editor/paste-special/src/locale/en-us.d.ts +8 -0
- package/@ones-editor/paste-special/src/locale/index.d.ts +1 -0
- package/@ones-editor/paste-special/src/locale/ja-jp.d.ts +8 -0
- package/@ones-editor/paste-special/src/locale/zh-cn.d.ts +8 -0
- package/@ones-editor/scroll-container/src/dom-utils.d.ts +0 -1
- package/@ones-editor/scroll-container/src/types.d.ts +2 -1
- package/@ones-editor/scroll-container/src/utils.d.ts +1 -0
- package/@ones-editor/sharedb-doc/src/doc/op-parser/parse-handler.d.ts +25 -0
- package/@ones-editor/sharedb-doc/src/doc/sharedb-doc.d.ts +6 -2
- package/@ones-editor/table-block/src/locale/ja-jp.d.ts +27 -0
- package/@ones-editor/table-block/src/table-block/border-bar/table-border-bar-handler.d.ts +14 -1
- package/@ones-editor/table-block/src/table-block/border-bar/table-border-bar-scroll.d.ts +2 -0
- package/@ones-editor/table-block/src/table-block/border-bar/table-border-bar.d.ts +2 -1
- package/@ones-editor/table-block/src/table-block/doc-change-handler.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/table-scroll-events.d.ts +1 -0
- package/@ones-editor/table-block/src/types.d.ts +4 -1
- package/@ones-editor/templates/src/locale/ja-jp.d.ts +9 -0
- package/@ones-editor/text-commands/src/index.d.ts +2 -1
- package/@ones-editor/text-commands/src/locale/en-us.d.ts +0 -14
- package/@ones-editor/text-commands/src/locale/ja-jp.d.ts +13 -0
- package/@ones-editor/text-commands/src/locale/zh-cn.d.ts +0 -14
- package/@ones-editor/text-commands/src/shortcut-handler.d.ts +2 -0
- package/@ones-editor/text-commands/src/text-command-provider.d.ts +0 -1
- package/@ones-editor/to-docx/src/doc2other/core.d.ts +1 -1
- package/@ones-editor/toc/src/build-toc.d.ts +4 -2
- package/@ones-editor/toc/src/heading-scroll/index.d.ts +2 -2
- package/@ones-editor/toc/src/index.d.ts +1 -0
- package/@ones-editor/toc/src/locale/ja-jp.d.ts +6 -0
- package/@ones-editor/toc/src/toc-provider.d.ts +2 -1
- package/@ones-editor/toc/src/types.d.ts +3 -0
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/@ones-editor/ui/src/index.d.ts +5 -3
- package/@ones-editor/ui/src/locale/en-us.d.ts +10 -20
- package/@ones-editor/ui/src/locale/ja-jp.d.ts +43 -0
- package/@ones-editor/ui/src/locale/zh-cn.d.ts +2 -12
- package/@ones-editor/ui/src/quick-menu/basic-menu-items.d.ts +3 -0
- package/@ones-editor/ui/src/quick-menu/quick-menu-items.d.ts +4 -1
- package/@ones-editor/ui/src/toolbar/helper.d.ts +1 -1
- package/@ones-editor/ui/src/tooltips/index.d.ts +1 -0
- package/@ones-editor/ui-base/src/auto-suggest/auto-suggest-menu.d.ts +10 -4
- package/@ones-editor/ui-base/src/auto-suggest/auto-suggest.d.ts +5 -0
- package/@ones-editor/ui-base/src/command-bar/command-bar.d.ts +5 -2
- package/@ones-editor/ui-base/src/command-bar/manual-command-bar.d.ts +2 -1
- package/@ones-editor/ui-base/src/command-bar/types.d.ts +7 -3
- package/@ones-editor/ui-base/src/components/button.d.ts +1 -1
- package/@ones-editor/ui-base/src/components/checkbox.d.ts +3 -0
- package/@ones-editor/ui-base/src/components/index.d.ts +2 -0
- package/@ones-editor/ui-base/src/components/loading.d.ts +2 -0
- package/@ones-editor/ui-base/src/dropdown/index.d.ts +3 -0
- package/@ones-editor/ui-base/src/icons/index.d.ts +6 -1
- package/@ones-editor/ui-base/src/locale/ja-jp.d.ts +1 -1
- package/@ones-editor/ui-base/src/locale/zh-cn.d.ts +1 -1
- package/@ones-editor/versions/src/history-doc/history-doc.d.ts +2 -1
- package/@ones-editor/versions/src/locale/en-us.d.ts +25 -1
- package/@ones-editor/versions/src/locale/ja-jp.d.ts +44 -0
- package/@ones-editor/versions/src/locale/zh-cn.d.ts +25 -1
- package/@ones-editor/versions/src/types.d.ts +3 -1
- package/@ones-editor/versions/src/version-dialog/index.d.ts +6 -1
- package/@ones-editor/versions/src/version-dialog/size-limit-textarea.d.ts +2 -0
- package/@ones-editor/versions/src/version-dialog/version-info-header.d.ts +1 -1
- package/@ones-editor/versions/src/version-dialog/version-list.d.ts +7 -1
- package/@ones-editor/versions/src/version-dialog/versions-dropdown.d.ts +1 -0
- package/@ones-editor/webpage-embed/src/locale/en-us.d.ts +6 -0
- package/@ones-editor/webpage-embed/src/locale/ja-jp.d.ts +27 -0
- package/@ones-editor/webpage-embed/src/locale/zh-cn.d.ts +6 -0
- package/@ones-editor/webpage-embed/src/types.d.ts +1 -0
- package/dist/comments/create-comment-editor.d.ts +1 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +273 -196
- package/dist/types.d.ts +4 -1
- package/dist/versions/versions-provider.d.ts +1 -1
- package/package.json +2 -1
- package/@ones-editor/block-menu/src/icons/index.d.ts +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OnesEditorDocRange } from '../../doc/doc';
|
|
1
|
+
import { DocBlock, OnesEditorDocRange } from '../../doc/doc';
|
|
2
2
|
import { OnesEditor, OnesEditorUndoAction } from '../../types';
|
|
3
3
|
export default class Action implements OnesEditorUndoAction {
|
|
4
4
|
protected containerId: string;
|
|
@@ -10,4 +10,7 @@ export default class Action implements OnesEditorUndoAction {
|
|
|
10
10
|
combinable(other: OnesEditorUndoAction): boolean;
|
|
11
11
|
combine(other: OnesEditorUndoAction): void;
|
|
12
12
|
setAfterRange(range: OnesEditorDocRange): void;
|
|
13
|
+
findContainerById(editor: OnesEditor, id: string): boolean;
|
|
14
|
+
findBlockById(editor: OnesEditor, id: string): boolean;
|
|
15
|
+
checkBlockData(editor: OnesEditor, blockData: DocBlock): boolean;
|
|
13
16
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export type LANGS = keyof typeof langs;
|
|
1
2
|
declare const langs: {
|
|
2
3
|
'en-US': {
|
|
3
4
|
name: string;
|
|
@@ -14,6 +15,9 @@ declare const langs: {
|
|
|
14
15
|
common: {
|
|
15
16
|
cancel: string;
|
|
16
17
|
};
|
|
18
|
+
docx: {
|
|
19
|
+
imageExportFailed: string;
|
|
20
|
+
};
|
|
17
21
|
};
|
|
18
22
|
'zh-CN': {
|
|
19
23
|
name: string;
|
|
@@ -30,6 +34,9 @@ declare const langs: {
|
|
|
30
34
|
common: {
|
|
31
35
|
cancel: string;
|
|
32
36
|
};
|
|
37
|
+
docx: {
|
|
38
|
+
imageExportFailed: string;
|
|
39
|
+
};
|
|
33
40
|
};
|
|
34
41
|
'ja-JP': {
|
|
35
42
|
name: string;
|
|
@@ -46,10 +53,13 @@ declare const langs: {
|
|
|
46
53
|
common: {
|
|
47
54
|
cancel: string;
|
|
48
55
|
};
|
|
56
|
+
docx: {
|
|
57
|
+
imageExportFailed: string;
|
|
58
|
+
};
|
|
49
59
|
};
|
|
50
60
|
};
|
|
51
|
-
export declare function setLang(lang?:
|
|
61
|
+
export declare function setLang(lang?: LANGS | null | undefined): void;
|
|
52
62
|
export declare function mergeLang(l: any): void;
|
|
53
63
|
export declare function t(key: string, args?: Record<string, string>): string;
|
|
54
|
-
export
|
|
64
|
+
export declare function getCurrentLang(): "en-US" | "zh-CN" | "ja-JP";
|
|
55
65
|
export {};
|
|
@@ -11,12 +11,16 @@ export declare class LocalDoc extends EventCallbacks<OnesEditorDocCallbacks> imp
|
|
|
11
11
|
endBatchUpdate(): number;
|
|
12
12
|
toJSON(): DocObject;
|
|
13
13
|
getContainerBlocks(containerId: string): DocBlock[];
|
|
14
|
+
findContainerBlocks(containerId: string): DocBlock[];
|
|
14
15
|
getBlockData(containerId: string, blockIndex: number): DocBlock;
|
|
15
16
|
localUpdateBlockText(containerId: string, blockIndex: number, actions: DocBlockTextActions): DocBlockText;
|
|
16
17
|
localUpdateBlockData(containerId: string, blockIndex: number, delta: DocBlockDelta): DocBlock;
|
|
17
18
|
localInsertBlock(containerId: string, blockIndex: number, data: DocBlock): DocBlock;
|
|
18
19
|
localDeleteBlock(containerId: string, blockIndex: number): DocBlock;
|
|
19
|
-
|
|
20
|
+
localInsertChildContainers(containers: {
|
|
21
|
+
containerId: string;
|
|
22
|
+
blocks: DocBlock[];
|
|
23
|
+
}[]): void;
|
|
20
24
|
localDeleteChildContainers(containerIds: string[]): void;
|
|
21
25
|
uploadResource(file: File, options?: UploadResourceOptions): Promise<UploadResourceResult>;
|
|
22
26
|
addResources(resourceIds: string[]): Promise<string[]>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare function hashCode(str: string): number;
|
|
2
|
+
/**
|
|
3
|
+
* 用户名缩写
|
|
4
|
+
* @param name 用户名
|
|
5
|
+
* @param maxLength 最大展示长度
|
|
6
|
+
* @returns 缩写
|
|
7
|
+
* 规则:
|
|
8
|
+
* 1. 中日韩字符,从后往前取
|
|
9
|
+
* 2. 英文字符、特殊字符、数字,从前往后取,如果有空格比如 `Mike Tracy` 取 MT
|
|
10
|
+
* 3. emoji,从后往前取
|
|
11
|
+
* 4. 默认处理从前取
|
|
12
|
+
*/
|
|
13
|
+
export declare function abbreviation(name: string, maxLength?: number): string;
|
|
14
|
+
declare enum EColor {
|
|
15
|
+
blue = "#338FE5",
|
|
16
|
+
cyan = "#34AFDE",
|
|
17
|
+
teal = "#2CB2AE",
|
|
18
|
+
green = "#24B47E",
|
|
19
|
+
kelly = "#8AAB3F",
|
|
20
|
+
yellow = "#F0A100",
|
|
21
|
+
orange = "#EB6414",
|
|
22
|
+
red = "#E52727",
|
|
23
|
+
fuchsia = "#BE507D",
|
|
24
|
+
purple = "#9678D3"
|
|
25
|
+
}
|
|
26
|
+
export declare function getColorFromContent(content: string): EColor;
|
|
27
|
+
export {};
|
|
@@ -28,4 +28,5 @@ export declare function getElementOffset(el: Element): {
|
|
|
28
28
|
export declare function findTarget(event: Event, cssSelector: string): Element | null;
|
|
29
29
|
export declare function findEventTargetBlock(event: Event): Element | null;
|
|
30
30
|
export declare function isElementVisible(element: Element | null): boolean;
|
|
31
|
+
export declare function getElementScale(element: Element): number;
|
|
31
32
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function overflowText(text: string, fontSize: number, maxwidth: number): string | null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { OnesEditor, BlockElement } from '../../../../@ones-editor/core';
|
|
2
|
-
import {
|
|
2
|
+
import { DrawIoData, GraphDataType, XmlData, XmlSvgData, SrcData, DrawIoOptions } from '../../types';
|
|
3
3
|
import '../../types/window.d';
|
|
4
4
|
export declare function getDrawioOptions(editor: OnesEditor): DrawIoOptions;
|
|
5
5
|
export declare function getDrawioLang(editor: OnesEditor): string;
|
|
@@ -14,9 +14,15 @@ export declare function initializeDrawioIframe(editor: OnesEditor): Promise<{
|
|
|
14
14
|
export declare function contactWithIframe(editor: OnesEditor, block: BlockElement, drawIoData: DrawIoData, iframe: HTMLIFrameElement, loaded: () => void, exit: () => void, isInitializationCompleted: boolean): void;
|
|
15
15
|
export declare function editGraph(editor: OnesEditor, block: BlockElement, data: DrawIoData, isInitializationCompleted: boolean): Promise<void>;
|
|
16
16
|
export declare function initDrawIo(editor: OnesEditor): Promise<void>;
|
|
17
|
-
export declare function removeDrawioEmptyStatus(
|
|
18
|
-
export declare function addDrawioEmptyStatus(
|
|
19
|
-
export declare function
|
|
20
|
-
export declare function
|
|
21
|
-
export declare function
|
|
22
|
-
|
|
17
|
+
export declare function removeDrawioEmptyStatus(embed: HTMLElement): void;
|
|
18
|
+
export declare function addDrawioEmptyStatus(embed: HTMLElement): void;
|
|
19
|
+
export declare function addDrawioLoadErrorStatus(editor: OnesEditor, embed: HTMLElement, data: DrawIoData): void;
|
|
20
|
+
export declare function setGraph(embed: HTMLElement, data: GraphDataType): void;
|
|
21
|
+
export declare function getPreGraphData(embed: HTMLElement): {
|
|
22
|
+
src: string;
|
|
23
|
+
xmlSvg: string;
|
|
24
|
+
xml: string;
|
|
25
|
+
};
|
|
26
|
+
export declare function updateGraphBySrc(src: SrcData['src'], embed: HTMLElement, editor: OnesEditor): void;
|
|
27
|
+
export declare function updateGraphByXml(mxFile: XmlData['xml'], embed: HTMLElement, editor: OnesEditor): void;
|
|
28
|
+
export declare function updateGraphByXmlSvg(xmlSvg: XmlSvgData['xmlSvg'], embed: HTMLElement): void;
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
drawio: {
|
|
3
|
+
title: string;
|
|
4
|
+
empty: string;
|
|
5
|
+
loading: string;
|
|
6
|
+
abstract: string;
|
|
7
|
+
errorTips: string;
|
|
8
|
+
errorSubTips: string;
|
|
9
|
+
retry: string;
|
|
10
|
+
};
|
|
6
11
|
};
|
|
7
12
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
drawio: {
|
|
3
|
+
title: string;
|
|
4
|
+
empty: string;
|
|
5
|
+
loading: string;
|
|
6
|
+
abstract: string;
|
|
7
|
+
errorTips: string;
|
|
8
|
+
errorSubTips: string;
|
|
9
|
+
retry: string;
|
|
10
|
+
};
|
|
6
11
|
};
|
|
7
12
|
export default _default;
|
|
@@ -22,7 +22,7 @@ export interface SrcData {
|
|
|
22
22
|
}
|
|
23
23
|
export type GraphDataType = XmlData | XmlSvgData | SrcData;
|
|
24
24
|
export type LANG = Record<string, string | Record<string, string>>;
|
|
25
|
-
export type OnesEditorLang = 'zh-CN' | 'zh-TW' | '
|
|
25
|
+
export type OnesEditorLang = 'zh-CN' | 'zh-TW' | 'ja-JP' | 'en-US';
|
|
26
26
|
export interface DrawIoOptions {
|
|
27
27
|
lang?: OnesEditorLang;
|
|
28
28
|
cdn?: {
|
|
@@ -17,6 +17,7 @@ export default class OnesEditorDropTarget {
|
|
|
17
17
|
addHandler(handler: DropHandler): void;
|
|
18
18
|
static register(editor: OnesEditor): OnesEditorDropTarget;
|
|
19
19
|
static get(editor: OnesEditor): OnesEditorDropTarget;
|
|
20
|
+
static find(editor: OnesEditor): OnesEditorDropTarget | null;
|
|
20
21
|
private canInsertAfter;
|
|
21
22
|
private canInsertBefore;
|
|
22
23
|
private canDrop;
|
|
@@ -24,4 +25,5 @@ export default class OnesEditorDropTarget {
|
|
|
24
25
|
private findInsertPos;
|
|
25
26
|
private handleDragOver;
|
|
26
27
|
private handleDrop;
|
|
28
|
+
private handleDragLeave;
|
|
27
29
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BlockElement, BlockPath, ContainerElement, DocBlock, OnesEditor, OnesEditorBlockHook } from '../../../@ones-editor/core';
|
|
2
2
|
export default class BlockExclusiveHook implements OnesEditorBlockHook {
|
|
3
|
-
writable(editor: OnesEditor, blockElement: BlockElement): boolean | undefined;
|
|
3
|
+
writable(editor: OnesEditor, blockElement: BlockElement | BlockElement[]): boolean | undefined;
|
|
4
4
|
create(editor: OnesEditor, path: BlockPath, container: ContainerElement, blockElement: BlockElement, blockData: DocBlock): void;
|
|
5
5
|
update(editor: OnesEditor, path: BlockPath, container: ContainerElement, blockElement: BlockElement, blockData: DocBlock): void;
|
|
6
6
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BlockElement, OnesEditor } from '../../../@ones-editor/core';
|
|
2
|
-
export declare function addExclusiveStyle(block: BlockElement, userId: string, displayName: string): void;
|
|
2
|
+
export declare function addExclusiveStyle(editor: OnesEditor, block: BlockElement, userId: string, displayName: string): void;
|
|
3
3
|
export declare function removeExclusiveStyle(block: BlockElement): void;
|
|
4
4
|
export declare function updateBlockExclusive(editor: OnesEditor, block: BlockElement, exclusive: boolean, userId: string, displayName: string): void;
|
|
5
5
|
export declare function isExclusiveBlock(block: BlockElement): boolean;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { OnesEditorExclusiveBlock } from './exclusive-block';
|
|
2
2
|
import BlockExclusiveHook from './exclusive-block-hook';
|
|
3
3
|
import './exclusive-block-styles.scss';
|
|
4
|
+
import './locale';
|
|
5
|
+
export { isExclusiveBlock } from './exclusive-dom';
|
|
4
6
|
export { exclusiveBlock, unexclusiveBlock } from './exclusive-block';
|
|
5
7
|
export { BlockExclusiveHook, OnesEditorExclusiveBlock };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -18,6 +18,7 @@ export interface FileEmbedData extends DocEmbedData, FileData {
|
|
|
18
18
|
}
|
|
19
19
|
export interface FileOptions {
|
|
20
20
|
onClick?: (editor: OnesEditor, elem: BlockElement | BoxElement, event: MouseEvent) => void;
|
|
21
|
-
onDownloadFile?: (editor: OnesEditor, data: FileData) => void;
|
|
21
|
+
onDownloadFile?: (editor: OnesEditor, data: FileData | FileBoxData, source: 'embed' | 'box') => void;
|
|
22
22
|
renderFileCardIcon?: (editor: OnesEditor, blockData: FileEmbedData) => Promise<false | HTMLImageElement>;
|
|
23
|
+
onGetFileDownloadUrl?: (editor: OnesEditor, data: FileBoxData | FileEmbedData) => Promise<string | undefined>;
|
|
23
24
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TypedEmitter } from 'tiny-typed-emitter';
|
|
2
|
+
import type { OnesEditorDocCallbacks, OnesEditor, DocBlockTextActions, BlockElement, DocBlock } from '../../../../@ones-editor/core';
|
|
3
|
+
interface DocEvent {
|
|
4
|
+
onDocChanged: (changedBlock: BlockElement) => void;
|
|
5
|
+
onDocInserted: () => void;
|
|
6
|
+
onDocDeleted: (deletedBlock: BlockElement) => void;
|
|
7
|
+
}
|
|
8
|
+
declare class FindDialogDocHandler extends TypedEmitter<DocEvent> implements OnesEditorDocCallbacks {
|
|
9
|
+
private editor;
|
|
10
|
+
constructor(editor: OnesEditor);
|
|
11
|
+
onUpdateBlockText(containerId: string, blockIndex: number, actions: DocBlockTextActions): void;
|
|
12
|
+
onInsertBlock(containerId: string, blockIndex: number, blockData: DocBlock, local: boolean): void;
|
|
13
|
+
onDeleteBlock(containerId: string, blockIndex: number, local: boolean): void;
|
|
14
|
+
}
|
|
15
|
+
export default FindDialogDocHandler;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="lodash" />
|
|
2
2
|
import { ManualCloseDialog } from '../../../@ones-editor/ui-base';
|
|
3
|
-
import { OnesEditor } from '../../../@ones-editor/core';
|
|
3
|
+
import { OnesEditor, BlockElement } from '../../../@ones-editor/core';
|
|
4
4
|
export default class FindDialog {
|
|
5
5
|
private editor;
|
|
6
6
|
dialog: ManualCloseDialog | null;
|
|
@@ -25,6 +25,9 @@ export default class FindDialog {
|
|
|
25
25
|
constructor(editor: OnesEditor);
|
|
26
26
|
handleFindChanged: () => void;
|
|
27
27
|
handleCompositionEnd: () => void;
|
|
28
|
+
handleDocChanged: (changedBlock: BlockElement) => void;
|
|
29
|
+
handleDocInserted: () => void;
|
|
30
|
+
handleDocDeleted: (deletedBlock: BlockElement) => void;
|
|
28
31
|
handleInput: (event: Event) => void;
|
|
29
32
|
handleFind: () => void;
|
|
30
33
|
findNext(options: {
|
|
@@ -3,6 +3,9 @@ export declare function clearAllReplaceResultHighlight(editor: OnesEditor): void
|
|
|
3
3
|
export declare function clearAllHighlights(editor: OnesEditor, options?: {
|
|
4
4
|
keepReplaceResult?: boolean;
|
|
5
5
|
}): void;
|
|
6
|
+
export declare function clearHighlightsInBlock(editor: OnesEditor, block: BlockElement, options?: {
|
|
7
|
+
keepReplaceResult?: boolean;
|
|
8
|
+
}): void;
|
|
6
9
|
export declare function getCurrentHighlighIndex(editor: OnesEditor): number;
|
|
7
10
|
export declare function gotoFirstHighlight(editor: OnesEditor): number;
|
|
8
11
|
export declare function gotoNextHighlight(editor: OnesEditor): number;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BlockElement, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
2
|
export declare function isHighlight(elem: HTMLElement): boolean;
|
|
3
3
|
export declare function getAllHighlights(editor: OnesEditor): HTMLElement[];
|
|
4
|
+
export declare function getHighlightsInBlock(editor: OnesEditor, block: BlockElement): HTMLElement[];
|
|
4
5
|
export declare function getAllReplaceResultHighlights(editor: OnesEditor): HTMLElement[];
|
|
5
6
|
export declare function getBlockHighlight(block: BlockElement): HTMLElement[];
|
|
6
7
|
export declare function clearBlockHighlight(block: BlockElement): void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
find: {
|
|
3
|
+
findLabel: string;
|
|
4
|
+
replaceLabel: string;
|
|
5
|
+
findButton: string;
|
|
6
|
+
replaceButton: string;
|
|
7
|
+
replaceAllButton: string;
|
|
8
|
+
moreButton: string;
|
|
9
|
+
findPlaceholder: string;
|
|
10
|
+
replacePlaceholder: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export default _default;
|
|
@@ -7,6 +7,8 @@ export default abstract class GraphBase {
|
|
|
7
7
|
protected editor: OnesEditor;
|
|
8
8
|
logger: Logger;
|
|
9
9
|
editing: boolean;
|
|
10
|
+
private graphEmbedContent;
|
|
11
|
+
private status;
|
|
10
12
|
constructor(editor: OnesEditor, graphType: GraphType, codeEmbedDataKey: string);
|
|
11
13
|
protected abstract code2ObjectUrl(code: string): Promise<string>;
|
|
12
14
|
protected abstract code2ResourceId(code: string): Promise<string>;
|
|
@@ -17,8 +19,11 @@ export default abstract class GraphBase {
|
|
|
17
19
|
createEmbedContent(content: BlockContentElement, block: DocEmbedBlock): void;
|
|
18
20
|
updateEmbedContent(content: BlockContentElement, block: DocEmbedBlock): void;
|
|
19
21
|
protected updateImage(embed: HTMLDivElement, code: string | undefined, url: string | undefined | null, err: Error | null): Promise<void>;
|
|
20
|
-
protected
|
|
22
|
+
protected errorBoundary(embed: HTMLDivElement, code: string | undefined, url: string | undefined | null, reason: 'imageLoadError' | 'grammarError'): void;
|
|
23
|
+
protected emptyContent(): void;
|
|
24
|
+
protected updateSpecialClasses(embed: HTMLDivElement, code: string | undefined, err: Error | null): void;
|
|
21
25
|
editGraph(content: BlockContentElement): void;
|
|
22
26
|
getBlockProperties(block: BlockElement, properties?: GraphEmbedBlockProperties): BlockProperties;
|
|
23
27
|
private hasChanged;
|
|
28
|
+
private removeStatusContent;
|
|
24
29
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare function replaceHljsFragmentToCode(node: Node): void;
|
|
2
|
+
export declare function codeListToCode(ts: any): void;
|
|
2
3
|
export declare function preOnlyBlockToCode(ts: any): void;
|
|
3
4
|
export declare function codeOnlyBlockToCode(ts: any): void;
|
|
4
5
|
export declare function preCodeBlockToCode(ts: any): void;
|
|
@@ -3,12 +3,15 @@ export default class OnesEditorImageDragHandler {
|
|
|
3
3
|
private editor;
|
|
4
4
|
img: HTMLImageElement;
|
|
5
5
|
private dragContainer;
|
|
6
|
+
private autoScroll;
|
|
7
|
+
private imageContainer;
|
|
6
8
|
private startPosition;
|
|
7
9
|
constructor(editor: OnesEditor);
|
|
8
10
|
destroy(): void;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
handleMouseDown: (event: MouseEvent) => void;
|
|
12
|
+
handleDragStart: (event: MouseEvent) => Promise<void>;
|
|
13
|
+
handleDrag: (event: MouseEvent) => void;
|
|
14
|
+
handleDragEnd: (event?: MouseEvent) => void;
|
|
12
15
|
}
|
|
13
16
|
declare global {
|
|
14
17
|
interface Window {
|