jodit-pro 1.2.58 → 1.3.1
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/jodit.css +1 -1
- package/build/jodit.es5.css +2 -2
- 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/change-case/change-case.js +1 -1
- package/build/plugins/color-picker/color-picker.js +1 -1
- package/build/plugins/emoji/emoji.js +1 -1
- package/build/plugins/export-docs/export-docs.js +1 -1
- package/build/plugins/finder/finder.js +1 -1
- package/build/plugins/google-maps/google-maps.js +1 -1
- package/build/plugins/google-search/google-search.js +1 -1
- package/build/plugins/highlight-signature/highlight-signature.js +1 -1
- package/build/plugins/iframe-editor/iframe-editor.js +1 -1
- package/build/plugins/keyboard/keyboard.js +1 -1
- package/build/plugins/page-break/page-break.js +1 -1
- package/build/plugins/paste-code/paste-code.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/tune-block/tune-block.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
((e,t)=>{if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var a=t();for(var s in a)("object"==typeof exports?exports:e)[s]=a[s]}})(self,(function(){return(self.webpackChunkjodit_pro=self.webpackChunkjodit_pro||[]).push([[535],{
|
|
1
|
+
((e,t)=>{if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var a=t();for(var s in a)("object"==typeof exports?exports:e)[s]=a[s]}})(self,(function(){return(self.webpackChunkjodit_pro=self.webpackChunkjodit_pro||[]).push([[535],{244(e,t,a){"use strict";a.r(t),a.d(t,{pasteCode:()=>p});var s=a(205),o=a(2),i=a(11);o.D.prototype.controls.pasteCode={icon:a(245),tooltip:"Paste code",command:"pasteCode"},o.D.prototype.pasteCode={globalHighlightLib:!1,canonicalLanguageCode(e){switch(e){case"ts":return"typescript";case"js":return"javascript";case"markup":return"html"}return e},highlightLib:{highlight(e,t){return Prism.highlight(e,Prism.languages[t]||Prism.languages.plain,t)},isLangLoaded(e){return!!Prism.languages[e]},js:["https://cdnjs.cloudflare.com/ajax/libs/prism/1.25.0/prism.min.js"],langUrl:e=>`https://cdnjs.cloudflare.com/ajax/libs/prism/1.25.0/components/prism-${e}.min.js`,css:["https://cdnjs.cloudflare.com/ajax/libs/prism/1.25.0/themes/prism.min.css"]},defaultLanguage:"html",insertTemplate:(e,t,a)=>`<pre class="language-${t}">${(0,i.htmlspecialchars)(a)}</pre>`,languages:[{value:"html",text:"HTML/XML"},{value:"plaintext",text:"Plain"},{value:"bash",text:"Bash"},{value:"javascript",text:"JavaScript"},{value:"css",text:"CSS"},{value:"php",text:"PHP"},{value:"ruby",text:"Ruby"},{value:"python",text:"Python"},{value:"java",text:"Java"},{value:"c",text:"C"},{value:"csharp",text:"C#"},{value:"cpp",text:"C++"}],dialog:{width:700,height:600}};var l=a(77),r=a(48),n=a(21),c=a(1),d=a(4);let p=class extends l.S{constructor(){super(...arguments),this.requires=["license"],this.buttons=[{name:"pasteCode",group:"clipboard"}],this.prismJSIsLoaded=!1}afterInit(e){e.registerCommand("pasteCode",(()=>this.openCodeEditDialog()))}openCodeEditDialog(e,t,a){const s=this.j,o=this.createForm(),{code:l,language:r}=(0,i.refs)(o);e&&(r.value=e),t&&(l.value=t),s.async.requestIdleCallback((()=>{l.focus()})),s.s.save(),this.createDialog((()=>{if(!o.validate())return!1;{s.s.restore();const e=s.createInside.fromHTML(s.o.pasteCode.insertTemplate(s,r.value,l.value));if(a)d.Dom.replace(a,e,s.createInside,!1,!0);else{const t=s.s.current(),a=d.Dom.up(t,d.Dom.isBlock,s.editor);a?d.Dom.after(a,e):s.s.insertNode(e)}this.onChange()}}),(()=>{s.s.restore()})).setContent(o.container).open(!0)}beforeDestruct(e){}createForm(){const{jodit:e}=this;return new r.x4(e,[new r.Cj(e,{name:"language",label:"Language",value:e.o.pasteCode.defaultLanguage,options:e.o.pasteCode.languages,required:!0}),new r.GJ(e,{label:"Code view",resizable:!1,name:"code",required:!0,className:"jodit-paste-code__textarea"})],{className:"jodit-paste-code"})}createDialog(e,t){const a=new d.Dialog({language:this.j.o.language});return a.setHeader("Insert/Edit Code Sample").setSize(this.j.o.pasteCode.dialog.width,this.j.o.pasteCode.dialog.height).setFooter([(0,r.zx)(a,"","Cancel","default").onAction((()=>{a.close(),t()})),(0,r.zx)(a,"save","Save","primary").onAction((()=>{a.close(),e()}))]),a}onChange(){(0,i.$$)("pre",this.j.editor).forEach((e=>{(0,i.attr)(e,"contenteditable")||((0,i.attr)(e,"contenteditable",!1),this.highlightCode(e))}))}async highlightCode(e){const{globalHighlightLib:t,highlightLib:{css:a,js:s,langUrl:o,highlight:l,isLangLoaded:r}}=this.j.o.pasteCode;this.prismJSIsLoaded||t||(await Promise.all([(0,i.loadNextStyle)(this.jodit,a),(0,i.loadNext)(this.jodit,s)]),this.prismJSIsLoaded=!0);const n=this.parseLanguage(e);r(n)||t||await(0,i.appendScriptAsync)(this.jodit,o(n)).catch((()=>null));let c=e;e.firstElementChild===e.lastElementChild&&d.Dom.isTag(e.firstElementChild,"code")&&(c=e.firstElementChild),c.innerHTML=l(c.innerText,n)}onPreEdit(e){const t=d.Dom.isNode(e)&&d.Dom.isTag(e,"pre")?e:d.Dom.closest(e.target,"pre",this.j.editor);if(t){const e=this.parseLanguage(t);this.openCodeEditDialog(e,t.innerText,t)}}parseLanguage(e){let t=null;const a=e=>e.classList.forEach((e=>{if(/language-/.test(e)){const a=/language-(.*)/.exec(e);a&&a[1]&&(t=a[1])}}));return a(e),null==t&&e.firstElementChild===e.lastElementChild&&d.Dom.isTag(e.firstElementChild,"code")&&a(e.firstElementChild),this.jodit.o.pasteCode.canonicalLanguageCode(t||"html")}onAfterGetValueFromEditor(e){e.value=e.value.replace(/(<pre[^>]*)contenteditable\s*=\s*(['"]?)false\2([^>]*>\s*<code[^>]*>)(.*?)(<\/code>\s*<\/pre>)/gis,((e,t,a,s,o,l)=>`${t}${s}${(0,i.htmlspecialchars)((0,i.stripTags)(o))}${l}`)).replace(/(<pre[^>]*)contenteditable\s*=\s*(['"]?)false\2([^>]*>)(.*?)(<\/pre>)/gis,((e,t,a,s,o,l)=>`${t}${s}${(0,i.htmlspecialchars)((0,i.stripTags)(o))}${l}`))}};(0,s.gn)([n.autobind],p.prototype,"openCodeEditDialog",null),(0,s.gn)([(0,n.watch)("?:change"),(0,n.debounce)()],p.prototype,"onChange",null),(0,s.gn)([(0,n.watch)(["?:dblclick","?:editPreInPasteCode"])],p.prototype,"onPreEdit",null),(0,s.gn)([(0,n.watch)("?:afterGetValueFromEditor")],p.prototype,"onAfterGetValueFromEditor",null),p=(0,s.gn)([n.component],p),c.Jodit.plugins.add("paste-code",p)},205(e,t,a){"use strict";function s(e,t,a,s){var o,i=arguments.length,l=3>i?t:null===s?s=Object.getOwnPropertyDescriptor(t,a):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,a,s);else for(var r=e.length-1;r>=0;r--)(o=e[r])&&(l=(3>i?o(l):i>3?o(t,a,l):o(t,a))||l);return i>3&&l&&Object.defineProperty(t,a,l),l}a.d(t,{gn:()=>s})},245(e){e.exports='<svg viewBox="0 0 24 24" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"> <path d="M2.5244141,23.5h18.9511719c0.4140625,0,0.75-0.3359375,0.75-0.75V4.9208984 c0-0.1992188-0.0795898-0.390625-0.2207031-0.53125L18.3198242,0.71875C18.1791992,0.5786133,17.9887695,0.5,17.7905273,0.5 H2.5244141c-0.4140625,0-0.75,0.3359375-0.75,0.75v21.5C1.7744141,23.1640625,2.1103516,23.5,2.5244141,23.5z M20.7128296,5.2197266 h-2.6986694V2.531189L20.7128296,5.2197266z M3.2744141,2h13.2397461v3.9697266c0,0.4140625,0.3359375,0.75,0.75,0.75h3.4614258V22 H3.2744141V2z" fill="#1D1D1D"/> <path d="M8.75,10.25h1.75c0.4140625,0,0.75-0.3359375,0.75-0.75s-0.3359375-0.75-0.75-0.75H8 c-0.4140625,0-0.75,0.3359375-0.75,0.75v2.75H6c-0.4140625,0-0.75,0.3359375-0.75,0.75S5.5859375,13.75,6,13.75h1.25v2.75 c0,0.4140625,0.3359375,0.75,0.75,0.75h2.5c0.4140625,0,0.75-0.3359375,0.75-0.75s-0.3359375-0.75-0.75-0.75H8.75V10.25z" fill="#1D1D1D"/> <path d="M18.5,12.25h-1.25V9.5c0-0.4140625-0.3359375-0.75-0.75-0.75H14c-0.4140625,0-0.75,0.3359375-0.75,0.75 s0.3359375,0.75,0.75,0.75h1.75v5.5H14c-0.4140625,0-0.75,0.3359375-0.75,0.75s0.3359375,0.75,0.75,0.75h2.5 c0.4140625,0,0.75-0.3359375,0.75-0.75v-2.75h1.25c0.4140625,0,0.75-0.3359375,0.75-0.75S18.9140625,12.25,18.5,12.25z" fill="#1D1D1D"/></svg>'}},e=>e(e.s=244)])}));
|
|
@@ -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 s=e();for(var n in s)("object"==typeof exports?exports:t)[n]=s[n]}})(self,(function(){return(self.webpackChunkjodit_pro=self.webpackChunkjodit_pro||[]).push([[92],{273(t,e,s){s.r(e),s.d(e,{PasteFromWordPro:()=>F});var n=s(1),r=s(103),i=s(3),a=s(7),l=s(102);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 s=o.clientWidth;return e?-s:s}function c(t){const{style:e}=t;let s=[0,0,0,0];const n=e.keys.filter((t=>/margin/.test(t))),r=Math.max(n.indexOf("margin-left"),n.indexOf("margin")),i=r>0?n[r]:"margin-left";let a;return"margin"===i?(s=(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]))}})(e.get("margin")),a=s[3]||0):a=e.get(i)||0,u(a)}var p=s(11),d=s(18);function h(t,e=(()=>!0),s=!0){switch(!0){case t.isComment:case t.isText:{if(!e(t))return"";const{nodeValue:s}=t.attributes;return t.isComment?`\x3c!--${s}--\x3e`:s}case t.isElement:{const{attributes:n}=t,r=m(t,e,s);if(!t.attributes["jd-safe"]&&s&&0===r.replace(/[\n\t]/g,"").length&&!t.isSingle)return"";const i=Object.keys(n).map((t=>"style"===t||null==n[t]||/^jd-/.test(t)?"":`${t}="${f(n[t])}"`)).filter(Boolean),{str:a}=t.style;if(a&&i.push(`style="${f(a)}"`),s&&0===i.length&&["span","a"].includes(t.name))return r;const l=i.length?" "+i.join(" "):"";return e(t)?t.isSingle?`<${t.name}${l}/>`:`<${t.name}${l}>${r}</${t.name}>`:r}}return""}function m(t,e=(()=>!0),s=!0){let n=t.map((t=>h(t,e,s))).join("");return"p"===t.name&&0===(0,p.trim)(n).length&&(n=" "),n}function f(t){return(""+t).replace(/"/g,""")}const b="jd-list-level",g="jd-list-type",y="jd-list-style-type",v="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 x(t){return!(!t||"ol"!==t.name&&"ul"!==t.name)}function j(t){return!(!t||"li"!==t.name)}function T(t){return/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 k(t,e){return!(e.name!==t.attributes[g]||e.attributes[y]!==t.attributes[y]||t.attributes[b]!==e.attributes[b])}class ${constructor(t){this._data=w(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}add(t,e){return this._data=w(this.str+";"+`${t}:${e}`),this}get str(){const t=Object.keys(this._data).filter((t=>t&&!/^mso-/.test(t)&&null!=this.get(t)));return t.length?t.map((t=>`${(0,p.kebabCase)(t)}:${this.get(t)}`)).join(";"):""}}function w(t){return(t=>{const e={},s=[];for(let n=t.length-1;n>=0;n-=1){const r=t[n][0];e[r]||(e[r]=!0,s.unshift(t[n]))}return s})((null!=t?t:"").replace(/"/g,'"').split(";").filter(Boolean).map((t=>(0,p.trim)(t).split(":").map(p.trim)))).reduce(((t,[e,s])=>(e&&s&&(t[e]=s),t)),{})}const _=new Set(i.INSEPARABLE_TAGS);class O{constructor(t,e){this.parent=e,this.name=t.nodeName.toLowerCase(),this.type=t.nodeType,this.attributes=(t=>{const e={};if(d.i.isElement(t))for(let s=0,n=t.attributes;n.length>s;s+=1)e[n[s].name]=n[s].value;else e.nodeValue=t.nodeValue;return e})(t),this.style=new $(this.attributes.style),this.children=[],t.childNodes.forEach((t=>this.children.push(O.make(t,this))))}get isText(){return this.type===Node.TEXT_NODE}get html(){return h(this)}get isElement(){return this.type===Node.ELEMENT_NODE}get isComment(){return this.type===Node.COMMENT_NODE}get isSingle(){return _.has(this.name)}get length(){return this.children.length}static make(t,e=null){return new O(t,e)}wrap(t){var e;(0,p.assert)(null!=this.parent,"You can't wrap the root element");const s=O.make(document.createElement(t),this.parent),n=null!==(e=this.parent.children.indexOf(this))&&void 0!==e?e:-1;return-1===n?this.parent.append(s):this.parent.children[n]=s,s.append(this),s}append(t){return(0,p.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 s=e-1;s>=0;s-=1)if(t[s].isElement)return t[s];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,s;return null!==(s=null!==(t=this.sibling(!1))&&void 0!==t?t:null===(e=this.parent)||void 0===e?void 0:e.previous)&&void 0!==s?s:null}get next(){var t,e,s;return null!==(s=null!==(t=this.sibling(!0))&&void 0!==t?t:null===(e=this.parent)||void 0===e?void 0:e.next)&&void 0!==s?s:null}sibling(t){if(!this.parent)return null;const{children:e}=this.parent,s=e.indexOf(this);return-1!==s&&e[s+(t?1:-1)]?e[s+(t?1:-1)]:null}forEach(t,e=!1){const s=[...this.children];for(const n of s){if(!1===t(n))return!1;if(e&&!1===n.forEach(t,!0))return!1}}find(t,e=!0){const s=[];return this.forEach((e=>{t(e)&&s.push(e)}),e),s}map(t){return this.children.map(t)}remove(){var t,e;const s=null===(t=this.parent)||void 0===t?void 0:t.children.indexOf(this);return null!=s&&-1!==s&&(null===(e=this.parent)||void 0===e||e.children.splice(s,1)),this}textBetween(t,e){let s=!1;const n=[];return this.forEach((r=>{if(!s&&t(r)&&(s=!0),s&&r.isText&&n.push(h(r)),s&&e(r))return!1}),!0),n.join("")}}const C=["cellspacing","cellpadding","border","v:shapes","o:spid"],S=new Set(["o:p","xml","script","meta","link","v:imagedata","style"]),N={i:"em",b:"strong"};let M=0;var L=s(39);function A(t,e,s,n){const r=t.split(s);for(const t of r){const s=t.split("shplid");if(s.length>1){const t=s[1];let r="";for(let e=0;t.length>e&&!/[{ \r\n\\]/.test(t[e]);e++)r+=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()}n[e+r]={hex:o.join(""),type:a}}}}const B=[(t,e)=>{var s;if(e.rtf&&"#comment"===t.name&&t.attributes.nodeValue&&-1!==t.attributes.nodeValue.indexOf("<v:shape")){e.shapes||(e.shapes={});const s=e.jodit.create.fromHTML(t.attributes.nodeValue);return(0,p.toArray)(s.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 n=null===(s=e.shapes)||void 0===s?void 0:s[t.attributes["v:shapes"]];if(n){e.imageMap||(e.imageMap={},A(e.rtf,"i","\\shppict",e.imageMap),A(e.rtf,"s","\\shp{",e.imageMap));const s=e.imageMap[n.substring(7)];if(s){const e=[],n=s.hex.match(/[0-9a-f]{2}/gi);if(n){for(let t=0;n.length>t;t++)e.push(String.fromCharCode(parseInt(n[t],16)));t.attributes.src="data:"+s.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||S.has(t.name)?(t.remove(),null):t,t=>{const{name:e}=t;return e in N&&(t.name=N[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 C)t.attributes[e]&&(t.attributes[e]=null);return t},t=>{var e;if(T(t)){t.name="li",t.style.set("text-indent",null);const s=(t=>t.textBetween((t=>t.isComment&&/\[if.*supportLists.*]/.test(h(t))),(t=>t.isComment&&/\[endif]/.test(h(t)))).replace(/ /g,"").replace((0,i.SPACE_REG_EXP)(),""))(t),n=/[\da-np-zA-NP-Z].?/.test(s)?"ol":"ul",r=((t,e)=>{for(const e in E)if(RegExp(e).test(t))return E[e];return"ol"===e?"decimal":"disc"})(s,n);t.attributes[g]=n,t.attributes[y]=r,(t=>{if(void 0!==t.attributes[b])return;const e=[c(t)],s=[t];let n=t.next;for(;n;){if(n.isElement&&!n.attributes[b]&&T(n)){const t=c(n);t&&(e.push(t),s.push(n))}n=n.next}const r=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))),s.forEach(((t,e)=>{t.attributes[b]=i[e],t.style.add("margin-left",Math.max(c(t)-10*i[e]/r*40,0)+"px")}))})(t),(t=>{for(;t;){const e=t.previousElement;if(!j(e)&&!x(e))break;if(j(e)){if(e.attributes[b]>t.attributes[b])break;if(t.attributes[b]===e.attributes[b]&&t.parent&&k(t,t.parent))break;e.append(t);continue}const s=e;if(s.attributes[b]>t.attributes[b])break;if(t.attributes[b]===s.attributes[b]&&!k(t,s))break;s.append(t)}})(t);const{parent:a}=t;if(!x(a)||!k(t,a)){const i=((t,e,s,n)=>{const r=t.wrap(e);return r.attributes.start=(t=>/\d.\d/.test(t)?t.split(".").pop()||null:/^\d/.test(t)?""+(parseInt(t,10)||1):null)(s),r.attributes[b]=t.attributes[b],r.attributes[y]=t.attributes[y],r.attributes["data-list-style-type"]=t.attributes[y],r.style.set(v,n),(t=>{var e;!x(t)||"li"===(null===(e=t.parent)||void 0===e?void 0:e.name)||"disc"!==t.style.get(v)&&"decimal"!==t.style.get(v)||t.style.set(v,null)})(r),r})(t,n,s,r);return x(a)&&(i.remove(),null===(e=a.lastElement)||void 0===e||e.append(i)),t}}return t},(t,e)=>{var s;const n=null!==(s=e.links)&&void 0!==s?s:{};if(t.attributes.href&&t.attributes.href.match(/#.+$/)&&(n[t.attributes.href.match(/#(.+)$/)[1]]=t),t.attributes.name&&n[t.attributes.name]){const e=n[t.attributes.name];e.attributes.href=e.attributes.href.replace(/.*#(.*)$/,"#$1")}return e.links=n,t},t=>(t.isComment&&/\[if.*(supportLists|gte vml).*]/.test(h(t))&&(M++,t.remove()),t.isComment&&M>0&&h(t).includes("[endif]")&&(M=M>0?M-1:0,t.remove()),M&&(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:s}=t;return s.forEach((t=>{const e=s.get(t);e&&s.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,L.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)];s(2).D.prototype.pasteFromWord={enable:!1,convertUnitsToPixel:!1};class F extends r.B{insertFromWordByType(t,e,s,n){var r;if(!this.j.o.pasteFromWord.enable||s!==i.INSERT_AS_HTML&&s!==i.INSERT_AS_TEXT)return super.insertFromWordByType(t,e,s,n);if(e=((t,e,s,n="")=>{var r,i;const a=document.createElement("iframe");a.style.display="none",document.body.appendChild(a);try{const l=null!==(r=a.contentDocument)&&void 0!==r?r: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,p.$$)(e[t].selectorText,l.body).forEach((s=>{(0,p.attr)(s,o)||((0,p.attr)(s,o,(0,p.attr)(s,"style")||""),(0,p.attr)(s,"style","")),(0,p.attr)(s,"style",`${(0,p.attr)(s,"style")};${e[t].style.cssText}`)}))}catch(t){}return(0,p.$$)(`[${o}]`,l.body).forEach((t=>{(0,p.attr)(t,"style",`${(0,p.attr)(t,"style")};${(0,p.attr)(t,o)}`)})),((t,e,s,n)=>{const r={jodit:t,rtf:n};return e.forEach((function t(e){if(e){for(const t of B)if(null==(e=t(e,r)))break;null==e||e.forEach(t)}})),s&&e.forEach((t=>{t.style.clear()}),!0),(0,L.f)(m(e,(t=>!t.isComment)))})(t,O.make(l.body),s,n)}finally{d.i.safeRemove(a)}return e})(this.j,e,s===i.INSERT_AS_TEXT,n.rtf),this.j.o.beautifyHTML){const t=null===(r=this.j.events)||void 0===r?void 0:r.fire("beautifyHTML",e);(0,a.H)(t)&&(e=t)}(0,l.kU)(t,this.j,e)}}n.Jodit.plugins.remove("pasteFromWord"),n.Jodit.plugins.add("pasteFromWordPro",F)}},t=>t(t.s=273)])}));
|
|
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 s=e();for(var n in s)("object"==typeof exports?exports:t)[n]=s[n]}})(self,(function(){return(self.webpackChunkjodit_pro=self.webpackChunkjodit_pro||[]).push([[92],{275(t,e,s){s.r(e),s.d(e,{PasteFromWordPro:()=>F});var n=s(1),r=s(105),i=s(3),a=s(7),l=s(104);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 s=o.clientWidth;return e?-s:s}function c(t){const{style:e}=t;let s=[0,0,0,0];const n=e.keys.filter((t=>/margin/.test(t))),r=Math.max(n.indexOf("margin-left"),n.indexOf("margin")),i=r>0?n[r]:"margin-left";let a;return"margin"===i?(s=(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]))}})(e.get("margin")),a=s[3]||0):a=e.get(i)||0,u(a)}var p=s(11),d=s(18);function h(t,e=(()=>!0),s=!0){switch(!0){case t.isComment:case t.isText:{if(!e(t))return"";const{nodeValue:s}=t.attributes;return t.isComment?`\x3c!--${s}--\x3e`:s}case t.isElement:{const{attributes:n}=t,r=m(t,e,s);if(!t.attributes["jd-safe"]&&s&&0===r.replace(/[\n\t]/g,"").length&&!t.isSingle)return"";const i=Object.keys(n).map((t=>"style"===t||null==n[t]||/^jd-/.test(t)?"":`${t}="${f(n[t])}"`)).filter(Boolean),{str:a}=t.style;if(a&&i.push(`style="${f(a)}"`),s&&0===i.length&&["span","a"].includes(t.name))return r;const l=i.length?" "+i.join(" "):"";return e(t)?t.isSingle?`<${t.name}${l}/>`:`<${t.name}${l}>${r}</${t.name}>`:r}}return""}function m(t,e=(()=>!0),s=!0){let n=t.map((t=>h(t,e,s))).join("");return"p"===t.name&&0===(0,p.trim)(n).length&&(n=" "),n}function f(t){return(""+t).replace(/"/g,""")}const b="jd-list-level",g="jd-list-type",y="jd-list-style-type",v="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 x(t){return!(!t||"ol"!==t.name&&"ul"!==t.name)}function j(t){return!(!t||"li"!==t.name)}function T(t){return/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 k(t,e){return!(e.name!==t.attributes[g]||e.attributes[y]!==t.attributes[y]||t.attributes[b]!==e.attributes[b])}class ${constructor(t){this._data=w(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}add(t,e){return this._data=w(this.str+";"+`${t}:${e}`),this}get str(){const t=Object.keys(this._data).filter((t=>t&&!/^mso-/.test(t)&&null!=this.get(t)));return t.length?t.map((t=>`${(0,p.kebabCase)(t)}:${this.get(t)}`)).join(";"):""}}function w(t){return(t=>{const e={},s=[];for(let n=t.length-1;n>=0;n-=1){const r=t[n][0];e[r]||(e[r]=!0,s.unshift(t[n]))}return s})((null!=t?t:"").replace(/"/g,'"').split(";").filter(Boolean).map((t=>(0,p.trim)(t).split(":").map(p.trim)))).reduce(((t,[e,s])=>(e&&s&&(t[e]=s),t)),{})}const _=new Set(i.INSEPARABLE_TAGS);class O{constructor(t,e){this.parent=e,this.name=t.nodeName.toLowerCase(),this.type=t.nodeType,this.attributes=(t=>{const e={};if(d.i.isElement(t))for(let s=0,n=t.attributes;n.length>s;s+=1)e[n[s].name]=n[s].value;else e.nodeValue=t.nodeValue;return e})(t),this.style=new $(this.attributes.style),this.children=[],t.childNodes.forEach((t=>this.children.push(O.make(t,this))))}get isText(){return this.type===Node.TEXT_NODE}get html(){return h(this)}get isElement(){return this.type===Node.ELEMENT_NODE}get isComment(){return this.type===Node.COMMENT_NODE}get isSingle(){return _.has(this.name)}get length(){return this.children.length}static make(t,e=null){return new O(t,e)}wrap(t){var e;(0,p.assert)(null!=this.parent,"You can't wrap the root element");const s=O.make(document.createElement(t),this.parent),n=null!==(e=this.parent.children.indexOf(this))&&void 0!==e?e:-1;return-1===n?this.parent.append(s):this.parent.children[n]=s,s.append(this),s}append(t){return(0,p.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 s=e-1;s>=0;s-=1)if(t[s].isElement)return t[s];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,s;return null!==(s=null!==(t=this.sibling(!1))&&void 0!==t?t:null===(e=this.parent)||void 0===e?void 0:e.previous)&&void 0!==s?s:null}get next(){var t,e,s;return null!==(s=null!==(t=this.sibling(!0))&&void 0!==t?t:null===(e=this.parent)||void 0===e?void 0:e.next)&&void 0!==s?s:null}sibling(t){if(!this.parent)return null;const{children:e}=this.parent,s=e.indexOf(this);return-1!==s&&e[s+(t?1:-1)]?e[s+(t?1:-1)]:null}forEach(t,e=!1){const s=[...this.children];for(const n of s){if(!1===t(n))return!1;if(e&&!1===n.forEach(t,!0))return!1}}find(t,e=!0){const s=[];return this.forEach((e=>{t(e)&&s.push(e)}),e),s}map(t){return this.children.map(t)}remove(){var t,e;const s=null===(t=this.parent)||void 0===t?void 0:t.children.indexOf(this);return null!=s&&-1!==s&&(null===(e=this.parent)||void 0===e||e.children.splice(s,1)),this}textBetween(t,e){let s=!1;const n=[];return this.forEach((r=>{if(!s&&t(r)&&(s=!0),s&&r.isText&&n.push(h(r)),s&&e(r))return!1}),!0),n.join("")}}const C=["cellspacing","cellpadding","border","v:shapes","o:spid"],S=new Set(["o:p","xml","script","meta","link","v:imagedata","style"]),N={i:"em",b:"strong"};let M=0;var L=s(40);function A(t,e,s,n){const r=t.split(s);for(const t of r){const s=t.split("shplid");if(s.length>1){const t=s[1];let r="";for(let e=0;t.length>e&&!/[{ \r\n\\]/.test(t[e]);e++)r+=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()}n[e+r]={hex:o.join(""),type:a}}}}const B=[(t,e)=>{var s;if(e.rtf&&"#comment"===t.name&&t.attributes.nodeValue&&-1!==t.attributes.nodeValue.indexOf("<v:shape")){e.shapes||(e.shapes={});const s=e.jodit.create.fromHTML(t.attributes.nodeValue);return(0,p.toArray)(s.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 n=null===(s=e.shapes)||void 0===s?void 0:s[t.attributes["v:shapes"]];if(n){e.imageMap||(e.imageMap={},A(e.rtf,"i","\\shppict",e.imageMap),A(e.rtf,"s","\\shp{",e.imageMap));const s=e.imageMap[n.substring(7)];if(s){const e=[],n=s.hex.match(/[0-9a-f]{2}/gi);if(n){for(let t=0;n.length>t;t++)e.push(String.fromCharCode(parseInt(n[t],16)));t.attributes.src="data:"+s.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||S.has(t.name)?(t.remove(),null):t,t=>{const{name:e}=t;return e in N&&(t.name=N[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 C)t.attributes[e]&&(t.attributes[e]=null);return t},t=>{var e;if(T(t)){t.name="li",t.style.set("text-indent",null);const s=(t=>t.textBetween((t=>t.isComment&&/\[if.*supportLists.*]/.test(h(t))),(t=>t.isComment&&/\[endif]/.test(h(t)))).replace(/ /g,"").replace((0,i.SPACE_REG_EXP)(),""))(t),n=/[\da-np-zA-NP-Z].?/.test(s)?"ol":"ul",r=((t,e)=>{for(const e in E)if(RegExp(e).test(t))return E[e];return"ol"===e?"decimal":"disc"})(s,n);t.attributes[g]=n,t.attributes[y]=r,(t=>{if(void 0!==t.attributes[b])return;const e=[c(t)],s=[t];let n=t.next;for(;n;){if(n.isElement&&!n.attributes[b]&&T(n)){const t=c(n);t&&(e.push(t),s.push(n))}n=n.next}const r=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))),s.forEach(((t,e)=>{t.attributes[b]=i[e],t.style.add("margin-left",Math.max(c(t)-10*i[e]/r*40,0)+"px")}))})(t),(t=>{for(;t;){const e=t.previousElement;if(!j(e)&&!x(e))break;if(j(e)){if(e.attributes[b]>t.attributes[b])break;if(t.attributes[b]===e.attributes[b]&&t.parent&&k(t,t.parent))break;e.append(t);continue}const s=e;if(s.attributes[b]>t.attributes[b])break;if(t.attributes[b]===s.attributes[b]&&!k(t,s))break;s.append(t)}})(t);const{parent:a}=t;if(!x(a)||!k(t,a)){const i=((t,e,s,n)=>{const r=t.wrap(e);return r.attributes.start=(t=>/\d.\d/.test(t)?t.split(".").pop()||null:/^\d/.test(t)?""+(parseInt(t,10)||1):null)(s),r.attributes[b]=t.attributes[b],r.attributes[y]=t.attributes[y],r.attributes["data-list-style-type"]=t.attributes[y],r.style.set(v,n),(t=>{var e;!x(t)||"li"===(null===(e=t.parent)||void 0===e?void 0:e.name)||"disc"!==t.style.get(v)&&"decimal"!==t.style.get(v)||t.style.set(v,null)})(r),r})(t,n,s,r);return x(a)&&(i.remove(),null===(e=a.lastElement)||void 0===e||e.append(i)),t}}return t},(t,e)=>{var s;const n=null!==(s=e.links)&&void 0!==s?s:{};if(t.attributes.href&&t.attributes.href.match(/#.+$/)&&(n[t.attributes.href.match(/#(.+)$/)[1]]=t),t.attributes.name&&n[t.attributes.name]){const e=n[t.attributes.name];e.attributes.href=e.attributes.href.replace(/.*#(.*)$/,"#$1")}return e.links=n,t},t=>(t.isComment&&/\[if.*(supportLists|gte vml).*]/.test(h(t))&&(M++,t.remove()),t.isComment&&M>0&&h(t).includes("[endif]")&&(M=M>0?M-1:0,t.remove()),M&&(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:s}=t;return s.forEach((t=>{const e=s.get(t);e&&s.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,L.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)];s(2).D.prototype.pasteFromWord={enable:!1,convertUnitsToPixel:!1};class F extends r.B{insertFromWordByType(t,e,s,n){var r;if(!this.j.o.pasteFromWord.enable||s!==i.INSERT_AS_HTML&&s!==i.INSERT_AS_TEXT)return super.insertFromWordByType(t,e,s,n);if(e=((t,e,s,n="")=>{var r,i;const a=document.createElement("iframe");a.style.display="none",document.body.appendChild(a);try{const l=null!==(r=a.contentDocument)&&void 0!==r?r: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,p.$$)(e[t].selectorText,l.body).forEach((s=>{(0,p.attr)(s,o)||((0,p.attr)(s,o,(0,p.attr)(s,"style")||""),(0,p.attr)(s,"style","")),(0,p.attr)(s,"style",`${(0,p.attr)(s,"style")};${e[t].style.cssText}`)}))}catch(t){}return(0,p.$$)(`[${o}]`,l.body).forEach((t=>{(0,p.attr)(t,"style",`${(0,p.attr)(t,"style")};${(0,p.attr)(t,o)}`)})),((t,e,s,n)=>{const r={jodit:t,rtf:n};return e.forEach((function t(e){if(e){for(const t of B)if(null==(e=t(e,r)))break;null==e||e.forEach(t)}})),s&&e.forEach((t=>{t.style.clear()}),!0),(0,L.f)(m(e,(t=>!t.isComment)))})(t,O.make(l.body),s,n)}finally{d.i.safeRemove(a)}return e})(this.j,e,s===i.INSERT_AS_TEXT,n.rtf),this.j.o.beautifyHTML){const t=null===(r=this.j.events)||void 0===r?void 0:r.fire("beautifyHTML",e);(0,a.H)(t)&&(e=t)}(0,l.kU)(t,this.j,e)}}n.Jodit.plugins.remove("pasteFromWord"),n.Jodit.plugins.add("pasteFromWordPro",F)}},t=>t(t.s=275)])}));
|
|
@@ -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],{
|
|
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],{209(t,e,o){"use strict";o.r(e),o.d(e,{ar:()=>s,cs_cz:()=>l,de:()=>r,es:()=>i,fa:()=>n,fr:()=>a,he:()=>c,hu:()=>h,id:()=>p,it:()=>d,ja:()=>k,ko:()=>u,nl:()=>b,pl:()=>g,pt_br:()=>w,ru:()=>f,tr:()=>B,zh_cn:()=>x,zh_tw:()=>m});const s=o(210),l=o(211),r=o(212),i=o(213),n=o(214),a=o(215),c=o(216),h=o(217),p=o(218),d=o(219),k=o(220),u=o(221),b=o(222),g=o(223),w=o(224),f=o(225),B=o(226),x=o(227),m=o(228)},208(t,e,o){"use strict";o.r(e),o.d(e,{showBlocks:()=>p});var s=o(205),l=o(2);l.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"]},l.D.prototype.controls.showBlocks={isActive(t){return!!t.e.fire("showBlocksEnabled")},tooltip:"Show Blocks",command:"toggleShowBlocks"};var r=o(77),i=o(4),n=o(48),a=o(16),c=o(21),h=o(1);class p extends r.S{constructor(t){super(t),this.requires=["license"],this.buttons=[{name:"showBlocks",group:"state"}],this.isEnabled=!1,(0,a.xl)(o(209)),n.JO.set("showBlocks",o(229))}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")}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(),i.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)},205(t,e,o){"use strict";function s(t,e,o,s){var l,r=arguments.length,i=3>r?e:null===s?s=Object.getOwnPropertyDescriptor(e,o):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,o,s);else for(var n=t.length-1;n>=0;n--)(l=t[n])&&(i=(3>r?l(i):r>3?l(e,o,i):l(e,o))||i);return r>3&&i&&Object.defineProperty(e,o,i),i}o.d(e,{gn:()=>s})},210(t){t.exports={"Show Blocks":"تظهر كتل"}},211(t){t.exports={"Show Blocks":"Ukázat Bloky"}},212(t){t.exports={"Show Blocks":"Zeigen Blöcke"}},213(t){t.exports={"Show Blocks":"Mostrar Bloques"}},214(t){t.exports={"Show Blocks":"نشان می دهد بلوک"}},215(t){t.exports={"Show Blocks":"Afficher Les Blocs"}},216(t){t.exports={"Show Blocks":"תראה רחובות"}},217(t){t.exports={"Show Blocks":"Mutasd Meg Blokkok"}},218(t){t.exports={"Show Blocks":"Menunjukkan Blok"}},219(t){t.exports={"Show Blocks":"Visualizza Blocchi"}},220(t){t.exports={"Show Blocks":"ショーのブロック"}},221(t){t.exports={"Show Blocks":"쇼 블록"}},222(t){t.exports={"Show Blocks":"Toon Blokken"}},223(t){t.exports={"Show Blocks":"Pokaż Bloki"}},224(t){t.exports={"Show Blocks":"Mostrar Blocos"}},225(t){t.exports={"Show Blocks":"Показать Блоки"}},226(t){t.exports={"Show Blocks":"Haritayı Blokları"}},227(t){t.exports={"Show Blocks":"显示块"}},228(t){t.exports={"Show Blocks":"แสดงช่วงตึก"}},229(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=208)])}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";((e,t)=>{if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var o=t();for(var n in o)("object"==typeof exports?exports:e)[n]=o[n]}})(self,(function(){return(self.webpackChunkjodit_pro=self.webpackChunkjodit_pro||[]).push([[288],{
|
|
1
|
+
"use strict";((e,t)=>{if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var o=t();for(var n in o)("object"==typeof exports?exports:e)[n]=o[n]}})(self,(function(){return(self.webpackChunkjodit_pro=self.webpackChunkjodit_pro||[]).push([[288],{258(e,t,o){o.r(t),o.d(t,{tuneBlock:()=>b});var n=o(205),i=o(77),s=o(21),r=o(1),l=o(48),c=o(18),h=o(11),u=o(71);let p=class extends l.u1{constructor(){super(...arguments),this.isShown=!1,this.toolbar=(0,u.R)(this.j,this),this.popup=new l.GI(this.j,!1)}className(){return"UITuner"}render(){return"<div>\n\t\t\t<div class='&__handle' title='~Click to tune~'/>\n\t\t</div>"}show(){const e=this.j.s.current();if(!e)return this.hide();const t=c.i.isBlock(e)?e:c.i.closest(e,(e=>!(!e||!this.j.o.tuneBlock.popup[e.nodeName.toLowerCase()])),this.j.editor);if(!t||t===this.j.editor||!this.j.o.tuneBlock.popup[t.tagName.toLowerCase()])return this.hide();this.currentBlock=t,this.isShown=!0,this.closeToolbar(),this.calcPosition(),this.container.parentNode||this.j.workplace.append(this.container)}hide(){this.isShown&&(this.isShown=!1,c.i.safeRemove(this.container),this.closeToolbar())}onEditorScroll(){this.isShown&&this.calcPosition()}calcPosition(){const e=(0,h.css)(this.j.editor,"marginLeft"),t=(0,h.css)(this.j.editor,"paddingLeft"),o=(0,h.css)(this.j.editor,"marginTop");(0,h.css)(this.container,{transform:`translate3d(${this.currentBlock.offsetWidth-15+e+t}px, ${this.currentBlock.offsetTop-this.j.editor.scrollTop+o}px, 0)`}),this.popup.isOpened&&this.popup.updatePosition()}onAfterExecTune(e){e&&(this.currentBlock=e),this.calcPosition(),this.openToolbar()}onClickPrevent(e){e.preventDefault(),e.stopPropagation()}onTargetClick(){this.toggleToolbar()}openToolbar(){if(this.setMod("opened",!0),this.toolbar.build(this.j.o.tuneBlock.popup[this.currentBlock.tagName.toLowerCase()],this.currentBlock),this.popup.setContent(this.toolbar.container),!this.popup.isOpened){const e=this.getElm("handle");(0,h.assert)(null!=e,"Handle element does not exist"),this.popup.open((()=>(0,h.position)(e)))}}closeToolbar(){this.setMod("opened",!1),this.popup.close()}toggleToolbar(){this.getMod("opened")?this.closeToolbar():this.openToolbar()}};(0,n.gn)([(0,s.watch)(":hideTuner.tune")],p.prototype,"hide",null),(0,n.gn)([(0,s.watch)("j.editor:scroll"),(0,s.throttle)(10)],p.prototype,"onEditorScroll",null),(0,n.gn)([(0,s.watch)(":afterExecTune.tune"),(0,s.idle)()],p.prototype,"onAfterExecTune",null),(0,n.gn)([(0,s.watch)("container:click container:mousedown")],p.prototype,"onClickPrevent",null),(0,n.gn)([(0,s.watch)("handle:click")],p.prototype,"onTargetClick",null),(0,n.gn)([(0,s.watch)(":closeTuner.tune")],p.prototype,"closeToolbar",null),p=(0,n.gn)([s.component],p);var a=o(2);const d=["tune.up","tune.remove","tune.down"],f=["tune.h1","tune.h2","tune.h3","\n","tune.h4","tune.h5","tune.h6","\n",...d];function g(e){return{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50"><text dominant-baseline="text-before-edge" style="font: 45px sans-serif" x="0" y="0">'+e.toUpperCase()+"</text></svg>",isActive(t,o,n){var i;return(null===(i=null==n?void 0:n.target)||void 0===i?void 0:i.tagName.toLowerCase())===e},exec(t,o){if(o){t.selection.save();const n=c.i.replace(o,e,t.createInside);t.selection.restore(),t.e.fire("synchro"),t.e.fire("afterExecTune.tune",n)}return!0}}}function w(e){const t=e?"previousSibling":"nextSibling";return{icon:e?"angle-up":"angle-down",isDisabled(e,o,n){var i;return!(null===(i=null==n?void 0:n.target)||void 0===i?void 0:i[t])},exec(o,n){const i=null==n?void 0:n[t];return n&&i&&(o.selection.save(),(0,h.call)(e?c.i.before:c.i.after,i,n),o.selection.restore()),o.e.fire("synchro"),o.e.fire("afterExecTune.tune"),!0}}}a.D.prototype.tuneBlock={popup:{p:d,table:d,img:d,blockquote:d,div:d,pre:["tune.editPre",...d],h1:f,h2:f,h3:f,h4:f,h5:f,h6:f}},a.D.prototype.controls.tune={h1:g("h1"),h2:g("h2"),h3:g("h3"),h4:g("h4"),h5:g("h5"),h6:g("h6"),up:w(!0),down:w(!1),editPre:{icon:"pencil",exec(e,t){e.e.fire("editPreInPasteCode",t)}},remove:{icon:"bin",exec(e,t){c.i.safeRemove(t),e.e.fire("synchro"),e.e.fire("closeTuner.tune"),e.e.fire("hideTuner.tune")}}};class b extends i.S{constructor(){super(...arguments),this.requires=["license"]}afterInit(e){this.tuner=new p(e)}hideTuner(){this.tuner.hide()}onChangeSelection(){this.j.s.isCollapsed()||this.hideTuner()}onClickInBlock(e){this.j.s.isCollapsed()&&this.tuner.show()}beforeDestruct(e){this.tuner.destruct()}}(0,n.gn)([(0,s.watch)(":outsideClick :keydown")],b.prototype,"hideTuner",null),(0,n.gn)([(0,s.watch)("j.ed:selectionchange"),(0,s.debounce)()],b.prototype,"onChangeSelection",null),(0,n.gn)([(0,s.watch)(":click")],b.prototype,"onClickInBlock",null),r.Jodit.plugins.add("tune-block",b)},205(e,t,o){function n(e,t,o,n){var i,s=arguments.length,r=3>s?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,o,n);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(r=(3>s?i(r):s>3?i(t,o,r):i(t,o))||r);return s>3&&r&&Object.defineProperty(t,o,r),r}o.d(t,{gn:()=>n})}},e=>e(e.s=258)])}));
|