@ones-editor/editor 2.0.4-beta.9 → 2.0.5-beta.10
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-button/menu-button/index.d.ts +1 -1
- package/@ones-editor/callout-block/package.json +11 -0
- package/@ones-editor/callout-block/src/callout-block/callout-block-content.d.ts +3 -0
- package/@ones-editor/callout-block/src/callout-block/callout-block-doc.d.ts +2 -0
- package/@ones-editor/callout-block/src/callout-block/callout-block.d.ts +3 -0
- package/@ones-editor/callout-block/src/callout-block/callout-converter-interceptor.d.ts +8 -0
- package/@ones-editor/callout-block/src/callout-block/callout-drop-target-finder.d.ts +10 -0
- package/@ones-editor/callout-block/src/callout-block/callout-input-handler.d.ts +11 -0
- package/@ones-editor/callout-block/src/callout-block/callout-last-callout-payload.d.ts +9 -0
- package/@ones-editor/callout-block/src/callout-block/callout-options.d.ts +2 -0
- package/@ones-editor/callout-block/src/callout-block/callout-properties.d.ts +2 -0
- package/@ones-editor/callout-block/src/callout-block/callout-quick-menu-item-filter.d.ts +8 -0
- package/@ones-editor/callout-block/src/callout-block/command-items/bg-color-item.d.ts +22 -0
- package/@ones-editor/callout-block/src/callout-block/command-items/delete-icon-item.d.ts +3 -0
- package/@ones-editor/callout-block/src/callout-block/command-items/preset-item.d.ts +16 -0
- package/@ones-editor/callout-block/src/callout-block/covert-to.d.ts +2 -0
- package/@ones-editor/callout-block/src/callout-block/helper.d.ts +4 -0
- package/@ones-editor/callout-block/src/callout-block/index.d.ts +1 -0
- package/@ones-editor/callout-block/src/callout-block/types.d.ts +9 -0
- package/@ones-editor/callout-block/src/index.d.ts +3 -0
- package/@ones-editor/callout-block/src/locale/en-us.d.ts +12 -0
- package/@ones-editor/callout-block/src/locale/index.d.ts +1 -0
- package/@ones-editor/callout-block/src/locale/ja-jp.d.ts +12 -0
- package/@ones-editor/callout-block/src/locale/zh-cn.d.ts +12 -0
- package/@ones-editor/core/src/core/blocks/common/insert-empty-block.d.ts +1 -1
- package/@ones-editor/core/src/core/composition/editor-input.d.ts +1 -1
- package/@ones-editor/core/src/core/containers/element.d.ts +1 -0
- package/@ones-editor/core/src/core/types.d.ts +3 -3
- package/@ones-editor/core/src/helper/hovering-block.d.ts +2 -0
- package/@ones-editor/drop-target/src/drop-target.d.ts +6 -0
- package/@ones-editor/drop-target/src/index.d.ts +1 -0
- package/@ones-editor/image-embed/src/image-object.d.ts +2 -0
- package/@ones-editor/input-handlers/src/index.d.ts +4 -1
- package/@ones-editor/input-handlers/src/markdown-shortcuts/converter-interceptors.d.ts +12 -0
- package/@ones-editor/input-handlers/src/markdown-shortcuts/match-block-convert.d.ts +9 -1
- package/@ones-editor/paste-special/src/paste-special-handler.d.ts +1 -0
- package/@ones-editor/to-docx/src/doc2other/colors.d.ts +7 -1
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/@ones-editor/ui/src/index.d.ts +2 -2
- package/@ones-editor/ui/src/quick-menu/index.d.ts +3 -1
- package/@ones-editor/ui/src/quick-menu/types.d.ts +4 -0
- package/@ones-editor/ui-base/src/color-palette/color-palette.d.ts +2 -1
- package/@ones-editor/ui-base/src/color-palette/create-palette.d.ts +8 -0
- package/@ones-editor/ui-base/src/color-palette/index.d.ts +2 -2
- package/@ones-editor/ui-base/src/command-bar/types.d.ts +1 -0
- package/@ones-editor/ui-base/src/emoji-item/emoji-item.d.ts +19 -0
- package/@ones-editor/ui-base/src/emoji-item/index.d.ts +2 -0
- package/@ones-editor/ui-base/src/emoji-palette/emoji-content.d.ts +21 -0
- package/@ones-editor/ui-base/src/emoji-palette/emoji-data.d.ts +60 -0
- package/@ones-editor/ui-base/src/emoji-palette/emoji-navigation.d.ts +16 -0
- package/@ones-editor/ui-base/src/emoji-palette/emoji-search.d.ts +11 -0
- package/@ones-editor/ui-base/src/emoji-palette/index.d.ts +23 -0
- package/@ones-editor/ui-base/src/emoji-palette/types.d.ts +0 -0
- package/@ones-editor/ui-base/src/icons/index.d.ts +17 -1
- package/@ones-editor/ui-base/src/index.d.ts +1 -0
- package/@ones-editor/ui-base/src/input/create-input.d.ts +1 -0
- package/@ones-editor/ui-base/src/locale/en-us.d.ts +20 -0
- package/@ones-editor/ui-base/src/locale/ja-jp.d.ts +20 -0
- package/@ones-editor/ui-base/src/locale/zh-cn.d.ts +20 -0
- package/dist/index.js +285 -206
- package/dist/lang/en-us.d.ts +1 -0
- package/dist/lang/ja-jp.d.ts +1 -0
- package/dist/lang/zh-cn.d.ts +1 -0
- package/package.json +1 -1
|
@@ -9,7 +9,7 @@ export default class OnesEditorBlockMenuButton {
|
|
|
9
9
|
private dragHandler;
|
|
10
10
|
constructor(editor: OnesEditor);
|
|
11
11
|
destroy(): void;
|
|
12
|
-
handleHoverBlock: (hoverBlock: BlockElement | null, oldBlock: BlockElement | null,
|
|
12
|
+
handleHoverBlock: (hoverBlock: BlockElement | null, oldBlock: BlockElement | null, target: EventTarget | null, oldTarget: EventTarget | null) => void;
|
|
13
13
|
showRootButton(hoverBlock: BlockElement): void;
|
|
14
14
|
showParentButton(hoverBlock: BlockElement): boolean;
|
|
15
15
|
removeParentButton: () => void;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { OnesEditor, BlockPath, BlockElement } from '../../../../@ones-editor/core';
|
|
2
|
+
import type { DocCalloutBlockData } from './types';
|
|
3
|
+
export declare function createCalloutBlockContent(editor: OnesEditor, path: BlockPath, blockElement: BlockElement, blockData: DocCalloutBlockData): import("@ones-editor/core").BlockContentElement;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BlockConverter, ConverterInterceptor } from '../../../../@ones-editor/input-handlers';
|
|
2
|
+
import { OnesEditor, BlockElement, OnesEditorCustom } from '../../../../@ones-editor/core';
|
|
3
|
+
export declare class CalloutConverterInterceptor implements ConverterInterceptor, OnesEditorCustom {
|
|
4
|
+
constructor(editor: OnesEditor);
|
|
5
|
+
handler(editor: OnesEditor, block: BlockElement, converter: BlockConverter): boolean;
|
|
6
|
+
destroy(): void;
|
|
7
|
+
static init(editor: OnesEditor): CalloutConverterInterceptor;
|
|
8
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DropTargetFinder } from '../../../../@ones-editor/drop-target';
|
|
2
|
+
import { BlockElement, OnesEditor } from '../../../../@ones-editor/core';
|
|
3
|
+
export declare class CalloutDropTargetFinder implements DropTargetFinder {
|
|
4
|
+
private editor;
|
|
5
|
+
constructor(editor: OnesEditor);
|
|
6
|
+
private checkBlockAllowToDrop;
|
|
7
|
+
finder(editor: OnesEditor, source: BlockElement | null, x: number, y: number): BlockElement | null;
|
|
8
|
+
destroy(): void;
|
|
9
|
+
static init(editor: OnesEditor): CalloutDropTargetFinder;
|
|
10
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { OnesEditorInputHandler, OnesEditor, OnesEditorCustom, DocObject } from '../../../../@ones-editor/core';
|
|
2
|
+
export declare class CalloutInputHandler implements OnesEditorInputHandler, OnesEditorCustom {
|
|
3
|
+
constructor(editor: OnesEditor);
|
|
4
|
+
private pasteHasForbidden;
|
|
5
|
+
private handleBackspaceEvent;
|
|
6
|
+
handleBeforeKeyDown(editor: OnesEditor, event: KeyboardEvent): boolean;
|
|
7
|
+
handleBeforePasteDoc(editor: OnesEditor, doc: DocObject): Promise<boolean>;
|
|
8
|
+
handleAfterPaste(): Promise<boolean>;
|
|
9
|
+
destroy(): void;
|
|
10
|
+
static init(editor: OnesEditor): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { OnesEditor, OnesEditorCustom } from '../../../../@ones-editor/core';
|
|
2
|
+
import { CalloutBlockPayload } from './types';
|
|
3
|
+
export declare class CalloutLastUpdateData implements OnesEditorCustom {
|
|
4
|
+
private lastCalloutBlockPayload;
|
|
5
|
+
get(): CalloutBlockPayload;
|
|
6
|
+
update(payload: Partial<CalloutBlockPayload>): void;
|
|
7
|
+
destroy(): void;
|
|
8
|
+
static init(editor: OnesEditor): CalloutLastUpdateData;
|
|
9
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { OnesEditor, OnesEditorCustom } from '../../../../@ones-editor/core';
|
|
2
|
+
import type { QuickMenuItem, QuickMenuItemFilter } from '../../../../@ones-editor/ui';
|
|
3
|
+
export declare class CalloutQuickMenuItemFilter implements QuickMenuItemFilter, OnesEditorCustom {
|
|
4
|
+
constructor(editor: OnesEditor);
|
|
5
|
+
filter(editor: OnesEditor, items: QuickMenuItem[], from: string): QuickMenuItem[];
|
|
6
|
+
destroy(): void;
|
|
7
|
+
static init(editor: OnesEditor): CalloutQuickMenuItemFilter;
|
|
8
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BlockElement, CommandItem, OnesEditor, OnesEditorCustom } from '../../../../../@ones-editor/core';
|
|
2
|
+
import { ColorPaletteItem } from '../../../../../@ones-editor/ui-base';
|
|
3
|
+
import { ColorId } from '../types';
|
|
4
|
+
export declare class BgColorItem implements CommandItem, OnesEditorCustom {
|
|
5
|
+
private editor;
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
manualShowChildren: boolean;
|
|
9
|
+
dropdown: boolean;
|
|
10
|
+
childrenPlacement: "bottom-start";
|
|
11
|
+
private bgColorButton;
|
|
12
|
+
bgColorPaletteItem: ColorPaletteItem;
|
|
13
|
+
element: HTMLButtonElement;
|
|
14
|
+
children: CommandItem[];
|
|
15
|
+
private constructor();
|
|
16
|
+
private createPaletteButton;
|
|
17
|
+
private getBgColorFromBlock;
|
|
18
|
+
updateButtonColor(bgColor: ColorId): void;
|
|
19
|
+
updateItem(block: BlockElement): void;
|
|
20
|
+
destroy(): void;
|
|
21
|
+
static get(editor: OnesEditor): BgColorItem;
|
|
22
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BlockElement, CommandItem, OnesEditor } from '../../../../../@ones-editor/core';
|
|
2
|
+
import { CalloutBlockPayload } from '../types';
|
|
3
|
+
export type PresetId = `preset-${0 | 1}`;
|
|
4
|
+
type Preset = CalloutBlockPayload & {
|
|
5
|
+
name: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function isPresetId(id: string): id is PresetId;
|
|
8
|
+
export declare function getPresetId(id: PresetId): string;
|
|
9
|
+
export declare function getPreset(id: PresetId): Preset;
|
|
10
|
+
export declare function getPresetIcon(id: string): string;
|
|
11
|
+
export declare function getPresetPayload(presetId: PresetId): {
|
|
12
|
+
backgroundColor: number;
|
|
13
|
+
icon: "preset-0" | "preset-1";
|
|
14
|
+
};
|
|
15
|
+
export declare function createPresetItem(presetId: PresetId, editor: OnesEditor, block: BlockElement): CommandItem;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CalloutBlock } from './callout-block';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DocBlock } from '../../../../@ones-editor/core';
|
|
2
|
+
export type ColorId = number;
|
|
3
|
+
export interface DocCalloutBlockData extends DocBlock {
|
|
4
|
+
type: 'callout';
|
|
5
|
+
icon: string;
|
|
6
|
+
backgroundColor: ColorId;
|
|
7
|
+
children: string[];
|
|
8
|
+
}
|
|
9
|
+
export type CalloutBlockPayload = Pick<DocCalloutBlockData, 'icon' | 'backgroundColor'>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ContainerBlockOverrideInsertEmptyBlockInsideOptions, OnesEditor } from '../../types';
|
|
2
2
|
export declare function getContainerBlockOverrideOptions(editor: OnesEditor, containerID: string, blockType?: string): ContainerBlockOverrideInsertEmptyBlockInsideOptions | undefined;
|
|
3
3
|
export declare function insertEmptyEmbedBlock(editor: OnesEditor, embedType: string, containerId: string, blockIndex: number, data?: Record<string, unknown>): Promise<import("../../types").BlockElement | null>;
|
|
4
|
-
export declare function insertEmptyBlock(editor: OnesEditor, type: string, containerId: string, blockIndex: number, data?: Record<string, unknown>): Promise<import("../../types").BlockElement | null> | null;
|
|
4
|
+
export declare function insertEmptyBlock(editor: OnesEditor, type: string, containerId: string, blockIndex: number, data?: Record<string, unknown>, item?: Record<string, unknown>): Promise<import("../../types").BlockElement | null> | null;
|
|
@@ -27,7 +27,7 @@ export declare class EditorInput implements OnesEditorInput {
|
|
|
27
27
|
callbacks: EditorInputCallbacks;
|
|
28
28
|
inputElement: HTMLInputElement;
|
|
29
29
|
constructor(editor: OnesEditor, callbacks: EditorInputCallbacks);
|
|
30
|
-
private
|
|
30
|
+
private isInCommandBar;
|
|
31
31
|
destroy(): void;
|
|
32
32
|
getInput(): HTMLInputElement;
|
|
33
33
|
focus(): void;
|
|
@@ -4,3 +4,4 @@ export declare function getContainerById(editor: OnesEditor, containerId: string
|
|
|
4
4
|
export declare function getExistsContainerById(editor: OnesEditor, containerId: string): ContainerElement | null;
|
|
5
5
|
export declare function getContainerBlocksElement(container: ContainerElement): ContainerBlocksElement;
|
|
6
6
|
export declare function getContainerToolsElement(container: ContainerElement): ContainerToolsElement;
|
|
7
|
+
export declare function isContainerBlocksElement(element: Element): element is ContainerBlocksElement;
|
|
@@ -279,7 +279,7 @@ export interface Block {
|
|
|
279
279
|
convertTo?: (editor: OnesEditor, blockData: DocBlock, doc: DocObject, type: 'text' | 'html' | 'markdown', path: BlockPath) => string;
|
|
280
280
|
toStandardDoc?: (editor: OnesEditor, blockData: DocBlock, doc: DocObject) => Promise<DocObject | undefined>;
|
|
281
281
|
getBlockStyles?: (editor: OnesEditor, block: BlockElement) => BlockStyles;
|
|
282
|
-
blockToDoc?: (srcDoc: DocObject, srcBlockData: DocBlock, childBlockConverter: (srcDoc: DocObject, srcBlockData: DocBlock) => DocObject) => DocObject;
|
|
282
|
+
blockToDoc?: (srcDoc: DocObject, srcBlockData: DocBlock, childBlockConverter: (srcDoc: DocObject, srcBlockData: DocBlock) => DocObject, cloneDocResult?: CloneBlockResultInfo) => DocObject;
|
|
283
283
|
getResources?: (editor: OnesEditor, data: DocBlock) => string[] | null;
|
|
284
284
|
replaceResources?: (data: DocBlock, resources: Map<string, string>) => void;
|
|
285
285
|
}
|
|
@@ -496,7 +496,7 @@ export declare class OnesEditorCustomDataWrapper<T> {
|
|
|
496
496
|
getEditor(): OnesEditor;
|
|
497
497
|
destroy(): void;
|
|
498
498
|
}
|
|
499
|
-
export type OnesEditorCustomCreator = (editor: OnesEditor) =>
|
|
499
|
+
export type OnesEditorCustomCreator<T extends OnesEditorCustom = OnesEditorCustom> = (editor: OnesEditor) => T;
|
|
500
500
|
export interface CloneBlockResultInfo {
|
|
501
501
|
containerIdMap: Map<string, string>;
|
|
502
502
|
blockIdMap: Map<string, string>;
|
|
@@ -537,7 +537,7 @@ export interface OnesEditor extends TypedEmitter<OnesEditorEvents> {
|
|
|
537
537
|
readonly settingsProvider: OnesEditorSettingsProvider;
|
|
538
538
|
version: string;
|
|
539
539
|
readonly: boolean;
|
|
540
|
-
addCustom: <T extends OnesEditorCustom>(name: string, creator: OnesEditorCustomCreator) => T;
|
|
540
|
+
addCustom: <T extends OnesEditorCustom>(name: string, creator: OnesEditorCustomCreator<T>) => T;
|
|
541
541
|
getCustom: <T extends OnesEditorCustom>(name: string) => T;
|
|
542
542
|
replaceCustom: <T extends OnesEditorCustom>(name: string, newCustom: T) => T;
|
|
543
543
|
findCustom: <T extends OnesEditorCustom>(name: string) => T | null;
|
|
@@ -3,6 +3,7 @@ import type { TextBlockContentChild } from '../core/blocks/text-blocks/base/chil
|
|
|
3
3
|
import { BlockElement, OnesEditor, OnesEditorCustom } from '../core/types';
|
|
4
4
|
export interface OnesEditorHoveringBlockEvents {
|
|
5
5
|
change: (block: BlockElement | null, old: BlockElement | null, event: MouseEvent) => void;
|
|
6
|
+
targetChange: (block: BlockElement | null, old: BlockElement | null, target: EventTarget | null, oldTarget: EventTarget | null) => void;
|
|
6
7
|
childChange: (block: BlockElement | null, child: TextBlockContentChild | null, old: TextBlockContentChild | null, event: MouseEvent) => void;
|
|
7
8
|
}
|
|
8
9
|
export interface OnesEditorHoveringBlockFilter extends OnesEditorCustom {
|
|
@@ -14,6 +15,7 @@ export interface OnesEditorHoveringBlockFinder extends OnesEditorCustom {
|
|
|
14
15
|
export default class OnesEditorHoveringBlock extends TypedEmitter<OnesEditorHoveringBlockEvents> {
|
|
15
16
|
private editor;
|
|
16
17
|
private hoveringBlock;
|
|
18
|
+
private hoveringElem;
|
|
17
19
|
private hoveringTextChild;
|
|
18
20
|
private filters;
|
|
19
21
|
private finders;
|
|
@@ -3,6 +3,10 @@ import DropIndicator from './drop-indicator';
|
|
|
3
3
|
export interface DropHandler {
|
|
4
4
|
handleDrop: (editor: OnesEditor, dragData: BlockElement | File[], targetContainer: ContainerElement, blockIndex: number) => boolean | undefined;
|
|
5
5
|
}
|
|
6
|
+
export type DropTargetFinderId = keyof any;
|
|
7
|
+
export interface DropTargetFinder {
|
|
8
|
+
finder: (editor: OnesEditor, source: BlockElement | null, x: number, y: number) => BlockElement | null;
|
|
9
|
+
}
|
|
6
10
|
export default class OnesEditorDropTarget {
|
|
7
11
|
private editor;
|
|
8
12
|
indicator: DropIndicator;
|
|
@@ -12,10 +16,12 @@ export default class OnesEditorDropTarget {
|
|
|
12
16
|
dropEffect: 'move' | 'none';
|
|
13
17
|
} | undefined;
|
|
14
18
|
handlers: DropHandler[];
|
|
19
|
+
dropTargetFinders: Map<string | number | symbol, DropTargetFinder>;
|
|
15
20
|
combineToCreate: CombineToCreateOptions[];
|
|
16
21
|
constructor(editor: OnesEditor);
|
|
17
22
|
destroy(): void;
|
|
18
23
|
addHandler(handler: DropHandler): void;
|
|
24
|
+
addFinder(id: DropTargetFinderId, finder: DropTargetFinder): void;
|
|
19
25
|
static register(editor: OnesEditor): OnesEditorDropTarget;
|
|
20
26
|
static get(editor: OnesEditor): OnesEditorDropTarget;
|
|
21
27
|
static find(editor: OnesEditor): OnesEditorDropTarget | null;
|
|
@@ -2,5 +2,6 @@ import { INDICATOR_SIZE } from './drop-indicator';
|
|
|
2
2
|
import OnesEditorDropTarget from './drop-target';
|
|
3
3
|
import type { DropHandler } from './drop-target';
|
|
4
4
|
import { patchInsertFile } from './handlers/patch-insert-file';
|
|
5
|
+
export type { DropTargetFinder, DropTargetFinderId } from './drop-target';
|
|
5
6
|
export * from './drag-object';
|
|
6
7
|
export { OnesEditorDropTarget, DropHandler, patchInsertFile, INDICATOR_SIZE };
|
|
@@ -11,6 +11,8 @@ export declare class ImageObject implements ImageObjectBase {
|
|
|
11
11
|
private parentContainerResizerObserver;
|
|
12
12
|
private autoFix;
|
|
13
13
|
focusTimes: number;
|
|
14
|
+
mouseStartX: number;
|
|
15
|
+
mouseStartY: number;
|
|
14
16
|
constructor(editor: OnesEditor, blockData: DocEmbedBlock);
|
|
15
17
|
destroy(): void;
|
|
16
18
|
setAutoFix(autoFix: boolean): void;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { MarkdownInputHandler, converterIntercept } from './markdown-shortcuts';
|
|
2
|
+
import { MarkdownConverterInterceptors } from './markdown-shortcuts/converter-interceptors';
|
|
3
|
+
import type { ConverterInterceptor } from './markdown-shortcuts/converter-interceptors';
|
|
4
|
+
import type { BlockConverter } from './markdown-shortcuts/match-block-convert';
|
|
2
5
|
import './i18n';
|
|
3
6
|
export * from './enforce-with-document-title';
|
|
4
|
-
export { MarkdownInputHandler, converterIntercept };
|
|
7
|
+
export { MarkdownInputHandler, converterIntercept, ConverterInterceptor, MarkdownConverterInterceptors, BlockConverter };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BlockElement, OnesEditor, OnesEditorCustom } from '../../../../@ones-editor/core';
|
|
2
|
+
import type { BlockConverter } from './match-block-convert';
|
|
3
|
+
export interface ConverterInterceptor {
|
|
4
|
+
handler: (editor: OnesEditor, block: BlockElement, converter: BlockConverter) => boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare class MarkdownConverterInterceptors implements OnesEditorCustom {
|
|
7
|
+
private interceptors;
|
|
8
|
+
addInterceptor(interceptor: ConverterInterceptor): void;
|
|
9
|
+
runInterceptors(editor: OnesEditor, block: BlockElement, converter: BlockConverter): boolean;
|
|
10
|
+
destroy(): void;
|
|
11
|
+
static get(editor: OnesEditor): MarkdownConverterInterceptors;
|
|
12
|
+
}
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
-
import { OnesEditor } from '../../../../@ones-editor/core';
|
|
1
|
+
import { DocBlockAttributes, OnesEditor } from '../../../../@ones-editor/core';
|
|
2
|
+
export type BlockConverter = {
|
|
3
|
+
reg: RegExp;
|
|
4
|
+
blockType: string;
|
|
5
|
+
data?: DocBlockAttributes;
|
|
6
|
+
};
|
|
7
|
+
export type BlockConverters = {
|
|
8
|
+
[index: string]: BlockConverter;
|
|
9
|
+
};
|
|
2
10
|
export declare function converterIntercept(editor: OnesEditor, containerId: string, blockIndex: number, offset: number, type: 'enter' | 'space'): boolean;
|
|
3
11
|
export declare function matchBlockConvert(editor: OnesEditor, containerId: string, blockIndex: number, offset: number, type: 'enter' | 'space'): boolean;
|
|
@@ -6,6 +6,7 @@ export default class PasteSpecialHandler implements OnesEditorInputHandler {
|
|
|
6
6
|
lastUndoAction: OnesEditorUndoAction | null;
|
|
7
7
|
lastPos: BlockPosition | null;
|
|
8
8
|
event: ClipboardEvent | null;
|
|
9
|
+
order: number;
|
|
9
10
|
constructor(editor: OnesEditor);
|
|
10
11
|
destroy(): void;
|
|
11
12
|
handleChanged(editor: OnesEditor, action: OnesEditorUndoAction): void;
|
|
@@ -6,10 +6,16 @@ export declare function styleColorToColor(color: string | undefined): "d83931" |
|
|
|
6
6
|
* @param color
|
|
7
7
|
* @returns
|
|
8
8
|
*/
|
|
9
|
-
export declare function styleBackgroundColorToHighlight(color: string | undefined): "
|
|
9
|
+
export declare function styleBackgroundColorToHighlight(color: string | undefined): "green" | "red" | "blue" | "yellow" | "magenta" | "lightGray" | "darkGreen" | "darkMagenta" | "darkGray" | undefined;
|
|
10
10
|
export declare function styleBackgroundColorToHex(color: string | undefined): "fbbab6" | "ffdcb0" | "fff7a0" | "ceefc5" | "d1ddfb" | "d9cbf8" | "eaeaea" | "fe837c" | "ffbd6a" | "ffe662" | "a8f393" | "98b5ff" | "b394f8" | "b1b1b1" | undefined;
|
|
11
11
|
/**
|
|
12
12
|
* 将rgb(rrr,ggg,bbb)格式的颜色转为RRGGBB格式
|
|
13
13
|
* #RRGGBB 转为 RRGGBB
|
|
14
14
|
*/
|
|
15
15
|
export declare function colorToHex(color: any): string | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* 判断是否是合法的 Hex 格式颜色值
|
|
18
|
+
* @param color
|
|
19
|
+
* @returns
|
|
20
|
+
*/
|
|
21
|
+
export declare function isValidHexColor(color: string): boolean;
|