jodit 4.15.6 → 4.15.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/es2015/jodit.css +1 -1
  3. package/es2015/jodit.fat.min.js +3 -3
  4. package/es2015/jodit.js +64 -8
  5. package/es2015/jodit.min.js +3 -3
  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 +3 -3
  13. package/es2018/jodit.min.js +3 -3
  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 +3 -3
  18. package/es2021/jodit.js +63 -8
  19. package/es2021/jodit.min.js +3 -3
  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 +3 -3
  28. package/es2021.en/jodit.js +63 -8
  29. package/es2021.en/jodit.min.js +3 -3
  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 +105 -42
  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 +10 -0
  51. package/esm/core/constants.js +1 -1
  52. package/esm/plugins/clean-html/clean-html.d.ts +7 -3
  53. package/esm/plugins/clean-html/clean-html.js +37 -0
  54. package/esm/plugins/clean-html/config.d.ts +10 -0
  55. package/esm/plugins/clean-html/config.js +1 -0
  56. package/esm/plugins/drag-and-drop-element/drag-and-drop-element.d.ts +1 -0
  57. package/esm/plugins/drag-and-drop-element/drag-and-drop-element.js +19 -4
  58. package/package.json +1 -1
  59. package/types/config.d.ts +10 -0
  60. package/types/plugins/clean-html/clean-html.d.ts +7 -3
  61. package/types/plugins/clean-html/config.d.ts +10 -0
  62. package/types/plugins/drag-and-drop-element/drag-and-drop-element.d.ts +1 -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.15.6
4
+ * Version: v4.15.7
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -2107,7 +2107,7 @@ __webpack_require__.r(__webpack_exports__);
2107
2107
  * @packageDocumentation
2108
2108
  * @module constants
2109
2109
  */
2110
- var APP_VERSION = "4.15.6";
2110
+ var APP_VERSION = "4.15.7";
2111
2111
  // prettier-ignore
2112
2112
  var ES = "es5";
2113
2113
  var IS_ES_MODERN = false;
@@ -34064,16 +34064,17 @@ jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_10__.Icon.set('class-span', (_class_
34064
34064
  /* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(25045);
34065
34065
  /* harmony import */ var _swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(34918);
34066
34066
  /* harmony import */ var _swc_helpers_sliced_to_array__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(50684);
34067
- /* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(31635);
34068
- /* harmony import */ var _swc_helpers_wrap_native_super__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(38574);
34069
- /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(84839);
34070
- /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(23211);
34071
- /* harmony import */ var jodit_core_dom_lazy_walker__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(1080);
34072
- /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(28077);
34073
- /* harmony import */ var jodit_core_helpers_html_safe_html__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(48155);
34074
- /* harmony import */ var jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(18855);
34075
- /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(11173);
34076
- /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(54053);
34067
+ /* harmony import */ var _swc_helpers_to_consumable_array__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(42395);
34068
+ /* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(31635);
34069
+ /* harmony import */ var _swc_helpers_wrap_native_super__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(38574);
34070
+ /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(84839);
34071
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(23211);
34072
+ /* harmony import */ var jodit_core_dom_lazy_walker__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(1080);
34073
+ /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(28077);
34074
+ /* harmony import */ var jodit_core_helpers_html_safe_html__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(48155);
34075
+ /* harmony import */ var jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(18855);
34076
+ /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(11173);
34077
+ /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(54053);
34077
34078
  /*!
34078
34079
  * Jodit Editor (https://xdsoft.net/jodit/)
34079
34080
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -34098,9 +34099,11 @@ jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_10__.Icon.set('class-span', (_class_
34098
34099
 
34099
34100
 
34100
34101
 
34102
+
34101
34103
  /**
34102
34104
  * Clean HTML after removeFormat and insertHorizontalRule command
34103
- */ var cleanHtml = /*#__PURE__*/ function(Plugin) {
34105
+ */ var TRAILING_BR_BLOCKS = 'p, div, li, td, th, h1, h2, h3, h4, h5, h6, blockquote';
34106
+ var cleanHtml = /*#__PURE__*/ function(Plugin) {
34104
34107
  "use strict";
34105
34108
  (0,_swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__._)(cleanHtml, Plugin);
34106
34109
  function cleanHtml() {
@@ -34111,7 +34114,7 @@ jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_10__.Icon.set('class-span', (_class_
34111
34114
  name: 'eraser',
34112
34115
  group: 'font-style'
34113
34116
  }
34114
- ]), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "currentSelectionNode", null), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "walker", new jodit_core_dom_lazy_walker__WEBPACK_IMPORTED_MODULE_10__.LazyWalker(_this.j.async, {
34117
+ ]), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "currentSelectionNode", null), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "walker", new jodit_core_dom_lazy_walker__WEBPACK_IMPORTED_MODULE_11__.LazyWalker(_this.j.async, {
34115
34118
  timeout: _this.j.o.cleanHTML.timeout
34116
34119
  }));
34117
34120
  return _this;
@@ -34145,10 +34148,10 @@ jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_10__.Icon.set('class-span', (_class_
34145
34148
  value: function startWalker() {
34146
34149
  var _this = this;
34147
34150
  var jodit = this.jodit;
34148
- var allow = (0,_helpers__WEBPACK_IMPORTED_MODULE_15__.getHash)(this.j.o.cleanHTML.allowTags);
34149
- var deny = (0,_helpers__WEBPACK_IMPORTED_MODULE_15__.getHash)(this.j.o.cleanHTML.denyTags);
34151
+ var allow = (0,_helpers__WEBPACK_IMPORTED_MODULE_16__.getHash)(this.j.o.cleanHTML.allowTags);
34152
+ var deny = (0,_helpers__WEBPACK_IMPORTED_MODULE_16__.getHash)(this.j.o.cleanHTML.denyTags);
34150
34153
  this.walker.on('visit', function(node) {
34151
- return (0,_helpers__WEBPACK_IMPORTED_MODULE_15__.visitNodeWalker)(jodit, node, allow, deny, _this.currentSelectionNode);
34154
+ return (0,_helpers__WEBPACK_IMPORTED_MODULE_16__.visitNodeWalker)(jodit, node, allow, deny, _this.currentSelectionNode);
34152
34155
  }).on('end', function(affected) {
34153
34156
  _this.j.e.fire(affected ? 'internalChange finishedCleanHTMLWorker' : 'finishedCleanHTMLWorker');
34154
34157
  });
@@ -34159,9 +34162,9 @@ jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_10__.Icon.set('class-span', (_class_
34159
34162
  value: function beforeCommand(command) {
34160
34163
  if (command.toLowerCase() === 'removeformat') {
34161
34164
  if (this.j.s.isCollapsed()) {
34162
- (0,_helpers__WEBPACK_IMPORTED_MODULE_15__.removeFormatForCollapsedSelection)(this.j);
34165
+ (0,_helpers__WEBPACK_IMPORTED_MODULE_16__.removeFormatForCollapsedSelection)(this.j);
34163
34166
  } else {
34164
- (0,_helpers__WEBPACK_IMPORTED_MODULE_15__.removeFormatForSelection)(this.j);
34167
+ (0,_helpers__WEBPACK_IMPORTED_MODULE_16__.removeFormatForSelection)(this.j);
34165
34168
  }
34166
34169
  return false;
34167
34170
  }
@@ -34182,11 +34185,11 @@ jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_10__.Icon.set('class-span', (_class_
34182
34185
  sandBox.innerHTML = data.value;
34183
34186
  this.j.e.fire('safeHTML', sandBox);
34184
34187
  data.value = sandBox.innerHTML;
34185
- (0,jodit_core_helpers_html_safe_html__WEBPACK_IMPORTED_MODULE_12__.safeHTML)(sandBox, {
34188
+ (0,jodit_core_helpers_html_safe_html__WEBPACK_IMPORTED_MODULE_13__.safeHTML)(sandBox, {
34186
34189
  safeJavaScriptLink: true,
34187
34190
  removeOnError: true
34188
34191
  });
34189
- jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.safeRemove(iframe);
34192
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_10__.Dom.safeRemove(iframe);
34190
34193
  return false;
34191
34194
  }
34192
34195
  },
@@ -34198,6 +34201,7 @@ jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_10__.Icon.set('class-span', (_class_
34198
34201
  * opt-in via `cleanHTML.collapseEmptyValueToEmptyString`. See #1149
34199
34202
  */ function onAfterGetValueFromEditor(data) {
34200
34203
  this.__singleQuotesInFontFamily(data);
34204
+ this.__removeTrailingBr(data);
34201
34205
  if (!this.j.o.cleanHTML.collapseEmptyValueToEmptyString) {
34202
34206
  return;
34203
34207
  }
@@ -34207,7 +34211,7 @@ jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_10__.Icon.set('class-span', (_class_
34207
34211
  }
34208
34212
  },
34209
34213
  {
34210
- key: "__singleQuotesInFontFamily",
34214
+ key: "__removeTrailingBr",
34211
34215
  value: /**
34212
34216
  * Rewrite double-quoted font names inside `style` attributes with single
34213
34217
  * quotes. The DOM always serialises them as `&quot;…&quot;`, and back ends
@@ -34215,7 +34219,41 @@ jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_10__.Icon.set('class-span', (_class_
34215
34219
  * `style="font-family: "Open Sans", …"` — broken markup. Single quotes
34216
34220
  * survive that round trip. Names that already contain an apostrophe are
34217
34221
  * left alone.
34218
- */ function __singleQuotesInFontFamily(data) {
34222
+ */ /**
34223
+ * Drop a `<br>` that is the last node of a block (or of the value) and
34224
+ * follows other content — the caret placeholder browsers leave behind
34225
+ * after typing into an empty block. An empty block (`<p><br></p>`) and a
34226
+ * deliberate empty line (`text<br><br>`) are kept.
34227
+ */ function __removeTrailingBr(data) {
34228
+ if (!this.j.o.cleanHTML.removeTrailingBr || !/<br/i.test(data.value)) {
34229
+ return;
34230
+ }
34231
+ var box = this.j.c.div();
34232
+ box.innerHTML = data.value;
34233
+ var blocks = [
34234
+ box
34235
+ ].concat((0,_swc_helpers_to_consumable_array__WEBPACK_IMPORTED_MODULE_6__._)(box.querySelectorAll(TRAILING_BR_BLOCKS)));
34236
+ blocks.forEach(function(block) {
34237
+ var _prev_nodeValue;
34238
+ var last = block.lastChild;
34239
+ if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_10__.Dom.isTag(last, 'br')) {
34240
+ return;
34241
+ }
34242
+ var prev = last.previousSibling;
34243
+ if (!prev || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_10__.Dom.isTag(prev, 'br')) {
34244
+ return;
34245
+ }
34246
+ if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_10__.Dom.isText(prev) && !((_prev_nodeValue = prev.nodeValue) === null || _prev_nodeValue === void 0 ? void 0 : _prev_nodeValue.trim()) && !prev.previousSibling) {
34247
+ return;
34248
+ }
34249
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_10__.Dom.safeRemove(last);
34250
+ });
34251
+ data.value = box.innerHTML;
34252
+ }
34253
+ },
34254
+ {
34255
+ key: "__singleQuotesInFontFamily",
34256
+ value: function __singleQuotesInFontFamily(data) {
34219
34257
  if (!this.j.o.cleanHTML.singleQuotesInFontFamily || !data.value.includes('&quot;')) {
34220
34258
  return;
34221
34259
  }
@@ -34239,7 +34277,7 @@ jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_10__.Icon.set('class-span', (_class_
34239
34277
  if (sanitizer) {
34240
34278
  sandBox.innerHTML = sanitizer(sandBox.innerHTML);
34241
34279
  }
34242
- ;(0,jodit_core_helpers_html_safe_html__WEBPACK_IMPORTED_MODULE_12__.safeHTML)(sandBox, this.j.o.cleanHTML);
34280
+ ;(0,jodit_core_helpers_html_safe_html__WEBPACK_IMPORTED_MODULE_13__.safeHTML)(sandBox, this.j.o.cleanHTML);
34243
34281
  }
34244
34282
  },
34245
34283
  {
@@ -34250,9 +34288,9 @@ jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_10__.Icon.set('class-span', (_class_
34250
34288
  }
34251
34289
  ]);
34252
34290
  return cleanHtml;
34253
- }((0,_swc_helpers_wrap_native_super__WEBPACK_IMPORTED_MODULE_7__._)(jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_13__.Plugin));
34254
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
34255
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.watch)([
34291
+ }((0,_swc_helpers_wrap_native_super__WEBPACK_IMPORTED_MODULE_8__._)(jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_14__.Plugin));
34292
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
34293
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_9__.watch)([
34256
34294
  ':change',
34257
34295
  ':afterSetMode',
34258
34296
  ':afterInit',
@@ -34260,22 +34298,22 @@ jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_10__.Icon.set('class-span', (_class_
34260
34298
  ':keydown'
34261
34299
  ])
34262
34300
  ], cleanHtml.prototype, "onChangeCleanHTML", null);
34263
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
34264
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.hook)('ready')
34301
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
34302
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_9__.hook)('ready')
34265
34303
  ], cleanHtml.prototype, "startWalker", null);
34266
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
34267
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.watch)(':beforeCommand')
34304
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
34305
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_9__.watch)(':beforeCommand')
34268
34306
  ], cleanHtml.prototype, "beforeCommand", null);
34269
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
34270
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.watch)(':beforeSetNativeEditorValue')
34307
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
34308
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_9__.watch)(':beforeSetNativeEditorValue')
34271
34309
  ], cleanHtml.prototype, "onBeforeSetNativeEditorValue", null);
34272
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
34273
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.watch)(':afterGetValueFromEditor')
34310
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
34311
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_9__.watch)(':afterGetValueFromEditor')
34274
34312
  ], cleanHtml.prototype, "onAfterGetValueFromEditor", null);
34275
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
34276
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.watch)(':safeHTML')
34313
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
34314
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_9__.watch)(':safeHTML')
34277
34315
  ], cleanHtml.prototype, "onSafeHTML", null);
34278
- jodit_core_global__WEBPACK_IMPORTED_MODULE_11__.pluginSystem.add('cleanHtml', cleanHtml);
34316
+ jodit_core_global__WEBPACK_IMPORTED_MODULE_12__.pluginSystem.add('cleanHtml', cleanHtml);
34279
34317
 
34280
34318
 
34281
34319
  /***/ }),
@@ -34303,6 +34341,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.cleanHTML = {
34303
34341
  fillEmptyParagraph: true,
34304
34342
  collapseEmptyValueToEmptyString: false,
34305
34343
  singleQuotesInFontFamily: true,
34344
+ removeTrailingBr: false,
34306
34345
  replaceNBSP: true,
34307
34346
  replaceOldTags: {
34308
34347
  i: 'em',
@@ -36573,6 +36612,11 @@ var DragState = /*#__PURE__*/ (/* unused pure expression or super */ null && (fu
36573
36612
  this.state = 2;
36574
36613
  }
36575
36614
  this.j.e.fire('hidePopup hideResizer');
36615
+ // The ghost lives in the top document (position: fixed), but the
36616
+ // mousemove comes from the editor document. In iframe mode those are
36617
+ // different viewports, so the iframe's own offset has to be added or
36618
+ // the ghost trails the pointer by exactly that distance (#1455).
36619
+ var offset = this.__ghostOffset();
36576
36620
  if (!this.draggable.parentNode) {
36577
36621
  var _ref, _ref1;
36578
36622
  var target = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.dataBind)(this.draggable, 'target');
@@ -36583,20 +36627,39 @@ var DragState = /*#__PURE__*/ (/* unused pure expression or super */ null && (fu
36583
36627
  position: 'fixed',
36584
36628
  opacity: 0.7,
36585
36629
  display: 'inline-block',
36586
- left: event.clientX,
36587
- top: event.clientY,
36630
+ left: event.clientX + offset.left,
36631
+ top: event.clientY + offset.top,
36588
36632
  width: (_ref = target === null || target === void 0 ? void 0 : target.offsetWidth) !== null && _ref !== void 0 ? _ref : 100,
36589
36633
  height: (_ref1 = target === null || target === void 0 ? void 0 : target.offsetHeight) !== null && _ref1 !== void 0 ? _ref1 : 100
36590
36634
  });
36591
36635
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.append((0,jodit_core_global__WEBPACK_IMPORTED_MODULE_9__.getContainer)(this.j, dragAndDropElement), this.draggable);
36592
36636
  }
36593
36637
  ;(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.css)(this.draggable, {
36594
- left: event.clientX,
36595
- top: event.clientY
36638
+ left: event.clientX + offset.left,
36639
+ top: event.clientY + offset.top
36596
36640
  });
36641
+ // The caret goes into the editor document, so it keeps the raw
36642
+ // (iframe-relative) coordinates.
36597
36643
  this.j.s.insertCursorAtPoint(event.clientX, event.clientY);
36598
36644
  }
36599
36645
  },
36646
+ {
36647
+ key: "__ghostOffset",
36648
+ value: function __ghostOffset() {
36649
+ var iframe = this.j.iframe;
36650
+ if (!iframe) {
36651
+ return {
36652
+ left: 0,
36653
+ top: 0
36654
+ };
36655
+ }
36656
+ var rect = iframe.getBoundingClientRect();
36657
+ return {
36658
+ left: rect.left,
36659
+ top: rect.top
36660
+ };
36661
+ }
36662
+ },
36600
36663
  {
36601
36664
  key: "onDragEnd",
36602
36665
  value: /**
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.15.6
4
+ * Version: v4.15.7
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.15.6
11
+ * Version: v4.15.7
12
12
  * Url: https://xdsoft.net/jodit/
13
13
  * License(s): MIT
14
14
  */