@texonom/nreact 1.5.1 → 1.5.3

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.
@@ -83,36 +83,36 @@ const pe = ({ isChecked: t }) => {
83
83
  } catch (a) {
84
84
  }
85
85
  return null;
86
- }, V = (s) => {
87
- var m = s, { src: t, alt: a, className: n, style: o, zoomable: u = !1, priority: c = !1, height: r } = m, l = b(m, ["src", "alt", "className", "style", "zoomable", "priority", "height"]);
88
- var N, g, y;
89
- const { recordMap: p, zoom: i, previewImages: f, forceCustomImages: v, components: h } = _(), d = e.useRef(i ? i.clone() : null), w = f ? (y = (N = p == null ? void 0 : p.preview_images) == null ? void 0 : N[t]) != null ? y : (g = p == null ? void 0 : p.preview_images) == null ? void 0 : g[ne(t)] : null, I = e.useCallback(
90
- (C) => {
91
- u && (C.target.src || C.target.srcset) && d.current && d.current.attach(C.target);
86
+ }, V = (m) => {
87
+ var p = m, { src: t, alt: a, className: n, style: o, zoomable: u = !1, priority: c = !1, height: r, onError: l } = p, s = b(p, ["src", "alt", "className", "style", "zoomable", "priority", "height", "onError"]);
88
+ var g, y, v;
89
+ const { recordMap: i, zoom: d, previewImages: C, forceCustomImages: h, components: f } = S(), w = e.useRef(d ? d.clone() : null), I = C ? (v = (g = i == null ? void 0 : i.preview_images) == null ? void 0 : g[t]) != null ? v : (y = i == null ? void 0 : i.preview_images) == null ? void 0 : y[ne(t)] : null, x = e.useCallback(
90
+ (k) => {
91
+ u && (k.target.src || k.target.srcset) && w.current && w.current.attach(k.target);
92
92
  },
93
- [d, u]
94
- ), k = e.useCallback(
95
- (C) => {
96
- d.current && C && d.current.attach(C);
93
+ [w, u]
94
+ ), _ = e.useCallback(
95
+ (k) => {
96
+ w.current && k && w.current.attach(k);
97
97
  },
98
- [d]
99
- ), S = e.useMemo(() => u ? k : void 0, [u, k]);
100
- return w && h.Image ? /* @__PURE__ */ e.createElement(
101
- h.Image,
98
+ [w]
99
+ ), N = e.useMemo(() => u ? _ : void 0, [u, _]);
100
+ return I && f.Image ? /* @__PURE__ */ e.createElement(
101
+ f.Image,
102
102
  {
103
103
  src: t,
104
104
  alt: a,
105
105
  style: o,
106
106
  className: n,
107
- width: w.originalWidth,
108
- height: w.originalHeight,
109
- blurDataURL: w.dataURIBase64,
107
+ width: I.originalWidth,
108
+ height: I.originalHeight,
109
+ blurDataURL: I.dataURIBase64,
110
110
  placeholder: "blur",
111
111
  priority: c,
112
- onLoad: I
112
+ onLoad: x
113
113
  }
114
- ) : h.Image && v ? /* @__PURE__ */ e.createElement(
115
- h.Image,
114
+ ) : f.Image && h ? /* @__PURE__ */ e.createElement(
115
+ f.Image,
116
116
  {
117
117
  src: t,
118
118
  alt: a,
@@ -121,7 +121,7 @@ const pe = ({ isChecked: t }) => {
121
121
  width: null,
122
122
  height: r || null,
123
123
  priority: c,
124
- onLoad: I
124
+ onLoad: x
125
125
  }
126
126
  ) : /* @__PURE__ */ e.createElement(
127
127
  "img",
@@ -130,24 +130,25 @@ const pe = ({ isChecked: t }) => {
130
130
  style: o,
131
131
  src: t,
132
132
  alt: a,
133
- ref: S,
133
+ ref: N,
134
134
  loading: "lazy",
135
- decoding: "async"
136
- }, l)
135
+ decoding: "async",
136
+ onError: l
137
+ }, s)
137
138
  );
138
139
  }, Ce = (t) => t.type === "page" || t.type === "callout" || t.type === "collection_view" || t.type === "collection_view_page", ve = ({ block: t, className: a, inline: n = !0, hideDefaultIcon: o = !1, defaultIcon: u }) => {
139
140
  var p;
140
- const { mapImageUrl: c, recordMap: r, darkMode: l } = _();
141
+ const { mapImageUrl: c, recordMap: r, darkMode: l } = S();
141
142
  let s = !1, m = null;
142
143
  if (Ce(t)) {
143
- const i = ((p = ae(t, r)) == null ? void 0 : p.trim()) || u, f = F(t, r);
144
+ const i = ((p = ae(t, r)) == null ? void 0 : p.trim()) || u, d = F(t, r);
144
145
  if (i && re(i)) {
145
- const v = c(i, t);
146
- s = !0, m = /* @__PURE__ */ e.createElement(V, { src: v, alt: f || "page icon", className: `${a || ""} notion-page-icon` });
146
+ const C = c(i, t);
147
+ s = !0, m = /* @__PURE__ */ e.createElement(V, { src: C, alt: d || "page icon", className: `${a || ""} notion-page-icon` });
147
148
  } else if (i && i.startsWith("/icons/")) {
148
- const v = "https://www.notion.so" + i + "?mode=" + (l ? "dark" : "light");
149
- m = /* @__PURE__ */ e.createElement(V, { src: v, alt: f || "page icon", className: `${a || ""} notion-page-icon` });
150
- } else i ? (s = !1, m = /* @__PURE__ */ e.createElement("span", { className: `${a || ""} notion-page-icon`, role: "img", "aria-label": i }, i)) : o || (s = !0, m = /* @__PURE__ */ e.createElement(de, { className: `${a || ""} notion-page-icon`, alt: f || "page icon" }));
149
+ const C = "https://www.notion.so" + i + "?mode=" + (l ? "dark" : "light");
150
+ m = /* @__PURE__ */ e.createElement(V, { src: C, alt: d || "page icon", className: `${a || ""} notion-page-icon` });
151
+ } else i ? (s = !1, m = /* @__PURE__ */ e.createElement("span", { className: `${a || ""} notion-page-icon`, role: "img", "aria-label": i }, i)) : o || (s = !0, m = /* @__PURE__ */ e.createElement(de, { className: `${a || ""} notion-page-icon`, alt: d || "page icon" }));
151
152
  }
152
153
  return m ? /* @__PURE__ */ e.createElement(
153
154
  "div",
@@ -176,18 +177,18 @@ function ke(t) {
176
177
  )));
177
178
  }
178
179
  const xe = ({ block: t, inline: a, className: n }) => {
179
- var f, v, h;
180
- const { components: o } = _(), { original_url: u, attributes: c, domain: r } = (t == null ? void 0 : t.format) || {};
180
+ var d, C, h;
181
+ const { components: o } = S(), { original_url: u, attributes: c, domain: r } = (t == null ? void 0 : t.format) || {};
181
182
  if (!u || !c) return null;
182
- const l = (f = c.find((d) => d.id === "title")) == null ? void 0 : f.values[0];
183
- let s = (v = c.find((d) => d.id === "owner")) == null ? void 0 : v.values[0];
184
- const m = (h = c.find((d) => d.id === "updated_at")) == null ? void 0 : h.values[0], p = m ? oe(m) : null;
183
+ const l = (d = c.find((f) => f.id === "title")) == null ? void 0 : d.values[0];
184
+ let s = (C = c.find((f) => f.id === "owner")) == null ? void 0 : C.values[0];
185
+ const m = (h = c.find((f) => f.id === "updated_at")) == null ? void 0 : h.values[0], p = m ? oe(m) : null;
185
186
  let i;
186
187
  switch (r) {
187
188
  case "github.com":
188
189
  if (i = /* @__PURE__ */ e.createElement(ke, null), s) {
189
- const d = s.split("/");
190
- s = d[d.length - 1];
190
+ const f = s.split("/");
191
+ s = f[f.length - 1];
191
192
  }
192
193
  break;
193
194
  default:
@@ -205,40 +206,40 @@ const xe = ({ block: t, inline: a, className: n }) => {
205
206
  /* @__PURE__ */ e.createElement("div", { className: "notion-external-description" }, /* @__PURE__ */ e.createElement("div", { className: "notion-external-title" }, l), (s || p) && /* @__PURE__ */ e.createElement("div", { className: "notion-external-subtitle" }, s && /* @__PURE__ */ e.createElement("span", null, s), s && p && /* @__PURE__ */ e.createElement("span", null, " • "), p && /* @__PURE__ */ e.createElement("span", null, "Updated ", p)))
206
207
  );
207
208
  }, A = (t) => he ? /* @__PURE__ */ e.createElement(ce, E({}, t)) : /* @__PURE__ */ e.createElement("img", E({}, t)), D = ({ value: t, block: a, linkProps: n, linkProtocol: o }) => {
208
- const { components: u, recordMap: c, mapPageUrl: r, mapImageUrl: l, rootDomain: s } = _();
209
+ const { components: u, recordMap: c, mapPageUrl: r, mapImageUrl: l, rootDomain: s } = S();
209
210
  return /* @__PURE__ */ e.createElement(e.Fragment, null, t == null ? void 0 : t.map((m, p) => {
210
- const [i, f] = m;
211
- if (!f)
211
+ const [i, d] = m;
212
+ if (!d)
212
213
  return i === "," ? /* @__PURE__ */ e.createElement("span", { key: p, style: { padding: "0.5em" } }) : /* @__PURE__ */ e.createElement(e.Fragment, { key: p }, i);
213
- const v = f.reduce(
214
- (h, d) => {
215
- var w, I, k, S, N;
216
- switch (d[0]) {
214
+ const C = d.reduce(
215
+ (h, f) => {
216
+ var w, I, x, _, N;
217
+ switch (f[0]) {
217
218
  case "p": {
218
- const g = d[1], y = (w = c.block[g]) == null ? void 0 : w.value;
219
+ const g = f[1], y = (w = c.block[g]) == null ? void 0 : w.value;
219
220
  return y ? /* @__PURE__ */ e.createElement(u.PageLink, { className: "notion-link", href: r(g) }, /* @__PURE__ */ e.createElement(U, { block: y })) : (console.debug('"p" missing block', g), null);
220
221
  }
221
222
  case "‣": {
222
- const g = d[1][0], y = d[1][1];
223
+ const g = f[1][0], y = f[1][1];
223
224
  switch (g) {
224
225
  case "u": {
225
- const C = (I = c.notion_user[y]) == null ? void 0 : I.value;
226
- if (!C)
226
+ const v = (I = c.notion_user[y]) == null ? void 0 : I.value;
227
+ if (!v)
227
228
  return console.debug('"‣" missing user', y), null;
228
- const L = [C.given_name, C.family_name].filter(Boolean).join(" "), M = C.email;
229
+ const k = [v.given_name, v.family_name].filter(Boolean).join(" "), M = v.email;
229
230
  return /* @__PURE__ */ e.createElement(u.Link, E({ className: "notion-link", href: `mailto:${M}` }, n), /* @__PURE__ */ e.createElement(
230
231
  A,
231
232
  {
232
233
  className: "notion-user",
233
- src: l(C.profile_photo, a),
234
- alt: L,
234
+ src: l(v.profile_photo, a),
235
+ alt: k,
235
236
  style: { display: "inline", marginRight: "0.3em", marginBottom: "0.3em" }
236
237
  }
237
- ), L);
238
+ ), k);
238
239
  }
239
240
  default: {
240
- const C = (k = c.block[y]) == null ? void 0 : k.value;
241
- return C ? /* @__PURE__ */ e.createElement(
241
+ const v = (x = c.block[y]) == null ? void 0 : x.value;
242
+ return v ? /* @__PURE__ */ e.createElement(
242
243
  u.PageLink,
243
244
  P(E({
244
245
  className: "notion-link",
@@ -247,13 +248,13 @@ const xe = ({ block: t, inline: a, className: n }) => {
247
248
  target: "_blank",
248
249
  rel: "noopener noreferrer"
249
250
  }),
250
- /* @__PURE__ */ e.createElement(U, { block: C })
251
+ /* @__PURE__ */ e.createElement(U, { block: v })
251
252
  ) : (console.debug('"‣" missing block', g, y), null);
252
253
  }
253
254
  }
254
255
  }
255
256
  case "h":
256
- return /* @__PURE__ */ e.createElement("span", { className: `notion-${d[1]}` }, h);
257
+ return /* @__PURE__ */ e.createElement("span", { className: `notion-${f[1]}` }, h);
257
258
  case "c":
258
259
  return /* @__PURE__ */ e.createElement("code", { className: "notion-inline-code" }, h);
259
260
  case "b":
@@ -265,69 +266,69 @@ const xe = ({ block: t, inline: a, className: n }) => {
265
266
  case "_":
266
267
  return /* @__PURE__ */ e.createElement("span", { className: "notion-inline-underscore" }, h);
267
268
  case "e":
268
- return /* @__PURE__ */ e.createElement(u.Equation, { math: d[1], inline: !0 });
269
+ return /* @__PURE__ */ e.createElement(u.Equation, { math: f[1], inline: !0 });
269
270
  case "m":
270
271
  return h;
271
272
  //still need to return the base element
272
273
  case "a": {
273
- const g = d[1], y = g.substring(1), C = R(y, { uuid: !0 });
274
- if ((g[0] === "/" || g.includes(s)) && C) {
275
- const L = g.includes(s) ? g : `${r(C)}${ge(g)}`;
276
- return /* @__PURE__ */ e.createElement(u.PageLink, E({ className: "notion-link", href: L }, n), h);
274
+ const g = f[1], y = g.substring(1), v = R(y, { uuid: !0 });
275
+ if ((g[0] === "/" || g.includes(s)) && v) {
276
+ const k = g.includes(s) ? g : `${r(v)}${ge(g)}`;
277
+ return /* @__PURE__ */ e.createElement(u.PageLink, E({ className: "notion-link", href: k }, n), h);
277
278
  } else
278
279
  return /* @__PURE__ */ e.createElement(
279
280
  u.Link,
280
281
  E({
281
282
  className: "notion-link",
282
- href: o ? `${o}:${d[1]}` : d[1]
283
+ href: o ? `${o}:${f[1]}` : f[1]
283
284
  }, n),
284
285
  h
285
286
  );
286
287
  }
287
288
  // Date
288
289
  case "d": {
289
- const g = d[1], y = g == null ? void 0 : g.type;
290
+ const g = f[1], y = g == null ? void 0 : g.type;
290
291
  if (y === "date") {
291
- const C = g.start_date;
292
- return T(C);
292
+ const v = g.start_date;
293
+ return T(v);
293
294
  } else if (y === "daterange") {
294
- const C = g.start_date, L = g.end_date;
295
- return `${T(C)} → ${T(L)}`;
295
+ const v = g.start_date, k = g.end_date;
296
+ return `${T(v)} → ${T(k)}`;
296
297
  } else
297
298
  return h;
298
299
  }
299
300
  // User
300
301
  case "u": {
301
- const g = d[1], y = (S = c.notion_user[g]) == null ? void 0 : S.value;
302
+ const g = f[1], y = (_ = c.notion_user[g]) == null ? void 0 : _.value;
302
303
  if (!y)
303
304
  return console.debug("missing user", g), null;
304
- const C = y.name, L = y.email;
305
- return /* @__PURE__ */ e.createElement(u.Link, E({ className: "notion-link", href: `mailto:${L}` }, n), /* @__PURE__ */ e.createElement(
305
+ const v = y.name, k = y.email;
306
+ return /* @__PURE__ */ e.createElement(u.Link, E({ className: "notion-link", href: `mailto:${k}` }, n), /* @__PURE__ */ e.createElement(
306
307
  A,
307
308
  {
308
309
  className: "notion-user",
309
310
  src: l(y.profile_photo, a),
310
- alt: C,
311
+ alt: v,
311
312
  style: { display: "inline", marginRight: "0.3em", marginBottom: "0.3em" }
312
313
  }
313
- ), C);
314
+ ), v);
314
315
  }
315
316
  case "eoi": {
316
- const g = d[1], y = (N = c.block[g]) == null ? void 0 : N.value;
317
+ const g = f[1], y = (N = c.block[g]) == null ? void 0 : N.value;
317
318
  return /* @__PURE__ */ e.createElement(xe, { block: y, inline: !0 });
318
319
  }
319
320
  default:
320
- return process.env.NODE_ENV !== "production" && console.debug("unsupported text format", d), h;
321
+ return process.env.NODE_ENV !== "production" && console.debug("unsupported text format", f), h;
321
322
  }
322
323
  },
323
324
  /* @__PURE__ */ e.createElement(e.Fragment, null, i)
324
325
  );
325
- return /* @__PURE__ */ e.createElement(e.Fragment, { key: p }, v);
326
+ return /* @__PURE__ */ e.createElement(e.Fragment, { key: p }, C);
326
327
  }));
327
328
  }, Ie = (u) => {
328
329
  var c = u, { block: t, className: a, defaultIcon: n } = c, o = b(c, ["block", "className", "defaultIcon"]);
329
330
  var l, s;
330
- const { recordMap: r } = _();
331
+ const { recordMap: r } = S();
331
332
  if (!t) return null;
332
333
  if (t.type === "collection_view_page" || t.type === "collection_view") {
333
334
  const m = F(t, r);
@@ -399,17 +400,17 @@ class be extends e.Component {
399
400
  else {
400
401
  l = E({}, r);
401
402
  const p = l.results.map((i) => {
402
- var h, d;
403
- const f = (h = l.recordMap.block[i.id]) == null ? void 0 : h.value;
404
- if (!f) return;
405
- const v = F(f, l.recordMap);
406
- if (v && (i.title = v, i.block = f, i.recordMap = l.recordMap, i.page = se(f, l.recordMap, {
403
+ var h, f;
404
+ const d = (h = l.recordMap.block[i.id]) == null ? void 0 : h.value;
405
+ if (!d) return;
406
+ const C = F(d, l.recordMap);
407
+ if (C && (i.title = C, i.block = d, i.recordMap = l.recordMap, i.page = se(d, l.recordMap, {
407
408
  inclusive: !0
408
- }) || f, !!i.page.id))
409
- return (d = i.highlight) != null && d.text && (i.highlight.html = i.highlight.text.replace(/<gzkNfoUU>/gi, "<b>").replace(/<\/gzkNfoUU>/gi, "</b>")), i;
409
+ }) || d, !!i.page.id))
410
+ return (f = i.highlight) != null && f.text && (i.highlight.html = i.highlight.text.replace(/<gzkNfoUU>/gi, "<b>").replace(/<\/gzkNfoUU>/gi, "</b>")), i;
410
411
  }).filter(Boolean).reduce(
411
- (i, f) => P(E({}, i), {
412
- [f.page.id]: f
412
+ (i, d) => P(E({}, i), {
413
+ [d.page.id]: d
413
414
  }),
414
415
  {}
415
416
  );
@@ -444,22 +445,22 @@ class be extends e.Component {
444
445
  ref: this._inputRef,
445
446
  onInput: this._onChangeQuery
446
447
  }
447
- ), u && /* @__PURE__ */ e.createElement("div", { role: "button", className: "clearButton", onClick: this._onClearQuery }, /* @__PURE__ */ e.createElement(Ne, { className: "clearIcon" }))), l && c && /* @__PURE__ */ e.createElement(e.Fragment, null, c.results.length ? /* @__PURE__ */ e.createElement(De, P(E({}, s), { recordMap: c.recordMap }), /* @__PURE__ */ e.createElement("div", { className: "resultsPane" }, c.results.map((f) => {
448
- var v;
448
+ ), u && /* @__PURE__ */ e.createElement("div", { role: "button", className: "clearButton", onClick: this._onClearQuery }, /* @__PURE__ */ e.createElement(Ne, { className: "clearIcon" }))), l && c && /* @__PURE__ */ e.createElement(e.Fragment, null, c.results.length ? /* @__PURE__ */ e.createElement(De, P(E({}, s), { recordMap: c.recordMap }), /* @__PURE__ */ e.createElement("div", { className: "resultsPane" }, c.results.map((d) => {
449
+ var C;
449
450
  return /* @__PURE__ */ e.createElement(
450
451
  m.PageLink,
451
452
  {
452
- key: f.id,
453
+ key: d.id,
453
454
  className: "result notion-page-link",
454
- href: i(f.page.id, c.recordMap)
455
+ href: i(d.page.id, c.recordMap)
455
456
  },
456
- /* @__PURE__ */ e.createElement(U, { block: f.page, defaultIcon: p }),
457
- ((v = f.highlight) == null ? void 0 : v.html) && /* @__PURE__ */ e.createElement(
457
+ /* @__PURE__ */ e.createElement(U, { block: d.page, defaultIcon: p }),
458
+ ((C = d.highlight) == null ? void 0 : C.html) && /* @__PURE__ */ e.createElement(
458
459
  "div",
459
460
  {
460
461
  className: "notion-search-result-highlight",
461
462
  dangerouslySetInnerHTML: {
462
- __html: f.highlight.html
463
+ __html: d.highlight.html
463
464
  }
464
465
  }
465
466
  )
@@ -470,7 +471,7 @@ class be extends e.Component {
470
471
  }
471
472
  }
472
473
  const _e = ({ block: t }) => /* @__PURE__ */ e.createElement("header", { className: "notion-header" }, /* @__PURE__ */ e.createElement("div", { className: "notion-nav-header" }, /* @__PURE__ */ e.createElement(Se, { block: t }), /* @__PURE__ */ e.createElement(Pe, { block: t }))), Se = ({ block: t, rootOnly: a = !1 }) => {
473
- const { recordMap: n, mapPageUrl: o, components: u } = _(), c = e.useMemo(() => {
474
+ const { recordMap: n, mapPageUrl: o, components: u } = S(), c = e.useMemo(() => {
474
475
  const r = ie(n, t.id);
475
476
  return a ? [r[0]].filter(Boolean) : r;
476
477
  }, [n, t.id, a]);
@@ -482,13 +483,13 @@ const _e = ({ block: t }) => /* @__PURE__ */ e.createElement("header", { classNa
482
483
  return r.active ? m.pageLink = (p) => /* @__PURE__ */ e.createElement("div", E({}, p)) : s.href = o(r.pageId), /* @__PURE__ */ e.createElement(e.Fragment, { key: r.pageId }, /* @__PURE__ */ e.createElement(m.pageLink, E({ className: `breadcrumb ${r.active && "active"}` }, s), r.icon && /* @__PURE__ */ e.createElement(z, { className: "icon", block: r.block }), r.title && /* @__PURE__ */ e.createElement("span", { className: "title" }, r.title)), l < c.length - 1 && /* @__PURE__ */ e.createElement("span", { className: "spacer" }, "/"));
483
484
  }));
484
485
  }, Pe = ({ block: t, search: a, title: n = "Search" }) => {
485
- const { searchNotion: o, rootPageId: u, isShowingSearch: c, onHideSearch: r, rootSpaceId: l } = _(), s = a || o, [m, p] = e.useState(c);
486
+ const { searchNotion: o, rootPageId: u, isShowingSearch: c, onHideSearch: r, rootSpaceId: l } = S(), s = a || o, [m, p] = e.useState(c);
486
487
  e.useEffect(() => {
487
488
  p(c);
488
489
  }, [c]);
489
490
  const i = e.useCallback(() => {
490
491
  p(!0);
491
- }, []), f = e.useCallback(() => {
492
+ }, []), d = e.useCallback(() => {
492
493
  p(!1), r && r();
493
494
  }, [r]);
494
495
  W("cmd+p", (h) => {
@@ -496,14 +497,14 @@ const _e = ({ block: t }) => /* @__PURE__ */ e.createElement("header", { classNa
496
497
  }), W("cmd+k", (h) => {
497
498
  i(), h.preventDefault(), h.stopPropagation();
498
499
  });
499
- const v = !!s;
500
- return /* @__PURE__ */ e.createElement(e.Fragment, null, v && /* @__PURE__ */ e.createElement("div", { role: "button", className: "breadcrumb button notion-search-button", onClick: i }, /* @__PURE__ */ e.createElement(Y, { className: "searchIcon" }), n && /* @__PURE__ */ e.createElement("span", { className: "title" }, n)), m && v && /* @__PURE__ */ e.createElement(
500
+ const C = !!s;
501
+ return /* @__PURE__ */ e.createElement(e.Fragment, null, C && /* @__PURE__ */ e.createElement("div", { role: "button", className: "breadcrumb button notion-search-button", onClick: i }, /* @__PURE__ */ e.createElement(Y, { className: "searchIcon" }), n && /* @__PURE__ */ e.createElement("span", { className: "title" }, n)), m && C && /* @__PURE__ */ e.createElement(
501
502
  be,
502
503
  {
503
504
  isOpen: m,
504
505
  rootBlockId: u || (t == null ? void 0 : t.id),
505
506
  rootSpaceId: l,
506
- onClose: f,
507
+ onClose: d,
507
508
  searchNotion: s
508
509
  }
509
510
  ));
@@ -538,8 +539,8 @@ const _e = ({ block: t }) => /* @__PURE__ */ e.createElement("header", { classNa
538
539
  layout: s
539
540
  }, m)
540
541
  );
541
- }, me), $e = (t) => function(v) {
542
- var h = v, {
542
+ }, me), $e = (t) => function(C) {
543
+ var h = C, {
543
544
  href: n,
544
545
  as: o,
545
546
  passHref: u,
@@ -550,7 +551,7 @@ const _e = ({ block: t }) => /* @__PURE__ */ e.createElement("header", { classNa
550
551
  locale: m,
551
552
  className: p,
552
553
  style: i
553
- } = h, f = b(h, [
554
+ } = h, d = b(h, [
554
555
  "href",
555
556
  "as",
556
557
  "passHref",
@@ -574,12 +575,12 @@ const _e = ({ block: t }) => /* @__PURE__ */ e.createElement("header", { classNa
574
575
  locale: m,
575
576
  className: p,
576
577
  style: i
577
- }, f)
578
+ }, d)
578
579
  );
579
580
  }, Be = (t) => /* @__PURE__ */ e.createElement("a", E({ target: "_blank", rel: "noopener noreferrer" }, t)), Re = e.memo(Be), Oe = (n) => {
580
581
  var o = n, { href: t } = o, a = b(o, ["href"]);
581
582
  var l, s;
582
- const { recordMap: u, rootSpaceId: c } = _();
583
+ const { recordMap: u, rootSpaceId: c } = S();
583
584
  let r = t;
584
585
  if (typeof t == "string" && c) {
585
586
  const m = R(t);
@@ -592,7 +593,7 @@ const _e = ({ block: t }) => /* @__PURE__ */ e.createElement("header", { classNa
592
593
  }, Te = e.memo(Oe), Ve = (t) => /* @__PURE__ */ e.createElement(Ae, E({}, t)), ze = _e, at = (c) => {
593
594
  var r = c, { href: t, rel: a, target: n, title: o } = r, u = b(r, ["href", "rel", "target", "title"]);
594
595
  return /* @__PURE__ */ e.createElement("span", E({}, u));
595
- }, $ = (t) => () => (console.warn(`Warning: using empty component "${t}" (you should override this in NotionRenderer.components)`), null), x = (t, a) => a(), X = {
596
+ }, $ = (t) => () => (console.warn(`Warning: using empty component "${t}" (you should override this in NotionRenderer.components)`), null), L = (t, a) => a(), X = {
596
597
  Image: null,
597
598
  // disable custom images by default
598
599
  Link: Re,
@@ -605,21 +606,21 @@ const _e = ({ block: t }) => /* @__PURE__ */ e.createElement("header", { classNa
605
606
  Collection: $("Collection"),
606
607
  Property: void 0,
607
608
  // use the built-in property rendering by default
608
- propertyTextValue: x,
609
- propertySelectValue: x,
610
- propertyRelationValue: x,
611
- propertyFormulaValue: x,
612
- propertyTitleValue: x,
613
- propertyPersonValue: x,
614
- propertyFileValue: x,
615
- propertyCheckboxValue: x,
616
- propertyUrlValue: x,
617
- propertyEmailValue: x,
618
- propertyPhoneNumberValue: x,
619
- propertyNumberValue: x,
620
- propertyLastEditedTimeValue: x,
621
- propertyCreatedTimeValue: x,
622
- propertyDateValue: x,
609
+ propertyTextValue: L,
610
+ propertySelectValue: L,
611
+ propertyRelationValue: L,
612
+ propertyFormulaValue: L,
613
+ propertyTitleValue: L,
614
+ propertyPersonValue: L,
615
+ propertyFileValue: L,
616
+ propertyCheckboxValue: L,
617
+ propertyUrlValue: L,
618
+ propertyEmailValue: L,
619
+ propertyPhoneNumberValue: L,
620
+ propertyNumberValue: L,
621
+ propertyLastEditedTimeValue: L,
622
+ propertyCreatedTimeValue: L,
623
+ propertyDateValue: L,
623
624
  Pdf: $("Pdf"),
624
625
  Tweet: $("Tweet"),
625
626
  Modal: $("Modal"),
@@ -673,10 +674,10 @@ const _e = ({ block: t }) => /* @__PURE__ */ e.createElement("header", { classNa
673
674
  const m = e.useMemo(() => {
674
675
  const i = E({}, t);
675
676
  if (i.nextImage && (i.Image = Me(i.nextImage)), i.nextLink) {
676
- const f = $e(i.nextLink);
677
- i.nextLink = f, i.PageLink || (i.PageLink = f), i.Link || (i.Link = f);
677
+ const d = $e(i.nextLink);
678
+ i.nextLink = d, i.PageLink || (i.PageLink = d), i.Link || (i.Link = d);
678
679
  }
679
- for (const f of Object.keys(i)) i[f] || delete i[f];
680
+ for (const d of Object.keys(i)) i[d] || delete i[d];
680
681
  return i;
681
682
  }, [t]), p = e.useMemo(
682
683
  () => P(E(E({}, J), r), {
@@ -689,7 +690,7 @@ const _e = ({ block: t }) => /* @__PURE__ */ e.createElement("header", { classNa
689
690
  [o, n, m, u, c, r]
690
691
  );
691
692
  return /* @__PURE__ */ e.createElement(H.Provider, { value: p }, a);
692
- }, Ue = H.Consumer, _ = () => e.useContext(H), Fe = (t) => Object.keys(t).map((a) => `${encodeURIComponent(a)}=${encodeURIComponent(t[a])}`).join("&"), He = ({
693
+ }, Ue = H.Consumer, S = () => e.useContext(H), Fe = (t) => Object.keys(t).map((a) => `${encodeURIComponent(a)}=${encodeURIComponent(t[a])}`).join("&"), He = ({
693
694
  id: t,
694
695
  defaultPlay: a = !1,
695
696
  mute: n = !1,
@@ -701,27 +702,27 @@ const _e = ({ block: t }) => /* @__PURE__ */ e.createElement("header", { classNa
701
702
  style: s,
702
703
  className: m
703
704
  }) => {
704
- const p = n || a ? "1" : "0", i = e.useMemo(() => Fe(E({ autoplay: "1", mute: p }, r)), [p, r]), v = `https://i.ytimg.com/vi/${t}/hqdefault.jpg`, h = "https://www.youtube-nocookie.com", d = `${h}/embed/${t}?${i}`, [w, I] = e.useState(!1), [k, S] = e.useState(a), [N, g] = e.useState(!1), y = e.useCallback(() => {
705
+ const p = n || a ? "1" : "0", i = e.useMemo(() => Fe(E({ autoplay: "1", mute: p }, r)), [p, r]), C = `https://i.ytimg.com/vi/${t}/hqdefault.jpg`, h = "https://www.youtube-nocookie.com", f = `${h}/embed/${t}?${i}`, [w, I] = e.useState(!1), [x, _] = e.useState(a), [N, g] = e.useState(!1), y = e.useCallback(() => {
705
706
  w || I(!0);
706
- }, [w]), C = e.useCallback(() => {
707
- k || S(!0);
708
- }, [k]), L = e.useCallback(() => {
707
+ }, [w]), v = e.useCallback(() => {
708
+ x || _(!0);
709
+ }, [x]), k = e.useCallback(() => {
709
710
  g(!0);
710
711
  }, []);
711
- return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("link", { rel: "preload", href: v, as: "image" }), w && /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("link", { rel: "preconnect", href: h }), /* @__PURE__ */ e.createElement("link", { rel: "preconnect", href: "https://www.google.com" })), w && l && /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("link", { rel: "preconnect", href: "https://static.doubleclick.net" }), /* @__PURE__ */ e.createElement("link", { rel: "preconnect", href: "https://googleads.g.doubleclick.net" })), /* @__PURE__ */ e.createElement(
712
+ return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("link", { rel: "preload", href: C, as: "image" }), w && /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("link", { rel: "preconnect", href: h }), /* @__PURE__ */ e.createElement("link", { rel: "preconnect", href: "https://www.google.com" })), w && l && /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("link", { rel: "preconnect", href: "https://static.doubleclick.net" }), /* @__PURE__ */ e.createElement("link", { rel: "preconnect", href: "https://googleads.g.doubleclick.net" })), /* @__PURE__ */ e.createElement(
712
713
  "div",
713
714
  {
714
- onClick: C,
715
+ onClick: v,
715
716
  onPointerOver: y,
716
717
  className: `notion-yt-lite
717
718
  ${N && "notion-yt-loaded"}
718
- ${k && "notion-yt-initialized"}
719
+ ${x && "notion-yt-initialized"}
719
720
  ${m || ""}`,
720
721
  style: s
721
722
  },
722
- /* @__PURE__ */ e.createElement("img", { src: v, className: "notion-yt-thumbnail", loading: o ? "lazy" : void 0, alt: c }),
723
+ /* @__PURE__ */ e.createElement("img", { src: C, className: "notion-yt-thumbnail", loading: o ? "lazy" : void 0, alt: c }),
723
724
  /* @__PURE__ */ e.createElement("div", { className: "notion-yt-playbtn" }),
724
- k && /* @__PURE__ */ e.createElement(
725
+ x && /* @__PURE__ */ e.createElement(
725
726
  "iframe",
726
727
  {
727
728
  width: "560",
@@ -730,8 +731,8 @@ const _e = ({ block: t }) => /* @__PURE__ */ e.createElement("header", { classNa
730
731
  allow: "accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture",
731
732
  allowFullScreen: !0,
732
733
  title: u,
733
- src: d,
734
- onLoad: L
734
+ src: f,
735
+ onLoad: k
735
736
  }
736
737
  )
737
738
  ));
@@ -749,8 +750,8 @@ const _e = ({ block: t }) => /* @__PURE__ */ e.createElement("header", { classNa
749
750
  "codepen",
750
751
  "drive"
751
752
  ], Ze = ({ block: t, zoomable: a = !0, children: n }) => {
752
- var p, i, f, v, h, d, w, I, k, S;
753
- const { recordMap: o, mapImageUrl: u, components: c } = _();
753
+ var p, i, d, C, h, f, w, I, x, _;
754
+ const { recordMap: o, mapImageUrl: u, components: c } = S();
754
755
  if (!t || !qe.includes(t.type)) return null;
755
756
  const r = {
756
757
  position: "relative",
@@ -762,9 +763,9 @@ const _e = ({ block: t }) => /* @__PURE__ */ e.createElement("header", { classNa
762
763
  flexDirection: "column"
763
764
  }, l = {};
764
765
  if (t.format) {
765
- const { block_aspect_ratio: N, block_height: g, block_width: y, block_full_width: C, block_page_width: L, block_preserve_scale: M } = t.format;
766
- if (C || L)
767
- C ? r.width = "100vw" : r.width = "100%", t.type === "video" ? g ? r.height = g : N ? r.paddingBottom = `${N * 100}%` : M && (r.objectFit = "contain") : N && t.type !== "image" ? r.paddingBottom = `${N * 100}%` : g ? r.height = g : M && (t.type === "image" ? r.height = "100%" : (r.paddingBottom = "75%", r.minHeight = 100));
766
+ const { block_aspect_ratio: N, block_height: g, block_width: y, block_full_width: v, block_page_width: k, block_preserve_scale: M } = t.format;
767
+ if (v || k)
768
+ v ? r.width = "100vw" : r.width = "100%", t.type === "video" ? g ? r.height = g : N ? r.paddingBottom = `${N * 100}%` : M && (r.objectFit = "contain") : N && t.type !== "image" ? r.paddingBottom = `${N * 100}%` : g ? r.height = g : M && (t.type === "image" ? r.height = "100%" : (r.paddingBottom = "75%", r.minHeight = 100));
768
769
  else {
769
770
  switch ((p = t.format) == null ? void 0 : p.block_alignment) {
770
771
  case "center": {
@@ -784,7 +785,7 @@ const _e = ({ block: t }) => /* @__PURE__ */ e.createElement("header", { classNa
784
785
  }
785
786
  t.type === "image" ? l.objectFit = "cover" : M && (l.objectFit = "contain");
786
787
  }
787
- let s = ((i = o.signed_urls) == null ? void 0 : i[t.id]) || ((h = (v = (f = t.properties) == null ? void 0 : f.source) == null ? void 0 : v[0]) == null ? void 0 : h[0]), m = null;
788
+ let s = ((i = o.signed_urls) == null ? void 0 : i[t.id]) || ((h = (C = (d = t.properties) == null ? void 0 : d.source) == null ? void 0 : C[0]) == null ? void 0 : h[0]), m = null;
788
789
  if (!s) return null;
789
790
  if (t.type === "tweet") {
790
791
  const N = s;
@@ -809,7 +810,7 @@ const _e = ({ block: t }) => /* @__PURE__ */ e.createElement("header", { classNa
809
810
  if (t.type === "video" && s && s.indexOf("youtube") < 0 && s.indexOf("youtu.be") < 0 && s.indexOf("vimeo") < 0 && s.indexOf("wistia") < 0 && s.indexOf("loom") < 0 && s.indexOf("videoask") < 0 && s.indexOf("getcloudapp") < 0)
810
811
  r.paddingBottom = void 0, m = /* @__PURE__ */ e.createElement("video", { playsInline: !0, controls: !0, preload: "metadata", style: l, src: s, title: t.type });
811
812
  else {
812
- let N = ((d = t.format) == null ? void 0 : d.display_source) || s;
813
+ let N = ((f = t.format) == null ? void 0 : f.display_source) || s;
813
814
  if (N) {
814
815
  const g = t.type === "video" ? ye(N) : null;
815
816
  g ? m = /* @__PURE__ */ e.createElement(He, { id: g, style: l, className: "notion-asset-object-fit" }) : t.type === "gist" ? (N.endsWith(".pibb") || (N = `${N}.pibb`), l.width = "100%", r.paddingBottom = "50%", m = /* @__PURE__ */ e.createElement(
@@ -839,20 +840,20 @@ const _e = ({ block: t }) => /* @__PURE__ */ e.createElement("header", { classNa
839
840
  }
840
841
  }
841
842
  else if (t.type === "image") {
842
- s.includes("file.notion.so") && (s = (k = (I = (w = t.properties) == null ? void 0 : w.source) == null ? void 0 : I[0]) == null ? void 0 : k[0]);
843
- const N = u(s, t), y = le((S = t.properties) == null ? void 0 : S.caption) || "notion image";
843
+ s.includes("file.notion.so") && (s = (x = (I = (w = t.properties) == null ? void 0 : w.source) == null ? void 0 : I[0]) == null ? void 0 : x[0]);
844
+ const N = u(s, t), y = le((_ = t.properties) == null ? void 0 : _.caption) || "notion image";
844
845
  m = /* @__PURE__ */ e.createElement(V, { src: N, alt: y, zoomable: a, height: r.height, style: l });
845
846
  }
846
847
  return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("div", { style: r }, m, t.type === "image" && n), t.type !== "image" && n);
847
848
  }, We = { width: "100%" }, Ae = ({ blockId: t, block: a }) => {
848
- var m, p, i, f, v, h;
849
- const n = a, { components: o, mapPageUrl: u, rootDomain: c, zoom: r } = _();
849
+ var m, p, i, d, C, h;
850
+ const n = a, { components: o, mapPageUrl: u, rootDomain: c, zoom: r } = S();
850
851
  let l = !1;
851
852
  if (a.type === "image") {
852
- const d = (i = (p = (m = n == null ? void 0 : n.properties) == null ? void 0 : m.caption) == null ? void 0 : p[0]) == null ? void 0 : i[0];
853
- if (d) {
854
- const w = R(d, { uuid: !0 });
855
- (d.charAt(0) === "/" && w || Ge(d)) && (l = !0);
853
+ const f = (i = (p = (m = n == null ? void 0 : n.properties) == null ? void 0 : m.caption) == null ? void 0 : p[0]) == null ? void 0 : i[0];
854
+ if (f) {
855
+ const w = R(f, { uuid: !0 });
856
+ (f.charAt(0) === "/" && w || Ge(f)) && (l = !0);
856
857
  }
857
858
  }
858
859
  const s = /* @__PURE__ */ e.createElement(
@@ -860,19 +861,19 @@ const _e = ({ block: t }) => /* @__PURE__ */ e.createElement("header", { classNa
860
861
  {
861
862
  className: `notion-asset-wrapper
862
863
  notion-asset-wrapper-${a.type}
863
- ${(f = n.format) != null && f.block_full_width ? "notion-asset-wrapper-full" : ""}
864
+ ${(d = n.format) != null && d.block_full_width ? "notion-asset-wrapper-full" : ""}
864
865
  ${t}`
865
866
  },
866
- /* @__PURE__ */ e.createElement(Ze, { block: n, zoomable: r && !l }, ((v = n == null ? void 0 : n.properties) == null ? void 0 : v.caption) && !l && /* @__PURE__ */ e.createElement("figcaption", { className: "notion-asset-caption" }, /* @__PURE__ */ e.createElement(D, { value: n.properties.caption, block: a })))
867
+ /* @__PURE__ */ e.createElement(Ze, { block: n, zoomable: r && !l }, ((C = n == null ? void 0 : n.properties) == null ? void 0 : C.caption) && !l && /* @__PURE__ */ e.createElement("figcaption", { className: "notion-asset-caption" }, /* @__PURE__ */ e.createElement(D, { value: n.properties.caption, block: a })))
867
868
  );
868
869
  if (l) {
869
- const d = (h = n == null ? void 0 : n.properties) == null ? void 0 : h.caption[0][0], w = R(d, { uuid: !0 }), I = d.charAt(0) === "/" && w, k = Qe(d);
870
+ const f = (h = n == null ? void 0 : n.properties) == null ? void 0 : h.caption[0][0], w = R(f, { uuid: !0 }), I = f.charAt(0) === "/" && w, x = Qe(f);
870
871
  return /* @__PURE__ */ e.createElement(
871
872
  o.PageLink,
872
873
  {
873
874
  style: We,
874
- href: I ? u(w) : d,
875
- target: k && k !== c && !d.startsWith("/") ? "blank_" : null
875
+ href: I ? u(w) : f,
876
+ target: x && x !== c && !f.startsWith("/") ? "blank_" : null
876
877
  },
877
878
  s
878
879
  );
@@ -916,6 +917,6 @@ export {
916
917
  Ie as j,
917
918
  He as k,
918
919
  Ze as l,
919
- _ as u
920
+ S as u
920
921
  };
921
- //# sourceMappingURL=asset-wrapper-CmbIDPIw.js.map
922
+ //# sourceMappingURL=asset-wrapper-CaHInqoM.js.map