@paroicms/tiptap-editor-plugin 1.1.1 → 1.2.0
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
.TpField{display:block;width:100%}.TpField-label{display:block;margin-bottom:4px}.TpField>input[type=text],.TpField>input[type=url],.TpField>input[type=email],.TpField>input[type=password],.TpField>input[type=number],.TpField>textarea{appearance:none;background:#fff;border:1px solid #d1d5db;border-radius:6px;
|
|
1
|
+
.TpField{display:block;width:100%}.TpField-label{display:block;margin-bottom:4px}.TpField>input[type=text],.TpField>input[type=url],.TpField>input[type=email],.TpField>input[type=password],.TpField>input[type=number],.TpField>textarea{display:block;width:100%;min-height:35px;padding:10px;font-size:1rem;color:#4b5563;appearance:none;background:#fff;border:1px solid #d1d5db;border-radius:6px;transition:background-color .2s,color .2s,border-color .2s,box-shadow .2s}.TpField input[type=number]{width:auto}.TpOption{display:flex;flex-wrap:wrap;gap:5px;width:100%;margin-bottom:5px}.TpOption-input{padding:10px;margin-left:8px;font-size:1rem;color:#4b5563;background:#fff;border:1px solid #d1d5db;border-radius:6px;transition:background-color .2s,color .2s,border-color .2s,box-shadow .2s}.TpBox{display:flex;flex-wrap:wrap;row-gap:5px;column-gap:25px}dl.TpProp{display:inline;margin:0;color:#777}dl.TpProp>dt{display:inline;margin:0 .5em 0 0;font-size:14px;font-weight:700}dl.TpProp>dd{display:inline;margin:0;font-size:14px}.TpBar{display:flex;align-items:center}.TpBar.spaceBetween{justify-content:space-between}.TpBtn{padding:.75rem 1.25rem;font-size:1rem;color:#fff;cursor:pointer;background-color:#6366f1;border:1px solid #6366f1;border-radius:6px;transition:background-color .2s,color .2s,border-color .2s,box-shadow .2s}.TpBtn.secondary{background-color:#64748b;border:1px solid #64748b}.TpBtn.danger{background-color:#ef4444;border:1px solid #ef4444}.TpBtn.outlined{color:inherit;background-color:transparent}.TpBtn.outlined:hover{background-color:#c6c7f6}.TpBtn.secondary.outlined{color:#64748b}.TpBtn.secondary.outlined:hover{background-color:#64748b0a}.TpBtn.danger.outlined{color:#ef4444}.TpBtn.danger.outlined:hover{background-color:#ef44440a}.TpMl2{margin-left:.5rem}.TpMr2{margin-right:.5rem}.TpMt4{margin-top:1rem}.TpSpinner{display:flex;align-items:center;justify-content:center;height:100%;&.center{position:absolute;top:50%;left:50%;z-index:10;transform:translate(-50%,-50%)}&:before{width:2rem;height:2rem;margin:auto;content:"";border:.25rem solid #ccc;border-top-color:#ff4a4a;border-radius:50%;animation:spinner-rotate .75s infinite linear}}@keyframes spinner-rotate{to{transform:rotate(360deg)}}
|
|
@@ -160,7 +160,7 @@ function Hc(n){return typeof n=="object"&&n!==null&&"j"in n}const Ff={en:{en:"En
|
|
|
160
160
|
>
|
|
161
161
|
${e.t("linkDialog.validate")}
|
|
162
162
|
</button>
|
|
163
|
-
`;Fe(f,h);const p=n.createModalDialog({header:s==="insert"?e.t("linkDialog.insertLink"):e.t("linkDialog.editLink"),content:d,footer:h});return await p.open()}const pE=mk.extend({addOptions(){return{...this.parent?.(),service:void 0,i18n:void 0}},addAttributes(){return{href:{default:null,parseHTML:n=>n.getAttribute("href")},target:{default:null,parseHTML:n=>n.getAttribute("target"),renderHTML:n=>n.target?{target:n.target}:{}},rel:{default:null,parseHTML:()=>null,renderHTML:()=>({})},class:{default:null,parseHTML:()=>null,renderHTML:()=>({})}}},addProseMirrorPlugins(){const n=this.parent?.()||[],e=this.options.service,t=this.options.i18n;if(!e||!t)return n;const r=(s,o)=>{const{state:a}=s,l=a.doc.resolve(o),d=l.marks().find(m=>m.type.name==="link");if(!d)return!1;const u=jn(l,d.type);if(!u)return!1;const{from:h,to:f}=u;return!(f-h>1&&(o<=h||o>=f))},i=async(s,o,a)=>{if(!r(s,o))return!1;a.preventDefault(),a.stopPropagation();const{state:l}=s,c=l.doc.resolve(o),u=c.marks().find(k=>k.type.name==="link");if(!u)return!1;const h=jn(c,u.type);if(!h)return!1;const{from:f,to:p}=h,m=u.attrs.href,g=u.attrs.target,b=l.doc.textBetween(f,p,"");try{const k=await Kh({service:e,i18n:t,initialLabel:b,initialHref:m,initialTarget:g,mode:"update"});if(!k)return s.focus(),!0;const{tr:E}=l;if(k.action==="remove")E.removeMark(f,p,u.type);else if(k.action==="update"&&k.values){E.removeMark(f,p,u.type),k.values.label!==b&&E.replaceWith(f,p,l.schema.text(k.values.label));const x=f+k.values.label.length;E.addMark(f,x,u.type.create({href:k.values.href,target:k.values.target}))}return s.dispatch(E),s.focus(),!0}catch(k){return e.logger.error("[CustomLink] Error handling click:",k),s.focus(),!0}};return[...n,new ne({key:new ce("linkClickHandler"),props:{handleClick(s,o,a){return r(s,o)?(i(s,o,a),!0):!1}}})]}});function Wh(n,e){return n.chain().focus().insertContent({type:"media",attrs:e}).run()}function mE(n,e,t,r,i,s){const o=e.clipboardData?.getData("text/plain");if(o&&s){const u=s.recognizeUrl(o);if(u)return e.preventDefault(),t?.chain().focus().insertPlatformVideo(u).run(),!0}const a=e.clipboardData?.items;if(!a)return!1;const l=[];for(const u of Array.from(a))if(u.type.startsWith("image/")){const h=u.getAsFile();h&&l.push(h)}if(l.length===0)return!1;e.preventDefault();const c=10,d=l.slice(0,c);return l.length>c&&r.
|
|
163
|
+
`;Fe(f,h);const p=n.createModalDialog({header:s==="insert"?e.t("linkDialog.insertLink"):e.t("linkDialog.editLink"),content:d,footer:h});return await p.open()}const pE=mk.extend({addOptions(){return{...this.parent?.(),service:void 0,i18n:void 0}},addAttributes(){return{href:{default:null,parseHTML:n=>n.getAttribute("href")},target:{default:null,parseHTML:n=>n.getAttribute("target"),renderHTML:n=>n.target?{target:n.target}:{}},rel:{default:null,parseHTML:()=>null,renderHTML:()=>({})},class:{default:null,parseHTML:()=>null,renderHTML:()=>({})}}},addProseMirrorPlugins(){const n=this.parent?.()||[],e=this.options.service,t=this.options.i18n;if(!e||!t)return n;const r=(s,o)=>{const{state:a}=s,l=a.doc.resolve(o),d=l.marks().find(m=>m.type.name==="link");if(!d)return!1;const u=jn(l,d.type);if(!u)return!1;const{from:h,to:f}=u;return!(f-h>1&&(o<=h||o>=f))},i=async(s,o,a)=>{if(!r(s,o))return!1;a.preventDefault(),a.stopPropagation();const{state:l}=s,c=l.doc.resolve(o),u=c.marks().find(k=>k.type.name==="link");if(!u)return!1;const h=jn(c,u.type);if(!h)return!1;const{from:f,to:p}=h,m=u.attrs.href,g=u.attrs.target,b=l.doc.textBetween(f,p,"");try{const k=await Kh({service:e,i18n:t,initialLabel:b,initialHref:m,initialTarget:g,mode:"update"});if(!k)return s.focus(),!0;const{tr:E}=l;if(k.action==="remove")E.removeMark(f,p,u.type);else if(k.action==="update"&&k.values){E.removeMark(f,p,u.type),k.values.label!==b&&E.replaceWith(f,p,l.schema.text(k.values.label));const x=f+k.values.label.length;E.addMark(f,x,u.type.create({href:k.values.href,target:k.values.target}))}return s.dispatch(E),s.focus(),!0}catch(k){return e.logger.error("[CustomLink] Error handling click:",k),s.focus(),!0}};return[...n,new ne({key:new ce("linkClickHandler"),props:{handleClick(s,o,a){return r(s,o)?(i(s,o,a),!0):!1}}})]}});function Wh(n,e){return n.chain().focus().insertContent({type:"media",attrs:e}).run()}function mE(n,e,t,r,i,s){const o=e.clipboardData?.getData("text/plain");if(o&&s){const u=s.recognizeUrl(o);if(u)return e.preventDefault(),t?.chain().focus().insertPlatformVideo(u).run(),!0}const a=e.clipboardData?.items;if(!a)return!1;const l=[];for(const u of Array.from(a))if(u.type.startsWith("image/")){const h=u.getAsFile();h&&l.push(h)}if(l.length===0)return!1;e.preventDefault();const c=10,d=l.slice(0,c);return l.length>c&&r.showAlert(i.t("tooManyImages",{count:String(c)}),{severity:"warning",autoDismiss:!0}),jh(d,t,r,i),!0}function gE(n,e,t,r,i){const s=e.dataTransfer?.files;if(!s||s.length===0)return!1;const o=[];for(const u of Array.from(s))u.type.startsWith("image/")&&o.push(u);if(o.length===0)return!1;e.preventDefault();const a={left:e.clientX,top:e.clientY},l=n.posAtCoords(a);l&&t?.commands.setTextSelection(l.pos);const c=10,d=o.slice(0,c);return o.length>c&&r.showAlert(i.t("tooManyImages",{count:String(c)}),{severity:"warning",autoDismiss:!0}),jh(d,t,r,i),!0}async function jh(n,e,t,r){for(const i of n)await bE(i,e,t,r)}async function bE(n,e,t,r){if(!t.uploadMedia){t.logger.warn("uploadMedia not available"),t.showAlert(r.t("uploadNotAvailable"),{severity:"error",autoDismiss:!0});return}try{const i=await t.uploadMedia(n);if(!i||i.kind!=="image"){t.logger.error("Failed to upload image or not an image"),t.showAlert(r.t("imageUploadFailed"),{severity:"error",autoDismiss:!0});return}const s=t.themeConf.fTextImageResizeRules[0];if(!e){t.logger.error("Editor not initialized");return}Wh(e,{mediaId:i.mediaId,resizeRule:s,align:"center",zoomable:!0,href:void 0})}catch(i){t.logger.error("Error uploading image:",i),t.showAlert(r.t("imageUploadFailed"),{severity:"error"})}}function $o(n){const e=document.createElement("span");return e.className=n?.center?"TpSpinner center":"TpSpinner",e}async function yE({service:n,fetchedOutput:e,initialValues:t,i18n:r}){const{mediaId:i}=t,{themeConf:s}=n;let o=t.resizeRule,a=t.align,l=t.zoomable,c=!!t.href,d=t.href??"",u;const h=s.fTextImageResizeRules.map((E,x)=>({resizeRule:E,label:r.t("mediaNode.variantLabel",{n:String(x+1)})})),f=[{align:"left",label:r.t("mediaNode.left")},{align:"center",label:r.t("mediaNode.center")},{align:"right",label:r.t("mediaNode.right")}],p=document.createElement("div");function m(){const E=z`
|
|
164
164
|
<h2 class="FieldLabel">${r.t("mediaNode.sizes")}</h2>
|
|
165
165
|
<div class="TpOption">
|
|
166
166
|
${h.map(x=>z`
|
|
@@ -484,16 +484,19 @@ function Hc(n){return typeof n=="object"&&n!==null&&"j"in n}const Ff={en:{en:"En
|
|
|
484
484
|
<div class="tiptap-content" @click=${this.handleContentClick}></div>
|
|
485
485
|
</div>
|
|
486
486
|
`}};kt.styles=[vt`
|
|
487
|
-
:host {
|
|
487
|
+
/* :host {
|
|
488
488
|
display: block;
|
|
489
|
-
|
|
490
|
-
border
|
|
491
|
-
|
|
492
|
-
}
|
|
489
|
+
background: var(--color-bg);
|
|
490
|
+
border: 1px solid var(--color-border);
|
|
491
|
+
border-radius: var(--radius);
|
|
492
|
+
} */
|
|
493
493
|
|
|
494
494
|
.tiptap-container {
|
|
495
495
|
display: flex;
|
|
496
496
|
flex-direction: column;
|
|
497
|
+
background: var(--color-bg);
|
|
498
|
+
border: 1px solid var(--color-border);
|
|
499
|
+
border-radius: var(--radius);
|
|
497
500
|
}
|
|
498
501
|
|
|
499
502
|
.tiptap-content {
|
|
@@ -584,7 +587,7 @@ function Hc(n){return typeof n=="object"&&n!==null&&"j"in n}const Ff={en:{en:"En
|
|
|
584
587
|
white-space: normal;
|
|
585
588
|
z-index: 10;
|
|
586
589
|
}
|
|
587
|
-
`,sE,wE,lE,AE,OE,uE];rn([Se({attribute:!1})],kt.prototype,"service",2);rn([Se({attribute:!1})],kt.prototype,"i18n",2);rn([Se({attribute:!1})],kt.prototype,"videoPluginHook",2);rn([Se({attribute:!1})],kt.prototype,"internalLinkPluginHook",2);rn([Se({attribute:!1})],kt.prototype,"initialContent",2);rn([Se({attribute:!1})],kt.prototype,"onChange",2);rn([Et()],kt.prototype,"editor",2);kt=rn([vs("tiptap-editor")],kt);async function PE(n,e,t){const r=await Uh({service:e,initialValues:{html:""},mode:"insert",i18n:t});if(r&&r.action==="insert"&&r.values){const{from:i}=n.state.selection;n.chain().focus().insertHtmlSnippet(r.values).run();const s=i+1;n.state.doc.resolve(s).nodeAfter?n.commands.setTextSelection(s):n.chain().insertContentAt(s,"<p></p>").setTextSelection(s+1).run()}}async function BE(n,e,t){const{state:r}=n,{from:i}=r.selection,o=r.doc.resolve(i).nodeAfter;if(o?.type.name==="internalLink"&&o){const c=o.attrs.documentId,d=await t.openDialog(c||"",{getLanguage:()=>e.language});if(!d)return;d.documentId?n.chain().focus().deleteRange({from:i,to:i+o.nodeSize}).insertInternalLink(d.documentId).run():n.chain().focus().deleteRange({from:i,to:i+o.nodeSize}).run();return}const l=await t.openDialog("",{getLanguage:()=>e.language});!l||!l.documentId||n.chain().focus().deleteSelection().insertInternalLink(l.documentId).run()}async function zE(n,e,t){const{state:r}=n,{from:i,to:s,empty:o}=r.selection;if(o){e.
|
|
590
|
+
`,sE,wE,lE,AE,OE,uE];rn([Se({attribute:!1})],kt.prototype,"service",2);rn([Se({attribute:!1})],kt.prototype,"i18n",2);rn([Se({attribute:!1})],kt.prototype,"videoPluginHook",2);rn([Se({attribute:!1})],kt.prototype,"internalLinkPluginHook",2);rn([Se({attribute:!1})],kt.prototype,"initialContent",2);rn([Se({attribute:!1})],kt.prototype,"onChange",2);rn([Et()],kt.prototype,"editor",2);kt=rn([vs("tiptap-editor")],kt);async function PE(n,e,t){const r=await Uh({service:e,initialValues:{html:""},mode:"insert",i18n:t});if(r&&r.action==="insert"&&r.values){const{from:i}=n.state.selection;n.chain().focus().insertHtmlSnippet(r.values).run();const s=i+1;n.state.doc.resolve(s).nodeAfter?n.commands.setTextSelection(s):n.chain().insertContentAt(s,"<p></p>").setTextSelection(s+1).run()}}async function BE(n,e,t){const{state:r}=n,{from:i}=r.selection,o=r.doc.resolve(i).nodeAfter;if(o?.type.name==="internalLink"&&o){const c=o.attrs.documentId,d=await t.openDialog(c||"",{getLanguage:()=>e.language});if(!d)return;d.documentId?n.chain().focus().deleteRange({from:i,to:i+o.nodeSize}).insertInternalLink(d.documentId).run():n.chain().focus().deleteRange({from:i,to:i+o.nodeSize}).run();return}const l=await t.openDialog("",{getLanguage:()=>e.language});!l||!l.documentId||n.chain().focus().deleteSelection().insertInternalLink(l.documentId).run()}async function zE(n,e,t){const{state:r}=n,{from:i,to:s,empty:o}=r.selection;if(o){e.showAlert("Please select text to obfuscate",{severity:"warning",autoDismiss:!0});return}if(n.isActive("obfuscate")){const c=r.selection.$from.marks().find(u=>u.type.name==="obfuscate"),d=r.doc.textBetween(i,s);if(c){const u=await Po({service:e,i18n:t,initialContent:d,initialAsALink:c.attrs.asALink,mode:"update"});if(!u)return;u.action==="remove"?n.chain().focus().unsetObfuscate().run():u.action==="update"&&u.values&&n.chain().focus().deleteSelection().insertContent(u.values.content).setTextSelection({from:i,to:i+u.values.content.length}).setObfuscate(u.values.asALink).run()}}else{const l=r.doc.textBetween(i,s),c=ME(l),d=await Po({service:e,i18n:t,initialContent:l,initialAsALink:c,mode:"insert"});if(!d||d.action!=="insert"||!d.values)return;n.chain().focus().deleteSelection().insertContent(d.values.content).setTextSelection({from:i,to:i+d.values.content.length}).setObfuscate(d.values.asALink).run()}}async function HE(n,e,t,r){const i=await Jh({service:e,i18n:t,mode:"insert",value:{videoId:"",platform:"youtube"},videoPluginHook:r});i&&i.action==="insert"&&i.value&&n.chain().focus().insertPlatformVideo(i.value).run()}var FE=Object.defineProperty,UE=Object.getOwnPropertyDescriptor,qe=(n,e,t,r)=>{for(var i=r>1?void 0:r?UE(e,t):e,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(r?o(e,t,i):o(i))||i);return r&&i&&FE(e,t,i),i};let Be=class extends Yt{constructor(){super(...arguments),this.options=[],this.buttonTooltip="",this.isOpen=!1,this.highlightedIndex=-1,this.highlightedSubmenuIndex=-1,this.openUpward=!1,this.submenuOpenLeft=!1,this.handleKeydown=n=>{if(!this.isOpen){(n.key==="Enter"||n.key===" "||n.key==="ArrowDown")&&(n.preventDefault(),this.openDropdown());return}if(this.openSubmenuId!==void 0)switch(n.key){case"ArrowDown":{n.preventDefault();const e=this.options[this.highlightedIndex]?.children??[];this.highlightedSubmenuIndex=(this.highlightedSubmenuIndex+1)%e.length;break}case"ArrowUp":{n.preventDefault();const e=this.options[this.highlightedIndex]?.children??[];this.highlightedSubmenuIndex=this.highlightedSubmenuIndex<=0?e.length-1:this.highlightedSubmenuIndex-1;break}case"ArrowLeft":n.preventDefault(),this.openSubmenuId=void 0,this.highlightedSubmenuIndex=-1;break;case"Enter":case" ":{n.preventDefault();const t=(this.options[this.highlightedIndex]?.children??[])[this.highlightedSubmenuIndex];t&&!t.disabled&&this.handleOptionClick(t);break}case"Escape":n.preventDefault(),this.closeDropdown(),this.buttonElement?.focus();break}else switch(n.key){case"ArrowDown":n.preventDefault(),this.highlightedIndex=(this.highlightedIndex+1)%this.options.length;break;case"ArrowUp":n.preventDefault(),this.highlightedIndex=this.highlightedIndex<=0?this.options.length-1:this.highlightedIndex-1;break;case"ArrowRight":{n.preventDefault();const e=this.options[this.highlightedIndex];e?.children&&e.children.length>0&&(this.openSubmenuId=e.id,this.highlightedSubmenuIndex=0);break}case"Enter":case" ":{n.preventDefault();const e=this.options[this.highlightedIndex];e&&(e.children&&e.children.length>0?(this.openSubmenuId=e.id,this.highlightedSubmenuIndex=0):e.disabled||this.handleOptionClick(e));break}case"Escape":n.preventDefault(),this.closeDropdown(),this.buttonElement?.focus();break}}}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this.handleKeydown)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",this.handleKeydown),this.removeClickOutsideListener(),this.clearHoverTimeout()}toggleDropdown(){this.isOpen?this.closeDropdown():this.openDropdown()}openDropdown(){this.isOpen=!0,this.highlightedIndex=-1,this.openSubmenuId=void 0,this.updateComplete.then(()=>{this.updatePositioning(),this.addClickOutsideListener()})}closeDropdown(){this.isOpen=!1,this.highlightedIndex=-1,this.highlightedSubmenuIndex=-1,this.openSubmenuId=void 0,this.openUpward=!1,this.submenuOpenLeft=!1,this.removeClickOutsideListener(),this.clearHoverTimeout()}updatePositioning(){if(!this.buttonElement||!this.panelElement)return;const n=this.buttonElement.getBoundingClientRect(),e=this.panelElement.offsetHeight,r=window.innerHeight-n.bottom;this.openUpward=r<e&&n.top>e}updateSubmenuPositioning(n){if(!this.submenuElement)return;const e=n.getBoundingClientRect(),t=this.submenuElement.offsetWidth,i=window.innerWidth-e.right;this.submenuOpenLeft=i<t&&e.left>t}addClickOutsideListener(){this.clickOutsideHandler=n=>{n.composedPath().includes(this)||this.closeDropdown()},document.addEventListener("click",this.clickOutsideHandler,!0)}removeClickOutsideListener(){this.clickOutsideHandler&&(document.removeEventListener("click",this.clickOutsideHandler,!0),this.clickOutsideHandler=void 0)}clearHoverTimeout(){this.hoverTimeoutId!==void 0&&(window.clearTimeout(this.hoverTimeoutId),this.hoverTimeoutId=void 0)}handleOptionMouseEnter(n,e){this.highlightedIndex=e,n.children&&n.children.length>0?(this.clearHoverTimeout(),this.hoverTimeoutId=window.setTimeout(()=>{this.openSubmenuId=n.id,this.updateComplete.then(()=>{const t=this.panelElement?.querySelector(`.option[data-index="${e}"]`);t&&this.updateSubmenuPositioning(t)})},200)):this.openSubmenuId=void 0}handleOptionMouseLeave(){this.clearHoverTimeout()}handleSubmenuMouseEnter(n){this.highlightedSubmenuIndex=n}async handleOptionClick(n){n.disabled||(n.action&&await n.action(),this.closeDropdown())}renderOption(n,e,t=!1){const r=["option",n.active?"active":"",n.disabled?"disabled":"",n.children?"has-submenu":"",(t?this.highlightedSubmenuIndex:this.highlightedIndex)===e?"highlighted":""].filter(Boolean).join(" ");return z`
|
|
588
591
|
${n.separator==="before"?z`<div class="separator"></div>`:""}
|
|
589
592
|
<div
|
|
590
593
|
class=${r}
|
|
@@ -856,7 +859,7 @@ function Hc(n){return typeof n=="object"&&n!==null&&"j"in n}const Ff={en:{en:"En
|
|
|
856
859
|
display: block;
|
|
857
860
|
}
|
|
858
861
|
}
|
|
859
|
-
`;Lt([Se({attribute:!1})],ut.prototype,"options",2);Lt([Se()],ut.prototype,"value",2);Lt([Se({attribute:!1})],ut.prototype,"i18n",2);Lt([Et()],ut.prototype,"isOpen",2);Lt([Et()],ut.prototype,"highlightedIndex",2);Lt([Et()],ut.prototype,"openUpward",2);Lt([Pr("button")],ut.prototype,"buttonElement",2);Lt([Pr(".panel")],ut.prototype,"panelElement",2);ut=Lt([vs("tiptap-styled-dropdown")],ut);const WE='<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"><path d="M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8"/></svg>',jE='<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"><polyline points="16 18 22 12 16 6"></polyline><polyline points="8 6 2 12 8 18"></polyline></svg>',qE='<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"><path d="M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0z"/><path d="M8 12h8"/></svg>',GE='<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-ellipsis-vertical-icon lucide-ellipsis-vertical"><circle cx="12" cy="12" r="1"/><circle cx="12" cy="5" r="1"/><circle cx="12" cy="19" r="1"/></svg>',JE='<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"><path d="m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21"/><path d="M22 21H7"/><path d="m5 11 9 9"/></svg>',ZE='<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-symlink-icon lucide-file-symlink"><path d="m10 18 3-3-3-3"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/><path d="M4 11V4a2 2 0 0 1 2-2h9l5 5v13a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h7"/></svg>',YE='<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"><line x1="19" x2="10" y1="4" y2="4"/><line x1="14" x2="5" y1="20" y2="20"/><line x1="15" x2="9" y1="4" y2="20"/></svg>',XE='<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"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg>',QE='<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"><path d="M10 12h11"/><path d="M10 18h11"/><path d="M10 6h11"/><path d="M4 10h2"/><path d="M4 6h1v4"/><path d="M6 18H4c0-1 2-2 2-3s-1-1.5-2-1"/></svg>',ex='<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"><path d="M3 12h.01"/><path d="M3 18h.01"/><path d="M3 6h.01"/><path d="M8 12h13"/><path d="M8 18h13"/><path d="M8 6h13"/></svg>',tx='<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"><rect width="18" height="11" x="3" y="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/></svg>',nx='<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-quote-icon lucide-quote"><path d="M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z"/><path d="M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z"/></svg>',rx='<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"><path d="M21 7v6h-6"/><path d="M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7"/></svg>',ix='<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"><rect width="18" height="18" x="3" y="3" rx="2"></rect><path d="m10 10-2 2 2 2"></path><path d="m14 14 2-2-2-2"></path></svg>',sx='<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"><path d="M16 4H9a3 3 0 0 0-2.83 4"/><path d="M14 12a4 4 0 0 1 0 8H6"/><line x1="4" x2="20" y1="12" y2="12"/></svg>',ox='<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"><path d="M3 12h18"/><path d="M6 18h12"/><path d="M3 6h18"/></svg>',ax='<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"><path d="M3 12h18"/><path d="M9 18h12"/><path d="M3 6h18"/></svg>',lx='<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"><path d="M3 12h18"/><path d="M3 18h12"/><path d="M3 6h18"/></svg>',cx='<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"><path d="M3 7v6h6"/><path d="M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13"/></svg>';function ke(n){return z`${Vh(n)}`}var dx=Object.defineProperty,ux=Object.getOwnPropertyDescriptor,Xn=(n,e,t,r)=>{for(var i=r>1?void 0:r?ux(e,t):e,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(r?o(e,t,i):o(i))||i);return r&&i&&dx(e,t,i),i};let en=class extends Yt{refresh(){this.requestUpdate()}toggleBold(){this.editor?.chain().focus().toggleBold().run()}toggleItalic(){this.editor?.chain().focus().toggleItalic().run()}toggleStrike(){this.editor?.chain().focus().toggleStrike().run()}setHeading(n){n===0?this.editor?.chain().focus().setParagraph().run():this.editor?.chain().focus().setHeading({level:n}).run()}toggleBulletList(){this.editor?.chain().focus().toggleBulletList().run()}toggleOrderedList(){this.editor?.chain().focus().toggleOrderedList().run()}toggleBlockquote(){this.editor?.chain().focus().toggleBlockquote().run()}async setLink(){if(!this.editor||!this.service||!this.i18n)return;const{state:n}=this.editor,{from:e,to:t}=n.selection,r=n.doc.textBetween(e,t,""),i=await Kh({service:this.service,i18n:this.i18n,initialLabel:r,mode:"insert"});!i||!i.values||(r&&r!==i.values.label?this.editor.chain().focus().deleteSelection().insertContent(i.values.label).setTextSelection({from:e,to:e+i.values.label.length}).setMark("link",{href:i.values.href,target:i.values.target}).setTextSelection(e+i.values.label.length).run():r?this.editor.chain().focus().setLink({href:i.values.href,target:i.values.target}).setTextSelection(t).run():this.editor.chain().focus().insertContent(i.values.label).setTextSelection({from:e,to:e+i.values.label.length}).setMark("link",{href:i.values.href,target:i.values.target}).setTextSelection(e+i.values.label.length).run())}setAlignment(n){n===""?this.editor?.chain().focus().unsetTextAlign().run():this.editor?.chain().focus().setTextAlign(n).run()}setTextSize(n){const e=this.editor;e&&(n===""?e.chain().focus().unsetMark("textSize").run():e.chain().focus().setMark("textSize",{value:n}).run())}undo(){this.editor?.chain().focus().undo().run()}redo(){this.editor?.chain().focus().redo().run()}clearFormatting(){this.editor?.chain().focus().clearNodes().unsetAllMarks().run()}toggleCode(){this.editor?.chain().focus().toggleCode().run()}toggleCodeBlock(){this.editor?.chain().focus().toggleCodeBlock().run()}async handleInsertHtmlSnippet(){!this.editor||!this.service||!this.i18n||await PE(this.editor,this.service,this.i18n)}async handleToggleObfuscate(){!this.editor||!this.service||!this.i18n||await zE(this.editor,this.service,this.i18n)}async handleInsertVideo(){if(!(!this.editor||!this.service||!this.i18n)){if(!this.videoPluginHook){this.service.showToast("Video plugin not available",{severity:"warn"});return}await HE(this.editor,this.service,this.i18n,this.videoPluginHook)}}async handleToggleInternalLink(){if(!(!this.editor||!this.service||!this.i18n)){if(!this.internalLinkPluginHook){this.service.showToast("Internal link plugin not available",{severity:"warn"});return}await BE(this.editor,this.service,this.internalLinkPluginHook)}}render(){if(!this.editor)return z``;const n=[{value:"0",tooltip:this.i18n?.t("toolbar.paragraph")??"Paragraph",content:z`<span style="font-size: 1em; font-weight: normal;">${this.i18n?.t("toolbar.paragraph")??"Paragraph"}</span>`,buttonContent:z`<b>${this.i18n?.t("toolbar.paragraphShort")??"P"}</b>`},{value:"2",tooltip:this.i18n?.t("toolbar.heading2")??"Heading 2",content:z`<span style="font-size: 1.5em; font-weight: bold;">${this.i18n?.t("toolbar.heading2")??"Heading 2"}</span>`,buttonContent:z`<b>${this.i18n?.t("toolbar.heading2Short")??"H2"}</b>`},{value:"3",tooltip:this.i18n?.t("toolbar.heading3")??"Heading 3",content:z`<span style="font-size: 1.17em; font-weight: bold;">${this.i18n?.t("toolbar.heading3")??"Heading 3"}</span>`,buttonContent:z`<b>${this.i18n?.t("toolbar.heading3Short")??"H3"}</b>`},{value:"4",tooltip:this.i18n?.t("toolbar.heading4")??"Heading 4",content:z`<span style="font-size: 1em; font-weight: bold;">${this.i18n?.t("toolbar.heading4")??"Heading 4"}</span>`,buttonContent:z`<b>${this.i18n?.t("toolbar.heading4Short")??"H4"}</b>`}],e=this.editor.isActive("heading",{level:2})?"2":this.editor.isActive("heading",{level:3})?"3":this.editor.isActive("heading",{level:4})?"4":"0",t=[];t.push({id:"obfuscate",label:this.i18n?.t("toolbar.obfuscate")??"Obfuscate",icon:ke(tx),tooltip:this.i18n?.t("toolbar.obfuscate")??"Obfuscate",action:()=>this.handleToggleObfuscate(),active:this.editor.isActive("obfuscate"),separator:"after"}),this.service?.configuration?.code&&(t.push({id:"code-block",label:this.i18n?.t("toolbar.codeBlock")??"Code Block",icon:ke(ix),tooltip:this.i18n?.t("toolbar.codeBlock")??"Code Block",action:()=>this.toggleCodeBlock(),active:this.editor.isActive("codeBlock")}),t.push({id:"inline-code",label:this.i18n?.t("toolbar.code")??"Inline Code",icon:ke(jE),tooltip:this.i18n?.t("toolbar.code")??"Inline Code",action:()=>this.toggleCode(),active:this.editor.isActive("code"),separator:"after"})),t.push({id:"html-snippet",label:this.i18n?.t("htmlSnippetNode.insertHtmlSnippet")??"Insert HTML Snippet",icon:ke(qE),tooltip:this.i18n?.t("htmlSnippetNode.insertHtmlSnippet")??"Insert HTML Snippet",action:()=>this.handleInsertHtmlSnippet()}),this.videoPluginHook&&t.push({id:"video",label:this.i18n?.t("platformVideo.insertVideo")??"Insert Video",icon:ke(Gh),tooltip:this.i18n?.t("platformVideo.insertVideo")??"Insert Video",action:()=>this.handleInsertVideo()}),t.length>0&&(t[t.length-1].separator="after");const r=this.editor.isActive("textSize",{value:"small"})?"small":this.editor.isActive("textSize",{value:"large"})?"large":this.editor.isActive("textSize",{value:"huge"})?"huge":"";return t.push({id:"text-size",label:this.i18n?.t("toolbar.textSize")??"Text size",tooltip:this.i18n?.t("toolbar.textSize")??"Text size",children:[{id:"text-size-small",label:this.i18n?.t("toolbar.textSizeSmall")??"Small",content:z`<span style="font-size: 0.5625em;">${this.i18n?.t("toolbar.textSizeSmall")??"Small"}</span>`,tooltip:this.i18n?.t("toolbar.textSizeSmall")??"Small",action:()=>this.setTextSize("small"),active:r==="small"},{id:"text-size-normal",label:this.i18n?.t("toolbar.textSizeNormal")??"Normal",content:z`<span style="font-size: 1em;">${this.i18n?.t("toolbar.textSizeNormal")??"Normal"}</span>`,tooltip:this.i18n?.t("toolbar.textSizeNormal")??"Normal",action:()=>this.setTextSize(""),active:r===""},{id:"text-size-large",label:this.i18n?.t("toolbar.textSizeLarge")??"Large",content:z`<span style="font-size: 2em;">${this.i18n?.t("toolbar.textSizeLarge")??"Large"}</span>`,tooltip:this.i18n?.t("toolbar.textSizeLarge")??"Large",action:()=>this.setTextSize("large"),active:r==="large"},{id:"text-size-huge",label:this.i18n?.t("toolbar.textSizeHuge")??"Huge",content:z`<span style="font-size: 4em;">${this.i18n?.t("toolbar.textSizeHuge")??"Huge"}</span>`,tooltip:this.i18n?.t("toolbar.textSizeHuge")??"Huge",action:()=>this.setTextSize("huge"),active:r==="huge"}]}),t.push({id:"clear-formatting",label:this.i18n?.t("toolbar.clearFormatting")??"Clear Formatting",icon:ke(JE),tooltip:this.i18n?.t("toolbar.clearFormatting")??"Clear Formatting",action:()=>this.clearFormatting(),separator:"before"}),z`
|
|
862
|
+
`;Lt([Se({attribute:!1})],ut.prototype,"options",2);Lt([Se()],ut.prototype,"value",2);Lt([Se({attribute:!1})],ut.prototype,"i18n",2);Lt([Et()],ut.prototype,"isOpen",2);Lt([Et()],ut.prototype,"highlightedIndex",2);Lt([Et()],ut.prototype,"openUpward",2);Lt([Pr("button")],ut.prototype,"buttonElement",2);Lt([Pr(".panel")],ut.prototype,"panelElement",2);ut=Lt([vs("tiptap-styled-dropdown")],ut);const WE='<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"><path d="M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8"/></svg>',jE='<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"><polyline points="16 18 22 12 16 6"></polyline><polyline points="8 6 2 12 8 18"></polyline></svg>',qE='<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"><path d="M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0z"/><path d="M8 12h8"/></svg>',GE='<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-ellipsis-vertical-icon lucide-ellipsis-vertical"><circle cx="12" cy="12" r="1"/><circle cx="12" cy="5" r="1"/><circle cx="12" cy="19" r="1"/></svg>',JE='<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"><path d="m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21"/><path d="M22 21H7"/><path d="m5 11 9 9"/></svg>',ZE='<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-symlink-icon lucide-file-symlink"><path d="m10 18 3-3-3-3"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/><path d="M4 11V4a2 2 0 0 1 2-2h9l5 5v13a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h7"/></svg>',YE='<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"><line x1="19" x2="10" y1="4" y2="4"/><line x1="14" x2="5" y1="20" y2="20"/><line x1="15" x2="9" y1="4" y2="20"/></svg>',XE='<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"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg>',QE='<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"><path d="M10 12h11"/><path d="M10 18h11"/><path d="M10 6h11"/><path d="M4 10h2"/><path d="M4 6h1v4"/><path d="M6 18H4c0-1 2-2 2-3s-1-1.5-2-1"/></svg>',ex='<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"><path d="M3 12h.01"/><path d="M3 18h.01"/><path d="M3 6h.01"/><path d="M8 12h13"/><path d="M8 18h13"/><path d="M8 6h13"/></svg>',tx='<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"><rect width="18" height="11" x="3" y="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/></svg>',nx='<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-quote-icon lucide-quote"><path d="M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z"/><path d="M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z"/></svg>',rx='<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"><path d="M21 7v6h-6"/><path d="M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7"/></svg>',ix='<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"><rect width="18" height="18" x="3" y="3" rx="2"></rect><path d="m10 10-2 2 2 2"></path><path d="m14 14 2-2-2-2"></path></svg>',sx='<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"><path d="M16 4H9a3 3 0 0 0-2.83 4"/><path d="M14 12a4 4 0 0 1 0 8H6"/><line x1="4" x2="20" y1="12" y2="12"/></svg>',ox='<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"><path d="M3 12h18"/><path d="M6 18h12"/><path d="M3 6h18"/></svg>',ax='<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"><path d="M3 12h18"/><path d="M9 18h12"/><path d="M3 6h18"/></svg>',lx='<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"><path d="M3 12h18"/><path d="M3 18h12"/><path d="M3 6h18"/></svg>',cx='<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"><path d="M3 7v6h6"/><path d="M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13"/></svg>';function ke(n){return z`${Vh(n)}`}var dx=Object.defineProperty,ux=Object.getOwnPropertyDescriptor,Xn=(n,e,t,r)=>{for(var i=r>1?void 0:r?ux(e,t):e,s=n.length-1,o;s>=0;s--)(o=n[s])&&(i=(r?o(e,t,i):o(i))||i);return r&&i&&dx(e,t,i),i};let en=class extends Yt{refresh(){this.requestUpdate()}toggleBold(){this.editor?.chain().focus().toggleBold().run()}toggleItalic(){this.editor?.chain().focus().toggleItalic().run()}toggleStrike(){this.editor?.chain().focus().toggleStrike().run()}setHeading(n){n===0?this.editor?.chain().focus().setParagraph().run():this.editor?.chain().focus().setHeading({level:n}).run()}toggleBulletList(){this.editor?.chain().focus().toggleBulletList().run()}toggleOrderedList(){this.editor?.chain().focus().toggleOrderedList().run()}toggleBlockquote(){this.editor?.chain().focus().toggleBlockquote().run()}async setLink(){if(!this.editor||!this.service||!this.i18n)return;const{state:n}=this.editor,{from:e,to:t}=n.selection,r=n.doc.textBetween(e,t,""),i=await Kh({service:this.service,i18n:this.i18n,initialLabel:r,mode:"insert"});!i||!i.values||(r&&r!==i.values.label?this.editor.chain().focus().deleteSelection().insertContent(i.values.label).setTextSelection({from:e,to:e+i.values.label.length}).setMark("link",{href:i.values.href,target:i.values.target}).setTextSelection(e+i.values.label.length).run():r?this.editor.chain().focus().setLink({href:i.values.href,target:i.values.target}).setTextSelection(t).run():this.editor.chain().focus().insertContent(i.values.label).setTextSelection({from:e,to:e+i.values.label.length}).setMark("link",{href:i.values.href,target:i.values.target}).setTextSelection(e+i.values.label.length).run())}setAlignment(n){n===""?this.editor?.chain().focus().unsetTextAlign().run():this.editor?.chain().focus().setTextAlign(n).run()}setTextSize(n){const e=this.editor;e&&(n===""?e.chain().focus().unsetMark("textSize").run():e.chain().focus().setMark("textSize",{value:n}).run())}undo(){this.editor?.chain().focus().undo().run()}redo(){this.editor?.chain().focus().redo().run()}clearFormatting(){this.editor?.chain().focus().clearNodes().unsetAllMarks().run()}toggleCode(){this.editor?.chain().focus().toggleCode().run()}toggleCodeBlock(){this.editor?.chain().focus().toggleCodeBlock().run()}async handleInsertHtmlSnippet(){!this.editor||!this.service||!this.i18n||await PE(this.editor,this.service,this.i18n)}async handleToggleObfuscate(){!this.editor||!this.service||!this.i18n||await zE(this.editor,this.service,this.i18n)}async handleInsertVideo(){if(!(!this.editor||!this.service||!this.i18n)){if(!this.videoPluginHook){this.service.showAlert(this.i18n?.t("warnings.videoPluginNotAvailable")??"Video plugin not available",{severity:"warning",autoDismiss:!0});return}await HE(this.editor,this.service,this.i18n,this.videoPluginHook)}}async handleToggleInternalLink(){if(!(!this.editor||!this.service||!this.i18n)){if(!this.internalLinkPluginHook){this.service.showAlert(this.i18n?.t("warnings.internalLinkPluginNotAvailable")??"Internal link plugin not available",{severity:"warning",autoDismiss:!0});return}await BE(this.editor,this.service,this.internalLinkPluginHook)}}render(){if(!this.editor)return z``;const n=[{value:"0",tooltip:this.i18n?.t("toolbar.paragraph")??"Paragraph",content:z`<span style="font-size: 1em; font-weight: normal;">${this.i18n?.t("toolbar.paragraph")??"Paragraph"}</span>`,buttonContent:z`<b>${this.i18n?.t("toolbar.paragraphShort")??"P"}</b>`},{value:"2",tooltip:this.i18n?.t("toolbar.heading2")??"Heading 2",content:z`<span style="font-size: 1.5em; font-weight: bold;">${this.i18n?.t("toolbar.heading2")??"Heading 2"}</span>`,buttonContent:z`<b>${this.i18n?.t("toolbar.heading2Short")??"H2"}</b>`},{value:"3",tooltip:this.i18n?.t("toolbar.heading3")??"Heading 3",content:z`<span style="font-size: 1.17em; font-weight: bold;">${this.i18n?.t("toolbar.heading3")??"Heading 3"}</span>`,buttonContent:z`<b>${this.i18n?.t("toolbar.heading3Short")??"H3"}</b>`},{value:"4",tooltip:this.i18n?.t("toolbar.heading4")??"Heading 4",content:z`<span style="font-size: 1em; font-weight: bold;">${this.i18n?.t("toolbar.heading4")??"Heading 4"}</span>`,buttonContent:z`<b>${this.i18n?.t("toolbar.heading4Short")??"H4"}</b>`}],e=this.editor.isActive("heading",{level:2})?"2":this.editor.isActive("heading",{level:3})?"3":this.editor.isActive("heading",{level:4})?"4":"0",t=[];t.push({id:"obfuscate",label:this.i18n?.t("toolbar.obfuscate")??"Obfuscate",icon:ke(tx),tooltip:this.i18n?.t("toolbar.obfuscate")??"Obfuscate",action:()=>this.handleToggleObfuscate(),active:this.editor.isActive("obfuscate"),separator:"after"}),this.service?.configuration?.code&&(t.push({id:"code-block",label:this.i18n?.t("toolbar.codeBlock")??"Code Block",icon:ke(ix),tooltip:this.i18n?.t("toolbar.codeBlock")??"Code Block",action:()=>this.toggleCodeBlock(),active:this.editor.isActive("codeBlock")}),t.push({id:"inline-code",label:this.i18n?.t("toolbar.code")??"Inline Code",icon:ke(jE),tooltip:this.i18n?.t("toolbar.code")??"Inline Code",action:()=>this.toggleCode(),active:this.editor.isActive("code"),separator:"after"})),t.push({id:"html-snippet",label:this.i18n?.t("htmlSnippetNode.insertHtmlSnippet")??"Insert HTML Snippet",icon:ke(qE),tooltip:this.i18n?.t("htmlSnippetNode.insertHtmlSnippet")??"Insert HTML Snippet",action:()=>this.handleInsertHtmlSnippet()}),this.videoPluginHook&&t.push({id:"video",label:this.i18n?.t("platformVideo.insertVideo")??"Insert Video",icon:ke(Gh),tooltip:this.i18n?.t("platformVideo.insertVideo")??"Insert Video",action:()=>this.handleInsertVideo()}),t.length>0&&(t[t.length-1].separator="after");const r=this.editor.isActive("textSize",{value:"small"})?"small":this.editor.isActive("textSize",{value:"large"})?"large":this.editor.isActive("textSize",{value:"huge"})?"huge":"";return t.push({id:"text-size",label:this.i18n?.t("toolbar.textSize")??"Text size",tooltip:this.i18n?.t("toolbar.textSize")??"Text size",children:[{id:"text-size-small",label:this.i18n?.t("toolbar.textSizeSmall")??"Small",content:z`<span style="font-size: 0.5625em;">${this.i18n?.t("toolbar.textSizeSmall")??"Small"}</span>`,tooltip:this.i18n?.t("toolbar.textSizeSmall")??"Small",action:()=>this.setTextSize("small"),active:r==="small"},{id:"text-size-normal",label:this.i18n?.t("toolbar.textSizeNormal")??"Normal",content:z`<span style="font-size: 1em;">${this.i18n?.t("toolbar.textSizeNormal")??"Normal"}</span>`,tooltip:this.i18n?.t("toolbar.textSizeNormal")??"Normal",action:()=>this.setTextSize(""),active:r===""},{id:"text-size-large",label:this.i18n?.t("toolbar.textSizeLarge")??"Large",content:z`<span style="font-size: 2em;">${this.i18n?.t("toolbar.textSizeLarge")??"Large"}</span>`,tooltip:this.i18n?.t("toolbar.textSizeLarge")??"Large",action:()=>this.setTextSize("large"),active:r==="large"},{id:"text-size-huge",label:this.i18n?.t("toolbar.textSizeHuge")??"Huge",content:z`<span style="font-size: 4em;">${this.i18n?.t("toolbar.textSizeHuge")??"Huge"}</span>`,tooltip:this.i18n?.t("toolbar.textSizeHuge")??"Huge",action:()=>this.setTextSize("huge"),active:r==="huge"}]}),t.push({id:"clear-formatting",label:this.i18n?.t("toolbar.clearFormatting")??"Clear Formatting",icon:ke(JE),tooltip:this.i18n?.t("toolbar.clearFormatting")??"Clear Formatting",action:()=>this.clearFormatting(),separator:"before"}),z`
|
|
860
863
|
<div class="toolbar">
|
|
861
864
|
<tiptap-styled-dropdown
|
|
862
865
|
.options=${n}
|
|
@@ -999,4 +1002,4 @@ function Hc(n){return typeof n=="object"&&n!==null&&"j"in n}const Ff={en:{en:"En
|
|
|
999
1002
|
height: 18px;
|
|
1000
1003
|
display: block;
|
|
1001
1004
|
}
|
|
1002
|
-
`;Xn([Se({attribute:!1})],en.prototype,"editor",2);Xn([Se({attribute:!1})],en.prototype,"service",2);Xn([Se({attribute:!1})],en.prototype,"i18n",2);Xn([Se({attribute:!1})],en.prototype,"videoPluginHook",2);Xn([Se({attribute:!1})],en.prototype,"internalLinkPluginHook",2);en=Xn([vs("tiptap-toolbar")],en);function hx(){const n={videoPlugin:void 0,internalLinkPlugin:void 0};return{get videoPlugin(){return n.videoPlugin},get internalLinkPlugin(){return n.internalLinkPlugin},service:{registerVideoPlugin(e){if(n.videoPlugin)throw new Error("Video plugin already registered");n.videoPlugin=e},registerInternalLinkPlugin(e){if(n.internalLinkPlugin)throw new Error("Internal link plugin already registered");n.internalLinkPlugin=e}}}}const fx="Entfernen",px="Validieren",mx="Abbrechen",gx="Bild",bx="auto",yx="Bild wird hochgeladen…",kx="Bild erfolgreich hochgeladen",vx="Fehler beim Hochladen des Bildes",Ex="Upload-Funktion nicht verfügbar",xx="Zu viele Bilder. Nur die ersten {{ count }} werden verarbeitet.",Sx={htmlSnippet:"HTML-Snippet",insertHtmlSnippet:"HTML-Snippet einfügen",confirmDeletion:"Löschung bestätigen",htmlSnippetDeletionConfirm:"Sind Sie sicher, dass Sie dieses HTML-Snippet löschen möchten?"},wx={obfuscate:"Verschleiern",obfuscator:"Verschleierer",content:"Inhalt",asALink:"Als Link",doNotObfuscate:"Nicht verschleiern",done:"Fertig"},Tx={imageProperties:"Bildeigenschaften",sizes:"Größen",variantLabel:"Größe {{ n }}",alignment:"Ausrichtung",left:"Links",center:"Zentriert",right:"Rechts",options:"Optionen",link:"Link",enableZoom:"Zoom aktivieren",mediaProperties:"Medieneigenschaften",caption:"Bildunterschrift",pixelRatio:"Pixelverhältnis"},Mx={insertVideo:"Video einfügen",videoDialog:"Video festlegen"},Cx={insertInternalLink:"Internen Link einfügen"},Ax={editLink:"Link bearbeiten",insertLink:"Link einfügen",label:"Beschriftung",url:"URL",openInNewTab:"In neuem Tab öffnen",openLink:"Link öffnen",removeLink:"Link entfernen",validate:"Validieren"},Nx={paragraph:"Absatz",paragraphShort:"A",heading2:"Überschrift 2",heading2Short:"Ü2",heading3:"Überschrift 3",heading3Short:"Ü3",heading4:"Überschrift 4",heading4Short:"Ü4",bold:"Fett",italic:"Kursiv",strikethrough:"Durchgestrichen",obfuscate:"Verschleiern",blockquote:"Zitat",bulletList:"Aufzählungsliste",orderedList:"Nummerierte Liste",link:"Link",code:"Inline-Code",codeBlock:"Codeblock",alignmentDefault:"Standard",alignmentCenter:"Zentriert",alignmentRight:"Rechts",textSize:"Textgröße",textSizeSmall:"Klein",textSizeNormal:"Normal",textSizeLarge:"Groß",textSizeHuge:"Sehr groß",undo:"Rückgängig",redo:"Wiederholen",clearFormatting:"Formatierung löschen",more:"Mehr"},_x={remove:fx,validate:px,cancel:mx,delete:"Löschen",image:gx,auto:bx,uploadingImage:yx,imageUploadSuccess:kx,imageUploadFailed:vx,uploadNotAvailable:Ex,tooManyImages:xx,htmlSnippetNode:Sx,obfuscateMark:wx,mediaNode:Tx,platformVideo:Mx,internalLinkNode:Cx,linkDialog:Ax,toolbar:Nx},Ox="Remove",Ix="Validate",Lx="Cancel",Rx="Image",Dx="Auto",$x="Uploading image…",Px="Image uploaded successfully",Bx="Failed to upload image",zx="Upload functionality not available",Hx="Too many images. Only the first {{ count }} will be processed.",Fx={htmlSnippet:"HTML Snippet",insertHtmlSnippet:"Insert HTML Snippet",confirmDeletion:"Confirm Deletion",htmlSnippetDeletionConfirm:"Are you sure you want to delete this HTML Snippet?"},Ux={obfuscate:"Obfuscate",obfuscator:"Obfuscator",content:"Content",asALink:"As a link",doNotObfuscate:"Do not obfuscate",done:"Done"},Vx={imageProperties:"Image Properties",removedImage:"Removed image",imageNoLongerExists:"This image no longer exists in the media library.",sizes:"Sizes",variantLabel:"Size {{ n }}",alignment:"Alignment",left:"Left",center:"Center",right:"Right",options:"Options",link:"Link",enableZoom:"Enable Zoom",mediaProperties:"Media Properties",caption:"Caption",pixelRatio:"Pixel Ratio"},Kx={insertVideo:"Insert Video",videoDialog:"Set a video"},Wx={insertInternalLink:"Insert Internal Link"},jx={editLink:"Edit Link",insertLink:"Insert Link",label:"Label",url:"URL",openInNewTab:"Open in new tab",openLink:"Open the link",removeLink:"Remove Link",validate:"Validate"},qx={paragraph:"Paragraph",paragraphShort:"P",heading2:"Heading 2",heading2Short:"H2",heading3:"Heading 3",heading3Short:"H3",heading4:"Heading 4",heading4Short:"H4",bold:"Bold",italic:"Italic",strikethrough:"Strikethrough",obfuscate:"Obfuscate",blockquote:"Blockquote",bulletList:"Bullet List",orderedList:"Ordered List",link:"Link",code:"Inline Code",codeBlock:"Code Block",alignmentDefault:"Default",alignmentCenter:"Center",alignmentRight:"Right",textSize:"Text size",textSizeSmall:"Small",textSizeNormal:"Normal",textSizeLarge:"Large",textSizeHuge:"Huge",undo:"Undo",redo:"Redo",clearFormatting:"Clear Formatting",more:"More"},Gx={remove:Ox,validate:Ix,cancel:Lx,delete:"Delete",image:Rx,auto:Dx,uploadingImage:$x,imageUploadSuccess:Px,imageUploadFailed:Bx,uploadNotAvailable:zx,tooManyImages:Hx,htmlSnippetNode:Fx,obfuscateMark:Ux,mediaNode:Vx,platformVideo:Kx,internalLinkNode:Wx,linkDialog:jx,toolbar:qx},Jx="Quitar",Zx="Validar",Yx="Cancelar",Xx="Imagen",Qx="auto",eS="Subiendo imagen…",tS="Imagen subida con éxito",nS="Error al subir la imagen",rS="Funcionalidad de carga no disponible",iS="Demasiadas imágenes. Solo se procesarán las primeras {{ count }}.",sS={htmlSnippet:"Fragmento HTML",insertHtmlSnippet:"Insertar fragmento HTML",confirmDeletion:"Confirmar eliminación",htmlSnippetDeletionConfirm:"¿Está seguro de que desea eliminar este fragmento HTML?"},oS={obfuscate:"Ofuscar",obfuscator:"Ofuscador",content:"Contenido",asALink:"Como enlace",doNotObfuscate:"No ofuscar",done:"Hecho"},aS={imageProperties:"Propiedades de la imagen",sizes:"Tamaños",variantLabel:"Tamaño {{ n }}",alignment:"Alineación",left:"Izquierda",center:"Centro",right:"Derecha",options:"Opciones",link:"Enlace",enableZoom:"Habilitar zoom",mediaProperties:"Propiedades del medio",caption:"Leyenda",pixelRatio:"Proporción de píxeles"},lS={insertVideo:"Insertar un video",videoDialog:"Configurar un video"},cS={insertInternalLink:"Insertar un enlace interno"},dS={editLink:"Editar enlace",insertLink:"Insertar enlace",label:"Etiqueta",url:"URL",openInNewTab:"Abrir en nueva pestaña",openLink:"Abrir el enlace",removeLink:"Eliminar enlace",validate:"Validar"},uS={paragraph:"Párrafo",paragraphShort:"P",heading2:"Título 2",heading2Short:"T2",heading3:"Título 3",heading3Short:"T3",heading4:"Título 4",heading4Short:"T4",bold:"Negrita",italic:"Cursiva",strikethrough:"Tachado",obfuscate:"Ofuscar",blockquote:"Cita",bulletList:"Lista con viñetas",orderedList:"Lista numerada",link:"Enlace",code:"Código en línea",codeBlock:"Bloque de código",alignmentDefault:"Predeterminado",alignmentCenter:"Centrar",alignmentRight:"A la derecha",textSize:"Tamaño del texto",textSizeSmall:"Pequeño",textSizeNormal:"Normal",textSizeLarge:"Grande",textSizeHuge:"Muy grande",undo:"Deshacer",redo:"Rehacer",clearFormatting:"Borrar formato",more:"Más"},hS={remove:Jx,validate:Zx,cancel:Yx,delete:"Eliminar",image:Xx,auto:Qx,uploadingImage:eS,imageUploadSuccess:tS,imageUploadFailed:nS,uploadNotAvailable:rS,tooManyImages:iS,htmlSnippetNode:sS,obfuscateMark:oS,mediaNode:aS,platformVideo:lS,internalLinkNode:cS,linkDialog:dS,toolbar:uS},fS="Retirer",pS="Valider",mS="Annuler",gS="Image",bS="auto",yS="Téléchargement de l'image…",kS="Image téléchargée avec succès",vS="Échec du téléchargement de l'image",ES="Fonctionnalité de téléchargement non disponible",xS="Trop d'images. Seules les {{ count }} premières seront traitées.",SS={htmlSnippet:"Code HTML",insertHtmlSnippet:"Insérer du code HTML",confirmDeletion:"Confirmer la suppression",htmlSnippetDeletionConfirm:"Voulez-vous vraiment supprimer ce code HTML ?"},wS={obfuscate:"Obfusquer",obfusquator:"Obfusqueur",content:"Contenu",asALink:"En tant que lien",doNotObfuscate:"Ne pas obfusquer",done:"Terminé"},TS={imageProperties:"Propriétés de l'image",removedImage:"Image supprimée",imageNoLongerExists:"Cette image n'existe plus dans la médiathèque.",sizes:"Tailles",variantLabel:"Taille {{ n }}",alignment:"Alignement",left:"À gauche",center:"Centrer",right:"À droite",options:"Options",link:"Lien",enableZoom:"Activer le zoom",mediaProperties:"Propriétés du média",caption:"Légende",pixelRatio:"Pixel ratio"},MS={insertVideo:"Insérer une vidéo",videoDialog:"Définir une vidéo"},CS={insertInternalLink:"Insérer un lien interne"},AS={editLink:"Modifier le lien",insertLink:"Insérer un lien",label:"Libellé",url:"URL",openInNewTab:"Ouvrir dans un nouvel onglet",openLink:"Ouvrir le lien",removeLink:"Supprimer le lien",validate:"Valider"},NS={paragraph:"Paragraphe",paragraphShort:"P",heading2:"Titre 2",heading2Short:"T2",heading3:"Titre 3",heading3Short:"T3",heading4:"Titre 4",heading4Short:"T4",bold:"Gras",italic:"Italique",strikethrough:"Barré",obfuscate:"Obfusquer",blockquote:"Citation",bulletList:"Liste à puces",orderedList:"Liste numérotée",link:"Lien",code:"Code en ligne",codeBlock:"Bloc de code",alignmentDefault:"Par défaut",alignmentCenter:"Centrer",alignmentRight:"À droite",textSize:"Taille du texte",textSizeSmall:"Petit",textSizeNormal:"Normal",textSizeLarge:"Grand",textSizeHuge:"Très grand",undo:"Annuler",redo:"Rétablir",clearFormatting:"Effacer la mise en forme",more:"Plus"},_S={remove:fS,validate:pS,cancel:mS,delete:"Supprimer",image:gS,auto:bS,uploadingImage:yS,imageUploadSuccess:kS,imageUploadFailed:vS,uploadNotAvailable:ES,tooManyImages:xS,htmlSnippetNode:SS,obfuscateMark:wS,mediaNode:TS,platformVideo:MS,internalLinkNode:CS,linkDialog:AS,toolbar:NS},OS="Rimuovere",IS="Validare",LS="Annulla",RS="Immagine",DS="auto",$S="Caricamento immagine…",PS="Immagine caricata con successo",BS="Errore nel caricamento dell'immagine",zS="Funzionalità di caricamento non disponibile",HS="Troppe immagini. Verranno elaborate solo le prime {{ count }}.",FS={htmlSnippet:"Frammento HTML",insertHtmlSnippet:"Inserisci frammento HTML",confirmDeletion:"Conferma eliminazione",htmlSnippetDeletionConfirm:"Sei sicuro di voler eliminare questo frammento HTML?"},US={obfuscate:"Offuscare",obfuscator:"Offuscatore",content:"Contenuto",asALink:"Come link",doNotObfuscate:"Non offuscare",done:"Fatto"},VS={imageProperties:"Proprietà dell'immagine",sizes:"Dimensioni",variantLabel:"Dimensione {{ n }}",alignment:"Allineamento",left:"Sinistra",center:"Centro",right:"Destra",options:"Opzioni",link:"Link",enableZoom:"Abilita zoom",mediaProperties:"Proprietà del media",caption:"Didascalia",pixelRatio:"Rapporto pixel"},KS={insertVideo:"Inserisci un video",videoDialog:"Imposta un video"},WS={insertInternalLink:"Inserisci un link interno"},jS={editLink:"Modifica collegamento",insertLink:"Inserisci collegamento",label:"Etichetta",url:"URL",openInNewTab:"Apri in una nuova scheda",openLink:"Apri il collegamento",removeLink:"Rimuovi collegamento",validate:"Validare"},qS={paragraph:"Paragrafo",paragraphShort:"P",heading2:"Titolo 2",heading2Short:"T2",heading3:"Titolo 3",heading3Short:"T3",heading4:"Titolo 4",heading4Short:"T4",bold:"Grassetto",italic:"Corsivo",strikethrough:"Barrato",obfuscate:"Offuscare",blockquote:"Citazione",bulletList:"Elenco puntato",orderedList:"Elenco numerato",link:"Collegamento",code:"Codice in linea",codeBlock:"Blocco di codice",alignmentDefault:"Predefinito",alignmentCenter:"Centra",alignmentRight:"A destra",textSize:"Dimensione del testo",textSizeSmall:"Piccolo",textSizeNormal:"Normale",textSizeLarge:"Grande",textSizeHuge:"Molto grande",undo:"Annulla",redo:"Ripeti",clearFormatting:"Cancella formattazione",more:"Altro"},GS={remove:OS,validate:IS,cancel:LS,delete:"Elimina",image:RS,auto:DS,uploadingImage:$S,imageUploadSuccess:PS,imageUploadFailed:BS,uploadNotAvailable:zS,tooManyImages:HS,htmlSnippetNode:FS,obfuscateMark:US,mediaNode:VS,platformVideo:KS,internalLinkNode:WS,linkDialog:jS,toolbar:qS},JS="Remover",ZS="Validar",YS="Cancelar",XS="Imagem",QS="auto",ew="Enviando imagem…",tw="Imagem enviada com sucesso",nw="Falha ao enviar imagem",rw="Funcionalidade de envio não disponível",iw="Muitas imagens. Apenas as primeiras {{ count }} serão processadas.",sw={htmlSnippet:"Fragmento HTML",insertHtmlSnippet:"Inserir fragmento HTML",confirmDeletion:"Confirmar exclusão",htmlSnippetDeletionConfirm:"Tem certeza de que deseja excluir este fragmento HTML?"},ow={obfuscate:"Ofuscar",obfuscator:"Ofuscador",content:"Conteúdo",asALink:"Como link",doNotObfuscate:"Não ofuscar",done:"Concluído"},aw={imageProperties:"Propriedades da imagem",sizes:"Tamanhos",variantLabel:"Tamanho {{ n }}",alignment:"Alinhamento",left:"Esquerda",center:"Centro",right:"Direita",options:"Opções",link:"Link",enableZoom:"Ativar zoom",mediaProperties:"Propriedades da mídia",caption:"Legenda",pixelRatio:"Proporção de pixels"},lw={insertVideo:"Inserir um vídeo",videoDialog:"Definir um vídeo"},cw={insertInternalLink:"Inserir um link interno"},dw={editLink:"Editar link",insertLink:"Inserir link",label:"Rótulo",url:"URL",openInNewTab:"Abrir em nova aba",openLink:"Abrir o link",removeLink:"Remover link",validate:"Validar"},uw={paragraph:"Parágrafo",paragraphShort:"P",heading2:"Título 2",heading2Short:"T2",heading3:"Título 3",heading3Short:"T3",heading4:"Título 4",heading4Short:"T4",bold:"Negrito",italic:"Itálico",strikethrough:"Tachado",obfuscate:"Ofuscar",blockquote:"Citação",bulletList:"Lista com marcadores",orderedList:"Lista numerada",link:"Link",code:"Código em linha",codeBlock:"Bloco de código",alignmentDefault:"Padrão",alignmentCenter:"Centralizar",alignmentRight:"À direita",textSize:"Tamanho do texto",textSizeSmall:"Pequeno",textSizeNormal:"Normal",textSizeLarge:"Grande",textSizeHuge:"Muito grande",undo:"Desfazer",redo:"Refazer",clearFormatting:"Limpar formatação",more:"Mais"},hw={remove:JS,validate:ZS,cancel:YS,delete:"Excluir",image:XS,auto:QS,uploadingImage:ew,imageUploadSuccess:tw,imageUploadFailed:nw,uploadNotAvailable:rw,tooManyImages:iw,htmlSnippetNode:sw,obfuscateMark:ow,mediaNode:aw,platformVideo:lw,internalLinkNode:cw,linkDialog:dw,toolbar:uw},Bc={en:Gx,fr:_S,es:hS,de:_x,it:GS,pt:hw};class fw{constructor(e){this._ctx={language:"",dict:{}},this.setLanguage(e)}setLanguage(e,t){const r=Object.keys(Bc),i=Uf(e,{pluginLanguages:r,siteLanguages:t}),s=i,o={};Zh(Bc[s],"",o),this._ctx={language:i,dict:o}}t(e,t){let r=this._ctx.dict[e]??e;if(t)for(const[i,s]of Object.entries(t))r=r.replace(new RegExp(`\\{\\{\\s*${i}\\s*\\}\\}`,"g"),String(s));return r}}function Zh(n,e,t){for(const r in n){const i=n[r],s=e?`${e}.${r}`:r;i&&typeof i=="object"&&!Array.isArray(i)?Zh(i,s,t):typeof i=="string"&&(t[s]=i)}}const Bo=hx(),vw={init:pw,create:mw};function pw(n){const e=`${n.pluginBaseUrl}/admin-ui-plugin.css`,t=document.createElement("link");t.rel="stylesheet",t.href=e,document.head.appendChild(t),n.registerHook("htmlEditorServiceProvider",()=>Bo.service)}function mw(n){const{fieldType:e}=n;if(e.dataType!=="json")throw new Error(`field type '${e.name}' is incompatible with Tiptap plugin, needs data type 'json'`);if(n.initialValue!==void 0&&!Hc(n.initialValue))throw new Error(`field type '${e.name}' is incompatible, should be a json, got '${typeof n.initialValue}'`);const t=zc(n.initialValue);let r=n.language;const i=new fw(r),s=document.createElement("tiptap-editor");return s.service=n,s.i18n=i,s.videoPluginHook=Bo.videoPlugin,s.internalLinkPluginHook=Bo.internalLinkPlugin,s.initialContent=t,s.onChange=o=>{n.setModifiedValue({j:o})},{element:s,setValue:o=>{s.setContent(zc(o))},setLanguage:o=>{r=o,i.setLanguage(o),s.updateLanguage(o)},getValue:()=>({j:s.getJSON()}),dispose:()=>{s.remove()},insertMedia:async o=>{await s.insertMediaFromGallery(o)}}}function zc(n){if(n!==void 0)return Hc(n)&&typeof n.j=="object"&&n.j!==null?n.j:void 0}export{vw as default};
|
|
1005
|
+
`;Xn([Se({attribute:!1})],en.prototype,"editor",2);Xn([Se({attribute:!1})],en.prototype,"service",2);Xn([Se({attribute:!1})],en.prototype,"i18n",2);Xn([Se({attribute:!1})],en.prototype,"videoPluginHook",2);Xn([Se({attribute:!1})],en.prototype,"internalLinkPluginHook",2);en=Xn([vs("tiptap-toolbar")],en);function hx(){const n={videoPlugin:void 0,internalLinkPlugin:void 0};return{get videoPlugin(){return n.videoPlugin},get internalLinkPlugin(){return n.internalLinkPlugin},service:{registerVideoPlugin(e){if(n.videoPlugin)throw new Error("Video plugin already registered");n.videoPlugin=e},registerInternalLinkPlugin(e){if(n.internalLinkPlugin)throw new Error("Internal link plugin already registered");n.internalLinkPlugin=e}}}}const fx="Entfernen",px="Validieren",mx="Abbrechen",gx="Bild",bx="auto",yx="Bild wird hochgeladen…",kx="Bild erfolgreich hochgeladen",vx="Fehler beim Hochladen des Bildes",Ex="Upload-Funktion nicht verfügbar",xx="Zu viele Bilder. Nur die ersten {{ count }} werden verarbeitet.",Sx={htmlSnippet:"HTML-Snippet",insertHtmlSnippet:"HTML-Snippet einfügen",confirmDeletion:"Löschung bestätigen",htmlSnippetDeletionConfirm:"Sind Sie sicher, dass Sie dieses HTML-Snippet löschen möchten?"},wx={obfuscate:"Verschleiern",obfuscator:"Verschleierer",content:"Inhalt",asALink:"Als Link",doNotObfuscate:"Nicht verschleiern",done:"Fertig"},Tx={imageProperties:"Bildeigenschaften",sizes:"Größen",variantLabel:"Größe {{ n }}",alignment:"Ausrichtung",left:"Links",center:"Zentriert",right:"Rechts",options:"Optionen",link:"Link",enableZoom:"Zoom aktivieren",mediaProperties:"Medieneigenschaften",caption:"Bildunterschrift",pixelRatio:"Pixelverhältnis"},Mx={insertVideo:"Video einfügen",videoDialog:"Video festlegen"},Cx={insertInternalLink:"Internen Link einfügen"},Ax={editLink:"Link bearbeiten",insertLink:"Link einfügen",label:"Beschriftung",url:"URL",openInNewTab:"In neuem Tab öffnen",openLink:"Link öffnen",removeLink:"Link entfernen",validate:"Validieren"},Nx={paragraph:"Absatz",paragraphShort:"A",heading2:"Überschrift 2",heading2Short:"Ü2",heading3:"Überschrift 3",heading3Short:"Ü3",heading4:"Überschrift 4",heading4Short:"Ü4",bold:"Fett",italic:"Kursiv",strikethrough:"Durchgestrichen",obfuscate:"Verschleiern",blockquote:"Zitat",bulletList:"Aufzählungsliste",orderedList:"Nummerierte Liste",link:"Link",code:"Inline-Code",codeBlock:"Codeblock",alignmentDefault:"Standard",alignmentCenter:"Zentriert",alignmentRight:"Rechts",textSize:"Textgröße",textSizeSmall:"Klein",textSizeNormal:"Normal",textSizeLarge:"Groß",textSizeHuge:"Sehr groß",undo:"Rückgängig",redo:"Wiederholen",clearFormatting:"Formatierung löschen",more:"Mehr"},_x={videoPluginNotAvailable:"Video-Plugin nicht verfügbar",internalLinkPluginNotAvailable:"Interner-Link-Plugin nicht verfügbar"},Ox={remove:fx,validate:px,cancel:mx,delete:"Löschen",image:gx,auto:bx,uploadingImage:yx,imageUploadSuccess:kx,imageUploadFailed:vx,uploadNotAvailable:Ex,tooManyImages:xx,htmlSnippetNode:Sx,obfuscateMark:wx,mediaNode:Tx,platformVideo:Mx,internalLinkNode:Cx,linkDialog:Ax,toolbar:Nx,warnings:_x},Ix="Remove",Lx="Validate",Rx="Cancel",Dx="Image",$x="Auto",Px="Uploading image…",Bx="Image uploaded successfully",zx="Failed to upload image",Hx="Upload functionality not available",Fx="Too many images. Only the first {{ count }} will be processed.",Ux={htmlSnippet:"HTML Snippet",insertHtmlSnippet:"Insert HTML Snippet",confirmDeletion:"Confirm Deletion",htmlSnippetDeletionConfirm:"Are you sure you want to delete this HTML Snippet?"},Vx={obfuscate:"Obfuscate",obfuscator:"Obfuscator",content:"Content",asALink:"As a link",doNotObfuscate:"Do not obfuscate",done:"Done"},Kx={imageProperties:"Image Properties",removedImage:"Removed image",imageNoLongerExists:"This image no longer exists in the media library.",sizes:"Sizes",variantLabel:"Size {{ n }}",alignment:"Alignment",left:"Left",center:"Center",right:"Right",options:"Options",link:"Link",enableZoom:"Enable Zoom",mediaProperties:"Media Properties",caption:"Caption",pixelRatio:"Pixel Ratio"},Wx={insertVideo:"Insert Video",videoDialog:"Set a video"},jx={insertInternalLink:"Insert Internal Link"},qx={editLink:"Edit Link",insertLink:"Insert Link",label:"Label",url:"URL",openInNewTab:"Open in new tab",openLink:"Open the link",removeLink:"Remove Link",validate:"Validate"},Gx={paragraph:"Paragraph",paragraphShort:"P",heading2:"Heading 2",heading2Short:"H2",heading3:"Heading 3",heading3Short:"H3",heading4:"Heading 4",heading4Short:"H4",bold:"Bold",italic:"Italic",strikethrough:"Strikethrough",obfuscate:"Obfuscate",blockquote:"Blockquote",bulletList:"Bullet List",orderedList:"Ordered List",link:"Link",code:"Inline Code",codeBlock:"Code Block",alignmentDefault:"Default",alignmentCenter:"Center",alignmentRight:"Right",textSize:"Text size",textSizeSmall:"Small",textSizeNormal:"Normal",textSizeLarge:"Large",textSizeHuge:"Huge",undo:"Undo",redo:"Redo",clearFormatting:"Clear Formatting",more:"More"},Jx={videoPluginNotAvailable:"Video plugin not available",internalLinkPluginNotAvailable:"Internal link plugin not available"},Zx={remove:Ix,validate:Lx,cancel:Rx,delete:"Delete",image:Dx,auto:$x,uploadingImage:Px,imageUploadSuccess:Bx,imageUploadFailed:zx,uploadNotAvailable:Hx,tooManyImages:Fx,htmlSnippetNode:Ux,obfuscateMark:Vx,mediaNode:Kx,platformVideo:Wx,internalLinkNode:jx,linkDialog:qx,toolbar:Gx,warnings:Jx},Yx="Quitar",Xx="Validar",Qx="Cancelar",eS="Imagen",tS="auto",nS="Subiendo imagen…",rS="Imagen subida con éxito",iS="Error al subir la imagen",sS="Funcionalidad de carga no disponible",oS="Demasiadas imágenes. Solo se procesarán las primeras {{ count }}.",aS={htmlSnippet:"Fragmento HTML",insertHtmlSnippet:"Insertar fragmento HTML",confirmDeletion:"Confirmar eliminación",htmlSnippetDeletionConfirm:"¿Está seguro de que desea eliminar este fragmento HTML?"},lS={obfuscate:"Ofuscar",obfuscator:"Ofuscador",content:"Contenido",asALink:"Como enlace",doNotObfuscate:"No ofuscar",done:"Hecho"},cS={imageProperties:"Propiedades de la imagen",sizes:"Tamaños",variantLabel:"Tamaño {{ n }}",alignment:"Alineación",left:"Izquierda",center:"Centro",right:"Derecha",options:"Opciones",link:"Enlace",enableZoom:"Habilitar zoom",mediaProperties:"Propiedades del medio",caption:"Leyenda",pixelRatio:"Proporción de píxeles"},dS={insertVideo:"Insertar un video",videoDialog:"Configurar un video"},uS={insertInternalLink:"Insertar un enlace interno"},hS={editLink:"Editar enlace",insertLink:"Insertar enlace",label:"Etiqueta",url:"URL",openInNewTab:"Abrir en nueva pestaña",openLink:"Abrir el enlace",removeLink:"Eliminar enlace",validate:"Validar"},fS={paragraph:"Párrafo",paragraphShort:"P",heading2:"Título 2",heading2Short:"T2",heading3:"Título 3",heading3Short:"T3",heading4:"Título 4",heading4Short:"T4",bold:"Negrita",italic:"Cursiva",strikethrough:"Tachado",obfuscate:"Ofuscar",blockquote:"Cita",bulletList:"Lista con viñetas",orderedList:"Lista numerada",link:"Enlace",code:"Código en línea",codeBlock:"Bloque de código",alignmentDefault:"Predeterminado",alignmentCenter:"Centrar",alignmentRight:"A la derecha",textSize:"Tamaño del texto",textSizeSmall:"Pequeño",textSizeNormal:"Normal",textSizeLarge:"Grande",textSizeHuge:"Muy grande",undo:"Deshacer",redo:"Rehacer",clearFormatting:"Borrar formato",more:"Más"},pS={videoPluginNotAvailable:"Plugin de video no disponible",internalLinkPluginNotAvailable:"Plugin de enlace interno no disponible"},mS={remove:Yx,validate:Xx,cancel:Qx,delete:"Eliminar",image:eS,auto:tS,uploadingImage:nS,imageUploadSuccess:rS,imageUploadFailed:iS,uploadNotAvailable:sS,tooManyImages:oS,htmlSnippetNode:aS,obfuscateMark:lS,mediaNode:cS,platformVideo:dS,internalLinkNode:uS,linkDialog:hS,toolbar:fS,warnings:pS},gS="Retirer",bS="Valider",yS="Annuler",kS="Image",vS="auto",ES="Téléchargement de l'image…",xS="Image téléchargée avec succès",SS="Échec du téléchargement de l'image",wS="Fonctionnalité de téléchargement non disponible",TS="Trop d'images. Seules les {{ count }} premières seront traitées.",MS={htmlSnippet:"Code HTML",insertHtmlSnippet:"Insérer du code HTML",confirmDeletion:"Confirmer la suppression",htmlSnippetDeletionConfirm:"Voulez-vous vraiment supprimer ce code HTML ?"},CS={obfuscate:"Obfusquer",obfusquator:"Obfusqueur",content:"Contenu",asALink:"En tant que lien",doNotObfuscate:"Ne pas obfusquer",done:"Terminé"},AS={imageProperties:"Propriétés de l'image",removedImage:"Image supprimée",imageNoLongerExists:"Cette image n'existe plus dans la médiathèque.",sizes:"Tailles",variantLabel:"Taille {{ n }}",alignment:"Alignement",left:"À gauche",center:"Centrer",right:"À droite",options:"Options",link:"Lien",enableZoom:"Activer le zoom",mediaProperties:"Propriétés du média",caption:"Légende",pixelRatio:"Pixel ratio"},NS={insertVideo:"Insérer une vidéo",videoDialog:"Définir une vidéo"},_S={insertInternalLink:"Insérer un lien interne"},OS={editLink:"Modifier le lien",insertLink:"Insérer un lien",label:"Libellé",url:"URL",openInNewTab:"Ouvrir dans un nouvel onglet",openLink:"Ouvrir le lien",removeLink:"Supprimer le lien",validate:"Valider"},IS={paragraph:"Paragraphe",paragraphShort:"P",heading2:"Titre 2",heading2Short:"T2",heading3:"Titre 3",heading3Short:"T3",heading4:"Titre 4",heading4Short:"T4",bold:"Gras",italic:"Italique",strikethrough:"Barré",obfuscate:"Obfusquer",blockquote:"Citation",bulletList:"Liste à puces",orderedList:"Liste numérotée",link:"Lien",code:"Code en ligne",codeBlock:"Bloc de code",alignmentDefault:"Par défaut",alignmentCenter:"Centrer",alignmentRight:"À droite",textSize:"Taille du texte",textSizeSmall:"Petit",textSizeNormal:"Normal",textSizeLarge:"Grand",textSizeHuge:"Très grand",undo:"Annuler",redo:"Rétablir",clearFormatting:"Effacer la mise en forme",more:"Plus"},LS={videoPluginNotAvailable:"Plugin vidéo non disponible",internalLinkPluginNotAvailable:"Plugin de lien interne non disponible"},RS={remove:gS,validate:bS,cancel:yS,delete:"Supprimer",image:kS,auto:vS,uploadingImage:ES,imageUploadSuccess:xS,imageUploadFailed:SS,uploadNotAvailable:wS,tooManyImages:TS,htmlSnippetNode:MS,obfuscateMark:CS,mediaNode:AS,platformVideo:NS,internalLinkNode:_S,linkDialog:OS,toolbar:IS,warnings:LS},DS="Rimuovere",$S="Validare",PS="Annulla",BS="Immagine",zS="auto",HS="Caricamento immagine…",FS="Immagine caricata con successo",US="Errore nel caricamento dell'immagine",VS="Funzionalità di caricamento non disponibile",KS="Troppe immagini. Verranno elaborate solo le prime {{ count }}.",WS={htmlSnippet:"Frammento HTML",insertHtmlSnippet:"Inserisci frammento HTML",confirmDeletion:"Conferma eliminazione",htmlSnippetDeletionConfirm:"Sei sicuro di voler eliminare questo frammento HTML?"},jS={obfuscate:"Offuscare",obfuscator:"Offuscatore",content:"Contenuto",asALink:"Come link",doNotObfuscate:"Non offuscare",done:"Fatto"},qS={imageProperties:"Proprietà dell'immagine",sizes:"Dimensioni",variantLabel:"Dimensione {{ n }}",alignment:"Allineamento",left:"Sinistra",center:"Centro",right:"Destra",options:"Opzioni",link:"Link",enableZoom:"Abilita zoom",mediaProperties:"Proprietà del media",caption:"Didascalia",pixelRatio:"Rapporto pixel"},GS={insertVideo:"Inserisci un video",videoDialog:"Imposta un video"},JS={insertInternalLink:"Inserisci un link interno"},ZS={editLink:"Modifica collegamento",insertLink:"Inserisci collegamento",label:"Etichetta",url:"URL",openInNewTab:"Apri in una nuova scheda",openLink:"Apri il collegamento",removeLink:"Rimuovi collegamento",validate:"Validare"},YS={paragraph:"Paragrafo",paragraphShort:"P",heading2:"Titolo 2",heading2Short:"T2",heading3:"Titolo 3",heading3Short:"T3",heading4:"Titolo 4",heading4Short:"T4",bold:"Grassetto",italic:"Corsivo",strikethrough:"Barrato",obfuscate:"Offuscare",blockquote:"Citazione",bulletList:"Elenco puntato",orderedList:"Elenco numerato",link:"Collegamento",code:"Codice in linea",codeBlock:"Blocco di codice",alignmentDefault:"Predefinito",alignmentCenter:"Centra",alignmentRight:"A destra",textSize:"Dimensione del testo",textSizeSmall:"Piccolo",textSizeNormal:"Normale",textSizeLarge:"Grande",textSizeHuge:"Molto grande",undo:"Annulla",redo:"Ripeti",clearFormatting:"Cancella formattazione",more:"Altro"},XS={videoPluginNotAvailable:"Plugin video non disponibile",internalLinkPluginNotAvailable:"Plugin link interno non disponibile"},QS={remove:DS,validate:$S,cancel:PS,delete:"Elimina",image:BS,auto:zS,uploadingImage:HS,imageUploadSuccess:FS,imageUploadFailed:US,uploadNotAvailable:VS,tooManyImages:KS,htmlSnippetNode:WS,obfuscateMark:jS,mediaNode:qS,platformVideo:GS,internalLinkNode:JS,linkDialog:ZS,toolbar:YS,warnings:XS},ew="Remover",tw="Validar",nw="Cancelar",rw="Imagem",iw="auto",sw="Enviando imagem…",ow="Imagem enviada com sucesso",aw="Falha ao enviar imagem",lw="Funcionalidade de envio não disponível",cw="Muitas imagens. Apenas as primeiras {{ count }} serão processadas.",dw={htmlSnippet:"Fragmento HTML",insertHtmlSnippet:"Inserir fragmento HTML",confirmDeletion:"Confirmar exclusão",htmlSnippetDeletionConfirm:"Tem certeza de que deseja excluir este fragmento HTML?"},uw={obfuscate:"Ofuscar",obfuscator:"Ofuscador",content:"Conteúdo",asALink:"Como link",doNotObfuscate:"Não ofuscar",done:"Concluído"},hw={imageProperties:"Propriedades da imagem",sizes:"Tamanhos",variantLabel:"Tamanho {{ n }}",alignment:"Alinhamento",left:"Esquerda",center:"Centro",right:"Direita",options:"Opções",link:"Link",enableZoom:"Ativar zoom",mediaProperties:"Propriedades da mídia",caption:"Legenda",pixelRatio:"Proporção de pixels"},fw={insertVideo:"Inserir um vídeo",videoDialog:"Definir um vídeo"},pw={insertInternalLink:"Inserir um link interno"},mw={editLink:"Editar link",insertLink:"Inserir link",label:"Rótulo",url:"URL",openInNewTab:"Abrir em nova aba",openLink:"Abrir o link",removeLink:"Remover link",validate:"Validar"},gw={paragraph:"Parágrafo",paragraphShort:"P",heading2:"Título 2",heading2Short:"T2",heading3:"Título 3",heading3Short:"T3",heading4:"Título 4",heading4Short:"T4",bold:"Negrito",italic:"Itálico",strikethrough:"Tachado",obfuscate:"Ofuscar",blockquote:"Citação",bulletList:"Lista com marcadores",orderedList:"Lista numerada",link:"Link",code:"Código em linha",codeBlock:"Bloco de código",alignmentDefault:"Padrão",alignmentCenter:"Centralizar",alignmentRight:"À direita",textSize:"Tamanho do texto",textSizeSmall:"Pequeno",textSizeNormal:"Normal",textSizeLarge:"Grande",textSizeHuge:"Muito grande",undo:"Desfazer",redo:"Refazer",clearFormatting:"Limpar formatação",more:"Mais"},bw={videoPluginNotAvailable:"Plugin de vídeo não disponível",internalLinkPluginNotAvailable:"Plugin de link interno não disponível"},yw={remove:ew,validate:tw,cancel:nw,delete:"Excluir",image:rw,auto:iw,uploadingImage:sw,imageUploadSuccess:ow,imageUploadFailed:aw,uploadNotAvailable:lw,tooManyImages:cw,htmlSnippetNode:dw,obfuscateMark:uw,mediaNode:hw,platformVideo:fw,internalLinkNode:pw,linkDialog:mw,toolbar:gw,warnings:bw},Bc={en:Zx,fr:RS,es:mS,de:Ox,it:QS,pt:yw};class kw{constructor(e){this._ctx={language:"",dict:{}},this.setLanguage(e)}setLanguage(e,t){const r=Object.keys(Bc),i=Uf(e,{pluginLanguages:r,siteLanguages:t}),s=i,o={};Zh(Bc[s],"",o),this._ctx={language:i,dict:o}}t(e,t){let r=this._ctx.dict[e]??e;if(t)for(const[i,s]of Object.entries(t))r=r.replace(new RegExp(`\\{\\{\\s*${i}\\s*\\}\\}`,"g"),String(s));return r}}function Zh(n,e,t){for(const r in n){const i=n[r],s=e?`${e}.${r}`:r;i&&typeof i=="object"&&!Array.isArray(i)?Zh(i,s,t):typeof i=="string"&&(t[s]=i)}}const Bo=hx(),Mw={init:vw,create:Ew};function vw(n){const e=`${n.pluginBaseUrl}/admin-ui-plugin.css`,t=document.createElement("link");t.rel="stylesheet",t.href=e,document.head.appendChild(t),n.registerHook("htmlEditorServiceProvider",()=>Bo.service)}function Ew(n){const{fieldType:e}=n;if(e.dataType!=="json")throw new Error(`field type '${e.name}' is incompatible with Tiptap plugin, needs data type 'json'`);if(n.initialValue!==void 0&&!Hc(n.initialValue))throw new Error(`field type '${e.name}' is incompatible, should be a json, got '${typeof n.initialValue}'`);const t=zc(n.initialValue);let r=n.language;const i=new kw(r),s=document.createElement("tiptap-editor");return s.service=n,s.i18n=i,s.videoPluginHook=Bo.videoPlugin,s.internalLinkPluginHook=Bo.internalLinkPlugin,s.initialContent=t,s.onChange=o=>{n.setModifiedValue({j:o})},{element:s,setValue:o=>{s.setContent(zc(o))},setLanguage:o=>{r=o,i.setLanguage(o),s.updateLanguage(o)},getValue:()=>({j:s.getJSON()}),dispose:()=>{s.remove()},insertMedia:async o=>{await s.insertMediaFromGallery(o)}}}function zc(n){if(n!==void 0)return Hc(n)&&typeof n.j=="object"&&n.j!==null?n.j:void 0}export{Mw as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paroicms/tiptap-editor-plugin",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Tiptap editor plugin for ParoiCMS",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"paroicms",
|
|
@@ -19,18 +19,16 @@
|
|
|
19
19
|
"build": "npm run build:backend && npm run build:admin-ui && npm run build:public-assets",
|
|
20
20
|
"build:backend": "(cd backend && tsc)",
|
|
21
21
|
"build:admin-ui": "(cd admin-ui-plugin && npm run build)",
|
|
22
|
-
"build:public-assets": "
|
|
22
|
+
"build:public-assets": "mkdir -p public-assets/dist && cp public-assets/src/text.css public-assets/dist/text.css",
|
|
23
23
|
"build:backend:watch": "(cd backend && tsc --watch --preserveWatchOutput)",
|
|
24
24
|
"build:admin-ui:watch": "(cd admin-ui-plugin && npm run build:watch)",
|
|
25
|
-
"build:public-assets:watch": "npm run _scss && npm run _scss -- --watch",
|
|
26
|
-
"_scss": "sass public-assets/src/text.scss public-assets/dist/text.css",
|
|
27
25
|
"clear": "rimraf backend/dist/* admin-ui-plugin/dist/*",
|
|
28
26
|
"test": "vitest run",
|
|
29
27
|
"test:watch": "vitest"
|
|
30
28
|
},
|
|
31
29
|
"dependencies": {
|
|
32
30
|
"@paroicms/markdown-to-tiptap-json": "0.2.5",
|
|
33
|
-
"@paroicms/script-lib": "0.3.
|
|
31
|
+
"@paroicms/script-lib": "0.3.12",
|
|
34
32
|
"@tiptap/core": "3.11.0",
|
|
35
33
|
"@tiptap/extension-code": "3.11.0",
|
|
36
34
|
"@tiptap/extension-code-block-lowlight": "3.11.0",
|
|
@@ -47,11 +45,10 @@
|
|
|
47
45
|
"@paroicms/public-server-lib": "0"
|
|
48
46
|
},
|
|
49
47
|
"devDependencies": {
|
|
50
|
-
"@paroicms/public-anywhere-lib": "0.
|
|
51
|
-
"@paroicms/public-server-lib": "0.
|
|
48
|
+
"@paroicms/public-anywhere-lib": "0.41.0",
|
|
49
|
+
"@paroicms/public-server-lib": "0.50.0",
|
|
52
50
|
"@types/node": "~24.10.1",
|
|
53
51
|
"rimraf": "~6.1.2",
|
|
54
|
-
"sass": "~1.94.2",
|
|
55
52
|
"typescript": "~5.9.3",
|
|
56
53
|
"vitest": "~4.0.13"
|
|
57
54
|
},
|
|
@@ -1 +1,71 @@
|
|
|
1
|
-
.Text .Fig
|
|
1
|
+
.Text .Fig {
|
|
2
|
+
display: table;
|
|
3
|
+
margin: 0;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.Text .Fig.left {
|
|
7
|
+
float: left;
|
|
8
|
+
margin: 5px 20px 10px 0;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.Text .Fig.right {
|
|
12
|
+
float: right;
|
|
13
|
+
margin: 5px 0 10px 20px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.Text .Fig.center {
|
|
17
|
+
clear: both;
|
|
18
|
+
margin: 20px auto;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.Text .Fig-media {
|
|
22
|
+
display: block;
|
|
23
|
+
max-width: 100%;
|
|
24
|
+
height: auto;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.Text .Fig-caption {
|
|
28
|
+
display: table-caption;
|
|
29
|
+
margin-top: 8px;
|
|
30
|
+
font-size: 0.875em;
|
|
31
|
+
text-align: center;
|
|
32
|
+
caption-side: bottom;
|
|
33
|
+
opacity: 0.6;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.Text .Fig a {
|
|
37
|
+
display: block;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.Text .Fig a:hover {
|
|
41
|
+
opacity: 0.9;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.Text .text-align-center {
|
|
45
|
+
text-align: center;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.Text .text-align-right {
|
|
49
|
+
text-align: right;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.Text .text-align-justify {
|
|
53
|
+
text-align: justify;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.Text .text-size-small {
|
|
57
|
+
font-size: 0.5625em;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.Text .text-size-large {
|
|
61
|
+
font-size: 2em;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.Text .text-size-huge {
|
|
65
|
+
font-size: 4em;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.Text iframe {
|
|
69
|
+
display: block;
|
|
70
|
+
margin: 20px auto;
|
|
71
|
+
}
|