@pobuca/email-builder 1.2.0 → 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 +347 -71
- 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/classes/Elements.js +3 -2
- package/esm2015/lib/elements/image/image.component.js +13 -3
- package/esm2015/lib/elements/video/video.component.js +16 -4
- 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 +51 -5
- 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 +270 -12
- package/fesm2015/pobuca-email-builder.js.map +1 -1
- package/lib/elements/image/image.component.d.ts +2 -0
- package/lib/elements/video/video.component.d.ts +3 -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 +16 -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
- package/assets/placeholders/error.svg +0 -1
- package/assets/placeholders/image.svg +0 -1
- package/assets/placeholders/small-image.svg +0 -1
- package/assets/placeholders/video.svg +0 -1
|
@@ -325,7 +325,7 @@ class TextBlock {
|
|
|
325
325
|
}
|
|
326
326
|
}
|
|
327
327
|
class ImageBlock {
|
|
328
|
-
constructor(src = '
|
|
328
|
+
constructor(src = '', options, state = {
|
|
329
329
|
disabled: false,
|
|
330
330
|
message: ''
|
|
331
331
|
}) {
|
|
@@ -406,6 +406,7 @@ class VideoBlock {
|
|
|
406
406
|
units: ['px']
|
|
407
407
|
},
|
|
408
408
|
align: 'center',
|
|
409
|
+
title: '',
|
|
409
410
|
padding: {
|
|
410
411
|
top: 10,
|
|
411
412
|
right: 25,
|
|
@@ -1167,6 +1168,154 @@ PbStorageService.ctorParameters = () => [
|
|
|
1167
1168
|
{ type: Storage, decorators: [{ type: Inject, args: [PB_TEMPLATES_TEMPORARY_STORAGE,] }] }
|
|
1168
1169
|
];
|
|
1169
1170
|
|
|
1171
|
+
/*
|
|
1172
|
+
* Copyright (c) 2024 Pobuca.
|
|
1173
|
+
* All rights reserved.
|
|
1174
|
+
*/
|
|
1175
|
+
/**
|
|
1176
|
+
* @internal
|
|
1177
|
+
*/
|
|
1178
|
+
var HISTORY;
|
|
1179
|
+
(function (HISTORY) {
|
|
1180
|
+
HISTORY["KEY"] = "[NGB] history stack";
|
|
1181
|
+
})(HISTORY || (HISTORY = {}));
|
|
1182
|
+
/**
|
|
1183
|
+
* @internal
|
|
1184
|
+
*/
|
|
1185
|
+
class IpHistoryService {
|
|
1186
|
+
constructor(storage) {
|
|
1187
|
+
this.storage = storage;
|
|
1188
|
+
this.historyStack = [];
|
|
1189
|
+
this.currentIndex = -1;
|
|
1190
|
+
this.maxHistorySize = 50; // Maximum undo steps
|
|
1191
|
+
this._canUndo$ = new BehaviorSubject(false);
|
|
1192
|
+
this._canRedo$ = new BehaviorSubject(false);
|
|
1193
|
+
this.canUndo$ = this._canUndo$.asObservable();
|
|
1194
|
+
this.canRedo$ = this._canRedo$.asObservable();
|
|
1195
|
+
this.loadFromStorage();
|
|
1196
|
+
}
|
|
1197
|
+
/**
|
|
1198
|
+
* Add a new state to the history stack
|
|
1199
|
+
*/
|
|
1200
|
+
addState(state) {
|
|
1201
|
+
if (!state) {
|
|
1202
|
+
return;
|
|
1203
|
+
}
|
|
1204
|
+
const clonedState = cloneDeep(state);
|
|
1205
|
+
// If we're not at the end of the stack, remove all states after current index
|
|
1206
|
+
// This happens when user undoes and then makes a new change
|
|
1207
|
+
if (this.currentIndex < this.historyStack.length - 1) {
|
|
1208
|
+
this.historyStack = this.historyStack.slice(0, this.currentIndex + 1);
|
|
1209
|
+
}
|
|
1210
|
+
// Add the new state
|
|
1211
|
+
this.historyStack.push(clonedState);
|
|
1212
|
+
this.currentIndex++;
|
|
1213
|
+
// Limit history size to prevent memory issues
|
|
1214
|
+
if (this.historyStack.length > this.maxHistorySize) {
|
|
1215
|
+
this.historyStack.shift();
|
|
1216
|
+
this.currentIndex--;
|
|
1217
|
+
}
|
|
1218
|
+
this.updateUndoRedoStatus();
|
|
1219
|
+
this.saveToStorage();
|
|
1220
|
+
}
|
|
1221
|
+
/**
|
|
1222
|
+
* Get the previous state (undo)
|
|
1223
|
+
*/
|
|
1224
|
+
undo() {
|
|
1225
|
+
if (!this.canUndoNow()) {
|
|
1226
|
+
return null;
|
|
1227
|
+
}
|
|
1228
|
+
this.currentIndex--;
|
|
1229
|
+
this.updateUndoRedoStatus();
|
|
1230
|
+
return cloneDeep(this.historyStack[this.currentIndex]);
|
|
1231
|
+
}
|
|
1232
|
+
/**
|
|
1233
|
+
* Get the next state (redo)
|
|
1234
|
+
*/
|
|
1235
|
+
redo() {
|
|
1236
|
+
if (!this.canRedoNow()) {
|
|
1237
|
+
return null;
|
|
1238
|
+
}
|
|
1239
|
+
this.currentIndex++;
|
|
1240
|
+
this.updateUndoRedoStatus();
|
|
1241
|
+
return cloneDeep(this.historyStack[this.currentIndex]);
|
|
1242
|
+
}
|
|
1243
|
+
/**
|
|
1244
|
+
* Check if undo is available (synchronous)
|
|
1245
|
+
*/
|
|
1246
|
+
canUndoNow() {
|
|
1247
|
+
return this.currentIndex > 0;
|
|
1248
|
+
}
|
|
1249
|
+
/**
|
|
1250
|
+
* Check if redo is available (synchronous)
|
|
1251
|
+
*/
|
|
1252
|
+
canRedoNow() {
|
|
1253
|
+
return this.currentIndex < this.historyStack.length - 1;
|
|
1254
|
+
}
|
|
1255
|
+
/**
|
|
1256
|
+
* Clear history
|
|
1257
|
+
*/
|
|
1258
|
+
clear() {
|
|
1259
|
+
this.historyStack = [];
|
|
1260
|
+
this.currentIndex = -1;
|
|
1261
|
+
this.updateUndoRedoStatus();
|
|
1262
|
+
this.storage.removeItem(HISTORY.KEY);
|
|
1263
|
+
}
|
|
1264
|
+
/**
|
|
1265
|
+
* Get the history size
|
|
1266
|
+
*/
|
|
1267
|
+
getHistorySize() {
|
|
1268
|
+
return this.historyStack.length;
|
|
1269
|
+
}
|
|
1270
|
+
/**
|
|
1271
|
+
* Get current position in history stack
|
|
1272
|
+
*/
|
|
1273
|
+
getCurrentIndex() {
|
|
1274
|
+
return this.currentIndex;
|
|
1275
|
+
}
|
|
1276
|
+
updateUndoRedoStatus() {
|
|
1277
|
+
this._canUndo$.next(this.canUndoNow());
|
|
1278
|
+
this._canRedo$.next(this.canRedoNow());
|
|
1279
|
+
}
|
|
1280
|
+
saveToStorage() {
|
|
1281
|
+
try {
|
|
1282
|
+
const data = {
|
|
1283
|
+
stack: this.historyStack,
|
|
1284
|
+
currentIndex: this.currentIndex
|
|
1285
|
+
};
|
|
1286
|
+
this.storage.setItem(HISTORY.KEY, JSON.stringify(data));
|
|
1287
|
+
}
|
|
1288
|
+
catch (error) {
|
|
1289
|
+
console.warn('[IpHistoryService] Failed to save history to storage:', error);
|
|
1290
|
+
}
|
|
1291
|
+
}
|
|
1292
|
+
loadFromStorage() {
|
|
1293
|
+
var _a;
|
|
1294
|
+
try {
|
|
1295
|
+
const data = this.storage.getItem(HISTORY.KEY);
|
|
1296
|
+
if (data) {
|
|
1297
|
+
const parsed = JSON.parse(data);
|
|
1298
|
+
this.historyStack = parsed.stack || [];
|
|
1299
|
+
this.currentIndex = (_a = parsed.currentIndex) !== null && _a !== void 0 ? _a : -1;
|
|
1300
|
+
this.updateUndoRedoStatus();
|
|
1301
|
+
}
|
|
1302
|
+
}
|
|
1303
|
+
catch (error) {
|
|
1304
|
+
console.warn('[IpHistoryService] Failed to load history from storage:', error);
|
|
1305
|
+
this.clear();
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
1308
|
+
}
|
|
1309
|
+
IpHistoryService.ɵprov = i0.ɵɵdefineInjectable({ factory: function IpHistoryService_Factory() { return new IpHistoryService(i0.ɵɵinject(PB_STORAGE_FACTORY)); }, token: IpHistoryService, providedIn: "any" });
|
|
1310
|
+
IpHistoryService.decorators = [
|
|
1311
|
+
{ type: Injectable, args: [{
|
|
1312
|
+
providedIn: 'any'
|
|
1313
|
+
},] }
|
|
1314
|
+
];
|
|
1315
|
+
IpHistoryService.ctorParameters = () => [
|
|
1316
|
+
{ type: Storage, decorators: [{ type: Inject, args: [PB_STORAGE_FACTORY,] }] }
|
|
1317
|
+
];
|
|
1318
|
+
|
|
1170
1319
|
/*
|
|
1171
1320
|
* Copyright (c) 2024 Pobuca.
|
|
1172
1321
|
* All rights reserved.
|
|
@@ -1176,10 +1325,11 @@ PbStorageService.ctorParameters = () => [
|
|
|
1176
1325
|
* @internal
|
|
1177
1326
|
*/
|
|
1178
1327
|
class PbEmailObjectStoreService {
|
|
1179
|
-
constructor(userRestApi, pbStorage, userMiddleware, googleFonts, config) {
|
|
1328
|
+
constructor(userRestApi, pbStorage, userMiddleware, history, googleFonts, config) {
|
|
1180
1329
|
this.userRestApi = userRestApi;
|
|
1181
1330
|
this.pbStorage = pbStorage;
|
|
1182
1331
|
this.userMiddleware = userMiddleware;
|
|
1332
|
+
this.history = history;
|
|
1183
1333
|
this.googleFonts = googleFonts;
|
|
1184
1334
|
this.config = config;
|
|
1185
1335
|
this.Email = new PBEmail();
|
|
@@ -1200,6 +1350,14 @@ class PbEmailObjectStoreService {
|
|
|
1200
1350
|
this.templateAsObservable$ = this._Template$.asObservable();
|
|
1201
1351
|
this._onTemplateCreated$ = new Subject();
|
|
1202
1352
|
this.onTemplateCreated$ = this._onTemplateCreated$.pipe(withLatestFrom(this._Email$, this._Template$, this._Mjml$), map(([_, ...rest]) => rest));
|
|
1353
|
+
// History/Undo support
|
|
1354
|
+
this.canUndo$ = this.history.canUndo$;
|
|
1355
|
+
this.canRedo$ = this.history.canRedo$;
|
|
1356
|
+
}
|
|
1357
|
+
get defaultTemplateThumbPath() {
|
|
1358
|
+
var _a, _b;
|
|
1359
|
+
const apiPath = (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.apiPath) === null || _b === void 0 ? void 0 : _b.replace(/\/+$/, '');
|
|
1360
|
+
return `${apiPath}/images/placeholders/image-placeholder.png`;
|
|
1203
1361
|
}
|
|
1204
1362
|
createHTMLTemplate$() {
|
|
1205
1363
|
return this.emailAsObservable$.pipe(switchMap(email => {
|
|
@@ -1236,11 +1394,13 @@ class PbEmailObjectStoreService {
|
|
|
1236
1394
|
}
|
|
1237
1395
|
markForCheck() {
|
|
1238
1396
|
this._Email$.next(this.Email);
|
|
1397
|
+
// Add to undo/redo history
|
|
1398
|
+
this.history.addState(this.Email);
|
|
1239
1399
|
if (this.Email.structures.length) {
|
|
1240
1400
|
this.pbStorage.addTemplateToLatestUsed(cloneDeep({
|
|
1241
1401
|
templateData: this.Email,
|
|
1242
1402
|
title: 'last-edited',
|
|
1243
|
-
thumbPath:
|
|
1403
|
+
thumbPath: this.defaultTemplateThumbPath
|
|
1244
1404
|
}));
|
|
1245
1405
|
}
|
|
1246
1406
|
// console.log(getDiff(this.clonedEmail, this.Email));
|
|
@@ -1311,8 +1471,40 @@ class PbEmailObjectStoreService {
|
|
|
1311
1471
|
this.clonedEmail = cloneDeep(this.Email);
|
|
1312
1472
|
this.markForCheck();
|
|
1313
1473
|
}
|
|
1474
|
+
/**
|
|
1475
|
+
* Undo the last change
|
|
1476
|
+
* @returns true if undo was successful, false if undo is not available
|
|
1477
|
+
*/
|
|
1478
|
+
undo() {
|
|
1479
|
+
const previousState = this.history.undo();
|
|
1480
|
+
if (previousState) {
|
|
1481
|
+
this.Email = previousState;
|
|
1482
|
+
this._Email$.next(this.Email);
|
|
1483
|
+
// Reset template to force re-generation on next save
|
|
1484
|
+
this._Template$.next(null);
|
|
1485
|
+
this._Mjml$.next(null);
|
|
1486
|
+
return true;
|
|
1487
|
+
}
|
|
1488
|
+
return false;
|
|
1489
|
+
}
|
|
1490
|
+
/**
|
|
1491
|
+
* Redo the last undone change
|
|
1492
|
+
* @returns true if redo was successful, false if redo is not available
|
|
1493
|
+
*/
|
|
1494
|
+
redo() {
|
|
1495
|
+
const nextState = this.history.redo();
|
|
1496
|
+
if (nextState) {
|
|
1497
|
+
this.Email = nextState;
|
|
1498
|
+
this._Email$.next(this.Email);
|
|
1499
|
+
// Reset template to force re-generation on next save
|
|
1500
|
+
this._Template$.next(null);
|
|
1501
|
+
this._Mjml$.next(null);
|
|
1502
|
+
return true;
|
|
1503
|
+
}
|
|
1504
|
+
return false;
|
|
1505
|
+
}
|
|
1314
1506
|
}
|
|
1315
|
-
PbEmailObjectStoreService.ɵprov = i0.ɵɵdefineInjectable({ factory: function PbEmailObjectStoreService_Factory() { return new PbEmailObjectStoreService(i0.ɵɵinject(PbUserRestApiService), i0.ɵɵinject(PbStorageService), i0.ɵɵinject(PbUserMiddlewaresService), i0.ɵɵinject(PB_GOOGLE_FONTS), i0.ɵɵinject(PB_CONFIG)); }, token: PbEmailObjectStoreService, providedIn: "root" });
|
|
1507
|
+
PbEmailObjectStoreService.ɵprov = i0.ɵɵdefineInjectable({ factory: function PbEmailObjectStoreService_Factory() { return new PbEmailObjectStoreService(i0.ɵɵinject(PbUserRestApiService), i0.ɵɵinject(PbStorageService), i0.ɵɵinject(PbUserMiddlewaresService), i0.ɵɵinject(IpHistoryService), i0.ɵɵinject(PB_GOOGLE_FONTS), i0.ɵɵinject(PB_CONFIG)); }, token: PbEmailObjectStoreService, providedIn: "root" });
|
|
1316
1508
|
PbEmailObjectStoreService.decorators = [
|
|
1317
1509
|
{ type: Injectable, args: [{
|
|
1318
1510
|
providedIn: 'root'
|
|
@@ -1322,6 +1514,7 @@ PbEmailObjectStoreService.ctorParameters = () => [
|
|
|
1322
1514
|
{ type: PbUserRestApiService },
|
|
1323
1515
|
{ type: PbStorageService },
|
|
1324
1516
|
{ type: PbUserMiddlewaresService },
|
|
1517
|
+
{ type: IpHistoryService },
|
|
1325
1518
|
{ type: Array, decorators: [{ type: Inject, args: [PB_GOOGLE_FONTS,] }] },
|
|
1326
1519
|
{ type: undefined, decorators: [{ type: Inject, args: [PB_CONFIG,] }] }
|
|
1327
1520
|
];
|
|
@@ -2172,6 +2365,9 @@ class PbEmailBuilderComponent {
|
|
|
2172
2365
|
this.currentHTMLTemplate$ = this.emailObjectStore.templateAsObservable$;
|
|
2173
2366
|
this.activeMatProgress$ = this.userInterfaceService.activeMatProgress$.asObservable();
|
|
2174
2367
|
this.customModuleList$ = this.userRestApiService.getAllUserModules$;
|
|
2368
|
+
// Undo/Redo support
|
|
2369
|
+
this.canUndo$ = this.emailObjectStore.canUndo$;
|
|
2370
|
+
this.canRedo$ = this.emailObjectStore.canRedo$;
|
|
2175
2371
|
this._onDestroy$ = new Subject();
|
|
2176
2372
|
this.includedFonts = new Set();
|
|
2177
2373
|
if (this.doc) {
|
|
@@ -2221,6 +2417,22 @@ class PbEmailBuilderComponent {
|
|
|
2221
2417
|
disableStructureList$(structure) {
|
|
2222
2418
|
return this.middlewares.disableStructureDragFromList(structure).pipe(take(1));
|
|
2223
2419
|
}
|
|
2420
|
+
/**
|
|
2421
|
+
* Undo the last action
|
|
2422
|
+
*/
|
|
2423
|
+
undo() {
|
|
2424
|
+
if (this.emailObjectStore.undo()) {
|
|
2425
|
+
this.userInterfaceService.notify('Undo applied', 'short');
|
|
2426
|
+
}
|
|
2427
|
+
}
|
|
2428
|
+
/**
|
|
2429
|
+
* Redo the last undone action
|
|
2430
|
+
*/
|
|
2431
|
+
redo() {
|
|
2432
|
+
if (this.emailObjectStore.redo()) {
|
|
2433
|
+
this.userInterfaceService.notify('Redo applied', 'short');
|
|
2434
|
+
}
|
|
2435
|
+
}
|
|
2224
2436
|
trackByFn(block) {
|
|
2225
2437
|
return block.type;
|
|
2226
2438
|
}
|
|
@@ -2328,6 +2540,30 @@ class PbEmailBuilderComponent {
|
|
|
2328
2540
|
});
|
|
2329
2541
|
}
|
|
2330
2542
|
});
|
|
2543
|
+
// Keyboard shortcuts for Undo (Ctrl+Z) and Redo (Ctrl+Shift+Z)
|
|
2544
|
+
fromEvent(this.doc, 'keydown')
|
|
2545
|
+
.pipe(filter(event => {
|
|
2546
|
+
// Check if Ctrl (or Cmd on Mac) is pressed
|
|
2547
|
+
const isCtrlOrCmd = event.ctrlKey || event.metaKey;
|
|
2548
|
+
// Check if we're in a focusable element like input/textarea
|
|
2549
|
+
const isFocusable = event.target instanceof HTMLInputElement ||
|
|
2550
|
+
event.target instanceof HTMLTextAreaElement;
|
|
2551
|
+
return isCtrlOrCmd && !isFocusable;
|
|
2552
|
+
}), takeUntil(this._onDestroy$))
|
|
2553
|
+
.subscribe((event) => {
|
|
2554
|
+
if (event.key === 'z' || event.key === 'Z') {
|
|
2555
|
+
// Undo: Ctrl+Z
|
|
2556
|
+
if (!event.shiftKey) {
|
|
2557
|
+
event.preventDefault();
|
|
2558
|
+
this.undo();
|
|
2559
|
+
}
|
|
2560
|
+
// Redo: Ctrl+Shift+Z
|
|
2561
|
+
else if (event.shiftKey) {
|
|
2562
|
+
event.preventDefault();
|
|
2563
|
+
this.redo();
|
|
2564
|
+
}
|
|
2565
|
+
}
|
|
2566
|
+
});
|
|
2331
2567
|
}
|
|
2332
2568
|
ngOnChanges(changes) {
|
|
2333
2569
|
if (changes.email) {
|
|
@@ -2357,7 +2593,7 @@ class PbEmailBuilderComponent {
|
|
|
2357
2593
|
PbEmailBuilderComponent.decorators = [
|
|
2358
2594
|
{ type: Component, args: [{
|
|
2359
2595
|
selector: 'pb-email-builder',
|
|
2360
|
-
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
|
|
2596
|
+
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",
|
|
2361
2597
|
exportAs: 'pbEmailBuilder',
|
|
2362
2598
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2363
2599
|
providers: [
|
|
@@ -2368,7 +2604,7 @@ PbEmailBuilderComponent.decorators = [
|
|
|
2368
2604
|
},
|
|
2369
2605
|
SlugifyPipe
|
|
2370
2606
|
],
|
|
2371
|
-
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}"]
|
|
2607
|
+
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}"]
|
|
2372
2608
|
},] }
|
|
2373
2609
|
];
|
|
2374
2610
|
PbEmailBuilderComponent.ctorParameters = () => [
|
|
@@ -2493,13 +2729,21 @@ class ImageComponent extends AbstractBlock {
|
|
|
2493
2729
|
this.imageUploader = imageUploader;
|
|
2494
2730
|
this.chRef = chRef;
|
|
2495
2731
|
this.ngb = ngb;
|
|
2732
|
+
this.defaultImageWidth = {
|
|
2733
|
+
value: 110,
|
|
2734
|
+
unit: 'px',
|
|
2735
|
+
auto: false
|
|
2736
|
+
};
|
|
2496
2737
|
}
|
|
2497
2738
|
// @Input() block = new ImageBlock();
|
|
2498
2739
|
get align() {
|
|
2499
2740
|
return this.block.options.align;
|
|
2500
2741
|
}
|
|
2501
2742
|
get src() {
|
|
2502
|
-
return this.block.src ||
|
|
2743
|
+
return this.block.src || this.defaultImageSrc;
|
|
2744
|
+
}
|
|
2745
|
+
get defaultImageSrc() {
|
|
2746
|
+
return `${this.ngb.config.apiPath}/images/placeholders/image-placeholder.png`;
|
|
2503
2747
|
}
|
|
2504
2748
|
uploadImage() {
|
|
2505
2749
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -2512,7 +2756,9 @@ class ImageComponent extends AbstractBlock {
|
|
|
2512
2756
|
}
|
|
2513
2757
|
getImageStyles() {
|
|
2514
2758
|
const { border, width, height, padding } = this.block.options;
|
|
2515
|
-
|
|
2759
|
+
const hasPlaceholderImage = !(this.block.src || '').trim();
|
|
2760
|
+
const imageWidth = hasPlaceholderImage ? this.defaultImageWidth : width;
|
|
2761
|
+
return Object.assign(Object.assign({ width: createWidthHeight(imageWidth), height: createWidthHeight(height) }, createPadding(padding)), createBorder(border));
|
|
2516
2762
|
}
|
|
2517
2763
|
}
|
|
2518
2764
|
ImageComponent.decorators = [
|
|
@@ -2673,10 +2919,14 @@ class VideoComponent extends AbstractBlock {
|
|
|
2673
2919
|
this.chRef = chRef;
|
|
2674
2920
|
this.ngb = ngb;
|
|
2675
2921
|
this.videoThumbnailService = videoThumbnailService;
|
|
2922
|
+
this.defaultPosterWidth = {
|
|
2923
|
+
value: 160,
|
|
2924
|
+
unit: 'px',
|
|
2925
|
+
auto: false
|
|
2926
|
+
};
|
|
2676
2927
|
this.destroy$ = new Subject();
|
|
2677
2928
|
this.srcChange$ = new Subject();
|
|
2678
2929
|
this.previousSrc = '';
|
|
2679
|
-
this.defaultPosterSrc = 'assets/placeholders/video.svg';
|
|
2680
2930
|
this.isGeneratingThumbnail = false;
|
|
2681
2931
|
}
|
|
2682
2932
|
get align() {
|
|
@@ -2688,6 +2938,12 @@ class VideoComponent extends AbstractBlock {
|
|
|
2688
2938
|
get posterSrc() {
|
|
2689
2939
|
return (this.block.posterSrc || '').trim() || this.defaultPosterSrc;
|
|
2690
2940
|
}
|
|
2941
|
+
get defaultPosterSrc() {
|
|
2942
|
+
return `${this.ngb.config.apiPath}/images/placeholders/video-placeholder.png`;
|
|
2943
|
+
}
|
|
2944
|
+
get errorPosterSrc() {
|
|
2945
|
+
return `${this.ngb.config.apiPath}/images/placeholders/error-placeholder.png`;
|
|
2946
|
+
}
|
|
2691
2947
|
get videoUrl() {
|
|
2692
2948
|
return this.block.src || '';
|
|
2693
2949
|
}
|
|
@@ -2740,7 +2996,7 @@ class VideoComponent extends AbstractBlock {
|
|
|
2740
2996
|
}
|
|
2741
2997
|
catch (error) {
|
|
2742
2998
|
console.error('Error generating thumbnail:', error);
|
|
2743
|
-
this.block.posterSrc =
|
|
2999
|
+
this.block.posterSrc = this.errorPosterSrc;
|
|
2744
3000
|
}
|
|
2745
3001
|
finally {
|
|
2746
3002
|
this.isGeneratingThumbnail = false;
|
|
@@ -2768,7 +3024,9 @@ class VideoComponent extends AbstractBlock {
|
|
|
2768
3024
|
}
|
|
2769
3025
|
getVideoStyles() {
|
|
2770
3026
|
const { border, width, height, padding } = this.block.options;
|
|
2771
|
-
|
|
3027
|
+
const hasPlaceholderPoster = !!(this.block.posterSrc || '').trim();
|
|
3028
|
+
const posterWidth = hasPlaceholderPoster ? width : this.defaultPosterWidth;
|
|
3029
|
+
return Object.assign(Object.assign({ width: createWidthHeight(posterWidth), height: createWidthHeight(height) }, createPadding(padding)), createBorder(border));
|
|
2772
3030
|
}
|
|
2773
3031
|
}
|
|
2774
3032
|
VideoComponent.decorators = [
|
|
@@ -4694,5 +4952,5 @@ PbEmailBuilderModule.ctorParameters = () => [
|
|
|
4694
4952
|
* Generated bundle index. Do not edit.
|
|
4695
4953
|
*/
|
|
4696
4954
|
|
|
4697
|
-
export { AIPBlock, ButtonBlock, Defaults, DividerBlock, ETemplatesStorage, ImageUploader as FreeUsersImageUploader, ImageBlock, PBEmail, PB_BLOCKS, PB_CONFIG, PB_DEFAULT_BLOCKS, PB_DEFAULT_CONFIG, PB_DEFAULT_FALLBACK_FONTS, PB_DEFAULT_GOOGLE_FONTS, PB_DEFAULT_SOCIAL_NETWORKS, PB_DEFAULT_STRUCTURES, PB_FALLBACK_FONTS, PB_GOOGLE_FONTS, PB_SOCIAL_NETWORKS, PB_STORAGE_FACTORY, PB_STRUCTURES, PB_TEMPLATES_TEMPORARY_STORAGE, PbEmailBuilderComponent, PbEmailBuilderModule, PbEmailBuilderService, PbStorageService, PbUserImageUploaderService, PbUserMiddlewaresService, PbUserRestApiService, PreviewTemplateComponent, SlugifyPipe, SocialBlock, SpacerBlock, Structure, TextBlock, VideoBlock, bytesToSize, cloneDeep, createBackground, createBorder, createCustomRestApiService, createFont, createLineHeight, createMargin, createPadding, createUserMiddlewareService, createUserUploaderService, createUsersIpStorage, createWidthHeight, defaultColumnsOptions, defaultsDeep, deferOf, getAssetByPath, isEqual, ɵ0, PbEmailObjectStoreService as ɵa,
|
|
4955
|
+
export { AIPBlock, ButtonBlock, Defaults, DividerBlock, ETemplatesStorage, ImageUploader as FreeUsersImageUploader, ImageBlock, PBEmail, PB_BLOCKS, PB_CONFIG, PB_DEFAULT_BLOCKS, PB_DEFAULT_CONFIG, PB_DEFAULT_FALLBACK_FONTS, PB_DEFAULT_GOOGLE_FONTS, PB_DEFAULT_SOCIAL_NETWORKS, PB_DEFAULT_STRUCTURES, PB_FALLBACK_FONTS, PB_GOOGLE_FONTS, PB_SOCIAL_NETWORKS, PB_STORAGE_FACTORY, PB_STRUCTURES, PB_TEMPLATES_TEMPORARY_STORAGE, PbEmailBuilderComponent, PbEmailBuilderModule, PbEmailBuilderService, PbStorageService, PbUserImageUploaderService, PbUserMiddlewaresService, PbUserRestApiService, PreviewTemplateComponent, SlugifyPipe, SocialBlock, SpacerBlock, Structure, TextBlock, VideoBlock, bytesToSize, cloneDeep, createBackground, createBorder, createCustomRestApiService, createFont, createLineHeight, createMargin, createPadding, createUserMiddlewareService, createUserUploaderService, createUsersIpStorage, createWidthHeight, defaultColumnsOptions, defaultsDeep, deferOf, getAssetByPath, isEqual, ɵ0, PbEmailObjectStoreService as ɵa, IpHistoryService as ɵb, LinkComponent as ɵba, AlignComponent as ɵbb, DirectionComponent as ɵbc, BackRepatComponent as ɵbd, ConfirmDialogComponent as ɵbe, ImageUploadComponent as ɵbf, BlockSettingsComponent as ɵbg, StructureSettingsComponent as ɵbh, GeneralSettingsComponent as ɵbi, UploadBottomSheetDialogComponent as ɵbj, UploadImageGalleryComponent as ɵbk, TemplateListDialogComponent as ɵbl, ImportDialogComponent as ɵbm, IpInterceptorInterceptor as ɵbn, LIBRARY_IS_PRO as ɵbo, PbUserInterfaceService as ɵc, FreeUsersRestApi as ɵd, FreeUsersPbStorage as ɵe, StructureComponent as ɵf, BlockComponent as ɵg, DynamicComponentDirective as ɵh, TextElementComponent as ɵi, AbstractBlock as ɵj, ImageComponent as ɵk, VideoComponent as ɵl, VideoThumbnailService as ɵm, ButtonComponent as ɵn, DividerComponent as ɵo, SpacerComponent as ɵp, SocialComponent as ɵq, BuilderContainerComponent as ɵr, FontStylesComponent as ɵs, PaddingComponent as ɵt, MarginComponent as ɵu, GapsComponent as ɵv, LineHeightComponent as ɵw, WidthHeightComponent as ɵx, BorderComponent as ɵy, ColorComponent as ɵz };
|
|
4698
4956
|
//# sourceMappingURL=pobuca-email-builder.js.map
|