@texonom/nreact 1.6.7 → 1.6.8

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