jodit 4.0.1 → 4.0.2

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 (72) hide show
  1. package/CHANGELOG.md +10 -6
  2. package/es2015/jodit.css +5 -7
  3. package/es2015/jodit.fat.min.css +1 -1
  4. package/es2015/jodit.fat.min.js +2 -2
  5. package/es2015/jodit.js +27 -24
  6. package/es2015/jodit.min.css +1 -1
  7. package/es2015/jodit.min.js +2 -2
  8. package/es2015/plugins/debug/debug.js +1 -1
  9. package/es2015/plugins/debug/debug.min.js +1 -1
  10. package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
  11. package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
  12. package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
  13. package/es2018/jodit.css +5 -7
  14. package/es2018/jodit.fat.min.css +1 -1
  15. package/es2018/jodit.fat.min.js +2 -2
  16. package/es2018/jodit.js +27 -24
  17. package/es2018/jodit.min.css +1 -1
  18. package/es2018/jodit.min.js +2 -2
  19. package/es2018/plugins/debug/debug.js +1 -1
  20. package/es2018/plugins/debug/debug.min.js +1 -1
  21. package/es2018/plugins/speech-recognize/speech-recognize.css +1 -1
  22. package/es2018/plugins/speech-recognize/speech-recognize.js +1 -1
  23. package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
  24. package/es2021/jodit.css +5 -7
  25. package/es2021/jodit.fat.min.css +1 -1
  26. package/es2021/jodit.fat.min.js +2 -2
  27. package/es2021/jodit.js +27 -24
  28. package/es2021/jodit.min.css +1 -1
  29. package/es2021/jodit.min.js +2 -2
  30. package/es2021/plugins/debug/debug.js +1 -1
  31. package/es2021/plugins/debug/debug.min.js +1 -1
  32. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  33. package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
  34. package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
  35. package/es2021.en/jodit.css +5 -7
  36. package/es2021.en/jodit.fat.min.css +1 -1
  37. package/es2021.en/jodit.fat.min.js +2 -2
  38. package/es2021.en/jodit.js +27 -24
  39. package/es2021.en/jodit.min.css +1 -1
  40. package/es2021.en/jodit.min.js +2 -2
  41. package/es2021.en/plugins/debug/debug.js +1 -1
  42. package/es2021.en/plugins/debug/debug.min.js +1 -1
  43. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  44. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
  45. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
  46. package/es5/jodit.css +7 -9
  47. package/es5/jodit.fat.min.css +1 -1
  48. package/es5/jodit.fat.min.js +2 -2
  49. package/es5/jodit.js +28 -23
  50. package/es5/jodit.min.css +3 -3
  51. package/es5/jodit.min.js +2 -2
  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/ui/popup/popup.js +5 -4
  59. package/esm/modules/context-menu/context-menu.js +5 -3
  60. package/esm/modules/dialog/dialog.js +5 -3
  61. package/esm/modules/file-browser/builders/context-menu.js +3 -1
  62. package/esm/modules/file-browser/data-provider.js +6 -6
  63. package/esm/modules/file-browser/file-browser.js +1 -5
  64. package/esm/modules/toolbar/button/button.d.ts +1 -1
  65. package/esm/plugins/inline-popup/config/items/a.d.ts +1 -1
  66. package/esm/plugins/inline-popup/config/items/cells.d.ts +1 -1
  67. package/esm/plugins/inline-popup/config/items/img.d.ts +1 -1
  68. package/package.json +1 -1
  69. package/types/modules/toolbar/button/button.d.ts +1 -1
  70. package/types/plugins/inline-popup/config/items/a.d.ts +1 -1
  71. package/types/plugins/inline-popup/config/items/cells.d.ts +1 -1
  72. package/types/plugins/inline-popup/config/items/img.d.ts +1 -1
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.0.1
4
+ * Version: v4.0.2
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1692,7 +1692,7 @@ __webpack_require__.r(__webpack_exports__);
1692
1692
  * Released under MIT see LICENSE.txt in the project root for license information.
1693
1693
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
1694
1694
  */
1695
- const APP_VERSION = "4.0.1";
1695
+ const APP_VERSION = "4.0.2";
1696
1696
  // prettier-ignore
1697
1697
  const ES = "es2021";
1698
1698
  const IS_ES_MODERN = true;
@@ -15472,10 +15472,11 @@ class Popup extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_3__/* .UI
15472
15472
  .off(this.container, 'scroll mousewheel', up)
15473
15473
  .off(ow, 'scroll', up)
15474
15474
  .off(ow, 'resize', up);
15475
- void 0;
15476
- jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .i.up(this.j.container, box => {
15477
- box && this.j.e.off(box, 'scroll mousewheel', up);
15478
- });
15475
+ if (this.j.container.isConnected) {
15476
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .i.up(this.j.container, box => {
15477
+ box && this.j.e.off(box, 'scroll mousewheel', up);
15478
+ });
15479
+ }
15479
15480
  }
15480
15481
  /**
15481
15482
  * Set ZIndex
@@ -17457,7 +17458,8 @@ let ContextMenu = class ContextMenu extends jodit_core_ui_popup__WEBPACK_IMPORTE
17457
17458
  * ```
17458
17459
  */
17459
17460
  show(x, y, actions) {
17460
- const self = this, content = this.j.c.div(this.getFullElName('actions'));
17461
+ const self = this;
17462
+ self.clear();
17461
17463
  if (!(0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_2__/* .isArray */ .kJ)(actions)) {
17462
17464
  return;
17463
17465
  }
@@ -17470,12 +17472,13 @@ let ContextMenu = class ContextMenu extends jodit_core_ui_popup__WEBPACK_IMPORTE
17470
17472
  action.setMod('context', 'menu');
17471
17473
  action.onAction((e) => {
17472
17474
  item.exec?.call(self, e);
17475
+ self.clear();
17473
17476
  self.close();
17474
17477
  return false;
17475
17478
  });
17476
- content.appendChild(action.container);
17479
+ this.append(action);
17477
17480
  });
17478
- this.setContent(content).open(() => ({ left: x, top: y, width: 0, height: 0 }), true);
17481
+ this.open(() => ({ left: x, top: y, width: 0, height: 0 }), true);
17479
17482
  }
17480
17483
  };
17481
17484
  ContextMenu = (0,tslib__WEBPACK_IMPORTED_MODULE_3__/* .__decorate */ .gn)([
@@ -18066,10 +18069,12 @@ let Dialog = Dialog_1 = class Dialog extends jodit_core_view_view_with_toolbar__
18066
18069
  this.getMod('static') === true) {
18067
18070
  return this;
18068
18071
  }
18072
+ const { e } = this;
18069
18073
  /**
18070
18074
  * Called up to close the window
18071
18075
  */
18072
- if (this.e.fire('beforeClose', this) === false) {
18076
+ if (e.fire(this, 'beforeClose') === false ||
18077
+ e.fire('beforeClose', this) === false) {
18073
18078
  return this;
18074
18079
  }
18075
18080
  this.setMod('active', false);
@@ -18082,8 +18087,8 @@ let Dialog = Dialog_1 = class Dialog extends jodit_core_view_view_with_toolbar__
18082
18087
  /**
18083
18088
  * It called after the window is closed
18084
18089
  */
18085
- this.e.fire(this, 'afterClose');
18086
- this.e.fire(this.ow, 'joditCloseDialog');
18090
+ e.fire(this, 'afterClose');
18091
+ e.fire(this.ow, 'joditCloseDialog');
18087
18092
  if (this.destroyAfterClose) {
18088
18093
  this.destruct();
18089
18094
  }
@@ -18526,7 +18531,9 @@ const CLASS_PREVIEW = 'jodit-file-browser-preview', preview_tpl_next = (next = '
18526
18531
  ]);
18527
18532
  }, self.defaultTimeout);
18528
18533
  self.e
18529
- .on('beforeClose', () => contextmenu.close())
18534
+ .on('beforeClose', () => {
18535
+ contextmenu.close();
18536
+ })
18530
18537
  .on('beforeDestruct', () => contextmenu.destruct());
18531
18538
  e.stopPropagation();
18532
18539
  e.preventDefault();
@@ -19006,7 +19013,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .D.prototype.controls.fil
19006
19013
 
19007
19014
 
19008
19015
  const DEFAULT_SOURCE_NAME = 'default';
19009
- const possibleRules = [
19016
+ const possibleRules = new Set([
19010
19017
  'allowFiles',
19011
19018
  'allowFileMove',
19012
19019
  'allowFileUpload',
@@ -19020,7 +19027,7 @@ const possibleRules = [
19020
19027
  'allowFolderRename',
19021
19028
  'allowImageResize',
19022
19029
  'allowImageCrop'
19023
- ];
19030
+ ]);
19024
19031
  let DataProvider = class DataProvider {
19025
19032
  constructor(parent, options) {
19026
19033
  this.parent = parent;
@@ -19101,13 +19108,13 @@ let DataProvider = class DataProvider {
19101
19108
  canI(action) {
19102
19109
  const rule = 'allow' + action;
19103
19110
  if (!jodit_core_constants__WEBPACK_IMPORTED_MODULE_4__.IS_PROD) {
19104
- if (!possibleRules.includes(rule)) {
19111
+ if (!possibleRules.has(rule)) {
19105
19112
  throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.error)('Wrong action ' + action);
19106
19113
  }
19107
19114
  }
19108
- const preset = this.o.permissionsPresets[rule];
19109
- if (preset !== undefined) {
19110
- return preset;
19115
+ const presetValue = this.o.permissionsPresets[rule];
19116
+ if (presetValue !== undefined) {
19117
+ return presetValue;
19111
19118
  }
19112
19119
  return (this.__currentPermissions == null ||
19113
19120
  this.__currentPermissions[rule] === undefined ||
@@ -19617,11 +19624,7 @@ let FileBrowser = class FileBrowser extends jodit_core_view_view_with_toolbar__W
19617
19624
  minHeight: 300,
19618
19625
  buttons: this.o.headerButtons ?? ['fullsize', 'dialog.close']
19619
19626
  });
19620
- ['afterClose', 'beforeOpen'].forEach(proxyEvent => {
19621
- dialog.events.on(dialog, proxyEvent, () => {
19622
- this.e.fire(proxyEvent);
19623
- });
19624
- });
19627
+ ['beforeClose', 'afterClose', 'beforeOpen'].forEach(proxyEvent => dialog.events.on(dialog, proxyEvent, () => this.e.fire(proxyEvent)));
19625
19628
  dialog.setSize(this.o.width, this.o.height);
19626
19629
  return dialog;
19627
19630
  }