@websolutespa/bom-mixer-emails 2.0.1-next.1 → 3.0.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/CHANGELOG.md +13 -25
- package/dist/index.d.ts +43 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +33 -0
- package/dist/index.js.map +1 -0
- package/package.json +42 -24
- package/dist/cjs/index.js +0 -47
- package/dist/cjs/index.js.map +0 -1
- package/dist/esm/app.js +0 -24
- package/dist/esm/app.js.map +0 -1
- package/dist/esm/index.js +0 -3
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/render.js +0 -25
- package/dist/esm/render.js.map +0 -1
- package/dist/types/app.d.ts +0 -3
- package/dist/types/app.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -4
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/render.d.ts +0 -3
- package/dist/types/render.d.ts.map +0 -1
- package/dist/types/types.d.ts +0 -29
- package/dist/types/types.d.ts.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,25 +1,13 @@
|
|
|
1
|
-
# @websolutespa/bom-mixer-emails
|
|
2
|
-
|
|
3
|
-
##
|
|
4
|
-
|
|
5
|
-
###
|
|
6
|
-
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
##
|
|
10
|
-
|
|
11
|
-
###
|
|
12
|
-
|
|
13
|
-
-
|
|
14
|
-
|
|
15
|
-
### Patch Changes
|
|
16
|
-
|
|
17
|
-
- Updated dependencies [e74b305]
|
|
18
|
-
- @websolutespa/bom-mixer-hooks@2.0.1-next.0
|
|
19
|
-
- @websolutespa/bom-core@2.0.1-next.0
|
|
20
|
-
|
|
21
|
-
## 0.0.1
|
|
22
|
-
|
|
23
|
-
### Patch Changes
|
|
24
|
-
|
|
25
|
-
- Added: first release
|
|
1
|
+
# @websolutespa/bom-mixer-emails
|
|
2
|
+
|
|
3
|
+
## 3.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- Release: Bom 3.0
|
|
8
|
+
|
|
9
|
+
## 0.0.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Added: first release
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ILayout } from "@websolutespa/bom-core";
|
|
2
|
+
import { FC, ReactNode } from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/types.d.ts
|
|
5
|
+
type IEmailSharedProps = {
|
|
6
|
+
origin: string;
|
|
7
|
+
layout: ILayout;
|
|
8
|
+
optInUrl?: string;
|
|
9
|
+
optOutUrl?: string;
|
|
10
|
+
viewOnWebUrl?: string;
|
|
11
|
+
preview?: string;
|
|
12
|
+
};
|
|
13
|
+
type IEmailAppProps<T> = IEmailSharedProps & {
|
|
14
|
+
Component: IEmailComponent<T>;
|
|
15
|
+
Layout: IEmailLayoutComponent;
|
|
16
|
+
props: T;
|
|
17
|
+
};
|
|
18
|
+
type IEmailAppComponent<T = any> = FC<Readonly<IEmailAppProps<T>>>;
|
|
19
|
+
type IEmailLayoutProps<T> = IEmailSharedProps & {
|
|
20
|
+
Component: IEmailComponent<T>;
|
|
21
|
+
props: T;
|
|
22
|
+
};
|
|
23
|
+
type IEmailLayoutComponent = FC<Readonly<IEmailSharedProps & {
|
|
24
|
+
children: ReactNode;
|
|
25
|
+
}>>;
|
|
26
|
+
type IEmailComponent<T> = FC<Readonly<IEmailSharedProps & {
|
|
27
|
+
props: T;
|
|
28
|
+
}>> & {
|
|
29
|
+
Layout?: IEmailLayoutComponent;
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=types.d.ts.map
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/app.d.ts
|
|
34
|
+
declare const App: IEmailAppComponent;
|
|
35
|
+
//# sourceMappingURL=app.d.ts.map
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region src/render.d.ts
|
|
38
|
+
declare function renderEmail<T>(props: IEmailAppProps<T>): string;
|
|
39
|
+
//# sourceMappingURL=render.d.ts.map
|
|
40
|
+
|
|
41
|
+
//#endregion
|
|
42
|
+
export { App, IEmailAppComponent, IEmailAppProps, IEmailComponent, IEmailLayoutComponent, IEmailLayoutProps, IEmailSharedProps, renderEmail };
|
|
43
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/types.ts","../src/app.tsx","../src/render.tsx"],"sourcesContent":[],"mappings":";;;;KAGY,iBAAA;;EAAA,MAAA,EAEF,OAFE;EASA,QAAA,CAAA,EAAA,MAAc;EAAA,SAAA,CAAA,EAAA,MAAA;EAAA,YAAM,CAAA,EAAA,MAAA;EAAiB,OACpB,CAAA,EAAA,MAAA;CAAC;AACpB,KAFE,cAEF,CAAA,CAAA,CAAA,GAFsB,iBAEtB,GAAA;EAAqB,SACtB,EAFI,eAEJ,CAFoB,CAEpB,CAAA;EAAC,MAAA,EADA,qBACA;EAGE,KAAA,EAHH,CAGG;CAAkB;AAAuC,KAAzD,kBAAyD,CAAA,IAAA,GAAA,CAAA,GAA3B,EAA2B,CAAxB,QAAwB,CAAf,cAAe,CAAA,CAAA,CAAA,CAAA,CAAA;AAAf,KAE1C,iBAF0C,CAAA,CAAA,CAAA,GAEnB,iBAFmB,GAAA;EAAc,SAAvB,EAGhC,eAHgC,CAGhB,CAHgB,CAAA;EAAQ,KAAX,EAIjC,CAJiC;AAAE,CAAA;AAEhC,KAKA,qBAAA,GAAwB,EALP,CAKU,QALV,CAKmB,iBALnB,GAAA;EAAA,QAAA,EAKmD,SALnD;CAAA,CAAA,CAAA;AACA,KAMjB,eANiB,CAAA,CAAA,CAAA,GAMI,EANJ,CAMO,QANP,CAMgB,iBANhB,GAAA;EAAC,KAAjB,EAM6D,CAN7D;CAAe,CAAA,CAAA,GAAA;EAClB,MAAA,CAAA,EAMC,qBAND;AAGV,CAAA;;;;cCtBa,KAAK;;;;iBCGF,sBAAsB,eAAe"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { LabelProvider, LayoutProvider } from "@websolutespa/bom-mixer-hooks";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { render } from "@react-email/render";
|
|
4
|
+
import { isDevelopment } from "@websolutespa/bom-core";
|
|
5
|
+
|
|
6
|
+
//#region src/app.tsx
|
|
7
|
+
const App = ({ Component, Layout,...props }) => {
|
|
8
|
+
const LayoutComponent = Component.Layout || Layout;
|
|
9
|
+
return /* @__PURE__ */ jsx(LayoutProvider, {
|
|
10
|
+
layout: props.layout,
|
|
11
|
+
children: /* @__PURE__ */ jsx(LabelProvider, { children: /* @__PURE__ */ jsx(LayoutComponent, {
|
|
12
|
+
...props,
|
|
13
|
+
children: /* @__PURE__ */ jsx(Component, { ...props })
|
|
14
|
+
}) })
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region src/render.tsx
|
|
20
|
+
function renderEmail(props) {
|
|
21
|
+
const renderOptions = { pretty: isDevelopment };
|
|
22
|
+
try {
|
|
23
|
+
const html = render(/* @__PURE__ */ jsx(App, { ...props }), renderOptions);
|
|
24
|
+
return html;
|
|
25
|
+
} catch (error) {
|
|
26
|
+
console.log(error);
|
|
27
|
+
return "An error occurred";
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
//#endregion
|
|
32
|
+
export { App, renderEmail };
|
|
33
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["App: IEmailAppComponent","props: IEmailAppProps<T>"],"sources":["../src/app.tsx","../src/render.tsx"],"sourcesContent":["import { LabelProvider, LayoutProvider } from '@websolutespa/bom-mixer-hooks';\r\nimport { IEmailAppComponent } from './types';\r\n\r\nexport const App: IEmailAppComponent = ({ Component, Layout, ...props }) => {\r\n const LayoutComponent = Component.Layout || Layout;\r\n return (\r\n <LayoutProvider layout={props.layout}>\r\n <LabelProvider>\r\n <LayoutComponent {...props}>\r\n <Component {...props}></Component>\r\n </LayoutComponent>\r\n </LabelProvider>\r\n </LayoutProvider>\r\n );\r\n};\r\n","\r\nimport { render } from '@react-email/render';\r\nimport { isDevelopment } from '@websolutespa/bom-core';\r\nimport { App } from './app';\r\nimport { IEmailAppProps } from './types';\r\n\r\nexport function renderEmail<T>(props: IEmailAppProps<T>) {\r\n // console.log('renderEmail.props', props);\r\n const renderOptions = { pretty: isDevelopment };\r\n // console.log('renderEmail.renderOptions', renderOptions);\r\n try {\r\n const html = render((<App {...props} />), renderOptions);\r\n // console.log('renderEmail', 'html', html);\r\n return html;\r\n } catch (error) {\r\n console.log(error);\r\n return 'An error occurred';\r\n }\r\n}\r\n"],"mappings":";;;;;;AAGA,MAAaA,MAA0B,CAAC,EAAE,WAAW,OAAQ,GAAG,OAAO,KAAK;CAC1E,MAAM,kBAAkB,UAAU,UAAU;AAC5C,4BACG;EAAe,QAAQ,MAAM;gCAC3B,+CACE;GAAgB,GAAI;iCAClB,aAAU,GAAI,QAAmB;IAClB,GACJ;GACD;AAEpB;;;;ACRD,SAAgB,YAAeC,OAA0B;CAEvD,MAAM,gBAAgB,EAAE,QAAQ,cAAe;AAE/C,KAAI;EACF,MAAM,OAAO,2BAAS,OAAI,GAAI,QAAS,EAAG,cAAc;AAExD,SAAO;CACR,SAAQ,OAAO;EACd,QAAQ,IAAI,MAAM;AAClB,SAAO;CACR;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@websolutespa/bom-mixer-emails",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Mixer Emails module of the BOM Repository",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bom",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"test-watch": "vitest",
|
|
19
19
|
"coverage:integration": "npm run test -- --coverage.enabled --coverage.provider=istanbul --coverage.all",
|
|
20
20
|
"coverage": "run-s -c --silent coverage:*",
|
|
21
|
-
"compile": "
|
|
21
|
+
"compile": "tsdown",
|
|
22
22
|
"prepack": "bom prepack",
|
|
23
23
|
"postpack": "bom postpack",
|
|
24
24
|
"types": "tsc --noemit"
|
|
@@ -27,26 +27,25 @@
|
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"@react-email/components": "0.0.20",
|
|
29
29
|
"@react-email/render": "0.0.16",
|
|
30
|
-
"@websolutespa/bom-core": "
|
|
31
|
-
"@websolutespa/bom-mixer-hooks": "
|
|
32
|
-
"react-dom": "19.2.
|
|
33
|
-
"react": "19.2.
|
|
30
|
+
"@websolutespa/bom-core": "*",
|
|
31
|
+
"@websolutespa/bom-mixer-hooks": "*",
|
|
32
|
+
"react-dom": "19.2.3",
|
|
33
|
+
"react": "19.2.3"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@react-email/components": "0.0.20",
|
|
37
37
|
"@react-email/render": "0.0.16",
|
|
38
|
-
"@types/react-dom": "19.2.
|
|
39
|
-
"@types/react": "19.2.
|
|
40
|
-
"@websolutespa/bom-cli": "
|
|
41
|
-
"@websolutespa/test": "
|
|
42
|
-
"@websolutespa/tsconfig": "
|
|
43
|
-
"@websolutespa/eslint-config": "
|
|
38
|
+
"@types/react-dom": "19.2.3",
|
|
39
|
+
"@types/react": "19.2.10",
|
|
40
|
+
"@websolutespa/bom-cli": "*",
|
|
41
|
+
"@websolutespa/test": "*",
|
|
42
|
+
"@websolutespa/tsconfig": "*",
|
|
43
|
+
"@websolutespa/eslint-config": "*",
|
|
44
44
|
"eslint": "9.31.0",
|
|
45
45
|
"npm-run-all": "4.1.5",
|
|
46
|
-
"react-dom": "19.2.
|
|
46
|
+
"react-dom": "19.2.3",
|
|
47
47
|
"react-error-boundary": "4.1.2",
|
|
48
|
-
"react": "19.2.
|
|
49
|
-
"ts-node": "^10.9.2",
|
|
48
|
+
"react": "19.2.3",
|
|
50
49
|
"typescript": "5.8.3"
|
|
51
50
|
},
|
|
52
51
|
"publishConfig": {
|
|
@@ -55,17 +54,36 @@
|
|
|
55
54
|
"sideEffects": false,
|
|
56
55
|
"type": "module",
|
|
57
56
|
"prepack": {
|
|
58
|
-
"types": "./dist/
|
|
59
|
-
"main": "./dist/
|
|
60
|
-
"
|
|
61
|
-
"
|
|
57
|
+
"types": "./dist/index.d.ts",
|
|
58
|
+
"main": "./dist/index.js",
|
|
59
|
+
"source": "./src/index.ts",
|
|
60
|
+
"exports": {
|
|
61
|
+
".": {
|
|
62
|
+
"import": "./dist/index.js",
|
|
63
|
+
"types": "./dist/index.d.ts",
|
|
64
|
+
"default": "./dist/index.js"
|
|
65
|
+
}
|
|
66
|
+
}
|
|
62
67
|
},
|
|
63
68
|
"postpack": {
|
|
64
69
|
"types": "./src/index.ts",
|
|
65
|
-
"main": "./src/index.ts"
|
|
70
|
+
"main": "./src/index.ts",
|
|
71
|
+
"exports": {
|
|
72
|
+
".": {
|
|
73
|
+
"import": "./src/index.ts",
|
|
74
|
+
"types": "./src/index.ts",
|
|
75
|
+
"default": "./src/index.ts"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
66
78
|
},
|
|
67
|
-
"types": "./dist/
|
|
68
|
-
"main": "./dist/
|
|
69
|
-
"
|
|
70
|
-
"
|
|
79
|
+
"types": "./dist/index.d.ts",
|
|
80
|
+
"main": "./dist/index.js",
|
|
81
|
+
"source": "./src/index.ts",
|
|
82
|
+
"exports": {
|
|
83
|
+
".": {
|
|
84
|
+
"import": "./dist/index.js",
|
|
85
|
+
"types": "./dist/index.d.ts",
|
|
86
|
+
"default": "./dist/index.js"
|
|
87
|
+
}
|
|
88
|
+
}
|
|
71
89
|
}
|
package/dist/cjs/index.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var bomMixerHooks = require('@websolutespa/bom-mixer-hooks');
|
|
4
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
-
var render = require('@react-email/render');
|
|
6
|
-
var bomCore = require('@websolutespa/bom-core');
|
|
7
|
-
|
|
8
|
-
const App = ({
|
|
9
|
-
Component,
|
|
10
|
-
Layout,
|
|
11
|
-
...props
|
|
12
|
-
}) => {
|
|
13
|
-
const LayoutComponent = Component.Layout || Layout;
|
|
14
|
-
return /*#__PURE__*/jsxRuntime.jsx(bomMixerHooks.LayoutProvider, {
|
|
15
|
-
layout: props.layout,
|
|
16
|
-
children: /*#__PURE__*/jsxRuntime.jsx(bomMixerHooks.LabelProvider, {
|
|
17
|
-
children: /*#__PURE__*/jsxRuntime.jsx(LayoutComponent, {
|
|
18
|
-
...props,
|
|
19
|
-
children: /*#__PURE__*/jsxRuntime.jsx(Component, {
|
|
20
|
-
...props
|
|
21
|
-
})
|
|
22
|
-
})
|
|
23
|
-
})
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
function renderEmail(props) {
|
|
28
|
-
// console.log('renderEmail.props', props);
|
|
29
|
-
const renderOptions = {
|
|
30
|
-
pretty: bomCore.isDevelopment
|
|
31
|
-
};
|
|
32
|
-
// console.log('renderEmail.renderOptions', renderOptions);
|
|
33
|
-
try {
|
|
34
|
-
const html = render.render(/*#__PURE__*/jsxRuntime.jsx(App, {
|
|
35
|
-
...props
|
|
36
|
-
}), renderOptions);
|
|
37
|
-
// console.log('renderEmail', 'html', html);
|
|
38
|
-
return html;
|
|
39
|
-
} catch (error) {
|
|
40
|
-
console.log(error);
|
|
41
|
-
return 'An error occurred';
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
exports.App = App;
|
|
46
|
-
exports.renderEmail = renderEmail;
|
|
47
|
-
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/app.tsx","../../src/render.tsx"],"sourcesContent":[null,null],"names":["App","Component","Layout","props","LayoutComponent","_jsx","LayoutProvider","layout","children","LabelProvider","renderEmail","renderOptions","pretty","isDevelopment","html","render","error","console","log"],"mappings":";;;;;;;AAGO,MAAMA,GAAG,GAAuBA,CAAC;EAAEC,SAAS;EAAEC,MAAM;EAAE,GAAGC;AAAK,CAAE,KAAI;AACzE,EAAA,MAAMC,eAAe,GAAGH,SAAS,CAACC,MAAM,IAAIA,MAAM;EAClD,oBACEG,cAAA,CAACC,4BAAc,EAAA;IAACC,MAAM,EAAEJ,KAAK,CAACI,MAAO;IAAAC,QAAA,eACnCH,cAAA,CAACI,2BAAa,EAAA;MAAAD,QAAA,eACZH,cAAA,CAACD,eAAe,EAAA;AAAA,QAAA,GAAKD,KAAK;QAAAK,QAAA,eACxBH,cAAA,CAACJ,SAAS,EAAA;UAAA,GAAKE;SAAkB;OAClB;KACJ;AACjB,GAAgB,CAAC;AAErB;;ACRM,SAAUO,WAAWA,CAAIP,KAAwB,EAAA;AACrD;AACA,EAAA,MAAMQ,aAAa,GAAG;AAAEC,IAAAA,MAAM,EAAEC;GAAe;AAC/C;EACA,IAAI;AACF,IAAA,MAAMC,IAAI,GAAGC,aAAM,cAAEV,cAAA,CAACL,GAAG,EAAA;MAAA,GAAKG;KAAM,CAAG,EAAGQ,aAAa,CAAC;AACxD;AACA,IAAA,OAAOG,IAAI;EACb,CAAC,CAAC,OAAOE,KAAK,EAAE;AACdC,IAAAA,OAAO,CAACC,GAAG,CAACF,KAAK,CAAC;AAClB,IAAA,OAAO,mBAAmB;AAC5B,EAAA;AACF;;;;;"}
|
package/dist/esm/app.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { LayoutProvider, LabelProvider } from '@websolutespa/bom-mixer-hooks';
|
|
2
|
-
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
|
|
4
|
-
const App = ({
|
|
5
|
-
Component,
|
|
6
|
-
Layout,
|
|
7
|
-
...props
|
|
8
|
-
}) => {
|
|
9
|
-
const LayoutComponent = Component.Layout || Layout;
|
|
10
|
-
return /*#__PURE__*/jsx(LayoutProvider, {
|
|
11
|
-
layout: props.layout,
|
|
12
|
-
children: /*#__PURE__*/jsx(LabelProvider, {
|
|
13
|
-
children: /*#__PURE__*/jsx(LayoutComponent, {
|
|
14
|
-
...props,
|
|
15
|
-
children: /*#__PURE__*/jsx(Component, {
|
|
16
|
-
...props
|
|
17
|
-
})
|
|
18
|
-
})
|
|
19
|
-
})
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export { App };
|
|
24
|
-
//# sourceMappingURL=app.js.map
|
package/dist/esm/app.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app.js","sources":["../../src/app.tsx"],"sourcesContent":[null],"names":["App","Component","Layout","props","LayoutComponent","_jsx","LayoutProvider","layout","children","LabelProvider"],"mappings":";;;AAGO,MAAMA,GAAG,GAAuBA,CAAC;EAAEC,SAAS;EAAEC,MAAM;EAAE,GAAGC;AAAK,CAAE,KAAI;AACzE,EAAA,MAAMC,eAAe,GAAGH,SAAS,CAACC,MAAM,IAAIA,MAAM;EAClD,oBACEG,GAAA,CAACC,cAAc,EAAA;IAACC,MAAM,EAAEJ,KAAK,CAACI,MAAO;IAAAC,QAAA,eACnCH,GAAA,CAACI,aAAa,EAAA;MAAAD,QAAA,eACZH,GAAA,CAACD,eAAe,EAAA;AAAA,QAAA,GAAKD,KAAK;QAAAK,QAAA,eACxBH,GAAA,CAACJ,SAAS,EAAA;UAAA,GAAKE;SAAkB;OAClB;KACJ;AACjB,GAAgB,CAAC;AAErB;;;;"}
|
package/dist/esm/index.js
DELETED
package/dist/esm/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/dist/esm/render.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { render } from '@react-email/render';
|
|
2
|
-
import { isDevelopment } from '@websolutespa/bom-core';
|
|
3
|
-
import { App } from './app.js';
|
|
4
|
-
import { jsx } from 'react/jsx-runtime';
|
|
5
|
-
|
|
6
|
-
function renderEmail(props) {
|
|
7
|
-
// console.log('renderEmail.props', props);
|
|
8
|
-
const renderOptions = {
|
|
9
|
-
pretty: isDevelopment
|
|
10
|
-
};
|
|
11
|
-
// console.log('renderEmail.renderOptions', renderOptions);
|
|
12
|
-
try {
|
|
13
|
-
const html = render(/*#__PURE__*/jsx(App, {
|
|
14
|
-
...props
|
|
15
|
-
}), renderOptions);
|
|
16
|
-
// console.log('renderEmail', 'html', html);
|
|
17
|
-
return html;
|
|
18
|
-
} catch (error) {
|
|
19
|
-
console.log(error);
|
|
20
|
-
return 'An error occurred';
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export { renderEmail };
|
|
25
|
-
//# sourceMappingURL=render.js.map
|
package/dist/esm/render.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"render.js","sources":["../../src/render.tsx"],"sourcesContent":[null],"names":["renderEmail","props","renderOptions","pretty","isDevelopment","html","render","_jsx","App","error","console","log"],"mappings":";;;;;AAMM,SAAUA,WAAWA,CAAIC,KAAwB,EAAA;AACrD;AACA,EAAA,MAAMC,aAAa,GAAG;AAAEC,IAAAA,MAAM,EAAEC;GAAe;AAC/C;EACA,IAAI;AACF,IAAA,MAAMC,IAAI,GAAGC,MAAM,cAAEC,GAAA,CAACC,GAAG,EAAA;MAAA,GAAKP;KAAM,CAAG,EAAGC,aAAa,CAAC;AACxD;AACA,IAAA,OAAOG,IAAI;EACb,CAAC,CAAC,OAAOI,KAAK,EAAE;AACdC,IAAAA,OAAO,CAACC,GAAG,CAACF,KAAK,CAAC;AAClB,IAAA,OAAO,mBAAmB;AAC5B,EAAA;AACF;;;;"}
|
package/dist/types/app.d.ts
DELETED
package/dist/types/app.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/app.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE7C,eAAO,MAAM,GAAG,EAAE,kBAWjB,CAAC"}
|
package/dist/types/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
|
package/dist/types/render.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/render.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC,UAYtD"}
|
package/dist/types/types.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { ILayout } from '@websolutespa/bom-core';
|
|
2
|
-
import { FC, ReactNode } from 'react';
|
|
3
|
-
export type IEmailSharedProps = {
|
|
4
|
-
origin: string;
|
|
5
|
-
layout: ILayout;
|
|
6
|
-
optInUrl?: string;
|
|
7
|
-
optOutUrl?: string;
|
|
8
|
-
viewOnWebUrl?: string;
|
|
9
|
-
preview?: string;
|
|
10
|
-
};
|
|
11
|
-
export type IEmailAppProps<T> = IEmailSharedProps & {
|
|
12
|
-
Component: IEmailComponent<T>;
|
|
13
|
-
Layout: IEmailLayoutComponent;
|
|
14
|
-
props: T;
|
|
15
|
-
};
|
|
16
|
-
export type IEmailAppComponent<T = any> = FC<Readonly<IEmailAppProps<T>>>;
|
|
17
|
-
export type IEmailLayoutProps<T> = IEmailSharedProps & {
|
|
18
|
-
Component: IEmailComponent<T>;
|
|
19
|
-
props: T;
|
|
20
|
-
};
|
|
21
|
-
export type IEmailLayoutComponent = FC<Readonly<IEmailSharedProps & {
|
|
22
|
-
children: ReactNode;
|
|
23
|
-
}>>;
|
|
24
|
-
export type IEmailComponent<T> = FC<Readonly<IEmailSharedProps & {
|
|
25
|
-
props: T;
|
|
26
|
-
}>> & {
|
|
27
|
-
Layout?: IEmailLayoutComponent;
|
|
28
|
-
};
|
|
29
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtC,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI,iBAAiB,GAAG;IAClD,SAAS,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC;IAC9B,MAAM,EAAE,qBAAqB,CAAC;IAC9B,KAAK,EAAE,CAAC,CAAC;CACV,CAAC;AAEF,MAAM,MAAM,kBAAkB,CAAC,CAAC,GAAG,GAAG,IAAI,EAAE,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAE1E,MAAM,MAAM,iBAAiB,CAAC,CAAC,IAAI,iBAAiB,GAAG;IACrD,SAAS,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC;IAC9B,KAAK,EAAE,CAAC,CAAC;CACV,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,EAAE,CAAC,QAAQ,CAAC,iBAAiB,GAAG;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,CAAC,CAAC,CAAC;AAE9F,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,iBAAiB,GAAG;IAAE,KAAK,EAAE,CAAC,CAAA;CAAE,CAAC,CAAC,GAAG;IAChF,MAAM,CAAC,EAAE,qBAAqB,CAAC;CAChC,CAAC"}
|