@seyamali/aurelia-editor 0.1.0
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/LICENSE +21 -0
- package/README.md +154 -0
- package/dist/core/commands.d.ts +1 -0
- package/dist/core/engine.d.ts +11 -0
- package/dist/core/registry.d.ts +13 -0
- package/dist/core/sdk.d.ts +57 -0
- package/dist/counter.d.ts +1 -0
- package/dist/horizontal-rule-plugin-DdpCd1us.js +20 -0
- package/dist/index-C9G087KG.js +54332 -0
- package/dist/index.d.ts +4 -0
- package/dist/main.d.ts +0 -0
- package/dist/omni-editor.js +6 -0
- package/dist/omni-editor.umd.cjs +822 -0
- package/dist/plugins/advanced/asset-link-node.d.ts +18 -0
- package/dist/plugins/advanced/code-block-node.d.ts +33 -0
- package/dist/plugins/advanced/code-blocks.d.ts +13 -0
- package/dist/plugins/advanced/footnote-node.d.ts +59 -0
- package/dist/plugins/advanced/footnote-plugin.d.ts +6 -0
- package/dist/plugins/advanced/footnote.d.ts +8 -0
- package/dist/plugins/advanced/html-snippet-node.d.ts +16 -0
- package/dist/plugins/advanced/markdown.d.ts +5 -0
- package/dist/plugins/advanced/media-embed.d.ts +4 -0
- package/dist/plugins/advanced/placeholder-node.d.ts +22 -0
- package/dist/plugins/advanced/placeholder.d.ts +18 -0
- package/dist/plugins/advanced/revision-history.d.ts +22 -0
- package/dist/plugins/advanced/source-view.d.ts +37 -0
- package/dist/plugins/advanced/style-node.d.ts +18 -0
- package/dist/plugins/advanced/youtube-node.d.ts +34 -0
- package/dist/plugins/collaboration/revision-history.d.ts +25 -0
- package/dist/plugins/collaboration/revision-ui.d.ts +2 -0
- package/dist/plugins/collaboration/suggestion-node.d.ts +21 -0
- package/dist/plugins/collaboration/track-changes.d.ts +8 -0
- package/dist/plugins/configuration/accessibility.d.ts +11 -0
- package/dist/plugins/configuration/context-aware-toolbar.d.ts +66 -0
- package/dist/plugins/configuration/i18n.d.ts +40 -0
- package/dist/plugins/configuration/toolbar-config.d.ts +73 -0
- package/dist/plugins/configuration/toolbar-customization-ui.d.ts +73 -0
- package/dist/plugins/configuration/toolbar-customization.d.ts +12 -0
- package/dist/plugins/configuration/toolbar-system.d.ts +25 -0
- package/dist/plugins/configuration/toolbar-ui.d.ts +1 -0
- package/dist/plugins/custom-plugin-demo.d.ts +11 -0
- package/dist/plugins/essentials/clipboard.d.ts +4 -0
- package/dist/plugins/essentials/history.d.ts +12 -0
- package/dist/plugins/essentials/horizontal-rule-plugin.d.ts +2 -0
- package/dist/plugins/export/pdf-export.d.ts +4 -0
- package/dist/plugins/export/word-export.d.ts +4 -0
- package/dist/plugins/formatting/basic-styles.d.ts +33 -0
- package/dist/plugins/formatting/custom-heading-node.d.ts +17 -0
- package/dist/plugins/formatting/custom-link-node.d.ts +17 -0
- package/dist/plugins/formatting/custom-paragraph-node.d.ts +16 -0
- package/dist/plugins/formatting/icon-node.d.ts +22 -0
- package/dist/plugins/formatting/span-node.d.ts +18 -0
- package/dist/plugins/import/word-import.d.ts +5 -0
- package/dist/plugins/layout/headings.d.ts +7 -0
- package/dist/plugins/layout/indent.d.ts +2 -0
- package/dist/plugins/layout/layout-node.d.ts +22 -0
- package/dist/plugins/layout/lists.d.ts +22 -0
- package/dist/plugins/layout/table-resizer.d.ts +5 -0
- package/dist/plugins/layout/tables.d.ts +16 -0
- package/dist/plugins/media/custom-image-node.d.ts +23 -0
- package/dist/plugins/media/embed-plugin.d.ts +9 -0
- package/dist/plugins/media/image-drag-move.d.ts +2 -0
- package/dist/plugins/media/image-node.d.ts +70 -0
- package/dist/plugins/media/image-popover-ui.d.ts +2 -0
- package/dist/plugins/media/image-resizer.d.ts +6 -0
- package/dist/plugins/media/image-url-modal.d.ts +3 -0
- package/dist/plugins/media/images.d.ts +4 -0
- package/dist/plugins/media/link-popover-ui.d.ts +3 -0
- package/dist/plugins/media/links.d.ts +3 -0
- package/dist/plugins/media/unified-image-modal.d.ts +3 -0
- package/dist/plugins/page-layout/page-break-node.d.ts +20 -0
- package/dist/plugins/page-layout/page-break.d.ts +7 -0
- package/dist/plugins/page-layout/toc-node.d.ts +46 -0
- package/dist/plugins/page-layout/toc-plugin.d.ts +8 -0
- package/dist/plugins/productivity/autosave.d.ts +6 -0
- package/dist/plugins/productivity/case-change.d.ts +11 -0
- package/dist/plugins/productivity/document-outline.d.ts +12 -0
- package/dist/plugins/productivity/emoji-ui.d.ts +2 -0
- package/dist/plugins/productivity/emoji.d.ts +9 -0
- package/dist/plugins/productivity/find-replace-ui.d.ts +2 -0
- package/dist/plugins/productivity/find-replace.d.ts +26 -0
- package/dist/plugins/productivity/format-painter.d.ts +10 -0
- package/dist/plugins/productivity/minimap.d.ts +6 -0
- package/dist/plugins/productivity/productivity-pack.d.ts +5 -0
- package/dist/plugins/productivity/slash-commands.d.ts +5 -0
- package/dist/plugins/productivity/slash-menu-ui.d.ts +25 -0
- package/dist/plugins/upload/adapters.d.ts +16 -0
- package/dist/plugins/upload/upload-manager.d.ts +20 -0
- package/dist/shared/dialog-system.d.ts +28 -0
- package/dist/spare.d.ts +7 -0
- package/dist/ui/code-block-popover-ui.d.ts +5 -0
- package/dist/ui/components/editor-main-html.d.ts +1 -0
- package/dist/ui/components/modals-html.d.ts +1 -0
- package/dist/ui/components/status-bar-html.d.ts +1 -0
- package/dist/ui/components/toolbar-html.d.ts +1 -0
- package/dist/ui/icons.d.ts +53 -0
- package/dist/ui/layout.d.ts +1 -0
- package/dist/ui/revision-history-ui.d.ts +2 -0
- package/dist/ui/table-grid-picker.d.ts +3 -0
- package/dist/ui/table-popover-ui.d.ts +2 -0
- package/dist/ui/toolbar-delegation.d.ts +6 -0
- package/dist/ui/toolbar-logic/advanced-logic.d.ts +2 -0
- package/dist/ui/toolbar-logic/basic-logic.d.ts +2 -0
- package/dist/ui/toolbar-logic/document-logic.d.ts +2 -0
- package/dist/ui/toolbar-logic/state-logic.d.ts +1 -0
- package/dist/ui/toolbar-setup.d.ts +6 -0
- package/dist/ui/toolbar.d.ts +3 -0
- package/dist/ui/track-changes-ui.d.ts +2 -0
- package/dist/vite.svg +1 -0
- package/package.json +48 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type ToolbarItemConfig = {
|
|
2
|
+
id: string;
|
|
3
|
+
label: string;
|
|
4
|
+
visible: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare const ToolbarCustomization: {
|
|
7
|
+
getDefaultConfig: () => ToolbarItemConfig[];
|
|
8
|
+
getConfig: () => ToolbarItemConfig[];
|
|
9
|
+
saveConfig: (config: ToolbarItemConfig[]) => void;
|
|
10
|
+
applyConfig: (config: ToolbarItemConfig[]) => void;
|
|
11
|
+
init: () => void;
|
|
12
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { LexicalEditor } from 'lexical';
|
|
2
|
+
import { AureliaEditor } from '../../core/engine';
|
|
3
|
+
export declare class ToolbarSystem {
|
|
4
|
+
private static isInitialized;
|
|
5
|
+
/**
|
|
6
|
+
* Initialize the complete toolbar system
|
|
7
|
+
*/
|
|
8
|
+
static init(editor: AureliaEditor, internalEditor: LexicalEditor): void;
|
|
9
|
+
/**
|
|
10
|
+
* Setup toolbar customization button
|
|
11
|
+
*/
|
|
12
|
+
private static setupCustomizationButton;
|
|
13
|
+
/**
|
|
14
|
+
* Setup responsive overflow handling
|
|
15
|
+
*/
|
|
16
|
+
private static setupResponsiveOverflow;
|
|
17
|
+
/**
|
|
18
|
+
* Update overflow menu with hidden items
|
|
19
|
+
*/
|
|
20
|
+
private static updateOverflowMenu;
|
|
21
|
+
static showCustomization(): void;
|
|
22
|
+
static applyPreset(presetId: string): void;
|
|
23
|
+
static resetToDefault(): void;
|
|
24
|
+
}
|
|
25
|
+
export default ToolbarSystem;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function setupToolbarSettingsUI(): void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { EditorSDK } from '../core/sdk';
|
|
2
|
+
import { LexicalCommand } from 'lexical';
|
|
3
|
+
export declare const HELLO_WORLD_COMMAND: LexicalCommand<string>;
|
|
4
|
+
/**
|
|
5
|
+
* A Demo Plugin to showcase the new Editor SDK.
|
|
6
|
+
* It adds a button to the toolbar and registers a custom command.
|
|
7
|
+
*/
|
|
8
|
+
export declare const HelloWorldPlugin: {
|
|
9
|
+
name: string;
|
|
10
|
+
init: (sdk: EditorSDK) => void;
|
|
11
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { EditorPlugin } from '../../core/registry';
|
|
2
|
+
export declare const HistoryPlugin: EditorPlugin;
|
|
3
|
+
export declare const HISTORY_COMMANDS: {
|
|
4
|
+
UNDO: {
|
|
5
|
+
command: import('lexical').LexicalCommand<void>;
|
|
6
|
+
payload: undefined;
|
|
7
|
+
};
|
|
8
|
+
REDO: {
|
|
9
|
+
command: import('lexical').LexicalCommand<void>;
|
|
10
|
+
payload: undefined;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { TextFormatType } from 'lexical';
|
|
2
|
+
import { EditorPlugin } from '../../core/registry';
|
|
3
|
+
export declare const BasicStylesPlugin: EditorPlugin;
|
|
4
|
+
export declare const FORMAT_COMMANDS: {
|
|
5
|
+
BOLD: {
|
|
6
|
+
command: import('lexical').LexicalCommand<TextFormatType>;
|
|
7
|
+
payload: TextFormatType;
|
|
8
|
+
};
|
|
9
|
+
ITALIC: {
|
|
10
|
+
command: import('lexical').LexicalCommand<TextFormatType>;
|
|
11
|
+
payload: TextFormatType;
|
|
12
|
+
};
|
|
13
|
+
UNDERLINE: {
|
|
14
|
+
command: import('lexical').LexicalCommand<TextFormatType>;
|
|
15
|
+
payload: TextFormatType;
|
|
16
|
+
};
|
|
17
|
+
STRIKETHROUGH: {
|
|
18
|
+
command: import('lexical').LexicalCommand<TextFormatType>;
|
|
19
|
+
payload: TextFormatType;
|
|
20
|
+
};
|
|
21
|
+
SUBSCRIPT: {
|
|
22
|
+
command: import('lexical').LexicalCommand<TextFormatType>;
|
|
23
|
+
payload: TextFormatType;
|
|
24
|
+
};
|
|
25
|
+
SUPERSCRIPT: {
|
|
26
|
+
command: import('lexical').LexicalCommand<TextFormatType>;
|
|
27
|
+
payload: TextFormatType;
|
|
28
|
+
};
|
|
29
|
+
CODE: {
|
|
30
|
+
command: import('lexical').LexicalCommand<TextFormatType>;
|
|
31
|
+
payload: TextFormatType;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { HeadingNode, SerializedHeadingNode } from '@lexical/rich-text';
|
|
2
|
+
import { EditorConfig, NodeKey, DOMConversionMap, DOMExportOutput, Spread } from 'lexical';
|
|
3
|
+
export type SerializedCustomHeadingNode = Spread<{
|
|
4
|
+
attributes: Record<string, string>;
|
|
5
|
+
}, SerializedHeadingNode>;
|
|
6
|
+
export declare class CustomHeadingNode extends HeadingNode {
|
|
7
|
+
__attributes: Record<string, string>;
|
|
8
|
+
constructor(tag: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6', attributes?: Record<string, string>, key?: NodeKey);
|
|
9
|
+
static getType(): string;
|
|
10
|
+
static clone(node: CustomHeadingNode): CustomHeadingNode;
|
|
11
|
+
createDOM(config: EditorConfig): HTMLElement;
|
|
12
|
+
exportDOM(editor: any): DOMExportOutput;
|
|
13
|
+
static importDOM(): DOMConversionMap | null;
|
|
14
|
+
static importJSON(serializedNode: SerializedCustomHeadingNode): CustomHeadingNode;
|
|
15
|
+
exportJSON(): SerializedCustomHeadingNode;
|
|
16
|
+
}
|
|
17
|
+
export declare function $createCustomHeadingNode(tag: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6', attributes?: Record<string, string>): CustomHeadingNode;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { LinkNode, SerializedLinkNode } from '@lexical/link';
|
|
2
|
+
import { EditorConfig, NodeKey, DOMConversionMap, DOMExportOutput, Spread } from 'lexical';
|
|
3
|
+
export type SerializedCustomLinkNode = Spread<{
|
|
4
|
+
attributes: Record<string, string>;
|
|
5
|
+
}, SerializedLinkNode>;
|
|
6
|
+
export declare class CustomLinkNode extends LinkNode {
|
|
7
|
+
__attributes: Record<string, string>;
|
|
8
|
+
constructor(url: string, attributes?: Record<string, string>, key?: NodeKey);
|
|
9
|
+
static getType(): string;
|
|
10
|
+
static clone(node: CustomLinkNode): CustomLinkNode;
|
|
11
|
+
createDOM(config: EditorConfig): HTMLElement;
|
|
12
|
+
exportDOM(editor: any): DOMExportOutput;
|
|
13
|
+
static importDOM(): DOMConversionMap | null;
|
|
14
|
+
static importJSON(serializedNode: SerializedCustomLinkNode): CustomLinkNode;
|
|
15
|
+
exportJSON(): SerializedCustomLinkNode;
|
|
16
|
+
}
|
|
17
|
+
export declare function $createCustomLinkNode(url: string, attributes?: Record<string, string>): CustomLinkNode;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ParagraphNode, SerializedParagraphNode, EditorConfig, NodeKey, DOMConversionMap, DOMExportOutput, Spread } from 'lexical';
|
|
2
|
+
export type SerializedCustomParagraphNode = Spread<{
|
|
3
|
+
attributes: Record<string, string>;
|
|
4
|
+
}, SerializedParagraphNode>;
|
|
5
|
+
export declare class CustomParagraphNode extends ParagraphNode {
|
|
6
|
+
__attributes: Record<string, string>;
|
|
7
|
+
constructor(attributes?: Record<string, string>, key?: NodeKey);
|
|
8
|
+
static getType(): string;
|
|
9
|
+
static clone(node: CustomParagraphNode): CustomParagraphNode;
|
|
10
|
+
createDOM(config: EditorConfig): HTMLElement;
|
|
11
|
+
exportDOM(editor: any): DOMExportOutput;
|
|
12
|
+
static importDOM(): DOMConversionMap | null;
|
|
13
|
+
static importJSON(serializedNode: SerializedCustomParagraphNode): CustomParagraphNode;
|
|
14
|
+
exportJSON(): SerializedCustomParagraphNode;
|
|
15
|
+
}
|
|
16
|
+
export declare function $createCustomParagraphNode(attributes?: Record<string, string>): CustomParagraphNode;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ElementNode, EditorConfig, NodeKey, DOMConversionMap, DOMExportOutput, LexicalNode, SerializedElementNode, Spread } from 'lexical';
|
|
2
|
+
export type SerializedIconNode = Spread<{
|
|
3
|
+
tagName: string;
|
|
4
|
+
attributes: Record<string, string>;
|
|
5
|
+
}, SerializedElementNode>;
|
|
6
|
+
export declare class IconNode extends ElementNode {
|
|
7
|
+
__tagName: string;
|
|
8
|
+
__attributes: Record<string, string>;
|
|
9
|
+
constructor(tagName: string, attributes?: Record<string, string>, key?: NodeKey);
|
|
10
|
+
static getType(): string;
|
|
11
|
+
static clone(node: IconNode): IconNode;
|
|
12
|
+
createDOM(_config: EditorConfig): HTMLElement;
|
|
13
|
+
updateDOM(prevNode: IconNode, dom: HTMLElement): boolean;
|
|
14
|
+
static importDOM(): DOMConversionMap | null;
|
|
15
|
+
exportDOM(): DOMExportOutput;
|
|
16
|
+
static importJSON(serializedNode: SerializedIconNode): IconNode;
|
|
17
|
+
exportJSON(): SerializedIconNode;
|
|
18
|
+
isInline(): boolean;
|
|
19
|
+
canBeEmpty(): boolean;
|
|
20
|
+
}
|
|
21
|
+
export declare function $createIconNode(tagName: string, attributes?: Record<string, string>): IconNode;
|
|
22
|
+
export declare function $isIconNode(node: LexicalNode | null | undefined): node is IconNode;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ElementNode, EditorConfig, NodeKey, DOMConversionMap, DOMExportOutput, SerializedElementNode, Spread } from 'lexical';
|
|
2
|
+
export type SerializedSpanNode = Spread<{
|
|
3
|
+
attributes: Record<string, string>;
|
|
4
|
+
}, SerializedElementNode>;
|
|
5
|
+
export declare class SpanNode extends ElementNode {
|
|
6
|
+
__attributes: Record<string, string>;
|
|
7
|
+
constructor(attributes?: Record<string, string>, key?: NodeKey);
|
|
8
|
+
static getType(): string;
|
|
9
|
+
static clone(node: SpanNode): SpanNode;
|
|
10
|
+
createDOM(_config: EditorConfig): HTMLElement;
|
|
11
|
+
updateDOM(prevNode: SpanNode, dom: HTMLElement): boolean;
|
|
12
|
+
static importDOM(): DOMConversionMap | null;
|
|
13
|
+
exportDOM(): DOMExportOutput;
|
|
14
|
+
static importJSON(serializedNode: SerializedSpanNode): SpanNode;
|
|
15
|
+
exportJSON(): SerializedSpanNode;
|
|
16
|
+
canBeEmpty(): boolean;
|
|
17
|
+
isInline(): boolean;
|
|
18
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HeadingTagType } from '@lexical/rich-text';
|
|
2
|
+
import { LexicalEditor } from 'lexical';
|
|
3
|
+
import { EditorPlugin } from '../../core/registry';
|
|
4
|
+
export declare const HeadingsPlugin: EditorPlugin;
|
|
5
|
+
export declare const setBlockType: (editor: any, type: HeadingTagType | "quote" | "paragraph") => void;
|
|
6
|
+
export declare const toggleBlockQuote: (editor: LexicalEditor) => void;
|
|
7
|
+
export declare const insertHorizontalRule: (editor: LexicalEditor) => void;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ElementNode, EditorConfig, NodeKey, DOMConversionMap, DOMExportOutput, LexicalNode, SerializedElementNode, Spread } from 'lexical';
|
|
2
|
+
export type SerializedLayoutNode = Spread<{
|
|
3
|
+
tagName: string;
|
|
4
|
+
attributes: Record<string, string>;
|
|
5
|
+
}, SerializedElementNode>;
|
|
6
|
+
export declare class LayoutNode extends ElementNode {
|
|
7
|
+
__tagName: string;
|
|
8
|
+
__attributes: Record<string, string>;
|
|
9
|
+
constructor(tagName: string, attributes?: Record<string, string>, key?: NodeKey);
|
|
10
|
+
static getType(): string;
|
|
11
|
+
static clone(node: LayoutNode): LayoutNode;
|
|
12
|
+
createDOM(config: EditorConfig): HTMLElement;
|
|
13
|
+
updateDOM(prevNode: LayoutNode, dom: HTMLElement): boolean;
|
|
14
|
+
static importDOM(): DOMConversionMap | null;
|
|
15
|
+
exportDOM(): DOMExportOutput;
|
|
16
|
+
static importJSON(serializedNode: SerializedLayoutNode): LayoutNode;
|
|
17
|
+
exportJSON(): SerializedLayoutNode;
|
|
18
|
+
canBeEmpty(): boolean;
|
|
19
|
+
isInline(): boolean;
|
|
20
|
+
}
|
|
21
|
+
export declare function $createLayoutNode(tagName: string, attributes?: Record<string, string>): LayoutNode;
|
|
22
|
+
export declare function $isLayoutNode(node: LexicalNode | null | undefined): node is LayoutNode;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { LexicalEditor } from 'lexical';
|
|
2
|
+
import { EditorPlugin } from '../../core/registry';
|
|
3
|
+
export declare const ListsPlugin: EditorPlugin;
|
|
4
|
+
export declare const toggleList: (editor: LexicalEditor, type: "bullet" | "number") => void;
|
|
5
|
+
export declare const LIST_COMMANDS: {
|
|
6
|
+
BULLET: {
|
|
7
|
+
command: import('lexical').LexicalCommand<void>;
|
|
8
|
+
payload: undefined;
|
|
9
|
+
};
|
|
10
|
+
NUMBER: {
|
|
11
|
+
command: import('lexical').LexicalCommand<void>;
|
|
12
|
+
payload: undefined;
|
|
13
|
+
};
|
|
14
|
+
INDENT: {
|
|
15
|
+
command: import('lexical').LexicalCommand<void>;
|
|
16
|
+
payload: undefined;
|
|
17
|
+
};
|
|
18
|
+
OUTDENT: {
|
|
19
|
+
command: import('lexical').LexicalCommand<void>;
|
|
20
|
+
payload: undefined;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { EditorPlugin } from '../../core/registry';
|
|
2
|
+
export declare const TablesPlugin: EditorPlugin;
|
|
3
|
+
export declare const tableHandlers: {
|
|
4
|
+
insertRowAbove: (editor: any) => void;
|
|
5
|
+
insertRowBelow: (editor: any) => void;
|
|
6
|
+
insertColumnLeft: (editor: any) => void;
|
|
7
|
+
insertColumnRight: (editor: any) => void;
|
|
8
|
+
deleteRow: (editor: any) => void;
|
|
9
|
+
deleteColumn: (editor: any) => void;
|
|
10
|
+
deleteTable: (editor: any) => void;
|
|
11
|
+
insertRow: (editor: any) => void;
|
|
12
|
+
insertColumn: (editor: any) => void;
|
|
13
|
+
mergeCells: (editor: any) => void;
|
|
14
|
+
splitCell: (editor: any) => void;
|
|
15
|
+
};
|
|
16
|
+
export declare const insertTable: (editor: any) => void;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ImageNode, SerializedImageNode, ImageAlignment } from './image-node';
|
|
2
|
+
import { NodeKey, DOMConversionMap, DOMExportOutput, Spread, EditorConfig, LexicalEditor } from 'lexical';
|
|
3
|
+
export type SerializedCustomImageNode = Spread<{
|
|
4
|
+
attributes: Record<string, string>;
|
|
5
|
+
}, SerializedImageNode>;
|
|
6
|
+
export declare class CustomImageNode extends ImageNode {
|
|
7
|
+
__attributes: Record<string, string>;
|
|
8
|
+
constructor(src?: string, altText?: string, attributes?: Record<string, string>, maxWidth?: number, width?: number | 'inherit', height?: number | 'inherit', caption?: string, alignment?: ImageAlignment, showCaption?: boolean, linkUrl?: string, cropData?: {
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
width: number;
|
|
12
|
+
height: number;
|
|
13
|
+
} | null, key?: NodeKey);
|
|
14
|
+
static getType(): string;
|
|
15
|
+
static clone(node: CustomImageNode): CustomImageNode;
|
|
16
|
+
createDOM(config: EditorConfig): HTMLElement;
|
|
17
|
+
decorate(editor: LexicalEditor, config: EditorConfig): HTMLElement;
|
|
18
|
+
exportDOM(): DOMExportOutput;
|
|
19
|
+
static importDOM(): DOMConversionMap | null;
|
|
20
|
+
static importJSON(serializedNode: SerializedCustomImageNode): CustomImageNode;
|
|
21
|
+
exportJSON(): SerializedCustomImageNode;
|
|
22
|
+
}
|
|
23
|
+
export declare function $createCustomImageNode(src: string, altText: string, attributes?: Record<string, string>): CustomImageNode;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { LexicalCommand } from 'lexical';
|
|
2
|
+
import { EditorPlugin } from '../../core/registry';
|
|
3
|
+
import { EditorSDK } from '../../core/sdk';
|
|
4
|
+
export declare const INSERT_YOUTUBE_COMMAND: LexicalCommand<string>;
|
|
5
|
+
export declare const INSERT_HTML_SNIPPET_COMMAND: LexicalCommand<string>;
|
|
6
|
+
export declare class EmbedPlugin implements EditorPlugin {
|
|
7
|
+
name: string;
|
|
8
|
+
init(sdk: EditorSDK): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { DecoratorNode, NodeKey, EditorConfig, LexicalNode, SerializedLexicalNode, Spread, LexicalEditor, DOMConversionMap, DOMExportOutput } from 'lexical';
|
|
2
|
+
export type ImageAlignment = 'left' | 'right' | 'center' | 'full';
|
|
3
|
+
export type SerializedImageNode = Spread<{
|
|
4
|
+
altText: string;
|
|
5
|
+
caption: string;
|
|
6
|
+
height?: number;
|
|
7
|
+
maxWidth: number;
|
|
8
|
+
src: string;
|
|
9
|
+
width?: number;
|
|
10
|
+
alignment?: ImageAlignment;
|
|
11
|
+
showCaption?: boolean;
|
|
12
|
+
linkUrl?: string;
|
|
13
|
+
cropData?: {
|
|
14
|
+
x: number;
|
|
15
|
+
y: number;
|
|
16
|
+
width: number;
|
|
17
|
+
height: number;
|
|
18
|
+
};
|
|
19
|
+
className?: string;
|
|
20
|
+
}, SerializedLexicalNode>;
|
|
21
|
+
export declare class ImageNode extends DecoratorNode<HTMLElement> {
|
|
22
|
+
__src: string;
|
|
23
|
+
__altText: string;
|
|
24
|
+
__width: 'inherit' | number;
|
|
25
|
+
__height: 'inherit' | number;
|
|
26
|
+
__maxWidth: number;
|
|
27
|
+
__caption: string;
|
|
28
|
+
__alignment: ImageAlignment;
|
|
29
|
+
__showCaption: boolean;
|
|
30
|
+
__linkUrl: string;
|
|
31
|
+
__cropData: {
|
|
32
|
+
x: number;
|
|
33
|
+
y: number;
|
|
34
|
+
width: number;
|
|
35
|
+
height: number;
|
|
36
|
+
} | null;
|
|
37
|
+
__className: string;
|
|
38
|
+
constructor(src?: string, altText?: string, maxWidth?: number, width?: number | 'inherit', height?: number | 'inherit', caption?: string, alignment?: ImageAlignment, showCaption?: boolean, linkUrl?: string, cropData?: {
|
|
39
|
+
x: number;
|
|
40
|
+
y: number;
|
|
41
|
+
width: number;
|
|
42
|
+
height: number;
|
|
43
|
+
} | null, className?: string, key?: NodeKey);
|
|
44
|
+
static getType(): string;
|
|
45
|
+
static clone(node: ImageNode): ImageNode;
|
|
46
|
+
static importDOM(): DOMConversionMap | null;
|
|
47
|
+
exportDOM(): DOMExportOutput;
|
|
48
|
+
static importJSON(serializedNode: SerializedImageNode): ImageNode;
|
|
49
|
+
exportJSON(): SerializedImageNode;
|
|
50
|
+
setClassName(className: string): void;
|
|
51
|
+
setWidthAndHeight(width: number | 'inherit', height: number | 'inherit'): void;
|
|
52
|
+
setAlignment(alignment: ImageAlignment): void;
|
|
53
|
+
setShowCaption(show: boolean): void;
|
|
54
|
+
setCaption(caption: string): void;
|
|
55
|
+
setAltText(altText: string): void;
|
|
56
|
+
setLinkUrl(url: string): void;
|
|
57
|
+
setCropData(cropData: {
|
|
58
|
+
x: number;
|
|
59
|
+
y: number;
|
|
60
|
+
width: number;
|
|
61
|
+
height: number;
|
|
62
|
+
} | null): void;
|
|
63
|
+
isInline(): boolean;
|
|
64
|
+
isKeyboardSelectable(): boolean;
|
|
65
|
+
createDOM(config: EditorConfig): HTMLElement;
|
|
66
|
+
updateDOM(prevNode: ImageNode): boolean;
|
|
67
|
+
decorate(editor: LexicalEditor, _config: EditorConfig): HTMLElement;
|
|
68
|
+
}
|
|
69
|
+
export declare function $isImageNode(node: LexicalNode | null | undefined): node is ImageNode;
|
|
70
|
+
export declare function $createImageNode(src: string, altText: string, maxWidth: number): ImageNode;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { DecoratorNode, DOMExportOutput, EditorConfig, LexicalNode, NodeKey, SerializedLexicalNode, Spread, DOMConversionMap } from 'lexical';
|
|
2
|
+
export type SerializedPageBreakNode = Spread<{
|
|
3
|
+
type: 'page-break';
|
|
4
|
+
version: 1;
|
|
5
|
+
}, SerializedLexicalNode>;
|
|
6
|
+
export declare class PageBreakNode extends DecoratorNode<HTMLDivElement> {
|
|
7
|
+
static getType(): string;
|
|
8
|
+
static clone(node: PageBreakNode): PageBreakNode;
|
|
9
|
+
static importJSON(_serializedNode: SerializedPageBreakNode): PageBreakNode;
|
|
10
|
+
constructor(key?: NodeKey);
|
|
11
|
+
exportJSON(): SerializedPageBreakNode;
|
|
12
|
+
createDOM(_config: EditorConfig): HTMLElement;
|
|
13
|
+
updateDOM(): boolean;
|
|
14
|
+
decorate(): HTMLDivElement;
|
|
15
|
+
static importDOM(): DOMConversionMap | null;
|
|
16
|
+
exportDOM(): DOMExportOutput;
|
|
17
|
+
getTextContent(): string;
|
|
18
|
+
}
|
|
19
|
+
export declare function $createPageBreakNode(): PageBreakNode;
|
|
20
|
+
export declare function $isPageBreakNode(node: LexicalNode | null | undefined): node is PageBreakNode;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { DecoratorNode, EditorConfig, LexicalNode, NodeKey, SerializedLexicalNode, Spread, $getRoot } from 'lexical';
|
|
2
|
+
export type TOCEntry = {
|
|
3
|
+
key: string;
|
|
4
|
+
text: string;
|
|
5
|
+
tag: string;
|
|
6
|
+
level: number;
|
|
7
|
+
};
|
|
8
|
+
export type TOCConfig = {
|
|
9
|
+
minLevel?: number;
|
|
10
|
+
maxLevel?: number;
|
|
11
|
+
numbered?: boolean;
|
|
12
|
+
collapsible?: boolean;
|
|
13
|
+
style?: 'ordered' | 'unordered' | 'nested';
|
|
14
|
+
theme?: 'light' | 'dark' | 'auto';
|
|
15
|
+
};
|
|
16
|
+
export type SerializedTableOfContentsNode = Spread<{
|
|
17
|
+
entries: TOCEntry[];
|
|
18
|
+
config: TOCConfig;
|
|
19
|
+
type: 'toc';
|
|
20
|
+
version: 2;
|
|
21
|
+
}, SerializedLexicalNode>;
|
|
22
|
+
export declare class TableOfContentsNode extends DecoratorNode<HTMLElement> {
|
|
23
|
+
__entries: TOCEntry[];
|
|
24
|
+
__config: TOCConfig;
|
|
25
|
+
static getType(): string;
|
|
26
|
+
static clone(node: TableOfContentsNode): TableOfContentsNode;
|
|
27
|
+
static importJSON(serializedNode: SerializedTableOfContentsNode): TableOfContentsNode;
|
|
28
|
+
constructor(entries?: TOCEntry[], config?: TOCConfig, key?: NodeKey);
|
|
29
|
+
exportJSON(): SerializedTableOfContentsNode;
|
|
30
|
+
createDOM(_config: EditorConfig): HTMLElement;
|
|
31
|
+
updateDOM(prevNode: TableOfContentsNode, dom: HTMLElement): boolean;
|
|
32
|
+
renderEntries(container: HTMLElement): void;
|
|
33
|
+
private buildNestedList;
|
|
34
|
+
private getNumberForEntry;
|
|
35
|
+
setEntries(entries: TOCEntry[]): void;
|
|
36
|
+
setConfig(config: Partial<TOCConfig>): void;
|
|
37
|
+
getConfig(): TOCConfig;
|
|
38
|
+
decorate(): HTMLElement;
|
|
39
|
+
getTextContent(): string;
|
|
40
|
+
}
|
|
41
|
+
export declare function $createTableOfContentsNode(entries?: TOCEntry[], config?: TOCConfig): TableOfContentsNode;
|
|
42
|
+
export declare function $isTableOfContentsNode(node: LexicalNode | null | undefined): node is TableOfContentsNode;
|
|
43
|
+
/**
|
|
44
|
+
* Recursively scan all nodes to find headings, including those in nested structures
|
|
45
|
+
*/
|
|
46
|
+
export declare function $scanAllHeadings(root: ReturnType<typeof $getRoot>): TOCEntry[];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { LexicalCommand } from 'lexical';
|
|
2
|
+
import { TOCConfig } from './toc-node';
|
|
3
|
+
import { EditorSDK } from '../../core/sdk';
|
|
4
|
+
export declare const INSERT_TOC_COMMAND: LexicalCommand<TOCConfig | undefined>;
|
|
5
|
+
export declare const TableOfContentsPlugin: {
|
|
6
|
+
name: string;
|
|
7
|
+
init: (sdk: EditorSDK) => void;
|
|
8
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { EditorPlugin } from '../../core/registry';
|
|
2
|
+
import { LexicalEditor } from 'lexical';
|
|
3
|
+
export declare const AUTOSAVE_KEY = "editor_autosave_state";
|
|
4
|
+
export declare const AutosavePlugin: EditorPlugin;
|
|
5
|
+
export declare function hasAutosavedState(): boolean;
|
|
6
|
+
export declare function loadAutosavedState(editor: LexicalEditor): void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { LexicalEditor } from 'lexical';
|
|
2
|
+
import { EditorSDK } from '../../core/sdk';
|
|
3
|
+
export declare const CaseChange: {
|
|
4
|
+
toUpperCase: (editor: LexicalEditor) => void;
|
|
5
|
+
toLowerCase: (editor: LexicalEditor) => void;
|
|
6
|
+
toTitleCase: (editor: LexicalEditor) => void;
|
|
7
|
+
};
|
|
8
|
+
export declare const CaseChangePlugin: {
|
|
9
|
+
name: string;
|
|
10
|
+
init: (_sdk: EditorSDK) => void;
|
|
11
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { EditorSDK } from '../../core/sdk';
|
|
2
|
+
export type OutlineEntry = {
|
|
3
|
+
key: string;
|
|
4
|
+
text: string;
|
|
5
|
+
tag: string;
|
|
6
|
+
level: number;
|
|
7
|
+
};
|
|
8
|
+
export declare const DocumentOutlinePlugin: {
|
|
9
|
+
name: string;
|
|
10
|
+
init: (sdk: EditorSDK) => void;
|
|
11
|
+
toggleVisibility: () => void;
|
|
12
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { LexicalEditor } from 'lexical';
|
|
2
|
+
import { EditorSDK } from '../../core/sdk';
|
|
3
|
+
export declare const EmojiPlugin: {
|
|
4
|
+
name: string;
|
|
5
|
+
init: (_sdk: EditorSDK) => void;
|
|
6
|
+
};
|
|
7
|
+
export declare const EmojiPicker: {
|
|
8
|
+
insertEmoji: (editor: LexicalEditor, emoji: string) => void;
|
|
9
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { TextNode, LexicalEditor } from 'lexical';
|
|
2
|
+
export interface SearchOptions {
|
|
3
|
+
caseSensitive: boolean;
|
|
4
|
+
wholeWord: boolean;
|
|
5
|
+
isRegex: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const FindReplace: {
|
|
8
|
+
/**
|
|
9
|
+
* Finds the next match relative to current cursor.
|
|
10
|
+
*/
|
|
11
|
+
findNext: (editor: LexicalEditor, searchText: string, options: SearchOptions) => void;
|
|
12
|
+
/**
|
|
13
|
+
* Finds the previous match (search backwards).
|
|
14
|
+
*/
|
|
15
|
+
findPrevious: (editor: LexicalEditor, searchText: string, options: SearchOptions) => void;
|
|
16
|
+
/**
|
|
17
|
+
* Internal search logic using Regex for flexibility
|
|
18
|
+
*/
|
|
19
|
+
_find: (editor: LexicalEditor, searchText: string, options: SearchOptions, backwards: boolean) => void;
|
|
20
|
+
selectMatch: (editor: LexicalEditor, node: TextNode, index: number, length: number) => void;
|
|
21
|
+
/**
|
|
22
|
+
* Replaces, then moves to next.
|
|
23
|
+
*/
|
|
24
|
+
replace: (editor: LexicalEditor, searchText: string, replaceText: string, options: SearchOptions) => void;
|
|
25
|
+
replaceAll: (editor: LexicalEditor, searchText: string, replaceText: string, options: SearchOptions) => void;
|
|
26
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { LexicalEditor } from 'lexical';
|
|
2
|
+
import { EditorPlugin } from '../../core/registry';
|
|
3
|
+
export declare const FormatPainterPlugin: EditorPlugin;
|
|
4
|
+
export declare const FormatPainter: {
|
|
5
|
+
/**
|
|
6
|
+
* Copies the format of the current selection.
|
|
7
|
+
*/
|
|
8
|
+
copyFormat: (editor: LexicalEditor, isLocked?: boolean) => void;
|
|
9
|
+
isPainting: () => boolean;
|
|
10
|
+
};
|