@firestitch/block-editor 9.0.11 → 12.0.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/block/block.component.d.ts +78 -75
- package/app/components/block-editor/block-editor.component.d.ts +37 -34
- package/app/components/sidebar/sidebar.component.d.ts +61 -58
- package/app/directives/block-editor-margin.directive.d.ts +9 -6
- package/app/directives/block-editor-sidebar-panel.directive.d.ts +10 -7
- package/app/fs-block-editor.module.d.ts +22 -4
- package/app/interfaces/block-editor-config.d.ts +18 -18
- package/app/interfaces/block.d.ts +37 -37
- package/app/services/block-editor.service.d.ts +36 -33
- package/bundles/firestitch-block-editor.umd.js +1491 -1377
- package/bundles/firestitch-block-editor.umd.js.map +1 -1
- package/esm2015/app/components/block/block.component.js +370 -384
- package/esm2015/app/components/block-editor/block-editor.component.js +141 -156
- package/esm2015/app/components/sidebar/sidebar.component.js +299 -303
- package/esm2015/app/directives/block-editor-margin.directive.js +19 -21
- package/esm2015/app/directives/block-editor-sidebar-panel.directive.js +21 -27
- package/esm2015/app/fs-block-editor.module.js +79 -53
- 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 +99 -99
- package/esm2015/firestitch-block-editor.js +5 -8
- package/esm2015/public_api.js +8 -8
- package/fesm2015/firestitch-block-editor.js +975 -990
- package/fesm2015/firestitch-block-editor.js.map +1 -1
- package/firestitch-block-editor.d.ts +5 -7
- package/package.json +7 -10
- package/public_api.d.ts +6 -6
- 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
|
@@ -1,75 +1,78 @@
|
|
|
1
|
-
import { AfterContentInit, ChangeDetectorRef, ElementRef, EventEmitter, OnDestroy, OnInit } from '@angular/core';
|
|
2
|
-
import { FsHtmlEditorComponent, FsHtmlEditorConfig } from '@firestitch/html-editor';
|
|
3
|
-
import { BlockEditorService } from './../../services/block-editor.service';
|
|
4
|
-
import { Block } from './../../interfaces/block';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
private
|
|
8
|
-
private
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
private
|
|
23
|
-
private
|
|
24
|
-
private
|
|
25
|
-
private
|
|
26
|
-
private
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
get
|
|
30
|
-
get
|
|
31
|
-
|
|
32
|
-
set
|
|
33
|
-
set
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
set
|
|
37
|
-
set
|
|
38
|
-
set
|
|
39
|
-
set
|
|
40
|
-
set
|
|
41
|
-
set
|
|
42
|
-
set
|
|
43
|
-
set
|
|
44
|
-
set
|
|
45
|
-
set
|
|
46
|
-
set
|
|
47
|
-
set
|
|
48
|
-
set
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
set
|
|
52
|
-
set
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
set
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
private
|
|
75
|
-
|
|
1
|
+
import { AfterContentInit, ChangeDetectorRef, ElementRef, EventEmitter, OnDestroy, OnInit } from '@angular/core';
|
|
2
|
+
import { FsHtmlEditorComponent, FsHtmlEditorConfig } from '@firestitch/html-editor';
|
|
3
|
+
import { BlockEditorService } from './../../services/block-editor.service';
|
|
4
|
+
import { Block } from './../../interfaces/block';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class FsBlockComponent implements OnDestroy, AfterContentInit, OnInit {
|
|
7
|
+
private _service;
|
|
8
|
+
private _elementRef;
|
|
9
|
+
private _cdRef;
|
|
10
|
+
element: ElementRef;
|
|
11
|
+
contentElement: ElementRef;
|
|
12
|
+
contentEditable: ElementRef;
|
|
13
|
+
htmlEditor: FsHtmlEditorComponent;
|
|
14
|
+
block: Block<any>;
|
|
15
|
+
html: string;
|
|
16
|
+
changed: EventEmitter<any>;
|
|
17
|
+
matrix: any;
|
|
18
|
+
unit: any;
|
|
19
|
+
content: string;
|
|
20
|
+
justifyContent: any;
|
|
21
|
+
htmlConfig: FsHtmlEditorConfig;
|
|
22
|
+
private _moveable;
|
|
23
|
+
private _editable;
|
|
24
|
+
private _selectedElements;
|
|
25
|
+
private _rotateStart;
|
|
26
|
+
private _transformable;
|
|
27
|
+
private _destroy$;
|
|
28
|
+
constructor(_service: BlockEditorService, _elementRef: ElementRef, _cdRef: ChangeDetectorRef);
|
|
29
|
+
get el(): any;
|
|
30
|
+
get moveable(): any;
|
|
31
|
+
get editable(): any;
|
|
32
|
+
set elementGuidelines(value: any);
|
|
33
|
+
set editable(value: any);
|
|
34
|
+
set clippable(value: any);
|
|
35
|
+
get transformable(): any;
|
|
36
|
+
set transformable(value: any);
|
|
37
|
+
set lineHeight(value: any);
|
|
38
|
+
set borderWidth(value: any);
|
|
39
|
+
set fontSize(value: any);
|
|
40
|
+
set backgroundColor(value: any);
|
|
41
|
+
set width(value: any);
|
|
42
|
+
set height(value: any);
|
|
43
|
+
set top(value: any);
|
|
44
|
+
set left(value: any);
|
|
45
|
+
set rotate(value: any);
|
|
46
|
+
set shapeRadius(value: any);
|
|
47
|
+
set index(value: any);
|
|
48
|
+
set borderColor(value: any);
|
|
49
|
+
set paddingAll(value: any);
|
|
50
|
+
padding(name: any, value: any): void;
|
|
51
|
+
set imageUrl(value: any);
|
|
52
|
+
set fontColor(value: any);
|
|
53
|
+
set verticalAlign(value: any);
|
|
54
|
+
shapeRound(name: any, value: any): void;
|
|
55
|
+
set horizontalAlign(value: any);
|
|
56
|
+
set italic(value: any);
|
|
57
|
+
get italic(): any;
|
|
58
|
+
set bold(value: any);
|
|
59
|
+
get bold(): any;
|
|
60
|
+
set underline(value: any);
|
|
61
|
+
get underline(): any;
|
|
62
|
+
updateRect(): void;
|
|
63
|
+
markForCheck(): void;
|
|
64
|
+
ngOnInit(): void;
|
|
65
|
+
saveSelectedElements(): void;
|
|
66
|
+
clearSelectedElements(): void;
|
|
67
|
+
ngAfterContentInit(): void;
|
|
68
|
+
pxToIn(px: any): number;
|
|
69
|
+
round(value: any, decimals: any): number;
|
|
70
|
+
deselect(): void;
|
|
71
|
+
deselectContent(): void;
|
|
72
|
+
selectAll(): void;
|
|
73
|
+
ngOnDestroy(): void;
|
|
74
|
+
private _setTransform;
|
|
75
|
+
private _triggerChanged;
|
|
76
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FsBlockComponent, never>;
|
|
77
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FsBlockComponent, "fs-block", never, { "block": "block"; "html": "html"; }, { "changed": "changed"; }, never, never>;
|
|
78
|
+
}
|
|
@@ -1,34 +1,37 @@
|
|
|
1
|
-
import { AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, IterableDiffers, OnDestroy, OnInit, QueryList } from '@angular/core';
|
|
2
|
-
import { BlockEditorConfig } from './../../interfaces/block-editor-config';
|
|
3
|
-
import { FsBlockComponent } from './../block/block.component';
|
|
4
|
-
import { BlockEditorService } from './../../services/block-editor.service';
|
|
5
|
-
import { Block } from './../../interfaces/block';
|
|
6
|
-
import { FsBlockEditorSidebarPanelDirective } from './../../directives/block-editor-sidebar-panel.directive';
|
|
7
|
-
import { FsBlockEditorMarginDirective } from './../../directives/block-editor-margin.directive';
|
|
8
|
-
import { SidebarComponent } from './../sidebar/sidebar.component';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
private
|
|
12
|
-
private
|
|
13
|
-
private
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
private
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
1
|
+
import { AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, IterableDiffers, OnDestroy, OnInit, QueryList } from '@angular/core';
|
|
2
|
+
import { BlockEditorConfig } from './../../interfaces/block-editor-config';
|
|
3
|
+
import { FsBlockComponent } from './../block/block.component';
|
|
4
|
+
import { BlockEditorService } from './../../services/block-editor.service';
|
|
5
|
+
import { Block } from './../../interfaces/block';
|
|
6
|
+
import { FsBlockEditorSidebarPanelDirective } from './../../directives/block-editor-sidebar-panel.directive';
|
|
7
|
+
import { FsBlockEditorMarginDirective } from './../../directives/block-editor-margin.directive';
|
|
8
|
+
import { SidebarComponent } from './../sidebar/sidebar.component';
|
|
9
|
+
import * as i0 from "@angular/core";
|
|
10
|
+
export declare class FsBlockEditorComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
11
|
+
private _el;
|
|
12
|
+
private _service;
|
|
13
|
+
private _cdRef;
|
|
14
|
+
private _differs;
|
|
15
|
+
sidebarPanels: QueryList<FsBlockEditorSidebarPanelDirective>;
|
|
16
|
+
blockComponents: QueryList<FsBlockComponent>;
|
|
17
|
+
artboard: ElementRef;
|
|
18
|
+
marginContainer: ElementRef;
|
|
19
|
+
margins: QueryList<FsBlockEditorMarginDirective>;
|
|
20
|
+
artboardContainer: ElementRef;
|
|
21
|
+
sidebar: SidebarComponent;
|
|
22
|
+
config: BlockEditorConfig;
|
|
23
|
+
blockAdded: EventEmitter<FsBlockComponent>;
|
|
24
|
+
blockRemoved: EventEmitter<FsBlockComponent>;
|
|
25
|
+
blocks: Block<any>[];
|
|
26
|
+
private _differ;
|
|
27
|
+
private _destroy$;
|
|
28
|
+
constructor(_el: ElementRef, _service: BlockEditorService, _cdRef: ChangeDetectorRef, _differs: IterableDiffers);
|
|
29
|
+
get el(): any;
|
|
30
|
+
ngOnInit(): void;
|
|
31
|
+
artboardClick(event: any): void;
|
|
32
|
+
blockChanged(block: Block<any>): void;
|
|
33
|
+
ngAfterViewInit(): void;
|
|
34
|
+
ngOnDestroy(): void;
|
|
35
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FsBlockEditorComponent, never>;
|
|
36
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FsBlockEditorComponent, "fs-block-editor", never, { "config": "config"; }, { "blockAdded": "blockAdded"; "blockRemoved": "blockRemoved"; }, ["sidebarPanels"], never>;
|
|
37
|
+
}
|
|
@@ -1,58 +1,61 @@
|
|
|
1
|
-
import { FsBlockComponent } from './../block/block.component';
|
|
2
|
-
import { ChangeDetectorRef, ElementRef, EventEmitter, OnDestroy, OnInit, QueryList } from '@angular/core';
|
|
3
|
-
import { FsFile } from '@firestitch/file';
|
|
4
|
-
import { BlockEditorConfig } from '../../interfaces/block-editor-config';
|
|
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
|
-
|
|
9
|
-
|
|
10
|
-
private
|
|
11
|
-
private
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
get
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
1
|
+
import { FsBlockComponent } from './../block/block.component';
|
|
2
|
+
import { ChangeDetectorRef, ElementRef, EventEmitter, OnDestroy, OnInit, QueryList } from '@angular/core';
|
|
3
|
+
import { FsFile } from '@firestitch/file';
|
|
4
|
+
import { BlockEditorConfig } from '../../interfaces/block-editor-config';
|
|
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 * as i0 from "@angular/core";
|
|
9
|
+
export declare class SidebarComponent implements OnInit, OnDestroy {
|
|
10
|
+
private _el;
|
|
11
|
+
private _service;
|
|
12
|
+
private _cdRef;
|
|
13
|
+
sidebarPanels: QueryList<FsBlockEditorSidebarPanelDirective>;
|
|
14
|
+
config: BlockEditorConfig;
|
|
15
|
+
blocks: any;
|
|
16
|
+
blockAdded: EventEmitter<FsBlockComponent>;
|
|
17
|
+
block: Block<any>;
|
|
18
|
+
clippable: any;
|
|
19
|
+
private _destroy$;
|
|
20
|
+
constructor(_el: ElementRef, _service: BlockEditorService, _cdRef: ChangeDetectorRef);
|
|
21
|
+
get changeDetector(): ChangeDetectorRef;
|
|
22
|
+
get el(): any;
|
|
23
|
+
ngOnInit(): void;
|
|
24
|
+
verticalAlignClick(value: any): void;
|
|
25
|
+
boldClick(): void;
|
|
26
|
+
fontColorChange(value: any): void;
|
|
27
|
+
lineHeightChange(value: any): void;
|
|
28
|
+
fontSizeChange(value: any): void;
|
|
29
|
+
borderWidthChange(value: any): void;
|
|
30
|
+
italicClick(): void;
|
|
31
|
+
underlineClick(): void;
|
|
32
|
+
backgroundColorChange(value: any): void;
|
|
33
|
+
widthChange(value: any): void;
|
|
34
|
+
heightChange(value: any): void;
|
|
35
|
+
topChange(value: any): void;
|
|
36
|
+
leftChange(value: any): void;
|
|
37
|
+
rotateChange(value: any): void;
|
|
38
|
+
paddingChange(name: any, value: any): void;
|
|
39
|
+
paddingAllChange(value: any): void;
|
|
40
|
+
borderColorChange(value: any): void;
|
|
41
|
+
horizontalAlignClick(value: any): void;
|
|
42
|
+
shapeRound(value: any): void;
|
|
43
|
+
imageRemove(): void;
|
|
44
|
+
imageClip(): void;
|
|
45
|
+
shapeRadiusChange(value: any): void;
|
|
46
|
+
fileSelect(fsFile: FsFile): void;
|
|
47
|
+
blockRemoveClick(): void;
|
|
48
|
+
blockAddClick(): void;
|
|
49
|
+
addBlock(block: Block<any>): void;
|
|
50
|
+
private _updateIndexes;
|
|
51
|
+
layerMove(direction: any): void;
|
|
52
|
+
layerUp(): void;
|
|
53
|
+
layerDown(): void;
|
|
54
|
+
getBlock(reference: any): Block<any>;
|
|
55
|
+
blockChanged(block: Block<any>): void;
|
|
56
|
+
inputFocus(event: any): void;
|
|
57
|
+
ngOnDestroy(): void;
|
|
58
|
+
validNumeric(value: any): boolean;
|
|
59
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SidebarComponent, never>;
|
|
60
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SidebarComponent, "sidebar", never, { "config": "config"; "blocks": "blocks"; "blockAdded": "blockAdded"; }, {}, ["sidebarPanels"], never>;
|
|
61
|
+
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { ElementRef } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { ElementRef } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class FsBlockEditorMarginDirective {
|
|
4
|
+
private _elementRef;
|
|
5
|
+
constructor(_elementRef: ElementRef);
|
|
6
|
+
get element(): any;
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FsBlockEditorMarginDirective, never>;
|
|
8
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<FsBlockEditorMarginDirective, "[fsBlockEditorMargin]", never, {}, {}, never>;
|
|
9
|
+
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { TemplateRef } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { TemplateRef } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class FsBlockEditorSidebarPanelDirective {
|
|
4
|
+
templateRef: TemplateRef<any>;
|
|
5
|
+
label: string;
|
|
6
|
+
show: boolean;
|
|
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>;
|
|
10
|
+
}
|
|
@@ -1,4 +1,22 @@
|
|
|
1
|
-
import { ModuleWithProviders } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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 "@angular/common";
|
|
9
|
+
import * as i7 from "@angular/forms";
|
|
10
|
+
import * as i8 from "@angular/material/icon";
|
|
11
|
+
import * as i9 from "@angular/material/button";
|
|
12
|
+
import * as i10 from "@angular/material/input";
|
|
13
|
+
import * as i11 from "@angular/material/form-field";
|
|
14
|
+
import * as i12 from "@firestitch/html-editor";
|
|
15
|
+
import * as i13 from "@firestitch/file";
|
|
16
|
+
import * as i14 from "@firestitch/colorpicker";
|
|
17
|
+
export declare class FsBlockEditorModule {
|
|
18
|
+
static forRoot(): ModuleWithProviders<FsBlockEditorModule>;
|
|
19
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FsBlockEditorModule, never>;
|
|
20
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<FsBlockEditorModule, [typeof i1.FsBlockComponent, typeof i2.FsBlockEditorComponent, typeof i3.FsBlockEditorSidebarPanelDirective, typeof i4.FsBlockEditorMarginDirective, typeof i5.SidebarComponent], [typeof i6.CommonModule, typeof i7.FormsModule, typeof i8.MatIconModule, typeof i9.MatButtonModule, typeof i10.MatInputModule, typeof i11.MatFormFieldModule, typeof i12.FsHtmlEditorModule, typeof i13.FsFileModule, typeof i14.FsColorPickerModule], [typeof i1.FsBlockComponent, typeof i2.FsBlockEditorComponent, typeof i3.FsBlockEditorSidebarPanelDirective]>;
|
|
21
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<FsBlockEditorModule>;
|
|
22
|
+
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { Observable } from 'rxjs';
|
|
2
|
-
import { Block } from './block';
|
|
3
|
-
export interface BlockEditorConfig {
|
|
4
|
-
unit?: 'in' | 'px';
|
|
5
|
-
width?: number;
|
|
6
|
-
height?: number;
|
|
7
|
-
marginTop?: number;
|
|
8
|
-
marginRight?: number;
|
|
9
|
-
marginBottom?: number;
|
|
10
|
-
marginLeft?: number;
|
|
11
|
-
blocks?: Block<any>[];
|
|
12
|
-
blockChanged?: (block: Block<any>) => void;
|
|
13
|
-
blockAdded?: (block: Block<any>) => Observable<Block<any>>;
|
|
14
|
-
blocksRemoved?: (block: Block<any>[]) => Observable<Block<any>>;
|
|
15
|
-
blocksLevelChanged?: (blocks: Block<any>[]) => void;
|
|
16
|
-
blocksSelected?: (blocks: Block<any>[]) => void;
|
|
17
|
-
fileUpload?: (file: Blob) => Observable<string>;
|
|
18
|
-
}
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { Block } from './block';
|
|
3
|
+
export interface BlockEditorConfig {
|
|
4
|
+
unit?: 'in' | 'px';
|
|
5
|
+
width?: number;
|
|
6
|
+
height?: number;
|
|
7
|
+
marginTop?: number;
|
|
8
|
+
marginRight?: number;
|
|
9
|
+
marginBottom?: number;
|
|
10
|
+
marginLeft?: number;
|
|
11
|
+
blocks?: Block<any>[];
|
|
12
|
+
blockChanged?: (block: Block<any>) => void;
|
|
13
|
+
blockAdded?: (block: Block<any>) => Observable<Block<any>>;
|
|
14
|
+
blocksRemoved?: (block: Block<any>[]) => Observable<Block<any>>;
|
|
15
|
+
blocksLevelChanged?: (blocks: Block<any>[]) => void;
|
|
16
|
+
blocksSelected?: (blocks: Block<any>[]) => void;
|
|
17
|
+
fileUpload?: (file: Blob) => Observable<string>;
|
|
18
|
+
}
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { FsBlockComponent } from './../components/block/block.component';
|
|
2
|
-
export declare type Block<T = {}> = BlockBase & T;
|
|
3
|
-
export interface BlockBase {
|
|
4
|
-
reference: any;
|
|
5
|
-
width?: number;
|
|
6
|
-
height?: number;
|
|
7
|
-
top?: number;
|
|
8
|
-
left?: number;
|
|
9
|
-
rotate?: number;
|
|
10
|
-
horizontalAlign?: 'left' | 'right' | 'center';
|
|
11
|
-
verticalAlign?: 'top' | 'center' | 'bottom';
|
|
12
|
-
borderColor?: string;
|
|
13
|
-
borderWidth?: number;
|
|
14
|
-
fontColor?: string;
|
|
15
|
-
fontSize?: number;
|
|
16
|
-
bold?: boolean;
|
|
17
|
-
italic?: boolean;
|
|
18
|
-
underline?: boolean;
|
|
19
|
-
backgroundColor?: string;
|
|
20
|
-
shapeRadius?: number;
|
|
21
|
-
lineHeight?: number;
|
|
22
|
-
shapeTopRight?: string;
|
|
23
|
-
shapeTopLeft?: string;
|
|
24
|
-
shapeBottomRight?: string;
|
|
25
|
-
shapeBottomLeft?: string;
|
|
26
|
-
padding?: number;
|
|
27
|
-
paddingTop?: number;
|
|
28
|
-
paddingLeft?: number;
|
|
29
|
-
paddingBottom?: number;
|
|
30
|
-
paddingRight?: number;
|
|
31
|
-
content?: string;
|
|
32
|
-
blockComponent?: FsBlockComponent;
|
|
33
|
-
index?: number;
|
|
34
|
-
imageUrl?: string;
|
|
35
|
-
clipPath?: string;
|
|
36
|
-
readonly?: boolean;
|
|
37
|
-
}
|
|
1
|
+
import { FsBlockComponent } from './../components/block/block.component';
|
|
2
|
+
export declare type Block<T = {}> = BlockBase & T;
|
|
3
|
+
export interface BlockBase {
|
|
4
|
+
reference: any;
|
|
5
|
+
width?: number;
|
|
6
|
+
height?: number;
|
|
7
|
+
top?: number;
|
|
8
|
+
left?: number;
|
|
9
|
+
rotate?: number;
|
|
10
|
+
horizontalAlign?: 'left' | 'right' | 'center';
|
|
11
|
+
verticalAlign?: 'top' | 'center' | 'bottom';
|
|
12
|
+
borderColor?: string;
|
|
13
|
+
borderWidth?: number;
|
|
14
|
+
fontColor?: string;
|
|
15
|
+
fontSize?: number;
|
|
16
|
+
bold?: boolean;
|
|
17
|
+
italic?: boolean;
|
|
18
|
+
underline?: boolean;
|
|
19
|
+
backgroundColor?: string;
|
|
20
|
+
shapeRadius?: number;
|
|
21
|
+
lineHeight?: number;
|
|
22
|
+
shapeTopRight?: string;
|
|
23
|
+
shapeTopLeft?: string;
|
|
24
|
+
shapeBottomRight?: string;
|
|
25
|
+
shapeBottomLeft?: string;
|
|
26
|
+
padding?: number;
|
|
27
|
+
paddingTop?: number;
|
|
28
|
+
paddingLeft?: number;
|
|
29
|
+
paddingBottom?: number;
|
|
30
|
+
paddingRight?: number;
|
|
31
|
+
content?: string;
|
|
32
|
+
blockComponent?: FsBlockComponent;
|
|
33
|
+
index?: number;
|
|
34
|
+
imageUrl?: string;
|
|
35
|
+
clipPath?: string;
|
|
36
|
+
readonly?: boolean;
|
|
37
|
+
}
|
|
@@ -1,33 +1,36 @@
|
|
|
1
|
-
import { BehaviorSubject } from 'rxjs';
|
|
2
|
-
import { Block } from './../interfaces/block';
|
|
3
|
-
import { FsBlockComponent } from '../components/block/block.component';
|
|
4
|
-
import { BlockEditorConfig } from '../interfaces/block-editor-config';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
private
|
|
12
|
-
private
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
get blocks(): any[]
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
get
|
|
25
|
-
get
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
1
|
+
import { BehaviorSubject } from 'rxjs';
|
|
2
|
+
import { Block } from './../interfaces/block';
|
|
3
|
+
import { FsBlockComponent } from '../components/block/block.component';
|
|
4
|
+
import { BlockEditorConfig } from '../interfaces/block-editor-config';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class BlockEditorService {
|
|
7
|
+
container: any;
|
|
8
|
+
margin: any;
|
|
9
|
+
blockComponents: FsBlockComponent[];
|
|
10
|
+
config: BlockEditorConfig;
|
|
11
|
+
private _blocks$;
|
|
12
|
+
private _selectionRange;
|
|
13
|
+
private _selectedBlockComponents$;
|
|
14
|
+
constructor();
|
|
15
|
+
get elementGuidelines(): any[];
|
|
16
|
+
addBlock(block: Block<any>): void;
|
|
17
|
+
removeBlock(block: Block<any>): void;
|
|
18
|
+
get blocks$(): BehaviorSubject<any[]>;
|
|
19
|
+
get blocks(): any[];
|
|
20
|
+
set blocks(blocks: any[]);
|
|
21
|
+
isSelectedBlock(block: any): boolean;
|
|
22
|
+
indexOf(block: any): number;
|
|
23
|
+
set selectedBlockComponents(blocks: FsBlockComponent[]);
|
|
24
|
+
get selectedBlockComponents(): FsBlockComponent[];
|
|
25
|
+
get selectedBlocks(): Block<any>[];
|
|
26
|
+
get selectedBlockComponents$(): BehaviorSubject<FsBlockComponent[]>;
|
|
27
|
+
saveSelection(): void;
|
|
28
|
+
restoreSelection(): void;
|
|
29
|
+
hasSelectionRange(): boolean;
|
|
30
|
+
registerBlock(block: FsBlockComponent): void;
|
|
31
|
+
registerContainer(container: any): void;
|
|
32
|
+
registerMargin(margin: any): void;
|
|
33
|
+
sanitizeBlock(block: any): any;
|
|
34
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BlockEditorService, never>;
|
|
35
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<BlockEditorService>;
|
|
36
|
+
}
|