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.
Files changed (69) hide show
  1. package/CHANGELOG.md +38 -5
  2. package/es2015/jodit.css +1 -1
  3. package/es2015/jodit.fat.min.js +2 -2
  4. package/es2015/jodit.js +39 -22
  5. package/es2015/jodit.min.js +2 -2
  6. package/es2015/plugins/debug/debug.css +1 -1
  7. package/es2015/plugins/debug/debug.js +1 -1
  8. package/es2015/plugins/debug/debug.min.js +1 -1
  9. package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
  10. package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
  11. package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
  12. package/es2018/jodit.css +1 -1
  13. package/es2018/jodit.fat.min.js +2 -2
  14. package/es2018/jodit.js +39 -22
  15. package/es2018/jodit.min.js +2 -2
  16. package/es2018/plugins/debug/debug.css +1 -1
  17. package/es2018/plugins/debug/debug.js +1 -1
  18. package/es2018/plugins/debug/debug.min.js +1 -1
  19. package/es2018/plugins/speech-recognize/speech-recognize.css +1 -1
  20. package/es2018/plugins/speech-recognize/speech-recognize.js +1 -1
  21. package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
  22. package/es2021/jodit.css +1 -1
  23. package/es2021/jodit.fat.min.js +2 -2
  24. package/es2021/jodit.js +39 -22
  25. package/es2021/jodit.min.js +2 -2
  26. package/es2021/plugins/debug/debug.css +1 -1
  27. package/es2021/plugins/debug/debug.js +1 -1
  28. package/es2021/plugins/debug/debug.min.js +1 -1
  29. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  30. package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
  31. package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
  32. package/es2021.en/jodit.css +1 -1
  33. package/es2021.en/jodit.fat.min.js +2 -2
  34. package/es2021.en/jodit.js +39 -22
  35. package/es2021.en/jodit.min.js +2 -2
  36. package/es2021.en/plugins/debug/debug.css +1 -1
  37. package/es2021.en/plugins/debug/debug.js +1 -1
  38. package/es2021.en/plugins/debug/debug.min.js +1 -1
  39. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  40. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
  41. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
  42. package/es5/164.fat.min.js +1 -1
  43. package/es5/164.min.js +1 -1
  44. package/es5/5.fat.min.js +1 -1
  45. package/es5/5.min.js +1 -1
  46. package/es5/jodit.css +2 -2
  47. package/es5/jodit.fat.min.js +2 -2
  48. package/es5/jodit.js +40 -24
  49. package/es5/jodit.min.css +2 -2
  50. package/es5/jodit.min.js +2 -2
  51. package/es5/plugins/debug/debug.css +1 -1
  52. package/es5/plugins/debug/debug.js +1 -1
  53. package/es5/plugins/debug/debug.min.js +1 -1
  54. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  55. package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
  56. package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
  57. package/esm/core/constants.js +1 -1
  58. package/esm/core/helpers/utils/convert-media-url-to-video-embed.d.ts +4 -1
  59. package/esm/core/helpers/utils/convert-media-url-to-video-embed.js +7 -3
  60. package/esm/plugins/clean-html/config.d.ts +9 -0
  61. package/esm/plugins/link/link.js +6 -2
  62. package/esm/plugins/video/config.d.ts +29 -0
  63. package/esm/plugins/video/config.js +26 -17
  64. package/esm/plugins/wrap-nodes/config.d.ts +5 -1
  65. package/package.json +1 -1
  66. package/types/core/helpers/utils/convert-media-url-to-video-embed.d.ts +4 -1
  67. package/types/plugins/clean-html/config.d.ts +9 -0
  68. package/types/plugins/video/config.d.ts +29 -0
  69. package/types/plugins/wrap-nodes/config.d.ts +5 -1
@@ -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.40
4
+ * Version: v4.2.41
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1736,7 +1736,7 @@ __webpack_require__.r(__webpack_exports__);
1736
1736
  * Released under MIT see LICENSE.txt in the project root for license information.
1737
1737
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
1738
1738
  */
1739
- const APP_VERSION = "4.2.40";
1739
+ const APP_VERSION = "4.2.41";
1740
1740
  // prettier-ignore
1741
1741
  const ES = "es2021";
1742
1742
  const IS_ES_MODERN = true;
@@ -7672,11 +7672,12 @@ function ConfigFlatten(obj) {
7672
7672
  /**
7673
7673
  * Javascript url pattern converter replace youtube/vimeo url in embed code.
7674
7674
  */
7675
- const convertMediaUrlToVideoEmbed = (url, width = 400, height = 345) => {
7675
+ const convertMediaUrlToVideoEmbed = (url, { width = 400, height = 345 } = {}) => {
7676
7676
  if (!(0,jodit_core_helpers_checker_is_url__WEBPACK_IMPORTED_MODULE_1__/* .isURL */ .m)(url)) {
7677
7677
  return url;
7678
7678
  }
7679
- const parser = jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalDocument.createElement('a'), pattern1 = /(?:http?s?:\/\/)?(?:www\.)?(?:vimeo\.com)\/?(.+)/g;
7679
+ const parser = jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalDocument.createElement('a');
7680
+ const pattern1 = /(?:http?s?:\/\/)?(?:www\.)?(?:vimeo\.com)\/?(.+)/g;
7680
7681
  parser.href = url;
7681
7682
  if (!width) {
7682
7683
  width = 400;
@@ -7703,7 +7704,10 @@ const convertMediaUrlToVideoEmbed = (url, width = 400, height = 345) => {
7703
7704
  case 'www.youtu.be': {
7704
7705
  const query = parser.search
7705
7706
  ? (0,_parse_query__WEBPACK_IMPORTED_MODULE_2__/* .parseQuery */ .m)(parser.search)
7706
- : { v: parser.pathname.substr(1) };
7707
+ : { v: parser.pathname.substring(1) };
7708
+ if (/^embed\/.*/.test(query.v)) {
7709
+ query.v = query.v.substring(6);
7710
+ }
7707
7711
  return query.v
7708
7712
  ? '<iframe width="' +
7709
7713
  width +
@@ -34015,7 +34019,11 @@ class link extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_4__/* .Plugin */ .
34015
34019
  }
34016
34020
  jodit.e.stopPropagation('processPaste');
34017
34021
  if (jodit.o.link.processVideoLink) {
34018
- const embed = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.convertMediaUrlToVideoEmbed)(html);
34022
+ const embed = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.call)(jodit.o.video?.parseUrlToVideoEmbed ??
34023
+ jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.convertMediaUrlToVideoEmbed, html, {
34024
+ width: jodit.o.video?.defaultWidth,
34025
+ height: jodit.o.video?.defaultHeight
34026
+ });
34019
34027
  if (embed !== html) {
34020
34028
  return jodit.createInside.fromHTML(embed);
34021
34029
  }
@@ -40974,12 +40982,17 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_0__/* .pluginSystem */ .fg.add('table
40974
40982
 
40975
40983
 
40976
40984
 
40985
+ jodit_config__WEBPACK_IMPORTED_MODULE_4__/* .Config */ .T.prototype.video = {
40986
+ parseUrlToVideoEmbed: jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.convertMediaUrlToVideoEmbed,
40987
+ defaultWidth: 400,
40988
+ defaultHeight: 345
40989
+ };
40977
40990
  jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__/* .Icon */ .I.set('video', (_video_svg__WEBPACK_IMPORTED_MODULE_6___default()));
40978
40991
  jodit_config__WEBPACK_IMPORTED_MODULE_4__/* .Config */ .T.prototype.controls.video = {
40979
- popup: (editor, current, close) => {
40980
- const formLink = new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIForm */ .XV(editor, [
40981
- new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIBlock */ .Yh(editor, [
40982
- new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIInput */ .tS(editor, {
40992
+ popup: (jodit, current, close) => {
40993
+ const formLink = new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIForm */ .XV(jodit, [
40994
+ new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIBlock */ .Yh(jodit, [
40995
+ new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIInput */ .tS(jodit, {
40983
40996
  name: 'url',
40984
40997
  required: true,
40985
40998
  label: 'URL',
@@ -40987,26 +41000,26 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__/* .Config */ .T.prototype.controls.vid
40987
41000
  validators: ['url']
40988
41001
  })
40989
41002
  ]),
40990
- new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIBlock */ .Yh(editor, [
40991
- (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_1__/* .Button */ .$n)(editor, '', 'Insert', 'primary').onAction(() => formLink.submit())
41003
+ new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIBlock */ .Yh(jodit, [
41004
+ (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_1__/* .Button */ .$n)(jodit, '', 'Insert', 'primary').onAction(() => formLink.submit())
40992
41005
  ])
40993
- ]), formCode = new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIForm */ .XV(editor, [
40994
- new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIBlock */ .Yh(editor, [
40995
- new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UITextArea */ .F0(editor, {
41006
+ ]), formCode = new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIForm */ .XV(jodit, [
41007
+ new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIBlock */ .Yh(jodit, [
41008
+ new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UITextArea */ .F0(jodit, {
40996
41009
  name: 'code',
40997
41010
  required: true,
40998
41011
  label: 'Embed code'
40999
41012
  })
41000
41013
  ]),
41001
- new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIBlock */ .Yh(editor, [
41002
- (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_1__/* .Button */ .$n)(editor, '', 'Insert', 'primary').onAction(() => formCode.submit())
41014
+ new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIBlock */ .Yh(jodit, [
41015
+ (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_1__/* .Button */ .$n)(jodit, '', 'Insert', 'primary').onAction(() => formCode.submit())
41003
41016
  ])
41004
41017
  ]), tabs = [], insertCode = (code) => {
41005
- editor.s.restore();
41006
- editor.s.insertHTML(code);
41018
+ jodit.s.restore();
41019
+ jodit.s.insertHTML(code);
41007
41020
  close();
41008
41021
  };
41009
- editor.s.save();
41022
+ jodit.s.save();
41010
41023
  tabs.push({
41011
41024
  icon: 'link',
41012
41025
  name: 'Link',
@@ -41017,12 +41030,16 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__/* .Config */ .T.prototype.controls.vid
41017
41030
  content: formCode.container
41018
41031
  });
41019
41032
  formLink.onSubmit(data => {
41020
- insertCode((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.convertMediaUrlToVideoEmbed)(data.url));
41033
+ insertCode((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.call)(jodit.o.video?.parseUrlToVideoEmbed ??
41034
+ jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.convertMediaUrlToVideoEmbed, data.url, {
41035
+ width: jodit.o.video?.defaultWidth,
41036
+ height: jodit.o.video?.defaultHeight
41037
+ }));
41021
41038
  });
41022
41039
  formCode.onSubmit(data => {
41023
41040
  insertCode(data.code);
41024
41041
  });
41025
- return (0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_5__/* .TabsWidget */ .Zg)(editor, tabs);
41042
+ return (0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_5__/* .TabsWidget */ .Zg)(jodit, tabs);
41026
41043
  },
41027
41044
  tags: ['iframe'],
41028
41045
  tooltip: 'Insert youtube/vimeo video'