@air-jam/sdk 0.9.1 → 0.9.3

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 (247) hide show
  1. package/README.md +25 -45
  2. package/dist/{agent-tooling-BSMGBix9.d.cts → agent-contract-CD2QnbBJ.d.cts} +1 -1
  3. package/dist/{agent-tooling-BSMGBix9.d.ts → agent-contract-CD2QnbBJ.d.ts} +1 -1
  4. package/dist/agent-tooling.cjs +139 -0
  5. package/dist/agent-tooling.cjs.map +1 -1
  6. package/dist/agent-tooling.d.cts +25 -1
  7. package/dist/agent-tooling.d.ts +25 -1
  8. package/dist/agent-tooling.js +138 -0
  9. package/dist/agent-tooling.js.map +1 -1
  10. package/dist/air-jam-context-BlLPvCup.d.cts +175 -0
  11. package/dist/air-jam-context-DTsxF-tP.d.ts +175 -0
  12. package/dist/arcade/bridge/controller.cjs +214 -194
  13. package/dist/arcade/bridge/controller.cjs.map +1 -1
  14. package/dist/arcade/bridge/controller.d.cts +2 -2
  15. package/dist/arcade/bridge/controller.d.ts +2 -2
  16. package/dist/arcade/bridge/controller.js +6 -4
  17. package/dist/arcade/bridge/host.cjs +1 -1
  18. package/dist/arcade/bridge/host.cjs.map +1 -1
  19. package/dist/arcade/bridge/host.d.cts +3 -3
  20. package/dist/arcade/bridge/host.d.ts +3 -3
  21. package/dist/arcade/bridge/host.js +4 -3
  22. package/dist/arcade/bridge/iframe.cjs +1 -1
  23. package/dist/arcade/bridge/iframe.cjs.map +1 -1
  24. package/dist/arcade/bridge/iframe.d.cts +2 -2
  25. package/dist/arcade/bridge/iframe.d.ts +2 -2
  26. package/dist/arcade/bridge/iframe.js +4 -4
  27. package/dist/arcade/bridge.cjs +251 -231
  28. package/dist/arcade/bridge.cjs.map +1 -1
  29. package/dist/arcade/bridge.d.cts +4 -4
  30. package/dist/arcade/bridge.d.ts +4 -4
  31. package/dist/arcade/bridge.js +9 -7
  32. package/dist/arcade/host.cjs +145 -122
  33. package/dist/arcade/host.cjs.map +1 -1
  34. package/dist/arcade/host.d.cts +5 -4
  35. package/dist/arcade/host.d.ts +5 -4
  36. package/dist/arcade/host.js +6 -5
  37. package/dist/arcade/runtime.cjs +6499 -0
  38. package/dist/arcade/runtime.cjs.map +1 -0
  39. package/dist/arcade/runtime.d.cts +22 -0
  40. package/dist/arcade/runtime.d.ts +22 -0
  41. package/dist/arcade/runtime.js +32 -0
  42. package/dist/arcade/runtime.js.map +1 -0
  43. package/dist/arcade/surface.cjs +9 -0
  44. package/dist/arcade/surface.cjs.map +1 -1
  45. package/dist/arcade/surface.d.cts +6 -1
  46. package/dist/arcade/surface.d.ts +6 -1
  47. package/dist/arcade/surface.js +6 -2
  48. package/dist/arcade/url.d.cts +4 -4
  49. package/dist/arcade/url.d.ts +4 -4
  50. package/dist/arcade/url.js +5 -5
  51. package/dist/arcade.cjs +322 -292
  52. package/dist/arcade.cjs.map +1 -1
  53. package/dist/arcade.d.cts +6 -6
  54. package/dist/arcade.d.ts +6 -6
  55. package/dist/arcade.js +35 -29
  56. package/dist/{chunk-CEJ5RFSG.js → chunk-2SZ2YYGJ.js} +8 -16
  57. package/dist/chunk-2SZ2YYGJ.js.map +1 -0
  58. package/dist/{chunk-VKBMZHMQ.js → chunk-32RSSFSF.js} +10 -12
  59. package/dist/chunk-32RSSFSF.js.map +1 -0
  60. package/dist/chunk-3YMUAKPU.js +10 -0
  61. package/dist/chunk-3YMUAKPU.js.map +1 -0
  62. package/dist/chunk-56DM2KEW.js +14 -0
  63. package/dist/chunk-56DM2KEW.js.map +1 -0
  64. package/dist/chunk-CM53YLT5.js +59 -0
  65. package/dist/chunk-CM53YLT5.js.map +1 -0
  66. package/dist/{chunk-JEHV5C2X.js → chunk-CV3PBXPT.js} +3 -3
  67. package/dist/chunk-D4VDEVTZ.js +80 -0
  68. package/dist/chunk-D4VDEVTZ.js.map +1 -0
  69. package/dist/{chunk-W3YA5BWR.js → chunk-FUA6EMSJ.js} +24 -60
  70. package/dist/chunk-FUA6EMSJ.js.map +1 -0
  71. package/dist/chunk-GMLU7RI5.js +70 -0
  72. package/dist/chunk-GMLU7RI5.js.map +1 -0
  73. package/dist/{chunk-NCL6WJCL.js → chunk-IG6GZZSS.js} +32 -1
  74. package/dist/chunk-IG6GZZSS.js.map +1 -0
  75. package/dist/{chunk-EDRQIOCV.js → chunk-ITMQSBTH.js} +3 -2
  76. package/dist/chunk-ITMQSBTH.js.map +1 -0
  77. package/dist/{chunk-32NYL7XI.js → chunk-J5MCII33.js} +189 -108
  78. package/dist/chunk-J5MCII33.js.map +1 -0
  79. package/dist/{chunk-ZLPL2R3R.js → chunk-K4OZ54UD.js} +7 -34
  80. package/dist/chunk-K4OZ54UD.js.map +1 -0
  81. package/dist/{chunk-KXAFI5OP.js → chunk-LIHEEAVE.js} +9 -11
  82. package/dist/chunk-LIHEEAVE.js.map +1 -0
  83. package/dist/{chunk-FAT2KJ3K.js → chunk-MIMPMB7O.js} +2 -2
  84. package/dist/{chunk-NUJBMV3O.js → chunk-O6X7FJ6N.js} +29 -32
  85. package/dist/chunk-O6X7FJ6N.js.map +1 -0
  86. package/dist/chunk-PSUYTD2L.js +16 -0
  87. package/dist/chunk-PSUYTD2L.js.map +1 -0
  88. package/dist/{chunk-7UXSWCZZ.js → chunk-QO4KFUEI.js} +2 -2
  89. package/dist/chunk-QTLYZADF.js +125 -0
  90. package/dist/chunk-QTLYZADF.js.map +1 -0
  91. package/dist/chunk-TTQDHKXL.js +3017 -0
  92. package/dist/chunk-TTQDHKXL.js.map +1 -0
  93. package/dist/chunk-UCPY7UJC.js +8 -0
  94. package/dist/chunk-UCPY7UJC.js.map +1 -0
  95. package/dist/{chunk-JO2HR5PV.js → chunk-UPV6YWT5.js} +4 -4
  96. package/dist/chunk-X35LLCWV.js +65 -0
  97. package/dist/chunk-X35LLCWV.js.map +1 -0
  98. package/dist/{controller-DxVchfiA.d.ts → controller-PZEM_1cH.d.ts} +6 -2
  99. package/dist/{controller-Bod8YYr1.d.cts → controller-vj82tKm4.d.cts} +6 -2
  100. package/dist/{dev-log-events-CVAM29hx.d.cts → dev-log-events-BCJKmygo.d.cts} +0 -3
  101. package/dist/{dev-log-events-CVAM29hx.d.ts → dev-log-events-BCJKmygo.d.ts} +0 -3
  102. package/dist/{host-8hmq_Sgc.d.cts → host-B9pRy0Aa.d.cts} +20 -7
  103. package/dist/{host-Cw-N6e-5.d.ts → host-DylGsX7p.d.ts} +20 -7
  104. package/dist/index.cjs +4275 -3813
  105. package/dist/index.cjs.map +1 -1
  106. package/dist/index.d.cts +40 -642
  107. package/dist/index.d.ts +40 -642
  108. package/dist/index.js +1032 -3658
  109. package/dist/index.js.map +1 -1
  110. package/dist/metadata.cjs.map +1 -1
  111. package/dist/metadata.d.cts +2 -3
  112. package/dist/metadata.d.ts +2 -3
  113. package/dist/metadata.js.map +1 -1
  114. package/dist/{notices-CnGaaS8B.d.ts → notices-C4bao3oi.d.ts} +1 -1
  115. package/dist/{notices-NyDM5Mtz.d.cts → notices-DNdOjwtj.d.cts} +1 -1
  116. package/dist/platform-machine.cjs +115 -15
  117. package/dist/platform-machine.cjs.map +1 -1
  118. package/dist/platform-machine.d.cts +1338 -65
  119. package/dist/platform-machine.d.ts +1338 -65
  120. package/dist/platform-machine.js +88 -15
  121. package/dist/platform-machine.js.map +1 -1
  122. package/dist/{platform-settings-cuor3i11.d.cts → platform-settings-DUWs4JTy.d.cts} +1 -1
  123. package/dist/{platform-settings-cuor3i11.d.ts → platform-settings-DUWs4JTy.d.ts} +1 -1
  124. package/dist/preview.cjs +301 -253
  125. package/dist/preview.cjs.map +1 -1
  126. package/dist/preview.d.cts +6 -4
  127. package/dist/preview.d.ts +6 -4
  128. package/dist/preview.js +31 -21
  129. package/dist/preview.js.map +1 -1
  130. package/dist/protocol.cjs +282 -167
  131. package/dist/protocol.cjs.map +1 -1
  132. package/dist/protocol.d.cts +74 -21
  133. package/dist/protocol.d.ts +74 -21
  134. package/dist/protocol.js +28 -10
  135. package/dist/release.cjs +37 -0
  136. package/dist/release.cjs.map +1 -1
  137. package/dist/release.d.cts +27 -1
  138. package/dist/release.d.ts +27 -1
  139. package/dist/release.js +13 -1
  140. package/dist/runtime-control.cjs +46 -0
  141. package/dist/runtime-control.cjs.map +1 -0
  142. package/dist/runtime-control.d.cts +17 -0
  143. package/dist/runtime-control.d.ts +17 -0
  144. package/dist/runtime-control.js +8 -0
  145. package/dist/runtime-control.js.map +1 -0
  146. package/dist/runtime-inspection.cjs +655 -0
  147. package/dist/runtime-inspection.cjs.map +1 -0
  148. package/dist/runtime-inspection.d.cts +47 -0
  149. package/dist/runtime-inspection.d.ts +47 -0
  150. package/dist/runtime-inspection.js +30 -0
  151. package/dist/runtime-inspection.js.map +1 -0
  152. package/dist/runtime-reporting-pe-eryVz.d.cts +27 -0
  153. package/dist/runtime-reporting-pe-eryVz.d.ts +27 -0
  154. package/dist/signals-ZHftIKuc.d.cts +33 -0
  155. package/dist/signals-ZHftIKuc.d.ts +33 -0
  156. package/dist/{standard-match-phase-BucA5dYo.d.ts → standard-match-phase-BzSgBYFg.d.ts} +2 -2
  157. package/dist/{standard-match-phase-U2ra8J-0.d.cts → standard-match-phase-CvJUW8Oe.d.cts} +2 -2
  158. package/dist/{sync-B6QsNrXz.d.cts → sync-xtPfWhif.d.cts} +1 -45
  159. package/dist/{sync-B6QsNrXz.d.ts → sync-xtPfWhif.d.ts} +1 -45
  160. package/dist/ui.cjs +689 -629
  161. package/dist/ui.cjs.map +1 -1
  162. package/dist/ui.d.cts +14 -4
  163. package/dist/ui.d.ts +14 -4
  164. package/dist/ui.js +117 -35
  165. package/dist/ui.js.map +1 -1
  166. package/dist/use-air-jam-host-COLy8t4s.d.ts +403 -0
  167. package/dist/use-air-jam-host-DM-ybB3C.d.cts +403 -0
  168. package/package.json +55 -21
  169. package/src/agent/agent-contract-conformance.ts +201 -0
  170. package/src/agent-tooling.ts +5 -0
  171. package/src/arcade/runtime.ts +6 -0
  172. package/src/arcade/surface.ts +1 -0
  173. package/src/components/join-qr-overlay.tsx +115 -31
  174. package/src/context/air-jam-context.tsx +8 -8
  175. package/src/context/socket-manager.ts +0 -7
  176. package/src/dev/browser-log-sink.ts +12 -15
  177. package/src/events.ts +0 -5
  178. package/src/hooks/internal/use-controller-runtime-api.ts +110 -21
  179. package/src/hooks/internal/use-host-runtime-api.ts +306 -49
  180. package/src/hooks/use-air-jam-controller.ts +9 -9
  181. package/src/hooks/use-air-jam-host.ts +7 -7
  182. package/src/hooks/use-get-input.ts +1 -1
  183. package/src/hooks/use-host-arcade-restore.ts +6 -1
  184. package/src/hooks/use-host-audio-mute-preference.ts +99 -0
  185. package/src/index.ts +6 -21
  186. package/src/metadata/manifest.ts +2 -3
  187. package/src/platform-machine.ts +109 -12
  188. package/src/preview/workspace.tsx +48 -29
  189. package/src/protocol/arcade-platform-actions.ts +19 -1
  190. package/src/protocol/controller.ts +8 -2
  191. package/src/protocol/dev-log-events.ts +0 -3
  192. package/src/protocol/host-grant.ts +58 -140
  193. package/src/protocol/host.ts +21 -9
  194. package/src/protocol/runtime-reporting.ts +32 -0
  195. package/src/protocol/signed-envelope.ts +176 -0
  196. package/src/protocol/socket-events.ts +8 -10
  197. package/src/protocol/sync.ts +0 -16
  198. package/src/protocol.ts +2 -0
  199. package/src/release.ts +32 -0
  200. package/src/runtime/admission-retry.ts +62 -0
  201. package/src/runtime/air-jam-config.ts +6 -16
  202. package/src/runtime/air-jam-error-boundary.tsx +46 -2
  203. package/src/runtime/bridge-envelope-args.ts +21 -0
  204. package/src/runtime/connected-runtime-error-boundary.tsx +31 -0
  205. package/src/runtime/contracts/control.ts +107 -59
  206. package/src/runtime/controller-bridge.ts +12 -24
  207. package/src/runtime/controller-identity.ts +55 -27
  208. package/src/runtime/controller-realtime-client.ts +8 -47
  209. package/src/runtime/create-air-jam-app.tsx +21 -13
  210. package/src/runtime/host-bridge.ts +16 -24
  211. package/src/runtime/local-reference-game-identity.ts +13 -0
  212. package/src/runtime/runtime-session-params.ts +4 -64
  213. package/src/runtime-control.ts +3 -8
  214. package/src/settings/platform-settings-runtime.tsx +1 -6
  215. package/src/settings/platform-settings.ts +7 -38
  216. package/src/state/connection-store.ts +13 -6
  217. package/src/store/create-air-jam-store.ts +59 -7
  218. package/src/utils/ids.ts +32 -5
  219. package/dist/capabilities.cjs +0 -39
  220. package/dist/capabilities.cjs.map +0 -1
  221. package/dist/capabilities.d.cts +0 -31
  222. package/dist/capabilities.d.ts +0 -31
  223. package/dist/capabilities.js +0 -12
  224. package/dist/capabilities.js.map +0 -1
  225. package/dist/chunk-32NYL7XI.js.map +0 -1
  226. package/dist/chunk-CABEUV65.js +0 -184
  227. package/dist/chunk-CABEUV65.js.map +0 -1
  228. package/dist/chunk-CEJ5RFSG.js.map +0 -1
  229. package/dist/chunk-EDRQIOCV.js.map +0 -1
  230. package/dist/chunk-KXAFI5OP.js.map +0 -1
  231. package/dist/chunk-NCL6WJCL.js.map +0 -1
  232. package/dist/chunk-NUJBMV3O.js.map +0 -1
  233. package/dist/chunk-VKBMZHMQ.js.map +0 -1
  234. package/dist/chunk-W3YA5BWR.js.map +0 -1
  235. package/dist/chunk-ZLPL2R3R.js.map +0 -1
  236. package/dist/chunk-ZTQ5SP4H.js +0 -9
  237. package/dist/chunk-ZTQ5SP4H.js.map +0 -1
  238. package/src/capabilities/manifest.ts +0 -71
  239. package/src/capabilities.ts +0 -12
  240. package/src/hooks/internal/use-runtime-control-contract.ts +0 -15
  241. package/src/hooks/internal/use-runtime-observability-contract.ts +0 -24
  242. package/src/runtime/contracts/observability.ts +0 -94
  243. package/src/runtime-observability.ts +0 -9
  244. /package/dist/{chunk-JEHV5C2X.js.map → chunk-CV3PBXPT.js.map} +0 -0
  245. /package/dist/{chunk-FAT2KJ3K.js.map → chunk-MIMPMB7O.js.map} +0 -0
  246. /package/dist/{chunk-7UXSWCZZ.js.map → chunk-QO4KFUEI.js.map} +0 -0
  247. /package/dist/{chunk-JO2HR5PV.js.map → chunk-UPV6YWT5.js.map} +0 -0
package/dist/ui.d.cts CHANGED
@@ -1,13 +1,13 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { H as ConnectionStatus, J as RuntimeState, P as PlayerProfile } from './controller-Bod8YYr1.cjs';
2
+ import { b as ConnectionStatus, c as RuntimeState, P as PlayerProfile } from './controller-vj82tKm4.cjs';
3
3
  import * as react from 'react';
4
4
  import { JSX, ReactNode, CSSProperties } from 'react';
5
- import { S as ShellMatchPhase, P as PlatformAudioSettingsApi } from './standard-match-phase-U2ra8J-0.cjs';
5
+ import { S as ShellMatchPhase, d as PlatformAudioSettingsApi } from './standard-match-phase-CvJUW8Oe.cjs';
6
6
  import * as class_variance_authority_types from 'class-variance-authority/types';
7
7
  import { VariantProps } from 'class-variance-authority';
8
8
  import * as SliderPrimitive from '@radix-ui/react-slider';
9
9
  import 'zod';
10
- import './platform-settings-cuor3i11.cjs';
10
+ import './platform-settings-DUWs4JTy.cjs';
11
11
 
12
12
  interface ConnectionStatusPillProps {
13
13
  status: ConnectionStatus;
@@ -55,16 +55,26 @@ declare function HostMuteButton({ muted, onToggle, className, labelClassName, mu
55
55
  interface JoinQrOverlayProps {
56
56
  open: boolean;
57
57
  value: string | null | undefined;
58
+ status?: "ready" | "loading" | "unavailable";
58
59
  roomId?: string | null;
59
60
  onClose?: () => void;
60
61
  title?: string;
62
+ roomLabel?: string;
61
63
  description?: string;
64
+ unavailableLabel?: string;
65
+ loadingLabel?: string;
66
+ qrAlt?: string;
67
+ showCloseButton?: boolean;
62
68
  className?: string;
63
69
  panelClassName?: string;
64
70
  qrClassName?: string;
71
+ bodyClassName?: string;
72
+ messageClassName?: string;
73
+ descriptionClassName?: string;
74
+ closeButtonClassName?: string;
65
75
  size?: number;
66
76
  }
67
- declare const JoinQrOverlay: ({ open, value, roomId, onClose, title, description, className, panelClassName, qrClassName, size, }: JoinQrOverlayProps) => JSX.Element | null;
77
+ declare const JoinQrOverlay: ({ open, value, status, roomId, onClose, title, roomLabel, description, unavailableLabel, loadingLabel, qrAlt, showCloseButton, className, panelClassName, qrClassName, bodyClassName, messageClassName, descriptionClassName, closeButtonClassName, size, }: JoinQrOverlayProps) => JSX.Element | null;
68
78
 
69
79
  interface JoinUrlActionButtonsProps {
70
80
  hasValue: boolean;
package/dist/ui.d.ts CHANGED
@@ -1,13 +1,13 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { H as ConnectionStatus, J as RuntimeState, P as PlayerProfile } from './controller-DxVchfiA.js';
2
+ import { b as ConnectionStatus, c as RuntimeState, P as PlayerProfile } from './controller-PZEM_1cH.js';
3
3
  import * as react from 'react';
4
4
  import { JSX, ReactNode, CSSProperties } from 'react';
5
- import { S as ShellMatchPhase, P as PlatformAudioSettingsApi } from './standard-match-phase-BucA5dYo.js';
5
+ import { S as ShellMatchPhase, d as PlatformAudioSettingsApi } from './standard-match-phase-BzSgBYFg.js';
6
6
  import * as class_variance_authority_types from 'class-variance-authority/types';
7
7
  import { VariantProps } from 'class-variance-authority';
8
8
  import * as SliderPrimitive from '@radix-ui/react-slider';
9
9
  import 'zod';
10
- import './platform-settings-cuor3i11.js';
10
+ import './platform-settings-DUWs4JTy.js';
11
11
 
12
12
  interface ConnectionStatusPillProps {
13
13
  status: ConnectionStatus;
@@ -55,16 +55,26 @@ declare function HostMuteButton({ muted, onToggle, className, labelClassName, mu
55
55
  interface JoinQrOverlayProps {
56
56
  open: boolean;
57
57
  value: string | null | undefined;
58
+ status?: "ready" | "loading" | "unavailable";
58
59
  roomId?: string | null;
59
60
  onClose?: () => void;
60
61
  title?: string;
62
+ roomLabel?: string;
61
63
  description?: string;
64
+ unavailableLabel?: string;
65
+ loadingLabel?: string;
66
+ qrAlt?: string;
67
+ showCloseButton?: boolean;
62
68
  className?: string;
63
69
  panelClassName?: string;
64
70
  qrClassName?: string;
71
+ bodyClassName?: string;
72
+ messageClassName?: string;
73
+ descriptionClassName?: string;
74
+ closeButtonClassName?: string;
65
75
  size?: number;
66
76
  }
67
- declare const JoinQrOverlay: ({ open, value, roomId, onClose, title, description, className, panelClassName, qrClassName, size, }: JoinQrOverlayProps) => JSX.Element | null;
77
+ declare const JoinQrOverlay: ({ open, value, status, roomId, onClose, title, roomLabel, description, unavailableLabel, loadingLabel, qrAlt, showCloseButton, className, panelClassName, qrClassName, bodyClassName, messageClassName, descriptionClassName, closeButtonClassName, size, }: JoinQrOverlayProps) => JSX.Element | null;
68
78
 
69
79
  interface JoinUrlActionButtonsProps {
70
80
  hasValue: boolean;
package/dist/ui.js CHANGED
@@ -1,10 +1,13 @@
1
1
  import {
2
- readEmbeddedControllerRuntimeParams,
2
+ readEmbeddedControllerRuntimeParams
3
+ } from "./chunk-D4VDEVTZ.js";
4
+ import {
3
5
  useAirJamController
4
- } from "./chunk-CABEUV65.js";
6
+ } from "./chunk-X35LLCWV.js";
5
7
  import {
6
8
  createControllerPresentationSyncMessage
7
- } from "./chunk-VKBMZHMQ.js";
9
+ } from "./chunk-32RSSFSF.js";
10
+ import "./chunk-56DM2KEW.js";
8
11
  import "./chunk-X24K52DG.js";
9
12
  import {
10
13
  Button,
@@ -15,24 +18,25 @@ import {
15
18
  shellHeaderClassName,
16
19
  shellHelperTextClassName,
17
20
  shellLabelClassName,
18
- shellPanelClassName,
19
21
  shellUtilityButtonClassName
20
22
  } from "./chunk-EVZJA6RN.js";
21
23
  import {
22
24
  usePlatformAudioSettings
23
- } from "./chunk-CEJ5RFSG.js";
24
- import "./chunk-FAT2KJ3K.js";
25
- import "./chunk-JEHV5C2X.js";
25
+ } from "./chunk-2SZ2YYGJ.js";
26
+ import "./chunk-3YMUAKPU.js";
27
+ import "./chunk-BE6Z4SIT.js";
28
+ import "./chunk-MIMPMB7O.js";
29
+ import "./chunk-CV3PBXPT.js";
26
30
  import {
27
31
  useSessionScope
28
- } from "./chunk-NUJBMV3O.js";
29
- import "./chunk-LIXPF4P6.js";
30
- import "./chunk-ZLPL2R3R.js";
31
- import "./chunk-32NYL7XI.js";
32
+ } from "./chunk-O6X7FJ6N.js";
32
33
  import "./chunk-W2VK36RO.js";
33
34
  import "./chunk-UWJOIVON.js";
35
+ import "./chunk-LIXPF4P6.js";
36
+ import "./chunk-J5MCII33.js";
34
37
  import "./chunk-3USU7GY2.js";
35
- import "./chunk-BE6Z4SIT.js";
38
+ import "./chunk-K4OZ54UD.js";
39
+ import "./chunk-UCPY7UJC.js";
36
40
 
37
41
  // src/components/connection-status-pill.tsx
38
42
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -266,7 +270,8 @@ function HostMuteButton({
266
270
  }
267
271
 
268
272
  // src/components/join-qr-overlay.tsx
269
- import { useEffect as useEffect3 } from "react";
273
+ import { useEffect as useEffect3, useState as useState3 } from "react";
274
+ import { createPortal } from "react-dom";
270
275
 
271
276
  // src/components/room-qr-code.tsx
272
277
  import { toDataURL } from "qrcode";
@@ -368,17 +373,29 @@ import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
368
373
  var JoinQrOverlay = ({
369
374
  open,
370
375
  value,
376
+ status = "ready",
371
377
  roomId,
372
378
  onClose,
373
- title = "Scan to join",
379
+ title = "Scan QR code to join as a controller",
380
+ roomLabel = "Join room",
374
381
  description = "Scan with your phone to connect as a controller.",
382
+ unavailableLabel = "Join URL unavailable right now.",
383
+ loadingLabel = "Preparing join QR\u2026",
384
+ qrAlt,
385
+ showCloseButton = false,
375
386
  className,
376
387
  panelClassName,
377
388
  qrClassName,
378
- size = 440
389
+ bodyClassName,
390
+ messageClassName,
391
+ descriptionClassName,
392
+ closeButtonClassName,
393
+ size = 260
379
394
  }) => {
380
395
  const joinUrlValue = value?.trim() ?? "";
381
- const hasJoinUrl = joinUrlValue.length > 0;
396
+ const effectiveStatus = status === "ready" && joinUrlValue.length === 0 ? "unavailable" : status;
397
+ const overlaySize = `min(72vw, ${size}px)`;
398
+ const [entered, setEntered] = useState3(false);
382
399
  useEffect3(() => {
383
400
  if (!open || typeof window === "undefined") {
384
401
  return;
@@ -393,20 +410,34 @@ var JoinQrOverlay = ({
393
410
  window.removeEventListener("keydown", handleKeyDown);
394
411
  };
395
412
  }, [onClose, open]);
413
+ useEffect3(() => {
414
+ if (!open || typeof window === "undefined") {
415
+ setEntered(false);
416
+ return;
417
+ }
418
+ setEntered(false);
419
+ const frame = window.requestAnimationFrame(() => {
420
+ setEntered(true);
421
+ });
422
+ return () => {
423
+ window.cancelAnimationFrame(frame);
424
+ };
425
+ }, [open]);
396
426
  if (!open) {
397
427
  return null;
398
428
  }
399
429
  const handlePanelClick = (event) => {
400
430
  event.stopPropagation();
401
431
  };
402
- return /* @__PURE__ */ jsx6(
432
+ const dialog = /* @__PURE__ */ jsx6(
403
433
  "div",
404
434
  {
405
435
  role: "dialog",
406
436
  "aria-modal": "true",
407
437
  "aria-label": roomId ? `Join room ${roomId}` : title,
408
438
  className: cn(
409
- "absolute inset-0 z-50 flex items-center justify-center bg-black/82 px-6 py-8 backdrop-blur-md",
439
+ "pointer-events-auto fixed inset-0 z-[120] flex cursor-pointer flex-col items-center justify-center bg-black/85 px-6 backdrop-blur-md transition-opacity duration-200 ease-out",
440
+ entered ? "opacity-100" : "opacity-0",
410
441
  className
411
442
  ),
412
443
  onClick: onClose,
@@ -414,17 +445,34 @@ var JoinQrOverlay = ({
414
445
  "div",
415
446
  {
416
447
  className: cn(
417
- "flex w-full max-w-xl flex-col items-center gap-6 px-6 py-7 text-center",
418
- shellPanelClassName,
448
+ "flex cursor-default flex-col items-center gap-6 text-center transition-transform duration-200 ease-out",
449
+ entered ? "translate-y-0" : "-translate-y-4",
419
450
  panelClassName
420
451
  ),
421
452
  onClick: handlePanelClick,
422
453
  children: [
423
454
  /* @__PURE__ */ jsxs6("div", { className: "space-y-1", children: [
424
- /* @__PURE__ */ jsx6("p", { className: "text-[0.6875rem] font-semibold tracking-[0.22em] text-white/52 uppercase", children: title }),
425
- roomId ? /* @__PURE__ */ jsx6("p", { className: "text-3xl font-semibold tracking-[0.12em] text-white uppercase tabular-nums", children: roomId }) : null
455
+ /* @__PURE__ */ jsx6("p", { className: "text-[11px] tracking-[0.18em] text-slate-400 uppercase", children: roomLabel }),
456
+ roomId ? /* @__PURE__ */ jsx6("p", { className: "text-2xl font-semibold tracking-tight text-white tabular-nums", children: roomId }) : null
426
457
  ] }),
427
- hasJoinUrl ? /* @__PURE__ */ jsx6(
458
+ effectiveStatus === "loading" ? /* @__PURE__ */ jsxs6(
459
+ "div",
460
+ {
461
+ className: cn(
462
+ "flex flex-col items-center justify-center gap-3 rounded-lg border border-white/25 bg-white/6 px-5 py-10 text-sm text-white/70 shadow-sm",
463
+ bodyClassName
464
+ ),
465
+ style: {
466
+ width: overlaySize,
467
+ height: "auto",
468
+ aspectRatio: "1 / 1"
469
+ },
470
+ children: [
471
+ /* @__PURE__ */ jsx6("span", { className: "h-8 w-8 animate-spin rounded-full border-2 border-white/15 border-t-white/85" }),
472
+ /* @__PURE__ */ jsx6("span", { children: loadingLabel })
473
+ ]
474
+ }
475
+ ) : effectiveStatus === "ready" ? /* @__PURE__ */ jsx6(
428
476
  RoomQrCode,
429
477
  {
430
478
  value: joinUrlValue,
@@ -432,31 +480,65 @@ var JoinQrOverlay = ({
432
480
  padding: 2,
433
481
  foregroundColor: "#111827",
434
482
  backgroundColor: "#ffffff",
435
- className: cn("rounded-xl bg-white shadow-sm", qrClassName),
483
+ className: cn(
484
+ "rounded-lg border border-white/25 bg-white/6 shadow-sm",
485
+ qrClassName
486
+ ),
436
487
  style: {
437
- width: "min(72vw, 26rem)",
488
+ width: overlaySize,
438
489
  height: "auto",
439
490
  aspectRatio: "1 / 1"
440
491
  },
441
- alt: roomId ? `QR code to join room ${roomId}` : "QR code to join as a controller"
492
+ alt: qrAlt ?? (roomId ? `QR code to join room ${roomId}` : "QR code to join as a controller")
442
493
  }
443
- ) : /* @__PURE__ */ jsx6("div", { className: "flex w-full max-w-[26rem] items-center justify-center rounded-xl border border-white/12 bg-white/6 px-5 py-10 text-sm leading-6 text-white/68", children: "Join URL unavailable right now." }),
444
- /* @__PURE__ */ jsx6("p", { className: "max-w-md text-sm leading-6 text-white/68", children: description }),
494
+ ) : /* @__PURE__ */ jsx6(
495
+ "div",
496
+ {
497
+ className: cn(
498
+ "flex items-center justify-center rounded-lg border border-white/25 bg-white/6 px-5 py-10 text-sm text-white/70 shadow-sm",
499
+ messageClassName
500
+ ),
501
+ style: {
502
+ width: overlaySize,
503
+ height: "auto",
504
+ aspectRatio: "1 / 1"
505
+ },
506
+ children: unavailableLabel
507
+ }
508
+ ),
445
509
  /* @__PURE__ */ jsx6(
510
+ "p",
511
+ {
512
+ className: cn(
513
+ "max-w-xs text-center text-sm text-slate-400",
514
+ descriptionClassName
515
+ ),
516
+ children: description
517
+ }
518
+ ),
519
+ showCloseButton ? /* @__PURE__ */ jsx6(
446
520
  Button,
447
521
  {
448
522
  type: "button",
449
523
  variant: "outline",
450
524
  onClick: onClose,
451
- className: cn("rounded-2xl px-5", shellUtilityButtonClassName),
525
+ className: cn(
526
+ "rounded-2xl px-5",
527
+ shellUtilityButtonClassName,
528
+ closeButtonClassName
529
+ ),
452
530
  children: "Close"
453
531
  }
454
- )
532
+ ) : null
455
533
  ]
456
534
  }
457
535
  )
458
536
  }
459
537
  );
538
+ if (typeof document === "undefined") {
539
+ return dialog;
540
+ }
541
+ return createPortal(dialog, document.body);
460
542
  };
461
543
 
462
544
  // src/components/join-url-action-buttons.tsx
@@ -934,7 +1016,7 @@ var RuntimeShellHeader = ({
934
1016
  };
935
1017
 
936
1018
  // src/components/surface-viewport.tsx
937
- import { useEffect as useEffect4, useMemo, useRef as useRef2, useState as useState3 } from "react";
1019
+ import { useEffect as useEffect4, useMemo, useRef as useRef2, useState as useState4 } from "react";
938
1020
 
939
1021
  // src/runtime/controller-presentation.ts
940
1022
  var publishEmbeddedControllerPresentation = (orientation) => {
@@ -1262,7 +1344,7 @@ var SurfaceViewport = ({
1262
1344
  minScale,
1263
1345
  maxScale
1264
1346
  }) => {
1265
- const [viewport, setViewport] = useState3(null);
1347
+ const [viewport, setViewport] = useState4(null);
1266
1348
  const viewportRef = useRef2(null);
1267
1349
  const sessionScope = useSessionScope();
1268
1350
  useEffect4(() => {
@@ -1584,7 +1666,7 @@ var useControllerShellStatus = ({
1584
1666
  };
1585
1667
 
1586
1668
  // src/hooks/use-host-join-controls.ts
1587
- import { useCallback as useCallback2, useEffect as useEffect5, useMemo as useMemo2, useRef as useRef3, useState as useState4 } from "react";
1669
+ import { useCallback as useCallback2, useEffect as useEffect5, useMemo as useMemo2, useRef as useRef3, useState as useState5 } from "react";
1588
1670
  var copyTextToClipboard = async (text) => {
1589
1671
  if (!text) {
1590
1672
  return false;
@@ -1619,8 +1701,8 @@ var useHostJoinControls = ({
1619
1701
  onStartMatch,
1620
1702
  copiedDurationMs = 1800
1621
1703
  }) => {
1622
- const [copied, setCopied] = useState4(false);
1623
- const [joinQrVisible, setJoinQrVisible] = useState4(false);
1704
+ const [copied, setCopied] = useState5(false);
1705
+ const [joinQrVisible, setJoinQrVisible] = useState5(false);
1624
1706
  const resetTimerRef = useRef3(null);
1625
1707
  const joinUrlValue = useMemo2(() => joinUrl ?? "", [joinUrl]);
1626
1708
  const hasJoinUrl = joinUrlValue.length > 0;