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
package/es2018/jodit.js CHANGED
@@ -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
  */
@@ -1691,7 +1691,7 @@ __webpack_require__.r(__webpack_exports__);
1691
1691
  * Released under MIT see LICENSE.txt in the project root for license information.
1692
1692
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
1693
1693
  */
1694
- const APP_VERSION = "4.0.1";
1694
+ const APP_VERSION = "4.0.2";
1695
1695
  // prettier-ignore
1696
1696
  const ES = "es2018";
1697
1697
  const IS_ES_MODERN = true;
@@ -15520,10 +15520,11 @@ class Popup extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_3__/* .UI
15520
15520
  .off(this.container, 'scroll mousewheel', up)
15521
15521
  .off(ow, 'scroll', up)
15522
15522
  .off(ow, 'resize', up);
15523
- void 0;
15524
- jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .i.up(this.j.container, box => {
15525
- box && this.j.e.off(box, 'scroll mousewheel', up);
15526
- });
15523
+ if (this.j.container.isConnected) {
15524
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .i.up(this.j.container, box => {
15525
+ box && this.j.e.off(box, 'scroll mousewheel', up);
15526
+ });
15527
+ }
15527
15528
  }
15528
15529
  /**
15529
15530
  * Set ZIndex
@@ -17523,7 +17524,8 @@ let ContextMenu = class ContextMenu extends jodit_core_ui_popup__WEBPACK_IMPORTE
17523
17524
  * ```
17524
17525
  */
17525
17526
  show(x, y, actions) {
17526
- const self = this, content = this.j.c.div(this.getFullElName('actions'));
17527
+ const self = this;
17528
+ self.clear();
17527
17529
  if (!(0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_2__/* .isArray */ .kJ)(actions)) {
17528
17530
  return;
17529
17531
  }
@@ -17537,12 +17539,13 @@ let ContextMenu = class ContextMenu extends jodit_core_ui_popup__WEBPACK_IMPORTE
17537
17539
  action.onAction((e) => {
17538
17540
  var _a;
17539
17541
  (_a = item.exec) === null || _a === void 0 ? void 0 : _a.call(self, e);
17542
+ self.clear();
17540
17543
  self.close();
17541
17544
  return false;
17542
17545
  });
17543
- content.appendChild(action.container);
17546
+ this.append(action);
17544
17547
  });
17545
- this.setContent(content).open(() => ({ left: x, top: y, width: 0, height: 0 }), true);
17548
+ this.open(() => ({ left: x, top: y, width: 0, height: 0 }), true);
17546
17549
  }
17547
17550
  };
17548
17551
  ContextMenu = (0,tslib__WEBPACK_IMPORTED_MODULE_3__/* .__decorate */ .gn)([
@@ -18134,10 +18137,12 @@ let Dialog = Dialog_1 = class Dialog extends jodit_core_view_view_with_toolbar__
18134
18137
  this.getMod('static') === true) {
18135
18138
  return this;
18136
18139
  }
18140
+ const { e } = this;
18137
18141
  /**
18138
18142
  * Called up to close the window
18139
18143
  */
18140
- if (this.e.fire('beforeClose', this) === false) {
18144
+ if (e.fire(this, 'beforeClose') === false ||
18145
+ e.fire('beforeClose', this) === false) {
18141
18146
  return this;
18142
18147
  }
18143
18148
  this.setMod('active', false);
@@ -18150,8 +18155,8 @@ let Dialog = Dialog_1 = class Dialog extends jodit_core_view_view_with_toolbar__
18150
18155
  /**
18151
18156
  * It called after the window is closed
18152
18157
  */
18153
- this.e.fire(this, 'afterClose');
18154
- this.e.fire(this.ow, 'joditCloseDialog');
18158
+ e.fire(this, 'afterClose');
18159
+ e.fire(this.ow, 'joditCloseDialog');
18155
18160
  if (this.destroyAfterClose) {
18156
18161
  this.destruct();
18157
18162
  }
@@ -18595,7 +18600,9 @@ const CLASS_PREVIEW = 'jodit-file-browser-preview', preview_tpl_next = (next = '
18595
18600
  ]);
18596
18601
  }, self.defaultTimeout);
18597
18602
  self.e
18598
- .on('beforeClose', () => contextmenu.close())
18603
+ .on('beforeClose', () => {
18604
+ contextmenu.close();
18605
+ })
18599
18606
  .on('beforeDestruct', () => contextmenu.destruct());
18600
18607
  e.stopPropagation();
18601
18608
  e.preventDefault();
@@ -19075,7 +19082,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .D.prototype.controls.fil
19075
19082
 
19076
19083
 
19077
19084
  const DEFAULT_SOURCE_NAME = 'default';
19078
- const possibleRules = [
19085
+ const possibleRules = new Set([
19079
19086
  'allowFiles',
19080
19087
  'allowFileMove',
19081
19088
  'allowFileUpload',
@@ -19089,7 +19096,7 @@ const possibleRules = [
19089
19096
  'allowFolderRename',
19090
19097
  'allowImageResize',
19091
19098
  'allowImageCrop'
19092
- ];
19099
+ ]);
19093
19100
  let DataProvider = class DataProvider {
19094
19101
  constructor(parent, options) {
19095
19102
  this.parent = parent;
@@ -19170,13 +19177,13 @@ let DataProvider = class DataProvider {
19170
19177
  canI(action) {
19171
19178
  const rule = 'allow' + action;
19172
19179
  if (!jodit_core_constants__WEBPACK_IMPORTED_MODULE_4__.IS_PROD) {
19173
- if (!possibleRules.includes(rule)) {
19180
+ if (!possibleRules.has(rule)) {
19174
19181
  throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.error)('Wrong action ' + action);
19175
19182
  }
19176
19183
  }
19177
- const preset = this.o.permissionsPresets[rule];
19178
- if (preset !== undefined) {
19179
- return preset;
19184
+ const presetValue = this.o.permissionsPresets[rule];
19185
+ if (presetValue !== undefined) {
19186
+ return presetValue;
19180
19187
  }
19181
19188
  return (this.__currentPermissions == null ||
19182
19189
  this.__currentPermissions[rule] === undefined ||
@@ -19690,11 +19697,7 @@ let FileBrowser = class FileBrowser extends jodit_core_view_view_with_toolbar__W
19690
19697
  minHeight: 300,
19691
19698
  buttons: (_a = this.o.headerButtons) !== null && _a !== void 0 ? _a : ['fullsize', 'dialog.close']
19692
19699
  });
19693
- ['afterClose', 'beforeOpen'].forEach(proxyEvent => {
19694
- dialog.events.on(dialog, proxyEvent, () => {
19695
- this.e.fire(proxyEvent);
19696
- });
19697
- });
19700
+ ['beforeClose', 'afterClose', 'beforeOpen'].forEach(proxyEvent => dialog.events.on(dialog, proxyEvent, () => this.e.fire(proxyEvent)));
19698
19701
  dialog.setSize(this.o.width, this.o.height);
19699
19702
  return dialog;
19700
19703
  }