jodit 4.16.0 → 4.17.0
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 +22 -0
- package/es2015/jodit.css +11 -1
- package/es2015/jodit.fat.min.css +1 -1
- package/es2015/jodit.fat.min.js +7 -7
- package/es2015/jodit.js +176 -33
- package/es2015/jodit.min.css +1 -1
- package/es2015/jodit.min.js +7 -7
- 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.css +1 -1
- package/es2018/jodit.fat.min.js +7 -7
- package/es2018/jodit.min.css +1 -1
- package/es2018/jodit.min.js +7 -7
- package/es2018/plugins/debug/debug.min.js +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021/jodit.css +11 -1
- package/es2021/jodit.fat.min.css +1 -1
- package/es2021/jodit.fat.min.js +7 -7
- package/es2021/jodit.js +168 -32
- package/es2021/jodit.min.css +1 -1
- package/es2021/jodit.min.js +7 -7
- 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 +11 -1
- package/es2021.en/jodit.fat.min.css +1 -1
- package/es2021.en/jodit.fat.min.js +7 -7
- package/es2021.en/jodit.js +168 -32
- package/es2021.en/jodit.min.css +1 -1
- 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 +15 -2
- package/es5/jodit.fat.min.css +1 -1
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +188 -33
- package/es5/jodit.min.css +3 -3
- 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 +40 -1
- package/esm/core/constants.js +1 -1
- package/esm/modules/widget/file-selector/file-selector.d.ts +10 -1
- package/esm/modules/widget/file-selector/file-selector.js +30 -18
- package/esm/plugins/file/file.d.ts +24 -1
- package/esm/plugins/file/file.js +17 -1
- package/esm/plugins/iframe/config.js +4 -0
- package/esm/plugins/image-processor/image-processor.d.ts +5 -0
- package/esm/plugins/image-processor/image-processor.js +29 -2
- package/esm/plugins/inline-popup/config/items/img.js +22 -1
- package/esm/plugins/source/editor/engines/ace.js +2 -1
- package/esm/plugins/source/source.d.ts +17 -0
- package/esm/plugins/source/source.js +58 -10
- package/esm/plugins/video/config.d.ts +21 -1
- package/esm/plugins/video/config.js +22 -2
- package/package.json +1 -1
- package/types/config.d.ts +40 -1
- package/types/modules/widget/file-selector/file-selector.d.ts +10 -1
- package/types/plugins/file/file.d.ts +24 -1
- package/types/plugins/image-processor/image-processor.d.ts +5 -0
- package/types/plugins/source/source.d.ts +17 -0
- package/types/plugins/video/config.d.ts +21 -1
|
@@ -8,12 +8,22 @@ 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
|
-
import { TabsWidget } from "../../modules/widget/index.js";
|
|
11
|
+
import { TabsWidget, UploadTab } from "../../modules/widget/index.js";
|
|
12
12
|
import videoIcon from "./video.svg.js";
|
|
13
|
+
function insertVideos(data) {
|
|
14
|
+
var _a;
|
|
15
|
+
(_a = data.files) === null || _a === void 0 ? void 0 : _a.forEach(file => {
|
|
16
|
+
this.s.insertNode(this.createInside.element('video', {
|
|
17
|
+
controls: '',
|
|
18
|
+
src: data.baseurl + file
|
|
19
|
+
}));
|
|
20
|
+
});
|
|
21
|
+
}
|
|
13
22
|
Config.prototype.video = {
|
|
14
23
|
parseUrlToVideoEmbed: convertMediaUrlToVideoEmbed,
|
|
15
24
|
defaultWidth: 400,
|
|
16
|
-
defaultHeight: 345
|
|
25
|
+
defaultHeight: 345,
|
|
26
|
+
defaultHandlerSuccess: insertVideos
|
|
17
27
|
};
|
|
18
28
|
Icon.set('video', videoIcon);
|
|
19
29
|
Config.prototype.controls.video = {
|
|
@@ -48,6 +58,16 @@ Config.prototype.controls.video = {
|
|
|
48
58
|
close();
|
|
49
59
|
};
|
|
50
60
|
jodit.s.save();
|
|
61
|
+
const { uploader } = jodit.o;
|
|
62
|
+
// Base64 alone would put whole video files into the content
|
|
63
|
+
if (uploader.showTabInFileSelector !== false &&
|
|
64
|
+
(uploader.url || uploader.customUploadFunction)) {
|
|
65
|
+
tabs.push(UploadTab(jodit, data => {
|
|
66
|
+
var _a, _b;
|
|
67
|
+
jodit.s.restore();
|
|
68
|
+
((_b = (_a = jodit.o.video) === null || _a === void 0 ? void 0 : _a.defaultHandlerSuccess) !== null && _b !== void 0 ? _b : insertVideos).call(jodit, data);
|
|
69
|
+
}, { label: 'Drop file', accept: 'video/*' }));
|
|
70
|
+
}
|
|
51
71
|
tabs.push({
|
|
52
72
|
icon: 'link',
|
|
53
73
|
name: 'Link',
|
package/package.json
CHANGED
package/types/config.d.ts
CHANGED
|
@@ -8,9 +8,10 @@ import type { HTMLTagNames } from "./types/index";
|
|
|
8
8
|
import type { AiAssistantSettings } from "./plugins/ai-assistant/interface";
|
|
9
9
|
import type { IDictionary } from "./types/index";
|
|
10
10
|
import type { Nullable } from "./types/index";
|
|
11
|
+
import type { IJodit } from "./types/index";
|
|
12
|
+
import type { IUploaderData } from "./types/index";
|
|
11
13
|
import type { ImagePropertiesOptions } from "./plugins/image-properties/interface";
|
|
12
14
|
import type { IControlType } from "./types/index";
|
|
13
|
-
import type { IJodit } from "./types/index";
|
|
14
15
|
import type { formTemplate } from "./plugins/link/template";
|
|
15
16
|
import type { IUIForm } from "./types/index";
|
|
16
17
|
import type { IUIOption } from "./types/index";
|
|
@@ -1264,6 +1265,27 @@ interface Config {
|
|
|
1264
1265
|
blockLimits: IDictionary<1>;
|
|
1265
1266
|
};
|
|
1266
1267
|
}
|
|
1268
|
+
interface Config {
|
|
1269
|
+
file: {
|
|
1270
|
+
/**
|
|
1271
|
+
* Inserts the files uploaded from the file popup's Upload tab. By default
|
|
1272
|
+
* each one goes in as a link, an image as well, the way
|
|
1273
|
+
* `uploader.defaultHandlerSuccess` inserts a file that isn't an image.
|
|
1274
|
+
* ```javascript
|
|
1275
|
+
* Jodit.make('#editor', {
|
|
1276
|
+
* file: {
|
|
1277
|
+
* defaultHandlerSuccess(data) {
|
|
1278
|
+
* data.files.forEach(file => {
|
|
1279
|
+
* this.s.insertHTML(`<a class="file" href="${data.baseurl + file}">${file}</a>`);
|
|
1280
|
+
* });
|
|
1281
|
+
* }
|
|
1282
|
+
* }
|
|
1283
|
+
* });
|
|
1284
|
+
* ```
|
|
1285
|
+
*/
|
|
1286
|
+
defaultHandlerSuccess?: (this: IJodit, data: IUploaderData) => void;
|
|
1287
|
+
};
|
|
1288
|
+
}
|
|
1267
1289
|
interface Config {
|
|
1268
1290
|
autofocus: boolean;
|
|
1269
1291
|
cursorAfterAutofocus: 'start' | 'end';
|
|
@@ -1971,6 +1993,23 @@ interface Config {
|
|
|
1971
1993
|
* Default height for video iframe. Default: 345
|
|
1972
1994
|
*/
|
|
1973
1995
|
defaultHeight?: number;
|
|
1996
|
+
/**
|
|
1997
|
+
* Inserts the videos uploaded from the popup's Upload tab, which is shown
|
|
1998
|
+
* when `uploader.url` or `uploader.customUploadFunction` is set. By default
|
|
1999
|
+
* each one goes in as `<video controls src="…">`.
|
|
2000
|
+
* ```javascript
|
|
2001
|
+
* Jodit.make('#editor', {
|
|
2002
|
+
* video: {
|
|
2003
|
+
* defaultHandlerSuccess(data) {
|
|
2004
|
+
* data.files.forEach(file => {
|
|
2005
|
+
* this.s.insertHTML(`<video controls preload="metadata" src="${data.baseurl + file}"></video>`);
|
|
2006
|
+
* });
|
|
2007
|
+
* }
|
|
2008
|
+
* }
|
|
2009
|
+
* });
|
|
2010
|
+
* ```
|
|
2011
|
+
*/
|
|
2012
|
+
defaultHandlerSuccess?: (this: IJodit, data: IUploaderData) => void;
|
|
1974
2013
|
};
|
|
1975
2014
|
}
|
|
1976
2015
|
interface Config {
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
* @packageDocumentation
|
|
9
9
|
* @module modules/widget/file-selector
|
|
10
10
|
*/
|
|
11
|
-
import type { IFileBrowserCallBackData, IJodit } from "../../../types/index";
|
|
11
|
+
import type { IFileBrowserCallBackData, IJodit, IUploaderData } from "../../../types/index";
|
|
12
|
+
import { type TabOption } from "../tabs/tabs";
|
|
12
13
|
interface ImageSelectorCallbacks {
|
|
13
14
|
/**
|
|
14
15
|
* Function that will be called when the user enters the URL of the tab image and alternative text for images
|
|
@@ -34,4 +35,12 @@ interface ImageSelectorCallbacks {
|
|
|
34
35
|
* functions with different parameters
|
|
35
36
|
*/
|
|
36
37
|
export declare const FileSelectorWidget: (editor: IJodit, callbacks: ImageSelectorCallbacks, elm: HTMLElement | null, close: () => void, isImage?: boolean) => HTMLDivElement;
|
|
38
|
+
/**
|
|
39
|
+
* The Upload tab: a box that uploads the files dropped on it or chosen in its
|
|
40
|
+
* file input, then passes the uploader's answer to `onSuccess` and closes the popup
|
|
41
|
+
*/
|
|
42
|
+
export declare const UploadTab: (editor: IJodit, onSuccess: (this: IJodit, data: IUploaderData) => void, { label, accept }: {
|
|
43
|
+
label: string;
|
|
44
|
+
accept: string;
|
|
45
|
+
}) => TabOption;
|
|
37
46
|
export {};
|
|
@@ -8,5 +8,28 @@
|
|
|
8
8
|
* @packageDocumentation
|
|
9
9
|
* @module plugins/file
|
|
10
10
|
*/
|
|
11
|
-
import type { IJodit } from "../../types/index";
|
|
11
|
+
import type { IJodit, IUploaderData } from "../../types/index";
|
|
12
|
+
declare module 'jodit/config' {
|
|
13
|
+
interface Config {
|
|
14
|
+
file: {
|
|
15
|
+
/**
|
|
16
|
+
* Inserts the files uploaded from the file popup's Upload tab. By default
|
|
17
|
+
* each one goes in as a link, an image as well, the way
|
|
18
|
+
* `uploader.defaultHandlerSuccess` inserts a file that isn't an image.
|
|
19
|
+
* ```javascript
|
|
20
|
+
* Jodit.make('#editor', {
|
|
21
|
+
* file: {
|
|
22
|
+
* defaultHandlerSuccess(data) {
|
|
23
|
+
* data.files.forEach(file => {
|
|
24
|
+
* this.s.insertHTML(`<a class="file" href="${data.baseurl + file}">${file}</a>`);
|
|
25
|
+
* });
|
|
26
|
+
* }
|
|
27
|
+
* }
|
|
28
|
+
* });
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
defaultHandlerSuccess?: (this: IJodit, data: IUploaderData) => void;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
}
|
|
12
35
|
export declare function file(editor: IJodit): void;
|
|
@@ -23,6 +23,11 @@ export declare class imageProcessor extends Plugin {
|
|
|
23
23
|
protected onBeforeSetElementValue(data: {
|
|
24
24
|
value: string;
|
|
25
25
|
}): void;
|
|
26
|
+
/**
|
|
27
|
+
* While the selection is an image, only the image is highlighted: Safari
|
|
28
|
+
* paints the rest of a block image's line with its parent's highlight. See #1528
|
|
29
|
+
*/
|
|
30
|
+
private onSelectionChange;
|
|
26
31
|
protected afterChange(data: {
|
|
27
32
|
value: string;
|
|
28
33
|
}): Promise<void>;
|
|
@@ -21,6 +21,11 @@ export declare class source extends Plugin {
|
|
|
21
21
|
private mirrorContainer;
|
|
22
22
|
private __lock;
|
|
23
23
|
private __oldMirrorValue;
|
|
24
|
+
/**
|
|
25
|
+
* What the source view was last filled with from WYSIWYG, read back from
|
|
26
|
+
* the editor; while the view still holds it, nothing has been typed there
|
|
27
|
+
*/
|
|
28
|
+
private __filledValue;
|
|
24
29
|
private tempMarkerStart;
|
|
25
30
|
private tempMarkerStartReg;
|
|
26
31
|
private tempMarkerEnd;
|
|
@@ -50,6 +55,18 @@ export declare class source extends Plugin {
|
|
|
50
55
|
afterInit(editor: IJodit): void;
|
|
51
56
|
private syncValueFromWYSIWYG;
|
|
52
57
|
private initSourceEditor;
|
|
58
|
+
/**
|
|
59
|
+
* Replaces the source editor (the textarea shown while ACE loads) with
|
|
60
|
+
* the one that just became ready, carrying its text, selection and focus
|
|
61
|
+
* over. Filling the new editor from WYSIWYG instead would drop what was
|
|
62
|
+
* typed since the last, debounced, sync and normalise half-typed markup.
|
|
63
|
+
*/
|
|
64
|
+
private takeOver;
|
|
65
|
+
/**
|
|
66
|
+
* The beautifier arrived after the source view was opened: format the
|
|
67
|
+
* view if nothing has been typed into it, otherwise leave the typing alone
|
|
68
|
+
*/
|
|
69
|
+
private beautifyUntouched;
|
|
53
70
|
/** @override */
|
|
54
71
|
beforeDestruct(): void;
|
|
55
72
|
}
|
|
@@ -3,6 +3,10 @@
|
|
|
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
|
+
* @module plugins/video
|
|
8
|
+
*/
|
|
9
|
+
import type { IJodit, IUploaderData } from "../../types/index";
|
|
6
10
|
declare module 'jodit/config' {
|
|
7
11
|
interface Config {
|
|
8
12
|
video: {
|
|
@@ -29,7 +33,23 @@ declare module 'jodit/config' {
|
|
|
29
33
|
* Default height for video iframe. Default: 345
|
|
30
34
|
*/
|
|
31
35
|
defaultHeight?: number;
|
|
36
|
+
/**
|
|
37
|
+
* Inserts the videos uploaded from the popup's Upload tab, which is shown
|
|
38
|
+
* when `uploader.url` or `uploader.customUploadFunction` is set. By default
|
|
39
|
+
* each one goes in as `<video controls src="…">`.
|
|
40
|
+
* ```javascript
|
|
41
|
+
* Jodit.make('#editor', {
|
|
42
|
+
* video: {
|
|
43
|
+
* defaultHandlerSuccess(data) {
|
|
44
|
+
* data.files.forEach(file => {
|
|
45
|
+
* this.s.insertHTML(`<video controls preload="metadata" src="${data.baseurl + file}"></video>`);
|
|
46
|
+
* });
|
|
47
|
+
* }
|
|
48
|
+
* }
|
|
49
|
+
* });
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
defaultHandlerSuccess?: (this: IJodit, data: IUploaderData) => void;
|
|
32
53
|
};
|
|
33
54
|
}
|
|
34
55
|
}
|
|
35
|
-
export {};
|