@texonom/nreact 1.3.0-rc.4 → 1.3.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.
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  useNotionContext
3
- } from "../chunk-NVAEYUJK.js";
3
+ } from "../chunk-N6EDMIQD.js";
4
4
  import {
5
5
  __objRest,
6
6
  __spreadValues
7
- } from "../chunk-JX5CEG3A.js";
7
+ } from "../chunk-Q4G2SZRD.js";
8
8
 
9
9
  // src/third-party/equation.tsx
10
10
  import React from "react";
@@ -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;AAAM,WAAO;AAElB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,UAAU;AAAA,MACV,WAAW,mBAAmB,SAAS,2BAA2B,2BAA2B,aAAa;AAAA;AAAA,IAC1G,oCAAC,wBAAM,MAAY,UAAU,iBAAmB,KAAM;AAAA,EACxD;AAEJ;","names":[]}
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;AAAM,WAAO;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":[]}
@@ -1,4 +1,4 @@
1
- import "../chunk-JX5CEG3A.js";
1
+ import "../chunk-Q4G2SZRD.js";
2
2
 
3
3
  // src/third-party/modal.tsx
4
4
  import Modal from "react-modal";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  __objRest,
3
3
  __spreadValues
4
- } from "../chunk-JX5CEG3A.js";
4
+ } from "../chunk-Q4G2SZRD.js";
5
5
 
6
6
  // src/third-party/pdf.tsx
7
7
  import React from "react";
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/third-party/pdf.tsx"],"sourcesContent":["import React from 'react'\n\nimport { Document, Page, pdfjs } from 'react-pdf'\n\n// ensure pdfjs can find its worker script regardless of how nreact is bundled\npdfjs.GlobalWorkerOptions.workerSrc = `//unpkg.com/pdfjs-dist@${pdfjs.version}/legacy/build/pdf.worker.min.js`\n\nexport const Pdf: React.FC<{ file: string }> = ({ file, ...rest }) => {\n const [numPages, setNumPages] = React.useState(null)\n\n function onDocumentLoadSuccess({ numPages }) {\n setNumPages(numPages)\n }\n\n return (\n <Document file={file} onLoadSuccess={onDocumentLoadSuccess} {...rest}>\n {Array.from(new Array(numPages), (_, index) => (\n <Page key={`page_${index + 1}`} pageNumber={index + 1} />\n ))}\n </Document>\n )\n}\n"],"mappings":";;;;;;AAAA,OAAO,WAAW;AAElB,SAAS,UAAU,MAAM,aAAa;AAGtC,MAAM,oBAAoB,YAAY,0BAA0B,MAAM;AAE/D,IAAM,MAAkC,CAAC,OAAsB;AAAtB,eAAE,OAPlD,IAOgD,IAAW,iBAAX,IAAW,CAAT;AAChD,QAAM,CAAC,UAAU,WAAW,IAAI,MAAM,SAAS,IAAI;AAEnD,WAAS,sBAAsB,EAAE,UAAAA,UAAS,GAAG;AAC3C,gBAAYA,SAAQ;AAAA,EACtB;AAEA,SACE,oCAAC,2BAAS,MAAY,eAAe,yBAA2B,OAC7D,MAAM,KAAK,IAAI,MAAM,QAAQ,GAAG,CAAC,GAAG,UACnC,oCAAC,QAAK,KAAK,QAAQ,QAAQ,KAAK,YAAY,QAAQ,GAAG,CACxD,CACH;AAEJ;","names":["numPages"]}
1
+ {"version":3,"sources":["../../../src/third-party/pdf.tsx"],"sourcesContent":["import React from 'react'\n\nimport { Document, Page, pdfjs } from 'react-pdf'\n\n// ensure pdfjs can find its worker script regardless of how nreact is bundled\npdfjs.GlobalWorkerOptions.workerSrc = `//unpkg.com/pdfjs-dist@${pdfjs.version}/legacy/build/pdf.worker.min.js`\n\nexport const Pdf: React.FC<{ file: string }> = ({ file, ...rest }) => {\n const [numPages, setNumPages] = React.useState(null)\n\n function onDocumentLoadSuccess({ numPages }) {\n setNumPages(numPages)\n }\n\n return (\n <Document file={file} onLoadSuccess={onDocumentLoadSuccess} {...rest}>\n {Array.from(new Array(numPages), (_, index) => (\n <Page key={`page_${index + 1}`} pageNumber={index + 1} />\n ))}\n </Document>\n )\n}\n"],"mappings":";;;;;;AAAA,OAAO,WAAW;AAElB,SAAS,UAAU,MAAM,aAAa;AAGtC,MAAM,oBAAoB,YAAY,0BAA0B,MAAM,OAAO;AAEtE,IAAM,MAAkC,CAAC,OAAsB;AAAtB,eAAE,OAPlD,IAOgD,IAAW,iBAAX,IAAW,CAAT;AAChD,QAAM,CAAC,UAAU,WAAW,IAAI,MAAM,SAAS,IAAI;AAEnD,WAAS,sBAAsB,EAAE,UAAAA,UAAS,GAAG;AAC3C,gBAAYA,SAAQ;AAAA,EACtB;AAEA,SACE,oCAAC,2BAAS,MAAY,eAAe,yBAA2B,OAC7D,MAAM,KAAK,IAAI,MAAM,QAAQ,GAAG,CAAC,GAAG,UACnC,oCAAC,QAAK,KAAK,QAAQ,QAAQ,CAAC,IAAI,YAAY,QAAQ,GAAG,CACxD,CACH;AAEJ;","names":["numPages"]}
@@ -1 +1 @@
1
- {"version":3,"file":"clear-icon.d.ts","sourceRoot":"","sources":["../../src/icons/clear-icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,eAAO,MAAM,SAAS,mCAOrB,CAAA"}
1
+ {"version":3,"file":"clear-icon.d.ts","sourceRoot":"","sources":["../../src/icons/clear-icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,eAAO,MAAM,SAAS,mCAOrB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"loading-icon.d.ts","sourceRoot":"","sources":["../../src/icons/loading-icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,eAAO,MAAM,WAAW,mCAsBvB,CAAA"}
1
+ {"version":3,"file":"loading-icon.d.ts","sourceRoot":"","sources":["../../src/icons/loading-icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,eAAO,MAAM,WAAW,mCAsBvB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"search-icon.d.ts","sourceRoot":"","sources":["../../src/icons/search-icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,eAAO,MAAM,UAAU,mCAOtB,CAAA"}
1
+ {"version":3,"file":"search-icon.d.ts","sourceRoot":"","sources":["../../src/icons/search-icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,eAAO,MAAM,UAAU,mCAOtB,CAAA"}
package/build/index.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  CollectionColumnTitle,
3
3
  PropertyIcon,
4
4
  iconMap
5
- } from "./chunk-LB5ZQ7L5.js";
5
+ } from "./chunk-2U7I3XVC.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-HJGIONX2.js";
35
+ } from "./chunk-VP33CFNB.js";
36
36
  import {
37
37
  __objRest,
38
38
  __spreadProps,
39
39
  __spreadValues,
40
40
  __toESM
41
- } from "./chunk-723T62SD.js";
41
+ } from "./chunk-FCO7MUK6.js";
42
42
 
43
43
  // src/renderer.tsx
44
44
  import React9 from "react";
@@ -224,7 +224,6 @@ var Block = (props) => {
224
224
  const {
225
225
  components,
226
226
  fullPage,
227
- darkMode,
228
227
  recordMap,
229
228
  mapPageUrl,
230
229
  mapImageUrl,
@@ -286,7 +285,7 @@ var Block = (props) => {
286
285
  const hasToc = showTableOfContents && toc.length >= minTableOfContentsItems;
287
286
  const hasAside = (hasToc || pageAside) && !page_full_width;
288
287
  const hasPageCover = pageCover || page_cover;
289
- return /* @__PURE__ */ React8.createElement("div", { className: `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(
290
289
  LazyImage,
291
290
  {
292
291
  src: mapImageUrl(page_cover, block),
@@ -338,7 +337,6 @@ var Block = (props) => {
338
337
  "main",
339
338
  {
340
339
  className: `notion
341
- ${darkMode ? "dark" : "light"},
342
340
  notion-page
343
341
  ${page_full_width && "notion-full-width"}
344
342
  ${page_small_text && "notion-small-text"}
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  Text,
3
3
  useNotionContext
4
- } from "../chunk-HJGIONX2.js";
4
+ } from "../chunk-VP33CFNB.js";
5
5
  import {
6
6
  __async,
7
7
  __commonJS,
8
8
  __spreadValues,
9
9
  __toESM
10
- } from "../chunk-723T62SD.js";
10
+ } from "../chunk-FCO7MUK6.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({
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  CollectionColumnTitle
3
- } from "../chunk-LB5ZQ7L5.js";
3
+ } from "../chunk-2U7I3XVC.js";
4
4
  import {
5
5
  Checkbox,
6
6
  GracefulImage,
@@ -12,14 +12,14 @@ import {
12
12
  dummyLink,
13
13
  formatDate,
14
14
  useNotionContext
15
- } from "../chunk-HJGIONX2.js";
15
+ } from "../chunk-VP33CFNB.js";
16
16
  import {
17
17
  __commonJS,
18
18
  __objRest,
19
19
  __spreadProps,
20
20
  __spreadValues,
21
21
  __toESM
22
- } from "../chunk-723T62SD.js";
22
+ } from "../chunk-FCO7MUK6.js";
23
23
 
24
24
  // ../../node_modules/.pnpm/@babel+runtime@7.21.5/node_modules/@babel/runtime/helpers/interopRequireDefault.js
25
25
  var require_interopRequireDefault = __commonJS({
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  useNotionContext
3
- } from "../chunk-HJGIONX2.js";
3
+ } from "../chunk-VP33CFNB.js";
4
4
  import {
5
5
  __objRest,
6
6
  __spreadValues
7
- } from "../chunk-723T62SD.js";
7
+ } from "../chunk-FCO7MUK6.js";
8
8
 
9
9
  // src/third-party/equation.tsx
10
10
  import React from "react";
@@ -1,4 +1,4 @@
1
- import "../chunk-723T62SD.js";
1
+ import "../chunk-FCO7MUK6.js";
2
2
 
3
3
  // src/third-party/modal.tsx
4
4
  import Modal from "react-modal";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  __objRest,
3
3
  __spreadValues
4
- } from "../chunk-723T62SD.js";
4
+ } from "../chunk-FCO7MUK6.js";
5
5
 
6
6
  // src/third-party/pdf.tsx
7
7
  import React from "react";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@texonom/nreact",
3
- "version": "1.3.0-rc.4",
3
+ "version": "1.3.0",
4
4
  "type": "module",
5
5
  "description": "Fast and accurate React renderer for Notion.",
6
6
  "repository": "texonom/notion-node",
@@ -15,7 +15,7 @@
15
15
  "src/styles.css"
16
16
  ],
17
17
  "engines": {
18
- "node": ">=20.9.0"
18
+ "node": ">=20.11.0"
19
19
  },
20
20
  "dependencies": {
21
21
  "@fisch0920/medium-zoom": "^1.0.7",
@@ -23,18 +23,18 @@
23
23
  "katex": "^0.16.9",
24
24
  "prismjs": "^1.29.0",
25
25
  "react-fast-compare": "^3.2.2",
26
- "react-hotkeys-hook": "^4.4.1",
26
+ "react-hotkeys-hook": "^4.4.4",
27
27
  "react-image": "^4.1.0",
28
28
  "react-modal": "^3.16.1",
29
- "react-pdf": "^7.5.1",
30
- "react-use": "^17.4.0",
31
- "@texonom/ntypes": "^1.2.11",
32
- "@texonom/nutils": "^1.2.11"
29
+ "react-pdf": "^7.7.0",
30
+ "react-use": "^17.4.3",
31
+ "@texonom/ntypes": "^1.3.0",
32
+ "@texonom/nutils": "^1.3.0"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@types/lodash.throttle": "^4.1.9",
36
- "@types/node": "^20.9.0",
37
- "@types/react": "^18.2.37",
36
+ "@types/node": "^20.11.5",
37
+ "@types/react": "^18.2.48",
38
38
  "clipboard-copy": "^4.0.1",
39
39
  "date-fns": "^2.30.0",
40
40
  "format-number": "^3.0.0",