reactjs-tiptap-editor 1.0.18 → 1.0.19
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/lib/{ActionMenuButton-BOjCHFTA.js → ActionMenuButton-B1Nfn5Hm.js} +1 -1
- package/lib/{ActionMenuButton-Df077oOH.cjs → ActionMenuButton-D3b_bcin.cjs} +1 -1
- package/lib/Attachment.cjs +1 -1
- package/lib/Attachment.js +23 -23
- package/lib/Blockquote.cjs +3 -3
- package/lib/Blockquote.js +33 -28
- package/lib/Bold.cjs +1 -1
- package/lib/Bold.js +16 -10
- package/lib/BulletList.cjs +1 -1
- package/lib/BulletList.js +2 -2
- package/lib/Callout.cjs +1 -1
- package/lib/Callout.js +21 -22
- package/lib/Clear.cjs +1 -1
- package/lib/Clear.js +2 -2
- package/lib/Code.cjs +1 -1
- package/lib/Code.js +2 -2
- package/lib/CodeBlock.cjs +37 -37
- package/lib/CodeBlock.js +15 -16
- package/lib/CodeView.cjs +1 -1
- package/lib/CodeView.js +2 -2
- package/lib/Color.cjs +1 -1
- package/lib/Color.js +3 -3
- package/lib/Column.cjs +1 -1
- package/lib/Column.js +2 -2
- package/lib/{Drawer-DxOoRiGQ.js → Drawer-B1-7Y4HB.js} +3 -3
- package/lib/{Drawer-DwrlY_lY.cjs → Drawer-kEO7KzzC.cjs} +1 -1
- package/lib/Drawer.cjs +1 -1
- package/lib/Drawer.js +4 -4
- package/lib/Emoji.cjs +1 -1
- package/lib/Emoji.js +12 -12
- package/lib/Excalidraw.cjs +1 -1
- package/lib/Excalidraw.js +17 -17
- package/lib/ExportPdf.cjs +1 -1
- package/lib/ExportPdf.js +2 -2
- package/lib/ExportWord.cjs +1 -1
- package/lib/ExportWord.js +2 -2
- package/lib/FontFamily.cjs +1 -1
- package/lib/FontFamily.js +4 -4
- package/lib/FontSize.cjs +1 -1
- package/lib/FontSize.js +4 -4
- package/lib/Heading.cjs +1 -1
- package/lib/Heading.js +9 -9
- package/lib/Highlight.cjs +1 -1
- package/lib/Highlight.js +3 -3
- package/lib/History.cjs +1 -1
- package/lib/History.js +5 -3
- package/lib/HorizontalRule.cjs +1 -1
- package/lib/HorizontalRule.js +2 -2
- package/lib/{Iframe-C6pBw-AF.cjs → Iframe-Bk5OIlvy.cjs} +1 -1
- package/lib/{Iframe-AhNV5WH5.js → Iframe-XlAb03_r.js} +7 -7
- package/lib/Iframe.cjs +1 -1
- package/lib/Iframe.js +3 -3
- package/lib/Image.cjs +1 -1
- package/lib/Image.js +6 -5
- package/lib/ImageGif.cjs +1 -1
- package/lib/ImageGif.js +36 -36
- package/lib/ImportWord.cjs +1 -1
- package/lib/ImportWord.js +13 -13
- package/lib/{Indent-Do-X0AsY.cjs → Indent-XaZNTsOk.cjs} +1 -1
- package/lib/{Indent-DZ5PcJA4.js → Indent-ruPuj5xn.js} +2 -2
- package/lib/Indent.cjs +1 -1
- package/lib/Indent.js +2 -2
- package/lib/Italic.cjs +1 -1
- package/lib/Italic.js +24 -18
- package/lib/Katex-BFIYLrwm.cjs +4 -0
- package/lib/{Katex-bIgoenn_.js → Katex-DKspCn-p.js} +5 -6
- package/lib/Katex.cjs +1 -1
- package/lib/Katex.js +3 -3
- package/lib/LineHeight.cjs +1 -1
- package/lib/LineHeight.js +3 -3
- package/lib/Link.cjs +1 -1
- package/lib/Link.js +2 -2
- package/lib/{LinkEditBlock-D_cF9fnc.js → LinkEditBlock-BWm2Ypt2.js} +26 -26
- package/lib/{LinkEditBlock-B0ZaACZO.cjs → LinkEditBlock-DhesHreq.cjs} +1 -1
- package/lib/MarkdownPaste.cjs +1 -1
- package/lib/MarkdownPaste.js +1 -1
- package/lib/Mention.cjs +1 -1
- package/lib/Mention.js +4 -4
- package/lib/Mermaid.cjs +2 -2
- package/lib/Mermaid.js +41 -42
- package/lib/MoreMark.cjs +1 -1
- package/lib/MoreMark.js +5 -5
- package/lib/OrderedList.cjs +1 -1
- package/lib/OrderedList.js +2 -2
- package/lib/SearchAndReplace.cjs +1 -1
- package/lib/SearchAndReplace.js +8 -8
- package/lib/SlashCommand.cjs +1 -1
- package/lib/SlashCommand.js +6 -6
- package/lib/{SlashCommandNodeView-Ba03hlVZ.cjs → SlashCommandNodeView-CojfS61Q.cjs} +1 -1
- package/lib/{SlashCommandNodeView-cg0x3NRF.js → SlashCommandNodeView-Hf2DX4km.js} +6 -6
- package/lib/Strike.cjs +1 -1
- package/lib/Strike.js +2 -2
- package/lib/{Table-KqLiT5wG.js → Table-BTkFUATL.js} +4 -4
- package/lib/{Table-ddU2LSc6.cjs → Table-C1_xLqV0.cjs} +1 -1
- package/lib/Table.cjs +1 -1
- package/lib/Table.js +1 -1
- package/lib/TaskList.cjs +1 -1
- package/lib/TaskList.js +2 -2
- package/lib/TextAlign.cjs +1 -1
- package/lib/TextAlign.js +3 -3
- package/lib/TextDirection.cjs +1 -1
- package/lib/TextDirection.js +3 -3
- package/lib/TextUnderline.cjs +1 -1
- package/lib/TextUnderline.js +2 -2
- package/lib/{Twitter-BIiR78Jh.cjs → Twitter-Cj-0yyQQ.cjs} +1 -1
- package/lib/{Twitter-C1Lzqc7u.js → Twitter-D5mUTILj.js} +9 -9
- package/lib/Twitter.cjs +1 -1
- package/lib/Twitter.js +3 -3
- package/lib/Video.cjs +1 -1
- package/lib/Video.js +4 -4
- package/lib/bubble.cjs +6 -6
- package/lib/bubble.js +1835 -1634
- package/lib/{clsx-BWE7vnna.cjs → clsx-BSBE1eoY.cjs} +1 -1
- package/lib/{clsx-eGVyq7ot.js → clsx-OumA9x-8.js} +1 -1
- package/lib/{dropdown-menu-CexIkt_V.js → dropdown-menu-Bragdu5m.js} +1 -1
- package/lib/{dropdown-menu-oSKIntXM.cjs → dropdown-menu-CUeq1boX.cjs} +1 -1
- package/lib/extensions/Image/Image.d.ts +1 -0
- package/lib/{index-D_8P0LE5.js → index-B-7eHzaO.js} +1 -1
- package/lib/{index-RIXs7STX.js → index-BKlbc8Qo.js} +1 -1
- package/lib/index-BLrMslr7.cjs +1 -0
- package/lib/{index-mfGK4pFo.js → index-BVRHx_ha.js} +94 -90
- package/lib/{index-DHUN85fV.js → index-CDFAs4RT.js} +1149 -1019
- package/lib/{index-CJ9pyCM4.cjs → index-CMLwKzI0.cjs} +1 -1
- package/lib/index-COCTP78Y.cjs +12 -0
- package/lib/{index-BnW6t8z6.js → index-CZ1_8JQQ.js} +1 -1
- package/lib/{index-D0lc95kr.cjs → index-CnePcUeF.cjs} +1 -1
- package/lib/{index-DUpSE1Gb.cjs → index-D7wfvzJg.cjs} +1 -1
- package/lib/{index-zig3Dj7A.cjs → index-DwSnESy-.cjs} +7 -5
- package/lib/{index-C6xmkxrQ.js → index-cPEuL4Zr.js} +140 -138
- package/lib/index.cjs +1 -1
- package/lib/index.js +12 -12
- package/lib/{popover-BYSZ3zBi.js → popover-C2BbhsXH.js} +1 -1
- package/lib/{popover-BcHDZqBt.cjs → popover-DCJpsZx0.cjs} +1 -1
- package/lib/{renderNodeView-BrM5kUj_.js → renderNodeView-CmnUEfby.js} +2 -2
- package/lib/{renderNodeView-D1zydtli.cjs → renderNodeView-DQjWzXDA.cjs} +1 -1
- package/lib/{separator-BmixLrnJ.cjs → separator-BuG1zwKa.cjs} +1 -1
- package/lib/{separator-CFKVxAea.js → separator-lkMWuUvf.js} +14 -14
- package/lib/{updatePosition-CfmY5Trk.cjs → updatePosition-D6AScA-1.cjs} +1 -1
- package/lib/{updatePosition-CBRjbQMH.js → updatePosition-DYuAiqx-.js} +2 -2
- package/package.json +1 -1
- package/lib/Katex-CIC9ygbL.cjs +0 -4
- package/lib/index-BUTn2LY6.cjs +0 -1
- package/lib/index-BtxvYLJ1.cjs +0 -12
- package/lib/select-C5SHDLFj.js +0 -120
- package/lib/select-DHjzKkcu.cjs +0 -1
- package/lib/textarea-CasDcv3u.cjs +0 -1
- package/lib/textarea-DNLrJoRl.js +0 -20
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as c, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { Slot as n } from "@radix-ui/react-slot";
|
|
3
3
|
import r from "react";
|
|
4
|
-
import { i as d, T as m, a as f, B as s, b as u, g } from "./index-
|
|
4
|
+
import { i as d, T as m, a as f, B as s, b as u, g } from "./index-CDFAs4RT.js";
|
|
5
5
|
import "./theme.js";
|
|
6
6
|
const C = r.forwardRef(
|
|
7
7
|
({ asChild: x = !1, tooltip: i, ...t }, l) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),a=require("@radix-ui/react-slot"),d=require("react"),i=require("./index-
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),a=require("@radix-ui/react-slot"),d=require("react"),i=require("./index-BLrMslr7.cjs");require("./theme.cjs");const s=d.forwardRef(({asChild:h=!1,tooltip:c,...t},l)=>{var n;const x=i.icons[t.icon],r=h?a.Slot:i.Button;return e.jsxs(i.Tooltip,{children:[e.jsx(i.TooltipTrigger,{asChild:!0,children:e.jsx(r,{className:"richtext-h-[32px] richtext-min-w-24 richtext-overflow-hidden richtext-px-[5px] richtext-py-0","data-state":t!=null&&t.dataState?"on":"off",disabled:t==null?void 0:t.disabled,ref:l,variant:"ghost",...t,children:e.jsxs("div",{className:"richtext-flex richtext-h-full richtext-items-center richtext-font-normal",children:[(t==null?void 0:t.title)&&e.jsx("div",{className:"richtext-grow richtext-truncate richtext-text-left richtext-text-sm",children:t==null?void 0:t.title}),x&&e.jsx(x,{className:"richtext-ml-1 richtext-size-3 richtext-shrink-0 richtext-text-zinc-500"})]})})}),c&&e.jsx(i.TooltipContent,{children:e.jsxs("div",{className:"richtext-flex richtext-max-w-24 richtext-flex-col richtext-items-center richtext-text-center",children:[c&&e.jsx("div",{children:c}),e.jsx("div",{className:"richtext-flex",children:!!((n=t==null?void 0:t.shortcutKeys)!=null&&n.length)&&e.jsx("span",{children:i.getShortcutKeys(t==null?void 0:t.shortcutKeys)})})]})})]})});exports.ActionMenuButton=s;
|
package/lib/Attachment.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./index-DwSnESy-.cjs"),u=require("./clsx-BSBE1eoY.cjs"),s=require("./index-BLrMslr7.cjs"),e=require("react/jsx-runtime"),v=require("react");require("./theme.cjs");const x=require("lucide-react"),S=require("./index-BqL4vAWE.cjs"),d=require("./dom-dataset-BqoJhJXt.cjs"),B={audio:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-audio-lines"><path d="M2 10v3"/><path d="M6 6v11"/><path d="M10 3v18"/><path d="M14 8v7"/><path d="M18 5v13"/><path d="M22 10v3"/></svg>',video:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-video"><path d="m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5"/><rect x="2" y="6" width="14" height="12" rx="2"/></svg>',file:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-file"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/></svg>',image:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-image"><rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"/></svg>',pdf:`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 32 32">
|
|
2
2
|
<path fill="currentColor" d="M30 18v-2h-6v10h2v-4h3v-2h-3v-2zm-11 8h-4V16h4a3.003 3.003 0 0 1 3 3v4a3.003 3.003 0 0 1-3 3m-2-2h2a1 1 0 0 0 1-1v-4a1 1 0 0 0-1-1h-2zm-6-8H6v10h2v-3h3a2.003 2.003 0 0 0 2-2v-3a2 2 0 0 0-2-2m-3 5v-3h3l.001 3z"></path>
|
|
3
3
|
<path fill="currentColor" d="M22 14v-4a.91.91 0 0 0-.3-.7l-7-7A.9.9 0 0 0 14 2H4a2.006 2.006 0 0 0-2 2v24a2 2 0 0 0 2 2h16v-2H4V4h8v6a2.006 2.006 0 0 0 2 2h6v2Zm-8-4V4.4l5.6 5.6Z"></path>
|
|
4
4
|
</svg>`,word:`<svg
|
package/lib/Attachment.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { N as j, m as
|
|
2
|
-
import { N as x, c as y, a as
|
|
3
|
-
import {
|
|
1
|
+
import { N as j, m as D } from "./index-BVRHx_ha.js";
|
|
2
|
+
import { N as x, c as y, a as P } from "./clsx-OumA9x-8.js";
|
|
3
|
+
import { Y as $, Z as R, _ as I, M as Z, $ as O, a0 as W, a1 as N, A as T, u as K, d as Y } from "./index-CDFAs4RT.js";
|
|
4
4
|
import { jsx as e, Fragment as L, jsxs as f } from "react/jsx-runtime";
|
|
5
|
-
import { useRef as
|
|
5
|
+
import { useRef as q, useState as G, useCallback as k, useEffect as J } from "react";
|
|
6
6
|
import "./theme.js";
|
|
7
|
-
import { LucideTableProperties as
|
|
7
|
+
import { LucideTableProperties as Q, LucideSheet as U, LucideImage as X, LucideFile as ee, LucideVideo as te, LucideAudioLines as re } from "lucide-react";
|
|
8
8
|
import { u as ie } from "./index-BlXGgvT-.js";
|
|
9
9
|
import { g as c } from "./dom-dataset-CIEeltF6.js";
|
|
10
10
|
const oe = {
|
|
@@ -56,14 +56,14 @@ const ae = {
|
|
|
56
56
|
audio: /* @__PURE__ */ e(re, {}),
|
|
57
57
|
video: /* @__PURE__ */ e(te, {}),
|
|
58
58
|
file: /* @__PURE__ */ e(ee, {}),
|
|
59
|
-
image: /* @__PURE__ */ e(
|
|
59
|
+
image: /* @__PURE__ */ e(X, {}),
|
|
60
60
|
pdf: /* @__PURE__ */ e(I, {}),
|
|
61
|
-
word: /* @__PURE__ */ e(
|
|
62
|
-
excel: /* @__PURE__ */ e(
|
|
63
|
-
ppt: /* @__PURE__ */ e(
|
|
61
|
+
word: /* @__PURE__ */ e(R, {}),
|
|
62
|
+
excel: /* @__PURE__ */ e(U, {}),
|
|
63
|
+
ppt: /* @__PURE__ */ e(Q, {})
|
|
64
64
|
};
|
|
65
65
|
function b(t, o = !1) {
|
|
66
|
-
const r =
|
|
66
|
+
const r = $(t), l = ae[r] || /* @__PURE__ */ e(L, {});
|
|
67
67
|
return o ? ne(r) : l;
|
|
68
68
|
}
|
|
69
69
|
const se = "_wrap_15oj2_2", M = {
|
|
@@ -71,22 +71,22 @@ const se = "_wrap_15oj2_2", M = {
|
|
|
71
71
|
};
|
|
72
72
|
function le({ editor: t, node: o, updateAttributes: r, deleteNode: l, extension: s }) {
|
|
73
73
|
var A;
|
|
74
|
-
const n =
|
|
74
|
+
const n = q(null), i = Z(), { hasTrigger: a, fileName: d, fileSize: h, fileExt: z, fileType: E, url: u, error: H } = o.attrs, [F, v] = G(!1), { t: w } = ie(), V = (A = s == null ? void 0 : s.options) == null ? void 0 : A.upload, m = k(() => {
|
|
75
75
|
!i || u || n.current.click();
|
|
76
|
-
}, [u, i]),
|
|
76
|
+
}, [u, i]), _ = k(
|
|
77
77
|
async (C) => {
|
|
78
78
|
const p = C.target.files && C.target.files[0];
|
|
79
79
|
if (!p) return;
|
|
80
|
-
const
|
|
81
|
-
fileName:
|
|
80
|
+
const S = {
|
|
81
|
+
fileName: W(p.name),
|
|
82
82
|
fileSize: p.size,
|
|
83
83
|
fileType: p.type,
|
|
84
|
-
fileExt:
|
|
84
|
+
fileExt: O(p.name)
|
|
85
85
|
};
|
|
86
86
|
v(!0);
|
|
87
87
|
try {
|
|
88
88
|
const g = await V(p);
|
|
89
|
-
r({ ...
|
|
89
|
+
r({ ...S, url: g }), v(!1);
|
|
90
90
|
} catch (g) {
|
|
91
91
|
r({
|
|
92
92
|
error: `File upload fail: ${g && g.message}`
|
|
@@ -95,13 +95,13 @@ function le({ editor: t, node: o, updateAttributes: r, deleteNode: l, extension:
|
|
|
95
95
|
},
|
|
96
96
|
[v, r]
|
|
97
97
|
);
|
|
98
|
-
|
|
98
|
+
J(() => {
|
|
99
99
|
!u && !a && (m(), r({ hasTrigger: !0 }));
|
|
100
100
|
}, [u, a, m, r]);
|
|
101
|
-
const
|
|
101
|
+
const B = k(() => l(), [t]);
|
|
102
102
|
return i && !u ? /* @__PURE__ */ e(x, { children: /* @__PURE__ */ f("div", { className: y(M.wrap, "render-wrapper"), children: [
|
|
103
103
|
/* @__PURE__ */ e("p", { onClick: m, style: { cursor: "pointer" }, children: F ? /* @__PURE__ */ e("span", { children: w("editor.attachment.uploading") }) : /* @__PURE__ */ e("span", { children: w("editor.attachment.please_upload") }) }),
|
|
104
|
-
/* @__PURE__ */ e("input", { hidden: !0, onChange:
|
|
104
|
+
/* @__PURE__ */ e("input", { hidden: !0, onChange: _, ref: n, type: "file" })
|
|
105
105
|
] }) }) : u ? /* @__PURE__ */ e(x, { children: /* @__PURE__ */ f("div", { className: y(M.wrap, "render-wrapper"), onClick: m, children: [
|
|
106
106
|
/* @__PURE__ */ f("div", { className: "richtext-flex richtext-items-center richtext-gap-[4px]", children: [
|
|
107
107
|
/* @__PURE__ */ e("span", { children: b(E) }),
|
|
@@ -116,7 +116,7 @@ function le({ editor: t, node: o, updateAttributes: r, deleteNode: l, extension:
|
|
|
116
116
|
")"
|
|
117
117
|
] })
|
|
118
118
|
] }),
|
|
119
|
-
/* @__PURE__ */ e(T, { action:
|
|
119
|
+
/* @__PURE__ */ e(T, { action: B, icon: "Trash2", tooltip: w("editor.delete") })
|
|
120
120
|
] }) }) : H !== "null" ? /* @__PURE__ */ e(x, { children: /* @__PURE__ */ e("div", { className: y(M.wrap, "render-wrapper"), onClick: m, children: /* @__PURE__ */ e("p", { children: H }) }) }) : /* @__PURE__ */ e(L, {});
|
|
121
121
|
}
|
|
122
122
|
function xe() {
|
|
@@ -127,7 +127,7 @@ function xe() {
|
|
|
127
127
|
tooltipOptions: s = {},
|
|
128
128
|
action: n = void 0,
|
|
129
129
|
isActive: i = void 0
|
|
130
|
-
} = (t == null ? void 0 : t.componentProps) ?? {}, { editorDisabled: a, update: d } =
|
|
130
|
+
} = (t == null ? void 0 : t.componentProps) ?? {}, { editorDisabled: a, update: d } = Y(i), h = () => {
|
|
131
131
|
a || n && (n(), d());
|
|
132
132
|
};
|
|
133
133
|
return t ? /* @__PURE__ */ e(
|
|
@@ -183,7 +183,7 @@ const ce = /* @__PURE__ */ j.create({
|
|
|
183
183
|
} = t || {};
|
|
184
184
|
return [
|
|
185
185
|
"div",
|
|
186
|
-
|
|
186
|
+
D(
|
|
187
187
|
// @ts-expect-error
|
|
188
188
|
this.options.HTMLAttributes || {},
|
|
189
189
|
t || {}
|
|
@@ -238,7 +238,7 @@ const ce = /* @__PURE__ */ j.create({
|
|
|
238
238
|
};
|
|
239
239
|
},
|
|
240
240
|
addNodeView() {
|
|
241
|
-
return
|
|
241
|
+
return P(le);
|
|
242
242
|
}
|
|
243
243
|
});
|
|
244
244
|
export {
|
package/lib/Blockquote.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
-
`).map(
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-DwSnESy-.cjs"),h=require("./jsx-runtime-C_NLcKys.cjs"),d=require("react/jsx-runtime"),p=require("./index-BLrMslr7.cjs");require("react");require("./theme.cjs");var m=/^\s*>\s$/,b=a.Node3.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return h.h("blockquote",{...a.mergeAttributes(this.options.HTMLAttributes,t),children:h.h("slot",{})})},parseMarkdown:(t,e)=>{var o;const n=(o=e.parseBlockChildren)!=null?o:e.parseChildren;return e.createNode("blockquote",void 0,n(t.tokens||[]))},renderMarkdown:(t,e)=>{if(!t.content)return"";const o=">",n=[];return t.content.forEach((r,i)=>{var s,u;const l=((u=(s=e.renderChild)==null?void 0:s.call(e,r,i))!=null?u:e.renderChildren([r])).split(`
|
|
2
|
+
`).map(q=>q.trim()===""?o:`${o} ${q}`);n.push(l.join(`
|
|
3
3
|
`))}),n.join(`
|
|
4
4
|
${o}
|
|
5
|
-
`)},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[
|
|
5
|
+
`)},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[a.wrappingInputRule({find:m,type:this.type})]}});function v(){const t=p.useButtonProps(g.name),{icon:e=void 0,tooltip:o=void 0,shortcutKeys:n=void 0,tooltipOptions:r={},action:i=void 0,isActive:s=void 0}=(t==null?void 0:t.componentProps)??{},{dataState:u,disabled:c,update:k}=p.useToggleActive(s),l=()=>{c||i&&(i(),k())};return t?d.jsx(p.ActionButton,{action:l,dataState:u,disabled:c,icon:e,shortcutKeys:n,tooltip:o,tooltipOptions:r}):d.jsx(d.Fragment,{})}const g=b.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),HTMLAttributes:{class:"blockquote"},button:({editor:e,t:o,extension:n})=>({componentProps:{action:()=>e.commands.toggleBlockquote(),isActive:()=>e.isActive("blockquote"),disabled:!e.can().toggleBlockquote(),icon:"TextQuote",shortcutKeys:n.options.shortcutKeys??["shift","mod","B"],tooltip:o("editor.blockquote.tooltip")}})}}});exports.Blockquote=g;exports.RichTextBlockquote=v;
|
package/lib/Blockquote.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { N as
|
|
2
|
-
import { h as
|
|
3
|
-
import { jsx as
|
|
4
|
-
import { u as f, d as
|
|
1
|
+
import { N as k, w as h, m as g } from "./index-BVRHx_ha.js";
|
|
2
|
+
import { h as p } from "./jsx-runtime-CT7Pcg-t.js";
|
|
3
|
+
import { jsx as m, Fragment as b } from "react/jsx-runtime";
|
|
4
|
+
import { u as f, d as q, A as v } from "./index-CDFAs4RT.js";
|
|
5
5
|
import "react";
|
|
6
6
|
import "./theme.js";
|
|
7
|
-
var
|
|
7
|
+
var B = /^\s*>\s$/, A = k.create({
|
|
8
8
|
name: "blockquote",
|
|
9
9
|
addOptions() {
|
|
10
10
|
return {
|
|
@@ -18,17 +18,22 @@ var v = /^\s*>\s$/, B = m.create({
|
|
|
18
18
|
return [{ tag: "blockquote" }];
|
|
19
19
|
},
|
|
20
20
|
renderHTML({ HTMLAttributes: t }) {
|
|
21
|
-
return /* @__PURE__ */
|
|
21
|
+
return /* @__PURE__ */ p("blockquote", { ...g(this.options.HTMLAttributes, t), children: /* @__PURE__ */ p("slot", {}) });
|
|
22
|
+
},
|
|
23
|
+
parseMarkdown: (t, o) => {
|
|
24
|
+
var e;
|
|
25
|
+
const n = (e = o.parseBlockChildren) != null ? e : o.parseChildren;
|
|
26
|
+
return o.createNode("blockquote", void 0, n(t.tokens || []));
|
|
22
27
|
},
|
|
23
|
-
parseMarkdown: (t, o) => o.createNode("blockquote", void 0, o.parseChildren(t.tokens || [])),
|
|
24
28
|
renderMarkdown: (t, o) => {
|
|
25
29
|
if (!t.content)
|
|
26
30
|
return "";
|
|
27
31
|
const e = ">", n = [];
|
|
28
|
-
return t.content.forEach((i) => {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
+
return t.content.forEach((r, i) => {
|
|
33
|
+
var s, c;
|
|
34
|
+
const a = ((c = (s = o.renderChild) == null ? void 0 : s.call(o, r, i)) != null ? c : o.renderChildren([r])).split(`
|
|
35
|
+
`).map((d) => d.trim() === "" ? e : `${e} ${d}`);
|
|
36
|
+
n.push(a.join(`
|
|
32
37
|
`));
|
|
33
38
|
}), n.join(`
|
|
34
39
|
${e}
|
|
@@ -49,37 +54,37 @@ ${e}
|
|
|
49
54
|
addInputRules() {
|
|
50
55
|
return [
|
|
51
56
|
h({
|
|
52
|
-
find:
|
|
57
|
+
find: B,
|
|
53
58
|
type: this.type
|
|
54
59
|
})
|
|
55
60
|
];
|
|
56
61
|
}
|
|
57
62
|
});
|
|
58
|
-
function
|
|
59
|
-
const t = f(
|
|
63
|
+
function L() {
|
|
64
|
+
const t = f(x.name), {
|
|
60
65
|
icon: o = void 0,
|
|
61
66
|
tooltip: e = void 0,
|
|
62
67
|
shortcutKeys: n = void 0,
|
|
63
|
-
tooltipOptions:
|
|
64
|
-
action:
|
|
65
|
-
isActive:
|
|
66
|
-
} = (t == null ? void 0 : t.componentProps) ?? {}, { dataState: c, disabled:
|
|
67
|
-
|
|
68
|
+
tooltipOptions: r = {},
|
|
69
|
+
action: i = void 0,
|
|
70
|
+
isActive: s = void 0
|
|
71
|
+
} = (t == null ? void 0 : t.componentProps) ?? {}, { dataState: c, disabled: u, update: l } = q(s), a = () => {
|
|
72
|
+
u || i && (i(), l());
|
|
68
73
|
};
|
|
69
|
-
return t ? /* @__PURE__ */
|
|
70
|
-
|
|
74
|
+
return t ? /* @__PURE__ */ m(
|
|
75
|
+
v,
|
|
71
76
|
{
|
|
72
|
-
action:
|
|
77
|
+
action: a,
|
|
73
78
|
dataState: c,
|
|
74
|
-
disabled:
|
|
79
|
+
disabled: u,
|
|
75
80
|
icon: o,
|
|
76
81
|
shortcutKeys: n,
|
|
77
82
|
tooltip: e,
|
|
78
|
-
tooltipOptions:
|
|
83
|
+
tooltipOptions: r
|
|
79
84
|
}
|
|
80
|
-
) : /* @__PURE__ */
|
|
85
|
+
) : /* @__PURE__ */ m(b, {});
|
|
81
86
|
}
|
|
82
|
-
const
|
|
87
|
+
const x = /* @__PURE__ */ A.extend({
|
|
83
88
|
//@ts-expect-error
|
|
84
89
|
addOptions() {
|
|
85
90
|
var t;
|
|
@@ -102,6 +107,6 @@ const A = /* @__PURE__ */ B.extend({
|
|
|
102
107
|
}
|
|
103
108
|
});
|
|
104
109
|
export {
|
|
105
|
-
|
|
106
|
-
|
|
110
|
+
x as Blockquote,
|
|
111
|
+
L as RichTextBlockquote
|
|
107
112
|
};
|
package/lib/Bold.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-DwSnESy-.cjs"),u=require("./jsx-runtime-C_NLcKys.cjs"),n=require("./index-BLrMslr7.cjs"),i=require("react/jsx-runtime");require("react");require("./theme.cjs");var y=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,_=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,B=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,k=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,v=o.Mark.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return u.h("strong",{...o.mergeAttributes(this.options.HTMLAttributes,t),children:u.h("slot",{})})},markdownTokenName:"strong",parseMarkdown:(t,e)=>e.applyMark("bold",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"<strong>",close:"</strong>"}},renderMarkdown:(t,e)=>`**${e.renderChildren(t)}**`,addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[o.markInputRule({find:y,type:this.type}),o.markInputRule({find:B,type:this.type})]},addPasteRules(){return[o.markPasteRule({find:_,type:this.type}),o.markPasteRule({find:k,type:this.type})]}});function M(){const t=n.useButtonProps(l.name),{icon:e=void 0,tooltip:r=void 0,shortcutKeys:s=void 0,tooltipOptions:c={},action:d=void 0,isActive:p=void 0}=(t==null?void 0:t.componentProps)??{},{dataState:g,disabled:a,update:m}=n.useToggleActive(p),h=()=>{a||d&&(d(),m())};return t?i.jsx(n.ActionButton,{action:h,dataState:g,disabled:a,icon:e,shortcutKeys:s,tooltip:r,tooltipOptions:c}):i.jsx(i.Fragment,{})}const l=v.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,t:r,extension:s})=>({component:n.ActionButton,componentProps:{action:()=>e.commands.toggleBold(),isActive:()=>e.isActive("bold"),icon:"Bold",shortcutKeys:s.options.shortcutKeys??["mod","B"],tooltip:r("editor.bold.tooltip")}})}}});exports.Bold=l;exports.RichTextBold=M;
|
package/lib/Bold.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { M as _, f as a, h as i, m as y } from "./index-
|
|
1
|
+
import { M as _, f as a, h as i, m as y } from "./index-BVRHx_ha.js";
|
|
2
2
|
import { h as d } from "./jsx-runtime-CT7Pcg-t.js";
|
|
3
|
-
import { u as f, d as M, A as
|
|
4
|
-
import { jsx as
|
|
3
|
+
import { u as f, d as M, A as u } from "./index-CDFAs4RT.js";
|
|
4
|
+
import { jsx as l, Fragment as k } from "react/jsx-runtime";
|
|
5
5
|
import "react";
|
|
6
6
|
import "./theme.js";
|
|
7
|
-
var
|
|
7
|
+
var v = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, B = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g, b = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/, A = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g, R = _.create({
|
|
8
8
|
name: "bold",
|
|
9
9
|
addOptions() {
|
|
10
10
|
return {
|
|
@@ -35,6 +35,12 @@ var B = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, k = /(?:^|\s)(\*
|
|
|
35
35
|
},
|
|
36
36
|
markdownTokenName: "strong",
|
|
37
37
|
parseMarkdown: (t, e) => e.applyMark("bold", e.parseInline(t.tokens || [])),
|
|
38
|
+
markdownOptions: {
|
|
39
|
+
htmlReopen: {
|
|
40
|
+
open: "<strong>",
|
|
41
|
+
close: "</strong>"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
38
44
|
renderMarkdown: (t, e) => `**${e.renderChildren(t)}**`,
|
|
39
45
|
addCommands() {
|
|
40
46
|
return {
|
|
@@ -52,7 +58,7 @@ var B = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, k = /(?:^|\s)(\*
|
|
|
52
58
|
addInputRules() {
|
|
53
59
|
return [
|
|
54
60
|
i({
|
|
55
|
-
find:
|
|
61
|
+
find: v,
|
|
56
62
|
type: this.type
|
|
57
63
|
}),
|
|
58
64
|
i({
|
|
@@ -64,7 +70,7 @@ var B = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, k = /(?:^|\s)(\*
|
|
|
64
70
|
addPasteRules() {
|
|
65
71
|
return [
|
|
66
72
|
a({
|
|
67
|
-
find:
|
|
73
|
+
find: B,
|
|
68
74
|
type: this.type
|
|
69
75
|
}),
|
|
70
76
|
a({
|
|
@@ -85,8 +91,8 @@ function K() {
|
|
|
85
91
|
} = (t == null ? void 0 : t.componentProps) ?? {}, { dataState: c, disabled: s, update: g } = M(m), h = () => {
|
|
86
92
|
s || n && (n(), g());
|
|
87
93
|
};
|
|
88
|
-
return t ? /* @__PURE__ */
|
|
89
|
-
|
|
94
|
+
return t ? /* @__PURE__ */ l(
|
|
95
|
+
u,
|
|
90
96
|
{
|
|
91
97
|
action: h,
|
|
92
98
|
dataState: c,
|
|
@@ -96,7 +102,7 @@ function K() {
|
|
|
96
102
|
tooltip: o,
|
|
97
103
|
tooltipOptions: p
|
|
98
104
|
}
|
|
99
|
-
) : /* @__PURE__ */
|
|
105
|
+
) : /* @__PURE__ */ l(k, {});
|
|
100
106
|
}
|
|
101
107
|
const x = /* @__PURE__ */ R.extend({
|
|
102
108
|
//@ts-expect-error
|
|
@@ -105,7 +111,7 @@ const x = /* @__PURE__ */ R.extend({
|
|
|
105
111
|
return {
|
|
106
112
|
...(t = this.parent) == null ? void 0 : t.call(this),
|
|
107
113
|
button: ({ editor: e, t: o, extension: r }) => ({
|
|
108
|
-
component:
|
|
114
|
+
component: u,
|
|
109
115
|
componentProps: {
|
|
110
116
|
action: () => e.commands.toggleBold(),
|
|
111
117
|
isActive: () => e.isActive("bold"),
|
package/lib/BulletList.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("./index-COCTP78Y.cjs"),s=require("react/jsx-runtime"),n=require("./index-BLrMslr7.cjs");require("react");require("./theme.cjs");function g(){const t=n.useButtonProps(l.name),{icon:e=void 0,tooltip:i=void 0,shortcutKeys:o=void 0,tooltipOptions:r={},action:c=void 0,isActive:d=void 0}=(t==null?void 0:t.componentProps)??{},{dataState:a,disabled:u,update:p}=n.useToggleActive(d),m=()=>{u||c&&(c(),p())};return t?s.jsx(n.ActionButton,{action:m,dataState:a,disabled:u,icon:e,shortcutKeys:o,tooltip:i,tooltipOptions:r}):s.jsx(s.Fragment,{})}const l=v.BulletList.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,t:i,extension:o})=>({componentProps:{action:()=>e.commands.toggleBulletList(),isActive:()=>e.isActive("bulletList"),disabled:!1,shortcutKeys:o.options.shortcutKeys??["shift","mod","8"],icon:"List",tooltip:i("editor.bulletlist.tooltip")}})}}});exports.BulletList=l;exports.RichTextBulletList=g;
|
package/lib/BulletList.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { B as d } from "./index-
|
|
1
|
+
import { B as d } from "./index-cPEuL4Zr.js";
|
|
2
2
|
import { jsx as c, Fragment as m } from "react/jsx-runtime";
|
|
3
|
-
import { u as f, d as v, A } from "./index-
|
|
3
|
+
import { u as f, d as v, A } from "./index-CDFAs4RT.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import "./theme.js";
|
|
6
6
|
function y() {
|
package/lib/Callout.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./index-DwSnESy-.cjs"),h=require("./clsx-BSBE1eoY.cjs"),e=require("./index-BLrMslr7.cjs"),t=require("react/jsx-runtime"),d=require("react");require("./theme.cjs");const n=require("lucide-react"),k=require("./index-BqL4vAWE.cjs"),j=[{value:"note",label:"Note",icon:n.Info,color:"#1f6feb",background:"#1f6feb1f"},{value:"tip",label:"Tip",icon:n.Lightbulb,color:"#238636",background:"#2386361f"},{value:"important",label:"Important",icon:n.AlertCircle,color:"#ab7df8",background:"#ab7df81f"},{value:"warning",label:"Warning",icon:n.TriangleAlert,color:"#d29922",background:"#d299221f"},{value:"caution",label:"Caution",icon:n.OctagonAlert,color:"#f85149",background:"#f851491f"}];function q({node:l}){const{type:o="note",title:i="",body:c=""}=l.attrs,s=(j.find(u=>u.value===o)||j[0]).icon;return t.jsx(h.NodeViewWrapper,{children:t.jsxs("div",{className:h.clsx("richtext-relative richtext-my-4 richtext-rounded-lg richtext-border richtext-p-4",{"richtext-bg-[#1f6feb1f] richtext-border-[#1f6feb]":o==="note","richtext-bg-[#2386361f] richtext-border-[#238636]":o==="tip","richtext-bg-[#ab7df81f] richtext-border-[#ab7df8]":o==="important","richtext-bg-[#d299221f] richtext-border-[#d29922]":o==="warning","richtext-bg-[#f851491f] richtext-border-[#f85149]":o==="caution"}),children:[t.jsxs("div",{className:h.clsx("richtext-mb-2 richtext-flex richtext-items-center richtext-gap-2",{"richtext-text-[#1f6feb]":o==="note","richtext-text-[#238636]":o==="tip","richtext-text-[#ab7df8]":o==="important","richtext-text-[#d29922]":o==="warning","richtext-text-[#f85149]":o==="caution"}),children:[t.jsx(s,{className:"richtext-size-5"}),t.jsx("span",{className:"richtext-font-semibold",children:i})]}),c&&t.jsx("p",{className:"richtext-pl-[28px]",children:c})]})})}const w=[{value:"note",label:"Note",icon:"Info"},{value:"tip",label:"Tip",icon:"Lightbulb"},{value:"important",label:"Important",icon:"AlertCircle"},{value:"warning",label:"Warning",icon:"TriangleAlert"},{value:"caution",label:"Caution",icon:"OctagonAlert"}];function M(){const{t:l}=k.useLocale(),o=e.useEditorInstance(),i=e.useButtonProps(C.name),[c,a]=d.useState(!1),[s,u]=d.useState("note"),[p,b]=d.useState(""),[g,f]=d.useState(""),{icon:y=void 0,tooltip:T=void 0,shortcutKeys:A=void 0,tooltipOptions:L={},isActive:N=void 0}=(i==null?void 0:i.componentProps)??{},{dataState:S,disabled:v}=e.useToggleActive(N),I=()=>{o&&(o.chain().focus().setCallout({type:s,title:p,body:g}).run(),a(!1),u("note"),b(""),f(""))},O=()=>{v||a(!0)};return i?t.jsxs(e.Dialog,{onOpenChange:a,open:c,children:[t.jsx(e.DialogTrigger,{asChild:!0,children:t.jsx(e.ActionButton,{action:O,dataState:S,disabled:v,icon:y,shortcutKeys:A,tooltip:T,tooltipOptions:L})}),t.jsxs(e.DialogContent,{children:[t.jsx(e.DialogTitle,{children:l("editor.callout.dialog.title")}),t.jsxs("div",{className:"richtext-space-y-4 richtext-py-4",children:[t.jsxs("div",{className:"richtext-space-y-2",children:[t.jsx(e.Label,{children:l("editor.callout.dialog.type")}),t.jsxs(e.Select,{onValueChange:u,value:s,children:[t.jsx(e.SelectTrigger,{children:t.jsx(e.SelectValue,{placeholder:l("editor.callout.dialog.type.placeholder")})}),t.jsx(e.SelectContent,{children:w.map(r=>t.jsx(e.SelectItem,{value:r.value,children:l(`editor.callout.type.${r.value}`)},r.value))})]})]}),t.jsxs("div",{className:"richtext-space-y-2",children:[t.jsx(e.Label,{children:l("editor.callout.dialog.title.label")}),t.jsx(e.Input,{onChange:r=>b(r.target.value),placeholder:l("editor.callout.dialog.title.placeholder"),value:p})]}),t.jsxs("div",{className:"richtext-space-y-2",children:[t.jsx(e.Label,{children:l("editor.callout.dialog.body.label")}),t.jsx(e.Input,{onChange:r=>f(r.target.value),placeholder:l("editor.callout.dialog.body.placeholder"),value:g})]})]}),t.jsxs(e.DialogFooter,{children:[t.jsx(e.Button,{onClick:()=>a(!1),variant:"outline",children:l("editor.callout.dialog.button.cancel")}),t.jsx(e.Button,{onClick:I,children:l("editor.callout.dialog.button.apply")})]})]})]}):t.jsx(t.Fragment,{})}function x(l){return o=>o.getAttribute(l)}const C=m.Node3.create({name:"callout",group:"block",selectable:!0,atom:!0,draggable:!0,inline:!1,addOptions(){var l;return{...(l=this.parent)==null?void 0:l.call(this),HTMLAttributes:{class:"callout"},button:({editor:o,t:i})=>({component:e.ActionButton,componentProps:{action:()=>!0,isActive:()=>o.isActive("callout"),disabled:!1,icon:"Callout",tooltip:i("editor.callout.tooltip")}})}},parseHTML(){return[{tag:"div.callout"}]},renderHTML({HTMLAttributes:l}){return["div",m.mergeAttributes(this.options&&this.options.HTMLAttributes||{},l)]},addAttributes(){return{type:{default:"",parseHTML:x("type")},title:{default:"",parseHTML:x("title")},body:{default:"",parseHTML:x("body")}}},addCommands(){return{setCallout:l=>({chain:o})=>o().insertContent({type:this.name,attrs:l}).run()}},addNodeView(){return h.ReactNodeViewRenderer(q)}});exports.Callout=C;exports.RichTextCallout=M;
|
package/lib/Callout.js
CHANGED
|
@@ -1,45 +1,44 @@
|
|
|
1
|
-
import { N as D, m as H } from "./index-
|
|
2
|
-
import { N as M, c as x, a as B } from "./clsx-
|
|
3
|
-
import { h as V, u as P, d as j, D as E, m as R, A as T, n as W, o as F, L as u, j as v,
|
|
4
|
-
import { jsx as o, jsxs as l, Fragment as
|
|
1
|
+
import { N as D, m as H } from "./index-BVRHx_ha.js";
|
|
2
|
+
import { N as M, c as x, a as B } from "./clsx-OumA9x-8.js";
|
|
3
|
+
import { h as V, u as P, d as j, D as E, m as R, A as T, n as W, o as F, L as u, S as U, p as Y, q as _, r as $, s as q, j as v, t as z, B as C } from "./index-CDFAs4RT.js";
|
|
4
|
+
import { jsx as o, jsxs as l, Fragment as K } from "react/jsx-runtime";
|
|
5
5
|
import { useState as s } from "react";
|
|
6
6
|
import "./theme.js";
|
|
7
|
-
import { Info as
|
|
8
|
-
import { S as G, a as J, b as Q, c as X, d as Z } from "./select-C5SHDLFj.js";
|
|
7
|
+
import { Info as G, Lightbulb as J, AlertCircle as Q, TriangleAlert as X, OctagonAlert as Z } from "lucide-react";
|
|
9
8
|
import { u as tt } from "./index-BlXGgvT-.js";
|
|
10
9
|
const y = [
|
|
11
10
|
{
|
|
12
11
|
value: "note",
|
|
13
12
|
label: "Note",
|
|
14
|
-
icon:
|
|
13
|
+
icon: G,
|
|
15
14
|
color: "#1f6feb",
|
|
16
15
|
background: "#1f6feb1f"
|
|
17
16
|
},
|
|
18
17
|
{
|
|
19
18
|
value: "tip",
|
|
20
19
|
label: "Tip",
|
|
21
|
-
icon:
|
|
20
|
+
icon: J,
|
|
22
21
|
color: "#238636",
|
|
23
22
|
background: "#2386361f"
|
|
24
23
|
},
|
|
25
24
|
{
|
|
26
25
|
value: "important",
|
|
27
26
|
label: "Important",
|
|
28
|
-
icon:
|
|
27
|
+
icon: Q,
|
|
29
28
|
color: "#ab7df8",
|
|
30
29
|
background: "#ab7df81f"
|
|
31
30
|
},
|
|
32
31
|
{
|
|
33
32
|
value: "warning",
|
|
34
33
|
label: "Warning",
|
|
35
|
-
icon:
|
|
34
|
+
icon: X,
|
|
36
35
|
color: "#d29922",
|
|
37
36
|
background: "#d299221f"
|
|
38
37
|
},
|
|
39
38
|
{
|
|
40
39
|
value: "caution",
|
|
41
40
|
label: "Caution",
|
|
42
|
-
icon:
|
|
41
|
+
icon: Z,
|
|
43
42
|
color: "#f85149",
|
|
44
43
|
background: "#f851491f"
|
|
45
44
|
}
|
|
@@ -88,15 +87,15 @@ const ot = [
|
|
|
88
87
|
{ value: "warning", label: "Warning", icon: "TriangleAlert" },
|
|
89
88
|
{ value: "caution", label: "Caution", icon: "OctagonAlert" }
|
|
90
89
|
];
|
|
91
|
-
function
|
|
92
|
-
const { t } = tt(), e = V(), a = P(lt.name), [n, i] = s(!1), [c, d] = s("note"), [h, b] = s(""), [
|
|
90
|
+
function pt() {
|
|
91
|
+
const { t } = tt(), e = V(), a = P(lt.name), [n, i] = s(!1), [c, d] = s("note"), [h, b] = s(""), [g, f] = s(""), {
|
|
93
92
|
icon: A = void 0,
|
|
94
93
|
tooltip: N = void 0,
|
|
95
94
|
shortcutKeys: L = void 0,
|
|
96
95
|
tooltipOptions: S = {},
|
|
97
96
|
isActive: I = void 0
|
|
98
97
|
} = (a == null ? void 0 : a.componentProps) ?? {}, { dataState: k, disabled: m } = j(I), w = () => {
|
|
99
|
-
e && (e.chain().focus().setCallout({ type: c, title: h, body:
|
|
98
|
+
e && (e.chain().focus().setCallout({ type: c, title: h, body: g }).run(), i(!1), d("note"), b(""), f(""));
|
|
100
99
|
}, O = () => {
|
|
101
100
|
m || i(!0);
|
|
102
101
|
};
|
|
@@ -118,9 +117,9 @@ function ht() {
|
|
|
118
117
|
/* @__PURE__ */ l("div", { className: "richtext-space-y-4 richtext-py-4", children: [
|
|
119
118
|
/* @__PURE__ */ l("div", { className: "richtext-space-y-2", children: [
|
|
120
119
|
/* @__PURE__ */ o(u, { children: t("editor.callout.dialog.type") }),
|
|
121
|
-
/* @__PURE__ */ l(
|
|
122
|
-
/* @__PURE__ */ o(
|
|
123
|
-
/* @__PURE__ */ o(
|
|
120
|
+
/* @__PURE__ */ l(U, { onValueChange: d, value: c, children: [
|
|
121
|
+
/* @__PURE__ */ o(Y, { children: /* @__PURE__ */ o(_, { placeholder: t("editor.callout.dialog.type.placeholder") }) }),
|
|
122
|
+
/* @__PURE__ */ o($, { children: ot.map((r) => /* @__PURE__ */ o(q, { value: r.value, children: t(`editor.callout.type.${r.value}`) }, r.value)) })
|
|
124
123
|
] })
|
|
125
124
|
] }),
|
|
126
125
|
/* @__PURE__ */ l("div", { className: "richtext-space-y-2", children: [
|
|
@@ -139,19 +138,19 @@ function ht() {
|
|
|
139
138
|
/* @__PURE__ */ o(
|
|
140
139
|
v,
|
|
141
140
|
{
|
|
142
|
-
onChange: (r) =>
|
|
141
|
+
onChange: (r) => f(r.target.value),
|
|
143
142
|
placeholder: t("editor.callout.dialog.body.placeholder"),
|
|
144
|
-
value:
|
|
143
|
+
value: g
|
|
145
144
|
}
|
|
146
145
|
)
|
|
147
146
|
] })
|
|
148
147
|
] }),
|
|
149
|
-
/* @__PURE__ */ l(
|
|
148
|
+
/* @__PURE__ */ l(z, { children: [
|
|
150
149
|
/* @__PURE__ */ o(C, { onClick: () => i(!1), variant: "outline", children: t("editor.callout.dialog.button.cancel") }),
|
|
151
150
|
/* @__PURE__ */ o(C, { onClick: w, children: t("editor.callout.dialog.button.apply") })
|
|
152
151
|
] })
|
|
153
152
|
] })
|
|
154
|
-
] }) : /* @__PURE__ */ o(
|
|
153
|
+
] }) : /* @__PURE__ */ o(K, {});
|
|
155
154
|
}
|
|
156
155
|
function p(t) {
|
|
157
156
|
return (e) => e.getAttribute(t);
|
|
@@ -222,5 +221,5 @@ const lt = /* @__PURE__ */ D.create({
|
|
|
222
221
|
});
|
|
223
222
|
export {
|
|
224
223
|
lt as Callout,
|
|
225
|
-
|
|
224
|
+
pt as RichTextCallout
|
|
226
225
|
};
|
package/lib/Clear.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./index-DwSnESy-.cjs"),n=require("react/jsx-runtime"),i=require("./index-BLrMslr7.cjs");function v(){const t=i.useButtonProps(s.name),{icon:e=void 0,tooltip:o=void 0,shortcutKeys:a=void 0,tooltipOptions:u={},action:r=void 0,isActive:l=void 0}=(t==null?void 0:t.componentProps)??{},{disabled:c}=i.useActive(l),d=()=>{c||r&&r()};return t?n.jsx(i.ActionButton,{action:d,disabled:c,icon:e,shortcutKeys:a,tooltip:o,tooltipOptions:u}):n.jsx(n.Fragment,{})}const s=p.Node3.create({name:"clear",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,t:o})=>({componentProps:{action:()=>e.chain().focus().clearNodes().unsetAllMarks().run(),isActive:()=>e.can().chain().focus().clearNodes().unsetAllMarks().run(),icon:"Eraser",tooltip:o("editor.clear.tooltip")}})}}});exports.Clear=s;exports.RichTextClear=v;
|
package/lib/Clear.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { N as l } from "./index-
|
|
1
|
+
import { N as l } from "./index-BVRHx_ha.js";
|
|
2
2
|
import { jsx as r, Fragment as p } from "react/jsx-runtime";
|
|
3
|
-
import { u as d, e as m, A as f } from "./index-
|
|
3
|
+
import { u as d, e as m, A as f } from "./index-CDFAs4RT.js";
|
|
4
4
|
function x() {
|
|
5
5
|
const o = d(v.name), {
|
|
6
6
|
icon: t = void 0,
|
package/lib/Code.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-DwSnESy-.cjs"),i=require("react/jsx-runtime"),d=require("./index-BLrMslr7.cjs");require("react");require("./theme.cjs");var h=/(^|[^`])`([^`]+)`(?!`)$/,x=/(^|[^`])`([^`]+)`(?!`)/g,C=o.Mark.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:e}){return["code",o.mergeAttributes(this.options.HTMLAttributes,e),0]},markdownTokenName:"codespan",parseMarkdown:(e,t)=>t.applyMark("code",[{type:"text",text:e.text||""}]),renderMarkdown:(e,t)=>e.content?`\`${t.renderChildren(e.content)}\``:"",addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[o.markInputRule({find:h,type:this.type})]},addPasteRules(){return[o.markPasteRule({find:x,type:this.type})]}});function v(){const e=d.useButtonProps(u.name),{icon:t=void 0,tooltip:r=void 0,shortcutKeys:n=void 0,tooltipOptions:c={},action:s=void 0,isActive:p=void 0}=(e==null?void 0:e.componentProps)??{},{dataState:l,disabled:a,update:m}=d.useToggleActive(p),g=()=>{a||s&&(s(),m())};return e?i.jsx(d.ActionButton,{action:g,dataState:l,disabled:a,icon:t,shortcutKeys:n,tooltip:r,tooltipOptions:c}):i.jsx(i.Fragment,{})}const u=C.extend({addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),button:({editor:t,t:r,extension:n})=>({componentProps:{action:()=>t.commands.toggleCode(),isActive:()=>t.isActive("code"),disabled:!t.can().toggleCode(),icon:"Code",shortcutKeys:n.options.shortcutKeys??["mod","E"],tooltip:r("editor.code.tooltip")}})}}});exports.Code=u;exports.RichTextCode=v;
|
package/lib/Code.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { M as m, f as l, h as g, m as h } from "./index-
|
|
1
|
+
import { M as m, f as l, h as g, m as h } from "./index-BVRHx_ha.js";
|
|
2
2
|
import { jsx as a, Fragment as M } from "react/jsx-runtime";
|
|
3
|
-
import { u as v, d as C, A as f } from "./index-
|
|
3
|
+
import { u as v, d as C, A as f } from "./index-CDFAs4RT.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import "./theme.js";
|
|
6
6
|
var k = /(^|[^`])`([^`]+)`(?!`)$/, x = /(^|[^`])`([^`]+)`(?!`)/g, y = m.create({
|