@rudyzeinoun/email-builder 0.0.34 → 0.0.35

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
@@ -317,8 +317,15 @@ function Reader({ document, rootBlockId }) {
317
317
  }
318
318
 
319
319
  // 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
+ }
320
327
  function renderToStaticMarkup(document, { rootBlockId }) {
321
- var _a;
328
+ const rootElement = parseRootElement(document["root"]);
322
329
  return "<!DOCTYPE html>" + (0, import_server.renderToStaticMarkup)(
323
330
  /* @__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
331
  .responsive-mobile { display: none !important; }
@@ -327,7 +334,7 @@ function renderToStaticMarkup(document, { rootBlockId }) {
327
334
  .responsive-mobile { display: block !important; }
328
335
  .responsive-desktop { display: none !important; }
329
336
  }
330
- ${((_a = document[rootBlockId].props) == null ? void 0 : _a.underline) !== true ? "a { text-decoration: none; }" : ""}
337
+ ${rootElement.underline !== true ? "a { text-decoration: none; }" : ""}
331
338
  `)), /* @__PURE__ */ import_react5.default.createElement("body", null, /* @__PURE__ */ import_react5.default.createElement(Reader, { document, rootBlockId })))
332
339
  );
333
340
  }
package/dist/index.mjs CHANGED
@@ -284,8 +284,15 @@ function Reader({ document, rootBlockId }) {
284
284
  }
285
285
 
286
286
  // 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
+ }
287
294
  function renderToStaticMarkup(document, { rootBlockId }) {
288
- var _a;
295
+ const rootElement = parseRootElement(document["root"]);
289
296
  return "<!DOCTYPE html>" + baseRenderToStaticMarkup(
290
297
  /* @__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
298
  .responsive-mobile { display: none !important; }
@@ -294,7 +301,7 @@ function renderToStaticMarkup(document, { rootBlockId }) {
294
301
  .responsive-mobile { display: block !important; }
295
302
  .responsive-desktop { display: none !important; }
296
303
  }
297
- ${((_a = document[rootBlockId].props) == null ? void 0 : _a.underline) !== true ? "a { text-decoration: none; }" : ""}
304
+ ${rootElement.underline !== true ? "a { text-decoration: none; }" : ""}
298
305
  `)), /* @__PURE__ */ React5.createElement("body", null, /* @__PURE__ */ React5.createElement(Reader, { document, rootBlockId })))
299
306
  );
300
307
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rudyzeinoun/email-builder",
3
- "version": "0.0.34",
3
+ "version": "0.0.35",
4
4
  "description": "React component to render email messages",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",