@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
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { IStructure, IPBEmail, IGeneralOptions } from '../interfaces/interfaces';
|
|
1
|
+
import { IStructure, IPBEmail, IGeneralOptions, ICustomFont } from '../interfaces/interfaces';
|
|
2
2
|
export declare class Defaults {
|
|
3
3
|
structures: IStructure[];
|
|
4
4
|
general: IGeneralOptions;
|
|
5
|
-
|
|
5
|
+
customFonts: ICustomFont[];
|
|
6
|
+
constructor(structures?: IStructure[], general?: IGeneralOptions, customFonts?: ICustomFont[]);
|
|
6
7
|
}
|
|
7
8
|
export declare class PBEmail extends Defaults {
|
|
8
|
-
constructor({ structures, general }?: IPBEmail);
|
|
9
|
+
constructor({ structures, general, customFonts }?: IPBEmail);
|
|
9
10
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IBlockState, IButtonBlockOptions, IDividerBlockOptions, IImageBLockOptions, ISocialBlockOptions, ISocialNetwork, ISpacerBlockOptions, ITextBlockOptions } from '../interfaces/interfaces';
|
|
2
|
-
export declare type TBlocksOptions = ITextBlockOptions | IImageBLockOptions | IButtonBlockOptions | IDividerBlockOptions | ISpacerBlockOptions | ISocialBlockOptions;
|
|
1
|
+
import { IBlockState, IButtonBlockOptions, IDividerBlockOptions, IImageBLockOptions, IVideoBlockOptions, ISocialBlockOptions, ISocialNetwork, ISpacerBlockOptions, ITextBlockOptions } from '../interfaces/interfaces';
|
|
2
|
+
export declare type TBlocksOptions = ITextBlockOptions | IImageBLockOptions | IVideoBlockOptions | IButtonBlockOptions | IDividerBlockOptions | ISpacerBlockOptions | ISocialBlockOptions;
|
|
3
3
|
export declare abstract class AIPBlock {
|
|
4
4
|
readonly type: string;
|
|
5
5
|
readonly icon: string;
|
|
@@ -25,6 +25,16 @@ export declare class ImageBlock implements AIPBlock {
|
|
|
25
25
|
title: string;
|
|
26
26
|
constructor(src?: string, options?: IImageBLockOptions, state?: IBlockState);
|
|
27
27
|
}
|
|
28
|
+
export declare class VideoBlock implements AIPBlock {
|
|
29
|
+
src: string;
|
|
30
|
+
posterSrc: string;
|
|
31
|
+
state: IBlockState;
|
|
32
|
+
readonly type = "video";
|
|
33
|
+
readonly icon = "videocam";
|
|
34
|
+
options: IVideoBlockOptions;
|
|
35
|
+
title: string;
|
|
36
|
+
constructor(src?: string, posterSrc?: string, options?: Partial<IVideoBlockOptions>, state?: IBlockState);
|
|
37
|
+
}
|
|
28
38
|
export declare class ButtonBlock implements AIPBlock {
|
|
29
39
|
innerText: string;
|
|
30
40
|
state: IBlockState;
|
|
@@ -59,4 +69,4 @@ export declare class SocialBlock implements AIPBlock {
|
|
|
59
69
|
options: ISocialBlockOptions;
|
|
60
70
|
constructor(networks?: ISocialNetwork[], options?: ISocialBlockOptions, state?: IBlockState);
|
|
61
71
|
}
|
|
62
|
-
export declare type TBlocks = TextBlock | ImageBlock | ButtonBlock | DividerBlock | SpacerBlock | SocialBlock;
|
|
72
|
+
export declare type TBlocks = TextBlock | ImageBlock | VideoBlock | ButtonBlock | DividerBlock | SpacerBlock | SocialBlock;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ChangeDetectorRef, OnInit, OnDestroy, DoCheck } from '@angular/core';
|
|
2
|
+
import { VideoBlock } from '../../classes/Elements';
|
|
3
|
+
import { PbUserImageUploaderService } from '../../services/user-image-uploader-service/user-image-uploader.service';
|
|
4
|
+
import { PbEmailBuilderService } from '../../pb-email-builder.service';
|
|
5
|
+
import { AbstractBlock } from '../abstract-block';
|
|
6
|
+
import { VideoThumbnailService } from '../../services/video-thumbnail.service';
|
|
7
|
+
export declare class VideoComponent extends AbstractBlock<VideoBlock> implements OnInit, OnDestroy, DoCheck {
|
|
8
|
+
private imageUploader;
|
|
9
|
+
private chRef;
|
|
10
|
+
ngb: PbEmailBuilderService;
|
|
11
|
+
private videoThumbnailService;
|
|
12
|
+
private destroy$;
|
|
13
|
+
private srcChange$;
|
|
14
|
+
private previousSrc;
|
|
15
|
+
private readonly defaultPosterSrc;
|
|
16
|
+
isGeneratingThumbnail: boolean;
|
|
17
|
+
get align(): import("../../interfaces/interfaces").TAlign;
|
|
18
|
+
get src(): string;
|
|
19
|
+
get posterSrc(): string;
|
|
20
|
+
get videoUrl(): string;
|
|
21
|
+
constructor(imageUploader: PbUserImageUploaderService, chRef: ChangeDetectorRef, ngb: PbEmailBuilderService, videoThumbnailService: VideoThumbnailService);
|
|
22
|
+
ngOnInit(): void;
|
|
23
|
+
ngDoCheck(): void;
|
|
24
|
+
ngOnDestroy(): void;
|
|
25
|
+
onVideoUrlChange(url: string): Promise<void>;
|
|
26
|
+
generateThumbnail(url: string): Promise<void>;
|
|
27
|
+
uploadVideo(): Promise<void>;
|
|
28
|
+
uploadPoster(): Promise<void>;
|
|
29
|
+
getVideoStyles(): {
|
|
30
|
+
borderRadius: string;
|
|
31
|
+
width: string;
|
|
32
|
+
height: string;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
@@ -8,9 +8,13 @@ export declare class FontStylesComponent {
|
|
|
8
8
|
private stylesMap;
|
|
9
9
|
constructor(pbEmailObject: PbEmailObjectStoreService, googleFonts: string[], fallbackFonts: string[]);
|
|
10
10
|
get fontWeightList(): number[];
|
|
11
|
+
get customFonts(): string[];
|
|
12
|
+
get customStack(): string;
|
|
11
13
|
get fontFamilyList(): string[];
|
|
14
|
+
get fallbackFontChoices(): string[];
|
|
12
15
|
get styles(): IFont['style'][];
|
|
13
16
|
markForCheck(): void;
|
|
17
|
+
isCustomFont(): boolean;
|
|
14
18
|
isGoogleFont(): boolean;
|
|
15
19
|
getStyleLabel(style: IFont['style']): string;
|
|
16
20
|
hasProperty(property: string): boolean;
|
|
@@ -293,6 +293,18 @@ export interface IImageBLockOptions {
|
|
|
293
293
|
title?: string;
|
|
294
294
|
padding?: IPadding;
|
|
295
295
|
}
|
|
296
|
+
/**
|
|
297
|
+
* Builder {@link VideoComponent} options interface.
|
|
298
|
+
*/
|
|
299
|
+
export interface IVideoBlockOptions {
|
|
300
|
+
border?: IBorder;
|
|
301
|
+
width?: IWidthHeight;
|
|
302
|
+
height?: IWidthHeight;
|
|
303
|
+
link?: ILink;
|
|
304
|
+
align?: TAlign;
|
|
305
|
+
title?: string;
|
|
306
|
+
padding?: IPadding;
|
|
307
|
+
}
|
|
296
308
|
/**
|
|
297
309
|
* Builder {@link ButtonComponent} options interface.
|
|
298
310
|
*/
|
|
@@ -365,6 +377,14 @@ export interface IGeneralOptions {
|
|
|
365
377
|
export interface IPBEmail {
|
|
366
378
|
general?: IGeneralOptions;
|
|
367
379
|
structures?: IStructure[];
|
|
380
|
+
customFonts?: ICustomFont[];
|
|
381
|
+
}
|
|
382
|
+
/**
|
|
383
|
+
* Custom font interface
|
|
384
|
+
*/
|
|
385
|
+
export interface ICustomFont {
|
|
386
|
+
family: string;
|
|
387
|
+
url: string;
|
|
368
388
|
}
|
|
369
389
|
/**
|
|
370
390
|
* Builder module interface.
|
|
@@ -53,7 +53,7 @@ export declare class PbEmailBuilderComponent implements OnChanges, OnDestroy, On
|
|
|
53
53
|
saveEmail(): import("rxjs").Subscription;
|
|
54
54
|
disableBlocksList$(block: TBlocks): import("rxjs").Observable<boolean>;
|
|
55
55
|
disableStructureList$(structure: IStructure): import("rxjs").Observable<boolean>;
|
|
56
|
-
trackByFn(block: TBlocks | IStructure): "button" | "image" | "text" | "divider" | "spacer" | "social" | "cols_1" | "cols_2" | "cols_3" | "cols_4" | "cols_12" | "cols_21";
|
|
56
|
+
trackByFn(block: TBlocks | IStructure): "button" | "video" | "image" | "text" | "divider" | "spacer" | "social" | "cols_1" | "cols_2" | "cols_3" | "cols_4" | "cols_12" | "cols_21";
|
|
57
57
|
changeTabIndex(index: number): void;
|
|
58
58
|
download(source: TExportType): import("rxjs").Subscription;
|
|
59
59
|
importFile(): void;
|
|
@@ -69,6 +69,19 @@ export declare abstract class PbUserRestApiService {
|
|
|
69
69
|
* Get all images to include into Image Gallery.
|
|
70
70
|
*/
|
|
71
71
|
getUserImages$(): Observable<string[]>;
|
|
72
|
+
/**
|
|
73
|
+
* Upload a base64 encoded image to the server.
|
|
74
|
+
*
|
|
75
|
+
* @param base64Image The base64 encoded image data (including the data URI prefix).
|
|
76
|
+
* @param folderPath The folder path where the image should be stored.
|
|
77
|
+
* @param uploadImageAPI The API endpoint for uploading base64 images.
|
|
78
|
+
*/
|
|
79
|
+
userImageUploadBase64$(base64Image: string, folderPath: string): Observable<{
|
|
80
|
+
succeeded: boolean;
|
|
81
|
+
result: {
|
|
82
|
+
url: string;
|
|
83
|
+
};
|
|
84
|
+
}>;
|
|
72
85
|
/**
|
|
73
86
|
* Rewrite the default request which converts PBEmail to HTML, if you have a paid License,
|
|
74
87
|
* this method allows you to rewrite the default Convertor API Path to yours.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { HttpClient } from '@angular/common/http';
|
|
2
|
+
import { PbUserRestApiService } from '../../public_api';
|
|
3
|
+
interface VideoInfo {
|
|
4
|
+
type: 'youtube' | 'vimeo';
|
|
5
|
+
id: string;
|
|
6
|
+
}
|
|
7
|
+
export declare class VideoThumbnailService {
|
|
8
|
+
private http;
|
|
9
|
+
private pbUserRestApiService;
|
|
10
|
+
private readonly YOUTUBE_OVERLAY;
|
|
11
|
+
private readonly VIMEO_OVERLAY;
|
|
12
|
+
constructor(http: HttpClient, pbUserRestApiService: PbUserRestApiService);
|
|
13
|
+
/**
|
|
14
|
+
* Parse video URL to extract platform and video ID
|
|
15
|
+
*/
|
|
16
|
+
parseVideoUrl(url: string): VideoInfo | null;
|
|
17
|
+
getYouTubeThumbnail(videoId: string): string;
|
|
18
|
+
getVimeoThumbnail(url: string): Promise<string | null>;
|
|
19
|
+
private loadImage;
|
|
20
|
+
compositeImages(thumbnailUrl: string, platform: 'youtube' | 'vimeo'): Promise<string>;
|
|
21
|
+
generateThumbnail(videoUrl: string): Promise<string | null>;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
package/package.json
CHANGED
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
"name": "@pobuca/email-builder",
|
|
3
3
|
"description": "Email Builder",
|
|
4
4
|
"private": false,
|
|
5
|
-
"version": "1.0
|
|
5
|
+
"version": "1.2.0",
|
|
6
6
|
"homepage": "https://pobuca.com",
|
|
7
7
|
"peerDependencies": {
|
|
8
8
|
"@angular/common": ">=9",
|
|
9
9
|
"@angular/localize": ">=9",
|
|
10
10
|
"@angular/compiler": ">=9",
|
|
11
11
|
"@angular/core": ">=9",
|
|
12
|
-
"@angular/flex-layout": "
|
|
12
|
+
"@angular/flex-layout": "*",
|
|
13
13
|
"@angular/forms": ">=9",
|
|
14
14
|
"@angular/material": ">=9",
|
|
15
15
|
"@angular/platform-browser": ">=9",
|
|
16
16
|
"@angular/platform-browser-dynamic": ">=9",
|
|
17
17
|
"ngx-color": "^5.1.4",
|
|
18
|
-
"ngx-quill": "
|
|
18
|
+
"ngx-quill": ">=12",
|
|
19
19
|
"quill": "^1.3.7",
|
|
20
20
|
"recursive-diff": "^1.0.7"
|
|
21
21
|
},
|
|
@@ -26,6 +26,11 @@
|
|
|
26
26
|
"name": "Pobuca",
|
|
27
27
|
"url": "https://pobuca.com"
|
|
28
28
|
},
|
|
29
|
+
"keywords": [
|
|
30
|
+
"email builder",
|
|
31
|
+
"angular email builder",
|
|
32
|
+
"angular email editor"
|
|
33
|
+
],
|
|
29
34
|
"main": "bundles/pobuca-email-builder.umd.js",
|
|
30
35
|
"module": "fesm2015/pobuca-email-builder.js",
|
|
31
36
|
"es2015": "fesm2015/pobuca-email-builder.js",
|
|
@@ -2,41 +2,43 @@
|
|
|
2
2
|
* Generated bundle index. Do not edit.
|
|
3
3
|
*/
|
|
4
4
|
export * from './public_api';
|
|
5
|
-
export { BlockSettingsComponent as
|
|
5
|
+
export { BlockSettingsComponent as ɵbf } from './lib/components/block-settings/block-settings.component';
|
|
6
6
|
export { BlockComponent as ɵf } from './lib/components/block/block.component';
|
|
7
|
-
export { BuilderContainerComponent as
|
|
8
|
-
export { ConfirmDialogComponent as
|
|
9
|
-
export { GeneralSettingsComponent as
|
|
10
|
-
export { ImportDialogComponent as
|
|
11
|
-
export { StructureSettingsComponent as
|
|
7
|
+
export { BuilderContainerComponent as ɵq } from './lib/components/builder-container/builder-container.component';
|
|
8
|
+
export { ConfirmDialogComponent as ɵbd } from './lib/components/dialog.component';
|
|
9
|
+
export { GeneralSettingsComponent as ɵbh } from './lib/components/general-settings/general-settings.component';
|
|
10
|
+
export { ImportDialogComponent as ɵbl } from './lib/components/import-dialog/import-dialog.component';
|
|
11
|
+
export { StructureSettingsComponent as ɵbg } from './lib/components/structure-settings/structure-settings.component';
|
|
12
12
|
export { StructureComponent as ɵe } from './lib/components/structure/structure.component';
|
|
13
|
-
export { TemplateListDialogComponent as
|
|
13
|
+
export { TemplateListDialogComponent as ɵbk } from './lib/components/template-list-dialog/template-list-dialog.component';
|
|
14
14
|
export { DynamicComponentDirective as ɵg } from './lib/directives/dynamic-component.directive';
|
|
15
15
|
export { AbstractBlock as ɵi } from './lib/elements/abstract-block';
|
|
16
|
-
export { ButtonComponent as
|
|
17
|
-
export { DividerComponent as
|
|
16
|
+
export { ButtonComponent as ɵm } from './lib/elements/button/button.component';
|
|
17
|
+
export { DividerComponent as ɵn } from './lib/elements/divider/divider.component';
|
|
18
18
|
export { ImageComponent as ɵj } from './lib/elements/image/image.component';
|
|
19
|
-
export { SocialComponent as
|
|
20
|
-
export { SpacerComponent as
|
|
19
|
+
export { SocialComponent as ɵp } from './lib/elements/social/social.component';
|
|
20
|
+
export { SpacerComponent as ɵo } from './lib/elements/spacer/spacer.component';
|
|
21
21
|
export { TextElementComponent as ɵh } from './lib/elements/text-element/text-element.component';
|
|
22
|
-
export {
|
|
23
|
-
export {
|
|
24
|
-
export {
|
|
25
|
-
export {
|
|
26
|
-
export {
|
|
27
|
-
export {
|
|
28
|
-
export {
|
|
29
|
-
export {
|
|
30
|
-
export {
|
|
31
|
-
export {
|
|
32
|
-
export {
|
|
33
|
-
export {
|
|
34
|
-
export {
|
|
35
|
-
export {
|
|
22
|
+
export { VideoComponent as ɵk } from './lib/elements/video/video.component';
|
|
23
|
+
export { AlignComponent as ɵba } from './lib/groups/align';
|
|
24
|
+
export { BackRepatComponent as ɵbc } from './lib/groups/back-repeat';
|
|
25
|
+
export { BorderComponent as ɵx } from './lib/groups/border';
|
|
26
|
+
export { ColorComponent as ɵy } from './lib/groups/color';
|
|
27
|
+
export { DirectionComponent as ɵbb } from './lib/groups/direction';
|
|
28
|
+
export { FontStylesComponent as ɵr } from './lib/groups/font-styles';
|
|
29
|
+
export { GapsComponent as ɵu } from './lib/groups/gaps';
|
|
30
|
+
export { LineHeightComponent as ɵv } from './lib/groups/line-height';
|
|
31
|
+
export { LinkComponent as ɵz } from './lib/groups/link';
|
|
32
|
+
export { MarginComponent as ɵt } from './lib/groups/margin';
|
|
33
|
+
export { PaddingComponent as ɵs } from './lib/groups/padding';
|
|
34
|
+
export { ImageUploadComponent as ɵbe } from './lib/groups/upload-image';
|
|
35
|
+
export { WidthHeightComponent as ɵw } from './lib/groups/width-height';
|
|
36
|
+
export { IpInterceptorInterceptor as ɵbm } from './lib/interceptors/pb-interceptor.interceptor';
|
|
36
37
|
export { PbEmailObjectStoreService as ɵa } from './lib/services/internals/pb-email-object-store/pb-email-object-store.service';
|
|
37
38
|
export { PbUserInterfaceService as ɵb } from './lib/services/internals/user-interfaces/user-interface.service';
|
|
38
39
|
export { FreeUsersPbStorage as ɵd } from './lib/services/pb-storage';
|
|
39
|
-
export { UploadBottomSheetDialogComponent as
|
|
40
|
-
export { UploadImageGalleryComponent as
|
|
40
|
+
export { UploadBottomSheetDialogComponent as ɵbi } from './lib/services/user-image-uploader-service/upload-bottom-sheet-dialog/upload-bottom-sheet-dialog.component';
|
|
41
|
+
export { UploadImageGalleryComponent as ɵbj } from './lib/services/user-image-uploader-service/upload-image-gallery/upload-image-gallery.component';
|
|
41
42
|
export { FreeUsersRestApi as ɵc } from './lib/services/user-rest-api-service';
|
|
42
|
-
export {
|
|
43
|
+
export { VideoThumbnailService as ɵl } from './lib/services/video-thumbnail.service';
|
|
44
|
+
export { LIBRARY_IS_PRO as ɵbn } from './lib/tokens/private-tokens';
|