@texonom/nreact 1.6.1 → 1.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/build/asset-wrapper-BjCXzGmC.js +1056 -0
  2. package/build/asset-wrapper-BjCXzGmC.js.map +1 -0
  3. package/build/block.d.ts.map +1 -1
  4. package/build/collection-column-title-Bw3sXBSk.js +113 -0
  5. package/build/collection-column-title-Bw3sXBSk.js.map +1 -0
  6. package/build/components/editable-text.d.ts +18 -0
  7. package/build/components/editable-text.d.ts.map +1 -0
  8. package/build/components/editable-text.test.d.ts +2 -0
  9. package/build/components/editable-text.test.d.ts.map +1 -0
  10. package/build/components/graceful-image.d.ts.map +1 -1
  11. package/build/context.d.ts +4 -0
  12. package/build/context.d.ts.map +1 -1
  13. package/build/index.js +596 -686
  14. package/build/index.js.map +1 -1
  15. package/build/renderer.d.ts +2 -0
  16. package/build/renderer.d.ts.map +1 -1
  17. package/build/rolldown-runtime-CEFd7nDs.js +30 -0
  18. package/build/third-party/code.js +559 -196
  19. package/build/third-party/code.js.map +1 -1
  20. package/build/third-party/collection.js +2690 -3432
  21. package/build/third-party/collection.js.map +1 -1
  22. package/build/third-party/equation.js +27 -43
  23. package/build/third-party/equation.js.map +1 -1
  24. package/build/third-party/modal.js +1355 -1615
  25. package/build/third-party/modal.js.map +1 -1
  26. package/license +21 -0
  27. package/package.json +16 -13
  28. package/src/styles.css +16 -0
  29. package/build/_commonjsHelpers-ByYUsBRP.js +0 -34
  30. package/build/_commonjsHelpers-ByYUsBRP.js.map +0 -1
  31. package/build/asset-wrapper-BbigBRET.js +0 -1154
  32. package/build/asset-wrapper-BbigBRET.js.map +0 -1
  33. package/build/collection-column-title-l4hmVo49.js +0 -99
  34. package/build/collection-column-title-l4hmVo49.js.map +0 -1
package/build/index.js CHANGED
@@ -1,690 +1,600 @@
1
- var Ke = Object.defineProperty, Qe = Object.defineProperties;
2
- var et = Object.getOwnPropertyDescriptors;
3
- var ge = Object.getOwnPropertySymbols;
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
- for (var o in a || (a = {}))
7
- Ue.call(a, o) && ze(n, o, a[o]);
8
- if (ge)
9
- for (var o of ge(a))
10
- We.call(a, o) && ze(n, o, a[o]);
11
- return n;
12
- }, be = (n, a) => Qe(n, et(a));
13
- var le = (n, a) => {
14
- var o = {};
15
- for (var m in n)
16
- Ue.call(n, m) && a.indexOf(m) < 0 && (o[m] = n[m]);
17
- if (n != null && ge)
18
- for (var m of ge(n))
19
- a.indexOf(m) < 0 && We.call(n, m) && (o[m] = n[m]);
20
- return o;
21
- };
22
- import e from "react";
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-BbigBRET.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-BbigBRET.js";
28
- import { c as Ee, g as st } from "./_commonjsHelpers-ByYUsBRP.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
- var r, u, v;
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
- return /* @__PURE__ */ e.createElement("div", { className: `notion-audio ${a || ""}` }, /* @__PURE__ */ e.createElement("audio", { controls: !0, preload: "none", src: m }));
34
- }, dt = (n) => {
35
- const m = n, { className: a } = m, o = le(m, ["className"]);
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
- }, ut = ({ block: n, className: a }) => {
38
- var u, v, k, y, b;
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(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
- var v;
43
- const { components: o, mapImageUrl: m } = ce(), r = (v = n.format) == null ? void 0 : v.drive_properties;
44
- if (!r) return null;
45
- let u;
46
- try {
47
- u = new URL(r.url).hostname;
48
- } catch (k) {
49
- }
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
- rt,
52
- {
53
- src: m(r.thumbnail, n),
54
- alt: r.title || "Google Drive Document",
55
- loading: "lazy"
56
- }
57
- )), /* @__PURE__ */ e.createElement("div", { className: "notion-google-drive-body" }, r.title && /* @__PURE__ */ e.createElement("div", { className: "notion-google-drive-body-title" }, r.title), r.icon && u && /* @__PURE__ */ e.createElement("div", { className: "notion-google-drive-body-source" }, r.icon && /* @__PURE__ */ e.createElement(
58
- "div",
59
- {
60
- className: "notion-google-drive-body-source-icon",
61
- style: {
62
- backgroundImage: `url(${r.icon})`
63
- }
64
- }
65
- ), u && /* @__PURE__ */ e.createElement("div", { className: "notion-google-drive-body-source-domain" }, u)))));
66
- };
67
- var Ne, Ze;
68
- function ft() {
69
- if (Ze) return Ne;
70
- Ze = 1;
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
- return _.Date.now();
73
- };
74
- function B(i, f, h) {
75
- var N, I, q, c, x, S, H = 0, te = !1, A = !1, G = !0;
76
- if (typeof i != "function")
77
- throw new TypeError(n);
78
- f = R(f) || 0, M(h) && (te = !!h.leading, A = "maxWait" in h, q = A ? L(R(h.maxWait) || 0, f) : q, G = "trailing" in h ? !!h.trailing : G);
79
- function Y(E) {
80
- var P = N, F = I;
81
- return N = I = void 0, H = E, c = i.apply(F, P), c;
82
- }
83
- function se(E) {
84
- return H = E, x = setTimeout(z, f), te ? Y(E) : c;
85
- }
86
- function me(E) {
87
- var P = E - S, F = E - H, ae = f - P;
88
- return A ? t(ae, q - F) : ae;
89
- }
90
- function ne(E) {
91
- var P = E - S, F = E - H;
92
- return S === void 0 || P >= f || P < 0 || A && F >= q;
93
- }
94
- function z() {
95
- var E = g();
96
- if (ne(E))
97
- return oe(E);
98
- x = setTimeout(z, me(E));
99
- }
100
- function oe(E) {
101
- return x = void 0, G && N ? Y(E) : (N = I = void 0, c);
102
- }
103
- function de() {
104
- x !== void 0 && clearTimeout(x), H = 0, N = S = I = x = void 0;
105
- }
106
- function ue() {
107
- return x === void 0 ? c : oe(g());
108
- }
109
- function Z() {
110
- var E = g(), P = ne(E);
111
- if (N = arguments, I = this, S = E, P) {
112
- if (x === void 0)
113
- return se(S);
114
- if (A)
115
- return x = setTimeout(z, f), Y(S);
116
- }
117
- return x === void 0 && (x = setTimeout(z, f)), c;
118
- }
119
- return Z.cancel = de, Z.flush = ue, Z;
120
- }
121
- function V(i, f, h) {
122
- var N = !0, I = !0;
123
- if (typeof i != "function")
124
- throw new TypeError(n);
125
- return M(h) && (N = "leading" in h ? !!h.leading : N, I = "trailing" in h ? !!h.trailing : I), B(i, f, {
126
- leading: N,
127
- maxWait: f,
128
- trailing: I
129
- });
130
- }
131
- function M(i) {
132
- var f = typeof i;
133
- return !!i && (f == "object" || f == "function");
134
- }
135
- function Q(i) {
136
- return !!i && typeof i == "object";
137
- }
138
- function ee(i) {
139
- return typeof i == "symbol" || Q(i) && O.call(i) == o;
140
- }
141
- function R(i) {
142
- if (typeof i == "number")
143
- return i;
144
- if (ee(i))
145
- return a;
146
- if (M(i)) {
147
- var f = typeof i.valueOf == "function" ? i.valueOf() : i;
148
- i = M(f) ? f + "" : f;
149
- }
150
- if (typeof i != "string")
151
- return i === 0 ? i : +i;
152
- i = i.replace(m, "");
153
- var h = u.test(i);
154
- return h || v.test(i) ? k(i.slice(2), h ? 2 : 8) : r.test(i) ? a : +i;
155
- }
156
- return Ne = V, Ne;
157
- }
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
- const y = e.useMemo(
161
- () => Et(() => {
162
- const b = document.getElementsByClassName("notion-h");
163
- let _ = null, T = a;
164
- for (let O = 0; O < b.length; ++O) {
165
- const L = b[O];
166
- if (!L || !(L instanceof Element)) continue;
167
- T || (T = L.getAttribute("data-id"));
168
- const t = L.getBoundingClientRect(), g = _ ? t.top - _.bottom : 0, B = Math.max(150, g / 4);
169
- if (t.top - B < 0) {
170
- T = L.getAttribute("data-id"), _ = t;
171
- continue;
172
- }
173
- break;
174
- }
175
- o(T);
176
- }, 100),
177
- // eslint-disable-next-line react-hooks/exhaustive-deps
178
- [
179
- // explicitly not taking a dependency on activeSection
180
- o
181
- ]
182
- );
183
- return e.useEffect(() => {
184
- if (r)
185
- return window.addEventListener("scroll", y), y(), () => {
186
- window.removeEventListener("scroll", y);
187
- };
188
- }, [r, y]), u ? /* @__PURE__ */ e.createElement("aside", { className: `notion-aside ${v || ""}` }, r && /* @__PURE__ */ e.createElement("div", { className: "notion-aside-table-of-contents" }, /* @__PURE__ */ e.createElement("div", { className: "notion-aside-table-of-contents-header" }, "Table of Contents"), /* @__PURE__ */ e.createElement("nav", { className: "notion-table-of-contents" }, n.map((b) => {
189
- const _ = ve(b.id);
190
- return /* @__PURE__ */ e.createElement(
191
- "a",
192
- {
193
- key: _,
194
- href: `#${_}`,
195
- className: `notion-table-of-contents-item
196
- notion-table-of-contents-item-indent-level-${b.indentLevel}
197
- ${a === _ && "notion-table-of-contents-active-item"}`
198
- },
199
- /* @__PURE__ */ e.createElement(
200
- "span",
201
- {
202
- className: "notion-table-of-contents-item-body",
203
- style: {
204
- display: "inline-block",
205
- marginLeft: b.indentLevel * 16
206
- }
207
- },
208
- b.text
209
- )
210
- );
211
- }))), m) : null;
212
- }, bt = ({ block: n, level: a }) => {
213
- var r, u;
214
- if (!n)
215
- return process.env.NODE_ENV !== "production" && console.warn("missing sync pointer block", n.id), null;
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
- return m ? /* @__PURE__ */ e.createElement(ye, { key: m, level: a, blockId: m }) : null;
218
- }, ht = (n) => {
219
- const m = n, { className: a } = m, o = le(m, ["className"]);
220
- return /* @__PURE__ */ e.createElement("svg", be(W({ className: a }, o), { viewBox: "0 0 16 16", width: "16", height: "16" }), /* @__PURE__ */ e.createElement(
221
- "path",
222
- {
223
- fillRule: "evenodd",
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
- }
226
- ));
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
- const a = ce(), {
230
- components: o,
231
- fullPage: m,
232
- recordMap: r,
233
- mapPageUrl: u,
234
- mapImageUrl: v,
235
- showTableOfContents: k,
236
- minTableOfContentsItems: y,
237
- defaultPageIcon: b,
238
- defaultPageCover: _,
239
- defaultPageCoverPosition: T
240
- } = a, [O, L] = e.useState(null), {
241
- block: t,
242
- children: g,
243
- level: B,
244
- className: V,
245
- bodyClassName: M,
246
- header: Q,
247
- footer: ee,
248
- pageHeader: R,
249
- pageFooter: i,
250
- pageTitle: f,
251
- pageAside: h,
252
- pageCover: N,
253
- hideBlockId: I,
254
- disableHeader: q
255
- } = n;
256
- if (!t) return null;
257
- if (B === 0 && t.type === "collection_view") {
258
- const l = t;
259
- l.type = "collection_view_page";
260
- }
261
- const c = I ? "notion-block" : `notion-block-${ve(t.id)}`;
262
- switch (t.type) {
263
- case "collection_view_page":
264
- // fallthrough
265
- case "page":
266
- if (B === 0) {
267
- const {
268
- page_icon: l = b,
269
- page_cover: s = _,
270
- page_cover_position: p = T,
271
- page_full_width: d,
272
- page_small_text: w
273
- } = t.format || {};
274
- if (m) {
275
- const $ = t.type === "page" ? t.properties : {
276
- title: (S = (x = r.collection[nt(t, r)]) == null ? void 0 : x.value) == null ? void 0 : S.name
277
- }, D = `center ${(1 - (p || 0.5)) * 100}%`;
278
- let j = Xe[D];
279
- j || (j = Xe[D] = {
280
- objectPosition: D
281
- });
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
- 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
- ke,
285
- {
286
- src: v(s, t),
287
- alt: ie($ == null ? void 0 : $.title),
288
- priority: !0,
289
- className: "notion-page-cover",
290
- style: j
291
- }
292
- ))), /* @__PURE__ */ e.createElement(
293
- "main",
294
- {
295
- className: `notion-page
296
- ${fe ? "notion-page-has-cover" : "notion-page-no-cover"}
297
- ${l ? "notion-page-has-icon" : "notion-page-no-icon"}
298
- ${U ? "notion-page-has-image-icon" : "notion-page-has-text-icon"}
1
+ import { o as e, t } from "./rolldown-runtime-CEFd7nDs.js";
2
+ import { A as n, C as r, D as i, E as a, O as o, S as s, T as c, _ as l, a as u, b as d, c as f, d as p, g as m, h, i as g, j as _, k as v, l as y, m as b, n as x, o as S, r as C, s as w, t as T, u as E, v as D, w as O, x as k, y as A } from "./asset-wrapper-BjCXzGmC.js";
3
+ import { n as ee, r as j, t as M } from "./collection-column-title-Bw3sXBSk.js";
4
+ import N from "react";
5
+ import P from "@fisch0920/medium-zoom";
6
+ import { getBlockCollectionId as te, getBlockIcon as ne, getBlockParentPage as F, getPageTableOfContents as I, getTextContent as L, isEditableBlock as re, uuidToId as R } from "@texonom/nutils";
7
+ //#region src/components/audio.tsx
8
+ var ie = ({ block: e, className: t }) => {
9
+ var n;
10
+ let { recordMap: r } = w(), i = r.signed_urls[e.id] || ((n = e.properties) == null || (n = n.source) == null || (n = n[0]) == null ? void 0 : n[0]);
11
+ return /* @__PURE__ */ N.createElement("div", { className: `notion-audio ${t || ""}` }, /* @__PURE__ */ N.createElement("audio", {
12
+ controls: !0,
13
+ preload: "none",
14
+ src: i
15
+ }));
16
+ }, z = ["className"], B = (e) => {
17
+ let { className: t } = e, n = v(e, z);
18
+ return /* @__PURE__ */ N.createElement("svg", _(_({ className: t }, n), {}, { viewBox: "0 0 30 30" }), /* @__PURE__ */ N.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" }));
19
+ }, ae = ({ block: e, className: t }) => {
20
+ var n, r, i;
21
+ let { components: a, recordMap: o } = w(), s = o.signed_urls[e.id] || ((n = e.properties) == null || (n = n.source) == null || (n = n[0]) == null ? void 0 : n[0]);
22
+ return /* @__PURE__ */ N.createElement("div", { className: `notion-file ${t || ""}` }, /* @__PURE__ */ N.createElement(a.Link, {
23
+ className: "notion-file-link",
24
+ href: s,
25
+ target: "_blank",
26
+ rel: "noopener noreferrer"
27
+ }, /* @__PURE__ */ N.createElement(B, { className: "notion-file-icon" }), /* @__PURE__ */ N.createElement("div", { className: "notion-file-info" }, /* @__PURE__ */ N.createElement("div", { className: "notion-file-title" }, /* @__PURE__ */ N.createElement(m, {
28
+ value: ((r = e.properties) == null ? void 0 : r.title) || [["File"]],
29
+ block: e
30
+ })), ((i = e.properties) == null ? void 0 : i.size) && /* @__PURE__ */ N.createElement("div", { className: "notion-file-size" }, /* @__PURE__ */ N.createElement(m, {
31
+ value: e.properties.size,
32
+ block: e
33
+ })))));
34
+ }, oe = ({ block: e, className: t }) => {
35
+ var n;
36
+ let { components: r, mapImageUrl: i } = w(), a = (n = e.format) == null ? void 0 : n.drive_properties;
37
+ if (!a) return null;
38
+ let o;
39
+ try {
40
+ o = new URL(a.url).hostname;
41
+ } catch (e) {}
42
+ return /* @__PURE__ */ N.createElement("div", { className: `notion-google-drive ${t || ""}` }, /* @__PURE__ */ N.createElement(r.Link, {
43
+ className: "notion-google-drive-link",
44
+ href: a.url,
45
+ target: "_blank",
46
+ rel: "noopener noreferrer"
47
+ }, /* @__PURE__ */ N.createElement("div", { className: "notion-google-drive-preview" }, /* @__PURE__ */ N.createElement(l, {
48
+ src: i(a.thumbnail, e),
49
+ alt: a.title || "Google Drive Document",
50
+ loading: "lazy"
51
+ })), /* @__PURE__ */ N.createElement("div", { className: "notion-google-drive-body" }, a.title && /* @__PURE__ */ N.createElement("div", { className: "notion-google-drive-body-title" }, a.title), a.icon && o && /* @__PURE__ */ N.createElement("div", { className: "notion-google-drive-body-source" }, a.icon && /* @__PURE__ */ N.createElement("div", {
52
+ className: "notion-google-drive-body-source-icon",
53
+ style: { backgroundImage: `url(${a.icon})` }
54
+ }), o && /* @__PURE__ */ N.createElement("div", { className: "notion-google-drive-body-source-domain" }, o)))));
55
+ }, se = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
56
+ var n = "Expected a function", r = NaN, i = /^\s+|\s+$/g, a = /^[-+]0x[0-9a-f]+$/i, o = /^0b[01]+$/i, s = /^0o[0-7]+$/i, c = parseInt, l = typeof global == "object" && global && global.Object === Object && global, u = typeof self == "object" && self && self.Object === Object && self, d = l || u || Function("return this")(), f = Object.prototype.toString, p = Math.max, m = Math.min, h = function() {
57
+ return d.Date.now();
58
+ };
59
+ function g(e, t, r) {
60
+ var i, a, o, s, c, l, u = 0, d = !1, f = !1, g = !0;
61
+ if (typeof e != "function") throw TypeError(n);
62
+ t = x(t) || 0, v(r) && (d = !!r.leading, f = "maxWait" in r, o = f ? p(x(r.maxWait) || 0, t) : o, g = "trailing" in r ? !!r.trailing : g);
63
+ function _(t) {
64
+ var n = i, r = a;
65
+ return i = a = void 0, u = t, s = e.apply(r, n), s;
66
+ }
67
+ function y(e) {
68
+ return u = e, c = setTimeout(C, t), d ? _(e) : s;
69
+ }
70
+ function b(e) {
71
+ var n = e - l, r = e - u, i = t - n;
72
+ return f ? m(i, o - r) : i;
73
+ }
74
+ function S(e) {
75
+ var n = e - l, r = e - u;
76
+ return l === void 0 || n >= t || n < 0 || f && r >= o;
77
+ }
78
+ function C() {
79
+ var e = h();
80
+ if (S(e)) return w(e);
81
+ c = setTimeout(C, b(e));
82
+ }
83
+ function w(e) {
84
+ return c = void 0, g && i ? _(e) : (i = a = void 0, s);
85
+ }
86
+ function T() {
87
+ c !== void 0 && clearTimeout(c), u = 0, i = l = a = c = void 0;
88
+ }
89
+ function E() {
90
+ return c === void 0 ? s : w(h());
91
+ }
92
+ function D() {
93
+ var e = h(), n = S(e);
94
+ if (i = arguments, a = this, l = e, n) {
95
+ if (c === void 0) return y(l);
96
+ if (f) return c = setTimeout(C, t), _(l);
97
+ }
98
+ return c === void 0 && (c = setTimeout(C, t)), s;
99
+ }
100
+ return D.cancel = T, D.flush = E, D;
101
+ }
102
+ function _(e, t, r) {
103
+ var i = !0, a = !0;
104
+ if (typeof e != "function") throw TypeError(n);
105
+ return v(r) && (i = "leading" in r ? !!r.leading : i, a = "trailing" in r ? !!r.trailing : a), g(e, t, {
106
+ leading: i,
107
+ maxWait: t,
108
+ trailing: a
109
+ });
110
+ }
111
+ function v(e) {
112
+ var t = typeof e;
113
+ return !!e && (t == "object" || t == "function");
114
+ }
115
+ function y(e) {
116
+ return !!e && typeof e == "object";
117
+ }
118
+ function b(e) {
119
+ return typeof e == "symbol" || y(e) && f.call(e) == "[object Symbol]";
120
+ }
121
+ function x(e) {
122
+ if (typeof e == "number") return e;
123
+ if (b(e)) return r;
124
+ if (v(e)) {
125
+ var t = typeof e.valueOf == "function" ? e.valueOf() : e;
126
+ e = v(t) ? t + "" : t;
127
+ }
128
+ if (typeof e != "string") return e === 0 ? e : +e;
129
+ e = e.replace(i, "");
130
+ var n = o.test(e);
131
+ return n || s.test(e) ? c(e.slice(2), n ? 2 : 8) : a.test(e) ? r : +e;
132
+ }
133
+ t.exports = _;
134
+ })))(), 1), ce = ({ toc: e, activeSection: t, setActiveSection: n, pageAside: r, hasToc: i, hasAside: a, className: o }) => {
135
+ let s = N.useMemo(() => (0, se.default)(() => {
136
+ let e = document.getElementsByClassName("notion-h"), r = null, i = t;
137
+ for (let t = 0; t < e.length; ++t) {
138
+ let n = e[t];
139
+ if (!n || !(n instanceof Element)) continue;
140
+ i || (i = n.getAttribute("data-id"));
141
+ let a = n.getBoundingClientRect(), o = r ? a.top - r.bottom : 0, s = Math.max(150, o / 4);
142
+ if (a.top - s < 0) i = n.getAttribute("data-id"), r = a;
143
+ else break;
144
+ }
145
+ n(i);
146
+ }, 100), [n]);
147
+ return N.useEffect(() => {
148
+ if (i) return window.addEventListener("scroll", s), s(), () => {
149
+ window.removeEventListener("scroll", s);
150
+ };
151
+ }, [i, s]), a ? /* @__PURE__ */ N.createElement("aside", { className: `notion-aside ${o || ""}` }, i && /* @__PURE__ */ N.createElement("div", { className: "notion-aside-table-of-contents" }, /* @__PURE__ */ N.createElement("div", { className: "notion-aside-table-of-contents-header" }, "Table of Contents"), /* @__PURE__ */ N.createElement("nav", { className: "notion-table-of-contents" }, e.map((e) => {
152
+ let n = R(e.id);
153
+ return /* @__PURE__ */ N.createElement("a", {
154
+ key: n,
155
+ href: `#${n}`,
156
+ className: `notion-table-of-contents-item
157
+ notion-table-of-contents-item-indent-level-${e.indentLevel}
158
+ ${t === n && "notion-table-of-contents-active-item"}`
159
+ }, /* @__PURE__ */ N.createElement("span", {
160
+ className: "notion-table-of-contents-item-body",
161
+ style: {
162
+ display: "inline-block",
163
+ marginLeft: e.indentLevel * 16
164
+ }
165
+ }, e.text));
166
+ }))), r) : null;
167
+ }, le = ({ block: e, level: t }) => {
168
+ var n;
169
+ if (!e) return process.env.NODE_ENV !== "production" && console.warn("missing sync pointer block", e.id), null;
170
+ let r = e, i = r == null || (n = r.format) == null || (n = n.transclusion_reference_pointer) == null ? void 0 : n.id;
171
+ return i ? /* @__PURE__ */ N.createElement(J, {
172
+ key: i,
173
+ level: t,
174
+ blockId: i
175
+ }) : null;
176
+ }, ue = ({ block: e }) => {
177
+ var t, n;
178
+ let { onChangeBlock: r } = w(), i = N.useRef(null), a = L((t = (n = e.properties) == null ? void 0 : n.title) == null ? [] : t), o = N.useRef(null);
179
+ return N.useEffect(() => {
180
+ let e = i.current;
181
+ e && a !== o.current && e !== document.activeElement && (e.innerText = a, o.current = a);
182
+ }, [a]), /* @__PURE__ */ N.createElement("span", {
183
+ ref: i,
184
+ className: "notion-text-editable",
185
+ role: "textbox",
186
+ "aria-multiline": "true",
187
+ contentEditable: !0,
188
+ suppressContentEditableWarning: !0,
189
+ spellCheck: !0,
190
+ onBlur: (t) => {
191
+ let n = t.currentTarget.innerText.replace(/\n+$/, "");
192
+ n !== o.current && (o.current = n, r == null || r(e.id, n));
193
+ }
194
+ });
195
+ }, V = ["className"], de = (e) => {
196
+ let { className: t } = e, n = v(e, V);
197
+ return /* @__PURE__ */ N.createElement("svg", _(_({ className: t }, n), {}, {
198
+ viewBox: "0 0 16 16",
199
+ width: "16",
200
+ height: "16"
201
+ }), /* @__PURE__ */ N.createElement("path", {
202
+ fillRule: "evenodd",
203
+ 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"
204
+ }));
205
+ }, H = {}, U = {}, W = (e) => {
206
+ let t = w(), { components: n, fullPage: r, recordMap: i, mapPageUrl: a, mapImageUrl: s, showTableOfContents: l, minTableOfContentsItems: u, defaultPageIcon: d, defaultPageCover: f, defaultPageCoverPosition: p, editable: h } = t, [g, v] = N.useState(null), { block: y, children: x, level: S, className: C, bodyClassName: E, header: O, footer: ee, pageHeader: j, pageFooter: M, pageTitle: P, pageAside: z, pageCover: B, hideBlockId: se, disableHeader: V } = e;
207
+ if (!y) return null;
208
+ if (S === 0 && y.type === "collection_view") {
209
+ let e = y;
210
+ e.type = "collection_view_page";
211
+ }
212
+ let W = se ? "notion-block" : `notion-block-${R(y.id)}`, G = () => h && re(y) ? /* @__PURE__ */ N.createElement(ue, { block: y }) : /* @__PURE__ */ N.createElement(m, {
213
+ value: y.properties.title,
214
+ block: y
215
+ });
216
+ switch (y.type) {
217
+ case "collection_view_page":
218
+ case "page":
219
+ if (S === 0) {
220
+ let { page_icon: e = d, page_cover: a = f, page_cover_position: c = p, page_full_width: h, page_small_text: _ } = y.format || {};
221
+ if (r) {
222
+ var K, q;
223
+ let r = y.type === "page" ? y.properties : { title: (K = i.collection[te(y, i)]) == null || (K = K.value) == null ? void 0 : K.name }, f = `center ${(1 - (c || .5)) * 100}%`, p = U[f];
224
+ p || (p = U[f] = { objectPosition: f });
225
+ let b = (q = ne(y, i)) == null ? d : q, S = b && o(b), w = I(y, i), T = l && w.length >= u, D = (T || z) && !h, F = B || a;
226
+ return /* @__PURE__ */ N.createElement("div", { className: `notion notion-app ${W} ${C || ""}` }, /* @__PURE__ */ N.createElement("div", { className: "notion-viewport" }), /* @__PURE__ */ N.createElement("div", { className: "notion-frame" }, !V && /* @__PURE__ */ N.createElement(n.Header, { block: y }), O, /* @__PURE__ */ N.createElement("div", { className: "notion-page-scroller" }, F && (B || /* @__PURE__ */ N.createElement("div", { className: "notion-page-cover-wrapper" }, /* @__PURE__ */ N.createElement(k, {
227
+ src: s(a, y),
228
+ alt: L(r == null ? void 0 : r.title),
229
+ priority: !0,
230
+ className: "notion-page-cover",
231
+ style: p
232
+ }))), /* @__PURE__ */ N.createElement("main", { className: `notion-page
233
+ ${F ? "notion-page-has-cover" : "notion-page-no-cover"}
234
+ ${e ? "notion-page-has-icon" : "notion-page-no-icon"}
235
+ ${S ? "notion-page-has-image-icon" : "notion-page-has-text-icon"}
299
236
  notion-full-page
300
- ${d && "notion-full-width"}
301
- ${w && "notion-small-text"}
302
- ${M}`
303
- },
304
- l && /* @__PURE__ */ e.createElement(Ge, { block: t, defaultIcon: b, inline: !1 }),
305
- R,
306
- /* @__PURE__ */ e.createElement("h1", { className: "notion-title" }, f != null ? f : /* @__PURE__ */ e.createElement(C, { value: $ == null ? void 0 : $.title, block: t })),
307
- (t.type === "collection_view_page" || t.type === "page" && t.parent_table === "collection") && /* @__PURE__ */ e.createElement(o.Collection, { block: t, ctx: a }),
308
- t.type !== "collection_view_page" && /* @__PURE__ */ e.createElement(
309
- "div",
310
- {
311
- className: `notion-page-content
312
- ${K && "notion-page-content-has-aside"}
313
- ${pe && "notion-page-content-has-toc"}`
314
- },
315
- /* @__PURE__ */ e.createElement("article", { className: "notion-page-content-inner" }, g),
316
- K && /* @__PURE__ */ e.createElement(
317
- vt,
318
- {
319
- toc: re,
320
- activeSection: O,
321
- setActiveSection: L,
322
- hasToc: pe,
323
- hasAside: K,
324
- pageAside: h
325
- }
326
- )
327
- ),
328
- i
329
- ), ee)));
330
- } else
331
- return /* @__PURE__ */ e.createElement(
332
- "main",
333
- {
334
- className: `notion
237
+ ${h && "notion-full-width"}
238
+ ${_ && "notion-small-text"}
239
+ ${E}` }, e && /* @__PURE__ */ N.createElement(A, {
240
+ block: y,
241
+ defaultIcon: d,
242
+ inline: !1
243
+ }), j, /* @__PURE__ */ N.createElement("h1", { className: "notion-title" }, P == null ? /* @__PURE__ */ N.createElement(m, {
244
+ value: r == null ? void 0 : r.title,
245
+ block: y
246
+ }) : P), (y.type === "collection_view_page" || y.type === "page" && y.parent_table === "collection") && /* @__PURE__ */ N.createElement(n.Collection, {
247
+ block: y,
248
+ ctx: t
249
+ }), y.type !== "collection_view_page" && /* @__PURE__ */ N.createElement("div", { className: `notion-page-content
250
+ ${D && "notion-page-content-has-aside"}
251
+ ${T && "notion-page-content-has-toc"}` }, /* @__PURE__ */ N.createElement("article", { className: "notion-page-content-inner" }, x), D && /* @__PURE__ */ N.createElement(ce, {
252
+ toc: w,
253
+ activeSection: g,
254
+ setActiveSection: v,
255
+ hasToc: T,
256
+ hasAside: D,
257
+ pageAside: z
258
+ })), M), ee)));
259
+ }
260
+ return /* @__PURE__ */ N.createElement("main", { className: `notion
335
261
  notion-page
336
- ${d && "notion-full-width"}
337
- ${w && "notion-small-text"}
338
- ${c}
339
- ${V || ""}
340
- ${M}`
341
- },
342
- /* @__PURE__ */ e.createElement("div", { className: "notion-viewport" }),
343
- R,
344
- (t.type === "collection_view_page" || t.type === "page" && t.parent_table === "collection") && /* @__PURE__ */ e.createElement(o.Collection, { block: t, ctx: a }),
345
- t.type !== "collection_view_page" && g,
346
- i
347
- );
348
- } else {
349
- const l = (te = t.format) == null ? void 0 : te.block_color;
350
- return /* @__PURE__ */ e.createElement(
351
- o.PageLink,
352
- {
353
- className: `notion-page-link ${l && `notion-${l}`} ${c}`,
354
- href: u(t.id)
355
- },
356
- /* @__PURE__ */ e.createElement(qe, { block: t })
357
- );
358
- }
359
- case "header":
360
- // fallthrough
361
- case "sub_header":
362
- // fallthrough
363
- case "sub_sub_header": {
364
- if (!t.properties) return null;
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 = Je[t.id], w;
367
- if (d === void 0) {
368
- const re = Ve(t, r);
369
- if (re) {
370
- const K = he(re, r).find((fe) => fe.id === t.id);
371
- K && (d = K.indentLevel, Je[t.id] = d);
372
- }
373
- }
374
- d !== void 0 && (w = `notion-h-indent-${d}`);
375
- const $ = t.type === "header", J = t.type === "sub_header", D = t.type === "sub_sub_header", j = `${$ && "notion-h notion-h1"}
376
- ${J && "notion-h notion-h2"}
377
- ${D && "notion-h notion-h3"}
378
- ${l && `notion-${l}`}
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(ht, null)), /* @__PURE__ */ e.createElement("span", { className: "notion-h-title" }, /* @__PURE__ */ e.createElement(C, { value: t.properties.title, block: t })));
381
- let U = null;
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
- }
384
- case "divider":
385
- return /* @__PURE__ */ e.createElement("hr", { className: `notion-hr ${c}` });
386
- case "text": {
387
- if (!t.properties && !((se = t.content) != null && se.length)) return /* @__PURE__ */ e.createElement("div", { className: `notion-blank ${c}` }, " ");
388
- const l = (me = t.format) == null ? void 0 : me.block_color;
389
- return /* @__PURE__ */ e.createElement("div", { className: `notion-text ${l && `notion-${l}`} ${c}` }, ((ne = t.properties) == null ? void 0 : ne.title) && /* @__PURE__ */ e.createElement(C, { value: t.properties.title, block: t }), g && /* @__PURE__ */ e.createElement("div", { className: "notion-text-children" }, g));
390
- }
391
- case "bulleted_list":
392
- // fallthrough
393
- case "numbered_list": {
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
- let s = null;
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 = it(t.id, r.block);
398
- return p ? l(s, d) : s;
399
- }
400
- case "embed":
401
- return /* @__PURE__ */ e.createElement(o.Embed, { blockId: c, block: t });
402
- case "tweet":
403
- // fallthrough
404
- case "maps":
405
- // fallthrough
406
- case "pdf":
407
- // fallthrough
408
- case "figma":
409
- // fallthrough
410
- case "typeform":
411
- // fallthrough
412
- case "codepen":
413
- // fallthrough
414
- case "excalidraw":
415
- // fallthrough
416
- case "image":
417
- // fallthrough
418
- case "gist":
419
- // fallthrough
420
- case "video":
421
- return /* @__PURE__ */ e.createElement(Ye, { blockId: c, block: t });
422
- case "drive":
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
- case "audio":
425
- return /* @__PURE__ */ e.createElement(mt, { block: t, className: c });
426
- case "file":
427
- return /* @__PURE__ */ e.createElement(ut, { block: t, className: c });
428
- case "equation":
429
- return /* @__PURE__ */ e.createElement(o.Equation, { block: t, inline: !1, className: c });
430
- case "code":
431
- return /* @__PURE__ */ e.createElement(o.Code, { block: t });
432
- case "column_list":
433
- return /* @__PURE__ */ e.createElement("div", { className: `notion-row ${c}` }, g);
434
- case "column": {
435
- const l = "min(32px, 4vw)", s = ((Z = t.format) == null ? void 0 : Z.column_ratio) || 0.5, p = (E = r.block[t.parent_id]) == null ? void 0 : E.value, $ = { width: `calc((100% - (${(((P = p == null ? void 0 : p.content) == null ? void 0 : P.length) || Math.max(2, Math.ceil(1 / s))) - 1} * ${l})) * ${s})` };
436
- return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("div", { className: `notion-column ${c}`, style: $ }, g), /* @__PURE__ */ e.createElement("div", { className: "notion-spacer" }));
437
- }
438
- case "quote": {
439
- if (!t.properties) return null;
440
- const l = (F = t.format) == null ? void 0 : F.block_color;
441
- return /* @__PURE__ */ e.createElement("blockquote", { className: `notion-quote ${l && `notion-${l}`} ${c}` }, /* @__PURE__ */ e.createElement("div", null, /* @__PURE__ */ e.createElement(C, { value: t.properties.title, block: t })), g);
442
- }
443
- case "collection_view":
444
- return /* @__PURE__ */ e.createElement(o.Collection, { block: t, className: c, ctx: a });
445
- case "callout":
446
- return o.Callout ? /* @__PURE__ */ e.createElement(o.Callout, { block: t, className: c }) : /* @__PURE__ */ e.createElement(
447
- "div",
448
- {
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
- },
451
- /* @__PURE__ */ e.createElement(Ge, { block: t }),
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
- );
454
- case "bookmark": {
455
- if (!t.properties) return null;
456
- const l = t.properties.link;
457
- if (!l || !((Ce = l[0]) != null && Ce[0])) return null;
458
- let s = ie(t.properties.title);
459
- if (s || (s = ie(l)), s && s.startsWith("http"))
460
- try {
461
- s = new URL(s).hostname;
462
- } catch (p) {
463
- }
464
- return /* @__PURE__ */ e.createElement(
465
- "a",
466
- {
467
- target: "_blank",
468
- rel: "noopener noreferrer",
469
- className: `notion-bookmark ${(xe = t.format) != null && xe.block_color ? `notion-${t.format.block_color}` : ""} ${c}`,
470
- href: l[0][0]
471
- },
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
- ke,
474
- {
475
- src: v(t.format.bookmark_icon, t),
476
- alt: s,
477
- onError: (p) => {
478
- const d = p.currentTarget.closest(".notion-bookmark-link-icon");
479
- d && (d.style.display = "none");
480
- }
481
- }
482
- )), /* @__PURE__ */ e.createElement("div", { className: "notion-bookmark-link-text" }, /* @__PURE__ */ e.createElement(C, { value: l, block: t })))),
483
- ((Ie = t.format) == null ? void 0 : Ie.bookmark_cover) && /* @__PURE__ */ e.createElement("div", { className: "notion-bookmark-image" }, /* @__PURE__ */ e.createElement(
484
- ke,
485
- {
486
- src: v(t.format.bookmark_cover, t),
487
- alt: ie(t.properties.title),
488
- style: {
489
- objectFit: "cover"
490
- },
491
- onError: (p) => {
492
- const d = p.currentTarget.closest(".notion-bookmark-image");
493
- d && (d.style.display = "none");
494
- }
495
- }
496
- ))
497
- );
498
- }
499
- case "toggle":
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
- case "table_of_contents": {
502
- const l = Ve(t, r);
503
- if (!l) return null;
504
- const s = he(l, r), p = (Pe = t.format) == null ? void 0 : Pe.block_color;
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
- "span",
507
- {
508
- className: "notion-table-of-contents-item-body",
509
- style: {
510
- display: "inline-block",
511
- marginLeft: d.indentLevel * 24
512
- }
513
- },
514
- d.text
515
- ))));
516
- }
517
- case "to_do": {
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
- }
521
- case "transclusion_container":
522
- return /* @__PURE__ */ e.createElement("div", { className: `notion-sync-block ${c}` }, g);
523
- case "transclusion_reference":
524
- return /* @__PURE__ */ e.createElement(bt, W({ block: t, level: B + 1 }, n));
525
- case "alias": {
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
- }
529
- case "table":
530
- return /* @__PURE__ */ e.createElement("table", { className: `notion-simple-table ${c}` }, /* @__PURE__ */ e.createElement("tbody", null, g));
531
- case "table_row": {
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
- return !l || !s ? null : /* @__PURE__ */ e.createElement("tr", { className: `notion-simple-table-row ${d && `notion-${d}`} ${c}` }, s.map((w) => {
534
- var J, D, j;
535
- const $ = (J = p == null ? void 0 : p[w]) == null ? void 0 : J.color;
536
- return /* @__PURE__ */ e.createElement(
537
- "td",
538
- {
539
- key: w,
540
- className: $ ? `notion-${$}` : "",
541
- style: {
542
- width: ((D = p == null ? void 0 : p[w]) == null ? void 0 : D.width) || 120
543
- }
544
- },
545
- /* @__PURE__ */ e.createElement("div", { className: "notion-simple-table-cell" }, /* @__PURE__ */ e.createElement(C, { value: ((j = t.properties) == null ? void 0 : j[w]) || [["ㅤ"]], block: t }))
546
- );
547
- }));
548
- }
549
- case "external_object_instance":
550
- return /* @__PURE__ */ e.createElement(lt, { block: t, className: c });
551
- default:
552
- return process.env.NODE_ENV !== "production" && console.debug("Unsupported type " + t.type, JSON.stringify(t, null, 2)), /* @__PURE__ */ e.createElement("div", null);
553
- }
554
- }, It = (h) => {
555
- var N = h, {
556
- components: n,
557
- recordMap: a,
558
- mapPageUrl: o,
559
- mapImageUrl: m,
560
- searchNotion: r,
561
- isShowingSearch: u,
562
- onHideSearch: v,
563
- fullPage: k,
564
- rootPageId: y,
565
- rootDomain: b,
566
- rootSpaceId: _,
567
- darkMode: T,
568
- previewImages: O,
569
- forceCustomImages: L,
570
- showCollectionViewDropdown: t,
571
- linkTableTitleProperties: g,
572
- isLinkCollectionToUrlProperty: B,
573
- isImageZoomable: V = !0,
574
- showTableOfContents: M,
575
- minTableOfContentsItems: Q,
576
- defaultPageIcon: ee,
577
- defaultPageCover: R,
578
- defaultPageCoverPosition: i
579
- } = N, f = le(N, [
580
- "components",
581
- "recordMap",
582
- "mapPageUrl",
583
- "mapImageUrl",
584
- "searchNotion",
585
- "isShowingSearch",
586
- "onHideSearch",
587
- "fullPage",
588
- "rootPageId",
589
- "rootDomain",
590
- "rootSpaceId",
591
- "darkMode",
592
- "previewImages",
593
- "forceCustomImages",
594
- "showCollectionViewDropdown",
595
- "linkTableTitleProperties",
596
- "isLinkCollectionToUrlProperty",
597
- "isImageZoomable",
598
- "showTableOfContents",
599
- "minTableOfContentsItems",
600
- "defaultPageIcon",
601
- "defaultPageCover",
602
- "defaultPageCoverPosition"
603
- ]);
604
- const I = e.useMemo(
605
- () => typeof window != "undefined" && tt({
606
- background: "rgba(0, 0, 0, 0.8)",
607
- minZoomScale: 2,
608
- margin: Nt()
609
- }),
610
- []
611
- );
612
- return /* @__PURE__ */ e.createElement(
613
- ct,
614
- {
615
- components: n,
616
- recordMap: a,
617
- mapPageUrl: o,
618
- mapImageUrl: m,
619
- searchNotion: r,
620
- isShowingSearch: u,
621
- onHideSearch: v,
622
- fullPage: k,
623
- rootPageId: y,
624
- rootDomain: b,
625
- rootSpaceId: _,
626
- darkMode: T,
627
- previewImages: O,
628
- forceCustomImages: L,
629
- showCollectionViewDropdown: t,
630
- linkTableTitleProperties: g,
631
- isLinkCollectionToUrlProperty: B,
632
- showTableOfContents: M,
633
- minTableOfContentsItems: Q,
634
- defaultPageIcon: ee,
635
- defaultPageCover: R,
636
- defaultPageCoverPosition: i,
637
- zoom: V ? I : null
638
- },
639
- /* @__PURE__ */ e.createElement(ye, W({}, f))
640
- );
641
- }, ye = (m) => {
642
- var r = m, { level: n = 0, blockId: a } = r, o = le(r, ["level", "blockId"]);
643
- var y, b;
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(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);
262
+ ${h && "notion-full-width"}
263
+ ${_ && "notion-small-text"}
264
+ ${W}
265
+ ${C || ""}
266
+ ${E}` }, /* @__PURE__ */ N.createElement("div", { className: "notion-viewport" }), j, (y.type === "collection_view_page" || y.type === "page" && y.parent_table === "collection") && /* @__PURE__ */ N.createElement(n.Collection, {
267
+ block: y,
268
+ ctx: t
269
+ }), y.type !== "collection_view_page" && x, M);
270
+ }
271
+ {
272
+ var J;
273
+ let e = (J = y.format) == null ? void 0 : J.block_color;
274
+ return /* @__PURE__ */ N.createElement(n.PageLink, {
275
+ className: `notion-page-link ${e && `notion-${e}`} ${W}`,
276
+ href: a(y.id)
277
+ }, /* @__PURE__ */ N.createElement(b, { block: y }));
278
+ }
279
+ case "header":
280
+ case "sub_header":
281
+ case "sub_sub_header": {
282
+ var Y, fe, pe;
283
+ if (!y.properties) return null;
284
+ let e = (Y = y.format) == null ? void 0 : Y.block_color, t = R(y.id), n = L(y.properties.title) || `Notion Header ${t}`, r = H[y.id], a;
285
+ if (r === void 0) {
286
+ let e = F(y, i);
287
+ if (e) {
288
+ let t = I(e, i).find((e) => e.id === y.id);
289
+ t && (r = t.indentLevel, H[y.id] = r);
290
+ }
291
+ }
292
+ r !== void 0 && (a = `notion-h-indent-${r}`);
293
+ let o = y.type === "header", s = y.type === "sub_header", c = y.type === "sub_sub_header", l = `${o && "notion-h notion-h1"}
294
+ ${s && "notion-h notion-h2"}
295
+ ${c && "notion-h notion-h3"}
296
+ ${e && `notion-${e}`}
297
+ ${a},
298
+ ${W}`, u = /* @__PURE__ */ N.createElement("span", null, /* @__PURE__ */ N.createElement("div", {
299
+ id: t,
300
+ className: "notion-header-anchor"
301
+ }), !((fe = y.format) != null && fe.toggleable) && /* @__PURE__ */ N.createElement("a", {
302
+ className: "notion-hash-link",
303
+ href: `#${t}`,
304
+ title: n
305
+ }, /* @__PURE__ */ N.createElement(de, null)), /* @__PURE__ */ N.createElement("span", { className: "notion-h-title" }, G())), d = null;
306
+ return d = o ? /* @__PURE__ */ N.createElement("h2", {
307
+ className: l,
308
+ "data-id": t
309
+ }, u) : s ? /* @__PURE__ */ N.createElement("h3", {
310
+ className: l,
311
+ "data-id": t
312
+ }, u) : /* @__PURE__ */ N.createElement("h4", {
313
+ className: l,
314
+ "data-id": t
315
+ }, u), (pe = y.format) != null && pe.toggleable ? /* @__PURE__ */ N.createElement("details", { className: `notion-toggle ${W}` }, /* @__PURE__ */ N.createElement("summary", null, d), /* @__PURE__ */ N.createElement("div", null, x)) : d;
316
+ }
317
+ case "divider": return /* @__PURE__ */ N.createElement("hr", { className: `notion-hr ${W}` });
318
+ case "text": {
319
+ var me, he, ge;
320
+ if (!y.properties && !((me = y.content) != null && me.length)) return /* @__PURE__ */ N.createElement("div", { className: `notion-blank ${W}` }, "\xA0");
321
+ let e = (he = y.format) == null ? void 0 : he.block_color;
322
+ return /* @__PURE__ */ N.createElement("div", { className: `notion-text ${e && `notion-${e}`} ${W}` }, ((ge = y.properties) == null ? void 0 : ge.title) && G(), x && /* @__PURE__ */ N.createElement("div", { className: "notion-text-children" }, x));
323
+ }
324
+ case "bulleted_list":
325
+ case "numbered_list": {
326
+ var X;
327
+ let e = (e, t) => y.type === "bulleted_list" ? /* @__PURE__ */ N.createElement("ul", { className: `notion-list notion-list-disc ${W}` }, e) : /* @__PURE__ */ N.createElement("ol", {
328
+ start: t,
329
+ className: `notion-list notion-list-numbered ${W}`
330
+ }, e), t = null;
331
+ t = y.content ? /* @__PURE__ */ N.createElement(N.Fragment, null, y.properties && /* @__PURE__ */ N.createElement("li", null, G()), e(x)) : y.properties ? /* @__PURE__ */ N.createElement("li", null, G()) : null;
332
+ let n = y.type !== ((X = i.block[y.parent_id]) == null || (X = X.value) == null ? void 0 : X.type), r = c(y.id, i.block);
333
+ return n ? e(t, r) : t;
334
+ }
335
+ case "embed": return /* @__PURE__ */ N.createElement(n.Embed, {
336
+ blockId: W,
337
+ block: y
338
+ });
339
+ case "tweet":
340
+ case "maps":
341
+ case "pdf":
342
+ case "figma":
343
+ case "typeform":
344
+ case "codepen":
345
+ case "excalidraw":
346
+ case "image":
347
+ case "gist":
348
+ case "video": return /* @__PURE__ */ N.createElement(T, {
349
+ blockId: W,
350
+ block: y
351
+ });
352
+ case "drive":
353
+ var _e;
354
+ if (!((_e = y.format) != null && _e.drive_properties)) {
355
+ var ve;
356
+ if ((ve = y.format) != null && ve.display_source) return /* @__PURE__ */ N.createElement(T, {
357
+ blockId: W,
358
+ block: y
359
+ });
360
+ }
361
+ return /* @__PURE__ */ N.createElement(oe, {
362
+ block: y,
363
+ className: W
364
+ });
365
+ case "audio": return /* @__PURE__ */ N.createElement(ie, {
366
+ block: y,
367
+ className: W
368
+ });
369
+ case "file": return /* @__PURE__ */ N.createElement(ae, {
370
+ block: y,
371
+ className: W
372
+ });
373
+ case "equation": return /* @__PURE__ */ N.createElement(n.Equation, {
374
+ block: y,
375
+ inline: !1,
376
+ className: W
377
+ });
378
+ case "code": return /* @__PURE__ */ N.createElement(n.Code, { block: y });
379
+ case "column_list": return /* @__PURE__ */ N.createElement("div", { className: `notion-row ${W}` }, x);
380
+ case "column": {
381
+ var ye, be, xe;
382
+ let e = ((ye = y.format) == null ? void 0 : ye.column_ratio) || .5, t = (be = i.block[y.parent_id]) == null ? void 0 : be.value, n = { width: `calc((100% - (${((t == null || (xe = t.content) == null ? void 0 : xe.length) || Math.max(2, Math.ceil(1 / e))) - 1} * min(32px, 4vw))) * ${e})` };
383
+ return /* @__PURE__ */ N.createElement(N.Fragment, null, /* @__PURE__ */ N.createElement("div", {
384
+ className: `notion-column ${W}`,
385
+ style: n
386
+ }, x), /* @__PURE__ */ N.createElement("div", { className: "notion-spacer" }));
387
+ }
388
+ case "quote": {
389
+ var Se;
390
+ if (!y.properties) return null;
391
+ let e = (Se = y.format) == null ? void 0 : Se.block_color;
392
+ return /* @__PURE__ */ N.createElement("blockquote", { className: `notion-quote ${e && `notion-${e}`} ${W}` }, /* @__PURE__ */ N.createElement("div", null, /* @__PURE__ */ N.createElement(m, {
393
+ value: y.properties.title,
394
+ block: y
395
+ })), x);
396
+ }
397
+ case "collection_view": return /* @__PURE__ */ N.createElement(n.Collection, {
398
+ block: y,
399
+ className: W,
400
+ ctx: t
401
+ });
402
+ case "callout":
403
+ var Ce, we, Te;
404
+ return n.Callout ? /* @__PURE__ */ N.createElement(n.Callout, {
405
+ block: y,
406
+ className: W
407
+ }) : /* @__PURE__ */ N.createElement("div", { className: `notion-callout ${((Ce = y.format) == null ? void 0 : Ce.block_color) && `notion-${(we = y.format) == null ? void 0 : we.block_color}_co`} ${W}` }, /* @__PURE__ */ N.createElement(A, { block: y }), /* @__PURE__ */ N.createElement("div", { className: "notion-callout-text" }, /* @__PURE__ */ N.createElement(m, {
408
+ value: (Te = y.properties) == null ? void 0 : Te.title,
409
+ block: y
410
+ }), x));
411
+ case "bookmark": {
412
+ var Ee, De, Oe, ke, Ae, je, Me, Ne, Pe;
413
+ if (!y.properties) return null;
414
+ let e = y.properties.link;
415
+ if (!e || !((Ee = e[0]) != null && Ee[0])) return null;
416
+ let t = L(y.properties.title);
417
+ if (t || (t = L(e)), t && t.startsWith("http")) try {
418
+ t = new URL(t).hostname;
419
+ } catch (e) {}
420
+ return /* @__PURE__ */ N.createElement("div", { className: "notion-row" }, /* @__PURE__ */ N.createElement(n.Link, {
421
+ target: "_blank",
422
+ rel: "noopener noreferrer",
423
+ className: `notion-bookmark ${(De = y.format) != null && De.block_color ? `notion-${y.format.block_color}` : ""} ${W}`,
424
+ href: e[0][0]
425
+ }, /* @__PURE__ */ N.createElement("div", null, t && /* @__PURE__ */ N.createElement("div", { className: "notion-bookmark-title" }, /* @__PURE__ */ N.createElement(m, {
426
+ value: [[t]],
427
+ block: y
428
+ })), ((Oe = y.properties) == null ? void 0 : Oe.description) && /* @__PURE__ */ N.createElement("div", { className: "notion-bookmark-description" }, /* @__PURE__ */ N.createElement(m, {
429
+ value: (ke = y.properties) == null ? void 0 : ke.description,
430
+ block: y
431
+ })), /* @__PURE__ */ N.createElement("div", { className: "notion-bookmark-link" }, ((Ae = y.format) == null ? void 0 : Ae.bookmark_icon) && /* @__PURE__ */ N.createElement("div", { className: "notion-bookmark-link-icon" }, /* @__PURE__ */ N.createElement(k, {
432
+ src: s((je = y.format) == null ? void 0 : je.bookmark_icon, y),
433
+ alt: t,
434
+ onError: (e) => {
435
+ let t = e.currentTarget.closest(".notion-bookmark-link-icon");
436
+ t && (t.style.display = "none");
437
+ }
438
+ })), /* @__PURE__ */ N.createElement("div", { className: "notion-bookmark-link-text" }, /* @__PURE__ */ N.createElement(m, {
439
+ value: e,
440
+ block: y
441
+ })))), ((Me = y.format) == null ? void 0 : Me.bookmark_cover) && /* @__PURE__ */ N.createElement("div", { className: "notion-bookmark-image" }, /* @__PURE__ */ N.createElement(k, {
442
+ src: s((Ne = y.format) == null ? void 0 : Ne.bookmark_cover, y).replace(/(\/\/i\.ytimg\.com\/.*?)maxresdefault/, "$1hqdefault"),
443
+ alt: L((Pe = y.properties) == null ? void 0 : Pe.title),
444
+ style: { objectFit: "cover" },
445
+ onError: (e) => {
446
+ let t = e.currentTarget.closest(".notion-bookmark-image");
447
+ t && (t.style.display = "none");
448
+ }
449
+ }))));
450
+ }
451
+ case "toggle":
452
+ var Fe;
453
+ return /* @__PURE__ */ N.createElement("details", { className: `notion-toggle ${W}` }, /* @__PURE__ */ N.createElement("summary", null, /* @__PURE__ */ N.createElement(m, {
454
+ value: (Fe = y.properties) == null ? void 0 : Fe.title,
455
+ block: y
456
+ })), /* @__PURE__ */ N.createElement("div", null, x));
457
+ case "table_of_contents": {
458
+ var Ie;
459
+ let e = F(y, i);
460
+ if (!e) return null;
461
+ let t = I(e, i), n = (Ie = y.format) == null ? void 0 : Ie.block_color;
462
+ return /* @__PURE__ */ N.createElement("div", { className: `notion-table-of-contents ${n && `notion-${n}`} ${W}` }, t.map((e) => /* @__PURE__ */ N.createElement("a", {
463
+ key: e.id,
464
+ href: `#${R(e.id)}`,
465
+ className: "notion-table-of-contents-item"
466
+ }, /* @__PURE__ */ N.createElement("span", {
467
+ className: "notion-table-of-contents-item-body",
468
+ style: {
469
+ display: "inline-block",
470
+ marginLeft: e.indentLevel * 24
471
+ }
472
+ }, e.text))));
473
+ }
474
+ case "to_do": {
475
+ var Z, Le;
476
+ let e = ((Z = y.properties) == null || (Z = Z.checked) == null || (Z = Z[0]) == null ? void 0 : Z[0]) === "Yes";
477
+ return /* @__PURE__ */ N.createElement("div", { className: `notion-to-do ${W}` }, /* @__PURE__ */ N.createElement("div", { className: "notion-to-do-item" }, /* @__PURE__ */ N.createElement(n.Checkbox, {
478
+ blockId: W,
479
+ isChecked: e
480
+ }), /* @__PURE__ */ N.createElement("div", { className: `notion-to-do-body ${e && "notion-to-do-checked"}` }, /* @__PURE__ */ N.createElement(m, {
481
+ value: (Le = y.properties) == null ? void 0 : Le.title,
482
+ block: y
483
+ }))), /* @__PURE__ */ N.createElement("div", { className: "notion-to-do-children" }, x));
484
+ }
485
+ case "transclusion_container": return /* @__PURE__ */ N.createElement("div", { className: `notion-sync-block ${W}` }, x);
486
+ case "transclusion_reference": return /* @__PURE__ */ N.createElement(le, _({
487
+ block: y,
488
+ level: S + 1
489
+ }, e));
490
+ case "alias": {
491
+ var Q, $;
492
+ let e = y == null || (Q = y.format) == null || (Q = Q.alias_pointer) == null ? void 0 : Q.id, t = ($ = i.block[e]) == null ? void 0 : $.value;
493
+ return t ? /* @__PURE__ */ N.createElement(n.PageLink, {
494
+ className: `notion-page-link ${e}}`,
495
+ href: a(e)
496
+ }, /* @__PURE__ */ N.createElement(b, { block: t })) : (console.debug("\"alias\" missing block", e), null);
497
+ }
498
+ case "table": return /* @__PURE__ */ N.createElement("table", { className: `notion-simple-table ${W}` }, /* @__PURE__ */ N.createElement("tbody", null, x));
499
+ case "table_row": {
500
+ var Re, ze, Be, Ve;
501
+ let e = (Re = i.block[y.parent_id]) == null ? void 0 : Re.value, t = (ze = e.format) == null ? void 0 : ze.table_block_column_order, n = (Be = e.format) == null ? void 0 : Be.table_block_column_format, r = (Ve = y.format) == null ? void 0 : Ve.block_color;
502
+ return !e || !t ? null : /* @__PURE__ */ N.createElement("tr", { className: `notion-simple-table-row ${r && `notion-${r}`} ${W}` }, t.map((e) => {
503
+ var t, r, i;
504
+ let a = n == null || (t = n[e]) == null ? void 0 : t.color;
505
+ return /* @__PURE__ */ N.createElement("td", {
506
+ key: e,
507
+ className: a ? `notion-${a}` : "",
508
+ style: { width: (n == null || (r = n[e]) == null ? void 0 : r.width) || 120 }
509
+ }, /* @__PURE__ */ N.createElement("div", { className: "notion-simple-table-cell" }, /* @__PURE__ */ N.createElement(m, {
510
+ value: ((i = y.properties) == null ? void 0 : i[e]) || [["ㅤ"]],
511
+ block: y
512
+ })));
513
+ }));
514
+ }
515
+ case "external_object_instance": return /* @__PURE__ */ N.createElement(D, {
516
+ block: y,
517
+ className: W
518
+ });
519
+ default: return process.env.NODE_ENV !== "production" && console.debug("Unsupported type " + y.type, JSON.stringify(y, null, 2)), /* @__PURE__ */ N.createElement("div", null);
520
+ }
521
+ }, G = [
522
+ "components",
523
+ "recordMap",
524
+ "mapPageUrl",
525
+ "mapImageUrl",
526
+ "searchNotion",
527
+ "isShowingSearch",
528
+ "onHideSearch",
529
+ "fullPage",
530
+ "rootPageId",
531
+ "rootDomain",
532
+ "rootSpaceId",
533
+ "darkMode",
534
+ "previewImages",
535
+ "forceCustomImages",
536
+ "showCollectionViewDropdown",
537
+ "linkTableTitleProperties",
538
+ "isLinkCollectionToUrlProperty",
539
+ "isImageZoomable",
540
+ "showTableOfContents",
541
+ "minTableOfContentsItems",
542
+ "defaultPageIcon",
543
+ "defaultPageCover",
544
+ "defaultPageCoverPosition",
545
+ "editable",
546
+ "onChangeBlock"
547
+ ], K = ["level", "blockId"], q = (e) => {
548
+ let { components: t, recordMap: n, mapPageUrl: r, mapImageUrl: i, searchNotion: a, isShowingSearch: o, onHideSearch: s, fullPage: c, rootPageId: l, rootDomain: d, rootSpaceId: f, darkMode: p, previewImages: m, forceCustomImages: h, showCollectionViewDropdown: g, linkTableTitleProperties: _, isLinkCollectionToUrlProperty: y, isImageZoomable: b = !0, showTableOfContents: x, minTableOfContentsItems: S, defaultPageIcon: C, defaultPageCover: w, defaultPageCoverPosition: T, editable: E, onChangeBlock: D } = e, O = v(e, G), k = N.useMemo(() => typeof window < "u" && P({
549
+ background: "rgba(0, 0, 0, 0.8)",
550
+ minZoomScale: 2,
551
+ margin: Y()
552
+ }), []);
553
+ return /* @__PURE__ */ N.createElement(u, {
554
+ components: t,
555
+ recordMap: n,
556
+ mapPageUrl: r,
557
+ mapImageUrl: i,
558
+ searchNotion: a,
559
+ isShowingSearch: o,
560
+ onHideSearch: s,
561
+ fullPage: c,
562
+ rootPageId: l,
563
+ rootDomain: d,
564
+ rootSpaceId: f,
565
+ darkMode: p,
566
+ previewImages: m,
567
+ forceCustomImages: h,
568
+ showCollectionViewDropdown: g,
569
+ linkTableTitleProperties: _,
570
+ isLinkCollectionToUrlProperty: y,
571
+ showTableOfContents: x,
572
+ minTableOfContentsItems: S,
573
+ defaultPageIcon: C,
574
+ defaultPageCover: w,
575
+ defaultPageCoverPosition: T,
576
+ editable: E,
577
+ onChangeBlock: D,
578
+ zoom: b ? k : null
579
+ }, /* @__PURE__ */ N.createElement(J, O));
580
+ }, J = (e) => {
581
+ var t, n;
582
+ let { level: r = 0, blockId: i } = e, a = v(e, K), { recordMap: o } = w(), s = i || Object.keys(o.block)[0], c = (t = o.block[s]) == null ? void 0 : t.value;
583
+ return c ? /* @__PURE__ */ N.createElement(W, _({
584
+ key: s,
585
+ level: r,
586
+ block: c
587
+ }, a), c == null || (n = c.content) == null ? void 0 : n.map((e) => /* @__PURE__ */ N.createElement(J, _({
588
+ key: e,
589
+ blockId: e,
590
+ level: r + 1
591
+ }, a)))) : (process.env.NODE_ENV !== "production" && console.warn("missing block", i), null);
646
592
  };
647
- function Nt() {
648
- const n = window.innerWidth;
649
- return n < 500 ? 8 : n < 800 ? 20 : n < 1280 ? 30 : n < 1600 ? 40 : n < 1920 ? 48 : 72;
593
+ function Y() {
594
+ let e = window.innerWidth;
595
+ return e < 500 ? 8 : e < 800 ? 20 : e < 1280 ? 30 : e < 1600 ? 40 : e < 1920 ? 48 : 72;
650
596
  }
651
- export {
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
- ye as NotionBlockRenderer,
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
- C as Text,
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
- ce as useNotionContext
689
- };
690
- //# sourceMappingURL=index.js.map
597
+ //#endregion
598
+ export { x as Asset, T as AssetWrapper, ie as Audio, W as Block, f as Breadcrumbs, n as Checkbox, M as CollectionColumnTitle, D as EOI, ae as File, oe as GoogleDrive, l as GracefulImage, y as Header, C as LiteYouTubeEmbed, J as NotionBlockRenderer, g as NotionContextConsumer, u as NotionContextProvider, q as NotionRenderer, ce as PageAside, A as PageIcon, d as PageIconImpl, b as PageTitle, h as PageTitleImpl, ee as PropertyIcon, E as Search, p as SearchDialog, le as SyncPointerBlock, m as Text, S as dummyLink, s as formatDate, r as formatNotionDateTime, O as getHashFragmentValue, c as getListNumber, a as getYoutubeId, j as iconMap, i as isBrowser, o as isUrl, w as useNotionContext };
599
+
600
+ //# sourceMappingURL=index.js.map