@websolutespa/bom-mixer-emails 3.1.2 → 3.1.3

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,5 +1,7 @@
1
1
  # @websolutespa/bom-mixer-emails
2
2
 
3
+ ## 3.1.3
4
+
3
5
  ## 3.1.2
4
6
 
5
7
  ## 3.1.1
package/dist/index.js CHANGED
@@ -4,12 +4,12 @@ import { isDevelopment } from "@websolutespa/bom-core";
4
4
  //#region src/app.tsx
5
5
  const App = ({ Component, Layout, ...props }) => {
6
6
  const LayoutComponent = Component.Layout || Layout;
7
- return <LayoutProvider layout={props.layout}>
8
- <LabelProvider>
9
- <LayoutComponent {...props}>
10
- <Component {...props}></Component>
11
- </LayoutComponent>
12
- </LabelProvider>
7
+ return <LayoutProvider layout={props.layout}>
8
+ <LabelProvider>
9
+ <LayoutComponent {...props}>
10
+ <Component {...props}></Component>
11
+ </LayoutComponent>
12
+ </LabelProvider>
13
13
  </LayoutProvider>;
14
14
  };
15
15
  //#endregion
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"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","import { 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 async function renderEmail<T>(props: IEmailAppProps<T>): Promise<string> {\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 = await 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,MAAa,OAA2B,EAAE,WAAW,QAAQ,GAAG,YAAY;CAC1E,MAAM,kBAAkB,UAAU,UAAU;AAC5C,QACE,CAAC,eAAe,QAAQ,MAAM,QAAQ;MACpC,CAAC,cAAc;QACb,CAAC,oBAAoB,OAAO;UAC1B,CAAC,cAAc,OAAO,EAAE,UAAU;QACpC,EAAE,gBAAgB;MACpB,EAAE,cAAc;IAClB,EAAE;;;;ACPN,eAAsB,YAAe,OAA2C;CAE9E,MAAM,gBAAgB,EAAE,QAAQ,eAAe;AAE/C,KAAI;AAGF,SAFa,MAAM,OAAQ,CAAC,QAAQ,WAAY,cAAc;UAGvD,OAAO;AACd,UAAQ,IAAI,MAAM;AAClB,SAAO"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/app.tsx","../src/render.tsx"],"sourcesContent":["import { LabelProvider, LayoutProvider } from '@websolutespa/bom-mixer-hooks';\nimport { IEmailAppComponent } from './types';\n\nexport const App: IEmailAppComponent = ({ Component, Layout, ...props }) => {\n const LayoutComponent = Component.Layout || Layout;\n return (\n <LayoutProvider layout={props.layout}>\n <LabelProvider>\n <LayoutComponent {...props}>\n <Component {...props}></Component>\n </LayoutComponent>\n </LabelProvider>\n </LayoutProvider>\n );\n};\n","import { 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 async function renderEmail<T>(props: IEmailAppProps<T>): Promise<string> {\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 = await 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,MAAa,OAA2B,EAAE,WAAW,QAAQ,GAAG,YAAY;CAC1E,MAAM,kBAAkB,UAAU,UAAU;AAC5C,QACE,CAAC,eAAe,QAAQ,MAAM,QAAQ;MACpC,CAAC,cAAc;QACb,CAAC,oBAAoB,OAAO;UAC1B,CAAC,cAAc,OAAO,EAAE,UAAU;QACpC,EAAE,gBAAgB;MACpB,EAAE,cAAc;IAClB,EAAE;;;;ACPN,eAAsB,YAAe,OAA2C;CAE9E,MAAM,gBAAgB,EAAE,QAAQ,eAAe;AAE/C,KAAI;AAGF,SAFa,MAAM,OAAQ,CAAC,QAAQ,WAAY,cAAc;UAGvD,OAAO;AACd,UAAQ,IAAI,MAAM;AAClB,SAAO"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@websolutespa/bom-mixer-emails",
3
- "version": "3.1.2",
3
+ "version": "3.1.3",
4
4
  "description": "Mixer Emails module of the BOM Repository",
5
5
  "keywords": [
6
6
  "bom",
@@ -38,15 +38,14 @@
38
38
  "@types/react": "19.2.18",
39
39
  "@types/react-dom": "19.2.7",
40
40
  "@vitest/coverage-istanbul": "5.0.5",
41
- "@websolutespa/bom-cli": "^3.1.2",
42
- "@websolutespa/eslint-config": "^3.1.2",
43
- "@websolutespa/test": "^3.1.2",
44
- "@websolutespa/tsconfig": "^3.1.2",
41
+ "@websolutespa/bom-cli": "^3.1.3",
42
+ "@websolutespa/eslint-config": "^3.1.3",
43
+ "@websolutespa/test": "^3.1.3",
44
+ "@websolutespa/tsconfig": "^3.1.3",
45
45
  "eslint": "10.13.0",
46
46
  "npm-run-all": "4.1.5",
47
47
  "react": "19.2.9",
48
48
  "react-dom": "19.2.9",
49
- "react-error-boundary": "6.1.6",
50
49
  "tsdown": "0.21.0",
51
50
  "typescript": "6.0.3",
52
51
  "vitest": "5.0.5"
@@ -1,8 +1,8 @@
1
- import { describe, expect, it } from 'vitest';
2
-
3
- describe('Example', () => {
4
- it('passes', async () => {
5
- const value = 'test';
6
- expect(value).toEqual(value);
7
- });
8
- });
1
+ import { describe, expect, it } from 'vitest';
2
+
3
+ describe('Example', () => {
4
+ it('passes', async () => {
5
+ const value = 'test';
6
+ expect(value).toEqual(value);
7
+ });
8
+ });
package/src/app.tsx CHANGED
@@ -1,15 +1,15 @@
1
- import { LabelProvider, LayoutProvider } from '@websolutespa/bom-mixer-hooks';
2
- import { IEmailAppComponent } from './types';
3
-
4
- export const App: IEmailAppComponent = ({ Component, Layout, ...props }) => {
5
- const LayoutComponent = Component.Layout || Layout;
6
- return (
7
- <LayoutProvider layout={props.layout}>
8
- <LabelProvider>
9
- <LayoutComponent {...props}>
10
- <Component {...props}></Component>
11
- </LayoutComponent>
12
- </LabelProvider>
13
- </LayoutProvider>
14
- );
15
- };
1
+ import { LabelProvider, LayoutProvider } from '@websolutespa/bom-mixer-hooks';
2
+ import { IEmailAppComponent } from './types';
3
+
4
+ export const App: IEmailAppComponent = ({ Component, Layout, ...props }) => {
5
+ const LayoutComponent = Component.Layout || Layout;
6
+ return (
7
+ <LayoutProvider layout={props.layout}>
8
+ <LabelProvider>
9
+ <LayoutComponent {...props}>
10
+ <Component {...props}></Component>
11
+ </LayoutComponent>
12
+ </LabelProvider>
13
+ </LayoutProvider>
14
+ );
15
+ };
package/src/types.ts CHANGED
@@ -1,30 +1,30 @@
1
- import { ILayout } from '@websolutespa/bom-core';
2
- import { FC, ReactNode } from 'react';
3
-
4
- export type IEmailSharedProps = {
5
- origin: string;
6
- layout: ILayout;
7
- optInUrl?: string;
8
- optOutUrl?: string;
9
- viewOnWebUrl?: string;
10
- preview?: string;
11
- };
12
-
13
- export type IEmailAppProps<T> = IEmailSharedProps & {
14
- Component: IEmailComponent<T>;
15
- Layout: IEmailLayoutComponent;
16
- props: T;
17
- };
18
-
19
- export type IEmailAppComponent<T = any> = FC<Readonly<IEmailAppProps<T>>>;
20
-
21
- export type IEmailLayoutProps<T> = IEmailSharedProps & {
22
- Component: IEmailComponent<T>;
23
- props: T;
24
- };
25
-
26
- export type IEmailLayoutComponent = FC<Readonly<IEmailSharedProps & { children: ReactNode }>>;
27
-
28
- export type IEmailComponent<T> = FC<Readonly<IEmailSharedProps & { props: T }>> & {
29
- Layout?: IEmailLayoutComponent;
30
- };
1
+ import { ILayout } from '@websolutespa/bom-core';
2
+ import { FC, ReactNode } from 'react';
3
+
4
+ export type IEmailSharedProps = {
5
+ origin: string;
6
+ layout: ILayout;
7
+ optInUrl?: string;
8
+ optOutUrl?: string;
9
+ viewOnWebUrl?: string;
10
+ preview?: string;
11
+ };
12
+
13
+ export type IEmailAppProps<T> = IEmailSharedProps & {
14
+ Component: IEmailComponent<T>;
15
+ Layout: IEmailLayoutComponent;
16
+ props: T;
17
+ };
18
+
19
+ export type IEmailAppComponent<T = any> = FC<Readonly<IEmailAppProps<T>>>;
20
+
21
+ export type IEmailLayoutProps<T> = IEmailSharedProps & {
22
+ Component: IEmailComponent<T>;
23
+ props: T;
24
+ };
25
+
26
+ export type IEmailLayoutComponent = FC<Readonly<IEmailSharedProps & { children: ReactNode }>>;
27
+
28
+ export type IEmailComponent<T> = FC<Readonly<IEmailSharedProps & { props: T }>> & {
29
+ Layout?: IEmailLayoutComponent;
30
+ };