@react-three/fiber 8.8.2 → 8.8.4
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/CHANGELOG.md +12 -0
- package/dist/{index-e6292667.cjs.prod.js → index-0ce5d46e.cjs.prod.js} +86 -88
- package/dist/{index-78501abd.cjs.dev.js → index-21350952.cjs.dev.js} +86 -88
- package/dist/{index-80784ca9.esm.js → index-a415204b.esm.js} +86 -88
- package/dist/react-three-fiber.cjs.dev.js +1 -1
- package/dist/react-three-fiber.cjs.prod.js +1 -1
- package/dist/react-three-fiber.esm.js +2 -2
- package/native/dist/react-three-fiber-native.cjs.dev.js +1 -1
- package/native/dist/react-three-fiber-native.cjs.prod.js +1 -1
- package/native/dist/react-three-fiber-native.esm.js +2 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @react-three/fiber
|
|
2
2
|
|
|
3
|
+
## 8.8.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 2f2dc9f9: chore: upgrade bridge to harden suspense behavior
|
|
8
|
+
|
|
9
|
+
## 8.8.3
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 9f571239: fix #2506, events should fall back to rootstate"
|
|
14
|
+
|
|
3
15
|
## 8.8.2
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -609,113 +609,111 @@ function createEvents(store) {
|
|
|
609
609
|
|
|
610
610
|
|
|
611
611
|
function handleIntersects(intersections, event, delta, callback) {
|
|
612
|
-
// If anything has been found, forward it to the event listeners
|
|
612
|
+
const rootState = store.getState(); // If anything has been found, forward it to the event listeners
|
|
613
|
+
|
|
613
614
|
if (intersections.length) {
|
|
614
615
|
const localState = {
|
|
615
616
|
stopped: false
|
|
616
617
|
};
|
|
617
618
|
|
|
618
619
|
for (const hit of intersections) {
|
|
619
|
-
const state = getRootState(hit.object);
|
|
620
|
+
const state = getRootState(hit.object) || rootState;
|
|
621
|
+
const {
|
|
622
|
+
raycaster,
|
|
623
|
+
pointer,
|
|
624
|
+
camera,
|
|
625
|
+
internal
|
|
626
|
+
} = state;
|
|
627
|
+
const unprojectedPoint = new THREE__namespace.Vector3(pointer.x, pointer.y, 0).unproject(camera);
|
|
620
628
|
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
raycaster,
|
|
624
|
-
pointer,
|
|
625
|
-
camera,
|
|
626
|
-
internal
|
|
627
|
-
} = state;
|
|
628
|
-
const unprojectedPoint = new THREE__namespace.Vector3(pointer.x, pointer.y, 0).unproject(camera);
|
|
629
|
+
const hasPointerCapture = id => {
|
|
630
|
+
var _internal$capturedMap, _internal$capturedMap2;
|
|
629
631
|
|
|
630
|
-
|
|
631
|
-
|
|
632
|
+
return (_internal$capturedMap = (_internal$capturedMap2 = internal.capturedMap.get(id)) == null ? void 0 : _internal$capturedMap2.has(hit.eventObject)) != null ? _internal$capturedMap : false;
|
|
633
|
+
};
|
|
632
634
|
|
|
633
|
-
|
|
635
|
+
const setPointerCapture = id => {
|
|
636
|
+
const captureData = {
|
|
637
|
+
intersection: hit,
|
|
638
|
+
target: event.target
|
|
634
639
|
};
|
|
635
640
|
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
// containing the hitObject, and the hit. hitObject is used for
|
|
649
|
-
// faster access.
|
|
650
|
-
internal.capturedMap.set(id, new Map([[hit.eventObject, captureData]]));
|
|
651
|
-
} // Call the original event now
|
|
652
|
-
event.target.setPointerCapture(id);
|
|
653
|
-
};
|
|
641
|
+
if (internal.capturedMap.has(id)) {
|
|
642
|
+
// if the pointerId was previously captured, we add the hit to the
|
|
643
|
+
// event capturedMap.
|
|
644
|
+
internal.capturedMap.get(id).set(hit.eventObject, captureData);
|
|
645
|
+
} else {
|
|
646
|
+
// if the pointerId was not previously captured, we create a map
|
|
647
|
+
// containing the hitObject, and the hit. hitObject is used for
|
|
648
|
+
// faster access.
|
|
649
|
+
internal.capturedMap.set(id, new Map([[hit.eventObject, captureData]]));
|
|
650
|
+
} // Call the original event now
|
|
651
|
+
event.target.setPointerCapture(id);
|
|
652
|
+
};
|
|
654
653
|
|
|
655
|
-
|
|
656
|
-
|
|
654
|
+
const releasePointerCapture = id => {
|
|
655
|
+
const captures = internal.capturedMap.get(id);
|
|
657
656
|
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
657
|
+
if (captures) {
|
|
658
|
+
releaseInternalPointerCapture(internal.capturedMap, hit.eventObject, captures, id);
|
|
659
|
+
}
|
|
660
|
+
}; // Add native event props
|
|
662
661
|
|
|
663
662
|
|
|
664
|
-
|
|
663
|
+
let extractEventProps = {}; // This iterates over the event's properties including the inherited ones. Native PointerEvents have most of their props as getters which are inherited, but polyfilled PointerEvents have them all as their own properties (i.e. not inherited). We can't use Object.keys() or Object.entries() as they only return "own" properties; nor Object.getPrototypeOf(event) as that *doesn't* return "own" properties, only inherited ones.
|
|
665
664
|
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
665
|
+
for (let prop in event) {
|
|
666
|
+
let property = event[prop]; // Only copy over atomics, leave functions alone as these should be
|
|
667
|
+
// called as event.nativeEvent.fn()
|
|
669
668
|
|
|
670
|
-
|
|
671
|
-
|
|
669
|
+
if (typeof property !== 'function') extractEventProps[prop] = property;
|
|
670
|
+
}
|
|
672
671
|
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
}
|
|
672
|
+
let raycastEvent = { ...hit,
|
|
673
|
+
...extractEventProps,
|
|
674
|
+
pointer,
|
|
675
|
+
intersections,
|
|
676
|
+
stopped: localState.stopped,
|
|
677
|
+
delta,
|
|
678
|
+
unprojectedPoint,
|
|
679
|
+
ray: raycaster.ray,
|
|
680
|
+
camera: camera,
|
|
681
|
+
// Hijack stopPropagation, which just sets a flag
|
|
682
|
+
stopPropagation: () => {
|
|
683
|
+
// https://github.com/pmndrs/react-three-fiber/issues/596
|
|
684
|
+
// Events are not allowed to stop propagation if the pointer has been captured
|
|
685
|
+
const capturesForPointer = 'pointerId' in event && internal.capturedMap.get(event.pointerId); // We only authorize stopPropagation...
|
|
686
|
+
|
|
687
|
+
if ( // ...if this pointer hasn't been captured
|
|
688
|
+
!capturesForPointer || // ... or if the hit object is capturing the pointer
|
|
689
|
+
capturesForPointer.has(hit.eventObject)) {
|
|
690
|
+
raycastEvent.stopped = localState.stopped = true; // Propagation is stopped, remove all other hover records
|
|
691
|
+
// An event handler is only allowed to flush other handlers if it is hovered itself
|
|
692
|
+
|
|
693
|
+
if (internal.hovered.size && Array.from(internal.hovered.values()).find(i => i.eventObject === hit.eventObject)) {
|
|
694
|
+
// Objects cannot flush out higher up objects that have already caught the event
|
|
695
|
+
const higher = intersections.slice(0, intersections.indexOf(hit));
|
|
696
|
+
cancelPointer([...higher, hit]);
|
|
699
697
|
}
|
|
700
|
-
}
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
698
|
+
}
|
|
699
|
+
},
|
|
700
|
+
// there should be a distinction between target and currentTarget
|
|
701
|
+
target: {
|
|
702
|
+
hasPointerCapture,
|
|
703
|
+
setPointerCapture,
|
|
704
|
+
releasePointerCapture
|
|
705
|
+
},
|
|
706
|
+
currentTarget: {
|
|
707
|
+
hasPointerCapture,
|
|
708
|
+
setPointerCapture,
|
|
709
|
+
releasePointerCapture
|
|
710
|
+
},
|
|
711
|
+
nativeEvent: event
|
|
712
|
+
}; // Call subscribers
|
|
713
|
+
|
|
714
|
+
callback(raycastEvent); // Event bubbling may be interrupted by stopPropagation
|
|
715
|
+
|
|
716
|
+
if (localState.stopped === true) break;
|
|
719
717
|
}
|
|
720
718
|
}
|
|
721
719
|
|
|
@@ -609,113 +609,111 @@ function createEvents(store) {
|
|
|
609
609
|
|
|
610
610
|
|
|
611
611
|
function handleIntersects(intersections, event, delta, callback) {
|
|
612
|
-
// If anything has been found, forward it to the event listeners
|
|
612
|
+
const rootState = store.getState(); // If anything has been found, forward it to the event listeners
|
|
613
|
+
|
|
613
614
|
if (intersections.length) {
|
|
614
615
|
const localState = {
|
|
615
616
|
stopped: false
|
|
616
617
|
};
|
|
617
618
|
|
|
618
619
|
for (const hit of intersections) {
|
|
619
|
-
const state = getRootState(hit.object);
|
|
620
|
+
const state = getRootState(hit.object) || rootState;
|
|
621
|
+
const {
|
|
622
|
+
raycaster,
|
|
623
|
+
pointer,
|
|
624
|
+
camera,
|
|
625
|
+
internal
|
|
626
|
+
} = state;
|
|
627
|
+
const unprojectedPoint = new THREE__namespace.Vector3(pointer.x, pointer.y, 0).unproject(camera);
|
|
620
628
|
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
raycaster,
|
|
624
|
-
pointer,
|
|
625
|
-
camera,
|
|
626
|
-
internal
|
|
627
|
-
} = state;
|
|
628
|
-
const unprojectedPoint = new THREE__namespace.Vector3(pointer.x, pointer.y, 0).unproject(camera);
|
|
629
|
+
const hasPointerCapture = id => {
|
|
630
|
+
var _internal$capturedMap, _internal$capturedMap2;
|
|
629
631
|
|
|
630
|
-
|
|
631
|
-
|
|
632
|
+
return (_internal$capturedMap = (_internal$capturedMap2 = internal.capturedMap.get(id)) == null ? void 0 : _internal$capturedMap2.has(hit.eventObject)) != null ? _internal$capturedMap : false;
|
|
633
|
+
};
|
|
632
634
|
|
|
633
|
-
|
|
635
|
+
const setPointerCapture = id => {
|
|
636
|
+
const captureData = {
|
|
637
|
+
intersection: hit,
|
|
638
|
+
target: event.target
|
|
634
639
|
};
|
|
635
640
|
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
// containing the hitObject, and the hit. hitObject is used for
|
|
649
|
-
// faster access.
|
|
650
|
-
internal.capturedMap.set(id, new Map([[hit.eventObject, captureData]]));
|
|
651
|
-
} // Call the original event now
|
|
652
|
-
event.target.setPointerCapture(id);
|
|
653
|
-
};
|
|
641
|
+
if (internal.capturedMap.has(id)) {
|
|
642
|
+
// if the pointerId was previously captured, we add the hit to the
|
|
643
|
+
// event capturedMap.
|
|
644
|
+
internal.capturedMap.get(id).set(hit.eventObject, captureData);
|
|
645
|
+
} else {
|
|
646
|
+
// if the pointerId was not previously captured, we create a map
|
|
647
|
+
// containing the hitObject, and the hit. hitObject is used for
|
|
648
|
+
// faster access.
|
|
649
|
+
internal.capturedMap.set(id, new Map([[hit.eventObject, captureData]]));
|
|
650
|
+
} // Call the original event now
|
|
651
|
+
event.target.setPointerCapture(id);
|
|
652
|
+
};
|
|
654
653
|
|
|
655
|
-
|
|
656
|
-
|
|
654
|
+
const releasePointerCapture = id => {
|
|
655
|
+
const captures = internal.capturedMap.get(id);
|
|
657
656
|
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
657
|
+
if (captures) {
|
|
658
|
+
releaseInternalPointerCapture(internal.capturedMap, hit.eventObject, captures, id);
|
|
659
|
+
}
|
|
660
|
+
}; // Add native event props
|
|
662
661
|
|
|
663
662
|
|
|
664
|
-
|
|
663
|
+
let extractEventProps = {}; // This iterates over the event's properties including the inherited ones. Native PointerEvents have most of their props as getters which are inherited, but polyfilled PointerEvents have them all as their own properties (i.e. not inherited). We can't use Object.keys() or Object.entries() as they only return "own" properties; nor Object.getPrototypeOf(event) as that *doesn't* return "own" properties, only inherited ones.
|
|
665
664
|
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
665
|
+
for (let prop in event) {
|
|
666
|
+
let property = event[prop]; // Only copy over atomics, leave functions alone as these should be
|
|
667
|
+
// called as event.nativeEvent.fn()
|
|
669
668
|
|
|
670
|
-
|
|
671
|
-
|
|
669
|
+
if (typeof property !== 'function') extractEventProps[prop] = property;
|
|
670
|
+
}
|
|
672
671
|
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
}
|
|
672
|
+
let raycastEvent = { ...hit,
|
|
673
|
+
...extractEventProps,
|
|
674
|
+
pointer,
|
|
675
|
+
intersections,
|
|
676
|
+
stopped: localState.stopped,
|
|
677
|
+
delta,
|
|
678
|
+
unprojectedPoint,
|
|
679
|
+
ray: raycaster.ray,
|
|
680
|
+
camera: camera,
|
|
681
|
+
// Hijack stopPropagation, which just sets a flag
|
|
682
|
+
stopPropagation: () => {
|
|
683
|
+
// https://github.com/pmndrs/react-three-fiber/issues/596
|
|
684
|
+
// Events are not allowed to stop propagation if the pointer has been captured
|
|
685
|
+
const capturesForPointer = 'pointerId' in event && internal.capturedMap.get(event.pointerId); // We only authorize stopPropagation...
|
|
686
|
+
|
|
687
|
+
if ( // ...if this pointer hasn't been captured
|
|
688
|
+
!capturesForPointer || // ... or if the hit object is capturing the pointer
|
|
689
|
+
capturesForPointer.has(hit.eventObject)) {
|
|
690
|
+
raycastEvent.stopped = localState.stopped = true; // Propagation is stopped, remove all other hover records
|
|
691
|
+
// An event handler is only allowed to flush other handlers if it is hovered itself
|
|
692
|
+
|
|
693
|
+
if (internal.hovered.size && Array.from(internal.hovered.values()).find(i => i.eventObject === hit.eventObject)) {
|
|
694
|
+
// Objects cannot flush out higher up objects that have already caught the event
|
|
695
|
+
const higher = intersections.slice(0, intersections.indexOf(hit));
|
|
696
|
+
cancelPointer([...higher, hit]);
|
|
699
697
|
}
|
|
700
|
-
}
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
698
|
+
}
|
|
699
|
+
},
|
|
700
|
+
// there should be a distinction between target and currentTarget
|
|
701
|
+
target: {
|
|
702
|
+
hasPointerCapture,
|
|
703
|
+
setPointerCapture,
|
|
704
|
+
releasePointerCapture
|
|
705
|
+
},
|
|
706
|
+
currentTarget: {
|
|
707
|
+
hasPointerCapture,
|
|
708
|
+
setPointerCapture,
|
|
709
|
+
releasePointerCapture
|
|
710
|
+
},
|
|
711
|
+
nativeEvent: event
|
|
712
|
+
}; // Call subscribers
|
|
713
|
+
|
|
714
|
+
callback(raycastEvent); // Event bubbling may be interrupted by stopPropagation
|
|
715
|
+
|
|
716
|
+
if (localState.stopped === true) break;
|
|
719
717
|
}
|
|
720
718
|
}
|
|
721
719
|
|
|
@@ -582,113 +582,111 @@ function createEvents(store) {
|
|
|
582
582
|
|
|
583
583
|
|
|
584
584
|
function handleIntersects(intersections, event, delta, callback) {
|
|
585
|
-
// If anything has been found, forward it to the event listeners
|
|
585
|
+
const rootState = store.getState(); // If anything has been found, forward it to the event listeners
|
|
586
|
+
|
|
586
587
|
if (intersections.length) {
|
|
587
588
|
const localState = {
|
|
588
589
|
stopped: false
|
|
589
590
|
};
|
|
590
591
|
|
|
591
592
|
for (const hit of intersections) {
|
|
592
|
-
const state = getRootState(hit.object);
|
|
593
|
+
const state = getRootState(hit.object) || rootState;
|
|
594
|
+
const {
|
|
595
|
+
raycaster,
|
|
596
|
+
pointer,
|
|
597
|
+
camera,
|
|
598
|
+
internal
|
|
599
|
+
} = state;
|
|
600
|
+
const unprojectedPoint = new THREE.Vector3(pointer.x, pointer.y, 0).unproject(camera);
|
|
593
601
|
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
raycaster,
|
|
597
|
-
pointer,
|
|
598
|
-
camera,
|
|
599
|
-
internal
|
|
600
|
-
} = state;
|
|
601
|
-
const unprojectedPoint = new THREE.Vector3(pointer.x, pointer.y, 0).unproject(camera);
|
|
602
|
+
const hasPointerCapture = id => {
|
|
603
|
+
var _internal$capturedMap, _internal$capturedMap2;
|
|
602
604
|
|
|
603
|
-
|
|
604
|
-
|
|
605
|
+
return (_internal$capturedMap = (_internal$capturedMap2 = internal.capturedMap.get(id)) == null ? void 0 : _internal$capturedMap2.has(hit.eventObject)) != null ? _internal$capturedMap : false;
|
|
606
|
+
};
|
|
605
607
|
|
|
606
|
-
|
|
608
|
+
const setPointerCapture = id => {
|
|
609
|
+
const captureData = {
|
|
610
|
+
intersection: hit,
|
|
611
|
+
target: event.target
|
|
607
612
|
};
|
|
608
613
|
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
// containing the hitObject, and the hit. hitObject is used for
|
|
622
|
-
// faster access.
|
|
623
|
-
internal.capturedMap.set(id, new Map([[hit.eventObject, captureData]]));
|
|
624
|
-
} // Call the original event now
|
|
625
|
-
event.target.setPointerCapture(id);
|
|
626
|
-
};
|
|
614
|
+
if (internal.capturedMap.has(id)) {
|
|
615
|
+
// if the pointerId was previously captured, we add the hit to the
|
|
616
|
+
// event capturedMap.
|
|
617
|
+
internal.capturedMap.get(id).set(hit.eventObject, captureData);
|
|
618
|
+
} else {
|
|
619
|
+
// if the pointerId was not previously captured, we create a map
|
|
620
|
+
// containing the hitObject, and the hit. hitObject is used for
|
|
621
|
+
// faster access.
|
|
622
|
+
internal.capturedMap.set(id, new Map([[hit.eventObject, captureData]]));
|
|
623
|
+
} // Call the original event now
|
|
624
|
+
event.target.setPointerCapture(id);
|
|
625
|
+
};
|
|
627
626
|
|
|
628
|
-
|
|
629
|
-
|
|
627
|
+
const releasePointerCapture = id => {
|
|
628
|
+
const captures = internal.capturedMap.get(id);
|
|
630
629
|
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
630
|
+
if (captures) {
|
|
631
|
+
releaseInternalPointerCapture(internal.capturedMap, hit.eventObject, captures, id);
|
|
632
|
+
}
|
|
633
|
+
}; // Add native event props
|
|
635
634
|
|
|
636
635
|
|
|
637
|
-
|
|
636
|
+
let extractEventProps = {}; // This iterates over the event's properties including the inherited ones. Native PointerEvents have most of their props as getters which are inherited, but polyfilled PointerEvents have them all as their own properties (i.e. not inherited). We can't use Object.keys() or Object.entries() as they only return "own" properties; nor Object.getPrototypeOf(event) as that *doesn't* return "own" properties, only inherited ones.
|
|
638
637
|
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
638
|
+
for (let prop in event) {
|
|
639
|
+
let property = event[prop]; // Only copy over atomics, leave functions alone as these should be
|
|
640
|
+
// called as event.nativeEvent.fn()
|
|
642
641
|
|
|
643
|
-
|
|
644
|
-
|
|
642
|
+
if (typeof property !== 'function') extractEventProps[prop] = property;
|
|
643
|
+
}
|
|
645
644
|
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
}
|
|
645
|
+
let raycastEvent = { ...hit,
|
|
646
|
+
...extractEventProps,
|
|
647
|
+
pointer,
|
|
648
|
+
intersections,
|
|
649
|
+
stopped: localState.stopped,
|
|
650
|
+
delta,
|
|
651
|
+
unprojectedPoint,
|
|
652
|
+
ray: raycaster.ray,
|
|
653
|
+
camera: camera,
|
|
654
|
+
// Hijack stopPropagation, which just sets a flag
|
|
655
|
+
stopPropagation: () => {
|
|
656
|
+
// https://github.com/pmndrs/react-three-fiber/issues/596
|
|
657
|
+
// Events are not allowed to stop propagation if the pointer has been captured
|
|
658
|
+
const capturesForPointer = 'pointerId' in event && internal.capturedMap.get(event.pointerId); // We only authorize stopPropagation...
|
|
659
|
+
|
|
660
|
+
if ( // ...if this pointer hasn't been captured
|
|
661
|
+
!capturesForPointer || // ... or if the hit object is capturing the pointer
|
|
662
|
+
capturesForPointer.has(hit.eventObject)) {
|
|
663
|
+
raycastEvent.stopped = localState.stopped = true; // Propagation is stopped, remove all other hover records
|
|
664
|
+
// An event handler is only allowed to flush other handlers if it is hovered itself
|
|
665
|
+
|
|
666
|
+
if (internal.hovered.size && Array.from(internal.hovered.values()).find(i => i.eventObject === hit.eventObject)) {
|
|
667
|
+
// Objects cannot flush out higher up objects that have already caught the event
|
|
668
|
+
const higher = intersections.slice(0, intersections.indexOf(hit));
|
|
669
|
+
cancelPointer([...higher, hit]);
|
|
672
670
|
}
|
|
673
|
-
}
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
671
|
+
}
|
|
672
|
+
},
|
|
673
|
+
// there should be a distinction between target and currentTarget
|
|
674
|
+
target: {
|
|
675
|
+
hasPointerCapture,
|
|
676
|
+
setPointerCapture,
|
|
677
|
+
releasePointerCapture
|
|
678
|
+
},
|
|
679
|
+
currentTarget: {
|
|
680
|
+
hasPointerCapture,
|
|
681
|
+
setPointerCapture,
|
|
682
|
+
releasePointerCapture
|
|
683
|
+
},
|
|
684
|
+
nativeEvent: event
|
|
685
|
+
}; // Call subscribers
|
|
686
|
+
|
|
687
|
+
callback(raycastEvent); // Event bubbling may be interrupted by stopPropagation
|
|
688
|
+
|
|
689
|
+
if (localState.stopped === true) break;
|
|
692
690
|
}
|
|
693
691
|
}
|
|
694
692
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var index = require('./index-
|
|
5
|
+
var index = require('./index-21350952.cjs.dev.js');
|
|
6
6
|
var _extends = require('@babel/runtime/helpers/extends');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var THREE = require('three');
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var index = require('./index-
|
|
5
|
+
var index = require('./index-0ce5d46e.cjs.prod.js');
|
|
6
6
|
var _extends = require('@babel/runtime/helpers/extends');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var THREE = require('three');
|
|
@@ -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-
|
|
2
|
-
export { t as ReactThreeFiber, v as _roots, s 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 getRootState, l as invalidate, h as reconciler, r as render, d as unmountComponentAtNode, z as useFrame, A as useGraph, w as useInstanceHandle, C as useLoader, x as useStore, y as useThree } from './index-
|
|
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-a415204b.esm.js';
|
|
2
|
+
export { t as ReactThreeFiber, v as _roots, s 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 getRootState, l as invalidate, h as reconciler, r as render, d as unmountComponentAtNode, z as useFrame, A as useGraph, w as useInstanceHandle, C as useLoader, x as useStore, y as useThree } from './index-a415204b.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';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var index = require('../../dist/index-
|
|
5
|
+
var index = require('../../dist/index-21350952.cjs.dev.js');
|
|
6
6
|
var _extends = require('@babel/runtime/helpers/extends');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var THREE = require('three');
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var index = require('../../dist/index-
|
|
5
|
+
var index = require('../../dist/index-0ce5d46e.cjs.prod.js');
|
|
6
6
|
var _extends = require('@babel/runtime/helpers/extends');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var THREE = require('three');
|
|
@@ -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-
|
|
2
|
-
export { t as ReactThreeFiber, v as _roots, s as act, o as addAfterEffect, n as addEffect, p as addTail, m as advance, j as applyProps, f as context, g as createPortal, a as createRoot, k as dispose, e as extend, q as getRootState, l as invalidate, h as reconciler, r as render, d as unmountComponentAtNode, z as useFrame, A as useGraph, w as useInstanceHandle, C as useLoader, x as useStore, y as useThree } from '../../dist/index-
|
|
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-a415204b.esm.js';
|
|
2
|
+
export { t as ReactThreeFiber, v as _roots, s as act, o as addAfterEffect, n as addEffect, p as addTail, m as advance, j as applyProps, f as context, g as createPortal, a as createRoot, k as dispose, e as extend, q as getRootState, l as invalidate, h as reconciler, r as render, d as unmountComponentAtNode, z as useFrame, A as useGraph, w as useInstanceHandle, C as useLoader, x as useStore, y as useThree } from '../../dist/index-a415204b.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';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-three/fiber",
|
|
3
|
-
"version": "8.8.
|
|
3
|
+
"version": "8.8.4",
|
|
4
4
|
"description": "A React renderer for Threejs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@babel/runtime": "^7.17.8",
|
|
46
46
|
"@types/react-reconciler": "^0.26.7",
|
|
47
|
-
"its-fine": "^1.0.
|
|
47
|
+
"its-fine": "^1.0.2",
|
|
48
48
|
"react-reconciler": "^0.27.0",
|
|
49
49
|
"react-use-measure": "^2.1.1",
|
|
50
50
|
"scheduler": "^0.21.0",
|