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/es2021/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
  */
@@ -1736,7 +1736,7 @@ __webpack_require__.r(__webpack_exports__);
1736
1736
  * Released under MIT see LICENSE.txt in the project root for license information.
1737
1737
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
1738
1738
  */
1739
- const APP_VERSION = "4.2.43";
1739
+ const APP_VERSION = "4.2.46";
1740
1740
  // prettier-ignore
1741
1741
  const ES = "es2021";
1742
1742
  const IS_ES_MODERN = true;
@@ -7552,8 +7552,9 @@ const completeUrl = (url) => {
7552
7552
 
7553
7553
  "use strict";
7554
7554
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7555
- /* harmony export */ V: function() { return /* binding */ ConfigFlatten; },
7556
- /* harmony export */ t: function() { return /* binding */ ConfigProto; }
7555
+ /* harmony export */ VL: function() { return /* binding */ ConfigFlatten; },
7556
+ /* harmony export */ pi: function() { return /* binding */ ConfigDeepFlatten; },
7557
+ /* harmony export */ tb: function() { return /* binding */ ConfigProto; }
7557
7558
  /* harmony export */ });
7558
7559
  /* harmony import */ var jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(37923);
7559
7560
  /* harmony import */ var jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(25376);
@@ -7644,6 +7645,31 @@ function ConfigFlatten(obj) {
7644
7645
  return app;
7645
7646
  }, {});
7646
7647
  }
7648
+ /**
7649
+ * Returns a plain object from a prototype-based object.
7650
+ * ```typescript
7651
+ * const editor = Jodit.make('#editor', {
7652
+ * image: {
7653
+ * dialogWidth: 500
7654
+ * }
7655
+ * });
7656
+ *
7657
+ * console.log(editor.o.image.openOnDblClick) // true
7658
+ * // But you can't get all options in plain object
7659
+ * console.log(JSON.stringify(editor.o.image)); // {"dialogWidth":500}
7660
+ *
7661
+ * const plain = Jodit.modules.Helpers.ConfigDeepFlatten(editor.o.image);
7662
+ * console.log(JSON.stringify(plain)); // {"dialogWidth":500, "openOnDblClick": true, "editSrc": true, ...}
7663
+ * ```
7664
+ */
7665
+ function ConfigDeepFlatten(obj) {
7666
+ return (0,_utils__WEBPACK_IMPORTED_MODULE_1__/* .keys */ .HP)(obj, false).reduce((app, key) => {
7667
+ app[key] = (0,jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_4__/* .isPlainObject */ .Q)(obj[key])
7668
+ ? ConfigDeepFlatten(obj[key])
7669
+ : obj[key];
7670
+ return app;
7671
+ }, {});
7672
+ }
7647
7673
 
7648
7674
 
7649
7675
  /***/ }),
@@ -8274,8 +8300,9 @@ const humanSizeToBytes = (human) => {
8274
8300
  __webpack_require__.r(__webpack_exports__);
8275
8301
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
8276
8302
  /* harmony export */ $$: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_23__.$$; },
8277
- /* harmony export */ ConfigFlatten: function() { return /* reexport safe */ _config_proto__WEBPACK_IMPORTED_MODULE_7__.V; },
8278
- /* harmony export */ ConfigProto: function() { return /* reexport safe */ _config_proto__WEBPACK_IMPORTED_MODULE_7__.t; },
8303
+ /* harmony export */ ConfigDeepFlatten: function() { return /* reexport safe */ _config_proto__WEBPACK_IMPORTED_MODULE_7__.pi; },
8304
+ /* harmony export */ ConfigFlatten: function() { return /* reexport safe */ _config_proto__WEBPACK_IMPORTED_MODULE_7__.VL; },
8305
+ /* harmony export */ ConfigProto: function() { return /* reexport safe */ _config_proto__WEBPACK_IMPORTED_MODULE_7__.tb; },
8279
8306
  /* harmony export */ ConnectionError: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_13__.Rc; },
8280
8307
  /* harmony export */ LimitedStack: function() { return /* reexport safe */ _stack__WEBPACK_IMPORTED_MODULE_25__.d; },
8281
8308
  /* harmony export */ OptionsError: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_13__.ZW; },
@@ -12857,6 +12884,7 @@ class Dlgs {
12857
12884
  shadowRoot: this.o.shadowRoot,
12858
12885
  ownerWindow: this.o.ownerWindow,
12859
12886
  defaultTimeout: this.o.defaultTimeout,
12887
+ direction: this.o.direction,
12860
12888
  theme: this.o.theme,
12861
12889
  globalFullSize: this.o.globalFullSize,
12862
12890
  ...options
@@ -17362,13 +17390,6 @@ let Jodit = Jodit_1 = class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE
17362
17390
  })
17363
17391
  .on('blur', () => (this.editorIsActive = false));
17364
17392
  this.__prepareWYSIWYGEditor();
17365
- // direction
17366
- if (this.o.direction) {
17367
- const direction = this.o.direction.toLowerCase() === 'rtl' ? 'rtl' : 'ltr';
17368
- this.container.style.direction = direction;
17369
- this.container.setAttribute('dir', direction);
17370
- this.toolbar.setDirection(direction);
17371
- }
17372
17393
  if (this.o.triggerChangeEvent) {
17373
17394
  this.e.on('change', this.async.debounce(() => {
17374
17395
  this.e && this.e.fire(this.element, 'change');
@@ -17386,6 +17407,9 @@ let Jodit = Jodit_1 = class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE
17386
17407
  const direction = this.o.direction.toLowerCase() === 'rtl' ? 'rtl' : 'ltr';
17387
17408
  this.editor.style.direction = direction;
17388
17409
  this.editor.setAttribute('dir', direction);
17410
+ this.container.style.direction = direction;
17411
+ this.container.setAttribute('dir', direction);
17412
+ this.toolbar.setDirection(direction);
17389
17413
  }
17390
17414
  // proxy events
17391
17415
  this.e
@@ -18378,6 +18402,10 @@ let Dialog = Dialog_1 = class Dialog extends jodit_core_view_view_with_toolbar__
18378
18402
  <div class="${n('resizer')}">${jodit_core_ui__WEBPACK_IMPORTED_MODULE_9__/* .Icon */ .In.get('resize_handler')}</div>
18379
18403
  </div>
18380
18404
  </div>`);
18405
+ if (self.options.direction === 'rtl') {
18406
+ self.container.style.direction = 'rtl';
18407
+ self.container.setAttribute('dir', 'rtl');
18408
+ }
18381
18409
  if (this.o.zIndex) {
18382
18410
  this.container.style.zIndex = this.o.zIndex.toString();
18383
18411
  }
@@ -39773,6 +39801,10 @@ class AceEditor extends jodit_plugins_source_editor_sourceEditor__WEBPACK_IMPORT
39773
39801
  this.container.appendChild(fakeMirror);
39774
39802
  const ace = editor.ow.ace;
39775
39803
  this.instance = ace.edit(fakeMirror);
39804
+ if (editor.o.direction === 'rtl') {
39805
+ this.instance.setOption('rtlText', true);
39806
+ this.instance.setOption('rtl', true);
39807
+ }
39776
39808
  this.instance.setTheme(editor.o.sourceEditorNativeOptions.theme);
39777
39809
  this.instance.renderer.setShowGutter(editor.o.sourceEditorNativeOptions.showGutter);
39778
39810
  this.instance
@@ -39935,7 +39967,8 @@ class TextAreaEditor extends jodit_plugins_source_editor_sourceEditor__WEBPACK_I
39935
39967
  }
39936
39968
  init(editor) {
39937
39969
  this.instance = editor.c.element('textarea', {
39938
- class: 'jodit-source__mirror'
39970
+ class: 'jodit-source__mirror',
39971
+ dir: editor.o.direction === 'rtl' ? 'rtl' : undefined
39939
39972
  });
39940
39973
  this.container.appendChild(this.instance);
39941
39974
  editor.e