feat: add vditor locally

This commit is contained in:
merlin
2025-11-12 14:39:23 +08:00
parent 16e8fd2d65
commit 4e21c62e26
532 changed files with 43947 additions and 38 deletions

View File

@@ -0,0 +1,5 @@
export declare const afterRenderEvent: (vditor: IVditor, options?: {
enableAddUndoStack: boolean;
enableHint: boolean;
enableInput: boolean;
}) => void;

View File

@@ -0,0 +1,4 @@
export declare const highlightToolbarWYSIWYG: (vditor: IVditor) => void;
export declare const genLinkRefPopover: (vditor: IVditor, linkRefElement: HTMLElement, range?: Range) => void;
export declare const genAPopover: (vditor: IVditor, aElement: HTMLElement, range: Range) => void;
export declare const genImagePopover: (event: Event, vditor: IVditor) => void;

22
public/vditor/ts/wysiwyg/index.d.ts vendored Normal file
View File

@@ -0,0 +1,22 @@
/// <reference types="./types" />
declare class WYSIWYG {
range: Range;
element: HTMLPreElement;
popover: HTMLDivElement;
selectPopover: HTMLDivElement;
afterRenderTimeoutId: number;
hlToolbarTimeoutId: number;
preventInput: boolean;
composingLock: boolean;
commentIds: string[];
private scrollListener;
constructor(vditor: IVditor);
getComments(vditor: IVditor, getData?: boolean): ICommentsData[];
triggerRemoveComment(vditor: IVditor): void;
showComment(): void;
hideComment(): void;
unbindListener(): void;
private copy;
private bindEvent;
}
export { WYSIWYG };

10
public/vditor/ts/wysiwyg/inlineTag.d.ts vendored Normal file
View File

@@ -0,0 +1,10 @@
export declare const previoueIsEmptyA: (node: Node) => false | HTMLElement;
export declare const nextIsCode: (range: Range) => boolean;
export declare const getNextHTML: (node: Node) => string;
export declare const getPreviousHTML: (node: Node) => string;
export declare const getRenderElementNextNode: (blockCodeElement: HTMLElement) => ChildNode;
export declare const splitElement: (range: Range) => {
afterHTML: string;
beforeHTML: string;
};
export declare const modifyPre: (vditor: IVditor, range: Range) => void;

1
public/vditor/ts/wysiwyg/input.d.ts vendored Normal file
View File

@@ -0,0 +1 @@
export declare const input: (vditor: IVditor, range: Range, event?: InputEvent) => void;

View File

@@ -0,0 +1,2 @@
export declare const processKeydown: (vditor: IVditor, event: KeyboardEvent) => boolean;
export declare const removeBlockElement: (vditor: IVditor, event: KeyboardEvent) => boolean;

View File

@@ -0,0 +1,5 @@
export declare const renderDomByMd: (vditor: IVditor, md: string, options?: {
enableAddUndoStack: boolean;
enableHint: boolean;
enableInput: boolean;
}) => void;

View File

@@ -0,0 +1,2 @@
export declare const setHeading: (vditor: IVditor, tagName: string) => void;
export declare const removeHeading: (vditor: IVditor) => void;

View File

@@ -0,0 +1 @@
export declare const showCode: (previewElement: HTMLElement, vditor: IVditor, first?: boolean) => void;

View File

@@ -0,0 +1 @@
export declare const toolbarEvent: (vditor: IVditor, actionBtn: Element, event: Event) => void;