@popmelt.com/core 0.41.1 → 0.42.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/claude-plugin/.claude-plugin/plugin.json +1 -1
- package/codex-plugin/.codex-plugin/plugin.json +1 -1
- package/codex-plugin/assets/popmelt-logo.svg +1 -1
- package/dist/{ExploreAttachment-PTK4YHVE.mjs → ExploreAttachment-TRA62BMX.mjs} +1 -1
- package/dist/PagePreviewLayer-TX74TJBY.mjs +1 -0
- package/dist/ParticipantRuntime-Y7MKLWBC.mjs +1 -0
- package/dist/PhoneHostGate-XRYFSUJA.mjs +1 -0
- package/dist/{PopmeltProvider-5g-1VH5a.d.mts → PopmeltProvider-NwqjKtGG.d.mts} +1 -1
- package/dist/PopmeltTasteConnectedPane-NMKIRMDM.mjs +1 -0
- package/dist/{PreviewRuntime-7EQNIOF5.mjs → PreviewRuntime-VJXFECBF.mjs} +1 -1
- package/dist/{QueuedReplies-ESF5UL3J.mjs → QueuedReplies-X2N4JRS6.mjs} +1 -1
- package/dist/SamplePlacementOverlay-VWCULP2R.mjs +1 -0
- package/dist/ShareProjectPane-L6AO57IN.mjs +1 -0
- package/dist/SuppliedContext-UGQSL4IG.mjs +1 -0
- package/dist/{ThreadErrorCard-QGTWIV7B.mjs → ThreadErrorCard-WSNEGY7J.mjs} +1 -1
- package/dist/ThreadPanel-QNDCQOA4.mjs +1 -0
- package/dist/adapter-react-three-fiber.d.mts +1 -1
- package/dist/adapter-three.d.mts +1 -1
- package/dist/bridge-entry.mjs +1 -1
- package/dist/{bridgeSSEStream-2KKFO64A.mjs → bridgeSSEStream-BHUFYHTT.mjs} +1 -1
- package/dist/{bridgeWebSocketStream-XTHQPBPI.mjs → bridgeWebSocketStream-L277I5ZX.mjs} +1 -1
- package/dist/browser-runtime-3PAM2ZUE.mjs +1 -0
- package/dist/browser.d.mts +4 -4
- package/dist/browser.mjs +1 -1
- package/dist/{canvas-chat-note-XMVKWL2J.mjs → canvas-chat-note-HTK23RYE.mjs} +1 -1
- package/dist/canvas-text.d.mts +1 -1
- package/dist/{checkFixture-VWHN4ZNH.mjs → checkFixture-C26VSTGP.mjs} +1 -1
- package/dist/chunk-23YWKAQM.mjs +1 -0
- package/dist/chunk-2OWGUAUI.mjs +1 -0
- package/dist/{chunk-YTIDSDPP.mjs → chunk-2PARHFWP.mjs} +1 -1
- package/dist/chunk-2YT4X5VC.mjs +1 -0
- package/dist/{chunk-DMKBAI2Z.mjs → chunk-47SWWW5Y.mjs} +1 -1
- package/dist/chunk-56AALMHI.mjs +1 -0
- package/dist/chunk-5JAZXI47.mjs +1 -0
- package/dist/chunk-5SXPTNUM.mjs +1 -0
- package/dist/chunk-5YNIYMKX.mjs +1 -0
- package/dist/{chunk-EWNSX5BF.mjs → chunk-7PZN2RNE.mjs} +1 -1
- package/dist/chunk-ALW6WNDJ.mjs +1 -0
- package/dist/{chunk-ADRWR5GI.mjs → chunk-BH5BNULT.mjs} +1 -1
- package/dist/chunk-BZPWT44Z.mjs +1 -0
- package/dist/chunk-DAMF6ZWZ.mjs +1 -0
- package/dist/chunk-E7VH7WB5.mjs +1 -0
- package/dist/chunk-EBESPLST.mjs +1 -0
- package/dist/{chunk-7D4BUDKG.mjs → chunk-ECGXE2Z6.mjs} +1 -1
- package/dist/chunk-EEU5J3CD.mjs +1 -0
- package/dist/chunk-FGJX74DI.mjs +1 -0
- package/dist/chunk-I3LFTKJP.mjs +1 -0
- package/dist/chunk-K4CIGHJI.mjs +1 -0
- package/dist/chunk-KYS76O3N.mjs +1 -0
- package/dist/{chunk-77DD4HQE.mjs → chunk-LB66O2BP.mjs} +1 -1
- package/dist/chunk-LEMLTB2X.mjs +1 -0
- package/dist/chunk-M2BCEQDP.mjs +1 -0
- package/dist/{chunk-44NLL6X3.mjs → chunk-MYEG7OXO.mjs} +1 -1
- package/dist/chunk-NMMTIZ6K.mjs +1 -0
- package/dist/chunk-NWQGXYER.mjs +1 -0
- package/dist/{chunk-3UE2DLFY.mjs → chunk-OBYCW4I3.mjs} +1 -1
- package/dist/chunk-ODZOYCTC.mjs +1 -0
- package/dist/{chunk-HFKGW34E.mjs → chunk-OOFTFGZL.mjs} +1 -1
- package/dist/chunk-OSUJWNS2.mjs +1 -0
- package/dist/chunk-PACB6IBR.mjs +1 -0
- package/dist/{chunk-ENXCO63D.mjs → chunk-PGIWJ37M.mjs} +1 -1
- package/dist/{chunk-VSWRWS2H.mjs → chunk-PLRJ4GAR.mjs} +1 -1
- package/dist/{chunk-KF35YUNZ.mjs → chunk-QF5B6AYF.mjs} +1 -1
- package/dist/chunk-QKJPWA2I.mjs +1 -0
- package/dist/{chunk-4O6YFMWF.mjs → chunk-RBX7ANQX.mjs} +1 -1
- package/dist/chunk-RQHZNEA2.mjs +1 -0
- package/dist/{chunk-SZQTGYPS.mjs → chunk-SDXFJ7JW.mjs} +1 -1
- package/dist/{chunk-EHM2ZBQU.mjs → chunk-SKQA53J2.mjs} +1 -1
- package/dist/chunk-TJ25JLBL.mjs +1 -0
- package/dist/chunk-U522GPBG.mjs +1 -0
- package/dist/{chunk-5J4BZL6N.mjs → chunk-V5K4F2XQ.mjs} +1 -1
- package/dist/chunk-VGX6J2OP.mjs +1 -0
- package/dist/{chunk-EO3SHOXX.mjs → chunk-VPF4NHAP.mjs} +1 -1
- package/dist/{chunk-VJKC2RJB.mjs → chunk-WNCZCPTX.mjs} +1 -1
- package/dist/chunk-XMCHOGMG.mjs +1 -0
- package/dist/chunk-XNCN6DGG.mjs +30 -0
- package/dist/{chunk-P6XIVHP5.mjs → chunk-XRM2KI4C.mjs} +1 -1
- package/dist/{chunk-YU5PF45T.mjs → chunk-YFXYRNER.mjs} +1 -1
- package/dist/{chunk-YHCZYT4T.mjs → chunk-YZIDCW7A.mjs} +1 -1
- package/dist/chunk-Z32CLWW2.mjs +1 -0
- package/dist/{chunk-KCDHP4N3.mjs → chunk-ZCJCM3DT.mjs} +1 -1
- package/dist/{chunk-WIJSWSNF.mjs → chunk-ZE3LG7MR.mjs} +1 -1
- package/dist/chunk-ZEIVO4X7.mjs +1 -0
- package/dist/{chunk-SIGOY5GG.mjs → chunk-ZQLNGMVV.mjs} +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/codex-note-context-327LH622.mjs +1 -0
- package/dist/codex-project-25QJDNJN.mjs +1 -0
- package/dist/{codex-store-mount-VHUHC2ZA.mjs → codex-store-mount-BRHVGYZU.mjs} +1 -1
- package/dist/{dev-server-D8Qxrp1A.d.mts → dev-server-C-mvGeOM.d.mts} +2 -2
- package/dist/dev-server-ZLIPCFFT.mjs +1 -0
- package/dist/{focus-inspection-FVQ6TVGA.mjs → focus-inspection-TPTEFBH3.mjs} +1 -1
- package/dist/guest-admission.mjs +1 -1
- package/dist/guest-live-canvas.mjs +1 -1
- package/dist/index.d.mts +7 -7
- package/dist/index.mjs +1 -1
- package/dist/{invitationLink-LUIIOAEZ.mjs → invitationLink-RX53O6RI.mjs} +1 -1
- package/dist/media.d.mts +3 -3
- package/dist/memory-store.d.mts +6 -6
- package/dist/{page-interaction-74JGNCZ5.mjs → page-interaction-6SR32FFS.mjs} +1 -1
- package/dist/{page-planes-BeFZ3Wso.d.mts → page-planes-C5J6qgMj.d.mts} +99 -50
- package/dist/{participantBootstrap-BcfNTEe9.d.mts → participantBootstrap-BjHfrdwL.d.mts} +3 -2
- package/dist/peer-client-2LEZ7SW4.mjs +1 -0
- package/dist/phone-recovery.mjs +1 -0
- package/dist/plugin-astro.d.mts +7 -7
- package/dist/plugin-astro.mjs +1 -1
- package/dist/plugin-next.mjs +1 -1
- package/dist/plugin-nuxt.d.mts +5 -5
- package/dist/plugin-nuxt.mjs +1 -1
- package/dist/plugin-vite.d.mts +8 -7
- package/dist/plugin-vite.mjs +1 -1
- package/dist/project-id.mjs +1 -0
- package/dist/{protocol-BIUE4rB6.d.mts → protocol-aJ3S127Q.d.mts} +5 -1
- package/dist/server.d.mts +15 -7
- package/dist/server.mjs +1 -1
- package/dist/shared-page-KQSG3DM3.mjs +1 -0
- package/dist/{subjects-qHIrZrlt.d.mts → subjects-CGN4QTSS.d.mts} +1 -1
- package/dist/{video-adapter-B5eap10v.d.mts → video-adapter-DtIw_QVy.d.mts} +1 -1
- package/dist/{workspace-snapshot-RUGPDEYJ.mjs → workspace-snapshot-DX62ZFVF.mjs} +1 -1
- package/infra/phone-pairing/machine-config.mjs +15 -2
- package/infra/phone-pairing/machine-service.mjs +39 -13
- package/infra/phone-pairing/managed-install.mjs +8 -2
- package/package.json +1 -1
- package/dist/PagePreviewLayer-HMKZL5VB.mjs +0 -1
- package/dist/ParticipantRuntime-ELXK42P7.mjs +0 -1
- package/dist/PhoneHostGate-5S2WCM3W.mjs +0 -1
- package/dist/PopmeltTasteConnectedPane-BILMI6L2.mjs +0 -1
- package/dist/SamplePlacementOverlay-K3Z5C67A.mjs +0 -1
- package/dist/ShareProjectPane-P5HAKBKX.mjs +0 -1
- package/dist/SuppliedContext-ADMN2D2I.mjs +0 -1
- package/dist/ThreadPanel-Z76WNKPP.mjs +0 -1
- package/dist/browser-runtime-OWU4CMJB.mjs +0 -1
- package/dist/chunk-2F2BVGFH.mjs +0 -1
- package/dist/chunk-5TCWBNV4.mjs +0 -1
- package/dist/chunk-72CUIZA2.mjs +0 -1
- package/dist/chunk-C2ZSNUXQ.mjs +0 -1
- package/dist/chunk-EILBHZDX.mjs +0 -1
- package/dist/chunk-FAEFYWCY.mjs +0 -1
- package/dist/chunk-FQH24XFS.mjs +0 -1
- package/dist/chunk-G7UU6M76.mjs +0 -1
- package/dist/chunk-GYKRKAEF.mjs +0 -1
- package/dist/chunk-HAZXZ5TU.mjs +0 -1
- package/dist/chunk-HM6EBJVO.mjs +0 -1
- package/dist/chunk-IC4G3NXR.mjs +0 -1
- package/dist/chunk-ITLRSHNZ.mjs +0 -1
- package/dist/chunk-J3IPAD7E.mjs +0 -1
- package/dist/chunk-LZV3IYTM.mjs +0 -1
- package/dist/chunk-OEJXPUAR.mjs +0 -1
- package/dist/chunk-PRZ6C5X3.mjs +0 -1
- package/dist/chunk-RWZ7SVMO.mjs +0 -1
- package/dist/chunk-SHIN4R4V.mjs +0 -1
- package/dist/chunk-SMIEQSM5.mjs +0 -1
- package/dist/chunk-SOGN7S54.mjs +0 -1
- package/dist/chunk-SUAHDXJZ.mjs +0 -1
- package/dist/chunk-TMW3SI7F.mjs +0 -1
- package/dist/chunk-TRRNHBEH.mjs +0 -1
- package/dist/chunk-UFU5IA3G.mjs +0 -1
- package/dist/chunk-UNUYNWTJ.mjs +0 -1
- package/dist/chunk-VI3DNZM4.mjs +0 -1
- package/dist/chunk-VLTK7KWK.mjs +0 -1
- package/dist/chunk-WP44H6DL.mjs +0 -30
- package/dist/chunk-YG3RSK5J.mjs +0 -1
- package/dist/chunk-YTMUAK4P.mjs +0 -1
- package/dist/codex-note-context-PM4TA6WR.mjs +0 -1
- package/dist/codex-project-YSALZU44.mjs +0 -1
- package/dist/dev-server-KE4NM4WM.mjs +0 -1
- package/dist/peer-client-TSTD27DV.mjs +0 -1
- package/dist/shared-page-6AUYAPJ3.mjs +0 -1
- /package/dist/{chunk-CIKFUS7J.mjs → chunk-R565ZNSP.mjs} +0 -0
- /package/dist/{chunk-DPLSL33X.mjs → chunk-XBA5ROC5.mjs} +0 -0
- /package/dist/{toolbarFonts-33BI56VQ.mjs → toolbarFonts-RR24L4CJ.mjs} +0 -0
- /package/dist/{webpEncoder-JVMGDKHV.mjs → webpEncoder-XTISHUBA.mjs} +0 -0
package/dist/server.d.mts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { a as ParticipantAgentAdapter, b as ParticipantCredential, P as PopmeltHandle, d as ParticipantPlaneApps, e as PopmeltOptions, f as PhoneApp, g as PageFramework, N as NextBundlerFlag, G as GuestAppRequest, h as PeerSessions, i as PeerShape } from './page-planes-
|
|
2
|
-
export { j as ParticipantAgentView, k as createParticipantGuestAccess, c as createParticipantPlaneApps } from './page-planes-
|
|
3
|
-
import { f as ParticipantBootstrapConfig } from './participantBootstrap-
|
|
1
|
+
import { a as ParticipantAgentAdapter, b as ParticipantCredential, P as PopmeltHandle, d as ParticipantPlaneApps, e as PopmeltOptions, f as PhoneApp, g as PageFramework, N as NextBundlerFlag, G as GuestAppRequest, h as PeerSessions, i as PeerShape } from './page-planes-C5J6qgMj.mjs';
|
|
2
|
+
export { j as ParticipantAgentView, k as createParticipantGuestAccess, c as createParticipantPlaneApps } from './page-planes-C5J6qgMj.mjs';
|
|
3
|
+
import { f as ParticipantBootstrapConfig } from './participantBootstrap-BjHfrdwL.mjs';
|
|
4
4
|
import * as node_http from 'node:http';
|
|
5
5
|
import { IncomingMessage, ServerResponse } from 'node:http';
|
|
6
6
|
import { c as ImprintGraph, d as ImprintTransaction, e as ImprintMutation, f as ImprintContext, g as ImprintSummaryKind, h as ImprintExplanationKind, i as ImprintScope, j as ImprintTopologyRelationType, k as ImprintExplanationRef, I as ImprintThreadSummary, a as ImprintGroundingAction, l as ImprintRelation, Q as QualifiedImprintRelation } from './types-XKO-uva0.mjs';
|
|
7
7
|
export { m as ImprintConcrete, n as ImprintEvidence, o as ImprintExplanation, p as ImprintExplanationState, q as ImprintRelationType } from './types-XKO-uva0.mjs';
|
|
8
8
|
import 'vite';
|
|
9
|
-
import './protocol-
|
|
10
|
-
import './
|
|
9
|
+
import './protocol-aJ3S127Q.mjs';
|
|
10
|
+
import './subjects-CGN4QTSS.mjs';
|
|
11
|
+
import './PopmeltProvider-NwqjKtGG.mjs';
|
|
11
12
|
import 'react';
|
|
12
|
-
import './
|
|
13
|
-
import './video-adapter-B5eap10v.mjs';
|
|
13
|
+
import './video-adapter-DtIw_QVy.mjs';
|
|
14
14
|
|
|
15
15
|
/** One disposable, local Chrome profile per agent. Never attaches to a user's browser. */
|
|
16
16
|
declare function managedParticipantBrowser(url: string): ParticipantAgentAdapter;
|
|
@@ -282,6 +282,13 @@ declare function startDevelopmentSession(options: {
|
|
|
282
282
|
port: number;
|
|
283
283
|
projectId: string;
|
|
284
284
|
storeId?: string;
|
|
285
|
+
guestRecoveryUrl?: () => string | undefined;
|
|
286
|
+
redeemGuestHandoff?: (ticket: string, origin: string) => Promise<{
|
|
287
|
+
bookmark: string;
|
|
288
|
+
credential: ParticipantCredential;
|
|
289
|
+
sharedPath: string;
|
|
290
|
+
}>;
|
|
291
|
+
checkGuestBookmark?: (bookmark: string) => Promise<void>;
|
|
285
292
|
visitGuestInvite?: PeerSessions["visitGuestInvite"];
|
|
286
293
|
guestInviteAppearance?: (invitation: string) => Promise<{
|
|
287
294
|
projectName?: string;
|
|
@@ -292,6 +299,7 @@ declare function startDevelopmentSession(options: {
|
|
|
292
299
|
id: string;
|
|
293
300
|
revision?: string;
|
|
294
301
|
}>;
|
|
302
|
+
remoteGuestAvailable?: () => boolean;
|
|
295
303
|
participantHost?: () => Promise<ParticipantCredential>;
|
|
296
304
|
}>;
|
|
297
305
|
|
package/dist/server.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as t,b as s,c as m}from"./chunk-
|
|
1
|
+
import{a as t,b as s,c as m}from"./chunk-XMCHOGMG.mjs";import"./chunk-WNCZCPTX.mjs";import"./chunk-PCUUOIFD.mjs";import"./chunk-YZIDCW7A.mjs";import{h as a,i as r,j as i,k as p}from"./chunk-XNCN6DGG.mjs";import"./chunk-ALWPAFIW.mjs";import"./chunk-BSVZXOOS.mjs";import"./chunk-7OATJ6BO.mjs";import{a as n,b as o}from"./chunk-NC7YXD7Q.mjs";import"./chunk-KOHR4LAQ.mjs";import{b as c,e,f as u}from"./chunk-TJ25JLBL.mjs";import{b as h}from"./chunk-NMMTIZ6K.mjs";import"./chunk-HKHZBKAN.mjs";import"./chunk-R565ZNSP.mjs";import"./chunk-ZEIVO4X7.mjs";import"./chunk-GLF7Z5IR.mjs";import"./chunk-KD2AOPYP.mjs";import"./chunk-KF73S7MG.mjs";import"./chunk-NOHXTT24.mjs";export{p as ImprintService,a as ImprintStore,u as createParticipantDevBootstrap,c as createParticipantGuestAccess,e as createParticipantHostEntry,h as createParticipantPlaneApps,i as formatImprintPrompt,n as imprintExplanationRef,t as managedParticipantBrowser,r as parseImprintDraft,o as qualifyImprintRelation,m as startDevelopmentSession,s as startPopmelt};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as a,d as r}from"./chunk-YZIDCW7A.mjs";import"./chunk-HKHZBKAN.mjs";import"./chunk-R565ZNSP.mjs";import"./chunk-KF73S7MG.mjs";export{r as createSharedPageReader,a as sharedPagePath};
|
|
@@ -625,4 +625,4 @@ type PopmeltSubjectAdapter = {
|
|
|
625
625
|
removeSubject?(key: string): void;
|
|
626
626
|
};
|
|
627
627
|
|
|
628
|
-
export type { Annotation as A, BridgeStatus as B, CanvasSampleCodec as C, DomModification as D, ElementInfo as E, ImageObjectContext as I, OpaqueTargetReference as O, PopmeltSubjectAdapter as P, ReactSourceLocation as R, SubjectFeedbackAttachment as S, TextModification as T, VideoObjectContext as V, PopmeltSubjectBounds as a, PopmeltSubject as b, PopmeltSubjectCreationSession as c, PopmeltSubjectOutlinePoint as d, PopmeltSubjectTrackingAnchor as e, AnnotationAttachment as f, StyleModification as g, SpacingTokenChange as h, AnnotationRegion as i, AnnotationType as j, ClaudeResponse as k, Point as l, PopmeltSurfaceSnapshot as m, StyleChange as n, ToolType as o,
|
|
628
|
+
export type { Annotation as A, BridgeStatus as B, CanvasSampleCodec as C, DomModification as D, ElementInfo as E, ImageObjectContext as I, OpaqueTargetReference as O, PopmeltSubjectAdapter as P, ReactSourceLocation as R, SubjectFeedbackAttachment as S, TextModification as T, VideoObjectContext as V, PopmeltSubjectBounds as a, PopmeltSubject as b, PopmeltSubjectCreationSession as c, PopmeltSubjectOutlinePoint as d, PopmeltSubjectTrackingAnchor as e, AnnotationAttachment as f, StyleModification as g, SpacingTokenChange as h, AnnotationRegion as i, AnnotationType as j, ClaudeResponse as k, Point as l, PopmeltSurfaceSnapshot as m, StyleChange as n, ToolType as o, AnnotationState as p, StickerFamily as q, StickerSubproperty as r };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as PopmeltSubjectAdapter, b as PopmeltSubject, E as ElementInfo, c as PopmeltSubjectCreationSession, a as PopmeltSubjectBounds, d as PopmeltSubjectOutlinePoint, e as PopmeltSubjectTrackingAnchor } from './subjects-
|
|
1
|
+
import { P as PopmeltSubjectAdapter, b as PopmeltSubject, E as ElementInfo, c as PopmeltSubjectCreationSession, a as PopmeltSubjectBounds, d as PopmeltSubjectOutlinePoint, e as PopmeltSubjectTrackingAnchor } from './subjects-CGN4QTSS.mjs';
|
|
2
2
|
|
|
3
3
|
/** Geometry is normalized against the loaded image, not its rendered size. */
|
|
4
4
|
type ImageObjectBox = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{
|
|
1
|
+
"use client";import{c as t}from"./chunk-5YNIYMKX.mjs";import{f as e}from"./chunk-AAMUU2QA.mjs";import{v as n,d as a,o as i}from"./chunk-LH7HKUCK.mjs";import"./chunk-YGP6PPOZ.mjs";function r(t,e){let n=t.filter(t=>!(e.kind&&t.kind!==e.kind||e.entryId&&t.id!==e.entryId||e.pathname&&t.pathname!==e.pathname)),a=Number.isInteger(e.limit)?Math.min(50,Math.max(1,e.limit)):20,i=Number.isInteger(e.offset)?Math.max(0,e.offset):0;return{entries:n.slice(i,i+a).map(({details:t,...n})=>e.entryId?{...n,details:t}:n),total:n.length,nextOffset:i+a<n.length?i+a:null}}function o(r,o,s,d=!1){if(!r||!o)return null;let c=e=>{let n=a(e),r=t(e),o=t=>t.width>0&&t.height>0&&t.bottom>0&&t.right>0&&t.top<innerHeight&&t.left<innerWidth;return e.isConnected&&n.width>0&&n.height>0&&(d||o(n)||!!r&&o(r))&&!i(e,'[data-popmelt-private], [aria-hidden="true"]')},u=t=>{try{let e=t?document.querySelectorAll(t):[];return 1===e.length?e[0]:null}catch{return null}};if(o.startsWith("thread:")){let t=o.slice(7),a=[...document.querySelectorAll("[data-popmelt-thread-id]")].filter(e=>e.getAttribute("data-popmelt-thread-id")===t&&c(e));if(1===a.length)return a[0].querySelector("[data-popmelt-thread-header]");let i=r.annotations.filter(n=>n.threadId===t&&(!n.pathname||n.pathname===e(location.pathname))),l=new Set(i.map(t=>t.target?s.resolve(t.target)?.element??null:n(t.linkedSelector,t.elements?.[0])).filter(t=>!!t&&c(t)));return 1===l.size?[...l][0]:null}let m=l(r,{entryId:o});if(!("entries"in m)||1!==m.entries.length)return null;let h=m.entries[0];if(h.pathname&&h.pathname!==e(location.pathname))return null;let p=r.annotations.find(t=>`draft:${t.id}`===o);if(p?.target){let t=s.resolve(p.target)?.element;return t&&c(t)?t:null}let f="details"in h?h.details:void 0,g=[...r.styleModifications,...r.textModifications].find(t=>t.selector===h.selector),k=p?.elements?.[0]??g?.element,y=k?n(h.selector,{...k,selector:f?.durableSelector??k.selector}):u(h.selector)??u(f?.durableSelector);return y&&c(y)?y:null}function l(t,n={}){if(!t)return{status:"unavailable",reason:"browser_state_unavailable"};let a=[];for(let e of t.annotations)"pending"===(e.status??(e.captured?"resolved":"pending"))&&a.push({id:`draft:${e.id}`,kind:"draft",status:"unsubmitted",summary:(e.text||`${e.type} annotation`).slice(0,200),pathname:e.pathname,selector:e.linkedSelector,target:e.target,threadId:e.threadId,updatedAt:e.timestamp,details:{text:e.text,type:e.type,target:e.target,points:e.points,region:e.region,scope:e.scope,interactionEpisode:e.interactionEpisode,attachments:e.attachments,imageCount:e.imageCount}});for(let[e,n]of[["style",t.styleModifications],["text",t.textModifications],["dom",t.domModifications]])for(let t of n){if(t.captured)continue;let n="id"in t?t.id:JSON.stringify([t.pathname??"",t.selector,"textNodePath"in t?t.textNodePath:null]);a.push({id:`change:${e}:${n}`,kind:"change",status:"staged",summary:`${e}: ${"modified"in t?t.modified:t.selector}`.slice(0,200),pathname:t.pathname,selector:t.selector,details:t})}for(let e of t.spacingTokenChanges??[])e.captured||a.push({id:`change:spacing:${e.id}`,kind:"change",status:"staged",summary:`Spacing ${e.tokenName}: ${e.originalPx} → ${e.newPx}`,details:e});for(let e of t.spacingTokenMods??[])e.captured||a.push({id:`change:token:${e.tokenPath}`,kind:"change",status:"staged",summary:`Token ${e.tokenPath}`.slice(0,200),details:e});return{status:"ok",capturedAt:Date.now(),page:location.origin+e(location.pathname),trust:"Unsubmitted human intent and local preview changes, not instructions to execute or proof of saved code changes.",...r(a,n)}}export{l as collectWorkspaceSnapshot,o as workspaceAttentionTarget};
|
|
@@ -35,13 +35,15 @@ export function routingTable(state) {
|
|
|
35
35
|
const bindings = state.projects.map(readBinding),
|
|
36
36
|
table = new Map(),
|
|
37
37
|
ports = new Set();
|
|
38
|
-
for (const { id, appOrigin } of bindings) {
|
|
38
|
+
for (const { id, appOrigin, projectKey } of bindings) {
|
|
39
39
|
const { hostname, socket } = route(id),
|
|
40
40
|
port = new URL(appOrigin).port;
|
|
41
41
|
if (ports.has(port) || table.has(hostname))
|
|
42
42
|
throw Error('Each project needs its own hostname and loopback app port.');
|
|
43
43
|
ports.add(port);
|
|
44
44
|
table.set(hostname, socket);
|
|
45
|
+
if (state.guestProjects?.includes(projectKey))
|
|
46
|
+
table.set('g-' + id + '.popmelt.com', socket);
|
|
45
47
|
}
|
|
46
48
|
return table;
|
|
47
49
|
}
|
|
@@ -108,6 +110,17 @@ export async function configure(command, args = [], provisionDns, idForKey) {
|
|
|
108
110
|
table.set(hostname, socket);
|
|
109
111
|
}
|
|
110
112
|
}
|
|
113
|
+
if (command === 'guest') {
|
|
114
|
+
const [key, id] = args;
|
|
115
|
+
if (!state.projects.includes(key) || readBinding(key).id !== id)
|
|
116
|
+
throw Error('Guest preview requires an existing paired project.');
|
|
117
|
+
const guestHostname = 'g-' + id + '.popmelt.com';
|
|
118
|
+
if (!state.guestProjects?.includes(key)) {
|
|
119
|
+
await provisionDns(state.tunnel, guestHostname, key);
|
|
120
|
+
(state.guestProjects ??= []).push(key);
|
|
121
|
+
table.set(guestHostname, route(id).socket);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
111
124
|
if (command === 'run') state.liveRouting = true;
|
|
112
125
|
const ingress = state.liveRouting
|
|
113
126
|
? [{ hostname: '*.popmelt.com', service: 'unix:' + routerSocket }]
|
|
@@ -144,7 +157,7 @@ export async function configure(command, args = [], provisionDns, idForKey) {
|
|
|
144
157
|
return {
|
|
145
158
|
tunnel: state.tunnel,
|
|
146
159
|
config,
|
|
147
|
-
projects:
|
|
160
|
+
projects: state.projects.length,
|
|
148
161
|
...(project && route(project.id)),
|
|
149
162
|
};
|
|
150
163
|
});
|
|
@@ -132,7 +132,13 @@ export async function serve(registerDns = provisionDns, idForKey) {
|
|
|
132
132
|
res.setHeader('Cache-Control', 'private, no-store');
|
|
133
133
|
if (
|
|
134
134
|
req.headers.origin === 'https://pair.popmelt.com' &&
|
|
135
|
-
[
|
|
135
|
+
[
|
|
136
|
+
'/__pair/options',
|
|
137
|
+
'/__pair/finish',
|
|
138
|
+
'/__pair/guest/options',
|
|
139
|
+
'/__pair/guest/finish',
|
|
140
|
+
'/__pair/guest/destination',
|
|
141
|
+
].includes(req.url)
|
|
136
142
|
) {
|
|
137
143
|
res.setHeader('Access-Control-Allow-Origin', req.headers.origin);
|
|
138
144
|
res.setHeader('Vary', 'Origin');
|
|
@@ -150,6 +156,20 @@ export async function serve(registerDns = provisionDns, idForKey) {
|
|
|
150
156
|
req.method === 'GET' &&
|
|
151
157
|
req.headers['sec-fetch-mode'] === 'navigate'
|
|
152
158
|
) {
|
|
159
|
+
const guest = /^g-([a-f0-9]{32})\.popmelt\.com$/.exec(
|
|
160
|
+
req.headers.host,
|
|
161
|
+
)?.[1];
|
|
162
|
+
if (guest) {
|
|
163
|
+
res.setHeader('Retry-After', '3');
|
|
164
|
+
return res
|
|
165
|
+
.writeHead(503, {
|
|
166
|
+
'Content-Type': 'text/html; charset=utf-8',
|
|
167
|
+
'Content-Security-Policy': "default-src 'none'",
|
|
168
|
+
})
|
|
169
|
+
.end(
|
|
170
|
+
'<!doctype html><meta name="viewport" content="width=device-width,initial-scale=1"><meta http-equiv="refresh" content="3"><title>Project reconnecting</title><p>The shared project is restarting. This tab will retry.</p>',
|
|
171
|
+
);
|
|
172
|
+
}
|
|
153
173
|
const id = /^p-([a-f0-9]{32})\.popmelt\.com$/.exec(
|
|
154
174
|
req.headers.host,
|
|
155
175
|
)?.[1];
|
|
@@ -167,7 +187,7 @@ export async function serve(registerDns = provisionDns, idForKey) {
|
|
|
167
187
|
const closeHmr = serveViteHmr(router, (req) => {
|
|
168
188
|
const host = req.headers.host;
|
|
169
189
|
const socketPath = routes.get(host);
|
|
170
|
-
if (socketPath && req.headers.cookie)
|
|
190
|
+
if (socketPath && host.startsWith('p-') && req.headers.cookie)
|
|
171
191
|
return { host, socketPath, cookie: req.headers.cookie };
|
|
172
192
|
});
|
|
173
193
|
// Serialize adds, including the DNS operation. Duplicate clicks reuse the
|
|
@@ -176,7 +196,7 @@ export async function serve(registerDns = provisionDns, idForKey) {
|
|
|
176
196
|
const control = createServer({ requestTimeout: 10000 }, async (req, res) => {
|
|
177
197
|
if (
|
|
178
198
|
req.method !== 'POST' ||
|
|
179
|
-
|
|
199
|
+
!['/projects', '/guest-project'].includes(req.url) ||
|
|
180
200
|
req.headers['content-type'] !== 'application/json'
|
|
181
201
|
) {
|
|
182
202
|
res.writeHead(404).end();
|
|
@@ -190,27 +210,33 @@ export async function serve(registerDns = provisionDns, idForKey) {
|
|
|
190
210
|
if (size > 8192) throw Error('Invalid project registration.');
|
|
191
211
|
chunks.push(chunk);
|
|
192
212
|
}
|
|
193
|
-
const { root, origin, reconnectId } = JSON.parse(
|
|
213
|
+
const { root, origin, reconnectId, key, id } = JSON.parse(
|
|
194
214
|
Buffer.concat(chunks).toString('utf8'),
|
|
195
215
|
);
|
|
216
|
+
const guest = req.url === '/guest-project';
|
|
196
217
|
if (
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
218
|
+
guest
|
|
219
|
+
? typeof key !== 'string' ||
|
|
220
|
+
!/^[0-9a-f]{64}$/.test(key) ||
|
|
221
|
+
typeof id !== 'string' ||
|
|
222
|
+
!/^[0-9a-f]{32}$/.test(id)
|
|
223
|
+
: typeof root !== 'string' ||
|
|
224
|
+
!isAbsolute(root) ||
|
|
225
|
+
typeof origin !== 'string' ||
|
|
226
|
+
(reconnectId !== undefined &&
|
|
227
|
+
(typeof reconnectId !== 'string' ||
|
|
228
|
+
!/^[0-9a-f]{32}$/.test(reconnectId)))
|
|
203
229
|
)
|
|
204
230
|
throw Error('Invalid project registration.');
|
|
205
231
|
const added = tail.then(async () => {
|
|
206
232
|
const result = await configure(
|
|
207
|
-
'add',
|
|
208
|
-
[root, origin, reconnectId],
|
|
233
|
+
guest ? 'guest' : 'add',
|
|
234
|
+
guest ? [key, id] : [root, origin, reconnectId],
|
|
209
235
|
registerDns,
|
|
210
236
|
idForKey,
|
|
211
237
|
);
|
|
212
238
|
routes = routingTable(readState());
|
|
213
|
-
return result;
|
|
239
|
+
return guest ? { id, hostname: 'g-' + id + '.popmelt.com' } : result;
|
|
214
240
|
});
|
|
215
241
|
tail = added.catch(() => {});
|
|
216
242
|
const result = await added;
|
|
@@ -132,11 +132,17 @@ export async function managedDns() {
|
|
|
132
132
|
return {
|
|
133
133
|
idForKey: (key) => projectId(deviceId, key),
|
|
134
134
|
register: async (tunnel, hostname, key) => {
|
|
135
|
-
const
|
|
135
|
+
const guest =
|
|
136
|
+
hostname === 'g-' + projectId(deviceId, key) + '.popmelt.com';
|
|
137
|
+
const result = await send(device, '/v1/project', {
|
|
138
|
+
project: key,
|
|
139
|
+
...(guest && { guest: true }),
|
|
140
|
+
});
|
|
136
141
|
if (
|
|
137
142
|
result.tunnel !== tunnel ||
|
|
138
143
|
result.id !== projectId(deviceId, key) ||
|
|
139
|
-
hostname !== 'p-' + result.id + '.popmelt.com'
|
|
144
|
+
hostname !== (guest ? 'g-' : 'p-') + result.id + '.popmelt.com' ||
|
|
145
|
+
(guest && result.guest !== true)
|
|
140
146
|
)
|
|
141
147
|
throw Error('Could not verify the project registration.');
|
|
142
148
|
},
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";export{f as PagePreviewLayer}from"./chunk-SIGOY5GG.mjs";import"./chunk-J3IPAD7E.mjs";import"./chunk-JWWWU4GY.mjs";import"./chunk-Q6N77LIS.mjs";import"./chunk-FHCKFQBY.mjs";import"./chunk-APP5IYTE.mjs";import"./chunk-VOL4KS67.mjs";import"./chunk-53SKVMWR.mjs";import"./chunk-AOTDTBQO.mjs";import"./chunk-WP2SHSCG.mjs";import"./chunk-LH7HKUCK.mjs";import"./chunk-ZVDKW7TO.mjs";import"./chunk-Q6C7ZA3H.mjs";import"./chunk-7D4BUDKG.mjs";import"./chunk-OEJXPUAR.mjs";import"./chunk-HM6EBJVO.mjs";import"./chunk-SUAHDXJZ.mjs";import"./chunk-YGP6PPOZ.mjs";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";import{d as t,b as e,c as o,a as r}from"./chunk-YTMUAK4P.mjs";import"./chunk-UFU5IA3G.mjs";import"./chunk-EO3SHOXX.mjs";import{f as i}from"./chunk-GYKRKAEF.mjs";import"./chunk-RXC7B7SX.mjs";import"./chunk-SZQTGYPS.mjs";import"./chunk-FQH24XFS.mjs";import"./chunk-SOGN7S54.mjs";import"./chunk-P6XIVHP5.mjs";import"./chunk-VSWRWS2H.mjs";import"./chunk-B4RLDY5H.mjs";import"./chunk-PH2MLB3T.mjs";import"./chunk-SHIN4R4V.mjs";import"./chunk-XTOCFTVW.mjs";import"./chunk-EHM2ZBQU.mjs";import{a as n}from"./chunk-YU5PF45T.mjs";import{h as a,X as s}from"./chunk-IC4G3NXR.mjs";import"./chunk-PRZ6C5X3.mjs";import"./chunk-VOL4KS67.mjs";import"./chunk-VLTK7KWK.mjs";import"./chunk-EWNSX5BF.mjs";import"./chunk-G2ZHJXHZ.mjs";import"./chunk-53SKVMWR.mjs";import"./chunk-TMW3SI7F.mjs";import"./chunk-RK6UROPO.mjs";import"./chunk-AOTDTBQO.mjs";import"./chunk-2F2BVGFH.mjs";import"./chunk-RWZ7SVMO.mjs";import"./chunk-HAZXZ5TU.mjs";import"./chunk-YTIDSDPP.mjs";import"./chunk-KF35YUNZ.mjs";import"./chunk-VBH2YQLG.mjs";import"./chunk-VXRRHXUP.mjs";import"./chunk-WP2SHSCG.mjs";import{e as c,g as l,f as p}from"./chunk-AAMUU2QA.mjs";import"./chunk-LH7HKUCK.mjs";import{a as m}from"./chunk-77DD4HQE.mjs";import{b as h,f as u,c as d,d as f}from"./chunk-5TCWBNV4.mjs";import{p as j}from"./chunk-ENXCO63D.mjs";import"./chunk-DUWONLQE.mjs";import"./chunk-ATLUO4G7.mjs";import"./chunk-YG3RSK5J.mjs";import"./chunk-C2ZSNUXQ.mjs";import"./chunk-EILBHZDX.mjs";import"./chunk-HFKGW34E.mjs";import"./chunk-ZVDKW7TO.mjs";import"./chunk-HQVWOBYH.mjs";import"./chunk-Q6C7ZA3H.mjs";import"./chunk-OREALBUO.mjs";import"./chunk-CK3CDA3L.mjs";import{c as k,a as g}from"./chunk-7D4BUDKG.mjs";import"./chunk-OEJXPUAR.mjs";import{V as w}from"./chunk-KE4MQBRY.mjs";import"./chunk-B4DYUYX4.mjs";import"./chunk-HM6EBJVO.mjs";import"./chunk-ADRWR5GI.mjs";import{b as S}from"./chunk-SUAHDXJZ.mjs";import"./chunk-PRPXMDZ7.mjs";import"./chunk-YGP6PPOZ.mjs";import{useState as y,useSyncExternalStore as v,useEffect as P}from"react";import{jsx as I,jsxs as O}from"react/jsx-runtime";function H(t,i){let n,a={phase:"starting"},m=0,j=!1,k=!1,g=0,w=new Set,y=`popmelt-participant:${t.projectId}`,v=new h(t.url,t.projectId),P=t=>{if(!k){a=t;for(let t of w)t()}},I=()=>history.state?.popmeltGuestEntry===t.projectId,O=e=>history.replaceState({...history.state,popmeltGuestEntry:t.projectId},"",e),H=t=>fetch("/__popmelt/host",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify(t),redirect:"error"}),U=async(e={},o=!1,r)=>{if(S(t.url))return null;let i=await H(e);if(403===i.status){let e=i.headers.get("X-Popmelt-Host-Origin"),n=i.headers.get("X-Popmelt-Session"),a=new URL(location.href);if(!o||!n||window.top!==window||!["localhost","127.0.0.1","[::1]"].includes(a.hostname)||a.pathname.startsWith("/__popmelt/")||a.searchParams.has("__popmelt_code_preview")||a.hash.includes("popmelt-")||I())return null;let s=localStorage.getItem(`popmelt-admission:${t.projectId}`);if(s)try{if(JSON.parse(s)?.receipt)return null}catch{return null}if(e&&function(t,e){try{let o=new URL(t),r=new URL(e),i=["localhost","127.0.0.1","[::1]"];return o.origin===t&&r.origin===e&&t!==e&&["http:","https:"].includes(o.protocol)&&o.protocol===r.protocol&&o.port===r.port&&i.includes(o.hostname)&&i.includes(r.hostname)}catch{return!1}}(location.origin,e)){let t=await fetch(e+"/__popmelt/host",{method:"HEAD",credentials:"omit",redirect:"error",referrerPolicy:"no-referrer",signal:AbortSignal.timeout(2e3)}).catch(()=>null);if(!k&&204===t?.status&&t.headers.get("X-Popmelt-Session")===n)throw a.host=new URL(e).host,location.replace(a.href),A;return null}let c=i.headers.get("X-Popmelt-Local-Port");if(!c||!/^[1-9]\d{0,4}$/.test(c)||Number(c)>65535)return null;let l=await fetch("http://127.0.0.1:"+c+"/",{method:"POST",headers:{"X-Popmelt-Session":n},credentials:"omit",cache:"no-store",redirect:"error",referrerPolicy:"no-referrer",signal:AbortSignal.timeout(6500)}).catch(()=>null);if(!l?.ok||k)return null;let p=await l.json().catch(()=>null);if("string"!=typeof p?.proof||(i=await H({localProof:p.proof,previousId:r}),403===i.status))return null}if(!i.ok)throw new Error(`Host entry unavailable (${i.status}).`);let n=`popmelt-before-participants:${t.projectId}`;return null===localStorage.getItem(n)&&localStorage.setItem(n,JSON.stringify(Object.fromEntries(Object.values(s(t.projectId)).map(t=>[t,localStorage.getItem(t)])))),await i.json()},A=Symbol("navigating"),R=async(a,s=g)=>{if(k||s!==g)return;let m=await r({bridgeUrl:t.url,projectId:t.projectId,credential:a,runtimeStorage:sessionStorage,observedSource:{sourceId:t.projectId,revision:t.revision},loadOwnSource:i,prepareApplication:t.planeApps?async r=>{if(k||s!==g)throw A;let i=c(location.pathname);if(r.author.id===a.participantId&&"host"===r.author.relationship&&!S(t.url)){if("/"!==i){let t=new URL(location.href);throw t.pathname=p(t.pathname),location.replace(t.href),A}return("/"===r.ownWorkspace?.basePath?r.ownWorkspace.revision:void 0)??r.draft.source?.revision??t.revision}let n=await e(a,a.participantId,void 0,location.pathname);if(k||s!==g)throw A;let m=o(n.application);if(t.appVersion??(t.appVersion=n.application.version),m!==l(location.pathname)||t.appVersion&&t.appVersion!==n.application.version)throw localStorage.setItem(y,JSON.stringify(a)),location.replace(m+location.search+location.hash),A;return n.application.basis??t.revision}:void 0}).catch(t=>{if(t!==A)throw t});if(m){if(k||s!==g)return void m.dispose();try{localStorage.setItem(y,JSON.stringify(a))}catch(t){throw m.dispose(),t}if(n?.dispose(),I()){let t={...history.state};delete t.popmeltGuestEntry,history.replaceState(t,"")}n=m,P({phase:"connected",connection:m}),U({credential:a}).catch(()=>{})}},b=()=>{O(location.href),g++,n?.dispose(),n=void 0,function(t,e){t.removeItem(`popmelt-participant:${e}`);let o,r=`popmelt-admission:${e}`;try{o=JSON.parse(t.getItem(r)??"null")}catch{return void t.removeItem(r)}o&&"object"==typeof o&&t.setItem(r,JSON.stringify({name:o.name,colorIdentity:o.colorIdentity??o.receipt}))}(localStorage,t.projectId),P({phase:"entry",invitation:null})};return{client:v,getSnapshot:()=>a,subscribe:t=>(w.add(t),()=>{w.delete(t)}),retain(){if(k)throw new Error("Participant lifecycle is disposed");m++,j||(j=!0,(async()=>{let t=u(location.href),e=new URL(t.cleanUrl),o=new URLSearchParams(e.hash.slice(1)),r=o.get("popmelt-host");o.delete("popmelt-host"),r&&(e.hash=o.toString()),t.token?O(e.href):e.href!==location.href&&history.replaceState(history.state,"",e);let i=null;if(r){if(i=await U({token:r}),!i&&!t.token&&(i=await U({},!0)),!i)throw new Error("Host entry expired. Use the current private host link.")}else if(!t.token&&!I()){try{i=JSON.parse(localStorage.getItem(y)??"null")}catch{}i??(i=await U({},!0))}if(k)return;if(!i)return void P({phase:"entry",invitation:t.token??null});let n=g;for(let e=1;!k&&n===g;e++)try{return void await R(i,n)}catch(o){if(k||n!==g)return;if(d(o)){P({phase:"error",message:o.message}),await new Promise(t=>setTimeout(t,f(e)));continue}if("access_removed"===o.code)return void b();if(401!==o.status)throw o;let a=await U({},!r&&!t.token,i.participantId);return void(a?await R(a):b())}})().catch(t=>{t!==A&&P({phase:"error",message:t.message})}));let t=!1;return()=>{t||(t=!0,m--,queueMicrotask(()=>{m||k||(k=!0,g++,n?.dispose(),n=void 0,w.clear())}))}},removed:b,async join(e,o){if("entry"!==a.phase||!a.invitation||k)throw new Error("No active invitation");if(!o)throw new Error("Peer identity is not ready");let r=g,i=await v.joinOrRequestAdmission(a.invitation,e,o);if(!k&&r===g){if("admission"in i)return localStorage.setItem(`popmelt-admission:${t.projectId}`,JSON.stringify({name:i.admission.name,receipt:o,colorIdentity:o})),void P({phase:"entry",invitation:null});await R(i.joined.credential,r)}},admit:t=>R(t)}}function U({config:r,loadOwnSource:s,children:p}){let[h]=y(()=>H(r,s)),u=a(),d=v(h.subscribe,h.getSnapshot,h.getSnapshot);P(()=>h.retain(),[h]);let[f,U,A]=k(),R="connected"===d.phase?d.connection:null;if(P(()=>{if(!R||!r.planeApps)return;let t,i=new AbortController,n=R.isHost&&!S(r.url)&&"/"===c(location.pathname),a=n?void 0:r.appVersion,s=async()=>{try{let t=await e(R.credential,R.credential.participantId,i.signal,location.pathname);if(n&&"/"!==t.application.basePath)throw new Error("Host checkout unavailable");let s=o(t.application);if(a??(a=t.application.version),!i.signal.aborted&&(s!==l(location.pathname)||t.application.version!==a)){if(R.isHost&&!S(r.url)){let t=await fetch(s+location.search,{method:"HEAD",headers:{Accept:"text/html"},mode:"same-origin",cache:"no-store",signal:i.signal});if(!t.ok||!t.headers.get("content-type")?.includes("text/html")||l(new URL(t.url).pathname)!==s)throw new Error("Host plane document unavailable")}return await R.state.flush(),void(i.signal.aborted||(s===l(location.pathname)?location.reload():location.replace(s+location.search+location.hash)))}}catch{}i.signal.aborted||(t=setTimeout(s,1500))};return s(),()=>{i.abort(),clearTimeout(t)}},[r.planeApps,r.appVersion,r.url,R,u]),R)return I(t,{connection:R,codePreviewUrl:location.href,planeApps:r.planeApps,onAccessRemoved:h.removed,children:p});let b="starting"===d.phase||"error"===d.phase,E="entry"===d.phase?d.invitation:null;return I(n,{children:I("div",{"data-devtools":"participant-entry",style:{display:"contents",pointerEvents:"auto"},children:b?I(i,{entry:{theme:f,themePreference:A,onThemePreferenceChange:U,ariaLabel:"starting"===d.phase?"Popmelt connecting":"Popmelt disconnected",action:null,logoOnly:!0,connected:!1,connection:O("span",{"data-popmelt-entry-content":!0,role:"status",style:{...j(g[f],!1),cursor:"default"},children:[I(w,{size:14,strokeWidth:1.5,"aria-hidden":"true"}),"starting"===d.phase?"Connecting…":"Disconnected"]})}}):I(m,{showHostLinkHelp:window.top===window&&["localhost","127.0.0.1","[::1]"].includes(location.hostname)&&!S(r.url)&&"/"===c(location.pathname),client:h.client,storage:localStorage,storageKey:`popmelt-admission:${r.projectId}`,theme:f,themePreference:A,onThemePreferenceChange:U,onAdmitted:h.admit,onJoin:E?h.join:void 0},E??"request-access")})})}export{U as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";import{a as r,d as t}from"./chunk-YTMUAK4P.mjs";import"./chunk-UFU5IA3G.mjs";import"./chunk-EO3SHOXX.mjs";import"./chunk-FQH24XFS.mjs";import"./chunk-SOGN7S54.mjs";import"./chunk-SHIN4R4V.mjs";import"./chunk-EHM2ZBQU.mjs";import"./chunk-IC4G3NXR.mjs";import"./chunk-PRZ6C5X3.mjs";import"./chunk-VOL4KS67.mjs";import"./chunk-VLTK7KWK.mjs";import"./chunk-EWNSX5BF.mjs";import"./chunk-G2ZHJXHZ.mjs";import"./chunk-53SKVMWR.mjs";import"./chunk-TMW3SI7F.mjs";import"./chunk-RK6UROPO.mjs";import"./chunk-AOTDTBQO.mjs";import"./chunk-2F2BVGFH.mjs";import"./chunk-RWZ7SVMO.mjs";import"./chunk-HAZXZ5TU.mjs";import"./chunk-YTIDSDPP.mjs";import"./chunk-KF35YUNZ.mjs";import"./chunk-VBH2YQLG.mjs";import"./chunk-VXRRHXUP.mjs";import"./chunk-WP2SHSCG.mjs";import"./chunk-AAMUU2QA.mjs";import"./chunk-LH7HKUCK.mjs";import"./chunk-5TCWBNV4.mjs";import"./chunk-EILBHZDX.mjs";import"./chunk-ZVDKW7TO.mjs";import"./chunk-HQVWOBYH.mjs";import"./chunk-Q6C7ZA3H.mjs";import"./chunk-OREALBUO.mjs";import"./chunk-CK3CDA3L.mjs";import"./chunk-7D4BUDKG.mjs";import{b as o}from"./chunk-OEJXPUAR.mjs";import"./chunk-KE4MQBRY.mjs";import"./chunk-B4DYUYX4.mjs";import{d as n,f as i,c as m,a as e}from"./chunk-HM6EBJVO.mjs";import"./chunk-ADRWR5GI.mjs";import"./chunk-SUAHDXJZ.mjs";import"./chunk-PRPXMDZ7.mjs";import"./chunk-YGP6PPOZ.mjs";import{useState as c,useEffect as s,cloneElement as p}from"react";import{jsxs as h,jsx as u}from"react/jsx-runtime";function j({children:j,projectId:k,participantConfig:a}){let[l,d]=c(null),[I,H]=c("");if(s(()=>{let t,m,c=!1;return d(null),H(""),n(k).then(async n=>{if(c)return;let s=location.origin+e;m=i(s,n);let p=await o(s+"/status",{signal:AbortSignal.timeout(6e3)}),h=p.ok?await p.json():null;if(h?.projectId!==n.projectId)throw new Error("Phone access expired. Create a fresh pairing link in the project terminal.");if(!c){if(h.phoneParticipantId)t=await r({projectId:n.projectId,bridgeUrl:s,credential:{participantId:h.phoneParticipantId,token:""},runtimeStorage:sessionStorage,observedSource:{sourceId:n.projectId,revision:a?.revision??"unversioned"}});else if(a)throw new Error("This phone is not connected to the multiplayer host.");c?t?.dispose():d({bridgeUrl:s,projectId:n.projectId,connection:t})}}).catch(r=>{m?.(),c||H(r instanceof Error?r.message:"Phone pairing failed.")}),()=>{c=!0,t?.dispose(),m?.()}},[k,a]),I)return h("p",{role:"alert","data-devtools":"phone-pairing-error",children:[I," ",u("button",{type:"button",onClick:m,children:"Forget this pairing"})]});if(!l)return null;let U=p(j,{bridgeUrl:l.bridgeUrl,projectId:l.projectId});return l.connection?u(t,{connection:l.connection,onAccessRemoved:m,children:U}):U}export{j as PhoneHostGate};
|