@pobuca/email-builder 1.2.1 → 1.3.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.
@@ -1696,16 +1696,125 @@
1696
1696
  { type: Storage, decorators: [{ type: i0.Inject, args: [PB_TEMPLATES_TEMPORARY_STORAGE,] }] }
1697
1697
  ]; };
1698
1698
 
1699
+ /*
1700
+ * Copyright (c) 2024 Pobuca.
1701
+ * All rights reserved.
1702
+ */
1703
+ /**
1704
+ * @internal
1705
+ */
1706
+ var IpHistoryService = /** @class */ (function () {
1707
+ function IpHistoryService() {
1708
+ this.historyStack = [];
1709
+ this.currentIndex = -1;
1710
+ this.maxHistorySize = 50; // Maximum undo steps
1711
+ this._canUndo$ = new rxjs.BehaviorSubject(false);
1712
+ this._canRedo$ = new rxjs.BehaviorSubject(false);
1713
+ this.canUndo$ = this._canUndo$.asObservable();
1714
+ this.canRedo$ = this._canRedo$.asObservable();
1715
+ }
1716
+ /**
1717
+ * Add a new state to the history stack
1718
+ */
1719
+ IpHistoryService.prototype.addState = function (state) {
1720
+ if (!state) {
1721
+ return;
1722
+ }
1723
+ var clonedState = cloneDeep(state);
1724
+ // If we're not at the end of the stack, remove all states after current index
1725
+ // This happens when user undoes and then makes a new change
1726
+ if (this.currentIndex < this.historyStack.length - 1) {
1727
+ this.historyStack = this.historyStack.slice(0, this.currentIndex + 1);
1728
+ }
1729
+ // Add the new state
1730
+ this.historyStack.push(clonedState);
1731
+ this.currentIndex++;
1732
+ // Limit history size to prevent memory issues
1733
+ if (this.historyStack.length > this.maxHistorySize) {
1734
+ this.historyStack.shift();
1735
+ this.currentIndex--;
1736
+ }
1737
+ this.updateUndoRedoStatus();
1738
+ };
1739
+ /**
1740
+ * Get the previous state (undo)
1741
+ */
1742
+ IpHistoryService.prototype.undo = function () {
1743
+ if (!this.canUndoNow()) {
1744
+ return null;
1745
+ }
1746
+ this.currentIndex--;
1747
+ this.updateUndoRedoStatus();
1748
+ return cloneDeep(this.historyStack[this.currentIndex]);
1749
+ };
1750
+ /**
1751
+ * Get the next state (redo)
1752
+ */
1753
+ IpHistoryService.prototype.redo = function () {
1754
+ if (!this.canRedoNow()) {
1755
+ return null;
1756
+ }
1757
+ this.currentIndex++;
1758
+ this.updateUndoRedoStatus();
1759
+ return cloneDeep(this.historyStack[this.currentIndex]);
1760
+ };
1761
+ /**
1762
+ * Check if undo is available (synchronous)
1763
+ */
1764
+ IpHistoryService.prototype.canUndoNow = function () {
1765
+ return this.currentIndex > 0;
1766
+ };
1767
+ /**
1768
+ * Check if redo is available (synchronous)
1769
+ */
1770
+ IpHistoryService.prototype.canRedoNow = function () {
1771
+ return this.currentIndex < this.historyStack.length - 1;
1772
+ };
1773
+ /**
1774
+ * Clear history
1775
+ */
1776
+ IpHistoryService.prototype.clear = function () {
1777
+ this.historyStack = [];
1778
+ this.currentIndex = -1;
1779
+ this.updateUndoRedoStatus();
1780
+ };
1781
+ /**
1782
+ * Get the history size
1783
+ */
1784
+ IpHistoryService.prototype.getHistorySize = function () {
1785
+ return this.historyStack.length;
1786
+ };
1787
+ /**
1788
+ * Get current position in history stack
1789
+ */
1790
+ IpHistoryService.prototype.getCurrentIndex = function () {
1791
+ return this.currentIndex;
1792
+ };
1793
+ IpHistoryService.prototype.updateUndoRedoStatus = function () {
1794
+ this._canUndo$.next(this.canUndoNow());
1795
+ this._canRedo$.next(this.canRedoNow());
1796
+ };
1797
+ return IpHistoryService;
1798
+ }());
1799
+ IpHistoryService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function IpHistoryService_Factory() { return new IpHistoryService(); }, token: IpHistoryService, providedIn: "any" });
1800
+ IpHistoryService.decorators = [
1801
+ { type: i0.Injectable, args: [{
1802
+ providedIn: 'any'
1803
+ },] }
1804
+ ];
1805
+ IpHistoryService.ctorParameters = function () { return []; };
1806
+
1699
1807
  // https://www.npmjs.com/package/recursive-diff
1700
1808
  /**
1701
1809
  * @internal
1702
1810
  */
1703
1811
  var PbEmailObjectStoreService = /** @class */ (function () {
1704
- function PbEmailObjectStoreService(userRestApi, pbStorage, userMiddleware, googleFonts, config) {
1812
+ function PbEmailObjectStoreService(userRestApi, pbStorage, userMiddleware, history, googleFonts, config) {
1705
1813
  var _this = this;
1706
1814
  this.userRestApi = userRestApi;
1707
1815
  this.pbStorage = pbStorage;
1708
1816
  this.userMiddleware = userMiddleware;
1817
+ this.history = history;
1709
1818
  this.googleFonts = googleFonts;
1710
1819
  this.config = config;
1711
1820
  this.Email = new PBEmail();
@@ -1732,6 +1841,9 @@
1732
1841
  var _d = __read(_c), _ = _d[0], rest = _d.slice(1);
1733
1842
  return rest;
1734
1843
  }));
1844
+ // History/Undo support
1845
+ this.canUndo$ = this.history.canUndo$;
1846
+ this.canRedo$ = this.history.canRedo$;
1735
1847
  }
1736
1848
  Object.defineProperty(PbEmailObjectStoreService.prototype, "defaultTemplateThumbPath", {
1737
1849
  get: function () {
@@ -1785,6 +1897,8 @@
1785
1897
  };
1786
1898
  PbEmailObjectStoreService.prototype.markForCheck = function () {
1787
1899
  this._Email$.next(this.Email);
1900
+ // Add to undo/redo history
1901
+ this.history.addState(this.Email);
1788
1902
  if (this.Email.structures.length) {
1789
1903
  this.pbStorage.addTemplateToLatestUsed(cloneDeep({
1790
1904
  templateData: this.Email,
@@ -1864,9 +1978,41 @@
1864
1978
  this.clonedEmail = cloneDeep(this.Email);
1865
1979
  this.markForCheck();
1866
1980
  };
1981
+ /**
1982
+ * Undo the last change
1983
+ * @returns true if undo was successful, false if undo is not available
1984
+ */
1985
+ PbEmailObjectStoreService.prototype.undo = function () {
1986
+ var previousState = this.history.undo();
1987
+ if (previousState) {
1988
+ this.Email = previousState;
1989
+ this._Email$.next(this.Email);
1990
+ // Reset template to force re-generation on next save
1991
+ this._Template$.next(null);
1992
+ this._Mjml$.next(null);
1993
+ return true;
1994
+ }
1995
+ return false;
1996
+ };
1997
+ /**
1998
+ * Redo the last undone change
1999
+ * @returns true if redo was successful, false if redo is not available
2000
+ */
2001
+ PbEmailObjectStoreService.prototype.redo = function () {
2002
+ var nextState = this.history.redo();
2003
+ if (nextState) {
2004
+ this.Email = nextState;
2005
+ this._Email$.next(this.Email);
2006
+ // Reset template to force re-generation on next save
2007
+ this._Template$.next(null);
2008
+ this._Mjml$.next(null);
2009
+ return true;
2010
+ }
2011
+ return false;
2012
+ };
1867
2013
  return PbEmailObjectStoreService;
1868
2014
  }());
1869
- PbEmailObjectStoreService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function PbEmailObjectStoreService_Factory() { return new PbEmailObjectStoreService(i0__namespace.ɵɵinject(PbUserRestApiService), i0__namespace.ɵɵinject(PbStorageService), i0__namespace.ɵɵinject(PbUserMiddlewaresService), i0__namespace.ɵɵinject(PB_GOOGLE_FONTS), i0__namespace.ɵɵinject(PB_CONFIG)); }, token: PbEmailObjectStoreService, providedIn: "root" });
2015
+ PbEmailObjectStoreService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function PbEmailObjectStoreService_Factory() { return new PbEmailObjectStoreService(i0__namespace.ɵɵinject(PbUserRestApiService), i0__namespace.ɵɵinject(PbStorageService), i0__namespace.ɵɵinject(PbUserMiddlewaresService), i0__namespace.ɵɵinject(IpHistoryService), i0__namespace.ɵɵinject(PB_GOOGLE_FONTS), i0__namespace.ɵɵinject(PB_CONFIG)); }, token: PbEmailObjectStoreService, providedIn: "root" });
1870
2016
  PbEmailObjectStoreService.decorators = [
1871
2017
  { type: i0.Injectable, args: [{
1872
2018
  providedIn: 'root'
@@ -1876,6 +2022,7 @@
1876
2022
  { type: PbUserRestApiService },
1877
2023
  { type: PbStorageService },
1878
2024
  { type: PbUserMiddlewaresService },
2025
+ { type: IpHistoryService },
1879
2026
  { type: Array, decorators: [{ type: i0.Inject, args: [PB_GOOGLE_FONTS,] }] },
1880
2027
  { type: undefined, decorators: [{ type: i0.Inject, args: [PB_CONFIG,] }] }
1881
2028
  ]; };
@@ -2775,6 +2922,9 @@
2775
2922
  this.currentHTMLTemplate$ = this.emailObjectStore.templateAsObservable$;
2776
2923
  this.activeMatProgress$ = this.userInterfaceService.activeMatProgress$.asObservable();
2777
2924
  this.customModuleList$ = this.userRestApiService.getAllUserModules$;
2925
+ // Undo/Redo support
2926
+ this.canUndo$ = this.emailObjectStore.canUndo$;
2927
+ this.canRedo$ = this.emailObjectStore.canRedo$;
2778
2928
  this._onDestroy$ = new rxjs.Subject();
2779
2929
  this.includedFonts = new Set();
2780
2930
  if (this.doc) {
@@ -2839,6 +2989,22 @@
2839
2989
  PbEmailBuilderComponent.prototype.disableStructureList$ = function (structure) {
2840
2990
  return this.middlewares.disableStructureDragFromList(structure).pipe(operators.take(1));
2841
2991
  };
2992
+ /**
2993
+ * Undo the last action
2994
+ */
2995
+ PbEmailBuilderComponent.prototype.undo = function () {
2996
+ if (this.emailObjectStore.undo()) {
2997
+ this.userInterfaceService.notify('Undo applied', 'short');
2998
+ }
2999
+ };
3000
+ /**
3001
+ * Redo the last undone action
3002
+ */
3003
+ PbEmailBuilderComponent.prototype.redo = function () {
3004
+ if (this.emailObjectStore.redo()) {
3005
+ this.userInterfaceService.notify('Redo applied', 'short');
3006
+ }
3007
+ };
2842
3008
  PbEmailBuilderComponent.prototype.trackByFn = function (block) {
2843
3009
  return block.type;
2844
3010
  };
@@ -2958,6 +3124,30 @@
2958
3124
  });
2959
3125
  }
2960
3126
  });
3127
+ // Keyboard shortcuts for Undo (Ctrl+Z) and Redo (Ctrl+Shift+Z)
3128
+ rxjs.fromEvent(this.doc, 'keydown')
3129
+ .pipe(operators.filter(function (event) {
3130
+ // Check if Ctrl (or Cmd on Mac) is pressed
3131
+ var isCtrlOrCmd = event.ctrlKey || event.metaKey;
3132
+ // Check if we're in a focusable element like input/textarea
3133
+ var isFocusable = event.target instanceof HTMLInputElement ||
3134
+ event.target instanceof HTMLTextAreaElement;
3135
+ return isCtrlOrCmd && !isFocusable;
3136
+ }), operators.takeUntil(this._onDestroy$))
3137
+ .subscribe(function (event) {
3138
+ if (event.key === 'z' || event.key === 'Z') {
3139
+ // Undo: Ctrl+Z
3140
+ if (!event.shiftKey) {
3141
+ event.preventDefault();
3142
+ _this.undo();
3143
+ }
3144
+ // Redo: Ctrl+Shift+Z
3145
+ else if (event.shiftKey) {
3146
+ event.preventDefault();
3147
+ _this.redo();
3148
+ }
3149
+ }
3150
+ });
2961
3151
  };
2962
3152
  PbEmailBuilderComponent.prototype.ngOnChanges = function (changes) {
2963
3153
  if (changes.email) {
@@ -2988,7 +3178,7 @@
2988
3178
  PbEmailBuilderComponent.decorators = [
2989
3179
  { type: i0.Component, args: [{
2990
3180
  selector: 'pb-email-builder',
2991
- template: "<!--\n ~ Copyright (c) 2024 Pobuca.\n ~ All rights reserved.\n -->\n\n<mat-sidenav-container>\n <div class=\"pb-builder-container\" fxLayout=\"column\" fxFlex>\n <mat-progress-bar *ngIf=\"activeMatProgress$ | async\" mode=\"buffer\"></mat-progress-bar>\n <mat-toolbar fxLayoutGap=\"1rem\" fxLayoutAlign=\"space-between center\">\n <ng-content fxLayout fxLayoutGap=\"0.5rem\" select=\".top-actions\"></ng-content>\n\n <div fxFlexlayout fxLayoutGap=\"0.5rem\">\n <button *ngIf=\"ngb.config.useSaveButton\" type=\"button\" (click)=\"saveEmail()\" mat-stroked-button color=\"primary\"\n i18n=\"actions|Save Email\">\n Save Email\n </button>\n <button *ngIf=\"ngb.config.usePreviewButton\" type=\"button\" (click)=\"togglePreview()\" mat-stroked-button>\n <ng-container [ngSwitch]=\"previewTemplate\">\n <span *ngSwitchDefault i18n=\"actions|Preview\">Preview</span>\n <span *ngSwitchCase=\"true\" i18n=\"actions|Close Preview\">Close Preview</span>\n </ng-container>\n </button>\n\n <button mat-button mat-stroked-button i18n=\"actions|Import\" (click)=\"importFile()\">\n Import\n </button>\n\n <ng-container *ngIf=\"ngb.config.useDownloadButton\">\n <button mat-button [matMenuTriggerFor]=\"downloadMenu\" mat-stroked-button i18n=\"actions|Export\">\n Export\n </button>\n <mat-menu #downloadMenu=\"matMenu\">\n <button mat-menu-item (click)=\"download('html')\" i18n=\"actions|Export HTML\">\n Export HTML\n </button>\n <button mat-menu-item (click)=\"download('mjml')\" i18n=\"actions|Export MJML\">\n Export MJML\n </button>\n <button mat-menu-item (click)=\"download('json')\" i18n=\"actions|Export JSON\">\n Export JSON\n </button>\n </mat-menu>\n </ng-container>\n\n </div>\n <!-- <div class=\"history-actions\" style=\"margin-inline-start: auto;\">\n <span>Last saved Now</span>\n <button type=\"button\" mat-icon-button>\n <mat-icon>undo</mat-icon>\n </button>\n <button type=\"button\" mat-icon-button>\n <mat-icon>redo</mat-icon>\n </button>\n </div> -->\n </mat-toolbar>\n <ng-container [ngSwitch]=\"previewTemplate\">\n <pb-builder-container *ngSwitchDefault [ngStyle]=\"getBuilderContainerStyles$ | async\">\n <ng-content select=\".rewrited-empty-email\"></ng-content>\n </pb-builder-container>\n\n <pb-preview-template fxLayout fxFlex=\"auto\" fxLayoutAlign=\"center\" [template]=\"currentHTMLTemplate$ | async\"\n *ngSwitchCase=\"true\">\n </pb-preview-template>\n </ng-container>\n </div>\n <mat-sidenav mode=\"side\" fxFlex=\"0 0 310px\" [opened]=\"!previewTemplate\" position=\"end\" class=\"pb-builder-content\">\n <mat-tab-group [selectedIndex]=\"currentTabIndex$ | async\" (selectedIndexChange)=\"changeTabIndex($event)\">\n <mat-tab i18n-label=\"Content\" label=\"Content\">\n <div class=\"main-padding\">\n <cdk-drop-list class=\"elements\" [cdkDropListConnectedTo]=\"cdkDropListConnectedTo$ | async\"\n [cdkDropListData]=\"blocks\" [cdkDropListSortingDisabled]=\"true\" id=\"block-elements\">\n <div cdkDrag *ngFor=\"let block of blocks; trackBy: trackByFn\" [cdkDragData]=\"block\"\n [cdkDragDisabled]=\"disableBlocksList$(block) | async\" class=\"drag-element\"\n [matTooltip]=\"block.state.message\">\n <mat-icon>{{ block.icon }}</mat-icon>\n <div class=\"drag-element-title\">{{ block.title }}</div>\n </div>\n </cdk-drop-list>\n\n <mat-divider style=\"margin: 1em 0;\"></mat-divider>\n <!-- <h3 class=\"divider\"><span>Structures</span></h3> -->\n <cdk-drop-list class=\"elements structure-elements\" cdkDropListConnectedTo=\"structures-drop-list\"\n [cdkDropListSortingDisabled]=\"true\" [cdkDropListData]=\"structures\">\n <div cdkDrag *ngFor=\"let structure of structures; trackBy: trackByFn\" [cdkDragData]=\"structure\"\n [cdkDragDisabled]=\"disableStructureList$(structure) | async\" class=\"drag-element structure-element\"\n [ngClass]=\"structure.type\">\n <div *ngFor=\"let column of createArrayFromStructureColumns(structure)\"></div>\n </div>\n </cdk-drop-list>\n <ng-content fxLayout fxLayoutGap=\"0.5rem\" select=\".after-structure-blocks\"></ng-content>\n </div>\n </mat-tab>\n <mat-tab i18n-label=\"Modules\" label=\"Modules\" class=\"modules-tab\">\n <cdk-virtual-scroll-viewport itemSize=\"54\" [minBufferPx]=\"54 * 10\" [maxBufferPx]=\"54 * 20\"\n style=\"height: inherit;\"\n *ngIf=\"customModuleList$ | async as modules; else emptyModuleList\">\n <div class=\"main-padding\">\n <div class=\"custom-modules\" cdkDropList cdkDropListConnectedTo=\"structures-drop-list\"\n [cdkDropListData]=\"modules\" [cdkDropListSortingDisabled]=\"true\">\n <div fxLayout=\"column\" fxLayoutGap=\"1rem\">\n <ng-container *cdkVirtualFor=\"let module of modules\">\n <div cdkDrag [cdkDragData]=\"module.module\"\n [cdkDragDisabled]=\"disableStructureList$(module.module) | async\" class=\"drag-element\"\n style=\"padding: 1em;text-transform: uppercase;height: 54px;\">\n <span *ngIf=\"module.name\">{{module.name}}</span>\n <!-- <img *ngIf=\"module.thumb\" [src]=\"module.thumb\" /> -->\n </div>\n </ng-container>\n </div>\n </div>\n <ng-content fxLayout fxLayoutGap=\"0.5rem\" select=\".after-content-blocks\"></ng-content>\n </div>\n </cdk-virtual-scroll-viewport>\n <ng-template #emptyModuleList>\n <h4 class=\"main-padding\" style=\"text-align: center;\" i18n=\"modules|empty list message\">\n Module list is empty\n </h4>\n </ng-template>\n </mat-tab>\n <mat-tab i18n-label=\"Settings\" label=\"Settings\">\n <div class=\"pb-builder-options\" [ngSwitch]=\"showGeneralSettings$ | async\">\n <pb-general-settings *ngSwitchDefault></pb-general-settings>\n <pb-block-settings *ngSwitchCase=\"'block'\"></pb-block-settings>\n <pb-structure-settings *ngSwitchCase=\"'structure'\" fxLayout=\"column\"></pb-structure-settings>\n </div>\n </mat-tab>\n </mat-tab-group>\n </mat-sidenav>\n</mat-sidenav-container>\n",
3181
+ template: "<!--\n ~ Copyright (c) 2024 Pobuca.\n ~ All rights reserved.\n -->\n\n<mat-sidenav-container>\n <div class=\"pb-builder-container\" fxLayout=\"column\" fxFlex>\n <mat-progress-bar *ngIf=\"activeMatProgress$ | async\" mode=\"buffer\"></mat-progress-bar>\n <mat-toolbar fxLayoutGap=\"1rem\" fxLayoutAlign=\"space-between center\">\n <ng-content fxLayout fxLayoutGap=\"0.5rem\" select=\".top-actions\"></ng-content>\n\n <div fxFlexlayout fxLayoutGap=\"0.5rem\">\n <button *ngIf=\"ngb.config.useSaveButton\" type=\"button\" (click)=\"saveEmail()\" mat-stroked-button color=\"primary\"\n i18n=\"actions|Save Email\">\n Save Email\n </button>\n <button *ngIf=\"ngb.config.usePreviewButton\" type=\"button\" (click)=\"togglePreview()\" mat-stroked-button>\n <ng-container [ngSwitch]=\"previewTemplate\">\n <span *ngSwitchDefault i18n=\"actions|Preview\">Preview</span>\n <span *ngSwitchCase=\"true\" i18n=\"actions|Close Preview\">Close Preview</span>\n </ng-container>\n </button>\n\n <button mat-button mat-stroked-button i18n=\"actions|Import\" (click)=\"importFile()\">\n Import\n </button>\n\n <ng-container *ngIf=\"ngb.config.useDownloadButton\">\n <button mat-button [matMenuTriggerFor]=\"downloadMenu\" mat-stroked-button i18n=\"actions|Export\">\n Export\n </button>\n <mat-menu #downloadMenu=\"matMenu\">\n <button mat-menu-item (click)=\"download('html')\" i18n=\"actions|Export HTML\">\n Export HTML\n </button>\n <button mat-menu-item (click)=\"download('mjml')\" i18n=\"actions|Export MJML\">\n Export MJML\n </button>\n <button mat-menu-item (click)=\"download('json')\" i18n=\"actions|Export JSON\">\n Export JSON\n </button>\n </mat-menu>\n </ng-container>\n\n </div>\n <div class=\"history-actions\">\n <button type=\"button\" mat-icon-button (click)=\"undo()\" [disabled]=\"!(canUndo$ | async)\"\n matTooltip=\"Undo (Ctrl+Z)\" i18n-matTooltip=\"actions|undo shortcut tooltip\"\n class=\"history-btn\">\n <mat-icon>undo</mat-icon>\n </button>\n <button type=\"button\" mat-icon-button (click)=\"redo()\" [disabled]=\"!(canRedo$ | async)\"\n matTooltip=\"Redo (Ctrl+Shift+Z)\" i18n-matTooltip=\"actions|redo shortcut tooltip\"\n class=\"history-btn\">\n <mat-icon>redo</mat-icon>\n </button>\n </div>\n </mat-toolbar>\n <ng-container [ngSwitch]=\"previewTemplate\">\n <pb-builder-container *ngSwitchDefault [ngStyle]=\"getBuilderContainerStyles$ | async\">\n <ng-content select=\".rewrited-empty-email\"></ng-content>\n </pb-builder-container>\n\n <pb-preview-template fxLayout fxFlex=\"auto\" fxLayoutAlign=\"center\" [template]=\"currentHTMLTemplate$ | async\"\n *ngSwitchCase=\"true\">\n </pb-preview-template>\n </ng-container>\n </div>\n <mat-sidenav mode=\"side\" fxFlex=\"0 0 310px\" [opened]=\"!previewTemplate\" position=\"end\" class=\"pb-builder-content\">\n <mat-tab-group [selectedIndex]=\"currentTabIndex$ | async\" (selectedIndexChange)=\"changeTabIndex($event)\">\n <mat-tab i18n-label=\"Content\" label=\"Content\">\n <div class=\"main-padding\">\n <cdk-drop-list class=\"elements\" [cdkDropListConnectedTo]=\"cdkDropListConnectedTo$ | async\"\n [cdkDropListData]=\"blocks\" [cdkDropListSortingDisabled]=\"true\" id=\"block-elements\">\n <div cdkDrag *ngFor=\"let block of blocks; trackBy: trackByFn\" [cdkDragData]=\"block\"\n [cdkDragDisabled]=\"disableBlocksList$(block) | async\" class=\"drag-element\"\n [matTooltip]=\"block.state.message\">\n <mat-icon>{{ block.icon }}</mat-icon>\n <div class=\"drag-element-title\">{{ block.title }}</div>\n </div>\n </cdk-drop-list>\n\n <mat-divider style=\"margin: 1em 0;\"></mat-divider>\n <!-- <h3 class=\"divider\"><span>Structures</span></h3> -->\n <cdk-drop-list class=\"elements structure-elements\" cdkDropListConnectedTo=\"structures-drop-list\"\n [cdkDropListSortingDisabled]=\"true\" [cdkDropListData]=\"structures\">\n <div cdkDrag *ngFor=\"let structure of structures; trackBy: trackByFn\" [cdkDragData]=\"structure\"\n [cdkDragDisabled]=\"disableStructureList$(structure) | async\" class=\"drag-element structure-element\"\n [ngClass]=\"structure.type\">\n <div *ngFor=\"let column of createArrayFromStructureColumns(structure)\"></div>\n </div>\n </cdk-drop-list>\n <ng-content fxLayout fxLayoutGap=\"0.5rem\" select=\".after-structure-blocks\"></ng-content>\n </div>\n </mat-tab>\n <mat-tab i18n-label=\"Modules\" label=\"Modules\" class=\"modules-tab\">\n <cdk-virtual-scroll-viewport itemSize=\"54\" [minBufferPx]=\"54 * 10\" [maxBufferPx]=\"54 * 20\"\n style=\"height: inherit;\"\n *ngIf=\"customModuleList$ | async as modules; else emptyModuleList\">\n <div class=\"main-padding\">\n <div class=\"custom-modules\" cdkDropList cdkDropListConnectedTo=\"structures-drop-list\"\n [cdkDropListData]=\"modules\" [cdkDropListSortingDisabled]=\"true\">\n <div fxLayout=\"column\" fxLayoutGap=\"1rem\">\n <ng-container *cdkVirtualFor=\"let module of modules\">\n <div cdkDrag [cdkDragData]=\"module.module\"\n [cdkDragDisabled]=\"disableStructureList$(module.module) | async\" class=\"drag-element\"\n style=\"padding: 1em;text-transform: uppercase;height: 54px;\">\n <span *ngIf=\"module.name\">{{module.name}}</span>\n <!-- <img *ngIf=\"module.thumb\" [src]=\"module.thumb\" /> -->\n </div>\n </ng-container>\n </div>\n </div>\n <ng-content fxLayout fxLayoutGap=\"0.5rem\" select=\".after-content-blocks\"></ng-content>\n </div>\n </cdk-virtual-scroll-viewport>\n <ng-template #emptyModuleList>\n <h4 class=\"main-padding\" style=\"text-align: center;\" i18n=\"modules|empty list message\">\n Module list is empty\n </h4>\n </ng-template>\n </mat-tab>\n <mat-tab i18n-label=\"Settings\" label=\"Settings\">\n <div class=\"pb-builder-options\" [ngSwitch]=\"showGeneralSettings$ | async\">\n <pb-general-settings *ngSwitchDefault></pb-general-settings>\n <pb-block-settings *ngSwitchCase=\"'block'\"></pb-block-settings>\n <pb-structure-settings *ngSwitchCase=\"'structure'\" fxLayout=\"column\"></pb-structure-settings>\n </div>\n </mat-tab>\n </mat-tab-group>\n </mat-sidenav>\n</mat-sidenav-container>\n",
2992
3182
  exportAs: 'pbEmailBuilder',
2993
3183
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
2994
3184
  providers: [
@@ -2999,7 +3189,7 @@
2999
3189
  },
3000
3190
  SlugifyPipe
3001
3191
  ],
3002
- styles: ["/*!\n * Copyright (c) 2024 Pobuca.\n * All rights reserved.\n */:host{display:block;height:100vh}.hide{display:none}::ng-deep mat-sidenav-container{height:100%}::ng-deep mat-sidenav-container mat-sidenav-content{width:100%;z-index:unset!important;overflow:unset!important}::ng-deep h3.divider{text-align:center;display:block;overflow:hidden;margin:0 0 1rem}::ng-deep h3.divider span{font-weight:100;position:relative;display:inline-block}::ng-deep h3.divider span:after,::ng-deep h3.divider span:before{content:\"\";position:absolute;top:50%;height:1px;background:#ccc;width:99999px}::ng-deep h3.divider span:before{left:100%;margin-left:10px}::ng-deep h3.divider span:after{right:100%;margin-right:10px}::ng-deep .pb-builder-content{border-right:1px solid rgba(0,0,0,.12)}::ng-deep .pb-builder-content .overflow{position:absolute;top:0;bottom:0;left:0;right:0;background-color:#fff;opacity:.5;display:none;z-index:3}::ng-deep .pb-builder-content.disabled .overflow{display:block}::ng-deep .pb-builder-content .mat-tab-label{width:50%;min-width:auto;height:64px;font-size:medium;text-transform:uppercase;padding:0 12px}::ng-deep .pb-builder-content .mat-tab-body-wrapper,::ng-deep .pb-builder-content .mat-tab-group{height:100%}::ng-deep .pb-builder-content .mat-tab-body-wrapper .mat-tab-body{padding:0}::ng-deep .pb-builder-content .mat-tab-body-wrapper .mat-tab-body .elements{display:grid;grid-gap:.5rem;margin-bottom:1rem;grid-template:repeat(2,1fr)/repeat(3,1fr)}::ng-deep .pb-builder-content .mat-tab-body-wrapper .mat-tab-body .elements.structure-elements{grid-template:repeat(4,1fr)/1fr}::ng-deep .pb-builder-content .mat-tab-body-wrapper .mat-tab-body .elements.cdk-drop-list-dragging .cdk-drag{transform:none!important}::ng-deep .pb-builder-content .mat-tab-body-wrapper .mat-tab-body input{height:auto;border:none}::ng-deep .pb-builder-content .mat-tab-body-wrapper .mat-tab-body .custom-modules .drag-element img{max-width:100%}::ng-deep .pb-builder-container{position:relative;height:100%}::ng-deep .pb-builder-container mat-progress-bar{position:absolute}::ng-deep .pb-builder-container mat-toolbar{background-color:#fff}::ng-deep .pb-builder-options .mat-expansion-panel{box-shadow:none!important}::ng-deep .pb-builder-options .mat-expansion-panel.mat-expanded{overflow:visible}::ng-deep .pb-builder-options mat-expansion-panel-header:not(.mat-expanded){background:rgba(0,0,0,.04)}::ng-deep .pb-builder-options ::ng-deep .group{display:grid;grid-template:auto/repeat(2,1fr);grid-gap:1rem}::ng-deep .pb-builder-options ::ng-deep .group>*{align-self:center}::ng-deep .pb-builder-options ::ng-deep .group+.group{margin-top:1em}::ng-deep .pb-builder-options ::ng-deep .group.four{grid-template-columns:repeat(4,1fr)}::ng-deep .pb-builder-options ::ng-deep .group.f-large{grid-template-columns:2fr 1fr}::ng-deep .pb-builder-options ::ng-deep .group.l-large{grid-template-columns:1fr 2fr}::ng-deep .pb-builder-options ::ng-deep .group.three{grid-template-columns:repeat(3,1fr)}::ng-deep .pb-builder-options ::ng-deep .group.three.f-small{grid-template-columns:1fr repeat(2,2fr)}::ng-deep .pb-builder-options ::ng-deep .group.three.f-large{grid-template-columns:2fr repeat(2,1fr)}::ng-deep .pb-builder-options ::ng-deep .group.three.l-large{grid-template-columns:repeat(2,1fr) 2fr}::ng-deep .pb-builder-options ::ng-deep .group .mat-form-field-infix{width:auto!important}::ng-deep .drag-element{text-align:center;border:1px solid #ccc;box-sizing:border-box;background:#fff;color:#7b7b7b;cursor:move;transition:box-shadow .3s ease-in-out;will-change:box-shadow;border-radius:3px}::ng-deep .drag-element.cdk-drag-disabled,::ng-deep .drag-element.cdk-drag-placeholder{cursor:not-allowed;opacity:.6}::ng-deep .drag-element:hover{box-shadow:0 3px 1px -2px rgba(0,0,0,.2),0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12)}::ng-deep .drag-element .mat-icon{font-size:40px!important;padding:.5rem;width:auto;height:auto}::ng-deep .drag-element img{max-width:100%}::ng-deep .drag-element-title{font-size:.9em;text-transform:uppercase;margin-bottom:.5rem}::ng-deep .drag-element.structure-element{height:60px;position:relative;padding:4px;display:grid;grid-template:1fr/1fr}::ng-deep .drag-element.structure-element>div{background:#ccc;border:4px solid #bbb}::ng-deep .drag-element.structure-element.cols_2{grid-template-columns:repeat(2,5fr)}::ng-deep .drag-element.structure-element.cols_3{grid-template-columns:repeat(3,3.33fr)}::ng-deep .drag-element.structure-element.cols_4{grid-template-columns:repeat(4,2.5fr)}::ng-deep .drag-element.structure-element.cols_12{grid-template-columns:6fr 4fr}::ng-deep .drag-element.structure-element.cols_21{grid-template-columns:4fr 6fr}::ng-deep .main-padding{padding:1rem}::ng-deep .cdk-drop-list-receiving>:not(.cdk-drag){opacity:.6}::ng-deep .cdk-drop-list-dragging>*{pointer-events:none}@keyframes drag-animation{0%{opacity:0;height:0}to{opacity:1}}::ng-deep .cdk-drag-animating{animation:drag-animation 1s cubic-bezier(0,0,.2,1) infinite}::ng-deep .cdk-drag-preview{border-radius:4px;box-shadow:0 0 0 2px rgba(63,81,181,.5);min-height:60px;min-width:100px;background-color:#fff}::ng-deep .cdk-drag.structure-element.cdk-drag-placeholder{box-shadow:0 0 1px 2px #ff4081;width:100%;pointer-events:none}"]
3192
+ styles: ["/*!\n * Copyright (c) 2024 Pobuca.\n * All rights reserved.\n */:host{display:block;height:100vh}.hide{display:none}::ng-deep mat-sidenav-container{height:100%}::ng-deep mat-sidenav-container mat-sidenav-content{width:100%;z-index:unset!important;overflow:unset!important}::ng-deep h3.divider{text-align:center;display:block;overflow:hidden;margin:0 0 1rem}::ng-deep h3.divider span{font-weight:100;position:relative;display:inline-block}::ng-deep h3.divider span:after,::ng-deep h3.divider span:before{content:\"\";position:absolute;top:50%;height:1px;background:#ccc;width:99999px}::ng-deep h3.divider span:before{left:100%;margin-left:10px}::ng-deep h3.divider span:after{right:100%;margin-right:10px}::ng-deep .pb-builder-content{border-right:1px solid rgba(0,0,0,.12)}::ng-deep .pb-builder-content .overflow{position:absolute;top:0;bottom:0;left:0;right:0;background-color:#fff;opacity:.5;display:none;z-index:3}::ng-deep .pb-builder-content.disabled .overflow{display:block}::ng-deep .pb-builder-content .mat-tab-label{width:50%;min-width:auto;height:64px;font-size:medium;text-transform:uppercase;padding:0 12px}::ng-deep .pb-builder-content .mat-tab-body-wrapper,::ng-deep .pb-builder-content .mat-tab-group{height:100%}::ng-deep .pb-builder-content .mat-tab-body-wrapper .mat-tab-body{padding:0}::ng-deep .pb-builder-content .mat-tab-body-wrapper .mat-tab-body .elements{display:grid;grid-gap:.5rem;margin-bottom:1rem;grid-template:repeat(2,1fr)/repeat(3,1fr)}::ng-deep .pb-builder-content .mat-tab-body-wrapper .mat-tab-body .elements.structure-elements{grid-template:repeat(4,1fr)/1fr}::ng-deep .pb-builder-content .mat-tab-body-wrapper .mat-tab-body .elements.cdk-drop-list-dragging .cdk-drag{transform:none!important}::ng-deep .pb-builder-content .mat-tab-body-wrapper .mat-tab-body input{height:auto;border:none}::ng-deep .pb-builder-content .mat-tab-body-wrapper .mat-tab-body .custom-modules .drag-element img{max-width:100%}::ng-deep .pb-builder-container{position:relative;height:100%}::ng-deep .pb-builder-container mat-progress-bar{position:absolute}::ng-deep .pb-builder-container mat-toolbar{background-color:#fff}::ng-deep .pb-builder-options .mat-expansion-panel{box-shadow:none!important}::ng-deep .pb-builder-options .mat-expansion-panel.mat-expanded{overflow:visible}::ng-deep .pb-builder-options mat-expansion-panel-header:not(.mat-expanded){background:rgba(0,0,0,.04)}::ng-deep .pb-builder-options ::ng-deep .group{display:grid;grid-template:auto/repeat(2,1fr);grid-gap:1rem}::ng-deep .pb-builder-options ::ng-deep .group>*{align-self:center}::ng-deep .pb-builder-options ::ng-deep .group+.group{margin-top:1em}::ng-deep .pb-builder-options ::ng-deep .group.four{grid-template-columns:repeat(4,1fr)}::ng-deep .pb-builder-options ::ng-deep .group.f-large{grid-template-columns:2fr 1fr}::ng-deep .pb-builder-options ::ng-deep .group.l-large{grid-template-columns:1fr 2fr}::ng-deep .pb-builder-options ::ng-deep .group.three{grid-template-columns:repeat(3,1fr)}::ng-deep .pb-builder-options ::ng-deep .group.three.f-small{grid-template-columns:1fr repeat(2,2fr)}::ng-deep .pb-builder-options ::ng-deep .group.three.f-large{grid-template-columns:2fr repeat(2,1fr)}::ng-deep .pb-builder-options ::ng-deep .group.three.l-large{grid-template-columns:repeat(2,1fr) 2fr}::ng-deep .pb-builder-options ::ng-deep .group .mat-form-field-infix{width:auto!important}::ng-deep .drag-element{text-align:center;border:1px solid #ccc;box-sizing:border-box;background:#fff;color:#7b7b7b;cursor:move;transition:box-shadow .3s ease-in-out;will-change:box-shadow;border-radius:3px}::ng-deep .drag-element.cdk-drag-disabled,::ng-deep .drag-element.cdk-drag-placeholder{cursor:not-allowed;opacity:.6}::ng-deep .drag-element:hover{box-shadow:0 3px 1px -2px rgba(0,0,0,.2),0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12)}::ng-deep .drag-element .mat-icon{font-size:40px!important;padding:.5rem;width:auto;height:auto}::ng-deep .drag-element img{max-width:100%}::ng-deep .drag-element-title{font-size:.9em;text-transform:uppercase;margin-bottom:.5rem}::ng-deep .drag-element.structure-element{height:60px;position:relative;padding:4px;display:grid;grid-template:1fr/1fr}::ng-deep .drag-element.structure-element>div{background:#ccc;border:4px solid #bbb}::ng-deep .drag-element.structure-element.cols_2{grid-template-columns:repeat(2,5fr)}::ng-deep .drag-element.structure-element.cols_3{grid-template-columns:repeat(3,3.33fr)}::ng-deep .drag-element.structure-element.cols_4{grid-template-columns:repeat(4,2.5fr)}::ng-deep .drag-element.structure-element.cols_12{grid-template-columns:6fr 4fr}::ng-deep .drag-element.structure-element.cols_21{grid-template-columns:4fr 6fr}::ng-deep .main-padding{padding:1rem}::ng-deep .history-actions{margin-inline-start:auto;display:flex;gap:.5rem;align-items:center}::ng-deep .history-actions .history-btn{transition:all .2s ease-in-out;color:rgba(0,0,0,.54)}::ng-deep .history-actions .history-btn:hover:not([disabled]){background-color:rgba(0,0,0,.08);border-radius:4px;color:rgba(0,0,0,.87)}::ng-deep .history-actions .history-btn[disabled]{opacity:.38}::ng-deep .cdk-drop-list-receiving>:not(.cdk-drag){opacity:.6}::ng-deep .cdk-drop-list-dragging>*{pointer-events:none}@keyframes drag-animation{0%{opacity:0;height:0}to{opacity:1}}::ng-deep .cdk-drag-animating{animation:drag-animation 1s cubic-bezier(0,0,.2,1) infinite}::ng-deep .cdk-drag-preview{border-radius:4px;box-shadow:0 0 0 2px rgba(63,81,181,.5);min-height:60px;min-width:100px;background-color:#fff}::ng-deep .cdk-drag.structure-element.cdk-drag-placeholder{box-shadow:0 0 1px 2px #ff4081;width:100%;pointer-events:none}"]
3003
3193
  },] }
3004
3194
  ];
3005
3195
  PbEmailBuilderComponent.ctorParameters = function () { return [
@@ -5126,45 +5316,46 @@
5126
5316
  exports.isEqual = isEqual;
5127
5317
  exports["ɵ0"] = ɵ0;
5128
5318
  exports["ɵa"] = PbEmailObjectStoreService;
5129
- exports["ɵb"] = PbUserInterfaceService;
5130
- exports["ɵba"] = AlignComponent;
5131
- exports["ɵbb"] = DirectionComponent;
5132
- exports["ɵbc"] = BackRepatComponent;
5133
- exports["ɵbd"] = ConfirmDialogComponent;
5134
- exports["ɵbe"] = ImageUploadComponent;
5135
- exports["ɵbf"] = BlockSettingsComponent;
5136
- exports["ɵbg"] = StructureSettingsComponent;
5137
- exports["ɵbh"] = GeneralSettingsComponent;
5138
- exports["ɵbi"] = UploadBottomSheetDialogComponent;
5139
- exports["ɵbj"] = UploadImageGalleryComponent;
5140
- exports["ɵbk"] = TemplateListDialogComponent;
5141
- exports["ɵbl"] = ImportDialogComponent;
5142
- exports["ɵbm"] = IpInterceptorInterceptor;
5143
- exports["ɵbn"] = LIBRARY_IS_PRO;
5144
- exports["ɵc"] = FreeUsersRestApi;
5145
- exports["ɵd"] = FreeUsersPbStorage;
5146
- exports["ɵe"] = StructureComponent;
5147
- exports["ɵf"] = BlockComponent;
5148
- exports["ɵg"] = DynamicComponentDirective;
5149
- exports["ɵh"] = TextElementComponent;
5150
- exports["ɵi"] = AbstractBlock;
5151
- exports["ɵj"] = ImageComponent;
5152
- exports["ɵk"] = VideoComponent;
5153
- exports["ɵl"] = VideoThumbnailService;
5154
- exports["ɵm"] = ButtonComponent;
5155
- exports["ɵn"] = DividerComponent;
5156
- exports["ɵo"] = SpacerComponent;
5157
- exports["ɵp"] = SocialComponent;
5158
- exports["ɵq"] = BuilderContainerComponent;
5159
- exports["ɵr"] = FontStylesComponent;
5160
- exports["ɵs"] = PaddingComponent;
5161
- exports["ɵt"] = MarginComponent;
5162
- exports["ɵu"] = GapsComponent;
5163
- exports["ɵv"] = LineHeightComponent;
5164
- exports["ɵw"] = WidthHeightComponent;
5165
- exports["ɵx"] = BorderComponent;
5166
- exports["ɵy"] = ColorComponent;
5167
- exports["ɵz"] = LinkComponent;
5319
+ exports["ɵb"] = IpHistoryService;
5320
+ exports["ɵba"] = LinkComponent;
5321
+ exports["ɵbb"] = AlignComponent;
5322
+ exports["ɵbc"] = DirectionComponent;
5323
+ exports["ɵbd"] = BackRepatComponent;
5324
+ exports["ɵbe"] = ConfirmDialogComponent;
5325
+ exports["ɵbf"] = ImageUploadComponent;
5326
+ exports["ɵbg"] = BlockSettingsComponent;
5327
+ exports["ɵbh"] = StructureSettingsComponent;
5328
+ exports["ɵbi"] = GeneralSettingsComponent;
5329
+ exports["ɵbj"] = UploadBottomSheetDialogComponent;
5330
+ exports["ɵbk"] = UploadImageGalleryComponent;
5331
+ exports["ɵbl"] = TemplateListDialogComponent;
5332
+ exports["ɵbm"] = ImportDialogComponent;
5333
+ exports["ɵbn"] = IpInterceptorInterceptor;
5334
+ exports["ɵbo"] = LIBRARY_IS_PRO;
5335
+ exports["ɵc"] = PbUserInterfaceService;
5336
+ exports["ɵd"] = FreeUsersRestApi;
5337
+ exports["ɵe"] = FreeUsersPbStorage;
5338
+ exports["ɵf"] = StructureComponent;
5339
+ exports["ɵg"] = BlockComponent;
5340
+ exports["ɵh"] = DynamicComponentDirective;
5341
+ exports["ɵi"] = TextElementComponent;
5342
+ exports["ɵj"] = AbstractBlock;
5343
+ exports["ɵk"] = ImageComponent;
5344
+ exports["ɵl"] = VideoComponent;
5345
+ exports["ɵm"] = VideoThumbnailService;
5346
+ exports["ɵn"] = ButtonComponent;
5347
+ exports["ɵo"] = DividerComponent;
5348
+ exports["ɵp"] = SpacerComponent;
5349
+ exports["ɵq"] = SocialComponent;
5350
+ exports["ɵr"] = BuilderContainerComponent;
5351
+ exports["ɵs"] = FontStylesComponent;
5352
+ exports["ɵt"] = PaddingComponent;
5353
+ exports["ɵu"] = MarginComponent;
5354
+ exports["ɵv"] = GapsComponent;
5355
+ exports["ɵw"] = LineHeightComponent;
5356
+ exports["ɵx"] = WidthHeightComponent;
5357
+ exports["ɵy"] = BorderComponent;
5358
+ exports["ɵz"] = ColorComponent;
5168
5359
 
5169
5360
  Object.defineProperty(exports, '__esModule', { value: true });
5170
5361