@vincentt-xr/sdk 2.0.0-alpha.0 → 2.0.0-alpha.2
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/GROUNDING.md +1813 -27
- package/dist/{DebuggerUI-CEfdddkZ.cjs → DebuggerUI-B45_Gb9d.cjs} +1 -1
- package/dist/{DebuggerUI-Dgop6Q6o.js → DebuggerUI-Cq28c18s.js} +1 -1
- package/dist/FaceMeshRenderer-6t8OsQhK.js +1195 -0
- package/dist/FaceMeshRenderer-lQLhYIW-.cjs +155 -0
- package/dist/FaceRetouch-CDrL0pXg.js +551 -0
- package/dist/FaceRetouch-DtNl8-4e.cjs +134 -0
- package/dist/audio/AudioEngine.d.ts +3 -1
- package/dist/audio/AudioPlayer.d.ts +29 -0
- package/dist/audio/AudioPlayerLogic.d.ts +4 -0
- package/dist/audio/index.d.ts +2 -0
- package/dist/components/Axes/index.d.ts +6 -0
- package/dist/components/FaceMesh/FaceMeshRenderer.d.ts +17 -0
- package/dist/components/FaceMesh/canonical/CanonicalFaceMeshRenderer.d.ts +22 -1
- package/dist/components/FaceMesh/canonical/FaceMeshMaterial.d.ts +25 -0
- package/dist/components/FaceMesh/canonical/assets.d.ts +3 -0
- package/dist/components/FaceMesh/canonical/geometryGroups.d.ts +9 -0
- package/dist/components/FaceMesh/canonical/parseCanonicalFaceModel.d.ts +2 -0
- package/dist/components/FaceMesh/canonical/shaders.d.ts +2 -0
- package/dist/components/FaceMesh/deform.d.ts +3 -0
- package/dist/components/FaceMesh/index.d.ts +5 -0
- package/dist/components/FaceMesh/material/defaults.d.ts +74 -0
- package/dist/components/FaceMesh/material/index.d.ts +1 -0
- package/dist/components/FaceMesh/material/options.d.ts +5 -1
- package/dist/components/FaceMesh/material/support.d.ts +7 -2
- package/dist/components/FaceMesh/material/textures.d.ts +4 -0
- package/dist/components/FaceMesh/material/types.d.ts +4 -2
- package/dist/components/FaceRetouch/Background.d.ts +9 -5
- package/dist/components/FaceRetouch/FaceRetouch.d.ts +47 -0
- package/dist/components/FaceRetouch/index.d.ts +2 -6
- package/dist/components/FaceRetouch/landmarkMask.d.ts +4 -6
- package/dist/components/FaceRetouch/useFaceRetouchMask.d.ts +4 -7
- package/dist/components/FaceTracker/index.d.ts +5 -3
- package/dist/components/FaceWarp3D/FaceWarp3DHead.d.ts +15 -0
- package/dist/components/FaceWarp3D/defaults.d.ts +37 -0
- package/dist/components/FaceWarp3D/index.d.ts +3 -0
- package/dist/components/FaceWarp3D/warp.d.ts +13 -0
- package/dist/components/HandJoints2D/index.d.ts +6 -0
- package/dist/components/HandTracker/index.d.ts +2 -2
- package/dist/components/HandTracking2D/HandVisual.d.ts +12 -0
- package/dist/components/HandTracking2D/index.d.ts +5 -0
- package/dist/components/HandTracking2DController/index.d.ts +5 -0
- package/dist/components/HandTracking3D/index.d.ts +6 -0
- package/dist/components/LightObject/index.d.ts +20 -0
- package/dist/components/LookAt/index.d.ts +23 -0
- package/dist/components/MeshRenderer/index.d.ts +58 -0
- package/dist/components/PerspectiveCamera/index.d.ts +2 -8
- package/dist/components/PinToMesh/index.d.ts +47 -0
- package/dist/components/RenderGroupLayer/index.d.ts +6 -0
- package/dist/components/SceneObjectRenderer/index.d.ts +16 -0
- package/dist/components/Screen2D/ScreenTransformFrame.d.ts +11 -0
- package/dist/components/Screen2D/ScreenTransformHelpers.d.ts +19 -0
- package/dist/components/Screen2D/ScreenTransformInteraction.d.ts +18 -0
- package/dist/components/Screen2D/index.d.ts +5 -0
- package/dist/components/ScreenGlass/defaults.d.ts +3 -0
- package/dist/components/ScreenGlass/index.d.ts +5 -0
- package/dist/components/ScreenGlass/shaders.d.ts +2 -0
- package/dist/components/ScreenGlass/types.d.ts +10 -0
- package/dist/components/ScreenGradient/defaults.d.ts +5 -0
- package/dist/components/ScreenGradient/index.d.ts +5 -0
- package/dist/components/ScreenGradient/shaders.d.ts +2 -0
- package/dist/components/ScreenGradient/types.d.ts +19 -0
- package/dist/components/ScreenImage/ScreenImage.d.ts +4 -0
- package/dist/components/ScreenImage/components/DynamicTextureSync.d.ts +9 -0
- package/dist/components/ScreenImage/components/ScreenImageBody.d.ts +9 -0
- package/dist/components/ScreenImage/components/ScreenImageFrame.d.ts +9 -0
- package/dist/components/ScreenImage/components/ScreenImageTransformFrame.d.ts +9 -0
- package/dist/components/ScreenImage/fit.d.ts +52 -0
- package/dist/components/ScreenImage/index.d.ts +8 -0
- package/dist/components/ScreenImage/materials/ScreenImageBlendMaterial.d.ts +9 -0
- package/dist/components/ScreenImage/materials/ScreenImageMatcap.d.ts +3 -0
- package/dist/components/ScreenImage/source.d.ts +16 -0
- package/dist/components/ScreenImage/types.d.ts +37 -0
- package/dist/components/ScreenImage/utils/ScreenImageConstants.d.ts +9 -0
- package/dist/components/ScreenImage/utils/ScreenImageHelpers.d.ts +4 -0
- package/dist/components/ScreenShape/geometry.d.ts +5 -0
- package/dist/components/ScreenShape/index.d.ts +5 -0
- package/dist/components/ScreenShape/types.d.ts +41 -0
- package/dist/components/ScreenSpaceUI/ScreenTransformGuide.d.ts +15 -0
- package/dist/components/ScreenSpaceUI/ScreenTransformOverlayGuide.d.ts +9 -0
- package/dist/components/ScreenSpaceUI/index.d.ts +2 -0
- package/dist/components/ScreenText/components/ScreenTextBody.d.ts +2 -0
- package/dist/components/ScreenText/components/ScreenTextTransformFrame.d.ts +9 -0
- package/dist/components/ScreenText/constants.d.ts +5 -0
- package/dist/components/ScreenText/index.d.ts +6 -0
- package/dist/components/ScreenText/types.d.ts +31 -0
- package/dist/components/ScreenText/utils/ScreenTextHelpers.d.ts +14 -0
- package/dist/components/ScreenText/utils/ScreenTextMappings.d.ts +17 -0
- package/dist/components/SequentialRenderPasses/index.d.ts +6 -0
- package/dist/components/TextLabel/TextLabel.d.ts +5 -0
- package/dist/components/TextLabel/alignment.d.ts +4 -0
- package/dist/components/TextLabel/bend.d.ts +9 -0
- package/dist/components/TextLabel/canvas/buildTextLabelTexture.d.ts +4 -0
- package/dist/components/TextLabel/canvas/canvasTypography.d.ts +13 -0
- package/dist/components/TextLabel/canvas/drawBackground.d.ts +21 -0
- package/dist/components/TextLabel/canvas/drawEffects.d.ts +34 -0
- package/dist/components/TextLabel/canvas/drawText.d.ts +19 -0
- package/dist/components/TextLabel/components/TextLabelMesh.d.ts +13 -0
- package/dist/components/TextLabel/constants.d.ts +2 -0
- package/dist/components/TextLabel/hooks/useTextLabelTexture.d.ts +7 -0
- package/dist/components/TextLabel/index.d.ts +2 -62
- package/dist/components/TextLabel/layout/measurement.d.ts +8 -0
- package/dist/components/TextLabel/layout/resolveTextLayout.d.ts +25 -0
- package/dist/components/TextLabel/layout/wrapText.d.ts +6 -0
- package/dist/components/TextLabel/types.d.ts +227 -0
- package/dist/components/TrackingAnchor/index.d.ts +18 -2
- package/dist/components/Transform3D/index.d.ts +30 -0
- package/dist/components/XRMediaSurface/index.d.ts +6 -6
- package/dist/components/XRScene/index.d.ts +14 -3
- package/dist/components/XRViewport/XRViewport.d.ts +11 -0
- package/dist/components/XRViewport/components/HiddenMedia.d.ts +7 -0
- package/dist/components/XRViewport/components/MediaAssetPicker.d.ts +8 -0
- package/dist/components/XRViewport/components/MediaControlStack.d.ts +13 -0
- package/dist/components/XRViewport/components/XRViewportLayers.d.ts +30 -0
- package/dist/components/XRViewport/constants.d.ts +24 -0
- package/dist/components/XRViewport/contexts.d.ts +6 -0
- package/dist/components/XRViewport/hooks/useViewportExternalFaces.d.ts +13 -0
- package/dist/components/XRViewport/hooks/useViewportMediaSource.d.ts +16 -0
- package/dist/components/XRViewport/hooks/useViewportMediaTexture.d.ts +10 -0
- package/dist/components/XRViewport/hooks/useViewportPipeline.d.ts +41 -0
- package/dist/components/XRViewport/hooks/useViewportRenderState.d.ts +47 -0
- package/dist/components/XRViewport/index.d.ts +3 -101
- package/dist/components/XRViewport/layout.d.ts +16 -0
- package/dist/components/XRViewport/slots.d.ts +16 -0
- package/dist/components/XRViewport/types.d.ts +89 -0
- package/dist/components/XRViewport/useViewportSize.d.ts +3 -0
- package/dist/components/index.d.ts +19 -0
- package/dist/contexts-BKvTIayr.cjs +1 -0
- package/dist/contexts-Bk5zz_VR.js +214 -0
- package/dist/debug-ui/component-editor/index.d.ts +19 -0
- package/dist/debug-ui/default-setting/index.d.ts +37 -0
- package/dist/debug-ui/default-setting.cjs +21 -0
- package/dist/debug-ui/default-setting.js +777 -0
- package/dist/debug-ui/face-mesh-renderer-settings/index.d.ts +8 -0
- package/dist/debug-ui/face-retouch/index.d.ts +11 -0
- package/dist/debug-ui/face-warp-3d/index.d.ts +6 -0
- package/dist/debug-ui/hand-joints-2d/index.d.ts +6 -0
- package/dist/debug-ui/hand-tracking-2d/index.d.ts +6 -0
- package/dist/debug-ui/hand-tracking-2d-controller/index.d.ts +6 -0
- package/dist/debug-ui/hand-tracking-3d/index.d.ts +6 -0
- package/dist/debug-ui/hierarchy-panel/index.d.ts +29 -0
- package/dist/debug-ui/index.d.ts +46 -0
- package/dist/debug-ui/layer-panel/index.d.ts +18 -0
- package/dist/debug-ui/media-source/MediaSourceSwitcher.d.ts +10 -0
- package/dist/debug-ui/media-source/index.d.ts +6 -0
- package/dist/debug-ui/media-source/media-preset.d.ts +9 -0
- package/dist/debug-ui/media-source/session.d.ts +12 -0
- package/dist/debug-ui/media-source.cjs +1 -0
- package/dist/debug-ui/media-source.js +9 -0
- package/dist/debug-ui/mesh-renderer-settings/index.d.ts +6 -0
- package/dist/debug-ui/object-inspector-panel/index.d.ts +25 -0
- package/dist/debug-ui/pin-to-mesh-settings/index.d.ts +10 -0
- package/dist/debug-ui/scene-editor/context.d.ts +38 -0
- package/dist/debug-ui/scene-editor/hierarchy-panel.d.ts +9 -0
- package/dist/debug-ui/scene-editor/index.d.ts +11 -0
- package/dist/debug-ui/scene-editor/inspector-panel.d.ts +7 -0
- package/dist/debug-ui/scene-editor/store-utils.d.ts +2 -0
- package/dist/debug-ui/scene-editor/viewport-toolbar.d.ts +4 -0
- package/dist/debug-ui/scene-editor/viewport.d.ts +21 -0
- package/dist/debug-ui/screen-glass-settings/index.d.ts +6 -0
- package/dist/debug-ui/screen-gradient-settings/GradientStopsEditor.d.ts +5 -0
- package/dist/debug-ui/screen-gradient-settings/index.d.ts +6 -0
- package/dist/debug-ui/screen-gradient-settings/styles.d.ts +3 -0
- package/dist/debug-ui/screen-image-settings/index.d.ts +9 -0
- package/dist/debug-ui/screen-shape-settings/index.d.ts +6 -0
- package/dist/debug-ui/screen-text-settings/NumberField.d.ts +9 -0
- package/dist/debug-ui/screen-text-settings/ScreenTextSettingsPanel.d.ts +3 -0
- package/dist/debug-ui/screen-text-settings/controls/NestedSection.d.ts +7 -0
- package/dist/debug-ui/screen-text-settings/controls/Section.d.ts +8 -0
- package/dist/debug-ui/screen-text-settings/controls/icons.d.ts +4 -0
- package/dist/debug-ui/screen-text-settings/index.d.ts +2 -0
- package/dist/debug-ui/screen-text-settings/sections/BackgroundSection.d.ts +8 -0
- package/dist/debug-ui/screen-text-settings/sections/ContentSection.d.ts +5 -0
- package/dist/debug-ui/screen-text-settings/sections/EffectsSection.d.ts +25 -0
- package/dist/debug-ui/screen-text-settings/sections/StyleSection.d.ts +5 -0
- package/dist/debug-ui/screen-text-settings/sections/TransformSection.d.ts +5 -0
- package/dist/debug-ui/screen-text-settings/sections/background/BackgroundFillControls.d.ts +2 -0
- package/dist/debug-ui/screen-text-settings/sections/background/BackgroundSizeControls.d.ts +2 -0
- package/dist/debug-ui/screen-text-settings/sections/background/BackgroundStrokeControls.d.ts +2 -0
- package/dist/debug-ui/screen-text-settings/sections/background/types.d.ts +7 -0
- package/dist/debug-ui/screen-text-settings/sections/effects/BendEffectSection.d.ts +4 -0
- package/dist/debug-ui/screen-text-settings/sections/effects/EffectChrome.d.ts +21 -0
- package/dist/debug-ui/screen-text-settings/sections/effects/GlowEffectSection.d.ts +4 -0
- package/dist/debug-ui/screen-text-settings/sections/effects/InnerShadowEffectSection.d.ts +4 -0
- package/dist/debug-ui/screen-text-settings/sections/effects/OutlineEffectSection.d.ts +4 -0
- package/dist/debug-ui/screen-text-settings/sections/effects/ShadowEffectSection.d.ts +4 -0
- package/dist/debug-ui/screen-text-settings/sections/effects/types.d.ts +14 -0
- package/dist/debug-ui/screen-text-settings/settings.d.ts +90 -0
- package/dist/debug-ui/screen-text-settings/styles.d.ts +26 -0
- package/dist/debug-ui/screen-text-settings/transform.d.ts +6 -0
- package/dist/debug-ui/screen-text-settings/types.d.ts +9 -0
- package/dist/debug-ui/settings-panel/index.d.ts +38 -0
- package/dist/debug-ui/shared/MaterialSection.d.ts +13 -0
- package/dist/debug-ui/shared/ScreenTransformSection.d.ts +32 -0
- package/dist/debug-ui/transform-3d-settings/index.d.ts +11 -0
- package/dist/debug-ui.cjs +10 -0
- package/dist/debug-ui.js +8861 -0
- package/dist/drawNormalizedCrop-B-7zU-Xw.cjs +1 -0
- package/dist/drawNormalizedCrop-CRdIDyl1.js +44 -0
- package/dist/entries/all.d.ts +1 -0
- package/dist/entries/core.d.ts +55 -4
- package/dist/entries/face-effects.d.ts +12 -8
- package/dist/entries/internal.d.ts +1 -1
- package/dist/entries/low-level.d.ts +21 -4
- package/dist/entries/scene-object.d.ts +10 -0
- package/dist/entries/tracking.d.ts +25 -2
- package/dist/face-action/index.d.ts +34 -0
- package/dist/face-attribute-expression/index.d.ts +10 -0
- package/dist/face-effects.cjs +1 -252
- package/dist/face-effects.js +1404 -2613
- package/dist/face-info/blendshapes.d.ts +3 -0
- package/dist/face-info/derive.d.ts +8 -0
- package/dist/face-info/drawFaceCrop.d.ts +10 -0
- package/dist/face-info/getFaceInfo.d.ts +8 -0
- package/dist/face-info/index.d.ts +8 -0
- package/dist/face-info/landmarks.d.ts +21 -0
- package/dist/face-info/types.d.ts +52 -0
- package/dist/getFaceInfo-CyPAKh3h.cjs +1 -0
- package/dist/getFaceInfo-hUKMLFcr.js +118 -0
- package/dist/hand/handJoints2d.d.ts +49 -0
- package/dist/hand/handTracking2d.d.ts +33 -0
- package/dist/hand/handTracking2dController.d.ts +65 -0
- package/dist/hand/handTracking3d.d.ts +52 -0
- package/dist/hooks/faceResults.d.ts +1 -1
- package/dist/hooks/useCalibrationFaceTracker.d.ts +1 -1
- package/dist/hooks/useFaceAction.d.ts +3 -0
- package/dist/hooks/useFaceAttributeExpression.d.ts +16 -0
- package/dist/hooks/useFaceDetection.d.ts +18 -0
- package/dist/hooks/useFaceInfo.d.ts +7 -0
- package/dist/hooks/useFaceInfos.d.ts +15 -0
- package/dist/hooks/useFaceResultReader.d.ts +10 -0
- package/dist/hooks/useFrameCapture.d.ts +18 -0
- package/dist/hooks/useMediaRecorder.d.ts +14 -2
- package/dist/hooks/useOwnedTexture.d.ts +6 -0
- package/dist/hooks/useTrackerContext.d.ts +2 -2
- package/dist/hooks/useXRSession/facade.d.ts +3 -0
- package/dist/hooks/useXRSession/registry.d.ts +9 -0
- package/dist/index-82aENaRq.cjs +1 -0
- package/dist/{index-BD-JWMjE.js → index-BgQAX8rs.js} +198 -134
- package/dist/index-CEc1CAmB.cjs +1 -0
- package/dist/index-CTHeBQOs.js +178 -0
- package/dist/index-D4bLzBr6.cjs +1 -0
- package/dist/index-DSpzjuqd.cjs +1 -0
- package/dist/index-Di70KWuY.js +2049 -0
- package/dist/index-DzEzkBIH.cjs +17 -0
- package/dist/{index-CYMj26Ej.js → index-JygePOwo.js} +565 -498
- package/dist/index-UC0Ux38E.js +111 -0
- package/dist/{internal-KOKJDxCG.js → internal-DuMPpcbp.js} +86 -80
- package/dist/internal-i2JkM85N.cjs +1 -0
- package/dist/internal.cjs +1 -1
- package/dist/internal.js +2 -2
- package/dist/low-level.cjs +1 -1
- package/dist/low-level.js +959 -632
- package/dist/main.cjs +1 -1
- package/dist/main.js +556 -455
- package/dist/material/MaterialFill.d.ts +20 -0
- package/dist/material/MeshMaterial.d.ts +14 -0
- package/dist/material/index.d.ts +2 -0
- package/dist/models/Body/index.d.ts +1 -1
- package/dist/models/Face/index.d.ts +1 -0
- package/dist/models/Face/rotation.d.ts +3 -0
- package/dist/models/Hand/HandTracking.d.ts +2 -0
- package/dist/render/layerStack.d.ts +29 -0
- package/dist/render/renderGroups.d.ts +47 -0
- package/dist/render/renderPasses.d.ts +18 -0
- package/dist/renderGroups-C9QJrAXu.js +152 -0
- package/dist/renderGroups-Dvm1J4lW.cjs +1 -0
- package/dist/renderLayers-lDtL0_43.cjs +1 -0
- package/dist/renderLayers-zrK2pv5O.js +13 -0
- package/dist/renderPasses-CT5iBwtg.cjs +21 -0
- package/dist/renderPasses-CjgG_6kQ.js +1500 -0
- package/dist/scene-object/index.d.ts +146 -0
- package/dist/scene-object/runtimeRegistry.d.ts +14 -0
- package/dist/scene-object.cjs +1 -0
- package/dist/scene-object.js +40 -0
- package/dist/screen-image/screenImagePresets.d.ts +13 -0
- package/dist/screen-image/screenImageSettings.d.ts +57 -0
- package/dist/screen-text/screenTextPresets.d.ts +6 -0
- package/dist/screen-text/screenTextSettings.d.ts +147 -0
- package/dist/screen2d/coordinates.d.ts +87 -0
- package/dist/screen2d/index.d.ts +7 -0
- package/dist/screen2d/material-runtime.d.ts +32 -0
- package/dist/screen2d/screenTransform.d.ts +47 -0
- package/dist/screen2d/smoothing.d.ts +5 -0
- package/dist/screen2d/texture.d.ts +10 -0
- package/dist/screen2d/transform.d.ts +25 -0
- package/dist/screen2d/types.d.ts +90 -0
- package/dist/{selectors-Bub0o3qy.cjs → selectors-2QvO5RYY.cjs} +1 -1
- package/dist/{selectors-BHO6TnoC.js → selectors-Dw3C-gSk.js} +5 -5
- package/dist/services/MetricsCollector/index.d.ts +7 -1
- package/dist/services/MetricsCollector/utils.d.ts +1 -1
- package/dist/session-BChR4TgK.cjs +31 -0
- package/dist/session-C1StwN0f.js +363 -0
- package/dist/texture/animatedTexture.d.ts +61 -0
- package/dist/texture/animationMath.d.ts +8 -0
- package/dist/texture/sourceResolver.d.ts +30 -0
- package/dist/tracking.cjs +1 -1
- package/dist/tracking.js +582 -298
- package/dist/types/face.d.ts +1 -13
- package/dist/types/hand-tracking.d.ts +8 -0
- package/dist/types/index.d.ts +0 -1
- package/dist/types/nodes.d.ts +4 -1
- package/dist/types/session.d.ts +2 -0
- package/dist/types/tracking.d.ts +8 -2
- package/dist/types/util-types.d.ts +1 -1
- package/dist/useFaceInfo-C-WfMlYp.cjs +1 -0
- package/dist/useFaceInfo-CwsHZedC.js +62 -0
- package/dist/useFaceResults-CkFc1egZ.js +19 -0
- package/dist/useFaceResults-VcFdOUFV.cjs +1 -0
- package/dist/utils/drawNormalizedCrop.d.ts +22 -0
- package/dist/utils/integrity.d.ts +4 -25
- package/dist/utils/landmarkBounds.d.ts +1 -1
- package/dist/utils/logger.d.ts +2 -2
- package/dist/x-Co8jPhP0.js +127 -0
- package/dist/x-KC8E4Gaj.cjs +41 -0
- package/docs/MIGRATION_GUIDE.md +589 -0
- package/docs/SDK_DOCUMENTATION.md +1155 -0
- package/docs/api/audio.mdx +36 -0
- package/docs/api/behavior-components.mdx +164 -0
- package/docs/api/capture-recording.mdx +103 -0
- package/docs/api/debug-ui-scene-editor.mdx +249 -0
- package/docs/api/face-actions.mdx +104 -0
- package/docs/api/face-attribute-expression.mdx +87 -0
- package/docs/api/face-binding-anchors.mdx +53 -0
- package/docs/api/face-effects.mdx +19 -0
- package/docs/api/face-info.mdx +112 -0
- package/docs/api/face-mesh.mdx +98 -0
- package/docs/api/face-painting.mdx +33 -0
- package/docs/api/face-retouching.mdx +73 -0
- package/docs/api/material-render-state.mdx +132 -0
- package/docs/api/runtime-3d.mdx +311 -0
- package/docs/api/scene-object-store.mdx +213 -0
- package/docs/api/screen-image.mdx +41 -0
- package/docs/api/screen-shape.mdx +64 -0
- package/docs/api/screen-space-coordinates.mdx +41 -0
- package/docs/api/screen-text.mdx +39 -0
- package/docs/api/texture-sources.mdx +55 -0
- package/docs/api/trackers.mdx +46 -0
- package/docs/docs.json +70 -0
- package/docs/examples/scene-object-recipes.mdx +194 -0
- package/docs/guides/harness-debug-ui.mdx +139 -0
- package/docs/inspector/hierarchy-panel.mdx +51 -0
- package/docs/inspector/object-inspector-panel.mdx +51 -0
- package/docs/introduction.mdx +121 -0
- package/docs/scene-objects/overview.mdx +127 -0
- package/docs/scene-objects/render-groups.mdx +77 -0
- package/docs/scene-objects/runtime-rendering.mdx +75 -0
- package/docs/texture-api-consumer.md +58 -0
- package/package.json +55 -7
- package/dist/components/FaceRetouch/retouchRegions.d.ts +0 -23
- package/dist/components/FaceRetouch/useFaceRetouchRegions.d.ts +0 -12
- package/dist/index-B5J4gzn2.cjs +0 -1
- package/dist/index-BVBVg96G.cjs +0 -1
- package/dist/index-DtwHElmG.js +0 -157
- package/dist/index-PtFmD6B8.cjs +0 -1
- package/dist/internal-DH5d1Xnq.cjs +0 -1
- package/dist/modules/XRClient/index.d.ts +0 -9
- package/dist/modules/index.d.ts +0 -1
- package/dist/services/ApiService.d.ts +0 -12
- package/dist/types/client.d.ts +0 -3
- package/dist/useFaceResults-cpsSmKKc.js +0 -81
- package/dist/useFaceResults-hVUJYSEY.cjs +0 -1
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type * as THREE from "three";
|
|
2
|
+
export type ScreenTransformMode = "basic" | "advanced";
|
|
3
|
+
export type ScreenCoordinateSpace = "normalized" | "canvas";
|
|
4
|
+
export type ScreenCanvasSize = {
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
};
|
|
8
|
+
export type ScreenTransform2D = {
|
|
9
|
+
mode?: ScreenTransformMode;
|
|
10
|
+
coordinateSpace?: ScreenCoordinateSpace;
|
|
11
|
+
canvasSize?: ScreenCanvasSize;
|
|
12
|
+
position?: [number, number];
|
|
13
|
+
size?: [number, number];
|
|
14
|
+
rotation?: number;
|
|
15
|
+
pivot?: [number, number];
|
|
16
|
+
anchors?: {
|
|
17
|
+
left?: number;
|
|
18
|
+
right?: number;
|
|
19
|
+
top?: number;
|
|
20
|
+
bottom?: number;
|
|
21
|
+
};
|
|
22
|
+
offsets?: {
|
|
23
|
+
left?: number;
|
|
24
|
+
right?: number;
|
|
25
|
+
top?: number;
|
|
26
|
+
bottom?: number;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export type MaterialKind = "image" | "surface" | "text";
|
|
30
|
+
export type MaterialType = "unlit" | "standardPBR" | "matcap";
|
|
31
|
+
export type BlendMode = "normal" | "add" | "subtract" | "multiply" | "screen" | "lighten" | "darken";
|
|
32
|
+
export type TextureSource = {
|
|
33
|
+
kind: "none";
|
|
34
|
+
} | {
|
|
35
|
+
kind: "asset";
|
|
36
|
+
id: string;
|
|
37
|
+
url?: string;
|
|
38
|
+
width?: number;
|
|
39
|
+
height?: number;
|
|
40
|
+
} | {
|
|
41
|
+
kind: "image";
|
|
42
|
+
src: string;
|
|
43
|
+
width?: number;
|
|
44
|
+
height?: number;
|
|
45
|
+
} | {
|
|
46
|
+
kind: "texture";
|
|
47
|
+
texture: THREE.Texture;
|
|
48
|
+
width?: number;
|
|
49
|
+
height?: number;
|
|
50
|
+
} | {
|
|
51
|
+
kind: "video";
|
|
52
|
+
src: string;
|
|
53
|
+
width?: number;
|
|
54
|
+
height?: number;
|
|
55
|
+
} | {
|
|
56
|
+
kind: "camera";
|
|
57
|
+
width?: number;
|
|
58
|
+
height?: number;
|
|
59
|
+
} | {
|
|
60
|
+
kind: "renderTexture";
|
|
61
|
+
id: string;
|
|
62
|
+
texture?: THREE.Texture;
|
|
63
|
+
width?: number;
|
|
64
|
+
height?: number;
|
|
65
|
+
} | {
|
|
66
|
+
kind: "depthTexture";
|
|
67
|
+
id: string;
|
|
68
|
+
texture?: THREE.Texture;
|
|
69
|
+
width?: number;
|
|
70
|
+
height?: number;
|
|
71
|
+
};
|
|
72
|
+
export type Material = {
|
|
73
|
+
kind: MaterialKind;
|
|
74
|
+
type?: MaterialType;
|
|
75
|
+
texture?: TextureSource;
|
|
76
|
+
color?: THREE.ColorRepresentation;
|
|
77
|
+
opacity?: number;
|
|
78
|
+
blendMode?: BlendMode;
|
|
79
|
+
alphaTest?: number;
|
|
80
|
+
flipX?: boolean;
|
|
81
|
+
flipY?: boolean;
|
|
82
|
+
};
|
|
83
|
+
export type ImageStretchMode = "fit" | "fitWidth" | "fitHeight" | "stretch" | "fill" | "fillAndCut";
|
|
84
|
+
export type RenderOutputKind = "mediaColor" | "sceneColor" | "finalColor" | "sceneDepth" | "estimatedDepth";
|
|
85
|
+
export type RenderTextureSource = Extract<TextureSource, {
|
|
86
|
+
kind: "renderTexture";
|
|
87
|
+
}>;
|
|
88
|
+
export type DepthTextureSource = Extract<TextureSource, {
|
|
89
|
+
kind: "depthTexture";
|
|
90
|
+
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const s=require("react"),u=require("./index-
|
|
1
|
+
"use strict";const s=require("react"),u=require("./index-D4bLzBr6.cjs"),o=()=>u.useXRContext().session.store,n=e=>t=>e.subscribe(t),c=()=>{const e=o();return s.useSyncExternalStore(n(e),()=>e.getSnapshot().ready,()=>!1)},a=()=>{const e=o();return s.useSyncExternalStore(n(e),()=>e.getSnapshot().error,()=>{})},i=()=>{const e=o();return s.useSyncExternalStore(n(e),()=>e.getSnapshot().cameraTexture,()=>{})},S=()=>{const e=o(),t=s.useSyncExternalStore(n(e),()=>e.getSnapshot().renderWidth,()=>0),r=s.useSyncExternalStore(n(e),()=>e.getSnapshot().renderHeight,()=>0);return s.useMemo(()=>({width:t,height:r}),[t,r])},l=e=>{const t=o(),r=s.useSyncExternalStore(n(t),()=>t.getSnapshot().pipeline.get(e)??null,()=>null);return s.useMemo(()=>r?r.getModelNode():null,[r])},p=()=>{const e=o(),t=s.useSyncExternalStore(n(e),()=>e.getSnapshot().pipeline,()=>e.getSnapshot().pipeline);return s.useMemo(()=>Array.from(t.keys()),[t])};exports.useXRCameraTexture=i;exports.useXRError=a;exports.useXRModelNode=l;exports.useXRPipelineSnapshot=p;exports.useXRReady=c;exports.useXRRenderSize=S;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useSyncExternalStore as s, useMemo as a } from "react";
|
|
2
|
-
import { u } from "./index-
|
|
2
|
+
import { u } from "./index-JygePOwo.js";
|
|
3
3
|
const r = () => u().session.store, o = (e) => (t) => e.subscribe(t), p = () => {
|
|
4
4
|
const e = r();
|
|
5
5
|
return s(
|
|
@@ -50,10 +50,10 @@ const r = () => u().session.store, o = (e) => (t) => e.subscribe(t), p = () => {
|
|
|
50
50
|
return a(() => Array.from(t.keys()), [t]);
|
|
51
51
|
};
|
|
52
52
|
export {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
l as a,
|
|
54
|
+
d as b,
|
|
55
|
+
S as c,
|
|
56
56
|
h as d,
|
|
57
57
|
g as e,
|
|
58
|
-
|
|
58
|
+
p as u
|
|
59
59
|
};
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { DebuggerMetrics } from '../../types/debugger';
|
|
2
2
|
import { MetricsCollectorOptions } from './types';
|
|
3
|
+
type PerformanceModel = {
|
|
4
|
+
getPerformanceData?: () => Promise<{
|
|
5
|
+
name: string;
|
|
6
|
+
processingTime?: number | null;
|
|
7
|
+
}>;
|
|
8
|
+
};
|
|
3
9
|
export declare class MetricsCollector {
|
|
4
10
|
private options;
|
|
5
11
|
private isRunning;
|
|
@@ -45,7 +51,7 @@ export declare class MetricsCollector {
|
|
|
45
51
|
* Update detection time from models
|
|
46
52
|
* Aggregates processing time from all active models in the XR pipeline
|
|
47
53
|
*/
|
|
48
|
-
updateDetectionTime(pipeline?: Partial<Record<string,
|
|
54
|
+
updateDetectionTime(pipeline?: Partial<Record<string, PerformanceModel>>): Promise<void>;
|
|
49
55
|
/**
|
|
50
56
|
* Update effective FPS calculation
|
|
51
57
|
* (will be implemented in Phase 6)
|
|
@@ -45,7 +45,7 @@ export declare function smoothValue(currentValue: number, newValue: number, smoo
|
|
|
45
45
|
* @param func Function to throttle
|
|
46
46
|
* @param wait Minimum time between executions in milliseconds
|
|
47
47
|
*/
|
|
48
|
-
export declare function throttle<T extends (...args:
|
|
48
|
+
export declare function throttle<T extends (...args: never[]) => unknown>(func: T, wait: number): (...args: Parameters<T>) => void;
|
|
49
49
|
/**
|
|
50
50
|
* Format number to fixed decimal places
|
|
51
51
|
* @param value Number to format
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";const p=require("./index-D4bLzBr6.cjs"),n=require("react/jsx-runtime"),L=require("react-dom"),c=require("react"),d=require("./x-KC8E4Gaj.cjs"),v=(t,e)=>new URL(`/assets/sdk/debug-ui/v1/${t}/${e}`,p.libConfig.assetStorageEndpoint).href,j=t=>t.replace(/\.[^.]+$/,"").replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,e=>e.toUpperCase()),$=["person_fullbody.mp4","person_looking.mp4","person_shaking_head.mp4","person_thumbUp.mp4","two_people_smiling.mp4"],z=["person_fist_sign.jpg","person_fullbody.jpg","person_peace_sign.jpg","person_portrait.jpg","person_side_portrait.jpg","three_people_smiling.jpg","two_people_smiling.jpg"],W=(t,e)=>({id:`sdk-video-${e+1}`,kind:"video",label:j(t),url:v("videos",t)}),F=(t,e)=>({id:`sdk-image-${e+1}`,kind:"image",label:j(t),url:v("images",t)}),M=$.map(W),_=z.map(F),V=[{id:"webcam",kind:"webcam",label:"Webcam"},...M,..._];/**
|
|
2
|
+
* @license lucide-react v1.17.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const X=[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]],P=d.createLucideIcon("camera",X);/**
|
|
7
|
+
* @license lucide-react v1.17.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const T=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],U=d.createLucideIcon("chevron-down",T);/**
|
|
12
|
+
* @license lucide-react v1.17.0 - ISC
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the ISC license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/const q=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],D=d.createLucideIcon("grip-vertical",q);/**
|
|
17
|
+
* @license lucide-react v1.17.0 - ISC
|
|
18
|
+
*
|
|
19
|
+
* This source code is licensed under the ISC license.
|
|
20
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
+
*/const N=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],A=d.createLucideIcon("image",N);/**
|
|
22
|
+
* @license lucide-react v1.17.0 - ISC
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the ISC license.
|
|
25
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/const K=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],B=d.createLucideIcon("menu",K);/**
|
|
27
|
+
* @license lucide-react v1.17.0 - ISC
|
|
28
|
+
*
|
|
29
|
+
* This source code is licensed under the ISC license.
|
|
30
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
+
*/const O=[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]],H=d.createLucideIcon("video",O),G=t=>t==="webcam"?"📷 ":t==="image"?"🖼 ":"▶ ",Y={position:"fixed",zIndex:2e4,pointerEvents:"none"},I={pointerEvents:"auto",border:"1px solid rgba(255, 255, 255, 0.12)",background:"rgba(8, 15, 28, 0.58)",boxShadow:"0 12px 32px rgba(0, 0, 0, 0.28)",backdropFilter:"blur(20px) saturate(1.15)",WebkitBackdropFilter:"blur(20px) saturate(1.15)",color:"#f8fafc",display:"flex"},J={...I,width:34,height:34,borderRadius:17,alignItems:"center",justifyContent:"center",cursor:"pointer",transition:"transform 150ms ease"},Q={...I,flexDirection:"column",borderRadius:12,overflow:"hidden",padding:4,gap:4},Z={display:"flex",alignItems:"center",gap:3},ee={width:1,height:12,background:"rgba(255, 255, 255, 0.12)",margin:"0 3px"},te={display:"flex",width:16,height:24,alignItems:"center",justifyContent:"center",cursor:"grab",color:"rgba(148, 163, 184, 0.8)",flex:"0 0 auto"},k=(t=!1)=>({display:"flex",width:24,height:24,alignItems:"center",justifyContent:"center",borderRadius:8,border:`1px solid ${t?"rgba(255, 255, 255, 0.12)":"transparent"}`,background:t?"rgba(255, 255, 255, 0.08)":"transparent",color:t?"#f8fafc":"rgba(226, 232, 240, 0.72)",cursor:"pointer",flex:"0 0 auto",transition:"background 120ms ease, color 120ms ease"}),re={position:"relative",display:"flex",alignItems:"center"},ne={width:"100%",minWidth:140,height:24,borderRadius:8,border:"1px solid rgba(255, 255, 255, 0.10)",background:"rgba(15, 23, 42, 0.65)",color:"#f8fafc",fontSize:11,outline:"none",paddingLeft:7,paddingRight:20,appearance:"none",cursor:"pointer"},ie={pointerEvents:"none",position:"absolute",right:5,top:0,bottom:0,display:"flex",alignItems:"center",color:"rgba(148, 163, 184, 0.9)"},se={height:24,display:"flex",alignItems:"center",padding:"0 8px",borderRadius:8,border:"1px solid rgba(255, 255, 255, 0.08)",background:"rgba(255, 255, 255, 0.04)",color:"rgba(226, 232, 240, 0.72)",fontSize:11},S={width:14,height:14},oe=({value:t,onChange:e,sources:i,style:a})=>{const[l,m]=c.useState(!1),[o,y]=c.useState({x:16,y:16}),[u,f]=c.useState(t.kind),g=c.useRef(null),x=c.useMemo(()=>({webcam:i.filter(r=>r.kind==="webcam"),image:i.filter(r=>r.kind==="image"),video:i.filter(r=>r.kind==="video")}),[i]),b=x[u];c.useEffect(()=>{f(t.kind)},[t.kind]);const E=r=>{f(r);const s=x[r][0];s&&e(s)};c.useEffect(()=>{const r=h=>{g.current&&y({x:Math.max(8,h.clientX-g.current.x),y:Math.max(8,h.clientY-g.current.y)})},s=()=>{g.current=null,document.body.classList.remove("select-none")};return window.addEventListener("pointermove",r),window.addEventListener("pointerup",s),()=>{window.removeEventListener("pointermove",r),window.removeEventListener("pointerup",s)}},[]);const w=r=>{const s=r.currentTarget.getBoundingClientRect();g.current={x:r.clientX-s.left,y:r.clientY-s.top},document.body.classList.add("select-none"),r.currentTarget.setPointerCapture(r.pointerId)},C=()=>{if(b.length===0){const r=u==="webcam"?"No camera source":u==="image"?"No image preview":"No video preview";return n.jsx("div",{style:se,children:r})}return n.jsxs("div",{style:re,children:[n.jsx("select",{value:t.id,onChange:r=>{const s=i.find(h=>h.id===r.target.value);s&&e(s)},style:ne,children:b.map(r=>n.jsxs("option",{value:r.id,children:[G(u),r.label]},r.id))}),n.jsx("div",{style:ie,children:n.jsx("span",{style:{width:10,height:10},children:n.jsx(U,{size:10,strokeWidth:1.8})})})]})};return typeof document>"u"?null:L.createPortal(n.jsx("div",{style:{...Y,left:o.x,top:o.y,...a},children:l?n.jsxs("div",{style:Q,children:[n.jsxs("div",{style:Z,children:[n.jsx("div",{onPointerDown:w,style:te,title:"Drag to move",children:n.jsx(D,{size:11,strokeWidth:2})}),n.jsx("button",{type:"button",onClick:()=>m(!1),style:k(!1),title:"Close Menu",children:n.jsx("span",{style:S,children:n.jsx(d.X,{size:14,strokeWidth:1.8})})}),n.jsx("div",{style:ee}),["webcam","image","video"].map(r=>n.jsx("button",{type:"button",onClick:()=>E(r),style:k(u===r),title:r.charAt(0).toUpperCase()+r.slice(1),children:n.jsx("span",{style:S,children:r==="webcam"?n.jsx(P,{size:14,strokeWidth:1.8}):r==="image"?n.jsx(A,{size:14,strokeWidth:1.8}):n.jsx(H,{size:14,strokeWidth:1.8})})},r))]}),C()]}):n.jsx("div",{style:J,onClick:()=>m(!0),onPointerDown:w,title:"Open Media Menu",children:n.jsx("span",{style:{width:16,height:16},children:n.jsx(B,{size:14,strokeWidth:1.8})})})}),document.body)},ce=async t=>{const e=new Image;e.crossOrigin="anonymous",e.src=t,await e.decode();const i=document.createElement("canvas");i.width=e.naturalWidth,i.height=e.naturalHeight;const a=i.getContext("2d");if(!a)throw new Error("Unable to create image media canvas");return a.drawImage(e,0,0,i.width,i.height),i.captureStream(30)},ae=async t=>{const e=document.createElement("video");return e.src=t,e.loop=!0,e.muted=!0,e.playsInline=!0,e.crossOrigin="anonymous",await e.play(),e.captureStream()},R=(t,e)=>{const{session:i}=p.useXRContext();c.useEffect(()=>{let a=!1,l=null;return(async()=>{try{if(t.kind==="webcam")await i.setMediaSource({source:p.XRMediaSource.WEBCAM});else{if(!t.url)throw new Error(`Missing media URL for ${t.id}`);const o=t.kind==="image"?await ce(t.url):await ae(t.url);if(l=o,a){o.getTracks().forEach(y=>y.stop());return}await i.setMediaSource({source:p.XRMediaSource.STREAM,stream:o,sourceKind:t.kind})}await i.registerXRPipeline((e==null?void 0:e.pipeline)??[{model:p.XRModel.FACE_TRACKER,options:{numFaces:(e==null?void 0:e.numFaces)??1}}]),await i.start()}catch(o){console.error("[MediaSourceSession] Error initializing XR session:",o)}})(),()=>{a=!0,l==null||l.getTracks().forEach(o=>o.stop())}},[t,e==null?void 0:e.numFaces,e==null?void 0:e.pipeline,i])},de=R;exports.MediaSourceSwitcher=oe;exports.defaultMediaSources=V;exports.sdkImageMediaSources=_;exports.sdkVideoMediaSources=M;exports.useFaceTrackingMediaSourceSession=de;exports.useMediaSourceSession=R;
|
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
import { l as j, u as z, c as v, X as L } from "./index-JygePOwo.js";
|
|
2
|
+
import { jsx as n, jsxs as u } from "react/jsx-runtime";
|
|
3
|
+
import { createPortal as W } from "react-dom";
|
|
4
|
+
import { useState as y, useRef as $, useMemo as F, useEffect as f } from "react";
|
|
5
|
+
import { c as d, X } from "./x-Co8jPhP0.js";
|
|
6
|
+
const M = (t, e) => new URL(`/assets/sdk/debug-ui/v1/${t}/${e}`, j.assetStorageEndpoint).href, C = (t) => t.replace(/\.[^.]+$/, "").replace(/[_-]+/g, " ").replace(/\s+/g, " ").trim().replace(/\b\w/g, (e) => e.toUpperCase()), P = [
|
|
7
|
+
"person_fullbody.mp4",
|
|
8
|
+
"person_looking.mp4",
|
|
9
|
+
"person_shaking_head.mp4",
|
|
10
|
+
"person_thumbUp.mp4",
|
|
11
|
+
"two_people_smiling.mp4"
|
|
12
|
+
], U = [
|
|
13
|
+
"person_fist_sign.jpg",
|
|
14
|
+
"person_fullbody.jpg",
|
|
15
|
+
"person_peace_sign.jpg",
|
|
16
|
+
"person_portrait.jpg",
|
|
17
|
+
"person_side_portrait.jpg",
|
|
18
|
+
"three_people_smiling.jpg",
|
|
19
|
+
"two_people_smiling.jpg"
|
|
20
|
+
], V = (t, e) => ({
|
|
21
|
+
id: `sdk-video-${e + 1}`,
|
|
22
|
+
kind: "video",
|
|
23
|
+
label: C(t),
|
|
24
|
+
url: M("videos", t)
|
|
25
|
+
}), D = (t, e) => ({
|
|
26
|
+
id: `sdk-image-${e + 1}`,
|
|
27
|
+
kind: "image",
|
|
28
|
+
label: C(t),
|
|
29
|
+
url: M("images", t)
|
|
30
|
+
}), N = P.map(V), T = U.map(D), ke = [
|
|
31
|
+
{ id: "webcam", kind: "webcam", label: "Webcam" },
|
|
32
|
+
...N,
|
|
33
|
+
...T
|
|
34
|
+
];
|
|
35
|
+
/**
|
|
36
|
+
* @license lucide-react v1.17.0 - ISC
|
|
37
|
+
*
|
|
38
|
+
* This source code is licensed under the ISC license.
|
|
39
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
40
|
+
*/
|
|
41
|
+
const A = [
|
|
42
|
+
[
|
|
43
|
+
"path",
|
|
44
|
+
{
|
|
45
|
+
d: "M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",
|
|
46
|
+
key: "18u6gg"
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
["circle", { cx: "12", cy: "13", r: "3", key: "1vg3eu" }]
|
|
50
|
+
], K = d("camera", A);
|
|
51
|
+
/**
|
|
52
|
+
* @license lucide-react v1.17.0 - ISC
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the ISC license.
|
|
55
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
56
|
+
*/
|
|
57
|
+
const B = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], O = d("chevron-down", B);
|
|
58
|
+
/**
|
|
59
|
+
* @license lucide-react v1.17.0 - ISC
|
|
60
|
+
*
|
|
61
|
+
* This source code is licensed under the ISC license.
|
|
62
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
63
|
+
*/
|
|
64
|
+
const H = [
|
|
65
|
+
["circle", { cx: "9", cy: "12", r: "1", key: "1vctgf" }],
|
|
66
|
+
["circle", { cx: "9", cy: "5", r: "1", key: "hp0tcf" }],
|
|
67
|
+
["circle", { cx: "9", cy: "19", r: "1", key: "fkjjf6" }],
|
|
68
|
+
["circle", { cx: "15", cy: "12", r: "1", key: "1tmaij" }],
|
|
69
|
+
["circle", { cx: "15", cy: "5", r: "1", key: "19l28e" }],
|
|
70
|
+
["circle", { cx: "15", cy: "19", r: "1", key: "f4zoj3" }]
|
|
71
|
+
], G = d("grip-vertical", H);
|
|
72
|
+
/**
|
|
73
|
+
* @license lucide-react v1.17.0 - ISC
|
|
74
|
+
*
|
|
75
|
+
* This source code is licensed under the ISC license.
|
|
76
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
77
|
+
*/
|
|
78
|
+
const Y = [
|
|
79
|
+
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2", key: "1m3agn" }],
|
|
80
|
+
["circle", { cx: "9", cy: "9", r: "2", key: "af1f0g" }],
|
|
81
|
+
["path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21", key: "1xmnt7" }]
|
|
82
|
+
], q = d("image", Y);
|
|
83
|
+
/**
|
|
84
|
+
* @license lucide-react v1.17.0 - ISC
|
|
85
|
+
*
|
|
86
|
+
* This source code is licensed under the ISC license.
|
|
87
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
88
|
+
*/
|
|
89
|
+
const J = [
|
|
90
|
+
["path", { d: "M4 5h16", key: "1tepv9" }],
|
|
91
|
+
["path", { d: "M4 12h16", key: "1lakjw" }],
|
|
92
|
+
["path", { d: "M4 19h16", key: "1djgab" }]
|
|
93
|
+
], Q = d("menu", J);
|
|
94
|
+
/**
|
|
95
|
+
* @license lucide-react v1.17.0 - ISC
|
|
96
|
+
*
|
|
97
|
+
* This source code is licensed under the ISC license.
|
|
98
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
99
|
+
*/
|
|
100
|
+
const Z = [
|
|
101
|
+
[
|
|
102
|
+
"path",
|
|
103
|
+
{
|
|
104
|
+
d: "m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",
|
|
105
|
+
key: "ftymec"
|
|
106
|
+
}
|
|
107
|
+
],
|
|
108
|
+
["rect", { x: "2", y: "6", width: "14", height: "12", rx: "2", key: "158x01" }]
|
|
109
|
+
], ee = d("video", Z), te = (t) => t === "webcam" ? "📷 " : t === "image" ? "🖼 " : "▶ ", re = {
|
|
110
|
+
position: "fixed",
|
|
111
|
+
zIndex: 2e4,
|
|
112
|
+
pointerEvents: "none"
|
|
113
|
+
}, E = {
|
|
114
|
+
pointerEvents: "auto",
|
|
115
|
+
border: "1px solid rgba(255, 255, 255, 0.12)",
|
|
116
|
+
background: "rgba(8, 15, 28, 0.58)",
|
|
117
|
+
boxShadow: "0 12px 32px rgba(0, 0, 0, 0.28)",
|
|
118
|
+
backdropFilter: "blur(20px) saturate(1.15)",
|
|
119
|
+
WebkitBackdropFilter: "blur(20px) saturate(1.15)",
|
|
120
|
+
color: "#f8fafc",
|
|
121
|
+
display: "flex"
|
|
122
|
+
}, ne = {
|
|
123
|
+
...E,
|
|
124
|
+
width: 34,
|
|
125
|
+
height: 34,
|
|
126
|
+
borderRadius: 17,
|
|
127
|
+
alignItems: "center",
|
|
128
|
+
justifyContent: "center",
|
|
129
|
+
cursor: "pointer",
|
|
130
|
+
transition: "transform 150ms ease"
|
|
131
|
+
}, ie = {
|
|
132
|
+
...E,
|
|
133
|
+
flexDirection: "column",
|
|
134
|
+
borderRadius: 12,
|
|
135
|
+
overflow: "hidden",
|
|
136
|
+
padding: 4,
|
|
137
|
+
gap: 4
|
|
138
|
+
}, oe = {
|
|
139
|
+
display: "flex",
|
|
140
|
+
alignItems: "center",
|
|
141
|
+
gap: 3
|
|
142
|
+
}, ae = {
|
|
143
|
+
width: 1,
|
|
144
|
+
height: 12,
|
|
145
|
+
background: "rgba(255, 255, 255, 0.12)",
|
|
146
|
+
margin: "0 3px"
|
|
147
|
+
}, se = {
|
|
148
|
+
display: "flex",
|
|
149
|
+
width: 16,
|
|
150
|
+
height: 24,
|
|
151
|
+
alignItems: "center",
|
|
152
|
+
justifyContent: "center",
|
|
153
|
+
cursor: "grab",
|
|
154
|
+
color: "rgba(148, 163, 184, 0.8)",
|
|
155
|
+
flex: "0 0 auto"
|
|
156
|
+
}, S = (t = !1) => ({
|
|
157
|
+
display: "flex",
|
|
158
|
+
width: 24,
|
|
159
|
+
height: 24,
|
|
160
|
+
alignItems: "center",
|
|
161
|
+
justifyContent: "center",
|
|
162
|
+
borderRadius: 8,
|
|
163
|
+
border: `1px solid ${t ? "rgba(255, 255, 255, 0.12)" : "transparent"}`,
|
|
164
|
+
background: t ? "rgba(255, 255, 255, 0.08)" : "transparent",
|
|
165
|
+
color: t ? "#f8fafc" : "rgba(226, 232, 240, 0.72)",
|
|
166
|
+
cursor: "pointer",
|
|
167
|
+
flex: "0 0 auto",
|
|
168
|
+
transition: "background 120ms ease, color 120ms ease"
|
|
169
|
+
}), ce = {
|
|
170
|
+
position: "relative",
|
|
171
|
+
display: "flex",
|
|
172
|
+
alignItems: "center"
|
|
173
|
+
}, de = {
|
|
174
|
+
width: "100%",
|
|
175
|
+
minWidth: 140,
|
|
176
|
+
height: 24,
|
|
177
|
+
borderRadius: 8,
|
|
178
|
+
border: "1px solid rgba(255, 255, 255, 0.10)",
|
|
179
|
+
background: "rgba(15, 23, 42, 0.65)",
|
|
180
|
+
color: "#f8fafc",
|
|
181
|
+
fontSize: 11,
|
|
182
|
+
outline: "none",
|
|
183
|
+
paddingLeft: 7,
|
|
184
|
+
paddingRight: 20,
|
|
185
|
+
appearance: "none",
|
|
186
|
+
cursor: "pointer"
|
|
187
|
+
}, le = {
|
|
188
|
+
pointerEvents: "none",
|
|
189
|
+
position: "absolute",
|
|
190
|
+
right: 5,
|
|
191
|
+
top: 0,
|
|
192
|
+
bottom: 0,
|
|
193
|
+
display: "flex",
|
|
194
|
+
alignItems: "center",
|
|
195
|
+
color: "rgba(148, 163, 184, 0.9)"
|
|
196
|
+
}, pe = {
|
|
197
|
+
height: 24,
|
|
198
|
+
display: "flex",
|
|
199
|
+
alignItems: "center",
|
|
200
|
+
padding: "0 8px",
|
|
201
|
+
borderRadius: 8,
|
|
202
|
+
border: "1px solid rgba(255, 255, 255, 0.08)",
|
|
203
|
+
background: "rgba(255, 255, 255, 0.04)",
|
|
204
|
+
color: "rgba(226, 232, 240, 0.72)",
|
|
205
|
+
fontSize: 11
|
|
206
|
+
}, _ = { width: 14, height: 14 }, xe = ({
|
|
207
|
+
value: t,
|
|
208
|
+
onChange: e,
|
|
209
|
+
sources: i,
|
|
210
|
+
style: s
|
|
211
|
+
}) => {
|
|
212
|
+
const [c, m] = y(!1), [a, h] = y({ x: 16, y: 16 }), [l, b] = y(t.kind), p = $(null), w = F(
|
|
213
|
+
() => ({
|
|
214
|
+
webcam: i.filter((r) => r.kind === "webcam"),
|
|
215
|
+
image: i.filter((r) => r.kind === "image"),
|
|
216
|
+
video: i.filter((r) => r.kind === "video")
|
|
217
|
+
}),
|
|
218
|
+
[i]
|
|
219
|
+
), k = w[l];
|
|
220
|
+
f(() => {
|
|
221
|
+
b(t.kind);
|
|
222
|
+
}, [t.kind]);
|
|
223
|
+
const R = (r) => {
|
|
224
|
+
b(r);
|
|
225
|
+
const o = w[r][0];
|
|
226
|
+
o && e(o);
|
|
227
|
+
};
|
|
228
|
+
f(() => {
|
|
229
|
+
const r = (g) => {
|
|
230
|
+
p.current && h({
|
|
231
|
+
x: Math.max(8, g.clientX - p.current.x),
|
|
232
|
+
y: Math.max(8, g.clientY - p.current.y)
|
|
233
|
+
});
|
|
234
|
+
}, o = () => {
|
|
235
|
+
p.current = null, document.body.classList.remove("select-none");
|
|
236
|
+
};
|
|
237
|
+
return window.addEventListener("pointermove", r), window.addEventListener("pointerup", o), () => {
|
|
238
|
+
window.removeEventListener("pointermove", r), window.removeEventListener("pointerup", o);
|
|
239
|
+
};
|
|
240
|
+
}, []);
|
|
241
|
+
const x = (r) => {
|
|
242
|
+
const o = r.currentTarget.getBoundingClientRect();
|
|
243
|
+
p.current = {
|
|
244
|
+
x: r.clientX - o.left,
|
|
245
|
+
y: r.clientY - o.top
|
|
246
|
+
}, document.body.classList.add("select-none"), r.currentTarget.setPointerCapture(r.pointerId);
|
|
247
|
+
}, I = () => k.length === 0 ? /* @__PURE__ */ n("div", { style: pe, children: l === "webcam" ? "No camera source" : l === "image" ? "No image preview" : "No video preview" }) : /* @__PURE__ */ u("div", { style: ce, children: [
|
|
248
|
+
/* @__PURE__ */ n(
|
|
249
|
+
"select",
|
|
250
|
+
{
|
|
251
|
+
value: t.id,
|
|
252
|
+
onChange: (r) => {
|
|
253
|
+
const o = i.find((g) => g.id === r.target.value);
|
|
254
|
+
o && e(o);
|
|
255
|
+
},
|
|
256
|
+
style: de,
|
|
257
|
+
children: k.map((r) => /* @__PURE__ */ u("option", { value: r.id, children: [
|
|
258
|
+
te(l),
|
|
259
|
+
r.label
|
|
260
|
+
] }, r.id))
|
|
261
|
+
}
|
|
262
|
+
),
|
|
263
|
+
/* @__PURE__ */ n("div", { style: le, children: /* @__PURE__ */ n("span", { style: { width: 10, height: 10 }, children: /* @__PURE__ */ n(O, { size: 10, strokeWidth: 1.8 }) }) })
|
|
264
|
+
] });
|
|
265
|
+
return typeof document > "u" ? null : W(
|
|
266
|
+
/* @__PURE__ */ n("div", { style: { ...re, left: a.x, top: a.y, ...s }, children: c ? (
|
|
267
|
+
// --- Expanded State ---
|
|
268
|
+
/* @__PURE__ */ u("div", { style: ie, children: [
|
|
269
|
+
/* @__PURE__ */ u("div", { style: oe, children: [
|
|
270
|
+
/* @__PURE__ */ n("div", { onPointerDown: x, style: se, title: "Drag to move", children: /* @__PURE__ */ n(G, { size: 11, strokeWidth: 2 }) }),
|
|
271
|
+
/* @__PURE__ */ n(
|
|
272
|
+
"button",
|
|
273
|
+
{
|
|
274
|
+
type: "button",
|
|
275
|
+
onClick: () => m(!1),
|
|
276
|
+
style: S(!1),
|
|
277
|
+
title: "Close Menu",
|
|
278
|
+
children: /* @__PURE__ */ n("span", { style: _, children: /* @__PURE__ */ n(X, { size: 14, strokeWidth: 1.8 }) })
|
|
279
|
+
}
|
|
280
|
+
),
|
|
281
|
+
/* @__PURE__ */ n("div", { style: ae }),
|
|
282
|
+
["webcam", "image", "video"].map((r) => /* @__PURE__ */ n(
|
|
283
|
+
"button",
|
|
284
|
+
{
|
|
285
|
+
type: "button",
|
|
286
|
+
onClick: () => R(r),
|
|
287
|
+
style: S(l === r),
|
|
288
|
+
title: r.charAt(0).toUpperCase() + r.slice(1),
|
|
289
|
+
children: /* @__PURE__ */ n("span", { style: _, children: r === "webcam" ? /* @__PURE__ */ n(K, { size: 14, strokeWidth: 1.8 }) : r === "image" ? /* @__PURE__ */ n(q, { size: 14, strokeWidth: 1.8 }) : /* @__PURE__ */ n(ee, { size: 14, strokeWidth: 1.8 }) })
|
|
290
|
+
},
|
|
291
|
+
r
|
|
292
|
+
))
|
|
293
|
+
] }),
|
|
294
|
+
I()
|
|
295
|
+
] })
|
|
296
|
+
) : (
|
|
297
|
+
// --- Collapsed State (Minimal FAB) ---
|
|
298
|
+
/* @__PURE__ */ n(
|
|
299
|
+
"div",
|
|
300
|
+
{
|
|
301
|
+
style: ne,
|
|
302
|
+
onClick: () => m(!0),
|
|
303
|
+
onPointerDown: x,
|
|
304
|
+
title: "Open Media Menu",
|
|
305
|
+
children: /* @__PURE__ */ n("span", { style: { width: 16, height: 16 }, children: /* @__PURE__ */ n(Q, { size: 14, strokeWidth: 1.8 }) })
|
|
306
|
+
}
|
|
307
|
+
)
|
|
308
|
+
) }),
|
|
309
|
+
document.body
|
|
310
|
+
);
|
|
311
|
+
}, ge = async (t) => {
|
|
312
|
+
const e = new Image();
|
|
313
|
+
e.crossOrigin = "anonymous", e.src = t, await e.decode();
|
|
314
|
+
const i = document.createElement("canvas");
|
|
315
|
+
i.width = e.naturalWidth, i.height = e.naturalHeight;
|
|
316
|
+
const s = i.getContext("2d");
|
|
317
|
+
if (!s) throw new Error("Unable to create image media canvas");
|
|
318
|
+
return s.drawImage(e, 0, 0, i.width, i.height), i.captureStream(30);
|
|
319
|
+
}, ue = async (t) => {
|
|
320
|
+
const e = document.createElement("video");
|
|
321
|
+
return e.src = t, e.loop = !0, e.muted = !0, e.playsInline = !0, e.crossOrigin = "anonymous", await e.play(), e.captureStream();
|
|
322
|
+
}, me = (t, e) => {
|
|
323
|
+
const { session: i } = z();
|
|
324
|
+
f(() => {
|
|
325
|
+
let s = !1, c = null;
|
|
326
|
+
return (async () => {
|
|
327
|
+
try {
|
|
328
|
+
if (t.kind === "webcam")
|
|
329
|
+
await i.setMediaSource({ source: v.WEBCAM });
|
|
330
|
+
else {
|
|
331
|
+
if (!t.url) throw new Error(`Missing media URL for ${t.id}`);
|
|
332
|
+
const a = t.kind === "image" ? await ge(t.url) : await ue(t.url);
|
|
333
|
+
if (c = a, s) {
|
|
334
|
+
a.getTracks().forEach((h) => h.stop());
|
|
335
|
+
return;
|
|
336
|
+
}
|
|
337
|
+
await i.setMediaSource({
|
|
338
|
+
source: v.STREAM,
|
|
339
|
+
stream: a,
|
|
340
|
+
sourceKind: t.kind
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
await i.registerXRPipeline(
|
|
344
|
+
(e == null ? void 0 : e.pipeline) ?? [
|
|
345
|
+
{ model: L.FACE_TRACKER, options: { numFaces: (e == null ? void 0 : e.numFaces) ?? 1 } }
|
|
346
|
+
]
|
|
347
|
+
), await i.start();
|
|
348
|
+
} catch (a) {
|
|
349
|
+
console.error("[MediaSourceSession] Error initializing XR session:", a);
|
|
350
|
+
}
|
|
351
|
+
})(), () => {
|
|
352
|
+
s = !0, c == null || c.getTracks().forEach((a) => a.stop());
|
|
353
|
+
};
|
|
354
|
+
}, [t, e == null ? void 0 : e.numFaces, e == null ? void 0 : e.pipeline, i]);
|
|
355
|
+
}, ve = me;
|
|
356
|
+
export {
|
|
357
|
+
xe as M,
|
|
358
|
+
N as a,
|
|
359
|
+
me as b,
|
|
360
|
+
ke as d,
|
|
361
|
+
T as s,
|
|
362
|
+
ve as u
|
|
363
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export type AnimatedTextureState = "idle" | "loading" | "ready" | "playing" | "paused" | "ended" | "error";
|
|
2
|
+
export type AnimatedTexturePlayMode = "forward" | "reverse" | "ping-pong" | "random";
|
|
3
|
+
export type AnimatedTextureEventType = "KeyFrameInSecond" | "Pause" | "PlayBegin" | "PlayEnd" | "Resume" | "Stop";
|
|
4
|
+
export type AnimatedTextureCapabilities = {
|
|
5
|
+
canSeek: boolean;
|
|
6
|
+
canReverse: boolean;
|
|
7
|
+
supportsLoopCount: boolean;
|
|
8
|
+
};
|
|
9
|
+
export type AnimatedTextureSnapshot = {
|
|
10
|
+
state: AnimatedTextureState;
|
|
11
|
+
frame: number;
|
|
12
|
+
time: number;
|
|
13
|
+
duration?: number;
|
|
14
|
+
frameCount?: number;
|
|
15
|
+
error?: Error;
|
|
16
|
+
playMode: AnimatedTexturePlayMode;
|
|
17
|
+
loop: boolean;
|
|
18
|
+
loopCount: number;
|
|
19
|
+
};
|
|
20
|
+
export type AnimatedTextureListener = (snapshot: AnimatedTextureSnapshot) => void;
|
|
21
|
+
export type AnimatedTextureEvent = {
|
|
22
|
+
type: AnimatedTextureEventType;
|
|
23
|
+
snapshot: AnimatedTextureSnapshot;
|
|
24
|
+
};
|
|
25
|
+
export type AnimatedTextureEventListener = (event: AnimatedTextureEvent) => void;
|
|
26
|
+
export interface AnimatedTextureController {
|
|
27
|
+
readonly capabilities: AnimatedTextureCapabilities;
|
|
28
|
+
play(): Promise<void> | void;
|
|
29
|
+
pause(): void;
|
|
30
|
+
restart(): Promise<void> | void;
|
|
31
|
+
seek?(value: number): void;
|
|
32
|
+
setPlayMode(mode: AnimatedTexturePlayMode): void;
|
|
33
|
+
setLoop(loop: boolean, count?: number): void;
|
|
34
|
+
subscribe(listener: AnimatedTextureListener): () => void;
|
|
35
|
+
on(type: AnimatedTextureEventType, listener: AnimatedTextureEventListener): () => void;
|
|
36
|
+
off(type: AnimatedTextureEventType, listener: AnimatedTextureEventListener): void;
|
|
37
|
+
/** Provider hook for frame/ended/stop events not caused by controller commands. */
|
|
38
|
+
emit(type: AnimatedTextureEventType): void;
|
|
39
|
+
getSnapshot(): AnimatedTextureSnapshot;
|
|
40
|
+
dispose(): void;
|
|
41
|
+
}
|
|
42
|
+
export declare class BasicAnimatedTextureController implements AnimatedTextureController {
|
|
43
|
+
readonly capabilities: AnimatedTextureCapabilities;
|
|
44
|
+
private snapshot;
|
|
45
|
+
private listeners;
|
|
46
|
+
private eventListeners;
|
|
47
|
+
constructor(capabilities: AnimatedTextureCapabilities, initial?: Partial<AnimatedTextureSnapshot>);
|
|
48
|
+
play(): void;
|
|
49
|
+
pause(): void;
|
|
50
|
+
restart(): void;
|
|
51
|
+
setPlayMode(playMode: AnimatedTexturePlayMode): void;
|
|
52
|
+
setLoop(loop: boolean, loopCount?: number): void;
|
|
53
|
+
seek(value: number): void;
|
|
54
|
+
subscribe(listener: AnimatedTextureListener): () => boolean;
|
|
55
|
+
on(type: AnimatedTextureEventType, listener: AnimatedTextureEventListener): () => void;
|
|
56
|
+
off(type: AnimatedTextureEventType, listener: AnimatedTextureEventListener): void;
|
|
57
|
+
getSnapshot(): AnimatedTextureSnapshot;
|
|
58
|
+
dispose(): void;
|
|
59
|
+
emit(type: AnimatedTextureEventType): void;
|
|
60
|
+
private update;
|
|
61
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AnimatedTexturePlayMode } from './animatedTexture';
|
|
2
|
+
export type PlaybackFrameResult = {
|
|
3
|
+
frame: number;
|
|
4
|
+
ended: boolean;
|
|
5
|
+
loop: number;
|
|
6
|
+
};
|
|
7
|
+
export declare const getPlaybackFrame: (tick: number, frameCount: number, mode: AnimatedTexturePlayMode, loop: boolean, loopCount: number) => PlaybackFrameResult;
|
|
8
|
+
export declare const getSequenceFrame: (elapsedSeconds: number, fps: number, frameCount: number) => number;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { AnimatedTextureController } from './animatedTexture';
|
|
2
|
+
import type * as THREE from "three";
|
|
3
|
+
export type ResolvedTextureSource = {
|
|
4
|
+
texture: THREE.Texture;
|
|
5
|
+
controller?: AnimatedTextureController;
|
|
6
|
+
metadata?: {
|
|
7
|
+
width?: number;
|
|
8
|
+
height?: number;
|
|
9
|
+
duration?: number;
|
|
10
|
+
frameCount?: number;
|
|
11
|
+
};
|
|
12
|
+
dispose(): void;
|
|
13
|
+
};
|
|
14
|
+
export type TextureSourceResolver<TSource> = (source: TSource, signal: AbortSignal) => Promise<ResolvedTextureSource>;
|
|
15
|
+
export type TextureSourceProvider<TSource> = {
|
|
16
|
+
canResolve(source: TSource): boolean;
|
|
17
|
+
resolve(source: TSource, signal: AbortSignal): Promise<ResolvedTextureSource>;
|
|
18
|
+
};
|
|
19
|
+
/** Compose image/video/GIF/sequence providers without coupling ScreenImage to loaders. */
|
|
20
|
+
export declare function createTextureSourceResolver<TSource>(providers: readonly TextureSourceProvider<TSource>[]): TextureSourceResolver<TSource>;
|
|
21
|
+
export declare class TextureSourceLoadError extends Error {
|
|
22
|
+
readonly source: unknown;
|
|
23
|
+
constructor(message: string, source: unknown);
|
|
24
|
+
}
|
|
25
|
+
/** Throw when an async provider finishes after its source was replaced. */
|
|
26
|
+
export declare function throwIfAborted(signal: AbortSignal): void;
|
|
27
|
+
/** Resolve a provider while guaranteeing late results are not accepted. */
|
|
28
|
+
export declare function resolveTextureSource<TSource>(resolver: TextureSourceResolver<TSource>, source: TSource, signal: AbortSignal): Promise<ResolvedTextureSource>;
|
|
29
|
+
/** Dispose a resolved source exactly once. Safe for source-switch cleanup. */
|
|
30
|
+
export declare function disposeResolvedTextureSource(source: ResolvedTextureSource | undefined): void;
|