jodit 4.11.15 → 4.12.2

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 (61) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/es2015/jodit.css +1 -1
  3. package/es2015/jodit.fat.min.js +3 -3
  4. package/es2015/jodit.js +84 -5
  5. package/es2015/jodit.min.js +3 -3
  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.fat.min.js +3 -3
  13. package/es2018/jodit.min.js +3 -3
  14. package/es2018/plugins/debug/debug.min.js +1 -1
  15. package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
  16. package/es2021/jodit.css +1 -1
  17. package/es2021/jodit.fat.min.js +4 -4
  18. package/es2021/jodit.js +84 -5
  19. package/es2021/jodit.min.js +4 -4
  20. package/es2021/plugins/debug/debug.css +1 -1
  21. package/es2021/plugins/debug/debug.js +1 -1
  22. package/es2021/plugins/debug/debug.min.js +1 -1
  23. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  24. package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
  25. package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
  26. package/es2021.en/jodit.css +1 -1
  27. package/es2021.en/jodit.fat.min.js +4 -4
  28. package/es2021.en/jodit.js +84 -5
  29. package/es2021.en/jodit.min.js +5 -5
  30. package/es2021.en/plugins/debug/debug.css +1 -1
  31. package/es2021.en/plugins/debug/debug.js +1 -1
  32. package/es2021.en/plugins/debug/debug.min.js +1 -1
  33. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  34. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
  35. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
  36. package/es5/jodit.css +2 -2
  37. package/es5/jodit.fat.min.js +2 -2
  38. package/es5/jodit.js +87 -5
  39. package/es5/jodit.min.css +2 -2
  40. package/es5/jodit.min.js +2 -2
  41. package/es5/plugins/debug/debug.css +1 -1
  42. package/es5/plugins/debug/debug.js +1 -1
  43. package/es5/plugins/debug/debug.min.js +1 -1
  44. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  45. package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
  46. package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
  47. package/es5/polyfills.fat.min.js +1 -1
  48. package/es5/polyfills.js +1 -1
  49. package/es5/polyfills.min.js +1 -1
  50. package/esm/core/constants.js +1 -1
  51. package/esm/core/helpers/utils/config-proto.d.ts +21 -0
  52. package/esm/core/helpers/utils/config-proto.js +32 -0
  53. package/esm/jodit.d.ts +44 -0
  54. package/esm/jodit.js +47 -1
  55. package/esm/modules/widget/file-selector/file-selector.js +2 -1
  56. package/esm/plugins/link/link.js +2 -1
  57. package/esm/typings.d.ts +1 -0
  58. package/package.json +1 -1
  59. package/types/core/helpers/utils/config-proto.d.ts +21 -0
  60. package/types/jodit.d.ts +44 -0
  61. package/types/typings.d.ts +1 -0
@@ -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.11.15
4
+ * Version: v4.12.2
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.11.15
4
+ * Version: v4.12.2
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.11.15
4
+ * Version: v4.12.2
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.11.15
4
+ * Version: v4.12.2
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.11.15
4
+ * Version: v4.12.2
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.11.15
4
+ * Version: v4.12.2
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.11.15
4
+ * Version: v4.12.2
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
package/es5/polyfills.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.11.15
4
+ * Version: v4.12.2
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.11.15
4
+ * Version: v4.12.2
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-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
- export const APP_VERSION = "4.11.15";
6
+ export const APP_VERSION = "4.12.2";
7
7
  // prettier-ignore
8
8
  export const ES = "es2020";
9
9
  export const IS_ES_MODERN = true;
@@ -56,4 +56,25 @@ export declare function ConfigFlatten(obj: IDictionary): IDictionary;
56
56
  * console.log(JSON.stringify(plain)); // {"dialogWidth":500, "openOnDblClick": true, "editSrc": true, ...}
57
57
  * ```
58
58
  */
59
+ /**
60
+ * Deep-merges `source` into `target` in-place.
61
+ * Uses the same merge semantics as {@link ConfigProto}:
62
+ * - Nested plain objects are merged recursively
63
+ * - {@link isAtom | Atomic} values replace the target entirely
64
+ * - Everything else (primitives, arrays, class instances) replaces the target value
65
+ *
66
+ * Designed for patching `Config.defaultOptions` without losing existing keys:
67
+ *
68
+ * ```js
69
+ * Jodit.configure({
70
+ * controls: {
71
+ * someButton: { group: 'custom' }
72
+ * }
73
+ * });
74
+ * // Only `controls.someButton` is touched — all other controls remain intact.
75
+ * ```
76
+ *
77
+ * @see {@link ConfigProto} for the prototype-chain variant used at editor creation time
78
+ */
79
+ export declare function ConfigMerge(target: IDictionary, source: IDictionary): void;
59
80
  export declare function ConfigDeepFlatten(obj: IDictionary): IDictionary;
@@ -97,6 +97,38 @@ export function ConfigFlatten(obj) {
97
97
  * console.log(JSON.stringify(plain)); // {"dialogWidth":500, "openOnDblClick": true, "editSrc": true, ...}
98
98
  * ```
99
99
  */
100
+ /**
101
+ * Deep-merges `source` into `target` in-place.
102
+ * Uses the same merge semantics as {@link ConfigProto}:
103
+ * - Nested plain objects are merged recursively
104
+ * - {@link isAtom | Atomic} values replace the target entirely
105
+ * - Everything else (primitives, arrays, class instances) replaces the target value
106
+ *
107
+ * Designed for patching `Config.defaultOptions` without losing existing keys:
108
+ *
109
+ * ```js
110
+ * Jodit.configure({
111
+ * controls: {
112
+ * someButton: { group: 'custom' }
113
+ * }
114
+ * });
115
+ * // Only `controls.someButton` is touched — all other controls remain intact.
116
+ * ```
117
+ *
118
+ * @see {@link ConfigProto} for the prototype-chain variant used at editor creation time
119
+ */
120
+ export function ConfigMerge(target, source) {
121
+ Object.keys(source).forEach(key => {
122
+ const srcVal = source[key];
123
+ const tgtVal = target[key];
124
+ if (isPlainObject(srcVal) && isPlainObject(tgtVal) && !isAtom(srcVal)) {
125
+ ConfigMerge(tgtVal, srcVal);
126
+ }
127
+ else {
128
+ target[key] = srcVal;
129
+ }
130
+ });
131
+ }
100
132
  export function ConfigDeepFlatten(obj) {
101
133
  return keys(obj, false).reduce((app, key) => {
102
134
  app[key] = isPlainObject(obj[key])
package/esm/jodit.d.ts CHANGED
@@ -79,6 +79,50 @@ export declare class Jodit extends ViewWithToolbar implements IJodit, Dlgs {
79
79
  * Default settings
80
80
  */
81
81
  static get defaultOptions(): Config;
82
+ /**
83
+ * Deep-merges partial options into the global defaults without replacing
84
+ * top-level objects. This lets you patch nested settings (e.g. a single
85
+ * button inside `controls`) without losing the rest:
86
+ *
87
+ * ```js
88
+ * // Add a custom button — all existing controls remain untouched
89
+ * Jodit.configure({
90
+ * controls: {
91
+ * myButton: {
92
+ * icon: 'pencil',
93
+ * command: 'selectall'
94
+ * }
95
+ * }
96
+ * });
97
+ *
98
+ * // Override only the `group` of an existing button
99
+ * Jodit.configure({
100
+ * controls: {
101
+ * someButton: { group: 'custom' }
102
+ * }
103
+ * });
104
+ *
105
+ * // Works with any nested option
106
+ * Jodit.configure({
107
+ * createAttributes: {
108
+ * div: { class: 'my-class' }
109
+ * }
110
+ * });
111
+ *
112
+ * // Use Jodit.atom() to replace a nested value entirely instead of merging
113
+ * Jodit.configure({
114
+ * controls: {
115
+ * fontsize: {
116
+ * list: Jodit.atom([8, 9, 10])
117
+ * }
118
+ * }
119
+ * });
120
+ * ```
121
+ *
122
+ * @see {@link ConfigMerge} for the merge algorithm
123
+ * @see {@link ConfigProto} for per-instance prototype-based merge used at editor creation time
124
+ */
125
+ static configure(options: IDictionary): void;
82
126
  static fatMode: boolean;
83
127
  static readonly plugins: IPluginSystem;
84
128
  static modules: typeof Modules;
package/esm/jodit.js CHANGED
@@ -18,7 +18,7 @@ import * as constants from "./core/constants.js";
18
18
  import { FAT_MODE, IS_PROD, lang } from "./core/constants.js";
19
19
  import { autobind, cache, cached, derive, throttle, watch } from "./core/decorators/index.js";
20
20
  import { eventEmitter, instances, modules, pluginSystem } from "./core/global.js";
21
- import { asArray, attr, callPromise, ConfigProto, css, error, isFunction, isJoditObject, isNumber, isPromise, isString, isVoid, kebabCase, markAsAtomic, normalizeKeyAliases, resolveElement, toArray, ucfirst } from "./core/helpers/index.js";
21
+ import { asArray, attr, callPromise, ConfigMerge, ConfigProto, css, error, isFunction, isJoditObject, isNumber, isPromise, isString, isVoid, kebabCase, markAsAtomic, normalizeKeyAliases, resolveElement, toArray, ucfirst } from "./core/helpers/index.js";
22
22
  import { Ajax } from "./core/request/index.js";
23
23
  import { Dlgs } from "./core/traits/dlgs.js";
24
24
  import { Config } from "./config.js";
@@ -116,6 +116,52 @@ let Jodit = Jodit_1 = class Jodit extends ViewWithToolbar {
116
116
  static get defaultOptions() {
117
117
  return Config.defaultOptions;
118
118
  }
119
+ /**
120
+ * Deep-merges partial options into the global defaults without replacing
121
+ * top-level objects. This lets you patch nested settings (e.g. a single
122
+ * button inside `controls`) without losing the rest:
123
+ *
124
+ * ```js
125
+ * // Add a custom button — all existing controls remain untouched
126
+ * Jodit.configure({
127
+ * controls: {
128
+ * myButton: {
129
+ * icon: 'pencil',
130
+ * command: 'selectall'
131
+ * }
132
+ * }
133
+ * });
134
+ *
135
+ * // Override only the `group` of an existing button
136
+ * Jodit.configure({
137
+ * controls: {
138
+ * someButton: { group: 'custom' }
139
+ * }
140
+ * });
141
+ *
142
+ * // Works with any nested option
143
+ * Jodit.configure({
144
+ * createAttributes: {
145
+ * div: { class: 'my-class' }
146
+ * }
147
+ * });
148
+ *
149
+ * // Use Jodit.atom() to replace a nested value entirely instead of merging
150
+ * Jodit.configure({
151
+ * controls: {
152
+ * fontsize: {
153
+ * list: Jodit.atom([8, 9, 10])
154
+ * }
155
+ * }
156
+ * });
157
+ * ```
158
+ *
159
+ * @see {@link ConfigMerge} for the merge algorithm
160
+ * @see {@link ConfigProto} for per-instance prototype-based merge used at editor creation time
161
+ */
162
+ static configure(options) {
163
+ ConfigMerge(Jodit_1.defaultOptions, options);
164
+ }
119
165
  get createInside() {
120
166
  return new Create(() => this.ed, this.o.createAttributes);
121
167
  }
@@ -66,7 +66,8 @@ export const FileSelectorWidget = (editor, callbacks, elm, close, isImage = true
66
66
  type: 'submit',
67
67
  variant: 'primary',
68
68
  text: 'Insert'
69
- }), form = new UIForm(editor, [
69
+ });
70
+ const form = new UIForm(editor, [
70
71
  new UIInput(editor, {
71
72
  required: true,
72
73
  label: 'URL',
@@ -105,7 +105,8 @@ export class link extends Plugin {
105
105
  }
106
106
  __generateForm(current, close) {
107
107
  const { jodit } = this;
108
- const i18n = jodit.i18n.bind(jodit), { openInNewTabCheckbox, openInNewTabCheckboxDefaultChecked, noFollowCheckbox, formTemplate, formClassName, modeClassName } = jodit.o.link;
108
+ const i18n = jodit.i18n.bind(jodit);
109
+ const { openInNewTabCheckbox, openInNewTabCheckboxDefaultChecked, noFollowCheckbox, formTemplate, formClassName, modeClassName } = jodit.o.link;
109
110
  const html = formTemplate(jodit);
110
111
  const form = isString(html)
111
112
  ? jodit.c.fromHTML(html, {
package/esm/typings.d.ts CHANGED
@@ -10,3 +10,4 @@ declare module '*.svg' {
10
10
  const content: string;
11
11
  export default content;
12
12
  }
13
+ declare module '*.less';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jodit",
3
- "version": "4.11.15",
3
+ "version": "4.12.2",
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",
@@ -56,4 +56,25 @@ export declare function ConfigFlatten(obj: IDictionary): IDictionary;
56
56
  * console.log(JSON.stringify(plain)); // {"dialogWidth":500, "openOnDblClick": true, "editSrc": true, ...}
57
57
  * ```
58
58
  */
59
+ /**
60
+ * Deep-merges `source` into `target` in-place.
61
+ * Uses the same merge semantics as {@link ConfigProto}:
62
+ * - Nested plain objects are merged recursively
63
+ * - {@link isAtom | Atomic} values replace the target entirely
64
+ * - Everything else (primitives, arrays, class instances) replaces the target value
65
+ *
66
+ * Designed for patching `Config.defaultOptions` without losing existing keys:
67
+ *
68
+ * ```js
69
+ * Jodit.configure({
70
+ * controls: {
71
+ * someButton: { group: 'custom' }
72
+ * }
73
+ * });
74
+ * // Only `controls.someButton` is touched — all other controls remain intact.
75
+ * ```
76
+ *
77
+ * @see {@link ConfigProto} for the prototype-chain variant used at editor creation time
78
+ */
79
+ export declare function ConfigMerge(target: IDictionary, source: IDictionary): void;
59
80
  export declare function ConfigDeepFlatten(obj: IDictionary): IDictionary;
package/types/jodit.d.ts CHANGED
@@ -79,6 +79,50 @@ export declare class Jodit extends ViewWithToolbar implements IJodit, Dlgs {
79
79
  * Default settings
80
80
  */
81
81
  static get defaultOptions(): Config;
82
+ /**
83
+ * Deep-merges partial options into the global defaults without replacing
84
+ * top-level objects. This lets you patch nested settings (e.g. a single
85
+ * button inside `controls`) without losing the rest:
86
+ *
87
+ * ```js
88
+ * // Add a custom button — all existing controls remain untouched
89
+ * Jodit.configure({
90
+ * controls: {
91
+ * myButton: {
92
+ * icon: 'pencil',
93
+ * command: 'selectall'
94
+ * }
95
+ * }
96
+ * });
97
+ *
98
+ * // Override only the `group` of an existing button
99
+ * Jodit.configure({
100
+ * controls: {
101
+ * someButton: { group: 'custom' }
102
+ * }
103
+ * });
104
+ *
105
+ * // Works with any nested option
106
+ * Jodit.configure({
107
+ * createAttributes: {
108
+ * div: { class: 'my-class' }
109
+ * }
110
+ * });
111
+ *
112
+ * // Use Jodit.atom() to replace a nested value entirely instead of merging
113
+ * Jodit.configure({
114
+ * controls: {
115
+ * fontsize: {
116
+ * list: Jodit.atom([8, 9, 10])
117
+ * }
118
+ * }
119
+ * });
120
+ * ```
121
+ *
122
+ * @see {@link ConfigMerge} for the merge algorithm
123
+ * @see {@link ConfigProto} for per-instance prototype-based merge used at editor creation time
124
+ */
125
+ static configure(options: IDictionary): void;
82
126
  static fatMode: boolean;
83
127
  static readonly plugins: IPluginSystem;
84
128
  static modules: typeof Modules;
@@ -10,3 +10,4 @@ declare module '*.svg' {
10
10
  const content: string;
11
11
  export default content;
12
12
  }
13
+ declare module '*.less';