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/es2021/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
  */
@@ -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
@@ -17474,7 +17475,8 @@ let ContextMenu = class ContextMenu extends jodit_core_ui_popup__WEBPACK_IMPORTE
17474
17475
  * ```
17475
17476
  */
17476
17477
  show(x, y, actions) {
17477
- const self = this, content = this.j.c.div(this.getFullElName('actions'));
17478
+ const self = this;
17479
+ self.clear();
17478
17480
  if (!(0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_2__/* .isArray */ .kJ)(actions)) {
17479
17481
  return;
17480
17482
  }
@@ -17487,12 +17489,13 @@ let ContextMenu = class ContextMenu extends jodit_core_ui_popup__WEBPACK_IMPORTE
17487
17489
  action.setMod('context', 'menu');
17488
17490
  action.onAction((e) => {
17489
17491
  item.exec?.call(self, e);
17492
+ self.clear();
17490
17493
  self.close();
17491
17494
  return false;
17492
17495
  });
17493
- content.appendChild(action.container);
17496
+ this.append(action);
17494
17497
  });
17495
- this.setContent(content).open(() => ({ left: x, top: y, width: 0, height: 0 }), true);
17498
+ this.open(() => ({ left: x, top: y, width: 0, height: 0 }), true);
17496
17499
  }
17497
17500
  };
17498
17501
  ContextMenu = (0,tslib__WEBPACK_IMPORTED_MODULE_3__/* .__decorate */ .gn)([
@@ -18083,10 +18086,12 @@ let Dialog = Dialog_1 = class Dialog extends jodit_core_view_view_with_toolbar__
18083
18086
  this.getMod('static') === true) {
18084
18087
  return this;
18085
18088
  }
18089
+ const { e } = this;
18086
18090
  /**
18087
18091
  * Called up to close the window
18088
18092
  */
18089
- if (this.e.fire('beforeClose', this) === false) {
18093
+ if (e.fire(this, 'beforeClose') === false ||
18094
+ e.fire('beforeClose', this) === false) {
18090
18095
  return this;
18091
18096
  }
18092
18097
  this.setMod('active', false);
@@ -18099,8 +18104,8 @@ let Dialog = Dialog_1 = class Dialog extends jodit_core_view_view_with_toolbar__
18099
18104
  /**
18100
18105
  * It called after the window is closed
18101
18106
  */
18102
- this.e.fire(this, 'afterClose');
18103
- this.e.fire(this.ow, 'joditCloseDialog');
18107
+ e.fire(this, 'afterClose');
18108
+ e.fire(this.ow, 'joditCloseDialog');
18104
18109
  if (this.destroyAfterClose) {
18105
18110
  this.destruct();
18106
18111
  }
@@ -18543,7 +18548,9 @@ const CLASS_PREVIEW = 'jodit-file-browser-preview', preview_tpl_next = (next = '
18543
18548
  ]);
18544
18549
  }, self.defaultTimeout);
18545
18550
  self.e
18546
- .on('beforeClose', () => contextmenu.close())
18551
+ .on('beforeClose', () => {
18552
+ contextmenu.close();
18553
+ })
18547
18554
  .on('beforeDestruct', () => contextmenu.destruct());
18548
18555
  e.stopPropagation();
18549
18556
  e.preventDefault();
@@ -19023,7 +19030,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .D.prototype.controls.fil
19023
19030
 
19024
19031
 
19025
19032
  const DEFAULT_SOURCE_NAME = 'default';
19026
- const possibleRules = [
19033
+ const possibleRules = new Set([
19027
19034
  'allowFiles',
19028
19035
  'allowFileMove',
19029
19036
  'allowFileUpload',
@@ -19037,7 +19044,7 @@ const possibleRules = [
19037
19044
  'allowFolderRename',
19038
19045
  'allowImageResize',
19039
19046
  'allowImageCrop'
19040
- ];
19047
+ ]);
19041
19048
  let DataProvider = class DataProvider {
19042
19049
  constructor(parent, options) {
19043
19050
  this.parent = parent;
@@ -19118,13 +19125,13 @@ let DataProvider = class DataProvider {
19118
19125
  canI(action) {
19119
19126
  const rule = 'allow' + action;
19120
19127
  if (!jodit_core_constants__WEBPACK_IMPORTED_MODULE_4__.IS_PROD) {
19121
- if (!possibleRules.includes(rule)) {
19128
+ if (!possibleRules.has(rule)) {
19122
19129
  throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.error)('Wrong action ' + action);
19123
19130
  }
19124
19131
  }
19125
- const preset = this.o.permissionsPresets[rule];
19126
- if (preset !== undefined) {
19127
- return preset;
19132
+ const presetValue = this.o.permissionsPresets[rule];
19133
+ if (presetValue !== undefined) {
19134
+ return presetValue;
19128
19135
  }
19129
19136
  return (this.__currentPermissions == null ||
19130
19137
  this.__currentPermissions[rule] === undefined ||
@@ -19634,11 +19641,7 @@ let FileBrowser = class FileBrowser extends jodit_core_view_view_with_toolbar__W
19634
19641
  minHeight: 300,
19635
19642
  buttons: this.o.headerButtons ?? ['fullsize', 'dialog.close']
19636
19643
  });
19637
- ['afterClose', 'beforeOpen'].forEach(proxyEvent => {
19638
- dialog.events.on(dialog, proxyEvent, () => {
19639
- this.e.fire(proxyEvent);
19640
- });
19641
- });
19644
+ ['beforeClose', 'afterClose', 'beforeOpen'].forEach(proxyEvent => dialog.events.on(dialog, proxyEvent, () => this.e.fire(proxyEvent)));
19642
19645
  dialog.setSize(this.o.width, this.o.height);
19643
19646
  return dialog;
19644
19647
  }