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
@@ -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
@@ -19109,13 +19117,14 @@ ContextMenu = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_0__.__decorat
19109
19117
  /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(28077);
19110
19118
  /* harmony import */ var jodit_core_helpers_array__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(45664);
19111
19119
  /* harmony import */ var jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(28686);
19112
- /* harmony import */ var jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(93640);
19113
- /* harmony import */ var jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(28712);
19114
- /* 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__);
19115
- /* harmony import */ var jodit_core_ui__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(4099);
19116
- /* harmony import */ var jodit_core_view_view__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(35099);
19117
- /* harmony import */ var jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(2222);
19118
- /* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(5266);
19120
+ /* harmony import */ var jodit_core_helpers_html_strip_tags__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(22852);
19121
+ /* harmony import */ var jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(93640);
19122
+ /* harmony import */ var jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(28712);
19123
+ /* 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__);
19124
+ /* harmony import */ var jodit_core_ui__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(4099);
19125
+ /* harmony import */ var jodit_core_view_view__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(35099);
19126
+ /* harmony import */ var jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(2222);
19127
+ /* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(5266);
19119
19128
  /*!
19120
19129
  * Jodit Editor (https://xdsoft.net/jodit/)
19121
19130
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -19138,7 +19147,8 @@ ContextMenu = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_0__.__decorat
19138
19147
 
19139
19148
 
19140
19149
 
19141
- jodit_config__WEBPACK_IMPORTED_MODULE_14__.Config.prototype.dialog = {
19150
+
19151
+ jodit_config__WEBPACK_IMPORTED_MODULE_15__.Config.prototype.dialog = {
19142
19152
  namespace: '',
19143
19153
  extraButtons: [],
19144
19154
  /**
@@ -19154,7 +19164,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_14__.Config.prototype.dialog = {
19154
19164
  toolbarButtonSize: 'middle',
19155
19165
  zIndex: 'inherit'
19156
19166
  };
19157
- jodit_config__WEBPACK_IMPORTED_MODULE_14__.Config.prototype.controls.dialog = {
19167
+ jodit_config__WEBPACK_IMPORTED_MODULE_15__.Config.prototype.controls.dialog = {
19158
19168
  close: {
19159
19169
  icon: 'cancel',
19160
19170
  exec: (dialog)=>{
@@ -19162,7 +19172,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_14__.Config.prototype.controls.dialog = {
19162
19172
  }
19163
19173
  }
19164
19174
  };
19165
- class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_13__.ViewWithToolbar {
19175
+ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_14__.ViewWithToolbar {
19166
19176
  /** @override */ className() {
19167
19177
  return 'Dialog';
19168
19178
  }
@@ -19226,8 +19236,8 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
19226
19236
  this.draggable = true;
19227
19237
  this.startX = e.clientX;
19228
19238
  this.startY = e.clientY;
19229
- this.startPoint.x = (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_9__.css)(this.dialog, 'left');
19230
- this.startPoint.y = (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_9__.css)(this.dialog, 'top');
19239
+ this.startPoint.x = (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.css)(this.dialog, 'left');
19240
+ this.startPoint.y = (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.css)(this.dialog, 'top');
19231
19241
  this.setMaxZIndex();
19232
19242
  if (e.cancelable) {
19233
19243
  e.preventDefault();
@@ -19316,7 +19326,7 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
19316
19326
  if (h == null) {
19317
19327
  h = this.dialog.offsetHeight;
19318
19328
  }
19319
- ;(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_9__.css)(this.dialog, {
19329
+ ;(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.css)(this.dialog, {
19320
19330
  width: w,
19321
19331
  height: h
19322
19332
  });
@@ -19350,7 +19360,7 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
19350
19360
  this.moved = Math.abs(x - left) > 100 || Math.abs(y - top) > 100;
19351
19361
  }
19352
19362
  // strings on purpose: `css()` would truncate fractional pixels
19353
- ;(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_9__.css)(this.dialog, {
19363
+ ;(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.css)(this.dialog, {
19354
19364
  left: (x || left) + 'px',
19355
19365
  top: (y || top) + 'px'
19356
19366
  });
@@ -19370,6 +19380,12 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
19370
19380
  * ```
19371
19381
  */ setHeader(content) {
19372
19382
  this.setElements(this.dialogbox_header, content);
19383
+ // `role="dialog"` needs an accessible name; a text title is the
19384
+ // natural one (element titles are left to the caller).
19385
+ if ((0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_8__.isString)(content)) {
19386
+ const name = (0,jodit_core_helpers_html_strip_tags__WEBPACK_IMPORTED_MODULE_9__.stripTags)(content, this.od).trim();
19387
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.attr)(this.container, 'aria-label', name || null);
19388
+ }
19373
19389
  return this;
19374
19390
  }
19375
19391
  /**
@@ -19423,7 +19439,7 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
19423
19439
  /**
19424
19440
  * Get zIndex from dialog
19425
19441
  */ getZIndex() {
19426
- return parseInt((0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_9__.css)(this.container, 'zIndex'), 10) || 0;
19442
+ return parseInt((0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.css)(this.container, 'zIndex'), 10) || 0;
19427
19443
  }
19428
19444
  /**
19429
19445
  * Get dialog instance with maximum z-index displaying it on top of all the dialog boxes
@@ -19446,7 +19462,7 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
19446
19462
  this.__openedSiblings().forEach((dialog)=>{
19447
19463
  maxZIndex = Math.max(dialog.getZIndex(), maxZIndex);
19448
19464
  });
19449
- (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_9__.css)(this.container, 'zIndex', (maxZIndex + 1).toString());
19465
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.css)(this.container, 'zIndex', (maxZIndex + 1).toString());
19450
19466
  }
19451
19467
  /**
19452
19468
  * Expands the dialog on full browser window
@@ -19496,7 +19512,7 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
19496
19512
  this.setPosition(this.offsetX, this.offsetY);
19497
19513
  this.setMaxZIndex();
19498
19514
  } else {
19499
- (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_9__.css)(this.container, 'zIndex', null);
19515
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.css)(this.container, 'zIndex', null);
19500
19516
  }
19501
19517
  if (this.o.fullsize) {
19502
19518
  this.toggleFullSize(true);
@@ -19610,7 +19626,7 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
19610
19626
  * True, if dialog was opened
19611
19627
  */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "isOpened", false);
19612
19628
  const self1 = this;
19613
- 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));
19629
+ 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));
19614
19630
  // Attach event handlers passed via `options.events` to the dialog's own
19615
19631
  // emitter (as FileBrowser already does), so a consumer — e.g. a plugin
19616
19632
  // forwarding the editor's `events` config — can observe `afterOpen` /
@@ -19628,40 +19644,40 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
19628
19644
  </div>
19629
19645
  <div class="${n('content')}"></div>
19630
19646
  <div class="${n('footer')}"></div>
19631
- <div class="${n('resizer')}">${jodit_core_ui__WEBPACK_IMPORTED_MODULE_11__.Icon.get('resize_handler')}</div>
19647
+ <div class="${n('resizer')}">${jodit_core_ui__WEBPACK_IMPORTED_MODULE_12__.Icon.get('resize_handler')}</div>
19632
19648
  </div>
19633
19649
  </div>`);
19634
19650
  if (self1.options.direction === 'rtl') {
19635
- (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_9__.css)(self1.container, 'direction', 'rtl');
19636
- (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_9__.attr)(self1.container, 'dir', 'rtl');
19651
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.css)(self1.container, 'direction', 'rtl');
19652
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.attr)(self1.container, 'dir', 'rtl');
19637
19653
  }
19638
19654
  if (this.o.zIndex) {
19639
- (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_9__.css)(this.container, 'zIndex', this.o.zIndex.toString());
19655
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.css)(this.container, 'zIndex', this.o.zIndex.toString());
19640
19656
  }
19641
- ;(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_9__.attr)(self1.container, 'role', 'dialog');
19657
+ ;(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.attr)(self1.container, 'role', 'dialog');
19642
19658
  Object.defineProperty(self1.container, 'component', {
19643
19659
  value: this
19644
19660
  });
19645
19661
  self1.setMod('theme', self1.o.theme || 'default').setMod('resizable', Boolean(self1.o.resizable));
19646
19662
  const dialog = self1.getElm('panel');
19647
- (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_10__.assert)(dialog != null, 'Panel element does not exist');
19663
+ (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_11__.assert)(dialog != null, 'Panel element does not exist');
19648
19664
  const resizer = self1.getElm('resizer');
19649
- (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_10__.assert)(resizer != null, 'Resizer element does not exist');
19665
+ (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_11__.assert)(resizer != null, 'Resizer element does not exist');
19650
19666
  const dialogbox_header = self1.getElm('header-title');
19651
- (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_10__.assert)(dialogbox_header != null, 'header-title element does not exist');
19667
+ (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_11__.assert)(dialogbox_header != null, 'header-title element does not exist');
19652
19668
  const dialogbox_content = self1.getElm('content');
19653
- (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_10__.assert)(dialogbox_content != null, 'Content element does not exist');
19669
+ (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_11__.assert)(dialogbox_content != null, 'Content element does not exist');
19654
19670
  const dialogbox_footer = self1.getElm('footer');
19655
- (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_10__.assert)(dialogbox_footer != null, 'Footer element does not exist');
19671
+ (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_11__.assert)(dialogbox_footer != null, 'Footer element does not exist');
19656
19672
  const dialogbox_toolbar = self1.getElm('header-toolbar');
19657
- (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_10__.assert)(dialogbox_toolbar != null, 'header-toolbar element does not exist');
19673
+ (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_11__.assert)(dialogbox_toolbar != null, 'header-toolbar element does not exist');
19658
19674
  this.dialog = dialog;
19659
19675
  this.resizer = resizer;
19660
19676
  this.dialogbox_header = dialogbox_header;
19661
19677
  this.dialogbox_content = dialogbox_content;
19662
19678
  this.dialogbox_footer = dialogbox_footer;
19663
19679
  this.dialogbox_toolbar = dialogbox_toolbar;
19664
- (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_9__.css)(self1.dialog, {
19680
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_10__.css)(self1.dialog, {
19665
19681
  maxWidth: self1.options.maxWidth,
19666
19682
  minHeight: self1.options.minHeight,
19667
19683
  minWidth: self1.options.minWidth
@@ -19674,7 +19690,7 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
19674
19690
  this.e.on(self1.container, 'close_dialog', self1.close).on(this.ow, 'keydown', this.__onEsc).on(this.ow, 'resize', this.__onResize);
19675
19691
  if (this.o.closeOnClickOverlay) {
19676
19692
  const overlay = self1.getElm('overlay');
19677
- (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_10__.assert)(overlay != null, 'Overlay element does not exist');
19693
+ (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_11__.assert)(overlay != null, 'Overlay element does not exist');
19678
19694
  this.e.on(overlay, 'click', self1.close);
19679
19695
  }
19680
19696
  }
@@ -19684,7 +19700,7 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
19684
19700
  * whole `destination` (usually `document.body`) for every z-index update.
19685
19701
  */ ;(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(Dialog, "__opened", new Set());
19686
19702
  (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(Dialog, "defaultOptions", {
19687
- ...jodit_core_view_view__WEBPACK_IMPORTED_MODULE_12__.View.defaultOptions,
19703
+ ...jodit_core_view_view__WEBPACK_IMPORTED_MODULE_13__.View.defaultOptions,
19688
19704
  closeOnClickOverlay: false,
19689
19705
  closeOnEsc: true
19690
19706
  });
@@ -24812,6 +24828,13 @@ class ToolbarContent extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__.U
24812
24828
  /** @override */ className() {
24813
24829
  return 'ToolbarContent';
24814
24830
  }
24831
+ /** A toolbar item like `ToolbarButton`: the parent group is a `list`. */ getRole() {
24832
+ return 'listitem';
24833
+ }
24834
+ /**
24835
+ * Arbitrary content is not a toggle button — `aria-pressed` is not
24836
+ * allowed on a `listitem`.
24837
+ */ onChangeActivated() {}
24815
24838
  /** @override */ update() {
24816
24839
  const { control } = this;
24817
24840
  const content = control.getContent(this.j, this);
@@ -24851,7 +24874,6 @@ class ToolbarContent extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__.U
24851
24874
  constructor(jodit, control, target = null){
24852
24875
  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;
24853
24876
  this.container.classList.add(`${this.componentName}_${this.clearName(control.name)}`);
24854
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.attr)(this.container, 'role', 'content');
24855
24877
  }
24856
24878
  }
24857
24879
  ToolbarContent = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
@@ -41284,19 +41306,26 @@ class AceEditor extends jodit_plugins_source_editor_sourceEditor__WEBPACK_IMPORT
41284
41306
  onResize();
41285
41307
  this.onReady();
41286
41308
  };
41309
+ let loading = false;
41287
41310
  const initAceEditor = ()=>{
41288
41311
  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) {
41289
41312
  return;
41290
41313
  }
41314
+ // ACE (~400 KiB from the CDN) is only needed once the source view
41315
+ // is actually shown — a page that stays in WYSIWYG must not
41316
+ // download it.
41317
+ if (!this.aceExists()) {
41318
+ if (!loading) {
41319
+ loading = true;
41320
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.loadNext)(editor, editor.o.sourceEditorCDNUrlsJS).then(initAceEditor).catch(()=>null);
41321
+ }
41322
+ return;
41323
+ }
41291
41324
  this.fromWYSIWYG();
41292
41325
  tryInitAceEditor();
41293
41326
  };
41294
41327
  editor.e.on('afterSetMode', initAceEditor);
41295
41328
  initAceEditor();
41296
- // global add ace editor in browser
41297
- if (!this.aceExists()) {
41298
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.loadNext)(editor, editor.o.sourceEditorCDNUrlsJS).then(initAceEditor).catch(()=>null);
41299
- }
41300
41329
  }
41301
41330
  destruct() {
41302
41331
  this.instance.off('change', this.toWYSIWYG);
@@ -41834,7 +41863,24 @@ class SourceEditor {
41834
41863
  return false;
41835
41864
  };
41836
41865
  if (!addEventListener()) {
41837
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.loadNext)(editor, editor.o.beautifyHTMLCDNUrlsJS).then(addEventListener, ()=>null);
41866
+ // js-beautify is only needed once the source view is shown —
41867
+ // do not download it for a page that stays in WYSIWYG.
41868
+ let loading = false;
41869
+ const loadBeautify = ()=>{
41870
+ if (loading || editor.getMode() !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.MODE_SOURCE && editor.getMode() !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.MODE_SPLIT) {
41871
+ return;
41872
+ }
41873
+ loading = true;
41874
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.loadNext)(editor, editor.o.beautifyHTMLCDNUrlsJS).then(()=>{
41875
+ // The source view was filled before the
41876
+ // beautifier arrived — format it now.
41877
+ if (addEventListener()) {
41878
+ this.syncValueFromWYSIWYG(true);
41879
+ }
41880
+ }, ()=>null);
41881
+ };
41882
+ editor.e.on('afterSetMode.source', loadBeautify);
41883
+ loadBeautify();
41838
41884
  }
41839
41885
  }
41840
41886
  this.syncValueFromWYSIWYG(true);