jodit 4.1.11 → 4.1.14

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 +27 -5
  2. package/es2015/jodit.css +2 -1
  3. package/es2015/jodit.fat.min.css +1 -1
  4. package/es2015/jodit.fat.min.js +2 -2
  5. package/es2015/jodit.js +145 -105
  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 +3 -3
  12. package/es2015/plugins/speech-recognize/speech-recognize.min.js +2 -2
  13. package/es2018/jodit.css +2 -1
  14. package/es2018/jodit.fat.min.css +1 -1
  15. package/es2018/jodit.fat.min.js +2 -2
  16. package/es2018/jodit.js +144 -104
  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 +3 -3
  23. package/es2018/plugins/speech-recognize/speech-recognize.min.js +2 -2
  24. package/es2021/jodit.css +2 -1
  25. package/es2021/jodit.fat.min.css +1 -1
  26. package/es2021/jodit.fat.min.js +2 -2
  27. package/es2021/jodit.js +143 -104
  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 +3 -3
  34. package/es2021/plugins/speech-recognize/speech-recognize.min.js +2 -2
  35. package/es2021.en/jodit.css +2 -1
  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 +143 -104
  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 +3 -3
  45. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +2 -2
  46. package/es5/jodit.css +3 -2
  47. package/es5/jodit.fat.min.css +1 -1
  48. package/es5/jodit.fat.min.js +2 -2
  49. package/es5/jodit.js +156 -108
  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 +3 -3
  56. package/es5/plugins/speech-recognize/speech-recognize.min.js +2 -2
  57. package/esm/core/constants.js +1 -1
  58. package/esm/core/decorators/watch/watch.d.ts +0 -1
  59. package/esm/core/decorators/watch/watch.js +0 -1
  60. package/esm/modules/file-browser/data-provider.js +1 -0
  61. package/esm/modules/file-browser/file-browser.d.ts +3 -0
  62. package/esm/modules/file-browser/file-browser.js +27 -1
  63. package/esm/plugins/ai-assistant/ai-assistant.d.ts +2 -0
  64. package/esm/plugins/ai-assistant/ai-assistant.js +40 -29
  65. package/esm/plugins/ai-assistant/ui/ui-ai-assistant.js +1 -1
  66. package/package.json +1 -1
  67. package/types/core/decorators/watch/watch.d.ts +0 -1
  68. package/types/modules/file-browser/file-browser.d.ts +3 -0
  69. package/types/plugins/ai-assistant/ai-assistant.d.ts +2 -0
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.1.11
4
+ * Version: v4.1.14
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1707,7 +1707,7 @@ __webpack_require__.r(__webpack_exports__);
1707
1707
  * Released under MIT see LICENSE.txt in the project root for license information.
1708
1708
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
1709
1709
  */
1710
- const APP_VERSION = "4.1.11";
1710
+ const APP_VERSION = "4.1.14";
1711
1711
  // prettier-ignore
1712
1712
  const ES = "es2018";
1713
1713
  const IS_ES_MODERN = true;
@@ -2399,14 +2399,14 @@ __webpack_require__.r(__webpack_exports__);
2399
2399
  /* harmony export */ component: function() { return /* reexport safe */ _component_component__WEBPACK_IMPORTED_MODULE_2__.s; },
2400
2400
  /* harmony export */ debounce: function() { return /* reexport safe */ _debounce_debounce__WEBPACK_IMPORTED_MODULE_3__.s; },
2401
2401
  /* harmony export */ derive: function() { return /* reexport safe */ _derive_derive__WEBPACK_IMPORTED_MODULE_4__.C; },
2402
- /* harmony export */ getPropertyDescriptor: function() { return /* reexport safe */ _watch_watch__WEBPACK_IMPORTED_MODULE_10__.Nx; },
2402
+ /* harmony export */ getPropertyDescriptor: function() { return /* reexport safe */ _watch_watch__WEBPACK_IMPORTED_MODULE_10__.N; },
2403
2403
  /* harmony export */ hook: function() { return /* reexport safe */ _hook_hook__WEBPACK_IMPORTED_MODULE_5__.A; },
2404
2404
  /* harmony export */ idle: function() { return /* reexport safe */ _idle_idle__WEBPACK_IMPORTED_MODULE_6__.N; },
2405
2405
  /* harmony export */ nonenumerable: function() { return /* reexport safe */ _nonenumerable_nonenumerable__WEBPACK_IMPORTED_MODULE_7__.m; },
2406
2406
  /* harmony export */ persistent: function() { return /* reexport safe */ _persistent_persistent__WEBPACK_IMPORTED_MODULE_8__.y; },
2407
2407
  /* harmony export */ throttle: function() { return /* reexport safe */ _debounce_debounce__WEBPACK_IMPORTED_MODULE_3__.n; },
2408
2408
  /* harmony export */ wait: function() { return /* reexport safe */ _wait_wait__WEBPACK_IMPORTED_MODULE_9__.u; },
2409
- /* harmony export */ watch: function() { return /* reexport safe */ _watch_watch__WEBPACK_IMPORTED_MODULE_10__.wB; }
2409
+ /* harmony export */ watch: function() { return /* reexport safe */ _watch_watch__WEBPACK_IMPORTED_MODULE_10__.w; }
2410
2410
  /* harmony export */ });
2411
2411
  /* harmony import */ var _autobind_autobind__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11961);
2412
2412
  /* harmony import */ var _cache_cache__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(87875);
@@ -2568,8 +2568,8 @@ function wait(condition) {
2568
2568
 
2569
2569
  "use strict";
2570
2570
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2571
- /* harmony export */ Nx: function() { return /* binding */ getPropertyDescriptor; },
2572
- /* harmony export */ wB: function() { return /* binding */ watch; }
2571
+ /* harmony export */ N: function() { return /* binding */ getPropertyDescriptor; },
2572
+ /* harmony export */ w: function() { return /* binding */ watch; }
2573
2573
  /* harmony export */ });
2574
2574
  /* harmony import */ var jodit_core_component_statuses__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(64567);
2575
2575
  /* harmony import */ var jodit_core_event_emitter_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(32332);
@@ -2685,7 +2685,6 @@ function watch(observeFields, opts) {
2685
2685
  }
2686
2686
  };
2687
2687
  }
2688
- /* harmony default export */ __webpack_exports__.Ay = (watch);
2689
2688
 
2690
2689
 
2691
2690
  /***/ }),
@@ -4257,7 +4256,7 @@ function observable(obj) {
4257
4256
  const key = _key;
4258
4257
  const prefix = prefixes.concat(key).filter(a => a.length);
4259
4258
  store[key] = dict[key];
4260
- const descriptor = (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_0__/* .getPropertyDescriptor */ .Nx)(dict, key);
4259
+ const descriptor = (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_0__/* .getPropertyDescriptor */ .N)(dict, key);
4261
4260
  Object.defineProperty(dict, key, {
4262
4261
  set: (value) => {
4263
4262
  const oldValue = store[key];
@@ -15779,7 +15778,7 @@ class ViewWithToolbar extends jodit_core_view_view__WEBPACK_IMPORTED_MODULE_5__/
15779
15778
  }
15780
15779
  }
15781
15780
  (0,tslib__WEBPACK_IMPORTED_MODULE_9__/* .__decorate */ .Cg)([
15782
- (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .wB)(':rebuildToolbar')
15781
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)(':rebuildToolbar')
15783
15782
  ], ViewWithToolbar.prototype, "buildToolbar", null);
15784
15783
  (0,tslib__WEBPACK_IMPORTED_MODULE_9__/* .__decorate */ .Cg)([
15785
15784
  jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .Ay
@@ -19173,6 +19172,7 @@ let DataProvider = class DataProvider {
19173
19172
  if (process) {
19174
19173
  const respData = process.call(self, resp);
19175
19174
  if (respData.data.permissions) {
19175
+ this.parent.events.fire(this, 'changePermissions', this.__currentPermissions, respData.data.permissions);
19176
19176
  this.__currentPermissions = respData.data.permissions;
19177
19177
  }
19178
19178
  }
@@ -19614,25 +19614,26 @@ async function loadTree(fb) {
19614
19614
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
19615
19615
  /* harmony export */ V: function() { return /* binding */ FileBrowser; }
19616
19616
  /* harmony export */ });
19617
- /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(31635);
19617
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(31635);
19618
19618
  /* harmony import */ var jodit_core_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(77753);
19619
19619
  /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(17352);
19620
19620
  /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(22664);
19621
- /* harmony import */ var jodit_core_event_emitter__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(50025);
19622
- /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(65147);
19623
- /* harmony import */ var jodit_core_storage__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(63915);
19624
- /* harmony import */ var jodit_core_traits_dlgs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(58597);
19625
- /* harmony import */ var jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(14961);
19626
- /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(70265);
19627
- /* harmony import */ var _fetch_load_items__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(9979);
19628
- /* harmony import */ var _fetch_load_tree__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(31859);
19629
- /* harmony import */ var _listeners_native_listeners__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(62994);
19630
- /* harmony import */ var _listeners_self_listeners__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(18043);
19631
- /* harmony import */ var _listeners_state_listeners__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(80004);
19632
- /* harmony import */ var _data_provider__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(75889);
19633
- /* harmony import */ var _factories__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(83797);
19634
- /* harmony import */ var _ui__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(10274);
19635
- /* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(36115);
19621
+ /* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(66927);
19622
+ /* harmony import */ var jodit_core_event_emitter__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(50025);
19623
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(65147);
19624
+ /* harmony import */ var jodit_core_storage__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(63915);
19625
+ /* harmony import */ var jodit_core_traits_dlgs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(58597);
19626
+ /* harmony import */ var jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(14961);
19627
+ /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(70265);
19628
+ /* harmony import */ var _fetch_load_items__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(9979);
19629
+ /* harmony import */ var _fetch_load_tree__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(31859);
19630
+ /* harmony import */ var _listeners_native_listeners__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(62994);
19631
+ /* harmony import */ var _listeners_self_listeners__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(18043);
19632
+ /* harmony import */ var _listeners_state_listeners__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(80004);
19633
+ /* harmony import */ var _data_provider__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(75889);
19634
+ /* harmony import */ var _factories__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(83797);
19635
+ /* harmony import */ var _ui__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(10274);
19636
+ /* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(36115);
19636
19637
  /*!
19637
19638
  * Jodit Editor (https://xdsoft.net/jodit/)
19638
19639
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -19659,13 +19660,14 @@ async function loadTree(fb) {
19659
19660
 
19660
19661
 
19661
19662
 
19662
- let FileBrowser = class FileBrowser extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_7__/* .ViewWithToolbar */ .T {
19663
+
19664
+ let FileBrowser = class FileBrowser extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_8__/* .ViewWithToolbar */ .T {
19663
19665
  /** @override */
19664
19666
  className() {
19665
19667
  return 'FileBrowser';
19666
19668
  }
19667
19669
  get dataProvider() {
19668
- return (0,_factories__WEBPACK_IMPORTED_MODULE_14__/* .makeDataProvider */ .S)(this, this.options);
19670
+ return (0,_factories__WEBPACK_IMPORTED_MODULE_15__/* .makeDataProvider */ .S)(this, this.options);
19669
19671
  }
19670
19672
  // eslint-disable-next-line no-unused-vars
19671
19673
  onSelect(callback) {
@@ -19686,7 +19688,7 @@ let FileBrowser = class FileBrowser extends jodit_core_view_view_with_toolbar__W
19686
19688
  files,
19687
19689
  isImages
19688
19690
  };
19689
- if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.isFunction)(callback)) {
19691
+ if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isFunction)(callback)) {
19690
19692
  callback(data);
19691
19693
  }
19692
19694
  this.close();
@@ -19709,7 +19711,7 @@ let FileBrowser = class FileBrowser extends jodit_core_view_view_with_toolbar__W
19709
19711
  * Container for set/get value
19710
19712
  */
19711
19713
  get storage() {
19712
- return jodit_core_storage__WEBPACK_IMPORTED_MODULE_5__/* .Storage */ .wc.makeStorage(Boolean(this.o.saveStateInStorage), this.componentName);
19714
+ return jodit_core_storage__WEBPACK_IMPORTED_MODULE_6__/* .Storage */ .wc.makeStorage(Boolean(this.o.saveStateInStorage), this.componentName);
19713
19715
  }
19714
19716
  get isOpened() {
19715
19717
  return this._dialog.isOpened && this.browser.style.display !== 'none';
@@ -19717,6 +19719,7 @@ let FileBrowser = class FileBrowser extends jodit_core_view_view_with_toolbar__W
19717
19719
  /**
19718
19720
  * It displays a message in the status bar of filebrowser
19719
19721
  *
19722
+ * @param message - The message that will be displayed
19720
19723
  * @param success - true It will be shown a message light . If no option is specified ,
19721
19724
  * ßan error will be shown the red
19722
19725
  * @example
@@ -19725,13 +19728,13 @@ let FileBrowser = class FileBrowser extends jodit_core_view_view_with_toolbar__W
19725
19728
  * ```
19726
19729
  */
19727
19730
  status(message, success) {
19728
- if (!message || (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.isAbortError)(message)) {
19731
+ if (!message || (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isAbortError)(message)) {
19729
19732
  return;
19730
19733
  }
19731
- if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.isString)(message)) {
19734
+ if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isString)(message)) {
19732
19735
  message = message.message;
19733
19736
  }
19734
- if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.isString)(message) || !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.trim)(message).length) {
19737
+ if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isString)(message) || !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.trim)(message).length) {
19735
19738
  return;
19736
19739
  }
19737
19740
  this.message.message(message, success ? 'success' : 'error', this.o.howLongShowMsg);
@@ -19759,7 +19762,7 @@ let FileBrowser = class FileBrowser extends jodit_core_view_view_with_toolbar__W
19759
19762
  .promise((resolve, reject) => {
19760
19763
  var _a;
19761
19764
  if (!this.o.items || !this.o.items.url) {
19762
- throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.error)('Need set options.filebrowser.ajax.url');
19765
+ throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.error)('Need set options.filebrowser.ajax.url');
19763
19766
  }
19764
19767
  let localTimeout = 0;
19765
19768
  this.e
@@ -19776,10 +19779,11 @@ let FileBrowser = class FileBrowser extends jodit_core_view_view_with_toolbar__W
19776
19779
  .off('select.filebrowser')
19777
19780
  .on('select.filebrowser', this.onSelect(callback));
19778
19781
  const header = this.c.div();
19779
- (_a = this.toolbar) === null || _a === void 0 ? void 0 : _a.build(this.__getButtons()).appendTo(header);
19782
+ (_a = this.toolbar) === null || _a === void 0 ? void 0 : _a.appendTo(header);
19783
+ this.__updateToolbarButtons();
19780
19784
  this._dialog.open(this.browser, header);
19781
19785
  this.e.fire('sort.filebrowser', this.state.sortBy);
19782
- (0,_fetch_load_tree__WEBPACK_IMPORTED_MODULE_9__/* .loadTree */ .r)(this).then(resolve, reject);
19786
+ (0,_fetch_load_tree__WEBPACK_IMPORTED_MODULE_10__/* .loadTree */ .r)(this).then(resolve, reject);
19783
19787
  })
19784
19788
  .catch((e) => {
19785
19789
  if (!jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.IS_PROD) {
@@ -19791,7 +19795,7 @@ let FileBrowser = class FileBrowser extends jodit_core_view_view_with_toolbar__W
19791
19795
  var _a;
19792
19796
  const options = ((_a = this.o.buttons) !== null && _a !== void 0 ? _a : []);
19793
19797
  return options.filter((btn) => {
19794
- if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.isString)(btn)) {
19798
+ if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isString)(btn)) {
19795
19799
  return true;
19796
19800
  }
19797
19801
  switch (btn) {
@@ -19808,8 +19812,8 @@ let FileBrowser = class FileBrowser extends jodit_core_view_view_with_toolbar__W
19808
19812
  }
19809
19813
  initUploader(editor) {
19810
19814
  var _a;
19811
- const self = this, options = (_a = editor === null || editor === void 0 ? void 0 : editor.options) === null || _a === void 0 ? void 0 : _a.uploader, uploaderOptions = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.ConfigProto)(options || {}, jodit_config__WEBPACK_IMPORTED_MODULE_16__/* .Config */ .T.defaultOptions.uploader);
19812
- const uploadHandler = () => (0,_fetch_load_items__WEBPACK_IMPORTED_MODULE_17__/* .loadItems */ .f)(this);
19815
+ const self = this, options = (_a = editor === null || editor === void 0 ? void 0 : editor.options) === null || _a === void 0 ? void 0 : _a.uploader, uploaderOptions = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.ConfigProto)(options || {}, jodit_config__WEBPACK_IMPORTED_MODULE_17__/* .Config */ .T.defaultOptions.uploader);
19816
+ const uploadHandler = () => (0,_fetch_load_items__WEBPACK_IMPORTED_MODULE_18__/* .loadItems */ .f)(this);
19813
19817
  self.uploader = self.getInstance('Uploader', uploaderOptions);
19814
19818
  self.uploader
19815
19819
  .setPath(self.state.currentPath)
@@ -19828,11 +19832,11 @@ let FileBrowser = class FileBrowser extends jodit_core_view_view_with_toolbar__W
19828
19832
  super(options);
19829
19833
  this.browser = this.c.div(this.componentName);
19830
19834
  this.status_line = this.c.div(this.getFullElName('status'));
19831
- this.tree = new _ui__WEBPACK_IMPORTED_MODULE_15__/* .FileBrowserTree */ .V(this);
19832
- this.files = new _ui__WEBPACK_IMPORTED_MODULE_15__/* .FileBrowserFiles */ .Q(this);
19833
- this.state = (0,jodit_core_event_emitter__WEBPACK_IMPORTED_MODULE_3__/* .observable */ .sH)({
19835
+ this.tree = new _ui__WEBPACK_IMPORTED_MODULE_16__/* .FileBrowserTree */ .V(this);
19836
+ this.files = new _ui__WEBPACK_IMPORTED_MODULE_16__/* .FileBrowserFiles */ .Q(this);
19837
+ this.state = (0,jodit_core_event_emitter__WEBPACK_IMPORTED_MODULE_4__/* .observable */ .sH)({
19834
19838
  currentPath: '',
19835
- currentSource: _data_provider__WEBPACK_IMPORTED_MODULE_13__/* .DEFAULT_SOURCE_NAME */ .o,
19839
+ currentSource: _data_provider__WEBPACK_IMPORTED_MODULE_14__/* .DEFAULT_SOURCE_NAME */ .o,
19836
19840
  currentBaseUrl: '',
19837
19841
  activeElements: [],
19838
19842
  elements: [],
@@ -19843,7 +19847,7 @@ let FileBrowser = class FileBrowser extends jodit_core_view_view_with_toolbar__W
19843
19847
  onlyImages: false
19844
19848
  });
19845
19849
  this.errorHandler = (resp) => {
19846
- if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.isAbortError)(resp)) {
19850
+ if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isAbortError)(resp)) {
19847
19851
  return;
19848
19852
  }
19849
19853
  if (resp instanceof Error) {
@@ -19859,9 +19863,10 @@ let FileBrowser = class FileBrowser extends jodit_core_view_view_with_toolbar__W
19859
19863
  this.close = () => {
19860
19864
  this._dialog.close();
19861
19865
  };
19866
+ this.__prevButtons = [];
19862
19867
  this.attachEvents(options);
19863
19868
  const self = this;
19864
- self.options = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.ConfigProto)(options || {}, jodit_config__WEBPACK_IMPORTED_MODULE_16__/* .Config */ .T.defaultOptions.filebrowser);
19869
+ self.options = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.ConfigProto)(options || {}, jodit_config__WEBPACK_IMPORTED_MODULE_17__/* .Config */ .T.defaultOptions.filebrowser);
19865
19870
  self.browser.component = this;
19866
19871
  self.container = self.browser;
19867
19872
  if (self.o.showFoldersPanel) {
@@ -19869,9 +19874,9 @@ let FileBrowser = class FileBrowser extends jodit_core_view_view_with_toolbar__W
19869
19874
  }
19870
19875
  self.browser.appendChild(self.files.container);
19871
19876
  self.browser.appendChild(self.status_line);
19872
- _listeners_self_listeners__WEBPACK_IMPORTED_MODULE_11__/* .selfListeners */ .c.call(self);
19873
- _listeners_native_listeners__WEBPACK_IMPORTED_MODULE_10__/* .nativeListeners */ .nW.call(self);
19874
- _listeners_state_listeners__WEBPACK_IMPORTED_MODULE_12__/* .stateListeners */ .r.call(self);
19877
+ _listeners_self_listeners__WEBPACK_IMPORTED_MODULE_12__/* .selfListeners */ .c.call(self);
19878
+ _listeners_native_listeners__WEBPACK_IMPORTED_MODULE_11__/* .nativeListeners */ .nW.call(self);
19879
+ _listeners_state_listeners__WEBPACK_IMPORTED_MODULE_13__/* .stateListeners */ .r.call(self);
19875
19880
  const keys = [
19876
19881
  'getLocalFileByUrl',
19877
19882
  'crop',
@@ -19889,7 +19894,7 @@ let FileBrowser = class FileBrowser extends jodit_core_view_view_with_toolbar__W
19889
19894
  ];
19890
19895
  keys.forEach(key => {
19891
19896
  if (this.options[key] != null) {
19892
- this.options[key] = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.ConfigProto)(this.options[key], this.o.ajax);
19897
+ this.options[key] = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.ConfigProto)(this.options[key], this.o.ajax);
19893
19898
  }
19894
19899
  });
19895
19900
  const { storeView, storeSortBy, storeLastOpenedFolder } = this.o
@@ -19933,26 +19938,49 @@ let FileBrowser = class FileBrowser extends jodit_core_view_view_with_toolbar__W
19933
19938
  this.events && this.e.off('.filebrowser');
19934
19939
  this.uploader && this.uploader.destruct();
19935
19940
  }
19941
+ __updateToolbarButtons() {
19942
+ var _a;
19943
+ const buttons = this.__getButtons();
19944
+ if (isEqualButtonList(this.__prevButtons, buttons)) {
19945
+ return;
19946
+ }
19947
+ this.__prevButtons = buttons;
19948
+ (_a = this.toolbar) === null || _a === void 0 ? void 0 : _a.build(buttons);
19949
+ }
19936
19950
  };
19937
- (0,tslib__WEBPACK_IMPORTED_MODULE_18__/* .__decorate */ .Cg)([
19951
+ (0,tslib__WEBPACK_IMPORTED_MODULE_19__/* .__decorate */ .Cg)([
19938
19952
  jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.cache
19939
19953
  ], FileBrowser.prototype, "dataProvider", null);
19940
- (0,tslib__WEBPACK_IMPORTED_MODULE_18__/* .__decorate */ .Cg)([
19954
+ (0,tslib__WEBPACK_IMPORTED_MODULE_19__/* .__decorate */ .Cg)([
19941
19955
  jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.cache
19942
19956
  ], FileBrowser.prototype, "_dialog", null);
19943
- (0,tslib__WEBPACK_IMPORTED_MODULE_18__/* .__decorate */ .Cg)([
19957
+ (0,tslib__WEBPACK_IMPORTED_MODULE_19__/* .__decorate */ .Cg)([
19944
19958
  jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.cache
19945
19959
  ], FileBrowser.prototype, "storage", null);
19946
- (0,tslib__WEBPACK_IMPORTED_MODULE_18__/* .__decorate */ .Cg)([
19960
+ (0,tslib__WEBPACK_IMPORTED_MODULE_19__/* .__decorate */ .Cg)([
19947
19961
  jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.autobind
19948
19962
  ], FileBrowser.prototype, "status", null);
19949
- (0,tslib__WEBPACK_IMPORTED_MODULE_18__/* .__decorate */ .Cg)([
19963
+ (0,tslib__WEBPACK_IMPORTED_MODULE_19__/* .__decorate */ .Cg)([
19950
19964
  jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.autobind
19951
19965
  ], FileBrowser.prototype, "open", null);
19952
- FileBrowser = (0,tslib__WEBPACK_IMPORTED_MODULE_18__/* .__decorate */ .Cg)([
19953
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.derive)(jodit_core_traits_dlgs__WEBPACK_IMPORTED_MODULE_6__/* .Dlgs */ .z)
19966
+ (0,tslib__WEBPACK_IMPORTED_MODULE_19__/* .__decorate */ .Cg)([
19967
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_3__/* .watch */ .w)('dataProvider:changePermissions')
19968
+ ], FileBrowser.prototype, "__updateToolbarButtons", null);
19969
+ FileBrowser = (0,tslib__WEBPACK_IMPORTED_MODULE_19__/* .__decorate */ .Cg)([
19970
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.derive)(jodit_core_traits_dlgs__WEBPACK_IMPORTED_MODULE_7__/* .Dlgs */ .z)
19954
19971
  ], FileBrowser);
19955
19972
 
19973
+ function isEqualButtonList(prevButtons, buttons) {
19974
+ if (prevButtons.length !== buttons.length) {
19975
+ return false;
19976
+ }
19977
+ for (let i = 0; i < prevButtons.length; i++) {
19978
+ if (prevButtons[i] !== buttons[i]) {
19979
+ return false;
19980
+ }
19981
+ }
19982
+ return true;
19983
+ }
19956
19984
 
19957
19985
 
19958
19986
  /***/ }),
@@ -25121,14 +25149,15 @@ jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__/* .Icon */ .I.set('enter', (_ent
25121
25149
 
25122
25150
  "use strict";
25123
25151
  /* unused harmony export aiAssistant */
25124
- /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(31635);
25125
- /* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(66927);
25126
- /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(56298);
25127
- /* harmony import */ var jodit_core_helpers_checker_is_abort_error__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(99951);
25128
- /* harmony import */ var jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(29866);
25129
- /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(66888);
25130
- /* harmony import */ var _ui_ui_ai_assistant__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(20785);
25131
- /* harmony import */ var _langs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(81026);
25152
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(31635);
25153
+ /* harmony import */ var jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(87875);
25154
+ /* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(66927);
25155
+ /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(56298);
25156
+ /* harmony import */ var jodit_core_helpers_checker_is_abort_error__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(99951);
25157
+ /* harmony import */ var jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(29866);
25158
+ /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(66888);
25159
+ /* harmony import */ var _ui_ui_ai_assistant__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(20785);
25160
+ /* harmony import */ var _langs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(81026);
25132
25161
  /*!
25133
25162
  * Jodit Editor (https://xdsoft.net/jodit/)
25134
25163
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -25142,10 +25171,37 @@ jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__/* .Icon */ .I.set('enter', (_ent
25142
25171
 
25143
25172
 
25144
25173
 
25174
+
25145
25175
  /**
25146
25176
  * The plugin inserts content generated by AI into the editor.
25147
25177
  */
25148
- class aiAssistant extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_2__/* .Plugin */ .k {
25178
+ class aiAssistant extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_3__/* .Plugin */ .k {
25179
+ get __dialog() {
25180
+ return this.jodit.dlg({
25181
+ buttons: ['fullsize', 'dialog.close'],
25182
+ closeOnClickOverlay: true,
25183
+ closeOnEsc: true,
25184
+ resizable: false,
25185
+ draggable: true,
25186
+ minHeight: 160
25187
+ });
25188
+ }
25189
+ get __container() {
25190
+ const { jodit, __dialog } = this;
25191
+ return new _ui_ui_ai_assistant__WEBPACK_IMPORTED_MODULE_5__/* .UiAiAssistant */ .b(jodit, {
25192
+ onInsertAfter(html) {
25193
+ jodit.s.focus();
25194
+ jodit.s.setCursorAfter(jodit.s.current());
25195
+ jodit.s.insertHTML(html);
25196
+ __dialog.close();
25197
+ },
25198
+ onInsert(html) {
25199
+ jodit.s.focus();
25200
+ jodit.s.insertHTML(html);
25201
+ __dialog.close();
25202
+ }
25203
+ });
25204
+ }
25149
25205
  constructor(jodit) {
25150
25206
  super(jodit);
25151
25207
  /** @override */
@@ -25159,38 +25215,13 @@ class aiAssistant extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_2__/
25159
25215
  group: 'insert'
25160
25216
  }
25161
25217
  ];
25162
- (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_1__/* .extendLang */ .JW)(_langs__WEBPACK_IMPORTED_MODULE_5__);
25218
+ (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_2__/* .extendLang */ .JW)(_langs__WEBPACK_IMPORTED_MODULE_6__);
25163
25219
  }
25164
25220
  /** @override */
25165
25221
  afterInit(jodit) { }
25166
25222
  onGenerateAiAssistantForm(prompt) {
25167
- const { jodit } = this;
25168
- const dialog = jodit.dlg({
25169
- buttons: ['fullsize', 'dialog.close'],
25170
- closeOnClickOverlay: true,
25171
- closeOnEsc: true,
25172
- resizable: false,
25173
- draggable: true
25174
- // minWidth: 460,
25175
- // maxWidth: 460
25176
- });
25177
- dialog.bindDestruct(jodit);
25178
- const container = new _ui_ui_ai_assistant__WEBPACK_IMPORTED_MODULE_4__/* .UiAiAssistant */ .b(jodit, {
25179
- onInsertAfter(html) {
25180
- jodit.s.focus();
25181
- jodit.s.setCursorAfter(jodit.s.current());
25182
- jodit.s.insertHTML(html);
25183
- dialog.close();
25184
- },
25185
- onInsert(html) {
25186
- jodit.s.focus();
25187
- jodit.s.insertHTML(html);
25188
- dialog.close();
25189
- }
25190
- });
25191
- container.bindDestruct(dialog);
25192
- dialog.open(container, 'AI Assistant', true, false);
25193
- container.setPrompt(prompt);
25223
+ this.__dialog.open(this.__container, 'AI Assistant');
25224
+ this.__container.setPrompt(prompt);
25194
25225
  }
25195
25226
  onInvokeAiAssistant(prompt) {
25196
25227
  const { jodit } = this;
@@ -25211,7 +25242,7 @@ class aiAssistant extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_2__/
25211
25242
  jodit.e.fire('ai-assistant-response', htmlFragment);
25212
25243
  })
25213
25244
  .catch(error => {
25214
- if ((0,jodit_core_helpers_checker_is_abort_error__WEBPACK_IMPORTED_MODULE_6__/* .isAbortError */ .z)(error)) {
25245
+ if ((0,jodit_core_helpers_checker_is_abort_error__WEBPACK_IMPORTED_MODULE_7__/* .isAbortError */ .z)(error)) {
25215
25246
  return;
25216
25247
  }
25217
25248
  jodit.message.error(error.message);
@@ -25219,15 +25250,24 @@ class aiAssistant extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_2__/
25219
25250
  });
25220
25251
  }
25221
25252
  /** @override */
25222
- beforeDestruct(_) { }
25253
+ beforeDestruct(_) {
25254
+ this.__container.destruct();
25255
+ this.__dialog.destruct();
25256
+ }
25223
25257
  }
25224
- (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
25225
- (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Ay)(':generateAiAssistantForm.ai-assistant')
25258
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
25259
+ jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_0__/* .cache */ .P
25260
+ ], aiAssistant.prototype, "__dialog", null);
25261
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
25262
+ jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_0__/* .cache */ .P
25263
+ ], aiAssistant.prototype, "__container", null);
25264
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
25265
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)(':generateAiAssistantForm.ai-assistant')
25226
25266
  ], aiAssistant.prototype, "onGenerateAiAssistantForm", null);
25227
- (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
25228
- (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Ay)(':invokeAiAssistant')
25267
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
25268
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)(':invokeAiAssistant')
25229
25269
  ], aiAssistant.prototype, "onInvokeAiAssistant", null);
25230
- jodit_core_global__WEBPACK_IMPORTED_MODULE_1__/* .pluginSystem */ .fg.add('ai-assistant', aiAssistant);
25270
+ jodit_core_global__WEBPACK_IMPORTED_MODULE_2__/* .pluginSystem */ .fg.add('ai-assistant', aiAssistant);
25231
25271
 
25232
25272
 
25233
25273
  /***/ }),
@@ -25583,13 +25623,13 @@ let UiAiAssistant = class UiAiAssistant extends jodit_core_ui_element__WEBPACK_I
25583
25623
  }
25584
25624
  };
25585
25625
  (0,tslib__WEBPACK_IMPORTED_MODULE_5__/* .__decorate */ .Cg)([
25586
- (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Ay)(':ai-assistant-response')
25626
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_0__/* .watch */ .w)(':ai-assistant-response')
25587
25627
  ], UiAiAssistant.prototype, "onAiAssistentResponse", null);
25588
25628
  (0,tslib__WEBPACK_IMPORTED_MODULE_5__/* .__decorate */ .Cg)([
25589
- (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Ay)(':ai-assistant-error')
25629
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_0__/* .watch */ .w)(':ai-assistant-error')
25590
25630
  ], UiAiAssistant.prototype, "onAiAssistentError", null);
25591
25631
  (0,tslib__WEBPACK_IMPORTED_MODULE_5__/* .__decorate */ .Cg)([
25592
- (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Ay)('promptInput:change')
25632
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_0__/* .watch */ .w)('promptInput:change')
25593
25633
  ], UiAiAssistant.prototype, "onChangePromptValue", null);
25594
25634
  UiAiAssistant = (0,tslib__WEBPACK_IMPORTED_MODULE_5__/* .__decorate */ .Cg)([
25595
25635
  jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_6__/* .component */ .s
@@ -29222,10 +29262,10 @@ class dtd extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_2__/* .Plugin */ .k
29222
29262
  }
29223
29263
  }
29224
29264
  (0,tslib__WEBPACK_IMPORTED_MODULE_6__/* .__decorate */ .Cg)([
29225
- (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_0__/* .watch */ .wB)(':beforeInsertNode')
29265
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_0__/* .watch */ .w)(':beforeInsertNode')
29226
29266
  ], dtd.prototype, "__onBeforeInsertNode", null);
29227
29267
  (0,tslib__WEBPACK_IMPORTED_MODULE_6__/* .__decorate */ .Cg)([
29228
- (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_0__/* .watch */ .wB)(':afterInsertNode')
29268
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_0__/* .watch */ .w)(':afterInsertNode')
29229
29269
  ], dtd.prototype, "__onAfterInsertNode", null);
29230
29270
  jodit_core_global__WEBPACK_IMPORTED_MODULE_1__/* .pluginSystem */ .fg.add('dtd', dtd);
29231
29271