@firestitch/block-editor 9.0.11 → 12.1.0
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/artboard/artboard.component.d.ts +35 -0
- package/app/components/block/block.component.d.ts +20 -38
- package/app/components/block-editor/block-editor.component.d.ts +10 -17
- package/app/components/sidebar/sidebar.component.d.ts +29 -12
- package/app/consts/block-types.const.d.ts +12 -0
- package/app/consts/index.d.ts +1 -0
- package/app/directives/block-editor-margin.directive.d.ts +3 -0
- package/app/directives/block-editor-sidebar-panel.directive.d.ts +3 -0
- package/app/enums/block-type.enum.d.ts +11 -0
- package/app/enums/index.d.ts +1 -0
- package/app/fs-block-editor.module.d.ts +22 -0
- package/app/interfaces/block-editor-config.d.ts +9 -7
- package/app/interfaces/block.d.ts +12 -1
- package/app/services/block-editor.service.d.ts +34 -14
- package/app/services/index.d.ts +1 -0
- package/bundles/firestitch-block-editor.umd.js +966 -838
- package/bundles/firestitch-block-editor.umd.js.map +1 -1
- package/esm2015/app/components/artboard/artboard.component.js +129 -0
- package/esm2015/app/components/block/block.component.js +162 -254
- package/esm2015/app/components/block-editor/block-editor.component.js +55 -131
- package/esm2015/app/components/sidebar/sidebar.component.js +128 -192
- package/esm2015/app/consts/block-types.const.js +13 -0
- package/esm2015/app/consts/index.js +2 -0
- package/esm2015/app/directives/block-editor-margin.directive.js +13 -15
- package/esm2015/app/directives/block-editor-sidebar-panel.directive.js +16 -22
- package/esm2015/app/enums/block-type.enum.js +13 -0
- package/esm2015/app/enums/index.js +2 -0
- package/esm2015/app/fs-block-editor.module.js +68 -27
- package/esm2015/app/interfaces/block-editor-config.js +2 -1
- package/esm2015/app/interfaces/block.js +2 -1
- package/esm2015/app/services/block-editor.service.js +140 -33
- package/esm2015/app/services/index.js +2 -0
- package/esm2015/firestitch-block-editor.js +1 -4
- package/esm2015/public_api.js +3 -4
- package/fesm2015/firestitch-block-editor.js +665 -626
- package/fesm2015/firestitch-block-editor.js.map +1 -1
- package/firestitch-block-editor.d.ts +1 -3
- package/package.json +6 -12
- package/public_api.d.ts +2 -0
- package/bundles/firestitch-block-editor.umd.min.js +0 -2
- package/bundles/firestitch-block-editor.umd.min.js.map +0 -1
- package/esm5/app/components/block/block.component.js +0 -498
- package/esm5/app/components/block-editor/block-editor.component.js +0 -163
- package/esm5/app/components/sidebar/sidebar.component.js +0 -329
- package/esm5/app/directives/block-editor-margin.directive.js +0 -26
- package/esm5/app/directives/block-editor-sidebar-panel.directive.js +0 -28
- package/esm5/app/fs-block-editor.module.js +0 -57
- package/esm5/app/interfaces/block-editor-config.js +0 -1
- package/esm5/app/interfaces/block.js +0 -1
- package/esm5/app/services/block-editor.service.js +0 -124
- package/esm5/firestitch-block-editor.js +0 -8
- package/esm5/public_api.js +0 -8
- package/fesm5/firestitch-block-editor.js +0 -1198
- package/fesm5/firestitch-block-editor.js.map +0 -1
- package/firestitch-block-editor.metadata.json +0 -1
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { AfterViewInit, ChangeDetectorRef, ElementRef, IterableDiffers, OnDestroy, OnInit, QueryList } from '@angular/core';
|
|
2
|
+
import { FsZoomPanComponent } from '@firestitch/zoom-pan';
|
|
3
|
+
import { BlockEditorConfig } from '../../interfaces/block-editor-config';
|
|
4
|
+
import { FsBlockComponent } from '../block/block.component';
|
|
5
|
+
import { BlockEditorService } from '../../services/block-editor.service';
|
|
6
|
+
import { Block } from '../../interfaces/block';
|
|
7
|
+
import { FsBlockEditorSidebarPanelDirective } from '../../directives/block-editor-sidebar-panel.directive';
|
|
8
|
+
import { FsBlockEditorMarginDirective } from '../../directives/block-editor-margin.directive';
|
|
9
|
+
import { SidebarComponent } from '../sidebar/sidebar.component';
|
|
10
|
+
import * as i0 from "@angular/core";
|
|
11
|
+
export declare class ArtboardComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
12
|
+
private _el;
|
|
13
|
+
private _blockEditor;
|
|
14
|
+
private _cdRef;
|
|
15
|
+
private _differs;
|
|
16
|
+
sidebarPanels: QueryList<FsBlockEditorSidebarPanelDirective>;
|
|
17
|
+
blockComponents: QueryList<FsBlockComponent>;
|
|
18
|
+
artboard: ElementRef;
|
|
19
|
+
marginContainer: ElementRef;
|
|
20
|
+
margins: QueryList<FsBlockEditorMarginDirective>;
|
|
21
|
+
sidebar: SidebarComponent;
|
|
22
|
+
config: BlockEditorConfig;
|
|
23
|
+
zoompan: FsZoomPanComponent;
|
|
24
|
+
blocks: Block[];
|
|
25
|
+
private _differ;
|
|
26
|
+
private _destroy$;
|
|
27
|
+
constructor(_el: ElementRef, _blockEditor: BlockEditorService, _cdRef: ChangeDetectorRef, _differs: IterableDiffers);
|
|
28
|
+
get el(): any;
|
|
29
|
+
ngOnInit(): void;
|
|
30
|
+
blockChanged(block: Block<any>): void;
|
|
31
|
+
ngAfterViewInit(): void;
|
|
32
|
+
ngOnDestroy(): void;
|
|
33
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ArtboardComponent, never>;
|
|
34
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ArtboardComponent, "app-artboard", never, { "config": "config"; "zoompan": "zoompan"; }, {}, ["sidebarPanels"], never>;
|
|
35
|
+
}
|
|
@@ -1,68 +1,46 @@
|
|
|
1
|
-
import { AfterContentInit, ChangeDetectorRef, ElementRef,
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
1
|
+
import { AfterContentInit, ChangeDetectorRef, ElementRef, OnDestroy, OnInit } from '@angular/core';
|
|
2
|
+
import { FsZoomPanComponent } from '@firestitch/zoom-pan';
|
|
3
|
+
import Moveable from 'moveable';
|
|
4
|
+
import { BlockEditorService } from './../../services';
|
|
4
5
|
import { Block } from './../../interfaces/block';
|
|
6
|
+
import { BlockType } from '../../enums';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
5
8
|
export declare class FsBlockComponent implements OnDestroy, AfterContentInit, OnInit {
|
|
6
|
-
private
|
|
9
|
+
private _blockEditor;
|
|
7
10
|
private _elementRef;
|
|
8
11
|
private _cdRef;
|
|
9
12
|
element: ElementRef;
|
|
10
13
|
contentElement: ElementRef;
|
|
11
14
|
contentEditable: ElementRef;
|
|
12
|
-
|
|
13
|
-
block: Block<any>;
|
|
15
|
+
block: Block;
|
|
14
16
|
html: string;
|
|
15
|
-
|
|
16
|
-
matrix: any;
|
|
17
|
+
zoompan: FsZoomPanComponent;
|
|
17
18
|
unit: any;
|
|
18
19
|
content: string;
|
|
19
|
-
|
|
20
|
-
htmlConfig: FsHtmlEditorConfig;
|
|
20
|
+
BlockType: typeof BlockType;
|
|
21
21
|
private _moveable;
|
|
22
22
|
private _editable;
|
|
23
|
-
private _selectedElements;
|
|
24
|
-
private _rotateStart;
|
|
25
23
|
private _transformable;
|
|
24
|
+
private _rotateStart;
|
|
26
25
|
private _destroy$;
|
|
27
|
-
constructor(
|
|
26
|
+
constructor(_blockEditor: BlockEditorService, _elementRef: ElementRef, _cdRef: ChangeDetectorRef);
|
|
28
27
|
get el(): any;
|
|
29
|
-
get moveable():
|
|
28
|
+
get moveable(): Moveable;
|
|
30
29
|
get editable(): any;
|
|
31
30
|
set elementGuidelines(value: any);
|
|
32
31
|
set editable(value: any);
|
|
33
32
|
set clippable(value: any);
|
|
34
|
-
get transformable():
|
|
35
|
-
set transformable(value:
|
|
36
|
-
set lineHeight(value: any);
|
|
37
|
-
set borderWidth(value: any);
|
|
38
|
-
set fontSize(value: any);
|
|
39
|
-
set backgroundColor(value: any);
|
|
33
|
+
get transformable(): boolean;
|
|
34
|
+
set transformable(value: boolean);
|
|
40
35
|
set width(value: any);
|
|
41
36
|
set height(value: any);
|
|
42
37
|
set top(value: any);
|
|
43
38
|
set left(value: any);
|
|
44
39
|
set rotate(value: any);
|
|
45
|
-
set shapeRadius(value: any);
|
|
46
40
|
set index(value: any);
|
|
47
|
-
set
|
|
48
|
-
set paddingAll(value: any);
|
|
49
|
-
padding(name: any, value: any): void;
|
|
50
|
-
set imageUrl(value: any);
|
|
51
|
-
set fontColor(value: any);
|
|
52
|
-
set verticalAlign(value: any);
|
|
53
|
-
shapeRound(name: any, value: any): void;
|
|
54
|
-
set horizontalAlign(value: any);
|
|
55
|
-
set italic(value: any);
|
|
56
|
-
get italic(): any;
|
|
57
|
-
set bold(value: any);
|
|
58
|
-
get bold(): any;
|
|
59
|
-
set underline(value: any);
|
|
60
|
-
get underline(): any;
|
|
61
|
-
updateRect(): void;
|
|
41
|
+
set keepRatio(value: any);
|
|
62
42
|
markForCheck(): void;
|
|
63
43
|
ngOnInit(): void;
|
|
64
|
-
saveSelectedElements(): void;
|
|
65
|
-
clearSelectedElements(): void;
|
|
66
44
|
ngAfterContentInit(): void;
|
|
67
45
|
pxToIn(px: any): number;
|
|
68
46
|
round(value: any, decimals: any): number;
|
|
@@ -72,4 +50,8 @@ export declare class FsBlockComponent implements OnDestroy, AfterContentInit, On
|
|
|
72
50
|
ngOnDestroy(): void;
|
|
73
51
|
private _setTransform;
|
|
74
52
|
private _triggerChanged;
|
|
53
|
+
private _initMoveable;
|
|
54
|
+
private _initEvents;
|
|
55
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FsBlockComponent, never>;
|
|
56
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FsBlockComponent, "fs-block", never, { "block": "block"; "html": "html"; "zoompan": "zoompan"; }, {}, never, never>;
|
|
75
57
|
}
|
|
@@ -1,34 +1,27 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ElementRef, OnDestroy, OnInit, QueryList } from '@angular/core';
|
|
2
|
+
import { FsZoomPanComponent } from '@firestitch/zoom-pan';
|
|
2
3
|
import { BlockEditorConfig } from './../../interfaces/block-editor-config';
|
|
3
|
-
import { FsBlockComponent } from './../block/block.component';
|
|
4
4
|
import { BlockEditorService } from './../../services/block-editor.service';
|
|
5
5
|
import { Block } from './../../interfaces/block';
|
|
6
6
|
import { FsBlockEditorSidebarPanelDirective } from './../../directives/block-editor-sidebar-panel.directive';
|
|
7
|
-
import { FsBlockEditorMarginDirective } from './../../directives/block-editor-margin.directive';
|
|
8
7
|
import { SidebarComponent } from './../sidebar/sidebar.component';
|
|
9
|
-
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
export declare class FsBlockEditorComponent implements OnInit, OnDestroy {
|
|
10
10
|
private _el;
|
|
11
|
-
private
|
|
12
|
-
private _cdRef;
|
|
13
|
-
private _differs;
|
|
11
|
+
private _blockEditor;
|
|
14
12
|
sidebarPanels: QueryList<FsBlockEditorSidebarPanelDirective>;
|
|
15
|
-
|
|
16
|
-
artboard: ElementRef;
|
|
17
|
-
marginContainer: ElementRef;
|
|
18
|
-
margins: QueryList<FsBlockEditorMarginDirective>;
|
|
13
|
+
zoompan: FsZoomPanComponent;
|
|
19
14
|
artboardContainer: ElementRef;
|
|
20
15
|
sidebar: SidebarComponent;
|
|
16
|
+
artboard: ElementRef;
|
|
21
17
|
config: BlockEditorConfig;
|
|
22
|
-
blockAdded: EventEmitter<FsBlockComponent>;
|
|
23
|
-
blockRemoved: EventEmitter<FsBlockComponent>;
|
|
24
18
|
blocks: Block<any>[];
|
|
25
|
-
private _differ;
|
|
26
19
|
private _destroy$;
|
|
27
|
-
constructor(_el: ElementRef,
|
|
20
|
+
constructor(_el: ElementRef, _blockEditor: BlockEditorService);
|
|
28
21
|
get el(): any;
|
|
29
22
|
ngOnInit(): void;
|
|
30
23
|
artboardClick(event: any): void;
|
|
31
|
-
blockChanged(block: Block<any>): void;
|
|
32
|
-
ngAfterViewInit(): void;
|
|
33
24
|
ngOnDestroy(): void;
|
|
25
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FsBlockEditorComponent, never>;
|
|
26
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FsBlockEditorComponent, "fs-block-editor", never, { "config": "config"; }, {}, ["sidebarPanels"], never>;
|
|
34
27
|
}
|
|
@@ -1,23 +1,37 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ChangeDetectorRef, ElementRef, EventEmitter, OnDestroy, OnInit, QueryList } from '@angular/core';
|
|
1
|
+
import { ChangeDetectorRef, ElementRef, OnDestroy, OnInit, QueryList } from '@angular/core';
|
|
3
2
|
import { FsFile } from '@firestitch/file';
|
|
3
|
+
import { FsPrompt } from '@firestitch/prompt';
|
|
4
4
|
import { BlockEditorConfig } from '../../interfaces/block-editor-config';
|
|
5
5
|
import { BlockEditorService } from '../../services/block-editor.service';
|
|
6
6
|
import { Block } from '../../interfaces/block';
|
|
7
7
|
import { FsBlockEditorSidebarPanelDirective } from '../../directives/block-editor-sidebar-panel.directive';
|
|
8
|
+
import { BlockType } from '../../enums';
|
|
9
|
+
import * as i0 from "@angular/core";
|
|
8
10
|
export declare class SidebarComponent implements OnInit, OnDestroy {
|
|
9
11
|
private _el;
|
|
10
|
-
private
|
|
12
|
+
private _blockEditor;
|
|
11
13
|
private _cdRef;
|
|
14
|
+
private _prompt;
|
|
12
15
|
sidebarPanels: QueryList<FsBlockEditorSidebarPanelDirective>;
|
|
13
16
|
config: BlockEditorConfig;
|
|
14
17
|
blocks: any;
|
|
15
|
-
|
|
16
|
-
|
|
18
|
+
block: Block;
|
|
19
|
+
BlockTypes: ({
|
|
20
|
+
value: BlockType;
|
|
21
|
+
name: string;
|
|
22
|
+
icon: string;
|
|
23
|
+
accept?: undefined;
|
|
24
|
+
} | {
|
|
25
|
+
value: BlockType;
|
|
26
|
+
name: string;
|
|
27
|
+
icon: string;
|
|
28
|
+
accept: string;
|
|
29
|
+
})[];
|
|
30
|
+
blockTypeNames: {};
|
|
17
31
|
clippable: any;
|
|
32
|
+
BlockType: typeof BlockType;
|
|
18
33
|
private _destroy$;
|
|
19
|
-
constructor(_el: ElementRef,
|
|
20
|
-
get changeDetector(): ChangeDetectorRef;
|
|
34
|
+
constructor(_el: ElementRef, _blockEditor: BlockEditorService, _cdRef: ChangeDetectorRef, _prompt: FsPrompt);
|
|
21
35
|
get el(): any;
|
|
22
36
|
ngOnInit(): void;
|
|
23
37
|
verticalAlignClick(value: any): void;
|
|
@@ -37,16 +51,17 @@ export declare class SidebarComponent implements OnInit, OnDestroy {
|
|
|
37
51
|
paddingChange(name: any, value: any): void;
|
|
38
52
|
paddingAllChange(value: any): void;
|
|
39
53
|
borderColorChange(value: any): void;
|
|
54
|
+
toggleKeepRatio(): void;
|
|
40
55
|
horizontalAlignClick(value: any): void;
|
|
41
|
-
shapeRound(
|
|
56
|
+
shapeRound(name: any): void;
|
|
42
57
|
imageRemove(): void;
|
|
43
58
|
imageClip(): void;
|
|
44
59
|
shapeRadiusChange(value: any): void;
|
|
45
|
-
|
|
60
|
+
blockChangeProperty(value: any, name: any): void;
|
|
61
|
+
imageSelect(fsFile: FsFile): void;
|
|
46
62
|
blockRemoveClick(): void;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
private _updateIndexes;
|
|
63
|
+
blockUpload(blockType: any, fsFile: FsFile): void;
|
|
64
|
+
blockAdd(type: BlockType): void;
|
|
50
65
|
layerMove(direction: any): void;
|
|
51
66
|
layerUp(): void;
|
|
52
67
|
layerDown(): void;
|
|
@@ -55,4 +70,6 @@ export declare class SidebarComponent implements OnInit, OnDestroy {
|
|
|
55
70
|
inputFocus(event: any): void;
|
|
56
71
|
ngOnDestroy(): void;
|
|
57
72
|
validNumeric(value: any): boolean;
|
|
73
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SidebarComponent, never>;
|
|
74
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SidebarComponent, "sidebar", never, { "config": "config"; "blocks": "blocks"; }, {}, ["sidebarPanels"], never>;
|
|
58
75
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './block-types.const';
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { ElementRef } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
2
3
|
export declare class FsBlockEditorMarginDirective {
|
|
3
4
|
private _elementRef;
|
|
4
5
|
constructor(_elementRef: ElementRef);
|
|
5
6
|
get element(): any;
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FsBlockEditorMarginDirective, never>;
|
|
8
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<FsBlockEditorMarginDirective, "[fsBlockEditorMargin]", never, {}, {}, never>;
|
|
6
9
|
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { TemplateRef } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
2
3
|
export declare class FsBlockEditorSidebarPanelDirective {
|
|
3
4
|
templateRef: TemplateRef<any>;
|
|
4
5
|
label: string;
|
|
5
6
|
show: boolean;
|
|
6
7
|
constructor(templateRef: TemplateRef<any>);
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FsBlockEditorSidebarPanelDirective, never>;
|
|
9
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<FsBlockEditorSidebarPanelDirective, "[fsBlockEditorSidebarPanel]", never, { "label": "label"; "show": "show"; }, {}, never>;
|
|
7
10
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './block-type.enum';
|
|
@@ -1,4 +1,26 @@
|
|
|
1
1
|
import { ModuleWithProviders } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import * as i1 from "./components/block/block.component";
|
|
4
|
+
import * as i2 from "./components/block-editor/block-editor.component";
|
|
5
|
+
import * as i3 from "./directives/block-editor-sidebar-panel.directive";
|
|
6
|
+
import * as i4 from "./directives/block-editor-margin.directive";
|
|
7
|
+
import * as i5 from "./components/sidebar/sidebar.component";
|
|
8
|
+
import * as i6 from "./components/artboard/artboard.component";
|
|
9
|
+
import * as i7 from "@angular/common";
|
|
10
|
+
import * as i8 from "@angular/forms";
|
|
11
|
+
import * as i9 from "@angular/material/icon";
|
|
12
|
+
import * as i10 from "@angular/material/button";
|
|
13
|
+
import * as i11 from "@angular/material/input";
|
|
14
|
+
import * as i12 from "@angular/material/form-field";
|
|
15
|
+
import * as i13 from "@angular/material/checkbox";
|
|
16
|
+
import * as i14 from "@angular/material/tooltip";
|
|
17
|
+
import * as i15 from "@firestitch/file";
|
|
18
|
+
import * as i16 from "@firestitch/colorpicker";
|
|
19
|
+
import * as i17 from "@firestitch/menu";
|
|
20
|
+
import * as i18 from "@firestitch/zoom-pan";
|
|
2
21
|
export declare class FsBlockEditorModule {
|
|
3
22
|
static forRoot(): ModuleWithProviders<FsBlockEditorModule>;
|
|
23
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FsBlockEditorModule, never>;
|
|
24
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<FsBlockEditorModule, [typeof i1.FsBlockComponent, typeof i2.FsBlockEditorComponent, typeof i3.FsBlockEditorSidebarPanelDirective, typeof i4.FsBlockEditorMarginDirective, typeof i5.SidebarComponent, typeof i6.ArtboardComponent], [typeof i7.CommonModule, typeof i8.FormsModule, typeof i9.MatIconModule, typeof i10.MatButtonModule, typeof i11.MatInputModule, typeof i12.MatFormFieldModule, typeof i13.MatCheckboxModule, typeof i14.MatTooltipModule, typeof i15.FsFileModule, typeof i16.FsColorPickerModule, typeof i17.FsMenuModule, typeof i18.FsZoomPanModule], [typeof i1.FsBlockComponent, typeof i2.FsBlockEditorComponent, typeof i3.FsBlockEditorSidebarPanelDirective]>;
|
|
25
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<FsBlockEditorModule>;
|
|
4
26
|
}
|
|
@@ -8,11 +8,13 @@ export interface BlockEditorConfig {
|
|
|
8
8
|
marginRight?: number;
|
|
9
9
|
marginBottom?: number;
|
|
10
10
|
marginLeft?: number;
|
|
11
|
-
blocks?: Block
|
|
12
|
-
blockChanged?: (block: Block
|
|
13
|
-
blockAdded?: (block: Block
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
blocks?: Block[];
|
|
12
|
+
blockChanged?: (block: Block) => void;
|
|
13
|
+
blockAdded?: (block: Block) => void;
|
|
14
|
+
blockAdd?: (block: Block) => Observable<Block>;
|
|
15
|
+
blockUpload?: (block: Block, file: Blob) => Observable<Block>;
|
|
16
|
+
blocksRemove?: (block: Block[]) => Observable<Block>;
|
|
17
|
+
blocksLevelChanged?: (blocks: Block[]) => void;
|
|
18
|
+
blocksSelected?: (blocks: Block[]) => void;
|
|
19
|
+
imageUpload?: (file: Blob) => Observable<string>;
|
|
18
20
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { BlockType } from '../enums';
|
|
1
2
|
import { FsBlockComponent } from './../components/block/block.component';
|
|
2
|
-
export declare type Block<T =
|
|
3
|
+
export declare type Block<T = any> = BlockBase & T;
|
|
3
4
|
export interface BlockBase {
|
|
4
5
|
reference: any;
|
|
5
6
|
width?: number;
|
|
@@ -16,6 +17,7 @@ export interface BlockBase {
|
|
|
16
17
|
bold?: boolean;
|
|
17
18
|
italic?: boolean;
|
|
18
19
|
underline?: boolean;
|
|
20
|
+
keepRatio?: boolean;
|
|
19
21
|
backgroundColor?: string;
|
|
20
22
|
shapeRadius?: number;
|
|
21
23
|
lineHeight?: number;
|
|
@@ -34,4 +36,13 @@ export interface BlockBase {
|
|
|
34
36
|
imageUrl?: string;
|
|
35
37
|
clipPath?: string;
|
|
36
38
|
readonly?: boolean;
|
|
39
|
+
name?: string;
|
|
40
|
+
format?: string;
|
|
41
|
+
required?: boolean;
|
|
42
|
+
label?: string;
|
|
43
|
+
description?: string;
|
|
44
|
+
default?: string;
|
|
45
|
+
groupLabel?: string;
|
|
46
|
+
groupDescription?: string;
|
|
47
|
+
type?: BlockType;
|
|
37
48
|
}
|
|
@@ -1,33 +1,53 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OnDestroy } from '@angular/core';
|
|
2
|
+
import { Observable, Subject } from 'rxjs';
|
|
2
3
|
import { Block } from './../interfaces/block';
|
|
3
4
|
import { FsBlockComponent } from '../components/block/block.component';
|
|
4
5
|
import { BlockEditorConfig } from '../interfaces/block-editor-config';
|
|
5
|
-
|
|
6
|
+
import { FsFile } from '@firestitch/file';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
export declare class BlockEditorService implements OnDestroy {
|
|
6
9
|
container: any;
|
|
7
10
|
margin: any;
|
|
8
|
-
blockComponents: FsBlockComponent[];
|
|
9
11
|
config: BlockEditorConfig;
|
|
12
|
+
private _blockChanged$;
|
|
13
|
+
private _blockRemoved$;
|
|
14
|
+
private _blockAdded$;
|
|
10
15
|
private _blocks$;
|
|
16
|
+
private _selectedBlocks$;
|
|
11
17
|
private _selectionRange;
|
|
12
|
-
private
|
|
13
|
-
|
|
18
|
+
private _blockComponents;
|
|
19
|
+
private _destroy$;
|
|
14
20
|
get elementGuidelines(): any[];
|
|
15
|
-
|
|
21
|
+
get blockComponents(): FsBlockComponent[];
|
|
22
|
+
get selectedComponentBlocks(): FsBlockComponent[];
|
|
23
|
+
blockUpload(block: Block, fsFile: FsFile): void;
|
|
24
|
+
blockAdd(block: Block<any>): void;
|
|
16
25
|
removeBlock(block: Block<any>): void;
|
|
17
|
-
|
|
18
|
-
get blocks():
|
|
19
|
-
|
|
20
|
-
|
|
26
|
+
removeSelectedBlocks(): void;
|
|
27
|
+
get blocks$(): Observable<Block[]>;
|
|
28
|
+
get blockChanged$(): Subject<any>;
|
|
29
|
+
get blockRemoved$(): Subject<any>;
|
|
30
|
+
get blockAdded$(): Subject<any>;
|
|
31
|
+
blockChange(block: any): void;
|
|
32
|
+
get blocks(): Block[];
|
|
33
|
+
set blocks(blocks: Block[]);
|
|
34
|
+
isSelectedBlock(block: Block): boolean;
|
|
21
35
|
indexOf(block: any): number;
|
|
22
|
-
|
|
23
|
-
get
|
|
36
|
+
selectedBlockComponentChangeProperty(value: any, name: any): void;
|
|
37
|
+
get selectedBlocks$(): Observable<Block<any>[]>;
|
|
38
|
+
set selectedBlock(block: Block<any>);
|
|
39
|
+
set selectedBlocks(blocks: Block<any>[]);
|
|
24
40
|
get selectedBlocks(): Block<any>[];
|
|
25
|
-
get selectedBlockComponents$(): BehaviorSubject<FsBlockComponent[]>;
|
|
26
41
|
saveSelection(): void;
|
|
27
42
|
restoreSelection(): void;
|
|
28
43
|
hasSelectionRange(): boolean;
|
|
29
|
-
registerBlock(block: FsBlockComponent): void;
|
|
44
|
+
registerBlock(block: Block, blockComponent: FsBlockComponent): void;
|
|
45
|
+
unregisterBlock(block: Block): void;
|
|
30
46
|
registerContainer(container: any): void;
|
|
31
47
|
registerMargin(margin: any): void;
|
|
48
|
+
sanitizeNewBlock(block: any): any;
|
|
32
49
|
sanitizeBlock(block: any): any;
|
|
50
|
+
ngOnDestroy(): void;
|
|
51
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BlockEditorService, never>;
|
|
52
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<BlockEditorService>;
|
|
33
53
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './block-editor.service';
|