@volter/game-editor 0.5.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BUNDLED_NOTICES +11228 -0
- package/LICENSE +686 -0
- package/LICENSE-BLENDER +1409 -0
- package/LICENSE-MCP +21 -0
- package/NOTICE +21 -0
- package/catalog/entries/audio.json +14 -0
- package/catalog/entries/bake.json +36 -0
- package/catalog/entries/blender.json +17 -0
- package/catalog/entries/react-root.json +24 -0
- package/catalog/entries/reflections.json +29 -0
- package/catalog/entries/static-batch.json +25 -0
- package/catalog/project-source/LICENSE +37 -0
- package/catalog/project-source/src/contributions/bake.kind.ts +40 -0
- package/catalog/project-source/src/contributions/builder-document.tsx +65 -0
- package/catalog/project-source/src/contributions/builder-state.ts +27 -0
- package/catalog/project-source/src/contributions/builder-ui.tsx +61 -0
- package/catalog/project-source/src/contributions/module-source.ts +502 -0
- package/catalog/project-source/src/contributions/pages.finder.ts +61 -0
- package/catalog/project-source/src/lib/audio/sfx.ts +255 -0
- package/catalog/project-source/src/lib/bake/asset-seed.ts +128 -0
- package/catalog/project-source/src/lib/bake/bake-schema.ts +65 -0
- package/catalog/project-source/src/lib/bake/clip-layering.ts +203 -0
- package/catalog/project-source/src/lib/bake/gltf-bake.ts +657 -0
- package/catalog/project-source/src/lib/bake/mesh-slice.ts +157 -0
- package/catalog/project-source/src/lib/bake/node-image.ts +463 -0
- package/catalog/project-source/src/lib/bake/object3d-bake.ts +121 -0
- package/catalog/project-source/src/lib/bake/object3d-lifecycle.ts +15 -0
- package/catalog/project-source/src/lib/bake/object3d-source.ts +8 -0
- package/catalog/project-source/src/lib/bake/params.ts +75 -0
- package/catalog/project-source/src/lib/bake/rest-relative-animation.ts +217 -0
- package/catalog/project-source/src/lib/bake/use-model.ts +95 -0
- package/catalog/project-source/src/lib/react-root/index.ts +20 -0
- package/catalog/project-source/src/lib/react-root/react-root-adapter.tsx +57 -0
- package/catalog/project-source/src/lib/reflections/ReflectionProbe.tsx +201 -0
- package/catalog/project-source/src/lib/reflections/index.ts +19 -0
- package/catalog/project-source/src/lib/reflections/probe-controller.ts +75 -0
- package/catalog/project-source/src/lib/reflections/reflection-probe-registry.ts +402 -0
- package/catalog/project-source/src/lib/reflections/volume-reflection-material.ts +416 -0
- package/catalog/project-source/src/lib/static-batch/Frozen.tsx +91 -0
- package/catalog/project-source/src/lib/static-batch/freeze.ts +579 -0
- package/catalog/project-source/src/lib/static-batch/index.ts +44 -0
- package/catalog/project-source/src/lib/static-batch/mutation-watch.ts +149 -0
- package/catalog/project-source/src/lib/static-batch/shadow-cache.ts +171 -0
- package/catalog/project-source/src/tools/bake-module.tool.ts +139 -0
- package/catalog/project-source/src/tools/bake-preview.tool.ts +475 -0
- package/dist/.vite/manifest.json +8304 -0
- package/dist/assets/AssetBudgetPanel-J9--TZPU.js +23 -0
- package/dist/assets/AudioViewer-CR7333fe.js +1 -0
- package/dist/assets/BVHLoader-6bQIXhMX.js +1 -0
- package/dist/assets/BufferGeometryUtils-Nz37EVXf.js +1 -0
- package/dist/assets/CCDIKSolver-CD7vLpsK.js +1 -0
- package/dist/assets/CSS3DRenderer-CL7ABLVK.js +1 -0
- package/dist/assets/CanvasSceneViewport-Bpi6gVTC.js +1 -0
- package/dist/assets/ColladaLoader-aVOPIsCh.js +3 -0
- package/dist/assets/ColorInput-DQBNrW-K.js +1 -0
- package/dist/assets/ConvexGeometry-CAzXlPVG.js +1 -0
- package/dist/assets/ConvexHull-BINCESFp.js +1 -0
- package/dist/assets/CopyShader-BzTUYzf6.js +24 -0
- package/dist/assets/DecalGeometry-160KRdfg.js +1 -0
- package/dist/assets/EXRLoader-Cdans_oJ.js +1 -0
- package/dist/assets/EffectComposer-DQxfsXBZ.js +1 -0
- package/dist/assets/EntityModelDocument-Ccvw66N9.js +1 -0
- package/dist/assets/EnvironmentAssetDocument-Dg-Qq6O6.js +1 -0
- package/dist/assets/FBXLoader-B4MoUtAn.js +1 -0
- package/dist/assets/Fbo-Dz-Soul3.js +1 -0
- package/dist/assets/FontLoader-CvGoVI5a.js +2 -0
- package/dist/assets/GLTFExporter-HgrCle4L.js +1 -0
- package/dist/assets/GameplaySessionTimeline-B52W3FVZ.js +1 -0
- package/dist/assets/Gltf-UHVWKz65.js +2 -0
- package/dist/assets/HDRLoader-THU88oVD.js +5 -0
- package/dist/assets/ImageViewer-Tn7s_MnW.js +1 -0
- package/dist/assets/InspectorCanvasPreview-CEr_Kxna.js +1 -0
- package/dist/assets/InspectorObjectPreview-CVejvLRg.js +1 -0
- package/dist/assets/JsonAssetDocument-C7VGcLhu.js +3 -0
- package/dist/assets/LineSegments2-CsOpKSiM.js +370 -0
- package/dist/assets/MTLLoader-_Xzd4_0p.js +2 -0
- package/dist/assets/MarchingCubes-Bsp4wrzd.js +1 -0
- package/dist/assets/MeshBVH-BiDHDcu-.js +1 -0
- package/dist/assets/ModelAssetDocument-F5GACirk.js +1 -0
- package/dist/assets/NonThreeAuthoringBootstrap-C3woOMxX.js +1 -0
- package/dist/assets/OBJLoader-BhIC6Hwo.js +5 -0
- package/dist/assets/Object3DDocumentViewport-DB7T0NTl.js +2 -0
- package/dist/assets/Object3DPreview-DL8oi7Xs.js +2 -0
- package/dist/assets/OnlineAssetDetail-C6z9RvYK.js +2 -0
- package/dist/assets/OrbitControls-CM3bPray.js +1 -0
- package/dist/assets/OrbitControls-DLpayAaK.js +1 -0
- package/dist/assets/OrthographicCamera-bQozawrh.js +1 -0
- package/dist/assets/PLYLoader-DYQqs5Ik.js +2 -0
- package/dist/assets/PerspectiveCamera-CQ2lh01o.js +1 -0
- package/dist/assets/PlayBar-BR-Vg3Jb.js +2 -0
- package/dist/assets/RGBELoader-BgBcQv8j.js +1 -0
- package/dist/assets/RectAreaLightUniformsLib-CMMoWfll.js +1 -0
- package/dist/assets/RenderPass-DPrn-Uky.js +1 -0
- package/dist/assets/ResolutionPicker-C67vs1F3.js +1 -0
- package/dist/assets/RootSelectionOverlay-BZPlxmXU.js +1 -0
- package/dist/assets/RoundedBox-BDGBg6QZ.js +1 -0
- package/dist/assets/RoundedBoxGeometry-CyUuYPfW.js +1 -0
- package/dist/assets/STLLoader-Dyv3lsxY.js +1 -0
- package/dist/assets/SelectionBox-D_75KrNW.js +1 -0
- package/dist/assets/ShaderPass-QYRpPuFJ.js +1 -0
- package/dist/assets/ShadowEditor-DkImwu1Y.js +1 -0
- package/dist/assets/SimplifyModifier-C8ayvRzd.js +1 -0
- package/dist/assets/SkeletonUtils-Cps8GOC6.js +1 -0
- package/dist/assets/Sky-CQKCgYDs.js +154 -0
- package/dist/assets/SourceAssetViewer-2SWQoUut.js +12 -0
- package/dist/assets/StageHost-BN-IoTef.js +2 -0
- package/dist/assets/StoryPreviewMount-DjyxRCXu.js +1 -0
- package/dist/assets/TDSLoader-D_T8XJ81.js +1 -0
- package/dist/assets/TextGeometry-DOWAEUV0.js +1 -0
- package/dist/assets/ThreeBoardDocument-CVncZyIq.js +2 -0
- package/dist/assets/ThreeIsolationSceneContent-C8C8whSF.js +1 -0
- package/dist/assets/ToolObject3DPreview-BRoDWe4Q.js +1 -0
- package/dist/assets/TrackballControls-DfznuQTh.js +1 -0
- package/dist/assets/TransientHint-BB1fwrvK.js +1 -0
- package/dist/assets/UnrealBloomPass-CR-cS_K5.js +83 -0
- package/dist/assets/VideoViewer-C6kocgIU.js +1 -0
- package/dist/assets/_commonjsHelpers-D6-XlEtG.js +1 -0
- package/dist/assets/active-ingest-CT6jSGhr.js +3 -0
- package/dist/assets/adapter-surface-Y37Nzcyw.js +1 -0
- package/dist/assets/after-paint-CB4bz1-e.js +1 -0
- package/dist/assets/agx-base-srgb-BjWZJgrZ.lut +0 -0
- package/dist/assets/agx-look-medium-high-contrast-D5F_ob1L.lut +0 -0
- package/dist/assets/agx-look-punchy-dxsnycNs.lut +0 -0
- package/dist/assets/animation-clock-CnjZqfJp.js +1 -0
- package/dist/assets/asset-budget-asset.menu-Di3KiQCd.js +1 -0
- package/dist/assets/asset-budget.action-DCzzcuTh.js +1 -0
- package/dist/assets/asset-budget.document-BWU8wnVW.js +1 -0
- package/dist/assets/asset-budget.menu-BGZpT_31.js +1 -0
- package/dist/assets/asset-editor-persistence-BBaONOJt.js +1 -0
- package/dist/assets/asset-loaders-BOy5Ss8k.js +2 -0
- package/dist/assets/asset-parse-error-BHMwBRU3.js +3 -0
- package/dist/assets/assets-BuSoGjBX.js +1 -0
- package/dist/assets/audio-meter-CyiToeUW.js +1 -0
- package/dist/assets/audio-unlock.service-CfUgUQVy.js +1 -0
- package/dist/assets/audio.utility-C6K6jem8.js +1 -0
- package/dist/assets/authoring-CgcOFhGS.js +1 -0
- package/dist/assets/autoplay.service-BZBGNSvt.js +1 -0
- package/dist/assets/axe-LkjAB6Lv.js +30 -0
- package/dist/assets/babylon-authoring-adapter-CL02gWDn.js +1 -0
- package/dist/assets/binding-Bmxqznjk.js +1 -0
- package/dist/assets/binding-identity-DcTpbvyg.js +1 -0
- package/dist/assets/binding-resolver-Dsh-6Vor.js +2 -0
- package/dist/assets/blender-emscripten-engine-9ZIRYNhe.js +2 -0
- package/dist/assets/blender-node-editor.document-iIDkB9sI.js +1 -0
- package/dist/assets/blender-properties-tab-C5CyPydi.js +3 -0
- package/dist/assets/blender-runtime-host-BpBwGv7r.js +4 -0
- package/dist/assets/blender-runtime-skin-DyQ9B6CR.js +7140 -0
- package/dist/assets/blender-runtime.document-lIYhhPtv.js +8 -0
- package/dist/assets/blender-timeline.document-77fx96N7.js +1 -0
- package/dist/assets/blender-uv-editor.document-fsT7B4gV.js +1 -0
- package/dist/assets/blender-version.status-o6dBm3n6.js +1 -0
- package/dist/assets/blender-wali-engine-wTOcrOMC.js +2 -0
- package/dist/assets/blender.command-BtJeWk-A.js +1 -0
- package/dist/assets/blender.keymap-GAQgeklK.js +1 -0
- package/dist/assets/blender.status-ujwGU6dU.js +1 -0
- package/dist/assets/blender.style-Dcem5f_T.js +1 -0
- package/dist/assets/board-guides-DziKSTss.js +1 -0
- package/dist/assets/body-marks-h_xDxiDE.js +1 -0
- package/dist/assets/bridge.command-o5gDNEwa.js +3 -0
- package/dist/assets/browserAll-DeWblVez.js +1 -0
- package/dist/assets/build-profiles.document-kW8iw8Xj.js +2 -0
- package/dist/assets/build-progress.status-BNRLytg2.js +1 -0
- package/dist/assets/build-session-C_sg3CEn.js +9 -0
- package/dist/assets/build.action-lYjTLb7K.js +1 -0
- package/dist/assets/build.command-DIGgUPU_.js +1 -0
- package/dist/assets/build.header-CKajx5U3.js +1 -0
- package/dist/assets/build.menu-BdU0QXny.js +1 -0
- package/dist/assets/build.service-CbBAyeu3.js +1 -0
- package/dist/assets/bus-mixer-CGfWDP3C.js +1 -0
- package/dist/assets/camera-KEsKvOL7.js +1 -0
- package/dist/assets/camera-runtime.inspector-B7unX4g1.js +1 -0
- package/dist/assets/canvas-entry-runtime-SfBxaR9M.js +2 -0
- package/dist/assets/capability-coverage-Czas4C18.js +7 -0
- package/dist/assets/chrome-trace-YZHMz60-.js +1 -0
- package/dist/assets/client-DNXj_opT.js +25 -0
- package/dist/assets/clip-planes-CnAI6DZn.js +1 -0
- package/dist/assets/collaboration-presence-DLoZ7EA3.js +1 -0
- package/dist/assets/collider-Bw0mXlsW.js +1 -0
- package/dist/assets/collider-dimensions-9xoFADXN.js +1 -0
- package/dist/assets/collision-system-DpNUJRJ3.js +1 -0
- package/dist/assets/command-results-CUQD49AB.js +1 -0
- package/dist/assets/component-board-registry-DrIa2csL.js +1 -0
- package/dist/assets/component-board.service-DCwcUssB.js +2 -0
- package/dist/assets/component-board.service-DidCyM4O.js +2 -0
- package/dist/assets/component-verbs.command-7xzfjGMZ.js +1 -0
- package/dist/assets/component-verbs.service-Bv9jId3q.js +1 -0
- package/dist/assets/config-CEZk921y.js +6 -0
- package/dist/assets/configurations-DTBMdaTL.js +1 -0
- package/dist/assets/connection.status-BifnQdOs.js +1 -0
- package/dist/assets/console-bridge-CHcb-xk5.js +1 -0
- package/dist/assets/constraint-De8f1Uiq.js +1 -0
- package/dist/assets/constraints.inspector-B9U9Yj-u.js +1 -0
- package/dist/assets/countdown-timer-CUm74dom.js +1 -0
- package/dist/assets/coverage.service-VTX5Mcsx.js +3 -0
- package/dist/assets/crash-null-boundary-v3a0uEgw.js +1 -0
- package/dist/assets/create-runtime-CVCc1BDx.js +1 -0
- package/dist/assets/curve-7Q79VgU4.js +1 -0
- package/dist/assets/data-asset-4hjS642k.js +5 -0
- package/dist/assets/data-check-core-CQEjuFyt.js +1 -0
- package/dist/assets/data-ref-CQI28C0D.js +1 -0
- package/dist/assets/debug-bridge-CCohG-d-.js +1 -0
- package/dist/assets/debug-registry-Dgvitx8M.js +1 -0
- package/dist/assets/defaults-DKiBJCPN.js +1 -0
- package/dist/assets/deferred-commands-CEMmvL47.js +1 -0
- package/dist/assets/deferred-ingest-play-DCJi_Pgu.js +2 -0
- package/dist/assets/design-time-layers-wYgOTgni.js +1 -0
- package/dist/assets/design-time-mount-registry-DUpXCg1U.js +1 -0
- package/dist/assets/design-time-mount.service-BzY21e1F.js +2 -0
- package/dist/assets/design-time-react-mount-DM9WLrF2.js +1 -0
- package/dist/assets/dev-build-gDYrq68M.js +1 -0
- package/dist/assets/directional-shadow-fit-BVkOKAv2.js +1 -0
- package/dist/assets/document-preview-three-Kbg2GCLm.js +1 -0
- package/dist/assets/dom-authoring-adapter-CY8C7f4T.js +1 -0
- package/dist/assets/draco3d-BBUTcNkz.js +1 -0
- package/dist/assets/draco_decoder-DsQ12WqX.wasm +0 -0
- package/dist/assets/draco_encoder-2Tcju8Ns.wasm +0 -0
- package/dist/assets/edit-mode-audio.service-Bzetwd5B.js +1 -0
- package/dist/assets/edit-mode-authoring-B47TfLqu.js +1 -0
- package/dist/assets/edit-mode-networking.service-YCX6RRb_.js +1 -0
- package/dist/assets/editor-api-BoJIcyZG.js +1 -0
- package/dist/assets/editor-port-C_FeBdeV.js +1 -0
- package/dist/assets/editor-presentation-activity-C7SNSmTd.js +1 -0
- package/dist/assets/entry-adjudication-Cq8Yeb74.js +1 -0
- package/dist/assets/environment-capture-7himRh2L.js +1 -0
- package/dist/assets/esbuild-BHljloGq.wasm +0 -0
- package/dist/assets/events-156d8d12.esm-ErOhDXXB.js +36 -0
- package/dist/assets/extend-B-eOccUm.js +36 -0
- package/dist/assets/extends-CF3RwP-h.js +1 -0
- package/dist/assets/eyedropper-session-bjPXnfeX.js +1 -0
- package/dist/assets/fflate.module-DPuTF8aG.js +6 -0
- package/dist/assets/filmic-srgb-Ct35FIH6.lut +0 -0
- package/dist/assets/first-party-audio-system-DxnGJOER.js +1 -0
- package/dist/assets/first-party-navigation-system-CL5Bquub.js +1 -0
- package/dist/assets/fork-menu-BoVyw2Wu.js +1 -0
- package/dist/assets/frame-debugger-store-D1Mf_5up.js +1 -0
- package/dist/assets/frame-delta-D2nsw_Ht.js +1 -0
- package/dist/assets/frame-pacing-D5acoOzO.js +1 -0
- package/dist/assets/frame-selector-cache-cCeUbcjG.js +1 -0
- package/dist/assets/game-DHOZVb-7.js +1 -0
- package/dist/assets/game-contract-seams-a5YXejOu.js +1 -0
- package/dist/assets/game-css-scope-transform-Eng4wS8E.js +33 -0
- package/dist/assets/game-document.service-DbRfx2V0.js +1 -0
- package/dist/assets/game-eval.command-D-7Dxbj_.js +2 -0
- package/dist/assets/game-input-seams-CIQdetRw.js +1 -0
- package/dist/assets/game-loop-CZvXlY00.js +1 -0
- package/dist/assets/game-module-access-B2mFxv-i.js +1 -0
- package/dist/assets/game.layout-CBASrvQu.js +1 -0
- package/dist/assets/gameplay-export-BoKXm51x.js +1 -0
- package/dist/assets/gameplay-replay-e5umMlXv.js +1 -0
- package/dist/assets/gameplay-rng-trap-CTNhm-UW.js +3 -0
- package/dist/assets/gameplay.command-DxcVYX6F.js +1 -0
- package/dist/assets/generation-DhwCUHPf.css +1 -0
- package/dist/assets/generation-jobs-BQrXbGp_.js +1 -0
- package/dist/assets/generation.service-CDIgObuw.js +1 -0
- package/dist/assets/generations-DzUogZsM.js +1 -0
- package/dist/assets/generations.status-CgOUBCum.js +1 -0
- package/dist/assets/hierarchy-marks-BLPfSIym.js +1 -0
- package/dist/assets/host-pointer-DbGSCjE9.js +1 -0
- package/dist/assets/hosted-asset-materialization-CiIvWkGU.js +2 -0
- package/dist/assets/ibl-override-material-BlmCxFKq.js +6 -0
- package/dist/assets/index-96FBF1Oj.js +1 -0
- package/dist/assets/index-BAWkB0dv.js +1 -0
- package/dist/assets/index-BDnS2b6S.js +1 -0
- package/dist/assets/index-BHp07vN0.js +2 -0
- package/dist/assets/index-BMxv2MNV.js +1 -0
- package/dist/assets/index-BP6wv2A0.js +5 -0
- package/dist/assets/index-BcCBqgM_.js +952 -0
- package/dist/assets/index-Bge9JUr6.js +1 -0
- package/dist/assets/index-BjTCPEQ7.js +134 -0
- package/dist/assets/index-BncK9THk.js +1 -0
- package/dist/assets/index-CJbYy-CF.js +3 -0
- package/dist/assets/index-CVCb_ImQ.js +1 -0
- package/dist/assets/index-CZd9o7Lu.js +1 -0
- package/dist/assets/index-CanA16PU.js +2 -0
- package/dist/assets/index-CinJrH5C.js +9 -0
- package/dist/assets/index-CtzuWnCS.js +1 -0
- package/dist/assets/index-D2fNXpHa.css +1 -0
- package/dist/assets/index-DUpHH6JR.js +3120 -0
- package/dist/assets/index-DUqP1RMl.js +1 -0
- package/dist/assets/index-D_NuPfjr.js +9 -0
- package/dist/assets/index-Da9JhEvW.js +25 -0
- package/dist/assets/index-DgapqSPi.js +7 -0
- package/dist/assets/index-FUuS4qwW.js +562 -0
- package/dist/assets/index-GIL7oGEO.js +4894 -0
- package/dist/assets/index-IEjydI9d.js +1 -0
- package/dist/assets/index-OrYXPk3Z.js +487 -0
- package/dist/assets/index-V1R-e5Bd.js +1 -0
- package/dist/assets/index-bQE2NA0D.js +1 -0
- package/dist/assets/index-gHZae-lw.js +13 -0
- package/dist/assets/index-mjWQmGhM.js +1 -0
- package/dist/assets/index-nmcBqr7Y.js +1 -0
- package/dist/assets/inference-diagnostics-Dhmtfbq_.js +1 -0
- package/dist/assets/ingest-BbYMC2vQ.js +1 -0
- package/dist/assets/ingest-boot-viewport-D5rI_Kk_.js +1 -0
- package/dist/assets/ingest-siblings-Bop2kqVl.js +1 -0
- package/dist/assets/ingest-source-persistence-C_6Hiyra.js +1 -0
- package/dist/assets/ingest.service-BTDnQfM1.js +1 -0
- package/dist/assets/input-manager-DH_hGW6d.js +1 -0
- package/dist/assets/input-router-BNQvtIqw.js +1 -0
- package/dist/assets/inspect-BZfi3mmo.js +1 -0
- package/dist/assets/inspection-CObLhnrs.js +1 -0
- package/dist/assets/instance-fork-actions-D3sRzS3K.js +1 -0
- package/dist/assets/instances.command-D6UkZNO8.js +1 -0
- package/dist/assets/instruments-CKR02Y8I.js +1 -0
- package/dist/assets/json-history-resource-BbxllWfV.js +1 -0
- package/dist/assets/jsx-runtime-DPjLkJKQ.js +9 -0
- package/dist/assets/light-D-_wsKTq.js +1 -0
- package/dist/assets/light-camera-factory-CWbbe9gI.js +1 -0
- package/dist/assets/lil-gui.module.min-BF55BEwA.js +10 -0
- package/dist/assets/live-behaviors-Bxq49Maz.js +1 -0
- package/dist/assets/live-gesture-lock-DJbrjOqf.js +1 -0
- package/dist/assets/loader-CaF_I7Yt.js +1 -0
- package/dist/assets/logger-Dqis-7W1.js +1 -0
- package/dist/assets/loop-gate-report-N52EWFGD.js +1 -0
- package/dist/assets/matcap-texture-CVfalpWT.js +1 -0
- package/dist/assets/material-CpAdjDxn.js +1 -0
- package/dist/assets/material-factory-Bz6h__6g.js +1 -0
- package/dist/assets/mesh-B3WPtNKO.js +1 -0
- package/dist/assets/mesh-shadow-CZnXrw_l.js +1 -0
- package/dist/assets/mikktspace.module-DO88SLib.js +1 -0
- package/dist/assets/model-asset-sections-CFvvihfx.css +1 -0
- package/dist/assets/model-asset-sections.service-CHhFS3ZX.js +1 -0
- package/dist/assets/model.layout-BJUEQYUI.js +1 -0
- package/dist/assets/models.finder-G2jQgIRu.js +1 -0
- package/dist/assets/module-mode-DVBLT9d-.js +2 -0
- package/dist/assets/mount-canvas-ingest-root-DDuAWf_C.js +2 -0
- package/dist/assets/mount-dom-ingest-root-D_EiBgpn.js +2 -0
- package/dist/assets/mount-game-6t9cKNo4.js +1 -0
- package/dist/assets/mount-ingest-root-glv2SSWf.js +2 -0
- package/dist/assets/mount-manifest-CGVxhmAw.js +1 -0
- package/dist/assets/mount-readiness-Ds0HvvLH.js +4 -0
- package/dist/assets/mount-three-ingest-root-hrUt9VVU.js +1 -0
- package/dist/assets/mounted-authoring-Dmg5xmhP.js +1 -0
- package/dist/assets/mounted-story-viewport-source-DjP6RA9U.js +1 -0
- package/dist/assets/native-debug-module-CWicoSGD.js +1 -0
- package/dist/assets/native-entry-surface-BE8LJNdu.js +1 -0
- package/dist/assets/navigation-CIiCx-SM.js +1 -0
- package/dist/assets/navmesh-workflow-store-Cmnm57TB.js +1 -0
- package/dist/assets/navmesh.menu-CAKiH8PW.js +1 -0
- package/dist/assets/navmesh.service-jgDWlgj1.js +1 -0
- package/dist/assets/network.utility-CEu5nHf7.js +1 -0
- package/dist/assets/object-marks-DwvIEBOK.js +1 -0
- package/dist/assets/object3d-authoring-subject-CH5sI2oP.js +1 -0
- package/dist/assets/output-DK8waum9.js +195 -0
- package/dist/assets/particles-Y626p22p.js +1 -0
- package/dist/assets/particles-factory-DnLOHXT8.js +1 -0
- package/dist/assets/pasteboard-materialize-BqSS4QzV.js +20 -0
- package/dist/assets/pasteboard.action-DU3UHtJG.js +2 -0
- package/dist/assets/performance-profiler-D_Jey87L.js +1 -0
- package/dist/assets/physics-registry-B2Jkp8e6.js +1 -0
- package/dist/assets/physics-registry-CUB9cT9p.js +1 -0
- package/dist/assets/pixi-authoring-adapter-CjibysC3.js +1 -0
- package/dist/assets/pixi-live-write-target-DuWydlWb.js +1 -0
- package/dist/assets/pixi-primitive-DlWbUPN9.js +1 -0
- package/dist/assets/pixi-react-root-factory-DYsznYRQ.js +1 -0
- package/dist/assets/pixi-story-model-DNkfnWUV.js +1 -0
- package/dist/assets/pixi-transform-channels-VjdohT11.js +1 -0
- package/dist/assets/play-mode-BFU2PCkG.js +22 -0
- package/dist/assets/play.command-BpqqLqkq.js +2 -0
- package/dist/assets/playtest-BXIL1JEF.js +1 -0
- package/dist/assets/pose-guard-6Osb2cFu.js +1 -0
- package/dist/assets/presentation-BPP5pXeQ.js +1 -0
- package/dist/assets/product-DFhyARJj.js +1 -0
- package/dist/assets/profiler.action-CaXJDp3t.js +1 -0
- package/dist/assets/profiler.menu-BIMF6Bi4.js +1 -0
- package/dist/assets/profiler.utility-BExw9wBO.js +1 -0
- package/dist/assets/project-authoring-session-Bnt6icLr.js +2 -0
- package/dist/assets/project-provenance-BoP3nrle.js +1 -0
- package/dist/assets/prompt-labels-DSMdM2_B.js +1 -0
- package/dist/assets/properties-bone-constraints.inspector-ByT6p7S-.js +1 -0
- package/dist/assets/properties-bone.inspector-z4qJwKO5.js +1 -0
- package/dist/assets/properties-collection.inspector-D0_3ijWU.js +1 -0
- package/dist/assets/properties-constraints.inspector-CESzjuls.js +1 -0
- package/dist/assets/properties-data.inspector-hG8Wgyzb.js +1 -0
- package/dist/assets/properties-material.inspector-CzY0JCQ6.js +1 -0
- package/dist/assets/properties-modifiers.inspector-3dDhwf7g.js +1 -0
- package/dist/assets/properties-object.inspector-CiarfxkT.js +1 -0
- package/dist/assets/properties-output.inspector-DKJxmKSD.js +1 -0
- package/dist/assets/properties-particles.inspector-CCEdYWGm.js +1 -0
- package/dist/assets/properties-physics.inspector-B2c0KUyA.js +1 -0
- package/dist/assets/properties-render.inspector-Bcm0HLRW.js +1 -0
- package/dist/assets/properties-scene.inspector-PIM_eTb_.js +1 -0
- package/dist/assets/properties-texture.inspector-CgFlnyr8.js +1 -0
- package/dist/assets/properties-view-layer.inspector-DGjF_Aqo.js +1 -0
- package/dist/assets/properties-world.inspector-CrMvaRvB.js +1 -0
- package/dist/assets/r3f-design-session-D-4yyDO9.js +2 -0
- package/dist/assets/r3f-physics-binding-BBo8oma9.js +1 -0
- package/dist/assets/r3f-root-factory-z9llD1OU.js +1 -0
- package/dist/assets/r3f-source-authoring-adapter-w6Bc60K-.js +13 -0
- package/dist/assets/rapier-physics-adapter-CaZqWLu0.js +1 -0
- package/dist/assets/rapier-physics-bridge-CMoeVo3Y.js +1 -0
- package/dist/assets/react-18-By2b4xR9.js +1 -0
- package/dist/assets/react-inspector.service-B_neRnSK.js +1 -0
- package/dist/assets/react-root-CEz5NTck.js +1 -0
- package/dist/assets/react-story-board-BDDwiE2H.js +1 -0
- package/dist/assets/react-three-fiber.esm-CycrbDlA.js +1 -0
- package/dist/assets/react-three-rapier.esm-CEfKpvxT.js +1 -0
- package/dist/assets/react-world-authoring-adapter-DmrwM3py.js +1 -0
- package/dist/assets/realm-services-CobQsq_X.js +1 -0
- package/dist/assets/rebind-controller-Dtq19Vb3.js +1 -0
- package/dist/assets/recast-navigation.wasm-compat-Dsoa_MD-.js +1 -0
- package/dist/assets/reflection-probe-Don-M3Fj.js +1 -0
- package/dist/assets/reflection-probe-capture.inspector-CmFUoJCx.js +1 -0
- package/dist/assets/register-render-vitals-BiZk29b2.js +1 -0
- package/dist/assets/registry-02YZjMNp.js +1 -0
- package/dist/assets/relative-path-guard-GiM7Lsz8.js +1 -0
- package/dist/assets/render-audio-control-vMRlePWb.js +1 -0
- package/dist/assets/render-batch-system-0vq7p0VC.js +1 -0
- package/dist/assets/render-census-BrQX_CXv.js +1 -0
- package/dist/assets/render-control-Df3yTiyr.js +1 -0
- package/dist/assets/render-env-D2IV2x5k.js +1 -0
- package/dist/assets/render-features-CPQ_e568.js +1 -0
- package/dist/assets/render-seed-DF4JHy7P.js +1 -0
- package/dist/assets/render-settings-Bw4W9SYF.js +1 -0
- package/dist/assets/render-vitals-BZ5HtvMi.js +1 -0
- package/dist/assets/renderer-config-BqG4O8i9.js +1 -0
- package/dist/assets/resolve-three-SZE_WWUM.js +702 -0
- package/dist/assets/root-seam-contract-Z0VWX3Bk.js +1 -0
- package/dist/assets/rrweb-Cd2ifIRP.js +142 -0
- package/dist/assets/run-ticks-settled-C4ksViyA.js +1 -0
- package/dist/assets/runtime-inspection-l2iFQSsg.js +1 -0
- package/dist/assets/scene-capture-BQKzU0NT.js +1 -0
- package/dist/assets/scene-capture-CGYF-Viw.js +1 -0
- package/dist/assets/scene-document.service-qkDjUrlP.js +2 -0
- package/dist/assets/scene-framing-Cat0GtyJ.js +1 -0
- package/dist/assets/scene-index-B6BZOHMk.js +1 -0
- package/dist/assets/scene-query-C7_N-TpI.js +1 -0
- package/dist/assets/schema-kl9-2B_J.js +1 -0
- package/dist/assets/sculpt.layout-zJF55yCR.js +1 -0
- package/dist/assets/seeded-random-i3mtgBKZ.js +1 -0
- package/dist/assets/session-CZ5JPg-z.js +4877 -0
- package/dist/assets/setup-audio-S8GQF91f.js +1 -0
- package/dist/assets/setup-particles-GCXlnkj_.js +1 -0
- package/dist/assets/setup-physics-BeZ7-LKD.js +1 -0
- package/dist/assets/setup-renderer-DVXaSGin.js +1587 -0
- package/dist/assets/shading.layout-DULYZV6M.js +1 -0
- package/dist/assets/sim-clock-CLflx7kg.js +1 -0
- package/dist/assets/sky-precompute-worker-ChN7J87v.js +1 -0
- package/dist/assets/soft-particle-depth-DGvfQDi1.js +1 -0
- package/dist/assets/source-object3d-authoring-adapter-B-L6Ha6f.js +1 -0
- package/dist/assets/source-persistence-backend-C-aR-B_Y.js +1 -0
- package/dist/assets/spark-renderer-lifecycle-ynWESJcv.js +1 -0
- package/dist/assets/spark.module-4pXQoz5d.js +12120 -0
- package/dist/assets/stage-invalidation-DBg3C3Ta.js +1 -0
- package/dist/assets/stage-keyboard-n-5kKH-m.js +1 -0
- package/dist/assets/stage-overlay-set-B9zp2sLB.js +1 -0
- package/dist/assets/stage-presence-markers-DiGI6A45.js +1 -0
- package/dist/assets/standard-viewport-dressing-CzjAe_0A.js +7 -0
- package/dist/assets/state-bridge-DLP1jLRW.js +1 -0
- package/dist/assets/state-watch.action-BOvQR2qt.js +1 -0
- package/dist/assets/state-watch.menu-CNLvDeeY.js +1 -0
- package/dist/assets/state-watch.utility-Bg1tTTQU.js +1 -0
- package/dist/assets/static-batch-advisor-B13QEH7d.js +1 -0
- package/dist/assets/stats.module-BL02l9NC.js +1 -0
- package/dist/assets/story-arg-descriptors-Ek86ExX7.js +1 -0
- package/dist/assets/story-capture-_gC8dXV-.js +1 -0
- package/dist/assets/story-documents--TDLaPeL.js +3 -0
- package/dist/assets/story-documents.service-BiS_YbNQ.js +1 -0
- package/dist/assets/story-documents.service-CxOPYJ2j.js +1 -0
- package/dist/assets/story-media-presence-BHzk2IV5.js +1 -0
- package/dist/assets/story-mount-turn-DFRTj5hi.js +1 -0
- package/dist/assets/story-pixi-preview-BUrOJZXS.js +1 -0
- package/dist/assets/story-presentation-j2AVN-mK.js +1 -0
- package/dist/assets/story-three-preview-BHEDZzcl.js +2 -0
- package/dist/assets/structural-ids-Dc-7rEwi.js +1 -0
- package/dist/assets/structural-signature-0w-i_ats.js +1 -0
- package/dist/assets/surface-content-Dg9Kkazf.js +1 -0
- package/dist/assets/surface-state-DaxyruCj.js +3 -0
- package/dist/assets/system-adapters-rIC8FSGP.js +1 -0
- package/dist/assets/system-runner-DkOjxEBt.js +1 -0
- package/dist/assets/system-slot-E2mEdiih.js +1 -0
- package/dist/assets/team-playtest.service-DqOinFVA.js +1 -0
- package/dist/assets/texture.layout-DASpHVht.js +1 -0
- package/dist/assets/three-CDSueJyJ.js +1 -0
- package/dist/assets/three-authoring-adapter-CmSQ3Vui.js +1 -0
- package/dist/assets/three-authoring.service-iuHLwtf1.js +2 -0
- package/dist/assets/three-ingest-runtime-QzDYk6tU.js +1 -0
- package/dist/assets/three-projection-core-BmKMZ-nf.js +1 -0
- package/dist/assets/three-viewport-presentation-QBQpSdMh.js +1 -0
- package/dist/assets/three.module-D396a9Mn.js +3840 -0
- package/dist/assets/three.quarks.esm-B1C61jGo.js +1039 -0
- package/dist/assets/tools-B_NJsk05.js +1 -0
- package/dist/assets/transform-writer-BhBBTx33.js +1 -0
- package/dist/assets/transport.header-B-6HQlU2.js +1 -0
- package/dist/assets/trigger-volume-BNK2XzPL.js +1 -0
- package/dist/assets/tuples-CIQ4Bn1U.js +1 -0
- package/dist/assets/tween.module-DciWpAG6.js +1 -0
- package/dist/assets/ui-board-document-Bwtt--xp.js +2 -0
- package/dist/assets/unexported-game-trap-Dm1JYKHy.js +2 -0
- package/dist/assets/unmanaged-root-detector-B8CpbkSN.js +2 -0
- package/dist/assets/upstream-pin-BdgRH6ID.js +1 -0
- package/dist/assets/use-data-Dzq-MytE.js +1 -0
- package/dist/assets/use-live-actor-state-DErbWQWF.js +1 -0
- package/dist/assets/use-selection-DbR73-xd.js +1 -0
- package/dist/assets/user-data-BB2Of6Ht.js +1 -0
- package/dist/assets/utility-view-state-BHypxA33.js +1 -0
- package/dist/assets/uv-editing.layout-BEKHxmHw.js +1 -0
- package/dist/assets/vgai-shared-fontawesome-CU65D4Ij.js +1 -0
- package/dist/assets/vgai-shared-jsx-dev-runtime-DFDKL7fx.js +1 -0
- package/dist/assets/vgai-shared-jsx-runtime-DIqBpTut.js +1 -0
- package/dist/assets/vgai-shared-react-BT7rMc2H.js +1 -0
- package/dist/assets/vgai-shared-react-dom-DFajMqMT.js +1 -0
- package/dist/assets/vgai-shared-react-dom-client-S0ozfl6_.js +1 -0
- package/dist/assets/vgai-shared-three-Bc5PvpLM.js +1 -0
- package/dist/assets/viewport-pick-context-DkawXbEi.js +1 -0
- package/dist/assets/viewport-root-presentation-CWsE56K6.js +1 -0
- package/dist/assets/viewport-shading-BuA88e_A.js +1 -0
- package/dist/assets/viewport-shading-boundary-B_-_gABg.js +82 -0
- package/dist/assets/viewport-surface-status-B3om4Kcf.js +1 -0
- package/dist/assets/vision_bundle-DX0dWqEa.js +15 -0
- package/dist/assets/voxel-surface-DtcsSWRL.js +1 -0
- package/dist/assets/wav-encode-D31zWF6O.js +1 -0
- package/dist/assets/webgl-frame-capture-FlF9zQmW.js +1 -0
- package/dist/assets/webgl-gpu-timer-D3YX7RaD.js +1 -0
- package/dist/assets/webworkerAll-CM2o_dnz.js +1 -0
- package/dist/assets/worker-UrMcrc5_.js +2 -0
- package/dist/assets/world-documents-147tiFZe.js +1 -0
- package/dist/assets/world-root-stage-binding-vwTrtBz6.js +1 -0
- package/dist/assets/world-state-BWG-IcOd.js +1 -0
- package/dist/assets/writer-B-KovzkA.js +5 -0
- package/dist/assets/xstate-animation-binding-Brd0NST6.js +1 -0
- package/dist/assets/xstate-animation-meta-Q3u9zh_m.js +1 -0
- package/dist/assets/xstate-behavior.action-B8UluFBK.js +1 -0
- package/dist/assets/xstate-behavior.document-CKAsE45I.js +1 -0
- package/dist/assets/xstate-behavior.inspector-vJJyuifc.js +1 -0
- package/dist/assets/xstate-behavior.menu-BXbPICIh.js +1 -0
- package/dist/assets/xstate-inspection-BsZv8LS9.js +1 -0
- package/dist/vgai-shared-react.json +10 -0
- package/dist/vgai-shared-three.json +3 -0
- package/dist-node/cli.js +9320 -0
- package/dist-node/create.js +3239 -0
- package/package.json +91 -0
- package/presets.mjs +2 -0
- package/src/contributions.d.ts +4 -0
- package/src/index.ts +38 -0
- package/starter/cube.blend +0 -0
- package/starter/cube.py +81 -0
- package/template/.agents/references/project-manual.md +341 -0
- package/template/.agents/skills/editor/SKILL.md +53 -0
- package/template/.agents/skills/editor/agents/openai.yaml +4 -0
- package/template/.agents/skills/editor/references/editor-control.md +363 -0
- package/template/.agents/skills/vgai-3d-models/SKILL.md +64 -0
- package/template/.agents/skills/vgai-ingest-existing-game/SKILL.md +112 -0
- package/template/.agents/skills/vgai-threejs-authoring/SKILL.md +347 -0
- package/template/.agents/skills/vgai-threejs-authoring/agents/openai.yaml +4 -0
- package/template/.agents/skills/vgai-threejs-authoring/references/helper-catalog.md +65 -0
- package/template/.claude/skills/editor/SKILL.md +53 -0
- package/template/.claude/skills/editor/agents/openai.yaml +4 -0
- package/template/.claude/skills/editor/references/editor-control.md +363 -0
- package/template/.claude/skills/vgai-3d-models/SKILL.md +64 -0
- package/template/.claude/skills/vgai-ingest-existing-game/SKILL.md +112 -0
- package/template/.claude/skills/vgai-threejs-authoring/SKILL.md +347 -0
- package/template/.claude/skills/vgai-threejs-authoring/agents/openai.yaml +4 -0
- package/template/.claude/skills/vgai-threejs-authoring/references/helper-catalog.md +65 -0
- package/template/.github/copilot-instructions.md +6 -0
- package/template/.github/skills/editor/SKILL.md +53 -0
- package/template/.github/skills/editor/agents/openai.yaml +4 -0
- package/template/.github/skills/editor/references/editor-control.md +363 -0
- package/template/.github/skills/vgai-3d-models/SKILL.md +64 -0
- package/template/.github/skills/vgai-ingest-existing-game/SKILL.md +112 -0
- package/template/.github/skills/vgai-threejs-authoring/SKILL.md +347 -0
- package/template/.github/skills/vgai-threejs-authoring/agents/openai.yaml +4 -0
- package/template/.github/skills/vgai-threejs-authoring/references/helper-catalog.md +65 -0
- package/template/.mcp.json +12 -0
- package/template/.vgai/assets.json +1 -0
- package/template/.vgai/provenance.json +4 -0
- package/template/.volter/tracker/validation/.preset.base.mts +178 -0
- package/template/.volter/tracker/validation/preset.mts +186 -0
- package/template/.volter/tracker/visualizer/.extension.base.tsx +14 -0
- package/template/.volter/tracker/visualizer/extension.tsx +14 -0
- package/template/.volter/tracker-config.json +17 -0
- package/template/AGENTS.md +176 -0
- package/template/CLAUDE.md +1 -0
- package/template/DEVLOG.md +20 -0
- package/template/IDIOMS.md +118 -0
- package/template/LICENSE +30 -0
- package/template/README.md +83 -0
- package/template/ROADMAP.md +20 -0
- package/template/asset-manifest.json +3 -0
- package/template/check-idioms.ts +1533 -0
- package/template/index.html +18 -0
- package/template/manifest-entry-modules-plugin.ts +53 -0
- package/template/package.json +62 -0
- package/template/public/jsm/libs/basis/basis_transcoder.js +19 -0
- package/template/public/jsm/libs/basis/basis_transcoder.wasm +0 -0
- package/template/public/jsm/libs/draco/gltf/draco_decoder.js +33 -0
- package/template/public/jsm/libs/draco/gltf/draco_decoder.wasm +0 -0
- package/template/public/jsm/libs/draco/gltf/draco_encoder.js +33 -0
- package/template/public/jsm/libs/draco/gltf/draco_wasm_wrapper.js +116 -0
- package/template/public/shaders/daylight-sky.frag.glsl +15 -0
- package/template/public/shaders/daylight-sky.vert.glsl +7 -0
- package/template/scripts/patch-drei-stats-gl.mjs +35 -0
- package/template/server/colyseus-setup.ts +111 -0
- package/template/server/loopback.ts +76 -0
- package/template/server/main.ts +78 -0
- package/template/server/rooms/arena-room.ts +488 -0
- package/template/server/rooms/game-room.ts +274 -0
- package/template/server/rooms.ts +15 -0
- package/template/server/tsconfig.json +19 -0
- package/template/src/bot/QaTester.tsx +35 -0
- package/template/src/bot/behaviors.ts +203 -0
- package/template/src/bot/bot-station.ts +192 -0
- package/template/src/bot/tester-run.ts +238 -0
- package/template/src/bot/tester-station.ts +193 -0
- package/template/src/components/environment/DaylightSky.tsx +54 -0
- package/template/src/components/environment/Ground.tsx +129 -0
- package/template/src/components/environment/SceneAtmosphere.tsx +14 -0
- package/template/src/components/environment/SoftGroundShadow.tsx +62 -0
- package/template/src/components/environment/SunShadowFit.tsx +141 -0
- package/template/src/contributions/README.md +98 -0
- package/template/src/contributions/analytics.analytics.tsx +26 -0
- package/template/src/contributions/data.document.tsx +35 -0
- package/template/src/contributions/pages.finder.ts +61 -0
- package/template/src/contributions/tester.inspector.tsx +64 -0
- package/template/src/contributions/use-game-modules.ts +80 -0
- package/template/src/data/README.md +17 -0
- package/template/src/input.ts +97 -0
- package/template/src/lib/audio/capability.json +4 -0
- package/template/src/lib/audio/sfx.ts +255 -0
- package/template/src/lib/react-root/capability.json +4 -0
- package/template/src/lib/react-root/index.ts +20 -0
- package/template/src/lib/react-root/react-root-adapter.tsx +57 -0
- package/template/src/lib/reflections/ReflectionProbe.tsx +201 -0
- package/template/src/lib/reflections/capability.json +4 -0
- package/template/src/lib/reflections/index.ts +19 -0
- package/template/src/lib/reflections/probe-controller.ts +75 -0
- package/template/src/lib/reflections/reflection-probe-registry.ts +402 -0
- package/template/src/lib/reflections/volume-reflection-material.ts +416 -0
- package/template/src/lib/static-batch/Frozen.tsx +91 -0
- package/template/src/lib/static-batch/capability.json +4 -0
- package/template/src/lib/static-batch/freeze.ts +579 -0
- package/template/src/lib/static-batch/index.ts +44 -0
- package/template/src/lib/static-batch/mutation-watch.ts +149 -0
- package/template/src/lib/static-batch/shadow-cache.ts +171 -0
- package/template/src/main.ts +63 -0
- package/template/src/manifest-entry-modules.d.ts +3 -0
- package/template/src/prefabs/HeroBox.stories.tsx +23 -0
- package/template/src/prefabs/HeroBox.tsx +35 -0
- package/template/src/scenes/MainScene.tsx +77 -0
- package/template/src/world.tsx +87 -0
- package/template/tsconfig.json +35 -0
- package/template/tsconfig.node.json +32 -0
- package/template/tsconfig.tools.json +22 -0
- package/template/validate-asset-content.ts +27 -0
- package/template/validate-assets.ts +60 -0
- package/template/validate-manifest.ts +55 -0
- package/template/vgai.adapter.ts +76 -0
- package/template/vgai.project.json +24 -0
- package/template/vite.config.ts +247 -0
- package/template-dotfiles/gitignore +63 -0
- package/workbench/src/media/game-cover.css +83 -0
- package/workbench/src/product.contribution.ts +188 -0
- package/workbench/src/vgaiGameSkew.ts +276 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let e=0;function n(){e++}function t(){return e}export{n as i,t as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as o}from"./index-nmcBqr7Y.js";import{dm as t}from"./index-GIL7oGEO.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"./three.module-D396a9Mn.js";function u({stage:r}){return o.useEffect(()=>t(r.store,r.viewport,r.canvas),[r.store,r.viewport,r.canvas]),null}export{u as StageKeyboardBinding};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./jsx-runtime-DPjLkJKQ.js";import{r}from"./index-nmcBqr7Y.js";import{jy as w,fe as F,fP as j,a9 as m,ao as b,jz as P,f7 as v,f8 as y,a5 as S,jA as B,jB as L,hL as M,i0 as A,a4 as x,fS as k,fT as C,jC as T,jD as z,jE as V,jF as O,jG as H,hs as D,f6 as R,f9 as I,jH as N,jI as G,jJ as U,jK as $,ac as W,jL as _,jM as K,jN as q}from"./index-GIL7oGEO.js";import"./index-CtzuWnCS.js";import{s as J,o as f}from"./viewport-shading-boundary-B_-_gABg.js";import{u as Z,v as Q,a as X,s as Y,t as E,b as g,V as ee}from"./three-viewport-presentation-QBQpSdMh.js";import{T as te}from"./TransientHint-BB1fwrvK.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./index-CinJrH5C.js";import"./three.module-D396a9Mn.js";import"./stage-invalidation-DBg3C3Ta.js";import"./clip-planes-CnAI6DZn.js";import"./three-CDSueJyJ.js";import"./viewport-pick-context-DkawXbEi.js";import"./OrbitControls-CM3bPray.js";import"./LineSegments2-CsOpKSiM.js";import"./three.quarks.esm-B1C61jGo.js";import"./live-gesture-lock-DJbrjOqf.js";import"./scene-framing-Cat0GtyJ.js";function u(t){return t.toFixed(2)}function se(){const t=w(),[o,s]=r.useState({x:0,y:0,z:0}),[i,n]=r.useState({x:0,y:0,z:0}),a=r.useRef(0),l=r.useSyncExternalStore(J,f,f);return Z(),r.useEffect(()=>{function p(){const d=t.cameraPosition,h=t.cameraTarget;s(c=>c.x!==d.x||c.y!==d.y||c.z!==d.z?{x:d.x,y:d.y,z:d.z}:c),n(c=>c.x!==h.x||c.y!==h.y||c.z!==h.z?{x:h.x,y:h.y,z:h.z}:c),a.current=requestAnimationFrame(p)}return a.current=requestAnimationFrame(p),()=>cancelAnimationFrame(a.current)},[t]),e.jsxs(F,{variant:"overlay",border:!0,className:"vgai-camera-info vgai-chrome-island vgai-glass-island","data-island-scale":"compact",children:[e.jsxs(j,{gap:8,align:"center",style:{whiteSpace:"nowrap"},children:[e.jsxs(m,{variant:"code",children:["Pos ",u(o.x)," ",u(o.y)," ",u(o.z)]}),e.jsxs(m,{variant:"code",children:["Target ",u(i.x)," ",u(i.y)," ",u(i.z)]})]}),!l&&e.jsxs(e.Fragment,{children:[e.jsx(m,{variant:"code","data-testid":"viewport-controls-hint",style:{whiteSpace:"nowrap"},children:Q()}),e.jsx(m,{variant:"code",style:{whiteSpace:"nowrap"},children:X()})]})]})}function re(){const t=w(),[,o]=r.useState(0),s=P();return r.useEffect(()=>{const i=setInterval(()=>o(n=>n+1),200);return()=>clearInterval(i)},[]),e.jsxs("div",{className:"vgai-hud-overlay vgai-chrome-island vgai-glass-island","data-island-scale":"compact","data-hud-border":"strong",style:{position:"absolute",top:"var(--vgai-viewport-overlay-hud-top, 48px)",right:8,padding:"6px 10px",pointerEvents:"auto",fontSize:"var(--vgai-font-base)",color:b.content.primary,fontFamily:b.typography.mono,lineHeight:"16px"},children:[e.jsxs("div",{children:["FPS: ",t.fps.toFixed(0)]}),e.jsxs("div",{children:["Draw: ",t.drawCalls]}),e.jsxs("div",{children:["Tris: ",t.triangles.toLocaleString()]}),e.jsxs("div",{children:["Frame: ",t.frameTime.toFixed(1),"ms"]}),s!==null&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:["Heap: ",s.heapUsedMB===null?"n/a":`${s.heapUsedMB.toFixed(0)}MB`,s.heapLimitMB===null?"":` / ${s.heapLimitMB.toFixed(0)}MB`]}),e.jsxs("div",{children:["Mount epochs: ",s.mountEpochs]}),e.jsxs("div",{children:["Canvas: ",s.canvasMB.toFixed(1),"MB ×",s.canvases]}),s.textures!==void 0&&e.jsxs("div",{children:["GPU: ",s.textures," tex, ",s.geometries??0," geo",s.programs===void 0?"":`, ${s.programs} prog`]})]})]})}function oe({store:t}){const o=r.useSyncExternalStore(Y,E,E),[s,i]=r.useState(!1),n=r.useRef(null);r.useEffect(()=>{if(!s)return;const l=p=>{n.current?.contains(p.target)||i(!1)};return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[s]);const a=l=>{g("orthographic"),t.setViewPreset(l)};return e.jsxs("div",{ref:n,className:"vgai-viewport-popover-anchor",children:[e.jsx(v,{text:o.projection==="perspective"?"Perspective":"Orthographic",children:e.jsx(y,{"aria-label":"Viewport views","aria-expanded":s,size:"comfortable",onClick:()=>i(l=>!l),children:e.jsx(S,{icon:s?B:L,size:"md"})})}),s?e.jsx(M,{style:{minWidth:230},children:e.jsxs(A,{gap:3,children:[e.jsx(m,{variant:"caption",tone:"muted",children:"Projection"}),e.jsxs(j,{gap:1,children:[e.jsx(x,{size:"compact",variant:o.projection==="perspective"?"primary":"ghost",onClick:()=>g("perspective"),children:"Perspective"}),e.jsx(x,{size:"compact",variant:o.projection==="orthographic"?"primary":"ghost",onClick:()=>g("orthographic"),children:"Orthographic"})]}),e.jsx(m,{variant:"caption",tone:"muted",children:"Axis View"}),e.jsxs(j,{gap:1,children:[e.jsx(x,{size:"compact",variant:"ghost",onClick:()=>a("top"),children:"Top"}),e.jsx(x,{size:"compact",variant:"ghost",onClick:()=>a("front"),children:"Front"}),e.jsx(x,{size:"compact",variant:"ghost",onClick:()=>a("right"),children:"Right"})]})]})}):null]})}function ie({store:t,documentId:o}){r.useSyncExternalStore(t.subscribe,t.getSnapshot),r.useSyncExternalStore(k,C),r.useSyncExternalStore(T,z),r.useSyncExternalStore(V,O);const{adapter:s}=H(t),i=D(o);r.useSyncExternalStore(i?.subscribe??ae,i?.getSnapshot??ne);const n=i?i.presentation().grid:t.showGrid;return e.jsxs(R,{label:"Viewport display",className:"vgai-viewport-toolbar vgai-viewport-toolbar-right",children:[e.jsx(v,{text:`Grid: ${n?"On":"Off"}`,children:e.jsx(y,{"aria-label":"Toggle grid","aria-pressed":n,size:"comfortable",onClick:()=>i?i.setGrid(!n):t.toggleGrid(),children:e.jsx(S,{icon:I,size:"md"})})}),e.jsx(ce,{store:t}),e.jsx(N,{mode:t.shadingMode,onChange:a=>t.setShadingMode(a)}),e.jsx(oe,{store:t}),e.jsx(le,{adapter:s,store:t})]})}const ae=()=>()=>{},ne=()=>0,le=r.memo(function({adapter:o,store:s}){const[,i]=r.useReducer(a=>a+1,0);r.useEffect(()=>o.subscribe?.(i),[o]);const n=r.useMemo(()=>U(o),[o,s.contentVersion]);return n===0?null:e.jsx(v,{text:`Open Light Explorer · ${n} ${n===1?"light":"lights"}`,children:e.jsx(y,{"aria-label":"Open Light Explorer",size:"comfortable",onClick:()=>W(_.lightExplorer.id),children:e.jsx(S,{icon:$,size:"md"})})})});function ce({store:t}){const o=[{key:"bounds",label:"Bounds"},{key:"lights",label:"Lights"},{key:"cameras",label:"Cameras"},{key:"colliders",label:"Colliders"},{key:"joints",label:"Joints"},{key:"particles",label:"Particle Emitters"},{key:"lod",label:"LOD"},{key:"audio",label:"Audio"},{key:"splines",label:"Splines"},{key:"navmesh",label:"NavMesh"},{key:"constraints",label:"Constraints"},{key:"reflectionProbes",label:"Reflection Probes"},{key:"triggerVolumes",label:"Trigger Volumes"},{key:"skeletons",label:"Skeletons"},{key:"weights",label:"Weights"}];return e.jsx(G,{label:"Helpers",master:{enabled:t.showHelpers,onToggle:()=>t.toggleHelpers()},choices:o.map(s=>({id:s.key,label:s.label,enabled:t.helperVisibility[s.key],onToggle:()=>t.toggleHelperType(s.key)}))})}function Pe({store:t,documentId:o,stage:s,active:i,chrome:n}){const a=s?.store??t;r.useSyncExternalStore(t.subscribe,t.getShellSnapshot??t.getSnapshot),r.useSyncExternalStore(a.subscribe,a.getShellSnapshot??a.getSnapshot),r.useSyncExternalStore(T,z),r.useSyncExternalStore(V,O),r.useSyncExternalStore(k,C);const l=K(t,o,n),p=q(l);return e.jsxs(e.Fragment,{children:[p?e.jsxs(e.Fragment,{children:[e.jsx(ie,{store:a,documentId:o}),e.jsx(se,{})]}):null,!p&&l.surface==="three"?e.jsx(ee,{}):null,l.surface==="three"&&a.showStats&&e.jsx(re,{}),i?e.jsx(te,{}):null]})}export{Pe as StageOverlaySet};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./jsx-runtime-DPjLkJKQ.js";import"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{aO as A,aU as N,df as X,as as Q,dg as V,dh as G}from"./index-GIL7oGEO.js";import{r as b}from"./collaboration-presence-DLoZ7EA3.js";import{t as _,g as H,x as U,bd as W,C as M,a1 as k,j as K,be as J,bf as ee,Q as te,V as x,O as oe,bg as ne,aY as re,aB as ie,aZ as ae,bh as se}from"./three.module-D396a9Mn.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";function ce(){const e=document.querySelector(`.${V}`);return(e?getComputedStyle(e).getPropertyValue("--vgai-content-on-accent").trim():"")||G.color.content.onAccent}function D(e,r){const o=e.image,n=o.getContext("2d");if(!n)return;n.clearRect(0,0,o.width,o.height),n.fillStyle=r.color,n.beginPath(),n.roundRect(2,2,o.width-4,o.height-4,16),n.fill(),n.fillStyle=ce(),n.font="600 22px system-ui, sans-serif",n.textAlign="center",n.textBaseline="middle";const c=r.kind==="agent"?" · AI":"";n.fillText(`${r.displayName}${c}`,o.width/2,o.height/2,238),e.needsUpdate=!0}function le(e){const r=new U(50,1,.2,1.4),o=new W(r),n=new M(e.color);o.setColors(n,n,n,n,n),o.name=`Collaboration camera: ${e.displayName}`,o.userData.editorOnly=!0;const c=document.createElement("canvas");c.width=256,c.height=64;const p=new k(c);p.colorSpace=K;const d=new J(new ee({map:p,depthTest:!1,transparent:!0}));return d.name=`Collaboration label: ${e.displayName}`,d.userData.editorOnly=!0,d.scale.set(1.8,.45,1),d.renderOrder=1e4,D(p,e),{camera:r,helper:o,label:d,texture:p,signature:"",targetPosition:new x,targetQuaternion:new te,targetFov:50,initialized:!1}}function de(e,r){const o=r.presence.camera;if(!o)return;e.targetPosition.set(o.x,o.y,o.z);const n=new oe;n.position.copy(e.targetPosition),n.lookAt(o.targetX,o.targetY,o.targetZ),e.targetQuaternion.copy(n.quaternion),e.targetFov=o.fov,e.initialized||(e.initialized=!0,e.camera.position.copy(e.targetPosition),e.camera.quaternion.copy(e.targetQuaternion),e.camera.fov=e.targetFov);const c=`${r.displayName}|${r.kind}|${r.color}|${r.status}`;c!==e.signature&&(e.signature=c,D(e.texture,r))}function pe(e,r){const o=1-Math.exp(-12*Math.max(0,r));e.camera.position.lerp(e.targetPosition,o),e.camera.quaternion.slerp(e.targetQuaternion,o),e.camera.fov+=(e.targetFov-e.camera.fov)*o,e.camera.updateProjectionMatrix(),e.camera.updateMatrixWorld(!0),e.helper.update(),e.label.position.copy(e.camera.position),e.label.position.y+=.55}function Z(e){e.helper.removeFromParent(),e.label.removeFromParent(),e.helper.dispose(),e.texture.dispose(),e.label.material.dispose()}function ue(e,r){const o=A(e),n=new ne(o,new M(r));return n.name=`Collaboration selection: ${e.name||e.uuid}`,n.userData.editorOnly=!0,n.renderOrder=9999,n.material.depthTest=!1,{object:e,box:o,helper:n}}function w(e){e.helper.removeFromParent(),e.helper.geometry.dispose(),e.helper.material.dispose()}function ge(e){if(!e||e.type!=="pointer-ray"||!["originX","originY","originZ","directionX","directionY","directionZ","length"].every(p=>typeof e[p]=="number"&&Number.isFinite(e[p])))return null;const o=new x(e.originX,e.originY,e.originZ),n=new x(e.directionX,e.directionY,e.directionZ),c=Math.min(1e3,Math.max(.1,e.length));return n.lengthSq()<1e-6?null:{origin:o,end:o.clone().add(n.normalize().multiplyScalar(c))}}function Pe(e){const{scene:r,store:o,documentId:n,container:c,canvas:p,viewport:d,readVisibleCameraPose:R}=e,y=()=>N()===n,v=()=>{if(!y())return;const i=R();b({camera:{x:i.position.x,y:i.position.y,z:i.position.z,targetX:i.target.x,targetY:i.target.y,targetZ:i.target.z,fov:i.fov}})};d.orbitControls.addEventListener("change",v);let C=!1;const I=i=>{const s=i.value===!0;C=s,y()&&b({gesture:s?{type:"transform",selection:[...o.selectedEntityIds]}:null})};d.transformControls.addEventListener("dragging-changed",I);const S=new _,P=new H,z=i=>{if(C||i.buttons!==0||!y())return;const s=p.getBoundingClientRect();if(s.width<=0||s.height<=0)return;P.set((i.clientX-s.left)/s.width*2-1,-((i.clientY-s.top)/s.height)*2+1),S.setFromCamera(P,d.renderCamera);const l=S.ray,m=R();b({gesture:{type:"pointer-ray",originX:l.origin.x,originY:l.origin.y,originZ:l.origin.z,directionX:l.direction.x,directionY:l.direction.y,directionZ:l.direction.z,length:Math.max(2,m.position.distanceTo(m.target))}})},E=()=>{!C&&y()&&b({gesture:null})};c.addEventListener("pointermove",z),c.addEventListener("pointerleave",E),v();const g=new Map,u=new Map,f=new Map;let L=-1;const B=()=>{const i=X();if(!i||i.sequence===L)return;L=i.sequence;const s=i.participants.filter(t=>t.participantId!==Q&&t.presence.document===n),l=s.filter(t=>t.presence.camera),m=new Set(l.map(t=>t.participantId));for(const[t,a]of g)m.has(t)||(Z(a),g.delete(t));for(const t of l){let a=g.get(t.participantId);a||(a=le(t),g.set(t.participantId,a),r.add(a.helper,a.label)),de(a,t)}const T=s.flatMap(t=>t.presence.selection.slice(0,20).map(a=>({key:`${t.participantId}:${a}`,objectId:a,color:t.color}))),q=new Set(T.map(t=>t.key));for(const[t,a]of u)q.has(t)||(w(a),u.delete(t));for(const t of T){const a=o.objectMap.get(t.objectId),h=u.get(t.key);if(!a){h&&(w(h),u.delete(t.key));continue}if(h?.object===a)continue;h&&w(h);const F=ue(a,t.color);u.set(t.key,F),r.add(F.helper)}const Y=s.flatMap(t=>{const a=ge(t.presence.gesture);return a?[{participantId:t.participantId,color:t.color,ray:a}]:[]}),j=new Set(Y.map(t=>t.participantId));for(const[t,a]of f)j.has(t)||($(a),f.delete(t));for(const t of Y){let a=f.get(t.participantId);a||(a=fe(t.color),f.set(t.participantId,a),r.add(a.line)),me(a,t.ray)}},O=i=>{if(!y())return;const s=i.detail?.participantId;if(typeof s!="string")return;const l=X()?.participants.find(m=>m.participantId===s)?.presence.camera;l&&o.setCameraPose({x:l.x,y:l.y,z:l.z},{x:l.targetX,y:l.targetY,z:l.targetZ},l.fov)};return window.addEventListener("editor:collaboration-join",O),{reportCamera:v,syncMarkers:i=>{B();for(const s of g.values())pe(s,i);for(const s of u.values())A(s.object,s.box)},live:()=>g.size+u.size+f.size>0,dispose:()=>{d.orbitControls.removeEventListener("change",v),d.transformControls.removeEventListener("dragging-changed",I),c.removeEventListener("pointermove",z),c.removeEventListener("pointerleave",E),window.removeEventListener("editor:collaboration-join",O);for(const i of g.values())Z(i);g.clear();for(const i of u.values())w(i);u.clear();for(const i of f.values())$(i);f.clear()}}}function fe(e){const r=new re(new Float32Array(6),3),o=new ie;o.setAttribute("position",r);const n=new ae({color:new M(e),depthTest:!1,transparent:!0,opacity:.9}),c=new se(o,n);return c.name="Collaboration pointer ray",c.userData.editorOnly=!0,c.renderOrder=10001,{line:c,positions:r}}function me(e,r){e.positions.setXYZ(0,r.origin.x,r.origin.y,r.origin.z),e.positions.setXYZ(1,r.end.x,r.end.y,r.end.z),e.positions.needsUpdate=!0,e.line.geometry.computeBoundingSphere()}function $(e){e.line.removeFromParent(),e.line.geometry.dispose(),e.line.material.dispose()}export{Pe as bindStagePresenceMarkers};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{i as M}from"./stage-invalidation-DBg3C3Ta.js";import{aM as b,aN as T,aO as w}from"./index-GIL7oGEO.js";import{D,C as p,i as E,R as P,j as F,k as R,G as C}from"./three.module-D396a9Mn.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 Y=[.8,.5,-1],x=new p(1975600),y=new p(5004144);function N(){const e=typeof document>"u"?null:document.querySelector("[data-vgai-palette]");if(!e)return{bottom:x.clone(),top:y.clone()};const t=getComputedStyle(e),r=document.createElement("canvas");r.width=r.height=1;const n=r.getContext("2d"),a=(l,f)=>{const u=t.getPropertyValue(l).trim();if(!n||!u||!CSS.supports("color",u))return f.clone();n.fillStyle=f.getStyle(),n.fillRect(0,0,1,1),n.fillStyle=t.getPropertyValue("--vgai-surface-shell").trim(),n.fillRect(0,0,1,1),n.fillStyle=u,n.fillRect(0,0,1,1);const[v,i,m]=n.getImageData(0,0,1,1).data;return new p().setRGB(v/255,i/255,m/255,F)},o=a("--vgai-surface-panel",x),s=a("--vgai-surface-raised",y),g=o.lerp(x,.25).lerp(new p(16777215),.03),d=s.lerp(y,.25).lerp(new p(16777215),.04);return{bottom:g,top:d}}function K(e){if(typeof document>"u"||typeof MutationObserver>"u")return()=>{};const t=document.querySelector("[data-vgai-palette]");if(!t)return()=>{};const r=new MutationObserver(()=>{e(),M()});return r.observe(t,{attributes:!0,attributeFilter:["data-vgai-palette","data-vgai-material"]}),()=>r.disconnect()}function O(e=N()){const r=new Uint8Array(512),n=new p;for(let o=0;o<128;o++)n.copy(e.bottom).lerp(e.top,o/127).convertLinearToSRGB(),r[o*4]=Math.round(n.r*255),r[o*4+1]=Math.round(n.g*255),r[o*4+2]=Math.round(n.b*255),r[o*4+3]=255;const a=new E(r,1,128,P);return a.colorSpace=F,a.magFilter=R,a.minFilter=R,a.needsUpdate=!0,a}function _(e){const t=w(e);if(t.isEmpty())return{size:50,centre:[0,0]};const r=Math.max(t.max.x-t.min.x,t.max.z-t.min.z);return{size:Math.min(Math.max(Math.ceil(r/10)*10+20,50),1e3),centre:[(t.min.x+t.max.x)/2,(t.min.z+t.max.z)/2]}}function k(e){for(const t of[1,2,5,10])if(e/t<=60)return Math.round(e/t);return Math.round(e/10)}function A(e,t){const r=t/2,n=r*.55,a=r;e.onBeforeCompile=o=>{o.uniforms.uGridFadeStart={value:n},o.uniforms.uGridFadeEnd={value:a},o.vertexShader=o.vertexShader.replace("#include <common>",`#include <common>
|
|
2
|
+
varying vec2 vGridPlanePosition;`).replace("#include <begin_vertex>",`#include <begin_vertex>
|
|
3
|
+
vGridPlanePosition = position.xz;`),o.fragmentShader=o.fragmentShader.replace("#include <common>",`#include <common>
|
|
4
|
+
varying vec2 vGridPlanePosition;
|
|
5
|
+
uniform float uGridFadeStart;
|
|
6
|
+
uniform float uGridFadeEnd;`).replace("#include <color_fragment>",`#include <color_fragment>
|
|
7
|
+
diffuseColor.a *= 1.0 - smoothstep(uGridFadeStart, uGridFadeEnd, length(vGridPlanePosition));`)},e.customProgramCacheKey=()=>`vgai-grid-fade:${n}:${a}`}const J=.85;function Q(e,t){const{environment:r,background:n=!0,keyLight:a=!0,grid:o=!1}=t,s=[],g=[];let d=null;if(r&&(e.environment=r.texture),n&&(d=O(),e.background=d),a){const i=new D(16777215,1.9);i.name="vgai:standard-dressing-key",i.position.set(6,10,-4),i.castShadow=!0,b(i,"editorHelper",!0),e.add(i),s.push(i),g.push(i)}let l=null,f="";const u=i=>{if(!o)return;const{size:m,centre:S}=_(i),G=`${m}:${S.join(":")}`;if(G===f)return;f=G,l&&(l.removeFromParent(),l.dispose(),s.splice(s.indexOf(l),1));const c=new C(m,k(m),10066329,10066329);l=c;const h=c.material;h.transparent=!0,h.opacity=.35,h.depthWrite=!1,A(h,m),c.name="vgai:standard-dressing-grid",c.position.set(S[0],-.02,S[1]),c.layers.set(T),b(c,"editorHelper",!0),e.add(c),s.push(c)};u(t.content??e);let v=!1;return{backgroundTexture:d,lights:g,frameContent:u,dispose(){if(!v){v=!0;for(const i of s)i.removeFromParent(),i.dispose?.();r&&(e.environment===r.texture&&(e.environment=null),r.dispose()),d&&(e.background===d&&(e.background=null),d.dispose())}}}}export{Y as STANDARD_COMPONENT_CAMERA_DIRECTION,J as STANDARD_ENVIRONMENT_INTENSITY,A as applyGridDistanceFade,Q as applyStandardViewportDressing,O as createGradientBackgroundTexture,N as paletteBackdropStops,K as watchPaletteBackdrop};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function n(){let t=0;const e=new Set;return{get frameVersion(){return t},subscribe(r){return e.add(r),()=>{e.delete(r)}},bump(){t++;const r=Array.from(e);for(const o of r)try{o()}catch(s){console.error("[state-bridge] subscriber threw:",s)}}}}export{n as createStateBridge};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{q as t}from"./index-GIL7oGEO.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"./three.module-D396a9Mn.js";const l="workspace.action",w=[{id:"state-watch",label:"Open State Watch",execute:()=>t().workspace.showUtility("tool:state-watch.utility")}];export{w as actions,l as point};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{q as t,ap as e}from"./index-GIL7oGEO.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"./three.module-D396a9Mn.js";const n="workspace.menu",d={menu:"debug",items:[{id:"state-watch",label:"State Watch",testId:"menu-state-watch",disabled:()=>e()==null,execute:()=>t().workspace.showUtility("tool:state-watch.utility")}]};export{d as menu,n as point};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as n}from"./jsx-runtime-DPjLkJKQ.js";import{ap as S,ao as o,bo as B,a4 as L,q as A,e6 as H}from"./index-GIL7oGEO.js";import{r as d}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./three.module-D396a9Mn.js";const F=250,M=200,P=500,z="stateWatchPins";function x(e){return JSON.stringify([e.provider,...e.path])}function y(e){return[e.provider,...e.path].join(".")}function D(){return A().projectLocalState.projectRootPath()??"__unscoped__"}function k(e){const t=A().projectLocalState.read(z);return Array.isArray(t)?t.filter(r=>typeof r?.provider=="string"&&Array.isArray(r.path)&&r.path.every(s=>typeof s=="string")):[]}function N(e,t){A().projectLocalState.write(z,t.map(r=>({provider:r.provider,path:[...r.path]})))}function j(e){return e!==null&&typeof e=="object"}function O(e){if(typeof e=="string")return`“${e}”`;if(typeof e=="number")return Number.isInteger(e)?String(e):e.toFixed(3);if(e===void 0)return"undefined";if(e===null)return"null";if(typeof e=="bigint")return`${e}n`;if(typeof e=="function")return"[Function]";if(j(e))try{return Array.isArray(e)?`Array(${e.length})`:`Object(${Object.keys(e).length})`}catch{return"[Unreadable object]"}return String(e)}function _(e){try{return Object.entries(e)}catch{return[]}}function V(e,t){try{if(!Object.hasOwn(e,t.provider))return{available:!1,value:void 0};let r=e[t.provider];for(const s of t.path){if(!j(r)||!Object.hasOwn(r,s))return{available:!1,value:void 0};r=r[s]}return{available:!0,value:r}}catch{return{available:!1,value:void 0}}}function R(e,t,r,s,l,c){if(l.length>=P)return;const g=j(t)&&c.includes(t);if(!j(t)||g){const a={provider:e,path:r,value:g?"[Circular]":t};(y(a).toLowerCase().includes(s)||O(a.value).toLowerCase().includes(s))&&l.push(a);return}const p=[...c,t],m=_(t);if(m.length===0){const a={provider:e,path:r,value:t};y(a).toLowerCase().includes(s)&&l.push(a);return}for(const[a,v]of m)if(R(e,v,[...r,a],s,l,p),l.length>=P)return}const C={fontFamily:o.typography.mono,fontSize:11};function T({leaf:e,pinned:t,onTogglePin:r,depth:s=0}){const l=e.path.at(-1)??e.provider;return n.jsxs("div",{style:{...C,minHeight:22,display:"grid",gridTemplateColumns:"minmax(100px, 0.65fr) minmax(120px, 1fr) auto",alignItems:"center",gap:8,paddingLeft:8+s*14,paddingRight:8,borderBottom:`1px solid ${o.boundary.default}`},title:y(e),children:[n.jsx("span",{style:{color:o.content.primary,overflow:"hidden",textOverflow:"ellipsis"},children:l}),n.jsx("span",{style:{color:o.content.muted,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:O(e.value)}),n.jsx(L,{type:"button",size:"compact",variant:t?"primary":"secondary","aria-pressed":t,title:t?`Remove ${y(e)} from watches`:`Watch ${y(e)}`,onClick:()=>r(e),children:t?"Pinned":"Pin"})]})}function W({provider:e,name:t,value:r,path:s,depth:l,ancestors:c,pinnedKeys:g,onTogglePin:p}){const m=j(r)&&c.includes(r),[a,v]=d.useState(l===0);if(!j(r)||m){const f={provider:e,path:s,value:m?"[Circular]":r};return n.jsx(T,{leaf:f,depth:l,pinned:g.has(x(f)),onTogglePin:p})}const h=_(r),b=h.slice(0,M);return n.jsxs("div",{children:[n.jsxs("button",{type:"button",onClick:()=>v(f=>!f),style:{...C,width:"100%",minHeight:22,display:"flex",alignItems:"center",gap:4,padding:`0 8px 0 ${8+l*14}px`,color:o.content.primary,background:"transparent",border:0,borderBottom:`1px solid ${o.boundary.default}`,textAlign:"left",cursor:"pointer"},children:[n.jsx("span",{style:{width:12,color:o.content.muted},children:n.jsx(H,{direction:a?"down":"right"})}),n.jsx("span",{children:t}),n.jsx("span",{style:{color:o.content.dim},children:Array.isArray(r)?`[${h.length}]`:`{${h.length}}`})]}),a&&b.map(([f,i])=>n.jsx(W,{provider:e,name:f,value:i,path:[...s,f],depth:l+1,ancestors:[...c,r],pinnedKeys:g,onTogglePin:p},f)),a&&h.length>b.length&&n.jsxs("div",{style:{...C,padding:`3px 8px 3px ${8+(l+1)*14}px`,color:o.content.dim},children:[h.length-b.length," more values — narrow with search"]})]})}function E(e){if(!e)return{providers:[],state:{},error:null};let t;try{t=e.providers()}catch(r){return{providers:[],state:{},error:r instanceof Error?r.message:String(r)}}try{return{providers:t,state:e.stateAll(),error:null}}catch(r){return{providers:t,state:{},error:r instanceof Error?r.message:String(r)}}}function U(){const e=D(),[t,r]=d.useState(()=>E(S())),[s,l]=d.useState(!1),[c,g]=d.useState(""),[p,m]=d.useState(()=>k());d.useEffect(()=>m(k()),[e]);const a=d.useCallback(()=>r(E(S())),[]);d.useEffect(()=>{if(a(),s)return;const i=window.setInterval(a,F);return()=>window.clearInterval(i)},[s,a]);const v=d.useMemo(()=>new Set(p.map(x)),[p]),h=d.useCallback(i=>{m(u=>{const w=x(i),I=u.some($=>x($)===w)?u.filter($=>x($)!==w):[...u,{provider:i.provider,path:[...i.path]}];return N(e,I),I})},[e]),b=d.useMemo(()=>{const i=c.trim().toLowerCase();if(!i)return[];const u=[];for(const w of t.providers)R(w.name,t.state[w.name],[],i,u,[]);return u},[c,t]);return S()?n.jsxs("div",{style:{height:"100%",minHeight:0,display:"flex",flexDirection:"column"},children:[n.jsxs("div",{style:{minHeight:34,display:"flex",alignItems:"center",gap:8,padding:"4px 8px",borderBottom:`1px solid ${o.boundary.default}`},children:[n.jsx(B,{value:c,onChange:i=>g(i.target.value),placeholder:"Filter state paths or values…","aria-label":"Filter state watches",style:{width:240}}),n.jsx(L,{type:"button",size:"compact",onClick:()=>l(i=>!i),children:s?"Resume":"Pause"}),n.jsx(L,{type:"button",size:"compact",disabled:!s,onClick:a,children:"Refresh"}),n.jsxs("span",{style:{color:o.content.dim,fontSize:10},children:[t.providers.length," provider",t.providers.length===1?"":"s"," ·"," ",p.length," pinned",s?" · paused":""]}),t.error&&n.jsx("span",{style:{color:o.semantic.danger,fontSize:10},children:t.error})]}),n.jsxs("div",{style:{flex:1,minHeight:0,display:"grid",gridTemplateColumns:"minmax(280px, 1fr) minmax(240px, 0.65fr)"},children:[n.jsxs("section",{"aria-label":"Live state",style:{minWidth:0,overflow:"auto"},children:[c.trim()?b.length>0?b.map(i=>n.jsx(T,{leaf:i,pinned:v.has(x(i)),onTogglePin:h},x(i))):n.jsxs("div",{style:{padding:10,color:o.content.dim,fontSize:11},children:["No state values match “",c.trim(),"”."]}):t.providers.map(i=>n.jsx(W,{provider:i.name,name:`${i.name} · ${i.tier}`,value:t.state[i.name],path:[],depth:0,ancestors:[],pinnedKeys:v,onTogglePin:h},i.name)),t.providers.length===0&&n.jsx("div",{style:{padding:10,color:o.content.dim,fontSize:11},children:"The running game has not registered any state providers."})]}),n.jsxs("aside",{"aria-label":"Pinned watches",style:{minWidth:0,overflow:"auto",borderLeft:`1px solid ${o.boundary.default}`},children:[n.jsx("div",{style:{position:"sticky",top:0,zIndex:1,padding:"6px 8px",color:o.content.muted,background:o.surface.panel,borderBottom:`1px solid ${o.boundary.default}`,fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.04em"},children:"Watches"}),p.map(i=>{const u=V(t.state,i);return n.jsxs("div",{style:{...C,display:"grid",gridTemplateColumns:"minmax(130px, 1fr) minmax(100px, 0.7fr) auto",alignItems:"center",gap:8,minHeight:24,padding:"2px 8px",borderBottom:`1px solid ${o.boundary.default}`},children:[n.jsx("span",{title:y(i),style:{color:o.content.primary,overflow:"hidden",textOverflow:"ellipsis"},children:y(i)}),n.jsx("span",{style:{color:u.available?o.content.muted:o.content.dim,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:u.available?O(u.value):"unavailable"}),n.jsx(L,{type:"button",size:"compact",onClick:()=>h(i),children:"Remove"})]},x(i))}),p.length===0&&n.jsx("div",{style:{padding:10,color:o.content.dim,fontSize:11},children:"Pin values from the live tree to keep them visible while you inspect the game."})]})]})]}):n.jsx("div",{style:{padding:12,color:o.content.muted,fontSize:11},children:"State Watch is available while a game with debug providers is running."})}const re="workspace.utility",ne="State Watch",ie=19,oe=()=>S()!=null;function se(){return n.jsx(U,{})}export{oe as available,se as default,ie as order,re as point,ne as title};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const h=500,R=.5,E=.4,m=120;function o(t){return t.toLocaleString("en-US")}function b(t){const{drawCalls:e,census:u,structural:r}=t;if(e===null||e<500)return null;const{collapsible:n}=r;if(n<e*.5)return null;const i=new Set(u.subtrees.map(A=>A.name)),s=r.bySubtree[0],a=s&&s.collapsible>=n*.4&&i.has(s.name)?s.name:null,l=a===null?"<Frozen>":`<Frozen name="${a}">`,d=a===null?"spread across the scene":`mostly under "${a}"`,S=`[static-batch] ~${o(n)} of ${o(e)} draw calls are the same handful of draws repeated (${o(r.familyCount)} structural families), ${d}. If that scenery is mount-static — nothing under it moves, re-colours or unmounts after mount — one wrapper collapses it to a few draws: wrap it in ${l}…</Frozen> (vgai add static-batch). Reactive scenery goes outside the wrapper, and a subtree that must stay unbatched declares it: userData={{ staticBatch: false }}.`;return{drawCalls:e,collapsible:n,subtree:a,fix:l,message:S}}const c="__vgaiStaticBatchAdvised";function _(){return globalThis[c]===!0}function f(t){console.warn(t)}function L(t,e=f){return _()?!1:(globalThis[c]=!0,e(t.message),!0)}function p(){globalThis[c]=void 0}export{R as ADVISOR_COLLAPSIBLE_SHARE,h as ADVISOR_DRAW_CALL_THRESHOLD,m as ADVISOR_SETTLE_FRAMES,E as ADVISOR_SUBTREE_SHARE,p as __resetStaticBatchAdvisoryForTest,b as decideStaticBatchAdvisory,L as warnStaticBatchAdvisory};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var P=function(){var m=0,a=document.createElement("div");a.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",a.addEventListener("click",function(n){n.preventDefault(),o(++m%a.children.length)},!1);function i(n){return a.appendChild(n.dom),n}function o(n){for(var l=0;l<a.children.length;l++)a.children[l].style.display=l===n?"block":"none";m=n}var f=(performance||Date).now(),r=f,e=0,u=i(new P.Panel("FPS","#0ff","#002")),v=i(new P.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var h=i(new P.Panel("MB","#f08","#201"));return o(0),{REVISION:16,dom:a,addPanel:i,showPanel:o,begin:function(){f=(performance||Date).now()},end:function(){e++;var n=(performance||Date).now();if(v.update(n-f,200),n>=r+1e3&&(u.update(e*1e3/(n-r),100),r=n,e=0,h)){var l=performance.memory;h.update(l.usedJSHeapSize/1048576,l.jsHeapSizeLimit/1048576)}return n},update:function(){f=this.end()},domElement:a,setMode:o}};P.Panel=function(m,a,i){var o=1/0,f=0,r=Math.round,e=r(window.devicePixelRatio||1),u=80*e,v=48*e,h=3*e,n=2*e,l=3*e,c=15*e,d=74*e,s=30*e,p=document.createElement("canvas");p.width=u,p.height=v,p.style.cssText="width:80px;height:48px";var t=p.getContext("2d");return t.font="bold "+9*e+"px Helvetica,Arial,sans-serif",t.textBaseline="top",t.fillStyle=i,t.fillRect(0,0,u,v),t.fillStyle=a,t.fillText(m,h,n),t.fillRect(l,c,d,s),t.fillStyle=i,t.globalAlpha=.9,t.fillRect(l,c,d,s),{dom:p,update:function(x,T){o=Math.min(o,x),f=Math.max(f,x),t.fillStyle=i,t.globalAlpha=1,t.fillRect(0,0,u,c),t.fillStyle=a,t.fillText(r(x)+" "+m+" ("+r(o)+"-"+r(f)+")",h,n),t.drawImage(p,l+e,c,d-e,s,l,c,d-e,s),t.fillRect(l+d-e,c,e,s),t.fillStyle=i,t.globalAlpha=.9,t.fillRect(l+d-e,c,e,r((1-x/T)*s))}}};export{P as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function p(r,n){return Object.entries(r).flatMap(([o,t])=>{if(typeof t=="function"||typeof t=="symbol"||t===void 0)return[];const e=typeof t=="boolean"?"boolean":typeof t=="number"?"number":typeof t=="string"?"string":"json";return[{path:`${n}${o}`,label:o,type:e,group:"Args"}]})}export{p as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as T}from"./react-story-board-BDDwiE2H.js";import{bF as S,bG as P,ax as C,bH as $,bI as M,bJ as E,bK as j,$ as v,bL as I,bM as R,bN as D,aF as L,ay as O}from"./index-GIL7oGEO.js";import{m as A}from"./StoryPreviewMount-DjyxRCXu.js";import{awaitPixiStoryFrame as U}from"./story-pixi-preview-BUrOJZXS.js";import{s as k}from"./story-presentation-j2AVN-mK.js";import{supportsThreeStoryCapture as B,captureStoryComponentThumbnail as H,isStoryThreeClassificationRefusal as N}from"./story-three-preview-BHEDZzcl.js";import"./jsx-runtime-DPjLkJKQ.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-nmcBqr7Y.js";import"./index-D_NuPfjr.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./three.module-D396a9Mn.js";import"./crash-null-boundary-v3a0uEgw.js";import"./pixi-story-model-DNkfnWUV.js";import"./story-mount-turn-DFRTj5hi.js";import"./events-156d8d12.esm-ErOhDXXB.js";import"./index-bQE2NA0D.js";async function dt(s,o){await S();const a=O(),c=P().filter(t=>C({modulePath:t.modulePath,regions:a}).medium==="dom"),e=document.createElement("canvas");e.width=s,e.height=o;const l=e.getContext("2d");if(!l)throw new Error("UI Canvas preview could not create a 2D output context.");if(c.length===0)return e.toDataURL("image/png");const m=k(c),u=L()?.config.resolution,p={width:u?.width??640,height:u?.height??400},h=new Map,f=new Map;for(const t of c){const n=m.resolve(t,p),[y]=await x(t.modulePath,[t],{width:n.width,height:n.height,capture:v,cropToContent:n.layout!=="fullscreen",layout:n.layout,transparent:!0});if(!y)throw new Error(`No preview rendered for ${t.id}.`);const g=new Image;g.src=`data:${y.mimeType};base64,${y.base64}`,await g.decode(),h.set(t.id,g),f.set(t.id,{width:g.naturalWidth,height:g.naturalHeight})}const i=T(c,m.index,t=>f.get(t.id)),r=Math.min(s/i.width,o/i.height),w=(s-i.width*r)/2,d=(o-i.height*r)/2;for(const[t,n]of i.layouts)l.drawImage(h.get(t),w+n.x*r,d+n.y*r,n.width*r,n.height*r);return e.toDataURL("image/png")}const F="#ffffff",W="#14171c";async function ut(s,o){const{modulePath:a,width:c,height:e}=o;if(!s)throw new Error(`No project is open, so '${a}' cannot be loaded. Open the project first.`);const l=await $(s),m=l.find(d=>d.modulePath===a);if(!m)throw new Error(`'${a}' is not a story file of this project. `+(l.length===0?"This project has no *.stories.tsx / *.stories.ts under src/.":`This project's story files are: ${l.map(d=>d.modulePath).join(", ")}.`));await M(await E(s));let u;try{u=await m.load()}catch(d){throw new Error(`'${a}' failed to import — ${d instanceof Error?d.message:String(d)}`)}const p=await j(a,u);if(!p.ok)throw new Error(p.error);const h=_(a,p.stories,o.story),f=o.capture??v,i=o.captureThree??(B()?(d,t)=>H(d,{...t,...o.camera===void 0?{}:{camera:o.camera},...o.pose===void 0?{}:{pose:o.pose}}):void 0);if((o.camera||o.pose)&&!i)throw new Error(`'${a}': camera/clip parameters need the three capture leg, which this environment cannot provide (no WebGL).`);const r=await x(a,h,{width:c,height:e,capture:f,...i?{captureThree:i}:{},requireThree:!!(o.camera||o.pose)}),w=await G(r,c,e);return{modulePath:a,width:c,height:e,variants:r,contactSheet:w}}function _(s,o,a){if(a===void 0)return o;const c=o.find(e=>e.name===a);if(!c)throw new Error(`'${s}' exports no story named '${a}'. It exports: ${o.map(e=>e.name).join(", ")}.`);return[c]}async function x(s,o,a){const{width:c,height:e,capture:l,captureThree:m,requireThree:u,cropToContent:p=!0}=a,h=document.createElement("div");h.setAttribute("style",`position:fixed;left:-20000px;top:0;width:${c}px;height:${e}px;overflow:hidden;contain:strict;pointer-events:none;background:${a.transparent?"transparent":F};`),document.body.appendChild(h);const f=[];try{for(const i of o){if(m){const t=await m(i.Component,{width:c,height:e}).catch(n=>(N(n)||console.warn(`[story-capture] three mount for '${i.name}' failed — falling back to the DOM leg:`,n instanceof Error?n.stack??n.message:String(n)),null));if(t===null&&u)throw new Error(`story '${i.name}' did not render on the three leg — --azimuth/--elevation/--distance/--clip/--time apply to three (R3F) stories only, and falling back to the DOM leg would silently ignore them. Narrow to a three story with --story <export>, or drop the camera/clip flags.`);if(t!==null){const n=t.indexOf(",");f.push({name:i.name,label:i.label,base64:n>=0?t.slice(n+1):t,mimeType:"image/png"});continue}}const r=document.createElement("div");r.setAttribute("style",`position:relative;width:${c}px;height:${e}px;overflow:hidden;`),a.layout==="padded"&&(r.style.padding="16px"),a.layout==="centered"&&(r.style.display="flex",r.style.alignItems="center",r.style.justifyContent="center"),r.style.boxSizing="border-box",h.replaceChildren(r);let w=[];const d=await R(async t=>{w=t;const n=await A(r,s,i.name,i.Component);return await z(r),await U(t),n});try{const t=await l(h,{canvasFrame:D(w),cropToContent:p,...a.transparent?{allowTransparent:!0}:{}});f.push({name:i.name,label:i.label,base64:t.base64,mimeType:"image/png"})}finally{d?.unmount(),await new Promise(t=>setTimeout(t,0)),r.remove()}}}finally{h.remove()}return f}async function z(s,o=10){for(let e=0;e<o&&!(s.childNodes.length>0);e++)await new Promise(l=>setTimeout(l,0));if(s.childNodes.length===0)return;const a=200,c=5e3;await new Promise(e=>{let l=null,m=!1;const u=new MutationObserver(()=>{l!==null&&clearTimeout(l),l=setTimeout(h,a)}),p=setTimeout(h,c);function h(){m||(m=!0,u.disconnect(),l!==null&&clearTimeout(l),clearTimeout(p),e())}u.observe(s,{subtree:!0,childList:!0,attributes:!0,characterData:!0}),l=setTimeout(h,a)})}async function G(s,o,a,c={}){const e=Math.min(Math.max(1,s.length),Math.max(1,Math.floor(c.columns??2))),l=Math.max(1,Math.ceil(s.length/e)),m=[];for(const t of s){const n=new Image;n.src=`data:${t.mimeType};base64,${t.base64}`,await n.decode(),m.push(n)}const u=Math.max(1,...m.map(t=>t.naturalWidth),m.length?0:o),p=Math.max(1,...m.map(t=>t.naturalHeight),m.length?0:a),h=u*e,f=p*l,i=document.createElement("canvas");i.width=h,i.height=f;const r=i.getContext("2d");if(!r)throw new Error("Unable to create the story variant sheet.");r.fillStyle=W,r.fillRect(0,0,h,f);for(const[t,n]of s.entries()){const y=t%e*u,g=Math.floor(t/e)*p,b=m[t];r.drawImage(b,y+Math.floor((u-b.naturalWidth)/2),g+Math.floor((p-b.naturalHeight)/2)),c.labels!==!1&&I(r,n.name.toUpperCase(),y,g,u,p)}const w=i.toDataURL("image/png"),d=w.indexOf(",");return{width:h,height:f,base64:d>=0?w.slice(d+1):w,mimeType:"image/png"}}export{dt as captureDomStoryBoardPreview,ut as captureProjectStoryVariants,G as composeVariantSheet,x as renderStoryVariants};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/axe-LkjAB6Lv.js","assets/_commonjsHelpers-D6-XlEtG.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{es as ie,e7 as se,b2 as ae,et as ce,eu as le,ev as K,ew as F,af as H,e9 as de,av as L,aw as P,ao as i,dP as u,dR as d,a4 as I,dV as ue,aV as ye,bo as G,_ as pe,ex as fe,ax as me,ay as he,ey as Q,ez as ve,eA as ge,eB as xe,bF as J,eC as X,aF as Se}from"./index-GIL7oGEO.js";import{a as r}from"./jsx-runtime-DPjLkJKQ.js";import{r as l}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{R as we}from"./ResolutionPicker-C67vs1F3.js";import{e as Z,S as q}from"./surface-state-DaxyruCj.js";import{m as ee,r as be}from"./StoryPreviewMount-DjyxRCXu.js";import{d as te}from"./surface-content-Dg9Kkazf.js";import{fitPresentation as je}from"./presentation-BPP5pXeQ.js";const Re=ie,y=new Map;let oe=0;const M=new Set;function m(){oe++;for(const t of M)t()}function E(t){return M.add(t),()=>{M.delete(t)}}function O(){return oe}function Ee(t,e){return`story:${t}#${e}`}function Oe(t,e){return`story-docs:${t}#${e}`}function z(){const t=K();if(!t||t.descriptor.kind!=="story")return null;const e=y.get(t.descriptor.id);return e?.mode==="preview"?{...e,id:t.descriptor.id}:null}function U(t,e,o){const n=y.get(t);if(n){if(o===void 0){const s={...n.argOverrides};delete s[e],n.argOverrides=s}else n.argOverrides={...n.argOverrides,[e]:o};m()}}function Ce(t,e,o){const n=y.get(t);n&&(n.actionLog=[...n.actionLog,{name:e,args:o,time:Date.now()}].slice(-200),m())}function Ne(t){const e=y.get(t);!e||e.actionLog.length===0||(e.actionLog=[],m())}function re(t,e,o,n={}){He();const s=Ee(e,o);y.has(s)||(y.set(s,{modulePath:e,storyName:o,mode:"preview",store:t,argOverrides:{},actionLog:[],playResult:null,accessibility:{status:"idle",violations:[]},container:null,previewReady:!1,previewRevision:0,resolution:{label:"Fill",width:null,height:null},scale:1}),m());const a=n.activate===void 0?{}:{activate:n.activate};return X({id:s,title:n.title??o,kind:"story",workspaceRole:"authored-subject",provenance:{sourcePath:e},Content:Pe,Toolbar:ze,closeable:!0,presentation:()=>({kind:"story",modulePath:e,storyName:o,mode:"preview"}),persist:()=>({modulePath:e,storyName:o}),onActivate:()=>t.setActiveViewportTab("edit"),onDispose:p=>{y.delete(p)&&m()}},a)}function V(t,e,o){const n=Oe(e,o);return y.has(n)||(y.set(n,{modulePath:e,storyName:o,mode:"docs",store:t,argOverrides:{},actionLog:[],playResult:null,accessibility:{status:"idle",violations:[]},container:null,previewReady:!1,previewRevision:0,resolution:{label:"Fill",width:null,height:null},scale:1}),m()),X({id:n,title:`${o} — Docs`,kind:"story",workspaceRole:"workspace-reference",provenance:{sourcePath:e},Content:_e,closeable:!0,presentation:()=>({kind:"story",modulePath:e,storyName:o,mode:"docs"}),persist:()=>({modulePath:e,storyName:o,view:"docs"}),onActivate:()=>t.setActiveViewportTab("edit"),onDispose:s=>{y.delete(s)&&m()}})}function ke(){const t=Se();return t?xe(t).then(J,J):Promise.resolve()}fe({kind:"story",owner:"story-documents",prepare:ke,restore:({state:t,store:e})=>{const o=t,n=typeof o?.modulePath=="string"?o.modulePath:null,s=typeof o?.storyName=="string"?o.storyName:null;if(!n||!s)return!1;const a=P().find(c=>c.modulePath===n);if(!a?.ok||!a.stories.some(c=>c.name===s))return!1;if(o?.view==="docs")return V(e,n,s),!0;const{medium:p}=me({modulePath:n,regions:he()});return p!=="dom"&&p!=="canvas"?!1:(re(e,n,s),!0)}});Q({id:ve,owner:"story-documents",open:(t,e)=>re(t,e.modulePath,e.storyName,{...e.title===void 0?{}:{title:e.title},...e.activate===void 0?{}:{activate:e.activate}})});Q({id:ge,owner:"story-documents",open:(t,e)=>V(t,e.modulePath,e.storyName)});function W(t,e){const o=P().find(n=>n.modulePath===t);return o?o.ok?{story:o.stories.find(n=>n.name===e),moduleError:void 0}:{story:void 0,moduleError:o.error}:{story:void 0,moduleError:void 0}}function ne(t){const e=t.Component.args;return e&&typeof e=="object"?e:{}}function Te(t,e){const o=y.get(t),n={};for(const[s,a]of Object.entries(ne(e)))typeof a=="function"&&(n[s]=(...p)=>(Ce(t,s,p),a(...p)));return{...n,...o?.argOverrides??{}}}function Pe({documentId:t}){l.useSyncExternalStore(E,O),l.useSyncExternalStore(L,()=>P());const e=y.get(t),o=l.useRef(null),n=l.useRef(null),[s,a]=l.useState(!1),[p,c]=l.useState("unknown"),[g,w]=l.useState(null),[$,D]=l.useState({width:0,height:0}),{story:b,moduleError:x}=e?W(e.modulePath,e.storyName):{story:void 0,moduleError:void 0},h=e?JSON.stringify(e.argOverrides):"";l.useEffect(()=>{const f=o.current;if(!f)return;if(typeof ResizeObserver>"u"){D({width:f.clientWidth,height:f.clientHeight});return}const j=new ResizeObserver(([R])=>{if(!R)return;const{width:_,height:k}=R.contentRect;D(T=>T.width===_&&T.height===k?T:{width:_,height:k})});return j.observe(f),()=>j.disconnect()},[]),l.useEffect(()=>{const f=n.current;if(!f||!e)return;e.container!==f&&(e.container=f,m());const j=e.previewRevision+1;if(e.previewRevision=j,e.previewReady=!1,e.playResult=null,e.accessibility={status:"idle",violations:[]},m(),c("unknown"),w(null),!b){a(!1),c("empty");return}let R=!1,_,k;const T=()=>{R||c(te(f)?"present":"empty")},Y=new MutationObserver(T);return Y.observe(f,{childList:!0,subtree:!0,characterData:!0}),a(!0),ee(f,e.modulePath,e.storyName,b.Component,Te(t,b)).then(S=>{if(R){S?.unmount();return}if(!S){y.get(t)?.previewRevision===j&&(a(!1),c("empty"));return}const B=y.get(t);if(!B||B.previewRevision!==j){S.unmount();return}_=S.unmount,B.previewReady=!0,a(!1),k=setTimeout(T,0),m()},S=>{R||y.get(t)?.previewRevision!==j||(a(!1),w(S instanceof Error?S.message:String(S)),c("empty"))}),()=>{R=!0,Y.disconnect(),k!==void 0&&clearTimeout(k),_?.()}},[t,e,b,h]);const C=e?.resolution.width===null,v=!e||C?1:je($,{width:e.resolution.width,height:e.resolution.height}).scale;if(l.useEffect(()=>{!e||!Number.isFinite(v)||v<=0||e.scale===v||(e.scale=v,m())},[v,e]),!e)return r.jsx("div",{style:{padding:u[6],fontSize:d.md,color:i.content.muted,pointerEvents:"auto"},children:"This story document is no longer available."});const N=`${e.modulePath}#${e.storyName}`,A=b?g?{tone:"error",title:`Story ${N} failed`,description:g}:Z({surface:"Story",rootIds:[N],phase:s?"loading":"ready",content:p}):{tone:"error",title:`Story ${N} is unavailable`,description:x??`No story export named “${e.storyName}” exists in ${e.modulePath}; it may have been renamed or removed.`};return r.jsx("div",{style:{flex:1,minHeight:0,display:"flex",flexDirection:"column",pointerEvents:"auto"},children:r.jsx("div",{ref:o,style:{position:"relative",flex:1,minHeight:0,overflow:"auto",display:"flex",alignItems:"center",justifyContent:"center"},children:r.jsxs("div",{style:C?{position:"absolute",inset:0}:{position:"relative",width:e.resolution.width*v,height:e.resolution.height*v,flex:"0 0 auto"},children:[r.jsx("div",{"data-testid":"story-preview-root",ref:n,style:{position:"absolute",inset:0,isolation:"isolate",contain:"layout paint",overflow:"auto",background:i.surface.inset,...C?{}:{width:e.resolution.width,height:e.resolution.height,transform:`scale(${v})`,transformOrigin:"top left"}}}),r.jsx(q,{explanation:A,testId:"story-surface-status"})]})})})}function De(t){const e=t.parameters.docs;if(!e||typeof e!="object")return{};const o=e.description;if(typeof o=="string")return{story:o};if(!o||typeof o!="object")return{};const n=o;return{...typeof n.component=="string"?{component:n.component}:{},...typeof n.story=="string"?{story:n.story}:{}}}function _e({documentId:t}){l.useSyncExternalStore(E,O),l.useSyncExternalStore(L,()=>P());const e=y.get(t),o=l.useRef(null),[n,s]=l.useState("unknown"),[a,p]=l.useState(null),{story:c,moduleError:g}=e?W(e.modulePath,e.storyName):{story:void 0,moduleError:void 0};if(l.useEffect(()=>{const x=o.current;if(!x||!e||!c)return;let h=!1,C=null,v;s("unknown"),p(null);const N=()=>{h||s(te(x)?"present":"empty")},A=new MutationObserver(N);return A.observe(x,{childList:!0,subtree:!0,characterData:!0}),ee(x,e.modulePath,e.storyName,c.Component).then(f=>{if(!f){h||s("empty");return}h?f.unmount():(C=f.unmount,v=setTimeout(N,0))},f=>{h||(p(f instanceof Error?f.message:String(f)),s("empty"))}),()=>{h=!0,A.disconnect(),v!==void 0&&clearTimeout(v),C?.()}},[e,c]),!e||!c)return r.jsx("div",{style:{padding:u[8],color:i.semantic.danger,fontSize:d.md},children:g??"This Storybook Docs document is no longer available."});const w=De(c),$=c.args,D=`${e.modulePath}#${e.storyName}`,b=a?{tone:"error",title:`Story ${D} failed`,description:a}:Z({surface:"Story",rootIds:[D],phase:n==="unknown"?"loading":"ready",content:n});return r.jsx("article",{"data-testid":"story-docs-document",className:"vgai-content-frost",style:{flex:1,minHeight:0,overflow:"auto",pointerEvents:"auto",padding:"24px clamp(18px, 5vw, 64px)"},children:r.jsxs("div",{style:{maxWidth:920,margin:"0 auto",display:"flex",flexDirection:"column",gap:22},children:[r.jsxs("header",{children:[r.jsx("div",{style:{color:i.content.dim,fontSize:d.base,marginBottom:5},children:c.title??e.modulePath}),r.jsx("h1",{style:{color:i.content.primary,fontSize:d.heading,margin:0},children:c.label}),(w.story??w.component)&&r.jsx("p",{style:{color:i.content.primary,lineHeight:1.6,maxWidth:760,whiteSpace:"pre-wrap"},children:w.story??w.component})]}),r.jsxs("section",{children:[r.jsx("h2",{style:{color:i.content.primary,fontSize:d.xl},children:"Canvas"}),r.jsxs("div",{style:{position:"relative",minHeight:180},children:[r.jsx("div",{ref:o,"data-testid":"story-docs-canvas",style:{position:"relative",isolation:"isolate",contain:"layout paint",minHeight:180,padding:18,overflow:"auto",background:i.surface.inset,border:`1px solid ${i.boundary.default}`,borderRadius:i.shape.medium}}),r.jsx(q,{explanation:b,testId:"story-docs-surface-status"})]})]}),r.jsxs("section",{children:[r.jsx("h2",{style:{color:i.content.primary,fontSize:d.xl},children:"Args"}),r.jsxs("div",{style:{border:`1px solid ${i.boundary.default}`,borderRadius:i.shape.medium,overflow:"hidden"},children:[Object.entries($).map(([x,h])=>r.jsxs("div",{style:{display:"grid",gridTemplateColumns:"minmax(120px, .4fr) minmax(140px, .6fr) 1fr",gap:u[6],padding:`${u[4]} ${u[5]}`,borderBottom:`1px solid ${i.boundary.default}`,fontSize:d.base},children:[r.jsx("code",{style:{color:i.accent.default},children:x}),r.jsx("span",{style:{color:i.content.muted},children:Array.isArray(h)?"array":typeof h}),r.jsx("code",{style:{color:i.content.primary,overflow:"hidden",textOverflow:"ellipsis"},children:typeof h=="function"?"function":JSON.stringify(h)})]},x)),Object.keys($).length===0&&r.jsx("div",{style:{padding:u[5],color:i.content.dim,fontSize:d.base},children:"This story declares no args."})]})]}),r.jsxs("footer",{style:{color:i.content.dim,fontSize:d.sm},children:[e.modulePath," · ",e.storyName]})]})})}function ze({documentId:t}){l.useSyncExternalStore(E,O),l.useSyncExternalStore(L,()=>P());const e=y.get(t);if(!e)return null;const{story:o}=W(e.modulePath,e.storyName),n=typeof o?.Component.play=="function",s=e.playResult;return r.jsxs("div",{"data-testid":"story-document-toolbar",style:{display:"flex",alignItems:"center",gap:u[4],padding:"3px 10px",fontSize:d.sm,color:i.content.muted,borderBottom:`1px solid ${i.boundary.default}`},children:[r.jsxs("span",{style:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:[e.modulePath," —"," ",r.jsx("code",{style:{color:i.accent.default},children:e.storyName})]}),r.jsx(we,{resolution:e.resolution,scale:e.scale,onResolutionChange:a=>{e.resolution=a,m()}}),r.jsx(I,{size:"compact","data-testid":"story-open-docs",onClick:()=>V(e.store,e.modulePath,e.storyName),style:{flexShrink:0},children:"Docs"}),n&&o&&r.jsx(I,{variant:"outline",size:"compact","data-testid":"story-run-play",onClick:async()=>{if(!e.container||!e.previewReady)return;const a=e.previewRevision,p=await be(e.modulePath,e.storyName,o.Component,e.container),c=y.get(t);c?.previewReady&&c.previewRevision===a&&(c.playResult=p,m())},disabled:!e.previewReady,style:{flexShrink:0},children:"Run play()"}),s?.ran&&!s.error&&r.jsx("span",{"data-testid":"story-play-result",style:{color:i.semantic.success,fontWeight:600},children:"play() ran"}),s?.error&&r.jsx("span",{"data-testid":"story-play-result",style:{color:i.semantic.danger},children:s.error})]})}function $e({id:t,name:e,value:o}){return r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:u[3],padding:"3px 0"},children:[r.jsx("span",{style:{width:90,flexShrink:0,fontSize:d.base,color:i.content.muted,overflow:"hidden",textOverflow:"ellipsis"},title:e,children:e}),typeof o=="boolean"?r.jsx(ye,{className:"vgai-checkbox","data-testid":`story-arg-${e}`,checked:o,onChange:n=>U(t,e,n.target.checked)}):typeof o=="number"?r.jsx(G,{type:"number",className:"vgai-input","data-testid":`story-arg-${e}`,value:o,onChange:n=>{const s=n.target.value,a=Number.parseFloat(s);U(t,e,s===""||Number.isNaN(a)?void 0:a)},style:{width:80}}):typeof o=="string"?r.jsx(G,{type:"text",className:"vgai-input","data-testid":`story-arg-${e}`,value:o,onChange:n=>U(t,e,n.target.value),style:{flex:1,minWidth:0}}):r.jsx("span",{style:{fontSize:d.base,color:i.content.dim},"data-testid":`story-arg-${e}`,children:typeof o=="function"?"fn (logged to Actions)":JSON.stringify(o)})]})}function Ae(){l.useSyncExternalStore(E,O),l.useSyncExternalStore(L,()=>P());const t=z();if(!t)return null;const{story:e}=W(t.modulePath,t.storyName),o=e?{...ne(e),...t.argOverrides}:{},n=Object.keys(o);return r.jsxs("div",{"data-testid":"inspector-story-args",style:{pointerEvents:"auto",padding:u[4],borderBottom:`1px solid ${i.boundary.default}`},children:[r.jsx("div",{style:{fontSize:d.base,color:i.content.dim,textTransform:"uppercase",marginBottom:u[2]},children:"Story Args"}),r.jsx("div",{style:{fontSize:d.base,color:i.content.primary,fontWeight:600,marginBottom:u[2]},children:t.storyName}),n.length===0&&r.jsx("div",{style:{fontSize:d.base,color:i.content.dim},children:e?"This story declares no args.":"Story source unavailable."}),n.map(s=>r.jsx($e,{id:t.id,name:s,value:o[s]},s))]})}function Ie(){l.useSyncExternalStore(E,O);const t=z();return t?r.jsxs("div",{"data-testid":"story-actions-utility",style:{flex:1,minHeight:0,overflowY:"auto",padding:u[4],fontSize:d.base},children:[r.jsx(I,{size:"compact",style:{marginBottom:u[3]},onClick:()=>Ne(t.id),children:"Clear"}),t.actionLog.length===0?r.jsx("div",{style:{color:i.content.dim},children:"No actions logged — function-valued args are wrapped with logging spies; interact with the story preview to see calls here."}):t.actionLog.map((e,o)=>r.jsxs("div",{style:{padding:`${u[1]} 0`,borderBottom:`1px solid ${i.boundary.default}`},children:[r.jsx("code",{style:{color:i.accent.default},children:e.name})," ",r.jsxs("span",{style:{color:i.content.muted},children:["(",e.args.map(n=>{try{return typeof n=="object"?JSON.stringify(n)?.slice(0,80):String(n)}catch{return String(n)}}).join(", "),")"]})]},o))]}):r.jsx("div",{style:{padding:u[6],fontSize:d.md,color:i.content.dim},children:"No active story."})}function Le(){l.useSyncExternalStore(E,O);const t=z();if(!t)return r.jsx("div",{style:{padding:u[6],fontSize:d.md,color:i.content.dim},children:"No active story."});const e=t.playResult;return r.jsxs("div",{"data-testid":"story-interactions-utility",style:{flex:1,minHeight:0,overflowY:"auto",padding:u[6],fontSize:d.md},children:[!e&&r.jsx("div",{style:{color:i.content.dim},children:"No interaction run yet — use the story document's “Run play()”."}),e&&!e.ran&&r.jsx("div",{style:{color:i.content.dim},children:"This story declares no play() function."}),e?.ran&&!e.error&&r.jsx("div",{style:{color:i.semantic.success,fontWeight:600},children:"play() ran without errors."}),e?.error&&r.jsx("div",{style:{color:i.semantic.danger,whiteSpace:"pre-wrap"},children:e.error})]})}async function We(t){const e=y.get(t);if(!e?.container||!e.previewReady)return;const o=e.container,n=e.previewRevision;e.accessibility={status:"running",violations:[]},m();try{const a=await(await pe(async()=>{const{default:c}=await import("./axe-LkjAB6Lv.js").then(g=>g.a);return{default:c}},__vite__mapDeps([0,1]))).default.run(o),p=y.get(t);if(!p?.previewReady||p.previewRevision!==n||p.container!==o)return;p.accessibility={status:"complete",violations:a.violations.map(c=>({id:c.id,impact:c.impact??null,help:c.help,helpUrl:c.helpUrl,nodes:c.nodes.map(g=>({html:g.html,target:g.target.map(String)}))}))},m()}catch(s){const a=y.get(t);if(!a?.previewReady||a.previewRevision!==n||a.container!==o)return;a.accessibility={status:"error",violations:[],error:s instanceof Error?s.message:String(s)},m()}}function Be(){l.useSyncExternalStore(E,O);const t=z();if(!t)return r.jsx("div",{style:{padding:u[6],fontSize:d.md,color:i.content.dim},children:"No active story."});const e=t.accessibility;return r.jsxs("div",{"data-testid":"story-accessibility-utility",style:{flex:1,minHeight:0,overflowY:"auto",padding:u[5],fontSize:d.base},children:[r.jsx(I,{variant:"outline",size:"compact",disabled:!t.container||!t.previewReady||e.status==="running",onClick:()=>void We(t.id),style:{marginBottom:u[4]},children:e.status==="running"?"Checking…":"Run accessibility check"}),e.status==="idle"&&r.jsx("div",{style:{color:i.content.dim},children:"Run axe against the mounted story preview."}),e.status==="error"&&r.jsx("div",{style:{color:i.semantic.danger},children:e.error}),e.status==="complete"&&e.violations.length===0&&r.jsx("div",{style:{color:i.semantic.success,fontWeight:600},children:"No accessibility violations found."}),e.violations.map(o=>r.jsxs("details",{style:{borderBottom:`1px solid ${i.boundary.default}`,padding:`${u[3]} 0`},children:[r.jsxs("summary",{style:{color:o.impact==="critical"||o.impact==="serious"?i.semantic.danger:i.content.primary,cursor:"pointer"},children:[o.help," · ",o.nodes.length," node",o.nodes.length===1?"":"s"]}),r.jsx("a",{href:o.helpUrl,target:"_blank",rel:"noreferrer",style:{color:i.accent.default,display:"inline-block",margin:"5px 0"},children:"How to fix"}),o.nodes.map((n,s)=>r.jsxs("pre",{style:{color:i.content.muted,fontFamily:ue,fontSize:d.sm,whiteSpace:"pre-wrap",overflowWrap:"anywhere"},children:[n.target.join(" "),`
|
|
3
|
+
`,n.html]},`${o.id}:${s}`))]},o.id))]})}const Fe=de();function He(){Fe.ensure(t=>{t(se({match:()=>K()?.descriptor.kind==="story",id:le,title:ce,icon:Re,order:ae,Section:Ae}));const e=()=>z()!==null;t(F({...H.storyActions,Content:Ie,available:e})),t(F({...H.storyInteractions,Content:Le,available:e})),t(F({...H.storyAccessibility,Content:Be,available:e}))})}export{Re as S,He as e,ke as p,Ee as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as r}from"./story-documents--TDLaPeL.js";import"./index-GIL7oGEO.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"./three.module-D396a9Mn.js";import"./ResolutionPicker-C67vs1F3.js";import"./surface-state-DaxyruCj.js";import"./StoryPreviewMount-DjyxRCXu.js";import"./surface-content-Dg9Kkazf.js";import"./presentation-BPP5pXeQ.js";const v="workspace.service";function w(){return r(),()=>{}}export{v as point,w as start};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as n}from"./jsx-runtime-DPjLkJKQ.js";import{O as H}from"./Object3DDocumentViewport-DB7T0NTl.js";import{S,e as V}from"./surface-state-DaxyruCj.js";import{STANDARD_COMPONENT_CAMERA_DIRECTION as W}from"./standard-viewport-dressing-CzjAe_0A.js";import{e7 as G,b2 as z,et as B,eu as Y,e9 as F,av as j,aw as x,ao as p,aV as J,bo as D,ev as U,ey as K,eQ as L,ex as Q,eR as X,eC as Z,ax as q,ay as ee,dc as te,eS as re}from"./index-GIL7oGEO.js";import{m as oe}from"./mounted-story-viewport-source-DjP6RA9U.js";import{s as se}from"./story-arg-descriptors-Ek86ExX7.js";import{mountStoryObject3D as ne,disposeStoryObject3D as N}from"./story-three-preview-BHEDZzcl.js";import{S as ie,p as ae,s as le}from"./story-documents--TDLaPeL.js";import{r as l}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{R3fSourceAuthoringAdapter as ce}from"./r3f-source-authoring-adapter-w6Bc60K-.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./viewport-surface-status-B3om4Kcf.js";import"./stage-invalidation-DBg3C3Ta.js";import"./three.module-D396a9Mn.js";import"./index-D_NuPfjr.js";import"./index-CinJrH5C.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./crash-null-boundary-v3a0uEgw.js";import"./events-156d8d12.esm-ErOhDXXB.js";import"./index-bQE2NA0D.js";import"./story-mount-turn-DFRTj5hi.js";import"./ResolutionPicker-C67vs1F3.js";import"./StoryPreviewMount-DjyxRCXu.js";import"./surface-content-Dg9Kkazf.js";import"./presentation-BPP5pXeQ.js";import"./live-gesture-lock-DJbrjOqf.js";import"./writer-B-KovzkA.js";import"./three-projection-core-BmKMZ-nf.js";import"./three-CDSueJyJ.js";import"./viewport-pick-context-DkawXbEi.js";import"./inference-diagnostics-Dhmtfbq_.js";import"./instance-fork-actions-D3sRzS3K.js";import"./r3f-physics-binding-BBo8oma9.js";import"./object3d-authoring-subject-CH5sI2oP.js";import"./user-data-BB2Of6Ht.js";import"./object-marks-DwvIEBOK.js";const de="threeStory.arg.",f=new Map;let _=0;const v=new Set;function b(){_++;for(const t of v)t()}function C(t){return v.add(t),()=>{v.delete(t)}}function I(){return _}function ue(t,r){return`three-story:${t}#${r}`}function k(){const t=U();if(!t)return null;const r=f.get(t.descriptor.id);return r?{...r,id:t.descriptor.id}:null}function g(t,r,e){const s=f.get(t);if(s){if(e===void 0){const o={...s.argOverrides};delete o[r],s.argOverrides=o}else s.argOverrides={...s.argOverrides,[r]:e};b()}}function A(t,r,e,s=e,o={}){P(),X(le(r,e));const i=ue(r,e);return f.has(i)||(f.set(i,{modulePath:r,storyName:e,argOverrides:{}}),b()),Z({id:i,title:s,kind:"world",workspaceRole:"authored-subject",provenance:{sourcePath:r},Content:pe,closeable:!0,presentation:()=>({kind:"story",modulePath:r,storyName:e,mode:"preview"}),persist:({title:c})=>({modulePath:r,storyName:e,title:c}),onActivate:()=>t.setActiveViewportTab("edit"),onDispose:c=>{f.delete(c)&&b()}},{activate:o.activate!==!1})}function me(t,r,e,s){const{story:o}=T(r,e);return!o||q({modulePath:r,regions:ee()}).medium!=="three"?!1:(A(t,r,e,s??o.label),!0)}K({id:L,owner:"three-story-documents",open:(t,r)=>A(t,r.modulePath,r.storyName,r.title??r.storyName,r.activate===void 0?{}:{activate:r.activate})});Q({kind:"world",owner:"three-story-documents",prepare:ae,restore:({state:t,store:r})=>{const e=t,s=typeof e?.modulePath=="string"?e.modulePath:null,o=typeof e?.storyName=="string"?e.storyName:null;if(!s||!o)return!1;const i=typeof e?.title=="string"?e.title:void 0;return me(r,s,o,i)}});function T(t,r){const e=x().find(s=>s.modulePath===t);return e?e.ok?{story:e.stories.find(s=>s.name===r),moduleError:void 0}:{story:void 0,moduleError:e.error}:{story:void 0,moduleError:void 0}}function pe({documentId:t,active:r}){l.useSyncExternalStore(C,I),l.useSyncExternalStore(j,x);const e=f.get(t),[s,o]=l.useState(null),[i,c]=l.useState(null),u=l.useRef(new Set);l.useEffect(()=>{if(s)for(const a of u.current){if(a===s)break;a.dispose(),u.current.delete(a)}},[s]),l.useEffect(()=>()=>{for(const a of u.current)a.dispose();u.current.clear()},[]);const[E,$]=l.useState(r),h=e?.modulePath,O=l.useMemo(()=>h?({store:a,scene:d,hierarchyRoots:y})=>{const R=new ce(a,d,{worldId:t,entryPath:h,writeBackend:te("The Asset Editor"),hierarchyMode:"definition",...y?{hierarchyRoots:y}:{}});return{adapter:R,dispose:()=>R.dispose()}}:void 0,[t,h]);l.useEffect(()=>{r&&$(!0)},[r]);const{story:m,moduleError:w}=e?T(e.modulePath,e.storyName):{story:void 0,moduleError:void 0},M=e?JSON.stringify(e.argOverrides):"";if(l.useEffect(()=>{if(!E||!m||!e)return;let a=!1;return c(null),ne(m.Component,{...e.argOverrides}).then(d=>{if(a){N(d);return}if(!re(d.root)){N(d),c("The story mounted with no three content — its first R3F commit rendered an empty subtree. A <Suspense> boundary around three content is the usual cause: the boundary commits its fallback first, so the real children arrive on a later commit this document never sees.");return}const y=oe(d);u.current.add(y),o(y)}).catch(d=>{a||c(d instanceof Error?d.message:String(d))}),()=>{a=!0}},[E,m,e,M]),!e)return n.jsx("div",{style:{padding:12,fontSize:12,color:p.content.muted},children:"This story document is no longer available."});if((!m||i)&&!s){const a=`${e.modulePath}#${e.storyName}`;return n.jsx("div",{"data-testid":"three-story-document-error",style:{position:"relative",flex:1,minHeight:0},children:n.jsx(S,{testId:"three-story-surface-status",explanation:{tone:"error",title:`Story ${a} failed`,description:i??w??"It may have been renamed or removed; close this document."}})})}return s?n.jsxs("div",{style:{position:"relative",display:"flex",flex:1,minHeight:0},children:[n.jsx(H,{documentId:t,sourcePath:e.modulePath,build:s.build,displayName:m?.label??e.storyName,active:r,assetType:"component",...O?{sourceAuthoring:O}:{},cameraDirection:W}),(!m||i)&&n.jsx(S,{testId:"three-story-surface-status",explanation:{tone:"error",title:"Source update failed",description:i??w??"This story is unavailable. The last working view is retained."}})]}):n.jsx("div",{"data-testid":"three-story-document-loading",style:{position:"relative",flex:1,minHeight:0},children:n.jsx(S,{testId:"three-story-surface-status",explanation:V({surface:"Story",rootIds:[`${e.modulePath}#${e.storyName}`],phase:"loading",content:"unknown"})})})}function fe(){l.useSyncExternalStore(C,I),l.useSyncExternalStore(j,x);const t=k();if(!t)return null;const{story:r}=T(t.modulePath,t.storyName),e=r?{...r.args,...t.argOverrides}:{},s=se(e,de);return n.jsxs("div",{"data-testid":"inspector-story-args-three",style:{pointerEvents:"auto",padding:8,borderBottom:`1px solid ${p.boundary.default}`},children:[n.jsx("div",{style:{fontSize:11,color:p.content.primary,fontWeight:600,marginBottom:4},children:t.storyName}),s.length===0&&n.jsx("div",{style:{fontSize:11,color:p.content.dim},children:r?"This story declares no editable args.":"Story source unavailable."}),s.map(o=>n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"3px 0"},children:[n.jsx("span",{title:o.label,style:{width:90,flexShrink:0,fontSize:11,color:p.content.muted,overflow:"hidden",textOverflow:"ellipsis"},children:o.label}),o.type==="boolean"?n.jsx(J,{className:"vgai-checkbox","data-testid":`three-story-arg-${o.label}`,checked:e[o.label]===!0,onChange:i=>g(t.id,o.label,i.target.checked)}):o.type==="number"?n.jsx(D,{type:"number",className:"vgai-input","data-testid":`three-story-arg-${o.label}`,value:e[o.label],onChange:i=>{const c=i.target.value,u=Number.parseFloat(c);g(t.id,o.label,c===""||Number.isNaN(u)?void 0:u)},style:{width:80}}):o.type==="string"?n.jsx(D,{type:"text",className:"vgai-input","data-testid":`three-story-arg-${o.label}`,value:e[o.label],onChange:i=>g(t.id,o.label,i.target.value),style:{flex:1,minWidth:0}}):n.jsx("span",{"data-testid":`three-story-arg-${o.label}`,style:{fontSize:11,color:p.content.dim},children:JSON.stringify(e[o.label])})]},o.path))]})}const ye=F();function P(){ye.ensure(t=>{t(G({match:()=>k()!==null,id:Y,title:B,icon:ie,order:z,Section:fe}))})}const tt="workspace.service";function rt(){return P(),()=>{}}export{tt as point,rt as start};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{av as p,aw as y,ax as S,ay as b,az as v}from"./index-GIL7oGEO.js";const f={three:!1,canvas:!1,dom:!1};let r=f,a=0;const n=new Set;let i=!1;function j(){return l(),r}function w(e){return l(),n.add(e),()=>{n.delete(e)}}function l(){i||(i=!0,p(()=>{d()}),d())}function u(e){if(!(e.three===r.three&&e.canvas===r.canvas&&e.dom===r.dom)){r=e;for(const t of n)t()}}function M(e){const t=S({modulePath:e.modulePath,regions:b()});if(t.medium)return t.medium;e.modulePath&&v(e.modulePath,t.reason)}async function d(){const e=++a,t=y().flatMap(s=>s.ok?s.stories.map(o=>({...o,modulePath:s.modulePath})):[]);if(t.length===0)return u(f),r;const c={three:!1,canvas:!1,dom:!1};for(const s of t){const o=M(s);if(o&&(c[o]=!0),e!==a)return r}const{three:m,canvas:h,dom:P}=c;return e!==a||u({three:m,canvas:h,dom:P}),r}export{j as g,w as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let o=Promise.resolve();function t(n){const r=o.then(n,n);return o=r.then(()=>{},()=>{}),r}export{t as r};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as v}from"./index-nmcBqr7Y.js";import{aD as E,bM as M}from"./index-GIL7oGEO.js";import{C as P}from"./crash-null-boundary-v3a0uEgw.js";import{m as T}from"./pixi-story-model-DNkfnWUV.js";import{r as S}from"./story-mount-turn-DFRTj5hi.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"./three.module-D396a9Mn.js";const w=1e4,k=12,I="position:fixed;left:-20000px;top:0;width:512px;height:512px;overflow:hidden;contain:strict;pointer-events:none;visibility:hidden;";function C(t){return S(()=>t(D))}function R(t,c={}){return C(n=>n(t,c))}function _(t){return S(async()=>t.dispose())}async function j(t,c={}){const n=await R(t,c.props??{});try{const o=c.width??128,r=c.height??96;n.app.renderer.render({container:n.stage});const a=n.stage.getBounds(),s=c.layout==="fullscreen",d=8,e=n.app.screen.clone();s||(e.x=a.x-d,e.y=a.y-d,e.width=Math.max(1,a.width+d*2),e.height=Math.max(1,a.height+d*2));const i=o/r;if(!s&&e.width/e.height<i){const l=e.height*i;e.x-=(l-e.width)/2,e.width=l}else if(!s&&e.width/e.height>i){const l=e.width/i;e.y-=(l-e.height)/2,e.height=l}const u=n.app.renderer.background,h=await n.app.renderer.extract.canvas({target:n.stage,frame:e,...s&&u.alpha>0?{clearColor:u.colorRgba}:{}}),m=document.createElement("canvas");m.width=o,m.height=r;const f=m.getContext("2d");if(!f)throw new Error("Canvas story preview could not create a 2D readback context.");const g=Math.min(o/h.width,r/h.height),y=h.width*g,x=h.height*g;return f.drawImage(h,(o-y)/2,(r-x)/2,y,x),m.toDataURL("image/png")}finally{await _(n)}}const p=()=>new Promise(t=>setTimeout(t,0));async function D(t,c={}){typeof t.load=="function"&&await t.load();const n=await E(),o=document.createElement("div");o.setAttribute("style",I),document.body.appendChild(o);let r=null;const a=()=>{r?.unmount(),r=null,o.remove()};try{return await M(async s=>{let d=null;r=n.createRoot(o),r.render(v.createElement(P,{onCaught:h=>{d??=h}},v.createElement(t,c)));for(let h=0;h<k&&!(d||o.querySelector("canvas"));h++)await p();if(d)throw b(d);if(!o.querySelector("canvas"))throw new Error("The story rendered no canvas — it does not mount Pixi content.");const e=Date.now()+w;let i;for(;Date.now()<e;){if(d)throw b(d);if(i??=s[0],i&&T(i.stage))break;await p()}if(!i)throw new Error(`The story rendered a canvas but never initialized a Pixi Application within ${w/1e3}s — it is not a canvas story, or its renderer could not be created here.`);i.stop(),i.ticker.lastTime=0;let u=!1;return{host:o,stage:i.stage,ticker:i.ticker,app:i,dispose(){u||(u=!0,a())}}})}catch(s){throw a(),s}}const O=w;async function G(t,c=Date.now){if(t.length===0)return;const n=new Set,o=t.map(r=>{const a={postrender:()=>{n.add(r)}};return r.renderer?.runners.postrender.add(a),{app:r,observer:a}});try{const r=c()+O;for(;c()<r;){if(t.every(s=>s.stage!==void 0&&T(s.stage)&&n.has(s)))return;await p()}}finally{for(const{app:r,observer:a}of o)r.renderer?.runners.postrender.remove(a)}}function b(t){return new Error(`mountStoryPixi: the story threw while rendering — it does not mount Pixi content, or its component crashed. Original error: ${t instanceof Error?t.message:String(t)}`,{cause:t})}export{G as awaitPixiStoryFrame,j as capturePixiStoryThumbnail,_ as disposeStoryPixi,R as mountStoryPixi,C as withPixiStoryMountTurn};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{bO as P,bP as L,bQ as M}from"./index-GIL7oGEO.js";const R=640,j=400;function F(e,t){return`portable-${e}:${t.map(n=>encodeURIComponent(n)).join("/")}`}function N(e){const t=new Map,n=[],u=new Map,i=new Map;for(const o of e){const s=P({modulePath:o.modulePath,...o.title?{title:o.title}:{}}),h=[...s.segments,s.leaf];let a=null;for(let d=0;d<h.length;d++){const p=h.slice(0,d+1),c=d===h.length-1,r=F(c?"component":"folder",p);t.has(r)||(t.set(r,{id:r,label:p.at(-1),role:c?"component":"folder",kind:c?"component":"group",typeLabel:c?"Component":d===0?"Category":"Folder",parentId:a,childIds:[],...c?{secondaryLabel:o.modulePath}:{}}),a?t.get(a)?.childIds.push(r):n.push(r)),a=r}const l=a;t.get(l)?.childIds.push(o.id),u.set(o.id,l);const f=i.get(l);f?f.storyIds.push(o.id):i.set(l,{id:l,label:L(s),storyIds:[o.id]})}return{sections:[...i.values()],nodes:[...t.values()],rootIds:n,storyParentIds:u}}function y(e){return e&&typeof e=="object"?e:null}function v(e){if(typeof e!="string")return null;const t=Number.parseFloat(e);return Number.isFinite(t)&&t>0?t:null}function O(e){const t=y(y(e.viewport)?.options),n={...M};if(!t)return n;for(const[u,i]of Object.entries(t)){const o=y(i),s=y(o?.styles);!o||!s||typeof o.name!="string"||typeof s.width!="string"||typeof s.height!="string"||(n[u]={name:o.name,styles:{width:s.width,height:s.height},...typeof o.type=="string"?{type:o.type}:{}})}return n}function S(e){const t=e.viewport;if(typeof t=="string")return{value:t||null,isRotated:!1};const n=y(t);return{value:typeof n?.value=="string"&&n.value?n.value:null,isRotated:n?.isRotated===!0}}function T(e,t,n,u){const i=e.parameters??{},o=e.globals??{},s=i.layout,h=s==="centered"||s==="fullscreen"||s==="padded"?s:"padded",a=O(i),l=Object.entries(a).flatMap(([m,b])=>{const w=v(b.styles.width),I=v(b.styles.height);return w&&I?[{id:m,label:b.name,width:w,height:I}]:[]}),f=S(o),d=n===void 0?f.value:n,p=l.find(m=>m.id===d),c=p?.width??t?.width??R,r=p?.height??t?.height??j,g=u??f.isRotated;return{layout:h,choices:l,selectedViewportId:p?.id??null,locked:e.viewportLocked===!0,rotated:g,width:g?r:c,height:g?c:r}}function E(e,t=N(e)){return{index:t,resolve:T}}export{N as c,E as s};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/react-three-rapier.esm-CEfKpvxT.js","assets/index-GIL7oGEO.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/three.module-D396a9Mn.js","assets/index-D2fNXpHa.css","assets/events-156d8d12.esm-ErOhDXXB.js","assets/index-bQE2NA0D.js","assets/BufferGeometryUtils-Nz37EVXf.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{Q as U,dy as W,gi as z,gj as H,_ as G}from"./index-GIL7oGEO.js";import{r as F}from"./index-nmcBqr7Y.js";import{C as Q}from"./crash-null-boundary-v3a0uEgw.js";import{T as $,v as q,j as V,cb as X}from"./three.module-D396a9Mn.js";import{e as J,c as K}from"./events-156d8d12.esm-ErOhDXXB.js";import{r as Y}from"./story-mount-turn-DFRTj5hi.js";import"./jsx-runtime-DPjLkJKQ.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-CtzuWnCS.js";import"./index-CinJrH5C.js";import"./index-D_NuPfjr.js";import"./index-FUuS4qwW.js";import"./client-DNXj_opT.js";import"./index-bQE2NA0D.js";const Z=1/60,ee=6,te=15,N=1e-4,ne=2,re=10,oe=250,ie=4e3;function S(e){e.updateMatrixWorld(!0);const t=[];return e.traverse(n=>{const r=n.matrixWorld.elements;t.push(r[12],r[13],r[14])}),t}function D(e){let t=0;return e.traverse(()=>{t++}),t}function x(e,t){if(e.length!==t.length)return Number.NaN;let n=0;for(let r=0;r<t.length;r+=3){const o=t[r]-e[r],a=t[r+1]-e[r+1],i=t[r+2]-e[r+2],s=Math.sqrt(o*o+a*a+i*i);if(!Number.isFinite(s))return Number.NaN;s>n&&(n=s)}return n}const se=()=>new Promise(e=>setTimeout(e,0));async function ae(e,t,n){const r=n();let o=D(e),a=r,i=!1;for(;n()-r<ie;){if(n()-a>=oe){i=!0;break}await t();const s=D(e);s!==o&&(o=s,a=n())}return{buildWaitMs:n()-r,buildSettled:i}}function C(e){return{outcome:e,steps:0,lastMotion:0,buildWaitMs:0,buildSettled:!0}}function ce(e){return e.hasPhysicsSubscriber!==!1}async function ue(e,t={}){const n=t.yieldTurn??se,r=t.now??(()=>Date.now()),o=e.update?.bind(e);if(!o)return C("unsupported");if(!ce(e))return C("still");const{buildWaitMs:a,buildSettled:i}=await ae(e.scene,n,r);let s=S(e.scene),l=0,u=0,h=!1,E=0,y="still";for(let d=0;d<te;d++){for(let w=0;w<ee;w++)o(Z),l++;await n();const m=S(e.scene),f=x(s,m);if(s=m,!Number.isFinite(f)){u=0;continue}if(E=f,f>N){h=!0,u=0,y="budget";continue}if(u++,h&&u>=ne){y="rest";break}}for(let d=0;d<re;d++){await n();const m=S(e.scene),f=x(s,m);if(s=m,Number.isFinite(f)&&f<=N)break}return{outcome:y,steps:l,lastMotion:E,buildWaitMs:a,buildSettled:i}}const le={packaged:!1,createElement:F.createElement,createR3FRoot:K,extendThree:J,three:$};let R=null;async function de(){const e=await import(W);for(const t of["createElement","createR3FRoot","extendThree"])if(typeof e[t]!="function")throw new Error(`The packaged R3F preview runtime did not export ${t} as a function — see vite-plugin-module-doorways.ts.`);if(typeof e.projectThree!="object"||e.projectThree===null)throw new Error("The packaged R3F preview runtime did not export projectThree — see vite-plugin-module-doorways.ts.");return{packaged:!0,createElement:e.createElement,createR3FRoot:e.createR3FRoot,extendThree:e.extendThree,three:e.projectThree}}async function me(){return await U()?(R||(R=de()),R):le}let T=null;function Ue(){return T}const v="vgai:story-preview-root",fe=1e4;function P(e){if(typeof e=="function"){const t=e;return t.displayName||t.name||""}if(e&&typeof e=="object"){const t=e;return typeof t.displayName=="string"&&t.displayName.length>0?t.displayName:typeof t.name=="string"&&t.name.length>0?t.name:P(t.type??t.render)}return""}function pe(e){const t=e,n=t._reactInternals??t._reactInternalFiber;return n&&typeof n=="object"?n:void 0}function he(e){const t=[P(e.type),P(e.elementType)];if(!(t.includes("RigidBody")||t.includes("InstancedRigidBodies")))return{provider:t.includes("Physics"),body:!1,movingBody:!1};const r=e.memoizedProps&&typeof e.memoizedProps=="object"?e.memoizedProps:{};return{provider:t.includes("Physics"),body:!0,movingBody:r.type!=="fixed"}}function ye(e){const t=e?[e]:[],n=new Set;let r=!1,o=!1,a=!1;for(;t.length>0;){const i=t.pop();if(n.has(i))continue;n.add(i);const s=he(i);r||=s.provider,o||=s.body,a||=s.movingBody,i.child&&t.push(i.child),i.sibling&&t.push(i.sibling)}return r?!o||a:!1}class we extends F.Component{componentDidMount(){this.props.onReport(ye(pe(this)))}render(){return this.props.children??null}}function Ee(e){return e instanceof Error&&e.message.includes("is not part of the THREE namespace")}function L(e){return Ee(e)?!0:e instanceof Error?e.message.includes("Hooks can only be used within the Canvas component")||e.message.includes("useGame: no Game in context"):!1}function We(e){return L(e)}function I(e){return e instanceof Error&&e.message.includes("useRapier must be used within <Physics")}async function Te(e){try{return(e.packaged?await import("/@id/@react-three/rapier"):await G(()=>import("./react-three-rapier.esm-CEfKpvxT.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]))).Physics}catch{return null}}function ge(e,t,n){const r=globalThis,o=r.reportError,a=typeof o=="function"?o.bind(globalThis):i=>{console.error(i)};r.reportError=i=>{L(i)||t&&I(i)||a(i)};try{return n(e)}finally{r.reportError=o}}function be(e){return{domElement:e,xr:{enabled:!1,addEventListener(){},removeEventListener(){},setAnimationLoop(){},getSession(){return null}},shadowMap:{enabled:!1,type:X},outputColorSpace:V,toneMapping:q,setPixelRatio(){},setSize(){},setClearColor(){},setClearAlpha(){},setViewport(){},setScissor(){},setScissorTest(){},setAnimationLoop(){},clear(){},render(){},compile(){},dispose(){},getPixelRatio(){return 1},getContext(){return null}}}let O=null;function k(e){return Y(()=>e(Pe))}function Se(e){O!==e.extendThree&&(O=e.extendThree,e.extendThree(e.three))}async function Re(e,t={}){return k(n=>n(e,t))}function ve(e){return k(async()=>e.dispose())}async function Pe(e,t={}){const n=H();T=null;const r=n?Date.now():0,o=await me(),a=n?Date.now()-r:0,i=n?Date.now():0;typeof e.load=="function"&&await e.load();const s=n?Date.now()-i:0;try{return await j(o,e,t,void 0,{timed:n,runtimeMs:a,loadMs:s})}catch(l){if(!I(l))throw l;const u=await Te(o);if(!u)throw l;return await j(o,e,t,h=>o.createElement(u,{paused:!1},h),{timed:n,runtimeMs:a,loadMs:s})}}async function j(e,t,n,r,o){Se(e);const a=document.createElement("canvas"),i=ge(a,r===void 0,e.createR3FRoot);let s;const l=new Promise(c=>{s=c});await i.configure({gl:(()=>be(a)),frameloop:"never",size:{width:128,height:96,top:0,left:0},onCreated:c=>s(c)});let u=null,h;const E=new Promise((c,b)=>{h=b}),y=c=>{u??=new Error("mountStoryObject3D: the story threw while reconciling into an R3F root — it does not render `three` content (a DOM/React story), or its component crashed. Original error: "+String(c instanceof Error?c.message:c),{cause:c}),h(u)},d=e.createElement(t,n);let m=!1;const f=c=>{m=c};i.render(e.createElement("group",{name:v},e.createElement(Q,{onCaught:y},e.createElement(we,{onReport:f},r?r(d):d))));const w=o?.timed?Date.now():0;let M;const p=await Promise.race([l,E,new Promise((c,b)=>{M=setTimeout(()=>b(new Error("mountStoryObject3D: onCreated did not fire within 10s — the story never reached its first R3F commit and never threw. Either it is still SUSPENDED on a slow load (a suspending loader with no <Suspense> boundary holds the first commit until its content is ready), or its render is hung.")),fe)})]).catch(c=>{throw o?.timed&&(T={runtimeMs:o.runtimeMs,loadMs:o.loadMs,fiberMs:Date.now()-w,settleMs:0}),i.unmount(),c}).finally(()=>clearTimeout(M));if(u)throw i.unmount(),u;p.clock.autoStart=!1,p.clock.stop();const g=p.scene.getObjectByName(v);if(!g)throw i.unmount(),new Error(`mountStoryObject3D: the story's wrapper group ("${v}") is not in the scene after its first commit — the story rendered nothing mountable.`);const A=o?.timed?Date.now()-w:0,B=o?.timed?Date.now():0;await ue({scene:g,update:c=>{p.advance(p.clock.elapsedTime+Math.min(c,.1),!1)},hasPhysicsSubscriber:m}),o?.timed&&(T={runtimeMs:o.runtimeMs,loadMs:o.loadMs,fiberMs:A,settleMs:Date.now()-B});let _=p.clock.elapsedTime;return{root:g,scene:p.scene,advance(c){!(c>0)||!Number.isFinite(c)||(_+=Math.min(c,.1),p.advance(_,!1))},dispose(){i.unmount()}}}async function ze(e,t={}){const n=await Re(e,t.props??{});try{const r=z(n.root,{width:t.width??128,height:t.height??96,...t.camera===void 0?{}:{camera:t.camera},...t.pose===void 0?{}:{pose:t.pose}}),o=r.views.find(a=>a.view==="perspective")??r.views[0];if(!o)throw new Error("Story preview capture returned no views.");return`data:${o.mimeType};base64,${o.base64}`}finally{await ve(n)}}function He(){return typeof WebGLRenderingContext<"u"&&typeof navigator<"u"&&!navigator.userAgent.toLowerCase().includes("jsdom")}export{v as PREVIEW_ROOT_NAME,ze as captureStoryComponentThumbnail,ve as disposeStoryObject3D,We as isStoryThreeClassificationRefusal,Ue as lastStoryMountPhaseTiming,Re as mountStoryObject3D,He as supportsThreeStoryCapture,k as withStoryMountTurn};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{setUserData as d}from"./user-data-BB2Of6Ht.js";import"./object-marks-DwvIEBOK.js";const m="ingest:camera",y=1<<31;function I(s){return(s.layers.mask&y)!==0}function M(s){const t=s.material;if(!t)return null;const n=Array.isArray(t)?t[0]:t;return n?.color?n:null}function A(s,t){const n=new Map;let e=0,c=0,l=0;const f=(i,r)=>{const o=`ingest:${r}:${i.type}:${i.name||""}`;n.set(o,i),e++,i.isLight?l++:i.isMesh&&c++,u(i,r)},u=(i,r)=>{let o=0;for(const a of i.children)I(a)||(f(a,r?`${r}/${o}`:`${o}`),o++)};return u(s,""),t&&(n.set(m,t),e++),{byId:n,count:e,meshes:c,lights:l}}function h(s,t){const n=A(s,t);for(const[e,c]of n.byId)d(c,"entityId",e);return n}export{m as CAMERA_ID,h as assignStructuralIds,A as collectStructuralIds,M as colorMaterialOf};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const u="staticBatch";function c(t){if(t.userData?.[u]===!1)return"opted-out";const e=t;return e.isInstancedMesh?"instanced":e.isBatchedMesh?"batched":e.isSkinnedMesh?"skinned":e.isMesh?!e.geometry||!e.material?"no-geometry":Array.isArray(e.material)?"multi-material":Object.keys(e.geometry.morphAttributes).length>0?"morph-targets":e.material.transparent?"transparent":null:"not-a-mesh"}function o(t){const e=t.parameters;return e?`${t.type}:${JSON.stringify(e)}`:`uuid:${t.uuid}`}function s(t){const e=t,r=e.color?.getHexString?.()??"",n=e.map?.uuid??"";return`${t.type}:${r}:${e.roughness??""}:${e.metalness??""}:${n}:${t.side}:${t.transparent}:${t.vertexColors}`}function p(t){const e=t.geometry,r=t.material;return`${o(e)}|${s(r)}|${t.castShadow?1:0}${t.receiveShadow?1:0}`}function d(t){return`${Object.keys(t.attributes).sort().map(r=>`${r}:${t.attributes[r]?.itemSize??"?"}`).join(",")}${t.getIndex()?"|i":""}`}function h(t){const e=t;if(e.isShaderMaterial||e.isRawShaderMaterial)return`uuid:${t.uuid}`;const r=t,n=[r.normalMap,r.aoMap,r.emissiveMap,r.roughnessMap,r.metalnessMap].map(a=>a?.uuid??"").join(","),i=t.customProgramCacheKey?.()??"";return[s(t),t.opacity,t.depthWrite,t.depthTest,t.alphaTest,t.blending,t.toneMapped,t.visible,r.emissive?.getHexString?.()??"",r.flatShading??"",r.wireframe??"",n,i].join("|")}export{u as STATIC_BATCH_OPT_OUT_KEY,d as geometryLayoutSignature,o as geometrySignature,h as materialMergeSignature,s as materialSignature,p as staticBatchSignature,c as staticBatchSkipReason};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a=new Set(["canvas","svg","img","picture","video","input","button"]),u=new Set(["script","style","template"]);function l(e){if(e.hasAttribute("hidden"))return!0;if(typeof getComputedStyle!="function")return!1;const t=getComputedStyle(e);return t.display==="none"||t.visibility==="hidden"||t.opacity==="0"}function c(e){if(typeof getComputedStyle!="function")return!1;const t=getComputedStyle(e),n=e.getBoundingClientRect();return n.width>0&&n.height>0?t.backgroundImage!=="none"||t.backgroundColor!=="transparent"&&t.backgroundColor!=="rgba(0, 0, 0, 0)"||t.borderTopStyle!=="none"||t.outlineStyle!=="none":!1}function s(e){if(e.nodeType===Node.TEXT_NODE)return!!e.textContent?.trim();if(!(e instanceof Element))return!1;const t=e.tagName.toLowerCase();if(u.has(t)||l(e))return!1;if(a.has(t))return!0;for(const n of e.childNodes)if(s(n))return!0;return c(e)}function f(e){for(const t of e.childNodes)if(s(t))return!0;return!1}function d(e,t){const n=e;if(t!==void 0&&n.layers.mask>>>0===1<<t>>>0||!n.isMesh&&!n.isLine&&!n.isPoints&&!n.isSprite)return!1;const r=Array.isArray(n.material)?n.material:n.material?[n.material]:[];return r.length===0||r.some(i=>i.visible)}function h(e,t={}){if(t.includeBackground!==!1&&e.background!==null)return!0;const n=[e];for(;n.length>0;){const r=n.pop();if(!(!r||!r.visible)){if(r!==e&&d(r,t.ignoredLayer))return!0;for(let i=r.children.length-1;i>=0;i-=1){const o=r.children[i];o&&n.push(o)}}}return!1}export{f as d,h as t};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as s}from"./jsx-runtime-DPjLkJKQ.js";import"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{d_ as a}from"./index-GIL7oGEO.js";function m({explanation:t,testId:e,style:o}){return t?s.jsx(a,{"data-testid":e,tone:t.tone,title:t.title,description:s.jsx("span",{style:{whiteSpace:"pre-wrap"},children:t.description}),style:{position:"absolute",inset:0,pointerEvents:"none",...o}}):null}function i(t){return t.map(e=>`“${e}”`).join(", ")}function d(t,e){const o=e.map(n=>n.worldId);return{tone:"error",title:o.length===1?`${t} root ${i(o)} failed`:`${o.length} ${t} roots failed`,description:`${e.map(n=>`${n.worldId} (${n.kind}, ${n.identity}): ${n.message}`).join(`
|
|
2
|
+
`)}
|
|
3
|
+
If this followed an edit, Undo (Ctrl+Z) restores the previous source and remounts.`}}function c(t,e){return{tone:"loading",title:e.length===0?`Loading ${t}`:e.length===1?`Loading ${t} root ${i(e)}`:`Loading ${e.length} ${t} roots`,description:e.length===0?"Reading the project declaration to identify the root that belongs here.":`Waiting for ${i(e)} to finish mounting.`}}function u(t,e){return e.length===0?{tone:"neutral",title:`No ${t} root`,description:"No declared root belongs to this surface."}:{tone:"neutral",title:"No renderable content",description:(e.length===1?`Root ${i(e)} mounted successfully but currently produces no renderable content.`:`Roots ${i(e)} mounted successfully but currently produce no renderable content.`)+" If this world builds its content under its game systems, press Play (▶) to run it."}}function $(t){if(t.content==="present")return null;if(t.playSuspended)return{tone:"neutral",title:"Editing paused during Play",description:`${i(t.rootIds)} is running in the Game tab. Press Stop (⏹) to edit it here.`};const e=new Set(t.rootIds),o=(t.failures??[]).filter(r=>e.has(r.worldId));if(o.length>0)return d(t.surface,o);const n=(t.readiness??[]).filter(r=>r.state==="waiting"&&e.has(r.rootId)).map(r=>r.rootId),l=n.length>0?n:t.rootIds;return t.phase==="loading"||n.length>0||t.content==="unknown"?c(t.surface,l):u(t.surface,t.rootIds)}export{m as S,$ as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function s(n){const t=new WeakMap;return{keyedBy:"display",ownerOf(e){const r=n.get(e);return r&&(r.body.isDynamic()||r.body.isKinematic())?"physics":"none"},freeze(e){const r=n.get(e);r&&(t.set(e,r.body.bodyType()),r.body.setBodyType(2,!0))},commit(e,r,o){const f=n.get(e);f&&(f.body.setTranslation({x:r[0],y:r[1]},!0),f.body.setRotation(o,!0))},unfreeze(e){const r=n.get(e);if(!r)return;const o=t.get(e);o!==void 0&&(r.body.setBodyType(o,!0),t.delete(e))}}}function c(n){const t=e=>n.find(r=>r.ownerOf(e)==="physics")??null;return{keyedBy:"display",ownerOf:e=>t(e)?"physics":"none",freeze:e=>t(e)?.freeze(e),commit:(e,r,o)=>t(e)?.commit(e,r,o),unfreeze:e=>t(e)?.unfreeze(e)}}export{c as composePhysicsAdapters2D,s as createPhysicsAdapter2D};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c1 as i}from"./index-GIL7oGEO.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"./three.module-D396a9Mn.js";function j(g,h="world"){const s=new Map,r=[],l=new Map;let d=0;for(const e of i)s.set(e,[]);let u=!1;const c=new Map;for(const e of i)c.set(e,new Set);const p=new Set;function m(e,n,t){const o=l.get(e)??e.name??`anonymous-${++d}`;l.set(e,o),g?.beginSystem(h,n,o);try{e(t)}catch(f){const a=e.name?`"${e.name}"`:"(anonymous)";console.error(`[system-runner] system ${a} in phase "${n}" threw:`,f)}finally{g?.endSystem(h,n,o)}}return{add(e,n,t){const o=s.get(e);if(!o)throw new Error(`Unknown phase: ${e}. Valid phases: ${i.join(", ")}`);o.push(n),l.set(n,t?.name??n.name??`anonymous-${++d}`)},remove(e,n){const t=s.get(e);if(!t)return;const o=t.indexOf(n);o!==-1&&t.splice(o,1),c.get(e)?.delete(n)},register(e){const n=s.get(e.phase);if(!n)throw new Error(`Unknown phase: ${e.phase}. Valid phases: ${i.join(", ")}`);n.push(e.update),l.set(e.update,e.name??e.update.name??`anonymous-${++d}`),r.push(e)},unregister(e){const n=s.get(e.phase);if(n){const o=n.indexOf(e.update);o!==-1&&n.splice(o,1)}c.get(e.phase)?.delete(e.update);const t=r.indexOf(e);t!==-1&&r.splice(t,1),p.delete(e),e.dispose?.()},runInit(){const e=[...r].sort((n,t)=>i.indexOf(n.phase)-i.indexOf(t.phase));for(const n of e)n.init?.()},runDispose(){for(const e of r){const n=s.get(e.phase);if(n){const t=n.indexOf(e.update);t!==-1&&n.splice(t,1)}e.dispose?.()}r.length=0},runPhase(e,n){const t=s.get(e);if(!t)throw new Error(`Unknown phase: ${e}. Valid phases: ${i.join(", ")}`);const o=c.get(e),f=[];for(const a of t)u&&!o.has(a)?f.push(a):m(a,e,n);for(const a of f)m(a,e,n)},run(e){for(const n of i)this.runPhase(n,e)},markEngineBoundary(){for(const e of i){const n=c.get(e);for(const t of s.get(e))n.add(t)}for(const e of r)p.add(e);u=!0},removeAllNonEngine(){if(!u)return;const e=r.filter(t=>p.has(t)),n=r.filter(t=>!p.has(t));r.length=0,r.push(...e);for(const t of n)t.dispose?.();for(const t of i){const o=s.get(t),f=c.get(t),a=o.filter(w=>f.has(w));o.length=0,o.push(...a)}},count(e){if(e)return s.get(e)?.length??0;let n=0;for(const t of s.values())n+=t.length;return n}}}export{j as createSystemRunner};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function $(n){if(typeof n!="string"||n.trim()==="")throw new Error('absent(): an absence needs evidence — say what was searched and what was found (e.g. "no Colyseus client anywhere in `src/`"), so a reviewer can re-run it. An unevidenced absence asserts something nobody can re-check.');return{present:!1,evidence:n}}function E(n){const{name:c,unattachedMessage:u,members:h}=n;let t=null;const l=new Set;let f=null,a=null;const v=e=>e,b=e=>{if(!t)return;const r=v(t)[e];return typeof r=="function"?r:void 0},p=()=>{for(const e of[...l])e()},d=()=>{if(f?.(),f=null,!t||a===null||l.size===0)return;const e=b(a);if(!e)return;const r=e.call(t,p);f=typeof r=="function"?r:null},i={},g=Object.entries(h);for(const[e,r]of g)switch(r.kind){case"action":{i[e]=(...s)=>{if(!t)throw new Error(`${c}: ${u}`);const o=b(e);if(!o)throw new Error(`${c}: the live adapter has no ${e}().`);return o.apply(t,s)};break}case"read":{const{empty:s}=r;i[e]=(...o)=>{const m=t,w=b(e);return(w?w.apply(m,o):void 0)??s};break}case"subscribe":{if(a!==null)throw new Error(`${c}: a slot declares at most one 'subscribe' member (${a} and ${e}).`);a=e,i[e]=s=>(l.add(s),d(),()=>{l.delete(s),d()});break}case"optional":{Object.defineProperty(i,e,{enumerable:!0,configurable:!0,get(){const s=t,o=b(e);if(o)return(...m)=>o.apply(s,m)}});break}}return{attach:e=>(t=e,d(),p(),()=>{t===e&&(t=null,d(),p())}),slot:i}}const y=new WeakMap;function M(n,c){return y.set(n,c),n}function j(n,c){const u=y.get(n);return u?u(c):n}export{$ as absent,j as bindScopedSystem,E as createSystemSlot,M as declareScopedSystem};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{aq as d,ar as w,as as b,at as N}from"./index-GIL7oGEO.js";import{r as m}from"./collaboration-presence-DLoZ7EA3.js";import{e as v,h as P,k as I}from"./play-mode-BFU2PCkG.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"./three.module-D396a9Mn.js";import"./native-debug-module-CWicoSGD.js";import"./native-entry-surface-BE8LJNdu.js";import"./debug-registry-Dgvitx8M.js";import"./playtest-BXIL1JEF.js";import"./game-contract-seams-a5YXejOu.js";import"./instruments-CKR02Y8I.js";import"./frame-pacing-D5acoOzO.js";import"./edit-mode-authoring-B47TfLqu.js";import"./json-history-resource-BbxllWfV.js";import"./binding-resolver-Dsh-6Vor.js";import"./adapter-surface-Y37Nzcyw.js";import"./entry-adjudication-Cq8Yeb74.js";import"./r3f-root-factory-z9llD1OU.js";import"./register-render-vitals-BiZk29b2.js";import"./render-census-BrQX_CXv.js";import"./structural-signature-0w-i_ats.js";import"./render-vitals-BZ5HtvMi.js";import"./static-batch-advisor-B13QEH7d.js";import"./webgl-frame-capture-FlF9zQmW.js";import"./world-state-BWG-IcOd.js";import"./frame-selector-cache-cCeUbcjG.js";import"./dev-build-gDYrq68M.js";import"./game-input-seams-CIQdetRw.js";import"./seeded-random-i3mtgBKZ.js";import"./render-seed-DF4JHy7P.js";import"./frame-delta-D2nsw_Ht.js";import"./events-156d8d12.esm-ErOhDXXB.js";import"./index-bQE2NA0D.js";import"./realm-services-CobQsq_X.js";import"./canvas-entry-runtime-SfBxaR9M.js";import"./three-ingest-runtime-QzDYk6tU.js";import"./EffectComposer-DQxfsXBZ.js";import"./CopyShader-BzTUYzf6.js";import"./ShaderPass-QYRpPuFJ.js";import"./CSS3DRenderer-CL7ABLVK.js";import"./relative-path-guard-GiM7Lsz8.js";import"./capability-coverage-Czas4C18.js";import"./react-root-CEz5NTck.js";import"./editor-presentation-activity-C7SNSmTd.js";import"./active-ingest-CT6jSGhr.js";import"./ingest-source-persistence-C_6Hiyra.js";import"./pixi-story-model-DNkfnWUV.js";import"./surface-content-Dg9Kkazf.js";import"./viewport-root-presentation-CWsE56K6.js";import"./mounted-authoring-Dmg5xmhP.js";import"./three-CDSueJyJ.js";import"./viewport-pick-context-DkawXbEi.js";import"./logger-Dqis-7W1.js";import"./run-ticks-settled-C4ksViyA.js";import"./three-authoring-adapter-CmSQ3Vui.js";import"./source-persistence-backend-C-aR-B_Y.js";import"./three-projection-core-BmKMZ-nf.js";import"./body-marks-h_xDxiDE.js";import"./user-data-BB2Of6Ht.js";import"./object-marks-DwvIEBOK.js";import"./structural-ids-Dc-7rEwi.js";import"./object3d-authoring-subject-CH5sI2oP.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./r3f-physics-binding-BBo8oma9.js";import"./deferred-ingest-play-DCJi_Pgu.js";import"./rrweb-Cd2ifIRP.js";import"./react-world-authoring-adapter-DmrwM3py.js";import"./board-guides-DziKSTss.js";import"./writer-B-KovzkA.js";import"./story-arg-descriptors-Ek86ExX7.js";import"./inspect-BZfi3mmo.js";import"./inference-diagnostics-Dhmtfbq_.js";const Wt="workspace.service";function Xt(){let i=null;const p=new Set;let e=null,n=null,a=d();const l=()=>{e?.(),e=null,n?.(),n=null,a=null},y=w(u=>{const k=u.participants.find(r=>r.participantId===b)?.capabilities.includes("test")??!1,t=u.activePlaytest,s=I();if(!k||!t){i=null,l(),m({playtest:null}),s?.mode==="team"&&P(),t||p.clear();return}s?.mode==="team"&&s.id===t.id||i!==t.id&&(p.has(t.id)||(i=t.id,m({playtest:{id:t.id,play:"starting",networking:"connecting",roomName:null,problem:null}}),v(t.seed,{mode:"team",id:t.id,roomKey:t.roomKey,revision:t.revision,participantId:b}).then(()=>{if(i!==t.id)return;l();const r=()=>{const o=d(),c=o?.getConnectionState?.(),f=o?.getRoomInfo?.();m({playtest:{id:t.id,play:"ready",networking:o?c==="connected"&&f?"ready":c==="error"?"error":"connecting":"not-declared",roomName:f?.roomName??null,problem:c==="error"?"The game networking adapter reported an error.":null}})},g=()=>{const o=d();o!==a&&(e?.(),a=o,e=o?.subscribe(r)??null),r()};n=N(g),g()}).catch(r=>{i===t.id&&(i=null,p.add(t.id),m({playtest:{id:t.id,play:"error",networking:"error",roomName:null,problem:r instanceof Error?r.message:String(r)}}))})))});return()=>{l(),y()}}export{Wt as point,Xt as start};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e="workspace.layout",t={id:"texture",title:"Texture",description:"Substance-Painter-shaped texturing. Uses Model's arrangement until the texture program ships its layer stack.",requires:{documentKind:"model"}};export{t as layout,e as point};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{aI as j,jO as N,jP as K,jQ as $,O as P,aH as A,fJ as E,jR as S}from"./index-GIL7oGEO.js";import{g as W}from"./viewport-pick-context-DkawXbEi.js";import{g as z,t as V,ao as G}from"./three.module-D396a9Mn.js";function J(n){const t=j(n,"constraints");return Array.isArray(t)?t.filter(e=>!!e&&typeof e=="object"&&typeof e.getSnapshot=="function"&&!!e.config):[]}const M="ingest:camera",Q=1<<31;function U(n){return(n.layers.mask&Q)!==0}function q(n,t){const e=new Map;let r=0,s=0,f=0;const u=(i,c)=>{const o=`ingest:${c}:${i.type}:${i.name||""}`;e.set(o,i),r++,i.isLight?f++:i.isMesh&&s++,d(i,c)},d=(i,c)=>{let o=0;for(const h of i.children)U(h)||(u(h,c?`${c}/${o}`:`${o}`),o++)};return d(n,""),t&&(e.set(M,t),r++),{byId:e,count:r,meshes:s,lights:f}}function Y(n){const t=j(n,"authoringSubject");return t&&typeof t.label=="string"&&typeof t.kind=="string"?t:null}function Z(n){const t=j(n,"reflectionProbe");if(!t||typeof t!="object")return null;const e=t;return e.config&&typeof e.recapture=="function"&&typeof e.getSnapshot=="function"?t:null}function R(n){return n.depthWrite===!1&&n.side===G}function X(n){const t=n.material;return t?Array.isArray(t)?t.length>0&&t.every(R):R(t):!1}function D(n,t,e,r=()=>!1,s){const f=W();if(!f)return[];const u=f.canvas.getBoundingClientRect();if(u.width<=0||u.height<=0||!Number.isFinite(t)||!Number.isFinite(e)||t<u.left||e<u.top||t>=u.left+u.width||e>=u.top+u.height)return[];const d=new z((t-u.left)/u.width*2-1,-((e-u.top)/u.height)*2+1),i=new V;i.layers.enableAll(),i.setFromCamera(d,f.camera);const c=new Set(s?.objects??n.objectMap.values()),o=[...c].filter(O=>{for(let I=O.parent;I;I=I.parent)if(c.has(I))return!1;return!0});for(const O of o)O.traverse(I=>{const v=I;v.isSkinnedMesh&&(v.boundingBox=null,v.boundingSphere=null)});const h=i.intersectObjects(o,!0),p=[],m=new Set;for(const O of h){if(N(O.object)||X(O.object))continue;let I=O.object,v=null;if(s)for(;I&&v===null;)v=s.idForObject3D(I),I=I.parent;else{const a=K(I);v=a?$(a)??null:null}v!==null&&!r(v)&&!m.has(v)&&(m.add(v),p.push(v))}return tt(p,o,h.length,t,e),p}function tt(n,t,e,r,s){n.length>0||r===0&&s===0||console.info(`[viewport-pick] click selected nothing (candidates ${t.length}, rayHits ${e}, resolvedIds 0)`)}function et(n,t,e,r=()=>!1,s){return D(n,t,e,r,s)[0]??null}const C={count:0,meshes:0,lights:0,instancedMeshes:0,instances:0};let x=0;function H(n){let t=0,e=0;for(const r of n.values()){const s=r.object;s.isInstancedMesh&&(t++,e+=typeof s.count=="number"?s.count:0)}return{instancedMeshes:t,instances:e}}function L(n){let t=0,e=0;for(const r of n.values()){const s=r.object;s.isLight?e++:s.isMesh&&t++}return{count:n.size,meshes:t,lights:e,...H(n)}}function T(n,t){const e=new Map,r=[],s=t.skip??A;t.begin?.(n);const f=(u,d,i,c)=>{if(s(u))return;const o=t.identify(u,{path:d,ownerId:i,ownedByAncestor:c});o!==null&&(P(u,o),e.set(o,{object:u,id:o,parentId:i,childIds:[]}),i===null?r.push(o):e.get(i)?.childIds.push(o));const h=c||o!==null;u.children.forEach((p,m)=>{f(p,[...d,m],o??i,h)}),t.leave?.(u,o)};return n.children.forEach((u,d)=>{f(u,[d],null,!1)}),{nodes:e,rootIds:r,stats:L(e)}}const nt="r3f:";function B(n,t){return`${nt}${n}:${t}`}function st(n){const t=new Map,e=new Map,r=(d,i)=>d===i||d.startsWith(`${i}#`)&&/^\d+$/u.test(d.slice(i.length+1)),s=d=>{e.clear();const i=c=>{if(A(c))return;const o=E(c),h=$(c);if(o!==void 0&&h!==void 0){const p=B(n,o);r(h,p)&&!e.has(h)&&e.set(h,c)}for(const p of c.children)i(p)};for(const c of d.children)i(c)},f=(d,i)=>{const c=$(d);if(c===void 0||i===void 0)return c;const o=B(n,i);return r(c,o)?e.get(c)===d?c:void 0:c},u=(d,i)=>{const c=B(n,i);let o=t.get(i)??0,h=S(c,o);for(;e.has(h);)o+=1,h=S(c,o);return t.set(i,o+1),e.set(h,d),h};return{begin:d=>{t.clear(),s(d)},identify:(d,i)=>{const c=E(d),o=f(d,c);if(o!==void 0)return o;const h=c===void 0?void 0:u(d,c);return h!==void 0||!i.ownedByAncestor||j(d,"authoringRoot")===!0?h??`live:${n}:${x++}`:null}}}function F(n,t){return T(n,st(t))}function dt(n,t){const{nodes:e}=F(n,t),r=new Map;for(const[s,f]of e)r.set(s,f.object);return r}function at(n,t={}){const e=t.camera;return{incremental:{kind:"live-oid",worldId:n},project:r=>{const s=F(r,n);return!e||[...s.nodes.values()].some(f=>f.object===e)?s:(P(e,M),s.nodes.set(M,{object:e,id:M,parentId:null,childIds:[]}),s.rootIds.push(M),{...s,stats:{...s.stats,count:s.nodes.size}})}}}function ut(n={}){const t=n.camera;return{project:e=>{const r=q(e,t),s=new Map;for(const[d,i]of r.byId)s.set(i,d);const f=new Map,u=[];for(const[d,i]of r.byId){const c=i.parent,o=(c&&c!==e?s.get(c):void 0)??null,h=i.children.map(p=>s.get(p)).filter(p=>p!==void 0);f.set(d,{object:i,id:d,parentId:o,childIds:h}),o===null&&u.push(d)}return{nodes:f,rootIds:u,stats:{count:r.count,meshes:r.meshes,lights:r.lights,...H(f)}}}}}function lt(n){let t=new Map,e=new Map;return{get instanceRoots(){return t},get representatives(){return e},project:r=>{const s=new Map,f=new Map,u=new Map,d=new Set,i=new Map,c=T(r,{identify:(o,h)=>{const p=E(o);if(p===void 0)return B(n,`@${h.path.join(".")}`);const m=s.get(p)??0;return s.set(p,m+1),m===0&&u.set(p,o),d.has(p)||(f.set(p,(f.get(p)??0)+1),d.add(p),i.set(o,p)),S(B(n,p),m)},leave:o=>{const h=i.get(o);h!==void 0&&(d.delete(h),i.delete(o))}});return t=f,e=u,c}}}function ft(n){return{project:t=>T(t,{skip:e=>!!j(e,"editorHelper")||e.isSkeletonHelper===!0,identify:(e,r)=>`source-object:${n}:${r.path.join(".")}`})}}function ht(n){const t=Y(n);return t?t.kind:J(n).length>0?"constraint-owner":Z(n)?"reflection-probe":n.isSkinnedMesh?"skinned-mesh":n.isBone?"bone":n.isLight?"light":n.isCamera?"camera":n.type==="Audio"||n.type==="PositionalAudio"||n.type==="AudioListener"?"audio":n.isMesh?"mesh":n.children.length>0?"group":"object"}function it(n,t){for(let e=n.parent;e!==null;e=e.parent)if(e===t)return!0;return!1}function _(n,t){if(n===t)return!0;for(let e=n.parent;e!==null;e=e.parent)if(e===t)return!0;return!1}class pt{constructor(t,e={}){this.identity=t,this.options=e}nodesById=new Map;objectsById=new Map;idsByObjectIndex=new Map;roots=[];walkStats=C;project(t){if(!t)return this.nodesById=new Map,this.objectsById=new Map,this.idsByObjectIndex=new Map,this.roots=[],this.walkStats=C,this.walkStats;const{nodes:e,rootIds:r,stats:s}=this.identity.project(t);return this.nodesById=e,this.objectsById=new Map([...e].map(([f,u])=>[f,u.object])),this.idsByObjectIndex=new Map([...e].map(([f,u])=>[u.object,f])),this.roots=r,this.walkStats=s,s}projectSubtrees(t,e){const r=this.identity.incremental;if(t===null||r?.kind!=="live-oid")return null;const s=e.filter((a,l)=>e.indexOf(a)===l&&!e.some(y=>y!==a&&it(a,y))),f=this.roots,u=new Set,d=new Set,i=new Set;for(const a of s)a.traverse(l=>{const y=this.idsByObjectIndex.get(l);if(y===void 0)return;const g=this.nodesById.get(y);g?.parentId!==null&&g?.parentId!==void 0&&i.add(g.parentId),u.add(y),this.nodesById.delete(y),this.objectsById.delete(y),this.idsByObjectIndex.delete(l)});const c=A,o=(a,l)=>{const y=this.objectsById.get(a);return y===void 0||y===l},h=(a,l)=>{const y=$(a);if(y!==void 0&&o(y,a))return y;const g=E(a);if(g!==void 0){const w=B(r.worldId,g);let b=0,k=S(w,b);for(;!o(k,a);)k=S(w,++b);return k}if(!l||j(a,"authoringRoot")===!0){let w=`live:${r.worldId}:${x++}`;for(;!o(w,a);)w=`live:${r.worldId}:${x++}`;return w}return null},p=(a,l,y)=>{if(c(a))return;const g=h(a,y);g!==null&&(P(a,g),this.nodesById.set(g,{object:a,id:g,parentId:l,childIds:[]}),this.objectsById.set(g,a),this.idsByObjectIndex.set(a,g),d.add(g),l!==null&&i.add(l));const w=g??l,b=y||g!==null;for(const k of a.children)p(k,w,b)};for(const a of s){if(!_(a,t))continue;let l=a.parent,y=null;for(;l!==null&&l!==t;){const g=this.idsByObjectIndex.get(l);if(g!==void 0){y=g;break}l=l.parent}p(a,y,y!==null)}const m=a=>{const l=[],y=g=>{if(c(g))return;const w=this.idsByObjectIndex.get(g);if(w!==void 0){l.push(w);return}for(const b of g.children)y(b)};for(const g of a.children)y(g);return l};for(const a of i){const l=this.nodesById.get(a);l!==void 0&&l.childIds.splice(0,l.childIds.length,...m(l.object))}for(const a of d){const l=this.nodesById.get(a);l!==void 0&&l.childIds.splice(0,l.childIds.length,...m(l.object))}const O=m(t),I=this.roots.filter(a=>{const l=this.objectsById.get(a);return l!==void 0&&!_(l,t)&&!u.has(a)});this.roots=[...O,...I],this.walkStats=L(this.nodesById);const v=f.length!==this.roots.length||f.some((a,l)=>a!==this.roots[l]);return{removedIds:u,addedIds:d,changedParentIds:i,rootsChanged:v}}get nodes(){return this.nodesById}get objects(){return this.objectsById}get idsByObject(){return this.idsByObjectIndex}get rootIds(){return this.roots}get stats(){return this.walkStats}node(t){return this.nodesById.get(t)??null}rootNodes(){return this.roots.map(t=>this.nodesById.get(t)).filter(t=>t!==void 0)}objectOf(t){return this.objectsById.get(t)??null}idOf(t){return this.idsByObjectIndex.get(t)??null}childIdsOf(t){const e=[];for(const r of t){const s=this.idsByObjectIndex.get(r);s!==void 0&&e.push(s)}return e}objectMapSnapshot(){return new Map(this.objectsById)}pick(t,e,r,s){return et(t,e,r,s,this.pickProjection())}candidates(t,e,r,s){return D(t,e,r,s,this.pickProjection())}pickProjection(){if(this.options.pickScope!=="store-object-map")return{objects:this.objectsById.values(),idForObject3D:t=>this.idOf(t)}}}export{pt as T,at as a,ut as b,lt as c,ft as d,J as e,ht as n,Y as o,Z as r,dt as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{dc as k,dE as B,V as v,aB as E,aF as X,dA as O,fE as z,fF as R,aH as P,fG as U,bT as W,fH as G,aq as N,bU as L,fI as Q,fJ as C,bR as Y,bS as Z,k as q,bV as ee}from"./index-GIL7oGEO.js";import{c as te,p as x,m as re,a as se}from"./source-persistence-backend-C-aR-B_Y.js";import{J as oe,c as ie}from"./json-history-resource-BbxllWfV.js";import{r as f,d as ne,a as ae}from"./ingest-source-persistence-C_6Hiyra.js";import{r as ce}from"./three-projection-core-BmKMZ-nf.js";import{a as _,T as le,n as he,b as ue}from"./three-CDSueJyJ.js";import{bodyOwningNode as T}from"./body-marks-h_xDxiDE.js";import{colorMaterialOf as y}from"./structural-ids-Dc-7rEwi.js";import{object3DAuthoringSubjectOf as F}from"./object3d-authoring-subject-CH5sI2oP.js";import{createRapierBodyEditing as de}from"./rapier-physics-adapter-CaZqWLu0.js";import{getUserData as m}from"./user-data-BB2Of6Ht.js";import{p as fe,b as me}from"./r3f-physics-binding-BBo8oma9.js";const pe={position:{owner:"self",member:"position",kind:"vector3"},rotation:{owner:"self",member:"rotation",kind:"euler"},scale:{owner:"self",member:"scale",kind:"vector3"},visible:{owner:"self",member:"visible",kind:"boolean"},name:{owner:"self",member:"name",kind:"string"},"material.color":{owner:"material",member:"color",kind:"color"},"light.color":{owner:"self",member:"color",kind:"color"},"light.intensity":{owner:"self",member:"intensity",kind:"number"},"light.distance":{owner:"self",member:"distance",kind:"number"},"camera.fov":{owner:"self",member:"fov",kind:"number"},"camera.near":{owner:"self",member:"near",kind:"number"},"camera.far":{owner:"self",member:"far",kind:"number"},"shadow.cast":{owner:"self",member:"castShadow",kind:"boolean"},"shadow.receive":{owner:"self",member:"receiveShadow",kind:"boolean"}},be={position:{owner:"self",member:"position",kind:"vector2",componentMembers:["x","y"]},rotation:{owner:"self",member:"rotation",kind:"number"},scale:{owner:"self",member:"scale",kind:"vector2"},visible:{owner:"self",member:"visible",kind:"boolean"},name:{owner:"self",member:"label",kind:"string"},alpha:{owner:"self",member:"alpha",kind:"number"},tint:{owner:"self",member:"tint",kind:"color"}},ye={position:{owner:"self",member:"position",kind:"vector3"},rotation:{owner:"self",member:"rotation",kind:"euler"},scale:{owner:"self",member:"scaling",kind:"vector3"},name:{owner:"self",member:"name",kind:"string"},visible:{owner:"self",member:"isVisible",kind:"boolean"},visibility:{owner:"self",member:"visibility",kind:"number"}};function D(l,t="three"){return(t==="pixi"?be:t==="babylon"?ye:pe)[l]??null}const J="the game's own JSX source (source-stamp write-back)",S={position:"position",rotation:"rotation",scale:"scale",visible:"visible",name:"name","material.color":"color","light.color":"color","light.intensity":"intensity","light.distance":"distance","camera.fov":"fov","camera.near":"near","camera.far":"far","shadow.cast":"castShadow","shadow.receive":"receiveShadow"};function H(l){const t=Math.round(l*1e4)/1e4;return Object.is(t,-0)?"0":String(t)}function K(l,t){const e=D(l)?.kind;return e==="vector3"||e==="euler"?!Array.isArray(t)||t.length!==3||!t.every(r=>typeof r=="number"&&Number.isFinite(r))?null:`[${t.map(H).join(", ")}]`:e==="number"?typeof t=="number"&&Number.isFinite(t)?H(t):null:e==="boolean"?typeof t=="boolean"?String(t):null:(e==="color"||e==="string")&&typeof t=="string"?t.replace(/["\\]/g,""):null}function V(l,t){const e=fe(l??void 0,t);if(e)return e;const r=l?.r3fAuthoring;if(!r||t!=="position"&&t!=="rotation"&&t!=="scale")return null;const s=`<${l?.tag??"this component"}>`;return r.simulationOwnedTransform===!0?`${s} drives its own ${t} every frame — this instance is placed by the simulation, not by the editor`:r.transformProps.includes(t)?null:`${s} does not forward ${t} to its native root`}function I(l){const t=l.file.replaceAll("\\","/"),e=X()?.rootPath.replaceAll("\\","/").replace(/\/$/,""),r=e&&t.startsWith(`${e}/`)?t.slice(e.length+1):t;return{anchored:!0,kind:"source",file:r,line:l.line,col:l.col,display:`${r}:${l.line}`}}async function Me(l){try{const e=await(l??k("Live source locations"))?.index?.();return r=>{const s=e?.[r];return s?I(s):null}}catch{return()=>null}}async function ge(l,t,e){const r=l.writeProp;if(!r)throw new Error("the gesture-scoped source writer cannot write JSX props");let s=0;for(const{property:o,text:i}of e){const a=await r(t,o,i,{addIfMissing:!0,allowShapeUpgrade:!0});if(a.dynamic)throw new Error(`${o} is bound to a JSX expression, not an authored literal`);if(!a.changed&&a.error)throw new Error(a.error);a.changed&&s++}return s}function ve(l){const t=l.backend??k("The Play→source transform committer"),e=B(t,l.history),r=o=>o?!e?.runGesture||!e.writeProp||!e.index?{available:!1,reason:"This editor session cannot open a checksum-guarded project-source gesture."}:{available:!0}:{available:!1,reason:"This live node has no OID source stamp, so no authored literal owns its pose."},s=o=>(v.warn(`[play] Commit live transform to source refused: ${o}`,"play-mode"),{destination:E,persisted:!1});return{availability:r,async commit(o,i){const a=r(o);if(!a.available||!o||!e?.runGesture||!e.index)return s(a.reason??"the source writer is unavailable");const c=(await e.index())[o]??null;if(!c)return s(`the current source index has no entry for OID "${o}"`);const h=["position","rotation","scale"].map(d=>{const j=V(c,d);if(j)throw new Error(j);const w=i[d],$=w===void 0?null:K(d,w);if($===null)throw new Error(`${d} is not a finite transform literal`);return{property:d,text:$}});let u;try{u=await e.runGesture("Commit Play Transform to Source",d=>ge(d,o,h))}catch(d){return s(d instanceof Error?d.message:String(d))}return u===0?(v.log("[play] Source already matches the selected live transform.","play-mode"),{destination:"source already matched the live transform",persisted:!1}):(v.log(`[play] Committed ${u} live transform literal(s) to ${c.file}:${c.line}.`,"play-mode"),{destination:J,persisted:!0})}}}function we(l){let t=null,e=new Map,r=!1;const s=async()=>{const n=t?.index;if(n)try{e=new Map(Object.entries(await n.call(t))),r=!0}catch{}},o=n=>n?e.get(n)??null:null,i=n=>{const c=o(n);return c?I(c).display:null},a=(n,c)=>{if(!n)return{ok:!1,reason:"this object carries no source stamp — the game built it at runtime rather than writing it as an element of its own source"};if(!t?.writeProp)return{ok:!1,reason:"this editor tier cannot write project source"};const h=S[c];if(!h)return{ok:!1,reason:`${c} has no JSX attribute this seam can write`};const u=V(o(n),h);if(u)return{ok:!1,reason:u};if(!O()){const d=i(n);return{ok:!1,reason:`${d?`written at ${d}`:"source-stamped"}, but this game is playing — hold it to author`}}return{ok:!0}};return{attach(){const n=l.backend??k("This world’s OID source persistence")??null;t=n?B(n,l.history)??n:null,s()},anchor(n){const c=e.get(n);return c?I(c):null},physicsPlaced(n,c){return me(o(n)??void 0,S[c]??c)},describe({sourceOid:n,property:c}){const h=a(n,c);if(!h.ok)return`Live-only edit — ${h.reason}.`;const u=i(n);return u?`Persisting to ${u}.`:`Persisting to this element's own JSX${r?"":" (source index still loading)"}.`},gate({sourceOid:n,property:c}){return a(n,c)},armed:()=>t?.writeProp!==void 0&&O(),report:(n,c)=>f(n,c),async write(n){const c=a(n.sourceOid,n.property);if(!c.ok)return f(n.label,c.reason),!1;const h=S[n.property],u=K(n.property,n.next);if(u===null)return f(n.label,`the new ${n.property} is not a value this seam can spell as a JSX literal`),!1;try{const d=await t.writeProp(n.sourceOid,h,u,{addIfMissing:!0,allowShapeUpgrade:!0});return d.dynamic?(f(n.label,`${h} at ${i(n.sourceOid)??"this element"} is bound to a JSX expression, not a literal`),!1):d.changed?(v.log(`[ingest] ${n.label} written to the game's own source — ${h} → ${i(n.sourceOid)??n.sourceOid}`),s(),!0):(f(n.label,d.error??"the source writer made no change"),!1)}catch(d){return f(n.label,`the write failed: ${d instanceof Error?d.message:String(d)}`),!1}},removal:{available({sourceOid:n,property:c}){return t?.removeProp?a(n,c).ok:!1},async perform(n){const c=a(n.sourceOid,n.property);if(!c.ok||!t?.removeProp)return f(n.label,c.ok?"this editor tier cannot remove project source":c.reason),!1;const h=S[n.property];try{const u=await t.removeProp(n.sourceOid,h);return u.dynamic?(f(n.label,`${h} at ${i(n.sourceOid)??"this element"} is bound to a JSX expression — removing it would delete the game's own wiring, not an override`),!1):u.changed?(v.log(`[ingest] ${n.label} — ${h} dropped from the game's own source at ${i(n.sourceOid)??n.sourceOid}`),s(),!0):(f(n.label,u.error??`${i(n.sourceOid)??"this element"} authors no ${h} attribute, so there was nothing to drop`),!1)}catch(u){return f(n.label,`the removal failed: ${u instanceof Error?u.message:String(u)}`),!1}}},destination(){return t?.writeProp&&O()?J:E},dispose(){t=null,e=new Map,r=!1}}}const Se={source:"live",label:"live",detail:"Running objects adopted from the live scene. Edits affect this session only and are discarded when play stops."},je="Applied to the running world; code that drives this transform each frame may overwrite it.",Oe={source:"foreign",label:"live-only",detail:"Unmodified ingested game — edits apply to the running game for this session only and are never saved."},Ce={source:"foreign",label:"game source",detail:"Ingested game whose own source carries the editor's authoring stamps — a literal JSX prop writes back to the game’s own file (expression-bound props stay read-only)."};function p(l){return l.isLight?l:null}function g(l){const t=l;return t.isPointLight||t.isSpotLight?t:null}function Ie(l){const t=l;return t.isDirectionalLight||t.isPointLight||t.isSpotLight?t:null}function b(l){const t=l;return t.isPerspectiveCamera?t:null}function M(l){const t=l;return t.isMesh&&t.geometry?t.geometry:null}class A{constructor(t,e,r){if(this.store=t,this.options=r,this.sceneRef=e,this.identity=r.identity,this.projector=new le(this.identity,{pickScope:"projection"}),this.persist=r.persistence??null,this.loop=r.loop,this.frameControl=r.frameControl??"adapter",this.provenance=r.provenance??Se,r.sourceCommit){const i={availability:a=>r.sourceCommit.availability(C(this.objectOf(a))),commit:async a=>{const n=this.objectOf(a),c=this.captureChannelBaseline(a)??{},h=await r.sourceCommit.commit(C(n),c);return h.persisted&&this.store.notifyIngestEdit(),h}};Object.assign(this.transforms,{sourceCommit:i})}r.sourceDeclaresStories&&(this.stories=z("three",t,i=>{const a=this.hierarchy.node(i);return a?.role!=="component"?null:{name:a.typeLabel??a.label}})),this.refresh(),this.watchStructure();const s=t.projectHistory;this.historyResource=this.persist&&s?new oe({history:s,kind:"session-state",scope:"session",subject:{...r.journal,id:`${r.journal.id}/live-three-edits`},displayName:"Live edits",capture:()=>this.captureHistoryState(),conflictIdentity:i=>i.edits,restore:async i=>{this.restoreHistoryState(i)}}):null;const o=this.persist;o&&(o.attach({read:(i,a)=>this.readChannel(i,a),apply:(i,a,n)=>this.applyChannel(i,a,n)}),this.persistence={...ie(),get destination(){return o.destination()}},o.readSiteLiterals&&(this.instances=this.creationSiteInstances(o)))}sceneRef;projector;watchedForStructure=new Set;changedStructureRoots=new Set;structureRefreshQueued=!1;disposed=!1;crossSurfaceStructureRevision=0;hasCrossSurfaceStructure=!1;identity;persist;loop;frameControl;instanceLiterals=new Map;instanceLiteralRequests=new Map;markedBodies=de(t=>{const e=this.objectOf(t);if(!e)return{kind:"unresolved"};const r=T(e);return r?{kind:"body",body:r}:{kind:"no-body"}});bodyOwnershipByObject=new WeakMap;physicsFor(t){const e=R();return e&&e.ownerOf(t)!=="unresolved"?e:null}edits={};historyResource;editStartState;editBaseline;capabilities={transform:!0,inspectorFields:!0,persist:!1};stories;instances;provenance;persistence;get scene(){return typeof this.sceneRef=="function"?this.sceneRef():this.sceneRef}refresh(){const t=this.projector.project(this.scene);return this.refreshCrossSurfacePresence(),this.crossSurfaceStructureRevision++,t}crossSurfaceStructureSignature(){return this.hasCrossSurfaceStructure?String(this.crossSurfaceStructureRevision):null}objectCarriesCrossSurfaceStructure(t){return m(t,"authoringHierarchyId")!==void 0||m(t,"authoringHierarchyParentId")!==void 0||m(t,"authoringHierarchyOrder")!==void 0}subtreeCarriesCrossSurfaceStructure(t){let e=!1;return t.traverse(r=>{this.objectCarriesCrossSurfaceStructure(r)&&(e=!0)}),e}refreshCrossSurfacePresence(){this.hasCrossSurfaceStructure=!1;for(const t of this.projector.nodes.values())if(this.objectCarriesCrossSurfaceStructure(t.object)){this.hasCrossSurfaceStructure=!0;return}}onStructureChanged=t=>{P(t.child)||this.disposed||(this.changedStructureRoots.add(t.child),!this.structureRefreshQueued&&(this.structureRefreshQueued=!0,queueMicrotask(()=>{if(this.structureRefreshQueued=!1,this.disposed)return;const e=[...this.changedStructureRoots];this.changedStructureRoots.clear();const r=e.some(o=>this.subtreeCarriesCrossSurfaceStructure(o));for(const o of e)this.unwatchStructureSubtree(o);const s=this.projector.projectSubtrees(this.scene,e);if(s===null)this.refresh(),this.watchStructure();else for(const o of e)this.structureRootIsAttached(o)&&this.watchStructureSubtree(o);r&&(this.refreshCrossSurfacePresence(),this.crossSurfaceStructureRevision++),this.syncAdoptedObjectMap(s??void 0),this.store.notifyIngestObjectMapEdit(s===null?void 0:{changedParentIds:s.changedParentIds,rootsChanged:s.rootsChanged,addedIds:s.addedIds,removedIds:s.removedIds})})))};watchStructure(){for(const e of this.watchedForStructure)e.removeEventListener("childadded",this.onStructureChanged),e.removeEventListener("childremoved",this.onStructureChanged);this.watchedForStructure.clear();const t=this.scene;t&&this.watchStructureSubtree(t)}watchStructureSubtree(t){const e=r=>{if(!(P(r)||this.watchedForStructure.has(r))){r.addEventListener("childadded",this.onStructureChanged),r.addEventListener("childremoved",this.onStructureChanged),this.watchedForStructure.add(r);for(const s of r.children)e(s)}};e(t)}structureRootIsAttached(t){const e=this.scene;if(e===null)return!1;for(let r=t;r!==null;r=r.parent)if(r===e)return!0;return!1}unwatchStructureSubtree(t){t.traverse(e=>{this.watchedForStructure.delete(e)&&(e.removeEventListener("childadded",this.onStructureChanged),e.removeEventListener("childremoved",this.onStructureChanged))})}syncAdoptedObjectMap(t){const e=this.scene;if(!e||this.store.scene!==e)return;const r=this.store.objectMap;if(t===void 0){r.clear();for(const[o,i]of this.projector.objectMapSnapshot())r.set(o,i)}else{for(const o of t.removedIds)r.delete(o);for(const o of t.addedIds){const i=this.projector.objectOf(o);i!==null&&r.set(o,i)}}const s=[...this.store.selectedEntityIds].filter(o=>r.has(o));s.length!==this.store.selectedEntityIds.size&&this.store.selectMultiple(s)}invalidate(){this.refresh()}adoptScene(t){this.sceneRef=t,this.refresh(),this.watchStructure(),this.syncAdoptedObjectMap()}objectOf(t){return this.projector.objectOf(t)}objectMapSnapshot(){return this.projector.objectMapSnapshot()}record(t,e){this.edits[t]={...this.edits[t],...e}}toEditorNode(t){const e=t.object,r=m(e,"authoringHierarchyId"),s=m(e,"authoringHierarchyParentId"),o=m(e,"authoringHierarchyOrder"),i=U(e)&&m(e,"authoringRoot")!==!0,a=m(e,"authoringComponent"),n=(i?m(e,"authoringLabel"):void 0)||e.name||e.type;return{id:t.id,label:n,role:i?"component":"entity",kind:he(e),typeLabel:i?a||n:e.type,parentId:t.parentId,childIds:[...t.childIds],...r===void 0?{}:{crossSurfaceId:r},...s===void 0?{}:{crossSurfaceParentId:s},...o===void 0?{}:{crossSurfaceOrder:o}}}hierarchy={crossSurfaceStructureSignature:()=>this.crossSurfaceStructureSignature(),roots:()=>this.projector.rootNodes().map(t=>this.toEditorNode(t)),node:t=>{const e=this.projector.node(t);return e?this.toEditorNode(e):null},object3D:t=>this.objectOf(t),idForObject3D:t=>this.projector.idOf(t)};selection={get:()=>[...this.store.selectedEntityIds],set:t=>this.store.selectMultiple(t),resolve:(t,e)=>{const r=this.hierarchy.node(t);if(!r)return null;const s=[];let o=r,i=0;for(;o&&i++<1e3;)(o.role==="component"||o.role==="instance")&&s.push(o),o=o.parentId?this.hierarchy.node(o.parentId):null;const a=s.reverse();if(a.length===0)return{id:t};const n=e?.scopeId?a.findIndex(u=>u.id===e.scopeId):-1,c=n>=0?Math.min(n+1,a.length-1):0,h=e?.intent==="deep"?Math.min(c+1,a.length-1):c;return{id:a[h].id}}};pickable={pick:(t,e)=>(this.refresh(),this.projector.pick(this.store,t,e)),candidates:(t,e)=>(this.refresh(),this.projector.candidates(this.store,t,e))};truth={resolve:(t,e)=>{const r=this.anchorFor(t,e);return{site:r.anchor,writeAnchorKind:r.anchorKind}}};related=te(t=>this.truth.resolve(t,"position").site);transforms={get:t=>ce(this.objectOf(t)),editability:(t,e)=>{if(!this.objectOf(t))return{writable:!1,reason:G};const r=N();return r?.networkId(t)&&!r.editable(t)?{writable:!1,reason:"This transform is controlled by remote or server network authority."}:this.bodyOwns(t)?{writable:!0,reason:"Moves the physics body that owns this node.",...this.removableFlag(t,e)}:this.frameControl==="host"&&this.store.playState==="playing"?{writable:!0,reason:je,...this.removableFlag(t,e)}:this.persist?{writable:!0,reason:this.persist.describe(this.anchorFor(t,e)),...this.removableFlag(t,e)}:{writable:!0}},beginEdit:t=>{this.historyResource?.assertCanMutate(),!(!this.objectOf(t)||!this.editableByNetwork(t))&&(this.loop?.pause(),this.physicsFor(t)?.freeze(t),this.markedBodies.freeze(t),this.editStartState=this.persist?this.captureHistoryState():void 0,this.editBaseline=void 0)},apply:(t,e)=>{!this.objectOf(t)||!this.editableByNetwork(t)||(this.persist&&!this.editBaseline&&(this.editBaseline=this.captureChannelBaseline(t)),this.writeTransform(t,e),this.physicsFor(t)?.commit(t,e),this.markedBodies.commit(t,e),this.store.notifyIngestEdit())},endEdit:t=>{this.loop?.resume();const e=this.objectOf(t),r=`Transform ${e?.name||"Object"}`,s=this.editStartState,o=this.editBaseline;return this.editStartState=void 0,this.editBaseline=void 0,e&&(this.physicsFor(t)?.unfreeze(t),this.markedBodies.unfreeze(t),this.store.notifyIngestEdit()),this.persist?this.persistOrJournal(t,r,s,o):void 0},remove:(t,e)=>{if(this.persist?.removal)return W(this.pipedRemove(t,e))}};removableFlag(t,e){const r=this.persist?.removal;return r?r.available(this.anchorFor(t,e))?{removable:!0}:{}:{}}pipedRemove(t,e){const r=this.persist,s=r.removal,o=`Remove ${this.objectOf(t)?.name||"Object"} ${e}`;return{resolve:()=>{const i=this.anchorFor(t,e);return s.available(i)?i.anchorKind==="live-only"?L(r.describe(i)):{reaches:"writer",anchorKind:i.anchorKind,destination:r.destination(),write:()=>s.perform({...i,label:o})}:L(r.describe(i))},record:()=>{},report:i=>{r.armed()&&r.report(o,i)}}}bodyOwns(t){const e=this.objectOf(t);if(!e)return!1;const r=this.bodyOwnershipByObject.get(e);if(r!==void 0)return r;const s=R()?.ownerOf(t);if(s==="physics")return this.bodyOwnershipByObject.set(e,!0),!0;const o=T(e)!==void 0;return(o||s==="editor")&&this.bodyOwnershipByObject.set(e,o),o}editableByNetwork(t){const e=N();return e?e.editable(t):!0}inspector={properties:t=>{const e=this.objectOf(t);if(!e)return[];const r=[{path:"name",label:"Name",type:"string"},{path:"visible",label:"Visible",type:"boolean"},{path:"object.type",label:"Native type",type:"string",readonly:!0}],s=F(e);return s?.fields&&r.push(...s.fields().filter(i=>!["name","visible"].includes(i.path)).map(({value:i,...a})=>a)),y(e)&&r.push({path:"material.color",label:"Color",type:"color",group:"Material"}),p(e)&&(r.push({path:"light.intensity",label:"Intensity",type:"number"}),r.push({path:"light.color",label:"Light Color",type:"color"}),g(e)&&r.push({path:"light.distance",label:"Distance",type:"number"}),Ie(e)&&r.push({path:"shadow.cast",label:"Cast Shadow",type:"boolean"})),b(e)&&(r.push({path:"camera.fov",label:"FOV",type:"number"}),r.push({path:"camera.near",label:"Near",type:"number"}),r.push({path:"camera.far",label:"Far",type:"number"})),M(e)&&(r.push({path:"mesh.vertices",label:"Vertices",type:"number",readonly:!0}),r.push({path:"shadow.cast",label:"Cast Shadow",type:"boolean"}),r.push({path:"shadow.receive",label:"Receive Shadow",type:"boolean"})),r},get:(t,e)=>{const r=this.objectOf(t);if(!r)return;if(e==="name")return r.name;if(e==="visible")return r.visible;if(e==="object.type")return r.type;const s=F(r)?.fields?.().find(o=>o.path===e);if(s)return s.value();if(e==="material.color"){const o=y(r);return o?`#${o.color.getHexString()}`:void 0}if(e==="light.intensity")return p(r)?.intensity;if(e==="light.distance")return g(r)?.distance;if(e==="light.color"){const o=p(r);return o?`#${o.color.getHexString()}`:void 0}if(e==="camera.fov")return b(r)?.fov;if(e==="camera.near")return b(r)?.near;if(e==="camera.far")return b(r)?.far;if(e==="mesh.vertices"){const o=M(r);return o?o.getAttribute("position")?.count??0:void 0}if(e==="shadow.cast")return r.castShadow;if(e==="shadow.receive")return r.receiveShadow},set:(t,e,r)=>{if(this.historyResource?.assertCanMutate(),!this.persist){this.writeProp(t,e,r);return}const s=this.captureHistoryState(),o=this.readChannel(t,e);this.writeProp(t,e,r);const i=`Set ${this.objectOf(t)?.name||"Object"} ${e}`,a=this.readChannel(t,e);if(!(o!==void 0&&a!==void 0&&JSON.stringify(o)!==JSON.stringify(a))){this.recordHistory(i,s);return}return x({backend:this.persist,subject:()=>this.anchorFor(t,e),baseline:o,next:a,label:i,journal:()=>this.recordHistory(i,s)})}};subscribe(t){return this.store.subscribe(t)}dispose(){this.disposed=!0;for(const t of this.watchedForStructure)t.removeEventListener("childadded",this.onStructureChanged),t.removeEventListener("childremoved",this.onStructureChanged);this.watchedForStructure.clear(),this.changedStructureRoots.clear(),this.historyResource?.dispose(),this.persist?.dispose()}readChannel(t,e){const r=this.objectOf(t);if(r)return e==="position"?r.position.toArray():e==="rotation"?[r.rotation.x,r.rotation.y,r.rotation.z]:e==="scale"?r.scale.toArray():this.inspector.get(t,e)}applyChannel(t,e,r){const s=this.objectOf(t);if(s){if(e==="position"&&Array.isArray(r))s.position.fromArray(r);else if(e==="rotation"&&Array.isArray(r)){const[o,i,a]=r;s.rotation.set(o??0,i??0,a??0)}else if(e==="scale"&&Array.isArray(r))s.scale.fromArray(r);else{this.writeProp(t,e,r);return}this.store.notifyIngestEdit()}}writeTransform(t,e){this.historyResource?.assertCanMutate();const r=this.objectOf(t);r&&(r.position.set(e.position[0],e.position[1],e.position[2]),r.quaternion.set(e.rotation[0],e.rotation[1],e.rotation[2],e.rotation[3]),r.scale.set(e.scale[0],e.scale[1],e.scale[2]),this.record(t,{position:e.position,rotation:e.rotation,scale:e.scale}))}writeProp(t,e,r){const s=this.objectOf(t);if(s){if(e==="name")s.name=String(r);else if(e==="visible")s.visible=!!r,this.record(t,{visible:s.visible});else if(e==="material.color"){const o=y(s);o&&(o.color.set(String(r)),this.record(t,{color:`#${o.color.getHexString()}`}))}else if(e==="light.intensity"){const o=p(s);o&&(o.intensity=Number(r))}else if(e==="light.distance"){const o=g(s);o&&(o.distance=Number(r))}else if(e==="light.color")p(s)?.color.set(String(r));else if(e==="camera.fov"||e==="camera.near"||e==="camera.far"){const o=b(s);o&&(o[e.split(".")[1]]=Number(r),o.updateProjectionMatrix())}else e==="shadow.cast"?s.castShadow=!!r:e==="shadow.receive"&&(s.receiveShadow=!!r);this.store.notifyIngestEdit()}}anchorFor(t,e){const r=this.objectOf(t),s=D(e),o=r&&s?.owner==="material"?y(r):r,i=s?.owner==="material"?Q(o):C(o),a=i?this.persist?.anchor?.(i):null;if(a){const h=i?this.persist?.physicsPlaced?.(i,e):!1;return{entityId:t,property:e,anchor:a,anchorKind:h?"physics-binding":"source-prop",instances:1,sourceOid:i}}const n=ne(o);if(n!==null)return{entityId:t,property:e,anchor:ae(n),anchorKind:"data-record",instances:1,...i?{sourceOid:i}:{}};const c=i?this.options.sourceAnchor?.(i)??{anchored:!1,reason:"The source index has not resolved this object’s OID."}:Y(o??null);return{entityId:t,property:e,anchor:c,anchorKind:i?this.persist?.anchor?"source-prop":"live-only":c.anchored?"construction-literal":"live-only",instances:c.anchored&&c.kind==="source"?i?1:Z(c):0,...i?{sourceOid:i}:{}}}measureWriteReach(){this.refresh();let t=0;const e=q();for(const r of this.projector.nodes.keys()){const s=this.anchorFor(r,"position");e[s.anchorKind]++,s.anchor.anchored&&t++}return{addressable:t,total:this.projector.nodes.size,destination:this.persist?.destination()??E,byKind:e}}captureChannelBaseline(t){const e=this.objectOf(t);if(e)return{position:e.position.toArray(),rotation:[e.rotation.x,e.rotation.y,e.rotation.z],scale:e.scale.toArray()}}persistOrJournal(t,e,r,s){const o=this.persist;if(!o)return;const i=s?this.captureChannelBaseline(t):void 0,a=s&&i?Object.keys(s).filter(c=>JSON.stringify(s[c])!==JSON.stringify(i[c])):[];a.length>1&&o.report(e,re(a));const n=a.length===1?a[0]:null;if(n===null){this.recordHistory(e,r);return}return x({backend:o,subject:()=>this.anchorFor(t,n),baseline:s[n],next:i[n],label:e,journal:()=>this.recordHistory(e,r)})}creationSiteKey(t){const e=t.anchor;return e.anchored&&e.kind==="source"?`${e.file}:${e.line}:${e.col}`:null}instancePropertyPaths(t,e){const r=["position","rotation","scale",...this.inspector.properties(t).filter(s=>!s.readonly).map(s=>s.path)];return[...new Set(r)].filter(s=>this.creationSiteKey(this.anchorFor(t,s))===e)}loadInstanceLiterals(t,e,r,s){const o=this.instanceLiteralRequests.get(s);if(o)return o;const i=this.instancePropertyPaths(e,s).map(n=>({property:n,live:this.readChannel(e,n)})).filter(n=>n.live!==void 0),a=t.readSiteLiterals({anchor:r.anchor,instances:r.instances,writeScope:"creation-site",properties:i}).then(n=>(this.instanceLiterals.set(s,n),this.store.notifyIngestEdit(),n));return this.instanceLiteralRequests.set(s,a),a}sameInstanceValue(t,e){return Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every((r,s)=>this.sameInstanceValue(r,e[s])):typeof t=="number"&&typeof e=="number"?Math.abs(t-e)<=1e-6:t===e}instanceComponentName(t){return t.constructor.name||t.type}instanceCountLabel(t){return`${t} ${t===1?"instance":"instances"}`}instanceOverride(t,e,r,s,o){const i=s[r],a=this.readChannel(e,r);if(!i||i.literal===null||a===void 0||this.sameInstanceValue(i.literal,a))return null;const n=t.gate({...this.anchorFor(e,r),writeScope:"creation-site"}),c=i.writable?n.ok?void 0:n.reason:i.reason,h=this.inspector.properties(e).find(u=>u.path===r)?.label??r;return{path:r,label:h,value:a,...i.text?{defaultText:i.text}:{},canApplyToComponent:c===void 0,...c?{applyUnavailableReason:c}:{},affectedInstanceCount:o.instances}}async applyInstanceDefault(t,e,r,s){const o={...this.anchorFor(r,s),writeScope:"creation-site"},i=this.creationSiteKey(o);if(!i)return{changed:!1,message:"This object has no source site."};const a=this.objectOf(r);if(!a)return{changed:!1,message:"This object is no longer in the live world."};const n=(await e(r,o,i))[s];if(!n)return{changed:!1,message:`The construction site names no ${s}.`};if(n.literal===null)return{changed:!1,message:`The construction site names no ${s} default.`};const c=this.readChannel(r,s);if(c===void 0)return{changed:!1,message:`${s} has no live value.`};if(!n.writable)return{changed:!1,message:n.reason??`${s} cannot be rewritten.`};const h=t.gate(o);if(!h.ok)return{changed:!1,message:h.reason};const u=o.instances,d=`Apply ${s} to ${this.instanceComponentName(a)} default (${this.instanceCountLabel(u)})`;if(!await t.write({...o,baseline:n.literal,next:c,label:d}))return{changed:!1,message:`${d} did not land; the console names why.`};this.instanceLiterals.delete(i),this.instanceLiteralRequests.delete(i),this.store.notifyIngestEdit();const w=o.anchor.anchored?o.anchor.display:"this source site";return{changed:!0,message:`${s} now applies to all ${this.instanceCountLabel(u)} from ${w}.`,write:{destination:w,persisted:!0}}}creationSiteInstances(t){const e=async(r,s,o)=>this.instanceLiterals.get(o)??this.loadInstanceLiterals(t,r,s,o);return{describe:r=>{const s=this.anchorFor(r,"position"),o=this.creationSiteKey(s),i=this.objectOf(r);if(!o||!i)return null;const a=this.instanceLiterals.get(o);if(!a)return this.loadInstanceLiterals(t,r,s,o),null;if(Object.keys(a).length===0)return null;const n=this.instancePropertyPaths(r,o).map(c=>this.instanceOverride(t,r,c,a,s)).filter(c=>c!==null);return{componentName:this.instanceComponentName(i),...s.anchor.anchored?{sourcePath:s.anchor.display}:{},overrides:n}},revert:async(r,s)=>{const o=this.anchorFor(r,"position"),i=this.creationSiteKey(o);if(!i)return;const a=await e(r,o,i),n=this.captureHistoryState();let c=0;for(const h of s){const u=a[h]?.literal;u!=null&&(this.applyChannel(r,h,u),c++)}return c>0&&this.recordHistory(`Revert ${c} instance override(s)`,n),c>0?ee:void 0},applyToComponent:(r,s)=>this.applyInstanceDefault(t,e,r,s)}}recordHistory(t,e){!this.historyResource||!e||this.historyResource.record(t,e,this.captureHistoryState()).catch(r=>{v.error(`[ingest] failed to journal "${t}" into project history — the edit is applied but has no history entry (it cannot be undone): ${r instanceof Error?r.message:String(r)}`)})}captureHistoryState(){const t={};for(const[e,r]of this.projector.nodes){const s=r.object,o=y(s),i=p(s),a=b(s);t[e]={name:s.name,visible:s.visible,transform:this.transforms.get(e),...o?{color:`#${o.color.getHexString()}`}:{},...i?{lightIntensity:i.intensity,lightColor:`#${i.color.getHexString()}`,...g(s)?{lightDistance:g(s).distance}:{}}:{},...a?{camera:{fov:a.fov,near:a.near,far:a.far}}:{},castShadow:s.castShadow,receiveShadow:s.receiveShadow}}return{edits:structuredClone(this.edits),objects:t}}restoreHistoryState(t){for(const[e,r]of Object.entries(t.objects)){const s=this.objectOf(e);if(!s)continue;s.name=r.name,s.visible=r.visible,s.position.fromArray(r.transform.position),s.quaternion.fromArray(r.transform.rotation),s.scale.fromArray(r.transform.scale),this.physicsFor(e)?.commit(e,r.transform),this.markedBodies.commit(e,r.transform),r.color&&y(s)?.color.set(r.color);const o=p(s);if(o&&(r.lightIntensity!==void 0&&(o.intensity=r.lightIntensity),r.lightColor&&o.color.set(r.lightColor),r.lightDistance!==void 0)){const a=g(s);a&&(a.distance=r.lightDistance)}const i=b(s);i&&r.camera&&(i.fov=r.camera.fov,i.near=r.camera.near,i.far=r.camera.far,i.updateProjectionMatrix()),s.castShadow=r.castShadow,s.receiveShadow=r.receiveShadow}this.edits=structuredClone(t.edits),this.store.notifyIngestEdit()}}function Be(l,t,e){return new A(l,t,{identity:ue({camera:e.camera}),journal:e.journal,persistence:se({history:l.projectHistory,writer:e.sourceWriter}),loop:e.loop,...e.frameControl?{frameControl:e.frameControl}:{},provenance:Oe})}function _e(l,t,e){return new A(l,t,{identity:_(e.worldId,{camera:e.camera}),journal:e.journal,persistence:we({history:l.projectHistory,backend:e.backend}),loop:e.loop,...e.frameControl?{frameControl:e.frameControl}:{},provenance:Ce,sourceDeclaresStories:!0})}function De(l,t,e,r,s={}){return new A(l,t,{identity:_(e),journal:r,frameControl:"host",sourceAnchor:s.sourceAnchor,...s.explicitSourceCommit?{sourceCommit:ve({history:l.projectHistory,...s.backend?{backend:s.backend}:{}})}:{}})}export{_e as a,De as o,Me as r,Be as s};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/r3f-design-session-D-4yyDO9.js","assets/index-GIL7oGEO.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/three.module-D396a9Mn.js","assets/index-D2fNXpHa.css","assets/edit-mode-authoring-B47TfLqu.js","assets/entry-adjudication-Cq8Yeb74.js","assets/r3f-root-factory-z9llD1OU.js","assets/register-render-vitals-BiZk29b2.js","assets/render-census-BrQX_CXv.js","assets/structural-signature-0w-i_ats.js","assets/render-vitals-BZ5HtvMi.js","assets/static-batch-advisor-B13QEH7d.js","assets/webgl-frame-capture-FlF9zQmW.js","assets/world-state-BWG-IcOd.js","assets/debug-registry-Dgvitx8M.js","assets/frame-selector-cache-cCeUbcjG.js","assets/dev-build-gDYrq68M.js","assets/game-input-seams-CIQdetRw.js","assets/seeded-random-i3mtgBKZ.js","assets/render-seed-DF4JHy7P.js","assets/frame-delta-D2nsw_Ht.js","assets/events-156d8d12.esm-ErOhDXXB.js","assets/index-bQE2NA0D.js","assets/realm-services-CobQsq_X.js","assets/canvas-entry-runtime-SfBxaR9M.js","assets/three-ingest-runtime-QzDYk6tU.js","assets/EffectComposer-DQxfsXBZ.js","assets/CopyShader-BzTUYzf6.js","assets/ShaderPass-QYRpPuFJ.js","assets/CSS3DRenderer-CL7ABLVK.js","assets/scene-framing-Cat0GtyJ.js","assets/native-debug-module-CWicoSGD.js","assets/native-entry-surface-BE8LJNdu.js","assets/playtest-BXIL1JEF.js","assets/game-contract-seams-a5YXejOu.js","assets/assets-BuSoGjBX.js","assets/loader-CaF_I7Yt.js","assets/game-loop-CZvXlY00.js","assets/frame-pacing-D5acoOzO.js","assets/create-runtime-CVCc1BDx.js","assets/adapter-surface-Y37Nzcyw.js","assets/binding-Bmxqznjk.js","assets/setup-renderer-DVXaSGin.js","assets/index-BcCBqgM_.js","assets/defaults-DKiBJCPN.js","assets/render-settings-Bw4W9SYF.js","assets/render-features-CPQ_e568.js","assets/game-DHOZVb-7.js","assets/loop-gate-report-N52EWFGD.js","assets/system-slot-E2mEdiih.js","assets/user-data-BB2Of6Ht.js","assets/object-marks-DwvIEBOK.js","assets/sim-clock-CLflx7kg.js","assets/system-runner-DkOjxEBt.js","assets/performance-profiler-D_Jey87L.js","assets/input-manager-DH_hGW6d.js","assets/asset-parse-error-BHMwBRU3.js","assets/binding-identity-DcTpbvyg.js","assets/prompt-labels-DSMdM2_B.js","assets/schema-kl9-2B_J.js","assets/gameplay-rng-trap-CTNhm-UW.js","assets/state-bridge-DLP1jLRW.js","assets/input-router-BNQvtIqw.js","assets/render-control-Df3yTiyr.js","assets/live-gesture-lock-DJbrjOqf.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as m,aP as p}from"./index-GIL7oGEO.js";import{r as s}from"./design-time-mount-registry-DUpXCg1U.js";import{q as n}from"./edit-mode-authoring-B47TfLqu.js";import{a}from"./json-history-resource-BbxllWfV.js";import{o as u}from"./three-authoring-adapter-CmSQ3Vui.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"./three.module-D396a9Mn.js";import"./source-persistence-backend-C-aR-B_Y.js";import"./ingest-source-persistence-C_6Hiyra.js";import"./three-projection-core-BmKMZ-nf.js";import"./three-CDSueJyJ.js";import"./viewport-pick-context-DkawXbEi.js";import"./body-marks-h_xDxiDE.js";import"./user-data-BB2Of6Ht.js";import"./object-marks-DwvIEBOK.js";import"./structural-ids-Dc-7rEwi.js";import"./object3d-authoring-subject-CH5sI2oP.js";import"./rapier-physics-adapter-CaZqWLu0.js";import"./r3f-physics-binding-BBo8oma9.js";const V="workspace.service";function W(){const t=m(()=>import("./r3f-design-session-D-4yyDO9.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,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72]));t.catch(()=>{});const i=p("three",(o,r)=>u(o,()=>o.scene,r,a(r))),e=s({kind:"three",owner:"@volter/editor-game/three/three-authoring",mountWorldRootSession:async o=>{const{mountR3FDesignSession:r}=await t;return r(o.store,o.composite,o.renderer)}});return n(),()=>{e(),i()}}export{V as point,W as start};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{T as n}from"./three.module-D396a9Mn.js";import{EffectComposer as i}from"./EffectComposer-DQxfsXBZ.js";import{CSS3DRenderer as s}from"./CSS3DRenderer-CL7ABLVK.js";import{Q as m,U as c}from"./index-GIL7oGEO.js";const a={three:n,EffectComposer:i,CSS3DRenderer:s};let r=null;async function f(){const e=await import(c),t=["projectThree","EffectComposer","CSS3DRenderer"].filter(o=>e[o]===void 0||e[o]===null);if(t.length>0)throw new Error(`The packaged runtime's synthetic three-ingest module did not export ${t.join(", ")} — see vite-plugin-module-doorways.ts.`);return{three:e.projectThree,EffectComposer:e.EffectComposer,CSS3DRenderer:e.CSS3DRenderer}}async function h(){return await m()?(r||(r=f()),r):a}export{h as r};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{aH as f,aI as n}from"./index-GIL7oGEO.js";import{o as h,n as I}from"./three-CDSueJyJ.js";import{V as u,Q as O}from"./three.module-D396a9Mn.js";const l=new u,p=new O,c=new u;function m(o){return o.matrixAutoUpdate===!1?(o.matrix.decompose(l,p,c),{position:l.toArray(),quaternion:p.toArray(),scale:c.toArray()}):{position:o.position.toArray(),quaternion:o.quaternion.toArray(),scale:o.scale.toArray()}}function y(o,t){return o.length===t.length&&o.every((e,r)=>e===t[r])}class S{constructor(t){this.options=t,this.selected=[...t.initial]}adopted=[];selected;current(){const t=[...this.options.store.selectedEntityIds].filter(this.options.owns);return y(t,this.adopted)||(this.adopted=t,this.selected=t,this.options.onChange?.(t)),[...this.selected]}publish(t){this.selected=[...t];const e=this.selected.filter(this.options.owns);this.adopted=e,this.options.onChange?.(e),this.options.store.selectMultiple(e)}}function v(o){if(!o)return{position:[0,0,0],rotation:[0,0,0,1],scale:[1,1,1]};const t=m(o);return{position:t.position,rotation:t.quaternion,scale:t.scale}}function a(o){return o.type==="Object3D"&&o.name===""&&h(o)===null&&o.userData.oid===void 0&&n(o,"authoringInstance")===void 0&&n(o,"authoringRoot")!==!0&&n(o,"vgaiComponentRoot")===void 0}class q{constructor(t){this.options=t,this.rootIdSet=new Set(t.rootIds)}rootIdSet;childObjects(t){return t.children.flatMap(e=>f(e)?[]:a(e)?this.childObjects(e):[e])}childIds(t){return this.options.projector.childIdsOf(this.childObjects(t))}rootObjects(){return this.options.rootIds.flatMap(t=>{const e=this.options.projector.objectOf(t);return e?a(e)?this.childObjects(e):[e]:[]})}rootIds(){return this.options.projector.childIdsOf(this.rootObjects())}parentId(t){const{projector:e,scene:r,documentNodeId:i}=this.options,d=e.idOf(t);if(d!==null&&this.rootIdSet.has(d))return i;let s=t.parent;for(;s&&s!==r&&a(s);)s=s.parent;return s&&s!==r?e.idOf(s)??i:i}node(t){const e=h(t);return{id:this.options.projector.idOf(t),label:e?.label||t.name||t.type||"Object3D",role:"entity",kind:I(t),...e?.typeLabel?{typeLabel:e.typeLabel}:{},parentId:this.parentId(t),childIds:this.childIds(t)}}}export{q as C,S,v as r};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./jsx-runtime-DPjLkJKQ.js";import{r as s}from"./index-nmcBqr7Y.js";import"./index-CtzuWnCS.js";import{fe as l,a9 as n,ff as d,fg as a,fh as c}from"./index-GIL7oGEO.js";import{s as u,o as i}from"./viewport-shading-boundary-B_-_gABg.js";function f(){const t=c("viewport.frameSelection");return`Orbit: right-drag (or Alt+drag) · Pan: middle-drag · Zoom: wheel${t?` · ${t}: frame selection`:""}`}function m(){const t=c("viewport.toggleSnap");return`Trackpad: two-finger pan · pinch zoom · Alt+drag orbit${t?` · Snap: ${t}`:""}`}function v(){s.useSyncExternalStore(d,a,a)}function E(){const t=s.useSyncExternalStore(u,i,i);return v(),t?null:e.jsxs(l,{variant:"overlay",border:!0,className:"vgai-viewport-controls-hint vgai-chrome-island vgai-glass-island","data-island-scale":"compact",style:{pointerEvents:"none"},children:[e.jsx(n,{variant:"code","data-testid":"viewport-controls-hint",children:f()}),e.jsx(n,{variant:"code",children:m()})]})}let r={projection:"perspective"};const o=new Set;function S(){return r}function y(t){return o.add(t),()=>o.delete(t)}function j(t){if(r.projection!==t){r={...r,projection:t};for(const p of o)p()}}export{E as V,m as a,j as b,y as s,S as t,v as u,f as v};
|