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/es2015/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
  */
@@ -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.40";
1738
+ const APP_VERSION = "4.2.41";
1739
1739
  // prettier-ignore
1740
1740
  const ES = "es2015";
1741
1741
  const IS_ES_MODERN = true;
@@ -7691,11 +7691,12 @@ function ConfigFlatten(obj) {
7691
7691
  /**
7692
7692
  * Javascript url pattern converter replace youtube/vimeo url in embed code.
7693
7693
  */
7694
- const convertMediaUrlToVideoEmbed = (url, width = 400, height = 345) => {
7694
+ const convertMediaUrlToVideoEmbed = (url, { width = 400, height = 345 } = {}) => {
7695
7695
  if (!(0,jodit_core_helpers_checker_is_url__WEBPACK_IMPORTED_MODULE_1__/* .isURL */ .m)(url)) {
7696
7696
  return url;
7697
7697
  }
7698
- const parser = jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalDocument.createElement('a'), pattern1 = /(?:http?s?:\/\/)?(?:www\.)?(?:vimeo\.com)\/?(.+)/g;
7698
+ const parser = jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalDocument.createElement('a');
7699
+ const pattern1 = /(?:http?s?:\/\/)?(?:www\.)?(?:vimeo\.com)\/?(.+)/g;
7699
7700
  parser.href = url;
7700
7701
  if (!width) {
7701
7702
  width = 400;
@@ -7722,7 +7723,10 @@ const convertMediaUrlToVideoEmbed = (url, width = 400, height = 345) => {
7722
7723
  case 'www.youtu.be': {
7723
7724
  const query = parser.search
7724
7725
  ? (0,_parse_query__WEBPACK_IMPORTED_MODULE_2__/* .parseQuery */ .m)(parser.search)
7725
- : { v: parser.pathname.substr(1) };
7726
+ : { v: parser.pathname.substring(1) };
7727
+ if (/^embed\/.*/.test(query.v)) {
7728
+ query.v = query.v.substring(6);
7729
+ }
7726
7730
  return query.v
7727
7731
  ? '<iframe width="' +
7728
7732
  width +
@@ -34925,13 +34929,17 @@ class link extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_4__/* .Plugin */ .
34925
34929
  }
34926
34930
  }
34927
34931
  onProcessPasteLink(ignore, html) {
34932
+ var _a, _b, _c, _d;
34928
34933
  const { jodit } = this;
34929
34934
  if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.isURL)(html) || !jodit.o.link.processPastedLink) {
34930
34935
  return;
34931
34936
  }
34932
34937
  jodit.e.stopPropagation('processPaste');
34933
34938
  if (jodit.o.link.processVideoLink) {
34934
- const embed = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.convertMediaUrlToVideoEmbed)(html);
34939
+ 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, {
34940
+ width: (_c = jodit.o.video) === null || _c === void 0 ? void 0 : _c.defaultWidth,
34941
+ height: (_d = jodit.o.video) === null || _d === void 0 ? void 0 : _d.defaultHeight
34942
+ });
34935
34943
  if (embed !== html) {
34936
34944
  return jodit.createInside.fromHTML(embed);
34937
34945
  }
@@ -42769,12 +42777,17 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_0__/* .pluginSystem */ .fg.add('table
42769
42777
 
42770
42778
 
42771
42779
 
42780
+ jodit_config__WEBPACK_IMPORTED_MODULE_4__/* .Config */ .T.prototype.video = {
42781
+ parseUrlToVideoEmbed: jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.convertMediaUrlToVideoEmbed,
42782
+ defaultWidth: 400,
42783
+ defaultHeight: 345
42784
+ };
42772
42785
  jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__/* .Icon */ .I.set('video', (_video_svg__WEBPACK_IMPORTED_MODULE_6___default()));
42773
42786
  jodit_config__WEBPACK_IMPORTED_MODULE_4__/* .Config */ .T.prototype.controls.video = {
42774
- popup: (editor, current, close) => {
42775
- const formLink = new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIForm */ .XV(editor, [
42776
- new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIBlock */ .Yh(editor, [
42777
- new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIInput */ .tS(editor, {
42787
+ popup: (jodit, current, close) => {
42788
+ const formLink = new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIForm */ .XV(jodit, [
42789
+ new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIBlock */ .Yh(jodit, [
42790
+ new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIInput */ .tS(jodit, {
42778
42791
  name: 'url',
42779
42792
  required: true,
42780
42793
  label: 'URL',
@@ -42782,26 +42795,26 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__/* .Config */ .T.prototype.controls.vid
42782
42795
  validators: ['url']
42783
42796
  })
42784
42797
  ]),
42785
- new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIBlock */ .Yh(editor, [
42786
- (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_1__/* .Button */ .$n)(editor, '', 'Insert', 'primary').onAction(() => formLink.submit())
42798
+ new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIBlock */ .Yh(jodit, [
42799
+ (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_1__/* .Button */ .$n)(jodit, '', 'Insert', 'primary').onAction(() => formLink.submit())
42787
42800
  ])
42788
- ]), formCode = new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIForm */ .XV(editor, [
42789
- new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIBlock */ .Yh(editor, [
42790
- new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UITextArea */ .F0(editor, {
42801
+ ]), formCode = new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIForm */ .XV(jodit, [
42802
+ new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIBlock */ .Yh(jodit, [
42803
+ new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UITextArea */ .F0(jodit, {
42791
42804
  name: 'code',
42792
42805
  required: true,
42793
42806
  label: 'Embed code'
42794
42807
  })
42795
42808
  ]),
42796
- new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIBlock */ .Yh(editor, [
42797
- (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_1__/* .Button */ .$n)(editor, '', 'Insert', 'primary').onAction(() => formCode.submit())
42809
+ new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIBlock */ .Yh(jodit, [
42810
+ (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_1__/* .Button */ .$n)(jodit, '', 'Insert', 'primary').onAction(() => formCode.submit())
42798
42811
  ])
42799
42812
  ]), tabs = [], insertCode = (code) => {
42800
- editor.s.restore();
42801
- editor.s.insertHTML(code);
42813
+ jodit.s.restore();
42814
+ jodit.s.insertHTML(code);
42802
42815
  close();
42803
42816
  };
42804
- editor.s.save();
42817
+ jodit.s.save();
42805
42818
  tabs.push({
42806
42819
  icon: 'link',
42807
42820
  name: 'Link',
@@ -42812,12 +42825,16 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__/* .Config */ .T.prototype.controls.vid
42812
42825
  content: formCode.container
42813
42826
  });
42814
42827
  formLink.onSubmit(data => {
42815
- insertCode((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.convertMediaUrlToVideoEmbed)(data.url));
42828
+ var _a, _b, _c, _d;
42829
+ 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, {
42830
+ width: (_c = jodit.o.video) === null || _c === void 0 ? void 0 : _c.defaultWidth,
42831
+ height: (_d = jodit.o.video) === null || _d === void 0 ? void 0 : _d.defaultHeight
42832
+ }));
42816
42833
  });
42817
42834
  formCode.onSubmit(data => {
42818
42835
  insertCode(data.code);
42819
42836
  });
42820
- return (0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_5__/* .TabsWidget */ .Zg)(editor, tabs);
42837
+ return (0,jodit_modules_widget__WEBPACK_IMPORTED_MODULE_5__/* .TabsWidget */ .Zg)(jodit, tabs);
42821
42838
  },
42822
42839
  tags: ['iframe'],
42823
42840
  tooltip: 'Insert youtube/vimeo video'