jodit 4.12.36 → 4.12.38
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 +17 -0
- package/es2015/jodit.css +1 -1
- package/es2015/jodit.fat.min.js +4 -4
- package/es2015/jodit.js +57 -2
- package/es2015/jodit.min.js +6 -6
- 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 +4 -4
- package/es2018/jodit.min.js +6 -6
- 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 +6 -6
- package/es2021/jodit.js +57 -2
- package/es2021/jodit.min.js +8 -8
- 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 +6 -6
- package/es2021.en/jodit.js +57 -2
- package/es2021.en/jodit.min.js +7 -7
- 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 +57 -2
- 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 +36 -6
- package/esm/config.js +14 -0
- package/esm/core/constants.js +1 -1
- package/esm/core/global.js +4 -0
- package/esm/core/helpers/utils/append-script.js +6 -0
- package/esm/plugins/link/config.d.ts +8 -0
- package/esm/plugins/link/config.js +1 -0
- package/esm/plugins/link/link.js +30 -0
- package/esm/plugins/source/config.d.ts +14 -6
- package/esm/plugins/source/editor/engines/ace.js +5 -0
- package/esm/types/view.d.ts +6 -0
- package/package.json +1 -1
- package/types/config.d.ts +36 -6
- package/types/plugins/link/config.d.ts +8 -0
- package/types/plugins/source/config.d.ts +14 -6
- package/types/types/view.d.ts +6 -0
package/es5/polyfills.fat.min.js
CHANGED
package/es5/polyfills.js
CHANGED
package/es5/polyfills.min.js
CHANGED
package/esm/config.d.ts
CHANGED
|
@@ -267,6 +267,20 @@ declare class Config implements IViewOptions {
|
|
|
267
267
|
* ```
|
|
268
268
|
*/
|
|
269
269
|
shadowRoot: Nullable<ShadowRoot>;
|
|
270
|
+
/**
|
|
271
|
+
* CSP nonce applied to every `<style>`, `<script>` and `<link>` element
|
|
272
|
+
* Jodit injects at runtime (plugin styles, CDN scripts for ACE/beautify,
|
|
273
|
+
* downloaded stylesheets). Set it to the same nonce your server puts in the
|
|
274
|
+
* `Content-Security-Policy` header so a strict `style-src`/`script-src`
|
|
275
|
+
* policy does not block the editor.
|
|
276
|
+
*
|
|
277
|
+
* ```js
|
|
278
|
+
* Jodit.make('#editor', {
|
|
279
|
+
* nonce: 'r4nd0m'
|
|
280
|
+
* });
|
|
281
|
+
* ```
|
|
282
|
+
*/
|
|
283
|
+
nonce: string;
|
|
270
284
|
/**
|
|
271
285
|
* Base CSS `z-index` for the editor UI (toolbar, popups, dialogs).
|
|
272
286
|
* Set to a higher value when other page elements overlap the editor.
|
|
@@ -1383,6 +1397,14 @@ interface Config {
|
|
|
1383
1397
|
* Wrap inserted link
|
|
1384
1398
|
*/
|
|
1385
1399
|
processPastedLink: boolean;
|
|
1400
|
+
/**
|
|
1401
|
+
* When opening the link dialog for a new link with an empty URL field,
|
|
1402
|
+
* pre-fill it from the selected text if that text looks like a URL or
|
|
1403
|
+
* an email address (`example.com` → `https://example.com`,
|
|
1404
|
+
* `user@site.com` → `mailto:user@site.com`). Plain text that is not a
|
|
1405
|
+
* URL/email is left untouched. Default: false.
|
|
1406
|
+
*/
|
|
1407
|
+
deriveUrlFromText: boolean;
|
|
1386
1408
|
/**
|
|
1387
1409
|
* Show `no follow` checkbox in link dialog.
|
|
1388
1410
|
*/
|
|
@@ -1678,15 +1700,22 @@ interface Config {
|
|
|
1678
1700
|
*/
|
|
1679
1701
|
sourceEditor: 'area' | 'ace' | ((jodit: IJodit) => ISourceEditor);
|
|
1680
1702
|
/**
|
|
1681
|
-
* Options for [ace](https://ace.c9.io/#config) editor
|
|
1703
|
+
* Options for [ace](https://ace.c9.io/#config) editor.
|
|
1704
|
+
*
|
|
1705
|
+
* Besides the named keys below, any other native ACE option is
|
|
1706
|
+
* forwarded to `editor.setOptions()` as is, so e.g. `fontSize`,
|
|
1707
|
+
* `tabSize` or `useSoftTabs` work too.
|
|
1682
1708
|
*
|
|
1683
1709
|
* ```js
|
|
1684
1710
|
* Jodit.make('#editor', {
|
|
1685
|
-
*
|
|
1686
|
-
*
|
|
1687
|
-
*
|
|
1688
|
-
*
|
|
1689
|
-
*
|
|
1711
|
+
* sourceEditorNativeOptions: {
|
|
1712
|
+
* showGutter: true,
|
|
1713
|
+
* theme: 'ace/theme/idle_fingers',
|
|
1714
|
+
* mode: 'ace/mode/html',
|
|
1715
|
+
* wrap: true,
|
|
1716
|
+
* highlightActiveLine: true,
|
|
1717
|
+
* fontSize: '16px'
|
|
1718
|
+
* }
|
|
1690
1719
|
* })
|
|
1691
1720
|
* ```
|
|
1692
1721
|
*/
|
|
@@ -1696,6 +1725,7 @@ interface Config {
|
|
|
1696
1725
|
mode: string;
|
|
1697
1726
|
wrap: string | boolean | number;
|
|
1698
1727
|
highlightActiveLine: boolean;
|
|
1728
|
+
[option: string]: string | boolean | number | undefined;
|
|
1699
1729
|
};
|
|
1700
1730
|
/**
|
|
1701
1731
|
* Beautify HTML then it possible
|
package/esm/config.js
CHANGED
|
@@ -278,6 +278,20 @@ class Config {
|
|
|
278
278
|
* ```
|
|
279
279
|
*/
|
|
280
280
|
this.shadowRoot = null;
|
|
281
|
+
/**
|
|
282
|
+
* CSP nonce applied to every `<style>`, `<script>` and `<link>` element
|
|
283
|
+
* Jodit injects at runtime (plugin styles, CDN scripts for ACE/beautify,
|
|
284
|
+
* downloaded stylesheets). Set it to the same nonce your server puts in the
|
|
285
|
+
* `Content-Security-Policy` header so a strict `style-src`/`script-src`
|
|
286
|
+
* policy does not block the editor.
|
|
287
|
+
*
|
|
288
|
+
* ```js
|
|
289
|
+
* Jodit.make('#editor', {
|
|
290
|
+
* nonce: 'r4nd0m'
|
|
291
|
+
* });
|
|
292
|
+
* ```
|
|
293
|
+
*/
|
|
294
|
+
this.nonce = '';
|
|
281
295
|
/**
|
|
282
296
|
* Base CSS `z-index` for the editor UI (toolbar, popups, dialogs).
|
|
283
297
|
* Set to a higher value when other page elements overlap the editor.
|
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.12.
|
|
6
|
+
export const APP_VERSION = "4.12.38";
|
|
7
7
|
// prettier-ignore
|
|
8
8
|
export const ES = "es2020";
|
|
9
9
|
export const IS_ES_MODERN = true;
|
package/esm/core/global.js
CHANGED
|
@@ -74,6 +74,10 @@ export function getContainer(jodit, classFunc, tag = 'div', createInsideEditor =
|
|
|
74
74
|
const box = c.element(tag, {
|
|
75
75
|
className: `jodit jodit-${kebabCase(name)}-container jodit-box`
|
|
76
76
|
});
|
|
77
|
+
// Let a strict CSP accept the injected <style>/<script> box
|
|
78
|
+
if (view.o.nonce && (tag === 'style' || tag === 'script')) {
|
|
79
|
+
box.setAttribute('nonce', view.o.nonce);
|
|
80
|
+
}
|
|
77
81
|
box.classList.add(`jodit_theme_${view.o.theme || 'default'}`);
|
|
78
82
|
body.appendChild(box);
|
|
79
83
|
data[key] = box;
|
|
@@ -31,6 +31,9 @@ export const appendScriptAsync = cacheLoaders((jodit, url) => {
|
|
|
31
31
|
async: true,
|
|
32
32
|
src: completeUrl(url)
|
|
33
33
|
});
|
|
34
|
+
if (jodit.o.nonce) {
|
|
35
|
+
script.setAttribute('nonce', jodit.o.nonce);
|
|
36
|
+
}
|
|
34
37
|
jodit.e.one(script, 'error', reject).one(script, 'load', resolve);
|
|
35
38
|
jodit.od.body.appendChild(script);
|
|
36
39
|
});
|
|
@@ -47,6 +50,9 @@ export const appendStyleAsync = cacheLoaders((jodit, url) => {
|
|
|
47
50
|
link.rel = 'stylesheet';
|
|
48
51
|
link.media = 'all';
|
|
49
52
|
link.crossOrigin = 'anonymous';
|
|
53
|
+
if (jodit.o.nonce) {
|
|
54
|
+
link.setAttribute('nonce', jodit.o.nonce);
|
|
55
|
+
}
|
|
50
56
|
const callback = () => resolve(link);
|
|
51
57
|
!jodit.isInDestruct &&
|
|
52
58
|
jodit.e.on(link, 'load', callback).on(link, 'error', reject);
|
|
@@ -27,6 +27,14 @@ declare module 'jodit/config' {
|
|
|
27
27
|
* Wrap inserted link
|
|
28
28
|
*/
|
|
29
29
|
processPastedLink: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* When opening the link dialog for a new link with an empty URL field,
|
|
32
|
+
* pre-fill it from the selected text if that text looks like a URL or
|
|
33
|
+
* an email address (`example.com` → `https://example.com`,
|
|
34
|
+
* `user@site.com` → `mailto:user@site.com`). Plain text that is not a
|
|
35
|
+
* URL/email is left untouched. Default: false.
|
|
36
|
+
*/
|
|
37
|
+
deriveUrlFromText: boolean;
|
|
30
38
|
/**
|
|
31
39
|
* Show `no follow` checkbox in link dialog.
|
|
32
40
|
*/
|
package/esm/plugins/link/link.js
CHANGED
|
@@ -167,6 +167,12 @@ export class link extends Plugin {
|
|
|
167
167
|
}
|
|
168
168
|
else {
|
|
169
169
|
Dom.hide(unlink);
|
|
170
|
+
if (jodit.o.link.deriveUrlFromText &&
|
|
171
|
+
url_input &&
|
|
172
|
+
!isImageContent &&
|
|
173
|
+
!url_input.value.trim()) {
|
|
174
|
+
url_input.value = guessUrlFromText(content_input.value);
|
|
175
|
+
}
|
|
170
176
|
if (openInNewTabCheckbox && target_checkbox) {
|
|
171
177
|
target_checkbox.checked = openInNewTabCheckboxDefaultChecked;
|
|
172
178
|
}
|
|
@@ -293,6 +299,30 @@ __decorate([
|
|
|
293
299
|
autobind
|
|
294
300
|
], link.prototype, "__onClickReadOnlyLink", null);
|
|
295
301
|
pluginSystem.add('link', link);
|
|
302
|
+
/**
|
|
303
|
+
* Guess a usable `href` from the selected text for the link dialog.
|
|
304
|
+
* Returns an empty string when the text is not a plausible URL/email,
|
|
305
|
+
* so plain text (e.g. "click here") is left untouched.
|
|
306
|
+
*/
|
|
307
|
+
function guessUrlFromText(text) {
|
|
308
|
+
const value = text.trim();
|
|
309
|
+
if (!value || /\s/.test(value)) {
|
|
310
|
+
return '';
|
|
311
|
+
}
|
|
312
|
+
// already an explicit scheme, an anchor or a relative path
|
|
313
|
+
if (/^(https?:|mailto:|tel:|ftp:|#|\/|\.{1,2}\/)/i.test(value)) {
|
|
314
|
+
return value;
|
|
315
|
+
}
|
|
316
|
+
// email address -> mailto:
|
|
317
|
+
if (/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value)) {
|
|
318
|
+
return `mailto:${value}`;
|
|
319
|
+
}
|
|
320
|
+
// bare domain like example.com or www.example.com/path -> https://
|
|
321
|
+
if (/^[a-z0-9-]+(\.[a-z0-9-]+)+(\/\S*)?$/i.test(value)) {
|
|
322
|
+
return `https://${value}`;
|
|
323
|
+
}
|
|
324
|
+
return '';
|
|
325
|
+
}
|
|
296
326
|
function writeClasses(modeClassName, className_input, className_select, a) {
|
|
297
327
|
var _a;
|
|
298
328
|
if (modeClassName && (className_input !== null && className_input !== void 0 ? className_input : className_select)) {
|
|
@@ -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
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
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/esm/types/view.d.ts
CHANGED
|
@@ -63,6 +63,12 @@ interface IViewOptions extends ILanguageOptions, IToolbarOptions {
|
|
|
63
63
|
createAttributes?: IDictionary<Attributes | NodeFunction>;
|
|
64
64
|
events?: IDictionary<(...args: any[]) => any>;
|
|
65
65
|
shadowRoot?: Nullable<ShadowRoot>;
|
|
66
|
+
/**
|
|
67
|
+
* CSP nonce applied to every `<style>`/`<script>`/`<link>` element Jodit
|
|
68
|
+
* injects at runtime, so a strict `style-src`/`script-src` policy does not
|
|
69
|
+
* block them.
|
|
70
|
+
*/
|
|
71
|
+
nonce?: string;
|
|
66
72
|
popupRoot?: Nullable<HTMLElement>;
|
|
67
73
|
ownerWindow?: Window;
|
|
68
74
|
language?: string;
|
package/package.json
CHANGED
package/types/config.d.ts
CHANGED
|
@@ -267,6 +267,20 @@ declare class Config implements IViewOptions {
|
|
|
267
267
|
* ```
|
|
268
268
|
*/
|
|
269
269
|
shadowRoot: Nullable<ShadowRoot>;
|
|
270
|
+
/**
|
|
271
|
+
* CSP nonce applied to every `<style>`, `<script>` and `<link>` element
|
|
272
|
+
* Jodit injects at runtime (plugin styles, CDN scripts for ACE/beautify,
|
|
273
|
+
* downloaded stylesheets). Set it to the same nonce your server puts in the
|
|
274
|
+
* `Content-Security-Policy` header so a strict `style-src`/`script-src`
|
|
275
|
+
* policy does not block the editor.
|
|
276
|
+
*
|
|
277
|
+
* ```js
|
|
278
|
+
* Jodit.make('#editor', {
|
|
279
|
+
* nonce: 'r4nd0m'
|
|
280
|
+
* });
|
|
281
|
+
* ```
|
|
282
|
+
*/
|
|
283
|
+
nonce: string;
|
|
270
284
|
/**
|
|
271
285
|
* Base CSS `z-index` for the editor UI (toolbar, popups, dialogs).
|
|
272
286
|
* Set to a higher value when other page elements overlap the editor.
|
|
@@ -1383,6 +1397,14 @@ interface Config {
|
|
|
1383
1397
|
* Wrap inserted link
|
|
1384
1398
|
*/
|
|
1385
1399
|
processPastedLink: boolean;
|
|
1400
|
+
/**
|
|
1401
|
+
* When opening the link dialog for a new link with an empty URL field,
|
|
1402
|
+
* pre-fill it from the selected text if that text looks like a URL or
|
|
1403
|
+
* an email address (`example.com` → `https://example.com`,
|
|
1404
|
+
* `user@site.com` → `mailto:user@site.com`). Plain text that is not a
|
|
1405
|
+
* URL/email is left untouched. Default: false.
|
|
1406
|
+
*/
|
|
1407
|
+
deriveUrlFromText: boolean;
|
|
1386
1408
|
/**
|
|
1387
1409
|
* Show `no follow` checkbox in link dialog.
|
|
1388
1410
|
*/
|
|
@@ -1678,15 +1700,22 @@ interface Config {
|
|
|
1678
1700
|
*/
|
|
1679
1701
|
sourceEditor: 'area' | 'ace' | ((jodit: IJodit) => ISourceEditor);
|
|
1680
1702
|
/**
|
|
1681
|
-
* Options for [ace](https://ace.c9.io/#config) editor
|
|
1703
|
+
* Options for [ace](https://ace.c9.io/#config) editor.
|
|
1704
|
+
*
|
|
1705
|
+
* Besides the named keys below, any other native ACE option is
|
|
1706
|
+
* forwarded to `editor.setOptions()` as is, so e.g. `fontSize`,
|
|
1707
|
+
* `tabSize` or `useSoftTabs` work too.
|
|
1682
1708
|
*
|
|
1683
1709
|
* ```js
|
|
1684
1710
|
* Jodit.make('#editor', {
|
|
1685
|
-
*
|
|
1686
|
-
*
|
|
1687
|
-
*
|
|
1688
|
-
*
|
|
1689
|
-
*
|
|
1711
|
+
* sourceEditorNativeOptions: {
|
|
1712
|
+
* showGutter: true,
|
|
1713
|
+
* theme: 'ace/theme/idle_fingers',
|
|
1714
|
+
* mode: 'ace/mode/html',
|
|
1715
|
+
* wrap: true,
|
|
1716
|
+
* highlightActiveLine: true,
|
|
1717
|
+
* fontSize: '16px'
|
|
1718
|
+
* }
|
|
1690
1719
|
* })
|
|
1691
1720
|
* ```
|
|
1692
1721
|
*/
|
|
@@ -1696,6 +1725,7 @@ interface Config {
|
|
|
1696
1725
|
mode: string;
|
|
1697
1726
|
wrap: string | boolean | number;
|
|
1698
1727
|
highlightActiveLine: boolean;
|
|
1728
|
+
[option: string]: string | boolean | number | undefined;
|
|
1699
1729
|
};
|
|
1700
1730
|
/**
|
|
1701
1731
|
* Beautify HTML then it possible
|
|
@@ -27,6 +27,14 @@ declare module 'jodit/config' {
|
|
|
27
27
|
* Wrap inserted link
|
|
28
28
|
*/
|
|
29
29
|
processPastedLink: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* When opening the link dialog for a new link with an empty URL field,
|
|
32
|
+
* pre-fill it from the selected text if that text looks like a URL or
|
|
33
|
+
* an email address (`example.com` → `https://example.com`,
|
|
34
|
+
* `user@site.com` → `mailto:user@site.com`). Plain text that is not a
|
|
35
|
+
* URL/email is left untouched. Default: false.
|
|
36
|
+
*/
|
|
37
|
+
deriveUrlFromText: boolean;
|
|
30
38
|
/**
|
|
31
39
|
* Show `no follow` checkbox in link dialog.
|
|
32
40
|
*/
|
|
@@ -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
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
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
|
package/types/types/view.d.ts
CHANGED
|
@@ -63,6 +63,12 @@ interface IViewOptions extends ILanguageOptions, IToolbarOptions {
|
|
|
63
63
|
createAttributes?: IDictionary<Attributes | NodeFunction>;
|
|
64
64
|
events?: IDictionary<(...args: any[]) => any>;
|
|
65
65
|
shadowRoot?: Nullable<ShadowRoot>;
|
|
66
|
+
/**
|
|
67
|
+
* CSP nonce applied to every `<style>`/`<script>`/`<link>` element Jodit
|
|
68
|
+
* injects at runtime, so a strict `style-src`/`script-src` policy does not
|
|
69
|
+
* block them.
|
|
70
|
+
*/
|
|
71
|
+
nonce?: string;
|
|
66
72
|
popupRoot?: Nullable<HTMLElement>;
|
|
67
73
|
ownerWindow?: Window;
|
|
68
74
|
language?: string;
|