@rudyzeinoun/email-builder 0.0.38 → 0.0.39
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/dist/index.js +3 -10
- package/dist/index.mjs +3 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -207,9 +207,10 @@ function getBorder({ borderColor }) {
|
|
|
207
207
|
function EmailLayoutReader(props) {
|
|
208
208
|
var _a, _b, _c, _d, _e;
|
|
209
209
|
const childrenIds = (_a = props.childrenIds) != null ? _a : [];
|
|
210
|
-
return /* @__PURE__ */ import_react3.default.createElement(import_react3.Fragment, null, props.previewText && /* @__PURE__ */ import_react3.default.createElement("div", { style: { display: "none", maxHeight: "0px", overflow: "hidden" } }, props.previewText, "\xA0\u200C\xA0\u200C\xA0\u200C\xA0"),
|
|
210
|
+
return /* @__PURE__ */ import_react3.default.createElement(import_react3.Fragment, null, props.previewText && /* @__PURE__ */ import_react3.default.createElement("div", { style: { display: "none", maxHeight: "0px", overflow: "hidden" } }, props.previewText, "\xA0\u200C\xA0\u200C\xA0\u200C\xA0"), /* @__PURE__ */ import_react3.default.createElement(
|
|
211
211
|
"div",
|
|
212
212
|
{
|
|
213
|
+
className: props.underline !== true ? "no-underline" : void 0,
|
|
213
214
|
style: {
|
|
214
215
|
backgroundColor: (_b = props.backdropColor) != null ? _b : "#F5F5F5",
|
|
215
216
|
color: (_c = props.textColor) != null ? _c : "#262626",
|
|
@@ -310,15 +311,7 @@ function Reader({ document, rootBlockId }) {
|
|
|
310
311
|
}
|
|
311
312
|
|
|
312
313
|
// src/renderers/renderToStaticMarkup.tsx
|
|
313
|
-
function parseRootElement(rootElement) {
|
|
314
|
-
const result = EmailLayoutPropsSchema.safeParse(rootElement);
|
|
315
|
-
if (!result.success) {
|
|
316
|
-
throw new Error(`Invalid EmailLayout: ${JSON.stringify(result.error.issues)}`);
|
|
317
|
-
}
|
|
318
|
-
return result.data;
|
|
319
|
-
}
|
|
320
314
|
function renderToStaticMarkup(document, { rootBlockId }) {
|
|
321
|
-
const rootElement = parseRootElement(document["root"].data);
|
|
322
315
|
return "<!DOCTYPE html>" + (0, import_server.renderToStaticMarkup)(
|
|
323
316
|
/* @__PURE__ */ import_react5.default.createElement("html", null, /* @__PURE__ */ import_react5.default.createElement("head", null, /* @__PURE__ */ import_react5.default.createElement("meta", { name: "viewport", content: "width=device-width, initial-scale=1.0" }), /* @__PURE__ */ import_react5.default.createElement("style", { type: "text/css" }, `
|
|
324
317
|
.responsive-mobile { display: none !important; }
|
|
@@ -327,7 +320,7 @@ function renderToStaticMarkup(document, { rootBlockId }) {
|
|
|
327
320
|
.responsive-mobile { display: block !important; }
|
|
328
321
|
.responsive-desktop { display: none !important; }
|
|
329
322
|
}
|
|
330
|
-
|
|
323
|
+
.no-underline a { text-decoration: none }
|
|
331
324
|
`)), /* @__PURE__ */ import_react5.default.createElement("body", null, /* @__PURE__ */ import_react5.default.createElement(Reader, { document, rootBlockId })))
|
|
332
325
|
);
|
|
333
326
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -174,9 +174,10 @@ function getBorder({ borderColor }) {
|
|
|
174
174
|
function EmailLayoutReader(props) {
|
|
175
175
|
var _a, _b, _c, _d, _e;
|
|
176
176
|
const childrenIds = (_a = props.childrenIds) != null ? _a : [];
|
|
177
|
-
return /* @__PURE__ */ React3.createElement(Fragment, null, props.previewText && /* @__PURE__ */ React3.createElement("div", { style: { display: "none", maxHeight: "0px", overflow: "hidden" } }, props.previewText, "\xA0\u200C\xA0\u200C\xA0\u200C\xA0"),
|
|
177
|
+
return /* @__PURE__ */ React3.createElement(Fragment, null, props.previewText && /* @__PURE__ */ React3.createElement("div", { style: { display: "none", maxHeight: "0px", overflow: "hidden" } }, props.previewText, "\xA0\u200C\xA0\u200C\xA0\u200C\xA0"), /* @__PURE__ */ React3.createElement(
|
|
178
178
|
"div",
|
|
179
179
|
{
|
|
180
|
+
className: props.underline !== true ? "no-underline" : void 0,
|
|
180
181
|
style: {
|
|
181
182
|
backgroundColor: (_b = props.backdropColor) != null ? _b : "#F5F5F5",
|
|
182
183
|
color: (_c = props.textColor) != null ? _c : "#262626",
|
|
@@ -277,15 +278,7 @@ function Reader({ document, rootBlockId }) {
|
|
|
277
278
|
}
|
|
278
279
|
|
|
279
280
|
// src/renderers/renderToStaticMarkup.tsx
|
|
280
|
-
function parseRootElement(rootElement) {
|
|
281
|
-
const result = EmailLayoutPropsSchema.safeParse(rootElement);
|
|
282
|
-
if (!result.success) {
|
|
283
|
-
throw new Error(`Invalid EmailLayout: ${JSON.stringify(result.error.issues)}`);
|
|
284
|
-
}
|
|
285
|
-
return result.data;
|
|
286
|
-
}
|
|
287
281
|
function renderToStaticMarkup(document, { rootBlockId }) {
|
|
288
|
-
const rootElement = parseRootElement(document["root"].data);
|
|
289
282
|
return "<!DOCTYPE html>" + baseRenderToStaticMarkup(
|
|
290
283
|
/* @__PURE__ */ React5.createElement("html", null, /* @__PURE__ */ React5.createElement("head", null, /* @__PURE__ */ React5.createElement("meta", { name: "viewport", content: "width=device-width, initial-scale=1.0" }), /* @__PURE__ */ React5.createElement("style", { type: "text/css" }, `
|
|
291
284
|
.responsive-mobile { display: none !important; }
|
|
@@ -294,7 +287,7 @@ function renderToStaticMarkup(document, { rootBlockId }) {
|
|
|
294
287
|
.responsive-mobile { display: block !important; }
|
|
295
288
|
.responsive-desktop { display: none !important; }
|
|
296
289
|
}
|
|
297
|
-
|
|
290
|
+
.no-underline a { text-decoration: none }
|
|
298
291
|
`)), /* @__PURE__ */ React5.createElement("body", null, /* @__PURE__ */ React5.createElement(Reader, { document, rootBlockId })))
|
|
299
292
|
);
|
|
300
293
|
}
|