@websolutespa/bom-mixer-emails 2.0.1-next.0 → 2.0.1-next.2

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 CHANGED
@@ -1,19 +1,31 @@
1
- # @websolutespa/bom-mixer-emails
2
-
3
- ## 2.0.1-next.0
4
-
5
- ### Major Changes
6
-
7
- - e74b305: Release: Payload 3.7.0
8
-
9
- ### Patch Changes
10
-
11
- - Updated dependencies [e74b305]
12
- - @websolutespa/bom-mixer-hooks@2.0.1-next.0
13
- - @websolutespa/bom-core@2.0.1-next.0
14
-
15
- ## 0.0.1
16
-
17
- ### Patch Changes
18
-
19
- - Added: first release
1
+ # @websolutespa/bom-mixer-emails
2
+
3
+ ## 2.0.1-next.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updating: dependencies and build step
8
+
9
+ ## 2.0.1-next.1
10
+
11
+ ### Patch Changes
12
+
13
+ - Fixing: types
14
+
15
+ ## 2.0.1-next.0
16
+
17
+ ### Major Changes
18
+
19
+ - e74b305: Release: Payload 3.7.0
20
+
21
+ ### Patch Changes
22
+
23
+ - Updated dependencies [e74b305]
24
+ - @websolutespa/bom-mixer-hooks@2.0.1-next.0
25
+ - @websolutespa/bom-core@2.0.1-next.0
26
+
27
+ ## 0.0.1
28
+
29
+ ### Patch Changes
30
+
31
+ - Added: first release
@@ -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": "2.0.1-next.0",
3
+ "version": "2.0.1-next.2",
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": "bom compile",
21
+ "compile": "tsdown",
22
22
  "prepack": "bom prepack",
23
23
  "postpack": "bom postpack",
24
24
  "types": "tsc --noemit"
@@ -27,8 +27,8 @@
27
27
  "peerDependencies": {
28
28
  "@react-email/components": "0.0.20",
29
29
  "@react-email/render": "0.0.16",
30
- "@websolutespa/bom-core": "2.0.1-next.0",
31
- "@websolutespa/bom-mixer-hooks": "2.0.1-next.0",
30
+ "@websolutespa/bom-core": "2.0.1-next.2",
31
+ "@websolutespa/bom-mixer-hooks": "2.0.1-next.2",
32
32
  "react-dom": "19.2.1",
33
33
  "react": "19.2.1"
34
34
  },
@@ -37,16 +37,15 @@
37
37
  "@react-email/render": "0.0.16",
38
38
  "@types/react-dom": "19.2.1",
39
39
  "@types/react": "19.2.1",
40
- "@websolutespa/bom-cli": "2.0.1-next.0",
41
- "@websolutespa/test": "2.0.1-next.0",
42
- "@websolutespa/tsconfig": "2.0.1-next.0",
43
- "@websolutespa/eslint-config": "2.0.1-next.0",
40
+ "@websolutespa/bom-cli": "2.0.1-next.2",
41
+ "@websolutespa/test": "2.0.1-next.2",
42
+ "@websolutespa/tsconfig": "2.0.1-next.2",
43
+ "@websolutespa/eslint-config": "2.0.1-next.2",
44
44
  "eslint": "9.31.0",
45
45
  "npm-run-all": "4.1.5",
46
46
  "react-dom": "19.2.1",
47
47
  "react-error-boundary": "4.1.2",
48
48
  "react": "19.2.1",
49
- "ts-node": "^10.9.2",
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/types/index.d.ts",
59
- "main": "./dist/esm/index.js",
60
- "module": "./dist/esm/index.js",
61
- "source": "./src/index.ts"
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/types/index.d.ts",
68
- "main": "./dist/esm/index.js",
69
- "module": "./dist/esm/index.js",
70
- "source": "./src/index.ts"
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
@@ -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
@@ -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
@@ -1,3 +0,0 @@
1
- export { App } from './app.js';
2
- export { renderEmail } from './render.js';
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -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
@@ -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;;;;"}