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
@@ -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
  */
@@ -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
  */
@@ -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
  */
@@ -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
  */
@@ -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
  */
@@ -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
  */
@@ -3,7 +3,7 @@
3
3
  * Released under MIT see LICENSE.txt in the project root for license information.
4
4
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
- export const APP_VERSION = "4.2.43";
6
+ export const APP_VERSION = "4.2.46";
7
7
  // prettier-ignore
8
8
  export const ES = "es2020";
9
9
  export const IS_ES_MODERN = true;
@@ -39,3 +39,21 @@ import type { IDictionary } from "../../../types";
39
39
  */
40
40
  export declare function ConfigProto(options: IDictionary, proto: IDictionary, deep?: number): IDictionary;
41
41
  export declare function ConfigFlatten(obj: IDictionary): IDictionary;
42
+ /**
43
+ * Returns a plain object from a prototype-based object.
44
+ * ```typescript
45
+ * const editor = Jodit.make('#editor', {
46
+ * image: {
47
+ * dialogWidth: 500
48
+ * }
49
+ * });
50
+ *
51
+ * console.log(editor.o.image.openOnDblClick) // true
52
+ * // But you can't get all options in plain object
53
+ * console.log(JSON.stringify(editor.o.image)); // {"dialogWidth":500}
54
+ *
55
+ * const plain = Jodit.modules.Helpers.ConfigDeepFlatten(editor.o.image);
56
+ * console.log(JSON.stringify(plain)); // {"dialogWidth":500, "openOnDblClick": true, "editSrc": true, ...}
57
+ * ```
58
+ */
59
+ export declare function ConfigDeepFlatten(obj: IDictionary): IDictionary;
@@ -80,3 +80,28 @@ export function ConfigFlatten(obj) {
80
80
  return app;
81
81
  }, {});
82
82
  }
83
+ /**
84
+ * Returns a plain object from a prototype-based object.
85
+ * ```typescript
86
+ * const editor = Jodit.make('#editor', {
87
+ * image: {
88
+ * dialogWidth: 500
89
+ * }
90
+ * });
91
+ *
92
+ * console.log(editor.o.image.openOnDblClick) // true
93
+ * // But you can't get all options in plain object
94
+ * console.log(JSON.stringify(editor.o.image)); // {"dialogWidth":500}
95
+ *
96
+ * const plain = Jodit.modules.Helpers.ConfigDeepFlatten(editor.o.image);
97
+ * console.log(JSON.stringify(plain)); // {"dialogWidth":500, "openOnDblClick": true, "editSrc": true, ...}
98
+ * ```
99
+ */
100
+ export function ConfigDeepFlatten(obj) {
101
+ return keys(obj, false).reduce((app, key) => {
102
+ app[key] = isPlainObject(obj[key])
103
+ ? ConfigDeepFlatten(obj[key])
104
+ : obj[key];
105
+ return app;
106
+ }, {});
107
+ }
@@ -13,6 +13,7 @@ export class Dlgs {
13
13
  shadowRoot: this.o.shadowRoot,
14
14
  ownerWindow: this.o.ownerWindow,
15
15
  defaultTimeout: this.o.defaultTimeout,
16
+ direction: this.o.direction,
16
17
  theme: this.o.theme,
17
18
  globalFullSize: this.o.globalFullSize,
18
19
  ...options
package/esm/jodit.js CHANGED
@@ -1090,13 +1090,6 @@ let Jodit = Jodit_1 = class Jodit extends ViewWithToolbar {
1090
1090
  })
1091
1091
  .on('blur', () => (this.editorIsActive = false));
1092
1092
  this.__prepareWYSIWYGEditor();
1093
- // direction
1094
- if (this.o.direction) {
1095
- const direction = this.o.direction.toLowerCase() === 'rtl' ? 'rtl' : 'ltr';
1096
- this.container.style.direction = direction;
1097
- this.container.setAttribute('dir', direction);
1098
- this.toolbar.setDirection(direction);
1099
- }
1100
1093
  if (this.o.triggerChangeEvent) {
1101
1094
  this.e.on('change', this.async.debounce(() => {
1102
1095
  this.e && this.e.fire(this.element, 'change');
@@ -1114,6 +1107,9 @@ let Jodit = Jodit_1 = class Jodit extends ViewWithToolbar {
1114
1107
  const direction = this.o.direction.toLowerCase() === 'rtl' ? 'rtl' : 'ltr';
1115
1108
  this.editor.style.direction = direction;
1116
1109
  this.editor.setAttribute('dir', direction);
1110
+ this.container.style.direction = direction;
1111
+ this.container.setAttribute('dir', direction);
1112
+ this.toolbar.setDirection(direction);
1117
1113
  }
1118
1114
  // proxy events
1119
1115
  this.e
@@ -508,6 +508,10 @@ let Dialog = Dialog_1 = class Dialog extends ViewWithToolbar {
508
508
  <div class="${n('resizer')}">${Icon.get('resize_handler')}</div>
509
509
  </div>
510
510
  </div>`);
511
+ if (self.options.direction === 'rtl') {
512
+ self.container.style.direction = 'rtl';
513
+ self.container.setAttribute('dir', 'rtl');
514
+ }
511
515
  if (this.o.zIndex) {
512
516
  this.container.style.zIndex = this.o.zIndex.toString();
513
517
  }
@@ -77,6 +77,10 @@ export class AceEditor extends SourceEditor {
77
77
  this.container.appendChild(fakeMirror);
78
78
  const ace = editor.ow.ace;
79
79
  this.instance = ace.edit(fakeMirror);
80
+ if (editor.o.direction === 'rtl') {
81
+ this.instance.setOption('rtlText', true);
82
+ this.instance.setOption('rtl', true);
83
+ }
80
84
  this.instance.setTheme(editor.o.sourceEditorNativeOptions.theme);
81
85
  this.instance.renderer.setShowGutter(editor.o.sourceEditorNativeOptions.showGutter);
82
86
  this.instance
@@ -16,7 +16,8 @@ export class TextAreaEditor extends SourceEditor {
16
16
  }
17
17
  init(editor) {
18
18
  this.instance = editor.c.element('textarea', {
19
- class: 'jodit-source__mirror'
19
+ class: 'jodit-source__mirror',
20
+ dir: editor.o.direction === 'rtl' ? 'rtl' : undefined
20
21
  });
21
22
  this.container.appendChild(this.instance);
22
23
  editor.e
@@ -48,6 +48,7 @@ interface IViewOptions extends ILanguageOptions, IToolbarOptions {
48
48
  disabled?: boolean;
49
49
  readonly?: boolean;
50
50
  iframe?: boolean;
51
+ direction?: 'ltr' | 'rtl' | '';
51
52
  namespace?: string;
52
53
  activeButtonsInReadOnly?: string[];
53
54
  allowTabNavigation?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jodit",
3
- "version": "4.2.43",
3
+ "version": "4.2.46",
4
4
  "description": "Jodit is an awesome and useful wysiwyg editor with filebrowser",
5
5
  "main": "esm/index.js",
6
6
  "types": "types/index.d.ts",
@@ -39,3 +39,21 @@ import type { IDictionary } from "../../../types";
39
39
  */
40
40
  export declare function ConfigProto(options: IDictionary, proto: IDictionary, deep?: number): IDictionary;
41
41
  export declare function ConfigFlatten(obj: IDictionary): IDictionary;
42
+ /**
43
+ * Returns a plain object from a prototype-based object.
44
+ * ```typescript
45
+ * const editor = Jodit.make('#editor', {
46
+ * image: {
47
+ * dialogWidth: 500
48
+ * }
49
+ * });
50
+ *
51
+ * console.log(editor.o.image.openOnDblClick) // true
52
+ * // But you can't get all options in plain object
53
+ * console.log(JSON.stringify(editor.o.image)); // {"dialogWidth":500}
54
+ *
55
+ * const plain = Jodit.modules.Helpers.ConfigDeepFlatten(editor.o.image);
56
+ * console.log(JSON.stringify(plain)); // {"dialogWidth":500, "openOnDblClick": true, "editSrc": true, ...}
57
+ * ```
58
+ */
59
+ export declare function ConfigDeepFlatten(obj: IDictionary): IDictionary;
@@ -48,6 +48,7 @@ interface IViewOptions extends ILanguageOptions, IToolbarOptions {
48
48
  disabled?: boolean;
49
49
  readonly?: boolean;
50
50
  iframe?: boolean;
51
+ direction?: 'ltr' | 'rtl' | '';
51
52
  namespace?: string;
52
53
  activeButtonsInReadOnly?: string[];
53
54
  allowTabNavigation?: boolean;
@@ -1,10 +0,0 @@
1
- /*!
2
- * Jodit Editor (https://xdsoft.net/jodit/)
3
- * Released under MIT see LICENSE.txt in the project root for license information.
4
- * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
- */
6
- import "classlist-polyfill";
7
- import "es6-promise/auto";
8
- import "core-js/es/symbol";
9
- import "core-js/es/array/find-index";
10
- import "core-js/es/array/from";
@@ -1,10 +0,0 @@
1
- /*!
2
- * Jodit Editor (https://xdsoft.net/jodit/)
3
- * Released under MIT see LICENSE.txt in the project root for license information.
4
- * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
- */
6
- import "classlist-polyfill";
7
- import "es6-promise/auto";
8
- import "core-js/es/symbol";
9
- import "core-js/es/array/find-index";
10
- import "core-js/es/array/from";