jodit 4.1.12 → 4.1.16

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 (64) hide show
  1. package/es2015/jodit.css +2 -1
  2. package/es2015/jodit.fat.min.css +1 -1
  3. package/es2015/jodit.fat.min.js +2 -2
  4. package/es2015/jodit.js +81 -61
  5. package/es2015/jodit.min.css +1 -1
  6. package/es2015/jodit.min.js +2 -2
  7. package/es2015/plugins/debug/debug.js +1 -1
  8. package/es2015/plugins/debug/debug.min.js +1 -1
  9. package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
  10. package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
  11. package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
  12. package/es2018/jodit.css +2 -1
  13. package/es2018/jodit.fat.min.css +1 -1
  14. package/es2018/jodit.fat.min.js +2 -2
  15. package/es2018/jodit.js +80 -60
  16. package/es2018/jodit.min.css +1 -1
  17. package/es2018/jodit.min.js +2 -2
  18. package/es2018/plugins/debug/debug.js +1 -1
  19. package/es2018/plugins/debug/debug.min.js +1 -1
  20. package/es2018/plugins/speech-recognize/speech-recognize.css +1 -1
  21. package/es2018/plugins/speech-recognize/speech-recognize.js +1 -1
  22. package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
  23. package/es2021/jodit.css +2 -1
  24. package/es2021/jodit.fat.min.css +1 -1
  25. package/es2021/jodit.fat.min.js +2 -2
  26. package/es2021/jodit.js +79 -60
  27. package/es2021/jodit.min.css +1 -1
  28. package/es2021/jodit.min.js +2 -2
  29. package/es2021/plugins/debug/debug.js +1 -1
  30. package/es2021/plugins/debug/debug.min.js +1 -1
  31. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  32. package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
  33. package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
  34. package/es2021.en/jodit.css +2 -1
  35. package/es2021.en/jodit.fat.min.css +1 -1
  36. package/es2021.en/jodit.fat.min.js +2 -2
  37. package/es2021.en/jodit.js +79 -60
  38. package/es2021.en/jodit.min.css +1 -1
  39. package/es2021.en/jodit.min.js +2 -2
  40. package/es2021.en/plugins/debug/debug.js +1 -1
  41. package/es2021.en/plugins/debug/debug.min.js +1 -1
  42. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  43. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
  44. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
  45. package/es5/jodit.css +3 -2
  46. package/es5/jodit.fat.min.css +1 -1
  47. package/es5/jodit.fat.min.js +2 -2
  48. package/es5/jodit.js +91 -63
  49. package/es5/jodit.min.css +3 -3
  50. package/es5/jodit.min.js +2 -2
  51. package/es5/plugins/debug/debug.js +1 -1
  52. package/es5/plugins/debug/debug.min.js +1 -1
  53. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  54. package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
  55. package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
  56. package/esm/core/constants.js +1 -1
  57. package/esm/core/decorators/cache/cache.d.ts +2 -1
  58. package/esm/core/decorators/cache/cache.js +7 -0
  59. package/esm/core/ui/button/tooltip/tooltip.js +2 -4
  60. package/esm/plugins/ai-assistant/ai-assistant.d.ts +2 -0
  61. package/esm/plugins/ai-assistant/ai-assistant.js +39 -28
  62. package/package.json +1 -1
  63. package/types/core/decorators/cache/cache.d.ts +2 -1
  64. 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.12
4
+ * Version: v4.1.16
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.12";
1710
+ const APP_VERSION = "4.1.16";
1711
1711
  // prettier-ignore
1712
1712
  const ES = "es2018";
1713
1713
  const IS_ES_MODERN = true;
@@ -2110,8 +2110,9 @@ class Create {
2110
2110
 
2111
2111
  "use strict";
2112
2112
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2113
- /* harmony export */ O: function() { return /* binding */ cacheHTML; },
2114
- /* harmony export */ P: function() { return /* binding */ cache; }
2113
+ /* harmony export */ OK: function() { return /* binding */ cacheHTML; },
2114
+ /* harmony export */ PO: function() { return /* binding */ cached; },
2115
+ /* harmony export */ PP: function() { return /* binding */ cache; }
2115
2116
  /* harmony export */ });
2116
2117
  /* harmony import */ var jodit_core_component_statuses__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(64567);
2117
2118
  /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(55186);
@@ -2126,6 +2127,13 @@ class Create {
2126
2127
 
2127
2128
 
2128
2129
 
2130
+ function cached(object, property) {
2131
+ const descriptor = Object.getOwnPropertyDescriptor(object, property);
2132
+ if (!descriptor || (0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_2__/* .isFunction */ .Tn)(descriptor.get)) {
2133
+ return null;
2134
+ }
2135
+ return descriptor.value;
2136
+ }
2129
2137
  function cache(_, name, descriptor) {
2130
2138
  const getter = descriptor.get;
2131
2139
  if (!getter) {
@@ -2394,8 +2402,9 @@ function idle() {
2394
2402
  __webpack_require__.r(__webpack_exports__);
2395
2403
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2396
2404
  /* harmony export */ autobind: function() { return /* reexport safe */ _autobind_autobind__WEBPACK_IMPORTED_MODULE_0__.d; },
2397
- /* harmony export */ cache: function() { return /* reexport safe */ _cache_cache__WEBPACK_IMPORTED_MODULE_1__.P; },
2398
- /* harmony export */ cacheHTML: function() { return /* reexport safe */ _cache_cache__WEBPACK_IMPORTED_MODULE_1__.O; },
2405
+ /* harmony export */ cache: function() { return /* reexport safe */ _cache_cache__WEBPACK_IMPORTED_MODULE_1__.PP; },
2406
+ /* harmony export */ cacheHTML: function() { return /* reexport safe */ _cache_cache__WEBPACK_IMPORTED_MODULE_1__.OK; },
2407
+ /* harmony export */ cached: function() { return /* reexport safe */ _cache_cache__WEBPACK_IMPORTED_MODULE_1__.PO; },
2399
2408
  /* harmony export */ component: function() { return /* reexport safe */ _component_component__WEBPACK_IMPORTED_MODULE_2__.s; },
2400
2409
  /* harmony export */ debounce: function() { return /* reexport safe */ _debounce_debounce__WEBPACK_IMPORTED_MODULE_3__.s; },
2401
2410
  /* harmony export */ derive: function() { return /* reexport safe */ _derive_derive__WEBPACK_IMPORTED_MODULE_4__.C; },
@@ -13306,7 +13315,8 @@ let UITooltip = UITooltip_1 = class UITooltip extends jodit_core_ui_element__WEB
13306
13315
  view.o.showTooltip &&
13307
13316
  !view.o.useNativeTooltip) {
13308
13317
  view.hookStatus(jodit_core_component__WEBPACK_IMPORTED_MODULE_0__/* .STATUSES */ .f.ready, () => {
13309
- (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_3__/* .getContainer */ .My)(view, UITooltip_1).appendChild(this.container);
13318
+ // TODO Move it inside __open method. Now it is here becous testcase failed with capturing
13319
+ (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_3__/* .getContainer */ .My)(this.j, UITooltip_1).appendChild(this.container);
13310
13320
  view.e.on(view.container, 'mouseenter.tooltip', this.__onMouseEnter, {
13311
13321
  capture: true
13312
13322
  });
@@ -13435,9 +13445,6 @@ let UITooltip = UITooltip_1 = class UITooltip extends jodit_core_ui_element__WEB
13435
13445
  (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
13436
13446
  jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.autobind
13437
13447
  ], UITooltip.prototype, "__onMouseEnter", null);
13438
- (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
13439
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.autobind
13440
- ], UITooltip.prototype, "__delayOpen", null);
13441
13448
  (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
13442
13449
  jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.autobind
13443
13450
  ], UITooltip.prototype, "__hide", null);
@@ -16072,22 +16079,22 @@ View.version = jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.APP_VERSION;
16072
16079
  View.esNext = jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.IS_ES_NEXT; // from webpack.config.js
16073
16080
  View.esModern = jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.IS_ES_MODERN; // from webpack.config.js
16074
16081
  (0,tslib__WEBPACK_IMPORTED_MODULE_15__/* .__decorate */ .Cg)([
16075
- jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .P
16082
+ jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .PP
16076
16083
  ], View.prototype, "buffer", null);
16077
16084
  (0,tslib__WEBPACK_IMPORTED_MODULE_15__/* .__decorate */ .Cg)([
16078
- jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .P
16085
+ jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .PP
16079
16086
  ], View.prototype, "message", null);
16080
16087
  (0,tslib__WEBPACK_IMPORTED_MODULE_15__/* .__decorate */ .Cg)([
16081
- jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .P
16088
+ jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .PP
16082
16089
  ], View.prototype, "storage", null);
16083
16090
  (0,tslib__WEBPACK_IMPORTED_MODULE_15__/* .__decorate */ .Cg)([
16084
- jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .P
16091
+ jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .PP
16085
16092
  ], View.prototype, "c", null);
16086
16093
  (0,tslib__WEBPACK_IMPORTED_MODULE_15__/* .__decorate */ .Cg)([
16087
- jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .P
16094
+ jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .PP
16088
16095
  ], View.prototype, "e", null);
16089
16096
  (0,tslib__WEBPACK_IMPORTED_MODULE_15__/* .__decorate */ .Cg)([
16090
- jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .P
16097
+ jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .PP
16091
16098
  ], View.prototype, "progressbar", null);
16092
16099
  (0,tslib__WEBPACK_IMPORTED_MODULE_15__/* .__decorate */ .Cg)([
16093
16100
  (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_6__/* .hook */ .A)(jodit_core_component_statuses__WEBPACK_IMPORTED_MODULE_2__/* .STATUSES */ .f.beforeDestruct)
@@ -25149,14 +25156,15 @@ jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__/* .Icon */ .I.set('enter', (_ent
25149
25156
 
25150
25157
  "use strict";
25151
25158
  /* unused harmony export aiAssistant */
25152
- /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(31635);
25153
- /* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(66927);
25154
- /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(56298);
25155
- /* harmony import */ var jodit_core_helpers_checker_is_abort_error__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(99951);
25156
- /* harmony import */ var jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(29866);
25157
- /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(66888);
25158
- /* harmony import */ var _ui_ui_ai_assistant__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(20785);
25159
- /* harmony import */ var _langs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(81026);
25159
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(31635);
25160
+ /* harmony import */ var jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(87875);
25161
+ /* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(66927);
25162
+ /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(56298);
25163
+ /* harmony import */ var jodit_core_helpers_checker_is_abort_error__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(99951);
25164
+ /* harmony import */ var jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(29866);
25165
+ /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(66888);
25166
+ /* harmony import */ var _ui_ui_ai_assistant__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(20785);
25167
+ /* harmony import */ var _langs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(81026);
25160
25168
  /*!
25161
25169
  * Jodit Editor (https://xdsoft.net/jodit/)
25162
25170
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -25170,10 +25178,37 @@ jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__/* .Icon */ .I.set('enter', (_ent
25170
25178
 
25171
25179
 
25172
25180
 
25181
+
25173
25182
  /**
25174
25183
  * The plugin inserts content generated by AI into the editor.
25175
25184
  */
25176
- class aiAssistant extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_2__/* .Plugin */ .k {
25185
+ class aiAssistant extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_3__/* .Plugin */ .k {
25186
+ get __dialog() {
25187
+ return this.jodit.dlg({
25188
+ buttons: ['fullsize', 'dialog.close'],
25189
+ closeOnClickOverlay: true,
25190
+ closeOnEsc: true,
25191
+ resizable: false,
25192
+ draggable: true,
25193
+ minHeight: 160
25194
+ });
25195
+ }
25196
+ get __container() {
25197
+ const { jodit, __dialog } = this;
25198
+ return new _ui_ui_ai_assistant__WEBPACK_IMPORTED_MODULE_5__/* .UiAiAssistant */ .b(jodit, {
25199
+ onInsertAfter(html) {
25200
+ jodit.s.focus();
25201
+ jodit.s.setCursorAfter(jodit.s.current());
25202
+ jodit.s.insertHTML(html);
25203
+ __dialog.close();
25204
+ },
25205
+ onInsert(html) {
25206
+ jodit.s.focus();
25207
+ jodit.s.insertHTML(html);
25208
+ __dialog.close();
25209
+ }
25210
+ });
25211
+ }
25177
25212
  constructor(jodit) {
25178
25213
  super(jodit);
25179
25214
  /** @override */
@@ -25187,38 +25222,13 @@ class aiAssistant extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_2__/
25187
25222
  group: 'insert'
25188
25223
  }
25189
25224
  ];
25190
- (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_1__/* .extendLang */ .JW)(_langs__WEBPACK_IMPORTED_MODULE_5__);
25225
+ (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_2__/* .extendLang */ .JW)(_langs__WEBPACK_IMPORTED_MODULE_6__);
25191
25226
  }
25192
25227
  /** @override */
25193
25228
  afterInit(jodit) { }
25194
25229
  onGenerateAiAssistantForm(prompt) {
25195
- const { jodit } = this;
25196
- const dialog = jodit.dlg({
25197
- buttons: ['fullsize', 'dialog.close'],
25198
- closeOnClickOverlay: true,
25199
- closeOnEsc: true,
25200
- resizable: false,
25201
- draggable: true
25202
- // minWidth: 460,
25203
- // maxWidth: 460
25204
- });
25205
- dialog.bindDestruct(jodit);
25206
- const container = new _ui_ui_ai_assistant__WEBPACK_IMPORTED_MODULE_4__/* .UiAiAssistant */ .b(jodit, {
25207
- onInsertAfter(html) {
25208
- jodit.s.focus();
25209
- jodit.s.setCursorAfter(jodit.s.current());
25210
- jodit.s.insertHTML(html);
25211
- dialog.close();
25212
- },
25213
- onInsert(html) {
25214
- jodit.s.focus();
25215
- jodit.s.insertHTML(html);
25216
- dialog.close();
25217
- }
25218
- });
25219
- container.bindDestruct(dialog);
25220
- dialog.open(container, 'AI Assistant', true, false);
25221
- container.setPrompt(prompt);
25230
+ this.__dialog.open(this.__container, 'AI Assistant');
25231
+ this.__container.setPrompt(prompt);
25222
25232
  }
25223
25233
  onInvokeAiAssistant(prompt) {
25224
25234
  const { jodit } = this;
@@ -25239,7 +25249,7 @@ class aiAssistant extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_2__/
25239
25249
  jodit.e.fire('ai-assistant-response', htmlFragment);
25240
25250
  })
25241
25251
  .catch(error => {
25242
- if ((0,jodit_core_helpers_checker_is_abort_error__WEBPACK_IMPORTED_MODULE_6__/* .isAbortError */ .z)(error)) {
25252
+ if ((0,jodit_core_helpers_checker_is_abort_error__WEBPACK_IMPORTED_MODULE_7__/* .isAbortError */ .z)(error)) {
25243
25253
  return;
25244
25254
  }
25245
25255
  jodit.message.error(error.message);
@@ -25247,15 +25257,25 @@ class aiAssistant extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_2__/
25247
25257
  });
25248
25258
  }
25249
25259
  /** @override */
25250
- beforeDestruct(_) { }
25260
+ beforeDestruct(_) {
25261
+ var _a, _b;
25262
+ (_a = (0,jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_0__/* .cached */ .PO)(this, '__container')) === null || _a === void 0 ? void 0 : _a.destruct();
25263
+ (_b = (0,jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_0__/* .cached */ .PO)(this, '__dialog')) === null || _b === void 0 ? void 0 : _b.destruct();
25264
+ }
25251
25265
  }
25252
- (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
25253
- (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_0__/* .watch */ .w)(':generateAiAssistantForm.ai-assistant')
25266
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
25267
+ jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_0__/* .cache */ .PP
25268
+ ], aiAssistant.prototype, "__dialog", null);
25269
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
25270
+ jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_0__/* .cache */ .PP
25271
+ ], aiAssistant.prototype, "__container", null);
25272
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
25273
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)(':generateAiAssistantForm.ai-assistant')
25254
25274
  ], aiAssistant.prototype, "onGenerateAiAssistantForm", null);
25255
- (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
25256
- (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_0__/* .watch */ .w)(':invokeAiAssistant')
25275
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
25276
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)(':invokeAiAssistant')
25257
25277
  ], aiAssistant.prototype, "onInvokeAiAssistant", null);
25258
- jodit_core_global__WEBPACK_IMPORTED_MODULE_1__/* .pluginSystem */ .fg.add('ai-assistant', aiAssistant);
25278
+ jodit_core_global__WEBPACK_IMPORTED_MODULE_2__/* .pluginSystem */ .fg.add('ai-assistant', aiAssistant);
25259
25279
 
25260
25280
 
25261
25281
  /***/ }),