pi-deck 0.1.2 → 0.1.3
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.
- package/package.json +1 -1
- package/packages/client/dist/assets/MarkdownContent-CJeDwkyO.js +2 -0
- package/packages/client/dist/assets/index-DoQPGtrm.js +354 -0
- package/packages/client/dist/assets/index-FJKlxeM7.css +1 -0
- package/packages/client/dist/index.html +3 -3
- package/dist/server.js +0 -7322
- package/dist/server.js.map +0 -7
- package/packages/client/dist/assets/MarkdownContent-CaLXPq7W.js +0 -2
- package/packages/client/dist/assets/index-C6QC_auV.js +0 -437
- package/packages/client/dist/assets/index-Uft_WPvr.css +0 -1
package/package.json
CHANGED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as f,j as s,h as w,o as d,M as j,a as y}from"./index-DoQPGtrm.js";const N=new Set(["ts","tsx","js","jsx","json","md","py","go","rs","java","c","cpp","h","css","html","yml","yaml","sh","zsh","toml","txt"]);function g(n){return n?/^www\./i.test(n)?!0:/^(https?:|mailto:|tel:)/i.test(n):!1}function h(n){var e;if(!n||n.startsWith("#")||g(n))return!1;const r=n.replace(/^file:\/\//i,"").split(/[?#]/)[0],a=r.includes(".")?(e=r.split(".").pop())==null?void 0:e.toLowerCase():"",t=!!(a&&N.has(a));return r.startsWith("/")||r.startsWith("./")||r.startsWith("../")||r.startsWith("~")||r.includes("/")||t}const k=/(?:\.\.?\/[\w./@-]+(?:\/[\w./@-]+)*|~\/[\w./@-]+(?:\/[\w./@-]+)*|\/[\w./@-]+(?:\/[\w./@-]+)+)/g;function m(n){if(typeof n=="string"){const i=[];let r=0,a;const t=new RegExp(k.source,"g");for(;(a=t.exec(n))!==null;){let e=a[0];for(;/[.,;:!?)}\]>]$/.test(e)&&e.length>1;)e=e.slice(0,-1);a.index>r&&i.push(n.slice(r,a.index));const o=e;i.push(s.jsx("button",{type:"button",className:"text-pi-accent hover:underline cursor-pointer bg-transparent border-none p-0 font-inherit text-inherit text-left inline",onClick:()=>window.dispatchEvent(new CustomEvent("pi:openFile",{detail:{path:o}})),title:`Open ${o}`,children:e},`fp-${a.index}`)),r=a.index+e.length}return i.length===0?n:(r<n.length&&i.push(n.slice(r)),i)}return Array.isArray(n)?n.map((i,r)=>{const a=m(i);return Array.isArray(a)?s.jsx("span",{children:a},r):a}):n}const v={...d,'pre[class*="language-"]':{...d['pre[class*="language-"]'],background:"#161b22",margin:0,padding:"12px",borderRadius:"4px",fontSize:"13px"},'code[class*="language-"]':{...d['code[class*="language-"]'],background:"transparent",fontSize:"13px"}},F=f.memo(function({content:i,className:r=""}){const a=f.useMemo(()=>({pre({children:t,...e}){return s.jsx("div",{className:"my-2",...e,children:t})},code({node:t,className:e,children:o,...l}){const p=/language-(\w+)/.exec(e||""),c=p?p[1]:"",b=String(o).replace(/\n$/,"");if(c||b.includes(`
|
|
2
|
+
`))return c?s.jsx(w,{style:v,language:c,PreTag:"div",...l,children:b}):s.jsx("pre",{className:"bg-[#161b22] p-3 rounded overflow-x-auto text-[13px]",children:s.jsx("code",{className:"text-pi-text",children:o})});const u=String(o);return h(u)?s.jsx("code",{className:"bg-[#161b22] px-1.5 py-0.5 rounded text-[13px] text-pi-accent hover:underline cursor-pointer",role:"button",tabIndex:0,title:`Open ${u}`,onClick:()=>{window.dispatchEvent(new CustomEvent("pi:openFile",{detail:{path:u}}))},onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),window.dispatchEvent(new CustomEvent("pi:openFile",{detail:{path:u}})))},...l,children:o}):s.jsx("code",{className:"bg-[#161b22] px-1.5 py-0.5 rounded text-[13px] text-pi-text",...l,children:o})},a({href:t,children:e,...o}){const l=g(t),p=h(t);return s.jsx("a",{href:t,target:l?"_blank":void 0,rel:l?"noopener noreferrer":void 0,className:"text-pi-accent hover:underline",onClick:c=>{!p||!t||(c.preventDefault(),window.dispatchEvent(new CustomEvent("pi:openFile",{detail:{path:t}})))},...o,children:e})},p({children:t,...e}){return s.jsx("p",{className:"mb-2 last:mb-0",...e,children:m(t)})},h1({children:t,...e}){return s.jsx("h1",{className:"text-lg font-semibold mb-2 mt-3 first:mt-0",...e,children:t})},h2({children:t,...e}){return s.jsx("h2",{className:"text-base font-semibold mb-2 mt-3 first:mt-0",...e,children:t})},h3({children:t,...e}){return s.jsx("h3",{className:"text-[14px] font-semibold mb-1 mt-2 first:mt-0",...e,children:t})},ul({children:t,...e}){return s.jsx("ul",{className:"list-disc pl-5 mb-2 space-y-0.5",...e,children:t})},ol({children:t,...e}){return s.jsx("ol",{className:"list-decimal pl-5 mb-2 space-y-0.5",...e,children:t})},li({children:t,...e}){return s.jsx("li",{className:"text-pi-text pl-1",...e,children:m(t)})},blockquote({children:t,...e}){return s.jsx("blockquote",{className:"border-l-2 border-pi-border pl-3 my-2 text-pi-muted italic",...e,children:t})},hr({...t}){return s.jsx("hr",{className:"border-pi-border my-3",...t})},table({children:t,...e}){return s.jsx("div",{className:"overflow-x-auto my-2",children:s.jsx("table",{className:"min-w-full border-collapse text-[13px]",...e,children:t})})},th({children:t,...e}){return s.jsx("th",{className:"border border-pi-border px-3 py-1.5 bg-pi-surface text-left font-semibold",...e,children:t})},td({children:t,...e}){return s.jsx("td",{className:"border border-pi-border px-3 py-1.5",...e,children:t})}}),[]);return s.jsx("div",{className:`markdown-content text-pi-text text-[14px] leading-relaxed ${r}`,children:s.jsx(j,{remarkPlugins:[y],components:a,children:i})})});export{F as MarkdownContent};
|