jodit 4.14.2 → 4.14.4
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/CHANGELOG.md +28 -0
- package/es2015/jodit.css +1 -1
- package/es2015/jodit.fat.min.js +13 -13
- package/es2015/jodit.js +692 -540
- package/es2015/jodit.min.js +13 -13
- package/es2015/plugins/debug/debug.css +1 -1
- package/es2015/plugins/debug/debug.js +2 -2
- package/es2015/plugins/debug/debug.min.js +2 -2
- package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.js +50 -50
- package/es2015/plugins/speech-recognize/speech-recognize.min.js +2 -2
- package/es2018/jodit.fat.min.js +13 -13
- package/es2018/jodit.min.js +13 -13
- package/es2018/plugins/debug/debug.min.js +2 -2
- package/es2018/plugins/speech-recognize/speech-recognize.min.js +2 -2
- package/es2021/jodit.css +1 -1
- package/es2021/jodit.fat.min.js +16 -16
- package/es2021/jodit.js +679 -531
- package/es2021/jodit.min.js +15 -15
- package/es2021/plugins/debug/debug.css +1 -1
- package/es2021/plugins/debug/debug.js +2 -2
- package/es2021/plugins/debug/debug.min.js +2 -2
- package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.js +50 -50
- package/es2021/plugins/speech-recognize/speech-recognize.min.js +2 -2
- package/es2021.en/jodit.css +1 -1
- package/es2021.en/jodit.fat.min.js +14 -14
- package/es2021.en/jodit.js +457 -296
- package/es2021.en/jodit.min.js +14 -14
- package/es2021.en/plugins/debug/debug.css +1 -1
- package/es2021.en/plugins/debug/debug.js +2 -2
- package/es2021.en/plugins/debug/debug.min.js +2 -2
- package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.js +2 -2
- package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +2 -2
- package/es5/jodit.css +2 -2
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +915 -609
- package/es5/jodit.min.css +2 -2
- package/es5/jodit.min.js +2 -2
- package/es5/plugins/debug/debug.css +1 -1
- package/es5/plugins/debug/debug.js +2 -2
- package/es5/plugins/debug/debug.min.js +2 -2
- package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.js +50 -50
- package/es5/plugins/speech-recognize/speech-recognize.min.js +2 -2
- package/es5/polyfills.fat.min.js +2 -2
- package/es5/polyfills.js +32 -57
- package/es5/polyfills.min.js +2 -2
- package/esm/core/constants.js +1 -1
- package/esm/core/selection/helpers/index.js +5 -2
- package/esm/core/selection/selection.d.ts +8 -5
- package/esm/core/selection/selection.js +267 -159
- package/esm/core/selection/style/api/extract.js +1 -3
- package/esm/core/selection/style/api/is-same-attributes.js +5 -2
- package/esm/core/selection/style/api/toggle-attributes.js +27 -10
- package/esm/core/selection/style/api/unwrap-children.js +39 -33
- package/esm/core/selection/style/apply-style.js +23 -25
- package/esm/core/selection/style/commit-style.js +3 -0
- package/esm/core/selection/style/transactions.js +2 -1
- package/esm/langs/az.d.ts +223 -0
- package/esm/langs/az.js +240 -0
- package/esm/languages.js +2 -0
- package/esm/modules/history/snapshot.js +45 -20
- package/esm/types/style.d.ts +2 -2
- package/esm/types/types.d.ts +3 -0
- package/package.json +1 -1
- package/types/core/selection/selection.d.ts +8 -5
- package/types/langs/az.d.ts +223 -0
- package/types/types/style.d.ts +2 -2
- package/types/types/types.d.ts +3 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
|
|
3
3
|
* Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
|
|
4
|
-
* Version: v4.14.
|
|
4
|
+
* Version: v4.14.4
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
@@ -197,7 +197,7 @@ function render(elm, level, range) {
|
|
|
197
197
|
|
|
198
198
|
},
|
|
199
199
|
/******/ function(__webpack_require__) { // webpackRuntimeModules
|
|
200
|
-
/******/ var __webpack_exec__ = function(moduleId) { return __webpack_require__(
|
|
200
|
+
/******/ var __webpack_exec__ = function(moduleId) { return __webpack_require__(moduleId); }
|
|
201
201
|
/******/ var __webpack_exports__ = (__webpack_exec__(96206));
|
|
202
202
|
/******/ return __webpack_exports__;
|
|
203
203
|
/******/ }
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
|
|
3
3
|
* Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
|
|
4
|
-
* Version: v4.14.
|
|
4
|
+
* Version: v4.14.4
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
8
8
|
"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 n=t();for(var s in n)("object"==typeof exports?exports:e)[s]=n[s]}}(self,function(){return(self.webpackChunkjodit=self.webpackChunkjodit||[]).push([[486],{96206:function(e,t,n){n.r(t),n.d(t,{Debug:function(){return i}});var s=n(81937),o=n(23211),a=n(22852),r=n(18855);class i extends r.Plugin{afterInit(e){let t=e.create.div("jodit-debug"),n=e.create.div("jodit-debug__tree"),r=e.create.div("jodit-debug__events"),i=e.create.div("jodit-debug__events-clear",["x"]),c=e.create.div("jodit-debug__sel");function d(){let t=e.selection.range;n.innerHTML=function e(t,n,r){let i=window.getSelection()?.containsNode(t),c=[`<span class="jodit-debug__tree-elm-name">${t.nodeName}</span>`,o.Dom.isText(t)?"- "+function(e,t){if(!e.nodeValue)return"<span style='color:red'>empty</span>";let n=e.nodeValue;return t.collapsed?e===t.startContainer&&(n=n.slice(0,t.startOffset)+"%CURSOR%"+n.slice(t.startOffset)):e===t.startContainer&&e===t.endContainer?n=n.slice(0,t.startOffset)+"%START-CURSOR%"+n.slice(t.startOffset,t.endOffset)+"%END-CURSOR%"+n.slice(t.endOffset):e===t.startContainer?n=n.slice(0,t.startOffset)+"%CURSOR%"+n.slice(t.startOffset):e===t.endContainer&&(n=n.slice(0,t.endOffset)+"%CURSOR%"+n.slice(t.endOffset)),(0,a.stripTags)(n.replace((0,s.INVISIBLE_SPACE_REG_EXP)(),"INV")).replace(/%CURSOR%/,'<span class="jodit-debug__tree-cursor">|</span>').replace(/%START-CURSOR%/,'<span class="jodit-debug__tree-cursor">|').replace(/%END-CURSOR%/,"|</span>")}(t,r):""].map(e=>e.trim()).filter(Boolean);return`<div class="${i?"jodit-debug__tree-element_selected":""}" style='padding-left: ${5*n}px'>
|
|
9
9
|
${c.join(" ")}
|
|
10
10
|
${Array.from(t.childNodes).map((s,o)=>{let a=[];return r.startContainer===t&&o===r.startOffset&&a.push('<span class="jodit-debug__tree-cursor">|</span>'),a.push(e(s,n+1,r)),r.endContainer===t&&o===r.endOffset&&a.push('<span class="jodit-debug__tree-cursor">|</span>'),a}).flat().join("")}
|
|
11
|
-
</div>`}(e.editor,0,t),c.innerHTML=`start ${t.startContainer.nodeName} ${t.startOffset}<br>end ${t.endContainer.nodeName} ${t.endOffset}`}function p(t){let n=e.e.current,s=e.create.div();s.innerHTML=`<span>${new Date().toLocaleTimeString()}</span> ${function(e,t){let n=[e??t.type];switch(e){case"beforeCommand":case"afterCommand":n.push(`<span>${t.toString()}</span>`);break;case"keydown":case"keyup":case"keypress":t.shiftKey&&"Shift"!==t.key&&n.push("Shift+"),t.ctrlKey&&"Control"!==t.key&&n.push("Ctrl+"),t.altKey&&"Alt"!==t.key&&n.push("Alt"),n.push(""+t.key)}return t&&o.Dom.isNode(t.target)&&n.push(`<span>${t.target.nodeName}</span>`),n.join(" ")}(n,t)}`,o.Dom.append(r,s),r.scrollTop=r.scrollHeight,e.async.setTimeout(()=>{r.children.length>100&&o.Dom.safeRemove(r.children[0])},100)}o.Dom.append(t,n),o.Dom.append(t,r),o.Dom.append(r,i),o.Dom.append(t,c),i.addEventListener("click",()=>{o.Dom.detach(r),o.Dom.append(r,i)}),o.Dom.append(e.workplace,t),e.e.on("keydown keyup keypress change afterInit updateDebug",d).on(["activate","afterInit","beforeactivate","beforeblur","beforedeactivate","beforefocus","beforeinput","blur","change","click","compositionend","compositionstart","compositionupdate","contextmenu","copy","cut","dblclick","deactivate","focus","focusin","focusout","focusout","input","keydown","keypress","keyup","mousedown","mouseup","paste","selectionchange","selectionstart","dragstart","drop","dragover","resize touchstart touchend","updateDebug","beforeCommand","afterCommand","wheel"],p).on(e.od,"selectionchange",p).on(e.od,"selectionchange",d)}beforeDestruct(e){}}}},function(e){return e(
|
|
11
|
+
</div>`}(e.editor,0,t),c.innerHTML=`start ${t.startContainer.nodeName} ${t.startOffset}<br>end ${t.endContainer.nodeName} ${t.endOffset}`}function p(t){let n=e.e.current,s=e.create.div();s.innerHTML=`<span>${new Date().toLocaleTimeString()}</span> ${function(e,t){let n=[e??t.type];switch(e){case"beforeCommand":case"afterCommand":n.push(`<span>${t.toString()}</span>`);break;case"keydown":case"keyup":case"keypress":t.shiftKey&&"Shift"!==t.key&&n.push("Shift+"),t.ctrlKey&&"Control"!==t.key&&n.push("Ctrl+"),t.altKey&&"Alt"!==t.key&&n.push("Alt"),n.push(""+t.key)}return t&&o.Dom.isNode(t.target)&&n.push(`<span>${t.target.nodeName}</span>`),n.join(" ")}(n,t)}`,o.Dom.append(r,s),r.scrollTop=r.scrollHeight,e.async.setTimeout(()=>{r.children.length>100&&o.Dom.safeRemove(r.children[0])},100)}o.Dom.append(t,n),o.Dom.append(t,r),o.Dom.append(r,i),o.Dom.append(t,c),i.addEventListener("click",()=>{o.Dom.detach(r),o.Dom.append(r,i)}),o.Dom.append(e.workplace,t),e.e.on("keydown keyup keypress change afterInit updateDebug",d).on(["activate","afterInit","beforeactivate","beforeblur","beforedeactivate","beforefocus","beforeinput","blur","change","click","compositionend","compositionstart","compositionupdate","contextmenu","copy","cut","dblclick","deactivate","focus","focusin","focusout","focusout","input","keydown","keypress","keyup","mousedown","mouseup","paste","selectionchange","selectionstart","dragstart","drop","dragover","resize touchstart touchend","updateDebug","beforeCommand","afterCommand","wheel"],p).on(e.od,"selectionchange",p).on(e.od,"selectionchange",d)}beforeDestruct(e){}}}},function(e){return e(96206)}])});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
|
|
3
3
|
* Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
|
|
4
|
-
* Version: v4.14.
|
|
4
|
+
* Version: v4.14.4
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
@@ -641,7 +641,7 @@ module.exports = "<svg viewBox=\"0 0 16 16\" xml:space=\"preserve\" xmlns=\"http
|
|
|
641
641
|
|
|
642
642
|
},
|
|
643
643
|
/******/ function(__webpack_require__) { // webpackRuntimeModules
|
|
644
|
-
/******/ var __webpack_exec__ = function(moduleId) { return __webpack_require__(
|
|
644
|
+
/******/ var __webpack_exec__ = function(moduleId) { return __webpack_require__(moduleId); }
|
|
645
645
|
/******/ var __webpack_exports__ = (__webpack_exec__(31262));
|
|
646
646
|
/******/ return __webpack_exports__;
|
|
647
647
|
/******/ }
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
|
|
3
3
|
* Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
|
|
4
|
-
* Version: v4.14.
|
|
4
|
+
* Version: v4.14.4
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
8
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var s=t();for(var i in s)("object"==typeof exports?exports:e)[i]=s[i]}}(self,function(){return(self.webpackChunkjodit=self.webpackChunkjodit||[]).push([[882],{75143:function(e,t,s){"use strict";var i=s(22289),n=s(85932),o=s(7909),r=s(36400),u=s(29434),c=s(5266),a=s(97743),l=s(68097),h=s(22227),p=s.n(h);c.Config.prototype.speechRecognize={api:void 0!==a.SpeechRecognition?a.SpeechRecognition:null,sound:!0,continuous:!1,interimResults:!0,commands:{"newline|enter":"enter","delete|remove word|delete word":"backspaceWordButton",comma:"inserthtml::,",underline:"inserthtml::_",hyphen:"inserthtml::-",space:"inserthtml:: ",question:"inserthtml::?",dot:"inserthtml::.","quote|quotes|open quote":"inserthtml::'","header|header h1":"formatblock::h1","select all":"selectall"}},u.Icon.set("speech-recognize",p()),c.Config.prototype.controls.speechRecognize={isVisible:e=>!!e.o.speechRecognize.api,isActive(e,t){let s=(0,r.dataBind)(e,"speech");return!!s?.isEnabled},isDisabled:e=>!e.o.speechRecognize.api,exec(e,t,{button:s,control:u}){let{api:c,lang:a,continuous:h,interimResults:p,sound:d}=e.o.speechRecognize;if(!c)return void e.alert("Speech recognize API unsupported in your browser");let _=(0,r.dataBind)(e,"speech");if(!_){let t=new c;(_=new l.RecognizeManager(e.async,t)).lang=(0,n.isString)(a)?a:(0,o.attr)(e.od.documentElement,"lang")??void 0,_.continuous=h,_.interimResults=p,_.sound=d,(0,r.dataBind)(e,"speech",_),_.on("pulse",e=>{s.setMod("pulse",e)}),_.on("result",t=>e.e.fire("speechRecognizeResult",t)),_.on("progress",t=>e.e.fire("speechRecognizeProgressResult",t)),_.on("error",t=>e.message.error(t)),e.hookStatus("beforeDestruct",()=>{(0,r.dataBind)(e,"speech",null),_.destruct()})}if(u.args){let e=u.args[0];if((0,i.isBoolean)(_[e])){_[e]=!_[e],_.isEnabled&&_.restart();return}}_.toggle(),_.isEnabled&&s.setMod("pulse",!0),s.state.activated=_.isEnabled},name:"speechRecognize",command:"toggleSpeechRecognize",tooltip:"Speech Recognize",list:{sound:"Sound",interimResults:"Interim Results"},childTemplate(e,t,s){let i=(0,r.dataBind)(e,"speech"),n=i?.[t]??e.o.speechRecognize[t];return`<span class='jodit-speech-recognize__list-item'><input ${n?"checked":""} class='jodit-checkbox' type='checkbox'> ${s}</span>`},mods:{stroke:!1}}},97743:function(e,t,s){"use strict";var i=s(81937);let n=i.globalWindow?i.globalWindow.SpeechRecognition||i.globalWindow.webkitSpeechRecognition:void 0;s.d(t,["SpeechRecognition",0,n])},86581:function(e,t,s){"use strict";function i(e,t){let[s,i]=t.split("::");"open"===s.toLowerCase()&&i&&/^(javascript:|data:|vbscript:)/i.test(i.trim())||e.execCommand(s,null,i)}s.d(t,{execSpellCommand:function(){return i}})},68097:function(e,t,s){"use strict";s.d(t,{RecognizeManager:function(){return c}});var i=s(25045),n=s(31635),o=s(84839),r=s(60216),u=s(32560);class c extends r.Eventify{set lang(e){this._lang=e,this._api.lang=e}get lang(){return this._lang}set continuous(e){this._continuous=e,this._api.continuous=e}get continuous(){return this._continuous}set interimResults(e){this._interimResults=e,this._api.interimResults=e}get interimResults(){return this._interimResults}destruct(){this.stop(),(0,u.closeSound)(this),c._instances.delete(this),super.destruct()}get isEnabled(){return this._isEnabled}start(){if(!this._isEnabled){this._isEnabled=!0,c._instances.forEach(e=>{e!==this&&e.stop()});try{this._api.start()}catch(e){this._onError(e),this.stop();return}this.__on("speechstart",this._onSpeechStart).__on("error",this._onError).__on("result",this._onProgress).__on("end",this._onResults)}}stop(){this._isEnabled&&(this._api.abort(),this._api.stop(),this.__off("speechstart",this._onSpeechStart).__off("error",this._onError).__off("result",this._onProgress).__off("end",this._onResults),this.async.clearTimeout(this._restartTimeout),this._isEnabled=!1,this.emit("pulse",!1))}toggle(){this._isEnabled?this.stop():this.start()}restart(){this.stop(),this.start()}__on(e,t){return this._api.addEventListener(e,t),this}__off(e,t){return this._api.removeEventListener(e,t),this}_onResults(e){this.emit("pulse",!1),this.emit("result",this.__interimResults),this.__interimResults="",this._makeSound(440),this.restart()}_onProgress(e){if(this._isEnabled&&(this.__interimResults="",e.results)){for(let t=0;t<e.results.length;t++){let s=e.results.item(t);if(s.length){let{transcript:e}=s.item(0);this.__interimResults+=e}}this.__interimResults&&this.emit("progress",this.__interimResults)}}_onError(e){"voice-unavailable"===e.error&&this.emit("error","Voice unavailable"),"not-allowed"===e.error&&this.emit("error","Not allowed"),("language-unavailable"===e.error||"language-not-supported"===e.error)&&this.emit("error","Language unavailable"),this._makeSound(940),this.emit("pulse",!1),this.stop()}_makeSound(e){this.sound&&(0,u.sound)(this,{frequency:e})}constructor(e,t){super(),(0,i._)(this,"async",void 0),(0,i._)(this,"_lang",void 0),(0,i._)(this,"_continuous",void 0),(0,i._)(this,"_interimResults",void 0),(0,i._)(this,"sound",void 0),(0,i._)(this,"_isEnabled",void 0),(0,i._)(this,"_restartTimeout",void 0),(0,i._)(this,"_onSpeechStart",void 0),(0,i._)(this,"_api",void 0),(0,i._)(this,"__interimResults",void 0),this.async=e,this._continuous=!1,this._interimResults=!1,this.sound=!0,this._isEnabled=!1,this._restartTimeout=0,this._onSpeechStart=e=>{this._isEnabled&&(this.async.clearTimeout(this._restartTimeout),this._restartTimeout=this.async.setTimeout(()=>{this.restart(),this.emit("pulse",!1),this._makeSound(940)},5e3),this.emit("pulse",!0))},this.__interimResults="",this._api=t,c._instances.add(this)}}(0,i._)(c,"_instances",new Set),(0,n.__decorate)([o.autobind],c.prototype,"_onResults",null),(0,n.__decorate)([o.autobind],c.prototype,"_onProgress",null),(0,n.__decorate)([o.autobind],c.prototype,"_onError",null)},32560:function(e,t,s){"use strict";s.d(t,{closeSound:function(){return r},sound:function(){return o}});var i=s(81937);let n=new WeakMap;function o(e,{sec:t=.1,frequency:s=440,gain:r=.1,type:u="sine"}={}){let c=function(e){if(!i.globalWindow)return null;let t=n.get(e);if(t&&"closed"!==t.state)return t;let s=i.globalWindow.AudioContext||i.globalWindow.webkitAudioContext;if(!s)return null;let o=new s;return n.set(e,o),o}(e);if(!c)return;let a=c.createGain(),l=c.createOscillator();l.type=u,l.frequency.value=s,a.gain.value=r,l.connect(a),a.connect(c.destination),l.start(),l.stop(c.currentTime+t)}function r(e){let t=n.get(e);t&&(n.delete(e),"closed"!==t.state&&t.close())}},43219:function(e,t,s){"use strict";s.r(t),s.d(t,{ar:function(){return i},cs_cz:function(){return i},de:function(){return i},es:function(){return i},fa:function(){return i},fi:function(){return i},fr:function(){return i},he:function(){return i},hu:function(){return i},id:function(){return i},it:function(){return i},ja:function(){return i},ko:function(){return i},mn:function(){return i},nl:function(){return i},no:function(){return i},pl:function(){return i},pt_br:function(){return i},ru:function(){return i},sk:function(){return i},tr:function(){return i},ua:function(){return i},zh_cn:function(){return i},zh_tw:function(){return i}});var i=s(41324)},31262:function(e,t,s){"use strict";s.r(t),s.d(t,{SpeechRecognizeNative:function(){return d}});var i=s(25045),n=s(31635),o=s(68616),r=s(23211),u=s(28077),c=s(71125),a=s(91206);s(75143);var l=s(73302),h=s(86581),p=s(43219);class d extends a.Plugin{afterInit(e){let{commands:t}=e.o.speechRecognize;t&&((0,u.extendLang)(p),(0,c.keys)(t,!1).forEach(s=>{s.split("|").forEach(i=>{i=i.trim().toLowerCase(),this._commandToWord[i]=t[s];let n=e.i18n(i);n!==i&&n.split("|").forEach(e=>{this._commandToWord[e.trim().toLowerCase()]=t[s].trim()})})}))}beforeDestruct(e){r.Dom.safeRemove(this.messagePopup)}onSpeechRecognizeProgressResult(e){this.messagePopup||(this.messagePopup=this.j.create.div("jodit-speech-recognize__popup")),r.Dom.append(this.j.workplace,this.messagePopup),this.j.async.clearTimeout(this.__hidePopupTimeout),this.__hidePopupTimeout=this.j.async.setTimeout(()=>{r.Dom.safeRemove(this.messagePopup)},1e3),this.messagePopup.innerText=e+"|"}onSpeechRecognizeResult(e){this.j.async.clearTimeout(this.__hidePopupTimeout),r.Dom.safeRemove(this.messagePopup);let{j:t}=this,{s}=t;if(!this._checkCommand(e)){let{range:i}=s,n=s.current();if(s.isCollapsed()&&r.Dom.isText(n)&&r.Dom.isOrContains(t.editor,n)&&n.nodeValue){let o=n.nodeValue;n.nodeValue=o+(/[\u00A0 ]\uFEFF*$/.test(o)?"":" ")+e,i.setStartAfter(n),s.selectRange(i),t.synchronizeValues()}else s.insertHTML(e)}}_checkCommand(e){return e=e.toLowerCase().replace(/\./g,""),!!this._commandToWord[e]&&((0,h.execSpellCommand)(this.j,this._commandToWord[e]),!0)}constructor(...e){super(...e),(0,i._)(this,"buttons",[{group:"state",name:"speechRecognize"}]),(0,i._)(this,"messagePopup",void 0),(0,i._)(this,"__hidePopupTimeout",void 0),(0,i._)(this,"_commandToWord",{})}}(0,n.__decorate)([(0,o.watch)(":speechRecognizeProgressResult")],d.prototype,"onSpeechRecognizeProgressResult",null),(0,n.__decorate)([(0,o.watch)(":speechRecognizeResult")],d.prototype,"onSpeechRecognizeResult",null),l.Jodit.plugins.add("speech-recognize",d)},22227:function(e){e.exports='<svg viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"> <path d="M8,11c1.657,0,3-1.343,3-3V3c0-1.657-1.343-3-3-3S5,1.343,5,3v5C5,9.657,6.343,11,8,11z"/> <path d="M13,8V6h-1l0,1.844c0,1.92-1.282,3.688-3.164,4.071C6.266,12.438,4,10.479,4,8V6H3v2c0,2.414,1.721,4.434,4,4.899V15H5v1h6 v-1H9v-2.101C11.279,12.434,13,10.414,13,8z"/> </svg>'}},function(e){return e(
|
|
8
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var s=t();for(var i in s)("object"==typeof exports?exports:e)[i]=s[i]}}(self,function(){return(self.webpackChunkjodit=self.webpackChunkjodit||[]).push([[882],{75143:function(e,t,s){"use strict";var i=s(22289),n=s(85932),o=s(7909),r=s(36400),u=s(29434),c=s(5266),a=s(97743),l=s(68097),h=s(22227),p=s.n(h);c.Config.prototype.speechRecognize={api:void 0!==a.SpeechRecognition?a.SpeechRecognition:null,sound:!0,continuous:!1,interimResults:!0,commands:{"newline|enter":"enter","delete|remove word|delete word":"backspaceWordButton",comma:"inserthtml::,",underline:"inserthtml::_",hyphen:"inserthtml::-",space:"inserthtml:: ",question:"inserthtml::?",dot:"inserthtml::.","quote|quotes|open quote":"inserthtml::'","header|header h1":"formatblock::h1","select all":"selectall"}},u.Icon.set("speech-recognize",p()),c.Config.prototype.controls.speechRecognize={isVisible:e=>!!e.o.speechRecognize.api,isActive(e,t){let s=(0,r.dataBind)(e,"speech");return!!s?.isEnabled},isDisabled:e=>!e.o.speechRecognize.api,exec(e,t,{button:s,control:u}){let{api:c,lang:a,continuous:h,interimResults:p,sound:d}=e.o.speechRecognize;if(!c)return void e.alert("Speech recognize API unsupported in your browser");let _=(0,r.dataBind)(e,"speech");if(!_){let t=new c;(_=new l.RecognizeManager(e.async,t)).lang=(0,n.isString)(a)?a:(0,o.attr)(e.od.documentElement,"lang")??void 0,_.continuous=h,_.interimResults=p,_.sound=d,(0,r.dataBind)(e,"speech",_),_.on("pulse",e=>{s.setMod("pulse",e)}),_.on("result",t=>e.e.fire("speechRecognizeResult",t)),_.on("progress",t=>e.e.fire("speechRecognizeProgressResult",t)),_.on("error",t=>e.message.error(t)),e.hookStatus("beforeDestruct",()=>{(0,r.dataBind)(e,"speech",null),_.destruct()})}if(u.args){let e=u.args[0];if((0,i.isBoolean)(_[e])){_[e]=!_[e],_.isEnabled&&_.restart();return}}_.toggle(),_.isEnabled&&s.setMod("pulse",!0),s.state.activated=_.isEnabled},name:"speechRecognize",command:"toggleSpeechRecognize",tooltip:"Speech Recognize",list:{sound:"Sound",interimResults:"Interim Results"},childTemplate(e,t,s){let i=(0,r.dataBind)(e,"speech"),n=i?.[t]??e.o.speechRecognize[t];return`<span class='jodit-speech-recognize__list-item'><input ${n?"checked":""} class='jodit-checkbox' type='checkbox'> ${s}</span>`},mods:{stroke:!1}}},97743:function(e,t,s){"use strict";var i=s(81937);let n=i.globalWindow?i.globalWindow.SpeechRecognition||i.globalWindow.webkitSpeechRecognition:void 0;s.d(t,["SpeechRecognition",0,n])},86581:function(e,t,s){"use strict";function i(e,t){let[s,i]=t.split("::");"open"===s.toLowerCase()&&i&&/^(javascript:|data:|vbscript:)/i.test(i.trim())||e.execCommand(s,null,i)}s.d(t,{execSpellCommand:function(){return i}})},68097:function(e,t,s){"use strict";s.d(t,{RecognizeManager:function(){return c}});var i=s(25045),n=s(31635),o=s(84839),r=s(60216),u=s(32560);class c extends r.Eventify{set lang(e){this._lang=e,this._api.lang=e}get lang(){return this._lang}set continuous(e){this._continuous=e,this._api.continuous=e}get continuous(){return this._continuous}set interimResults(e){this._interimResults=e,this._api.interimResults=e}get interimResults(){return this._interimResults}destruct(){this.stop(),(0,u.closeSound)(this),c._instances.delete(this),super.destruct()}get isEnabled(){return this._isEnabled}start(){if(!this._isEnabled){this._isEnabled=!0,c._instances.forEach(e=>{e!==this&&e.stop()});try{this._api.start()}catch(e){this._onError(e),this.stop();return}this.__on("speechstart",this._onSpeechStart).__on("error",this._onError).__on("result",this._onProgress).__on("end",this._onResults)}}stop(){this._isEnabled&&(this._api.abort(),this._api.stop(),this.__off("speechstart",this._onSpeechStart).__off("error",this._onError).__off("result",this._onProgress).__off("end",this._onResults),this.async.clearTimeout(this._restartTimeout),this._isEnabled=!1,this.emit("pulse",!1))}toggle(){this._isEnabled?this.stop():this.start()}restart(){this.stop(),this.start()}__on(e,t){return this._api.addEventListener(e,t),this}__off(e,t){return this._api.removeEventListener(e,t),this}_onResults(e){this.emit("pulse",!1),this.emit("result",this.__interimResults),this.__interimResults="",this._makeSound(440),this.restart()}_onProgress(e){if(this._isEnabled&&(this.__interimResults="",e.results)){for(let t=0;t<e.results.length;t++){let s=e.results.item(t);if(s.length){let{transcript:e}=s.item(0);this.__interimResults+=e}}this.__interimResults&&this.emit("progress",this.__interimResults)}}_onError(e){"voice-unavailable"===e.error&&this.emit("error","Voice unavailable"),"not-allowed"===e.error&&this.emit("error","Not allowed"),("language-unavailable"===e.error||"language-not-supported"===e.error)&&this.emit("error","Language unavailable"),this._makeSound(940),this.emit("pulse",!1),this.stop()}_makeSound(e){this.sound&&(0,u.sound)(this,{frequency:e})}constructor(e,t){super(),(0,i._)(this,"async",void 0),(0,i._)(this,"_lang",void 0),(0,i._)(this,"_continuous",void 0),(0,i._)(this,"_interimResults",void 0),(0,i._)(this,"sound",void 0),(0,i._)(this,"_isEnabled",void 0),(0,i._)(this,"_restartTimeout",void 0),(0,i._)(this,"_onSpeechStart",void 0),(0,i._)(this,"_api",void 0),(0,i._)(this,"__interimResults",void 0),this.async=e,this._continuous=!1,this._interimResults=!1,this.sound=!0,this._isEnabled=!1,this._restartTimeout=0,this._onSpeechStart=e=>{this._isEnabled&&(this.async.clearTimeout(this._restartTimeout),this._restartTimeout=this.async.setTimeout(()=>{this.restart(),this.emit("pulse",!1),this._makeSound(940)},5e3),this.emit("pulse",!0))},this.__interimResults="",this._api=t,c._instances.add(this)}}(0,i._)(c,"_instances",new Set),(0,n.__decorate)([o.autobind],c.prototype,"_onResults",null),(0,n.__decorate)([o.autobind],c.prototype,"_onProgress",null),(0,n.__decorate)([o.autobind],c.prototype,"_onError",null)},32560:function(e,t,s){"use strict";s.d(t,{closeSound:function(){return r},sound:function(){return o}});var i=s(81937);let n=new WeakMap;function o(e,{sec:t=.1,frequency:s=440,gain:r=.1,type:u="sine"}={}){let c=function(e){if(!i.globalWindow)return null;let t=n.get(e);if(t&&"closed"!==t.state)return t;let s=i.globalWindow.AudioContext||i.globalWindow.webkitAudioContext;if(!s)return null;let o=new s;return n.set(e,o),o}(e);if(!c)return;let a=c.createGain(),l=c.createOscillator();l.type=u,l.frequency.value=s,a.gain.value=r,l.connect(a),a.connect(c.destination),l.start(),l.stop(c.currentTime+t)}function r(e){let t=n.get(e);t&&(n.delete(e),"closed"!==t.state&&t.close())}},43219:function(e,t,s){"use strict";s.r(t),s.d(t,{ar:function(){return i},cs_cz:function(){return i},de:function(){return i},es:function(){return i},fa:function(){return i},fi:function(){return i},fr:function(){return i},he:function(){return i},hu:function(){return i},id:function(){return i},it:function(){return i},ja:function(){return i},ko:function(){return i},mn:function(){return i},nl:function(){return i},no:function(){return i},pl:function(){return i},pt_br:function(){return i},ru:function(){return i},sk:function(){return i},tr:function(){return i},ua:function(){return i},zh_cn:function(){return i},zh_tw:function(){return i}});var i=s(41324)},31262:function(e,t,s){"use strict";s.r(t),s.d(t,{SpeechRecognizeNative:function(){return d}});var i=s(25045),n=s(31635),o=s(68616),r=s(23211),u=s(28077),c=s(71125),a=s(91206);s(75143);var l=s(73302),h=s(86581),p=s(43219);class d extends a.Plugin{afterInit(e){let{commands:t}=e.o.speechRecognize;t&&((0,u.extendLang)(p),(0,c.keys)(t,!1).forEach(s=>{s.split("|").forEach(i=>{i=i.trim().toLowerCase(),this._commandToWord[i]=t[s];let n=e.i18n(i);n!==i&&n.split("|").forEach(e=>{this._commandToWord[e.trim().toLowerCase()]=t[s].trim()})})}))}beforeDestruct(e){r.Dom.safeRemove(this.messagePopup)}onSpeechRecognizeProgressResult(e){this.messagePopup||(this.messagePopup=this.j.create.div("jodit-speech-recognize__popup")),r.Dom.append(this.j.workplace,this.messagePopup),this.j.async.clearTimeout(this.__hidePopupTimeout),this.__hidePopupTimeout=this.j.async.setTimeout(()=>{r.Dom.safeRemove(this.messagePopup)},1e3),this.messagePopup.innerText=e+"|"}onSpeechRecognizeResult(e){this.j.async.clearTimeout(this.__hidePopupTimeout),r.Dom.safeRemove(this.messagePopup);let{j:t}=this,{s}=t;if(!this._checkCommand(e)){let{range:i}=s,n=s.current();if(s.isCollapsed()&&r.Dom.isText(n)&&r.Dom.isOrContains(t.editor,n)&&n.nodeValue){let o=n.nodeValue;n.nodeValue=o+(/[\u00A0 ]\uFEFF*$/.test(o)?"":" ")+e,i.setStartAfter(n),s.selectRange(i),t.synchronizeValues()}else s.insertHTML(e)}}_checkCommand(e){return e=e.toLowerCase().replace(/\./g,""),!!this._commandToWord[e]&&((0,h.execSpellCommand)(this.j,this._commandToWord[e]),!0)}constructor(...e){super(...e),(0,i._)(this,"buttons",[{group:"state",name:"speechRecognize"}]),(0,i._)(this,"messagePopup",void 0),(0,i._)(this,"__hidePopupTimeout",void 0),(0,i._)(this,"_commandToWord",{})}}(0,n.__decorate)([(0,o.watch)(":speechRecognizeProgressResult")],d.prototype,"onSpeechRecognizeProgressResult",null),(0,n.__decorate)([(0,o.watch)(":speechRecognizeResult")],d.prototype,"onSpeechRecognizeResult",null),l.Jodit.plugins.add("speech-recognize",d)},22227:function(e){e.exports='<svg viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"> <path d="M8,11c1.657,0,3-1.343,3-3V3c0-1.657-1.343-3-3-3S5,1.343,5,3v5C5,9.657,6.343,11,8,11z"/> <path d="M13,8V6h-1l0,1.844c0,1.92-1.282,3.688-3.164,4.071C6.266,12.438,4,10.479,4,8V6H3v2c0,2.414,1.721,4.434,4,4.899V15H5v1h6 v-1H9v-2.101C11.279,12.434,13,10.414,13,8z"/> </svg>'}},function(e){return e(31262)}])});
|
package/es5/jodit.css
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
|
|
3
3
|
* Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
|
|
4
|
-
* Version: v4.14.
|
|
4
|
+
* Version: v4.14.4
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
8
8
|
/*!
|
|
9
9
|
* jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
|
|
10
10
|
* Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
|
|
11
|
-
* Version: v4.14.
|
|
11
|
+
* Version: v4.14.4
|
|
12
12
|
* Url: https://xdsoft.net/jodit/
|
|
13
13
|
* License(s): MIT
|
|
14
14
|
*/
|