@firestitch/block-editor 12.3.6 → 12.3.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.
@@ -1352,14 +1352,26 @@
1352
1352
  FsBlockComponent.prototype._initEvents = function () {
1353
1353
  var _this = this;
1354
1354
  rxjs.fromEvent(this.contentEditable.nativeElement, 'paste')
1355
- .pipe(operators.delay(100), operators.takeUntil(this._destroy$)).subscribe(function (event) {
1356
- _this.content = _this.block.content;
1357
- //this.block.content = event.target.innerText;
1355
+ .pipe(operators.takeUntil(this._destroy$)).subscribe(function (e) {
1356
+ e.preventDefault();
1357
+ var clipboardData = e.clipboardData;
1358
+ var text = clipboardData.getData('Text');
1359
+ ;
1360
+ var range = document.getSelection().getRangeAt(0);
1361
+ range.deleteContents();
1362
+ var textNode = document.createTextNode(text);
1363
+ range.insertNode(textNode);
1364
+ range.selectNodeContents(textNode);
1365
+ range.collapse(false);
1366
+ var selection = window.getSelection();
1367
+ selection.removeAllRanges();
1368
+ selection.addRange(range);
1369
+ _this.block.content = _this.contentEditable.nativeElement.innerHTML;
1358
1370
  _this._triggerChanged();
1359
1371
  });
1360
1372
  rxjs.fromEvent(this.contentEditable.nativeElement, 'input')
1361
1373
  .pipe(operators.takeUntil(this._destroy$)).subscribe(function (event) {
1362
- _this.block.content = event.target.innerText;
1374
+ _this.block.content = event.target.innerHTML;
1363
1375
  _this._triggerChanged();
1364
1376
  });
1365
1377
  rxjs.fromEvent(this.el, 'mousedown')