jodit 4.1.12 → 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 (60) 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 +59 -47
  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 +58 -46
  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 +58 -46
  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 +58 -46
  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 +69 -49
  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/plugins/ai-assistant/ai-assistant.d.ts +2 -0
  58. package/esm/plugins/ai-assistant/ai-assistant.js +39 -28
  59. package/package.json +1 -1
  60. 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.12
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.12";
1710
+ const APP_VERSION = "4.1.14";
1711
1711
  // prettier-ignore
1712
1712
  const ES = "es2015";
1713
1713
  const IS_ES_MODERN = true;
@@ -25066,14 +25066,15 @@ jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__/* .Icon */ .I.set('enter', (_ent
25066
25066
 
25067
25067
  "use strict";
25068
25068
  /* unused harmony export aiAssistant */
25069
- /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(31635);
25070
- /* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(66927);
25071
- /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(56298);
25072
- /* harmony import */ var jodit_core_helpers_checker_is_abort_error__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(99951);
25073
- /* harmony import */ var jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(29866);
25074
- /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(66888);
25075
- /* harmony import */ var _ui_ui_ai_assistant__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(20785);
25076
- /* 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);
25077
25078
  /*!
25078
25079
  * Jodit Editor (https://xdsoft.net/jodit/)
25079
25080
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -25087,10 +25088,37 @@ jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__/* .Icon */ .I.set('enter', (_ent
25087
25088
 
25088
25089
 
25089
25090
 
25091
+
25090
25092
  /**
25091
25093
  * The plugin inserts content generated by AI into the editor.
25092
25094
  */
25093
- 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
+ }
25094
25122
  constructor(jodit) {
25095
25123
  super(jodit);
25096
25124
  /** @override */
@@ -25104,45 +25132,20 @@ class aiAssistant extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_2__/
25104
25132
  group: 'insert'
25105
25133
  }
25106
25134
  ];
25107
- (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__);
25108
25136
  }
25109
25137
  /** @override */
25110
25138
  afterInit(jodit) { }
25111
25139
  onGenerateAiAssistantForm(prompt) {
25112
- const { jodit } = this;
25113
- const dialog = jodit.dlg({
25114
- buttons: ['fullsize', 'dialog.close'],
25115
- closeOnClickOverlay: true,
25116
- closeOnEsc: true,
25117
- resizable: false,
25118
- draggable: true
25119
- // minWidth: 460,
25120
- // maxWidth: 460
25121
- });
25122
- dialog.bindDestruct(jodit);
25123
- const container = new _ui_ui_ai_assistant__WEBPACK_IMPORTED_MODULE_4__/* .UiAiAssistant */ .b(jodit, {
25124
- onInsertAfter(html) {
25125
- jodit.s.focus();
25126
- jodit.s.setCursorAfter(jodit.s.current());
25127
- jodit.s.insertHTML(html);
25128
- dialog.close();
25129
- },
25130
- onInsert(html) {
25131
- jodit.s.focus();
25132
- jodit.s.insertHTML(html);
25133
- dialog.close();
25134
- }
25135
- });
25136
- container.bindDestruct(dialog);
25137
- dialog.open(container, 'AI Assistant', true, false);
25138
- container.setPrompt(prompt);
25140
+ this.__dialog.open(this.__container, 'AI Assistant');
25141
+ this.__container.setPrompt(prompt);
25139
25142
  }
25140
25143
  onInvokeAiAssistant(prompt) {
25141
25144
  const { jodit } = this;
25142
25145
  jodit.s.focus();
25143
25146
  const selectedText = jodit.s.html;
25144
25147
  jodit.async
25145
- .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* () {
25146
25149
  try {
25147
25150
  const result = yield jodit.o.aiAssistant
25148
25151
  .aiAssistantCallback(prompt, selectedText);
@@ -25156,7 +25159,7 @@ class aiAssistant extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_2__/
25156
25159
  jodit.e.fire('ai-assistant-response', htmlFragment);
25157
25160
  })
25158
25161
  .catch(error => {
25159
- 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)) {
25160
25163
  return;
25161
25164
  }
25162
25165
  jodit.message.error(error.message);
@@ -25164,15 +25167,24 @@ class aiAssistant extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_2__/
25164
25167
  });
25165
25168
  }
25166
25169
  /** @override */
25167
- beforeDestruct(_) { }
25170
+ beforeDestruct(_) {
25171
+ this.__container.destruct();
25172
+ this.__dialog.destruct();
25173
+ }
25168
25174
  }
25169
- (0,tslib__WEBPACK_IMPORTED_MODULE_6__/* .__decorate */ .Cg)([
25170
- (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_0__/* .watch */ .w)(':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')
25171
25183
  ], aiAssistant.prototype, "onGenerateAiAssistantForm", null);
25172
- (0,tslib__WEBPACK_IMPORTED_MODULE_6__/* .__decorate */ .Cg)([
25173
- (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_0__/* .watch */ .w)(':invokeAiAssistant')
25184
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .Cg)([
25185
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)(':invokeAiAssistant')
25174
25186
  ], aiAssistant.prototype, "onInvokeAiAssistant", null);
25175
- 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);
25176
25188
 
25177
25189
 
25178
25190
  /***/ }),