@ones-editor/editor 0.0.3-beta.210 → 0.0.3-beta.211
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-menu/src/block-menu/items/text-styles/text-style-item.d.ts +2 -0
- package/@ones-editor/code-block/src/index.d.ts +1 -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/boxes/editor-boxes.d.ts +1 -0
- package/@ones-editor/core/src/core/types.d.ts +1 -0
- package/@ones-editor/core/src/i18n/i18n.d.ts +3 -2
- package/@ones-editor/drawio-embed/types/index.d.ts +1 -1
- package/@ones-editor/graph-embed/assets/index.d.ts +2 -0
- package/@ones-editor/graph-embed/src/helper/graph-base.d.ts +6 -3
- 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 +2 -1
- package/@ones-editor/list-block/src/keyboard/shortcut.d.ts +3 -0
- package/@ones-editor/mathjax/src/mathjax-box/mathjax-editor.d.ts +16 -0
- package/@ones-editor/scroll-container/src/types.d.ts +1 -0
- package/@ones-editor/table-block/src/table-block/border-bar/table-border-bar.d.ts +1 -1
- package/@ones-editor/table-block/src/types.d.ts +3 -0
- package/@ones-editor/toc/src/index.d.ts +1 -0
- package/@ones-editor/toc/src/types.d.ts +3 -0
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/@ones-editor/ui/src/toolbar/helper.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/icons/index.d.ts +2 -1
- package/@ones-editor/versions/src/locale/en-us.d.ts +1 -0
- package/@ones-editor/versions/src/locale/ja-jp.d.ts +1 -0
- package/@ones-editor/versions/src/locale/zh-cn.d.ts +1 -0
- package/@ones-editor/versions/src/version-dialog/index.d.ts +2 -0
- package/@ones-editor/versions/src/version-dialog/version-list.d.ts +4 -2
- package/dist/comments/create-comment-editor.d.ts +1 -1
- package/dist/index.js +165 -154
- package/dist/types.d.ts +2 -0
- package/package.json +1 -1
|
@@ -19,10 +19,12 @@ export default class TextStyleItem implements BlockMenuItem {
|
|
|
19
19
|
id: string;
|
|
20
20
|
name: string;
|
|
21
21
|
element: HTMLElement;
|
|
22
|
+
private textStylesTooltips;
|
|
22
23
|
constructor(editor: OnesEditor, block: BlockElement, options: TextStyleItemOptions);
|
|
23
24
|
createItemElement(editor: OnesEditor, block: BlockElement): HTMLDivElement;
|
|
24
25
|
private createHeadingItemElement;
|
|
25
26
|
private createListItemElement;
|
|
26
27
|
createItem(id: string, icon: string, parent: HTMLElement, active?: boolean): void;
|
|
27
28
|
handleClick: (editor: OnesEditor, event: Event) => void;
|
|
29
|
+
private calcTextStyleItemTooltipsEnum;
|
|
28
30
|
}
|
|
@@ -7,5 +7,6 @@ export default class CommentsCommandProvider implements OnesEditorCommandProvide
|
|
|
7
7
|
id: string;
|
|
8
8
|
constructor(provider: OnesEditorCommentsProvider, editorComments: OnesEditorComments);
|
|
9
9
|
getAvailableCommands(editor: OnesEditor, block: BlockElement, range: SelectionRange): BlockCommandItem[];
|
|
10
|
+
hideToolbar(editor: OnesEditor): void;
|
|
10
11
|
executeRangeCommand(editor: OnesEditor, range: SelectionRange, command: BlockCommandItemWithSource, params: CommandParams, result: CommandResult): boolean;
|
|
11
12
|
}
|
|
@@ -18,6 +18,9 @@ export interface OnesEditorCommentOptions {
|
|
|
18
18
|
onUpdateLayout?: (editor: OnesEditor, data: CommentData) => void;
|
|
19
19
|
onCommentCountChange?: (count: number) => void;
|
|
20
20
|
onCommentEditorClick?: (editor: OnesEditor, event: MouseEvent) => void;
|
|
21
|
+
componentsOptions?: {
|
|
22
|
+
[index: string]: unknown;
|
|
23
|
+
};
|
|
21
24
|
}
|
|
22
25
|
export interface OnesEditorCommentsEvents {
|
|
23
26
|
onCreateComment: (commentId: string, local: boolean) => void;
|
|
@@ -628,6 +628,7 @@ export interface OnesEditorBoxes {
|
|
|
628
628
|
registerBoxClass: (boxClass: Box) => void;
|
|
629
629
|
getBoxClass: (type: string) => Box;
|
|
630
630
|
createBox: (blockContent: BlockContentElement, box: DocBox) => BoxElement;
|
|
631
|
+
forEach: (callback: (boxClass: Box) => void) => void;
|
|
631
632
|
}
|
|
632
633
|
export interface OnesEditorInsertions {
|
|
633
634
|
registerInsertionClass: (insertionClass: Insertion) => void;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export type LANGS = keyof typeof langs;
|
|
1
2
|
declare const langs: {
|
|
2
3
|
'en-US': {
|
|
3
4
|
name: string;
|
|
@@ -57,8 +58,8 @@ declare const langs: {
|
|
|
57
58
|
};
|
|
58
59
|
};
|
|
59
60
|
};
|
|
60
|
-
export declare function setLang(lang?:
|
|
61
|
+
export declare function setLang(lang?: LANGS | null | undefined): void;
|
|
61
62
|
export declare function mergeLang(l: any): void;
|
|
62
63
|
export declare function t(key: string, args?: Record<string, string>): string;
|
|
63
|
-
export
|
|
64
|
+
export declare function getCurrentLang(): "en-US" | "zh-CN" | "ja-JP";
|
|
64
65
|
export {};
|
|
@@ -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?: {
|
|
@@ -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,10 +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 errorBoundary(embed: HTMLDivElement, code: string | undefined, url: string | undefined | null): void;
|
|
21
|
-
protected emptyContent(
|
|
22
|
-
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;
|
|
23
25
|
editGraph(content: BlockContentElement): void;
|
|
24
26
|
getBlockProperties(block: BlockElement, properties?: GraphEmbedBlockProperties): BlockProperties;
|
|
25
27
|
private hasChanged;
|
|
28
|
+
private removeStatusContent;
|
|
26
29
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MarkdownInputHandler } from './markdown-shortcuts';
|
|
1
|
+
import { MarkdownInputHandler, converterIntercept } from './markdown-shortcuts';
|
|
2
2
|
import './i18n';
|
|
3
3
|
export * from './enforce-with-document-title';
|
|
4
|
-
export { MarkdownInputHandler };
|
|
4
|
+
export { MarkdownInputHandler, converterIntercept };
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
+
export declare function converterIntercept(editor: OnesEditor, containerId: string, blockIndex: number, offset: number, type: 'enter' | 'space'): boolean;
|
|
2
3
|
export declare function matchBlockConvert(editor: OnesEditor, containerId: string, blockIndex: number, offset: number, type: 'enter' | 'space'): boolean;
|
|
@@ -2,6 +2,7 @@ import { TextKindBlock } from '../../../@ones-editor/core';
|
|
|
2
2
|
import OnesEditorListMindmap from './mindmap';
|
|
3
3
|
import { toMindmap } from './mindmap/to-mindmap';
|
|
4
4
|
import { Mindmap } from './mindmap/mindmap';
|
|
5
|
+
import ListBlockShortcuts from './keyboard/shortcut';
|
|
5
6
|
import { resetListStart } from './start/reset-list-start';
|
|
6
7
|
import { getListAllNextBrothers } from './utils/list-brother';
|
|
7
8
|
import './lang';
|
|
@@ -9,4 +10,4 @@ import './style.scss';
|
|
|
9
10
|
export { type ListOptions, type DocListBlock } from './types';
|
|
10
11
|
declare const ListBlock: TextKindBlock;
|
|
11
12
|
export * from './keyboard/to-text-block';
|
|
12
|
-
export { ListBlock, OnesEditorListMindmap, Mindmap, resetListStart, getListAllNextBrothers, toMindmap, };
|
|
13
|
+
export { ListBlock, OnesEditorListMindmap, Mindmap, resetListStart, getListAllNextBrothers, toMindmap, ListBlockShortcuts, };
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
/// <reference types="lodash" />
|
|
2
|
+
import { AbstractCommandBar, Popup } from '../../../../@ones-editor/ui-base';
|
|
1
3
|
import { OnesEditor } from '../../../../@ones-editor/core';
|
|
2
4
|
export type OnEditChange = (tex: string, end: boolean) => void;
|
|
5
|
+
export default class MathjaxEditor {
|
|
6
|
+
editMathjaxPopup: Popup | null;
|
|
7
|
+
onChange: OnEditChange | null;
|
|
8
|
+
tex: string;
|
|
9
|
+
private observer;
|
|
10
|
+
editMathjax(elem: HTMLElement, tex: string, onChange: OnEditChange): void;
|
|
11
|
+
handleClose: (commandBar: AbstractCommandBar) => void;
|
|
12
|
+
handleKeyup: (event: KeyboardEvent) => void;
|
|
13
|
+
handleChange: import("lodash").DebouncedFunc<(text: string) => void>;
|
|
14
|
+
createPopupContent(tex: string): HTMLTextAreaElement;
|
|
15
|
+
textareaWatcher(textarea: HTMLTextAreaElement): void;
|
|
16
|
+
getTextarea(): HTMLTextAreaElement;
|
|
17
|
+
destroy(): void;
|
|
18
|
+
}
|
|
3
19
|
export declare function editMathjax(editor: OnesEditor, elem: HTMLElement, tex: string, onChange: OnEditChange): void;
|
|
@@ -2,7 +2,7 @@ import { BlockElement, OnesEditor } from '../../../../../@ones-editor/core';
|
|
|
2
2
|
export declare class TableBorderBar {
|
|
3
3
|
private editor;
|
|
4
4
|
tableBlock: BlockElement;
|
|
5
|
-
private toolbar
|
|
5
|
+
private toolbar?;
|
|
6
6
|
private resizeObserver;
|
|
7
7
|
constructor(editor: OnesEditor, tableBlock: BlockElement);
|
|
8
8
|
close(): void;
|