jodit 4.18.3 → 4.18.6
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 +52 -0
- package/es2015/jodit.css +72 -34
- package/es2015/jodit.fat.min.css +1 -1
- package/es2015/jodit.fat.min.js +35 -10
- package/es2015/jodit.js +1967 -327
- package/es2015/jodit.min.css +1 -1
- package/es2015/jodit.min.js +41 -16
- 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 +35 -10
- package/es2018/jodit.min.css +1 -1
- package/es2018/jodit.min.js +35 -10
- package/es2018/plugins/debug/debug.min.js +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021/jodit.css +72 -34
- package/es2021/jodit.fat.min.css +1 -1
- package/es2021/jodit.fat.min.js +42 -17
- package/es2021/jodit.js +1949 -323
- package/es2021/jodit.min.css +1 -1
- package/es2021/jodit.min.js +42 -17
- 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 +72 -34
- package/es2021.en/jodit.fat.min.css +1 -1
- package/es2021.en/jodit.fat.min.js +42 -17
- package/es2021.en/jodit.js +1923 -297
- package/es2021.en/jodit.min.css +1 -1
- package/es2021.en/jodit.min.js +51 -26
- 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 +85 -38
- package/es5/jodit.fat.min.css +1 -1
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +2225 -379
- 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 +28 -26
- package/esm/config.js +19 -21
- package/esm/core/constants.js +1 -1
- package/esm/core/helpers/html/apply-styles.js +3 -0
- package/esm/core/helpers/html/clean-from-word.js +3 -0
- package/esm/core/helpers/html/strip-tags.js +24 -6
- package/esm/core/helpers/html/word-lists.d.ts +29 -0
- package/esm/core/helpers/html/word-lists.js +158 -0
- package/esm/core/helpers/utils/align.d.ts +1 -1
- package/esm/core/helpers/utils/align.js +2 -3
- package/esm/core/selection/helpers/index.d.ts +1 -0
- package/esm/core/selection/helpers/index.js +1 -0
- package/esm/core/selection/helpers/is-moved.d.ts +15 -0
- package/esm/core/selection/helpers/is-moved.js +22 -0
- package/esm/core/selection/style/api/list/toggle-ordered-list.js +40 -3
- package/esm/core/selection/style/transactions.js +5 -2
- package/esm/jodit.js +14 -4
- package/esm/langs/ar.d.ts +10 -0
- package/esm/langs/ar.js +11 -1
- package/esm/langs/az.d.ts +10 -0
- package/esm/langs/az.js +11 -1
- package/esm/langs/cs_cz.d.ts +10 -0
- package/esm/langs/cs_cz.js +12 -1
- package/esm/langs/de.d.ts +10 -0
- package/esm/langs/de.js +11 -1
- package/esm/langs/es.d.ts +10 -0
- package/esm/langs/es.js +11 -1
- package/esm/langs/fa.d.ts +10 -0
- package/esm/langs/fa.js +11 -1
- package/esm/langs/fi.d.ts +10 -0
- package/esm/langs/fi.js +11 -1
- package/esm/langs/fr.d.ts +10 -0
- package/esm/langs/fr.js +11 -1
- package/esm/langs/he.d.ts +10 -0
- package/esm/langs/he.js +11 -1
- package/esm/langs/hu.d.ts +10 -0
- package/esm/langs/hu.js +11 -1
- package/esm/langs/id.d.ts +10 -0
- package/esm/langs/id.js +11 -1
- package/esm/langs/it.d.ts +10 -0
- package/esm/langs/it.js +11 -1
- package/esm/langs/ja.d.ts +10 -0
- package/esm/langs/ja.js +11 -1
- package/esm/langs/ko.d.ts +10 -0
- package/esm/langs/ko.js +11 -1
- package/esm/langs/mn.d.ts +10 -0
- package/esm/langs/mn.js +11 -1
- package/esm/langs/nl.d.ts +10 -0
- package/esm/langs/nl.js +11 -1
- package/esm/langs/no.d.ts +10 -0
- package/esm/langs/no.js +11 -1
- package/esm/langs/pl.d.ts +10 -0
- package/esm/langs/pl.js +11 -1
- package/esm/langs/pt_br.d.ts +10 -0
- package/esm/langs/pt_br.js +11 -1
- package/esm/langs/ru.d.ts +10 -0
- package/esm/langs/ru.js +11 -1
- package/esm/langs/sk.d.ts +10 -0
- package/esm/langs/sk.js +11 -1
- package/esm/langs/sv.d.ts +10 -0
- package/esm/langs/sv.js +11 -1
- package/esm/langs/tr.d.ts +10 -0
- package/esm/langs/tr.js +11 -1
- package/esm/langs/ua.d.ts +10 -0
- package/esm/langs/ua.js +11 -1
- package/esm/langs/zh_cn.d.ts +10 -0
- package/esm/langs/zh_cn.js +11 -1
- package/esm/langs/zh_tw.d.ts +10 -0
- package/esm/langs/zh_tw.js +11 -1
- package/esm/modules/dialog/dialog.d.ts +7 -0
- package/esm/modules/dialog/dialog.js +24 -6
- package/esm/modules/table/table.d.ts +6 -0
- package/esm/modules/table/table.js +18 -26
- package/esm/plugins/all.d.ts +1 -0
- package/esm/plugins/all.js +1 -0
- package/esm/plugins/backspace/cases/check-join-neighbors.js +90 -3
- package/esm/plugins/clean-html/clean-html.d.ts +8 -0
- package/esm/plugins/clean-html/clean-html.js +21 -1
- package/esm/plugins/clean-html/helpers/index.d.ts +1 -0
- package/esm/plugins/clean-html/helpers/index.js +1 -0
- package/esm/plugins/clean-html/helpers/remove-placeholder-br.d.ts +16 -0
- package/esm/plugins/clean-html/helpers/remove-placeholder-br.js +51 -0
- package/esm/plugins/delete/delete.d.ts +11 -1
- package/esm/plugins/delete/delete.js +92 -16
- package/esm/plugins/focus/focus.js +12 -1
- package/esm/plugins/iframe/config.d.ts +3 -0
- package/esm/plugins/iframe/config.js +0 -27
- package/esm/plugins/iframe/iframe.js +8 -1
- package/esm/plugins/image-processor/image-processor.d.ts +4 -1
- package/esm/plugins/image-processor/image-processor.js +15 -4
- package/esm/plugins/image-properties/readers/align.d.ts +2 -2
- package/esm/plugins/index.d.ts +1 -0
- package/esm/plugins/inline-popup/config/items/iframe.d.ts +9 -1
- package/esm/plugins/inline-popup/config/items/iframe.js +15 -0
- package/esm/plugins/inline-popup/inline-popup.d.ts +19 -0
- package/esm/plugins/inline-popup/inline-popup.js +70 -1
- package/esm/plugins/media/media.js +16 -7
- package/esm/plugins/ordered-list/config.js +13 -2
- package/esm/plugins/ordered-list/start-dialog.d.ts +19 -0
- package/esm/plugins/ordered-list/start-dialog.js +58 -0
- package/esm/plugins/placeholder/placeholder.js +7 -1
- package/esm/plugins/resizer/config.d.ts +5 -3
- package/esm/plugins/resizer/config.js +8 -2
- package/esm/plugins/resizer/resizer.d.ts +20 -0
- package/esm/plugins/resizer/resizer.js +140 -17
- package/esm/plugins/select-cells/select-cells.d.ts +23 -0
- package/esm/plugins/select-cells/select-cells.js +75 -1
- package/esm/plugins/table-keyboard-navigation/table-keyboard-navigation.js +3 -2
- package/esm/plugins/video/config.d.ts +6 -0
- package/esm/plugins/video/config.js +77 -65
- package/esm/plugins/video-properties/interface.d.ts +31 -0
- package/esm/plugins/video-properties/interface.js +6 -0
- package/esm/plugins/video-properties/readers.d.ts +26 -0
- package/esm/plugins/video-properties/readers.js +65 -0
- package/esm/plugins/video-properties/replace.d.ts +15 -0
- package/esm/plugins/video-properties/replace.js +97 -0
- package/esm/plugins/video-properties/ui/ui-video-form.d.ts +41 -0
- package/esm/plugins/video-properties/ui/ui-video-form.js +228 -0
- package/esm/plugins/video-properties/video-properties.d.ts +37 -0
- package/esm/plugins/video-properties/video-properties.js +175 -0
- package/esm/plugins/video-properties/writers.d.ts +15 -0
- package/esm/plugins/video-properties/writers.js +73 -0
- package/esm/types/types.d.ts +1 -1
- package/package.json +1 -1
- package/types/config.d.ts +28 -26
- package/types/core/helpers/html/word-lists.d.ts +29 -0
- package/types/core/helpers/utils/align.d.ts +1 -1
- package/types/core/selection/helpers/index.d.ts +1 -0
- package/types/core/selection/helpers/is-moved.d.ts +15 -0
- package/types/langs/ar.d.ts +10 -0
- package/types/langs/az.d.ts +10 -0
- package/types/langs/cs_cz.d.ts +10 -0
- package/types/langs/de.d.ts +10 -0
- package/types/langs/es.d.ts +10 -0
- package/types/langs/fa.d.ts +10 -0
- package/types/langs/fi.d.ts +10 -0
- package/types/langs/fr.d.ts +10 -0
- package/types/langs/he.d.ts +10 -0
- package/types/langs/hu.d.ts +10 -0
- package/types/langs/id.d.ts +10 -0
- package/types/langs/it.d.ts +10 -0
- package/types/langs/ja.d.ts +10 -0
- package/types/langs/ko.d.ts +10 -0
- package/types/langs/mn.d.ts +10 -0
- package/types/langs/nl.d.ts +10 -0
- package/types/langs/no.d.ts +10 -0
- package/types/langs/pl.d.ts +10 -0
- package/types/langs/pt_br.d.ts +10 -0
- package/types/langs/ru.d.ts +10 -0
- package/types/langs/sk.d.ts +10 -0
- package/types/langs/sv.d.ts +10 -0
- package/types/langs/tr.d.ts +10 -0
- package/types/langs/ua.d.ts +10 -0
- package/types/langs/zh_cn.d.ts +10 -0
- package/types/langs/zh_tw.d.ts +10 -0
- package/types/modules/dialog/dialog.d.ts +7 -0
- package/types/modules/table/table.d.ts +6 -0
- package/types/plugins/clean-html/clean-html.d.ts +8 -0
- package/types/plugins/clean-html/helpers/index.d.ts +1 -0
- package/types/plugins/clean-html/helpers/remove-placeholder-br.d.ts +16 -0
- package/types/plugins/delete/delete.d.ts +11 -1
- package/types/plugins/iframe/config.d.ts +3 -0
- package/types/plugins/image-processor/image-processor.d.ts +4 -1
- package/types/plugins/image-properties/readers/align.d.ts +2 -2
- package/types/plugins/index.d.ts +1 -0
- package/types/plugins/inline-popup/config/items/iframe.d.ts +9 -1
- package/types/plugins/inline-popup/inline-popup.d.ts +19 -0
- package/types/plugins/ordered-list/start-dialog.d.ts +19 -0
- package/types/plugins/resizer/config.d.ts +5 -3
- package/types/plugins/resizer/resizer.d.ts +20 -0
- package/types/plugins/select-cells/select-cells.d.ts +23 -0
- package/types/plugins/video/config.d.ts +6 -0
- package/types/plugins/video-properties/interface.d.ts +31 -0
- package/types/plugins/video-properties/readers.d.ts +26 -0
- package/types/plugins/video-properties/replace.d.ts +15 -0
- package/types/plugins/video-properties/ui/ui-video-form.d.ts +41 -0
- package/types/plugins/video-properties/video-properties.d.ts +37 -0
- package/types/plugins/video-properties/writers.d.ts +15 -0
- package/types/types/types.d.ts +1 -1
|
@@ -0,0 +1,175 @@
|
|
|
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
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
7
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
9
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
10
|
+
else
|
|
11
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
12
|
+
if (d = decorators[i])
|
|
13
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
14
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
15
|
+
};
|
|
16
|
+
import { cache, cached, watch } from "../../core/decorators/index.js";
|
|
17
|
+
import { Dom } from "../../core/dom/dom.js";
|
|
18
|
+
import { pluginSystem } from "../../core/global.js";
|
|
19
|
+
import { isArray } from "../../core/helpers/checker/is-array.js";
|
|
20
|
+
import { position } from "../../core/helpers/size/position.js";
|
|
21
|
+
import { markOwner } from "../../core/helpers/utils/utils.js";
|
|
22
|
+
import { Plugin } from "../../core/plugin/plugin.js";
|
|
23
|
+
import { Button } from "../../core/ui/button/index.js";
|
|
24
|
+
import { Popup } from "../../core/ui/popup/popup.js";
|
|
25
|
+
import { FileSelectorWidget } from "../../modules/widget/file-selector/file-selector.js";
|
|
26
|
+
import { UIVideoPropertiesForm } from "./ui/ui-video-form.js";
|
|
27
|
+
import { editedMedia, readValues } from "./readers.js";
|
|
28
|
+
import { replaceMedia } from "./replace.js";
|
|
29
|
+
import { applyValues } from "./writers.js";
|
|
30
|
+
import { videoTabs } from "../video/config.js";
|
|
31
|
+
/**
|
|
32
|
+
* Show a dialog with the size, poster and playback settings of a video, an
|
|
33
|
+
* embed or audio. The media popup's Edit button opens it:
|
|
34
|
+
*
|
|
35
|
+
* ```javascript
|
|
36
|
+
* editor.events.fire('openVideoProperties', video);
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export class videoProperties extends Plugin {
|
|
40
|
+
constructor() {
|
|
41
|
+
super(...arguments);
|
|
42
|
+
this.state = {
|
|
43
|
+
target: this.j.c.element('video'),
|
|
44
|
+
media: this.j.c.element('video'),
|
|
45
|
+
ratio: 1,
|
|
46
|
+
sizeIsLocked: true,
|
|
47
|
+
values: {
|
|
48
|
+
width: '',
|
|
49
|
+
height: '',
|
|
50
|
+
poster: '',
|
|
51
|
+
autoplay: false,
|
|
52
|
+
loop: false,
|
|
53
|
+
muted: false,
|
|
54
|
+
controls: true
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
// The size as it was read, so an unchanged one isn't written
|
|
58
|
+
this.__readSize = '';
|
|
59
|
+
}
|
|
60
|
+
get __size() {
|
|
61
|
+
const { width, height } = this.state.values;
|
|
62
|
+
return `${width}x${height}`;
|
|
63
|
+
}
|
|
64
|
+
get form() {
|
|
65
|
+
return new UIVideoPropertiesForm(this.j, this.state, {
|
|
66
|
+
openPosterPopup: target => this.__openPosterPopup(target)
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
get dialog() {
|
|
70
|
+
const { j } = this;
|
|
71
|
+
const dialog = j.dlg({
|
|
72
|
+
minWidth: Math.min(400, screen.width),
|
|
73
|
+
buttons: ['dialog.close']
|
|
74
|
+
});
|
|
75
|
+
const buttons = this.__buttons;
|
|
76
|
+
buttons.check.onAction(() => {
|
|
77
|
+
applyValues(j, this.state, this.__size !== this.__readSize);
|
|
78
|
+
j.synchronizeValues();
|
|
79
|
+
dialog.close();
|
|
80
|
+
});
|
|
81
|
+
buttons.remove.onAction(() => {
|
|
82
|
+
j.s.removeNode(this.state.target);
|
|
83
|
+
dialog.close();
|
|
84
|
+
});
|
|
85
|
+
buttons.cancel.onAction(() => {
|
|
86
|
+
dialog.close();
|
|
87
|
+
});
|
|
88
|
+
dialog.setContent(this.form);
|
|
89
|
+
dialog.setFooter([[buttons.cancel, buttons.remove], buttons.check]);
|
|
90
|
+
markOwner(j, dialog.container);
|
|
91
|
+
return dialog;
|
|
92
|
+
}
|
|
93
|
+
get __buttons() {
|
|
94
|
+
const { j } = this;
|
|
95
|
+
return {
|
|
96
|
+
check: Button(j, 'ok', 'Apply', 'primary'),
|
|
97
|
+
remove: Button(j, 'bin', 'Delete'),
|
|
98
|
+
cancel: Button(j, 'cancel', 'Cancel')
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Open the dialog for the media `target` is, or is the wrapper of
|
|
103
|
+
*/
|
|
104
|
+
open(target) {
|
|
105
|
+
const media = editedMedia(target);
|
|
106
|
+
if (!media) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
this.state.target = target;
|
|
110
|
+
this.state.media = media;
|
|
111
|
+
readValues(this.state);
|
|
112
|
+
this.__readSize = this.__size;
|
|
113
|
+
this.dialog.setHeader(this.j.i18n(Dom.isTag(media, 'audio')
|
|
114
|
+
? 'Audio properties'
|
|
115
|
+
: 'Video properties'));
|
|
116
|
+
this.dialog.open().setModal(true).setPosition();
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* The video popup's tabs for the media popup's Replace: what they insert
|
|
120
|
+
* takes the place of the media `target` is, or is the wrapper of
|
|
121
|
+
*/
|
|
122
|
+
onGenerateReplaceVideoTabs(target, close) {
|
|
123
|
+
return videoTabs(this.j, close, insert => replaceMedia(this.j, target, insert));
|
|
124
|
+
}
|
|
125
|
+
__openPosterPopup(button) {
|
|
126
|
+
const { j, state } = this;
|
|
127
|
+
const popup = new Popup(this.dialog);
|
|
128
|
+
const close = () => {
|
|
129
|
+
popup.close();
|
|
130
|
+
popup.destruct();
|
|
131
|
+
};
|
|
132
|
+
popup
|
|
133
|
+
.setContent(FileSelectorWidget(j, {
|
|
134
|
+
upload: (data) => {
|
|
135
|
+
if (data.files && data.files.length) {
|
|
136
|
+
state.values.poster =
|
|
137
|
+
data.baseurl + data.files[0];
|
|
138
|
+
}
|
|
139
|
+
close();
|
|
140
|
+
},
|
|
141
|
+
filebrowser: (data) => {
|
|
142
|
+
if (isArray(data.files) && data.files.length) {
|
|
143
|
+
state.values.poster = data.files[0];
|
|
144
|
+
close();
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}, null, close))
|
|
148
|
+
.open(() => position(button));
|
|
149
|
+
}
|
|
150
|
+
/** @override */
|
|
151
|
+
afterInit() { }
|
|
152
|
+
/** @override */
|
|
153
|
+
beforeDestruct() {
|
|
154
|
+
var _a, _b, _c;
|
|
155
|
+
Object.values((_a = cached(this, '__buttons')) !== null && _a !== void 0 ? _a : {}).forEach(b => b.destruct());
|
|
156
|
+
(_b = cached(this, 'dialog')) === null || _b === void 0 ? void 0 : _b.destruct();
|
|
157
|
+
(_c = cached(this, 'form')) === null || _c === void 0 ? void 0 : _c.destruct();
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
__decorate([
|
|
161
|
+
cache
|
|
162
|
+
], videoProperties.prototype, "form", null);
|
|
163
|
+
__decorate([
|
|
164
|
+
cache
|
|
165
|
+
], videoProperties.prototype, "dialog", null);
|
|
166
|
+
__decorate([
|
|
167
|
+
cache
|
|
168
|
+
], videoProperties.prototype, "__buttons", null);
|
|
169
|
+
__decorate([
|
|
170
|
+
watch(':openVideoProperties')
|
|
171
|
+
], videoProperties.prototype, "open", null);
|
|
172
|
+
__decorate([
|
|
173
|
+
watch(':generateReplaceVideoTabs')
|
|
174
|
+
], videoProperties.prototype, "onGenerateReplaceVideoTabs", null);
|
|
175
|
+
pluginSystem.add('videoProperties', videoProperties);
|
|
@@ -0,0 +1,15 @@
|
|
|
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 plugins/video-properties
|
|
8
|
+
*/
|
|
9
|
+
import type { IJodit } from "../../types/index";
|
|
10
|
+
import type { VideoPropertiesState } from "./interface";
|
|
11
|
+
/**
|
|
12
|
+
* Apply the dialog's values to the media
|
|
13
|
+
* @private
|
|
14
|
+
*/
|
|
15
|
+
export declare function applyValues(j: IJodit, state: VideoPropertiesState, sizeChanged: boolean): void;
|
|
@@ -0,0 +1,73 @@
|
|
|
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
|
+
import { Dom } from "../../core/dom/dom.js";
|
|
7
|
+
import { attr } from "../../core/helpers/utils/attr.js";
|
|
8
|
+
import { css, cssInline } from "../../core/helpers/utils/css.js";
|
|
9
|
+
import { ownSize } from "./readers.js";
|
|
10
|
+
import { normalSizeToString } from "../image-properties/utils/utils.js";
|
|
11
|
+
const cssSize = (value) => value === '' ? null : normalSizeToString(value);
|
|
12
|
+
// Sizes go on as the resizer writes them: an embed takes them as attributes,
|
|
13
|
+
// and a video as CSS, without a height while its ratio is kept, if it had none
|
|
14
|
+
function applySize(j, state) {
|
|
15
|
+
var _a;
|
|
16
|
+
const { media, values } = state;
|
|
17
|
+
if (Dom.isTag(media, 'iframe')) {
|
|
18
|
+
['width', 'height'].forEach(key => {
|
|
19
|
+
attr(media, key, values[key] === '' ? null : values[key]);
|
|
20
|
+
if (cssInline(media, key)) {
|
|
21
|
+
css(media, key, cssSize(values[key]));
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
// The resizer's frame for an embed
|
|
25
|
+
const wrapper = media.parentElement;
|
|
26
|
+
if (wrapper && attr(wrapper, 'data-jodit_iframe_wrapper')) {
|
|
27
|
+
css(wrapper, {
|
|
28
|
+
width: media.offsetWidth,
|
|
29
|
+
height: media.offsetHeight
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const heightFollowsWidth = state.sizeIsLocked && !ownSize(media, 'height');
|
|
35
|
+
css(media, {
|
|
36
|
+
width: cssSize(values.width),
|
|
37
|
+
height: heightFollowsWidth ? null : cssSize(values.height)
|
|
38
|
+
});
|
|
39
|
+
if (!((_a = attr(media, 'style')) === null || _a === void 0 ? void 0 : _a.trim())) {
|
|
40
|
+
attr(media, 'style', null);
|
|
41
|
+
}
|
|
42
|
+
j.e.fire(media, 'changesize');
|
|
43
|
+
}
|
|
44
|
+
function setFlag(media, name, on) {
|
|
45
|
+
if (media.hasAttribute(name) !== on) {
|
|
46
|
+
attr(media, name, on ? '' : null);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Apply the dialog's values to the media
|
|
51
|
+
* @private
|
|
52
|
+
*/
|
|
53
|
+
export function applyValues(j, state, sizeChanged) {
|
|
54
|
+
const { media, values } = state;
|
|
55
|
+
if (sizeChanged && !Dom.isTag(media, 'audio')) {
|
|
56
|
+
applySize(j, state);
|
|
57
|
+
}
|
|
58
|
+
if (Dom.isTag(media, 'iframe')) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
if (Dom.isTag(media, 'video')) {
|
|
62
|
+
attr(media, 'poster', values.poster || null);
|
|
63
|
+
}
|
|
64
|
+
// Browsers only autoplay muted media, and playsinline keeps an iPhone from
|
|
65
|
+
// playing it full screen
|
|
66
|
+
setFlag(media, 'autoplay', values.autoplay);
|
|
67
|
+
setFlag(media, 'muted', values.autoplay || values.muted);
|
|
68
|
+
setFlag(media, 'loop', values.loop);
|
|
69
|
+
setFlag(media, 'controls', values.controls || !values.autoplay);
|
|
70
|
+
if (values.autoplay && Dom.isTag(media, 'video')) {
|
|
71
|
+
setFlag(media, 'playsinline', true);
|
|
72
|
+
}
|
|
73
|
+
}
|
package/esm/types/types.d.ts
CHANGED
|
@@ -193,7 +193,7 @@ export type ImageHAlign = 'normal' | 'left' | 'right' | 'center' | '';
|
|
|
193
193
|
*/
|
|
194
194
|
export type HAlignClasses = Partial<Record<Exclude<ImageHAlign, ''>, string | string[]>>;
|
|
195
195
|
/**
|
|
196
|
-
*
|
|
196
|
+
* @deprecated Use `HAlignClasses`
|
|
197
197
|
*/
|
|
198
198
|
export type ImageAlignClasses = HAlignClasses;
|
|
199
199
|
/**
|
package/package.json
CHANGED
package/types/config.d.ts
CHANGED
|
@@ -26,7 +26,6 @@ import type { Controls } from "./types/index";
|
|
|
26
26
|
import type { HAlignClasses } from "./types/index";
|
|
27
27
|
import type { IAsyncStorageOptions } from "./types/index";
|
|
28
28
|
import type { IExtraPlugin } from "./types/index";
|
|
29
|
-
import type { ImageAlignClasses } from "./types/index";
|
|
30
29
|
import type { ImageHAlign } from "./types/index";
|
|
31
30
|
import type { IUIButtonState } from "./types/index";
|
|
32
31
|
import type { IViewOptions } from "./types/index";
|
|
@@ -642,29 +641,19 @@ declare class Config implements IViewOptions {
|
|
|
642
641
|
*/
|
|
643
642
|
imageDefaultAlign: ImageHAlign;
|
|
644
643
|
/**
|
|
645
|
-
*
|
|
646
|
-
* `
|
|
647
|
-
* chosen alignment's, which can be several separated by spaces. An
|
|
648
|
-
* alignment can also list several such sets, to recognise each of them;
|
|
649
|
-
* aligning writes the first. `alignClasses.img` takes its place when set.
|
|
650
|
-
*
|
|
651
|
-
* ```javascript
|
|
652
|
-
* Jodit.make('#editor', {
|
|
653
|
-
* imageAlignClasses: {
|
|
654
|
-
* left: 'align-left',
|
|
655
|
-
* right: 'align-right',
|
|
656
|
-
* center: ['align-center', 'centered']
|
|
657
|
-
* }
|
|
658
|
-
* });
|
|
659
|
-
* ```
|
|
644
|
+
* @deprecated Use `alignClasses.img`, which takes the same value. When
|
|
645
|
+
* `alignClasses.img` isn't set, the editor copies this into it.
|
|
660
646
|
*/
|
|
661
|
-
imageAlignClasses: Nullable<
|
|
647
|
+
imageAlignClasses: Nullable<HAlignClasses>;
|
|
662
648
|
/**
|
|
663
|
-
* Class names to align elements with, by tag name,
|
|
664
|
-
*
|
|
665
|
-
* popup.
|
|
666
|
-
*
|
|
667
|
-
*
|
|
649
|
+
* Class names to align elements with, by tag name, instead of an inline
|
|
650
|
+
* `float` or `margin`: `img`, and `video`, `audio` and `iframe` in the
|
|
651
|
+
* media popup. Aligning an element removes every class listed for its tag
|
|
652
|
+
* and adds the chosen alignment's, which can be several separated by
|
|
653
|
+
* spaces. An alignment can also list several such sets, to recognise each
|
|
654
|
+
* of them; aligning writes the first. A media wrapper (see
|
|
655
|
+
* `mediaWrappers`), and Jodit's own `jodit` and `jodit-media` wrappers,
|
|
656
|
+
* are aligned with the classes for the media in them.
|
|
668
657
|
*
|
|
669
658
|
* ```javascript
|
|
670
659
|
* const media = {
|
|
@@ -674,7 +663,15 @@ declare class Config implements IViewOptions {
|
|
|
674
663
|
* };
|
|
675
664
|
*
|
|
676
665
|
* Jodit.make('#editor', {
|
|
677
|
-
* alignClasses: {
|
|
666
|
+
* alignClasses: {
|
|
667
|
+
* img: {
|
|
668
|
+
* left: 'align-left',
|
|
669
|
+
* right: 'align-right',
|
|
670
|
+
* center: ['align-center', 'centered']
|
|
671
|
+
* },
|
|
672
|
+
* video: media,
|
|
673
|
+
* iframe: media
|
|
674
|
+
* }
|
|
678
675
|
* });
|
|
679
676
|
* ```
|
|
680
677
|
*/
|
|
@@ -1407,6 +1404,9 @@ interface Config {
|
|
|
1407
1404
|
iframeDoctype: string;
|
|
1408
1405
|
/**
|
|
1409
1406
|
* Custom style to be used inside the iframe to display content.
|
|
1407
|
+
* It goes in after `iframeCSSLinks`. The rules Jodit's own plugins need
|
|
1408
|
+
* in the editing document are added apart from it, so a value of your
|
|
1409
|
+
* own doesn't have to repeat them.
|
|
1410
1410
|
*
|
|
1411
1411
|
* ```javascript
|
|
1412
1412
|
* Jodit.make('#editor', {
|
|
@@ -1759,7 +1759,7 @@ interface Config {
|
|
|
1759
1759
|
}
|
|
1760
1760
|
interface Config {
|
|
1761
1761
|
/**
|
|
1762
|
-
* Set of HTML tag names whose elements can be resized by the user via drag handles (e.g. images, iframes, tables)
|
|
1762
|
+
* Set of HTML tag names whose elements can be resized by the user via drag handles (e.g. images, iframes, tables, videos)
|
|
1763
1763
|
*/
|
|
1764
1764
|
allowResizeTags: Set<HTMLTagNames>;
|
|
1765
1765
|
resizer: {
|
|
@@ -1772,14 +1772,16 @@ interface Config {
|
|
|
1772
1772
|
* Save width and height proportions when resizing
|
|
1773
1773
|
* ```js
|
|
1774
1774
|
* Jodit.make('#editor', {
|
|
1775
|
-
* allowResizeTags: ['img', 'iframe', 'table', 'jodit'],
|
|
1775
|
+
* allowResizeTags: new Set(['img', 'iframe', 'table', 'jodit', 'video']),
|
|
1776
1776
|
* resizer: {
|
|
1777
1777
|
* useAspectRatio: false, // don't save,
|
|
1778
|
-
* useAspectRatio: ['img'], // save only for images
|
|
1778
|
+
* useAspectRatio: new Set(['img']), // save only for images
|
|
1779
1779
|
* useAspectRatio: true // save for all
|
|
1780
1780
|
* }
|
|
1781
1781
|
* });
|
|
1782
1782
|
* ```
|
|
1783
|
+
* Images and videos keep it by default. A video with no height of its
|
|
1784
|
+
* own keeps it by being given only a width.
|
|
1783
1785
|
*/
|
|
1784
1786
|
useAspectRatio: boolean | Set<HTMLTagNames>;
|
|
1785
1787
|
/**
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
* A Word list paragraph, read before its `mso-list` style is lost
|
|
8
|
+
*/
|
|
9
|
+
export interface WordListItem {
|
|
10
|
+
paragraph: HTMLElement;
|
|
11
|
+
list: string;
|
|
12
|
+
level: number;
|
|
13
|
+
tag: 'ul' | 'ol';
|
|
14
|
+
listStyleType: string | null;
|
|
15
|
+
start: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Finds Word's list paragraphs (`<p style="mso-list:l0 level1 lfo1">`), reads
|
|
19
|
+
* their list, level and type from the `mso-list:Ignore` marker, and removes the
|
|
20
|
+
* marker. Call it before anything strips the `mso-list` styles, then pass the
|
|
21
|
+
* result to {@link wrapWordListItems}
|
|
22
|
+
*/
|
|
23
|
+
export declare function readWordListItems(root: HTMLElement): WordListItem[];
|
|
24
|
+
/**
|
|
25
|
+
* Turns the paragraphs found by {@link readWordListItems} into `<ul>`/`<ol>`
|
|
26
|
+
* lists, nesting them by level. Each paragraph becomes an `<li>` without Word's
|
|
27
|
+
* hanging indent
|
|
28
|
+
*/
|
|
29
|
+
export declare function wrapWordListItems(items: WordListItem[]): void;
|
|
@@ -10,7 +10,7 @@ import type { HAlignClasses, IJodit, ImageHAlign, Nullable } from "../../../type
|
|
|
10
10
|
/**
|
|
11
11
|
* The class names to align `elm` with: `alignClasses` for its tag, or for the
|
|
12
12
|
* media in it when it wraps media (a `mediaWrappers` wrapper, `jodit` or
|
|
13
|
-
* `jodit-media`)
|
|
13
|
+
* `jodit-media`)
|
|
14
14
|
*/
|
|
15
15
|
export declare function getAlignClasses(jodit: IJodit, elm: Nullable<HTMLElement>): Nullable<HAlignClasses>;
|
|
16
16
|
/**
|
|
@@ -0,0 +1,15 @@
|
|
|
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 selection
|
|
8
|
+
*/
|
|
9
|
+
import type { IJodit, Nullable } from "../../../types/index";
|
|
10
|
+
/**
|
|
11
|
+
* Whether the selection, `before` as it was when a key went down, has since
|
|
12
|
+
* moved to somewhere else in the editor
|
|
13
|
+
* @private
|
|
14
|
+
*/
|
|
15
|
+
export declare function isMoved(jodit: IJodit, before: Nullable<Range>): boolean;
|
package/types/langs/ar.d.ts
CHANGED
|
@@ -213,5 +213,15 @@ declare const _exports: {
|
|
|
213
213
|
spellcheck: string;
|
|
214
214
|
'Speech Recognize': string;
|
|
215
215
|
All: string;
|
|
216
|
+
'Video properties': string;
|
|
217
|
+
'Audio properties': string;
|
|
218
|
+
Poster: string;
|
|
219
|
+
Autoplay: string;
|
|
220
|
+
Loop: string;
|
|
221
|
+
Muted: string;
|
|
222
|
+
Controls: string;
|
|
223
|
+
'Start at...': string;
|
|
224
|
+
'Start numbering at': string;
|
|
225
|
+
'Number for the first item': string;
|
|
216
226
|
};
|
|
217
227
|
export = _exports;
|
package/types/langs/az.d.ts
CHANGED
|
@@ -219,5 +219,15 @@ declare const _exports: {
|
|
|
219
219
|
'Insert className': string;
|
|
220
220
|
'Press Alt for custom resizing': string;
|
|
221
221
|
'License: %s': string;
|
|
222
|
+
'Video properties': string;
|
|
223
|
+
'Audio properties': string;
|
|
224
|
+
Poster: string;
|
|
225
|
+
Autoplay: string;
|
|
226
|
+
Loop: string;
|
|
227
|
+
Muted: string;
|
|
228
|
+
Controls: string;
|
|
229
|
+
'Start at...': string;
|
|
230
|
+
'Start numbering at': string;
|
|
231
|
+
'Number for the first item': string;
|
|
222
232
|
};
|
|
223
233
|
export = _exports;
|
package/types/langs/cs_cz.d.ts
CHANGED
|
@@ -211,5 +211,15 @@ declare const _exports: {
|
|
|
211
211
|
'Find Next': string;
|
|
212
212
|
'Insert className': string;
|
|
213
213
|
'Press Alt for custom resizing': string;
|
|
214
|
+
'Video properties': string;
|
|
215
|
+
'Audio properties': string;
|
|
216
|
+
Poster: string;
|
|
217
|
+
Autoplay: string;
|
|
218
|
+
Loop: string;
|
|
219
|
+
Muted: string;
|
|
220
|
+
Controls: string;
|
|
221
|
+
'Start at...': string;
|
|
222
|
+
'Start numbering at': string;
|
|
223
|
+
'Number for the first item': string;
|
|
214
224
|
};
|
|
215
225
|
export = _exports;
|
package/types/langs/de.d.ts
CHANGED
|
@@ -215,5 +215,15 @@ declare const _exports: {
|
|
|
215
215
|
'Insert className': string;
|
|
216
216
|
'Press Alt for custom resizing': string;
|
|
217
217
|
'License: %s': string;
|
|
218
|
+
'Video properties': string;
|
|
219
|
+
'Audio properties': string;
|
|
220
|
+
Poster: string;
|
|
221
|
+
Autoplay: string;
|
|
222
|
+
Loop: string;
|
|
223
|
+
Muted: string;
|
|
224
|
+
Controls: string;
|
|
225
|
+
'Start at...': string;
|
|
226
|
+
'Start numbering at': string;
|
|
227
|
+
'Number for the first item': string;
|
|
218
228
|
};
|
|
219
229
|
export = _exports;
|
package/types/langs/es.d.ts
CHANGED
|
@@ -215,5 +215,15 @@ declare const _exports: {
|
|
|
215
215
|
'Insert className': string;
|
|
216
216
|
'Press Alt for custom resizing': string;
|
|
217
217
|
'License: %s': string;
|
|
218
|
+
'Video properties': string;
|
|
219
|
+
'Audio properties': string;
|
|
220
|
+
Poster: string;
|
|
221
|
+
Autoplay: string;
|
|
222
|
+
Loop: string;
|
|
223
|
+
Muted: string;
|
|
224
|
+
Controls: string;
|
|
225
|
+
'Start at...': string;
|
|
226
|
+
'Start numbering at': string;
|
|
227
|
+
'Number for the first item': string;
|
|
218
228
|
};
|
|
219
229
|
export = _exports;
|
package/types/langs/fa.d.ts
CHANGED
|
@@ -210,5 +210,15 @@ declare const _exports: {
|
|
|
210
210
|
'Insert className': string;
|
|
211
211
|
'Press Alt for custom resizing': string;
|
|
212
212
|
'License: %s': string;
|
|
213
|
+
'Video properties': string;
|
|
214
|
+
'Audio properties': string;
|
|
215
|
+
Poster: string;
|
|
216
|
+
Autoplay: string;
|
|
217
|
+
Loop: string;
|
|
218
|
+
Muted: string;
|
|
219
|
+
Controls: string;
|
|
220
|
+
'Start at...': string;
|
|
221
|
+
'Start numbering at': string;
|
|
222
|
+
'Number for the first item': string;
|
|
213
223
|
};
|
|
214
224
|
export = _exports;
|
package/types/langs/fi.d.ts
CHANGED
|
@@ -216,5 +216,15 @@ declare const _exports: {
|
|
|
216
216
|
'Press Alt for custom resizing': string;
|
|
217
217
|
'Class name': string;
|
|
218
218
|
'License: %s': string;
|
|
219
|
+
'Video properties': string;
|
|
220
|
+
'Audio properties': string;
|
|
221
|
+
Poster: string;
|
|
222
|
+
Autoplay: string;
|
|
223
|
+
Loop: string;
|
|
224
|
+
Muted: string;
|
|
225
|
+
Controls: string;
|
|
226
|
+
'Start at...': string;
|
|
227
|
+
'Start numbering at': string;
|
|
228
|
+
'Number for the first item': string;
|
|
219
229
|
};
|
|
220
230
|
export = _exports;
|
package/types/langs/fr.d.ts
CHANGED
|
@@ -210,5 +210,15 @@ declare const _exports: {
|
|
|
210
210
|
Edit: string;
|
|
211
211
|
All: string;
|
|
212
212
|
'License: %s': string;
|
|
213
|
+
'Video properties': string;
|
|
214
|
+
'Audio properties': string;
|
|
215
|
+
Poster: string;
|
|
216
|
+
Autoplay: string;
|
|
217
|
+
Loop: string;
|
|
218
|
+
Muted: string;
|
|
219
|
+
Controls: string;
|
|
220
|
+
'Start at...': string;
|
|
221
|
+
'Start numbering at': string;
|
|
222
|
+
'Number for the first item': string;
|
|
213
223
|
};
|
|
214
224
|
export = _exports;
|
package/types/langs/he.d.ts
CHANGED
|
@@ -210,5 +210,15 @@ declare const _exports: {
|
|
|
210
210
|
'Insert className': string;
|
|
211
211
|
'Press Alt for custom resizing': string;
|
|
212
212
|
'License: %s': string;
|
|
213
|
+
'Video properties': string;
|
|
214
|
+
'Audio properties': string;
|
|
215
|
+
Poster: string;
|
|
216
|
+
Autoplay: string;
|
|
217
|
+
Loop: string;
|
|
218
|
+
Muted: string;
|
|
219
|
+
Controls: string;
|
|
220
|
+
'Start at...': string;
|
|
221
|
+
'Start numbering at': string;
|
|
222
|
+
'Number for the first item': string;
|
|
213
223
|
};
|
|
214
224
|
export = _exports;
|
package/types/langs/hu.d.ts
CHANGED
|
@@ -212,5 +212,15 @@ declare const _exports: {
|
|
|
212
212
|
'Insert className': string;
|
|
213
213
|
'Press Alt for custom resizing': string;
|
|
214
214
|
'License: %s': string;
|
|
215
|
+
'Video properties': string;
|
|
216
|
+
'Audio properties': string;
|
|
217
|
+
Poster: string;
|
|
218
|
+
Autoplay: string;
|
|
219
|
+
Loop: string;
|
|
220
|
+
Muted: string;
|
|
221
|
+
Controls: string;
|
|
222
|
+
'Start at...': string;
|
|
223
|
+
'Start numbering at': string;
|
|
224
|
+
'Number for the first item': string;
|
|
215
225
|
};
|
|
216
226
|
export = _exports;
|
package/types/langs/id.d.ts
CHANGED
|
@@ -211,5 +211,15 @@ declare const _exports: {
|
|
|
211
211
|
'Find Next': string;
|
|
212
212
|
'Insert className': string;
|
|
213
213
|
'Press Alt for custom resizing': string;
|
|
214
|
+
'Video properties': string;
|
|
215
|
+
'Audio properties': string;
|
|
216
|
+
Poster: string;
|
|
217
|
+
Autoplay: string;
|
|
218
|
+
Loop: string;
|
|
219
|
+
Muted: string;
|
|
220
|
+
Controls: string;
|
|
221
|
+
'Start at...': string;
|
|
222
|
+
'Start numbering at': string;
|
|
223
|
+
'Number for the first item': string;
|
|
214
224
|
};
|
|
215
225
|
export = _exports;
|
package/types/langs/it.d.ts
CHANGED
|
@@ -215,5 +215,15 @@ declare const _exports: {
|
|
|
215
215
|
'Insert className': string;
|
|
216
216
|
'Press Alt for custom resizing': string;
|
|
217
217
|
'License: %s': string;
|
|
218
|
+
'Video properties': string;
|
|
219
|
+
'Audio properties': string;
|
|
220
|
+
Poster: string;
|
|
221
|
+
Autoplay: string;
|
|
222
|
+
Loop: string;
|
|
223
|
+
Muted: string;
|
|
224
|
+
Controls: string;
|
|
225
|
+
'Start at...': string;
|
|
226
|
+
'Start numbering at': string;
|
|
227
|
+
'Number for the first item': string;
|
|
218
228
|
};
|
|
219
229
|
export = _exports;
|