jodit 4.2.39 → 4.2.41
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 +51 -9
- package/es2015/jodit.css +7 -1
- package/es2015/jodit.fat.min.css +1 -1
- package/es2015/jodit.fat.min.js +2 -2
- package/es2015/jodit.js +85 -54
- package/es2015/jodit.min.css +1 -1
- package/es2015/jodit.min.js +2 -2
- package/es2015/plugins/debug/debug.css +53 -0
- package/es2015/plugins/debug/debug.js +162 -24
- package/es2015/plugins/debug/debug.min.css +1 -0
- package/es2015/plugins/debug/debug.min.js +2 -2
- 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.css +7 -1
- package/es2018/jodit.fat.min.css +1 -1
- package/es2018/jodit.fat.min.js +2 -2
- package/es2018/jodit.js +85 -54
- package/es2018/jodit.min.css +1 -1
- package/es2018/jodit.min.js +2 -2
- package/es2018/plugins/debug/debug.css +53 -0
- package/es2018/plugins/debug/debug.js +162 -24
- package/es2018/plugins/debug/debug.min.css +1 -0
- package/es2018/plugins/debug/debug.min.js +2 -2
- package/es2018/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021/jodit.css +7 -1
- package/es2021/jodit.fat.min.css +1 -1
- package/es2021/jodit.fat.min.js +2 -2
- package/es2021/jodit.js +85 -53
- package/es2021/jodit.min.css +1 -1
- package/es2021/jodit.min.js +2 -2
- package/es2021/plugins/debug/debug.css +53 -0
- package/es2021/plugins/debug/debug.js +161 -24
- package/es2021/plugins/debug/debug.min.css +1 -0
- package/es2021/plugins/debug/debug.min.js +2 -2
- 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 +7 -1
- package/es2021.en/jodit.fat.min.css +1 -1
- package/es2021.en/jodit.fat.min.js +2 -2
- package/es2021.en/jodit.js +85 -53
- package/es2021.en/jodit.min.css +1 -1
- package/es2021.en/jodit.min.js +2 -2
- package/es2021.en/plugins/debug/debug.css +53 -0
- package/es2021.en/plugins/debug/debug.js +161 -24
- package/es2021.en/plugins/debug/debug.min.css +1 -0
- package/es2021.en/plugins/debug/debug.min.js +2 -2
- 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/164.fat.min.js +1 -1
- package/es5/164.min.js +1 -1
- package/es5/5.fat.min.js +1 -1
- package/es5/5.min.js +1 -1
- package/es5/jodit.css +11 -2
- package/es5/jodit.fat.min.css +1 -1
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +92 -65
- package/es5/jodit.min.css +3 -3
- package/es5/jodit.min.js +2 -2
- package/es5/plugins/debug/debug.css +53 -0
- package/es5/plugins/debug/debug.js +161 -24
- package/es5/plugins/debug/debug.min.css +1 -0
- package/es5/plugins/debug/debug.min.js +2 -2
- 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/esm/core/constants.js +1 -1
- package/esm/core/helpers/utils/convert-media-url-to-video-embed.d.ts +4 -1
- package/esm/core/helpers/utils/convert-media-url-to-video-embed.js +7 -3
- package/esm/core/ui/button/tooltip/tooltip.d.ts +1 -0
- package/esm/core/ui/button/tooltip/tooltip.js +19 -8
- package/esm/core/view/view-with-toolbar.d.ts +1 -0
- package/esm/core/view/view-with-toolbar.js +3 -0
- package/esm/modules/toolbar/collection/collection.d.ts +0 -1
- package/esm/modules/toolbar/collection/collection.js +1 -4
- package/esm/plugins/clean-html/config.d.ts +9 -0
- package/esm/plugins/debug/debug.d.ts +1 -0
- package/esm/plugins/enter/helpers/check-br.js +2 -0
- package/esm/plugins/index.js +1 -0
- package/esm/plugins/inline-popup/inline-popup.d.ts +0 -1
- package/esm/plugins/inline-popup/inline-popup.js +7 -7
- package/esm/plugins/link/link.js +6 -2
- package/esm/plugins/video/config.d.ts +29 -0
- package/esm/plugins/video/config.js +26 -17
- package/esm/plugins/wrap-nodes/config.d.ts +5 -1
- package/package.json +1 -1
- package/types/core/helpers/utils/convert-media-url-to-video-embed.d.ts +4 -1
- package/types/core/ui/button/tooltip/tooltip.d.ts +1 -0
- package/types/core/view/view-with-toolbar.d.ts +1 -0
- package/types/modules/toolbar/collection/collection.d.ts +0 -1
- package/types/plugins/clean-html/config.d.ts +9 -0
- package/types/plugins/debug/debug.d.ts +1 -0
- package/types/plugins/inline-popup/inline-popup.d.ts +0 -1
- package/types/plugins/video/config.d.ts +29 -0
- package/types/plugins/wrap-nodes/config.d.ts +5 -1
|
@@ -3,4 +3,33 @@
|
|
|
3
3
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
4
|
* Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
|
+
declare module 'jodit/config' {
|
|
7
|
+
interface Config {
|
|
8
|
+
video: {
|
|
9
|
+
/**
|
|
10
|
+
* Custom function for parsing video URL to embed code
|
|
11
|
+
* ```javascript
|
|
12
|
+
* Jodit.make('#editor', {
|
|
13
|
+
* video: {
|
|
14
|
+
* // Defaul behavior
|
|
15
|
+
* parseUrlToVideoEmbed: (url, size) => Jodit.modules.Helpers.convertMediaUrlToVideoEmbed(url, size)
|
|
16
|
+
* }
|
|
17
|
+
* });
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
parseUrlToVideoEmbed?: (url: string, { width, height }?: {
|
|
21
|
+
width?: number;
|
|
22
|
+
height?: number;
|
|
23
|
+
}) => string;
|
|
24
|
+
/**
|
|
25
|
+
* Default width for video iframe. Default: 400
|
|
26
|
+
*/
|
|
27
|
+
defaultWidth?: number;
|
|
28
|
+
/**
|
|
29
|
+
* Default height for video iframe. Default: 345
|
|
30
|
+
*/
|
|
31
|
+
defaultHeight?: number;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
}
|
|
6
35
|
export {};
|
|
@@ -3,19 +3,24 @@
|
|
|
3
3
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
4
|
* Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
|
-
import { convertMediaUrlToVideoEmbed } from "../../core/helpers/index.js";
|
|
6
|
+
import { call, convertMediaUrlToVideoEmbed } from "../../core/helpers/index.js";
|
|
7
7
|
import { Button } from "../../core/ui/button/index.js";
|
|
8
8
|
import { UIBlock, UIForm, UIInput, UITextArea } from "../../core/ui/form/index.js";
|
|
9
9
|
import { Icon } from "../../core/ui/icon.js";
|
|
10
10
|
import { Config } from "../../config.js";
|
|
11
11
|
import { TabsWidget } from "../../modules/widget/index.js";
|
|
12
12
|
import videoIcon from "./video.svg.js";
|
|
13
|
+
Config.prototype.video = {
|
|
14
|
+
parseUrlToVideoEmbed: convertMediaUrlToVideoEmbed,
|
|
15
|
+
defaultWidth: 400,
|
|
16
|
+
defaultHeight: 345
|
|
17
|
+
};
|
|
13
18
|
Icon.set('video', videoIcon);
|
|
14
19
|
Config.prototype.controls.video = {
|
|
15
|
-
popup: (
|
|
16
|
-
const formLink = new UIForm(
|
|
17
|
-
new UIBlock(
|
|
18
|
-
new UIInput(
|
|
20
|
+
popup: (jodit, current, close) => {
|
|
21
|
+
const formLink = new UIForm(jodit, [
|
|
22
|
+
new UIBlock(jodit, [
|
|
23
|
+
new UIInput(jodit, {
|
|
19
24
|
name: 'url',
|
|
20
25
|
required: true,
|
|
21
26
|
label: 'URL',
|
|
@@ -23,26 +28,26 @@ Config.prototype.controls.video = {
|
|
|
23
28
|
validators: ['url']
|
|
24
29
|
})
|
|
25
30
|
]),
|
|
26
|
-
new UIBlock(
|
|
27
|
-
Button(
|
|
31
|
+
new UIBlock(jodit, [
|
|
32
|
+
Button(jodit, '', 'Insert', 'primary').onAction(() => formLink.submit())
|
|
28
33
|
])
|
|
29
|
-
]), formCode = new UIForm(
|
|
30
|
-
new UIBlock(
|
|
31
|
-
new UITextArea(
|
|
34
|
+
]), formCode = new UIForm(jodit, [
|
|
35
|
+
new UIBlock(jodit, [
|
|
36
|
+
new UITextArea(jodit, {
|
|
32
37
|
name: 'code',
|
|
33
38
|
required: true,
|
|
34
39
|
label: 'Embed code'
|
|
35
40
|
})
|
|
36
41
|
]),
|
|
37
|
-
new UIBlock(
|
|
38
|
-
Button(
|
|
42
|
+
new UIBlock(jodit, [
|
|
43
|
+
Button(jodit, '', 'Insert', 'primary').onAction(() => formCode.submit())
|
|
39
44
|
])
|
|
40
45
|
]), tabs = [], insertCode = (code) => {
|
|
41
|
-
|
|
42
|
-
|
|
46
|
+
jodit.s.restore();
|
|
47
|
+
jodit.s.insertHTML(code);
|
|
43
48
|
close();
|
|
44
49
|
};
|
|
45
|
-
|
|
50
|
+
jodit.s.save();
|
|
46
51
|
tabs.push({
|
|
47
52
|
icon: 'link',
|
|
48
53
|
name: 'Link',
|
|
@@ -53,12 +58,16 @@ Config.prototype.controls.video = {
|
|
|
53
58
|
content: formCode.container
|
|
54
59
|
});
|
|
55
60
|
formLink.onSubmit(data => {
|
|
56
|
-
insertCode(
|
|
61
|
+
insertCode(call(jodit.o.video?.parseUrlToVideoEmbed ??
|
|
62
|
+
convertMediaUrlToVideoEmbed, data.url, {
|
|
63
|
+
width: jodit.o.video?.defaultWidth,
|
|
64
|
+
height: jodit.o.video?.defaultHeight
|
|
65
|
+
}));
|
|
57
66
|
});
|
|
58
67
|
formCode.onSubmit(data => {
|
|
59
68
|
insertCode(data.code);
|
|
60
69
|
});
|
|
61
|
-
return TabsWidget(
|
|
70
|
+
return TabsWidget(jodit, tabs);
|
|
62
71
|
},
|
|
63
72
|
tags: ['iframe'],
|
|
64
73
|
tooltip: 'Insert youtube/vimeo video'
|
|
@@ -10,10 +10,13 @@ import type { HTMLTagNames } from "../../types";
|
|
|
10
10
|
declare module 'jodit/config' {
|
|
11
11
|
interface Config {
|
|
12
12
|
wrapNodes: {
|
|
13
|
+
/**
|
|
14
|
+
* List of tags that should not be wrapped
|
|
15
|
+
* Default: `new Set(['hr', 'style', 'br'])`
|
|
16
|
+
*/
|
|
13
17
|
exclude: Set<HTMLTagNames>;
|
|
14
18
|
/**
|
|
15
19
|
* If the editor is empty, then insert an empty paragraph into it
|
|
16
|
-
* @example
|
|
17
20
|
* ```javascript
|
|
18
21
|
* Jodit.make('#editor', {
|
|
19
22
|
* wrapNodes: {
|
|
@@ -21,6 +24,7 @@ declare module 'jodit/config' {
|
|
|
21
24
|
* }
|
|
22
25
|
* });
|
|
23
26
|
* ```
|
|
27
|
+
* Default: `true`
|
|
24
28
|
*/
|
|
25
29
|
emptyBlockAfterInit: boolean;
|
|
26
30
|
};
|
package/package.json
CHANGED
|
@@ -6,4 +6,7 @@
|
|
|
6
6
|
/**
|
|
7
7
|
* Javascript url pattern converter replace youtube/vimeo url in embed code.
|
|
8
8
|
*/
|
|
9
|
-
export declare const convertMediaUrlToVideoEmbed: (url: string, width
|
|
9
|
+
export declare const convertMediaUrlToVideoEmbed: (url: string, { width, height }?: {
|
|
10
|
+
width?: number;
|
|
11
|
+
height?: number;
|
|
12
|
+
}) => string;
|
|
@@ -41,6 +41,7 @@ export declare abstract class ViewWithToolbar extends View implements IViewWithT
|
|
|
41
41
|
*/
|
|
42
42
|
private beforeToolbarBuild;
|
|
43
43
|
readonly isJodit: boolean;
|
|
44
|
+
private __tooltip;
|
|
44
45
|
/** @override **/
|
|
45
46
|
protected constructor(options?: Partial<IViewOptions>, isJodit?: boolean);
|
|
46
47
|
destruct(): void;
|
|
@@ -39,7 +39,6 @@ export declare class ToolbarCollection<T extends IViewWithToolbar = IViewWithToo
|
|
|
39
39
|
* Set direction
|
|
40
40
|
*/
|
|
41
41
|
setDirection(direction: 'rtl' | 'ltr'): void;
|
|
42
|
-
private __tooltip;
|
|
43
42
|
constructor(jodit: IViewBased);
|
|
44
43
|
protected __initEvents(): void;
|
|
45
44
|
hide(): void;
|
|
@@ -15,8 +15,17 @@ declare module 'jodit/config' {
|
|
|
15
15
|
* Replace &nbsp; to plain space
|
|
16
16
|
*/
|
|
17
17
|
replaceNBSP: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Remove empty P tags, if they are not in the beginning of the text
|
|
20
|
+
*/
|
|
18
21
|
fillEmptyParagraph: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Remove empty elements
|
|
24
|
+
*/
|
|
19
25
|
removeEmptyElements: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Replace old tags to new eg. <i> to <em>, <b> to <strong>
|
|
28
|
+
*/
|
|
20
29
|
replaceOldTags: IDictionary<HTMLTagNames> | false;
|
|
21
30
|
/**
|
|
22
31
|
* You can use an iframe with the sandbox attribute to safely paste and test HTML code.
|
|
@@ -3,4 +3,33 @@
|
|
|
3
3
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
4
|
* Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
|
+
declare module 'jodit/config' {
|
|
7
|
+
interface Config {
|
|
8
|
+
video: {
|
|
9
|
+
/**
|
|
10
|
+
* Custom function for parsing video URL to embed code
|
|
11
|
+
* ```javascript
|
|
12
|
+
* Jodit.make('#editor', {
|
|
13
|
+
* video: {
|
|
14
|
+
* // Defaul behavior
|
|
15
|
+
* parseUrlToVideoEmbed: (url, size) => Jodit.modules.Helpers.convertMediaUrlToVideoEmbed(url, size)
|
|
16
|
+
* }
|
|
17
|
+
* });
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
parseUrlToVideoEmbed?: (url: string, { width, height }?: {
|
|
21
|
+
width?: number;
|
|
22
|
+
height?: number;
|
|
23
|
+
}) => string;
|
|
24
|
+
/**
|
|
25
|
+
* Default width for video iframe. Default: 400
|
|
26
|
+
*/
|
|
27
|
+
defaultWidth?: number;
|
|
28
|
+
/**
|
|
29
|
+
* Default height for video iframe. Default: 345
|
|
30
|
+
*/
|
|
31
|
+
defaultHeight?: number;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
}
|
|
6
35
|
export {};
|
|
@@ -10,10 +10,13 @@ import type { HTMLTagNames } from "../../types";
|
|
|
10
10
|
declare module 'jodit/config' {
|
|
11
11
|
interface Config {
|
|
12
12
|
wrapNodes: {
|
|
13
|
+
/**
|
|
14
|
+
* List of tags that should not be wrapped
|
|
15
|
+
* Default: `new Set(['hr', 'style', 'br'])`
|
|
16
|
+
*/
|
|
13
17
|
exclude: Set<HTMLTagNames>;
|
|
14
18
|
/**
|
|
15
19
|
* If the editor is empty, then insert an empty paragraph into it
|
|
16
|
-
* @example
|
|
17
20
|
* ```javascript
|
|
18
21
|
* Jodit.make('#editor', {
|
|
19
22
|
* wrapNodes: {
|
|
@@ -21,6 +24,7 @@ declare module 'jodit/config' {
|
|
|
21
24
|
* }
|
|
22
25
|
* });
|
|
23
26
|
* ```
|
|
27
|
+
* Default: `true`
|
|
24
28
|
*/
|
|
25
29
|
emptyBlockAfterInit: boolean;
|
|
26
30
|
};
|