@qualityunit/liveagent-components-editor 0.0.32 → 0.0.33
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/dist/ckeditor.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";require("./ckeditor5-
|
|
1
|
+
"use strict";require("./ckeditor5-CXxEJzEp.cjs");
|
package/dist/ckeditor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import "./ckeditor5-
|
|
1
|
+
import "./ckeditor5-GI-h9giW.js";
|
|
@@ -1714,4 +1714,4 @@ $&
|
|
|
1714
1714
|
*/const hh="ckCsrfToken",fh=40,mh="abcdefghijklmnopqrstuvwxyz0123456789";function QV(){let n=XV(hh);return(!n||n.length!=fh)&&(n=tL(fh),eL(hh,n)),n}function XV(n){n=n.toLowerCase();const e=document.cookie.split(";");for(const t of e){const i=t.split("=");if(decodeURIComponent(i[0].trim().toLowerCase())===n)return decodeURIComponent(i[1])}return null}function eL(n,e){document.cookie=encodeURIComponent(n)+"="+encodeURIComponent(e)+";path=/"}function tL(n){let e="";const t=new Uint8Array(n);window.crypto.getRandomValues(t);for(let i=0;i<t.length;i++){const s=mh.charAt(t[i]%mh.length);e+=Math.random()>.5?s.toUpperCase():s}return e}/**
|
|
1715
1715
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
1716
1716
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
1717
|
-
*/class iL extends w{static get requires(){return[ti]}static get pluginName(){return"CKFinderUploadAdapter"}init(){const e=this.editor.config.get("ckfinder.uploadUrl");e&&(this.editor.plugins.get(ti).createUploadAdapter=t=>new nL(t,e,this.editor.t))}}class nL{constructor(e,t,i){this.loader=e,this.url=t,this.t=i}upload(){return this.loader.file.then(e=>new Promise((t,i)=>{this._initRequest(),this._initListeners(t,i,e),this._sendRequest(e)}))}abort(){this.xhr&&this.xhr.abort()}_initRequest(){const e=this.xhr=new XMLHttpRequest;e.open("POST",this.url,!0),e.responseType="json"}_initListeners(e,t,i){const s=this.xhr,o=this.loader,r=this.t,a=r("Cannot upload file:")+` ${i.name}.`;s.addEventListener("error",()=>t(a)),s.addEventListener("abort",()=>t()),s.addEventListener("load",()=>{const l=s.response;if(!l||!l.uploaded)return t(l&&l.error&&l.error.message?l.error.message:a);e({default:l.url})});/* istanbul ignore else -- @preserve */s.upload&&s.upload.addEventListener("progress",l=>{l.lengthComputable&&(o.uploadTotal=l.total,o.uploaded=l.loaded)})}_sendRequest(e){const t=new FormData;t.append("upload",e),t.append("ckCsrfToken",QV()),this.xhr.send(t)}}class va extends Io{}me(va,"builtinPlugins",[cP,lI,bI,GI,yI,iP,xP,VP,s4,p4,w4,XP,y4,C4,PI,Y4,s7,yp,S7,G7,us,Wp,uR,oR,pR,XR,L8,MI,DI,AI,J8,hV,_V,EV,RV,FV,YV,iL]),me(va,"defaultConfig",{toolbar:{items:["undo","redo","|","heading","bold","italic","strikethrough","underline","fontColor","fontBackgroundColor","fontFamily","fontSize","|","numberedList","bulletedList","|","outdent","indent","blockQuote","|","alignment","|","link","imageUpload","mediaEmbed","horizontalLine","specialCharacters","code","codeBlock","insertTable","|","style","|","removeFormat","selectAll","|","sourceEditing"]},style:{definitions:[{name:"Source code",element:"pre",classes:["SourceCode"]},{name:"Error",element:"p",classes:["Error"]},{name:"Path",element:"p",classes:["Path"]}]},codeBlock:{languages:[{language:"plaintext",label:"Plain text"},{language:"html",label:"HTML"},{language:"javascript",label:"JavaScript"},{language:"php",label:"PHP"},{language:"css",label:"CSS"}]},headingConfig:{options:[{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h1",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h2",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h3",title:"Heading 3",class:"ck-heading_heading3"}]},image:{resizeOptions:[{name:"resizeImage:25",value:"25",icon:"small"},{name:"resizeImage:50",value:"50",icon:"medium"},{name:"resizeImage:75",value:"75",icon:"large"},{name:"resizeImage:original",value:null,icon:"original"}],toolbar:["toggleImageCaption","imageTextAlternative","|","imageStyle:inline","imageStyle:block","imageStyle:side","|","imageStyle:wrapText","imageStyle:breakText","|","resizeImage:25","resizeImage:50","resizeImage:75","resizeImage:original"]},language:"en"});class sL{constructor(e,t,i){me(this,"loader");me(this,"xhr");me(this,"insertImageServiceUrl");me(this,"getImageServiceUrl");this.loader=e,this.insertImageServiceUrl=t,this.getImageServiceUrl=i}upload(){return this.loader.file.then(e=>new Promise((t,i)=>{this._initRequest(e),this._initListeners(t,i,e),this._sendRequest(e)}))}abort(){this.xhr&&this.xhr.abort()}_initRequest(e){const t=this.xhr=new XMLHttpRequest;let i=this.insertImageServiceUrl;i+="&dADFileUpload=Y",i+="&max_file_size=0",i+="&name="+window.btoa(encodeURIComponent(e.name)),i+="&size="+e.size,i+="&type="+(e.type?e.type:"n/a"),t.open("POST",i,!0),t.responseType="json"}_initListeners(e,t,i){const s=this.xhr,o=this.loader,r=`Couldn't upload file: ${i.name}.`;s.addEventListener("error",()=>t(r)),s.addEventListener("abort",()=>t()),s.addEventListener("load",()=>{const a=s.response;if(a&&a.S){if(a.S==="Y"){const l=this._getFileIdFromResponse(a);if(l){e({default:this.getImageServiceUrl+"?view=Y&file="+l});return}}else if(a.M){t(a.M);return}}t(r)}),s.upload&&s.upload.addEventListener("progress",a=>{a.lengthComputable&&(o.uploadTotal=a.total,o.uploaded=a.loaded)})}_sendRequest(e){this.xhr.send(e.slice())}_getFileIdFromResponse(e){if(e.F&&Array.isArray(e.F)){for(const t of e.F)if(Array.isArray(t)&&t.length>1&&t[0]==="id")return t[1]}return null}}function oL(n){let e;return{c(){e=Ca("div")},m(t,i){ka(t,e,i),n[15](e)},p:Yt,i:Yt,o:Yt,d(t){t&&fo(e),n[15](null)}}}function rL(n){const e=n.editing.view.domConverter.unsafeElements,t=e.indexOf("style");t>-1&&e.splice(t,1)}function aL(n,e,t){const i=e.createRangeIn(t);for(const s of i.getWalker()){const o=s.item;if(o.is("$textProxy")&&o.data!=""&&o.data.includes(n))return o}return null}function lL(n,e,t){let{insertImageServiceUrl:i=""}=e,{getImageServiceUrl:s=""}=e,{items:o=["undo","redo","|","heading","bold","italic","strikethrough","underline","fontColor","fontBackgroundColor","fontFamily","fontSize","|","numberedList","bulletedList","|","outdent","indent","blockQuote","|","alignment","|","link","imageUpload","mediaEmbed","horizontalLine","specialCharacters","code","codeBlock","insertTable","|","style","|","removeFormat","selectAll","|","sourceEditing"]}=e,{allowHtmlSupport:r=!1}=e,{value:a=""}=e,{placeHolder:l=""}=e,{lang:c="en"}=e,{valueChange:u=(k,L)=>{}}=e,{stateChange:d=(k,L)=>{}}=e,{sourceEditingModeChange:h=(k,L)=>{}}=e;const f=()=>m;let m=null,p=null;function _(k){k.plugins.get("FileRepository").createUploadAdapter=L=>new sL(L,i,s)}const y=k=>{m!=null&&(m.focus(),m.model.change(L=>{if(m==null)return;let C=m.model.document.getRoot();if(C==null)return;const P=aL(k,L,C);if(P!=null){L.setSelection(L.createPositionBefore(P)),L.remove(P);const x=P.data.split(k);L.insertText(x[0],m.model.document.selection.getFirstPosition()??void 0);const Y=m.model.document.selection.getFirstPosition();L.insertText(x[1],m.model.document.selection.getFirstPosition()??void 0),L.setSelection(Y)}}))},T=k=>{m!=null&&(m.focus(),m.model.change(L=>{if(m==null)return;let C=JSON.parse(k);if(C.root==null||C.path==null||C.stickiness==null)return;let P=m.model.document.getRoot(C.root);P!=null&&L.setSelection(L.createPositionFromPath(P,C.path,C.stickiness))}))};va.create(a,{placeholder:l,toolbar:o,extraPlugins:[_,rL],htmlSupport:{allow:r?[{name:/.*/,attributes:!0,classes:!0,styles:!0}]:[{name:"a",attributes:["href","target"],classes:!0,styles:!0},{name:/^(b|i|br|center|hr|nav|s|strong|style|u)$/},{name:/^(div|p|span)$/,classes:!0,styles:!0},{name:/^(figure|figcaption)$/,classes:!0,styles:!0},{name:"img",attributes:["src","width","height","alt"],classes:!0,styles:!0},{name:/^(table|tbody|th|tr|td)$/,attributes:["id","cellpadding","cellspacing","colspan","rowspan","border","width","height","align","valign"],classes:!0,styles:!0}]},language:{ui:c}}).then(k=>{t(14,m=k),p!=null&&k.ui.view.element!=null&&p.appendChild(k.ui.view.element),k.model.document.on("change:data",(L,C)=>{t(1,a=k.getData()),u(L,C)}),k.on("change:state",(L,C,P,x)=>{d(L,P)}),k.plugins.has("SourceEditing")&&k.plugins.get("SourceEditing").isEnabled&&k.plugins.get("SourceEditing").on("change:isSourceEditingMode",(L,C,P,x)=>{h(L,P)}),d(null,"ready")}).catch(k=>{console.error(k.stack)});function D(k){Ns[k?"unshift":"push"](()=>{p=k,t(0,p)})}return n.$$set=k=>{"insertImageServiceUrl"in k&&t(2,i=k.insertImageServiceUrl),"getImageServiceUrl"in k&&t(3,s=k.getImageServiceUrl),"items"in k&&t(4,o=k.items),"allowHtmlSupport"in k&&t(5,r=k.allowHtmlSupport),"value"in k&&t(1,a=k.value),"placeHolder"in k&&t(6,l=k.placeHolder),"lang"in k&&t(7,c=k.lang),"valueChange"in k&&t(8,u=k.valueChange),"stateChange"in k&&t(9,d=k.stateChange),"sourceEditingModeChange"in k&&t(10,h=k.sourceEditingModeChange)},n.$$.update=()=>{if(n.$$.dirty&16448){let k;m!=null&&(k=m.editing.view.document.getRoot("main"))!=null&&k.placeholder!=l&&(k.placeholder=l)}},[p,a,i,s,o,r,l,c,u,d,h,f,y,T,m,D]}class e1 extends Th{constructor(e){super(),kh(this,e,lL,oL,ph,{insertImageServiceUrl:2,getImageServiceUrl:3,items:4,allowHtmlSupport:5,value:1,placeHolder:6,lang:7,valueChange:8,stateChange:9,sourceEditingModeChange:10,getEditor:11,setCursorPositionAtPlaceholder:12,setCursorPositionFromJSONString:13})}get insertImageServiceUrl(){return this.$$.ctx[2]}set insertImageServiceUrl(e){this.$$set({insertImageServiceUrl:e}),Re()}get getImageServiceUrl(){return this.$$.ctx[3]}set getImageServiceUrl(e){this.$$set({getImageServiceUrl:e}),Re()}get items(){return this.$$.ctx[4]}set items(e){this.$$set({items:e}),Re()}get allowHtmlSupport(){return this.$$.ctx[5]}set allowHtmlSupport(e){this.$$set({allowHtmlSupport:e}),Re()}get value(){return this.$$.ctx[1]}set value(e){this.$$set({value:e}),Re()}get placeHolder(){return this.$$.ctx[6]}set placeHolder(e){this.$$set({placeHolder:e}),Re()}get lang(){return this.$$.ctx[7]}set lang(e){this.$$set({lang:e}),Re()}get valueChange(){return this.$$.ctx[8]}set valueChange(e){this.$$set({valueChange:e}),Re()}get stateChange(){return this.$$.ctx[9]}set stateChange(e){this.$$set({stateChange:e}),Re()}get sourceEditingModeChange(){return this.$$.ctx[10]}set sourceEditingModeChange(e){this.$$set({sourceEditingModeChange:e}),Re()}get getEditor(){return this.$$.ctx[11]}get setCursorPositionAtPlaceholder(){return this.$$.ctx[12]}get setCursorPositionFromJSONString(){return this.$$.ctx[13]}}customElements.define("ckeditor5-classic",Eh(e1,{insertImageServiceUrl:{},getImageServiceUrl:{},items:{},allowHtmlSupport:{type:"Boolean"},value:{},placeHolder:{},lang:{},valueChange:{},stateChange:{},sourceEditingModeChange:{}},[],["getEditor","setCursorPositionAtPlaceholder","setCursorPositionFromJSONString"],!1));exports.CKEditor5Classic_1=e1;exports.SvelteComponent=Th;exports.add_flush_callback=b1;exports.append=o1;exports.attr=bh;exports.bind=E1;exports.binding_callbacks=Ns;exports.check_outros=k1;exports.createEventDispatcher=g1;exports.create_component=T1;exports.create_custom_element=Eh;exports.destroy_component=yh;exports.destroy_each=r1;exports.detach=fo;exports.element=Ca;exports.flush=Re;exports.group_outros=y1;exports.init=kh;exports.insert=ka;exports.is_function=ya;exports.listen=l1;exports.mount_component=vh;exports.noop=Yt;exports.run_all=Zi;exports.safe_not_equal=ph;exports.set_data=u1;exports.set_input_value=d1;exports.space=a1;exports.text=wh;exports.transition_in=_h;exports.transition_out=C1;
|
|
1717
|
+
*/class iL extends w{static get requires(){return[ti]}static get pluginName(){return"CKFinderUploadAdapter"}init(){const e=this.editor.config.get("ckfinder.uploadUrl");e&&(this.editor.plugins.get(ti).createUploadAdapter=t=>new nL(t,e,this.editor.t))}}class nL{constructor(e,t,i){this.loader=e,this.url=t,this.t=i}upload(){return this.loader.file.then(e=>new Promise((t,i)=>{this._initRequest(),this._initListeners(t,i,e),this._sendRequest(e)}))}abort(){this.xhr&&this.xhr.abort()}_initRequest(){const e=this.xhr=new XMLHttpRequest;e.open("POST",this.url,!0),e.responseType="json"}_initListeners(e,t,i){const s=this.xhr,o=this.loader,r=this.t,a=r("Cannot upload file:")+` ${i.name}.`;s.addEventListener("error",()=>t(a)),s.addEventListener("abort",()=>t()),s.addEventListener("load",()=>{const l=s.response;if(!l||!l.uploaded)return t(l&&l.error&&l.error.message?l.error.message:a);e({default:l.url})});/* istanbul ignore else -- @preserve */s.upload&&s.upload.addEventListener("progress",l=>{l.lengthComputable&&(o.uploadTotal=l.total,o.uploaded=l.loaded)})}_sendRequest(e){const t=new FormData;t.append("upload",e),t.append("ckCsrfToken",QV()),this.xhr.send(t)}}class va extends Io{}me(va,"builtinPlugins",[cP,lI,bI,GI,yI,iP,xP,VP,s4,p4,w4,XP,y4,C4,PI,Y4,s7,yp,S7,G7,us,Wp,uR,oR,pR,XR,L8,MI,DI,AI,J8,hV,_V,EV,RV,FV,YV,iL]),me(va,"defaultConfig",{toolbar:{items:["undo","redo","|","heading","bold","italic","strikethrough","underline","fontColor","fontBackgroundColor","fontFamily","fontSize","|","numberedList","bulletedList","|","outdent","indent","blockQuote","|","alignment","|","link","imageUpload","mediaEmbed","horizontalLine","specialCharacters","code","codeBlock","insertTable","|","style","|","removeFormat","selectAll","|","sourceEditing"]},style:{definitions:[{name:"Source code",element:"pre",classes:["SourceCode"]},{name:"Error",element:"p",classes:["Error"]},{name:"Path",element:"p",classes:["Path"]}]},codeBlock:{languages:[{language:"plaintext",label:"Plain text"},{language:"html",label:"HTML"},{language:"javascript",label:"JavaScript"},{language:"php",label:"PHP"},{language:"css",label:"CSS"}]},headingConfig:{options:[{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h1",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h2",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h3",title:"Heading 3",class:"ck-heading_heading3"}]},image:{resizeOptions:[{name:"resizeImage:25",value:"25",icon:"small"},{name:"resizeImage:50",value:"50",icon:"medium"},{name:"resizeImage:75",value:"75",icon:"large"},{name:"resizeImage:original",value:null,icon:"original"}],toolbar:["toggleImageCaption","imageTextAlternative","|","imageStyle:inline","imageStyle:block","imageStyle:side","|","imageStyle:wrapText","imageStyle:breakText","|","resizeImage:25","resizeImage:50","resizeImage:75","resizeImage:original"]},language:"en"});class sL{constructor(e,t,i){me(this,"loader");me(this,"xhr");me(this,"insertImageServiceUrl");me(this,"getImageServiceUrl");this.loader=e,this.insertImageServiceUrl=t,this.getImageServiceUrl=i}upload(){return this.loader.file.then(e=>new Promise((t,i)=>{this._initRequest(e),this._initListeners(t,i,e),this._sendRequest(e)}))}abort(){this.xhr&&this.xhr.abort()}_initRequest(e){const t=this.xhr=new XMLHttpRequest;let i=this.insertImageServiceUrl;i+="&dADFileUpload=Y",i+="&max_file_size=0",i+="&name="+window.btoa(encodeURIComponent(e.name)),i+="&size="+e.size,i+="&type="+(e.type?e.type:"n/a"),t.open("POST",i,!0),t.responseType="json"}_initListeners(e,t,i){const s=this.xhr,o=this.loader,r=`Couldn't upload file: ${i.name}.`;s.addEventListener("error",()=>t(r)),s.addEventListener("abort",()=>t()),s.addEventListener("load",()=>{const a=s.response;if(a&&a.S){if(a.S==="Y"){const l=this._getFileIdFromResponse(a);if(l){e({default:this.getImageServiceUrl+"?view=Y&file="+l});return}}else if(a.M){t(a.M);return}}t(r)}),s.upload&&s.upload.addEventListener("progress",a=>{a.lengthComputable&&(o.uploadTotal=a.total,o.uploaded=a.loaded)})}_sendRequest(e){this.xhr.send(e.slice())}_getFileIdFromResponse(e){if(e.F&&Array.isArray(e.F)){for(const t of e.F)if(Array.isArray(t)&&t.length>1&&t[0]==="id")return t[1]}return null}}function oL(n){let e;return{c(){e=Ca("div")},m(t,i){ka(t,e,i),n[15](e)},p:Yt,i:Yt,o:Yt,d(t){t&&fo(e),n[15](null)}}}function rL(n){const e=n.editing.view.domConverter.unsafeElements,t=e.indexOf("style");t>-1&&e.splice(t,1)}function aL(n){n.conversion.for("downcast").add(e=>e.on("insert:imageBlock",(t,i,s)=>{const o=s.mapper.toViewElement(i.item);o&&s.writer.setStyle("margin","0",o)},{priority:"lowest"}))}function lL(n,e,t){const i=e.createRangeIn(t);for(const s of i.getWalker()){const o=s.item;if(o.is("$textProxy")&&o.data!=""&&o.data.includes(n))return o}return null}function cL(n,e,t){let{insertImageServiceUrl:i=""}=e,{getImageServiceUrl:s=""}=e,{items:o=["undo","redo","|","heading","bold","italic","strikethrough","underline","fontColor","fontBackgroundColor","fontFamily","fontSize","|","numberedList","bulletedList","|","outdent","indent","blockQuote","|","alignment","|","link","imageUpload","mediaEmbed","horizontalLine","specialCharacters","code","codeBlock","insertTable","|","style","|","removeFormat","selectAll","|","sourceEditing"]}=e,{allowHtmlSupport:r=!1}=e,{value:a=""}=e,{placeHolder:l=""}=e,{lang:c="en"}=e,{valueChange:u=(k,L)=>{}}=e,{stateChange:d=(k,L)=>{}}=e,{sourceEditingModeChange:h=(k,L)=>{}}=e;const f=()=>m;let m=null,p=null;function _(k){k.plugins.get("FileRepository").createUploadAdapter=L=>new sL(L,i,s)}const y=k=>{m!=null&&(m.focus(),m.model.change(L=>{if(m==null)return;let C=m.model.document.getRoot();if(C==null)return;const P=lL(k,L,C);if(P!=null){L.setSelection(L.createPositionBefore(P)),L.remove(P);const x=P.data.split(k);L.insertText(x[0],m.model.document.selection.getFirstPosition()??void 0);const Y=m.model.document.selection.getFirstPosition();L.insertText(x[1],m.model.document.selection.getFirstPosition()??void 0),L.setSelection(Y)}}))},T=k=>{m!=null&&(m.focus(),m.model.change(L=>{if(m==null)return;let C=JSON.parse(k);if(C.root==null||C.path==null||C.stickiness==null)return;let P=m.model.document.getRoot(C.root);P!=null&&L.setSelection(L.createPositionFromPath(P,C.path,C.stickiness))}))};va.create(a,{placeholder:l,toolbar:o,extraPlugins:[_,rL,aL],htmlSupport:{allow:r?[{name:/.*/,attributes:!0,classes:!0,styles:!0}]:[{name:"a",attributes:["href","target","rel"],classes:!0,styles:!0},{name:/^(b|i|br|center|hr|nav|s|strong|style|u)$/},{name:/^(div|p|span)$/,classes:!0,styles:!0},{name:"img",attributes:["src","width","height","alt"],classes:!0,styles:!0},{name:/^(table|tbody|th|tr|td)$/,attributes:["id","cellpadding","cellspacing","colspan","rowspan","border","width","height","align","valign"],classes:!0,styles:!0}]},language:{ui:c}}).then(k=>{t(14,m=k),p!=null&&k.ui.view.element!=null&&p.appendChild(k.ui.view.element),k.model.document.on("change:data",(L,C)=>{t(1,a=k.getData()),u(L,C)}),k.on("change:state",(L,C,P,x)=>{d(L,P)}),k.plugins.has("SourceEditing")&&k.plugins.get("SourceEditing").isEnabled&&k.plugins.get("SourceEditing").on("change:isSourceEditingMode",(L,C,P,x)=>{h(L,P)}),d(null,"ready")}).catch(k=>{console.error(k.stack)});function D(k){Ns[k?"unshift":"push"](()=>{p=k,t(0,p)})}return n.$$set=k=>{"insertImageServiceUrl"in k&&t(2,i=k.insertImageServiceUrl),"getImageServiceUrl"in k&&t(3,s=k.getImageServiceUrl),"items"in k&&t(4,o=k.items),"allowHtmlSupport"in k&&t(5,r=k.allowHtmlSupport),"value"in k&&t(1,a=k.value),"placeHolder"in k&&t(6,l=k.placeHolder),"lang"in k&&t(7,c=k.lang),"valueChange"in k&&t(8,u=k.valueChange),"stateChange"in k&&t(9,d=k.stateChange),"sourceEditingModeChange"in k&&t(10,h=k.sourceEditingModeChange)},n.$$.update=()=>{if(n.$$.dirty&16448){let k;m!=null&&(k=m.editing.view.document.getRoot("main"))!=null&&k.placeholder!=l&&(k.placeholder=l)}},[p,a,i,s,o,r,l,c,u,d,h,f,y,T,m,D]}class e1 extends Th{constructor(e){super(),kh(this,e,cL,oL,ph,{insertImageServiceUrl:2,getImageServiceUrl:3,items:4,allowHtmlSupport:5,value:1,placeHolder:6,lang:7,valueChange:8,stateChange:9,sourceEditingModeChange:10,getEditor:11,setCursorPositionAtPlaceholder:12,setCursorPositionFromJSONString:13})}get insertImageServiceUrl(){return this.$$.ctx[2]}set insertImageServiceUrl(e){this.$$set({insertImageServiceUrl:e}),Re()}get getImageServiceUrl(){return this.$$.ctx[3]}set getImageServiceUrl(e){this.$$set({getImageServiceUrl:e}),Re()}get items(){return this.$$.ctx[4]}set items(e){this.$$set({items:e}),Re()}get allowHtmlSupport(){return this.$$.ctx[5]}set allowHtmlSupport(e){this.$$set({allowHtmlSupport:e}),Re()}get value(){return this.$$.ctx[1]}set value(e){this.$$set({value:e}),Re()}get placeHolder(){return this.$$.ctx[6]}set placeHolder(e){this.$$set({placeHolder:e}),Re()}get lang(){return this.$$.ctx[7]}set lang(e){this.$$set({lang:e}),Re()}get valueChange(){return this.$$.ctx[8]}set valueChange(e){this.$$set({valueChange:e}),Re()}get stateChange(){return this.$$.ctx[9]}set stateChange(e){this.$$set({stateChange:e}),Re()}get sourceEditingModeChange(){return this.$$.ctx[10]}set sourceEditingModeChange(e){this.$$set({sourceEditingModeChange:e}),Re()}get getEditor(){return this.$$.ctx[11]}get setCursorPositionAtPlaceholder(){return this.$$.ctx[12]}get setCursorPositionFromJSONString(){return this.$$.ctx[13]}}customElements.define("ckeditor5-classic",Eh(e1,{insertImageServiceUrl:{},getImageServiceUrl:{},items:{},allowHtmlSupport:{type:"Boolean"},value:{},placeHolder:{},lang:{},valueChange:{},stateChange:{},sourceEditingModeChange:{}},[],["getEditor","setCursorPositionAtPlaceholder","setCursorPositionFromJSONString"],!1));exports.CKEditor5Classic_1=e1;exports.SvelteComponent=Th;exports.add_flush_callback=b1;exports.append=o1;exports.attr=bh;exports.bind=E1;exports.binding_callbacks=Ns;exports.check_outros=k1;exports.createEventDispatcher=g1;exports.create_component=T1;exports.create_custom_element=Eh;exports.destroy_component=yh;exports.destroy_each=r1;exports.detach=fo;exports.element=Ca;exports.flush=Re;exports.group_outros=y1;exports.init=kh;exports.insert=ka;exports.is_function=ya;exports.listen=l1;exports.mount_component=vh;exports.noop=Yt;exports.run_all=Zi;exports.safe_not_equal=ph;exports.set_data=u1;exports.set_input_value=d1;exports.space=a1;exports.text=wh;exports.transition_in=_h;exports.transition_out=C1;
|
|
@@ -37,7 +37,7 @@ function Kp(n, e) {
|
|
|
37
37
|
function Zp(n) {
|
|
38
38
|
return Object.keys(n).length === 0;
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function QV(n, e) {
|
|
41
41
|
n.appendChild(e);
|
|
42
42
|
}
|
|
43
43
|
function mh(n, e, t) {
|
|
@@ -46,7 +46,7 @@ function mh(n, e, t) {
|
|
|
46
46
|
function va(n) {
|
|
47
47
|
n.parentNode && n.parentNode.removeChild(n);
|
|
48
48
|
}
|
|
49
|
-
function
|
|
49
|
+
function XV(n, e) {
|
|
50
50
|
for (let t = 0; t < n.length; t += 1)
|
|
51
51
|
n[t] && n[t].d(e);
|
|
52
52
|
}
|
|
@@ -56,10 +56,10 @@ function gh(n) {
|
|
|
56
56
|
function Jp(n) {
|
|
57
57
|
return document.createTextNode(n);
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function eL() {
|
|
60
60
|
return Jp(" ");
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function tL(n, e, t, i) {
|
|
63
63
|
return n.addEventListener(e, t, i), () => n.removeEventListener(e, t, i);
|
|
64
64
|
}
|
|
65
65
|
function Yp(n, e, t) {
|
|
@@ -68,11 +68,11 @@ function Yp(n, e, t) {
|
|
|
68
68
|
function Qp(n) {
|
|
69
69
|
return Array.from(n.childNodes);
|
|
70
70
|
}
|
|
71
|
-
function
|
|
71
|
+
function iL(n, e) {
|
|
72
72
|
e = "" + e, n.data !== e && (n.data = /** @type {string} */
|
|
73
73
|
e);
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function nL(n, e) {
|
|
76
76
|
n.value = e ?? "";
|
|
77
77
|
}
|
|
78
78
|
function Xp(n, e, { bubbles: t = !1, cancelable: i = !1 } = {}) {
|
|
@@ -96,7 +96,7 @@ function t1() {
|
|
|
96
96
|
throw new Error("Function called outside component initialization");
|
|
97
97
|
return xn;
|
|
98
98
|
}
|
|
99
|
-
function
|
|
99
|
+
function sL() {
|
|
100
100
|
const n = t1();
|
|
101
101
|
return (e, t, { cancelable: i = !1 } = {}) => {
|
|
102
102
|
const s = n.$$.callbacks[e];
|
|
@@ -124,7 +124,7 @@ function n1() {
|
|
|
124
124
|
function Er(n) {
|
|
125
125
|
Fi.push(n);
|
|
126
126
|
}
|
|
127
|
-
function
|
|
127
|
+
function oL(n) {
|
|
128
128
|
kr.push(n);
|
|
129
129
|
}
|
|
130
130
|
const Lo = /* @__PURE__ */ new Set();
|
|
@@ -167,7 +167,7 @@ function o1(n) {
|
|
|
167
167
|
}
|
|
168
168
|
const Rs = /* @__PURE__ */ new Set();
|
|
169
169
|
let Zt;
|
|
170
|
-
function
|
|
170
|
+
function rL() {
|
|
171
171
|
Zt = {
|
|
172
172
|
r: 0,
|
|
173
173
|
c: [],
|
|
@@ -175,13 +175,13 @@ function oL() {
|
|
|
175
175
|
// parent group
|
|
176
176
|
};
|
|
177
177
|
}
|
|
178
|
-
function
|
|
178
|
+
function aL() {
|
|
179
179
|
Zt.r || Jn(Zt.c), Zt = Zt.p;
|
|
180
180
|
}
|
|
181
181
|
function r1(n, e) {
|
|
182
182
|
n && n.i && (Rs.delete(n), n.i(e));
|
|
183
183
|
}
|
|
184
|
-
function
|
|
184
|
+
function lL(n, e, t, i) {
|
|
185
185
|
if (n && n.o) {
|
|
186
186
|
if (Rs.has(n))
|
|
187
187
|
return;
|
|
@@ -191,11 +191,11 @@ function aL(n, e, t, i) {
|
|
|
191
191
|
} else
|
|
192
192
|
i && i();
|
|
193
193
|
}
|
|
194
|
-
function
|
|
194
|
+
function cL(n, e, t) {
|
|
195
195
|
const i = n.$$.props[e];
|
|
196
196
|
i !== void 0 && (n.$$.bound[i] = t, t(n.$$.ctx[i]));
|
|
197
197
|
}
|
|
198
|
-
function
|
|
198
|
+
function uL(n) {
|
|
199
199
|
n && n.c();
|
|
200
200
|
}
|
|
201
201
|
function a1(n, e, t) {
|
|
@@ -59636,7 +59636,18 @@ function jV(n) {
|
|
|
59636
59636
|
const e = n.editing.view.domConverter.unsafeElements, t = e.indexOf("style");
|
|
59637
59637
|
t > -1 && e.splice(t, 1);
|
|
59638
59638
|
}
|
|
59639
|
-
function GV(n
|
|
59639
|
+
function GV(n) {
|
|
59640
|
+
n.conversion.for("downcast").add((e) => e.on(
|
|
59641
|
+
"insert:imageBlock",
|
|
59642
|
+
(t, i, s) => {
|
|
59643
|
+
const o = s.mapper.toViewElement(i.item);
|
|
59644
|
+
o && s.writer.setStyle("margin", "0", o);
|
|
59645
|
+
},
|
|
59646
|
+
// Use the lowest priority to make sure that this will be run after default converters.
|
|
59647
|
+
{ priority: "lowest" }
|
|
59648
|
+
));
|
|
59649
|
+
}
|
|
59650
|
+
function KV(n, e, t) {
|
|
59640
59651
|
const i = e.createRangeIn(t);
|
|
59641
59652
|
for (const s of i.getWalker()) {
|
|
59642
59653
|
const o = s.item;
|
|
@@ -59645,7 +59656,7 @@ function GV(n, e, t) {
|
|
|
59645
59656
|
}
|
|
59646
59657
|
return null;
|
|
59647
59658
|
}
|
|
59648
|
-
function
|
|
59659
|
+
function ZV(n, e, t) {
|
|
59649
59660
|
let { insertImageServiceUrl: i = "" } = e, { getImageServiceUrl: s = "" } = e, { items: o = [
|
|
59650
59661
|
"undo",
|
|
59651
59662
|
"redo",
|
|
@@ -59700,7 +59711,7 @@ function KV(n, e, t) {
|
|
|
59700
59711
|
let C = m.model.document.getRoot();
|
|
59701
59712
|
if (C == null)
|
|
59702
59713
|
return;
|
|
59703
|
-
const P =
|
|
59714
|
+
const P = KV(k, L, C);
|
|
59704
59715
|
if (P != null) {
|
|
59705
59716
|
L.setSelection(L.createPositionBefore(P)), L.remove(P);
|
|
59706
59717
|
const x = P.data.split(k);
|
|
@@ -59723,7 +59734,11 @@ function KV(n, e, t) {
|
|
|
59723
59734
|
_a.create(a, {
|
|
59724
59735
|
placeholder: l,
|
|
59725
59736
|
toolbar: o,
|
|
59726
|
-
extraPlugins: [
|
|
59737
|
+
extraPlugins: [
|
|
59738
|
+
_,
|
|
59739
|
+
jV,
|
|
59740
|
+
GV
|
|
59741
|
+
],
|
|
59727
59742
|
htmlSupport: {
|
|
59728
59743
|
allow: r ? [
|
|
59729
59744
|
{
|
|
@@ -59735,7 +59750,7 @@ function KV(n, e, t) {
|
|
|
59735
59750
|
] : [
|
|
59736
59751
|
{
|
|
59737
59752
|
name: "a",
|
|
59738
|
-
attributes: ["href", "target"],
|
|
59753
|
+
attributes: ["href", "target", "rel"],
|
|
59739
59754
|
classes: !0,
|
|
59740
59755
|
styles: !0
|
|
59741
59756
|
},
|
|
@@ -59747,11 +59762,6 @@ function KV(n, e, t) {
|
|
|
59747
59762
|
classes: !0,
|
|
59748
59763
|
styles: !0
|
|
59749
59764
|
},
|
|
59750
|
-
{
|
|
59751
|
-
name: /^(figure|figcaption)$/,
|
|
59752
|
-
classes: !0,
|
|
59753
|
-
styles: !0
|
|
59754
|
-
},
|
|
59755
59765
|
{
|
|
59756
59766
|
name: "img",
|
|
59757
59767
|
attributes: ["src", "width", "height", "alt"],
|
|
@@ -59821,9 +59831,9 @@ function KV(n, e, t) {
|
|
|
59821
59831
|
D
|
|
59822
59832
|
];
|
|
59823
59833
|
}
|
|
59824
|
-
class
|
|
59834
|
+
class JV extends h1 {
|
|
59825
59835
|
constructor(e) {
|
|
59826
|
-
super(), u1(this, e,
|
|
59836
|
+
super(), u1(this, e, ZV, qV, Kp, {
|
|
59827
59837
|
insertImageServiceUrl: 2,
|
|
59828
59838
|
getImageServiceUrl: 3,
|
|
59829
59839
|
items: 4,
|
|
@@ -59909,37 +59919,37 @@ class ZV extends h1 {
|
|
|
59909
59919
|
return this.$$.ctx[13];
|
|
59910
59920
|
}
|
|
59911
59921
|
}
|
|
59912
|
-
customElements.define("ckeditor5-classic", d1(
|
|
59922
|
+
customElements.define("ckeditor5-classic", d1(JV, { insertImageServiceUrl: {}, getImageServiceUrl: {}, items: {}, allowHtmlSupport: { type: "Boolean" }, value: {}, placeHolder: {}, lang: {}, valueChange: {}, stateChange: {}, sourceEditingModeChange: {} }, [], ["getEditor", "setCursorPositionAtPlaceholder", "setCursorPositionFromJSONString"], !1));
|
|
59913
59923
|
export {
|
|
59914
59924
|
l1 as A,
|
|
59915
|
-
|
|
59916
|
-
|
|
59917
|
-
|
|
59925
|
+
rL as B,
|
|
59926
|
+
nL as C,
|
|
59927
|
+
JV as D,
|
|
59918
59928
|
h1 as S,
|
|
59919
|
-
|
|
59929
|
+
eL as a,
|
|
59920
59930
|
Yp as b,
|
|
59921
59931
|
d1 as c,
|
|
59922
59932
|
mh as d,
|
|
59923
59933
|
gh as e,
|
|
59924
59934
|
Ue as f,
|
|
59925
|
-
|
|
59935
|
+
QV as g,
|
|
59926
59936
|
va as h,
|
|
59927
59937
|
u1 as i,
|
|
59928
|
-
|
|
59929
|
-
|
|
59930
|
-
|
|
59938
|
+
XV as j,
|
|
59939
|
+
sL as k,
|
|
59940
|
+
tL as l,
|
|
59931
59941
|
fh as m,
|
|
59932
59942
|
Oi as n,
|
|
59933
|
-
|
|
59943
|
+
iL as o,
|
|
59934
59944
|
yr as p,
|
|
59935
|
-
|
|
59945
|
+
cL as q,
|
|
59936
59946
|
Jn as r,
|
|
59937
59947
|
Kp as s,
|
|
59938
59948
|
Jp as t,
|
|
59939
|
-
|
|
59949
|
+
uL as u,
|
|
59940
59950
|
a1 as v,
|
|
59941
|
-
|
|
59942
|
-
|
|
59951
|
+
lL as w,
|
|
59952
|
+
aL as x,
|
|
59943
59953
|
r1 as y,
|
|
59944
|
-
|
|
59954
|
+
oL as z
|
|
59945
59955
|
};
|
package/dist/editor-lib.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const t=require("./ckeditor5-
|
|
1
|
+
"use strict";const t=require("./ckeditor5-CXxEJzEp.cjs");function v(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function k(n,e,s){const l=n.slice();return l[4]=e[s],l}function E(n){let e,s=n[4].text+"",l,u,c,o,_;return{c(){e=t.element("button"),l=t.text(s),t.attr(e,"class",u=n[4].style),t.attr(e,"title",c=n[4].text)},m(r,a){t.insert(r,e,a),t.append(e,l),o||(_=t.listen(e,"click",function(){t.is_function(n[4].handler)&&n[4].handler.apply(this,arguments)}),o=!0)},p(r,a){n=r,a&1&&s!==(s=n[4].text+"")&&t.set_data(l,s),a&1&&u!==(u=n[4].style)&&t.attr(e,"class",u),a&1&&c!==(c=n[4].text)&&t.attr(e,"title",c)},d(r){r&&t.detach(e),o=!1,_()}}}function C(n){let e,s,l,u,c,o,_,r=v(n[0]),a=[];for(let i=0;i<r.length;i+=1)a[i]=E(k(n,r,i));return{c(){e=t.element("div"),s=t.element("button"),s.textContent="HTML",l=t.space(),u=t.element("button"),u.textContent="Plain",c=t.space();for(let i=0;i<a.length;i+=1)a[i].c();t.attr(s,"class","HTMLEditor"),t.attr(u,"class","PlainEditor")},m(i,d){t.insert(i,e,d),t.append(e,s),t.append(e,l),t.append(e,u),t.append(e,c);for(let f=0;f<a.length;f+=1)a[f]&&a[f].m(e,null);o||(_=[t.listen(s,"click",n[1]),t.listen(u,"click",n[2])],o=!0)},p(i,[d]){if(d&1){r=v(i[0]);let f;for(f=0;f<r.length;f+=1){const b=k(i,r,f);a[f]?a[f].p(b,d):(a[f]=E(b),a[f].c(),a[f].m(e,null))}for(;f<a.length;f+=1)a[f].d(1);a.length=r.length}},i:t.noop,o:t.noop,d(i){i&&t.detach(e),t.destroy_each(a,i),o=!1,t.run_all(_)}}}function w(n,e,s){const l=t.createEventDispatcher();let{buttons:u=[]}=e;function c(){l("html",{})}function o(){l("plain",{})}return n.$$set=_=>{"buttons"in _&&s(0,u=_.buttons)},[u,c,o]}class $ extends t.SvelteComponent{constructor(e){super(),t.init(this,e,w,C,t.safe_not_equal,{buttons:0})}get buttons(){return this.$$.ctx[0]}set buttons(e){this.$$set({buttons:e}),t.flush()}}t.create_custom_element($,{buttons:{}},[],[],!0);function H(n){let e,s,l;return{c(){e=t.element("textarea")},m(u,c){t.insert(u,e,c),t.set_input_value(e,n[0]),s||(l=t.listen(e,"input",n[6]),s=!0)},p(u,c){c&1&&t.set_input_value(e,u[0])},i:t.noop,o:t.noop,d(u){u&&t.detach(e),s=!1,l()}}}function P(n){let e,s,l;function u(o){n[5](o)}let c={};return n[0]!==void 0&&(c.value=n[0]),e=new t.CKEditor5Classic_1({props:c}),t.binding_callbacks.push(()=>t.bind(e,"value",u)),{c(){t.create_component(e.$$.fragment)},m(o,_){t.mount_component(e,o,_),l=!0},p(o,_){const r={};!s&&_&1&&(s=!0,r.value=o[0],t.add_flush_callback(()=>s=!1)),e.$set(r)},i(o){l||(t.transition_in(e.$$.fragment,o),l=!0)},o(o){t.transition_out(e.$$.fragment,o),l=!1},d(o){t.destroy_component(e,o)}}}function q(n){let e,s,l,u,c,o,_,r;const a=[P,H],i=[];function d(h,m){return h[2]?0:1}l=d(n),u=i[l]=a[l](n);function f(h){n[7](h)}let b={};return n[1]!==void 0&&(b.buttons=n[1]),o=new $({props:b}),t.binding_callbacks.push(()=>t.bind(o,"buttons",f)),o.$on("html",n[3]),o.$on("plain",n[4]),{c(){e=t.element("main"),s=t.element("div"),u.c(),c=t.space(),t.create_component(o.$$.fragment),t.attr(s,"class","Editor")},m(h,m){t.insert(h,e,m),t.append(e,s),i[l].m(s,null),t.append(e,c),t.mount_component(o,e,null),r=!0},p(h,[m]){let p=l;l=d(h),l===p?i[l].p(h,m):(t.group_outros(),t.transition_out(i[p],1,1,()=>{i[p]=null}),t.check_outros(),u=i[l],u?u.p(h,m):(u=i[l]=a[l](h),u.c()),t.transition_in(u,1),u.m(s,null));const g={};!_&&m&2&&(_=!0,g.buttons=h[1],t.add_flush_callback(()=>_=!1)),o.$set(g)},i(h){r||(t.transition_in(u),t.transition_in(o.$$.fragment,h),r=!0)},o(h){t.transition_out(u),t.transition_out(o.$$.fragment,h),r=!1},d(h){h&&t.detach(e),i[l].d(),t.destroy_component(o)}}}function S(n,e,s){let{value:l=""}=e,{buttons:u=[]}=e,{html:c=!0}=e;function o(){c||s(2,c=!0)}function _(){c&&(s(0,l=l.replace(/<[^>]*>?/gm,"")),s(2,c=!1))}function r(d){l=d,s(0,l)}function a(){l=this.value,s(0,l)}function i(d){u=d,s(1,u)}return n.$$set=d=>{"value"in d&&s(0,l=d.value),"buttons"in d&&s(1,u=d.buttons),"html"in d&&s(2,c=d.html)},[l,u,c,o,_,r,a,i]}class B extends t.SvelteComponent{constructor(e){super(),t.init(this,e,S,q,t.safe_not_equal,{value:0,buttons:1,html:2})}get value(){return this.$$.ctx[0]}set value(e){this.$$set({value:e}),t.flush()}get buttons(){return this.$$.ctx[1]}set buttons(e){this.$$set({buttons:e}),t.flush()}get html(){return this.$$.ctx[2]}set html(e){this.$$set({html:e}),t.flush()}}customElements.define("switchable-editor",t.create_custom_element(B,{value:{},buttons:{},html:{type:"Boolean"}},[],[],!1));
|
package/dist/editor-lib.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as M, S as T, i as j, f as v, s as y, e as d, a as B, b as h, d as w, g as m, l as C, n as $, h as H, j as O, r as Q, k as R, t as U, m as V, o as W, p as z, q as K, u as F, v as G, w as k, x as X, y as E, z as I, A as J, B as Y, C as q, D as Z } from "./ckeditor5-
|
|
1
|
+
import { c as M, S as T, i as j, f as v, s as y, e as d, a as B, b as h, d as w, g as m, l as C, n as $, h as H, j as O, r as Q, k as R, t as U, m as V, o as W, p as z, q as K, u as F, v as G, w as k, x as X, y as E, z as I, A as J, B as Y, C as q, D as Z } from "./ckeditor5-GI-h9giW.js";
|
|
2
2
|
function A(e) {
|
|
3
3
|
return (e == null ? void 0 : e.length) !== void 0 ? e : Array.from(e);
|
|
4
4
|
}
|