@pobuca/email-builder 1.0.0 → 1.1.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/README.md +1 -1
- package/bundles/pobuca-email-builder.umd.js +4464 -4414
- 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 -53
- package/esm2015/lib/classes/Elements.js +229 -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 +46 -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 +54 -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/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 -112
- 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 -246
- package/esm2015/lib/pb-email-builder.module.js +291 -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 +175 -165
- 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 +116 -116
- package/esm2015/lib/tokens/private-tokens.js +17 -17
- package/esm2015/lib/tokens/tokens.js +159 -159
- package/esm2015/lib/utils.js +147 -147
- package/esm2015/pobuca-email-builder.js +42 -42
- package/esm2015/public_api.js +26 -26
- package/fesm2015/pobuca-email-builder.js +4206 -4168
- package/fesm2015/pobuca-email-builder.js.map +1 -1
- package/lib/classes/DefaultEmail.d.ts +10 -9
- package/lib/classes/Elements.d.ts +62 -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 +19 -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/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 -17
- 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 +430 -422
- 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 +50 -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 +82 -82
- 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 +8 -3
- package/pobuca-email-builder.d.ts +42 -42
- package/pobuca-email-builder.metadata.json +1 -1
- package/public_api.d.ts +16 -16
|
@@ -1,422 +1,430 @@
|
|
|
1
|
-
import { TBlocks } from '../classes/Elements';
|
|
2
|
-
/**
|
|
3
|
-
* Main builder configuration Interface. See also {@link PbEmailBuilderModule#withConfig}.
|
|
4
|
-
*/
|
|
5
|
-
export interface IForRootConf {
|
|
6
|
-
/**
|
|
7
|
-
* Either an [Extended or Commercial License]{@link} key if any, otherwise leave it empty.
|
|
8
|
-
* @default t7HdQfZjGp6R96fOV4P8v18ggf6LLTQZ1puUI2tz
|
|
9
|
-
*/
|
|
10
|
-
xApiKey?: string;
|
|
11
|
-
/**
|
|
12
|
-
* @deprecated Rewrite PbUserRestApiService in providers instead
|
|
13
|
-
* @ignore
|
|
14
|
-
*/
|
|
15
|
-
uploadImagePath?: string;
|
|
16
|
-
/**
|
|
17
|
-
* @deprecated Rewrite PbUserRestApiService in providers instead
|
|
18
|
-
* @ignore
|
|
19
|
-
*/
|
|
20
|
-
uploadImageName?: string;
|
|
21
|
-
/**
|
|
22
|
-
* @deprecated Rewrite PbUserRestApiService in providers instead
|
|
23
|
-
* @ignore
|
|
24
|
-
*/
|
|
25
|
-
csrf?: {
|
|
26
|
-
name: string;
|
|
27
|
-
token: string;
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* Custom convertor path
|
|
31
|
-
*/
|
|
32
|
-
apiPath?: string;
|
|
33
|
-
/**
|
|
34
|
-
* Show download button on builder top bar.
|
|
35
|
-
* @default true
|
|
36
|
-
*/
|
|
37
|
-
useDownloadButton?: boolean;
|
|
38
|
-
/**
|
|
39
|
-
* Show preview button on builder top bar.
|
|
40
|
-
* @default true
|
|
41
|
-
*/
|
|
42
|
-
usePreviewButton?: boolean;
|
|
43
|
-
/**
|
|
44
|
-
* Show save button on builder top bar.
|
|
45
|
-
* @default true
|
|
46
|
-
*/
|
|
47
|
-
useSaveButton?: boolean;
|
|
48
|
-
/**
|
|
49
|
-
* Show a button that opens template gallery in case email body is empty.
|
|
50
|
-
* @default true
|
|
51
|
-
*/
|
|
52
|
-
templateListIfEmpty?: boolean;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Convertor errors response interface, id any.
|
|
56
|
-
*/
|
|
57
|
-
export interface IMjmlServerResponseErrors {
|
|
58
|
-
/**
|
|
59
|
-
* Error message.
|
|
60
|
-
*/
|
|
61
|
-
message: string;
|
|
62
|
-
/**
|
|
63
|
-
* MJML TagName error occurred.
|
|
64
|
-
*/
|
|
65
|
-
tagName: string;
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Convertor response interface.
|
|
69
|
-
*/
|
|
70
|
-
export interface IMjmlServerResponse {
|
|
71
|
-
/**
|
|
72
|
-
* Converted HTML Template based on {@link IPBEmail}.
|
|
73
|
-
*/
|
|
74
|
-
html: string;
|
|
75
|
-
/**
|
|
76
|
-
* Converted MJML Template based on {@link IPBEmail}.
|
|
77
|
-
*/
|
|
78
|
-
mjml: string;
|
|
79
|
-
/**
|
|
80
|
-
* Error representation if any. See {@link IMjmlServerResponseErrors}.
|
|
81
|
-
*/
|
|
82
|
-
errors: IMjmlServerResponseErrors[];
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Builder structure types.
|
|
86
|
-
* @default cols_1
|
|
87
|
-
*/
|
|
88
|
-
export declare type TStructureTypes = 'cols_1' | 'cols_2' | 'cols_3' | 'cols_4' | 'cols_12' | 'cols_21';
|
|
89
|
-
/**
|
|
90
|
-
* Builder direction types.
|
|
91
|
-
* @default ltr
|
|
92
|
-
*/
|
|
93
|
-
export declare type TDirection = 'ltr' | 'rtl';
|
|
94
|
-
/**
|
|
95
|
-
* Builder units types.
|
|
96
|
-
* @default px
|
|
97
|
-
*/
|
|
98
|
-
export declare type TUnits = '%' | 'px' | 'cover' | 'contain';
|
|
99
|
-
/**
|
|
100
|
-
* Builder align types.
|
|
101
|
-
* @default left
|
|
102
|
-
*/
|
|
103
|
-
export declare type TAlign = 'left' | 'center' | 'right';
|
|
104
|
-
/**
|
|
105
|
-
* Builder vertical align types.
|
|
106
|
-
* @default middle
|
|
107
|
-
*/
|
|
108
|
-
export declare type TVerticalAlign = 'top' | 'middle' | 'bottom';
|
|
109
|
-
/**
|
|
110
|
-
* Builder Line-height types.
|
|
111
|
-
* @default none
|
|
112
|
-
*/
|
|
113
|
-
export declare type TLineHeight = '%' | 'px' | 'none';
|
|
114
|
-
/**
|
|
115
|
-
* Builder Link target.
|
|
116
|
-
* @default _blank
|
|
117
|
-
*/
|
|
118
|
-
export declare type TLinkTarget = '_blank' | '_self' | '_parent' | '_top';
|
|
119
|
-
/**
|
|
120
|
-
* Builder font style types.
|
|
121
|
-
* @default normal
|
|
122
|
-
*/
|
|
123
|
-
export declare type TFontStyle = 'italic' | 'normal' | 'oblique';
|
|
124
|
-
/**
|
|
125
|
-
* Builder font weight types.
|
|
126
|
-
* @default inherit
|
|
127
|
-
*/
|
|
128
|
-
export declare type TFontWeight = number | 'bold' | 'bolder' | 'inherit' | 'initial' | 'light' | 'normal';
|
|
129
|
-
/**
|
|
130
|
-
* Builder background-repeat types.
|
|
131
|
-
* @default no-repeat
|
|
132
|
-
*/
|
|
133
|
-
export declare type TBackgroundRepeat = 'no-repeat' | 'repeat' | 'repeat-x' | 'repeat-y';
|
|
134
|
-
/**
|
|
135
|
-
* Builder border styles interface.
|
|
136
|
-
*/
|
|
137
|
-
export interface IBorder {
|
|
138
|
-
color?: string;
|
|
139
|
-
/**
|
|
140
|
-
* Border style.
|
|
141
|
-
* @default solid
|
|
142
|
-
*/
|
|
143
|
-
style?: 'solid' | 'dotted' | 'dashed' | 'double' | 'groove';
|
|
144
|
-
/**
|
|
145
|
-
* Border width
|
|
146
|
-
*/
|
|
147
|
-
width?: number;
|
|
148
|
-
/**
|
|
149
|
-
* Border radius
|
|
150
|
-
*/
|
|
151
|
-
radius?: number;
|
|
152
|
-
}
|
|
153
|
-
/**
|
|
154
|
-
* Builder padding styles interface.
|
|
155
|
-
*/
|
|
156
|
-
export interface IPadding {
|
|
157
|
-
top?: number;
|
|
158
|
-
right?: number;
|
|
159
|
-
bottom?: number;
|
|
160
|
-
left?: number;
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* Builder margin styles interface.
|
|
164
|
-
*/
|
|
165
|
-
export interface IMargin {
|
|
166
|
-
top?: number;
|
|
167
|
-
bottom?: number;
|
|
168
|
-
}
|
|
169
|
-
/**
|
|
170
|
-
* Builder Width and Height styles interface.
|
|
171
|
-
*/
|
|
172
|
-
export interface IWidthHeight {
|
|
173
|
-
value: number;
|
|
174
|
-
/**
|
|
175
|
-
* Width and Height unit type.
|
|
176
|
-
* @default px
|
|
177
|
-
*/
|
|
178
|
-
unit: TUnits;
|
|
179
|
-
auto?: boolean;
|
|
180
|
-
units?: TUnits[];
|
|
181
|
-
}
|
|
182
|
-
/**
|
|
183
|
-
* Builder background styles interface.
|
|
184
|
-
*/
|
|
185
|
-
export interface IBackground {
|
|
186
|
-
color?: string;
|
|
187
|
-
url?: string;
|
|
188
|
-
repeat?: TBackgroundRepeat;
|
|
189
|
-
size?: IWidthHeight;
|
|
190
|
-
}
|
|
191
|
-
/**
|
|
192
|
-
* Builder font styles interface.
|
|
193
|
-
*/
|
|
194
|
-
export interface IFont {
|
|
195
|
-
family?: string;
|
|
196
|
-
fallback?: string;
|
|
197
|
-
size?: number;
|
|
198
|
-
style?: TFontStyle;
|
|
199
|
-
weight?: TFontWeight;
|
|
200
|
-
}
|
|
201
|
-
export declare type IFontFamily = Set<string>;
|
|
202
|
-
/**
|
|
203
|
-
* Builder line-height styles interface.
|
|
204
|
-
*/
|
|
205
|
-
export interface ILineHeight {
|
|
206
|
-
value?: number;
|
|
207
|
-
unit?: TLineHeight;
|
|
208
|
-
}
|
|
209
|
-
/**
|
|
210
|
-
* Builder link styles interface.
|
|
211
|
-
*/
|
|
212
|
-
export interface ILink {
|
|
213
|
-
href: string;
|
|
214
|
-
target: TLinkTarget;
|
|
215
|
-
}
|
|
216
|
-
/**
|
|
217
|
-
* Builder structure columns' styles interface.
|
|
218
|
-
*/
|
|
219
|
-
export interface IStructureColumnOptions {
|
|
220
|
-
background?: IBackground;
|
|
221
|
-
border?: IBorder;
|
|
222
|
-
verticalAlign?: TVerticalAlign;
|
|
223
|
-
}
|
|
224
|
-
/**
|
|
225
|
-
* Builder structure styles interface.
|
|
226
|
-
*/
|
|
227
|
-
export interface IStructureOptions {
|
|
228
|
-
border?: IBorder;
|
|
229
|
-
background?: IBackground;
|
|
230
|
-
padding?: IPadding;
|
|
231
|
-
margin?: IMargin;
|
|
232
|
-
/**
|
|
233
|
-
* Disable responsive for entire structure
|
|
234
|
-
*/
|
|
235
|
-
disableResponsive?: boolean;
|
|
236
|
-
/**
|
|
237
|
-
* Mame section full width
|
|
238
|
-
*/
|
|
239
|
-
fullWidth?: boolean;
|
|
240
|
-
/**
|
|
241
|
-
* Mind the GAPS! Gaps between structure's columns.
|
|
242
|
-
*/
|
|
243
|
-
gaps?: [number, number];
|
|
244
|
-
columnsWidth?: number[];
|
|
245
|
-
columns?: IStructureColumnOptions[];
|
|
246
|
-
}
|
|
247
|
-
/**
|
|
248
|
-
* Builder structure interface.
|
|
249
|
-
*/
|
|
250
|
-
export interface IStructure {
|
|
251
|
-
readonly type: TStructureTypes;
|
|
252
|
-
readonly id: number;
|
|
253
|
-
/**
|
|
254
|
-
* If it's module, it can't be edited within email body.
|
|
255
|
-
* @default false
|
|
256
|
-
*/
|
|
257
|
-
isModule?: boolean;
|
|
258
|
-
options: IStructureOptions;
|
|
259
|
-
elements: TBlocks[][];
|
|
260
|
-
readonly columns: number;
|
|
261
|
-
}
|
|
262
|
-
/**
|
|
263
|
-
* Builder block state interface. If `disabled: true` it can't be dragged from left sidebar.
|
|
264
|
-
*/
|
|
265
|
-
export interface IBlockState {
|
|
266
|
-
/**
|
|
267
|
-
* @default false
|
|
268
|
-
*/
|
|
269
|
-
disabled: boolean;
|
|
270
|
-
/**
|
|
271
|
-
* Show a message in case it's disabled.
|
|
272
|
-
*/
|
|
273
|
-
message: string;
|
|
274
|
-
}
|
|
275
|
-
/**
|
|
276
|
-
* Builder {@link TextElementComponent} options interface.
|
|
277
|
-
*/
|
|
278
|
-
export interface ITextBlockOptions {
|
|
279
|
-
color?: string;
|
|
280
|
-
font?: IFont;
|
|
281
|
-
lineHeight?: ILineHeight;
|
|
282
|
-
padding?: IPadding;
|
|
283
|
-
}
|
|
284
|
-
/**
|
|
285
|
-
* Builder {@link ImageComponent} options interface.
|
|
286
|
-
*/
|
|
287
|
-
export interface IImageBLockOptions {
|
|
288
|
-
border?: IBorder;
|
|
289
|
-
width?: IWidthHeight;
|
|
290
|
-
height?: IWidthHeight;
|
|
291
|
-
link?: ILink;
|
|
292
|
-
align?: TAlign;
|
|
293
|
-
title?: string;
|
|
294
|
-
padding?: IPadding;
|
|
295
|
-
}
|
|
296
|
-
/**
|
|
297
|
-
* Builder {@link ButtonComponent} options interface.
|
|
298
|
-
*/
|
|
299
|
-
export interface IButtonBlockOptions {
|
|
300
|
-
backgroundColor?: string;
|
|
301
|
-
border?: IBorder;
|
|
302
|
-
color?: string;
|
|
303
|
-
font?: IFont;
|
|
304
|
-
align?: TAlign;
|
|
305
|
-
fullWidth?: boolean;
|
|
306
|
-
lineHeight?: ILineHeight;
|
|
307
|
-
link?: ILink;
|
|
308
|
-
innerPadding?: IPadding;
|
|
309
|
-
padding?: IPadding;
|
|
310
|
-
}
|
|
311
|
-
/**
|
|
312
|
-
* Builder {@link DividerComponent} options interface.
|
|
313
|
-
*/
|
|
314
|
-
export interface IDividerBlockOptions {
|
|
315
|
-
border?: IBorder;
|
|
316
|
-
padding?: IPadding;
|
|
317
|
-
}
|
|
318
|
-
/**
|
|
319
|
-
* Builder {@link SpacerComponent} options interface.
|
|
320
|
-
*/
|
|
321
|
-
export interface ISpacerBlockOptions {
|
|
322
|
-
height?: IWidthHeight;
|
|
323
|
-
width?: IWidthHeight;
|
|
324
|
-
}
|
|
325
|
-
/**
|
|
326
|
-
* Builder {@link SocialComponent} options interface.
|
|
327
|
-
*/
|
|
328
|
-
export interface ISocialBlockOptions {
|
|
329
|
-
align?: TAlign;
|
|
330
|
-
mode?: 'vertical' | 'horizontal';
|
|
331
|
-
font?: IFont;
|
|
332
|
-
iconSize?: ILineHeight;
|
|
333
|
-
lineHeight?: ILineHeight;
|
|
334
|
-
color?: string;
|
|
335
|
-
innerPadding?: IPadding;
|
|
336
|
-
padding?: IPadding;
|
|
337
|
-
}
|
|
338
|
-
/**
|
|
339
|
-
* Builder {@link SocialComponent} network options interface.
|
|
340
|
-
*/
|
|
341
|
-
export interface ISocialNetwork {
|
|
342
|
-
href: string;
|
|
343
|
-
label?: string;
|
|
344
|
-
name: 'github' | 'instagram' | 'web' | 'snapchat' | 'youtube' | 'vimeo' | 'medium' | 'soundcloud' | 'dribbble' | 'facebook' | 'twitter' | 'pinterest' | 'linkedin' | 'tumblr' | 'xing' | 'tiktok';
|
|
345
|
-
padding?: IPadding;
|
|
346
|
-
}
|
|
347
|
-
/**
|
|
348
|
-
* Builder {@link IPBEmail} general options interface.
|
|
349
|
-
*/
|
|
350
|
-
export interface IGeneralOptions {
|
|
351
|
-
width?: IWidthHeight;
|
|
352
|
-
background?: IBackground;
|
|
353
|
-
padding?: IPadding;
|
|
354
|
-
direction?: TDirection;
|
|
355
|
-
name?: string;
|
|
356
|
-
previewText: string;
|
|
357
|
-
global?: {
|
|
358
|
-
fonts?: string[];
|
|
359
|
-
padding?: IPadding;
|
|
360
|
-
};
|
|
361
|
-
}
|
|
362
|
-
/**
|
|
363
|
-
* Main builder Email Object interface.
|
|
364
|
-
*/
|
|
365
|
-
export interface IPBEmail {
|
|
366
|
-
general?: IGeneralOptions;
|
|
367
|
-
structures?: IStructure[];
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
/**
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
1
|
+
import { TBlocks } from '../classes/Elements';
|
|
2
|
+
/**
|
|
3
|
+
* Main builder configuration Interface. See also {@link PbEmailBuilderModule#withConfig}.
|
|
4
|
+
*/
|
|
5
|
+
export interface IForRootConf {
|
|
6
|
+
/**
|
|
7
|
+
* Either an [Extended or Commercial License]{@link} key if any, otherwise leave it empty.
|
|
8
|
+
* @default t7HdQfZjGp6R96fOV4P8v18ggf6LLTQZ1puUI2tz
|
|
9
|
+
*/
|
|
10
|
+
xApiKey?: string;
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated Rewrite PbUserRestApiService in providers instead
|
|
13
|
+
* @ignore
|
|
14
|
+
*/
|
|
15
|
+
uploadImagePath?: string;
|
|
16
|
+
/**
|
|
17
|
+
* @deprecated Rewrite PbUserRestApiService in providers instead
|
|
18
|
+
* @ignore
|
|
19
|
+
*/
|
|
20
|
+
uploadImageName?: string;
|
|
21
|
+
/**
|
|
22
|
+
* @deprecated Rewrite PbUserRestApiService in providers instead
|
|
23
|
+
* @ignore
|
|
24
|
+
*/
|
|
25
|
+
csrf?: {
|
|
26
|
+
name: string;
|
|
27
|
+
token: string;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Custom convertor path
|
|
31
|
+
*/
|
|
32
|
+
apiPath?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Show download button on builder top bar.
|
|
35
|
+
* @default true
|
|
36
|
+
*/
|
|
37
|
+
useDownloadButton?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Show preview button on builder top bar.
|
|
40
|
+
* @default true
|
|
41
|
+
*/
|
|
42
|
+
usePreviewButton?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Show save button on builder top bar.
|
|
45
|
+
* @default true
|
|
46
|
+
*/
|
|
47
|
+
useSaveButton?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Show a button that opens template gallery in case email body is empty.
|
|
50
|
+
* @default true
|
|
51
|
+
*/
|
|
52
|
+
templateListIfEmpty?: boolean;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Convertor errors response interface, id any.
|
|
56
|
+
*/
|
|
57
|
+
export interface IMjmlServerResponseErrors {
|
|
58
|
+
/**
|
|
59
|
+
* Error message.
|
|
60
|
+
*/
|
|
61
|
+
message: string;
|
|
62
|
+
/**
|
|
63
|
+
* MJML TagName error occurred.
|
|
64
|
+
*/
|
|
65
|
+
tagName: string;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Convertor response interface.
|
|
69
|
+
*/
|
|
70
|
+
export interface IMjmlServerResponse {
|
|
71
|
+
/**
|
|
72
|
+
* Converted HTML Template based on {@link IPBEmail}.
|
|
73
|
+
*/
|
|
74
|
+
html: string;
|
|
75
|
+
/**
|
|
76
|
+
* Converted MJML Template based on {@link IPBEmail}.
|
|
77
|
+
*/
|
|
78
|
+
mjml: string;
|
|
79
|
+
/**
|
|
80
|
+
* Error representation if any. See {@link IMjmlServerResponseErrors}.
|
|
81
|
+
*/
|
|
82
|
+
errors: IMjmlServerResponseErrors[];
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Builder structure types.
|
|
86
|
+
* @default cols_1
|
|
87
|
+
*/
|
|
88
|
+
export declare type TStructureTypes = 'cols_1' | 'cols_2' | 'cols_3' | 'cols_4' | 'cols_12' | 'cols_21';
|
|
89
|
+
/**
|
|
90
|
+
* Builder direction types.
|
|
91
|
+
* @default ltr
|
|
92
|
+
*/
|
|
93
|
+
export declare type TDirection = 'ltr' | 'rtl';
|
|
94
|
+
/**
|
|
95
|
+
* Builder units types.
|
|
96
|
+
* @default px
|
|
97
|
+
*/
|
|
98
|
+
export declare type TUnits = '%' | 'px' | 'cover' | 'contain';
|
|
99
|
+
/**
|
|
100
|
+
* Builder align types.
|
|
101
|
+
* @default left
|
|
102
|
+
*/
|
|
103
|
+
export declare type TAlign = 'left' | 'center' | 'right';
|
|
104
|
+
/**
|
|
105
|
+
* Builder vertical align types.
|
|
106
|
+
* @default middle
|
|
107
|
+
*/
|
|
108
|
+
export declare type TVerticalAlign = 'top' | 'middle' | 'bottom';
|
|
109
|
+
/**
|
|
110
|
+
* Builder Line-height types.
|
|
111
|
+
* @default none
|
|
112
|
+
*/
|
|
113
|
+
export declare type TLineHeight = '%' | 'px' | 'none';
|
|
114
|
+
/**
|
|
115
|
+
* Builder Link target.
|
|
116
|
+
* @default _blank
|
|
117
|
+
*/
|
|
118
|
+
export declare type TLinkTarget = '_blank' | '_self' | '_parent' | '_top';
|
|
119
|
+
/**
|
|
120
|
+
* Builder font style types.
|
|
121
|
+
* @default normal
|
|
122
|
+
*/
|
|
123
|
+
export declare type TFontStyle = 'italic' | 'normal' | 'oblique';
|
|
124
|
+
/**
|
|
125
|
+
* Builder font weight types.
|
|
126
|
+
* @default inherit
|
|
127
|
+
*/
|
|
128
|
+
export declare type TFontWeight = number | 'bold' | 'bolder' | 'inherit' | 'initial' | 'light' | 'normal';
|
|
129
|
+
/**
|
|
130
|
+
* Builder background-repeat types.
|
|
131
|
+
* @default no-repeat
|
|
132
|
+
*/
|
|
133
|
+
export declare type TBackgroundRepeat = 'no-repeat' | 'repeat' | 'repeat-x' | 'repeat-y';
|
|
134
|
+
/**
|
|
135
|
+
* Builder border styles interface.
|
|
136
|
+
*/
|
|
137
|
+
export interface IBorder {
|
|
138
|
+
color?: string;
|
|
139
|
+
/**
|
|
140
|
+
* Border style.
|
|
141
|
+
* @default solid
|
|
142
|
+
*/
|
|
143
|
+
style?: 'solid' | 'dotted' | 'dashed' | 'double' | 'groove';
|
|
144
|
+
/**
|
|
145
|
+
* Border width
|
|
146
|
+
*/
|
|
147
|
+
width?: number;
|
|
148
|
+
/**
|
|
149
|
+
* Border radius
|
|
150
|
+
*/
|
|
151
|
+
radius?: number;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Builder padding styles interface.
|
|
155
|
+
*/
|
|
156
|
+
export interface IPadding {
|
|
157
|
+
top?: number;
|
|
158
|
+
right?: number;
|
|
159
|
+
bottom?: number;
|
|
160
|
+
left?: number;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Builder margin styles interface.
|
|
164
|
+
*/
|
|
165
|
+
export interface IMargin {
|
|
166
|
+
top?: number;
|
|
167
|
+
bottom?: number;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Builder Width and Height styles interface.
|
|
171
|
+
*/
|
|
172
|
+
export interface IWidthHeight {
|
|
173
|
+
value: number;
|
|
174
|
+
/**
|
|
175
|
+
* Width and Height unit type.
|
|
176
|
+
* @default px
|
|
177
|
+
*/
|
|
178
|
+
unit: TUnits;
|
|
179
|
+
auto?: boolean;
|
|
180
|
+
units?: TUnits[];
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Builder background styles interface.
|
|
184
|
+
*/
|
|
185
|
+
export interface IBackground {
|
|
186
|
+
color?: string;
|
|
187
|
+
url?: string;
|
|
188
|
+
repeat?: TBackgroundRepeat;
|
|
189
|
+
size?: IWidthHeight;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Builder font styles interface.
|
|
193
|
+
*/
|
|
194
|
+
export interface IFont {
|
|
195
|
+
family?: string;
|
|
196
|
+
fallback?: string;
|
|
197
|
+
size?: number;
|
|
198
|
+
style?: TFontStyle;
|
|
199
|
+
weight?: TFontWeight;
|
|
200
|
+
}
|
|
201
|
+
export declare type IFontFamily = Set<string>;
|
|
202
|
+
/**
|
|
203
|
+
* Builder line-height styles interface.
|
|
204
|
+
*/
|
|
205
|
+
export interface ILineHeight {
|
|
206
|
+
value?: number;
|
|
207
|
+
unit?: TLineHeight;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Builder link styles interface.
|
|
211
|
+
*/
|
|
212
|
+
export interface ILink {
|
|
213
|
+
href: string;
|
|
214
|
+
target: TLinkTarget;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Builder structure columns' styles interface.
|
|
218
|
+
*/
|
|
219
|
+
export interface IStructureColumnOptions {
|
|
220
|
+
background?: IBackground;
|
|
221
|
+
border?: IBorder;
|
|
222
|
+
verticalAlign?: TVerticalAlign;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Builder structure styles interface.
|
|
226
|
+
*/
|
|
227
|
+
export interface IStructureOptions {
|
|
228
|
+
border?: IBorder;
|
|
229
|
+
background?: IBackground;
|
|
230
|
+
padding?: IPadding;
|
|
231
|
+
margin?: IMargin;
|
|
232
|
+
/**
|
|
233
|
+
* Disable responsive for entire structure
|
|
234
|
+
*/
|
|
235
|
+
disableResponsive?: boolean;
|
|
236
|
+
/**
|
|
237
|
+
* Mame section full width
|
|
238
|
+
*/
|
|
239
|
+
fullWidth?: boolean;
|
|
240
|
+
/**
|
|
241
|
+
* Mind the GAPS! Gaps between structure's columns.
|
|
242
|
+
*/
|
|
243
|
+
gaps?: [number, number];
|
|
244
|
+
columnsWidth?: number[];
|
|
245
|
+
columns?: IStructureColumnOptions[];
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Builder structure interface.
|
|
249
|
+
*/
|
|
250
|
+
export interface IStructure {
|
|
251
|
+
readonly type: TStructureTypes;
|
|
252
|
+
readonly id: number;
|
|
253
|
+
/**
|
|
254
|
+
* If it's module, it can't be edited within email body.
|
|
255
|
+
* @default false
|
|
256
|
+
*/
|
|
257
|
+
isModule?: boolean;
|
|
258
|
+
options: IStructureOptions;
|
|
259
|
+
elements: TBlocks[][];
|
|
260
|
+
readonly columns: number;
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Builder block state interface. If `disabled: true` it can't be dragged from left sidebar.
|
|
264
|
+
*/
|
|
265
|
+
export interface IBlockState {
|
|
266
|
+
/**
|
|
267
|
+
* @default false
|
|
268
|
+
*/
|
|
269
|
+
disabled: boolean;
|
|
270
|
+
/**
|
|
271
|
+
* Show a message in case it's disabled.
|
|
272
|
+
*/
|
|
273
|
+
message: string;
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Builder {@link TextElementComponent} options interface.
|
|
277
|
+
*/
|
|
278
|
+
export interface ITextBlockOptions {
|
|
279
|
+
color?: string;
|
|
280
|
+
font?: IFont;
|
|
281
|
+
lineHeight?: ILineHeight;
|
|
282
|
+
padding?: IPadding;
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Builder {@link ImageComponent} options interface.
|
|
286
|
+
*/
|
|
287
|
+
export interface IImageBLockOptions {
|
|
288
|
+
border?: IBorder;
|
|
289
|
+
width?: IWidthHeight;
|
|
290
|
+
height?: IWidthHeight;
|
|
291
|
+
link?: ILink;
|
|
292
|
+
align?: TAlign;
|
|
293
|
+
title?: string;
|
|
294
|
+
padding?: IPadding;
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Builder {@link ButtonComponent} options interface.
|
|
298
|
+
*/
|
|
299
|
+
export interface IButtonBlockOptions {
|
|
300
|
+
backgroundColor?: string;
|
|
301
|
+
border?: IBorder;
|
|
302
|
+
color?: string;
|
|
303
|
+
font?: IFont;
|
|
304
|
+
align?: TAlign;
|
|
305
|
+
fullWidth?: boolean;
|
|
306
|
+
lineHeight?: ILineHeight;
|
|
307
|
+
link?: ILink;
|
|
308
|
+
innerPadding?: IPadding;
|
|
309
|
+
padding?: IPadding;
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Builder {@link DividerComponent} options interface.
|
|
313
|
+
*/
|
|
314
|
+
export interface IDividerBlockOptions {
|
|
315
|
+
border?: IBorder;
|
|
316
|
+
padding?: IPadding;
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Builder {@link SpacerComponent} options interface.
|
|
320
|
+
*/
|
|
321
|
+
export interface ISpacerBlockOptions {
|
|
322
|
+
height?: IWidthHeight;
|
|
323
|
+
width?: IWidthHeight;
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Builder {@link SocialComponent} options interface.
|
|
327
|
+
*/
|
|
328
|
+
export interface ISocialBlockOptions {
|
|
329
|
+
align?: TAlign;
|
|
330
|
+
mode?: 'vertical' | 'horizontal';
|
|
331
|
+
font?: IFont;
|
|
332
|
+
iconSize?: ILineHeight;
|
|
333
|
+
lineHeight?: ILineHeight;
|
|
334
|
+
color?: string;
|
|
335
|
+
innerPadding?: IPadding;
|
|
336
|
+
padding?: IPadding;
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* Builder {@link SocialComponent} network options interface.
|
|
340
|
+
*/
|
|
341
|
+
export interface ISocialNetwork {
|
|
342
|
+
href: string;
|
|
343
|
+
label?: string;
|
|
344
|
+
name: 'github' | 'instagram' | 'web' | 'snapchat' | 'youtube' | 'vimeo' | 'medium' | 'soundcloud' | 'dribbble' | 'facebook' | 'twitter' | 'pinterest' | 'linkedin' | 'tumblr' | 'xing' | 'tiktok';
|
|
345
|
+
padding?: IPadding;
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* Builder {@link IPBEmail} general options interface.
|
|
349
|
+
*/
|
|
350
|
+
export interface IGeneralOptions {
|
|
351
|
+
width?: IWidthHeight;
|
|
352
|
+
background?: IBackground;
|
|
353
|
+
padding?: IPadding;
|
|
354
|
+
direction?: TDirection;
|
|
355
|
+
name?: string;
|
|
356
|
+
previewText: string;
|
|
357
|
+
global?: {
|
|
358
|
+
fonts?: string[];
|
|
359
|
+
padding?: IPadding;
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* Main builder Email Object interface.
|
|
364
|
+
*/
|
|
365
|
+
export interface IPBEmail {
|
|
366
|
+
general?: IGeneralOptions;
|
|
367
|
+
structures?: IStructure[];
|
|
368
|
+
customFonts?: ICustomFont[];
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* Custom font interface
|
|
372
|
+
*/
|
|
373
|
+
export interface ICustomFont {
|
|
374
|
+
family: string;
|
|
375
|
+
url: string;
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* Builder module interface.
|
|
379
|
+
*/
|
|
380
|
+
export interface IUserModule {
|
|
381
|
+
/**
|
|
382
|
+
* @deprecated Add name instead
|
|
383
|
+
* @ignore
|
|
384
|
+
*/
|
|
385
|
+
thumb?: string;
|
|
386
|
+
name?: string;
|
|
387
|
+
module: IStructure;
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
390
|
+
* @deprecated use IUserModule instead
|
|
391
|
+
* @internal
|
|
392
|
+
*/
|
|
393
|
+
export interface ICustomModule extends IUserModule {
|
|
394
|
+
}
|
|
395
|
+
/**
|
|
396
|
+
* Builder predefined template interface.
|
|
397
|
+
*/
|
|
398
|
+
export interface IUserTemplate {
|
|
399
|
+
id?: string;
|
|
400
|
+
title: string;
|
|
401
|
+
thumbPath: string;
|
|
402
|
+
templateData: IPBEmail;
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* @deprecated use IUserTemplate instead
|
|
406
|
+
* @internal
|
|
407
|
+
*/
|
|
408
|
+
export interface ICustomTemplate extends IUserTemplate {
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* Builder Template Gallery templates interface.
|
|
412
|
+
*/
|
|
413
|
+
export interface IUserTemplateCategory {
|
|
414
|
+
category: string;
|
|
415
|
+
templates: IUserTemplate[];
|
|
416
|
+
}
|
|
417
|
+
/**
|
|
418
|
+
* Builder IMage Gallery images interface.
|
|
419
|
+
*/
|
|
420
|
+
export interface IUserImageCategory {
|
|
421
|
+
category: string;
|
|
422
|
+
images: string[];
|
|
423
|
+
}
|
|
424
|
+
/**
|
|
425
|
+
* Template Storage/Cache keys.
|
|
426
|
+
*/
|
|
427
|
+
export declare enum ETemplatesStorage {
|
|
428
|
+
LATEST_USED = "NGB_LATEST_USED_TEMPLATES",
|
|
429
|
+
STORAGE = "NGB_TEMP_TEMPLATES_STORAGE"
|
|
430
|
+
}
|