jodit 4.9.9 → 4.9.11

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 (124) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/es2015/jodit.css +1 -1
  3. package/es2015/jodit.fat.min.js +5 -5
  4. package/es2015/jodit.js +217 -71
  5. package/es2015/jodit.min.js +5 -5
  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 +5 -5
  13. package/es2018/jodit.min.js +5 -5
  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 +5 -5
  18. package/es2021/jodit.js +217 -71
  19. package/es2021/jodit.min.js +5 -5
  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 +5 -5
  28. package/es2021.en/jodit.js +217 -71
  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 +226 -71
  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 +268 -88
  51. package/esm/config.js +166 -51
  52. package/esm/core/constants.js +1 -1
  53. package/esm/core/decorators/autobind/autobind.d.ts +0 -5
  54. package/esm/core/decorators/autobind/autobind.js +1 -1
  55. package/esm/core/decorators/component/component.d.ts +1 -1
  56. package/esm/core/event-emitter/global.d.ts +8 -0
  57. package/esm/core/event-emitter/global.js +8 -0
  58. package/esm/core/storage/async-storage.d.ts +8 -0
  59. package/esm/core/storage/async-storage.js +5 -0
  60. package/esm/core/ui/element.d.ts +1 -0
  61. package/esm/core/ui/element.js +6 -0
  62. package/esm/core/ui/group/group.d.ts +1 -0
  63. package/esm/core/ui/group/group.js +3 -0
  64. package/esm/modules/file-browser/builders/utils.d.ts +8 -0
  65. package/esm/modules/file-browser/builders/utils.js +5 -0
  66. package/esm/modules/toolbar/button/button.d.ts +1 -0
  67. package/esm/modules/toolbar/button/button.js +3 -1
  68. package/esm/plugins/add-new-line/config.d.ts +4 -3
  69. package/esm/plugins/backspace/config.d.ts +3 -0
  70. package/esm/plugins/clean-html/config.d.ts +2 -3
  71. package/esm/plugins/fullsize/config.d.ts +2 -2
  72. package/esm/plugins/hotkeys/config.d.ts +0 -1
  73. package/esm/plugins/iframe/config.d.ts +2 -5
  74. package/esm/plugins/image-processor/config.d.ts +3 -0
  75. package/esm/plugins/image-properties/config.d.ts +4 -0
  76. package/esm/plugins/inline-popup/config/config.d.ts +16 -0
  77. package/esm/plugins/limit/config.d.ts +3 -3
  78. package/esm/plugins/placeholder/config.d.ts +3 -3
  79. package/esm/plugins/resize-cells/config.d.ts +3 -0
  80. package/esm/plugins/resize-handler/config.d.ts +6 -0
  81. package/esm/plugins/resizer/config.d.ts +1 -1
  82. package/esm/plugins/select/config.d.ts +0 -1
  83. package/esm/plugins/select-cells/config.d.ts +3 -0
  84. package/esm/plugins/size/config.js +1 -2
  85. package/esm/plugins/source/config.d.ts +6 -2
  86. package/esm/plugins/stat/config.d.ts +12 -0
  87. package/esm/plugins/sticky/config.d.ts +5 -2
  88. package/esm/plugins/symbols/config.d.ts +6 -0
  89. package/esm/plugins/table/config.d.ts +3 -0
  90. package/esm/plugins/xpath/config.d.ts +3 -0
  91. package/esm/types/ui.d.ts +1 -0
  92. package/package.json +1 -1
  93. package/types/config.d.ts +268 -88
  94. package/types/core/decorators/autobind/autobind.d.ts +0 -5
  95. package/types/core/decorators/component/component.d.ts +1 -1
  96. package/types/core/event-emitter/global.d.ts +8 -0
  97. package/types/core/storage/async-storage.d.ts +8 -0
  98. package/types/core/ui/element.d.ts +1 -0
  99. package/types/core/ui/group/group.d.ts +1 -0
  100. package/types/modules/file-browser/builders/utils.d.ts +8 -0
  101. package/types/modules/toolbar/button/button.d.ts +1 -0
  102. package/types/plugins/add-new-line/config.d.ts +4 -3
  103. package/types/plugins/backspace/config.d.ts +3 -0
  104. package/types/plugins/clean-html/config.d.ts +2 -3
  105. package/types/plugins/fullsize/config.d.ts +2 -2
  106. package/types/plugins/hotkeys/config.d.ts +0 -1
  107. package/types/plugins/iframe/config.d.ts +2 -5
  108. package/types/plugins/image-processor/config.d.ts +3 -0
  109. package/types/plugins/image-properties/config.d.ts +4 -0
  110. package/types/plugins/inline-popup/config/config.d.ts +16 -0
  111. package/types/plugins/limit/config.d.ts +3 -3
  112. package/types/plugins/placeholder/config.d.ts +3 -3
  113. package/types/plugins/resize-cells/config.d.ts +3 -0
  114. package/types/plugins/resize-handler/config.d.ts +6 -0
  115. package/types/plugins/resizer/config.d.ts +1 -1
  116. package/types/plugins/select/config.d.ts +0 -1
  117. package/types/plugins/select-cells/config.d.ts +3 -0
  118. package/types/plugins/source/config.d.ts +6 -2
  119. package/types/plugins/stat/config.d.ts +12 -0
  120. package/types/plugins/sticky/config.d.ts +5 -2
  121. package/types/plugins/symbols/config.d.ts +6 -0
  122. package/types/plugins/table/config.d.ts +3 -0
  123. package/types/plugins/xpath/config.d.ts +3 -0
  124. package/types/types/ui.d.ts +1 -0
package/esm/config.d.ts CHANGED
@@ -26,18 +26,112 @@ import type { IUIButtonState } from "./types/index";
26
26
  import type { IViewOptions } from "./types/index";
27
27
  import type { NodeFunction } from "./types/index";
28
28
  /**
29
- * Default Editor's Configuration
29
+ * Default Editor's Configuration.
30
+ *
31
+ * This class holds all default option values for the Jodit editor.
32
+ * It uses a **private constructor** and a **lazy singleton** pattern — the single instance
33
+ * is created on the first access to {@link Config.defaultOptions} (also available as `Jodit.defaultOptions`).
34
+ *
35
+ * ## How options are resolved
36
+ *
37
+ * When you create an editor with `Jodit.make('#editor', userOptions)`, the library
38
+ * calls {@link ConfigProto}(userOptions, Config.defaultOptions). `ConfigProto` does
39
+ * **not** deep-clone the defaults. Instead it creates a new object whose JavaScript
40
+ * prototype is `Config.defaultOptions`:
41
+ *
42
+ * ```
43
+ * userOptions ──[[Prototype]]──► Config.defaultOptions
44
+ * ```
45
+ *
46
+ * Any key present in `userOptions` shadows the default;
47
+ * any key **not** present falls through to `Config.defaultOptions` via the prototype chain.
48
+ * Nested plain objects are recursively prototyped in the same way, so partial overrides
49
+ * of nested options work automatically:
50
+ *
51
+ * ```js
52
+ * // Only override `dialogWidth`; all other `image.*` defaults are still available
53
+ * Jodit.make('#editor', {
54
+ * image: { dialogWidth: 500 }
55
+ * });
56
+ * ```
57
+ *
58
+ * ## How plugins extend the config
59
+ *
60
+ * Each plugin adds its own defaults by assigning to `Config.prototype` and augmenting
61
+ * the TypeScript type with `declare module`:
62
+ *
63
+ * ```ts
64
+ * // 1. Type augmentation (compile-time)
65
+ * declare module 'jodit/config' {
66
+ * interface Config {
67
+ * toolbarSticky: boolean;
68
+ * }
69
+ * }
70
+ *
71
+ * // 2. Runtime default
72
+ * Config.prototype.toolbarSticky = true;
73
+ * ```
74
+ *
75
+ * Because the constructor runs `Object.assign(this, ConfigPrototype)` (where
76
+ * `ConfigPrototype` is captured as `Config.prototype` after the class definition),
77
+ * all prototype-level values — including those added by plugins — are materialized
78
+ * as own properties on the singleton. This means `Config.defaultOptions` always
79
+ * contains every registered option as an own, enumerable property.
80
+ *
81
+ * ## Changing global defaults
82
+ *
83
+ * You can modify `Jodit.defaultOptions` **before** creating editors to change
84
+ * defaults globally:
85
+ *
86
+ * ```js
87
+ * Jodit.defaultOptions.language = 'de';
88
+ * Jodit.defaultOptions.theme = 'dark';
89
+ *
90
+ * // Both editors inherit the new defaults
91
+ * Jodit.make('#editor1');
92
+ * Jodit.make('#editor2');
93
+ * ```
94
+ *
95
+ * ## `Jodit.atom` — preventing deep merge
96
+ *
97
+ * By default, `ConfigProto` deep-merges nested plain objects and arrays.
98
+ * Wrap a value with `Jodit.atom(value)` to make it **atomic** — it will completely
99
+ * replace the default instead of being merged:
100
+ *
101
+ * ```js
102
+ * Jodit.make('#editor', {
103
+ * controls: {
104
+ * fontsize: {
105
+ * // Replace the entire list rather than merging with the default one
106
+ * list: Jodit.atom([8, 9, 10])
107
+ * }
108
+ * }
109
+ * });
110
+ * ```
111
+ *
112
+ * `Jodit.atom` calls {@link markAsAtomic}, which sets a non-enumerable
113
+ * `isAtom` flag on the object. `ConfigProto` checks this flag and skips
114
+ * recursive merging when it is present. Note: top-level arrays (depth 0)
115
+ * are always treated as atomic — they replace rather than merge.
116
+ *
117
+ * @see {@link ConfigProto} for the full merge algorithm
118
+ * @see {@link markAsAtomic} / {@link isAtom} for the atom marker implementation
30
119
  */
31
120
  declare class Config implements IViewOptions {
32
121
  private constructor();
33
122
  /**
34
- * Use cache for heavy methods
123
+ * When enabled, the editor caches the results of expensive computations (e.g. toolbar rebuilds)
124
+ * to improve performance. Disable for debugging or when options change frequently at runtime.
35
125
  */
36
126
  cache: boolean;
37
127
  /**
38
128
  * Timeout of all asynchronous methods
39
129
  */
40
130
  defaultTimeout: number;
131
+ /**
132
+ * Prefix used for CSS class names and local-storage keys to avoid collisions
133
+ * when multiple editor instances or applications share the same page.
134
+ */
41
135
  namespace: string;
42
136
  /**
43
137
  * Editor loads completely without plugins. Useful when debugging your own plugin.
@@ -46,19 +140,16 @@ declare class Config implements IViewOptions {
46
140
  /**
47
141
  * Editor's width
48
142
  *
49
- * @example
50
143
  * ```javascript
51
144
  * Jodit.make('.editor', {
52
145
  * width: '100%',
53
146
  * })
54
147
  * ```
55
- * @example
56
148
  * ```javascript
57
149
  * Jodit.make('.editor', {
58
150
  * width: 600, // equivalent for '600px'
59
151
  * })
60
152
  * ```
61
- * @example
62
153
  * ```javascript
63
154
  * Jodit.make('.editor', {
64
155
  * width: 'auto', // autosize
@@ -69,19 +160,16 @@ declare class Config implements IViewOptions {
69
160
  /**
70
161
  * Editor's height
71
162
  *
72
- * @example
73
163
  * ```javascript
74
164
  * Jodit.make('.editor', {
75
165
  * height: '100%',
76
166
  * })
77
167
  * ```
78
- * @example
79
168
  * ```javascript
80
169
  * Jodit.make('.editor', {
81
170
  * height: 600, // equivalent for '600px'
82
171
  * })
83
172
  * ```
84
- * @example
85
173
  * ```javascript
86
174
  * Jodit.make('.editor', {
87
175
  * height: 'auto', // default - autosize
@@ -116,7 +204,37 @@ declare class Config implements IViewOptions {
116
204
  * ```
117
205
  */
118
206
  preset: string;
207
+ /**
208
+ * Dictionary of named configuration presets. Each key is a preset name and the value
209
+ * is a partial options object that will be merged into the editor config when
210
+ * {@link Config.preset} matches the key.
211
+ *
212
+ * ```javascript
213
+ * // Use a built-in preset
214
+ * Jodit.make('#editor', {
215
+ * preset: 'inline'
216
+ * });
217
+ * ```
218
+ *
219
+ * ```javascript
220
+ * // Define and use a custom preset
221
+ * Jodit.defaultOptions.presets.myCompact = {
222
+ * toolbarButtonSize: 'small',
223
+ * showCharsCounter: false,
224
+ * showWordsCounter: false,
225
+ * showXPathInStatusbar: false
226
+ * };
227
+ *
228
+ * Jodit.make('#editor', {
229
+ * preset: 'myCompact'
230
+ * });
231
+ * ```
232
+ */
119
233
  presets: IDictionary;
234
+ /**
235
+ * The Document object the editor operates within. Defaults to the current `document`.
236
+ * Override when the editor is created inside an iframe or a different browsing context.
237
+ */
120
238
  ownerDocument: Document;
121
239
  /**
122
240
  * Allows you to specify the window in which the editor will be created. Default - window
@@ -150,7 +268,9 @@ declare class Config implements IViewOptions {
150
268
  */
151
269
  shadowRoot: Nullable<ShadowRoot>;
152
270
  /**
153
- * z-index For editor
271
+ * Base CSS `z-index` for the editor UI (toolbar, popups, dialogs).
272
+ * Set to a higher value when other page elements overlap the editor.
273
+ * `0` means no explicit z-index is applied.
154
274
  */
155
275
  zIndex: number;
156
276
  /**
@@ -180,7 +300,6 @@ declare class Config implements IViewOptions {
180
300
  /**
181
301
  * Size of icons in the toolbar (can be "small", "middle", "large")
182
302
  *
183
- * @example
184
303
  * ```javascript
185
304
  * const editor = Jodit.make(".dark_editor", {
186
305
  * toolbarButtonSize: "small"
@@ -193,12 +312,14 @@ declare class Config implements IViewOptions {
193
312
  */
194
313
  allowTabNavigation: boolean;
195
314
  /**
196
- * Inline editing mode
315
+ * When enabled, the editor renders without its own container chrome (toolbar, borders, statusbar).
316
+ * The editable area becomes the element itself. Typically combined with
317
+ * `toolbarInline: true` so a floating toolbar appears on selection.
197
318
  */
198
319
  inline: boolean;
199
320
  /**
200
321
  * Theme (can be "dark")
201
- * @example
322
+ *
202
323
  * ```javascript
203
324
  * const editor = Jodit.make(".dark_editor", {
204
325
  * theme: "dark"
@@ -213,10 +334,9 @@ declare class Config implements IViewOptions {
213
334
  /**
214
335
  * Class name that can be appended to the editable area
215
336
  *
216
- * @see [[Config.iframeCSSLinks]]
217
- * @see [[Config.iframeStyle]]
337
+ * @see {@link Config.iframeCSSLinks}
338
+ * @see {@link Config.iframeStyle}
218
339
  *
219
- * @example
220
340
  * ```javascript
221
341
  * Jodit.make('#editor', {
222
342
  * editorClassName: 'some_my_class'
@@ -233,7 +353,7 @@ declare class Config implements IViewOptions {
233
353
  editorClassName: false | string;
234
354
  /**
235
355
  * Class name that can be appended to the main editor container
236
- * @example
356
+ *
237
357
  * ```javascript
238
358
  * const jodit = Jodit.make('#editor', {
239
359
  * className: 'some_my_class'
@@ -254,7 +374,7 @@ declare class Config implements IViewOptions {
254
374
  /**
255
375
  * The internal styles of the editable area. They are intended to change
256
376
  * not the appearance of the editor, but to change the appearance of the content.
257
- * @example
377
+ *
258
378
  * ```javascript
259
379
  * Jodit.make('#editor', {
260
380
  * style: {
@@ -266,13 +386,14 @@ declare class Config implements IViewOptions {
266
386
  */
267
387
  style: false | IDictionary;
268
388
  /**
389
+ * Inline CSS styles applied to the outer editor container element.
390
+ * Use this to style the editor wrapper (borders, background, etc.) without affecting content.
269
391
  *
270
- * @example
271
392
  * ```javascript
272
393
  * Jodit.make('#editor', {
273
- * editorStyle: {
274
- * font: '12px Arial',
275
- * color: '#0c0c0c'
394
+ * containerStyle: {
395
+ * border: '1px solid #ccc',
396
+ * background: '#f9f9f9'
276
397
  * }
277
398
  * });
278
399
  * ```
@@ -282,7 +403,6 @@ declare class Config implements IViewOptions {
282
403
  * Dictionary of variable values in css, a complete list can be found here
283
404
  * https://github.com/xdan/jodit/blob/main/src/styles/variables.less#L25
284
405
  *
285
- * @example
286
406
  * ```js
287
407
  * const editor = Jodit.make('#editor', {
288
408
  * styleValues: {
@@ -295,9 +415,9 @@ declare class Config implements IViewOptions {
295
415
  */
296
416
  styleValues: IDictionary;
297
417
  /**
298
- * After all, changes in editors for textarea will call change trigger
418
+ * When enabled, the editor dispatches a native `change` event on the original
419
+ * `<textarea>` element whenever the content changes, so standard DOM listeners work.
299
420
  *
300
- * @example
301
421
  * ```javascript
302
422
  * const editor = Jodit.make('#editor');
303
423
  * document.getElementById('editor').addEventListener('change', function () {
@@ -312,7 +432,6 @@ declare class Config implements IViewOptions {
312
432
  * the page element direction. 'ltr' – Indicates a Left-To-Right text direction (like in English).
313
433
  * 'rtl' – Indicates a Right-To-Left text direction (like in Arabic).
314
434
  *
315
- * @example
316
435
  * ```javascript
317
436
  * Jodit.make('.editor', {
318
437
  * direction: 'rtl'
@@ -325,7 +444,6 @@ declare class Config implements IViewOptions {
325
444
  * (navigator.language && navigator.language.substr(0, 2)) ||
326
445
  * (navigator.browserLanguage && navigator.browserLanguage.substr(0, 2)) || 'en'
327
446
  *
328
- * @example
329
447
  * ```html
330
448
  * <!-- include in you page lang file -->
331
449
  * <script src="jodit/lang/de.js"></script>
@@ -340,7 +458,6 @@ declare class Config implements IViewOptions {
340
458
  /**
341
459
  * if true all Lang.i18n(key) return `{key}`
342
460
  *
343
- * @example
344
461
  * ```html
345
462
  * <script>
346
463
  * var editor = Jodit.make('.editor', {
@@ -355,7 +472,6 @@ declare class Config implements IViewOptions {
355
472
  /**
356
473
  * Collection of language pack data `{en: {'Type something': 'Type something', ...}}`
357
474
  *
358
- * @example
359
475
  * ```javascript
360
476
  * const editor = Jodit.make('#editor', {
361
477
  * language: 'ru',
@@ -393,12 +509,12 @@ declare class Config implements IViewOptions {
393
509
  */
394
510
  showTooltipDelay: number;
395
511
  /**
396
- * Instead of create custop tooltip - use native title tooltips
512
+ * Instead of creating a custom tooltip, use the browser's native title tooltips
397
513
  */
398
514
  useNativeTooltip: boolean;
399
515
  /**
400
- * Default insert method
401
- * @default insert_as_html
516
+ * How pasted content is inserted into the editor by default.
517
+ * Possible values: `insert_as_html`, `insert_as_text`, `insert_only_text`, `insert_clear_html`.
402
518
  */
403
519
  defaultActionOnPaste: InsertMode;
404
520
  /**
@@ -408,7 +524,6 @@ declare class Config implements IViewOptions {
408
524
  /**
409
525
  * When this option is enabled, the editor's content will be placed in an iframe and isolated from the rest of the page.
410
526
  *
411
- * @example
412
527
  * ```javascript
413
528
  * Jodit.make('#editor', {
414
529
  * iframe: true,
@@ -421,7 +536,7 @@ declare class Config implements IViewOptions {
421
536
  /**
422
537
  * Allow editing the entire HTML document(html, head)
423
538
  * \> Works together with the iframe option.
424
- * @example
539
+ *
425
540
  * ```js
426
541
  * const editor = Jodit.make('#editor', {
427
542
  * iframe: true,
@@ -442,7 +557,7 @@ declare class Config implements IViewOptions {
442
557
  /**
443
558
  * Jodit.MODE_WYSIWYG The HTML editor allows you to write like MSWord,
444
559
  * Jodit.MODE_SOURCE syntax highlighting source editor
445
- * @example
560
+ *
446
561
  * ```javascript
447
562
  * var editor = Jodit.make('#editor', {
448
563
  * defaultMode: Jodit.MODE_SPLIT
@@ -452,12 +567,12 @@ declare class Config implements IViewOptions {
452
567
  */
453
568
  defaultMode: number;
454
569
  /**
455
- * Use split mode
570
+ * When enabled, the editor displays both the WYSIWYG view and the source-code view side by side.
456
571
  */
457
572
  useSplitMode: boolean;
458
573
  /**
459
574
  * The colors in HEX representation to select a color for the background and for the text in colorpicker
460
- * @example
575
+ *
461
576
  * ```javascript
462
577
  * Jodit.make('#editor', {
463
578
  * colors: ['#ff0000', '#00ff00', '#0000ff']
@@ -467,7 +582,7 @@ declare class Config implements IViewOptions {
467
582
  colors: IDictionary<string[]> | string[];
468
583
  /**
469
584
  * The default tab color picker
470
- * @example
585
+ *
471
586
  * ```javascript
472
587
  * Jodit.make('#editor2', {
473
588
  * colorPickerDefaultTab: 'color'
@@ -476,12 +591,12 @@ declare class Config implements IViewOptions {
476
591
  */
477
592
  colorPickerDefaultTab: 'background' | 'color';
478
593
  /**
479
- * Image size defaults to a larger image
594
+ * Default width (in pixels) applied to images inserted into the editor
480
595
  */
481
596
  imageDefaultWidth: number;
482
597
  /**
483
598
  * Do not display these buttons that are on the list
484
- * @example
599
+ *
485
600
  * ```javascript
486
601
  * Jodit.make('#editor2', {
487
602
  * removeButtons: ['hr', 'source']
@@ -491,7 +606,7 @@ declare class Config implements IViewOptions {
491
606
  removeButtons: string[];
492
607
  /**
493
608
  * Do not init these plugins
494
- * @example
609
+ *
495
610
  * ```typescript
496
611
  * var editor = Jodit.make('.editor', {
497
612
  * disablePlugins: 'table,iframe'
@@ -505,7 +620,7 @@ declare class Config implements IViewOptions {
505
620
  disablePlugins: string[] | string;
506
621
  /**
507
622
  * Init and download extra plugins
508
- * @example
623
+ *
509
624
  * ```typescript
510
625
  * var editor = Jodit.make('.editor', {
511
626
  * extraPlugins: ['emoji']
@@ -519,7 +634,7 @@ declare class Config implements IViewOptions {
519
634
  */
520
635
  basePath?: string;
521
636
  /**
522
- * These buttons list will be added to the option. Buttons
637
+ * Additional buttons appended to the {@link Config.buttons} list
523
638
  */
524
639
  extraButtons: Array<string | IControlType>;
525
640
  /**
@@ -527,7 +642,6 @@ declare class Config implements IViewOptions {
527
642
  * You can add your icon to the set using the `Jodit.modules.Icon.set (name, svg Code)` method.
528
643
  * But for a declarative declaration, you can use this option.
529
644
  *
530
- * @example
531
645
  * ```js
532
646
  * Jodit.modules.Icon.set('someIcon', '<svg><path.../></svg>');
533
647
  * const editor = Jodit.make({
@@ -536,8 +650,9 @@ declare class Config implements IViewOptions {
536
650
  * icon: 'someIcon'
537
651
  * }]
538
652
  * });
653
+ * ```
539
654
  *
540
- * @example
655
+ * ```js
541
656
  * const editor = Jodit.make({
542
657
  * extraIcons: {
543
658
  * someIcon: '<svg><path.../></svg>'
@@ -548,7 +663,7 @@ declare class Config implements IViewOptions {
548
663
  * }]
549
664
  * });
550
665
  * ```
551
- * @example
666
+ *
552
667
  * ```js
553
668
  * const editor = Jodit.make({
554
669
  * extraButtons: [{
@@ -561,7 +676,7 @@ declare class Config implements IViewOptions {
561
676
  extraIcons: IDictionary<string>;
562
677
  /**
563
678
  * Default attributes for created inside editor elements
564
- * @example
679
+ *
565
680
  * ```js
566
681
  * const editor2 = Jodit.make('#editor', {
567
682
  * createAttributes: {
@@ -581,7 +696,7 @@ declare class Config implements IViewOptions {
581
696
  * expect(ul.className).equals('ui-test');
582
697
  * ```
583
698
  * Or JSX in React
584
- * @example
699
+ *
585
700
  * ```jsx
586
701
  * import React, {useState, useRef} from 'react';
587
702
  * import JoditEditor from "jodit-react";
@@ -613,7 +728,7 @@ declare class Config implements IViewOptions {
613
728
  /**
614
729
  * The list of buttons that appear in the editor's toolbar on large places (≥ options.sizeLG).
615
730
  * Note - this is not the width of the device, the width of the editor
616
- * @example
731
+ *
617
732
  * ```javascript
618
733
  * Jodit.make('#editor', {
619
734
  * buttons: ['bold', 'italic', 'source'],
@@ -621,7 +736,7 @@ declare class Config implements IViewOptions {
621
736
  * buttonsXS: ['bold', 'fullsize'],
622
737
  * });
623
738
  * ```
624
- * @example
739
+ *
625
740
  * ```javascript
626
741
  * Jodit.make('#editor2', {
627
742
  * buttons: [{
@@ -645,7 +760,7 @@ declare class Config implements IViewOptions {
645
760
  * }]
646
761
  * });
647
762
  * ```
648
- * @example
763
+ *
649
764
  * ```javascript
650
765
  * Jodit.make('#editor2', {
651
766
  * buttons: Jodit.defaultOptions.buttons.concat([{
@@ -674,7 +789,8 @@ declare class Config implements IViewOptions {
674
789
  */
675
790
  buttons: ButtonsOption;
676
791
  /**
677
- * Behavior for buttons
792
+ * Map of toolbar button names to their control definitions (icon, tooltip, exec handler, etc.).
793
+ * Plugins extend this object with their own button definitions via `Config.prototype.controls`.
678
794
  */
679
795
  controls: Controls;
680
796
  /**
@@ -704,7 +820,7 @@ declare class Config implements IViewOptions {
704
820
  */
705
821
  events: IDictionary<(...args: any[]) => any>;
706
822
  /**
707
- * Buttons in toolbat without SVG - only texts
823
+ * Buttons in toolbar without SVG - only texts
708
824
  */
709
825
  textIcons: boolean;
710
826
  /**
@@ -756,16 +872,17 @@ interface Config {
756
872
  }
757
873
  interface Config {
758
874
  /**
759
- * Create helper
875
+ * Show a green "add paragraph" bar when the cursor hovers near the top or bottom
876
+ * edge of certain block elements (tables, images, iframes, etc.)
760
877
  */
761
878
  addNewLine: boolean;
762
879
  /**
763
- * What kind of tags it will be impact
880
+ * Block-level tag names near which the "add new line" bar will appear
764
881
  */
765
882
  addNewLineTagsTriggers: HTMLTagNames[];
766
883
  /**
767
884
  * On dbl click on empty space of editor it add new P element
768
- * @example
885
+ *
769
886
  * ```js
770
887
  * Jodit.make('#editor', {
771
888
  * addNewLineOnDBLClick: false // disable
@@ -783,6 +900,9 @@ interface Config {
783
900
  aiAssistant: AiAssistantSettings;
784
901
  }
785
902
  interface Config {
903
+ /**
904
+ * Keyboard hotkey mappings for delete and backspace operations (character, word, sentence).
905
+ */
786
906
  delete: {
787
907
  hotkeys: {
788
908
  delete: string[];
@@ -837,7 +957,7 @@ interface Config {
837
957
  /**
838
958
  * The allowTags option defines which elements will remain in the
839
959
  * edited text when the editor saves. You can use this limit the returned HTML.
840
- * @example
960
+ *
841
961
  * ```javascript
842
962
  * const jodit = new Jodit.make('#editor', {
843
963
  * cleanHTML: {
@@ -845,7 +965,7 @@ interface Config {
845
965
  * }
846
966
  * });
847
967
  * ```
848
- * @example
968
+ *
849
969
  * ```javascript
850
970
  * const editor = Jodit.make('#editor', {
851
971
  * cleanHTML: {
@@ -858,7 +978,6 @@ interface Config {
858
978
  * console.log(editor.value); //Sorry! <a href="https://xdsoft.net">Freeman</a>
859
979
  * ```
860
980
  *
861
- * @example
862
981
  * ```javascript
863
982
  * const editor = Jodit.make('#editor', {
864
983
  * cleanHTML: {
@@ -921,13 +1040,13 @@ interface Config {
921
1040
  interface Config {
922
1041
  /**
923
1042
  * Open WYSIWYG in full screen
924
- * @example
1043
+ *
925
1044
  * ```javascript
926
1045
  * var editor = Jodit.make({
927
1046
  * fullsize: true // fullsize editor
928
1047
  * });
929
1048
  * ```
930
- * @example
1049
+ *
931
1050
  * ```javascript
932
1051
  * var editor = Jodit.make();
933
1052
  * editor.e.fire('toggleFullSize');
@@ -945,7 +1064,6 @@ interface Config {
945
1064
  /**
946
1065
  * You can redefine hotkeys for some command
947
1066
  *
948
- * @example
949
1067
  * ```js
950
1068
  * const jodit = Jodit.make('#editor', {
951
1069
  * commandToHotkeys: {
@@ -961,7 +1079,6 @@ interface Config {
961
1079
  /**
962
1080
  * You can redefine default page
963
1081
  *
964
- * @example
965
1082
  * ```javascript
966
1083
  * Jodit.make('#editor', {
967
1084
  * iframe: true,
@@ -971,9 +1088,8 @@ interface Config {
971
1088
  */
972
1089
  iframeDefaultSrc: string;
973
1090
  /**
974
- * Base URL where the root directory for [[Config.iframe]] mode
1091
+ * Base URL where the root directory for {@link Config.iframe} mode
975
1092
  *
976
- * @example
977
1093
  * ```javascript
978
1094
  * Jodit.make('#editor', {
979
1095
  * iframe: true,
@@ -992,7 +1108,7 @@ interface Config {
992
1108
  iframeDoctype: string;
993
1109
  /**
994
1110
  * Custom style to be used inside the iframe to display content.
995
- * @example
1111
+ *
996
1112
  * ```javascript
997
1113
  * Jodit.make('#editor', {
998
1114
  * iframe: true,
@@ -1004,7 +1120,6 @@ interface Config {
1004
1120
  /**
1005
1121
  * Custom stylesheet files to be used inside the iframe to display content.
1006
1122
  *
1007
- * @example
1008
1123
  * ```javascript
1009
1124
  * Jodit.make('#editor', {
1010
1125
  * iframe: true,
@@ -1027,11 +1142,18 @@ interface Config {
1027
1142
  iframeSandbox: string | null;
1028
1143
  }
1029
1144
  interface Config {
1145
+ /**
1146
+ * Options for processing images inserted into the editor (e.g. converting base64 data URIs to Blob URLs).
1147
+ */
1030
1148
  imageProcessor: {
1031
1149
  replaceDataURIToBlobIdInView: boolean;
1032
1150
  };
1033
1151
  }
1034
1152
  interface Config {
1153
+ /**
1154
+ * Configuration for the image properties dialog (opened on double-click).
1155
+ * Controls which editing tabs are available: src, alt, title, link, size, margins, classes, styles, etc.
1156
+ */
1035
1157
  image: ImagePropertiesOptions;
1036
1158
  }
1037
1159
  interface Config {
@@ -1041,23 +1163,39 @@ interface Config {
1041
1163
  indentMargin: number;
1042
1164
  }
1043
1165
  interface Config {
1166
+ /**
1167
+ * Element-specific popup toolbars. Keys are tag names (e.g. `img`, `a`, `cells`)
1168
+ * and values are button lists or factory functions that return them.
1169
+ */
1044
1170
  popup: IDictionary<Array<IControlType | string> | ((editor: IJodit, target: HTMLElement | undefined, close: () => void) => Array<IControlType | string> | HTMLElement | string)>;
1171
+ /**
1172
+ * List of button names to exclude from the inline toolbar
1173
+ */
1045
1174
  toolbarInlineDisabledButtons: string[];
1175
+ /**
1176
+ * Show an inline toolbar when the user clicks inside the editor area (e.g. near images, links)
1177
+ */
1046
1178
  toolbarInline: boolean;
1179
+ /**
1180
+ * Show an inline toolbar when the user selects text
1181
+ */
1047
1182
  toolbarInlineForSelection: boolean;
1183
+ /**
1184
+ * CSS selector or array of selectors for elements that should not trigger the inline toolbar
1185
+ */
1048
1186
  toolbarInlineDisableFor: string | string[];
1049
1187
  }
1050
1188
  interface Config {
1051
1189
  /**
1052
- * limit words count
1190
+ * Maximum number of words allowed in the editor. Set to `false` to disable the limit.
1053
1191
  */
1054
1192
  limitWords: false | number;
1055
1193
  /**
1056
- * limit chars count
1194
+ * Maximum number of characters allowed in the editor. Set to `false` to disable the limit.
1057
1195
  */
1058
1196
  limitChars: false | number;
1059
1197
  /**
1060
- * limit html chars count
1198
+ * Maximum number of characters counted from the raw HTML source. Set to `false` to disable the limit.
1061
1199
  */
1062
1200
  limitHTML: false;
1063
1201
  }
@@ -1217,7 +1355,7 @@ interface Config {
1217
1355
  interface Config {
1218
1356
  /**
1219
1357
  * Show placeholder
1220
- * @example
1358
+ *
1221
1359
  * ```javascript
1222
1360
  * const editor = Jodit.make('#editor', {
1223
1361
  * showPlaceholder: false
@@ -1227,7 +1365,7 @@ interface Config {
1227
1365
  showPlaceholder: boolean;
1228
1366
  /**
1229
1367
  * Use a placeholder from original input field, if it was set
1230
- * @example
1368
+ *
1231
1369
  * ```javascript
1232
1370
  * //<textarea id="editor" placeholder="start typing text ..." cols="30" rows="10"></textarea>
1233
1371
  * const editor = Jodit.make('#editor', {
@@ -1238,7 +1376,7 @@ interface Config {
1238
1376
  useInputsPlaceholder: boolean;
1239
1377
  /**
1240
1378
  * Default placeholder
1241
- * @example
1379
+ *
1242
1380
  * ```javascript
1243
1381
  * const editor = Jodit.make('#editor', {
1244
1382
  * placeholder: 'start typing text ...'
@@ -1254,15 +1392,24 @@ interface Config {
1254
1392
  hidePoweredByJodit: boolean;
1255
1393
  }
1256
1394
  interface Config {
1395
+ /**
1396
+ * Allow users to resize table cells by dragging the cell borders
1397
+ */
1257
1398
  tableAllowCellResize: boolean;
1258
1399
  }
1259
1400
  interface Config {
1401
+ /**
1402
+ * Allow the user to resize the editor horizontally by dragging the resize handle
1403
+ */
1260
1404
  allowResizeX: boolean;
1405
+ /**
1406
+ * Allow the user to resize the editor vertically by dragging the resize handle
1407
+ */
1261
1408
  allowResizeY: boolean;
1262
1409
  }
1263
1410
  interface Config {
1264
1411
  /**
1265
- * Use true frame for editing iframe size
1412
+ * Set of HTML tag names whose elements can be resized by the user via drag handles (e.g. images, iframes, tables)
1266
1413
  */
1267
1414
  allowResizeTags: Set<HTMLTagNames>;
1268
1415
  resizer: {
@@ -1342,7 +1489,6 @@ interface Config {
1342
1489
  normalizeSelectionBeforeCutAndCopy: boolean;
1343
1490
  /**
1344
1491
  * Normalize selection after triple click
1345
- * @example
1346
1492
  *
1347
1493
  * `<ul><li>|test</li><li>|pop</li></ul>` will be `<ul><li>|test|</li><li>pop</li</ul>|`
1348
1494
  */
@@ -1350,6 +1496,9 @@ interface Config {
1350
1496
  };
1351
1497
  }
1352
1498
  interface Config {
1499
+ /**
1500
+ * Allow users to select multiple table cells by clicking and dragging
1501
+ */
1353
1502
  tableAllowCellSelection: boolean;
1354
1503
  }
1355
1504
  interface Config {
@@ -1360,20 +1509,24 @@ interface Config {
1360
1509
  maxHeight: number | string;
1361
1510
  }
1362
1511
  interface Config {
1512
+ /**
1513
+ * Which source-code editor to use: `'area'` for a plain textarea, `'ace'` to load the Ace editor,
1514
+ * or a factory function that returns a custom source editor instance.
1515
+ */
1363
1516
  sourceEditor: 'area' | 'ace' | ((jodit: IJodit) => ISourceEditor);
1364
1517
  /**
1365
- * Options for [ace](https://ace.c9.io/#config) editor
1366
- * @example
1367
- * ```js
1368
- * Jodit.make('#editor', {
1369
- * showGutter: true,
1370
- * theme: 'ace/theme/idle_fingers',
1371
- * mode: 'ace/mode/html',
1372
- * wrap: true,
1373
- § * highlightActiveLine: true
1374
- * })
1375
- * ```
1376
- */
1518
+ * Options for [ace](https://ace.c9.io/#config) editor
1519
+ *
1520
+ * ```js
1521
+ * Jodit.make('#editor', {
1522
+ * showGutter: true,
1523
+ * theme: 'ace/theme/idle_fingers',
1524
+ * mode: 'ace/mode/html',
1525
+ * wrap: true,
1526
+ * highlightActiveLine: true
1527
+ * })
1528
+ * ```
1529
+ */
1377
1530
  sourceEditorNativeOptions: {
1378
1531
  showGutter: boolean;
1379
1532
  theme: string;
@@ -1450,14 +1603,27 @@ interface Config {
1450
1603
  spellcheck: boolean;
1451
1604
  }
1452
1605
  interface Config {
1606
+ /**
1607
+ * Display a character counter in the statusbar
1608
+ */
1453
1609
  showCharsCounter: boolean;
1610
+ /**
1611
+ * When true, count characters from the raw HTML source instead of visible text only
1612
+ */
1454
1613
  countHTMLChars: boolean;
1614
+ /**
1615
+ * When true, include whitespace characters in the character count
1616
+ */
1455
1617
  countTextSpaces: boolean;
1618
+ /**
1619
+ * Display a word counter in the statusbar
1620
+ */
1456
1621
  showWordsCounter: boolean;
1457
1622
  }
1458
1623
  interface Config {
1459
1624
  /**
1460
- * @example
1625
+ * Keep the toolbar visible at the top of the viewport when scrolling past the editor
1626
+ *
1461
1627
  * ```javascript
1462
1628
  * var editor = Jodit.make('#someid', {
1463
1629
  * toolbarSticky: false
@@ -1465,12 +1631,14 @@ interface Config {
1465
1631
  * ```
1466
1632
  */
1467
1633
  toolbarSticky: boolean;
1634
+ /**
1635
+ * Disable sticky toolbar on mobile devices to save screen space
1636
+ */
1468
1637
  toolbarDisableStickyForMobile: boolean;
1469
1638
  /**
1470
1639
  * For example, in Joomla, the top menu bar closes Jodit toolbar when scrolling. Therefore, it is necessary to
1471
1640
  * move the toolbar Jodit by this amount [more](https://xdsoft.net/jodit/docs/#2.5.57)
1472
1641
  *
1473
- * @example
1474
1642
  * ```javascript
1475
1643
  * var editor = Jodit.make('#someid', {
1476
1644
  * toolbarStickyOffset: 100
@@ -1480,7 +1648,13 @@ interface Config {
1480
1648
  toolbarStickyOffset: number;
1481
1649
  }
1482
1650
  interface Config {
1651
+ /**
1652
+ * Array of HTML entities or characters displayed in the special-characters picker
1653
+ */
1483
1654
  specialCharacters: string[];
1655
+ /**
1656
+ * When true, show the special-characters picker as a toolbar popup instead of a modal dialog
1657
+ */
1484
1658
  usePopupForSpecialCharacters: boolean;
1485
1659
  }
1486
1660
  interface Config {
@@ -1492,6 +1666,9 @@ interface Config {
1492
1666
  };
1493
1667
  }
1494
1668
  interface Config {
1669
+ /**
1670
+ * Options for table insertion and behavior.
1671
+ */
1495
1672
  table: {
1496
1673
  splitBlockOnInsertTable: boolean;
1497
1674
  selectionCellStyle: string;
@@ -1547,5 +1724,8 @@ interface Config {
1547
1724
  };
1548
1725
  }
1549
1726
  interface Config {
1727
+ /**
1728
+ * Show the element breadcrumb path (e.g. `body > p > strong`) in the statusbar
1729
+ */
1550
1730
  showXPathInStatusbar: boolean;
1551
1731
  }