@firecms/editor 3.0.0-canary.160 → 3.0.0-canary.161
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/editor_extensions.d.ts +6 -0
- package/dist/index.es.js +51 -46
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +46 -42
- package/dist/index.umd.js.map +1 -1
- package/package.json +3 -3
@@ -3,4 +3,10 @@ export declare const tiptapLink: import("@tiptap/core").Mark<import("@tiptap/ext
|
|
3
3
|
export declare const taskList: import("@tiptap/core").Node<import("@tiptap/extension-task-list").TaskListOptions, any>;
|
4
4
|
export declare const taskItem: import("@tiptap/core").Node<import("@tiptap/extension-task-item").TaskItemOptions, any>;
|
5
5
|
export declare const horizontalRule: import("@tiptap/core").Node<import("@tiptap/extension-horizontal-rule").HorizontalRuleOptions, any>;
|
6
|
+
export declare const bulletList: import("@tiptap/core").Node<import("@tiptap/extension-bullet-list").BulletListOptions, any>;
|
7
|
+
export declare const orderedList: import("@tiptap/core").Node<import("@tiptap/extension-ordered-list").OrderedListOptions, any>;
|
8
|
+
export declare const listItem: import("@tiptap/core").Node<import("@tiptap/extension-list-item").ListItemOptions, any>;
|
9
|
+
export declare const blockquote: import("@tiptap/core").Node<import("@tiptap/extension-blockquote").BlockquoteOptions, any>;
|
10
|
+
export declare const codeBlock: import("@tiptap/core").Node<import("@tiptap/extension-code-block").CodeBlockOptions, any>;
|
11
|
+
export declare const code: import("@tiptap/core").Mark<import("@tiptap/extension-code").CodeOptions, any>;
|
6
12
|
export declare const starterKit: import("@tiptap/core").Extension<import("@tiptap/starter-kit").StarterKitOptions, any>;
|
package/dist/index.es.js
CHANGED
@@ -1,21 +1,16 @@
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
2
2
|
import React, { forwardRef, useRef, useEffect, useState, useImperativeHandle, useMemo, useDeferredValue } from "react";
|
3
|
-
import { CheckIcon, TextFieldsIcon, LooksOneIcon, LooksTwoIcon, Looks3Icon, CheckBoxIcon, FormatListBulletedIcon, FormatListNumberedIcon, FormatQuoteIcon, CodeIcon,
|
3
|
+
import { CheckIcon, TextFieldsIcon, LooksOneIcon, LooksTwoIcon, Looks3Icon, CheckBoxIcon, FormatListBulletedIcon, FormatListNumberedIcon, FormatQuoteIcon, CodeIcon, KeyboardArrowDownIcon, Button, Popover, cls, focusedDisabled, DeleteIcon, FormatBoldIcon, FormatItalicIcon, FormatUnderlinedIcon, FormatStrikethroughIcon, defaultBorderMixin, AutoFixHighIcon, ImageIcon, useInjectStyles, Separator } from "@firecms/ui";
|
4
4
|
import { useCurrentEditor, BubbleMenu, isNodeSelection, Node, mergeAttributes, ReactRenderer, EditorProvider } from "@tiptap/react";
|
5
5
|
import Document from "@tiptap/extension-document";
|
6
6
|
import { Markdown } from "tiptap-markdown";
|
7
7
|
import Underline from "@tiptap/extension-underline";
|
8
|
-
import OrderedList from "@tiptap/extension-ordered-list";
|
9
|
-
import BulletList from "@tiptap/extension-bullet-list";
|
10
8
|
import Heading from "@tiptap/extension-heading";
|
11
9
|
import TextStyle from "@tiptap/extension-text-style";
|
12
|
-
import BlockQuote from "@tiptap/extension-blockquote";
|
13
|
-
import CodeBlock from "@tiptap/extension-code-block";
|
14
10
|
import Color from "@tiptap/extension-color";
|
15
11
|
import Highlight from "@tiptap/extension-highlight";
|
16
12
|
import Bold from "@tiptap/extension-bold";
|
17
13
|
import Italic from "@tiptap/extension-italic";
|
18
|
-
import Code from "@tiptap/extension-code";
|
19
14
|
import Strike from "@tiptap/extension-strike";
|
20
15
|
import { c } from "react-compiler-runtime";
|
21
16
|
import { Slot } from "@radix-ui/react-slot";
|
@@ -29,6 +24,12 @@ import { TaskList } from "@tiptap/extension-task-list";
|
|
29
24
|
import { Extension, InputRule } from "@tiptap/core";
|
30
25
|
import { PluginKey, Plugin } from "prosemirror-state";
|
31
26
|
import { DecorationSet, Decoration } from "prosemirror-view";
|
27
|
+
import OrderedList from "@tiptap/extension-ordered-list";
|
28
|
+
import BulletList from "@tiptap/extension-bullet-list";
|
29
|
+
import ListItem from "@tiptap/extension-list-item";
|
30
|
+
import CodeBlock from "@tiptap/extension-code-block";
|
31
|
+
import Blockquote from "@tiptap/extension-blockquote";
|
32
|
+
import Code from "@tiptap/extension-code";
|
32
33
|
import { DecorationSet as DecorationSet$1, Decoration as Decoration$1, __serializeForClipboard } from "@tiptap/pm/view";
|
33
34
|
import { PluginKey as PluginKey$1, Plugin as Plugin$1, NodeSelection } from "@tiptap/pm/state";
|
34
35
|
import Suggestion from "@tiptap/suggestion";
|
@@ -309,7 +310,7 @@ const NodeSelector = (t0) => {
|
|
309
310
|
}
|
310
311
|
let t3;
|
311
312
|
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
312
|
-
t3 = /* @__PURE__ */ jsx(
|
313
|
+
t3 = /* @__PURE__ */ jsx(KeyboardArrowDownIcon, { size: "small" });
|
313
314
|
$[4] = t3;
|
314
315
|
} else {
|
315
316
|
t3 = $[4];
|
@@ -704,7 +705,10 @@ const PlaceholderExtension = Placeholder.configure({
|
|
704
705
|
if (node.type.name === "heading") {
|
705
706
|
return `Heading ${node.attrs.level}`;
|
706
707
|
}
|
707
|
-
|
708
|
+
if (node.type.name === "paragraph") {
|
709
|
+
return "Press '/' for commands";
|
710
|
+
}
|
711
|
+
return "";
|
708
712
|
},
|
709
713
|
includeChildren: true
|
710
714
|
});
|
@@ -749,38 +753,38 @@ const horizontalRule = Horizontal.configure({
|
|
749
753
|
class: cls("mt-4 mb-6 border-t", defaultBorderMixin)
|
750
754
|
}
|
751
755
|
});
|
756
|
+
const bulletList = BulletList.configure({
|
757
|
+
HTMLAttributes: {
|
758
|
+
class: cls("list-disc list-outside leading-3 -mt-2")
|
759
|
+
}
|
760
|
+
});
|
761
|
+
const orderedList = OrderedList.configure({
|
762
|
+
HTMLAttributes: {
|
763
|
+
class: cls("list-decimal list-outside leading-3 -mt-2")
|
764
|
+
}
|
765
|
+
});
|
766
|
+
const listItem = ListItem.configure({
|
767
|
+
HTMLAttributes: {
|
768
|
+
class: cls("leading-normal -mb-2")
|
769
|
+
}
|
770
|
+
});
|
771
|
+
const blockquote = Blockquote.configure({
|
772
|
+
HTMLAttributes: {
|
773
|
+
class: cls("border-l-4 border-primary")
|
774
|
+
}
|
775
|
+
});
|
776
|
+
const codeBlock = CodeBlock.configure({
|
777
|
+
HTMLAttributes: {
|
778
|
+
class: cls("rounded bg-blue-50 dark:bg-surface-700 border p-5 font-mono font-medium", defaultBorderMixin)
|
779
|
+
}
|
780
|
+
});
|
781
|
+
const code = Code.configure({
|
782
|
+
HTMLAttributes: {
|
783
|
+
class: cls("rounded-md bg-surface-accent-50 dark:bg-surface-700 px-1.5 py-1 font-mono font-medium"),
|
784
|
+
spellcheck: "false"
|
785
|
+
}
|
786
|
+
});
|
752
787
|
const starterKit = StarterKit.configure({
|
753
|
-
bulletList: {
|
754
|
-
HTMLAttributes: {
|
755
|
-
class: cls("list-disc list-outside leading-3 -mt-2")
|
756
|
-
}
|
757
|
-
},
|
758
|
-
orderedList: {
|
759
|
-
HTMLAttributes: {
|
760
|
-
class: cls("list-decimal list-outside leading-3 -mt-2")
|
761
|
-
}
|
762
|
-
},
|
763
|
-
listItem: {
|
764
|
-
HTMLAttributes: {
|
765
|
-
class: cls("leading-normal -mb-2")
|
766
|
-
}
|
767
|
-
},
|
768
|
-
blockquote: {
|
769
|
-
HTMLAttributes: {
|
770
|
-
class: cls("border-l-4 border-primary")
|
771
|
-
}
|
772
|
-
},
|
773
|
-
codeBlock: {
|
774
|
-
HTMLAttributes: {
|
775
|
-
class: cls("rounded bg-blue-50 dark:bg-surface-700 border p-5 font-mono font-medium", defaultBorderMixin)
|
776
|
-
}
|
777
|
-
},
|
778
|
-
code: {
|
779
|
-
HTMLAttributes: {
|
780
|
-
class: cls("rounded-md bg-surface-accent-50 dark:bg-surface-700 px-1.5 py-1 font-mono font-medium"),
|
781
|
-
spellcheck: "false"
|
782
|
-
}
|
783
|
-
},
|
784
788
|
document: false,
|
785
789
|
horizontalRule: false,
|
786
790
|
dropcursor: {
|
@@ -1397,7 +1401,7 @@ const suggestion = (ref, {
|
|
1397
1401
|
title: "Autocomplete",
|
1398
1402
|
description: "Add text based on the context.",
|
1399
1403
|
searchTerms: ["ai"],
|
1400
|
-
icon: /* @__PURE__ */ jsx(
|
1404
|
+
icon: /* @__PURE__ */ jsx(AutoFixHighIcon, { size: 18 }),
|
1401
1405
|
command: onDisabledAutocompleteClick
|
1402
1406
|
});
|
1403
1407
|
}
|
@@ -1639,7 +1643,7 @@ const autocompleteSuggestionItem = {
|
|
1639
1643
|
title: "Autocomplete",
|
1640
1644
|
description: "Add text based on the context.",
|
1641
1645
|
searchTerms: ["ai"],
|
1642
|
-
icon: /* @__PURE__ */ jsx(
|
1646
|
+
icon: /* @__PURE__ */ jsx(AutoFixHighIcon, { size: 18 }),
|
1643
1647
|
command: async ({
|
1644
1648
|
editor,
|
1645
1649
|
range,
|
@@ -1880,11 +1884,8 @@ const FireCMSEditor = ({
|
|
1880
1884
|
TextLoadingDecorationExtension,
|
1881
1885
|
Underline,
|
1882
1886
|
Bold,
|
1883
|
-
BlockQuote,
|
1884
1887
|
TextStyle,
|
1885
|
-
CodeBlock,
|
1886
1888
|
Italic,
|
1887
|
-
Code,
|
1888
1889
|
Strike,
|
1889
1890
|
Color,
|
1890
1891
|
Highlight.configure({
|
@@ -1895,8 +1896,6 @@ const FireCMSEditor = ({
|
|
1895
1896
|
// delimiter: "```custom"
|
1896
1897
|
// }),
|
1897
1898
|
Heading,
|
1898
|
-
OrderedList,
|
1899
|
-
BulletList,
|
1900
1899
|
CustomKeymap,
|
1901
1900
|
DragAndDrop,
|
1902
1901
|
placeholder,
|
@@ -1908,6 +1907,12 @@ const FireCMSEditor = ({
|
|
1908
1907
|
html: true
|
1909
1908
|
}),
|
1910
1909
|
horizontalRule,
|
1910
|
+
bulletList,
|
1911
|
+
orderedList,
|
1912
|
+
listItem,
|
1913
|
+
blockquote,
|
1914
|
+
codeBlock,
|
1915
|
+
code,
|
1911
1916
|
SlashCommand.configure({
|
1912
1917
|
HTMLAttributes: {
|
1913
1918
|
class: "mention"
|