@pobuca/email-builder 1.1.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/bundles/pobuca-email-builder.umd.js +4952 -4494
- 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 +54 -54
- package/esm2015/lib/classes/Elements.js +278 -229
- package/esm2015/lib/classes/Structure.js +89 -89
- package/esm2015/lib/components/block/block.component.js +89 -89
- package/esm2015/lib/components/block-settings/block-settings.component.js +53 -53
- package/esm2015/lib/components/builder-container/builder-container.component.js +114 -114
- package/esm2015/lib/components/dialog.component.js +30 -30
- package/esm2015/lib/components/general-settings/general-settings.component.js +25 -25
- package/esm2015/lib/components/import-dialog/import-dialog.component.js +62 -62
- package/esm2015/lib/components/preview.component.js +89 -89
- package/esm2015/lib/components/structure/structure.component.js +163 -163
- package/esm2015/lib/components/structure-settings/structure-settings.component.js +31 -31
- package/esm2015/lib/components/template-list-dialog/template-list-dialog.component.js +45 -45
- package/esm2015/lib/directives/dynamic-component.directive.js +48 -46
- package/esm2015/lib/elements/abstract-block.js +23 -23
- package/esm2015/lib/elements/button/button.component.js +29 -29
- package/esm2015/lib/elements/divider/divider.component.js +30 -30
- package/esm2015/lib/elements/image/image.component.js +64 -54
- package/esm2015/lib/elements/social/social.component.js +42 -42
- package/esm2015/lib/elements/spacer/spacer.component.js +30 -30
- package/esm2015/lib/elements/text-element/text-element.component.js +80 -80
- package/esm2015/lib/elements/video/video.component.js +147 -0
- package/esm2015/lib/groups/align.js +79 -79
- package/esm2015/lib/groups/back-repeat.js +55 -55
- package/esm2015/lib/groups/border.js +102 -102
- package/esm2015/lib/groups/color.js +139 -139
- package/esm2015/lib/groups/direction.js +63 -63
- package/esm2015/lib/groups/font-styles.js +127 -127
- package/esm2015/lib/groups/gaps.js +45 -45
- package/esm2015/lib/groups/line-height.js +68 -68
- package/esm2015/lib/groups/link.js +67 -67
- package/esm2015/lib/groups/margin.js +45 -45
- package/esm2015/lib/groups/padding.js +53 -53
- package/esm2015/lib/groups/upload-image.js +112 -112
- package/esm2015/lib/groups/width-height.js +94 -94
- package/esm2015/lib/interceptors/pb-interceptor.interceptor.js +51 -51
- package/esm2015/lib/interfaces/interfaces.js +13 -13
- package/esm2015/lib/pb-email-builder.component.js +258 -258
- package/esm2015/lib/pb-email-builder.module.js +296 -291
- package/esm2015/lib/pb-email-builder.service.js +134 -134
- package/esm2015/lib/pipes/slugify.pipe.js +39 -39
- package/esm2015/lib/services/internals/pb-email-object-store/pb-email-object-store.service.js +180 -175
- package/esm2015/lib/services/internals/user-interfaces/user-interface.service.js +122 -122
- package/esm2015/lib/services/pb-storage/FreeUsersStorage.class.js +11 -11
- package/esm2015/lib/services/pb-storage/index.js +7 -7
- package/esm2015/lib/services/pb-storage/pb-storage.service.js +79 -79
- package/esm2015/lib/services/user-image-uploader-service/free-users-image-uploader.service.js +26 -26
- package/esm2015/lib/services/user-image-uploader-service/index.js +8 -8
- package/esm2015/lib/services/user-image-uploader-service/paid-users-image-uploader.service.js +30 -30
- package/esm2015/lib/services/user-image-uploader-service/upload-bottom-sheet-dialog/upload-bottom-sheet-dialog.component.js +112 -112
- package/esm2015/lib/services/user-image-uploader-service/upload-image-gallery/upload-image-gallery.component.js +91 -91
- package/esm2015/lib/services/user-image-uploader-service/user-image-uploader.service.js +26 -26
- package/esm2015/lib/services/user-middleware-service/FreeUsersMiddleware.js +31 -31
- package/esm2015/lib/services/user-middleware-service/PaidUsersMiddleware.js +12 -12
- package/esm2015/lib/services/user-middleware-service/index.js +8 -8
- package/esm2015/lib/services/user-middleware-service/pb-middlewares.service.js +195 -195
- package/esm2015/lib/services/user-rest-api-service/free-users-rest-api.service.js +16 -16
- package/esm2015/lib/services/user-rest-api-service/index.js +7 -7
- package/esm2015/lib/services/user-rest-api-service/user-rest-api.service.js +130 -116
- package/esm2015/lib/services/video-thumbnail.service.js +142 -0
- package/esm2015/lib/tokens/private-tokens.js +17 -17
- package/esm2015/lib/tokens/tokens.js +160 -159
- package/esm2015/lib/utils.js +147 -147
- package/esm2015/pobuca-email-builder.js +45 -43
- package/esm2015/public_api.js +26 -26
- package/fesm2015/pobuca-email-builder.js +4560 -4207
- package/fesm2015/pobuca-email-builder.js.map +1 -1
- package/lib/classes/DefaultEmail.d.ts +10 -10
- package/lib/classes/Elements.d.ts +72 -62
- package/lib/classes/Structure.d.ts +11 -11
- package/lib/components/block/block.component.d.ts +25 -25
- package/lib/components/block-settings/block-settings.component.d.ts +18 -18
- package/lib/components/builder-container/builder-container.component.d.ts +36 -36
- package/lib/components/dialog.component.d.ts +10 -10
- package/lib/components/general-settings/general-settings.component.d.ts +6 -6
- package/lib/components/import-dialog/import-dialog.component.d.ts +16 -16
- package/lib/components/preview.component.d.ts +18 -18
- package/lib/components/structure/structure.component.d.ts +43 -43
- package/lib/components/structure-settings/structure-settings.component.d.ts +9 -9
- package/lib/components/template-list-dialog/template-list-dialog.component.d.ts +15 -15
- package/lib/directives/dynamic-component.directive.d.ts +13 -13
- package/lib/elements/abstract-block.d.ts +8 -8
- package/lib/elements/button/button.component.d.ts +18 -18
- package/lib/elements/divider/divider.component.d.ts +10 -10
- package/lib/elements/image/image.component.d.ts +21 -19
- package/lib/elements/social/social.component.d.ts +21 -21
- package/lib/elements/spacer/spacer.component.d.ts +5 -5
- package/lib/elements/text-element/text-element.component.d.ts +52 -52
- package/lib/elements/video/video.component.d.ts +36 -0
- package/lib/groups/align.d.ts +17 -17
- package/lib/groups/back-repeat.d.ts +8 -8
- package/lib/groups/border.d.ts +13 -13
- package/lib/groups/color.d.ts +26 -26
- package/lib/groups/direction.d.ts +13 -13
- package/lib/groups/font-styles.d.ts +21 -21
- package/lib/groups/gaps.d.ts +7 -7
- package/lib/groups/line-height.d.ts +12 -12
- package/lib/groups/link.d.ts +11 -11
- package/lib/groups/margin.d.ts +8 -8
- package/lib/groups/padding.d.ts +8 -8
- package/lib/groups/upload-image.d.ts +19 -19
- package/lib/groups/width-height.d.ts +19 -19
- package/lib/interceptors/pb-interceptor.interceptor.d.ts +10 -10
- package/lib/interfaces/interfaces.d.ts +442 -430
- package/lib/pb-email-builder.component.d.ts +67 -67
- package/lib/pb-email-builder.module.d.ts +51 -51
- package/lib/pb-email-builder.service.d.ts +83 -83
- package/lib/pipes/slugify.pipe.d.ts +9 -9
- package/lib/services/internals/pb-email-object-store/pb-email-object-store.service.d.ts +51 -50
- package/lib/services/internals/user-interfaces/user-interface.service.d.ts +46 -46
- package/lib/services/pb-storage/FreeUsersStorage.class.d.ts +6 -6
- package/lib/services/pb-storage/index.d.ts +2 -2
- package/lib/services/pb-storage/pb-storage.service.d.ts +54 -54
- package/lib/services/user-image-uploader-service/free-users-image-uploader.service.d.ts +12 -12
- package/lib/services/user-image-uploader-service/index.d.ts +3 -3
- package/lib/services/user-image-uploader-service/paid-users-image-uploader.service.d.ts +14 -14
- package/lib/services/user-image-uploader-service/upload-bottom-sheet-dialog/upload-bottom-sheet-dialog.component.d.ts +28 -28
- package/lib/services/user-image-uploader-service/upload-image-gallery/upload-image-gallery.component.d.ts +27 -27
- package/lib/services/user-image-uploader-service/user-image-uploader.service.d.ts +26 -26
- package/lib/services/user-middleware-service/FreeUsersMiddleware.d.ts +15 -15
- package/lib/services/user-middleware-service/PaidUsersMiddleware.d.ts +7 -7
- package/lib/services/user-middleware-service/index.d.ts +3 -3
- package/lib/services/user-middleware-service/pb-middlewares.service.d.ts +190 -190
- package/lib/services/user-rest-api-service/free-users-rest-api.service.d.ts +10 -10
- package/lib/services/user-rest-api-service/index.d.ts +2 -2
- package/lib/services/user-rest-api-service/user-rest-api.service.d.ts +95 -82
- package/lib/services/video-thumbnail.service.d.ts +23 -0
- package/lib/tokens/private-tokens.d.ts +5 -5
- package/lib/tokens/tokens.d.ts +70 -70
- package/lib/utils.d.ts +88 -88
- package/package.json +1 -1
- package/pobuca-email-builder.d.ts +44 -42
- package/pobuca-email-builder.metadata.json +1 -1
- package/public_api.d.ts +16 -16
|
@@ -1,89 +1,89 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2024 Pobuca.
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
*/
|
|
5
|
-
import { defaultsDeep } from '../utils';
|
|
6
|
-
export const defaultColumnsOptions = {
|
|
7
|
-
background: {
|
|
8
|
-
color: 'transparent'
|
|
9
|
-
},
|
|
10
|
-
border: {
|
|
11
|
-
width: 0,
|
|
12
|
-
color: '#cccccc',
|
|
13
|
-
radius: 0,
|
|
14
|
-
style: 'solid'
|
|
15
|
-
},
|
|
16
|
-
verticalAlign: 'top'
|
|
17
|
-
};
|
|
18
|
-
export class Structure {
|
|
19
|
-
constructor(type = 'cols_1', elements = [], options) {
|
|
20
|
-
this.type = type;
|
|
21
|
-
this.elements = elements;
|
|
22
|
-
this.columns = 1;
|
|
23
|
-
this.id = Date.now();
|
|
24
|
-
this.options = {
|
|
25
|
-
fullWidth: false,
|
|
26
|
-
border: {
|
|
27
|
-
color: '#cccccc',
|
|
28
|
-
style: 'solid',
|
|
29
|
-
width: 0,
|
|
30
|
-
radius: 0
|
|
31
|
-
},
|
|
32
|
-
background: {
|
|
33
|
-
color: '#ffffff',
|
|
34
|
-
url: '',
|
|
35
|
-
repeat: 'repeat',
|
|
36
|
-
size: {
|
|
37
|
-
value: 100,
|
|
38
|
-
unit: 'px',
|
|
39
|
-
auto: true,
|
|
40
|
-
units: ['px', '%', 'cover', 'contain']
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
padding: {
|
|
44
|
-
top: 4,
|
|
45
|
-
right: 4,
|
|
46
|
-
bottom: 4,
|
|
47
|
-
left: 4
|
|
48
|
-
},
|
|
49
|
-
margin: {
|
|
50
|
-
top: 0,
|
|
51
|
-
bottom: 0
|
|
52
|
-
},
|
|
53
|
-
gaps: [4, 4]
|
|
54
|
-
};
|
|
55
|
-
if (!elements.length) {
|
|
56
|
-
if (['cols_2', 'cols_12', 'cols_21'].includes(type)) {
|
|
57
|
-
this.columns = 2;
|
|
58
|
-
}
|
|
59
|
-
else if (type === 'cols_3') {
|
|
60
|
-
this.columns = 3;
|
|
61
|
-
}
|
|
62
|
-
else if (type === 'cols_4') {
|
|
63
|
-
this.columns = 4;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
const columns = Array.from({ length: this.columns }, () => defaultColumnsOptions);
|
|
67
|
-
let columnsWidth = [1];
|
|
68
|
-
if (type === 'cols_21') {
|
|
69
|
-
columnsWidth = [4, 6];
|
|
70
|
-
}
|
|
71
|
-
else if (type === 'cols_12') {
|
|
72
|
-
columnsWidth = [6, 4];
|
|
73
|
-
}
|
|
74
|
-
else if (type === 'cols_2') {
|
|
75
|
-
columnsWidth = [5, 5];
|
|
76
|
-
}
|
|
77
|
-
else if (type === 'cols_3') {
|
|
78
|
-
columnsWidth = [3.33, 3.33, 3.33];
|
|
79
|
-
}
|
|
80
|
-
else if (type === 'cols_4') {
|
|
81
|
-
columnsWidth = [2.5, 2.5, 2.5, 2.5];
|
|
82
|
-
}
|
|
83
|
-
this.options = defaultsDeep(options, this.options, {
|
|
84
|
-
columns,
|
|
85
|
-
columnsWidth
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2024 Pobuca.
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
*/
|
|
5
|
+
import { defaultsDeep } from '../utils';
|
|
6
|
+
export const defaultColumnsOptions = {
|
|
7
|
+
background: {
|
|
8
|
+
color: 'transparent'
|
|
9
|
+
},
|
|
10
|
+
border: {
|
|
11
|
+
width: 0,
|
|
12
|
+
color: '#cccccc',
|
|
13
|
+
radius: 0,
|
|
14
|
+
style: 'solid'
|
|
15
|
+
},
|
|
16
|
+
verticalAlign: 'top'
|
|
17
|
+
};
|
|
18
|
+
export class Structure {
|
|
19
|
+
constructor(type = 'cols_1', elements = [], options) {
|
|
20
|
+
this.type = type;
|
|
21
|
+
this.elements = elements;
|
|
22
|
+
this.columns = 1;
|
|
23
|
+
this.id = Date.now();
|
|
24
|
+
this.options = {
|
|
25
|
+
fullWidth: false,
|
|
26
|
+
border: {
|
|
27
|
+
color: '#cccccc',
|
|
28
|
+
style: 'solid',
|
|
29
|
+
width: 0,
|
|
30
|
+
radius: 0
|
|
31
|
+
},
|
|
32
|
+
background: {
|
|
33
|
+
color: '#ffffff',
|
|
34
|
+
url: '',
|
|
35
|
+
repeat: 'repeat',
|
|
36
|
+
size: {
|
|
37
|
+
value: 100,
|
|
38
|
+
unit: 'px',
|
|
39
|
+
auto: true,
|
|
40
|
+
units: ['px', '%', 'cover', 'contain']
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
padding: {
|
|
44
|
+
top: 4,
|
|
45
|
+
right: 4,
|
|
46
|
+
bottom: 4,
|
|
47
|
+
left: 4
|
|
48
|
+
},
|
|
49
|
+
margin: {
|
|
50
|
+
top: 0,
|
|
51
|
+
bottom: 0
|
|
52
|
+
},
|
|
53
|
+
gaps: [4, 4]
|
|
54
|
+
};
|
|
55
|
+
if (!elements.length) {
|
|
56
|
+
if (['cols_2', 'cols_12', 'cols_21'].includes(type)) {
|
|
57
|
+
this.columns = 2;
|
|
58
|
+
}
|
|
59
|
+
else if (type === 'cols_3') {
|
|
60
|
+
this.columns = 3;
|
|
61
|
+
}
|
|
62
|
+
else if (type === 'cols_4') {
|
|
63
|
+
this.columns = 4;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
const columns = Array.from({ length: this.columns }, () => defaultColumnsOptions);
|
|
67
|
+
let columnsWidth = [1];
|
|
68
|
+
if (type === 'cols_21') {
|
|
69
|
+
columnsWidth = [4, 6];
|
|
70
|
+
}
|
|
71
|
+
else if (type === 'cols_12') {
|
|
72
|
+
columnsWidth = [6, 4];
|
|
73
|
+
}
|
|
74
|
+
else if (type === 'cols_2') {
|
|
75
|
+
columnsWidth = [5, 5];
|
|
76
|
+
}
|
|
77
|
+
else if (type === 'cols_3') {
|
|
78
|
+
columnsWidth = [3.33, 3.33, 3.33];
|
|
79
|
+
}
|
|
80
|
+
else if (type === 'cols_4') {
|
|
81
|
+
columnsWidth = [2.5, 2.5, 2.5, 2.5];
|
|
82
|
+
}
|
|
83
|
+
this.options = defaultsDeep(options, this.options, {
|
|
84
|
+
columns,
|
|
85
|
+
columnsWidth
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiU3RydWN0dXJlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvcGItZW1haWwtYnVpbGRlci9zcmMvbGliL2NsYXNzZXMvU3RydWN0dXJlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7R0FHRztBQUlILE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSxVQUFVLENBQUM7QUFFeEMsTUFBTSxDQUFDLE1BQU0scUJBQXFCLEdBQTRCO0lBQzVELFVBQVUsRUFBRTtRQUNWLEtBQUssRUFBRSxhQUFhO0tBQ3JCO0lBQ0QsTUFBTSxFQUFFO1FBQ04sS0FBSyxFQUFFLENBQUM7UUFDUixLQUFLLEVBQUUsU0FBUztRQUNoQixNQUFNLEVBQUUsQ0FBQztRQUNULEtBQUssRUFBRSxPQUFPO0tBQ2Y7SUFDRCxhQUFhLEVBQUUsS0FBSztDQUNyQixDQUFDO0FBRUYsTUFBTSxPQUFPLFNBQVM7SUFtQ3BCLFlBQXFCLE9BQXdCLFFBQVEsRUFBUyxXQUF3QixFQUFFLEVBQUUsT0FBMkI7UUFBaEcsU0FBSSxHQUFKLElBQUksQ0FBNEI7UUFBUyxhQUFRLEdBQ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cGUgPT09ICdjb2xzXzQnKSB7XG4gICAgICAgIHRoaXMuY29sdW1ucyA9IDQ7XG4gICAgICB9XG4gICAgfVxuXG4gICAgY29uc3QgY29sdW1uczogSVN0cnVjdHVyZUNvbHVtbk9wdGlvbnNbXSA9IEFycmF5LmZyb20oeyBsZW5ndGg6IHRoaXMuY29sdW1ucyB9LCAoKSA9PiBkZWZhdWx0Q29sdW1uc09wdGlvbnMpO1xuXG4gICAgbGV0IGNvbHVtbnNXaWR0aCA9IFsxXTtcbiAgICBpZiAodHlwZSA9PT0gJ2NvbHNfMjEnKSB7XG4gICAgICBjb2x1bW5zV2lkdGggPSBbNCwgNl07XG4gICAgfSBlbHNlIGlmICh0eXBlID09PSAnY29sc18xMicpIHtcbiAgICAgIGNvbHVtbnNXaWR0aCA9IFs2LCA0XTtcbiAgICB9IGVsc2UgaWYgKHR5cGUgPT09ICdjb2xzXzInKSB7XG4gICAgICBjb2x1bW5zV2lkdGggPSBbNSwgNV07XG4gICAgfSBlbHNlIGlmICh0eXBlID09PSAnY29sc18zJykge1xuICAgICAgY29sdW1uc1dpZHRoID0gWzMuMzMsIDMuMzMsIDMuMzNdO1xuICAgIH0gZWxzZSBpZiAodHlwZSA9PT0gJ2NvbHNfNCcpIHtcbiAgICAgIGNvbHVtbnNXaWR0aCA9IFsyLjUsIDIuNSwgMi41LCAyLjVdO1xuICAgIH1cblxuICAgIHRoaXMub3B0aW9ucyA9IGRlZmF1bHRzRGVlcChvcHRpb25zLCB0aGlzLm9wdGlvbnMsIHtcbiAgICAgIGNvbHVtbnMsXG4gICAgICBjb2x1bW5zV2lkdGhcbiAgICB9KTtcbiAgfVxufVxuIl19
|
|
@@ -1,89 +1,89 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2024 Pobuca.
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
*/
|
|
5
|
-
import { Component, Input, ChangeDetectionStrategy, HostListener, HostBinding, ChangeDetectorRef } from '@angular/core';
|
|
6
|
-
import { exhaustMap, take, map, filter, takeUntil } from 'rxjs/operators';
|
|
7
|
-
import { Subject } from 'rxjs';
|
|
8
|
-
import { PbUserInterfaceService } from '../../services/internals/user-interfaces/user-interface.service';
|
|
9
|
-
import { PbEmailObjectStoreService } from '../../services/internals/pb-email-object-store/pb-email-object-store.service';
|
|
10
|
-
import { PbUserMiddlewaresService } from '../../services/user-middleware-service/pb-middlewares.service';
|
|
11
|
-
export class BlockComponent {
|
|
12
|
-
constructor(pbMiddlewaresService, userInterfaceService, emailObjectStore, chRef) {
|
|
13
|
-
this.pbMiddlewaresService = pbMiddlewaresService;
|
|
14
|
-
this.userInterfaceService = userInterfaceService;
|
|
15
|
-
this.emailObjectStore = emailObjectStore;
|
|
16
|
-
this.chRef = chRef;
|
|
17
|
-
this.isActive = false;
|
|
18
|
-
this.componentIsDestroyed$ = new Subject();
|
|
19
|
-
}
|
|
20
|
-
onHostClick(event) {
|
|
21
|
-
event.stopImmediatePropagation();
|
|
22
|
-
this.editBlock();
|
|
23
|
-
}
|
|
24
|
-
get isBlockActive() {
|
|
25
|
-
return this.isActive;
|
|
26
|
-
}
|
|
27
|
-
removeBlock() {
|
|
28
|
-
this.pbMiddlewaresService
|
|
29
|
-
.removeBlock(this.index, this.column, this.block)
|
|
30
|
-
.pipe(exhaustMap(() => this.userInterfaceService.confirmDialog$()), filter(removeAllowed => removeAllowed), take(1))
|
|
31
|
-
.subscribe(() => {
|
|
32
|
-
this.emailObjectStore.removeBlock(this.index, this.column);
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
duplicateBlock() {
|
|
36
|
-
this.pbMiddlewaresService
|
|
37
|
-
.duplicateBlock(this.index, this.column, this.block)
|
|
38
|
-
.pipe(map(data => this.emailObjectStore.duplicateBlock(data.index, data.column, data.block)), take(1))
|
|
39
|
-
.subscribe(() => {
|
|
40
|
-
// this.chRef.markForCheck();
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
editBlock() {
|
|
44
|
-
this.pbMiddlewaresService
|
|
45
|
-
.editBlock(this.block)
|
|
46
|
-
.pipe(take(1))
|
|
47
|
-
.subscribe(block => {
|
|
48
|
-
this.userInterfaceService.editBlock(block);
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
ngOnInit() {
|
|
52
|
-
this.userInterfaceService.currentEditingBlock$
|
|
53
|
-
.pipe(map(currentEditingBlock => currentEditingBlock === this.block), takeUntil(this.componentIsDestroyed$))
|
|
54
|
-
.subscribe(isActive => {
|
|
55
|
-
this.isActive = isActive;
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
ngDoCheck() {
|
|
59
|
-
if (this.isActive) {
|
|
60
|
-
this.chRef.markForCheck();
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
ngOnDestroy() {
|
|
64
|
-
this.componentIsDestroyed$.next('');
|
|
65
|
-
this.componentIsDestroyed$.complete();
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
BlockComponent.decorators = [
|
|
69
|
-
{ type: Component, args: [{
|
|
70
|
-
selector: 'pb-block',
|
|
71
|
-
template: "<!--\
|
|
72
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
73
|
-
styles: ["/*!\n * Copyright (c) 2024 Pobuca.\n * All rights reserved.\n */:host{display:block;position:relative}:host.active:not(.cdk-drag-preview)>.tools{opacity:1;display:flex!important}:host.active,:host.cdk-drag-placeholder,:host.cdk-drag-preview{z-index:3;box-shadow:0 0 0 2px #3f51b5}:host:hover:not(.active){box-shadow:0 0 0 2px rgba(63,81,181,.5)}:host>.tools{direction:ltr;opacity:0;z-index:4;position:absolute;max-width:100%;bottom:-25px;right:0;display:none!important;transition:all .5s ease-in-out}:host>.tools>button{background:#3f51b5;border-radius:3px;color:#fff;line-height:0;width:25px;height:25px}:host>.tools>button mat-icon{font-size:14px;margin-top:-3px}:host>.tools ::ng-deep+*>*{transition:all .5s cubic-bezier(.445,.05,.55,.95)}"]
|
|
74
|
-
},] }
|
|
75
|
-
];
|
|
76
|
-
BlockComponent.ctorParameters = () => [
|
|
77
|
-
{ type: PbUserMiddlewaresService },
|
|
78
|
-
{ type: PbUserInterfaceService },
|
|
79
|
-
{ type: PbEmailObjectStoreService },
|
|
80
|
-
{ type: ChangeDetectorRef }
|
|
81
|
-
];
|
|
82
|
-
BlockComponent.propDecorators = {
|
|
83
|
-
block: [{ type: Input }],
|
|
84
|
-
column: [{ type: Input }],
|
|
85
|
-
index: [{ type: Input }],
|
|
86
|
-
onHostClick: [{ type: HostListener, args: ['click', ['$event'],] }],
|
|
87
|
-
isBlockActive: [{ type: HostBinding, args: ['class.active',] }]
|
|
88
|
-
};
|
|
89
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2024 Pobuca.
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
*/
|
|
5
|
+
import { Component, Input, ChangeDetectionStrategy, HostListener, HostBinding, ChangeDetectorRef } from '@angular/core';
|
|
6
|
+
import { exhaustMap, take, map, filter, takeUntil } from 'rxjs/operators';
|
|
7
|
+
import { Subject } from 'rxjs';
|
|
8
|
+
import { PbUserInterfaceService } from '../../services/internals/user-interfaces/user-interface.service';
|
|
9
|
+
import { PbEmailObjectStoreService } from '../../services/internals/pb-email-object-store/pb-email-object-store.service';
|
|
10
|
+
import { PbUserMiddlewaresService } from '../../services/user-middleware-service/pb-middlewares.service';
|
|
11
|
+
export class BlockComponent {
|
|
12
|
+
constructor(pbMiddlewaresService, userInterfaceService, emailObjectStore, chRef) {
|
|
13
|
+
this.pbMiddlewaresService = pbMiddlewaresService;
|
|
14
|
+
this.userInterfaceService = userInterfaceService;
|
|
15
|
+
this.emailObjectStore = emailObjectStore;
|
|
16
|
+
this.chRef = chRef;
|
|
17
|
+
this.isActive = false;
|
|
18
|
+
this.componentIsDestroyed$ = new Subject();
|
|
19
|
+
}
|
|
20
|
+
onHostClick(event) {
|
|
21
|
+
event.stopImmediatePropagation();
|
|
22
|
+
this.editBlock();
|
|
23
|
+
}
|
|
24
|
+
get isBlockActive() {
|
|
25
|
+
return this.isActive;
|
|
26
|
+
}
|
|
27
|
+
removeBlock() {
|
|
28
|
+
this.pbMiddlewaresService
|
|
29
|
+
.removeBlock(this.index, this.column, this.block)
|
|
30
|
+
.pipe(exhaustMap(() => this.userInterfaceService.confirmDialog$()), filter(removeAllowed => removeAllowed), take(1))
|
|
31
|
+
.subscribe(() => {
|
|
32
|
+
this.emailObjectStore.removeBlock(this.index, this.column);
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
duplicateBlock() {
|
|
36
|
+
this.pbMiddlewaresService
|
|
37
|
+
.duplicateBlock(this.index, this.column, this.block)
|
|
38
|
+
.pipe(map(data => this.emailObjectStore.duplicateBlock(data.index, data.column, data.block)), take(1))
|
|
39
|
+
.subscribe(() => {
|
|
40
|
+
// this.chRef.markForCheck();
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
editBlock() {
|
|
44
|
+
this.pbMiddlewaresService
|
|
45
|
+
.editBlock(this.block)
|
|
46
|
+
.pipe(take(1))
|
|
47
|
+
.subscribe(block => {
|
|
48
|
+
this.userInterfaceService.editBlock(block);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
ngOnInit() {
|
|
52
|
+
this.userInterfaceService.currentEditingBlock$
|
|
53
|
+
.pipe(map(currentEditingBlock => currentEditingBlock === this.block), takeUntil(this.componentIsDestroyed$))
|
|
54
|
+
.subscribe(isActive => {
|
|
55
|
+
this.isActive = isActive;
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
ngDoCheck() {
|
|
59
|
+
if (this.isActive) {
|
|
60
|
+
this.chRef.markForCheck();
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
ngOnDestroy() {
|
|
64
|
+
this.componentIsDestroyed$.next('');
|
|
65
|
+
this.componentIsDestroyed$.complete();
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
BlockComponent.decorators = [
|
|
69
|
+
{ type: Component, args: [{
|
|
70
|
+
selector: 'pb-block',
|
|
71
|
+
template: "<!--\n ~ Copyright (c) 2024 Pobuca.\n ~ All rights reserved.\n -->\n\n<ng-content select=\".move\"></ng-content>\n<div class=\"tools\" fxLayout fxLayoutGap=\"0.25rem\">\n <button mat-icon-button (click)=\"duplicateBlock()\" i18n-matTooltip=\"block|Duplicate Block\"\n matTooltip=\"Duplicate Block\">\n <mat-icon i18n-aria-label=\"block|Duplicate Block\" aria-label=\"Duplicate block\" inline>file_copy</mat-icon>\n </button>\n <button mat-icon-button (click)=\"removeBlock()\" i18n-matTooltip=\"block|Remove Block\" class=\"delete\"\n matTooltip=\"Remove Block\">\n <mat-icon i18n-aria-label=\"block|Remove Block\" aria-label=\"Delete block\" inline>delete_forever</mat-icon>\n </button>\n</div>\n<ng-content *pbDynamicComponent=\"block\"></ng-content>\n",
|
|
72
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
73
|
+
styles: ["/*!\n * Copyright (c) 2024 Pobuca.\n * All rights reserved.\n */:host{display:block;position:relative}:host.active:not(.cdk-drag-preview)>.tools{opacity:1;display:flex!important}:host.active,:host.cdk-drag-placeholder,:host.cdk-drag-preview{z-index:3;box-shadow:0 0 0 2px #3f51b5}:host:hover:not(.active){box-shadow:0 0 0 2px rgba(63,81,181,.5)}:host>.tools{direction:ltr;opacity:0;z-index:4;position:absolute;max-width:100%;bottom:-25px;right:0;display:none!important;transition:all .5s ease-in-out}:host>.tools>button{background:#3f51b5;border-radius:3px;color:#fff;line-height:0;width:25px;height:25px}:host>.tools>button mat-icon{font-size:14px;margin-top:-3px}:host>.tools ::ng-deep+*>*{transition:all .5s cubic-bezier(.445,.05,.55,.95)}"]
|
|
74
|
+
},] }
|
|
75
|
+
];
|
|
76
|
+
BlockComponent.ctorParameters = () => [
|
|
77
|
+
{ type: PbUserMiddlewaresService },
|
|
78
|
+
{ type: PbUserInterfaceService },
|
|
79
|
+
{ type: PbEmailObjectStoreService },
|
|
80
|
+
{ type: ChangeDetectorRef }
|
|
81
|
+
];
|
|
82
|
+
BlockComponent.propDecorators = {
|
|
83
|
+
block: [{ type: Input }],
|
|
84
|
+
column: [{ type: Input }],
|
|
85
|
+
index: [{ type: Input }],
|
|
86
|
+
onHostClick: [{ type: HostListener, args: ['click', ['$event'],] }],
|
|
87
|
+
isBlockActive: [{ type: HostBinding, args: ['class.active',] }]
|
|
88
|
+
};
|
|
89
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmxvY2suY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvcGItZW1haWwtYnVpbGRlci9zcmMvbGliL2NvbXBvbmVudHMvYmxvY2svYmxvY2suY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7R0FHRztBQUVILE9BQU8sRUFDTCxTQUFTLEVBQ1QsS0FBSyxFQUVMLHVCQUF1QixFQUN2QixZQUFZLEVBQ1osV0FBVyxFQUdYLGlCQUFpQixFQUNsQixNQUFNLGVBQWUsQ0FBQztBQUN2QixPQUFPLEVBQUUsVUFBVSxFQUFFLElBQUksRUFBRSxHQUFHLEVBQUUsTUFBTSxFQUFFLFNBQVMsRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBQzFFLE9BQU8sRUFBRSxPQUFPLEVBQUUsTUFBTSxNQUFNLENBQUM7QUFFL0IsT0FBTyxFQUFFLHNCQUFzQixFQUFFLE1BQU0saUVBQWlFLENBQUM7QUFDekcsT0FBTyxFQUFFLHlCQUF5QixFQUFFLE1BQU0sOEVBQThFLENBQUM7QUFDekgsT0FBTyxFQUFFLHdCQUF3QixFQUFFLE1BQU0sK0RBQStELENBQUM7QUFRekcsTUFBTSxPQUFPLGNBQWM7SUFpQnpCLFlBQ1Usb0JBQThDLEVBQzlDLG9CQUE0QyxFQUM1QyxnQkFBMkMsRUF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VudGlsKHRoaXMuY29tcG9uZW50SXNEZXN0cm95ZWQkKVxuICAgICAgKVxuICAgICAgLnN1YnNjcmliZShpc0FjdGl2ZSA9PiB7XG4gICAgICAgIHRoaXMuaXNBY3RpdmUgPSBpc0FjdGl2ZTtcbiAgICAgIH0pO1xuICB9XG5cbiAgbmdEb0NoZWNrKCkge1xuICAgIGlmICh0aGlzLmlzQWN0aXZlKSB7XG4gICAgICB0aGlzLmNoUmVmLm1hcmtGb3JDaGVjaygpO1xuICAgIH1cbiAgfVxuXG4gIG5nT25EZXN0cm95KCkge1xuICAgIHRoaXMuY29tcG9uZW50SXNEZXN0cm95ZWQkLm5leHQoJycpO1xuICAgIHRoaXMuY29tcG9uZW50SXNEZXN0cm95ZWQkLmNvbXBsZXRlKCk7XG4gIH1cbn1cbiJdfQ==
|
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2024 Pobuca.
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
*/
|
|
5
|
-
import { Component, ViewEncapsulation, ChangeDetectionStrategy, Inject } from '@angular/core';
|
|
6
|
-
import { getAssetByPath } from '../../utils';
|
|
7
|
-
import { PbUserInterfaceService } from '../../services/internals/user-interfaces/user-interface.service';
|
|
8
|
-
import { PB_SOCIAL_NETWORKS } from '../../tokens/tokens';
|
|
9
|
-
import { PbEmailObjectStoreService } from '../../services/internals/pb-email-object-store/pb-email-object-store.service';
|
|
10
|
-
export class BlockSettingsComponent {
|
|
11
|
-
constructor(internalService, emailObject, networks) {
|
|
12
|
-
this.internalService = internalService;
|
|
13
|
-
this.emailObject = emailObject;
|
|
14
|
-
this.networks = networks;
|
|
15
|
-
this.block$ = this.internalService.currentEditingBlock$;
|
|
16
|
-
}
|
|
17
|
-
hasProperty(options, property) {
|
|
18
|
-
return options.hasOwnProperty(property);
|
|
19
|
-
}
|
|
20
|
-
markForCheck() {
|
|
21
|
-
this.emailObject.markForCheck();
|
|
22
|
-
}
|
|
23
|
-
socialNetworks(block) {
|
|
24
|
-
return this.networks.filter(link => !block.networks.find(({ name }) => name === link)).sort();
|
|
25
|
-
}
|
|
26
|
-
addSocialNetwork({ value, source }, block) {
|
|
27
|
-
block.networks.push({ name: value, href: '', label: '' });
|
|
28
|
-
source.value = '';
|
|
29
|
-
this.markForCheck();
|
|
30
|
-
}
|
|
31
|
-
removeSocialNetwork(network, block) {
|
|
32
|
-
block.networks = block.networks.filter(n => n !== network);
|
|
33
|
-
this.markForCheck();
|
|
34
|
-
}
|
|
35
|
-
getSocialIcon(network) {
|
|
36
|
-
return getAssetByPath(`${network}.png`);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
BlockSettingsComponent.decorators = [
|
|
40
|
-
{ type: Component, args: [{
|
|
41
|
-
selector: 'pb-block-settings',
|
|
42
|
-
template: "<!--\r\n ~ Copyright (c) 2024 Pobuca.\r\n ~ All rights reserved.\r\n -->\r\n\r\n<ng-container *ngIf=\"block$ | async as currentBlock\">\r\n <mat-accordion>\r\n <mat-expansion-panel expanded *ngIf=\"hasProperty(currentBlock.options, 'font')\">\r\n <mat-expansion-panel-header i18n=\"settings|Font\">\r\n Font\r\n </mat-expansion-panel-header>\r\n <ng-template matExpansionPanelContent>\r\n <pb-color [options]=\"currentBlock.options\" key=\"color\"></pb-color>\r\n <pb-font-styles [font]=\"currentBlock.options.font\"></pb-font-styles>\r\n <pb-line-height *ngIf=\"currentBlock.type !== 'social'\" [lineHeight]=\"currentBlock.options.lineHeight\">\r\n </pb-line-height>\r\n </ng-template>\r\n </mat-expansion-panel>\r\n\r\n <ng-container *ngIf=\"currentBlock.type === 'image'\">\r\n <mat-expansion-panel expanded>\r\n <mat-expansion-panel-header i18n=\"settings|Image\">\r\n Image\r\n </mat-expansion-panel-header>\r\n <pb-image-upload [block]=\"currentBlock\"></pb-image-upload>\r\n </mat-expansion-panel>\r\n\r\n <mat-expansion-panel>\r\n <mat-expansion-panel-header i18n=\"settings|Image Attributes\">\r\n Attributes\r\n </mat-expansion-panel-header>\r\n <ng-template matExpansionPanelContent>\r\n <div class=\"group f-large\">\r\n <mat-form-field appearance=\"outline\">\r\n <mat-label i18n=\"settings|Image Alt\">Alt</mat-label>\r\n <input matInput [(ngModel)]=\"currentBlock.options.title\" type=\"text\" i18n-placeholder\r\n placeholder=\"settings|Image Alt\" (input)=\"markForCheck()\" />\r\n </mat-form-field>\r\n <pb-align [model]=\"currentBlock.options\"></pb-align>\r\n </div>\r\n <pb-link [link]=\"currentBlock.options.link\"></pb-link>\r\n </ng-template>\r\n </mat-expansion-panel>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"currentBlock.type === 'button'\">\r\n <mat-expansion-panel>\r\n <mat-expansion-panel-header i18n=\"settings|Button Text\">\r\n Button Text\r\n </mat-expansion-panel-header>\r\n <ng-template matExpansionPanelContent>\r\n <mat-form-field appearance=\"outline\" style=\"width: 100%\">\r\n <mat-label i18n=\"settings|Button Text\">Button Text</mat-label>\r\n <input matInput [(ngModel)]=\"currentBlock.innerText\" type=\"text\" i18n-placeholder\r\n placeholder=\"settings|Button Text\" (input)=\"markForCheck()\" />\r\n </mat-form-field>\r\n </ng-template>\r\n </mat-expansion-panel>\r\n\r\n\r\n <mat-expansion-panel>\r\n <mat-expansion-panel-header i18n=\"settings|Background\">\r\n Background\r\n </mat-expansion-panel-header>\r\n <ng-template matExpansionPanelContent>\r\n <pb-color [options]=\"currentBlock.options\"></pb-color>\r\n </ng-template>\r\n </mat-expansion-panel>\r\n\r\n <mat-expansion-panel>\r\n <mat-expansion-panel-header i18n=\"settings|Button Attributes\">\r\n Attributes\r\n </mat-expansion-panel-header>\r\n <ng-template matExpansionPanelContent>\r\n <div class=\"group two\" style=\"padding-bottom: 0\">\r\n <pb-align [model]=\"currentBlock.options\" [disabled]=\"currentBlock.options.fullWidth\"></pb-align>\r\n <mat-slide-toggle style=\"margin-top: -24px\" [(ngModel)]=\"currentBlock.options.fullWidth\"\r\n (change)=\"markForCheck()\">\r\n <ng-container i18n=\"settings|Button Full Width\">Full Width</ng-container>\r\n </mat-slide-toggle>\r\n </div>\r\n <pb-link [link]=\"currentBlock.options.link\"></pb-link>\r\n <pb-padding [padding]=\"currentBlock.options.innerPadding\"></pb-padding>\r\n </ng-template>\r\n </mat-expansion-panel>\r\n </ng-container>\r\n\r\n <mat-expansion-panel [expanded]=\"currentBlock.type === 'spacer'\"\r\n *ngIf=\"hasProperty(currentBlock.options, 'width') || hasProperty(currentBlock.options, 'height')\">\r\n <mat-expansion-panel-header i18n=\"settings|Sizes\">\r\n Sizes\r\n </mat-expansion-panel-header>\r\n <ng-template matExpansionPanelContent>\r\n <pb-width-height *ngIf=\"hasProperty(currentBlock.options, 'width')\" [model]=\"currentBlock.options.width\"\r\n label=\"width\"></pb-width-height>\r\n <pb-width-height *ngIf=\"hasProperty(currentBlock.options, 'height')\" [model]=\"currentBlock.options.height\"\r\n label=\"height\"></pb-width-height>\r\n </ng-template>\r\n </mat-expansion-panel>\r\n\r\n <mat-expansion-panel *ngIf=\"hasProperty(currentBlock.options, 'background')\">\r\n <mat-expansion-panel-header i18n=\"settings|Background\">\r\n Background\r\n </mat-expansion-panel-header>\r\n <ng-template matExpansionPanelContent>\r\n <pb-color [options]=\"currentBlock.options.background\"></pb-color>\r\n </ng-template>\r\n backgroundColor\r\n </mat-expansion-panel>\r\n\r\n <mat-expansion-panel [expanded]=\"currentBlock.type === 'divider'\"\r\n *ngIf=\"hasProperty(currentBlock.options, 'border')\">\r\n <mat-expansion-panel-header>\r\n <ng-container i18n=\"settings|Divider Styles\" *ngIf=\"currentBlock.type === 'divider'\">Styles</ng-container>\r\n <ng-container i18n=\"settings|Border\" *ngIf=\"currentBlock.type !== 'divider'\">Border</ng-container>\r\n </mat-expansion-panel-header>\r\n <ng-template matExpansionPanelContent>\r\n <pb-border [border]=\"currentBlock.options.border\"></pb-border>\r\n </ng-template>\r\n </mat-expansion-panel>\r\n\r\n <ng-container *ngIf=\"currentBlock.type === 'social'\">\r\n <mat-expansion-panel>\r\n <mat-expansion-panel-header i18n=\"settings|Icons\">\r\n Icons\r\n </mat-expansion-panel-header>\r\n <ng-template matExpansionPanelContent>\r\n <mat-form-field appearance=\"outline\" style=\"width: 100%\">\r\n <mat-label i18n=\"settings|Add new Network\">Add new Network</mat-label>\r\n <mat-select (selectionChange)=\"addSocialNetwork($event, currentBlock)\" [disabled]=\"!socialNetworks.length\">\r\n <mat-option style=\"text-transform: capitalize\" *ngFor=\"let link of socialNetworks(currentBlock)\"\r\n [value]=\"link\">\r\n {{ link }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </ng-template>\r\n </mat-expansion-panel>\r\n\r\n <mat-expansion-panel class=\"networks-list\" *ngFor=\"let network of currentBlock.networks\">\r\n <mat-expansion-panel-header style=\"text-transform: capitalize\">\r\n <img [class]=\"network.name\" [src]=\"getSocialIcon(network.name)\" [alt]=\"network.name\" />\r\n {{ network.name }}\r\n </mat-expansion-panel-header>\r\n <ng-template matExpansionPanelContent>\r\n <div class=\"networks-list-item\">\r\n <div class=\"item-info\">\r\n <mat-form-field matLine appearance=\"outline\">\r\n <mat-label i18n=\"settings|Social Network Label\">Label</mat-label>\r\n <input matInput autocomplete=\"off\" [(ngModel)]=\"network.label\"\r\n i18n-placeholder=\"settings|Social Network Label\" placeholder=\"Label\" type=\"text\"\r\n (input)=\"markForCheck()\" />\r\n </mat-form-field>\r\n <button mat-stroked-button color=\"warn\" (click)=\"removeSocialNetwork(network, currentBlock)\">\r\n <mat-icon>delete_forever</mat-icon>\r\n </button>\r\n </div>\r\n <mat-form-field matLine appearance=\"outline\">\r\n <mat-label style=\"text-transform: capitalize\">\r\n {{ network.name }} <ng-container i18n=\"settings|Social Network Link\">Link</ng-container>\r\n </mat-label>\r\n <input autocomplete=\"off\" matInput [(ngModel)]=\"network.href\" type=\"url\" (input)=\"markForCheck()\" />\r\n </mat-form-field>\r\n </div>\r\n </ng-template>\r\n </mat-expansion-panel>\r\n\r\n <mat-expansion-panel>\r\n <mat-expansion-panel-header i18n=\"settings|Social Styles\">\r\n Styles\r\n </mat-expansion-panel-header>\r\n <ng-template matExpansionPanelContent>\r\n <div class=\"group two\" style=\"padding-bottom: 0\">\r\n <mat-form-field appearance=\"outline\">\r\n <mat-label i18n=\"settings|Social Model\">Mode</mat-label>\r\n <mat-select (selectionChange)=\"markForCheck()\" i18n-placeholder=\"settings|Social Model\" placeholder=\"Mode\"\r\n [(value)]=\"currentBlock.options.mode\" disableRipple>\r\n <mat-option *ngFor=\"let mode of ['horizontal', 'vertical']\" [value]=\"mode\">\r\n {{ mode }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n <pb-align [model]=\"currentBlock.options\"></pb-align>\r\n </div>\r\n <pb-line-height [units]=\"['px']\" [lineHeight]=\"currentBlock.options.iconSize\" label=\"Icon Size\">\r\n </pb-line-height>\r\n <pb-padding [padding]=\"currentBlock.options.innerPadding\"></pb-padding>\r\n </ng-template>\r\n </mat-expansion-panel>\r\n </ng-container>\r\n\r\n <mat-expansion-panel *ngIf=\"hasProperty(currentBlock.options, 'padding')\">\r\n <mat-expansion-panel-header i18n=\"settings|Padding\">\r\n Padding\r\n </mat-expansion-panel-header>\r\n <ng-template matExpansionPanelContent>\r\n <pb-padding [padding]=\"currentBlock.options.padding\"></pb-padding>\r\n </ng-template>\r\n </mat-expansion-panel>\r\n </mat-accordion>\r\n</ng-container>\r\n",
|
|
43
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
44
|
-
encapsulation: ViewEncapsulation.None,
|
|
45
|
-
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}"]
|
|
46
|
-
},] }
|
|
47
|
-
];
|
|
48
|
-
BlockSettingsComponent.ctorParameters = () => [
|
|
49
|
-
{ type: PbUserInterfaceService },
|
|
50
|
-
{ type: PbEmailObjectStoreService },
|
|
51
|
-
{ type: Array, decorators: [{ type: Inject, args: [PB_SOCIAL_NETWORKS,] }] }
|
|
52
|
-
];
|
|
53
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2024 Pobuca.
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
*/
|
|
5
|
+
import { Component, ViewEncapsulation, ChangeDetectionStrategy, Inject } from '@angular/core';
|
|
6
|
+
import { getAssetByPath } from '../../utils';
|
|
7
|
+
import { PbUserInterfaceService } from '../../services/internals/user-interfaces/user-interface.service';
|
|
8
|
+
import { PB_SOCIAL_NETWORKS } from '../../tokens/tokens';
|
|
9
|
+
import { PbEmailObjectStoreService } from '../../services/internals/pb-email-object-store/pb-email-object-store.service';
|
|
10
|
+
export class BlockSettingsComponent {
|
|
11
|
+
constructor(internalService, emailObject, networks) {
|
|
12
|
+
this.internalService = internalService;
|
|
13
|
+
this.emailObject = emailObject;
|
|
14
|
+
this.networks = networks;
|
|
15
|
+
this.block$ = this.internalService.currentEditingBlock$;
|
|
16
|
+
}
|
|
17
|
+
hasProperty(options, property) {
|
|
18
|
+
return options.hasOwnProperty(property);
|
|
19
|
+
}
|
|
20
|
+
markForCheck() {
|
|
21
|
+
this.emailObject.markForCheck();
|
|
22
|
+
}
|
|
23
|
+
socialNetworks(block) {
|
|
24
|
+
return this.networks.filter(link => !block.networks.find(({ name }) => name === link)).sort();
|
|
25
|
+
}
|
|
26
|
+
addSocialNetwork({ value, source }, block) {
|
|
27
|
+
block.networks.push({ name: value, href: '', label: '' });
|
|
28
|
+
source.value = '';
|
|
29
|
+
this.markForCheck();
|
|
30
|
+
}
|
|
31
|
+
removeSocialNetwork(network, block) {
|
|
32
|
+
block.networks = block.networks.filter(n => n !== network);
|
|
33
|
+
this.markForCheck();
|
|
34
|
+
}
|
|
35
|
+
getSocialIcon(network) {
|
|
36
|
+
return getAssetByPath(`${network}.png`);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
BlockSettingsComponent.decorators = [
|
|
40
|
+
{ type: Component, args: [{
|
|
41
|
+
selector: 'pb-block-settings',
|
|
42
|
+
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>",
|
|
43
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
44
|
+
encapsulation: ViewEncapsulation.None,
|
|
45
|
+
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}"]
|
|
46
|
+
},] }
|
|
47
|
+
];
|
|
48
|
+
BlockSettingsComponent.ctorParameters = () => [
|
|
49
|
+
{ type: PbUserInterfaceService },
|
|
50
|
+
{ type: PbEmailObjectStoreService },
|
|
51
|
+
{ type: Array, decorators: [{ type: Inject, args: [PB_SOCIAL_NETWORKS,] }] }
|
|
52
|
+
];
|
|
53
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmxvY2stc2V0dGluZ3MuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvcGItZW1haWwtYnVpbGRlci9zcmMvbGliL2NvbXBvbmVudHMvYmxvY2stc2V0dGluZ3MvYmxvY2stc2V0dGluZ3MuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7R0FHRztBQUVILE9BQU8sRUFBRSxTQUFTLEVBQUUsaUJBQWlCLEVBQUUsdUJBQXVCLEVBQUUsTUFBTSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBSzlGLE9BQU8sRUFBRSxjQUFjLEVBQUUsTUFBTSxhQUFhLENBQUM7QUFDN0MsT0FBTyxFQUFFLHNCQUFzQixFQUFFLE1BQU0saUVBQWlFLENBQUM7QUFDekcsT0FBTyxFQUFFLGtCQUFrQixFQUFFLE1BQU0scUJBQXFCLENBQUM7QUFDekQsT0FBTyxFQUFFLHlCQUF5QixFQUFFLE1BQU0sOEVBQThFLENBQUM7QUFTekgsTUFBTSxPQUFPLHNCQUFzQjtJQUdqQyxZQUNVLG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