jodit-pro 1.3.29 → 1.3.31
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/build/config.js +2 -1
- package/build/jodit.es5.css +1 -1
- package/build/jodit.es5.js +1 -1
- package/build/jodit.fat.css +1 -1
- package/build/jodit.fat.es5.css +1 -1
- package/build/jodit.fat.es5.js +1 -1
- package/build/jodit.fat.js +1 -1
- package/build/jodit.js +1 -1
- package/build/plugins/autocomplete/autocomplete.js +1 -1
- package/build/plugins/backup/backup.js +1 -1
- package/build/plugins/button-generator/button-generator.js +1 -1
- package/build/plugins/color-picker/color-picker.js +1 -1
- package/build/plugins/emoji/emoji.js +1 -1
- package/build/plugins/finder/finder.js +1 -1
- package/build/plugins/google-maps/google-maps.js +1 -1
- package/build/plugins/iframe-editor/iframe-editor.js +1 -1
- package/build/plugins/keyboard/keyboard.js +1 -1
- package/build/plugins/paste-from-word/paste-from-word.js +1 -1
- package/build/plugins/show-blocks/show-blocks.js +1 -1
- package/build/plugins/translate/translate.css +1 -0
- package/build/plugins/translate/translate.es5.css +1 -0
- package/build/plugins/translate/translate.es5.js +1 -0
- package/build/plugins/translate/translate.js +1 -0
- package/index.html +2 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";((t,e)=>{if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var r in n)("object"==typeof exports?exports:t)[r]=n[r]}})(self,(function(){return(self.webpackChunkjodit_pro=self.webpackChunkjodit_pro||[]).push([[92],{51424(t,e,n){n.r(e),n.d(e,{PasteFromWordPro(){return D}});var r=n(62195),s=n(49940),i=n(57348),a=n(73042);function l(t){if(!t)return[0,0,0,0];const e=t.match(/(0|auto|(-?[.\d]+(?:\w+|%)))/g)||["0px"];switch(e.length){case 2:return[0,1,0,1].map((t=>e[t]));case 3:return[0,1,2,1].map((t=>e[t]));case 4:return[0,1,2,3].map((t=>e[t]));default:return[0,0,0,0].map((t=>e[t]))}}let o;function u(t){if("number"==typeof t)return t;if(/%$/.test(t))return 0;o||(o=document.createElement("div"),Object.assign(o.style,{position:"absolute",left:"-9999px",top:"-9999px",margin:"0",padding:"0",border:"0"}),document.body.append(o),setTimeout((()=>{null==o||o.remove(),o=null})));const e=0>parseFloat(t);e&&(t=t.replace("-","")),o.style.width=t;const n=o.clientWidth;return e?-n:n}function c(t){const{style:e}=t;let n=[0,0,0,0];const r=e.keys.filter((t=>/margin/.test(t))),s=Math.max(r.indexOf("margin-left"),r.indexOf("margin")),i=s>0?r[s]:"margin-left";let a;return"margin"===i?(n=l(e.get("margin")),a=n[3]||0):a=e.get(i)||0,u(a)}var d=n(16892),p=n(12815);function h(t,e=(()=>!0),n=!0,r){switch(!0){case t.isComment:case t.isText:{if(!e(t))return"";const{nodeValue:n}=t.attributes;return t.isComment?`\x3c!--${n}--\x3e`:n}case t.isElement:{const{attributes:s}=t,i=m(t,e,n,r);if(!t.attributes["jd-safe"]&&n&&0===i.replace(/[\n\t]/g,"").length&&!t.isSingle)return"";const a=Object.keys(s).map((t=>"style"===t||null==s[t]||/^jd-/.test(t)?"":`${t}="${g(s[t])}"`)).filter(Boolean),{str:l}=t.style,o=g(l((t=>f(t,r))));if(o&&a.push(`style="${o}"`),n&&0===a.length&&["span","a"].includes(t.name))return i;const u=a.length?" "+a.join(" "):"";return e(t)?t.isSingle?`<${t.name}${u}/>`:`<${t.name}${u}>${i}</${t.name}>`:i}}return""}function f(t,e){var n;if(!e)return!0;if(f.cache.has(e)){const r=null===(n=f.cache.get(e))||void 0===n?void 0:n.get(t);if((0,d.isBoolean)(r))return r}const r=e.some((e=>RegExp(e).test(t))),s=f.cache.get(e)||new Map;return s.set(t,r),f.cache.set(e,s),r}function m(t,e=(()=>!0),n=!0,r){let s=t.map((t=>h(t,e,n,r))).join("");return"p"===t.name&&0===(0,d.trim)(s).length&&(s=" "),s}function g(t){return(""+t).replace(/"/g,""")}f.cache=new WeakMap;const b="jd-list-level",y="jd-list-type",v="jd-list-style-type",x="list-style-type",E={"·":"disc",o:"circle","§":"square","[ivx]":"lower-roman","[IVX]":"upper-roman","[a-z]":"lower-alpha","[A-Z]":"upper-alpha","\\d":"decimal"};function j(t){return!(!t||"ol"!==t.name&&"ul"!==t.name)}function k(t){return!(!t||"li"!==t.name)}function w(t){return"li"!==t.name&&/mso-list:\s*l\d+ level\d+ lfo\d+/i.test(t.attributes.style)||/msolistparagraph/i.test(t.attributes.class)&&!!t.find((t=>t.isComment&&h(t).includes("supportLists"))).length}function $(t,e){return!(e.name!==t.attributes[y]||e.attributes[v]!==t.attributes[v]||t.attributes[b]!==e.attributes[b])}var T=n(96582),O=n(70655),_=n(98422);let S=class t{constructor(t){this._data=C(t)}get keys(){return Object.keys(this._data)}forEach(t){this.keys.forEach((e=>t(e)))}clear(){this._data={}}set(t,e){this._data[t]=e}get(t){var e;return null!==(e=this._data[t])&&void 0!==e?e:null}has(t){return void 0!==this._data[t]}add(t,e){return this._data=C(this.str()+";"+`${t}:${e}`),this}str(t=(t=>!0)){const e=Object.keys(this._data).filter((e=>e&&!/^mso-/.test(e)&&t(e)&&null!=this.get(e))),n=t=>(0,d.isString)(t)?/^0[a-z]+$/i.test(t)?"0":t:""+t;return["padding","margin"].forEach((t=>{if(this._data[t]){const r=e.indexOf(t),s=l(this._data[t]);["top","right","bottom","left"].forEach(((i,a)=>{const l=`${t}-${i}`,o=this._data[l];null==o||e.indexOf(l)>=r&&n(s[a])!==n(o)||-1!==e.indexOf(l)&&e.splice(e.indexOf(l),1)}))}})),e.length?e.map((t=>`${(0,d.kebabCase)(t)}:${this.get(t)}`)).join(";"):""}};function C(t){return(t=>{const e={},n=[];for(let r=t.length-1;r>=0;r-=1){const s=t[r][0];e[s]||(e[s]=!0,n.unshift(t[r]))}return n})((null!=t?t:"").replace(/"/g,'"').split(";").filter(Boolean).map((t=>(0,d.trim)(t).split(":").map(d.trim)))).reduce(((t,[e,n])=>(e&&n&&(t[e]=n),t)),{})}S=(0,O.gn)([_.autobind],S);const M=new Set(s.INSEPARABLE_TAGS);class N{constructor(t,e){this.parent=e,this.name=t.nodeName.toLowerCase(),this.type=t.nodeType,this.attributes=(t=>{const e={};if(T.i.isElement(t))for(let n=0,r=t.attributes;r.length>n;n+=1)e[r[n].name]=r[n].value;else e.nodeValue=t.nodeValue;return e})(t),this.style=new S(this.attributes.style),this.children=[],t.childNodes.forEach((t=>this.children.push(N.make(t,this))))}get isText(){return this.type===Node.TEXT_NODE}get isElement(){return this.type===Node.ELEMENT_NODE}get isComment(){return this.type===Node.COMMENT_NODE}get isSingle(){return M.has(this.name)}get length(){return this.children.length}static make(t,e=null){return new N(t,e)}wrap(t){var e;(0,d.assert)(null!=this.parent,"You can't wrap the root element");const n=N.make(document.createElement(t),this.parent),r=null!==(e=this.parent.children.indexOf(this))&&void 0!==e?e:-1;return-1===r?this.parent.append(n):this.parent.children[r]=n,n.append(this),n}append(t){return(0,d.assert)(t!==this,"Forbidden to add to yourself"),t.remove(),this.children.push(t),t.parent=this,this}get previousElement(){if(!this.parent)return null;const{children:t}=this.parent,e=t.indexOf(this);if(-1!==e)for(let n=e-1;n>=0;n-=1)if(t[n].isElement)return t[n];return null}get lastElement(){const{children:t}=this;for(let e=t.length-1;e>=0;e-=1)if(t[e].isElement)return t[e];return null}get previous(){var t,e,n;return null!==(n=null!==(t=this.sibling(!1))&&void 0!==t?t:null===(e=this.parent)||void 0===e?void 0:e.previous)&&void 0!==n?n:null}get next(){var t,e,n;return null!==(n=null!==(t=this.sibling(!0))&&void 0!==t?t:null===(e=this.parent)||void 0===e?void 0:e.next)&&void 0!==n?n:null}sibling(t){if(!this.parent)return null;const{children:e}=this.parent,n=e.indexOf(this);return-1!==n&&e[n+(t?1:-1)]?e[n+(t?1:-1)]:null}forEach(t,e=!1){const n=[...this.children];for(const r of n){if(!1===t(r))return!1;if(e&&!1===r.forEach(t,!0))return!1}}find(t,e=!0){const n=[];return this.forEach((e=>{t(e)&&n.push(e)}),e),n}map(t){return this.children.map(t)}remove(){var t,e;const n=null===(t=this.parent)||void 0===t?void 0:t.children.indexOf(this);return null!=n&&-1!==n&&(null===(e=this.parent)||void 0===e||e.children.splice(n,1)),this}textBetween(t,e){let n=!1;const r=[];return this.forEach((s=>{if(!n&&t(s)&&(n=!0),n&&s.isText&&r.push(h(s)),n&&e(s))return!1}),!0),r.join("")}}const L=["cellspacing","cellpadding","border","v:shapes","o:spid"],P=new Set(["o:p","xml","script","meta","link","v:imagedata","style"]),R={i:"em",b:"strong"};let W=0;var A=n(78097);function F(t,e,n,r){const s=t.split(n);for(const t of s){const n=t.split("shplid");if(n.length>1){const t=n[1];let s="";for(let e=0;t.length>e&&!/[{ \r\n\\]/.test(t[e]);e++)s+=t[e];const i=t.split("bliptag");if(i&&2>i.length)continue;let a=null;if(i[0].indexOf("pngblip")?a="image/png":-1!==i[0].indexOf("jpegblip")&&(a="image/jpeg"),!a)continue;const l=i[1].split("}");if(l&&2>l.length)continue;let o;if(l.length>2&&l[0].includes("blipuid"))o=l[1].split(" ");else{if(o=l[0].split(" "),o&&2>o.length)continue;o.shift()}r[e+s]={hex:o.join(""),type:a}}}}const B={"text-justify":["inter-ideograph"]},I=[(t,e)=>{var n;if(e.rtf&&"#comment"===t.name&&t.attributes.nodeValue&&-1!==t.attributes.nodeValue.indexOf("<v:shape")){e.shapes||(e.shapes={});const n=e.jodit.create.fromHTML(t.attributes.nodeValue);return(0,d.toArray)(n.getElementsByTagName("v:shape")).forEach((t=>{e.shapes[t.id]=t.getAttribute("o:spid")})),t}if("img"!==t.name)return t;if(e.rtf&&t.attributes["v:shapes"]){const r=null===(n=e.shapes)||void 0===n?void 0:n[t.attributes["v:shapes"]];if(r){e.imageMap||(e.imageMap={},F(e.rtf,"i","\\shppict",e.imageMap),F(e.rtf,"s","\\shp{",e.imageMap));const n=e.imageMap[r.substring(7)];if(n){const e=[],r=n.hex.match(/[0-9a-f]{2}/gi);if(r){for(let t=0;r.length>t;t++)e.push(String.fromCharCode(parseInt(r[t],16)));t.attributes.src="data:"+n.type+";base64,"+btoa(e.join(""))}}}}return t},t=>((t.isElement&&"always"===t.style.get("page-break-before")||"page"===t.style.get("break-before"))&&(t.attributes["jd-safe"]=!0,t.style.add("page-break-before","always"),t.isSingle&&(t.name="div")),t),t=>"none"===t.style.get("display")||0===t.length&&"span"===t.name||P.has(t.name)?(t.remove(),null):t,t=>{const{name:e}=t;return e in R&&(t.name=R[e]),t},t=>{if(/^OLE_LINK\d+$/.test(t.attributes.name)&&(t.attributes.name=null,0===t.length))return t.remove(),null;"_GoBack"===t.attributes.name&&(t.attributes.name=null);for(const e of L)t.attributes[e]&&(t.attributes[e]=null);return t},t=>{var e;if(w(t)){t.name="li",t.style.set("text-indent",null);const n=(t=>t.textBetween((t=>t.isComment&&/\[if.*supportLists.*]/.test(h(t))),(t=>t.isComment&&/\[endif]/.test(h(t)))).replace(/ /g,"").replace((0,s.SPACE_REG_EXP)(),""))(t),r=/[\da-np-zA-NP-Z].?/.test(n)?"ol":"ul",i=((t,e)=>{for(const e in E)if(RegExp(e).test(t))return E[e];return"ol"===e?"decimal":"disc"})(n,r);t.attributes[y]=r,t.attributes[v]=i,(t=>{if(void 0!==t.attributes[b])return;const e=[c(t)],n=[t];let r=t.next;for(;r;){if(r.isElement&&!r.attributes[b]&&w(r)){const t=c(r);t&&(e.push(t),n.push(r))}r=r.next}const s=Math.min(...e.filter((t=>t>0)));let i=e.map((t=>Math.ceil(t/10)));-1!==i.indexOf(0)&&(i=i.map((t=>t+1))),n.forEach(((t,e)=>{t.attributes[b]=i[e],t.style.add("margin-left",Math.max(c(t)-10*i[e]/s*40,0)+"px")}))})(t),(t=>{for(;t;){const e=t.previousElement;if(!k(e)&&!j(e))break;if(k(e)){if(e.attributes[b]>t.attributes[b])break;if(t.attributes[b]===e.attributes[b]&&t.parent&&$(t,t.parent))break;e.append(t);continue}const n=e;if(n.attributes[b]>t.attributes[b])break;if(t.attributes[b]===n.attributes[b]&&!$(t,n))break;n.append(t)}})(t);const{parent:a}=t;if(!j(a)||!$(t,a)){const s=((t,e,n,r)=>{const s=t.wrap(e);return s.attributes.start=(t=>/\d.\d/.test(t)?t.split(".").pop()||null:/^\d/.test(t)?""+(parseInt(t,10)||1):null)(n),s.attributes[b]=t.attributes[b],s.attributes[v]=t.attributes[v],s.attributes["data-list-style-type"]=t.attributes[v],s.style.set(x,r),(t=>{var e;!j(t)||"li"===(null===(e=t.parent)||void 0===e?void 0:e.name)||"disc"!==t.style.get(x)&&"decimal"!==t.style.get(x)||t.style.set(x,null)})(s),s})(t,r,n,i);return j(a)&&(s.remove(),null===(e=a.lastElement)||void 0===e||e.append(s)),t}}return t},(t,e)=>{var n;const r=null!==(n=e.links)&&void 0!==n?n:{};if(t.attributes.href&&t.attributes.href.match(/#.+$/)&&(r[t.attributes.href.match(/#(.+)$/)[1]]=t),t.attributes.name&&r[t.attributes.name]){const e=r[t.attributes.name];e.attributes.href=e.attributes.href.replace(/.*#(.*)$/,"#$1")}return e.links=r,t},t=>(t.isComment&&/\[if.*(supportLists|gte vml).*]/.test(h(t))&&(W++,t.remove()),t.isComment&&W>0&&h(t).includes("[endif]")&&(W=W>0?W-1:0,t.remove()),W&&(t.isText||"img"===t.name&&(!t.attributes.src||/^file:/.test(t.attributes.src)))?(t.remove(),null):t),(t,{jodit:e})=>{if(!e.o.pasteFromWord.convertUnitsToPixel)return t;const{style:n}=t;return n.forEach((t=>{const e=n.get(t);e&&n.set(t,(""+e).replace(/\d+(\.\d+)?(pt|cm)/g,(t=>u(t)+"px")))})),t},t=>(t.attributes.class&&(t.attributes.class=t.attributes.class.replace(/(el\d+)|(font\d+)|msonormal|msolistparagraph\w*/gi,""),(0,A.f)(t.attributes.class)||(t.attributes.class=null)),t),t=>t.isElement?("img"===t.name&&(t.attributes.align&&(t.style.add("float",t.attributes.align),t.attributes.align=null),t.attributes.hspace&&(t.style.add("marginLeft",t.attributes.hspace+"px"),t.style.add("marginRight",t.attributes.hspace+"px"),t.attributes.hspace=null)),t):t,t=>(!t.attributes.width||"th"!==t.name&&"td"!==t.name||(t.attributes.width=null),t),t=>(t.isElement&&t.attributes.style&&Object.keys(B).forEach((e=>{const n=B[e];t.style.has(e)&&n.includes(""+t.style.get(e))&&t.style.set(e,null)})),t)];n(733).D.prototype.pasteFromWord={enable:!1,convertUnitsToPixel:!1,allowedStyleProps:["background","background-color","border","border-.*","color","float","font-family","font-size","font-style","font-weight","height","line-height","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","padding","text-align","text-justify","text-decoration","text-indent","vertical-align","width"]};var V=n(62582);class D extends a.L{insertFromWordByType(t,e,n,r){var a;if(!this.j.o.pasteFromWord.enable||n!==s.INSERT_AS_HTML&&n!==s.INSERT_AS_TEXT)return super.insertFromWordByType(t,e,n,r);if(e=((t,e,n,r="")=>{var s,i;const a=document.createElement("iframe");a.style.display="none",document.body.appendChild(a);try{const l=null!==(s=a.contentDocument)&&void 0!==s?s:null===(i=a.contentWindow)||void 0===i?void 0:i.document;if(!l)return e;l.open(),l.write(e),l.close();const o="jd-style";for(let t=0;l.styleSheets.length>t;t+=1)try{const e=l.styleSheets[t].cssRules;for(let t=0;e.length>t;t+=1)e[t].selectorText&&(0,d.$$)(e[t].selectorText,l.body).forEach((n=>{(0,d.attr)(n,o)||((0,d.attr)(n,o,(0,d.attr)(n,"style")||""),(0,d.attr)(n,"style","")),(0,d.attr)(n,"style",`${(0,d.attr)(n,"style")};${e[t].style.cssText}`)}))}catch(t){}return(0,d.$$)(`[${o}]`,l.body).forEach((t=>{(0,d.attr)(t,"style",`${(0,d.attr)(t,"style")};${(0,d.attr)(t,o)}`)})),((t,e,n,r)=>{const s={jodit:t,rtf:r};return e.forEach((function t(e){if(e){for(const t of I)if(null==(e=t(e,s)))break;null==e||e.forEach(t)}})),n&&e.forEach((t=>{t.style.clear()}),!0),(0,A.f)(m(e,(t=>!t.isComment),!0,t.o.pasteFromWord.allowedStyleProps))})(t,N.make(l.body),n,r)}finally{p.i.safeRemove(a)}return e})(this.j,e,n===s.INSERT_AS_TEXT,r.rtf),this.j.o.beautifyHTML){const t=null===(a=this.j.events)||void 0===a?void 0:a.fire("beautifyHTML",e);(0,i.H)(t)&&(e=t)}(0,V.kU)(t,this.j,e)}}r.Jodit.plugins.remove("pasteFromWord"),r.Jodit.plugins.add("pasteFromWordPro",D)},70655(t,e,n){function r(t,e,n,r){var s,i=arguments.length,a=3>i?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(3>i?s(a):i>3?s(e,n,a):s(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a}n.d(e,{gn(){return r}})}},t=>t(t.s=51424)])}));
|
|
1
|
+
"use strict";((t,e)=>{if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var r in n)("object"==typeof exports?exports:t)[r]=n[r]}})(self,(function(){return(self.webpackChunkjodit_pro=self.webpackChunkjodit_pro||[]).push([[92],{51424(t,e,n){n.r(e),n.d(e,{PasteFromWordPro(){return D}});var r=n(62195),s=n(49940),i=n(57348),a=n(73042);function l(t){if(!t)return[0,0,0,0];const e=t.match(/(0|auto|(-?[.\d]+(?:\w+|%)))/g)||["0px"];switch(e.length){case 2:return[0,1,0,1].map((t=>e[t]));case 3:return[0,1,2,1].map((t=>e[t]));case 4:return[0,1,2,3].map((t=>e[t]));default:return[0,0,0,0].map((t=>e[t]))}}let o;function u(t){if("number"==typeof t)return t;if(/%$/.test(t))return 0;o||(o=document.createElement("div"),Object.assign(o.style,{position:"absolute",left:"-9999px",top:"-9999px",margin:"0",padding:"0",border:"0"}),document.body.append(o),setTimeout((()=>{null==o||o.remove(),o=null})));const e=0>parseFloat(t);e&&(t=t.replace("-","")),o.style.width=t;const n=o.clientWidth;return e?-n:n}function c(t){const{style:e}=t;let n=[0,0,0,0];const r=e.keys.filter((t=>/margin/.test(t))),s=Math.max(r.indexOf("margin-left"),r.indexOf("margin")),i=s>0?r[s]:"margin-left";let a;return"margin"===i?(n=l(e.get("margin")),a=n[3]||0):a=e.get(i)||0,u(a)}var d=n(16892),p=n(12815);function h(t,e=(()=>!0),n=!0,r){switch(!0){case t.isComment:case t.isText:{if(!e(t))return"";const{nodeValue:n}=t.attributes;return t.isComment?`\x3c!--${n}--\x3e`:n}case t.isElement:{const{attributes:s}=t,i=m(t,e,n,r);if(!t.attributes["jd-safe"]&&n&&0===i.replace(/[\n\t]/g,"").length&&!t.isSingle)return"";const a=Object.keys(s).map((t=>"style"===t||null==s[t]||/^jd-/.test(t)?"":`${t}="${g(s[t])}"`)).filter(Boolean),{str:l}=t.style,o=g(l((t=>f(t,r))));if(o&&a.push(`style="${o}"`),n&&0===a.length&&["span","a"].includes(t.name))return i;const u=a.length?" "+a.join(" "):"";return e(t)?t.isSingle?`<${t.name}${u}/>`:`<${t.name}${u}>${i}</${t.name}>`:i}}return""}function f(t,e){var n;if(!e)return!0;if(f.cache.has(e)){const r=null===(n=f.cache.get(e))||void 0===n?void 0:n.get(t);if((0,d.isBoolean)(r))return r}const r=e.some((e=>RegExp(e).test(t))),s=f.cache.get(e)||new Map;return s.set(t,r),f.cache.set(e,s),r}function m(t,e=(()=>!0),n=!0,r){let s=t.map((t=>h(t,e,n,r))).join("");return"p"===t.name&&0===(0,d.trim)(s).length&&(s=" "),s}function g(t){return(""+t).replace(/"/g,""")}f.cache=new WeakMap;const b="jd-list-level",y="jd-list-type",v="jd-list-style-type",x="list-style-type",E={"·":"disc",o:"circle","§":"square","[ivx]":"lower-roman","[IVX]":"upper-roman","[a-z]":"lower-alpha","[A-Z]":"upper-alpha","\\d":"decimal"};function j(t){return!(!t||"ol"!==t.name&&"ul"!==t.name)}function k(t){return!(!t||"li"!==t.name)}function w(t){return"li"!==t.name&&/mso-list:\s*l\d+ level\d+ lfo\d+/i.test(t.attributes.style)||/msolistparagraph/i.test(t.attributes.class)&&!!t.find((t=>t.isComment&&h(t).includes("supportLists"))).length}function $(t,e){return!(e.name!==t.attributes[y]||e.attributes[v]!==t.attributes[v]||t.attributes[b]!==e.attributes[b])}var T=n(96582),O=n(70655),_=n(98422);let S=class t{constructor(t){this._data=C(t)}get keys(){return Object.keys(this._data)}forEach(t){this.keys.forEach((e=>t(e)))}clear(){this._data={}}set(t,e){this._data[t]=e}get(t){var e;return null!==(e=this._data[t])&&void 0!==e?e:null}has(t){return void 0!==this._data[t]}add(t,e){return this._data=C(this.str()+";"+`${t}:${e}`),this}str(t=(t=>!0)){const e=Object.keys(this._data).filter((e=>e&&!/^mso-/.test(e)&&t(e)&&null!=this.get(e))),n=t=>(0,d.isString)(t)?/^0[a-z]+$/i.test(t)?"0":t:""+t;return["padding","margin"].forEach((t=>{if(this._data[t]){const r=e.indexOf(t),s=l(this._data[t]);["top","right","bottom","left"].forEach(((i,a)=>{const l=`${t}-${i}`,o=this._data[l];null==o||e.indexOf(l)>=r&&n(s[a])!==n(o)||-1!==e.indexOf(l)&&e.splice(e.indexOf(l),1)}))}})),e.length?e.map((t=>`${(0,d.kebabCase)(t)}:${this.get(t)}`)).join(";"):""}};function C(t){return(t=>{const e={},n=[];for(let r=t.length-1;r>=0;r-=1){const s=t[r][0];e[s]||(e[s]=!0,n.unshift(t[r]))}return n})((null!=t?t:"").replace(/"/g,'"').split(";").filter(Boolean).map((t=>(0,d.trim)(t).split(":").map(d.trim)))).reduce(((t,[e,n])=>(e&&n&&(t[e]=n),t)),{})}S=(0,O.gn)([_.autobind],S);const M=new Set(s.INSEPARABLE_TAGS);class N{get isText(){return this.type===Node.TEXT_NODE}get isElement(){return this.type===Node.ELEMENT_NODE}get isComment(){return this.type===Node.COMMENT_NODE}get isSingle(){return M.has(this.name)}get length(){return this.children.length}constructor(t,e){this.parent=e,this.name=t.nodeName.toLowerCase(),this.type=t.nodeType,this.attributes=(t=>{const e={};if(T.i.isElement(t))for(let n=0,r=t.attributes;r.length>n;n+=1)e[r[n].name]=r[n].value;else e.nodeValue=t.nodeValue;return e})(t),this.style=new S(this.attributes.style),this.children=[],t.childNodes.forEach((t=>this.children.push(N.make(t,this))))}static make(t,e=null){return new N(t,e)}wrap(t){var e;(0,d.assert)(null!=this.parent,"You can't wrap the root element");const n=N.make(document.createElement(t),this.parent),r=null!==(e=this.parent.children.indexOf(this))&&void 0!==e?e:-1;return-1===r?this.parent.append(n):this.parent.children[r]=n,n.append(this),n}append(t){return(0,d.assert)(t!==this,"Forbidden to add to yourself"),t.remove(),this.children.push(t),t.parent=this,this}get previousElement(){if(!this.parent)return null;const{children:t}=this.parent,e=t.indexOf(this);if(-1!==e)for(let n=e-1;n>=0;n-=1)if(t[n].isElement)return t[n];return null}get lastElement(){const{children:t}=this;for(let e=t.length-1;e>=0;e-=1)if(t[e].isElement)return t[e];return null}get previous(){var t,e,n;return null!==(n=null!==(t=this.sibling(!1))&&void 0!==t?t:null===(e=this.parent)||void 0===e?void 0:e.previous)&&void 0!==n?n:null}get next(){var t,e,n;return null!==(n=null!==(t=this.sibling(!0))&&void 0!==t?t:null===(e=this.parent)||void 0===e?void 0:e.next)&&void 0!==n?n:null}sibling(t){if(!this.parent)return null;const{children:e}=this.parent,n=e.indexOf(this);return-1!==n&&e[n+(t?1:-1)]?e[n+(t?1:-1)]:null}forEach(t,e=!1){const n=[...this.children];for(const r of n){if(!1===t(r))return!1;if(e&&!1===r.forEach(t,!0))return!1}}find(t,e=!0){const n=[];return this.forEach((e=>{t(e)&&n.push(e)}),e),n}map(t){return this.children.map(t)}remove(){var t,e;const n=null===(t=this.parent)||void 0===t?void 0:t.children.indexOf(this);return null!=n&&-1!==n&&(null===(e=this.parent)||void 0===e||e.children.splice(n,1)),this}textBetween(t,e){let n=!1;const r=[];return this.forEach((s=>{if(!n&&t(s)&&(n=!0),n&&s.isText&&r.push(h(s)),n&&e(s))return!1}),!0),r.join("")}}const L=["cellspacing","cellpadding","border","v:shapes","o:spid"],P=new Set(["o:p","xml","script","meta","link","v:imagedata","style"]),R={i:"em",b:"strong"};let W=0;var A=n(78097);function F(t,e,n,r){const s=t.split(n);for(const t of s){const n=t.split("shplid");if(n.length>1){const t=n[1];let s="";for(let e=0;t.length>e&&!/[{ \r\n\\]/.test(t[e]);e++)s+=t[e];const i=t.split("bliptag");if(i&&2>i.length)continue;let a=null;if(i[0].indexOf("pngblip")?a="image/png":-1!==i[0].indexOf("jpegblip")&&(a="image/jpeg"),!a)continue;const l=i[1].split("}");if(l&&2>l.length)continue;let o;if(l.length>2&&l[0].includes("blipuid"))o=l[1].split(" ");else{if(o=l[0].split(" "),o&&2>o.length)continue;o.shift()}r[e+s]={hex:o.join(""),type:a}}}}const B={"text-justify":["inter-ideograph"]},I=[(t,e)=>{var n;if(e.rtf&&"#comment"===t.name&&t.attributes.nodeValue&&-1!==t.attributes.nodeValue.indexOf("<v:shape")){e.shapes||(e.shapes={});const n=e.jodit.create.fromHTML(t.attributes.nodeValue);return(0,d.toArray)(n.getElementsByTagName("v:shape")).forEach((t=>{e.shapes[t.id]=t.getAttribute("o:spid")})),t}if("img"!==t.name)return t;if(e.rtf&&t.attributes["v:shapes"]){const r=null===(n=e.shapes)||void 0===n?void 0:n[t.attributes["v:shapes"]];if(r){e.imageMap||(e.imageMap={},F(e.rtf,"i","\\shppict",e.imageMap),F(e.rtf,"s","\\shp{",e.imageMap));const n=e.imageMap[r.substring(7)];if(n){const e=[],r=n.hex.match(/[0-9a-f]{2}/gi);if(r){for(let t=0;r.length>t;t++)e.push(String.fromCharCode(parseInt(r[t],16)));t.attributes.src="data:"+n.type+";base64,"+btoa(e.join(""))}}}}return t},t=>((t.isElement&&"always"===t.style.get("page-break-before")||"page"===t.style.get("break-before"))&&(t.attributes["jd-safe"]=!0,t.style.add("page-break-before","always"),t.isSingle&&(t.name="div")),t),t=>"none"===t.style.get("display")||0===t.length&&"span"===t.name||P.has(t.name)?(t.remove(),null):t,t=>{const{name:e}=t;return e in R&&(t.name=R[e]),t},t=>{if(/^OLE_LINK\d+$/.test(t.attributes.name)&&(t.attributes.name=null,0===t.length))return t.remove(),null;"_GoBack"===t.attributes.name&&(t.attributes.name=null);for(const e of L)t.attributes[e]&&(t.attributes[e]=null);return t},t=>{var e;if(w(t)){t.name="li",t.style.set("text-indent",null);const n=(t=>t.textBetween((t=>t.isComment&&/\[if.*supportLists.*]/.test(h(t))),(t=>t.isComment&&/\[endif]/.test(h(t)))).replace(/ /g,"").replace((0,s.SPACE_REG_EXP)(),""))(t),r=/[\da-np-zA-NP-Z].?/.test(n)?"ol":"ul",i=((t,e)=>{for(const e in E)if(RegExp(e).test(t))return E[e];return"ol"===e?"decimal":"disc"})(n,r);t.attributes[y]=r,t.attributes[v]=i,(t=>{if(void 0!==t.attributes[b])return;const e=[c(t)],n=[t];let r=t.next;for(;r;){if(r.isElement&&!r.attributes[b]&&w(r)){const t=c(r);t&&(e.push(t),n.push(r))}r=r.next}const s=Math.min(...e.filter((t=>t>0)));let i=e.map((t=>Math.ceil(t/10)));-1!==i.indexOf(0)&&(i=i.map((t=>t+1))),n.forEach(((t,e)=>{t.attributes[b]=i[e],t.style.add("margin-left",Math.max(c(t)-10*i[e]/s*40,0)+"px")}))})(t),(t=>{for(;t;){const e=t.previousElement;if(!k(e)&&!j(e))break;if(k(e)){if(e.attributes[b]>t.attributes[b])break;if(t.attributes[b]===e.attributes[b]&&t.parent&&$(t,t.parent))break;e.append(t);continue}const n=e;if(n.attributes[b]>t.attributes[b])break;if(t.attributes[b]===n.attributes[b]&&!$(t,n))break;n.append(t)}})(t);const{parent:a}=t;if(!j(a)||!$(t,a)){const s=((t,e,n,r)=>{const s=t.wrap(e);return s.attributes.start=(t=>/\d.\d/.test(t)?t.split(".").pop()||null:/^\d/.test(t)?""+(parseInt(t,10)||1):null)(n),s.attributes[b]=t.attributes[b],s.attributes[v]=t.attributes[v],s.attributes["data-list-style-type"]=t.attributes[v],s.style.set(x,r),(t=>{var e;!j(t)||"li"===(null===(e=t.parent)||void 0===e?void 0:e.name)||"disc"!==t.style.get(x)&&"decimal"!==t.style.get(x)||t.style.set(x,null)})(s),s})(t,r,n,i);return j(a)&&(s.remove(),null===(e=a.lastElement)||void 0===e||e.append(s)),t}}return t},(t,e)=>{var n;const r=null!==(n=e.links)&&void 0!==n?n:{};if(t.attributes.href&&t.attributes.href.match(/#.+$/)&&(r[t.attributes.href.match(/#(.+)$/)[1]]=t),t.attributes.name&&r[t.attributes.name]){const e=r[t.attributes.name];e.attributes.href=e.attributes.href.replace(/.*#(.*)$/,"#$1")}return e.links=r,t},t=>(t.isComment&&/\[if.*(supportLists|gte vml).*]/.test(h(t))&&(W++,t.remove()),t.isComment&&W>0&&h(t).includes("[endif]")&&(W=W>0?W-1:0,t.remove()),W&&(t.isText||"img"===t.name&&(!t.attributes.src||/^file:/.test(t.attributes.src)))?(t.remove(),null):t),(t,{jodit:e})=>{if(!e.o.pasteFromWord.convertUnitsToPixel)return t;const{style:n}=t;return n.forEach((t=>{const e=n.get(t);e&&n.set(t,(""+e).replace(/\d+(\.\d+)?(pt|cm)/g,(t=>u(t)+"px")))})),t},t=>(t.attributes.class&&(t.attributes.class=t.attributes.class.replace(/(el\d+)|(font\d+)|msonormal|msolistparagraph\w*/gi,""),(0,A.f)(t.attributes.class)||(t.attributes.class=null)),t),t=>t.isElement?("img"===t.name&&(t.attributes.align&&(t.style.add("float",t.attributes.align),t.attributes.align=null),t.attributes.hspace&&(t.style.add("marginLeft",t.attributes.hspace+"px"),t.style.add("marginRight",t.attributes.hspace+"px"),t.attributes.hspace=null)),t):t,t=>(!t.attributes.width||"th"!==t.name&&"td"!==t.name||(t.attributes.width=null),t),t=>(t.isElement&&t.attributes.style&&Object.keys(B).forEach((e=>{const n=B[e];t.style.has(e)&&n.includes(""+t.style.get(e))&&t.style.set(e,null)})),t)];n(733).D.prototype.pasteFromWord={enable:!1,convertUnitsToPixel:!1,allowedStyleProps:["background","background-color","border","border-.*","color","float","font-family","font-size","font-style","font-weight","height","line-height","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","padding","text-align","text-justify","text-decoration","text-indent","vertical-align","width"]};var V=n(62582);class D extends a.L{insertFromWordByType(t,e,n,r){var a;if(!this.j.o.pasteFromWord.enable||n!==s.INSERT_AS_HTML&&n!==s.INSERT_AS_TEXT)return super.insertFromWordByType(t,e,n,r);if(e=((t,e,n,r="")=>{var s,i;const a=document.createElement("iframe");a.style.display="none",document.body.appendChild(a);try{const l=null!==(s=a.contentDocument)&&void 0!==s?s:null===(i=a.contentWindow)||void 0===i?void 0:i.document;if(!l)return e;l.open(),l.write(e),l.close();const o="jd-style";for(let t=0;l.styleSheets.length>t;t+=1)try{const e=l.styleSheets[t].cssRules;for(let t=0;e.length>t;t+=1)e[t].selectorText&&(0,d.$$)(e[t].selectorText,l.body).forEach((n=>{(0,d.attr)(n,o)||((0,d.attr)(n,o,(0,d.attr)(n,"style")||""),(0,d.attr)(n,"style","")),(0,d.attr)(n,"style",`${(0,d.attr)(n,"style")};${e[t].style.cssText}`)}))}catch(t){}return(0,d.$$)(`[${o}]`,l.body).forEach((t=>{(0,d.attr)(t,"style",`${(0,d.attr)(t,"style")};${(0,d.attr)(t,o)}`)})),((t,e,n,r)=>{const s={jodit:t,rtf:r};return e.forEach((function t(e){if(e){for(const t of I)if(null==(e=t(e,s)))break;null==e||e.forEach(t)}})),n&&e.forEach((t=>{t.style.clear()}),!0),(0,A.f)(m(e,(t=>!t.isComment),!0,t.o.pasteFromWord.allowedStyleProps))})(t,N.make(l.body),n,r)}finally{p.i.safeRemove(a)}return e})(this.j,e,n===s.INSERT_AS_TEXT,r.rtf),this.j.o.beautifyHTML){const t=null===(a=this.j.events)||void 0===a?void 0:a.fire("beautifyHTML",e);(0,i.H)(t)&&(e=t)}(0,V.kU)(t,this.j,e)}}r.Jodit.plugins.remove("pasteFromWord"),r.Jodit.plugins.add("pasteFromWordPro",D)},70655(t,e,n){function r(t,e,n,r){var s,i=arguments.length,a=3>i?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(3>i?s(a):i>3?s(e,n,a):s(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a}n.d(e,{gn(){return r}})}},t=>t(t.s=51424)])}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
((t,e)=>{if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var o=e();for(var s in o)("object"==typeof exports?exports:t)[s]=o[s]}})(self,(function(){return(self.webpackChunkjodit_pro=self.webpackChunkjodit_pro||[]).push([[876],{23337(t,e,o){"use strict";o.r(e),o.d(e,{ar(){return s},cs_cz(){return r},de(){return l},es(){return n},fa(){return i},fr(){return a},he(){return c},hu(){return h},id(){return p},it(){return d},ja(){return u},ko(){return k},nl(){return b},pl(){return g},pt_br(){return w},ru(){return f},tr(){return B},zh_cn(){return x},zh_tw(){return m}});const s=o(96551),r=o(26464),l=o(7896),n=o(44660),i=o(12990),a=o(10187),c=o(7834),h=o(46788),p=o(79955),d=o(48343),u=o(8449),k=o(36777),b=o(27705),g=o(7450),w=o(17454),f=o(48013),B=o(47766),x=o(70198),m=o(50756)},54778(t,e,o){"use strict";o.r(e),o.d(e,{showBlocks(){return p}});var s=o(70655),r=o(733);r.D.prototype.showBlocks={enable:!1,color:"#ccc",tagList:["html","body","div","span","applet","object","iframe","h1","h2","h3","h4","h5","h6","p","blockquote","pre","a","abbr","acronym","address","big","cite","code","del","dfn","em","img","ins","kbd","q","s","samp","small","strike","strong","sub","sup","tt","var","b","u","i","center","dl","dt","dd","fieldset","form","label","legend","caption","th","td","li","ol","ul","article","aside","canvas","details","embed","figure","figcaption","footer","header","hgroup","menu","nav","output","ruby","section","summary","time","mark","audio","video"]},r.D.prototype.controls.showBlocks={isActive:t=>!!t.e.fire("showBlocksEnabled"),tooltip:"Show Blocks",command:"toggleShowBlocks"};var l=o(43464),n=o(47611),i=o(33993),a=o(58706),c=o(98422),h=o(62195);class p extends l.S{
|
|
1
|
+
((t,e)=>{if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var o=e();for(var s in o)("object"==typeof exports?exports:t)[s]=o[s]}})(self,(function(){return(self.webpackChunkjodit_pro=self.webpackChunkjodit_pro||[]).push([[876],{23337(t,e,o){"use strict";o.r(e),o.d(e,{ar(){return s},cs_cz(){return r},de(){return l},es(){return n},fa(){return i},fr(){return a},he(){return c},hu(){return h},id(){return p},it(){return d},ja(){return u},ko(){return k},nl(){return b},pl(){return g},pt_br(){return w},ru(){return f},tr(){return B},zh_cn(){return x},zh_tw(){return m}});const s=o(96551),r=o(26464),l=o(7896),n=o(44660),i=o(12990),a=o(10187),c=o(7834),h=o(46788),p=o(79955),d=o(48343),u=o(8449),k=o(36777),b=o(27705),g=o(7450),w=o(17454),f=o(48013),B=o(47766),x=o(70198),m=o(50756)},54778(t,e,o){"use strict";o.r(e),o.d(e,{showBlocks(){return p}});var s=o(70655),r=o(733);r.D.prototype.showBlocks={enable:!1,color:"#ccc",tagList:["html","body","div","span","applet","object","iframe","h1","h2","h3","h4","h5","h6","p","blockquote","pre","a","abbr","acronym","address","big","cite","code","del","dfn","em","img","ins","kbd","q","s","samp","small","strike","strong","sub","sup","tt","var","b","u","i","center","dl","dt","dd","fieldset","form","label","legend","caption","th","td","li","ol","ul","article","aside","canvas","details","embed","figure","figcaption","footer","header","hgroup","menu","nav","output","ruby","section","summary","time","mark","audio","video"]},r.D.prototype.controls.showBlocks={isActive:t=>!!t.e.fire("showBlocksEnabled"),tooltip:"Show Blocks",command:"toggleShowBlocks"};var l=o(43464),n=o(47611),i=o(33993),a=o(58706),c=o(98422),h=o(62195);class p extends l.S{enable(){this.isEnabled=!0;const t=this.j.o.iframe?"body":".jodit-wysiwyg",{tagList:e,color:o}=this.j.o.showBlocks;this.style.innerHTML=e.map((e=>{return`${t} ${e}{\n\t\t\t\t\toutline: 1px dashed ${o};\n\t\t\t\t\tbackground-image: url("${s='<svg xmlns="http://www.w3.org/2000/svg" width="50px"><text dominant-baseline="hanging" text-anchor="end" style="fill: '+o+';font: 10px sans-serif" x="50px" y="0">'+e+"</text></svg>","data:image/svg+xml;utf8,"+escape(s)}");\n\t\t\t\t\tbackground-position: top 2px ${"rtl"===this.j.o.direction?"left":"right"} 4px;\n\t\t\t\t\tbackground-repeat: no-repeat;\n\t\t\t\t\tposition: relative;\n\t\t\t\t}`;var s})).join("")}disable(){this.isEnabled=!1,this.style.innerHTML=""}toggle(){this.isEnabled?this.disable():this.enable(),this.j.e.fire("updateToolbar")}constructor(t){super(t),this.requires=["license"],this.buttons=[{name:"showBlocks",group:"state"}],this.isEnabled=!1,(0,a.xl)(o(23337)),i.JO.set("showBlocks",o(48374))}afterInit(t){this.style=(0,a.ZO)(t,p,"style",!0),t.e.on("showBlocksEnabled",(()=>this.isEnabled)),t.registerCommand("enableShowBlocks",this.enable).registerCommand("disableShowBlocks",this.disable).registerCommand("toggleShowBlocks",this.toggle),this.j.o.showBlocks.enable&&this.enable()}beforeDestruct(t){this.disable(),n.Dom.safeRemove(this.style)}}(0,s.gn)([c.autobind],p.prototype,"enable",null),(0,s.gn)([c.autobind],p.prototype,"disable",null),(0,s.gn)([c.autobind],p.prototype,"toggle",null),h.Jodit.plugins.add("show-blocks",p)},70655(t,e,o){"use strict";function s(t,e,o,s){var r,l=arguments.length,n=3>l?e:null===s?s=Object.getOwnPropertyDescriptor(e,o):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,o,s);else for(var i=t.length-1;i>=0;i--)(r=t[i])&&(n=(3>l?r(n):l>3?r(e,o,n):r(e,o))||n);return l>3&&n&&Object.defineProperty(e,o,n),n}o.d(e,{gn(){return s}})},96551(t){t.exports={"Show Blocks":"تظهر كتل"}},26464(t){t.exports={"Show Blocks":"Ukázat Bloky"}},7896(t){t.exports={"Show Blocks":"Zeigen Blöcke"}},44660(t){t.exports={"Show Blocks":"Mostrar Bloques"}},12990(t){t.exports={"Show Blocks":"نشان می دهد بلوک"}},10187(t){t.exports={"Show Blocks":"Afficher Les Blocs"}},7834(t){t.exports={"Show Blocks":"תראה רחובות"}},46788(t){t.exports={"Show Blocks":"Mutasd Meg Blokkok"}},79955(t){t.exports={"Show Blocks":"Menunjukkan Blok"}},48343(t){t.exports={"Show Blocks":"Visualizza Blocchi"}},8449(t){t.exports={"Show Blocks":"ショーのブロック"}},36777(t){t.exports={"Show Blocks":"쇼 블록"}},27705(t){t.exports={"Show Blocks":"Toon Blokken"}},7450(t){t.exports={"Show Blocks":"Pokaż Bloki"}},17454(t){t.exports={"Show Blocks":"Mostrar Blocos"}},48013(t){t.exports={"Show Blocks":"Показать Блоки"}},47766(t){t.exports={"Show Blocks":"Haritayı Blokları"}},70198(t){t.exports={"Show Blocks":"显示块"}},50756(t){t.exports={"Show Blocks":"แสดงช่วงตึก"}},48374(t){t.exports='<svg viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"> <g> <rect rx="10" height="1620" width="1620" y="79.646973" x="80" stroke-width="100" stroke-dasharray="8% 10%" fill="none"/> <path d="m1333.992706,381.692384l0,52.982419q0,21.04781 -12.98052,44.272981t-29.820114,23.22517q-35.082487,0 -37.889085,0.725787q-18.242893,4.354719 -22.452791,22.499384q-2.104949,7.983652 -2.104949,46.45034l0,836.106125q0,18.144664 -12.629695,31.208822t-30.170938,13.064158l-75.778171,0q-17.541243,0 -30.170938,-13.064158t-12.629695,-31.208822l0,-884.008038l-100.335911,0l0,884.008038q0,18.144664 -12.27887,31.208822t-30.521763,13.064158l-75.778171,0q-18.242893,0 -30.521763,-13.064158t-12.27887,-31.208822l0,-359.990137q-103.14251,-8.709439 -171.904184,-42.821407q-88.407866,-42.095621 -134.716748,-129.915795q-44.905583,-84.917028 -44.905583,-187.978721q0,-120.48057 61.745176,-207.574958q61.745176,-85.642815 146.644794,-115.400064q77.88312,-26.854103 292.587937,-26.854103l336.090221,0q17.541243,0 30.170938,13.064158t12.629695,31.208822z"/> </g> </svg>'}},t=>t(t.s=54778)])}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.jodit-ui-translate-settings{display:flex;height:100%;justify-content:stretch;min-height:300px;padding:var(--jd-padding-default) var(--jd-padding-default) 0}.jodit-ui-translate-settings__arrow{align-items:center;display:flex;flex-direction:column;height:100%;justify-content:center;width:30px}.jodit-ui-translate-settings__arrow a{display:block;width:100%}.jodit-ui-translate-settings__arrow svg{fill:var(--jd-color-background-gray);cursor:pointer;transition:transform .2s linear}.jodit-ui-translate-settings__arrow svg:hover{fill:var(--jd-color-background-active)}.jodit-ui-translate-settings__arrow svg:active{transform:scale(1.15)}.jodit-ui-translate-settings__list{width:calc(50% - 15px)}.jodit-ui-translate-list{display:flex;flex-direction:column;height:100%}.jodit-ui-translate-list__list{border:1px solid var(--jd-color-border);box-sizing:border-box;cursor:pointer;flex:1;flex-wrap:nowrap;font-size:14px;overflow:auto}.jodit-ui-translate-list__item{color:var(--jd-color-gray-dark);display:flex;line-height:16px}.jodit-ui-translate-list__item:hover,.jodit-ui-translate-list__item[data-active=true]{background-color:var(--jd-color-background-active);color:#fff}.jodit-ui-translate-list__item:focus{outline:2px solid var(--jd-color-background-active)}.jodit-ui-translate-list__item[data-hidden=true]{display:none}.jodit-ui-translate-list__item-key{background-color:var(--jd-color-background-light-gray);box-sizing:border-box;flex:0 0 40px;font-size:13px;padding:7px 5px;pointer-events:none;text-align:center}.jodit-ui-translate-list__item:hover .jodit-ui-translate-list__item-key,.jodit-ui-translate-list__item[data-active=true] .jodit-ui-translate-list__item-key{background-color:var(--jd-color-background-active)}.jodit-ui-translate-list__item-title{flex:1 1 auto;padding:7px;pointer-events:none}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.jodit-ui-translate-settings{display:flex;height:100%;justify-content:stretch;min-height:300px;padding:var(--jd-padding-default) var(--jd-padding-default) 0}.jodit-ui-translate-settings__arrow{align-items:center;display:flex;flex-direction:column;height:100%;justify-content:center;width:30px}.jodit-ui-translate-settings__arrow a{display:block;width:100%}.jodit-ui-translate-settings__arrow svg{fill:var(--jd-color-background-gray);cursor:pointer;transition:transform .2s linear}.jodit-ui-translate-settings__arrow svg:hover{fill:var(--jd-color-background-active)}.jodit-ui-translate-settings__arrow svg:active{transform:scale(1.15)}.jodit-ui-translate-settings__list{width:calc(50% - 15px)}.jodit-ui-translate-list{display:flex;flex-direction:column;height:100%}.jodit-ui-translate-list__list{border:1px solid var(--jd-color-border);box-sizing:border-box;cursor:pointer;flex:1;flex-wrap:nowrap;font-size:14px;overflow:auto}.jodit-ui-translate-list__item{color:var(--jd-color-gray-dark);display:flex;line-height:16px}.jodit-ui-translate-list__item:hover,.jodit-ui-translate-list__item[data-active=true]{background-color:var(--jd-color-background-active);color:#fff}.jodit-ui-translate-list__item:focus{outline:2px solid var(--jd-color-background-active)}.jodit-ui-translate-list__item[data-hidden=true]{display:none}.jodit-ui-translate-list__item-key{background-color:var(--jd-color-background-light-gray);box-sizing:border-box;flex:0 0 40px;font-size:13px;padding:7px 5px;pointer-events:none;text-align:center}.jodit-ui-translate-list__item:hover .jodit-ui-translate-list__item-key,.jodit-ui-translate-list__item[data-active=true] .jodit-ui-translate-list__item-key{background-color:var(--jd-color-background-active)}.jodit-ui-translate-list__item-title{flex:1 1 auto;padding:7px;pointer-events:none}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var a=e();for(var n in a)("object"==typeof exports?exports:t)[n]=a[n]}}(self,(function(){return(self.webpackChunkjodit_pro=self.webpackChunkjodit_pro||[]).push([[81],{15877:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=a(733),i=a(74259);n.Config.prototype.translate={hotkeys:{translateSelection:["ctrl+shift+o","cmd+shift+o"],translateOptions:["ctrl+shift+p","cmd+shift+p"]},provider:"google",googleProviderOptions:{url:"https://translation.googleapis.com/language/translate/v2",key:""},defaultSourceLang:"",defaultTargetLang:"de"},n.Config.prototype.controls.translate={translate:{tooltip:"Translate selected text",icon:"translate",command:"translate",exec:function(t){t.execCommand("translate")},list:["Options"],childExec:function(t,e,a){t.execCommand("translate"+a.control.name)},mods:{stroke:!1}}},i.Icon.set("translate",a(43939)).set("translate-swap",a(26305))},85223:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GoogleTranslateProvider=void 0;var n=a(70655),i=a(93772),o=a(73034),s=function(){function t(t){this.jodit=t}return t.prototype.__fetch=function(t,e){var a=this;void 0===e&&(e={});var o=this.jodit.o.translate.googleProviderOptions;return(0,i.assert)(o,"Set googleProviderOptions"),this.jodit.fetch(o.url+"?key="+o.key,{method:"POST",data:n.__assign(n.__assign({},e),{ui:this.jodit.o.language}),contentType:"application/json; charset=utf-8",withCredentials:!1}).then((function(t){return t.json()})).catch((function(t){try{a.jodit.message.error(t.json().message)}catch(t){}}))},t.prototype.translate=function(t,e,a){return this.__fetch("translate",{q:t,source:e,target:a,format:"html"}).then((function(t){return{text:t.data.translations[0].translatedText}}))},t.prototype.supportedLanguages=function(){return Promise.resolve({langs:o.languages})},t}();e.GoogleTranslateProvider=s},73034:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.languages=void 0,e.languages={Afrikaans:"af",Albanian:"sq",Amharic:"am",Arabic:"ar",Armenian:"hy","Assamese*":"as","Aymara*":"ay",Azerbaijani:"az","Bambara*":"bm",Basque:"eu",Belarusian:"be",Bengali:"bn","Bhojpuri*":"bho",Bosnian:"bs",Bulgarian:"bg",Catalan:"ca",Cebuano:"ceb","Chinese (Simplified)":"zh-CN","Chinese (Traditional)":"zh-TW",Corsican:"co",Croatian:"hr",Czech:"cs",Danish:"da","Dhivehi*":"dv","Dogri*":"doi",Dutch:"nl",English:"en",Esperanto:"eo",Estonian:"et","Ewe*":"ee","Filipino (Tagalog)":"fil",Finnish:"fi",French:"fr",Frisian:"fy",Galician:"gl",Georgian:"ka",German:"de",Greek:"el","Guarani*":"gn",Gujarati:"gu","Haitian Creole":"ht",Hausa:"ha",Hawaiian:"haw",Hebrew:"he",Hindi:"hi",Hmong:"hmn",Hungarian:"hu",Icelandic:"is",Igbo:"ig","Ilocano*":"ilo",Indonesian:"id",Irish:"ga",Italian:"it",Japanese:"ja",Kannada:"kn",Kazakh:"kk",Khmer:"km",Kinyarwanda:"rw","Konkani*":"gom",Korean:"ko","Krio*":"kri",Kurdish:"ku","Kurdish (Sorani)*":"ckb",Kyrgyz:"ky",Lao:"lo",Latin:"la",Latvian:"lv","Lingala*":"ln",Lithuanian:"lt","Luganda*":"lg",Luxembourgish:"lb",Macedonian:"mk","Maithili*":"mai",Malagasy:"mg",Malay:"ms",Malayalam:"ml",Maltese:"mt",Maori:"mi",Marathi:"mr","Meiteilon (Manipuri)*":"mni-Mtei",Mizo:"lus",Mongolian:"mn","Myanmar (Burmese)":"my",Nepali:"ne",Norwegian:"no","Nyanja (Chichewa)":"ny","Odia (Oriya)":"or","Oromo*":"om",Pashto:"ps",Persian:"fa",Polish:"pl",Portuguese:"pt",Punjabi:"pa","Quechua*":"qu",Romanian:"ro",Russian:"ru",Samoan:"sm","Sanskrit*":"sa","Scots Gaelic":"gd","Sepedi*":"nso",Serbian:"sr",Sesotho:"st",Shona:"sn",Sindhi:"sd","Sinhala (Sinhalese)":"si",Slovak:"sk",Slovenian:"sl",Somali:"so",Spanish:"es",Sundanese:"su",Swahili:"sw",Swedish:"sv","Tagalog (Filipino)":"tl",Tajik:"tg",Tamil:"ta",Tatar:"tt",Telugu:"te",Thai:"th","Tigrinya*":"ti","Tsonga*":"ts",Turkish:"tr",Turkmen:"tk","Twi (Akan)*":"ak",Ukrainian:"uk",Urdu:"ur",Uyghur:"ug",Uzbek:"uz",Vietnamese:"vi",Welsh:"cy",Xhosa:"xh",Yiddish:"yi",Yoruba:"yo",Zulu:"zu"}},58592:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Translate=void 0;var n=a(70655);a(22338);var i=a(43464),o=a(97029),s=a(52378),r=a(6244),l=a(57348),c=a(16617),u=a(51923),g=a(85223);a(15877);var d=a(59398),h=a(70305),p=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.requires=["license"],e.buttons=[{name:"translate.translate",group:"insert"}],e.state={sourceLang:e.jodit.o.translate.defaultSourceLang||"en",targetLang:e.jodit.o.translate.defaultTargetLang},e}return n.__extends(e,t),e.prototype.__getProvider=function(){var t=this.jodit.options.translate.provider;if((0,l.isString)(t)){if("google"===t)return new g.GoogleTranslateProvider(this.j);throw new Error("Unknown provider")}return(0,s.assert)((0,r.isFunction)(t),"Provider must be a function"),t(this.jodit)},e.prototype.afterInit=function(t){var e=this,a=(0,c.defaultLanguage)(t.o.language,o.Jodit.defaultOptions.language),i=(0,c.defaultLanguage)(t.o.language,a),s=this.__getProvider();t.registerCommand("translateOptions",{exec:function(){return n.__awaiter(e,void 0,void 0,(function(){var e,a,i,o,r=this;return n.__generator(this,(function(n){switch(n.label){case 0:return e=this.state,(a=t.dlg()).setHeader("Translate options"),[4,s.supportedLanguages()];case 1:return i=n.sent(),o=new d.UITranslateSettings(a,this.state,{sourceList:i.langs,targetList:i.langs,onChange:function(t){e=t}}),a.setContent(o),a.setFooter([(0,h.Button)(t,"cancel","Cancel").onAction((function(){return a.close()})),(0,h.Button)(t,"ok","Save","primary").onAction((function(){r.state=e,a.close()}))]),o.bindDestruct(a),a.setSize(500,400).open(!0),[2]}}))}))},hotkeys:t.o.translate.hotkeys.translateOptions}).registerCommand("translate",{exec:function(){var a=t.s.html;if(a)return s.translate(a,e.state.sourceLang&&"auto"!==e.state.sourceLang?e.state.sourceLang:i,e.state.targetLang).then((function(e){t.s.range.deleteContents(),t.s.insertNode(t.createInside.text(e.text))})).catch((function(e){t.message.error((0,l.isString)(e)?e:e.message)}));t.message.error("Select text for translate")},hotkeys:t.o.translate.hotkeys.translateSelection})},e.prototype.beforeDestruct=function(t){},n.__decorate([u.persistent],e.prototype,"state",void 0),e}(i.Plugin);e.Translate=p,o.Jodit.plugins.add("translate",p)},16675:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UITranslateList=void 0;var n=a(70655);a(65023);var i=a(13717),o=a(51923),s=a(12815),r=a(89437),l=a(86431),c=a(16892),u=a(49940),g=function(t){function e(e,a){var n=t.call(this,e,a)||this;n.options=a,n.state={active:""},n.state.active=a.active;var i=new l.UIInput(e,{placeholder:e.i18n("Filter"),icon:"search",onChange:n.__onChangeFilter,clearButton:!0});return n.getElm("input").appendChild(i.container),n.__onActiveChange(),n}return n.__extends(e,t),e.prototype.className=function(){return"UITranslateList"},Object.defineProperty(e.prototype,"items",{get:function(){return this.getElms("item")},enumerable:!1,configurable:!0}),e.prototype.render=function(t){var e=this,a=[];return Object.keys(t.list).sort().forEach((function(n){var i=t.list[n];a.push("<a role='button' tabindex='0' class='&__item' data-lang='".concat(i,"'>\n\t\t\t\t\t\t<span class='&__item-key'>").concat(i,"</span>\n\t\t\t\t\t\t<span class='&__item-title'>").concat(e.j.i18n(n),"</span>\n\t\t\t\t\t</a>"))})),"<div class='&'>\n\t\t\t<div class='&__input'></div>\n\t\t\t<div class='&__list'>".concat(a.join(""),"</div>\n\t\t</div>")},e.prototype.__onChangeFilter=function(t){this.items.forEach((function(e){var a,n,i=null!==(n=null===(a=e.textContent)||void 0===a?void 0:a.toLowerCase())&&void 0!==n?n:"";(0,r.attr)(e,"data-hidden","true"!==(0,r.attr)(e,"data-active")&&!i.includes(t.toLowerCase()))}))},e.prototype.__scrollToActive=function(){var t=this.container.querySelector('[data-active="true"]');t&&(0,c.scrollIntoViewIfNeeded)(t,this.getElm("list"),this.j.od)},e.prototype.onClickItem=function(t){if("keydown"!==t.type||!("key"in t)||t.key===u.KEY_ENTER){var e=t.target;if(s.Dom.isHTMLElement(e)&&e.getAttribute("data-lang")){var a=(0,r.attr)(e,"data-lang");this.options.onChange(a),this.state.active=a}}},e.prototype.__onActiveChange=function(){var t=this;this.items.forEach((function(e){return(0,r.attr)(e,"data-active",(0,r.attr)(e,"data-lang")===t.state.active)})),this.__scrollToActive()},n.__decorate([(0,o.debounce)()],e.prototype,"__onChangeFilter",null),n.__decorate([(0,o.watch)(":afterOpen")],e.prototype,"__scrollToActive",null),n.__decorate([(0,o.watch)(["container:click","container:keydown"])],e.prototype,"onClickItem",null),n.__decorate([(0,o.watch)("state.active"),(0,o.debounce)()],e.prototype,"__onActiveChange",null),n.__decorate([o.component],e)}(i.UIElement);e.UITranslateList=g},59398:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UITranslateSettings=void 0;var n=a(70655);a(89803);var i=a(98440),o=a(51923),s=a(16675),r=function(t){function e(e,a,i){var o=t.call(this,e)||this;return o.state=a,o.options=i,o.__sourceList=new s.UITranslateList(e,{list:i.sourceList,active:a.sourceLang,onChange:function(t){o.state.sourceLang=t,o.options.onChange(n.__assign({},o.state))}}),o.getElm("source-list").appendChild(o.__sourceList.container),o.__targetList=new s.UITranslateList(e,{list:i.targetList,active:a.targetLang,onChange:function(t){o.state.targetLang=t,o.options.onChange(n.__assign({},o.state))}}),o.getElm("target-list").appendChild(o.__targetList.container),o}return n.__extends(e,t),e.prototype.className=function(){return"UITranslateSettings"},e.prototype.render=function(){return"<div>\n\t\t\t<div class='&__list &__source-list'></div>\n\t\t\t<div class='&__arrow'>\n\t\t\t\t<a class='&__arrow-swap'>*translate-swap*</a>\n\t\t\t</div>\n\t\t\t<div class='&__list &__target-list'></div>\n\t\t</div>"},e.prototype.__onSwap=function(){var t=this.state.sourceLang;this.state.sourceLang=this.state.targetLang,this.state.targetLang=t,this.__sourceList.state.active=this.state.sourceLang,this.__targetList.state.active=this.state.targetLang,this.options.onChange(n.__assign({},this.state))},n.__decorate([(0,o.watch)("arrow-swap:click")],e.prototype,"__onSwap",null),n.__decorate([o.component],e)}(i.UIElement);e.UITranslateSettings=r},26305:function(t){t.exports='<svg viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M13.98 22L6 30l7.98 8v-6H28v-4H13.98v-6zM42 18l-7.98-8v6H20v4h14.02v6L42 18z"/> <path d="M0 0h48v48H0z" fill="none"/> </svg>'},43939:function(t){t.exports='<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"> <path d="M4.545 6.714 4.11 8H3l1.862-5h1.284L8 8H6.833l-.435-1.286H4.545zm1.634-.736L5.5 3.956h-.049l-.679 2.022H6.18z"/> <path d="M0 2a2 2 0 0 1 2-2h7a2 2 0 0 1 2 2v3h3a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-3H2a2 2 0 0 1-2-2V2zm2-1a1 1 0 0 0-1 1v7a1 1 0 0 0 1 1h7a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H2zm7.138 9.995c.193.301.402.583.63.846-.748.575-1.673 1.001-2.768 1.292.178.217.451.635.555.867 1.125-.359 2.08-.844 2.886-1.494.777.665 1.739 1.165 2.93 1.472.133-.254.414-.673.629-.89-1.125-.253-2.057-.694-2.82-1.284.681-.747 1.222-1.651 1.621-2.757H14V8h-3v1.047h.765c-.318.844-.74 1.546-1.272 2.13a6.066 6.066 0 0 1-.415-.492 1.988 1.988 0 0 1-.94.31z"/> </svg>'},22338:function(t,e,a){"use strict";a.r(e)},65023:function(t,e,a){"use strict";a.r(e)},89803:function(t,e,a){"use strict";a.r(e)}},function(t){return t(t.s=58592)}])}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
((t,e)=>{if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var a=e();for(var s in a)("object"==typeof exports?exports:t)[s]=a[s]}})(self,(function(){return(self.webpackChunkjodit_pro=self.webpackChunkjodit_pro||[]).push([[81],{90676(t,e,a){"use strict";a.r(e),a.d(e,{Translate(){return S}});var s=a(70655),n=a(43464),i=a(62195),o=a(52378),r=a(6244),l=a(57348),c=a(16617),h=a(98422),g=a(93772);const u={Afrikaans:"af",Albanian:"sq",Amharic:"am",Arabic:"ar",Armenian:"hy","Assamese*":"as","Aymara*":"ay",Azerbaijani:"az","Bambara*":"bm",Basque:"eu",Belarusian:"be",Bengali:"bn","Bhojpuri*":"bho",Bosnian:"bs",Bulgarian:"bg",Catalan:"ca",Cebuano:"ceb","Chinese (Simplified)":"zh-CN","Chinese (Traditional)":"zh-TW",Corsican:"co",Croatian:"hr",Czech:"cs",Danish:"da","Dhivehi*":"dv","Dogri*":"doi",Dutch:"nl",English:"en",Esperanto:"eo",Estonian:"et","Ewe*":"ee","Filipino (Tagalog)":"fil",Finnish:"fi",French:"fr",Frisian:"fy",Galician:"gl",Georgian:"ka",German:"de",Greek:"el","Guarani*":"gn",Gujarati:"gu","Haitian Creole":"ht",Hausa:"ha",Hawaiian:"haw",Hebrew:"he",Hindi:"hi",Hmong:"hmn",Hungarian:"hu",Icelandic:"is",Igbo:"ig","Ilocano*":"ilo",Indonesian:"id",Irish:"ga",Italian:"it",Japanese:"ja",Kannada:"kn",Kazakh:"kk",Khmer:"km",Kinyarwanda:"rw","Konkani*":"gom",Korean:"ko","Krio*":"kri",Kurdish:"ku","Kurdish (Sorani)*":"ckb",Kyrgyz:"ky",Lao:"lo",Latin:"la",Latvian:"lv","Lingala*":"ln",Lithuanian:"lt","Luganda*":"lg",Luxembourgish:"lb",Macedonian:"mk","Maithili*":"mai",Malagasy:"mg",Malay:"ms",Malayalam:"ml",Maltese:"mt",Maori:"mi",Marathi:"mr","Meiteilon (Manipuri)*":"mni-Mtei",Mizo:"lus",Mongolian:"mn","Myanmar (Burmese)":"my",Nepali:"ne",Norwegian:"no","Nyanja (Chichewa)":"ny","Odia (Oriya)":"or","Oromo*":"om",Pashto:"ps",Persian:"fa",Polish:"pl",Portuguese:"pt",Punjabi:"pa","Quechua*":"qu",Romanian:"ro",Russian:"ru",Samoan:"sm","Sanskrit*":"sa","Scots Gaelic":"gd","Sepedi*":"nso",Serbian:"sr",Sesotho:"st",Shona:"sn",Sindhi:"sd","Sinhala (Sinhalese)":"si",Slovak:"sk",Slovenian:"sl",Somali:"so",Spanish:"es",Sundanese:"su",Swahili:"sw",Swedish:"sv","Tagalog (Filipino)":"tl",Tajik:"tg",Tamil:"ta",Tatar:"tt",Telugu:"te",Thai:"th","Tigrinya*":"ti","Tsonga*":"ts",Turkish:"tr",Turkmen:"tk","Twi (Akan)*":"ak",Ukrainian:"uk",Urdu:"ur",Uyghur:"ug",Uzbek:"uz",Vietnamese:"vi",Welsh:"cy",Xhosa:"xh",Yiddish:"yi",Yoruba:"yo",Zulu:"zu"};class d{constructor(t){this.jodit=t}__fetch(t,e={}){const a=this.jodit.o.translate.googleProviderOptions;return(0,g.assert)(a,"Set googleProviderOptions"),this.jodit.fetch(a.url+"?key="+a.key,{method:"POST",data:{...e,ui:this.jodit.o.language},contentType:"application/json; charset=utf-8",withCredentials:!1}).then((t=>t.json())).catch((t=>{try{this.jodit.message.error(t.json().message)}catch(t){}}))}translate(t,e,a){return this.__fetch("translate",{q:t,source:e,target:a,format:"html"}).then((t=>({text:t.data.translations[0].translatedText})))}supportedLanguages(){return Promise.resolve({langs:u})}}var p=a(733),m=a(74259);p.D.prototype.translate={hotkeys:{translateSelection:["ctrl+shift+o","cmd+shift+o"],translateOptions:["ctrl+shift+p","cmd+shift+p"]},provider:"google",googleProviderOptions:{url:"https://translation.googleapis.com/language/translate/v2",key:""},defaultSourceLang:"",defaultTargetLang:"de"},p.D.prototype.controls.translate={translate:{tooltip:"Translate selected text",icon:"translate",command:"translate",exec(t){t.execCommand("translate")},list:["Options"],childExec(t,e,{control:a}){t.execCommand("translate"+a.name)},mods:{stroke:!1}}},m.J.set("translate",a(43939)).set("translate-swap",a(26305));var v=a(33993),_=a(13717),f=a(12815),y=a(89437),k=a(86431),w=a(16892),L=a(49940);let C=class t extends _.u{className(){return"UITranslateList"}get items(){return this.getElms("item")}render(t){const e=[];return Object.keys(t.list).sort().forEach((a=>{const s=t.list[a];e.push(`<a role='button' tabindex='0' class='&__item' data-lang='${s}'>\n\t\t\t\t\t\t<span class='&__item-key'>${s}</span>\n\t\t\t\t\t\t<span class='&__item-title'>${this.j.i18n(a)}</span>\n\t\t\t\t\t</a>`)})),`<div class='&'>\n\t\t\t<div class='&__input'></div>\n\t\t\t<div class='&__list'>${e.join("")}</div>\n\t\t</div>`}constructor(t,e){super(t,e),this.options=e,this.state={active:""},this.state.active=e.active;const a=new k.u(t,{placeholder:t.i18n("Filter"),icon:"search",onChange:this.__onChangeFilter,clearButton:!0});this.getElm("input").appendChild(a.container),this.__onActiveChange()}__onChangeFilter(t){this.items.forEach((e=>{var a,s;const n=null!==(s=null===(a=e.textContent)||void 0===a?void 0:a.toLowerCase())&&void 0!==s?s:"";(0,y.Lj)(e,"data-hidden","true"!==(0,y.Lj)(e,"data-active")&&!n.includes(t.toLowerCase()))}))}__scrollToActive(){const t=this.container.querySelector('[data-active="true"]');t&&(0,w.scrollIntoViewIfNeeded)(t,this.getElm("list"),this.j.od)}onClickItem(t){if("keydown"===t.type&&"key"in t&&t.key!==L.KEY_ENTER)return;const e=t.target;if(f.i.isHTMLElement(e)&&e.getAttribute("data-lang")){const t=(0,y.Lj)(e,"data-lang");this.options.onChange(t),this.state.active=t}}__onActiveChange(){this.items.forEach((t=>(0,y.Lj)(t,"data-active",(0,y.Lj)(t,"data-lang")===this.state.active))),this.__scrollToActive()}};(0,s.gn)([(0,h.debounce)()],C.prototype,"__onChangeFilter",null),(0,s.gn)([(0,h.watch)(":afterOpen")],C.prototype,"__scrollToActive",null),(0,s.gn)([(0,h.watch)(["container:click","container:keydown"])],C.prototype,"onClickItem",null),(0,s.gn)([(0,h.watch)("state.active"),(0,h.debounce)()],C.prototype,"__onActiveChange",null),C=(0,s.gn)([h.component],C);let b=class t extends v.u1{className(){return"UITranslateSettings"}render(){return"<div>\n\t\t\t<div class='&__list &__source-list'></div>\n\t\t\t<div class='&__arrow'>\n\t\t\t\t<a class='&__arrow-swap'>*translate-swap*</a>\n\t\t\t</div>\n\t\t\t<div class='&__list &__target-list'></div>\n\t\t</div>"}constructor(t,e,a){super(t),this.state=e,this.options=a,this.__sourceList=new C(t,{list:a.sourceList,active:e.sourceLang,onChange:t=>{this.state.sourceLang=t,this.options.onChange({...this.state})}}),this.getElm("source-list").appendChild(this.__sourceList.container),this.__targetList=new C(t,{list:a.targetList,active:e.targetLang,onChange:t=>{this.state.targetLang=t,this.options.onChange({...this.state})}}),this.getElm("target-list").appendChild(this.__targetList.container)}__onSwap(){const t=this.state.sourceLang;this.state.sourceLang=this.state.targetLang,this.state.targetLang=t,this.__sourceList.state.active=this.state.sourceLang,this.__targetList.state.active=this.state.targetLang,this.options.onChange({...this.state})}};(0,s.gn)([(0,h.watch)("arrow-swap:click")],b.prototype,"__onSwap",null),b=(0,s.gn)([h.component],b);var j=a(70305);class S extends n.S{constructor(){super(...arguments),this.requires=["license"],this.buttons=[{name:"translate.translate",group:"insert"}],this.state={sourceLang:this.jodit.o.translate.defaultSourceLang||"en",targetLang:this.jodit.o.translate.defaultTargetLang}}__getProvider(){const{provider:t}=this.jodit.options.translate;if((0,l.H)(t)){if("google"===t)return new d(this.j);throw Error("Unknown provider")}return(0,o.assert)((0,r.m)(t),"Provider must be a function"),t(this.jodit)}afterInit(t){const e=(0,c.X)(t.o.language,i.Jodit.defaultOptions.language),a=(0,c.X)(t.o.language,e),s=this.__getProvider();t.registerCommand("translateOptions",{exec:async()=>{let e=this.state;const a=t.dlg();a.setHeader("Translate options");const n=await s.supportedLanguages(),i=new b(a,this.state,{sourceList:n.langs,targetList:n.langs,onChange(t){e=t}});a.setContent(i),a.setFooter([(0,j.zx)(t,"cancel","Cancel").onAction((()=>a.close())),(0,j.zx)(t,"ok","Save","primary").onAction((()=>{this.state=e,a.close()}))]),i.bindDestruct(a),a.setSize(500,400).open(!0)},hotkeys:t.o.translate.hotkeys.translateOptions}).registerCommand("translate",{exec:()=>{const e=t.s.html;if(e)return s.translate(e,this.state.sourceLang&&"auto"!==this.state.sourceLang?this.state.sourceLang:a,this.state.targetLang).then((e=>{t.s.range.deleteContents(),t.s.insertNode(t.createInside.text(e.text))})).catch((e=>{t.message.error((0,l.H)(e)?e:e.message)}));t.message.error("Select text for translate")},hotkeys:t.o.translate.hotkeys.translateSelection})}beforeDestruct(t){}}(0,s.gn)([h.persistent],S.prototype,"state",void 0),i.Jodit.plugins.add("translate",S)},70655(t,e,a){"use strict";function s(t,e,a,s){var n,i=arguments.length,o=3>i?e:null===s?s=Object.getOwnPropertyDescriptor(e,a):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,a,s);else for(var r=t.length-1;r>=0;r--)(n=t[r])&&(o=(3>i?n(o):i>3?n(e,a,o):n(e,a))||o);return i>3&&o&&Object.defineProperty(e,a,o),o}a.d(e,{gn(){return s}})},26305(t){t.exports='<svg viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M13.98 22L6 30l7.98 8v-6H28v-4H13.98v-6zM42 18l-7.98-8v6H20v4h14.02v6L42 18z"/> <path d="M0 0h48v48H0z" fill="none"/> </svg>'},43939(t){t.exports='<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"> <path d="M4.545 6.714 4.11 8H3l1.862-5h1.284L8 8H6.833l-.435-1.286H4.545zm1.634-.736L5.5 3.956h-.049l-.679 2.022H6.18z"/> <path d="M0 2a2 2 0 0 1 2-2h7a2 2 0 0 1 2 2v3h3a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-3H2a2 2 0 0 1-2-2V2zm2-1a1 1 0 0 0-1 1v7a1 1 0 0 0 1 1h7a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H2zm7.138 9.995c.193.301.402.583.63.846-.748.575-1.673 1.001-2.768 1.292.178.217.451.635.555.867 1.125-.359 2.08-.844 2.886-1.494.777.665 1.739 1.165 2.93 1.472.133-.254.414-.673.629-.89-1.125-.253-2.057-.694-2.82-1.284.681-.747 1.222-1.651 1.621-2.757H14V8h-3v1.047h.765c-.318.844-.74 1.546-1.272 2.13a6.066 6.066 0 0 1-.415-.492 1.988 1.988 0 0 1-.94.31z"/> </svg>'}},t=>t(t.s=90676)])}));
|
package/index.html
CHANGED
|
@@ -71,6 +71,7 @@
|
|
|
71
71
|
<script src="./build/plugins/export-docs/export-docs.js"></script>
|
|
72
72
|
<script src="./build/plugins/paste-from-word/paste-from-word.js"></script>
|
|
73
73
|
<script src="./build/plugins/mobile-view/mobile-view.js"></script>
|
|
74
|
+
<script src="./build/plugins/translate/translate.js"></script>
|
|
74
75
|
<script src="./config.js"></script>
|
|
75
76
|
<script>
|
|
76
77
|
const editor = new Jodit('#editor', {
|
|
@@ -103,7 +104,7 @@
|
|
|
103
104
|
// removeButtons: ['changeCase', 'classSpan', 'lineHeight'],
|
|
104
105
|
width: 762,
|
|
105
106
|
minHeight: '21px',
|
|
106
|
-
iframe: true,
|
|
107
|
+
// iframe: true,
|
|
107
108
|
// iframeStyle: '',
|
|
108
109
|
showPlaceholder: false,
|
|
109
110
|
// iframeCSSLinks: [
|