reactjs-tiptap-editor 1.0.16 → 1.0.18
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-a8LhmHXe.js → ActionMenuButton-BOjCHFTA.js} +12 -16
- package/lib/ActionMenuButton-Df077oOH.cjs +1 -0
- package/lib/Attachment.cjs +2 -2
- package/lib/Attachment.js +47 -89
- package/lib/Blockquote.cjs +2 -2
- package/lib/Blockquote.js +11 -14
- package/lib/Bold.cjs +1 -1
- package/lib/Bold.js +13 -16
- package/lib/BulletList.cjs +1 -1
- package/lib/BulletList.js +15 -18
- package/lib/Callout.cjs +1 -1
- package/lib/Callout.js +113 -113
- package/lib/Clear.cjs +1 -1
- package/lib/Clear.js +12 -14
- package/lib/Code.cjs +1 -1
- package/lib/Code.js +8 -11
- package/lib/CodeBlock.cjs +37 -37
- package/lib/CodeBlock.js +1566 -1613
- package/lib/CodeView.cjs +1 -1
- package/lib/CodeView.js +9 -11
- package/lib/Color.cjs +1 -1
- package/lib/Color.js +62 -82
- package/lib/Column.cjs +1 -1
- package/lib/Column.js +27 -15
- package/lib/Drawer-DwrlY_lY.cjs +1 -0
- package/lib/Drawer-DxOoRiGQ.js +1099 -0
- package/lib/Drawer.cjs +1 -1
- package/lib/Drawer.js +6 -5
- package/lib/Emoji.cjs +1 -1
- package/lib/Emoji.js +71 -97
- package/lib/Excalidraw.cjs +1 -1
- package/lib/Excalidraw.js +265 -5
- package/lib/ExportPdf.cjs +4 -4
- package/lib/ExportPdf.js +20 -31
- package/lib/ExportWord.cjs +1 -1
- package/lib/ExportWord.js +11 -11
- package/lib/FontFamily.cjs +1 -1
- package/lib/FontFamily.js +16 -39
- package/lib/FontSize.cjs +1 -1
- package/lib/FontSize.js +25 -41
- package/lib/Heading.cjs +1 -1
- package/lib/Heading.js +51 -65
- package/lib/Highlight.cjs +1 -1
- package/lib/Highlight.js +60 -76
- package/lib/History.cjs +1 -1
- package/lib/History.js +322 -320
- package/lib/HorizontalRule.cjs +1 -1
- package/lib/HorizontalRule.js +8 -11
- package/lib/{Iframe-CmjbQQcz.js → Iframe-AhNV5WH5.js} +52 -65
- package/lib/Iframe-C6pBw-AF.cjs +1 -0
- package/lib/Iframe.cjs +1 -1
- package/lib/Iframe.js +5 -4
- package/lib/Image.cjs +1 -1
- package/lib/Image.js +5 -5
- package/lib/ImageGif.cjs +1 -1
- package/lib/ImageGif.js +148 -181
- package/lib/ImportWord.cjs +1 -1
- package/lib/ImportWord.js +19 -26
- package/lib/{Indent-BoG-vpIE.js → Indent-DZ5PcJA4.js} +24 -30
- package/lib/Indent-Do-X0AsY.cjs +1 -0
- package/lib/Indent.cjs +1 -1
- package/lib/Indent.js +2 -2
- package/lib/Italic.cjs +1 -1
- package/lib/Italic.js +11 -14
- package/lib/Katex-CIC9ygbL.cjs +4 -0
- package/lib/{Katex-ByL9snce.js → Katex-bIgoenn_.js} +243 -262
- package/lib/Katex.cjs +1 -1
- package/lib/Katex.js +5 -4
- package/lib/LineHeight.cjs +1 -1
- package/lib/LineHeight.js +23 -34
- package/lib/Link.cjs +1 -1
- package/lib/Link.js +2 -2
- package/lib/LinkEditBlock-B0ZaACZO.cjs +5 -0
- package/lib/{LinkEditBlock-Ckih17pU.js → LinkEditBlock-D_cF9fnc.js} +324 -381
- package/lib/MarkdownPaste.cjs +58 -0
- package/lib/MarkdownPaste.js +1656 -0
- package/lib/Mention.cjs +1 -1
- package/lib/Mention.js +22 -17
- package/lib/Mermaid.cjs +2 -2
- package/lib/Mermaid.js +125 -154
- package/lib/MoreMark.cjs +1 -1
- package/lib/MoreMark.js +28 -40
- package/lib/OrderedList.cjs +1 -1
- package/lib/OrderedList.js +13 -16
- package/lib/SearchAndReplace.cjs +1 -1
- package/lib/SearchAndReplace.js +114 -186
- package/lib/SlashCommand.cjs +1 -1
- package/lib/SlashCommand.js +15 -14
- package/lib/SlashCommandNodeView-Ba03hlVZ.cjs +1 -0
- package/lib/{SlashCommandNodeView-B2g1MbgN.js → SlashCommandNodeView-cg0x3NRF.js} +72 -79
- package/lib/Strike.cjs +1 -1
- package/lib/Strike.js +12 -15
- package/lib/{Table-BEwrZVup.js → Table-KqLiT5wG.js} +85 -125
- package/lib/Table-ddU2LSc6.cjs +9 -0
- package/lib/Table.cjs +1 -1
- package/lib/Table.js +1 -1
- package/lib/TaskList.cjs +1 -1
- package/lib/TaskList.js +18 -21
- package/lib/TextAlign.cjs +1 -1
- package/lib/TextAlign.js +65 -78
- package/lib/TextDirection.cjs +1 -1
- package/lib/TextDirection.js +51 -77
- package/lib/TextUnderline.cjs +1 -1
- package/lib/TextUnderline.js +7 -10
- package/lib/Twitter-BIiR78Jh.cjs +1 -0
- package/lib/{Twitter-4U_ZBhpv.js → Twitter-C1Lzqc7u.js} +567 -599
- package/lib/Twitter.cjs +1 -1
- package/lib/Twitter.js +4 -3
- package/lib/Video.cjs +1 -1
- package/lib/Video.js +5 -270
- package/lib/bubble.cjs +6 -4
- package/lib/bubble.js +3719 -3039
- package/lib/clsx-BWE7vnna.cjs +33 -0
- package/lib/clsx-eGVyq7ot.js +1062 -0
- package/lib/components/ActionButton.d.ts +2 -2
- package/lib/components/ActionMenuButton.d.ts +1 -1
- package/lib/components/Bubble/formatBubble.d.ts +5 -5
- package/lib/components/ReactBus.d.ts +11 -0
- package/lib/components/SlashDialogTrigger/RenderDialogUploadImage.d.ts +1 -0
- package/lib/components/SlashDialogTrigger/RenderDialogUploadVideo.d.ts +1 -0
- package/lib/components/SlashDialogTrigger/SlashDialogTrigger.d.ts +5 -0
- package/lib/components/ui/checkbox.d.ts +1 -1
- package/lib/components/ui/dialog.d.ts +1 -1
- package/lib/components/ui/dropdown-menu.d.ts +1 -1
- package/lib/components/ui/emoji-picker.d.ts +1 -1
- package/lib/components/ui/label.d.ts +1 -1
- package/lib/components/ui/popover.d.ts +1 -1
- package/lib/components/ui/select.d.ts +1 -1
- package/lib/components/ui/separator.d.ts +1 -1
- package/lib/components/ui/switch.d.ts +1 -1
- package/lib/components/ui/tabs.d.ts +1 -1
- package/lib/components/ui/toast.d.ts +1 -1
- package/lib/components/ui/toggle.d.ts +1 -1
- package/lib/components/ui/tooltip.d.ts +1 -1
- package/lib/{delete-node-IyVmiRbI.js → delete-node-eQHsyyhR.js} +3 -1
- package/lib/{dropdown-menu-CW3Kthwy.js → dropdown-menu-CexIkt_V.js} +8 -8
- package/lib/{dropdown-menu-eUeBXQeA.cjs → dropdown-menu-oSKIntXM.cjs} +1 -1
- package/lib/extensions/Blockquote/Blockquote.d.ts +1 -1
- package/lib/extensions/Bold/Bold.d.ts +1 -1
- package/lib/extensions/Code/Code.d.ts +1 -1
- package/lib/extensions/CodeView/CodeView.d.ts +2 -2
- package/lib/extensions/Heading/Heading.d.ts +1 -1
- package/lib/extensions/Highlight/Highlight.d.ts +1 -1
- package/lib/extensions/HorizontalRule/HorizontalRule.d.ts +1 -1
- package/lib/extensions/ImportWord/ImportWord.d.ts +2 -2
- package/lib/extensions/Italic/Italic.d.ts +1 -1
- package/lib/extensions/Link/Link.d.ts +1 -1
- package/lib/extensions/MarkdownPaste/MarkdownPaste.d.ts +5 -0
- package/lib/extensions/MarkdownPaste/index.d.ts +1 -0
- package/lib/extensions/Mermaid/Mermaid.d.ts +1 -1
- package/lib/extensions/MoreMark/MoreMark.d.ts +1 -1
- package/lib/extensions/Strike/Strike.d.ts +1 -1
- package/lib/extensions/Table/Table.d.ts +1 -1
- package/lib/extensions/TextAlign/TextAlign.d.ts +1 -1
- package/lib/extensions/TextUnderline/TextUnderline.d.ts +1 -1
- package/lib/index-BUTn2LY6.cjs +1 -0
- package/lib/{index-C07N8gA1.js → index-BlXGgvT-.js} +21 -18
- package/lib/{index-CpTykZBR.js → index-BnW6t8z6.js} +23 -23
- package/lib/{index-BsFvo9PG.cjs → index-BqL4vAWE.cjs} +1 -1
- package/lib/index-BtxvYLJ1.cjs +12 -0
- package/lib/{index-DR5tIdL7.js → index-C6xmkxrQ.js} +232 -217
- package/lib/index-CJ9pyCM4.cjs +1 -0
- package/lib/{index-neeeY2o7.cjs → index-D0lc95kr.cjs} +3 -3
- package/lib/index-DHUN85fV.js +4855 -0
- package/lib/index-DUpSE1Gb.cjs +1 -0
- package/lib/index-D_8P0LE5.js +1362 -0
- package/lib/{index-4bHF5ovf.js → index-RIXs7STX.js} +1 -1
- package/lib/index-mfGK4pFo.js +6469 -0
- package/lib/index-zig3Dj7A.cjs +22 -0
- package/lib/index.cjs +3 -3
- package/lib/index.js +60 -72
- package/lib/locale-bundle.cjs +1 -1
- package/lib/locale-bundle.js +1 -1
- package/lib/plugins/image-upload.d.ts +1 -1
- package/lib/popover-BYSZ3zBi.js +24 -0
- package/lib/popover-BcHDZqBt.cjs +1 -0
- package/lib/{renderNodeView-CSazLrKF.js → renderNodeView-BrM5kUj_.js} +2 -2
- package/lib/{renderNodeView-DfLmGrgA.cjs → renderNodeView-D1zydtli.cjs} +1 -1
- package/lib/{select-F0ZZ3VZB.js → select-C5SHDLFj.js} +8 -5
- package/lib/{select-Doa_-jkZ.cjs → select-DHjzKkcu.cjs} +1 -1
- package/lib/separator-BmixLrnJ.cjs +1 -0
- package/lib/separator-CFKVxAea.js +293 -0
- package/lib/store/editor.d.ts +1 -1
- package/lib/store/store.d.ts +2 -22
- package/lib/style.css +1 -1
- package/lib/{textarea-BAolHF_W.cjs → textarea-CasDcv3u.cjs} +1 -1
- package/lib/{textarea-tOsPnxHf.js → textarea-DNLrJoRl.js} +1 -1
- package/lib/theme.js +1 -1
- package/lib/types.d.ts +3 -3
- package/lib/updatePosition-CBRjbQMH.js +16 -0
- package/lib/updatePosition-CfmY5Trk.cjs +1 -0
- package/lib/utils/checkIsVideoUrl.d.ts +1 -0
- package/lib/utils/columns.d.ts +1 -1
- package/lib/utils/customEvents/events.constant.d.ts +1 -0
- package/lib/utils/mitt.d.ts +6 -3
- package/lib/utils/pdf.d.ts +1 -1
- package/lib/utils/utils.d.ts +1 -1
- package/package.json +262 -247
- package/lib/ActionMenuButton-BYu0NyVo.cjs +0 -1
- package/lib/Drawer-CbOJ1Igo.js +0 -1379
- package/lib/Drawer-DNaDMoAk.cjs +0 -1
- package/lib/Excalidraw-DnHTVOj8.js +0 -355
- package/lib/Excalidraw-DxfO1lQ_.cjs +0 -1
- package/lib/Icon-C0TJMAOm.js +0 -12
- package/lib/Icon-DzK0_ztP.cjs +0 -1
- package/lib/Iframe-BSNCsofW.cjs +0 -1
- package/lib/Image-BZEFuS0P.js +0 -925
- package/lib/Image-iKsGKjvg.cjs +0 -1
- package/lib/Indent-Bou16OcB.cjs +0 -1
- package/lib/Katex-BqDocr3a.cjs +0 -4
- package/lib/LinkEditBlock-B0I0EUrt.cjs +0 -5
- package/lib/SlashCommandNodeView-BEJhEzba.cjs +0 -1
- package/lib/Table-BclWwp6P.cjs +0 -9
- package/lib/Twitter-Dtq6PEMC.cjs +0 -1
- package/lib/button-Bwn6gUuS.js +0 -43
- package/lib/button-CqJztfH2.cjs +0 -1
- package/lib/checkbox-BAzbZY2Y.cjs +0 -1
- package/lib/checkbox-B_rpz5Xq.js +0 -27
- package/lib/clsx-CXbNJWDD.cjs +0 -54
- package/lib/clsx-DSzxBzvL.js +0 -7391
- package/lib/dialog-CJvpoeMm.js +0 -101
- package/lib/dialog-CWYTvz5J.cjs +0 -1
- package/lib/events.constant-Dq21NPdV.cjs +0 -1
- package/lib/events.constant-do95b767.js +0 -21
- package/lib/extensions/Image/store.d.ts +0 -4
- package/lib/extensions/Video/store.d.ts +0 -4
- package/lib/file-BLas99n7.js +0 -43
- package/lib/file-i7e4nQY2.cjs +0 -1
- package/lib/index-BCzvbrf5.cjs +0 -12
- package/lib/index-CL7JP-Xz.js +0 -426
- package/lib/index-CjhjjJsN.cjs +0 -1
- package/lib/index-Cn-t3Zxw.cjs +0 -1
- package/lib/index-Cs6cp0Y6.cjs +0 -1
- package/lib/index-D8li6EQ4.js +0 -1351
- package/lib/index-DoiuU6VA.js +0 -2315
- package/lib/index-VhKd73hZ.cjs +0 -1
- package/lib/input-B1egKb-t.js +0 -21
- package/lib/input-ZGRt7lWR.cjs +0 -1
- package/lib/isNumber-BTYSVlKo.cjs +0 -1
- package/lib/isNumber-ClwLypY2.js +0 -15
- package/lib/label-Cjrzc5H2.js +0 -19
- package/lib/label-tzSPdqui.cjs +0 -1
- package/lib/popover-C6Cya3Cz.cjs +0 -1
- package/lib/popover-CeY3RbI5.js +0 -24
- package/lib/separator-CUh5Y7Rh.cjs +0 -1
- package/lib/separator-Cjn4YH8a.js +0 -329
- package/lib/store/fast-context.d.ts +0 -7
- package/lib/store-BsJz5QRC.js +0 -10
- package/lib/store-DjkMIIEN.cjs +0 -1
- package/lib/tabs-BP8ypR_m.cjs +0 -1
- package/lib/tabs-CBDjOLl_.js +0 -46
- package/lib/throttle-D040PfWL.js +0 -249
- package/lib/throttle-gTTvqDTW.cjs +0 -1
- package/lib/toggle-C_SSvDRy.cjs +0 -1
- package/lib/toggle-DEerYRil.js +0 -99
- package/lib/tooltip-BJIvosho.js +0 -24
- package/lib/tooltip-FS1rsvd3.cjs +0 -1
- package/lib/updatePosition-CDK7OR0i.js +0 -16
- package/lib/updatePosition-Cjuj2E26.cjs +0 -1
- package/lib/useButtonProps-CtZCbMQu.js +0 -136
- package/lib/useButtonProps-Cz4W5dC8.cjs +0 -1
- package/lib/utils/_event.d.ts +0 -13
- package/lib/utils/customEvents/customEvents.d.ts +0 -3
|
@@ -8,6 +8,6 @@ export interface ImageUploadOptions {
|
|
|
8
8
|
defaultInline?: boolean;
|
|
9
9
|
}
|
|
10
10
|
export type UploadFn = (files: File[], view: EditorView, pos: number) => void;
|
|
11
|
-
export declare function createImageUpload({ validateFn, onUpload, postUpload, defaultInline }: ImageUploadOptions): UploadFn;
|
|
11
|
+
export declare function createImageUpload({ validateFn, onUpload, postUpload, defaultInline, }: ImageUploadOptions): UploadFn;
|
|
12
12
|
export declare function handleImagePaste(view: EditorView, event: ClipboardEvent, uploadFn: UploadFn): boolean;
|
|
13
13
|
export declare function handleImageDrop(view: EditorView, event: DragEvent, moved: boolean, uploadFn: UploadFn): boolean;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import * as t from "@radix-ui/react-popover";
|
|
3
|
+
import * as c from "react";
|
|
4
|
+
import { c as s } from "./index-DHUN85fV.js";
|
|
5
|
+
const x = t.Root, p = t.Trigger, n = c.forwardRef(({ className: o, align: r = "center", sideOffset: i = 4, ...a }, d) => /* @__PURE__ */ e(t.Portal, { children: /* @__PURE__ */ e(
|
|
6
|
+
t.Content,
|
|
7
|
+
{
|
|
8
|
+
align: r,
|
|
9
|
+
"data-richtext-portal": !0,
|
|
10
|
+
ref: d,
|
|
11
|
+
sideOffset: i,
|
|
12
|
+
className: s(
|
|
13
|
+
"richtext-z-50 richtext-w-72 richtext-rounded-md !richtext-border !richtext-border-border richtext-bg-popover richtext-p-4 richtext-text-popover-foreground richtext-shadow-md richtext-outline-none data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0 data-[state=closed]:richtext-zoom-out-95 data-[state=open]:richtext-zoom-in-95 data-[side=bottom]:richtext-slide-in-from-top-2 data-[side=left]:richtext-slide-in-from-right-2 data-[side=right]:richtext-slide-in-from-left-2 data-[side=top]:richtext-slide-in-from-bottom-2",
|
|
14
|
+
o
|
|
15
|
+
),
|
|
16
|
+
...a
|
|
17
|
+
}
|
|
18
|
+
) }));
|
|
19
|
+
n.displayName = t.Content.displayName;
|
|
20
|
+
export {
|
|
21
|
+
x as P,
|
|
22
|
+
p as a,
|
|
23
|
+
n as b
|
|
24
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const a=require("react/jsx-runtime"),d=require("@radix-ui/react-popover"),p=require("react"),h=require("./index-BUTn2LY6.cjs");function n(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const i=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,i.get?i:{enumerable:!0,get:()=>t[e]})}}return r.default=t,Object.freeze(r)}const o=n(d),l=n(p),x=o.Root,m=o.Trigger,c=l.forwardRef(({className:t,align:r="center",sideOffset:e=4,...i},s)=>a.jsx(o.Portal,{children:a.jsx(o.Content,{align:r,"data-richtext-portal":!0,ref:s,sideOffset:e,className:h.cn("richtext-z-50 richtext-w-72 richtext-rounded-md !richtext-border !richtext-border-border richtext-bg-popover richtext-p-4 richtext-text-popover-foreground richtext-shadow-md richtext-outline-none data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0 data-[state=closed]:richtext-zoom-out-95 data-[state=open]:richtext-zoom-in-95 data-[side=bottom]:richtext-slide-in-from-top-2 data-[side=left]:richtext-slide-in-from-right-2 data-[side=right]:richtext-slide-in-from-left-2 data-[side=top]:richtext-slide-in-from-bottom-2",t),...i})}));c.displayName=o.Content.displayName;exports.Popover=x;exports.PopoverContent=c;exports.PopoverTrigger=m;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const i=require("./clsx-
|
|
1
|
+
"use strict";const i=require("./clsx-BWE7vnna.cjs"),r=require("./updatePosition-CfmY5Trk.cjs");function d(o){return()=>{let e;return{onStart:t=>{t.clientRect&&(e=new i.ReactRenderer(o,{props:t,editor:t.editor}),e.element.style.position="absolute",document.body.appendChild(e.element),r.updatePosition(t.editor,e.element))},onUpdate(t){e.updateProps(t),t.clientRect&&r.updatePosition(t.editor,e.element)},onKeyDown(t){var n;return t.event.key==="Escape"?(e.destroy(),e.element.remove(),!0):(n=e.ref)==null?void 0:n.onKeyDown(t)},onExit(){e.destroy(),e.element.remove()}}}}exports.renderNodeViewClosure=d;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsxs as h, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import * as o from "react";
|
|
3
2
|
import * as t from "@radix-ui/react-select";
|
|
4
3
|
import { ChevronDown as x, ChevronUp as m, Check as p } from "lucide-react";
|
|
5
|
-
import
|
|
4
|
+
import * as o from "react";
|
|
5
|
+
import { c as a } from "./index-DHUN85fV.js";
|
|
6
6
|
const v = t.Root, R = t.Value, f = o.forwardRef(({ className: i, children: c, ...r }, s) => /* @__PURE__ */ h(
|
|
7
7
|
t.Trigger,
|
|
8
8
|
{
|
|
9
9
|
ref: s,
|
|
10
10
|
className: a(
|
|
11
|
-
"richtext-flex richtext-h-10 richtext-w-full richtext-items-center richtext-justify-between richtext-rounded-md richtext-border richtext-border-input richtext-bg-background richtext-px-3 richtext-py-2 richtext-text-sm richtext-ring-offset-background placeholder:richtext-text-muted-foreground focus:richtext-outline-none focus:richtext-ring-2 focus:richtext-ring-ring focus:richtext-ring-offset-1 disabled:richtext-cursor-not-allowed disabled:richtext-opacity-50 [&>span]:richtext-line-clamp-1
|
|
11
|
+
"richtext-flex richtext-h-10 richtext-w-full richtext-items-center richtext-justify-between richtext-rounded-md richtext-border richtext-border-input richtext-bg-background richtext-px-3 richtext-py-2 richtext-text-sm richtext-text-foreground richtext-ring-offset-background placeholder:richtext-text-muted-foreground focus:richtext-outline-none focus:richtext-ring-2 focus:richtext-ring-ring focus:richtext-ring-offset-1 disabled:richtext-cursor-not-allowed disabled:richtext-opacity-50 [&>span]:richtext-line-clamp-1",
|
|
12
12
|
i
|
|
13
13
|
),
|
|
14
14
|
...r,
|
|
@@ -52,7 +52,7 @@ const u = o.forwardRef(({ className: i, children: c, position: r = "popper", ...
|
|
|
52
52
|
position: r,
|
|
53
53
|
ref: n,
|
|
54
54
|
className: a(
|
|
55
|
-
"richtext-relative richtext-z-50 richtext-max-h-60 richtext-
|
|
55
|
+
"richtext-relative richtext-z-50 richtext-max-h-60 richtext-min-w-[8rem] richtext-overflow-hidden richtext-overflow-y-auto richtext-rounded-md richtext-border !richtext-border-border richtext-bg-popover richtext-text-popover-foreground richtext-shadow-md data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0 data-[state=closed]:richtext-zoom-out-95 data-[state=open]:richtext-zoom-in-95 data-[side=bottom]:richtext-slide-in-from-top-2 data-[side=left]:richtext-slide-in-from-right-2 data-[side=right]:richtext-slide-in-from-left-2 data-[side=top]:richtext-slide-in-from-bottom-2",
|
|
56
56
|
r === "popper" && "data-[side=bottom]:richtext-translate-y-1 data-[side=left]:richtext--translate-x-1 data-[side=right]:richtext-translate-x-1 data-[side=top]:richtext--translate-y-1",
|
|
57
57
|
i
|
|
58
58
|
),
|
|
@@ -77,7 +77,10 @@ u.displayName = t.Content.displayName;
|
|
|
77
77
|
const y = o.forwardRef(({ className: i, ...c }, r) => /* @__PURE__ */ e(
|
|
78
78
|
t.Label,
|
|
79
79
|
{
|
|
80
|
-
className: a(
|
|
80
|
+
className: a(
|
|
81
|
+
"richtext-py-1.5 richtext-pl-8 richtext-pr-2 richtext-text-sm richtext-font-semibold",
|
|
82
|
+
i
|
|
83
|
+
),
|
|
81
84
|
ref: r,
|
|
82
85
|
...c
|
|
83
86
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const c=require("react/jsx-runtime"),f=require("
|
|
1
|
+
"use strict";const c=require("react/jsx-runtime"),f=require("@radix-ui/react-select"),x=require("lucide-react"),g=require("react"),s=require("./index-BUTn2LY6.cjs");function l(r){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const e in r)if(e!=="default"){const a=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(i,e,a.get?a:{enumerable:!0,get:()=>r[e]})}}return i.default=r,Object.freeze(i)}const t=l(f),o=l(g),y=t.Root,b=t.Value,n=o.forwardRef(({className:r,children:i,...e},a)=>c.jsxs(t.Trigger,{ref:a,className:s.cn("richtext-flex richtext-h-10 richtext-w-full richtext-items-center richtext-justify-between richtext-rounded-md richtext-border richtext-border-input richtext-bg-background richtext-px-3 richtext-py-2 richtext-text-sm richtext-text-foreground richtext-ring-offset-background placeholder:richtext-text-muted-foreground focus:richtext-outline-none focus:richtext-ring-2 focus:richtext-ring-ring focus:richtext-ring-offset-1 disabled:richtext-cursor-not-allowed disabled:richtext-opacity-50 [&>span]:richtext-line-clamp-1",r),...e,children:[i,c.jsx(t.Icon,{asChild:!0,children:c.jsx(x.ChevronDown,{className:"richtext-size-4 richtext-opacity-50"})})]}));n.displayName=t.Trigger.displayName;const h=o.forwardRef(({className:r,...i},e)=>c.jsx(t.ScrollUpButton,{ref:e,className:s.cn("richtext-flex richtext-cursor-default richtext-items-center richtext-justify-center richtext-py-1",r),...i,children:c.jsx(x.ChevronUp,{className:"richtext-size-4"})}));h.displayName=t.ScrollUpButton.displayName;const d=o.forwardRef(({className:r,...i},e)=>c.jsx(t.ScrollDownButton,{ref:e,className:s.cn("richtext-flex richtext-cursor-default richtext-items-center richtext-justify-center richtext-py-1",r),...i,children:c.jsx(x.ChevronDown,{className:"richtext-size-4"})}));d.displayName=t.ScrollDownButton.displayName;const m=o.forwardRef(({className:r,children:i,position:e="popper",...a},u)=>c.jsx(t.Portal,{children:c.jsxs(t.Content,{"data-richtext-portal":!0,position:e,ref:u,className:s.cn("richtext-relative richtext-z-50 richtext-max-h-60 richtext-min-w-[8rem] richtext-overflow-hidden richtext-overflow-y-auto richtext-rounded-md richtext-border !richtext-border-border richtext-bg-popover richtext-text-popover-foreground richtext-shadow-md data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0 data-[state=closed]:richtext-zoom-out-95 data-[state=open]:richtext-zoom-in-95 data-[side=bottom]:richtext-slide-in-from-top-2 data-[side=left]:richtext-slide-in-from-right-2 data-[side=right]:richtext-slide-in-from-left-2 data-[side=top]:richtext-slide-in-from-bottom-2",e==="popper"&&"data-[side=bottom]:richtext-translate-y-1 data-[side=left]:richtext--translate-x-1 data-[side=right]:richtext-translate-x-1 data-[side=top]:richtext--translate-y-1",r),...a,children:[c.jsx(h,{}),c.jsx(t.Viewport,{className:s.cn("richtext-p-1",e==="popper"&&"richtext-h-[var(--radix-select-trigger-height)] richtext-w-full richtext-min-w-[var(--radix-select-trigger-width)]"),children:i}),c.jsx(d,{})]})}));m.displayName=t.Content.displayName;const j=o.forwardRef(({className:r,...i},e)=>c.jsx(t.Label,{className:s.cn("richtext-py-1.5 richtext-pl-8 richtext-pr-2 richtext-text-sm richtext-font-semibold",r),ref:e,...i}));j.displayName=t.Label.displayName;const p=o.forwardRef(({className:r,children:i,...e},a)=>c.jsxs(t.Item,{ref:a,className:s.cn("richtext-relative richtext-flex richtext-w-full richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-py-1.5 richtext-pl-8 richtext-pr-2 richtext-text-sm richtext-outline-none focus:richtext-bg-accent focus:richtext-text-accent-foreground data-[disabled]:richtext-pointer-events-none data-[disabled]:richtext-opacity-50",r),...e,children:[c.jsx("span",{className:"richtext-absolute richtext-left-2 richtext-flex richtext-size-3.5 richtext-items-center richtext-justify-center",children:c.jsx(t.ItemIndicator,{children:c.jsx(x.Check,{className:"richtext-size-4"})})}),c.jsx(t.ItemText,{children:i})]}));p.displayName=t.Item.displayName;const N=o.forwardRef(({className:r,...i},e)=>c.jsx(t.Separator,{className:s.cn("richtext--mx-1 richtext-my-1 richtext-h-px richtext-bg-muted",r),ref:e,...i}));N.displayName=t.Separator.displayName;exports.Select=y;exports.SelectContent=m;exports.SelectItem=p;exports.SelectTrigger=n;exports.SelectValue=b;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),E=require("lucide-react"),n=require("react"),P=require("react-colorful"),j=require("./index-BUTn2LY6.cjs");require("./theme.cjs");const C=require("./index-BqL4vAWE.cjs"),v=require("./popover-BcHDZqBt.cjs"),O=require("@radix-ui/react-separator");function N(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const c in t)if(c!=="default"){const h=Object.getOwnPropertyDescriptor(t,c);Object.defineProperty(r,c,h.get?h:{enumerable:!0,get:()=>t[c]})}}return r.default=t,Object.freeze(r)}const y=N(n),z=N(O);function R(){return e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:e.jsx("path",{fill:"currentColor",d:"M18 14c0-4-6-10.8-6-10.8s-1.33 1.51-2.73 3.52l8.59 8.59c.09-.42.14-.86.14-1.31m-.88 3.12L12.5 12.5L5.27 5.27L4 6.55l3.32 3.32C6.55 11.32 6 12.79 6 14c0 3.31 2.69 6 6 6c1.52 0 2.9-.57 3.96-1.5l2.63 2.63l1.27-1.27z"})})}const w=typeof window>"u";function L(t,r,c=window){const h=n.useRef(void 0);n.useEffect(()=>{h.current=r},[r]),n.useEffect(()=>{if(!(c&&c.addEventListener))return;const f=x=>{h.current&&h.current(x)};return c.addEventListener(t,f),()=>{c.removeEventListener(t,f)}},[t,c])}function _(t,r,c={}){const{initializeWithValue:h=!0}=c,i=n.useCallback(o=>c.serializer?c.serializer(o):JSON.stringify(o),[c]),f=n.useCallback(o=>{if(c.deserializer)return c.deserializer(o);if(o==="undefined")return;const l=r instanceof Function?r():r;let s;try{s=JSON.parse(o)}catch(a){return console.error("Error parsing JSON:",a),l}return s},[c,r]),x=n.useCallback(()=>{const o=r instanceof Function?r():r;if(w)return o;try{const l=window.localStorage.getItem(t);return l?f(l):o}catch(l){return console.warn(`Error reading localStorage key “${t}”:`,l),o}},[r,t,f]),[d,p]=n.useState(()=>h?x():r instanceof Function?r():r),b=n.useCallback(o=>{w&&console.warn(`Tried setting localStorage key “${t}” even though environment is not a client`);try{const l=o instanceof Function?o(x()):o;window.localStorage.setItem(t,i(l)),p(l),window.dispatchEvent(new StorageEvent("local-storage",{key:t}))}catch(l){console.warn(`Error setting localStorage key “${t}”:`,l)}},[t,i,x]),g=n.useCallback(()=>{w&&console.warn(`Tried removing localStorage key “${t}” even though environment is not a client`);const o=r instanceof Function?r():r;window.localStorage.removeItem(t),p(o),window.dispatchEvent(new StorageEvent("local-storage",{key:t}))},[t,r]);n.useEffect(()=>{p(x())},[t]);const m=n.useCallback(o=>{o.key&&o.key!==t||p(x())},[t,x]);return L("storage",m),L("local-storage",m),[d,b,g]}function q(t){const{t:r}=C.useLocale(),{disabled:c=!1,value:h,onChange:i,colors:f=C.COLORS_LIST,highlight:x}=t,[d,p]=n.useState(!1),b=n.useMemo(()=>{const s=f,a=[];for(let u=0;u<s.length;u+=10)a.push(s.slice(u,u+10));return a},[f]),[g,m]=_(x?"richtext-recent-highlight":"richtext-recent-colors",[]),o=s=>{const a=[...g],u=a.indexOf(s);u!==-1&&a.splice(u,1),a.unshift(s),a.length>10&&a.pop(),m(a)};function l(s){if(s===void 0){i==null||i(s),p(!1);return}/^#([\da-f]{3}){1,2}$/i.test(s)&&(i==null||i(s),o(s),p(!1))}return e.jsxs(v.Popover,{modal:!0,onOpenChange:p,open:d,children:[e.jsx(v.PopoverTrigger,{asChild:!0,className:"!richtext-p-0",disabled:c,children:t==null?void 0:t.children}),e.jsx(v.PopoverContent,{align:"start",className:"richtext-size-full !richtext-p-2",hideWhenDetached:!0,side:"bottom",children:e.jsxs("div",{className:"richtext-flex richtext-flex-col",children:[e.jsxs("div",{className:"rd-1 richtext-flex richtext-cursor-pointer richtext-items-center richtext-gap-[4px] richtext-p-1 hover:richtext-bg-accent",onClick:()=>{l(void 0)},children:[e.jsx(R,{}),e.jsx("span",{className:"richtext-ml-1 richtext-text-sm",children:r(x?"editor.nofill":"editor.default")})]}),b.map((s,a)=>e.jsx("span",{className:"richtext-relative richtext-flex richtext-h-auto richtext-w-full richtext-p-0 last:richtext-pb-2",children:s.map((u,k)=>e.jsx("span",{className:"richtext-inline-block richtext-size-6 richtext-flex-[0_0_auto] richtext-cursor-pointer richtext-rounded-sm !richtext-border richtext-border-solid !richtext-border-transparent richtext-p-0.5 hover:!richtext-border-border",onClick:()=>l(u),children:e.jsx("span",{className:"richtext-relative richtext-block richtext-size-[18px] richtext-rounded-[2px]",style:{backgroundColor:u},children:u===h?e.jsx("svg",{className:"richtext-absolute -richtext-top-px richtext-left-px richtext-block richtext-size-3",viewBox:"0 0 18 18",style:{fill:"rgb(255, 255, 255)"},children:e.jsx("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})}):e.jsx("svg",{viewBox:"0 0 18 18",style:{fill:"rgb(255, 255, 255)",display:"none"},children:e.jsx("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})})})},`sub-color-${k}`))},`color-row-${a}`)),e.jsxs("div",{children:[e.jsx("div",{className:"richtext-my-1 richtext-text-sm",children:r("editor.recent")}),e.jsx("span",{className:"richtext-relative richtext-flex richtext-h-auto richtext-w-full richtext-flex-wrap richtext-p-0 last:richtext-pb-2",children:g==null?void 0:g.map((s,a)=>e.jsx("span",{className:"richtext-inline-block richtext-size-6 richtext-flex-[0_0_auto] richtext-cursor-pointer richtext-rounded-sm !richtext-border richtext-border-transparent richtext-p-0.5 hover:richtext-border-border hover:richtext-shadow-sm",onClick:()=>l(s),children:e.jsx("span",{className:"richtext-relative richtext-block richtext-size-[18px] richtext-rounded-[2px] richtext-border-transparent",style:{backgroundColor:s},children:e.jsx("svg",{viewBox:"0 0 18 18",style:{fill:"rgb(255, 255, 255)",display:"none"},children:e.jsx("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})})})},`sub-color-recent-${a}`))})]}),e.jsx(M,{setColor:l})]})})]})}function M({setColor:t}){const{t:r}=C.useLocale(),[c,h]=n.useState(!1),[i,f]=n.useState("#000000"),x=n.useCallback(d=>{f(d)},[]);return e.jsxs(v.Popover,{onOpenChange:h,open:c,children:[e.jsx(v.PopoverTrigger,{asChild:!0,children:e.jsxs("div",{className:"richtext-p-1.5 richtext-text-sm hover:richtext-cursor-pointer hover:richtext-bg-accent",children:[r("editor.color.more"),"..."]})}),e.jsxs(v.PopoverContent,{children:[e.jsxs("div",{className:"richtext-flex richtext-flex-col richtext-items-center richtext-justify-center",children:[e.jsx(P.HexColorPicker,{color:i,onChange:d=>{x(d)}}),e.jsx(j.Input,{className:"richtext-mt-[8px] richtext-w-full",type:"text",value:i.replace("#",""),onChange:d=>{d.preventDefault(),d.stopPropagation(),x(`#${d.target.value}`)}})]}),e.jsx(S,{className:"richtext-my-[10px]"}),e.jsx(j.Button,{className:"richtext-w-full",onClick:d=>{d.preventDefault(),d.stopPropagation(),t(i),h(!1)},children:e.jsx(E.Plus,{size:16})})]})]})}const S=y.forwardRef(({className:t,orientation:r="horizontal",decorative:c=!0,...h},i)=>e.jsx(z.Root,{ref:i,decorative:c,orientation:r,className:j.cn("richtext-shrink-0 richtext-bg-border",r==="horizontal"?"richtext-h-[1px] richtext-w-full":"richtext-h-full richtext-w-[1px]",t),...h}));S.displayName=z.Root.displayName;exports.ColorPicker=q;exports.Separator=S;
|
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
import { jsx as t, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import { Plus as k } from "lucide-react";
|
|
3
|
+
import * as $ from "react";
|
|
4
|
+
import { useCallback as m, useState as w, useEffect as L, useRef as M, useMemo as B } from "react";
|
|
5
|
+
import { HexColorPicker as F } from "react-colorful";
|
|
6
|
+
import { j as I, B as _, c as T } from "./index-DHUN85fV.js";
|
|
7
|
+
import "./theme.js";
|
|
8
|
+
import { u as N, C as j } from "./index-BlXGgvT-.js";
|
|
9
|
+
import { P as z, a as E, b as y } from "./popover-BYSZ3zBi.js";
|
|
10
|
+
import * as R from "@radix-ui/react-separator";
|
|
11
|
+
function D() {
|
|
12
|
+
return /* @__PURE__ */ t("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 24 24", children: /* @__PURE__ */ t(
|
|
13
|
+
"path",
|
|
14
|
+
{
|
|
15
|
+
fill: "currentColor",
|
|
16
|
+
d: "M18 14c0-4-6-10.8-6-10.8s-1.33 1.51-2.73 3.52l8.59 8.59c.09-.42.14-.86.14-1.31m-.88 3.12L12.5 12.5L5.27 5.27L4 6.55l3.32 3.32C6.55 11.32 6 12.79 6 14c0 3.31 2.69 6 6 6c1.52 0 2.9-.57 3.96-1.5l2.63 2.63l1.27-1.27z"
|
|
17
|
+
}
|
|
18
|
+
) });
|
|
19
|
+
}
|
|
20
|
+
const C = typeof window > "u";
|
|
21
|
+
function S(e, r, c = window) {
|
|
22
|
+
const d = M(void 0);
|
|
23
|
+
L(() => {
|
|
24
|
+
d.current = r;
|
|
25
|
+
}, [r]), L(() => {
|
|
26
|
+
if (!(c && c.addEventListener)) return;
|
|
27
|
+
const u = (a) => {
|
|
28
|
+
d.current && d.current(a);
|
|
29
|
+
};
|
|
30
|
+
return c.addEventListener(e, u), () => {
|
|
31
|
+
c.removeEventListener(e, u);
|
|
32
|
+
};
|
|
33
|
+
}, [e, c]);
|
|
34
|
+
}
|
|
35
|
+
function J(e, r, c = {}) {
|
|
36
|
+
const { initializeWithValue: d = !0 } = c, n = m(
|
|
37
|
+
(o) => c.serializer ? c.serializer(o) : JSON.stringify(o),
|
|
38
|
+
[c]
|
|
39
|
+
), u = m(
|
|
40
|
+
(o) => {
|
|
41
|
+
if (c.deserializer)
|
|
42
|
+
return c.deserializer(o);
|
|
43
|
+
if (o === "undefined")
|
|
44
|
+
return;
|
|
45
|
+
const s = r instanceof Function ? r() : r;
|
|
46
|
+
let i;
|
|
47
|
+
try {
|
|
48
|
+
i = JSON.parse(o);
|
|
49
|
+
} catch (l) {
|
|
50
|
+
return console.error("Error parsing JSON:", l), s;
|
|
51
|
+
}
|
|
52
|
+
return i;
|
|
53
|
+
},
|
|
54
|
+
[c, r]
|
|
55
|
+
), a = m(() => {
|
|
56
|
+
const o = r instanceof Function ? r() : r;
|
|
57
|
+
if (C)
|
|
58
|
+
return o;
|
|
59
|
+
try {
|
|
60
|
+
const s = window.localStorage.getItem(e);
|
|
61
|
+
return s ? u(s) : o;
|
|
62
|
+
} catch (s) {
|
|
63
|
+
return console.warn(`Error reading localStorage key “${e}”:`, s), o;
|
|
64
|
+
}
|
|
65
|
+
}, [r, e, u]), [h, f] = w(() => d ? a() : r instanceof Function ? r() : r), b = m(
|
|
66
|
+
(o) => {
|
|
67
|
+
C && console.warn(
|
|
68
|
+
`Tried setting localStorage key “${e}” even though environment is not a client`
|
|
69
|
+
);
|
|
70
|
+
try {
|
|
71
|
+
const s = o instanceof Function ? o(a()) : o;
|
|
72
|
+
window.localStorage.setItem(e, n(s)), f(s), window.dispatchEvent(
|
|
73
|
+
new StorageEvent("local-storage", {
|
|
74
|
+
key: e
|
|
75
|
+
})
|
|
76
|
+
);
|
|
77
|
+
} catch (s) {
|
|
78
|
+
console.warn(`Error setting localStorage key “${e}”:`, s);
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
[e, n, a]
|
|
82
|
+
), g = m(() => {
|
|
83
|
+
C && console.warn(
|
|
84
|
+
`Tried removing localStorage key “${e}” even though environment is not a client`
|
|
85
|
+
);
|
|
86
|
+
const o = r instanceof Function ? r() : r;
|
|
87
|
+
window.localStorage.removeItem(e), f(o), window.dispatchEvent(
|
|
88
|
+
new StorageEvent("local-storage", {
|
|
89
|
+
key: e
|
|
90
|
+
})
|
|
91
|
+
);
|
|
92
|
+
}, [e, r]);
|
|
93
|
+
L(() => {
|
|
94
|
+
f(a());
|
|
95
|
+
}, [e]);
|
|
96
|
+
const v = m(
|
|
97
|
+
(o) => {
|
|
98
|
+
o.key && o.key !== e || f(a());
|
|
99
|
+
},
|
|
100
|
+
[e, a]
|
|
101
|
+
);
|
|
102
|
+
return S("storage", v), S("local-storage", v), [h, b, g];
|
|
103
|
+
}
|
|
104
|
+
function X(e) {
|
|
105
|
+
const { t: r } = N(), { disabled: c = !1, value: d, onChange: n, colors: u = j, highlight: a } = e, [h, f] = w(!1), b = B(() => {
|
|
106
|
+
const i = u, l = [];
|
|
107
|
+
for (let x = 0; x < i.length; x += 10)
|
|
108
|
+
l.push(i.slice(x, x + 10));
|
|
109
|
+
return l;
|
|
110
|
+
}, [u]), [g, v] = J(
|
|
111
|
+
a ? "richtext-recent-highlight" : "richtext-recent-colors",
|
|
112
|
+
[]
|
|
113
|
+
), o = (i) => {
|
|
114
|
+
const l = [...g], x = l.indexOf(i);
|
|
115
|
+
x !== -1 && l.splice(x, 1), l.unshift(i), l.length > 10 && l.pop(), v(l);
|
|
116
|
+
};
|
|
117
|
+
function s(i) {
|
|
118
|
+
if (i === void 0) {
|
|
119
|
+
n == null || n(i), f(!1);
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
/^#([\da-f]{3}){1,2}$/i.test(i) && (n == null || n(i), o(i), f(!1));
|
|
123
|
+
}
|
|
124
|
+
return /* @__PURE__ */ p(z, { modal: !0, onOpenChange: f, open: h, children: [
|
|
125
|
+
/* @__PURE__ */ t(E, { asChild: !0, className: "!richtext-p-0", disabled: c, children: e == null ? void 0 : e.children }),
|
|
126
|
+
/* @__PURE__ */ t(
|
|
127
|
+
y,
|
|
128
|
+
{
|
|
129
|
+
align: "start",
|
|
130
|
+
className: "richtext-size-full !richtext-p-2",
|
|
131
|
+
hideWhenDetached: !0,
|
|
132
|
+
side: "bottom",
|
|
133
|
+
children: /* @__PURE__ */ p("div", { className: "richtext-flex richtext-flex-col", children: [
|
|
134
|
+
/* @__PURE__ */ p(
|
|
135
|
+
"div",
|
|
136
|
+
{
|
|
137
|
+
className: "rd-1 richtext-flex richtext-cursor-pointer richtext-items-center richtext-gap-[4px] richtext-p-1 hover:richtext-bg-accent",
|
|
138
|
+
onClick: () => {
|
|
139
|
+
s(void 0);
|
|
140
|
+
},
|
|
141
|
+
children: [
|
|
142
|
+
/* @__PURE__ */ t(D, {}),
|
|
143
|
+
/* @__PURE__ */ t("span", { className: "richtext-ml-1 richtext-text-sm", children: r(a ? "editor.nofill" : "editor.default") })
|
|
144
|
+
]
|
|
145
|
+
}
|
|
146
|
+
),
|
|
147
|
+
b.map((i, l) => /* @__PURE__ */ t(
|
|
148
|
+
"span",
|
|
149
|
+
{
|
|
150
|
+
className: "richtext-relative richtext-flex richtext-h-auto richtext-w-full richtext-p-0 last:richtext-pb-2",
|
|
151
|
+
children: i.map((x, P) => /* @__PURE__ */ t(
|
|
152
|
+
"span",
|
|
153
|
+
{
|
|
154
|
+
className: "richtext-inline-block richtext-size-6 richtext-flex-[0_0_auto] richtext-cursor-pointer richtext-rounded-sm !richtext-border richtext-border-solid !richtext-border-transparent richtext-p-0.5 hover:!richtext-border-border",
|
|
155
|
+
onClick: () => s(x),
|
|
156
|
+
children: /* @__PURE__ */ t(
|
|
157
|
+
"span",
|
|
158
|
+
{
|
|
159
|
+
className: "richtext-relative richtext-block richtext-size-[18px] richtext-rounded-[2px]",
|
|
160
|
+
style: {
|
|
161
|
+
backgroundColor: x
|
|
162
|
+
},
|
|
163
|
+
children: x === d ? /* @__PURE__ */ t(
|
|
164
|
+
"svg",
|
|
165
|
+
{
|
|
166
|
+
className: "richtext-absolute -richtext-top-px richtext-left-px richtext-block richtext-size-3",
|
|
167
|
+
viewBox: "0 0 18 18",
|
|
168
|
+
style: {
|
|
169
|
+
fill: "rgb(255, 255, 255)"
|
|
170
|
+
},
|
|
171
|
+
children: /* @__PURE__ */ t("path", { d: "M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" })
|
|
172
|
+
}
|
|
173
|
+
) : /* @__PURE__ */ t(
|
|
174
|
+
"svg",
|
|
175
|
+
{
|
|
176
|
+
viewBox: "0 0 18 18",
|
|
177
|
+
style: {
|
|
178
|
+
fill: "rgb(255, 255, 255)",
|
|
179
|
+
display: "none"
|
|
180
|
+
},
|
|
181
|
+
children: /* @__PURE__ */ t("path", { d: "M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" })
|
|
182
|
+
}
|
|
183
|
+
)
|
|
184
|
+
}
|
|
185
|
+
)
|
|
186
|
+
},
|
|
187
|
+
`sub-color-${P}`
|
|
188
|
+
))
|
|
189
|
+
},
|
|
190
|
+
`color-row-${l}`
|
|
191
|
+
)),
|
|
192
|
+
/* @__PURE__ */ p("div", { children: [
|
|
193
|
+
/* @__PURE__ */ t("div", { className: "richtext-my-1 richtext-text-sm", children: r("editor.recent") }),
|
|
194
|
+
/* @__PURE__ */ t("span", { className: "richtext-relative richtext-flex richtext-h-auto richtext-w-full richtext-flex-wrap richtext-p-0 last:richtext-pb-2", children: g == null ? void 0 : g.map((i, l) => /* @__PURE__ */ t(
|
|
195
|
+
"span",
|
|
196
|
+
{
|
|
197
|
+
className: "richtext-inline-block richtext-size-6 richtext-flex-[0_0_auto] richtext-cursor-pointer richtext-rounded-sm !richtext-border richtext-border-transparent richtext-p-0.5 hover:richtext-border-border hover:richtext-shadow-sm",
|
|
198
|
+
onClick: () => s(i),
|
|
199
|
+
children: /* @__PURE__ */ t(
|
|
200
|
+
"span",
|
|
201
|
+
{
|
|
202
|
+
className: "richtext-relative richtext-block richtext-size-[18px] richtext-rounded-[2px] richtext-border-transparent",
|
|
203
|
+
style: {
|
|
204
|
+
backgroundColor: i
|
|
205
|
+
},
|
|
206
|
+
children: /* @__PURE__ */ t(
|
|
207
|
+
"svg",
|
|
208
|
+
{
|
|
209
|
+
viewBox: "0 0 18 18",
|
|
210
|
+
style: {
|
|
211
|
+
fill: "rgb(255, 255, 255)",
|
|
212
|
+
display: "none"
|
|
213
|
+
},
|
|
214
|
+
children: /* @__PURE__ */ t("path", { d: "M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" })
|
|
215
|
+
}
|
|
216
|
+
)
|
|
217
|
+
}
|
|
218
|
+
)
|
|
219
|
+
},
|
|
220
|
+
`sub-color-recent-${l}`
|
|
221
|
+
)) })
|
|
222
|
+
] }),
|
|
223
|
+
/* @__PURE__ */ t(Z, { setColor: s })
|
|
224
|
+
] })
|
|
225
|
+
}
|
|
226
|
+
)
|
|
227
|
+
] });
|
|
228
|
+
}
|
|
229
|
+
function Z({ setColor: e }) {
|
|
230
|
+
const { t: r } = N(), [c, d] = w(!1), [n, u] = w("#000000"), a = m((h) => {
|
|
231
|
+
u(h);
|
|
232
|
+
}, []);
|
|
233
|
+
return /* @__PURE__ */ p(z, { onOpenChange: d, open: c, children: [
|
|
234
|
+
/* @__PURE__ */ t(E, { asChild: !0, children: /* @__PURE__ */ p("div", { className: "richtext-p-1.5 richtext-text-sm hover:richtext-cursor-pointer hover:richtext-bg-accent", children: [
|
|
235
|
+
r("editor.color.more"),
|
|
236
|
+
"..."
|
|
237
|
+
] }) }),
|
|
238
|
+
/* @__PURE__ */ p(y, { children: [
|
|
239
|
+
/* @__PURE__ */ p("div", { className: "richtext-flex richtext-flex-col richtext-items-center richtext-justify-center", children: [
|
|
240
|
+
/* @__PURE__ */ t(
|
|
241
|
+
F,
|
|
242
|
+
{
|
|
243
|
+
color: n,
|
|
244
|
+
onChange: (h) => {
|
|
245
|
+
a(h);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
),
|
|
249
|
+
/* @__PURE__ */ t(
|
|
250
|
+
I,
|
|
251
|
+
{
|
|
252
|
+
className: "richtext-mt-[8px] richtext-w-full",
|
|
253
|
+
type: "text",
|
|
254
|
+
value: n.replace("#", ""),
|
|
255
|
+
onChange: (h) => {
|
|
256
|
+
h.preventDefault(), h.stopPropagation(), a(`#${h.target.value}`);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
)
|
|
260
|
+
] }),
|
|
261
|
+
/* @__PURE__ */ t(O, { className: "richtext-my-[10px]" }),
|
|
262
|
+
/* @__PURE__ */ t(
|
|
263
|
+
_,
|
|
264
|
+
{
|
|
265
|
+
className: "richtext-w-full",
|
|
266
|
+
onClick: (h) => {
|
|
267
|
+
h.preventDefault(), h.stopPropagation(), e(n), d(!1);
|
|
268
|
+
},
|
|
269
|
+
children: /* @__PURE__ */ t(k, { size: 16 })
|
|
270
|
+
}
|
|
271
|
+
)
|
|
272
|
+
] })
|
|
273
|
+
] });
|
|
274
|
+
}
|
|
275
|
+
const O = $.forwardRef(({ className: e, orientation: r = "horizontal", decorative: c = !0, ...d }, n) => /* @__PURE__ */ t(
|
|
276
|
+
R.Root,
|
|
277
|
+
{
|
|
278
|
+
ref: n,
|
|
279
|
+
decorative: c,
|
|
280
|
+
orientation: r,
|
|
281
|
+
className: T(
|
|
282
|
+
"richtext-shrink-0 richtext-bg-border",
|
|
283
|
+
r === "horizontal" ? "richtext-h-[1px] richtext-w-full" : "richtext-h-full richtext-w-[1px]",
|
|
284
|
+
e
|
|
285
|
+
),
|
|
286
|
+
...d
|
|
287
|
+
}
|
|
288
|
+
));
|
|
289
|
+
O.displayName = R.Root.displayName;
|
|
290
|
+
export {
|
|
291
|
+
X as C,
|
|
292
|
+
O as S
|
|
293
|
+
};
|
package/lib/store/editor.d.ts
CHANGED
|
@@ -18,4 +18,4 @@ export declare function useTiptapEditor(providedEditor?: Editor | null): {
|
|
|
18
18
|
declare function useEditorInstance(): Editor;
|
|
19
19
|
declare function useEditorState(): import('@tiptap/pm/state').EditorState | undefined;
|
|
20
20
|
declare function useCanCommand(): (() => import('@tiptap/core').CanCommands) | undefined;
|
|
21
|
-
export { useEditorInstance, useEditorState, useCanCommand
|
|
21
|
+
export { useEditorInstance, useEditorState, useCanCommand };
|
package/lib/store/store.d.ts
CHANGED
|
@@ -1,23 +1,3 @@
|
|
|
1
|
-
declare const ProviderUploadImage: ({ children }: {
|
|
2
|
-
children: React.ReactNode;
|
|
3
|
-
}) => import("react/jsx-runtime").JSX.Element, useStoreUploadImage: <SelectorOutput>(selector: (store: {
|
|
4
|
-
value: boolean;
|
|
5
|
-
}) => SelectorOutput) => [SelectorOutput, (value: Partial<{
|
|
6
|
-
value: boolean;
|
|
7
|
-
}>) => void];
|
|
8
|
-
declare const ProviderUploadVideo: ({ children }: {
|
|
9
|
-
children: React.ReactNode;
|
|
10
|
-
}) => import("react/jsx-runtime").JSX.Element, useStoreUploadVideo: <SelectorOutput>(selector: (store: {
|
|
11
|
-
value: boolean;
|
|
12
|
-
}) => SelectorOutput) => [SelectorOutput, (value: Partial<{
|
|
13
|
-
value: boolean;
|
|
14
|
-
}>) => void];
|
|
15
1
|
declare function useEditableEditor(): boolean;
|
|
16
|
-
declare function useStoreEditableEditor(): (val:
|
|
17
|
-
|
|
18
|
-
} | ((oldVal: {
|
|
19
|
-
value: boolean;
|
|
20
|
-
}) => {
|
|
21
|
-
value: boolean;
|
|
22
|
-
})) => void;
|
|
23
|
-
export { ProviderUploadImage, useStoreUploadImage, ProviderUploadVideo, useStoreUploadVideo, useStoreEditableEditor, useEditableEditor, };
|
|
2
|
+
declare function useStoreEditableEditor(): (val: boolean | ((oldVal: boolean) => boolean)) => void;
|
|
3
|
+
export { useStoreEditableEditor, useEditableEditor };
|