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/es2015/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 = "es2015";
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];
@@ -15722,7 +15721,7 @@ class ViewWithToolbar extends jodit_core_view_view__WEBPACK_IMPORTED_MODULE_5__/
15722
15721
  }
15723
15722
  }
15724
15723
  (0,tslib__WEBPACK_IMPORTED_MODULE_9__/* .__decorate */ .Cg)([
15725
- (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .wB)(':rebuildToolbar')
15724
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)(':rebuildToolbar')
15726
15725
  ], ViewWithToolbar.prototype, "buildToolbar", null);
15727
15726
  (0,tslib__WEBPACK_IMPORTED_MODULE_9__/* .__decorate */ .Cg)([
15728
15727
  jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_10__/* ["default"] */ .Ay
@@ -19102,6 +19101,7 @@ let DataProvider = class DataProvider {
19102
19101
  if (process) {
19103
19102
  const respData = process.call(self, resp);
19104
19103
  if (respData.data.permissions) {
19104
+ this.parent.events.fire(this, 'changePermissions', this.__currentPermissions, respData.data.permissions);
19105
19105
  this.__currentPermissions = respData.data.permissions;
19106
19106
  }
19107
19107
  }
@@ -19546,25 +19546,26 @@ function loadTree(fb) {
19546
19546
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
19547
19547
  /* harmony export */ V: function() { return /* binding */ FileBrowser; }
19548
19548
  /* harmony export */ });
19549
- /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(31635);
19549
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(31635);
19550
19550
  /* harmony import */ var jodit_core_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(77753);
19551
19551
  /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(17352);
19552
19552
  /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(22664);
19553
- /* harmony import */ var jodit_core_event_emitter__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(50025);
19554
- /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(65147);
19555
- /* harmony import */ var jodit_core_storage__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(63915);
19556
- /* harmony import */ var jodit_core_traits_dlgs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(58597);
19557
- /* harmony import */ var jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(14961);
19558
- /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(70265);
19559
- /* harmony import */ var _fetch_load_items__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(9979);
19560
- /* harmony import */ var _fetch_load_tree__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(31859);
19561
- /* harmony import */ var _listeners_native_listeners__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(62994);
19562
- /* harmony import */ var _listeners_self_listeners__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(18043);
19563
- /* harmony import */ var _listeners_state_listeners__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(80004);
19564
- /* harmony import */ var _data_provider__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(75889);
19565
- /* harmony import */ var _factories__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(83797);
19566
- /* harmony import */ var _ui__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(10274);
19567
- /* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(36115);
19553
+ /* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(66927);
19554
+ /* harmony import */ var jodit_core_event_emitter__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(50025);
19555
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(65147);
19556
+ /* harmony import */ var jodit_core_storage__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(63915);
19557
+ /* harmony import */ var jodit_core_traits_dlgs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(58597);
19558
+ /* harmony import */ var jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(14961);
19559
+ /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(70265);
19560
+ /* harmony import */ var _fetch_load_items__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(9979);
19561
+ /* harmony import */ var _fetch_load_tree__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(31859);
19562
+ /* harmony import */ var _listeners_native_listeners__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(62994);
19563
+ /* harmony import */ var _listeners_self_listeners__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(18043);
19564
+ /* harmony import */ var _listeners_state_listeners__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(80004);
19565
+ /* harmony import */ var _data_provider__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(75889);
19566
+ /* harmony import */ var _factories__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(83797);
19567
+ /* harmony import */ var _ui__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(10274);
19568
+ /* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(36115);
19568
19569
  /*!
19569
19570
  * Jodit Editor (https://xdsoft.net/jodit/)
19570
19571
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -19591,13 +19592,14 @@ function loadTree(fb) {
19591
19592
 
19592
19593
 
19593
19594
 
19594
- let FileBrowser = class FileBrowser extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_7__/* .ViewWithToolbar */ .T {
19595
+
19596
+ let FileBrowser = class FileBrowser extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_8__/* .ViewWithToolbar */ .T {
19595
19597
  /** @override */
19596
19598
  className() {
19597
19599
  return 'FileBrowser';
19598
19600
  }
19599
19601
  get dataProvider() {
19600
- return (0,_factories__WEBPACK_IMPORTED_MODULE_14__/* .makeDataProvider */ .S)(this, this.options);
19602
+ return (0,_factories__WEBPACK_IMPORTED_MODULE_15__/* .makeDataProvider */ .S)(this, this.options);
19601
19603
  }
19602
19604
  // eslint-disable-next-line no-unused-vars
19603
19605
  onSelect(callback) {
@@ -19618,7 +19620,7 @@ let FileBrowser = class FileBrowser extends jodit_core_view_view_with_toolbar__W
19618
19620
  files,
19619
19621
  isImages
19620
19622
  };
19621
- if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.isFunction)(callback)) {
19623
+ if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isFunction)(callback)) {
19622
19624
  callback(data);
19623
19625
  }
19624
19626
  this.close();
@@ -19641,7 +19643,7 @@ let FileBrowser = class FileBrowser extends jodit_core_view_view_with_toolbar__W
19641
19643
  * Container for set/get value
19642
19644
  */
19643
19645
  get storage() {
19644
- return jodit_core_storage__WEBPACK_IMPORTED_MODULE_5__/* .Storage */ .wc.makeStorage(Boolean(this.o.saveStateInStorage), this.componentName);
19646
+ return jodit_core_storage__WEBPACK_IMPORTED_MODULE_6__/* .Storage */ .wc.makeStorage(Boolean(this.o.saveStateInStorage), this.componentName);
19645
19647
  }
19646
19648
  get isOpened() {
19647
19649
  return this._dialog.isOpened && this.browser.style.display !== 'none';
@@ -19649,6 +19651,7 @@ let FileBrowser = class FileBrowser extends jodit_core_view_view_with_toolbar__W
19649
19651
  /**
19650
19652
  * It displays a message in the status bar of filebrowser
19651
19653
  *
19654
+ * @param message - The message that will be displayed
19652
19655
  * @param success - true It will be shown a message light . If no option is specified ,
19653
19656
  * ßan error will be shown the red
19654
19657
  * @example
@@ -19657,13 +19660,13 @@ let FileBrowser = class FileBrowser extends jodit_core_view_view_with_toolbar__W
19657
19660
  * ```
19658
19661
  */
19659
19662
  status(message, success) {
19660
- if (!message || (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.isAbortError)(message)) {
19663
+ if (!message || (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isAbortError)(message)) {
19661
19664
  return;
19662
19665
  }
19663
- if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.isString)(message)) {
19666
+ if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isString)(message)) {
19664
19667
  message = message.message;
19665
19668
  }
19666
- if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.isString)(message) || !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.trim)(message).length) {
19669
+ if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isString)(message) || !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.trim)(message).length) {
19667
19670
  return;
19668
19671
  }
19669
19672
  this.message.message(message, success ? 'success' : 'error', this.o.howLongShowMsg);
@@ -19691,7 +19694,7 @@ let FileBrowser = class FileBrowser extends jodit_core_view_view_with_toolbar__W
19691
19694
  .promise((resolve, reject) => {
19692
19695
  var _a;
19693
19696
  if (!this.o.items || !this.o.items.url) {
19694
- throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.error)('Need set options.filebrowser.ajax.url');
19697
+ throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.error)('Need set options.filebrowser.ajax.url');
19695
19698
  }
19696
19699
  let localTimeout = 0;
19697
19700
  this.e
@@ -19708,10 +19711,11 @@ let FileBrowser = class FileBrowser extends jodit_core_view_view_with_toolbar__W
19708
19711
  .off('select.filebrowser')
19709
19712
  .on('select.filebrowser', this.onSelect(callback));
19710
19713
  const header = this.c.div();
19711
- (_a = this.toolbar) === null || _a === void 0 ? void 0 : _a.build(this.__getButtons()).appendTo(header);
19714
+ (_a = this.toolbar) === null || _a === void 0 ? void 0 : _a.appendTo(header);
19715
+ this.__updateToolbarButtons();
19712
19716
  this._dialog.open(this.browser, header);
19713
19717
  this.e.fire('sort.filebrowser', this.state.sortBy);
19714
- (0,_fetch_load_tree__WEBPACK_IMPORTED_MODULE_9__/* .loadTree */ .r)(this).then(resolve, reject);
19718
+ (0,_fetch_load_tree__WEBPACK_IMPORTED_MODULE_10__/* .loadTree */ .r)(this).then(resolve, reject);
19715
19719
  })
19716
19720
  .catch((e) => {
19717
19721
  if (!jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.IS_PROD) {
@@ -19723,7 +19727,7 @@ let FileBrowser = class FileBrowser extends jodit_core_view_view_with_toolbar__W
19723
19727
  var _a;
19724
19728
  const options = ((_a = this.o.buttons) !== null && _a !== void 0 ? _a : []);
19725
19729
  return options.filter((btn) => {
19726
- if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.isString)(btn)) {
19730
+ if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isString)(btn)) {
19727
19731
  return true;
19728
19732
  }
19729
19733
  switch (btn) {
@@ -19740,8 +19744,8 @@ let FileBrowser = class FileBrowser extends jodit_core_view_view_with_toolbar__W
19740
19744
  }
19741
19745
  initUploader(editor) {
19742
19746
  var _a;
19743
- 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);
19744
- const uploadHandler = () => (0,_fetch_load_items__WEBPACK_IMPORTED_MODULE_17__/* .loadItems */ .f)(this);
19747
+ 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);
19748
+ const uploadHandler = () => (0,_fetch_load_items__WEBPACK_IMPORTED_MODULE_18__/* .loadItems */ .f)(this);
19745
19749
  self.uploader = self.getInstance('Uploader', uploaderOptions);
19746
19750
  self.uploader
19747
19751
  .setPath(self.state.currentPath)
@@ -19760,11 +19764,11 @@ let FileBrowser = class FileBrowser extends jodit_core_view_view_with_toolbar__W
19760
19764
  super(options);
19761
19765
  this.browser = this.c.div(this.componentName);
19762
19766
  this.status_line = this.c.div(this.getFullElName('status'));
19763
- this.tree = new _ui__WEBPACK_IMPORTED_MODULE_15__/* .FileBrowserTree */ .V(this);
19764
- this.files = new _ui__WEBPACK_IMPORTED_MODULE_15__/* .FileBrowserFiles */ .Q(this);
19765
- this.state = (0,jodit_core_event_emitter__WEBPACK_IMPORTED_MODULE_3__/* .observable */ .sH)({
19767
+ this.tree = new _ui__WEBPACK_IMPORTED_MODULE_16__/* .FileBrowserTree */ .V(this);
19768
+ this.files = new _ui__WEBPACK_IMPORTED_MODULE_16__/* .FileBrowserFiles */ .Q(this);
19769
+ this.state = (0,jodit_core_event_emitter__WEBPACK_IMPORTED_MODULE_4__/* .observable */ .sH)({
19766
19770
  currentPath: '',
19767
- currentSource: _data_provider__WEBPACK_IMPORTED_MODULE_13__/* .DEFAULT_SOURCE_NAME */ .o,
19771
+ currentSource: _data_provider__WEBPACK_IMPORTED_MODULE_14__/* .DEFAULT_SOURCE_NAME */ .o,
19768
19772
  currentBaseUrl: '',
19769
19773
  activeElements: [],
19770
19774
  elements: [],
@@ -19775,7 +19779,7 @@ let FileBrowser = class FileBrowser extends jodit_core_view_view_with_toolbar__W
19775
19779
  onlyImages: false
19776
19780
  });
19777
19781
  this.errorHandler = (resp) => {
19778
- if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.isAbortError)(resp)) {
19782
+ if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isAbortError)(resp)) {
19779
19783
  return;
19780
19784
  }
19781
19785
  if (resp instanceof Error) {
@@ -19791,9 +19795,10 @@ let FileBrowser = class FileBrowser extends jodit_core_view_view_with_toolbar__W
19791
19795
  this.close = () => {
19792
19796
  this._dialog.close();
19793
19797
  };
19798
+ this.__prevButtons = [];
19794
19799
  this.attachEvents(options);
19795
19800
  const self = this;
19796
- self.options = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.ConfigProto)(options || {}, jodit_config__WEBPACK_IMPORTED_MODULE_16__/* .Config */ .T.defaultOptions.filebrowser);
19801
+ self.options = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.ConfigProto)(options || {}, jodit_config__WEBPACK_IMPORTED_MODULE_17__/* .Config */ .T.defaultOptions.filebrowser);
19797
19802
  self.browser.component = this;
19798
19803
  self.container = self.browser;
19799
19804
  if (self.o.showFoldersPanel) {
@@ -19801,9 +19806,9 @@ let FileBrowser = class FileBrowser extends jodit_core_view_view_with_toolbar__W
19801
19806
  }
19802
19807
  self.browser.appendChild(self.files.container);
19803
19808
  self.browser.appendChild(self.status_line);
19804
- _listeners_self_listeners__WEBPACK_IMPORTED_MODULE_11__/* .selfListeners */ .c.call(self);
19805
- _listeners_native_listeners__WEBPACK_IMPORTED_MODULE_10__/* .nativeListeners */ .nW.call(self);
19806
- _listeners_state_listeners__WEBPACK_IMPORTED_MODULE_12__/* .stateListeners */ .r.call(self);
19809
+ _listeners_self_listeners__WEBPACK_IMPORTED_MODULE_12__/* .selfListeners */ .c.call(self);
19810
+ _listeners_native_listeners__WEBPACK_IMPORTED_MODULE_11__/* .nativeListeners */ .nW.call(self);
19811
+ _listeners_state_listeners__WEBPACK_IMPORTED_MODULE_13__/* .stateListeners */ .r.call(self);
19807
19812
  const keys = [
19808
19813
  'getLocalFileByUrl',
19809
19814
  'crop',
@@ -19821,7 +19826,7 @@ let FileBrowser = class FileBrowser extends jodit_core_view_view_with_toolbar__W
19821
19826
  ];
19822
19827
  keys.forEach(key => {
19823
19828
  if (this.options[key] != null) {
19824
- this.options[key] = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.ConfigProto)(this.options[key], this.o.ajax);
19829
+ this.options[key] = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.ConfigProto)(this.options[key], this.o.ajax);
19825
19830
  }
19826
19831
  });
19827
19832
  const { storeView, storeSortBy, storeLastOpenedFolder } = this.o
@@ -19865,26 +19870,49 @@ let FileBrowser = class FileBrowser extends jodit_core_view_view_with_toolbar__W
19865
19870
  this.events && this.e.off('.filebrowser');
19866
19871
  this.uploader && this.uploader.destruct();
19867
19872
  }
19873
+ __updateToolbarButtons() {
19874
+ var _a;
19875
+ const buttons = this.__getButtons();
19876
+ if (isEqualButtonList(this.__prevButtons, buttons)) {
19877
+ return;
19878
+ }
19879
+ this.__prevButtons = buttons;
19880
+ (_a = this.toolbar) === null || _a === void 0 ? void 0 : _a.build(buttons);
19881
+ }
19868
19882
  };
19869
- (0,tslib__WEBPACK_IMPORTED_MODULE_18__/* .__decorate */ .Cg)([
19883
+ (0,tslib__WEBPACK_IMPORTED_MODULE_19__/* .__decorate */ .Cg)([
19870
19884
  jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.cache
19871
19885
  ], FileBrowser.prototype, "dataProvider", null);
19872
- (0,tslib__WEBPACK_IMPORTED_MODULE_18__/* .__decorate */ .Cg)([
19886
+ (0,tslib__WEBPACK_IMPORTED_MODULE_19__/* .__decorate */ .Cg)([
19873
19887
  jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.cache
19874
19888
  ], FileBrowser.prototype, "_dialog", null);
19875
- (0,tslib__WEBPACK_IMPORTED_MODULE_18__/* .__decorate */ .Cg)([
19889
+ (0,tslib__WEBPACK_IMPORTED_MODULE_19__/* .__decorate */ .Cg)([
19876
19890
  jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.cache
19877
19891
  ], FileBrowser.prototype, "storage", null);
19878
- (0,tslib__WEBPACK_IMPORTED_MODULE_18__/* .__decorate */ .Cg)([
19892
+ (0,tslib__WEBPACK_IMPORTED_MODULE_19__/* .__decorate */ .Cg)([
19879
19893
  jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.autobind
19880
19894
  ], FileBrowser.prototype, "status", null);
19881
- (0,tslib__WEBPACK_IMPORTED_MODULE_18__/* .__decorate */ .Cg)([
19895
+ (0,tslib__WEBPACK_IMPORTED_MODULE_19__/* .__decorate */ .Cg)([
19882
19896
  jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.autobind
19883
19897
  ], FileBrowser.prototype, "open", null);
19884
- FileBrowser = (0,tslib__WEBPACK_IMPORTED_MODULE_18__/* .__decorate */ .Cg)([
19885
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.derive)(jodit_core_traits_dlgs__WEBPACK_IMPORTED_MODULE_6__/* .Dlgs */ .z)
19898
+ (0,tslib__WEBPACK_IMPORTED_MODULE_19__/* .__decorate */ .Cg)([
19899
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_3__/* .watch */ .w)('dataProvider:changePermissions')
19900
+ ], FileBrowser.prototype, "__updateToolbarButtons", null);
19901
+ FileBrowser = (0,tslib__WEBPACK_IMPORTED_MODULE_19__/* .__decorate */ .Cg)([
19902
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.derive)(jodit_core_traits_dlgs__WEBPACK_IMPORTED_MODULE_7__/* .Dlgs */ .z)
19886
19903
  ], FileBrowser);
19887
19904
 
19905
+ function isEqualButtonList(prevButtons, buttons) {
19906
+ if (prevButtons.length !== buttons.length) {
19907
+ return false;
19908
+ }
19909
+ for (let i = 0; i < prevButtons.length; i++) {
19910
+ if (prevButtons[i] !== buttons[i]) {
19911
+ return false;
19912
+ }
19913
+ }
19914
+ return true;
19915
+ }
19888
19916
 
19889
19917
 
19890
19918
  /***/ }),
@@ -25038,14 +25066,15 @@ jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__/* .Icon */ .I.set('enter', (_ent
25038
25066
 
25039
25067
  "use strict";
25040
25068
  /* unused harmony export aiAssistant */
25041
- /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(31635);
25042
- /* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(66927);
25043
- /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(56298);
25044
- /* harmony import */ var jodit_core_helpers_checker_is_abort_error__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(99951);
25045
- /* harmony import */ var jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(29866);
25046
- /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(66888);
25047
- /* harmony import */ var _ui_ui_ai_assistant__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(20785);
25048
- /* harmony import */ var _langs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(81026);
25069
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(31635);
25070
+ /* harmony import */ var jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(87875);
25071
+ /* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(66927);
25072
+ /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(56298);
25073
+ /* harmony import */ var jodit_core_helpers_checker_is_abort_error__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(99951);
25074
+ /* harmony import */ var jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(29866);
25075
+ /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(66888);
25076
+ /* harmony import */ var _ui_ui_ai_assistant__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(20785);
25077
+ /* harmony import */ var _langs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(81026);
25049
25078
  /*!
25050
25079
  * Jodit Editor (https://xdsoft.net/jodit/)
25051
25080
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -25059,10 +25088,37 @@ jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__/* .Icon */ .I.set('enter', (_ent
25059
25088
 
25060
25089
 
25061
25090
 
25091
+
25062
25092
  /**
25063
25093
  * The plugin inserts content generated by AI into the editor.
25064
25094
  */
25065
- class aiAssistant extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_2__/* .Plugin */ .k {
25095
+ class aiAssistant extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_3__/* .Plugin */ .k {
25096
+ get __dialog() {
25097
+ return this.jodit.dlg({
25098
+ buttons: ['fullsize', 'dialog.close'],
25099
+ closeOnClickOverlay: true,
25100
+ closeOnEsc: true,
25101
+ resizable: false,
25102
+ draggable: true,
25103
+ minHeight: 160
25104
+ });
25105
+ }
25106
+ get __container() {
25107
+ const { jodit, __dialog } = this;
25108
+ return new _ui_ui_ai_assistant__WEBPACK_IMPORTED_MODULE_5__/* .UiAiAssistant */ .b(jodit, {
25109
+ onInsertAfter(html) {
25110
+ jodit.s.focus();
25111
+ jodit.s.setCursorAfter(jodit.s.current());
25112
+ jodit.s.insertHTML(html);
25113
+ __dialog.close();
25114
+ },
25115
+ onInsert(html) {
25116
+ jodit.s.focus();
25117
+ jodit.s.insertHTML(html);
25118
+ __dialog.close();
25119
+ }
25120
+ });
25121
+ }
25066
25122
  constructor(jodit) {
25067
25123
  super(jodit);
25068
25124
  /** @override */
@@ -25076,45 +25132,20 @@ class aiAssistant extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_2__/
25076
25132
  group: 'insert'
25077
25133
  }
25078
25134
  ];
25079
- (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_1__/* .extendLang */ .JW)(_langs__WEBPACK_IMPORTED_MODULE_5__);
25135
+ (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_2__/* .extendLang */ .JW)(_langs__WEBPACK_IMPORTED_MODULE_6__);
25080
25136
  }
25081
25137
  /** @override */
25082
25138
  afterInit(jodit) { }
25083
25139
  onGenerateAiAssistantForm(prompt) {
25084
- const { jodit } = this;
25085
- const dialog = jodit.dlg({
25086
- buttons: ['fullsize', 'dialog.close'],
25087
- closeOnClickOverlay: true,
25088
- closeOnEsc: true,
25089
- resizable: false,
25090
- draggable: true
25091
- // minWidth: 460,
25092
- // maxWidth: 460
25093
- });
25094
- dialog.bindDestruct(jodit);
25095
- const container = new _ui_ui_ai_assistant__WEBPACK_IMPORTED_MODULE_4__/* .UiAiAssistant */ .b(jodit, {
25096
- onInsertAfter(html) {
25097
- jodit.s.focus();
25098
- jodit.s.setCursorAfter(jodit.s.current());
25099
- jodit.s.insertHTML(html);
25100
- dialog.close();
25101
- },
25102
- onInsert(html) {
25103
- jodit.s.focus();
25104
- jodit.s.insertHTML(html);
25105
- dialog.close();
25106
- }
25107
- });
25108
- container.bindDestruct(dialog);
25109
- dialog.open(container, 'AI Assistant', true, false);
25110
- container.setPrompt(prompt);
25140
+ this.__dialog.open(this.__container, 'AI Assistant');
25141
+ this.__container.setPrompt(prompt);
25111
25142
  }
25112
25143
  onInvokeAiAssistant(prompt) {
25113
25144
  const { jodit } = this;
25114
25145
  jodit.s.focus();
25115
25146
  const selectedText = jodit.s.html;
25116
25147
  jodit.async
25117
- .promise((resolve, reject) => (0,tslib__WEBPACK_IMPORTED_MODULE_6__/* .__awaiter */ .sH)(this, void 0, void 0, function* () {
25148
+ .promise((resolve, reject) => (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__awaiter */ .sH)(this, void 0, void 0, function* () {
25118
25149
  try {
25119
25150
  const result = yield jodit.o.aiAssistant
25120
25151
  .aiAssistantCallback(prompt, selectedText);
@@ -25128,7 +25159,7 @@ class aiAssistant extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_2__/
25128
25159
  jodit.e.fire('ai-assistant-response', htmlFragment);
25129
25160
  })
25130
25161
  .catch(error => {
25131
- if ((0,jodit_core_helpers_checker_is_abort_error__WEBPACK_IMPORTED_MODULE_7__/* .isAbortError */ .z)(error)) {
25162
+ if ((0,jodit_core_helpers_checker_is_abort_error__WEBPACK_IMPORTED_MODULE_8__/* .isAbortError */ .z)(error)) {
25132
25163
  return;
25133
25164
  }
25134
25165
  jodit.message.error(error.message);
@@ -25136,15 +25167,24 @@ class aiAssistant extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_2__/
25136
25167
  });
25137
25168
  }
25138
25169
  /** @override */
25139
- beforeDestruct(_) { }
25170
+ beforeDestruct(_) {
25171
+ this.__container.destruct();
25172
+ this.__dialog.destruct();
25173
+ }
25140
25174
  }
25141
- (0,tslib__WEBPACK_IMPORTED_MODULE_6__/* .__decorate */ .Cg)([
25142
- (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Ay)(':generateAiAssistantForm.ai-assistant')
25175
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
25176
+ jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_0__/* .cache */ .P
25177
+ ], aiAssistant.prototype, "__dialog", null);
25178
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
25179
+ jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_0__/* .cache */ .P
25180
+ ], aiAssistant.prototype, "__container", null);
25181
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
25182
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)(':generateAiAssistantForm.ai-assistant')
25143
25183
  ], aiAssistant.prototype, "onGenerateAiAssistantForm", null);
25144
- (0,tslib__WEBPACK_IMPORTED_MODULE_6__/* .__decorate */ .Cg)([
25145
- (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Ay)(':invokeAiAssistant')
25184
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
25185
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)(':invokeAiAssistant')
25146
25186
  ], aiAssistant.prototype, "onInvokeAiAssistant", null);
25147
- jodit_core_global__WEBPACK_IMPORTED_MODULE_1__/* .pluginSystem */ .fg.add('ai-assistant', aiAssistant);
25187
+ jodit_core_global__WEBPACK_IMPORTED_MODULE_2__/* .pluginSystem */ .fg.add('ai-assistant', aiAssistant);
25148
25188
 
25149
25189
 
25150
25190
  /***/ }),
@@ -25500,13 +25540,13 @@ let UiAiAssistant = class UiAiAssistant extends jodit_core_ui_element__WEBPACK_I
25500
25540
  }
25501
25541
  };
25502
25542
  (0,tslib__WEBPACK_IMPORTED_MODULE_5__/* .__decorate */ .Cg)([
25503
- (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Ay)(':ai-assistant-response')
25543
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_0__/* .watch */ .w)(':ai-assistant-response')
25504
25544
  ], UiAiAssistant.prototype, "onAiAssistentResponse", null);
25505
25545
  (0,tslib__WEBPACK_IMPORTED_MODULE_5__/* .__decorate */ .Cg)([
25506
- (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Ay)(':ai-assistant-error')
25546
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_0__/* .watch */ .w)(':ai-assistant-error')
25507
25547
  ], UiAiAssistant.prototype, "onAiAssistentError", null);
25508
25548
  (0,tslib__WEBPACK_IMPORTED_MODULE_5__/* .__decorate */ .Cg)([
25509
- (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Ay)('promptInput:change')
25549
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_0__/* .watch */ .w)('promptInput:change')
25510
25550
  ], UiAiAssistant.prototype, "onChangePromptValue", null);
25511
25551
  UiAiAssistant = (0,tslib__WEBPACK_IMPORTED_MODULE_5__/* .__decorate */ .Cg)([
25512
25552
  jodit_core_decorators_component_component__WEBPACK_IMPORTED_MODULE_6__/* .component */ .s
@@ -29137,10 +29177,10 @@ class dtd extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_2__/* .Plugin */ .k
29137
29177
  }
29138
29178
  }
29139
29179
  (0,tslib__WEBPACK_IMPORTED_MODULE_6__/* .__decorate */ .Cg)([
29140
- (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_0__/* .watch */ .wB)(':beforeInsertNode')
29180
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_0__/* .watch */ .w)(':beforeInsertNode')
29141
29181
  ], dtd.prototype, "__onBeforeInsertNode", null);
29142
29182
  (0,tslib__WEBPACK_IMPORTED_MODULE_6__/* .__decorate */ .Cg)([
29143
- (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_0__/* .watch */ .wB)(':afterInsertNode')
29183
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_0__/* .watch */ .w)(':afterInsertNode')
29144
29184
  ], dtd.prototype, "__onAfterInsertNode", null);
29145
29185
  jodit_core_global__WEBPACK_IMPORTED_MODULE_1__/* .pluginSystem */ .fg.add('dtd', dtd);
29146
29186