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