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
@@ -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
  */
@@ -1708,7 +1708,7 @@ __webpack_require__.r(__webpack_exports__);
1708
1708
  * Released under MIT see LICENSE.txt in the project root for license information.
1709
1709
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
1710
1710
  */
1711
- const APP_VERSION = "4.1.12";
1711
+ const APP_VERSION = "4.1.16";
1712
1712
  // prettier-ignore
1713
1713
  const ES = "es2021";
1714
1714
  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) {
@@ -2393,8 +2401,9 @@ function idle() {
2393
2401
  __webpack_require__.r(__webpack_exports__);
2394
2402
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2395
2403
  /* harmony export */ autobind: function() { return /* reexport safe */ _autobind_autobind__WEBPACK_IMPORTED_MODULE_0__.d; },
2396
- /* harmony export */ cache: function() { return /* reexport safe */ _cache_cache__WEBPACK_IMPORTED_MODULE_1__.P; },
2397
- /* harmony export */ cacheHTML: function() { return /* reexport safe */ _cache_cache__WEBPACK_IMPORTED_MODULE_1__.O; },
2404
+ /* harmony export */ cache: function() { return /* reexport safe */ _cache_cache__WEBPACK_IMPORTED_MODULE_1__.PP; },
2405
+ /* harmony export */ cacheHTML: function() { return /* reexport safe */ _cache_cache__WEBPACK_IMPORTED_MODULE_1__.OK; },
2406
+ /* harmony export */ cached: function() { return /* reexport safe */ _cache_cache__WEBPACK_IMPORTED_MODULE_1__.PO; },
2398
2407
  /* harmony export */ component: function() { return /* reexport safe */ _component_component__WEBPACK_IMPORTED_MODULE_2__.s; },
2399
2408
  /* harmony export */ debounce: function() { return /* reexport safe */ _debounce_debounce__WEBPACK_IMPORTED_MODULE_3__.s; },
2400
2409
  /* harmony export */ derive: function() { return /* reexport safe */ _derive_derive__WEBPACK_IMPORTED_MODULE_4__.C; },
@@ -13266,7 +13275,8 @@ let UITooltip = UITooltip_1 = class UITooltip extends jodit_core_ui_element__WEB
13266
13275
  view.o.showTooltip &&
13267
13276
  !view.o.useNativeTooltip) {
13268
13277
  view.hookStatus(jodit_core_component__WEBPACK_IMPORTED_MODULE_0__/* .STATUSES */ .f.ready, () => {
13269
- (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_3__/* .getContainer */ .My)(view, UITooltip_1).appendChild(this.container);
13278
+ // TODO Move it inside __open method. Now it is here becous testcase failed with capturing
13279
+ (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_3__/* .getContainer */ .My)(this.j, UITooltip_1).appendChild(this.container);
13270
13280
  view.e.on(view.container, 'mouseenter.tooltip', this.__onMouseEnter, {
13271
13281
  capture: true
13272
13282
  });
@@ -13395,9 +13405,6 @@ let UITooltip = UITooltip_1 = class UITooltip extends jodit_core_ui_element__WEB
13395
13405
  (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
13396
13406
  jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.autobind
13397
13407
  ], UITooltip.prototype, "__onMouseEnter", null);
13398
- (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
13399
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.autobind
13400
- ], UITooltip.prototype, "__delayOpen", null);
13401
13408
  (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
13402
13409
  jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.autobind
13403
13410
  ], UITooltip.prototype, "__hide", null);
@@ -16023,22 +16030,22 @@ View.version = jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.APP_VERSION;
16023
16030
  View.esNext = jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.IS_ES_NEXT; // from webpack.config.js
16024
16031
  View.esModern = jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.IS_ES_MODERN; // from webpack.config.js
16025
16032
  (0,tslib__WEBPACK_IMPORTED_MODULE_15__/* .__decorate */ .Cg)([
16026
- jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .P
16033
+ jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .PP
16027
16034
  ], View.prototype, "buffer", null);
16028
16035
  (0,tslib__WEBPACK_IMPORTED_MODULE_15__/* .__decorate */ .Cg)([
16029
- jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .P
16036
+ jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .PP
16030
16037
  ], View.prototype, "message", null);
16031
16038
  (0,tslib__WEBPACK_IMPORTED_MODULE_15__/* .__decorate */ .Cg)([
16032
- jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .P
16039
+ jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .PP
16033
16040
  ], View.prototype, "storage", null);
16034
16041
  (0,tslib__WEBPACK_IMPORTED_MODULE_15__/* .__decorate */ .Cg)([
16035
- jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .P
16042
+ jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .PP
16036
16043
  ], View.prototype, "c", null);
16037
16044
  (0,tslib__WEBPACK_IMPORTED_MODULE_15__/* .__decorate */ .Cg)([
16038
- jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .P
16045
+ jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .PP
16039
16046
  ], View.prototype, "e", null);
16040
16047
  (0,tslib__WEBPACK_IMPORTED_MODULE_15__/* .__decorate */ .Cg)([
16041
- jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .P
16048
+ jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_5__/* .cache */ .PP
16042
16049
  ], View.prototype, "progressbar", null);
16043
16050
  (0,tslib__WEBPACK_IMPORTED_MODULE_15__/* .__decorate */ .Cg)([
16044
16051
  (0,jodit_core_decorators_hook_hook__WEBPACK_IMPORTED_MODULE_6__/* .hook */ .A)(jodit_core_component_statuses__WEBPACK_IMPORTED_MODULE_2__/* .STATUSES */ .f.beforeDestruct)
@@ -25053,14 +25060,15 @@ jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__/* .Icon */ .I.set('enter', (_ent
25053
25060
 
25054
25061
  "use strict";
25055
25062
  /* unused harmony export aiAssistant */
25056
- /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(31635);
25057
- /* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(66927);
25058
- /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(56298);
25059
- /* harmony import */ var jodit_core_helpers_checker_is_abort_error__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(99951);
25060
- /* harmony import */ var jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(29866);
25061
- /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(66888);
25062
- /* harmony import */ var _ui_ui_ai_assistant__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(20785);
25063
- /* harmony import */ var _langs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(81026);
25063
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(31635);
25064
+ /* harmony import */ var jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(87875);
25065
+ /* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(66927);
25066
+ /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(56298);
25067
+ /* harmony import */ var jodit_core_helpers_checker_is_abort_error__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(99951);
25068
+ /* harmony import */ var jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(29866);
25069
+ /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(66888);
25070
+ /* harmony import */ var _ui_ui_ai_assistant__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(20785);
25071
+ /* harmony import */ var _langs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(81026);
25064
25072
  /*!
25065
25073
  * Jodit Editor (https://xdsoft.net/jodit/)
25066
25074
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -25074,10 +25082,37 @@ jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__/* .Icon */ .I.set('enter', (_ent
25074
25082
 
25075
25083
 
25076
25084
 
25085
+
25077
25086
  /**
25078
25087
  * The plugin inserts content generated by AI into the editor.
25079
25088
  */
25080
- class aiAssistant extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_2__/* .Plugin */ .k {
25089
+ class aiAssistant extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_3__/* .Plugin */ .k {
25090
+ get __dialog() {
25091
+ return this.jodit.dlg({
25092
+ buttons: ['fullsize', 'dialog.close'],
25093
+ closeOnClickOverlay: true,
25094
+ closeOnEsc: true,
25095
+ resizable: false,
25096
+ draggable: true,
25097
+ minHeight: 160
25098
+ });
25099
+ }
25100
+ get __container() {
25101
+ const { jodit, __dialog } = this;
25102
+ return new _ui_ui_ai_assistant__WEBPACK_IMPORTED_MODULE_5__/* .UiAiAssistant */ .b(jodit, {
25103
+ onInsertAfter(html) {
25104
+ jodit.s.focus();
25105
+ jodit.s.setCursorAfter(jodit.s.current());
25106
+ jodit.s.insertHTML(html);
25107
+ __dialog.close();
25108
+ },
25109
+ onInsert(html) {
25110
+ jodit.s.focus();
25111
+ jodit.s.insertHTML(html);
25112
+ __dialog.close();
25113
+ }
25114
+ });
25115
+ }
25081
25116
  constructor(jodit) {
25082
25117
  super(jodit);
25083
25118
  /** @override */
@@ -25091,38 +25126,13 @@ class aiAssistant extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_2__/
25091
25126
  group: 'insert'
25092
25127
  }
25093
25128
  ];
25094
- (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_1__/* .extendLang */ .JW)(_langs__WEBPACK_IMPORTED_MODULE_5__);
25129
+ (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_2__/* .extendLang */ .JW)(_langs__WEBPACK_IMPORTED_MODULE_6__);
25095
25130
  }
25096
25131
  /** @override */
25097
25132
  afterInit(jodit) { }
25098
25133
  onGenerateAiAssistantForm(prompt) {
25099
- const { jodit } = this;
25100
- const dialog = jodit.dlg({
25101
- buttons: ['fullsize', 'dialog.close'],
25102
- closeOnClickOverlay: true,
25103
- closeOnEsc: true,
25104
- resizable: false,
25105
- draggable: true
25106
- // minWidth: 460,
25107
- // maxWidth: 460
25108
- });
25109
- dialog.bindDestruct(jodit);
25110
- const container = new _ui_ui_ai_assistant__WEBPACK_IMPORTED_MODULE_4__/* .UiAiAssistant */ .b(jodit, {
25111
- onInsertAfter(html) {
25112
- jodit.s.focus();
25113
- jodit.s.setCursorAfter(jodit.s.current());
25114
- jodit.s.insertHTML(html);
25115
- dialog.close();
25116
- },
25117
- onInsert(html) {
25118
- jodit.s.focus();
25119
- jodit.s.insertHTML(html);
25120
- dialog.close();
25121
- }
25122
- });
25123
- container.bindDestruct(dialog);
25124
- dialog.open(container, 'AI Assistant', true, false);
25125
- container.setPrompt(prompt);
25134
+ this.__dialog.open(this.__container, 'AI Assistant');
25135
+ this.__container.setPrompt(prompt);
25126
25136
  }
25127
25137
  onInvokeAiAssistant(prompt) {
25128
25138
  const { jodit } = this;
@@ -25143,7 +25153,7 @@ class aiAssistant extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_2__/
25143
25153
  jodit.e.fire('ai-assistant-response', htmlFragment);
25144
25154
  })
25145
25155
  .catch(error => {
25146
- if ((0,jodit_core_helpers_checker_is_abort_error__WEBPACK_IMPORTED_MODULE_6__/* .isAbortError */ .z)(error)) {
25156
+ if ((0,jodit_core_helpers_checker_is_abort_error__WEBPACK_IMPORTED_MODULE_7__/* .isAbortError */ .z)(error)) {
25147
25157
  return;
25148
25158
  }
25149
25159
  jodit.message.error(error.message);
@@ -25151,15 +25161,24 @@ class aiAssistant extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_2__/
25151
25161
  });
25152
25162
  }
25153
25163
  /** @override */
25154
- beforeDestruct(_) { }
25164
+ beforeDestruct(_) {
25165
+ (0,jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_0__/* .cached */ .PO)(this, '__container')?.destruct();
25166
+ (0,jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_0__/* .cached */ .PO)(this, '__dialog')?.destruct();
25167
+ }
25155
25168
  }
25156
- (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
25157
- (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_0__/* .watch */ .w)(':generateAiAssistantForm.ai-assistant')
25169
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
25170
+ jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_0__/* .cache */ .PP
25171
+ ], aiAssistant.prototype, "__dialog", null);
25172
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
25173
+ jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_0__/* .cache */ .PP
25174
+ ], aiAssistant.prototype, "__container", null);
25175
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
25176
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)(':generateAiAssistantForm.ai-assistant')
25158
25177
  ], aiAssistant.prototype, "onGenerateAiAssistantForm", null);
25159
- (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
25160
- (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_0__/* .watch */ .w)(':invokeAiAssistant')
25178
+ (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .Cg)([
25179
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)(':invokeAiAssistant')
25161
25180
  ], aiAssistant.prototype, "onInvokeAiAssistant", null);
25162
- jodit_core_global__WEBPACK_IMPORTED_MODULE_1__/* .pluginSystem */ .fg.add('ai-assistant', aiAssistant);
25181
+ jodit_core_global__WEBPACK_IMPORTED_MODULE_2__/* .pluginSystem */ .fg.add('ai-assistant', aiAssistant);
25163
25182
 
25164
25183
 
25165
25184
  /***/ }),