jodit-pro 1.3.11 → 1.3.14
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.es5.js +1 -1
- package/build/plugins/backup/backup.js +1 -1
- package/build/plugins/button-generator/button-generator.es5.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.es5.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.es5.js +1 -1
- package/build/plugins/export-docs/export-docs.js +1 -1
- package/build/plugins/finder/finder.css +1 -1
- package/build/plugins/finder/finder.es5.css +1 -1
- package/build/plugins/finder/finder.es5.js +1 -1
- package/build/plugins/finder/finder.js +1 -1
- package/build/plugins/google-maps/google-maps.es5.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.es5.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/index.html +44 -23
- package/package.json +1 -1
|
@@ -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([[283],{88572(t,e,o){"use strict";function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t=>typeof t:t=>t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t,s(t)}function r(t,e,o){var r=o.value;if("function"!=typeof r)throw new TypeError("@boundMethod decorator can only be applied to methods not: ".concat(s(r)));var a=!1;return{configurable:!0,get(){if(a||this===t.prototype||this.hasOwnProperty(e)||"function"!=typeof r)return r;var o=r.bind(this);return a=!0,Object.defineProperty(this,e,{configurable:!0,get:()=>o,set(t){r=t,delete this[e]}}),a=!1,o},set(t){r=t}}}function a(t){var e;return"undefined"!=typeof Reflect&&"function"==typeof Reflect.ownKeys?e=Reflect.ownKeys(t.prototype):(e=Object.getOwnPropertyNames(t.prototype),"function"==typeof Object.getOwnPropertySymbols&&(e=e.concat(Object.getOwnPropertySymbols(t.prototype)))),e.forEach((e=>{if("constructor"!==e){var o=Object.getOwnPropertyDescriptor(t.prototype,e);"function"==typeof o.value&&Object.defineProperty(t.prototype,e,r(t,e,o))}})),t}function i(){return 1===arguments.length?a.apply(void 0,arguments):r.apply(void 0,arguments)}o.r(e),o.d(e,{boundClass:()=>a,boundMethod:()=>r,default:()=>i})},69232(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=o(85119);s.Config.prototype.keyboard={defaultLayoutSet:"en",showLayoutSwitcher:!0,extraKeyGroup:"other",extraKeyButtons:[],delayKeyRepeat:350,periodKeyRepeat:100,layoutList:{en:{title:"English",keys:[["` ~ ±","1 ! §","2 @","3 #","4 $","5 %","6 ^","7 &","8 *","9 (","0 )","- _","= +","Backspace"],["Tab","q Q","w W","e E","r R","t T","y Y","u U","i I","o O","p P","[ {","] }","\\ |"],["Caps","a A","s S","d D","f F","g G","h H","j J","k K","l L","; :","' \"","Enter"],["Shift","z Z","x X","c C","v V","b B","n N","m M",", <",". >","/ ?","Shift"],["Options","Space","Options"]]},es:{title:"Español",keys:[["º ` ~","1 ! §","2 @","3 #","4 $","5 %","6 ^","7 &","8 *","9 (","0 )","- _ |","¡ = +","Backspace"],["Tab","q Q","w W","e E","r R","t T","y Y","u U","i I","o O","p P","[ {","] }","ç Ç \\"],["Caps","a A","s S","d D","f F","g G","h H","j J","k K","l L","ñ Ñ ; :","' \"","Enter"],["Shift","z Z","x X","c C","v V","b B","n N","m M",", <",". >","/ ?","Shift"],["Options","Space","Options"]]},de:{title:"Deutsch",keys:[["` ~ ±","1 ! §","2 @","3 #","4 $","5 %","6 ^","7 &","8 * :","9 ( {","0 ) }","- _","= +","Backspace"],["Tab","q Q","w W","e E","r R","t T","z Z","u U","i I","o O","p P","ü Ü [","] }","\\ |"],["Caps","a A","s S","d D","f F","g G","h H","j J","k K","l L","ö Ö ;","ä Ä ' \"","Enter"],["Shift","y Y","x X","c C","v V","b B","n N","m M",", <",". >","/ ?","Shift"],["Options","Space","Options"]]},ru:{title:"Русский",keys:[["` ~ ±","1 ! §",'2 @ "',"3 # :","4 $ <","5 % >","6 ^","7 &","8 *","9 (","0 )","- _","= +","Backspace"],["Tab","й Й","ц Ц","у У","к К","е Е","н Н","г Г","ш Ш","щ Щ","з З","х Х [","ъ ] {","\\ | }"],["Caps","ф Ф","ы Ы","в В","а А","п П","р Р","о О","л Л","д Д","ж Ж ;","э Э '","Enter"],["Shift","я Я","ч Ч","с С","м М","и И","т Т","ь Ь","б Б ,","ю Ю .","/ ?","Shift"],["Options","Space","Options"]]},tr:{title:"Türkçe",keys:[['" é` ~',"1 ! §",'2 @ "',"3 # :","4 $ <","5 % >","6 ^ ±","7 &","8 *","9 ( {","0 ) }","- _ [","= + ]","Backspace"],["Tab","q Q","w W","e E","r R","t T","y Y","u U","ı I","o O","p P","ğ Ğ","ü Ü",", \\ |"],["Caps","a A","s S","d D","f F","g G","h H","j J","k K","l L","ş Ş","i̇ İ","Enter"],["Shift","z Z","x X","c C","v V","b B","n N","m M","ö Ö <","ç Ç >",". / ?","Shift"],["Options","Space","Options"]]},iw:{title:"Hebrew",keys:[["` ~ ±","1 ! §","2 @","3 #","4 $","5 %","6 ^","7 &","8 *","9 (","0 )","- _","= +","Backspace"],["Tab","/ q Q","' w W","ק e E","ר r R","א t T","ט y Y","ו u U","ן i I","ם o O","פ p P","[ {","] }","\\ |"],["Caps","ש a A","ד s S","ג d D","כ f F","ע g G","י h H","ח j J","ל k K","ך l L","ף ; :","' \"","Enter"],["Shift","ז z Z","ס x X","ב c C","ה v V","נ b B","מ n N","צ m M",", <",". >","/ ?","Shift"],["Options","Space","Options"]]},tata:{title:"Tata",keys:[["һ Һ` ~","1 ! §",'2 @ "',"3 # :","4 $ <","5 % >","6 ^ ±","7 &","8 *","9 ( {","0 )","- _","= +","Backspace"],["Tab","й Й","ө Ө","у У","к К","е Е","н Н","г Г","ш Ш","ә Ә","з З","х Х [","ү Ү ]","\\ | }"],["Caps","ф Ф","ы Ы","в В","а А","п П","р Р","о О","л Л","д Д","ң Ң ;","э Э '","Enter"],["Shift","я Я","ч Ч","с С","м М","и И","т Т","җ Җ","б Б ,","ю Ю .","ґ Ґ /","Shift"],["Options","Space","Options"]]}},layoutSwitchList:["en","es","de","ru","tr","iw","tata"],keySize:32,layout:[[1,1,1,1,1,1,1,1,1,1,1,1,1,2],[1.5,1,1,1,1,1,1,1,1,1,1,1,1,1.5],[1.8,1,1,1,1,1,1,1,1,1,1,1,2.2],[2.5,1,1,1,1,1,1,1,1,1,1,2.5],[3.5,9,3.5]]},s.Config.prototype.controls.keyboard={tooltip:"Keyboard",icon:o(20325),isActive:t=>!!t.e.fire("isKeyboardOpened"),command:"toggleKeyboard"},s.Config.prototype.controls.extraKeyboardButtons={}},42396(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.keyboard=void 0;var s=o(70655),r=o(16490),a=o(97029),i=o(83542),n=o(23112);o(69232);var p=o(95185),c=o(78827),y=o(15651),h=o(85119),l=function(t){function e(e){var o=t.call(this,e)||this;o.hasStyle=!a.Jodit.fatMode,o.requires=["license"],o.buttons=[{group:"insert",name:"keyboard"}];var s=e.o.keyboard,r=s.extraKeyButtons,i=s.extraKeyGroup;return r.length&&r.forEach(((t,o)=>{var s=(0,y.isString)(t)?t:t.key,r=(0,y.isString)(t)||!t.hotkeys?["ctrl+".concat(o+1)]:t.hotkeys;e.registerButton({name:"extraKeyboardButtons.".concat(s),group:i}),h.Config.defaultOptions.controls.extraKeyboardButtons[s]={name:s,tooltip:s,args:[s],hotkeys:r,command:"insertChar"}})),o}return s.__extends(e,t),e.prototype.afterInit=function(t){var e=this;t.registerCommand("toggleKeyboard",this.toggleKeyboard).registerCommand("insertChar",this.insertChar),t.e.on("isKeyboardOpened",(()=>{var t;return null===(t=e.__keyboard)||void 0===t?void 0:t.isOpened}))},e.prototype.insertChar=function(t,e,o){this.j.s.insertNode(this.j.createInside.text(o))},e.prototype.toggleKeyboard=function(){if(!this.__keyboard){this.__keyboard=new p.Dialog({toolbarButtonSize:"tiny"});var t=new i.UIKeyboard(this.j);this.__keyboard.setMod("slim",!0).setMod("adaptive",!1).setContent(t);var e=this.j.o.keyboard,o=e.layoutList;if(e.showLayoutSwitcher){var s=new c.UISelect(this.__keyboard,{value:t.state.currentLayout,options:e.layoutSwitchList.map((t=>{var e,s;return{text:null!==(s=null===(e=o[t])||void 0===e?void 0:e.title)&&void 0!==s?s:t,value:t}})),onChange(e){t.state.currentLayout=e}});s.setMod("size","tiny").setMod("width","auto").setMod("variant","outline"),this.__keyboard.setHeader(s)}}this.__keyboard.isOpened?this.__keyboard.close():this.__keyboard.open()},e.prototype.beforeDestruct=function(t){var e;null===(e=this.__keyboard)||void 0===e||e.destruct()},s.__decorate([n.autobind],e.prototype,"insertChar",null),s.__decorate([n.autobind],e.prototype,"toggleKeyboard",null),e}(r.Plugin);e.keyboard=l,a.Jodit.plugins.add("keyboard",l)},83542(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UIKeyboard=void 0;var s=o(70655);o(36772);var r=o(78827),a=o(23112),i=o(46228),n=o(11606),p=o(88572),c=function(t){function e(e){var o=t.call(this,e)||this;return o.state={caps:!1,shift:!1,options:!1,currentLayout:o.j.o.keyboard.defaultLayoutSet},o._keys=o.getElms("key"),o.pressed=!1,o.reKeyDownTimeout=0,o.onStateChange(),o}var c;return s.__extends(e,t),c=e,e.prototype.className=()=>"UIKeyboard",e.prototype.render=function(){var t=this.j.options.keyboard,e=t.layout,o=t.keySize,s=e.length;return"<div>".concat((()=>{for(var t=[],r=0;s>r;r+=1){for(var a=[],i=0;e[r].length>i;i+=1)a.push('<div style="width:'.concat(o*e[r][i],"px;height:").concat(o,'px;" class="&__key"></div>'));t.push("<div class='&__row'>".concat(a.join("\n"),"</div>"))}return t.join("\n")})(),"</div>")},e.prototype.onStateChange=function(){for(var t=this.state,e=t.options,o=t.shift,s=t.caps,r=this.j.o.keyboard.layoutList[t.currentLayout].keys,a=0,i=0;r.length>i;i+=1)for(var n=0;r[i].length>n;n+=1){var p=r[i][n].split(" "),y=p[0];o&&(y=p[1]),!o&&s&&p[1]&&c.isLetter(p[0])&&(y=p[1]),e&&(y=p[2]),this.setKeyValue(a,null!=y?y:p[0]),a+=1}},e.isLetter=t=>t.toLowerCase()!==t.toUpperCase(),e.prototype.setKeyValue=function(t,e){var o=this._keys[t];if(o){var s=!1,r=this.state,a=r.options,n=r.shift,p=r.caps;switch(e){case"Caps":s=p;break;case"Options":s=a;break;case"Shift":s=n}o.innerHTML=c.decorate(e),o.classList.toggle(this.getFullElName("key","active",!0),s),(0,i.attr)(o,"-key",e)}},e.prototype.onKeyUp=function(){this.pressed&&this.stopPress()},e.prototype.onReady=function(){this.j.e.on(this.getElms("key"),"mouseenter",this.stopPress)},e.prototype.stopPress=function(){var t=this;this.pressed&&(this.pressed=!1,this.j.async.clearTimeout(this.reKeyDownTimeout),this._keys.forEach((e=>{e.classList.remove(t.getFullElName("key","pressed",!0))})))},e.prototype.onKeyDown=function(t,e){var o=this;void 0===e&&(e=0);var s=t.target;if(!s||!s.classList.contains(this.getFullElName("key")))return!1;this.pressed=!0,s.classList.add(this.getFullElName("key","pressed",!0));var r=(0,i.attr)(s,"-key");switch(r){case"Caps":this.state.caps=!this.state.caps;break;case"Shift":this.state.shift=!this.state.shift;break;case"Options":this.state.options=!this.state.options;break;case"Enter":case"Backspace":this.j.e.fire("keydown",{key:r,preventDefault(){}});break;case"Space":case"Tab":this.j.s.insertNode(this.j.createInside.text(n.NBSP_SPACE));break;default:this.state.shift&&(this.state.shift=!1),r&&this.j.s.insertNode(this.j.createInside.text(r))}var a=this.j.o.keyboard,p=a.periodKeyRepeat;return this.reKeyDownTimeout=this.j.async.setTimeout((()=>o.onKeyDown(t,p)),e||a.delayKeyRepeat),!1},e.decorate=t=>{switch(t){case"Space":return"";case"Enter":return r.Icon.get("enter");case"Backspace":return o(51311);case"Shift":return o(93174);case"Caps":return o(77116);case"Options":return o(20686);case"Tab":return o(33560);default:return t}},s.__decorate([(0,a.watch)(["state.currentLayout","state.options","state.shift","state.caps"])],e.prototype,"onStateChange",null),s.__decorate([(0,a.watch)(["ow:mouseup"])],e.prototype,"onKeyUp",null),s.__decorate([(0,a.hook)("ready")],e.prototype,"onReady",null),s.__decorate([p.default],e.prototype,"stopPress",null),s.__decorate([(0,a.watch)(["container:mousedown"],["container:touchstart"])],e.prototype,"onKeyDown",null),c=s.__decorate([a.component],e)}(r.UIElement);e.UIKeyboard=c},20325(t){t.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"> <path d="M0 6c0-1.1.9-2 2-2h16a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V6zm2 0v2h2V6H2zm1 3v2h2V9H3zm-1 3v2h2v-2H2zm3 0v2h10v-2H5zm11 0v2h2v-2h-2zM6 9v2h2V9H6zm3 0v2h2V9H9zm3 0v2h2V9h-2zm3 0v2h2V9h-2zM5 6v2h2V6H5zm3 0v2h2V6H8zm3 0v2h2V6h-2zm3 0v2h4V6h-4z"/> </svg>'},51311(t){t.exports='<?xml version="1.0" ?><svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M0 10l7-7h13v14H7l-7-7zm14.41 0l2.13-2.12-1.42-1.42L13 8.6l-2.12-2.13-1.42 1.42L11.6 10l-2.13 2.12 1.42 1.42L13 11.4l2.12 2.13 1.42-1.42L14.4 10z"/></svg>'},77116(t){t.exports='<svg viewBox="0 0 30 29" xmlns="http://www.w3.org/2000/svg"> <path d="M15 0.5L30 15.2625H22V24H8V15.2625H0L15 0.5Z"/> <rect x="8" y="26" width="14" height="3"/> </svg>'},20686(t){t.exports='<svg xmlns=\'http://www.w3.org/2000/svg\' viewBox="0 0 24 24" > <circle cy="12" cx="12" r="2.2"/> <circle cy="12" cx="5" r="2.2"/> <circle cy="12" cx="19" r="2.2"/> </svg>'},93174(t){t.exports='<svg viewBox="0 0 30 29" xmlns="http://www.w3.org/2000/svg"> <path d="M15 0.5L30 15.2625H22V29H8V15.2625H0L15 0.5Z"/> </svg>'},33560(t){t.exports='<svg viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M23.17 14.83l7.17 7.17h-28.34v4h28.34l-7.17 7.17 2.83 2.83 12-12-12-12-2.83 2.83zm16.83-2.83v24h4v-24h-4z"/> </svg>'},36772(t,e,o){"use strict";o.r(e)}},t=>t(t.s=42396)])}));
|
|
1
|
+
((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 o in s)("object"==typeof exports?exports:t)[o]=s[o]}})(self,(function(){return(self.webpackChunkjodit_pro=self.webpackChunkjodit_pro||[]).push([[283],{88572(t,e,s){"use strict";function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t=>typeof t:t=>t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t,o(t)}function r(t,e,s){var r=s.value;if("function"!=typeof r)throw new TypeError("@boundMethod decorator can only be applied to methods not: ".concat(o(r)));var a=!1;return{configurable:!0,get(){if(a||this===t.prototype||this.hasOwnProperty(e)||"function"!=typeof r)return r;var s=r.bind(this);return a=!0,Object.defineProperty(this,e,{configurable:!0,get:()=>s,set(t){r=t,delete this[e]}}),a=!1,s},set(t){r=t}}}function a(t){var e;return"undefined"!=typeof Reflect&&"function"==typeof Reflect.ownKeys?e=Reflect.ownKeys(t.prototype):(e=Object.getOwnPropertyNames(t.prototype),"function"==typeof Object.getOwnPropertySymbols&&(e=e.concat(Object.getOwnPropertySymbols(t.prototype)))),e.forEach((e=>{if("constructor"!==e){var s=Object.getOwnPropertyDescriptor(t.prototype,e);"function"==typeof s.value&&Object.defineProperty(t.prototype,e,r(t,e,s))}})),t}function i(){return 1===arguments.length?a.apply(void 0,arguments):r.apply(void 0,arguments)}s.d(e,{ZP:()=>i})},36952(t,e,s){"use strict";s.r(e),s.d(e,{keyboard:()=>g});var o,r=s(70655),a=s(16490),i=s(5846),n=s(48823),p=s(41257),c=s(43841),h=s(11606),y=s(88572);let l=o=class extends n.u1{constructor(t){super(t),this.state={caps:!1,shift:!1,options:!1,currentLayout:this.j.o.keyboard.defaultLayoutSet},this._keys=this.getElms("key"),this.pressed=!1,this.reKeyDownTimeout=0,this.onStateChange()}className(){return"UIKeyboard"}render(){const{layout:t,keySize:e}=this.j.options.keyboard,s=t.length;return`<div>${(()=>{const o=[];for(let r=0;s>r;r+=1){const s=[];for(let o=0;t[r].length>o;o+=1)s.push(`<div style="width:${e*t[r][o]}px;height:${e}px;" class="&__key"></div>`);o.push(`<div class='&__row'>${s.join("\n")}</div>`)}return o.join("\n")})()}</div>`}onStateChange(){const{currentLayout:t,options:e,shift:s,caps:r}=this.state,{keys:a}=this.j.o.keyboard.layoutList[t];let i=0;for(let t=0;a.length>t;t+=1)for(let n=0;a[t].length>n;n+=1){const p=a[t][n].split(" ");let c=p[0];s&&(c=p[1]),!s&&r&&p[1]&&o.isLetter(p[0])&&(c=p[1]),e&&(c=p[2]),this.setKeyValue(i,null!=c?c:p[0]),i+=1}}static isLetter(t){return t.toLowerCase()!==t.toUpperCase()}setKeyValue(t,e){const s=this._keys[t];if(!s)return;let r=!1;const{options:a,shift:i,caps:n}=this.state;switch(e){case"Caps":r=n;break;case"Options":r=a;break;case"Shift":r=i}s.innerHTML=o.decorate(e),s.classList.toggle(this.getFullElName("key","active",!0),r),(0,c.Lj)(s,"-key",e)}onKeyUp(){this.pressed&&this.stopPress()}onReady(){this.j.e.on(this.getElms("key"),"mouseenter",this.stopPress)}stopPress(){this.pressed&&(this.pressed=!1,this.j.async.clearTimeout(this.reKeyDownTimeout),this._keys.forEach((t=>{t.classList.remove(this.getFullElName("key","pressed",!0))})))}onKeyDown(t,e=0){const s=t.target;if(!s||!s.classList.contains(this.getFullElName("key")))return!1;this.pressed=!0,s.classList.add(this.getFullElName("key","pressed",!0));const o=(0,c.Lj)(s,"-key");switch(o){case"Caps":this.state.caps=!this.state.caps;break;case"Shift":this.state.shift=!this.state.shift;break;case"Options":this.state.options=!this.state.options;break;case"Enter":case"Backspace":this.j.e.fire("keydown",{key:o,preventDefault(){}});break;case"Space":case"Tab":this.j.s.insertNode(this.j.createInside.text(h.NBSP_SPACE));break;default:this.state.shift&&(this.state.shift=!1),o&&this.j.s.insertNode(this.j.createInside.text(o))}const{periodKeyRepeat:r,delayKeyRepeat:a}=this.j.o.keyboard;return this.reKeyDownTimeout=this.j.async.setTimeout((()=>this.onKeyDown(t,r)),e||a),!1}static decorate(t){switch(t){case"Space":return"";case"Enter":return n.JO.get("enter");case"Backspace":return s(51311);case"Shift":return s(93174);case"Caps":return s(77116);case"Options":return s(20686);case"Tab":return s(33560);default:return t}}};(0,r.gn)([(0,p.watch)(["state.currentLayout","state.options","state.shift","state.caps"])],l.prototype,"onStateChange",null),(0,r.gn)([(0,p.watch)(["ow:mouseup"])],l.prototype,"onKeyUp",null),(0,r.gn)([(0,p.hook)("ready")],l.prototype,"onReady",null),(0,r.gn)([y.ZP],l.prototype,"stopPress",null),(0,r.gn)([(0,p.watch)(["container:mousedown"],["container:touchstart"])],l.prototype,"onKeyDown",null),l=o=(0,r.gn)([p.component],l);var u=s(85119);u.D.prototype.keyboard={defaultLayoutSet:"en",showLayoutSwitcher:!0,extraKeyGroup:"other",extraKeyButtons:[],delayKeyRepeat:350,periodKeyRepeat:100,layoutList:{en:{title:"English",keys:[["` ~ ±","1 ! §","2 @","3 #","4 $","5 %","6 ^","7 &","8 *","9 (","0 )","- _","= +","Backspace"],["Tab","q Q","w W","e E","r R","t T","y Y","u U","i I","o O","p P","[ {","] }","\\ |"],["Caps","a A","s S","d D","f F","g G","h H","j J","k K","l L","; :","' \"","Enter"],["Shift","z Z","x X","c C","v V","b B","n N","m M",", <",". >","/ ?","Shift"],["Options","Space","Options"]]},es:{title:"Español",keys:[["º ` ~","1 ! §","2 @","3 #","4 $","5 %","6 ^","7 &","8 *","9 (","0 )","- _ |","¡ = +","Backspace"],["Tab","q Q","w W","e E","r R","t T","y Y","u U","i I","o O","p P","[ {","] }","ç Ç \\"],["Caps","a A","s S","d D","f F","g G","h H","j J","k K","l L","ñ Ñ ; :","' \"","Enter"],["Shift","z Z","x X","c C","v V","b B","n N","m M",", <",". >","/ ?","Shift"],["Options","Space","Options"]]},de:{title:"Deutsch",keys:[["` ~ ±","1 ! §","2 @","3 #","4 $","5 %","6 ^","7 &","8 * :","9 ( {","0 ) }","- _","= +","Backspace"],["Tab","q Q","w W","e E","r R","t T","z Z","u U","i I","o O","p P","ü Ü [","] }","\\ |"],["Caps","a A","s S","d D","f F","g G","h H","j J","k K","l L","ö Ö ;","ä Ä ' \"","Enter"],["Shift","y Y","x X","c C","v V","b B","n N","m M",", <",". >","/ ?","Shift"],["Options","Space","Options"]]},ru:{title:"Русский",keys:[["` ~ ±","1 ! §",'2 @ "',"3 # :","4 $ <","5 % >","6 ^","7 &","8 *","9 (","0 )","- _","= +","Backspace"],["Tab","й Й","ц Ц","у У","к К","е Е","н Н","г Г","ш Ш","щ Щ","з З","х Х [","ъ ] {","\\ | }"],["Caps","ф Ф","ы Ы","в В","а А","п П","р Р","о О","л Л","д Д","ж Ж ;","э Э '","Enter"],["Shift","я Я","ч Ч","с С","м М","и И","т Т","ь Ь","б Б ,","ю Ю .","/ ?","Shift"],["Options","Space","Options"]]},tr:{title:"Türkçe",keys:[['" é` ~',"1 ! §",'2 @ "',"3 # :","4 $ <","5 % >","6 ^ ±","7 &","8 *","9 ( {","0 ) }","- _ [","= + ]","Backspace"],["Tab","q Q","w W","e E","r R","t T","y Y","u U","ı I","o O","p P","ğ Ğ","ü Ü",", \\ |"],["Caps","a A","s S","d D","f F","g G","h H","j J","k K","l L","ş Ş","i̇ İ","Enter"],["Shift","z Z","x X","c C","v V","b B","n N","m M","ö Ö <","ç Ç >",". / ?","Shift"],["Options","Space","Options"]]},iw:{title:"Hebrew",keys:[["` ~ ±","1 ! §","2 @","3 #","4 $","5 %","6 ^","7 &","8 *","9 (","0 )","- _","= +","Backspace"],["Tab","/ q Q","' w W","ק e E","ר r R","א t T","ט y Y","ו u U","ן i I","ם o O","פ p P","[ {","] }","\\ |"],["Caps","ש a A","ד s S","ג d D","כ f F","ע g G","י h H","ח j J","ל k K","ך l L","ף ; :","' \"","Enter"],["Shift","ז z Z","ס x X","ב c C","ה v V","נ b B","מ n N","צ m M",", <",". >","/ ?","Shift"],["Options","Space","Options"]]},tata:{title:"Tata",keys:[["һ Һ` ~","1 ! §",'2 @ "',"3 # :","4 $ <","5 % >","6 ^ ±","7 &","8 *","9 ( {","0 )","- _","= +","Backspace"],["Tab","й Й","ө Ө","у У","к К","е Е","н Н","г Г","ш Ш","ә Ә","з З","х Х [","ү Ү ]","\\ | }"],["Caps","ф Ф","ы Ы","в В","а А","п П","р Р","о О","л Л","д Д","ң Ң ;","э Э '","Enter"],["Shift","я Я","ч Ч","с С","м М","и И","т Т","җ Җ","б Б ,","ю Ю .","ґ Ґ /","Shift"],["Options","Space","Options"]]}},layoutSwitchList:["en","es","de","ru","tr","iw","tata"],keySize:32,layout:[[1,1,1,1,1,1,1,1,1,1,1,1,1,2],[1.5,1,1,1,1,1,1,1,1,1,1,1,1,1.5],[1.8,1,1,1,1,1,1,1,1,1,1,1,2.2],[2.5,1,1,1,1,1,1,1,1,1,1,2.5],[3.5,9,3.5]]},u.D.prototype.controls.keyboard={tooltip:"Keyboard",icon:s(20325),isActive(t){return!!t.e.fire("isKeyboardOpened")},command:"toggleKeyboard"},u.D.prototype.controls.extraKeyboardButtons={};var d=s(35244),f=s(47295);class g extends a.S{constructor(t){super(t),this.hasStyle=!i.Jodit.fatMode,this.requires=["license"],this.buttons=[{group:"insert",name:"keyboard"}];const{extraKeyButtons:e,extraKeyGroup:s}=t.o.keyboard;e.length&&e.forEach(((e,o)=>{const r=(0,f.HD)(e)?e:e.key,a=(0,f.HD)(e)||!e.hotkeys?["ctrl+"+(o+1)]:e.hotkeys;t.registerButton({name:"extraKeyboardButtons."+r,group:s});const{extraKeyboardButtons:i}=u.D.defaultOptions.controls;i[r]={name:r,tooltip:r,args:[r],hotkeys:a,command:"insertChar"}}))}afterInit(t){t.registerCommand("toggleKeyboard",this.toggleKeyboard).registerCommand("insertChar",this.insertChar),t.e.on("isKeyboardOpened",(()=>{var t;return null===(t=this.__keyboard)||void 0===t?void 0:t.isOpened}))}insertChar(t,e,s){this.j.s.insertNode(this.j.createInside.text(s))}toggleKeyboard(){if(!this.__keyboard){this.__keyboard=new d.Dialog({toolbarButtonSize:"tiny"});const t=new l(this.j);this.__keyboard.setMod("slim",!0).setMod("adaptive",!1).setContent(t);const{showLayoutSwitcher:e,layoutSwitchList:s,layoutList:o}=this.j.o.keyboard;if(e){const e=new n.Cj(this.__keyboard,{value:t.state.currentLayout,options:s.map((t=>{var e,s;return{text:null!==(s=null===(e=o[t])||void 0===e?void 0:e.title)&&void 0!==s?s:t,value:t}})),onChange(e){t.state.currentLayout=e}});e.setMod("size","tiny").setMod("width","auto").setMod("variant","outline"),this.__keyboard.setHeader(e)}}this.__keyboard.isOpened?this.__keyboard.close():this.__keyboard.open()}beforeDestruct(t){var e;null===(e=this.__keyboard)||void 0===e||e.destruct()}}(0,r.gn)([p.autobind],g.prototype,"insertChar",null),(0,r.gn)([p.autobind],g.prototype,"toggleKeyboard",null),i.Jodit.plugins.add("keyboard",g)},70655(t,e,s){"use strict";function o(t,e,s,o){var r,a=arguments.length,i=3>a?e:null===o?o=Object.getOwnPropertyDescriptor(e,s):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,s,o);else for(var n=t.length-1;n>=0;n--)(r=t[n])&&(i=(3>a?r(i):a>3?r(e,s,i):r(e,s))||i);return a>3&&i&&Object.defineProperty(e,s,i),i}s.d(e,{gn:()=>o})},20325(t){t.exports='<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"> <path d="M0 6c0-1.1.9-2 2-2h16a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V6zm2 0v2h2V6H2zm1 3v2h2V9H3zm-1 3v2h2v-2H2zm3 0v2h10v-2H5zm11 0v2h2v-2h-2zM6 9v2h2V9H6zm3 0v2h2V9H9zm3 0v2h2V9h-2zm3 0v2h2V9h-2zM5 6v2h2V6H5zm3 0v2h2V6H8zm3 0v2h2V6h-2zm3 0v2h4V6h-4z"/> </svg>'},51311(t){t.exports='<?xml version="1.0" ?><svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M0 10l7-7h13v14H7l-7-7zm14.41 0l2.13-2.12-1.42-1.42L13 8.6l-2.12-2.13-1.42 1.42L11.6 10l-2.13 2.12 1.42 1.42L13 11.4l2.12 2.13 1.42-1.42L14.4 10z"/></svg>'},77116(t){t.exports='<svg viewBox="0 0 30 29" xmlns="http://www.w3.org/2000/svg"> <path d="M15 0.5L30 15.2625H22V24H8V15.2625H0L15 0.5Z"/> <rect x="8" y="26" width="14" height="3"/> </svg>'},20686(t){t.exports='<svg xmlns=\'http://www.w3.org/2000/svg\' viewBox="0 0 24 24" > <circle cy="12" cx="12" r="2.2"/> <circle cy="12" cx="5" r="2.2"/> <circle cy="12" cx="19" r="2.2"/> </svg>'},93174(t){t.exports='<svg viewBox="0 0 30 29" xmlns="http://www.w3.org/2000/svg"> <path d="M15 0.5L30 15.2625H22V29H8V15.2625H0L15 0.5Z"/> </svg>'},33560(t){t.exports='<svg viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> <path d="M23.17 14.83l7.17 7.17h-28.34v4h28.34l-7.17 7.17 2.83 2.83 12-12-12-12-2.83 2.83zm16.83-2.83v24h4v-24h-4z"/> </svg>'}},t=>t(t.s=36952)])}));
|
|
@@ -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 r=t();for(var a in r)("object"==typeof exports?exports:e)[a]=r[a]}})(self,(function(){return(self.webpackChunkjodit_pro=self.webpackChunkjodit_pro||[]).push([[790],{17114(e,t){"use strict";t.Z="[data-jodit-page-break] {\n\tdisplay: flex;\n\theight: 24px;\n\tbox-sizing: border-box;\n\n\talign-items: center;\n\tjustify-content: center;\n\n\tborder: 1px dashed #ccc;\n\n\tfont-size: 12px;\n\tpage-break-before: always;\n\ttext-transform: uppercase;\n}\n\n[data-jodit-page-break]:active {\n\tborder-color: #818181;\n}\n"},
|
|
1
|
+
((e,t)=>{if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var a in r)("object"==typeof exports?exports:e)[a]=r[a]}})(self,(function(){return(self.webpackChunkjodit_pro=self.webpackChunkjodit_pro||[]).push([[790],{17114(e,t){"use strict";t.Z="[data-jodit-page-break] {\n\tdisplay: flex;\n\theight: 24px;\n\tbox-sizing: border-box;\n\n\talign-items: center;\n\tjustify-content: center;\n\n\tborder: 1px dashed #ccc;\n\n\tfont-size: 12px;\n\tpage-break-before: always;\n\ttext-transform: uppercase;\n}\n\n[data-jodit-page-break]:active {\n\tborder-color: #818181;\n}\n"},93820(e,t,r){"use strict";r.r(t),r.d(t,{PageBreak:()=>l});var a=r(70655),o=r(16490),n=r(5846),i=r(85119);const s=r(17114).Z;i.D.prototype.pageBreak={separator:'<div style="page-break-before: always"></div>'},i.D.prototype.controls.pageBreak={tooltip:"Insert page break",icon:r(23654),command:"insertPageBreak"},i.D.prototype.iframeStyle=i.D.prototype.iframeStyle+""+s;var p=r(44370),d=r(41257),c=r(91037);class l extends o.S{constructor(){super(...arguments),this.requires=["license"],this.buttons=[{name:"pageBreak",group:"insert"}]}afterInit(e){e.registerCommand("insertPageBreak",(()=>{const t=e.createInside.div("",{});this.decoratePageBreak(t),e.s.insertNode(t,!1,!1);let r=t.parentNode;for(;r&&r!==e.editor&&(p.i.after(r,t),!p.i.isBlock(r));)r=t.parentNode;e.s.setCursorAfter(t),e.setEditorValue()}))}decoratePageBreak(e){(0,c.attr)(e,{"data-jodit-page-break":!0,contenteditable:!1}),e.innerText=this.j.i18n("Page break")}beforeDestruct(){}onChange(){(0,c.$$)('[style*="page-break-after"],[style*="page-break-before"]',this.j.editor).forEach((e=>{p.i.isEmpty(e)&&!(0,c.attr)(e,"data-jodit-page-break")&&this.decoratePageBreak(e)}))}onAfterGetValueFromEditor(e){e.value=e.value.replace(/<div[^>]+data-jodit-page-break[^>]+>[^]*?<\/div>/gi,this.j.o.pageBreak.separator)}}(0,a.gn)([(0,d.watch)([":change",":afterSetMode"]),(0,d.debounce)()],l.prototype,"onChange",null),(0,a.gn)([(0,d.watch)(":afterGetValueFromEditor")],l.prototype,"onAfterGetValueFromEditor",null),n.Jodit.plugins.add("pageBreak",l)},70655(e,t,r){"use strict";function a(e,t,r,a){var o,n=arguments.length,i=3>n?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(3>n?o(i):n>3?o(t,r,i):o(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i}r.d(t,{gn:()=>a})},23654(e){e.exports='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"> <path d="M2.5 12C2.5 11.5858 2.83579 11.25 3.25 11.25H4.75C5.16421 11.25 5.5 11.5858 5.5 12C5.5 12.4142 5.16421 12.75 4.75 12.75H3.25C2.83579 12.75 2.5 12.4142 2.5 12Z"/> <path d="M6.5 12C6.5 11.5858 6.83579 11.25 7.25 11.25H8.75C9.16421 11.25 9.5 11.5858 9.5 12C9.5 12.4142 9.16421 12.75 8.75 12.75H7.25C6.83579 12.75 6.5 12.4142 6.5 12Z" /> <path d="M10.5 12C10.5 11.5858 10.8358 11.25 11.25 11.25H12.75C13.1642 11.25 13.5 11.5858 13.5 12C13.5 12.4142 13.1642 12.75 12.75 12.75H11.25C10.8358 12.75 10.5 12.4142 10.5 12Z" /> <path d="M14.5 12C14.5 11.5858 14.8358 11.25 15.25 11.25H16.75C17.1642 11.25 17.5 11.5858 17.5 12C17.5 12.4142 17.1642 12.75 16.75 12.75H15.25C14.8358 12.75 14.5 12.4142 14.5 12Z" /> <path d="M18.5 12C18.5 11.5858 18.8358 11.25 19.25 11.25H20.75C21.1642 11.25 21.5 11.5858 21.5 12C21.5 12.4142 21.1642 12.75 20.75 12.75H19.25C18.8358 12.75 18.5 12.4142 18.5 12Z" /> <path d="M4.75 2C4.33579 2 4 2.33579 4 2.75V7C4 8.104 4.896 9 6 9H18C19.104 9 20 8.104 20 7V2.75C20 2.33579 19.6642 2 19.25 2C18.8358 2 18.5 2.33579 18.5 2.75V7C18.5 7.275 18.276 7.5 18 7.5H6C5.724 7.5 5.5 7.275 5.5 7V2.75C5.5 2.33579 5.16421 2 4.75 2Z" /> <path d="M19.25 22C19.6642 22 20 21.6642 20 21.25V17C20 15.896 19.104 15 18 15L6 15C4.896 15 4 15.896 4 17L4 21.25C4 21.6642 4.33579 22 4.75 22C5.16421 22 5.5 21.6642 5.5 21.25L5.5 17C5.5 16.725 5.724 16.5 6 16.5L18 16.5C18.276 16.5 18.5 16.725 18.5 17V21.25C18.5 21.6642 18.8358 22 19.25 22Z" /> </svg>'}},e=>e(e.s=93820)])}));
|
|
@@ -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
|
|
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],{76935(e,t,a){"use strict";a.r(t),a.d(t,{pasteCode:()=>p});var s=a(70655),o=a(85119),i=a(91037);o.D.prototype.controls.pasteCode={icon:a(11920),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(16490),r=a(48823),n=a(41257),c=a(5846),d=a(35244);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)},70655(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})},11920(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=76935)])}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(self,(function(){return(self.webpackChunkjodit_pro=self.webpackChunkjodit_pro||[]).push([[92],{68356:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.clearAttributes=void 0;var n=r(70655),i=["cellspacing","cellpadding","border","v:shapes","o:spid"];t.clearAttributes=function(e){var t,r;if(/^OLE_LINK\d+$/.test(e.attributes.name)&&(e.attributes.name=null,0===e.length))return e.remove(),null;"_GoBack"===e.attributes.name&&(e.attributes.name=null);try{for(var a=n.__values(i),o=a.next();!o.done;o=a.next()){var s=o.value;e.attributes[s]&&(e.attributes[s]=null)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}return e}},67635:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.clearClassName=void 0;var n=r(589);t.clearClassName=function(e){return e.attributes.class&&(e.attributes.class=e.attributes.class.replace(/(el\d+)|(font\d+)|msonormal|msolistparagraph\w*/gi,""),(0,n.trim)(e.attributes.class)||(e.attributes.class=null)),e}},57446:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.convertStyleUnitToPixels=void 0;var n=r(29580);t.convertStyleUnitToPixels=function(e,t){if(!t.jodit.o.pasteFromWord.convertUnitsToPixel)return e;var r=e.style;return r.forEach((function(e){var t=r.get(e);t&&r.set(e,t.toString().replace(/\d+(\.\d+)?(pt|cm)/g,(function(e){return(0,n.convertUnitToPx)(e)+"px"})))})),e}},44815:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.removeRedundancyStyle=t.convertToList=void 0;var n=r(29580),i=r(18566),a=r(11606),o=r(51330);function s(e){var t;!(0,i.isList)(e)||"li"===(null===(t=e.parent)||void 0===t?void 0:t.name)||"disc"!==e.style.get(o.STYLE_CSS_KEY)&&"decimal"!==e.style.get(o.STYLE_CSS_KEY)||e.style.set(o.STYLE_CSS_KEY,null)}t.convertToList=function(e){var t;if((0,i.isPseudoLeaf)(e)){e.name="li",e.style.set("text-indent",null);var r=l(e),a=/[\da-np-zA-NP-Z].?/.test(r)?"ol":"ul",u=function(e,t){for(var r in o.listStyleMap)if(RegExp(r).test(e))return o.listStyleMap[r];return"ol"===t?"decimal":"disc"}(r,a);e.attributes[o.TYPE_KEY]=a,e.attributes[o.STYLE_KEY]=u,(0,n.calcListLevels)(e),function(e){for(;e;){var t=e.previousElement;if(!(0,i.isLeaf)(t)&&!(0,i.isList)(t))break;if((0,i.isLeaf)(t)){if(t.attributes[o.LEVEL_KEY]>e.attributes[o.LEVEL_KEY])break;if(e.attributes[o.LEVEL_KEY]===t.attributes[o.LEVEL_KEY]&&e.parent&&(0,i.isSameType)(e,e.parent))break;t.append(e)}else{var r=t;if(r.attributes[o.LEVEL_KEY]>e.attributes[o.LEVEL_KEY])break;if(e.attributes[o.LEVEL_KEY]===r.attributes[o.LEVEL_KEY]&&!(0,i.isSameType)(e,r))break;r.append(e)}}}(e);var c=e.parent;if(!(0,i.isList)(c)||!(0,i.isSameType)(e,c)){var f=function(e,t,r,i){var a=e.wrap(t);return a.attributes.start=(0,n.calcStartBySymbol)(r),a.attributes[o.LEVEL_KEY]=e.attributes[o.LEVEL_KEY],a.attributes[o.STYLE_KEY]=e.attributes[o.STYLE_KEY],a.attributes[o.STYLE_VALID_KEY]=e.attributes[o.STYLE_KEY],a.style.set(o.STYLE_CSS_KEY,i),s(a),a}(e,a,r,u);return(0,i.isList)(c)&&(f.remove(),null===(t=c.lastElement)||void 0===t||t.append(f)),e}}return e},t.removeRedundancyStyle=s;var l=function(e){return e.textBetween((function(e){return e.isComment&&/\[if.*supportLists.*]/.test((0,i.html)(e))}),(function(e){return e.isComment&&/\[endif]/.test((0,i.html)(e))})).replace(/ /g,"").replace((0,a.SPACE_REG_EXP)(),"")}},2394:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.cases=void 0;var n=r(44815),i=r(68356),a=r(65302),o=r(75099),s=r(74587),l=r(57446),u=r(67635),c=r(35264),f=r(41925),p=r(83161),d=r(26549),m=r(40522);t.cases=[m.processImage,d.markPageBreakElements,a.removeExtraTags,o.replaceOldTags,i.clearAttributes,n.convertToList,c.processLinks,s.removeInsideComment,l.convertStyleUnitToPixels,u.clearClassName,f.normalizeImageProps,p.removeWidthFromTableCell]},26549:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.markPageBreakElements=void 0,t.markPageBreakElements=function(e){return(e.isElement&&"always"===e.style.get("page-break-before")||"page"===e.style.get("break-before"))&&(e.attributes["jd-safe"]=!0,e.style.add("page-break-before","always"),e.isSingle&&(e.name="div")),e}},41925:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeImageProps=void 0,t.normalizeImageProps=function(e){return e.isElement?("img"===e.name&&(e.attributes.align&&(e.style.add("float",e.attributes.align),e.attributes.align=null),e.attributes.hspace&&(e.style.add("marginLeft",e.attributes.hspace+"px"),e.style.add("marginRight",e.attributes.hspace+"px"),e.attributes.hspace=null)),e):e}},40522:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.processImage=void 0;var n=r(70655),i=r(75204);function a(e,t,r,i){var a,o,s=e.split(r);try{for(var l=n.__values(s),u=l.next();!u.done;u=l.next()){var c=u.value.split("shplid");if(c.length>1){for(var f=c[1],p="",d=0;f.length>d&&!/[{ \r\n\\]/.test(f[d]);d++)p+=f[d];var m=f.split("bliptag");if(m&&2>m.length)continue;var v=null;if(m[0].indexOf("pngblip")?v="image/png":-1!==m[0].indexOf("jpegblip")&&(v="image/jpeg"),!v)continue;var h=m[1].split("}");if(h&&2>h.length)continue;var y=void 0;if(h.length>2&&h[0].includes("blipuid"))y=h[1].split(" ");else{if((y=h[0].split(" "))&&2>y.length)continue;y.shift()}i[t+p]={hex:y.join(""),type:v}}}}catch(e){a={error:e}}finally{try{u&&!u.done&&(o=l.return)&&o.call(l)}finally{if(a)throw a.error}}}t.processImage=function(e,t){var r;if(t.rtf&&"#comment"===e.name&&e.attributes.nodeValue&&-1!==e.attributes.nodeValue.indexOf("<v:shape")){t.shapes||(t.shapes={});var n=t.jodit.create.fromHTML(e.attributes.nodeValue);return(0,i.toArray)(n.getElementsByTagName("v:shape")).forEach((function(e){t.shapes[e.id]=e.getAttribute("o:spid")})),e}if("img"!==e.name)return e;if(t.rtf&&e.attributes["v:shapes"]){var o=null===(r=t.shapes)||void 0===r?void 0:r[e.attributes["v:shapes"]];if(o){t.imageMap||(t.imageMap={},a(t.rtf,"i","\\shppict",t.imageMap),a(t.rtf,"s","\\shp{",t.imageMap));var s=t.imageMap[o.substring(7)];if(s){var l=[],u=s.hex.match(/[0-9a-f]{2}/gi);if(u){for(var c=0;u.length>c;c++)l.push(String.fromCharCode(parseInt(u[c],16)));e.attributes.src="data:"+s.type+";base64,"+btoa(l.join(""))}}}}return e}},35264:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.processLinks=void 0,t.processLinks=function(e,t){var r,n=null!==(r=t.links)&&void 0!==r?r:{};if(e.attributes.href&&e.attributes.href.match(/#.+$/)&&(n[e.attributes.href.match(/#(.+)$/)[1]]=e),e.attributes.name&&n[e.attributes.name]){var i=n[e.attributes.name];i.attributes.href=i.attributes.href.replace(/.*#(.*)$/,"#$1")}return t.links=n,e}},65302:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.removeExtraTags=void 0;var r=new Set(["o:p","xml","script","meta","link","v:imagedata","style"]);t.removeExtraTags=function(e){return"none"===e.style.get("display")||0===e.length&&"span"===e.name||r.has(e.name)?(e.remove(),null):e}},74587:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.removeInsideComment=void 0;var n=r(18566),i=0;t.removeInsideComment=function(e){return e.isComment&&/\[if.*(supportLists|gte vml).*]/.test((0,n.html)(e))&&(i++,e.remove()),e.isComment&&i>0&&(0,n.html)(e).includes("[endif]")&&(i=i>0?i-1:0,e.remove()),i&&(e.isText||"img"===e.name&&(!e.attributes.src||/^file:/.test(e.attributes.src)))?(e.remove(),null):e}},75099:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.replaceOldTags=void 0;var r={i:"em",b:"strong"};t.replaceOldTags=function(e){var t=e.name;return t in r&&(e.name=r[t]),e}},83161:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.removeWidthFromTableCell=void 0,t.removeWidthFromTableCell=function(e){return!e.attributes.width||"th"!==e.name&&"td"!==e.name||(e.attributes.width=null),e}},78322:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),r(85119).Config.prototype.pasteFromWord={enable:!1,convertUnitsToPixel:!1}},51330:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.listStyleMap=t.STYLE_CSS_KEY=t.STYLE_VALID_KEY=t.STYLE_KEY=t.TYPE_KEY=t.LEVEL_KEY=void 0,t.LEVEL_KEY="jd-list-level",t.TYPE_KEY="jd-list-type",t.STYLE_KEY="jd-list-style-type",t.STYLE_VALID_KEY="data-list-style-type",t.STYLE_CSS_KEY="list-style-type",t.listStyleMap={"·":"disc",o:"circle","§":"square","[ivx]":"lower-roman","[IVX]":"upper-roman","[a-z]":"lower-alpha","[A-Z]":"upper-alpha","\\d":"decimal"}},77800:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.isSameType=t.isPseudoLeaf=t.isLeaf=t.isList=void 0;var n=r(46801),i=r(51330);t.isList=function(e){return Boolean(e&&("ol"===e.name||"ul"===e.name))},t.isLeaf=function(e){return Boolean(e&&"li"===e.name)},t.isPseudoLeaf=function(e){return/mso-list:\s*l\d+ level\d+ lfo\d+/i.test(e.attributes.style)||/msolistparagraph/i.test(e.attributes.class)&&Boolean(e.find((function(e){return e.isComment&&(0,n.html)(e).includes("supportLists")})).length)},t.isSameType=function(e,t){return!(t.name!==e.attributes[i.TYPE_KEY]||t.attributes[i.STYLE_KEY]!==e.attributes[i.STYLE_KEY]||e.attributes[i.LEVEL_KEY]!==t.attributes[i.LEVEL_KEY])}},94616:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.JElement=void 0;var n=r(70655),i=r(44370),a=r(11606),o=r(75204),s=r(46801),l=r(15002),u=new Set(a.INSEPARABLE_TAGS),c=function(){function e(t,r){var n=this;this.parent=r,this.name=t.nodeName.toLowerCase(),this.type=t.nodeType,this.attributes=function(e){var t={};if(i.Dom.isElement(e))for(var r=0,n=e.attributes;n.length>r;r+=1)t[n[r].name]=n[r].value;else t.nodeValue=e.nodeValue;return t}(t),this.style=new l.Style(this.attributes.style),this.children=[],t.childNodes.forEach((function(t){return n.children.push(e.make(t,n))}))}return Object.defineProperty(e.prototype,"isText",{get:function(){return this.type===Node.TEXT_NODE},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"html",{get:function(){return(0,s.html)(this)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isElement",{get:function(){return this.type===Node.ELEMENT_NODE},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isComment",{get:function(){return this.type===Node.COMMENT_NODE},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isSingle",{get:function(){return u.has(this.name)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this.children.length},enumerable:!1,configurable:!0}),e.make=function(t,r){return void 0===r&&(r=null),new e(t,r)},e.prototype.wrap=function(t){var r;(0,o.assert)(null!=this.parent,"You can't wrap the root element");var n=e.make(document.createElement(t),this.parent),i=null!==(r=this.parent.children.indexOf(this))&&void 0!==r?r:-1;return-1===i?this.parent.append(n):this.parent.children[i]=n,n.append(this),n},e.prototype.append=function(e){return(0,o.assert)(e!==this,"Forbidden to add to yourself"),e.remove(),this.children.push(e),e.parent=this,this},Object.defineProperty(e.prototype,"previousElement",{get:function(){if(!this.parent)return null;var e=this.parent.children,t=e.indexOf(this);if(-1!==t)for(var r=t-1;r>=0;r-=1)if(e[r].isElement)return e[r];return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastElement",{get:function(){for(var e=this.children,t=e.length-1;t>=0;t-=1)if(e[t].isElement)return e[t];return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"previous",{get:function(){var e,t,r;return null!==(r=null!==(e=this.sibling(!1))&&void 0!==e?e:null===(t=this.parent)||void 0===t?void 0:t.previous)&&void 0!==r?r:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"next",{get:function(){var e,t,r;return null!==(r=null!==(e=this.sibling(!0))&&void 0!==e?e:null===(t=this.parent)||void 0===t?void 0:t.next)&&void 0!==r?r:null},enumerable:!1,configurable:!0}),e.prototype.sibling=function(e){if(!this.parent)return null;var t=this.parent.children,r=t.indexOf(this);return-1!==r&&t[r+(e?1:-1)]?t[r+(e?1:-1)]:null},e.prototype.forEach=function(e,t){var r,i;void 0===t&&(t=!1);var a=n.__spreadArray([],n.__read(this.children),!1);try{for(var o=n.__values(a),s=o.next();!s.done;s=o.next()){var l=s.value;if(!1===e(l))return!1;if(t&&!1===l.forEach(e,!0))return!1}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}},e.prototype.find=function(e,t){void 0===t&&(t=!0);var r=[];return this.forEach((function(t){e(t)&&r.push(t)}),t),r},e.prototype.map=function(e){return this.children.map(e)},e.prototype.remove=function(){var e,t,r=null===(e=this.parent)||void 0===e?void 0:e.children.indexOf(this);return null!=r&&-1!==r&&(null===(t=this.parent)||void 0===t||t.children.splice(r,1)),this},e.prototype.textBetween=function(e,t){var r=!1,n=[];return this.forEach((function(i){if(!r&&e(i)&&(r=!0),r&&i.isText&&n.push((0,s.html)(i)),r&&t(i))return!1}),!0),n.join("")},e}();t.JElement=c},18566:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(70655);n.__exportStar(r(77800),t),n.__exportStar(r(94616),t),n.__exportStar(r(46801),t)},46801:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.innerHTML=t.html=void 0;var n=r(75204);function i(e,t,r){switch(void 0===t&&(t=function(){return!0}),void 0===r&&(r=!0),!0){case e.isComment:case e.isText:if(!t(e))return"";var n=e.attributes.nodeValue;return e.isComment?"\x3c!--".concat(n,"--\x3e"):n;case e.isElement:var i=e.attributes,s=a(e,t,r);if(!e.attributes["jd-safe"]&&r&&0===s.replace(/[\n\t]/g,"").length&&!e.isSingle)return"";var l=Object.keys(i).map((function(e){return"style"===e||null==i[e]||/^jd-/.test(e)?"":"".concat(e,'="').concat(o(i[e]),'"')})).filter(Boolean),u=e.style.str;if(u&&l.push('style="'.concat(o(u),'"')),r&&0===l.length&&["span","a"].includes(e.name))return s;var c=l.length?" "+l.join(" "):"";return t(e)?e.isSingle?"<".concat(e.name).concat(c,"/>"):"<".concat(e.name).concat(c,">").concat(s,"</").concat(e.name,">"):s}return""}function a(e,t,r){void 0===t&&(t=function(){return!0}),void 0===r&&(r=!0);var a=e.map((function(e){return i(e,t,r)})).join("");return"p"===e.name&&0===(0,n.trim)(a).length&&(a=" "),a}function o(e){return e.toString().replace(/"/g,""")}t.html=i,t.innerHTML=a},15002:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.Style=void 0;var n=r(70655),i=r(75204),a=function(){function e(e){this._data=o(e)}return Object.defineProperty(e.prototype,"keys",{get:function(){return Object.keys(this._data)},enumerable:!1,configurable:!0}),e.prototype.forEach=function(e){this.keys.forEach((function(t){return e(t)}))},e.prototype.clear=function(){this._data={}},e.prototype.set=function(e,t){this._data[e]=t},e.prototype.get=function(e){var t;return null!==(t=this._data[e])&&void 0!==t?t:null},e.prototype.add=function(e,t){return this._data=o(this.str+";"+"".concat(e,":").concat(t)),this},Object.defineProperty(e.prototype,"str",{get:function(){var e=this,t=Object.keys(this._data).filter((function(t){return t&&!/^mso-/.test(t)&&null!=e.get(t)}));return t.length?t.map((function(t){return"".concat((0,i.kebabCase)(t),":").concat(e.get(t))})).join(";"):""},enumerable:!1,configurable:!0}),e}();function o(e){return function(e){for(var t={},r=[],n=e.length-1;n>=0;n-=1){var i=e[n][0];t[i]||(t[i]=!0,r.unshift(e[n]))}return r}((null!=e?e:"").replace(/"/g,'"').split(";").filter(Boolean).map((function(e){return(0,i.trim)(e).split(":").map(i.trim)}))).reduce((function(e,t){var r=n.__read(t,2),i=r[0],a=r[1];return i&&a&&(e[i]=a),e}),{})}t.Style=a},64282:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.applyStylesPro=void 0;var n=r(75204),i=r(44370),a=r(37987),o=r(18566);t.applyStylesPro=function(e,t,r,s){var l,u;void 0===s&&(s="");var c=document.createElement("iframe");c.style.display="none",document.body.appendChild(c);try{var f=null!==(l=c.contentDocument)&&void 0!==l?l:null===(u=c.contentWindow)||void 0===u?void 0:u.document;if(!f)return t;f.open(),f.write(t),f.close();for(var p="jd-style",d=function(e){try{for(var t=f.styleSheets[e].cssRules,r=function(e){if(!t[e].selectorText)return"continue";(0,n.$$)(t[e].selectorText,f.body).forEach((function(r){(0,n.attr)(r,p)||((0,n.attr)(r,p,(0,n.attr)(r,"style")||""),(0,n.attr)(r,"style","")),(0,n.attr)(r,"style","".concat((0,n.attr)(r,"style"),";").concat(t[e].style.cssText))}))},i=0;t.length>i;i+=1)r(i)}catch(e){}},m=0;f.styleSheets.length>m;m+=1)d(m);return(0,n.$$)("[".concat(p,"]"),f.body).forEach((function(e){(0,n.attr)(e,"style","".concat((0,n.attr)(e,"style"),";").concat((0,n.attr)(e,p)))})),(0,a.transformWordToHtml)(e,o.JElement.make(f.body),r,s)}finally{i.Dom.safeRemove(c)}return t}},20036:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.calcListLevels=void 0;var n=r(70655),i=r(18566),a=r(51330),o=r(90998);t.calcListLevels=function(e){if(void 0===e.attributes[a.LEVEL_KEY]){for(var t=[(0,o.realPixelIndent)(e)],r=[e],s=e.next;s;){if(s.isElement&&!s.attributes[a.LEVEL_KEY]&&(0,i.isPseudoLeaf)(s)){var l=(0,o.realPixelIndent)(s);l&&(t.push(l),r.push(s))}s=s.next}var u=Math.min.apply(Math,n.__spreadArray([],n.__read(t.filter((function(e){return e>0}))),!1)),c=t.map((function(e){return Math.ceil(e/10)}));-1!==c.indexOf(0)&&(c=c.map((function(e){return e+1}))),r.forEach((function(e,t){e.attributes[a.LEVEL_KEY]=c[t],e.style.add("margin-left","".concat(Math.max((0,o.realPixelIndent)(e)-10*c[t]/u*40,0),"px"))}))}}},90998:function(e,t){function r(e){if(!e)return[0,0,0,0];var t=e.match(/(0|auto|(-?[.\d]+(?:\w+|%)))/g)||["0px"];switch(t.length){case 2:return[0,1,0,1].map((function(e){return t[e]}));case 3:return[0,1,2,1].map((function(e){return t[e]}));case 4:return[0,1,2,3].map((function(e){return t[e]}));default:return[0,0,0,0].map((function(e){return t[e]}))}}var n;function i(e){if("number"==typeof e)return e;if(/%$/.test(e))return 0;n||(n=document.createElement("div"),Object.assign(n.style,{position:"absolute",left:"-9999px",top:"-9999px",margin:"0",padding:"0",border:"0"}),document.body.append(n),setTimeout((function(){null==n||n.remove(),n=null})));var t=0>parseFloat(e);t&&(e=e.replace("-","")),n.style.width=e;var r=n.clientWidth;return t?-r:r}Object.defineProperty(t,"__esModule",{value:!0}),t.calcStartBySymbol=t.realPixelIndent=t.convertUnitToPx=t.calcMarginParts=void 0,t.calcMarginParts=r,t.convertUnitToPx=i,t.realPixelIndent=function(e){var t=e.style,n=t.keys.filter((function(e){return/margin/.test(e)})),a=Math.max(n.indexOf("margin-left"),n.indexOf("margin")),o=a>0?n[a]:"margin-left";return i("margin"===o?r(t.get("margin"))[3]||0:t.get(o)||0)},t.calcStartBySymbol=function(e){return/\d.\d/.test(e)?e.split(".").pop()||null:/^\d/.test(e)?(parseInt(e,10)||1).toString():null}},29580:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(70655);n.__exportStar(r(90998),t),n.__exportStar(r(64282),t),n.__exportStar(r(37987),t),n.__exportStar(r(20036),t)},37987:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.transformWordToHtml=void 0;var n=r(70655),i=r(2394),a=r(589),o=r(18566);t.transformWordToHtml=function(e,t,r,s){var l={jodit:e,rtf:s};return t.forEach((function e(t){var r,a;if(t){try{for(var o=n.__values(i.cases),s=o.next();!s.done&&null!=(t=(0,s.value)(t,l));s=o.next());}catch(e){r={error:e}}finally{try{s&&!s.done&&(a=o.return)&&a.call(o)}finally{if(r)throw r.error}}null==t||t.forEach(e)}})),r&&t.forEach((function(e){e.style.clear()}),!0),(0,a.trim)((0,o.innerHTML)(t,(function(e){return!e.isComment})))}},35794:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.PasteFromWordPro=void 0;var n=r(70655),i=r(97029),a=r(11606),o=r(10728),s=r(82726),l=r(29580);r(78322);var u=r(47036),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t.prototype.insertFromWordByType=function(t,r,n,i){var s;if(!this.j.o.pasteFromWord.enable||n!==a.INSERT_AS_HTML&&n!==a.INSERT_AS_TEXT)return e.prototype.insertFromWordByType.call(this,t,r,n,i);if(r=(0,l.applyStylesPro)(this.j,r,n===a.INSERT_AS_TEXT,i.rtf),this.j.o.beautifyHTML){var c=null===(s=this.j.events)||void 0===s?void 0:s.fire("beautifyHTML",r);(0,o.isString)(c)&&(r=c)}(0,u.pasteInsertHtml)(t,this.j,r)},t}(s.pasteFromWord);t.PasteFromWordPro=c,i.Jodit.plugins.remove("pasteFromWord"),i.Jodit.plugins.add("pasteFromWordPro",c)}},function(e){return e(e.s=35794)}])}));
|
|
1
|
+
"use strict";!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(self,(function(){return(self.webpackChunkjodit_pro=self.webpackChunkjodit_pro||[]).push([[92],{68356:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.clearAttributes=void 0;var n=r(70655),i=["cellspacing","cellpadding","border","v:shapes","o:spid"];t.clearAttributes=function(e){var t,r;if(/^OLE_LINK\d+$/.test(e.attributes.name)&&(e.attributes.name=null,0===e.length))return e.remove(),null;"_GoBack"===e.attributes.name&&(e.attributes.name=null);try{for(var a=n.__values(i),o=a.next();!o.done;o=a.next()){var s=o.value;e.attributes[s]&&(e.attributes[s]=null)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}return e}},67635:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.clearClassName=void 0;var n=r(589);t.clearClassName=function(e){return e.attributes.class&&(e.attributes.class=e.attributes.class.replace(/(el\d+)|(font\d+)|msonormal|msolistparagraph\w*/gi,""),(0,n.trim)(e.attributes.class)||(e.attributes.class=null)),e}},57446:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.convertStyleUnitToPixels=void 0;var n=r(29580);t.convertStyleUnitToPixels=function(e,t){if(!t.jodit.o.pasteFromWord.convertUnitsToPixel)return e;var r=e.style;return r.forEach((function(e){var t=r.get(e);t&&r.set(e,t.toString().replace(/\d+(\.\d+)?(pt|cm)/g,(function(e){return(0,n.convertUnitToPx)(e)+"px"})))})),e}},44815:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.removeRedundancyStyle=t.convertToList=void 0;var n=r(29580),i=r(18566),a=r(11606),o=r(51330);function s(e){var t;!(0,i.isList)(e)||"li"===(null===(t=e.parent)||void 0===t?void 0:t.name)||"disc"!==e.style.get(o.STYLE_CSS_KEY)&&"decimal"!==e.style.get(o.STYLE_CSS_KEY)||e.style.set(o.STYLE_CSS_KEY,null)}t.convertToList=function(e){var t;if((0,i.isPseudoLeaf)(e)){e.name="li",e.style.set("text-indent",null);var r=l(e),a=/[\da-np-zA-NP-Z].?/.test(r)?"ol":"ul",u=function(e,t){for(var r in o.listStyleMap)if(RegExp(r).test(e))return o.listStyleMap[r];return"ol"===t?"decimal":"disc"}(r,a);e.attributes[o.TYPE_KEY]=a,e.attributes[o.STYLE_KEY]=u,(0,n.calcListLevels)(e),function(e){for(;e;){var t=e.previousElement;if(!(0,i.isLeaf)(t)&&!(0,i.isList)(t))break;if((0,i.isLeaf)(t)){if(t.attributes[o.LEVEL_KEY]>e.attributes[o.LEVEL_KEY])break;if(e.attributes[o.LEVEL_KEY]===t.attributes[o.LEVEL_KEY]&&e.parent&&(0,i.isSameType)(e,e.parent))break;t.append(e)}else{var r=t;if(r.attributes[o.LEVEL_KEY]>e.attributes[o.LEVEL_KEY])break;if(e.attributes[o.LEVEL_KEY]===r.attributes[o.LEVEL_KEY]&&!(0,i.isSameType)(e,r))break;r.append(e)}}}(e);var c=e.parent;if(!(0,i.isList)(c)||!(0,i.isSameType)(e,c)){var f=function(e,t,r,i){var a=e.wrap(t);return a.attributes.start=(0,n.calcStartBySymbol)(r),a.attributes[o.LEVEL_KEY]=e.attributes[o.LEVEL_KEY],a.attributes[o.STYLE_KEY]=e.attributes[o.STYLE_KEY],a.attributes[o.STYLE_VALID_KEY]=e.attributes[o.STYLE_KEY],a.style.set(o.STYLE_CSS_KEY,i),s(a),a}(e,a,r,u);return(0,i.isList)(c)&&(f.remove(),null===(t=c.lastElement)||void 0===t||t.append(f)),e}}return e},t.removeRedundancyStyle=s;var l=function(e){return e.textBetween((function(e){return e.isComment&&/\[if.*supportLists.*]/.test((0,i.html)(e))}),(function(e){return e.isComment&&/\[endif]/.test((0,i.html)(e))})).replace(/ /g,"").replace((0,a.SPACE_REG_EXP)(),"")}},2394:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.cases=void 0;var n=r(44815),i=r(68356),a=r(65302),o=r(75099),s=r(74587),l=r(57446),u=r(67635),c=r(35264),f=r(41925),d=r(83161),p=r(26549),m=r(40522);t.cases=[m.processImage,p.markPageBreakElements,a.removeExtraTags,o.replaceOldTags,i.clearAttributes,n.convertToList,c.processLinks,s.removeInsideComment,l.convertStyleUnitToPixels,u.clearClassName,f.normalizeImageProps,d.removeWidthFromTableCell]},26549:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.markPageBreakElements=void 0,t.markPageBreakElements=function(e){return(e.isElement&&"always"===e.style.get("page-break-before")||"page"===e.style.get("break-before"))&&(e.attributes["jd-safe"]=!0,e.style.add("page-break-before","always"),e.isSingle&&(e.name="div")),e}},41925:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeImageProps=void 0,t.normalizeImageProps=function(e){return e.isElement?("img"===e.name&&(e.attributes.align&&(e.style.add("float",e.attributes.align),e.attributes.align=null),e.attributes.hspace&&(e.style.add("marginLeft",e.attributes.hspace+"px"),e.style.add("marginRight",e.attributes.hspace+"px"),e.attributes.hspace=null)),e):e}},40522:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.processImage=void 0;var n=r(70655),i=r(75204);function a(e,t,r,i){var a,o,s=e.split(r);try{for(var l=n.__values(s),u=l.next();!u.done;u=l.next()){var c=u.value.split("shplid");if(c.length>1){for(var f=c[1],d="",p=0;f.length>p&&!/[{ \r\n\\]/.test(f[p]);p++)d+=f[p];var m=f.split("bliptag");if(m&&2>m.length)continue;var v=null;if(m[0].indexOf("pngblip")?v="image/png":-1!==m[0].indexOf("jpegblip")&&(v="image/jpeg"),!v)continue;var h=m[1].split("}");if(h&&2>h.length)continue;var y=void 0;if(h.length>2&&h[0].includes("blipuid"))y=h[1].split(" ");else{if((y=h[0].split(" "))&&2>y.length)continue;y.shift()}i[t+d]={hex:y.join(""),type:v}}}}catch(e){a={error:e}}finally{try{u&&!u.done&&(o=l.return)&&o.call(l)}finally{if(a)throw a.error}}}t.processImage=function(e,t){var r;if(t.rtf&&"#comment"===e.name&&e.attributes.nodeValue&&-1!==e.attributes.nodeValue.indexOf("<v:shape")){t.shapes||(t.shapes={});var n=t.jodit.create.fromHTML(e.attributes.nodeValue);return(0,i.toArray)(n.getElementsByTagName("v:shape")).forEach((function(e){t.shapes[e.id]=e.getAttribute("o:spid")})),e}if("img"!==e.name)return e;if(t.rtf&&e.attributes["v:shapes"]){var o=null===(r=t.shapes)||void 0===r?void 0:r[e.attributes["v:shapes"]];if(o){t.imageMap||(t.imageMap={},a(t.rtf,"i","\\shppict",t.imageMap),a(t.rtf,"s","\\shp{",t.imageMap));var s=t.imageMap[o.substring(7)];if(s){var l=[],u=s.hex.match(/[0-9a-f]{2}/gi);if(u){for(var c=0;u.length>c;c++)l.push(String.fromCharCode(parseInt(u[c],16)));e.attributes.src="data:"+s.type+";base64,"+btoa(l.join(""))}}}}return e}},35264:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.processLinks=void 0,t.processLinks=function(e,t){var r,n=null!==(r=t.links)&&void 0!==r?r:{};if(e.attributes.href&&e.attributes.href.match(/#.+$/)&&(n[e.attributes.href.match(/#(.+)$/)[1]]=e),e.attributes.name&&n[e.attributes.name]){var i=n[e.attributes.name];i.attributes.href=i.attributes.href.replace(/.*#(.*)$/,"#$1")}return t.links=n,e}},65302:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.removeExtraTags=void 0;var r=new Set(["o:p","xml","script","meta","link","v:imagedata","style"]);t.removeExtraTags=function(e){return"none"===e.style.get("display")||0===e.length&&"span"===e.name||r.has(e.name)?(e.remove(),null):e}},74587:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.removeInsideComment=void 0;var n=r(18566),i=0;t.removeInsideComment=function(e){return e.isComment&&/\[if.*(supportLists|gte vml).*]/.test((0,n.html)(e))&&(i++,e.remove()),e.isComment&&i>0&&(0,n.html)(e).includes("[endif]")&&(i=i>0?i-1:0,e.remove()),i&&(e.isText||"img"===e.name&&(!e.attributes.src||/^file:/.test(e.attributes.src)))?(e.remove(),null):e}},75099:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.replaceOldTags=void 0;var r={i:"em",b:"strong"};t.replaceOldTags=function(e){var t=e.name;return t in r&&(e.name=r[t]),e}},83161:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.removeWidthFromTableCell=void 0,t.removeWidthFromTableCell=function(e){return!e.attributes.width||"th"!==e.name&&"td"!==e.name||(e.attributes.width=null),e}},78322:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),r(85119).Config.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-autospace","text-justify","text-decoration","text-indent","vertical-align","width"]}},51330:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.listStyleMap=t.STYLE_CSS_KEY=t.STYLE_VALID_KEY=t.STYLE_KEY=t.TYPE_KEY=t.LEVEL_KEY=void 0,t.LEVEL_KEY="jd-list-level",t.TYPE_KEY="jd-list-type",t.STYLE_KEY="jd-list-style-type",t.STYLE_VALID_KEY="data-list-style-type",t.STYLE_CSS_KEY="list-style-type",t.listStyleMap={"·":"disc",o:"circle","§":"square","[ivx]":"lower-roman","[IVX]":"upper-roman","[a-z]":"lower-alpha","[A-Z]":"upper-alpha","\\d":"decimal"}},77800:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.isSameType=t.isPseudoLeaf=t.isLeaf=t.isList=void 0;var n=r(46801),i=r(51330);t.isList=function(e){return Boolean(e&&("ol"===e.name||"ul"===e.name))},t.isLeaf=function(e){return Boolean(e&&"li"===e.name)},t.isPseudoLeaf=function(e){return/mso-list:\s*l\d+ level\d+ lfo\d+/i.test(e.attributes.style)||/msolistparagraph/i.test(e.attributes.class)&&Boolean(e.find((function(e){return e.isComment&&(0,n.html)(e).includes("supportLists")})).length)},t.isSameType=function(e,t){return!(t.name!==e.attributes[i.TYPE_KEY]||t.attributes[i.STYLE_KEY]!==e.attributes[i.STYLE_KEY]||e.attributes[i.LEVEL_KEY]!==t.attributes[i.LEVEL_KEY])}},94616:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.JElement=void 0;var n=r(70655),i=r(44370),a=r(11606),o=r(75204),s=r(46801),l=r(15002),u=new Set(a.INSEPARABLE_TAGS),c=function(){function e(t,r){var n=this;this.parent=r,this.name=t.nodeName.toLowerCase(),this.type=t.nodeType,this.attributes=function(e){var t={};if(i.Dom.isElement(e))for(var r=0,n=e.attributes;n.length>r;r+=1)t[n[r].name]=n[r].value;else t.nodeValue=e.nodeValue;return t}(t),this.style=new l.Style(this.attributes.style),this.children=[],t.childNodes.forEach((function(t){return n.children.push(e.make(t,n))}))}return Object.defineProperty(e.prototype,"isText",{get:function(){return this.type===Node.TEXT_NODE},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isElement",{get:function(){return this.type===Node.ELEMENT_NODE},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isComment",{get:function(){return this.type===Node.COMMENT_NODE},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isSingle",{get:function(){return u.has(this.name)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this.children.length},enumerable:!1,configurable:!0}),e.make=function(t,r){return void 0===r&&(r=null),new e(t,r)},e.prototype.wrap=function(t){var r;(0,o.assert)(null!=this.parent,"You can't wrap the root element");var n=e.make(document.createElement(t),this.parent),i=null!==(r=this.parent.children.indexOf(this))&&void 0!==r?r:-1;return-1===i?this.parent.append(n):this.parent.children[i]=n,n.append(this),n},e.prototype.append=function(e){return(0,o.assert)(e!==this,"Forbidden to add to yourself"),e.remove(),this.children.push(e),e.parent=this,this},Object.defineProperty(e.prototype,"previousElement",{get:function(){if(!this.parent)return null;var e=this.parent.children,t=e.indexOf(this);if(-1!==t)for(var r=t-1;r>=0;r-=1)if(e[r].isElement)return e[r];return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastElement",{get:function(){for(var e=this.children,t=e.length-1;t>=0;t-=1)if(e[t].isElement)return e[t];return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"previous",{get:function(){var e,t,r;return null!==(r=null!==(e=this.sibling(!1))&&void 0!==e?e:null===(t=this.parent)||void 0===t?void 0:t.previous)&&void 0!==r?r:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"next",{get:function(){var e,t,r;return null!==(r=null!==(e=this.sibling(!0))&&void 0!==e?e:null===(t=this.parent)||void 0===t?void 0:t.next)&&void 0!==r?r:null},enumerable:!1,configurable:!0}),e.prototype.sibling=function(e){if(!this.parent)return null;var t=this.parent.children,r=t.indexOf(this);return-1!==r&&t[r+(e?1:-1)]?t[r+(e?1:-1)]:null},e.prototype.forEach=function(e,t){var r,i;void 0===t&&(t=!1);var a=n.__spreadArray([],n.__read(this.children),!1);try{for(var o=n.__values(a),s=o.next();!s.done;s=o.next()){var l=s.value;if(!1===e(l))return!1;if(t&&!1===l.forEach(e,!0))return!1}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}},e.prototype.find=function(e,t){void 0===t&&(t=!0);var r=[];return this.forEach((function(t){e(t)&&r.push(t)}),t),r},e.prototype.map=function(e){return this.children.map(e)},e.prototype.remove=function(){var e,t,r=null===(e=this.parent)||void 0===e?void 0:e.children.indexOf(this);return null!=r&&-1!==r&&(null===(t=this.parent)||void 0===t||t.children.splice(r,1)),this},e.prototype.textBetween=function(e,t){var r=!1,n=[];return this.forEach((function(i){if(!r&&e(i)&&(r=!0),r&&i.isText&&n.push((0,s.html)(i)),r&&t(i))return!1}),!0),n.join("")},e}();t.JElement=c},18566:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(70655);n.__exportStar(r(77800),t),n.__exportStar(r(94616),t),n.__exportStar(r(46801),t)},46801:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.innerHTML=t.html=void 0;var n=r(75204);function i(e,t,r,n){switch(void 0===t&&(t=function(){return!0}),void 0===r&&(r=!0),!0){case e.isComment:case e.isText:if(!t(e))return"";var i=e.attributes.nodeValue;return e.isComment?"\x3c!--".concat(i,"--\x3e"):i;case e.isElement:var l=e.attributes,u=o(e,t,r,n);if(!e.attributes["jd-safe"]&&r&&0===u.replace(/[\n\t]/g,"").length&&!e.isSingle)return"";var c=Object.keys(l).map((function(e){return"style"===e||null==l[e]||/^jd-/.test(e)?"":"".concat(e,'="').concat(s(l[e]),'"')})).filter(Boolean),f=s((0,e.style.str)((function(e){return a(e,n)})));if(f&&c.push('style="'.concat(f,'"')),r&&0===c.length&&["span","a"].includes(e.name))return u;var d=c.length?" "+c.join(" "):"";return t(e)?e.isSingle?"<".concat(e.name).concat(d,"/>"):"<".concat(e.name).concat(d,">").concat(u,"</").concat(e.name,">"):u}return""}function a(e,t){var r;if(!t)return!0;if(a.cache.has(t)){var i=null===(r=a.cache.get(t))||void 0===r?void 0:r.get(e);if((0,n.isBoolean)(i))return i}var o=t.some((function(t){return new RegExp(t).test(e)})),s=a.cache.get(t)||new Map;return s.set(e,o),a.cache.set(t,s),o}function o(e,t,r,a){void 0===t&&(t=function(){return!0}),void 0===r&&(r=!0);var o=e.map((function(e){return i(e,t,r,a)})).join("");return"p"===e.name&&0===(0,n.trim)(o).length&&(o=" "),o}function s(e){return e.toString().replace(/"/g,""")}t.html=i,a.cache=new WeakMap,t.innerHTML=o},15002:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.Style=void 0;var n=r(70655),i=r(75204),a=r(23112),o=function(){function e(e){this._data=s(e)}return Object.defineProperty(e.prototype,"keys",{get:function(){return Object.keys(this._data)},enumerable:!1,configurable:!0}),e.prototype.forEach=function(e){this.keys.forEach((function(t){return e(t)}))},e.prototype.clear=function(){this._data={}},e.prototype.set=function(e,t){this._data[e]=t},e.prototype.get=function(e){var t;return null!==(t=this._data[e])&&void 0!==t?t:null},e.prototype.add=function(e,t){return this._data=s(this.str()+";"+"".concat(e,":").concat(t)),this},e.prototype.str=function(e){var t=this;void 0===e&&(e=function(e){return!0});var r=Object.keys(this._data).filter((function(r){return r&&!/^mso-/.test(r)&&e(r)&&null!=t.get(r)}));return r.length?r.map((function(e){return"".concat((0,i.kebabCase)(e),":").concat(t.get(e))})).join(";"):""},n.__decorate([a.autobind],e)}();function s(e){return function(e){for(var t={},r=[],n=e.length-1;n>=0;n-=1){var i=e[n][0];t[i]||(t[i]=!0,r.unshift(e[n]))}return r}((null!=e?e:"").replace(/"/g,'"').split(";").filter(Boolean).map((function(e){return(0,i.trim)(e).split(":").map(i.trim)}))).reduce((function(e,t){var r=n.__read(t,2),i=r[0],a=r[1];return i&&a&&(e[i]=a),e}),{})}t.Style=o},64282:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.applyStylesPro=void 0;var n=r(75204),i=r(44370),a=r(37987),o=r(18566);t.applyStylesPro=function(e,t,r,s){var l,u;void 0===s&&(s="");var c=document.createElement("iframe");c.style.display="none",document.body.appendChild(c);try{var f=null!==(l=c.contentDocument)&&void 0!==l?l:null===(u=c.contentWindow)||void 0===u?void 0:u.document;if(!f)return t;f.open(),f.write(t),f.close();for(var d="jd-style",p=function(e){try{for(var t=f.styleSheets[e].cssRules,r=function(e){if(!t[e].selectorText)return"continue";(0,n.$$)(t[e].selectorText,f.body).forEach((function(r){(0,n.attr)(r,d)||((0,n.attr)(r,d,(0,n.attr)(r,"style")||""),(0,n.attr)(r,"style","")),(0,n.attr)(r,"style","".concat((0,n.attr)(r,"style"),";").concat(t[e].style.cssText))}))},i=0;t.length>i;i+=1)r(i)}catch(e){}},m=0;f.styleSheets.length>m;m+=1)p(m);return(0,n.$$)("[".concat(d,"]"),f.body).forEach((function(e){(0,n.attr)(e,"style","".concat((0,n.attr)(e,"style"),";").concat((0,n.attr)(e,d)))})),(0,a.transformWordToHtml)(e,o.JElement.make(f.body),r,s)}finally{i.Dom.safeRemove(c)}return t}},20036:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.calcListLevels=void 0;var n=r(70655),i=r(18566),a=r(51330),o=r(90998);t.calcListLevels=function(e){if(void 0===e.attributes[a.LEVEL_KEY]){for(var t=[(0,o.realPixelIndent)(e)],r=[e],s=e.next;s;){if(s.isElement&&!s.attributes[a.LEVEL_KEY]&&(0,i.isPseudoLeaf)(s)){var l=(0,o.realPixelIndent)(s);l&&(t.push(l),r.push(s))}s=s.next}var u=Math.min.apply(Math,n.__spreadArray([],n.__read(t.filter((function(e){return e>0}))),!1)),c=t.map((function(e){return Math.ceil(e/10)}));-1!==c.indexOf(0)&&(c=c.map((function(e){return e+1}))),r.forEach((function(e,t){e.attributes[a.LEVEL_KEY]=c[t],e.style.add("margin-left","".concat(Math.max((0,o.realPixelIndent)(e)-10*c[t]/u*40,0),"px"))}))}}},90998:function(e,t){function r(e){if(!e)return[0,0,0,0];var t=e.match(/(0|auto|(-?[.\d]+(?:\w+|%)))/g)||["0px"];switch(t.length){case 2:return[0,1,0,1].map((function(e){return t[e]}));case 3:return[0,1,2,1].map((function(e){return t[e]}));case 4:return[0,1,2,3].map((function(e){return t[e]}));default:return[0,0,0,0].map((function(e){return t[e]}))}}var n;function i(e){if("number"==typeof e)return e;if(/%$/.test(e))return 0;n||(n=document.createElement("div"),Object.assign(n.style,{position:"absolute",left:"-9999px",top:"-9999px",margin:"0",padding:"0",border:"0"}),document.body.append(n),setTimeout((function(){null==n||n.remove(),n=null})));var t=0>parseFloat(e);t&&(e=e.replace("-","")),n.style.width=e;var r=n.clientWidth;return t?-r:r}Object.defineProperty(t,"__esModule",{value:!0}),t.calcStartBySymbol=t.realPixelIndent=t.convertUnitToPx=t.calcMarginParts=void 0,t.calcMarginParts=r,t.convertUnitToPx=i,t.realPixelIndent=function(e){var t=e.style,n=t.keys.filter((function(e){return/margin/.test(e)})),a=Math.max(n.indexOf("margin-left"),n.indexOf("margin")),o=a>0?n[a]:"margin-left";return i("margin"===o?r(t.get("margin"))[3]||0:t.get(o)||0)},t.calcStartBySymbol=function(e){return/\d.\d/.test(e)?e.split(".").pop()||null:/^\d/.test(e)?(parseInt(e,10)||1).toString():null}},29580:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var n=r(70655);n.__exportStar(r(90998),t),n.__exportStar(r(64282),t),n.__exportStar(r(37987),t),n.__exportStar(r(20036),t)},37987:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.transformWordToHtml=void 0;var n=r(70655),i=r(2394),a=r(589),o=r(18566);t.transformWordToHtml=function(e,t,r,s){var l={jodit:e,rtf:s};return t.forEach((function e(t){var r,a;if(t){try{for(var o=n.__values(i.cases),s=o.next();!s.done&&null!=(t=(0,s.value)(t,l));s=o.next());}catch(e){r={error:e}}finally{try{s&&!s.done&&(a=o.return)&&a.call(o)}finally{if(r)throw r.error}}null==t||t.forEach(e)}})),r&&t.forEach((function(e){e.style.clear()}),!0),(0,a.trim)((0,o.innerHTML)(t,(function(e){return!e.isComment}),!0,e.o.pasteFromWord.allowedStyleProps))}},35794:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.PasteFromWordPro=void 0;var n=r(70655),i=r(97029),a=r(11606),o=r(10728),s=r(82726),l=r(29580);r(78322);var u=r(47036),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t.prototype.insertFromWordByType=function(t,r,n,i){var s;if(!this.j.o.pasteFromWord.enable||n!==a.INSERT_AS_HTML&&n!==a.INSERT_AS_TEXT)return e.prototype.insertFromWordByType.call(this,t,r,n,i);if(r=(0,l.applyStylesPro)(this.j,r,n===a.INSERT_AS_TEXT,i.rtf),this.j.o.beautifyHTML){var c=null===(s=this.j.events)||void 0===s?void 0:s.fire("beautifyHTML",r);(0,o.isString)(c)&&(r=c)}(0,u.pasteInsertHtml)(t,this.j,r)},t}(s.pasteFromWord);t.PasteFromWordPro=c,i.Jodit.plugins.remove("pasteFromWord"),i.Jodit.plugins.add("pasteFromWordPro",c)}},function(e){return e(e.s=35794)}])}));
|
|
@@ -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 r=t();for(var a in r)("object"==typeof exports?exports:e)[a]=r[a]}})(self,(function(){return(self.webpackChunkjodit_pro=self.webpackChunkjodit_pro||[]).push([[92],{68356(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.clearAttributes=void 0;var a=r(70655),i=["cellspacing","cellpadding","border","v:shapes","o:spid"];t.clearAttributes=e=>{var t,r;if(/^OLE_LINK\d+$/.test(e.attributes.name)&&(e.attributes.name=null,0===e.length))return e.remove(),null;"_GoBack"===e.attributes.name&&(e.attributes.name=null);try{for(var n=a.__values(i),s=n.next();!s.done;s=n.next()){var l=s.value;e.attributes[l]&&(e.attributes[l]=null)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}return e}},67635(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.clearClassName=void 0;var a=r(589);t.clearClassName=e=>(e.attributes.class&&(e.attributes.class=e.attributes.class.replace(/(el\d+)|(font\d+)|msonormal|msolistparagraph\w*/gi,""),(0,a.trim)(e.attributes.class)||(e.attributes.class=null)),e)},57446(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.convertStyleUnitToPixels=void 0;var a=r(29580);t.convertStyleUnitToPixels=(e,t)=>{if(!t.jodit.o.pasteFromWord.convertUnitsToPixel)return e;var r=e.style;return r.forEach((e=>{var t=r.get(e);t&&r.set(e,(""+t).replace(/\d+(\.\d+)?(pt|cm)/g,(e=>(0,a.convertUnitToPx)(e)+"px")))})),e}},44815(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.removeRedundancyStyle=t.convertToList=void 0;var a=r(29580),i=r(18566),n=r(11606),s=r(51330);function l(e){var t;!(0,i.isList)(e)||"li"===(null===(t=e.parent)||void 0===t?void 0:t.name)||"disc"!==e.style.get(s.STYLE_CSS_KEY)&&"decimal"!==e.style.get(s.STYLE_CSS_KEY)||e.style.set(s.STYLE_CSS_KEY,null)}t.convertToList=e=>{var t;if((0,i.isPseudoLeaf)(e)){e.name="li",e.style.set("text-indent",null);var r=o(e),n=/[\da-np-zA-NP-Z].?/.test(r)?"ol":"ul",u=((e,t)=>{for(var r in s.listStyleMap)if(RegExp(r).test(e))return s.listStyleMap[r];return"ol"===t?"decimal":"disc"})(r,n);e.attributes[s.TYPE_KEY]=n,e.attributes[s.STYLE_KEY]=u,(0,a.calcListLevels)(e),(e=>{for(;e;){var t=e.previousElement;if(!(0,i.isLeaf)(t)&&!(0,i.isList)(t))break;if((0,i.isLeaf)(t)){if(t.attributes[s.LEVEL_KEY]>e.attributes[s.LEVEL_KEY])break;if(e.attributes[s.LEVEL_KEY]===t.attributes[s.LEVEL_KEY]&&e.parent&&(0,i.isSameType)(e,e.parent))break;t.append(e)}else{var r=t;if(r.attributes[s.LEVEL_KEY]>e.attributes[s.LEVEL_KEY])break;if(e.attributes[s.LEVEL_KEY]===r.attributes[s.LEVEL_KEY]&&!(0,i.isSameType)(e,r))break;r.append(e)}}})(e);var p=e.parent;if(!(0,i.isList)(p)||!(0,i.isSameType)(e,p)){var d=((e,t,r,i)=>{var n=e.wrap(t);return n.attributes.start=(0,a.calcStartBySymbol)(r),n.attributes[s.LEVEL_KEY]=e.attributes[s.LEVEL_KEY],n.attributes[s.STYLE_KEY]=e.attributes[s.STYLE_KEY],n.attributes[s.STYLE_VALID_KEY]=e.attributes[s.STYLE_KEY],n.style.set(s.STYLE_CSS_KEY,i),l(n),n})(e,n,r,u);return(0,i.isList)(p)&&(d.remove(),null===(t=p.lastElement)||void 0===t||t.append(d)),e}}return e},t.removeRedundancyStyle=l;var o=e=>e.textBetween((e=>e.isComment&&/\[if.*supportLists.*]/.test((0,i.html)(e))),(e=>e.isComment&&/\[endif]/.test((0,i.html)(e)))).replace(/ /g,"").replace((0,n.SPACE_REG_EXP)(),"")},2394(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.cases=void 0;var a=r(44815),i=r(68356),n=r(65302),s=r(75099),l=r(74587),o=r(57446),u=r(67635),p=r(35264),d=r(41925),c=r(83161),f=r(26549),m=r(40522);t.cases=[m.processImage,f.markPageBreakElements,n.removeExtraTags,s.replaceOldTags,i.clearAttributes,a.convertToList,p.processLinks,l.removeInsideComment,o.convertStyleUnitToPixels,u.clearClassName,d.normalizeImageProps,c.removeWidthFromTableCell]},26549(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.markPageBreakElements=void 0,t.markPageBreakElements=e=>((e.isElement&&"always"===e.style.get("page-break-before")||"page"===e.style.get("break-before"))&&(e.attributes["jd-safe"]=!0,e.style.add("page-break-before","always"),e.isSingle&&(e.name="div")),e)},41925(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeImageProps=void 0,t.normalizeImageProps=e=>e.isElement?("img"===e.name&&(e.attributes.align&&(e.style.add("float",e.attributes.align),e.attributes.align=null),e.attributes.hspace&&(e.style.add("marginLeft",e.attributes.hspace+"px"),e.style.add("marginRight",e.attributes.hspace+"px"),e.attributes.hspace=null)),e):e},40522(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.processImage=void 0;var a=r(70655),i=r(75204);function n(e,t,r,i){var n,s,l=e.split(r);try{for(var o=a.__values(l),u=o.next();!u.done;u=o.next()){var p=u.value.split("shplid");if(p.length>1){for(var d=p[1],c="",f=0;d.length>f&&!/[{ \r\n\\]/.test(d[f]);f++)c+=d[f];var m=d.split("bliptag");if(m&&2>m.length)continue;var v=null;if(m[0].indexOf("pngblip")?v="image/png":-1!==m[0].indexOf("jpegblip")&&(v="image/jpeg"),!v)continue;var h=m[1].split("}");if(h&&2>h.length)continue;var y=void 0;if(h.length>2&&h[0].includes("blipuid"))y=h[1].split(" ");else{if((y=h[0].split(" "))&&2>y.length)continue;y.shift()}i[t+c]={hex:y.join(""),type:v}}}}catch(e){n={error:e}}finally{try{u&&!u.done&&(s=o.return)&&s.call(o)}finally{if(n)throw n.error}}}t.processImage=(e,t)=>{var r;if(t.rtf&&"#comment"===e.name&&e.attributes.nodeValue&&-1!==e.attributes.nodeValue.indexOf("<v:shape")){t.shapes||(t.shapes={});var a=t.jodit.create.fromHTML(e.attributes.nodeValue);return(0,i.toArray)(a.getElementsByTagName("v:shape")).forEach((e=>{t.shapes[e.id]=e.getAttribute("o:spid")})),e}if("img"!==e.name)return e;if(t.rtf&&e.attributes["v:shapes"]){var s=null===(r=t.shapes)||void 0===r?void 0:r[e.attributes["v:shapes"]];if(s){t.imageMap||(t.imageMap={},n(t.rtf,"i","\\shppict",t.imageMap),n(t.rtf,"s","\\shp{",t.imageMap));var l=t.imageMap[s.substring(7)];if(l){var o=[],u=l.hex.match(/[0-9a-f]{2}/gi);if(u){for(var p=0;u.length>p;p++)o.push(String.fromCharCode(parseInt(u[p],16)));e.attributes.src="data:"+l.type+";base64,"+btoa(o.join(""))}}}}return e}},35264(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.processLinks=void 0,t.processLinks=(e,t)=>{var r,a=null!==(r=t.links)&&void 0!==r?r:{};if(e.attributes.href&&e.attributes.href.match(/#.+$/)&&(a[e.attributes.href.match(/#(.+)$/)[1]]=e),e.attributes.name&&a[e.attributes.name]){var i=a[e.attributes.name];i.attributes.href=i.attributes.href.replace(/.*#(.*)$/,"#$1")}return t.links=a,e}},65302(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.removeExtraTags=void 0;var r=new Set(["o:p","xml","script","meta","link","v:imagedata","style"]);t.removeExtraTags=e=>"none"===e.style.get("display")||0===e.length&&"span"===e.name||r.has(e.name)?(e.remove(),null):e},74587(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.removeInsideComment=void 0;var a=r(18566),i=0;t.removeInsideComment=e=>(e.isComment&&/\[if.*(supportLists|gte vml).*]/.test((0,a.html)(e))&&(i++,e.remove()),e.isComment&&i>0&&(0,a.html)(e).includes("[endif]")&&(i=i>0?i-1:0,e.remove()),i&&(e.isText||"img"===e.name&&(!e.attributes.src||/^file:/.test(e.attributes.src)))?(e.remove(),null):e)},75099(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.replaceOldTags=void 0;var r={i:"em",b:"strong"};t.replaceOldTags=e=>{var t=e.name;return t in r&&(e.name=r[t]),e}},83161(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.removeWidthFromTableCell=void 0,t.removeWidthFromTableCell=e=>(!e.attributes.width||"th"!==e.name&&"td"!==e.name||(e.attributes.width=null),e)},78322(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),r(85119).Config.prototype.pasteFromWord={enable:!1,convertUnitsToPixel:!1}},51330(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.listStyleMap=t.STYLE_CSS_KEY=t.STYLE_VALID_KEY=t.STYLE_KEY=t.TYPE_KEY=t.LEVEL_KEY=void 0,t.LEVEL_KEY="jd-list-level",t.TYPE_KEY="jd-list-type",t.STYLE_KEY="jd-list-style-type",t.STYLE_VALID_KEY="data-list-style-type",t.STYLE_CSS_KEY="list-style-type",t.listStyleMap={"·":"disc",o:"circle","§":"square","[ivx]":"lower-roman","[IVX]":"upper-roman","[a-z]":"lower-alpha","[A-Z]":"upper-alpha","\\d":"decimal"}},77800(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.isSameType=t.isPseudoLeaf=t.isLeaf=t.isList=void 0;var a=r(46801),i=r(51330);t.isList=e=>!(!e||"ol"!==e.name&&"ul"!==e.name),t.isLeaf=e=>!(!e||"li"!==e.name),t.isPseudoLeaf=e=>/mso-list:\s*l\d+ level\d+ lfo\d+/i.test(e.attributes.style)||/msolistparagraph/i.test(e.attributes.class)&&!!e.find((e=>e.isComment&&(0,a.html)(e).includes("supportLists"))).length,t.isSameType=(e,t)=>!(t.name!==e.attributes[i.TYPE_KEY]||t.attributes[i.STYLE_KEY]!==e.attributes[i.STYLE_KEY]||e.attributes[i.LEVEL_KEY]!==t.attributes[i.LEVEL_KEY])},91127(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.JElement=void 0;var a=r(70655),i=r(44370),n=r(11606),s=r(75204),l=r(46801),o=r(15002),u=new Set(n.INSEPARABLE_TAGS),p=function(){function e(t,r){var a=this;this.parent=r,this.name=t.nodeName.toLowerCase(),this.type=t.nodeType,this.attributes=(e=>{var t={};if(i.Dom.isElement(e))for(var r=0,a=e.attributes;a.length>r;r+=1)t[a[r].name]=a[r].value;else t.nodeValue=e.nodeValue;return t})(t),this.style=new o.Style(this.attributes.style),this.children=[],t.childNodes.forEach((t=>a.children.push(e.make(t,a))))}return Object.defineProperty(e.prototype,"isText",{get(){return this.type===Node.TEXT_NODE},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"html",{get(){return(0,l.html)(this)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isElement",{get(){return this.type===Node.ELEMENT_NODE},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isComment",{get(){return this.type===Node.COMMENT_NODE},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isSingle",{get(){return u.has(this.name)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"length",{get(){return this.children.length},enumerable:!1,configurable:!0}),e.make=(t,r)=>(void 0===r&&(r=null),new e(t,r)),e.prototype.wrap=function(t){var r;(0,s.assert)(null!=this.parent,"You can't wrap the root element");var a=e.make(document.createElement(t),this.parent),i=null!==(r=this.parent.children.indexOf(this))&&void 0!==r?r:-1;return-1===i?this.parent.append(a):this.parent.children[i]=a,a.append(this),a},e.prototype.append=function(e){return(0,s.assert)(e!==this,"Forbidden to add to yourself"),e.remove(),this.children.push(e),e.parent=this,this},Object.defineProperty(e.prototype,"previousElement",{get(){if(!this.parent)return null;var e=this.parent.children,t=e.indexOf(this);if(-1!==t)for(var r=t-1;r>=0;r-=1)if(e[r].isElement)return e[r];return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastElement",{get(){for(var e=this.children,t=e.length-1;t>=0;t-=1)if(e[t].isElement)return e[t];return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"previous",{get(){var e,t,r;return null!==(r=null!==(e=this.sibling(!1))&&void 0!==e?e:null===(t=this.parent)||void 0===t?void 0:t.previous)&&void 0!==r?r:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"next",{get(){var e,t,r;return null!==(r=null!==(e=this.sibling(!0))&&void 0!==e?e:null===(t=this.parent)||void 0===t?void 0:t.next)&&void 0!==r?r:null},enumerable:!1,configurable:!0}),e.prototype.sibling=function(e){if(!this.parent)return null;var t=this.parent.children,r=t.indexOf(this);return-1!==r&&t[r+(e?1:-1)]?t[r+(e?1:-1)]:null},e.prototype.forEach=function(e,t){var r,i;void 0===t&&(t=!1);var n=a.__spreadArray([],a.__read(this.children),!1);try{for(var s=a.__values(n),l=s.next();!l.done;l=s.next()){var o=l.value;if(!1===e(o))return!1;if(t&&!1===o.forEach(e,!0))return!1}}catch(e){r={error:e}}finally{try{l&&!l.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}},e.prototype.find=function(e,t){void 0===t&&(t=!0);var r=[];return this.forEach((t=>{e(t)&&r.push(t)}),t),r},e.prototype.map=function(e){return this.children.map(e)},e.prototype.remove=function(){var e,t,r=null===(e=this.parent)||void 0===e?void 0:e.children.indexOf(this);return null!=r&&-1!==r&&(null===(t=this.parent)||void 0===t||t.children.splice(r,1)),this},e.prototype.textBetween=function(e,t){var r=!1,a=[];return this.forEach((i=>{if(!r&&e(i)&&(r=!0),r&&i.isText&&a.push((0,l.html)(i)),r&&t(i))return!1}),!0),a.join("")},e}();t.JElement=p},18566(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var a=r(70655);a.__exportStar(r(77800),t),a.__exportStar(r(91127),t),a.__exportStar(r(46801),t)},46801(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.innerHTML=t.html=void 0;var a=r(75204);function i(e,t,r){switch(void 0===t&&(t=()=>!0),void 0===r&&(r=!0),!0){case e.isComment:case e.isText:if(!t(e))return"";var a=e.attributes.nodeValue;return e.isComment?"\x3c!--".concat(a,"--\x3e"):a;case e.isElement:var i=e.attributes,l=n(e,t,r);if(!e.attributes["jd-safe"]&&r&&0===l.replace(/[\n\t]/g,"").length&&!e.isSingle)return"";var o=Object.keys(i).map((e=>"style"===e||null==i[e]||/^jd-/.test(e)?"":"".concat(e,'="').concat(s(i[e]),'"'))).filter(Boolean),u=e.style.str;if(u&&o.push('style="'.concat(s(u),'"')),r&&0===o.length&&["span","a"].includes(e.name))return l;var p=o.length?" "+o.join(" "):"";return t(e)?e.isSingle?"<".concat(e.name).concat(p,"/>"):"<".concat(e.name).concat(p,">").concat(l,"</").concat(e.name,">"):l}return""}function n(e,t,r){void 0===t&&(t=()=>!0),void 0===r&&(r=!0);var n=e.map((e=>i(e,t,r))).join("");return"p"===e.name&&0===(0,a.trim)(n).length&&(n=" "),n}function s(e){return(""+e).replace(/"/g,""")}t.html=i,t.innerHTML=n},15002(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.Style=void 0;var a=r(70655),i=r(75204),n=function(){function e(e){this._data=s(e)}return Object.defineProperty(e.prototype,"keys",{get(){return Object.keys(this._data)},enumerable:!1,configurable:!0}),e.prototype.forEach=function(e){this.keys.forEach((t=>e(t)))},e.prototype.clear=function(){this._data={}},e.prototype.set=function(e,t){this._data[e]=t},e.prototype.get=function(e){var t;return null!==(t=this._data[e])&&void 0!==t?t:null},e.prototype.add=function(e,t){return this._data=s(this.str+";"+"".concat(e,":").concat(t)),this},Object.defineProperty(e.prototype,"str",{get(){var e=this,t=Object.keys(this._data).filter((t=>t&&!/^mso-/.test(t)&&null!=e.get(t)));return t.length?t.map((t=>"".concat((0,i.kebabCase)(t),":").concat(e.get(t)))).join(";"):""},enumerable:!1,configurable:!0}),e}();function s(e){return(e=>{for(var t={},r=[],a=e.length-1;a>=0;a-=1){var i=e[a][0];t[i]||(t[i]=!0,r.unshift(e[a]))}return r})((null!=e?e:"").replace(/"/g,'"').split(";").filter(Boolean).map((e=>(0,i.trim)(e).split(":").map(i.trim)))).reduce(((e,t)=>{var r=a.__read(t,2),i=r[0],n=r[1];return i&&n&&(e[i]=n),e}),{})}t.Style=n},64282(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.applyStylesPro=void 0;var a=r(75204),i=r(44370),n=r(37987),s=r(18566);t.applyStylesPro=(e,t,r,l)=>{var o,u;void 0===l&&(l="");var p=document.createElement("iframe");p.style.display="none",document.body.appendChild(p);try{var d=null!==(o=p.contentDocument)&&void 0!==o?o:null===(u=p.contentWindow)||void 0===u?void 0:u.document;if(!d)return t;d.open(),d.write(t),d.close();for(var c="jd-style",f=e=>{try{for(var t=d.styleSheets[e].cssRules,r=e=>{if(!t[e].selectorText)return"continue";(0,a.$$)(t[e].selectorText,d.body).forEach((r=>{(0,a.attr)(r,c)||((0,a.attr)(r,c,(0,a.attr)(r,"style")||""),(0,a.attr)(r,"style","")),(0,a.attr)(r,"style","".concat((0,a.attr)(r,"style"),";").concat(t[e].style.cssText))}))},i=0;t.length>i;i+=1)r(i)}catch(e){}},m=0;d.styleSheets.length>m;m+=1)f(m);return(0,a.$$)("[jd-style]",d.body).forEach((e=>{(0,a.attr)(e,"style","".concat((0,a.attr)(e,"style"),";").concat((0,a.attr)(e,c)))})),(0,n.transformWordToHtml)(e,s.JElement.make(d.body),r,l)}finally{i.Dom.safeRemove(p)}return t}},20036(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.calcListLevels=void 0;var a=r(70655),i=r(18566),n=r(51330),s=r(90998);t.calcListLevels=e=>{if(void 0===e.attributes[n.LEVEL_KEY]){for(var t=[(0,s.realPixelIndent)(e)],r=[e],l=e.next;l;){if(l.isElement&&!l.attributes[n.LEVEL_KEY]&&(0,i.isPseudoLeaf)(l)){var o=(0,s.realPixelIndent)(l);o&&(t.push(o),r.push(l))}l=l.next}var u=Math.min.apply(Math,a.__spreadArray([],a.__read(t.filter((e=>e>0))),!1)),p=t.map((e=>Math.ceil(e/10)));-1!==p.indexOf(0)&&(p=p.map((e=>e+1))),r.forEach(((e,t)=>{e.attributes[n.LEVEL_KEY]=p[t],e.style.add("margin-left","".concat(Math.max((0,s.realPixelIndent)(e)-10*p[t]/u*40,0),"px"))}))}}},90998(e,t){function r(e){if(!e)return[0,0,0,0];var t=e.match(/(0|auto|(-?[.\d]+(?:\w+|%)))/g)||["0px"];switch(t.length){case 2:return[0,1,0,1].map((e=>t[e]));case 3:return[0,1,2,1].map((e=>t[e]));case 4:return[0,1,2,3].map((e=>t[e]));default:return[0,0,0,0].map((e=>t[e]))}}var a;function i(e){if("number"==typeof e)return e;if(/%$/.test(e))return 0;a||(a=document.createElement("div"),Object.assign(a.style,{position:"absolute",left:"-9999px",top:"-9999px",margin:"0",padding:"0",border:"0"}),document.body.append(a),setTimeout((()=>{null==a||a.remove(),a=null})));var t=0>parseFloat(e);t&&(e=e.replace("-","")),a.style.width=e;var r=a.clientWidth;return t?-r:r}Object.defineProperty(t,"__esModule",{value:!0}),t.calcStartBySymbol=t.realPixelIndent=t.convertUnitToPx=t.calcMarginParts=void 0,t.calcMarginParts=r,t.convertUnitToPx=i,t.realPixelIndent=e=>{var t=e.style,a=t.keys.filter((e=>/margin/.test(e))),n=Math.max(a.indexOf("margin-left"),a.indexOf("margin")),s=n>0?a[n]:"margin-left";return i("margin"===s?r(t.get("margin"))[3]||0:t.get(s)||0)},t.calcStartBySymbol=e=>/\d.\d/.test(e)?e.split(".").pop()||null:/^\d/.test(e)?""+(parseInt(e,10)||1):null},29580(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var a=r(70655);a.__exportStar(r(90998),t),a.__exportStar(r(64282),t),a.__exportStar(r(37987),t),a.__exportStar(r(20036),t)},37987(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.transformWordToHtml=void 0;var a=r(70655),i=r(2394),n=r(589),s=r(18566);t.transformWordToHtml=(e,t,r,l)=>{var o={jodit:e,rtf:l};return t.forEach((function e(t){var r,n;if(t){try{for(var s=a.__values(i.cases),l=s.next();!l.done&&null!=(t=(0,l.value)(t,o));l=s.next());}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}null==t||t.forEach(e)}})),r&&t.forEach((e=>{e.style.clear()}),!0),(0,n.trim)((0,s.innerHTML)(t,(e=>!e.isComment)))}},35794(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.PasteFromWordPro=void 0;var a=r(70655),i=r(97029),n=r(11606),s=r(10728),l=r(82726),o=r(29580);r(78322);var u=r(47036),p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return a.__extends(t,e),t.prototype.insertFromWordByType=function(t,r,a,i){var l;if(!this.j.o.pasteFromWord.enable||a!==n.INSERT_AS_HTML&&a!==n.INSERT_AS_TEXT)return e.prototype.insertFromWordByType.call(this,t,r,a,i);if(r=(0,o.applyStylesPro)(this.j,r,a===n.INSERT_AS_TEXT,i.rtf),this.j.o.beautifyHTML){var p=null===(l=this.j.events)||void 0===l?void 0:l.fire("beautifyHTML",r);(0,s.isString)(p)&&(r=p)}(0,u.pasteInsertHtml)(t,this.j,r)},t}(l.pasteFromWord);t.PasteFromWordPro=p,i.Jodit.plugins.remove("pasteFromWord"),i.Jodit.plugins.add("pasteFromWordPro",p)}},e=>e(e.s=35794)])}));
|
|
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],{75293(t,e,n){n.r(e),n.d(e,{PasteFromWordPro:()=>B});var r=n(5846),s=n(11606),i=n(10728),a=n(33075);let l;function o(t){if("number"==typeof t)return t;if(/%$/.test(t))return 0;l||(l=document.createElement("div"),Object.assign(l.style,{position:"absolute",left:"-9999px",top:"-9999px",margin:"0",padding:"0",border:"0"}),document.body.append(l),setTimeout((()=>{null==l||l.remove(),l=null})));const e=0>parseFloat(t);e&&(t=t.replace("-","")),l.style.width=t;const n=l.clientWidth;return e?-n:n}function u(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=(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=n[3]||0):a=e.get(i)||0,o(a)}var c=n(91037),p=n(44370);function d(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=f(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}="${m(s[t])}"`)).filter(Boolean),{str:l}=t.style,o=m(l((t=>h(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 h(t,e){var n;if(!e)return!0;if(h.cache.has(e)){const r=null===(n=h.cache.get(e))||void 0===n?void 0:n.get(t);if((0,c.isBoolean)(r))return r}const r=e.some((e=>RegExp(e).test(t))),s=h.cache.get(e)||new Map;return s.set(t,r),h.cache.set(e,s),r}function f(t,e=(()=>!0),n=!0,r){let s=t.map((t=>d(t,e,n,r))).join("");return"p"===t.name&&0===(0,c.trim)(s).length&&(s=" "),s}function m(t){return(""+t).replace(/"/g,""")}h.cache=new WeakMap;const g="jd-list-level",b="jd-list-type",y="jd-list-style-type",v="list-style-type",x={"·":"disc",o:"circle","§":"square","[ivx]":"lower-roman","[IVX]":"upper-roman","[a-z]":"lower-alpha","[A-Z]":"upper-alpha","\\d":"decimal"};function E(t){return!(!t||"ol"!==t.name&&"ul"!==t.name)}function j(t){return!(!t||"li"!==t.name)}function k(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&&d(t).includes("supportLists"))).length}function w(t,e){return!(e.name!==t.attributes[b]||e.attributes[y]!==t.attributes[y]||t.attributes[g]!==e.attributes[g])}var T=n(70655),$=n(41257);let _=class{constructor(t){this._data=O(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=O(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)));return e.length?e.map((t=>`${(0,c.kebabCase)(t)}:${this.get(t)}`)).join(";"):""}};function O(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,c.trim)(t).split(":").map(c.trim)))).reduce(((t,[e,n])=>(e&&n&&(t[e]=n),t)),{})}_=(0,T.gn)([$.autobind],_);const S=new Set(s.INSEPARABLE_TAGS);class C{constructor(t,e){this.parent=e,this.name=t.nodeName.toLowerCase(),this.type=t.nodeType,this.attributes=(t=>{const e={};if(p.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 _(this.attributes.style),this.children=[],t.childNodes.forEach((t=>this.children.push(C.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 S.has(this.name)}get length(){return this.children.length}static make(t,e=null){return new C(t,e)}wrap(t){var e;(0,c.assert)(null!=this.parent,"You can't wrap the root element");const n=C.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,c.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(d(s)),n&&e(s))return!1}),!0),r.join("")}}const M=["cellspacing","cellpadding","border","v:shapes","o:spid"],N=new Set(["o:p","xml","script","meta","link","v:imagedata","style"]),L={i:"em",b:"strong"};let P=0;var R=n(589);function W(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 A=[(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,c.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={},W(e.rtf,"i","\\shppict",e.imageMap),W(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||N.has(t.name)?(t.remove(),null):t,t=>{const{name:e}=t;return e in L&&(t.name=L[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 M)t.attributes[e]&&(t.attributes[e]=null);return t},t=>{var e;if(k(t)){t.name="li",t.style.set("text-indent",null);const n=(t=>t.textBetween((t=>t.isComment&&/\[if.*supportLists.*]/.test(d(t))),(t=>t.isComment&&/\[endif]/.test(d(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 x)if(RegExp(e).test(t))return x[e];return"ol"===e?"decimal":"disc"})(n,r);t.attributes[b]=r,t.attributes[y]=i,(t=>{if(void 0!==t.attributes[g])return;const e=[u(t)],n=[t];let r=t.next;for(;r;){if(r.isElement&&!r.attributes[g]&&k(r)){const t=u(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[g]=i[e],t.style.add("margin-left",Math.max(u(t)-10*i[e]/s*40,0)+"px")}))})(t),(t=>{for(;t;){const e=t.previousElement;if(!j(e)&&!E(e))break;if(j(e)){if(e.attributes[g]>t.attributes[g])break;if(t.attributes[g]===e.attributes[g]&&t.parent&&w(t,t.parent))break;e.append(t);continue}const n=e;if(n.attributes[g]>t.attributes[g])break;if(t.attributes[g]===n.attributes[g]&&!w(t,n))break;n.append(t)}})(t);const{parent:a}=t;if(!E(a)||!w(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[g]=t.attributes[g],s.attributes[y]=t.attributes[y],s.attributes["data-list-style-type"]=t.attributes[y],s.style.set(v,r),(t=>{var e;!E(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)})(s),s})(t,r,n,i);return E(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(d(t))&&(P++,t.remove()),t.isComment&&P>0&&d(t).includes("[endif]")&&(P=P>0?P-1:0,t.remove()),P&&(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=>o(t)+"px")))})),t},t=>(t.attributes.class&&(t.attributes.class=t.attributes.class.replace(/(el\d+)|(font\d+)|msonormal|msolistparagraph\w*/gi,""),(0,R.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)];n(85119).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-autospace","text-justify","text-decoration","text-indent","vertical-align","width"]};var F=n(47036);class B 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,c.$$)(e[t].selectorText,l.body).forEach((n=>{(0,c.attr)(n,o)||((0,c.attr)(n,o,(0,c.attr)(n,"style")||""),(0,c.attr)(n,"style","")),(0,c.attr)(n,"style",`${(0,c.attr)(n,"style")};${e[t].style.cssText}`)}))}catch(t){}return(0,c.$$)(`[${o}]`,l.body).forEach((t=>{(0,c.attr)(t,"style",`${(0,c.attr)(t,"style")};${(0,c.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 A)if(null==(e=t(e,s)))break;null==e||e.forEach(t)}})),n&&e.forEach((t=>{t.style.clear()}),!0),(0,R.f)(f(e,(t=>!t.isComment),!0,t.o.pasteFromWord.allowedStyleProps))})(t,C.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,F.kU)(t,this.j,e)}}r.Jodit.plugins.remove("pasteFromWord"),r.Jodit.plugins.add("pasteFromWordPro",B)},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:()=>r})}},t=>t(t.s=75293)])}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
((t,
|
|
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:()=>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(96551),l=o(26464),r=o(7896),i=o(44660),n=o(12990),a=o(10187),c=o(7834),h=o(46788),p=o(79955),d=o(48343),k=o(8449),u=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:()=>p});var s=o(70655),l=o(85119);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(16490),i=o(35244),n=o(48823),a=o(98740),c=o(41257),h=o(5846);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(23337)),n.JO.set("showBlocks",o(48374))}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)},70655(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})},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)])}));
|
|
@@ -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],{78838(e,t,o){o.r(t),o.d(t,{tuneBlock:()=>b});var n=o(70655),i=o(16490),s=o(41257),r=o(5846),l=o(48823),c=o(44370),h=o(91037),u=o(60989);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(85119);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)},70655(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=78838)])}));
|
package/index.html
CHANGED
|
@@ -74,29 +74,29 @@
|
|
|
74
74
|
const editor = new Jodit('#editor', {
|
|
75
75
|
// theme: 'dark',
|
|
76
76
|
// extraPlugins: ['tune-block'],
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
77
|
+
buttons: [
|
|
78
|
+
'source',
|
|
79
|
+
'|',
|
|
80
|
+
{
|
|
81
|
+
group: 'font-style',
|
|
82
|
+
buttons: []
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
group: 'list',
|
|
86
|
+
buttons: []
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
group: 'font',
|
|
90
|
+
buttons: []
|
|
91
|
+
},
|
|
92
|
+
'|',
|
|
93
|
+
'brush',
|
|
94
|
+
'image',
|
|
95
|
+
'align',
|
|
96
|
+
'|',
|
|
97
|
+
'pageBreak',
|
|
98
|
+
'exportDocs'
|
|
99
|
+
],
|
|
100
100
|
// removeButtons: ['changeCase', 'classSpan', 'lineHeight'],
|
|
101
101
|
width: 762,
|
|
102
102
|
minHeight: '21px',
|
|
@@ -239,5 +239,26 @@
|
|
|
239
239
|
});
|
|
240
240
|
});
|
|
241
241
|
</script>
|
|
242
|
+
|
|
243
|
+
<div style='margin: 100px auto; max-width: 1024px;padding-bottom: 100px'>
|
|
244
|
+
<div id='browser'></div>
|
|
245
|
+
</div>
|
|
246
|
+
<script>
|
|
247
|
+
Jodit.plugins.wait('finder').then(() => {
|
|
248
|
+
const finder = new Jodit.modules.FileBrowserPro({
|
|
249
|
+
buttons: Jodit.atom([
|
|
250
|
+
'filebrowser.settings',
|
|
251
|
+
'fullsize',
|
|
252
|
+
]),
|
|
253
|
+
license: '',
|
|
254
|
+
ajax: {
|
|
255
|
+
url: 'https://xdsoft.net/jodit/finder/'
|
|
256
|
+
},
|
|
257
|
+
height: 580
|
|
258
|
+
});
|
|
259
|
+
finder.setMod('static', true).open();
|
|
260
|
+
document.getElementById('browser').appendChild(finder.container);
|
|
261
|
+
});
|
|
262
|
+
</script>
|
|
242
263
|
</body>
|
|
243
264
|
</html>
|