@texonom/nreact 1.2.11 → 1.3.0-beta.0

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.
Files changed (64) hide show
  1. package/build/.tsbuildinfo +1 -1
  2. package/build/block.d.ts.map +1 -1
  3. package/build/chunk-2U7I3XVC.js +157 -0
  4. package/build/chunk-3R4ITV3N.js +1358 -0
  5. package/build/chunk-FCO7MUK6.js +83 -0
  6. package/build/chunk-HJGIONX2.js +1358 -0
  7. package/build/chunk-VP33CFNB.js +1358 -0
  8. package/build/components/asset-wrapper.d.ts.map +1 -1
  9. package/build/components/audio.d.ts.map +1 -1
  10. package/build/components/eoi.d.ts.map +1 -1
  11. package/build/components/file.d.ts.map +1 -1
  12. package/build/components/google-drive.d.ts.map +1 -1
  13. package/build/components/header.d.ts.map +1 -1
  14. package/build/components/lite-youtube-embed.d.ts.map +1 -1
  15. package/build/components/page-aside.d.ts.map +1 -1
  16. package/build/components/page-title.d.ts.map +1 -1
  17. package/build/components/search-dialog.d.ts.map +1 -1
  18. package/build/dev/chunk-4XJBBVRZ.js +1359 -0
  19. package/build/dev/chunk-4XJBBVRZ.js.map +1 -0
  20. package/build/dev/chunk-7R2ZX3WF.js +1359 -0
  21. package/build/dev/chunk-7R2ZX3WF.js.map +1 -0
  22. package/build/dev/chunk-N6EDMIQD.js +1359 -0
  23. package/build/dev/chunk-N6EDMIQD.js.map +1 -0
  24. package/build/dev/chunk-NVAEYUJK.js +1359 -0
  25. package/build/dev/chunk-NVAEYUJK.js.map +1 -0
  26. package/build/dev/chunk-PM5CWL6O.js +158 -0
  27. package/build/dev/chunk-PM5CWL6O.js.map +1 -0
  28. package/build/dev/chunk-Q4G2SZRD.js +84 -0
  29. package/build/dev/chunk-Q4G2SZRD.js.map +1 -0
  30. package/build/dev/chunk-QN4Z7A2J.js +1359 -0
  31. package/build/dev/chunk-QN4Z7A2J.js.map +1 -0
  32. package/build/dev/index.js +55 -70
  33. package/build/dev/index.js.map +1 -1
  34. package/build/dev/third-party/code.js +3 -4
  35. package/build/dev/third-party/code.js.map +1 -1
  36. package/build/dev/third-party/collection.js +15 -18
  37. package/build/dev/third-party/collection.js.map +1 -1
  38. package/build/dev/third-party/equation.js +3 -4
  39. package/build/dev/third-party/equation.js.map +1 -1
  40. package/build/dev/third-party/modal.js +1 -1
  41. package/build/dev/third-party/pdf.js +1 -1
  42. package/build/dev/third-party/pdf.js.map +1 -1
  43. package/build/icons/clear-icon.d.ts.map +1 -1
  44. package/build/icons/loading-icon.d.ts.map +1 -1
  45. package/build/icons/search-icon.d.ts.map +1 -1
  46. package/build/index.js +55 -70
  47. package/build/third-party/code.d.ts.map +1 -1
  48. package/build/third-party/code.js +3 -4
  49. package/build/third-party/collection-card.d.ts.map +1 -1
  50. package/build/third-party/collection-row.d.ts.map +1 -1
  51. package/build/third-party/collection-view-board.d.ts.map +1 -1
  52. package/build/third-party/collection-view-gallery.d.ts.map +1 -1
  53. package/build/third-party/collection-view-table.d.ts.map +1 -1
  54. package/build/third-party/collection.d.ts.map +1 -1
  55. package/build/third-party/collection.js +15 -18
  56. package/build/third-party/equation.d.ts.map +1 -1
  57. package/build/third-party/equation.js +3 -4
  58. package/build/third-party/modal.js +1 -1
  59. package/build/third-party/pdf.js +1 -1
  60. package/build/types.d.ts +34 -12
  61. package/build/types.d.ts.map +1 -1
  62. package/build/utils.d.ts +0 -1
  63. package/build/utils.d.ts.map +1 -1
  64. package/package.json +10 -10
@@ -2,7 +2,7 @@ import {
2
2
  CollectionColumnTitle,
3
3
  PropertyIcon,
4
4
  iconMap
5
- } from "./chunk-CWNFRR32.js";
5
+ } from "./chunk-PM5CWL6O.js";
6
6
  import {
7
7
  Asset,
8
8
  AssetWrapper,
@@ -22,7 +22,6 @@ import {
22
22
  Search,
23
23
  SearchDialog,
24
24
  Text,
25
- cs,
26
25
  dummyLink,
27
26
  formatDate,
28
27
  formatNotionDateTime,
@@ -33,13 +32,13 @@ import {
33
32
  isUrl,
34
33
  require_lodash,
35
34
  useNotionContext
36
- } from "./chunk-VHTSGS2P.js";
35
+ } from "./chunk-N6EDMIQD.js";
37
36
  import {
38
37
  __objRest,
39
38
  __spreadProps,
40
39
  __spreadValues,
41
40
  __toESM
42
- } from "./chunk-JX5CEG3A.js";
41
+ } from "./chunk-Q4G2SZRD.js";
43
42
 
44
43
  // src/renderer.tsx
45
44
  import React9 from "react";
@@ -62,7 +61,7 @@ var Audio = ({ block, className }) => {
62
61
  var _a, _b, _c;
63
62
  const { recordMap } = useNotionContext();
64
63
  const source = recordMap.signed_urls[block.id] || ((_c = (_b = (_a = block.properties) == null ? void 0 : _a.source) == null ? void 0 : _b[0]) == null ? void 0 : _c[0]);
65
- return /* @__PURE__ */ React.createElement("div", { className: cs("notion-audio", className) }, /* @__PURE__ */ React.createElement("audio", { controls: true, preload: "none", src: source }));
64
+ return /* @__PURE__ */ React.createElement("div", { className: `notion-audio ${className || ""}` }, /* @__PURE__ */ React.createElement("audio", { controls: true, preload: "none", src: source }));
66
65
  };
67
66
 
68
67
  // src/components/file.tsx
@@ -80,7 +79,7 @@ var File = ({ block, className }) => {
80
79
  var _a, _b, _c, _d, _e;
81
80
  const { components, recordMap } = useNotionContext();
82
81
  const source = recordMap.signed_urls[block.id] || ((_c = (_b = (_a = block.properties) == null ? void 0 : _a.source) == null ? void 0 : _b[0]) == null ? void 0 : _c[0]);
83
- return /* @__PURE__ */ React3.createElement("div", { className: cs("notion-file", className) }, /* @__PURE__ */ React3.createElement(components.Link, { className: "notion-file-link", href: source, target: "_blank", rel: "noopener noreferrer" }, /* @__PURE__ */ React3.createElement(FileIcon, { className: "notion-file-icon" }), /* @__PURE__ */ React3.createElement("div", { className: "notion-file-info" }, /* @__PURE__ */ React3.createElement("div", { className: "notion-file-title" }, /* @__PURE__ */ React3.createElement(Text, { value: ((_d = block.properties) == null ? void 0 : _d.title) || [["File"]], block })), ((_e = block.properties) == null ? void 0 : _e.size) && /* @__PURE__ */ React3.createElement("div", { className: "notion-file-size" }, /* @__PURE__ */ React3.createElement(Text, { value: block.properties.size, block })))));
82
+ return /* @__PURE__ */ React3.createElement("div", { className: `notion-file ${className || ""}` }, /* @__PURE__ */ React3.createElement(components.Link, { className: "notion-file-link", href: source, target: "_blank", rel: "noopener noreferrer" }, /* @__PURE__ */ React3.createElement(FileIcon, { className: "notion-file-icon" }), /* @__PURE__ */ React3.createElement("div", { className: "notion-file-info" }, /* @__PURE__ */ React3.createElement("div", { className: "notion-file-title" }, /* @__PURE__ */ React3.createElement(Text, { value: ((_d = block.properties) == null ? void 0 : _d.title) || [["File"]], block })), ((_e = block.properties) == null ? void 0 : _e.size) && /* @__PURE__ */ React3.createElement("div", { className: "notion-file-size" }, /* @__PURE__ */ React3.createElement(Text, { value: block.properties.size, block })))));
84
83
  };
85
84
 
86
85
  // src/components/google-drive.tsx
@@ -97,7 +96,7 @@ var GoogleDrive = ({ block, className }) => {
97
96
  domain = url.hostname;
98
97
  } catch (err) {
99
98
  }
100
- return /* @__PURE__ */ React4.createElement("div", { className: cs("notion-google-drive", className) }, /* @__PURE__ */ React4.createElement(components.Link, { className: "notion-google-drive-link", href: properties.url, target: "_blank", rel: "noopener noreferrer" }, /* @__PURE__ */ React4.createElement("div", { className: "notion-google-drive-preview" }, /* @__PURE__ */ React4.createElement(
99
+ return /* @__PURE__ */ React4.createElement("div", { className: `notion-google-drive ${className || ""}` }, /* @__PURE__ */ React4.createElement(components.Link, { className: "notion-google-drive-link", href: properties.url, target: "_blank", rel: "noopener noreferrer" }, /* @__PURE__ */ React4.createElement("div", { className: "notion-google-drive-preview" }, /* @__PURE__ */ React4.createElement(
101
100
  GracefulImage,
102
101
  {
103
102
  src: mapImageUrl(properties.thumbnail, block),
@@ -161,18 +160,16 @@ var PageAside = ({ toc, activeSection, setActiveSection, pageAside, hasToc, hasA
161
160
  }, [hasToc, actionSectionScrollSpy]);
162
161
  if (!hasAside)
163
162
  return null;
164
- return /* @__PURE__ */ React5.createElement("aside", { className: cs("notion-aside", className) }, hasToc && /* @__PURE__ */ React5.createElement("div", { className: "notion-aside-table-of-contents" }, /* @__PURE__ */ React5.createElement("div", { className: "notion-aside-table-of-contents-header" }, "Table of Contents"), /* @__PURE__ */ React5.createElement("nav", { className: "notion-table-of-contents" }, toc.map((tocItem) => {
163
+ return /* @__PURE__ */ React5.createElement("aside", { className: `notion-aside ${className || ""}` }, hasToc && /* @__PURE__ */ React5.createElement("div", { className: "notion-aside-table-of-contents" }, /* @__PURE__ */ React5.createElement("div", { className: "notion-aside-table-of-contents-header" }, "Table of Contents"), /* @__PURE__ */ React5.createElement("nav", { className: "notion-table-of-contents" }, toc.map((tocItem) => {
165
164
  const id = uuidToId(tocItem.id);
166
165
  return /* @__PURE__ */ React5.createElement(
167
166
  "a",
168
167
  {
169
168
  key: id,
170
169
  href: `#${id}`,
171
- className: cs(
172
- "notion-table-of-contents-item",
173
- `notion-table-of-contents-item-indent-level-${tocItem.indentLevel}`,
174
- activeSection === id && "notion-table-of-contents-active-item"
175
- )
170
+ className: `notion-table-of-contents-item
171
+ notion-table-of-contents-item-indent-level-${tocItem.indentLevel}
172
+ ${activeSection === id && "notion-table-of-contents-active-item"}`
176
173
  },
177
174
  /* @__PURE__ */ React5.createElement(
178
175
  "span",
@@ -227,7 +224,6 @@ var Block = (props) => {
227
224
  const {
228
225
  components,
229
226
  fullPage,
230
- darkMode,
231
227
  recordMap,
232
228
  mapPageUrl,
233
229
  mapImageUrl,
@@ -257,8 +253,8 @@ var Block = (props) => {
257
253
  if (!block)
258
254
  return null;
259
255
  if (level === 0 && block.type === "collection_view") {
260
- ;
261
- block.type = "collection_view_page";
256
+ const view_block = block;
257
+ view_block.type = "collection_view_page";
262
258
  }
263
259
  const blockId = hideBlockId ? "notion-block" : `notion-block-${uuidToId2(block.id)}`;
264
260
  switch (block.type) {
@@ -289,7 +285,7 @@ var Block = (props) => {
289
285
  const hasToc = showTableOfContents && toc.length >= minTableOfContentsItems;
290
286
  const hasAside = (hasToc || pageAside) && !page_full_width;
291
287
  const hasPageCover = pageCover || page_cover;
292
- return /* @__PURE__ */ React8.createElement("div", { className: cs("notion", "notion-app", darkMode ? "dark" : "light", blockId, className) }, /* @__PURE__ */ React8.createElement("div", { className: "notion-viewport" }), /* @__PURE__ */ React8.createElement("div", { className: "notion-frame" }, !disableHeader && /* @__PURE__ */ React8.createElement(components.Header, { block }), header, /* @__PURE__ */ React8.createElement("div", { className: "notion-page-scroller" }, hasPageCover && (pageCover ? pageCover : /* @__PURE__ */ React8.createElement("div", { className: "notion-page-cover-wrapper" }, /* @__PURE__ */ React8.createElement(
288
+ return /* @__PURE__ */ React8.createElement("div", { className: `notion notion-app ${blockId} ${className || ""}` }, /* @__PURE__ */ React8.createElement("div", { className: "notion-viewport" }), /* @__PURE__ */ React8.createElement("div", { className: "notion-frame" }, !disableHeader && /* @__PURE__ */ React8.createElement(components.Header, { block }), header, /* @__PURE__ */ React8.createElement("div", { className: "notion-page-scroller" }, hasPageCover && (pageCover ? pageCover : /* @__PURE__ */ React8.createElement("div", { className: "notion-page-cover-wrapper" }, /* @__PURE__ */ React8.createElement(
293
289
  LazyImage,
294
290
  {
295
291
  src: mapImageUrl(page_cover, block),
@@ -301,16 +297,14 @@ var Block = (props) => {
301
297
  ))), /* @__PURE__ */ React8.createElement(
302
298
  "main",
303
299
  {
304
- className: cs(
305
- "notion-page",
306
- hasPageCover ? "notion-page-has-cover" : "notion-page-no-cover",
307
- page_icon ? "notion-page-has-icon" : "notion-page-no-icon",
308
- isPageIconUrl ? "notion-page-has-image-icon" : "notion-page-has-text-icon",
309
- "notion-full-page",
310
- page_full_width && "notion-full-width",
311
- page_small_text && "notion-small-text",
312
- bodyClassName
313
- )
300
+ className: `notion-page
301
+ ${hasPageCover ? "notion-page-has-cover" : "notion-page-no-cover"}
302
+ ${page_icon ? "notion-page-has-icon" : "notion-page-no-icon"}
303
+ ${isPageIconUrl ? "notion-page-has-image-icon" : "notion-page-has-text-icon"}
304
+ notion-full-page
305
+ ${page_full_width && "notion-full-width"}
306
+ ${page_small_text && "notion-small-text"}
307
+ ${bodyClassName}`
314
308
  },
315
309
  page_icon && /* @__PURE__ */ React8.createElement(PageIcon, { block, defaultIcon: defaultPageIcon, inline: false }),
316
310
  pageHeader,
@@ -319,11 +313,9 @@ var Block = (props) => {
319
313
  block.type !== "collection_view_page" && /* @__PURE__ */ React8.createElement(
320
314
  "div",
321
315
  {
322
- className: cs(
323
- "notion-page-content",
324
- hasAside && "notion-page-content-has-aside",
325
- hasToc && "notion-page-content-has-toc"
326
- )
316
+ className: `notion-page-content
317
+ ${hasAside && "notion-page-content-has-aside"}
318
+ ${hasToc && "notion-page-content-has-toc"}`
327
319
  },
328
320
  /* @__PURE__ */ React8.createElement("article", { className: "notion-page-content-inner" }, children),
329
321
  hasAside && /* @__PURE__ */ React8.createElement(
@@ -344,16 +336,13 @@ var Block = (props) => {
344
336
  return /* @__PURE__ */ React8.createElement(
345
337
  "main",
346
338
  {
347
- className: cs(
348
- "notion",
349
- darkMode ? "dark" : "light",
350
- "notion-page",
351
- page_full_width && "notion-full-width",
352
- page_small_text && "notion-small-text",
353
- blockId,
354
- className,
355
- bodyClassName
356
- )
339
+ className: `notion
340
+ notion-page
341
+ ${page_full_width && "notion-full-width"}
342
+ ${page_small_text && "notion-small-text"}
343
+ ${blockId}
344
+ ${className || ""}
345
+ ${bodyClassName}`
357
346
  },
358
347
  /* @__PURE__ */ React8.createElement("div", { className: "notion-viewport" }),
359
348
  pageHeader,
@@ -367,7 +356,7 @@ var Block = (props) => {
367
356
  return /* @__PURE__ */ React8.createElement(
368
357
  components.PageLink,
369
358
  {
370
- className: cs("notion-page-link", blockColor && `notion-${blockColor}`, blockId),
359
+ className: `notion-page-link ${blockColor && `notion-${blockColor}`} ${blockId}`,
371
360
  href: mapPageUrl(block.id)
372
361
  },
373
362
  /* @__PURE__ */ React8.createElement(PageTitle, { block })
@@ -399,14 +388,12 @@ var Block = (props) => {
399
388
  const isH1 = block.type === "header";
400
389
  const isH2 = block.type === "sub_header";
401
390
  const isH3 = block.type === "sub_sub_header";
402
- const classNameStr = cs(
403
- isH1 && "notion-h notion-h1",
404
- isH2 && "notion-h notion-h2",
405
- isH3 && "notion-h notion-h3",
406
- blockColor && `notion-${blockColor}`,
407
- indentLevelClass,
408
- blockId
409
- );
391
+ const classNameStr = `${isH1 && "notion-h notion-h1"}
392
+ ${isH2 && "notion-h notion-h2"}
393
+ ${isH3 && "notion-h notion-h3"}
394
+ ${blockColor && `notion-${blockColor}`}
395
+ ${indentLevelClass},
396
+ ${blockId}`;
410
397
  const innerHeader = /* @__PURE__ */ React8.createElement("span", null, /* @__PURE__ */ React8.createElement("div", { id, className: "notion-header-anchor" }), !((_f = block.format) == null ? void 0 : _f.toggleable) && /* @__PURE__ */ React8.createElement("a", { className: "notion-hash-link", href: `#${id}`, title }, /* @__PURE__ */ React8.createElement(LinkIcon, null)), /* @__PURE__ */ React8.createElement("span", { className: "notion-h-title" }, /* @__PURE__ */ React8.createElement(Text, { value: block.properties.title, block })));
411
398
  let headerBlock = null;
412
399
  if (isH1)
@@ -416,21 +403,21 @@ var Block = (props) => {
416
403
  else
417
404
  headerBlock = /* @__PURE__ */ React8.createElement("h4", { className: classNameStr, "data-id": id }, innerHeader);
418
405
  if ((_g = block.format) == null ? void 0 : _g.toggleable)
419
- return /* @__PURE__ */ React8.createElement("details", { className: cs("notion-toggle", blockId) }, /* @__PURE__ */ React8.createElement("summary", null, headerBlock), /* @__PURE__ */ React8.createElement("div", null, children));
406
+ return /* @__PURE__ */ React8.createElement("details", { className: `notion-toggle ${blockId}` }, /* @__PURE__ */ React8.createElement("summary", null, headerBlock), /* @__PURE__ */ React8.createElement("div", null, children));
420
407
  else
421
408
  return headerBlock;
422
409
  }
423
410
  case "divider":
424
- return /* @__PURE__ */ React8.createElement("hr", { className: cs("notion-hr", blockId) });
411
+ return /* @__PURE__ */ React8.createElement("hr", { className: `notion-hr ${blockId}` });
425
412
  case "text": {
426
413
  if (!block.properties && !((_h = block.content) == null ? void 0 : _h.length))
427
- return /* @__PURE__ */ React8.createElement("div", { className: cs("notion-blank", blockId) }, "\xA0");
414
+ return /* @__PURE__ */ React8.createElement("div", { className: `notion-blank ${blockId}` }, "\xA0");
428
415
  const blockColor = (_i = block.format) == null ? void 0 : _i.block_color;
429
- return /* @__PURE__ */ React8.createElement("div", { className: cs("notion-text", blockColor && `notion-${blockColor}`, blockId) }, ((_j = block.properties) == null ? void 0 : _j.title) && /* @__PURE__ */ React8.createElement(Text, { value: block.properties.title, block }), children && /* @__PURE__ */ React8.createElement("div", { className: "notion-text-children" }, children));
416
+ return /* @__PURE__ */ React8.createElement("div", { className: `notion-text ${blockColor && `notion-${blockColor}`} ${blockId}` }, ((_j = block.properties) == null ? void 0 : _j.title) && /* @__PURE__ */ React8.createElement(Text, { value: block.properties.title, block }), children && /* @__PURE__ */ React8.createElement("div", { className: "notion-text-children" }, children));
430
417
  }
431
418
  case "bulleted_list":
432
419
  case "numbered_list": {
433
- const wrapList = (content, start2) => block.type === "bulleted_list" ? /* @__PURE__ */ React8.createElement("ul", { className: cs("notion-list", "notion-list-disc", blockId) }, content) : /* @__PURE__ */ React8.createElement("ol", { start: start2, className: cs("notion-list", "notion-list-numbered", blockId) }, content);
420
+ const wrapList = (content, start2) => block.type === "bulleted_list" ? /* @__PURE__ */ React8.createElement("ul", { className: `notion-list notion-list-disc ${blockId}` }, content) : /* @__PURE__ */ React8.createElement("ol", { start: start2, className: `notion-list notion-list-numbered ${blockId}` }, content);
434
421
  let output = null;
435
422
  if (block.content)
436
423
  output = /* @__PURE__ */ React8.createElement(React8.Fragment, null, block.properties && /* @__PURE__ */ React8.createElement("li", null, /* @__PURE__ */ React8.createElement(Text, { value: block.properties.title, block })), wrapList(children));
@@ -470,7 +457,7 @@ var Block = (props) => {
470
457
  case "code":
471
458
  return /* @__PURE__ */ React8.createElement(components.Code, { block });
472
459
  case "column_list":
473
- return /* @__PURE__ */ React8.createElement("div", { className: cs("notion-row", blockId) }, children);
460
+ return /* @__PURE__ */ React8.createElement("div", { className: `notion-row ${blockId}` }, children);
474
461
  case "column": {
475
462
  const spacerWidth = `min(32px, 4vw)`;
476
463
  const ratio = ((_o = block.format) == null ? void 0 : _o.column_ratio) || 0.5;
@@ -478,13 +465,13 @@ var Block = (props) => {
478
465
  const columns = ((_q = parent == null ? void 0 : parent.content) == null ? void 0 : _q.length) || Math.max(2, Math.ceil(1 / ratio));
479
466
  const width = `calc((100% - (${columns - 1} * ${spacerWidth})) * ${ratio})`;
480
467
  const style = { width };
481
- return /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement("div", { className: cs("notion-column", blockId), style }, children), /* @__PURE__ */ React8.createElement("div", { className: "notion-spacer" }));
468
+ return /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement("div", { className: `notion-column ${blockId}`, style }, children), /* @__PURE__ */ React8.createElement("div", { className: "notion-spacer" }));
482
469
  }
483
470
  case "quote": {
484
471
  if (!block.properties)
485
472
  return null;
486
473
  const blockColor = (_r = block.format) == null ? void 0 : _r.block_color;
487
- return /* @__PURE__ */ React8.createElement("blockquote", { className: cs("notion-quote", blockColor && `notion-${blockColor}`, blockId) }, /* @__PURE__ */ React8.createElement("div", null, /* @__PURE__ */ React8.createElement(Text, { value: block.properties.title, block })), children);
474
+ return /* @__PURE__ */ React8.createElement("blockquote", { className: `notion-quote ${blockColor && `notion-${blockColor}`} ${blockId}` }, /* @__PURE__ */ React8.createElement("div", null, /* @__PURE__ */ React8.createElement(Text, { value: block.properties.title, block })), children);
488
475
  }
489
476
  case "collection_view":
490
477
  return /* @__PURE__ */ React8.createElement(components.Collection, { block, className: blockId, ctx });
@@ -495,7 +482,7 @@ var Block = (props) => {
495
482
  return /* @__PURE__ */ React8.createElement(
496
483
  "div",
497
484
  {
498
- className: cs("notion-callout", ((_s = block.format) == null ? void 0 : _s.block_color) && `notion-${(_t = block.format) == null ? void 0 : _t.block_color}_co`, blockId)
485
+ className: `notion-callout ${((_s = block.format) == null ? void 0 : _s.block_color) && `notion-${(_t = block.format) == null ? void 0 : _t.block_color}_co`} ${blockId}`
499
486
  },
500
487
  /* @__PURE__ */ React8.createElement(PageIcon, { block }),
501
488
  /* @__PURE__ */ React8.createElement("div", { className: "notion-callout-text" }, /* @__PURE__ */ React8.createElement(Text, { value: (_u = block.properties) == null ? void 0 : _u.title, block }), children)
@@ -522,7 +509,7 @@ var Block = (props) => {
522
509
  {
523
510
  target: "_blank",
524
511
  rel: "noopener noreferrer",
525
- className: cs("notion-bookmark", ((_w = block.format) == null ? void 0 : _w.block_color) && `notion-${block.format.block_color}`, blockId),
512
+ className: `notion-bookmark ${((_w = block.format) == null ? void 0 : _w.block_color) && `notion-${block.format.block_color}`} ${blockId}`,
526
513
  href: link[0][0]
527
514
  },
528
515
  /* @__PURE__ */ React8.createElement("div", null, title && /* @__PURE__ */ React8.createElement("div", { className: "notion-bookmark-title" }, /* @__PURE__ */ React8.createElement(Text, { value: [[title]], block })), ((_x = block.properties) == null ? void 0 : _x.description) && /* @__PURE__ */ React8.createElement("div", { className: "notion-bookmark-description" }, /* @__PURE__ */ React8.createElement(Text, { value: (_y = block.properties) == null ? void 0 : _y.description, block })), /* @__PURE__ */ React8.createElement("div", { className: "notion-bookmark-link" }, ((_z = block.format) == null ? void 0 : _z.bookmark_icon) && /* @__PURE__ */ React8.createElement("div", { className: "notion-bookmark-link-icon" }, /* @__PURE__ */ React8.createElement(LazyImage, { src: mapImageUrl((_A = block.format) == null ? void 0 : _A.bookmark_icon, block), alt: title })), /* @__PURE__ */ React8.createElement("div", { className: "notion-bookmark-link-text" }, /* @__PURE__ */ React8.createElement(Text, { value: link, block })))),
@@ -539,14 +526,14 @@ var Block = (props) => {
539
526
  ));
540
527
  }
541
528
  case "toggle":
542
- return /* @__PURE__ */ React8.createElement("details", { className: cs("notion-toggle", blockId) }, /* @__PURE__ */ React8.createElement("summary", null, /* @__PURE__ */ React8.createElement(Text, { value: (_E = block.properties) == null ? void 0 : _E.title, block })), /* @__PURE__ */ React8.createElement("div", null, children));
529
+ return /* @__PURE__ */ React8.createElement("details", { className: `notion-toggle ${blockId}` }, /* @__PURE__ */ React8.createElement("summary", null, /* @__PURE__ */ React8.createElement(Text, { value: (_E = block.properties) == null ? void 0 : _E.title, block })), /* @__PURE__ */ React8.createElement("div", null, children));
543
530
  case "table_of_contents": {
544
531
  const page = getBlockParentPage(block, recordMap);
545
532
  if (!page)
546
533
  return null;
547
534
  const toc = getPageTableOfContents(page, recordMap);
548
535
  const blockColor = (_F = block.format) == null ? void 0 : _F.block_color;
549
- return /* @__PURE__ */ React8.createElement("div", { className: cs("notion-table-of-contents", blockColor && `notion-${blockColor}`, blockId) }, toc.map((tocItem) => /* @__PURE__ */ React8.createElement("a", { key: tocItem.id, href: `#${uuidToId2(tocItem.id)}`, className: "notion-table-of-contents-item" }, /* @__PURE__ */ React8.createElement(
536
+ return /* @__PURE__ */ React8.createElement("div", { className: `notion-table-of-contents ${blockColor && `notion-${blockColor}`} ${blockId}` }, toc.map((tocItem) => /* @__PURE__ */ React8.createElement("a", { key: tocItem.id, href: `#${uuidToId2(tocItem.id)}`, className: "notion-table-of-contents-item" }, /* @__PURE__ */ React8.createElement(
550
537
  "span",
551
538
  {
552
539
  className: "notion-table-of-contents-item-body",
@@ -560,10 +547,10 @@ var Block = (props) => {
560
547
  }
561
548
  case "to_do": {
562
549
  const isChecked = ((_I = (_H = (_G = block.properties) == null ? void 0 : _G.checked) == null ? void 0 : _H[0]) == null ? void 0 : _I[0]) === "Yes";
563
- return /* @__PURE__ */ React8.createElement("div", { className: cs("notion-to-do", blockId) }, /* @__PURE__ */ React8.createElement("div", { className: "notion-to-do-item" }, /* @__PURE__ */ React8.createElement(components.Checkbox, { blockId, isChecked }), /* @__PURE__ */ React8.createElement("div", { className: cs("notion-to-do-body", isChecked && `notion-to-do-checked`) }, /* @__PURE__ */ React8.createElement(Text, { value: (_J = block.properties) == null ? void 0 : _J.title, block }))), /* @__PURE__ */ React8.createElement("div", { className: "notion-to-do-children" }, children));
550
+ return /* @__PURE__ */ React8.createElement("div", { className: `notion-to-do ${blockId}` }, /* @__PURE__ */ React8.createElement("div", { className: "notion-to-do-item" }, /* @__PURE__ */ React8.createElement(components.Checkbox, { blockId, isChecked }), /* @__PURE__ */ React8.createElement("div", { className: `notion-to-do-body ${isChecked && `notion-to-do-checked`}` }, /* @__PURE__ */ React8.createElement(Text, { value: (_J = block.properties) == null ? void 0 : _J.title, block }))), /* @__PURE__ */ React8.createElement("div", { className: "notion-to-do-children" }, children));
564
551
  }
565
552
  case "transclusion_container":
566
- return /* @__PURE__ */ React8.createElement("div", { className: cs("notion-sync-block", blockId) }, children);
553
+ return /* @__PURE__ */ React8.createElement("div", { className: `notion-sync-block ${blockId}` }, children);
567
554
  case "transclusion_reference":
568
555
  return /* @__PURE__ */ React8.createElement(SyncPointerBlock, __spreadValues({ block, level: level + 1 }, props));
569
556
  case "alias": {
@@ -573,10 +560,10 @@ var Block = (props) => {
573
560
  console.debug('"alias" missing block', blockPointerId);
574
561
  return null;
575
562
  }
576
- return /* @__PURE__ */ React8.createElement(components.PageLink, { className: cs("notion-page-link", blockPointerId), href: mapPageUrl(blockPointerId) }, /* @__PURE__ */ React8.createElement(PageTitle, { block: linkedBlock }));
563
+ return /* @__PURE__ */ React8.createElement(components.PageLink, { className: `notion-page-link ${blockPointerId}}`, href: mapPageUrl(blockPointerId) }, /* @__PURE__ */ React8.createElement(PageTitle, { block: linkedBlock }));
577
564
  }
578
565
  case "table":
579
- return /* @__PURE__ */ React8.createElement("table", { className: cs("notion-simple-table", blockId) }, /* @__PURE__ */ React8.createElement("tbody", null, children));
566
+ return /* @__PURE__ */ React8.createElement("table", { className: `notion-simple-table ${blockId}` }, /* @__PURE__ */ React8.createElement("tbody", null, children));
580
567
  case "table_row": {
581
568
  const tableBlock = (_N = recordMap.block[block.parent_id]) == null ? void 0 : _N.value;
582
569
  const order = (_O = tableBlock.format) == null ? void 0 : _O.table_block_column_order;
@@ -584,7 +571,7 @@ var Block = (props) => {
584
571
  const backgroundColor = (_Q = block.format) == null ? void 0 : _Q.block_color;
585
572
  if (!tableBlock || !order)
586
573
  return null;
587
- return /* @__PURE__ */ React8.createElement("tr", { className: cs("notion-simple-table-row", backgroundColor && `notion-${backgroundColor}`, blockId) }, order.map((column) => {
574
+ return /* @__PURE__ */ React8.createElement("tr", { className: `notion-simple-table-row ${backgroundColor && `notion-${backgroundColor}`} ${blockId}` }, order.map((column) => {
588
575
  var _a2, _b2, _c2;
589
576
  const color = (_a2 = formatMap == null ? void 0 : formatMap[column]) == null ? void 0 : _a2.color;
590
577
  return /* @__PURE__ */ React8.createElement(
@@ -607,7 +594,6 @@ var Block = (props) => {
607
594
  console.debug("Unsupported type " + block.type, JSON.stringify(block, null, 2));
608
595
  return /* @__PURE__ */ React8.createElement("div", null);
609
596
  }
610
- return null;
611
597
  };
612
598
 
613
599
  // src/renderer.tsx
@@ -752,7 +738,6 @@ export {
752
738
  SearchDialog,
753
739
  SyncPointerBlock,
754
740
  Text,
755
- cs,
756
741
  dummyLink,
757
742
  formatDate,
758
743
  formatNotionDateTime,