sanity-plugin-latex-input
3.0.83.0.9
dist/index.js.map~
dist/index.js.mapModified+1−1
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