reactjs-tiptap-editor 0.3.11 → 0.3.13
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-BQ2ojtpo.js → ActionMenuButton-BfH5nAGi.js} +1 -1
- package/lib/{ActionMenuButton-OfnmanTP.cjs → ActionMenuButton-Cbbnqd-L.cjs} +1 -1
- package/lib/Attachment.cjs +2 -2
- package/lib/Attachment.d.cts +17 -17
- package/lib/Attachment.d.ts +17 -17
- package/lib/Attachment.js +5 -5
- package/lib/Blockquote.cjs +1 -1
- package/lib/Blockquote.d.cts +17 -17
- package/lib/Blockquote.d.ts +17 -17
- package/lib/Blockquote.js +2 -2
- package/lib/Bold.cjs +1 -1
- package/lib/Bold.d.cts +17 -17
- package/lib/Bold.d.ts +17 -17
- package/lib/Bold.js +2 -2
- package/lib/BulletList.cjs +1 -1
- package/lib/BulletList.d.cts +17 -17
- package/lib/BulletList.d.ts +17 -17
- package/lib/BulletList.js +2 -2
- package/lib/Clear.cjs +1 -1
- package/lib/Clear.d.cts +17 -17
- package/lib/Clear.d.ts +17 -17
- package/lib/Clear.js +2 -2
- package/lib/Code.cjs +1 -1
- package/lib/Code.d.cts +17 -17
- package/lib/Code.d.ts +17 -17
- package/lib/Code.js +2 -2
- package/lib/CodeBlock.cjs +1 -1
- package/lib/CodeBlock.d.cts +17 -17
- package/lib/CodeBlock.d.ts +17 -17
- package/lib/CodeBlock.js +3 -3
- package/lib/CodeView.cjs +1 -1
- package/lib/CodeView.d.cts +17 -17
- package/lib/CodeView.d.ts +17 -17
- package/lib/CodeView.js +2 -2
- package/lib/Color.cjs +1 -1
- package/lib/Color.d.cts +17 -17
- package/lib/Color.d.ts +17 -17
- package/lib/Color.js +3 -3
- package/lib/Document.d.cts +17 -17
- package/lib/Document.d.ts +17 -17
- package/lib/Document.js +1 -1
- package/lib/{Drawer-9QMJnenp.js → Drawer-DUXFBfgE.js} +3 -3
- package/lib/{Drawer-BN8H4Zb2.cjs → Drawer-jPHImfyr.cjs} +1 -1
- package/lib/Drawer.cjs +1 -1
- package/lib/Drawer.d.cts +17 -17
- package/lib/Drawer.d.ts +17 -17
- package/lib/Drawer.js +4 -4
- package/lib/Emoji.cjs +1 -1
- package/lib/Emoji.d.cts +17 -17
- package/lib/Emoji.d.ts +17 -17
- package/lib/Emoji.js +4 -4
- package/lib/{Excalidraw-B95hkXm5.js → Excalidraw-BBOIIhij.js} +3 -3
- package/lib/{Excalidraw-iG1WleD5.cjs → Excalidraw-CwZ3g3p-.cjs} +1 -1
- package/lib/Excalidraw.cjs +1 -1
- package/lib/Excalidraw.d.cts +17 -17
- package/lib/Excalidraw.d.ts +17 -17
- package/lib/Excalidraw.js +3 -3
- package/lib/ExportPdf.cjs +1 -1
- package/lib/ExportPdf.d.cts +17 -17
- package/lib/ExportPdf.d.ts +17 -17
- package/lib/ExportPdf.js +2 -2
- package/lib/ExportWord.cjs +1 -1
- package/lib/ExportWord.d.cts +17 -17
- package/lib/ExportWord.d.ts +17 -17
- package/lib/ExportWord.js +2 -2
- package/lib/FontFamily.cjs +1 -1
- package/lib/FontFamily.d.cts +17 -17
- package/lib/FontFamily.d.ts +17 -17
- package/lib/FontFamily.js +4 -4
- package/lib/FontSize.cjs +1 -1
- package/lib/FontSize.d.cts +17 -17
- package/lib/FontSize.d.ts +17 -17
- package/lib/FontSize.js +3 -3
- package/lib/FormatPainter.cjs +1 -1
- package/lib/FormatPainter.d.cts +17 -17
- package/lib/FormatPainter.d.ts +17 -17
- package/lib/FormatPainter.js +2 -2
- package/lib/Heading.cjs +1 -1
- package/lib/Heading.d.cts +17 -17
- package/lib/Heading.d.ts +17 -17
- package/lib/Heading.js +3 -3
- package/lib/Highlight.cjs +1 -1
- package/lib/Highlight.d.cts +17 -17
- package/lib/Highlight.d.ts +17 -17
- package/lib/Highlight.js +2 -2
- package/lib/History.cjs +1 -1
- package/lib/History.d.cts +17 -17
- package/lib/History.d.ts +17 -17
- package/lib/History.js +2 -2
- package/lib/HorizontalRule.cjs +1 -1
- package/lib/HorizontalRule.d.cts +17 -17
- package/lib/HorizontalRule.d.ts +17 -17
- package/lib/HorizontalRule.js +2 -2
- package/lib/Iframe.cjs +1 -1
- package/lib/Iframe.d.cts +17 -17
- package/lib/Iframe.d.ts +17 -17
- package/lib/Iframe.js +3 -3
- package/lib/Image.cjs +1 -1
- package/lib/Image.d.cts +17 -17
- package/lib/Image.d.ts +17 -17
- package/lib/Image.js +3 -3
- package/lib/ImageGif.cjs +1 -1
- package/lib/ImageGif.d.cts +17 -17
- package/lib/ImageGif.d.ts +17 -17
- package/lib/ImageGif.js +3 -3
- package/lib/ImportWord.cjs +1 -1
- package/lib/ImportWord.d.cts +17 -17
- package/lib/ImportWord.d.ts +17 -17
- package/lib/ImportWord.js +2 -2
- package/lib/Indent.cjs +1 -1
- package/lib/Indent.d.cts +17 -17
- package/lib/Indent.d.ts +17 -17
- package/lib/Indent.js +2 -2
- package/lib/Italic.cjs +1 -1
- package/lib/Italic.d.cts +17 -17
- package/lib/Italic.d.ts +17 -17
- package/lib/Italic.js +2 -2
- package/lib/Katex.cjs +1 -1
- package/lib/Katex.d.cts +17 -17
- package/lib/Katex.d.ts +17 -17
- package/lib/Katex.js +4 -4
- package/lib/LineHeight.cjs +1 -1
- package/lib/LineHeight.d.cts +17 -17
- package/lib/LineHeight.d.ts +17 -17
- package/lib/LineHeight.js +2 -2
- package/lib/Link.cjs +1 -5
- package/lib/Link.d.cts +20 -18
- package/lib/Link.d.ts +20 -18
- package/lib/Link.js +4 -1048
- package/lib/ListItem.d.cts +17 -17
- package/lib/ListItem.d.ts +17 -17
- package/lib/ListItem.js +1 -1
- package/lib/Mention.d.cts +17 -17
- package/lib/Mention.d.ts +17 -17
- package/lib/Mention.js +3 -3
- package/lib/Mermaid.cjs +2 -2
- package/lib/Mermaid.d.cts +17 -17
- package/lib/Mermaid.d.ts +17 -17
- package/lib/Mermaid.js +4 -4
- package/lib/MoreMark.cjs +1 -1
- package/lib/MoreMark.d.cts +17 -17
- package/lib/MoreMark.d.ts +17 -17
- package/lib/MoreMark.js +3 -3
- package/lib/MultiColumn.cjs +1 -1
- package/lib/MultiColumn.d.cts +17 -17
- package/lib/MultiColumn.d.ts +17 -17
- package/lib/MultiColumn.js +2 -2
- package/lib/OrderedList.cjs +1 -1
- package/lib/OrderedList.d.cts +17 -17
- package/lib/OrderedList.d.ts +17 -17
- package/lib/OrderedList.js +2 -2
- package/lib/RichTextEditor-C3sK_Ys3.cjs +141 -0
- package/lib/{RichTextEditor-CFwUKN9i.js → RichTextEditor-OW4s40FH.js} +4817 -3766
- package/lib/SearchAndReplace.cjs +1 -1
- package/lib/SearchAndReplace.d.cts +17 -17
- package/lib/SearchAndReplace.d.ts +17 -17
- package/lib/SearchAndReplace.js +2 -2
- package/lib/Selection.d.cts +17 -17
- package/lib/Selection.d.ts +17 -17
- package/lib/Selection.js +1 -1
- package/lib/SlashCommand.cjs +1 -1
- package/lib/SlashCommand.d.cts +17 -17
- package/lib/SlashCommand.d.ts +17 -17
- package/lib/SlashCommand.js +18 -18
- package/lib/Strike.cjs +1 -1
- package/lib/Strike.d.cts +17 -17
- package/lib/Strike.d.ts +17 -17
- package/lib/Strike.js +2 -2
- package/lib/SubAndSuperScript.cjs +1 -1
- package/lib/SubAndSuperScript.d.cts +17 -17
- package/lib/SubAndSuperScript.d.ts +17 -17
- package/lib/SubAndSuperScript.js +3 -3
- package/lib/Table.cjs +2 -2
- package/lib/Table.d.cts +17 -17
- package/lib/Table.d.ts +17 -17
- package/lib/Table.js +16 -16
- package/lib/TableOfContent.cjs +1 -1
- package/lib/TableOfContent.d.cts +17 -17
- package/lib/TableOfContent.d.ts +17 -17
- package/lib/TableOfContent.js +5 -5
- package/lib/TaskList.cjs +1 -1
- package/lib/TaskList.d.cts +17 -17
- package/lib/TaskList.d.ts +17 -17
- package/lib/TaskList.js +2 -2
- package/lib/TextAlign.cjs +1 -1
- package/lib/TextAlign.d.cts +17 -17
- package/lib/TextAlign.d.ts +17 -17
- package/lib/TextAlign.js +2 -2
- package/lib/TextBubble.cjs +1 -1
- package/lib/TextBubble.d.cts +17 -17
- package/lib/TextBubble.d.ts +17 -17
- package/lib/TextBubble.js +2 -2
- package/lib/TextDirection.cjs +1 -1
- package/lib/TextDirection.d.cts +17 -17
- package/lib/TextDirection.d.ts +17 -17
- package/lib/TextDirection.js +2 -2
- package/lib/TextUnderline.cjs +1 -1
- package/lib/TextUnderline.d.cts +17 -17
- package/lib/TextUnderline.d.ts +17 -17
- package/lib/TextUnderline.js +2 -2
- package/lib/TrailingNode.d.cts +17 -17
- package/lib/TrailingNode.d.ts +17 -17
- package/lib/TrailingNode.js +1 -1
- package/lib/{Twitter-ChRmdJB0.js → Twitter-2LOf4hFb.js} +44 -44
- package/lib/{Twitter-DbokWMq-.cjs → Twitter-Cg58uzB-.cjs} +3 -3
- package/lib/Twitter.cjs +1 -1
- package/lib/Twitter.d.cts +17 -17
- package/lib/Twitter.d.ts +17 -17
- package/lib/Twitter.js +3 -3
- package/lib/Video.cjs +1 -1
- package/lib/Video.d.cts +17 -17
- package/lib/Video.d.ts +17 -17
- package/lib/Video.js +2 -2
- package/lib/bubble-extra.cjs +2 -2
- package/lib/bubble-extra.d.cts +17 -17
- package/lib/bubble-extra.d.ts +17 -17
- package/lib/bubble-extra.js +6 -6
- package/lib/{dom-dataset-2RXYq9wp.js → dom-dataset-CHDbKz5J.js} +1 -1
- package/lib/{index-CXIIg9Sq.js → index-BWx1Mchx.js} +21 -21
- package/lib/{index-BGwJ0NfQ.js → index-DEFQHExY.js} +1 -1
- package/lib/{index-BkoojfPK.js → index-DIPntess.js} +1 -1
- package/lib/{index-fKx6CYUM.js → index-oQutU45z.js} +1 -1
- package/lib/index.cjs +1 -1
- package/lib/index.d.cts +19 -17
- package/lib/index.d.ts +19 -17
- package/lib/index.js +43 -43
- package/lib/locale-bundle.d.cts +17 -17
- package/lib/locale-bundle.d.ts +17 -17
- package/lib/style.css +1 -1
- package/lib/{textarea-D5VHsW3K.js → textarea-DM-_io94.js} +1 -1
- package/lib/{textarea-BfhvC1nW.cjs → textarea-DNz8Tnud.cjs} +1 -1
- package/package.json +1 -1
- package/lib/RichTextEditor-COwI-b24.cjs +0 -137
package/lib/Link.cjs
CHANGED
|
@@ -1,5 +1 @@
|
|
|
1
|
-
"use strict";Object.
|
|
2
|
-
`,Me="️",De="",Wt="";let nt=null,ot=null;function je(t=[]){const n={};R.groups=n;const e=new R;nt==null&&(nt=de(ve)),ot==null&&(ot=de(Ne)),r(e,"'",Zt),r(e,"{",q),r(e,"}",J),r(e,"[",rt),r(e,"]",at),r(e,"(",lt),r(e,")",ct),r(e,"<",ut),r(e,">",dt),r(e,"(",ht),r(e,")",ft),r(e,"「",gt),r(e,"」",mt),r(e,"『",Et),r(e,"』",pt),r(e,"<",At),r(e,">",kt),r(e,"&",Lt),r(e,"*",Tt),r(e,"@",x),r(e,"`",Ct),r(e,"^",Rt),r(e,":",M),r(e,",",te),r(e,"$",bt),r(e,".",P),r(e,"=",Ot),r(e,"!",ee),r(e,"-",S),r(e,"%",V),r(e,"|",St),r(e,"+",Pt),r(e,"#",vt),r(e,"?",Y),r(e,'"',ne),r(e,"/",v),r(e,";",oe),r(e,"~",X),r(e,"_",Nt),r(e,"\\",yt),r(e,"・",ke);const o=A(e,I,Yt,{[Ft]:!0});A(o,I,o);const s=A(o,N,pe,{[$]:!0}),i=A(o,Q,Ae,{[_]:!0}),a=A(e,N,H,{[Gt]:!0});A(a,I,s),A(a,N,a),A(s,I,s),A(s,N,s);const l=A(e,Q,$t,{[Qt]:!0});A(l,N),A(l,I,i),A(l,Q,l),A(i,I,i),A(i,N),A(i,Q,i);const h=r(e,zt,Xt,{[jt]:!0}),c=r(e,ue,Vt,{[jt]:!0}),f=A(e,Bt,Vt,{[jt]:!0});r(e,Wt,f),r(c,zt,h),r(c,Wt,f),A(c,Bt,f),r(f,ue),r(f,zt),A(f,Bt,f),r(f,Wt,f);const d=A(e,Ut,Le,{[Ee]:!0});r(d,"#"),A(d,Ut,d),r(d,Me,d);const m=r(d,De);r(m,"#"),A(m,Ut,d);const p=[[N,a],[I,s]],b=[[N,null],[Q,l],[I,i]];for(let k=0;k<nt.length;k++)w(e,nt[k],qt,H,p);for(let k=0;k<ot.length;k++)w(e,ot[k],Jt,$t,b);j(qt,{tld:!0,ascii:!0},n),j(Jt,{utld:!0,alpha:!0},n),w(e,"file",it,H,p),w(e,"mailto",it,H,p),w(e,"http",W,H,p),w(e,"https",W,H,p),w(e,"ftp",W,H,p),w(e,"ftps",W,H,p),j(it,{scheme:!0,ascii:!0},n),j(W,{slashscheme:!0,ascii:!0},n),t=t.sort((k,y)=>k[0]>y[0]?1:-1);for(let k=0;k<t.length;k++){const y=t[k][0],T=t[k][1]?{[Ie]:!0}:{[He]:!0};y.indexOf("-")>=0?T[_t]=!0:N.test(y)?I.test(y)?T[$]=!0:T[Gt]=!0:T[Ft]=!0,ce(e,y,y,T)}return ce(e,"localhost",Z,{ascii:!0}),e.jd=new R(It),{start:e,tokens:K({groups:n},Te)}}function ye(t,n){const e=Ue(n.replace(/[A-Z]/g,l=>l.toLowerCase())),o=e.length,s=[];let i=0,a=0;for(;a<o;){let l=t,h=null,c=0,f=null,d=-1,m=-1;for(;a<o&&(h=l.go(e[a]));)l=h,l.accepts()?(d=0,m=0,f=l):d>=0&&(d+=e[a].length,m++),c+=e[a].length,i+=e[a].length,a++;i-=d,a-=m,c-=d,s.push({t:f.t,v:n.slice(i-c,i),s:i-c,e:i})}return s}function Ue(t){const n=[],e=t.length;let o=0;for(;o<e;){let s=t.charCodeAt(o),i,a=s<55296||s>56319||o+1===e||(i=t.charCodeAt(o+1))<56320||i>57343?t[o]:t.slice(o,o+2);n.push(a),o+=a.length}return n}function w(t,n,e,o,s){let i;const a=n.length;for(let l=0;l<a-1;l++){const h=n[l];t.j[h]?i=t.j[h]:(i=new R(o),i.jr=s.slice(),t.j[h]=i),t=i}return i=new R(e),i.jr=s.slice(),t.j[n[a-1]]=i,i}function de(t){const n=[],e=[];let o=0,s="0123456789";for(;o<t.length;){let i=0;for(;s.indexOf(t[o+i])>=0;)i++;if(i>0){n.push(e.join(""));for(let a=parseInt(t.substring(o,o+i),10);a>0;a--)e.pop();o+=i}else e.push(t[o]),o++}return n}const tt={defaultProtocol:"http",events:null,format:he,formatHref:he,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function se(t,n=null){let e=K({},tt);t&&(e=K(e,t instanceof se?t.o:t));const o=e.ignoreTags,s=[];for(let i=0;i<o.length;i++)s.push(o[i].toUpperCase());this.o=e,n&&(this.defaultRender=n),this.ignoreTags=s}se.prototype={o:tt,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,n,e){const o=n!=null;let s=this.o[t];return s&&(typeof s=="object"?(s=e.t in s?s[e.t]:tt[t],typeof s=="function"&&o&&(s=s(n,e))):typeof s=="function"&&o&&(s=s(n,e.t,e)),s)},getObj(t,n,e){let o=this.o[t];return typeof o=="function"&&n!=null&&(o=o(n,e.t,e)),o},render(t){const n=t.render(this);return(this.get("render",null,t)||this.defaultRender)(n,t.t,t)}};function he(t){return t}function Ce(t,n){this.t="token",this.v=t,this.tk=n}Ce.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const n=this.toString(),e=t.get("truncate",n,this),o=t.get("format",n,this);return e&&o.length>e?o.substring(0,e)+"…":o},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=tt.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const n=this,e=this.toHref(t.get("defaultProtocol")),o=t.get("formatHref",e,this),s=t.get("tagName",e,n),i=this.toFormattedString(t),a={},l=t.get("className",e,n),h=t.get("target",e,n),c=t.get("rel",e,n),f=t.getObj("attributes",e,n),d=t.getObj("events",e,n);return a.href=o,l&&(a.class=l),h&&(a.target=h),c&&(a.rel=c),f&&K(a,f),{tagName:s,attributes:a,content:i,eventListeners:d}}};function Ht(t,n){class e extends Ce{constructor(s,i){super(s,i),this.t=t}}for(const o in n)e.prototype[o]=n[o];return e.t=t,e}const fe=Ht("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),ge=Ht("text"),Be=Ht("nl"),st=Ht("url",{isLink:!0,toHref(t=tt.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==Z&&t[1].t===M}}),O=t=>new R(t);function ze({groups:t}){const n=t.domain.concat([Lt,Tt,x,yt,Ct,Rt,bt,Ot,S,Yt,V,St,Pt,vt,v,It,X,Nt]),e=[M,te,P,ee,V,Y,ne,oe,ut,dt,q,J,at,rt,lt,ct,ht,ft,gt,mt,Et,pt,At,kt],o=[Lt,Zt,Tt,yt,Ct,Rt,bt,Ot,S,q,J,V,St,Pt,vt,Y,v,It,X,Nt],s=O(),i=r(s,X);u(i,o,i),u(i,t.domain,i);const a=O(),l=O(),h=O();u(s,t.domain,a),u(s,t.scheme,l),u(s,t.slashscheme,h),u(a,o,i),u(a,t.domain,a);const c=r(a,x);r(i,x,c),r(l,x,c),r(h,x,c);const f=r(i,P);u(f,o,i),u(f,t.domain,i);const d=O();u(c,t.domain,d),u(d,t.domain,d);const m=r(d,P);u(m,t.domain,d);const p=O(fe);u(m,t.tld,p),u(m,t.utld,p),r(c,Z,p);const b=r(d,S);r(b,S,b),u(b,t.domain,d),u(p,t.domain,d),r(p,P,m),r(p,S,b);const k=r(p,M);u(k,t.numeric,fe);const y=r(a,S),g=r(a,P);r(y,S,y),u(y,t.domain,a),u(g,o,i),u(g,t.domain,a);const T=O(st);u(g,t.tld,T),u(g,t.utld,T),u(T,t.domain,a),u(T,o,i),r(T,P,g),r(T,S,y),r(T,x,c);const be=r(T,M),re=O(st);u(be,t.numeric,re);const C=O(st),F=O();u(C,n,C),u(C,e,F),u(F,n,C),u(F,e,F),r(T,v,C),r(re,v,C);const wt=r(l,M),Oe=r(h,M),Se=r(Oe,v),xt=r(Se,v);u(l,t.domain,a),r(l,P,g),r(l,S,y),u(h,t.domain,a),r(h,P,g),r(h,S,y),u(wt,t.domain,C),r(wt,v,C),r(wt,Y,C),u(xt,t.domain,C),u(xt,n,C),r(xt,v,C);const ae=[[q,J],[rt,at],[lt,ct],[ut,dt],[ht,ft],[gt,mt],[Et,pt],[At,kt]];for(let Mt=0;Mt<ae.length;Mt++){const[le,Dt]=ae[Mt],et=r(C,le);r(F,le,et),r(et,Dt,C);const U=O(st);u(et,n,U);const G=O();u(et,e),u(U,n,U),u(U,e,G),u(G,n,U),u(G,e,G),r(U,Dt,C),r(G,Dt,C)}return r(s,Z,T),r(s,Xt,Be),{start:s,tokens:Te}}function We(t,n,e){let o=e.length,s=0,i=[],a=[];for(;s<o;){let l=t,h=null,c=null,f=0,d=null,m=-1;for(;s<o&&!(h=l.go(e[s].t));)a.push(e[s++]);for(;s<o&&(c=h||l.go(e[s].t));)h=null,l=c,l.accepts()?(m=0,d=l):m>=0&&m++,s++,f++;if(m<0)s-=f,s<o&&(a.push(e[s]),s++);else{a.length>0&&(i.push(Kt(ge,n,a)),a=[]),s-=m,f-=m;const p=d.t,b=e.slice(s-f,s);i.push(Kt(p,n,b))}}return a.length>0&&i.push(Kt(ge,n,a)),i}function Kt(t,n,e){const o=e[0].s,s=e[e.length-1].e,i=n.slice(o,s);return new t(i,e)}const Ke=typeof console<"u"&&console&&console.warn||(()=>{}),Fe="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",E={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function Ge(){return R.groups={},E.scanner=null,E.parser=null,E.tokenQueue=[],E.pluginQueue=[],E.customSchemes=[],E.initialized=!1,E}function me(t,n=!1){if(E.initialized&&Ke(`linkifyjs: already initialized - will not register custom scheme "${t}" ${Fe}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
|
|
3
|
-
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
4
|
-
2. Cannot start or end with "-"
|
|
5
|
-
3. "-" cannot repeat`);E.customSchemes.push([t,n])}function Qe(){E.scanner=je(E.customSchemes);for(let t=0;t<E.tokenQueue.length;t++)E.tokenQueue[t][1]({scanner:E.scanner});E.parser=ze(E.scanner.tokens);for(let t=0;t<E.pluginQueue.length;t++)E.pluginQueue[t][1]({scanner:E.scanner,parser:E.parser});return E.initialized=!0,E}function ie(t){return E.initialized||Qe(),We(E.parser.start,t,ye(E.scanner.start,t))}ie.scan=ye;function Re(t,n=null,e=null){if(n&&typeof n=="object"){if(e)throw Error(`linkifyjs: Invalid link type ${n}; must be a string`);e=n,n=null}const o=new se(e),s=ie(t),i=[];for(let a=0;a<s.length;a++){const l=s[a];l.isLink&&(!n||l.t===n)&&o.check(l)&&i.push(l.toFormattedObject(o))}return i}function _e(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function $e(t){return new L.Plugin({key:new L.PluginKey("autolink"),appendTransaction:(n,e,o)=>{const s=n.some(c=>c.docChanged)&&!e.doc.eq(o.doc),i=n.some(c=>c.getMeta("preventAutolink"));if(!s||i)return;const{tr:a}=o,l=L.combineTransactionSteps(e.doc,[...n]);if(L.getChangedRanges(l).forEach(({newRange:c})=>{const f=L.findChildrenInRange(o.doc,c,p=>p.isTextblock);let d,m;if(f.length>1?(d=f[0],m=o.doc.textBetween(d.pos,d.pos+d.node.nodeSize,void 0," ")):f.length&&o.doc.textBetween(c.from,c.to," "," ").endsWith(" ")&&(d=f[0],m=o.doc.textBetween(d.pos,c.to,void 0," ")),d&&m){const p=m.split(" ").filter(g=>g!=="");if(p.length<=0)return!1;const b=p[p.length-1],k=d.pos+m.lastIndexOf(b);if(!b)return!1;const y=ie(b).map(g=>g.toObject(t.defaultProtocol));if(!_e(y))return!1;y.filter(g=>g.isLink).map(g=>({...g,from:k+g.start+1,to:k+g.end+1})).filter(g=>o.schema.marks.code?!o.doc.rangeHasMark(g.from,g.to,o.schema.marks.code):!0).filter(g=>t.validate(g.value)).filter(g=>t.shouldAutoLink(g.value)).forEach(g=>{L.getMarksBetween(g.from,g.to,o.doc).some(T=>T.mark.type===t.type)||a.addMark(g.from,g.to,t.type.create({href:g.href}))})}}),!!a.steps.length)return a}})}function qe(t){return new L.Plugin({key:new L.PluginKey("handleClickLink"),props:{handleClick:(n,e,o)=>{var s,i;if(o.button!==0||!n.editable)return!1;let a=o.target;const l=[];for(;a.nodeName!=="DIV";)l.push(a),a=a.parentNode;if(!l.find(m=>m.nodeName==="A"))return!1;const h=L.getAttributes(n.state,t.type.name),c=o.target,f=(s=c==null?void 0:c.href)!==null&&s!==void 0?s:h.href,d=(i=c==null?void 0:c.target)!==null&&i!==void 0?i:h.target;return c&&f?(window.open(f,d),!0):!1}}})}function Je(t){return new L.Plugin({key:new L.PluginKey("handlePasteLink"),props:{handlePaste:(n,e,o)=>{const{state:s}=n,{selection:i}=s,{empty:a}=i;if(a)return!1;let l="";o.content.forEach(c=>{l+=c.textContent});const h=Re(l,{defaultProtocol:t.defaultProtocol}).find(c=>c.isLink&&c.value===l);return!l||!h?!1:t.editor.commands.setMark(t.type,{href:h.href})}}})}const Ve=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function D(t,n){const e=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return n&&n.forEach(o=>{const s=typeof o=="string"?o:o.scheme;s&&e.push(s)}),!t||t.replace(Ve,"").match(new RegExp(`^(?:(?:${e.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const Ye=L.Mark.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){me(t);return}me(t.scheme,t.optionalSlashes)})},onDestroy(){Ge()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,n)=>!!D(t,n.protocols),validate:t=>!!t,shouldAutoLink:t=>!!t}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const n=t.getAttribute("href");return!n||!this.options.isAllowedUri(n,{defaultValidate:e=>!!D(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:n=>!!D(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",L.mergeAttributes(this.options.HTMLAttributes,t),0]:["a",L.mergeAttributes(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return{setLink:t=>({chain:n})=>{const{href:e}=t;return this.options.isAllowedUri(e,{defaultValidate:o=>!!D(o,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?n().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:n})=>{const{href:e}=t;return this.options.isAllowedUri(e,{defaultValidate:o=>!!D(o,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?n().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[L.markPasteRule({find:t=>{const n=[];if(t){const{protocols:e,defaultProtocol:o}=this.options,s=Re(t).filter(i=>i.isLink&&this.options.isAllowedUri(i.value,{defaultValidate:a=>!!D(a,e),protocols:e,defaultProtocol:o}));s.length&&s.forEach(i=>n.push({text:i.value,data:{href:i.href},index:i.start}))}return n},type:this.type,getAttributes:t=>{var n;return{href:(n=t.data)===null||n===void 0?void 0:n.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:n,defaultProtocol:e}=this.options;return this.options.autolink&&t.push($e({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:o=>this.options.isAllowedUri(o,{defaultValidate:s=>!!D(s,n),protocols:n,defaultProtocol:e}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&t.push(qe({type:this.type})),this.options.linkOnPaste&&t.push(Je({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}});function Xe(t){const[n,e]=Pe.useState(!1);function o(s,i,a){t.action&&(t.action({link:s,text:i,openInNewTab:a}),e(!1))}return B.jsxs(z.Popover,{modal:!0,open:n,onOpenChange:e,children:[B.jsx(z.PopoverTrigger,{disabled:t==null?void 0:t.disabled,asChild:!0,children:B.jsx(z.ActionButton,{tooltip:t==null?void 0:t.tooltip,isActive:t==null?void 0:t.isActive,disabled:t==null?void 0:t.disabled,children:B.jsx(z.IconComponent,{name:t==null?void 0:t.icon})})}),B.jsx(z.PopoverContent,{hideWhenDetached:!0,className:"richtext-w-full",align:"start",side:"bottom",children:B.jsx(z.LinkEditBlock,{editor:t.editor,onSetLink:o})})]})}const Ze=Ye.extend({inclusive:!1,parseHTML(){return[{tag:'a[href]:not([data-type="button"]):not([href *= "javascript:" i])'}]},renderHTML({HTMLAttributes:t}){return["a",L.mergeAttributes(this.options.HTMLAttributes,t,{class:"link"}),0]},addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),openOnClick:!0,button:({editor:n,t:e})=>({component:Xe,componentProps:{editor:n,action:o=>{const{link:s,text:i,openInNewTab:a}=o,{state:l}=n,{from:h}=l.selection,c=i.length,f=h+c;n.chain().extendMarkRange("link").insertContent({type:"text",text:i,marks:[{type:"link",attrs:{href:s,target:a?"_blank":""}}]}).setLink({href:s}).setTextSelection({from:h,to:f}).focus().run()},id:"linkk",isActive:()=>n.isActive("link")||!1,disabled:!n.can().setLink({href:""}),icon:"Link",tooltip:e("editor.link.tooltip")}})}},addProseMirrorPlugins(){return[new L.Plugin({props:{handleClick:(t,n)=>{const{schema:e,doc:o,tr:s}=t.state,i=L.getMarkRange(o.resolve(n),e.marks.link);if(!i)return!1;const a=o.resolve(i.from),l=o.resolve(i.to),h=s.setSelection(new L.TextSelection(a,l));t.dispatch(h)}}})]}});exports.Link=Ze;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require("./index-CSvnpArE.cjs");const e=require("./RichTextEditor-C3sK_Ys3.cjs");exports.Link=e.Link;exports.default=e.Link;
|
package/lib/Link.d.cts
CHANGED
|
@@ -70,7 +70,9 @@ declare interface GeneralOptions<T> {
|
|
|
70
70
|
toolbar?: boolean;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
declare const Link: Mark<LinkOptions, any>;
|
|
74
|
+
export { Link }
|
|
75
|
+
export default Link;
|
|
74
76
|
|
|
75
77
|
export declare interface LinkOptions extends LinkOptions_2, GeneralOptions<LinkOptions> {
|
|
76
78
|
}
|
|
@@ -110,11 +112,9 @@ declare module '@tiptap/core' {
|
|
|
110
112
|
|
|
111
113
|
declare module '@tiptap/core' {
|
|
112
114
|
interface Commands<ReturnType> {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
emoji: string;
|
|
117
|
-
}) => ReturnType;
|
|
115
|
+
drawer: {
|
|
116
|
+
setDrawer: (options: any, replace?: any) => ReturnType;
|
|
117
|
+
setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
118
118
|
};
|
|
119
119
|
}
|
|
120
120
|
}
|
|
@@ -122,9 +122,11 @@ declare module '@tiptap/core' {
|
|
|
122
122
|
|
|
123
123
|
declare module '@tiptap/core' {
|
|
124
124
|
interface Commands<ReturnType> {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
125
|
+
emoji: {
|
|
126
|
+
setEmoji: (emoji: {
|
|
127
|
+
name: string;
|
|
128
|
+
emoji: string;
|
|
129
|
+
}) => ReturnType;
|
|
128
130
|
};
|
|
129
131
|
}
|
|
130
132
|
}
|
|
@@ -148,15 +150,6 @@ declare module '@tiptap/core' {
|
|
|
148
150
|
}
|
|
149
151
|
|
|
150
152
|
|
|
151
|
-
declare module '@tiptap/core' {
|
|
152
|
-
interface Commands<ReturnType> {
|
|
153
|
-
painter: {
|
|
154
|
-
setPainter: (marks: Mark[]) => ReturnType;
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
|
|
160
153
|
declare module '@tiptap/core' {
|
|
161
154
|
interface Commands<ReturnType> {
|
|
162
155
|
fontSize: {
|
|
@@ -175,6 +168,15 @@ declare module '@tiptap/core' {
|
|
|
175
168
|
}
|
|
176
169
|
|
|
177
170
|
|
|
171
|
+
declare module '@tiptap/core' {
|
|
172
|
+
interface Commands<ReturnType> {
|
|
173
|
+
painter: {
|
|
174
|
+
setPainter: (marks: Mark[]) => ReturnType;
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
|
|
178
180
|
declare module '@tiptap/core' {
|
|
179
181
|
interface Commands<ReturnType> {
|
|
180
182
|
iframe: {
|
package/lib/Link.d.ts
CHANGED
|
@@ -70,7 +70,9 @@ declare interface GeneralOptions<T> {
|
|
|
70
70
|
toolbar?: boolean;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
declare const Link: Mark<LinkOptions, any>;
|
|
74
|
+
export { Link }
|
|
75
|
+
export default Link;
|
|
74
76
|
|
|
75
77
|
export declare interface LinkOptions extends LinkOptions_2, GeneralOptions<LinkOptions> {
|
|
76
78
|
}
|
|
@@ -110,11 +112,9 @@ declare module '@tiptap/core' {
|
|
|
110
112
|
|
|
111
113
|
declare module '@tiptap/core' {
|
|
112
114
|
interface Commands<ReturnType> {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
emoji: string;
|
|
117
|
-
}) => ReturnType;
|
|
115
|
+
drawer: {
|
|
116
|
+
setDrawer: (options: any, replace?: any) => ReturnType;
|
|
117
|
+
setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
|
|
118
118
|
};
|
|
119
119
|
}
|
|
120
120
|
}
|
|
@@ -122,9 +122,11 @@ declare module '@tiptap/core' {
|
|
|
122
122
|
|
|
123
123
|
declare module '@tiptap/core' {
|
|
124
124
|
interface Commands<ReturnType> {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
125
|
+
emoji: {
|
|
126
|
+
setEmoji: (emoji: {
|
|
127
|
+
name: string;
|
|
128
|
+
emoji: string;
|
|
129
|
+
}) => ReturnType;
|
|
128
130
|
};
|
|
129
131
|
}
|
|
130
132
|
}
|
|
@@ -148,15 +150,6 @@ declare module '@tiptap/core' {
|
|
|
148
150
|
}
|
|
149
151
|
|
|
150
152
|
|
|
151
|
-
declare module '@tiptap/core' {
|
|
152
|
-
interface Commands<ReturnType> {
|
|
153
|
-
painter: {
|
|
154
|
-
setPainter: (marks: Mark[]) => ReturnType;
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
|
|
160
153
|
declare module '@tiptap/core' {
|
|
161
154
|
interface Commands<ReturnType> {
|
|
162
155
|
fontSize: {
|
|
@@ -175,6 +168,15 @@ declare module '@tiptap/core' {
|
|
|
175
168
|
}
|
|
176
169
|
|
|
177
170
|
|
|
171
|
+
declare module '@tiptap/core' {
|
|
172
|
+
interface Commands<ReturnType> {
|
|
173
|
+
painter: {
|
|
174
|
+
setPainter: (marks: Mark[]) => ReturnType;
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
|
|
178
180
|
declare module '@tiptap/core' {
|
|
179
181
|
interface Commands<ReturnType> {
|
|
180
182
|
iframe: {
|