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
package/es2018/jodit.js CHANGED
@@ -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
  */
@@ -1715,7 +1715,7 @@ __webpack_require__.r(__webpack_exports__);
1715
1715
  * Released under MIT see LICENSE.txt in the project root for license information.
1716
1716
  * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
1717
1717
  */
1718
- const APP_VERSION = "4.0.0-beta.92";
1718
+ const APP_VERSION = "4.0.0-beta.95";
1719
1719
  // prettier-ignore
1720
1720
  const ES = "es2018";
1721
1721
  const IS_ES_MODERN = true;
@@ -10734,7 +10734,7 @@ class Selection {
10734
10734
  const range = this.createRange();
10735
10735
  let start = node, last = node;
10736
10736
  do {
10737
- if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isText(start)) {
10737
+ 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)) {
10738
10738
  break;
10739
10739
  }
10740
10740
  last = start;
@@ -10742,7 +10742,7 @@ class Selection {
10742
10742
  } while (start);
10743
10743
  if (!start) {
10744
10744
  const fakeNode = this.j.createInside.text(jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INVISIBLE_SPACE);
10745
- if (!/^(img|br|input)$/i.test(last.nodeName)) {
10745
+ if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isTag(last, jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INSEPARABLE_TAGS)) {
10746
10746
  last.appendChild(fakeNode);
10747
10747
  last = fakeNode;
10748
10748
  }
@@ -10750,8 +10750,17 @@ class Selection {
10750
10750
  start = last;
10751
10751
  }
10752
10752
  }
10753
- range.selectNodeContents(start || last);
10754
- range.collapse(inStart);
10753
+ const workElm = start || last;
10754
+ if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isTag(workElm, jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INSEPARABLE_TAGS)) {
10755
+ range.selectNodeContents(workElm);
10756
+ range.collapse(inStart);
10757
+ }
10758
+ else {
10759
+ inStart || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isTag(workElm, 'br')
10760
+ ? range.setStartBefore(workElm)
10761
+ : range.setEndAfter(workElm);
10762
+ range.collapse(inStart);
10763
+ }
10755
10764
  this.selectRange(range);
10756
10765
  return last;
10757
10766
  }
@@ -15815,7 +15824,10 @@ let View = View_1 = class View extends jodit_modules__WEBPACK_IMPORTED_MODULE_3_
15815
15824
  return jodit_core_storage__WEBPACK_IMPORTED_MODULE_0__/* .Storage */ .Ke.makeStorage();
15816
15825
  }
15817
15826
  get message() {
15818
- return new jodit_modules_messages_messages__WEBPACK_IMPORTED_MODULE_8__/* .UIMessages */ .D(this, this.container);
15827
+ return this.getMessageModule(this.container);
15828
+ }
15829
+ getMessageModule(container) {
15830
+ return new jodit_modules_messages_messages__WEBPACK_IMPORTED_MODULE_8__/* .UIMessages */ .D(this, container);
15819
15831
  }
15820
15832
  /**
15821
15833
  * Container for persistent set/get value
@@ -16207,6 +16219,9 @@ let Jodit = Jodit_1 = class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE
16207
16219
  get workplace() {
16208
16220
  return this.currentPlace.workplace;
16209
16221
  }
16222
+ get message() {
16223
+ return this.getMessageModule(this.workplace);
16224
+ }
16210
16225
  /**
16211
16226
  * Statusbar module
16212
16227
  */
@@ -17294,6 +17309,9 @@ Jodit.core = {
17294
17309
  (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .gn)([
17295
17310
  jodit_core_decorators__WEBPACK_IMPORTED_MODULE_5__.cache
17296
17311
  ], Jodit.prototype, "createInside", null);
17312
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .gn)([
17313
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_5__.cache
17314
+ ], Jodit.prototype, "message", null);
17297
17315
  (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .gn)([
17298
17316
  jodit_core_decorators__WEBPACK_IMPORTED_MODULE_5__.cache
17299
17317
  ], Jodit.prototype, "s", null);
@@ -24052,7 +24070,12 @@ function send(uploader, data) {
24052
24070
  .send()
24053
24071
  .then(resp => resp.json())
24054
24072
  .catch(error => {
24055
- uploader.o.error.call(uploader, error);
24073
+ return {
24074
+ success: false,
24075
+ data: {
24076
+ messages: [error]
24077
+ }
24078
+ };
24056
24079
  })
24057
24080
  .finally(() => {
24058
24081
  ajax.destruct();
@@ -40999,10 +41022,10 @@ class wrapNodes extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_0__/* .Plugin
40999
41022
  return;
41000
41023
  }
41001
41024
  jodit.e
41002
- .on('drop.wtn focus.wtn keydown.wtn mousedown.wtn afterInit.wtn', this.preprocessInput, {
41025
+ .on('drop.wtn focus.wtn keydown.wtn mousedown.wtn afterInit.wtn backSpaceAfterDelete.wtn', this.preprocessInput, {
41003
41026
  top: true
41004
41027
  })
41005
- .on('afterInit.wtn postProcessSetEditorValue.wtn afterCommitStyle.wtn', this.postProcessSetEditorValue);
41028
+ .on('afterInit.wtn postProcessSetEditorValue.wtn afterCommitStyle.wtn backSpaceAfterDelete.wtn', this.postProcessSetEditorValue);
41006
41029
  }
41007
41030
  /** @override **/
41008
41031
  beforeDestruct(jodit) {