reactjs-tiptap-editor 0.3.22 → 0.3.23
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-B81uYOvt.cjs → ActionMenuButton-5AJJxQy1.cjs} +1 -1
- package/lib/{ActionMenuButton-CtcDNq-L.js → ActionMenuButton-DwzYAKDg.js} +1 -1
- package/lib/Attachment.cjs +1 -1
- package/lib/Attachment.d.cts +13 -13
- package/lib/Attachment.d.ts +13 -13
- package/lib/Attachment.js +1 -1
- package/lib/Blockquote.cjs +1 -1
- package/lib/Blockquote.d.cts +13 -13
- package/lib/Blockquote.d.ts +13 -13
- package/lib/Blockquote.js +1 -1
- package/lib/Bold.cjs +1 -1
- package/lib/Bold.d.cts +13 -13
- package/lib/Bold.d.ts +13 -13
- package/lib/Bold.js +1 -1
- package/lib/BulletList.cjs +1 -1
- package/lib/BulletList.d.cts +13 -13
- package/lib/BulletList.d.ts +13 -13
- package/lib/BulletList.js +1 -1
- package/lib/Clear.cjs +1 -1
- package/lib/Clear.d.cts +13 -13
- package/lib/Clear.d.ts +13 -13
- package/lib/Clear.js +1 -1
- package/lib/Code.cjs +1 -1
- package/lib/Code.d.cts +13 -13
- package/lib/Code.d.ts +13 -13
- package/lib/Code.js +1 -1
- package/lib/CodeBlock.cjs +1 -1
- package/lib/CodeBlock.d.cts +13 -13
- package/lib/CodeBlock.d.ts +13 -13
- package/lib/CodeBlock.js +1 -1
- package/lib/CodeView.cjs +1 -1
- package/lib/CodeView.d.cts +13 -13
- package/lib/CodeView.d.ts +13 -13
- package/lib/CodeView.js +1 -1
- package/lib/Color.cjs +1 -1
- package/lib/Color.d.cts +13 -13
- package/lib/Color.d.ts +13 -13
- package/lib/Color.js +1 -1
- package/lib/Document.d.cts +13 -13
- package/lib/Document.d.ts +13 -13
- package/lib/{Drawer-CHGZ5D6j.cjs → Drawer-CCzPaigS.cjs} +1 -1
- package/lib/{Drawer-BI_9XSqI.js → Drawer-Dc03j6W1.js} +1 -1
- package/lib/Drawer.cjs +1 -1
- package/lib/Drawer.d.cts +13 -13
- package/lib/Drawer.d.ts +13 -13
- package/lib/Drawer.js +2 -2
- package/lib/Emoji.cjs +1 -1
- package/lib/Emoji.d.cts +13 -13
- package/lib/Emoji.d.ts +13 -13
- package/lib/Emoji.js +1 -1
- package/lib/{Excalidraw-DOJiMnFl.cjs → Excalidraw-Bxo4S3ET.cjs} +1 -1
- package/lib/{Excalidraw-AIzEaOzF.js → Excalidraw-yQ7O39ws.js} +1 -1
- package/lib/Excalidraw.cjs +1 -1
- package/lib/Excalidraw.d.cts +13 -13
- package/lib/Excalidraw.d.ts +13 -13
- package/lib/Excalidraw.js +1 -1
- package/lib/ExportPdf.cjs +1 -1
- package/lib/ExportPdf.d.cts +13 -13
- package/lib/ExportPdf.d.ts +13 -13
- package/lib/ExportPdf.js +1 -1
- package/lib/ExportWord.cjs +1 -1
- package/lib/ExportWord.d.cts +13 -13
- package/lib/ExportWord.d.ts +13 -13
- package/lib/ExportWord.js +1 -1
- package/lib/FontFamily.cjs +1 -1
- package/lib/FontFamily.d.cts +13 -13
- package/lib/FontFamily.d.ts +13 -13
- package/lib/FontFamily.js +2 -2
- package/lib/FontSize.cjs +1 -1
- package/lib/FontSize.d.cts +13 -13
- package/lib/FontSize.d.ts +13 -13
- package/lib/FontSize.js +2 -2
- package/lib/FormatPainter.cjs +1 -1
- package/lib/FormatPainter.d.cts +13 -13
- package/lib/FormatPainter.d.ts +13 -13
- package/lib/FormatPainter.js +1 -1
- package/lib/Heading.cjs +1 -1
- package/lib/Heading.d.cts +13 -13
- package/lib/Heading.d.ts +13 -13
- package/lib/Heading.js +2 -2
- package/lib/Highlight.cjs +1 -1
- package/lib/Highlight.d.cts +13 -13
- package/lib/Highlight.d.ts +13 -13
- package/lib/Highlight.js +1 -1
- package/lib/History.cjs +1 -1
- package/lib/History.d.cts +13 -13
- package/lib/History.d.ts +13 -13
- package/lib/History.js +1 -1
- package/lib/HorizontalRule.cjs +1 -1
- package/lib/HorizontalRule.d.cts +13 -13
- package/lib/HorizontalRule.d.ts +13 -13
- package/lib/HorizontalRule.js +1 -1
- package/lib/Iframe.cjs +1 -1
- package/lib/Iframe.d.cts +13 -13
- package/lib/Iframe.d.ts +13 -13
- package/lib/Iframe.js +1 -1
- package/lib/Image.cjs +1 -1
- package/lib/Image.d.cts +13 -13
- package/lib/Image.d.ts +13 -13
- package/lib/Image.js +1 -1
- package/lib/ImageGif.cjs +1 -1
- package/lib/ImageGif.d.cts +13 -13
- package/lib/ImageGif.d.ts +13 -13
- package/lib/ImageGif.js +1 -1
- package/lib/ImportWord.cjs +1 -1
- package/lib/ImportWord.d.cts +13 -13
- package/lib/ImportWord.d.ts +13 -13
- package/lib/ImportWord.js +1 -1
- package/lib/Indent.cjs +1 -1
- package/lib/Indent.d.cts +13 -13
- package/lib/Indent.d.ts +13 -13
- package/lib/Indent.js +1 -1
- package/lib/Italic.cjs +1 -1
- package/lib/Italic.d.cts +13 -13
- package/lib/Italic.d.ts +13 -13
- package/lib/Italic.js +1 -1
- package/lib/Katex.cjs +1 -1
- package/lib/Katex.d.cts +13 -13
- package/lib/Katex.d.ts +13 -13
- package/lib/Katex.js +2 -2
- package/lib/LineHeight.cjs +1 -1
- package/lib/LineHeight.d.cts +13 -13
- package/lib/LineHeight.d.ts +13 -13
- package/lib/LineHeight.js +1 -1
- package/lib/Link.cjs +1 -1
- package/lib/Link.d.cts +13 -13
- package/lib/Link.d.ts +13 -13
- package/lib/Link.js +1 -1
- package/lib/ListItem.d.cts +13 -13
- package/lib/ListItem.d.ts +13 -13
- package/lib/Mention.d.cts +13 -13
- package/lib/Mention.d.ts +13 -13
- package/lib/Mermaid.cjs +1 -1
- package/lib/Mermaid.d.cts +13 -13
- package/lib/Mermaid.d.ts +13 -13
- package/lib/Mermaid.js +2 -2
- package/lib/MoreMark.cjs +1 -1
- package/lib/MoreMark.d.cts +13 -13
- package/lib/MoreMark.d.ts +13 -13
- package/lib/MoreMark.js +1 -1
- package/lib/MultiColumn.cjs +1 -1
- package/lib/MultiColumn.d.cts +13 -13
- package/lib/MultiColumn.d.ts +13 -13
- package/lib/MultiColumn.js +1 -1
- package/lib/OrderedList.cjs +1 -1
- package/lib/OrderedList.d.cts +13 -13
- package/lib/OrderedList.d.ts +13 -13
- package/lib/OrderedList.js +1 -1
- package/lib/{RichTextEditor-DtxJlApT.cjs → RichTextEditor-BnC1uaUo.cjs} +1 -1
- package/lib/{RichTextEditor-CtxIf8pq.js → RichTextEditor-CqgbZwS5.js} +3 -3
- package/lib/SearchAndReplace.cjs +1 -1
- package/lib/SearchAndReplace.d.cts +13 -13
- package/lib/SearchAndReplace.d.ts +13 -13
- package/lib/SearchAndReplace.js +1 -1
- package/lib/Selection.d.cts +13 -13
- package/lib/Selection.d.ts +13 -13
- package/lib/SlashCommand.cjs +1 -1
- package/lib/SlashCommand.d.cts +13 -13
- package/lib/SlashCommand.d.ts +13 -13
- package/lib/SlashCommand.js +1 -1
- package/lib/Strike.cjs +1 -1
- package/lib/Strike.d.cts +13 -13
- package/lib/Strike.d.ts +13 -13
- package/lib/Strike.js +1 -1
- package/lib/SubAndSuperScript.cjs +1 -1
- package/lib/SubAndSuperScript.d.cts +13 -13
- package/lib/SubAndSuperScript.d.ts +13 -13
- package/lib/SubAndSuperScript.js +1 -1
- package/lib/Table.cjs +1 -1
- package/lib/Table.d.cts +13 -13
- package/lib/Table.d.ts +13 -13
- package/lib/Table.js +1 -1
- package/lib/TableOfContent.cjs +1 -1
- package/lib/TableOfContent.d.cts +13 -13
- package/lib/TableOfContent.d.ts +13 -13
- package/lib/TableOfContent.js +1 -1
- package/lib/TaskList.cjs +1 -1
- package/lib/TaskList.d.cts +13 -13
- package/lib/TaskList.d.ts +13 -13
- package/lib/TaskList.js +1 -1
- package/lib/TextAlign.cjs +1 -1
- package/lib/TextAlign.d.cts +13 -13
- package/lib/TextAlign.d.ts +13 -13
- package/lib/TextAlign.js +1 -1
- package/lib/TextBubble.cjs +1 -1
- package/lib/TextBubble.d.cts +13 -13
- package/lib/TextBubble.d.ts +13 -13
- package/lib/TextBubble.js +1 -1
- package/lib/TextDirection.cjs +1 -1
- package/lib/TextDirection.d.cts +13 -13
- package/lib/TextDirection.d.ts +13 -13
- package/lib/TextDirection.js +1 -1
- package/lib/TextUnderline.cjs +1 -1
- package/lib/TextUnderline.d.cts +13 -13
- package/lib/TextUnderline.d.ts +13 -13
- package/lib/TextUnderline.js +1 -1
- package/lib/TrailingNode.d.cts +13 -13
- package/lib/TrailingNode.d.ts +13 -13
- package/lib/{Twitter-DBA28WG3.cjs → Twitter-2BEmpZYn.cjs} +1 -1
- package/lib/{Twitter-CJIud-WM.js → Twitter-DjzxXZcS.js} +1 -1
- package/lib/Twitter.cjs +1 -1
- package/lib/Twitter.d.cts +13 -13
- package/lib/Twitter.d.ts +13 -13
- package/lib/Twitter.js +1 -1
- package/lib/Video.cjs +1 -1
- package/lib/Video.d.cts +13 -13
- package/lib/Video.d.ts +13 -13
- package/lib/Video.js +1 -1
- package/lib/bubble-extra.cjs +1 -1
- package/lib/bubble-extra.d.cts +13 -13
- package/lib/bubble-extra.d.ts +13 -13
- package/lib/bubble-extra.js +5 -5
- package/lib/index.cjs +1 -1
- package/lib/index.d.cts +13 -13
- package/lib/index.d.ts +13 -13
- package/lib/index.js +2 -2
- package/lib/locale-bundle.d.cts +13 -13
- package/lib/locale-bundle.d.ts +13 -13
- package/lib/{textarea-BhTw-eGz.js → textarea-ClmQTGYC.js} +1 -1
- package/lib/{textarea-9iN67tad.cjs → textarea-DsAuYgt7.cjs} +1 -1
- package/package.json +1 -1
|
@@ -7754,7 +7754,7 @@ function kx(e) {
|
|
|
7754
7754
|
m.preventDefault(), m.stopPropagation(), r && (e.editor.chain().focus().setVideo({
|
|
7755
7755
|
src: r,
|
|
7756
7756
|
width: "100%"
|
|
7757
|
-
}).run(), c(!1));
|
|
7757
|
+
}).run(), c(!1), n(""));
|
|
7758
7758
|
}
|
|
7759
7759
|
function p(m) {
|
|
7760
7760
|
var v;
|
|
@@ -7811,7 +7811,7 @@ function kx(e) {
|
|
|
7811
7811
|
)
|
|
7812
7812
|
] }),
|
|
7813
7813
|
/* @__PURE__ */ E(Ar, { value: "link", children: [
|
|
7814
|
-
/* @__PURE__ */ l("
|
|
7814
|
+
/* @__PURE__ */ l("div", { children: /* @__PURE__ */ E("div", { className: "richtext-flex richtext-items-center richtext-gap-2", children: [
|
|
7815
7815
|
/* @__PURE__ */ l(
|
|
7816
7816
|
Ne,
|
|
7817
7817
|
{
|
|
@@ -7829,7 +7829,7 @@ function kx(e) {
|
|
|
7829
7829
|
}
|
|
7830
7830
|
}
|
|
7831
7831
|
),
|
|
7832
|
-
/* @__PURE__ */ l(Ce, { type: "
|
|
7832
|
+
/* @__PURE__ */ l(Ce, { type: "button", onClick: h, children: t("editor.video.dialog.button.apply") })
|
|
7833
7833
|
] }) }),
|
|
7834
7834
|
o && /* @__PURE__ */ l("div", { className: "richtext-my-[5px] richtext-text-red-500", children: o })
|
|
7835
7835
|
] })
|
package/lib/SearchAndReplace.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./index-ByRfqzMr.cjs"),P=require("scroll-into-view-if-needed"),i=require("react/jsx-runtime"),f=require("react"),c=require("./RichTextEditor-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./index-ByRfqzMr.cjs"),P=require("scroll-into-view-if-needed"),i=require("react/jsx-runtime"),f=require("react"),c=require("./RichTextEditor-BnC1uaUo.cjs"),A=require("./index-C19MB4Al.cjs");function w({editor:e,...t}){const{t:s}=A.useLocale(),[a,n]=f.useState(-1),[r,l]=f.useState([]),[o,x]=f.useState(""),[u,h]=f.useState(""),[m,C]=f.useState(!1),[p,I]=f.useState(!1);return f.useEffect(()=>{m||(x(""),h(""),n(-1),l([]),e.commands.setSearchTerm(""),e.commands.setReplaceTerm(""))},[e,m]),f.useEffect(()=>{m&&e&&e.commands&&e.commands.setSearchTerm&&e.commands.setSearchTerm(o)},[m,o,e]),f.useEffect(()=>{m&&e&&e.commands&&e.commands.setReplaceTerm&&e.commands.setReplaceTerm(u)},[m,u,e]),f.useEffect(()=>{if(!e)return;const d=e.extensionManager.extensions.find(R=>R.name===j.name);if(!d)return;const T=()=>{if(!m)return;const R=d?d.storage.currentIndex:-1,v=d?d.storage.results:[];n(E=>E!==R?R:E),l(E=>c.deepEqual(E,v)?E:v)};return c.listenEvent(c.EVENTS.SEARCH_REPLCE,T),()=>{d&&c.listenEvent(c.EVENTS.SEARCH_REPLCE,T)}},[m,e]),i.jsxs(c.Popover,{onOpenChange:C,open:m,children:[i.jsx(c.PopoverTrigger,{asChild:!0,disabled:t==null?void 0:t.disabled,children:i.jsx(c.ActionButton,{disabled:t==null?void 0:t.disabled,isActive:t==null?void 0:t.isActive,tooltip:t==null?void 0:t.tooltip,children:i.jsx(c.IconComponent,{name:t==null?void 0:t.icon})})}),i.jsxs(c.PopoverContent,{align:"start",className:"richtext-w-full",hideWhenDetached:!0,side:"bottom",children:[i.jsxs("div",{className:"richtext-mb-[6px] richtext-flex richtext-items-center richtext-justify-between",children:[i.jsx(c.Label,{children:s("editor.search.dialog.text")}),i.jsx("span",{className:"richtext-font-semibold",children:r.length>0?`${a+1}/${r.length}`:"0/0"})]}),i.jsxs("div",{className:"richtext-mb-[10px] richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:[i.jsx(c.Input,{autoFocus:!0,className:"richtext-w-full",onChange:d=>x(d.target.value),placeholder:"Text",required:!0,type:"text",value:o}),i.jsx(c.Button,{className:"richtext-flex-1",disabled:r.length===0,onClick:e.commands.goToPrevSearchResult,children:i.jsx(c.IconComponent,{name:"ChevronUp"})}),i.jsx(c.Button,{className:"richtext-flex-1",disabled:r.length===0,onClick:e.commands.goToNextSearchResult,children:i.jsx(c.IconComponent,{name:"ChevronDown"})})]}),i.jsx(c.Label,{className:"richtext-mb-[6px]",children:s("editor.replace.dialog.text")}),i.jsx("div",{className:"richtext-mb-[5px] richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:i.jsx("div",{className:"richtext-relative richtext-w-full richtext-max-w-sm richtext-items-center",children:i.jsx(c.Input,{className:"richtext-w-80",onChange:d=>h(d.target.value),placeholder:"Text",required:!0,type:"text",value:u})})}),i.jsxs("div",{className:"richtext-mb-[10px] richtext-flex richtext-items-center richtext-space-x-2",children:[i.jsx(c.Switch,{checked:p,onCheckedChange:d=>{I(d),e.commands.setCaseSensitive(d)}}),i.jsx(c.Label,{children:s("editor.replace.caseSensitive")})]}),i.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-[10px]",children:[i.jsx(c.Button,{className:"richtext-flex-1",disabled:r.length===0,onClick:e.commands.replace,children:s("editor.replace.dialog.text")}),i.jsx(c.Button,{className:"richtext-flex-1",disabled:r.length===0,onClick:e.commands.replaceAll,children:s("editor.replaceAll.dialog.text")})]})]})]})}const S=(e,t)=>t(e.tr);function V(e,t,s){return RegExp(t?e.replace(/[$()*+./?[\\\]^{|}-]/g,String.raw`\$&`):e,s?"gu":"gui")}function L(e,t,s){const a=[];let n=[];const r=[];let l=0;if(!t)return{decorationsToReturn:[],results:[]};e==null||e.descendants((o,x)=>{o.isText?n[l]?n[l]={text:n[l].text+o.text,pos:n[l].pos}:n[l]={text:`${o.text}`,pos:x}:l+=1}),n=n.filter(Boolean);for(const{text:o,pos:x}of n){const u=[...o.matchAll(t)];for(const h of u){if(h[0]==="")break;h.index!==void 0&&r.push({from:x+h.index,to:x+h.index+h[0].length})}}for(const o of r)a.push(g.Decoration.inline(o.from,o.to,{class:s}));return{decorationsToReturn:a,results:r}}function b(e,t,{state:s,dispatch:a}){if(!t[0])return;const{from:r,to:l}=t[0];a&&a(s.tr.insertText(e,r,l))}function y(e,t,s,a){const n=t+1;if(!a[n])return null;const{from:r,to:l}=a[t],o=l-r-e.length+s,{from:x,to:u}=a[n];return a[n]={to:u-o,from:x-o},[o,a]}function D(e,t,{tr:s,dispatch:a}){let n=0,r=t.slice();if(r.length===0)return!1;for(let l=0;l<r.length;l+=1){const{from:o,to:x}=r[l];s.insertText(e,o,x);const u=y(e,l,n,r);u&&(n=u[0],r=u[1])}return a(s),!0}function N({view:e,tr:t,searchResults:s,searchResultCurrentClass:a,gotoIndex:n}){const r=s[n];if(r){const l=t.setMeta("directDecoration",{fromPos:r.from,toPos:r.to,attrs:{class:a}});return e==null||e.dispatch(l),setTimeout(()=>{const o=window.document.querySelector(`.${a}`);o&&P(o,{behavior:"smooth",scrollMode:"if-needed"})},0),!0}return!1}const j=g.Extension.create({name:"search",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),searchTerm:"",replaceTerm:"",results:[],currentIndex:0,searchResultClass:"search-result",searchResultCurrentClass:"search-result-current",caseSensitive:!1,disableRegex:!1,onChange:()=>{},button:({editor:t,t:s})=>({component:w,componentProps:{action:()=>{},icon:"SearchAndReplace",tooltip:s("editor.searchAndReplace.tooltip"),isActive:()=>!1,disabled:!1,editor:t}})}},addStorage(){return{results:[],currentIndex:-1}},addCommands(){return{setSearchTerm:e=>({state:t,dispatch:s})=>(this.options.searchTerm=e,this.storage.results=[],this.storage.currentIndex=0,c.dispatchEvent(c.EVENTS.SEARCH_REPLCE),S(t,s),!1),setReplaceTerm:e=>({state:t,dispatch:s})=>(this.options.replaceTerm=e,S(t,s),!1),setCaseSensitive:e=>({state:t,dispatch:s})=>(this.options.caseSensitive=e,S(t,s),!1),replace:()=>({state:e,dispatch:t})=>{const{replaceTerm:s}=this.options,{currentIndex:a,results:n}=this.storage,r=n[a];return r?(b(s,[r],{state:e,dispatch:t}),this.storage.results.splice(a,1)):(b(s,n,{state:e,dispatch:t}),this.storage.results.shift()),c.dispatchEvent(c.EVENTS.SEARCH_REPLCE),S(e,t),!1},replaceAll:()=>({state:e,tr:t,dispatch:s})=>{const{replaceTerm:a}=this.options,{results:n}=this.storage;return D(a,n,{tr:t,dispatch:s}),this.storage.currentIndex=-1,this.storage.results=[],c.dispatchEvent(c.EVENTS.SEARCH_REPLCE),S(e,s),!1},goToPrevSearchResult:()=>({view:e,tr:t})=>{const{searchResultCurrentClass:s}=this.options,{currentIndex:a,results:n}=this.storage,r=(a+n.length-1)%n.length;return this.storage.currentIndex=r,c.dispatchEvent(c.EVENTS.SEARCH_REPLCE),N({view:e,tr:t,searchResults:n,searchResultCurrentClass:s,gotoIndex:r})},goToNextSearchResult:()=>({view:e,tr:t})=>{const{searchResultCurrentClass:s}=this.options,{currentIndex:a,results:n}=this.storage,r=(a+1)%n.length;return this.storage.currentIndex=r,this.options.onChange&&this.options.onChange(),c.dispatchEvent(c.EVENTS.SEARCH_REPLCE),N({view:e,tr:t,searchResults:n,searchResultCurrentClass:s,gotoIndex:r})}}},addProseMirrorPlugins(){const e=this;return[new g.Plugin({key:new g.PluginKey("search"),state:{init(){return g.DecorationSet.empty},apply(t){const{doc:s,docChanged:a}=t,{searchTerm:n,searchResultClass:r,searchResultCurrentClass:l,disableRegex:o,caseSensitive:x}=e.options;if(a||n){const{decorationsToReturn:u,results:h}=L(s,V(n,o,x),r);if(e.storage.results=h,e.storage.currentIndex>h.length-1&&(e.storage.currentIndex=0),c.dispatchEvent(c.EVENTS.SEARCH_REPLCE),t.getMeta("directDecoration")){const{fromPos:m,toPos:C,attrs:p}=t.getMeta("directDecoration");u.push(g.Decoration.inline(m,C,p))}else h.length>0&&(u[0]=g.Decoration.inline(h[0].from,h[0].to,{class:l}));return g.DecorationSet.create(s,u)}return g.DecorationSet.empty}},props:{decorations(t){return this.getState(t)}}})]}});exports.SearchAndReplace=j;
|
|
@@ -331,15 +331,14 @@ declare module '@tiptap/core' {
|
|
|
331
331
|
|
|
332
332
|
declare module '@tiptap/core' {
|
|
333
333
|
interface Commands<ReturnType> {
|
|
334
|
-
|
|
335
|
-
/**
|
|
336
|
-
* Add an video
|
|
337
|
-
*/
|
|
338
|
-
setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
334
|
+
twitter: {
|
|
339
335
|
/**
|
|
340
|
-
*
|
|
336
|
+
* Insert a tweet
|
|
337
|
+
* @param options The tweet attributes
|
|
338
|
+
* @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
|
|
341
339
|
*/
|
|
342
|
-
|
|
340
|
+
setTweet: (options: SetTweetOptions) => ReturnType;
|
|
341
|
+
updateTweet: (options: SetTweetOptions) => ReturnType;
|
|
343
342
|
};
|
|
344
343
|
}
|
|
345
344
|
}
|
|
@@ -347,14 +346,15 @@ declare module '@tiptap/core' {
|
|
|
347
346
|
|
|
348
347
|
declare module '@tiptap/core' {
|
|
349
348
|
interface Commands<ReturnType> {
|
|
350
|
-
|
|
349
|
+
video: {
|
|
351
350
|
/**
|
|
352
|
-
*
|
|
353
|
-
* @param options The tweet attributes
|
|
354
|
-
* @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
|
|
351
|
+
* Add an video
|
|
355
352
|
*/
|
|
356
|
-
|
|
357
|
-
|
|
353
|
+
setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
354
|
+
/**
|
|
355
|
+
* Update an video
|
|
356
|
+
*/
|
|
357
|
+
updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
358
358
|
};
|
|
359
359
|
}
|
|
360
360
|
}
|
|
@@ -331,15 +331,14 @@ declare module '@tiptap/core' {
|
|
|
331
331
|
|
|
332
332
|
declare module '@tiptap/core' {
|
|
333
333
|
interface Commands<ReturnType> {
|
|
334
|
-
|
|
335
|
-
/**
|
|
336
|
-
* Add an video
|
|
337
|
-
*/
|
|
338
|
-
setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
334
|
+
twitter: {
|
|
339
335
|
/**
|
|
340
|
-
*
|
|
336
|
+
* Insert a tweet
|
|
337
|
+
* @param options The tweet attributes
|
|
338
|
+
* @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
|
|
341
339
|
*/
|
|
342
|
-
|
|
340
|
+
setTweet: (options: SetTweetOptions) => ReturnType;
|
|
341
|
+
updateTweet: (options: SetTweetOptions) => ReturnType;
|
|
343
342
|
};
|
|
344
343
|
}
|
|
345
344
|
}
|
|
@@ -347,14 +346,15 @@ declare module '@tiptap/core' {
|
|
|
347
346
|
|
|
348
347
|
declare module '@tiptap/core' {
|
|
349
348
|
interface Commands<ReturnType> {
|
|
350
|
-
|
|
349
|
+
video: {
|
|
351
350
|
/**
|
|
352
|
-
*
|
|
353
|
-
* @param options The tweet attributes
|
|
354
|
-
* @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
|
|
351
|
+
* Add an video
|
|
355
352
|
*/
|
|
356
|
-
|
|
357
|
-
|
|
353
|
+
setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
354
|
+
/**
|
|
355
|
+
* Update an video
|
|
356
|
+
*/
|
|
357
|
+
updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
358
358
|
};
|
|
359
359
|
}
|
|
360
360
|
}
|
package/lib/SearchAndReplace.js
CHANGED
|
@@ -2,7 +2,7 @@ import { E as _, P as M, a as $, b as N, D as P } from "./index-DI9T3iLd.js";
|
|
|
2
2
|
import q from "scroll-into-view-if-needed";
|
|
3
3
|
import { jsxs as f, jsx as o } from "react/jsx-runtime";
|
|
4
4
|
import { useState as g, useEffect as E } from "react";
|
|
5
|
-
import { l as k, E as d, P as B, m as j, A as F, k as A, n as O, L as I, o as y, B as T, S as W, p as K, q as R } from "./RichTextEditor-
|
|
5
|
+
import { l as k, E as d, P as B, m as j, A as F, k as A, n as O, L as I, o as y, B as T, S as W, p as K, q as R } from "./RichTextEditor-CqgbZwS5.js";
|
|
6
6
|
import { u as U } from "./index-Tj3Ci7xM.js";
|
|
7
7
|
function z({ editor: e, ...t }) {
|
|
8
8
|
const { t: s } = U(), [c, r] = g(-1), [n, i] = g([]), [a, u] = g(""), [l, h] = g(""), [x, v] = g(!1), [b, V] = g(!1);
|
package/lib/Selection.d.cts
CHANGED
|
@@ -245,15 +245,14 @@ declare module '@tiptap/core' {
|
|
|
245
245
|
|
|
246
246
|
declare module '@tiptap/core' {
|
|
247
247
|
interface Commands<ReturnType> {
|
|
248
|
-
|
|
249
|
-
/**
|
|
250
|
-
* Add an video
|
|
251
|
-
*/
|
|
252
|
-
setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
248
|
+
twitter: {
|
|
253
249
|
/**
|
|
254
|
-
*
|
|
250
|
+
* Insert a tweet
|
|
251
|
+
* @param options The tweet attributes
|
|
252
|
+
* @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
|
|
255
253
|
*/
|
|
256
|
-
|
|
254
|
+
setTweet: (options: SetTweetOptions) => ReturnType;
|
|
255
|
+
updateTweet: (options: SetTweetOptions) => ReturnType;
|
|
257
256
|
};
|
|
258
257
|
}
|
|
259
258
|
}
|
|
@@ -261,14 +260,15 @@ declare module '@tiptap/core' {
|
|
|
261
260
|
|
|
262
261
|
declare module '@tiptap/core' {
|
|
263
262
|
interface Commands<ReturnType> {
|
|
264
|
-
|
|
263
|
+
video: {
|
|
265
264
|
/**
|
|
266
|
-
*
|
|
267
|
-
* @param options The tweet attributes
|
|
268
|
-
* @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
|
|
265
|
+
* Add an video
|
|
269
266
|
*/
|
|
270
|
-
|
|
271
|
-
|
|
267
|
+
setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
268
|
+
/**
|
|
269
|
+
* Update an video
|
|
270
|
+
*/
|
|
271
|
+
updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
272
272
|
};
|
|
273
273
|
}
|
|
274
274
|
}
|
package/lib/Selection.d.ts
CHANGED
|
@@ -245,15 +245,14 @@ declare module '@tiptap/core' {
|
|
|
245
245
|
|
|
246
246
|
declare module '@tiptap/core' {
|
|
247
247
|
interface Commands<ReturnType> {
|
|
248
|
-
|
|
249
|
-
/**
|
|
250
|
-
* Add an video
|
|
251
|
-
*/
|
|
252
|
-
setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
248
|
+
twitter: {
|
|
253
249
|
/**
|
|
254
|
-
*
|
|
250
|
+
* Insert a tweet
|
|
251
|
+
* @param options The tweet attributes
|
|
252
|
+
* @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
|
|
255
253
|
*/
|
|
256
|
-
|
|
254
|
+
setTweet: (options: SetTweetOptions) => ReturnType;
|
|
255
|
+
updateTweet: (options: SetTweetOptions) => ReturnType;
|
|
257
256
|
};
|
|
258
257
|
}
|
|
259
258
|
}
|
|
@@ -261,14 +260,15 @@ declare module '@tiptap/core' {
|
|
|
261
260
|
|
|
262
261
|
declare module '@tiptap/core' {
|
|
263
262
|
interface Commands<ReturnType> {
|
|
264
|
-
|
|
263
|
+
video: {
|
|
265
264
|
/**
|
|
266
|
-
*
|
|
267
|
-
* @param options The tweet attributes
|
|
268
|
-
* @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
|
|
265
|
+
* Add an video
|
|
269
266
|
*/
|
|
270
|
-
|
|
271
|
-
|
|
267
|
+
setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
268
|
+
/**
|
|
269
|
+
* Update an video
|
|
270
|
+
*/
|
|
271
|
+
updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
272
272
|
};
|
|
273
273
|
}
|
|
274
274
|
}
|
package/lib/SlashCommand.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const A=require("./index-ByRfqzMr.cjs"),O=require("./dom-dataset-Byuf1YmW.cjs"),q=require("./index-BI-IcZcN.cjs"),D=require("tippy.js"),f=require("react/jsx-runtime"),x=require("react"),b=require("./RichTextEditor-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const A=require("./index-ByRfqzMr.cjs"),O=require("./dom-dataset-Byuf1YmW.cjs"),q=require("./index-BI-IcZcN.cjs"),D=require("tippy.js"),f=require("react/jsx-runtime"),x=require("react"),b=require("./RichTextEditor-BnC1uaUo.cjs"),h=require("./index-C19MB4Al.cjs");function P(i,d){var k,N;const[t,n]=x.useState(0),[e,o]=x.useState(0),r=x.useRef(null),{t:s}=h.useLocale(),u=x.useRef([]);x.useImperativeHandle(d,()=>({onKeyDown:g})),x.useEffect(()=>{if(!r.current)return;const l=e*1e3+t,c=u.current[l];c&&c.scrollIntoView({behavior:"smooth",block:"nearest"})},[t,e]);function g({event:l}){return l.key==="ArrowUp"?(C(),!0):l.key==="ArrowDown"?(R(),!0):l.key==="Enter"?(L(),!0):!1}function C(){var m;if(i.items.length===0)return!1;let l=t-1,c=e;l<0&&(c=e-1,l=((m=i.items[c])==null?void 0:m.commands.length)-1||0),c<0&&(c=i.items.length-1,l=i.items[c].commands.length-1),n(l),o(c)}function R(){if(i.items.length===0)return!1;const l=i.items[e].commands;let c=t+1,m=e;l.length-1<c&&(c=0,m=e+1),i.items.length-1<m&&(m=0),n(c),o(m)}function L(){if(i.items.length===0||e===-1||t===-1)return!1;v(e,t)}function v(l,c){const m=i.items[l].commands[c];i.command(m)}function H(l,c){v(l,c)}function I(l,c,m){u.current[l*1e3+c]=m}return f.jsx("div",{className:"richtext-mb-8 richtext-max-h-[min(80vh,24rem)] richtext-flex-wrap richtext-overflow-auto richtext-rounded-lg !richtext-border !richtext-border-neutral-200 !richtext-bg-white richtext-p-1 !richtext-text-black richtext-shadow-sm dark:!richtext-border-neutral-800 dark:!richtext-bg-black",ref:r,children:(k=i==null?void 0:i.items)!=null&&k.length?f.jsx("div",{className:"richtext-grid richtext-min-w-48 richtext-grid-cols-1 richtext-gap-0.5",children:(N=i==null?void 0:i.items)==null?void 0:N.map((l,c)=>f.jsxs(x.Fragment,{children:[f.jsx("div",{className:"richtext-col-[1/-1] richtext-mx-2 richtext-mt-2 richtext-select-none richtext-text-[0.65rem] richtext-font-semibold richtext-uppercase richtext-tracking-wider !richtext-text-neutral-500 first:richtext-mt-0.5",children:l.title}),l.commands.map((m,y)=>f.jsxs("button",{onClick:()=>H(c,y),ref:S=>I(c,y,S),className:b.cn("richtext-flex richtext-items-center richtext-gap-3 richtext-px-2 richtext-py-1.5 richtext-text-sm !richtext-text-neutral-800 dark:!richtext-text-neutral-200 richtext-text-left richtext-w-full richtext-rounded-sm richtext-outline-none richtext-transition-colors !richtext-bg-transparent hover:!richtext-bg-accent ",{"slash-command-active":e===c&&t===y}),children:[m.iconUrl&&f.jsx("img",{alt:"",className:"richtext-size-6",src:m.iconUrl}),m.iconName&&f.jsx(b.IconComponent,{className:"!richtext-mr-1 !richtext-text-lg",name:m.iconName}),m.label]},`command-${y}`))]},`slash-${l.title}`))}):f.jsx("div",{className:"richtext-p-3",children:f.jsx("span",{className:"richtext-text-xs richtext-text-gray-800 dark:richtext-text-gray-100",children:s("editor.slash.empty")})})})}const $=x.forwardRef(P),j={setOpen:(i,d)=>{b.dispatchEvent(b.EVENTS.UPLOAD_VIDEO(i),d)}};function B(i,d){const t=[{name:"format",title:h.localeActions.t("editor.slash.format"),commands:[]},{name:"insert",title:h.localeActions.t("editor.slash.insert"),commands:[]}];return i.forEach(n=>{n.name.toLowerCase()==="heading"&&n.options.levels.forEach(e=>{t[0].commands.push({name:`heading${e}`,label:h.localeActions.t(`editor.heading.h${e}.tooltip`),aliases:[`h${e}`,"bt",`bt${e}`],iconName:`Heading${e}`,action:({editor:o,range:r})=>{o.chain().focus().deleteRange(r).setHeading({level:e}).run()}})}),n.name.toLowerCase()==="bulletlist"&&t[0].commands.push({name:"bulletList",label:h.localeActions.t("editor.bulletlist.tooltip"),aliases:["ul","yxlb"],iconName:"List",action:({editor:e,range:o})=>{e.chain().focus().deleteRange(o).toggleBulletList().run()}}),n.name.toLowerCase()==="orderedlist"&&t[0].commands.push({name:"numberedList",label:h.localeActions.t("editor.orderedlist.tooltip"),aliases:["ol","yxlb"],iconName:"ListOrdered",action:({editor:e,range:o})=>{e.chain().focus().deleteRange(o).toggleOrderedList().run()}}),n.name.toLowerCase()==="tasklist"&&t[0].commands.push({name:"taskList",label:h.localeActions.t("editor.tasklist.tooltip"),iconName:"ListTodo",description:"Task list with todo items",aliases:["todo"],action:({editor:e,range:o})=>{e.chain().focus().deleteRange(o).toggleTaskList().run()}}),n.name.toLowerCase()==="blockquote"&&t[0].commands.push({name:"blockquote",label:h.localeActions.t("editor.blockquote.tooltip"),description:"插入引入格式",aliases:["yr"],iconName:"TextQuote",action:({editor:e,range:o})=>{e.chain().focus().deleteRange(o).setBlockquote().run()}}),n.name.toLowerCase()==="codeblock"&&t[0].commands.push({name:"codeBlock",label:h.localeActions.t("editor.codeblock.tooltip"),iconName:"Code2",description:"Code block with syntax highlighting",shouldBeHidden:e=>e.isActive("columns"),action:({editor:e,range:o})=>{e.chain().focus().deleteRange(o).setCodeBlock().run()}}),n.name.toLowerCase()===b.Image$1.name&&t[1].commands.push({name:"image",label:h.localeActions.t("editor.image.tooltip"),iconName:"ImageUp",description:"Insert a image",aliases:["image","tp","tupian"],shouldBeHidden:e=>e.isActive("columns"),action:({editor:e,range:o})=>{e.chain().focus().deleteRange(o).run(),b.actionDialogImage.setOpen(e.id,!0)}}),n.name.toLowerCase()===b.Video.name&&t[1].commands.push({name:"video",label:h.localeActions.t("editor.video.tooltip"),iconName:"Video",description:"Insert a video",aliases:["video","sp","shipin"],shouldBeHidden:e=>e.isActive("columns"),action:({editor:e,range:o})=>{e.chain().focus().deleteRange(o).run(),j.setOpen(e.id,!0)}}),n.name.toLowerCase()==="table"&&t[1].commands.push({name:"table",label:h.localeActions.t("editor.table.tooltip"),iconName:"Table",description:"Insert a table",aliases:["table","bg","biaoge","biao"],shouldBeHidden:e=>e.isActive("columns"),action:({editor:e,range:o})=>{e.chain().focus().deleteRange(o).insertTable({rows:3,cols:3,withHeaderRow:!1}).run()}}),n.name.toLowerCase()==="horizontalrule"&&t[1].commands.push({name:"horizontalRule",label:h.localeActions.t("editor.horizontalrule.tooltip"),iconName:"Minus",description:"Insert a horizontal divider",aliases:["hr","fgx","fg"],action:({editor:e,range:o})=>{e.chain().focus().deleteRange(o).setHorizontalRule().run()}}),n.name.toLowerCase()==="columns"&&t[1].commands.push({name:"columns",label:h.localeActions.t("editor.columns.tooltip"),iconName:"Columns2",description:"Add two column content",action:({editor:e})=>{e.chain().focus().insertColumns({cols:2}).run()}}),d==null||d(n,t)}),t}const w="slashCommand";let a;const E=A.Extension.create({name:w,priority:200,onCreate(){a=D("body",{interactive:!0,trigger:"manual",placement:"bottom-start",theme:"slash-command",maxWidth:"16rem",offset:[16,8],popperOptions:{strategy:"fixed",modifiers:[{name:"flip",enabled:!1}]}})},addProseMirrorPlugins(){return[q.Suggestion({editor:this.editor,char:"/",allowSpaces:!0,startOfLine:!0,pluginKey:new A.PluginKey(w),allow:({state:i,range:d})=>{var g,C,R;const t=i.doc.resolve(d.from),n=t.depth===1,e=t.parent.type.name==="paragraph",o=((g=t.parent.textContent)==null?void 0:g.charAt(0))==="/",r=this.editor.isActive("column"),s=(R=t.parent.textContent)==null?void 0:R.slice(Math.max(0,(C=t.parent.textContent)==null?void 0:C.indexOf("/"))),u=!(s!=null&&s.endsWith(" "));return(n&&e&&o||r&&e&&o)&&u},command:({editor:i,range:d,props:t})=>{const{view:n}=i;t.action({editor:i,range:d}),n.focus()},items:({query:i,editor:d})=>B(d.extensionManager.extensions,this.options.renderGroupItem).map(r=>({...r,commands:r.commands.filter(s=>{const u=s.label.toLowerCase().trim(),g=i.toLowerCase().trim();if(s.aliases){const C=s.aliases.map(v=>v.toLowerCase().trim()),R=u.match(g),L=C.some(v=>v.match(g));return R||L}return u.match(g)}).filter(s=>s.shouldBeHidden?!s.shouldBeHidden(this.editor):!0)})).filter(r=>r.commands.length>0).map(r=>({...r,commands:r.commands.map(s=>({...s,isEnabled:!0}))})),render:()=>{let i,d=null;return{onStart:t=>{var o;i=new O.ReactRenderer($,{props:t,editor:t.editor});const{view:n}=t.editor,e=()=>{if(!t.clientRect)return t.editor.storage[w].rect;const r=t.clientRect();if(!r)return t.editor.storage[w].rect;let s=r.y;if(r.top+i.element.offsetHeight+40>window.innerHeight){const u=r.top+i.element.offsetHeight-window.innerHeight+40;s=r.y-u}return new DOMRect(r.x,s,r.width,r.height)};d=()=>{a==null||a[0].setProps({getReferenceClientRect:e})},(o=n.dom.parentElement)==null||o.addEventListener("scroll",d),a==null||a[0].setProps({getReferenceClientRect:e,appendTo:()=>document.body,content:i.element}),a==null||a[0].show()},onUpdate(t){var r;i.updateProps(t);const{view:n}=t.editor,e=()=>{if(!t.clientRect)return t.editor.storage[w].rect;const s=t.clientRect();return s?new DOMRect(s.x,s.y,s.width,s.height):t.editor.storage[w].rect},o=()=>{a==null||a[0].setProps({getReferenceClientRect:e})};(r=n.dom.parentElement)==null||r.addEventListener("scroll",o),t.editor.storage[w].rect=t.clientRect?e():{width:0,height:0,left:0,top:0,right:0,bottom:0},a==null||a[0].setProps({getReferenceClientRect:e})},onKeyDown(t){var n;return t.event.key==="Escape"?(a==null||a[0].hide(),!0):(a!=null&&a[0].state.isShown||a==null||a[0].show(),(n=i.ref)==null?void 0:n.onKeyDown(t))},onExit(t){var n;if(a==null||a[0].hide(),d){const{view:e}=t.editor;(n=e.dom.parentElement)==null||n.removeEventListener("scroll",d)}i.destroy()}}}})]},addStorage(){return{rect:{width:0,height:0,left:0,top:0,right:0,bottom:0}}}});exports.SlashCommand=E;exports.default=E;
|
package/lib/SlashCommand.d.cts
CHANGED
|
@@ -272,15 +272,14 @@ declare module '@tiptap/core' {
|
|
|
272
272
|
|
|
273
273
|
declare module '@tiptap/core' {
|
|
274
274
|
interface Commands<ReturnType> {
|
|
275
|
-
|
|
276
|
-
/**
|
|
277
|
-
* Add an video
|
|
278
|
-
*/
|
|
279
|
-
setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
275
|
+
twitter: {
|
|
280
276
|
/**
|
|
281
|
-
*
|
|
277
|
+
* Insert a tweet
|
|
278
|
+
* @param options The tweet attributes
|
|
279
|
+
* @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
|
|
282
280
|
*/
|
|
283
|
-
|
|
281
|
+
setTweet: (options: SetTweetOptions) => ReturnType;
|
|
282
|
+
updateTweet: (options: SetTweetOptions) => ReturnType;
|
|
284
283
|
};
|
|
285
284
|
}
|
|
286
285
|
}
|
|
@@ -288,14 +287,15 @@ declare module '@tiptap/core' {
|
|
|
288
287
|
|
|
289
288
|
declare module '@tiptap/core' {
|
|
290
289
|
interface Commands<ReturnType> {
|
|
291
|
-
|
|
290
|
+
video: {
|
|
292
291
|
/**
|
|
293
|
-
*
|
|
294
|
-
* @param options The tweet attributes
|
|
295
|
-
* @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
|
|
292
|
+
* Add an video
|
|
296
293
|
*/
|
|
297
|
-
|
|
298
|
-
|
|
294
|
+
setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
295
|
+
/**
|
|
296
|
+
* Update an video
|
|
297
|
+
*/
|
|
298
|
+
updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
299
299
|
};
|
|
300
300
|
}
|
|
301
301
|
}
|
package/lib/SlashCommand.d.ts
CHANGED
|
@@ -272,15 +272,14 @@ declare module '@tiptap/core' {
|
|
|
272
272
|
|
|
273
273
|
declare module '@tiptap/core' {
|
|
274
274
|
interface Commands<ReturnType> {
|
|
275
|
-
|
|
276
|
-
/**
|
|
277
|
-
* Add an video
|
|
278
|
-
*/
|
|
279
|
-
setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
275
|
+
twitter: {
|
|
280
276
|
/**
|
|
281
|
-
*
|
|
277
|
+
* Insert a tweet
|
|
278
|
+
* @param options The tweet attributes
|
|
279
|
+
* @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
|
|
282
280
|
*/
|
|
283
|
-
|
|
281
|
+
setTweet: (options: SetTweetOptions) => ReturnType;
|
|
282
|
+
updateTweet: (options: SetTweetOptions) => ReturnType;
|
|
284
283
|
};
|
|
285
284
|
}
|
|
286
285
|
}
|
|
@@ -288,14 +287,15 @@ declare module '@tiptap/core' {
|
|
|
288
287
|
|
|
289
288
|
declare module '@tiptap/core' {
|
|
290
289
|
interface Commands<ReturnType> {
|
|
291
|
-
|
|
290
|
+
video: {
|
|
292
291
|
/**
|
|
293
|
-
*
|
|
294
|
-
* @param options The tweet attributes
|
|
295
|
-
* @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
|
|
292
|
+
* Add an video
|
|
296
293
|
*/
|
|
297
|
-
|
|
298
|
-
|
|
294
|
+
setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
295
|
+
/**
|
|
296
|
+
* Update an video
|
|
297
|
+
*/
|
|
298
|
+
updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
299
299
|
};
|
|
300
300
|
}
|
|
301
301
|
}
|
package/lib/SlashCommand.js
CHANGED
|
@@ -4,7 +4,7 @@ import { S as P } from "./index-CbQQFj2T.js";
|
|
|
4
4
|
import B from "tippy.js";
|
|
5
5
|
import { jsx as g, jsxs as k } from "react/jsx-runtime";
|
|
6
6
|
import { forwardRef as $, useState as N, useRef as E, useImperativeHandle as z, useEffect as M, Fragment as T } from "react";
|
|
7
|
-
import { d as V, k as U, q, E as K, R as G, U as F, V as j } from "./RichTextEditor-
|
|
7
|
+
import { d as V, k as U, q, E as K, R as G, U as F, V as j } from "./RichTextEditor-CqgbZwS5.js";
|
|
8
8
|
import { u as W, m as h } from "./index-Tj3Ci7xM.js";
|
|
9
9
|
function Q(i, m) {
|
|
10
10
|
var L, v;
|
package/lib/Strike.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-ByRfqzMr.cjs"),n=require("./RichTextEditor-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-ByRfqzMr.cjs"),n=require("./RichTextEditor-BnC1uaUo.cjs"),i=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,o=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,a=e.Mark.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",e.mergeAttributes(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[e.markInputRule({find:i,type:this.type})]},addPasteRules(){return[e.markPasteRule({find:o,type:this.type})]}}),u=a.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:r,t:s})=>({component:n.ActionButton,componentProps:{action:()=>r.commands.toggleStrike(),isActive:()=>r.isActive("strike")||!1,disabled:!1,icon:"Strikethrough",shortcutKeys:["shift","mod","S"],tooltip:s("editor.strike.tooltip")}})}}});exports.Strike=u;
|
package/lib/Strike.d.cts
CHANGED
|
@@ -316,15 +316,14 @@ declare module '@tiptap/core' {
|
|
|
316
316
|
|
|
317
317
|
declare module '@tiptap/core' {
|
|
318
318
|
interface Commands<ReturnType> {
|
|
319
|
-
|
|
320
|
-
/**
|
|
321
|
-
* Add an video
|
|
322
|
-
*/
|
|
323
|
-
setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
319
|
+
twitter: {
|
|
324
320
|
/**
|
|
325
|
-
*
|
|
321
|
+
* Insert a tweet
|
|
322
|
+
* @param options The tweet attributes
|
|
323
|
+
* @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
|
|
326
324
|
*/
|
|
327
|
-
|
|
325
|
+
setTweet: (options: SetTweetOptions) => ReturnType;
|
|
326
|
+
updateTweet: (options: SetTweetOptions) => ReturnType;
|
|
328
327
|
};
|
|
329
328
|
}
|
|
330
329
|
}
|
|
@@ -332,14 +331,15 @@ declare module '@tiptap/core' {
|
|
|
332
331
|
|
|
333
332
|
declare module '@tiptap/core' {
|
|
334
333
|
interface Commands<ReturnType> {
|
|
335
|
-
|
|
334
|
+
video: {
|
|
336
335
|
/**
|
|
337
|
-
*
|
|
338
|
-
* @param options The tweet attributes
|
|
339
|
-
* @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
|
|
336
|
+
* Add an video
|
|
340
337
|
*/
|
|
341
|
-
|
|
342
|
-
|
|
338
|
+
setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
339
|
+
/**
|
|
340
|
+
* Update an video
|
|
341
|
+
*/
|
|
342
|
+
updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
343
343
|
};
|
|
344
344
|
}
|
|
345
345
|
}
|
package/lib/Strike.d.ts
CHANGED
|
@@ -316,15 +316,14 @@ declare module '@tiptap/core' {
|
|
|
316
316
|
|
|
317
317
|
declare module '@tiptap/core' {
|
|
318
318
|
interface Commands<ReturnType> {
|
|
319
|
-
|
|
320
|
-
/**
|
|
321
|
-
* Add an video
|
|
322
|
-
*/
|
|
323
|
-
setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
319
|
+
twitter: {
|
|
324
320
|
/**
|
|
325
|
-
*
|
|
321
|
+
* Insert a tweet
|
|
322
|
+
* @param options The tweet attributes
|
|
323
|
+
* @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
|
|
326
324
|
*/
|
|
327
|
-
|
|
325
|
+
setTweet: (options: SetTweetOptions) => ReturnType;
|
|
326
|
+
updateTweet: (options: SetTweetOptions) => ReturnType;
|
|
328
327
|
};
|
|
329
328
|
}
|
|
330
329
|
}
|
|
@@ -332,14 +331,15 @@ declare module '@tiptap/core' {
|
|
|
332
331
|
|
|
333
332
|
declare module '@tiptap/core' {
|
|
334
333
|
interface Commands<ReturnType> {
|
|
335
|
-
|
|
334
|
+
video: {
|
|
336
335
|
/**
|
|
337
|
-
*
|
|
338
|
-
* @param options The tweet attributes
|
|
339
|
-
* @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
|
|
336
|
+
* Add an video
|
|
340
337
|
*/
|
|
341
|
-
|
|
342
|
-
|
|
338
|
+
setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
339
|
+
/**
|
|
340
|
+
* Update an video
|
|
341
|
+
*/
|
|
342
|
+
updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
343
343
|
};
|
|
344
344
|
}
|
|
345
345
|
}
|
package/lib/Strike.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { M as r, c as n, d as i, m as o } from "./index-DI9T3iLd.js";
|
|
2
|
-
import { A as a } from "./RichTextEditor-
|
|
2
|
+
import { A as a } from "./RichTextEditor-CqgbZwS5.js";
|
|
3
3
|
const u = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/, d = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g, m = r.create({
|
|
4
4
|
name: "strike",
|
|
5
5
|
addOptions() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./index-ByRfqzMr.cjs"),n=require("./index-Z4b9rzn-.cjs"),e=require("./RichTextEditor-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./index-ByRfqzMr.cjs"),n=require("./index-Z4b9rzn-.cjs"),e=require("./RichTextEditor-BnC1uaUo.cjs"),l=b.Extension.create({name:"subAndSuperScript",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:s,extension:o,t:p})=>{const c=o.options.subscript,r=o.options.superscript,u={component:e.ActionButton,componentProps:{action:()=>s.commands.toggleSubscript(),isActive:()=>s.isActive("subscript")||!1,disabled:!s.can().toggleSubscript(),icon:"Subscript",tooltip:p("editor.subscript.tooltip")}},a={component:e.ActionButton,componentProps:{action:()=>s.commands.toggleSuperscript(),isActive:()=>s.isActive("superscript")||!1,disabled:!s.can().toggleSuperscript(),icon:"Superscript",tooltip:p("editor.superscript.tooltip")}},i=[];return c!==!1&&i.push(u),r!==!1&&i.push(a),i}}},addExtensions(){const t=[];return this.options.subscript!==!1&&t.push(n.Subscript.configure(this.options.subscript)),this.options.superscript!==!1&&t.push(n.Superscript.configure(this.options.superscript)),t}});exports.SubAndSuperScript=l;
|
|
@@ -331,15 +331,14 @@ declare module '@tiptap/core' {
|
|
|
331
331
|
|
|
332
332
|
declare module '@tiptap/core' {
|
|
333
333
|
interface Commands<ReturnType> {
|
|
334
|
-
|
|
335
|
-
/**
|
|
336
|
-
* Add an video
|
|
337
|
-
*/
|
|
338
|
-
setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
334
|
+
twitter: {
|
|
339
335
|
/**
|
|
340
|
-
*
|
|
336
|
+
* Insert a tweet
|
|
337
|
+
* @param options The tweet attributes
|
|
338
|
+
* @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
|
|
341
339
|
*/
|
|
342
|
-
|
|
340
|
+
setTweet: (options: SetTweetOptions) => ReturnType;
|
|
341
|
+
updateTweet: (options: SetTweetOptions) => ReturnType;
|
|
343
342
|
};
|
|
344
343
|
}
|
|
345
344
|
}
|
|
@@ -347,14 +346,15 @@ declare module '@tiptap/core' {
|
|
|
347
346
|
|
|
348
347
|
declare module '@tiptap/core' {
|
|
349
348
|
interface Commands<ReturnType> {
|
|
350
|
-
|
|
349
|
+
video: {
|
|
351
350
|
/**
|
|
352
|
-
*
|
|
353
|
-
* @param options The tweet attributes
|
|
354
|
-
* @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
|
|
351
|
+
* Add an video
|
|
355
352
|
*/
|
|
356
|
-
|
|
357
|
-
|
|
353
|
+
setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
354
|
+
/**
|
|
355
|
+
* Update an video
|
|
356
|
+
*/
|
|
357
|
+
updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
358
358
|
};
|
|
359
359
|
}
|
|
360
360
|
}
|
|
@@ -331,15 +331,14 @@ declare module '@tiptap/core' {
|
|
|
331
331
|
|
|
332
332
|
declare module '@tiptap/core' {
|
|
333
333
|
interface Commands<ReturnType> {
|
|
334
|
-
|
|
335
|
-
/**
|
|
336
|
-
* Add an video
|
|
337
|
-
*/
|
|
338
|
-
setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
334
|
+
twitter: {
|
|
339
335
|
/**
|
|
340
|
-
*
|
|
336
|
+
* Insert a tweet
|
|
337
|
+
* @param options The tweet attributes
|
|
338
|
+
* @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
|
|
341
339
|
*/
|
|
342
|
-
|
|
340
|
+
setTweet: (options: SetTweetOptions) => ReturnType;
|
|
341
|
+
updateTweet: (options: SetTweetOptions) => ReturnType;
|
|
343
342
|
};
|
|
344
343
|
}
|
|
345
344
|
}
|
|
@@ -347,14 +346,15 @@ declare module '@tiptap/core' {
|
|
|
347
346
|
|
|
348
347
|
declare module '@tiptap/core' {
|
|
349
348
|
interface Commands<ReturnType> {
|
|
350
|
-
|
|
349
|
+
video: {
|
|
351
350
|
/**
|
|
352
|
-
*
|
|
353
|
-
* @param options The tweet attributes
|
|
354
|
-
* @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
|
|
351
|
+
* Add an video
|
|
355
352
|
*/
|
|
356
|
-
|
|
357
|
-
|
|
353
|
+
setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
354
|
+
/**
|
|
355
|
+
* Update an video
|
|
356
|
+
*/
|
|
357
|
+
updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
|
|
358
358
|
};
|
|
359
359
|
}
|
|
360
360
|
}
|
package/lib/SubAndSuperScript.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { E as a } from "./index-DI9T3iLd.js";
|
|
2
2
|
import { S as b, a as l } from "./index-LUL9mqY4.js";
|
|
3
|
-
import { A as r } from "./RichTextEditor-
|
|
3
|
+
import { A as r } from "./RichTextEditor-CqgbZwS5.js";
|
|
4
4
|
const g = /* @__PURE__ */ a.create({
|
|
5
5
|
name: "subAndSuperScript",
|
|
6
6
|
addOptions() {
|