jodit 4.16.1 → 4.17.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.
Files changed (67) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/es2015/jodit.css +1 -1
  3. package/es2015/jodit.fat.min.js +7 -7
  4. package/es2015/jodit.js +152 -29
  5. package/es2015/jodit.min.js +7 -7
  6. package/es2015/plugins/debug/debug.css +1 -1
  7. package/es2015/plugins/debug/debug.js +1 -1
  8. package/es2015/plugins/debug/debug.min.js +1 -1
  9. package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
  10. package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
  11. package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
  12. package/es2018/jodit.fat.min.js +7 -7
  13. package/es2018/jodit.min.js +7 -7
  14. package/es2018/plugins/debug/debug.min.js +1 -1
  15. package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
  16. package/es2021/jodit.css +1 -1
  17. package/es2021/jodit.fat.min.js +7 -7
  18. package/es2021/jodit.js +144 -28
  19. package/es2021/jodit.min.js +7 -7
  20. package/es2021/plugins/debug/debug.css +1 -1
  21. package/es2021/plugins/debug/debug.js +1 -1
  22. package/es2021/plugins/debug/debug.min.js +1 -1
  23. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  24. package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
  25. package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
  26. package/es2021.en/jodit.css +1 -1
  27. package/es2021.en/jodit.fat.min.js +7 -7
  28. package/es2021.en/jodit.js +144 -28
  29. package/es2021.en/jodit.min.js +7 -7
  30. package/es2021.en/plugins/debug/debug.css +1 -1
  31. package/es2021.en/plugins/debug/debug.js +1 -1
  32. package/es2021.en/plugins/debug/debug.min.js +1 -1
  33. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  34. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
  35. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
  36. package/es5/jodit.css +2 -2
  37. package/es5/jodit.fat.min.js +2 -2
  38. package/es5/jodit.js +161 -29
  39. package/es5/jodit.min.css +2 -2
  40. package/es5/jodit.min.js +2 -2
  41. package/es5/plugins/debug/debug.css +1 -1
  42. package/es5/plugins/debug/debug.js +1 -1
  43. package/es5/plugins/debug/debug.min.js +1 -1
  44. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  45. package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
  46. package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
  47. package/es5/polyfills.fat.min.js +1 -1
  48. package/es5/polyfills.js +1 -1
  49. package/es5/polyfills.min.js +1 -1
  50. package/esm/config.d.ts +40 -1
  51. package/esm/core/constants.js +1 -1
  52. package/esm/modules/widget/file-selector/file-selector.d.ts +10 -1
  53. package/esm/modules/widget/file-selector/file-selector.js +30 -18
  54. package/esm/plugins/file/file.d.ts +24 -1
  55. package/esm/plugins/file/file.js +17 -1
  56. package/esm/plugins/inline-popup/config/items/img.js +22 -1
  57. package/esm/plugins/source/editor/engines/ace.js +2 -1
  58. package/esm/plugins/source/source.d.ts +17 -0
  59. package/esm/plugins/source/source.js +60 -8
  60. package/esm/plugins/video/config.d.ts +21 -1
  61. package/esm/plugins/video/config.js +22 -2
  62. package/package.json +1 -1
  63. package/types/config.d.ts +40 -1
  64. package/types/modules/widget/file-selector/file-selector.d.ts +10 -1
  65. package/types/plugins/file/file.d.ts +24 -1
  66. package/types/plugins/source/source.d.ts +17 -0
  67. package/types/plugins/video/config.d.ts +21 -1
package/es5/jodit.js CHANGED
@@ -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.16.1
4
+ * Version: v4.17.0
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -2129,7 +2129,7 @@ __webpack_require__.r(__webpack_exports__);
2129
2129
  * @packageDocumentation
2130
2130
  * @module constants
2131
2131
  */
2132
- var APP_VERSION = "4.16.1";
2132
+ var APP_VERSION = "4.17.0";
2133
2133
  // prettier-ignore
2134
2134
  var ES = "es5";
2135
2135
  var IS_ES_MODERN = false;
@@ -31712,7 +31712,8 @@ jodit_core_ui__WEBPACK_IMPORTED_MODULE_2__.Icon.set('palette', (_palette_svg__WE
31712
31712
 
31713
31713
  "use strict";
31714
31714
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31715
- /* harmony export */ FileSelectorWidget: function() { return /* binding */ FileSelectorWidget; }
31715
+ /* harmony export */ FileSelectorWidget: function() { return /* binding */ FileSelectorWidget; },
31716
+ /* harmony export */ UploadTab: function() { return /* binding */ UploadTab; }
31716
31717
  /* harmony export */ });
31717
31718
  /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23211);
31718
31719
  /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(65946);
@@ -31744,22 +31745,19 @@ jodit_core_ui__WEBPACK_IMPORTED_MODULE_2__.Icon.set('palette', (_palette_svg__WE
31744
31745
  var tabs = [];
31745
31746
  var options = editor.o.uploader;
31746
31747
  if (callbacks.upload && options.showTabInFileSelector !== false && (options.url || options.insertImageAsBase64URI || options.customUploadFunction)) {
31747
- var dragBox = editor.c.fromHTML('<div class="jodit-drag-and-drop__file-box">' + "<strong>".concat(editor.i18n(isImage ? 'Drop image' : 'Drop file'), "</strong>") + "<span><br>".concat(editor.i18n('or click'), "</span>") + '<input type="file" accept="'.concat(isImage ? 'image/*' : '*', '" tabindex="-1" dir="auto" multiple=""/>') + '</div>');
31748
- editor.uploader.bind(dragBox, function(resp) {
31749
- var handler = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.isFunction)(callbacks.upload) ? callbacks.upload : options.defaultHandlerSuccess;
31748
+ var upload = callbacks.upload;
31749
+ tabs.push(UploadTab(editor, function(resp) {
31750
+ var handler = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.isFunction)(upload) ? upload : options.defaultHandlerSuccess;
31750
31751
  if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.isFunction)(handler)) {
31751
31752
  handler.call(editor, resp);
31752
31753
  }
31753
- editor.e.fire('closeAllPopups');
31754
- }, function(error) {
31755
- editor.message.error(error.message);
31756
- editor.e.fire('closeAllPopups');
31757
- });
31758
- tabs.push({
31759
- icon: 'upload',
31760
- name: 'Upload',
31761
- content: dragBox
31762
- });
31754
+ }, isImage ? {
31755
+ label: 'Drop image',
31756
+ accept: 'image/*'
31757
+ } : {
31758
+ label: 'Drop file',
31759
+ accept: '*'
31760
+ }));
31763
31761
  }
31764
31762
  if (callbacks.filebrowser) {
31765
31763
  if (editor.o.filebrowser.ajax.url || editor.o.filebrowser.items.url) {
@@ -31827,6 +31825,25 @@ jodit_core_ui__WEBPACK_IMPORTED_MODULE_2__.Icon.set('palette', (_palette_svg__WE
31827
31825
  box.classList.add('jodit-file-selector');
31828
31826
  return box;
31829
31827
  };
31828
+ /**
31829
+ * The Upload tab: a box that uploads the files dropped on it or chosen in its
31830
+ * file input, then passes the uploader's answer to `onSuccess` and closes the popup
31831
+ */ var UploadTab = function UploadTab(editor, onSuccess, param) {
31832
+ var label = param.label, accept = param.accept;
31833
+ var dragBox = editor.c.fromHTML('<div class="jodit-drag-and-drop__file-box">' + "<strong>".concat(editor.i18n(label), "</strong>") + "<span><br>".concat(editor.i18n('or click'), "</span>") + '<input type="file" accept="'.concat(accept, '" tabindex="-1" dir="auto" multiple=""/>') + '</div>');
31834
+ editor.uploader.bind(dragBox, function(resp) {
31835
+ onSuccess.call(editor, resp);
31836
+ editor.e.fire('closeAllPopups');
31837
+ }, function(error) {
31838
+ editor.message.error(error.message);
31839
+ editor.e.fire('closeAllPopups');
31840
+ });
31841
+ return {
31842
+ icon: 'upload',
31843
+ name: 'Upload',
31844
+ content: dragBox
31845
+ };
31846
+ };
31830
31847
  function val(elm, name, value) {
31831
31848
  var child = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.first(elm, function(node) {
31832
31849
  return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(node, 'input') && (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.attr)(node, 'name') === name;
@@ -31850,7 +31867,8 @@ function val(elm, name, value) {
31850
31867
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31851
31868
  /* harmony export */ ColorPickerWidget: function() { return /* reexport safe */ _color_picker_color_picker__WEBPACK_IMPORTED_MODULE_0__.ColorPickerWidget; },
31852
31869
  /* harmony export */ FileSelectorWidget: function() { return /* reexport safe */ _file_selector_file_selector__WEBPACK_IMPORTED_MODULE_1__.FileSelectorWidget; },
31853
- /* harmony export */ TabsWidget: function() { return /* reexport safe */ _tabs_tabs__WEBPACK_IMPORTED_MODULE_2__.TabsWidget; }
31870
+ /* harmony export */ TabsWidget: function() { return /* reexport safe */ _tabs_tabs__WEBPACK_IMPORTED_MODULE_2__.TabsWidget; },
31871
+ /* harmony export */ UploadTab: function() { return /* reexport safe */ _file_selector_file_selector__WEBPACK_IMPORTED_MODULE_1__.UploadTab; }
31854
31872
  /* harmony export */ });
31855
31873
  /* harmony import */ var _color_picker_color_picker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(72348);
31856
31874
  /* harmony import */ var _file_selector_file_selector__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(18762);
@@ -38179,6 +38197,20 @@ function brBefore(start) {
38179
38197
 
38180
38198
 
38181
38199
 
38200
+ function insertLinks(data) {
38201
+ var _this = this;
38202
+ var _data_files;
38203
+ (_data_files = data.files) === null || _data_files === void 0 ? void 0 : _data_files.forEach(function(file) {
38204
+ var link = _this.createInside.element('a', {
38205
+ href: data.baseurl + file
38206
+ });
38207
+ link.textContent = _this.o.uploader.getDisplayName.call(_this.uploader, data.baseurl, file);
38208
+ _this.s.insertNode(link);
38209
+ });
38210
+ }
38211
+ jodit_config__WEBPACK_IMPORTED_MODULE_3__.Config.prototype.file = {
38212
+ defaultHandlerSuccess: insertLinks
38213
+ };
38182
38214
  jodit_config__WEBPACK_IMPORTED_MODULE_3__.Config.prototype.controls.file = {
38183
38215
  popup: function popup(editor, current, close) {
38184
38216
  var insert = function insert(url) {
@@ -38196,7 +38228,11 @@ jodit_config__WEBPACK_IMPORTED_MODULE_3__.Config.prototype.controls.file = {
38196
38228
  });
38197
38229
  close();
38198
38230
  },
38199
- upload: true,
38231
+ upload: function upload(data) {
38232
+ var _ref;
38233
+ var _editor_o_file;
38234
+ ((_ref = (_editor_o_file = editor.o.file) === null || _editor_o_file === void 0 ? void 0 : _editor_o_file.defaultHandlerSuccess) !== null && _ref !== void 0 ? _ref : insertLinks).call(editor, data);
38235
+ },
38200
38236
  url: function url(url, text) {
38201
38237
  if (sourceAnchor) {
38202
38238
  (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attr)(sourceAnchor, 'href', url);
@@ -42226,6 +42262,26 @@ var cmd = function cmd(control) {
42226
42262
  var alignClasses = function alignClasses(editor, elm) {
42227
42263
  return jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(elm, 'img') ? editor.o.imageAlignClasses : null;
42228
42264
  };
42265
+ // A Normal image sits where the text of its line is aligned (#1531)
42266
+ var lineAlign = function lineAlign(editor, elm) {
42267
+ var block = elm && jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(elm, jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock, editor.editor) || editor.editor;
42268
+ var rtl = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_4__.css)(block, 'direction') === 'rtl';
42269
+ switch((0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_4__.css)(block, 'text-align')){
42270
+ case 'center':
42271
+ case '-webkit-center':
42272
+ return 'center';
42273
+ case 'justify':
42274
+ return 'justify';
42275
+ case 'right':
42276
+ return 'right';
42277
+ case 'end':
42278
+ return rtl ? 'left' : 'right';
42279
+ case 'start':
42280
+ return rtl ? 'right' : 'left';
42281
+ default:
42282
+ return 'left';
42283
+ }
42284
+ };
42229
42285
  var currentAlign = function currentAlign(editor, elm) {
42230
42286
  return elm ? (0,jodit_core_helpers_utils_align__WEBPACK_IMPORTED_MODULE_3__.getHAlign)(elm, alignClasses(editor, elm)) : 'normal';
42231
42287
  };
@@ -42242,7 +42298,7 @@ var align = {
42242
42298
  ],
42243
42299
  update: function update(editor, button) {
42244
42300
  var current = currentAlign(editor, button.target);
42245
- button.state.icon.name = current === 'normal' ? 'left' : current;
42301
+ button.state.icon.name = current === 'normal' ? lineAlign(editor, button.target) : current;
42246
42302
  },
42247
42303
  isActive: function isActive(editor, button) {
42248
42304
  return currentAlign(editor, button.target) !== 'normal';
@@ -50221,7 +50277,8 @@ var AceEditor = /*#__PURE__*/ function(SourceEditor) {
50221
50277
  }
50222
50278
  return;
50223
50279
  }
50224
- _this.fromWYSIWYG();
50280
+ // The source plugin carries the fallback editor's text over when this
50281
+ // one is ready; refilling from WYSIWYG here would drop unsynced typing
50225
50282
  tryInitAceEditor();
50226
50283
  };
50227
50284
  editor.e.on('afterSetMode', initAceEditor);
@@ -50725,7 +50782,10 @@ var SourceEditor = /*#__PURE__*/ function() {
50725
50782
  name: 'source',
50726
50783
  group: 'source'
50727
50784
  }
50728
- ]), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "sourceEditor", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "mirrorContainer", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__lock", false), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__oldMirrorValue", ''), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "tempMarkerStart", '{start-jodit-selection}'), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "tempMarkerStartReg", /{start-jodit-selection}/g), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "tempMarkerEnd", '{end-jodit-selection}'), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "tempMarkerEndReg", /{end-jodit-selection}/g), // override it for ace editors
50785
+ ]), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "sourceEditor", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "mirrorContainer", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__lock", false), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__oldMirrorValue", ''), /**
50786
+ * What the source view was last filled with from WYSIWYG, read back from
50787
+ * the editor; while the view still holds it, nothing has been typed there
50788
+ */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__filledValue", ''), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "tempMarkerStart", '{start-jodit-selection}'), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "tempMarkerStartReg", /{start-jodit-selection}/g), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "tempMarkerEnd", '{end-jodit-selection}'), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "tempMarkerEndReg", /{end-jodit-selection}/g), // override it for ace editors
50729
50789
  (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "getSelectionStart", function() {
50730
50790
  var _ref;
50731
50791
  var _this_sourceEditor;
@@ -50761,6 +50821,7 @@ var SourceEditor = /*#__PURE__*/ function() {
50761
50821
  if (new_value !== this.getMirrorValue()) {
50762
50822
  this.setMirrorValue(new_value);
50763
50823
  }
50824
+ this.__filledValue = this.getMirrorValue();
50764
50825
  this.__lock = false;
50765
50826
  }
50766
50827
  }
@@ -50979,9 +51040,9 @@ var SourceEditor = /*#__PURE__*/ function() {
50979
51040
  return;
50980
51041
  }
50981
51042
  loading = true;
50982
- // It formats the source view from the next time it opens:
50983
- // filling it again now would replace what was typed there
50984
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.loadNext)(editor, editor.o.beautifyHTMLCDNUrlsJS).then(addEventListener, function() {
51043
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.loadNext)(editor, editor.o.beautifyHTMLCDNUrlsJS).then(function() {
51044
+ addEventListener() && _this.beautifyUntouched();
51045
+ }, function() {
50985
51046
  return null;
50986
51047
  });
50987
51048
  };
@@ -51010,10 +51071,8 @@ var SourceEditor = /*#__PURE__*/ function() {
51010
51071
  if (editor.o.sourceEditor !== 'area') {
51011
51072
  var sourceEditor = (0,_editor_factory__WEBPACK_IMPORTED_MODULE_14__.createSourceEditor)(editor.o.sourceEditor, editor, this.mirrorContainer, this.toWYSIWYG, this.fromWYSIWYG);
51012
51073
  sourceEditor.onReadyAlways(function() {
51013
- var _this_sourceEditor, _editor_events;
51014
- (_this_sourceEditor = _this.sourceEditor) === null || _this_sourceEditor === void 0 ? void 0 : _this_sourceEditor.destruct();
51015
- _this.sourceEditor = sourceEditor;
51016
- _this.syncValueFromWYSIWYG(true);
51074
+ var _editor_events;
51075
+ _this.takeOver(sourceEditor);
51017
51076
  (_editor_events = editor.events) === null || _editor_events === void 0 ? void 0 : _editor_events.fire('sourceEditorReady', editor);
51018
51077
  });
51019
51078
  } else {
@@ -51026,6 +51085,55 @@ var SourceEditor = /*#__PURE__*/ function() {
51026
51085
  }
51027
51086
  }
51028
51087
  },
51088
+ {
51089
+ key: "takeOver",
51090
+ value: /**
51091
+ * Replaces the source editor (the textarea shown while ACE loads) with
51092
+ * the one that just became ready, carrying its text, selection and focus
51093
+ * over. Filling the new editor from WYSIWYG instead would drop what was
51094
+ * typed since the last, debounced, sync and normalise half-typed markup.
51095
+ */ function takeOver(sourceEditor) {
51096
+ var previous = this.sourceEditor;
51097
+ if (!previous || previous === sourceEditor) {
51098
+ this.sourceEditor = sourceEditor;
51099
+ this.syncValueFromWYSIWYG(true);
51100
+ return;
51101
+ }
51102
+ var value = previous.getValue(), start = previous.getSelectionStart(), end = previous.getSelectionEnd(), focused = previous.isFocused, untouched = value === this.__filledValue;
51103
+ previous.destruct();
51104
+ this.sourceEditor = sourceEditor;
51105
+ if (untouched) {
51106
+ this.syncValueFromWYSIWYG(true);
51107
+ } else {
51108
+ sourceEditor.setValue(value);
51109
+ this.toWYSIWYG();
51110
+ }
51111
+ if (start >= 0) {
51112
+ sourceEditor.setSelectionRange(start, end);
51113
+ }
51114
+ focused && sourceEditor.focus();
51115
+ }
51116
+ },
51117
+ {
51118
+ key: "beautifyUntouched",
51119
+ value: /**
51120
+ * The beautifier arrived after the source view was opened: format the
51121
+ * view if nothing has been typed into it, otherwise leave the typing alone
51122
+ */ function beautifyUntouched() {
51123
+ var value = this.getMirrorValue();
51124
+ if (this.j.o.editHTMLDocumentMode || !value || value !== this.__filledValue) {
51125
+ return;
51126
+ }
51127
+ var html = this.j.e.fire('beautifyHTML', value);
51128
+ if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.isString)(html) && html !== value) {
51129
+ var _this_sourceEditor, _this_sourceEditor1;
51130
+ var focused = (_this_sourceEditor = this.sourceEditor) === null || _this_sourceEditor === void 0 ? void 0 : _this_sourceEditor.isFocused;
51131
+ this.setMirrorValue(html);
51132
+ this.__filledValue = this.getMirrorValue();
51133
+ focused && ((_this_sourceEditor1 = this.sourceEditor) === null || _this_sourceEditor1 === void 0 ? void 0 : _this_sourceEditor1.focus());
51134
+ }
51135
+ }
51136
+ },
51029
51137
  {
51030
51138
  /** @override */ key: "beforeDestruct",
51031
51139
  value: function beforeDestruct() {
@@ -53601,10 +53709,21 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_11__.pluginSystem.add('toolbarNavigat
53601
53709
 
53602
53710
 
53603
53711
 
53712
+ function insertVideos(data) {
53713
+ var _this = this;
53714
+ var _data_files;
53715
+ (_data_files = data.files) === null || _data_files === void 0 ? void 0 : _data_files.forEach(function(file) {
53716
+ _this.s.insertNode(_this.createInside.element('video', {
53717
+ controls: '',
53718
+ src: data.baseurl + file
53719
+ }));
53720
+ });
53721
+ }
53604
53722
  jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.video = {
53605
53723
  parseUrlToVideoEmbed: jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.convertMediaUrlToVideoEmbed,
53606
53724
  defaultWidth: 400,
53607
- defaultHeight: 345
53725
+ defaultHeight: 345,
53726
+ defaultHandlerSuccess: insertVideos
53608
53727
  };
53609
53728
  jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__.Icon.set('video', (_video_svg__WEBPACK_IMPORTED_MODULE_6___default()));
53610
53729
  jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.video = {
@@ -53645,6 +53764,19 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.video = {
53645
53764
  close();
53646
53765
  };
53647
53766
  jodit.s.save();
53767
+ var uploader = jodit.o.uploader;
53768
+ // Base64 alone would put whole video files into the content
53769
+ if (uploader.showTabInFileSelector !== false && (uploader.url || uploader.customUploadFunction)) {
53770
+ tabs.push((0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_5__.UploadTab)(jodit, function(data) {
53771
+ var _ref;
53772
+ var _jodit_o_video;
53773
+ jodit.s.restore();
53774
+ ((_ref = (_jodit_o_video = jodit.o.video) === null || _jodit_o_video === void 0 ? void 0 : _jodit_o_video.defaultHandlerSuccess) !== null && _ref !== void 0 ? _ref : insertVideos).call(jodit, data);
53775
+ }, {
53776
+ label: 'Drop file',
53777
+ accept: 'video/*'
53778
+ }));
53779
+ }
53648
53780
  tabs.push({
53649
53781
  icon: 'link',
53650
53782
  name: 'Link',
package/es5/jodit.min.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.16.1
4
+ * Version: v4.17.0
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.16.1
11
+ * Version: v4.17.0
12
12
  * Url: https://xdsoft.net/jodit/
13
13
  * License(s): MIT
14
14
  */