@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,602 @@
1
+ <div>
2
+ <document>
3
+ <page
4
+ dpi="100"
5
+ style="padding-top: 35px; padding-bottom: 65px; font-family: Inter; font-size: 12px; line-height: 1.5;"
6
+ >
7
+ <view>
8
+ <text>
9
+ Header
10
+ </text>
11
+ </view>
12
+ <view>
13
+ <view
14
+ style="text-align: left;"
15
+ >
16
+ <text>
17
+ <text
18
+ style="font-style: italic;"
19
+ >
20
+ Welcome to this
21
+ </text>
22
+ <text
23
+ style="font-style: italic; font-weight: bold;"
24
+ >
25
+ demo 🙌!
26
+ </text>
27
+ </text>
28
+ </view>
29
+ <view
30
+ style="margin-left: 18px;"
31
+ >
32
+ <view
33
+ style="text-align: left;"
34
+ >
35
+ <text>
36
+ <text>
37
+ Hello World nested
38
+ </text>
39
+ </text>
40
+ </view>
41
+ <view
42
+ style="margin-left: 18px;"
43
+ >
44
+ <view
45
+ style="text-align: left;"
46
+ >
47
+ <text>
48
+ <text>
49
+ Hello World double nested
50
+ </text>
51
+ </text>
52
+ </view>
53
+ </view>
54
+ </view>
55
+ <view
56
+ style="text-align: left; background-color: rgb(251, 228, 228);"
57
+ >
58
+ <text>
59
+ <text
60
+ style="font-weight: bold;"
61
+ >
62
+ This paragraph has a background color
63
+ </text>
64
+ </text>
65
+ </view>
66
+ <view
67
+ style="text-align: left;"
68
+ >
69
+ <text>
70
+ <text>
71
+ Paragraph
72
+ </text>
73
+ </text>
74
+ </view>
75
+ <view
76
+ style="text-align: left;"
77
+ >
78
+ <text
79
+ style="font-size: 24px; font-weight: 700;"
80
+ >
81
+ <text>
82
+ Heading
83
+ </text>
84
+ </text>
85
+ </view>
86
+ <view
87
+ style="text-align: right; align-items: flex-end;"
88
+ >
89
+ <text
90
+ style="font-size: 24px; font-weight: 700;"
91
+ >
92
+ <text>
93
+ Heading right
94
+ </text>
95
+ </text>
96
+ </view>
97
+ <view
98
+ style="text-align: justify;"
99
+ >
100
+ <text>
101
+ <text>
102
+ justified paragraph. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
103
+ </text>
104
+ </text>
105
+ </view>
106
+ <view>
107
+ <text>
108
+ codeBlock not implemented
109
+ </text>
110
+ </view>
111
+ <view
112
+ style="text-align: left;"
113
+ >
114
+ <view>
115
+ <view>
116
+ <text>
117
+
118
+ </text>
119
+ </view>
120
+ <text>
121
+ <text>
122
+ Bullet List Item. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
123
+ </text>
124
+ </text>
125
+ </view>
126
+ </view>
127
+ <view
128
+ style="margin-left: 18px;"
129
+ >
130
+ <view
131
+ style="text-align: left;"
132
+ >
133
+ <view>
134
+ <view>
135
+ <text>
136
+
137
+ </text>
138
+ </view>
139
+ <text>
140
+ <text>
141
+ Bullet List Item. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
142
+ </text>
143
+ </text>
144
+ </view>
145
+ </view>
146
+ <view
147
+ style="text-align: right; align-items: flex-end;"
148
+ >
149
+ <view>
150
+ <view>
151
+ <text>
152
+
153
+ </text>
154
+ </view>
155
+ <text>
156
+ <text>
157
+ Bullet List Item right. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
158
+ </text>
159
+ </text>
160
+ </view>
161
+ </view>
162
+ <view
163
+ style="text-align: left;"
164
+ >
165
+ <view>
166
+ <view>
167
+ <text>
168
+ 1.
169
+ </text>
170
+ </view>
171
+ <text>
172
+ <text>
173
+ Numbered List Item 1
174
+ </text>
175
+ </text>
176
+ </view>
177
+ </view>
178
+ <view
179
+ style="text-align: left;"
180
+ >
181
+ <view>
182
+ <view>
183
+ <text>
184
+ 2.
185
+ </text>
186
+ </view>
187
+ <text>
188
+ <text>
189
+ Numbered List Item 2
190
+ </text>
191
+ </text>
192
+ </view>
193
+ </view>
194
+ <view
195
+ style="margin-left: 18px;"
196
+ >
197
+ <view
198
+ style="text-align: left;"
199
+ >
200
+ <view>
201
+ <view>
202
+ <text>
203
+ 1.
204
+ </text>
205
+ </view>
206
+ <text>
207
+ <text>
208
+ Numbered List Item Nested 1
209
+ </text>
210
+ </text>
211
+ </view>
212
+ </view>
213
+ <view
214
+ style="text-align: left;"
215
+ >
216
+ <view>
217
+ <view>
218
+ <text>
219
+ 2.
220
+ </text>
221
+ </view>
222
+ <text>
223
+ <text>
224
+ Numbered List Item Nested 2
225
+ </text>
226
+ </text>
227
+ </view>
228
+ </view>
229
+ <view
230
+ style="text-align: right; background-color: rgb(251, 228, 228); color: rgb(11, 110, 153); align-items: flex-end;"
231
+ >
232
+ <view>
233
+ <view>
234
+ <text>
235
+ 3.
236
+ </text>
237
+ </view>
238
+ <text>
239
+ <text>
240
+ Numbered List Item Nested funky right
241
+ </text>
242
+ </text>
243
+ </view>
244
+ </view>
245
+ <view
246
+ style="text-align: center; background-color: rgb(251, 228, 228); color: rgb(11, 110, 153); align-items: center;"
247
+ >
248
+ <view>
249
+ <view>
250
+ <text>
251
+ 4.
252
+ </text>
253
+ </view>
254
+ <text>
255
+ <text>
256
+ Numbered List Item Nested funky center
257
+ </text>
258
+ </text>
259
+ </view>
260
+ </view>
261
+ </view>
262
+ </view>
263
+ <view
264
+ style="text-align: left;"
265
+ >
266
+ <view>
267
+ <view>
268
+ <text>
269
+ 1.
270
+ </text>
271
+ </view>
272
+ <text>
273
+ <text>
274
+ Numbered List Item
275
+ </text>
276
+ </text>
277
+ </view>
278
+ </view>
279
+ <view
280
+ style="text-align: left;"
281
+ >
282
+ <view>
283
+ <view>
284
+ <svg
285
+ fill="undefined"
286
+ height="12"
287
+ style="margin-top: 2px;"
288
+ viewbox="0 -960 960 960"
289
+ width="12"
290
+ >
291
+ <path
292
+ d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Z"
293
+ />
294
+ </svg>
295
+ </view>
296
+ <text>
297
+ <text>
298
+ Check List Item
299
+ </text>
300
+ </text>
301
+ </view>
302
+ </view>
303
+ <view>
304
+ <view>
305
+ <view>
306
+ <view>
307
+ <text>
308
+ Wide Cell
309
+ </text>
310
+ </view>
311
+ <view>
312
+ <text>
313
+ Table Cell
314
+ </text>
315
+ </view>
316
+ <view>
317
+ <text>
318
+ Table Cell
319
+ </text>
320
+ </view>
321
+ </view>
322
+ <view>
323
+ <view>
324
+ <text>
325
+ Wide Cell
326
+ </text>
327
+ </view>
328
+ <view>
329
+ <text>
330
+ Table Cell
331
+ </text>
332
+ </view>
333
+ <view>
334
+ <text>
335
+ Table Cell
336
+ </text>
337
+ </view>
338
+ </view>
339
+ <view>
340
+ <view>
341
+ <text>
342
+ Wide Cell
343
+ </text>
344
+ </view>
345
+ <view>
346
+ <text>
347
+ Table Cell
348
+ </text>
349
+ </view>
350
+ <view>
351
+ <text>
352
+ Table Cell
353
+ </text>
354
+ </view>
355
+ </view>
356
+ </view>
357
+ </view>
358
+ <view>
359
+ <view>
360
+ <link
361
+ src=""
362
+ >
363
+ <view
364
+ style="display: flex; gap: 6px; flex-direction: row;"
365
+ >
366
+ <svg
367
+ fill="currentColor"
368
+ height="16"
369
+ viewbox="0 0 24 24"
370
+ width="16"
371
+ >
372
+ <path
373
+ d="M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z"
374
+ />
375
+ </svg>
376
+ <text>
377
+ Open file
378
+ </text>
379
+ </view>
380
+ </link>
381
+ </view>
382
+ </view>
383
+ <view
384
+ style="text-align: left;"
385
+ >
386
+ <view>
387
+ <image
388
+ src="[object Blob]"
389
+ style="width: 384px;"
390
+ />
391
+ <text
392
+ style="width: 384px; font-size: 9.600000000000001px;"
393
+ >
394
+ From https://interactive-examples.mdn.mozilla.net/media/cc0-images/grapefruit-slice-332-332.jpg
395
+ </text>
396
+ </view>
397
+ </view>
398
+ <view
399
+ style="text-align: right; align-items: flex-end;"
400
+ >
401
+ <view>
402
+ <image
403
+ src="[object Blob]"
404
+ style="width: 150px;"
405
+ />
406
+ </view>
407
+ </view>
408
+ <view
409
+ style="text-align: left;"
410
+ >
411
+ <view>
412
+ <link
413
+ src="https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.webm"
414
+ >
415
+ <view
416
+ style="display: flex; gap: 6px; flex-direction: row;"
417
+ >
418
+ <svg
419
+ fill="currentColor"
420
+ height="14"
421
+ viewbox="0 0 24 24"
422
+ width="14"
423
+ >
424
+ <path
425
+ d="M2 3.9934C2 3.44476 2.45531 3 2.9918 3H21.0082C21.556 3 22 3.44495 22 3.9934V20.0066C22 20.5552 21.5447 21 21.0082 21H2.9918C2.44405 21 2 20.5551 2 20.0066V3.9934ZM8 5V19H16V5H8ZM4 5V7H6V5H4ZM18 5V7H20V5H18ZM4 9V11H6V9H4ZM18 9V11H20V9H18ZM4 13V15H6V13H4ZM18 13V15H20V13H18ZM4 17V19H6V17H4ZM18 17V19H20V17H18Z"
426
+ />
427
+ </svg>
428
+ <text>
429
+ Open video file
430
+ </text>
431
+ </view>
432
+ </link>
433
+ <text
434
+ style="width: 384px; font-size: 9.600000000000001px;"
435
+ >
436
+ From https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.webm
437
+ </text>
438
+ </view>
439
+ </view>
440
+ <view>
441
+ <view>
442
+ <link
443
+ src="https://interactive-examples.mdn.mozilla.net/media/cc0-audio/t-rex-roar.mp3"
444
+ >
445
+ <view
446
+ style="display: flex; gap: 6px; flex-direction: row;"
447
+ >
448
+ <svg
449
+ fill="currentColor"
450
+ height="14"
451
+ viewbox="0 0 24 24"
452
+ width="14"
453
+ >
454
+ <path
455
+ d="M2 16.0001H5.88889L11.1834 20.3319C11.2727 20.405 11.3846 20.4449 11.5 20.4449C11.7761 20.4449 12 20.2211 12 19.9449V4.05519C12 3.93977 11.9601 3.8279 11.887 3.73857C11.7121 3.52485 11.3971 3.49335 11.1834 3.66821L5.88889 8.00007H2C1.44772 8.00007 1 8.44778 1 9.00007V15.0001C1 15.5524 1.44772 16.0001 2 16.0001ZM23 12C23 15.292 21.5539 18.2463 19.2622 20.2622L17.8445 18.8444C19.7758 17.1937 21 14.7398 21 12C21 9.26016 19.7758 6.80629 17.8445 5.15557L19.2622 3.73779C21.5539 5.75368 23 8.70795 23 12ZM18 12C18 10.0883 17.106 8.38548 15.7133 7.28673L14.2842 8.71584C15.3213 9.43855 16 10.64 16 12C16 13.36 15.3213 14.5614 14.2842 15.2841L15.7133 16.7132C17.106 15.6145 18 13.9116 18 12Z"
456
+ />
457
+ </svg>
458
+ <text>
459
+ Open audio file
460
+ </text>
461
+ </view>
462
+ </link>
463
+ <text
464
+ style="font-size: 9.600000000000001px;"
465
+ >
466
+ From https://interactive-examples.mdn.mozilla.net/media/cc0-audio/t-rex-roar.mp3
467
+ </text>
468
+ </view>
469
+ </view>
470
+ <view
471
+ style="text-align: left;"
472
+ >
473
+ <text />
474
+ </view>
475
+ <view>
476
+ <view>
477
+ <link
478
+ src=""
479
+ >
480
+ <view
481
+ style="display: flex; gap: 6px; flex-direction: row;"
482
+ >
483
+ <svg
484
+ fill="currentColor"
485
+ height="14"
486
+ viewbox="0 0 24 24"
487
+ width="14"
488
+ >
489
+ <path
490
+ d="M2 16.0001H5.88889L11.1834 20.3319C11.2727 20.405 11.3846 20.4449 11.5 20.4449C11.7761 20.4449 12 20.2211 12 19.9449V4.05519C12 3.93977 11.9601 3.8279 11.887 3.73857C11.7121 3.52485 11.3971 3.49335 11.1834 3.66821L5.88889 8.00007H2C1.44772 8.00007 1 8.44778 1 9.00007V15.0001C1 15.5524 1.44772 16.0001 2 16.0001ZM23 12C23 15.292 21.5539 18.2463 19.2622 20.2622L17.8445 18.8444C19.7758 17.1937 21 14.7398 21 12C21 9.26016 19.7758 6.80629 17.8445 5.15557L19.2622 3.73779C21.5539 5.75368 23 8.70795 23 12ZM18 12C18 10.0883 17.106 8.38548 15.7133 7.28673L14.2842 8.71584C15.3213 9.43855 16 10.64 16 12C16 13.36 15.3213 14.5614 14.2842 15.2841L15.7133 16.7132C17.106 15.6145 18 13.9116 18 12Z"
491
+ />
492
+ </svg>
493
+ <text>
494
+ audio.mp3
495
+ </text>
496
+ </view>
497
+ </link>
498
+ <text
499
+ style="font-size: 9.600000000000001px;"
500
+ >
501
+ Audio file caption
502
+ </text>
503
+ </view>
504
+ </view>
505
+ <view
506
+ style="text-align: left;"
507
+ >
508
+ <text>
509
+ <text
510
+ style="font-weight: bold;"
511
+ >
512
+ Inline Content:
513
+ </text>
514
+ </text>
515
+ </view>
516
+ <view
517
+ style="text-align: left;"
518
+ >
519
+ <text>
520
+ <text
521
+ style="font-weight: bold; font-style: italic; color: rgb(224, 62, 62); background-color: rgb(221, 235, 241);"
522
+ >
523
+ Styled Text
524
+ </text>
525
+ <text>
526
+
527
+ </text>
528
+ <link
529
+ href="https://www.blocknotejs.org"
530
+ >
531
+ <text>
532
+ Link
533
+ </text>
534
+ </link>
535
+ </text>
536
+ </view>
537
+ <view>
538
+ <view>
539
+ <view>
540
+ <view>
541
+ <text>
542
+ Table Cell 1
543
+ </text>
544
+ </view>
545
+ <view>
546
+ <text>
547
+ Table Cell 2
548
+ </text>
549
+ </view>
550
+ <view>
551
+ <text>
552
+ Table Cell 3
553
+ </text>
554
+ </view>
555
+ </view>
556
+ <view>
557
+ <view>
558
+ <text>
559
+ Table Cell 4
560
+ </text>
561
+ </view>
562
+ <view>
563
+ <text
564
+ style="font-weight: bold;"
565
+ >
566
+ Table Cell Bold 5
567
+ </text>
568
+ </view>
569
+ <view>
570
+ <text>
571
+ Table Cell 6
572
+ </text>
573
+ </view>
574
+ </view>
575
+ <view>
576
+ <view>
577
+ <text>
578
+ Table Cell 7
579
+ </text>
580
+ </view>
581
+ <view>
582
+ <text>
583
+ Table Cell 8
584
+ </text>
585
+ </view>
586
+ <view>
587
+ <text>
588
+ Table Cell 9
589
+ </text>
590
+ </view>
591
+ </view>
592
+ </view>
593
+ </view>
594
+ </view>
595
+ <view>
596
+ <text>
597
+ Footer
598
+ </text>
599
+ </view>
600
+ </page>
601
+ </document>
602
+ </div>