@texonom/nreact 1.6.2 → 1.6.4

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 (33) hide show
  1. package/build/asset-wrapper-BjCXzGmC.js +1056 -0
  2. package/build/asset-wrapper-BjCXzGmC.js.map +1 -0
  3. package/build/block.d.ts.map +1 -1
  4. package/build/collection-column-title-Bw3sXBSk.js +113 -0
  5. package/build/collection-column-title-Bw3sXBSk.js.map +1 -0
  6. package/build/components/editable-text.d.ts +18 -0
  7. package/build/components/editable-text.d.ts.map +1 -0
  8. package/build/components/editable-text.test.d.ts +2 -0
  9. package/build/components/editable-text.test.d.ts.map +1 -0
  10. package/build/context.d.ts +4 -0
  11. package/build/context.d.ts.map +1 -1
  12. package/build/index.js +596 -689
  13. package/build/index.js.map +1 -1
  14. package/build/renderer.d.ts +2 -0
  15. package/build/renderer.d.ts.map +1 -1
  16. package/build/rolldown-runtime-CEFd7nDs.js +30 -0
  17. package/build/third-party/code.js +559 -196
  18. package/build/third-party/code.js.map +1 -1
  19. package/build/third-party/collection.js +2690 -3432
  20. package/build/third-party/collection.js.map +1 -1
  21. package/build/third-party/equation.js +27 -43
  22. package/build/third-party/equation.js.map +1 -1
  23. package/build/third-party/modal.js +1355 -1615
  24. package/build/third-party/modal.js.map +1 -1
  25. package/license +21 -0
  26. package/package.json +16 -13
  27. package/src/styles.css +16 -0
  28. package/build/_commonjsHelpers-ByYUsBRP.js +0 -34
  29. package/build/_commonjsHelpers-ByYUsBRP.js.map +0 -1
  30. package/build/asset-wrapper-CVJvW06J.js +0 -984
  31. package/build/asset-wrapper-CVJvW06J.js.map +0 -1
  32. package/build/collection-column-title-l4hmVo49.js +0 -99
  33. package/build/collection-column-title-l4hmVo49.js.map +0 -1
@@ -1,44 +1,28 @@
1
- var x = Object.defineProperty;
2
- var r = Object.getOwnPropertySymbols;
3
- var s = Object.prototype.hasOwnProperty, l = Object.prototype.propertyIsEnumerable;
4
- var a = (o, t, e) => t in o ? x(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e, c = (o, t) => {
5
- for (var e in t || (t = {}))
6
- s.call(t, e) && a(o, e, t[e]);
7
- if (r)
8
- for (var e of r(t))
9
- l.call(t, e) && a(o, e, t[e]);
10
- return o;
1
+ import { j as e, k as t, s as n } from "../asset-wrapper-BjCXzGmC.js";
2
+ import r from "react";
3
+ import { getBlockTitle as i } from "@texonom/nutils";
4
+ import a from "@matejmazur/react-katex";
5
+ //#region src/third-party/equation.tsx
6
+ var o = [
7
+ "block",
8
+ "math",
9
+ "inline",
10
+ "className"
11
+ ], s = {
12
+ throwOnError: !1,
13
+ strict: !1
14
+ }, c = (c) => {
15
+ let { block: l, math: u, inline: d = !1, className: f } = c, p = t(c, o), { recordMap: m } = n();
16
+ return u = u || i(l, m), u ? /* @__PURE__ */ r.createElement("span", {
17
+ role: "button",
18
+ tabIndex: 0,
19
+ className: `notion-equation ${d ? "notion-equation-inline" : "notion-equation-block"} ${f || ""}`
20
+ }, /* @__PURE__ */ r.createElement(a, e({
21
+ math: u,
22
+ settings: s
23
+ }, p))) : null;
11
24
  };
12
- var u = (o, t) => {
13
- var e = {};
14
- for (var n in o)
15
- s.call(o, n) && t.indexOf(n) < 0 && (e[n] = o[n]);
16
- if (o != null && r)
17
- for (var n of r(o))
18
- t.indexOf(n) < 0 && l.call(o, n) && (e[n] = o[n]);
19
- return e;
20
- };
21
- import f from "react";
22
- import q from "@matejmazur/react-katex";
23
- import { getBlockTitle as E } from "@texonom/nutils";
24
- import { u as b } from "../asset-wrapper-CVJvW06J.js";
25
- const g = {
26
- throwOnError: !1,
27
- strict: !1
28
- }, C = (k) => {
29
- var i = k, { block: o, math: t, inline: e = !1, className: n } = i, m = u(i, ["block", "math", "inline", "className"]);
30
- const { recordMap: p } = b();
31
- return t = t || E(o, p), t ? /* @__PURE__ */ f.createElement(
32
- "span",
33
- {
34
- role: "button",
35
- tabIndex: 0,
36
- className: `notion-equation ${e ? "notion-equation-inline" : "notion-equation-block"} ${n || ""}`
37
- },
38
- /* @__PURE__ */ f.createElement(q, c({ math: t, settings: g }, m))
39
- ) : null;
40
- };
41
- export {
42
- C as Equation
43
- };
44
- //# sourceMappingURL=equation.js.map
25
+ //#endregion
26
+ export { c as Equation };
27
+
28
+ //# sourceMappingURL=equation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"equation.js","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"],"names":["katexSettings","Equation","_a","_b","block","math","inline","className","rest","__objRest","recordMap","useNotionContext","getBlockTitle","React","Katex","__spreadValues"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAQA,MAAMA,IAAgB;AAAA,EACpB,cAAc;AAAA,EACd,QAAQ;AACV,GAEaC,IAKR,CAACC,MAAwD;AAAxD,MAAAC,IAAAD,GAAE,SAAAE,GAAO,MAAAC,GAAM,QAAAC,IAAS,IAAO,WAAAC,MAA/BJ,GAA6CK,IAAAC,EAA7CN,GAA6C,CAA3C,SAAO,QAAM,UAAgB;AACnC,QAAM,EAAE,WAAAO,EAAA,IAAcC,EAAA;AAEtB,SADAN,IAAOA,KAAQO,EAAcR,GAAOM,CAAS,GACxCL,IAGH,gBAAAQ,EAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,UAAU;AAAA,MACV,WAAW,mBAAmBP,IAAS,2BAA2B,uBAAuB,IAAIC,KAAa,EAAE;AAAA,IAAA;AAAA,oCAC3GO,GAAAC,EAAA,EAAM,MAAAV,GAAY,UAAUL,KAAmBQ,EAAM;AAAA,EAAA,IAPxC;AAUpB;"}
1
+ {"version":3,"file":"equation.js","names":["_objectSpread2","_objectWithoutProperties","useNotionContext","React","Katex","_excluded","katexSettings","Equation","_ref","rest","math","getBlockTitle","block","recordMap","inline","className"],"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":";;;;;;CAkBQ;CAAO;CAAM;CAAgB;GAV/BM,IAAgB;CACpB,cAAc;CACd,QAAQ;AACV,GAEaC,KAKP,MAAwD;CAAxD,IAAA,EAAE,UAAO,SAAM,YAAS,IAAO,iBAAAC,GAAcC,IAAAR,EAAAO,GAAAH,CAAA,GAC3C,EAAE,iBAAcH,EAAiB;CAIvC,OAHA,IAAOQ,KAAQC,EAAcC,GAAOC,CAAS,GACxCH,IAGH,kBAAA,cAAC,QAAD;EACE,MAAK;EACL,UAAU;EACV,WAAW,mBAAmBI,IAAS,2BAA2B,wBAAwB,GAAGC,KAAa;CAEtG,GADJ,kBAAA,cAACX,GAAAJ,EAAA;EAAY;EAAM,UAAUM;CAAmB,GAAAG,CAAO,CAAA,CACnD,IARU;AAUpB"}