@blocknote/xl-pdf-exporter 0.33.0 → 0.35.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.
@@ -1,11 +1,11 @@
1
- var R = Object.defineProperty;
2
- var P = (t, r, e) => r in t ? R(t, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[r] = e;
3
- var w = (t, r, e) => P(t, typeof r != "symbol" ? r + "" : r, e);
4
- import { jsx as n, jsxs as f, Fragment as F } from "react/jsx-runtime";
5
- import { View as l, StyleSheet as v, Text as d, Svg as m, Path as g, Image as _, Link as V, Font as p, Document as D, Page as Z } from "@react-pdf/renderer";
1
+ var V = Object.defineProperty;
2
+ var R = (e, r, t) => r in e ? V(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
3
+ var x = (e, r, t) => R(e, typeof r != "symbol" ? r + "" : r, t);
4
+ import { jsx as n, jsxs as f, Fragment as P } from "react/jsx-runtime";
5
+ import { View as s, StyleSheet as v, Text as d, Svg as m, Path as g, Image as D, Link as T, Font as u, Document as F, Page as Z } from "@react-pdf/renderer";
6
6
  import { mapTableCell as k, Exporter as B, COLORS_DEFAULT as A } from "@blocknote/core";
7
7
  import { Fragment as q } from "react";
8
- const O = 0.75, L = v.create({
8
+ const O = 0.75, M = v.create({
9
9
  listItem: {
10
10
  display: "flex",
11
11
  flexDirection: "row",
@@ -46,14 +46,14 @@ const O = 0.75, L = v.create({
46
46
  fill: "undefined",
47
47
  children: /* @__PURE__ */ n(g, { d: "m424-312 282-282-56-56-226 226-114-114-56 56 170 170ZM200-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-560H200v560Zm0-560v560-560Z" })
48
48
  }
49
- ), x = ({
50
- listMarker: t,
49
+ ), w = ({
50
+ listMarker: e,
51
51
  children: r,
52
- style: e
53
- }) => /* @__PURE__ */ f(l, { style: [L.listItem, e || {}], children: [
54
- /* @__PURE__ */ n(l, { style: L.bullet, children: typeof t == "string" ? /* @__PURE__ */ n(d, { children: t }) : t }),
52
+ style: t
53
+ }) => /* @__PURE__ */ f(s, { style: [M.listItem, t || {}], children: [
54
+ /* @__PURE__ */ n(s, { style: M.bullet, children: typeof e == "string" ? /* @__PURE__ */ n(d, { children: e }) : e }),
55
55
  r
56
- ] }), E = 0.75, u = v.create({
56
+ ] }), _ = 0.75, p = v.create({
57
57
  tableContainer: {
58
58
  // width: "100%",
59
59
  },
@@ -65,8 +65,8 @@ const O = 0.75, L = v.create({
65
65
  display: "flex"
66
66
  },
67
67
  cell: {
68
- paddingHorizontal: 5 * E,
69
- paddingTop: 3 * E,
68
+ paddingHorizontal: 5 * _,
69
+ paddingTop: 3 * _,
70
70
  // paddingBottom: 1 * PIXELS_PER_POINT, should be 3px but looks odd, better with no padding Bottom
71
71
  borderLeft: "1px solid #ddd",
72
72
  borderTop: "1px solid #ddd",
@@ -82,170 +82,183 @@ const O = 0.75, L = v.create({
82
82
  rightCell: {
83
83
  borderRight: "1px solid #ddd"
84
84
  }
85
- }), K = (t) => {
86
- const r = new Array(t.data.headerRows ?? 0).fill(!0), e = new Array(t.data.headerCols ?? 0).fill(!0);
87
- return /* @__PURE__ */ n(l, { style: u.tableContainer, wrap: !1, children: t.data.rows.map((i, a) => /* @__PURE__ */ n(
88
- l,
85
+ }), K = (e) => {
86
+ const r = new Array(e.data.headerRows ?? 0).fill(!0), t = new Array(e.data.headerCols ?? 0).fill(!0);
87
+ return /* @__PURE__ */ n(s, { style: p.tableContainer, wrap: !1, children: e.data.rows.map((i, o) => /* @__PURE__ */ n(
88
+ s,
89
89
  {
90
90
  style: [
91
- u.row,
92
- a === t.data.rows.length - 1 ? u.bottomCell : {}
91
+ p.row,
92
+ o === e.data.rows.length - 1 ? p.bottomCell : {}
93
93
  ],
94
- children: i.cells.map((c, o) => {
95
- const s = k(c), y = r[a], I = e[o];
94
+ children: i.cells.map((h, l) => {
95
+ const a = k(h), C = r[o], I = t[l];
96
96
  return /* @__PURE__ */ n(
97
- l,
97
+ s,
98
98
  {
99
99
  style: [
100
- u.cell,
101
- y || I ? u.headerCell : {},
102
- o === i.cells.length - 1 ? u.rightCell : {},
103
- t.data.columnWidths[o] ? { width: t.data.columnWidths[o] } : { flex: 1 },
100
+ p.cell,
101
+ C || I ? p.headerCell : {},
102
+ l === i.cells.length - 1 ? p.rightCell : {},
103
+ e.data.columnWidths[l] ? { width: e.data.columnWidths[l] } : { flex: 1 },
104
104
  {
105
- color: s.props.textColor === "default" ? void 0 : t.transformer.options.colors[s.props.textColor].text,
106
- backgroundColor: s.props.backgroundColor === "default" ? void 0 : t.transformer.options.colors[s.props.backgroundColor].background,
107
- textAlign: s.props.textAlignment
105
+ color: a.props.textColor === "default" ? void 0 : e.transformer.options.colors[a.props.textColor].text,
106
+ backgroundColor: a.props.backgroundColor === "default" ? void 0 : e.transformer.options.colors[a.props.backgroundColor].background,
107
+ textAlign: a.props.textAlignment
108
108
  }
109
109
  ],
110
- children: t.transformer.transformInlineContent(s.content)
110
+ children: e.transformer.transformInlineContent(a.content)
111
111
  },
112
- o
112
+ l
113
113
  );
114
114
  })
115
115
  },
116
- a
116
+ o
117
117
  )) });
118
- }, h = 0.75, b = 16, U = {
119
- paragraph: (t, r) => /* @__PURE__ */ n(d, { children: r.transformInlineContent(t.content) }, "paragraph" + t.id),
120
- toggleListItem: (t, r) => /* @__PURE__ */ n(x, { listMarker: j, children: /* @__PURE__ */ n(d, { children: r.transformInlineContent(t.content) }) }),
121
- bulletListItem: (t, r) => /* @__PURE__ */ n(x, { listMarker: W, children: /* @__PURE__ */ n(d, { children: r.transformInlineContent(t.content) }) }, "bulletListItem" + t.id),
122
- numberedListItem: (t, r, e, i) => /* @__PURE__ */ n(
123
- x,
118
+ }, c = 0.75, b = 16, U = {
119
+ paragraph: (e, r) => /* @__PURE__ */ n(d, { children: r.transformInlineContent(e.content) }, "paragraph" + e.id),
120
+ toggleListItem: (e, r) => /* @__PURE__ */ n(w, { listMarker: j, children: /* @__PURE__ */ n(d, { children: r.transformInlineContent(e.content) }) }),
121
+ bulletListItem: (e, r) => /* @__PURE__ */ n(w, { listMarker: W, children: /* @__PURE__ */ n(d, { children: r.transformInlineContent(e.content) }) }, "bulletListItem" + e.id),
122
+ numberedListItem: (e, r, t, i) => /* @__PURE__ */ n(
123
+ w,
124
124
  {
125
125
  listMarker: `${i}.`,
126
- children: /* @__PURE__ */ n(d, { children: r.transformInlineContent(t.content) })
126
+ children: /* @__PURE__ */ n(d, { children: r.transformInlineContent(e.content) })
127
127
  },
128
- "numberedListItem" + t.id
128
+ "numberedListItem" + e.id
129
129
  ),
130
130
  // would be nice to have pdf checkboxes:
131
131
  // https://github.com/diegomura/react-pdf/issues/2103
132
- checkListItem: (t, r) => /* @__PURE__ */ n(
133
- x,
132
+ checkListItem: (e, r) => /* @__PURE__ */ n(
133
+ w,
134
134
  {
135
- listMarker: t.props.checked ? N : z,
136
- children: /* @__PURE__ */ n(d, { children: r.transformInlineContent(t.content) })
135
+ listMarker: e.props.checked ? N : z,
136
+ children: /* @__PURE__ */ n(d, { children: r.transformInlineContent(e.content) })
137
137
  },
138
- "checkListItem" + t.id
138
+ "checkListItem" + e.id
139
139
  ),
140
- heading: (t, r) => {
141
- const e = {
140
+ heading: (e, r) => {
141
+ const t = {
142
142
  1: 2,
143
143
  2: 1.5,
144
144
  3: 1.17,
145
145
  4: 1,
146
146
  5: 0.83,
147
147
  6: 0.67
148
- }[t.props.level];
148
+ }[e.props.level];
149
149
  return /* @__PURE__ */ n(
150
150
  d,
151
151
  {
152
152
  style: {
153
- fontSize: e * b * h,
153
+ fontSize: t * b * c,
154
+ lineHeight: 1.25,
154
155
  fontWeight: 700
155
156
  },
156
- children: r.transformInlineContent(t.content)
157
+ children: r.transformInlineContent(e.content)
157
158
  },
158
- "heading" + t.id
159
+ "heading" + e.id
159
160
  );
160
161
  },
161
- quote: (t, r) => /* @__PURE__ */ n(
162
+ quote: (e, r) => /* @__PURE__ */ n(
162
163
  d,
163
164
  {
164
165
  style: {
165
166
  borderLeft: "#7D797A",
166
167
  color: "#7D797A",
167
- paddingLeft: 9.5 * h
168
+ paddingLeft: 9.5 * c
168
169
  },
169
- children: r.transformInlineContent(t.content)
170
+ children: r.transformInlineContent(e.content)
170
171
  },
171
- "quote" + t.id
172
+ "quote" + e.id
172
173
  ),
173
- codeBlock: (t) => {
174
+ codeBlock: (e) => {
174
175
  var i;
175
- const e = (((i = t.content[0]) == null ? void 0 : i.text) || "").split(`
176
- `).map((a, c) => {
177
- var s;
178
- const o = ((s = a.match(/^\s*/)) == null ? void 0 : s[0].length) || 0;
176
+ const t = (((i = e.content[0]) == null ? void 0 : i.text) || "").split(`
177
+ `).map((o, h) => {
178
+ var a;
179
+ const l = ((a = o.match(/^\s*/)) == null ? void 0 : a[0].length) || 0;
179
180
  return /* @__PURE__ */ n(
180
181
  d,
181
182
  {
182
183
  style: {
183
- marginLeft: o * 9.5 * h
184
+ marginLeft: l * 9.5 * c
184
185
  },
185
- children: a.trimStart() || /* @__PURE__ */ n(F, { children: " " })
186
+ children: o.trimStart() || /* @__PURE__ */ n(P, { children: " " })
186
187
  },
187
- `line_${c}` + t.id
188
+ `line_${h}` + e.id
188
189
  );
189
190
  });
190
191
  return /* @__PURE__ */ n(
191
- l,
192
+ s,
192
193
  {
193
194
  wrap: !1,
194
195
  style: {
195
- padding: 24 * h,
196
+ padding: 24 * c,
196
197
  backgroundColor: "#161616",
197
198
  color: "#ffffff",
198
199
  lineHeight: 1.25,
199
- fontSize: b * h,
200
+ fontSize: b * c,
200
201
  fontFamily: "GeistMono"
201
202
  },
202
- children: e
203
+ children: t
203
204
  },
204
- "codeBlock" + t.id
205
+ "codeBlock" + e.id
205
206
  );
206
207
  },
207
- pageBreak: () => /* @__PURE__ */ n(l, { break: !0 }, "pageBreak"),
208
- audio: (t, r) => /* @__PURE__ */ f(l, { wrap: !1, children: [
209
- S(
210
- t.props,
208
+ pageBreak: () => /* @__PURE__ */ n(s, { break: !0 }, "pageBreak"),
209
+ column: (e, r, t, i, o) => /* @__PURE__ */ n(s, { style: { flex: e.props.width }, children: o }),
210
+ columnList: (e, r, t, i, o) => /* @__PURE__ */ n(
211
+ s,
212
+ {
213
+ style: {
214
+ display: "flex",
215
+ gap: 8 * c,
216
+ flexDirection: "row"
217
+ },
218
+ children: o
219
+ }
220
+ ),
221
+ audio: (e, r) => /* @__PURE__ */ f(s, { wrap: !1, children: [
222
+ L(
223
+ e.props,
211
224
  "Open audio file",
212
225
  /* @__PURE__ */ n(m, { height: 14, width: 14, viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ n(g, { 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" }) })
213
226
  ),
214
- H(t.props)
215
- ] }, "audio" + t.id),
216
- video: (t, r) => /* @__PURE__ */ f(l, { wrap: !1, children: [
217
- S(
218
- t.props,
227
+ H(e.props)
228
+ ] }, "audio" + e.id),
229
+ video: (e, r) => /* @__PURE__ */ f(s, { wrap: !1, children: [
230
+ L(
231
+ e.props,
219
232
  "Open video file",
220
233
  /* @__PURE__ */ n(m, { height: 14, width: 14, viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ n(g, { 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" }) })
221
234
  ),
222
- H(t.props)
223
- ] }, "video" + t.id),
224
- file: (t, r) => /* @__PURE__ */ f(l, { wrap: !1, children: [
225
- S(
226
- t.props,
235
+ H(e.props)
236
+ ] }, "video" + e.id),
237
+ file: (e, r) => /* @__PURE__ */ f(s, { wrap: !1, children: [
238
+ L(
239
+ e.props,
227
240
  "Open file",
228
241
  /* @__PURE__ */ n(m, { height: 16, width: 16, viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ n(g, { 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" }) })
229
242
  ),
230
- H(t.props)
231
- ] }, "file" + t.id),
232
- image: async (t, r) => /* @__PURE__ */ f(l, { wrap: !1, children: [
243
+ H(e.props)
244
+ ] }, "file" + e.id),
245
+ image: async (e, r) => /* @__PURE__ */ f(s, { wrap: !1, children: [
233
246
  /* @__PURE__ */ n(
234
- _,
247
+ D,
235
248
  {
236
- src: await r.resolveFile(t.props.url),
249
+ src: await r.resolveFile(e.props.url),
237
250
  style: {
238
- width: t.props.previewWidth ? t.props.previewWidth * h : void 0
251
+ width: e.props.previewWidth ? e.props.previewWidth * c : void 0
239
252
  }
240
253
  }
241
254
  ),
242
- H(t.props)
243
- ] }, "image" + t.id),
244
- table: (t, r) => /* @__PURE__ */ n(K, { data: t.content, transformer: r }, "table" + t.id)
255
+ H(e.props)
256
+ ] }, "image" + e.id),
257
+ table: (e, r) => /* @__PURE__ */ n(K, { data: e.content, transformer: r }, "table" + e.id)
245
258
  };
246
- function S(t, r, e, i) {
247
- return /* @__PURE__ */ n(V, { src: t.url, children: /* @__PURE__ */ f(
248
- l,
259
+ function L(e, r, t, i) {
260
+ return /* @__PURE__ */ n(T, { src: e.url, children: /* @__PURE__ */ f(
261
+ s,
249
262
  {
250
263
  style: {
251
264
  display: "flex",
@@ -253,70 +266,70 @@ function S(t, r, e, i) {
253
266
  flexDirection: "row"
254
267
  },
255
268
  children: [
256
- e,
257
- /* @__PURE__ */ n(d, { children: t.name || r })
269
+ t,
270
+ /* @__PURE__ */ n(d, { children: e.name || r })
258
271
  ]
259
272
  }
260
- ) }, "file" + t.url);
273
+ ) }, "file" + e.url);
261
274
  }
262
- function H(t, r) {
263
- if (t.caption)
275
+ function H(e, r) {
276
+ if (e.caption)
264
277
  return /* @__PURE__ */ n(
265
278
  d,
266
279
  {
267
280
  style: {
268
- width: t.previewWidth ? t.previewWidth * h : void 0,
269
- fontSize: b * 0.8 * h
281
+ width: e.previewWidth ? e.previewWidth * c : void 0,
282
+ fontSize: b * 0.8 * c
270
283
  },
271
- children: t.caption
284
+ children: e.caption
272
285
  },
273
- "caption" + t.caption
286
+ "caption" + e.caption
274
287
  );
275
288
  }
276
289
  const $ = {
277
- link: (t, r) => /* @__PURE__ */ n(V, { href: t.href, children: t.content.map((e) => r.transformStyledText(e)) }, "link" + t.href),
278
- text: (t, r) => r.transformStyledText(t)
290
+ link: (e, r) => /* @__PURE__ */ n(T, { href: e.href, children: e.content.map((t) => r.transformStyledText(t)) }, "link" + e.href),
291
+ text: (e, r) => r.transformStyledText(e)
279
292
  }, X = {
280
- bold: (t) => t ? {
293
+ bold: (e) => e ? {
281
294
  fontWeight: "bold"
282
295
  } : {},
283
- italic: (t) => t ? {
296
+ italic: (e) => e ? {
284
297
  fontStyle: "italic"
285
298
  } : {},
286
- underline: (t) => t ? {
299
+ underline: (e) => e ? {
287
300
  textDecoration: "underline"
288
301
  // TODO: could conflict with strike
289
302
  } : {},
290
- strike: (t) => t ? {
303
+ strike: (e) => e ? {
291
304
  textDecoration: "line-through"
292
305
  } : {},
293
- backgroundColor: (t, r) => t ? {
294
- backgroundColor: r.options.colors[t].background
306
+ backgroundColor: (e, r) => e ? {
307
+ backgroundColor: r.options.colors[e].background
295
308
  } : {},
296
- textColor: (t, r) => t ? {
297
- color: r.options.colors[t].text
309
+ textColor: (e, r) => e ? {
310
+ color: r.options.colors[e].text
298
311
  } : {},
299
- code: (t) => t ? {
312
+ code: (e) => e ? {
300
313
  fontFamily: "GeistMono"
301
314
  } : {}
302
- }, nt = {
315
+ }, ne = {
303
316
  blockMapping: U,
304
317
  inlineContentMapping: $,
305
318
  styleMapping: X
306
319
  };
307
- async function G(t) {
308
- return "https://corsproxy.api.blocknotejs.org/corsproxy/?url=" + encodeURIComponent(t);
320
+ async function G(e) {
321
+ return "https://corsproxy.api.blocknotejs.org/corsproxy/?url=" + encodeURIComponent(e);
309
322
  }
310
- async function J(t, r) {
311
- return t.default;
323
+ async function J(e, r) {
324
+ return e.default;
312
325
  }
313
- async function C(t) {
314
- return J(t);
326
+ async function y(e) {
327
+ return J(e);
315
328
  }
316
- const T = 16, M = 0.75;
317
- class it extends B {
318
- constructor(e, i, a) {
319
- const o = {
329
+ const E = 16, S = 0.75;
330
+ class ie extends B {
331
+ constructor(t, i, o) {
332
+ const l = {
320
333
  ...{
321
334
  emojiSource: {
322
335
  format: "png",
@@ -325,17 +338,17 @@ class it extends B {
325
338
  resolveFileUrl: G,
326
339
  colors: A
327
340
  },
328
- ...a
341
+ ...o
329
342
  };
330
- super(e, i, o);
331
- w(this, "fontsRegistered", !1);
332
- w(this, "styles", v.create({
343
+ super(t, i, l);
344
+ x(this, "fontsRegistered", !1);
345
+ x(this, "styles", v.create({
333
346
  page: {
334
347
  paddingTop: 35,
335
348
  paddingBottom: 65,
336
349
  paddingHorizontal: 35,
337
350
  fontFamily: "Inter",
338
- fontSize: T * M,
351
+ fontSize: E * S,
339
352
  // pixels
340
353
  lineHeight: 1.5
341
354
  },
@@ -346,108 +359,109 @@ class it extends B {
346
359
  position: "absolute"
347
360
  }
348
361
  }));
349
- w(this, "options");
350
- this.schema = e, this.options = o;
362
+ x(this, "options");
363
+ this.schema = t, this.options = l;
351
364
  }
352
365
  /**
353
366
  * Mostly for internal use, you probably want to use `toBlob` or `toReactPDFDocument` instead.
354
367
  */
355
- transformStyledText(e) {
356
- const i = this.mapStyles(e.styles), a = Object.assign({}, ...i);
357
- return /* @__PURE__ */ n(d, { style: a, children: e.text }, e.text);
368
+ transformStyledText(t) {
369
+ const i = this.mapStyles(t.styles), o = Object.assign({}, ...i);
370
+ return /* @__PURE__ */ n(d, { style: o, children: t.text }, t.text);
358
371
  }
359
372
  /**
360
373
  * Mostly for internal use, you probably want to use `toBlob` or `toReactPDFDocument` instead.
361
374
  */
362
- async transformBlocks(e, i = 0) {
363
- const a = [];
364
- let c = 0;
365
- for (const o of e) {
366
- o.type === "numberedListItem" ? c++ : c = 0;
367
- const s = await this.transformBlocks(o.children, i + 1), y = await this.mapBlock(
368
- o,
375
+ async transformBlocks(t, i = 0) {
376
+ const o = [];
377
+ let h = 0;
378
+ for (const l of t) {
379
+ l.type === "numberedListItem" ? h++ : h = 0;
380
+ const a = await this.transformBlocks(l.children, i + 1), C = await this.mapBlock(
381
+ l,
369
382
  i,
370
- c
383
+ h,
384
+ a
371
385
  );
372
- if (o.type === "pageBreak") {
373
- a.push(y);
386
+ if (["pageBreak", "columnList", "column"].includes(l.type)) {
387
+ o.push(C);
374
388
  continue;
375
389
  }
376
- const I = this.blocknoteDefaultPropsToReactPDFStyle(o.props);
377
- a.push(
390
+ const I = this.blocknoteDefaultPropsToReactPDFStyle(l.props);
391
+ o.push(
378
392
  /* @__PURE__ */ f(q, { children: [
379
393
  /* @__PURE__ */ n(
380
- l,
394
+ s,
381
395
  {
382
396
  style: {
383
- paddingVertical: 3 * M,
397
+ paddingVertical: 3 * S,
384
398
  ...this.styles.block,
385
399
  ...I
386
400
  },
387
- children: y
401
+ children: C
388
402
  }
389
403
  ),
390
- s.length > 0 && /* @__PURE__ */ n(
391
- l,
404
+ a.length > 0 && /* @__PURE__ */ n(
405
+ s,
392
406
  {
393
407
  style: {
394
- marginLeft: T * 1.5 * M,
408
+ marginLeft: E * 1.5 * S,
395
409
  ...this.styles.blockChildren
396
410
  },
397
- children: s
411
+ children: a
398
412
  },
399
- o.id + i + "children"
413
+ l.id + i + "children"
400
414
  )
401
- ] }, o.id)
415
+ ] }, l.id)
402
416
  );
403
417
  }
404
- return a;
418
+ return o;
405
419
  }
406
420
  async registerFonts() {
407
421
  if (this.fontsRegistered)
408
422
  return;
409
- this.options.emojiSource && p.registerEmojiSource(this.options.emojiSource);
410
- let e = await C(
423
+ this.options.emojiSource && u.registerEmojiSource(this.options.emojiSource);
424
+ let t = await y(
411
425
  await import("./Inter_18pt-Regular-byxnNS-8.js")
412
426
  );
413
- p.register({
427
+ u.register({
414
428
  family: "Inter",
415
- src: e
416
- }), e = await C(
429
+ src: t
430
+ }), t = await y(
417
431
  await import("./Inter_18pt-Italic-BVnfHlUD.js")
418
- ), p.register({
432
+ ), u.register({
419
433
  family: "Inter",
420
434
  fontStyle: "italic",
421
- src: e
422
- }), e = await C(
435
+ src: t
436
+ }), t = await y(
423
437
  await import("./Inter_18pt-Bold-BOnnSImi.js")
424
- ), p.register({
438
+ ), u.register({
425
439
  family: "Inter",
426
- src: e,
440
+ src: t,
427
441
  fontWeight: "bold"
428
- }), e = await C(
442
+ }), t = await y(
429
443
  await import("./Inter_18pt-BoldItalic-DPKIpVzB.js")
430
- ), p.register({
444
+ ), u.register({
431
445
  family: "Inter",
432
446
  fontStyle: "italic",
433
- src: e,
447
+ src: t,
434
448
  fontWeight: "bold"
435
- }), e = await C(
449
+ }), t = await y(
436
450
  await import("./GeistMono-Regular-D4rKXxwr.js")
437
- ), p.register({
451
+ ), u.register({
438
452
  family: "GeistMono",
439
- src: e
453
+ src: t
440
454
  }), this.fontsRegistered = !0;
441
455
  }
442
456
  /**
443
457
  * Convert a document (array of Blocks) to a react-pdf Document.
444
458
  */
445
- async toReactPDFDocument(e, i = {}) {
446
- return await this.registerFonts(), /* @__PURE__ */ n(D, { children: /* @__PURE__ */ f(Z, { dpi: 100, size: "A4", style: this.styles.page, children: [
447
- i.header && /* @__PURE__ */ n(l, { fixed: !0, style: this.styles.header, children: i.header }),
448
- await this.transformBlocks(e),
459
+ async toReactPDFDocument(t, i = {}) {
460
+ return await this.registerFonts(), /* @__PURE__ */ n(F, { children: /* @__PURE__ */ f(Z, { dpi: 100, size: "A4", style: this.styles.page, children: [
461
+ i.header && /* @__PURE__ */ n(s, { fixed: !0, style: this.styles.header, children: i.header }),
462
+ await this.transformBlocks(t),
449
463
  i.footer && /* @__PURE__ */ n(
450
- l,
464
+ s,
451
465
  {
452
466
  fixed: !0,
453
467
  style: [
@@ -463,17 +477,17 @@ class it extends B {
463
477
  )
464
478
  ] }) });
465
479
  }
466
- blocknoteDefaultPropsToReactPDFStyle(e) {
480
+ blocknoteDefaultPropsToReactPDFStyle(t) {
467
481
  return {
468
- textAlign: e.textAlignment,
469
- backgroundColor: e.backgroundColor === "default" || !e.backgroundColor ? void 0 : this.options.colors[e.backgroundColor].background,
470
- color: e.textColor === "default" || !e.textColor ? void 0 : this.options.colors[e.textColor].text,
471
- alignItems: e.textAlignment === "right" ? "flex-end" : e.textAlignment === "center" ? "center" : void 0
482
+ textAlign: t.textAlignment,
483
+ backgroundColor: t.backgroundColor === "default" || !t.backgroundColor ? void 0 : this.options.colors[t.backgroundColor].background,
484
+ color: t.textColor === "default" || !t.textColor ? void 0 : this.options.colors[t.textColor].text,
485
+ alignItems: t.textAlignment === "right" ? "flex-end" : t.textAlignment === "center" ? "center" : void 0
472
486
  };
473
487
  }
474
488
  }
475
489
  export {
476
- it as PDFExporter,
477
- nt as pdfDefaultSchemaMappings
490
+ ie as PDFExporter,
491
+ ne as pdfDefaultSchemaMappings
478
492
  };
479
493
  //# sourceMappingURL=blocknote-xl-pdf-exporter.js.map