@rudyzeinoun/email-builder 0.0.21 → 0.0.23

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
@@ -160,7 +160,8 @@ var EmailLayoutPropsSchema = import_zod3.z.object({
160
160
  canvasColor: COLOR_SCHEMA,
161
161
  textColor: COLOR_SCHEMA,
162
162
  fontFamily: FONT_FAMILY_SCHEMA,
163
- childrenIds: import_zod3.z.array(import_zod3.z.string()).optional().nullable()
163
+ childrenIds: import_zod3.z.array(import_zod3.z.string()).optional().nullable(),
164
+ previewText: import_zod3.z.string().optional().nullable()
164
165
  });
165
166
 
166
167
  // src/blocks/EmailLayout/EmailLayoutReader.tsx
@@ -171,7 +172,7 @@ function getFontFamily(fontFamily) {
171
172
  case "HELVETICA":
172
173
  return "Helvetica, Arial, sans-serif";
173
174
  case "GEORGIA":
174
- return '"Georgia, "Times New Roman", Times, serif';
175
+ return 'Georgia, "Times New Roman", Times, serif';
175
176
  case "MODERN_SANS":
176
177
  return '"Helvetica Neue", "Arial Nova", "Nimbus Sans", Arial, sans-serif';
177
178
  case "BOOK_SANS":
@@ -201,7 +202,14 @@ function getBorder({ borderColor }) {
201
202
  function EmailLayoutReader(props) {
202
203
  var _a, _b, _c, _d, _e;
203
204
  const childrenIds = (_a = props.childrenIds) != null ? _a : [];
204
- return /* @__PURE__ */ import_react3.default.createElement(
205
+ return /* @__PURE__ */ import_react3.default.createElement(import_react3.Fragment, null, props.previewText && /* @__PURE__ */ import_react3.default.createElement(
206
+ "div",
207
+ {
208
+ style: { display: "none", maxHeight: "0px", overflow: "hidden" }
209
+ },
210
+ props.previewText,
211
+ "\xA0\u200C\xA0\u200C\xA0\u200C\xA0"
212
+ ), /* @__PURE__ */ import_react3.default.createElement(
205
213
  "div",
206
214
  {
207
215
  style: {
@@ -237,7 +245,7 @@ function EmailLayoutReader(props) {
237
245
  },
238
246
  /* @__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
247
  )
240
- );
248
+ ));
241
249
  }
242
250
 
243
251
  // src/Reader/core.tsx
package/dist/index.mjs CHANGED
@@ -127,18 +127,19 @@ var EmailLayoutPropsSchema = z3.object({
127
127
  canvasColor: COLOR_SCHEMA,
128
128
  textColor: COLOR_SCHEMA,
129
129
  fontFamily: FONT_FAMILY_SCHEMA,
130
- childrenIds: z3.array(z3.string()).optional().nullable()
130
+ childrenIds: z3.array(z3.string()).optional().nullable(),
131
+ previewText: z3.string().optional().nullable()
131
132
  });
132
133
 
133
134
  // src/blocks/EmailLayout/EmailLayoutReader.tsx
134
- import React3 from "react";
135
+ import React3, { Fragment } from "react";
135
136
  function getFontFamily(fontFamily) {
136
137
  const f = fontFamily != null ? fontFamily : "MODERN_SANS";
137
138
  switch (f) {
138
139
  case "HELVETICA":
139
140
  return "Helvetica, Arial, sans-serif";
140
141
  case "GEORGIA":
141
- return '"Georgia, "Times New Roman", Times, serif';
142
+ return 'Georgia, "Times New Roman", Times, serif';
142
143
  case "MODERN_SANS":
143
144
  return '"Helvetica Neue", "Arial Nova", "Nimbus Sans", Arial, sans-serif';
144
145
  case "BOOK_SANS":
@@ -168,7 +169,14 @@ function getBorder({ borderColor }) {
168
169
  function EmailLayoutReader(props) {
169
170
  var _a, _b, _c, _d, _e;
170
171
  const childrenIds = (_a = props.childrenIds) != null ? _a : [];
171
- return /* @__PURE__ */ React3.createElement(
172
+ return /* @__PURE__ */ React3.createElement(Fragment, null, props.previewText && /* @__PURE__ */ React3.createElement(
173
+ "div",
174
+ {
175
+ style: { display: "none", maxHeight: "0px", overflow: "hidden" }
176
+ },
177
+ props.previewText,
178
+ "\xA0\u200C\xA0\u200C\xA0\u200C\xA0"
179
+ ), /* @__PURE__ */ React3.createElement(
172
180
  "div",
173
181
  {
174
182
  style: {
@@ -204,7 +212,7 @@ function EmailLayoutReader(props) {
204
212
  },
205
213
  /* @__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
214
  )
207
- );
215
+ ));
208
216
  }
209
217
 
210
218
  // src/Reader/core.tsx
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rudyzeinoun/email-builder",
3
- "version": "0.0.21",
3
+ "version": "0.0.23",
4
4
  "description": "React component to render email messages",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -28,14 +28,14 @@
28
28
  "dependencies": {
29
29
  "@rudyzeinoun/block-container": "^0.0.8",
30
30
  "@usewaypoint/block-avatar": "^0.0.3",
31
- "@rudyzeinoun/block-button": "^0.0.4",
31
+ "@rudyzeinoun/block-button": "^0.0.5",
32
32
  "@rudyzeinoun/block-columns-container": "^0.0.6",
33
33
  "@usewaypoint/block-divider": "^0.0.4",
34
- "@rudyzeinoun/block-heading": "^0.0.4",
35
- "@rudyzeinoun/block-html": "^0.0.4",
34
+ "@rudyzeinoun/block-heading": "^0.0.5",
35
+ "@rudyzeinoun/block-html": "^0.0.5",
36
36
  "@usewaypoint/block-image": "^0.0.5",
37
37
  "@usewaypoint/block-spacer": "^0.0.3",
38
- "@rudyzeinoun/block-text": "^0.0.7",
38
+ "@rudyzeinoun/block-text": "^0.0.8",
39
39
  "@usewaypoint/document-core": "^0.0.6"
40
40
  },
41
41
  "devDependencies": {