@seafile/sea-email-editor 0.0.3 → 0.0.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.
@@ -31,11 +31,15 @@ const translateElement = (value, element, path) => {
31
31
  ...(style || {})
32
32
  };
33
33
  if (element.type === _constants.ElementTypes.TABLE_CELL) {
34
- const tablePath = path.slice(0, -2);
35
- const tableElement = findElementByPath(value, tablePath);
36
- const tdIndex = path.at(-1);
37
- const align = tableElement.align[tdIndex] || 'left';
38
- customizeStyle['textAlign'] = align;
34
+ try {
35
+ const tablePath = path.slice(0, -2);
36
+ const tableElement = findElementByPath(value, tablePath);
37
+ const tdIndex = path.at(-1);
38
+ const align = tableElement.align[tdIndex] || 'left';
39
+ customizeStyle['textAlign'] = align;
40
+ } catch {
41
+ //
42
+ }
39
43
  }
40
44
  let styleString = Object.keys(customizeStyle).map(styleKey => `${styleKey.split(/(?=[A-Z])/).join('-').toLowerCase()}: ${customizeStyle[styleKey]};`).join('');
41
45
  styleString = styleString ? ` style="${styleString}"` : '';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/sea-email-editor",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "dependencies": {