@react-three/drei 11.0.0-alpha.5 → 11.0.0-alpha.6

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.
@@ -4,6 +4,7 @@ import { MarchingCubes as MarchingCubes$1 } from 'three/examples/jsm/objects/Mar
4
4
  import { ThreeElements, ReactThreeFiber, ThreeElement } from '@react-three/fiber';
5
5
  import * as React from 'react';
6
6
  import { ForwardRefExoticComponent, PropsWithoutRef, RefAttributes } from 'react';
7
+ import { MeshBVHUniformStruct } from 'three-mesh-bvh';
7
8
  import { RenderPass } from 'three/examples/jsm/postprocessing/RenderPass.js';
8
9
  import { ShaderPass } from 'three/examples/jsm/postprocessing/ShaderPass.js';
9
10
  import { EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer.js';
@@ -149,6 +150,25 @@ declare module '@react-three/fiber' {
149
150
  }
150
151
  }
151
152
 
153
+ declare module '@react-three/fiber' {
154
+ interface ThreeElements {
155
+ meshRefractionMaterial_: ThreeElements['shaderMaterial'] & {
156
+ envMap?: THREE.CubeTexture | THREE.Texture | null;
157
+ bounces?: number;
158
+ ior?: number;
159
+ correctMips?: boolean;
160
+ aberrationStrength?: number;
161
+ fresnel?: number;
162
+ bvh?: MeshBVHUniformStruct;
163
+ color?: ReactThreeFiber.Color;
164
+ opacity?: number;
165
+ resolution?: [number, number] | THREE.Vector2;
166
+ viewMatrixInverse?: THREE.Matrix4;
167
+ projectionMatrixInverse?: THREE.Matrix4;
168
+ };
169
+ }
170
+ }
171
+
152
172
  declare module '@react-three/fiber' {
153
173
  interface ThreeElements {
154
174
  portalMaterialImpl: ThreeElements['shaderMaterial'] & {
@@ -4,6 +4,7 @@ import { MarchingCubes as MarchingCubes$1 } from 'three/examples/jsm/objects/Mar
4
4
  import { ThreeElements, ReactThreeFiber, ThreeElement } from '@react-three/fiber';
5
5
  import * as React from 'react';
6
6
  import { ForwardRefExoticComponent, PropsWithoutRef, RefAttributes } from 'react';
7
+ import { MeshBVHUniformStruct } from 'three-mesh-bvh';
7
8
  import { RenderPass } from 'three/examples/jsm/postprocessing/RenderPass.js';
8
9
  import { ShaderPass } from 'three/examples/jsm/postprocessing/ShaderPass.js';
9
10
  import { EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer.js';
@@ -149,6 +150,25 @@ declare module '@react-three/fiber' {
149
150
  }
150
151
  }
151
152
 
153
+ declare module '@react-three/fiber' {
154
+ interface ThreeElements {
155
+ meshRefractionMaterial_: ThreeElements['shaderMaterial'] & {
156
+ envMap?: THREE.CubeTexture | THREE.Texture | null;
157
+ bounces?: number;
158
+ ior?: number;
159
+ correctMips?: boolean;
160
+ aberrationStrength?: number;
161
+ fresnel?: number;
162
+ bvh?: MeshBVHUniformStruct;
163
+ color?: ReactThreeFiber.Color;
164
+ opacity?: number;
165
+ resolution?: [number, number] | THREE.Vector2;
166
+ viewMatrixInverse?: THREE.Matrix4;
167
+ projectionMatrixInverse?: THREE.Matrix4;
168
+ };
169
+ }
170
+ }
171
+
152
172
  declare module '@react-three/fiber' {
153
173
  interface ThreeElements {
154
174
  portalMaterialImpl: ThreeElements['shaderMaterial'] & {
@@ -1,9 +1,10 @@
1
+ import * as _react_three_fiber from '@react-three/fiber';
1
2
  import { ThreeElements, ThreeElement, ReactThreeFiber, Vector2, Vector3 } from '@react-three/fiber';
2
3
  import * as React from 'react';
3
4
  import { ForwardRefExoticComponent, PropsWithoutRef, RefAttributes, RefObject, ReactNode } from 'react';
4
5
  import * as THREE from 'three';
5
6
  import { Mesh, Group, PerspectiveCamera, OrthographicCamera, EventDispatcher, MeshStandardMaterial, Texture, Matrix4, Color, ColorRepresentation } from 'three';
6
- import { SplitStrategy } from 'three-mesh-bvh';
7
+ import { SplitStrategy, MeshBVHUniformStruct } from 'three-mesh-bvh';
7
8
  import CameraControlsImpl from 'camera-controls';
8
9
  export { default as CameraControlsImpl } from 'camera-controls';
9
10
  import { FaceLandmarkerResult, FaceLandmarkerOptions, FaceLandmarker as FaceLandmarker$1 } from '@mediapipe/tasks-vision';
@@ -205,6 +206,25 @@ declare module '@react-three/fiber' {
205
206
  }
206
207
  }
207
208
 
209
+ declare module '@react-three/fiber' {
210
+ interface ThreeElements {
211
+ meshRefractionMaterial_: ThreeElements['shaderMaterial'] & {
212
+ envMap?: THREE.CubeTexture | THREE.Texture | null;
213
+ bounces?: number;
214
+ ior?: number;
215
+ correctMips?: boolean;
216
+ aberrationStrength?: number;
217
+ fresnel?: number;
218
+ bvh?: MeshBVHUniformStruct;
219
+ color?: ReactThreeFiber.Color;
220
+ opacity?: number;
221
+ resolution?: [number, number] | THREE.Vector2;
222
+ viewMatrixInverse?: THREE.Matrix4;
223
+ projectionMatrixInverse?: THREE.Matrix4;
224
+ };
225
+ }
226
+ }
227
+
208
228
  declare module '@react-three/fiber' {
209
229
  interface ThreeElements {
210
230
  portalMaterialImpl: ThreeElements['shaderMaterial'] & {
@@ -292,7 +312,23 @@ type FacemeshApi = {
292
312
  eyeRightRef: React.RefObject<FacemeshEyeApi>;
293
313
  eyeLeftRef: React.RefObject<FacemeshEyeApi>;
294
314
  };
295
- declare const Facemesh: React.ForwardRefExoticComponent<Omit<FacemeshProps, "ref"> & React.RefAttributes<FacemeshApi>>;
315
+ declare const Facemesh: React.ForwardRefExoticComponent<{
316
+ points?: MediaPipePoints;
317
+ face?: MediaPipeFaceMesh;
318
+ width?: number;
319
+ height?: number;
320
+ depth?: number;
321
+ verticalTri?: [number, number, number];
322
+ origin?: number | THREE.Vector3;
323
+ facialTransformationMatrix?: (typeof FacemeshDatas.SAMPLE_FACELANDMARKER_RESULT.facialTransformationMatrixes)[0];
324
+ offset?: boolean;
325
+ offsetScalar?: number;
326
+ faceBlendshapes?: (typeof FacemeshDatas.SAMPLE_FACELANDMARKER_RESULT.faceBlendshapes)[0];
327
+ eyes?: boolean;
328
+ eyesAsOrigin?: boolean;
329
+ debug?: boolean;
330
+ LineComponent?: React.ComponentType<LineProps>;
331
+ } & Omit<_react_three_fiber.Mutable<_react_three_fiber.Overwrite<Partial<_react_three_fiber.Overwrite<THREE.Group<THREE.Object3DEventMap>, _react_three_fiber.MathProps<THREE.Group<THREE.Object3DEventMap>> & _react_three_fiber.ReactProps<THREE.Group<THREE.Object3DEventMap>> & Partial<_react_three_fiber.EventHandlers> & _react_three_fiber.NodeProps<THREE.Group<THREE.Object3DEventMap>>>>, Omit<_react_three_fiber.InstanceProps<THREE.Group<THREE.Object3DEventMap>, typeof THREE.Group>, "object">>>, "ref"> & React.RefAttributes<FacemeshApi>>;
296
332
  type FacemeshEyeProps = {
297
333
  side: 'left' | 'right';
298
334
  debug?: boolean;
@@ -1,9 +1,10 @@
1
+ import * as _react_three_fiber from '@react-three/fiber';
1
2
  import { ThreeElements, ThreeElement, ReactThreeFiber, Vector2, Vector3 } from '@react-three/fiber';
2
3
  import * as React from 'react';
3
4
  import { ForwardRefExoticComponent, PropsWithoutRef, RefAttributes, RefObject, ReactNode } from 'react';
4
5
  import * as THREE from 'three';
5
6
  import { Mesh, Group, PerspectiveCamera, OrthographicCamera, EventDispatcher, MeshStandardMaterial, Texture, Matrix4, Color, ColorRepresentation } from 'three';
6
- import { SplitStrategy } from 'three-mesh-bvh';
7
+ import { SplitStrategy, MeshBVHUniformStruct } from 'three-mesh-bvh';
7
8
  import CameraControlsImpl from 'camera-controls';
8
9
  export { default as CameraControlsImpl } from 'camera-controls';
9
10
  import { FaceLandmarkerResult, FaceLandmarkerOptions, FaceLandmarker as FaceLandmarker$1 } from '@mediapipe/tasks-vision';
@@ -205,6 +206,25 @@ declare module '@react-three/fiber' {
205
206
  }
206
207
  }
207
208
 
209
+ declare module '@react-three/fiber' {
210
+ interface ThreeElements {
211
+ meshRefractionMaterial_: ThreeElements['shaderMaterial'] & {
212
+ envMap?: THREE.CubeTexture | THREE.Texture | null;
213
+ bounces?: number;
214
+ ior?: number;
215
+ correctMips?: boolean;
216
+ aberrationStrength?: number;
217
+ fresnel?: number;
218
+ bvh?: MeshBVHUniformStruct;
219
+ color?: ReactThreeFiber.Color;
220
+ opacity?: number;
221
+ resolution?: [number, number] | THREE.Vector2;
222
+ viewMatrixInverse?: THREE.Matrix4;
223
+ projectionMatrixInverse?: THREE.Matrix4;
224
+ };
225
+ }
226
+ }
227
+
208
228
  declare module '@react-three/fiber' {
209
229
  interface ThreeElements {
210
230
  portalMaterialImpl: ThreeElements['shaderMaterial'] & {
@@ -292,7 +312,23 @@ type FacemeshApi = {
292
312
  eyeRightRef: React.RefObject<FacemeshEyeApi>;
293
313
  eyeLeftRef: React.RefObject<FacemeshEyeApi>;
294
314
  };
295
- declare const Facemesh: React.ForwardRefExoticComponent<Omit<FacemeshProps, "ref"> & React.RefAttributes<FacemeshApi>>;
315
+ declare const Facemesh: React.ForwardRefExoticComponent<{
316
+ points?: MediaPipePoints;
317
+ face?: MediaPipeFaceMesh;
318
+ width?: number;
319
+ height?: number;
320
+ depth?: number;
321
+ verticalTri?: [number, number, number];
322
+ origin?: number | THREE.Vector3;
323
+ facialTransformationMatrix?: (typeof FacemeshDatas.SAMPLE_FACELANDMARKER_RESULT.facialTransformationMatrixes)[0];
324
+ offset?: boolean;
325
+ offsetScalar?: number;
326
+ faceBlendshapes?: (typeof FacemeshDatas.SAMPLE_FACELANDMARKER_RESULT.faceBlendshapes)[0];
327
+ eyes?: boolean;
328
+ eyesAsOrigin?: boolean;
329
+ debug?: boolean;
330
+ LineComponent?: React.ComponentType<LineProps>;
331
+ } & Omit<_react_three_fiber.Mutable<_react_three_fiber.Overwrite<Partial<_react_three_fiber.Overwrite<THREE.Group<THREE.Object3DEventMap>, _react_three_fiber.MathProps<THREE.Group<THREE.Object3DEventMap>> & _react_three_fiber.ReactProps<THREE.Group<THREE.Object3DEventMap>> & Partial<_react_three_fiber.EventHandlers> & _react_three_fiber.NodeProps<THREE.Group<THREE.Object3DEventMap>>>>, Omit<_react_three_fiber.InstanceProps<THREE.Group<THREE.Object3DEventMap>, typeof THREE.Group>, "object">>>, "ref"> & React.RefAttributes<FacemeshApi>>;
296
332
  type FacemeshEyeProps = {
297
333
  side: 'left' | 'right';
298
334
  debug?: boolean;
@@ -8,7 +8,6 @@ import CameraControlsImpl from 'camera-controls';
8
8
  export { default as CameraControlsImpl } from 'camera-controls';
9
9
  import { easing } from 'maath';
10
10
  import { suspend, clear } from 'suspend-react';
11
- import { Events } from 'hls.js';
12
11
  import { Line2 } from 'three/examples/jsm/lines/Line2.js';
13
12
  import { LineSegments2 } from 'three/examples/jsm/lines/LineSegments2.js';
14
13
  import { LineGeometry } from 'three/examples/jsm/lines/LineGeometry.js';
@@ -271,8 +270,8 @@ function useVideoTexture(srcOrSrcObject, {
271
270
  });
272
271
  if (src && IS_BROWSER && src.endsWith(".m3u8")) {
273
272
  const hls = hlsRef.current = await getHls(hlsConfig);
274
- if (hls) {
275
- hls.on(Events.MEDIA_ATTACHED, () => void hls.loadSource(src));
273
+ if (hls && _HLSModule) {
274
+ hls.on(_HLSModule.Events.MEDIA_ATTACHED, () => void hls.loadSource(src));
276
275
  hls.attachMedia(video2);
277
276
  }
278
277
  }
@@ -4379,7 +4378,7 @@ const FacemeshDatas = {
4379
4378
 
4380
4379
  const FaceLandmarkerContext = /* @__PURE__ */ createContext({});
4381
4380
  const FaceLandmarkerDefaults = {
4382
- basePath: "https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@0.10.17/wasm",
4381
+ basePath: `https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@${"0.10.17"}/wasm`,
4383
4382
  options: {
4384
4383
  baseOptions: {
4385
4384
  modelAssetPath: "https://storage.googleapis.com/mediapipe-models/face_landmarker/face_landmarker/float16/1/face_landmarker.task",