jodit 4.6.11 → 4.6.13

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 (65) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/es2015/jodit.css +1 -1
  3. package/es2015/jodit.fat.min.js +2 -2
  4. package/es2015/jodit.js +18 -131
  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 +22 -132
  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 +21 -132
  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 +21 -132
  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/415.fat.min.js +1 -1
  43. package/es5/415.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 +18 -131
  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/array/index.d.ts +0 -1
  59. package/esm/core/helpers/array/index.js +0 -1
  60. package/esm/core/selection/style/transactions.js +15 -4
  61. package/package.json +1 -1
  62. package/types/core/helpers/array/index.d.ts +0 -1
  63. package/esm/core/helpers/array/reconcile-arrays.d.ts +0 -54
  64. package/esm/core/helpers/array/reconcile-arrays.js +0 -103
  65. package/types/core/helpers/array/reconcile-arrays.d.ts +0 -54
@@ -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.6.11
4
+ * Version: v4.6.13
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.6.11
4
+ * Version: v4.6.13
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.6.11
4
+ * Version: v4.6.13
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.6.11
4
+ * Version: v4.6.13
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.6.11
4
+ * Version: v4.6.13
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.6.11
4
+ * Version: v4.6.13
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-2025 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
- export const APP_VERSION = "4.6.11";
6
+ export const APP_VERSION = "4.6.13";
7
7
  // prettier-ignore
8
8
  export const ES = "es2020";
9
9
  export const IS_ES_MODERN = true;
@@ -7,6 +7,5 @@
7
7
  * @module helpers/array
8
8
  */
9
9
  export { asArray } from "./as-array";
10
- export { applyArrayReconciliation, reconcileArrays, type ReconcileResult } from "./reconcile-arrays";
11
10
  export { splitArray } from "./split-array";
12
11
  export { toArray } from "./to-array";
@@ -7,6 +7,5 @@
7
7
  * @module helpers/array
8
8
  */
9
9
  export { asArray } from "./as-array.js";
10
- export { applyArrayReconciliation, reconcileArrays } from "./reconcile-arrays.js";
11
10
  export { splitArray } from "./split-array.js";
12
11
  export { toArray } from "./to-array.js";
@@ -81,16 +81,27 @@ export const transactions = {
81
81
  },
82
82
  [states.EXTRACT]: {
83
83
  exec(value) {
84
+ var _a;
84
85
  const { element, jodit, style } = value;
85
86
  const suit = suitableClosest(style, element, jodit.editor);
86
87
  assert(suit, 'This place should have an element');
87
- if (!style.elementIsBlock) {
88
- extractSelectedPart(suit, element, jodit);
88
+ // If we're applying inline styles to a block element, don't split the block
89
+ const isApplyingInlineStyle = !style.elementIsBlock && ((_a = style.options.attributes) === null || _a === void 0 ? void 0 : _a.style);
90
+ const shouldNotSplitBlock = isApplyingInlineStyle && Dom.isBlock(suit);
91
+ if (!shouldNotSplitBlock) {
92
+ if (!style.elementIsBlock) {
93
+ extractSelectedPart(suit, element, jodit);
94
+ }
95
+ return {
96
+ ...value,
97
+ element: suit,
98
+ next: states.ELEMENT
99
+ };
89
100
  }
101
+ // Create a new wrapper instead of splitting the block
90
102
  return {
91
103
  ...value,
92
- element: suit,
93
- next: states.ELEMENT
104
+ next: states.WRAP
94
105
  };
95
106
  }
96
107
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jodit",
3
- "version": "4.6.11",
3
+ "version": "4.6.13",
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",
@@ -7,6 +7,5 @@
7
7
  * @module helpers/array
8
8
  */
9
9
  export { asArray } from "./as-array";
10
- export { applyArrayReconciliation, reconcileArrays, type ReconcileResult } from "./reconcile-arrays";
11
10
  export { splitArray } from "./split-array";
12
11
  export { toArray } from "./to-array";
@@ -1,54 +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-2025 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
- */
6
- /**
7
- * @module helpers/array
8
- */
9
- export interface ReconcileResult<T> {
10
- added: T[];
11
- removed: T[];
12
- kept: T[];
13
- moved: Array<{
14
- item: T;
15
- from: number;
16
- to: number;
17
- }>;
18
- }
19
- /**
20
- * Reconciles two arrays and returns the differences
21
- * @param oldArray - The original array
22
- * @param newArray - The new array to compare against
23
- * @param keyFn - Optional function to generate unique keys for items (for object comparison)
24
- * @returns Object containing added, removed, kept and moved items
25
- *
26
- * @example
27
- * ```typescript
28
- * const old = [1, 2, 3, 4];
29
- * const new = [2, 4, 5, 1];
30
- * const result = reconcileArrays(old, new);
31
- * // result.added = [5]
32
- * // result.removed = [3]
33
- * // result.kept = [2, 4, 1]
34
- * // result.moved = [{item: 1, from: 0, to: 3}]
35
- * ```
36
- *
37
- * @example
38
- * ```typescript
39
- * const old = [{id: 1, name: 'a'}, {id: 2, name: 'b'}];
40
- * const new = [{id: 2, name: 'b'}, {id: 3, name: 'c'}];
41
- * const result = reconcileArrays(old, new, item => item.id);
42
- * // result.added = [{id: 3, name: 'c'}]
43
- * // result.removed = [{id: 1, name: 'a'}]
44
- * ```
45
- */
46
- export declare function reconcileArrays<T>(oldArray: T[], newArray: T[], keyFn?: (item: T) => string | number): ReconcileResult<T>;
47
- /**
48
- * Applies reconciliation patches to transform one array into another
49
- * @param oldArray - The original array to transform
50
- * @param newArray - The target array structure
51
- * @param keyFn - Optional function to generate unique keys for items
52
- * @returns New array matching the structure of newArray
53
- */
54
- export declare function applyArrayReconciliation<T>(oldArray: T[], newArray: T[], keyFn?: (item: T) => string | number): T[];
@@ -1,103 +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-2025 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
- */
6
- /**
7
- * Reconciles two arrays and returns the differences
8
- * @param oldArray - The original array
9
- * @param newArray - The new array to compare against
10
- * @param keyFn - Optional function to generate unique keys for items (for object comparison)
11
- * @returns Object containing added, removed, kept and moved items
12
- *
13
- * @example
14
- * ```typescript
15
- * const old = [1, 2, 3, 4];
16
- * const new = [2, 4, 5, 1];
17
- * const result = reconcileArrays(old, new);
18
- * // result.added = [5]
19
- * // result.removed = [3]
20
- * // result.kept = [2, 4, 1]
21
- * // result.moved = [{item: 1, from: 0, to: 3}]
22
- * ```
23
- *
24
- * @example
25
- * ```typescript
26
- * const old = [{id: 1, name: 'a'}, {id: 2, name: 'b'}];
27
- * const new = [{id: 2, name: 'b'}, {id: 3, name: 'c'}];
28
- * const result = reconcileArrays(old, new, item => item.id);
29
- * // result.added = [{id: 3, name: 'c'}]
30
- * // result.removed = [{id: 1, name: 'a'}]
31
- * ```
32
- */
33
- export function reconcileArrays(oldArray, newArray, keyFn) {
34
- const getKey = keyFn || ((item) => item);
35
- const oldMap = new Map();
36
- const newMap = new Map();
37
- oldArray.forEach((item, index) => {
38
- oldMap.set(getKey(item), { item, index });
39
- });
40
- newArray.forEach((item, index) => {
41
- newMap.set(getKey(item), { item, index });
42
- });
43
- const added = [];
44
- const removed = [];
45
- const kept = [];
46
- const moved = [];
47
- // Find removed items
48
- oldMap.forEach((value, key) => {
49
- if (!newMap.has(key)) {
50
- removed.push(value.item);
51
- }
52
- });
53
- // Find added items and track kept/moved items
54
- newMap.forEach((value, key) => {
55
- const oldItem = oldMap.get(key);
56
- if (!oldItem) {
57
- added.push(value.item);
58
- }
59
- else {
60
- kept.push(value.item);
61
- if (oldItem.index !== value.index) {
62
- moved.push({
63
- item: value.item,
64
- from: oldItem.index,
65
- to: value.index
66
- });
67
- }
68
- }
69
- });
70
- return {
71
- added,
72
- removed,
73
- kept,
74
- moved
75
- };
76
- }
77
- /**
78
- * Applies reconciliation patches to transform one array into another
79
- * @param oldArray - The original array to transform
80
- * @param newArray - The target array structure
81
- * @param keyFn - Optional function to generate unique keys for items
82
- * @returns New array matching the structure of newArray
83
- */
84
- export function applyArrayReconciliation(oldArray, newArray, keyFn) {
85
- const result = reconcileArrays(oldArray, newArray, keyFn);
86
- const output = [];
87
- // Build the new array based on newArray order
88
- newArray.forEach(item => {
89
- const key = keyFn ? keyFn(item) : item;
90
- const isNew = result.added.some(addedItem => (keyFn ? keyFn(addedItem) : addedItem) === key);
91
- if (isNew) {
92
- output.push(item);
93
- }
94
- else {
95
- // Use the old item reference if it exists
96
- const oldItem = oldArray.find(oldItem => (keyFn ? keyFn(oldItem) : oldItem) === key);
97
- if (oldItem !== undefined) {
98
- output.push(oldItem);
99
- }
100
- }
101
- });
102
- return output;
103
- }
@@ -1,54 +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-2025 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
- */
6
- /**
7
- * @module helpers/array
8
- */
9
- export interface ReconcileResult<T> {
10
- added: T[];
11
- removed: T[];
12
- kept: T[];
13
- moved: Array<{
14
- item: T;
15
- from: number;
16
- to: number;
17
- }>;
18
- }
19
- /**
20
- * Reconciles two arrays and returns the differences
21
- * @param oldArray - The original array
22
- * @param newArray - The new array to compare against
23
- * @param keyFn - Optional function to generate unique keys for items (for object comparison)
24
- * @returns Object containing added, removed, kept and moved items
25
- *
26
- * @example
27
- * ```typescript
28
- * const old = [1, 2, 3, 4];
29
- * const new = [2, 4, 5, 1];
30
- * const result = reconcileArrays(old, new);
31
- * // result.added = [5]
32
- * // result.removed = [3]
33
- * // result.kept = [2, 4, 1]
34
- * // result.moved = [{item: 1, from: 0, to: 3}]
35
- * ```
36
- *
37
- * @example
38
- * ```typescript
39
- * const old = [{id: 1, name: 'a'}, {id: 2, name: 'b'}];
40
- * const new = [{id: 2, name: 'b'}, {id: 3, name: 'c'}];
41
- * const result = reconcileArrays(old, new, item => item.id);
42
- * // result.added = [{id: 3, name: 'c'}]
43
- * // result.removed = [{id: 1, name: 'a'}]
44
- * ```
45
- */
46
- export declare function reconcileArrays<T>(oldArray: T[], newArray: T[], keyFn?: (item: T) => string | number): ReconcileResult<T>;
47
- /**
48
- * Applies reconciliation patches to transform one array into another
49
- * @param oldArray - The original array to transform
50
- * @param newArray - The target array structure
51
- * @param keyFn - Optional function to generate unique keys for items
52
- * @returns New array matching the structure of newArray
53
- */
54
- export declare function applyArrayReconciliation<T>(oldArray: T[], newArray: T[], keyFn?: (item: T) => string | number): T[];