jodit 4.2.40 → 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 +38 -5
- package/es2015/jodit.css +1 -1
- package/es2015/jodit.fat.min.js +2 -2
- package/es2015/jodit.js +39 -22
- package/es2015/jodit.min.js +2 -2
- 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.css +1 -1
- package/es2018/jodit.fat.min.js +2 -2
- package/es2018/jodit.js +39 -22
- package/es2018/jodit.min.js +2 -2
- package/es2018/plugins/debug/debug.css +1 -1
- package/es2018/plugins/debug/debug.js +1 -1
- package/es2018/plugins/debug/debug.min.js +1 -1
- 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 +1 -1
- package/es2021/jodit.fat.min.js +2 -2
- package/es2021/jodit.js +39 -22
- package/es2021/jodit.min.js +2 -2
- 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 +2 -2
- package/es2021.en/jodit.js +39 -22
- package/es2021.en/jodit.min.js +2 -2
- 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/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 +2 -2
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +40 -24
- 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/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/plugins/clean-html/config.d.ts +9 -0
- 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/plugins/clean-html/config.d.ts +9 -0
- package/types/plugins/video/config.d.ts +29 -0
- package/types/plugins/wrap-nodes/config.d.ts +5 -1
package/es2018/jodit.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
|
|
3
3
|
* Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
|
|
4
|
-
* Version: v4.2.
|
|
4
|
+
* Version: v4.2.41
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
@@ -1735,7 +1735,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1735
1735
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
1736
1736
|
* Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
1737
1737
|
*/
|
|
1738
|
-
const APP_VERSION = "4.2.
|
|
1738
|
+
const APP_VERSION = "4.2.41";
|
|
1739
1739
|
// prettier-ignore
|
|
1740
1740
|
const ES = "es2018";
|
|
1741
1741
|
const IS_ES_MODERN = true;
|
|
@@ -7689,11 +7689,12 @@ function ConfigFlatten(obj) {
|
|
|
7689
7689
|
/**
|
|
7690
7690
|
* Javascript url pattern converter replace youtube/vimeo url in embed code.
|
|
7691
7691
|
*/
|
|
7692
|
-
const convertMediaUrlToVideoEmbed = (url, width = 400, height = 345) => {
|
|
7692
|
+
const convertMediaUrlToVideoEmbed = (url, { width = 400, height = 345 } = {}) => {
|
|
7693
7693
|
if (!(0,jodit_core_helpers_checker_is_url__WEBPACK_IMPORTED_MODULE_1__/* .isURL */ .m)(url)) {
|
|
7694
7694
|
return url;
|
|
7695
7695
|
}
|
|
7696
|
-
const parser = jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalDocument.createElement('a')
|
|
7696
|
+
const parser = jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalDocument.createElement('a');
|
|
7697
|
+
const pattern1 = /(?:http?s?:\/\/)?(?:www\.)?(?:vimeo\.com)\/?(.+)/g;
|
|
7697
7698
|
parser.href = url;
|
|
7698
7699
|
if (!width) {
|
|
7699
7700
|
width = 400;
|
|
@@ -7720,7 +7721,10 @@ const convertMediaUrlToVideoEmbed = (url, width = 400, height = 345) => {
|
|
|
7720
7721
|
case 'www.youtu.be': {
|
|
7721
7722
|
const query = parser.search
|
|
7722
7723
|
? (0,_parse_query__WEBPACK_IMPORTED_MODULE_2__/* .parseQuery */ .m)(parser.search)
|
|
7723
|
-
: { v: parser.pathname.
|
|
7724
|
+
: { v: parser.pathname.substring(1) };
|
|
7725
|
+
if (/^embed\/.*/.test(query.v)) {
|
|
7726
|
+
query.v = query.v.substring(6);
|
|
7727
|
+
}
|
|
7724
7728
|
return query.v
|
|
7725
7729
|
? '<iframe width="' +
|
|
7726
7730
|
width +
|
|
@@ -34998,13 +35002,17 @@ class link extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_4__/* .Plugin */ .
|
|
|
34998
35002
|
}
|
|
34999
35003
|
}
|
|
35000
35004
|
onProcessPasteLink(ignore, html) {
|
|
35005
|
+
var _a, _b, _c, _d;
|
|
35001
35006
|
const { jodit } = this;
|
|
35002
35007
|
if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.isURL)(html) || !jodit.o.link.processPastedLink) {
|
|
35003
35008
|
return;
|
|
35004
35009
|
}
|
|
35005
35010
|
jodit.e.stopPropagation('processPaste');
|
|
35006
35011
|
if (jodit.o.link.processVideoLink) {
|
|
35007
|
-
const embed = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.
|
|
35012
|
+
const embed = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.call)((_b = (_a = jodit.o.video) === null || _a === void 0 ? void 0 : _a.parseUrlToVideoEmbed) !== null && _b !== void 0 ? _b : jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.convertMediaUrlToVideoEmbed, html, {
|
|
35013
|
+
width: (_c = jodit.o.video) === null || _c === void 0 ? void 0 : _c.defaultWidth,
|
|
35014
|
+
height: (_d = jodit.o.video) === null || _d === void 0 ? void 0 : _d.defaultHeight
|
|
35015
|
+
});
|
|
35008
35016
|
if (embed !== html) {
|
|
35009
35017
|
return jodit.createInside.fromHTML(embed);
|
|
35010
35018
|
}
|
|
@@ -42824,12 +42832,17 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_0__/* .pluginSystem */ .fg.add('table
|
|
|
42824
42832
|
|
|
42825
42833
|
|
|
42826
42834
|
|
|
42835
|
+
jodit_config__WEBPACK_IMPORTED_MODULE_4__/* .Config */ .T.prototype.video = {
|
|
42836
|
+
parseUrlToVideoEmbed: jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.convertMediaUrlToVideoEmbed,
|
|
42837
|
+
defaultWidth: 400,
|
|
42838
|
+
defaultHeight: 345
|
|
42839
|
+
};
|
|
42827
42840
|
jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__/* .Icon */ .I.set('video', (_video_svg__WEBPACK_IMPORTED_MODULE_6___default()));
|
|
42828
42841
|
jodit_config__WEBPACK_IMPORTED_MODULE_4__/* .Config */ .T.prototype.controls.video = {
|
|
42829
|
-
popup: (
|
|
42830
|
-
const formLink = new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIForm */ .XV(
|
|
42831
|
-
new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIBlock */ .Yh(
|
|
42832
|
-
new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIInput */ .tS(
|
|
42842
|
+
popup: (jodit, current, close) => {
|
|
42843
|
+
const formLink = new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIForm */ .XV(jodit, [
|
|
42844
|
+
new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIBlock */ .Yh(jodit, [
|
|
42845
|
+
new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIInput */ .tS(jodit, {
|
|
42833
42846
|
name: 'url',
|
|
42834
42847
|
required: true,
|
|
42835
42848
|
label: 'URL',
|
|
@@ -42837,26 +42850,26 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__/* .Config */ .T.prototype.controls.vid
|
|
|
42837
42850
|
validators: ['url']
|
|
42838
42851
|
})
|
|
42839
42852
|
]),
|
|
42840
|
-
new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIBlock */ .Yh(
|
|
42841
|
-
(0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_1__/* .Button */ .$n)(
|
|
42853
|
+
new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIBlock */ .Yh(jodit, [
|
|
42854
|
+
(0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_1__/* .Button */ .$n)(jodit, '', 'Insert', 'primary').onAction(() => formLink.submit())
|
|
42842
42855
|
])
|
|
42843
|
-
]), formCode = new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIForm */ .XV(
|
|
42844
|
-
new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIBlock */ .Yh(
|
|
42845
|
-
new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UITextArea */ .F0(
|
|
42856
|
+
]), formCode = new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIForm */ .XV(jodit, [
|
|
42857
|
+
new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIBlock */ .Yh(jodit, [
|
|
42858
|
+
new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UITextArea */ .F0(jodit, {
|
|
42846
42859
|
name: 'code',
|
|
42847
42860
|
required: true,
|
|
42848
42861
|
label: 'Embed code'
|
|
42849
42862
|
})
|
|
42850
42863
|
]),
|
|
42851
|
-
new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIBlock */ .Yh(
|
|
42852
|
-
(0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_1__/* .Button */ .$n)(
|
|
42864
|
+
new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIBlock */ .Yh(jodit, [
|
|
42865
|
+
(0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_1__/* .Button */ .$n)(jodit, '', 'Insert', 'primary').onAction(() => formCode.submit())
|
|
42853
42866
|
])
|
|
42854
42867
|
]), tabs = [], insertCode = (code) => {
|
|
42855
|
-
|
|
42856
|
-
|
|
42868
|
+
jodit.s.restore();
|
|
42869
|
+
jodit.s.insertHTML(code);
|
|
42857
42870
|
close();
|
|
42858
42871
|
};
|
|
42859
|
-
|
|
42872
|
+
jodit.s.save();
|
|
42860
42873
|
tabs.push({
|
|
42861
42874
|
icon: 'link',
|
|
42862
42875
|
name: 'Link',
|
|
@@ -42867,12 +42880,16 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__/* .Config */ .T.prototype.controls.vid
|
|
|
42867
42880
|
content: formCode.container
|
|
42868
42881
|
});
|
|
42869
42882
|
formLink.onSubmit(data => {
|
|
42870
|
-
|
|
42883
|
+
var _a, _b, _c, _d;
|
|
42884
|
+
insertCode((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.call)((_b = (_a = jodit.o.video) === null || _a === void 0 ? void 0 : _a.parseUrlToVideoEmbed) !== null && _b !== void 0 ? _b : jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.convertMediaUrlToVideoEmbed, data.url, {
|
|
42885
|
+
width: (_c = jodit.o.video) === null || _c === void 0 ? void 0 : _c.defaultWidth,
|
|
42886
|
+
height: (_d = jodit.o.video) === null || _d === void 0 ? void 0 : _d.defaultHeight
|
|
42887
|
+
}));
|
|
42871
42888
|
});
|
|
42872
42889
|
formCode.onSubmit(data => {
|
|
42873
42890
|
insertCode(data.code);
|
|
42874
42891
|
});
|
|
42875
|
-
return (0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_5__/* .TabsWidget */ .Zg)(
|
|
42892
|
+
return (0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_5__/* .TabsWidget */ .Zg)(jodit, tabs);
|
|
42876
42893
|
},
|
|
42877
42894
|
tags: ['iframe'],
|
|
42878
42895
|
tooltip: 'Insert youtube/vimeo video'
|