@travetto/email-inky 3.3.3 → 3.3.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/email-inky",
3
- "version": "3.3.3",
3
+ "version": "3.3.4",
4
4
  "description": "Email Inky templating module",
5
5
  "keywords": [
6
6
  "email",
@@ -27,17 +27,17 @@
27
27
  "directory": "module/email-inky"
28
28
  },
29
29
  "dependencies": {
30
- "@travetto/base": "^3.3.2",
31
- "@travetto/config": "^3.3.2",
32
- "@travetto/di": "^3.3.2",
33
- "@travetto/email": "^3.3.2",
30
+ "@travetto/base": "^3.3.3",
31
+ "@travetto/config": "^3.3.3",
32
+ "@travetto/di": "^3.3.3",
33
+ "@travetto/email": "^3.3.3",
34
34
  "foundation-emails": "^2.4.0"
35
35
  },
36
36
  "devDependencies": {
37
- "@travetto/email-compiler": "^3.3.4"
37
+ "@travetto/email-compiler": "^3.3.5"
38
38
  },
39
39
  "peerDependencies": {
40
- "@travetto/cli": "^3.3.3"
40
+ "@travetto/cli": "^3.3.4"
41
41
  },
42
42
  "peerDependenciesMeta": {
43
43
  "@travetto/cli": {
@@ -42,7 +42,7 @@ export const classStr = (existing: string | undefined, ...toAdd: string[]): stri
42
42
  return out.join(' ');
43
43
  };
44
44
 
45
- export const combinePropsToStr = (allowedProps: Set<string>, props: Record<string, unknown>, ...addClasses: string[]): string => {
45
+ export const combinePropsToStr = (allowedProps: Set<string>, props: Record<string, unknown>, addClasses: string[] = []): string => {
46
46
  // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
47
47
  const out = { ...props, className: classStr(props.className as string, ...addClasses) };
48
48
  return Object.entries(out)
@@ -132,7 +132,7 @@ export const Html: RenderProvider<RenderContext> = {
132
132
 
133
133
  // Final HTML output
134
134
  return `
135
- <th ${propsToStr(el.props, ...classes)}>
135
+ <th ${propsToStr(el.props, classes)}>
136
136
  <table>
137
137
  <tbody>
138
138
  <tr>
@@ -144,14 +144,14 @@ export const Html: RenderProvider<RenderContext> = {
144
144
  },
145
145
 
146
146
  HLine: async ({ props }) => `
147
- <table ${propsToStr(props, 'h-line')}>
147
+ <table ${propsToStr(props, ['h-line'])}>
148
148
  <tbody>
149
149
  <tr><th>&nbsp;</th></tr>
150
150
  </tbody>
151
151
  </table>`,
152
152
 
153
153
  Row: async ({ recurse, el }): Promise<string> => `
154
- <table ${propsToStr(el.props, 'row')}>
154
+ <table ${propsToStr(el.props, ['row'])}>
155
155
  <tbody>
156
156
  <tr>${await recurse()}</tr>
157
157
  </tbody>
@@ -180,7 +180,7 @@ export const Html: RenderProvider<RenderContext> = {
180
180
 
181
181
  // The .button class is always there, along with any others on the <button> element
182
182
  return `
183
- <table ${propsToStr(rest, 'button')}>
183
+ <table ${propsToStr(rest, ['button'])}>
184
184
  <tbody>
185
185
  <tr>
186
186
  <td>
@@ -201,14 +201,14 @@ export const Html: RenderProvider<RenderContext> = {
201
201
  },
202
202
 
203
203
  Container: async ({ recurse, props }): Promise<string> => `
204
- <table align="center" ${propsToStr(props, 'container')}>
204
+ <table align="center" ${propsToStr(props, ['container'])}>
205
205
  <tbody>
206
206
  <tr><td>${await recurse()}</td></tr>
207
207
  </tbody>
208
208
  </table>`,
209
209
 
210
210
  BlockGrid: async ({ recurse, props }): Promise<string> => `
211
- <table ${propsToStr(props, 'block-grid', props.up ? `up-${props.up}` : '')}>
211
+ <table ${propsToStr(props, ['block-grid', props.up ? `up-${props.up}` : ''])}>
212
212
  <tbody>
213
213
  <tr>${await recurse()}</tr>
214
214
  </tbody>
@@ -231,7 +231,7 @@ export const Html: RenderProvider<RenderContext> = {
231
231
  }
232
232
 
233
233
  return `
234
- <table ${propsToStr(props, 'menu')}>
234
+ <table ${propsToStr(props, ['menu'])}>
235
235
  <tbody>
236
236
  <tr>
237
237
  <td>
@@ -251,7 +251,7 @@ export const Html: RenderProvider<RenderContext> = {
251
251
  Item: async ({ recurse, props }): Promise<string> => {
252
252
  const { href, target, ...parentAttrs } = props;
253
253
  return `
254
- <th ${propsToStr(parentAttrs, 'menu-item')}>
254
+ <th ${propsToStr(parentAttrs, ['menu-item'])}>
255
255
  <a ${propsToStr({ href, target })}>${await recurse()}</a>
256
256
  </th>`;
257
257
  },
@@ -284,10 +284,10 @@ export const Html: RenderProvider<RenderContext> = {
284
284
  delete props.className;
285
285
 
286
286
  return `
287
- <table ${propsToStr(props, 'callout')}>
287
+ <table ${propsToStr(props, ['callout'])}>
288
288
  <tbody>
289
289
  <tr>
290
- <th ${propsToStr(innerProps, 'callout-inner')}>
290
+ <th ${propsToStr(innerProps, ['callout-inner'])}>
291
291
  ${await recurse()}
292
292
  </th>
293
293
  <th class="expander"></th>
@@ -300,7 +300,7 @@ export const Html: RenderProvider<RenderContext> = {
300
300
  const html: string[] = [];
301
301
  const buildSpacer = (size: number | string, extraClass: string = ''): string =>
302
302
  `
303
- <table ${propsToStr(props, 'spacer', extraClass)}>
303
+ <table ${propsToStr(props, ['spacer', extraClass])}>
304
304
  <tbody>
305
305
  <tr>
306
306
  <td height="${size}px" style="font-size:${size}px;line-height:${size}px;">&nbsp;</td>
@@ -327,7 +327,7 @@ export const Html: RenderProvider<RenderContext> = {
327
327
  },
328
328
 
329
329
  Wrapper: async ({ recurse, el }) => `
330
- <table align="center" ${propsToStr(el.props, 'wrapper')}>
330
+ <table align="center" ${propsToStr(el.props, ['wrapper'])}>
331
331
  <tbody>
332
332
  <tr>
333
333
  <td class="wrapper-inner">