jodit 4.2.43 → 4.2.46

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 (79) hide show
  1. package/CHANGELOG.md +855 -806
  2. package/es2015/jodit.css +5 -7
  3. package/es2015/jodit.fat.min.css +1 -1
  4. package/es2015/jodit.fat.min.js +2 -2
  5. package/es2015/jodit.js +47 -15
  6. package/es2015/jodit.min.css +1 -1
  7. package/es2015/jodit.min.js +2 -2
  8. package/es2015/plugins/debug/debug.css +1 -1
  9. package/es2015/plugins/debug/debug.js +1 -1
  10. package/es2015/plugins/debug/debug.min.js +1 -1
  11. package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
  12. package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
  13. package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
  14. package/es2018/jodit.css +5 -7
  15. package/es2018/jodit.fat.min.css +1 -1
  16. package/es2018/jodit.fat.min.js +2 -2
  17. package/es2018/jodit.js +47 -14
  18. package/es2018/jodit.min.css +1 -1
  19. package/es2018/jodit.min.js +2 -2
  20. package/es2018/plugins/debug/debug.css +1 -1
  21. package/es2018/plugins/debug/debug.js +1 -1
  22. package/es2018/plugins/debug/debug.min.js +1 -1
  23. package/es2018/plugins/speech-recognize/speech-recognize.css +1 -1
  24. package/es2018/plugins/speech-recognize/speech-recognize.js +1 -1
  25. package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
  26. package/es2021/jodit.css +5 -7
  27. package/es2021/jodit.fat.min.css +1 -1
  28. package/es2021/jodit.fat.min.js +2 -2
  29. package/es2021/jodit.js +47 -14
  30. package/es2021/jodit.min.css +1 -1
  31. package/es2021/jodit.min.js +2 -2
  32. package/es2021/plugins/debug/debug.css +1 -1
  33. package/es2021/plugins/debug/debug.js +1 -1
  34. package/es2021/plugins/debug/debug.min.js +1 -1
  35. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  36. package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
  37. package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
  38. package/es2021.en/jodit.css +5 -7
  39. package/es2021.en/jodit.fat.min.css +1 -1
  40. package/es2021.en/jodit.fat.min.js +2 -2
  41. package/es2021.en/jodit.js +47 -14
  42. package/es2021.en/jodit.min.css +1 -1
  43. package/es2021.en/jodit.min.js +2 -2
  44. package/es2021.en/plugins/debug/debug.css +1 -1
  45. package/es2021.en/plugins/debug/debug.js +1 -1
  46. package/es2021.en/plugins/debug/debug.min.js +1 -1
  47. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  48. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
  49. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
  50. package/es5/164.fat.min.js +1 -1
  51. package/es5/164.min.js +1 -1
  52. package/es5/5.fat.min.js +1 -1
  53. package/es5/5.min.js +1 -1
  54. package/es5/jodit.css +35 -66
  55. package/es5/jodit.fat.min.css +1 -1
  56. package/es5/jodit.fat.min.js +2 -2
  57. package/es5/jodit.js +47 -15
  58. package/es5/jodit.min.css +3 -3
  59. package/es5/jodit.min.js +2 -2
  60. package/es5/plugins/debug/debug.css +1 -1
  61. package/es5/plugins/debug/debug.js +1 -1
  62. package/es5/plugins/debug/debug.min.js +1 -1
  63. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  64. package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
  65. package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
  66. package/esm/core/constants.js +1 -1
  67. package/esm/core/helpers/utils/config-proto.d.ts +18 -0
  68. package/esm/core/helpers/utils/config-proto.js +25 -0
  69. package/esm/core/traits/dlgs.js +1 -0
  70. package/esm/jodit.js +3 -7
  71. package/esm/modules/dialog/dialog.js +4 -0
  72. package/esm/plugins/source/editor/engines/ace.js +4 -0
  73. package/esm/plugins/source/editor/engines/area.js +2 -1
  74. package/esm/types/view.d.ts +1 -0
  75. package/package.json +1 -1
  76. package/types/core/helpers/utils/config-proto.d.ts +18 -0
  77. package/types/types/view.d.ts +1 -0
  78. package/esm/polyfills.d.ts +0 -10
  79. package/types/polyfills.d.ts +0 -10
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.43
4
+ * Version: v4.2.46
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.43";
1841
+ var APP_VERSION = "4.2.46";
1842
1842
  // prettier-ignore
1843
1843
  var ES = "es5";
1844
1844
  var IS_ES_MODERN = false;
@@ -7905,8 +7905,9 @@ var completeUrl = function (url) {
7905
7905
 
7906
7906
  "use strict";
7907
7907
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7908
- /* harmony export */ V: function() { return /* binding */ ConfigFlatten; },
7909
- /* harmony export */ t: function() { return /* binding */ ConfigProto; }
7908
+ /* harmony export */ VL: function() { return /* binding */ ConfigFlatten; },
7909
+ /* harmony export */ pi: function() { return /* binding */ ConfigDeepFlatten; },
7910
+ /* harmony export */ tb: function() { return /* binding */ ConfigProto; }
7910
7911
  /* harmony export */ });
7911
7912
  /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(31635);
7912
7913
  /* harmony import */ var jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(37923);
@@ -8000,6 +8001,31 @@ function ConfigFlatten(obj) {
8000
8001
  return app;
8001
8002
  }, {});
8002
8003
  }
8004
+ /**
8005
+ * Returns a plain object from a prototype-based object.
8006
+ * ```typescript
8007
+ * const editor = Jodit.make('#editor', {
8008
+ * image: {
8009
+ * dialogWidth: 500
8010
+ * }
8011
+ * });
8012
+ *
8013
+ * console.log(editor.o.image.openOnDblClick) // true
8014
+ * // But you can't get all options in plain object
8015
+ * console.log(JSON.stringify(editor.o.image)); // {"dialogWidth":500}
8016
+ *
8017
+ * const plain = Jodit.modules.Helpers.ConfigDeepFlatten(editor.o.image);
8018
+ * console.log(JSON.stringify(plain)); // {"dialogWidth":500, "openOnDblClick": true, "editSrc": true, ...}
8019
+ * ```
8020
+ */
8021
+ function ConfigDeepFlatten(obj) {
8022
+ return (0,_utils__WEBPACK_IMPORTED_MODULE_1__/* .keys */ .HP)(obj, false).reduce(function (app, key) {
8023
+ app[key] = (0,jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_4__/* .isPlainObject */ .Q)(obj[key])
8024
+ ? ConfigDeepFlatten(obj[key])
8025
+ : obj[key];
8026
+ return app;
8027
+ }, {});
8028
+ }
8003
8029
 
8004
8030
 
8005
8031
  /***/ }),
@@ -8660,8 +8686,9 @@ var humanSizeToBytes = function (human) {
8660
8686
  __webpack_require__.r(__webpack_exports__);
8661
8687
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8662
8688
  /* harmony export */ $$: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_23__.$$; },
8663
- /* harmony export */ ConfigFlatten: function() { return /* reexport safe */ _config_proto__WEBPACK_IMPORTED_MODULE_7__.V; },
8664
- /* harmony export */ ConfigProto: function() { return /* reexport safe */ _config_proto__WEBPACK_IMPORTED_MODULE_7__.t; },
8689
+ /* harmony export */ ConfigDeepFlatten: function() { return /* reexport safe */ _config_proto__WEBPACK_IMPORTED_MODULE_7__.pi; },
8690
+ /* harmony export */ ConfigFlatten: function() { return /* reexport safe */ _config_proto__WEBPACK_IMPORTED_MODULE_7__.VL; },
8691
+ /* harmony export */ ConfigProto: function() { return /* reexport safe */ _config_proto__WEBPACK_IMPORTED_MODULE_7__.tb; },
8665
8692
  /* harmony export */ ConnectionError: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_13__.Rc; },
8666
8693
  /* harmony export */ LimitedStack: function() { return /* reexport safe */ _stack__WEBPACK_IMPORTED_MODULE_25__.d; },
8667
8694
  /* harmony export */ OptionsError: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_13__.ZW; },
@@ -13480,7 +13507,7 @@ var Dlgs = /** @class */ (function () {
13480
13507
  function Dlgs() {
13481
13508
  }
13482
13509
  Dlgs.prototype.dlg = function (options) {
13483
- var dialog = new jodit_modules_dialog__WEBPACK_IMPORTED_MODULE_2__/* .Dialog */ .lG((0,tslib__WEBPACK_IMPORTED_MODULE_3__/* .__assign */ .Cl)({ language: this.o.language, shadowRoot: this.o.shadowRoot, ownerWindow: this.o.ownerWindow, defaultTimeout: this.o.defaultTimeout, theme: this.o.theme, globalFullSize: this.o.globalFullSize }, options));
13510
+ var dialog = new jodit_modules_dialog__WEBPACK_IMPORTED_MODULE_2__/* .Dialog */ .lG((0,tslib__WEBPACK_IMPORTED_MODULE_3__/* .__assign */ .Cl)({ language: this.o.language, shadowRoot: this.o.shadowRoot, ownerWindow: this.o.ownerWindow, defaultTimeout: this.o.defaultTimeout, direction: this.o.direction, theme: this.o.theme, globalFullSize: this.o.globalFullSize }, options));
13484
13511
  (0,jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_1__/* .markOwner */ .b_)(this, dialog.container);
13485
13512
  dialog.parent = this;
13486
13513
  return dialog.bindDestruct(this);
@@ -18329,13 +18356,6 @@ var Jodit = /** @class */ (function (_super) {
18329
18356
  })
18330
18357
  .on('blur', function () { return (_this.editorIsActive = false); });
18331
18358
  _this.__prepareWYSIWYGEditor();
18332
- // direction
18333
- if (_this.o.direction) {
18334
- var direction = _this.o.direction.toLowerCase() === 'rtl' ? 'rtl' : 'ltr';
18335
- _this.container.style.direction = direction;
18336
- _this.container.setAttribute('dir', direction);
18337
- _this.toolbar.setDirection(direction);
18338
- }
18339
18359
  if (_this.o.triggerChangeEvent) {
18340
18360
  _this.e.on('change', _this.async.debounce(function () {
18341
18361
  _this.e && _this.e.fire(_this.element, 'change');
@@ -18354,6 +18374,9 @@ var Jodit = /** @class */ (function (_super) {
18354
18374
  var direction = this.o.direction.toLowerCase() === 'rtl' ? 'rtl' : 'ltr';
18355
18375
  this.editor.style.direction = direction;
18356
18376
  this.editor.setAttribute('dir', direction);
18377
+ this.container.style.direction = direction;
18378
+ this.container.setAttribute('dir', direction);
18379
+ this.toolbar.setDirection(direction);
18357
18380
  }
18358
18381
  // proxy events
18359
18382
  this.e
@@ -18941,6 +18964,10 @@ var Dialog = /** @class */ (function (_super) {
18941
18964
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__/* .Dom */ .J.safeRemove(self.container);
18942
18965
  var n = _this.getFullElName.bind(_this);
18943
18966
  self.container = _this.c.fromHTML("<div class=\"jodit jodit-dialog ".concat(_this.componentName, "\">\n\t\t\t\t<div class=\"").concat(n('overlay'), "\"></div>\n\t\t\t\t<div class=\"").concat(_this.getFullElName('panel'), "\">\n\t\t\t\t\t<div class=\"").concat(n('header'), "\">\n\t\t\t\t\t\t<div class=\"").concat(n('header-title'), "\"></div>\n\t\t\t\t\t\t<div class=\"").concat(n('header-toolbar'), "\"></div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"").concat(n('content'), "\"></div>\n\t\t\t\t\t<div class=\"").concat(n('footer'), "\"></div>\n\t\t\t\t\t<div class=\"").concat(n('resizer'), "\">").concat(jodit_core_ui__WEBPACK_IMPORTED_MODULE_9__/* .Icon */ .In.get('resize_handler'), "</div>\n\t\t\t\t</div>\n\t\t\t</div>"));
18967
+ if (self.options.direction === 'rtl') {
18968
+ self.container.style.direction = 'rtl';
18969
+ self.container.setAttribute('dir', 'rtl');
18970
+ }
18944
18971
  if (_this.o.zIndex) {
18945
18972
  _this.container.style.zIndex = _this.o.zIndex.toString();
18946
18973
  }
@@ -41511,6 +41538,10 @@ var AceEditor = /** @class */ (function (_super) {
41511
41538
  _this.container.appendChild(fakeMirror);
41512
41539
  var ace = editor.ow.ace;
41513
41540
  _this.instance = ace.edit(fakeMirror);
41541
+ if (editor.o.direction === 'rtl') {
41542
+ _this.instance.setOption('rtlText', true);
41543
+ _this.instance.setOption('rtl', true);
41544
+ }
41514
41545
  _this.instance.setTheme(editor.o.sourceEditorNativeOptions.theme);
41515
41546
  _this.instance.renderer.setShowGutter(editor.o.sourceEditorNativeOptions.showGutter);
41516
41547
  _this.instance
@@ -41685,7 +41716,8 @@ var TextAreaEditor = /** @class */ (function (_super) {
41685
41716
  TextAreaEditor.prototype.init = function (editor) {
41686
41717
  var _this = this;
41687
41718
  this.instance = editor.c.element('textarea', {
41688
- class: 'jodit-source__mirror'
41719
+ class: 'jodit-source__mirror',
41720
+ dir: editor.o.direction === 'rtl' ? 'rtl' : undefined
41689
41721
  });
41690
41722
  this.container.appendChild(this.instance);
41691
41723
  editor.e