@rudyzeinoun/email-builder 0.0.37 → 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 CHANGED
@@ -207,16 +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(
211
- "div",
212
- {
213
- style: { display: "none", maxHeight: "0px", overflow: "hidden" }
214
- },
215
- props.previewText,
216
- "\xA0\u200C\xA0\u200C\xA0\u200C\xA0"
217
- ), /* @__PURE__ */ import_react3.default.createElement(
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(
218
211
  "div",
219
212
  {
213
+ className: props.underline !== true ? "no-underline" : void 0,
220
214
  style: {
221
215
  backgroundColor: (_b = props.backdropColor) != null ? _b : "#F5F5F5",
222
216
  color: (_c = props.textColor) != null ? _c : "#262626",
@@ -317,15 +311,7 @@ function Reader({ document, rootBlockId }) {
317
311
  }
318
312
 
319
313
  // src/renderers/renderToStaticMarkup.tsx
320
- function parseRootElement(rootElement) {
321
- const result = EmailLayoutPropsSchema.safeParse(rootElement);
322
- if (!result.success) {
323
- throw new Error(`Invalid EmailLayout: ${JSON.stringify(result.error.issues)}`);
324
- }
325
- return result.data;
326
- }
327
314
  function renderToStaticMarkup(document, { rootBlockId }) {
328
- const rootElement = parseRootElement(document["root"].data);
329
315
  return "<!DOCTYPE html>" + (0, import_server.renderToStaticMarkup)(
330
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" }, `
331
317
  .responsive-mobile { display: none !important; }
@@ -334,7 +320,7 @@ function renderToStaticMarkup(document, { rootBlockId }) {
334
320
  .responsive-mobile { display: block !important; }
335
321
  .responsive-desktop { display: none !important; }
336
322
  }
337
- ${rootElement.underline !== true ? "a { text-decoration: none; }" : ""}
323
+ .no-underline a { text-decoration: none }
338
324
  `)), /* @__PURE__ */ import_react5.default.createElement("body", null, /* @__PURE__ */ import_react5.default.createElement(Reader, { document, rootBlockId })))
339
325
  );
340
326
  }
package/dist/index.mjs CHANGED
@@ -174,16 +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(
178
- "div",
179
- {
180
- style: { display: "none", maxHeight: "0px", overflow: "hidden" }
181
- },
182
- props.previewText,
183
- "\xA0\u200C\xA0\u200C\xA0\u200C\xA0"
184
- ), /* @__PURE__ */ React3.createElement(
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(
185
178
  "div",
186
179
  {
180
+ className: props.underline !== true ? "no-underline" : void 0,
187
181
  style: {
188
182
  backgroundColor: (_b = props.backdropColor) != null ? _b : "#F5F5F5",
189
183
  color: (_c = props.textColor) != null ? _c : "#262626",
@@ -284,15 +278,7 @@ function Reader({ document, rootBlockId }) {
284
278
  }
285
279
 
286
280
  // src/renderers/renderToStaticMarkup.tsx
287
- function parseRootElement(rootElement) {
288
- const result = EmailLayoutPropsSchema.safeParse(rootElement);
289
- if (!result.success) {
290
- throw new Error(`Invalid EmailLayout: ${JSON.stringify(result.error.issues)}`);
291
- }
292
- return result.data;
293
- }
294
281
  function renderToStaticMarkup(document, { rootBlockId }) {
295
- const rootElement = parseRootElement(document["root"].data);
296
282
  return "<!DOCTYPE html>" + baseRenderToStaticMarkup(
297
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" }, `
298
284
  .responsive-mobile { display: none !important; }
@@ -301,7 +287,7 @@ function renderToStaticMarkup(document, { rootBlockId }) {
301
287
  .responsive-mobile { display: block !important; }
302
288
  .responsive-desktop { display: none !important; }
303
289
  }
304
- ${rootElement.underline !== true ? "a { text-decoration: none; }" : ""}
290
+ .no-underline a { text-decoration: none }
305
291
  `)), /* @__PURE__ */ React5.createElement("body", null, /* @__PURE__ */ React5.createElement(Reader, { document, rootBlockId })))
306
292
  );
307
293
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rudyzeinoun/email-builder",
3
- "version": "0.0.37",
3
+ "version": "0.0.39",
4
4
  "description": "React component to render email messages",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",