@comet/brevo-mail-rendering 3.0.0-canary-20250121115908
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/LICENSE +24 -0
- package/lib/blocks/CommonImageBlock.d.ts +11 -0
- package/lib/blocks/CommonImageBlock.d.ts.map +1 -0
- package/lib/blocks/CommonImageBlock.js +29 -0
- package/lib/blocks/NewsletterImageBlock.d.ts +9 -0
- package/lib/blocks/NewsletterImageBlock.d.ts.map +1 -0
- package/lib/blocks/NewsletterImageBlock.js +6 -0
- package/lib/blocks/helpers/imageBlockHelpers.d.ts +17 -0
- package/lib/blocks/helpers/imageBlockHelpers.d.ts.map +1 -0
- package/lib/blocks/helpers/imageBlockHelpers.js +34 -0
- package/lib/blocks.generated.d.ts +131 -0
- package/lib/blocks.generated.d.ts.map +1 -0
- package/lib/blocks.generated.js +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +1 -0
- package/package.json +57 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
BSD 2-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023, Vivid Planet Software GmbH
|
|
4
|
+
|
|
5
|
+
Redistribution and use in source and binary forms, with or without
|
|
6
|
+
modification, are permitted provided that the following conditions are met:
|
|
7
|
+
|
|
8
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
9
|
+
list of conditions and the following disclaimer.
|
|
10
|
+
|
|
11
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
12
|
+
this list of conditions and the following disclaimer in the documentation
|
|
13
|
+
and/or other materials provided with the distribution.
|
|
14
|
+
|
|
15
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
16
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
17
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
18
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
19
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
20
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
21
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
22
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
23
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
24
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { MjmlImage } from "@luma-team/mjml-react";
|
|
3
|
+
import { PixelImageBlockData } from "../blocks.generated";
|
|
4
|
+
interface Props extends React.ComponentProps<typeof MjmlImage> {
|
|
5
|
+
data: PixelImageBlockData;
|
|
6
|
+
desktopRenderWidth?: number;
|
|
7
|
+
contentWidth?: number;
|
|
8
|
+
}
|
|
9
|
+
export declare const CommonImageBlock: ({ data, desktopRenderWidth, contentWidth, ...restProps }: Props) => import("react/jsx-runtime").JSX.Element | null;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=CommonImageBlock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommonImageBlock.d.ts","sourceRoot":"","sources":["../../src/blocks/CommonImageBlock.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAG1D,UAAU,KAAM,SAAQ,KAAK,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC;IAC1D,IAAI,EAAE,mBAAmB,CAAC;IAC1B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,eAAO,MAAM,gBAAgB,6DAA0E,KAAK,mDAiC3G,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { MjmlImage } from "@luma-team/mjml-react";
|
|
14
|
+
import { calculateInheritAspectRatio, generateImageUrl, getDamAllowedImageWidth } from "./helpers/imageBlockHelpers";
|
|
15
|
+
export const CommonImageBlock = (_a) => {
|
|
16
|
+
var { data, desktopRenderWidth = 600, contentWidth = 600 } = _a, restProps = __rest(_a, ["data", "desktopRenderWidth", "contentWidth"]);
|
|
17
|
+
const { damFile, cropArea, urlTemplate } = data;
|
|
18
|
+
if (!(damFile === null || damFile === void 0 ? void 0 : damFile.image)) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
const usedCropArea = cropArea !== null && cropArea !== void 0 ? cropArea : damFile.image.cropArea;
|
|
22
|
+
const usedAspectRatio = calculateInheritAspectRatio(damFile.image, usedCropArea);
|
|
23
|
+
const imageUrl = generateImageUrl({
|
|
24
|
+
width: getDamAllowedImageWidth(desktopRenderWidth, contentWidth),
|
|
25
|
+
src: urlTemplate,
|
|
26
|
+
}, usedAspectRatio);
|
|
27
|
+
const desktopImageHeight = Math.round(desktopRenderWidth / usedAspectRatio);
|
|
28
|
+
return (_jsx(MjmlImage, Object.assign({ src: imageUrl, fluidOnMobile: "true", cssClass: "image-block", width: desktopRenderWidth, height: desktopImageHeight, alt: damFile.altText, title: damFile.title, padding: 0 }, restProps)));
|
|
29
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PropsWithData } from "@comet/cms-site";
|
|
2
|
+
import { NewsletterImageBlockData } from "../blocks.generated";
|
|
3
|
+
interface NewsletterImageBlockProps extends PropsWithData<NewsletterImageBlockData> {
|
|
4
|
+
desktopRenderWidth?: number;
|
|
5
|
+
contentWidth?: number;
|
|
6
|
+
}
|
|
7
|
+
export declare const NewsletterImageBlock: ({ data, desktopRenderWidth, contentWidth }: NewsletterImageBlockProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=NewsletterImageBlock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NewsletterImageBlock.d.ts","sourceRoot":"","sources":["../../src/blocks/NewsletterImageBlock.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAG/D,UAAU,yBAA0B,SAAQ,aAAa,CAAC,wBAAwB,CAAC;IAC/E,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,eAAO,MAAM,oBAAoB,+CAAgD,yBAAyB,4CAQzG,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { MjmlColumn, MjmlSection } from "@luma-team/mjml-react";
|
|
3
|
+
import { CommonImageBlock } from "./CommonImageBlock";
|
|
4
|
+
export const NewsletterImageBlock = ({ data, desktopRenderWidth, contentWidth }) => {
|
|
5
|
+
return (_jsx(MjmlSection, { children: _jsx(MjmlColumn, { children: _jsx(CommonImageBlock, { data: data.image, desktopRenderWidth: desktopRenderWidth, contentWidth: contentWidth }) }) }));
|
|
6
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ImageLoaderProps } from "next/image";
|
|
2
|
+
export declare const validSizes: number[];
|
|
3
|
+
export declare const getDamAllowedImageWidth: (minimumWidth: number, contentWidth: number) => number;
|
|
4
|
+
interface ImageDimensions {
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function calculateInheritAspectRatio(imageDimensions: ImageDimensions, cropArea: {
|
|
9
|
+
focalPoint: "SMART" | "CENTER" | "NORTHWEST" | "NORTHEAST" | "SOUTHWEST" | "SOUTHEAST";
|
|
10
|
+
width?: number;
|
|
11
|
+
height?: number;
|
|
12
|
+
x?: number;
|
|
13
|
+
y?: number;
|
|
14
|
+
}): number;
|
|
15
|
+
export declare function generateImageUrl({ src, width }: Pick<ImageLoaderProps, "src" | "width">, aspectRatio: number): string;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=imageBlockHelpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imageBlockHelpers.d.ts","sourceRoot":"","sources":["../../../src/blocks/helpers/imageBlockHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C,eAAO,MAAM,UAAU,EAAE,MAAM,EAGL,CAAC;AAE3B,eAAO,MAAM,uBAAuB,iBAAkB,MAAM,gBAAgB,MAAM,KAAG,MAiBpF,CAAC;AAEF,UAAU,eAAe;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,2BAA2B,CACvC,eAAe,EAAE,eAAe,EAChC,QAAQ,EAAE;IACN,UAAU,EAAE,OAAO,GAAG,QAAQ,GAAG,WAAW,GAAG,WAAW,GAAG,WAAW,GAAG,WAAW,CAAC;IACvF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;CACd,GACF,MAAM,CAUR;AAED,wBAAgB,gBAAgB,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,IAAI,CAAC,gBAAgB,EAAE,KAAK,GAAG,OAAO,CAAC,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAErH"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export const validSizes = process.env.DAM_ALLOWED_IMAGE_SIZES
|
|
2
|
+
.split(",")
|
|
3
|
+
.map((value) => parseInt(value))
|
|
4
|
+
.sort((a, b) => a - b);
|
|
5
|
+
export const getDamAllowedImageWidth = (minimumWidth, contentWidth) => {
|
|
6
|
+
let width = null;
|
|
7
|
+
const largestPossibleWidth = validSizes[validSizes.length - 1];
|
|
8
|
+
validSizes.forEach((validWidth) => {
|
|
9
|
+
if (minimumWidth === contentWidth) {
|
|
10
|
+
width = contentWidth * 2;
|
|
11
|
+
}
|
|
12
|
+
else if (!width && validWidth >= minimumWidth * 2) {
|
|
13
|
+
width = validWidth;
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
if (!width) {
|
|
17
|
+
return largestPossibleWidth;
|
|
18
|
+
}
|
|
19
|
+
return width;
|
|
20
|
+
};
|
|
21
|
+
export function calculateInheritAspectRatio(imageDimensions, cropArea) {
|
|
22
|
+
if (cropArea.focalPoint === "SMART") {
|
|
23
|
+
return imageDimensions.width / imageDimensions.height;
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
if (cropArea.width === undefined || cropArea.height === undefined) {
|
|
27
|
+
throw new Error("Missing crop dimensions");
|
|
28
|
+
}
|
|
29
|
+
return (cropArea.width * imageDimensions.width) / 100 / ((cropArea.height * imageDimensions.height) / 100);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export function generateImageUrl({ src, width }, aspectRatio) {
|
|
33
|
+
return src.replace("$resizeWidth", String(width)).replace("$resizeHeight", String(Math.ceil(width / aspectRatio)));
|
|
34
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
export interface AnchorBlockData {
|
|
2
|
+
name?: string;
|
|
3
|
+
}
|
|
4
|
+
export interface DamFileDownloadLinkBlockData {
|
|
5
|
+
file?: {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
fileUrl: string;
|
|
9
|
+
size: number;
|
|
10
|
+
scope?: unknown;
|
|
11
|
+
};
|
|
12
|
+
openFileType: "NewTab" | "Download";
|
|
13
|
+
}
|
|
14
|
+
export interface DamImageBlockData {
|
|
15
|
+
attachedBlocks: Array<{
|
|
16
|
+
type: string;
|
|
17
|
+
props: PixelImageBlockData | SvgImageBlockData;
|
|
18
|
+
}>;
|
|
19
|
+
activeType?: string;
|
|
20
|
+
block?: {
|
|
21
|
+
type: string;
|
|
22
|
+
props: PixelImageBlockData | SvgImageBlockData;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export interface DamVideoBlockData {
|
|
26
|
+
autoplay?: boolean;
|
|
27
|
+
showControls?: boolean;
|
|
28
|
+
loop?: boolean;
|
|
29
|
+
previewImage: PixelImageBlockData;
|
|
30
|
+
damFile?: {
|
|
31
|
+
id: string;
|
|
32
|
+
name: string;
|
|
33
|
+
size: number;
|
|
34
|
+
mimetype: string;
|
|
35
|
+
contentHash: string;
|
|
36
|
+
title?: string;
|
|
37
|
+
altText?: string;
|
|
38
|
+
archived: boolean;
|
|
39
|
+
scope?: unknown;
|
|
40
|
+
fileUrl: string;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export interface EmailLinkBlockData {
|
|
44
|
+
email?: string;
|
|
45
|
+
}
|
|
46
|
+
export interface ExternalLinkBlockData {
|
|
47
|
+
targetUrl?: string;
|
|
48
|
+
openInNewWindow: boolean;
|
|
49
|
+
}
|
|
50
|
+
export interface InternalLinkBlockData {
|
|
51
|
+
targetPageAnchor?: string;
|
|
52
|
+
targetPage?: {
|
|
53
|
+
id: string;
|
|
54
|
+
name: string;
|
|
55
|
+
path: string;
|
|
56
|
+
scope?: unknown;
|
|
57
|
+
documentType: string;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
export interface NewsletterImageBlockData {
|
|
61
|
+
image: PixelImageBlockData;
|
|
62
|
+
}
|
|
63
|
+
export interface PhoneLinkBlockData {
|
|
64
|
+
phone?: string;
|
|
65
|
+
}
|
|
66
|
+
export interface PixelImageBlockData {
|
|
67
|
+
damFile?: {
|
|
68
|
+
id: string;
|
|
69
|
+
name: string;
|
|
70
|
+
size: number;
|
|
71
|
+
mimetype: string;
|
|
72
|
+
contentHash: string;
|
|
73
|
+
title?: string;
|
|
74
|
+
altText?: string;
|
|
75
|
+
archived: boolean;
|
|
76
|
+
scope?: unknown;
|
|
77
|
+
image?: {
|
|
78
|
+
width: number;
|
|
79
|
+
height: number;
|
|
80
|
+
cropArea: {
|
|
81
|
+
focalPoint: "SMART" | "CENTER" | "NORTHWEST" | "NORTHEAST" | "SOUTHWEST" | "SOUTHEAST";
|
|
82
|
+
width?: number;
|
|
83
|
+
height?: number;
|
|
84
|
+
x?: number;
|
|
85
|
+
y?: number;
|
|
86
|
+
};
|
|
87
|
+
dominantColor?: string;
|
|
88
|
+
};
|
|
89
|
+
fileUrl: string;
|
|
90
|
+
};
|
|
91
|
+
cropArea?: {
|
|
92
|
+
focalPoint: "SMART" | "CENTER" | "NORTHWEST" | "NORTHEAST" | "SOUTHWEST" | "SOUTHEAST";
|
|
93
|
+
width?: number;
|
|
94
|
+
height?: number;
|
|
95
|
+
x?: number;
|
|
96
|
+
y?: number;
|
|
97
|
+
};
|
|
98
|
+
urlTemplate: string;
|
|
99
|
+
}
|
|
100
|
+
export interface SpaceBlockData {
|
|
101
|
+
height: number;
|
|
102
|
+
}
|
|
103
|
+
export interface SvgImageBlockData {
|
|
104
|
+
damFile?: {
|
|
105
|
+
id: string;
|
|
106
|
+
name: string;
|
|
107
|
+
size: number;
|
|
108
|
+
mimetype: string;
|
|
109
|
+
contentHash: string;
|
|
110
|
+
title?: string;
|
|
111
|
+
altText?: string;
|
|
112
|
+
archived: boolean;
|
|
113
|
+
scope?: unknown;
|
|
114
|
+
fileUrl: string;
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
export interface VimeoVideoBlockData {
|
|
118
|
+
autoplay?: boolean;
|
|
119
|
+
showControls?: boolean;
|
|
120
|
+
loop?: boolean;
|
|
121
|
+
previewImage: PixelImageBlockData;
|
|
122
|
+
vimeoIdentifier?: string;
|
|
123
|
+
}
|
|
124
|
+
export interface YouTubeVideoBlockData {
|
|
125
|
+
autoplay?: boolean;
|
|
126
|
+
showControls?: boolean;
|
|
127
|
+
loop?: boolean;
|
|
128
|
+
previewImage: PixelImageBlockData;
|
|
129
|
+
youtubeIdentifier?: string;
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=blocks.generated.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blocks.generated.d.ts","sourceRoot":"","sources":["../src/blocks.generated.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AACD,MAAM,WAAW,4BAA4B;IACzC,IAAI,CAAC,EAAE;QACH,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,CAAC,EAAE,OAAO,CAAC;KACnB,CAAC;IACF,YAAY,EAAE,QAAQ,GAAG,UAAU,CAAC;CACvC;AACD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M,WAAW,cAAc;IAC3B,MAAM,EAAE,MAAM,CAAC;CAClB;AACD,MAAM,WAAW,iBAAiB;IAC9B,OAAO,CAAC,EAAE;QACN,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,EAAE,MAAM,CAAC;QACpB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,OAAO,CAAC;QAClB,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;KACnB,CAAC;CACL;AACD,MAAM,WAAW,mBAAmB;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,YAAY,EAAE,mBAAmB,CAAC;IAClC,eAAe,CAAC,EAAE,MAAM,CAAC;CAC5B;AACD,MAAM,WAAW,qBAAqB;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,YAAY,EAAE,mBAAmB,CAAC;IAClC,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC9B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC"}
|
package/lib/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { NewsletterImageBlock } from "./blocks/NewsletterImageBlock";
|
package/package.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@comet/brevo-mail-rendering",
|
|
3
|
+
"version": "3.0.0-canary-20250121115908",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "https://github.com/vivid-planet/comet-brevo-module/",
|
|
7
|
+
"directory": "packages/mail-rendering"
|
|
8
|
+
},
|
|
9
|
+
"license": "BSD-2-Clause",
|
|
10
|
+
"main": "lib/index.js",
|
|
11
|
+
"types": "lib/index.d.ts",
|
|
12
|
+
"files": [
|
|
13
|
+
"lib/*"
|
|
14
|
+
],
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"@comet/cli": "^7.10.0",
|
|
17
|
+
"@comet/cms-site": "^7.10.0",
|
|
18
|
+
"@comet/eslint-config": "^7.10.0",
|
|
19
|
+
"@luma-team/mjml-react": "^0.2.1",
|
|
20
|
+
"@types/react": "^18.3.12",
|
|
21
|
+
"@types/react-dom": "^18.3.1",
|
|
22
|
+
"chokidar-cli": "^2.0.0",
|
|
23
|
+
"eslint": "^8.0.0",
|
|
24
|
+
"mjml": "^4.15.3",
|
|
25
|
+
"next": "^14.2.18",
|
|
26
|
+
"npm-run-all2": "^5.0.2",
|
|
27
|
+
"react": "^18.3.1",
|
|
28
|
+
"react-dom": "^18.3.1",
|
|
29
|
+
"rimraf": "^6.0.1",
|
|
30
|
+
"styled-components": "^6.1.13",
|
|
31
|
+
"typescript": "^4.9.5"
|
|
32
|
+
},
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"@comet/cms-site": "^7.10.0",
|
|
35
|
+
"@luma-team/mjml-react": "^0.2.1",
|
|
36
|
+
"mjml": "^4.7.0",
|
|
37
|
+
"next": "^14.2.18",
|
|
38
|
+
"react": "^18.0.0",
|
|
39
|
+
"react-dom": "^18.0.0",
|
|
40
|
+
"styled-components": "^6.1.13"
|
|
41
|
+
},
|
|
42
|
+
"publishConfig": {
|
|
43
|
+
"access": "public",
|
|
44
|
+
"registry": "https://registry.npmjs.org"
|
|
45
|
+
},
|
|
46
|
+
"scripts": {
|
|
47
|
+
"build": "$npm_execpath run clean && npm run generate-block-types && tsc -p tsconfig.build.json",
|
|
48
|
+
"clean": "rimraf lib 'src/**/*.generated.ts'",
|
|
49
|
+
"dev": "$npm_execpath generate-block-types && tsc --watch --preserveWatchOutput -p tsconfig.build.json",
|
|
50
|
+
"generate-block-types": "comet generate-block-types",
|
|
51
|
+
"generate-block-types:watch": "chokidar -s \"**/block-meta.json\" -c \"$npm_execpath generate-block-types\"",
|
|
52
|
+
"lint": "$npm_execpath generate-block-types && run-p lint:eslint lint:prettier lint:tsc",
|
|
53
|
+
"lint:eslint": "eslint --max-warnings 0 src/ package.json",
|
|
54
|
+
"lint:prettier": "npx prettier --check './**/*.{js,json,md,yml,yaml}'",
|
|
55
|
+
"lint:tsc": "tsc --noEmit"
|
|
56
|
+
}
|
|
57
|
+
}
|