@pobuca/email-builder 1.0.1 → 1.2.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/assets/placeholders/error.svg +1 -0
- package/assets/placeholders/image.svg +1 -0
- package/assets/placeholders/small-image.svg +1 -0
- package/assets/placeholders/video.svg +1 -0
- package/bundles/pobuca-email-builder.umd.js +517 -53
- 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/DefaultEmail.js +5 -4
- package/esm2015/lib/classes/Elements.js +50 -2
- package/esm2015/lib/components/block-settings/block-settings.component.js +2 -2
- package/esm2015/lib/directives/dynamic-component.directive.js +3 -1
- package/esm2015/lib/elements/image/image.component.js +2 -2
- package/esm2015/lib/elements/video/video.component.js +135 -0
- package/esm2015/lib/groups/font-styles.js +20 -5
- package/esm2015/lib/interfaces/interfaces.js +1 -1
- package/esm2015/lib/pb-email-builder.component.js +13 -1
- package/esm2015/lib/pb-email-builder.module.js +7 -2
- package/esm2015/lib/services/internals/pb-email-object-store/pb-email-object-store.service.js +12 -2
- package/esm2015/lib/services/user-rest-api-service/user-rest-api.service.js +15 -1
- package/esm2015/lib/services/video-thumbnail.service.js +142 -0
- package/esm2015/lib/tokens/tokens.js +3 -2
- package/esm2015/pobuca-email-builder.js +31 -29
- package/fesm2015/pobuca-email-builder.js +376 -13
- package/fesm2015/pobuca-email-builder.js.map +1 -1
- package/lib/classes/DefaultEmail.d.ts +4 -3
- package/lib/classes/Elements.d.ts +13 -3
- package/lib/elements/video/video.component.d.ts +34 -0
- package/lib/groups/font-styles.d.ts +4 -0
- package/lib/interfaces/interfaces.d.ts +20 -0
- package/lib/pb-email-builder.component.d.ts +1 -1
- package/lib/services/user-rest-api-service/user-rest-api.service.d.ts +13 -0
- package/lib/services/video-thumbnail.service.d.ts +23 -0
- package/package.json +8 -3
- package/pobuca-email-builder.d.ts +30 -28
- package/pobuca-email-builder.metadata.json +1 -1
|
@@ -3,6 +3,7 @@ import { InjectionToken, Injectable, Inject, Component, ChangeDetectionStrategy,
|
|
|
3
3
|
import { defer, of, BehaviorSubject, Subject, combineLatest, EMPTY, ReplaySubject, animationFrameScheduler, iif, fromEvent, throwError } from 'rxjs';
|
|
4
4
|
import { map, shareReplay, pluck, withLatestFrom, switchMap, exhaustMap, take, catchError, distinct, distinctUntilKeyChanged, subscribeOn, distinctUntilChanged, tap, filter, finalize, takeUntil, mapTo, debounceTime } from 'rxjs/operators';
|
|
5
5
|
import { moveItemInArray, transferArrayItem, DragDropModule } from '@angular/cdk/drag-drop';
|
|
6
|
+
import * as i1 from '@angular/common/http';
|
|
6
7
|
import { HttpClient, HttpEventType, HttpResponse, HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
|
|
7
8
|
import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar';
|
|
8
9
|
import { MatDialogRef, MAT_DIALOG_DATA, MatDialog, MatDialogModule } from '@angular/material/dialog';
|
|
@@ -324,7 +325,7 @@ class TextBlock {
|
|
|
324
325
|
}
|
|
325
326
|
}
|
|
326
327
|
class ImageBlock {
|
|
327
|
-
constructor(src = '
|
|
328
|
+
constructor(src = 'assets/placeholders/small-image.svg', options, state = {
|
|
328
329
|
disabled: false,
|
|
329
330
|
message: ''
|
|
330
331
|
}) {
|
|
@@ -368,6 +369,54 @@ class ImageBlock {
|
|
|
368
369
|
this.options = defaultsDeep(options, this.options);
|
|
369
370
|
}
|
|
370
371
|
}
|
|
372
|
+
class VideoBlock {
|
|
373
|
+
constructor(src = '', posterSrc = '', options = {
|
|
374
|
+
border: {
|
|
375
|
+
color: '#000000',
|
|
376
|
+
style: 'solid',
|
|
377
|
+
width: 0,
|
|
378
|
+
radius: 0
|
|
379
|
+
}
|
|
380
|
+
}, state = {
|
|
381
|
+
disabled: false,
|
|
382
|
+
message: ''
|
|
383
|
+
}) {
|
|
384
|
+
this.src = src;
|
|
385
|
+
this.posterSrc = posterSrc;
|
|
386
|
+
this.state = state;
|
|
387
|
+
this.type = 'video';
|
|
388
|
+
this.icon = 'videocam';
|
|
389
|
+
this.options = {
|
|
390
|
+
border: {
|
|
391
|
+
color: '#000000',
|
|
392
|
+
style: 'solid',
|
|
393
|
+
width: 0,
|
|
394
|
+
radius: 0
|
|
395
|
+
},
|
|
396
|
+
width: {
|
|
397
|
+
value: 100,
|
|
398
|
+
unit: 'px',
|
|
399
|
+
auto: true,
|
|
400
|
+
units: ['px']
|
|
401
|
+
},
|
|
402
|
+
height: {
|
|
403
|
+
value: 100,
|
|
404
|
+
unit: 'px',
|
|
405
|
+
auto: true,
|
|
406
|
+
units: ['px']
|
|
407
|
+
},
|
|
408
|
+
align: 'center',
|
|
409
|
+
padding: {
|
|
410
|
+
top: 10,
|
|
411
|
+
right: 25,
|
|
412
|
+
bottom: 10,
|
|
413
|
+
left: 25
|
|
414
|
+
}
|
|
415
|
+
};
|
|
416
|
+
this.title = $localize `:@@video_block:Video`;
|
|
417
|
+
this.options = defaultsDeep(options, this.options);
|
|
418
|
+
}
|
|
419
|
+
}
|
|
371
420
|
class ButtonBlock {
|
|
372
421
|
constructor(innerText = 'Click on me', options, state = {
|
|
373
422
|
disabled: false,
|
|
@@ -622,6 +671,7 @@ const PB_STRUCTURES = new InjectionToken('PB Structures', {
|
|
|
622
671
|
const PB_DEFAULT_BLOCKS = [
|
|
623
672
|
new TextBlock(),
|
|
624
673
|
new ImageBlock(),
|
|
674
|
+
new VideoBlock(),
|
|
625
675
|
new ButtonBlock(),
|
|
626
676
|
new DividerBlock(),
|
|
627
677
|
new SpacerBlock(),
|
|
@@ -710,14 +760,15 @@ class Defaults {
|
|
|
710
760
|
left: 0
|
|
711
761
|
}
|
|
712
762
|
}
|
|
713
|
-
}) {
|
|
763
|
+
}, customFonts = []) {
|
|
714
764
|
this.structures = structures;
|
|
715
765
|
this.general = general;
|
|
766
|
+
this.customFonts = customFonts;
|
|
716
767
|
}
|
|
717
768
|
}
|
|
718
769
|
class PBEmail extends Defaults {
|
|
719
|
-
constructor({ structures, general } = {}) {
|
|
720
|
-
super(structures, general);
|
|
770
|
+
constructor({ structures, general, customFonts } = {}) {
|
|
771
|
+
super(structures, general, customFonts);
|
|
721
772
|
}
|
|
722
773
|
}
|
|
723
774
|
|
|
@@ -1006,6 +1057,20 @@ class PbUserRestApiService {
|
|
|
1006
1057
|
getUserImages$() {
|
|
1007
1058
|
return deferOf([]);
|
|
1008
1059
|
}
|
|
1060
|
+
/**
|
|
1061
|
+
* Upload a base64 encoded image to the server.
|
|
1062
|
+
*
|
|
1063
|
+
* @param base64Image The base64 encoded image data (including the data URI prefix).
|
|
1064
|
+
* @param folderPath The folder path where the image should be stored.
|
|
1065
|
+
* @param uploadImageAPI The API endpoint for uploading base64 images.
|
|
1066
|
+
*/
|
|
1067
|
+
userImageUploadBase64$(base64Image, folderPath) {
|
|
1068
|
+
const uploadImageAPI = '';
|
|
1069
|
+
return this.http.post(uploadImageAPI, {
|
|
1070
|
+
folderPath,
|
|
1071
|
+
imageBase64: base64Image
|
|
1072
|
+
});
|
|
1073
|
+
}
|
|
1009
1074
|
/**
|
|
1010
1075
|
* Rewrite the default request which converts PBEmail to HTML, if you have a paid License,
|
|
1011
1076
|
* this method allows you to rewrite the default Convertor API Path to yours.
|
|
@@ -1149,6 +1214,16 @@ class PbEmailObjectStoreService {
|
|
|
1149
1214
|
const error = res.errors.map(({ message, tagName }) => `${tagName} > ${message}`).join('\n');
|
|
1150
1215
|
throw new Error(error);
|
|
1151
1216
|
}
|
|
1217
|
+
// Post-process HTML to include custom fonts
|
|
1218
|
+
if (email.customFonts && email.customFonts.length) {
|
|
1219
|
+
const customFontLinks = email.customFonts
|
|
1220
|
+
.filter(font => font.url)
|
|
1221
|
+
.map(font => `<link href="${font.url}" rel="stylesheet" type="text/css">`)
|
|
1222
|
+
.join('\n');
|
|
1223
|
+
if (customFontLinks && res.html.includes('</head>')) {
|
|
1224
|
+
res.html = res.html.replace('</head>', `${customFontLinks}\n</head>`);
|
|
1225
|
+
}
|
|
1226
|
+
}
|
|
1152
1227
|
this._Mjml$.next(res.mjml);
|
|
1153
1228
|
this._Template$.next(res.html);
|
|
1154
1229
|
this.clonedEmail = cloneDeep(this.Email);
|
|
@@ -1165,7 +1240,7 @@ class PbEmailObjectStoreService {
|
|
|
1165
1240
|
this.pbStorage.addTemplateToLatestUsed(cloneDeep({
|
|
1166
1241
|
templateData: this.Email,
|
|
1167
1242
|
title: 'last-edited',
|
|
1168
|
-
thumbPath: '
|
|
1243
|
+
thumbPath: 'assets/placeholders/image.svg'
|
|
1169
1244
|
}));
|
|
1170
1245
|
}
|
|
1171
1246
|
// console.log(getDiff(this.clonedEmail, this.Email));
|
|
@@ -2240,6 +2315,18 @@ class PbEmailBuilderComponent {
|
|
|
2240
2315
|
(_a = this.onTouched) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
2241
2316
|
(_b = this.onChange) === null || _b === void 0 ? void 0 : _b.call(this, email);
|
|
2242
2317
|
this.emailChange.next(email);
|
|
2318
|
+
if (this.doc && (email === null || email === void 0 ? void 0 : email.customFonts)) {
|
|
2319
|
+
email.customFonts.forEach(font => {
|
|
2320
|
+
const existing = Array.from(this.includedFonts).find(link => link.href === font.url);
|
|
2321
|
+
if (!existing) {
|
|
2322
|
+
const link = this.doc.createElement('link');
|
|
2323
|
+
link.href = font.url;
|
|
2324
|
+
link.rel = 'stylesheet';
|
|
2325
|
+
this.includedFonts.add(link);
|
|
2326
|
+
this.doc.head.appendChild(link);
|
|
2327
|
+
}
|
|
2328
|
+
});
|
|
2329
|
+
}
|
|
2243
2330
|
});
|
|
2244
2331
|
}
|
|
2245
2332
|
ngOnChanges(changes) {
|
|
@@ -2412,7 +2499,7 @@ class ImageComponent extends AbstractBlock {
|
|
|
2412
2499
|
return this.block.options.align;
|
|
2413
2500
|
}
|
|
2414
2501
|
get src() {
|
|
2415
|
-
return this.block.src || '
|
|
2502
|
+
return this.block.src || 'assets/placeholders/image.svg';
|
|
2416
2503
|
}
|
|
2417
2504
|
uploadImage() {
|
|
2418
2505
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -2444,6 +2531,263 @@ ImageComponent.propDecorators = {
|
|
|
2444
2531
|
align: [{ type: HostBinding, args: ['style.textAlign',] }]
|
|
2445
2532
|
};
|
|
2446
2533
|
|
|
2534
|
+
class VideoThumbnailService {
|
|
2535
|
+
constructor(http, pbUserRestApiService) {
|
|
2536
|
+
this.http = http;
|
|
2537
|
+
this.pbUserRestApiService = pbUserRestApiService;
|
|
2538
|
+
// SVG play button overlays
|
|
2539
|
+
this.YOUTUBE_OVERLAY = `data:image/svg+xml;base64,${btoa(`
|
|
2540
|
+
<svg width="200" height="140" xmlns="http://www.w3.org/2000/svg">
|
|
2541
|
+
<rect x="0" y="0" width="200" height="140" rx="20" fill="red" fill-opacity="0.9"/>
|
|
2542
|
+
<polygon points="75,45 75,95 130,70" fill="white"/>
|
|
2543
|
+
</svg>`)}`;
|
|
2544
|
+
this.VIMEO_OVERLAY = `data:image/svg+xml;base64,${btoa(`
|
|
2545
|
+
<svg width="200" height="200" xmlns="http://www.w3.org/2000/svg">
|
|
2546
|
+
<circle cx="100" cy="100" r="90" fill="#00ADEF" fill-opacity="0.9"/>
|
|
2547
|
+
<polygon points="80,65 80,135 140,100" fill="white"/>
|
|
2548
|
+
</svg>`)}`;
|
|
2549
|
+
}
|
|
2550
|
+
/**
|
|
2551
|
+
* Parse video URL to extract platform and video ID
|
|
2552
|
+
*/
|
|
2553
|
+
parseVideoUrl(url) {
|
|
2554
|
+
if (!url)
|
|
2555
|
+
return null;
|
|
2556
|
+
// YouTube patterns
|
|
2557
|
+
const ytRegex = /(?:youtu\.be\/|youtube\.com\/(?:watch\?v=|embed\/|v\/|shorts\/))([^\?&"'>]+)/;
|
|
2558
|
+
const ytMatch = url.match(ytRegex);
|
|
2559
|
+
if (ytMatch) {
|
|
2560
|
+
return { type: 'youtube', id: ytMatch[1] };
|
|
2561
|
+
}
|
|
2562
|
+
// Vimeo patterns
|
|
2563
|
+
const vimeoRegex = /(?:vimeo\.com\/|player\.vimeo\.com\/video\/)([0-9]+)/;
|
|
2564
|
+
const vimeoMatch = url.match(vimeoRegex);
|
|
2565
|
+
if (vimeoMatch) {
|
|
2566
|
+
return { type: 'vimeo', id: vimeoMatch[1] };
|
|
2567
|
+
}
|
|
2568
|
+
return null;
|
|
2569
|
+
}
|
|
2570
|
+
getYouTubeThumbnail(videoId) {
|
|
2571
|
+
return `https://img.youtube.com/vi/${videoId}/mqdefault.jpg`;
|
|
2572
|
+
}
|
|
2573
|
+
getVimeoThumbnail(url) {
|
|
2574
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2575
|
+
try {
|
|
2576
|
+
const response = yield this.http.get(`https://vimeo.com/api/oembed.json?url=${encodeURIComponent(url)}&width=1280`).toPromise();
|
|
2577
|
+
return (response === null || response === void 0 ? void 0 : response.thumbnail_url) || null;
|
|
2578
|
+
}
|
|
2579
|
+
catch (error) {
|
|
2580
|
+
console.error('Error fetching Vimeo thumbnail:', error);
|
|
2581
|
+
return null;
|
|
2582
|
+
}
|
|
2583
|
+
});
|
|
2584
|
+
}
|
|
2585
|
+
loadImage(src) {
|
|
2586
|
+
return new Promise((resolve, reject) => {
|
|
2587
|
+
const img = new Image();
|
|
2588
|
+
img.crossOrigin = 'anonymous';
|
|
2589
|
+
img.onload = () => resolve(img);
|
|
2590
|
+
img.onerror = reject;
|
|
2591
|
+
img.src = src;
|
|
2592
|
+
});
|
|
2593
|
+
}
|
|
2594
|
+
compositeImages(thumbnailUrl, platform) {
|
|
2595
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2596
|
+
try {
|
|
2597
|
+
const baseImg = yield this.loadImage(thumbnailUrl);
|
|
2598
|
+
const overlaySource = platform === 'youtube' ? this.YOUTUBE_OVERLAY : this.VIMEO_OVERLAY;
|
|
2599
|
+
const overlayImg = yield this.loadImage(overlaySource);
|
|
2600
|
+
const canvas = document.createElement('canvas');
|
|
2601
|
+
const ctx = canvas.getContext('2d');
|
|
2602
|
+
if (!ctx) {
|
|
2603
|
+
throw new Error('Could not get canvas context');
|
|
2604
|
+
}
|
|
2605
|
+
canvas.width = baseImg.width;
|
|
2606
|
+
canvas.height = baseImg.height;
|
|
2607
|
+
ctx.drawImage(baseImg, 0, 0);
|
|
2608
|
+
const scale = Math.min(canvas.width / overlayImg.width, canvas.height / overlayImg.height) * 0.25;
|
|
2609
|
+
const overlayWidth = overlayImg.width * scale;
|
|
2610
|
+
const overlayHeight = overlayImg.height * scale;
|
|
2611
|
+
const x = (canvas.width - overlayWidth) / 2;
|
|
2612
|
+
const y = (canvas.height - overlayHeight) / 2;
|
|
2613
|
+
ctx.drawImage(overlayImg, x, y, overlayWidth, overlayHeight);
|
|
2614
|
+
return canvas.toDataURL('image/png');
|
|
2615
|
+
}
|
|
2616
|
+
catch (error) {
|
|
2617
|
+
console.error('Error compositing images:', error);
|
|
2618
|
+
return thumbnailUrl;
|
|
2619
|
+
}
|
|
2620
|
+
});
|
|
2621
|
+
}
|
|
2622
|
+
generateThumbnail(videoUrl) {
|
|
2623
|
+
var _a;
|
|
2624
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2625
|
+
const videoInfo = this.parseVideoUrl(videoUrl);
|
|
2626
|
+
if (!videoInfo) {
|
|
2627
|
+
return null;
|
|
2628
|
+
}
|
|
2629
|
+
let thumbnailUrl = null;
|
|
2630
|
+
if (videoInfo.type === 'youtube') {
|
|
2631
|
+
thumbnailUrl = this.getYouTubeThumbnail(videoInfo.id);
|
|
2632
|
+
}
|
|
2633
|
+
else if (videoInfo.type === 'vimeo') {
|
|
2634
|
+
thumbnailUrl = yield this.getVimeoThumbnail(videoUrl);
|
|
2635
|
+
}
|
|
2636
|
+
if (!thumbnailUrl) {
|
|
2637
|
+
return null;
|
|
2638
|
+
}
|
|
2639
|
+
const compositeBase64 = yield this.compositeImages(thumbnailUrl, videoInfo.type);
|
|
2640
|
+
try {
|
|
2641
|
+
const uploadResponse = yield this.pbUserRestApiService.userImageUploadBase64$(compositeBase64, 'thumbnails').toPromise();
|
|
2642
|
+
if ((uploadResponse === null || uploadResponse === void 0 ? void 0 : uploadResponse.succeeded) && ((_a = uploadResponse.result) === null || _a === void 0 ? void 0 : _a.url)) {
|
|
2643
|
+
return uploadResponse.result.url;
|
|
2644
|
+
}
|
|
2645
|
+
return null;
|
|
2646
|
+
}
|
|
2647
|
+
catch (error) {
|
|
2648
|
+
console.error('Error uploading video thumbnail:', error);
|
|
2649
|
+
return null;
|
|
2650
|
+
}
|
|
2651
|
+
});
|
|
2652
|
+
}
|
|
2653
|
+
}
|
|
2654
|
+
VideoThumbnailService.ɵprov = i0.ɵɵdefineInjectable({ factory: function VideoThumbnailService_Factory() { return new VideoThumbnailService(i0.ɵɵinject(i1.HttpClient), i0.ɵɵinject(PbUserRestApiService)); }, token: VideoThumbnailService, providedIn: "root" });
|
|
2655
|
+
VideoThumbnailService.decorators = [
|
|
2656
|
+
{ type: Injectable, args: [{
|
|
2657
|
+
providedIn: 'root'
|
|
2658
|
+
},] }
|
|
2659
|
+
];
|
|
2660
|
+
VideoThumbnailService.ctorParameters = () => [
|
|
2661
|
+
{ type: HttpClient },
|
|
2662
|
+
{ type: PbUserRestApiService }
|
|
2663
|
+
];
|
|
2664
|
+
|
|
2665
|
+
/*
|
|
2666
|
+
* Copyright (c) 2024 Pobuca.
|
|
2667
|
+
* All rights reserved.
|
|
2668
|
+
*/
|
|
2669
|
+
class VideoComponent extends AbstractBlock {
|
|
2670
|
+
constructor(imageUploader, chRef, ngb, videoThumbnailService) {
|
|
2671
|
+
super();
|
|
2672
|
+
this.imageUploader = imageUploader;
|
|
2673
|
+
this.chRef = chRef;
|
|
2674
|
+
this.ngb = ngb;
|
|
2675
|
+
this.videoThumbnailService = videoThumbnailService;
|
|
2676
|
+
this.destroy$ = new Subject();
|
|
2677
|
+
this.srcChange$ = new Subject();
|
|
2678
|
+
this.previousSrc = '';
|
|
2679
|
+
this.defaultPosterSrc = 'assets/placeholders/video.svg';
|
|
2680
|
+
this.isGeneratingThumbnail = false;
|
|
2681
|
+
}
|
|
2682
|
+
get align() {
|
|
2683
|
+
return this.block.options.align;
|
|
2684
|
+
}
|
|
2685
|
+
get src() {
|
|
2686
|
+
return this.block.src || '';
|
|
2687
|
+
}
|
|
2688
|
+
get posterSrc() {
|
|
2689
|
+
return (this.block.posterSrc || '').trim() || this.defaultPosterSrc;
|
|
2690
|
+
}
|
|
2691
|
+
get videoUrl() {
|
|
2692
|
+
return this.block.src || '';
|
|
2693
|
+
}
|
|
2694
|
+
ngOnInit() {
|
|
2695
|
+
this.srcChange$
|
|
2696
|
+
.pipe(debounceTime(500), takeUntil(this.destroy$))
|
|
2697
|
+
.subscribe((url) => __awaiter(this, void 0, void 0, function* () {
|
|
2698
|
+
yield this.generateThumbnail(url);
|
|
2699
|
+
}));
|
|
2700
|
+
if (this.block.src) {
|
|
2701
|
+
this.previousSrc = this.block.src;
|
|
2702
|
+
this.srcChange$.next(this.block.src);
|
|
2703
|
+
}
|
|
2704
|
+
}
|
|
2705
|
+
ngDoCheck() {
|
|
2706
|
+
// Detect changes to block.src from external sources (like settings panel)
|
|
2707
|
+
if (this.block && this.block.src !== this.previousSrc) {
|
|
2708
|
+
this.previousSrc = this.block.src || '';
|
|
2709
|
+
this.srcChange$.next(this.previousSrc);
|
|
2710
|
+
}
|
|
2711
|
+
}
|
|
2712
|
+
ngOnDestroy() {
|
|
2713
|
+
this.destroy$.next();
|
|
2714
|
+
this.destroy$.complete();
|
|
2715
|
+
}
|
|
2716
|
+
onVideoUrlChange(url) {
|
|
2717
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2718
|
+
this.block.src = url;
|
|
2719
|
+
this.previousSrc = url;
|
|
2720
|
+
this.srcChange$.next(url);
|
|
2721
|
+
});
|
|
2722
|
+
}
|
|
2723
|
+
generateThumbnail(url) {
|
|
2724
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2725
|
+
if (!url) {
|
|
2726
|
+
this.block.posterSrc = this.defaultPosterSrc;
|
|
2727
|
+
this.chRef.markForCheck();
|
|
2728
|
+
return;
|
|
2729
|
+
}
|
|
2730
|
+
this.isGeneratingThumbnail = true;
|
|
2731
|
+
this.chRef.markForCheck();
|
|
2732
|
+
try {
|
|
2733
|
+
const thumbnail = yield this.videoThumbnailService.generateThumbnail(url);
|
|
2734
|
+
if (thumbnail) {
|
|
2735
|
+
this.block.posterSrc = thumbnail;
|
|
2736
|
+
}
|
|
2737
|
+
else {
|
|
2738
|
+
throw new Error('Failed to generate thumbnail');
|
|
2739
|
+
}
|
|
2740
|
+
}
|
|
2741
|
+
catch (error) {
|
|
2742
|
+
console.error('Error generating thumbnail:', error);
|
|
2743
|
+
this.block.posterSrc = 'assets/placeholders/error.svg';
|
|
2744
|
+
}
|
|
2745
|
+
finally {
|
|
2746
|
+
this.isGeneratingThumbnail = false;
|
|
2747
|
+
this.chRef.markForCheck();
|
|
2748
|
+
}
|
|
2749
|
+
});
|
|
2750
|
+
}
|
|
2751
|
+
uploadVideo() {
|
|
2752
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2753
|
+
const src = yield this.imageUploader.browse$().toPromise();
|
|
2754
|
+
if (src) {
|
|
2755
|
+
this.block.src = src;
|
|
2756
|
+
this.chRef.markForCheck();
|
|
2757
|
+
}
|
|
2758
|
+
});
|
|
2759
|
+
}
|
|
2760
|
+
uploadPoster() {
|
|
2761
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2762
|
+
const src = yield this.imageUploader.browse$().toPromise();
|
|
2763
|
+
if (src) {
|
|
2764
|
+
this.block.posterSrc = src;
|
|
2765
|
+
this.chRef.markForCheck();
|
|
2766
|
+
}
|
|
2767
|
+
});
|
|
2768
|
+
}
|
|
2769
|
+
getVideoStyles() {
|
|
2770
|
+
const { border, width, height, padding } = this.block.options;
|
|
2771
|
+
return Object.assign(Object.assign({ width: createWidthHeight(width), height: createWidthHeight(height) }, createPadding(padding)), createBorder(border));
|
|
2772
|
+
}
|
|
2773
|
+
}
|
|
2774
|
+
VideoComponent.decorators = [
|
|
2775
|
+
{ type: Component, args: [{
|
|
2776
|
+
selector: 'pb-video',
|
|
2777
|
+
template: "<!--\n ~ Copyright (c) 2024 Pobuca.\n ~ All rights reserved.\n -->\n\n<a [href]=\"videoUrl || '#'\" [attr.target]=\"block.options.link?.target || '_blank'\"\n style=\"display: inline-block; text-decoration: none;\" [style.pointer-events]=\"ngb.Email ? 'none' : 'auto'\">\n <img [src]=\"posterSrc\" [title]=\"block.options.title\" [ngStyle]=\"getVideoStyles()\" alt=\"Video thumbnail\" />\n</a>",
|
|
2778
|
+
styles: [":host{display:block;line-height:0}:host:hover .overflow{opacity:1}.overflow{position:absolute;top:0;right:0;bottom:0;left:0;background-color:rgba(0,0,0,.3);opacity:0;will-change:opacity;transition:opacity .3s cubic-bezier(.075,.82,.165,1);cursor:pointer;color:#fff;display:flex;align-items:center;justify-content:center;font-size:3em}.overflow mat-icon{opacity:.8}img,video{max-width:100%;box-sizing:border-box}"]
|
|
2779
|
+
},] }
|
|
2780
|
+
];
|
|
2781
|
+
VideoComponent.ctorParameters = () => [
|
|
2782
|
+
{ type: PbUserImageUploaderService },
|
|
2783
|
+
{ type: ChangeDetectorRef },
|
|
2784
|
+
{ type: PbEmailBuilderService },
|
|
2785
|
+
{ type: VideoThumbnailService }
|
|
2786
|
+
];
|
|
2787
|
+
VideoComponent.propDecorators = {
|
|
2788
|
+
align: [{ type: HostBinding, args: ['style.textAlign',] }]
|
|
2789
|
+
};
|
|
2790
|
+
|
|
2447
2791
|
/*
|
|
2448
2792
|
* Copyright (c) 2024 Pobuca.
|
|
2449
2793
|
* All rights reserved.
|
|
@@ -2579,6 +2923,7 @@ class DynamicComponentDirective {
|
|
|
2579
2923
|
this.viewContainerRef = viewContainerRef;
|
|
2580
2924
|
cStore.set('text', TextElementComponent);
|
|
2581
2925
|
cStore.set('image', ImageComponent);
|
|
2926
|
+
cStore.set('video', VideoComponent);
|
|
2582
2927
|
cStore.set('button', ButtonComponent);
|
|
2583
2928
|
cStore.set('divider', DividerComponent);
|
|
2584
2929
|
cStore.set('spacer', SpacerComponent);
|
|
@@ -2726,8 +3071,19 @@ class FontStylesComponent {
|
|
|
2726
3071
|
get fontWeightList() {
|
|
2727
3072
|
return this.isGoogleFont() ? this.fontsMap.get(this.font.family) : [100, 400, 500, 700, 900];
|
|
2728
3073
|
}
|
|
3074
|
+
get customFonts() {
|
|
3075
|
+
return (this.pbEmailObject.Email.customFonts || []).map(f => f.family);
|
|
3076
|
+
}
|
|
3077
|
+
get customStack() {
|
|
3078
|
+
return this.customFonts.join(', ');
|
|
3079
|
+
}
|
|
2729
3080
|
get fontFamilyList() {
|
|
2730
|
-
|
|
3081
|
+
const stack = this.customStack;
|
|
3082
|
+
return [...(stack ? [stack] : []), ...this.fontsMap.keys(), ...this.fallbackFonts];
|
|
3083
|
+
}
|
|
3084
|
+
get fallbackFontChoices() {
|
|
3085
|
+
const stack = this.customStack;
|
|
3086
|
+
return [...(stack ? [stack] : []), ...this.fallbackFonts];
|
|
2731
3087
|
}
|
|
2732
3088
|
get styles() {
|
|
2733
3089
|
return [...this.stylesMap.keys()];
|
|
@@ -2735,6 +3091,9 @@ class FontStylesComponent {
|
|
|
2735
3091
|
markForCheck() {
|
|
2736
3092
|
this.pbEmailObject.markForCheck();
|
|
2737
3093
|
}
|
|
3094
|
+
isCustomFont() {
|
|
3095
|
+
return this.customFonts.includes(this.font.family);
|
|
3096
|
+
}
|
|
2738
3097
|
isGoogleFont() {
|
|
2739
3098
|
return this.fontsMap.has(this.font.family);
|
|
2740
3099
|
}
|
|
@@ -2759,12 +3118,13 @@ FontStylesComponent.decorators = [
|
|
|
2759
3118
|
</mat-option>
|
|
2760
3119
|
</mat-select>
|
|
2761
3120
|
<mat-hint *ngIf="isGoogleFont()" i18n="settings|Partial support">Partial support.</mat-hint>
|
|
2762
|
-
<mat-hint *ngIf="
|
|
3121
|
+
<mat-hint *ngIf="isCustomFont()" i18n="settings|Custom font">Custom font.</mat-hint>
|
|
3122
|
+
<mat-hint *ngIf="!isGoogleFont() && !isCustomFont()" i18n="settings|Full support">Full support.</mat-hint>
|
|
2763
3123
|
</mat-form-field>
|
|
2764
3124
|
<mat-form-field appearance="outline" *ngIf="hasProperty('fallback')">
|
|
2765
3125
|
<mat-label i18n="settings|Font Fallback">Fallback</mat-label>
|
|
2766
|
-
<mat-select [(value)]="font.fallback" [disabled]="!isGoogleFont()" disableRipple (selectionChange)="markForCheck()">
|
|
2767
|
-
<mat-option *ngFor="let name of
|
|
3126
|
+
<mat-select [(value)]="font.fallback" [disabled]="!isGoogleFont() && !isCustomFont()" disableRipple (selectionChange)="markForCheck()">
|
|
3127
|
+
<mat-option *ngFor="let name of fallbackFontChoices" [ngStyle]="{ fontFamily: name }" [value]="name">
|
|
2768
3128
|
{{ name }}
|
|
2769
3129
|
</mat-option>
|
|
2770
3130
|
</mat-select>
|
|
@@ -3827,7 +4187,7 @@ class BlockSettingsComponent {
|
|
|
3827
4187
|
BlockSettingsComponent.decorators = [
|
|
3828
4188
|
{ type: Component, args: [{
|
|
3829
4189
|
selector: 'pb-block-settings',
|
|
3830
|
-
template: "<!--\n ~ Copyright (c) 2024 Pobuca.\n ~ All rights reserved.\n -->\n\n<ng-container *ngIf=\"block$ | async as currentBlock\">\n <mat-accordion>\n <mat-expansion-panel expanded *ngIf=\"hasProperty(currentBlock.options, 'font')\">\n <mat-expansion-panel-header i18n=\"settings|Font\">\n Font\n </mat-expansion-panel-header>\n <ng-template matExpansionPanelContent>\n <pb-color [options]=\"currentBlock.options\" key=\"color\"></pb-color>\n <pb-font-styles [font]=\"currentBlock.options.font\"></pb-font-styles>\n <pb-line-height *ngIf=\"currentBlock.type !== 'social'\" [lineHeight]=\"currentBlock.options.lineHeight\">\n </pb-line-height>\n </ng-template>\n </mat-expansion-panel>\n\n <ng-container *ngIf=\"currentBlock.type === 'image'\">\n <mat-expansion-panel expanded>\n <mat-expansion-panel-header i18n=\"settings|Image\">\n Image\n </mat-expansion-panel-header>\n <pb-image-upload [block]=\"currentBlock\"></pb-image-upload>\n </mat-expansion-panel>\n\n <mat-expansion-panel>\n <mat-expansion-panel-header i18n=\"settings|Image Attributes\">\n Attributes\n </mat-expansion-panel-header>\n <ng-template matExpansionPanelContent>\n <div class=\"group f-large\">\n <mat-form-field appearance=\"outline\">\n <mat-label i18n=\"settings|Image Alt\">Alt</mat-label>\n <input matInput [(ngModel)]=\"currentBlock.options.title\" type=\"text\" i18n-placeholder\n placeholder=\"settings|Image Alt\" (input)=\"markForCheck()\" />\n </mat-form-field>\n <pb-align [model]=\"currentBlock.options\"></pb-align>\n </div>\n <pb-link [link]=\"currentBlock.options.link\"></pb-link>\n </ng-template>\n </mat-expansion-panel>\n </ng-container>\n\n <ng-container *ngIf=\"currentBlock.type === 'button'\">\n <mat-expansion-panel>\n <mat-expansion-panel-header i18n=\"settings|Button Text\">\n Button Text\n </mat-expansion-panel-header>\n <ng-template matExpansionPanelContent>\n <mat-form-field appearance=\"outline\" style=\"width: 100%\">\n <mat-label i18n=\"settings|Button Text\">Button Text</mat-label>\n <input matInput [(ngModel)]=\"currentBlock.innerText\" type=\"text\" i18n-placeholder\n placeholder=\"settings|Button Text\" (input)=\"markForCheck()\" />\n </mat-form-field>\n </ng-template>\n </mat-expansion-panel>\n\n\n <mat-expansion-panel>\n <mat-expansion-panel-header i18n=\"settings|Background\">\n Background\n </mat-expansion-panel-header>\n <ng-template matExpansionPanelContent>\n <pb-color [options]=\"currentBlock.options\"></pb-color>\n </ng-template>\n </mat-expansion-panel>\n\n <mat-expansion-panel>\n <mat-expansion-panel-header i18n=\"settings|Button Attributes\">\n Attributes\n </mat-expansion-panel-header>\n <ng-template matExpansionPanelContent>\n <div class=\"group two\" style=\"padding-bottom: 0\">\n <pb-align [model]=\"currentBlock.options\" [disabled]=\"currentBlock.options.fullWidth\"></pb-align>\n <mat-slide-toggle style=\"margin-top: -24px\" [(ngModel)]=\"currentBlock.options.fullWidth\"\n (change)=\"markForCheck()\">\n <ng-container i18n=\"settings|Button Full Width\">Full Width</ng-container>\n </mat-slide-toggle>\n </div>\n <pb-link [link]=\"currentBlock.options.link\"></pb-link>\n <pb-padding [padding]=\"currentBlock.options.innerPadding\"></pb-padding>\n </ng-template>\n </mat-expansion-panel>\n </ng-container>\n\n <mat-expansion-panel [expanded]=\"currentBlock.type === 'spacer'\"\n *ngIf=\"hasProperty(currentBlock.options, 'width') || hasProperty(currentBlock.options, 'height')\">\n <mat-expansion-panel-header i18n=\"settings|Sizes\">\n Sizes\n </mat-expansion-panel-header>\n <ng-template matExpansionPanelContent>\n <pb-width-height *ngIf=\"hasProperty(currentBlock.options, 'width')\" [model]=\"currentBlock.options.width\"\n label=\"width\"></pb-width-height>\n <pb-width-height *ngIf=\"hasProperty(currentBlock.options, 'height')\" [model]=\"currentBlock.options.height\"\n label=\"height\"></pb-width-height>\n </ng-template>\n </mat-expansion-panel>\n\n <mat-expansion-panel *ngIf=\"hasProperty(currentBlock.options, 'background')\">\n <mat-expansion-panel-header i18n=\"settings|Background\">\n Background\n </mat-expansion-panel-header>\n <ng-template matExpansionPanelContent>\n <pb-color [options]=\"currentBlock.options.background\"></pb-color>\n </ng-template>\n backgroundColor\n </mat-expansion-panel>\n\n <mat-expansion-panel [expanded]=\"currentBlock.type === 'divider'\"\n *ngIf=\"hasProperty(currentBlock.options, 'border')\">\n <mat-expansion-panel-header>\n <ng-container i18n=\"settings|Divider Styles\" *ngIf=\"currentBlock.type === 'divider'\">Styles</ng-container>\n <ng-container i18n=\"settings|Border\" *ngIf=\"currentBlock.type !== 'divider'\">Border</ng-container>\n </mat-expansion-panel-header>\n <ng-template matExpansionPanelContent>\n <pb-border [border]=\"currentBlock.options.border\"></pb-border>\n </ng-template>\n </mat-expansion-panel>\n\n <ng-container *ngIf=\"currentBlock.type === 'social'\">\n <mat-expansion-panel>\n <mat-expansion-panel-header i18n=\"settings|Icons\">\n Icons\n </mat-expansion-panel-header>\n <ng-template matExpansionPanelContent>\n <mat-form-field appearance=\"outline\" style=\"width: 100%\">\n <mat-label i18n=\"settings|Add new Network\">Add new Network</mat-label>\n <mat-select (selectionChange)=\"addSocialNetwork($event, currentBlock)\" [disabled]=\"!socialNetworks.length\">\n <mat-option style=\"text-transform: capitalize\" *ngFor=\"let link of socialNetworks(currentBlock)\"\n [value]=\"link\">\n {{ link }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n </ng-template>\n </mat-expansion-panel>\n\n <mat-expansion-panel class=\"networks-list\" *ngFor=\"let network of currentBlock.networks\">\n <mat-expansion-panel-header style=\"text-transform: capitalize\">\n <img [class]=\"network.name\" [src]=\"getSocialIcon(network.name)\" [alt]=\"network.name\" />\n {{ network.name }}\n </mat-expansion-panel-header>\n <ng-template matExpansionPanelContent>\n <div class=\"networks-list-item\">\n <div class=\"item-info\">\n <mat-form-field matLine appearance=\"outline\">\n <mat-label i18n=\"settings|Social Network Label\">Label</mat-label>\n <input matInput autocomplete=\"off\" [(ngModel)]=\"network.label\"\n i18n-placeholder=\"settings|Social Network Label\" placeholder=\"Label\" type=\"text\"\n (input)=\"markForCheck()\" />\n </mat-form-field>\n <button mat-stroked-button color=\"warn\" (click)=\"removeSocialNetwork(network, currentBlock)\">\n <mat-icon>delete_forever</mat-icon>\n </button>\n </div>\n <mat-form-field matLine appearance=\"outline\">\n <mat-label style=\"text-transform: capitalize\">\n {{ network.name }} <ng-container i18n=\"settings|Social Network Link\">Link</ng-container>\n </mat-label>\n <input autocomplete=\"off\" matInput [(ngModel)]=\"network.href\" type=\"url\" (input)=\"markForCheck()\" />\n </mat-form-field>\n </div>\n </ng-template>\n </mat-expansion-panel>\n\n <mat-expansion-panel>\n <mat-expansion-panel-header i18n=\"settings|Social Styles\">\n Styles\n </mat-expansion-panel-header>\n <ng-template matExpansionPanelContent>\n <div class=\"group two\" style=\"padding-bottom: 0\">\n <mat-form-field appearance=\"outline\">\n <mat-label i18n=\"settings|Social Model\">Mode</mat-label>\n <mat-select (selectionChange)=\"markForCheck()\" i18n-placeholder=\"settings|Social Model\" placeholder=\"Mode\"\n [(value)]=\"currentBlock.options.mode\" disableRipple>\n <mat-option *ngFor=\"let mode of ['horizontal', 'vertical']\" [value]=\"mode\">\n {{ mode }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n <pb-align [model]=\"currentBlock.options\"></pb-align>\n </div>\n <pb-line-height [units]=\"['px']\" [lineHeight]=\"currentBlock.options.iconSize\" label=\"Icon Size\">\n </pb-line-height>\n <pb-padding [padding]=\"currentBlock.options.innerPadding\"></pb-padding>\n </ng-template>\n </mat-expansion-panel>\n </ng-container>\n\n <mat-expansion-panel *ngIf=\"hasProperty(currentBlock.options, 'padding')\">\n <mat-expansion-panel-header i18n=\"settings|Padding\">\n Padding\n </mat-expansion-panel-header>\n <ng-template matExpansionPanelContent>\n <pb-padding [padding]=\"currentBlock.options.padding\"></pb-padding>\n </ng-template>\n </mat-expansion-panel>\n </mat-accordion>\n</ng-container>\n",
|
|
4190
|
+
template: "<!--\n ~ Copyright (c) 2024 Pobuca.\n ~ All rights reserved.\n -->\n\n<ng-container *ngIf=\"block$ | async as currentBlock\">\n <mat-accordion>\n <mat-expansion-panel expanded *ngIf=\"hasProperty(currentBlock.options, 'font')\">\n <mat-expansion-panel-header i18n=\"settings|Font\">\n Font\n </mat-expansion-panel-header>\n <ng-template matExpansionPanelContent>\n <pb-color [options]=\"currentBlock.options\" key=\"color\"></pb-color>\n <pb-font-styles [font]=\"currentBlock.options.font\"></pb-font-styles>\n <pb-line-height *ngIf=\"currentBlock.type !== 'social'\" [lineHeight]=\"currentBlock.options.lineHeight\">\n </pb-line-height>\n </ng-template>\n </mat-expansion-panel>\n\n <ng-container *ngIf=\"currentBlock.type === 'image'\">\n <mat-expansion-panel expanded>\n <mat-expansion-panel-header i18n=\"settings|Image\">\n Image\n </mat-expansion-panel-header>\n <pb-image-upload [block]=\"currentBlock\"></pb-image-upload>\n </mat-expansion-panel>\n\n <mat-expansion-panel>\n <mat-expansion-panel-header i18n=\"settings|Image Attributes\">\n Attributes\n </mat-expansion-panel-header>\n <ng-template matExpansionPanelContent>\n <div class=\"group f-large\">\n <mat-form-field appearance=\"outline\">\n <mat-label i18n=\"settings|Image Alt\">Alt</mat-label>\n <input matInput [(ngModel)]=\"currentBlock.options.title\" type=\"text\" i18n-placeholder\n placeholder=\"settings|Image Alt\" (input)=\"markForCheck()\" />\n </mat-form-field>\n <pb-align [model]=\"currentBlock.options\"></pb-align>\n </div>\n <pb-link [link]=\"currentBlock.options.link\"></pb-link>\n </ng-template>\n </mat-expansion-panel>\n </ng-container>\n\n <ng-container *ngIf=\"currentBlock.type === 'video'\">\n <mat-expansion-panel expanded>\n <mat-expansion-panel-header i18n=\"settings|Video\">\n Video URL\n </mat-expansion-panel-header>\n <ng-template matExpansionPanelContent>\n <div class=\"group\" style=\"grid-template-columns: 1fr;\">\n <mat-form-field appearance=\"outline\" style=\"width: 100%\">\n <mat-label i18n=\"settings|Video URL\">Video URL (YouTube or Vimeo)</mat-label>\n <input matInput [(ngModel)]=\"currentBlock.src\" type=\"url\" i18n-placeholder\n placeholder=\"settings|Video URL\" (input)=\"markForCheck()\" />\n <mat-hint i18n=\"settings|Video URL Hint\">Thumbnail with play button will be auto-generated</mat-hint>\n </mat-form-field>\n </div>\n </ng-template>\n </mat-expansion-panel>\n\n <mat-expansion-panel>\n <mat-expansion-panel-header i18n=\"settings|Video Attributes\">\n Attributes\n </mat-expansion-panel-header>\n <ng-template matExpansionPanelContent>\n <div class=\"group f-large\">\n <mat-form-field appearance=\"outline\">\n <mat-label i18n=\"settings|Video Alt\">Alt Text</mat-label>\n <input matInput [(ngModel)]=\"currentBlock.options.title\" type=\"text\" i18n-placeholder\n placeholder=\"settings|Video Alt\" (input)=\"markForCheck()\" />\n </mat-form-field>\n <pb-align [model]=\"currentBlock.options\"></pb-align>\n </div>\n </ng-template>\n </mat-expansion-panel>\n </ng-container>\n\n <ng-container *ngIf=\"currentBlock.type === 'button'\">\n <mat-expansion-panel>\n <mat-expansion-panel-header i18n=\"settings|Button Text\">\n Button Text\n </mat-expansion-panel-header>\n <ng-template matExpansionPanelContent>\n <mat-form-field appearance=\"outline\" style=\"width: 100%\">\n <mat-label i18n=\"settings|Button Text\">Button Text</mat-label>\n <input matInput [(ngModel)]=\"currentBlock.innerText\" type=\"text\" i18n-placeholder\n placeholder=\"settings|Button Text\" (input)=\"markForCheck()\" />\n </mat-form-field>\n </ng-template>\n </mat-expansion-panel>\n\n\n <mat-expansion-panel>\n <mat-expansion-panel-header i18n=\"settings|Background\">\n Background\n </mat-expansion-panel-header>\n <ng-template matExpansionPanelContent>\n <pb-color [options]=\"currentBlock.options\"></pb-color>\n </ng-template>\n </mat-expansion-panel>\n\n <mat-expansion-panel>\n <mat-expansion-panel-header i18n=\"settings|Button Attributes\">\n Attributes\n </mat-expansion-panel-header>\n <ng-template matExpansionPanelContent>\n <div class=\"group two\" style=\"padding-bottom: 0\">\n <pb-align [model]=\"currentBlock.options\" [disabled]=\"currentBlock.options.fullWidth\"></pb-align>\n <mat-slide-toggle style=\"margin-top: -24px\" [(ngModel)]=\"currentBlock.options.fullWidth\"\n (change)=\"markForCheck()\">\n <ng-container i18n=\"settings|Button Full Width\">Full Width</ng-container>\n </mat-slide-toggle>\n </div>\n <pb-link [link]=\"currentBlock.options.link\"></pb-link>\n <pb-padding [padding]=\"currentBlock.options.innerPadding\"></pb-padding>\n </ng-template>\n </mat-expansion-panel>\n </ng-container>\n\n <mat-expansion-panel [expanded]=\"currentBlock.type === 'spacer'\"\n *ngIf=\"hasProperty(currentBlock.options, 'width') || hasProperty(currentBlock.options, 'height')\">\n <mat-expansion-panel-header i18n=\"settings|Sizes\">\n Sizes\n </mat-expansion-panel-header>\n <ng-template matExpansionPanelContent>\n <pb-width-height *ngIf=\"hasProperty(currentBlock.options, 'width')\" [model]=\"currentBlock.options.width\"\n label=\"width\"></pb-width-height>\n <pb-width-height *ngIf=\"hasProperty(currentBlock.options, 'height')\" [model]=\"currentBlock.options.height\"\n label=\"height\"></pb-width-height>\n </ng-template>\n </mat-expansion-panel>\n\n <mat-expansion-panel *ngIf=\"hasProperty(currentBlock.options, 'background')\">\n <mat-expansion-panel-header i18n=\"settings|Background\">\n Background\n </mat-expansion-panel-header>\n <ng-template matExpansionPanelContent>\n <pb-color [options]=\"currentBlock.options.background\"></pb-color>\n </ng-template>\n backgroundColor\n </mat-expansion-panel>\n\n <mat-expansion-panel [expanded]=\"currentBlock.type === 'divider'\"\n *ngIf=\"hasProperty(currentBlock.options, 'border')\">\n <mat-expansion-panel-header>\n <ng-container i18n=\"settings|Divider Styles\" *ngIf=\"currentBlock.type === 'divider'\">Styles</ng-container>\n <ng-container i18n=\"settings|Border\" *ngIf=\"currentBlock.type !== 'divider'\">Border</ng-container>\n </mat-expansion-panel-header>\n <ng-template matExpansionPanelContent>\n <pb-border [border]=\"currentBlock.options.border\"></pb-border>\n </ng-template>\n </mat-expansion-panel>\n\n <ng-container *ngIf=\"currentBlock.type === 'social'\">\n <mat-expansion-panel>\n <mat-expansion-panel-header i18n=\"settings|Icons\">\n Icons\n </mat-expansion-panel-header>\n <ng-template matExpansionPanelContent>\n <mat-form-field appearance=\"outline\" style=\"width: 100%\">\n <mat-label i18n=\"settings|Add new Network\">Add new Network</mat-label>\n <mat-select (selectionChange)=\"addSocialNetwork($event, currentBlock)\" [disabled]=\"!socialNetworks.length\">\n <mat-option style=\"text-transform: capitalize\" *ngFor=\"let link of socialNetworks(currentBlock)\"\n [value]=\"link\">\n {{ link }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n </ng-template>\n </mat-expansion-panel>\n\n <mat-expansion-panel class=\"networks-list\" *ngFor=\"let network of currentBlock.networks\">\n <mat-expansion-panel-header style=\"text-transform: capitalize\">\n <img [class]=\"network.name\" [src]=\"getSocialIcon(network.name)\" [alt]=\"network.name\" />\n {{ network.name }}\n </mat-expansion-panel-header>\n <ng-template matExpansionPanelContent>\n <div class=\"networks-list-item\">\n <div class=\"item-info\">\n <mat-form-field matLine appearance=\"outline\">\n <mat-label i18n=\"settings|Social Network Label\">Label</mat-label>\n <input matInput autocomplete=\"off\" [(ngModel)]=\"network.label\"\n i18n-placeholder=\"settings|Social Network Label\" placeholder=\"Label\" type=\"text\"\n (input)=\"markForCheck()\" />\n </mat-form-field>\n <button mat-stroked-button color=\"warn\" (click)=\"removeSocialNetwork(network, currentBlock)\">\n <mat-icon>delete_forever</mat-icon>\n </button>\n </div>\n <mat-form-field matLine appearance=\"outline\">\n <mat-label style=\"text-transform: capitalize\">\n {{ network.name }} <ng-container i18n=\"settings|Social Network Link\">Link</ng-container>\n </mat-label>\n <input autocomplete=\"off\" matInput [(ngModel)]=\"network.href\" type=\"url\" (input)=\"markForCheck()\" />\n </mat-form-field>\n </div>\n </ng-template>\n </mat-expansion-panel>\n\n <mat-expansion-panel>\n <mat-expansion-panel-header i18n=\"settings|Social Styles\">\n Styles\n </mat-expansion-panel-header>\n <ng-template matExpansionPanelContent>\n <div class=\"group two\" style=\"padding-bottom: 0\">\n <mat-form-field appearance=\"outline\">\n <mat-label i18n=\"settings|Social Model\">Mode</mat-label>\n <mat-select (selectionChange)=\"markForCheck()\" i18n-placeholder=\"settings|Social Model\" placeholder=\"Mode\"\n [(value)]=\"currentBlock.options.mode\" disableRipple>\n <mat-option *ngFor=\"let mode of ['horizontal', 'vertical']\" [value]=\"mode\">\n {{ mode }}\n </mat-option>\n </mat-select>\n </mat-form-field>\n <pb-align [model]=\"currentBlock.options\"></pb-align>\n </div>\n <pb-line-height [units]=\"['px']\" [lineHeight]=\"currentBlock.options.iconSize\" label=\"Icon Size\">\n </pb-line-height>\n <pb-padding [padding]=\"currentBlock.options.innerPadding\"></pb-padding>\n </ng-template>\n </mat-expansion-panel>\n </ng-container>\n\n <mat-expansion-panel *ngIf=\"hasProperty(currentBlock.options, 'padding')\">\n <mat-expansion-panel-header i18n=\"settings|Padding\">\n Padding\n </mat-expansion-panel-header>\n <ng-template matExpansionPanelContent>\n <pb-padding [padding]=\"currentBlock.options.padding\"></pb-padding>\n </ng-template>\n </mat-expansion-panel>\n </mat-accordion>\n</ng-container>",
|
|
3831
4191
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
3832
4192
|
encapsulation: ViewEncapsulation.None,
|
|
3833
4193
|
styles: ["/*!\n * Copyright (c) 2024 Pobuca.\n * All rights reserved.\n */.networks-list mat-expansion-panel-header .mat-content{place-items:center}.networks-list mat-expansion-panel-header img{width:20px;margin:0 .5rem 0 0;border-radius:3px;background-color:#000}.networks-list-item{width:100%;display:grid;row-gap:.5rem}.networks-list-item .item-info{display:grid;grid-template-columns:2fr 1fr;-moz-column-gap:.5rem;column-gap:.5rem}.networks-list-item .item-info button{align-self:baseline;margin:.25rem 0;height:50px}.networks-list-item .item-info ::ng-deep .mat-form-field-wrapper{padding-bottom:0;margin-bottom:0}"]
|
|
@@ -4261,6 +4621,7 @@ PbEmailBuilderModule.decorators = [
|
|
|
4261
4621
|
PreviewTemplateComponent,
|
|
4262
4622
|
TextElementComponent,
|
|
4263
4623
|
ImageComponent,
|
|
4624
|
+
VideoComponent,
|
|
4264
4625
|
ButtonComponent,
|
|
4265
4626
|
DividerComponent,
|
|
4266
4627
|
SpacerComponent,
|
|
@@ -4293,6 +4654,7 @@ PbEmailBuilderModule.decorators = [
|
|
|
4293
4654
|
entryComponents: [
|
|
4294
4655
|
TextElementComponent,
|
|
4295
4656
|
ImageComponent,
|
|
4657
|
+
VideoComponent,
|
|
4296
4658
|
ButtonComponent,
|
|
4297
4659
|
DividerComponent,
|
|
4298
4660
|
SpacerComponent,
|
|
@@ -4312,7 +4674,8 @@ PbEmailBuilderModule.decorators = [
|
|
|
4312
4674
|
// { provide: PB_BLOCK_ELEMENT, useClass: TextBlock, multi: true },
|
|
4313
4675
|
PbEmailBuilderService,
|
|
4314
4676
|
PbEmailObjectStoreService,
|
|
4315
|
-
PbUserInterfaceService
|
|
4677
|
+
PbUserInterfaceService,
|
|
4678
|
+
VideoThumbnailService
|
|
4316
4679
|
]
|
|
4317
4680
|
},] }
|
|
4318
4681
|
];
|
|
@@ -4331,5 +4694,5 @@ PbEmailBuilderModule.ctorParameters = () => [
|
|
|
4331
4694
|
* Generated bundle index. Do not edit.
|
|
4332
4695
|
*/
|
|
4333
4696
|
|
|
4334
|
-
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, bytesToSize, cloneDeep, createBackground, createBorder, createCustomRestApiService, createFont, createLineHeight, createMargin, createPadding, createUserMiddlewareService, createUserUploaderService, createUsersIpStorage, createWidthHeight, defaultColumnsOptions, defaultsDeep, deferOf, getAssetByPath, isEqual, ɵ0, PbEmailObjectStoreService as ɵa, PbUserInterfaceService as ɵb,
|
|
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, PbUserInterfaceService as ɵb, AlignComponent as ɵba, DirectionComponent as ɵbb, BackRepatComponent as ɵbc, ConfirmDialogComponent as ɵbd, ImageUploadComponent as ɵbe, BlockSettingsComponent as ɵbf, StructureSettingsComponent as ɵbg, GeneralSettingsComponent as ɵbh, UploadBottomSheetDialogComponent as ɵbi, UploadImageGalleryComponent as ɵbj, TemplateListDialogComponent as ɵbk, ImportDialogComponent as ɵbl, IpInterceptorInterceptor as ɵbm, LIBRARY_IS_PRO as ɵbn, FreeUsersRestApi as ɵc, FreeUsersPbStorage as ɵd, StructureComponent as ɵe, BlockComponent as ɵf, DynamicComponentDirective as ɵg, TextElementComponent as ɵh, AbstractBlock as ɵi, ImageComponent as ɵj, VideoComponent as ɵk, VideoThumbnailService as ɵl, ButtonComponent as ɵm, DividerComponent as ɵn, SpacerComponent as ɵo, SocialComponent as ɵp, BuilderContainerComponent as ɵq, FontStylesComponent as ɵr, PaddingComponent as ɵs, MarginComponent as ɵt, GapsComponent as ɵu, LineHeightComponent as ɵv, WidthHeightComponent as ɵw, BorderComponent as ɵx, ColorComponent as ɵy, LinkComponent as ɵz };
|
|
4335
4698
|
//# sourceMappingURL=pobuca-email-builder.js.map
|