jodit 4.0.0-beta.92 → 4.0.0-beta.95

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 (59) hide show
  1. package/CHANGELOG.md +13 -5
  2. package/README.md +5 -5
  3. package/es2015/jodit.css +1 -1
  4. package/es2015/jodit.fat.min.js +2 -2
  5. package/es2015/jodit.js +33 -10
  6. package/es2015/jodit.min.js +2 -2
  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.css +1 -1
  13. package/es2018/jodit.fat.min.js +2 -2
  14. package/es2018/jodit.js +33 -10
  15. package/es2018/jodit.min.js +2 -2
  16. package/es2018/plugins/debug/debug.js +1 -1
  17. package/es2018/plugins/debug/debug.min.js +1 -1
  18. package/es2018/plugins/speech-recognize/speech-recognize.css +1 -1
  19. package/es2018/plugins/speech-recognize/speech-recognize.js +1 -1
  20. package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
  21. package/es2021/jodit.css +1 -1
  22. package/es2021/jodit.fat.min.js +2 -2
  23. package/es2021/jodit.js +33 -10
  24. package/es2021/jodit.min.js +2 -2
  25. package/es2021/plugins/debug/debug.js +1 -1
  26. package/es2021/plugins/debug/debug.min.js +1 -1
  27. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  28. package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
  29. package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
  30. package/es2021.en/jodit.css +1 -1
  31. package/es2021.en/jodit.fat.min.js +2 -2
  32. package/es2021.en/jodit.js +33 -10
  33. package/es2021.en/jodit.min.js +2 -2
  34. package/es2021.en/plugins/debug/debug.js +1 -1
  35. package/es2021.en/plugins/debug/debug.min.js +1 -1
  36. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  37. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
  38. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
  39. package/es5/jodit.css +2 -2
  40. package/es5/jodit.fat.min.js +2 -2
  41. package/es5/jodit.js +37 -10
  42. package/es5/jodit.min.css +2 -2
  43. package/es5/jodit.min.js +2 -2
  44. package/es5/plugins/debug/debug.js +1 -1
  45. package/es5/plugins/debug/debug.min.js +1 -1
  46. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  47. package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
  48. package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
  49. package/esm/core/constants.js +1 -1
  50. package/esm/core/selection/selection.js +14 -5
  51. package/esm/core/view/view.d.ts +1 -0
  52. package/esm/core/view/view.js +4 -1
  53. package/esm/jodit.d.ts +2 -1
  54. package/esm/jodit.js +6 -0
  55. package/esm/modules/uploader/helpers/send.js +6 -1
  56. package/esm/plugins/wrap-nodes/wrap-nodes.js +2 -2
  57. package/package.json +1 -1
  58. package/types/core/view/view.d.ts +1 -0
  59. package/types/jodit.d.ts +2 -1
@@ -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/jodit/)
4
- * Version: v4.0.0-beta.92
4
+ * Version: v4.0.0-beta.95
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1716,7 +1716,7 @@ __webpack_require__.r(__webpack_exports__);
1716
1716
  * Released under MIT see LICENSE.txt in the project root for license information.
1717
1717
  * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
1718
1718
  */
1719
- const APP_VERSION = "4.0.0-beta.92";
1719
+ const APP_VERSION = "4.0.0-beta.95";
1720
1720
  // prettier-ignore
1721
1721
  const ES = "es2021";
1722
1722
  const IS_ES_MODERN = true;
@@ -10703,7 +10703,7 @@ class Selection {
10703
10703
  const range = this.createRange();
10704
10704
  let start = node, last = node;
10705
10705
  do {
10706
- if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isText(start)) {
10706
+ if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isText(start) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isTag(start, jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INSEPARABLE_TAGS)) {
10707
10707
  break;
10708
10708
  }
10709
10709
  last = start;
@@ -10711,7 +10711,7 @@ class Selection {
10711
10711
  } while (start);
10712
10712
  if (!start) {
10713
10713
  const fakeNode = this.j.createInside.text(jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INVISIBLE_SPACE);
10714
- if (!/^(img|br|input)$/i.test(last.nodeName)) {
10714
+ if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isTag(last, jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INSEPARABLE_TAGS)) {
10715
10715
  last.appendChild(fakeNode);
10716
10716
  last = fakeNode;
10717
10717
  }
@@ -10719,8 +10719,17 @@ class Selection {
10719
10719
  start = last;
10720
10720
  }
10721
10721
  }
10722
- range.selectNodeContents(start || last);
10723
- range.collapse(inStart);
10722
+ const workElm = start || last;
10723
+ if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isTag(workElm, jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INSEPARABLE_TAGS)) {
10724
+ range.selectNodeContents(workElm);
10725
+ range.collapse(inStart);
10726
+ }
10727
+ else {
10728
+ inStart || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isTag(workElm, 'br')
10729
+ ? range.setStartBefore(workElm)
10730
+ : range.setEndAfter(workElm);
10731
+ range.collapse(inStart);
10732
+ }
10724
10733
  this.selectRange(range);
10725
10734
  return last;
10726
10735
  }
@@ -15766,7 +15775,10 @@ let View = View_1 = class View extends jodit_modules__WEBPACK_IMPORTED_MODULE_3_
15766
15775
  return jodit_core_storage__WEBPACK_IMPORTED_MODULE_0__/* .Storage */ .Ke.makeStorage();
15767
15776
  }
15768
15777
  get message() {
15769
- return new jodit_modules_messages_messages__WEBPACK_IMPORTED_MODULE_8__/* .UIMessages */ .D(this, this.container);
15778
+ return this.getMessageModule(this.container);
15779
+ }
15780
+ getMessageModule(container) {
15781
+ return new jodit_modules_messages_messages__WEBPACK_IMPORTED_MODULE_8__/* .UIMessages */ .D(this, container);
15770
15782
  }
15771
15783
  /**
15772
15784
  * Container for persistent set/get value
@@ -16157,6 +16169,9 @@ let Jodit = Jodit_1 = class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE
16157
16169
  get workplace() {
16158
16170
  return this.currentPlace.workplace;
16159
16171
  }
16172
+ get message() {
16173
+ return this.getMessageModule(this.workplace);
16174
+ }
16160
16175
  /**
16161
16176
  * Statusbar module
16162
16177
  */
@@ -17244,6 +17259,9 @@ Jodit.core = {
17244
17259
  (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .gn)([
17245
17260
  jodit_core_decorators__WEBPACK_IMPORTED_MODULE_5__.cache
17246
17261
  ], Jodit.prototype, "createInside", null);
17262
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .gn)([
17263
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_5__.cache
17264
+ ], Jodit.prototype, "message", null);
17247
17265
  (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .gn)([
17248
17266
  jodit_core_decorators__WEBPACK_IMPORTED_MODULE_5__.cache
17249
17267
  ], Jodit.prototype, "s", null);
@@ -23957,7 +23975,12 @@ function send(uploader, data) {
23957
23975
  .send()
23958
23976
  .then(resp => resp.json())
23959
23977
  .catch(error => {
23960
- uploader.o.error.call(uploader, error);
23978
+ return {
23979
+ success: false,
23980
+ data: {
23981
+ messages: [error]
23982
+ }
23983
+ };
23961
23984
  })
23962
23985
  .finally(() => {
23963
23986
  ajax.destruct();
@@ -39341,10 +39364,10 @@ class wrapNodes extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_0__/* .Plugin
39341
39364
  return;
39342
39365
  }
39343
39366
  jodit.e
39344
- .on('drop.wtn focus.wtn keydown.wtn mousedown.wtn afterInit.wtn', this.preprocessInput, {
39367
+ .on('drop.wtn focus.wtn keydown.wtn mousedown.wtn afterInit.wtn backSpaceAfterDelete.wtn', this.preprocessInput, {
39345
39368
  top: true
39346
39369
  })
39347
- .on('afterInit.wtn postProcessSetEditorValue.wtn afterCommitStyle.wtn', this.postProcessSetEditorValue);
39370
+ .on('afterInit.wtn postProcessSetEditorValue.wtn afterCommitStyle.wtn backSpaceAfterDelete.wtn', this.postProcessSetEditorValue);
39348
39371
  }
39349
39372
  /** @override **/
39350
39373
  beforeDestruct(jodit) {