@blocknote/xl-odt-exporter 0.42.0 → 0.42.2

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.
@@ -1 +1 @@
1
- {"builtAt":1762873671993,"assets":[{"name":"blocknote-xl-odt-exporter.umd.cjs","size":700486},{"name":"blocknote-xl-odt-exporter.umd.cjs.map","size":752450}],"chunks":[{"id":"642be88","entry":true,"initial":true,"files":["blocknote-xl-odt-exporter.umd.cjs"],"names":["index"]}],"modules":[{"name":"./src/odt/defaultSchema/blocks.tsx","size":16712,"chunks":["642be88"]},{"name":"./src/odt/defaultSchema/inlineContent.tsx","size":533,"chunks":["642be88"]},{"name":"./src/odt/defaultSchema/styles.ts","size":963,"chunks":["642be88"]},{"name":"./src/odt/defaultSchema/index.ts","size":199,"chunks":["642be88"]},{"name":"../../shared/util/fileUtil.ts","size":214,"chunks":["642be88"]},{"name":"../../shared/util/imageUtil.ts","size":592,"chunks":["642be88"]},{"name":"./src/odt/template/styles.xml?raw","size":76781,"chunks":["642be88"]},{"name":"./src/odt/odtExporter.tsx","size":10335,"chunks":["642be88"]},{"name":"./src/index.ts","size":0,"chunks":["642be88"]},{"name":"../../shared/assets/fonts/inter/Inter_18pt-Regular.ttf","size":456958,"chunks":["642be88"]},{"name":"../../shared/assets/fonts/GeistMono-Regular.ttf","size":155049,"chunks":["642be88"]}]}
1
+ {"builtAt":1763552660187,"assets":[{"name":"blocknote-xl-odt-exporter.umd.cjs","size":700741},{"name":"blocknote-xl-odt-exporter.umd.cjs.map","size":752538}],"chunks":[{"id":"642be88","entry":true,"initial":true,"files":["blocknote-xl-odt-exporter.umd.cjs"],"names":["index"]}],"modules":[{"name":"./src/odt/defaultSchema/blocks.tsx","size":16737,"chunks":["642be88"]},{"name":"./src/odt/defaultSchema/inlineContent.tsx","size":533,"chunks":["642be88"]},{"name":"./src/odt/defaultSchema/styles.ts","size":1047,"chunks":["642be88"]},{"name":"./src/odt/defaultSchema/index.ts","size":199,"chunks":["642be88"]},{"name":"../../shared/util/fileUtil.ts","size":214,"chunks":["642be88"]},{"name":"../../shared/util/imageUtil.ts","size":592,"chunks":["642be88"]},{"name":"./src/odt/template/styles.xml?raw","size":76781,"chunks":["642be88"]},{"name":"./src/odt/odtExporter.tsx","size":10335,"chunks":["642be88"]},{"name":"./src/index.ts","size":0,"chunks":["642be88"]},{"name":"../../shared/assets/fonts/inter/Inter_18pt-Regular.ttf","size":456958,"chunks":["642be88"]},{"name":"../../shared/assets/fonts/GeistMono-Regular.ttf","size":155049,"chunks":["642be88"]}]}
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "directory": "packages/xl-odt-exporter"
10
10
  },
11
11
  "license": "GPL-3.0 OR PROPRIETARY",
12
- "version": "0.42.0",
12
+ "version": "0.42.2",
13
13
  "files": [
14
14
  "dist",
15
15
  "types",
@@ -49,8 +49,8 @@
49
49
  }
50
50
  },
51
51
  "dependencies": {
52
- "@blocknote/core": "0.42.0",
53
- "@blocknote/xl-multi-column": "0.42.0",
52
+ "@blocknote/core": "0.42.2",
53
+ "@blocknote/xl-multi-column": "0.42.2",
54
54
  "@zip.js/zip.js": "^2.8.8",
55
55
  "buffer": "^6.0.3",
56
56
  "image-meta": "^0.2.2"
@@ -41,9 +41,7 @@ const createParagraphStyle = (
41
41
 
42
42
  const backgroundColor =
43
43
  props.backgroundColor && props.backgroundColor !== "default"
44
- ? exporter.options.colors[
45
- props.backgroundColor as keyof typeof exporter.options.colors
46
- ].background
44
+ ? exporter.options.colors[props.backgroundColor]?.background
47
45
  : undefined;
48
46
 
49
47
  if (backgroundColor) {
@@ -54,7 +52,7 @@ const createParagraphStyle = (
54
52
  const color =
55
53
  exporter.options.colors[
56
54
  props.textColor as keyof typeof exporter.options.colors
57
- ].text;
55
+ ]?.text ?? props.textColor;
58
56
  textStyles["fo:color"] = color;
59
57
  }
60
58
 
@@ -115,18 +113,14 @@ const createTableCellStyle = (
115
113
  fo:background-color={
116
114
  cell.props.backgroundColor !== "default" &&
117
115
  cell.props.backgroundColor
118
- ? exporter.options.colors[
119
- cell.props
120
- .backgroundColor as keyof typeof exporter.options.colors
121
- ].background
116
+ ? exporter.options.colors?.[cell.props.backgroundColor]
117
+ ?.background
122
118
  : undefined
123
119
  }
124
120
  // TODO This is not applying because the children set their own colors
125
121
  fo:color={
126
122
  cell.props.textColor !== "default" && cell.props.textColor
127
- ? exporter.options.colors[
128
- cell.props.textColor as keyof typeof exporter.options.colors
129
- ].text
123
+ ? exporter.options.colors[cell.props.textColor]?.text
130
124
  : undefined
131
125
  }
132
126
  />
@@ -35,8 +35,10 @@ export const odtStyleMappingForDefaultSchema: StyleMapping<
35
35
  if (!val) {
36
36
  return {};
37
37
  }
38
- const color =
39
- exporter.options.colors[val as keyof typeof exporter.options.colors].text;
38
+ const color = exporter.options.colors[val]?.text;
39
+ if (!color) {
40
+ return {};
41
+ }
40
42
  return { "fo:color": color };
41
43
  },
42
44
 
@@ -44,9 +46,10 @@ export const odtStyleMappingForDefaultSchema: StyleMapping<
44
46
  if (!val) {
45
47
  return {};
46
48
  }
47
- const color =
48
- exporter.options.colors[val as keyof typeof exporter.options.colors]
49
- .background;
49
+ const color = exporter.options.colors[val]?.background;
50
+ if (!color) {
51
+ return {};
52
+ }
50
53
  return { "fo:background-color": color };
51
54
  },
52
55