@tulip-systems/editor 0.12.2 → 0.12.3
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/dist/client.d.mts +5 -4
- package/dist/client.mjs +5 -4
- package/dist/components/editor.client.d.mts +4 -3
- package/dist/components/editor.client.mjs +3 -3
- package/dist/extensions/skeleton/extension.d.mts +5 -0
- package/dist/extensions/skeleton/renderer.mjs +1 -1
- package/dist/lib/extensions.d.mts +6 -54
- package/dist/lib/extensions.mjs +7 -30
- package/package.json +4 -5
- package/dist/lib/constants.d.mts +0 -35
- package/dist/lib/constants.mjs +0 -87
package/dist/client.d.mts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { EditorContent } from "./components/content.client.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { Image, ImageOptions } from "./extensions/image/extension.mjs";
|
|
4
|
-
import { EditorExtensionsConfig, EditorExtensionsConfigResult, createExtensionConfig, editorExtensionsConfigToExtensions, flattenEditorExtensionsConfig } from "./lib/extensions.mjs";
|
|
2
|
+
import { EditorExtensionState, EditorPreset, defineEditorPreset, getEditorExtensionState } from "./lib/extensions.mjs";
|
|
5
3
|
import { EditorJSONContent } from "./lib/types.mjs";
|
|
6
4
|
import { Editor, EditorContext, EditorProps, editorVariants } from "./components/editor.client.mjs";
|
|
7
5
|
import { EditorMenuBubble, EditorMenuFixed } from "./components/menu.client.mjs";
|
|
8
|
-
|
|
6
|
+
import { FileHandler, FileHandlerOptions } from "./extensions/file-handler/extension.mjs";
|
|
7
|
+
import { Image, ImageOptions } from "./extensions/image/extension.mjs";
|
|
8
|
+
import { Skeleton } from "./extensions/skeleton/extension.mjs";
|
|
9
|
+
export { Editor, EditorContent, EditorContext, EditorExtensionState, EditorJSONContent, EditorMenuBubble, EditorMenuFixed, EditorPreset, EditorProps, FileHandler, FileHandlerOptions, Image, ImageOptions, Skeleton, defineEditorPreset, editorVariants, getEditorExtensionState };
|
package/dist/client.mjs
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import "./lib/types.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { Image } from "./extensions/image/extension.mjs";
|
|
4
|
-
import { createExtensionConfig, editorExtensionsConfigToExtensions, flattenEditorExtensionsConfig } from "./lib/extensions.mjs";
|
|
2
|
+
import { defineEditorPreset, getEditorExtensionState } from "./lib/extensions.mjs";
|
|
5
3
|
import { Editor, EditorContext, editorVariants } from "./components/editor.client.mjs";
|
|
6
4
|
import { EditorContent } from "./components/content.client.mjs";
|
|
7
5
|
import { EditorMenuBubble, EditorMenuFixed } from "./components/menu.client.mjs";
|
|
8
|
-
|
|
6
|
+
import { FileHandler } from "./extensions/file-handler/extension.mjs";
|
|
7
|
+
import { Image } from "./extensions/image/extension.mjs";
|
|
8
|
+
import { Skeleton } from "./extensions/skeleton/extension.mjs";
|
|
9
|
+
export { Editor, EditorContent, EditorContext, EditorMenuBubble, EditorMenuFixed, FileHandler, Image, Skeleton, defineEditorPreset, editorVariants, getEditorExtensionState };
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EditorExtensionState } from "../lib/extensions.mjs";
|
|
2
2
|
import { EditorJSONContent } from "../lib/types.mjs";
|
|
3
|
+
import { Extensions } from "@tiptap/core";
|
|
3
4
|
import { Content, Editor, EditorOptions } from "@tiptap/react";
|
|
4
5
|
import { PropsWithChildren } from "react";
|
|
5
6
|
import { VariantProps } from "class-variance-authority";
|
|
6
7
|
//#region src/components/editor.client.d.ts
|
|
7
8
|
type EditorContextValue = {
|
|
8
9
|
editor: Editor;
|
|
9
|
-
extensions:
|
|
10
|
+
extensions: EditorExtensionState;
|
|
10
11
|
};
|
|
11
12
|
declare const EditorContext: import("react").Context<EditorContextValue>;
|
|
12
13
|
declare const editorVariants: (props?: ({
|
|
@@ -14,7 +15,7 @@ declare const editorVariants: (props?: ({
|
|
|
14
15
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
15
16
|
type EditorProps = VariantProps<typeof editorVariants> & Pick<EditorOptions["editorProps"], "attributes"> & PropsWithChildren<{
|
|
16
17
|
value?: Content;
|
|
17
|
-
extensions
|
|
18
|
+
extensions: Extensions;
|
|
18
19
|
onUpdate?: (value: EditorJSONContent) => void;
|
|
19
20
|
onBlur?: (value: EditorJSONContent) => void;
|
|
20
21
|
disabled?: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { getEditorExtensionState } from "../lib/extensions.mjs";
|
|
3
3
|
import { editorImageVariants, editorProseVariants } from "../lib/variants.mjs";
|
|
4
4
|
import { useEditor } from "@tiptap/react";
|
|
5
5
|
import { createContext } from "react";
|
|
@@ -18,7 +18,7 @@ const editorVariants = cva("", {
|
|
|
18
18
|
});
|
|
19
19
|
function Editor$1({ value, extensions, onUpdate, onBlur, disabled, variant, className, children, attributes }) {
|
|
20
20
|
const editor = useEditor({
|
|
21
|
-
extensions
|
|
21
|
+
extensions,
|
|
22
22
|
content: value,
|
|
23
23
|
onUpdate: ({ editor }) => onUpdate?.(editor.getJSON()),
|
|
24
24
|
onBlur: ({ editor }) => onBlur?.(editor.getJSON()),
|
|
@@ -37,7 +37,7 @@ function Editor$1({ value, extensions, onUpdate, onBlur, disabled, variant, clas
|
|
|
37
37
|
return /* @__PURE__ */ jsx(EditorContext.Provider, {
|
|
38
38
|
value: {
|
|
39
39
|
editor,
|
|
40
|
-
extensions:
|
|
40
|
+
extensions: getEditorExtensionState(extensions)
|
|
41
41
|
},
|
|
42
42
|
children: /* @__PURE__ */ jsx("div", {
|
|
43
43
|
className: editorVariants({ variant }),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { NodeViewWrapper } from "@tiptap/react";
|
|
3
|
-
import { Skeleton } from "@tulip-systems/ui/skeleton";
|
|
4
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { Skeleton } from "@tulip-systems/ui/skeleton";
|
|
5
5
|
//#region src/extensions/skeleton/renderer.tsx
|
|
6
6
|
function SkeletonNodeRenderer(props) {
|
|
7
7
|
const { width, height } = props.node.attrs;
|
|
@@ -1,56 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ImageOptions } from "../extensions/image/extension.mjs";
|
|
3
|
-
import { EditorExtensions } from "./constants.mjs";
|
|
4
|
-
import { BlockquoteOptions } from "@tiptap/extension-blockquote";
|
|
5
|
-
import { BoldOptions } from "@tiptap/extension-bold";
|
|
6
|
-
import { HardBreakOptions } from "@tiptap/extension-hard-break";
|
|
7
|
-
import { HeadingOptions } from "@tiptap/extension-heading";
|
|
8
|
-
import { HorizontalRuleOptions } from "@tiptap/extension-horizontal-rule";
|
|
9
|
-
import { ItalicOptions } from "@tiptap/extension-italic";
|
|
10
|
-
import { LinkOptions } from "@tiptap/extension-link";
|
|
11
|
-
import { BulletListOptions, ListItemOptions, ListKeymapOptions, OrderedListOptions } from "@tiptap/extension-list";
|
|
12
|
-
import { ParagraphOptions } from "@tiptap/extension-paragraph";
|
|
13
|
-
import { StrikeOptions } from "@tiptap/extension-strike";
|
|
14
|
-
import { UnderlineOptions } from "@tiptap/extension-underline";
|
|
15
|
-
import { Extension } from "@tiptap/react";
|
|
16
|
-
import { HighlightOptions } from "@tiptap/extension-highlight";
|
|
17
|
-
import { ColorOptions, TextStyleOptions } from "@tiptap/extension-text-style";
|
|
18
|
-
import { DropcursorOptions, TrailingNodeOptions, UndoRedoOptions } from "@tiptap/extensions";
|
|
1
|
+
import { Extensions } from "@tiptap/core";
|
|
19
2
|
//#region src/lib/extensions.d.ts
|
|
20
|
-
type
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
hardBreak: Partial<HardBreakOptions> | boolean;
|
|
25
|
-
heading: Partial<HeadingOptions> | boolean;
|
|
26
|
-
horizontalRule: Partial<HorizontalRuleOptions> | boolean;
|
|
27
|
-
listItem: Partial<ListItemOptions> | boolean;
|
|
28
|
-
orderedList: Partial<OrderedListOptions> | boolean;
|
|
29
|
-
paragraph: Partial<ParagraphOptions> | boolean;
|
|
30
|
-
text: Partial<TextStyleOptions> | boolean;
|
|
31
|
-
image: Partial<ImageOptions> | boolean;
|
|
32
|
-
fileHandler: Partial<FileHandlerOptions> | boolean;
|
|
33
|
-
skeleton: boolean;
|
|
34
|
-
bold: Partial<BoldOptions> | boolean;
|
|
35
|
-
italic: Partial<ItalicOptions> | boolean;
|
|
36
|
-
link: Partial<LinkOptions> | boolean;
|
|
37
|
-
strike: Partial<StrikeOptions> | boolean;
|
|
38
|
-
underline: Partial<UnderlineOptions> | boolean;
|
|
39
|
-
highlight: Partial<HighlightOptions> | boolean;
|
|
40
|
-
dropcursor: Partial<DropcursorOptions> | boolean;
|
|
41
|
-
gapcursor: boolean;
|
|
42
|
-
undoRedo: Partial<UndoRedoOptions> | boolean;
|
|
43
|
-
listKeymap: Partial<ListKeymapOptions> | boolean;
|
|
44
|
-
trailingNode: Partial<TrailingNodeOptions> | boolean;
|
|
45
|
-
textStyle: Partial<TextStyleOptions> | boolean;
|
|
46
|
-
color: Partial<ColorOptions> | boolean;
|
|
47
|
-
};
|
|
48
|
-
declare function createExtensionConfig<TName extends keyof EditorExtensionsConfig>(name: TName, defaultOptions?: Partial<Exclude<EditorExtensionsConfig[TName], boolean>>): {
|
|
49
|
-
name: TName;
|
|
50
|
-
configure: (options: EditorExtensionsConfig[TName]) => import("@tiptap/core").Node<BlockquoteOptions, any> | import("@tiptap/core").Node<any, any> | import("@tiptap/core").Node<HardBreakOptions, any> | import("@tiptap/core").Node<HeadingOptions, any> | import("@tiptap/core").Node<HorizontalRuleOptions, any> | import("@tiptap/core").Node<ListItemOptions, any> | import("@tiptap/core").Node<OrderedListOptions, any> | import("@tiptap/core").Node<ImageOptions, any> | Extension<FileHandlerOptions, any> | import("@tiptap/core").Mark<BoldOptions, any> | import("@tiptap/core").Mark<LinkOptions, any> | import("@tiptap/core").Mark<HighlightOptions, any> | Extension<DropcursorOptions, any> | Extension<any, any> | Extension<UndoRedoOptions, any> | Extension<ListKeymapOptions, any> | Extension<TrailingNodeOptions, any> | import("@tiptap/core").Mark<TextStyleOptions, any> | Extension<ColorOptions, any> | undefined;
|
|
51
|
-
};
|
|
52
|
-
declare function editorExtensionsConfigToExtensions(extensions?: Partial<EditorExtensionsConfig>): Extension<any, any>[];
|
|
53
|
-
declare function flattenEditorExtensionsConfig(extensions?: Partial<EditorExtensionsConfig>): EditorExtensionsConfigResult;
|
|
54
|
-
type EditorExtensionsConfigResult = Record<keyof EditorExtensions, boolean>;
|
|
3
|
+
type EditorExtensionState = Record<string, boolean>;
|
|
4
|
+
type EditorPreset = Extensions;
|
|
5
|
+
declare function defineEditorPreset(extensions: Extensions): EditorPreset;
|
|
6
|
+
declare function getEditorExtensionState(extensions: Extensions): EditorExtensionState;
|
|
55
7
|
//#endregion
|
|
56
|
-
export {
|
|
8
|
+
export { EditorExtensionState, EditorPreset, defineEditorPreset, getEditorExtensionState };
|
package/dist/lib/extensions.mjs
CHANGED
|
@@ -1,35 +1,12 @@
|
|
|
1
|
-
import { EDITOR_EXTENSIONS, EDITOR_EXTENSIONS_CONFIG, EDITOR_EXTENSIONS_KEYS } from "./constants.mjs";
|
|
2
|
-
import deepmerge from "deepmerge";
|
|
3
1
|
//#region src/lib/extensions.ts
|
|
4
|
-
function
|
|
5
|
-
return
|
|
6
|
-
name,
|
|
7
|
-
configure: (options) => {
|
|
8
|
-
const extension = EDITOR_EXTENSIONS[name];
|
|
9
|
-
if (!options || !extension) return void 0;
|
|
10
|
-
if (typeof options === "boolean") return extension.configure(defaultOptions);
|
|
11
|
-
const extensionOptions = deepmerge(defaultOptions, options);
|
|
12
|
-
return extension.configure(extensionOptions);
|
|
13
|
-
}
|
|
14
|
-
};
|
|
2
|
+
function defineEditorPreset(extensions) {
|
|
3
|
+
return extensions;
|
|
15
4
|
}
|
|
16
|
-
function
|
|
17
|
-
return
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return configure(value);
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
function flattenEditorExtensionsConfig(extensions) {
|
|
24
|
-
return EDITOR_EXTENSIONS_KEYS.reduce((acc, key) => {
|
|
25
|
-
const value = extensions?.[key];
|
|
26
|
-
if (value === void 0) {
|
|
27
|
-
acc[key] = true;
|
|
28
|
-
return acc;
|
|
29
|
-
}
|
|
30
|
-
acc[key] = typeof value === "boolean" ? value : true;
|
|
31
|
-
return acc;
|
|
5
|
+
function getEditorExtensionState(extensions) {
|
|
6
|
+
return extensions.reduce((state, extension) => {
|
|
7
|
+
state[extension.name] = true;
|
|
8
|
+
return state;
|
|
32
9
|
}, {});
|
|
33
10
|
}
|
|
34
11
|
//#endregion
|
|
35
|
-
export {
|
|
12
|
+
export { defineEditorPreset, getEditorExtensionState };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tulip-systems/editor",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": true,
|
|
6
6
|
"license": "AGPL-3.0",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"@tiptap/core": "^3.29.2",
|
|
9
9
|
"@tiptap/extension-blockquote": "^3.29.2",
|
|
10
10
|
"@tiptap/extension-bold": "^3.29.2",
|
|
11
|
-
"@tiptap/extension-color": "
|
|
11
|
+
"@tiptap/extension-color": "3.29.2",
|
|
12
12
|
"@tiptap/extension-document": "^3.29.2",
|
|
13
13
|
"@tiptap/extension-file-handler": "^3.29.2",
|
|
14
14
|
"@tiptap/extension-hard-break": "^3.29.2",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"@tiptap/extension-paragraph": "^3.29.2",
|
|
23
23
|
"@tiptap/extension-strike": "^3.29.2",
|
|
24
24
|
"@tiptap/extension-text": "^3.29.2",
|
|
25
|
-
"@tiptap/extension-text-style": "
|
|
25
|
+
"@tiptap/extension-text-style": "3.29.2",
|
|
26
26
|
"@tiptap/extension-underline": "^3.29.2",
|
|
27
27
|
"@tiptap/extensions": "^3.29.2",
|
|
28
28
|
"@tiptap/html": "^3.29.2",
|
|
@@ -30,10 +30,9 @@
|
|
|
30
30
|
"@tiptap/react": "^3.29.2",
|
|
31
31
|
"@tiptap/static-renderer": "^3.29.2",
|
|
32
32
|
"class-variance-authority": "^0.7.1",
|
|
33
|
-
"deepmerge": "^4.3.1",
|
|
34
33
|
"lucide-react": "^1.30.0",
|
|
35
34
|
"markdown-it": "^14.3.0",
|
|
36
|
-
"@tulip-systems/ui": "0.12.
|
|
35
|
+
"@tulip-systems/ui": "0.12.3"
|
|
37
36
|
},
|
|
38
37
|
"devDependencies": {
|
|
39
38
|
"@arethetypeswrong/core": "^0.18.5",
|
package/dist/lib/constants.d.mts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { FileHandlerOptions } from "../extensions/file-handler/extension.mjs";
|
|
2
|
-
import { ImageOptions } from "../extensions/image/extension.mjs";
|
|
3
|
-
import "../client.mjs";
|
|
4
|
-
//#region src/lib/constants.d.ts
|
|
5
|
-
declare const EDITOR_EXTENSIONS: {
|
|
6
|
-
blockquote: import("@tiptap/core").Node<import("@tiptap/extension-blockquote").BlockquoteOptions, any>;
|
|
7
|
-
document: import("@tiptap/core").Node<any, any>;
|
|
8
|
-
hardBreak: import("@tiptap/core").Node<import("@tiptap/extension-hard-break").HardBreakOptions, any>;
|
|
9
|
-
heading: import("@tiptap/core").Node<import("@tiptap/extension-heading").HeadingOptions, any>;
|
|
10
|
-
horizontalRule: import("@tiptap/core").Node<import("@tiptap/extension-horizontal-rule").HorizontalRuleOptions, any>;
|
|
11
|
-
listItem: import("@tiptap/core").Node<import("@tiptap/extension-list").ListItemOptions, any>;
|
|
12
|
-
orderedList: import("@tiptap/core").Node<import("@tiptap/extension-list").OrderedListOptions, any>;
|
|
13
|
-
bulletList: import("@tiptap/core").Node<import("@tiptap/extension-list").BulletListOptions, any>;
|
|
14
|
-
paragraph: import("@tiptap/core").Node<import("@tiptap/extension-paragraph").ParagraphOptions, any>;
|
|
15
|
-
text: import("@tiptap/core").Node<any, any>;
|
|
16
|
-
image: import("@tiptap/core").Node<ImageOptions, any>;
|
|
17
|
-
fileHandler: import("@tiptap/core").Extension<FileHandlerOptions, any>;
|
|
18
|
-
skeleton: import("@tiptap/core").Node<any, any>;
|
|
19
|
-
bold: import("@tiptap/core").Mark<import("@tiptap/extension-bold").BoldOptions, any>;
|
|
20
|
-
italic: import("@tiptap/core").Mark<import("@tiptap/extension-italic").ItalicOptions, any>;
|
|
21
|
-
link: import("@tiptap/core").Mark<import("@tiptap/extension-link").LinkOptions, any>;
|
|
22
|
-
strike: import("@tiptap/core").Mark<import("@tiptap/extension-strike").StrikeOptions, any>;
|
|
23
|
-
underline: import("@tiptap/core").Mark<import("@tiptap/extension-underline").UnderlineOptions, any>;
|
|
24
|
-
highlight: import("@tiptap/core").Mark<import("@tiptap/extension-highlight").HighlightOptions, any>;
|
|
25
|
-
dropcursor: import("@tiptap/core").Extension<import("@tiptap/extensions").DropcursorOptions, any>;
|
|
26
|
-
gapcursor: import("@tiptap/core").Extension<any, any>;
|
|
27
|
-
undoRedo: import("@tiptap/core").Extension<import("@tiptap/extensions").UndoRedoOptions, any>;
|
|
28
|
-
listKeymap: import("@tiptap/core").Extension<import("@tiptap/extension-list").ListKeymapOptions, any>;
|
|
29
|
-
trailingNode: import("@tiptap/core").Extension<import("@tiptap/extensions").TrailingNodeOptions, any>;
|
|
30
|
-
textStyle: import("@tiptap/core").Mark<import("@tiptap/extension-text-style").TextStyleOptions, any>;
|
|
31
|
-
color: import("@tiptap/core").Extension<import("@tiptap/extension-text-style").ColorOptions, any>;
|
|
32
|
-
};
|
|
33
|
-
type EditorExtensions = typeof EDITOR_EXTENSIONS;
|
|
34
|
-
//#endregion
|
|
35
|
-
export { EDITOR_EXTENSIONS, EditorExtensions };
|
package/dist/lib/constants.mjs
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { FileHandler } from "../extensions/file-handler/extension.mjs";
|
|
2
|
-
import { Image } from "../extensions/image/extension.mjs";
|
|
3
|
-
import { Skeleton } from "../extensions/skeleton/extension.mjs";
|
|
4
|
-
import { createExtensionConfig } from "./extensions.mjs";
|
|
5
|
-
import Blockquote from "@tiptap/extension-blockquote";
|
|
6
|
-
import Bold from "@tiptap/extension-bold";
|
|
7
|
-
import Document from "@tiptap/extension-document";
|
|
8
|
-
import HardBreak from "@tiptap/extension-hard-break";
|
|
9
|
-
import Heading from "@tiptap/extension-heading";
|
|
10
|
-
import HorizontalRule from "@tiptap/extension-horizontal-rule";
|
|
11
|
-
import Italic from "@tiptap/extension-italic";
|
|
12
|
-
import Link from "@tiptap/extension-link";
|
|
13
|
-
import { BulletList, ListItem, ListKeymap, OrderedList } from "@tiptap/extension-list";
|
|
14
|
-
import Paragraph from "@tiptap/extension-paragraph";
|
|
15
|
-
import Strike from "@tiptap/extension-strike";
|
|
16
|
-
import Text from "@tiptap/extension-text";
|
|
17
|
-
import Underline from "@tiptap/extension-underline";
|
|
18
|
-
import Highlight from "@tiptap/extension-highlight";
|
|
19
|
-
import { Color, TextStyle } from "@tiptap/extension-text-style";
|
|
20
|
-
import { Dropcursor, Gapcursor, TrailingNode, UndoRedo } from "@tiptap/extensions";
|
|
21
|
-
//#region src/lib/constants.ts
|
|
22
|
-
const EDITOR_EXTENSIONS = {
|
|
23
|
-
blockquote: Blockquote,
|
|
24
|
-
document: Document,
|
|
25
|
-
hardBreak: HardBreak,
|
|
26
|
-
heading: Heading,
|
|
27
|
-
horizontalRule: HorizontalRule,
|
|
28
|
-
listItem: ListItem,
|
|
29
|
-
orderedList: OrderedList,
|
|
30
|
-
bulletList: BulletList,
|
|
31
|
-
paragraph: Paragraph,
|
|
32
|
-
text: Text,
|
|
33
|
-
image: Image,
|
|
34
|
-
fileHandler: FileHandler,
|
|
35
|
-
skeleton: Skeleton,
|
|
36
|
-
bold: Bold,
|
|
37
|
-
italic: Italic,
|
|
38
|
-
link: Link,
|
|
39
|
-
strike: Strike,
|
|
40
|
-
underline: Underline,
|
|
41
|
-
highlight: Highlight,
|
|
42
|
-
dropcursor: Dropcursor,
|
|
43
|
-
gapcursor: Gapcursor,
|
|
44
|
-
undoRedo: UndoRedo,
|
|
45
|
-
listKeymap: ListKeymap,
|
|
46
|
-
trailingNode: TrailingNode,
|
|
47
|
-
textStyle: TextStyle,
|
|
48
|
-
color: Color
|
|
49
|
-
};
|
|
50
|
-
const EDITOR_EXTENSIONS_KEYS = Object.keys(EDITOR_EXTENSIONS);
|
|
51
|
-
Object.values(EDITOR_EXTENSIONS);
|
|
52
|
-
const EDITOR_EXTENSIONS_CONFIG = [
|
|
53
|
-
createExtensionConfig("blockquote"),
|
|
54
|
-
createExtensionConfig("document"),
|
|
55
|
-
createExtensionConfig("hardBreak"),
|
|
56
|
-
createExtensionConfig("heading"),
|
|
57
|
-
createExtensionConfig("horizontalRule"),
|
|
58
|
-
createExtensionConfig("listItem"),
|
|
59
|
-
createExtensionConfig("orderedList"),
|
|
60
|
-
createExtensionConfig("bulletList"),
|
|
61
|
-
createExtensionConfig("paragraph"),
|
|
62
|
-
createExtensionConfig("text"),
|
|
63
|
-
createExtensionConfig("image", { resize: {
|
|
64
|
-
enabled: true,
|
|
65
|
-
directions: ["left", "right"],
|
|
66
|
-
minHeight: 50,
|
|
67
|
-
minWidth: 50,
|
|
68
|
-
alwaysPreserveAspectRatio: true
|
|
69
|
-
} }),
|
|
70
|
-
createExtensionConfig("fileHandler"),
|
|
71
|
-
createExtensionConfig("skeleton"),
|
|
72
|
-
createExtensionConfig("bold"),
|
|
73
|
-
createExtensionConfig("italic"),
|
|
74
|
-
createExtensionConfig("link"),
|
|
75
|
-
createExtensionConfig("strike"),
|
|
76
|
-
createExtensionConfig("underline"),
|
|
77
|
-
createExtensionConfig("highlight", { multicolor: true }),
|
|
78
|
-
createExtensionConfig("dropcursor"),
|
|
79
|
-
createExtensionConfig("gapcursor"),
|
|
80
|
-
createExtensionConfig("undoRedo"),
|
|
81
|
-
createExtensionConfig("listKeymap"),
|
|
82
|
-
createExtensionConfig("trailingNode"),
|
|
83
|
-
createExtensionConfig("textStyle"),
|
|
84
|
-
createExtensionConfig("color")
|
|
85
|
-
];
|
|
86
|
-
//#endregion
|
|
87
|
-
export { EDITOR_EXTENSIONS, EDITOR_EXTENSIONS_CONFIG, EDITOR_EXTENSIONS_KEYS };
|