@popmelt.com/core 0.5.21 → 0.5.22

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
@@ -35,7 +35,7 @@ Your AI gets the visual and technical context it needs to act.`,usage:[],keys:[{
35
35
  color: initial;
36
36
  -webkit-font-smoothing: auto;
37
37
  }
38
- `;function Na({children:e}){return gf(ff,{children:[pf("style",{children:uf}),e]})}import{useEffect as mf,useLayoutEffect as hf,useRef as yf,useState as Ha}from"react";import{createPortal as bf}from"react-dom";import{Fragment as wf,jsx as Sf,jsxs as Cf}from"react/jsx-runtime";function xf(e){return e.tagName==="STYLE"||e.tagName==="LINK"&&e.rel==="stylesheet"}function vf(e){let t=new Map,n=e.firstChild;function r(s){if(t.has(s)||s.hasAttribute("data-pm-mirror"))return;let l=s.cloneNode(!0);l.setAttribute("data-pm-mirror",""),e.insertBefore(l,n),t.set(s,l)}function o(s){let l=t.get(s);l&&(l.remove(),t.delete(s))}for(let s of document.querySelectorAll('link[rel="stylesheet"], style'))s.getRootNode()===document&&r(s);try{document.adoptedStyleSheets.length>0&&(e.adoptedStyleSheets=[...document.adoptedStyleSheets,...e.adoptedStyleSheets])}catch(s){}let i=new MutationObserver(s=>{for(let l of s)if(l.type==="childList"){for(let a of l.addedNodes)a instanceof Element&&xf(a)&&r(a);for(let a of l.removedNodes)a instanceof Element&&o(a)}});return i.observe(document.head,{childList:!0}),document.body&&i.observe(document.body,{childList:!0}),()=>{i.disconnect();for(let s of t.values())s.remove();t.clear()}}function Fa({children:e}){let t=yf(null),[n,r]=Ha(null),[o,i]=Ha(null);return hf(()=>{let s=t.current;if(!s||s.shadowRoot)return;let l=s.attachShadow({mode:"open"}),a=document.createElement("div");a.setAttribute("data-popmelt-root",""),l.appendChild(a),r(l),i(a)},[]),mf(()=>{if(n)return vf(n)},[n]),Cf(wf,{children:[Sf("div",{ref:t,"data-popmelt-shadow-host":!0,style:{position:"absolute",width:0,height:0,overflow:"visible"}}),o&&bf(e,o)]})}import{useCallback as $r,useEffect as Un,useRef as Hn,useState as mo}from"react";import{Fragment as If,jsx as St}from"react/jsx-runtime";var _a="ui-monospace, SFMono-Regular, Menlo, monospace",Ef=/^#[0-9a-fA-F]{3,8}$/,kf=/^(?:rgba?|hsla?|oklch)\([^)]+\)$/,Mf=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 Tf(e){let t=e.trim();return Ef.test(t)||kf.test(t)||Mf.has(t.toLowerCase())}function as(e,t){return St("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 or(e){let t=[],n=/(`[^`]+`)|(\*\*\*(.+?)\*\*\*)|(\*\*(.+?)\*\*)|(\*(.+?)\*)|(_([^_]+?)_)|(\[([^\]]+)\]\(([^)]+)\))|(#[0-9a-fA-F]{3,8})(?![0-9a-fA-F])|((?:rgba?|hsla?|oklch)\([^)]+\))/g,r=0,o;for(;(o=n.exec(e))!==null;){if(o.index>r&&t.push(e.slice(r,o.index)),o[1]){let i=o[1].slice(1,-1);Tf(i)&&t.push(as(i,`sw-${o.index}`)),t.push(St("code",{style:{fontFamily:_a,fontSize:"0.9em",backgroundColor:"rgba(0,0,0,0.06)",padding:"1px 4px",borderRadius:2},children:i},o.index))}else o[3]!==void 0?t.push(St("strong",{children:St("em",{children:o[3]})},o.index)):o[5]!==void 0?t.push(St("strong",{children:o[5]},o.index)):o[7]!==void 0?t.push(St("em",{children:o[7]},o.index)):o[9]!==void 0?t.push(St("em",{children:o[9]},o.index)):o[11]!==void 0&&o[12]!==void 0?t.push(St("a",{href:o[12],target:"_blank",rel:"noopener noreferrer",style:{color:"inherit",textDecoration:"underline"},children:o[11]},o.index)):o[13]!==void 0?(t.push(as(o[13],`sw-${o.index}`)),t.push(o[13])):o[14]!==void 0&&(t.push(as(o[14],`sw-${o.index}`)),t.push(o[14]));r=o.index+o[0].length}return r<e.length&&t.push(e.slice(r)),t}function zr(e){var o;let t=e.split(`
38
+ `;function Na({children:e}){return gf(ff,{children:[pf("style",{children:uf}),e]})}import{useEffect as mf,useLayoutEffect as hf,useRef as yf,useState as Ha}from"react";import{createPortal as bf}from"react-dom";import{Fragment as wf,jsx as Sf,jsxs as Cf}from"react/jsx-runtime";function xf(e){return e.tagName==="STYLE"||e.tagName==="LINK"&&e.rel==="stylesheet"}function vf(e){let t=new Map,n=e.firstChild;function r(s){if(t.has(s)||s.hasAttribute("data-pm-mirror"))return;let l=s.cloneNode(!0);l.setAttribute("data-pm-mirror",""),e.insertBefore(l,n),t.set(s,l)}function o(s){let l=t.get(s);l&&(l.remove(),t.delete(s))}for(let s of document.querySelectorAll('link[rel="stylesheet"], style'))s.getRootNode()===document&&r(s);try{document.adoptedStyleSheets.length>0&&(e.adoptedStyleSheets=[...document.adoptedStyleSheets,...e.adoptedStyleSheets])}catch(s){}let i=new MutationObserver(s=>{for(let l of s)if(l.type==="childList"){for(let a of l.addedNodes)a instanceof Element&&xf(a)&&r(a);for(let a of l.removedNodes)a instanceof Element&&o(a)}});return i.observe(document.head,{childList:!0}),document.body&&i.observe(document.body,{childList:!0}),()=>{i.disconnect();for(let s of t.values())s.remove();t.clear()}}function Fa({children:e}){let t=yf(null),[n,r]=Ha(null),[o,i]=Ha(null);return hf(()=>{let s=t.current;if(!s||s.shadowRoot)return;let l=s.attachShadow({mode:"open"}),a=document.createElement("div");a.setAttribute("data-popmelt-root",""),l.appendChild(a),r(l),i(a)},[]),mf(()=>{if(n)return vf(n)},[n]),Cf(wf,{children:[Sf("div",{ref:t,"data-popmelt-shadow-host":!0,style:{position:"absolute",width:0,height:0,overflow:"visible",zIndex:1e4}}),o&&bf(e,o)]})}import{useCallback as $r,useEffect as Un,useRef as Hn,useState as mo}from"react";import{Fragment as If,jsx as St}from"react/jsx-runtime";var _a="ui-monospace, SFMono-Regular, Menlo, monospace",Ef=/^#[0-9a-fA-F]{3,8}$/,kf=/^(?:rgba?|hsla?|oklch)\([^)]+\)$/,Mf=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 Tf(e){let t=e.trim();return Ef.test(t)||kf.test(t)||Mf.has(t.toLowerCase())}function as(e,t){return St("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 or(e){let t=[],n=/(`[^`]+`)|(\*\*\*(.+?)\*\*\*)|(\*\*(.+?)\*\*)|(\*(.+?)\*)|(_([^_]+?)_)|(\[([^\]]+)\]\(([^)]+)\))|(#[0-9a-fA-F]{3,8})(?![0-9a-fA-F])|((?:rgba?|hsla?|oklch)\([^)]+\))/g,r=0,o;for(;(o=n.exec(e))!==null;){if(o.index>r&&t.push(e.slice(r,o.index)),o[1]){let i=o[1].slice(1,-1);Tf(i)&&t.push(as(i,`sw-${o.index}`)),t.push(St("code",{style:{fontFamily:_a,fontSize:"0.9em",backgroundColor:"rgba(0,0,0,0.06)",padding:"1px 4px",borderRadius:2},children:i},o.index))}else o[3]!==void 0?t.push(St("strong",{children:St("em",{children:o[3]})},o.index)):o[5]!==void 0?t.push(St("strong",{children:o[5]},o.index)):o[7]!==void 0?t.push(St("em",{children:o[7]},o.index)):o[9]!==void 0?t.push(St("em",{children:o[9]},o.index)):o[11]!==void 0&&o[12]!==void 0?t.push(St("a",{href:o[12],target:"_blank",rel:"noopener noreferrer",style:{color:"inherit",textDecoration:"underline"},children:o[11]},o.index)):o[13]!==void 0?(t.push(as(o[13],`sw-${o.index}`)),t.push(o[13])):o[14]!==void 0&&(t.push(as(o[14],`sw-${o.index}`)),t.push(o[14]));r=o.index+o[0].length}return r<e.length&&t.push(e.slice(r)),t}function zr(e){var o;let t=e.split(`
39
39
  `),n=[],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++,n.push(St("pre",{style:{fontFamily:_a,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(`
40
40
  `)},n.length));continue}if(/^(-{3,}|\*{3,}|_{3,})\s*$/.test(i)){n.push(St("hr",{style:{border:"none",borderTop:"1px solid rgba(0,0,0,0.1)",margin:"6px 0"}},n.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};n.push(St("div",{style:{fontWeight:700,fontSize:(o=d[c])!=null?o:12,margin:"8px 0 2px"},children:or(s[2])},n.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=E=>/^\|[\s\-:|]+\|$/.test(E),u=c.filter(E=>!d(E)),p=E=>E.split("|").slice(1,-1).map(D=>D.trim()),g=E=>/^\*\*.+\*\*$/.test(E)||/^__.+__$/.test(E),M=u.map(p),C=M.length>1&&M.slice(1).every(E=>E[0]&&g(E[0])),b=M.length>0&&M[0].every(E=>g(E));n.push(St("div",{style:{overflowX:"auto",margin:"4px 0",paddingBottom:4},children:St("table",{style:{borderCollapse:"separate",borderSpacing:0,fontSize:"0.95em",width:"max-content",minWidth:"100%"},children:St("tbody",{children:u.map((E,D)=>St("tr",{children:p(E).map((A,R)=>St(D===0?"th":"td",{style:f({border:"1px solid rgba(0,0,0,0.1)",padding:"3px 6px",textAlign:"left",fontWeight:D===0?600:400,minWidth:60,whiteSpace:"nowrap"},R===0&&C||D===0&&b?y(f(f({position:"sticky"},R===0&&C?{left:0}:{}),D===0&&b?{top:0}:{}),{background:"#fff",zIndex:R===0&&C&&D===0&&b?2:1}):{}),children:or(A)},R))},D))})})},n.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(St("li",{children:or(d[1])},c.length)),r++}n.push(St("ul",{style:{margin:"2px 0",paddingLeft:20},children:c},n.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(St("li",{children:or(d[1])},c.length)),r++}n.push(St("ol",{style:{margin:"2px 0",paddingLeft:20},children:c},n.length));continue}if(i.trim()===""){n.push(St("div",{style:{height:4}},n.length)),r++;continue}n.push(St("div",{style:{margin:"2px 0"},children:or(i)},n.length)),r++}return St(If,{children:n})}import{Fragment as Wr,jsx as He,jsxs as xt}from"react/jsx-runtime";var Ya=400,Fo=16,ja=3,Rf=3,Ga=4,Lf=8,cs="devtools-thread-panel-position",ps=Ya+2*ja+2*Ga,Af=ps+2*Rf;function ds(){return{top:Fo,left:window.innerWidth-ps-Fo}}function za(e,t,n){let r=n==null?void 0:n.getBoundingClientRect(),o=2*ja+2*Ga,i=window.innerHeight-Fo-o;return r&&t+Af>r.left&&(i=r.top-Lf-o),Math.max(200,i-Math.max(0,e))}var Pf={width:Ya,backgroundColor:"#eaeaea",borderWidth:3,borderStyle:"solid",borderColor:"transparent",boxSizing:"content-box",display:"flex",flexDirection:"column",overflow:"visible",padding:4,fontFamily:Ft,fontSize:12,color:"#1f2937",pointerEvents:"auto"},Bf={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"4px 5px 4px 10px",margin:0,fontWeight:600,fontSize:12,overflow:"hidden"},Of={flex:1,overflowY:"auto",padding:"8px 0",scrollbarWidth:"none"},Df=`
41
41
  [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.21",
3
+ "version": "0.5.22",
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)",