@texonom/nreact 1.6.6 → 1.6.7

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,28 +1,30 @@
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";
1
+ import { n as e, t } from "../objectSpread2-DfFXoz5f.js";
2
+ import { k as n, s as r } from "../asset-wrapper-saop46mm.js";
3
+ import i from "react";
4
+ import { getBlockTitle as a } from "@texonom/nutils";
5
+ import o from "@matejmazur/react-katex";
5
6
  //#region src/third-party/equation.tsx
6
- var o = [
7
+ e();
8
+ var s = [
7
9
  "block",
8
10
  "math",
9
11
  "inline",
10
12
  "className"
11
- ], s = {
13
+ ], c = {
12
14
  throwOnError: !1,
13
15
  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", {
16
+ }, l = (e) => {
17
+ let { block: l, math: u, inline: d = !1, className: f } = e, p = n(e, s), { recordMap: m } = r();
18
+ return u = u || a(l, m), u ? /* @__PURE__ */ i.createElement("span", {
17
19
  role: "button",
18
20
  tabIndex: 0,
19
21
  className: `notion-equation ${d ? "notion-equation-inline" : "notion-equation-block"} ${f || ""}`
20
- }, /* @__PURE__ */ r.createElement(a, e({
22
+ }, /* @__PURE__ */ i.createElement(o, t({
21
23
  math: u,
22
- settings: s
24
+ settings: c
23
25
  }, p))) : null;
24
26
  };
25
27
  //#endregion
26
- export { c as Equation };
28
+ export { l as Equation };
27
29
 
28
30
  //# sourceMappingURL=equation.js.map
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"equation.js","names":["init_objectSpread2","_objectWithoutProperties","useNotionContext","React","Katex","_excluded","katexSettings","Equation","_ref","rest","math","getBlockTitle","block","recordMap","inline","className","_objectSpread2"],"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,GAAAY,EAAA;EAAY;EAAM,UAAUV;CAAmB,GAAAG,CAAO,CAAA,CACnD,IARU;AAUpB"}