@remarkablejames/editor 0.0.4 → 0.0.6
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-BUtJUsfO.js → ActionMenuButton-CpmEfz31.js} +1 -1
- package/lib/{ActionMenuButton-M55VtCZ5.cjs → ActionMenuButton-NfiUDE60.cjs} +1 -1
- package/lib/Attachment.cjs +1 -19
- package/lib/Attachment.js +6 -305
- package/lib/Blockquote.cjs +2 -2
- package/lib/Blockquote.js +2 -2
- package/lib/Bold.cjs +1 -1
- package/lib/Bold.js +2 -2
- package/lib/BulletList.cjs +1 -1
- package/lib/BulletList.js +2 -2
- package/lib/Callout.cjs +1 -1
- package/lib/Callout.js +17 -18
- 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 +1 -1
- package/lib/CodeBlock.js +32 -33
- 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-mlmJ2nCT.js → Drawer-CayP4Ww4.js} +16 -16
- package/lib/{Drawer-CdQBnwUs.cjs → Drawer-DlgdaO_B.cjs} +2 -2
- package/lib/Drawer.cjs +1 -1
- package/lib/Drawer.js +3 -3
- package/lib/Emoji.cjs +1 -1
- package/lib/Emoji.js +12 -12
- package/lib/Excalidraw.cjs +1 -1
- package/lib/Excalidraw.js +29 -30
- 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 +5 -5
- package/lib/FontSize.cjs +1 -1
- package/lib/FontSize.js +5 -5
- package/lib/Heading.cjs +1 -1
- package/lib/Heading.js +10 -10
- package/lib/Highlight.cjs +1 -1
- package/lib/Highlight.js +3 -3
- package/lib/History.cjs +1 -1
- package/lib/History.js +3 -3
- package/lib/HorizontalRule.cjs +1 -1
- package/lib/HorizontalRule.js +2 -2
- package/lib/{Iframe-CYgR99Ny.js → Iframe-C6Sb97KS.js} +4 -5
- package/lib/Iframe-CANdxSpV.cjs +1 -0
- package/lib/Iframe.cjs +1 -1
- package/lib/Iframe.js +3 -3
- package/lib/Image.cjs +1 -1
- package/lib/Image.js +4 -4
- package/lib/ImageGif.cjs +1 -1
- package/lib/ImageGif.js +24 -24
- package/lib/ImportWord.cjs +1 -1
- package/lib/ImportWord.js +14 -14
- package/lib/{Indent-BMz2ILRl.js → Indent-CcFe8py3.js} +2 -2
- package/lib/{Indent-BAcoFdaq.cjs → Indent-DuB2U6Cs.cjs} +1 -1
- package/lib/Indent.cjs +1 -1
- package/lib/Indent.js +2 -2
- package/lib/Italic.cjs +1 -1
- package/lib/Italic.js +2 -2
- package/lib/{Katex-DOlb4iTP.js → Katex-Bp6AnIUF.js} +64 -65
- package/lib/Katex-DFU1unCm.cjs +4 -0
- package/lib/Katex.cjs +1 -1
- package/lib/Katex.js +2 -2
- package/lib/LineHeight.cjs +1 -1
- package/lib/LineHeight.js +4 -4
- package/lib/Link.cjs +1 -1
- package/lib/Link.js +2 -2
- package/lib/{LinkEditBlock-xnokk4G7.js → LinkEditBlock-BiHumIJR.js} +8 -8
- package/lib/{LinkEditBlock-Cqs5RxjV.cjs → LinkEditBlock-C2zX0WVK.cjs} +1 -1
- package/lib/Mention.js +3 -3
- package/lib/Mermaid-B8lQSOGn.cjs +2 -0
- package/lib/{Mermaid-Bs3pIGc6.js → Mermaid-Dlx0XTJj.js} +23 -24
- package/lib/Mermaid.cjs +1 -1
- package/lib/Mermaid.js +2 -2
- package/lib/MoreMark.cjs +1 -1
- package/lib/MoreMark.js +3 -3
- package/lib/OrderedList.cjs +1 -1
- package/lib/OrderedList.js +2 -2
- package/lib/PaywallSeparator.cjs +1 -0
- package/lib/PaywallSeparator.js +140 -0
- 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-BfWNWGRr.cjs +1 -0
- package/lib/{SlashCommandNodeView-CYcf7mVz.js → SlashCommandNodeView-DzmsYaNc.js} +73 -57
- package/lib/Strike.cjs +1 -1
- package/lib/Strike.js +2 -2
- package/lib/{Table-dlXTKKwJ.cjs → Table-BfM6ywrZ.cjs} +1 -1
- package/lib/{Table-bz1Wcojf.js → Table-IH34r4jd.js} +5 -5
- 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-CNTXzgt0.js → Twitter-FVQKPaq6.js} +8 -8
- package/lib/{Twitter-DhEnGg6P.cjs → Twitter-axcoCgD7.cjs} +1 -1
- package/lib/Twitter.cjs +1 -1
- package/lib/Twitter.js +2 -2
- package/lib/Video.cjs +1 -1
- package/lib/Video.js +5 -5
- package/lib/bubble.cjs +3 -3
- package/lib/bubble.js +84 -86
- package/lib/{clsx-CDyrfCnw.js → clsx-BUPZHhq3.js} +2 -2
- package/lib/components/SlashDialogTrigger/RenderDialogUploadAttachment.d.ts +1 -0
- package/lib/{dropdown-menu-BuSlU2uN.js → dropdown-menu-Ce2TorkG.js} +1 -1
- package/lib/{dropdown-menu-CfWNst4v.cjs → dropdown-menu-DirUyRAI.cjs} +1 -1
- package/lib/extensions/Attachment/Attachment.d.ts +17 -6
- package/lib/extensions/Attachment/components/NodeViewAttachment/NodeViewAttachment.d.ts +1 -1
- package/lib/extensions/PaywallSeparator/PaywallSeparator.d.ts +35 -0
- package/lib/extensions/PaywallSeparator/components/PaywallIcon.d.ts +2 -0
- package/lib/extensions/PaywallSeparator/components/PaywallSeparatorView.d.ts +17 -0
- package/lib/extensions/PaywallSeparator/components/RichTextPaywallSeparator.d.ts +1 -0
- package/lib/extensions/PaywallSeparator/components/index.d.ts +2 -0
- package/lib/extensions/PaywallSeparator/index.d.ts +1 -0
- package/lib/{index-DZfkCNKr.js → index-BGd2HiwP.js} +50 -20
- package/lib/index-BynXHtjJ.cjs +28 -0
- package/lib/{index-8B00E8e4.js → index-CnKgiZFQ.js} +1766 -1245
- package/lib/{index-CsSfYR30.js → index-D4M4hrH4.js} +1 -1
- package/lib/{index-DjDf4BK8.js → index-DZj2z9_1.js} +1 -1
- package/lib/index-DgOXAdKt.cjs +1 -0
- package/lib/{index-C1WCZhyA.js → index-Dl3OjzmR.js} +1 -1
- package/lib/{index-C-tDsIKJ.js → index-RkKGy5oa.js} +1 -1
- package/lib/index.cjs +3 -3
- package/lib/index.js +19 -19
- package/lib/locale-bundle.cjs +1 -1
- package/lib/locale-bundle.js +1 -1
- package/lib/locales/en.d.ts +5 -0
- package/lib/locales/fi.d.ts +5 -0
- package/lib/locales/hu.d.ts +5 -0
- package/lib/locales/index.d.ts +30 -0
- package/lib/locales/pt-br.d.ts +5 -0
- package/lib/locales/vi.d.ts +5 -0
- package/lib/locales/zh-cn.d.ts +5 -0
- package/lib/{popover-51mwx3UY.cjs → popover-BdLwAlrM.cjs} +1 -1
- package/lib/{popover-DMPRgXD3.js → popover-BzJyaFvy.js} +1 -1
- package/lib/{renderNodeView-BJSrgyGj.js → renderNodeView-dj6AaFSX.js} +2 -2
- package/lib/{separator-kB9YUfeO.cjs → separator-CoQaQmFK.cjs} +1 -1
- package/lib/{separator-CpqX9KQC.js → separator-D-fyzbfx.js} +14 -14
- package/lib/style.css +1 -1
- package/lib/types.d.ts +5 -5
- package/lib/{updatePosition-e90ZrFWW.js → updatePosition-C294Pixi.js} +2 -2
- package/lib/utils/customEvents/events.constant.d.ts +1 -0
- package/package.json +14 -1
- package/lib/Iframe-B_a_AoZc.cjs +0 -1
- package/lib/Katex-bIhj82VV.cjs +0 -4
- package/lib/Mermaid-DiOdgQv1.cjs +0 -2
- package/lib/SlashCommandNodeView-CLimjqhb.cjs +0 -1
- package/lib/dom-dataset-BqoJhJXt.cjs +0 -1
- package/lib/dom-dataset-CIEeltF6.js +0 -47
- package/lib/index-BrxL7y9p.cjs +0 -1
- package/lib/index-Bt9LiArC.cjs +0 -10
- package/lib/select-B7v1Scb-.cjs +0 -1
- package/lib/select-BxFDMaZi.js +0 -120
- package/lib/textarea-C5DsgzSy.js +0 -20
- package/lib/textarea-bQSzjqg3.cjs +0 -1
|
@@ -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-CnKgiZFQ.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"),
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),a=require("@radix-ui/react-slot"),d=require("react"),c=require("./index-BynXHtjJ.cjs");require("./theme.cjs");const s=d.forwardRef(({asChild:h=!1,tooltip:i,...t},l)=>{var n;const x=c.icons[t.icon],r=h?a.Slot:c.Button;return e.jsxs(c.Tooltip,{children:[e.jsx(c.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"})]})})}),i&&e.jsx(c.TooltipContent,{children:e.jsxs("div",{className:"richtext-flex richtext-max-w-24 richtext-flex-col richtext-items-center richtext-text-center",children:[i&&e.jsx("div",{children:i}),e.jsx("div",{className:"richtext-flex",children:!!((n=t==null?void 0:t.shortcutKeys)!=null&&n.length)&&e.jsx("span",{children:c.getShortcutKeys(t==null?void 0:t.shortcutKeys)})})]})})]})});exports.ActionMenuButton=s;
|
package/lib/Attachment.cjs
CHANGED
|
@@ -1,19 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
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
|
-
<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
|
-
</svg>`,word:`<svg
|
|
5
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
6
|
-
width="1em"
|
|
7
|
-
height="1em"
|
|
8
|
-
className="icon"
|
|
9
|
-
viewBox="0 0 1024 1024"
|
|
10
|
-
>
|
|
11
|
-
<path
|
|
12
|
-
fill="currentColor"
|
|
13
|
-
d="M679.253 402.364 618.77 561.015l-60.348-158.651a30.04 30.04 0 0 0-30.447-18.637 29.76 29.76 0 0 0-30.447 18.637l-60.416 158.651-60.416-158.651a30.515 30.515 0 0 0-38.843-17.272 28.945 28.945 0 0 0-17.954 37.547l88.815 233.267c4.369 11.469 15.7 19.115 28.398 19.115a30.31 30.31 0 0 0 28.468-19.115l62.395-163.908 62.396 163.84c4.437 11.605 15.701 19.183 28.4 19.183a30.31 30.31 0 0 0 28.466-19.115l88.747-233.267a28.945 28.945 0 0 0-17.886-37.547 30.447 30.447 0 0 0-38.912 17.272zm219.478 395.605-51.883-29.218c-28.672-16.18-52.224-3.072-52.224 29.082v.273H643.209a29.833 29.833 0 0 0-30.31 29.354c0 16.18 13.584 29.218 30.31 29.218h151.825c1.092 30.516 24.03 43.077 52.224 27.648l51.063-27.989c29.013-15.906 29.15-42.189.41-58.368"
|
|
14
|
-
/>
|
|
15
|
-
<path
|
|
16
|
-
fill="currentColor"
|
|
17
|
-
d="m810.667 913.135-.478.068H201.796c-19.865 0-36.727-11.673-36.727-25.6v-618.36h154.965c51.268 0 92.911-39.39 92.911-87.858v-87.86H810.19c19.797 0 36.522 11.742 36.522 25.669V739.26h61.987V119.262c0-46.421-44.169-84.241-98.51-84.241H328.364l-225.28 194.56v658.09c0 46.285 44.236 84.105 98.713 84.105H810.19c43.759 0 80.554-24.713 93.32-58.573h-92.842zM350.89 94.89v86.562c0 16.11-13.858 29.286-30.925 29.286H216.815L350.959 94.891z"
|
|
18
|
-
/>
|
|
19
|
-
</svg>`,excel:'<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-sheet"><rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><line x1="3" x2="21" y1="9" y2="9"/><line x1="3" x2="21" y1="15" y2="15"/><line x1="9" x2="9" y1="9" y2="21"/><line x1="15" x2="15" y1="9" y2="21"/></svg>',ppt:'<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-table-properties"><path d="M15 3v18"/><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M21 9H3"/><path d="M21 15H3"/></svg>'};function I(t){const s=P[t],o=new DOMParser().parseFromString(s,"image/svg+xml").documentElement,l=["svg",{...Array.from(o.attributes).reduce((r,c)=>(r[c.name]=c.value,r),{})}];return Array.from(o.childNodes).forEach(r=>{if(r.nodeType===1){const c=[r.tagName.toLowerCase(),Array.from(r.attributes).reduce((p,m)=>(p[m.name]=m.value,p),{})];r.textContent&&c.push(r.textContent),l.push(c)}}),l}const R={audio:e.jsx(w.LucideAudioLines,{}),video:e.jsx(w.LucideVideo,{}),file:e.jsx(w.LucideFile,{}),image:e.jsx(w.LucideImage,{}),pdf:e.jsx(n.ExportPdf,{}),word:e.jsx(n.ExportWord,{}),excel:e.jsx(w.LucideSheet,{}),ppt:e.jsx(w.LucideTableProperties,{})};function H(t,s=!1){const i=n.normalizeFileType(t),d=R[i]||e.jsx(e.Fragment,{});return s?I(i):d}const q="_wrap_1is0r_5",W="_placeholder_1is0r_44",$="_placeholderText_1is0r_53",O="_card_1is0r_64",Z="_downloadBtn_1is0r_82",K="_cardLeft_1is0r_88",G="_iconWrap_1is0r_97",J="_fileInfo_1is0r_116",Q="_fileName_1is0r_123",U="_fileSize_1is0r_133",X="_cardPreview_1is0r_145",Y="_actions_1is0r_221",ee="_cardError_1is0r_236",te="_errorText_1is0r_240",a={wrap:q,placeholder:W,placeholderText:$,card:O,downloadBtn:Z,cardLeft:K,iconWrap:G,fileInfo:J,fileName:Q,fileSize:U,cardPreview:X,actions:Y,cardError:ee,errorText:te};function re({editor:t,node:s,updateAttributes:i,deleteNode:d,extension:o}){var L,C;const l=f.useRef(null),r=(t==null?void 0:t.isEditable)??!1,{hasTrigger:c,fileName:p,fileSize:m,fileExt:k,fileType:A,id:h,error:M}=s.attrs,[E,_]=f.useState(!1),{t:j}=V.useLocale(),b=(L=o==null?void 0:o.options)==null?void 0:L.upload,y=(C=o==null?void 0:o.options)==null?void 0:C.onDownload,N=f.useCallback(()=>{var x;!r||h||(x=l.current)==null||x.click()},[h,r]),B=f.useCallback(async x=>{const g=x.target.files&&x.target.files[0];if(!g)return;const F={fileName:n.extractFilename(g.name),fileSize:g.size,fileType:g.type,fileExt:n.extractFileExtension(g.name)};_(!0);try{const T=await b(g);i({...F,id:T}),_(!1)}catch(T){i({error:`File upload fail: ${T&&T.message}`}),_(!1),l.current&&(l.current.value="")}},[_,i,b]);f.useEffect(()=>{!h&&!c&&(N(),i({hasTrigger:!0}))},[h,c,N,i]);const D=f.useCallback(()=>d(),[d]),S=f.useCallback(()=>{!h||!y||y({id:h,fileName:p,fileExt:k,fileType:A,fileSize:m})},[h,p,k,A,m,y]);return r&&!h?e.jsx(u.NodeViewWrapper,{children:e.jsxs("div",{className:u.clsx(a.wrap,a.placeholder,"render-wrapper"),children:[e.jsx("p",{onClick:N,className:a.placeholderText,children:E?e.jsx("span",{children:j("editor.attachment.uploading")}):e.jsx("span",{children:j("editor.attachment.please_upload")})}),e.jsx("input",{hidden:!0,onChange:B,ref:l,type:"file"})]})}):h?e.jsx(u.NodeViewWrapper,{children:e.jsxs("div",{className:u.clsx(a.card,"render-wrapper",{[a.cardPreview]:!r}),children:[e.jsxs("div",{className:a.cardLeft,children:[e.jsx("div",{className:a.iconWrap,children:H(A)}),e.jsxs("div",{className:a.fileInfo,children:[e.jsxs("span",{className:a.fileName,children:[p,".",k]}),e.jsx("span",{className:a.fileSize,children:n.normalizeFileSize(m)})]})]}),e.jsxs("div",{className:a.actions,children:[y&&e.jsx(n.ActionButton,{action:S,icon:"AttachmentDownload",tooltip:j("editor.attachment.download"),customClass:r?void 0:a.downloadBtn}),r&&e.jsx(n.ActionButton,{action:D,icon:"Trash2",tooltip:j("editor.delete")})]})]})}):M&&M!=="null"?e.jsx(u.NodeViewWrapper,{children:e.jsx("div",{className:u.clsx(a.card,a.cardError,"render-wrapper"),children:e.jsx("p",{className:a.errorText,children:M})})}):e.jsx(e.Fragment,{})}function ie(){const t=n.useButtonProps(z.name),{icon:s=void 0,tooltip:i=void 0,shortcutKeys:d=void 0,tooltipOptions:o={},action:l=void 0,isActive:r=void 0}=(t==null?void 0:t.componentProps)??{},{editorDisabled:c,update:p}=n.useToggleActive(r),m=()=>{c||l&&(l(),p())};return t?e.jsx(n.ActionButton,{action:m,disabled:c,icon:s,shortcutKeys:d,tooltip:i,tooltipOptions:o}):e.jsx(e.Fragment,{})}const z=u.Node3.create({name:"attachment",content:"",marks:"",group:"block",selectable:!0,atom:!0,draggable:!0,addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),HTMLAttributes:{class:"attachment"},button:({editor:s,t:i})=>({component:n.ActionButton,componentProps:{action:()=>s.chain().focus().setAttachment().run(),isActive:()=>!1,disabled:!1,icon:"Attachment",tooltip:i("editor.attachment.tooltip")}})}},parseHTML(){return[{tag:"div[class=attachment]"}]},renderHTML({HTMLAttributes:t}){const{id:s="",fileName:i="",fileSize:d="",fileType:o="",fileExt:l=""}=t||{};return["div",u.mergeAttributes(this.options.HTMLAttributes||{},t||{}),s?["span",{class:"attachment__body"},["span",{class:"attachment__icon"},H(o,!0)],["span",{class:"attachment__text"},`${i}.${l} (${n.normalizeFileSize(d)})`]]:["div",{class:"attachment__placeholder"}]]},addAttributes(){return{id:{default:null,parseHTML:v.getDatasetAttribute("id")},fileName:{default:null,parseHTML:v.getDatasetAttribute("filename")},fileSize:{default:null,parseHTML:v.getDatasetAttribute("filesize")},fileType:{default:null,parseHTML:v.getDatasetAttribute("filetype")},fileExt:{default:null,parseHTML:v.getDatasetAttribute("fileext")},hasTrigger:{default:!1,parseHTML:t=>v.getDatasetAttribute("hastrigger")(t)==="true"},error:{default:null,parseHTML:v.getDatasetAttribute("error")}}},addCommands(){return{setAttachment:(t={})=>({chain:s})=>s().insertContent({type:this.name,attrs:t}).run()}},addNodeView(){return u.ReactNodeViewRenderer(re)}});exports.Attachment=z;exports.RichTextAttachment=ie;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./clsx-CXbNJWDD.cjs");const e=require("./index-BynXHtjJ.cjs");require("react/jsx-runtime");require("react");require("./theme.cjs");exports.Attachment=e.Attachment;exports.RichTextAttachment=e.RichTextAttachment;
|
package/lib/Attachment.js
CHANGED
|
@@ -1,308 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import "./clsx-BUPZHhq3.js";
|
|
2
|
+
import { a2 as p, a3 as e } from "./index-CnKgiZFQ.js";
|
|
3
|
+
import "react/jsx-runtime";
|
|
4
|
+
import "react";
|
|
5
5
|
import "./theme.js";
|
|
6
|
-
import { LucideTableProperties as Y, LucideSheet as ee, LucideImage as te, LucideFile as re, LucideVideo as ie, LucideAudioLines as oe } from "lucide-react";
|
|
7
|
-
import { u as ae } from "./index-DZfkCNKr.js";
|
|
8
|
-
import { g as u } from "./dom-dataset-CIEeltF6.js";
|
|
9
|
-
const ne = {
|
|
10
|
-
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>',
|
|
11
|
-
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>',
|
|
12
|
-
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>',
|
|
13
|
-
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>',
|
|
14
|
-
pdf: `<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 32 32">
|
|
15
|
-
<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>
|
|
16
|
-
<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>
|
|
17
|
-
</svg>`,
|
|
18
|
-
word: `<svg
|
|
19
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
20
|
-
width="1em"
|
|
21
|
-
height="1em"
|
|
22
|
-
className="icon"
|
|
23
|
-
viewBox="0 0 1024 1024"
|
|
24
|
-
>
|
|
25
|
-
<path
|
|
26
|
-
fill="currentColor"
|
|
27
|
-
d="M679.253 402.364 618.77 561.015l-60.348-158.651a30.04 30.04 0 0 0-30.447-18.637 29.76 29.76 0 0 0-30.447 18.637l-60.416 158.651-60.416-158.651a30.515 30.515 0 0 0-38.843-17.272 28.945 28.945 0 0 0-17.954 37.547l88.815 233.267c4.369 11.469 15.7 19.115 28.398 19.115a30.31 30.31 0 0 0 28.468-19.115l62.395-163.908 62.396 163.84c4.437 11.605 15.701 19.183 28.4 19.183a30.31 30.31 0 0 0 28.466-19.115l88.747-233.267a28.945 28.945 0 0 0-17.886-37.547 30.447 30.447 0 0 0-38.912 17.272zm219.478 395.605-51.883-29.218c-28.672-16.18-52.224-3.072-52.224 29.082v.273H643.209a29.833 29.833 0 0 0-30.31 29.354c0 16.18 13.584 29.218 30.31 29.218h151.825c1.092 30.516 24.03 43.077 52.224 27.648l51.063-27.989c29.013-15.906 29.15-42.189.41-58.368"
|
|
28
|
-
/>
|
|
29
|
-
<path
|
|
30
|
-
fill="currentColor"
|
|
31
|
-
d="m810.667 913.135-.478.068H201.796c-19.865 0-36.727-11.673-36.727-25.6v-618.36h154.965c51.268 0 92.911-39.39 92.911-87.858v-87.86H810.19c19.797 0 36.522 11.742 36.522 25.669V739.26h61.987V119.262c0-46.421-44.169-84.241-98.51-84.241H328.364l-225.28 194.56v658.09c0 46.285 44.236 84.105 98.713 84.105H810.19c43.759 0 80.554-24.713 93.32-58.573h-92.842zM350.89 94.89v86.562c0 16.11-13.858 29.286-30.925 29.286H216.815L350.959 94.891z"
|
|
32
|
-
/>
|
|
33
|
-
</svg>`,
|
|
34
|
-
excel: '<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-sheet"><rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><line x1="3" x2="21" y1="9" y2="9"/><line x1="3" x2="21" y1="15" y2="15"/><line x1="9" x2="9" y1="9" y2="21"/><line x1="15" x2="15" y1="9" y2="21"/></svg>',
|
|
35
|
-
ppt: '<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-table-properties"><path d="M15 3v18"/><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M21 9H3"/><path d="M21 15H3"/></svg>'
|
|
36
|
-
};
|
|
37
|
-
function se(t) {
|
|
38
|
-
const a = ne[t], n = new DOMParser().parseFromString(a, "image/svg+xml").documentElement, s = [
|
|
39
|
-
"svg",
|
|
40
|
-
{
|
|
41
|
-
...Array.from(n.attributes).reduce((r, l) => (r[l.name] = l.value, r), {})
|
|
42
|
-
}
|
|
43
|
-
];
|
|
44
|
-
return Array.from(n.childNodes).forEach((r) => {
|
|
45
|
-
if (r.nodeType === 1) {
|
|
46
|
-
const l = [
|
|
47
|
-
r.tagName.toLowerCase(),
|
|
48
|
-
Array.from(r.attributes).reduce((h, p) => (h[p.name] = p.value, h), {})
|
|
49
|
-
];
|
|
50
|
-
r.textContent && l.push(r.textContent), s.push(l);
|
|
51
|
-
}
|
|
52
|
-
}), s;
|
|
53
|
-
}
|
|
54
|
-
const le = {
|
|
55
|
-
audio: /* @__PURE__ */ e(oe, {}),
|
|
56
|
-
video: /* @__PURE__ */ e(ie, {}),
|
|
57
|
-
file: /* @__PURE__ */ e(re, {}),
|
|
58
|
-
image: /* @__PURE__ */ e(te, {}),
|
|
59
|
-
pdf: /* @__PURE__ */ e(Z, {}),
|
|
60
|
-
word: /* @__PURE__ */ e(O, {}),
|
|
61
|
-
excel: /* @__PURE__ */ e(ee, {}),
|
|
62
|
-
ppt: /* @__PURE__ */ e(Y, {})
|
|
63
|
-
};
|
|
64
|
-
function S(t, a = !1) {
|
|
65
|
-
const i = $(t), c = le[i] || /* @__PURE__ */ e(z, {});
|
|
66
|
-
return a ? se(i) : c;
|
|
67
|
-
}
|
|
68
|
-
const ce = "_wrap_1is0r_5", de = "_placeholder_1is0r_44", he = "_placeholderText_1is0r_53", pe = "_card_1is0r_64", ue = "_downloadBtn_1is0r_82", me = "_cardLeft_1is0r_88", fe = "_iconWrap_1is0r_97", ve = "_fileInfo_1is0r_116", ge = "_fileName_1is0r_123", we = "_fileSize_1is0r_133", xe = "_cardPreview_1is0r_145", _e = "_actions_1is0r_221", ye = "_cardError_1is0r_236", Te = "_errorText_1is0r_240", o = {
|
|
69
|
-
wrap: ce,
|
|
70
|
-
placeholder: de,
|
|
71
|
-
placeholderText: he,
|
|
72
|
-
card: pe,
|
|
73
|
-
downloadBtn: ue,
|
|
74
|
-
cardLeft: me,
|
|
75
|
-
iconWrap: fe,
|
|
76
|
-
fileInfo: ve,
|
|
77
|
-
fileName: ge,
|
|
78
|
-
fileSize: we,
|
|
79
|
-
cardPreview: xe,
|
|
80
|
-
actions: _e,
|
|
81
|
-
cardError: ye,
|
|
82
|
-
errorText: Te
|
|
83
|
-
};
|
|
84
|
-
function ke({
|
|
85
|
-
editor: t,
|
|
86
|
-
node: a,
|
|
87
|
-
updateAttributes: i,
|
|
88
|
-
deleteNode: c,
|
|
89
|
-
extension: n
|
|
90
|
-
}) {
|
|
91
|
-
var E, b;
|
|
92
|
-
const s = J(null), r = (t == null ? void 0 : t.isEditable) ?? !1, { hasTrigger: l, fileName: h, fileSize: p, fileExt: k, fileType: N, id: d, error: L } = a.attrs, [F, g] = U(!1), { t: w } = ae(), C = (E = n == null ? void 0 : n.options) == null ? void 0 : E.upload, x = (b = n == null ? void 0 : n.options) == null ? void 0 : b.onDownload, M = y(() => {
|
|
93
|
-
var v;
|
|
94
|
-
!r || d || (v = s.current) == null || v.click();
|
|
95
|
-
}, [d, r]), V = y(
|
|
96
|
-
async (v) => {
|
|
97
|
-
const m = v.target.files && v.target.files[0];
|
|
98
|
-
if (!m) return;
|
|
99
|
-
const j = {
|
|
100
|
-
fileName: Q(m.name),
|
|
101
|
-
fileSize: m.size,
|
|
102
|
-
fileType: m.type,
|
|
103
|
-
fileExt: K(m.name)
|
|
104
|
-
};
|
|
105
|
-
g(!0);
|
|
106
|
-
try {
|
|
107
|
-
const _ = await C(m);
|
|
108
|
-
i({ ...j, id: _ }), g(!1);
|
|
109
|
-
} catch (_) {
|
|
110
|
-
i({
|
|
111
|
-
error: `File upload fail: ${_ && _.message}`
|
|
112
|
-
}), g(!1), s.current && (s.current.value = "");
|
|
113
|
-
}
|
|
114
|
-
},
|
|
115
|
-
[g, i, C]
|
|
116
|
-
);
|
|
117
|
-
X(() => {
|
|
118
|
-
!d && !l && (M(), i({ hasTrigger: !0 }));
|
|
119
|
-
}, [d, l, M, i]);
|
|
120
|
-
const P = y(() => c(), [c]), D = y(() => {
|
|
121
|
-
!d || !x || x({ id: d, fileName: h, fileExt: k, fileType: N, fileSize: p });
|
|
122
|
-
}, [d, h, k, N, p, x]);
|
|
123
|
-
return r && !d ? /* @__PURE__ */ e(H, { children: /* @__PURE__ */ f(
|
|
124
|
-
"div",
|
|
125
|
-
{
|
|
126
|
-
className: A(o.wrap, o.placeholder, "render-wrapper"),
|
|
127
|
-
children: [
|
|
128
|
-
/* @__PURE__ */ e("p", { onClick: M, className: o.placeholderText, children: F ? /* @__PURE__ */ e("span", { children: w("editor.attachment.uploading") }) : /* @__PURE__ */ e("span", { children: w("editor.attachment.please_upload") }) }),
|
|
129
|
-
/* @__PURE__ */ e("input", { hidden: !0, onChange: V, ref: s, type: "file" })
|
|
130
|
-
]
|
|
131
|
-
}
|
|
132
|
-
) }) : d ? /* @__PURE__ */ e(H, { children: /* @__PURE__ */ f(
|
|
133
|
-
"div",
|
|
134
|
-
{
|
|
135
|
-
className: A(o.card, "render-wrapper", {
|
|
136
|
-
[o.cardPreview]: !r
|
|
137
|
-
}),
|
|
138
|
-
children: [
|
|
139
|
-
/* @__PURE__ */ f("div", { className: o.cardLeft, children: [
|
|
140
|
-
/* @__PURE__ */ e("div", { className: o.iconWrap, children: S(N) }),
|
|
141
|
-
/* @__PURE__ */ f("div", { className: o.fileInfo, children: [
|
|
142
|
-
/* @__PURE__ */ f("span", { className: o.fileName, children: [
|
|
143
|
-
h,
|
|
144
|
-
".",
|
|
145
|
-
k
|
|
146
|
-
] }),
|
|
147
|
-
/* @__PURE__ */ e("span", { className: o.fileSize, children: B(p) })
|
|
148
|
-
] })
|
|
149
|
-
] }),
|
|
150
|
-
/* @__PURE__ */ f("div", { className: o.actions, children: [
|
|
151
|
-
x && /* @__PURE__ */ e(
|
|
152
|
-
T,
|
|
153
|
-
{
|
|
154
|
-
action: D,
|
|
155
|
-
icon: "AttachmentDownload",
|
|
156
|
-
tooltip: w("editor.attachment.download"),
|
|
157
|
-
customClass: r ? void 0 : o.downloadBtn
|
|
158
|
-
}
|
|
159
|
-
),
|
|
160
|
-
r && /* @__PURE__ */ e(
|
|
161
|
-
T,
|
|
162
|
-
{
|
|
163
|
-
action: P,
|
|
164
|
-
icon: "Trash2",
|
|
165
|
-
tooltip: w("editor.delete")
|
|
166
|
-
}
|
|
167
|
-
)
|
|
168
|
-
] })
|
|
169
|
-
]
|
|
170
|
-
}
|
|
171
|
-
) }) : L && L !== "null" ? /* @__PURE__ */ e(H, { children: /* @__PURE__ */ e("div", { className: A(o.card, o.cardError, "render-wrapper"), children: /* @__PURE__ */ e("p", { className: o.errorText, children: L }) }) }) : /* @__PURE__ */ e(z, {});
|
|
172
|
-
}
|
|
173
|
-
function Be() {
|
|
174
|
-
const t = q(Ne.name), {
|
|
175
|
-
icon: a = void 0,
|
|
176
|
-
tooltip: i = void 0,
|
|
177
|
-
shortcutKeys: c = void 0,
|
|
178
|
-
tooltipOptions: n = {},
|
|
179
|
-
action: s = void 0,
|
|
180
|
-
isActive: r = void 0
|
|
181
|
-
} = (t == null ? void 0 : t.componentProps) ?? {}, { editorDisabled: l, update: h } = G(r), p = () => {
|
|
182
|
-
l || s && (s(), h());
|
|
183
|
-
};
|
|
184
|
-
return t ? /* @__PURE__ */ e(
|
|
185
|
-
T,
|
|
186
|
-
{
|
|
187
|
-
action: p,
|
|
188
|
-
disabled: l,
|
|
189
|
-
icon: a,
|
|
190
|
-
shortcutKeys: c,
|
|
191
|
-
tooltip: i,
|
|
192
|
-
tooltipOptions: n
|
|
193
|
-
}
|
|
194
|
-
) : /* @__PURE__ */ e(z, {});
|
|
195
|
-
}
|
|
196
|
-
const Ne = /* @__PURE__ */ I.create({
|
|
197
|
-
name: "attachment",
|
|
198
|
-
content: "",
|
|
199
|
-
marks: "",
|
|
200
|
-
group: "block",
|
|
201
|
-
selectable: !0,
|
|
202
|
-
atom: !0,
|
|
203
|
-
draggable: !0,
|
|
204
|
-
//@ts-expect-error
|
|
205
|
-
addOptions() {
|
|
206
|
-
var t;
|
|
207
|
-
return {
|
|
208
|
-
...(t = this.parent) == null ? void 0 : t.call(this),
|
|
209
|
-
HTMLAttributes: {
|
|
210
|
-
class: "attachment"
|
|
211
|
-
},
|
|
212
|
-
button: ({ editor: a, t: i }) => ({
|
|
213
|
-
component: T,
|
|
214
|
-
componentProps: {
|
|
215
|
-
action: () => a.chain().focus().setAttachment().run(),
|
|
216
|
-
isActive: () => !1,
|
|
217
|
-
disabled: !1,
|
|
218
|
-
icon: "Attachment",
|
|
219
|
-
tooltip: i("editor.attachment.tooltip")
|
|
220
|
-
}
|
|
221
|
-
})
|
|
222
|
-
};
|
|
223
|
-
},
|
|
224
|
-
parseHTML() {
|
|
225
|
-
return [{ tag: "div[class=attachment]" }];
|
|
226
|
-
},
|
|
227
|
-
renderHTML({ HTMLAttributes: t }) {
|
|
228
|
-
const {
|
|
229
|
-
id: a = "",
|
|
230
|
-
fileName: i = "",
|
|
231
|
-
fileSize: c = "",
|
|
232
|
-
fileType: n = "",
|
|
233
|
-
fileExt: s = ""
|
|
234
|
-
} = t || {};
|
|
235
|
-
return [
|
|
236
|
-
"div",
|
|
237
|
-
W(
|
|
238
|
-
// @ts-expect-error
|
|
239
|
-
this.options.HTMLAttributes || {},
|
|
240
|
-
t || {}
|
|
241
|
-
),
|
|
242
|
-
a ? [
|
|
243
|
-
"span",
|
|
244
|
-
{ class: "attachment__body" },
|
|
245
|
-
[
|
|
246
|
-
"span",
|
|
247
|
-
{ class: "attachment__icon" },
|
|
248
|
-
S(n, !0)
|
|
249
|
-
],
|
|
250
|
-
[
|
|
251
|
-
"span",
|
|
252
|
-
{ class: "attachment__text" },
|
|
253
|
-
`${i}.${s} (${B(c)})`
|
|
254
|
-
]
|
|
255
|
-
] : ["div", { class: "attachment__placeholder" }]
|
|
256
|
-
];
|
|
257
|
-
},
|
|
258
|
-
addAttributes() {
|
|
259
|
-
return {
|
|
260
|
-
/**
|
|
261
|
-
* The UUID / primary key your backend assigned to this asset.
|
|
262
|
-
* This is the only persistent reference stored in the document.
|
|
263
|
-
* Use it server-side to look up, stream, delete, or generate a
|
|
264
|
-
* signed download URL for the file.
|
|
265
|
-
*/
|
|
266
|
-
id: {
|
|
267
|
-
default: null,
|
|
268
|
-
parseHTML: u("id")
|
|
269
|
-
},
|
|
270
|
-
fileName: {
|
|
271
|
-
default: null,
|
|
272
|
-
parseHTML: u("filename")
|
|
273
|
-
},
|
|
274
|
-
fileSize: {
|
|
275
|
-
default: null,
|
|
276
|
-
parseHTML: u("filesize")
|
|
277
|
-
},
|
|
278
|
-
fileType: {
|
|
279
|
-
default: null,
|
|
280
|
-
parseHTML: u("filetype")
|
|
281
|
-
},
|
|
282
|
-
fileExt: {
|
|
283
|
-
default: null,
|
|
284
|
-
parseHTML: u("fileext")
|
|
285
|
-
},
|
|
286
|
-
hasTrigger: {
|
|
287
|
-
default: !1,
|
|
288
|
-
parseHTML: (t) => u("hastrigger")(t) === "true"
|
|
289
|
-
},
|
|
290
|
-
error: {
|
|
291
|
-
default: null,
|
|
292
|
-
parseHTML: u("error")
|
|
293
|
-
}
|
|
294
|
-
};
|
|
295
|
-
},
|
|
296
|
-
addCommands() {
|
|
297
|
-
return {
|
|
298
|
-
setAttachment: (t = {}) => ({ chain: a }) => a().insertContent({ type: this.name, attrs: t }).run()
|
|
299
|
-
};
|
|
300
|
-
},
|
|
301
|
-
addNodeView() {
|
|
302
|
-
return R(ke);
|
|
303
|
-
}
|
|
304
|
-
});
|
|
305
6
|
export {
|
|
306
|
-
|
|
307
|
-
|
|
7
|
+
p as Attachment,
|
|
8
|
+
e as RichTextAttachment
|
|
308
9
|
};
|
package/lib/Blockquote.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./clsx-CXbNJWDD.cjs"),p=require("./jsx-runtime-C_NLcKys.cjs"),l=require("react/jsx-runtime"),a=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./clsx-CXbNJWDD.cjs"),p=require("./jsx-runtime-C_NLcKys.cjs"),l=require("react/jsx-runtime"),a=require("./index-BynXHtjJ.cjs");require("react");require("./theme.cjs");var m=/^\s*>\s$/,g=c.Node3.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return p.h("blockquote",{...c.mergeAttributes(this.options.HTMLAttributes,t),children:p.h("slot",{})})},parseMarkdown:(t,e)=>e.createNode("blockquote",void 0,e.parseChildren(t.tokens||[])),renderMarkdown:(t,e)=>{if(!t.content)return"";const o=">",n=[];return t.content.forEach(i=>{const u=e.renderChildren([i]).split(`
|
|
2
2
|
`).map(r=>r.trim()===""?o:`${o} ${r}`);n.push(u.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[c.wrappingInputRule({find:
|
|
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[c.wrappingInputRule({find:m,type:this.type})]}});function b(){const t=a.useButtonProps(h.name),{icon:e=void 0,tooltip:o=void 0,shortcutKeys:n=void 0,tooltipOptions:i={},action:s=void 0,isActive:d=void 0}=(t==null?void 0:t.componentProps)??{},{dataState:u,disabled:r,update:q}=a.useToggleActive(d),k=()=>{r||s&&(s(),q())};return t?l.jsx(a.ActionButton,{action:k,dataState:u,disabled:r,icon:e,shortcutKeys:n,tooltip:o,tooltipOptions:i}):l.jsx(l.Fragment,{})}const h=g.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=h;exports.RichTextBlockquote=b;
|
package/lib/Blockquote.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { N as m, w as h, m as k } from "./clsx-
|
|
1
|
+
import { N as m, w as h, m as k } from "./clsx-BUPZHhq3.js";
|
|
2
2
|
import { h as a } from "./jsx-runtime-CT7Pcg-t.js";
|
|
3
3
|
import { jsx as d, Fragment as g } from "react/jsx-runtime";
|
|
4
|
-
import { u as f, d as b, A as q } from "./index-
|
|
4
|
+
import { u as f, d as b, A as q } from "./index-CnKgiZFQ.js";
|
|
5
5
|
import "react";
|
|
6
6
|
import "./theme.js";
|
|
7
7
|
var v = /^\s*>\s$/, B = m.create({
|
package/lib/Bold.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./clsx-CXbNJWDD.cjs"),u=require("./jsx-runtime-C_NLcKys.cjs"),r=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./clsx-CXbNJWDD.cjs"),u=require("./jsx-runtime-C_NLcKys.cjs"),r=require("./index-BynXHtjJ.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||[])),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=r.useButtonProps(l.name),{icon:e=void 0,tooltip:n=void 0,shortcutKeys:s=void 0,tooltipOptions:c={},action:a=void 0,isActive:p=void 0}=(t==null?void 0:t.componentProps)??{},{dataState:g,disabled:d,update:m}=r.useToggleActive(p),h=()=>{d||a&&(a(),m())};return t?i.jsx(r.ActionButton,{action:h,dataState:g,disabled:d,icon:e,shortcutKeys:s,tooltip:n,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:n,extension:s})=>({component:r.ActionButton,componentProps:{action:()=>e.commands.toggleBold(),isActive:()=>e.isActive("bold"),icon:"Bold",shortcutKeys:s.options.shortcutKeys??["mod","B"],tooltip:n("editor.bold.tooltip")}})}}});exports.Bold=l;exports.RichTextBold=M;
|
package/lib/Bold.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { M as _, e as a, f as i, m as y } from "./clsx-
|
|
1
|
+
import { M as _, e as a, f as i, m as y } from "./clsx-BUPZHhq3.js";
|
|
2
2
|
import { h as d } from "./jsx-runtime-CT7Pcg-t.js";
|
|
3
|
-
import { u as f, d as M, A as l } from "./index-
|
|
3
|
+
import { u as f, d as M, A as l } from "./index-CnKgiZFQ.js";
|
|
4
4
|
import { jsx as u, Fragment as v } from "react/jsx-runtime";
|
|
5
5
|
import "react";
|
|
6
6
|
import "./theme.js";
|
package/lib/BulletList.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("./index-BCzvbrf5.cjs"),s=require("react/jsx-runtime"),n=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("./index-BCzvbrf5.cjs"),s=require("react/jsx-runtime"),n=require("./index-BynXHtjJ.cjs");require("react");require("./theme.cjs");function h(){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=h;
|
package/lib/BulletList.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { B as d } from "./index-
|
|
1
|
+
import { B as d } from "./index-DZj2z9_1.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-CnKgiZFQ.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 a=require("./clsx-CXbNJWDD.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./clsx-CXbNJWDD.cjs"),e=require("./index-BynXHtjJ.cjs"),t=require("react/jsx-runtime"),h=require("react");require("./theme.cjs");const c=require("lucide-react"),O=require("./index-DgOXAdKt.cjs"),m=[{value:"note",label:"Note",icon:c.Info,color:"#1f6feb",background:"#1f6feb1f"},{value:"tip",label:"Tip",icon:c.Lightbulb,color:"#238636",background:"#2386361f"},{value:"important",label:"Important",icon:c.AlertCircle,color:"#ab7df8",background:"#ab7df81f"},{value:"warning",label:"Warning",icon:c.TriangleAlert,color:"#d29922",background:"#d299221f"},{value:"caution",label:"Caution",icon:c.OctagonAlert,color:"#f85149",background:"#f851491f"}];function k({node:l}){const{type:o="note",title:i="",body:s=""}=l.attrs,u=(m.find(d=>d.value===o)||m[0]).icon;return t.jsx(a.NodeViewWrapper,{children:t.jsxs("div",{className:a.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:a.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(u,{className:"richtext-size-5"}),t.jsx("span",{className:"richtext-font-semibold",children:i})]}),s&&t.jsx("p",{className:"richtext-pl-[28px]",children:s})]})})}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}=O.useLocale(),o=e.useEditorInstance(),i=e.useButtonProps(j.name),[s,n]=h.useState(!1),[u,d]=h.useState("note"),[p,b]=h.useState(""),[g,f]=h.useState(""),{icon:C=void 0,tooltip:y=void 0,shortcutKeys:T=void 0,tooltipOptions:A={},isActive:L=void 0}=(i==null?void 0:i.componentProps)??{},{dataState:N,disabled:v}=e.useToggleActive(L),S=()=>{o&&(o.chain().focus().setCallout({type:u,title:p,body:g}).run(),n(!1),d("note"),b(""),f(""))},I=()=>{v||n(!0)};return i?t.jsxs(e.Dialog,{onOpenChange:n,open:s,children:[t.jsx(e.DialogTrigger,{asChild:!0,children:t.jsx(e.ActionButton,{action:I,dataState:N,disabled:v,icon:C,shortcutKeys:T,tooltip:y,tooltipOptions:A})}),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:d,value:u,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:()=>n(!1),variant:"outline",children:l("editor.callout.dialog.button.cancel")}),t.jsx(e.Button,{onClick:S,children:l("editor.callout.dialog.button.apply")})]})]})]}):t.jsx(t.Fragment,{})}function x(l){return o=>o.getAttribute(l)}const j=a.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",a.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 a.ReactNodeViewRenderer(k)}});exports.Callout=j;exports.RichTextCallout=M;
|
package/lib/Callout.js
CHANGED
|
@@ -1,44 +1,43 @@
|
|
|
1
|
-
import { h as D, j as x, N as H, k as M, m as B } from "./clsx-
|
|
2
|
-
import { h as V, u as j, d as P, D as E, m as R, A as T, n as W, o as F, L as u, j as v,
|
|
3
|
-
import { jsx as o, jsxs as l, Fragment as
|
|
1
|
+
import { h as D, j as x, N as H, k as M, m as B } from "./clsx-BUPZHhq3.js";
|
|
2
|
+
import { h as V, u as j, d as P, 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-CnKgiZFQ.js";
|
|
3
|
+
import { jsx as o, jsxs as l, Fragment as K } from "react/jsx-runtime";
|
|
4
4
|
import { useState as s } from "react";
|
|
5
5
|
import "./theme.js";
|
|
6
|
-
import { Info as
|
|
7
|
-
import {
|
|
8
|
-
import { u as tt } from "./index-DZfkCNKr.js";
|
|
6
|
+
import { Info as G, Lightbulb as J, AlertCircle as Q, TriangleAlert as X, OctagonAlert as Z } from "lucide-react";
|
|
7
|
+
import { u as tt } from "./index-BGd2HiwP.js";
|
|
9
8
|
const y = [
|
|
10
9
|
{
|
|
11
10
|
value: "note",
|
|
12
11
|
label: "Note",
|
|
13
|
-
icon:
|
|
12
|
+
icon: G,
|
|
14
13
|
color: "#1f6feb",
|
|
15
14
|
background: "#1f6feb1f"
|
|
16
15
|
},
|
|
17
16
|
{
|
|
18
17
|
value: "tip",
|
|
19
18
|
label: "Tip",
|
|
20
|
-
icon:
|
|
19
|
+
icon: J,
|
|
21
20
|
color: "#238636",
|
|
22
21
|
background: "#2386361f"
|
|
23
22
|
},
|
|
24
23
|
{
|
|
25
24
|
value: "important",
|
|
26
25
|
label: "Important",
|
|
27
|
-
icon:
|
|
26
|
+
icon: Q,
|
|
28
27
|
color: "#ab7df8",
|
|
29
28
|
background: "#ab7df81f"
|
|
30
29
|
},
|
|
31
30
|
{
|
|
32
31
|
value: "warning",
|
|
33
32
|
label: "Warning",
|
|
34
|
-
icon:
|
|
33
|
+
icon: X,
|
|
35
34
|
color: "#d29922",
|
|
36
35
|
background: "#d299221f"
|
|
37
36
|
},
|
|
38
37
|
{
|
|
39
38
|
value: "caution",
|
|
40
39
|
label: "Caution",
|
|
41
|
-
icon:
|
|
40
|
+
icon: Z,
|
|
42
41
|
color: "#f85149",
|
|
43
42
|
background: "#f851491f"
|
|
44
43
|
}
|
|
@@ -87,7 +86,7 @@ const ot = [
|
|
|
87
86
|
{ value: "warning", label: "Warning", icon: "TriangleAlert" },
|
|
88
87
|
{ value: "caution", label: "Caution", icon: "OctagonAlert" }
|
|
89
88
|
];
|
|
90
|
-
function
|
|
89
|
+
function ut() {
|
|
91
90
|
const { t } = tt(), e = V(), a = j(lt.name), [n, i] = s(!1), [c, d] = s("note"), [p, b] = s(""), [g, f] = s(""), {
|
|
92
91
|
icon: A = void 0,
|
|
93
92
|
tooltip: N = void 0,
|
|
@@ -117,9 +116,9 @@ function ht() {
|
|
|
117
116
|
/* @__PURE__ */ l("div", { className: "richtext-space-y-4 richtext-py-4", children: [
|
|
118
117
|
/* @__PURE__ */ l("div", { className: "richtext-space-y-2", children: [
|
|
119
118
|
/* @__PURE__ */ o(u, { children: t("editor.callout.dialog.type") }),
|
|
120
|
-
/* @__PURE__ */ l(
|
|
121
|
-
/* @__PURE__ */ o(
|
|
122
|
-
/* @__PURE__ */ o(
|
|
119
|
+
/* @__PURE__ */ l(U, { onValueChange: d, value: c, children: [
|
|
120
|
+
/* @__PURE__ */ o(Y, { children: /* @__PURE__ */ o(_, { placeholder: t("editor.callout.dialog.type.placeholder") }) }),
|
|
121
|
+
/* @__PURE__ */ o($, { children: ot.map((r) => /* @__PURE__ */ o(q, { value: r.value, children: t(`editor.callout.type.${r.value}`) }, r.value)) })
|
|
123
122
|
] })
|
|
124
123
|
] }),
|
|
125
124
|
/* @__PURE__ */ l("div", { className: "richtext-space-y-2", children: [
|
|
@@ -145,12 +144,12 @@ function ht() {
|
|
|
145
144
|
)
|
|
146
145
|
] })
|
|
147
146
|
] }),
|
|
148
|
-
/* @__PURE__ */ l(
|
|
147
|
+
/* @__PURE__ */ l(z, { children: [
|
|
149
148
|
/* @__PURE__ */ o(C, { onClick: () => i(!1), variant: "outline", children: t("editor.callout.dialog.button.cancel") }),
|
|
150
149
|
/* @__PURE__ */ o(C, { onClick: w, children: t("editor.callout.dialog.button.apply") })
|
|
151
150
|
] })
|
|
152
151
|
] })
|
|
153
|
-
] }) : /* @__PURE__ */ o(
|
|
152
|
+
] }) : /* @__PURE__ */ o(K, {});
|
|
154
153
|
}
|
|
155
154
|
function h(t) {
|
|
156
155
|
return (e) => e.getAttribute(t);
|
|
@@ -221,5 +220,5 @@ const lt = /* @__PURE__ */ H.create({
|
|
|
221
220
|
});
|
|
222
221
|
export {
|
|
223
222
|
lt as Callout,
|
|
224
|
-
|
|
223
|
+
ut as RichTextCallout
|
|
225
224
|
};
|
package/lib/Clear.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./clsx-CXbNJWDD.cjs"),n=require("react/jsx-runtime"),i=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./clsx-CXbNJWDD.cjs"),n=require("react/jsx-runtime"),i=require("./index-BynXHtjJ.cjs");function v(){const t=i.useButtonProps(s.name),{icon:e=void 0,tooltip:o=void 0,shortcutKeys:a=void 0,tooltipOptions:u={},action:c=void 0,isActive:l=void 0}=(t==null?void 0:t.componentProps)??{},{disabled:r}=i.useActive(l),d=()=>{r||c&&c()};return t?n.jsx(i.ActionButton,{action:d,disabled:r,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 "./clsx-
|
|
1
|
+
import { N as l } from "./clsx-BUPZHhq3.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-CnKgiZFQ.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("./clsx-CXbNJWDD.cjs"),i=require("react/jsx-runtime"),s=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./clsx-CXbNJWDD.cjs"),i=require("react/jsx-runtime"),s=require("./index-BynXHtjJ.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=s.useButtonProps(u.name),{icon:t=void 0,tooltip:r=void 0,shortcutKeys:n=void 0,tooltipOptions:c={},action:d=void 0,isActive:p=void 0}=(e==null?void 0:e.componentProps)??{},{dataState:l,disabled:a,update:m}=s.useToggleActive(p),g=()=>{a||d&&(d(),m())};return e?i.jsx(s.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, e as l, f as g, m as h } from "./clsx-
|
|
1
|
+
import { M as m, e as l, f as g, m as h } from "./clsx-BUPZHhq3.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-CnKgiZFQ.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import "./theme.js";
|
|
6
6
|
var k = /(^|[^`])`([^`]+)`(?!`)$/, x = /(^|[^`])`([^`]+)`(?!`)/g, y = m.create({
|