@ones-editor/editor 3.0.3 → 3.0.4-beta.2
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/core/src/core/types.d.ts +1 -0
- package/@ones-editor/input-handlers/src/markdown-shortcuts/markdown-input-handler.d.ts +3 -0
- package/@ones-editor/input-handlers/src/markdown-shortcuts/match-block-style.d.ts +2 -1
- package/@ones-editor/input-handlers/src/markdown-shortcuts/types.d.ts +3 -0
- package/@ones-editor/main-toolbar/src/items/text-color.d.ts +1 -0
- package/@ones-editor/markdown-to-doc/src/markdown-to-doc.d.ts +3 -1
- package/@ones-editor/markdown-to-doc/src/tokens/base.d.ts +3 -0
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +128 -30
- package/package.json +1 -1
|
@@ -132,6 +132,7 @@ export interface CommandItem {
|
|
|
132
132
|
value?: string;
|
|
133
133
|
order?: number;
|
|
134
134
|
type?: CommandItemType;
|
|
135
|
+
className?: string;
|
|
135
136
|
element?: HTMLElement | ((item: CommandItem) => HTMLElement);
|
|
136
137
|
icon?: string;
|
|
137
138
|
childrenType?: 'menu' | 'toolbar' | 'mobile-bottom-menu';
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { OnesEditor, OnesEditorInputHandler } from '../../../../@ones-editor/core';
|
|
2
|
+
import { MarkdownInputHandlerOptions } from './types';
|
|
2
3
|
declare class MarkdownInputHandler implements OnesEditorInputHandler {
|
|
4
|
+
private options?;
|
|
5
|
+
constructor(options?: MarkdownInputHandlerOptions | undefined);
|
|
3
6
|
handleAfterInsertText(editor: OnesEditor, containerId: string, blockIndex: number, offset: number, text: string): boolean;
|
|
4
7
|
handleBeforeKeyDown(editor: OnesEditor, event: KeyboardEvent): boolean;
|
|
5
8
|
}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
-
|
|
2
|
+
import { MarkdownInputHandlerOptions } from './types';
|
|
3
|
+
export declare function matchBlockStyle(editor: OnesEditor, containerId: string, blockIndex: number, offset: number, options?: MarkdownInputHandlerOptions): boolean;
|
|
@@ -15,6 +15,7 @@ export declare class ColorItem extends TextColorItem implements ToolbarItem {
|
|
|
15
15
|
value?: string | undefined;
|
|
16
16
|
order?: number | undefined;
|
|
17
17
|
type?: import("@ones-editor/core").CommandItemType | undefined;
|
|
18
|
+
className?: string | undefined;
|
|
18
19
|
element?: HTMLElement | ((item: import("@ones-editor/core").CommandItem) => HTMLElement) | undefined;
|
|
19
20
|
icon?: string | undefined;
|
|
20
21
|
childrenType?: "menu" | "toolbar" | "mobile-bottom-menu" | undefined;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { DocObject } from '../../../@ones-editor/core';
|
|
1
|
+
import { DocBlockText, DocBlockTextAttributes, DocObject } from '../../../@ones-editor/core';
|
|
2
2
|
import './types/marked-extended-latex.d';
|
|
3
|
+
import { CustomTagToken } from './custom/tag';
|
|
3
4
|
export { getBlocksWidth } from './tokens/block-tokens/table';
|
|
4
5
|
interface MarkdownToDocOptions {
|
|
5
6
|
font?: string | Element;
|
|
6
7
|
htmlToDoc?: (html: string) => DocObject | null;
|
|
8
|
+
customTagProcess?: (token: CustomTagToken, attributes: DocBlockTextAttributes) => DocBlockText | null | undefined;
|
|
7
9
|
}
|
|
8
10
|
export declare function markdownToDoc(markdown: string, options?: MarkdownToDocOptions): DocObject | null;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { marked } from 'marked';
|
|
2
2
|
import { DocBlock, DocBlockText, DocBlockTextAttributes, DocObject } from '../../../../@ones-editor/core';
|
|
3
|
+
import { CustomTagToken } from '../custom/tag';
|
|
3
4
|
export type TextAndChildren = {
|
|
4
5
|
text: DocBlockText;
|
|
5
6
|
children: DocBlock[];
|
|
@@ -7,6 +8,7 @@ export type TextAndChildren = {
|
|
|
7
8
|
export type TokensToText = (tokens: marked.Token[], attributes: DocBlockTextAttributes, options: TokenToBlockOptions) => DocBlockText;
|
|
8
9
|
export type TokensToBlocks = (tokens: marked.Token[], options: TokenToBlockOptions) => DocBlock[];
|
|
9
10
|
export type TokensToTextWithChildren = (tokens: marked.Token[], options: TokenToBlockOptions) => TextAndChildren;
|
|
11
|
+
export type CustomTagProcess = (token: CustomTagToken, attributes: DocBlockTextAttributes) => DocBlockText | null | undefined;
|
|
10
12
|
export type HtmlToDoc = (html: string) => DocObject | null;
|
|
11
13
|
export type TokenToBlockOptions = {
|
|
12
14
|
font?: string | Element;
|
|
@@ -16,4 +18,5 @@ export type TokenToBlockOptions = {
|
|
|
16
18
|
tokensToTextWithChildren: TokensToTextWithChildren;
|
|
17
19
|
htmlToDoc?: HtmlToDoc;
|
|
18
20
|
listLevel: number;
|
|
21
|
+
customTagProcess?: CustomTagProcess;
|
|
19
22
|
};
|