@react-three/fiber 8.10.3 → 8.11.0

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.
@@ -1,11 +1,11 @@
1
- import * as React from 'react';
2
- import type { Options as ResizeOptions } from 'react-use-measure';
3
- import { RenderProps } from '../core';
4
- export interface Props extends Omit<RenderProps<HTMLCanvasElement>, 'size'>, React.HTMLAttributes<HTMLDivElement> {
5
- children: React.ReactNode;
6
- fallback?: React.ReactNode;
7
- resize?: ResizeOptions;
8
- eventSource?: HTMLElement | React.MutableRefObject<HTMLElement>;
9
- eventPrefix?: 'offset' | 'client' | 'page' | 'layer' | 'screen';
10
- }
11
- export declare const Canvas: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLCanvasElement>>;
1
+ import * as React from 'react';
2
+ import type { Options as ResizeOptions } from 'react-use-measure';
3
+ import { RenderProps } from '../core';
4
+ export interface Props extends Omit<RenderProps<HTMLCanvasElement>, 'size'>, React.HTMLAttributes<HTMLDivElement> {
5
+ children: React.ReactNode;
6
+ fallback?: React.ReactNode;
7
+ resize?: ResizeOptions;
8
+ eventSource?: HTMLElement | React.MutableRefObject<HTMLElement>;
9
+ eventPrefix?: 'offset' | 'client' | 'page' | 'layer' | 'screen';
10
+ }
11
+ export declare const Canvas: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLCanvasElement>>;
@@ -1,4 +1,4 @@
1
- import { UseBoundStore } from 'zustand';
2
- import { RootState } from '../core/store';
3
- import { EventManager } from '../core/events';
4
- export declare function createPointerEvents(store: UseBoundStore<RootState>): EventManager<HTMLElement>;
1
+ import { UseBoundStore } from 'zustand';
2
+ import { RootState } from '../core/store';
3
+ import { EventManager } from '../core/events';
4
+ export declare function createPointerEvents(store: UseBoundStore<RootState>): EventManager<HTMLElement>;
@@ -66,15 +66,12 @@ function Block({
66
66
  return null;
67
67
  }
68
68
  class ErrorBoundary extends React__namespace.Component {
69
- constructor(props) {
70
- super(props);
69
+ constructor(...args) {
70
+ super(...args);
71
71
  this.state = {
72
72
  error: false
73
73
  };
74
74
  }
75
- static getDerivedStateFromError = () => ({
76
- error: true
77
- });
78
75
  componentDidCatch(err) {
79
76
  this.props.set(err);
80
77
  }
@@ -82,6 +79,9 @@ class ErrorBoundary extends React__namespace.Component {
82
79
  return this.state.error ? null : this.props.children;
83
80
  }
84
81
  }
82
+ ErrorBoundary.getDerivedStateFromError = () => ({
83
+ error: true
84
+ });
85
85
  const DEFAULT = '__default';
86
86
  const isDiffSet = def => def && !!def.memoized && !!def.changes;
87
87
  function calculateDpr(dpr) {
@@ -66,15 +66,12 @@ function Block({
66
66
  return null;
67
67
  }
68
68
  class ErrorBoundary extends React__namespace.Component {
69
- constructor(props) {
70
- super(props);
69
+ constructor(...args) {
70
+ super(...args);
71
71
  this.state = {
72
72
  error: false
73
73
  };
74
74
  }
75
- static getDerivedStateFromError = () => ({
76
- error: true
77
- });
78
75
  componentDidCatch(err) {
79
76
  this.props.set(err);
80
77
  }
@@ -82,6 +79,9 @@ class ErrorBoundary extends React__namespace.Component {
82
79
  return this.state.error ? null : this.props.children;
83
80
  }
84
81
  }
82
+ ErrorBoundary.getDerivedStateFromError = () => ({
83
+ error: true
84
+ });
85
85
  const DEFAULT = '__default';
86
86
  const isDiffSet = def => def && !!def.memoized && !!def.changes;
87
87
  function calculateDpr(dpr) {
@@ -39,15 +39,12 @@ function Block({
39
39
  return null;
40
40
  }
41
41
  class ErrorBoundary extends React.Component {
42
- constructor(props) {
43
- super(props);
42
+ constructor(...args) {
43
+ super(...args);
44
44
  this.state = {
45
45
  error: false
46
46
  };
47
47
  }
48
- static getDerivedStateFromError = () => ({
49
- error: true
50
- });
51
48
  componentDidCatch(err) {
52
49
  this.props.set(err);
53
50
  }
@@ -55,6 +52,9 @@ class ErrorBoundary extends React.Component {
55
52
  return this.state.error ? null : this.props.children;
56
53
  }
57
54
  }
55
+ ErrorBoundary.getDerivedStateFromError = () => ({
56
+ error: true
57
+ });
58
58
  const DEFAULT = '__default';
59
59
  const isDiffSet = def => def && !!def.memoized && !!def.changes;
60
60
  function calculateDpr(dpr) {
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var index = require('./index-dff4d2eb.cjs.dev.js');
5
+ var index = require('./index-6442a2a3.cjs.dev.js');
6
6
  var _extends = require('@babel/runtime/helpers/extends');
7
7
  var React = require('react');
8
8
  var THREE = require('three');
@@ -70,6 +70,14 @@ function createPointerEvents(store) {
70
70
  ...acc,
71
71
  [key]: handlePointer(key)
72
72
  }), {}),
73
+ update: () => {
74
+ var _internal$lastEvent;
75
+ const {
76
+ events,
77
+ internal
78
+ } = store.getState();
79
+ if ((_internal$lastEvent = internal.lastEvent) != null && _internal$lastEvent.current && events.handlers) events.handlers.onPointerMove(internal.lastEvent.current);
80
+ },
73
81
  connect: target => {
74
82
  var _events$handlers;
75
83
  const {
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var index = require('./index-6e3ece64.cjs.prod.js');
5
+ var index = require('./index-455b51ca.cjs.prod.js');
6
6
  var _extends = require('@babel/runtime/helpers/extends');
7
7
  var React = require('react');
8
8
  var THREE = require('three');
@@ -70,6 +70,14 @@ function createPointerEvents(store) {
70
70
  ...acc,
71
71
  [key]: handlePointer(key)
72
72
  }), {}),
73
+ update: () => {
74
+ var _internal$lastEvent;
75
+ const {
76
+ events,
77
+ internal
78
+ } = store.getState();
79
+ if ((_internal$lastEvent = internal.lastEvent) != null && _internal$lastEvent.current && events.handlers) events.handlers.onPointerMove(internal.lastEvent.current);
80
+ },
73
81
  connect: target => {
74
82
  var _events$handlers;
75
83
  const {
@@ -1,5 +1,5 @@
1
- import { c as createEvents, e as extend, u as useMutableCallback, a as createRoot, i as isRef, E as ErrorBoundary, B as Block, b as useIsomorphicLayoutEffect, d as unmountComponentAtNode } from './index-291d12f4.esm.js';
2
- export { t as ReactThreeFiber, w as _roots, v as act, o as addAfterEffect, n as addEffect, p as addTail, m as advance, j as applyProps, f as context, c as createEvents, g as createPortal, a as createRoot, k as dispose, e as extend, q as flushGlobalEffects, s as getRootState, l as invalidate, h as reconciler, r as render, d as unmountComponentAtNode, A as useFrame, C as useGraph, x as useInstanceHandle, D as useLoader, y as useStore, z as useThree } from './index-291d12f4.esm.js';
1
+ import { c as createEvents, e as extend, u as useMutableCallback, a as createRoot, i as isRef, E as ErrorBoundary, B as Block, b as useIsomorphicLayoutEffect, d as unmountComponentAtNode } from './index-7dbf758c.esm.js';
2
+ export { t as ReactThreeFiber, w as _roots, v as act, o as addAfterEffect, n as addEffect, p as addTail, m as advance, j as applyProps, f as context, c as createEvents, g as createPortal, a as createRoot, k as dispose, e as extend, q as flushGlobalEffects, s as getRootState, l as invalidate, h as reconciler, r as render, d as unmountComponentAtNode, A as useFrame, C as useGraph, x as useInstanceHandle, D as useLoader, y as useStore, z as useThree } from './index-7dbf758c.esm.js';
3
3
  import _extends from '@babel/runtime/helpers/esm/extends';
4
4
  import * as React from 'react';
5
5
  import * as THREE from 'three';
@@ -43,6 +43,14 @@ function createPointerEvents(store) {
43
43
  ...acc,
44
44
  [key]: handlePointer(key)
45
45
  }), {}),
46
+ update: () => {
47
+ var _internal$lastEvent;
48
+ const {
49
+ events,
50
+ internal
51
+ } = store.getState();
52
+ if ((_internal$lastEvent = internal.lastEvent) != null && _internal$lastEvent.current && events.handlers) events.handlers.onPointerMove(internal.lastEvent.current);
53
+ },
46
54
  connect: target => {
47
55
  var _events$handlers;
48
56
  const {
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var index = require('../../dist/index-dff4d2eb.cjs.dev.js');
5
+ var index = require('../../dist/index-6442a2a3.cjs.dev.js');
6
6
  var _extends = require('@babel/runtime/helpers/extends');
7
7
  var React = require('react');
8
8
  var THREE = require('three');
@@ -92,6 +92,14 @@ function createTouchEvents(store) {
92
92
  ...acc,
93
93
  [name]: event => handleTouch(event, name)
94
94
  }), {}),
95
+ update: () => {
96
+ var _internal$lastEvent;
97
+ const {
98
+ events,
99
+ internal
100
+ } = store.getState();
101
+ if ((_internal$lastEvent = internal.lastEvent) != null && _internal$lastEvent.current && events.handlers) events.handlers.onPointerMove(internal.lastEvent.current);
102
+ },
95
103
  connect: () => {
96
104
  const {
97
105
  set,
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var index = require('../../dist/index-6e3ece64.cjs.prod.js');
5
+ var index = require('../../dist/index-455b51ca.cjs.prod.js');
6
6
  var _extends = require('@babel/runtime/helpers/extends');
7
7
  var React = require('react');
8
8
  var THREE = require('three');
@@ -92,6 +92,14 @@ function createTouchEvents(store) {
92
92
  ...acc,
93
93
  [name]: event => handleTouch(event, name)
94
94
  }), {}),
95
+ update: () => {
96
+ var _internal$lastEvent;
97
+ const {
98
+ events,
99
+ internal
100
+ } = store.getState();
101
+ if ((_internal$lastEvent = internal.lastEvent) != null && _internal$lastEvent.current && events.handlers) events.handlers.onPointerMove(internal.lastEvent.current);
102
+ },
95
103
  connect: () => {
96
104
  const {
97
105
  set,
@@ -1,5 +1,5 @@
1
- import { c as createEvents, e as extend, u as useMutableCallback, a as createRoot, E as ErrorBoundary, B as Block, d as unmountComponentAtNode } from '../../dist/index-291d12f4.esm.js';
2
- export { t as ReactThreeFiber, w as _roots, v as act, o as addAfterEffect, n as addEffect, p as addTail, m as advance, j as applyProps, f as context, c as createEvents, g as createPortal, a as createRoot, k as dispose, e as extend, q as flushGlobalEffects, s as getRootState, l as invalidate, h as reconciler, r as render, d as unmountComponentAtNode, A as useFrame, C as useGraph, x as useInstanceHandle, D as useLoader, y as useStore, z as useThree } from '../../dist/index-291d12f4.esm.js';
1
+ import { c as createEvents, e as extend, u as useMutableCallback, a as createRoot, E as ErrorBoundary, B as Block, d as unmountComponentAtNode } from '../../dist/index-7dbf758c.esm.js';
2
+ export { t as ReactThreeFiber, w as _roots, v as act, o as addAfterEffect, n as addEffect, p as addTail, m as advance, j as applyProps, f as context, c as createEvents, g as createPortal, a as createRoot, k as dispose, e as extend, q as flushGlobalEffects, s as getRootState, l as invalidate, h as reconciler, r as render, d as unmountComponentAtNode, A as useFrame, C as useGraph, x as useInstanceHandle, D as useLoader, y as useStore, z as useThree } from '../../dist/index-7dbf758c.esm.js';
3
3
  import _extends from '@babel/runtime/helpers/esm/extends';
4
4
  import * as React from 'react';
5
5
  import * as THREE from 'three';
@@ -65,6 +65,14 @@ function createTouchEvents(store) {
65
65
  ...acc,
66
66
  [name]: event => handleTouch(event, name)
67
67
  }), {}),
68
+ update: () => {
69
+ var _internal$lastEvent;
70
+ const {
71
+ events,
72
+ internal
73
+ } = store.getState();
74
+ if ((_internal$lastEvent = internal.lastEvent) != null && _internal$lastEvent.current && events.handlers) events.handlers.onPointerMove(internal.lastEvent.current);
75
+ },
68
76
  connect: () => {
69
77
  const {
70
78
  set,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-three/fiber",
3
- "version": "8.10.3",
3
+ "version": "8.11.0",
4
4
  "description": "A React renderer for Threejs",
5
5
  "keywords": [
6
6
  "react",