@octanejs/drei 0.0.1
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/LICENSE +21 -0
- package/README.md +11 -0
- package/UPSTREAM.md +92 -0
- package/package.json +96 -0
- package/src/config.ts +14 -0
- package/src/core/AccumulativeShadows.three.tsrx +313 -0
- package/src/core/AdaptivePerformance.three.tsrx +49 -0
- package/src/core/AsciiRenderer.three.tsrx +61 -0
- package/src/core/Bounds.three.tsrx +323 -0
- package/src/core/Bvh.three.tsrx +116 -0
- package/src/core/CameraControls.three.tsrx +181 -0
- package/src/core/CameraShake.three.tsrx +104 -0
- package/src/core/Caustics.three.tsrx +107 -0
- package/src/core/Center.three.tsrx +145 -0
- package/src/core/Clone.three.tsrx +167 -0
- package/src/core/Cloud.three.tsrx +314 -0
- package/src/core/ComputedAttribute.three.tsrx +27 -0
- package/src/core/ContactShadows.three.tsrx +106 -0
- package/src/core/CubeTexture.three.tsrx +32 -0
- package/src/core/CurveModifier.three.tsrx +37 -0
- package/src/core/Decal.three.tsrx +132 -0
- package/src/core/Detailed.three.tsrx +28 -0
- package/src/core/DetectGPU.three.tsrx +22 -0
- package/src/core/Effects.three.tsrx +123 -0
- package/src/core/Environment.three.tsrx +220 -0
- package/src/core/Example.three.tsrx +56 -0
- package/src/core/Fbo.three.tsrx +70 -0
- package/src/core/Fbx.three.tsrx +25 -0
- package/src/core/Fisheye.three.tsrx +82 -0
- package/src/core/GizmoHelper.three.tsrx +115 -0
- package/src/core/GizmoViewcube.three.tsrx +82 -0
- package/src/core/GizmoViewport.three.tsrx +122 -0
- package/src/core/Gltf.three.tsrx +62 -0
- package/src/core/GradientTexture.three.tsrx +66 -0
- package/src/core/Grid.three.tsrx +170 -0
- package/src/core/Helper.three.tsrx +56 -0
- package/src/core/Hud.three.tsrx +52 -0
- package/src/core/Image.three.tsrx +146 -0
- package/src/core/Instances.three.tsrx +332 -0
- package/src/core/Ktx2.three.tsrx +59 -0
- package/src/core/Lightformer.three.tsrx +75 -0
- package/src/core/MarchingCubes.three.tsrx +125 -0
- package/src/core/MeshPortalMaterial.three.tsrx +103 -0
- package/src/core/MeshReflectorMaterial.three.tsrx +67 -0
- package/src/core/MeshRefractionMaterial.three.tsrx +70 -0
- package/src/core/MeshTransmissionMaterial.three.tsrx +71 -0
- package/src/core/MotionPathControls.three.tsrx +139 -0
- package/src/core/MultiMaterial.three.tsrx +32 -0
- package/src/core/Outlines.three.tsrx +162 -0
- package/src/core/PerformanceMonitor.three.tsrx +144 -0
- package/src/core/PointerLockControls.three.tsrx +84 -0
- package/src/core/Points.three.tsrx +242 -0
- package/src/core/PositionalAudio.three.tsrx +76 -0
- package/src/core/Preload.three.tsrx +40 -0
- package/src/core/Progress.three.tsrx +47 -0
- package/src/core/RenderCubeTexture.three.tsrx +111 -0
- package/src/core/RenderTexture.three.tsrx +102 -0
- package/src/core/Resize.three.tsrx +59 -0
- package/src/core/RoundedBox.three.tsrx +106 -0
- package/src/core/Sampler.three.tsrx +116 -0
- package/src/core/ScreenSizer.three.tsrx +43 -0
- package/src/core/ScreenSpace.three.tsrx +21 -0
- package/src/core/Segments.three.tsrx +119 -0
- package/src/core/Sky.three.tsrx +63 -0
- package/src/core/Sparkles.three.tsrx +145 -0
- package/src/core/Splat.three.tsrx +52 -0
- package/src/core/SpotLight.three.tsrx +350 -0
- package/src/core/SpriteAnimator.three.tsrx +338 -0
- package/src/core/Stage.three.tsrx +112 -0
- package/src/core/Stars.three.tsrx +103 -0
- package/src/core/Stats.three.tsrx +35 -0
- package/src/core/StatsGl.three.tsrx +60 -0
- package/src/core/Svg.three.tsrx +82 -0
- package/src/core/Text.three.tsrx +96 -0
- package/src/core/Text3D.three.tsrx +90 -0
- package/src/core/Texture.three.tsrx +72 -0
- package/src/core/Trail.three.tsrx +167 -0
- package/src/core/TrailTexture.three.tsrx +171 -0
- package/src/core/TransformControls.three.tsrx +155 -0
- package/src/core/VideoTexture.three.tsrx +116 -0
- package/src/core/Wireframe.three.tsrx +92 -0
- package/src/core/basic-controls.three.tsrx +353 -0
- package/src/core/calculateScaleFactor.ts +42 -0
- package/src/core/cameras.three.tsrx +230 -0
- package/src/core/catalog-resource.ts +12 -0
- package/src/core/catalog-textures.three.tsrx +105 -0
- package/src/core/compiler-slot.ts +9 -0
- package/src/core/effects-utils.ts +8 -0
- package/src/core/environment-loader.ts +87 -0
- package/src/core/font-resource.ts +31 -0
- package/src/core/gltf-loader.ts +33 -0
- package/src/core/gradient-types.ts +4 -0
- package/src/core/index.ts +295 -0
- package/src/core/lines.three.tsrx +329 -0
- package/src/core/meshBounds.ts +26 -0
- package/src/core/motion-materials.three.tsrx +93 -0
- package/src/core/octane-children.ts +18 -0
- package/src/core/octane-element.ts +16 -0
- package/src/core/resource.ts +29 -0
- package/src/core/scene-motion.three.tsrx +183 -0
- package/src/core/shaderMaterial.ts +50 -0
- package/src/core/shadows.three.tsrx +164 -0
- package/src/core/shapes.three.tsrx +170 -0
- package/src/core/simple-materials.three.tsrx +124 -0
- package/src/core/softShadows.three.tsrx +151 -0
- package/src/core/splat-resource.ts +598 -0
- package/src/core/useAnimations.three.tsrx +57 -0
- package/src/core/useAspect.three.tsrx +10 -0
- package/src/core/useBoxProjectedEnv.three.tsrx +113 -0
- package/src/core/useCamera.three.tsrx +26 -0
- package/src/core/useContextBridge.three.tsrx +25 -0
- package/src/core/useDepthBuffer.three.tsrx +35 -0
- package/src/core/useEnvironment.three.tsrx +81 -0
- package/src/core/useFont.three.tsrx +12 -0
- package/src/core/useIntersect.three.tsrx +38 -0
- package/src/core/useSpriteLoader.three.tsrx +249 -0
- package/src/core/video-texture-resource.ts +14 -0
- package/src/index.ts +2 -0
- package/src/materials/BlurPass.ts +94 -0
- package/src/materials/CausticsMaterials.ts +197 -0
- package/src/materials/ConvolutionMaterial.ts +65 -0
- package/src/materials/MeshReflectorMaterial.ts +180 -0
- package/src/materials/MeshRefractionMaterial.ts +131 -0
- package/src/materials/MeshTransmissionMaterial.ts +182 -0
- package/src/materials/PortalMaterial.ts +38 -0
- package/src/materials/WireframeMaterial.ts +241 -0
- package/src/materials/makeSDFGenerator.ts +155 -0
- package/src/troika-three-text.d.ts +19 -0
- package/src/web/CycleRaycast.three.tsrx +81 -0
- package/src/web/DragControls.three.tsrx +82 -0
- package/src/web/FaceControls.three.tsrx +178 -0
- package/src/web/FaceLandmarker.three.tsrx +48 -0
- package/src/web/Facemesh.three.tsrx +464 -0
- package/src/web/Html.three.tsrx +390 -0
- package/src/web/KeyboardControls.three.tsrx +98 -0
- package/src/web/Loader.tsrx +61 -0
- package/src/web/PresentationControls.three.tsrx +63 -0
- package/src/web/ScrollControls.three.tsrx +120 -0
- package/src/web/Select.three.tsrx +155 -0
- package/src/web/View.three.tsrx +46 -0
- package/src/web/face-landmarker-resource.ts +18 -0
- package/src/web/facemesh-data.ts +54 -0
- package/src/web/index.ts +41 -0
- package/src/web/keyboard-controls-types.ts +33 -0
- package/src/web/media-textures.three.tsrx +50 -0
- package/src/web/pivotControls/annotation.tsrx +17 -0
- package/src/web/pivotControls/context.ts +38 -0
- package/src/web/pivotControls/index.three.tsrx +877 -0
- package/src/web/scroll-html-root.tsrx +27 -0
- package/src/web/useCursor.three.tsrx +19 -0
- package/src/web/useGesture.ts +27 -0
- package/status.json +14 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { context as threeContext, type RootStore } from '@octanejs/three';
|
|
2
|
+
import { createRoot, type Context, type OctaneNode } from 'octane';
|
|
3
|
+
import type { ScrollControlsState } from './ScrollControls.three.tsrx';
|
|
4
|
+
|
|
5
|
+
// The Three context is registered with Octane's renderer bridge, so this DOM-owned
|
|
6
|
+
// root must expose that same provider through the DOM Context call signature.
|
|
7
|
+
const DomThreeContextProvider = threeContext.Provider as unknown as Context<RootStore | null>['Provider'];
|
|
8
|
+
|
|
9
|
+
function ScrollHtmlContent({ state, fiberState, children }: {
|
|
10
|
+
state: ScrollControlsState;
|
|
11
|
+
fiberState: RootStore;
|
|
12
|
+
children?: OctaneNode;
|
|
13
|
+
}) @{
|
|
14
|
+
<ScrollControlsStateProvider value={state}>
|
|
15
|
+
<DomThreeContextProvider value={fiberState}>{children}</DomThreeContextProvider>
|
|
16
|
+
</ScrollControlsStateProvider>
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Assigned by ScrollControls to avoid a runtime circular import while preserving context identity.
|
|
20
|
+
export let ScrollControlsStateProvider: any;
|
|
21
|
+
export function setScrollControlsStateProvider(provider: any): void { ScrollControlsStateProvider = provider; }
|
|
22
|
+
|
|
23
|
+
export function mountScrollHtml(container: HTMLElement, props: { state: ScrollControlsState; fiberState: RootStore; children?: OctaneNode }): () => void {
|
|
24
|
+
const root = createRoot(container);
|
|
25
|
+
root.render(ScrollHtmlContent, props);
|
|
26
|
+
return () => root.unmount();
|
|
27
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useEffect } from '@octanejs/three/renderer';
|
|
2
|
+
import { slotDefault } from '../core/compiler-slot.js';
|
|
3
|
+
|
|
4
|
+
export function useCursor(
|
|
5
|
+
hovered: boolean,
|
|
6
|
+
onPointerOver = 'pointer',
|
|
7
|
+
onPointerOut = 'auto',
|
|
8
|
+
container: HTMLElement = document.body,
|
|
9
|
+
) {
|
|
10
|
+
onPointerOver = slotDefault(onPointerOver, 'pointer');
|
|
11
|
+
onPointerOut = slotDefault(onPointerOut, 'auto');
|
|
12
|
+
container = slotDefault(container, document.body);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
if (hovered) {
|
|
15
|
+
container.style.cursor = onPointerOver;
|
|
16
|
+
return () => void (container.style.cursor = onPointerOut);
|
|
17
|
+
}
|
|
18
|
+
}, [hovered]);
|
|
19
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Controller, parseMergedHandlers } from '@use-gesture/core';
|
|
2
|
+
import {
|
|
3
|
+
dragAction,
|
|
4
|
+
hoverAction,
|
|
5
|
+
moveAction,
|
|
6
|
+
pinchAction,
|
|
7
|
+
registerAction,
|
|
8
|
+
scrollAction,
|
|
9
|
+
wheelAction,
|
|
10
|
+
} from '@use-gesture/core/actions';
|
|
11
|
+
import type { GestureHandlers, UserGestureConfig } from '@use-gesture/core/types';
|
|
12
|
+
import { useEffect, useMemo } from '@octanejs/three/renderer';
|
|
13
|
+
import { slotDefault } from '../core/compiler-slot.js';
|
|
14
|
+
|
|
15
|
+
for (const action of [dragAction, pinchAction, scrollAction, wheelAction, moveAction, hoverAction])
|
|
16
|
+
registerAction(action);
|
|
17
|
+
|
|
18
|
+
export function useGesture(handlersInput: GestureHandlers, configInput: UserGestureConfig = {}) {
|
|
19
|
+
configInput = slotDefault(configInput, {});
|
|
20
|
+
const { handlers, nativeHandlers, config } = parseMergedHandlers(handlersInput, configInput);
|
|
21
|
+
const controller = useMemo(() => new Controller(handlers), []);
|
|
22
|
+
controller.applyHandlers(handlers, nativeHandlers);
|
|
23
|
+
controller.applyConfig(config);
|
|
24
|
+
useEffect(controller.effect.bind(controller));
|
|
25
|
+
useEffect(() => controller.clean.bind(controller), []);
|
|
26
|
+
return config.target === undefined ? controller.bind.bind(controller) : undefined;
|
|
27
|
+
}
|
package/status.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"upstream": {
|
|
3
|
+
"package": "@react-three/drei",
|
|
4
|
+
"version": "10.7.7"
|
|
5
|
+
},
|
|
6
|
+
"surface": "Complete port of the pinned @react-three/drei 10.7.7 public web API (commit b8b99fd4ca1dfb8d821335671320512daa6efea4): 379 source exports and 217 runtime exports are accounted for by the executable crosswalk, with 299 parity assertions across 105 test files.",
|
|
7
|
+
"divergences": [
|
|
8
|
+
"View: inline Canvas views are ported. Calling View from an Octane DOM root fails with the universal renderer-boundary diagnostic, and View.Port is a callable no-op. Octane components are statically renderer-owned, so one component cannot switch between DOM and Three renderers or transport authored Three children between independent roots as React Drei does with tunnel-rat."
|
|
9
|
+
],
|
|
10
|
+
"ssr": "Browser-dependent helpers remain client-only; server-safe behavior is verified per export.",
|
|
11
|
+
"verified": "2026-08-02",
|
|
12
|
+
"parityEvidence": "packages/drei/audit/react-parity.json",
|
|
13
|
+
"docs": ["packages/drei/README.md", "packages/drei/UPSTREAM.md"]
|
|
14
|
+
}
|