@rudyzeinoun/email-builder 0.0.22 → 0.0.25

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
@@ -160,7 +162,8 @@ var EmailLayoutPropsSchema = import_zod3.z.object({
160
162
  canvasColor: COLOR_SCHEMA,
161
163
  textColor: COLOR_SCHEMA,
162
164
  fontFamily: FONT_FAMILY_SCHEMA,
163
- childrenIds: import_zod3.z.array(import_zod3.z.string()).optional().nullable()
165
+ childrenIds: import_zod3.z.array(import_zod3.z.string()).optional().nullable(),
166
+ previewText: import_zod3.z.string().optional().nullable()
164
167
  });
165
168
 
166
169
  // src/blocks/EmailLayout/EmailLayoutReader.tsx
@@ -201,7 +204,14 @@ function getBorder({ borderColor }) {
201
204
  function EmailLayoutReader(props) {
202
205
  var _a, _b, _c, _d, _e;
203
206
  const childrenIds = (_a = props.childrenIds) != null ? _a : [];
204
- return /* @__PURE__ */ import_react3.default.createElement(
207
+ return /* @__PURE__ */ import_react3.default.createElement(import_react3.Fragment, null, props.previewText && /* @__PURE__ */ import_react3.default.createElement(
208
+ "div",
209
+ {
210
+ style: { display: "none", maxHeight: "0px", overflow: "hidden" }
211
+ },
212
+ props.previewText,
213
+ "\xA0\u200C\xA0\u200C\xA0\u200C\xA0"
214
+ ), /* @__PURE__ */ import_react3.default.createElement(
205
215
  "div",
206
216
  {
207
217
  style: {
@@ -237,7 +247,7 @@ function EmailLayoutReader(props) {
237
247
  },
238
248
  /* @__PURE__ */ import_react3.default.createElement("tbody", null, /* @__PURE__ */ import_react3.default.createElement("tr", { style: { width: "100%" } }, /* @__PURE__ */ import_react3.default.createElement("td", null, childrenIds.map((childId) => /* @__PURE__ */ import_react3.default.createElement(ReaderBlock, { key: childId, id: childId })))))
239
249
  )
240
- );
250
+ ));
241
251
  }
242
252
 
243
253
  // src/Reader/core.tsx
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
@@ -127,11 +129,12 @@ var EmailLayoutPropsSchema = z3.object({
127
129
  canvasColor: COLOR_SCHEMA,
128
130
  textColor: COLOR_SCHEMA,
129
131
  fontFamily: FONT_FAMILY_SCHEMA,
130
- childrenIds: z3.array(z3.string()).optional().nullable()
132
+ childrenIds: z3.array(z3.string()).optional().nullable(),
133
+ previewText: z3.string().optional().nullable()
131
134
  });
132
135
 
133
136
  // src/blocks/EmailLayout/EmailLayoutReader.tsx
134
- import React3 from "react";
137
+ import React3, { Fragment } from "react";
135
138
  function getFontFamily(fontFamily) {
136
139
  const f = fontFamily != null ? fontFamily : "MODERN_SANS";
137
140
  switch (f) {
@@ -168,7 +171,14 @@ function getBorder({ borderColor }) {
168
171
  function EmailLayoutReader(props) {
169
172
  var _a, _b, _c, _d, _e;
170
173
  const childrenIds = (_a = props.childrenIds) != null ? _a : [];
171
- return /* @__PURE__ */ React3.createElement(
174
+ return /* @__PURE__ */ React3.createElement(Fragment, null, props.previewText && /* @__PURE__ */ React3.createElement(
175
+ "div",
176
+ {
177
+ style: { display: "none", maxHeight: "0px", overflow: "hidden" }
178
+ },
179
+ props.previewText,
180
+ "\xA0\u200C\xA0\u200C\xA0\u200C\xA0"
181
+ ), /* @__PURE__ */ React3.createElement(
172
182
  "div",
173
183
  {
174
184
  style: {
@@ -204,7 +214,7 @@ function EmailLayoutReader(props) {
204
214
  },
205
215
  /* @__PURE__ */ React3.createElement("tbody", null, /* @__PURE__ */ React3.createElement("tr", { style: { width: "100%" } }, /* @__PURE__ */ React3.createElement("td", null, childrenIds.map((childId) => /* @__PURE__ */ React3.createElement(ReaderBlock, { key: childId, id: childId })))))
206
216
  )
207
- );
217
+ ));
208
218
  }
209
219
 
210
220
  // src/Reader/core.tsx
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rudyzeinoun/email-builder",
3
- "version": "0.0.22",
3
+ "version": "0.0.25",
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",