@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.
- package/bundles/firestitch-block-editor.umd.js +16 -4
- package/bundles/firestitch-block-editor.umd.js.map +1 -1
- package/esm2015/app/components/block/block.component.js +18 -6
- package/fesm2015/firestitch-block-editor.js +16 -4
- package/fesm2015/firestitch-block-editor.js.map +1 -1
- package/package.json +1 -1
|
@@ -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.
|
|
1356
|
-
|
|
1357
|
-
|
|
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.
|
|
1374
|
+
_this.block.content = event.target.innerHTML;
|
|
1363
1375
|
_this._triggerChanged();
|
|
1364
1376
|
});
|
|
1365
1377
|
rxjs.fromEvent(this.el, 'mousedown')
|