jodit 4.15.18 → 4.16.1

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 (76) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/es2015/jodit.css +11 -1
  3. package/es2015/jodit.fat.min.css +1 -1
  4. package/es2015/jodit.fat.min.js +10 -9
  5. package/es2015/jodit.js +116 -50
  6. package/es2015/jodit.min.css +1 -1
  7. package/es2015/jodit.min.js +10 -9
  8. package/es2015/plugins/debug/debug.css +1 -1
  9. package/es2015/plugins/debug/debug.js +1 -1
  10. package/es2015/plugins/debug/debug.min.js +1 -1
  11. package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
  12. package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
  13. package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
  14. package/es2018/jodit.fat.min.css +1 -1
  15. package/es2018/jodit.fat.min.js +10 -9
  16. package/es2018/jodit.min.css +1 -1
  17. package/es2018/jodit.min.js +10 -9
  18. package/es2018/plugins/debug/debug.min.js +1 -1
  19. package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
  20. package/es2021/jodit.css +11 -1
  21. package/es2021/jodit.fat.min.css +1 -1
  22. package/es2021/jodit.fat.min.js +11 -10
  23. package/es2021/jodit.js +116 -50
  24. package/es2021/jodit.min.css +1 -1
  25. package/es2021/jodit.min.js +11 -10
  26. package/es2021/plugins/debug/debug.css +1 -1
  27. package/es2021/plugins/debug/debug.js +1 -1
  28. package/es2021/plugins/debug/debug.min.js +1 -1
  29. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  30. package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
  31. package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
  32. package/es2021.en/jodit.css +11 -1
  33. package/es2021.en/jodit.fat.min.css +1 -1
  34. package/es2021.en/jodit.fat.min.js +11 -10
  35. package/es2021.en/jodit.js +116 -50
  36. package/es2021.en/jodit.min.css +1 -1
  37. package/es2021.en/jodit.min.js +11 -10
  38. package/es2021.en/plugins/debug/debug.css +1 -1
  39. package/es2021.en/plugins/debug/debug.js +1 -1
  40. package/es2021.en/plugins/debug/debug.min.js +1 -1
  41. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  42. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
  43. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
  44. package/es5/jodit.css +15 -2
  45. package/es5/jodit.fat.min.css +1 -1
  46. package/es5/jodit.fat.min.js +2 -2
  47. package/es5/jodit.js +131 -56
  48. package/es5/jodit.min.css +3 -3
  49. package/es5/jodit.min.js +2 -2
  50. package/es5/plugins/debug/debug.css +1 -1
  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/es5/polyfills.fat.min.js +1 -1
  57. package/es5/polyfills.js +1 -1
  58. package/es5/polyfills.min.js +1 -1
  59. package/esm/core/constants.js +1 -1
  60. package/esm/core/ui/button/button/button.js +10 -4
  61. package/esm/core/ui/form/inputs/file/file.js +1 -0
  62. package/esm/core/ui/group/group.d.ts +4 -0
  63. package/esm/core/ui/group/group.js +5 -1
  64. package/esm/core/ui/group/list.js +2 -2
  65. package/esm/modules/dialog/dialog.js +7 -0
  66. package/esm/modules/toolbar/button/content.d.ts +7 -0
  67. package/esm/modules/toolbar/button/content.js +9 -1
  68. package/esm/plugins/iframe/config.js +4 -0
  69. package/esm/plugins/image-processor/image-processor.d.ts +5 -0
  70. package/esm/plugins/image-processor/image-processor.js +29 -2
  71. package/esm/plugins/source/editor/engines/ace.js +13 -6
  72. package/esm/plugins/source/source.js +16 -1
  73. package/package.json +1 -1
  74. package/types/core/ui/group/group.d.ts +4 -0
  75. package/types/modules/toolbar/button/content.d.ts +7 -0
  76. package/types/plugins/image-processor/image-processor.d.ts +5 -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.15.18
4
+ * Version: v4.16.1
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1805,7 +1805,7 @@ __webpack_require__.r(__webpack_exports__);
1805
1805
  * ```
1806
1806
  * @packageDocumentation
1807
1807
  * @module constants
1808
- */ const APP_VERSION = "4.15.18";
1808
+ */ const APP_VERSION = "4.16.1";
1809
1809
  // prettier-ignore
1810
1810
  const ES = "es2015";
1811
1811
  const IS_ES_MODERN = true;
@@ -14437,6 +14437,7 @@ class UIButton extends jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_11__.UIEle
14437
14437
  this.name = this.state.name;
14438
14438
  (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_10__.attr)(this.container, 'data-ref', this.state.name);
14439
14439
  (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_10__.attr)(this.container, 'ref', this.state.name);
14440
+ this.updateAriaLabel();
14440
14441
  }
14441
14442
  onChangeTooltip() {
14442
14443
  const i8nTooltip = this.state.tooltip ? this.jodit.i18n(this.state.tooltip) : null;
@@ -14448,9 +14449,12 @@ class UIButton extends jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_11__.UIEle
14448
14449
  }
14449
14450
  updateAriaLabel() {
14450
14451
  const hasText = this.state.text.trim().length > 0;
14451
- const i8nTooltip = this.state.tooltip ? this.jodit.i18n(this.state.tooltip) : null;
14452
- (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_10__.attr)(this.container, 'aria-label', i8nTooltip);
14453
- (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_10__.attr)(this.button, 'aria-label', !hasText ? i8nTooltip : null);
14452
+ // An icon-only button without a tooltip would have no accessible
14453
+ // name at all — fall back to its raw name (not translated: control
14454
+ // names are identifiers, not i18n keys).
14455
+ const label = this.state.tooltip ? this.jodit.i18n(this.state.tooltip) : !hasText && this.state.name ? this.state.name : null;
14456
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_10__.attr)(this.container, 'aria-label', label);
14457
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_10__.attr)(this.button, 'aria-label', !hasText ? label : null);
14454
14458
  }
14455
14459
  onChangeTabIndex() {
14456
14460
  ;(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_10__.attr)(this.container, 'tabindex', this.state.tabIndex);
@@ -15478,6 +15482,7 @@ class UIFileInput extends jodit_core_ui_form_inputs_input_input__WEBPACK_IMPORTE
15478
15482
  return this.j.create.fromHTML(`<input
15479
15483
  type="file"
15480
15484
  accept="${options.onlyImages ? 'image/*' : '*'}"
15485
+ aria-label="${this.j.i18n(options.tooltip || 'Upload')}"
15481
15486
  tabindex="-1"
15482
15487
  dir="auto"
15483
15488
  multiple=""
@@ -15982,9 +15987,12 @@ class UIGroup extends jodit_core_ui_element__WEBPACK_IMPORTED_MODULE_6__.UIEleme
15982
15987
  className() {
15983
15988
  return 'UIGroup';
15984
15989
  }
15985
- getRole() {
15990
+ /**
15991
+ * A generic container: `group` allows any children. Toolbar button groups
15992
+ * are lists of `listitem`s and get `role="list"` explicitly from `UIList`.
15993
+ */ getRole() {
15986
15994
  var _this_options;
15987
- return ((_this_options = this.options) === null || _this_options === void 0 ? void 0 : _this_options.role) || 'list';
15995
+ return ((_this_options = this.options) === null || _this_options === void 0 ? void 0 : _this_options.role) || 'group';
15988
15996
  }
15989
15997
  /**
15990
15998
  * All group children
@@ -16188,10 +16196,10 @@ class UIList extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_8__.UIGr
16188
16196
  }
16189
16197
  /**
16190
16198
  * Make new group and append it in list of elements
16191
- */ makeGroup(role) {
16192
- return new jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_8__.UIGroup(this.jodit, [], role ? {
16199
+ */ makeGroup(role = 'list') {
16200
+ return new jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_8__.UIGroup(this.jodit, [], {
16193
16201
  role
16194
- } : undefined);
16202
+ });
16195
16203
  }
16196
16204
  /**
16197
16205
  * All buttons from list
@@ -19278,13 +19286,14 @@ ContextMenu = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_0__.__decorat
19278
19286
  /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(28077);
19279
19287
  /* harmony import */ var jodit_core_helpers_array__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(45664);
19280
19288
  /* harmony import */ var jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(28686);
19281
- /* harmony import */ var jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(93640);
19282
- /* harmony import */ var jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(28712);
19283
- /* harmony import */ var jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_12__);
19284
- /* harmony import */ var jodit_core_ui__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(4099);
19285
- /* harmony import */ var jodit_core_view_view__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(35099);
19286
- /* harmony import */ var jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(2222);
19287
- /* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(5266);
19289
+ /* harmony import */ var jodit_core_helpers_html_strip_tags__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(22852);
19290
+ /* harmony import */ var jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(93640);
19291
+ /* harmony import */ var jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(28712);
19292
+ /* harmony import */ var jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_13__);
19293
+ /* harmony import */ var jodit_core_ui__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(4099);
19294
+ /* harmony import */ var jodit_core_view_view__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(35099);
19295
+ /* harmony import */ var jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(2222);
19296
+ /* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(5266);
19288
19297
  /*!
19289
19298
  * Jodit Editor (https://xdsoft.net/jodit/)
19290
19299
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -19309,7 +19318,8 @@ ContextMenu = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_0__.__decorat
19309
19318
 
19310
19319
 
19311
19320
 
19312
- jodit_config__WEBPACK_IMPORTED_MODULE_16__.Config.prototype.dialog = {
19321
+
19322
+ jodit_config__WEBPACK_IMPORTED_MODULE_17__.Config.prototype.dialog = {
19313
19323
  namespace: '',
19314
19324
  extraButtons: [],
19315
19325
  /**
@@ -19325,7 +19335,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_16__.Config.prototype.dialog = {
19325
19335
  toolbarButtonSize: 'middle',
19326
19336
  zIndex: 'inherit'
19327
19337
  };
19328
- jodit_config__WEBPACK_IMPORTED_MODULE_16__.Config.prototype.controls.dialog = {
19338
+ jodit_config__WEBPACK_IMPORTED_MODULE_17__.Config.prototype.controls.dialog = {
19329
19339
  close: {
19330
19340
  icon: 'cancel',
19331
19341
  exec: (dialog)=>{
@@ -19333,7 +19343,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_16__.Config.prototype.controls.dialog = {
19333
19343
  }
19334
19344
  }
19335
19345
  };
19336
- class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_15__.ViewWithToolbar {
19346
+ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_16__.ViewWithToolbar {
19337
19347
  /** @override */ className() {
19338
19348
  return 'Dialog';
19339
19349
  }
@@ -19397,8 +19407,8 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
19397
19407
  this.draggable = true;
19398
19408
  this.startX = e.clientX;
19399
19409
  this.startY = e.clientY;
19400
- this.startPoint.x = (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_11__.css)(this.dialog, 'left');
19401
- this.startPoint.y = (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_11__.css)(this.dialog, 'top');
19410
+ this.startPoint.x = (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_12__.css)(this.dialog, 'left');
19411
+ this.startPoint.y = (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_12__.css)(this.dialog, 'top');
19402
19412
  this.setMaxZIndex();
19403
19413
  if (e.cancelable) {
19404
19414
  e.preventDefault();
@@ -19488,7 +19498,7 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
19488
19498
  if (h == null) {
19489
19499
  h = this.dialog.offsetHeight;
19490
19500
  }
19491
- ;(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_11__.css)(this.dialog, {
19501
+ ;(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_12__.css)(this.dialog, {
19492
19502
  width: w,
19493
19503
  height: h
19494
19504
  });
@@ -19522,7 +19532,7 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
19522
19532
  this.moved = Math.abs(x - left) > 100 || Math.abs(y - top) > 100;
19523
19533
  }
19524
19534
  // strings on purpose: `css()` would truncate fractional pixels
19525
- ;(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_11__.css)(this.dialog, {
19535
+ ;(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_12__.css)(this.dialog, {
19526
19536
  left: (x || left) + 'px',
19527
19537
  top: (y || top) + 'px'
19528
19538
  });
@@ -19542,6 +19552,12 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
19542
19552
  * ```
19543
19553
  */ setHeader(content) {
19544
19554
  this.setElements(this.dialogbox_header, content);
19555
+ // `role="dialog"` needs an accessible name; a text title is the
19556
+ // natural one (element titles are left to the caller).
19557
+ if ((0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_10__.isString)(content)) {
19558
+ const name = (0,jodit_core_helpers_html_strip_tags__WEBPACK_IMPORTED_MODULE_11__.stripTags)(content, this.od).trim();
19559
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_12__.attr)(this.container, 'aria-label', name || null);
19560
+ }
19545
19561
  return this;
19546
19562
  }
19547
19563
  /**
@@ -19595,7 +19611,7 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
19595
19611
  /**
19596
19612
  * Get zIndex from dialog
19597
19613
  */ getZIndex() {
19598
- return parseInt((0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_11__.css)(this.container, 'zIndex'), 10) || 0;
19614
+ return parseInt((0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_12__.css)(this.container, 'zIndex'), 10) || 0;
19599
19615
  }
19600
19616
  /**
19601
19617
  * Get dialog instance with maximum z-index displaying it on top of all the dialog boxes
@@ -19618,7 +19634,7 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
19618
19634
  this.__openedSiblings().forEach((dialog)=>{
19619
19635
  maxZIndex = Math.max(dialog.getZIndex(), maxZIndex);
19620
19636
  });
19621
- (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_11__.css)(this.container, 'zIndex', (maxZIndex + 1).toString());
19637
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_12__.css)(this.container, 'zIndex', (maxZIndex + 1).toString());
19622
19638
  }
19623
19639
  /**
19624
19640
  * Expands the dialog on full browser window
@@ -19668,7 +19684,7 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
19668
19684
  this.setPosition(this.offsetX, this.offsetY);
19669
19685
  this.setMaxZIndex();
19670
19686
  } else {
19671
- (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_11__.css)(this.container, 'zIndex', null);
19687
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_12__.css)(this.container, 'zIndex', null);
19672
19688
  }
19673
19689
  if (this.o.fullsize) {
19674
19690
  this.toggleFullSize(true);
@@ -19782,7 +19798,7 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
19782
19798
  * True, if dialog was opened
19783
19799
  */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "isOpened", false);
19784
19800
  const self1 = this;
19785
- self1.options = (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_11__.ConfigProto)(options, (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_11__.ConfigProto)(jodit_config__WEBPACK_IMPORTED_MODULE_16__.Config.prototype.dialog, Dialog.defaultOptions));
19801
+ self1.options = (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_12__.ConfigProto)(options, (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_12__.ConfigProto)(jodit_config__WEBPACK_IMPORTED_MODULE_17__.Config.prototype.dialog, Dialog.defaultOptions));
19786
19802
  // Attach event handlers passed via `options.events` to the dialog's own
19787
19803
  // emitter (as FileBrowser already does), so a consumer — e.g. a plugin
19788
19804
  // forwarding the editor's `events` config — can observe `afterOpen` /
@@ -19800,40 +19816,40 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
19800
19816
  </div>
19801
19817
  <div class="${n('content')}"></div>
19802
19818
  <div class="${n('footer')}"></div>
19803
- <div class="${n('resizer')}">${jodit_core_ui__WEBPACK_IMPORTED_MODULE_13__.Icon.get('resize_handler')}</div>
19819
+ <div class="${n('resizer')}">${jodit_core_ui__WEBPACK_IMPORTED_MODULE_14__.Icon.get('resize_handler')}</div>
19804
19820
  </div>
19805
19821
  </div>`);
19806
19822
  if (self1.options.direction === 'rtl') {
19807
- (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_11__.css)(self1.container, 'direction', 'rtl');
19808
- (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_11__.attr)(self1.container, 'dir', 'rtl');
19823
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_12__.css)(self1.container, 'direction', 'rtl');
19824
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_12__.attr)(self1.container, 'dir', 'rtl');
19809
19825
  }
19810
19826
  if (this.o.zIndex) {
19811
- (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_11__.css)(this.container, 'zIndex', this.o.zIndex.toString());
19827
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_12__.css)(this.container, 'zIndex', this.o.zIndex.toString());
19812
19828
  }
19813
- ;(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_11__.attr)(self1.container, 'role', 'dialog');
19829
+ ;(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_12__.attr)(self1.container, 'role', 'dialog');
19814
19830
  Object.defineProperty(self1.container, 'component', {
19815
19831
  value: this
19816
19832
  });
19817
19833
  self1.setMod('theme', self1.o.theme || 'default').setMod('resizable', Boolean(self1.o.resizable));
19818
19834
  const dialog = self1.getElm('panel');
19819
- (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_12__.assert)(dialog != null, 'Panel element does not exist');
19835
+ (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_13__.assert)(dialog != null, 'Panel element does not exist');
19820
19836
  const resizer = self1.getElm('resizer');
19821
- (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_12__.assert)(resizer != null, 'Resizer element does not exist');
19837
+ (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_13__.assert)(resizer != null, 'Resizer element does not exist');
19822
19838
  const dialogbox_header = self1.getElm('header-title');
19823
- (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_12__.assert)(dialogbox_header != null, 'header-title element does not exist');
19839
+ (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_13__.assert)(dialogbox_header != null, 'header-title element does not exist');
19824
19840
  const dialogbox_content = self1.getElm('content');
19825
- (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_12__.assert)(dialogbox_content != null, 'Content element does not exist');
19841
+ (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_13__.assert)(dialogbox_content != null, 'Content element does not exist');
19826
19842
  const dialogbox_footer = self1.getElm('footer');
19827
- (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_12__.assert)(dialogbox_footer != null, 'Footer element does not exist');
19843
+ (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_13__.assert)(dialogbox_footer != null, 'Footer element does not exist');
19828
19844
  const dialogbox_toolbar = self1.getElm('header-toolbar');
19829
- (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_12__.assert)(dialogbox_toolbar != null, 'header-toolbar element does not exist');
19845
+ (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_13__.assert)(dialogbox_toolbar != null, 'header-toolbar element does not exist');
19830
19846
  this.dialog = dialog;
19831
19847
  this.resizer = resizer;
19832
19848
  this.dialogbox_header = dialogbox_header;
19833
19849
  this.dialogbox_content = dialogbox_content;
19834
19850
  this.dialogbox_footer = dialogbox_footer;
19835
19851
  this.dialogbox_toolbar = dialogbox_toolbar;
19836
- (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_11__.css)(self1.dialog, {
19852
+ (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_12__.css)(self1.dialog, {
19837
19853
  maxWidth: self1.options.maxWidth,
19838
19854
  minHeight: self1.options.minHeight,
19839
19855
  minWidth: self1.options.minWidth
@@ -19846,7 +19862,7 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
19846
19862
  this.e.on(self1.container, 'close_dialog', self1.close).on(this.ow, 'keydown', this.__onEsc).on(this.ow, 'resize', this.__onResize);
19847
19863
  if (this.o.closeOnClickOverlay) {
19848
19864
  const overlay = self1.getElm('overlay');
19849
- (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_12__.assert)(overlay != null, 'Overlay element does not exist');
19865
+ (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_13__.assert)(overlay != null, 'Overlay element does not exist');
19850
19866
  this.e.on(overlay, 'click', self1.close);
19851
19867
  }
19852
19868
  }
@@ -19855,7 +19871,7 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
19855
19871
  * Registry of the currently opened dialogs. Replaces a DOM scan of the
19856
19872
  * whole `destination` (usually `document.body`) for every z-index update.
19857
19873
  */ ;(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(Dialog, "__opened", new Set());
19858
- (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(Dialog, "defaultOptions", (0,_swc_helpers_object_spread_props__WEBPACK_IMPORTED_MODULE_2__._)((0,_swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_1__._)({}, jodit_core_view_view__WEBPACK_IMPORTED_MODULE_14__.View.defaultOptions), {
19874
+ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(Dialog, "defaultOptions", (0,_swc_helpers_object_spread_props__WEBPACK_IMPORTED_MODULE_2__._)((0,_swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_1__._)({}, jodit_core_view_view__WEBPACK_IMPORTED_MODULE_15__.View.defaultOptions), {
19859
19875
  closeOnClickOverlay: false,
19860
19876
  closeOnEsc: true
19861
19877
  }));
@@ -25032,6 +25048,13 @@ class ToolbarContent extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__.U
25032
25048
  /** @override */ className() {
25033
25049
  return 'ToolbarContent';
25034
25050
  }
25051
+ /** A toolbar item like `ToolbarButton`: the parent group is a `list`. */ getRole() {
25052
+ return 'listitem';
25053
+ }
25054
+ /**
25055
+ * Arbitrary content is not a toggle button — `aria-pressed` is not
25056
+ * allowed on a `listitem`.
25057
+ */ onChangeActivated() {}
25035
25058
  /** @override */ update() {
25036
25059
  var _control_isDisabled, _control_isActive, _control_update;
25037
25060
  const { control } = this;
@@ -25072,7 +25095,6 @@ class ToolbarContent extends jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_5__.U
25072
25095
  constructor(jodit, control, target = null){
25073
25096
  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;
25074
25097
  this.container.classList.add(`${this.componentName}_${this.clearName(control.name)}`);
25075
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.attr)(this.container, 'role', 'content');
25076
25098
  }
25077
25099
  }
25078
25100
  ToolbarContent = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
@@ -33113,7 +33135,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeBaseUrl = '';
33113
33135
  jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeTitle = 'Jodit Editor';
33114
33136
  jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeDoctype = '<!DOCTYPE html>';
33115
33137
  jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeDefaultSrc = 'about:blank';
33116
- jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeStyle = 'html{' + 'margin:0;' + 'padding:0;' + 'min-height: 100%;' + '}' + 'body{' + 'box-sizing:border-box;' + 'font-size:13px;' + 'line-height:1.6;' + 'padding:10px;' + 'margin:0;' + 'background:transparent;' + 'color:#000;' + 'position:' + 'relative;' + 'z-index:2;' + 'user-select:auto;' + 'margin:0px;' + 'overflow:auto;' + 'outline:none;' + '}' + 'table{' + 'width:100%;' + 'border:none;' + 'border-collapse:collapse;' + 'empty-cells: show;' + 'max-width: 100%;' + '}' + 'th,td{' + 'padding: 2px 5px;' + 'border:1px solid #ccc;' + '-webkit-user-select:text;' + '-moz-user-select:text;' + '-ms-user-select:text;' + 'user-select:text' + '}' + 'p{' + 'margin-top:0;' + '}' + '.jodit_editor .jodit_iframe_wrapper{' + 'display: block;' + 'clear: both;' + 'user-select: none;' + 'position: relative;' + '}' + '.jodit_editor .jodit_iframe_wrapper:after {' + 'position:absolute;' + 'content:"";' + 'z-index:1;' + 'top:0;' + 'left:0;' + 'right: 0;' + 'bottom: 0;' + 'cursor: pointer;' + 'display: block;' + 'background: rgba(0, 0, 0, 0);' + '} ' + '.jodit_disabled{' + 'user-select: none;' + '-o-user-select: none;' + '-moz-user-select: none;' + '-khtml-user-select: none;' + '-webkit-user-select: none;' + '-ms-user-select: none' + '}';
33138
+ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeStyle = 'html{' + 'margin:0;' + 'padding:0;' + 'min-height: 100%;' + '}' + 'body{' + 'box-sizing:border-box;' + 'font-size:13px;' + 'line-height:1.6;' + 'padding:10px;' + 'margin:0;' + 'background:transparent;' + 'color:#000;' + 'position:' + 'relative;' + 'z-index:2;' + 'user-select:auto;' + 'margin:0px;' + 'overflow:auto;' + 'outline:none;' + '}' + 'table{' + 'width:100%;' + 'border:none;' + 'border-collapse:collapse;' + 'empty-cells: show;' + 'max-width: 100%;' + '}' + 'th,td{' + 'padding: 2px 5px;' + 'border:1px solid #ccc;' + '-webkit-user-select:text;' + '-moz-user-select:text;' + '-ms-user-select:text;' + 'user-select:text' + '}' + 'p{' + 'margin-top:0;' + '}' + '.jodit_editor .jodit_iframe_wrapper{' + 'display: block;' + 'clear: both;' + 'user-select: none;' + 'position: relative;' + '}' + '.jodit_editor .jodit_iframe_wrapper:after {' + 'position:absolute;' + 'content:"";' + 'z-index:1;' + 'top:0;' + 'left:0;' + 'right: 0;' + 'bottom: 0;' + 'cursor: pointer;' + 'display: block;' + 'background: rgba(0, 0, 0, 0);' + '} ' + '.jodit-wysiwyg_image-selected::selection,' + '.jodit-wysiwyg_image-selected *:not(img)::selection{' + 'background:transparent' + '}' + '.jodit_disabled{' + 'user-select: none;' + '-o-user-select: none;' + '-moz-user-select: none;' + '-khtml-user-select: none;' + '-webkit-user-select: none;' + '-ms-user-select: none' + '}';
33117
33139
  jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeCSSLinks = [];
33118
33140
  jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeSandbox = null;
33119
33141
 
@@ -33358,13 +33380,19 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.imageProcessor = {
33358
33380
 
33359
33381
 
33360
33382
 
33383
+
33361
33384
  const JODIT_IMAGE_PROCESSOR_BINDED = '__jodit_imageprocessor_binded';
33362
33385
  const JODIT_IMAGE_BLOB_ID = JODIT_IMAGE_PROCESSOR_BINDED + 'blob-id';
33386
+ const IMAGE_SELECTED = 'jodit-wysiwyg_image-selected';
33363
33387
  /**
33364
33388
  * Change editor's size after load all images
33365
33389
  */ class imageProcessor extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin {
33366
- afterInit(jodit) {}
33390
+ afterInit(jodit) {
33391
+ jodit.e.on(jodit.ed, 'selectionchange', this.onSelectionChange);
33392
+ }
33367
33393
  beforeDestruct(jodit) {
33394
+ jodit.e.off(jodit.ed, 'selectionchange', this.onSelectionChange);
33395
+ jodit.editor.classList.remove(IMAGE_SELECTED);
33368
33396
  const buffer = (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.cached)(jodit, 'buffer');
33369
33397
  const list = buffer === null || buffer === void 0 ? void 0 : buffer.get(JODIT_IMAGE_BLOB_ID);
33370
33398
  if (buffer && list) {
@@ -33395,6 +33423,13 @@ const JODIT_IMAGE_BLOB_ID = JODIT_IMAGE_PROCESSOR_BINDED + 'blob-id';
33395
33423
  }
33396
33424
  }
33397
33425
  }
33426
+ /**
33427
+ * While the selection is an image, only the image is highlighted: Safari
33428
+ * paints the rest of a block image's line with its parent's highlight. See #1528
33429
+ */ onSelectionChange() {
33430
+ const { jodit } = this;
33431
+ jodit.editor.classList.toggle(IMAGE_SELECTED, isImageSelected(jodit));
33432
+ }
33398
33433
  afterChange(data) {
33399
33434
  return (0,_swc_helpers_async_to_generator__WEBPACK_IMPORTED_MODULE_0__._)(function*() {
33400
33435
  const { jodit: editor } = this;
@@ -33429,6 +33464,9 @@ const JODIT_IMAGE_BLOB_ID = JODIT_IMAGE_PROCESSOR_BINDED + 'blob-id';
33429
33464
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
33430
33465
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.watch)(':beforeSetElementValue')
33431
33466
  ], imageProcessor.prototype, "onBeforeSetElementValue", null);
33467
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
33468
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.autobind
33469
+ ], imageProcessor.prototype, "onSelectionChange", null);
33432
33470
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
33433
33471
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.watch)([
33434
33472
  ':change',
@@ -33437,6 +33475,14 @@ const JODIT_IMAGE_BLOB_ID = JODIT_IMAGE_PROCESSOR_BINDED + 'blob-id';
33437
33475
  ]),
33438
33476
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.debounce)()
33439
33477
  ], imageProcessor.prototype, "afterChange", null);
33478
+ function isImageSelected(jodit) {
33479
+ const { sel } = jodit.s;
33480
+ if (!sel || !sel.rangeCount) {
33481
+ return false;
33482
+ }
33483
+ const { startContainer, startOffset, endContainer, endOffset } = sel.getRangeAt(0);
33484
+ return startContainer === endContainer && endOffset === startOffset + 1 && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isTag(startContainer.childNodes[startOffset], 'img') && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isOrContains(jodit.editor, startContainer);
33485
+ }
33440
33486
  /**
33441
33487
  * Remove the invisible-space text beside an image, which only held a caret.
33442
33488
  * Selecting the image replaces the caret, and with the text still after a
@@ -42356,19 +42402,26 @@ class AceEditor extends jodit_plugins_source_editor_sourceEditor__WEBPACK_IMPORT
42356
42402
  onResize();
42357
42403
  this.onReady();
42358
42404
  };
42405
+ let loading = false;
42359
42406
  const initAceEditor = ()=>{
42360
42407
  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) {
42361
42408
  return;
42362
42409
  }
42410
+ // ACE (~400 KiB from the CDN) is only needed once the source view
42411
+ // is actually shown — a page that stays in WYSIWYG must not
42412
+ // download it.
42413
+ if (!this.aceExists()) {
42414
+ if (!loading) {
42415
+ loading = true;
42416
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.loadNext)(editor, editor.o.sourceEditorCDNUrlsJS).then(initAceEditor).catch(()=>null);
42417
+ }
42418
+ return;
42419
+ }
42363
42420
  this.fromWYSIWYG();
42364
42421
  tryInitAceEditor();
42365
42422
  };
42366
42423
  editor.e.on('afterSetMode', initAceEditor);
42367
42424
  initAceEditor();
42368
- // global add ace editor in browser
42369
- if (!this.aceExists()) {
42370
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.loadNext)(editor, editor.o.sourceEditorCDNUrlsJS).then(initAceEditor).catch(()=>null);
42371
- }
42372
42425
  }
42373
42426
  destruct() {
42374
42427
  var _this_j_events, _this_j;
@@ -42918,7 +42971,20 @@ class SourceEditor {
42918
42971
  return false;
42919
42972
  };
42920
42973
  if (!addEventListener()) {
42921
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.loadNext)(editor, editor.o.beautifyHTMLCDNUrlsJS).then(addEventListener, ()=>null);
42974
+ // js-beautify is only needed once the source view is shown —
42975
+ // do not download it for a page that stays in WYSIWYG.
42976
+ let loading = false;
42977
+ const loadBeautify = ()=>{
42978
+ if (loading || editor.getMode() !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.MODE_SOURCE && editor.getMode() !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.MODE_SPLIT) {
42979
+ return;
42980
+ }
42981
+ loading = true;
42982
+ // It formats the source view from the next time it opens:
42983
+ // filling it again now would replace what was typed there
42984
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.loadNext)(editor, editor.o.beautifyHTMLCDNUrlsJS).then(addEventListener, ()=>null);
42985
+ };
42986
+ editor.e.on('afterSetMode.source', loadBeautify);
42987
+ loadBeautify();
42922
42988
  }
42923
42989
  }
42924
42990
  this.syncValueFromWYSIWYG(true);