@blocknote/xl-pdf-exporter 0.19.0

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.
Files changed (78) hide show
  1. package/LICENSE +661 -0
  2. package/dist/Inter_18pt-Bold-BOnnSImi.js +5 -0
  3. package/dist/Inter_18pt-Bold-BOnnSImi.js.map +1 -0
  4. package/dist/Inter_18pt-BoldItalic-DPKIpVzB.js +5 -0
  5. package/dist/Inter_18pt-BoldItalic-DPKIpVzB.js.map +1 -0
  6. package/dist/Inter_18pt-Italic-BVnfHlUD.js +5 -0
  7. package/dist/Inter_18pt-Italic-BVnfHlUD.js.map +1 -0
  8. package/dist/Inter_18pt-Regular-byxnNS-8.js +5 -0
  9. package/dist/Inter_18pt-Regular-byxnNS-8.js.map +1 -0
  10. package/dist/blocknote-xl-pdf-exporter.js +2503 -0
  11. package/dist/blocknote-xl-pdf-exporter.js.map +1 -0
  12. package/dist/blocknote-xl-pdf-exporter.umd.cjs +69 -0
  13. package/dist/blocknote-xl-pdf-exporter.umd.cjs.map +1 -0
  14. package/dist/webpack-stats.json +1 -0
  15. package/package.json +88 -0
  16. package/src/index.ts +1 -0
  17. package/src/pdf/__snapshots__/example.jsx +592 -0
  18. package/src/pdf/__snapshots__/exampleWithHeaderAndFooter.jsx +602 -0
  19. package/src/pdf/defaultSchema/blocks.tsx +177 -0
  20. package/src/pdf/defaultSchema/index.ts +9 -0
  21. package/src/pdf/defaultSchema/inlinecontent.tsx +23 -0
  22. package/src/pdf/defaultSchema/styles.tsx +68 -0
  23. package/src/pdf/index.ts +2 -0
  24. package/src/pdf/pdfExporter.test.tsx +208 -0
  25. package/src/pdf/pdfExporter.tsx +297 -0
  26. package/src/pdf/types.ts +3 -0
  27. package/src/pdf/util/listItem.tsx +70 -0
  28. package/src/pdf/util/table/Table.tsx +76 -0
  29. package/src/vite-env.d.ts +11 -0
  30. package/types/src/Exporter.d.ts +26 -0
  31. package/types/src/context/BlockNoteContext.d.ts +59 -0
  32. package/types/src/context/BlockNoteContext.test.d.ts +1 -0
  33. package/types/src/context/ServerBlockNoteEditor.d.ts +137 -0
  34. package/types/src/context/ServerBlockNoteEditor.test.d.ts +1 -0
  35. package/types/src/context/react/ReactServer.test.d.ts +2 -0
  36. package/types/src/docx/blocks.d.ts +433 -0
  37. package/types/src/docx/defaultSchema/blocks.d.ts +4 -0
  38. package/types/src/docx/defaultSchema/index.d.ts +559 -0
  39. package/types/src/docx/defaultSchema/inlinecontent.d.ts +4 -0
  40. package/types/src/docx/defaultSchema/styles.d.ts +4 -0
  41. package/types/src/docx/docxExporter.d.ts +14 -0
  42. package/types/src/docx/docxExporter.test.d.ts +1 -0
  43. package/types/src/docx/imageUtil.d.ts +4 -0
  44. package/types/src/docx/index.d.ts +2 -0
  45. package/types/src/docx/inlinecontent.d.ts +12 -0
  46. package/types/src/docx/styles.d.ts +55 -0
  47. package/types/src/docx/util/Table.d.ts +4 -0
  48. package/types/src/docxExporter.d.ts +255 -0
  49. package/types/src/docxExporter.test.d.ts +1 -0
  50. package/types/src/index.d.ts +1 -0
  51. package/types/src/mapping.d.ts +29 -0
  52. package/types/src/pdf/blocks.d.ts +434 -0
  53. package/types/src/pdf/defaultSchema/blocks.d.ts +4 -0
  54. package/types/src/pdf/defaultSchema/index.d.ts +510 -0
  55. package/types/src/pdf/defaultSchema/inlinecontent.d.ts +4 -0
  56. package/types/src/pdf/defaultSchema/styles.d.ts +3 -0
  57. package/types/src/pdf/index.d.ts +2 -0
  58. package/types/src/pdf/inlinecontent.d.ts +13 -0
  59. package/types/src/pdf/pdfExporter.d.ts +81 -0
  60. package/types/src/pdf/pdfExporter.test.d.ts +1 -0
  61. package/types/src/pdf/styles.d.ts +55 -0
  62. package/types/src/pdf/types.d.ts +2 -0
  63. package/types/src/pdf/util/listItem.d.ts +9 -0
  64. package/types/src/pdf/util/loadFontDataUrl.d.ts +3 -0
  65. package/types/src/pdf/util/table/Table.d.ts +5 -0
  66. package/types/src/pdfExporter.d.ts +256 -0
  67. package/types/src/pdfExporter.test.d.ts +1 -0
  68. package/types/src/react-email/defaultSchema/blocks.d.ts +5 -0
  69. package/types/src/react-email/defaultSchema/index.d.ts +560 -0
  70. package/types/src/react-email/defaultSchema/inlinecontent.d.ts +5 -0
  71. package/types/src/react-email/defaultSchema/styles.d.ts +4 -0
  72. package/types/src/react-email/reactEmailExporter.d.ts +13 -0
  73. package/types/src/react-email/reactEmailExporter.test.d.ts +8 -0
  74. package/types/src/testDocument.d.ts +505 -0
  75. package/types/src/transformer.d.ts +20 -0
  76. package/types/src/util/fileUtil.d.ts +22 -0
  77. package/types/src/util/imageUtil.d.ts +4 -0
  78. package/types/src/yjs/index.d.ts +2 -0
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const TestContext: import("react").Context<true | undefined>;
@@ -0,0 +1,433 @@
1
+ import { Paragraph, ParagraphChild } from "docx";
2
+ export declare function docxBlockMappingForDefaultSchema(inlineContentTransformer: (inlineContent: any) => ParagraphChild): import("../mapping").BlockMapping<import("@blocknote/core").BlockSchemaFromSpecs<{
3
+ paragraph: {
4
+ config: {
5
+ type: "paragraph";
6
+ content: "inline";
7
+ propSchema: {
8
+ backgroundColor: {
9
+ default: "default";
10
+ };
11
+ textColor: {
12
+ default: "default";
13
+ };
14
+ textAlignment: {
15
+ default: "left";
16
+ values: readonly ["left", "center", "right", "justify"];
17
+ };
18
+ };
19
+ };
20
+ implementation: import("@blocknote/core").TiptapBlockImplementation<{
21
+ type: "paragraph";
22
+ content: "inline";
23
+ propSchema: {
24
+ backgroundColor: {
25
+ default: "default";
26
+ };
27
+ textColor: {
28
+ default: "default";
29
+ };
30
+ textAlignment: {
31
+ default: "left";
32
+ values: readonly ["left", "center", "right", "justify"];
33
+ };
34
+ };
35
+ }, any, import("@blocknote/core").InlineContentSchema, import("@blocknote/core").StyleSchema>;
36
+ };
37
+ heading: {
38
+ config: {
39
+ type: "heading";
40
+ content: "inline";
41
+ propSchema: {
42
+ level: {
43
+ default: number;
44
+ values: readonly [1, 2, 3];
45
+ };
46
+ backgroundColor: {
47
+ default: "default";
48
+ };
49
+ textColor: {
50
+ default: "default";
51
+ };
52
+ textAlignment: {
53
+ default: "left";
54
+ values: readonly ["left", "center", "right", "justify"];
55
+ };
56
+ };
57
+ };
58
+ implementation: import("@blocknote/core").TiptapBlockImplementation<{
59
+ type: "heading";
60
+ content: "inline";
61
+ propSchema: {
62
+ level: {
63
+ default: number;
64
+ values: readonly [1, 2, 3];
65
+ };
66
+ backgroundColor: {
67
+ default: "default";
68
+ };
69
+ textColor: {
70
+ default: "default";
71
+ };
72
+ textAlignment: {
73
+ default: "left";
74
+ values: readonly ["left", "center", "right", "justify"];
75
+ };
76
+ };
77
+ }, any, import("@blocknote/core").InlineContentSchema, import("@blocknote/core").StyleSchema>;
78
+ };
79
+ bulletListItem: {
80
+ config: {
81
+ type: "bulletListItem";
82
+ content: "inline";
83
+ propSchema: {
84
+ backgroundColor: {
85
+ default: "default";
86
+ };
87
+ textColor: {
88
+ default: "default";
89
+ };
90
+ textAlignment: {
91
+ default: "left";
92
+ values: readonly ["left", "center", "right", "justify"];
93
+ };
94
+ };
95
+ };
96
+ implementation: import("@blocknote/core").TiptapBlockImplementation<{
97
+ type: "bulletListItem";
98
+ content: "inline";
99
+ propSchema: {
100
+ backgroundColor: {
101
+ default: "default";
102
+ };
103
+ textColor: {
104
+ default: "default";
105
+ };
106
+ textAlignment: {
107
+ default: "left";
108
+ values: readonly ["left", "center", "right", "justify"];
109
+ };
110
+ };
111
+ }, any, import("@blocknote/core").InlineContentSchema, import("@blocknote/core").StyleSchema>;
112
+ };
113
+ numberedListItem: {
114
+ config: {
115
+ type: "numberedListItem";
116
+ content: "inline";
117
+ propSchema: {
118
+ backgroundColor: {
119
+ default: "default";
120
+ };
121
+ textColor: {
122
+ default: "default";
123
+ };
124
+ textAlignment: {
125
+ default: "left";
126
+ values: readonly ["left", "center", "right", "justify"];
127
+ };
128
+ };
129
+ };
130
+ implementation: import("@blocknote/core").TiptapBlockImplementation<{
131
+ type: "numberedListItem";
132
+ content: "inline";
133
+ propSchema: {
134
+ backgroundColor: {
135
+ default: "default";
136
+ };
137
+ textColor: {
138
+ default: "default";
139
+ };
140
+ textAlignment: {
141
+ default: "left";
142
+ values: readonly ["left", "center", "right", "justify"];
143
+ };
144
+ };
145
+ }, any, import("@blocknote/core").InlineContentSchema, import("@blocknote/core").StyleSchema>;
146
+ };
147
+ checkListItem: {
148
+ config: {
149
+ type: "checkListItem";
150
+ content: "inline";
151
+ propSchema: {
152
+ checked: {
153
+ default: false;
154
+ };
155
+ backgroundColor: {
156
+ default: "default";
157
+ };
158
+ textColor: {
159
+ default: "default";
160
+ };
161
+ textAlignment: {
162
+ default: "left";
163
+ values: readonly ["left", "center", "right", "justify"];
164
+ };
165
+ };
166
+ };
167
+ implementation: import("@blocknote/core").TiptapBlockImplementation<{
168
+ type: "checkListItem";
169
+ content: "inline";
170
+ propSchema: {
171
+ checked: {
172
+ default: false;
173
+ };
174
+ backgroundColor: {
175
+ default: "default";
176
+ };
177
+ textColor: {
178
+ default: "default";
179
+ };
180
+ textAlignment: {
181
+ default: "left";
182
+ values: readonly ["left", "center", "right", "justify"];
183
+ };
184
+ };
185
+ }, any, import("@blocknote/core").InlineContentSchema, import("@blocknote/core").StyleSchema>;
186
+ };
187
+ table: {
188
+ config: {
189
+ type: "table";
190
+ content: "table";
191
+ propSchema: {
192
+ backgroundColor: {
193
+ default: "default";
194
+ };
195
+ textColor: {
196
+ default: "default";
197
+ };
198
+ textAlignment: {
199
+ default: "left";
200
+ values: readonly ["left", "center", "right", "justify"];
201
+ };
202
+ };
203
+ };
204
+ implementation: import("@blocknote/core").TiptapBlockImplementation<{
205
+ type: "table";
206
+ content: "table";
207
+ propSchema: {
208
+ backgroundColor: {
209
+ default: "default";
210
+ };
211
+ textColor: {
212
+ default: "default";
213
+ };
214
+ textAlignment: {
215
+ default: "left";
216
+ values: readonly ["left", "center", "right", "justify"];
217
+ };
218
+ };
219
+ }, any, import("@blocknote/core").InlineContentSchema, import("@blocknote/core").StyleSchema>;
220
+ };
221
+ file: {
222
+ config: {
223
+ type: "file";
224
+ propSchema: {
225
+ backgroundColor: {
226
+ default: "default";
227
+ };
228
+ name: {
229
+ default: "";
230
+ };
231
+ url: {
232
+ default: "";
233
+ };
234
+ caption: {
235
+ default: "";
236
+ };
237
+ };
238
+ content: "none";
239
+ isFileBlock: true;
240
+ };
241
+ implementation: import("@blocknote/core").TiptapBlockImplementation<{
242
+ type: "file";
243
+ propSchema: {
244
+ backgroundColor: {
245
+ default: "default";
246
+ };
247
+ name: {
248
+ default: "";
249
+ };
250
+ url: {
251
+ default: "";
252
+ };
253
+ caption: {
254
+ default: "";
255
+ };
256
+ };
257
+ content: "none";
258
+ isFileBlock: true;
259
+ }, any, import("@blocknote/core").InlineContentSchema, import("@blocknote/core").StyleSchema>;
260
+ };
261
+ image: {
262
+ config: {
263
+ type: "image";
264
+ propSchema: {
265
+ textAlignment: {
266
+ default: "left";
267
+ values: readonly ["left", "center", "right", "justify"];
268
+ };
269
+ backgroundColor: {
270
+ default: "default";
271
+ };
272
+ name: {
273
+ default: "";
274
+ };
275
+ url: {
276
+ default: "";
277
+ };
278
+ caption: {
279
+ default: "";
280
+ };
281
+ showPreview: {
282
+ default: true;
283
+ };
284
+ previewWidth: {
285
+ default: number;
286
+ };
287
+ };
288
+ content: "none";
289
+ isFileBlock: true;
290
+ fileBlockAccept: string[];
291
+ };
292
+ implementation: import("@blocknote/core").TiptapBlockImplementation<{
293
+ type: "image";
294
+ propSchema: {
295
+ textAlignment: {
296
+ default: "left";
297
+ values: readonly ["left", "center", "right", "justify"];
298
+ };
299
+ backgroundColor: {
300
+ default: "default";
301
+ };
302
+ name: {
303
+ default: "";
304
+ };
305
+ url: {
306
+ default: "";
307
+ };
308
+ caption: {
309
+ default: "";
310
+ };
311
+ showPreview: {
312
+ default: true;
313
+ };
314
+ previewWidth: {
315
+ default: number;
316
+ };
317
+ };
318
+ content: "none";
319
+ isFileBlock: true;
320
+ fileBlockAccept: string[];
321
+ }, any, import("@blocknote/core").InlineContentSchema, import("@blocknote/core").StyleSchema>;
322
+ };
323
+ video: {
324
+ config: {
325
+ type: "video";
326
+ propSchema: {
327
+ textAlignment: {
328
+ default: "left";
329
+ values: readonly ["left", "center", "right", "justify"];
330
+ };
331
+ backgroundColor: {
332
+ default: "default";
333
+ };
334
+ name: {
335
+ default: "";
336
+ };
337
+ url: {
338
+ default: "";
339
+ };
340
+ caption: {
341
+ default: "";
342
+ };
343
+ showPreview: {
344
+ default: true;
345
+ };
346
+ previewWidth: {
347
+ default: number;
348
+ };
349
+ };
350
+ content: "none";
351
+ isFileBlock: true;
352
+ fileBlockAccept: string[];
353
+ };
354
+ implementation: import("@blocknote/core").TiptapBlockImplementation<{
355
+ type: "video";
356
+ propSchema: {
357
+ textAlignment: {
358
+ default: "left";
359
+ values: readonly ["left", "center", "right", "justify"];
360
+ };
361
+ backgroundColor: {
362
+ default: "default";
363
+ };
364
+ name: {
365
+ default: "";
366
+ };
367
+ url: {
368
+ default: "";
369
+ };
370
+ caption: {
371
+ default: "";
372
+ };
373
+ showPreview: {
374
+ default: true;
375
+ };
376
+ previewWidth: {
377
+ default: number;
378
+ };
379
+ };
380
+ content: "none";
381
+ isFileBlock: true;
382
+ fileBlockAccept: string[];
383
+ }, any, import("@blocknote/core").InlineContentSchema, import("@blocknote/core").StyleSchema>;
384
+ };
385
+ audio: {
386
+ config: {
387
+ type: "audio";
388
+ propSchema: {
389
+ backgroundColor: {
390
+ default: "default";
391
+ };
392
+ name: {
393
+ default: "";
394
+ };
395
+ url: {
396
+ default: "";
397
+ };
398
+ caption: {
399
+ default: "";
400
+ };
401
+ showPreview: {
402
+ default: true;
403
+ };
404
+ };
405
+ content: "none";
406
+ isFileBlock: true;
407
+ fileBlockAccept: string[];
408
+ };
409
+ implementation: import("@blocknote/core").TiptapBlockImplementation<{
410
+ type: "audio";
411
+ propSchema: {
412
+ backgroundColor: {
413
+ default: "default";
414
+ };
415
+ name: {
416
+ default: "";
417
+ };
418
+ url: {
419
+ default: "";
420
+ };
421
+ caption: {
422
+ default: "";
423
+ };
424
+ showPreview: {
425
+ default: true;
426
+ };
427
+ };
428
+ content: "none";
429
+ isFileBlock: true;
430
+ fileBlockAccept: string[];
431
+ }, any, import("@blocknote/core").InlineContentSchema, import("@blocknote/core").StyleSchema>;
432
+ };
433
+ }>, import("@blocknote/core").InlineContentSchema, import("@blocknote/core").StyleSchema, Paragraph>;
@@ -0,0 +1,4 @@
1
+ import { DefaultBlockSchema } from "@blocknote/core";
2
+ import { BlockMapping } from "@blocknote/core/src/exporter/mapping.js";
3
+ import { Table as DocxTable, Paragraph, ParagraphChild } from "docx";
4
+ export declare const docxBlockMappingForDefaultSchema: BlockMapping<DefaultBlockSchema, any, any, Promise<Paragraph[] | Paragraph | DocxTable> | Paragraph[] | Paragraph | DocxTable, ParagraphChild>;