codicent-app-sdk 0.3.110 → 0.3.111
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Markdown.d.ts","sourceRoot":"","sources":["../../../src/components/Markdown.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Markdown.d.ts","sourceRoot":"","sources":["../../../src/components/Markdown.tsx"],"names":[],"mappings":"AAkHA,QAAA,MAAM,QAAQ,gBAAiB;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,4CAsEjD,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("./MermaidChart.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("./MermaidChart.js"),t=require("react"),n=require("../node_modules/hast-util-sanitize/lib/schema.js"),a=require("../node_modules/@griffel/react/makeStyles.esm.js"),s=require("../node_modules/react-markdown/lib/index.js"),i=require("../node_modules/remark-gfm/lib/index.js"),o=require("../node_modules/rehype-raw/lib/index.js"),l=require("../node_modules/rehype-sanitize/lib/index.js");const d={...n.defaultSchema,tagNames:[...n.defaultSchema.tagNames||[],"iframe","small","br"],attributes:{...n.defaultSchema.attributes,iframe:["src","style","width","height","frameBorder","title","allow","allowFullScreen"],a:[...n.defaultSchema.attributes?.a||[],"target","rel","download"],p:[...n.defaultSchema.attributes?.p||[],"style"],div:[...n.defaultSchema.attributes?.div||[],"style"],small:["style"]},protocols:{...n.defaultSchema.protocols,src:["http","https"]}},c=a.makeStyles({markdownDiv:{"& ul":{paddingLeft:"8px",margin:"8px 0"},"& li":{marginLeft:"16px",marginBottom:"4px",marginTop:"4px"},"& a":{color:"inherit",textDecoration:"underline"}},htmlBlock:{width:"100%",minHeight:"100px",border:"none",backgroundColor:"transparent"}});class m extends t.Component{constructor(){super(...arguments),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,r){console.error("Markdown rendering error:",e,r)}render(){return this.state.hasError?e.jsx("div",{style:{color:"red"},children:"ERROR: failed to render markdown content"}):this.props.children}}const h=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&/Macintosh/.test(navigator.userAgent)&&!/iPhone|iPad|iPod/.test(navigator.userAgent),u=({html:r,className:t})=>{const n=`\n <!DOCTYPE html>\n <html>\n <head>\n <meta charset="utf-8">\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <style>\n body { \n margin: 0; \n padding: 8px;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;\n font-size: 14px;\n line-height: 1.5;\n }\n a { color: inherit; }\n </style>\n </head>\n <body>${r}</body>\n </html>\n `;return e.jsx("iframe",{srcDoc:n,className:t,sandbox:"allow-scripts allow-popups allow-popups-to-escape-sandbox",style:{width:"100%",minHeight:"100px",border:"none"},title:"HTML content"})};exports.default=({content:t})=>{const n=c();return e.jsx(m,{children:e.jsx("div",{className:n.markdownDiv,children:e.jsx(s.Markdown,{remarkPlugins:h?[]:[i.default],rehypePlugins:[o.default,[l.default,d]],components:{code({_node:t,inline:a,className:s,children:i,...o}){const l=/language-(\w+)/.exec(s||""),d=String(i).replace(/\n$/,"");return!a&&l&&"mermaid"===l[1]?e.jsx(r.default,{chart:d}):!a&&l&&"html"===l[1]?e.jsx(u,{html:d,className:n.htmlBlock}):e.jsx("code",{className:s,...o,children:i})},a:({href:r,children:t,...n})=>r?e.jsx("a",{href:r,rel:"noopener noreferrer",...n,children:t}):e.jsx(e.Fragment,{children:t}),...h&&{text:({children:r})=>{if("string"!=typeof r)return e.jsx(e.Fragment,{children:r});const t=/https?:\/\/[^\s<>[\]{}|\\^]+/g,n=r.split(t),a=r.match(t)||[];return 0===a.length?e.jsx(e.Fragment,{children:r}):e.jsx(e.Fragment,{children:n.map(((r,t)=>e.jsxs(e.Fragment,{children:[r,a[t]&&e.jsx("a",{href:a[t],rel:"noopener noreferrer",children:a[t]})]})))})}}},children:t})})})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Markdown.d.ts","sourceRoot":"","sources":["../../../src/components/Markdown.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Markdown.d.ts","sourceRoot":"","sources":["../../../src/components/Markdown.tsx"],"names":[],"mappings":"AAkHA,QAAA,MAAM,QAAQ,gBAAiB;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,4CAsEjD,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as e,Fragment as r,jsxs as t}from"react/jsx-runtime";import n from"./MermaidChart.js";import{Component as o}from"react";import{defaultSchema as a}from"../node_modules/hast-util-sanitize/lib/schema.js";import{makeStyles as i}from"../node_modules/@griffel/react/makeStyles.esm.js";import{Markdown as s}from"../node_modules/react-markdown/lib/index.js";import l from"../node_modules/remark-gfm/lib/index.js";import d from"../node_modules/rehype-raw/lib/index.js";import m from"../node_modules/rehype-sanitize/lib/index.js";const c={...a,tagNames:[...a.tagNames||[],"iframe","small","br"],attributes:{...a.attributes,iframe:["src","style","width","height","frameBorder","title","allow","allowFullScreen"],a:[...a.attributes?.a||[],"target","rel","download"],p:[...a.attributes?.p||[],"style"],div:[...a.attributes?.div||[],"style"],small:["style"]},protocols:{...a.protocols,src:["http","https"]}},h=i({markdownDiv:{"& ul":{paddingLeft:"8px",margin:"8px 0"},"& li":{marginLeft:"16px",marginBottom:"4px",marginTop:"4px"},"& a":{color:"inherit",textDecoration:"underline"}},htmlBlock:{width:"100%",minHeight:"100px",border:"none",backgroundColor:"transparent"}});class p extends o{constructor(){super(...arguments),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,r){console.error("Markdown rendering error:",e,r)}render(){return this.state.hasError?e("div",{style:{color:"red"},children:"ERROR: failed to render markdown content"}):this.props.children}}const u=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&/Macintosh/.test(navigator.userAgent)&&!/iPhone|iPad|iPod/.test(navigator.userAgent),g=({html:r,className:t})=>e("iframe",{srcDoc:`\n <!DOCTYPE html>\n <html>\n <head>\n <meta charset="utf-8">\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <style>\n body { \n margin: 0; \n padding: 8px;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;\n font-size: 14px;\n line-height: 1.5;\n }\n a { color: inherit; }\n </style>\n </head>\n <body>${r}</body>\n </html>\n `,className:t,sandbox:"allow-scripts allow-popups allow-popups-to-escape-sandbox",style:{width:"100%",minHeight:"100px",border:"none"},title:"HTML content"}),f=({content:o})=>{const a=h();return e(p,{children:e("div",{className:a.markdownDiv,children:e(s,{remarkPlugins:u?[]:[l],rehypePlugins:[d,[m,c]],components:{code({_node:r,inline:t,className:o,children:i,...s}){const l=/language-(\w+)/.exec(o||""),d=String(i).replace(/\n$/,"");return!t&&l&&"mermaid"===l[1]?e(n,{chart:d}):!t&&l&&"html"===l[1]?e(g,{html:d,className:a.htmlBlock}):e("code",{className:o,...s,children:i})},a:({href:t,children:n,...o})=>t?e("a",{href:t,rel:"noopener noreferrer",...o,children:n}):e(r,{children:n}),...u&&{text:({children:n})=>{if("string"!=typeof n)return e(r,{children:n});const o=/https?:\/\/[^\s<>[\]{}|\\^]+/g,a=n.split(o),i=n.match(o)||[];return 0===i.length?e(r,{children:n}):e(r,{children:a.map(((n,o)=>t(r,{children:[n,i[o]&&e("a",{href:i[o],rel:"noopener noreferrer",children:i[o]})]})))})}}},children:o})})})};export{f as default};
|