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
package/es2021/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.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 +
@@ -34900,7 +34904,11 @@ class link extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_4__/* .Plugin */ .
34900
34904
  }
34901
34905
  jodit.e.stopPropagation('processPaste');
34902
34906
  if (jodit.o.link.processVideoLink) {
34903
- const embed = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.convertMediaUrlToVideoEmbed)(html);
34907
+ const embed = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.call)(jodit.o.video?.parseUrlToVideoEmbed ??
34908
+ jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.convertMediaUrlToVideoEmbed, html, {
34909
+ width: jodit.o.video?.defaultWidth,
34910
+ height: jodit.o.video?.defaultHeight
34911
+ });
34904
34912
  if (embed !== html) {
34905
34913
  return jodit.createInside.fromHTML(embed);
34906
34914
  }
@@ -42691,12 +42699,17 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_0__/* .pluginSystem */ .fg.add('table
42691
42699
 
42692
42700
 
42693
42701
 
42702
+ jodit_config__WEBPACK_IMPORTED_MODULE_4__/* .Config */ .T.prototype.video = {
42703
+ parseUrlToVideoEmbed: jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.convertMediaUrlToVideoEmbed,
42704
+ defaultWidth: 400,
42705
+ defaultHeight: 345
42706
+ };
42694
42707
  jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__/* .Icon */ .I.set('video', (_video_svg__WEBPACK_IMPORTED_MODULE_6___default()));
42695
42708
  jodit_config__WEBPACK_IMPORTED_MODULE_4__/* .Config */ .T.prototype.controls.video = {
42696
- popup: (editor, current, close) => {
42697
- const formLink = new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIForm */ .XV(editor, [
42698
- new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIBlock */ .Yh(editor, [
42699
- new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIInput */ .tS(editor, {
42709
+ popup: (jodit, current, close) => {
42710
+ const formLink = new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIForm */ .XV(jodit, [
42711
+ new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIBlock */ .Yh(jodit, [
42712
+ new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIInput */ .tS(jodit, {
42700
42713
  name: 'url',
42701
42714
  required: true,
42702
42715
  label: 'URL',
@@ -42704,26 +42717,26 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__/* .Config */ .T.prototype.controls.vid
42704
42717
  validators: ['url']
42705
42718
  })
42706
42719
  ]),
42707
- new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIBlock */ .Yh(editor, [
42708
- (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_1__/* .Button */ .$n)(editor, '', 'Insert', 'primary').onAction(() => formLink.submit())
42720
+ new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIBlock */ .Yh(jodit, [
42721
+ (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_1__/* .Button */ .$n)(jodit, '', 'Insert', 'primary').onAction(() => formLink.submit())
42709
42722
  ])
42710
- ]), formCode = new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIForm */ .XV(editor, [
42711
- new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIBlock */ .Yh(editor, [
42712
- new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UITextArea */ .F0(editor, {
42723
+ ]), formCode = new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIForm */ .XV(jodit, [
42724
+ new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIBlock */ .Yh(jodit, [
42725
+ new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UITextArea */ .F0(jodit, {
42713
42726
  name: 'code',
42714
42727
  required: true,
42715
42728
  label: 'Embed code'
42716
42729
  })
42717
42730
  ]),
42718
- new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIBlock */ .Yh(editor, [
42719
- (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_1__/* .Button */ .$n)(editor, '', 'Insert', 'primary').onAction(() => formCode.submit())
42731
+ new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIBlock */ .Yh(jodit, [
42732
+ (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_1__/* .Button */ .$n)(jodit, '', 'Insert', 'primary').onAction(() => formCode.submit())
42720
42733
  ])
42721
42734
  ]), tabs = [], insertCode = (code) => {
42722
- editor.s.restore();
42723
- editor.s.insertHTML(code);
42735
+ jodit.s.restore();
42736
+ jodit.s.insertHTML(code);
42724
42737
  close();
42725
42738
  };
42726
- editor.s.save();
42739
+ jodit.s.save();
42727
42740
  tabs.push({
42728
42741
  icon: 'link',
42729
42742
  name: 'Link',
@@ -42734,12 +42747,16 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__/* .Config */ .T.prototype.controls.vid
42734
42747
  content: formCode.container
42735
42748
  });
42736
42749
  formLink.onSubmit(data => {
42737
- insertCode((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.convertMediaUrlToVideoEmbed)(data.url));
42750
+ insertCode((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.call)(jodit.o.video?.parseUrlToVideoEmbed ??
42751
+ jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.convertMediaUrlToVideoEmbed, data.url, {
42752
+ width: jodit.o.video?.defaultWidth,
42753
+ height: jodit.o.video?.defaultHeight
42754
+ }));
42738
42755
  });
42739
42756
  formCode.onSubmit(data => {
42740
42757
  insertCode(data.code);
42741
42758
  });
42742
- return (0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_5__/* .TabsWidget */ .Zg)(editor, tabs);
42759
+ return (0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_5__/* .TabsWidget */ .Zg)(jodit, tabs);
42743
42760
  },
42744
42761
  tags: ['iframe'],
42745
42762
  tooltip: 'Insert youtube/vimeo video'