@volter/game-editor 0.5.97 → 0.5.98

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 (298) hide show
  1. package/BUNDLED_NOTICES +22 -22
  2. package/catalog/entries/blender.json +2 -2
  3. package/catalog/entries/music.json +2 -2
  4. package/dist/.vite/manifest.json +2154 -2154
  5. package/dist/assets/{AssetBudgetPanel-Cep5NyGP.js → AssetBudgetPanel-CYUJjJ94.js} +3 -3
  6. package/dist/assets/{AudioViewer-DQ8lKD5j.js → AudioViewer-D3cfg4ml.js} +1 -1
  7. package/dist/assets/{CanvasBoardDocument-CkEMY2-8.js → CanvasBoardDocument-D8sK_xyG.js} +1 -1
  8. package/dist/assets/{CanvasSceneViewport-C9Nml0t3.js → CanvasSceneViewport-CEXxZv3P.js} +1 -1
  9. package/dist/assets/{ColorInput-BWuKy9BY.js → ColorInput-CZnenbqt.js} +1 -1
  10. package/dist/assets/{ColorPicker-BxPSgfhZ.js → ColorPicker-Bc9BzljY.js} +1 -1
  11. package/dist/assets/{EntityModelDocument-C0hTFUFP.js → EntityModelDocument-DckIPX3c.js} +1 -1
  12. package/dist/assets/{EnvironmentAssetDocument-CjpIe39H.js → EnvironmentAssetDocument-CDPBYiSJ.js} +1 -1
  13. package/dist/assets/{GameplaySessionTimeline-BfFggWCg.js → GameplaySessionTimeline-CuVrbEQL.js} +1 -1
  14. package/dist/assets/{ImageViewer-CyWAuVIw.js → ImageViewer-DfXYDb1X.js} +1 -1
  15. package/dist/assets/InspectorObjectPreview-DL4-l2Ag.js +1 -0
  16. package/dist/assets/{JsonAssetDocument-DLNpN-9s.js → JsonAssetDocument-BEKGk2nb.js} +1 -1
  17. package/dist/assets/{LiveModuleDocument-Cg7hoB29.js → LiveModuleDocument-CpmVed1N.js} +1 -1
  18. package/dist/assets/{LutAssetDocument-CAEKbWBM.js → LutAssetDocument-BIapcD5V.js} +1 -1
  19. package/dist/assets/{ModelAssetDocument-B47tDDCW.js → ModelAssetDocument-UwH6Ng58.js} +1 -1
  20. package/dist/assets/{NonThreeAuthoringBootstrap-Cg_D_UEM.js → NonThreeAuthoringBootstrap-CTkF_Fjw.js} +1 -1
  21. package/dist/assets/{Object3DDocumentToolbar-B1LvvIG_.js → Object3DDocumentToolbar-C0bsqmKv.js} +1 -1
  22. package/dist/assets/Object3DDocumentViewport-C1joQKk8.js +2 -0
  23. package/dist/assets/{Object3DPreview-Dw20Z-tF.js → Object3DPreview-rEJMq5PW.js} +1 -1
  24. package/dist/assets/{OnlineAssetDetail-Chbdfi-N.js → OnlineAssetDetail-BOPfM7Y2.js} +1 -1
  25. package/dist/assets/{PlayBar-DGiKoFHe.js → PlayBar-MxWuZDbI.js} +1 -1
  26. package/dist/assets/{QuarksAssetDocument-UBzM9NpW.js → QuarksAssetDocument-wB8wcf2f.js} +1 -1
  27. package/dist/assets/{ReactCanvasControls-2BcDqh92.js → ReactCanvasControls-DeKZZILw.js} +1 -1
  28. package/dist/assets/{RootSelectionOverlay-Te-Oqem5.js → RootSelectionOverlay-DYanTBYE.js} +1 -1
  29. package/dist/assets/{ShaderAssetDocument-Bl6VyA1O.js → ShaderAssetDocument-CyDKdN5b.js} +1 -1
  30. package/dist/assets/{ShadowEditor-DB3WW1uY.js → ShadowEditor-DbTzN2mf.js} +1 -1
  31. package/dist/assets/{SourceAssetViewer-aoCN7FVl.js → SourceAssetViewer-BymSraDS.js} +1 -1
  32. package/dist/assets/{StageHost-nRksZrQ1.js → StageHost-DeO574tC.js} +2 -2
  33. package/dist/assets/{StoryPreviewMount-BFTHe553.js → StoryPreviewMount-DvSkOR4Z.js} +1 -1
  34. package/dist/assets/{ThreeBoardDocument-Df2V85ot.js → ThreeBoardDocument-CHB3u0xE.js} +2 -2
  35. package/dist/assets/{ThreeIsolationSceneContent-52RSbh1g.js → ThreeIsolationSceneContent-BY8vG3kV.js} +1 -1
  36. package/dist/assets/{ToolObject3DPreview-Cyai9vr_.js → ToolObject3DPreview-CtfgzNns.js} +1 -1
  37. package/dist/assets/{Toolbar-DVjCZQkK.js → Toolbar-BfhP5BUg.js} +1 -1
  38. package/dist/assets/{TransientHint-WQMEBkuO.js → TransientHint-Byhdm3Od.js} +1 -1
  39. package/dist/assets/{VideoViewer-DpaWicwU.js → VideoViewer-DW1zETUK.js} +1 -1
  40. package/dist/assets/{ViewportShadingMenu-CFR6zenE.js → ViewportShadingMenu-BL9v8N9j.js} +1 -1
  41. package/dist/assets/{active-ingest-ZOiV0Jtk.js → active-ingest-_WDvM24r.js} +2 -2
  42. package/dist/assets/{animation-clock-Dr4EnNrV.js → animation-clock-Gep7Un-B.js} +1 -1
  43. package/dist/assets/{animation-mixers.service-DuBOR3FM.js → animation-mixers.service-DGJIQnos.js} +1 -1
  44. package/dist/assets/{animation-timeline.utility-rpFN_NKQ.js → animation-timeline.utility-CVbfCvgY.js} +1 -1
  45. package/dist/assets/{asset-budget-asset.menu-Dpd-65_s.js → asset-budget-asset.menu-gyAKeUNd.js} +1 -1
  46. package/dist/assets/{asset-budget.action-BbWPZf9p.js → asset-budget.action-BghNaV-4.js} +1 -1
  47. package/dist/assets/{asset-budget.document-BR8rdZj1.js → asset-budget.document-B7wUAdpI.js} +1 -1
  48. package/dist/assets/{asset-budget.menu-H5o9EU1g.js → asset-budget.menu-OkiblnyF.js} +1 -1
  49. package/dist/assets/{asset-editor-persistence-Byrmam_8.js → asset-editor-persistence-B4oTV3TQ.js} +1 -1
  50. package/dist/assets/{asset-loaders-C5hSuF5w.js → asset-loaders-C_-GHTQo.js} +1 -1
  51. package/dist/assets/{asset-preview-Clo8SaV6.js → asset-preview-Di8vxUY8.js} +1 -1
  52. package/dist/assets/{audio-unlock.service-BMTPpNST.js → audio-unlock.service-BtqFiL1X.js} +1 -1
  53. package/dist/assets/{audio.utility-7rJdsZRs.js → audio.utility-viua3_CA.js} +1 -1
  54. package/dist/assets/autoplay.service-C6DfzGKJ.js +1 -0
  55. package/dist/assets/{babylon-authoring-adapter-Ba6K8LSs.js → babylon-authoring-adapter-CxbL-7dI.js} +1 -1
  56. package/dist/assets/{binding-resolver-DCeGebRY.js → binding-resolver-B1NT5eZp.js} +2 -2
  57. package/dist/assets/{blender-emscripten-engine-CbHHZuUu.js → blender-emscripten-engine-BUt1MIRn.js} +1 -1
  58. package/dist/assets/{blender-node-editor.document-DYj1pEzm.js → blender-node-editor.document-C2QdPHaS.js} +1 -1
  59. package/dist/assets/{blender-properties-tab-_UQryjaE.js → blender-properties-tab-BatuUyQ6.js} +1 -1
  60. package/dist/assets/{blender-runtime-host-D_JU34fx.js → blender-runtime-host-BUl0kiMb.js} +1 -1
  61. package/dist/assets/{blender-runtime-skin-B1bWYvLx.js → blender-runtime-skin-CCKkESgo.js} +9 -9
  62. package/dist/assets/{blender-runtime.document-CwtzTYN0.js → blender-runtime.document-CqDEiey6.js} +8 -8
  63. package/dist/assets/{blender-screenshot.menu-BOm0A_fs.js → blender-screenshot.menu-D6z3j9Z0.js} +1 -1
  64. package/dist/assets/{blender-timeline.document-uc9n3IzF.js → blender-timeline.document-BfvX9HD8.js} +1 -1
  65. package/dist/assets/{blender-uv-editor.document-hrolGRvl.js → blender-uv-editor.document-9zFVMreH.js} +1 -1
  66. package/dist/assets/{blender-version.status-CtulscU0.js → blender-version.status-B31FeHyZ.js} +1 -1
  67. package/dist/assets/{blender-wali-engine-uH9q2l3f.js → blender-wali-engine--CAT1JcK.js} +1 -1
  68. package/dist/assets/{blender.command-C1fW4kWp.js → blender.command-q5Ss5U4v.js} +1 -1
  69. package/dist/assets/{board-guides-B_1dNBxX.js → board-guides-DLC77TC2.js} +1 -1
  70. package/dist/assets/{bridge.command-D6A8A9ri.js → bridge.command-Ca9_9Usm.js} +3 -3
  71. package/dist/assets/{browserAll-CR6_j2mp.js → browserAll-V5qUB869.js} +1 -1
  72. package/dist/assets/{build-player.document-DYclYzh2.js → build-player.document-Dihw3ECY.js} +1 -1
  73. package/dist/assets/{build-profiles.document-PzCjWvqU.js → build-profiles.document-BX9nb42H.js} +1 -1
  74. package/dist/assets/{build-progress.status-CP9C8cb9.js → build-progress.status-D-0oRNyH.js} +1 -1
  75. package/dist/assets/{build-session-D5w-r4Be.js → build-session-Dvt7pd00.js} +1 -1
  76. package/dist/assets/{build.action-C-dnDeEj.js → build.action-C0ockeu9.js} +1 -1
  77. package/dist/assets/{build.command-Cy08-IxS.js → build.command-CSW_MD00.js} +1 -1
  78. package/dist/assets/{build.header-CfKLqqNW.js → build.header-BczTqYb_.js} +1 -1
  79. package/dist/assets/{build.menu-CJWutH9z.js → build.menu-DBAU85mK.js} +1 -1
  80. package/dist/assets/{build.service-D8uj_jPB.js → build.service-BjwUe_ye.js} +1 -1
  81. package/dist/assets/{camera-DBA2Hsqv.js → camera-BThd0DYj.js} +1 -1
  82. package/dist/assets/{camera-runtime.inspector-f4N1iCDF.js → camera-runtime.inspector-c51thcIe.js} +1 -1
  83. package/dist/assets/{canvas-design-mount-C0NaIyI3.js → canvas-design-mount-Dg1jk7P9.js} +3 -3
  84. package/dist/assets/{canvas-entry-runtime-BLPKpqpp.js → canvas-entry-runtime-D4UUWHHS.js} +2 -2
  85. package/dist/assets/{canvas-preview-frames-BFYpLtLK.js → canvas-preview-frames-8g_T28jt.js} +1 -1
  86. package/dist/assets/{canvas-story-capture.service--waamjqh.js → canvas-story-capture.service-BD2ZDfgb.js} +2 -2
  87. package/dist/assets/{capability-coverage-NcL3fdGj.js → capability-coverage-D1AjR_LI.js} +1 -1
  88. package/dist/assets/{collaboration-presence-CypC1OHn.js → collaboration-presence-B1-ixzD4.js} +1 -1
  89. package/dist/assets/{collider-D2vJA2Dp.js → collider-D_MStfz8.js} +1 -1
  90. package/dist/assets/{component-board.service-BM4e9DXU.js → component-board.service-BCJDbWJO.js} +2 -2
  91. package/dist/assets/{component-board.service-D2McY2BT.js → component-board.service-CNfcy4re.js} +2 -2
  92. package/dist/assets/{component-board.service-w9Wkqe28.js → component-board.service-kpvKo8AX.js} +2 -2
  93. package/dist/assets/{component-contracts.service-Tfu5yfN-.js → component-contracts.service-DOq7Uz8X.js} +1 -1
  94. package/dist/assets/{component-instance-root-4o-HMx39.js → component-instance-root-BVjTH0AO.js} +1 -1
  95. package/dist/assets/{component-verbs.command-CCabdRwc.js → component-verbs.command-BJ7vPc7n.js} +1 -1
  96. package/dist/assets/{component-verbs.service-CsnI9V_a.js → component-verbs.service-A7JUNMTN.js} +1 -1
  97. package/dist/assets/{config-CTi5HVQk.js → config-DXbdl8V5.js} +2 -2
  98. package/dist/assets/{configurations-DQXyouVq.js → configurations-CUnfG7ZO.js} +1 -1
  99. package/dist/assets/{connection.status-CXQvtUky.js → connection.status-B-cxZwYA.js} +1 -1
  100. package/dist/assets/{constraints.inspector-BnaTP-f_.js → constraints.inspector-Crmp8_cu.js} +1 -1
  101. package/dist/assets/{content-bounds-C6Nb8vJK.js → content-bounds-DzkikRBl.js} +1 -1
  102. package/dist/assets/{contract-system-adapters-CJXxexZO.js → contract-system-adapters-BTeuY0Wz.js} +1 -1
  103. package/dist/assets/{coverage.service-B6mSdaKu.js → coverage.service-B8ThvM6U.js} +1 -1
  104. package/dist/assets/{create-runtime-BcW4ljbo.js → create-runtime-DTWZzn1t.js} +1 -1
  105. package/dist/assets/{curve-Ds2-liNe.js → curve-CpzFB8qh.js} +1 -1
  106. package/dist/assets/{data-asset-CWl5bb8W.js → data-asset-CIxV9JTk.js} +1 -1
  107. package/dist/assets/{data-ref-jOa7Hw5q.js → data-ref-DrNnlhsi.js} +1 -1
  108. package/dist/assets/{debug-bridge-s2ipjHbl.js → debug-bridge-B43FSMW-.js} +1 -1
  109. package/dist/assets/{debug-registry-B0UtXvgn.js → debug-registry-DZXSvvn0.js} +1 -1
  110. package/dist/assets/{deferred-ingest-play-BpPZrTLz.js → deferred-ingest-play-DtbBSsch.js} +2 -2
  111. package/dist/assets/{design-time-canvas-mount-9GhEUOXN.js → design-time-canvas-mount-BNJucWC9.js} +2 -2
  112. package/dist/assets/{design-time-layers-BtxJATJe.js → design-time-layers-DSk4tElq.js} +1 -1
  113. package/dist/assets/{design-time-mount.service-DsMz9KB0.js → design-time-mount.service-B1uT1tYo.js} +2 -2
  114. package/dist/assets/{design-time-mount.service-B3TlKaZf.js → design-time-mount.service-mqzVtqAw.js} +2 -2
  115. package/dist/assets/{design-time-react-mount-Dh-IMbR8.js → design-time-react-mount-BfdKL8vZ.js} +1 -1
  116. package/dist/assets/{document-preview-three-DgyEGb7g.js → document-preview-three-BZmgWaSO.js} +1 -1
  117. package/dist/assets/{dom-authoring-adapter-DzKucjZ1.js → dom-authoring-adapter-DoX9DoiD.js} +1 -1
  118. package/dist/assets/{draco3d-CtGZleeO.js → draco3d-DucG06PU.js} +1 -1
  119. package/dist/assets/{edit-mode-audio.service-CyxFaDyl.js → edit-mode-audio.service-DdZc2jfs.js} +1 -1
  120. package/dist/assets/{edit-mode-authoring-8eqT4Ah6.js → edit-mode-authoring-Ch6v9PnO.js} +1 -1
  121. package/dist/assets/{edit-mode-networking.service-t3CgKERU.js → edit-mode-networking.service-BpnwwS06.js} +1 -1
  122. package/dist/assets/{editor-api-CnMI4ri9.js → editor-api-DUY4XF3E.js} +1 -1
  123. package/dist/assets/{editor-layers-TtgYYi_s.js → editor-layers-DJwy9H_k.js} +1 -1
  124. package/dist/assets/{editor-shell-store-C9QYXDRr.js → editor-shell-store-B87W2cjm.js} +1 -1
  125. package/dist/assets/{entity-object-CTha2dPd.js → entity-object-BpsV3ox5.js} +1 -1
  126. package/dist/assets/{extend-DScgOkqm.js → extend-CC4illCZ.js} +1 -1
  127. package/dist/assets/{fork-menu-CW0fvp_-.js → fork-menu-DMGtk-df.js} +1 -1
  128. package/dist/assets/{frame-debugger-store-Ovblcz2s.js → frame-debugger-store-DJdnRJUk.js} +1 -1
  129. package/dist/assets/{game-contract-seams-BhjR536D.js → game-contract-seams-leXTqnUS.js} +1 -1
  130. package/dist/assets/{game-css-scope-transform-DhmUzNg4.js → game-css-scope-transform-B2GgkZOW.js} +1 -1
  131. package/dist/assets/{game-document.service-DpYuC6EA.js → game-document.service-DU8RzyUd.js} +1 -1
  132. package/dist/assets/{game-eval.command-CZjgr-Ux.js → game-eval.command-CXeVgR1j.js} +1 -1
  133. package/dist/assets/{game-module-access-BBoEY2IL.js → game-module-access-BdrsVQdv.js} +1 -1
  134. package/dist/assets/{game-network-BoP-iKCC.js → game-network-CBHt-_DV.js} +3 -3
  135. package/dist/assets/{gameplay-export-D6ZefP6y.js → gameplay-export-CBGX3vzm.js} +1 -1
  136. package/dist/assets/{gameplay-replay-BhWtcNfn.js → gameplay-replay-pGsdN2b-.js} +1 -1
  137. package/dist/assets/{gameplay.command-DFDve9iS.js → gameplay.command-CU-k64Ab.js} +1 -1
  138. package/dist/assets/{generation-jobs-RBppjmZm.js → generation-jobs-CTnSvyBa.js} +1 -1
  139. package/dist/assets/{generation.service-CYlKPuNC.js → generation.service-BZwHj9AP.js} +1 -1
  140. package/dist/assets/{generations-BX9sRTpt.js → generations-D2YCnWwG.js} +1 -1
  141. package/dist/assets/{generations.status-D78fiCZN.js → generations.status--hCUPMhD.js} +1 -1
  142. package/dist/assets/{hierarchy-marks-DMWVKCJa.js → hierarchy-marks-D1HxcOXp.js} +1 -1
  143. package/dist/assets/{hosted-asset-materialization-B7uBOJtr.js → hosted-asset-materialization-Djmv6uo-.js} +1 -1
  144. package/dist/assets/{index-BErRsnP9.js → index-BMchyFVg.js} +1 -1
  145. package/dist/assets/{index-C_gLrIvk.js → index-C5cL2IUJ.js} +7 -7
  146. package/dist/assets/{index-CpXy7sdX.js → index-CS5UDFWT.js} +1 -1
  147. package/dist/assets/{index-BVSm448e.js → index-D4HAbSY1.js} +2 -2
  148. package/dist/assets/{index-Q2PKxvts.js → index-DVJePnKE.js} +1 -1
  149. package/dist/assets/{index-bXjpWEn9.js → index-DXBXE0hk.js} +1 -1
  150. package/dist/assets/{index-sFzW-AhX.js → index-Dp7eO4yU.js} +1 -1
  151. package/dist/assets/{index-R6-13mGN.js → index-W7hnJutR.js} +1 -1
  152. package/dist/assets/{index-D8czczMc.js → index-r5GMjI4u.js} +1 -1
  153. package/dist/assets/{inference-diagnostics-CSTitz6Y.js → inference-diagnostics-BI3pXsTw.js} +1 -1
  154. package/dist/assets/{ingest-boot-viewport-ClRh-m5Z.js → ingest-boot-viewport--RER68Hf.js} +1 -1
  155. package/dist/assets/{ingest-siblings-C4yJ-pFC.js → ingest-siblings-D-acEhl8.js} +1 -1
  156. package/dist/assets/{ingest-source-persistence-Cxv-xcnT.js → ingest-source-persistence-CCGS4Nxy.js} +1 -1
  157. package/dist/assets/{ingest.service-BnUZe4K0.js → ingest.service-BJNrvg1w.js} +1 -1
  158. package/dist/assets/{inspect-DybkUNPY.js → inspect-Czr75mkK.js} +1 -1
  159. package/dist/assets/instances.command-CX8PxYgi.js +1 -0
  160. package/dist/assets/{json-history-resource-BReCXsj2.js → json-history-resource-DS16aq7M.js} +1 -1
  161. package/dist/assets/{layered-pick-BJfI6PwU.js → layered-pick-6TWdZ7gI.js} +1 -1
  162. package/dist/assets/{light-CdIUgmeK.js → light-RsKoPui1.js} +1 -1
  163. package/dist/assets/{live-project-verbs-DBGzvsy3.js → live-project-verbs-Xdg6cat1.js} +1 -1
  164. package/dist/assets/{machine.document-DUy8aZD2.js → machine.document-DcQb_OIY.js} +1 -1
  165. package/dist/assets/{machines.finder-C9I3Zbhn.js → machines.finder-Bqq1wtq5.js} +1 -1
  166. package/dist/assets/{material-CDL3cxMn.js → material-B_D7n6mb.js} +1 -1
  167. package/dist/assets/{material-factory-C0OAYJZ6.js → material-factory-CuXmyLzp.js} +1 -1
  168. package/dist/assets/{mesh-CGLhemJl.js → mesh-CahLLFyU.js} +1 -1
  169. package/dist/assets/{model-asset-sections.service-CGVR9EhV.js → model-asset-sections.service-DCf6Ptug.js} +1 -1
  170. package/dist/assets/{model-inspection-CwGBMSvf.js → model-inspection-BSCcC5V2.js} +1 -1
  171. package/dist/assets/{model-thumbnail-zIoZC1z2.js → model-thumbnail-D73YMcQe.js} +1 -1
  172. package/dist/assets/{models.finder-BDhWOMcl.js → models.finder-DRzo0vrh.js} +1 -1
  173. package/dist/assets/{module-mode-BHeWNrkN.js → module-mode-BoKe-JQH.js} +2 -2
  174. package/dist/assets/{mount-canvas-ingest-root-Dbycoo4l.js → mount-canvas-ingest-root-DtbPPM9b.js} +2 -2
  175. package/dist/assets/{mount-dom-ingest-root-DhCiXBw0.js → mount-dom-ingest-root-4b8yowH1.js} +2 -2
  176. package/dist/assets/{mount-ingest-root-Dn5SOQdS.js → mount-ingest-root-B6iHB5JJ.js} +2 -2
  177. package/dist/assets/{mount-manifest-BFwCVGaC.js → mount-manifest-DXoBRN_6.js} +1 -1
  178. package/dist/assets/{mount-three-ingest-root-7bNuxm9b.js → mount-three-ingest-root-B4FVx_e1.js} +1 -1
  179. package/dist/assets/{mounted-authoring-DI-dfAS5.js → mounted-authoring-D3ZR7cVq.js} +1 -1
  180. package/dist/assets/{mounted-story-viewport-source-BBOTgZEy.js → mounted-story-viewport-source-CU0H0HM-.js} +1 -1
  181. package/dist/assets/{native-debug-module-Dvzh4rev.js → native-debug-module-BcCIQlpj.js} +1 -1
  182. package/dist/assets/{navigation-j17GvlMl.js → navigation-BN6Z9E73.js} +1 -1
  183. package/dist/assets/{navmesh.menu-II20NCGk.js → navmesh.menu-B-fi8IMb.js} +1 -1
  184. package/dist/assets/{navmesh.service-DDiQLjFE.js → navmesh.service-BX4QWfzb.js} +1 -1
  185. package/dist/assets/network-observer.service-B_OThTzb.js +1 -0
  186. package/dist/assets/{network.utility-vkLvhGPx.js → network.utility-CARO54yd.js} +1 -1
  187. package/dist/assets/{object3d-document-session-registry-Bt76KtzL.js → object3d-document-session-registry-ZvPc6hyy.js} +2 -2
  188. package/dist/assets/{oid-transform-DMPczBkS.js → oid-transform-BUbpXU6R.js} +1 -1
  189. package/dist/assets/{particles-CtEtOqNM.js → particles-BQuXnAL_.js} +1 -1
  190. package/dist/assets/{pixi-authoring-adapter-CXve0GKc.js → pixi-authoring-adapter-DaWrJsOF.js} +1 -1
  191. package/dist/assets/{pixi-live-write-target-tfgZy1iB.js → pixi-live-write-target-DN3QCjnE.js} +1 -1
  192. package/dist/assets/{play.command-CGlPKbny.js → play.command-DG5pGZ5K.js} +2 -2
  193. package/dist/assets/{presentation-DBDrAo3B.js → presentation-CcaWOOPX.js} +1 -1
  194. package/dist/assets/{product-iSAUcCl9.js → product-u_v6pdNh.js} +1 -1
  195. package/dist/assets/{profiler.action-BpOx2gla.js → profiler.action-BgKedBf4.js} +1 -1
  196. package/dist/assets/{profiler.menu-Ds4Dm2T9.js → profiler.menu-_HSBT8qW.js} +1 -1
  197. package/dist/assets/{profiler.utility-o6cOubd_.js → profiler.utility-BLxsScYH.js} +1 -1
  198. package/dist/assets/{project-authoring-session-Dekk2e3o.js → project-authoring-session-CnTuJBJD.js} +2 -2
  199. package/dist/assets/{properties-bone-constraints.inspector-4zktkkvC.js → properties-bone-constraints.inspector-BS3WyCdl.js} +1 -1
  200. package/dist/assets/{properties-bone.inspector-BisMKVWS.js → properties-bone.inspector-ClRnj5zf.js} +1 -1
  201. package/dist/assets/{properties-collection.inspector-By43HF5s.js → properties-collection.inspector-zVB_Ikpf.js} +1 -1
  202. package/dist/assets/{properties-constraints.inspector-C5Dv4nTl.js → properties-constraints.inspector-BI3f2IGZ.js} +1 -1
  203. package/dist/assets/{properties-data.inspector-Cp8_hP_J.js → properties-data.inspector-CrzMpdOd.js} +1 -1
  204. package/dist/assets/{properties-material.inspector-BNYKbXo2.js → properties-material.inspector-DV0YU-Ni.js} +1 -1
  205. package/dist/assets/{properties-modifiers.inspector-Dri9d_7u.js → properties-modifiers.inspector-DO2RFWS-.js} +1 -1
  206. package/dist/assets/{properties-object.inspector-Zsa_Rkjh.js → properties-object.inspector-DCcGMMN5.js} +1 -1
  207. package/dist/assets/{properties-output.inspector-DlV8p-bH.js → properties-output.inspector-CIsc-G2d.js} +1 -1
  208. package/dist/assets/{properties-particles.inspector-C5RLi4IV.js → properties-particles.inspector-DiPs9mU5.js} +1 -1
  209. package/dist/assets/{properties-physics.inspector-BC0P-uli.js → properties-physics.inspector-OgDZCroI.js} +1 -1
  210. package/dist/assets/{properties-render.inspector-DUQSvvhk.js → properties-render.inspector-ERcM3P1l.js} +1 -1
  211. package/dist/assets/{properties-scene.inspector-LY_7pIIZ.js → properties-scene.inspector-e1YmvWIj.js} +1 -1
  212. package/dist/assets/{properties-texture.inspector-YlJ6eiXy.js → properties-texture.inspector-1X6LXH3l.js} +1 -1
  213. package/dist/assets/{properties-view-layer.inspector-k9TDa2BK.js → properties-view-layer.inspector-DpcNCgss.js} +1 -1
  214. package/dist/assets/{properties-world.inspector-Lrl6vogA.js → properties-world.inspector-CzopHMsM.js} +1 -1
  215. package/dist/assets/{r3f-design-session-CNjz1_AF.js → r3f-design-session-CvXShgBI.js} +2 -2
  216. package/dist/assets/{r3f-physics-binding-B0M0RByC.js → r3f-physics-binding-uhCRHed5.js} +1 -1
  217. package/dist/assets/{r3f-source-authoring-adapter-DYp48abR.js → r3f-source-authoring-adapter-C3V3ODnr.js} +1 -1
  218. package/dist/assets/{react-canvas-navigation-BPHMARV3.js → react-canvas-navigation-Awf5f-km.js} +1 -1
  219. package/dist/assets/{react-inspector.service-DgLj6yGA.js → react-inspector.service-DvgKi8qm.js} +1 -1
  220. package/dist/assets/{react-story-board-B9_ZSGGT.js → react-story-board-D2pwwUUp.js} +1 -1
  221. package/dist/assets/{react-three-rapier.esm-CZ8fWAw-.js → react-three-rapier.esm-JEarqnso.js} +1 -1
  222. package/dist/assets/{react-world-authoring-adapter-C9fTSu6u.js → react-world-authoring-adapter-CJSmvs_1.js} +1 -1
  223. package/dist/assets/{realm-services-CyH5yTHN.js → realm-services-CqGTAk9D.js} +1 -1
  224. package/dist/assets/{reflection-probe-capture.inspector-B5Ken3Wv.js → reflection-probe-capture.inspector-BKXle-FB.js} +1 -1
  225. package/dist/assets/{registry-YEJktf-K.js → registry-rFk05JpG.js} +1 -1
  226. package/dist/assets/{relative-import-specifier-Dg5O2O1R.js → relative-import-specifier-OJ1nkBV9.js} +1 -1
  227. package/dist/assets/{render-env-5rmrHmGC.js → render-env-DekK9VA2.js} +1 -1
  228. package/dist/assets/{render-features-BPb6UG8u.js → render-features-CMMNCiUj.js} +1 -1
  229. package/dist/assets/{render-settings-DBqv2yw8.js → render-settings-Dy89f95W.js} +1 -1
  230. package/dist/assets/{resolve-three-7CthO8aC.js → resolve-three-CYk0C9L7.js} +3 -3
  231. package/dist/assets/{root-seam-contract-Bf_WRD_z.js → root-seam-contract-ctxfAQZR.js} +1 -1
  232. package/dist/assets/{run-selection-CbwxS453.js → run-selection-D-MXhzyH.js} +1 -1
  233. package/dist/assets/{scene-capture-D5ooN1dC.js → scene-capture-BHFvkGDv.js} +1 -1
  234. package/dist/assets/{scene-document.service-vDIQM-_L.js → scene-document.service-ZzG8QUXr.js} +2 -2
  235. package/dist/assets/{scene-framing-DeMlXIgX.js → scene-framing-Visz22um.js} +1 -1
  236. package/dist/assets/{seeded-random-CilWrQ9p.js → seeded-random-31t3Hhi7.js} +1 -1
  237. package/dist/assets/{session-kTroQqmY.js → session-DA-J0Ee6.js} +11 -6
  238. package/dist/assets/{setup-renderer-D4rh83E5.js → setup-renderer-DAvDM3La.js} +1 -1
  239. package/dist/assets/{source-object3d-authoring-adapter-Ci6EfWDG.js → source-object3d-authoring-adapter-BiLtZNLQ.js} +1 -1
  240. package/dist/assets/{source-persistence-backend-CpNTlQ6r.js → source-persistence-backend-Mw40F3bc.js} +1 -1
  241. package/dist/assets/{stage-keyboard-DffZ_2Js.js → stage-keyboard-BwQBp0X8.js} +1 -1
  242. package/dist/assets/{stage-overlay-set-HW84K0WL.js → stage-overlay-set-BsUb7Fv4.js} +1 -1
  243. package/dist/assets/{stage-presence-markers-BhBXzQaB.js → stage-presence-markers-CIMlMmNr.js} +1 -1
  244. package/dist/assets/{stage-transform-tools-Bt248CuV.js → stage-transform-tools-vwCY4rbA.js} +1 -1
  245. package/dist/assets/{standard-viewport-dressing-CtIrUH9V.js → standard-viewport-dressing-YsNQjtKv.js} +1 -1
  246. package/dist/assets/{state-watch.action-BWSHqM8G.js → state-watch.action-DsN9G3xj.js} +1 -1
  247. package/dist/assets/{state-watch.menu-DZw8R4P9.js → state-watch.menu-CmF_Au9t.js} +1 -1
  248. package/dist/assets/{state-watch.utility-DfZzhxLI.js → state-watch.utility-MpUll9xe.js} +1 -1
  249. package/dist/assets/{story-capture-BkC82-C6.js → story-capture-yOsfM7Wp.js} +1 -1
  250. package/dist/assets/{story-documents-BgenKklm.js → story-documents-DyV9TmgX.js} +1 -1
  251. package/dist/assets/{story-documents.service-DcIPA1V2.js → story-documents.service-Cm_r4rSP.js} +1 -1
  252. package/dist/assets/{story-documents.service-vCX0ua3i.js → story-documents.service-DR-8Nax9.js} +1 -1
  253. package/dist/assets/{story-media-presence-CEkAUR-5.js → story-media-presence-PjJsx64u.js} +1 -1
  254. package/dist/assets/{story-pixi-preview-C-VALVuE.js → story-pixi-preview-CBCJhgCw.js} +1 -1
  255. package/dist/assets/{story-presentation-DJtDDykU.js → story-presentation-fpxUtjMs.js} +1 -1
  256. package/dist/assets/{story-three-preview-RAf4-fEE.js → story-three-preview-D2OfeC1l.js} +2 -2
  257. package/dist/assets/{studio-environment-CjfDi6Xs.js → studio-environment-BFOzO9xW.js} +1 -1
  258. package/dist/assets/{surface-state-DqslrBdu.js → surface-state-DeXIPWuS.js} +1 -1
  259. package/dist/assets/{syntactic-prop-specs-_CzMqIxq.js → syntactic-prop-specs-D3_Hyv1m.js} +1 -1
  260. package/dist/assets/{team-playtest.service-BX6fYsMy.js → team-playtest.service-QqTIBuBd.js} +1 -1
  261. package/dist/assets/{three-authoring-adapter-cWKLa6xe.js → three-authoring-adapter-BEDQRs2B.js} +1 -1
  262. package/dist/assets/three-authoring.service-DcLaapAT.js +2 -0
  263. package/dist/assets/{three-ingest-runtime-B09tYa9n.js → three-ingest-runtime-C2ruwAa_.js} +1 -1
  264. package/dist/assets/{three-integration-BXyJZy9c.js → three-integration-BjghFioV.js} +2 -2
  265. package/dist/assets/three-integration.service-CDnke_Eh.js +1 -0
  266. package/dist/assets/{three-projection-core-BAHKdNuj.js → three-projection-core-BAO-45fo.js} +1 -1
  267. package/dist/assets/{three-state-CR9QYeCl.js → three-state-CouynZOV.js} +1 -1
  268. package/dist/assets/{three-story-capture.service-DUmB30Hg.js → three-story-capture.service-YYAt9aQX.js} +2 -2
  269. package/dist/assets/{three-story-model-sxgG2OGG.js → three-story-model-DrH7Vzo5.js} +1 -1
  270. package/dist/assets/{three-viewport-presentation-CbOERA2i.js → three-viewport-presentation-cnzAiIdI.js} +1 -1
  271. package/dist/assets/{three-BWA441zQ.js → three-z0dIVVct.js} +1 -1
  272. package/dist/assets/{transform-mode-request-BOVxBX4f.js → transform-mode-request-BEHHgfb9.js} +1 -1
  273. package/dist/assets/{transport-strip-CJFVXvxI.js → transport-strip-CKFa9Kx2.js} +1 -1
  274. package/dist/assets/transport.header-BLN3lUBy.js +1 -0
  275. package/dist/assets/{tuples-B44o6m5b.js → tuples-QLLPE1Xl.js} +1 -1
  276. package/dist/assets/{ui-board-document-CS2m1uLf.js → ui-board-document-mjuhM-FJ.js} +2 -2
  277. package/dist/assets/{user-data-BS92dOsI.js → user-data-BYUf0wLn.js} +1 -1
  278. package/dist/assets/{utility-view-state-B66E09an.js → utility-view-state-CGImpCGD.js} +1 -1
  279. package/dist/assets/{viewport-door-CN3_JGfc.js → viewport-door-_El1wx2N.js} +1 -1
  280. package/dist/assets/{viewport-root-presentation-CV9AuiRe.js → viewport-root-presentation-DBSTTcWY.js} +1 -1
  281. package/dist/assets/{viewport-surface-status-tLC5uoTr.js → viewport-surface-status-86lP1z8H.js} +1 -1
  282. package/dist/assets/{webworkerAll-CJN_8ry7.js → webworkerAll-CBkNGoTW.js} +1 -1
  283. package/dist/assets/{worker-DLnISz0i.js → worker-BUhehstd.js} +1 -1
  284. package/dist/assets/{workspace-arrangement-BTINexHg.js → workspace-arrangement-Bx5PVUVK.js} +1 -1
  285. package/dist/assets/{world-documents-DqDkHGRk.js → world-documents-BOMYFyua.js} +1 -1
  286. package/dist/assets/{world-root-stage-binding-CgTjfy6y.js → world-root-stage-binding-xZZlhfra.js} +1 -1
  287. package/dist/assets/{xstate-animation-binding-BMH7CiRL.js → xstate-animation-binding-BPoA569V.js} +1 -1
  288. package/dist/assets/{xstate-animation-meta-DJjcEqI3.js → xstate-animation-meta-BCxFKr-g.js} +1 -1
  289. package/dist-node/cli.js +16 -16
  290. package/package.json +16 -16
  291. package/dist/assets/InspectorObjectPreview-DONT8JtA.js +0 -1
  292. package/dist/assets/Object3DDocumentViewport-D5wFHIjC.js +0 -2
  293. package/dist/assets/autoplay.service-DgBeAZF0.js +0 -1
  294. package/dist/assets/instances.command-DJhsMELC.js +0 -1
  295. package/dist/assets/network-observer.service-CwdeMEvO.js +0 -1
  296. package/dist/assets/three-authoring.service-DwRqwTgP.js +0 -2
  297. package/dist/assets/three-integration.service-B87Ig6eN.js +0 -1
  298. package/dist/assets/transport.header-CT9_8prP.js +0 -1
@@ -1 +1 @@
1
- import{D as v}from"./debug-registry-B0UtXvgn.js";import{r as _}from"./game-network-BoP-iKCC.js";const D="volter-debug",T=100,E=50,k=100,P=60,b=2e3,V="the host loop reported liveness 'loop-starved' and this session has no way to drive ticks — no recent rAF progress was observed. Check `volter-game-editor status` for the separate visibility readings; foreground/reload the editor, or start play to wire the run-ticks target, then retry.";async function L(n,s,d){const i=()=>n.state("time"),c=i();let l=c.tick,u=0,g=0;for(;;){const r=i();if(r.simSeconds-c.simSeconds>=s)return{stalled:!1};if(r.loopLiveness==="loop-starved"){if(!d)return{stalled:!0,starvedWithoutDriver:!0};if(g>=b)return{stalled:!0};g+=1;const e=s-(r.simSeconds-c.simSeconds),t=r.fixedDt,o=t!==void 0&&Number.isFinite(t)&&t>0?Math.max(1,Math.ceil(e/t-1e-9)):1;d(Math.min(P,o));const a=i();if(a.tick===r.tick&&a.simSeconds===r.simSeconds)return{stalled:!0};l=a.tick,u=0,await Promise.resolve();continue}if(u=r.tick===l?u+1:0,l=r.tick,u>=k)return{stalled:!0};await new Promise(e=>setTimeout(e,E))}}function h(){return typeof window<"u"}function S(n){return new URLSearchParams(n.search).get(D)==="1"}function A(n){return n.debug?.allowInProduction===!0}function I(n){const{registry:s,manifest:d}=n,i=s.adapter,c=[];function l(e){c.push(e),c.length>T&&c.shift()}const u=e=>{l(e.message||String(e.error))},g=e=>{l(`Unhandled promise rejection: ${String(e.reason)}`)};n.window.addEventListener?.("error",u),n.window.addEventListener?.("unhandledrejection",g);function r(e,t){const o=s.getVirtualInputTarget(t);if(!o)throw new v("DEBUG_INPUT_UNAVAILABLE",`debug bridge: ${e}() has no virtual-input target wired — no root entry exports \`debug.input\` (the game's own input door), or none has mounted yet`);return o}return{version:1,providers:i.providers,state:i.state,stateAll:i.stateAll,commands:i.commands,events:i.events,async invoke(e,t){if(!A(d))throw new v("DEBUG_COMMANDS_UNSUPPORTED",`debug: command "${e}" invocation refused — production build without debug.allowInProduction (D18)`,{name:e});return i.invoke(e,t)},input:{setVirtualAction:(e,t,o)=>r("setVirtualAction",o).setVirtualAction(e,t),tapVirtualAction:(e,t)=>r("tapVirtualAction",t).tapVirtualAction(e),clearVirtualActions:e=>r("clearVirtualActions",e).clearVirtualActions(),scheduleActionAtTick:(e,t,o,a)=>r("scheduleActionAtTick",a).scheduleActionAtTick(e,t,o),startRecording:e=>r("startRecording",e).startInputRecording(),stopRecording:e=>r("stopRecording",e).stopInputRecording(),isRecording:e=>r("isRecording",e).isInputRecording(),injectPointerDelta:(e,t,o)=>r("injectPointerDelta",o).injectPointerDelta(e,t),injectPointerPosition:(e,t,o)=>r("injectPointerPosition",o).injectPointerPosition(e,t)},snapshot(e){return{time:i.state("time"),state:i.stateAll(),events:i.events(e),pageErrors:c.slice()}},runTicks(e,t){const o=s.getRunTicksTarget();if(!o)throw new v("DEBUG_RUN_TICKS_UNAVAILABLE","debug bridge: runTicks() has no run-ticks target wired — no Game has mounted yet");o.runTicks(e,t)},runTicksSettled(e,t){return _(s,e,t)},async holdFor(e,t,o){const a=r("holdFor",o),w=a.setVirtualAction(e,!0);if(!w.delivered)return a.clearVirtualActions(),w.reason!==void 0?{delivered:!1,reason:w.reason}:{delivered:!1};const f=s.getRunTicksTarget(),{stalled:m,starvedWithoutDriver:p}=await L(i,t,f?R=>f.runTicks(R,{render:"last"}):void 0);return a.clearVirtualActions(),m?{delivered:!1,reason:p?V:"play stopped during hold"}:{delivered:!0}},uninstall(){n.window.removeEventListener?.("error",u),n.window.removeEventListener?.("unhandledrejection",g),delete n.window.__volter}}}function U(n){const s=n.url??(h()?window.location:void 0);if(!s||!S(s))return;const d=n.window??(h()?window:void 0);if(!d)return;if(!A(n.manifest)){console.warn("[debug] ?volter-debug=1 ignored: production build without debug.allowInProduction (D18)");return}const i=I({registry:n.registry,manifest:n.manifest,window:d});return d.__volter=i,i}export{V as H,U as m,L as w};
1
+ import{D as v}from"./debug-registry-DZXSvvn0.js";import{r as _}from"./game-network-CBHt-_DV.js";const D="volter-debug",T=100,E=50,k=100,P=60,b=2e3,V="the host loop reported liveness 'loop-starved' and this session has no way to drive ticks — no recent rAF progress was observed. Check `volter-game-editor status` for the separate visibility readings; foreground/reload the editor, or start play to wire the run-ticks target, then retry.";async function L(n,s,d){const i=()=>n.state("time"),c=i();let l=c.tick,u=0,g=0;for(;;){const r=i();if(r.simSeconds-c.simSeconds>=s)return{stalled:!1};if(r.loopLiveness==="loop-starved"){if(!d)return{stalled:!0,starvedWithoutDriver:!0};if(g>=b)return{stalled:!0};g+=1;const e=s-(r.simSeconds-c.simSeconds),t=r.fixedDt,o=t!==void 0&&Number.isFinite(t)&&t>0?Math.max(1,Math.ceil(e/t-1e-9)):1;d(Math.min(P,o));const a=i();if(a.tick===r.tick&&a.simSeconds===r.simSeconds)return{stalled:!0};l=a.tick,u=0,await Promise.resolve();continue}if(u=r.tick===l?u+1:0,l=r.tick,u>=k)return{stalled:!0};await new Promise(e=>setTimeout(e,E))}}function h(){return typeof window<"u"}function S(n){return new URLSearchParams(n.search).get(D)==="1"}function A(n){return n.debug?.allowInProduction===!0}function I(n){const{registry:s,manifest:d}=n,i=s.adapter,c=[];function l(e){c.push(e),c.length>T&&c.shift()}const u=e=>{l(e.message||String(e.error))},g=e=>{l(`Unhandled promise rejection: ${String(e.reason)}`)};n.window.addEventListener?.("error",u),n.window.addEventListener?.("unhandledrejection",g);function r(e,t){const o=s.getVirtualInputTarget(t);if(!o)throw new v("DEBUG_INPUT_UNAVAILABLE",`debug bridge: ${e}() has no virtual-input target wired — no root entry exports \`debug.input\` (the game's own input door), or none has mounted yet`);return o}return{version:1,providers:i.providers,state:i.state,stateAll:i.stateAll,commands:i.commands,events:i.events,async invoke(e,t){if(!A(d))throw new v("DEBUG_COMMANDS_UNSUPPORTED",`debug: command "${e}" invocation refused — production build without debug.allowInProduction (D18)`,{name:e});return i.invoke(e,t)},input:{setVirtualAction:(e,t,o)=>r("setVirtualAction",o).setVirtualAction(e,t),tapVirtualAction:(e,t)=>r("tapVirtualAction",t).tapVirtualAction(e),clearVirtualActions:e=>r("clearVirtualActions",e).clearVirtualActions(),scheduleActionAtTick:(e,t,o,a)=>r("scheduleActionAtTick",a).scheduleActionAtTick(e,t,o),startRecording:e=>r("startRecording",e).startInputRecording(),stopRecording:e=>r("stopRecording",e).stopInputRecording(),isRecording:e=>r("isRecording",e).isInputRecording(),injectPointerDelta:(e,t,o)=>r("injectPointerDelta",o).injectPointerDelta(e,t),injectPointerPosition:(e,t,o)=>r("injectPointerPosition",o).injectPointerPosition(e,t)},snapshot(e){return{time:i.state("time"),state:i.stateAll(),events:i.events(e),pageErrors:c.slice()}},runTicks(e,t){const o=s.getRunTicksTarget();if(!o)throw new v("DEBUG_RUN_TICKS_UNAVAILABLE","debug bridge: runTicks() has no run-ticks target wired — no Game has mounted yet");o.runTicks(e,t)},runTicksSettled(e,t){return _(s,e,t)},async holdFor(e,t,o){const a=r("holdFor",o),w=a.setVirtualAction(e,!0);if(!w.delivered)return a.clearVirtualActions(),w.reason!==void 0?{delivered:!1,reason:w.reason}:{delivered:!1};const f=s.getRunTicksTarget(),{stalled:m,starvedWithoutDriver:p}=await L(i,t,f?R=>f.runTicks(R,{render:"last"}):void 0);return a.clearVirtualActions(),m?{delivered:!1,reason:p?V:"play stopped during hold"}:{delivered:!0}},uninstall(){n.window.removeEventListener?.("error",u),n.window.removeEventListener?.("unhandledrejection",g),delete n.window.__volter}}}function U(n){const s=n.url??(h()?window.location:void 0);if(!s||!S(s))return;const d=n.window??(h()?window:void 0);if(!d)return;if(!A(n.manifest)){console.warn("[debug] ?volter-debug=1 ignored: production build without debug.allowInProduction (D18)");return}const i=I({registry:n.registry,manifest:n.manifest,window:d});return d.__volter=i,i}export{V as H,U as m,L as w};
@@ -1 +1 @@
1
- import{e0 as L}from"./index-C_gLrIvk.js";function B(o){const s=Symbol.for(`@volter/game-runtime/game-scoped/${o}`);return{set(u,d){Object.defineProperty(u,s,{configurable:!0,enumerable:!1,value:d})},get(u){return u[s]??null}}}class c extends Error{code;data;constructor(s,u,d){super(u),this.name="DebugError",this.code=s,this.data=d}}const T="ctx.debug.registerStateProvider(name, fn) — see the template example component";function P(o){if(o instanceof Error){const s={causeName:o.name,causeMessage:o.message};return o.stack===void 0?s:{...s,causeStack:o.stack}}return{causeName:typeof o,causeMessage:String(o)}}const q=1e4;function y(o,s,u,d){o.has(s)||(o.add(s),console.warn(`[debug] ${u} "${s}" re-registered (world "${d}")`))}function V(o){const s=new Map,u=new Map,d=new Set,S=new Set,m=[],R=500;let p=0,I=!1;const _=new Map,w=new Map,l=new Map;let E=null;const D=new Set;let b=null;const g=new Map;let N=0;function C(e){if(e!==void 0){if(!l.has(e))throw new c("DEBUG_INPUT_WORLD_NOT_FOUND",`debug: no input door wired for world "${e}" — registered: `+(l.size?[...l.keys()].join(", "):"(none)"),{worldId:e,registered:[...l.keys()]});return e}return h(l.keys())}function h(e){const t=[...e];if(t.length===0)return null;const r=o.getDefaultRootId?.()??null;return r!==null&&t.includes(r)?r:t[0]}s.set("time",{fn:()=>({simSeconds:o.getSimT(),tick:o.getTick(),loopLiveness:o.getLoopLiveness?.()??null,...o.getFixedDt===void 0?{}:{fixedDt:o.getFixedDt()}}),tier:"observable",worldId:"__engine__",builtin:!0}),s.set("input.actions",{fn:()=>{const e=h(_.keys());return(e?_.get(e):void 0)?.()??[]},tier:"observable",worldId:"__engine__",builtin:!0}),s.set("input.trace",{fn:()=>{const e=h(w.keys());return(e?w.get(e):void 0)?.()??{version:1,seed:null,fixedDt:null,ticks:[]}},tier:"observable",worldId:"__engine__",builtin:!0});function O(e,t,r,i){const n=s.get(t);if(n?.builtin)throw new c("DEBUG_BUILTIN_RESERVED",`debug: "${t}" is a built-in state provider (registered by "${n.worldId}") — built-in names cannot be registered over from a world`,{name:t,registered:n.worldId});if(n){if(n.worldId!==e)throw new c("DEBUG_NAME_COLLISION",`debug: state provider "${t}" is registered by both world "${n.worldId}" and world "${e}" — each provider name must be unique across live roots`,{name:t,roots:[n.worldId,e]});y(d,t,"provider",e)}s.set(t,{fn:r,tier:i,worldId:e,builtin:!1})}function A(e,t,r,i){if(r.locus===void 0&&I)throw new c("DEBUG_COMMAND_LOCUS_REQUIRED","this project declares a Colyseus room — declare locus: 'client' | 'server' so fixtures mutate authoritative state, not client prediction",{name:t,worldId:e});const n=u.get(t);if(n){if(n.worldId!==e)throw new c("DEBUG_NAME_COLLISION",`debug: command "${t}" is registered by both world "${n.worldId}" and world "${e}" — each command name must be unique across live roots`,{name:t,roots:[n.worldId,e]});y(S,t,"command",e)}u.set(t,{description:r.description,argsSchema:r.args,locus:r.locus,fn:i,worldId:e})}function k(e,t){p+=1,m.push({tick:o.getTick(),simT:o.getSimT(),event:e,detail:t,seq:p}),m.length>R&&m.shift()}function $(e){return e===void 0?m.slice():m.filter(t=>t.seq>e)}function G(e,t){if(!b)throw new c("DEBUG_COMMAND_FAILED",`debug: command "${e}" is locus:'server' but no Colyseus room is attached (call ctx.debug.attachRoom(room) once your game joins its room)`,{reason:"no room connection"});const r=`dbg-${++N}`,i=b;return new Promise((n,a)=>{const f=setTimeout(()=>{g.delete(r),a(new c("DEBUG_COMMAND_FAILED",`debug: command "${e}" (requestId "${r}") timed out waiting for the server`,{reason:"server timeout"}))},q);g.set(r,{resolve:n,reject:a,timer:f}),i.send("__volter:debugCommand",{name:e,args:t,requestId:r})})}let v=null;function U(e){v?.(),b=e;const t=e.onMessage("__volter:debugCommandResult",i=>{const n=i,a=n?.requestId;if(a===void 0)return;const f=g.get(a);f&&(g.delete(a),clearTimeout(f.timer),n?.ok?f.resolve(n.result):f.reject(new c("DEBUG_COMMAND_FAILED",`debug: server command failed: ${String(n?.error)}`,{cause:n?.error})))}),r=()=>{if(v===r){v=null,b===e&&(b=null),typeof t=="function"&&t();for(const[i,n]of g)clearTimeout(n.timer),n.reject(new c("DEBUG_COMMAND_FAILED",`debug: command (requestId "${i}") failed — its room was detached before a reply arrived`,{reason:"no room connection"}));g.clear()}};return v=r,r}return{adapter:{providers(){return[...s.entries()].map(([e,t])=>({name:e,tier:t.tier}))},state(e){const t=s.get(e);if(!t)throw new c("STATE_PROVIDER_NOT_FOUND",`debug: no state provider registered under "${e}"`,{registered:[...s.keys()],registrationHint:T});return t.fn()},stateAll(){const e={};for(const[t,r]of s)try{e[t]=r.fn()}catch(i){e[t]={__error:String(i)}}return e},commands(){return[...u.entries()].map(([e,t])=>({name:e,description:t.description,argsJsonSchema:t.argsSchema?L(t.argsSchema,{unrepresentable:"any"}):void 0,locus:t.locus??"client"}))},async invoke(e,t){const r=u.get(e);if(!r)throw new c("DEBUG_COMMAND_NOT_REGISTERED",`debug: no command registered under "${e}"`,{registered:[...u.keys()],registrationHint:T});let i=t;if(r.argsSchema){const n=r.argsSchema.safeParse(t);if(!n.success)throw new c("DEBUG_COMMAND_ARGS_INVALID",`debug: command "${e}" received invalid args`,{issues:n.error.issues});i=n.data}if((r.locus??"client")==="server")return G(e,i);try{return await r.fn(...i)}catch(n){const a=P(n);throw new c("DEBUG_COMMAND_FAILED",`debug: command "${e}" threw: ${a.causeMessage}`,{cause:n,...a})}},events(e){return $(e)}},forRoot(e){return{registerStateProvider(t,r,i){O(e,t,r,i?.tier??"observable")},registerCommand(t,r,i){A(e,t,r,i)},emit(t,r){k(t,r)},attachRoom(t){return U(t)}}},strip(e){for(const[t,r]of s)r.builtin||e!==void 0&&r.worldId!==e||(s.delete(t),d.delete(t));for(const[t,r]of u)e!==void 0&&r.worldId!==e||(u.delete(t),S.delete(t))},setRoomDeclared(e){I=e},setInputActionsSource(e,t){_.set(e,t)},setInputTraceSource(e,t){w.set(e,t)},setVirtualInputTarget(e,t){l.set(e,t)},getVirtualInputTarget(e){const t=C(e);return t!==null?l.get(t)??null:null},setRunTicksTarget(e){E=e},getRunTicksTarget(){return E},registerWorldSettledProbe(e){return D.add(e),()=>{D.delete(e)}},worldSettled(){for(const e of D)try{if(!e())return!1}catch{return!1}return!0},getGameTick(){return o.getTick()}}}const M=B("debug-registry");function j(o,s){M.set(o,s)}function H(o){return M.get(o)??null}export{c as D,V as a,B as c,H as g,j as r};
1
+ import{e0 as L}from"./index-C5cL2IUJ.js";function B(o){const s=Symbol.for(`@volter/game-runtime/game-scoped/${o}`);return{set(u,d){Object.defineProperty(u,s,{configurable:!0,enumerable:!1,value:d})},get(u){return u[s]??null}}}class c extends Error{code;data;constructor(s,u,d){super(u),this.name="DebugError",this.code=s,this.data=d}}const T="ctx.debug.registerStateProvider(name, fn) — see the template example component";function P(o){if(o instanceof Error){const s={causeName:o.name,causeMessage:o.message};return o.stack===void 0?s:{...s,causeStack:o.stack}}return{causeName:typeof o,causeMessage:String(o)}}const q=1e4;function y(o,s,u,d){o.has(s)||(o.add(s),console.warn(`[debug] ${u} "${s}" re-registered (world "${d}")`))}function V(o){const s=new Map,u=new Map,d=new Set,S=new Set,m=[],R=500;let p=0,I=!1;const _=new Map,w=new Map,l=new Map;let E=null;const D=new Set;let b=null;const g=new Map;let N=0;function C(e){if(e!==void 0){if(!l.has(e))throw new c("DEBUG_INPUT_WORLD_NOT_FOUND",`debug: no input door wired for world "${e}" — registered: `+(l.size?[...l.keys()].join(", "):"(none)"),{worldId:e,registered:[...l.keys()]});return e}return h(l.keys())}function h(e){const t=[...e];if(t.length===0)return null;const r=o.getDefaultRootId?.()??null;return r!==null&&t.includes(r)?r:t[0]}s.set("time",{fn:()=>({simSeconds:o.getSimT(),tick:o.getTick(),loopLiveness:o.getLoopLiveness?.()??null,...o.getFixedDt===void 0?{}:{fixedDt:o.getFixedDt()}}),tier:"observable",worldId:"__engine__",builtin:!0}),s.set("input.actions",{fn:()=>{const e=h(_.keys());return(e?_.get(e):void 0)?.()??[]},tier:"observable",worldId:"__engine__",builtin:!0}),s.set("input.trace",{fn:()=>{const e=h(w.keys());return(e?w.get(e):void 0)?.()??{version:1,seed:null,fixedDt:null,ticks:[]}},tier:"observable",worldId:"__engine__",builtin:!0});function O(e,t,r,i){const n=s.get(t);if(n?.builtin)throw new c("DEBUG_BUILTIN_RESERVED",`debug: "${t}" is a built-in state provider (registered by "${n.worldId}") — built-in names cannot be registered over from a world`,{name:t,registered:n.worldId});if(n){if(n.worldId!==e)throw new c("DEBUG_NAME_COLLISION",`debug: state provider "${t}" is registered by both world "${n.worldId}" and world "${e}" — each provider name must be unique across live roots`,{name:t,roots:[n.worldId,e]});y(d,t,"provider",e)}s.set(t,{fn:r,tier:i,worldId:e,builtin:!1})}function A(e,t,r,i){if(r.locus===void 0&&I)throw new c("DEBUG_COMMAND_LOCUS_REQUIRED","this project declares a Colyseus room — declare locus: 'client' | 'server' so fixtures mutate authoritative state, not client prediction",{name:t,worldId:e});const n=u.get(t);if(n){if(n.worldId!==e)throw new c("DEBUG_NAME_COLLISION",`debug: command "${t}" is registered by both world "${n.worldId}" and world "${e}" — each command name must be unique across live roots`,{name:t,roots:[n.worldId,e]});y(S,t,"command",e)}u.set(t,{description:r.description,argsSchema:r.args,locus:r.locus,fn:i,worldId:e})}function k(e,t){p+=1,m.push({tick:o.getTick(),simT:o.getSimT(),event:e,detail:t,seq:p}),m.length>R&&m.shift()}function $(e){return e===void 0?m.slice():m.filter(t=>t.seq>e)}function G(e,t){if(!b)throw new c("DEBUG_COMMAND_FAILED",`debug: command "${e}" is locus:'server' but no Colyseus room is attached (call ctx.debug.attachRoom(room) once your game joins its room)`,{reason:"no room connection"});const r=`dbg-${++N}`,i=b;return new Promise((n,a)=>{const f=setTimeout(()=>{g.delete(r),a(new c("DEBUG_COMMAND_FAILED",`debug: command "${e}" (requestId "${r}") timed out waiting for the server`,{reason:"server timeout"}))},q);g.set(r,{resolve:n,reject:a,timer:f}),i.send("__volter:debugCommand",{name:e,args:t,requestId:r})})}let v=null;function U(e){v?.(),b=e;const t=e.onMessage("__volter:debugCommandResult",i=>{const n=i,a=n?.requestId;if(a===void 0)return;const f=g.get(a);f&&(g.delete(a),clearTimeout(f.timer),n?.ok?f.resolve(n.result):f.reject(new c("DEBUG_COMMAND_FAILED",`debug: server command failed: ${String(n?.error)}`,{cause:n?.error})))}),r=()=>{if(v===r){v=null,b===e&&(b=null),typeof t=="function"&&t();for(const[i,n]of g)clearTimeout(n.timer),n.reject(new c("DEBUG_COMMAND_FAILED",`debug: command (requestId "${i}") failed — its room was detached before a reply arrived`,{reason:"no room connection"}));g.clear()}};return v=r,r}return{adapter:{providers(){return[...s.entries()].map(([e,t])=>({name:e,tier:t.tier}))},state(e){const t=s.get(e);if(!t)throw new c("STATE_PROVIDER_NOT_FOUND",`debug: no state provider registered under "${e}"`,{registered:[...s.keys()],registrationHint:T});return t.fn()},stateAll(){const e={};for(const[t,r]of s)try{e[t]=r.fn()}catch(i){e[t]={__error:String(i)}}return e},commands(){return[...u.entries()].map(([e,t])=>({name:e,description:t.description,argsJsonSchema:t.argsSchema?L(t.argsSchema,{unrepresentable:"any"}):void 0,locus:t.locus??"client"}))},async invoke(e,t){const r=u.get(e);if(!r)throw new c("DEBUG_COMMAND_NOT_REGISTERED",`debug: no command registered under "${e}"`,{registered:[...u.keys()],registrationHint:T});let i=t;if(r.argsSchema){const n=r.argsSchema.safeParse(t);if(!n.success)throw new c("DEBUG_COMMAND_ARGS_INVALID",`debug: command "${e}" received invalid args`,{issues:n.error.issues});i=n.data}if((r.locus??"client")==="server")return G(e,i);try{return await r.fn(...i)}catch(n){const a=P(n);throw new c("DEBUG_COMMAND_FAILED",`debug: command "${e}" threw: ${a.causeMessage}`,{cause:n,...a})}},events(e){return $(e)}},forRoot(e){return{registerStateProvider(t,r,i){O(e,t,r,i?.tier??"observable")},registerCommand(t,r,i){A(e,t,r,i)},emit(t,r){k(t,r)},attachRoom(t){return U(t)}}},strip(e){for(const[t,r]of s)r.builtin||e!==void 0&&r.worldId!==e||(s.delete(t),d.delete(t));for(const[t,r]of u)e!==void 0&&r.worldId!==e||(u.delete(t),S.delete(t))},setRoomDeclared(e){I=e},setInputActionsSource(e,t){_.set(e,t)},setInputTraceSource(e,t){w.set(e,t)},setVirtualInputTarget(e,t){l.set(e,t)},getVirtualInputTarget(e){const t=C(e);return t!==null?l.get(t)??null:null},setRunTicksTarget(e){E=e},getRunTicksTarget(){return E},registerWorldSettledProbe(e){return D.add(e),()=>{D.delete(e)}},worldSettled(){for(const e of D)try{if(!e())return!1}catch{return!1}return!0},getGameTick(){return o.getTick()}}}const M=B("debug-registry");function j(o,s){M.set(o,s)}function H(o){return M.get(o)??null}export{c as D,V as a,B as c,H as g,j as r};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/canvas-entry-runtime-BLPKpqpp.js","assets/index-C_gLrIvk.js","assets/index-nmcBqr7Y.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-D_NuPfjr.js","assets/jsx-runtime-DPjLkJKQ.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/index-CPiRKiDC.css","assets/debug-registry-B0UtXvgn.js","assets/mount-ingest-root-Dn5SOQdS.js","assets/active-ingest-ZOiV0Jtk.js","assets/game-contract-seams-BhjR536D.js","assets/capability-coverage-NcL3fdGj.js","assets/ingest-source-persistence-Cxv-xcnT.js","assets/contract-system-adapters-CJXxexZO.js","assets/three-state-CR9QYeCl.js","assets/editor-shell-store-C9QYXDRr.js","assets/output-pass-HurwNl0G.js","assets/three.module-BLhyNg0e.js","assets/three.core-3arARmh6.js","assets/Pass-D1MRT672.js","assets/editor-layers-TtgYYi_s.js","assets/workspace-arrangement-BTINexHg.js","assets/user-data-BS92dOsI.js","assets/entity-object-CTha2dPd.js","assets/three-contract-Dkt6PmWY.js"])))=>i.map(i=>d[i]);
2
- import{I as u,J as f,_ as i,K as d,L as n,M as m,O as p,Q as g}from"./index-C_gLrIvk.js";import{q as v}from"./edit-mode-authoring-8eqT4Ah6.js";import{d as P,a as c,b as w,g as y,e as I,c as _}from"./active-ingest-ZOiV0Jtk.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./game-contract-seams-BhjR536D.js";import"./capability-coverage-NcL3fdGj.js";import"./ingest-source-persistence-Cxv-xcnT.js";import"./contract-system-adapters-CJXxexZO.js";async function h(){const e=await u().catch(()=>null);if(!e)return!1;const t=f(e);if(t.length!==1)return!1;if(t[0].world!==void 0)return!0;const a=await R();return A(a)}const D=4e3;function R(){const e=n();return e?Promise.resolve(e):new Promise(t=>{const a=setTimeout(()=>{s(),t(n())},D),s=m(()=>{const r=n();r&&(clearTimeout(a),s(),t(r))})})}function A(e){return e?p(e.scenes).some(t=>t.plan.kind==="isolation-document"):!1}async function G(e){if(!await h())return!1;const t=await u().catch(()=>null);if((t?f(t).some(r=>r.adapter.surface==="canvas"):!1)&&!c()){const{resolveCanvasPixiForEditor:r}=await i(async()=>{const{resolveCanvasPixiForEditor:l}=await import("./canvas-entry-runtime-BLPKpqpp.js");return{resolveCanvasPixiForEditor:l}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]));(await r()).Assets.reset()}const{launchIngestRoutes:s}=await i(async()=>{const{launchIngestRoutes:r}=await import("./mount-ingest-root-Dn5SOQdS.js").then(o=>o.m);return{launchIngestRoutes:r}},__vite__mapDeps([12,1,2,3,4,5,6,7,8,9,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28]));if(await s(e),!c())throw new Error(`Play could not start: this project's ingest root failed to mount — see the mount failure reported above (and in ${d("status")}).`);return w(),g(),y()?.play(),!0}function J(e){return P()?(I(),_(),e.shell.setPlayState("stopped"),v(),!0):!1}export{P as deferredIngestPlayActive,J as exitDeferredIngestPlay,h as ingestMountIsDeferredToPlay,G as mountDeferredIngestForPlay};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/canvas-entry-runtime-D4UUWHHS.js","assets/index-C5cL2IUJ.js","assets/index-nmcBqr7Y.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-D_NuPfjr.js","assets/jsx-runtime-DPjLkJKQ.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/index-CPiRKiDC.css","assets/debug-registry-DZXSvvn0.js","assets/mount-ingest-root-B6iHB5JJ.js","assets/active-ingest-_WDvM24r.js","assets/game-contract-seams-leXTqnUS.js","assets/capability-coverage-D1AjR_LI.js","assets/ingest-source-persistence-CCGS4Nxy.js","assets/contract-system-adapters-BTeuY0Wz.js","assets/three-state-CouynZOV.js","assets/editor-shell-store-B87W2cjm.js","assets/output-pass-HurwNl0G.js","assets/three.module-BLhyNg0e.js","assets/three.core-3arARmh6.js","assets/Pass-D1MRT672.js","assets/editor-layers-DJwy9H_k.js","assets/workspace-arrangement-Bx5PVUVK.js","assets/user-data-BYUf0wLn.js","assets/entity-object-BpsV3ox5.js","assets/three-contract-Dkt6PmWY.js"])))=>i.map(i=>d[i]);
2
+ import{I as u,J as f,_ as i,K as d,L as n,M as m,O as p,Q as g}from"./index-C5cL2IUJ.js";import{q as v}from"./edit-mode-authoring-Ch6v9PnO.js";import{d as P,a as c,b as w,g as y,e as I,c as _}from"./active-ingest-_WDvM24r.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./game-contract-seams-leXTqnUS.js";import"./capability-coverage-D1AjR_LI.js";import"./ingest-source-persistence-CCGS4Nxy.js";import"./contract-system-adapters-BTeuY0Wz.js";async function h(){const e=await u().catch(()=>null);if(!e)return!1;const t=f(e);if(t.length!==1)return!1;if(t[0].world!==void 0)return!0;const a=await R();return A(a)}const D=4e3;function R(){const e=n();return e?Promise.resolve(e):new Promise(t=>{const a=setTimeout(()=>{s(),t(n())},D),s=m(()=>{const r=n();r&&(clearTimeout(a),s(),t(r))})})}function A(e){return e?p(e.scenes).some(t=>t.plan.kind==="isolation-document"):!1}async function G(e){if(!await h())return!1;const t=await u().catch(()=>null);if((t?f(t).some(r=>r.adapter.surface==="canvas"):!1)&&!c()){const{resolveCanvasPixiForEditor:r}=await i(async()=>{const{resolveCanvasPixiForEditor:l}=await import("./canvas-entry-runtime-D4UUWHHS.js");return{resolveCanvasPixiForEditor:l}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]));(await r()).Assets.reset()}const{launchIngestRoutes:s}=await i(async()=>{const{launchIngestRoutes:r}=await import("./mount-ingest-root-B6iHB5JJ.js").then(o=>o.m);return{launchIngestRoutes:r}},__vite__mapDeps([12,1,2,3,4,5,6,7,8,9,10,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28]));if(await s(e),!c())throw new Error(`Play could not start: this project's ingest root failed to mount — see the mount failure reported above (and in ${d("status")}).`);return w(),g(),y()?.play(),!0}function J(e){return P()?(I(),_(),e.shell.setPlayState("stopped"),v(),!0):!1}export{P as deferredIngestPlayActive,J as exitDeferredIngestPlay,h as ingestMountIsDeferredToPlay,G as mountDeferredIngestForPlay};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/canvas-design-mount-C0NaIyI3.js","assets/index-C_gLrIvk.js","assets/index-nmcBqr7Y.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-D_NuPfjr.js","assets/jsx-runtime-DPjLkJKQ.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/index-CPiRKiDC.css","assets/babylon-authoring-adapter-Ba6K8LSs.js","assets/json-history-resource-BReCXsj2.js","assets/source-persistence-backend-CpNTlQ6r.js","assets/ingest-source-persistence-Cxv-xcnT.js","assets/pixi-authoring-adapter-CXve0GKc.js","assets/index-BVSm448e.js","assets/component-instance-root-4o-HMx39.js","assets/user-data-BS92dOsI.js","assets/workspace-arrangement-BTINexHg.js","assets/pixi-transform-channels-P4rvmusc.js","assets/relative-import-specifier-Dg5O2O1R.js","assets/oid-transform-DMPczBkS.js","assets/writer-tw6EcuVO.js","assets/r3f-physics-binding-B0M0RByC.js","assets/canvas-preview-frames-BFYpLtLK.js","assets/canvas-entry-runtime-BLPKpqpp.js","assets/debug-registry-B0UtXvgn.js","assets/realm-services-CyH5yTHN.js","assets/three-ingest-runtime-B09tYa9n.js","assets/three.module-BLhyNg0e.js","assets/three.core-3arARmh6.js","assets/EffectComposer-BEAt0PtQ.js","assets/CopyShader-BzTUYzf6.js","assets/ShaderPass-DTnDQXm0.js","assets/Pass-D1MRT672.js","assets/CSS3DRenderer-BsAqfavI.js","assets/native-debug-module-Dvzh4rev.js","assets/native-entry-surface-BE8LJNdu.js","assets/contract-system-adapters-CJXxexZO.js","assets/game-contract-seams-BhjR536D.js","assets/assets-BcrMQHRv.js","assets/loader-BTUKnX5Q.js","assets/KTX2Loader-CaqVE6nY.js","assets/GLTFLoader-KeoruJgS.js","assets/BufferGeometryUtils-B22h7jo4.js","assets/create-runtime-BcW4ljbo.js","assets/adapter-surface-Y37Nzcyw.js","assets/binding-Bmxqznjk.js","assets/root-stacking-BEd9ZvxC.js","assets/setup-renderer-D4rh83E5.js","assets/index-DHhMOs_s.js","assets/defaults-DKiBJCPN.js","assets/render-settings-DBqv2yw8.js","assets/render-features-BPb6UG8u.js","assets/seeded-random-CilWrQ9p.js","assets/loop-gate-report-N52EWFGD.js","assets/system-slot-E2mEdiih.js","assets/user-data-CODoGZqA.js","assets/object-marks-BnvSuCTt.js","assets/performance-profiler-CMbwGBuk.js"])))=>i.map(i=>d[i]);
2
- import{_ as u,dI as c,dJ as l}from"./index-C_gLrIvk.js";import{t as d}from"./three-state-CR9QYeCl.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./editor-shell-store-C9QYXDRr.js";import"./output-pass-HurwNl0G.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./Pass-D1MRT672.js";import"./editor-layers-TtgYYi_s.js";import"./workspace-arrangement-BTINexHg.js";import"./user-data-BS92dOsI.js";import"./entity-object-CTha2dPd.js";import"./three-contract-Dkt6PmWY.js";async function W(o,t,e){const{mountCanvasDesignLayer:r}=await u(async()=>{const{mountCanvasDesignLayer:p}=await import("./canvas-design-mount-C0NaIyI3.js");return{mountCanvasDesignLayer:p}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60])),{projectRootPath:s,view:a,activationDocumentId:i}=e,n=d();if(!n)throw new Error(`canvas root "${o.worldId}": the editor store is not bound yet.`);const m=await r(o.worldId,o.path,t,s,n,a,i?()=>c(i):void 0);return{adapter:m.adapter,dispose:()=>m.dispose()}}function $(o){let t=null;const e=l(r=>{r!==""&&!/^src\/.+\.(?:[cm]?tsx?|jsx?)$/.test(r)||(t!==null&&clearTimeout(t),t=setTimeout(()=>{t=null,o()},150))});return()=>{t!==null&&clearTimeout(t),t=null,e()}}export{W as mountCanvasDesignTimeLayer,$ as remountWhenSourceIsWritten};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/canvas-design-mount-Dg1jk7P9.js","assets/index-C5cL2IUJ.js","assets/index-nmcBqr7Y.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-D_NuPfjr.js","assets/jsx-runtime-DPjLkJKQ.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/index-CPiRKiDC.css","assets/babylon-authoring-adapter-CxbL-7dI.js","assets/json-history-resource-DS16aq7M.js","assets/source-persistence-backend-Mw40F3bc.js","assets/ingest-source-persistence-CCGS4Nxy.js","assets/pixi-authoring-adapter-DaWrJsOF.js","assets/index-D4HAbSY1.js","assets/component-instance-root-BVjTH0AO.js","assets/user-data-BYUf0wLn.js","assets/workspace-arrangement-Bx5PVUVK.js","assets/pixi-transform-channels-P4rvmusc.js","assets/relative-import-specifier-OJ1nkBV9.js","assets/oid-transform-BUbpXU6R.js","assets/writer-tw6EcuVO.js","assets/r3f-physics-binding-uhCRHed5.js","assets/canvas-preview-frames-8g_T28jt.js","assets/canvas-entry-runtime-D4UUWHHS.js","assets/debug-registry-DZXSvvn0.js","assets/realm-services-CqGTAk9D.js","assets/three-ingest-runtime-C2ruwAa_.js","assets/three.module-BLhyNg0e.js","assets/three.core-3arARmh6.js","assets/EffectComposer-BEAt0PtQ.js","assets/CopyShader-BzTUYzf6.js","assets/ShaderPass-DTnDQXm0.js","assets/Pass-D1MRT672.js","assets/CSS3DRenderer-BsAqfavI.js","assets/native-debug-module-BcCIQlpj.js","assets/native-entry-surface-BE8LJNdu.js","assets/contract-system-adapters-BTeuY0Wz.js","assets/game-contract-seams-leXTqnUS.js","assets/assets-BcrMQHRv.js","assets/loader-BTUKnX5Q.js","assets/KTX2Loader-CaqVE6nY.js","assets/GLTFLoader-KeoruJgS.js","assets/BufferGeometryUtils-B22h7jo4.js","assets/create-runtime-DTWZzn1t.js","assets/adapter-surface-Y37Nzcyw.js","assets/binding-Bmxqznjk.js","assets/root-stacking-BEd9ZvxC.js","assets/setup-renderer-DAvDM3La.js","assets/index-DHhMOs_s.js","assets/defaults-DKiBJCPN.js","assets/render-settings-Dy89f95W.js","assets/render-features-CMMNCiUj.js","assets/seeded-random-31t3Hhi7.js","assets/loop-gate-report-N52EWFGD.js","assets/system-slot-E2mEdiih.js","assets/user-data-CODoGZqA.js","assets/object-marks-BnvSuCTt.js","assets/performance-profiler-CMbwGBuk.js"])))=>i.map(i=>d[i]);
2
+ import{_ as u,dI as c,dJ as l}from"./index-C5cL2IUJ.js";import{t as d}from"./three-state-CouynZOV.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./editor-shell-store-B87W2cjm.js";import"./output-pass-HurwNl0G.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./Pass-D1MRT672.js";import"./editor-layers-DJwy9H_k.js";import"./workspace-arrangement-Bx5PVUVK.js";import"./user-data-BYUf0wLn.js";import"./entity-object-BpsV3ox5.js";import"./three-contract-Dkt6PmWY.js";async function W(o,t,e){const{mountCanvasDesignLayer:r}=await u(async()=>{const{mountCanvasDesignLayer:p}=await import("./canvas-design-mount-Dg1jk7P9.js");return{mountCanvasDesignLayer:p}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60])),{projectRootPath:s,view:a,activationDocumentId:i}=e,n=d();if(!n)throw new Error(`canvas root "${o.worldId}": the editor store is not bound yet.`);const m=await r(o.worldId,o.path,t,s,n,a,i?()=>c(i):void 0);return{adapter:m.adapter,dispose:()=>m.dispose()}}function $(o){let t=null;const e=l(r=>{r!==""&&!/^src\/.+\.(?:[cm]?tsx?|jsx?)$/.test(r)||(t!==null&&clearTimeout(t),t=setTimeout(()=>{t=null,o()},150))});return()=>{t!==null&&clearTimeout(t),t=null,e()}}export{W as mountCanvasDesignTimeLayer,$ as remountWhenSourceIsWritten};
@@ -1 +1 @@
1
- import{stackOrder as se}from"./root-stacking-BEd9ZvxC.js";import{dM as ie,dN as de,dO as le,dB as ue,aC as ae,dP as q,bY as fe,Z as P,bX as pe,aH as ce,dQ as we,dE as he,dC as ye}from"./index-C_gLrIvk.js";import{B as S,q as N}from"./edit-mode-authoring-8eqT4Ah6.js";import{s as me,d as I,a as ge}from"./design-time-mount-registry-DUpXCg1U.js";import{d as Ie,s as be,g as ve,e as Se}from"./react-story-board-B9_ZSGGT.js";import{m as ke}from"./game-surface-defaults-D8S4cRxi.js";const H=new Map;function X(n,r){return`${n}\0${r}`}function De(n,r){return H.get(X(n,r))}function Ve(n,r,t){H.set(X(n,r),t)}const Ce=1;function Y(n){const r=[];for(const{worldId:t,adapter:d}of n.childAdapters()){if(!(d instanceof S))continue;const u=d.inspector.get(t,"kind");if(u!=="dom"&&u!=="canvas"||d.inspector.get(t,"reason")!==void 0)continue;const b=d.inspector.get(t,"adapter");b?.startsWith("ingest")||b?.startsWith("module")||r.push({worldId:t,kind:u,path:d.inspector.get(t,"path"),zOrder:Number(d.inspector.get(t,"zOrder")??0),pausable:d.inspector.get(t,"pausable")!==!1})}return r}function xe(n){return Y(n)}const Oe="ui-components-board";function j(n,r){return n.childAdapters().some(t=>t.worldId===r)}function We(){return{worldId:Oe,kind:"dom",path:void 0,zOrder:0,pausable:!0}}function Z(n,r,t="dom"){const d=ce(r)?"none":"block";n.style.display=d,n.style.pointerEvents=I(t)?.alwaysInteractive||we(r)?"auto":"none";for(const u of Array.from(n.parentElement?.children??[]))u instanceof HTMLElement&&u.dataset.volterStoryBoardChromeFor===r&&(u.style.display=d)}function Re(n,r,t,d){const{worldId:u}=r,s=document.createElement("div");return s.dataset.worldId=u,s.dataset.volterRootSurface="true",d&&(s.dataset.volterCanvasScene="true"),s.style.position="absolute",s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%",s.style.zIndex=String(t),s.style.contain="layout paint",ke(s),Z(s,u,r.kind),D(s),n.appendChild(s),s}function D(n){if(n.dataset.volterCanvasScene==="true"){n.style.transform="",n.style.width="100%",n.style.height="100%";return}if(n.style.transform=he(ye())??"",n.style.transformOrigin="0 0",n.dataset.volterReactStoryBoard==="true")return;const r=ve();n.style.width=r.width===null?"100%":`${r.width}px`,n.style.height=r.height===null?"100%":`${r.height}px`}const E=new Map;function Ae(n,r,t,d,u,s,b){s?s.canvasSceneView.reset():ie(),Se();const k=ae();if(!s&&k?.config.resolution&&Ie(k.config.resolution.width,k.config.resolution.height),t.playState!=="stopped"){let e=!1,o=!1;const i=t.subscribe(()=>{e||o||t.playState!=="stopped"||(o=!0,e||N())});return()=>{e=!0,i()}}const V=k?.rootPath,z=d?[...d]:Y(r);if(z.length===0||!V)return()=>{};const G=V,y=se(z.map(e=>({id:e.worldId,zOrder:e.zOrder}))).map(e=>z.find(o=>o.worldId===e.id)),x=new Map(y.map(e=>[e.worldId,e])),a=new Map,m=new Map,C=new Map,O=new Set,R=new Set,T=new Set;let h=!1,p=!1,W=!1;function A(){for(const e of m.values())try{e()}catch(o){P.error(`[design-time-layers] dispose failed: ${o}`,"authoring")}m.clear();for(const e of a.values())e.remove();a.clear();for(const e of y)u?.(e.worldId,null)}function J(){A();for(const e of O){const o=x.get(e);if(!o)continue;const i={id:o.worldId,kind:o.kind,entryOrScenePath:o.path,zOrder:o.zOrder,pausable:o.pausable};r.replaceChild(e,new S(t,i,"Design-time layer suspended by play mode — Stop restores it."))}O.clear(),t.notifyIngestEdit()}function M(e,o,i){const l=I(e.kind);if(!l){R.add(e.worldId);return}R.delete(e.worldId);const f=(C.get(e.worldId)??0)+1;C.set(e.worldId,f);const c=Re(n,e,Ce+o,!!s);a.set(e.worldId,c);const B={projectRootPath:G,store:t,...s?{view:s.canvasSceneView}:{},...b?{activationDocumentId:b}:{}},L=E.get(e.worldId),$=(async()=>(L&&await L,l.mount(e,c,B)))().then(w=>{if(h||p||C.get(e.worldId)!==f){w.dispose();return}if(w.adapter)j(r,e.worldId)&&(r.replaceChild(e.worldId,w.adapter),O.add(e.worldId)),u?.(e.worldId,w.adapter);else if(w.pick){const v={id:e.worldId,kind:e.kind,entryOrScenePath:e.path,zOrder:e.zOrder,pausable:e.pausable};r.replaceChild(e.worldId,new S(t,v,void 0,w.pick)),O.add(e.worldId)}m.set(e.worldId,w.dispose),q(e.worldId),t.notifyIngestEdit(),i?.()}).catch(w=>{if(C.get(e.worldId)!==f||(i?.(),c.remove(),a.get(e.worldId)===c&&a.delete(e.worldId),h||p))return;const v=fe(w);P.error(`[design-time-layers] world "${e.worldId}" (${e.kind}) failed to mount: ${v}`,"authoring");const ne={id:e.worldId,kind:e.kind,entryOrScenePath:e.path,zOrder:e.zOrder,pausable:e.pausable};u?.(e.worldId,null),j(r,e.worldId)&&r.replaceChild(e.worldId,new S(t,ne,v)),pe({worldId:e.worldId,kind:e.kind,identity:l.identity,message:v}),t.notifyIngestEdit()});E.set(e.worldId,$),$.then(()=>{E.get(e.worldId)===$&&E.delete(e.worldId)})}y.forEach((e,o)=>{M(e,o)});function K(e,o){const i=m.get(e.worldId);m.delete(e.worldId);const l=a.get(e.worldId);a.delete(e.worldId),M(e,o,()=>{const c=a.get(e.worldId);if(c&&(c.style.visibility=""),i)try{i()}catch(B){P.error(`[design-time-layers] re-projection dispose failed: ${B}`,"authoring")}l?.remove()});const f=a.get(e.worldId);f&&f!==l&&(f.style.visibility="hidden")}function Q(e,o){const i=m.get(e.worldId);if(m.delete(e.worldId),i)try{i()}catch(f){P.error(`[design-time-layers] remount dispose failed: ${f}`,"authoring")}const l=a.get(e.worldId);l&&(l.remove(),a.delete(e.worldId)),M(e,o)}const g=new Map;function F(){for(const[e,o]of g)I(e.kind)!==e&&(o(),g.delete(e));for(const e of ge()){if(g.has(e)||I(e.kind)!==e||!y.some(l=>l.kind===e.kind))continue;const o=[],i=l=>()=>{h||p||t.playState!=="stopped"||y.forEach((f,c)=>{f.kind===e.kind&&l(f,c)})};e.remountWhen&&o.push(e.remountWhen(i(Q))),e.reprojectWhen&&o.push(e.reprojectWhen(i(K))),g.set(e,()=>{for(const l of o)l()})}}F();const U=me(()=>{h||p||t.playState!=="stopped"||(y.forEach((e,o)=>{R.has(e.worldId)&&I(e.kind)&&(T.delete(e.worldId),q(e.worldId),M(e,o))}),F())}),_=()=>{if(h||p)return;let e=!1;for(const o of y){if(!R.has(o.worldId)||T.has(o.worldId)||I(o.kind)||(T.add(o.worldId),!j(r,o.worldId)))continue;const i={id:o.worldId,kind:o.kind,entryOrScenePath:o.path,zOrder:o.zOrder,pausable:o.pausable};r.replaceChild(o.worldId,new S(t,i,`No package in this editor registered a design-time mount for a "${o.kind}" world, so there is nothing here to author it with.`)),e=!0}e&&t.notifyIngestEdit()},ee=de(_);le()&&_();const oe=ue(()=>{for(const e of a.values())D(e)}),te=be(()=>{for(const e of a.values())D(e)}),re=t.subscribe(()=>{if(!p&&t.playState!=="stopped"){p=!0,J();return}if(p&&!W&&t.playState==="stopped"&&!h){W=!0,h||N();return}if(!p)for(const[e,o]of a)Z(o,e,x.get(e)?.kind??"dom")});return()=>{h=!0;for(const e of g.values())e();g.clear(),U(),ee(),re(),oe(),te(),A()}}export{Ve as a,xe as d,Ae as m,We as p,De as r};
1
+ import{stackOrder as se}from"./root-stacking-BEd9ZvxC.js";import{dM as ie,dN as de,dO as le,dB as ue,aC as ae,dP as q,bY as fe,Z as P,bX as pe,aH as ce,dQ as we,dE as he,dC as ye}from"./index-C5cL2IUJ.js";import{B as S,q as N}from"./edit-mode-authoring-Ch6v9PnO.js";import{s as me,d as I,a as ge}from"./design-time-mount-registry-DUpXCg1U.js";import{d as Ie,s as be,g as ve,e as Se}from"./react-story-board-D2pwwUUp.js";import{m as ke}from"./game-surface-defaults-D8S4cRxi.js";const H=new Map;function X(n,r){return`${n}\0${r}`}function De(n,r){return H.get(X(n,r))}function Ve(n,r,t){H.set(X(n,r),t)}const Ce=1;function Y(n){const r=[];for(const{worldId:t,adapter:d}of n.childAdapters()){if(!(d instanceof S))continue;const u=d.inspector.get(t,"kind");if(u!=="dom"&&u!=="canvas"||d.inspector.get(t,"reason")!==void 0)continue;const b=d.inspector.get(t,"adapter");b?.startsWith("ingest")||b?.startsWith("module")||r.push({worldId:t,kind:u,path:d.inspector.get(t,"path"),zOrder:Number(d.inspector.get(t,"zOrder")??0),pausable:d.inspector.get(t,"pausable")!==!1})}return r}function xe(n){return Y(n)}const Oe="ui-components-board";function j(n,r){return n.childAdapters().some(t=>t.worldId===r)}function We(){return{worldId:Oe,kind:"dom",path:void 0,zOrder:0,pausable:!0}}function Z(n,r,t="dom"){const d=ce(r)?"none":"block";n.style.display=d,n.style.pointerEvents=I(t)?.alwaysInteractive||we(r)?"auto":"none";for(const u of Array.from(n.parentElement?.children??[]))u instanceof HTMLElement&&u.dataset.volterStoryBoardChromeFor===r&&(u.style.display=d)}function Re(n,r,t,d){const{worldId:u}=r,s=document.createElement("div");return s.dataset.worldId=u,s.dataset.volterRootSurface="true",d&&(s.dataset.volterCanvasScene="true"),s.style.position="absolute",s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%",s.style.zIndex=String(t),s.style.contain="layout paint",ke(s),Z(s,u,r.kind),D(s),n.appendChild(s),s}function D(n){if(n.dataset.volterCanvasScene==="true"){n.style.transform="",n.style.width="100%",n.style.height="100%";return}if(n.style.transform=he(ye())??"",n.style.transformOrigin="0 0",n.dataset.volterReactStoryBoard==="true")return;const r=ve();n.style.width=r.width===null?"100%":`${r.width}px`,n.style.height=r.height===null?"100%":`${r.height}px`}const E=new Map;function Ae(n,r,t,d,u,s,b){s?s.canvasSceneView.reset():ie(),Se();const k=ae();if(!s&&k?.config.resolution&&Ie(k.config.resolution.width,k.config.resolution.height),t.playState!=="stopped"){let e=!1,o=!1;const i=t.subscribe(()=>{e||o||t.playState!=="stopped"||(o=!0,e||N())});return()=>{e=!0,i()}}const V=k?.rootPath,z=d?[...d]:Y(r);if(z.length===0||!V)return()=>{};const G=V,y=se(z.map(e=>({id:e.worldId,zOrder:e.zOrder}))).map(e=>z.find(o=>o.worldId===e.id)),x=new Map(y.map(e=>[e.worldId,e])),a=new Map,m=new Map,C=new Map,O=new Set,R=new Set,T=new Set;let h=!1,p=!1,W=!1;function A(){for(const e of m.values())try{e()}catch(o){P.error(`[design-time-layers] dispose failed: ${o}`,"authoring")}m.clear();for(const e of a.values())e.remove();a.clear();for(const e of y)u?.(e.worldId,null)}function J(){A();for(const e of O){const o=x.get(e);if(!o)continue;const i={id:o.worldId,kind:o.kind,entryOrScenePath:o.path,zOrder:o.zOrder,pausable:o.pausable};r.replaceChild(e,new S(t,i,"Design-time layer suspended by play mode — Stop restores it."))}O.clear(),t.notifyIngestEdit()}function M(e,o,i){const l=I(e.kind);if(!l){R.add(e.worldId);return}R.delete(e.worldId);const f=(C.get(e.worldId)??0)+1;C.set(e.worldId,f);const c=Re(n,e,Ce+o,!!s);a.set(e.worldId,c);const B={projectRootPath:G,store:t,...s?{view:s.canvasSceneView}:{},...b?{activationDocumentId:b}:{}},L=E.get(e.worldId),$=(async()=>(L&&await L,l.mount(e,c,B)))().then(w=>{if(h||p||C.get(e.worldId)!==f){w.dispose();return}if(w.adapter)j(r,e.worldId)&&(r.replaceChild(e.worldId,w.adapter),O.add(e.worldId)),u?.(e.worldId,w.adapter);else if(w.pick){const v={id:e.worldId,kind:e.kind,entryOrScenePath:e.path,zOrder:e.zOrder,pausable:e.pausable};r.replaceChild(e.worldId,new S(t,v,void 0,w.pick)),O.add(e.worldId)}m.set(e.worldId,w.dispose),q(e.worldId),t.notifyIngestEdit(),i?.()}).catch(w=>{if(C.get(e.worldId)!==f||(i?.(),c.remove(),a.get(e.worldId)===c&&a.delete(e.worldId),h||p))return;const v=fe(w);P.error(`[design-time-layers] world "${e.worldId}" (${e.kind}) failed to mount: ${v}`,"authoring");const ne={id:e.worldId,kind:e.kind,entryOrScenePath:e.path,zOrder:e.zOrder,pausable:e.pausable};u?.(e.worldId,null),j(r,e.worldId)&&r.replaceChild(e.worldId,new S(t,ne,v)),pe({worldId:e.worldId,kind:e.kind,identity:l.identity,message:v}),t.notifyIngestEdit()});E.set(e.worldId,$),$.then(()=>{E.get(e.worldId)===$&&E.delete(e.worldId)})}y.forEach((e,o)=>{M(e,o)});function K(e,o){const i=m.get(e.worldId);m.delete(e.worldId);const l=a.get(e.worldId);a.delete(e.worldId),M(e,o,()=>{const c=a.get(e.worldId);if(c&&(c.style.visibility=""),i)try{i()}catch(B){P.error(`[design-time-layers] re-projection dispose failed: ${B}`,"authoring")}l?.remove()});const f=a.get(e.worldId);f&&f!==l&&(f.style.visibility="hidden")}function Q(e,o){const i=m.get(e.worldId);if(m.delete(e.worldId),i)try{i()}catch(f){P.error(`[design-time-layers] remount dispose failed: ${f}`,"authoring")}const l=a.get(e.worldId);l&&(l.remove(),a.delete(e.worldId)),M(e,o)}const g=new Map;function F(){for(const[e,o]of g)I(e.kind)!==e&&(o(),g.delete(e));for(const e of ge()){if(g.has(e)||I(e.kind)!==e||!y.some(l=>l.kind===e.kind))continue;const o=[],i=l=>()=>{h||p||t.playState!=="stopped"||y.forEach((f,c)=>{f.kind===e.kind&&l(f,c)})};e.remountWhen&&o.push(e.remountWhen(i(Q))),e.reprojectWhen&&o.push(e.reprojectWhen(i(K))),g.set(e,()=>{for(const l of o)l()})}}F();const U=me(()=>{h||p||t.playState!=="stopped"||(y.forEach((e,o)=>{R.has(e.worldId)&&I(e.kind)&&(T.delete(e.worldId),q(e.worldId),M(e,o))}),F())}),_=()=>{if(h||p)return;let e=!1;for(const o of y){if(!R.has(o.worldId)||T.has(o.worldId)||I(o.kind)||(T.add(o.worldId),!j(r,o.worldId)))continue;const i={id:o.worldId,kind:o.kind,entryOrScenePath:o.path,zOrder:o.zOrder,pausable:o.pausable};r.replaceChild(o.worldId,new S(t,i,`No package in this editor registered a design-time mount for a "${o.kind}" world, so there is nothing here to author it with.`)),e=!0}e&&t.notifyIngestEdit()},ee=de(_);le()&&_();const oe=ue(()=>{for(const e of a.values())D(e)}),te=be(()=>{for(const e of a.values())D(e)}),re=t.subscribe(()=>{if(!p&&t.playState!=="stopped"){p=!0,J();return}if(p&&!W&&t.playState==="stopped"&&!h){W=!0,h||N();return}if(!p)for(const[e,o]of a)Z(o,e,x.get(e)?.kind??"dom")});return()=>{h=!0;for(const e of g.values())e();g.clear(),U(),ee(),re(),oe(),te(),A()}}export{Ve as a,xe as d,Ae as m,We as p,De as r};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/design-time-canvas-mount-9GhEUOXN.js","assets/index-C_gLrIvk.js","assets/index-nmcBqr7Y.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-D_NuPfjr.js","assets/jsx-runtime-DPjLkJKQ.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/index-CPiRKiDC.css","assets/three-state-CR9QYeCl.js","assets/editor-shell-store-C9QYXDRr.js","assets/output-pass-HurwNl0G.js","assets/three.module-BLhyNg0e.js","assets/three.core-3arARmh6.js","assets/Pass-D1MRT672.js","assets/editor-layers-TtgYYi_s.js","assets/workspace-arrangement-BTINexHg.js","assets/user-data-BS92dOsI.js","assets/entity-object-CTha2dPd.js","assets/three-contract-Dkt6PmWY.js"])))=>i.map(i=>d[i]);
2
- import{_ as n}from"./index-C_gLrIvk.js";import{r as a}from"./design-time-mount-registry-DUpXCg1U.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";const g="workspace.service";function y(){return a({kind:"canvas",owner:"@volter/editor-game/canvas/design-time-mount",identity:"default-pixi",alwaysInteractive:!0,mount:async(r,e,t)=>{const{mountCanvasDesignTimeLayer:i}=await n(async()=>{const{mountCanvasDesignTimeLayer:o}=await import("./design-time-canvas-mount-9GhEUOXN.js");return{mountCanvasDesignTimeLayer:o}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]));return i(r,e,t)},remountWhen:r=>{let e=!1,t=null;return n(()=>import("./design-time-canvas-mount-9GhEUOXN.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])).then(i=>{e||(t=i.remountWhenSourceIsWritten(r))}),()=>{e=!0,t?.(),t=null}}})}export{g as point,y as start};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/design-time-canvas-mount-BNJucWC9.js","assets/index-C5cL2IUJ.js","assets/index-nmcBqr7Y.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-D_NuPfjr.js","assets/jsx-runtime-DPjLkJKQ.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/index-CPiRKiDC.css","assets/three-state-CouynZOV.js","assets/editor-shell-store-B87W2cjm.js","assets/output-pass-HurwNl0G.js","assets/three.module-BLhyNg0e.js","assets/three.core-3arARmh6.js","assets/Pass-D1MRT672.js","assets/editor-layers-DJwy9H_k.js","assets/workspace-arrangement-Bx5PVUVK.js","assets/user-data-BYUf0wLn.js","assets/entity-object-BpsV3ox5.js","assets/three-contract-Dkt6PmWY.js"])))=>i.map(i=>d[i]);
2
+ import{_ as n}from"./index-C5cL2IUJ.js";import{r as a}from"./design-time-mount-registry-DUpXCg1U.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";const g="workspace.service";function y(){return a({kind:"canvas",owner:"@volter/editor-game/canvas/design-time-mount",identity:"default-pixi",alwaysInteractive:!0,mount:async(r,e,t)=>{const{mountCanvasDesignTimeLayer:i}=await n(async()=>{const{mountCanvasDesignTimeLayer:o}=await import("./design-time-canvas-mount-BNJucWC9.js");return{mountCanvasDesignTimeLayer:o}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]));return i(r,e,t)},remountWhen:r=>{let e=!1,t=null;return n(()=>import("./design-time-canvas-mount-BNJucWC9.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])).then(i=>{e||(t=i.remountWhenSourceIsWritten(r))}),()=>{e=!0,t?.(),t=null}}})}export{g as point,y as start};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/design-time-react-mount-Dh-IMbR8.js","assets/design-time-layers-BtxJATJe.js","assets/root-stacking-BEd9ZvxC.js","assets/index-C_gLrIvk.js","assets/index-nmcBqr7Y.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-D_NuPfjr.js","assets/jsx-runtime-DPjLkJKQ.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/index-CPiRKiDC.css","assets/edit-mode-authoring-8eqT4Ah6.js","assets/design-time-mount-registry-DUpXCg1U.js","assets/react-story-board-B9_ZSGGT.js","assets/game-surface-defaults-D8S4cRxi.js","assets/crash-null-boundary-v3a0uEgw.js","assets/realm-services-CyH5yTHN.js","assets/canvas-entry-runtime-BLPKpqpp.js","assets/debug-registry-B0UtXvgn.js","assets/three-ingest-runtime-B09tYa9n.js","assets/three.module-BLhyNg0e.js","assets/three.core-3arARmh6.js","assets/EffectComposer-BEAt0PtQ.js","assets/CopyShader-BzTUYzf6.js","assets/ShaderPass-DTnDQXm0.js","assets/Pass-D1MRT672.js","assets/CSS3DRenderer-BsAqfavI.js","assets/react-root-BHA-cdrW.js","assets/StoryPreviewMount-BFTHe553.js","assets/story-presentation-DJtDDykU.js","assets/three-story-model-sxgG2OGG.js","assets/inspect-DybkUNPY.js","assets/inference-diagnostics-CSTitz6Y.js","assets/react-world-authoring-adapter-C9fTSu6u.js","assets/board-guides-B_1dNBxX.js","assets/relative-import-specifier-Dg5O2O1R.js","assets/story-arg-descriptors-Ek86ExX7.js","assets/writer-tw6EcuVO.js"])))=>i.map(i=>d[i]);
2
- import{_ as i}from"./index-C_gLrIvk.js";import{r as m}from"./design-time-mount-registry-DUpXCg1U.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";const v="workspace.service";function y(){return m({kind:"dom",owner:"@volter/editor-game/react/design-time-mount",identity:"default-react",mount:async(r,e,t)=>{const{mountReactDesignLayer:o}=await i(async()=>{const{mountReactDesignLayer:n}=await import("./design-time-react-mount-Dh-IMbR8.js");return{mountReactDesignLayer:n}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39]));return o(r,e,t)},reprojectWhen:r=>{let e=!1,t=null;return i(()=>import("./design-time-react-mount-Dh-IMbR8.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39])).then(o=>{e||(t=o.reprojectWhenStoriesRepublish(r))}),()=>{e=!0,t?.(),t=null}}})}export{v as point,y as start};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/design-time-react-mount-BfdKL8vZ.js","assets/design-time-layers-DSk4tElq.js","assets/root-stacking-BEd9ZvxC.js","assets/index-C5cL2IUJ.js","assets/index-nmcBqr7Y.js","assets/_commonjsHelpers-D6-XlEtG.js","assets/index-D_NuPfjr.js","assets/jsx-runtime-DPjLkJKQ.js","assets/index-CtzuWnCS.js","assets/index-CinJrH5C.js","assets/index-FUuS4qwW.js","assets/client-DNXj_opT.js","assets/index-CPiRKiDC.css","assets/edit-mode-authoring-Ch6v9PnO.js","assets/design-time-mount-registry-DUpXCg1U.js","assets/react-story-board-D2pwwUUp.js","assets/game-surface-defaults-D8S4cRxi.js","assets/crash-null-boundary-v3a0uEgw.js","assets/realm-services-CqGTAk9D.js","assets/canvas-entry-runtime-D4UUWHHS.js","assets/debug-registry-DZXSvvn0.js","assets/three-ingest-runtime-C2ruwAa_.js","assets/three.module-BLhyNg0e.js","assets/three.core-3arARmh6.js","assets/EffectComposer-BEAt0PtQ.js","assets/CopyShader-BzTUYzf6.js","assets/ShaderPass-DTnDQXm0.js","assets/Pass-D1MRT672.js","assets/CSS3DRenderer-BsAqfavI.js","assets/react-root-BHA-cdrW.js","assets/StoryPreviewMount-DvSkOR4Z.js","assets/story-presentation-fpxUtjMs.js","assets/three-story-model-DrH7Vzo5.js","assets/inspect-Czr75mkK.js","assets/inference-diagnostics-BI3pXsTw.js","assets/react-world-authoring-adapter-CJSmvs_1.js","assets/board-guides-DLC77TC2.js","assets/relative-import-specifier-OJ1nkBV9.js","assets/story-arg-descriptors-Ek86ExX7.js","assets/writer-tw6EcuVO.js"])))=>i.map(i=>d[i]);
2
+ import{_ as i}from"./index-C5cL2IUJ.js";import{r as m}from"./design-time-mount-registry-DUpXCg1U.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";const v="workspace.service";function y(){return m({kind:"dom",owner:"@volter/editor-game/react/design-time-mount",identity:"default-react",mount:async(r,e,t)=>{const{mountReactDesignLayer:o}=await i(async()=>{const{mountReactDesignLayer:n}=await import("./design-time-react-mount-BfdKL8vZ.js");return{mountReactDesignLayer:n}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39]));return o(r,e,t)},reprojectWhen:r=>{let e=!1,t=null;return i(()=>import("./design-time-react-mount-BfdKL8vZ.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39])).then(o=>{e||(t=o.reprojectWhenStoriesRepublish(r))}),()=>{e=!0,t?.(),t=null}}})}export{v as point,y as start};
@@ -1 +1 @@
1
- import{r as it,a as at}from"./design-time-layers-BtxJATJe.js";import{fb as st,ba as lt,gb as ut,gc as dt,Z as E,gd as mt,ge as Y,bY as q,dI as U,as as ct,eL as z,at as $,dw as pt,cP as ft,gf as H}from"./index-C_gLrIvk.js";import{h as ht,d as gt,g as bt}from"./react-story-board-B9_ZSGGT.js";import{C as wt}from"./crash-null-boundary-v3a0uEgw.js";import{r as yt,a as St}from"./realm-services-CyH5yTHN.js";import{r as It}from"./react-root-BHA-cdrW.js";import{m as Pt}from"./StoryPreviewMount-BFTHe553.js";import{c as Rt,s as vt}from"./story-presentation-DJtDDykU.js";import{d as Mt}from"./three-story-model-sxgG2OGG.js";import{c as Ct}from"./inspect-DybkUNPY.js";import{R as J}from"./react-world-authoring-adapter-C9fTSu6u.js";import"./root-stacking-BEd9ZvxC.js";import"./edit-mode-authoring-8eqT4Ah6.js";import"./design-time-mount-registry-DUpXCg1U.js";import"./game-surface-defaults-D8S4cRxi.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./canvas-entry-runtime-BLPKpqpp.js";import"./debug-registry-B0UtXvgn.js";import"./three-ingest-runtime-B09tYa9n.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./EffectComposer-BEAt0PtQ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-DTnDQXm0.js";import"./Pass-D1MRT672.js";import"./CSS3DRenderer-BsAqfavI.js";import"./inference-diagnostics-CSTitz6Y.js";import"./board-guides-B_1dNBxX.js";import"./relative-import-specifier-Dg5O2O1R.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./writer-tw6EcuVO.js";function Et(e){const o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="svg"||o==="SVG"||o==="PICTURE")return!0;const r=getComputedStyle(e);if(r.visibility==="hidden"||r.display==="none")return!1;if(xt(r.backgroundColor)||r.backgroundImage&&r.backgroundImage!=="none"||r.boxShadow&&r.boxShadow!=="none"||r.borderStyle!=="none"&&r.borderStyle!==""&&(parseFloat(r.borderTopWidth)>0||parseFloat(r.borderRightWidth)>0||parseFloat(r.borderBottomWidth)>0||parseFloat(r.borderLeftWidth)>0))return!0;for(const n of e.childNodes)if(n.nodeType===Node.TEXT_NODE&&(n.textContent??"").trim()!=="")return!0;return!1}function xt(e){if(!e||e==="transparent")return!1;const o=/^rgba\(\s*[\d.]+\s*,\s*[\d.]+\s*,\s*[\d.]+\s*,\s*([\d.]+)\s*\)$/.exec(e);return o?parseFloat(o[1])>0:!0}function Nt(e,o=r=>r.getBoundingClientRect()){const r=o(e),n=e.offsetWidth;if(r.width<=0||n<=0)return null;const s=r.width/n;let d=Number.POSITIVE_INFINITY,c=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,y=Number.NEGATIVE_INFINITY;for(const p of e.querySelectorAll("*")){if(!Et(p))continue;const m=o(p);m.width<=0||m.height<=0||(d=Math.min(d,(m.left-r.left)/s),c=Math.min(c,(m.top-r.top)/s),i=Math.max(i,(m.right-r.left)/s),y=Math.max(y,(m.bottom-r.top)/s))}return i<=d||y<=c?null:{x:d,y:c,width:i-d,height:y-c}}let x=!1;function kt(e,o){if(!e)return;H({adapter:e,seam:"editor.stories.apply",stage:"effect",detail:`the design board applied portable story ${o}`,run:()=>e.stories.apply(o,o)});const r=e.selection;r&&H({adapter:e,seam:"editor.selection.set",stage:"effect",detail:`the design board selected portable story ${o}`,run:()=>r.set([o])})}let X=!1;async function Ft(){if(X)return;X=!0;const e=bt();if(!(e.width!==null||e.height!==null))try{const o=await ft("volter.project.json");if(!o)return;const r=JSON.parse(o),n=r.resolution?.width,s=r.resolution?.height;if(typeof n!="number"||typeof s!="number"||n<64||s<64||n>4096||s>4096)return;gt(n,s)}catch{}}function Tt(e,o){return{id:e,surface:"dom",description:void 0,adapter:{type:"builtin",identity:"dom",surface:"dom"},entry:o,zOrder:0,pausable:!0,loop:"gated"}}async function At(e,o){try{const r=await St(o,pt());return{ok:!0,Entry:await It(e,r)}}catch(r){return{ok:!1,error:r}}}async function we(e,o,r){const{projectRootPath:n,store:s,activationDocumentId:d}=r;x?x=!1:await st({rootPath:n});const c=lt(),i=Mt(c),y=e.path,p=y?await At(Tt(e.worldId,y),n):{ok:!1,error:new Error(`design-time react layer "${e.worldId}": no \`entry\` declared — nothing to mount.`)},m=p.ok?ut(p.Entry):void 0,K=m?dt(m,e.path):null,j=i.find(g=>g.id===K?.id)??null;if(i.length>0){const g=it(n,e.worldId),P=i.find(t=>t.id===g)??j??i[0];e.path&&!j&&E.warn(`[design-time-layers] React root "${e.worldId}" has no story naming its entry component${m?` "${m}"`:""} — the board opens on "${P.label}". Give a *.stories.tsx a \`meta.component\` of this root's entry component to choose its default preview.`,"authoring");let k=!1,M=null,F=null;const T=new Map,D=Rt(i);await Ft();const l=ht(o,i.map(t=>({id:t.id,label:t.label,modulePath:t.modulePath,...t.title?{title:t.title}:{},parameters:t.parameters,...t.globals?{globals:t.globals}:{},...t.viewportLocked!==void 0?{viewportLocked:t.viewportLocked}:{}})),P.id,(t,u)=>{F=u,kt(M,t)},vt(i,D)),_=t=>{if(k)return;const u=l.frames.get(t.id);if(!u)return;if(t.parameters?.layout==="fullscreen"){l.setMeasuredFrame(t.id,null);return}const a={width:u.content.offsetWidth,height:u.content.offsetHeight},h=a.width>0?Nt(u.content):null;if(!h){l.setMeasuredFrame(t.id,null);return}const C=8,S=48;let b=Math.max(0,h.x-C),w=Math.max(0,h.y-C),R=Math.min(a.width,h.x+h.width+C),v=Math.min(a.height,h.y+h.height+C);if(R-b<S){const A=(S-(R-b))/2;b=Math.max(0,b-A),R=Math.min(a.width,b+S)}if(v-w<S){const A=(S-(v-w))/2;w=Math.max(0,w-A),v=Math.min(a.height,w+S)}if(R-b>=a.width*.9&&v-w>=a.height*.9){l.setMeasuredFrame(t.id,null);return}l.setMeasuredFrame(t.id,{frame:{width:Math.round(R-b),height:Math.round(v-w)},mount:a,offset:{x:Math.round(b),y:Math.round(w)}})},rt=t=>{setTimeout(()=>_(t),0),setTimeout(()=>_(t),1e3)},G=async(t,u=t.args)=>{const f=l.frames.get(t.id)?.content;if(f){try{const a=await Pt(f,t.modulePath,t.name,t.Component,u);if(!a)return;if(k){a.unmount();return}T.set(t.id,a),l.clearError(t.id),rt(t)}catch(a){const h=q(a);l.setError(t.id,h),E.error(`[design-time-layers] React root "${e.worldId}" failed mounting portable story "${t.name}": ${h}`,"authoring")}s.notifyIngestEdit()}};await Promise.all(i.map(t=>G(t))),l.setNote(mt().note),g&&l.activate(P.id,!0);const L=new Map(i.map(t=>[t.id,t])),nt={tagName:"DIV",get children(){return l.activeContent().children},getAttribute:t=>o.getAttribute(t),getBoundingClientRect:()=>o.getBoundingClientRect(),get style(){return o.style},get textContent(){return l.activeContent().textContent}},O=await Y();return M=new J(nt,s,{...O?{writeBackend:O}:{},designTokens:()=>{const t=l.activeContent(),u=t.closest?.("[data-volter-game-styles]")??t.querySelector?.("[data-volter-game-styles]")??t;return Ct(getComputedStyle(u))},assetRoot:o,portableStories:i.map(t=>({id:t.id,label:t.label,args:t.args,name:t.name,modulePath:t.modulePath})),portableHierarchy:D,activePortableStoryId:P.id,onPortableStoryApplied:t=>{const u=(t?L.get(t):null)??P;at(n,e.worldId,u.id);const f=F;F=null,l.activate(u.id,f===null||f==="zoom")},onPortableStoryArgsChanged:(t,u)=>{const f=L.get(t);f&&G(f,u).catch(a=>{E.error(`[design-time-layers] React root "${e.worldId}" failed updating portable story "${f.name}" args: ${q(a)}`,"authoring")})}}),d&&requestAnimationFrame(()=>U(d)),{adapter:M,dispose:()=>{k=!0,M.disposeReactRootAdapter();for(const t of T.values())t.unmount();T.clear(),l.dispose()}}}if(!p.ok)throw p.error instanceof Error?p.error:new Error(String(p.error));E.warn(`[design-time-layers] React root "${e.worldId}" has no portable CSF preview — the project declares no UI stories. Add a *.stories.tsx; give it a \`meta.component\` of this root's entry component${m?` (${m}, ${e.path})`:""} to make it this root’s default preview. Falling back to rendering the entry bare.`,"authoring");const Q=p.Entry,{createElement:B,createRoot:tt,flushSync:et}=await yt(),N=tt(o),ot=g=>{N.render(B(wt,{key:"__entry__",onCaught:g,children:B(Q)}))};let I=null;if(et(()=>{ot(g=>{I=g})}),I!==null)throw N.unmount(),I instanceof Error?I:new Error(String(I));const V=await Y(),W=new J(o,s,{...V?{writeBackend:V}:{}});return d&&requestAnimationFrame(()=>U(d)),{adapter:W,dispose:()=>{W.disposeReactRootAdapter(),N.unmount()}}}function Z(){return $().map(e=>e.ok?e.stories.map(o=>o.id).join(","):`!${e.modulePath}`).join("|")}function ye(e){let o=z()?$():null,r=o===null?null:Z(),n=null;const s=ct(()=>{if(!z())return;const d=$(),c=Z();if(o===null){o=d,r=c;return}const i=c!==r;o=d,r=c,i&&(n!==null&&clearTimeout(n),n=setTimeout(()=>{n=null,x=!0,e(),setTimeout(()=>{x=!1},0)},250))});return()=>{n!==null&&clearTimeout(n),n=null,s()}}export{we as mountReactDesignLayer,ye as reprojectWhenStoriesRepublish};
1
+ import{r as it,a as at}from"./design-time-layers-DSk4tElq.js";import{fb as st,ba as lt,gb as ut,gc as dt,Z as E,gd as mt,ge as Y,bY as q,dI as U,as as ct,eL as z,at as $,dw as pt,cP as ft,gf as H}from"./index-C5cL2IUJ.js";import{h as ht,d as gt,g as bt}from"./react-story-board-D2pwwUUp.js";import{C as wt}from"./crash-null-boundary-v3a0uEgw.js";import{r as yt,a as St}from"./realm-services-CqGTAk9D.js";import{r as It}from"./react-root-BHA-cdrW.js";import{m as Pt}from"./StoryPreviewMount-DvSkOR4Z.js";import{c as Rt,s as vt}from"./story-presentation-fpxUtjMs.js";import{d as Mt}from"./three-story-model-DrH7Vzo5.js";import{c as Ct}from"./inspect-Czr75mkK.js";import{R as J}from"./react-world-authoring-adapter-CJSmvs_1.js";import"./root-stacking-BEd9ZvxC.js";import"./edit-mode-authoring-Ch6v9PnO.js";import"./design-time-mount-registry-DUpXCg1U.js";import"./game-surface-defaults-D8S4cRxi.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./canvas-entry-runtime-D4UUWHHS.js";import"./debug-registry-DZXSvvn0.js";import"./three-ingest-runtime-C2ruwAa_.js";import"./three.module-BLhyNg0e.js";import"./three.core-3arARmh6.js";import"./EffectComposer-BEAt0PtQ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-DTnDQXm0.js";import"./Pass-D1MRT672.js";import"./CSS3DRenderer-BsAqfavI.js";import"./inference-diagnostics-BI3pXsTw.js";import"./board-guides-DLC77TC2.js";import"./relative-import-specifier-OJ1nkBV9.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./writer-tw6EcuVO.js";function Et(e){const o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="svg"||o==="SVG"||o==="PICTURE")return!0;const r=getComputedStyle(e);if(r.visibility==="hidden"||r.display==="none")return!1;if(xt(r.backgroundColor)||r.backgroundImage&&r.backgroundImage!=="none"||r.boxShadow&&r.boxShadow!=="none"||r.borderStyle!=="none"&&r.borderStyle!==""&&(parseFloat(r.borderTopWidth)>0||parseFloat(r.borderRightWidth)>0||parseFloat(r.borderBottomWidth)>0||parseFloat(r.borderLeftWidth)>0))return!0;for(const n of e.childNodes)if(n.nodeType===Node.TEXT_NODE&&(n.textContent??"").trim()!=="")return!0;return!1}function xt(e){if(!e||e==="transparent")return!1;const o=/^rgba\(\s*[\d.]+\s*,\s*[\d.]+\s*,\s*[\d.]+\s*,\s*([\d.]+)\s*\)$/.exec(e);return o?parseFloat(o[1])>0:!0}function Nt(e,o=r=>r.getBoundingClientRect()){const r=o(e),n=e.offsetWidth;if(r.width<=0||n<=0)return null;const s=r.width/n;let d=Number.POSITIVE_INFINITY,c=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,y=Number.NEGATIVE_INFINITY;for(const p of e.querySelectorAll("*")){if(!Et(p))continue;const m=o(p);m.width<=0||m.height<=0||(d=Math.min(d,(m.left-r.left)/s),c=Math.min(c,(m.top-r.top)/s),i=Math.max(i,(m.right-r.left)/s),y=Math.max(y,(m.bottom-r.top)/s))}return i<=d||y<=c?null:{x:d,y:c,width:i-d,height:y-c}}let x=!1;function kt(e,o){if(!e)return;H({adapter:e,seam:"editor.stories.apply",stage:"effect",detail:`the design board applied portable story ${o}`,run:()=>e.stories.apply(o,o)});const r=e.selection;r&&H({adapter:e,seam:"editor.selection.set",stage:"effect",detail:`the design board selected portable story ${o}`,run:()=>r.set([o])})}let X=!1;async function Ft(){if(X)return;X=!0;const e=bt();if(!(e.width!==null||e.height!==null))try{const o=await ft("volter.project.json");if(!o)return;const r=JSON.parse(o),n=r.resolution?.width,s=r.resolution?.height;if(typeof n!="number"||typeof s!="number"||n<64||s<64||n>4096||s>4096)return;gt(n,s)}catch{}}function Tt(e,o){return{id:e,surface:"dom",description:void 0,adapter:{type:"builtin",identity:"dom",surface:"dom"},entry:o,zOrder:0,pausable:!0,loop:"gated"}}async function At(e,o){try{const r=await St(o,pt());return{ok:!0,Entry:await It(e,r)}}catch(r){return{ok:!1,error:r}}}async function we(e,o,r){const{projectRootPath:n,store:s,activationDocumentId:d}=r;x?x=!1:await st({rootPath:n});const c=lt(),i=Mt(c),y=e.path,p=y?await At(Tt(e.worldId,y),n):{ok:!1,error:new Error(`design-time react layer "${e.worldId}": no \`entry\` declared — nothing to mount.`)},m=p.ok?ut(p.Entry):void 0,K=m?dt(m,e.path):null,j=i.find(g=>g.id===K?.id)??null;if(i.length>0){const g=it(n,e.worldId),P=i.find(t=>t.id===g)??j??i[0];e.path&&!j&&E.warn(`[design-time-layers] React root "${e.worldId}" has no story naming its entry component${m?` "${m}"`:""} — the board opens on "${P.label}". Give a *.stories.tsx a \`meta.component\` of this root's entry component to choose its default preview.`,"authoring");let k=!1,M=null,F=null;const T=new Map,D=Rt(i);await Ft();const l=ht(o,i.map(t=>({id:t.id,label:t.label,modulePath:t.modulePath,...t.title?{title:t.title}:{},parameters:t.parameters,...t.globals?{globals:t.globals}:{},...t.viewportLocked!==void 0?{viewportLocked:t.viewportLocked}:{}})),P.id,(t,u)=>{F=u,kt(M,t)},vt(i,D)),_=t=>{if(k)return;const u=l.frames.get(t.id);if(!u)return;if(t.parameters?.layout==="fullscreen"){l.setMeasuredFrame(t.id,null);return}const a={width:u.content.offsetWidth,height:u.content.offsetHeight},h=a.width>0?Nt(u.content):null;if(!h){l.setMeasuredFrame(t.id,null);return}const C=8,S=48;let b=Math.max(0,h.x-C),w=Math.max(0,h.y-C),R=Math.min(a.width,h.x+h.width+C),v=Math.min(a.height,h.y+h.height+C);if(R-b<S){const A=(S-(R-b))/2;b=Math.max(0,b-A),R=Math.min(a.width,b+S)}if(v-w<S){const A=(S-(v-w))/2;w=Math.max(0,w-A),v=Math.min(a.height,w+S)}if(R-b>=a.width*.9&&v-w>=a.height*.9){l.setMeasuredFrame(t.id,null);return}l.setMeasuredFrame(t.id,{frame:{width:Math.round(R-b),height:Math.round(v-w)},mount:a,offset:{x:Math.round(b),y:Math.round(w)}})},rt=t=>{setTimeout(()=>_(t),0),setTimeout(()=>_(t),1e3)},G=async(t,u=t.args)=>{const f=l.frames.get(t.id)?.content;if(f){try{const a=await Pt(f,t.modulePath,t.name,t.Component,u);if(!a)return;if(k){a.unmount();return}T.set(t.id,a),l.clearError(t.id),rt(t)}catch(a){const h=q(a);l.setError(t.id,h),E.error(`[design-time-layers] React root "${e.worldId}" failed mounting portable story "${t.name}": ${h}`,"authoring")}s.notifyIngestEdit()}};await Promise.all(i.map(t=>G(t))),l.setNote(mt().note),g&&l.activate(P.id,!0);const L=new Map(i.map(t=>[t.id,t])),nt={tagName:"DIV",get children(){return l.activeContent().children},getAttribute:t=>o.getAttribute(t),getBoundingClientRect:()=>o.getBoundingClientRect(),get style(){return o.style},get textContent(){return l.activeContent().textContent}},O=await Y();return M=new J(nt,s,{...O?{writeBackend:O}:{},designTokens:()=>{const t=l.activeContent(),u=t.closest?.("[data-volter-game-styles]")??t.querySelector?.("[data-volter-game-styles]")??t;return Ct(getComputedStyle(u))},assetRoot:o,portableStories:i.map(t=>({id:t.id,label:t.label,args:t.args,name:t.name,modulePath:t.modulePath})),portableHierarchy:D,activePortableStoryId:P.id,onPortableStoryApplied:t=>{const u=(t?L.get(t):null)??P;at(n,e.worldId,u.id);const f=F;F=null,l.activate(u.id,f===null||f==="zoom")},onPortableStoryArgsChanged:(t,u)=>{const f=L.get(t);f&&G(f,u).catch(a=>{E.error(`[design-time-layers] React root "${e.worldId}" failed updating portable story "${f.name}" args: ${q(a)}`,"authoring")})}}),d&&requestAnimationFrame(()=>U(d)),{adapter:M,dispose:()=>{k=!0,M.disposeReactRootAdapter();for(const t of T.values())t.unmount();T.clear(),l.dispose()}}}if(!p.ok)throw p.error instanceof Error?p.error:new Error(String(p.error));E.warn(`[design-time-layers] React root "${e.worldId}" has no portable CSF preview — the project declares no UI stories. Add a *.stories.tsx; give it a \`meta.component\` of this root's entry component${m?` (${m}, ${e.path})`:""} to make it this root’s default preview. Falling back to rendering the entry bare.`,"authoring");const Q=p.Entry,{createElement:B,createRoot:tt,flushSync:et}=await yt(),N=tt(o),ot=g=>{N.render(B(wt,{key:"__entry__",onCaught:g,children:B(Q)}))};let I=null;if(et(()=>{ot(g=>{I=g})}),I!==null)throw N.unmount(),I instanceof Error?I:new Error(String(I));const V=await Y(),W=new J(o,s,{...V?{writeBackend:V}:{}});return d&&requestAnimationFrame(()=>U(d)),{adapter:W,dispose:()=>{W.disposeReactRootAdapter(),N.unmount()}}}function Z(){return $().map(e=>e.ok?e.stories.map(o=>o.id).join(","):`!${e.modulePath}`).join("|")}function ye(e){let o=z()?$():null,r=o===null?null:Z(),n=null;const s=ct(()=>{if(!z())return;const d=$(),c=Z();if(o===null){o=d,r=c;return}const i=c!==r;o=d,r=c,i&&(n!==null&&clearTimeout(n),n=setTimeout(()=>{n=null,x=!0,e(),setTimeout(()=>{x=!1},0)},250))});return()=>{n!==null&&clearTimeout(n),n=null,s()}}export{we as mountReactDesignLayer,ye as reprojectWhenStoriesRepublish};
@@ -1 +1 @@
1
- import{c as g}from"./content-bounds-C6Nb8vJK.js";import{isEditorOwnedObject as u}from"./editor-layers-TtgYYi_s.js";import{m as x}from"./renderer-ownership-BovSEcLv.js";import{W as w}from"./three.module-BLhyNg0e.js";import{f as C}from"./scene-framing-DeMlXIgX.js";import{ej as y,A as M,d9 as d,fo as s,ex as v,cj as S}from"./three.core-3arARmh6.js";import"./hierarchy-marks-DMWVKCJa.js";import"./workspace-arrangement-BTINexHg.js";import"./index-C_gLrIvk.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";function W(n){const e=[];return n.traverse(a=>{!u(a)&&a.isCamera&&e.push(a)}),e}function R(n,e){const a=[];n.traverse(r=>{r.parent&&u(r)&&a.push({object:r,parent:r.parent})});for(const{object:r}of a)r.removeFromParent();let t;try{t=g(n)}finally{for(const{object:r,parent:h}of a)h.add(r)}const o=t.filter(r=>!r.overlay&&!r.enclosure),c=C(o.map(r=>r.box)),i=new d(42,e,.01,1e5),f=c.isEmpty()?new s:c.getCenter(new s),m=c.isEmpty()?1:Math.max(.01,c.getBoundingSphere(new v).radius),p=m/Math.sin(S.degToRad(i.fov/2));return i.position.copy(f).addScaledVector(new s(1,.75,1).normalize(),p*1.15),i.lookAt(f),i.near=Math.max(.001,p-m*2.5),i.far=p+m*3,i.updateProjectionMatrix(),i.updateMatrixWorld(!0),i}function P(n,e){if(e.camera){const t=new d(e.camera.fov??42,e.width/e.height,.01,1e5);return t.position.set(e.camera.position.x,e.camera.position.y,e.camera.position.z),t.lookAt(e.camera.target.x,e.camera.target.y,e.camera.target.z),t.updateMatrixWorld(!0),t}const a=W(n);if(a.length===1){const t=a[0].clone();return t.matrixWorld.copy(a[0].matrixWorld),t.matrixWorld.decompose(t.position,t.quaternion,t.scale),t instanceof d&&(t.aspect=e.width/e.height,t.updateProjectionMatrix()),t}return R(n,e.width/e.height)}function I(n,e,a,t){e.updateMatrixWorld(!0);const l=P(n,a),o=x(new w({antialias:!0,alpha:!0,preserveDrawingBuffer:!0}));let c;try{return c=t?.(o),o.setPixelRatio(1),o.setSize(a.width,a.height,!1),o.outputColorSpace=y,o.toneMapping=M,o.setClearColor(2106411,e.background===null?0:1),o.render(e,l),o.domElement.toDataURL("image/png")}finally{c?.(),o.dispose(),o.forceContextLoss()}}export{I as captureAuthoredThreeScenePreview};
1
+ import{c as g}from"./content-bounds-DzkikRBl.js";import{isEditorOwnedObject as u}from"./editor-layers-DJwy9H_k.js";import{m as x}from"./renderer-ownership-BovSEcLv.js";import{W as w}from"./three.module-BLhyNg0e.js";import{f as C}from"./scene-framing-Visz22um.js";import{ej as y,A as M,d9 as d,fo as s,ex as v,cj as S}from"./three.core-3arARmh6.js";import"./hierarchy-marks-D1HxcOXp.js";import"./workspace-arrangement-Bx5PVUVK.js";import"./index-C5cL2IUJ.js";import"./index-nmcBqr7Y.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./jsx-runtime-DPjLkJKQ.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";function W(n){const e=[];return n.traverse(a=>{!u(a)&&a.isCamera&&e.push(a)}),e}function R(n,e){const a=[];n.traverse(r=>{r.parent&&u(r)&&a.push({object:r,parent:r.parent})});for(const{object:r}of a)r.removeFromParent();let t;try{t=g(n)}finally{for(const{object:r,parent:h}of a)h.add(r)}const o=t.filter(r=>!r.overlay&&!r.enclosure),c=C(o.map(r=>r.box)),i=new d(42,e,.01,1e5),f=c.isEmpty()?new s:c.getCenter(new s),m=c.isEmpty()?1:Math.max(.01,c.getBoundingSphere(new v).radius),p=m/Math.sin(S.degToRad(i.fov/2));return i.position.copy(f).addScaledVector(new s(1,.75,1).normalize(),p*1.15),i.lookAt(f),i.near=Math.max(.001,p-m*2.5),i.far=p+m*3,i.updateProjectionMatrix(),i.updateMatrixWorld(!0),i}function P(n,e){if(e.camera){const t=new d(e.camera.fov??42,e.width/e.height,.01,1e5);return t.position.set(e.camera.position.x,e.camera.position.y,e.camera.position.z),t.lookAt(e.camera.target.x,e.camera.target.y,e.camera.target.z),t.updateMatrixWorld(!0),t}const a=W(n);if(a.length===1){const t=a[0].clone();return t.matrixWorld.copy(a[0].matrixWorld),t.matrixWorld.decompose(t.position,t.quaternion,t.scale),t instanceof d&&(t.aspect=e.width/e.height,t.updateProjectionMatrix()),t}return R(n,e.width/e.height)}function I(n,e,a,t){e.updateMatrixWorld(!0);const l=P(n,a),o=x(new w({antialias:!0,alpha:!0,preserveDrawingBuffer:!0}));let c;try{return c=t?.(o),o.setPixelRatio(1),o.setSize(a.width,a.height,!1),o.outputColorSpace=y,o.toneMapping=M,o.setClearColor(2106411,e.background===null?0:1),o.render(e,l),o.domElement.toDataURL("image/png")}finally{c?.(),o.dispose(),o.forceContextLoss()}}export{I as captureAuthoredThreeScenePreview};
@@ -1 +1 @@
1
- import{ax as y,ay as v}from"./index-C_gLrIvk.js";import{J as R,c as x}from"./json-history-resource-BReCXsj2.js";import{D as C,s as w,a as b,c as k,m as T}from"./react-world-authoring-adapter-C9fTSu6u.js";import{g as p,b as u}from"./inspect-DybkUNPY.js";function H(a){const e=(typeof a=="string"?a:a?.baseVal)?.trim()??"";if(e)return e.split(/\s+/)[0]}function S(a,t){if(a.id)return`${t}#${a.id}`;const e=H(a.className??"");return e?`${t}.${e}`:t}function j(a){const t=new Map;for(const[e,s]of a.nodes)t.set(e,{id:e,tag:s.object.tagName.toLowerCase(),el:s.object,parentId:s.parentId,childIds:[...s.childIds]});return{nodes:t,rootIds:[...a.rootIds]}}const g=[{prop:"color",label:"Color",type:"color"},{prop:"backgroundColor",label:"Background",type:"color"},{prop:"borderColor",label:"Border Color",type:"color"},{prop:"fontSize",label:"Font Size",type:"number"},{prop:"width",label:"Width",type:"number"},{prop:"height",label:"Height",type:"number"},{prop:"padding",label:"Padding",type:"number"},{prop:"margin",label:"Margin",type:"number"},{prop:"borderRadius",label:"Border Radius",type:"number"},{prop:"gap",label:"Gap",type:"number"},{prop:"display",label:"Display",type:"enum",options:["flex","block","none","grid"]},{prop:"textAlign",label:"Text Align",type:"enum",options:["left","center","right"]},{prop:"flexDirection",label:"Flex Direction",type:"enum",options:["row","column"]}],f="style.",M=new Map(g.map(({prop:a,type:t})=>[a,t]));class D{constructor(t,e,s){this.root=t,this.store=e;const o=e.shell.projectHistory;this.historyResource=o?new R({history:o,kind:"session-state",scope:"session",subject:{...s.journal,id:`${s.journal.id}/react-dom-edits`},displayName:"React DOM edits",capture:()=>this.captureHistoryState(),restore:async i=>{this.restoreHistoryState(i)}}):null}capabilities={transform:!1,inspectorFields:!0,persist:!1};provenance={source:"foreign",label:"live-only",detail:"Unmodified ingested React game — style edits apply for this session only and are never saved."};doc={};historyResource;projector=new C(w());snapCache=null;snapInvalidationScheduled=!1;boxEditSession=null;lockedIds=new Set;snapshot(){if(this.snapCache)return this.snapCache;this.projector.project(this.root);const t=j(this.projector);return this.snapCache=t,this.snapInvalidationScheduled||(this.snapInvalidationScheduled=!0,queueMicrotask(()=>{this.snapCache=null,this.snapInvalidationScheduled=!1})),t}nodeCount(){return this.snapshot().nodes.size}toEditorNode(t){return{id:t.id,label:S(t.el,t.tag),role:"element",kind:t.tag,parentId:t.parentId,childIds:t.childIds}}applyStyleToElement(t,e,s){t.style&&(t.style[e]=s)}recordStyleEdit(t,e,s){const o=this.doc[t]??{};o[e]=s,this.doc[t]=o}hierarchy={roots:()=>{const{nodes:t,rootIds:e}=this.snapshot();return e.map(s=>this.toEditorNode(t.get(s)))},node:t=>{const e=this.snapshot().nodes.get(t);return e?this.toEditorNode(e):null}};selection={get:()=>[...this.store.shell.selectedEntityIds],set:t=>this.store.shell.selectMultiple(t)};pickable={pick:(t,e)=>{const{nodes:s}=this.snapshot();let o=null,i=Number.POSITIVE_INFINITY,r=-1,l=-1;for(const c of s.values()){if(l++,this.lockedIds.has(c.id)||c.el.style?.pointerEvents==="none")continue;const n=c.el.getBoundingClientRect?.();if(!n||t<n.left||t>n.right||e<n.top||e>n.bottom)continue;const h=n.width*n.height;(h<i||h===i&&l>r)&&(o=c.id,i=h,r=l)}return o}};hostRect(){const t=this.root.getBoundingClientRect?.();return{left:t?.left??0,top:t?.top??0}}toHostRelative(t){const e=this.hostRect();return{x:t.left-e.left,y:t.top-e.top,width:t.width,height:t.height}}rects={rect:t=>{const s=this.snapshot().nodes.get(t)?.el.getBoundingClientRect?.();return s?this.toHostRelative(s):null},contextRects:t=>{const{nodes:e}=this.snapshot(),s=e.get(t);if(!s)return{};const o=s.parentId?e.get(s.parentId):void 0,i=o?.el.getBoundingClientRect?.(),l=(o?o.childIds:this.snapshot().rootIds).filter(d=>d!==t).map(d=>e.get(d)?.el.getBoundingClientRect?.()).filter(d=>d!=null).map(d=>this.toHostRelative(d)),c=s.el,n=c.getBoundingClientRect?.();let h;if(n){const d=y(p(c,"borderTopWidth",u))??0,I=y(p(c,"borderRightWidth",u))??0,E=y(p(c,"borderBottomWidth",u))??0,m=y(p(c,"borderLeftWidth",u))??0;h=this.toHostRelative({left:n.left+m,top:n.top+d,width:Math.max(0,n.width-m-I),height:Math.max(0,n.height-d-E)})}return{...i?{parent:this.toHostRelative(i)}:{},...l.length?{siblings:l}:{},...h?{paddingBox:h}:{}}}};colorSample={backgroundChainAt:(t,e)=>{const s=this.pickable.pick(t,e);if(!s)return null;const{nodes:o}=this.snapshot(),i=[];let r=o.get(s);for(;r;)i.push(p(r.el,"backgroundColor",u)),r=r.parentId?o.get(r.parentId):void 0;return i}};boxEdit={begin:t=>{this.historyResource?.assertCanMutate(),this.boxEditSession={id:t,touched:new Map,priorInline:new Map}},apply:(t,e)=>{this.historyResource?.assertCanMutate();const s=this.boxEditSession;if(!s||s.id!==t)return;const o=this.snapshot().nodes.get(t);if(!o)return;const i=p(o.el,"position",u),r=i==="absolute"||i==="fixed";for(const[l,c]of Object.entries(e)){const n=T(l,r);if(!n){console.warn(`[DomAuthoringAdapter] boxEdit: dropping patch key "${l}" for "${t}" — `+(l==="x"||l==="y"?`node is not absolutely/fixed positioned (computed position: "${i}"), no left/top to move`:"unrecognized box-edit patch key"));continue}if(!s.priorInline.has(n.prop)){const d=b(o.el.style,n.prop);s.priorInline.set(n.prop,d==null?"":String(d))}const h=n.cssValue(c);this.applyStyleToElement(o.el,n.prop,h),s.touched.set(n.prop,h)}},end:t=>{const e=this.boxEditSession;this.boxEditSession=null,!(!e||e.id!==t||e.touched.size===0)&&this.commitBoxEdit(t,e.touched,e.priorInline)}};commitBoxEdit(t,e,s){this.historyResource?.assertCanMutate();const o=this.captureHistoryState(),i=o.styles[t]??{};o.styles[t]=i;for(const[l,c]of s)i[l]=c;let r=!1;for(const[l,c]of e)r=this.writeStyleEntry(t,l,c)||r;r&&this.historyResource&&this.historyResource.record(`Edit ${e.size} Styles`,o,this.captureHistoryState()).catch(()=>{})}inspector={properties:()=>g.map(({prop:t,label:e,type:s,options:o})=>({path:`${f}${t}`,label:e,type:s,...o?{options:o}:{}})),get:(t,e)=>{if(e==="locked")return this.lockedIds.has(t);if(e==="visible"){const l=this.snapshot().nodes.get(t);return l?b(l.el.style,"visibility")!=="hidden":void 0}if(!e.startsWith(f))return;const s=e.slice(f.length),o=this.snapshot().nodes.get(t);if(!o)return;const i=b(o.el.style,s),r=M.get(s);return r==="number"?y(i):r==="color"?k(i):i},set:(t,e,s)=>{if(e==="locked"){s?this.lockedIds.add(t):this.lockedIds.delete(t),this.store.shell.notifyIngestEdit();return}if(e==="visible"){this.writeStyle(t,"visibility",s?"visible":"hidden");return}if(!e.startsWith(f))return;const o=e.slice(f.length);this.writeStyle(t,o,String(s))}};assetSubject={get:t=>this.assetSubjectForNode(this.snapshot(),t),entries:()=>{const t=this.snapshot();return[...t.nodes.keys()].flatMap(e=>{const s=this.assetSubjectForNode(t,e);return s?[{id:e,subject:s}]:[]})}};assetSubjectForNode(t,e){const s=t.nodes.get(e);return!s||s.tag!=="svg"||!s.el.outerHTML?null:{kind:"image",name:S(s.el,s.tag),mediaType:"image/svg+xml",text:s.el.outerHTML}}writeStyleEntry(t,e,s){const o=this.snapshot().nodes.get(t);return o?(this.applyStyleToElement(o.el,e,s),this.recordStyleEdit(t,e,s),this.store.shell.notifyIngestEdit(),!0):!1}writeStyle(t,e,s){this.historyResource?.assertCanMutate();const o=this.captureHistoryState();this.writeStyleEntry(t,e,s)&&this.historyResource&&this.historyResource.record(`Set ${e}`,o,this.captureHistoryState()).catch(()=>{})}dispose(){this.historyResource?.dispose()}captureHistoryState(){const t={};for(const[e,s]of this.snapshot().nodes){const o={};for(const{prop:i}of g){const r=b(s.el.style,i);r!==""&&(o[i]=String(r))}t[e]=o}return{edits:structuredClone(this.doc),styles:t}}restoreHistoryState(t){for(const s of Object.keys(this.doc))delete this.doc[s];Object.assign(this.doc,structuredClone(t.edits));const{nodes:e}=this.snapshot();for(const[s,o]of e){const i=t.styles[s]??{};for(const{prop:r}of g)this.applyStyleToElement(o.el,r,i[r]??"")}this.store.shell.notifyIngestEdit()}subscribe(t){return this.store.shell.subscribe(t)}get persistence(){return{...x(),destination:v}}}export{D};
1
+ import{ax as y,ay as v}from"./index-C5cL2IUJ.js";import{J as R,c as x}from"./json-history-resource-DS16aq7M.js";import{D as C,s as w,a as b,c as k,m as T}from"./react-world-authoring-adapter-CJSmvs_1.js";import{g as p,b as u}from"./inspect-Czr75mkK.js";function H(a){const e=(typeof a=="string"?a:a?.baseVal)?.trim()??"";if(e)return e.split(/\s+/)[0]}function S(a,t){if(a.id)return`${t}#${a.id}`;const e=H(a.className??"");return e?`${t}.${e}`:t}function j(a){const t=new Map;for(const[e,s]of a.nodes)t.set(e,{id:e,tag:s.object.tagName.toLowerCase(),el:s.object,parentId:s.parentId,childIds:[...s.childIds]});return{nodes:t,rootIds:[...a.rootIds]}}const g=[{prop:"color",label:"Color",type:"color"},{prop:"backgroundColor",label:"Background",type:"color"},{prop:"borderColor",label:"Border Color",type:"color"},{prop:"fontSize",label:"Font Size",type:"number"},{prop:"width",label:"Width",type:"number"},{prop:"height",label:"Height",type:"number"},{prop:"padding",label:"Padding",type:"number"},{prop:"margin",label:"Margin",type:"number"},{prop:"borderRadius",label:"Border Radius",type:"number"},{prop:"gap",label:"Gap",type:"number"},{prop:"display",label:"Display",type:"enum",options:["flex","block","none","grid"]},{prop:"textAlign",label:"Text Align",type:"enum",options:["left","center","right"]},{prop:"flexDirection",label:"Flex Direction",type:"enum",options:["row","column"]}],f="style.",M=new Map(g.map(({prop:a,type:t})=>[a,t]));class D{constructor(t,e,s){this.root=t,this.store=e;const o=e.shell.projectHistory;this.historyResource=o?new R({history:o,kind:"session-state",scope:"session",subject:{...s.journal,id:`${s.journal.id}/react-dom-edits`},displayName:"React DOM edits",capture:()=>this.captureHistoryState(),restore:async i=>{this.restoreHistoryState(i)}}):null}capabilities={transform:!1,inspectorFields:!0,persist:!1};provenance={source:"foreign",label:"live-only",detail:"Unmodified ingested React game — style edits apply for this session only and are never saved."};doc={};historyResource;projector=new C(w());snapCache=null;snapInvalidationScheduled=!1;boxEditSession=null;lockedIds=new Set;snapshot(){if(this.snapCache)return this.snapCache;this.projector.project(this.root);const t=j(this.projector);return this.snapCache=t,this.snapInvalidationScheduled||(this.snapInvalidationScheduled=!0,queueMicrotask(()=>{this.snapCache=null,this.snapInvalidationScheduled=!1})),t}nodeCount(){return this.snapshot().nodes.size}toEditorNode(t){return{id:t.id,label:S(t.el,t.tag),role:"element",kind:t.tag,parentId:t.parentId,childIds:t.childIds}}applyStyleToElement(t,e,s){t.style&&(t.style[e]=s)}recordStyleEdit(t,e,s){const o=this.doc[t]??{};o[e]=s,this.doc[t]=o}hierarchy={roots:()=>{const{nodes:t,rootIds:e}=this.snapshot();return e.map(s=>this.toEditorNode(t.get(s)))},node:t=>{const e=this.snapshot().nodes.get(t);return e?this.toEditorNode(e):null}};selection={get:()=>[...this.store.shell.selectedEntityIds],set:t=>this.store.shell.selectMultiple(t)};pickable={pick:(t,e)=>{const{nodes:s}=this.snapshot();let o=null,i=Number.POSITIVE_INFINITY,r=-1,l=-1;for(const c of s.values()){if(l++,this.lockedIds.has(c.id)||c.el.style?.pointerEvents==="none")continue;const n=c.el.getBoundingClientRect?.();if(!n||t<n.left||t>n.right||e<n.top||e>n.bottom)continue;const h=n.width*n.height;(h<i||h===i&&l>r)&&(o=c.id,i=h,r=l)}return o}};hostRect(){const t=this.root.getBoundingClientRect?.();return{left:t?.left??0,top:t?.top??0}}toHostRelative(t){const e=this.hostRect();return{x:t.left-e.left,y:t.top-e.top,width:t.width,height:t.height}}rects={rect:t=>{const s=this.snapshot().nodes.get(t)?.el.getBoundingClientRect?.();return s?this.toHostRelative(s):null},contextRects:t=>{const{nodes:e}=this.snapshot(),s=e.get(t);if(!s)return{};const o=s.parentId?e.get(s.parentId):void 0,i=o?.el.getBoundingClientRect?.(),l=(o?o.childIds:this.snapshot().rootIds).filter(d=>d!==t).map(d=>e.get(d)?.el.getBoundingClientRect?.()).filter(d=>d!=null).map(d=>this.toHostRelative(d)),c=s.el,n=c.getBoundingClientRect?.();let h;if(n){const d=y(p(c,"borderTopWidth",u))??0,I=y(p(c,"borderRightWidth",u))??0,E=y(p(c,"borderBottomWidth",u))??0,m=y(p(c,"borderLeftWidth",u))??0;h=this.toHostRelative({left:n.left+m,top:n.top+d,width:Math.max(0,n.width-m-I),height:Math.max(0,n.height-d-E)})}return{...i?{parent:this.toHostRelative(i)}:{},...l.length?{siblings:l}:{},...h?{paddingBox:h}:{}}}};colorSample={backgroundChainAt:(t,e)=>{const s=this.pickable.pick(t,e);if(!s)return null;const{nodes:o}=this.snapshot(),i=[];let r=o.get(s);for(;r;)i.push(p(r.el,"backgroundColor",u)),r=r.parentId?o.get(r.parentId):void 0;return i}};boxEdit={begin:t=>{this.historyResource?.assertCanMutate(),this.boxEditSession={id:t,touched:new Map,priorInline:new Map}},apply:(t,e)=>{this.historyResource?.assertCanMutate();const s=this.boxEditSession;if(!s||s.id!==t)return;const o=this.snapshot().nodes.get(t);if(!o)return;const i=p(o.el,"position",u),r=i==="absolute"||i==="fixed";for(const[l,c]of Object.entries(e)){const n=T(l,r);if(!n){console.warn(`[DomAuthoringAdapter] boxEdit: dropping patch key "${l}" for "${t}" — `+(l==="x"||l==="y"?`node is not absolutely/fixed positioned (computed position: "${i}"), no left/top to move`:"unrecognized box-edit patch key"));continue}if(!s.priorInline.has(n.prop)){const d=b(o.el.style,n.prop);s.priorInline.set(n.prop,d==null?"":String(d))}const h=n.cssValue(c);this.applyStyleToElement(o.el,n.prop,h),s.touched.set(n.prop,h)}},end:t=>{const e=this.boxEditSession;this.boxEditSession=null,!(!e||e.id!==t||e.touched.size===0)&&this.commitBoxEdit(t,e.touched,e.priorInline)}};commitBoxEdit(t,e,s){this.historyResource?.assertCanMutate();const o=this.captureHistoryState(),i=o.styles[t]??{};o.styles[t]=i;for(const[l,c]of s)i[l]=c;let r=!1;for(const[l,c]of e)r=this.writeStyleEntry(t,l,c)||r;r&&this.historyResource&&this.historyResource.record(`Edit ${e.size} Styles`,o,this.captureHistoryState()).catch(()=>{})}inspector={properties:()=>g.map(({prop:t,label:e,type:s,options:o})=>({path:`${f}${t}`,label:e,type:s,...o?{options:o}:{}})),get:(t,e)=>{if(e==="locked")return this.lockedIds.has(t);if(e==="visible"){const l=this.snapshot().nodes.get(t);return l?b(l.el.style,"visibility")!=="hidden":void 0}if(!e.startsWith(f))return;const s=e.slice(f.length),o=this.snapshot().nodes.get(t);if(!o)return;const i=b(o.el.style,s),r=M.get(s);return r==="number"?y(i):r==="color"?k(i):i},set:(t,e,s)=>{if(e==="locked"){s?this.lockedIds.add(t):this.lockedIds.delete(t),this.store.shell.notifyIngestEdit();return}if(e==="visible"){this.writeStyle(t,"visibility",s?"visible":"hidden");return}if(!e.startsWith(f))return;const o=e.slice(f.length);this.writeStyle(t,o,String(s))}};assetSubject={get:t=>this.assetSubjectForNode(this.snapshot(),t),entries:()=>{const t=this.snapshot();return[...t.nodes.keys()].flatMap(e=>{const s=this.assetSubjectForNode(t,e);return s?[{id:e,subject:s}]:[]})}};assetSubjectForNode(t,e){const s=t.nodes.get(e);return!s||s.tag!=="svg"||!s.el.outerHTML?null:{kind:"image",name:S(s.el,s.tag),mediaType:"image/svg+xml",text:s.el.outerHTML}}writeStyleEntry(t,e,s){const o=this.snapshot().nodes.get(t);return o?(this.applyStyleToElement(o.el,e,s),this.recordStyleEdit(t,e,s),this.store.shell.notifyIngestEdit(),!0):!1}writeStyle(t,e,s){this.historyResource?.assertCanMutate();const o=this.captureHistoryState();this.writeStyleEntry(t,e,s)&&this.historyResource&&this.historyResource.record(`Set ${e}`,o,this.captureHistoryState()).catch(()=>{})}dispose(){this.historyResource?.dispose()}captureHistoryState(){const t={};for(const[e,s]of this.snapshot().nodes){const o={};for(const{prop:i}of g){const r=b(s.el.style,i);r!==""&&(o[i]=String(r))}t[e]=o}return{edits:structuredClone(this.doc),styles:t}}restoreHistoryState(t){for(const s of Object.keys(this.doc))delete this.doc[s];Object.assign(this.doc,structuredClone(t.edits));const{nodes:e}=this.snapshot();for(const[s,o]of e){const i=t.styles[s]??{};for(const{prop:r}of g)this.applyStyleToElement(o.el,r,i[r]??"")}this.store.shell.notifyIngestEdit()}subscribe(t){return this.store.shell.subscribe(t)}get persistence(){return{...x(),destination:v}}}export{D};