@texonom/nreact 1.6.6 → 1.6.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.js CHANGED
@@ -1,58 +1,62 @@
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 te, t as ne } from "./collection-column-title-Bw3sXBSk.js";
4
- import j from "react";
1
+ import { n as e, r as t, s as n, t as r } from "./objectSpread2-DfFXoz5f.js";
2
+ import { A as i, C as a, D as o, E as s, O as c, S as l, T as u, _ as d, a as f, b as p, c as m, d as h, g, h as _, i as v, k as y, l as b, m as x, n as S, o as C, r as w, s as T, t as E, u as D, v as O, w as ee, x as te, y as k } from "./asset-wrapper-saop46mm.js";
3
+ import { n as A, r as j, t as ne } from "./collection-column-title-B2x01rzc.js";
4
+ import M from "react";
5
5
  import re from "@fisch0920/medium-zoom";
6
- import { getBlockCollectionId as ie, getBlockIcon as ae, getBlockParentPage as M, getPageTableOfContents as N, getTextContent as P, isEditableInPlace as oe, parsePageId as F, uuidToId as I } from "@texonom/nutils";
6
+ import { getBlockCollectionId as ie, getBlockIcon as ae, getBlockParentPage as N, getPageTableOfContents as P, getTextContent as F, isEditableInPlace as oe, parsePageId as I, uuidToId as L } from "@texonom/nutils";
7
7
  //#region src/components/audio.tsx
8
8
  var se = ({ block: e, className: t }) => {
9
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__ */ j.createElement("div", { className: `notion-audio ${t || ""}` }, /* @__PURE__ */ j.createElement("audio", {
10
+ let { recordMap: r } = T(), 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__ */ M.createElement("div", { className: `notion-audio ${t || ""}` }, /* @__PURE__ */ M.createElement("audio", {
12
12
  controls: !0,
13
13
  preload: "none",
14
14
  src: i
15
15
  }));
16
- }, L = ["className"], ce = (e) => {
17
- let { className: t } = e, n = v(e, L);
18
- return /* @__PURE__ */ j.createElement("svg", _(_({ className: t }, n), {}, { viewBox: "0 0 30 30" }), /* @__PURE__ */ j.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
- }, le = ({ block: e, className: t }) => {
16
+ };
17
+ //#endregion
18
+ //#region src/icons/file-icon.tsx
19
+ e();
20
+ var ce = ["className"], le = (e) => {
21
+ let { className: t } = e, n = y(e, ce);
22
+ return /* @__PURE__ */ M.createElement("svg", r(r({ className: t }, n), {}, { viewBox: "0 0 30 30" }), /* @__PURE__ */ M.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" }));
23
+ }, ue = ({ block: e, className: t }) => {
20
24
  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__ */ j.createElement("div", { className: `notion-file ${t || ""}` }, /* @__PURE__ */ j.createElement(a.Link, {
25
+ let { components: a, recordMap: o } = T(), s = o.signed_urls[e.id] || ((n = e.properties) == null || (n = n.source) == null || (n = n[0]) == null ? void 0 : n[0]);
26
+ return /* @__PURE__ */ M.createElement("div", { className: `notion-file ${t || ""}` }, /* @__PURE__ */ M.createElement(a.Link, {
23
27
  className: "notion-file-link",
24
28
  href: s,
25
29
  target: "_blank",
26
30
  rel: "noopener noreferrer"
27
- }, /* @__PURE__ */ j.createElement(ce, { className: "notion-file-icon" }), /* @__PURE__ */ j.createElement("div", { className: "notion-file-info" }, /* @__PURE__ */ j.createElement("div", { className: "notion-file-title" }, /* @__PURE__ */ j.createElement(m, {
31
+ }, /* @__PURE__ */ M.createElement(le, { className: "notion-file-icon" }), /* @__PURE__ */ M.createElement("div", { className: "notion-file-info" }, /* @__PURE__ */ M.createElement("div", { className: "notion-file-title" }, /* @__PURE__ */ M.createElement(g, {
28
32
  value: ((r = e.properties) == null ? void 0 : r.title) || [["File"]],
29
33
  block: e
30
- })), ((i = e.properties) == null ? void 0 : i.size) && /* @__PURE__ */ j.createElement("div", { className: "notion-file-size" }, /* @__PURE__ */ j.createElement(m, {
34
+ })), ((i = e.properties) == null ? void 0 : i.size) && /* @__PURE__ */ M.createElement("div", { className: "notion-file-size" }, /* @__PURE__ */ M.createElement(g, {
31
35
  value: e.properties.size,
32
36
  block: e
33
37
  })))));
34
- }, ue = ({ block: e, className: t }) => {
38
+ }, de = ({ block: e, className: t }) => {
35
39
  var n;
36
- let { components: r, mapImageUrl: i } = w(), a = (n = e.format) == null ? void 0 : n.drive_properties;
40
+ let { components: r, mapImageUrl: i } = T(), a = (n = e.format) == null ? void 0 : n.drive_properties;
37
41
  if (!a) return null;
38
42
  let o;
39
43
  try {
40
44
  o = new URL(a.url).hostname;
41
45
  } catch (e) {}
42
- return /* @__PURE__ */ j.createElement("div", { className: `notion-google-drive ${t || ""}` }, /* @__PURE__ */ j.createElement(r.Link, {
46
+ return /* @__PURE__ */ M.createElement("div", { className: `notion-google-drive ${t || ""}` }, /* @__PURE__ */ M.createElement(r.Link, {
43
47
  className: "notion-google-drive-link",
44
48
  href: a.url,
45
49
  target: "_blank",
46
50
  rel: "noopener noreferrer"
47
- }, /* @__PURE__ */ j.createElement("div", { className: "notion-google-drive-preview" }, /* @__PURE__ */ j.createElement(l, {
51
+ }, /* @__PURE__ */ M.createElement("div", { className: "notion-google-drive-preview" }, /* @__PURE__ */ M.createElement(d, {
48
52
  src: i(a.thumbnail, e),
49
53
  alt: a.title || "Google Drive Document",
50
54
  loading: "lazy"
51
- })), /* @__PURE__ */ j.createElement("div", { className: "notion-google-drive-body" }, a.title && /* @__PURE__ */ j.createElement("div", { className: "notion-google-drive-body-title" }, a.title), a.icon && o && /* @__PURE__ */ j.createElement("div", { className: "notion-google-drive-body-source" }, a.icon && /* @__PURE__ */ j.createElement("div", {
55
+ })), /* @__PURE__ */ M.createElement("div", { className: "notion-google-drive-body" }, a.title && /* @__PURE__ */ M.createElement("div", { className: "notion-google-drive-body-title" }, a.title), a.icon && o && /* @__PURE__ */ M.createElement("div", { className: "notion-google-drive-body-source" }, a.icon && /* @__PURE__ */ M.createElement("div", {
52
56
  className: "notion-google-drive-body-source-icon",
53
57
  style: { backgroundImage: `url(${a.icon})` }
54
- }), o && /* @__PURE__ */ j.createElement("div", { className: "notion-google-drive-body-source-domain" }, o)))));
55
- }, de = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
58
+ }), o && /* @__PURE__ */ M.createElement("div", { className: "notion-google-drive-body-source-domain" }, o)))));
59
+ }, R = /* @__PURE__ */ n((/* @__PURE__ */ t(((e, t) => {
56
60
  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
61
  return d.Date.now();
58
62
  };
@@ -132,7 +136,7 @@ var se = ({ block: e, className: t }) => {
132
136
  }
133
137
  t.exports = _;
134
138
  })))(), 1), fe = ({ toc: e, activeSection: t, setActiveSection: n, pageAside: r, hasToc: i, hasAside: a, className: o }) => {
135
- let s = j.useMemo(() => (0, de.default)(() => {
139
+ let s = M.useMemo(() => (0, R.default)(() => {
136
140
  let e = document.getElementsByClassName("notion-h"), r = null, i = t;
137
141
  for (let t = 0; t < e.length; ++t) {
138
142
  let n = e[t];
@@ -144,19 +148,19 @@ var se = ({ block: e, className: t }) => {
144
148
  }
145
149
  n(i);
146
150
  }, 100), [n]);
147
- return j.useEffect(() => {
151
+ return M.useEffect(() => {
148
152
  if (i) return window.addEventListener("scroll", s), s(), () => {
149
153
  window.removeEventListener("scroll", s);
150
154
  };
151
- }, [i, s]), a ? /* @__PURE__ */ j.createElement("aside", { className: `notion-aside ${o || ""}` }, i && /* @__PURE__ */ j.createElement("div", { className: "notion-aside-table-of-contents" }, /* @__PURE__ */ j.createElement("div", { className: "notion-aside-table-of-contents-header" }, "Table of Contents"), /* @__PURE__ */ j.createElement("nav", { className: "notion-table-of-contents" }, e.map((e) => {
152
- let n = I(e.id);
153
- return /* @__PURE__ */ j.createElement("a", {
155
+ }, [i, s]), a ? /* @__PURE__ */ M.createElement("aside", { className: `notion-aside ${o || ""}` }, i && /* @__PURE__ */ M.createElement("div", { className: "notion-aside-table-of-contents" }, /* @__PURE__ */ M.createElement("div", { className: "notion-aside-table-of-contents-header" }, "Table of Contents"), /* @__PURE__ */ M.createElement("nav", { className: "notion-table-of-contents" }, e.map((e) => {
156
+ let n = L(e.id);
157
+ return /* @__PURE__ */ M.createElement("a", {
154
158
  key: n,
155
159
  href: `#${n}`,
156
160
  className: `notion-table-of-contents-item
157
161
  notion-table-of-contents-item-indent-level-${e.indentLevel}
158
162
  ${t === n && "notion-table-of-contents-active-item"}`
159
- }, /* @__PURE__ */ j.createElement("span", {
163
+ }, /* @__PURE__ */ M.createElement("span", {
160
164
  className: "notion-table-of-contents-item-body",
161
165
  style: {
162
166
  display: "inline-block",
@@ -168,40 +172,40 @@ var se = ({ block: e, className: t }) => {
168
172
  var n;
169
173
  if (!e) return process.env.NODE_ENV !== "production" && console.warn("missing sync pointer block", e.id), null;
170
174
  let r = e, i = r == null || (n = r.format) == null || (n = n.transclusion_reference_pointer) == null ? void 0 : n.id;
171
- return i ? /* @__PURE__ */ j.createElement(Z, {
175
+ return i ? /* @__PURE__ */ M.createElement(Z, {
172
176
  key: i,
173
177
  level: t,
174
178
  blockId: i
175
179
  }) : null;
176
- }, R = /* @__PURE__ */ new Set([
180
+ }, me = /* @__PURE__ */ new Set([
177
181
  "b",
178
182
  "i",
179
183
  "s",
180
184
  "c",
181
185
  "_",
182
186
  "h"
183
- ]), z = (e, t) => (e[0] === "/" || !!t && e.includes(t)) && !!F(e.substring(1), { uuid: !0 });
187
+ ]), z = (e, t) => (e[0] === "/" || !!t && e.includes(t)) && !!I(e.substring(1), { uuid: !0 });
184
188
  function B(e, t) {
185
189
  let [n, r] = e;
186
- return !r || r.length === 0 ? n === "," : !r.every((e) => R.has(e[0]) || e[0] === "a" && typeof e[1] == "string" && !z(e[1], t));
190
+ return !r || r.length === 0 ? n === "," : !r.every((e) => me.has(e[0]) || e[0] === "a" && typeof e[1] == "string" && !z(e[1], t));
187
191
  }
188
- var V = ({ title: e, block: t, holdsLine: n }) => {
189
- let { rootDomain: r } = w();
190
- return n ? /* @__PURE__ */ j.createElement("br", null) : /* @__PURE__ */ j.createElement(j.Fragment, null, e.map((e, n) => B(e, r) ? /* @__PURE__ */ j.createElement("span", {
192
+ var he = ({ title: e, block: t, holdsLine: n }) => {
193
+ let { rootDomain: r } = T();
194
+ return n ? /* @__PURE__ */ M.createElement("br", null) : /* @__PURE__ */ M.createElement(M.Fragment, null, e.map((e, n) => B(e, r) ? /* @__PURE__ */ M.createElement("span", {
191
195
  key: n,
192
196
  contentEditable: !1,
193
197
  "data-segment": JSON.stringify(e)
194
- }, /* @__PURE__ */ j.createElement(m, {
198
+ }, /* @__PURE__ */ M.createElement(g, {
195
199
  value: [e],
196
200
  block: t
197
- })) : /* @__PURE__ */ j.createElement(m, {
201
+ })) : /* @__PURE__ */ M.createElement(g, {
198
202
  key: n,
199
203
  value: [e],
200
204
  block: t
201
205
  })));
202
- }, me = ({ block: e }) => {
206
+ }, ge = ({ block: e }) => {
203
207
  var t, n, r, i;
204
- let a = (t = (n = e.properties) == null ? void 0 : n.title) == null ? [] : t, o = a.length === 0 && (e.type === "text" && !e.properties && !((r = e.content) != null && r.length) || Array.isArray((i = e.properties) == null ? void 0 : i.title)), s = JSON.stringify(a), c = j.useRef(null), l = j.useRef({
208
+ let a = (t = (n = e.properties) == null ? void 0 : n.title) == null ? [] : t, o = a.length === 0 && (e.type === "text" && !e.properties && !((r = e.content) != null && r.length) || Array.isArray((i = e.properties) == null ? void 0 : i.title)), s = JSON.stringify(a), c = M.useRef(null), l = M.useRef({
205
209
  json: s,
206
210
  version: 0
207
211
  });
@@ -212,12 +216,12 @@ var V = ({ title: e, block: t, holdsLine: n }) => {
212
216
  version: ((u = c.current) == null ? void 0 : u.getAttribute("data-title")) === s ? l.current.version : l.current.version + 1
213
217
  };
214
218
  }
215
- let { version: d } = l.current, f = j.useMemo(() => /* @__PURE__ */ j.createElement(V, {
219
+ let { version: d } = l.current, f = M.useMemo(() => /* @__PURE__ */ M.createElement(he, {
216
220
  title: a,
217
221
  block: e,
218
222
  holdsLine: o
219
223
  }), [d]);
220
- return /* @__PURE__ */ j.createElement("span", {
224
+ return /* @__PURE__ */ M.createElement("span", {
221
225
  key: d,
222
226
  ref: c,
223
227
  className: "notion-text-editable",
@@ -227,7 +231,7 @@ var V = ({ title: e, block: t, holdsLine: n }) => {
227
231
  suppressContentEditableWarning: !0,
228
232
  spellCheck: !0
229
233
  }, f);
230
- }, H = /* @__PURE__ */ new Set([
234
+ }, _e = /* @__PURE__ */ new Set([
231
235
  "default",
232
236
  "gray",
233
237
  "brown",
@@ -239,12 +243,12 @@ var V = ({ title: e, block: t, holdsLine: n }) => {
239
243
  "purple",
240
244
  "pink",
241
245
  "red"
242
- ]), U = (e) => {
246
+ ]), ve = (e) => {
243
247
  if (!e.startsWith("notion-")) return;
244
248
  let t = e.slice(7);
245
- return H.has(t.replace(/_background$/, "")) ? t : void 0;
249
+ return _e.has(t.replace(/_background$/, "")) ? t : void 0;
246
250
  };
247
- function he(e) {
251
+ function V(e) {
248
252
  switch (e.tagName) {
249
253
  case "B":
250
254
  case "STRONG": return ["b"];
@@ -262,21 +266,21 @@ function he(e) {
262
266
  case "SPAN":
263
267
  if (e.classList.contains("notion-inline-underscore")) return ["_"];
264
268
  for (let t of Array.from(e.classList)) {
265
- let e = U(t);
269
+ let e = ve(t);
266
270
  if (e) return ["h", e];
267
271
  }
268
272
  return;
269
273
  default: return;
270
274
  }
271
275
  }
272
- var W = (e) => e.nodeType === Node.ELEMENT_NODE && e.dataset.segment !== void 0 ? e : void 0;
273
- function G(e) {
276
+ var H = (e) => e.nodeType === Node.ELEMENT_NODE && e.dataset.segment !== void 0 ? e : void 0;
277
+ function U(e) {
274
278
  let t = e;
275
- for (; t.lastChild && !W(t);) t = t.lastChild;
279
+ for (; t.lastChild && !H(t);) t = t.lastChild;
276
280
  return t !== e && t.nodeName === "BR" ? t : void 0;
277
281
  }
278
- function ge(e) {
279
- let t = [], n = G(e), r = (e, n) => {
282
+ function W(e) {
283
+ let t = [], n = U(e), r = (e, n) => {
280
284
  if (!e) return;
281
285
  let r = t[t.length - 1];
282
286
  r && "text" in r && JSON.stringify(r.formats) === JSON.stringify(n) ? r.text += e : t.push({
@@ -288,7 +292,7 @@ function ge(e) {
288
292
  r(e.data.replace(/ /g, " "), a);
289
293
  return;
290
294
  }
291
- let o = W(e);
295
+ let o = H(e);
292
296
  if (o) {
293
297
  t.push({ island: JSON.parse(o.dataset.segment) });
294
298
  return;
@@ -300,43 +304,43 @@ function ge(e) {
300
304
  return;
301
305
  }
302
306
  (s.tagName === "DIV" || s.tagName === "P") && s.previousSibling && r("\n", a);
303
- let c = he(s), l = c ? [...a, c] : a;
307
+ let c = V(s), l = c ? [...a, c] : a;
304
308
  for (let e of Array.from(s.childNodes)) i(e, l);
305
309
  };
306
310
  for (let t of Array.from(e.childNodes)) i(t, []);
307
311
  return t.map((e) => "island" in e ? e.island : e.formats.length > 0 ? [e.text, [...e.formats].reverse()] : [e.text]);
308
312
  }
309
- function K(e) {
313
+ function G(e) {
310
314
  let t = [], n = (e) => {
311
- if (e.nodeType === Node.TEXT_NODE || W(e) || e.nodeName === "BR") t.push(e);
315
+ if (e.nodeType === Node.TEXT_NODE || H(e) || e.nodeName === "BR") t.push(e);
312
316
  else if (e.nodeType === Node.ELEMENT_NODE) for (let t of Array.from(e.childNodes)) n(t);
313
317
  };
314
318
  for (let t of Array.from(e.childNodes)) n(t);
315
319
  return t;
316
320
  }
317
- function q(e, t) {
321
+ function K(e, t) {
318
322
  if (e.nodeType === Node.TEXT_NODE) return e.data.length;
319
- let n = W(e);
323
+ let n = H(e);
320
324
  return n ? JSON.parse(n.dataset.segment)[0].length : e === t ? 0 : 1;
321
325
  }
322
- var J = (e) => Array.prototype.indexOf.call(e.parentNode.childNodes, e);
323
- function _e(e, t, n) {
326
+ var q = (e) => Array.prototype.indexOf.call(e.parentNode.childNodes, e);
327
+ function ye(e, t, n) {
324
328
  var r;
325
329
  let i = (r = t.nodeType === Node.ELEMENT_NODE ? t : t.parentElement) == null ? void 0 : r.closest("[data-segment]");
326
- i && i !== e && e.contains(i) && (t = i.parentNode, n = J(i) + 1);
327
- let a = G(e), o = 0;
328
- for (let r of K(e)) {
329
- if (r === t) return o + Math.min(n, q(r, a));
330
+ i && i !== e && e.contains(i) && (t = i.parentNode, n = q(i) + 1);
331
+ let a = U(e), o = 0;
332
+ for (let r of G(e)) {
333
+ if (r === t) return o + Math.min(n, K(r, a));
330
334
  let i = e.ownerDocument.createRange();
331
335
  if (i.selectNode(r), !(i.comparePoint(t, n) > 0 || t === i.endContainer && n === i.endOffset)) return o;
332
- o += q(r, a);
336
+ o += K(r, a);
333
337
  }
334
338
  return o;
335
339
  }
336
- function Y(e, t) {
337
- let n = G(e), r = Math.max(0, t), i;
338
- for (let t of K(e)) {
339
- let e = q(t, n);
340
+ function J(e, t) {
341
+ let n = U(e), r = Math.max(0, t), i;
342
+ for (let t of G(e)) {
343
+ let e = K(t, n);
340
344
  if (t.nodeType === Node.TEXT_NODE) {
341
345
  if (r <= e) return {
342
346
  node: t,
@@ -344,46 +348,51 @@ function Y(e, t) {
344
348
  };
345
349
  } else if (r === 0) return {
346
350
  node: t.parentNode,
347
- offset: J(t)
351
+ offset: q(t)
348
352
  };
349
353
  r -= e, t !== n && (i = t);
350
354
  }
351
355
  return i ? {
352
356
  node: i.parentNode,
353
- offset: J(i) + 1
357
+ offset: q(i) + 1
354
358
  } : {
355
359
  node: e,
356
360
  offset: 0
357
361
  };
358
362
  }
359
- function ve(e, t, n = t) {
363
+ function be(e, t, n = t) {
360
364
  let r = e.ownerDocument.getSelection();
361
365
  if (!r) return;
362
- let i = Y(e, t), a = n === t ? i : Y(e, n), o = e.ownerDocument.createRange();
366
+ let i = J(e, t), a = n === t ? i : J(e, n), o = e.ownerDocument.createRange();
363
367
  o.setStart(i.node, i.offset), o.setEnd(a.node, a.offset), r.removeAllRanges(), r.addRange(o);
364
368
  }
365
369
  //#endregion
366
370
  //#region src/icons/link-icon.tsx
367
- var ye = ["className"], be = (e) => {
368
- let { className: t } = e, n = v(e, ye);
369
- return /* @__PURE__ */ j.createElement("svg", _(_({ className: t }, n), {}, {
371
+ e();
372
+ var xe = ["className"], Se = (e) => {
373
+ let { className: t } = e, n = y(e, xe);
374
+ return /* @__PURE__ */ M.createElement("svg", r(r({ className: t }, n), {}, {
370
375
  viewBox: "0 0 16 16",
371
376
  width: "16",
372
377
  height: "16"
373
- }), /* @__PURE__ */ j.createElement("path", {
378
+ }), /* @__PURE__ */ M.createElement("path", {
374
379
  fillRule: "evenodd",
375
380
  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"
376
381
  }));
377
- }, xe = {}, Se = {}, X = (e) => {
378
- 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] = j.useState(null), { block: y, children: x, level: S, className: C, bodyClassName: E, header: O, footer: ee, pageHeader: te, pageFooter: ne, pageTitle: re, pageAside: F, pageCover: L, hideBlockId: ce, disableHeader: de } = e;
382
+ };
383
+ //#endregion
384
+ //#region src/block.tsx
385
+ e();
386
+ var Ce = {}, we = {}, Y = (e) => {
387
+ let t = T(), { components: n, fullPage: i, recordMap: a, mapPageUrl: o, mapImageUrl: s, showTableOfContents: l, minTableOfContentsItems: d, defaultPageIcon: f, defaultPageCover: p, defaultPageCoverPosition: m, editable: h } = t, [_, v] = M.useState(null), { block: y, children: b, level: S, className: C, bodyClassName: w, header: D, footer: ee, pageHeader: A, pageFooter: j, pageTitle: ne, pageAside: re, pageCover: I, hideBlockId: ce, disableHeader: le } = e;
379
388
  if (!y) return null;
380
389
  if (S === 0 && y.type === "collection_view") {
381
390
  let e = y;
382
391
  e.type = "collection_view_page";
383
392
  }
384
- let R = ce ? "notion-block" : `notion-block-${I(y.id)}`, z = h && oe(y), B = () => {
393
+ let R = ce ? "notion-block" : `notion-block-${L(y.id)}`, me = h && oe(y), z = () => {
385
394
  var e;
386
- return z ? /* @__PURE__ */ j.createElement(me, { block: y }) : /* @__PURE__ */ j.createElement(m, {
395
+ return me ? /* @__PURE__ */ M.createElement(ge, { block: y }) : /* @__PURE__ */ M.createElement(g, {
387
396
  value: (e = y.properties) == null ? void 0 : e.title,
388
397
  block: y
389
398
  });
@@ -392,121 +401,121 @@ var ye = ["className"], be = (e) => {
392
401
  case "collection_view_page":
393
402
  case "page":
394
403
  if (S === 0) {
395
- let { page_icon: e = d, page_cover: a = f, page_cover_position: c = p, page_full_width: h, page_small_text: _ } = y.format || {};
396
- if (r) {
397
- var V, H;
398
- let r = y.type === "page" ? y.properties : { title: (V = i.collection[ie(y, i)]) == null || (V = V.value) == null ? void 0 : V.name }, f = `center ${(1 - (c || .5)) * 100}%`, p = Se[f];
399
- p || (p = Se[f] = { objectPosition: f });
400
- let b = (H = ae(y, i)) == null ? d : H, S = b && o(b), w = N(y, i), T = l && w.length >= u, D = (T || F) && !h, M = L || a;
401
- return /* @__PURE__ */ j.createElement("div", { className: `notion notion-app ${R} ${C || ""}` }, /* @__PURE__ */ j.createElement("div", { className: "notion-viewport" }), /* @__PURE__ */ j.createElement("div", { className: "notion-frame" }, !de && /* @__PURE__ */ j.createElement(n.Header, { block: y }), O, /* @__PURE__ */ j.createElement("div", { className: "notion-page-scroller" }, M && (L || /* @__PURE__ */ j.createElement("div", { className: "notion-page-cover-wrapper" }, /* @__PURE__ */ j.createElement(k, {
402
- src: s(a, y),
403
- alt: P(r == null ? void 0 : r.title),
404
+ let { page_icon: e = f, page_cover: r = p, page_cover_position: o = m, page_full_width: u, page_small_text: h } = y.format || {};
405
+ if (i) {
406
+ var B, he;
407
+ let i = y.type === "page" ? y.properties : { title: (B = a.collection[ie(y, a)]) == null || (B = B.value) == null ? void 0 : B.name }, p = `center ${(1 - (o || .5)) * 100}%`, m = we[p];
408
+ m || (m = we[p] = { objectPosition: p });
409
+ let x = (he = ae(y, a)) == null ? f : he, S = x && c(x), T = P(y, a), E = l && T.length >= d, O = (E || re) && !u, N = I || r;
410
+ return /* @__PURE__ */ M.createElement("div", { className: `notion notion-app ${R} ${C || ""}` }, /* @__PURE__ */ M.createElement("div", { className: "notion-viewport" }), /* @__PURE__ */ M.createElement("div", { className: "notion-frame" }, !le && /* @__PURE__ */ M.createElement(n.Header, { block: y }), D, /* @__PURE__ */ M.createElement("div", { className: "notion-page-scroller" }, N && (I || /* @__PURE__ */ M.createElement("div", { className: "notion-page-cover-wrapper" }, /* @__PURE__ */ M.createElement(te, {
411
+ src: s(r, y),
412
+ alt: F(i == null ? void 0 : i.title),
404
413
  priority: !0,
405
414
  className: "notion-page-cover",
406
- style: p
407
- }))), /* @__PURE__ */ j.createElement("main", { className: `notion-page
408
- ${M ? "notion-page-has-cover" : "notion-page-no-cover"}
415
+ style: m
416
+ }))), /* @__PURE__ */ M.createElement("main", { className: `notion-page
417
+ ${N ? "notion-page-has-cover" : "notion-page-no-cover"}
409
418
  ${e ? "notion-page-has-icon" : "notion-page-no-icon"}
410
419
  ${S ? "notion-page-has-image-icon" : "notion-page-has-text-icon"}
411
420
  notion-full-page
412
- ${h && "notion-full-width"}
413
- ${_ && "notion-small-text"}
414
- ${E}` }, e && /* @__PURE__ */ j.createElement(A, {
421
+ ${u && "notion-full-width"}
422
+ ${h && "notion-small-text"}
423
+ ${w}` }, e && /* @__PURE__ */ M.createElement(k, {
415
424
  block: y,
416
- defaultIcon: d,
425
+ defaultIcon: f,
417
426
  inline: !1
418
- }), te, /* @__PURE__ */ j.createElement("h1", { className: "notion-title" }, re == null ? /* @__PURE__ */ j.createElement(m, {
419
- value: r == null ? void 0 : r.title,
427
+ }), A, /* @__PURE__ */ M.createElement("h1", { className: "notion-title" }, ne == null ? /* @__PURE__ */ M.createElement(g, {
428
+ value: i == null ? void 0 : i.title,
420
429
  block: y
421
- }) : re), (y.type === "collection_view_page" || y.type === "page" && y.parent_table === "collection") && /* @__PURE__ */ j.createElement(n.Collection, {
430
+ }) : ne), (y.type === "collection_view_page" || y.type === "page" && y.parent_table === "collection") && /* @__PURE__ */ M.createElement(n.Collection, {
422
431
  block: y,
423
432
  ctx: t
424
- }), y.type !== "collection_view_page" && /* @__PURE__ */ j.createElement("div", { className: `notion-page-content
425
- ${D && "notion-page-content-has-aside"}
426
- ${T && "notion-page-content-has-toc"}` }, /* @__PURE__ */ j.createElement("article", { className: "notion-page-content-inner" }, x), D && /* @__PURE__ */ j.createElement(fe, {
427
- toc: w,
428
- activeSection: g,
433
+ }), y.type !== "collection_view_page" && /* @__PURE__ */ M.createElement("div", { className: `notion-page-content
434
+ ${O && "notion-page-content-has-aside"}
435
+ ${E && "notion-page-content-has-toc"}` }, /* @__PURE__ */ M.createElement("article", { className: "notion-page-content-inner" }, b), O && /* @__PURE__ */ M.createElement(fe, {
436
+ toc: T,
437
+ activeSection: _,
429
438
  setActiveSection: v,
430
- hasToc: T,
431
- hasAside: D,
432
- pageAside: F
433
- })), ne), ee)));
439
+ hasToc: E,
440
+ hasAside: O,
441
+ pageAside: re
442
+ })), j), ee)));
434
443
  }
435
- return /* @__PURE__ */ j.createElement("main", { className: `notion
444
+ return /* @__PURE__ */ M.createElement("main", { className: `notion
436
445
  notion-page
437
- ${h && "notion-full-width"}
438
- ${_ && "notion-small-text"}
446
+ ${u && "notion-full-width"}
447
+ ${h && "notion-small-text"}
439
448
  ${R}
440
449
  ${C || ""}
441
- ${E}` }, /* @__PURE__ */ j.createElement("div", { className: "notion-viewport" }), te, (y.type === "collection_view_page" || y.type === "page" && y.parent_table === "collection") && /* @__PURE__ */ j.createElement(n.Collection, {
450
+ ${w}` }, /* @__PURE__ */ M.createElement("div", { className: "notion-viewport" }), A, (y.type === "collection_view_page" || y.type === "page" && y.parent_table === "collection") && /* @__PURE__ */ M.createElement(n.Collection, {
442
451
  block: y,
443
452
  ctx: t
444
- }), y.type !== "collection_view_page" && x, ne);
453
+ }), y.type !== "collection_view_page" && b, j);
445
454
  }
446
455
  {
447
- var U;
448
- let e = (U = y.format) == null ? void 0 : U.block_color;
449
- return /* @__PURE__ */ j.createElement(n.PageLink, {
456
+ var _e;
457
+ let e = (_e = y.format) == null ? void 0 : _e.block_color;
458
+ return /* @__PURE__ */ M.createElement(n.PageLink, {
450
459
  className: `notion-page-link ${e && `notion-${e}`} ${R}`,
451
- href: a(y.id)
452
- }, /* @__PURE__ */ j.createElement(b, { block: y }));
460
+ href: o(y.id)
461
+ }, /* @__PURE__ */ M.createElement(x, { block: y }));
453
462
  }
454
463
  case "header":
455
464
  case "sub_header":
456
465
  case "sub_sub_header": {
457
- var he, W, G;
466
+ var ve, V, H;
458
467
  if (!y.properties) return null;
459
- let e = (he = y.format) == null ? void 0 : he.block_color, t = I(y.id), n = P(y.properties.title) || `Notion Header ${t}`, r = xe[y.id], a;
468
+ let e = (ve = y.format) == null ? void 0 : ve.block_color, t = L(y.id), n = F(y.properties.title) || `Notion Header ${t}`, r = Ce[y.id], i;
460
469
  if (r === void 0) {
461
- let e = M(y, i);
470
+ let e = N(y, a);
462
471
  if (e) {
463
- let t = N(e, i).find((e) => e.id === y.id);
464
- t && (r = t.indentLevel, xe[y.id] = r);
472
+ let t = P(e, a).find((e) => e.id === y.id);
473
+ t && (r = t.indentLevel, Ce[y.id] = r);
465
474
  }
466
475
  }
467
- r !== void 0 && (a = `notion-h-indent-${r}`);
476
+ r !== void 0 && (i = `notion-h-indent-${r}`);
468
477
  let o = y.type === "header", s = y.type === "sub_header", c = y.type === "sub_sub_header", l = `${o && "notion-h notion-h1"}
469
478
  ${s && "notion-h notion-h2"}
470
479
  ${c && "notion-h notion-h3"}
471
480
  ${e && `notion-${e}`}
472
- ${a},
473
- ${R}`, u = /* @__PURE__ */ j.createElement("span", null, /* @__PURE__ */ j.createElement("div", {
481
+ ${i},
482
+ ${R}`, u = /* @__PURE__ */ M.createElement("span", null, /* @__PURE__ */ M.createElement("div", {
474
483
  id: t,
475
484
  className: "notion-header-anchor"
476
- }), !((W = y.format) != null && W.toggleable) && /* @__PURE__ */ j.createElement("a", {
485
+ }), !((V = y.format) != null && V.toggleable) && /* @__PURE__ */ M.createElement("a", {
477
486
  className: "notion-hash-link",
478
487
  href: `#${t}`,
479
488
  title: n
480
- }, /* @__PURE__ */ j.createElement(be, null)), /* @__PURE__ */ j.createElement("span", { className: "notion-h-title" }, B())), d = null;
481
- return d = o ? /* @__PURE__ */ j.createElement("h2", {
489
+ }, /* @__PURE__ */ M.createElement(Se, null)), /* @__PURE__ */ M.createElement("span", { className: "notion-h-title" }, z())), d = null;
490
+ return d = o ? /* @__PURE__ */ M.createElement("h2", {
482
491
  className: l,
483
492
  "data-id": t
484
- }, u) : s ? /* @__PURE__ */ j.createElement("h3", {
493
+ }, u) : s ? /* @__PURE__ */ M.createElement("h3", {
485
494
  className: l,
486
495
  "data-id": t
487
- }, u) : /* @__PURE__ */ j.createElement("h4", {
496
+ }, u) : /* @__PURE__ */ M.createElement("h4", {
488
497
  className: l,
489
498
  "data-id": t
490
- }, u), (G = y.format) != null && G.toggleable ? /* @__PURE__ */ j.createElement("details", { className: `notion-toggle ${R}` }, /* @__PURE__ */ j.createElement("summary", null, d), /* @__PURE__ */ j.createElement("div", null, x)) : d;
499
+ }, u), (H = y.format) != null && H.toggleable ? /* @__PURE__ */ M.createElement("details", { className: `notion-toggle ${R}` }, /* @__PURE__ */ M.createElement("summary", null, d), /* @__PURE__ */ M.createElement("div", null, b)) : d;
491
500
  }
492
- case "divider": return /* @__PURE__ */ j.createElement("hr", { className: `notion-hr ${R}` });
501
+ case "divider": return /* @__PURE__ */ M.createElement("hr", { className: `notion-hr ${R}` });
493
502
  case "text": {
494
- var ge, K, q;
495
- let e = !y.properties && !((ge = y.content) != null && ge.length), t = (K = y.format) == null ? void 0 : K.block_color, n = e ? `notion-blank ${R}` : `notion-text ${t && `notion-${t}`} ${R}`;
496
- return z ? /* @__PURE__ */ j.createElement("div", { className: n }, B(), x && /* @__PURE__ */ j.createElement("div", { className: "notion-text-children" }, x)) : e ? /* @__PURE__ */ j.createElement("div", { className: n }, "\xA0") : /* @__PURE__ */ j.createElement("div", { className: n }, ((q = y.properties) == null ? void 0 : q.title) && B(), x && /* @__PURE__ */ j.createElement("div", { className: "notion-text-children" }, x));
503
+ var U, W, G;
504
+ let e = !y.properties && !((U = y.content) != null && U.length), t = (W = y.format) == null ? void 0 : W.block_color, n = e ? `notion-blank ${R}` : `notion-text ${t && `notion-${t}`} ${R}`;
505
+ return me ? /* @__PURE__ */ M.createElement("div", { className: n }, z(), b && /* @__PURE__ */ M.createElement("div", { className: "notion-text-children" }, b)) : e ? /* @__PURE__ */ M.createElement("div", { className: n }, "\xA0") : /* @__PURE__ */ M.createElement("div", { className: n }, ((G = y.properties) == null ? void 0 : G.title) && z(), b && /* @__PURE__ */ M.createElement("div", { className: "notion-text-children" }, b));
497
506
  }
498
507
  case "bulleted_list":
499
508
  case "numbered_list": {
500
- var J;
501
- let e = (e, t) => y.type === "bulleted_list" ? /* @__PURE__ */ j.createElement("ul", { className: `notion-list notion-list-disc ${R}` }, e) : /* @__PURE__ */ j.createElement("ol", {
509
+ var K;
510
+ let e = (e, t) => y.type === "bulleted_list" ? /* @__PURE__ */ M.createElement("ul", { className: `notion-list notion-list-disc ${R}` }, e) : /* @__PURE__ */ M.createElement("ol", {
502
511
  start: t,
503
512
  className: `notion-list notion-list-numbered ${R}`
504
513
  }, e), t = null;
505
- t = y.content ? /* @__PURE__ */ j.createElement(j.Fragment, null, y.properties && /* @__PURE__ */ j.createElement("li", { "data-block-id": h ? y.id : void 0 }, B()), e(x)) : y.properties ? /* @__PURE__ */ j.createElement("li", { "data-block-id": h ? y.id : void 0 }, B()) : null;
506
- let n = y.type !== ((J = i.block[y.parent_id]) == null || (J = J.value) == null ? void 0 : J.type), r = c(y.id, i.block);
514
+ t = y.content ? /* @__PURE__ */ M.createElement(M.Fragment, null, y.properties && /* @__PURE__ */ M.createElement("li", { "data-block-id": h ? y.id : void 0 }, z()), e(b)) : y.properties ? /* @__PURE__ */ M.createElement("li", { "data-block-id": h ? y.id : void 0 }, z()) : null;
515
+ let n = y.type !== ((K = a.block[y.parent_id]) == null || (K = K.value) == null ? void 0 : K.type), r = u(y.id, a.block);
507
516
  return n ? e(t, r) : t;
508
517
  }
509
- case "embed": return /* @__PURE__ */ j.createElement(n.Embed, {
518
+ case "embed": return /* @__PURE__ */ M.createElement(n.Embed, {
510
519
  blockId: R,
511
520
  block: y
512
521
  });
@@ -519,99 +528,99 @@ var ye = ["className"], be = (e) => {
519
528
  case "excalidraw":
520
529
  case "image":
521
530
  case "gist":
522
- case "video": return /* @__PURE__ */ j.createElement(T, {
531
+ case "video": return /* @__PURE__ */ M.createElement(E, {
523
532
  blockId: R,
524
533
  block: y
525
534
  });
526
535
  case "drive":
527
- var _e;
528
- if (!((_e = y.format) != null && _e.drive_properties)) {
529
- var Y;
530
- if ((Y = y.format) != null && Y.display_source) return /* @__PURE__ */ j.createElement(T, {
536
+ var q;
537
+ if (!((q = y.format) != null && q.drive_properties)) {
538
+ var ye;
539
+ if ((ye = y.format) != null && ye.display_source) return /* @__PURE__ */ M.createElement(E, {
531
540
  blockId: R,
532
541
  block: y
533
542
  });
534
543
  }
535
- return /* @__PURE__ */ j.createElement(ue, {
544
+ return /* @__PURE__ */ M.createElement(de, {
536
545
  block: y,
537
546
  className: R
538
547
  });
539
- case "audio": return /* @__PURE__ */ j.createElement(se, {
548
+ case "audio": return /* @__PURE__ */ M.createElement(se, {
540
549
  block: y,
541
550
  className: R
542
551
  });
543
- case "file": return /* @__PURE__ */ j.createElement(le, {
552
+ case "file": return /* @__PURE__ */ M.createElement(ue, {
544
553
  block: y,
545
554
  className: R
546
555
  });
547
- case "equation": return /* @__PURE__ */ j.createElement(n.Equation, {
556
+ case "equation": return /* @__PURE__ */ M.createElement(n.Equation, {
548
557
  block: y,
549
558
  inline: !1,
550
559
  className: R
551
560
  });
552
- case "code": return /* @__PURE__ */ j.createElement(n.Code, { block: y });
553
- case "column_list": return /* @__PURE__ */ j.createElement("div", { className: `notion-row ${R}` }, x);
561
+ case "code": return /* @__PURE__ */ M.createElement(n.Code, { block: y });
562
+ case "column_list": return /* @__PURE__ */ M.createElement("div", { className: `notion-row ${R}` }, b);
554
563
  case "column": {
555
- var ve, ye, X;
556
- let e = ((ve = y.format) == null ? void 0 : ve.column_ratio) || .5, t = (ye = i.block[y.parent_id]) == null ? void 0 : ye.value, n = { width: `calc((100% - (${((t == null || (X = t.content) == null ? void 0 : X.length) || Math.max(2, Math.ceil(1 / e))) - 1} * min(32px, 4vw))) * ${e})` };
557
- return /* @__PURE__ */ j.createElement(j.Fragment, null, /* @__PURE__ */ j.createElement("div", {
564
+ var J, be, xe;
565
+ let e = ((J = y.format) == null ? void 0 : J.column_ratio) || .5, t = (be = a.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})` };
566
+ return /* @__PURE__ */ M.createElement(M.Fragment, null, /* @__PURE__ */ M.createElement("div", {
558
567
  className: `notion-column ${R}`,
559
568
  style: n
560
- }, x), /* @__PURE__ */ j.createElement("div", { className: "notion-spacer" }));
569
+ }, b), /* @__PURE__ */ M.createElement("div", { className: "notion-spacer" }));
561
570
  }
562
571
  case "quote": {
563
- var Ce;
572
+ var Y;
564
573
  if (!y.properties) return null;
565
- let e = (Ce = y.format) == null ? void 0 : Ce.block_color;
566
- return /* @__PURE__ */ j.createElement("blockquote", { className: `notion-quote ${e && `notion-${e}`} ${R}` }, /* @__PURE__ */ j.createElement("div", null, B()), x);
574
+ let e = (Y = y.format) == null ? void 0 : Y.block_color;
575
+ return /* @__PURE__ */ M.createElement("blockquote", { className: `notion-quote ${e && `notion-${e}`} ${R}` }, /* @__PURE__ */ M.createElement("div", null, z()), b);
567
576
  }
568
- case "collection_view": return /* @__PURE__ */ j.createElement(n.Collection, {
577
+ case "collection_view": return /* @__PURE__ */ M.createElement(n.Collection, {
569
578
  block: y,
570
579
  className: R,
571
580
  ctx: t
572
581
  });
573
582
  case "callout":
574
- var we, Te, Z;
575
- return n.Callout ? /* @__PURE__ */ j.createElement(n.Callout, {
583
+ var Te, X, Ee;
584
+ return n.Callout ? /* @__PURE__ */ M.createElement(n.Callout, {
576
585
  block: y,
577
586
  className: R
578
- }) : /* @__PURE__ */ j.createElement("div", { className: `notion-callout ${((we = y.format) == null ? void 0 : we.block_color) && `notion-${(Te = y.format) == null ? void 0 : Te.block_color}_co`} ${R}` }, /* @__PURE__ */ j.createElement(A, { block: y }), /* @__PURE__ */ j.createElement("div", { className: "notion-callout-text" }, /* @__PURE__ */ j.createElement(m, {
579
- value: (Z = y.properties) == null ? void 0 : Z.title,
587
+ }) : /* @__PURE__ */ M.createElement("div", { className: `notion-callout ${((Te = y.format) == null ? void 0 : Te.block_color) && `notion-${(X = y.format) == null ? void 0 : X.block_color}_co`} ${R}` }, /* @__PURE__ */ M.createElement(k, { block: y }), /* @__PURE__ */ M.createElement("div", { className: "notion-callout-text" }, /* @__PURE__ */ M.createElement(g, {
588
+ value: (Ee = y.properties) == null ? void 0 : Ee.title,
580
589
  block: y
581
- }), x));
590
+ }), b));
582
591
  case "bookmark": {
583
- var Ee, De, Oe, ke, Ae, je, Me, Ne, Pe;
592
+ var Z, De, Oe, ke, Ae, je, Me, Ne, Pe;
584
593
  if (!y.properties) return null;
585
594
  let e = y.properties.link;
586
- if (!e || !((Ee = e[0]) != null && Ee[0])) return null;
587
- let t = P(y.properties.title);
588
- if (t || (t = P(e)), t && t.startsWith("http")) try {
595
+ if (!e || !((Z = e[0]) != null && Z[0])) return null;
596
+ let t = F(y.properties.title);
597
+ if (t || (t = F(e)), t && t.startsWith("http")) try {
589
598
  t = new URL(t).hostname;
590
599
  } catch (e) {}
591
- return /* @__PURE__ */ j.createElement("div", { className: "notion-row" }, /* @__PURE__ */ j.createElement(n.Link, {
600
+ return /* @__PURE__ */ M.createElement("div", { className: "notion-row" }, /* @__PURE__ */ M.createElement(n.Link, {
592
601
  target: "_blank",
593
602
  rel: "noopener noreferrer",
594
603
  className: `notion-bookmark ${(De = y.format) != null && De.block_color ? `notion-${y.format.block_color}` : ""} ${R}`,
595
604
  href: e[0][0]
596
- }, /* @__PURE__ */ j.createElement("div", null, t && /* @__PURE__ */ j.createElement("div", { className: "notion-bookmark-title" }, /* @__PURE__ */ j.createElement(m, {
605
+ }, /* @__PURE__ */ M.createElement("div", null, t && /* @__PURE__ */ M.createElement("div", { className: "notion-bookmark-title" }, /* @__PURE__ */ M.createElement(g, {
597
606
  value: [[t]],
598
607
  block: y
599
- })), ((Oe = y.properties) == null ? void 0 : Oe.description) && /* @__PURE__ */ j.createElement("div", { className: "notion-bookmark-description" }, /* @__PURE__ */ j.createElement(m, {
608
+ })), ((Oe = y.properties) == null ? void 0 : Oe.description) && /* @__PURE__ */ M.createElement("div", { className: "notion-bookmark-description" }, /* @__PURE__ */ M.createElement(g, {
600
609
  value: (ke = y.properties) == null ? void 0 : ke.description,
601
610
  block: y
602
- })), /* @__PURE__ */ j.createElement("div", { className: "notion-bookmark-link" }, ((Ae = y.format) == null ? void 0 : Ae.bookmark_icon) && /* @__PURE__ */ j.createElement("div", { className: "notion-bookmark-link-icon" }, /* @__PURE__ */ j.createElement(k, {
611
+ })), /* @__PURE__ */ M.createElement("div", { className: "notion-bookmark-link" }, ((Ae = y.format) == null ? void 0 : Ae.bookmark_icon) && /* @__PURE__ */ M.createElement("div", { className: "notion-bookmark-link-icon" }, /* @__PURE__ */ M.createElement(te, {
603
612
  src: s((je = y.format) == null ? void 0 : je.bookmark_icon, y),
604
613
  alt: t,
605
614
  onError: (e) => {
606
615
  let t = e.currentTarget.closest(".notion-bookmark-link-icon");
607
616
  t && (t.style.display = "none");
608
617
  }
609
- })), /* @__PURE__ */ j.createElement("div", { className: "notion-bookmark-link-text" }, /* @__PURE__ */ j.createElement(m, {
618
+ })), /* @__PURE__ */ M.createElement("div", { className: "notion-bookmark-link-text" }, /* @__PURE__ */ M.createElement(g, {
610
619
  value: e,
611
620
  block: y
612
- })))), ((Me = y.format) == null ? void 0 : Me.bookmark_cover) && /* @__PURE__ */ j.createElement("div", { className: "notion-bookmark-image" }, /* @__PURE__ */ j.createElement(k, {
621
+ })))), ((Me = y.format) == null ? void 0 : Me.bookmark_cover) && /* @__PURE__ */ M.createElement("div", { className: "notion-bookmark-image" }, /* @__PURE__ */ M.createElement(te, {
613
622
  src: s((Ne = y.format) == null ? void 0 : Ne.bookmark_cover, y).replace(/(\/\/i\.ytimg\.com\/.*?)maxresdefault/, "$1hqdefault"),
614
- alt: P((Pe = y.properties) == null ? void 0 : Pe.title),
623
+ alt: F((Pe = y.properties) == null ? void 0 : Pe.title),
615
624
  style: { objectFit: "cover" },
616
625
  onError: (e) => {
617
626
  let t = e.currentTarget.closest(".notion-bookmark-image");
@@ -619,17 +628,17 @@ var ye = ["className"], be = (e) => {
619
628
  }
620
629
  }))));
621
630
  }
622
- case "toggle": return /* @__PURE__ */ j.createElement("details", { className: `notion-toggle ${R}` }, /* @__PURE__ */ j.createElement("summary", null, B()), /* @__PURE__ */ j.createElement("div", null, x));
631
+ case "toggle": return /* @__PURE__ */ M.createElement("details", { className: `notion-toggle ${R}` }, /* @__PURE__ */ M.createElement("summary", null, z()), /* @__PURE__ */ M.createElement("div", null, b));
623
632
  case "table_of_contents": {
624
633
  var Fe;
625
- let e = M(y, i);
634
+ let e = N(y, a);
626
635
  if (!e) return null;
627
- let t = N(e, i), n = (Fe = y.format) == null ? void 0 : Fe.block_color;
628
- return /* @__PURE__ */ j.createElement("div", { className: `notion-table-of-contents ${n && `notion-${n}`} ${R}` }, t.map((e) => /* @__PURE__ */ j.createElement("a", {
636
+ let t = P(e, a), n = (Fe = y.format) == null ? void 0 : Fe.block_color;
637
+ return /* @__PURE__ */ M.createElement("div", { className: `notion-table-of-contents ${n && `notion-${n}`} ${R}` }, t.map((e) => /* @__PURE__ */ M.createElement("a", {
629
638
  key: e.id,
630
- href: `#${I(e.id)}`,
639
+ href: `#${L(e.id)}`,
631
640
  className: "notion-table-of-contents-item"
632
- }, /* @__PURE__ */ j.createElement("span", {
641
+ }, /* @__PURE__ */ M.createElement("span", {
633
642
  className: "notion-table-of-contents-item-body",
634
643
  style: {
635
644
  display: "inline-block",
@@ -640,48 +649,52 @@ var ye = ["className"], be = (e) => {
640
649
  case "to_do": {
641
650
  var Q;
642
651
  let e = ((Q = y.properties) == null || (Q = Q.checked) == null || (Q = Q[0]) == null ? void 0 : Q[0]) === "Yes";
643
- return /* @__PURE__ */ j.createElement("div", { className: `notion-to-do ${R}` }, /* @__PURE__ */ j.createElement("div", { className: "notion-to-do-item" }, /* @__PURE__ */ j.createElement(n.Checkbox, {
652
+ return /* @__PURE__ */ M.createElement("div", { className: `notion-to-do ${R}` }, /* @__PURE__ */ M.createElement("div", { className: "notion-to-do-item" }, /* @__PURE__ */ M.createElement(n.Checkbox, {
644
653
  blockId: R,
645
654
  isChecked: e
646
- }), /* @__PURE__ */ j.createElement("div", { className: `notion-to-do-body ${e && "notion-to-do-checked"}` }, B())), /* @__PURE__ */ j.createElement("div", { className: "notion-to-do-children" }, x));
655
+ }), /* @__PURE__ */ M.createElement("div", { className: `notion-to-do-body ${e && "notion-to-do-checked"}` }, z())), /* @__PURE__ */ M.createElement("div", { className: "notion-to-do-children" }, b));
647
656
  }
648
- case "transclusion_container": return /* @__PURE__ */ j.createElement("div", { className: `notion-sync-block ${R}` }, x);
649
- case "transclusion_reference": return /* @__PURE__ */ j.createElement(pe, _({
657
+ case "transclusion_container": return /* @__PURE__ */ M.createElement("div", { className: `notion-sync-block ${R}` }, b);
658
+ case "transclusion_reference": return /* @__PURE__ */ M.createElement(pe, r({
650
659
  block: y,
651
660
  level: S + 1
652
661
  }, e));
653
662
  case "alias": {
654
663
  var $, Ie;
655
- let e = y == null || ($ = y.format) == null || ($ = $.alias_pointer) == null ? void 0 : $.id, t = (Ie = i.block[e]) == null ? void 0 : Ie.value;
656
- return t ? /* @__PURE__ */ j.createElement(n.PageLink, {
664
+ let e = y == null || ($ = y.format) == null || ($ = $.alias_pointer) == null ? void 0 : $.id, t = (Ie = a.block[e]) == null ? void 0 : Ie.value;
665
+ return t ? /* @__PURE__ */ M.createElement(n.PageLink, {
657
666
  className: `notion-page-link ${e}}`,
658
- href: a(e)
659
- }, /* @__PURE__ */ j.createElement(b, { block: t })) : (console.debug("\"alias\" missing block", e), null);
667
+ href: o(e)
668
+ }, /* @__PURE__ */ M.createElement(x, { block: t })) : (console.debug("\"alias\" missing block", e), null);
660
669
  }
661
- case "table": return /* @__PURE__ */ j.createElement("table", { className: `notion-simple-table ${R}` }, /* @__PURE__ */ j.createElement("tbody", null, x));
670
+ case "table": return /* @__PURE__ */ M.createElement("table", { className: `notion-simple-table ${R}` }, /* @__PURE__ */ M.createElement("tbody", null, b));
662
671
  case "table_row": {
663
672
  var Le, Re, ze, Be;
664
- let e = (Le = i.block[y.parent_id]) == null ? void 0 : Le.value, t = (Re = e.format) == null ? void 0 : Re.table_block_column_order, n = (ze = e.format) == null ? void 0 : ze.table_block_column_format, r = (Be = y.format) == null ? void 0 : Be.block_color;
665
- return !e || !t ? null : /* @__PURE__ */ j.createElement("tr", { className: `notion-simple-table-row ${r && `notion-${r}`} ${R}` }, t.map((e) => {
673
+ let e = (Le = a.block[y.parent_id]) == null ? void 0 : Le.value, t = (Re = e.format) == null ? void 0 : Re.table_block_column_order, n = (ze = e.format) == null ? void 0 : ze.table_block_column_format, r = (Be = y.format) == null ? void 0 : Be.block_color;
674
+ return !e || !t ? null : /* @__PURE__ */ M.createElement("tr", { className: `notion-simple-table-row ${r && `notion-${r}`} ${R}` }, t.map((e) => {
666
675
  var t, r, i;
667
676
  let a = n == null || (t = n[e]) == null ? void 0 : t.color;
668
- return /* @__PURE__ */ j.createElement("td", {
677
+ return /* @__PURE__ */ M.createElement("td", {
669
678
  key: e,
670
679
  className: a ? `notion-${a}` : "",
671
680
  style: { width: (n == null || (r = n[e]) == null ? void 0 : r.width) || 120 }
672
- }, /* @__PURE__ */ j.createElement("div", { className: "notion-simple-table-cell" }, /* @__PURE__ */ j.createElement(m, {
681
+ }, /* @__PURE__ */ M.createElement("div", { className: "notion-simple-table-cell" }, /* @__PURE__ */ M.createElement(g, {
673
682
  value: ((i = y.properties) == null ? void 0 : i[e]) || [["ㅤ"]],
674
683
  block: y
675
684
  })));
676
685
  }));
677
686
  }
678
- case "external_object_instance": return /* @__PURE__ */ j.createElement(D, {
687
+ case "external_object_instance": return /* @__PURE__ */ M.createElement(O, {
679
688
  block: y,
680
689
  className: R
681
690
  });
682
- default: return process.env.NODE_ENV !== "production" && console.debug("Unsupported type " + y.type, JSON.stringify(y, null, 2)), /* @__PURE__ */ j.createElement("div", null);
691
+ default: return process.env.NODE_ENV !== "production" && console.debug("Unsupported type " + y.type, JSON.stringify(y, null, 2)), /* @__PURE__ */ M.createElement("div", null);
683
692
  }
684
- }, Ce = [
693
+ };
694
+ //#endregion
695
+ //#region src/renderer.tsx
696
+ e();
697
+ var Te = [
685
698
  "components",
686
699
  "recordMap",
687
700
  "mapPageUrl",
@@ -706,13 +719,13 @@ var ye = ["className"], be = (e) => {
706
719
  "defaultPageCover",
707
720
  "defaultPageCoverPosition",
708
721
  "editable"
709
- ], we = ["level", "blockId"], Te = (e) => {
710
- 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 } = e, D = v(e, Ce), O = j.useMemo(() => typeof window < "u" && re({
722
+ ], X = ["level", "blockId"], Ee = (e) => {
723
+ let { components: t, recordMap: n, mapPageUrl: r, mapImageUrl: i, searchNotion: a, isShowingSearch: o, onHideSearch: s, fullPage: c, rootPageId: l, rootDomain: u, rootSpaceId: d, darkMode: p, previewImages: m, forceCustomImages: h, showCollectionViewDropdown: g, linkTableTitleProperties: _, isLinkCollectionToUrlProperty: v, isImageZoomable: b = !0, showTableOfContents: x, minTableOfContentsItems: S, defaultPageIcon: C, defaultPageCover: w, defaultPageCoverPosition: T, editable: E } = e, D = y(e, Te), O = M.useMemo(() => typeof window < "u" && re({
711
724
  background: "rgba(0, 0, 0, 0.8)",
712
725
  minZoomScale: 2,
713
- margin: Ee()
726
+ margin: De()
714
727
  }), []);
715
- return /* @__PURE__ */ j.createElement(u, {
728
+ return /* @__PURE__ */ M.createElement(f, {
716
729
  components: t,
717
730
  recordMap: n,
718
731
  mapPageUrl: r,
@@ -722,14 +735,14 @@ var ye = ["className"], be = (e) => {
722
735
  onHideSearch: s,
723
736
  fullPage: c,
724
737
  rootPageId: l,
725
- rootDomain: d,
726
- rootSpaceId: f,
738
+ rootDomain: u,
739
+ rootSpaceId: d,
727
740
  darkMode: p,
728
741
  previewImages: m,
729
742
  forceCustomImages: h,
730
743
  showCollectionViewDropdown: g,
731
744
  linkTableTitleProperties: _,
732
- isLinkCollectionToUrlProperty: y,
745
+ isLinkCollectionToUrlProperty: v,
733
746
  showTableOfContents: x,
734
747
  minTableOfContentsItems: S,
735
748
  defaultPageIcon: C,
@@ -737,25 +750,25 @@ var ye = ["className"], be = (e) => {
737
750
  defaultPageCoverPosition: T,
738
751
  editable: E,
739
752
  zoom: b ? O : null
740
- }, /* @__PURE__ */ j.createElement(Z, D));
753
+ }, /* @__PURE__ */ M.createElement(Z, D));
741
754
  }, Z = (e) => {
742
755
  var t, n;
743
- let { level: r = 0, blockId: i } = e, a = v(e, we), { recordMap: o } = w(), s = i || Object.keys(o.block)[0], c = (t = o.block[s]) == null ? void 0 : t.value;
744
- return c ? /* @__PURE__ */ j.createElement(X, _({
745
- key: s,
746
- level: r,
747
- block: c
748
- }, a), c == null || (n = c.content) == null ? void 0 : n.map((e) => /* @__PURE__ */ j.createElement(Z, _({
756
+ let { level: i = 0, blockId: a } = e, o = y(e, X), { recordMap: s } = T(), c = a || Object.keys(s.block)[0], l = (t = s.block[c]) == null ? void 0 : t.value;
757
+ return l ? /* @__PURE__ */ M.createElement(Y, r({
758
+ key: c,
759
+ level: i,
760
+ block: l
761
+ }, o), l == null || (n = l.content) == null ? void 0 : n.map((e) => /* @__PURE__ */ M.createElement(Z, r({
749
762
  key: e,
750
763
  blockId: e,
751
- level: r + 1
752
- }, a)))) : (process.env.NODE_ENV !== "production" && console.warn("missing block", i), null);
764
+ level: i + 1
765
+ }, o)))) : (process.env.NODE_ENV !== "production" && console.warn("missing block", a), null);
753
766
  };
754
- function Ee() {
767
+ function De() {
755
768
  let e = window.innerWidth;
756
769
  return e < 500 ? 8 : e < 800 ? 20 : e < 1280 ? 30 : e < 1600 ? 40 : e < 1920 ? 48 : 72;
757
770
  }
758
771
  //#endregion
759
- export { x as Asset, T as AssetWrapper, se as Audio, X as Block, f as Breadcrumbs, n as Checkbox, ne as CollectionColumnTitle, D as EOI, me as EditableText, le as File, ue as GoogleDrive, l as GracefulImage, y as Header, C as LiteYouTubeEmbed, Z as NotionBlockRenderer, g as NotionContextConsumer, u as NotionContextProvider, Te as NotionRenderer, fe as PageAside, A as PageIcon, d as PageIconImpl, b as PageTitle, h as PageTitleImpl, ee as PropertyIcon, E as Search, p as SearchDialog, pe as SyncPointerBlock, m as Text, S as dummyLink, s as formatDate, r as formatNotionDateTime, O as getHashFragmentValue, c as getListNumber, a as getYoutubeId, te as iconMap, i as isBrowser, B as isTitleIsland, o as isUrl, ge as readTitle, ve as selectTitle, _e as titleOffset, Y as titlePosition, w as useNotionContext };
772
+ export { S as Asset, E as AssetWrapper, se as Audio, Y as Block, m as Breadcrumbs, i as Checkbox, ne as CollectionColumnTitle, O as EOI, ge as EditableText, ue as File, de as GoogleDrive, d as GracefulImage, b as Header, w as LiteYouTubeEmbed, Z as NotionBlockRenderer, v as NotionContextConsumer, f as NotionContextProvider, Ee as NotionRenderer, fe as PageAside, k as PageIcon, p as PageIconImpl, x as PageTitle, _ as PageTitleImpl, A as PropertyIcon, D as Search, h as SearchDialog, pe as SyncPointerBlock, g as Text, C as dummyLink, l as formatDate, a as formatNotionDateTime, ee as getHashFragmentValue, u as getListNumber, s as getYoutubeId, j as iconMap, o as isBrowser, B as isTitleIsland, c as isUrl, W as readTitle, be as selectTitle, ye as titleOffset, J as titlePosition, T as useNotionContext };
760
773
 
761
774
  //# sourceMappingURL=index.js.map