jodit 4.2.41 → 4.2.43

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 (105) hide show
  1. package/CHANGELOG.md +19 -5
  2. package/es2015/jodit.css +1 -1
  3. package/es2015/jodit.fat.min.js +2 -2
  4. package/es2015/jodit.js +81 -33
  5. package/es2015/jodit.min.js +2 -2
  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.css +1 -1
  13. package/es2018/jodit.fat.min.js +2 -2
  14. package/es2018/jodit.js +81 -33
  15. package/es2018/jodit.min.js +2 -2
  16. package/es2018/plugins/debug/debug.css +1 -1
  17. package/es2018/plugins/debug/debug.js +1 -1
  18. package/es2018/plugins/debug/debug.min.js +1 -1
  19. package/es2018/plugins/speech-recognize/speech-recognize.css +1 -1
  20. package/es2018/plugins/speech-recognize/speech-recognize.js +1 -1
  21. package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
  22. package/es2021/jodit.css +1 -1
  23. package/es2021/jodit.fat.min.js +2 -2
  24. package/es2021/jodit.js +81 -33
  25. package/es2021/jodit.min.js +2 -2
  26. package/es2021/plugins/debug/debug.css +1 -1
  27. package/es2021/plugins/debug/debug.js +1 -1
  28. package/es2021/plugins/debug/debug.min.js +1 -1
  29. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  30. package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
  31. package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
  32. package/es2021.en/jodit.css +1 -1
  33. package/es2021.en/jodit.fat.min.js +2 -2
  34. package/es2021.en/jodit.js +81 -33
  35. package/es2021.en/jodit.min.js +2 -2
  36. package/es2021.en/plugins/debug/debug.css +1 -1
  37. package/es2021.en/plugins/debug/debug.js +1 -1
  38. package/es2021.en/plugins/debug/debug.min.js +1 -1
  39. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  40. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
  41. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
  42. package/es5/164.fat.min.js +1 -1
  43. package/es5/164.min.js +1 -1
  44. package/es5/5.fat.min.js +1 -1
  45. package/es5/5.min.js +1 -1
  46. package/es5/jodit.css +2 -2
  47. package/es5/jodit.fat.min.js +2 -2
  48. package/es5/jodit.js +81 -33
  49. package/es5/jodit.min.css +2 -2
  50. package/es5/jodit.min.js +2 -2
  51. package/es5/plugins/debug/debug.css +1 -1
  52. package/es5/plugins/debug/debug.js +1 -1
  53. package/es5/plugins/debug/debug.min.js +1 -1
  54. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  55. package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
  56. package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
  57. package/esm/core/constants.js +1 -1
  58. package/esm/core/helpers/utils/complete-url.d.ts +0 -3
  59. package/esm/core/helpers/utils/complete-url.js +1 -1
  60. package/esm/core/selection/style/api/extract.js +1 -0
  61. package/esm/jodit.d.ts +11 -1
  62. package/esm/jodit.js +11 -1
  63. package/esm/modules/history/snapshot.d.ts +1 -0
  64. package/esm/modules/history/snapshot.js +8 -1
  65. package/esm/modules/toolbar/button/button.js +18 -9
  66. package/esm/plugins/ai-assistant/langs/index.d.ts +3 -0
  67. package/esm/plugins/ai-assistant/langs/index.js +3 -0
  68. package/esm/plugins/image-properties/readers/align.d.ts +3 -1
  69. package/esm/plugins/image-properties/readers/align.js +3 -1
  70. package/esm/plugins/image-properties/readers/index.d.ts +3 -0
  71. package/esm/plugins/image-properties/readers/link.d.ts +3 -0
  72. package/esm/plugins/image-properties/readers/margin.js +3 -0
  73. package/esm/plugins/image-properties/readers/size.js +3 -0
  74. package/esm/plugins/image-properties/ui/ui-image-form.d.ts +3 -0
  75. package/esm/plugins/image-properties/ui/ui-image-main-tab.d.ts +3 -0
  76. package/esm/plugins/image-properties/ui/ui-image-position-tab.d.ts +3 -0
  77. package/esm/plugins/image-properties/utils/open-image-editor.d.ts +3 -0
  78. package/esm/plugins/image-properties/utils/open-image-popup.d.ts +3 -0
  79. package/esm/plugins/image-properties/utils/utils.js +3 -0
  80. package/esm/plugins/image-properties/writers/index.d.ts +3 -0
  81. package/esm/plugins/image-properties/writers/link.d.ts +3 -0
  82. package/esm/plugins/image-properties/writers/margin.d.ts +3 -0
  83. package/esm/plugins/image-properties/writers/size.js +3 -0
  84. package/esm/plugins/symbols/config.js +6 -7
  85. package/esm/plugins/symbols/symbols.d.ts +1 -3
  86. package/esm/plugins/symbols/symbols.js +16 -11
  87. package/esm/types/history.d.ts +3 -0
  88. package/package.json +1 -1
  89. package/types/core/helpers/utils/complete-url.d.ts +0 -3
  90. package/types/jodit.d.ts +11 -1
  91. package/types/modules/history/snapshot.d.ts +1 -0
  92. package/types/plugins/ai-assistant/langs/index.d.ts +3 -0
  93. package/types/plugins/image-properties/readers/align.d.ts +3 -1
  94. package/types/plugins/image-properties/readers/index.d.ts +3 -0
  95. package/types/plugins/image-properties/readers/link.d.ts +3 -0
  96. package/types/plugins/image-properties/ui/ui-image-form.d.ts +3 -0
  97. package/types/plugins/image-properties/ui/ui-image-main-tab.d.ts +3 -0
  98. package/types/plugins/image-properties/ui/ui-image-position-tab.d.ts +3 -0
  99. package/types/plugins/image-properties/utils/open-image-editor.d.ts +3 -0
  100. package/types/plugins/image-properties/utils/open-image-popup.d.ts +3 -0
  101. package/types/plugins/image-properties/writers/index.d.ts +3 -0
  102. package/types/plugins/image-properties/writers/link.d.ts +3 -0
  103. package/types/plugins/image-properties/writers/margin.d.ts +3 -0
  104. package/types/plugins/symbols/symbols.d.ts +1 -3
  105. package/types/types/history.d.ts +3 -0
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.2.41
4
+ * Version: v4.2.43
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1838,7 +1838,7 @@ __webpack_require__.r(__webpack_exports__);
1838
1838
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
1839
1839
  */
1840
1840
 
1841
- var APP_VERSION = "4.2.41";
1841
+ var APP_VERSION = "4.2.43";
1842
1842
  // prettier-ignore
1843
1843
  var ES = "es5";
1844
1844
  var IS_ES_MODERN = false;
@@ -7886,10 +7886,10 @@ var buildQuery = function (data, prefix) {
7886
7886
  * Released under MIT see LICENSE.txt in the project root for license information.
7887
7887
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
7888
7888
  */
7889
-
7890
7889
  /**
7891
7890
  * @module helpers/utils
7892
7891
  */
7892
+
7893
7893
  var completeUrl = function (url) {
7894
7894
  if (jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalWindow.location.protocol === 'file:' && /^\/\//.test(url)) {
7895
7895
  url = 'https:' + url;
@@ -11851,6 +11851,7 @@ function extractSelectedPart(wrapper, font, jodit) {
11851
11851
  }
11852
11852
  /**
11853
11853
  * Retrieves content before after the selected area, clears it if it is empty, and inserts before after the framed selection
11854
+ * @private
11854
11855
  */
11855
11856
  function extractAndMove(wrapper, range, left) {
11856
11857
  var fragment = range.extractContents();
@@ -17284,7 +17285,17 @@ var Jodit = /** @class */ (function (_super) {
17284
17285
  configurable: true
17285
17286
  });
17286
17287
  /**
17287
- * Method wrap usual Has Object in Object helper for prevent deep object merging in options*
17288
+ * Method wrap usual object in Object helper for prevent deep object merging in options*
17289
+ * ```js
17290
+ * const editor = Jodit.make('#editor', {
17291
+ * controls: {
17292
+ * fontsize: {
17293
+ * list: Jodit.atom([8, 9, 10])
17294
+ * }
17295
+ * }
17296
+ * });
17297
+ * ```
17298
+ * In this case, the array [8, 9, 10] will not be combined with other arrays, but will replace them
17288
17299
  */
17289
17300
  Jodit.atom = function (object) {
17290
17301
  return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.markAsAtomic)(object);
@@ -22022,6 +22033,7 @@ var Snapshot = /** @class */ (function (_super) {
22022
22033
  function Snapshot() {
22023
22034
  var _this = _super.apply(this, (0,tslib__WEBPACK_IMPORTED_MODULE_3__/* .__spreadArray */ .fX)([], (0,tslib__WEBPACK_IMPORTED_MODULE_3__/* .__read */ .zs)(arguments), false)) || this;
22024
22035
  _this.__isBlocked = false;
22036
+ _this.__levelOfTransaction = 0;
22025
22037
  return _this;
22026
22038
  }
22027
22039
  /** @override */
@@ -22107,6 +22119,7 @@ var Snapshot = /** @class */ (function (_super) {
22107
22119
  };
22108
22120
  Snapshot.prototype.transaction = function (changes) {
22109
22121
  this.__block(true);
22122
+ this.__levelOfTransaction += 1;
22110
22123
  try {
22111
22124
  changes();
22112
22125
  }
@@ -22115,7 +22128,12 @@ var Snapshot = /** @class */ (function (_super) {
22115
22128
  throw e;
22116
22129
  }
22117
22130
  }
22118
- this.__block(false);
22131
+ finally {
22132
+ this.__levelOfTransaction -= 1;
22133
+ if (this.__levelOfTransaction === 0) {
22134
+ this.__block(false);
22135
+ }
22136
+ }
22119
22137
  };
22120
22138
  /**
22121
22139
  * Creates object a snapshot of editor: html and the current selection. Current selection calculate by
@@ -24363,17 +24381,26 @@ var ToolbarButton = /** @class */ (function (_super) {
24363
24381
  if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.isFunction)(ctr.popup)) {
24364
24382
  var popup = this.openPopup();
24365
24383
  popup.parentElement = this;
24366
- if (this.j.e.fire((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.camelCase)("before-".concat(ctr.name, "-open-popup")), this.target, ctr, popup) !== false) {
24367
- var target = (_c = (_b = (_a = this.toolbar) === null || _a === void 0 ? void 0 : _a.getTarget(this)) !== null && _b !== void 0 ? _b : this.target) !== null && _c !== void 0 ? _c : null;
24368
- var elm = ctr.popup(this.j, target, this.__closePopup, this);
24369
- if (elm) {
24370
- popup
24371
- .setContent((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.isString)(elm) ? this.j.c.fromHTML(elm) : elm)
24372
- .open(function () { return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.position)(_this.container); }, false, this.j.o.allowTabNavigation
24373
- ? this.container
24374
- : undefined);
24384
+ try {
24385
+ if (this.j.e.fire((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.camelCase)("before-".concat(ctr.name, "-open-popup")), this.target, ctr, popup) !== false) {
24386
+ var target = (_c = (_b = (_a = this.toolbar) === null || _a === void 0 ? void 0 : _a.getTarget(this)) !== null && _b !== void 0 ? _b : this.target) !== null && _c !== void 0 ? _c : null;
24387
+ var elm = ctr.popup(this.j, target, this.__closePopup, this);
24388
+ if (elm) {
24389
+ popup
24390
+ .setContent((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.isString)(elm) ? this.j.c.fromHTML(elm) : elm)
24391
+ .open(function () { return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.position)(_this.container); }, false, this.j.o.allowTabNavigation
24392
+ ? this.container
24393
+ : undefined);
24394
+ }
24395
+ else {
24396
+ this.__closePopup();
24397
+ }
24375
24398
  }
24376
24399
  }
24400
+ catch (e) {
24401
+ this.__closePopup();
24402
+ throw e;
24403
+ }
24377
24404
  /**
24378
24405
  * Fired after the popup was opened for some control button
24379
24406
  */
@@ -26845,6 +26872,9 @@ __webpack_require__.r(__webpack_exports__);
26845
26872
  * Released under MIT see LICENSE.txt in the project root for license information.
26846
26873
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
26847
26874
  */
26875
+ /**
26876
+ * @module plugins/ai-assistant
26877
+ */
26848
26878
 
26849
26879
 
26850
26880
 
@@ -33013,7 +33043,9 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_2__/* .pluginSystem */ .fg.add('image
33013
33043
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
33014
33044
  */
33015
33045
 
33016
- /** @private */
33046
+ /**
33047
+ * @private
33048
+ */
33017
33049
  function readAlign(image, values) {
33018
33050
  // Align
33019
33051
  if (image.style.cssFloat &&
@@ -33141,6 +33173,9 @@ function readLink(state, j, values) {
33141
33173
  * Released under MIT see LICENSE.txt in the project root for license information.
33142
33174
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
33143
33175
  */
33176
+ /**
33177
+ * @module plugins/image-properties
33178
+ */
33144
33179
 
33145
33180
  /** @private */
33146
33181
  function readMargins(image, values, state) {
@@ -33186,6 +33221,9 @@ function readMargins(image, values, state) {
33186
33221
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
33187
33222
  */
33188
33223
 
33224
+ /**
33225
+ * @module plugins/image-properties
33226
+ */
33189
33227
 
33190
33228
 
33191
33229
 
@@ -33970,6 +34008,9 @@ function openImagePopup(j, dialog, state, button) {
33970
34008
  * Released under MIT see LICENSE.txt in the project root for license information.
33971
34009
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
33972
34010
  */
34011
+ /**
34012
+ * @module plugins/image-properties
34013
+ */
33973
34014
 
33974
34015
 
33975
34016
  /** @private */
@@ -34158,6 +34199,9 @@ function applyMargin(j, marginTop, marginRight, marginBottom, marginLeft, image,
34158
34199
  * Released under MIT see LICENSE.txt in the project root for license information.
34159
34200
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
34160
34201
  */
34202
+ /**
34203
+ * @module plugins/image-properties
34204
+ */
34161
34205
 
34162
34206
 
34163
34207
 
@@ -43286,14 +43330,13 @@ jodit_config__WEBPACK_IMPORTED_MODULE_1__/* .Config */ .T.prototype.controls.sym
43286
43330
  editor.e.on(container, 'close_dialog', close);
43287
43331
  return box;
43288
43332
  }
43289
- else {
43290
- editor
43291
- .alert(container, 'Select Special Character', undefined, 'jodit-symbols')
43292
- .bindDestruct(editor);
43293
- var a = container.querySelector('a');
43294
- a && a.focus();
43295
- }
43333
+ editor
43334
+ .alert(container, 'Select Special Character', undefined, 'jodit-symbols')
43335
+ .bindDestruct(editor);
43336
+ var a = container.querySelector('a');
43337
+ a && a.focus();
43296
43338
  }
43339
+ return;
43297
43340
  }
43298
43341
  };
43299
43342
 
@@ -43813,25 +43856,28 @@ var symbols = /** @class */ (function (_super) {
43813
43856
  (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__extends */ .C6)(symbols, _super);
43814
43857
  function symbols(jodit) {
43815
43858
  var _this = _super.call(this, jodit) || this;
43816
- /** @override */
43817
43859
  _this.buttons = [
43818
43860
  {
43819
43861
  name: 'symbols',
43820
43862
  group: 'insert'
43821
43863
  }
43822
43864
  ];
43823
- _this.countInRow = 17;
43865
+ _this.__countInRow = 17;
43824
43866
  (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_2__/* .extendLang */ .JW)(_langs__WEBPACK_IMPORTED_MODULE_6__);
43825
43867
  return _this;
43826
43868
  }
43827
- /** @override */
43828
43869
  symbols.prototype.afterInit = function (jodit) {
43829
43870
  var _this = this;
43830
43871
  jodit.e.on('generateSpecialCharactersTable.symbols', function () {
43831
- var container = jodit.c.fromHTML("<div class=\"jodit-symbols__container\">\n\t\t\t\t\t\t<div class=\"jodit-symbols__container_table\">\n\t\t\t\t\t\t\t<table class=\"jodit-symbols__table\"><tbody></tbody></table>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"jodit-symbols__container_preview\">\n\t\t\t\t\t\t\t<div class=\"jodit-symbols__preview\"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>"), preview = container.querySelector('.jodit-symbols__preview'), table = container.querySelector('table'), body = table.tBodies[0], chars = [];
43872
+ var container = jodit.c.fromHTML("<div class=\"jodit-symbols__container\">\n\t\t\t\t\t\t<div class=\"jodit-symbols__container_table\">\n\t\t\t\t\t\t\t<table class=\"jodit-symbols__table\"><tbody></tbody></table>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"jodit-symbols__container_preview\">\n\t\t\t\t\t\t\t<div class=\"jodit-symbols__preview\"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>");
43873
+ var preview = container.querySelector('.jodit-symbols__preview');
43874
+ var table = container.querySelector('table');
43875
+ var body = table.tBodies[0];
43876
+ var chars = [];
43832
43877
  for (var i = 0; i < jodit.o.specialCharacters.length;) {
43833
43878
  var tr = jodit.c.element('tr');
43834
- for (var j = 0; j < _this.countInRow && i < jodit.o.specialCharacters.length; j += 1, i += 1) {
43879
+ for (var j = 0; j < _this.__countInRow &&
43880
+ i < jodit.o.specialCharacters.length; j += 1, i += 1) {
43835
43881
  var td = jodit.c.element('td'), a = jodit.c.fromHTML("<a\n\t\t\t\t\t\t\t\t\tdata-index=\"".concat(i, "\"\n\t\t\t\t\t\t\t\t\tdata-index-j=\"").concat(j, "\"\n\t\t\t\t\t\t\t\t\trole=\"option\"\n\t\t\t\t\t\t\t\t\ttabindex=\"-1\"\n\t\t\t\t\t\t\t>").concat(jodit.o.specialCharacters[i], "</a>"));
43836
43882
  chars.push(a);
43837
43883
  td.appendChild(a);
@@ -43848,7 +43894,9 @@ var symbols = /** @class */ (function (_super) {
43848
43894
  if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isTag(this, 'a')) {
43849
43895
  jodit.s.focus();
43850
43896
  jodit.s.insertHTML(this.innerHTML);
43851
- jodit.e.fire(this, 'close_dialog');
43897
+ if (!(e === null || e === void 0 ? void 0 : e.shiftKey)) {
43898
+ jodit.e.fire(this, 'close_dialog');
43899
+ }
43852
43900
  e && e.preventDefault();
43853
43901
  e && e.stopImmediatePropagation();
43854
43902
  }
@@ -43868,18 +43916,18 @@ var symbols = /** @class */ (function (_super) {
43868
43916
  case jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_DOWN:
43869
43917
  newIndex =
43870
43918
  e.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_UP
43871
- ? index - self.countInRow
43872
- : index + self.countInRow;
43919
+ ? index - self.__countInRow
43920
+ : index + self.__countInRow;
43873
43921
  if (chars[newIndex] === undefined) {
43874
43922
  newIndex =
43875
43923
  e.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_UP
43876
43924
  ? Math.floor(chars.length /
43877
- self.countInRow) *
43878
- self.countInRow +
43925
+ self.__countInRow) *
43926
+ self.__countInRow +
43879
43927
  jIndex
43880
43928
  : jIndex;
43881
43929
  if (newIndex > chars.length - 1) {
43882
- newIndex -= self.countInRow;
43930
+ newIndex -= self.__countInRow;
43883
43931
  }
43884
43932
  }
43885
43933
  chars[newIndex] && chars[newIndex].focus();
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.2.41
4
+ * Version: v4.2.43
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.2.41
11
+ * Version: v4.2.43
12
12
  * Url: https://xdsoft.net/jodit/
13
13
  * License(s): MIT
14
14
  */