jodit 3.23.1 → 3.23.3

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 (39) hide show
  1. package/README.md +4 -4
  2. package/build/jodit.css +2 -2
  3. package/build/jodit.es2018.css +1 -1
  4. package/build/jodit.es2018.en.css +1 -1
  5. package/build/jodit.es2018.en.js +28 -16
  6. package/build/jodit.es2018.en.min.js +1 -1
  7. package/build/jodit.es2018.js +28 -16
  8. package/build/jodit.es2018.min.js +1 -1
  9. package/build/jodit.js +46 -35
  10. package/build/jodit.min.css +1 -1
  11. package/build/jodit.min.js +1 -1
  12. package/build/plugins/debug/debug.es2018.en.js +1 -1
  13. package/build/plugins/debug/debug.es2018.js +1 -1
  14. package/build/plugins/debug/debug.js +1 -1
  15. package/build/plugins/speech-recognize/speech-recognize.css +1 -1
  16. package/build/plugins/speech-recognize/speech-recognize.es2018.css +1 -1
  17. package/build/plugins/speech-recognize/speech-recognize.es2018.en.css +1 -1
  18. package/build/plugins/speech-recognize/speech-recognize.es2018.en.js +1 -1
  19. package/build/plugins/speech-recognize/speech-recognize.es2018.js +1 -1
  20. package/build/plugins/speech-recognize/speech-recognize.js +1 -1
  21. package/build/vdom.css +1 -1
  22. package/build/vdom.js +1 -1
  23. package/package.json +1 -1
  24. package/src/core/request/ajax.ts +8 -0
  25. package/src/core/request/config.ts +0 -1
  26. package/src/core/ui/element.ts +10 -6
  27. package/src/jodit.ts +2 -0
  28. package/src/modules/file-browser/README.md +0 -3
  29. package/src/modules/file-browser/config.ts +0 -2
  30. package/src/modules/history/snapshot.ts +1 -3
  31. package/src/modules/toolbar/button/button.ts +7 -1
  32. package/src/modules/uploader/helpers/send.ts +0 -1
  33. package/src/types/ajax.d.ts +0 -6
  34. package/src/types/file-browser.d.ts +0 -2
  35. package/src/types/toolbar.d.ts +43 -6
  36. package/types/core/ui/element.d.ts +1 -0
  37. package/types/types/ajax.d.ts +0 -6
  38. package/types/types/file-browser.d.ts +0 -2
  39. package/types/types/toolbar.d.ts +43 -6
package/README.md CHANGED
@@ -58,9 +58,9 @@ ES2018 Version (if your users use only modern browsers)
58
58
  ```html
59
59
  <link
60
60
  rel="stylesheet"
61
- href="https://cdnjs.cloudflare.com/ajax/libs/jodit/3.21.6/jodit.es2018.min.css"
61
+ href="https://cdnjs.cloudflare.com/ajax/libs/jodit/3.23.2/jodit.es2018.min.css"
62
62
  />
63
- <script src="https://cdnjs.cloudflare.com/ajax/libs/jodit/3.21.6/jodit.es2018.min.js"></script>
63
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/jodit/3.23.2/jodit.es2018.min.js"></script>
64
64
  ```
65
65
 
66
66
  #### unpkg
@@ -69,9 +69,9 @@ ES2018 Version (if your users use only modern browsers)
69
69
  ```html
70
70
  <link
71
71
  rel="stylesheet"
72
- href="https://unpkg.com/jodit@3.21.6/build/jodit.es2018.min.css"
72
+ href="https://unpkg.com/jodit@3.23.2/build/jodit.es2018.min.css"
73
73
  />
74
- <script src="https://unpkg.com/jodit@3.21.6/build/jodit.es2018.min.js"></script>
74
+ <script src="https://unpkg.com/jodit@3.23.2/build/jodit.es2018.min.js"></script>
75
75
  ```
76
76
 
77
77
 
package/build/jodit.css CHANGED
@@ -1,14 +1,14 @@
1
1
  /*!
2
2
  * jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/)
4
- * Version: v3.23.1
4
+ * Version: v3.23.3
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
8
8
  /*!
9
9
  * jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser
10
10
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/)
11
- * Version: v3.23.1
11
+ * Version: v3.23.3
12
12
  * Url: https://xdsoft.net/jodit/
13
13
  * License(s): MIT
14
14
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/)
4
- * Version: v3.23.1
4
+ * Version: v3.23.3
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/)
4
- * Version: v3.23.1
4
+ * Version: v3.23.3
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/)
4
- * Version: v3.23.1
4
+ * Version: v3.23.3
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -7782,7 +7782,6 @@ var decorators = __webpack_require__(63945);
7782
7782
 
7783
7783
  config/* Config.prototype.defaultAjaxOptions */.D.prototype.defaultAjaxOptions = {
7784
7784
  successStatuses: [200, 201, 202],
7785
- dataType: 'json',
7786
7785
  method: 'GET',
7787
7786
  url: '',
7788
7787
  data: null,
@@ -7820,6 +7819,11 @@ class Ajax {
7820
7819
  this.xhr = this.o.xhr ? this.o.xhr() : new XMLHttpRequest();
7821
7820
  }
7822
7821
  __buildParams(obj, prefix) {
7822
+ if ((0,helpers.isPlainObject)(obj) &&
7823
+ this.options.contentType &&
7824
+ this.options.contentType.includes('application/json')) {
7825
+ return JSON.stringify(obj);
7826
+ }
7823
7827
  if ((0,helpers.isFunction)(this.o.queryBuild)) {
7824
7828
  return this.o.queryBuild.call(this, obj, prefix);
7825
7829
  }
@@ -10580,15 +10584,18 @@ let UIElement = UIElement_1 = class UIElement extends jodit_core_component__WEBP
10580
10584
  createContainer(options) {
10581
10585
  const result = this.render(options);
10582
10586
  if ((0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_5__/* .isString */ .H)(result)) {
10583
- const elm = this.j.c.fromHTML(result
10584
- .replace(/\*([^*]+?)\*/g, (_, name) => jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__/* .Icon.get */ .J.get(name) || '')
10585
- .replace(/&__/g, this.componentName + '__')
10586
- .replace(/~([^~]+?)~/g, (_, s) => this.i18n(s)));
10587
+ const elm = this.parseTemplate(result);
10587
10588
  elm.classList.add(this.componentName);
10588
10589
  return elm;
10589
10590
  }
10590
10591
  return result;
10591
10592
  }
10593
+ parseTemplate(result) {
10594
+ return this.j.c.fromHTML(result
10595
+ .replace(/\*([^*]+?)\*/g, (_, name) => jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__/* .Icon.get */ .J.get(name) || '')
10596
+ .replace(/&__/g, this.componentName + '__')
10597
+ .replace(/~([^~]+?)~/g, (_, s) => this.i18n(s)));
10598
+ }
10592
10599
  destruct() {
10593
10600
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom.safeRemove */ .i.safeRemove(this.container);
10594
10601
  this.parentElement = null;
@@ -12482,7 +12489,7 @@ let View = View_1 = class View extends jodit_modules__WEBPACK_IMPORTED_MODULE_3_
12482
12489
  this.parent = null;
12483
12490
  this.mods = {};
12484
12491
  this.components = new Set();
12485
- this.version = "3.23.1";
12492
+ this.version = "3.23.3";
12486
12493
  this.buffer = _storage__WEBPACK_IMPORTED_MODULE_0__/* .Storage.makeStorage */ .Ke.makeStorage();
12487
12494
  this.storage = _storage__WEBPACK_IMPORTED_MODULE_0__/* .Storage.makeStorage */ .Ke.makeStorage(true, this.componentName);
12488
12495
  this.OPTIONS = View_1.defaultOptions;
@@ -12564,10 +12571,10 @@ let View = View_1 = class View extends jodit_modules__WEBPACK_IMPORTED_MODULE_3_
12564
12571
  return this.__isFullSize;
12565
12572
  }
12566
12573
  getVersion() {
12567
- return "3.23.1";
12574
+ return "3.23.3";
12568
12575
  }
12569
12576
  static getVersion() {
12570
- return "3.23.1";
12577
+ return "3.23.3";
12571
12578
  }
12572
12579
  initOptions(options) {
12573
12580
  this.options = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.ConfigProto)(options || {}, (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.ConfigProto)(this.options || {}, View_1.defaultOptions));
@@ -13938,13 +13945,11 @@ config/* Config.prototype.filebrowser */.D.prototype.filebrowser = {
13938
13945
  ajax: {
13939
13946
  ...config/* Config.prototype.defaultAjaxOptions */.D.prototype.defaultAjaxOptions,
13940
13947
  url: '',
13941
- async: true,
13942
13948
  data: {},
13943
13949
  cache: true,
13944
13950
  contentType: 'application/x-www-form-urlencoded; charset=UTF-8',
13945
13951
  method: 'POST',
13946
13952
  processData: true,
13947
- dataType: 'json',
13948
13953
  headers: {},
13949
13954
  prepareData(data) {
13950
13955
  return data;
@@ -15939,9 +15944,7 @@ class Snapshot extends component/* ViewComponent */.Hr {
15939
15944
  if (value !== snapshot.html) {
15940
15945
  this.j.value = snapshot.html;
15941
15946
  }
15942
- if (this.j.s.isFocused()) {
15943
- this.restoreOnlySelection(snapshot);
15944
- }
15947
+ this.restoreOnlySelection(snapshot);
15945
15948
  this.restoreScrollState(scroll);
15946
15949
  });
15947
15950
  }
@@ -16412,7 +16415,6 @@ function send(uploader, data) {
16412
16415
  headers: uploader.o.headers,
16413
16416
  queryBuild: uploader.o.queryBuild,
16414
16417
  contentType: uploader.o.contentType.call(uploader, request),
16415
- dataType: uploader.o.format || 'json',
16416
16418
  withCredentials: uploader.o.withCredentials || false
16417
16419
  });
16418
16420
  let instances = ajaxInstances.get(uploader);
@@ -17869,7 +17871,15 @@ let ToolbarButton = class ToolbarButton extends jodit_core_ui_button__WEBPACK_IM
17869
17871
  name: key.toString(),
17870
17872
  template: childTemplate &&
17871
17873
  ((j, k, v) => childTemplate(j, k, v, this)),
17872
- exec: control.exec,
17874
+ exec: control.childExec
17875
+ ? (view, current, options) => {
17876
+ var _a;
17877
+ return (_a = control.childExec) === null || _a === void 0 ? void 0 : _a.call(control, view, current, {
17878
+ ...options,
17879
+ parentControl: control
17880
+ });
17881
+ }
17882
+ : control.exec,
17873
17883
  data: control.data,
17874
17884
  command: control.command,
17875
17885
  isActive: control.isChildActive,
@@ -21458,9 +21468,11 @@ let Jodit = Jodit_1 = class Jodit extends modules.ViewWithToolbar {
21458
21468
  }, this.o.defaultAjaxOptions);
21459
21469
  const destroy = () => {
21460
21470
  this.e.off('beforeDestruct', destroy);
21471
+ this.progressbar.progress(100).hide();
21461
21472
  ajax.destruct();
21462
21473
  };
21463
21474
  this.e.one('beforeDestruct', destroy);
21475
+ this.progressbar.show().progress(30);
21464
21476
  const promise = ajax.send();
21465
21477
  promise.finally(destroy).catch(() => null);
21466
21478
  return promise;