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.
- package/CHANGELOG.md +7 -0
- package/es2015/jodit.css +1 -1
- package/es2015/jodit.fat.min.js +5 -5
- package/es2015/jodit.js +217 -71
- package/es2015/jodit.min.js +5 -5
- package/es2015/plugins/debug/debug.css +1 -1
- package/es2015/plugins/debug/debug.js +1 -1
- package/es2015/plugins/debug/debug.min.js +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2018/jodit.fat.min.js +5 -5
- package/es2018/jodit.min.js +5 -5
- package/es2018/plugins/debug/debug.min.js +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021/jodit.css +1 -1
- package/es2021/jodit.fat.min.js +5 -5
- package/es2021/jodit.js +217 -71
- package/es2021/jodit.min.js +5 -5
- package/es2021/plugins/debug/debug.css +1 -1
- package/es2021/plugins/debug/debug.js +1 -1
- package/es2021/plugins/debug/debug.min.js +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021.en/jodit.css +1 -1
- package/es2021.en/jodit.fat.min.js +5 -5
- package/es2021.en/jodit.js +217 -71
- package/es2021.en/jodit.min.js +5 -5
- package/es2021.en/plugins/debug/debug.css +1 -1
- package/es2021.en/plugins/debug/debug.js +1 -1
- package/es2021.en/plugins/debug/debug.min.js +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es5/jodit.css +2 -2
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +226 -71
- package/es5/jodit.min.css +2 -2
- package/es5/jodit.min.js +2 -2
- package/es5/plugins/debug/debug.css +1 -1
- package/es5/plugins/debug/debug.js +1 -1
- package/es5/plugins/debug/debug.min.js +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es5/polyfills.fat.min.js +1 -1
- package/es5/polyfills.js +1 -1
- package/es5/polyfills.min.js +1 -1
- package/esm/config.d.ts +268 -88
- package/esm/config.js +166 -51
- package/esm/core/constants.js +1 -1
- package/esm/core/decorators/autobind/autobind.d.ts +0 -5
- package/esm/core/decorators/autobind/autobind.js +1 -1
- package/esm/core/decorators/component/component.d.ts +1 -1
- package/esm/core/event-emitter/global.d.ts +8 -0
- package/esm/core/event-emitter/global.js +8 -0
- package/esm/core/storage/async-storage.d.ts +8 -0
- package/esm/core/storage/async-storage.js +5 -0
- package/esm/core/ui/element.d.ts +1 -0
- package/esm/core/ui/element.js +6 -0
- package/esm/core/ui/group/group.d.ts +1 -0
- package/esm/core/ui/group/group.js +3 -0
- package/esm/modules/file-browser/builders/utils.d.ts +8 -0
- package/esm/modules/file-browser/builders/utils.js +5 -0
- package/esm/modules/toolbar/button/button.d.ts +1 -0
- package/esm/modules/toolbar/button/button.js +3 -1
- package/esm/plugins/add-new-line/config.d.ts +4 -3
- package/esm/plugins/backspace/config.d.ts +3 -0
- package/esm/plugins/clean-html/config.d.ts +2 -3
- package/esm/plugins/fullsize/config.d.ts +2 -2
- package/esm/plugins/hotkeys/config.d.ts +0 -1
- package/esm/plugins/iframe/config.d.ts +2 -5
- package/esm/plugins/image-processor/config.d.ts +3 -0
- package/esm/plugins/image-properties/config.d.ts +4 -0
- package/esm/plugins/inline-popup/config/config.d.ts +16 -0
- package/esm/plugins/limit/config.d.ts +3 -3
- package/esm/plugins/placeholder/config.d.ts +3 -3
- package/esm/plugins/resize-cells/config.d.ts +3 -0
- package/esm/plugins/resize-handler/config.d.ts +6 -0
- package/esm/plugins/resizer/config.d.ts +1 -1
- package/esm/plugins/select/config.d.ts +0 -1
- package/esm/plugins/select-cells/config.d.ts +3 -0
- package/esm/plugins/size/config.js +1 -2
- package/esm/plugins/source/config.d.ts +6 -2
- package/esm/plugins/stat/config.d.ts +12 -0
- package/esm/plugins/sticky/config.d.ts +5 -2
- package/esm/plugins/symbols/config.d.ts +6 -0
- package/esm/plugins/table/config.d.ts +3 -0
- package/esm/plugins/xpath/config.d.ts +3 -0
- package/esm/types/ui.d.ts +1 -0
- package/package.json +1 -1
- package/types/config.d.ts +268 -88
- package/types/core/decorators/autobind/autobind.d.ts +0 -5
- package/types/core/decorators/component/component.d.ts +1 -1
- package/types/core/event-emitter/global.d.ts +8 -0
- package/types/core/storage/async-storage.d.ts +8 -0
- package/types/core/ui/element.d.ts +1 -0
- package/types/core/ui/group/group.d.ts +1 -0
- package/types/modules/file-browser/builders/utils.d.ts +8 -0
- package/types/modules/toolbar/button/button.d.ts +1 -0
- package/types/plugins/add-new-line/config.d.ts +4 -3
- package/types/plugins/backspace/config.d.ts +3 -0
- package/types/plugins/clean-html/config.d.ts +2 -3
- package/types/plugins/fullsize/config.d.ts +2 -2
- package/types/plugins/hotkeys/config.d.ts +0 -1
- package/types/plugins/iframe/config.d.ts +2 -5
- package/types/plugins/image-processor/config.d.ts +3 -0
- package/types/plugins/image-properties/config.d.ts +4 -0
- package/types/plugins/inline-popup/config/config.d.ts +16 -0
- package/types/plugins/limit/config.d.ts +3 -3
- package/types/plugins/placeholder/config.d.ts +3 -3
- package/types/plugins/resize-cells/config.d.ts +3 -0
- package/types/plugins/resize-handler/config.d.ts +6 -0
- package/types/plugins/resizer/config.d.ts +1 -1
- package/types/plugins/select/config.d.ts +0 -1
- package/types/plugins/select-cells/config.d.ts +3 -0
- package/types/plugins/source/config.d.ts +6 -2
- package/types/plugins/stat/config.d.ts +12 -0
- package/types/plugins/sticky/config.d.ts +5 -2
- package/types/plugins/symbols/config.d.ts +6 -0
- package/types/plugins/table/config.d.ts +3 -0
- package/types/plugins/xpath/config.d.ts +3 -0
- package/types/types/ui.d.ts +1 -0
package/esm/config.js
CHANGED
|
@@ -20,18 +20,112 @@ import * as consts from "./core/constants.js";
|
|
|
20
20
|
import { globalDocument, globalWindow, INSERT_AS_HTML } from "./core/constants.js";
|
|
21
21
|
let ConfigPrototype = {};
|
|
22
22
|
/**
|
|
23
|
-
* Default Editor's Configuration
|
|
23
|
+
* Default Editor's Configuration.
|
|
24
|
+
*
|
|
25
|
+
* This class holds all default option values for the Jodit editor.
|
|
26
|
+
* It uses a **private constructor** and a **lazy singleton** pattern — the single instance
|
|
27
|
+
* is created on the first access to {@link Config.defaultOptions} (also available as `Jodit.defaultOptions`).
|
|
28
|
+
*
|
|
29
|
+
* ## How options are resolved
|
|
30
|
+
*
|
|
31
|
+
* When you create an editor with `Jodit.make('#editor', userOptions)`, the library
|
|
32
|
+
* calls {@link ConfigProto}(userOptions, Config.defaultOptions). `ConfigProto` does
|
|
33
|
+
* **not** deep-clone the defaults. Instead it creates a new object whose JavaScript
|
|
34
|
+
* prototype is `Config.defaultOptions`:
|
|
35
|
+
*
|
|
36
|
+
* ```
|
|
37
|
+
* userOptions ──[[Prototype]]──► Config.defaultOptions
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* Any key present in `userOptions` shadows the default;
|
|
41
|
+
* any key **not** present falls through to `Config.defaultOptions` via the prototype chain.
|
|
42
|
+
* Nested plain objects are recursively prototyped in the same way, so partial overrides
|
|
43
|
+
* of nested options work automatically:
|
|
44
|
+
*
|
|
45
|
+
* ```js
|
|
46
|
+
* // Only override `dialogWidth`; all other `image.*` defaults are still available
|
|
47
|
+
* Jodit.make('#editor', {
|
|
48
|
+
* image: { dialogWidth: 500 }
|
|
49
|
+
* });
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* ## How plugins extend the config
|
|
53
|
+
*
|
|
54
|
+
* Each plugin adds its own defaults by assigning to `Config.prototype` and augmenting
|
|
55
|
+
* the TypeScript type with `declare module`:
|
|
56
|
+
*
|
|
57
|
+
* ```ts
|
|
58
|
+
* // 1. Type augmentation (compile-time)
|
|
59
|
+
* declare module 'jodit/config' {
|
|
60
|
+
* interface Config {
|
|
61
|
+
* toolbarSticky: boolean;
|
|
62
|
+
* }
|
|
63
|
+
* }
|
|
64
|
+
*
|
|
65
|
+
* // 2. Runtime default
|
|
66
|
+
* Config.prototype.toolbarSticky = true;
|
|
67
|
+
* ```
|
|
68
|
+
*
|
|
69
|
+
* Because the constructor runs `Object.assign(this, ConfigPrototype)` (where
|
|
70
|
+
* `ConfigPrototype` is captured as `Config.prototype` after the class definition),
|
|
71
|
+
* all prototype-level values — including those added by plugins — are materialized
|
|
72
|
+
* as own properties on the singleton. This means `Config.defaultOptions` always
|
|
73
|
+
* contains every registered option as an own, enumerable property.
|
|
74
|
+
*
|
|
75
|
+
* ## Changing global defaults
|
|
76
|
+
*
|
|
77
|
+
* You can modify `Jodit.defaultOptions` **before** creating editors to change
|
|
78
|
+
* defaults globally:
|
|
79
|
+
*
|
|
80
|
+
* ```js
|
|
81
|
+
* Jodit.defaultOptions.language = 'de';
|
|
82
|
+
* Jodit.defaultOptions.theme = 'dark';
|
|
83
|
+
*
|
|
84
|
+
* // Both editors inherit the new defaults
|
|
85
|
+
* Jodit.make('#editor1');
|
|
86
|
+
* Jodit.make('#editor2');
|
|
87
|
+
* ```
|
|
88
|
+
*
|
|
89
|
+
* ## `Jodit.atom` — preventing deep merge
|
|
90
|
+
*
|
|
91
|
+
* By default, `ConfigProto` deep-merges nested plain objects and arrays.
|
|
92
|
+
* Wrap a value with `Jodit.atom(value)` to make it **atomic** — it will completely
|
|
93
|
+
* replace the default instead of being merged:
|
|
94
|
+
*
|
|
95
|
+
* ```js
|
|
96
|
+
* Jodit.make('#editor', {
|
|
97
|
+
* controls: {
|
|
98
|
+
* fontsize: {
|
|
99
|
+
* // Replace the entire list rather than merging with the default one
|
|
100
|
+
* list: Jodit.atom([8, 9, 10])
|
|
101
|
+
* }
|
|
102
|
+
* }
|
|
103
|
+
* });
|
|
104
|
+
* ```
|
|
105
|
+
*
|
|
106
|
+
* `Jodit.atom` calls {@link markAsAtomic}, which sets a non-enumerable
|
|
107
|
+
* `isAtom` flag on the object. `ConfigProto` checks this flag and skips
|
|
108
|
+
* recursive merging when it is present. Note: top-level arrays (depth 0)
|
|
109
|
+
* are always treated as atomic — they replace rather than merge.
|
|
110
|
+
*
|
|
111
|
+
* @see {@link ConfigProto} for the full merge algorithm
|
|
112
|
+
* @see {@link markAsAtomic} / {@link isAtom} for the atom marker implementation
|
|
24
113
|
*/
|
|
25
114
|
class Config {
|
|
26
115
|
constructor() {
|
|
27
116
|
/**
|
|
28
|
-
*
|
|
117
|
+
* When enabled, the editor caches the results of expensive computations (e.g. toolbar rebuilds)
|
|
118
|
+
* to improve performance. Disable for debugging or when options change frequently at runtime.
|
|
29
119
|
*/
|
|
30
120
|
this.cache = true;
|
|
31
121
|
/**
|
|
32
122
|
* Timeout of all asynchronous methods
|
|
33
123
|
*/
|
|
34
124
|
this.defaultTimeout = 100;
|
|
125
|
+
/**
|
|
126
|
+
* Prefix used for CSS class names and local-storage keys to avoid collisions
|
|
127
|
+
* when multiple editor instances or applications share the same page.
|
|
128
|
+
*/
|
|
35
129
|
this.namespace = '';
|
|
36
130
|
/**
|
|
37
131
|
* Editor loads completely without plugins. Useful when debugging your own plugin.
|
|
@@ -40,19 +134,16 @@ class Config {
|
|
|
40
134
|
/**
|
|
41
135
|
* Editor's width
|
|
42
136
|
*
|
|
43
|
-
* @example
|
|
44
137
|
* ```javascript
|
|
45
138
|
* Jodit.make('.editor', {
|
|
46
139
|
* width: '100%',
|
|
47
140
|
* })
|
|
48
141
|
* ```
|
|
49
|
-
* @example
|
|
50
142
|
* ```javascript
|
|
51
143
|
* Jodit.make('.editor', {
|
|
52
144
|
* width: 600, // equivalent for '600px'
|
|
53
145
|
* })
|
|
54
146
|
* ```
|
|
55
|
-
* @example
|
|
56
147
|
* ```javascript
|
|
57
148
|
* Jodit.make('.editor', {
|
|
58
149
|
* width: 'auto', // autosize
|
|
@@ -63,19 +154,16 @@ class Config {
|
|
|
63
154
|
/**
|
|
64
155
|
* Editor's height
|
|
65
156
|
*
|
|
66
|
-
* @example
|
|
67
157
|
* ```javascript
|
|
68
158
|
* Jodit.make('.editor', {
|
|
69
159
|
* height: '100%',
|
|
70
160
|
* })
|
|
71
161
|
* ```
|
|
72
|
-
* @example
|
|
73
162
|
* ```javascript
|
|
74
163
|
* Jodit.make('.editor', {
|
|
75
164
|
* height: 600, // equivalent for '600px'
|
|
76
165
|
* })
|
|
77
166
|
* ```
|
|
78
|
-
* @example
|
|
79
167
|
* ```javascript
|
|
80
168
|
* Jodit.make('.editor', {
|
|
81
169
|
* height: 'auto', // default - autosize
|
|
@@ -116,6 +204,32 @@ class Config {
|
|
|
116
204
|
* ```
|
|
117
205
|
*/
|
|
118
206
|
this.preset = 'custom';
|
|
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
|
this.presets = {
|
|
120
234
|
inline: {
|
|
121
235
|
inline: true,
|
|
@@ -128,6 +242,10 @@ class Config {
|
|
|
128
242
|
showPlaceholder: false
|
|
129
243
|
}
|
|
130
244
|
};
|
|
245
|
+
/**
|
|
246
|
+
* The Document object the editor operates within. Defaults to the current `document`.
|
|
247
|
+
* Override when the editor is created inside an iframe or a different browsing context.
|
|
248
|
+
*/
|
|
131
249
|
this.ownerDocument = globalDocument;
|
|
132
250
|
/**
|
|
133
251
|
* Allows you to specify the window in which the editor will be created. Default - window
|
|
@@ -161,7 +279,9 @@ class Config {
|
|
|
161
279
|
*/
|
|
162
280
|
this.shadowRoot = null;
|
|
163
281
|
/**
|
|
164
|
-
* z-index
|
|
282
|
+
* Base CSS `z-index` for the editor UI (toolbar, popups, dialogs).
|
|
283
|
+
* Set to a higher value when other page elements overlap the editor.
|
|
284
|
+
* `0` means no explicit z-index is applied.
|
|
165
285
|
*/
|
|
166
286
|
this.zIndex = 0;
|
|
167
287
|
/**
|
|
@@ -198,7 +318,6 @@ class Config {
|
|
|
198
318
|
/**
|
|
199
319
|
* Size of icons in the toolbar (can be "small", "middle", "large")
|
|
200
320
|
*
|
|
201
|
-
* @example
|
|
202
321
|
* ```javascript
|
|
203
322
|
* const editor = Jodit.make(".dark_editor", {
|
|
204
323
|
* toolbarButtonSize: "small"
|
|
@@ -211,12 +330,14 @@ class Config {
|
|
|
211
330
|
*/
|
|
212
331
|
this.allowTabNavigation = false;
|
|
213
332
|
/**
|
|
214
|
-
*
|
|
333
|
+
* When enabled, the editor renders without its own container chrome (toolbar, borders, statusbar).
|
|
334
|
+
* The editable area becomes the element itself. Typically combined with
|
|
335
|
+
* `toolbarInline: true` so a floating toolbar appears on selection.
|
|
215
336
|
*/
|
|
216
337
|
this.inline = false;
|
|
217
338
|
/**
|
|
218
339
|
* Theme (can be "dark")
|
|
219
|
-
*
|
|
340
|
+
*
|
|
220
341
|
* ```javascript
|
|
221
342
|
* const editor = Jodit.make(".dark_editor", {
|
|
222
343
|
* theme: "dark"
|
|
@@ -231,10 +352,9 @@ class Config {
|
|
|
231
352
|
/**
|
|
232
353
|
* Class name that can be appended to the editable area
|
|
233
354
|
*
|
|
234
|
-
* @see
|
|
235
|
-
* @see
|
|
355
|
+
* @see {@link Config.iframeCSSLinks}
|
|
356
|
+
* @see {@link Config.iframeStyle}
|
|
236
357
|
*
|
|
237
|
-
* @example
|
|
238
358
|
* ```javascript
|
|
239
359
|
* Jodit.make('#editor', {
|
|
240
360
|
* editorClassName: 'some_my_class'
|
|
@@ -251,7 +371,7 @@ class Config {
|
|
|
251
371
|
this.editorClassName = false;
|
|
252
372
|
/**
|
|
253
373
|
* Class name that can be appended to the main editor container
|
|
254
|
-
*
|
|
374
|
+
*
|
|
255
375
|
* ```javascript
|
|
256
376
|
* const jodit = Jodit.make('#editor', {
|
|
257
377
|
* className: 'some_my_class'
|
|
@@ -272,7 +392,7 @@ class Config {
|
|
|
272
392
|
/**
|
|
273
393
|
* The internal styles of the editable area. They are intended to change
|
|
274
394
|
* not the appearance of the editor, but to change the appearance of the content.
|
|
275
|
-
*
|
|
395
|
+
*
|
|
276
396
|
* ```javascript
|
|
277
397
|
* Jodit.make('#editor', {
|
|
278
398
|
* style: {
|
|
@@ -284,13 +404,14 @@ class Config {
|
|
|
284
404
|
*/
|
|
285
405
|
this.style = false;
|
|
286
406
|
/**
|
|
407
|
+
* Inline CSS styles applied to the outer editor container element.
|
|
408
|
+
* Use this to style the editor wrapper (borders, background, etc.) without affecting content.
|
|
287
409
|
*
|
|
288
|
-
* @example
|
|
289
410
|
* ```javascript
|
|
290
411
|
* Jodit.make('#editor', {
|
|
291
|
-
*
|
|
292
|
-
*
|
|
293
|
-
*
|
|
412
|
+
* containerStyle: {
|
|
413
|
+
* border: '1px solid #ccc',
|
|
414
|
+
* background: '#f9f9f9'
|
|
294
415
|
* }
|
|
295
416
|
* });
|
|
296
417
|
* ```
|
|
@@ -300,7 +421,6 @@ class Config {
|
|
|
300
421
|
* Dictionary of variable values in css, a complete list can be found here
|
|
301
422
|
* https://github.com/xdan/jodit/blob/main/src/styles/variables.less#L25
|
|
302
423
|
*
|
|
303
|
-
* @example
|
|
304
424
|
* ```js
|
|
305
425
|
* const editor = Jodit.make('#editor', {
|
|
306
426
|
* styleValues: {
|
|
@@ -313,9 +433,9 @@ class Config {
|
|
|
313
433
|
*/
|
|
314
434
|
this.styleValues = {};
|
|
315
435
|
/**
|
|
316
|
-
*
|
|
436
|
+
* When enabled, the editor dispatches a native `change` event on the original
|
|
437
|
+
* `<textarea>` element whenever the content changes, so standard DOM listeners work.
|
|
317
438
|
*
|
|
318
|
-
* @example
|
|
319
439
|
* ```javascript
|
|
320
440
|
* const editor = Jodit.make('#editor');
|
|
321
441
|
* document.getElementById('editor').addEventListener('change', function () {
|
|
@@ -330,7 +450,6 @@ class Config {
|
|
|
330
450
|
* the page element direction. 'ltr' – Indicates a Left-To-Right text direction (like in English).
|
|
331
451
|
* 'rtl' – Indicates a Right-To-Left text direction (like in Arabic).
|
|
332
452
|
*
|
|
333
|
-
* @example
|
|
334
453
|
* ```javascript
|
|
335
454
|
* Jodit.make('.editor', {
|
|
336
455
|
* direction: 'rtl'
|
|
@@ -343,7 +462,6 @@ class Config {
|
|
|
343
462
|
* (navigator.language && navigator.language.substr(0, 2)) ||
|
|
344
463
|
* (navigator.browserLanguage && navigator.browserLanguage.substr(0, 2)) || 'en'
|
|
345
464
|
*
|
|
346
|
-
* @example
|
|
347
465
|
* ```html
|
|
348
466
|
* <!-- include in you page lang file -->
|
|
349
467
|
* <script src="jodit/lang/de.js"></script>
|
|
@@ -358,7 +476,6 @@ class Config {
|
|
|
358
476
|
/**
|
|
359
477
|
* if true all Lang.i18n(key) return `{key}`
|
|
360
478
|
*
|
|
361
|
-
* @example
|
|
362
479
|
* ```html
|
|
363
480
|
* <script>
|
|
364
481
|
* var editor = Jodit.make('.editor', {
|
|
@@ -373,7 +490,6 @@ class Config {
|
|
|
373
490
|
/**
|
|
374
491
|
* Collection of language pack data `{en: {'Type something': 'Type something', ...}}`
|
|
375
492
|
*
|
|
376
|
-
* @example
|
|
377
493
|
* ```javascript
|
|
378
494
|
* const editor = Jodit.make('#editor', {
|
|
379
495
|
* language: 'ru',
|
|
@@ -411,12 +527,12 @@ class Config {
|
|
|
411
527
|
*/
|
|
412
528
|
this.showTooltipDelay = 200;
|
|
413
529
|
/**
|
|
414
|
-
* Instead of
|
|
530
|
+
* Instead of creating a custom tooltip, use the browser's native title tooltips
|
|
415
531
|
*/
|
|
416
532
|
this.useNativeTooltip = false;
|
|
417
533
|
/**
|
|
418
|
-
*
|
|
419
|
-
*
|
|
534
|
+
* How pasted content is inserted into the editor by default.
|
|
535
|
+
* Possible values: `insert_as_html`, `insert_as_text`, `insert_only_text`, `insert_clear_html`.
|
|
420
536
|
*/
|
|
421
537
|
this.defaultActionOnPaste = INSERT_AS_HTML;
|
|
422
538
|
// TODO
|
|
@@ -431,7 +547,6 @@ class Config {
|
|
|
431
547
|
/**
|
|
432
548
|
* When this option is enabled, the editor's content will be placed in an iframe and isolated from the rest of the page.
|
|
433
549
|
*
|
|
434
|
-
* @example
|
|
435
550
|
* ```javascript
|
|
436
551
|
* Jodit.make('#editor', {
|
|
437
552
|
* iframe: true,
|
|
@@ -444,7 +559,7 @@ class Config {
|
|
|
444
559
|
/**
|
|
445
560
|
* Allow editing the entire HTML document(html, head)
|
|
446
561
|
* \> Works together with the iframe option.
|
|
447
|
-
*
|
|
562
|
+
*
|
|
448
563
|
* ```js
|
|
449
564
|
* const editor = Jodit.make('#editor', {
|
|
450
565
|
* iframe: true,
|
|
@@ -465,7 +580,7 @@ class Config {
|
|
|
465
580
|
/**
|
|
466
581
|
* Jodit.MODE_WYSIWYG The HTML editor allows you to write like MSWord,
|
|
467
582
|
* Jodit.MODE_SOURCE syntax highlighting source editor
|
|
468
|
-
*
|
|
583
|
+
*
|
|
469
584
|
* ```javascript
|
|
470
585
|
* var editor = Jodit.make('#editor', {
|
|
471
586
|
* defaultMode: Jodit.MODE_SPLIT
|
|
@@ -475,12 +590,12 @@ class Config {
|
|
|
475
590
|
*/
|
|
476
591
|
this.defaultMode = consts.MODE_WYSIWYG;
|
|
477
592
|
/**
|
|
478
|
-
*
|
|
593
|
+
* When enabled, the editor displays both the WYSIWYG view and the source-code view side by side.
|
|
479
594
|
*/
|
|
480
595
|
this.useSplitMode = false;
|
|
481
596
|
/**
|
|
482
597
|
* The colors in HEX representation to select a color for the background and for the text in colorpicker
|
|
483
|
-
*
|
|
598
|
+
*
|
|
484
599
|
* ```javascript
|
|
485
600
|
* Jodit.make('#editor', {
|
|
486
601
|
* colors: ['#ff0000', '#00ff00', '#0000ff']
|
|
@@ -577,7 +692,7 @@ class Config {
|
|
|
577
692
|
};
|
|
578
693
|
/**
|
|
579
694
|
* The default tab color picker
|
|
580
|
-
*
|
|
695
|
+
*
|
|
581
696
|
* ```javascript
|
|
582
697
|
* Jodit.make('#editor2', {
|
|
583
698
|
* colorPickerDefaultTab: 'color'
|
|
@@ -586,12 +701,12 @@ class Config {
|
|
|
586
701
|
*/
|
|
587
702
|
this.colorPickerDefaultTab = 'background';
|
|
588
703
|
/**
|
|
589
|
-
*
|
|
704
|
+
* Default width (in pixels) applied to images inserted into the editor
|
|
590
705
|
*/
|
|
591
706
|
this.imageDefaultWidth = 300;
|
|
592
707
|
/**
|
|
593
708
|
* Do not display these buttons that are on the list
|
|
594
|
-
*
|
|
709
|
+
*
|
|
595
710
|
* ```javascript
|
|
596
711
|
* Jodit.make('#editor2', {
|
|
597
712
|
* removeButtons: ['hr', 'source']
|
|
@@ -601,7 +716,7 @@ class Config {
|
|
|
601
716
|
this.removeButtons = [];
|
|
602
717
|
/**
|
|
603
718
|
* Do not init these plugins
|
|
604
|
-
*
|
|
719
|
+
*
|
|
605
720
|
* ```typescript
|
|
606
721
|
* var editor = Jodit.make('.editor', {
|
|
607
722
|
* disablePlugins: 'table,iframe'
|
|
@@ -615,7 +730,7 @@ class Config {
|
|
|
615
730
|
this.disablePlugins = [];
|
|
616
731
|
/**
|
|
617
732
|
* Init and download extra plugins
|
|
618
|
-
*
|
|
733
|
+
*
|
|
619
734
|
* ```typescript
|
|
620
735
|
* var editor = Jodit.make('.editor', {
|
|
621
736
|
* extraPlugins: ['emoji']
|
|
@@ -625,7 +740,7 @@ class Config {
|
|
|
625
740
|
*/
|
|
626
741
|
this.extraPlugins = [];
|
|
627
742
|
/**
|
|
628
|
-
*
|
|
743
|
+
* Additional buttons appended to the {@link Config.buttons} list
|
|
629
744
|
*/
|
|
630
745
|
this.extraButtons = [];
|
|
631
746
|
/**
|
|
@@ -633,7 +748,6 @@ class Config {
|
|
|
633
748
|
* You can add your icon to the set using the `Jodit.modules.Icon.set (name, svg Code)` method.
|
|
634
749
|
* But for a declarative declaration, you can use this option.
|
|
635
750
|
*
|
|
636
|
-
* @example
|
|
637
751
|
* ```js
|
|
638
752
|
* Jodit.modules.Icon.set('someIcon', '<svg><path.../></svg>');
|
|
639
753
|
* const editor = Jodit.make({
|
|
@@ -642,8 +756,9 @@ class Config {
|
|
|
642
756
|
* icon: 'someIcon'
|
|
643
757
|
* }]
|
|
644
758
|
* });
|
|
759
|
+
* ```
|
|
645
760
|
*
|
|
646
|
-
*
|
|
761
|
+
* ```js
|
|
647
762
|
* const editor = Jodit.make({
|
|
648
763
|
* extraIcons: {
|
|
649
764
|
* someIcon: '<svg><path.../></svg>'
|
|
@@ -654,7 +769,7 @@ class Config {
|
|
|
654
769
|
* }]
|
|
655
770
|
* });
|
|
656
771
|
* ```
|
|
657
|
-
*
|
|
772
|
+
*
|
|
658
773
|
* ```js
|
|
659
774
|
* const editor = Jodit.make({
|
|
660
775
|
* extraButtons: [{
|
|
@@ -667,7 +782,7 @@ class Config {
|
|
|
667
782
|
this.extraIcons = {};
|
|
668
783
|
/**
|
|
669
784
|
* Default attributes for created inside editor elements
|
|
670
|
-
*
|
|
785
|
+
*
|
|
671
786
|
* ```js
|
|
672
787
|
* const editor2 = Jodit.make('#editor', {
|
|
673
788
|
* createAttributes: {
|
|
@@ -687,7 +802,7 @@ class Config {
|
|
|
687
802
|
* expect(ul.className).equals('ui-test');
|
|
688
803
|
* ```
|
|
689
804
|
* Or JSX in React
|
|
690
|
-
*
|
|
805
|
+
*
|
|
691
806
|
* ```jsx
|
|
692
807
|
* import React, {useState, useRef} from 'react';
|
|
693
808
|
* import JoditEditor from "jodit-react";
|
|
@@ -723,7 +838,7 @@ class Config {
|
|
|
723
838
|
/**
|
|
724
839
|
* The list of buttons that appear in the editor's toolbar on large places (≥ options.sizeLG).
|
|
725
840
|
* Note - this is not the width of the device, the width of the editor
|
|
726
|
-
*
|
|
841
|
+
*
|
|
727
842
|
* ```javascript
|
|
728
843
|
* Jodit.make('#editor', {
|
|
729
844
|
* buttons: ['bold', 'italic', 'source'],
|
|
@@ -731,7 +846,7 @@ class Config {
|
|
|
731
846
|
* buttonsXS: ['bold', 'fullsize'],
|
|
732
847
|
* });
|
|
733
848
|
* ```
|
|
734
|
-
*
|
|
849
|
+
*
|
|
735
850
|
* ```javascript
|
|
736
851
|
* Jodit.make('#editor2', {
|
|
737
852
|
* buttons: [{
|
|
@@ -755,7 +870,7 @@ class Config {
|
|
|
755
870
|
* }]
|
|
756
871
|
* });
|
|
757
872
|
* ```
|
|
758
|
-
*
|
|
873
|
+
*
|
|
759
874
|
* ```javascript
|
|
760
875
|
* Jodit.make('#editor2', {
|
|
761
876
|
* buttons: Jodit.defaultOptions.buttons.concat([{
|
|
@@ -878,7 +993,7 @@ class Config {
|
|
|
878
993
|
*/
|
|
879
994
|
this.events = {};
|
|
880
995
|
/**
|
|
881
|
-
* Buttons in
|
|
996
|
+
* Buttons in toolbar without SVG - only texts
|
|
882
997
|
*/
|
|
883
998
|
this.textIcons = false;
|
|
884
999
|
/**
|
package/esm/core/constants.js
CHANGED
|
@@ -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.9.
|
|
6
|
+
export const APP_VERSION = "4.9.11";
|
|
7
7
|
// prettier-ignore
|
|
8
8
|
export const ES = "es2020";
|
|
9
9
|
export const IS_ES_MODERN = true;
|
|
@@ -3,11 +3,6 @@
|
|
|
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
|
-
/**
|
|
7
|
-
* [[include:core/decorators/autobind/README.md]]
|
|
8
|
-
* @packageDocumentation
|
|
9
|
-
* @module decorators/autobind
|
|
10
|
-
*/
|
|
11
6
|
/**
|
|
12
7
|
* Decorator that automatically binds a method to its class instance.
|
|
13
8
|
* This is useful when passing methods as callbacks to preserve the correct `this` context.
|
|
@@ -3,12 +3,12 @@
|
|
|
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
|
-
import { isFunction } from "../../helpers/checker/is-function.js";
|
|
7
6
|
/**
|
|
8
7
|
* [[include:core/decorators/autobind/README.md]]
|
|
9
8
|
* @packageDocumentation
|
|
10
9
|
* @module decorators/autobind
|
|
11
10
|
*/
|
|
11
|
+
import { isFunction } from "../../helpers/checker/is-function.js";
|
|
12
12
|
/**
|
|
13
13
|
* Decorator that automatically binds a method to its class instance.
|
|
14
14
|
* This is useful when passing methods as callbacks to preserve the correct `this` context.
|
|
@@ -3,12 +3,12 @@
|
|
|
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
|
-
import type { IComponent } from "../../../types/index";
|
|
7
6
|
/**
|
|
8
7
|
* [[include:core/decorators/component/README.md]]
|
|
9
8
|
* @packageDocumentation
|
|
10
9
|
* @module decorators/component
|
|
11
10
|
*/
|
|
11
|
+
import type { IComponent } from "../../../types/index";
|
|
12
12
|
export interface ComponentCompatible<T = IComponent> {
|
|
13
13
|
new (...constructorArgs: any[]): T;
|
|
14
14
|
}
|
|
@@ -1,2 +1,10 @@
|
|
|
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-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @module event-emitter
|
|
8
|
+
*/
|
|
1
9
|
import { EventEmitter } from "./event-emitter";
|
|
2
10
|
export declare const eventEmitter: EventEmitter;
|
|
@@ -1,2 +1,10 @@
|
|
|
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-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @module event-emitter
|
|
8
|
+
*/
|
|
1
9
|
import { EventEmitter } from "./event-emitter.js";
|
|
2
10
|
export const eventEmitter = new EventEmitter();
|
|
@@ -1,3 +1,11 @@
|
|
|
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-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @module storage
|
|
8
|
+
*/
|
|
1
9
|
import type { IAsyncStorage, IStorage, StorageValueType } from "../../types/index";
|
|
2
10
|
import { type WebStorageStrategy } from "./engines/local-storage-provider";
|
|
3
11
|
export declare class AsyncStorage<T = StorageValueType> implements IAsyncStorage<T> {
|
|
@@ -1,3 +1,8 @@
|
|
|
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-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
|
+
*/
|
|
1
6
|
import { camelCase } from "../helpers/string/camel-case.js";
|
|
2
7
|
import { canUseIndexedDB, IndexedDBProvider } from "./engines/indexed-db-provider.js";
|
|
3
8
|
import { canUsePersistentStorage, LocalStorageProvider } from "./engines/local-storage-provider.js";
|
package/esm/core/ui/element.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export interface UIElement extends Mods, Elms {
|
|
|
16
16
|
export declare abstract class UIElement<T extends IViewBased = IViewBased> extends ViewComponent<T> implements IUIElement, Mods, Elms {
|
|
17
17
|
container: HTMLElement;
|
|
18
18
|
name: string;
|
|
19
|
+
getRole(): string;
|
|
19
20
|
private __parentElement;
|
|
20
21
|
get parentElement(): Nullable<IUIElement>;
|
|
21
22
|
set parentElement(parentElement: Nullable<IUIElement>);
|
package/esm/core/ui/element.js
CHANGED
|
@@ -18,10 +18,14 @@ import { Component, ViewComponent } from "../component/index.js";
|
|
|
18
18
|
import { derive } from "../decorators/derive/derive.js";
|
|
19
19
|
import { Dom } from "../dom/dom.js";
|
|
20
20
|
import { isString } from "../helpers/checker/is-string.js";
|
|
21
|
+
import { attr } from "../helpers/utils/attr.js";
|
|
21
22
|
import { Elms } from "../traits/elms.js";
|
|
22
23
|
import { Mods } from "../traits/mods.js";
|
|
23
24
|
import { Icon } from "./icon.js";
|
|
24
25
|
let UIElement = UIElement_1 = class UIElement extends ViewComponent {
|
|
26
|
+
getRole() {
|
|
27
|
+
return '';
|
|
28
|
+
}
|
|
25
29
|
get parentElement() {
|
|
26
30
|
return this.__parentElement;
|
|
27
31
|
}
|
|
@@ -133,6 +137,8 @@ let UIElement = UIElement_1 = class UIElement extends ViewComponent {
|
|
|
133
137
|
this.__parentElement = null;
|
|
134
138
|
this.mods = {};
|
|
135
139
|
this.container = this.createContainer(options);
|
|
140
|
+
const role = this.getRole();
|
|
141
|
+
role && attr(this.container, 'role', role);
|
|
136
142
|
Object.defineProperty(this.container, 'component', {
|
|
137
143
|
value: this,
|
|
138
144
|
configurable: true
|
|
@@ -13,6 +13,7 @@ import { UIElement } from "../element";
|
|
|
13
13
|
export declare class UIGroup<T extends IViewBased = IViewBased> extends UIElement<T> implements IUIGroup {
|
|
14
14
|
readonly options?: IDictionary | undefined;
|
|
15
15
|
className(): string;
|
|
16
|
+
getRole(): string;
|
|
16
17
|
/**
|
|
17
18
|
* Synchronize mods to all children
|
|
18
19
|
*/
|
|
@@ -1,3 +1,11 @@
|
|
|
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-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @module modules/file-browser
|
|
8
|
+
*/
|
|
1
9
|
import type { HTMLTagNames, IDictionary, IFileBrowserItem, Nullable } from "../../../types/index";
|
|
2
10
|
/**
|
|
3
11
|
* @private
|