jodit 4.13.26 → 4.14.0
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 +33 -0
- package/es2015/jodit.css +1 -1
- package/es2015/jodit.fat.min.js +19 -19
- package/es2015/jodit.js +1104 -884
- package/es2015/jodit.min.js +20 -20
- package/es2015/plugins/debug/debug.css +1 -1
- package/es2015/plugins/debug/debug.js +10 -10
- package/es2015/plugins/debug/debug.min.js +4 -4
- package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.js +2 -2
- package/es2015/plugins/speech-recognize/speech-recognize.min.js +2 -2
- package/es2018/jodit.fat.min.js +19 -19
- package/es2018/jodit.min.js +19 -19
- package/es2018/plugins/debug/debug.min.js +4 -4
- package/es2018/plugins/speech-recognize/speech-recognize.min.js +2 -2
- package/es2021/jodit.css +1 -1
- package/es2021/jodit.fat.min.js +29 -29
- package/es2021/jodit.js +1097 -875
- package/es2021/jodit.min.js +29 -29
- package/es2021/plugins/debug/debug.css +1 -1
- package/es2021/plugins/debug/debug.js +10 -10
- package/es2021/plugins/debug/debug.min.js +4 -4
- package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.js +2 -2
- 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 +29 -29
- package/es2021.en/jodit.js +1097 -875
- package/es2021.en/jodit.min.js +29 -29
- package/es2021.en/plugins/debug/debug.css +1 -1
- package/es2021.en/plugins/debug/debug.js +10 -10
- package/es2021.en/plugins/debug/debug.min.js +4 -4
- 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 +1221 -925
- 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 +10 -10
- 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 +2 -2
- package/es5/plugins/speech-recognize/speech-recognize.min.js +2 -2
- package/es5/polyfills.fat.min.js +1 -1
- package/es5/polyfills.js +1 -1
- package/es5/polyfills.min.js +1 -1
- package/esm/core/constants.js +1 -1
- package/esm/core/create/create.js +2 -2
- package/esm/core/dom/dom.d.ts +21 -13
- package/esm/core/dom/dom.js +58 -87
- package/esm/core/global.js +3 -2
- package/esm/core/helpers/html/apply-styles.js +14 -10
- package/esm/core/helpers/html/clean-from-word.js +8 -4
- package/esm/core/helpers/html/safe-html.js +23 -14
- package/esm/core/helpers/html/strip-tags.js +9 -4
- package/esm/core/helpers/utils/align.d.ts +0 -3
- package/esm/core/helpers/utils/align.js +15 -18
- package/esm/core/helpers/utils/append-script.js +13 -10
- package/esm/core/helpers/utils/attr.d.ts +3 -1
- package/esm/core/helpers/utils/attr.js +18 -0
- package/esm/core/helpers/utils/css.d.ts +18 -1
- package/esm/core/helpers/utils/css.js +15 -0
- package/esm/core/helpers/utils/print.js +17 -14
- package/esm/core/helpers/utils/reset.js +3 -0
- package/esm/core/helpers/utils/selector.js +11 -7
- package/esm/core/selection/helpers/move-node-inside-start.js +1 -1
- package/esm/core/selection/selection.js +29 -26
- package/esm/core/selection/style/api/get-suit-parent.js +10 -0
- package/esm/core/selection/style/api/is-same-attributes.js +5 -2
- package/esm/core/selection/style/api/toggle-attributes.js +8 -9
- package/esm/core/selection/style/api/wrap-unwrapped-text.js +2 -2
- package/esm/core/traits/elms.js +11 -3
- package/esm/core/ui/button/button/button.js +3 -3
- package/esm/core/ui/button/group/group.js +2 -1
- package/esm/core/ui/button/tooltip/tooltip.js +2 -2
- package/esm/core/ui/element.js +1 -1
- package/esm/core/ui/form/inputs/area/area.js +3 -2
- package/esm/core/ui/form/inputs/file/file.js +2 -1
- package/esm/core/ui/form/inputs/input/input.js +5 -5
- package/esm/core/ui/group/group.js +7 -7
- package/esm/core/ui/icon.js +2 -2
- package/esm/core/ui/popup/popup.js +10 -8
- package/esm/core/ui/progress-bar/progress-bar.js +3 -4
- package/esm/core/view/view-with-toolbar.js +1 -1
- package/esm/core/view/view.js +1 -1
- package/esm/jodit.js +30 -28
- package/esm/modules/dialog/alert.js +1 -1
- package/esm/modules/dialog/confirm.js +3 -2
- package/esm/modules/dialog/dialog.d.ts +6 -0
- package/esm/modules/dialog/dialog.js +40 -22
- package/esm/modules/dialog/prompt.js +4 -3
- package/esm/modules/file-browser/builders/context-menu.js +5 -5
- package/esm/modules/file-browser/config.js +3 -1
- package/esm/modules/file-browser/file-browser.js +7 -4
- package/esm/modules/file-browser/listeners/state-listeners.js +6 -6
- package/esm/modules/image-editor/image-editor.js +31 -17
- package/esm/modules/messages/messages.js +2 -1
- package/esm/modules/status-bar/status-bar.js +3 -4
- package/esm/modules/table/table.js +22 -18
- package/esm/modules/toolbar/button/button.js +4 -4
- package/esm/modules/toolbar/button/content.js +12 -4
- package/esm/modules/toolbar/collection/collection.js +4 -2
- package/esm/modules/uploader/config.js +3 -2
- package/esm/modules/uploader/helpers/process-old-browser-drag.js +1 -1
- package/esm/modules/uploader/uploader.js +7 -2
- package/esm/modules/widget/color-picker/color-picker.js +4 -4
- package/esm/modules/widget/file-selector/file-selector.js +6 -6
- package/esm/modules/widget/tabs/tabs.js +5 -5
- package/esm/plugins/add-new-line/add-new-line.js +8 -7
- package/esm/plugins/ai-assistant/ui/ui-ai-assistant.js +4 -4
- package/esm/plugins/backspace/cases/check-join-neighbors.js +4 -1
- package/esm/plugins/clean-html/helpers/visitor/filters/allow-attributes.js +5 -1
- package/esm/plugins/clean-html/helpers/visitor/filters/fill-empty-paragraph.js +1 -1
- package/esm/plugins/color/config.js +4 -4
- package/esm/plugins/copy-format/copy-format.js +1 -1
- package/esm/plugins/delete/delete.js +9 -2
- package/esm/plugins/drag-and-drop/drag-and-drop.js +1 -1
- package/esm/plugins/drag-and-drop-element/drag-and-drop-element.js +1 -1
- package/esm/plugins/enter/helpers/insert-paragraph.js +1 -1
- package/esm/plugins/enter/helpers/process-empty-li-leaf.js +2 -2
- package/esm/plugins/enter/helpers/wrap-text.js +1 -1
- package/esm/plugins/fullsize/fullsize.js +3 -2
- package/esm/plugins/iframe/iframe.js +6 -5
- package/esm/plugins/image-properties/readers/align.js +6 -5
- package/esm/plugins/image-properties/readers/index.js +3 -1
- package/esm/plugins/image-properties/ui/ui-image-form.js +2 -1
- package/esm/plugins/image-properties/writers/index.js +2 -1
- package/esm/plugins/image-properties/writers/link.js +1 -1
- package/esm/plugins/indent/config.js +3 -2
- package/esm/plugins/indent/indent.js +4 -2
- package/esm/plugins/media/media.js +10 -7
- package/esm/plugins/mobile/config.js +2 -2
- package/esm/plugins/paste-storage/paste-storage.js +5 -5
- package/esm/plugins/placeholder/placeholder.js +13 -11
- package/esm/plugins/print/print.js +2 -2
- package/esm/plugins/resize-cells/resize-cells.js +13 -15
- package/esm/plugins/resize-handler/resize-handler.js +3 -4
- package/esm/plugins/resizer/resizer.js +11 -10
- package/esm/plugins/search/helpers/highlight-text-ranges.js +1 -1
- package/esm/plugins/search/ui/search.js +1 -1
- package/esm/plugins/select/select.js +2 -2
- package/esm/plugins/select-cells/select-cells.js +5 -6
- package/esm/plugins/source/editor/engines/ace.js +2 -1
- package/esm/plugins/source/editor/engines/area.js +3 -3
- package/esm/plugins/source/source.js +2 -2
- package/esm/plugins/speech-recognize/speech-recognize.js +1 -1
- package/esm/plugins/sticky/sticky.js +1 -1
- package/esm/plugins/symbols/config.js +3 -2
- package/esm/plugins/symbols/symbols.js +6 -5
- package/esm/plugins/tab/cases/on-tab-inside-li.js +2 -2
- package/esm/plugins/table/config.js +18 -10
- package/esm/plugins/table-keyboard-navigation/table-keyboard-navigation.js +2 -2
- package/esm/plugins/wrap-nodes/wrap-nodes.js +2 -2
- package/esm/plugins/xpath/xpath.js +2 -3
- package/esm/types/index.d.ts +1 -0
- package/esm/types/vdom.d.ts +96 -0
- package/package.json +1 -1
- package/types/core/dom/dom.d.ts +21 -13
- package/types/core/helpers/utils/align.d.ts +0 -3
- package/types/core/helpers/utils/attr.d.ts +3 -1
- package/types/core/helpers/utils/css.d.ts +18 -1
- package/types/modules/dialog/dialog.d.ts +6 -0
- package/types/types/index.d.ts +1 -0
- package/types/types/vdom.d.ts +96 -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.
|
|
4
|
+
* Version: v4.14.0
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
@@ -71,15 +71,15 @@ var Debug = /*#__PURE__*/ function(Plugin) {
|
|
|
71
71
|
'x'
|
|
72
72
|
]);
|
|
73
73
|
var sel = jodit.create.div('jodit-debug__sel');
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_6__.Dom.append(mirror, tree);
|
|
75
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_6__.Dom.append(mirror, events);
|
|
76
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_6__.Dom.append(events, clear);
|
|
77
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_6__.Dom.append(mirror, sel);
|
|
78
78
|
clear.addEventListener('click', function() {
|
|
79
|
-
events
|
|
80
|
-
|
|
79
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_6__.Dom.detach(events);
|
|
80
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_6__.Dom.append(events, clear);
|
|
81
81
|
});
|
|
82
|
-
jodit.workplace
|
|
82
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_6__.Dom.append(jodit.workplace, mirror);
|
|
83
83
|
var allEvents = [
|
|
84
84
|
'activate',
|
|
85
85
|
'afterInit',
|
|
@@ -130,10 +130,10 @@ var Debug = /*#__PURE__*/ function(Plugin) {
|
|
|
130
130
|
var event = jodit.e.current;
|
|
131
131
|
var div = jodit.create.div();
|
|
132
132
|
div.innerHTML = "<span>".concat(new Date().toLocaleTimeString(), "</span> ").concat(renderEvent(event, e));
|
|
133
|
-
|
|
133
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_6__.Dom.append(events, div);
|
|
134
134
|
events.scrollTop = events.scrollHeight;
|
|
135
135
|
jodit.async.setTimeout(function() {
|
|
136
|
-
events.children.length > 100 &&
|
|
136
|
+
events.children.length > 100 && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_6__.Dom.safeRemove(events.children[0]);
|
|
137
137
|
}, 100);
|
|
138
138
|
}
|
|
139
139
|
function renderEvent(event, e) {
|
|
@@ -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.
|
|
4
|
+
* Version: v4.14.0
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
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 o in n)("object"==typeof exports?exports:e)[o]=n[o]}}(self,function(){return(self.webpackChunkjodit=self.webpackChunkjodit||[]).push([[486],{96206:function(e,t,n){n.r(t),n.d(t,{Debug:function(){return
|
|
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 o in n)("object"==typeof exports?exports:e)[o]=n[o]}}(self,function(){return(self.webpackChunkjodit=self.webpackChunkjodit||[]).push([[486],{96206:function(e,t,n){n.r(t),n.d(t,{Debug:function(){return p}});var o=n(69262),a=n(73104),s=n(53429),r=n(34918),c=n(38574),i=n(81937),d=n(23211),u=n(22852),f=n(18855),p=function(e){function t(){return(0,a._)(this,t),(0,o._)(this,t,arguments)}return(0,r._)(t,e),(0,s._)(t,[{key:"afterInit",value:function(e){var t=e.create.div("jodit-debug"),n=e.create.div("jodit-debug__tree"),o=e.create.div("jodit-debug__events"),a=e.create.div("jodit-debug__events-clear",["x"]),s=e.create.div("jodit-debug__sel");function r(){var t=e.selection.range;n.innerHTML=function e(t,n,o){var a,s=null==(a=window.getSelection())?void 0:a.containsNode(t),r=['<span class="jodit-debug__tree-elm-name">'.concat(t.nodeName,"</span>"),d.Dom.isText(t)?"- ".concat(function(e,t){if(!e.nodeValue)return"<span style='color:red'>empty</span>";var 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,u.stripTags)(n.replace((0,i.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,o)):""].map(function(e){return e.trim()}).filter(Boolean);return'<div class="'.concat(s?"jodit-debug__tree-element_selected":"","\" style='padding-left: ").concat(5*n,"px'>\n ").concat(r.join(" "),"\n ").concat(Array.from(t.childNodes).map(function(a,s){var r=[];return o.startContainer===t&&s===o.startOffset&&r.push('<span class="jodit-debug__tree-cursor">|</span>'),r.push(e(a,n+1,o)),o.endContainer===t&&s===o.endOffset&&r.push('<span class="jodit-debug__tree-cursor">|</span>'),r}).flat().join(""),"\n</div>")}(e.editor,0,t),s.innerHTML="start ".concat(t.startContainer.nodeName," ").concat(t.startOffset,"<br>end ").concat(t.endContainer.nodeName," ").concat(t.endOffset)}function c(t){var n=e.e.current,a=e.create.div();a.innerHTML="<span>".concat(new Date().toLocaleTimeString(),"</span> ").concat(function(e,t){var n=[null!=e?e:t.type];switch(e){case"beforeCommand":case"afterCommand":n.push("<span>".concat(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("".concat(t.key))}return t&&d.Dom.isNode(t.target)&&n.push("<span>".concat(t.target.nodeName,"</span>")),n.join(" ")}(n,t)),d.Dom.append(o,a),o.scrollTop=o.scrollHeight,e.async.setTimeout(function(){o.children.length>100&&d.Dom.safeRemove(o.children[0])},100)}d.Dom.append(t,n),d.Dom.append(t,o),d.Dom.append(o,a),d.Dom.append(t,s),a.addEventListener("click",function(){d.Dom.detach(o),d.Dom.append(o,a)}),d.Dom.append(e.workplace,t),e.e.on("keydown keyup keypress change afterInit updateDebug",r).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"],c).on(e.od,"selectionchange",c).on(e.od,"selectionchange",r)}},{key:"beforeDestruct",value:function(e){}}]),t}((0,c._)(f.Plugin))}},function(e){return e(e.s=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.
|
|
4
|
+
* Version: v4.14.0
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
@@ -1215,7 +1215,7 @@ var SpeechRecognizeNative = /*#__PURE__*/ function(Plugin) {
|
|
|
1215
1215
|
if (!this.messagePopup) {
|
|
1216
1216
|
this.messagePopup = this.j.create.div('jodit-speech-recognize__popup');
|
|
1217
1217
|
}
|
|
1218
|
-
this.j.workplace
|
|
1218
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.append(this.j.workplace, this.messagePopup);
|
|
1219
1219
|
this.j.async.clearTimeout(this.__hidePopupTimeout);
|
|
1220
1220
|
this.__hidePopupTimeout = this.j.async.setTimeout(function() {
|
|
1221
1221
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.safeRemove(_this.messagePopup);
|
|
@@ -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.
|
|
4
|
+
* Version: v4.14.0
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
8
|
-
!function(e,n){if("object"==typeof exports&&"object"==typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var t=n();for(var i in t)("object"==typeof exports?exports:e)[i]=t[i]}}(self,function(){return(self.webpackChunkjodit=self.webpackChunkjodit||[]).push([[882],{75143:function(e,n,t){"use strict";var i=t(22289),o=t(85932),s=t(7909),r=t(36400),u=t(29434),c=t(5266),a=t(97743),l=t(68097),p=t(22227),d=t.n(p);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",d()),c.Config.prototype.controls.speechRecognize={isVisible:function(e){return!!e.o.speechRecognize.api},isActive:function(e,n){var t=(0,r.dataBind)(e,"speech");return!!(null==t?void 0:t.isEnabled)},isDisabled:function(e){return!e.o.speechRecognize.api},exec:function(e,n,t){var u=t.button,c=t.control,a=e.o.speechRecognize,p=a.api,d=a.lang,h=a.continuous,f=a.interimResults,m=a.sound;if(!p)return void e.alert("Speech recognize API unsupported in your browser");var _=(0,r.dataBind)(e,"speech");if(!_){var g,R=new p;(_=new l.RecognizeManager(e.async,R)).lang=(0,o.isString)(d)?d:null!=(g=(0,s.attr)(e.od.documentElement,"lang"))?g:void 0,_.continuous=h,_.interimResults=f,_.sound=m,(0,r.dataBind)(e,"speech",_),_.on("pulse",function(e){u.setMod("pulse",e)}),_.on("result",function(n){return e.e.fire("speechRecognizeResult",n)}),_.on("progress",function(n){return e.e.fire("speechRecognizeProgressResult",n)}),_.on("error",function(n){return e.message.error(n)}),e.hookStatus("beforeDestruct",function(){(0,r.dataBind)(e,"speech",null),_.destruct()})}if(c.args){var v=c.args[0];if((0,i.isBoolean)(_[v])){_[v]=!_[v],_.isEnabled&&_.restart();return}}_.toggle(),_.isEnabled&&u.setMod("pulse",!0),u.state.activated=_.isEnabled},name:"speechRecognize",command:"toggleSpeechRecognize",tooltip:"Speech Recognize",list:{sound:"Sound",interimResults:"Interim Results"},childTemplate:function(e,n,t){var i,o=(0,r.dataBind)(e,"speech"),s=null!=(i=null==o?void 0:o[n])?i:e.o.speechRecognize[n];return"<span class='jodit-speech-recognize__list-item'><input ".concat(s?"checked":""," class='jodit-checkbox' type='checkbox'> ").concat(t,"</span>")},mods:{stroke:!1}}},94092:function(e,n,t){"use strict";t.d(n,{PII:function(){return i},WARN:function(){return o}});var i=440,o=940},97743:function(e,n,t){"use strict";t.d(n,{SpeechRecognition:function(){return o}});var i=t(81937),o=i.globalWindow?i.globalWindow.SpeechRecognition||i.globalWindow.webkitSpeechRecognition:void 0},8962:function(e,n,t){"use strict";t.d(n,{execSpellCommand:function(){return o}});var i=t(50684);function o(e,n){var t=(0,i._)(n.split("::"),2),o=t[0],s=t[1];"open"===o.toLowerCase()&&s&&/^(javascript:|data:|vbscript:)/i.test(s.trim())||e.execCommand(o,null,s)}},68097:function(e,n,t){"use strict";t.d(n,{RecognizeManager:function(){return m}});var i=t(69262),o=t(73104),s=t(53429),r=t(25045),u=t(22248),c=t(66773),a=t(34918),l=t(31635),p=t(84839),d=t(60216),h=t(32560),f=t(94092),m=function(e){function n(e,t){var s;return(0,o._)(this,n),s=(0,i._)(this,n),(0,r._)(s,"async",void 0),(0,r._)(s,"_lang",void 0),(0,r._)(s,"_continuous",void 0),(0,r._)(s,"_interimResults",void 0),(0,r._)(s,"sound",void 0),(0,r._)(s,"_isEnabled",void 0),(0,r._)(s,"_restartTimeout",void 0),(0,r._)(s,"_onSpeechStart",void 0),(0,r._)(s,"_api",void 0),(0,r._)(s,"__interimResults",void 0),s.async=e,s._continuous=!1,s._interimResults=!1,s.sound=!0,s._isEnabled=!1,s._restartTimeout=0,s._onSpeechStart=function(e){s._isEnabled&&(s.async.clearTimeout(s._restartTimeout),s._restartTimeout=s.async.setTimeout(function(){s.restart(),s.emit("pulse",!1),s._makeSound(f.WARN)},5e3),s.emit("pulse",!0))},s.__interimResults="",s._api=t,n._instances.add(s),s}return(0,a._)(n,e),(0,s._)(n,[{key:"lang",get:function(){return this._lang},set:function(e){this._lang=e,this._api.lang=e}},{key:"continuous",get:function(){return this._continuous},set:function(e){this._continuous=e,this._api.continuous=e}},{key:"interimResults",get:function(){return this._interimResults},set:function(e){this._interimResults=e,this._api.interimResults=e}},{key:"destruct",value:function(){this.stop(),(0,h.closeSound)(this),n._instances.delete(this),(0,u._)((0,c._)(n.prototype),"destruct",this).call(this)}},{key:"isEnabled",get:function(){return this._isEnabled}},{key:"start",value:function(){var e=this;if(!this._isEnabled){this._isEnabled=!0,n._instances.forEach(function(n){n!==e&&n.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)}}},{key:"stop",value:function(){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))}},{key:"toggle",value:function(){this._isEnabled?this.stop():this.start()}},{key:"restart",value:function(){this.stop(),this.start()}},{key:"__on",value:function(e,n){return this._api.addEventListener(e,n),this}},{key:"__off",value:function(e,n){return this._api.removeEventListener(e,n),this}},{key:"_onResults",value:function(e){this.emit("pulse",!1),this.emit("result",this.__interimResults),this.__interimResults="",this._makeSound(f.PII),this.restart()}},{key:"_onProgress",value:function(e){if(this._isEnabled&&(this.__interimResults="",e.results)){for(var n=0;n<e.results.length;n++){var t=e.results.item(n);if(t.length){var i=t.item(0).transcript;this.__interimResults+=i}}this.__interimResults&&this.emit("progress",this.__interimResults)}}},{key:"_onError",value:function(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(f.WARN),this.emit("pulse",!1),this.stop()}},{key:"_makeSound",value:function(e){this.sound&&(0,h.sound)(this,{frequency:e})}}]),n}(d.Eventify);(0,r._)(m,"_instances",new Set),(0,l.__decorate)([p.autobind],m.prototype,"_onResults",null),(0,l.__decorate)([p.autobind],m.prototype,"_onProgress",null),(0,l.__decorate)([p.autobind],m.prototype,"_onError",null)},32560:function(e,n,t){"use strict";t.d(n,{closeSound:function(){return u},sound:function(){return r}});var i=t(81937),o=t(94092),s=new WeakMap;function r(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.sec,r=n.frequency,u=void 0===r?o.PII:r,c=n.gain,a=n.type,l=function(e){if(!i.globalWindow)return null;var n=s.get(e);if(n&&"closed"!==n.state)return n;var t=i.globalWindow.AudioContext||i.globalWindow.webkitAudioContext;if(!t)return null;var o=new t;return s.set(e,o),o}(e);if(l){var p=l.createGain(),d=l.createOscillator();d.type=void 0===a?"sine":a,d.frequency.value=u,p.gain.value=void 0===c?.1:c,d.connect(p),p.connect(l.destination),d.start(),d.stop(l.currentTime+(void 0===t?.1:t))}}function u(e){var n=s.get(e);n&&(s.delete(e),"closed"!==n.state&&n.close())}},19922:function(e){e.exports={newline:"الخط الجديد",delete:"حذف",space:"الفضاء","Speech Recognize":"التعرف على الكلام",Sound:"الصوت","Interim Results":"النتائج المؤقتة"}},20759:function(e){e.exports={newline:"ř\xe1dek",delete:"odstranit",space:"prostora","Speech Recognize":"Rozpozn\xe1n\xed Řeči",Sound:"Zvuk","Interim Results":"Průběžn\xe9 V\xfdsledky"}},22350:function(e){e.exports={newline:"Zeilenumbruch",delete:"l\xf6schen",space:"Raum","Speech Recognize":"Sprache Erkennen",Sound:"Sound","Interim Results":"Zwischenergebnis"}},97509:function(e){e.exports={newline:"nueva l\xednea",delete:"eliminar",space:"espacio","Speech Recognize":"Reconocimiento de Voz",Sound:"Sonido","Interim Results":"Resultados Provisionales"}},49668:function(e){e.exports={newline:"خط جدید",delete:"حذف",space:"فضا","Speech Recognize":"گفتار را تشخیص دهید",Sound:"صدا","Interim Results":"نتایج موقت"}},33276:function(e){e.exports={"Speech Recognize":"Puheentunnistus",newline:"uusi rivi",delete:"poistaa",space:"tilaa",Sound:"\xc4\xe4ni","Interim Results":"V\xe4litulokset"}},43517:function(e){e.exports={newline:"nouvelle ligne",delete:"supprimer",space:"espace","Speech Recognize":"Reconnaissance Vocale",Sound:"Son","Interim Results":"R\xe9sultats Interm\xe9diaires"}},8858:function(e){e.exports={newline:"חדשות",delete:"מחק",space:"שטח","Speech Recognize":"דיבור מזהה",Sound:"קול","Interim Results":"תוצאות ביניים"}},22922:function(e){e.exports={newline:"\xfajsor",delete:"t\xf6rl\xe9s",space:"t\xe9r","Speech Recognize":"A Besz\xe9d Felismeri",Sound:"Hang","Interim Results":"Idők\xf6zi Eredm\xe9nyek"}},81900:function(e){e.exports={newline:"newline",delete:"Hapus",space:"ruang","Speech Recognize":"Pidato Mengenali",Sound:"Suara","Interim Results":"Hasil Sementara"}},43219:function(e,n,t){"use strict";t.r(n),t.d(n,{ar:function(){return i},cs_cz:function(){return o},de:function(){return s},es:function(){return r},fa:function(){return u},fi:function(){return c},fr:function(){return a},he:function(){return l},hu:function(){return p},id:function(){return d},it:function(){return h},ja:function(){return f},ko:function(){return m},mn:function(){return _},nl:function(){return g},no:function(){return R},pl:function(){return v},pt_br:function(){return S},ru:function(){return z},sk:function(){return w},tr:function(){return y},ua:function(){return k},zh_cn:function(){return b},zh_tw:function(){return x}});var i=t(19922),o=t(20759),s=t(22350),r=t(97509),u=t(49668),c=t(33276),a=t(43517),l=t(8858),p=t(22922),d=t(81900),h=t(35420),f=t(18712),m=t(73363),_=t(74762),g=t(73759),R=t(72850),v=t(37161),S=t(62896),z=t(39996),w=t(62415),y=t(93423),k=t(10179),b=t(62547),x=t(29475)},35420:function(e){e.exports={newline:"nuova riga",delete:"eliminare",space:"spazio","Speech Recognize":"Discorso Riconoscere",Sound:"Suono","Interim Results":"Risultati intermedi"}},18712:function(e){e.exports={newline:"改行",delete:"削除",space:"スペース","Speech Recognize":"音声認識",Sound:"音","Interim Results":"中間結果"}},73363:function(e){e.exports={newline:"줄 바꿈",delete:"삭제",space:"공간","Speech Recognize":"음성 인식",Sound:"소리","Interim Results":"중간 결과"}},74762:function(e){e.exports={newline:"Шинэ мөр",delete:"Устгах",space:"Зай","Speech Recognize":"Дуу хоолой таних",Sound:"Дуу","Interim Results":"Түр зуурын үр дүн"}},73759:function(e){e.exports={newline:"regel",delete:"verwijderen",space:"ruimte","Speech Recognize":"Spraak Herkennen",Sound:"Geluid","Interim Results":"Tussentijdse Resultaten"}},72850:function(e){e.exports={newline:"nylinje",delete:"slette",space:"rom","Speech Recognize":"Talegjenkjenning",Sound:"Lyd","Interim Results":"Midlertidige resultater"}},37161:function(e){e.exports={newline:"newline",delete:"usunąć",space:"przestrzeń","Speech Recognize":"Rozpoznawanie Mowy",Sound:"Dźwięk","Interim Results":"Wyniki Okresowe"}},62896:function(e){e.exports={newline:"linha",delete:"excluir",space:"espaco","Speech Recognize":"Discurso Reconhecer",Sound:"Som","Interim Results":"Resultados Provis\xf3rios"}},39996:function(e){e.exports={newline:"новая строка|перенос|энтер",delete:"удалить",space:"пробел","Speech Recognize":"Распознавание речи",Sound:"Звук","Interim Results":"Промежуточные результаты"}},62415:function(e){e.exports={newline:"nov\xfd riadok",delete:"vymazať",space:"medzera","Speech Recognize":"Rozpozn\xe1vanie reči",Sound:"Zvuk","Interim Results":"Predbežn\xe9 v\xfdsledky"}},93423:function(e){e.exports={newline:"yeni satır",delete:"silmek",space:"uzay","Speech Recognize":"Konuşma Tanıma",Sound:"Ses","Interim Results":"Ara Sonu\xe7lar"}},10179:function(e){e.exports={newline:"новая строка|перенос|ентер",delete:"видалити",space:"пробел","Speech Recognize":"Распознавание речи",Sound:"Звук","Interim Results":"Проміжні результати"}},62547:function(e){e.exports={newline:"新行",delete:"删除",space:"空间","Speech Recognize":"言语识别",Sound:"声音","Interim Results":"中期业绩"}},29475:function(e){e.exports={newline:"換行",delete:"刪除",space:"空白","Speech Recognize":"語音辨識",Sound:"聲音","Interim Results":"階段性辨識結果"}},31262:function(e,n,t){"use strict";t.r(n),t.d(n,{SpeechRecognizeNative:function(){return R}});var i=t(69262),o=t(73104),s=t(53429),r=t(25045),u=t(34918),c=t(31635),a=t(38574),l=t(68616),p=t(23211),d=t(28077),h=t(71125),f=t(91206);t(75143);var m=t(73302),_=t(8962),g=t(43219),R=function(e){function n(){var e;return(0,o._)(this,n),e=(0,i._)(this,n,arguments),(0,r._)(e,"buttons",[{group:"state",name:"speechRecognize"}]),(0,r._)(e,"messagePopup",void 0),(0,r._)(e,"__hidePopupTimeout",void 0),(0,r._)(e,"_commandToWord",{}),e}return(0,u._)(n,e),(0,s._)(n,[{key:"afterInit",value:function(e){var n=this,t=e.o.speechRecognize.commands;t&&((0,d.extendLang)(g),(0,h.keys)(t,!1).forEach(function(i){i.split("|").forEach(function(o){o=o.trim().toLowerCase(),n._commandToWord[o]=t[i];var s=e.i18n(o);s!==o&&s.split("|").forEach(function(e){n._commandToWord[e.trim().toLowerCase()]=t[i].trim()})})}))}},{key:"beforeDestruct",value:function(e){p.Dom.safeRemove(this.messagePopup)}},{key:"onSpeechRecognizeProgressResult",value:function(e){var n=this;this.messagePopup||(this.messagePopup=this.j.create.div("jodit-speech-recognize__popup")),this.j.workplace.appendChild(this.messagePopup),this.j.async.clearTimeout(this.__hidePopupTimeout),this.__hidePopupTimeout=this.j.async.setTimeout(function(){p.Dom.safeRemove(n.messagePopup)},1e3),this.messagePopup.innerText=e+"|"}},{key:"onSpeechRecognizeResult",value:function(e){this.j.async.clearTimeout(this.__hidePopupTimeout),p.Dom.safeRemove(this.messagePopup);var n=this.j,t=n.s;if(!this._checkCommand(e)){var i=t.range,o=t.current();if(t.isCollapsed()&&p.Dom.isText(o)&&p.Dom.isOrContains(n.editor,o)&&o.nodeValue){var s=o.nodeValue;o.nodeValue=s+(/[\u00A0 ]\uFEFF*$/.test(s)?"":" ")+e,i.setStartAfter(o),t.selectRange(i),n.synchronizeValues()}else t.insertHTML(e)}}},{key:"_checkCommand",value:function(e){return e=e.toLowerCase().replace(/\./g,""),!!this._commandToWord[e]&&((0,_.execSpellCommand)(this.j,this._commandToWord[e]),!0)}}]),n}((0,a._)(f.Plugin));(0,c.__decorate)([(0,l.watch)(":speechRecognizeProgressResult")],R.prototype,"onSpeechRecognizeProgressResult",null),(0,c.__decorate)([(0,l.watch)(":speechRecognizeResult")],R.prototype,"onSpeechRecognizeResult",null),m.Jodit.plugins.add("speech-recognize",R)},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(e.s=31262)}])});
|
|
8
|
+
!function(e,n){if("object"==typeof exports&&"object"==typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var t=n();for(var i in t)("object"==typeof exports?exports:e)[i]=t[i]}}(self,function(){return(self.webpackChunkjodit=self.webpackChunkjodit||[]).push([[882],{75143:function(e,n,t){"use strict";var i=t(22289),o=t(85932),s=t(7909),r=t(36400),u=t(29434),c=t(5266),a=t(97743),l=t(68097),p=t(22227),d=t.n(p);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",d()),c.Config.prototype.controls.speechRecognize={isVisible:function(e){return!!e.o.speechRecognize.api},isActive:function(e,n){var t=(0,r.dataBind)(e,"speech");return!!(null==t?void 0:t.isEnabled)},isDisabled:function(e){return!e.o.speechRecognize.api},exec:function(e,n,t){var u=t.button,c=t.control,a=e.o.speechRecognize,p=a.api,d=a.lang,h=a.continuous,f=a.interimResults,m=a.sound;if(!p)return void e.alert("Speech recognize API unsupported in your browser");var _=(0,r.dataBind)(e,"speech");if(!_){var g,R=new p;(_=new l.RecognizeManager(e.async,R)).lang=(0,o.isString)(d)?d:null!=(g=(0,s.attr)(e.od.documentElement,"lang"))?g:void 0,_.continuous=h,_.interimResults=f,_.sound=m,(0,r.dataBind)(e,"speech",_),_.on("pulse",function(e){u.setMod("pulse",e)}),_.on("result",function(n){return e.e.fire("speechRecognizeResult",n)}),_.on("progress",function(n){return e.e.fire("speechRecognizeProgressResult",n)}),_.on("error",function(n){return e.message.error(n)}),e.hookStatus("beforeDestruct",function(){(0,r.dataBind)(e,"speech",null),_.destruct()})}if(c.args){var v=c.args[0];if((0,i.isBoolean)(_[v])){_[v]=!_[v],_.isEnabled&&_.restart();return}}_.toggle(),_.isEnabled&&u.setMod("pulse",!0),u.state.activated=_.isEnabled},name:"speechRecognize",command:"toggleSpeechRecognize",tooltip:"Speech Recognize",list:{sound:"Sound",interimResults:"Interim Results"},childTemplate:function(e,n,t){var i,o=(0,r.dataBind)(e,"speech"),s=null!=(i=null==o?void 0:o[n])?i:e.o.speechRecognize[n];return"<span class='jodit-speech-recognize__list-item'><input ".concat(s?"checked":""," class='jodit-checkbox' type='checkbox'> ").concat(t,"</span>")},mods:{stroke:!1}}},94092:function(e,n,t){"use strict";t.d(n,{PII:function(){return i},WARN:function(){return o}});var i=440,o=940},97743:function(e,n,t){"use strict";t.d(n,{SpeechRecognition:function(){return o}});var i=t(81937),o=i.globalWindow?i.globalWindow.SpeechRecognition||i.globalWindow.webkitSpeechRecognition:void 0},8962:function(e,n,t){"use strict";t.d(n,{execSpellCommand:function(){return o}});var i=t(50684);function o(e,n){var t=(0,i._)(n.split("::"),2),o=t[0],s=t[1];"open"===o.toLowerCase()&&s&&/^(javascript:|data:|vbscript:)/i.test(s.trim())||e.execCommand(o,null,s)}},68097:function(e,n,t){"use strict";t.d(n,{RecognizeManager:function(){return m}});var i=t(69262),o=t(73104),s=t(53429),r=t(25045),u=t(22248),c=t(66773),a=t(34918),l=t(31635),p=t(84839),d=t(60216),h=t(32560),f=t(94092),m=function(e){function n(e,t){var s;return(0,o._)(this,n),s=(0,i._)(this,n),(0,r._)(s,"async",void 0),(0,r._)(s,"_lang",void 0),(0,r._)(s,"_continuous",void 0),(0,r._)(s,"_interimResults",void 0),(0,r._)(s,"sound",void 0),(0,r._)(s,"_isEnabled",void 0),(0,r._)(s,"_restartTimeout",void 0),(0,r._)(s,"_onSpeechStart",void 0),(0,r._)(s,"_api",void 0),(0,r._)(s,"__interimResults",void 0),s.async=e,s._continuous=!1,s._interimResults=!1,s.sound=!0,s._isEnabled=!1,s._restartTimeout=0,s._onSpeechStart=function(e){s._isEnabled&&(s.async.clearTimeout(s._restartTimeout),s._restartTimeout=s.async.setTimeout(function(){s.restart(),s.emit("pulse",!1),s._makeSound(f.WARN)},5e3),s.emit("pulse",!0))},s.__interimResults="",s._api=t,n._instances.add(s),s}return(0,a._)(n,e),(0,s._)(n,[{key:"lang",get:function(){return this._lang},set:function(e){this._lang=e,this._api.lang=e}},{key:"continuous",get:function(){return this._continuous},set:function(e){this._continuous=e,this._api.continuous=e}},{key:"interimResults",get:function(){return this._interimResults},set:function(e){this._interimResults=e,this._api.interimResults=e}},{key:"destruct",value:function(){this.stop(),(0,h.closeSound)(this),n._instances.delete(this),(0,u._)((0,c._)(n.prototype),"destruct",this).call(this)}},{key:"isEnabled",get:function(){return this._isEnabled}},{key:"start",value:function(){var e=this;if(!this._isEnabled){this._isEnabled=!0,n._instances.forEach(function(n){n!==e&&n.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)}}},{key:"stop",value:function(){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))}},{key:"toggle",value:function(){this._isEnabled?this.stop():this.start()}},{key:"restart",value:function(){this.stop(),this.start()}},{key:"__on",value:function(e,n){return this._api.addEventListener(e,n),this}},{key:"__off",value:function(e,n){return this._api.removeEventListener(e,n),this}},{key:"_onResults",value:function(e){this.emit("pulse",!1),this.emit("result",this.__interimResults),this.__interimResults="",this._makeSound(f.PII),this.restart()}},{key:"_onProgress",value:function(e){if(this._isEnabled&&(this.__interimResults="",e.results)){for(var n=0;n<e.results.length;n++){var t=e.results.item(n);if(t.length){var i=t.item(0).transcript;this.__interimResults+=i}}this.__interimResults&&this.emit("progress",this.__interimResults)}}},{key:"_onError",value:function(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(f.WARN),this.emit("pulse",!1),this.stop()}},{key:"_makeSound",value:function(e){this.sound&&(0,h.sound)(this,{frequency:e})}}]),n}(d.Eventify);(0,r._)(m,"_instances",new Set),(0,l.__decorate)([p.autobind],m.prototype,"_onResults",null),(0,l.__decorate)([p.autobind],m.prototype,"_onProgress",null),(0,l.__decorate)([p.autobind],m.prototype,"_onError",null)},32560:function(e,n,t){"use strict";t.d(n,{closeSound:function(){return u},sound:function(){return r}});var i=t(81937),o=t(94092),s=new WeakMap;function r(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.sec,r=n.frequency,u=void 0===r?o.PII:r,c=n.gain,a=n.type,l=function(e){if(!i.globalWindow)return null;var n=s.get(e);if(n&&"closed"!==n.state)return n;var t=i.globalWindow.AudioContext||i.globalWindow.webkitAudioContext;if(!t)return null;var o=new t;return s.set(e,o),o}(e);if(l){var p=l.createGain(),d=l.createOscillator();d.type=void 0===a?"sine":a,d.frequency.value=u,p.gain.value=void 0===c?.1:c,d.connect(p),p.connect(l.destination),d.start(),d.stop(l.currentTime+(void 0===t?.1:t))}}function u(e){var n=s.get(e);n&&(s.delete(e),"closed"!==n.state&&n.close())}},19922:function(e){e.exports={newline:"الخط الجديد",delete:"حذف",space:"الفضاء","Speech Recognize":"التعرف على الكلام",Sound:"الصوت","Interim Results":"النتائج المؤقتة"}},20759:function(e){e.exports={newline:"ř\xe1dek",delete:"odstranit",space:"prostora","Speech Recognize":"Rozpozn\xe1n\xed Řeči",Sound:"Zvuk","Interim Results":"Průběžn\xe9 V\xfdsledky"}},22350:function(e){e.exports={newline:"Zeilenumbruch",delete:"l\xf6schen",space:"Raum","Speech Recognize":"Sprache Erkennen",Sound:"Sound","Interim Results":"Zwischenergebnis"}},97509:function(e){e.exports={newline:"nueva l\xednea",delete:"eliminar",space:"espacio","Speech Recognize":"Reconocimiento de Voz",Sound:"Sonido","Interim Results":"Resultados Provisionales"}},49668:function(e){e.exports={newline:"خط جدید",delete:"حذف",space:"فضا","Speech Recognize":"گفتار را تشخیص دهید",Sound:"صدا","Interim Results":"نتایج موقت"}},33276:function(e){e.exports={"Speech Recognize":"Puheentunnistus",newline:"uusi rivi",delete:"poistaa",space:"tilaa",Sound:"\xc4\xe4ni","Interim Results":"V\xe4litulokset"}},43517:function(e){e.exports={newline:"nouvelle ligne",delete:"supprimer",space:"espace","Speech Recognize":"Reconnaissance Vocale",Sound:"Son","Interim Results":"R\xe9sultats Interm\xe9diaires"}},8858:function(e){e.exports={newline:"חדשות",delete:"מחק",space:"שטח","Speech Recognize":"דיבור מזהה",Sound:"קול","Interim Results":"תוצאות ביניים"}},22922:function(e){e.exports={newline:"\xfajsor",delete:"t\xf6rl\xe9s",space:"t\xe9r","Speech Recognize":"A Besz\xe9d Felismeri",Sound:"Hang","Interim Results":"Idők\xf6zi Eredm\xe9nyek"}},81900:function(e){e.exports={newline:"newline",delete:"Hapus",space:"ruang","Speech Recognize":"Pidato Mengenali",Sound:"Suara","Interim Results":"Hasil Sementara"}},43219:function(e,n,t){"use strict";t.r(n),t.d(n,{ar:function(){return i},cs_cz:function(){return o},de:function(){return s},es:function(){return r},fa:function(){return u},fi:function(){return c},fr:function(){return a},he:function(){return l},hu:function(){return p},id:function(){return d},it:function(){return h},ja:function(){return f},ko:function(){return m},mn:function(){return _},nl:function(){return g},no:function(){return R},pl:function(){return v},pt_br:function(){return S},ru:function(){return z},sk:function(){return w},tr:function(){return y},ua:function(){return k},zh_cn:function(){return b},zh_tw:function(){return x}});var i=t(19922),o=t(20759),s=t(22350),r=t(97509),u=t(49668),c=t(33276),a=t(43517),l=t(8858),p=t(22922),d=t(81900),h=t(35420),f=t(18712),m=t(73363),_=t(74762),g=t(73759),R=t(72850),v=t(37161),S=t(62896),z=t(39996),w=t(62415),y=t(93423),k=t(10179),b=t(62547),x=t(29475)},35420:function(e){e.exports={newline:"nuova riga",delete:"eliminare",space:"spazio","Speech Recognize":"Discorso Riconoscere",Sound:"Suono","Interim Results":"Risultati intermedi"}},18712:function(e){e.exports={newline:"改行",delete:"削除",space:"スペース","Speech Recognize":"音声認識",Sound:"音","Interim Results":"中間結果"}},73363:function(e){e.exports={newline:"줄 바꿈",delete:"삭제",space:"공간","Speech Recognize":"음성 인식",Sound:"소리","Interim Results":"중간 결과"}},74762:function(e){e.exports={newline:"Шинэ мөр",delete:"Устгах",space:"Зай","Speech Recognize":"Дуу хоолой таних",Sound:"Дуу","Interim Results":"Түр зуурын үр дүн"}},73759:function(e){e.exports={newline:"regel",delete:"verwijderen",space:"ruimte","Speech Recognize":"Spraak Herkennen",Sound:"Geluid","Interim Results":"Tussentijdse Resultaten"}},72850:function(e){e.exports={newline:"nylinje",delete:"slette",space:"rom","Speech Recognize":"Talegjenkjenning",Sound:"Lyd","Interim Results":"Midlertidige resultater"}},37161:function(e){e.exports={newline:"newline",delete:"usunąć",space:"przestrzeń","Speech Recognize":"Rozpoznawanie Mowy",Sound:"Dźwięk","Interim Results":"Wyniki Okresowe"}},62896:function(e){e.exports={newline:"linha",delete:"excluir",space:"espaco","Speech Recognize":"Discurso Reconhecer",Sound:"Som","Interim Results":"Resultados Provis\xf3rios"}},39996:function(e){e.exports={newline:"новая строка|перенос|энтер",delete:"удалить",space:"пробел","Speech Recognize":"Распознавание речи",Sound:"Звук","Interim Results":"Промежуточные результаты"}},62415:function(e){e.exports={newline:"nov\xfd riadok",delete:"vymazať",space:"medzera","Speech Recognize":"Rozpozn\xe1vanie reči",Sound:"Zvuk","Interim Results":"Predbežn\xe9 v\xfdsledky"}},93423:function(e){e.exports={newline:"yeni satır",delete:"silmek",space:"uzay","Speech Recognize":"Konuşma Tanıma",Sound:"Ses","Interim Results":"Ara Sonu\xe7lar"}},10179:function(e){e.exports={newline:"новая строка|перенос|ентер",delete:"видалити",space:"пробел","Speech Recognize":"Распознавание речи",Sound:"Звук","Interim Results":"Проміжні результати"}},62547:function(e){e.exports={newline:"新行",delete:"删除",space:"空间","Speech Recognize":"言语识别",Sound:"声音","Interim Results":"中期业绩"}},29475:function(e){e.exports={newline:"換行",delete:"刪除",space:"空白","Speech Recognize":"語音辨識",Sound:"聲音","Interim Results":"階段性辨識結果"}},31262:function(e,n,t){"use strict";t.r(n),t.d(n,{SpeechRecognizeNative:function(){return R}});var i=t(69262),o=t(73104),s=t(53429),r=t(25045),u=t(34918),c=t(31635),a=t(38574),l=t(68616),p=t(23211),d=t(28077),h=t(71125),f=t(91206);t(75143);var m=t(73302),_=t(8962),g=t(43219),R=function(e){function n(){var e;return(0,o._)(this,n),e=(0,i._)(this,n,arguments),(0,r._)(e,"buttons",[{group:"state",name:"speechRecognize"}]),(0,r._)(e,"messagePopup",void 0),(0,r._)(e,"__hidePopupTimeout",void 0),(0,r._)(e,"_commandToWord",{}),e}return(0,u._)(n,e),(0,s._)(n,[{key:"afterInit",value:function(e){var n=this,t=e.o.speechRecognize.commands;t&&((0,d.extendLang)(g),(0,h.keys)(t,!1).forEach(function(i){i.split("|").forEach(function(o){o=o.trim().toLowerCase(),n._commandToWord[o]=t[i];var s=e.i18n(o);s!==o&&s.split("|").forEach(function(e){n._commandToWord[e.trim().toLowerCase()]=t[i].trim()})})}))}},{key:"beforeDestruct",value:function(e){p.Dom.safeRemove(this.messagePopup)}},{key:"onSpeechRecognizeProgressResult",value:function(e){var n=this;this.messagePopup||(this.messagePopup=this.j.create.div("jodit-speech-recognize__popup")),p.Dom.append(this.j.workplace,this.messagePopup),this.j.async.clearTimeout(this.__hidePopupTimeout),this.__hidePopupTimeout=this.j.async.setTimeout(function(){p.Dom.safeRemove(n.messagePopup)},1e3),this.messagePopup.innerText=e+"|"}},{key:"onSpeechRecognizeResult",value:function(e){this.j.async.clearTimeout(this.__hidePopupTimeout),p.Dom.safeRemove(this.messagePopup);var n=this.j,t=n.s;if(!this._checkCommand(e)){var i=t.range,o=t.current();if(t.isCollapsed()&&p.Dom.isText(o)&&p.Dom.isOrContains(n.editor,o)&&o.nodeValue){var s=o.nodeValue;o.nodeValue=s+(/[\u00A0 ]\uFEFF*$/.test(s)?"":" ")+e,i.setStartAfter(o),t.selectRange(i),n.synchronizeValues()}else t.insertHTML(e)}}},{key:"_checkCommand",value:function(e){return e=e.toLowerCase().replace(/\./g,""),!!this._commandToWord[e]&&((0,_.execSpellCommand)(this.j,this._commandToWord[e]),!0)}}]),n}((0,a._)(f.Plugin));(0,c.__decorate)([(0,l.watch)(":speechRecognizeProgressResult")],R.prototype,"onSpeechRecognizeProgressResult",null),(0,c.__decorate)([(0,l.watch)(":speechRecognizeResult")],R.prototype,"onSpeechRecognizeResult",null),m.Jodit.plugins.add("speech-recognize",R)},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(e.s=31262)}])});
|
package/es5/polyfills.fat.min.js
CHANGED
package/es5/polyfills.js
CHANGED
package/es5/polyfills.min.js
CHANGED
package/esm/core/constants.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
4
|
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
|
-
export const APP_VERSION = "4.
|
|
6
|
+
export const APP_VERSION = "4.14.0";
|
|
7
7
|
// prettier-ignore
|
|
8
8
|
export const ES = "es2020";
|
|
9
9
|
export const IS_ES_MODERN = true;
|
|
@@ -28,7 +28,7 @@ export class Create {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
if (children) {
|
|
31
|
-
asArray(children).forEach((child) =>
|
|
31
|
+
asArray(children).forEach((child) => Dom.append(elm, isString(child) ? this.fromHTML(child) : child));
|
|
32
32
|
}
|
|
33
33
|
return elm;
|
|
34
34
|
}
|
|
@@ -42,7 +42,7 @@ export class Create {
|
|
|
42
42
|
sandbox() {
|
|
43
43
|
var _a;
|
|
44
44
|
const iframe = this.element('iframe', { sandbox: 'allow-same-origin' });
|
|
45
|
-
this.doc.body
|
|
45
|
+
Dom.append(this.doc.body, iframe);
|
|
46
46
|
const doc = (_a = iframe.contentWindow) === null || _a === void 0 ? void 0 : _a.document;
|
|
47
47
|
assert(doc, 'iframe.contentWindow.document');
|
|
48
48
|
if (!doc) {
|
package/esm/core/dom/dom.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @packageDocumentation
|
|
9
9
|
* @module dom
|
|
10
10
|
*/
|
|
11
|
-
import type { HTMLTagNames, ICreate, IDictionary, IJodit, NodeCondition, Nullable } from "../../types/index";
|
|
11
|
+
import type { HTMLTagNames, ICreate, IDictionary, IJodit, NodeCondition, Nullable, VHTMLElement, VNode } from "../../types/index";
|
|
12
12
|
/**
|
|
13
13
|
* Module for working with DOM
|
|
14
14
|
*/
|
|
@@ -17,7 +17,7 @@ export declare class Dom {
|
|
|
17
17
|
/**
|
|
18
18
|
* Remove all content from element
|
|
19
19
|
*/
|
|
20
|
-
static detach(node: Nullable<
|
|
20
|
+
static detach(node: Nullable<VNode>): void;
|
|
21
21
|
/**
|
|
22
22
|
* Wrap all inline next siblings
|
|
23
23
|
*/
|
|
@@ -32,7 +32,7 @@ export declare class Dom {
|
|
|
32
32
|
/**
|
|
33
33
|
* Remove parent of node and insert this node instead that parent
|
|
34
34
|
*/
|
|
35
|
-
static unwrap(node:
|
|
35
|
+
static unwrap(node: VNode): void;
|
|
36
36
|
/**
|
|
37
37
|
* Call callback for all nodes between `start` and `end` in document order
|
|
38
38
|
* (`start` and `end` are not included). Iteration stops when the callback returns `true`.
|
|
@@ -140,6 +140,11 @@ export declare class Dom {
|
|
|
140
140
|
* Get last matched node inside root
|
|
141
141
|
*/
|
|
142
142
|
static last(root: Nullable<Node>, condition: NodeCondition): Nullable<Node>;
|
|
143
|
+
/**
|
|
144
|
+
* Depth-first search for the first matched node inside root:
|
|
145
|
+
* in document order (`reverse = false`) or in reverse order
|
|
146
|
+
*/
|
|
147
|
+
private static __deepMost;
|
|
143
148
|
/**
|
|
144
149
|
* Find previous node
|
|
145
150
|
*/
|
|
@@ -150,6 +155,7 @@ export declare class Dom {
|
|
|
150
155
|
static next<T extends Node = Node>(node: Node, condition: NodeCondition, root: HTMLElement, withChild?: boolean): Nullable<T>;
|
|
151
156
|
static prevWithClass(node: HTMLElement, className: string): Nullable<HTMLElement>;
|
|
152
157
|
static nextWithClass(node: HTMLElement, className: string): Nullable<HTMLElement>;
|
|
158
|
+
private static __siblingWithClass;
|
|
153
159
|
/**
|
|
154
160
|
* Find next/prev node what `condition(next) === true`
|
|
155
161
|
*/
|
|
@@ -197,6 +203,7 @@ export declare class Dom {
|
|
|
197
203
|
* Returns the previous (`left = true`) or next sibling of the node
|
|
198
204
|
*/
|
|
199
205
|
static sibling(node: Node, left?: boolean): Nullable<Node>;
|
|
206
|
+
static sibling(node: VNode, left?: boolean): Nullable<VNode>;
|
|
200
207
|
/**
|
|
201
208
|
* It goes through all the elements in ascending order, and checks to see if they meet the predetermined condition
|
|
202
209
|
*
|
|
@@ -219,28 +226,29 @@ export declare class Dom {
|
|
|
219
226
|
/**
|
|
220
227
|
* Append new element in the start of root
|
|
221
228
|
*/
|
|
222
|
-
static appendChildFirst(root:
|
|
229
|
+
static appendChildFirst(root: VNode, newElement: VNode): void;
|
|
223
230
|
/**
|
|
224
231
|
* Insert newElement after element
|
|
225
232
|
*/
|
|
226
|
-
static after(elm:
|
|
233
|
+
static after(elm: VNode, newElement: VNode): void;
|
|
227
234
|
/**
|
|
228
235
|
* Insert newElement before element
|
|
229
236
|
*/
|
|
230
|
-
static before(elm:
|
|
237
|
+
static before(elm: VNode, newElement: VNode): void;
|
|
231
238
|
/**
|
|
232
239
|
* Insert newElement as first child inside element
|
|
233
240
|
*/
|
|
234
|
-
static prepend(root:
|
|
241
|
+
static prepend(root: VNode, newElement: VNode): void;
|
|
235
242
|
/**
|
|
236
243
|
* Insert newElement as last child inside element
|
|
237
244
|
*/
|
|
238
|
-
static append(root:
|
|
239
|
-
static append(root:
|
|
245
|
+
static append(root: VNode, newElements: VNode[]): void;
|
|
246
|
+
static append(root: VNode, newElement: VNode): void;
|
|
240
247
|
/**
|
|
241
248
|
* Move all content to another element
|
|
242
249
|
*/
|
|
243
250
|
static moveContent(from: Node, to: Node, inStart?: boolean, filter?: (node: Node) => boolean): void;
|
|
251
|
+
static moveContent(from: VNode, to: VNode, inStart?: boolean, filter?: (node: VNode) => boolean): void;
|
|
244
252
|
/**
|
|
245
253
|
* Check root contains child or equal child
|
|
246
254
|
*/
|
|
@@ -259,11 +267,11 @@ export declare class Dom {
|
|
|
259
267
|
/**
|
|
260
268
|
* Hide element
|
|
261
269
|
*/
|
|
262
|
-
static hide(node: Nullable<
|
|
270
|
+
static hide(node: Nullable<VHTMLElement>): void;
|
|
263
271
|
/**
|
|
264
272
|
* Show element
|
|
265
273
|
*/
|
|
266
|
-
static show(node: Nullable<
|
|
274
|
+
static show(node: Nullable<VHTMLElement>): void;
|
|
267
275
|
/**
|
|
268
276
|
* Check if element is some tag
|
|
269
277
|
*/
|
|
@@ -286,8 +294,8 @@ export declare class Dom {
|
|
|
286
294
|
*/
|
|
287
295
|
static replaceTemporaryFromString(value: string): string;
|
|
288
296
|
/**
|
|
289
|
-
*
|
|
290
|
-
*
|
|
297
|
+
* Collect the temporary elements (`data-jodit-temp`) inside the root.
|
|
298
|
+
* A plain tree walk on purpose: no selector engine, works on VNode.
|
|
291
299
|
*/
|
|
292
300
|
static temporaryList(root: HTMLElement): HTMLElement[];
|
|
293
301
|
}
|
package/esm/core/dom/dom.js
CHANGED
|
@@ -347,56 +347,39 @@ export class Dom {
|
|
|
347
347
|
* Get first matched node inside root
|
|
348
348
|
*/
|
|
349
349
|
static first(root, condition) {
|
|
350
|
-
|
|
351
|
-
if (!first) {
|
|
352
|
-
return null;
|
|
353
|
-
}
|
|
354
|
-
do {
|
|
355
|
-
if (condition(first)) {
|
|
356
|
-
return first;
|
|
357
|
-
}
|
|
358
|
-
let next = first.firstChild;
|
|
359
|
-
if (!next) {
|
|
360
|
-
next = first.nextSibling;
|
|
361
|
-
}
|
|
362
|
-
if (!next && first.parentNode !== root) {
|
|
363
|
-
do {
|
|
364
|
-
first = first.parentNode;
|
|
365
|
-
} while (first &&
|
|
366
|
-
!(first === null || first === void 0 ? void 0 : first.nextSibling) &&
|
|
367
|
-
first.parentNode !== root);
|
|
368
|
-
next = first === null || first === void 0 ? void 0 : first.nextSibling;
|
|
369
|
-
}
|
|
370
|
-
first = next;
|
|
371
|
-
} while (first);
|
|
372
|
-
return null;
|
|
350
|
+
return Dom.__deepMost(root, condition, false);
|
|
373
351
|
}
|
|
374
352
|
/**
|
|
375
353
|
* Get last matched node inside root
|
|
376
354
|
*/
|
|
377
355
|
static last(root, condition) {
|
|
378
|
-
|
|
379
|
-
|
|
356
|
+
return Dom.__deepMost(root, condition, true);
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* Depth-first search for the first matched node inside root:
|
|
360
|
+
* in document order (`reverse = false`) or in reverse order
|
|
361
|
+
*/
|
|
362
|
+
static __deepMost(root, condition, reverse) {
|
|
363
|
+
const child = reverse ? 'lastChild' : 'firstChild', sibling = reverse ? 'previousSibling' : 'nextSibling';
|
|
364
|
+
let current = root === null || root === void 0 ? void 0 : root[child];
|
|
365
|
+
if (!current) {
|
|
380
366
|
return null;
|
|
381
367
|
}
|
|
382
368
|
do {
|
|
383
|
-
if (condition(
|
|
384
|
-
return
|
|
385
|
-
}
|
|
386
|
-
let next = last.lastChild;
|
|
387
|
-
if (!next) {
|
|
388
|
-
next = last.previousSibling;
|
|
369
|
+
if (condition(current)) {
|
|
370
|
+
return current;
|
|
389
371
|
}
|
|
390
|
-
|
|
372
|
+
let next = current[child] || current[sibling];
|
|
373
|
+
if (!next && current.parentNode !== root) {
|
|
391
374
|
do {
|
|
392
|
-
|
|
393
|
-
} while (
|
|
394
|
-
!
|
|
395
|
-
|
|
396
|
-
next =
|
|
375
|
+
current = current.parentNode;
|
|
376
|
+
} while (current &&
|
|
377
|
+
!current[sibling] &&
|
|
378
|
+
current.parentNode !== root);
|
|
379
|
+
next = current === null || current === void 0 ? void 0 : current[sibling];
|
|
397
380
|
}
|
|
398
|
-
|
|
399
|
-
} while (
|
|
381
|
+
current = next;
|
|
382
|
+
} while (current);
|
|
400
383
|
return null;
|
|
401
384
|
}
|
|
402
385
|
/**
|
|
@@ -412,12 +395,17 @@ export class Dom {
|
|
|
412
395
|
return Dom.find(node, condition, root, true, withChild);
|
|
413
396
|
}
|
|
414
397
|
static prevWithClass(node, className) {
|
|
415
|
-
return Dom.
|
|
416
|
-
return (Dom.isElement(node) && node.classList.contains(className));
|
|
417
|
-
}, node.parentNode);
|
|
398
|
+
return Dom.__siblingWithClass(node, className, true);
|
|
418
399
|
}
|
|
419
400
|
static nextWithClass(node, className) {
|
|
420
|
-
return Dom.
|
|
401
|
+
return Dom.__siblingWithClass(node, className, false);
|
|
402
|
+
}
|
|
403
|
+
static __siblingWithClass(node, className, left) {
|
|
404
|
+
const condition = (elm) => Dom.isElement(elm) && elm.classList.contains(className);
|
|
405
|
+
const parent = node.parentNode;
|
|
406
|
+
return (left
|
|
407
|
+
? Dom.prev(node, condition, parent)
|
|
408
|
+
: Dom.next(node, condition, parent));
|
|
421
409
|
}
|
|
422
410
|
/**
|
|
423
411
|
* Find next/prev node what `condition(next) === true`
|
|
@@ -552,9 +540,6 @@ export class Dom {
|
|
|
552
540
|
(!(Dom.isText(n) || Dom.isComment(n)) ||
|
|
553
541
|
trim((n === null || n === void 0 ? void 0 : n.nodeValue) || '').length)), root);
|
|
554
542
|
}
|
|
555
|
-
/**
|
|
556
|
-
* Returns the previous (`left = true`) or next sibling of the node
|
|
557
|
-
*/
|
|
558
543
|
static sibling(node, left) {
|
|
559
544
|
return left ? node.previousSibling : node.nextSibling;
|
|
560
545
|
}
|
|
@@ -618,40 +603,24 @@ export class Dom {
|
|
|
618
603
|
* Append new element in the start of root
|
|
619
604
|
*/
|
|
620
605
|
static appendChildFirst(root, newElement) {
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
if (child !== newElement) {
|
|
624
|
-
root.insertBefore(newElement, child);
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
else {
|
|
628
|
-
root.appendChild(newElement);
|
|
606
|
+
if (root.firstChild !== newElement) {
|
|
607
|
+
Dom.prepend(root, newElement);
|
|
629
608
|
}
|
|
630
609
|
}
|
|
631
610
|
/**
|
|
632
611
|
* Insert newElement after element
|
|
633
612
|
*/
|
|
634
613
|
static after(elm, newElement) {
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
}
|
|
639
|
-
if (parentNode.lastChild === elm) {
|
|
640
|
-
parentNode.appendChild(newElement);
|
|
641
|
-
}
|
|
642
|
-
else {
|
|
643
|
-
parentNode.insertBefore(newElement, elm.nextSibling);
|
|
644
|
-
}
|
|
614
|
+
var _a;
|
|
615
|
+
// `insertBefore` with a `null` reference appends to the end
|
|
616
|
+
(_a = elm.parentNode) === null || _a === void 0 ? void 0 : _a.insertBefore(newElement, elm.nextSibling);
|
|
645
617
|
}
|
|
646
618
|
/**
|
|
647
619
|
* Insert newElement before element
|
|
648
620
|
*/
|
|
649
621
|
static before(elm, newElement) {
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
return;
|
|
653
|
-
}
|
|
654
|
-
parentNode.insertBefore(newElement, elm);
|
|
622
|
+
var _a;
|
|
623
|
+
(_a = elm.parentNode) === null || _a === void 0 ? void 0 : _a.insertBefore(newElement, elm);
|
|
655
624
|
}
|
|
656
625
|
/**
|
|
657
626
|
* Insert newElement as first child inside element
|
|
@@ -669,10 +638,10 @@ export class Dom {
|
|
|
669
638
|
root.appendChild(newElement);
|
|
670
639
|
}
|
|
671
640
|
}
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
641
|
+
static moveContent(from, to, inStart = false,
|
|
642
|
+
// `any` reconciles the browser `Node` overload with the `VNode` one:
|
|
643
|
+
// a callback typed for one is not assignable to the other
|
|
644
|
+
filter = () => true) {
|
|
676
645
|
const fragment = (from.ownerDocument || globalDocument).createDocumentFragment();
|
|
677
646
|
toArray(from.childNodes)
|
|
678
647
|
.filter(elm => {
|
|
@@ -682,15 +651,11 @@ export class Dom {
|
|
|
682
651
|
Dom.safeRemove(elm);
|
|
683
652
|
return false;
|
|
684
653
|
})
|
|
685
|
-
.forEach(
|
|
654
|
+
.forEach(node => {
|
|
686
655
|
fragment.appendChild(node);
|
|
687
656
|
});
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
}
|
|
691
|
-
else {
|
|
692
|
-
to.insertBefore(fragment, to.firstChild);
|
|
693
|
-
}
|
|
657
|
+
// `appendChild`/`insertBefore` with a `null` reference append to the end
|
|
658
|
+
to.insertBefore(fragment, inStart ? to.firstChild : null);
|
|
694
659
|
}
|
|
695
660
|
/**
|
|
696
661
|
* Check root contains child or equal child
|
|
@@ -740,8 +705,8 @@ export class Dom {
|
|
|
740
705
|
if (!node) {
|
|
741
706
|
return;
|
|
742
707
|
}
|
|
743
|
-
dataBind(node, '__old_display', node.style.display);
|
|
744
|
-
node.style.display
|
|
708
|
+
dataBind(node, '__old_display', node.style.getPropertyValue('display'));
|
|
709
|
+
node.style.setProperty('display', 'none');
|
|
745
710
|
}
|
|
746
711
|
/**
|
|
747
712
|
* Show element
|
|
@@ -751,8 +716,8 @@ export class Dom {
|
|
|
751
716
|
return;
|
|
752
717
|
}
|
|
753
718
|
const display = dataBind(node, '__old_display');
|
|
754
|
-
if (node.style.display === 'none') {
|
|
755
|
-
node.style.display
|
|
719
|
+
if (node.style.getPropertyValue('display') === 'none') {
|
|
720
|
+
node.style.setProperty('display', display || null);
|
|
756
721
|
}
|
|
757
722
|
}
|
|
758
723
|
static isTag(node, tagNames) {
|
|
@@ -801,10 +766,16 @@ export class Dom {
|
|
|
801
766
|
return value.replace(TEMP_ELEMENT_REG_EXP, '$2');
|
|
802
767
|
}
|
|
803
768
|
/**
|
|
804
|
-
*
|
|
805
|
-
*
|
|
769
|
+
* Collect the temporary elements (`data-jodit-temp`) inside the root.
|
|
770
|
+
* A plain tree walk on purpose: no selector engine, works on VNode.
|
|
806
771
|
*/
|
|
807
772
|
static temporaryList(root) {
|
|
808
|
-
|
|
773
|
+
const result = [];
|
|
774
|
+
Dom.each(root, node => {
|
|
775
|
+
if (Dom.isHTMLElement(node) && node.hasAttribute(TEMP_ATTR)) {
|
|
776
|
+
result.push(node);
|
|
777
|
+
}
|
|
778
|
+
});
|
|
779
|
+
return result;
|
|
809
780
|
}
|
|
810
781
|
}
|