@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.
Files changed (106) hide show
  1. package/README.md +24 -868
  2. package/THIRD_PARTY_NOTICES.md +72 -0
  3. package/claude-plugin/.claude-plugin/plugin.json +1 -1
  4. package/codex-plugin/.codex-plugin/plugin.json +1 -1
  5. package/dist/ExploreAttachment-H5WPEAZB.mjs +1 -0
  6. package/dist/PagePreviewLayer-WCYOBKAS.mjs +1 -0
  7. package/dist/ParticipantRuntime-HEC26AER.mjs +1 -0
  8. package/dist/PhoneHostGate-Q2AXVOSH.mjs +1 -0
  9. package/dist/PopmeltTasteConnectedPane-B7DHQKRQ.mjs +1 -0
  10. package/dist/{PreviewRuntime-EYKB7MG5.mjs → PreviewRuntime-H2UOLP6T.mjs} +1 -1
  11. package/dist/QueuedReplies-ESIFFRKS.mjs +1 -0
  12. package/dist/SuppliedContext-7ASO6GAW.mjs +1 -0
  13. package/dist/ThreadErrorCard-6R7W3RGZ.mjs +1 -0
  14. package/dist/ThreadPanel-3IS7GUYS.mjs +1 -0
  15. package/dist/adapter-react-three-fiber.d.mts +1 -1
  16. package/dist/bridge-entry.mjs +1 -1
  17. package/dist/browser-runtime-ILNTJLZ5.mjs +1 -0
  18. package/dist/browser.d.mts +4 -4
  19. package/dist/browser.mjs +1 -1
  20. package/dist/{checkFixture-AMLLLJNS.mjs → checkFixture-YE2ROOLL.mjs} +1 -1
  21. package/dist/chunk-26P7UUHT.mjs +1 -0
  22. package/dist/chunk-3SEXH3AZ.mjs +1 -0
  23. package/dist/chunk-3XJEC6LS.mjs +1 -0
  24. package/dist/chunk-7CGKO4IU.mjs +30 -0
  25. package/dist/{chunk-YXPRWW6B.mjs → chunk-AH6LZOQC.mjs} +1 -1
  26. package/dist/chunk-APP5IYTE.mjs +1 -0
  27. package/dist/chunk-DC47WNPG.mjs +1 -0
  28. package/dist/chunk-DJTGR3RO.mjs +1 -0
  29. package/dist/{chunk-QQB5G3VB.mjs → chunk-DLUNNAZC.mjs} +1 -1
  30. package/dist/chunk-EXIUW3JX.mjs +1 -0
  31. package/dist/chunk-FLTHWLRC.mjs +1 -0
  32. package/dist/chunk-GBVPRXA3.mjs +1 -0
  33. package/dist/chunk-HU2XWUJC.mjs +1 -0
  34. package/dist/chunk-L7QONR4K.mjs +1 -0
  35. package/dist/chunk-MSWXKP77.mjs +1 -0
  36. package/dist/{chunk-YTUQYKLM.mjs → chunk-NDGM4DAP.mjs} +1 -1
  37. package/dist/chunk-NWE5PYKM.mjs +1 -0
  38. package/dist/{chunk-GSEMSZDB.mjs → chunk-OAHYSDJ4.mjs} +1 -1
  39. package/dist/{chunk-Y6WD56SO.mjs → chunk-OZBMHEOD.mjs} +1 -1
  40. package/dist/chunk-PNTM77NT.mjs +1 -0
  41. package/dist/chunk-PYGRFSUU.mjs +1 -0
  42. package/dist/{chunk-H2RLTCUJ.mjs → chunk-R3AJWOID.mjs} +1 -1
  43. package/dist/chunk-TLREGQQB.mjs +1 -0
  44. package/dist/chunk-TUXBMJQZ.mjs +1 -0
  45. package/dist/chunk-WDAXARLI.mjs +1 -0
  46. package/dist/chunk-X2Q3H6X7.mjs +1 -0
  47. package/dist/chunk-XJQJQ5V5.mjs +1 -0
  48. package/dist/chunk-YHYFWNN6.mjs +1 -0
  49. package/dist/{chunk-MJ2PFKF3.mjs → chunk-ZDXQ7WNW.mjs} +1 -1
  50. package/dist/chunk-ZSL57PQ7.mjs +1 -0
  51. package/dist/cli.mjs +1 -1
  52. package/dist/codex-note-context-YFURG7VL.mjs +1 -0
  53. package/dist/codex-project-3NSU5OWL.mjs +1 -0
  54. package/dist/focus-inspection-SZJ5KP23.mjs +1 -0
  55. package/dist/index.d.mts +5 -5
  56. package/dist/index.mjs +1 -1
  57. package/dist/media.d.mts +3 -3
  58. package/dist/memory-store.d.mts +1 -1
  59. package/dist/{participantBootstrap-ClKpD2qC.d.mts → participantBootstrap-DFJlcKRI.d.mts} +2 -2
  60. package/dist/peer-client-56EAHIGF.mjs +1 -0
  61. package/dist/plugin-astro.mjs +1 -1
  62. package/dist/plugin-nuxt.mjs +1 -1
  63. package/dist/plugin-vite.d.mts +17 -0
  64. package/dist/plugin-vite.mjs +1 -1
  65. package/dist/server.d.mts +6 -6
  66. package/dist/server.mjs +1 -1
  67. package/dist/{steerStyles-VKQD57KC.mjs → steerStyles-E76E44PI.mjs} +1 -1
  68. package/dist/{subjects-EWAR5-0S.d.mts → subjects-DdavjSTL.d.mts} +12 -0
  69. package/dist/{types-C8tjyhiF.d.mts → types-g9YCBx4Z.d.mts} +2 -1
  70. package/dist/{video-adapter-BUMpNTCP.d.mts → video-adapter-DB6Hex1f.d.mts} +1 -1
  71. package/package.json +2 -3
  72. package/dist/ExploreAttachment-BG7ZOQSA.mjs +0 -1
  73. package/dist/PagePreviewLayer-CBDGPMJQ.mjs +0 -1
  74. package/dist/ParticipantRuntime-FSZX2PUQ.mjs +0 -1
  75. package/dist/PhoneHostGate-OM7FLOJ2.mjs +0 -1
  76. package/dist/PopmeltTasteConnectedPane-KJSBPJQR.mjs +0 -1
  77. package/dist/QueuedReplies-ZYUDSTS2.mjs +0 -1
  78. package/dist/SuppliedContext-7THB2WZY.mjs +0 -1
  79. package/dist/ThreadErrorCard-J2VTA5JW.mjs +0 -1
  80. package/dist/ThreadPanel-PNVMIIYJ.mjs +0 -1
  81. package/dist/browser-runtime-FFT5NH66.mjs +0 -1
  82. package/dist/chunk-2ETPREWQ.mjs +0 -1
  83. package/dist/chunk-3WSTAV5B.mjs +0 -1
  84. package/dist/chunk-67OWRNU3.mjs +0 -30
  85. package/dist/chunk-BFVLMSG5.mjs +0 -1
  86. package/dist/chunk-BJ25TGJN.mjs +0 -1
  87. package/dist/chunk-E5WNW4WE.mjs +0 -1
  88. package/dist/chunk-F5XSNRGT.mjs +0 -1
  89. package/dist/chunk-FMI4VQDZ.mjs +0 -1
  90. package/dist/chunk-GRPDZGPP.mjs +0 -1
  91. package/dist/chunk-JRP5XFYN.mjs +0 -1
  92. package/dist/chunk-LD3532UC.mjs +0 -1
  93. package/dist/chunk-MP6ZV2DN.mjs +0 -1
  94. package/dist/chunk-N66ZZG3L.mjs +0 -1
  95. package/dist/chunk-P4KM3K5M.mjs +0 -1
  96. package/dist/chunk-PQT5FYN5.mjs +0 -1
  97. package/dist/chunk-R3FPXDQS.mjs +0 -1
  98. package/dist/chunk-RSUMSUAW.mjs +0 -1
  99. package/dist/chunk-TRHC7WBO.mjs +0 -1
  100. package/dist/chunk-XSMCZUDR.mjs +0 -1
  101. package/dist/chunk-YC5CUNRU.mjs +0 -1
  102. package/dist/codex-note-context-NUKGR2WT.mjs +0 -1
  103. package/dist/codex-project-KE7ZZ6YX.mjs +0 -1
  104. package/dist/focus-inspection-BPPRCMNN.mjs +0 -1
  105. package/dist/peer-client-UQDASAO7.mjs +0 -1
  106. /package/dist/{chunk-3GXLNBXU.mjs → chunk-YD3PDEFX.mjs} +0 -0
@@ -1 +0,0 @@
1
- "use client";import{b as e}from"./chunk-DOCRI237.mjs";import{f as t}from"./chunk-YC5CUNRU.mjs";import{b as n,a,c as o,d as i,e as r,s,r as l}from"./chunk-N66ZZG3L.mjs";import{domToCanvas as m}from"modern-screenshot";import{useId as c,useState as p,useLayoutEffect as u}from"react";async function h(s,l){if(s&&s.pathname===location.pathname)try{let c=n(s),p=a(c.element),u=c.legacyScene||(p&&(p===c.element||c.element?.closest("svg,canvas"))?p:null),h=u?"component":"element",d=u??o(c,"element",!1);if(!d||d.closest("[data-popmelt-explore-original],[data-popmelt-explore-scene]"))return;let{width:f,height:g}=d.getBoundingClientRect();if(f<=0||g<=0)return;let v=getComputedStyle(d),x={capturedAt:Date.now(),backdrop:e(d),selector:s.selector,pathname:s.pathname,scope:h,width:f,height:g,viewport:{width:innerWidth,height:innerHeight},textFonts:r(d),style:Object.fromEntries(i.map(e=>[e,v.getPropertyValue(e)]))};try{let e=l&&(d.matches("canvas")||d.querySelector("canvas"))?await l():[],n=await t(e,()=>m(d,{width:Math.ceil(f),height:Math.ceil(g),scale:Math.min(2,512/Math.max(f,g)),timeout:1500,backgroundColor:x.backdrop,style:{margin:"0",position:"static",transform:"none"},filter:e=>!(e instanceof Element&&e.matches("[data-devtools],[data-popmelt-root],[data-popmelt-explore-preview]"))}));for(;n.width&&n.height;){let e=n.toDataURL("image/webp",.8);if(e.length<=96e3&&/^data:image\/(webp|png);base64,/.test(e)){x.still=e;break}if(Math.max(n.width,n.height)<32)break;let t=document.createElement("canvas");t.width=Math.max(1,Math.floor(n.width/2)),t.height=Math.max(1,Math.floor(n.height/2)),t.getContext("2d").drawImage(n,0,0,t.width,t.height),n=t}}catch{}return x}catch{return}}async function d(e,t){let n=1===e.annotations.length&&e.annotations[0];n&&s(n.instruction??"")&&(e.exploreCapture=await h(l(n,location.pathname),t))}function f(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]),o=t,i=0;for(let[e,t]of a)i+=Math.max(0,t-Math.max(o,e)),o=Math.max(o,t);return i}function g(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 v(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 o=t[e.imageIndex];return o?[{id:e.id,imageIndex:e.imageIndex,label:0===a?"Initial state":n.get(e.id)??"State",url:o}]:[]})}function x(e){let t=e.instruction?.trim();return t?e.attachments?.some(e=>e.name?.trim()===t)?null:t:null}function b(e,t){let n=e?.tagName?.toLowerCase(),a=e?.id?`#${e.id}`:"",o=e?.className?`.${e.className.trim().split(/\s+/).slice(0,2).join(".")}`:"",i=n?`${n}${a}${o}`:t;return e?.reactComponent?`<${e.reactComponent}> ${i}`:i}function w(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 y(e){let t=e.annotations.map(e=>{let t=e.interactionEpisode?.steps.length??0;return{kind:"annotation",annotationId:e.id,pathname:e.pathname,text:x(e)??w(e),...t>0?{interactionEpisodeStepCount:t}:{}}}),n=new Map,a=e=>{let a=`${e.pathname??""}:${e.durableSelector??e.selector}`,o=n.get(a);if(o)return o.changes.push(e.text),void(void 0!==e.annotationNumber&&(void 0===o.annotationNumber||e.annotationNumber<o.annotationNumber)&&(o.annotationNumber=e.annotationNumber));let i={kind:"changes",elementKey:a,elementLabel:b(e.element,e.selector),...void 0!==e.annotationNumber?{annotationNumber:e.annotationNumber}:{},pathname:e.pathname,changes:[e.text]};n.set(a,i),t.push(i)};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 $(e){let t=e.annotations.flatMap(e=>{let t=x(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 M(e,t=96){let n=e.replace(/\s+/g," ").trim();return n.length>t?`${n.slice(0,Math.max(0,t-3))}...`:n}function k(e,t){let n=c(),[a,o]=p(-1),[i,r]=p(!1),s=t.some(({suffix:e})=>e);u(()=>{let t=e.current;if(!t||!s)return;let n=()=>o(t.matches(":focus")&&t.selectionStart===t.selectionEnd?t.selectionEnd:-1),a=()=>o(-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=i?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 o=/\s/.test(n.value.charAt(a)),i=l.suffix+(o?"":" ");return n.ownerDocument.execCommand?.("insertText",!1,i)||(n.setRangeText(i,a,a,"end"),t()),o&&n.setSelectionRange(a+i.length+1,a+i.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 C(e,t,n){return n?.activePreview?n.annotationNumber:e??t}function E(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{h as a,d as b,f as c,g as d,v as e,y as f,$ as g,M as h,k as i,C as j,E as k};