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/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.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 = "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'), pattern1 = /(?:http?s?:\/\/)?(?:www\.)?(?:vimeo\.com)\/?(.+)/g;
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.substr(1) };
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__.convertMediaUrlToVideoEmbed)(html);
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: (editor, current, close) => {
42830
- const formLink = new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIForm */ .XV(editor, [
42831
- new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIBlock */ .Yh(editor, [
42832
- new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIInput */ .tS(editor, {
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(editor, [
42841
- (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_1__/* .Button */ .$n)(editor, '', 'Insert', 'primary').onAction(() => formLink.submit())
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(editor, [
42844
- new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UIBlock */ .Yh(editor, [
42845
- new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_2__/* .UITextArea */ .F0(editor, {
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(editor, [
42852
- (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_1__/* .Button */ .$n)(editor, '', 'Insert', 'primary').onAction(() => formCode.submit())
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
- editor.s.restore();
42856
- editor.s.insertHTML(code);
42868
+ jodit.s.restore();
42869
+ jodit.s.insertHTML(code);
42857
42870
  close();
42858
42871
  };
42859
- editor.s.save();
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
- insertCode((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.convertMediaUrlToVideoEmbed)(data.url));
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)(editor, tabs);
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'