@keycloakify/angular-email 0.0.1-rc.2 → 0.0.1-rc.20
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 +160 -13
- package/bin/build.mjs +154 -0
- package/esbuild/esbuild.d.ts +2 -1
- package/fesm2022/keycloakify-angular-email-esbuild.mjs +2 -2
- package/fesm2022/keycloakify-angular-email-esbuild.mjs.map +1 -1
- package/fesm2022/keycloakify-angular-email.mjs +357 -127
- package/fesm2022/keycloakify-angular-email.mjs.map +1 -1
- package/index.d.ts +2 -0
- package/lib/components/background/background.component.d.ts +4 -3
- package/lib/components/body/body.component.d.ts +3 -1
- package/lib/components/button/button.component.d.ts +11 -10
- package/lib/components/column/column.component.d.ts +3 -2
- package/lib/components/container/container.component.d.ts +4 -3
- package/lib/components/heading/heading.component.d.ts +4 -3
- package/lib/components/hr/hr.component.d.ts +4 -3
- package/lib/components/html/html.component.d.ts +3 -1
- package/lib/components/img/img.component.d.ts +4 -3
- package/lib/components/link/link.component.d.ts +4 -3
- package/lib/components/preview/preview.component.d.ts +2 -1
- package/lib/components/raw/raw.component.d.ts +8 -0
- package/lib/components/row/row.component.d.ts +8 -0
- package/lib/components/section/section.component.d.ts +4 -3
- package/lib/components/text/text.component.d.ts +4 -3
- package/lib/render.d.ts +17 -2
- package/lib/utils.d.ts +2 -0
- package/node/index.cjs +1 -0
- package/node/index.d.ts +5 -0
- package/node/index.js +1 -0
- package/package.json +17 -4
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
export declare class LinkComponent {
|
|
3
|
-
$
|
|
3
|
+
$style: import("@angular/core").InputSignal<Record<string, any> | null | undefined>;
|
|
4
|
+
$styleClass: import("@angular/core").InputSignal<string | undefined>;
|
|
4
5
|
$disableDefaultStyle: import("@angular/core").InputSignal<boolean>;
|
|
5
6
|
$href: import("@angular/core").InputSignal<string>;
|
|
6
7
|
$target: import("@angular/core").InputSignal<string>;
|
|
7
|
-
$
|
|
8
|
+
$linkStyle: import("@angular/core").Signal<{
|
|
8
9
|
color?: string | undefined;
|
|
9
10
|
textDecoration?: string | undefined;
|
|
10
11
|
}>;
|
|
11
12
|
static ɵfac: i0.ɵɵFactoryDeclaration<LinkComponent, never>;
|
|
12
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<LinkComponent, "ng-email-link", never, { "$
|
|
13
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<LinkComponent, "ng-email-link", never, { "$style": { "alias": "style"; "required": false; "isSignal": true; }; "$styleClass": { "alias": "styleClass"; "required": false; "isSignal": true; }; "$disableDefaultStyle": { "alias": "disableDefaultStyle"; "required": false; "isSignal": true; }; "$href": { "alias": "href"; "required": false; "isSignal": true; }; "$target": { "alias": "target"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
13
14
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
export declare class PreviewComponent {
|
|
3
3
|
$preview: import("@angular/core").InputSignal<string>;
|
|
4
|
-
|
|
4
|
+
maxLength: number;
|
|
5
|
+
$text: import("@angular/core").Signal<string | null>;
|
|
5
6
|
static ɵfac: i0.ɵɵFactoryDeclaration<PreviewComponent, never>;
|
|
6
7
|
static ɵcmp: i0.ɵɵComponentDeclaration<PreviewComponent, "ng-email-preview", never, { "$preview": { "alias": "preview"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
7
8
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class RawComponent {
|
|
3
|
+
$disablePlainTextOutput: import("@angular/core").InputSignal<boolean>;
|
|
4
|
+
$content: import("@angular/core").InputSignal<string>;
|
|
5
|
+
$escapingContent: import("@angular/core").Signal<string>;
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RawComponent, never>;
|
|
7
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<RawComponent, "ng-email-raw", never, { "$disablePlainTextOutput": { "alias": "disablePlainTextOutput"; "required": false; "isSignal": true; }; "$content": { "alias": "content"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class RowComponent {
|
|
3
|
+
$style: import("@angular/core").InputSignal<Record<string, any> | null | undefined>;
|
|
4
|
+
$styleClass: import("@angular/core").InputSignal<string | undefined>;
|
|
5
|
+
$disableDefaultStyle: import("@angular/core").InputSignal<boolean>;
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RowComponent, never>;
|
|
7
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<RowComponent, "ng-email-row", never, { "$style": { "alias": "style"; "required": false; "isSignal": true; }; "$styleClass": { "alias": "styleClass"; "required": false; "isSignal": true; }; "$disableDefaultStyle": { "alias": "disableDefaultStyle"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
8
|
+
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
export declare class SectionComponent {
|
|
3
|
-
$
|
|
4
|
-
$
|
|
3
|
+
$style: import("@angular/core").InputSignal<Record<string, any> | null | undefined>;
|
|
4
|
+
$styleClass: import("@angular/core").InputSignal<string | undefined>;
|
|
5
|
+
$sectionStyle: import("@angular/core").Signal<string>;
|
|
5
6
|
static ɵfac: i0.ɵɵFactoryDeclaration<SectionComponent, never>;
|
|
6
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SectionComponent, "ng-email-section", never, { "$
|
|
7
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SectionComponent, "ng-email-section", never, { "$style": { "alias": "style"; "required": false; "isSignal": true; }; "$styleClass": { "alias": "styleClass"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
7
8
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
export declare class TextComponent {
|
|
3
|
-
$
|
|
3
|
+
$style: import("@angular/core").InputSignal<Record<string, any> | null | undefined>;
|
|
4
|
+
$styleClass: import("@angular/core").InputSignal<string | undefined>;
|
|
4
5
|
$disableDefaultStyle: import("@angular/core").InputSignal<boolean>;
|
|
5
|
-
$
|
|
6
|
+
$textStyle: import("@angular/core").Signal<{
|
|
6
7
|
fontSize?: string | undefined;
|
|
7
8
|
lineHeight?: string | undefined;
|
|
8
9
|
margin?: string | undefined;
|
|
9
10
|
}>;
|
|
10
11
|
static ɵfac: i0.ɵɵFactoryDeclaration<TextComponent, never>;
|
|
11
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<TextComponent, "ng-email-text", never, { "$
|
|
12
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TextComponent, "ng-email-text", never, { "$style": { "alias": "style"; "required": false; "isSignal": true; }; "$styleClass": { "alias": "styleClass"; "required": false; "isSignal": true; }; "$disableDefaultStyle": { "alias": "disableDefaultStyle"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
12
13
|
}
|
package/lib/render.d.ts
CHANGED
|
@@ -1,12 +1,27 @@
|
|
|
1
1
|
import { Type } from '@angular/core';
|
|
2
|
-
|
|
2
|
+
import { Config } from 'tailwindcss';
|
|
3
|
+
type Render<Input extends Record<string, any>> = {
|
|
3
4
|
component: Type<unknown>;
|
|
4
5
|
/** Component selector */
|
|
5
6
|
selector: string;
|
|
7
|
+
props?: Input;
|
|
6
8
|
options?: {
|
|
7
9
|
plainText?: boolean;
|
|
8
10
|
pretty?: boolean;
|
|
11
|
+
/** tailwind configuration object */
|
|
12
|
+
tailwindConfig?: Partial<Config>;
|
|
13
|
+
signalInputsPrefix?: string;
|
|
9
14
|
};
|
|
10
15
|
};
|
|
11
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Renders an Angular component to HTML and applies transformations.
|
|
18
|
+
*
|
|
19
|
+
* @param component - The Angular component to render.
|
|
20
|
+
* @param selector - The Component selector.
|
|
21
|
+
* @param options - Optional rendering options.
|
|
22
|
+
*
|
|
23
|
+
* @returns {Promise<string>} The rendered HTML or plain text.
|
|
24
|
+
*/
|
|
25
|
+
export declare const render: <Input extends Record<string, any>>({ component, selector, props, options, }: Render<Input>) => Promise<string>;
|
|
26
|
+
export type RenderToHtml<Input extends Record<string, any>> = (props?: Input) => ReturnType<typeof render>;
|
|
12
27
|
export {};
|
package/lib/utils.d.ts
CHANGED
|
@@ -14,3 +14,5 @@ export declare const styleToString: (style: Record<string, string | number | nul
|
|
|
14
14
|
export declare const classToString: (style: string | string[] | Set<string> | Record<string, any> | null | undefined) => string;
|
|
15
15
|
export declare const unreachable: (condition: never, message?: string) => never;
|
|
16
16
|
export declare const HTMLElements: string[];
|
|
17
|
+
export declare function escapeForRawComponent(input: string): string;
|
|
18
|
+
export declare function unescapeForRawComponent(input: string): string;
|
package/node/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var m=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var T=Object.prototype.hasOwnProperty;var y=(o,t)=>{for(var e in t)m(o,e,{get:t[e],enumerable:!0})},v=(o,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of j(t))!T.call(o,n)&&n!==e&&m(o,n,{get:()=>t[n],enumerable:!(s=x(t,n))||s.enumerable});return o};var k=o=>v(m({},"__esModule",{value:!0}),o);var F={};y(F,{toHTML:()=>D});module.exports=k(F);var u=require("@keycloakify/angular-email/esbuild"),p=require("esbuild"),g=require("node:fs/promises"),l=require("node:path"),a=require("node:process"),d=require("node:url"),D=async o=>{let t=console.log;console.log=function(...r){if(r[0]!=="Angular is running in development mode.")return console.info(...r)};let{filePath:e,props:s,root:n}=o;try{let r=new Date,i=n??(0,a.cwd)(),c=(0,l.join)(i,".tmp/emails"),f=await(0,p.build)({logLevel:"warning",entryPoints:[e],bundle:!0,outdir:c,absWorkingDir:i,platform:"node",sourcemap:!1,minify:!0,packages:"bundle",external:["juice","postcss"],format:"cjs",outExtension:{".js":".cjs"},target:"node20",plugins:[(0,u.angularEsbuildPlugin)(i)],metafile:!0}),b=Object.entries(f.metafile.outputs)[0],h=await(await import((0,d.pathToFileURL)((0,l.resolve)(i,b[0])).toString())).renderToHtml(s);await(0,g.rm)(c,{recursive:!0,force:!0});let w=(new Date().getTime()-r.getTime())/1e3,P=e.split("/").pop();return console.log("\x1B[36m%s\x1B[0m",`rendered ${P} to html in ${w}s`),console.log=t,h}catch(r){console.log=t,console.error(r),(0,a.exit)(1)}};0&&(module.exports={toHTML});
|
package/node/index.d.ts
ADDED
package/node/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{angularEsbuildPlugin as g}from"@keycloakify/angular-email/esbuild";import{build as d}from"esbuild";import{rm as f}from"node:fs/promises";import{join as b,resolve as h}from"node:path";import{cwd as w,exit as P}from"node:process";import{pathToFileURL as x}from"node:url";var L=async s=>{let e=console.log;console.log=function(...t){if(t[0]!=="Angular is running in development mode.")return console.info(...t)};let{filePath:n,props:i,root:l}=s;try{let t=new Date,o=l??w(),r=b(o,".tmp/emails"),a=await d({logLevel:"warning",entryPoints:[n],bundle:!0,outdir:r,absWorkingDir:o,platform:"node",sourcemap:!1,minify:!0,packages:"bundle",external:["juice","postcss"],format:"cjs",outExtension:{".js":".cjs"},target:"node20",plugins:[g(o)],metafile:!0}),m=Object.entries(a.metafile.outputs)[0],c=await(await import(x(h(o,m[0])).toString())).renderToHtml(i);await f(r,{recursive:!0,force:!0});let u=(new Date().getTime()-t.getTime())/1e3,p=n.split("/").pop();return console.log("\x1B[36m%s\x1B[0m",`rendered ${p} to html in ${u}s`),console.log=e,c}catch(t){console.log=e,console.error(t),P(1)}};export{L as toHTML};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@keycloakify/angular-email",
|
|
3
|
-
"version": "0.0.1-rc.
|
|
3
|
+
"version": "0.0.1-rc.20",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Angular Email Builder",
|
|
@@ -26,15 +26,22 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"tslib": "^2.3.0",
|
|
28
28
|
"html-to-text": "^9.0.5",
|
|
29
|
-
"pretty": "^2.0.0",
|
|
30
29
|
"cheerio": "^1.0.0",
|
|
31
30
|
"@angular/build": "^19.1.0",
|
|
32
|
-
"@angular/platform-server": "^19.1.0"
|
|
31
|
+
"@angular/platform-server": "^19.1.0",
|
|
32
|
+
"tailwindcss-preset-email": "^1.4.0",
|
|
33
|
+
"juice": "^11.0.1",
|
|
34
|
+
"postcss": "^8.5.3",
|
|
35
|
+
"pretty": "^2.0.0",
|
|
36
|
+
"termost": "^1.4.0"
|
|
33
37
|
},
|
|
34
38
|
"sideEffects": false,
|
|
35
39
|
"publishConfig": {
|
|
36
40
|
"access": "public"
|
|
37
41
|
},
|
|
42
|
+
"bin": {
|
|
43
|
+
"keycloakify-angular-email": "bin/build.mjs"
|
|
44
|
+
},
|
|
38
45
|
"module": "fesm2022/keycloakify-angular-email.mjs",
|
|
39
46
|
"typings": "index.d.ts",
|
|
40
47
|
"exports": {
|
|
@@ -48,6 +55,12 @@
|
|
|
48
55
|
"./esbuild": {
|
|
49
56
|
"types": "./esbuild/index.d.ts",
|
|
50
57
|
"default": "./fesm2022/keycloakify-angular-email-esbuild.mjs"
|
|
58
|
+
},
|
|
59
|
+
"./node": {
|
|
60
|
+
"types": "./node/index.d.ts",
|
|
61
|
+
"import": "./node/index.js",
|
|
62
|
+
"require": "./node/index.cjs",
|
|
63
|
+
"default": "./node/index.cjs"
|
|
51
64
|
}
|
|
52
65
|
}
|
|
53
|
-
}
|
|
66
|
+
}
|