jodit 4.15.18 → 4.16.0

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 (63) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/es2015/jodit.css +1 -1
  3. package/es2015/jodit.fat.min.js +9 -8
  4. package/es2015/jodit.js +94 -48
  5. package/es2015/jodit.min.js +9 -8
  6. package/es2015/plugins/debug/debug.css +1 -1
  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.fat.min.js +9 -8
  13. package/es2018/jodit.min.js +9 -8
  14. package/es2018/plugins/debug/debug.min.js +1 -1
  15. package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
  16. package/es2021/jodit.css +1 -1
  17. package/es2021/jodit.fat.min.js +10 -9
  18. package/es2021/jodit.js +94 -48
  19. package/es2021/jodit.min.js +10 -9
  20. package/es2021/plugins/debug/debug.css +1 -1
  21. package/es2021/plugins/debug/debug.js +1 -1
  22. package/es2021/plugins/debug/debug.min.js +1 -1
  23. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  24. package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
  25. package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
  26. package/es2021.en/jodit.css +1 -1
  27. package/es2021.en/jodit.fat.min.js +10 -9
  28. package/es2021.en/jodit.js +94 -48
  29. package/es2021.en/jodit.min.js +10 -9
  30. package/es2021.en/plugins/debug/debug.css +1 -1
  31. package/es2021.en/plugins/debug/debug.js +1 -1
  32. package/es2021.en/plugins/debug/debug.min.js +1 -1
  33. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  34. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
  35. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
  36. package/es5/jodit.css +2 -2
  37. package/es5/jodit.fat.min.js +2 -2
  38. package/es5/jodit.js +106 -54
  39. package/es5/jodit.min.css +2 -2
  40. package/es5/jodit.min.js +2 -2
  41. package/es5/plugins/debug/debug.css +1 -1
  42. package/es5/plugins/debug/debug.js +1 -1
  43. package/es5/plugins/debug/debug.min.js +1 -1
  44. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  45. package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
  46. package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
  47. package/es5/polyfills.fat.min.js +1 -1
  48. package/es5/polyfills.js +1 -1
  49. package/es5/polyfills.min.js +1 -1
  50. package/esm/core/constants.js +1 -1
  51. package/esm/core/ui/button/button/button.js +10 -4
  52. package/esm/core/ui/form/inputs/file/file.js +1 -0
  53. package/esm/core/ui/group/group.d.ts +4 -0
  54. package/esm/core/ui/group/group.js +5 -1
  55. package/esm/core/ui/group/list.js +2 -2
  56. package/esm/modules/dialog/dialog.js +7 -0
  57. package/esm/modules/toolbar/button/content.d.ts +7 -0
  58. package/esm/modules/toolbar/button/content.js +9 -1
  59. package/esm/plugins/source/editor/engines/ace.js +13 -6
  60. package/esm/plugins/source/source.js +20 -1
  61. package/package.json +1 -1
  62. package/types/core/ui/group/group.d.ts +4 -0
  63. package/types/modules/toolbar/button/content.d.ts +7 -0
package/es2021/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.15.18
4
+ * Version: v4.16.0
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1799,7 +1799,7 @@ __webpack_require__.r(__webpack_exports__);
1799
1799
  * ```
1800
1800
  * @packageDocumentation
1801
1801
  * @module constants
1802
- */ const APP_VERSION = "4.15.18";
1802
+ */ const APP_VERSION = "4.16.0";
1803
1803
  // prettier-ignore
1804
1804
  const ES = "es2021";
1805
1805
  const IS_ES_MODERN = true;
@@ -14332,6 +14332,7 @@ class UIButton extends jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_11__.UIEle
14332
14332
  this.name = this.state.name;
14333
14333
  (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_10__.attr)(this.container, 'data-ref', this.state.name);
14334
14334
  (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_10__.attr)(this.container, 'ref', this.state.name);
14335
+ this.updateAriaLabel();
14335
14336
  }
14336
14337
  onChangeTooltip() {
14337
14338
  const i8nTooltip = this.state.tooltip ? this.jodit.i18n(this.state.tooltip) : null;
@@ -14343,9 +14344,12 @@ class UIButton extends jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_11__.UIEle
14343
14344
  }
14344
14345
  updateAriaLabel() {
14345
14346
  const hasText = this.state.text.trim().length > 0;
14346
- const i8nTooltip = this.state.tooltip ? this.jodit.i18n(this.state.tooltip) : null;
14347
- (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_10__.attr)(this.container, 'aria-label', i8nTooltip);
14348
- (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_10__.attr)(this.button, 'aria-label', !hasText ? i8nTooltip : null);
14347
+ // An icon-only button without a tooltip would have no accessible
14348
+ // name at all — fall back to its raw name (not translated: control
14349
+ // names are identifiers, not i18n keys).
14350
+ const label = this.state.tooltip ? this.jodit.i18n(this.state.tooltip) : !hasText && this.state.name ? this.state.name : null;
14351
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_10__.attr)(this.container, 'aria-label', label);
14352
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_10__.attr)(this.button, 'aria-label', !hasText ? label : null);
14349
14353
  }
14350
14354
  onChangeTabIndex() {
14351
14355
  ;(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_10__.attr)(this.container, 'tabindex', this.state.tabIndex);
@@ -15361,6 +15365,7 @@ class UIFileInput extends jodit_core_ui_form_inputs_input_input__WEBPACK_IMPORTE
15361
15365
  return this.j.create.fromHTML(`<input
15362
15366
  type="file"
15363
15367
  accept="${options.onlyImages ? 'image/*' : '*'}"
15368
+ aria-label="${this.j.i18n(options.tooltip || 'Upload')}"
15364
15369
  tabindex="-1"
15365
15370
  dir="auto"
15366
15371
  multiple=""
@@ -15859,8 +15864,11 @@ class UIGroup extends jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_6__.UIEleme
15859
15864
  className() {
15860
15865
  return 'UIGroup';
15861
15866
  }
15862
- getRole() {
15863
- return this.options?.role || 'list';
15867
+ /**
15868
+ * A generic container: `group` allows any children. Toolbar button groups
15869
+ * are lists of `listitem`s and get `role="list"` explicitly from `UIList`.
15870
+ */ getRole() {
15871
+ return this.options?.role || 'group';
15864
15872
  }
15865
15873
  /**
15866
15874
  * All group children
@@ -16063,10 +16071,10 @@ class UIList extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_8__.UIGr
16063
16071
  }
16064
16072
  /**
16065
16073
  * Make new group and append it in list of elements
16066
- */ makeGroup(role) {
16067
- return new jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_8__.UIGroup(this.jodit, [], role ? {
16074
+ */ makeGroup(role = 'list') {
16075
+ return new jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_8__.UIGroup(this.jodit, [], {
16068
16076
  role
16069
- } : undefined);
16077
+ });
16070
16078
  }
16071
16079
  /**
16072
16080
  * All buttons from list
@@ -19133,13 +19141,14 @@ ContextMenu = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_0__.__decorat
19133
19141
  /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(28077);
19134
19142
  /* harmony import */ var jodit_core_helpers_array__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(45664);
19135
19143
  /* harmony import */ var jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(28686);
19136
- /* harmony import */ var jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(93640);
19137
- /* harmony import */ var jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(28712);
19138
- /* harmony import */ var jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_10__);
19139
- /* harmony import */ var jodit_core_ui__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(4099);
19140
- /* harmony import */ var jodit_core_view_view__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(35099);
19141
- /* harmony import */ var jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(2222);
19142
- /* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(5266);
19144
+ /* harmony import */ var jodit_core_helpers_html_strip_tags__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(22852);
19145
+ /* harmony import */ var jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(93640);
19146
+ /* harmony import */ var jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(28712);
19147
+ /* harmony import */ var jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_11__);
19148
+ /* harmony import */ var jodit_core_ui__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(4099);
19149
+ /* harmony import */ var jodit_core_view_view__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(35099);
19150
+ /* harmony import */ var jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(2222);
19151
+ /* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(5266);
19143
19152
  /*!
19144
19153
  * Jodit Editor (https://xdsoft.net/jodit/)
19145
19154
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -19162,7 +19171,8 @@ ContextMenu = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_0__.__decorat
19162
19171
 
19163
19172
 
19164
19173
 
19165
- jodit_config__WEBPACK_IMPORTED_MODULE_14__.Config.prototype.dialog = {
19174
+
19175
+ jodit_config__WEBPACK_IMPORTED_MODULE_15__.Config.prototype.dialog = {
19166
19176
  namespace: '',
19167
19177
  extraButtons: [],
19168
19178
  /**
@@ -19178,7 +19188,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_14__.Config.prototype.dialog = {
19178
19188
  toolbarButtonSize: 'middle',
19179
19189
  zIndex: 'inherit'
19180
19190
  };
19181
- jodit_config__WEBPACK_IMPORTED_MODULE_14__.Config.prototype.controls.dialog = {
19191
+ jodit_config__WEBPACK_IMPORTED_MODULE_15__.Config.prototype.controls.dialog = {
19182
19192
  close: {
19183
19193
  icon: 'cancel',
19184
19194
  exec: (dialog)=>{
@@ -19186,7 +19196,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_14__.Config.prototype.controls.dialog = {
19186
19196
  }
19187
19197
  }
19188
19198
  };
19189
- class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_13__.ViewWithToolbar {
19199
+ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_14__.ViewWithToolbar {
19190
19200
  /** @override */ className() {
19191
19201
  return 'Dialog';
19192
19202
  }
@@ -19250,8 +19260,8 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
19250
19260
  this.draggable = true;
19251
19261
  this.startX = e.clientX;
19252
19262
  this.startY = e.clientY;
19253
- this.startPoint.x = (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_9__.css)(this.dialog, 'left');
19254
- this.startPoint.y = (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_9__.css)(this.dialog, 'top');
19263
+ this.startPoint.x = (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.css)(this.dialog, 'left');
19264
+ this.startPoint.y = (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.css)(this.dialog, 'top');
19255
19265
  this.setMaxZIndex();
19256
19266
  if (e.cancelable) {
19257
19267
  e.preventDefault();
@@ -19340,7 +19350,7 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
19340
19350
  if (h == null) {
19341
19351
  h = this.dialog.offsetHeight;
19342
19352
  }
19343
- ;(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_9__.css)(this.dialog, {
19353
+ ;(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.css)(this.dialog, {
19344
19354
  width: w,
19345
19355
  height: h
19346
19356
  });
@@ -19374,7 +19384,7 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
19374
19384
  this.moved = Math.abs(x - left) > 100 || Math.abs(y - top) > 100;
19375
19385
  }
19376
19386
  // strings on purpose: `css()` would truncate fractional pixels
19377
- ;(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_9__.css)(this.dialog, {
19387
+ ;(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.css)(this.dialog, {
19378
19388
  left: (x || left) + 'px',
19379
19389
  top: (y || top) + 'px'
19380
19390
  });
@@ -19394,6 +19404,12 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
19394
19404
  * ```
19395
19405
  */ setHeader(content) {
19396
19406
  this.setElements(this.dialogbox_header, content);
19407
+ // `role="dialog"` needs an accessible name; a text title is the
19408
+ // natural one (element titles are left to the caller).
19409
+ if ((0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_8__.isString)(content)) {
19410
+ const name = (0,jodit_core_helpers_html_strip_tags__WEBPACK_IMPORTED_MODULE_9__.stripTags)(content, this.od).trim();
19411
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.attr)(this.container, 'aria-label', name || null);
19412
+ }
19397
19413
  return this;
19398
19414
  }
19399
19415
  /**
@@ -19447,7 +19463,7 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
19447
19463
  /**
19448
19464
  * Get zIndex from dialog
19449
19465
  */ getZIndex() {
19450
- return parseInt((0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_9__.css)(this.container, 'zIndex'), 10) || 0;
19466
+ return parseInt((0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.css)(this.container, 'zIndex'), 10) || 0;
19451
19467
  }
19452
19468
  /**
19453
19469
  * Get dialog instance with maximum z-index displaying it on top of all the dialog boxes
@@ -19470,7 +19486,7 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
19470
19486
  this.__openedSiblings().forEach((dialog)=>{
19471
19487
  maxZIndex = Math.max(dialog.getZIndex(), maxZIndex);
19472
19488
  });
19473
- (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_9__.css)(this.container, 'zIndex', (maxZIndex + 1).toString());
19489
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.css)(this.container, 'zIndex', (maxZIndex + 1).toString());
19474
19490
  }
19475
19491
  /**
19476
19492
  * Expands the dialog on full browser window
@@ -19520,7 +19536,7 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
19520
19536
  this.setPosition(this.offsetX, this.offsetY);
19521
19537
  this.setMaxZIndex();
19522
19538
  } else {
19523
- (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_9__.css)(this.container, 'zIndex', null);
19539
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.css)(this.container, 'zIndex', null);
19524
19540
  }
19525
19541
  if (this.o.fullsize) {
19526
19542
  this.toggleFullSize(true);
@@ -19634,7 +19650,7 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
19634
19650
  * True, if dialog was opened
19635
19651
  */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "isOpened", false);
19636
19652
  const self1 = this;
19637
- self1.options = (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_9__.ConfigProto)(options, (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_9__.ConfigProto)(jodit_config__WEBPACK_IMPORTED_MODULE_14__.Config.prototype.dialog, Dialog.defaultOptions));
19653
+ self1.options = (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.ConfigProto)(options, (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.ConfigProto)(jodit_config__WEBPACK_IMPORTED_MODULE_15__.Config.prototype.dialog, Dialog.defaultOptions));
19638
19654
  // Attach event handlers passed via `options.events` to the dialog's own
19639
19655
  // emitter (as FileBrowser already does), so a consumer — e.g. a plugin
19640
19656
  // forwarding the editor's `events` config — can observe `afterOpen` /
@@ -19652,40 +19668,40 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
19652
19668
  </div>
19653
19669
  <div class="${n('content')}"></div>
19654
19670
  <div class="${n('footer')}"></div>
19655
- <div class="${n('resizer')}">${jodit_core_ui__WEBPACK_IMPORTED_MODULE_11__.Icon.get('resize_handler')}</div>
19671
+ <div class="${n('resizer')}">${jodit_core_ui__WEBPACK_IMPORTED_MODULE_12__.Icon.get('resize_handler')}</div>
19656
19672
  </div>
19657
19673
  </div>`);
19658
19674
  if (self1.options.direction === 'rtl') {
19659
- (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_9__.css)(self1.container, 'direction', 'rtl');
19660
- (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_9__.attr)(self1.container, 'dir', 'rtl');
19675
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.css)(self1.container, 'direction', 'rtl');
19676
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.attr)(self1.container, 'dir', 'rtl');
19661
19677
  }
19662
19678
  if (this.o.zIndex) {
19663
- (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_9__.css)(this.container, 'zIndex', this.o.zIndex.toString());
19679
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.css)(this.container, 'zIndex', this.o.zIndex.toString());
19664
19680
  }
19665
- ;(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_9__.attr)(self1.container, 'role', 'dialog');
19681
+ ;(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.attr)(self1.container, 'role', 'dialog');
19666
19682
  Object.defineProperty(self1.container, 'component', {
19667
19683
  value: this
19668
19684
  });
19669
19685
  self1.setMod('theme', self1.o.theme || 'default').setMod('resizable', Boolean(self1.o.resizable));
19670
19686
  const dialog = self1.getElm('panel');
19671
- (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_10__.assert)(dialog != null, 'Panel element does not exist');
19687
+ (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_11__.assert)(dialog != null, 'Panel element does not exist');
19672
19688
  const resizer = self1.getElm('resizer');
19673
- (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_10__.assert)(resizer != null, 'Resizer element does not exist');
19689
+ (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_11__.assert)(resizer != null, 'Resizer element does not exist');
19674
19690
  const dialogbox_header = self1.getElm('header-title');
19675
- (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_10__.assert)(dialogbox_header != null, 'header-title element does not exist');
19691
+ (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_11__.assert)(dialogbox_header != null, 'header-title element does not exist');
19676
19692
  const dialogbox_content = self1.getElm('content');
19677
- (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_10__.assert)(dialogbox_content != null, 'Content element does not exist');
19693
+ (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_11__.assert)(dialogbox_content != null, 'Content element does not exist');
19678
19694
  const dialogbox_footer = self1.getElm('footer');
19679
- (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_10__.assert)(dialogbox_footer != null, 'Footer element does not exist');
19695
+ (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_11__.assert)(dialogbox_footer != null, 'Footer element does not exist');
19680
19696
  const dialogbox_toolbar = self1.getElm('header-toolbar');
19681
- (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_10__.assert)(dialogbox_toolbar != null, 'header-toolbar element does not exist');
19697
+ (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_11__.assert)(dialogbox_toolbar != null, 'header-toolbar element does not exist');
19682
19698
  this.dialog = dialog;
19683
19699
  this.resizer = resizer;
19684
19700
  this.dialogbox_header = dialogbox_header;
19685
19701
  this.dialogbox_content = dialogbox_content;
19686
19702
  this.dialogbox_footer = dialogbox_footer;
19687
19703
  this.dialogbox_toolbar = dialogbox_toolbar;
19688
- (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_9__.css)(self1.dialog, {
19704
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.css)(self1.dialog, {
19689
19705
  maxWidth: self1.options.maxWidth,
19690
19706
  minHeight: self1.options.minHeight,
19691
19707
  minWidth: self1.options.minWidth
@@ -19698,7 +19714,7 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
19698
19714
  this.e.on(self1.container, 'close_dialog', self1.close).on(this.ow, 'keydown', this.__onEsc).on(this.ow, 'resize', this.__onResize);
19699
19715
  if (this.o.closeOnClickOverlay) {
19700
19716
  const overlay = self1.getElm('overlay');
19701
- (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_10__.assert)(overlay != null, 'Overlay element does not exist');
19717
+ (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_11__.assert)(overlay != null, 'Overlay element does not exist');
19702
19718
  this.e.on(overlay, 'click', self1.close);
19703
19719
  }
19704
19720
  }
@@ -19708,7 +19724,7 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
19708
19724
  * whole `destination` (usually `document.body`) for every z-index update.
19709
19725
  */ ;(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(Dialog, "__opened", new Set());
19710
19726
  (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(Dialog, "defaultOptions", {
19711
- ...jodit_core_view_view__WEBPACK_IMPORTED_MODULE_12__.View.defaultOptions,
19727
+ ...jodit_core_view_view__WEBPACK_IMPORTED_MODULE_13__.View.defaultOptions,
19712
19728
  closeOnClickOverlay: false,
19713
19729
  closeOnEsc: true
19714
19730
  });
@@ -24836,6 +24852,13 @@ class ToolbarContent extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__.U
24836
24852
  /** @override */ className() {
24837
24853
  return 'ToolbarContent';
24838
24854
  }
24855
+ /** A toolbar item like `ToolbarButton`: the parent group is a `list`. */ getRole() {
24856
+ return 'listitem';
24857
+ }
24858
+ /**
24859
+ * Arbitrary content is not a toggle button — `aria-pressed` is not
24860
+ * allowed on a `listitem`.
24861
+ */ onChangeActivated() {}
24839
24862
  /** @override */ update() {
24840
24863
  const { control } = this;
24841
24864
  const content = control.getContent(this.j, this);
@@ -24875,7 +24898,6 @@ class ToolbarContent extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__.U
24875
24898
  constructor(jodit, control, target = null){
24876
24899
  super(jodit), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "control", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "target", void 0), this.control = control, this.target = target;
24877
24900
  this.container.classList.add(`${this.componentName}_${this.clearName(control.name)}`);
24878
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.attr)(this.container, 'role', 'content');
24879
24901
  }
24880
24902
  }
24881
24903
  ToolbarContent = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
@@ -42037,19 +42059,26 @@ class AceEditor extends jodit_plugins_source_editor_sourceEditor__WEBPACK_IMPORT
42037
42059
  onResize();
42038
42060
  this.onReady();
42039
42061
  };
42062
+ let loading = false;
42040
42063
  const initAceEditor = ()=>{
42041
42064
  if (editor.isInDestruct || editor.getRealMode() !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.MODE_SOURCE && editor.getMode() !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.MODE_SPLIT) {
42042
42065
  return;
42043
42066
  }
42067
+ // ACE (~400 KiB from the CDN) is only needed once the source view
42068
+ // is actually shown — a page that stays in WYSIWYG must not
42069
+ // download it.
42070
+ if (!this.aceExists()) {
42071
+ if (!loading) {
42072
+ loading = true;
42073
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.loadNext)(editor, editor.o.sourceEditorCDNUrlsJS).then(initAceEditor).catch(()=>null);
42074
+ }
42075
+ return;
42076
+ }
42044
42077
  this.fromWYSIWYG();
42045
42078
  tryInitAceEditor();
42046
42079
  };
42047
42080
  editor.e.on('afterSetMode', initAceEditor);
42048
42081
  initAceEditor();
42049
- // global add ace editor in browser
42050
- if (!this.aceExists()) {
42051
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.loadNext)(editor, editor.o.sourceEditorCDNUrlsJS).then(initAceEditor).catch(()=>null);
42052
- }
42053
42082
  }
42054
42083
  destruct() {
42055
42084
  this.instance.off('change', this.toWYSIWYG);
@@ -42587,7 +42616,24 @@ class SourceEditor {
42587
42616
  return false;
42588
42617
  };
42589
42618
  if (!addEventListener()) {
42590
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.loadNext)(editor, editor.o.beautifyHTMLCDNUrlsJS).then(addEventListener, ()=>null);
42619
+ // js-beautify is only needed once the source view is shown —
42620
+ // do not download it for a page that stays in WYSIWYG.
42621
+ let loading = false;
42622
+ const loadBeautify = ()=>{
42623
+ if (loading || editor.getMode() !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.MODE_SOURCE && editor.getMode() !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.MODE_SPLIT) {
42624
+ return;
42625
+ }
42626
+ loading = true;
42627
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.loadNext)(editor, editor.o.beautifyHTMLCDNUrlsJS).then(()=>{
42628
+ // The source view was filled before the
42629
+ // beautifier arrived — format it now.
42630
+ if (addEventListener()) {
42631
+ this.syncValueFromWYSIWYG(true);
42632
+ }
42633
+ }, ()=>null);
42634
+ };
42635
+ editor.e.on('afterSetMode.source', loadBeautify);
42636
+ loadBeautify();
42591
42637
  }
42592
42638
  }
42593
42639
  this.syncValueFromWYSIWYG(true);