jodit 4.12.35 → 4.12.37

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 +28 -0
  2. package/es2015/jodit.css +1 -1
  3. package/es2015/jodit.fat.min.js +3 -3
  4. package/es2015/jodit.js +110 -49
  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 +109 -47
  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 +109 -47
  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 +259 -195
  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/config.d.ts +14 -6
  51. package/esm/core/constants.js +1 -1
  52. package/esm/core/dom/dom.d.ts +35 -12
  53. package/esm/core/dom/dom.js +42 -20
  54. package/esm/core/dom/lazy-walker.d.ts +18 -1
  55. package/esm/core/dom/lazy-walker.js +23 -3
  56. package/esm/core/selection/helpers/index.d.ts +3 -1
  57. package/esm/core/selection/helpers/index.js +3 -1
  58. package/esm/core/selection/selection.d.ts +14 -0
  59. package/esm/core/selection/selection.js +19 -8
  60. package/esm/core/selection/style/api/is-same-attributes.d.ts +4 -2
  61. package/esm/core/selection/style/api/is-same-attributes.js +3 -4
  62. package/esm/core/selection/style/api/is-suit-element.d.ts +2 -1
  63. package/esm/core/selection/style/api/is-suit-element.js +2 -1
  64. package/esm/core/selection/style/api/list/toggle-ordered-list.js +7 -0
  65. package/esm/core/selection/style/api/toggle-attributes.js +3 -1
  66. package/esm/core/selection/style/commit-style.d.ts +1 -1
  67. package/esm/core/selection/style/commit-style.js +2 -2
  68. package/esm/plugins/source/config.d.ts +14 -6
  69. package/esm/plugins/source/editor/engines/ace.js +5 -0
  70. package/package.json +1 -1
  71. package/types/config.d.ts +14 -6
  72. package/types/core/dom/dom.d.ts +35 -12
  73. package/types/core/dom/lazy-walker.d.ts +18 -1
  74. package/types/core/selection/helpers/index.d.ts +3 -1
  75. package/types/core/selection/selection.d.ts +14 -0
  76. package/types/core/selection/style/api/is-same-attributes.d.ts +4 -2
  77. package/types/core/selection/style/api/is-suit-element.d.ts +2 -1
  78. package/types/core/selection/style/commit-style.d.ts +1 -1
  79. package/types/plugins/source/config.d.ts +14 -6
@@ -5,8 +5,10 @@
5
5
  */
6
6
  import type { IDictionary } from "../../../../types/index";
7
7
  /**
8
- * Compares whether the given attributes match the element's own attributes
8
+ * Checks that every attribute from `attrs` is present on the element with
9
+ * the same value (one-directional match: extra own attributes of the element
10
+ * are ignored, empty `attrs` matches any element)
9
11
  * @private
10
12
  */
11
- export declare function isSameAttributes(elm: HTMLElement, attrs?: IDictionary): elm is HTMLElement;
13
+ export declare function isSameAttributes(elm: HTMLElement, attrs?: IDictionary): boolean;
12
14
  export declare function elementsEqualAttributes(elm1: HTMLElement, elm2: HTMLElement): boolean;
@@ -8,13 +8,12 @@ import { attr } from "../../../helpers/utils/index.js";
8
8
  import { assert } from "../../../helpers/utils/assert.js";
9
9
  import { hasSameStyle } from "./has-same-style.js";
10
10
  /**
11
- * Compares whether the given attributes match the element's own attributes
11
+ * Checks that every attribute from `attrs` is present on the element with
12
+ * the same value (one-directional match: extra own attributes of the element
13
+ * are ignored, empty `attrs` matches any element)
12
14
  * @private
13
15
  */
14
16
  export function isSameAttributes(elm, attrs) {
15
- if (!elm.attributes.length && !size(attrs)) {
16
- return true;
17
- }
18
17
  if (!size(attrs)) {
19
18
  return true;
20
19
  }
@@ -12,7 +12,8 @@ import type { ICommitStyle, Nullable } from "../../../../types/index";
12
12
  * @param commitStyle - style commit
13
13
  * @param elm - checked item
14
14
  * @param strict - strict mode - false - the default tag is suitable for us if it is also in the commit
15
- * @param strictStyle - strict style mode - true - the element has the same style keys as in the commit, but not their values
15
+ * @param strictStyle - strict style mode - true - the element must have the same style keys AND values
16
+ * as in the commit, false - matching style keys are enough
16
17
  * @private
17
18
  */
18
19
  export declare function isSuitElement(commitStyle: ICommitStyle, elm: Nullable<Node>, strict: boolean, strictStyle?: boolean): elm is HTMLElement;
@@ -9,7 +9,8 @@ import { isNormalNode } from "./is-normal-node.js";
9
9
  * @param commitStyle - style commit
10
10
  * @param elm - checked item
11
11
  * @param strict - strict mode - false - the default tag is suitable for us if it is also in the commit
12
- * @param strictStyle - strict style mode - true - the element has the same style keys as in the commit, but not their values
12
+ * @param strictStyle - strict style mode - true - the element must have the same style keys AND values
13
+ * as in the commit, false - matching style keys are enough
13
14
  * @private
14
15
  */
15
16
  export function isSuitElement(commitStyle, elm, strict, strictStyle = true) {
@@ -51,6 +51,13 @@ function unwrapList(mode, list, li, jodit, cs) {
51
51
  extractSelectedPart(list, li, jodit);
52
52
  assert(Dom.isHTMLElement(li.parentElement), 'Element should be inside the list');
53
53
  Dom.unwrap(li.parentElement);
54
+ // In the REPLACE mode the content will be immediately wrapped in a `li`
55
+ // of the new list inside `wrapList`, so it should stay in the document.
56
+ // Replacing it with a fragment here would dissolve the content
57
+ // (with `enter: 'br'`) and the new list would never be inserted.
58
+ if (mode === REPLACE) {
59
+ return li;
60
+ }
54
61
  return Dom.replace(li, jodit.o.enter.toLowerCase() !== 'br'
55
62
  ? jodit.o.enter
56
63
  : jodit.createInside.fragment(), jodit.createInside);
@@ -95,7 +95,9 @@ function toggleClass(jodit, value, elm, mode, dry) {
95
95
  function toggleAttribute(jodit, value, elm, key, dry, mode) {
96
96
  assert(isString(value) || isNumber(value) || isBoolean(value) || value == null, 'Attribute value must be a string or number or boolean or null');
97
97
  const hook = jodit.e.fire.bind(jodit.e, `${_PREFIX}AfterToggleAttribute`);
98
- if (attr(elm, key) === value) {
98
+ // `attr()` getter always returns a string, so a number/boolean value
99
+ // must be normalized, otherwise the toggle-off branch is unreachable
100
+ if (attr(elm, key) === (value == null ? value : String(value))) {
99
101
  !dry && attr(elm, key, null);
100
102
  mode = UNSET;
101
103
  !dry && hook(mode, elm, key, value);
@@ -15,7 +15,7 @@ export declare class CommitStyle implements ICommitStyle {
15
15
  get elementIsList(): boolean;
16
16
  get element(): HTMLTagNames;
17
17
  /**
18
- * New element is blocked
18
+ * New element is a block element
19
19
  */
20
20
  get elementIsBlock(): boolean;
21
21
  /**
@@ -13,7 +13,7 @@ export class CommitStyle {
13
13
  if (!data) {
14
14
  return false;
15
15
  }
16
- return data[key];
16
+ return Boolean(data[key]);
17
17
  }
18
18
  setApplied(elm, key) {
19
19
  var _a;
@@ -28,7 +28,7 @@ export class CommitStyle {
28
28
  return this.options.element || this.defaultTag;
29
29
  }
30
30
  /**
31
- * New element is blocked
31
+ * New element is a block element
32
32
  */
33
33
  get elementIsBlock() {
34
34
  return Boolean(this.options.element && IS_BLOCK.test(this.options.element));
@@ -15,15 +15,22 @@ declare module 'jodit/config' {
15
15
  */
16
16
  sourceEditor: 'area' | 'ace' | ((jodit: IJodit) => ISourceEditor);
17
17
  /**
18
- * Options for [ace](https://ace.c9.io/#config) editor
18
+ * Options for [ace](https://ace.c9.io/#config) editor.
19
+ *
20
+ * Besides the named keys below, any other native ACE option is
21
+ * forwarded to `editor.setOptions()` as is, so e.g. `fontSize`,
22
+ * `tabSize` or `useSoftTabs` work too.
19
23
  *
20
24
  * ```js
21
25
  * Jodit.make('#editor', {
22
- * showGutter: true,
23
- * theme: 'ace/theme/idle_fingers',
24
- * mode: 'ace/mode/html',
25
- * wrap: true,
26
- * highlightActiveLine: true
26
+ * sourceEditorNativeOptions: {
27
+ * showGutter: true,
28
+ * theme: 'ace/theme/idle_fingers',
29
+ * mode: 'ace/mode/html',
30
+ * wrap: true,
31
+ * highlightActiveLine: true,
32
+ * fontSize: '16px'
33
+ * }
27
34
  * })
28
35
  * ```
29
36
  */
@@ -33,6 +40,7 @@ declare module 'jodit/config' {
33
40
  mode: string;
34
41
  wrap: string | boolean | number;
35
42
  highlightActiveLine: boolean;
43
+ [option: string]: string | boolean | number | undefined;
36
44
  };
37
45
  /**
38
46
  * Beautify HTML then it possible
@@ -81,6 +81,11 @@ export class AceEditor extends SourceEditor {
81
81
  this.instance.setOption('rtlText', true);
82
82
  this.instance.setOption('rtl', true);
83
83
  }
84
+ // Forward every native ACE option the user provided (theme,
85
+ // mode, fontSize, tabSize, …). Without this only the handful of
86
+ // keys explicitly wired below were applied and extras such as
87
+ // `fontSize` were silently ignored. See #1285
88
+ this.instance.setOptions(editor.o.sourceEditorNativeOptions);
84
89
  this.instance.setTheme(editor.o.sourceEditorNativeOptions.theme);
85
90
  this.instance.renderer.setShowGutter(editor.o.sourceEditorNativeOptions.showGutter);
86
91
  this.instance
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jodit",
3
- "version": "4.12.35",
3
+ "version": "4.12.37",
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",
package/types/config.d.ts CHANGED
@@ -1678,15 +1678,22 @@ interface Config {
1678
1678
  */
1679
1679
  sourceEditor: 'area' | 'ace' | ((jodit: IJodit) => ISourceEditor);
1680
1680
  /**
1681
- * Options for [ace](https://ace.c9.io/#config) editor
1681
+ * Options for [ace](https://ace.c9.io/#config) editor.
1682
+ *
1683
+ * Besides the named keys below, any other native ACE option is
1684
+ * forwarded to `editor.setOptions()` as is, so e.g. `fontSize`,
1685
+ * `tabSize` or `useSoftTabs` work too.
1682
1686
  *
1683
1687
  * ```js
1684
1688
  * Jodit.make('#editor', {
1685
- * showGutter: true,
1686
- * theme: 'ace/theme/idle_fingers',
1687
- * mode: 'ace/mode/html',
1688
- * wrap: true,
1689
- * highlightActiveLine: true
1689
+ * sourceEditorNativeOptions: {
1690
+ * showGutter: true,
1691
+ * theme: 'ace/theme/idle_fingers',
1692
+ * mode: 'ace/mode/html',
1693
+ * wrap: true,
1694
+ * highlightActiveLine: true,
1695
+ * fontSize: '16px'
1696
+ * }
1690
1697
  * })
1691
1698
  * ```
1692
1699
  */
@@ -1696,6 +1703,7 @@ interface Config {
1696
1703
  mode: string;
1697
1704
  wrap: string | boolean | number;
1698
1705
  highlightActiveLine: boolean;
1706
+ [option: string]: string | boolean | number | undefined;
1699
1707
  };
1700
1708
  /**
1701
1709
  * Beautify HTML then it possible
@@ -34,7 +34,11 @@ export declare class Dom {
34
34
  */
35
35
  static unwrap(node: Node): void;
36
36
  /**
37
- * Call functions for all nodes between `start` and `end`
37
+ * Call callback for all nodes between `start` and `end` in document order
38
+ * (`start` and `end` are not included). Iteration stops when the callback returns `true`.
39
+ *
40
+ * `end` must be positioned after `start` in the document (e.g. selection markers),
41
+ * otherwise iteration will stop only at the end of the tree.
38
42
  */
39
43
  static between(start: Node, end: Node, callback: (node: Node) => void | boolean): void;
40
44
  /**
@@ -46,14 +50,18 @@ export declare class Dom {
46
50
  * @param notMoveContent - false - Move content from elm to newTagName
47
51
  * @example
48
52
  * ```javascript
49
- * Jodit.modules.Dom.replace(parent.editor.getElementsByTagName('span')[0], 'p');
50
- * // Replace the first <span> element to the < p >
53
+ * Jodit.modules.Dom.replace(
54
+ * parent.editor.getElementsByTagName('span')[0],
55
+ * 'p',
56
+ * parent.createInside
57
+ * );
58
+ * // Replace the first <span> element to the <p>
51
59
  * ```
52
60
  */
53
- static replace<T extends HTMLElement>(elm: Node, newTagName: HTMLTagNames): T;
54
61
  static replace<T extends HTMLElement>(elm: Node, newTagName: HTMLTagNames, create: ICreate, withAttributes?: boolean, notMoveContent?: boolean): T;
55
- static replace<T extends Node>(elm: Node, newTagName: T): T;
56
- static replace<T extends Node>(elm: Node, newTagName: T | string, create?: ICreate, withAttributes?: boolean, notMoveContent?: boolean): T;
62
+ static replace<T extends Node>(elm: Node, newElement: T, create?: ICreate, withAttributes?: boolean, notMoveContent?: boolean): T;
63
+ static replace<T extends Node>(elm: Node, html: string, create: ICreate, withAttributes?: boolean, notMoveContent?: boolean): T;
64
+ static replace<T extends Node>(elm: Node, newTagNameOrElement: HTMLTagNames | T, create: ICreate, withAttributes?: boolean, notMoveContent?: boolean): T;
57
65
  /**
58
66
  * Checks whether the Node text and blank (in this case it may contain invisible auxiliary characters ,
59
67
  * it is also empty )
@@ -80,9 +88,9 @@ export declare class Dom {
80
88
  */
81
89
  static isCell(elm: unknown): elm is HTMLTableCellElement;
82
90
  /**
83
- * Check if element is a list element UL or OL
91
+ * Check if element is a list element UL or OL
84
92
  */
85
- static isList(elm: Nullable<Node>): elm is HTMLOListElement;
93
+ static isList(elm: Nullable<Node>): elm is HTMLUListElement | HTMLOListElement;
86
94
  /**
87
95
  * Check if element is a part of list element LI
88
96
  */
@@ -103,7 +111,7 @@ export declare class Dom {
103
111
  /**
104
112
  * Check if element is comment node
105
113
  */
106
- static isComment(node: Node): node is Comment;
114
+ static isComment(node: Nullable<Node> | false): node is Comment;
107
115
  /**
108
116
  * Check if element is element node
109
117
  */
@@ -147,7 +155,9 @@ export declare class Dom {
147
155
  */
148
156
  static find<T extends Node = Node>(node: Node, condition: NodeCondition, root: HTMLElement, leftToRight?: boolean, withChild?: boolean): Nullable<T>;
149
157
  /**
150
- * Find next/prev node what `condition(next) === true`
158
+ * Lazily iterate over all nodes what follow after `start` (in document order
159
+ * for `leftToRight = true`, in reverse order otherwise) inside `root`.
160
+ * Ancestors of `start` are not yielded.
151
161
  */
152
162
  static nextGen(start: Node, root: HTMLElement, leftToRight?: boolean, withChild?: boolean): Generator<Node>;
153
163
  /**
@@ -159,7 +169,7 @@ export declare class Dom {
159
169
  * ```javascript
160
170
  * Jodit.modules.Dom.each(editor.s.current(), function (node) {
161
171
  * if (node.nodeType === Node.TEXT_NODE) {
162
- * node.nodeValue = node.nodeValue.replace(Jodit.INVISIBLE_SPACE_REG_EX, '') // remove all of the text element codes invisible character
172
+ * node.nodeValue = node.nodeValue.replace(Jodit.INVISIBLE_SPACE_REG_EXP(), '') // remove all of the text element codes invisible character
163
173
  * }
164
174
  * });
165
175
  * ```
@@ -183,9 +193,16 @@ export declare class Dom {
183
193
  * Returns the nearest non-empty neighbor
184
194
  */
185
195
  static findNotEmptyNeighbor(node: Node, left: boolean, root: HTMLElement): Nullable<Node>;
196
+ /**
197
+ * Returns the previous (`left = true`) or next sibling of the node
198
+ */
186
199
  static sibling(node: Node, left?: boolean): Nullable<Node>;
187
200
  /**
188
201
  * It goes through all the elements in ascending order, and checks to see if they meet the predetermined condition
202
+ *
203
+ * The condition is checked for the `node` itself too. The `root` reached
204
+ * while ascending is checked only when `checkRoot = true`
205
+ * (but if `node === root` it is checked in any case).
189
206
  */
190
207
  static up<T extends HTMLElement>(node: Nullable<Node>, condition: NodeCondition, root?: Node, checkRoot?: boolean): Nullable<T>;
191
208
  /**
@@ -232,6 +249,12 @@ export declare class Dom {
232
249
  * Safe remove element from DOM
233
250
  */
234
251
  static safeRemove(...nodes: unknown[]): void;
252
+ /**
253
+ * Insert a node into the range and collapse the range to the start of
254
+ * the inserted content. Unlike the native `Range.insertNode` it does not
255
+ * split inseparable elements (BR, HR, IMG etc.) and removes empty text
256
+ * nodes produced by the split of a text container.
257
+ */
235
258
  static safeInsertNode(range: Range, node: Node): void;
236
259
  /**
237
260
  * Hide element
@@ -259,7 +282,7 @@ export declare class Dom {
259
282
  */
260
283
  static isMarker(elm: Nullable<Node>): elm is HTMLElement;
261
284
  /**
262
- * Replace temporary elements from string
285
+ * Unwrap temporary elements inside a HTML string (keeps their content)
263
286
  */
264
287
  static replaceTemporaryFromString(value: string): string;
265
288
  /**
@@ -8,6 +8,16 @@
8
8
  */
9
9
  import type { IAsync, IDestructible } from "../../types/index";
10
10
  import { Eventify } from "../event-emitter/eventify";
11
+ /**
12
+ * Walks the DOM tree in small chunks between browser tasks so that even huge
13
+ * documents do not block the main thread.
14
+ *
15
+ * Events:
16
+ * - `visit` - is called for every node; return `true` to mark the pass as
17
+ * "had effect" (it will be passed into the `end` event)
18
+ * - `break` - the pass was interrupted via [[LazyWalker.break]]
19
+ * - `end` - the pass is finished, receives `true` if some `visit` handler returned `true`
20
+ */
11
21
  export declare class LazyWalker extends Eventify<{
12
22
  visit: (node: Node) => boolean;
13
23
  break: (reason?: string) => void;
@@ -16,17 +26,24 @@ export declare class LazyWalker extends Eventify<{
16
26
  private readonly async;
17
27
  private readonly options;
18
28
  private workNodes;
29
+ /**
30
+ * Starts a new pass over the `root` tree.
31
+ * If a previous pass is still running it will be stopped first.
32
+ */
19
33
  setWork(root: Node): this;
20
34
  private hadAffect;
21
35
  private isWorked;
22
36
  private isFinished;
23
37
  constructor(async: IAsync, options?: {
38
+ /** Visit only nodes with this `nodeType` (e.g. `Node.ELEMENT_NODE`) */
24
39
  readonly whatToShow?: number;
40
+ /** Walk the tree from the last node to the first */
25
41
  readonly reverse?: boolean;
42
+ /** How many nodes are processed per one chunk. Default: 50 */
26
43
  readonly timeoutChunkSize?: number;
44
+ /** Delay between chunks in ms */
27
45
  readonly timeout?: number;
28
46
  });
29
- private idleId;
30
47
  private __schedulerController;
31
48
  private _requestStarting;
32
49
  break(reason?: string): void;
@@ -6,7 +6,9 @@
6
6
  export * from "./move-node-inside-start";
7
7
  export * from "./move-the-node-along-the-edge-outward";
8
8
  /**
9
- * Check if the cursor is at the edge of the string
9
+ * Despite the name, returns `true` when the cursor is NOT at the checked edge
10
+ * of the text node: there is significant (non invisible-space) text between
11
+ * the offset and the start (`start = true`) or the end (`end = true`) of the string.
10
12
  * @private
11
13
  */
12
14
  export declare function cursorInTheEdgeOfString(container: Node, offset: number, start: boolean, end: boolean): boolean;
@@ -90,6 +90,11 @@ export declare class Selection implements ISelect {
90
90
  * Restores user selections using marker invisible elements in the DOM.
91
91
  */
92
92
  restore(): void;
93
+ /**
94
+ * Inserts invisible fake nodes on the boundaries of the current selection
95
+ * and returns them. Unlike [[Select.save]] the selection stays valid while
96
+ * the DOM around it is being modified. Restore it later with [[Select.restoreFakes]].
97
+ */
93
98
  fakes(): [
94
99
  ] | [
95
100
  Node
@@ -97,6 +102,10 @@ export declare class Selection implements ISelect {
97
102
  Node,
98
103
  Node
99
104
  ];
105
+ /**
106
+ * Restores the selection previously saved with [[Select.fakes]]
107
+ * and removes the fake nodes (disconnected fakes are ignored).
108
+ */
100
109
  restoreFakes(fakes: [
101
110
  ] | [
102
111
  Node
@@ -244,5 +253,10 @@ export declare class Selection implements ISelect {
244
253
  * Split selection on two parts: left and right
245
254
  */
246
255
  splitSelection(currentBox: HTMLElement, edge?: Node): Nullable<Element>;
256
+ /**
257
+ * Expands the non-collapsed selection outward: boundaries positioned on the
258
+ * edge of their parents are moved out of them (e.g. `<p><b>|test|</b></p>`
259
+ * becomes `<p>|<b>test</b>|</p>`)
260
+ */
247
261
  expandSelection(): this;
248
262
  }
@@ -5,8 +5,10 @@
5
5
  */
6
6
  import type { IDictionary } from "../../../../types/index";
7
7
  /**
8
- * Compares whether the given attributes match the element's own attributes
8
+ * Checks that every attribute from `attrs` is present on the element with
9
+ * the same value (one-directional match: extra own attributes of the element
10
+ * are ignored, empty `attrs` matches any element)
9
11
  * @private
10
12
  */
11
- export declare function isSameAttributes(elm: HTMLElement, attrs?: IDictionary): elm is HTMLElement;
13
+ export declare function isSameAttributes(elm: HTMLElement, attrs?: IDictionary): boolean;
12
14
  export declare function elementsEqualAttributes(elm1: HTMLElement, elm2: HTMLElement): boolean;
@@ -12,7 +12,8 @@ import type { ICommitStyle, Nullable } from "../../../../types/index";
12
12
  * @param commitStyle - style commit
13
13
  * @param elm - checked item
14
14
  * @param strict - strict mode - false - the default tag is suitable for us if it is also in the commit
15
- * @param strictStyle - strict style mode - true - the element has the same style keys as in the commit, but not their values
15
+ * @param strictStyle - strict style mode - true - the element must have the same style keys AND values
16
+ * as in the commit, false - matching style keys are enough
16
17
  * @private
17
18
  */
18
19
  export declare function isSuitElement(commitStyle: ICommitStyle, elm: Nullable<Node>, strict: boolean, strictStyle?: boolean): elm is HTMLElement;
@@ -15,7 +15,7 @@ export declare class CommitStyle implements ICommitStyle {
15
15
  get elementIsList(): boolean;
16
16
  get element(): HTMLTagNames;
17
17
  /**
18
- * New element is blocked
18
+ * New element is a block element
19
19
  */
20
20
  get elementIsBlock(): boolean;
21
21
  /**
@@ -15,15 +15,22 @@ declare module 'jodit/config' {
15
15
  */
16
16
  sourceEditor: 'area' | 'ace' | ((jodit: IJodit) => ISourceEditor);
17
17
  /**
18
- * Options for [ace](https://ace.c9.io/#config) editor
18
+ * Options for [ace](https://ace.c9.io/#config) editor.
19
+ *
20
+ * Besides the named keys below, any other native ACE option is
21
+ * forwarded to `editor.setOptions()` as is, so e.g. `fontSize`,
22
+ * `tabSize` or `useSoftTabs` work too.
19
23
  *
20
24
  * ```js
21
25
  * Jodit.make('#editor', {
22
- * showGutter: true,
23
- * theme: 'ace/theme/idle_fingers',
24
- * mode: 'ace/mode/html',
25
- * wrap: true,
26
- * highlightActiveLine: true
26
+ * sourceEditorNativeOptions: {
27
+ * showGutter: true,
28
+ * theme: 'ace/theme/idle_fingers',
29
+ * mode: 'ace/mode/html',
30
+ * wrap: true,
31
+ * highlightActiveLine: true,
32
+ * fontSize: '16px'
33
+ * }
27
34
  * })
28
35
  * ```
29
36
  */
@@ -33,6 +40,7 @@ declare module 'jodit/config' {
33
40
  mode: string;
34
41
  wrap: string | boolean | number;
35
42
  highlightActiveLine: boolean;
43
+ [option: string]: string | boolean | number | undefined;
36
44
  };
37
45
  /**
38
46
  * Beautify HTML then it possible