jodit 4.18.6 → 4.18.8

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 +19 -0
  2. package/es2015/jodit.css +1 -1
  3. package/es2015/jodit.fat.min.js +9 -9
  4. package/es2015/jodit.js +265 -36
  5. package/es2015/jodit.min.js +9 -9
  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 -9
  13. package/es2018/jodit.min.js +7 -7
  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 +11 -11
  18. package/es2021/jodit.js +264 -36
  19. package/es2021/jodit.min.js +7 -7
  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 +8 -8
  28. package/es2021.en/jodit.js +264 -36
  29. package/es2021.en/jodit.min.js +7 -7
  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 +280 -35
  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/config.d.ts +4 -2
  51. package/esm/core/constants.js +1 -1
  52. package/esm/core/decorators/component/component.js +12 -0
  53. package/esm/core/ui/popup/popup.js +14 -9
  54. package/esm/jodit.js +5 -1
  55. package/esm/modules/dialog/dialog.js +18 -3
  56. package/esm/modules/file-browser/ui/files/files.js +17 -2
  57. package/esm/modules/file-browser/ui/tree/tree.js +17 -2
  58. package/esm/plugins/backspace/cases/check-join-neighbors.js +81 -0
  59. package/esm/plugins/backspace/cases/check-remove-char.d.ts +2 -1
  60. package/esm/plugins/backspace/cases/check-remove-char.js +31 -9
  61. package/esm/plugins/backspace/cases/check-unwrap-list-item.d.ts +26 -0
  62. package/esm/plugins/backspace/cases/check-unwrap-list-item.js +56 -0
  63. package/esm/plugins/backspace/cases/index.js +2 -0
  64. package/esm/plugins/backspace/config.d.ts +4 -2
  65. package/esm/plugins/backspace/config.js +6 -3
  66. package/esm/plugins/enter/enter.js +1 -1
  67. package/esm/plugins/enter/helpers/check-br.js +7 -2
  68. package/esm/plugins/image-properties/image-properties.d.ts +5 -0
  69. package/esm/plugins/image-properties/image-properties.js +30 -5
  70. package/esm/plugins/mobile/mobile.js +7 -4
  71. package/package.json +1 -1
  72. package/types/config.d.ts +4 -2
  73. package/types/plugins/backspace/cases/check-remove-char.d.ts +2 -1
  74. package/types/plugins/backspace/cases/check-unwrap-list-item.d.ts +26 -0
  75. package/types/plugins/backspace/config.d.ts +4 -2
  76. package/types/plugins/image-properties/image-properties.d.ts +5 -0
package/es5/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.18.6
4
+ * Version: v4.18.8
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -2152,7 +2152,7 @@ __webpack_require__.r(__webpack_exports__);
2152
2152
  * @packageDocumentation
2153
2153
  * @module constants
2154
2154
  */
2155
- var APP_VERSION = "4.18.6";
2155
+ var APP_VERSION = "4.18.8";
2156
2156
  // prettier-ignore
2157
2157
  var ES = "es5";
2158
2158
  var IS_ES_MODERN = false;
@@ -2893,6 +2893,8 @@ function cacheHTML(target, _, descriptor) {
2893
2893
 
2894
2894
 
2895
2895
  var componentRegistry = new Map();
2896
+ var decoratedClasses = new WeakSet();
2897
+ var warnedClasses = new WeakSet();
2896
2898
  /**
2897
2899
  * Decorate components and set status isReady after constructor
2898
2900
  * @param constructorFunction - Component constructor class
@@ -2916,11 +2918,18 @@ var componentRegistry = new Map();
2916
2918
  Object.setPrototypeOf(_this, newConstructorFunction.prototype);
2917
2919
  }
2918
2920
  _this.setStatus('ready');
2921
+ } else if (!jodit_core_constants__WEBPACK_IMPORTED_MODULE_5__.IS_PROD && !decoratedClasses.has(_this.constructor) && !warnedClasses.has(_this.constructor)) {
2922
+ // Only the outermost class's decorator sets `ready`, so a subclass
2923
+ // without its own decorator stays in `beforeInit`. See #1685
2924
+ warnedClasses.add(_this.constructor);
2925
+ console.warn('Component "'.concat(_this.constructor.name || (0,jodit_core_helpers_utils_get_class_name__WEBPACK_IMPORTED_MODULE_6__.getClassName)(_this), '" extends a @component class without being decorated itself, so it never becomes ready and its @watch, @debounce, @throttle and @hook handlers never run'));
2919
2926
  }
2920
2927
  return _this;
2921
2928
  }
2922
2929
  return newConstructorFunction;
2923
2930
  }(constructorFunction);
2931
+ decoratedClasses.add(constructorFunction);
2932
+ decoratedClasses.add(newConstructorFunction);
2924
2933
  var name = (0,jodit_core_helpers_utils_get_class_name__WEBPACK_IMPORTED_MODULE_6__.getClassName)(constructorFunction.prototype);
2925
2934
  if (componentRegistry.has(name) && !jodit_core_constants__WEBPACK_IMPORTED_MODULE_5__.IS_PROD) {
2926
2935
  throw new Error('Component with name "'.concat(name, '" is already registered'));
@@ -21249,6 +21258,9 @@ var Popup = /*#__PURE__*/ function(UIGroup) {
21249
21258
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_10__.__decorate)([
21250
21259
  jodit_core_decorators__WEBPACK_IMPORTED_MODULE_12__.autobind
21251
21260
  ], Popup.prototype, "__closeOnOutsideClick", null);
21261
+ Popup = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_10__.__decorate)([
21262
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_12__.component
21263
+ ], Popup);
21252
21264
 
21253
21265
 
21254
21266
  /***/ }),
@@ -22707,7 +22719,7 @@ var Jodit = /*#__PURE__*/ function(ViewWithToolbar) {
22707
22719
  commands.push(command);
22708
22720
  if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_15__.isFunction)(command)) {
22709
22721
  var hotkeys = this.o.commandToHotkeys[commandName] || this.o.commandToHotkeys[commandNameOriginal] || command.hotkeys;
22710
- if (hotkeys) {
22722
+ if (hotkeys && hotkeys.length) {
22711
22723
  this.registerHotkeyToCommand(hotkeys, commandName, options === null || options === void 0 ? void 0 : options.stopPropagation);
22712
22724
  }
22713
22725
  }
@@ -22721,6 +22733,10 @@ var Jodit = /*#__PURE__*/ function(ViewWithToolbar) {
22721
22733
  value: function registerHotkeyToCommand(hotkeys, commandName) {
22722
22734
  var _this = this;
22723
22735
  var shouldStop = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;
22736
+ // An empty list (e.g. `commandToHotkeys: { cmd: [] }`) turns the key off
22737
+ if (!hotkeys || !hotkeys.length) {
22738
+ return;
22739
+ }
22724
22740
  var shortcuts = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_15__.asArray)(hotkeys).map(jodit_core_helpers__WEBPACK_IMPORTED_MODULE_15__.normalizeKeyAliases).map(function(hotkey) {
22725
22741
  return hotkey + '.hotkey';
22726
22742
  }).join(' ');
@@ -24084,6 +24100,11 @@ ContextMenu = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_4__.__decorat
24084
24100
 
24085
24101
 
24086
24102
 
24103
+ /**
24104
+ * A position from 0 up to `max`, or 0 when the panel is larger than the window
24105
+ */ var clampToWindow = function clampToWindow(value, max) {
24106
+ return Math.max(0, Math.min(value, max));
24107
+ };
24087
24108
  jodit_config__WEBPACK_IMPORTED_MODULE_23__.Config.prototype.dialog = {
24088
24109
  namespace: '',
24089
24110
  extraButtons: [],
@@ -24279,6 +24300,11 @@ var Dialog = /*#__PURE__*/ function(ViewWithToolbar) {
24279
24300
  this.startY = e.clientY;
24280
24301
  this.startPoint.x = (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_18__.css)(this.dialog, 'left');
24281
24302
  this.startPoint.y = (0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_18__.css)(this.dialog, 'top');
24303
+ // Rounded up: at the right edge a fraction of a pixel less room would
24304
+ // wrap the header of a panel that has no width of its own
24305
+ var _this_dialog_getBoundingClientRect = this.dialog.getBoundingClientRect(), width = _this_dialog_getBoundingClientRect.width, height = _this_dialog_getBoundingClientRect.height;
24306
+ this.startPoint.w = Math.ceil(width);
24307
+ this.startPoint.h = Math.ceil(height);
24282
24308
  this.setMaxZIndex();
24283
24309
  if (e.cancelable) {
24284
24310
  e.preventDefault();
@@ -24297,7 +24323,11 @@ var Dialog = /*#__PURE__*/ function(ViewWithToolbar) {
24297
24323
  key: "__onMouseMove",
24298
24324
  value: function __onMouseMove(e) {
24299
24325
  if (this.draggable && this.o.draggable) {
24300
- this.setPosition(this.startPoint.x + e.clientX - this.startX, this.startPoint.y + e.clientY - this.startY);
24326
+ var documentElement = this.od.documentElement;
24327
+ // Keep the whole panel in the window at the size it had when the
24328
+ // drag began. A panel with no width of its own would otherwise
24329
+ // shrink as it neared the right edge, and then leave the window
24330
+ this.setPosition(clampToWindow(this.startPoint.x + e.clientX - this.startX, (documentElement.clientWidth || this.ow.innerWidth) - this.startPoint.w), clampToWindow(this.startPoint.y + e.clientY - this.startY, (documentElement.clientHeight || this.ow.innerHeight) - this.startPoint.h));
24301
24331
  if (this.e) {
24302
24332
  /**
24303
24333
  * Fired when dialog box is moved
@@ -24447,8 +24477,8 @@ var Dialog = /*#__PURE__*/ function(ViewWithToolbar) {
24447
24477
  }
24448
24478
  // strings on purpose: `css()` would truncate fractional pixels
24449
24479
  ;(0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_18__.css)(this.dialog, {
24450
- left: (x || left) + 'px',
24451
- top: (y || top) + 'px'
24480
+ left: (x !== null && x !== void 0 ? x : left) + 'px',
24481
+ top: (y !== null && y !== void 0 ? y : top) + 'px'
24452
24482
  });
24453
24483
  return this;
24454
24484
  }
@@ -27302,7 +27332,10 @@ var DEFAULT_SOURCE_NAME = 'default';
27302
27332
  /* harmony import */ var _swc_helpers_class_call_check__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(73104);
27303
27333
  /* harmony import */ var _swc_helpers_create_class__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(53429);
27304
27334
  /* harmony import */ var _swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(34918);
27305
- /* harmony import */ var jodit_core_ui__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(4099);
27335
+ /* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(31635);
27336
+ /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(84839);
27337
+ /* harmony import */ var jodit_core_ui__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(4099);
27338
+
27306
27339
 
27307
27340
 
27308
27341
 
@@ -27313,6 +27346,7 @@ var DEFAULT_SOURCE_NAME = 'default';
27313
27346
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
27314
27347
  */
27315
27348
 
27349
+
27316
27350
  var FileBrowserFiles = /*#__PURE__*/ function(UIGroup) {
27317
27351
  "use strict";
27318
27352
  (0,_swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__._)(FileBrowserFiles, UIGroup);
@@ -27329,7 +27363,10 @@ var FileBrowserFiles = /*#__PURE__*/ function(UIGroup) {
27329
27363
  }
27330
27364
  ]);
27331
27365
  return FileBrowserFiles;
27332
- }(jodit_core_ui__WEBPACK_IMPORTED_MODULE_4__.UIGroup);
27366
+ }(jodit_core_ui__WEBPACK_IMPORTED_MODULE_6__.UIGroup);
27367
+ FileBrowserFiles = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_4__.__decorate)([
27368
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_5__.component
27369
+ ], FileBrowserFiles);
27333
27370
 
27334
27371
 
27335
27372
  /***/ }),
@@ -27367,7 +27404,10 @@ var FileBrowserFiles = /*#__PURE__*/ function(UIGroup) {
27367
27404
  /* harmony import */ var _swc_helpers_class_call_check__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(73104);
27368
27405
  /* harmony import */ var _swc_helpers_create_class__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(53429);
27369
27406
  /* harmony import */ var _swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(34918);
27370
- /* harmony import */ var jodit_core_ui__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(4099);
27407
+ /* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(31635);
27408
+ /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(84839);
27409
+ /* harmony import */ var jodit_core_ui__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(4099);
27410
+
27371
27411
 
27372
27412
 
27373
27413
 
@@ -27378,6 +27418,7 @@ var FileBrowserFiles = /*#__PURE__*/ function(UIGroup) {
27378
27418
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
27379
27419
  */
27380
27420
 
27421
+
27381
27422
  var FileBrowserTree = /*#__PURE__*/ function(UIGroup) {
27382
27423
  "use strict";
27383
27424
  (0,_swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__._)(FileBrowserTree, UIGroup);
@@ -27394,7 +27435,10 @@ var FileBrowserTree = /*#__PURE__*/ function(UIGroup) {
27394
27435
  }
27395
27436
  ]);
27396
27437
  return FileBrowserTree;
27397
- }(jodit_core_ui__WEBPACK_IMPORTED_MODULE_4__.UIGroup);
27438
+ }(jodit_core_ui__WEBPACK_IMPORTED_MODULE_6__.UIGroup);
27439
+ FileBrowserTree = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_4__.__decorate)([
27440
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_5__.component
27441
+ ], FileBrowserTree);
27398
27442
 
27399
27443
 
27400
27444
  /***/ }),
@@ -34096,6 +34140,9 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_9__.pluginSystem.add('backspace', bac
34096
34140
  * Check if two separate elements can be connected
34097
34141
  * @private
34098
34142
  */ function checkJoinNeighbors(jodit, fakeNode, backspace) {
34143
+ if (checkJoinBareText(jodit, fakeNode, backspace)) {
34144
+ return true;
34145
+ }
34099
34146
  var nextBox = fakeNode, mainClosestBox = nextBox;
34100
34147
  // Find the main big closest element
34101
34148
  while(nextBox && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.findNotEmptySibling(nextBox, backspace) && nextBox.parentElement !== jodit.editor){
@@ -34123,7 +34170,7 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_9__.pluginSystem.add('backspace', bac
34123
34170
  return true;
34124
34171
  }
34125
34172
  var box = findCaretBox(fakeNode, mainClosestBox);
34126
- if (sibling && (checkPullNextLine(jodit, fakeNode, box, sibling, backspace) || checkMoveListContent(jodit, box, sibling, backspace) || moveContentAndRemoveEmpty(jodit, box, findEdgeBlock(resolveTableSibling(sibling, backspace), backspace, jodit.editor), backspace))) {
34173
+ if (sibling && (checkPullNextLine(jodit, fakeNode, box, sibling, backspace) || checkMoveListContent(jodit, box, sibling, backspace) || checkJoinInlineSibling(jodit, box, sibling, backspace) || moveContentAndRemoveEmpty(jodit, box, findEdgeBlock(resolveTableSibling(sibling, backspace), backspace, jodit.editor), backspace))) {
34127
34174
  jodit.s.setCursorBefore(fakeNode);
34128
34175
  return true;
34129
34176
  }
@@ -34210,6 +34257,74 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_9__.pluginSystem.add('backspace', bac
34210
34257
  }
34211
34258
  return true;
34212
34259
  }
34260
+ /**
34261
+ * A block next to bare text in the same parent joins that text, as the
34262
+ * browsers do: `<li>one<p>|two</p></li>` gives `<li>one|two</li>`, and
34263
+ * `<li><p>one|</p>two</li>` gives `<li><p>one|two</p></li>`
34264
+ * @private
34265
+ */ function checkJoinInlineSibling(jodit, box, sibling, backspace) {
34266
+ if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(sibling) || !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(box) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isList(box) || // The caret's block is nested deeper than the text: `text<div><p>|x</p></div>`
34267
+ box.parentNode !== sibling.parentNode || Array.from(box.childNodes).some(function(node) {
34268
+ return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(node);
34269
+ })) {
34270
+ return false;
34271
+ }
34272
+ if (backspace) {
34273
+ // Text after the block keeps its own line
34274
+ var next = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.findNotEmptySibling(box, false);
34275
+ if (next && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(next) && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(next, 'br')) {
34276
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.after(box, jodit.createInside.element('br'));
34277
+ }
34278
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.unwrap(box);
34279
+ return true;
34280
+ }
34281
+ var filter = (0,jodit_plugins_backspace_helpers__WEBPACK_IMPORTED_MODULE_2__.getMoveFilter)(jodit);
34282
+ for(var node = sibling; node && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(node);){
34283
+ var next1 = node.nextSibling;
34284
+ if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(node, 'br')) {
34285
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(node);
34286
+ break;
34287
+ }
34288
+ filter(node) ? jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(box, node) : jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(node);
34289
+ node = next1;
34290
+ }
34291
+ return true;
34292
+ }
34293
+ /**
34294
+ * Bare text next to a block in the same parent, as the browsers join them:
34295
+ * Backspace in `<div><p>a</p>|b</div>` gives `<div><p>a|b</p></div>`, Delete
34296
+ * in `<div>a|<p>b</p>c</div>` gives `<div>a|b<br>c</div>`
34297
+ */ function checkJoinBareText(jodit, fakeNode, backspace) {
34298
+ var block = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.findNotEmptySibling(fakeNode, backspace);
34299
+ if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement(block) || !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(block) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isList(block) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(block, 'table') || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isCell(block) || !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isContentEditable(block, jodit.editor) || Array.from(block.childNodes).some(function(node) {
34300
+ return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(node);
34301
+ })) {
34302
+ return false;
34303
+ }
34304
+ var filter = (0,jodit_plugins_backspace_helpers__WEBPACK_IMPORTED_MODULE_2__.getMoveFilter)(jodit);
34305
+ if (backspace) {
34306
+ // The caret's line goes to the end of the block before it
34307
+ for(var node = fakeNode; node && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(node);){
34308
+ var next = node.nextSibling;
34309
+ if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(node, 'br')) {
34310
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(node);
34311
+ break;
34312
+ }
34313
+ filter(node) ? jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(block, node) : jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(node);
34314
+ node = next;
34315
+ }
34316
+ } else {
34317
+ // The block's content joins the caret's line, and text after the
34318
+ // block keeps its own line
34319
+ var next1 = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.findNotEmptySibling(block, false);
34320
+ if (next1 && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(next1) && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(next1, 'br')) {
34321
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.after(block, jodit.createInside.element('br'));
34322
+ }
34323
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.unwrap(block);
34324
+ }
34325
+ jodit.s.setCursorBefore(fakeNode);
34326
+ return true;
34327
+ }
34213
34328
  function checkMoveListContent(jodit, mainClosestBox, sibling, backspace) {
34214
34329
  // Process UL/LI/OL cases
34215
34330
  var siblingIsList = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(sibling, jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.LIST_TAGS);
@@ -34362,9 +34477,11 @@ function moveContentAndRemoveEmpty(jodit, mainClosestBox, sibling, backspace) {
34362
34477
  * ```html
34363
34478
  * t|st
34364
34479
  * ```
34480
+ * With `stopBeforeSpace`, nothing is removed when the next char is a space.
34365
34481
  * @private
34366
34482
  */ // eslint-disable-next-line complexity
34367
34483
  function checkRemoveChar(jodit, fakeNode, backspace, mode) {
34484
+ var stopBeforeSpace = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : false;
34368
34485
  var step = backspace ? -1 : 1;
34369
34486
  var anotherSibling = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.sibling(fakeNode, !backspace);
34370
34487
  var sibling = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.sibling(fakeNode, backspace);
@@ -34383,6 +34500,9 @@ function checkRemoveChar(jodit, fakeNode, backspace, mode) {
34383
34500
  break;
34384
34501
  }
34385
34502
  if ((_sibling_nodeValue = sibling.nodeValue) === null || _sibling_nodeValue === void 0 ? void 0 : _sibling_nodeValue.length) {
34503
+ if (stopBeforeSpace && isSpace(nextChar(sibling.nodeValue, backspace))) {
34504
+ break;
34505
+ }
34386
34506
  removed = tryRemoveChar(sibling, backspace, step, anotherSibling);
34387
34507
  if (!sibling.nodeValue.length && jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isInlineBlock(sibling.parentNode)) {
34388
34508
  sibling.nodeValue = jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INVISIBLE_SPACE;
@@ -34420,10 +34540,11 @@ function getNextInlineSibling(sibling, backspace, root) {
34420
34540
  var nextSibling = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.sibling(sibling, backspace);
34421
34541
  if (!nextSibling && sibling.parentNode && sibling.parentNode !== root) {
34422
34542
  nextSibling = (0,jodit_plugins_backspace_helpers__WEBPACK_IMPORTED_MODULE_3__.findMostNestedNeighbor)(sibling, !backspace, root, true);
34423
- // Do not cross a list-item boundary. At the start of a list item the
34424
- // neighbor can be the text of the parent/previous item; deleting a char
34425
- // there is wrong — the list cases must handle the outdent/merge (#1277).
34426
- if (nextSibling && jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(sibling, 'li', root) !== jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(nextSibling, 'li', root)) {
34543
+ // Do not cross a block boundary. At the start of a list item the
34544
+ // neighbor can be the text of the parent/previous item (#1277), and at
34545
+ // the start of a paragraph the text before it in the same parent
34546
+ // (#1693); deleting a char there is wrong — the join cases handle them.
34547
+ if (nextSibling && jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(sibling, jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock, root) !== jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(nextSibling, jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock, root)) {
34427
34548
  return null;
34428
34549
  }
34429
34550
  }
@@ -34490,10 +34611,26 @@ function replaceSpaceOnNBSP(anotherSibling, backspace, value) {
34490
34611
  }
34491
34612
  function checkRepeatRemoveCharAction(backspace, sibling, fakeNode, mode, removed, jodit) {
34492
34613
  ;(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.call)(backspace ? jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.after : jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.before, sibling, fakeNode);
34493
- if (mode === 'sentence' || mode === 'word' && removed !== ' ' && removed !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.NBSP_SPACE) {
34494
- checkRemoveChar(jodit, fakeNode, backspace, mode);
34614
+ var wordChar = mode === 'word' && !isSpace(removed);
34615
+ // Backspace by word removes the spaces before the caret, then the word, and keeps the space in front of it
34616
+ if (mode === 'sentence' || wordChar || mode === 'word' && backspace) {
34617
+ checkRemoveChar(jodit, fakeNode, backspace, mode, wordChar && backspace);
34495
34618
  }
34496
34619
  }
34620
+ /**
34621
+ * The char tryRemoveChar would remove next
34622
+ */ function nextChar(value, backspace) {
34623
+ var chars = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.toArray)(value);
34624
+ var step = backspace ? -1 : 1;
34625
+ var index = backspace ? chars.length - 1 : 0;
34626
+ while(chars[index] === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INVISIBLE_SPACE){
34627
+ index += step;
34628
+ }
34629
+ return chars[index];
34630
+ }
34631
+ function isSpace(char) {
34632
+ return char === ' ' || char === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.NBSP_SPACE;
34633
+ }
34497
34634
 
34498
34635
 
34499
34636
  /***/ }),
@@ -34789,6 +34926,71 @@ function checkRepeatRemoveCharAction(backspace, sibling, fakeNode, mode, removed
34789
34926
  }
34790
34927
 
34791
34928
 
34929
+ /***/ }),
34930
+
34931
+ /***/ 88426:
34932
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
34933
+
34934
+ "use strict";
34935
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
34936
+ /* harmony export */ checkUnwrapListItem: function() { return /* binding */ checkUnwrapListItem; }
34937
+ /* harmony export */ });
34938
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23211);
34939
+ /*!
34940
+ * Jodit Editor (https://xdsoft.net/jodit/)
34941
+ * Released under MIT see LICENSE.txt in the project root for license information.
34942
+ * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
34943
+ */ /**
34944
+ * @module plugins/backspace
34945
+ */
34946
+ /**
34947
+ * Backspace at the start of a later list item takes the bullet off, as Word
34948
+ * does: the item becomes a paragraph where it was, and the list is split
34949
+ * around it. A split `<ol>` carries its numbering on with `start`.
34950
+ *
34951
+ * @example
34952
+ * ```html
34953
+ * <ol><li>first</li><li>|second</li><li>third</li></ol>
34954
+ * ```
34955
+ * Result
34956
+ * ```html
34957
+ * <ol><li>first</li></ol><p>|second</p><ol start="2"><li>third</li></ol>
34958
+ * ```
34959
+ *
34960
+ * @private
34961
+ */ function checkUnwrapListItem(jodit, fakeNode, backspace) {
34962
+ if (!backspace) {
34963
+ return false;
34964
+ }
34965
+ var li = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.closest(fakeNode, 'li', jodit.editor);
34966
+ var list = li ? li.parentElement : null;
34967
+ if (!li || !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isList(list) || !li.previousElementSibling || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(li) || Array.from(li.childNodes).some(function(node) {
34968
+ return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isBlock(node);
34969
+ }) || !jodit.s.cursorInTheEdge(true, li)) {
34970
+ return false;
34971
+ }
34972
+ var p = jodit.createInside.element(jodit.o.enterBlock);
34973
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.after(list, p);
34974
+ if (li.nextElementSibling) {
34975
+ var rest = list.cloneNode(false);
34976
+ // Two lists cannot share one id
34977
+ rest.removeAttribute('id');
34978
+ while(li.nextSibling){
34979
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.append(rest, li.nextSibling);
34980
+ }
34981
+ if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(list, 'ol')) {
34982
+ var start = parseInt(list.getAttribute('start') || '1', 10) || 1;
34983
+ rest.setAttribute('start', String(start + list.children.length - 1));
34984
+ }
34985
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.after(p, rest);
34986
+ }
34987
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.moveContent(li, p);
34988
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(li);
34989
+ jodit.s.setCursorBefore(fakeNode);
34990
+ return true;
34991
+ }
34992
+
34993
+
34792
34994
  /***/ }),
34793
34995
 
34794
34996
  /***/ 17523:
@@ -34809,6 +35011,7 @@ function checkRepeatRemoveCharAction(backspace, sibling, fakeNode, mode, removed
34809
35011
  /* harmony import */ var _check_remove_unbreakable_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(93890);
34810
35012
  /* harmony import */ var _check_table_cell__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(12443);
34811
35013
  /* harmony import */ var _check_unwrap_first_list_item__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(10157);
35014
+ /* harmony import */ var _check_unwrap_list_item__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(88426);
34812
35015
  /*!
34813
35016
  * Jodit Editor (https://xdsoft.net/jodit/)
34814
35017
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -34825,6 +35028,7 @@ function checkRepeatRemoveCharAction(backspace, sibling, fakeNode, mode, removed
34825
35028
 
34826
35029
 
34827
35030
 
35031
+
34828
35032
  /**
34829
35033
  * Ordered delete/backspace cases with stable keys. The first one returning
34830
35034
  * `true` wins. The keys are stable across minified builds (function names are
@@ -34859,6 +35063,10 @@ function checkRepeatRemoveCharAction(backspace, sibling, fakeNode, mode, removed
34859
35063
  'join-two-lists',
34860
35064
  _check_join_two_lists__WEBPACK_IMPORTED_MODULE_2__.checkJoinTwoLists
34861
35065
  ],
35066
+ [
35067
+ 'unwrap-list-item',
35068
+ _check_unwrap_list_item__WEBPACK_IMPORTED_MODULE_10__.checkUnwrapListItem
35069
+ ],
34862
35070
  [
34863
35071
  'join-neighbors',
34864
35072
  _check_join_neighbors__WEBPACK_IMPORTED_MODULE_1__.checkJoinNeighbors
@@ -34883,7 +35091,8 @@ function checkRepeatRemoveCharAction(backspace, sibling, fakeNode, mode, removed
34883
35091
  /***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
34884
35092
 
34885
35093
  "use strict";
34886
- /* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5266);
35094
+ /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
35095
+ /* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5266);
34887
35096
  /*!
34888
35097
  * Jodit Editor (https://xdsoft.net/jodit/)
34889
35098
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -34891,13 +35100,18 @@ function checkRepeatRemoveCharAction(backspace, sibling, fakeNode, mode, removed
34891
35100
  */ /**
34892
35101
  * @module plugins/backspace
34893
35102
  */
34894
- jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.delete = {
35103
+
35104
+ jodit_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.delete = {
34895
35105
  hotkeys: {
34896
- delete: [
35106
+ delete: jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.IS_MAC ? [
35107
+ 'delete'
35108
+ ] : [
34897
35109
  'delete',
34898
35110
  'cmd+backspace'
34899
35111
  ],
34900
- deleteWord: [
35112
+ deleteWord: jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.IS_MAC ? [
35113
+ 'ctrl+delete'
35114
+ ] : [
34901
35115
  'ctrl+delete',
34902
35116
  'cmd+alt+backspace',
34903
35117
  'ctrl+alt+backspace'
@@ -34909,7 +35123,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.delete = {
34909
35123
  backspace: [
34910
35124
  'backspace'
34911
35125
  ],
34912
- backspaceWord: [
35126
+ backspaceWord: jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.IS_MAC ? [] : [
34913
35127
  'ctrl+backspace'
34914
35128
  ],
34915
35129
  backspaceSentence: [
@@ -38939,7 +39153,7 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_7__.pluginSystem.add('dtd', dtd);
38939
39153
  ]);
38940
39154
  var block = (0,_helpers__WEBPACK_IMPORTED_MODULE_12__.getBlockWrapper)(fake, jodit);
38941
39155
  var isLi = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isLeaf(block);
38942
- // if use <br> defaultTag for break line or when was entered SHIFt key or in <td> or <th> or <blockquote>
39156
+ // if use <br> defaultTag for break line or when was entered SHIFt key or in <td>, <th> or <blockquote> without an inner block
38943
39157
  if ((!isLi || (event === null || event === void 0 ? void 0 : event.shiftKey)) && (0,_helpers__WEBPACK_IMPORTED_MODULE_12__.checkBR)(fake, jodit, event === null || event === void 0 ? void 0 : event.shiftKey, block)) {
38944
39158
  return false;
38945
39159
  }
@@ -39012,10 +39226,9 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_9__.pluginSystem.add('enter', enter);
39012
39226
  * Checks the possibility and necessity of inserting a BR instead of a block
39013
39227
  * @private
39014
39228
  */ function checkBR(fake, jodit, shiftKeyPressed, block) {
39015
- var isMultiLineBlock = Boolean(jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(fake, [
39016
- 'pre',
39017
- 'blockquote'
39018
- ], jodit.editor));
39229
+ // Text in a <pre>, or bare text in a quote, gets a BR. A real block inside
39230
+ // a quote (<p>, <h3>, ...) is split like anywhere else, as in a cell below.
39231
+ var isMultiLineBlock = Boolean(jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(fake, 'pre', jodit.editor)) || (block ? jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(block, 'blockquote') : Boolean(jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(fake, 'blockquote', jodit.editor)));
39019
39232
  // A cell itself can't be split into two cells, so bare cell content gets
39020
39233
  // a BR. But when the cell already holds a real block (<p>, <h3>, ...) that
39021
39234
  // block is split like anywhere else, otherwise every line of the cell
@@ -39025,7 +39238,7 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_9__.pluginSystem.add('enter', enter);
39025
39238
  'th'
39026
39239
  ], jodit.editor)));
39027
39240
  var isBRMode = jodit.o.enter.toLowerCase() === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.BR.toLowerCase();
39028
- // if you use <br> defaultTag for break line or when was entered SHIFt key or in <td> or <th> or <blockquote>
39241
+ // if you use <br> defaultTag for break line or when was entered SHIFt key or in <td>, <th> or <blockquote> without an inner block
39029
39242
  if (isBRMode || isCell || shiftKeyPressed && !isMultiLineBlock || !shiftKeyPressed && isMultiLineBlock) {
39030
39243
  // 2 BR before
39031
39244
  if (isMultiLineBlock && checkSeveralBR(fake)) {
@@ -41739,8 +41952,12 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.image = {
41739
41952
  dialog.close();
41740
41953
  });
41741
41954
  buttons.remove.onAction(function() {
41955
+ var caret = j.s.createRange();
41956
+ caret.setStartBefore(_this.state.sourceImage);
41957
+ caret.collapse(true);
41742
41958
  j.s.removeNode(_this.state.sourceImage);
41743
41959
  dialog.close();
41960
+ j.s.selectRange(caret);
41744
41961
  });
41745
41962
  buttons.cancel.onAction(function() {
41746
41963
  dialog.close();
@@ -41754,10 +41971,20 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.image = {
41754
41971
  ],
41755
41972
  buttons.check
41756
41973
  ]);
41757
- j.e.on(dialog, 'afterClose', function() {
41758
- if (_this.state.image.parentNode && j.o.image.selectImageAfterClose) {
41759
- j.s.select(_this.state.sourceImage);
41974
+ // The dialog fires `afterClose` on its own emitter, not the editor's
41975
+ dialog.e.on(dialog, 'afterClose', function() {
41976
+ var sourceImage = _this.state.sourceImage;
41977
+ if (j.isInDestruct || !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_10__.Dom.isOrContains(j.editor, sourceImage)) {
41978
+ return;
41979
+ }
41980
+ if (j.o.image.selectImageAfterClose) {
41981
+ j.s.select(sourceImage);
41982
+ return;
41760
41983
  }
41984
+ var caret = j.s.createRange();
41985
+ caret.setStartAfter(sourceImage);
41986
+ caret.collapse(true);
41987
+ j.s.selectRange(caret);
41761
41988
  });
41762
41989
  dialog.setSize(j.o.image.dialogWidth);
41763
41990
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_12__.markOwner)(j, dialog.container);
@@ -41795,6 +42022,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.image = {
41795
42022
  this.activeTabState.activeTab = 'Image';
41796
42023
  this.__lock();
41797
42024
  this.dialog.open().setModal(true).setPosition();
42025
+ this.__focusFirstField();
41798
42026
  this.async.promise(function(resolve, reject) {
41799
42027
  return (0,_readers__WEBPACK_IMPORTED_MODULE_19__.readValuesFromImage)(_this.j, _this.state).then(resolve, reject);
41800
42028
  }).catch(function(e) {
@@ -41807,6 +42035,21 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.image = {
41807
42035
  return false;
41808
42036
  }
41809
42037
  },
42038
+ {
42039
+ key: "__focusFirstField",
42040
+ value: /**
42041
+ * Keys typed while the dialog is open must not reach the editor behind it,
42042
+ * so focus the active tab's first field, or else the first field shown
42043
+ */ function __focusFirstField() {
42044
+ var _fields_concat_find;
42045
+ var fields = function fields(box) {
42046
+ return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_12__.toArray)(box.querySelectorAll('input, select, textarea'));
42047
+ };
42048
+ (_fields_concat_find = fields(this.form.getElm('tabsBox')).concat(fields(this.form.container)).find(function(field) {
42049
+ return field.offsetParent != null;
42050
+ })) === null || _fields_concat_find === void 0 ? void 0 : _fields_concat_find.focus();
42051
+ }
42052
+ },
41810
42053
  {
41811
42054
  key: "__lock",
41812
42055
  value: function __lock() {
@@ -46910,9 +47153,11 @@ var isButtonSeparator = function isButtonSeparator(item) {
46910
47153
  return cleaned;
46911
47154
  }
46912
47155
  /**
46913
- * The width that decides which breakpoint set the toolbar uses. A toolbar
46914
- * rendered into an external container (`toolbar` set to an element or a
46915
- * selector) lays out in that container, so its width is what matters there.
47156
+ * The width that decides which breakpoint set the toolbar uses: the editor's
47157
+ * own width, or its parent's while the editor has none yet (for example
47158
+ * while hidden at init). A toolbar rendered into an external container
47159
+ * (`toolbar` set to an element or a selector) lays out in that container, so
47160
+ * its width is what matters there.
46916
47161
  */ function adaptiveWidth(editor) {
46917
47162
  var _editor_container_parentElement;
46918
47163
  var toolbar = editor.o.toolbar;
@@ -46922,7 +47167,7 @@ var isButtonSeparator = function isButtonSeparator(item) {
46922
47167
  return width;
46923
47168
  }
46924
47169
  }
46925
- return ((_editor_container_parentElement = editor.container.parentElement) !== null && _editor_container_parentElement !== void 0 ? _editor_container_parentElement : editor.container).offsetWidth;
47170
+ return editor.container.offsetWidth || ((_editor_container_parentElement = editor.container.parentElement) !== null && _editor_container_parentElement !== void 0 ? _editor_container_parentElement : editor.container).offsetWidth;
46926
47171
  }
46927
47172
  /**
46928
47173
  * Rebuild toolbar in depends on editor's width
package/es5/jodit.min.css CHANGED
@@ -1,14 +1,14 @@
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.18.6
4
+ * Version: v4.18.8
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
8
8
  /*!
9
9
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
10
10
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
11
- * Version: v4.18.6
11
+ * Version: v4.18.8
12
12
  * Url: https://xdsoft.net/jodit/
13
13
  * License(s): MIT
14
14
  */