jodit 4.0.0-beta.88 → 4.0.0-beta.91

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 (62) hide show
  1. package/CHANGELOG.md +28 -5
  2. package/README.md +4 -4
  3. package/es2015/jodit.css +1 -1
  4. package/es2015/jodit.fat.min.js +2 -2
  5. package/es2015/jodit.js +29 -12
  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 +1 -1
  13. package/es2018/jodit.fat.min.js +2 -2
  14. package/es2018/jodit.js +33 -12
  15. package/es2018/jodit.min.js +2 -2
  16. package/es2018/plugins/debug/debug.js +1 -1
  17. package/es2018/plugins/debug/debug.min.js +1 -1
  18. package/es2018/plugins/speech-recognize/speech-recognize.css +1 -1
  19. package/es2018/plugins/speech-recognize/speech-recognize.js +1 -1
  20. package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
  21. package/es2021/jodit.css +1 -1
  22. package/es2021/jodit.fat.min.js +2 -2
  23. package/es2021/jodit.js +33 -12
  24. package/es2021/jodit.min.js +2 -2
  25. package/es2021/plugins/debug/debug.js +1 -1
  26. package/es2021/plugins/debug/debug.min.js +1 -1
  27. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  28. package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
  29. package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
  30. package/es2021.en/jodit.css +1 -1
  31. package/es2021.en/jodit.fat.min.js +2 -2
  32. package/es2021.en/jodit.js +33 -12
  33. package/es2021.en/jodit.min.js +2 -2
  34. package/es2021.en/plugins/debug/debug.js +1 -1
  35. package/es2021.en/plugins/debug/debug.min.js +1 -1
  36. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  37. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
  38. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
  39. package/es5/jodit.css +2 -2
  40. package/es5/jodit.fat.min.js +2 -2
  41. package/es5/jodit.js +29 -11
  42. package/es5/jodit.min.css +2 -2
  43. package/es5/jodit.min.js +2 -2
  44. package/es5/plugins/debug/debug.js +1 -1
  45. package/es5/plugins/debug/debug.min.js +1 -1
  46. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  47. package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
  48. package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
  49. package/esm/core/constants.js +1 -1
  50. package/esm/core/traits/dlgs.js +3 -3
  51. package/esm/modules/dialog/alert.js +3 -1
  52. package/esm/modules/dialog/confirm.js +3 -1
  53. package/esm/modules/dialog/dialog.d.ts +1 -0
  54. package/esm/modules/dialog/dialog.js +17 -3
  55. package/esm/modules/dialog/prompt.d.ts +1 -0
  56. package/esm/modules/dialog/prompt.js +4 -1
  57. package/esm/plugins/about/about.js +1 -1
  58. package/esm/types/dialog.d.ts +2 -0
  59. package/package.json +1 -1
  60. package/types/modules/dialog/dialog.d.ts +1 -0
  61. package/types/modules/dialog/prompt.d.ts +1 -0
  62. package/types/types/dialog.d.ts +2 -0
@@ -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/jodit/)
4
- * Version: v4.0.0-beta.88
4
+ * Version: v4.0.0-beta.91
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1716,7 +1716,7 @@ __webpack_require__.r(__webpack_exports__);
1716
1716
  * Released under MIT see LICENSE.txt in the project root for license information.
1717
1717
  * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
1718
1718
  */
1719
- const APP_VERSION = "4.0.0-beta.88";
1719
+ const APP_VERSION = "4.0.0-beta.91";
1720
1720
  // prettier-ignore
1721
1721
  const ES = "es2021";
1722
1722
  const IS_ES_MODERN = true;
@@ -12667,18 +12667,18 @@ class Dlgs {
12667
12667
  confirm(msg, title, callback) {
12668
12668
  msg = processTitle(msg, this);
12669
12669
  title = processTitle(title, this);
12670
- return jodit_modules_dialog__WEBPACK_IMPORTED_MODULE_0__/* .Confirm */ .I4.call(this.dlg(), msg, title, callback);
12670
+ return jodit_modules_dialog__WEBPACK_IMPORTED_MODULE_0__/* .Confirm */ .I4.call(this.dlg({ closeOnClickOverlay: true }), msg, title, callback);
12671
12671
  }
12672
12672
  prompt(msg, title, callback, placeholder, defaultValue) {
12673
12673
  msg = processTitle(msg, this);
12674
12674
  title = processTitle(title, this);
12675
12675
  placeholder = processTitle(placeholder, this);
12676
- return jodit_modules_dialog__WEBPACK_IMPORTED_MODULE_0__/* .Prompt */ .NL.call(this.dlg(), msg, title, callback, placeholder, defaultValue);
12676
+ return jodit_modules_dialog__WEBPACK_IMPORTED_MODULE_0__/* .Prompt */ .NL.call(this.dlg({ closeOnClickOverlay: true }), msg, title, callback, placeholder, defaultValue);
12677
12677
  }
12678
12678
  alert(msg, title, callback, className) {
12679
12679
  msg = processTitle(msg, this);
12680
12680
  title = processTitle(title, this);
12681
- return jodit_modules_dialog__WEBPACK_IMPORTED_MODULE_0__/* .Alert */ .bZ.call(this.dlg(), msg, title, callback, className);
12681
+ return jodit_modules_dialog__WEBPACK_IMPORTED_MODULE_0__/* .Alert */ .bZ.call(this.dlg({ closeOnClickOverlay: true }), msg, title, callback, className);
12682
12682
  }
12683
12683
  }
12684
12684
  function processTitle(title, self) {
@@ -17476,7 +17476,9 @@ function Alert(msg, title, callback, className = 'jodit-dialog_alert') {
17476
17476
  callback = title;
17477
17477
  title = undefined;
17478
17478
  }
17479
- const dialog = this instanceof _dialog__WEBPACK_IMPORTED_MODULE_2__/* .Dialog */ .V ? this : new _dialog__WEBPACK_IMPORTED_MODULE_2__/* .Dialog */ .V(), container = dialog.c.div(className), okButton = (0,jodit_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_1__/* .Button */ .zx)(dialog, 'ok', 'Ok');
17479
+ const dialog = this instanceof _dialog__WEBPACK_IMPORTED_MODULE_2__/* .Dialog */ .V
17480
+ ? this
17481
+ : new _dialog__WEBPACK_IMPORTED_MODULE_2__/* .Dialog */ .V({ closeOnClickOverlay: true }), container = dialog.c.div(className), okButton = (0,jodit_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_1__/* .Button */ .zx)(dialog, 'ok', 'Ok');
17480
17482
  (0,jodit_core_helpers_array_as_array__WEBPACK_IMPORTED_MODULE_4__/* .asArray */ ._)(msg).forEach(oneMessage => {
17481
17483
  container.appendChild(jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__/* .Dom */ .i.isNode(oneMessage) ? oneMessage : dialog.c.fromHTML(oneMessage));
17482
17484
  });
@@ -17527,7 +17529,9 @@ function Alert(msg, title, callback, className = 'jodit-dialog_alert') {
17527
17529
  * ```
17528
17530
  */
17529
17531
  function Confirm(msg, title, callback) {
17530
- const dialog = this instanceof jodit_modules_dialog_dialog__WEBPACK_IMPORTED_MODULE_0__/* .Dialog */ .V ? this : new jodit_modules_dialog_dialog__WEBPACK_IMPORTED_MODULE_0__/* .Dialog */ .V(), $div = dialog.c.fromHTML('<form class="jodit-dialog_prompt"></form>'), $label = dialog.c.element('label');
17532
+ const dialog = this instanceof jodit_modules_dialog_dialog__WEBPACK_IMPORTED_MODULE_0__/* .Dialog */ .V
17533
+ ? this
17534
+ : new jodit_modules_dialog_dialog__WEBPACK_IMPORTED_MODULE_0__/* .Dialog */ .V({ closeOnClickOverlay: true }), $div = dialog.c.fromHTML('<form class="jodit-dialog_prompt"></form>'), $label = dialog.c.element('label');
17531
17535
  if ((0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_2__/* .isFunction */ .m)(title)) {
17532
17536
  callback = title;
17533
17537
  title = undefined;
@@ -17583,6 +17587,7 @@ function Confirm(msg, title, callback) {
17583
17587
  * Released under MIT see LICENSE.txt in the project root for license information.
17584
17588
  * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
17585
17589
  */
17590
+ var Dialog_1;
17586
17591
 
17587
17592
  /**
17588
17593
  * @module modules/dialog
@@ -17628,7 +17633,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .D.prototype.controls.dia
17628
17633
  /**
17629
17634
  * Module to generate dialog windows
17630
17635
  */
17631
- let Dialog = class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_6__/* .ViewWithToolbar */ .C {
17636
+ let Dialog = Dialog_1 = class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_6__/* .ViewWithToolbar */ .C {
17632
17637
  /** @override */
17633
17638
  className() {
17634
17639
  return 'Dialog';
@@ -17727,6 +17732,9 @@ let Dialog = class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMP
17727
17732
  }
17728
17733
  }
17729
17734
  onEsc(e) {
17735
+ if (!this.o.closeOnEsc) {
17736
+ return;
17737
+ }
17730
17738
  if (this.isOpened &&
17731
17739
  e.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.KEY_ESC &&
17732
17740
  this.getMod('static') !== true) {
@@ -18061,7 +18069,7 @@ let Dialog = class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMP
18061
18069
  */
18062
18070
  this.isOpened = false;
18063
18071
  const self = this;
18064
- self.options = (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.ConfigProto)(options, (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.ConfigProto)(jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .D.prototype.dialog, jodit_core_view_view__WEBPACK_IMPORTED_MODULE_11__/* .View */ .G.defaultOptions));
18072
+ self.options = (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.ConfigProto)(options, (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.ConfigProto)(jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .D.prototype.dialog, Dialog_1.defaultOptions));
18065
18073
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_7__/* .Dom */ .i.safeRemove(self.container);
18066
18074
  const n = this.getFullElName.bind(this);
18067
18075
  self.container = this.c.fromHTML(`<div class="jodit jodit-dialog ${this.componentName}">
@@ -18117,6 +18125,11 @@ let Dialog = class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMP
18117
18125
  .on(self.container, 'close_dialog', self.close)
18118
18126
  .on(this.ow, 'keydown', this.onEsc)
18119
18127
  .on(this.ow, 'resize', this.onResize);
18128
+ if (this.o.closeOnClickOverlay) {
18129
+ const overlay = self.getElm('overlay');
18130
+ void 0;
18131
+ this.e.on(overlay, 'click', self.close);
18132
+ }
18120
18133
  }
18121
18134
  /**
18122
18135
  * Build toolbar after ready
@@ -18170,10 +18183,15 @@ let Dialog = class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMP
18170
18183
  (0,tslib__WEBPACK_IMPORTED_MODULE_13__/* .__decorate */ .gn)([
18171
18184
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_10__.hook)('ready')
18172
18185
  ], Dialog.prototype, "buildToolbar", null);
18173
- Dialog = (0,tslib__WEBPACK_IMPORTED_MODULE_13__/* .__decorate */ .gn)([
18186
+ Dialog = Dialog_1 = (0,tslib__WEBPACK_IMPORTED_MODULE_13__/* .__decorate */ .gn)([
18174
18187
  jodit_core_decorators__WEBPACK_IMPORTED_MODULE_10__.component
18175
18188
  ], Dialog);
18176
18189
 
18190
+ Dialog.defaultOptions = {
18191
+ ...jodit_core_view_view__WEBPACK_IMPORTED_MODULE_11__/* .View */ .G.defaultOptions,
18192
+ closeOnClickOverlay: false,
18193
+ closeOnEsc: true
18194
+ };
18177
18195
 
18178
18196
 
18179
18197
  /***/ }),
@@ -18233,6 +18251,7 @@ Dialog = (0,tslib__WEBPACK_IMPORTED_MODULE_13__/* .__decorate */ .gn)([
18233
18251
  /**
18234
18252
  * Show `Prompt` dialog. Work without Jodit object
18235
18253
  *
18254
+ * @param msg - Dialog content
18236
18255
  * @param title - Title or callback
18237
18256
  * @param callback - callback. The first argument is the value entered
18238
18257
  * @param placeholder - Placeholder for input
@@ -18248,7 +18267,9 @@ Dialog = (0,tslib__WEBPACK_IMPORTED_MODULE_13__/* .__decorate */ .gn)([
18248
18267
  * ```
18249
18268
  */
18250
18269
  function Prompt(msg, title, callback, placeholder, defaultValue) {
18251
- const dialog = this instanceof _dialog__WEBPACK_IMPORTED_MODULE_2__/* .Dialog */ .V ? this : new _dialog__WEBPACK_IMPORTED_MODULE_2__/* .Dialog */ .V(), cancelButton = (0,jodit_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_0__/* .Button */ .zx)(dialog, 'cancel', 'Cancel'), okButton = (0,jodit_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_0__/* .Button */ .zx)(dialog, 'ok', 'Ok'), form = dialog.c.element('form', {
18270
+ const dialog = this instanceof _dialog__WEBPACK_IMPORTED_MODULE_2__/* .Dialog */ .V
18271
+ ? this
18272
+ : new _dialog__WEBPACK_IMPORTED_MODULE_2__/* .Dialog */ .V({ closeOnClickOverlay: true }), cancelButton = (0,jodit_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_0__/* .Button */ .zx)(dialog, 'cancel', 'Cancel'), okButton = (0,jodit_core_ui_button_button_button__WEBPACK_IMPORTED_MODULE_0__/* .Button */ .zx)(dialog, 'ok', 'Ok'), form = dialog.c.element('form', {
18252
18273
  class: 'jodit-dialog_prompt'
18253
18274
  }), inputElement = dialog.c.element('input', {
18254
18275
  autofocus: true,
@@ -24605,7 +24626,7 @@ const TabsWidget = (jodit, tabs, state) => {
24605
24626
 
24606
24627
  jodit_config__WEBPACK_IMPORTED_MODULE_0__/* .Config */ .D.prototype.controls.about = {
24607
24628
  exec: (editor) => {
24608
- const dialog = editor.dlg(), i = editor.i18n.bind(editor);
24629
+ const dialog = editor.dlg({ closeOnClickOverlay: true }), i = editor.i18n.bind(editor);
24609
24630
  dialog
24610
24631
  .setMod('theme', editor.o.theme)
24611
24632
  .setHeader(i('About Jodit'))