Skip to content

Commit 32b2c1a

Browse files
committed
address feedback
1 parent a035241 commit 32b2c1a

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

packages/xl-odt-exporter/src/odt/odtExporter.tsx

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ import {
99
StyleSchema,
1010
StyledText,
1111
} from "@blocknote/core";
12-
import { BlobWriter, TextReader, ZipWriter, BlobReader } from "@zip.js/zip.js";
13-
import { renderToString } from "react-dom/server";
14-
import stylesXml from "./template/styles.xml?raw";
1512
import { loadFileBuffer } from "@shared/util/fileUtil.js";
13+
import { BlobReader, BlobWriter, TextReader, ZipWriter } from "@zip.js/zip.js";
14+
import { renderToString } from "react-dom/server";
1615
import { getImageDimensions } from "./imageUtil.js";
16+
import stylesXml from "./template/styles.xml?raw";
1717

1818
export class ODTExporter<
1919
B extends BlockSchema,
@@ -28,16 +28,22 @@ export class ODTExporter<
2828
Record<string, string>,
2929
React.ReactNode
3030
> {
31+
// "Styles" to be added to the AutomaticStyles section of the ODT file
32+
// Keyed by the style name
3133
private automaticStyles: Map<string, React.ReactNode> = new Map();
32-
private pictures: Map<
34+
35+
// "Pictures" to be added to the Pictures folder in the ODT file
36+
// Keyed by the original image URL
37+
private pictures = new Map<
3338
string,
3439
{
3540
file: Blob;
3641
fileName: string;
3742
height: number;
3843
width: number;
3944
}
40-
> = new Map();
45+
>();
46+
4147
private styleCounter = 0;
4248

4349
public readonly options: ExporterOptions;
@@ -304,6 +310,7 @@ export class ODTExporter<
304310
this.automaticStyles.set(styleName, style(styleName));
305311
return styleName;
306312
}
313+
307314
public async registerPicture(url: string): Promise<{
308315
path: string;
309316
mimeType: string;

0 commit comments

Comments
 (0)