@popmelt.com/core 0.34.0 → 0.36.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.
- package/README.md +24 -868
- package/THIRD_PARTY_NOTICES.md +72 -0
- package/claude-plugin/.claude-plugin/plugin.json +1 -1
- package/codex-plugin/.codex-plugin/plugin.json +1 -1
- package/dist/ExploreAttachment-H5WPEAZB.mjs +1 -0
- package/dist/PagePreviewLayer-WCYOBKAS.mjs +1 -0
- package/dist/ParticipantRuntime-HEC26AER.mjs +1 -0
- package/dist/PhoneHostGate-Q2AXVOSH.mjs +1 -0
- package/dist/PopmeltTasteConnectedPane-B7DHQKRQ.mjs +1 -0
- package/dist/{PreviewRuntime-EYKB7MG5.mjs → PreviewRuntime-H2UOLP6T.mjs} +1 -1
- package/dist/QueuedReplies-ESIFFRKS.mjs +1 -0
- package/dist/SuppliedContext-7ASO6GAW.mjs +1 -0
- package/dist/ThreadErrorCard-6R7W3RGZ.mjs +1 -0
- package/dist/ThreadPanel-3IS7GUYS.mjs +1 -0
- package/dist/adapter-react-three-fiber.d.mts +1 -1
- package/dist/bridge-entry.mjs +1 -1
- package/dist/browser-runtime-ILNTJLZ5.mjs +1 -0
- package/dist/browser.d.mts +4 -4
- package/dist/browser.mjs +1 -1
- package/dist/{checkFixture-AMLLLJNS.mjs → checkFixture-YE2ROOLL.mjs} +1 -1
- package/dist/chunk-26P7UUHT.mjs +1 -0
- package/dist/chunk-3SEXH3AZ.mjs +1 -0
- package/dist/chunk-3XJEC6LS.mjs +1 -0
- package/dist/chunk-7CGKO4IU.mjs +30 -0
- package/dist/{chunk-YXPRWW6B.mjs → chunk-AH6LZOQC.mjs} +1 -1
- package/dist/chunk-APP5IYTE.mjs +1 -0
- package/dist/chunk-DC47WNPG.mjs +1 -0
- package/dist/chunk-DJTGR3RO.mjs +1 -0
- package/dist/{chunk-QQB5G3VB.mjs → chunk-DLUNNAZC.mjs} +1 -1
- package/dist/chunk-EXIUW3JX.mjs +1 -0
- package/dist/chunk-FLTHWLRC.mjs +1 -0
- package/dist/chunk-GBVPRXA3.mjs +1 -0
- package/dist/chunk-HU2XWUJC.mjs +1 -0
- package/dist/chunk-L7QONR4K.mjs +1 -0
- package/dist/chunk-MSWXKP77.mjs +1 -0
- package/dist/{chunk-YTUQYKLM.mjs → chunk-NDGM4DAP.mjs} +1 -1
- package/dist/chunk-NWE5PYKM.mjs +1 -0
- package/dist/{chunk-GSEMSZDB.mjs → chunk-OAHYSDJ4.mjs} +1 -1
- package/dist/{chunk-Y6WD56SO.mjs → chunk-OZBMHEOD.mjs} +1 -1
- package/dist/chunk-PNTM77NT.mjs +1 -0
- package/dist/chunk-PYGRFSUU.mjs +1 -0
- package/dist/{chunk-H2RLTCUJ.mjs → chunk-R3AJWOID.mjs} +1 -1
- package/dist/chunk-TLREGQQB.mjs +1 -0
- package/dist/chunk-TUXBMJQZ.mjs +1 -0
- package/dist/chunk-WDAXARLI.mjs +1 -0
- package/dist/chunk-X2Q3H6X7.mjs +1 -0
- package/dist/chunk-XJQJQ5V5.mjs +1 -0
- package/dist/chunk-YHYFWNN6.mjs +1 -0
- package/dist/{chunk-MJ2PFKF3.mjs → chunk-ZDXQ7WNW.mjs} +1 -1
- package/dist/chunk-ZSL57PQ7.mjs +1 -0
- package/dist/cli.mjs +1 -1
- package/dist/codex-note-context-YFURG7VL.mjs +1 -0
- package/dist/codex-project-3NSU5OWL.mjs +1 -0
- package/dist/focus-inspection-SZJ5KP23.mjs +1 -0
- package/dist/index.d.mts +5 -5
- package/dist/index.mjs +1 -1
- package/dist/media.d.mts +3 -3
- package/dist/memory-store.d.mts +1 -1
- package/dist/{participantBootstrap-ClKpD2qC.d.mts → participantBootstrap-DFJlcKRI.d.mts} +2 -2
- package/dist/peer-client-56EAHIGF.mjs +1 -0
- package/dist/plugin-astro.mjs +1 -1
- package/dist/plugin-nuxt.mjs +1 -1
- package/dist/plugin-vite.d.mts +17 -0
- package/dist/plugin-vite.mjs +1 -1
- package/dist/server.d.mts +6 -6
- package/dist/server.mjs +1 -1
- package/dist/{steerStyles-VKQD57KC.mjs → steerStyles-E76E44PI.mjs} +1 -1
- package/dist/{subjects-EWAR5-0S.d.mts → subjects-DdavjSTL.d.mts} +12 -0
- package/dist/{types-C8tjyhiF.d.mts → types-g9YCBx4Z.d.mts} +2 -1
- package/dist/{video-adapter-BUMpNTCP.d.mts → video-adapter-DB6Hex1f.d.mts} +1 -1
- package/package.json +2 -3
- package/dist/ExploreAttachment-BG7ZOQSA.mjs +0 -1
- package/dist/PagePreviewLayer-CBDGPMJQ.mjs +0 -1
- package/dist/ParticipantRuntime-FSZX2PUQ.mjs +0 -1
- package/dist/PhoneHostGate-OM7FLOJ2.mjs +0 -1
- package/dist/PopmeltTasteConnectedPane-KJSBPJQR.mjs +0 -1
- package/dist/QueuedReplies-ZYUDSTS2.mjs +0 -1
- package/dist/SuppliedContext-7THB2WZY.mjs +0 -1
- package/dist/ThreadErrorCard-J2VTA5JW.mjs +0 -1
- package/dist/ThreadPanel-PNVMIIYJ.mjs +0 -1
- package/dist/browser-runtime-FFT5NH66.mjs +0 -1
- package/dist/chunk-2ETPREWQ.mjs +0 -1
- package/dist/chunk-3WSTAV5B.mjs +0 -1
- package/dist/chunk-67OWRNU3.mjs +0 -30
- package/dist/chunk-BFVLMSG5.mjs +0 -1
- package/dist/chunk-BJ25TGJN.mjs +0 -1
- package/dist/chunk-E5WNW4WE.mjs +0 -1
- package/dist/chunk-F5XSNRGT.mjs +0 -1
- package/dist/chunk-FMI4VQDZ.mjs +0 -1
- package/dist/chunk-GRPDZGPP.mjs +0 -1
- package/dist/chunk-JRP5XFYN.mjs +0 -1
- package/dist/chunk-LD3532UC.mjs +0 -1
- package/dist/chunk-MP6ZV2DN.mjs +0 -1
- package/dist/chunk-N66ZZG3L.mjs +0 -1
- package/dist/chunk-P4KM3K5M.mjs +0 -1
- package/dist/chunk-PQT5FYN5.mjs +0 -1
- package/dist/chunk-R3FPXDQS.mjs +0 -1
- package/dist/chunk-RSUMSUAW.mjs +0 -1
- package/dist/chunk-TRHC7WBO.mjs +0 -1
- package/dist/chunk-XSMCZUDR.mjs +0 -1
- package/dist/chunk-YC5CUNRU.mjs +0 -1
- package/dist/codex-note-context-NUKGR2WT.mjs +0 -1
- package/dist/codex-project-KE7ZZ6YX.mjs +0 -1
- package/dist/focus-inspection-BPPRCMNN.mjs +0 -1
- package/dist/peer-client-UQDASAO7.mjs +0 -1
- /package/dist/{chunk-3GXLNBXU.mjs → chunk-YD3PDEFX.mjs} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{forwardRef as e,useId as t,useRef as n,useState as r,useLayoutEffect as o,useEffect as i}from"react";import{createPortal as l}from"react-dom";import{jsx as a,jsxs as d}from"react/jsx-runtime";var c=e(function({style:e,...t},n){return a("span",{...t,ref:n,role:"tooltip",style:{background:"var(--popmelt-thread-raised, #222)",color:"var(--popmelt-thread-primary, #eee)",borderRadius:16,boxSizing:"border-box",...e}})}),s=new WeakMap;function u(e){return e.closest("[data-popmelt-tooltip-group]")??e.parentElement}function p({hint:e,above:t,anchorRef:n,children:r,...o}){return a(h,{hint:e??o["aria-label"],above:t,anchorRef:n,children:e=>a("button",{type:"button",...o,"aria-describedby":e,children:r})})}function h({hint:e,above:p,anchorRef:h,children:m}){let f=t(),v=n(null),b=n(null),g=n(!1),y=n(!1),[x,w]=r("closed"),R="entering"===x||"instant"===x,E="closed"!==x?v.current:null,M=E?.closest('[data-popmelt-tooltip-boundary], [data-devtools="thread-panel"]'),L=E?.getRootNode(),W=M??(L&&"host"in L?L:E?.ownerDocument.body);function k(t,n){if(!e)return;let r=u(t),o=r&&s.get(r),i=!1;if(o&&o.tip!==b.current){let e=t.ownerDocument.defaultView;i=n&&!!e&&Number(e.getComputedStyle(o.tip).opacity)>0,o.close()}w(i?"instant":"entering")}return o(()=>{let e=b.current,t=E?.ownerDocument.defaultView;if(!E||!e||!t)return;let n=h?.current??E,r=()=>{let r=M?.getBoundingClientRect(),o=n.getBoundingClientRect(),i=Math.max(r?.left??0,0)+8,l=Math.min(r?.right??t.innerWidth,t.innerWidth)-8,a=Math.max(r?.top??0,0)+8,d=Math.min(r?.bottom??t.innerHeight,t.innerHeight)-8;e.style.maxWidth=Math.max(0,Math.min(180,l-i))+"px";let{width:c,height:s}=e.getBoundingClientRect();if(o.right<=i||o.left>=l||o.bottom<=a||o.top>=d||c>l-i||s>d-a)return void(e.style.visibility="hidden");let u=(e,t,n)=>Math.max(t,Math.min(e,n)),h=u(o.left+(o.width-c)/2,i,l-c),m=o.top-s-4,f=o.bottom+4,v=u((p?m>=a:f+s>d)?m:f,a,d-s);e.style.left=h-(r?.left??0)-(M?.clientLeft??0)+"px",e.style.top=v-(r?.top??0)-(M?.clientTop??0)+"px",e.style.visibility="visible"};r();let o=new t.ResizeObserver(r);o.observe(E),n!==E&&o.observe(n),o.observe(e),M&&o.observe(M);let i=E.getRootNode();return i.addEventListener("scroll",r,!0),t.addEventListener("resize",r),()=>{o.disconnect(),i.removeEventListener("scroll",r,!0),t.removeEventListener("resize",r)}},[E,h,M,p,e]),o(()=>{let e=E&&u(E),t=b.current;if(!e||!t)return;let n={tip:t,close:()=>w("closed")};return s.set(e,n),()=>{s.get(e)===n&&s.delete(e)}},[E]),o(()=>{let e=b.current,t=E?.ownerDocument.defaultView;if(!e||!t)return;let n="instant"!==x&&!t.matchMedia("(prefers-reduced-motion: reduce)").matches;if(e.style.transition=n?"opacity 120ms ease-out":"none","entering"===x&&t.getComputedStyle(e).opacity,e.style.opacity=R?"1":"0",!R){if(!n)return void w("closed");let e=t.setTimeout(()=>w("closed"),120);return()=>t.clearTimeout(e)}},[E,R,x]),i(()=>{let e=v.current?.ownerDocument;if(!R||!e)return;let t=e=>{"Escape"===e.key&&(w("closed"),e.stopPropagation())};return e.addEventListener("keydown",t,!0),()=>e.removeEventListener("keydown",t,!0)},[R]),d("span",{ref:v,style:{position:"relative",display:"inline-flex",minWidth:0},onPointerEnter:e=>{"touch"!==e.pointerType&&(g.current=!0,k(e.currentTarget,!0))},onPointerLeave:()=>{g.current=!1,y.current||w(e=>"closed"===e?e:"leaving")},onFocus:e=>{y.current=e.target.matches(":focus-visible"),y.current&&k(e.currentTarget,!1)},onBlur:()=>{y.current=!1,g.current||w(e=>"closed"===e?e:"leaving")},children:[m(R&&e?f:void 0),W&&e&&l(a(c,{ref:b,id:f,"aria-hidden":!R||void 0,style:{position:M?"absolute":"fixed",opacity:0,visibility:"hidden",background:"var(--popmelt-thread-action, #222)",color:"var(--popmelt-thread-on-action, #eee)",whiteSpace:"normal",overflowWrap:"anywhere",zIndex:20,width:"max-content",maxWidth:180,pointerEvents:"none",fontSize:12,fontWeight:500,lineHeight:1.35,padding:"5px 8px",borderRadius:8},children:e}),W)]})}export{c as a,p as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{b as e}from"./chunk-DOCRI237.mjs";import{a as t,b as n,h as a}from"./chunk-DJTGR3RO.mjs";import{b as i,a as o,c as r,d as s,e as l,s as m,r as c}from"./chunk-DC47WNPG.mjs";import{createContext as u,domToCanvas as p,destroyContext as h}from"modern-screenshot";import{useId as d,useState as f,useLayoutEffect as g}from"react";async function v(m,c){if(m&&m.pathname===location.pathname)try{let d=i(m),f=o(d.element),g=d.legacyScene||(f&&(f===d.element||d.element?.closest("svg,canvas"))?f:null),v=g?"component":"element",x=g??r(d,"element",!1);if(!x||x.closest("[data-popmelt-explore-original],[data-popmelt-explore-scene]"))return;let{width:b,height:w}=x.getBoundingClientRect();if(b<=0||w<=0)return;let y=getComputedStyle(x),$={capturedAt:Date.now(),backdrop:e(x),selector:m.selector,pathname:m.pathname,scope:v,width:b,height:w,viewport:{width:innerWidth,height:innerHeight},textFonts:l(x),style:Object.fromEntries(s.map(e=>[e,y.getPropertyValue(e)]))};try{let e=t(),i=c&&(x.matches("canvas")||x.querySelector("canvas"))?await n(e,c):[],o=await a(i,async()=>{let t=await n(e,()=>u(x,{width:Math.ceil(b),height:Math.ceil(w),scale:Math.min(2,512/Math.max(b,w)),timeout:1500,backgroundColor:$.backdrop,style:{margin:"0",position:"static",transform:"none"},filter:e=>!(e instanceof Element&&e.matches("[data-devtools],[data-popmelt-root],[data-popmelt-explore-preview]"))}));try{return await n(e,()=>p(t))}finally{h(t)}});for(;o.width&&o.height;){let e=o.toDataURL("image/webp",.8);if(e.length<=96e3&&/^data:image\/(webp|png);base64,/.test(e)){$.still=e;break}if(Math.max(o.width,o.height)<32)break;let t=document.createElement("canvas");t.width=Math.max(1,Math.floor(o.width/2)),t.height=Math.max(1,Math.floor(o.height/2)),t.getContext("2d").drawImage(o,0,0,t.width,t.height),o=t}}catch{}return $}catch{return}}async function x(e,t){let n=1===e.annotations.length&&e.annotations[0];n&&m(n.instruction??"")&&(e.exploreCapture=await v(c(n,location.pathname),t))}function b(e,t,n){let a=e.flatMap(({requestedAt:e,resolvedAt:a})=>Number.isFinite(e)&&Number.isFinite(a)?[[Math.max(t,e),Math.min(n,a)]]:[]).sort((e,t)=>e[0]-t[0]),i=t,o=0;for(let[e,t]of a)o+=Math.max(0,t-Math.max(i,e)),i=Math.max(i,t);return o}function w(e){let t=new Map,n=new Set;for(let a of e)if("approval"===a.type){let e=a.data.approval;t.set(e.id,e)}else("done"===a.type||"error"===a.type)&&n.add(String(a.data.jobId));return new Set([...t.values()].filter(e=>"pending"===e.status&&!n.has(e.jobId)).map(e=>e.jobId))}function y(e,t){if(!e?.frames?.length)return[];let n=new Map;for(let t of e.steps){let e=t.visuals?.afterFrameId;e&&!n.has(e)&&n.set(e,t.action?.label?`After ${t.action.label}`:"Resulting state")}return e.frames.flatMap((e,a)=>{let i=t[e.imageIndex];return i?[{id:e.id,imageIndex:e.imageIndex,label:0===a?"Initial state":n.get(e.id)??"State",url:i}]:[]})}function $(e){let t=e.instruction?.trim();return t?e.attachments?.some(e=>e.name?.trim()===t)?null:t:null}function M(e,t){let n=e?.tagName?.toLowerCase(),a=e?.id?`#${e.id}`:"",i=e?.className?`.${e.className.trim().split(/\s+/).slice(0,2).join(".")}`:"",o=n?`${n}${a}${i}`:t;return e?.reactComponent?`<${e.reactComponent}> ${o}`:o}function k(e){let t=e.elements?.[0]?.reactComponent||e.elements?.[0]?.tagName||e.linkedSelector,n=e.type&&"annotation"!==e.type?`${e.type} annotation`:"Annotation";return t?`${n} on ${t}`:n}function E(e){let t=e.annotations.map(e=>{let t=e.interactionEpisode?.steps.length??0;return{kind:"annotation",annotationId:e.id,pathname:e.pathname,text:$(e)??k(e),...t>0?{interactionEpisodeStepCount:t}:{}}}),n=new Map,a=e=>{let a=`${e.pathname??""}:${e.durableSelector??e.selector}`,i=n.get(a);if(i)return i.changes.push(e.text),void(void 0!==e.annotationNumber&&(void 0===i.annotationNumber||e.annotationNumber<i.annotationNumber)&&(i.annotationNumber=e.annotationNumber));let o={kind:"changes",elementKey:a,elementLabel:M(e.element,e.selector),...void 0!==e.annotationNumber?{annotationNumber:e.annotationNumber}:{},pathname:e.pathname,changes:[e.text]};n.set(a,o),t.push(o)};for(let t of e.styleModifications??[])for(let e of t.changes)a({...t,text:`${e.property}: ${e.original||"unset"} → ${e.modified||"unset"}${e.token?` (${e.token})`:""}`});for(let t of e.textModifications??[])a({...t,text:`Text: ${t.original||"empty"} → ${t.modified||"empty"}`});for(let t of e.domModifications??[])a({...t,text:"copy"===t.operation?"Copied element":"Moved element"});return e.spacingTokenChanges?.length&&t.push({kind:"changes",elementKey:"spacing-tokens",elementLabel:"Spacing tokens",changes:e.spacingTokenChanges.map(e=>`${e.tokenName}: ${e.originalPx}px → ${e.newPx}px`)}),t}function C(e){let t=e.annotations.flatMap(e=>{let t=$(e);return t?[{instruction:t,pathname:e.pathname}]:[]});if(0===t.length)return;if(new Set(t.map(e=>e.pathname).filter(Boolean)).size<=1)return t.map(e=>e.instruction).join("\n\n");let n=new Map;for(let e of t){let t=e.pathname||"(unknown)",a=n.get(t)??[];a.push(e.instruction),n.set(t,a)}return[...n.entries()].map(([e,t])=>`\`${e}\`\n${t.map(e=>`- ${e}`).join("\n")}`).join("\n")}function N(e,t=96){let n=e.replace(/\s+/g," ").trim();return n.length>t?`${n.slice(0,Math.max(0,t-3))}...`:n}function S(e,t){let n=d(),[a,i]=f(-1),[o,r]=f(!1),s=t.some(({suffix:e})=>e);g(()=>{let t=e.current;if(!t||!s)return;let n=()=>i(t.matches(":focus")&&t.selectionStart===t.selectionEnd?t.selectionEnd:-1),a=()=>i(-1);return n(),t.addEventListener("selectionchange",n),t.addEventListener("select",n),t.addEventListener("input",n),t.addEventListener("focus",n),t.addEventListener("blur",a),()=>{t.removeEventListener("selectionchange",n),t.removeEventListener("select",n),t.removeEventListener("input",n),t.removeEventListener("focus",n),t.removeEventListener("blur",a)}},[s,e]);let l=o?void 0:t.find(({start:e,token:t,suffix:n})=>n&&e+t.length===a);return{active:l,complete:function(e,t){let n=e.currentTarget;if(!l||"Tab"!==e.key||e.shiftKey||e.altKey||e.ctrlKey||e.metaKey||e.nativeEvent.isComposing||n.selectionStart!==a||n.selectionEnd!==a)return!1;e.preventDefault(),e.stopPropagation();let i=/\s/.test(n.value.charAt(a)),o=l.suffix+(i?"":" ");return n.ownerDocument.execCommand?.("insertText",!1,o)||(n.setRangeText(o,a,a,"end"),t()),i&&n.setSelectionRange(a+o.length+1,a+o.length+1),!0},hintId:n,inputProps:{"aria-autocomplete":l?"inline":void 0,"aria-describedby":l?n:void 0,onCompositionStart:()=>r(!0),onCompositionEnd:()=>r(!1)}}}function j(e,t,n){return n?.activePreview?n.annotationNumber:e??t}function L(e,t){return e?.trim()?e.trim():function(e){let t=e?.requestItems?.flatMap(e=>"annotation"===e.kind&&e.text.trim()?[e.text.trim()]:[]);if(t?.length)return t.join("; ");let n=e?.requestItems?.flatMap(e=>"changes"===e.kind?[`${e.elementLabel} [${e.changes.join(", ")}]`]:[]);return n?.length?n.join("; "):e?.requestText?.trim()||void 0}(t.find(e=>"human"===e.role))}export{v as a,x as b,b as c,w as d,y as e,E as f,C as g,N as h,S as i,j,L as k};
|