sanity-plugin-latex-input
3.0.83.0.9
~
Modified (3 files)
Index: package/dist/index.js
===================================================================
--- package/dist/index.js
+++ package/dist/index.js
@@ -1,8 +1,7 @@
import { definePlugin, defineType } from "sanity";
import { c } from "react/compiler-runtime";
import { renderToString } from "katex";
-import "react";
import "katex/dist/katex.min.css";
import { jsx } from "react/jsx-runtime";
const LatexPreview = (props) => {
let $ = c(6), latex = props?.body || "", isInline = props.layout === "inline", t0 = !isInline, t1; Index: package/package.json
===================================================================
--- package/package.json
+++ package/package.json
@@ -1,7 +1,7 @@
{
"name": "sanity-plugin-latex-input",
- "version": "3.0.8",
+ "version": "3.0.9",
"description": "LaTeX input for Portable Text Editor in Sanity Studio.",
"keywords": [
"latex",
"plugin",
@@ -31,15 +31,15 @@
"katex": "^0.18.4"
},
"devDependencies": {
"@sanity/tsconfig": "^2.2.1",
- "@sanity/tsdown-config": "^0.24.0",
+ "@sanity/tsdown-config": "^0.26.0",
"@types/react": "^19.2.18",
"@types/react-dom": "^19.2.4",
- "babel-plugin-react-compiler": "^1.0.0",
+ "oxc-transform-react": "^0.145.0",
"react": "^19.2.8",
"react-dom": "^19.2.8",
- "sanity": "^6.9.2",
+ "sanity": "^6.10.1",
"tsdown": "^0.22.14"
},
"peerDependencies": {
"react": "^19.2", Index: package/dist/index.js.map
===================================================================
--- package/dist/index.js.map
+++ package/dist/index.js.map
@@ -1,1 +1,1 @@
-{"version":3,"file":"index.js","names":["renderToString","useMemo","LatexPreviewProps","body","layout","LatexPreview","props","$","_c","latex","isInline","t0","t1","displayMode","throwOnError","html","t2","__html","defineType","ObjectDefinition","LatexPreview","latexTypeName","const","LatexDefinition","Omit","type","IntrinsicDefinitions","latex","latexSchema","title","name","components","preview","fields","select","body"],"sources":["../src/components/LatexPreview.tsx","../src/schema.ts","../src/plugin.tsx"],"sourcesContent":["import {renderToString} from 'katex'\nimport {useMemo} from 'react'\n\nimport 'katex/dist/katex.min.css'\n\nexport interface LatexPreviewProps {\n body?: string\n layout?: string\n}\n\n// KaTeX's renderToString sanitizes its output and does not execute scripts,\n// making it safe to use with dangerouslySetInnerHTML for trusted LaTeX source content.\nexport const LatexPreview = (props: LatexPreviewProps) => {\n const latex = props?.body || ''\n const isInline = props.layout === 'inline'\n\n const html = useMemo(\n () =>\n renderToString(latex, {\n displayMode: !isInline,\n throwOnError: false,\n }),\n [latex, isInline],\n )\n\n return isInline ? (\n <span dangerouslySetInnerHTML={{__html: html}} />\n ) : (\n <div dangerouslySetInnerHTML={{__html: html}} />\n )\n}\n","import {defineType, type ObjectDefinition} from 'sanity'\n\nimport {LatexPreview} from './components/LatexPreview'\n\nconst latexTypeName = 'latex' as const\n\n/**\n * @public\n */\nexport interface LatexDefinition extends Omit<ObjectDefinition, 'type' | 'fields'> {\n type: typeof latexTypeName\n}\n\ndeclare module 'sanity' {\n // makes type: 'latex' narrow correctly when using defineType/defineField/defineArrayMember\n export interface IntrinsicDefinitions {\n latex: LatexDefinition\n }\n}\n\nexport const latexSchema = defineType({\n title: 'Latex',\n type: 'object',\n name: 'latex',\n components: {preview: LatexPreview},\n fields: [\n {\n title: 'LaTeX content',\n name: 'body',\n type: 'text',\n },\n ],\n preview: {\n select: {\n body: 'body',\n },\n },\n})\n","import {definePlugin} from 'sanity'\n\nimport {latexSchema} from './schema'\n\nexport const latexInput = definePlugin({\n name: 'latex-block-plugin',\n schema: {\n types: [latexSchema],\n },\n})\n"],"mappings":";;;;;;AAYA,MAAaK,gBAAeC,UAAA;CAAA,IAAAC,IAAAC,EAAA,CAAA,GAC1BC,QAAcH,OAAKH,QAAL,IACdO,WAAiBJ,MAAKF,WAAY,UAKfO,KAAA,CAACD,UAAQE;CAAA,AAAAL,EAAA,OAAAE,SAAAF,EAAA,OAAAI,MADxBC,KAAAZ,eAAeS,OAAO;EAAAI,aACPF;EAASG,cACR;CAChB,CAAC,GAACP,EAAA,KAAAE,OAAAF,EAAA,KAAAI,IAAAJ,EAAA,KAAAK,MAAAA,KAAAL,EAAA;CALN,IAAAQ,OAEIH,IAKHI;CAMA,OANAT,EAAA,OAAAQ,QAAAR,EAAA,OAAAG,YAEMM,KACL,IADKN,WACL,SAEA,OAFA,EAA+B,yBAAA,EAAAO,QAASF,KAAI,EAAC,CAED,GAC7CR,EAAA,KAAAQ,MAAAR,EAAA,KAAAG,UAAAH,EAAA,KAAAS,MAAAA,KAAAT,EAAA,IAJMS;AAIN,GCTUY,cAAcV,WAAW;CACpCW,OAAO;CACPJ,MAAM;CACNK,MAAM;CACNC,YAAY,EAACC,SAASZ,aAAY;CAClCa,QAAQ,CACN;EACEJ,OAAO;EACPC,MAAM;EACNL,MAAM;CACR,CAAC;CAEHO,SAAS,EACPE,QAAQ,EACNC,MAAM,OACR,EACF;AACF,CAAC,GCjCY,aAAa,aAAa;CACrC,MAAM;CACN,QAAQ,EACN,OAAO,CAAC,WAAW,EACrB;AACF,CAAC"}
\ No newline at end of file
+{"version":3,"file":"index.js","names":["renderToString(latex, {\n displayMode: !isInline,\n throwOnError: false,\n })","!isInline","useMemo(\n () =>\n renderToString(latex, {\n displayMode: !isInline,\n throwOnError: false,\n }),\n [latex, isInline],\n )","isInline ? (\n <span dangerouslySetInnerHTML={{__html: html}} />\n ) : (\n <div dangerouslySetInnerHTML={{__html: html}} />\n )"],"sources":["../src/components/LatexPreview.tsx","../src/schema.ts","../src/plugin.tsx"],"sourcesContent":["import {renderToString} from 'katex'\nimport {useMemo} from 'react'\n\nimport 'katex/dist/katex.min.css'\n\nexport interface LatexPreviewProps {\n body?: string\n layout?: string\n}\n\n// KaTeX's renderToString sanitizes its output and does not execute scripts,\n// making it safe to use with dangerouslySetInnerHTML for trusted LaTeX source content.\nexport const LatexPreview = (props: LatexPreviewProps) => {\n const latex = props?.body || ''\n const isInline = props.layout === 'inline'\n\n const html = useMemo(\n () =>\n renderToString(latex, {\n displayMode: !isInline,\n throwOnError: false,\n }),\n [latex, isInline],\n )\n\n return isInline ? (\n <span dangerouslySetInnerHTML={{__html: html}} />\n ) : (\n <div dangerouslySetInnerHTML={{__html: html}} />\n )\n}\n","import {defineType, type ObjectDefinition} from 'sanity'\n\nimport {LatexPreview} from './components/LatexPreview'\n\nconst latexTypeName = 'latex' as const\n\n/**\n * @public\n */\nexport interface LatexDefinition extends Omit<ObjectDefinition, 'type' | 'fields'> {\n type: typeof latexTypeName\n}\n\ndeclare module 'sanity' {\n // makes type: 'latex' narrow correctly when using defineType/defineField/defineArrayMember\n export interface IntrinsicDefinitions {\n latex: LatexDefinition\n }\n}\n\nexport const latexSchema = defineType({\n title: 'Latex',\n type: 'object',\n name: 'latex',\n components: {preview: LatexPreview},\n fields: [\n {\n title: 'LaTeX content',\n name: 'body',\n type: 'text',\n },\n ],\n preview: {\n select: {\n body: 'body',\n },\n },\n})\n","import {definePlugin} from 'sanity'\n\nimport {latexSchema} from './schema'\n\nexport const latexInput = definePlugin({\n name: 'latex-block-plugin',\n schema: {\n types: [latexSchema],\n },\n})\n"],"mappings":";;;;;AAYA,MAAa,gBAAgB,UAA6B;eAClD,QAAQ,OAAO,QAAQ,IACvB,WAAW,MAAM,WAAW,UAKf,KAAA,CAAC,UADhBA;CAAe,AAAA,EAAA,OAAA,SAAA,EAAA,OACAC,MADf,KAAA,eAAe,OAAO;EACpB,aAAaA;EACb,cAAc;CAChB,CAAC,GAHc,EAAA,KAAA,OACAA,EAAAA,KAAAA;CAHnB,IAAM,OAAOC,IASNC;CAAP,OAC0C,EAAA,OAAA,QAAA,EAAA,OADnC,YACL,KAAA,IAAA,WAAC,SAEA,OAFD,EAAM,yBAAyB,EAAC,QAAQ,KAAI,EAAI,CAED,GAFP,EAAA,KAAA,MADnC,EAAA,KAAA,kCAAAA;AAKT,GCVa,cAAc,WAAW;CACpC,OAAO;CACP,MAAM;CACN,MAAM;CACN,YAAY,EAAC,SAAS,aAAY;CAClC,QAAQ,CACN;EACE,OAAO;EACP,MAAM;EACN,MAAM;CACR,CACF;CACA,SAAS,EACP,QAAQ,EACN,MAAM,OACR,EACF;AACF,CAAC,GCjCY,aAAa,aAAa;CACrC,MAAM;CACN,QAAQ,EACN,OAAO,CAAC,WAAW,EACrB;AACF,CAAC"}
\ No newline at end of file