@firestitch/block-editor 12.1.8 → 12.2.1

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.
@@ -0,0 +1,15 @@
1
+ import { MatDialogRef } from '@angular/material/dialog';
2
+ import { CdkDragDrop } from '@angular/cdk/drag-drop';
3
+ import { FsBlockComponent } from '../block/block.component';
4
+ import * as i0 from "@angular/core";
5
+ export declare class LayersReorderDialogComponent {
6
+ private _dialogRef;
7
+ fields: FsBlockComponent[];
8
+ blockTypeIcons: {};
9
+ constructor(_dialogData: unknown, _dialogRef: MatDialogRef<LayersReorderDialogComponent>);
10
+ swapItems(event: CdkDragDrop<FsBlockComponent>): void;
11
+ done(): void;
12
+ private _init;
13
+ static ɵfac: i0.ɵɵFactoryDeclaration<LayersReorderDialogComponent, never>;
14
+ static ɵcmp: i0.ɵɵComponentDeclaration<LayersReorderDialogComponent, "ng-component", never, {}, {}, never, never>;
15
+ }
@@ -12,6 +12,7 @@ export declare class SidebarComponent implements OnInit, OnDestroy {
12
12
  private _blockEditor;
13
13
  private _cdRef;
14
14
  private _prompt;
15
+ private _document;
15
16
  sidebarPanels: QueryList<FsBlockEditorSidebarPanelDirective>;
16
17
  config: BlockEditorConfig;
17
18
  blocks: any;
@@ -34,7 +35,7 @@ export declare class SidebarComponent implements OnInit, OnDestroy {
34
35
  BlockType: typeof BlockType;
35
36
  formats: any[];
36
37
  private _destroy$;
37
- constructor(_el: ElementRef, _blockEditor: BlockEditorService, _cdRef: ChangeDetectorRef, _prompt: FsPrompt);
38
+ constructor(_el: ElementRef, _blockEditor: BlockEditorService, _cdRef: ChangeDetectorRef, _prompt: FsPrompt, _document: any);
38
39
  get el(): any;
39
40
  ngOnInit(): void;
40
41
  verticalAlignClick(value: any): void;
@@ -63,11 +64,12 @@ export declare class SidebarComponent implements OnInit, OnDestroy {
63
64
  blockChangeProperty(value: any, name: any): void;
64
65
  imageSelect(fsFile: FsFile): void;
65
66
  blockRemoveClick(): void;
66
- blockUpload(blockType: any, fsFile: FsFile): void;
67
+ blockUpload(type: any, fsFile: FsFile): void;
67
68
  blockAdd(type: BlockType): void;
68
69
  layerMove(direction: any): void;
69
70
  layerUp(): void;
70
71
  layerDown(): void;
72
+ reorderLayers(): void;
71
73
  blockChanged(block: Block<any>): void;
72
74
  inputFocus(event: any): void;
73
75
  ngOnDestroy(): void;
@@ -1,6 +1,6 @@
1
1
  export declare enum BlockFormat {
2
2
  Date = "date",
3
- YYYYMMDD = "yyyy/MM/dd",
3
+ YYYYMMDD = "YYYY/MM/DD",
4
4
  Currency = "currency",
5
5
  Number = "number"
6
6
  }
@@ -6,22 +6,26 @@ import * as i3 from "./directives/block-editor-sidebar-panel.directive";
6
6
  import * as i4 from "./directives/block-editor-margin.directive";
7
7
  import * as i5 from "./components/sidebar/sidebar.component";
8
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 "@angular/material/select";
18
- import * as i16 from "@firestitch/file";
19
- import * as i17 from "@firestitch/colorpicker";
20
- import * as i18 from "@firestitch/menu";
21
- import * as i19 from "@firestitch/zoom-pan";
9
+ import * as i7 from "./components/layers-reorder-dialog/layers-reorder-dialog.component";
10
+ import * as i8 from "@angular/common";
11
+ import * as i9 from "@angular/forms";
12
+ import * as i10 from "@angular/material/icon";
13
+ import * as i11 from "@angular/material/button";
14
+ import * as i12 from "@angular/material/input";
15
+ import * as i13 from "@angular/material/form-field";
16
+ import * as i14 from "@angular/material/checkbox";
17
+ import * as i15 from "@angular/material/tooltip";
18
+ import * as i16 from "@angular/material/select";
19
+ import * as i17 from "@angular/material/list";
20
+ import * as i18 from "@angular/cdk/drag-drop";
21
+ import * as i19 from "@firestitch/file";
22
+ import * as i20 from "@firestitch/colorpicker";
23
+ import * as i21 from "@firestitch/menu";
24
+ import * as i22 from "@firestitch/zoom-pan";
25
+ import * as i23 from "@firestitch/dialog";
22
26
  export declare class FsBlockEditorModule {
23
27
  static forRoot(): ModuleWithProviders<FsBlockEditorModule>;
24
28
  static ɵfac: i0.ɵɵFactoryDeclaration<FsBlockEditorModule, never>;
25
- 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.MatSelectModule, typeof i16.FsFileModule, typeof i17.FsColorPickerModule, typeof i18.FsMenuModule, typeof i19.FsZoomPanModule], [typeof i1.FsBlockComponent, typeof i2.FsBlockEditorComponent, typeof i3.FsBlockEditorSidebarPanelDirective]>;
29
+ 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.LayersReorderDialogComponent], [typeof i8.CommonModule, typeof i9.FormsModule, typeof i10.MatIconModule, typeof i11.MatButtonModule, typeof i12.MatInputModule, typeof i13.MatFormFieldModule, typeof i14.MatCheckboxModule, typeof i15.MatTooltipModule, typeof i16.MatSelectModule, typeof i17.MatListModule, typeof i18.DragDropModule, typeof i19.FsFileModule, typeof i20.FsColorPickerModule, typeof i21.FsMenuModule, typeof i22.FsZoomPanModule, typeof i23.FsDialogModule], [typeof i1.FsBlockComponent, typeof i2.FsBlockEditorComponent, typeof i3.FsBlockEditorSidebarPanelDirective]>;
26
30
  static ɵinj: i0.ɵɵInjectorDeclaration<FsBlockEditorModule>;
27
31
  }
@@ -32,6 +32,7 @@ export interface BlockBase {
32
32
  content?: string;
33
33
  blockComponent?: FsBlockComponent;
34
34
  index?: number;
35
+ tabIndex?: number;
35
36
  imageUrl?: string;
36
37
  clipPath?: string;
37
38
  readonly?: boolean;
@@ -1,37 +1,37 @@
1
1
  import { OnDestroy } from '@angular/core';
2
- import { Observable, Subject } from 'rxjs';
2
+ import { Observable } from 'rxjs';
3
+ import { FsFile } from '@firestitch/file';
4
+ import { FsDialog } from '@firestitch/dialog';
5
+ import { BlocksStore } from './blocks-store.service';
3
6
  import { Block } from './../interfaces/block';
4
7
  import { FsBlockComponent } from '../components/block/block.component';
5
8
  import { BlockEditorConfig } from '../interfaces/block-editor-config';
6
- import { FsFile } from '@firestitch/file';
7
9
  import * as i0 from "@angular/core";
8
10
  export declare class BlockEditorService implements OnDestroy {
11
+ private _store;
12
+ private _dialog;
9
13
  container: any;
10
14
  margin: any;
11
15
  config: BlockEditorConfig;
12
- private _blockChanged$;
13
- private _blockRemoved$;
14
- private _blockAdded$;
15
- private _blocks$;
16
16
  private _selectedBlocks$;
17
17
  private _selectionRange;
18
18
  private _blockComponents;
19
19
  private _destroy$;
20
- get elementGuidelines(): any[];
20
+ constructor(_store: BlocksStore, _dialog: FsDialog);
21
21
  get blockComponents(): FsBlockComponent[];
22
22
  get selectedComponentBlocks(): FsBlockComponent[];
23
- blockUpload(block: Block, fsFile: FsFile): void;
24
- blockAdd(block: Block<any>): void;
23
+ init(config: BlockEditorConfig): void;
24
+ blockAdd(block: Block, newBlock?: boolean): void;
25
+ blockUpload(block: Block, fsFile: FsFile, newBlock?: boolean): void;
25
26
  private _updateIndexesFor;
26
- removeBlock(block: Block<any>): void;
27
+ blockRemove(block: Block): void;
27
28
  removeSelectedBlocks(): void;
28
29
  get blocks$(): Observable<Block[]>;
29
- get blockChanged$(): Subject<any>;
30
- get blockRemoved$(): Subject<any>;
31
- get blockAdded$(): Subject<any>;
32
- blockChange(block: any): void;
30
+ get blockChanged$(): Observable<any>;
31
+ get blockAdded$(): Observable<Block>;
32
+ get blockRemoved$(): Observable<Block>;
33
33
  get blocks(): Block[];
34
- set blocks(blocks: Block[]);
34
+ blockChange(block: Block): void;
35
35
  isSelectedBlock(block: any): boolean;
36
36
  indexOf(block: any): number;
37
37
  selectedBlockComponentChangeProperty(value: any, name: any): void;
@@ -46,8 +46,7 @@ export declare class BlockEditorService implements OnDestroy {
46
46
  unregisterBlock(block: Block): void;
47
47
  registerContainer(container: any): void;
48
48
  registerMargin(margin: any): void;
49
- sanitizeNewBlock(block: Block): any;
50
- sanitizeBlock(block: any): any;
49
+ openReorderDialog(): void;
51
50
  ngOnDestroy(): void;
52
51
  static ɵfac: i0.ɵɵFactoryDeclaration<BlockEditorService, never>;
53
52
  static ɵprov: i0.ɵɵInjectableDeclaration<BlockEditorService>;
@@ -0,0 +1,34 @@
1
+ import { OnDestroy } from '@angular/core';
2
+ import { Observable } from 'rxjs';
3
+ import { FsFile } from '@firestitch/file';
4
+ import { Block } from '../interfaces/block';
5
+ import { BlockEditorConfig } from '../interfaces/block-editor-config';
6
+ import * as i0 from "@angular/core";
7
+ export declare class BlocksStore implements OnDestroy {
8
+ private _config;
9
+ private _lastTabIndex;
10
+ private _eventBus$;
11
+ private _blocks$;
12
+ private _destroy$;
13
+ get blocks(): Block[];
14
+ get blocks$(): Observable<Block[]>;
15
+ get blockAdded$(): Observable<Block>;
16
+ get blockChanged$(): Observable<Block>;
17
+ get blockRemoved$(): Observable<Block>;
18
+ ngOnDestroy(): void;
19
+ init(config: BlockEditorConfig): void;
20
+ blockExists(block: Block): boolean;
21
+ blockAdd(block: Block, initBlock?: boolean): void;
22
+ blockUpload(block: Block, fsFile: FsFile, initBlock?: boolean): void;
23
+ blockChange(block: Block): void;
24
+ blockRemove(targetBlocks: Block | Block[]): void;
25
+ isReordableBlock(block: Block): boolean;
26
+ updateTabIndex(index: number): void;
27
+ private _setBlocks;
28
+ private _appendBlock;
29
+ private _dispatchEvent;
30
+ private _createBlock;
31
+ private _deduplicateIndexesFor;
32
+ static ɵfac: i0.ɵɵFactoryDeclaration<BlocksStore, never>;
33
+ static ɵprov: i0.ɵɵInjectableDeclaration<BlocksStore>;
34
+ }