jodit 3.18.2 → 3.18.3

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 (36) hide show
  1. package/.idea/workspace.xml +78 -36
  2. package/CHANGELOG.MD +12 -6
  3. package/README.md +2 -2
  4. package/build/jodit.css +2 -2
  5. package/build/jodit.es2018.css +1 -1
  6. package/build/jodit.es2018.en.css +1 -1
  7. package/build/jodit.es2018.en.js +27 -14
  8. package/build/jodit.es2018.en.min.js +1 -1
  9. package/build/jodit.es2018.js +27 -14
  10. package/build/jodit.es2018.min.js +1 -1
  11. package/build/jodit.js +35 -14
  12. package/build/jodit.min.css +1 -1
  13. package/build/jodit.min.js +1 -1
  14. package/build/vdom.css +1 -1
  15. package/build/vdom.js +1 -1
  16. package/package.json +1 -1
  17. package/src/core/helpers/html/safe-html.ts +4 -0
  18. package/src/core/helpers/utils/reset.ts +4 -0
  19. package/src/core/helpers/utils/scroll-into-view.ts +4 -0
  20. package/src/plugins/clipboard/paste/helpers.ts +13 -4
  21. package/src/plugins/source/editor/engines/ace.ts +4 -0
  22. package/src/plugins/source/editor/engines/area.ts +4 -0
  23. package/src/plugins/source/source.ts +10 -12
  24. package/src/plugins/speech/speech-recognize/README.md +0 -0
  25. package/src/plugins/speech/speech-recognize/config.ts +23 -0
  26. package/src/plugins/speech/speech-recognize/helpers/microphone-input.ts +218 -0
  27. package/src/plugins/speech/speech-recognize/helpers/voice-command.ts +118 -0
  28. package/src/plugins/speech/speech-recognize/icon.svg +5 -0
  29. package/src/plugins/speech/speech-recognize/speech-recognize.ts +38 -0
  30. package/src/types/events.d.ts +12 -1
  31. package/src/types/source.d.ts +1 -0
  32. package/types/core/helpers/utils/reset.d.ts +3 -0
  33. package/types/plugins/source/editor/engines/ace.d.ts +1 -0
  34. package/types/plugins/source/editor/engines/area.d.ts +1 -0
  35. package/types/types/events.d.ts +12 -1
  36. package/types/types/source.d.ts +1 -0
package/build/jodit.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/)
4
- * Version: v3.18.2
4
+ * Version: v3.18.3
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -16297,7 +16297,7 @@ var View = (function (_super) {
16297
16297
  _this.isView = true;
16298
16298
  _this.mods = {};
16299
16299
  _this.components = new Set();
16300
- _this.version = "3.18.2";
16300
+ _this.version = "3.18.3";
16301
16301
  _this.buffer = storage_1.Storage.makeStorage();
16302
16302
  _this.storage = storage_1.Storage.makeStorage(true, _this.componentName);
16303
16303
  _this.OPTIONS = View.defaultOptions;
@@ -16443,10 +16443,10 @@ var View = (function (_super) {
16443
16443
  configurable: true
16444
16444
  });
16445
16445
  View.prototype.getVersion = function () {
16446
- return "3.18.2";
16446
+ return "3.18.3";
16447
16447
  };
16448
16448
  View.getVersion = function () {
16449
- return "3.18.2";
16449
+ return "3.18.3";
16450
16450
  };
16451
16451
  View.prototype.initOptions = function (options) {
16452
16452
  this.options = (0, helpers_1.ConfigProto)(options || {}, (0, helpers_1.ConfigProto)(this.options || {}, View.defaultOptions));
@@ -29682,13 +29682,23 @@ function askInsertTypeDialog(jodit, msg, title, callback, buttonList) {
29682
29682
  text: text,
29683
29683
  name: text.toLowerCase(),
29684
29684
  tabIndex: 0
29685
- }).onAction(function () { return callback(value); });
29685
+ }).onAction(function () {
29686
+ dialog.close();
29687
+ callback(value);
29688
+ });
29689
+ });
29690
+ dialog.e.one(dialog, 'afterClose', function () {
29691
+ if (!jodit.s.isFocused()) {
29692
+ jodit.s.focus();
29693
+ }
29686
29694
  });
29687
29695
  var cancel = (0, ui_1.Button)(jodit, {
29688
29696
  text: 'Cancel',
29689
29697
  tabIndex: 0
29698
+ }).onAction(function () {
29699
+ dialog.close();
29690
29700
  });
29691
- dialog.setFooter(tslib_1.__spreadArray(tslib_1.__spreadArray([], tslib_1.__read(buttons), false), [cancel], false).map(function (btn) { return btn.onAction(function () { return dialog.close(); }); }));
29701
+ dialog.setFooter(tslib_1.__spreadArray(tslib_1.__spreadArray([], tslib_1.__read(buttons), false), [cancel], false));
29692
29702
  buttons[0].focus();
29693
29703
  buttons[0].state.variant = 'primary';
29694
29704
  jodit.e.fire('afterOpenPasteDialog', dialog, msg, title, callback, buttonList);
@@ -37723,14 +37733,11 @@ var source = (function (_super) {
37723
37733
  editor.workplace.appendChild(_this.mirrorContainer);
37724
37734
  });
37725
37735
  this.sourceEditor = (0, factory_1.createSourceEditor)('area', editor, this.mirrorContainer, this.toWYSIWYG, this.fromWYSIWYG);
37726
- editor.registerCommand('escapeSourceEditor', {
37727
- exec: function () {
37728
- var _a;
37729
- (_a = _this.sourceEditor) === null || _a === void 0 ? void 0 : _a.blur();
37730
- },
37731
- hotkeys: ['esc']
37732
- }, {
37733
- stopPropagation: false
37736
+ editor.e.on(editor.ow, 'keydown', function (e) {
37737
+ var _a;
37738
+ if (e.key === constants_1.KEY_ESC && ((_a = _this.sourceEditor) === null || _a === void 0 ? void 0 : _a.isFocused)) {
37739
+ _this.sourceEditor.blur();
37740
+ }
37734
37741
  });
37735
37742
  this.onReadonlyReact();
37736
37743
  editor.e
@@ -37971,6 +37978,13 @@ var TextAreaEditor = (function (_super) {
37971
37978
  if (end === void 0) { end = start; }
37972
37979
  this.instance.setSelectionRange(start, end);
37973
37980
  };
37981
+ Object.defineProperty(TextAreaEditor.prototype, "isFocused", {
37982
+ get: function () {
37983
+ return this.instance === this.j.od.activeElement;
37984
+ },
37985
+ enumerable: false,
37986
+ configurable: true
37987
+ });
37974
37988
  TextAreaEditor.prototype.focus = function () {
37975
37989
  this.instance.focus();
37976
37990
  };
@@ -38224,6 +38238,13 @@ var AceEditor = (function (_super) {
38224
38238
  AceEditor.prototype.setReadOnly = function (isReadOnly) {
38225
38239
  this.instance.setReadOnly(isReadOnly);
38226
38240
  };
38241
+ Object.defineProperty(AceEditor.prototype, "isFocused", {
38242
+ get: function () {
38243
+ return this.instance.isFocused();
38244
+ },
38245
+ enumerable: false,
38246
+ configurable: true
38247
+ });
38227
38248
  AceEditor.prototype.focus = function () {
38228
38249
  this.instance.focus();
38229
38250
  };
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/)
4
- * Version: v3.18.2
4
+ * Version: v3.18.3
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */