@@ -9,11 +9,11 @@ import {
9
9
StyleSchema ,
10
10
StyledText ,
11
11
} 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" ;
15
12
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" ;
16
15
import { getImageDimensions } from "./imageUtil.js" ;
16
+ import stylesXml from "./template/styles.xml?raw" ;
17
17
18
18
export class ODTExporter <
19
19
B extends BlockSchema ,
@@ -28,16 +28,22 @@ export class ODTExporter<
28
28
Record < string , string > ,
29
29
React . ReactNode
30
30
> {
31
+ // "Styles" to be added to the AutomaticStyles section of the ODT file
32
+ // Keyed by the style name
31
33
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 <
33
38
string ,
34
39
{
35
40
file : Blob ;
36
41
fileName : string ;
37
42
height : number ;
38
43
width : number ;
39
44
}
40
- > = new Map ( ) ;
45
+ > ( ) ;
46
+
41
47
private styleCounter = 0 ;
42
48
43
49
public readonly options : ExporterOptions ;
@@ -304,6 +310,7 @@ export class ODTExporter<
304
310
this . automaticStyles . set ( styleName , style ( styleName ) ) ;
305
311
return styleName ;
306
312
}
313
+
307
314
public async registerPicture ( url : string ) : Promise < {
308
315
path : string ;
309
316
mimeType : string ;
0 commit comments