@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.
- package/build/asset-wrapper-BjCXzGmC.js +1056 -0
- package/build/asset-wrapper-BjCXzGmC.js.map +1 -0
- package/build/block.d.ts.map +1 -1
- package/build/collection-column-title-Bw3sXBSk.js +113 -0
- package/build/collection-column-title-Bw3sXBSk.js.map +1 -0
- package/build/components/editable-text.d.ts +18 -0
- package/build/components/editable-text.d.ts.map +1 -0
- package/build/components/editable-text.test.d.ts +2 -0
- package/build/components/editable-text.test.d.ts.map +1 -0
- package/build/components/graceful-image.d.ts.map +1 -1
- package/build/context.d.ts +4 -0
- package/build/context.d.ts.map +1 -1
- package/build/index.js +596 -686
- package/build/index.js.map +1 -1
- package/build/renderer.d.ts +2 -0
- package/build/renderer.d.ts.map +1 -1
- package/build/rolldown-runtime-CEFd7nDs.js +30 -0
- package/build/third-party/code.js +559 -196
- package/build/third-party/code.js.map +1 -1
- package/build/third-party/collection.js +2690 -3432
- package/build/third-party/collection.js.map +1 -1
- package/build/third-party/equation.js +27 -43
- package/build/third-party/equation.js.map +1 -1
- package/build/third-party/modal.js +1355 -1615
- package/build/third-party/modal.js.map +1 -1
- package/license +21 -0
- package/package.json +16 -13
- package/src/styles.css +16 -0
- package/build/_commonjsHelpers-ByYUsBRP.js +0 -34
- package/build/_commonjsHelpers-ByYUsBRP.js.map +0 -1
- package/build/asset-wrapper-BbigBRET.js +0 -1154
- package/build/asset-wrapper-BbigBRET.js.map +0 -1
- package/build/collection-column-title-l4hmVo49.js +0 -99
- package/build/collection-column-title-l4hmVo49.js.map +0 -1
package/build/index.js
CHANGED
|
@@ -1,690 +1,600 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
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
|
-
${
|
|
301
|
-
${
|
|
302
|
-
${
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
${
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
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
|
-
${
|
|
337
|
-
${
|
|
338
|
-
${
|
|
339
|
-
${
|
|
340
|
-
${
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
},
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
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
|
|
648
|
-
|
|
649
|
-
|
|
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
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
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
|