@texonom/nreact 1.5.5 → 1.5.7

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.
package/build/index.js CHANGED
@@ -1,44 +1,44 @@
1
- var ot = Object.defineProperty, at = Object.defineProperties;
2
- var rt = Object.getOwnPropertyDescriptors;
1
+ var Ke = Object.defineProperty, Qe = Object.defineProperties;
2
+ var et = Object.getOwnPropertyDescriptors;
3
3
  var ge = Object.getOwnPropertySymbols;
4
- var Ye = Object.prototype.hasOwnProperty, Ze = Object.prototype.propertyIsEnumerable;
5
- var Ge = (n, a, o) => a in n ? ot(n, a, { enumerable: !0, configurable: !0, writable: !0, value: o }) : n[a] = o, W = (n, a) => {
4
+ var Ue = Object.prototype.hasOwnProperty, We = Object.prototype.propertyIsEnumerable;
5
+ var ze = (n, a, o) => a in n ? Ke(n, a, { enumerable: !0, configurable: !0, writable: !0, value: o }) : n[a] = o, W = (n, a) => {
6
6
  for (var o in a || (a = {}))
7
- Ye.call(a, o) && Ge(n, o, a[o]);
7
+ Ue.call(a, o) && ze(n, o, a[o]);
8
8
  if (ge)
9
9
  for (var o of ge(a))
10
- Ze.call(a, o) && Ge(n, o, a[o]);
10
+ We.call(a, o) && ze(n, o, a[o]);
11
11
  return n;
12
- }, be = (n, a) => at(n, rt(a));
12
+ }, be = (n, a) => Qe(n, et(a));
13
13
  var le = (n, a) => {
14
14
  var o = {};
15
15
  for (var m in n)
16
- Ye.call(n, m) && a.indexOf(m) < 0 && (o[m] = n[m]);
16
+ Ue.call(n, m) && a.indexOf(m) < 0 && (o[m] = n[m]);
17
17
  if (n != null && ge)
18
18
  for (var m of ge(n))
19
- a.indexOf(m) < 0 && Ze.call(n, m) && (o[m] = n[m]);
19
+ a.indexOf(m) < 0 && We.call(n, m) && (o[m] = n[m]);
20
20
  return o;
21
21
  };
22
22
  import e from "react";
23
- import lt from "@fisch0920/medium-zoom";
24
- import { uuidToId as ve, getBlockParentPage as Je, getPageTableOfContents as he, getTextContent as ie, getBlockCollectionId as it, getBlockIcon as ct, isUrl as st } from "@texonom/nutils";
25
- import { formatDate as Mt, formatNotionDateTime as Ht, isUrl as At } from "@texonom/nutils";
26
- import { u as ce, T as C, G as mt, E as dt, P as Xe, L as ke, a as Ke, A as Qe, g as ut, N as pt } from "./asset-wrapper-CaHInqoM.js";
27
- import { l as Dt, B as Rt, C as zt, H as Ut, k as Wt, e as Vt, f as qt, j as Gt, S as Yt, h as Zt, d as Jt, b as Xt, c as Kt, i as Qt } from "./asset-wrapper-CaHInqoM.js";
28
- import { c as Ee, g as ft } from "./_commonjsHelpers-bAxELxBV.js";
29
- import { C as tn, P as nn, i as on } from "./collection-column-title-l4hmVo49.js";
30
- const gt = ({ block: n, className: a }) => {
23
+ import tt from "@fisch0920/medium-zoom";
24
+ import { uuidToId as ve, getBlockParentPage as Ve, getPageTableOfContents as he, getTextContent as ie, getBlockCollectionId as nt, getBlockIcon as ot, isUrl as at } from "@texonom/nutils";
25
+ import { formatDate as Tt, formatNotionDateTime as St, isUrl as jt } from "@texonom/nutils";
26
+ import { u as ce, T as C, G as rt, E as lt, P as qe, L as ke, a as Ge, A as Ye, g as it, N as ct } from "./asset-wrapper-CaHInqoM.js";
27
+ import { l as Bt, B as Mt, C as Ht, H as At, k as Ft, e as Dt, f as Rt, j as zt, S as Ut, h as Wt, d as Vt, b as qt, c as Gt, i as Yt } from "./asset-wrapper-CaHInqoM.js";
28
+ import { c as Ee, g as st } from "./_commonjsHelpers-bAxELxBV.js";
29
+ import { C as Jt, P as Xt, i as Kt } from "./collection-column-title-l4hmVo49.js";
30
+ const mt = ({ block: n, className: a }) => {
31
31
  var r, u, v;
32
32
  const { recordMap: o } = ce(), m = o.signed_urls[n.id] || ((v = (u = (r = n.properties) == null ? void 0 : r.source) == null ? void 0 : u[0]) == null ? void 0 : v[0]);
33
33
  return /* @__PURE__ */ e.createElement("div", { className: `notion-audio ${a || ""}` }, /* @__PURE__ */ e.createElement("audio", { controls: !0, preload: "none", src: m }));
34
- }, Et = (n) => {
34
+ }, dt = (n) => {
35
35
  const m = n, { className: a } = m, o = le(m, ["className"]);
36
36
  return /* @__PURE__ */ e.createElement("svg", be(W({ className: a }, o), { viewBox: "0 0 30 30" }), /* @__PURE__ */ e.createElement("path", { d: "M22,8v12c0,3.866-3.134,7-7,7s-7-3.134-7-7V8c0-2.762,2.238-5,5-5s5,2.238,5,5v12c0,1.657-1.343,3-3,3s-3-1.343-3-3V8h-2v12c0,2.762,2.238,5,5,5s5-2.238,5-5V8c0-3.866-3.134-7-7-7S6,4.134,6,8v12c0,4.971,4.029,9,9,9s9-4.029,9-9V8H22z" }));
37
- }, vt = ({ block: n, className: a }) => {
37
+ }, ut = ({ block: n, className: a }) => {
38
38
  var u, v, k, y, b;
39
39
  const { components: o, recordMap: m } = ce(), r = m.signed_urls[n.id] || ((k = (v = (u = n.properties) == null ? void 0 : u.source) == null ? void 0 : v[0]) == null ? void 0 : k[0]);
40
- return /* @__PURE__ */ e.createElement("div", { className: `notion-file ${a || ""}` }, /* @__PURE__ */ e.createElement(o.Link, { className: "notion-file-link", href: r, target: "_blank", rel: "noopener noreferrer" }, /* @__PURE__ */ e.createElement(Et, { className: "notion-file-icon" }), /* @__PURE__ */ e.createElement("div", { className: "notion-file-info" }, /* @__PURE__ */ e.createElement("div", { className: "notion-file-title" }, /* @__PURE__ */ e.createElement(C, { value: ((y = n.properties) == null ? void 0 : y.title) || [["File"]], block: n })), ((b = n.properties) == null ? void 0 : b.size) && /* @__PURE__ */ e.createElement("div", { className: "notion-file-size" }, /* @__PURE__ */ e.createElement(C, { value: n.properties.size, block: n })))));
41
- }, bt = ({ block: n, className: a }) => {
40
+ return /* @__PURE__ */ e.createElement("div", { className: `notion-file ${a || ""}` }, /* @__PURE__ */ e.createElement(o.Link, { className: "notion-file-link", href: r, target: "_blank", rel: "noopener noreferrer" }, /* @__PURE__ */ e.createElement(dt, { className: "notion-file-icon" }), /* @__PURE__ */ e.createElement("div", { className: "notion-file-info" }, /* @__PURE__ */ e.createElement("div", { className: "notion-file-title" }, /* @__PURE__ */ e.createElement(C, { value: ((y = n.properties) == null ? void 0 : y.title) || [["File"]], block: n })), ((b = n.properties) == null ? void 0 : b.size) && /* @__PURE__ */ e.createElement("div", { className: "notion-file-size" }, /* @__PURE__ */ e.createElement(C, { value: n.properties.size, block: n })))));
41
+ }, pt = ({ block: n, className: a }) => {
42
42
  var v;
43
43
  const { components: o, mapImageUrl: m } = ce(), r = (v = n.format) == null ? void 0 : v.drive_properties;
44
44
  if (!r) return null;
@@ -48,7 +48,7 @@ const gt = ({ block: n, className: a }) => {
48
48
  } catch (k) {
49
49
  }
50
50
  return /* @__PURE__ */ e.createElement("div", { className: `notion-google-drive ${a || ""}` }, /* @__PURE__ */ e.createElement(o.Link, { className: "notion-google-drive-link", href: r.url, target: "_blank", rel: "noopener noreferrer" }, /* @__PURE__ */ e.createElement("div", { className: "notion-google-drive-preview" }, /* @__PURE__ */ e.createElement(
51
- mt,
51
+ rt,
52
52
  {
53
53
  src: m(r.thumbnail, n),
54
54
  alt: r.title || "Google Drive Document",
@@ -64,10 +64,10 @@ const gt = ({ block: n, className: a }) => {
64
64
  }
65
65
  ), u && /* @__PURE__ */ e.createElement("div", { className: "notion-google-drive-body-source-domain" }, u)))));
66
66
  };
67
- var Ne, et;
68
- function ht() {
69
- if (et) return Ne;
70
- et = 1;
67
+ var Ne, Ze;
68
+ function ft() {
69
+ if (Ze) return Ne;
70
+ Ze = 1;
71
71
  var n = "Expected a function", a = NaN, o = "[object Symbol]", m = /^\s+|\s+$/g, r = /^[-+]0x[0-9a-f]+$/i, u = /^0b[01]+$/i, v = /^0o[0-7]+$/i, k = parseInt, y = typeof Ee == "object" && Ee && Ee.Object === Object && Ee, b = typeof self == "object" && self && self.Object === Object && self, _ = y || b || Function("return this")(), T = Object.prototype, O = T.toString, L = Math.max, t = Math.min, g = function() {
72
72
  return _.Date.now();
73
73
  };
@@ -155,10 +155,10 @@ function ht() {
155
155
  }
156
156
  return Ne = V, Ne;
157
157
  }
158
- var kt = ht();
159
- const Nt = /* @__PURE__ */ ft(kt), yt = ({ toc: n, activeSection: a, setActiveSection: o, pageAside: m, hasToc: r, hasAside: u, className: v }) => {
158
+ var gt = ft();
159
+ const Et = /* @__PURE__ */ st(gt), vt = ({ toc: n, activeSection: a, setActiveSection: o, pageAside: m, hasToc: r, hasAside: u, className: v }) => {
160
160
  const y = e.useMemo(
161
- () => Nt(() => {
161
+ () => Et(() => {
162
162
  const b = document.getElementsByClassName("notion-h");
163
163
  let _ = null, T = a;
164
164
  for (let O = 0; O < b.length; ++O) {
@@ -209,13 +209,13 @@ const Nt = /* @__PURE__ */ ft(kt), yt = ({ toc: n, activeSection: a, setActiveSe
209
209
  )
210
210
  );
211
211
  }))), m) : null;
212
- }, _t = ({ block: n, level: a }) => {
212
+ }, bt = ({ block: n, level: a }) => {
213
213
  var r, u;
214
214
  if (!n)
215
215
  return process.env.NODE_ENV !== "production" && console.warn("missing sync pointer block", n.id), null;
216
216
  const o = n, m = (u = (r = o == null ? void 0 : o.format) == null ? void 0 : r.transclusion_reference_pointer) == null ? void 0 : u.id;
217
217
  return m ? /* @__PURE__ */ e.createElement(ye, { key: m, level: a, blockId: m }) : null;
218
- }, $t = (n) => {
218
+ }, ht = (n) => {
219
219
  const m = n, { className: a } = m, o = le(m, ["className"]);
220
220
  return /* @__PURE__ */ e.createElement("svg", be(W({ className: a }, o), { viewBox: "0 0 16 16", width: "16", height: "16" }), /* @__PURE__ */ e.createElement(
221
221
  "path",
@@ -224,8 +224,8 @@ const Nt = /* @__PURE__ */ ft(kt), yt = ({ toc: n, activeSection: a, setActiveSe
224
224
  d: "M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"
225
225
  }
226
226
  ));
227
- }, tt = {}, nt = {}, Ct = (n) => {
228
- var x, S, H, te, A, G, Y, se, me, ne, z, oe, de, ue, Z, E, P, F, ae, _e, $e, Ce, xe, we, Ie, Le, Pe, Te, Se, je, Oe, Be, Me, He, Ae, Fe, De, Re, ze, Ue, We, Ve, qe;
227
+ }, Je = {}, Xe = {}, kt = (n) => {
228
+ var x, S, H, te, A, G, Y, se, me, ne, z, oe, de, ue, Z, E, P, F, ae, _e, $e, Ce, xe, we, Ie, Le, Pe, Te, Se, je, Oe, Be, Me, He, Ae, Fe, De, Re;
229
229
  const a = ce(), {
230
230
  components: o,
231
231
  fullPage: m,
@@ -273,13 +273,13 @@ const Nt = /* @__PURE__ */ ft(kt), yt = ({ toc: n, activeSection: a, setActiveSe
273
273
  } = t.format || {};
274
274
  if (m) {
275
275
  const $ = t.type === "page" ? t.properties : {
276
- title: (S = (x = r.collection[it(t, r)]) == null ? void 0 : x.value) == null ? void 0 : S.name
276
+ title: (S = (x = r.collection[nt(t, r)]) == null ? void 0 : x.value) == null ? void 0 : S.name
277
277
  }, D = `center ${(1 - (p || 0.5)) * 100}%`;
278
- let j = nt[D];
279
- j || (j = nt[D] = {
278
+ let j = Xe[D];
279
+ j || (j = Xe[D] = {
280
280
  objectPosition: D
281
281
  });
282
- const X = (H = ct(t, r)) != null ? H : b, U = X && st(X), re = he(t, r), pe = k && re.length >= y, K = (pe || h) && !d, fe = N || s;
282
+ const X = (H = ot(t, r)) != null ? H : b, U = X && at(X), re = he(t, r), pe = k && re.length >= y, K = (pe || h) && !d, fe = N || s;
283
283
  return /* @__PURE__ */ e.createElement("div", { className: `notion notion-app ${c} ${V || ""}` }, /* @__PURE__ */ e.createElement("div", { className: "notion-viewport" }), /* @__PURE__ */ e.createElement("div", { className: "notion-frame" }, !q && /* @__PURE__ */ e.createElement(o.Header, { block: t }), Q, /* @__PURE__ */ e.createElement("div", { className: "notion-page-scroller" }, fe && (N || /* @__PURE__ */ e.createElement("div", { className: "notion-page-cover-wrapper" }, /* @__PURE__ */ e.createElement(
284
284
  ke,
285
285
  {
@@ -301,7 +301,7 @@ const Nt = /* @__PURE__ */ ft(kt), yt = ({ toc: n, activeSection: a, setActiveSe
301
301
  ${w && "notion-small-text"}
302
302
  ${M}`
303
303
  },
304
- l && /* @__PURE__ */ e.createElement(Ke, { block: t, defaultIcon: b, inline: !1 }),
304
+ l && /* @__PURE__ */ e.createElement(Ge, { block: t, defaultIcon: b, inline: !1 }),
305
305
  R,
306
306
  /* @__PURE__ */ e.createElement("h1", { className: "notion-title" }, f != null ? f : /* @__PURE__ */ e.createElement(C, { value: $ == null ? void 0 : $.title, block: t })),
307
307
  (t.type === "collection_view_page" || t.type === "page" && t.parent_table === "collection") && /* @__PURE__ */ e.createElement(o.Collection, { block: t, ctx: a }),
@@ -314,7 +314,7 @@ const Nt = /* @__PURE__ */ ft(kt), yt = ({ toc: n, activeSection: a, setActiveSe
314
314
  },
315
315
  /* @__PURE__ */ e.createElement("article", { className: "notion-page-content-inner" }, g),
316
316
  K && /* @__PURE__ */ e.createElement(
317
- yt,
317
+ vt,
318
318
  {
319
319
  toc: re,
320
320
  activeSection: O,
@@ -353,7 +353,7 @@ const Nt = /* @__PURE__ */ ft(kt), yt = ({ toc: n, activeSection: a, setActiveSe
353
353
  className: `notion-page-link ${l && `notion-${l}`} ${c}`,
354
354
  href: u(t.id)
355
355
  },
356
- /* @__PURE__ */ e.createElement(Xe, { block: t })
356
+ /* @__PURE__ */ e.createElement(qe, { block: t })
357
357
  );
358
358
  }
359
359
  case "header":
@@ -363,12 +363,12 @@ const Nt = /* @__PURE__ */ ft(kt), yt = ({ toc: n, activeSection: a, setActiveSe
363
363
  case "sub_sub_header": {
364
364
  if (!t.properties) return null;
365
365
  const l = (A = t.format) == null ? void 0 : A.block_color, s = ve(t.id), p = ie(t.properties.title) || `Notion Header ${s}`;
366
- let d = tt[t.id], w;
366
+ let d = Je[t.id], w;
367
367
  if (d === void 0) {
368
- const re = Je(t, r);
368
+ const re = Ve(t, r);
369
369
  if (re) {
370
370
  const K = he(re, r).find((fe) => fe.id === t.id);
371
- K && (d = K.indentLevel, tt[t.id] = d);
371
+ K && (d = K.indentLevel, Je[t.id] = d);
372
372
  }
373
373
  }
374
374
  d !== void 0 && (w = `notion-h-indent-${d}`);
@@ -377,7 +377,7 @@ const Nt = /* @__PURE__ */ ft(kt), yt = ({ toc: n, activeSection: a, setActiveSe
377
377
  ${D && "notion-h notion-h3"}
378
378
  ${l && `notion-${l}`}
379
379
  ${w},
380
- ${c}`, X = /* @__PURE__ */ e.createElement("span", null, /* @__PURE__ */ e.createElement("div", { id: s, className: "notion-header-anchor" }), !((G = t.format) != null && G.toggleable) && /* @__PURE__ */ e.createElement("a", { className: "notion-hash-link", href: `#${s}`, title: p }, /* @__PURE__ */ e.createElement($t, null)), /* @__PURE__ */ e.createElement("span", { className: "notion-h-title" }, /* @__PURE__ */ e.createElement(C, { value: t.properties.title, block: t })));
380
+ ${c}`, X = /* @__PURE__ */ e.createElement("span", null, /* @__PURE__ */ e.createElement("div", { id: s, className: "notion-header-anchor" }), !((G = t.format) != null && G.toggleable) && /* @__PURE__ */ e.createElement("a", { className: "notion-hash-link", href: `#${s}`, title: p }, /* @__PURE__ */ e.createElement(ht, null)), /* @__PURE__ */ e.createElement("span", { className: "notion-h-title" }, /* @__PURE__ */ e.createElement(C, { value: t.properties.title, block: t })));
381
381
  let U = null;
382
382
  return $ ? U = /* @__PURE__ */ e.createElement("h2", { className: j, "data-id": s }, X) : J ? U = /* @__PURE__ */ e.createElement("h3", { className: j, "data-id": s }, X) : U = /* @__PURE__ */ e.createElement("h4", { className: j, "data-id": s }, X), (Y = t.format) != null && Y.toggleable ? /* @__PURE__ */ e.createElement("details", { className: `notion-toggle ${c}` }, /* @__PURE__ */ e.createElement("summary", null, U), /* @__PURE__ */ e.createElement("div", null, g)) : U;
383
383
  }
@@ -394,7 +394,7 @@ const Nt = /* @__PURE__ */ ft(kt), yt = ({ toc: n, activeSection: a, setActiveSe
394
394
  const l = (w, $) => t.type === "bulleted_list" ? /* @__PURE__ */ e.createElement("ul", { className: `notion-list notion-list-disc ${c}` }, w) : /* @__PURE__ */ e.createElement("ol", { start: $, className: `notion-list notion-list-numbered ${c}` }, w);
395
395
  let s = null;
396
396
  t.content ? s = /* @__PURE__ */ e.createElement(e.Fragment, null, t.properties && /* @__PURE__ */ e.createElement("li", null, /* @__PURE__ */ e.createElement(C, { value: t.properties.title, block: t })), l(g)) : s = t.properties ? /* @__PURE__ */ e.createElement("li", null, /* @__PURE__ */ e.createElement(C, { value: t.properties.title, block: t })) : null;
397
- const p = t.type !== ((oe = (z = r.block[t.parent_id]) == null ? void 0 : z.value) == null ? void 0 : oe.type), d = ut(t.id, r.block);
397
+ const p = t.type !== ((oe = (z = r.block[t.parent_id]) == null ? void 0 : z.value) == null ? void 0 : oe.type), d = it(t.id, r.block);
398
398
  return p ? l(s, d) : s;
399
399
  }
400
400
  case "embed":
@@ -418,13 +418,13 @@ const Nt = /* @__PURE__ */ ft(kt), yt = ({ toc: n, activeSection: a, setActiveSe
418
418
  case "gist":
419
419
  // fallthrough
420
420
  case "video":
421
- return /* @__PURE__ */ e.createElement(Qe, { blockId: c, block: t });
421
+ return /* @__PURE__ */ e.createElement(Ye, { blockId: c, block: t });
422
422
  case "drive":
423
- return !((de = t.format) == null ? void 0 : de.drive_properties) && (ue = t.format) != null && ue.display_source ? /* @__PURE__ */ e.createElement(Qe, { blockId: c, block: t }) : /* @__PURE__ */ e.createElement(bt, { block: t, className: c });
423
+ return !((de = t.format) == null ? void 0 : de.drive_properties) && (ue = t.format) != null && ue.display_source ? /* @__PURE__ */ e.createElement(Ye, { blockId: c, block: t }) : /* @__PURE__ */ e.createElement(pt, { block: t, className: c });
424
424
  case "audio":
425
- return /* @__PURE__ */ e.createElement(gt, { block: t, className: c });
425
+ return /* @__PURE__ */ e.createElement(mt, { block: t, className: c });
426
426
  case "file":
427
- return /* @__PURE__ */ e.createElement(vt, { block: t, className: c });
427
+ return /* @__PURE__ */ e.createElement(ut, { block: t, className: c });
428
428
  case "equation":
429
429
  return /* @__PURE__ */ e.createElement(o.Equation, { block: t, inline: !1, className: c });
430
430
  case "code":
@@ -448,7 +448,7 @@ const Nt = /* @__PURE__ */ ft(kt), yt = ({ toc: n, activeSection: a, setActiveSe
448
448
  {
449
449
  className: `notion-callout ${((ae = t.format) == null ? void 0 : ae.block_color) && `notion-${(_e = t.format) == null ? void 0 : _e.block_color}_co`} ${c}`
450
450
  },
451
- /* @__PURE__ */ e.createElement(Ke, { block: t }),
451
+ /* @__PURE__ */ e.createElement(Ge, { block: t }),
452
452
  /* @__PURE__ */ e.createElement("div", { className: "notion-callout-text" }, /* @__PURE__ */ e.createElement(C, { value: ($e = t.properties) == null ? void 0 : $e.title, block: t }), g)
453
453
  );
454
454
  case "bookmark": {
@@ -462,17 +462,17 @@ const Nt = /* @__PURE__ */ ft(kt), yt = ({ toc: n, activeSection: a, setActiveSe
462
462
  } catch (p) {
463
463
  }
464
464
  return /* @__PURE__ */ e.createElement(
465
- o.Link,
465
+ "a",
466
466
  {
467
467
  target: "_blank",
468
468
  rel: "noopener noreferrer",
469
- className: `notion-bookmark ${((xe = t.format) == null ? void 0 : xe.block_color) && `notion-${t.format.block_color}`} ${c}`,
469
+ className: `notion-bookmark ${(xe = t.format) != null && xe.block_color ? `notion-${t.format.block_color}` : ""} ${c}`,
470
470
  href: l[0][0]
471
471
  },
472
- /* @__PURE__ */ e.createElement("div", null, s && /* @__PURE__ */ e.createElement("div", { className: "notion-bookmark-title" }, /* @__PURE__ */ e.createElement(C, { value: [[s]], block: t })), ((we = t.properties) == null ? void 0 : we.description) && /* @__PURE__ */ e.createElement("div", { className: "notion-bookmark-description" }, /* @__PURE__ */ e.createElement(C, { value: (Ie = t.properties) == null ? void 0 : Ie.description, block: t })), /* @__PURE__ */ e.createElement("div", { className: "notion-bookmark-link" }, ((Le = t.format) == null ? void 0 : Le.bookmark_icon) && /* @__PURE__ */ e.createElement("div", { className: "notion-bookmark-link-icon" }, /* @__PURE__ */ e.createElement(
472
+ /* @__PURE__ */ e.createElement("div", null, s && /* @__PURE__ */ e.createElement("div", { className: "notion-bookmark-title" }, /* @__PURE__ */ e.createElement(C, { value: [[s]], block: t })), t.properties.description && /* @__PURE__ */ e.createElement("div", { className: "notion-bookmark-description" }, /* @__PURE__ */ e.createElement(C, { value: t.properties.description, block: t })), /* @__PURE__ */ e.createElement("div", { className: "notion-bookmark-link" }, ((we = t.format) == null ? void 0 : we.bookmark_icon) && /* @__PURE__ */ e.createElement("div", { className: "notion-bookmark-link-icon" }, /* @__PURE__ */ e.createElement(
473
473
  ke,
474
474
  {
475
- src: v((Pe = t.format) == null ? void 0 : Pe.bookmark_icon, t),
475
+ src: v(t.format.bookmark_icon, t),
476
476
  alt: s,
477
477
  onError: (p) => {
478
478
  const d = p.currentTarget.closest(".notion-bookmark-link-icon");
@@ -480,11 +480,11 @@ const Nt = /* @__PURE__ */ ft(kt), yt = ({ toc: n, activeSection: a, setActiveSe
480
480
  }
481
481
  }
482
482
  )), /* @__PURE__ */ e.createElement("div", { className: "notion-bookmark-link-text" }, /* @__PURE__ */ e.createElement(C, { value: l, block: t })))),
483
- ((Te = t.format) == null ? void 0 : Te.bookmark_cover) && /* @__PURE__ */ e.createElement("div", { className: "notion-bookmark-image" }, /* @__PURE__ */ e.createElement(
483
+ ((Ie = t.format) == null ? void 0 : Ie.bookmark_cover) && /* @__PURE__ */ e.createElement("div", { className: "notion-bookmark-image" }, /* @__PURE__ */ e.createElement(
484
484
  ke,
485
485
  {
486
- src: v((Se = t.format) == null ? void 0 : Se.bookmark_cover, t),
487
- alt: ie((je = t.properties) == null ? void 0 : je.title),
486
+ src: v(t.format.bookmark_cover, t),
487
+ alt: ie(t.properties.title),
488
488
  style: {
489
489
  objectFit: "cover"
490
490
  },
@@ -497,11 +497,11 @@ const Nt = /* @__PURE__ */ ft(kt), yt = ({ toc: n, activeSection: a, setActiveSe
497
497
  );
498
498
  }
499
499
  case "toggle":
500
- return /* @__PURE__ */ e.createElement("details", { className: `notion-toggle ${c}` }, /* @__PURE__ */ e.createElement("summary", null, /* @__PURE__ */ e.createElement(C, { value: (Oe = t.properties) == null ? void 0 : Oe.title, block: t })), /* @__PURE__ */ e.createElement("div", null, g));
500
+ return /* @__PURE__ */ e.createElement("details", { className: `notion-toggle ${c}` }, /* @__PURE__ */ e.createElement("summary", null, /* @__PURE__ */ e.createElement(C, { value: (Le = t.properties) == null ? void 0 : Le.title, block: t })), /* @__PURE__ */ e.createElement("div", null, g));
501
501
  case "table_of_contents": {
502
- const l = Je(t, r);
502
+ const l = Ve(t, r);
503
503
  if (!l) return null;
504
- const s = he(l, r), p = (Be = t.format) == null ? void 0 : Be.block_color;
504
+ const s = he(l, r), p = (Pe = t.format) == null ? void 0 : Pe.block_color;
505
505
  return /* @__PURE__ */ e.createElement("div", { className: `notion-table-of-contents ${p && `notion-${p}`} ${c}` }, s.map((d) => /* @__PURE__ */ e.createElement("a", { key: d.id, href: `#${ve(d.id)}`, className: "notion-table-of-contents-item" }, /* @__PURE__ */ e.createElement(
506
506
  "span",
507
507
  {
@@ -515,21 +515,21 @@ const Nt = /* @__PURE__ */ ft(kt), yt = ({ toc: n, activeSection: a, setActiveSe
515
515
  ))));
516
516
  }
517
517
  case "to_do": {
518
- const l = ((Ae = (He = (Me = t.properties) == null ? void 0 : Me.checked) == null ? void 0 : He[0]) == null ? void 0 : Ae[0]) === "Yes";
519
- return /* @__PURE__ */ e.createElement("div", { className: `notion-to-do ${c}` }, /* @__PURE__ */ e.createElement("div", { className: "notion-to-do-item" }, /* @__PURE__ */ e.createElement(o.Checkbox, { blockId: c, isChecked: l }), /* @__PURE__ */ e.createElement("div", { className: `notion-to-do-body ${l && "notion-to-do-checked"}` }, /* @__PURE__ */ e.createElement(C, { value: (Fe = t.properties) == null ? void 0 : Fe.title, block: t }))), /* @__PURE__ */ e.createElement("div", { className: "notion-to-do-children" }, g));
518
+ const l = ((je = (Se = (Te = t.properties) == null ? void 0 : Te.checked) == null ? void 0 : Se[0]) == null ? void 0 : je[0]) === "Yes";
519
+ return /* @__PURE__ */ e.createElement("div", { className: `notion-to-do ${c}` }, /* @__PURE__ */ e.createElement("div", { className: "notion-to-do-item" }, /* @__PURE__ */ e.createElement(o.Checkbox, { blockId: c, isChecked: l }), /* @__PURE__ */ e.createElement("div", { className: `notion-to-do-body ${l && "notion-to-do-checked"}` }, /* @__PURE__ */ e.createElement(C, { value: (Oe = t.properties) == null ? void 0 : Oe.title, block: t }))), /* @__PURE__ */ e.createElement("div", { className: "notion-to-do-children" }, g));
520
520
  }
521
521
  case "transclusion_container":
522
522
  return /* @__PURE__ */ e.createElement("div", { className: `notion-sync-block ${c}` }, g);
523
523
  case "transclusion_reference":
524
- return /* @__PURE__ */ e.createElement(_t, W({ block: t, level: B + 1 }, n));
524
+ return /* @__PURE__ */ e.createElement(bt, W({ block: t, level: B + 1 }, n));
525
525
  case "alias": {
526
- const l = (Re = (De = t == null ? void 0 : t.format) == null ? void 0 : De.alias_pointer) == null ? void 0 : Re.id, s = (ze = r.block[l]) == null ? void 0 : ze.value;
527
- return s ? /* @__PURE__ */ e.createElement(o.PageLink, { className: `notion-page-link ${l}}`, href: u(l) }, /* @__PURE__ */ e.createElement(Xe, { block: s })) : (console.debug('"alias" missing block', l), null);
526
+ const l = (Me = (Be = t == null ? void 0 : t.format) == null ? void 0 : Be.alias_pointer) == null ? void 0 : Me.id, s = (He = r.block[l]) == null ? void 0 : He.value;
527
+ return s ? /* @__PURE__ */ e.createElement(o.PageLink, { className: `notion-page-link ${l}}`, href: u(l) }, /* @__PURE__ */ e.createElement(qe, { block: s })) : (console.debug('"alias" missing block', l), null);
528
528
  }
529
529
  case "table":
530
530
  return /* @__PURE__ */ e.createElement("table", { className: `notion-simple-table ${c}` }, /* @__PURE__ */ e.createElement("tbody", null, g));
531
531
  case "table_row": {
532
- const l = (Ue = r.block[t.parent_id]) == null ? void 0 : Ue.value, s = (We = l.format) == null ? void 0 : We.table_block_column_order, p = (Ve = l.format) == null ? void 0 : Ve.table_block_column_format, d = (qe = t.format) == null ? void 0 : qe.block_color;
532
+ const l = (Ae = r.block[t.parent_id]) == null ? void 0 : Ae.value, s = (Fe = l.format) == null ? void 0 : Fe.table_block_column_order, p = (De = l.format) == null ? void 0 : De.table_block_column_format, d = (Re = t.format) == null ? void 0 : Re.block_color;
533
533
  return !l || !s ? null : /* @__PURE__ */ e.createElement("tr", { className: `notion-simple-table-row ${d && `notion-${d}`} ${c}` }, s.map((w) => {
534
534
  var J, D, j;
535
535
  const $ = (J = p == null ? void 0 : p[w]) == null ? void 0 : J.color;
@@ -547,11 +547,11 @@ const Nt = /* @__PURE__ */ ft(kt), yt = ({ toc: n, activeSection: a, setActiveSe
547
547
  }));
548
548
  }
549
549
  case "external_object_instance":
550
- return /* @__PURE__ */ e.createElement(dt, { block: t, className: c });
550
+ return /* @__PURE__ */ e.createElement(lt, { block: t, className: c });
551
551
  default:
552
552
  return process.env.NODE_ENV !== "production" && console.debug("Unsupported type " + t.type, JSON.stringify(t, null, 2)), /* @__PURE__ */ e.createElement("div", null);
553
553
  }
554
- }, jt = (h) => {
554
+ }, It = (h) => {
555
555
  var N = h, {
556
556
  components: n,
557
557
  recordMap: a,
@@ -602,15 +602,15 @@ const Nt = /* @__PURE__ */ ft(kt), yt = ({ toc: n, activeSection: a, setActiveSe
602
602
  "defaultPageCoverPosition"
603
603
  ]);
604
604
  const I = e.useMemo(
605
- () => typeof window != "undefined" && lt({
605
+ () => typeof window != "undefined" && tt({
606
606
  background: "rgba(0, 0, 0, 0.8)",
607
607
  minZoomScale: 2,
608
- margin: xt()
608
+ margin: Nt()
609
609
  }),
610
610
  []
611
611
  );
612
612
  return /* @__PURE__ */ e.createElement(
613
- pt,
613
+ ct,
614
614
  {
615
615
  components: n,
616
616
  recordMap: a,
@@ -642,49 +642,49 @@ const Nt = /* @__PURE__ */ ft(kt), yt = ({ toc: n, activeSection: a, setActiveSe
642
642
  var r = m, { level: n = 0, blockId: a } = r, o = le(r, ["level", "blockId"]);
643
643
  var y, b;
644
644
  const { recordMap: u } = ce(), v = a || Object.keys(u.block)[0], k = (y = u.block[v]) == null ? void 0 : y.value;
645
- return k ? /* @__PURE__ */ e.createElement(Ct, W({ key: v, level: n, block: k }, o), (b = k == null ? void 0 : k.content) == null ? void 0 : b.map((_) => /* @__PURE__ */ e.createElement(ye, W({ key: _, blockId: _, level: n + 1 }, o)))) : (process.env.NODE_ENV !== "production" && console.warn("missing block", a), null);
645
+ return k ? /* @__PURE__ */ e.createElement(kt, W({ key: v, level: n, block: k }, o), (b = k == null ? void 0 : k.content) == null ? void 0 : b.map((_) => /* @__PURE__ */ e.createElement(ye, W({ key: _, blockId: _, level: n + 1 }, o)))) : (process.env.NODE_ENV !== "production" && console.warn("missing block", a), null);
646
646
  };
647
- function xt() {
647
+ function Nt() {
648
648
  const n = window.innerWidth;
649
649
  return n < 500 ? 8 : n < 800 ? 20 : n < 1280 ? 30 : n < 1600 ? 40 : n < 1920 ? 48 : 72;
650
650
  }
651
651
  export {
652
- Dt as Asset,
653
- Qe as AssetWrapper,
654
- gt as Audio,
655
- Ct as Block,
656
- Rt as Breadcrumbs,
657
- zt as Checkbox,
658
- tn as CollectionColumnTitle,
659
- dt as EOI,
660
- vt as File,
661
- bt as GoogleDrive,
662
- mt as GracefulImage,
663
- Ut as Header,
664
- Wt as LiteYouTubeEmbed,
652
+ Bt as Asset,
653
+ Ye as AssetWrapper,
654
+ mt as Audio,
655
+ kt as Block,
656
+ Mt as Breadcrumbs,
657
+ Ht as Checkbox,
658
+ Jt as CollectionColumnTitle,
659
+ lt as EOI,
660
+ ut as File,
661
+ pt as GoogleDrive,
662
+ rt as GracefulImage,
663
+ At as Header,
664
+ Ft as LiteYouTubeEmbed,
665
665
  ye as NotionBlockRenderer,
666
- Vt as NotionContextConsumer,
667
- pt as NotionContextProvider,
668
- jt as NotionRenderer,
669
- yt as PageAside,
670
- Ke as PageIcon,
671
- qt as PageIconImpl,
672
- Xe as PageTitle,
673
- Gt as PageTitleImpl,
674
- nn as PropertyIcon,
675
- Yt as Search,
676
- Zt as SearchDialog,
677
- _t as SyncPointerBlock,
666
+ Dt as NotionContextConsumer,
667
+ ct as NotionContextProvider,
668
+ It as NotionRenderer,
669
+ vt as PageAside,
670
+ Ge as PageIcon,
671
+ Rt as PageIconImpl,
672
+ qe as PageTitle,
673
+ zt as PageTitleImpl,
674
+ Xt as PropertyIcon,
675
+ Ut as Search,
676
+ Wt as SearchDialog,
677
+ bt as SyncPointerBlock,
678
678
  C as Text,
679
- Jt as dummyLink,
680
- Mt as formatDate,
681
- Ht as formatNotionDateTime,
682
- Xt as getHashFragmentValue,
683
- ut as getListNumber,
684
- Kt as getYoutubeId,
685
- on as iconMap,
686
- Qt as isBrowser,
687
- At as isUrl,
679
+ Vt as dummyLink,
680
+ Tt as formatDate,
681
+ St as formatNotionDateTime,
682
+ qt as getHashFragmentValue,
683
+ it as getListNumber,
684
+ Gt as getYoutubeId,
685
+ Kt as iconMap,
686
+ Yt as isBrowser,
687
+ jt as isUrl,
688
688
  ce as useNotionContext
689
689
  };
690
690
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/components/audio.tsx","../src/icons/file-icon.tsx","../src/components/file.tsx","../src/components/google-drive.tsx","../../../node_modules/.pnpm/lodash.throttle@4.1.1/node_modules/lodash.throttle/index.js","../src/components/page-aside.tsx","../src/components/sync-pointer-block.tsx","../src/icons/link-icon.tsx","../src/block.tsx","../src/renderer.tsx"],"sourcesContent":["import React from 'react'\n\nimport { AudioBlock } from '@texonom/ntypes'\n\nimport { useNotionContext } from '../context'\n\nexport const Audio: React.FC<{\n block: AudioBlock\n className?: string\n}> = ({ block, className }) => {\n const { recordMap } = useNotionContext()\n const source = recordMap.signed_urls[block.id] || block.properties?.source?.[0]?.[0]\n\n return (\n <div className={`notion-audio ${className || ''}`}>\n <audio controls preload='none' src={source} />\n </div>\n )\n}\n","import React from 'react'\n\nexport const FileIcon = props => {\n const { className, ...rest } = props\n return (\n <svg className={className} {...rest} viewBox='0 0 30 30'>\n <path d='M22,8v12c0,3.866-3.134,7-7,7s-7-3.134-7-7V8c0-2.762,2.238-5,5-5s5,2.238,5,5v12c0,1.657-1.343,3-3,3s-3-1.343-3-3V8h-2v12c0,2.762,2.238,5,5,5s5-2.238,5-5V8c0-3.866-3.134-7-7-7S6,4.134,6,8v12c0,4.971,4.029,9,9,9s9-4.029,9-9V8H22z'></path>\n </svg>\n )\n}\n","import React from 'react'\n\nimport { FileBlock } from '@texonom/ntypes'\n\nimport { useNotionContext } from '../context'\nimport { FileIcon } from '../icons/file-icon'\nimport { Text } from './text'\n\nexport const File: React.FC<{\n block: FileBlock\n className?: string\n}> = ({ block, className }) => {\n const { components, recordMap } = useNotionContext()\n const source = recordMap.signed_urls[block.id] || block.properties?.source?.[0]?.[0]\n\n return (\n <div className={`notion-file ${className || ''}`}>\n <components.Link className='notion-file-link' href={source} target='_blank' rel='noopener noreferrer'>\n <FileIcon className='notion-file-icon' />\n\n <div className='notion-file-info'>\n <div className='notion-file-title'>\n <Text value={block.properties?.title || [['File']]} block={block} />\n </div>\n\n {block.properties?.size && (\n <div className='notion-file-size'>\n <Text value={block.properties.size} block={block} />\n </div>\n )}\n </div>\n </components.Link>\n </div>\n )\n}\n","import React from 'react'\n\nimport { GoogleDriveBlock } from '@texonom/ntypes'\n\nimport { useNotionContext } from '../context'\nimport { GracefulImage } from './graceful-image'\n\nexport const GoogleDrive: React.FC<{\n block: GoogleDriveBlock\n className?: string\n}> = ({ block, className }) => {\n const { components, mapImageUrl } = useNotionContext()\n const properties = block.format?.drive_properties\n if (!properties) return null\n let domain\n\n try {\n const url = new URL(properties.url)\n domain = url.hostname\n } catch (err) {\n // ignore invalid urls for robustness\n }\n\n return (\n <div className={`notion-google-drive ${className || ''}`}>\n <components.Link className='notion-google-drive-link' href={properties.url} target='_blank' rel='noopener noreferrer'>\n <div className='notion-google-drive-preview'>\n <GracefulImage\n src={mapImageUrl(properties.thumbnail, block)}\n alt={properties.title || 'Google Drive Document'}\n loading='lazy'\n />\n </div>\n\n <div className='notion-google-drive-body'>\n {properties.title && <div className='notion-google-drive-body-title'>{properties.title}</div>}\n\n {/* TODO: re-add last modified time with alternative to timeago.js */}\n {/* {properties.modified_time && (\n <div className='notion-google-drive-body-modified-time'>\n Last modified{' '}\n {properties.user_name ? `by ${properties.user_name} ` : ''}\n {timeago(properties.modified_time)}\n </div>\n )} */}\n\n {properties.icon && domain && (\n <div className='notion-google-drive-body-source'>\n {properties.icon && (\n <div\n className='notion-google-drive-body-source-icon'\n style={{\n backgroundImage: `url(${properties.icon})`\n }}\n />\n )}\n\n {domain && <div className='notion-google-drive-body-source-domain'>{domain}</div>}\n </div>\n )}\n </div>\n </components.Link>\n </div>\n )\n}\n","/**\n * lodash (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors <https://jquery.org/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/** Used to match leading and trailing whitespace. */\nvar reTrim = /^\\s+|\\s+$/g;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n result = wait - timeSinceLastCall;\n\n return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\n/**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide `options` to indicate whether `func`\n * should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return the\n * result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the throttled function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=true]\n * Specify invoking on the leading edge of the timeout.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // Avoid excessively updating the position while scrolling.\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.\n * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });\n * jQuery(element).on('click', throttled);\n *\n * // Cancel the trailing throttled invocation.\n * jQuery(window).on('popstate', throttled.cancel);\n */\nfunction throttle(func, wait, options) {\n var leading = true,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (isObject(options)) {\n leading = 'leading' in options ? !!options.leading : leading;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n return debounce(func, wait, {\n 'leading': leading,\n 'maxWait': wait,\n 'trailing': trailing\n });\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = value.replace(reTrim, '');\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = throttle;\n","import React from 'react'\n\nimport throttle from 'lodash.throttle'\nimport { TableOfContentsEntry, uuidToId } from '@texonom/nutils'\n\nexport const PageAside: React.FC<{\n toc: Array<TableOfContentsEntry>\n activeSection: string | null\n setActiveSection: (activeSection: string | null) => unknown\n hasToc: boolean\n hasAside: boolean\n pageAside?: React.ReactNode\n className?: string\n}> = ({ toc, activeSection, setActiveSection, pageAside, hasToc, hasAside, className }) => {\n const throttleMs = 100\n const actionSectionScrollSpy = React.useMemo(\n () =>\n throttle(() => {\n const sections = document.getElementsByClassName('notion-h')\n\n let prevBBox: DOMRect = null\n let currentSectionId = activeSection\n\n for (let i = 0; i < sections.length; ++i) {\n const section = sections[i]\n if (!section || !(section instanceof Element)) continue\n\n if (!currentSectionId) currentSectionId = section.getAttribute('data-id')\n\n const bbox = section.getBoundingClientRect()\n const prevHeight = prevBBox ? bbox.top - prevBBox.bottom : 0\n const offset = Math.max(150, prevHeight / 4)\n\n // GetBoundingClientRect returns values relative to the viewport\n if (bbox.top - offset < 0) {\n currentSectionId = section.getAttribute('data-id')\n\n prevBBox = bbox\n continue\n }\n\n // No need to continue loop, if last element has been detected\n break\n }\n\n setActiveSection(currentSectionId)\n }, throttleMs),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n // explicitly not taking a dependency on activeSection\n setActiveSection\n ]\n )\n\n React.useEffect(() => {\n if (!hasToc) return\n\n window.addEventListener('scroll', actionSectionScrollSpy)\n\n actionSectionScrollSpy()\n\n return () => {\n window.removeEventListener('scroll', actionSectionScrollSpy)\n }\n }, [hasToc, actionSectionScrollSpy])\n\n if (!hasAside) return null\n\n return (\n <aside className={`notion-aside ${className || ''}`}>\n {hasToc && (\n <div className='notion-aside-table-of-contents'>\n <div className='notion-aside-table-of-contents-header'>Table of Contents</div>\n\n <nav className='notion-table-of-contents'>\n {toc.map(tocItem => {\n const id = uuidToId(tocItem.id)\n\n return (\n <a\n key={id}\n href={`#${id}`}\n className={`notion-table-of-contents-item\n notion-table-of-contents-item-indent-level-${tocItem.indentLevel}\n ${activeSection === id && 'notion-table-of-contents-active-item'}`}>\n <span\n className='notion-table-of-contents-item-body'\n style={{\n display: 'inline-block',\n marginLeft: tocItem.indentLevel * 16\n }}>\n {tocItem.text}\n </span>\n </a>\n )\n })}\n </nav>\n </div>\n )}\n\n {pageAside}\n </aside>\n )\n}\n","import React from 'react'\n\nimport { NotionBlockRenderer } from '../renderer'\n\nimport type { Block as BlockType, SyncPointerBlock as SyncPointerBlockType } from '@texonom/ntypes'\n\nexport const SyncPointerBlock: React.FC<{\n block: BlockType\n level: number\n}> = ({ block, level }) => {\n if (!block) {\n if (process.env.NODE_ENV !== 'production') console.warn('missing sync pointer block', block.id)\n\n return null\n }\n\n const syncPointerBlock = block as SyncPointerBlockType\n const referencePointerId = syncPointerBlock?.format?.transclusion_reference_pointer?.id\n\n if (!referencePointerId) return null\n\n return <NotionBlockRenderer key={referencePointerId} level={level} blockId={referencePointerId} />\n}\n","import React from 'react'\n\nexport const LinkIcon = props => {\n const { className, ...rest } = props\n return (\n <svg className={className} {...rest} viewBox='0 0 16 16' width='16' height='16'>\n <path\n fillRule='evenodd'\n d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'\n />\n </svg>\n )\n}\n","import React from 'react'\n\nimport {\n getBlockCollectionId,\n getBlockIcon,\n getBlockParentPage,\n getPageTableOfContents,\n getTextContent,\n uuidToId\n} from '@texonom/nutils'\n\nimport { AssetWrapper } from './components/asset-wrapper'\nimport { Audio } from './components/audio'\nimport { EOI } from './components/eoi'\nimport { File } from './components/file'\nimport { GoogleDrive } from './components/google-drive'\nimport { LazyImage } from './components/lazy-image'\nimport { PageAside } from './components/page-aside'\nimport { PageIcon } from './components/page-icon'\nimport { PageTitle } from './components/page-title'\nimport { SyncPointerBlock } from './components/sync-pointer-block'\nimport { Text } from './components/text'\nimport { useNotionContext } from './context'\nimport { LinkIcon } from './icons/link-icon'\nimport { getListNumber, isUrl } from './utils'\n\nimport type {\n Block as BlockType,\n PageBlock,\n GoogleDriveBlock,\n AudioBlock,\n FileBlock,\n EquationBlock,\n CollectionViewPageBlock,\n CodeBlock,\n TableBlock\n} from '@texonom/ntypes'\ninterface BlockProps {\n block: BlockType\n level: number\n\n className?: string\n bodyClassName?: string\n\n header?: React.ReactNode\n footer?: React.ReactNode\n pageHeader?: React.ReactNode\n pageFooter?: React.ReactNode\n pageTitle?: React.ReactNode\n pageAside?: React.ReactNode\n pageCover?: React.ReactNode\n\n hideBlockId?: boolean\n disableHeader?: boolean\n\n children?: React.ReactNode\n}\n\n// TODO: use react state instead of a global for this\nconst tocIndentLevelCache: {\n [blockId: string]: number\n} = {}\n\nconst pageCoverStyleCache: Record<string, object> = {}\n\nexport const Block: React.FC<BlockProps> = props => {\n const ctx = useNotionContext()\n const {\n components,\n fullPage,\n recordMap,\n mapPageUrl,\n mapImageUrl,\n showTableOfContents,\n minTableOfContentsItems,\n defaultPageIcon,\n defaultPageCover,\n defaultPageCoverPosition\n } = ctx\n\n const [activeSection, setActiveSection] = React.useState(null)\n\n const {\n block,\n children,\n level,\n className,\n bodyClassName,\n header,\n footer,\n pageHeader,\n pageFooter,\n pageTitle,\n pageAside,\n pageCover,\n hideBlockId,\n disableHeader\n } = props\n\n if (!block) return null\n\n // ugly hack to make viewing raw collection views work properly\n // e.g., 6d886ca87ab94c21a16e3b82b43a57fb\n if (level === 0 && block.type === 'collection_view') {\n const view_block = block as unknown as CollectionViewPageBlock\n view_block.type = 'collection_view_page'\n }\n\n const blockId = hideBlockId ? 'notion-block' : `notion-block-${uuidToId(block.id)}`\n\n switch (block.type) {\n case 'collection_view_page':\n // fallthrough\n case 'page':\n if (level === 0) {\n const {\n page_icon = defaultPageIcon,\n page_cover = defaultPageCover,\n page_cover_position = defaultPageCoverPosition,\n page_full_width,\n page_small_text\n } = block.format || {}\n\n if (fullPage) {\n const properties =\n block.type === 'page'\n ? block.properties\n : {\n title: recordMap.collection[getBlockCollectionId(block, recordMap)]?.value?.name\n }\n\n const coverPosition = (1 - (page_cover_position || 0.5)) * 100\n const pageCoverObjectPosition = `center ${coverPosition}%`\n let pageCoverStyle = pageCoverStyleCache[pageCoverObjectPosition]\n if (!pageCoverStyle)\n pageCoverStyle = pageCoverStyleCache[pageCoverObjectPosition] = {\n objectPosition: pageCoverObjectPosition\n }\n\n const pageIcon = getBlockIcon(block, recordMap) ?? defaultPageIcon\n const isPageIconUrl = pageIcon && isUrl(pageIcon)\n\n const toc = getPageTableOfContents(block as PageBlock, recordMap)\n\n const hasToc = showTableOfContents && toc.length >= minTableOfContentsItems\n const hasAside = (hasToc || pageAside) && !page_full_width\n const hasPageCover = pageCover || page_cover\n\n return (\n <div className={`notion notion-app ${blockId} ${className || ''}`}>\n <div className='notion-viewport' />\n\n <div className='notion-frame'>\n {!disableHeader && <components.Header block={block} />}\n {header}\n\n <div className='notion-page-scroller'>\n {hasPageCover &&\n (pageCover ? (\n pageCover\n ) : (\n <div className='notion-page-cover-wrapper'>\n <LazyImage\n src={mapImageUrl(page_cover, block)}\n alt={getTextContent(properties?.title)}\n priority={true}\n className='notion-page-cover'\n style={pageCoverStyle}\n />\n </div>\n ))}\n\n <main\n className={`notion-page\n ${hasPageCover ? 'notion-page-has-cover' : 'notion-page-no-cover'}\n ${page_icon ? 'notion-page-has-icon' : 'notion-page-no-icon'}\n ${isPageIconUrl ? 'notion-page-has-image-icon' : 'notion-page-has-text-icon'}\n notion-full-page\n ${page_full_width && 'notion-full-width'}\n ${page_small_text && 'notion-small-text'}\n ${bodyClassName}`}>\n {page_icon && <PageIcon block={block} defaultIcon={defaultPageIcon} inline={false} />}\n\n {pageHeader}\n\n <h1 className='notion-title'>{pageTitle ?? <Text value={properties?.title} block={block} />}</h1>\n\n {(block.type === 'collection_view_page' ||\n (block.type === 'page' && block.parent_table === 'collection')) && (\n <components.Collection block={block} ctx={ctx} />\n )}\n\n {block.type !== 'collection_view_page' && (\n <div\n className={`notion-page-content\n ${hasAside && 'notion-page-content-has-aside'}\n ${hasToc && 'notion-page-content-has-toc'}`}>\n <article className='notion-page-content-inner'>{children}</article>\n\n {hasAside && (\n <PageAside\n toc={toc}\n activeSection={activeSection}\n setActiveSection={setActiveSection}\n hasToc={hasToc}\n hasAside={hasAside}\n pageAside={pageAside}\n />\n )}\n </div>\n )}\n\n {pageFooter}\n </main>\n\n {footer}\n </div>\n </div>\n </div>\n )\n } else {\n return (\n <main\n className={`notion\n notion-page\n ${page_full_width && 'notion-full-width'}\n ${page_small_text && 'notion-small-text'}\n ${blockId}\n ${className || ''}\n ${bodyClassName}`}>\n <div className='notion-viewport' />\n\n {pageHeader}\n\n {(block.type === 'collection_view_page' || (block.type === 'page' && block.parent_table === 'collection')) && (\n <components.Collection block={block} ctx={ctx} />\n )}\n\n {block.type !== 'collection_view_page' && children}\n\n {pageFooter}\n </main>\n )\n }\n } else {\n const blockColor = block.format?.block_color\n\n return (\n <components.PageLink\n className={`notion-page-link ${blockColor && `notion-${blockColor}`} ${blockId}`}\n href={mapPageUrl(block.id)}>\n <PageTitle block={block} />\n </components.PageLink>\n )\n }\n\n case 'header':\n // fallthrough\n case 'sub_header':\n // fallthrough\n case 'sub_sub_header': {\n if (!block.properties) return null\n\n const blockColor = block.format?.block_color\n const id = uuidToId(block.id)\n const title = getTextContent(block.properties.title) || `Notion Header ${id}`\n\n // we use a cache here because constructing the ToC is non-trivial\n let indentLevel = tocIndentLevelCache[block.id]\n let indentLevelClass: string\n\n if (indentLevel === undefined) {\n const page = getBlockParentPage(block, recordMap)\n\n if (page) {\n const toc = getPageTableOfContents(page, recordMap)\n const tocItem = toc.find(tocItem => tocItem.id === block.id)\n\n if (tocItem) {\n indentLevel = tocItem.indentLevel\n tocIndentLevelCache[block.id] = indentLevel\n }\n }\n }\n\n if (indentLevel !== undefined) indentLevelClass = `notion-h-indent-${indentLevel}`\n\n const isH1 = block.type === 'header'\n const isH2 = block.type === 'sub_header'\n const isH3 = block.type === 'sub_sub_header'\n\n const classNameStr = `${isH1 && 'notion-h notion-h1'}\n ${isH2 && 'notion-h notion-h2'}\n ${isH3 && 'notion-h notion-h3'}\n ${blockColor && `notion-${blockColor}`}\n ${indentLevelClass},\n ${blockId}`\n\n const innerHeader = (\n <span>\n <div id={id} className='notion-header-anchor' />\n {!block.format?.toggleable && (\n <a className='notion-hash-link' href={`#${id}`} title={title}>\n <LinkIcon />\n </a>\n )}\n\n <span className='notion-h-title'>\n <Text value={block.properties.title} block={block} />\n </span>\n </span>\n )\n let headerBlock = null\n\n //page title takes the h1 so all header blocks are greater\n if (isH1)\n headerBlock = (\n <h2 className={classNameStr} data-id={id}>\n {innerHeader}\n </h2>\n )\n else if (isH2)\n headerBlock = (\n <h3 className={classNameStr} data-id={id}>\n {innerHeader}\n </h3>\n )\n else\n headerBlock = (\n <h4 className={classNameStr} data-id={id}>\n {innerHeader}\n </h4>\n )\n\n if (block.format?.toggleable)\n return (\n <details className={`notion-toggle ${blockId}`}>\n <summary>{headerBlock}</summary>\n <div>{children}</div>\n </details>\n )\n else return headerBlock\n }\n\n case 'divider':\n return <hr className={`notion-hr ${blockId}`} />\n\n case 'text': {\n if (!block.properties && !block.content?.length) return <div className={`notion-blank ${blockId}`}>&nbsp;</div>\n\n const blockColor = block.format?.block_color\n\n return (\n <div className={`notion-text ${blockColor && `notion-${blockColor}`} ${blockId}`}>\n {block.properties?.title && <Text value={block.properties.title} block={block} />}\n\n {children && <div className='notion-text-children'>{children}</div>}\n </div>\n )\n }\n\n case 'bulleted_list':\n // fallthrough\n case 'numbered_list': {\n const wrapList = (content: React.ReactNode, start?: number) =>\n block.type === 'bulleted_list' ? (\n <ul className={`notion-list notion-list-disc ${blockId}`}>{content}</ul>\n ) : (\n <ol start={start} className={`notion-list notion-list-numbered ${blockId}`}>\n {content}\n </ol>\n )\n\n let output: React.JSX.Element | null = null\n\n if (block.content)\n output = (\n <>\n {block.properties && (\n <li>\n <Text value={block.properties.title} block={block} />\n </li>\n )}\n {wrapList(children)}\n </>\n )\n else\n output = block.properties ? (\n <li>\n <Text value={block.properties.title} block={block} />\n </li>\n ) : null\n\n const isTopLevel = block.type !== recordMap.block[block.parent_id]?.value?.type\n const start = getListNumber(block.id, recordMap.block)\n\n return isTopLevel ? wrapList(output, start) : output\n }\n\n case 'embed':\n return <components.Embed blockId={blockId} block={block} />\n case 'tweet':\n // fallthrough\n case 'maps':\n // fallthrough\n case 'pdf':\n // fallthrough\n case 'figma':\n // fallthrough\n case 'typeform':\n // fallthrough\n case 'codepen':\n // fallthrough\n case 'excalidraw':\n // fallthrough\n case 'image':\n // fallthrough\n case 'gist':\n // fallthrough\n case 'video':\n return <AssetWrapper blockId={blockId} block={block} />\n\n case 'drive': {\n const properties = block.format?.drive_properties\n if (!properties)\n if (block.format?.display_source)\n //check if this drive actually needs to be embeded ex. google sheets.\n return <AssetWrapper blockId={blockId} block={block} />\n\n return <GoogleDrive block={block as GoogleDriveBlock} className={blockId} />\n }\n\n case 'audio':\n return <Audio block={block as AudioBlock} className={blockId} />\n\n case 'file':\n return <File block={block as FileBlock} className={blockId} />\n\n case 'equation':\n return <components.Equation block={block as EquationBlock} inline={false} className={blockId} />\n\n case 'code':\n return <components.Code block={block as CodeBlock} />\n\n case 'column_list':\n return <div className={`notion-row ${blockId}`}>{children}</div>\n\n case 'column': {\n // note: notion uses 46px\n const spacerWidth = `min(32px, 4vw)`\n const ratio = block.format?.column_ratio || 0.5\n const parent = recordMap.block[block.parent_id]?.value\n const columns = parent?.content?.length || Math.max(2, Math.ceil(1.0 / ratio))\n\n const width = `calc((100% - (${columns - 1} * ${spacerWidth})) * ${ratio})`\n const style = { width }\n\n return (\n <>\n <div className={`notion-column ${blockId}`} style={style}>\n {children}\n </div>\n\n <div className='notion-spacer' />\n </>\n )\n }\n\n case 'quote': {\n if (!block.properties) return null\n\n const blockColor = block.format?.block_color\n\n return (\n <blockquote className={`notion-quote ${blockColor && `notion-${blockColor}`} ${blockId}`}>\n <div>\n <Text value={block.properties.title} block={block} />\n </div>\n {children}\n </blockquote>\n )\n }\n\n case 'collection_view':\n return <components.Collection block={block} className={blockId} ctx={ctx} />\n\n case 'callout':\n if (components.Callout) return <components.Callout block={block} className={blockId} />\n else\n return (\n <div\n className={`notion-callout ${block.format?.block_color && `notion-${block.format?.block_color}_co`} ${blockId}`}>\n <PageIcon block={block} />\n\n <div className='notion-callout-text'>\n <Text value={block.properties?.title} block={block} />\n {children}\n </div>\n </div>\n )\n\n case 'bookmark': {\n if (!block.properties) return null\n\n const link = block.properties.link\n if (!link || !link[0]?.[0]) return null\n\n let title = getTextContent(block.properties.title)\n if (!title) title = getTextContent(link)\n\n if (title)\n if (title.startsWith('http'))\n try {\n const url = new URL(title)\n title = url.hostname\n } catch (err) {\n // ignore invalid links\n }\n\n return (\n <components.Link\n target='_blank'\n rel='noopener noreferrer'\n className={`notion-bookmark ${block.format?.block_color && `notion-${block.format.block_color}`} ${blockId}`}\n href={link[0][0]}>\n <div>\n {title && (\n <div className='notion-bookmark-title'>\n <Text value={[[title]]} block={block} />\n </div>\n )}\n\n {block.properties?.description && (\n <div className='notion-bookmark-description'>\n <Text value={block.properties?.description} block={block} />\n </div>\n )}\n\n <div className='notion-bookmark-link'>\n {block.format?.bookmark_icon && (\n <div className='notion-bookmark-link-icon'>\n <LazyImage\n src={mapImageUrl(block.format?.bookmark_icon, block)}\n alt={title}\n onError={e => {\n const parent = e.currentTarget.closest('.notion-bookmark-link-icon') as HTMLElement\n if (parent) parent.style.display = 'none'\n }}\n />\n </div>\n )}\n\n <div className='notion-bookmark-link-text'>\n <Text value={link} block={block} />\n </div>\n </div>\n </div>\n\n {block.format?.bookmark_cover && (\n <div className='notion-bookmark-image'>\n <LazyImage\n src={mapImageUrl(block.format?.bookmark_cover, block)}\n alt={getTextContent(block.properties?.title)}\n style={{\n objectFit: 'cover'\n }}\n onError={e => {\n const parent = e.currentTarget.closest('.notion-bookmark-image') as HTMLElement\n if (parent) parent.style.display = 'none'\n }}\n />\n </div>\n )}\n </components.Link>\n )\n }\n\n case 'toggle':\n return (\n <details className={`notion-toggle ${blockId}`}>\n <summary>\n <Text value={block.properties?.title} block={block} />\n </summary>\n\n <div>{children}</div>\n </details>\n )\n\n case 'table_of_contents': {\n const page = getBlockParentPage(block, recordMap)\n if (!page) return null\n\n const toc = getPageTableOfContents(page, recordMap)\n const blockColor = block.format?.block_color\n\n return (\n <div className={`notion-table-of-contents ${blockColor && `notion-${blockColor}`} ${blockId}`}>\n {toc.map(tocItem => (\n <a key={tocItem.id} href={`#${uuidToId(tocItem.id)}`} className='notion-table-of-contents-item'>\n <span\n className='notion-table-of-contents-item-body'\n style={{\n display: 'inline-block',\n marginLeft: tocItem.indentLevel * 24\n }}>\n {tocItem.text}\n </span>\n </a>\n ))}\n </div>\n )\n }\n\n case 'to_do': {\n const isChecked = block.properties?.checked?.[0]?.[0] === 'Yes'\n\n return (\n <div className={`notion-to-do ${blockId}`}>\n <div className='notion-to-do-item'>\n <components.Checkbox blockId={blockId} isChecked={isChecked} />\n\n <div className={`notion-to-do-body ${isChecked && `notion-to-do-checked`}`}>\n <Text value={block.properties?.title} block={block} />\n </div>\n </div>\n\n <div className='notion-to-do-children'>{children}</div>\n </div>\n )\n }\n\n case 'transclusion_container':\n return <div className={`notion-sync-block ${blockId}`}>{children}</div>\n\n case 'transclusion_reference':\n return <SyncPointerBlock block={block} level={level + 1} {...props} />\n\n case 'alias': {\n const blockPointerId = block?.format?.alias_pointer?.id\n const linkedBlock = recordMap.block[blockPointerId]?.value\n if (!linkedBlock) {\n console.debug('\"alias\" missing block', blockPointerId)\n return null\n }\n\n return (\n <components.PageLink className={`notion-page-link ${blockPointerId}}`} href={mapPageUrl(blockPointerId)}>\n <PageTitle block={linkedBlock} />\n </components.PageLink>\n )\n }\n\n case 'table':\n return (\n <table className={`notion-simple-table ${blockId}`}>\n <tbody>{children}</tbody>\n </table>\n )\n\n case 'table_row': {\n const tableBlock = recordMap.block[block.parent_id]?.value as TableBlock\n const order = tableBlock.format?.table_block_column_order\n const formatMap = tableBlock.format?.table_block_column_format\n const backgroundColor = block.format?.block_color\n\n if (!tableBlock || !order) return null\n\n return (\n <tr className={`notion-simple-table-row ${backgroundColor && `notion-${backgroundColor}`} ${blockId}`}>\n {order.map(column => {\n const color = formatMap?.[column]?.color\n\n return (\n <td\n key={column}\n className={color ? `notion-${color}` : ''}\n style={{\n width: formatMap?.[column]?.width || 120\n }}>\n <div className='notion-simple-table-cell'>\n <Text value={block.properties?.[column] || [['ㅤ']]} block={block} />\n </div>\n </td>\n )\n })}\n </tr>\n )\n }\n\n case 'external_object_instance':\n return <EOI block={block} className={blockId} />\n\n default:\n if (process.env.NODE_ENV !== 'production')\n console.debug('Unsupported type ' + (block as BlockType).type, JSON.stringify(block, null, 2))\n\n return <div />\n }\n}\n","import React from 'react'\n\nimport mediumZoom from '@fisch0920/medium-zoom'\nimport type { ExtendedRecordMap } from '@texonom/ntypes'\n\nimport { Block } from './block'\nimport { NotionContextProvider, useNotionContext } from './context'\nimport { MapImageUrlFn, MapPageUrlFn, NotionComponents, SearchNotionFn } from './types'\n\nexport const NotionRenderer: React.FC<{\n recordMap: ExtendedRecordMap\n components?: Partial<NotionComponents>\n\n mapPageUrl?: MapPageUrlFn\n mapImageUrl?: MapImageUrlFn\n searchNotion?: SearchNotionFn\n isShowingSearch?: boolean\n onHideSearch?: () => void\n\n rootPageId?: string\n rootDomain?: string\n rootSpaceId?: string\n\n // set fullPage to false to render page content only\n // this will remove the header, cover image, and footer\n fullPage?: boolean\n\n darkMode?: boolean\n previewImages?: boolean\n forceCustomImages?: boolean\n showCollectionViewDropdown?: boolean\n linkTableTitleProperties?: boolean\n isLinkCollectionToUrlProperty?: boolean\n isImageZoomable?: boolean\n\n showTableOfContents?: boolean\n minTableOfContentsItems?: number\n\n defaultPageIcon?: string\n defaultPageCover?: string\n defaultPageCoverPosition?: number\n\n className?: string\n bodyClassName?: string\n\n header?: React.ReactNode\n footer?: React.ReactNode\n pageHeader?: React.ReactNode\n pageFooter?: React.ReactNode\n pageTitle?: React.ReactNode\n pageAside?: React.ReactNode\n pageCover?: React.ReactNode\n\n blockId?: string\n hideBlockId?: boolean\n disableHeader?: boolean\n}> = ({\n components,\n recordMap,\n mapPageUrl,\n mapImageUrl,\n searchNotion,\n isShowingSearch,\n onHideSearch,\n fullPage,\n rootPageId,\n rootDomain,\n rootSpaceId,\n darkMode,\n previewImages,\n forceCustomImages,\n showCollectionViewDropdown,\n linkTableTitleProperties,\n isLinkCollectionToUrlProperty,\n isImageZoomable = true,\n showTableOfContents,\n minTableOfContentsItems,\n defaultPageIcon,\n defaultPageCover,\n defaultPageCoverPosition,\n ...rest\n}) => {\n const zoom = React.useMemo(\n () =>\n typeof window !== 'undefined' &&\n mediumZoom({\n background: 'rgba(0, 0, 0, 0.8)',\n minZoomScale: 2.0,\n margin: getMediumZoomMargin()\n }),\n []\n )\n\n return (\n <NotionContextProvider\n components={components}\n recordMap={recordMap}\n mapPageUrl={mapPageUrl}\n mapImageUrl={mapImageUrl}\n searchNotion={searchNotion}\n isShowingSearch={isShowingSearch}\n onHideSearch={onHideSearch}\n fullPage={fullPage}\n rootPageId={rootPageId}\n rootDomain={rootDomain}\n rootSpaceId={rootSpaceId}\n darkMode={darkMode}\n previewImages={previewImages}\n forceCustomImages={forceCustomImages}\n showCollectionViewDropdown={showCollectionViewDropdown}\n linkTableTitleProperties={linkTableTitleProperties}\n isLinkCollectionToUrlProperty={isLinkCollectionToUrlProperty}\n showTableOfContents={showTableOfContents}\n minTableOfContentsItems={minTableOfContentsItems}\n defaultPageIcon={defaultPageIcon}\n defaultPageCover={defaultPageCover}\n defaultPageCoverPosition={defaultPageCoverPosition}\n zoom={isImageZoomable ? zoom : null}>\n <NotionBlockRenderer {...rest} />\n </NotionContextProvider>\n )\n}\n\nexport const NotionBlockRenderer: React.FC<{\n className?: string\n bodyClassName?: string\n header?: React.ReactNode\n footer?: React.ReactNode\n disableHeader?: boolean\n\n blockId?: string\n hideBlockId?: boolean\n level?: number\n}> = ({ level = 0, blockId, ...props }) => {\n const { recordMap } = useNotionContext()\n const id = blockId || Object.keys(recordMap.block)[0]\n const block = recordMap.block[id]?.value\n\n if (!block) {\n if (process.env.NODE_ENV !== 'production') console.warn('missing block', blockId)\n\n return null\n }\n\n return (\n <Block key={id} level={level} block={block} {...props}>\n {block?.content?.map(contentBlockId => (\n <NotionBlockRenderer key={contentBlockId} blockId={contentBlockId} level={level + 1} {...props} />\n ))}\n </Block>\n )\n}\n\nfunction getMediumZoomMargin() {\n const width = window.innerWidth\n\n if (width < 500) return 8\n else if (width < 800) return 20\n else if (width < 1280) return 30\n else if (width < 1600) return 40\n else if (width < 1920) return 48\n else return 72\n}\n"],"names":["Audio","block","className","recordMap","useNotionContext","source","_c","_b","_a","React","FileIcon","props","rest","__objRest","__spreadProps","__spreadValues","File","components","Text","_d","_e","GoogleDrive","mapImageUrl","properties","domain","err","GracefulImage","FUNC_ERROR_TEXT","NAN","symbolTag","reTrim","reIsBadHex","reIsBinary","reIsOctal","freeParseInt","freeGlobal","global","freeSelf","root","objectProto","objectToString","nativeMax","nativeMin","now","debounce","func","wait","options","lastArgs","lastThis","maxWait","result","timerId","lastCallTime","lastInvokeTime","leading","maxing","trailing","toNumber","isObject","invokeFunc","time","args","thisArg","leadingEdge","timerExpired","remainingWait","timeSinceLastCall","timeSinceLastInvoke","shouldInvoke","trailingEdge","cancel","flush","debounced","isInvoking","throttle","value","type","isObjectLike","isSymbol","other","isBinary","lodash_throttle","PageAside","toc","activeSection","setActiveSection","pageAside","hasToc","hasAside","actionSectionScrollSpy","sections","prevBBox","currentSectionId","i","section","bbox","prevHeight","offset","tocItem","id","uuidToId","SyncPointerBlock","level","syncPointerBlock","referencePointerId","NotionBlockRenderer","LinkIcon","tocIndentLevelCache","pageCoverStyleCache","Block","ctx","fullPage","mapPageUrl","showTableOfContents","minTableOfContentsItems","defaultPageIcon","defaultPageCover","defaultPageCoverPosition","children","bodyClassName","header","footer","pageHeader","pageFooter","pageTitle","pageCover","hideBlockId","disableHeader","view_block","blockId","page_icon","page_cover","page_cover_position","page_full_width","page_small_text","getBlockCollectionId","pageCoverObjectPosition","pageCoverStyle","pageIcon","getBlockIcon","isPageIconUrl","isUrl","getPageTableOfContents","hasPageCover","LazyImage","getTextContent","PageIcon","blockColor","PageTitle","title","indentLevel","indentLevelClass","page","getBlockParentPage","isH1","isH2","isH3","classNameStr","innerHeader","_f","headerBlock","_g","_h","_i","_j","wrapList","content","start","output","isTopLevel","_l","_k","getListNumber","AssetWrapper","_m","_n","spacerWidth","ratio","_o","parent","_p","style","_q","_r","_s","_t","_u","link","_v","_w","_x","_y","_z","_A","e","_B","_C","_D","_E","_F","isChecked","_I","_H","_G","_J","blockPointerId","_L","_K","linkedBlock","_M","tableBlock","_N","order","_O","formatMap","_P","backgroundColor","_Q","column","color","EOI","NotionRenderer","searchNotion","isShowingSearch","onHideSearch","rootPageId","rootDomain","rootSpaceId","darkMode","previewImages","forceCustomImages","showCollectionViewDropdown","linkTableTitleProperties","isLinkCollectionToUrlProperty","isImageZoomable","zoom","mediumZoom","getMediumZoomMargin","NotionContextProvider","contentBlockId","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IAAA/F,EAAA,EAAM,KAAKqF,GAAI,OAAAG,GAAc,OAAAtG,KAAkBU,KAC7CJ,IAAAN,KAAA,gBAAAA,EAAO,YAAP,gBAAAM,EAAgB,IAAI,CAAAyO,sCAClBtI,IAAA3F,EAAA,EAAoB,KAAKiO,GAAgB,SAASA,GAAgB,OAAOzI,IAAQ,KAAO5F,EAAO,EAEpG,KAVI,QAAQ,IAAI,aAAa,gBAAc,QAAQ,KAAK,iBAAiBuH,CAAO,GAEzE;AAUX;AAEA,SAAS4G,KAAsB;AAC7B,QAAMG,IAAQ,OAAO;AAErB,SAAIA,IAAQ,MAAY,IACfA,IAAQ,MAAY,KACpBA,IAAQ,OAAa,KACrBA,IAAQ,OAAa,KACrBA,IAAQ,OAAa,KAClB;AACd;","x_google_ignoreList":[4]}
1
+ {"version":3,"file":"index.js","sources":["../src/components/audio.tsx","../src/icons/file-icon.tsx","../src/components/file.tsx","../src/components/google-drive.tsx","../../../node_modules/.pnpm/lodash.throttle@4.1.1/node_modules/lodash.throttle/index.js","../src/components/page-aside.tsx","../src/components/sync-pointer-block.tsx","../src/icons/link-icon.tsx","../src/block.tsx","../src/renderer.tsx"],"sourcesContent":["import React from 'react'\n\nimport { AudioBlock } from '@texonom/ntypes'\n\nimport { useNotionContext } from '../context'\n\nexport const Audio: React.FC<{\n block: AudioBlock\n className?: string\n}> = ({ block, className }) => {\n const { recordMap } = useNotionContext()\n const source = recordMap.signed_urls[block.id] || block.properties?.source?.[0]?.[0]\n\n return (\n <div className={`notion-audio ${className || ''}`}>\n <audio controls preload='none' src={source} />\n </div>\n )\n}\n","import React from 'react'\n\nexport const FileIcon = props => {\n const { className, ...rest } = props\n return (\n <svg className={className} {...rest} viewBox='0 0 30 30'>\n <path d='M22,8v12c0,3.866-3.134,7-7,7s-7-3.134-7-7V8c0-2.762,2.238-5,5-5s5,2.238,5,5v12c0,1.657-1.343,3-3,3s-3-1.343-3-3V8h-2v12c0,2.762,2.238,5,5,5s5-2.238,5-5V8c0-3.866-3.134-7-7-7S6,4.134,6,8v12c0,4.971,4.029,9,9,9s9-4.029,9-9V8H22z'></path>\n </svg>\n )\n}\n","import React from 'react'\n\nimport { FileBlock } from '@texonom/ntypes'\n\nimport { useNotionContext } from '../context'\nimport { FileIcon } from '../icons/file-icon'\nimport { Text } from './text'\n\nexport const File: React.FC<{\n block: FileBlock\n className?: string\n}> = ({ block, className }) => {\n const { components, recordMap } = useNotionContext()\n const source = recordMap.signed_urls[block.id] || block.properties?.source?.[0]?.[0]\n\n return (\n <div className={`notion-file ${className || ''}`}>\n <components.Link className='notion-file-link' href={source} target='_blank' rel='noopener noreferrer'>\n <FileIcon className='notion-file-icon' />\n\n <div className='notion-file-info'>\n <div className='notion-file-title'>\n <Text value={block.properties?.title || [['File']]} block={block} />\n </div>\n\n {block.properties?.size && (\n <div className='notion-file-size'>\n <Text value={block.properties.size} block={block} />\n </div>\n )}\n </div>\n </components.Link>\n </div>\n )\n}\n","import React from 'react'\n\nimport { GoogleDriveBlock } from '@texonom/ntypes'\n\nimport { useNotionContext } from '../context'\nimport { GracefulImage } from './graceful-image'\n\nexport const GoogleDrive: React.FC<{\n block: GoogleDriveBlock\n className?: string\n}> = ({ block, className }) => {\n const { components, mapImageUrl } = useNotionContext()\n const properties = block.format?.drive_properties\n if (!properties) return null\n let domain\n\n try {\n const url = new URL(properties.url)\n domain = url.hostname\n } catch (err) {\n // ignore invalid urls for robustness\n }\n\n return (\n <div className={`notion-google-drive ${className || ''}`}>\n <components.Link className='notion-google-drive-link' href={properties.url} target='_blank' rel='noopener noreferrer'>\n <div className='notion-google-drive-preview'>\n <GracefulImage\n src={mapImageUrl(properties.thumbnail, block)}\n alt={properties.title || 'Google Drive Document'}\n loading='lazy'\n />\n </div>\n\n <div className='notion-google-drive-body'>\n {properties.title && <div className='notion-google-drive-body-title'>{properties.title}</div>}\n\n {/* TODO: re-add last modified time with alternative to timeago.js */}\n {/* {properties.modified_time && (\n <div className='notion-google-drive-body-modified-time'>\n Last modified{' '}\n {properties.user_name ? `by ${properties.user_name} ` : ''}\n {timeago(properties.modified_time)}\n </div>\n )} */}\n\n {properties.icon && domain && (\n <div className='notion-google-drive-body-source'>\n {properties.icon && (\n <div\n className='notion-google-drive-body-source-icon'\n style={{\n backgroundImage: `url(${properties.icon})`\n }}\n />\n )}\n\n {domain && <div className='notion-google-drive-body-source-domain'>{domain}</div>}\n </div>\n )}\n </div>\n </components.Link>\n </div>\n )\n}\n","/**\n * lodash (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors <https://jquery.org/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/** Used to match leading and trailing whitespace. */\nvar reTrim = /^\\s+|\\s+$/g;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n result = wait - timeSinceLastCall;\n\n return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\n/**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide `options` to indicate whether `func`\n * should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return the\n * result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the throttled function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=true]\n * Specify invoking on the leading edge of the timeout.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // Avoid excessively updating the position while scrolling.\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.\n * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });\n * jQuery(element).on('click', throttled);\n *\n * // Cancel the trailing throttled invocation.\n * jQuery(window).on('popstate', throttled.cancel);\n */\nfunction throttle(func, wait, options) {\n var leading = true,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (isObject(options)) {\n leading = 'leading' in options ? !!options.leading : leading;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n return debounce(func, wait, {\n 'leading': leading,\n 'maxWait': wait,\n 'trailing': trailing\n });\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = value.replace(reTrim, '');\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = throttle;\n","import React from 'react'\n\nimport throttle from 'lodash.throttle'\nimport { TableOfContentsEntry, uuidToId } from '@texonom/nutils'\n\nexport const PageAside: React.FC<{\n toc: Array<TableOfContentsEntry>\n activeSection: string | null\n setActiveSection: (activeSection: string | null) => unknown\n hasToc: boolean\n hasAside: boolean\n pageAside?: React.ReactNode\n className?: string\n}> = ({ toc, activeSection, setActiveSection, pageAside, hasToc, hasAside, className }) => {\n const throttleMs = 100\n const actionSectionScrollSpy = React.useMemo(\n () =>\n throttle(() => {\n const sections = document.getElementsByClassName('notion-h')\n\n let prevBBox: DOMRect = null\n let currentSectionId = activeSection\n\n for (let i = 0; i < sections.length; ++i) {\n const section = sections[i]\n if (!section || !(section instanceof Element)) continue\n\n if (!currentSectionId) currentSectionId = section.getAttribute('data-id')\n\n const bbox = section.getBoundingClientRect()\n const prevHeight = prevBBox ? bbox.top - prevBBox.bottom : 0\n const offset = Math.max(150, prevHeight / 4)\n\n // GetBoundingClientRect returns values relative to the viewport\n if (bbox.top - offset < 0) {\n currentSectionId = section.getAttribute('data-id')\n\n prevBBox = bbox\n continue\n }\n\n // No need to continue loop, if last element has been detected\n break\n }\n\n setActiveSection(currentSectionId)\n }, throttleMs),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n // explicitly not taking a dependency on activeSection\n setActiveSection\n ]\n )\n\n React.useEffect(() => {\n if (!hasToc) return\n\n window.addEventListener('scroll', actionSectionScrollSpy)\n\n actionSectionScrollSpy()\n\n return () => {\n window.removeEventListener('scroll', actionSectionScrollSpy)\n }\n }, [hasToc, actionSectionScrollSpy])\n\n if (!hasAside) return null\n\n return (\n <aside className={`notion-aside ${className || ''}`}>\n {hasToc && (\n <div className='notion-aside-table-of-contents'>\n <div className='notion-aside-table-of-contents-header'>Table of Contents</div>\n\n <nav className='notion-table-of-contents'>\n {toc.map(tocItem => {\n const id = uuidToId(tocItem.id)\n\n return (\n <a\n key={id}\n href={`#${id}`}\n className={`notion-table-of-contents-item\n notion-table-of-contents-item-indent-level-${tocItem.indentLevel}\n ${activeSection === id && 'notion-table-of-contents-active-item'}`}>\n <span\n className='notion-table-of-contents-item-body'\n style={{\n display: 'inline-block',\n marginLeft: tocItem.indentLevel * 16\n }}>\n {tocItem.text}\n </span>\n </a>\n )\n })}\n </nav>\n </div>\n )}\n\n {pageAside}\n </aside>\n )\n}\n","import React from 'react'\n\nimport { NotionBlockRenderer } from '../renderer'\n\nimport type { Block as BlockType, SyncPointerBlock as SyncPointerBlockType } from '@texonom/ntypes'\n\nexport const SyncPointerBlock: React.FC<{\n block: BlockType\n level: number\n}> = ({ block, level }) => {\n if (!block) {\n if (process.env.NODE_ENV !== 'production') console.warn('missing sync pointer block', block.id)\n\n return null\n }\n\n const syncPointerBlock = block as SyncPointerBlockType\n const referencePointerId = syncPointerBlock?.format?.transclusion_reference_pointer?.id\n\n if (!referencePointerId) return null\n\n return <NotionBlockRenderer key={referencePointerId} level={level} blockId={referencePointerId} />\n}\n","import React from 'react'\n\nexport const LinkIcon = props => {\n const { className, ...rest } = props\n return (\n <svg className={className} {...rest} viewBox='0 0 16 16' width='16' height='16'>\n <path\n fillRule='evenodd'\n d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'\n />\n </svg>\n )\n}\n","import React from 'react'\n\nimport {\n getBlockCollectionId,\n getBlockIcon,\n getBlockParentPage,\n getPageTableOfContents,\n getTextContent,\n uuidToId\n} from '@texonom/nutils'\n\nimport { AssetWrapper } from './components/asset-wrapper'\nimport { Audio } from './components/audio'\nimport { EOI } from './components/eoi'\nimport { File } from './components/file'\nimport { GoogleDrive } from './components/google-drive'\nimport { LazyImage } from './components/lazy-image'\nimport { PageAside } from './components/page-aside'\nimport { PageIcon } from './components/page-icon'\nimport { PageTitle } from './components/page-title'\nimport { SyncPointerBlock } from './components/sync-pointer-block'\nimport { Text } from './components/text'\nimport { useNotionContext } from './context'\nimport { LinkIcon } from './icons/link-icon'\nimport { getListNumber, isUrl } from './utils'\n\nimport type {\n Block as BlockType,\n PageBlock,\n GoogleDriveBlock,\n AudioBlock,\n FileBlock,\n EquationBlock,\n CollectionViewPageBlock,\n CodeBlock,\n TableBlock\n} from '@texonom/ntypes'\ninterface BlockProps {\n block: BlockType\n level: number\n\n className?: string\n bodyClassName?: string\n\n header?: React.ReactNode\n footer?: React.ReactNode\n pageHeader?: React.ReactNode\n pageFooter?: React.ReactNode\n pageTitle?: React.ReactNode\n pageAside?: React.ReactNode\n pageCover?: React.ReactNode\n\n hideBlockId?: boolean\n disableHeader?: boolean\n\n children?: React.ReactNode\n}\n\n// TODO: use react state instead of a global for this\nconst tocIndentLevelCache: {\n [blockId: string]: number\n} = {}\n\nconst pageCoverStyleCache: Record<string, object> = {}\n\nexport const Block: React.FC<BlockProps> = props => {\n const ctx = useNotionContext()\n const {\n components,\n fullPage,\n recordMap,\n mapPageUrl,\n mapImageUrl,\n showTableOfContents,\n minTableOfContentsItems,\n defaultPageIcon,\n defaultPageCover,\n defaultPageCoverPosition\n } = ctx\n\n const [activeSection, setActiveSection] = React.useState(null)\n\n const {\n block,\n children,\n level,\n className,\n bodyClassName,\n header,\n footer,\n pageHeader,\n pageFooter,\n pageTitle,\n pageAside,\n pageCover,\n hideBlockId,\n disableHeader\n } = props\n\n if (!block) return null\n\n // ugly hack to make viewing raw collection views work properly\n // e.g., 6d886ca87ab94c21a16e3b82b43a57fb\n if (level === 0 && block.type === 'collection_view') {\n const view_block = block as unknown as CollectionViewPageBlock\n view_block.type = 'collection_view_page'\n }\n\n const blockId = hideBlockId ? 'notion-block' : `notion-block-${uuidToId(block.id)}`\n\n switch (block.type) {\n case 'collection_view_page':\n // fallthrough\n case 'page':\n if (level === 0) {\n const {\n page_icon = defaultPageIcon,\n page_cover = defaultPageCover,\n page_cover_position = defaultPageCoverPosition,\n page_full_width,\n page_small_text\n } = block.format || {}\n\n if (fullPage) {\n const properties =\n block.type === 'page'\n ? block.properties\n : {\n title: recordMap.collection[getBlockCollectionId(block, recordMap)]?.value?.name\n }\n\n const coverPosition = (1 - (page_cover_position || 0.5)) * 100\n const pageCoverObjectPosition = `center ${coverPosition}%`\n let pageCoverStyle = pageCoverStyleCache[pageCoverObjectPosition]\n if (!pageCoverStyle)\n pageCoverStyle = pageCoverStyleCache[pageCoverObjectPosition] = {\n objectPosition: pageCoverObjectPosition\n }\n\n const pageIcon = getBlockIcon(block, recordMap) ?? defaultPageIcon\n const isPageIconUrl = pageIcon && isUrl(pageIcon)\n\n const toc = getPageTableOfContents(block as PageBlock, recordMap)\n\n const hasToc = showTableOfContents && toc.length >= minTableOfContentsItems\n const hasAside = (hasToc || pageAside) && !page_full_width\n const hasPageCover = pageCover || page_cover\n\n return (\n <div className={`notion notion-app ${blockId} ${className || ''}`}>\n <div className='notion-viewport' />\n\n <div className='notion-frame'>\n {!disableHeader && <components.Header block={block} />}\n {header}\n\n <div className='notion-page-scroller'>\n {hasPageCover &&\n (pageCover ? (\n pageCover\n ) : (\n <div className='notion-page-cover-wrapper'>\n <LazyImage\n src={mapImageUrl(page_cover, block)}\n alt={getTextContent(properties?.title)}\n priority={true}\n className='notion-page-cover'\n style={pageCoverStyle}\n />\n </div>\n ))}\n\n <main\n className={`notion-page\n ${hasPageCover ? 'notion-page-has-cover' : 'notion-page-no-cover'}\n ${page_icon ? 'notion-page-has-icon' : 'notion-page-no-icon'}\n ${isPageIconUrl ? 'notion-page-has-image-icon' : 'notion-page-has-text-icon'}\n notion-full-page\n ${page_full_width && 'notion-full-width'}\n ${page_small_text && 'notion-small-text'}\n ${bodyClassName}`}>\n {page_icon && <PageIcon block={block} defaultIcon={defaultPageIcon} inline={false} />}\n\n {pageHeader}\n\n <h1 className='notion-title'>{pageTitle ?? <Text value={properties?.title} block={block} />}</h1>\n\n {(block.type === 'collection_view_page' ||\n (block.type === 'page' && block.parent_table === 'collection')) && (\n <components.Collection block={block} ctx={ctx} />\n )}\n\n {block.type !== 'collection_view_page' && (\n <div\n className={`notion-page-content\n ${hasAside && 'notion-page-content-has-aside'}\n ${hasToc && 'notion-page-content-has-toc'}`}>\n <article className='notion-page-content-inner'>{children}</article>\n\n {hasAside && (\n <PageAside\n toc={toc}\n activeSection={activeSection}\n setActiveSection={setActiveSection}\n hasToc={hasToc}\n hasAside={hasAside}\n pageAside={pageAside}\n />\n )}\n </div>\n )}\n\n {pageFooter}\n </main>\n\n {footer}\n </div>\n </div>\n </div>\n )\n } else {\n return (\n <main\n className={`notion\n notion-page\n ${page_full_width && 'notion-full-width'}\n ${page_small_text && 'notion-small-text'}\n ${blockId}\n ${className || ''}\n ${bodyClassName}`}>\n <div className='notion-viewport' />\n\n {pageHeader}\n\n {(block.type === 'collection_view_page' || (block.type === 'page' && block.parent_table === 'collection')) && (\n <components.Collection block={block} ctx={ctx} />\n )}\n\n {block.type !== 'collection_view_page' && children}\n\n {pageFooter}\n </main>\n )\n }\n } else {\n const blockColor = block.format?.block_color\n\n return (\n <components.PageLink\n className={`notion-page-link ${blockColor && `notion-${blockColor}`} ${blockId}`}\n href={mapPageUrl(block.id)}>\n <PageTitle block={block} />\n </components.PageLink>\n )\n }\n\n case 'header':\n // fallthrough\n case 'sub_header':\n // fallthrough\n case 'sub_sub_header': {\n if (!block.properties) return null\n\n const blockColor = block.format?.block_color\n const id = uuidToId(block.id)\n const title = getTextContent(block.properties.title) || `Notion Header ${id}`\n\n // we use a cache here because constructing the ToC is non-trivial\n let indentLevel = tocIndentLevelCache[block.id]\n let indentLevelClass: string\n\n if (indentLevel === undefined) {\n const page = getBlockParentPage(block, recordMap)\n\n if (page) {\n const toc = getPageTableOfContents(page, recordMap)\n const tocItem = toc.find(tocItem => tocItem.id === block.id)\n\n if (tocItem) {\n indentLevel = tocItem.indentLevel\n tocIndentLevelCache[block.id] = indentLevel\n }\n }\n }\n\n if (indentLevel !== undefined) indentLevelClass = `notion-h-indent-${indentLevel}`\n\n const isH1 = block.type === 'header'\n const isH2 = block.type === 'sub_header'\n const isH3 = block.type === 'sub_sub_header'\n\n const classNameStr = `${isH1 && 'notion-h notion-h1'}\n ${isH2 && 'notion-h notion-h2'}\n ${isH3 && 'notion-h notion-h3'}\n ${blockColor && `notion-${blockColor}`}\n ${indentLevelClass},\n ${blockId}`\n\n const innerHeader = (\n <span>\n <div id={id} className='notion-header-anchor' />\n {!block.format?.toggleable && (\n <a className='notion-hash-link' href={`#${id}`} title={title}>\n <LinkIcon />\n </a>\n )}\n\n <span className='notion-h-title'>\n <Text value={block.properties.title} block={block} />\n </span>\n </span>\n )\n let headerBlock = null\n\n //page title takes the h1 so all header blocks are greater\n if (isH1)\n headerBlock = (\n <h2 className={classNameStr} data-id={id}>\n {innerHeader}\n </h2>\n )\n else if (isH2)\n headerBlock = (\n <h3 className={classNameStr} data-id={id}>\n {innerHeader}\n </h3>\n )\n else\n headerBlock = (\n <h4 className={classNameStr} data-id={id}>\n {innerHeader}\n </h4>\n )\n\n if (block.format?.toggleable)\n return (\n <details className={`notion-toggle ${blockId}`}>\n <summary>{headerBlock}</summary>\n <div>{children}</div>\n </details>\n )\n else return headerBlock\n }\n\n case 'divider':\n return <hr className={`notion-hr ${blockId}`} />\n\n case 'text': {\n if (!block.properties && !block.content?.length) return <div className={`notion-blank ${blockId}`}>&nbsp;</div>\n\n const blockColor = block.format?.block_color\n\n return (\n <div className={`notion-text ${blockColor && `notion-${blockColor}`} ${blockId}`}>\n {block.properties?.title && <Text value={block.properties.title} block={block} />}\n\n {children && <div className='notion-text-children'>{children}</div>}\n </div>\n )\n }\n\n case 'bulleted_list':\n // fallthrough\n case 'numbered_list': {\n const wrapList = (content: React.ReactNode, start?: number) =>\n block.type === 'bulleted_list' ? (\n <ul className={`notion-list notion-list-disc ${blockId}`}>{content}</ul>\n ) : (\n <ol start={start} className={`notion-list notion-list-numbered ${blockId}`}>\n {content}\n </ol>\n )\n\n let output: React.JSX.Element | null = null\n\n if (block.content)\n output = (\n <>\n {block.properties && (\n <li>\n <Text value={block.properties.title} block={block} />\n </li>\n )}\n {wrapList(children)}\n </>\n )\n else\n output = block.properties ? (\n <li>\n <Text value={block.properties.title} block={block} />\n </li>\n ) : null\n\n const isTopLevel = block.type !== recordMap.block[block.parent_id]?.value?.type\n const start = getListNumber(block.id, recordMap.block)\n\n return isTopLevel ? wrapList(output, start) : output\n }\n\n case 'embed':\n return <components.Embed blockId={blockId} block={block} />\n case 'tweet':\n // fallthrough\n case 'maps':\n // fallthrough\n case 'pdf':\n // fallthrough\n case 'figma':\n // fallthrough\n case 'typeform':\n // fallthrough\n case 'codepen':\n // fallthrough\n case 'excalidraw':\n // fallthrough\n case 'image':\n // fallthrough\n case 'gist':\n // fallthrough\n case 'video':\n return <AssetWrapper blockId={blockId} block={block} />\n\n case 'drive': {\n const properties = block.format?.drive_properties\n if (!properties)\n if (block.format?.display_source)\n //check if this drive actually needs to be embeded ex. google sheets.\n return <AssetWrapper blockId={blockId} block={block} />\n\n return <GoogleDrive block={block as GoogleDriveBlock} className={blockId} />\n }\n\n case 'audio':\n return <Audio block={block as AudioBlock} className={blockId} />\n\n case 'file':\n return <File block={block as FileBlock} className={blockId} />\n\n case 'equation':\n return <components.Equation block={block as EquationBlock} inline={false} className={blockId} />\n\n case 'code':\n return <components.Code block={block as CodeBlock} />\n\n case 'column_list':\n return <div className={`notion-row ${blockId}`}>{children}</div>\n\n case 'column': {\n // note: notion uses 46px\n const spacerWidth = `min(32px, 4vw)`\n const ratio = block.format?.column_ratio || 0.5\n const parent = recordMap.block[block.parent_id]?.value\n const columns = parent?.content?.length || Math.max(2, Math.ceil(1.0 / ratio))\n\n const width = `calc((100% - (${columns - 1} * ${spacerWidth})) * ${ratio})`\n const style = { width }\n\n return (\n <>\n <div className={`notion-column ${blockId}`} style={style}>\n {children}\n </div>\n\n <div className='notion-spacer' />\n </>\n )\n }\n\n case 'quote': {\n if (!block.properties) return null\n\n const blockColor = block.format?.block_color\n\n return (\n <blockquote className={`notion-quote ${blockColor && `notion-${blockColor}`} ${blockId}`}>\n <div>\n <Text value={block.properties.title} block={block} />\n </div>\n {children}\n </blockquote>\n )\n }\n\n case 'collection_view':\n return <components.Collection block={block} className={blockId} ctx={ctx} />\n\n case 'callout':\n if (components.Callout) return <components.Callout block={block} className={blockId} />\n else\n return (\n <div\n className={`notion-callout ${block.format?.block_color && `notion-${block.format?.block_color}_co`} ${blockId}`}>\n <PageIcon block={block} />\n\n <div className='notion-callout-text'>\n <Text value={block.properties?.title} block={block} />\n {children}\n </div>\n </div>\n )\n\n case 'bookmark': {\n if (!block.properties) return null\n\n const link = block.properties.link\n if (!link || !link[0]?.[0]) return null\n\n let title = getTextContent(block.properties.title)\n if (!title) title = getTextContent(link)\n\n if (title)\n if (title.startsWith('http'))\n try {\n const url = new URL(title)\n title = url.hostname\n } catch (err) {\n // ignore invalid links\n }\n\n return (\n <a\n target='_blank'\n rel='noopener noreferrer'\n className={`notion-bookmark ${block.format?.block_color ? `notion-${block.format.block_color}` : ''} ${blockId}`}\n href={link[0][0]}>\n <div>\n {title && (\n <div className='notion-bookmark-title'>\n <Text value={[[title]]} block={block} />\n </div>\n )}\n\n {block.properties.description && (\n <div className='notion-bookmark-description'>\n <Text value={block.properties.description} block={block} />\n </div>\n )}\n\n <div className='notion-bookmark-link'>\n {block.format?.bookmark_icon && (\n <div className='notion-bookmark-link-icon'>\n <LazyImage\n src={mapImageUrl(block.format.bookmark_icon, block)}\n alt={title}\n onError={e => {\n const parent = e.currentTarget.closest('.notion-bookmark-link-icon') as HTMLElement\n if (parent) parent.style.display = 'none'\n }}\n />\n </div>\n )}\n\n <div className='notion-bookmark-link-text'>\n <Text value={link} block={block} />\n </div>\n </div>\n </div>\n\n {block.format?.bookmark_cover && (\n <div className='notion-bookmark-image'>\n <LazyImage\n src={mapImageUrl(block.format.bookmark_cover, block)}\n alt={getTextContent(block.properties.title)}\n style={{\n objectFit: 'cover'\n }}\n onError={e => {\n const parent = e.currentTarget.closest('.notion-bookmark-image') as HTMLElement\n if (parent) parent.style.display = 'none'\n }}\n />\n </div>\n )}\n </a>\n )\n }\n\n case 'toggle':\n return (\n <details className={`notion-toggle ${blockId}`}>\n <summary>\n <Text value={block.properties?.title} block={block} />\n </summary>\n\n <div>{children}</div>\n </details>\n )\n\n case 'table_of_contents': {\n const page = getBlockParentPage(block, recordMap)\n if (!page) return null\n\n const toc = getPageTableOfContents(page, recordMap)\n const blockColor = block.format?.block_color\n\n return (\n <div className={`notion-table-of-contents ${blockColor && `notion-${blockColor}`} ${blockId}`}>\n {toc.map(tocItem => (\n <a key={tocItem.id} href={`#${uuidToId(tocItem.id)}`} className='notion-table-of-contents-item'>\n <span\n className='notion-table-of-contents-item-body'\n style={{\n display: 'inline-block',\n marginLeft: tocItem.indentLevel * 24\n }}>\n {tocItem.text}\n </span>\n </a>\n ))}\n </div>\n )\n }\n\n case 'to_do': {\n const isChecked = block.properties?.checked?.[0]?.[0] === 'Yes'\n\n return (\n <div className={`notion-to-do ${blockId}`}>\n <div className='notion-to-do-item'>\n <components.Checkbox blockId={blockId} isChecked={isChecked} />\n\n <div className={`notion-to-do-body ${isChecked && `notion-to-do-checked`}`}>\n <Text value={block.properties?.title} block={block} />\n </div>\n </div>\n\n <div className='notion-to-do-children'>{children}</div>\n </div>\n )\n }\n\n case 'transclusion_container':\n return <div className={`notion-sync-block ${blockId}`}>{children}</div>\n\n case 'transclusion_reference':\n return <SyncPointerBlock block={block} level={level + 1} {...props} />\n\n case 'alias': {\n const blockPointerId = block?.format?.alias_pointer?.id\n const linkedBlock = recordMap.block[blockPointerId]?.value\n if (!linkedBlock) {\n console.debug('\"alias\" missing block', blockPointerId)\n return null\n }\n\n return (\n <components.PageLink className={`notion-page-link ${blockPointerId}}`} href={mapPageUrl(blockPointerId)}>\n <PageTitle block={linkedBlock} />\n </components.PageLink>\n )\n }\n\n case 'table':\n return (\n <table className={`notion-simple-table ${blockId}`}>\n <tbody>{children}</tbody>\n </table>\n )\n\n case 'table_row': {\n const tableBlock = recordMap.block[block.parent_id]?.value as TableBlock\n const order = tableBlock.format?.table_block_column_order\n const formatMap = tableBlock.format?.table_block_column_format\n const backgroundColor = block.format?.block_color\n\n if (!tableBlock || !order) return null\n\n return (\n <tr className={`notion-simple-table-row ${backgroundColor && `notion-${backgroundColor}`} ${blockId}`}>\n {order.map(column => {\n const color = formatMap?.[column]?.color\n\n return (\n <td\n key={column}\n className={color ? `notion-${color}` : ''}\n style={{\n width: formatMap?.[column]?.width || 120\n }}>\n <div className='notion-simple-table-cell'>\n <Text value={block.properties?.[column] || [['ㅤ']]} block={block} />\n </div>\n </td>\n )\n })}\n </tr>\n )\n }\n\n case 'external_object_instance':\n return <EOI block={block} className={blockId} />\n\n default:\n if (process.env.NODE_ENV !== 'production')\n console.debug('Unsupported type ' + (block as BlockType).type, JSON.stringify(block, null, 2))\n\n return <div />\n }\n}\n","import React from 'react'\n\nimport mediumZoom from '@fisch0920/medium-zoom'\nimport type { ExtendedRecordMap } from '@texonom/ntypes'\n\nimport { Block } from './block'\nimport { NotionContextProvider, useNotionContext } from './context'\nimport { MapImageUrlFn, MapPageUrlFn, NotionComponents, SearchNotionFn } from './types'\n\nexport const NotionRenderer: React.FC<{\n recordMap: ExtendedRecordMap\n components?: Partial<NotionComponents>\n\n mapPageUrl?: MapPageUrlFn\n mapImageUrl?: MapImageUrlFn\n searchNotion?: SearchNotionFn\n isShowingSearch?: boolean\n onHideSearch?: () => void\n\n rootPageId?: string\n rootDomain?: string\n rootSpaceId?: string\n\n // set fullPage to false to render page content only\n // this will remove the header, cover image, and footer\n fullPage?: boolean\n\n darkMode?: boolean\n previewImages?: boolean\n forceCustomImages?: boolean\n showCollectionViewDropdown?: boolean\n linkTableTitleProperties?: boolean\n isLinkCollectionToUrlProperty?: boolean\n isImageZoomable?: boolean\n\n showTableOfContents?: boolean\n minTableOfContentsItems?: number\n\n defaultPageIcon?: string\n defaultPageCover?: string\n defaultPageCoverPosition?: number\n\n className?: string\n bodyClassName?: string\n\n header?: React.ReactNode\n footer?: React.ReactNode\n pageHeader?: React.ReactNode\n pageFooter?: React.ReactNode\n pageTitle?: React.ReactNode\n pageAside?: React.ReactNode\n pageCover?: React.ReactNode\n\n blockId?: string\n hideBlockId?: boolean\n disableHeader?: boolean\n}> = ({\n components,\n recordMap,\n mapPageUrl,\n mapImageUrl,\n searchNotion,\n isShowingSearch,\n onHideSearch,\n fullPage,\n rootPageId,\n rootDomain,\n rootSpaceId,\n darkMode,\n previewImages,\n forceCustomImages,\n showCollectionViewDropdown,\n linkTableTitleProperties,\n isLinkCollectionToUrlProperty,\n isImageZoomable = true,\n showTableOfContents,\n minTableOfContentsItems,\n defaultPageIcon,\n defaultPageCover,\n defaultPageCoverPosition,\n ...rest\n}) => {\n const zoom = React.useMemo(\n () =>\n typeof window !== 'undefined' &&\n mediumZoom({\n background: 'rgba(0, 0, 0, 0.8)',\n minZoomScale: 2.0,\n margin: getMediumZoomMargin()\n }),\n []\n )\n\n return (\n <NotionContextProvider\n components={components}\n recordMap={recordMap}\n mapPageUrl={mapPageUrl}\n mapImageUrl={mapImageUrl}\n searchNotion={searchNotion}\n isShowingSearch={isShowingSearch}\n onHideSearch={onHideSearch}\n fullPage={fullPage}\n rootPageId={rootPageId}\n rootDomain={rootDomain}\n rootSpaceId={rootSpaceId}\n darkMode={darkMode}\n previewImages={previewImages}\n forceCustomImages={forceCustomImages}\n showCollectionViewDropdown={showCollectionViewDropdown}\n linkTableTitleProperties={linkTableTitleProperties}\n isLinkCollectionToUrlProperty={isLinkCollectionToUrlProperty}\n showTableOfContents={showTableOfContents}\n minTableOfContentsItems={minTableOfContentsItems}\n defaultPageIcon={defaultPageIcon}\n defaultPageCover={defaultPageCover}\n defaultPageCoverPosition={defaultPageCoverPosition}\n zoom={isImageZoomable ? zoom : null}>\n <NotionBlockRenderer {...rest} />\n </NotionContextProvider>\n )\n}\n\nexport const NotionBlockRenderer: React.FC<{\n className?: string\n bodyClassName?: string\n header?: React.ReactNode\n footer?: React.ReactNode\n disableHeader?: boolean\n\n blockId?: string\n hideBlockId?: boolean\n level?: number\n}> = ({ level = 0, blockId, ...props }) => {\n const { recordMap } = useNotionContext()\n const id = blockId || Object.keys(recordMap.block)[0]\n const block = recordMap.block[id]?.value\n\n if (!block) {\n if (process.env.NODE_ENV !== 'production') console.warn('missing block', blockId)\n\n return null\n }\n\n return (\n <Block key={id} level={level} block={block} {...props}>\n {block?.content?.map(contentBlockId => (\n <NotionBlockRenderer key={contentBlockId} blockId={contentBlockId} level={level + 1} {...props} />\n ))}\n </Block>\n )\n}\n\nfunction getMediumZoomMargin() {\n const width = window.innerWidth\n\n if (width < 500) return 8\n else if (width < 800) return 20\n else if (width < 1280) return 30\n else if (width < 1600) return 40\n else if (width < 1920) return 48\n else return 72\n}\n"],"names":["Audio","block","className","recordMap","useNotionContext","source","_c","_b","_a","React","FileIcon","props","rest","__objRest","__spreadProps","__spreadValues","File","components","Text","_d","_e","GoogleDrive","mapImageUrl","properties","domain","err","GracefulImage","FUNC_ERROR_TEXT","NAN","symbolTag","reTrim","reIsBadHex","reIsBinary","reIsOctal","freeParseInt","freeGlobal","global","freeSelf","root","objectProto","objectToString","nativeMax","nativeMin","now","debounce","func","wait","options","lastArgs","lastThis","maxWait","result","timerId","lastCallTime","lastInvokeTime","leading","maxing","trailing","toNumber","isObject","invokeFunc","time","args","thisArg","leadingEdge","timerExpired","remainingWait","timeSinceLastCall","timeSinceLastInvoke","shouldInvoke","trailingEdge","cancel","flush","debounced","isInvoking","throttle","value","type","isObjectLike","isSymbol","other","isBinary","lodash_throttle","PageAside","toc","activeSection","setActiveSection","pageAside","hasToc","hasAside","actionSectionScrollSpy","sections","prevBBox","currentSectionId","i","section","bbox","prevHeight","offset","tocItem","id","uuidToId","SyncPointerBlock","level","syncPointerBlock","referencePointerId","NotionBlockRenderer","LinkIcon","tocIndentLevelCache","pageCoverStyleCache","Block","ctx","fullPage","mapPageUrl","showTableOfContents","minTableOfContentsItems","defaultPageIcon","defaultPageCover","defaultPageCoverPosition","children","bodyClassName","header","footer","pageHeader","pageFooter","pageTitle","pageCover","hideBlockId","disableHeader","view_block","blockId","page_icon","page_cover","page_cover_position","page_full_width","page_small_text","getBlockCollectionId","pageCoverObjectPosition","pageCoverStyle","pageIcon","getBlockIcon","isPageIconUrl","isUrl","getPageTableOfContents","hasPageCover","LazyImage","getTextContent","PageIcon","blockColor","PageTitle","title","indentLevel","indentLevelClass","page","getBlockParentPage","isH1","isH2","isH3","classNameStr","innerHeader","_f","headerBlock","_g","_h","_i","_j","wrapList","content","start","output","isTopLevel","_l","_k","getListNumber","AssetWrapper","_m","_n","spacerWidth","ratio","_o","parent","_p","style","_q","_r","_s","_t","_u","link","_v","_w","_x","e","_y","_z","_A","isChecked","_D","_C","_B","_E","blockPointerId","_G","_F","linkedBlock","_H","tableBlock","_I","order","_J","formatMap","_K","backgroundColor","_L","column","color","EOI","NotionRenderer","searchNotion","isShowingSearch","onHideSearch","rootPageId","rootDomain","rootSpaceId","darkMode","previewImages","forceCustomImages","showCollectionViewDropdown","linkTableTitleProperties","isLinkCollectionToUrlProperty","isImageZoomable","zoom","mediumZoom","getMediumZoomMargin","NotionContextProvider","contentBlockId","width"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMO,MAAMA,KAGR,CAAC,EAAE,OAAAC,GAAO,WAAAC,QAAgB;;AAC7B,QAAM,EAAE,WAAAC,EAAA,IAAcC,GAAA,GAChBC,IAASF,EAAU,YAAYF,EAAM,EAAE,OAAKK,KAAAC,KAAAC,IAAAP,EAAM,eAAN,gBAAAO,EAAkB,WAAlB,gBAAAD,EAA2B,OAA3B,gBAAAD,EAAgC;AAElF,SACE,gBAAAG,EAAA,cAAC,OAAA,EAAI,WAAW,gBAAgBP,KAAa,EAAE,GAAA,GAC7C,gBAAAO,EAAA,cAAC,SAAA,EAAM,UAAQ,IAAC,SAAQ,QAAO,KAAKJ,GAAQ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1.5.5",
3
+ "version": "1.5.7",
4
4
  "type": "module",
5
5
  "description": "Fast and accurate React renderer for Notion.",
6
6
  "repository": "texonom/notion-node",
@@ -28,8 +28,8 @@
28
28
  "react-modal": "^3.16.3",
29
29
  "react-pdf": "^10.3.0",
30
30
  "react-use": "^17.6.0",
31
- "@texonom/nutils": "^1.5.5",
32
- "@texonom/ntypes": "^1.5.5"
31
+ "@texonom/ntypes": "^1.5.7",
32
+ "@texonom/nutils": "^1.5.7"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@types/lodash.throttle": "^4.1.9",
package/src/styles.css CHANGED
@@ -976,6 +976,8 @@ svg.notion-page-icon {
976
976
  .notion-bookmark {
977
977
  margin: 4px 0;
978
978
  width: 100%;
979
+ max-width: 100%;
980
+ min-width: 0;
979
981
  box-sizing: border-box;
980
982
  text-decoration: none;
981
983
  border: 1px solid var(--fg-color-1);
@@ -991,6 +993,7 @@ svg.notion-page-icon {
991
993
 
992
994
  .notion-bookmark > div:first-child {
993
995
  flex: 4 1 180px;
996
+ min-width: 0;
994
997
  padding: 12px 14px 14px;
995
998
  overflow: hidden;
996
999
  text-align: left;
@@ -1018,6 +1021,8 @@ svg.notion-page-icon {
1018
1021
  .notion-bookmark-link {
1019
1022
  display: flex;
1020
1023
  margin-top: 6px;
1024
+ min-width: 0;
1025
+ overflow: hidden;
1021
1026
  }
1022
1027
 
1023
1028
  .notion-bookmark-link-icon {
@@ -1034,6 +1039,7 @@ svg.notion-page-icon {
1034
1039
  white-space: nowrap;
1035
1040
  overflow: hidden;
1036
1041
  text-overflow: ellipsis;
1042
+ min-width: 0;
1037
1043
  }
1038
1044
 
1039
1045
  .notion-bookmark-link-icon img {