@rudyzeinoun/email-builder 0.0.23 → 0.0.26

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
@@ -91,6 +91,7 @@ var BasePropsShape = import_block_columns_container.ColumnsContainerPropsSchema.
91
91
  var ColumnsContainerPropsSchema = import_zod.z.object({
92
92
  style: import_block_columns_container.ColumnsContainerPropsSchema.shape.style,
93
93
  className: import_zod.z.string().optional().nullable(),
94
+ responsiveDisplay: import_zod.z.string().optional().nullable(),
94
95
  loopStart: import_zod.z.number().optional().nullable(),
95
96
  loopEnd: import_zod.z.number().optional().nullable(),
96
97
  props: import_zod.z.object(__spreadProps(__spreadValues({}, BasePropsShape), {
@@ -106,13 +107,13 @@ var ColumnsContainerPropsSchema_default = ColumnsContainerPropsSchema;
106
107
  // src/blocks/ColumnsContainer/ColumnsContainerReader.tsx
107
108
  var import_react = __toESM(require("react"));
108
109
  var import_block_columns_container2 = require("@rudyzeinoun/block-columns-container");
109
- function ColumnsContainerReader({ style, props, className, loopStart, loopEnd }) {
110
+ function ColumnsContainerReader({ style, props, className, loopStart, loopEnd, responsiveDisplay }) {
110
111
  const _a = props != null ? props : {}, { columns } = _a, restProps = __objRest(_a, ["columns"]);
111
112
  let cols = void 0;
112
113
  if (columns) {
113
114
  cols = columns.map((col) => col.childrenIds.map((childId) => /* @__PURE__ */ import_react.default.createElement(ReaderBlock, { key: childId, id: childId })));
114
115
  }
115
- return /* @__PURE__ */ import_react.default.createElement(import_block_columns_container2.ColumnsContainer, { props: restProps, columns: cols, style, className, loopStart, loopEnd });
116
+ return /* @__PURE__ */ import_react.default.createElement(import_block_columns_container2.ColumnsContainer, { props: restProps, columns: cols, style, className, loopStart, loopEnd, responsiveDisplay });
116
117
  }
117
118
 
118
119
  // src/blocks/Container/ContainerPropsSchema.tsx
@@ -121,6 +122,7 @@ var import_block_container = require("@rudyzeinoun/block-container");
121
122
  var ContainerPropsSchema = import_zod2.z.object({
122
123
  style: import_block_container.ContainerPropsSchema.shape.style,
123
124
  className: import_zod2.z.string().optional().nullable(),
125
+ responsiveDisplay: import_zod2.z.string().optional().nullable(),
124
126
  loopStart: import_zod2.z.number().optional().nullable(),
125
127
  loopEnd: import_zod2.z.number().optional().nullable(),
126
128
  props: import_zod2.z.object({
@@ -131,10 +133,10 @@ var ContainerPropsSchema = import_zod2.z.object({
131
133
  // src/blocks/Container/ContainerReader.tsx
132
134
  var import_react2 = __toESM(require("react"));
133
135
  var import_block_container2 = require("@rudyzeinoun/block-container");
134
- function ContainerReader({ style, props, className, loopStart, loopEnd }) {
136
+ function ContainerReader({ style, props, className, loopStart, loopEnd, responsiveDisplay }) {
135
137
  var _a;
136
138
  const childrenIds = (_a = props == null ? void 0 : props.childrenIds) != null ? _a : [];
137
- return /* @__PURE__ */ import_react2.default.createElement(import_block_container2.Container, { className, loopStart, loopEnd, style }, childrenIds.map((childId) => /* @__PURE__ */ import_react2.default.createElement(ReaderBlock, { key: childId, id: childId })));
139
+ return /* @__PURE__ */ import_react2.default.createElement(import_block_container2.Container, { className, loopStart, loopEnd, style, responsiveDisplay }, childrenIds.map((childId) => /* @__PURE__ */ import_react2.default.createElement(ReaderBlock, { key: childId, id: childId })));
138
140
  }
139
141
 
140
142
  // src/blocks/EmailLayout/EmailLayoutPropsSchema.tsx
@@ -314,7 +316,14 @@ function Reader({ document, rootBlockId }) {
314
316
  // src/renderers/renderToStaticMarkup.tsx
315
317
  function renderToStaticMarkup(document, { rootBlockId }) {
316
318
  return "<!DOCTYPE html>" + (0, import_server.renderToStaticMarkup)(
317
- /* @__PURE__ */ import_react5.default.createElement("html", null, /* @__PURE__ */ import_react5.default.createElement("body", null, /* @__PURE__ */ import_react5.default.createElement(Reader, { document, rootBlockId })))
319
+ /* @__PURE__ */ import_react5.default.createElement("html", null, /* @__PURE__ */ import_react5.default.createElement("head", null, /* @__PURE__ */ import_react5.default.createElement("style", { type: "text/css" }, `
320
+ .responsive-mobile { display: none !important; }
321
+ .responsive-desktop { display: block !important; }
322
+ @media (max-width: 370px) {
323
+ .responsive-mobile { display: block !important; }
324
+ .responsive-desktop { display: none !important; }
325
+ }
326
+ `)), /* @__PURE__ */ import_react5.default.createElement("body", null, /* @__PURE__ */ import_react5.default.createElement(Reader, { document, rootBlockId })))
318
327
  );
319
328
  }
320
329
  // Annotate the CommonJS export names for ESM import in node:
package/dist/index.mjs CHANGED
@@ -58,6 +58,7 @@ var BasePropsShape = BaseColumnsContainerPropsSchema.shape.props.unwrap().unwrap
58
58
  var ColumnsContainerPropsSchema = z.object({
59
59
  style: BaseColumnsContainerPropsSchema.shape.style,
60
60
  className: z.string().optional().nullable(),
61
+ responsiveDisplay: z.string().optional().nullable(),
61
62
  loopStart: z.number().optional().nullable(),
62
63
  loopEnd: z.number().optional().nullable(),
63
64
  props: z.object(__spreadProps(__spreadValues({}, BasePropsShape), {
@@ -73,13 +74,13 @@ var ColumnsContainerPropsSchema_default = ColumnsContainerPropsSchema;
73
74
  // src/blocks/ColumnsContainer/ColumnsContainerReader.tsx
74
75
  import React from "react";
75
76
  import { ColumnsContainer as BaseColumnsContainer } from "@rudyzeinoun/block-columns-container";
76
- function ColumnsContainerReader({ style, props, className, loopStart, loopEnd }) {
77
+ function ColumnsContainerReader({ style, props, className, loopStart, loopEnd, responsiveDisplay }) {
77
78
  const _a = props != null ? props : {}, { columns } = _a, restProps = __objRest(_a, ["columns"]);
78
79
  let cols = void 0;
79
80
  if (columns) {
80
81
  cols = columns.map((col) => col.childrenIds.map((childId) => /* @__PURE__ */ React.createElement(ReaderBlock, { key: childId, id: childId })));
81
82
  }
82
- return /* @__PURE__ */ React.createElement(BaseColumnsContainer, { props: restProps, columns: cols, style, className, loopStart, loopEnd });
83
+ return /* @__PURE__ */ React.createElement(BaseColumnsContainer, { props: restProps, columns: cols, style, className, loopStart, loopEnd, responsiveDisplay });
83
84
  }
84
85
 
85
86
  // src/blocks/Container/ContainerPropsSchema.tsx
@@ -88,6 +89,7 @@ import { ContainerPropsSchema as BaseContainerPropsSchema } from "@rudyzeinoun/b
88
89
  var ContainerPropsSchema = z2.object({
89
90
  style: BaseContainerPropsSchema.shape.style,
90
91
  className: z2.string().optional().nullable(),
92
+ responsiveDisplay: z2.string().optional().nullable(),
91
93
  loopStart: z2.number().optional().nullable(),
92
94
  loopEnd: z2.number().optional().nullable(),
93
95
  props: z2.object({
@@ -98,10 +100,10 @@ var ContainerPropsSchema = z2.object({
98
100
  // src/blocks/Container/ContainerReader.tsx
99
101
  import React2 from "react";
100
102
  import { Container as BaseContainer } from "@rudyzeinoun/block-container";
101
- function ContainerReader({ style, props, className, loopStart, loopEnd }) {
103
+ function ContainerReader({ style, props, className, loopStart, loopEnd, responsiveDisplay }) {
102
104
  var _a;
103
105
  const childrenIds = (_a = props == null ? void 0 : props.childrenIds) != null ? _a : [];
104
- return /* @__PURE__ */ React2.createElement(BaseContainer, { className, loopStart, loopEnd, style }, childrenIds.map((childId) => /* @__PURE__ */ React2.createElement(ReaderBlock, { key: childId, id: childId })));
106
+ return /* @__PURE__ */ React2.createElement(BaseContainer, { className, loopStart, loopEnd, style, responsiveDisplay }, childrenIds.map((childId) => /* @__PURE__ */ React2.createElement(ReaderBlock, { key: childId, id: childId })));
105
107
  }
106
108
 
107
109
  // src/blocks/EmailLayout/EmailLayoutPropsSchema.tsx
@@ -281,7 +283,14 @@ function Reader({ document, rootBlockId }) {
281
283
  // src/renderers/renderToStaticMarkup.tsx
282
284
  function renderToStaticMarkup(document, { rootBlockId }) {
283
285
  return "<!DOCTYPE html>" + baseRenderToStaticMarkup(
284
- /* @__PURE__ */ React5.createElement("html", null, /* @__PURE__ */ React5.createElement("body", null, /* @__PURE__ */ React5.createElement(Reader, { document, rootBlockId })))
286
+ /* @__PURE__ */ React5.createElement("html", null, /* @__PURE__ */ React5.createElement("head", null, /* @__PURE__ */ React5.createElement("style", { type: "text/css" }, `
287
+ .responsive-mobile { display: none !important; }
288
+ .responsive-desktop { display: block !important; }
289
+ @media (max-width: 370px) {
290
+ .responsive-mobile { display: block !important; }
291
+ .responsive-desktop { display: none !important; }
292
+ }
293
+ `)), /* @__PURE__ */ React5.createElement("body", null, /* @__PURE__ */ React5.createElement(Reader, { document, rootBlockId })))
285
294
  );
286
295
  }
287
296
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rudyzeinoun/email-builder",
3
- "version": "0.0.23",
3
+ "version": "0.0.26",
4
4
  "description": "React component to render email messages",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -16,7 +16,8 @@
16
16
  "dist"
17
17
  ],
18
18
  "scripts": {
19
- "build": "npx tsup src/index.ts --format esm,cjs --dts --out-dir dist"
19
+ "build": "npx tsup src/index.ts --format esm,cjs --dts --out-dir dist",
20
+ "publish": "npm publish --access public"
20
21
  },
21
22
  "author": "carlos@usewaypoint.com",
22
23
  "license": "MIT",
@@ -26,10 +27,10 @@
26
27
  "zod": "^1 || ^2 || ^3"
27
28
  },
28
29
  "dependencies": {
29
- "@rudyzeinoun/block-container": "^0.0.8",
30
+ "@rudyzeinoun/block-container": "^0.0.9",
30
31
  "@usewaypoint/block-avatar": "^0.0.3",
31
32
  "@rudyzeinoun/block-button": "^0.0.5",
32
- "@rudyzeinoun/block-columns-container": "^0.0.6",
33
+ "@rudyzeinoun/block-columns-container": "^0.0.7",
33
34
  "@usewaypoint/block-divider": "^0.0.4",
34
35
  "@rudyzeinoun/block-heading": "^0.0.5",
35
36
  "@rudyzeinoun/block-html": "^0.0.5",