@popmelt.com/core 0.33.0 → 0.34.0

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 (146) hide show
  1. package/README.md +24 -1
  2. package/claude-plugin/.claude-plugin/plugin.json +1 -1
  3. package/codex-plugin/.codex-plugin/plugin.json +1 -1
  4. package/dist/ExploreAttachment-BG7ZOQSA.mjs +1 -0
  5. package/dist/PagePreviewLayer-CBDGPMJQ.mjs +1 -0
  6. package/dist/ParticipantRuntime-FSZX2PUQ.mjs +1 -0
  7. package/dist/PhoneHostGate-OM7FLOJ2.mjs +1 -0
  8. package/dist/PopmeltTasteConnectedPane-KJSBPJQR.mjs +1 -0
  9. package/dist/PreviewRuntime-EYKB7MG5.mjs +1 -0
  10. package/dist/QueuedReplies-ZYUDSTS2.mjs +1 -46
  11. package/dist/SuppliedContext-7THB2WZY.mjs +1 -0
  12. package/dist/ThreadErrorCard-J2VTA5JW.mjs +1 -0
  13. package/dist/ThreadPanel-PNVMIIYJ.mjs +1 -0
  14. package/dist/adapter-react-three-fiber.mjs +1 -2
  15. package/dist/bridge-entry.mjs +1 -1
  16. package/dist/bridge-recovery-3IQN3U6D.mjs +1 -2
  17. package/dist/bridgeSSEStream-K3UIMBTC.mjs +1 -0
  18. package/dist/bridgeWebSocketStream-2SUZUBE3.mjs +1 -0
  19. package/dist/browser-runtime-FFT5NH66.mjs +1 -0
  20. package/dist/browser.mjs +1 -2
  21. package/dist/canvas-chat-note-MGAEUYJO.mjs +1 -0
  22. package/dist/checkFixture-AMLLLJNS.mjs +1 -0
  23. package/dist/chunk-2ETPREWQ.mjs +1 -0
  24. package/dist/chunk-2P2NUZW7.mjs +1 -2
  25. package/dist/chunk-3GXLNBXU.mjs +1 -0
  26. package/dist/chunk-3WSTAV5B.mjs +1 -0
  27. package/dist/chunk-4LHTPRFY.mjs +1 -2
  28. package/dist/chunk-53SKVMWR.mjs +1 -0
  29. package/dist/chunk-57FM7XQV.mjs +1 -0
  30. package/dist/chunk-5D2ADU7H.mjs +1 -0
  31. package/dist/chunk-5K7SACPW.mjs +1 -2
  32. package/dist/chunk-67OWRNU3.mjs +30 -0
  33. package/dist/chunk-67QNAAUC.mjs +1 -0
  34. package/dist/chunk-BACXPVHP.mjs +1 -0
  35. package/dist/chunk-BFVLMSG5.mjs +1 -0
  36. package/dist/chunk-BJ25TGJN.mjs +1 -0
  37. package/dist/chunk-DOCRI237.mjs +1 -0
  38. package/dist/{chunk-C5WXW6VL.mjs → chunk-E5WNW4WE.mjs} +1 -1
  39. package/dist/chunk-EX63NVDN.mjs +1 -2
  40. package/dist/chunk-F5XSNRGT.mjs +1 -2
  41. package/dist/chunk-FMI4VQDZ.mjs +1 -0
  42. package/dist/chunk-G2ZHJXHZ.mjs +1 -0
  43. package/dist/chunk-G6RYESYI.mjs +1 -0
  44. package/dist/chunk-G7JR5Z3P.mjs +1 -0
  45. package/dist/chunk-GRPDZGPP.mjs +1 -0
  46. package/dist/chunk-GSEMSZDB.mjs +1 -0
  47. package/dist/chunk-H2RLTCUJ.mjs +1 -0
  48. package/dist/chunk-HAE5LUJX.mjs +1 -0
  49. package/dist/{chunk-IKCHOC3U.mjs → chunk-HV7HRQ2S.mjs} +0 -1
  50. package/dist/chunk-J3UIBBU2.mjs +1 -2
  51. package/dist/chunk-J4WDYITA.mjs +1 -2
  52. package/dist/chunk-JRP5XFYN.mjs +1 -0
  53. package/dist/chunk-LD3532UC.mjs +1 -0
  54. package/dist/chunk-LVEMYZOA.mjs +1 -2
  55. package/dist/chunk-MJ2PFKF3.mjs +1 -0
  56. package/dist/chunk-MP6ZV2DN.mjs +1 -0
  57. package/dist/chunk-N2ZEZCHO.mjs +1 -2
  58. package/dist/chunk-N66ZZG3L.mjs +1 -0
  59. package/dist/chunk-NSCO633B.mjs +1 -0
  60. package/dist/chunk-O4HZP3RP.mjs +1 -2
  61. package/dist/chunk-P4KM3K5M.mjs +1 -0
  62. package/dist/chunk-PH2MLB3T.mjs +1 -0
  63. package/dist/chunk-PQT5FYN5.mjs +1 -2
  64. package/dist/chunk-Q6C7ZA3H.mjs +1 -0
  65. package/dist/chunk-Q6N77LIS.mjs +1 -0
  66. package/dist/chunk-Q74FBX2I.mjs +1 -0
  67. package/dist/chunk-QQB5G3VB.mjs +1 -0
  68. package/dist/chunk-R3FPXDQS.mjs +1 -0
  69. package/dist/chunk-RK6UROPO.mjs +1 -0
  70. package/dist/chunk-RR4SHK7O.mjs +1 -0
  71. package/dist/chunk-RSUMSUAW.mjs +1 -0
  72. package/dist/{chunk-GL4I4MI6.mjs → chunk-RUJC32MA.mjs} +1 -1
  73. package/dist/chunk-RUTWU5W2.mjs +1 -0
  74. package/dist/chunk-TRHC7WBO.mjs +1 -0
  75. package/dist/chunk-V2I7PSJW.mjs +1 -2
  76. package/dist/chunk-WHJEKDNP.mjs +1 -2
  77. package/dist/chunk-XSMCZUDR.mjs +1 -0
  78. package/dist/chunk-XT6PHPPG.mjs +1 -0
  79. package/dist/chunk-XTOCFTVW.mjs +1 -2
  80. package/dist/chunk-Y6WD56SO.mjs +1 -0
  81. package/dist/chunk-YC5CUNRU.mjs +1 -0
  82. package/dist/chunk-YFDD7HGT.mjs +1 -0
  83. package/dist/chunk-YTUQYKLM.mjs +1 -0
  84. package/dist/chunk-YXPRWW6B.mjs +1 -0
  85. package/dist/chunk-ZVDKW7TO.mjs +1 -0
  86. package/dist/cli.mjs +1 -1
  87. package/dist/codex-note-context-NUKGR2WT.mjs +1 -0
  88. package/dist/codex-project-KE7ZZ6YX.mjs +1 -0
  89. package/dist/{codex-session-registry-SPRWY2WW.mjs → codex-session-registry-ONODFWFD.mjs} +1 -2
  90. package/dist/focus-inspection-BPPRCMNN.mjs +1 -0
  91. package/dist/index.d.mts +25 -0
  92. package/dist/index.mjs +1 -2
  93. package/dist/media.mjs +1 -2
  94. package/dist/memory-store.mjs +1 -1
  95. package/dist/peer-client-UQDASAO7.mjs +1 -0
  96. package/dist/plugin-astro.mjs +1 -1
  97. package/dist/plugin-next.mjs +1 -1
  98. package/dist/plugin-nuxt.mjs +1 -1
  99. package/dist/plugin-vite.mjs +1 -1
  100. package/dist/server.mjs +1 -1
  101. package/dist/steerStyles-VKQD57KC.mjs +1 -0
  102. package/dist/taste-proposal-session-XU4N7RUV.mjs +1 -2
  103. package/dist/workspace-snapshot-RTTXNNUX.mjs +1 -2
  104. package/package.json +1 -1
  105. package/dist/ExploreAttachment-CLFSAWKM.mjs +0 -260
  106. package/dist/ParticipantRuntime-HW3MOZI5.mjs +0 -139
  107. package/dist/PopmeltTasteConnectedPane-FKIJM3C7.mjs +0 -215
  108. package/dist/PreviewRuntime-LFPK56NW.mjs +0 -2
  109. package/dist/SuppliedContext-RWN6UR3K.mjs +0 -2
  110. package/dist/ThreadErrorCard-7J62GD5W.mjs +0 -2
  111. package/dist/ThreadPanel-RJIHV3P6.mjs +0 -197
  112. package/dist/bridgeSSEStream-NEYI73TC.mjs +0 -4
  113. package/dist/bridgeWebSocketStream-H3DCP4T3.mjs +0 -2
  114. package/dist/browser-runtime-JJHSKIKD.mjs +0 -2
  115. package/dist/canvas-chat-note-NHYL3T6J.mjs +0 -2
  116. package/dist/checkFixture-TJDFGPQI.mjs +0 -2
  117. package/dist/chunk-27ADDVGC.mjs +0 -3
  118. package/dist/chunk-2IASPT6L.mjs +0 -2
  119. package/dist/chunk-2VCHBI7Y.mjs +0 -11
  120. package/dist/chunk-2ZJ4FBTG.mjs +0 -2
  121. package/dist/chunk-6V2VCKPG.mjs +0 -53
  122. package/dist/chunk-6VXFTT5U.mjs +0 -2
  123. package/dist/chunk-75PQGTKX.mjs +0 -2
  124. package/dist/chunk-7IJGE5AK.mjs +0 -31
  125. package/dist/chunk-BVTLSUQT.mjs +0 -2
  126. package/dist/chunk-CPOYMGYY.mjs +0 -2
  127. package/dist/chunk-DMWB3IRD.mjs +0 -1
  128. package/dist/chunk-DNOKP3JS.mjs +0 -2
  129. package/dist/chunk-EAV2VV2V.mjs +0 -2
  130. package/dist/chunk-GASEZICN.mjs +0 -2
  131. package/dist/chunk-H2UYAUX3.mjs +0 -2
  132. package/dist/chunk-HNCV37XO.mjs +0 -2
  133. package/dist/chunk-I63OQTCF.mjs +0 -347
  134. package/dist/chunk-J5SC3R5L.mjs +0 -2
  135. package/dist/chunk-JMMP5JSP.mjs +0 -2
  136. package/dist/chunk-ODIGT4YJ.mjs +0 -17
  137. package/dist/chunk-PHKDIU3X.mjs +0 -30
  138. package/dist/chunk-PSSHCTJ2.mjs +0 -8
  139. package/dist/chunk-W5NIRROD.mjs +0 -7
  140. package/dist/chunk-XKD2ABCO.mjs +0 -7
  141. package/dist/chunk-XMKYGH62.mjs +0 -142
  142. package/dist/chunk-ZHJZPC7U.mjs +0 -2
  143. package/dist/codex-note-context-YHKPQ4WP.mjs +0 -2
  144. package/dist/codex-project-7VYHYTWO.mjs +0 -2
  145. package/dist/focus-inspection-VBS5656D.mjs +0 -2
  146. package/dist/peer-client-MTWZG2FB.mjs +0 -2
@@ -1,8 +0,0 @@
1
- "use client";
2
- import{b as H}from"./chunk-F5XSNRGT.mjs";import{n as _}from"./chunk-2VCHBI7Y.mjs";import{e as Q}from"./chunk-ODIGT4YJ.mjs";import{useSyncExternalStore as I,useState as k,useRef as K,useLayoutEffect as T}from"react";import{Minus as U,Plus as ee,Minimize2 as te}from"lucide-react";import{jsxs as X,jsx as z,Fragment as re}from"react/jsx-runtime";var C=1,G=4,ne=[1,1.5,2.25,3.375,G];function J(h=1){let n=h,t=null,c=0,u=0,f=()=>t===null?C:t/(n??1),y=l=>Math.max(Math.min(C,f()),Math.min(G/(n??1),l)),a=new Set,m=(l,i)=>i<=1?(1-i)/2:Math.max(1-i,Math.min(0,l));function v(l,i,p){let s=l===C?null:l*(n??1);if(!(t===s&&c===i&&u===p)){t=s,c=i,u=p;for(let o of a)o()}}return{clampScale:y,snapshot:()=>({pageScale:t,focusX:c,focusY:u}),restore(l){if(!(l.pageScale===t&&l.focusX===c&&l.focusY===u)){({pageScale:t,focusX:c,focusY:u}=l);for(let i of a)i()}},getFitScale:()=>n,setFitScale(l){if(n!==l){n=l;for(let i of a)i()}},getScale:f,setScale(l){let i=y(l);v(i,i===C?0:c,i===C?0:u)},getView(l,i){let p=f(),s=(1-p)/2,o=t??n??1;return{scale:p,x:m(l>0?s-c*o/l:s,p),y:m(i>0?s-u*o/i:s,p)}},setView(l,i,p,s,o){if(!s||!o)return;let x=y(l),F=(1-x)/2,Y=x*(n??1);v(x,(F-m(i,x))*s/Y,(F-m(p,x))*o/Y)},subscribe(l){return a.add(l),()=>{a.delete(l)}}}}function W({framing:h}){let n=I(h.subscribe,h.getScale,h.getScale),t=I(h.subscribe,h.getFitScale,h.getFitScale),c=t===null?[]:ne.map(a=>a/t),u=c.find(a=>a>n)??n,f=c.filter(a=>a<n).pop()??Math.min(C,n);function y(a,m){if(t===null)return`Zoom ${a}`;let v=Math.round(t*m*100)+"%";return m===n?a==="out"?`Fit (${v})`:`Maximum zoom (${v})`:`Zoom ${a} to ${v}`}return X("div",{"data-preview-zoom-controls":"",role:"group","aria-label":"Preview framing","data-popmelt-canvas-block":"",children:[z(H,{type:"button","aria-label":"Zoom out",hint:y("out",f),disabled:f===n,onClick:()=>h.setScale(f),children:z(U,{size:14})}),z(H,{type:"button","aria-label":"Zoom in",hint:y("in",u),disabled:u===n,onClick:()=>h.setScale(u),children:z(ee,{size:14})})]})}function ie({children:h,overlay:n,interactive:t=!1,framing:c,parentGestureSurface:u}){let f=Q.dark,[y]=k(J),a=c??y,m=K(null),[v,l]=k(),[i,p]=k({scale:1,x:0,y:0}),s=K(i);return T(()=>{let o=m.current;if(!o)return;let x=()=>{let e=o.getBoundingClientRect(),r=a.getView(e.width,e.height);s.current=r,p(r)},F=()=>{l({width:o.clientWidth,height:o.clientHeight}),x()},Y=a.subscribe(x);F();let V=typeof ResizeObserver<"u"?new ResizeObserver(F):void 0;V?.observe(o);let D=()=>window.matchMedia("(any-hover: hover) and (any-pointer: fine)").matches,$=e=>(u&&e.currentTarget===u?o.ownerDocument.defaultView?.frameElement:o)?.getBoundingClientRect()??o.getBoundingClientRect(),L=(e,r,d,g=o.getBoundingClientRect())=>{if(!g.width||!g.height)return;let S=s.current,R=a.clampScale(e),w=Math.max(0,Math.min(1,(r-g.left)/g.width)),E=Math.max(0,Math.min(1,(d-g.top)/g.height));a.setView(R,w-(w-S.x)*R/S.scale,E-(E-S.y)*R/S.scale,g.width,g.height)},M=null,Z=e=>{if(!t&&!D()||!e.ctrlKey&&s.current.scale===1)return;e.preventDefault(),e.stopPropagation();let r=$(e),d=e.deltaMode===1?16:e.deltaMode===2?o.clientHeight:1;e.ctrlKey?M===null&&L(s.current.scale*Math.exp(-e.deltaY*d*.01),e.clientX,e.clientY,r):r.width&&r.height&&a.setView(s.current.scale,s.current.x-e.deltaX*d/r.width,s.current.y-e.deltaY*d/r.height,r.width,r.height)},N=e=>{if(!t&&!D())return;e.preventDefault(),e.stopPropagation();let r=e;if(e.type==="gesturestart")M=s.current.scale;else if(e.type==="gestureend")M=null;else if(M!==null&&Number.isFinite(r.scale)){let d=$(e);L(M*r.scale,Number.isFinite(r.clientX)?r.clientX:d.left+d.width/2,Number.isFinite(r.clientY)?r.clientY:d.top+d.height/2,d)}},b=null,P=e=>{if(e.touches.length!==2){b=null;return}let[r,d]=[e.touches[0],e.touches[1]],g=(r.clientX+d.clientX)/2,S=(r.clientY+d.clientY)/2,R=Math.hypot(r.clientX-d.clientX,r.clientY-d.clientY);if(e.preventDefault(),e.type==="touchmove"&&M===null&&b&&b.distance>0){let w=$(e);L(s.current.scale*R/b.distance,b.x,b.y,w);let E=s.current;w.width&&w.height&&a.setView(E.scale,E.x+(g-b.x)/w.width,E.y+(S-b.y)/w.height,w.width,w.height)}b={x:g,y:S,distance:R}},O=e=>{if(s.current.scale<=1||!(e.target instanceof Element)||!e.target.closest("[data-preview-zoom-content]"))return;let r=e.target.getBoundingClientRect(),d=o.getBoundingClientRect();(r.left<d.left||r.top<d.top||r.right>d.right||r.bottom>d.bottom)&&a.setScale(1)},j=["touchstart","touchmove","touchend","touchcancel"],q=u?[o,u]:[o],A=["gesturestart","gesturechange","gestureend"];for(let e of q){if(t)for(let r of j)e.addEventListener(r,P,{passive:!1,capture:!0});e.addEventListener("wheel",Z,{passive:!1,capture:t});for(let r of A)e.addEventListener(r,N,{passive:!1,capture:t})}return t&&o.addEventListener("focusin",O),()=>{for(let e of q){if(t)for(let r of j)e.removeEventListener(r,P,!0);e.removeEventListener("wheel",Z,t);for(let r of A)e.removeEventListener(r,N,t)}o.removeEventListener("focusin",O),Y(),V?.disconnect()}},[t,a,u]),T(()=>{t&&m.current&&_(m.current)},[t,i,v]),X("div",{ref:m,"data-preview-zoom":!0,style:{position:"relative",width:"100%",aspectRatio:t?void 0:"16 / 9",height:t?"100%":void 0,touchAction:t?"none":void 0,overflow:"hidden",borderRadius:8},children:[z("div",{"data-preview-zoom-content":!0,style:{width:v?.width||"100%",height:v?.height||"100%",zoom:i.scale,transformOrigin:"0 0",transform:`translate(${i.x*100/i.scale}%, ${i.y*100/i.scale}%)`},children:h}),n,t&&!c&&z(W,{framing:a}),!t&&i.scale>1&&X(re,{children:[z("style",{children:`
3
- [data-preview-zoom-reset] span { color: ${f.primary}; }
4
- [data-preview-zoom-reset] svg { color: ${f.secondary}; }
5
- [data-preview-zoom-reset]:hover span, [data-preview-zoom-reset]:focus-visible span { color: ${f.secondary}; }
6
- [data-preview-zoom-reset]:hover svg, [data-preview-zoom-reset]:focus-visible svg { color: ${f.primary}; }
7
- [data-preview-zoom-reset] span, [data-preview-zoom-reset] svg { transition: color 120ms ease; }
8
- `}),X("button",{"data-popmelt-canvas-block":"","data-preview-zoom-reset":!0,type:"button","aria-label":"Reset preview zoom",onClick:()=>a.setScale(1),style:{position:"absolute",right:8,bottom:8,display:"inline-flex",alignItems:"center",gap:6,border:0,borderRadius:8,padding:"4px 6px 4px 10px",background:f.control,color:f.primary,fontSize:12,cursor:"pointer"},children:[X("span",{children:[Math.round(i.scale*100),"%"]}),z(te,{size:14,"aria-hidden":"true"})]})]})]})}function B(h){let n=h.map(t=>{let c=t/255;return c<=.04045?c/12.92:((c+.055)/1.055)**2.4});return n[0]*.2126+n[1]*.7152+n[2]*.0722}function ae(h,n){let t=B(h),c=B(n);return(Math.max(t,c)+.05)/(Math.min(t,c)+.05)}function le(){if(typeof CanvasRenderingContext2D>"u")return;let h=document.createElement("canvas");h.width=h.height=1;let n=h.getContext("2d",{willReadFrequently:!0});if(n)return(t,c)=>{n.fillStyle=c,n.fillRect(0,0,1,1),n.fillStyle=t,n.fillRect(0,0,1,1);let u=n.getImageData(0,0,1,1).data;return[u[0],u[1],u[2]]}}export{J as a,W as b,ie as c,B as d,ae as e,le as f};
@@ -1,7 +0,0 @@
1
- "use client";
2
- function m(n,a,i){let t=n.flatMap(({requestedAt:r,resolvedAt:l})=>Number.isFinite(r)&&Number.isFinite(l)?[[Math.max(a,r),Math.min(i,l)]]:[]).sort((r,l)=>r[0]-l[0]),e=a,o=0;for(let[r,l]of t)o+=Math.max(0,l-Math.max(e,r)),e=Math.max(e,l);return o}function u(n){let a=new Map,i=new Set;for(let t of n)if(t.type==="approval"){let e=t.data.approval;a.set(e.id,e)}else(t.type==="done"||t.type==="error")&&i.add(String(t.data.jobId));return new Set([...a.values()].filter(t=>t.status==="pending"&&!i.has(t.jobId)).map(t=>t.jobId))}function p(n){let a=n?.requestItems?.flatMap(t=>t.kind==="annotation"&&t.text.trim()?[t.text.trim()]:[]);if(a?.length)return a.join("; ");let i=n?.requestItems?.flatMap(t=>t.kind==="changes"?[`${t.elementLabel} [${t.changes.join(", ")}]`]:[]);return i?.length?i.join("; "):n?.requestText?.trim()||void 0}function f(n,a){if(!n?.frames?.length)return[];let i=new Map;for(let t of n.steps){let e=t.visuals?.afterFrameId;e&&!i.has(e)&&i.set(e,t.action?.label?`After ${t.action.label}`:"Resulting state")}return n.frames.flatMap((t,e)=>{let o=a[t.imageIndex];return o?[{id:t.id,imageIndex:t.imageIndex,label:e===0?"Initial state":i.get(t.id)??"State",url:o}]:[]})}function s(n){let a=n.instruction?.trim();return a?n.attachments?.some(i=>i.name?.trim()===a)?null:a:null}function c(n,a){let i=n?.tagName?.toLowerCase(),t=n?.id?`#${n.id}`:"",e=n?.className?`.${n.className.trim().split(/\s+/).slice(0,2).join(".")}`:"",o=i?`${i}${t}${e}`:a;return n?.reactComponent?`<${n.reactComponent}> ${o}`:o}function d(n){let a=n.elements?.[0]?.reactComponent||n.elements?.[0]?.tagName||n.linkedSelector,i=n.type&&n.type!=="annotation"?`${n.type} annotation`:"Annotation";return a?`${i} on ${a}`:i}function h(n){let a=n.annotations.map(e=>{let o=e.interactionEpisode?.steps.length??0;return{kind:"annotation",annotationId:e.id,pathname:e.pathname,text:s(e)??d(e),...o>0?{interactionEpisodeStepCount:o}:{}}}),i=new Map,t=e=>{let o=`${e.pathname??""}:${e.durableSelector??e.selector}`,r=i.get(o);if(r){r.changes.push(e.text),e.annotationNumber!==void 0&&(r.annotationNumber===void 0||e.annotationNumber<r.annotationNumber)&&(r.annotationNumber=e.annotationNumber);return}let l={kind:"changes",elementKey:o,elementLabel:c(e.element,e.selector),...e.annotationNumber!==void 0?{annotationNumber:e.annotationNumber}:{},pathname:e.pathname,changes:[e.text]};i.set(o,l),a.push(l)};for(let e of n.styleModifications??[])for(let o of e.changes)t({...e,text:`${o.property}: ${o.original||"unset"} \u2192 ${o.modified||"unset"}${o.token?` (${o.token})`:""}`});for(let e of n.textModifications??[])t({...e,text:`Text: ${e.original||"empty"} \u2192 ${e.modified||"empty"}`});for(let e of n.domModifications??[])t({...e,text:e.operation==="copy"?"Copied element":"Moved element"});return n.spacingTokenChanges?.length&&a.push({kind:"changes",elementKey:"spacing-tokens",elementLabel:"Spacing tokens",changes:n.spacingTokenChanges.map(e=>`${e.tokenName}: ${e.originalPx}px \u2192 ${e.newPx}px`)}),a}function g(n){let a=n.annotations.flatMap(t=>{let e=s(t);return e?[{instruction:e,pathname:t.pathname}]:[]});if(a.length===0)return;if(new Set(a.map(t=>t.pathname).filter(Boolean)).size<=1)return a.map(t=>t.instruction).join(`
3
-
4
- `);let i=new Map;for(let t of a){let e=t.pathname||"(unknown)",o=i.get(e)??[];o.push(t.instruction),i.set(e,o)}return[...i.entries()].map(([t,e])=>`\`${t}\`
5
- ${e.map(o=>`- ${o}`).join(`
6
- `)}`).join(`
7
- `)}function $(n,a=96){let i=n.replace(/\s+/g," ").trim();return i.length>a?`${i.slice(0,Math.max(0,a-3))}...`:i}function x(n,a,i){return i?.activePreview?i.annotationNumber:n??a}function b(n,a){return n?.trim()?n.trim():p(a.find(i=>i.role==="human"))}export{m as a,u as b,f as c,h as d,g as e,$ as f,x as g,b as h};
@@ -1,7 +0,0 @@
1
- "use client";
2
- var P="Update the annotated component with this reviewed option and its Steer changes. Preserve existing behavior and unrelated styling.",j=`
3
- `+P+"\n```json\n",m="popmelt.explore-option.v1";function x(r,e,o){return[r?"Component: "+r:"Target: "+e,"Route: "+o].join(`
4
- `)}function A(r,e){if(!e||typeof e!="object"||Array.isArray(e))return r;let o=e.target;if(!o||typeof o!="object"||Array.isArray(o)||typeof o.pathname!="string")return r;let[t,...n]=r.split(`
5
- `),p=" \xB7 "+o.pathname;if(!t?.endsWith(p))return r;let l=t.slice(0,-p.length),i=typeof o.component=="string"?o.component:void 0;return!l||i&&l!==i?r:[x(i,l,o.pathname),...n].join(`
6
- `)}function y(r,e,o,t){let n=r.options[e],{pathname:p,selector:l,element:i}=r.target,u=i?.reactSource,s=i?.reactComponent,h=o.filter(a=>a.batchId===r.id&&a.option===e).map(({part:a,property:c,from:d,to:g})=>({part:a,property:c,from:d,to:g})),b={pathname:p,selector:l,...i?.selector&&{sourceSelector:i.selector},...s&&{component:s},...u&&{source:u}},f="root"in n&&t?.path.reduce((a,c)=>a.children[c],n.root);return{source:"Popmelt",title:f&&(t?.path.length||t?.field)?n.title+" \xB7 "+(f.name??f.label??f.kind)+(t.field?" label":""):t?.fixturePart?n.title+" \xB7 "+(t.fixturePartLabel||t.fixturePart.replace(/^@/,"")):n.title,content:[x(s,i?.subjectLabel||l,p),...h.map(({part:a,property:c,to:d})=>[a,c+" \u2192 "+d].filter(Boolean).join(" \xB7 "))].join(`
7
- `),...u&&{sourceURI:u.fileName},kind:m,selection:{batchId:r.id,index:e,target:b,option:n,steerEdits:h,...t&&(t.path.length||t.field||t.fixturePart)?{focus:{path:t.path,...t.fixturePart&&{part:t.fixturePart},...t.fixturePartLabel&&{label:t.fixturePartLabel},...t.field&&{field:t.field}}}:{}}}}function v(r,e,o){return{key:JSON.stringify([r.id,e.option,e.path,e.field,e.fixturePart]),tag:e,note:y(r,e.option,o,e)}}function B(r,e,o){let t=y(r,e,o);return{text:`Apply \u201C${t.title}\u201D in code.`,meta:{exploreOption:t}}}function S(r){if(!r?.startsWith("Apply \u201C"))return;let e=r.indexOf(j);if(e>0&&r.slice(0,e).endsWith("\u201D in code."))return r.slice(0,e)}export{m as a,A as b,v as c,B as d,S as e};