@firestitch/block-editor 12.3.5 → 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/app/components/block/block.component.d.ts +1 -0
- package/bundles/firestitch-block-editor.umd.js +21 -2
- package/bundles/firestitch-block-editor.umd.js.map +1 -1
- package/esm2015/app/components/block/block.component.js +22 -3
- package/fesm2015/firestitch-block-editor.js +21 -2
- package/fesm2015/firestitch-block-editor.js.map +1 -1
- package/package.json +1 -1
|
@@ -1131,6 +1131,7 @@
|
|
|
1131
1131
|
FsBlockComponent.prototype.ngOnInit = function () {
|
|
1132
1132
|
var _this = this;
|
|
1133
1133
|
this.unit = this._blockEditor.config.unit;
|
|
1134
|
+
this.content = this.block.content;
|
|
1134
1135
|
this.block.shadowOpacity = this.block.shadowOpacity || 100;
|
|
1135
1136
|
this._initFonts();
|
|
1136
1137
|
this._blockEditor.blockClippable$
|
|
@@ -1350,9 +1351,27 @@
|
|
|
1350
1351
|
};
|
|
1351
1352
|
FsBlockComponent.prototype._initEvents = function () {
|
|
1352
1353
|
var _this = this;
|
|
1354
|
+
rxjs.fromEvent(this.contentEditable.nativeElement, 'paste')
|
|
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;
|
|
1370
|
+
_this._triggerChanged();
|
|
1371
|
+
});
|
|
1353
1372
|
rxjs.fromEvent(this.contentEditable.nativeElement, 'input')
|
|
1354
1373
|
.pipe(operators.takeUntil(this._destroy$)).subscribe(function (event) {
|
|
1355
|
-
_this.block.content = event.target.
|
|
1374
|
+
_this.block.content = event.target.innerHTML;
|
|
1356
1375
|
_this._triggerChanged();
|
|
1357
1376
|
});
|
|
1358
1377
|
rxjs.fromEvent(this.el, 'mousedown')
|
|
@@ -1398,7 +1417,7 @@
|
|
|
1398
1417
|
return FsBlockComponent;
|
|
1399
1418
|
}());
|
|
1400
1419
|
FsBlockComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsBlockComponent, deps: [{ token: BlockEditorService }, { token: i0__namespace.ElementRef }, { token: i0__namespace.ChangeDetectorRef }, { token: GoogleFontService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1401
|
-
FsBlockComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsBlockComponent, selector: "fs-block", inputs: { block: "block", html: "html", zoompan: "zoompan" }, host: { properties: { "class.transforming": "this.transformating" } }, viewQueries: [{ propertyName: "element", first: true, predicate: ["element"], descendants: true, static: true }, { propertyName: "contentElement", first: true, predicate: ["contentElement"], descendants: true, static: true }, { propertyName: "contentEditable", first: true, predicate: ["contentEditable"], descendants: true, static: true }], ngImport: i0__namespace, template: "<div\n #element\n [class]=\"'block ' + 'block-' + block.type\"\n [style.top]=\"styleTop\"\n [style.left]=\"styleLeft\"\n [style.width]=\"styleWidth\"\n [style.height]=\"styleHeight\"\n [ngClass]=\"{ \n editable: editable, \n readonly: block.readonly,\n required: block.required\n }\"\n [style.zIndex]=\"block.index\">\n <div\n #contentElement\n class=\"content\"\n [style.borderColor]=\"block.borderColor\"\n [style.borderWidth]=\"block.borderWidth ? block.borderWidth + 'pt' : ''\"\n [style.borderStyle]=\"block.borderColor ? 'solid' : 'dashed'\"\n [style.textAlign]=\"block.horizontalAlign\"\n [style.fontStyle]=\"block.italic ? 'italic' : ''\"\n [style.fontFamily]=\"block.fontFamily || ''\"\n [style.fontSize]=\"block.fontSize ? block.fontSize + 'pt' : ''\"\n [style.lineHeight]=\"block.lineHeight ? block.lineHeight + 'pt' : ''\"\n [style.color]=\"block.fontColor\"\n [style.fontWeight]=\"block.bold ? 'bold' : ''\"\n [style.textDecoration]=\"block.underline ? 'underline' : ''\"\n [style.paddingTop]=\"block.paddingTop ? block.paddingTop + 'pt' : ''\"\n [style.paddingBottom]=\"block.paddingBottom ? block.paddingBottom + 'pt' : ''\"\n [style.paddingLeft]=\"block.paddingLeft ? block.paddingLeft + 'pt' : ''\"\n [style.paddingRight]=\"block.paddingRight ? block.paddingRight + 'pt' : ''\"\n [style.backgroundColor]=\"block.backgroundColor\"\n [style.borderBottomLeftRadius]=\"block.shapeRadius && block.shapeBottomLeft === 'round' ? block.shapeRadius + 'pt' : ''\"\n [style.borderBottomRightRadius]=\"block.shapeRadius && block.shapeBottomRight === 'round' ? block.shapeRadius + 'pt' : ''\"\n [style.borderTopRightRadius]=\"block.shapeRadius && block.shapeTopRight === 'round' ? block.shapeRadius + 'pt' : ''\"\n [style.borderTopLeftRadius]=\"block.shapeRadius && block.shapeTopLeft === 'round' ? block.shapeRadius + 'pt' : ''\"\n [style.boxShadow]=\"styleBoxShadow\"\n [ngClass]=\"{\n 'editable': editable,\n 'vertical-align-center': block.verticalAlign === 'center',\n 'vertical-align-bottom': block.verticalAlign === 'bottom'\n }\">\n <ng-container [ngSwitch]=\"block.type\">\n <ng-container *ngSwitchCase=\"BlockType.Pdf\">\n <img [src]=\"block.imageUrl\">\n </ng-container>\n <img \n *ngIf=\"block.imageUrl\" \n [style.clipPath]=\"styleClipPath\" \n [style.height]=\"styleImageHeight\" \n [style.width]=\"styleImageWidth\" \n [style.top]=\"styleImageTop\" \n [style.left]=\"styleImageLeft\" \n [src]=\"block.imageUrl\">\n </ng-container>\n <ng-container *ngIf=\"block.type === BlockType.LongText || block.type === BlockType.ShortText || block.type === BlockType.RadioButton || block.type === BlockType.Checkbox || block.type === BlockType.Date\">\n {{block.label || block.name}}\n </ng-container>\n <div\n #contentEditable\n [contentEditable]=\"editable\"\n class=\"content-editable\"\n [innerHTML]=\"
|
|
1420
|
+
FsBlockComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FsBlockComponent, selector: "fs-block", inputs: { block: "block", html: "html", zoompan: "zoompan" }, host: { properties: { "class.transforming": "this.transformating" } }, viewQueries: [{ propertyName: "element", first: true, predicate: ["element"], descendants: true, static: true }, { propertyName: "contentElement", first: true, predicate: ["contentElement"], descendants: true, static: true }, { propertyName: "contentEditable", first: true, predicate: ["contentEditable"], descendants: true, static: true }], ngImport: i0__namespace, template: "<div\n #element\n [class]=\"'block ' + 'block-' + block.type\"\n [style.top]=\"styleTop\"\n [style.left]=\"styleLeft\"\n [style.width]=\"styleWidth\"\n [style.height]=\"styleHeight\"\n [ngClass]=\"{ \n editable: editable, \n readonly: block.readonly,\n required: block.required\n }\"\n [style.zIndex]=\"block.index\">\n <div\n #contentElement\n class=\"content\"\n [style.borderColor]=\"block.borderColor\"\n [style.borderWidth]=\"block.borderWidth ? block.borderWidth + 'pt' : ''\"\n [style.borderStyle]=\"block.borderColor ? 'solid' : 'dashed'\"\n [style.textAlign]=\"block.horizontalAlign\"\n [style.fontStyle]=\"block.italic ? 'italic' : ''\"\n [style.fontFamily]=\"block.fontFamily || ''\"\n [style.fontSize]=\"block.fontSize ? block.fontSize + 'pt' : ''\"\n [style.lineHeight]=\"block.lineHeight ? block.lineHeight + 'pt' : ''\"\n [style.color]=\"block.fontColor\"\n [style.fontWeight]=\"block.bold ? 'bold' : ''\"\n [style.textDecoration]=\"block.underline ? 'underline' : ''\"\n [style.paddingTop]=\"block.paddingTop ? block.paddingTop + 'pt' : ''\"\n [style.paddingBottom]=\"block.paddingBottom ? block.paddingBottom + 'pt' : ''\"\n [style.paddingLeft]=\"block.paddingLeft ? block.paddingLeft + 'pt' : ''\"\n [style.paddingRight]=\"block.paddingRight ? block.paddingRight + 'pt' : ''\"\n [style.backgroundColor]=\"block.backgroundColor\"\n [style.borderBottomLeftRadius]=\"block.shapeRadius && block.shapeBottomLeft === 'round' ? block.shapeRadius + 'pt' : ''\"\n [style.borderBottomRightRadius]=\"block.shapeRadius && block.shapeBottomRight === 'round' ? block.shapeRadius + 'pt' : ''\"\n [style.borderTopRightRadius]=\"block.shapeRadius && block.shapeTopRight === 'round' ? block.shapeRadius + 'pt' : ''\"\n [style.borderTopLeftRadius]=\"block.shapeRadius && block.shapeTopLeft === 'round' ? block.shapeRadius + 'pt' : ''\"\n [style.boxShadow]=\"styleBoxShadow\"\n [ngClass]=\"{\n 'editable': editable,\n 'vertical-align-center': block.verticalAlign === 'center',\n 'vertical-align-bottom': block.verticalAlign === 'bottom'\n }\">\n <ng-container [ngSwitch]=\"block.type\">\n <ng-container *ngSwitchCase=\"BlockType.Pdf\">\n <img [src]=\"block.imageUrl\">\n </ng-container>\n <img \n *ngIf=\"block.imageUrl\" \n [style.clipPath]=\"styleClipPath\" \n [style.height]=\"styleImageHeight\" \n [style.width]=\"styleImageWidth\" \n [style.top]=\"styleImageTop\" \n [style.left]=\"styleImageLeft\" \n [src]=\"block.imageUrl\">\n </ng-container>\n <ng-container *ngIf=\"block.type === BlockType.LongText || block.type === BlockType.ShortText || block.type === BlockType.RadioButton || block.type === BlockType.Checkbox || block.type === BlockType.Date\">\n {{block.label || block.name}}\n </ng-container>\n <div\n #contentEditable\n [contentEditable]=\"editable\"\n class=\"content-editable\"\n [innerHTML]=\"content\">\n </div>\n </div>\n</div>\n", styles: [":host ::ng-deep .moveable-control{width:10px!important;height:10px!important;margin-top:-5px!important;margin-left:-5px!important}:host.transforming ::ng-deep .moveable-control,:host.transforming ::ng-deep .moveable-rotation{display:none}.block{position:absolute;display:block;outline:none;-webkit-user-select:none;user-select:none;cursor:pointer}.block.block-shorttext,.block.block-longtext,.block.block-date,.block.block-radiobutton,.block.block-signature,.block.block-checkbox{background-color:#aab5e1cc;color:#585555;font-size:12px}.block.block-radiobutton{border-radius:50%}.block.required{background-color:#f7adaa}.block .content-editable{outline:none;position:relative}.block.editable .content-editable{cursor:text}.block .content{flex-direction:column;height:100%;display:flex;border:0px solid transparent;position:relative;box-sizing:border-box;overflow:hidden}.block .content fs-html-editor{width:100%}.block .content.vertical-align-center{justify-content:center}.block .content.vertical-align-bottom{justify-content:flex-end}.block .content img{width:100%;height:100%;position:absolute}:host ::ng-deep fs-html-editor .bottom-line,:host ::ng-deep fs-html-editor .fr-toolbar{display:none!important}:host ::ng-deep fs-html-editor .fr-wrapper{background:none!important;border:none!important}:host ::ng-deep .moveable-line:not(.moveable-rotation-line):not(.moveable-guideline){background:transparent!important}\n"], directives: [{ type: i13__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i13__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i13__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i13__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
1402
1421
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0__namespace, type: FsBlockComponent, decorators: [{
|
|
1403
1422
|
type: i0.Component,
|
|
1404
1423
|
args: [{
|