@pobuca/email-builder 1.2.1 → 1.3.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/bundles/pobuca-email-builder.umd.js +275 -43
- package/bundles/pobuca-email-builder.umd.js.map +1 -1
- package/bundles/pobuca-email-builder.umd.min.js +1 -1
- package/bundles/pobuca-email-builder.umd.min.js.map +1 -1
- package/esm2015/lib/pb-email-builder.component.js +46 -3
- package/esm2015/lib/services/internals/pb-email-object-store/pb-email-object-store.service.js +45 -4
- package/esm2015/lib/services/internals/pb-history/pb-history.service.js +154 -0
- package/esm2015/pobuca-email-builder.js +41 -40
- package/fesm2015/pobuca-email-builder.js +235 -5
- package/fesm2015/pobuca-email-builder.js.map +1 -1
- package/lib/pb-email-builder.component.d.ts +10 -0
- package/lib/services/internals/pb-email-object-store/pb-email-object-store.service.d.ts +15 -1
- package/lib/services/internals/pb-history/pb-history.service.d.ts +51 -0
- package/package.json +1 -1
- package/pobuca-email-builder.d.ts +40 -39
- package/pobuca-email-builder.metadata.json +1 -1
|
@@ -1696,16 +1696,166 @@
|
|
|
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 HISTORY;
|
|
1707
|
+
(function (HISTORY) {
|
|
1708
|
+
HISTORY["KEY"] = "[NGB] history stack";
|
|
1709
|
+
})(HISTORY || (HISTORY = {}));
|
|
1710
|
+
/**
|
|
1711
|
+
* @internal
|
|
1712
|
+
*/
|
|
1713
|
+
var IpHistoryService = /** @class */ (function () {
|
|
1714
|
+
function IpHistoryService(storage) {
|
|
1715
|
+
this.storage = storage;
|
|
1716
|
+
this.historyStack = [];
|
|
1717
|
+
this.currentIndex = -1;
|
|
1718
|
+
this.maxHistorySize = 50; // Maximum undo steps
|
|
1719
|
+
this._canUndo$ = new rxjs.BehaviorSubject(false);
|
|
1720
|
+
this._canRedo$ = new rxjs.BehaviorSubject(false);
|
|
1721
|
+
this.canUndo$ = this._canUndo$.asObservable();
|
|
1722
|
+
this.canRedo$ = this._canRedo$.asObservable();
|
|
1723
|
+
this.loadFromStorage();
|
|
1724
|
+
}
|
|
1725
|
+
/**
|
|
1726
|
+
* Add a new state to the history stack
|
|
1727
|
+
*/
|
|
1728
|
+
IpHistoryService.prototype.addState = function (state) {
|
|
1729
|
+
if (!state) {
|
|
1730
|
+
return;
|
|
1731
|
+
}
|
|
1732
|
+
var clonedState = cloneDeep(state);
|
|
1733
|
+
// If we're not at the end of the stack, remove all states after current index
|
|
1734
|
+
// This happens when user undoes and then makes a new change
|
|
1735
|
+
if (this.currentIndex < this.historyStack.length - 1) {
|
|
1736
|
+
this.historyStack = this.historyStack.slice(0, this.currentIndex + 1);
|
|
1737
|
+
}
|
|
1738
|
+
// Add the new state
|
|
1739
|
+
this.historyStack.push(clonedState);
|
|
1740
|
+
this.currentIndex++;
|
|
1741
|
+
// Limit history size to prevent memory issues
|
|
1742
|
+
if (this.historyStack.length > this.maxHistorySize) {
|
|
1743
|
+
this.historyStack.shift();
|
|
1744
|
+
this.currentIndex--;
|
|
1745
|
+
}
|
|
1746
|
+
this.updateUndoRedoStatus();
|
|
1747
|
+
this.saveToStorage();
|
|
1748
|
+
};
|
|
1749
|
+
/**
|
|
1750
|
+
* Get the previous state (undo)
|
|
1751
|
+
*/
|
|
1752
|
+
IpHistoryService.prototype.undo = function () {
|
|
1753
|
+
if (!this.canUndoNow()) {
|
|
1754
|
+
return null;
|
|
1755
|
+
}
|
|
1756
|
+
this.currentIndex--;
|
|
1757
|
+
this.updateUndoRedoStatus();
|
|
1758
|
+
return cloneDeep(this.historyStack[this.currentIndex]);
|
|
1759
|
+
};
|
|
1760
|
+
/**
|
|
1761
|
+
* Get the next state (redo)
|
|
1762
|
+
*/
|
|
1763
|
+
IpHistoryService.prototype.redo = function () {
|
|
1764
|
+
if (!this.canRedoNow()) {
|
|
1765
|
+
return null;
|
|
1766
|
+
}
|
|
1767
|
+
this.currentIndex++;
|
|
1768
|
+
this.updateUndoRedoStatus();
|
|
1769
|
+
return cloneDeep(this.historyStack[this.currentIndex]);
|
|
1770
|
+
};
|
|
1771
|
+
/**
|
|
1772
|
+
* Check if undo is available (synchronous)
|
|
1773
|
+
*/
|
|
1774
|
+
IpHistoryService.prototype.canUndoNow = function () {
|
|
1775
|
+
return this.currentIndex > 0;
|
|
1776
|
+
};
|
|
1777
|
+
/**
|
|
1778
|
+
* Check if redo is available (synchronous)
|
|
1779
|
+
*/
|
|
1780
|
+
IpHistoryService.prototype.canRedoNow = function () {
|
|
1781
|
+
return this.currentIndex < this.historyStack.length - 1;
|
|
1782
|
+
};
|
|
1783
|
+
/**
|
|
1784
|
+
* Clear history
|
|
1785
|
+
*/
|
|
1786
|
+
IpHistoryService.prototype.clear = function () {
|
|
1787
|
+
this.historyStack = [];
|
|
1788
|
+
this.currentIndex = -1;
|
|
1789
|
+
this.updateUndoRedoStatus();
|
|
1790
|
+
this.storage.removeItem(HISTORY.KEY);
|
|
1791
|
+
};
|
|
1792
|
+
/**
|
|
1793
|
+
* Get the history size
|
|
1794
|
+
*/
|
|
1795
|
+
IpHistoryService.prototype.getHistorySize = function () {
|
|
1796
|
+
return this.historyStack.length;
|
|
1797
|
+
};
|
|
1798
|
+
/**
|
|
1799
|
+
* Get current position in history stack
|
|
1800
|
+
*/
|
|
1801
|
+
IpHistoryService.prototype.getCurrentIndex = function () {
|
|
1802
|
+
return this.currentIndex;
|
|
1803
|
+
};
|
|
1804
|
+
IpHistoryService.prototype.updateUndoRedoStatus = function () {
|
|
1805
|
+
this._canUndo$.next(this.canUndoNow());
|
|
1806
|
+
this._canRedo$.next(this.canRedoNow());
|
|
1807
|
+
};
|
|
1808
|
+
IpHistoryService.prototype.saveToStorage = function () {
|
|
1809
|
+
try {
|
|
1810
|
+
var data = {
|
|
1811
|
+
stack: this.historyStack,
|
|
1812
|
+
currentIndex: this.currentIndex
|
|
1813
|
+
};
|
|
1814
|
+
this.storage.setItem(HISTORY.KEY, JSON.stringify(data));
|
|
1815
|
+
}
|
|
1816
|
+
catch (error) {
|
|
1817
|
+
console.warn('[IpHistoryService] Failed to save history to storage:', error);
|
|
1818
|
+
}
|
|
1819
|
+
};
|
|
1820
|
+
IpHistoryService.prototype.loadFromStorage = function () {
|
|
1821
|
+
var _a;
|
|
1822
|
+
try {
|
|
1823
|
+
var data = this.storage.getItem(HISTORY.KEY);
|
|
1824
|
+
if (data) {
|
|
1825
|
+
var parsed = JSON.parse(data);
|
|
1826
|
+
this.historyStack = parsed.stack || [];
|
|
1827
|
+
this.currentIndex = (_a = parsed.currentIndex) !== null && _a !== void 0 ? _a : -1;
|
|
1828
|
+
this.updateUndoRedoStatus();
|
|
1829
|
+
}
|
|
1830
|
+
}
|
|
1831
|
+
catch (error) {
|
|
1832
|
+
console.warn('[IpHistoryService] Failed to load history from storage:', error);
|
|
1833
|
+
this.clear();
|
|
1834
|
+
}
|
|
1835
|
+
};
|
|
1836
|
+
return IpHistoryService;
|
|
1837
|
+
}());
|
|
1838
|
+
IpHistoryService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function IpHistoryService_Factory() { return new IpHistoryService(i0__namespace.ɵɵinject(PB_STORAGE_FACTORY)); }, token: IpHistoryService, providedIn: "any" });
|
|
1839
|
+
IpHistoryService.decorators = [
|
|
1840
|
+
{ type: i0.Injectable, args: [{
|
|
1841
|
+
providedIn: 'any'
|
|
1842
|
+
},] }
|
|
1843
|
+
];
|
|
1844
|
+
IpHistoryService.ctorParameters = function () { return [
|
|
1845
|
+
{ type: Storage, decorators: [{ type: i0.Inject, args: [PB_STORAGE_FACTORY,] }] }
|
|
1846
|
+
]; };
|
|
1847
|
+
|
|
1699
1848
|
// https://www.npmjs.com/package/recursive-diff
|
|
1700
1849
|
/**
|
|
1701
1850
|
* @internal
|
|
1702
1851
|
*/
|
|
1703
1852
|
var PbEmailObjectStoreService = /** @class */ (function () {
|
|
1704
|
-
function PbEmailObjectStoreService(userRestApi, pbStorage, userMiddleware, googleFonts, config) {
|
|
1853
|
+
function PbEmailObjectStoreService(userRestApi, pbStorage, userMiddleware, history, googleFonts, config) {
|
|
1705
1854
|
var _this = this;
|
|
1706
1855
|
this.userRestApi = userRestApi;
|
|
1707
1856
|
this.pbStorage = pbStorage;
|
|
1708
1857
|
this.userMiddleware = userMiddleware;
|
|
1858
|
+
this.history = history;
|
|
1709
1859
|
this.googleFonts = googleFonts;
|
|
1710
1860
|
this.config = config;
|
|
1711
1861
|
this.Email = new PBEmail();
|
|
@@ -1732,6 +1882,9 @@
|
|
|
1732
1882
|
var _d = __read(_c), _ = _d[0], rest = _d.slice(1);
|
|
1733
1883
|
return rest;
|
|
1734
1884
|
}));
|
|
1885
|
+
// History/Undo support
|
|
1886
|
+
this.canUndo$ = this.history.canUndo$;
|
|
1887
|
+
this.canRedo$ = this.history.canRedo$;
|
|
1735
1888
|
}
|
|
1736
1889
|
Object.defineProperty(PbEmailObjectStoreService.prototype, "defaultTemplateThumbPath", {
|
|
1737
1890
|
get: function () {
|
|
@@ -1785,6 +1938,8 @@
|
|
|
1785
1938
|
};
|
|
1786
1939
|
PbEmailObjectStoreService.prototype.markForCheck = function () {
|
|
1787
1940
|
this._Email$.next(this.Email);
|
|
1941
|
+
// Add to undo/redo history
|
|
1942
|
+
this.history.addState(this.Email);
|
|
1788
1943
|
if (this.Email.structures.length) {
|
|
1789
1944
|
this.pbStorage.addTemplateToLatestUsed(cloneDeep({
|
|
1790
1945
|
templateData: this.Email,
|
|
@@ -1864,9 +2019,41 @@
|
|
|
1864
2019
|
this.clonedEmail = cloneDeep(this.Email);
|
|
1865
2020
|
this.markForCheck();
|
|
1866
2021
|
};
|
|
2022
|
+
/**
|
|
2023
|
+
* Undo the last change
|
|
2024
|
+
* @returns true if undo was successful, false if undo is not available
|
|
2025
|
+
*/
|
|
2026
|
+
PbEmailObjectStoreService.prototype.undo = function () {
|
|
2027
|
+
var previousState = this.history.undo();
|
|
2028
|
+
if (previousState) {
|
|
2029
|
+
this.Email = previousState;
|
|
2030
|
+
this._Email$.next(this.Email);
|
|
2031
|
+
// Reset template to force re-generation on next save
|
|
2032
|
+
this._Template$.next(null);
|
|
2033
|
+
this._Mjml$.next(null);
|
|
2034
|
+
return true;
|
|
2035
|
+
}
|
|
2036
|
+
return false;
|
|
2037
|
+
};
|
|
2038
|
+
/**
|
|
2039
|
+
* Redo the last undone change
|
|
2040
|
+
* @returns true if redo was successful, false if redo is not available
|
|
2041
|
+
*/
|
|
2042
|
+
PbEmailObjectStoreService.prototype.redo = function () {
|
|
2043
|
+
var nextState = this.history.redo();
|
|
2044
|
+
if (nextState) {
|
|
2045
|
+
this.Email = nextState;
|
|
2046
|
+
this._Email$.next(this.Email);
|
|
2047
|
+
// Reset template to force re-generation on next save
|
|
2048
|
+
this._Template$.next(null);
|
|
2049
|
+
this._Mjml$.next(null);
|
|
2050
|
+
return true;
|
|
2051
|
+
}
|
|
2052
|
+
return false;
|
|
2053
|
+
};
|
|
1867
2054
|
return PbEmailObjectStoreService;
|
|
1868
2055
|
}());
|
|
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" });
|
|
2056
|
+
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
2057
|
PbEmailObjectStoreService.decorators = [
|
|
1871
2058
|
{ type: i0.Injectable, args: [{
|
|
1872
2059
|
providedIn: 'root'
|
|
@@ -1876,6 +2063,7 @@
|
|
|
1876
2063
|
{ type: PbUserRestApiService },
|
|
1877
2064
|
{ type: PbStorageService },
|
|
1878
2065
|
{ type: PbUserMiddlewaresService },
|
|
2066
|
+
{ type: IpHistoryService },
|
|
1879
2067
|
{ type: Array, decorators: [{ type: i0.Inject, args: [PB_GOOGLE_FONTS,] }] },
|
|
1880
2068
|
{ type: undefined, decorators: [{ type: i0.Inject, args: [PB_CONFIG,] }] }
|
|
1881
2069
|
]; };
|
|
@@ -2775,6 +2963,9 @@
|
|
|
2775
2963
|
this.currentHTMLTemplate$ = this.emailObjectStore.templateAsObservable$;
|
|
2776
2964
|
this.activeMatProgress$ = this.userInterfaceService.activeMatProgress$.asObservable();
|
|
2777
2965
|
this.customModuleList$ = this.userRestApiService.getAllUserModules$;
|
|
2966
|
+
// Undo/Redo support
|
|
2967
|
+
this.canUndo$ = this.emailObjectStore.canUndo$;
|
|
2968
|
+
this.canRedo$ = this.emailObjectStore.canRedo$;
|
|
2778
2969
|
this._onDestroy$ = new rxjs.Subject();
|
|
2779
2970
|
this.includedFonts = new Set();
|
|
2780
2971
|
if (this.doc) {
|
|
@@ -2839,6 +3030,22 @@
|
|
|
2839
3030
|
PbEmailBuilderComponent.prototype.disableStructureList$ = function (structure) {
|
|
2840
3031
|
return this.middlewares.disableStructureDragFromList(structure).pipe(operators.take(1));
|
|
2841
3032
|
};
|
|
3033
|
+
/**
|
|
3034
|
+
* Undo the last action
|
|
3035
|
+
*/
|
|
3036
|
+
PbEmailBuilderComponent.prototype.undo = function () {
|
|
3037
|
+
if (this.emailObjectStore.undo()) {
|
|
3038
|
+
this.userInterfaceService.notify('Undo applied', 'short');
|
|
3039
|
+
}
|
|
3040
|
+
};
|
|
3041
|
+
/**
|
|
3042
|
+
* Redo the last undone action
|
|
3043
|
+
*/
|
|
3044
|
+
PbEmailBuilderComponent.prototype.redo = function () {
|
|
3045
|
+
if (this.emailObjectStore.redo()) {
|
|
3046
|
+
this.userInterfaceService.notify('Redo applied', 'short');
|
|
3047
|
+
}
|
|
3048
|
+
};
|
|
2842
3049
|
PbEmailBuilderComponent.prototype.trackByFn = function (block) {
|
|
2843
3050
|
return block.type;
|
|
2844
3051
|
};
|
|
@@ -2958,6 +3165,30 @@
|
|
|
2958
3165
|
});
|
|
2959
3166
|
}
|
|
2960
3167
|
});
|
|
3168
|
+
// Keyboard shortcuts for Undo (Ctrl+Z) and Redo (Ctrl+Shift+Z)
|
|
3169
|
+
rxjs.fromEvent(this.doc, 'keydown')
|
|
3170
|
+
.pipe(operators.filter(function (event) {
|
|
3171
|
+
// Check if Ctrl (or Cmd on Mac) is pressed
|
|
3172
|
+
var isCtrlOrCmd = event.ctrlKey || event.metaKey;
|
|
3173
|
+
// Check if we're in a focusable element like input/textarea
|
|
3174
|
+
var isFocusable = event.target instanceof HTMLInputElement ||
|
|
3175
|
+
event.target instanceof HTMLTextAreaElement;
|
|
3176
|
+
return isCtrlOrCmd && !isFocusable;
|
|
3177
|
+
}), operators.takeUntil(this._onDestroy$))
|
|
3178
|
+
.subscribe(function (event) {
|
|
3179
|
+
if (event.key === 'z' || event.key === 'Z') {
|
|
3180
|
+
// Undo: Ctrl+Z
|
|
3181
|
+
if (!event.shiftKey) {
|
|
3182
|
+
event.preventDefault();
|
|
3183
|
+
_this.undo();
|
|
3184
|
+
}
|
|
3185
|
+
// Redo: Ctrl+Shift+Z
|
|
3186
|
+
else if (event.shiftKey) {
|
|
3187
|
+
event.preventDefault();
|
|
3188
|
+
_this.redo();
|
|
3189
|
+
}
|
|
3190
|
+
}
|
|
3191
|
+
});
|
|
2961
3192
|
};
|
|
2962
3193
|
PbEmailBuilderComponent.prototype.ngOnChanges = function (changes) {
|
|
2963
3194
|
if (changes.email) {
|
|
@@ -2988,7 +3219,7 @@
|
|
|
2988
3219
|
PbEmailBuilderComponent.decorators = [
|
|
2989
3220
|
{ type: i0.Component, args: [{
|
|
2990
3221
|
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
|
|
3222
|
+
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
3223
|
exportAs: 'pbEmailBuilder',
|
|
2993
3224
|
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
2994
3225
|
providers: [
|
|
@@ -2999,7 +3230,7 @@
|
|
|
2999
3230
|
},
|
|
3000
3231
|
SlugifyPipe
|
|
3001
3232
|
],
|
|
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}"]
|
|
3233
|
+
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
3234
|
},] }
|
|
3004
3235
|
];
|
|
3005
3236
|
PbEmailBuilderComponent.ctorParameters = function () { return [
|
|
@@ -5126,45 +5357,46 @@
|
|
|
5126
5357
|
exports.isEqual = isEqual;
|
|
5127
5358
|
exports["ɵ0"] = ɵ0;
|
|
5128
5359
|
exports["ɵa"] = PbEmailObjectStoreService;
|
|
5129
|
-
exports["ɵb"] =
|
|
5130
|
-
exports["ɵba"] =
|
|
5131
|
-
exports["ɵbb"] =
|
|
5132
|
-
exports["ɵbc"] =
|
|
5133
|
-
exports["ɵbd"] =
|
|
5134
|
-
exports["ɵbe"] =
|
|
5135
|
-
exports["ɵbf"] =
|
|
5136
|
-
exports["ɵbg"] =
|
|
5137
|
-
exports["ɵbh"] =
|
|
5138
|
-
exports["ɵbi"] =
|
|
5139
|
-
exports["ɵbj"] =
|
|
5140
|
-
exports["ɵbk"] =
|
|
5141
|
-
exports["ɵbl"] =
|
|
5142
|
-
exports["ɵbm"] =
|
|
5143
|
-
exports["ɵbn"] =
|
|
5144
|
-
exports["
|
|
5145
|
-
exports["
|
|
5146
|
-
exports["
|
|
5147
|
-
exports["
|
|
5148
|
-
exports["
|
|
5149
|
-
exports["
|
|
5150
|
-
exports["
|
|
5151
|
-
exports["
|
|
5152
|
-
exports["
|
|
5153
|
-
exports["
|
|
5154
|
-
exports["
|
|
5155
|
-
exports["
|
|
5156
|
-
exports["
|
|
5157
|
-
exports["
|
|
5158
|
-
exports["
|
|
5159
|
-
exports["
|
|
5160
|
-
exports["
|
|
5161
|
-
exports["
|
|
5162
|
-
exports["
|
|
5163
|
-
exports["
|
|
5164
|
-
exports["
|
|
5165
|
-
exports["
|
|
5166
|
-
exports["
|
|
5167
|
-
exports["
|
|
5360
|
+
exports["ɵb"] = IpHistoryService;
|
|
5361
|
+
exports["ɵba"] = LinkComponent;
|
|
5362
|
+
exports["ɵbb"] = AlignComponent;
|
|
5363
|
+
exports["ɵbc"] = DirectionComponent;
|
|
5364
|
+
exports["ɵbd"] = BackRepatComponent;
|
|
5365
|
+
exports["ɵbe"] = ConfirmDialogComponent;
|
|
5366
|
+
exports["ɵbf"] = ImageUploadComponent;
|
|
5367
|
+
exports["ɵbg"] = BlockSettingsComponent;
|
|
5368
|
+
exports["ɵbh"] = StructureSettingsComponent;
|
|
5369
|
+
exports["ɵbi"] = GeneralSettingsComponent;
|
|
5370
|
+
exports["ɵbj"] = UploadBottomSheetDialogComponent;
|
|
5371
|
+
exports["ɵbk"] = UploadImageGalleryComponent;
|
|
5372
|
+
exports["ɵbl"] = TemplateListDialogComponent;
|
|
5373
|
+
exports["ɵbm"] = ImportDialogComponent;
|
|
5374
|
+
exports["ɵbn"] = IpInterceptorInterceptor;
|
|
5375
|
+
exports["ɵbo"] = LIBRARY_IS_PRO;
|
|
5376
|
+
exports["ɵc"] = PbUserInterfaceService;
|
|
5377
|
+
exports["ɵd"] = FreeUsersRestApi;
|
|
5378
|
+
exports["ɵe"] = FreeUsersPbStorage;
|
|
5379
|
+
exports["ɵf"] = StructureComponent;
|
|
5380
|
+
exports["ɵg"] = BlockComponent;
|
|
5381
|
+
exports["ɵh"] = DynamicComponentDirective;
|
|
5382
|
+
exports["ɵi"] = TextElementComponent;
|
|
5383
|
+
exports["ɵj"] = AbstractBlock;
|
|
5384
|
+
exports["ɵk"] = ImageComponent;
|
|
5385
|
+
exports["ɵl"] = VideoComponent;
|
|
5386
|
+
exports["ɵm"] = VideoThumbnailService;
|
|
5387
|
+
exports["ɵn"] = ButtonComponent;
|
|
5388
|
+
exports["ɵo"] = DividerComponent;
|
|
5389
|
+
exports["ɵp"] = SpacerComponent;
|
|
5390
|
+
exports["ɵq"] = SocialComponent;
|
|
5391
|
+
exports["ɵr"] = BuilderContainerComponent;
|
|
5392
|
+
exports["ɵs"] = FontStylesComponent;
|
|
5393
|
+
exports["ɵt"] = PaddingComponent;
|
|
5394
|
+
exports["ɵu"] = MarginComponent;
|
|
5395
|
+
exports["ɵv"] = GapsComponent;
|
|
5396
|
+
exports["ɵw"] = LineHeightComponent;
|
|
5397
|
+
exports["ɵx"] = WidthHeightComponent;
|
|
5398
|
+
exports["ɵy"] = BorderComponent;
|
|
5399
|
+
exports["ɵz"] = ColorComponent;
|
|
5168
5400
|
|
|
5169
5401
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5170
5402
|
|