@texonom/nreact 1.5.2 → 1.5.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.
package/build/index.js
CHANGED
|
@@ -23,29 +23,29 @@ import e from "react";
|
|
|
23
23
|
import lt from "@fisch0920/medium-zoom";
|
|
24
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
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
|
|
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
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
28
|
import { c as Ee, g as ft } from "./_commonjsHelpers-bAxELxBV.js";
|
|
29
29
|
import { C as tn, P as nn, i as on } from "./collection-column-title-l4hmVo49.js";
|
|
30
30
|
const gt = ({ block: n, className: a }) => {
|
|
31
|
-
var r,
|
|
32
|
-
const { recordMap: o } = ce(), m = o.signed_urls[n.id] || ((v = (
|
|
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
33
|
return /* @__PURE__ */ e.createElement("div", { className: `notion-audio ${a || ""}` }, /* @__PURE__ */ e.createElement("audio", { controls: !0, preload: "none", src: m }));
|
|
34
34
|
}, Et = (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
37
|
}, vt = ({ block: n, className: a }) => {
|
|
38
|
-
var
|
|
39
|
-
const { components: o, recordMap: m } = ce(), r = m.signed_urls[n.id] || ((
|
|
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
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
41
|
}, bt = ({ 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;
|
|
45
|
-
let
|
|
45
|
+
let u;
|
|
46
46
|
try {
|
|
47
|
-
|
|
48
|
-
} catch (
|
|
47
|
+
u = new URL(r.url).hostname;
|
|
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
51
|
mt,
|
|
@@ -54,7 +54,7 @@ const gt = ({ block: n, className: a }) => {
|
|
|
54
54
|
alt: r.title || "Google Drive Document",
|
|
55
55
|
loading: "lazy"
|
|
56
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 &&
|
|
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
58
|
"div",
|
|
59
59
|
{
|
|
60
60
|
className: "notion-google-drive-body-source-icon",
|
|
@@ -62,34 +62,34 @@ const gt = ({ block: n, className: a }) => {
|
|
|
62
62
|
backgroundImage: `url(${r.icon})`
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
),
|
|
65
|
+
), u && /* @__PURE__ */ e.createElement("div", { className: "notion-google-drive-body-source-domain" }, u)))));
|
|
66
66
|
};
|
|
67
|
-
var
|
|
67
|
+
var Ne, et;
|
|
68
68
|
function ht() {
|
|
69
|
-
if (et) return
|
|
69
|
+
if (et) return Ne;
|
|
70
70
|
et = 1;
|
|
71
|
-
var n = "Expected a function", a = NaN, o = "[object Symbol]", m = /^\s+|\s+$/g, r = /^[-+]0x[0-9a-f]+$/i,
|
|
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
|
};
|
|
74
|
-
function B(i,
|
|
75
|
-
var
|
|
74
|
+
function B(i, f, h) {
|
|
75
|
+
var N, I, q, c, x, S, H = 0, te = !1, A = !1, G = !0;
|
|
76
76
|
if (typeof i != "function")
|
|
77
77
|
throw new TypeError(n);
|
|
78
|
-
|
|
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
79
|
function Y(E) {
|
|
80
|
-
var P =
|
|
81
|
-
return
|
|
80
|
+
var P = N, F = I;
|
|
81
|
+
return N = I = void 0, H = E, c = i.apply(F, P), c;
|
|
82
82
|
}
|
|
83
83
|
function se(E) {
|
|
84
|
-
return H = E, x = setTimeout(z,
|
|
84
|
+
return H = E, x = setTimeout(z, f), te ? Y(E) : c;
|
|
85
85
|
}
|
|
86
86
|
function me(E) {
|
|
87
|
-
var P = E - S, F = E - H, ae =
|
|
87
|
+
var P = E - S, F = E - H, ae = f - P;
|
|
88
88
|
return A ? t(ae, q - F) : ae;
|
|
89
89
|
}
|
|
90
90
|
function ne(E) {
|
|
91
91
|
var P = E - S, F = E - H;
|
|
92
|
-
return S === void 0 || P >=
|
|
92
|
+
return S === void 0 || P >= f || P < 0 || A && F >= q;
|
|
93
93
|
}
|
|
94
94
|
function z() {
|
|
95
95
|
var E = g();
|
|
@@ -98,39 +98,39 @@ function ht() {
|
|
|
98
98
|
x = setTimeout(z, me(E));
|
|
99
99
|
}
|
|
100
100
|
function oe(E) {
|
|
101
|
-
return x = void 0, G &&
|
|
101
|
+
return x = void 0, G && N ? Y(E) : (N = I = void 0, c);
|
|
102
102
|
}
|
|
103
103
|
function de() {
|
|
104
|
-
x !== void 0 && clearTimeout(x), H = 0,
|
|
104
|
+
x !== void 0 && clearTimeout(x), H = 0, N = S = I = x = void 0;
|
|
105
105
|
}
|
|
106
106
|
function ue() {
|
|
107
107
|
return x === void 0 ? c : oe(g());
|
|
108
108
|
}
|
|
109
109
|
function Z() {
|
|
110
110
|
var E = g(), P = ne(E);
|
|
111
|
-
if (
|
|
111
|
+
if (N = arguments, I = this, S = E, P) {
|
|
112
112
|
if (x === void 0)
|
|
113
113
|
return se(S);
|
|
114
114
|
if (A)
|
|
115
|
-
return x = setTimeout(z,
|
|
115
|
+
return x = setTimeout(z, f), Y(S);
|
|
116
116
|
}
|
|
117
|
-
return x === void 0 && (x = setTimeout(z,
|
|
117
|
+
return x === void 0 && (x = setTimeout(z, f)), c;
|
|
118
118
|
}
|
|
119
119
|
return Z.cancel = de, Z.flush = ue, Z;
|
|
120
120
|
}
|
|
121
|
-
function V(i,
|
|
122
|
-
var
|
|
121
|
+
function V(i, f, h) {
|
|
122
|
+
var N = !0, I = !0;
|
|
123
123
|
if (typeof i != "function")
|
|
124
124
|
throw new TypeError(n);
|
|
125
|
-
return M(h) && (
|
|
126
|
-
leading:
|
|
127
|
-
maxWait:
|
|
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
128
|
trailing: I
|
|
129
129
|
});
|
|
130
130
|
}
|
|
131
131
|
function M(i) {
|
|
132
|
-
var
|
|
133
|
-
return !!i && (
|
|
132
|
+
var f = typeof i;
|
|
133
|
+
return !!i && (f == "object" || f == "function");
|
|
134
134
|
}
|
|
135
135
|
function Q(i) {
|
|
136
136
|
return !!i && typeof i == "object";
|
|
@@ -144,21 +144,21 @@ function ht() {
|
|
|
144
144
|
if (ee(i))
|
|
145
145
|
return a;
|
|
146
146
|
if (M(i)) {
|
|
147
|
-
var
|
|
148
|
-
i = M(
|
|
147
|
+
var f = typeof i.valueOf == "function" ? i.valueOf() : i;
|
|
148
|
+
i = M(f) ? f + "" : f;
|
|
149
149
|
}
|
|
150
150
|
if (typeof i != "string")
|
|
151
151
|
return i === 0 ? i : +i;
|
|
152
152
|
i = i.replace(m, "");
|
|
153
|
-
var h =
|
|
154
|
-
return h || v.test(i) ?
|
|
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
155
|
}
|
|
156
|
-
return
|
|
156
|
+
return Ne = V, Ne;
|
|
157
157
|
}
|
|
158
|
-
var
|
|
159
|
-
const
|
|
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 }) => {
|
|
160
160
|
const y = e.useMemo(
|
|
161
|
-
() =>
|
|
161
|
+
() => Nt(() => {
|
|
162
162
|
const b = document.getElementsByClassName("notion-h");
|
|
163
163
|
let _ = null, T = a;
|
|
164
164
|
for (let O = 0; O < b.length; ++O) {
|
|
@@ -185,7 +185,7 @@ const kt = /* @__PURE__ */ ft(Nt), yt = ({ toc: n, activeSection: a, setActiveSe
|
|
|
185
185
|
return window.addEventListener("scroll", y), y(), () => {
|
|
186
186
|
window.removeEventListener("scroll", y);
|
|
187
187
|
};
|
|
188
|
-
}, [r, y]),
|
|
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
189
|
const _ = ve(b.id);
|
|
190
190
|
return /* @__PURE__ */ e.createElement(
|
|
191
191
|
"a",
|
|
@@ -210,10 +210,10 @@ const kt = /* @__PURE__ */ ft(Nt), yt = ({ toc: n, activeSection: a, setActiveSe
|
|
|
210
210
|
);
|
|
211
211
|
}))), m) : null;
|
|
212
212
|
}, _t = ({ block: n, level: a }) => {
|
|
213
|
-
var r,
|
|
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
|
-
const o = n, m = (
|
|
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
218
|
}, $t = (n) => {
|
|
219
219
|
const m = n, { className: a } = m, o = le(m, ["className"]);
|
|
@@ -230,9 +230,9 @@ const kt = /* @__PURE__ */ ft(Nt), yt = ({ toc: n, activeSection: a, setActiveSe
|
|
|
230
230
|
components: o,
|
|
231
231
|
fullPage: m,
|
|
232
232
|
recordMap: r,
|
|
233
|
-
mapPageUrl:
|
|
233
|
+
mapPageUrl: u,
|
|
234
234
|
mapImageUrl: v,
|
|
235
|
-
showTableOfContents:
|
|
235
|
+
showTableOfContents: k,
|
|
236
236
|
minTableOfContentsItems: y,
|
|
237
237
|
defaultPageIcon: b,
|
|
238
238
|
defaultPageCover: _,
|
|
@@ -247,9 +247,9 @@ const kt = /* @__PURE__ */ ft(Nt), yt = ({ toc: n, activeSection: a, setActiveSe
|
|
|
247
247
|
footer: ee,
|
|
248
248
|
pageHeader: R,
|
|
249
249
|
pageFooter: i,
|
|
250
|
-
pageTitle:
|
|
250
|
+
pageTitle: f,
|
|
251
251
|
pageAside: h,
|
|
252
|
-
pageCover:
|
|
252
|
+
pageCover: N,
|
|
253
253
|
hideBlockId: I,
|
|
254
254
|
disableHeader: q
|
|
255
255
|
} = n;
|
|
@@ -267,21 +267,21 @@ const kt = /* @__PURE__ */ ft(Nt), yt = ({ toc: n, activeSection: a, setActiveSe
|
|
|
267
267
|
const {
|
|
268
268
|
page_icon: l = b,
|
|
269
269
|
page_cover: s = _,
|
|
270
|
-
page_cover_position:
|
|
271
|
-
page_full_width:
|
|
270
|
+
page_cover_position: p = T,
|
|
271
|
+
page_full_width: d,
|
|
272
272
|
page_small_text: w
|
|
273
273
|
} = t.format || {};
|
|
274
274
|
if (m) {
|
|
275
275
|
const $ = t.type === "page" ? t.properties : {
|
|
276
276
|
title: (S = (x = r.collection[it(t, r)]) == null ? void 0 : x.value) == null ? void 0 : S.name
|
|
277
|
-
}, D = `center ${(1 - (
|
|
277
|
+
}, D = `center ${(1 - (p || 0.5)) * 100}%`;
|
|
278
278
|
let j = nt[D];
|
|
279
279
|
j || (j = nt[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 =
|
|
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 && (
|
|
284
|
-
|
|
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;
|
|
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
285
|
{
|
|
286
286
|
src: v(s, t),
|
|
287
287
|
alt: ie($ == null ? void 0 : $.title),
|
|
@@ -297,13 +297,13 @@ const kt = /* @__PURE__ */ ft(Nt), yt = ({ toc: n, activeSection: a, setActiveSe
|
|
|
297
297
|
${l ? "notion-page-has-icon" : "notion-page-no-icon"}
|
|
298
298
|
${U ? "notion-page-has-image-icon" : "notion-page-has-text-icon"}
|
|
299
299
|
notion-full-page
|
|
300
|
-
${
|
|
300
|
+
${d && "notion-full-width"}
|
|
301
301
|
${w && "notion-small-text"}
|
|
302
302
|
${M}`
|
|
303
303
|
},
|
|
304
304
|
l && /* @__PURE__ */ e.createElement(Ke, { block: t, defaultIcon: b, inline: !1 }),
|
|
305
305
|
R,
|
|
306
|
-
/* @__PURE__ */ e.createElement("h1", { className: "notion-title" },
|
|
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 }),
|
|
308
308
|
t.type !== "collection_view_page" && /* @__PURE__ */ e.createElement(
|
|
309
309
|
"div",
|
|
@@ -333,7 +333,7 @@ const kt = /* @__PURE__ */ ft(Nt), yt = ({ toc: n, activeSection: a, setActiveSe
|
|
|
333
333
|
{
|
|
334
334
|
className: `notion
|
|
335
335
|
notion-page
|
|
336
|
-
${
|
|
336
|
+
${d && "notion-full-width"}
|
|
337
337
|
${w && "notion-small-text"}
|
|
338
338
|
${c}
|
|
339
339
|
${V || ""}
|
|
@@ -351,7 +351,7 @@ const kt = /* @__PURE__ */ ft(Nt), yt = ({ toc: n, activeSection: a, setActiveSe
|
|
|
351
351
|
o.PageLink,
|
|
352
352
|
{
|
|
353
353
|
className: `notion-page-link ${l && `notion-${l}`} ${c}`,
|
|
354
|
-
href:
|
|
354
|
+
href: u(t.id)
|
|
355
355
|
},
|
|
356
356
|
/* @__PURE__ */ e.createElement(Xe, { block: t })
|
|
357
357
|
);
|
|
@@ -362,22 +362,22 @@ const kt = /* @__PURE__ */ ft(Nt), yt = ({ toc: n, activeSection: a, setActiveSe
|
|
|
362
362
|
// fallthrough
|
|
363
363
|
case "sub_sub_header": {
|
|
364
364
|
if (!t.properties) return null;
|
|
365
|
-
const l = (A = t.format) == null ? void 0 : A.block_color, s = ve(t.id),
|
|
366
|
-
let
|
|
367
|
-
if (
|
|
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;
|
|
367
|
+
if (d === void 0) {
|
|
368
368
|
const re = Je(t, r);
|
|
369
369
|
if (re) {
|
|
370
370
|
const K = he(re, r).find((fe) => fe.id === t.id);
|
|
371
|
-
K && (
|
|
371
|
+
K && (d = K.indentLevel, tt[t.id] = d);
|
|
372
372
|
}
|
|
373
373
|
}
|
|
374
|
-
|
|
374
|
+
d !== void 0 && (w = `notion-h-indent-${d}`);
|
|
375
375
|
const $ = t.type === "header", J = t.type === "sub_header", D = t.type === "sub_sub_header", j = `${$ && "notion-h notion-h1"}
|
|
376
376
|
${J && "notion-h notion-h2"}
|
|
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:
|
|
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 })));
|
|
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,8 +394,8 @@ const kt = /* @__PURE__ */ ft(Nt), 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
|
|
398
|
-
return
|
|
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);
|
|
398
|
+
return p ? l(s, d) : s;
|
|
399
399
|
}
|
|
400
400
|
case "embed":
|
|
401
401
|
return /* @__PURE__ */ e.createElement(o.Embed, { blockId: c, block: t });
|
|
@@ -432,7 +432,7 @@ const kt = /* @__PURE__ */ ft(Nt), yt = ({ toc: n, activeSection: a, setActiveSe
|
|
|
432
432
|
case "column_list":
|
|
433
433
|
return /* @__PURE__ */ e.createElement("div", { className: `notion-row ${c}` }, g);
|
|
434
434
|
case "column": {
|
|
435
|
-
const l = "min(32px, 4vw)", s = ((Z = t.format) == null ? void 0 : Z.column_ratio) || 0.5,
|
|
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
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
437
|
}
|
|
438
438
|
case "quote": {
|
|
@@ -459,7 +459,7 @@ const kt = /* @__PURE__ */ ft(Nt), yt = ({ toc: n, activeSection: a, setActiveSe
|
|
|
459
459
|
if (s || (s = ie(l)), s && s.startsWith("http"))
|
|
460
460
|
try {
|
|
461
461
|
s = new URL(s).hostname;
|
|
462
|
-
} catch (
|
|
462
|
+
} catch (p) {
|
|
463
463
|
}
|
|
464
464
|
return /* @__PURE__ */ e.createElement(
|
|
465
465
|
o.Link,
|
|
@@ -470,27 +470,27 @@ const kt = /* @__PURE__ */ ft(Nt), yt = ({ toc: n, activeSection: a, setActiveSe
|
|
|
470
470
|
href: l[0][0]
|
|
471
471
|
},
|
|
472
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(
|
|
473
|
-
|
|
473
|
+
ke,
|
|
474
474
|
{
|
|
475
475
|
src: v((Pe = t.format) == null ? void 0 : Pe.bookmark_icon, t),
|
|
476
476
|
alt: s,
|
|
477
|
-
onError: (
|
|
478
|
-
const
|
|
479
|
-
|
|
477
|
+
onError: (p) => {
|
|
478
|
+
const d = p.currentTarget.closest(".notion-bookmark-link-icon");
|
|
479
|
+
d && (d.style.display = "none");
|
|
480
480
|
}
|
|
481
481
|
}
|
|
482
482
|
)), /* @__PURE__ */ e.createElement("div", { className: "notion-bookmark-link-text" }, /* @__PURE__ */ e.createElement(C, { value: l, block: t })))),
|
|
483
483
|
((Te = t.format) == null ? void 0 : Te.bookmark_cover) && /* @__PURE__ */ e.createElement("div", { className: "notion-bookmark-image" }, /* @__PURE__ */ e.createElement(
|
|
484
|
-
|
|
484
|
+
ke,
|
|
485
485
|
{
|
|
486
486
|
src: v((Se = t.format) == null ? void 0 : Se.bookmark_cover, t),
|
|
487
487
|
alt: ie((je = t.properties) == null ? void 0 : je.title),
|
|
488
488
|
style: {
|
|
489
489
|
objectFit: "cover"
|
|
490
490
|
},
|
|
491
|
-
onError: (
|
|
492
|
-
const
|
|
493
|
-
|
|
491
|
+
onError: (p) => {
|
|
492
|
+
const d = p.currentTarget.closest(".notion-bookmark-image");
|
|
493
|
+
d && (d.style.display = "none");
|
|
494
494
|
}
|
|
495
495
|
}
|
|
496
496
|
))
|
|
@@ -501,17 +501,17 @@ const kt = /* @__PURE__ */ ft(Nt), yt = ({ toc: n, activeSection: a, setActiveSe
|
|
|
501
501
|
case "table_of_contents": {
|
|
502
502
|
const l = Je(t, r);
|
|
503
503
|
if (!l) return null;
|
|
504
|
-
const s = he(l, r),
|
|
505
|
-
return /* @__PURE__ */ e.createElement("div", { className: `notion-table-of-contents ${
|
|
504
|
+
const s = he(l, r), p = (Be = t.format) == null ? void 0 : Be.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
506
|
"span",
|
|
507
507
|
{
|
|
508
508
|
className: "notion-table-of-contents-item-body",
|
|
509
509
|
style: {
|
|
510
510
|
display: "inline-block",
|
|
511
|
-
marginLeft:
|
|
511
|
+
marginLeft: d.indentLevel * 24
|
|
512
512
|
}
|
|
513
513
|
},
|
|
514
|
-
|
|
514
|
+
d.text
|
|
515
515
|
))));
|
|
516
516
|
}
|
|
517
517
|
case "to_do": {
|
|
@@ -524,22 +524,22 @@ const kt = /* @__PURE__ */ ft(Nt), yt = ({ toc: n, activeSection: a, setActiveSe
|
|
|
524
524
|
return /* @__PURE__ */ e.createElement(_t, W({ block: t, level: B + 1 }, n));
|
|
525
525
|
case "alias": {
|
|
526
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:
|
|
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);
|
|
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,
|
|
533
|
-
return !l || !s ? null : /* @__PURE__ */ e.createElement("tr", { className: `notion-simple-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;
|
|
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
|
-
const $ = (J =
|
|
535
|
+
const $ = (J = p == null ? void 0 : p[w]) == null ? void 0 : J.color;
|
|
536
536
|
return /* @__PURE__ */ e.createElement(
|
|
537
537
|
"td",
|
|
538
538
|
{
|
|
539
539
|
key: w,
|
|
540
540
|
className: $ ? `notion-${$}` : "",
|
|
541
541
|
style: {
|
|
542
|
-
width: ((D =
|
|
542
|
+
width: ((D = p == null ? void 0 : p[w]) == null ? void 0 : D.width) || 120
|
|
543
543
|
}
|
|
544
544
|
},
|
|
545
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 }))
|
|
@@ -552,15 +552,15 @@ const kt = /* @__PURE__ */ ft(Nt), yt = ({ toc: n, activeSection: a, setActiveSe
|
|
|
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
554
|
}, jt = (h) => {
|
|
555
|
-
var
|
|
555
|
+
var N = h, {
|
|
556
556
|
components: n,
|
|
557
557
|
recordMap: a,
|
|
558
558
|
mapPageUrl: o,
|
|
559
559
|
mapImageUrl: m,
|
|
560
560
|
searchNotion: r,
|
|
561
|
-
isShowingSearch:
|
|
561
|
+
isShowingSearch: u,
|
|
562
562
|
onHideSearch: v,
|
|
563
|
-
fullPage:
|
|
563
|
+
fullPage: k,
|
|
564
564
|
rootPageId: y,
|
|
565
565
|
rootDomain: b,
|
|
566
566
|
rootSpaceId: _,
|
|
@@ -576,7 +576,7 @@ const kt = /* @__PURE__ */ ft(Nt), yt = ({ toc: n, activeSection: a, setActiveSe
|
|
|
576
576
|
defaultPageIcon: ee,
|
|
577
577
|
defaultPageCover: R,
|
|
578
578
|
defaultPageCoverPosition: i
|
|
579
|
-
} =
|
|
579
|
+
} = N, f = le(N, [
|
|
580
580
|
"components",
|
|
581
581
|
"recordMap",
|
|
582
582
|
"mapPageUrl",
|
|
@@ -617,9 +617,9 @@ const kt = /* @__PURE__ */ ft(Nt), yt = ({ toc: n, activeSection: a, setActiveSe
|
|
|
617
617
|
mapPageUrl: o,
|
|
618
618
|
mapImageUrl: m,
|
|
619
619
|
searchNotion: r,
|
|
620
|
-
isShowingSearch:
|
|
620
|
+
isShowingSearch: u,
|
|
621
621
|
onHideSearch: v,
|
|
622
|
-
fullPage:
|
|
622
|
+
fullPage: k,
|
|
623
623
|
rootPageId: y,
|
|
624
624
|
rootDomain: b,
|
|
625
625
|
rootSpaceId: _,
|
|
@@ -636,13 +636,13 @@ const kt = /* @__PURE__ */ ft(Nt), yt = ({ toc: n, activeSection: a, setActiveSe
|
|
|
636
636
|
defaultPageCoverPosition: i,
|
|
637
637
|
zoom: V ? I : null
|
|
638
638
|
},
|
|
639
|
-
/* @__PURE__ */ e.createElement(ye, W({},
|
|
639
|
+
/* @__PURE__ */ e.createElement(ye, W({}, f))
|
|
640
640
|
);
|
|
641
641
|
}, ye = (m) => {
|
|
642
642
|
var r = m, { level: n = 0, blockId: a } = r, o = le(r, ["level", "blockId"]);
|
|
643
643
|
var y, b;
|
|
644
|
-
const { recordMap:
|
|
645
|
-
return
|
|
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);
|
|
646
646
|
};
|
|
647
647
|
function xt() {
|
|
648
648
|
const n = window.innerWidth;
|