@popmelt.com/core 0.5.14 → 0.5.15

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.
Files changed (2) hide show
  1. package/dist/index.mjs +1 -1
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -22,7 +22,7 @@ Your AI gets the visual and technical context it needs to act.`,usage:[],keys:[{
22
22
  line-height: 1.5;
23
23
  -webkit-font-smoothing: antialiased;
24
24
  }
25
- `;function ta({children:e}){return lp(sp,{children:[ip("style",{children:rp}),e]})}import{useEffect as ap,useLayoutEffect as cp,useRef as na}from"react";import{createRoot as dp}from"react-dom/client";import{Fragment as up,jsx as oa}from"react/jsx-runtime";function ra({children:e}){let t=na(null),o=na(null);return ap(()=>{let r=t.current;if(!r||r.shadowRoot)return;let n=r.attachShadow({mode:"open"}),i=document.createElement("div");return i.setAttribute("data-popmelt-root",""),n.appendChild(i),o.current=dp(i),()=>{var s;(s=o.current)==null||s.unmount(),o.current=null}},[]),cp(()=>{var r;(r=o.current)==null||r.render(oa(up,{children:e}))}),oa("div",{ref:t,"data-popmelt-shadow-host":!0,style:{display:"contents"}})}import{useCallback as Cr,useEffect as _n,useRef as On,useState as no}from"react";import{Fragment as hp,jsx as Et}from"react/jsx-runtime";var ia="ui-monospace, SFMono-Regular, Menlo, monospace",pp=/^#[0-9a-fA-F]{3,8}$/,fp=/^(?:rgba?|hsla?|oklch)\([^)]+\)$/,gp=new Set(["black","white","red","blue","green","yellow","orange","purple","pink","gray","grey","cyan","magenta","brown","navy","teal","maroon","olive","silver","aqua","fuchsia","lime"]);function mp(e){let t=e.trim();return pp.test(t)||fp.test(t)||gp.has(t.toLowerCase())}function Wi(e,t){return Et("span",{style:{display:"inline-block",width:10,height:10,backgroundColor:e,border:"1px solid rgba(0,0,0,0.15)",borderRadius:2,verticalAlign:"middle",marginRight:3}},t)}function Vo(e){let t=[],o=/(`[^`]+`)|(\*\*\*(.+?)\*\*\*)|(\*\*(.+?)\*\*)|(\*(.+?)\*)|(_([^_]+?)_)|(\[([^\]]+)\]\(([^)]+)\))|(#[0-9a-fA-F]{3,8})(?![0-9a-fA-F])|((?:rgba?|hsla?|oklch)\([^)]+\))/g,r=0,n;for(;(n=o.exec(e))!==null;){if(n.index>r&&t.push(e.slice(r,n.index)),n[1]){let i=n[1].slice(1,-1);mp(i)&&t.push(Wi(i,`sw-${n.index}`)),t.push(Et("code",{style:{fontFamily:ia,fontSize:"0.9em",backgroundColor:"rgba(0,0,0,0.06)",padding:"1px 4px",borderRadius:2},children:i},n.index))}else n[3]!==void 0?t.push(Et("strong",{children:Et("em",{children:n[3]})},n.index)):n[5]!==void 0?t.push(Et("strong",{children:n[5]},n.index)):n[7]!==void 0?t.push(Et("em",{children:n[7]},n.index)):n[9]!==void 0?t.push(Et("em",{children:n[9]},n.index)):n[11]!==void 0&&n[12]!==void 0?t.push(Et("a",{href:n[12],target:"_blank",rel:"noopener noreferrer",style:{color:"inherit",textDecoration:"underline"},children:n[11]},n.index)):n[13]!==void 0?(t.push(Wi(n[13],`sw-${n.index}`)),t.push(n[13])):n[14]!==void 0&&(t.push(Wi(n[14],`sw-${n.index}`)),t.push(n[14]));r=n.index+n[0].length}return r<e.length&&t.push(e.slice(r)),t}function kr(e){var n;let t=e.split(`
25
+ `;function ta({children:e}){return lp(sp,{children:[ip("style",{children:rp}),e]})}import{useEffect as ap,useLayoutEffect as cp,useRef as na}from"react";import{createRoot as dp}from"react-dom/client";import{Fragment as up,jsx as oa}from"react/jsx-runtime";function ra({children:e}){let t=na(null),o=na(null);return ap(()=>{let r=t.current;if(!r||r.shadowRoot)return;let n=r.attachShadow({mode:"open"}),i=document.createElement("div");return i.setAttribute("data-popmelt-root",""),n.appendChild(i),o.current=dp(i),()=>{let s=o.current;o.current=null,setTimeout(()=>s==null?void 0:s.unmount(),0)}},[]),cp(()=>{var r;(r=o.current)==null||r.render(oa(up,{children:e}))}),oa("div",{ref:t,"data-popmelt-shadow-host":!0,style:{display:"contents"}})}import{useCallback as Cr,useEffect as _n,useRef as On,useState as no}from"react";import{Fragment as hp,jsx as Et}from"react/jsx-runtime";var ia="ui-monospace, SFMono-Regular, Menlo, monospace",pp=/^#[0-9a-fA-F]{3,8}$/,fp=/^(?:rgba?|hsla?|oklch)\([^)]+\)$/,gp=new Set(["black","white","red","blue","green","yellow","orange","purple","pink","gray","grey","cyan","magenta","brown","navy","teal","maroon","olive","silver","aqua","fuchsia","lime"]);function mp(e){let t=e.trim();return pp.test(t)||fp.test(t)||gp.has(t.toLowerCase())}function Wi(e,t){return Et("span",{style:{display:"inline-block",width:10,height:10,backgroundColor:e,border:"1px solid rgba(0,0,0,0.15)",borderRadius:2,verticalAlign:"middle",marginRight:3}},t)}function Vo(e){let t=[],o=/(`[^`]+`)|(\*\*\*(.+?)\*\*\*)|(\*\*(.+?)\*\*)|(\*(.+?)\*)|(_([^_]+?)_)|(\[([^\]]+)\]\(([^)]+)\))|(#[0-9a-fA-F]{3,8})(?![0-9a-fA-F])|((?:rgba?|hsla?|oklch)\([^)]+\))/g,r=0,n;for(;(n=o.exec(e))!==null;){if(n.index>r&&t.push(e.slice(r,n.index)),n[1]){let i=n[1].slice(1,-1);mp(i)&&t.push(Wi(i,`sw-${n.index}`)),t.push(Et("code",{style:{fontFamily:ia,fontSize:"0.9em",backgroundColor:"rgba(0,0,0,0.06)",padding:"1px 4px",borderRadius:2},children:i},n.index))}else n[3]!==void 0?t.push(Et("strong",{children:Et("em",{children:n[3]})},n.index)):n[5]!==void 0?t.push(Et("strong",{children:n[5]},n.index)):n[7]!==void 0?t.push(Et("em",{children:n[7]},n.index)):n[9]!==void 0?t.push(Et("em",{children:n[9]},n.index)):n[11]!==void 0&&n[12]!==void 0?t.push(Et("a",{href:n[12],target:"_blank",rel:"noopener noreferrer",style:{color:"inherit",textDecoration:"underline"},children:n[11]},n.index)):n[13]!==void 0?(t.push(Wi(n[13],`sw-${n.index}`)),t.push(n[13])):n[14]!==void 0&&(t.push(Wi(n[14],`sw-${n.index}`)),t.push(n[14]));r=n.index+n[0].length}return r<e.length&&t.push(e.slice(r)),t}function kr(e){var n;let t=e.split(`
26
26
  `),o=[],r=0;for(;r<t.length;){let i=t[r];if(i.trimStart().startsWith("```")){let c=[];for(r++;r<t.length&&!t[r].trimStart().startsWith("```");)c.push(t[r]),r++;r++,o.push(Et("pre",{style:{fontFamily:ia,fontSize:"0.9em",lineHeight:1.4,backgroundColor:"rgba(0,0,0,0.04)",padding:"6px 8px",margin:"4px 0",overflowX:"auto",whiteSpace:"pre"},children:c.join(`
27
27
  `)},o.length));continue}if(/^(-{3,}|\*{3,}|_{3,})\s*$/.test(i)){o.push(Et("hr",{style:{border:"none",borderTop:"1px solid rgba(0,0,0,0.1)",margin:"6px 0"}},o.length)),r++;continue}let s=i.match(/^(#{1,4})\s+(.+)/);if(s){let c=s[1].length,d={1:16,2:14,3:13,4:12};o.push(Et("div",{style:{fontWeight:700,fontSize:(n=d[c])!=null?n:12,margin:"8px 0 2px"},children:Vo(s[2])},o.length)),r++;continue}if(i.trimStart().startsWith("|")&&i.trimEnd().endsWith("|")){let c=[];for(;r<t.length&&t[r].trimStart().startsWith("|")&&t[r].trimEnd().endsWith("|");)c.push(t[r]),r++;let d=w=>/^\|[\s\-:|]+\|$/.test(w),u=c.filter(w=>!d(w)),p=w=>w.split("|").slice(1,-1).map(O=>O.trim()),g=w=>/^\*\*.+\*\*$/.test(w)||/^__.+__$/.test(w),S=u.map(p),v=S.length>1&&S.slice(1).every(w=>w[0]&&g(w[0])),y=S.length>0&&S[0].every(w=>g(w));o.push(Et("div",{style:{overflowX:"auto",margin:"4px 0",paddingBottom:4},children:Et("table",{style:{borderCollapse:"separate",borderSpacing:0,fontSize:"0.95em",width:"max-content",minWidth:"100%"},children:Et("tbody",{children:u.map((w,O)=>Et("tr",{children:p(w).map((A,C)=>Et(O===0?"th":"td",{style:f({border:"1px solid rgba(0,0,0,0.1)",padding:"3px 6px",textAlign:"left",fontWeight:O===0?600:400,minWidth:60,whiteSpace:"nowrap"},C===0&&v||O===0&&y?m(f(f({position:"sticky"},C===0&&v?{left:0}:{}),O===0&&y?{top:0}:{}),{background:"#fff",zIndex:C===0&&v&&O===0&&y?2:1}):{}),children:Vo(A)},C))},O))})})},o.length));continue}if(i.match(/^(\s*)([-*])\s+(.+)/)){let c=[];for(;r<t.length&&/^\s*[-*]\s+/.test(t[r]);){let d=t[r].match(/^\s*[-*]\s+(.+)/);d&&c.push(Et("li",{children:Vo(d[1])},c.length)),r++}o.push(Et("ul",{style:{margin:"2px 0",paddingLeft:20},children:c},o.length));continue}if(i.match(/^(\s*)\d+\.\s+(.+)/)){let c=[];for(;r<t.length&&/^\s*\d+\.\s+/.test(t[r]);){let d=t[r].match(/^\s*\d+\.\s+(.+)/);d&&c.push(Et("li",{children:Vo(d[1])},c.length)),r++}o.push(Et("ol",{style:{margin:"2px 0",paddingLeft:20},children:c},o.length));continue}if(i.trim()===""){o.push(Et("div",{style:{height:4}},o.length)),r++;continue}o.push(Et("div",{style:{margin:"2px 0"},children:Vo(i)},o.length)),r++}return Et(hp,{children:o})}import{Fragment as Vi,jsx as ze,jsxs as Nt}from"react/jsx-runtime";var Mr=400,Ro=16,Ui=3,yp=16,Yi="devtools-thread-panel-position";function ji(){return{top:Ro,left:window.innerWidth-Mr-2*Ui-Ro}}function sa(e,t,o){let r=o==null?void 0:o.getBoundingClientRect(),n=window.innerHeight-Ro;return r&&t+Mr+2*Ui>r.left&&(n=r.top-yp),Math.max(200,n-Math.max(0,e))}var bp=m(f({width:Mr,backgroundColor:"#ffffff"},bn),{boxSizing:"content-box",display:"flex",flexDirection:"column",overflow:"hidden",fontFamily:$t,fontSize:12,color:"#1f2937",pointerEvents:"auto"}),xp={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"4px 5px 4px 10px",margin:"3px 3px 0",fontWeight:600,fontSize:12},vp={flex:1,overflowY:"auto",padding:"8px 0",scrollbarWidth:"none"},Sp=`
28
28
  [data-devtools="thread-panel-messages"]:hover {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@popmelt.com/core",
3
- "version": "0.5.14",
3
+ "version": "0.5.15",
4
4
  "description": "The design collaboration layer for AI coding agents",
5
5
  "license": "PolyForm-Shield-1.0.0",
6
6
  "author": "Popmelt <hello@popmelt.com> (https://popmelt.com)",