@texonom/nreact 1.3.1 → 1.4.1
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/.tsbuildinfo +1 -1
- package/build/{chunk-HJGIONX2.js → chunk-72RHNPWF.js} +56 -107
- package/build/{chunk-LB5ZQ7L5.js → chunk-P7HX4BAT.js} +2 -3
- package/build/dev/{chunk-NVAEYUJK.js → chunk-64UJZ76E.js} +57 -108
- package/build/dev/{chunk-NVAEYUJK.js.map → chunk-64UJZ76E.js.map} +1 -1
- package/build/dev/{chunk-CWNFRR32.js → chunk-ABDRHJEI.js} +3 -4
- package/build/dev/{chunk-CWNFRR32.js.map → chunk-ABDRHJEI.js.map} +1 -1
- package/build/dev/{chunk-JX5CEG3A.js → chunk-OAIRL2FN.js} +1 -1
- package/build/dev/{chunk-4XJBBVRZ.js → chunk-SEA7YL2O.js} +57 -108
- package/build/dev/chunk-SEA7YL2O.js.map +1 -0
- package/build/dev/index.js +42 -55
- package/build/dev/index.js.map +1 -1
- package/build/dev/third-party/code.js +3 -4
- package/build/dev/third-party/code.js.map +1 -1
- package/build/dev/third-party/collection.js +137 -113
- package/build/dev/third-party/collection.js.map +1 -1
- package/build/dev/third-party/equation.js +3 -4
- package/build/dev/third-party/equation.js.map +1 -1
- package/build/dev/third-party/modal.js +1 -1
- package/build/dev/third-party/pdf.js +1 -1
- package/build/index.js +42 -55
- package/build/next.d.ts.map +1 -1
- package/build/third-party/code.js +3 -4
- package/build/third-party/collection.js +137 -113
- package/build/third-party/equation.js +3 -4
- package/build/third-party/modal.js +1 -1
- package/build/third-party/pdf.js +1 -1
- package/build/utils.d.ts.map +1 -1
- package/package.json +12 -12
- package/build/chunk-26XPY26R.js +0 -1364
- package/build/chunk-3GUXT4PT.js +0 -1386
- package/build/chunk-3R4ITV3N.js +0 -1358
- package/build/chunk-626ANHMX.js +0 -4519
- package/build/chunk-BYOAK6PN.js +0 -1362
- package/build/chunk-E7SOYYOP.js +0 -1364
- package/build/chunk-GDUEQGYI.js +0 -1373
- package/build/chunk-INDII3MG.js +0 -1346
- package/build/chunk-LAZZ76RR.js +0 -142
- package/build/chunk-NH6F5YHO.js +0 -90
- package/build/chunk-THLNCQWF.js +0 -1364
- package/build/chunk-YEVPS76Z.js +0 -1355
- package/build/dev/chunk-2LHADYU7.js +0 -1365
- package/build/dev/chunk-2LHADYU7.js.map +0 -1
- package/build/dev/chunk-4XJBBVRZ.js.map +0 -1
- package/build/dev/chunk-5DDQTDIS.js +0 -1365
- package/build/dev/chunk-5DDQTDIS.js.map +0 -1
- package/build/dev/chunk-73CYHEZ6.js +0 -1374
- package/build/dev/chunk-73CYHEZ6.js.map +0 -1
- package/build/dev/chunk-7R2ZX3WF.js +0 -1359
- package/build/dev/chunk-7R2ZX3WF.js.map +0 -1
- package/build/dev/chunk-CRSVOVI5.js +0 -1387
- package/build/dev/chunk-CRSVOVI5.js.map +0 -1
- package/build/dev/chunk-EDEWD2W7.js +0 -1363
- package/build/dev/chunk-EDEWD2W7.js.map +0 -1
- package/build/dev/chunk-O5ZUWUSN.js +0 -158
- package/build/dev/chunk-O5ZUWUSN.js.map +0 -1
- package/build/dev/chunk-QAD7OWKG.js +0 -91
- package/build/dev/chunk-QAD7OWKG.js.map +0 -1
- package/build/dev/chunk-QHYYIFZL.js +0 -1365
- package/build/dev/chunk-QHYYIFZL.js.map +0 -1
- package/build/dev/chunk-QN4Z7A2J.js +0 -1359
- package/build/dev/chunk-QN4Z7A2J.js.map +0 -1
- package/build/dev/chunk-RO7JTBZN.js +0 -1356
- package/build/dev/chunk-RO7JTBZN.js.map +0 -1
- package/build/dev/chunk-UE6LH4B3.js +0 -1347
- package/build/dev/chunk-UE6LH4B3.js.map +0 -1
- package/build/dev/chunk-VHTSGS2P.js +0 -1365
- package/build/dev/chunk-VHTSGS2P.js.map +0 -1
- package/build/dev/chunk-VZCA75U7.js +0 -143
- package/build/dev/chunk-VZCA75U7.js.map +0 -1
- package/build/dev/chunk-XJQFUGEP.js +0 -4520
- package/build/dev/chunk-XJQFUGEP.js.map +0 -1
- package/build/map-image-url.d.ts +0 -3
- package/build/map-image-url.d.ts.map +0 -1
- package/build/map-page-url.d.ts +0 -2
- package/build/map-page-url.d.ts.map +0 -1
- /package/build/{chunk-723T62SD.js → chunk-C6BUIPAM.js} +0 -0
- /package/build/dev/{chunk-JX5CEG3A.js.map → chunk-OAIRL2FN.js.map} +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useNotionContext
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-SEA7YL2O.js";
|
|
4
4
|
import {
|
|
5
5
|
__objRest,
|
|
6
6
|
__spreadValues
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-OAIRL2FN.js";
|
|
8
8
|
|
|
9
9
|
// src/third-party/equation.tsx
|
|
10
10
|
import React from "react";
|
|
@@ -18,8 +18,7 @@ var Equation = (_a) => {
|
|
|
18
18
|
var _b = _a, { block, math, inline = false, className } = _b, rest = __objRest(_b, ["block", "math", "inline", "className"]);
|
|
19
19
|
const { recordMap } = useNotionContext();
|
|
20
20
|
math = math || getBlockTitle(block, recordMap);
|
|
21
|
-
if (!math)
|
|
22
|
-
return null;
|
|
21
|
+
if (!math) return null;
|
|
23
22
|
return /* @__PURE__ */ React.createElement(
|
|
24
23
|
"span",
|
|
25
24
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/third-party/equation.tsx"],"sourcesContent":["import React from 'react'\n\nimport Katex from '@matejmazur/react-katex'\nimport { EquationBlock } from '@texonom/ntypes'\nimport { getBlockTitle } from '@texonom/nutils'\n\nimport { useNotionContext } from '../context'\n\nconst katexSettings = {\n throwOnError: false,\n strict: false\n}\n\nexport const Equation: React.FC<{\n block: EquationBlock\n math?: string\n inline?: boolean\n className?: string\n}> = ({ block, math, inline = false, className, ...rest }) => {\n const { recordMap } = useNotionContext()\n math = math || getBlockTitle(block, recordMap)\n if (!math) return null\n\n return (\n <span\n role='button'\n tabIndex={0}\n className={`notion-equation ${inline ? 'notion-equation-inline' : 'notion-equation-block'} ${className || ''}`}>\n <Katex math={math} settings={katexSettings} {...rest} />\n </span>\n )\n}\n"],"mappings":";;;;;;;;;AAAA,OAAO,WAAW;AAElB,OAAO,WAAW;AAElB,SAAS,qBAAqB;AAI9B,IAAM,gBAAgB;AAAA,EACpB,cAAc;AAAA,EACd,QAAQ;AACV;AAEO,IAAM,WAKR,CAAC,OAAwD;AAAxD,eAAE,SAAO,MAAM,SAAS,OAAO,UAlBrC,IAkBM,IAA6C,iBAA7C,IAA6C,CAA3C,SAAO,QAAM,UAAgB;AACnC,QAAM,EAAE,UAAU,IAAI,iBAAiB;AACvC,SAAO,QAAQ,cAAc,OAAO,SAAS;AAC7C,MAAI,CAAC
|
|
1
|
+
{"version":3,"sources":["../../../src/third-party/equation.tsx"],"sourcesContent":["import React from 'react'\n\nimport Katex from '@matejmazur/react-katex'\nimport { EquationBlock } from '@texonom/ntypes'\nimport { getBlockTitle } from '@texonom/nutils'\n\nimport { useNotionContext } from '../context'\n\nconst katexSettings = {\n throwOnError: false,\n strict: false\n}\n\nexport const Equation: React.FC<{\n block: EquationBlock\n math?: string\n inline?: boolean\n className?: string\n}> = ({ block, math, inline = false, className, ...rest }) => {\n const { recordMap } = useNotionContext()\n math = math || getBlockTitle(block, recordMap)\n if (!math) return null\n\n return (\n <span\n role='button'\n tabIndex={0}\n className={`notion-equation ${inline ? 'notion-equation-inline' : 'notion-equation-block'} ${className || ''}`}>\n <Katex math={math} settings={katexSettings} {...rest} />\n </span>\n )\n}\n"],"mappings":";;;;;;;;;AAAA,OAAO,WAAW;AAElB,OAAO,WAAW;AAElB,SAAS,qBAAqB;AAI9B,IAAM,gBAAgB;AAAA,EACpB,cAAc;AAAA,EACd,QAAQ;AACV;AAEO,IAAM,WAKR,CAAC,OAAwD;AAAxD,eAAE,SAAO,MAAM,SAAS,OAAO,UAlBrC,IAkBM,IAA6C,iBAA7C,IAA6C,CAA3C,SAAO,QAAM,UAAgB;AACnC,QAAM,EAAE,UAAU,IAAI,iBAAiB;AACvC,SAAO,QAAQ,cAAc,OAAO,SAAS;AAC7C,MAAI,CAAC,KAAM,QAAO;AAElB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,UAAU;AAAA,MACV,WAAW,mBAAmB,SAAS,2BAA2B,uBAAuB,IAAI,aAAa,EAAE;AAAA;AAAA,IAC5G,oCAAC,wBAAM,MAAY,UAAU,iBAAmB,KAAM;AAAA,EACxD;AAEJ;","names":[]}
|
package/build/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
CollectionColumnTitle,
|
|
3
3
|
PropertyIcon,
|
|
4
4
|
iconMap
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-P7HX4BAT.js";
|
|
6
6
|
import {
|
|
7
7
|
Asset,
|
|
8
8
|
AssetWrapper,
|
|
@@ -32,13 +32,13 @@ import {
|
|
|
32
32
|
isUrl,
|
|
33
33
|
require_lodash,
|
|
34
34
|
useNotionContext
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-72RHNPWF.js";
|
|
36
36
|
import {
|
|
37
37
|
__objRest,
|
|
38
38
|
__spreadProps,
|
|
39
39
|
__spreadValues,
|
|
40
40
|
__toESM
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-C6BUIPAM.js";
|
|
42
42
|
|
|
43
43
|
// src/renderer.tsx
|
|
44
44
|
import React9 from "react";
|
|
@@ -88,8 +88,7 @@ var GoogleDrive = ({ block, className }) => {
|
|
|
88
88
|
var _a;
|
|
89
89
|
const { components, mapImageUrl } = useNotionContext();
|
|
90
90
|
const properties = (_a = block.format) == null ? void 0 : _a.drive_properties;
|
|
91
|
-
if (!properties)
|
|
92
|
-
return null;
|
|
91
|
+
if (!properties) return null;
|
|
93
92
|
let domain;
|
|
94
93
|
try {
|
|
95
94
|
const url = new URL(properties.url);
|
|
@@ -127,10 +126,8 @@ var PageAside = ({ toc, activeSection, setActiveSection, pageAside, hasToc, hasA
|
|
|
127
126
|
let currentSectionId = activeSection;
|
|
128
127
|
for (let i = 0; i < sections.length; ++i) {
|
|
129
128
|
const section = sections[i];
|
|
130
|
-
if (!section || !(section instanceof Element))
|
|
131
|
-
|
|
132
|
-
if (!currentSectionId)
|
|
133
|
-
currentSectionId = section.getAttribute("data-id");
|
|
129
|
+
if (!section || !(section instanceof Element)) continue;
|
|
130
|
+
if (!currentSectionId) currentSectionId = section.getAttribute("data-id");
|
|
134
131
|
const bbox = section.getBoundingClientRect();
|
|
135
132
|
const prevHeight = prevBBox ? bbox.top - prevBBox.bottom : 0;
|
|
136
133
|
const offset = Math.max(150, prevHeight / 4);
|
|
@@ -150,16 +147,14 @@ var PageAside = ({ toc, activeSection, setActiveSection, pageAside, hasToc, hasA
|
|
|
150
147
|
]
|
|
151
148
|
);
|
|
152
149
|
React5.useEffect(() => {
|
|
153
|
-
if (!hasToc)
|
|
154
|
-
return;
|
|
150
|
+
if (!hasToc) return;
|
|
155
151
|
window.addEventListener("scroll", actionSectionScrollSpy);
|
|
156
152
|
actionSectionScrollSpy();
|
|
157
153
|
return () => {
|
|
158
154
|
window.removeEventListener("scroll", actionSectionScrollSpy);
|
|
159
155
|
};
|
|
160
156
|
}, [hasToc, actionSectionScrollSpy]);
|
|
161
|
-
if (!hasAside)
|
|
162
|
-
return null;
|
|
157
|
+
if (!hasAside) return null;
|
|
163
158
|
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) => {
|
|
164
159
|
const id = uuidToId(tocItem.id);
|
|
165
160
|
return /* @__PURE__ */ React5.createElement(
|
|
@@ -191,14 +186,12 @@ import React6 from "react";
|
|
|
191
186
|
var SyncPointerBlock = ({ block, level }) => {
|
|
192
187
|
var _a, _b;
|
|
193
188
|
if (!block) {
|
|
194
|
-
if (true)
|
|
195
|
-
console.warn("missing sync pointer block", block.id);
|
|
189
|
+
if (true) console.warn("missing sync pointer block", block.id);
|
|
196
190
|
return null;
|
|
197
191
|
}
|
|
198
192
|
const syncPointerBlock = block;
|
|
199
193
|
const referencePointerId = (_b = (_a = syncPointerBlock == null ? void 0 : syncPointerBlock.format) == null ? void 0 : _a.transclusion_reference_pointer) == null ? void 0 : _b.id;
|
|
200
|
-
if (!referencePointerId)
|
|
201
|
-
return null;
|
|
194
|
+
if (!referencePointerId) return null;
|
|
202
195
|
return /* @__PURE__ */ React6.createElement(NotionBlockRenderer, { key: referencePointerId, level, blockId: referencePointerId });
|
|
203
196
|
};
|
|
204
197
|
|
|
@@ -250,8 +243,7 @@ var Block = (props) => {
|
|
|
250
243
|
hideBlockId,
|
|
251
244
|
disableHeader
|
|
252
245
|
} = props;
|
|
253
|
-
if (!block)
|
|
254
|
-
return null;
|
|
246
|
+
if (!block) return null;
|
|
255
247
|
if (level === 0 && block.type === "collection_view") {
|
|
256
248
|
const view_block = block;
|
|
257
249
|
view_block.type = "collection_view_page";
|
|
@@ -259,6 +251,7 @@ var Block = (props) => {
|
|
|
259
251
|
const blockId = hideBlockId ? "notion-block" : `notion-block-${uuidToId2(block.id)}`;
|
|
260
252
|
switch (block.type) {
|
|
261
253
|
case "collection_view_page":
|
|
254
|
+
// fallthrough
|
|
262
255
|
case "page":
|
|
263
256
|
if (level === 0) {
|
|
264
257
|
const {
|
|
@@ -363,10 +356,11 @@ var Block = (props) => {
|
|
|
363
356
|
);
|
|
364
357
|
}
|
|
365
358
|
case "header":
|
|
359
|
+
// fallthrough
|
|
366
360
|
case "sub_header":
|
|
361
|
+
// fallthrough
|
|
367
362
|
case "sub_sub_header": {
|
|
368
|
-
if (!block.properties)
|
|
369
|
-
return null;
|
|
363
|
+
if (!block.properties) return null;
|
|
370
364
|
const blockColor = (_e = block.format) == null ? void 0 : _e.block_color;
|
|
371
365
|
const id = uuidToId2(block.id);
|
|
372
366
|
const title = getTextContent(block.properties.title) || `Notion Header ${id}`;
|
|
@@ -383,8 +377,7 @@ var Block = (props) => {
|
|
|
383
377
|
}
|
|
384
378
|
}
|
|
385
379
|
}
|
|
386
|
-
if (indentLevel !== void 0)
|
|
387
|
-
indentLevelClass = `notion-h-indent-${indentLevel}`;
|
|
380
|
+
if (indentLevel !== void 0) indentLevelClass = `notion-h-indent-${indentLevel}`;
|
|
388
381
|
const isH1 = block.type === "header";
|
|
389
382
|
const isH2 = block.type === "sub_header";
|
|
390
383
|
const isH3 = block.type === "sub_sub_header";
|
|
@@ -404,18 +397,17 @@ var Block = (props) => {
|
|
|
404
397
|
headerBlock = /* @__PURE__ */ React8.createElement("h4", { className: classNameStr, "data-id": id }, innerHeader);
|
|
405
398
|
if ((_g = block.format) == null ? void 0 : _g.toggleable)
|
|
406
399
|
return /* @__PURE__ */ React8.createElement("details", { className: `notion-toggle ${blockId}` }, /* @__PURE__ */ React8.createElement("summary", null, headerBlock), /* @__PURE__ */ React8.createElement("div", null, children));
|
|
407
|
-
else
|
|
408
|
-
return headerBlock;
|
|
400
|
+
else return headerBlock;
|
|
409
401
|
}
|
|
410
402
|
case "divider":
|
|
411
403
|
return /* @__PURE__ */ React8.createElement("hr", { className: `notion-hr ${blockId}` });
|
|
412
404
|
case "text": {
|
|
413
|
-
if (!block.properties && !((_h = block.content) == null ? void 0 : _h.length))
|
|
414
|
-
return /* @__PURE__ */ React8.createElement("div", { className: `notion-blank ${blockId}` }, "\xA0");
|
|
405
|
+
if (!block.properties && !((_h = block.content) == null ? void 0 : _h.length)) return /* @__PURE__ */ React8.createElement("div", { className: `notion-blank ${blockId}` }, "\xA0");
|
|
415
406
|
const blockColor = (_i = block.format) == null ? void 0 : _i.block_color;
|
|
416
407
|
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));
|
|
417
408
|
}
|
|
418
409
|
case "bulleted_list":
|
|
410
|
+
// fallthrough
|
|
419
411
|
case "numbered_list": {
|
|
420
412
|
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);
|
|
421
413
|
let output = null;
|
|
@@ -430,14 +422,23 @@ var Block = (props) => {
|
|
|
430
422
|
case "embed":
|
|
431
423
|
return /* @__PURE__ */ React8.createElement(components.Embed, { blockId, block });
|
|
432
424
|
case "tweet":
|
|
425
|
+
// fallthrough
|
|
433
426
|
case "maps":
|
|
427
|
+
// fallthrough
|
|
434
428
|
case "pdf":
|
|
429
|
+
// fallthrough
|
|
435
430
|
case "figma":
|
|
431
|
+
// fallthrough
|
|
436
432
|
case "typeform":
|
|
433
|
+
// fallthrough
|
|
437
434
|
case "codepen":
|
|
435
|
+
// fallthrough
|
|
438
436
|
case "excalidraw":
|
|
437
|
+
// fallthrough
|
|
439
438
|
case "image":
|
|
439
|
+
// fallthrough
|
|
440
440
|
case "gist":
|
|
441
|
+
// fallthrough
|
|
441
442
|
case "video":
|
|
442
443
|
return /* @__PURE__ */ React8.createElement(AssetWrapper, { blockId, block });
|
|
443
444
|
case "drive": {
|
|
@@ -468,16 +469,14 @@ var Block = (props) => {
|
|
|
468
469
|
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement("div", { className: `notion-column ${blockId}`, style }, children), /* @__PURE__ */ React8.createElement("div", { className: "notion-spacer" }));
|
|
469
470
|
}
|
|
470
471
|
case "quote": {
|
|
471
|
-
if (!block.properties)
|
|
472
|
-
return null;
|
|
472
|
+
if (!block.properties) return null;
|
|
473
473
|
const blockColor = (_r = block.format) == null ? void 0 : _r.block_color;
|
|
474
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);
|
|
475
475
|
}
|
|
476
476
|
case "collection_view":
|
|
477
477
|
return /* @__PURE__ */ React8.createElement(components.Collection, { block, className: blockId, ctx });
|
|
478
478
|
case "callout":
|
|
479
|
-
if (components.Callout)
|
|
480
|
-
return /* @__PURE__ */ React8.createElement(components.Callout, { block, className: blockId });
|
|
479
|
+
if (components.Callout) return /* @__PURE__ */ React8.createElement(components.Callout, { block, className: blockId });
|
|
481
480
|
else
|
|
482
481
|
return /* @__PURE__ */ React8.createElement(
|
|
483
482
|
"div",
|
|
@@ -488,14 +487,11 @@ var Block = (props) => {
|
|
|
488
487
|
/* @__PURE__ */ React8.createElement("div", { className: "notion-callout-text" }, /* @__PURE__ */ React8.createElement(Text, { value: (_u = block.properties) == null ? void 0 : _u.title, block }), children)
|
|
489
488
|
);
|
|
490
489
|
case "bookmark": {
|
|
491
|
-
if (!block.properties)
|
|
492
|
-
return null;
|
|
490
|
+
if (!block.properties) return null;
|
|
493
491
|
const link = block.properties.link;
|
|
494
|
-
if (!link || !((_v = link[0]) == null ? void 0 : _v[0]))
|
|
495
|
-
return null;
|
|
492
|
+
if (!link || !((_v = link[0]) == null ? void 0 : _v[0])) return null;
|
|
496
493
|
let title = getTextContent(block.properties.title);
|
|
497
|
-
if (!title)
|
|
498
|
-
title = getTextContent(link);
|
|
494
|
+
if (!title) title = getTextContent(link);
|
|
499
495
|
if (title) {
|
|
500
496
|
if (title.startsWith("http"))
|
|
501
497
|
try {
|
|
@@ -529,8 +525,7 @@ var Block = (props) => {
|
|
|
529
525
|
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));
|
|
530
526
|
case "table_of_contents": {
|
|
531
527
|
const page = getBlockParentPage(block, recordMap);
|
|
532
|
-
if (!page)
|
|
533
|
-
return null;
|
|
528
|
+
if (!page) return null;
|
|
534
529
|
const toc = getPageTableOfContents(page, recordMap);
|
|
535
530
|
const blockColor = (_F = block.format) == null ? void 0 : _F.block_color;
|
|
536
531
|
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(
|
|
@@ -569,8 +564,7 @@ var Block = (props) => {
|
|
|
569
564
|
const order = (_O = tableBlock.format) == null ? void 0 : _O.table_block_column_order;
|
|
570
565
|
const formatMap = (_P = tableBlock.format) == null ? void 0 : _P.table_block_column_format;
|
|
571
566
|
const backgroundColor = (_Q = block.format) == null ? void 0 : _Q.block_color;
|
|
572
|
-
if (!tableBlock || !order)
|
|
573
|
-
return null;
|
|
567
|
+
if (!tableBlock || !order) return null;
|
|
574
568
|
return /* @__PURE__ */ React8.createElement("tr", { className: `notion-simple-table-row ${backgroundColor && `notion-${backgroundColor}`} ${blockId}` }, order.map((column) => {
|
|
575
569
|
var _a2, _b2, _c2;
|
|
576
570
|
const color = (_a2 = formatMap == null ? void 0 : formatMap[column]) == null ? void 0 : _a2.color;
|
|
@@ -689,26 +683,19 @@ var NotionBlockRenderer = (_a) => {
|
|
|
689
683
|
const id = blockId || Object.keys(recordMap.block)[0];
|
|
690
684
|
const block = (_a2 = recordMap.block[id]) == null ? void 0 : _a2.value;
|
|
691
685
|
if (!block) {
|
|
692
|
-
if (true)
|
|
693
|
-
console.warn("missing block", blockId);
|
|
686
|
+
if (true) console.warn("missing block", blockId);
|
|
694
687
|
return null;
|
|
695
688
|
}
|
|
696
689
|
return /* @__PURE__ */ React9.createElement(Block, __spreadValues({ key: id, level, block }, props), (_b2 = block == null ? void 0 : block.content) == null ? void 0 : _b2.map((contentBlockId) => /* @__PURE__ */ React9.createElement(NotionBlockRenderer, __spreadValues({ key: contentBlockId, blockId: contentBlockId, level: level + 1 }, props))));
|
|
697
690
|
};
|
|
698
691
|
function getMediumZoomMargin() {
|
|
699
692
|
const width = window.innerWidth;
|
|
700
|
-
if (width < 500)
|
|
701
|
-
|
|
702
|
-
else if (width <
|
|
703
|
-
|
|
704
|
-
else if (width <
|
|
705
|
-
|
|
706
|
-
else if (width < 1600)
|
|
707
|
-
return 40;
|
|
708
|
-
else if (width < 1920)
|
|
709
|
-
return 48;
|
|
710
|
-
else
|
|
711
|
-
return 72;
|
|
693
|
+
if (width < 500) return 8;
|
|
694
|
+
else if (width < 800) return 20;
|
|
695
|
+
else if (width < 1280) return 30;
|
|
696
|
+
else if (width < 1600) return 40;
|
|
697
|
+
else if (width < 1920) return 48;
|
|
698
|
+
else return 72;
|
|
712
699
|
}
|
|
713
700
|
export {
|
|
714
701
|
Asset,
|
package/build/next.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../src/next.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,eAAO,MAAM,aAAa,cAAe,GAAG,KAAG,
|
|
1
|
+
{"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../src/next.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,eAAO,MAAM,aAAa,cAAe,GAAG,KAAG,KAAK,CAAC,EAAE,CAAC,GAAG,CA+B1D,CAAA;AAED,eAAO,MAAM,YAAY,aAAc,GAAG,KAAG,KAAK,CAAC,EAAE,CAAC,GAAG,CAetD,CAAA"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Text,
|
|
3
3
|
useNotionContext
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-72RHNPWF.js";
|
|
5
5
|
import {
|
|
6
6
|
__async,
|
|
7
7
|
__commonJS,
|
|
8
8
|
__spreadValues,
|
|
9
9
|
__toESM
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-C6BUIPAM.js";
|
|
11
11
|
|
|
12
12
|
// ../../node_modules/.pnpm/clipboard-copy@4.0.1/node_modules/clipboard-copy/index.js
|
|
13
13
|
var require_clipboard_copy = __commonJS({
|
|
@@ -44,8 +44,7 @@ var require_clipboard_copy = __commonJS({
|
|
|
44
44
|
selection.removeAllRanges();
|
|
45
45
|
window.document.body.removeChild(span);
|
|
46
46
|
}
|
|
47
|
-
if (!success)
|
|
48
|
-
throw makeError();
|
|
47
|
+
if (!success) throw makeError();
|
|
49
48
|
});
|
|
50
49
|
}
|
|
51
50
|
function clipboardCopy(text) {
|