@react-three/fiber 8.7.1 → 8.7.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/CHANGELOG.md +6 -0
- package/dist/{index-44001bdc.esm.js → index-05f8627d.esm.js} +89 -86
- package/dist/{index-f9709241.cjs.dev.js → index-407f3d70.cjs.dev.js} +89 -86
- package/dist/{index-af0d582a.cjs.prod.js → index-5350eaac.cjs.prod.js} +89 -86
- 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 +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -477,9 +477,7 @@ function removeInteractivity(store, object) {
|
|
|
477
477
|
});
|
|
478
478
|
}
|
|
479
479
|
function createEvents(store) {
|
|
480
|
-
const temp = new THREE.Vector3();
|
|
481
480
|
/** Calculates delta */
|
|
482
|
-
|
|
483
481
|
function calculateDistance(event) {
|
|
484
482
|
const {
|
|
485
483
|
internal
|
|
@@ -579,108 +577,113 @@ function createEvents(store) {
|
|
|
579
577
|
|
|
580
578
|
|
|
581
579
|
function handleIntersects(intersections, event, delta, callback) {
|
|
582
|
-
|
|
583
|
-
raycaster,
|
|
584
|
-
pointer,
|
|
585
|
-
camera,
|
|
586
|
-
internal
|
|
587
|
-
} = store.getState(); // If anything has been found, forward it to the event listeners
|
|
588
|
-
|
|
580
|
+
// If anything has been found, forward it to the event listeners
|
|
589
581
|
if (intersections.length) {
|
|
590
|
-
const unprojectedPoint = temp.set(pointer.x, pointer.y, 0).unproject(camera);
|
|
591
582
|
const localState = {
|
|
592
583
|
stopped: false
|
|
593
584
|
};
|
|
594
585
|
|
|
595
586
|
for (const hit of intersections) {
|
|
596
|
-
const
|
|
597
|
-
var _internal$capturedMap, _internal$capturedMap2;
|
|
587
|
+
const state = getRootState(hit.object);
|
|
598
588
|
|
|
599
|
-
|
|
600
|
-
|
|
589
|
+
if (state) {
|
|
590
|
+
const {
|
|
591
|
+
raycaster,
|
|
592
|
+
pointer,
|
|
593
|
+
camera,
|
|
594
|
+
internal
|
|
595
|
+
} = state;
|
|
596
|
+
const unprojectedPoint = new THREE.Vector3(pointer.x, pointer.y, 0).unproject(camera);
|
|
601
597
|
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
598
|
+
const hasPointerCapture = id => {
|
|
599
|
+
var _internal$capturedMap, _internal$capturedMap2;
|
|
600
|
+
|
|
601
|
+
return (_internal$capturedMap = (_internal$capturedMap2 = internal.capturedMap.get(id)) == null ? void 0 : _internal$capturedMap2.has(hit.eventObject)) != null ? _internal$capturedMap : false;
|
|
606
602
|
};
|
|
607
603
|
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
604
|
+
const setPointerCapture = id => {
|
|
605
|
+
const captureData = {
|
|
606
|
+
intersection: hit,
|
|
607
|
+
target: event.target
|
|
608
|
+
};
|
|
609
|
+
|
|
610
|
+
if (internal.capturedMap.has(id)) {
|
|
611
|
+
// if the pointerId was previously captured, we add the hit to the
|
|
612
|
+
// event capturedMap.
|
|
613
|
+
internal.capturedMap.get(id).set(hit.eventObject, captureData);
|
|
614
|
+
} else {
|
|
615
|
+
// if the pointerId was not previously captured, we create a map
|
|
616
|
+
// containing the hitObject, and the hit. hitObject is used for
|
|
617
|
+
// faster access.
|
|
618
|
+
internal.capturedMap.set(id, new Map([[hit.eventObject, captureData]]));
|
|
619
|
+
} // Call the original event now
|
|
620
|
+
event.target.setPointerCapture(id);
|
|
621
|
+
};
|
|
620
622
|
|
|
621
|
-
|
|
622
|
-
|
|
623
|
+
const releasePointerCapture = id => {
|
|
624
|
+
const captures = internal.capturedMap.get(id);
|
|
623
625
|
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
626
|
+
if (captures) {
|
|
627
|
+
releaseInternalPointerCapture(internal.capturedMap, hit.eventObject, captures, id);
|
|
628
|
+
}
|
|
629
|
+
}; // Add native event props
|
|
628
630
|
|
|
629
631
|
|
|
630
|
-
|
|
632
|
+
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.
|
|
631
633
|
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
634
|
+
for (let prop in event) {
|
|
635
|
+
let property = event[prop]; // Only copy over atomics, leave functions alone as these should be
|
|
636
|
+
// called as event.nativeEvent.fn()
|
|
635
637
|
|
|
636
|
-
|
|
637
|
-
|
|
638
|
+
if (typeof property !== 'function') extractEventProps[prop] = property;
|
|
639
|
+
}
|
|
638
640
|
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
641
|
+
let raycastEvent = { ...hit,
|
|
642
|
+
...extractEventProps,
|
|
643
|
+
pointer,
|
|
644
|
+
intersections,
|
|
645
|
+
stopped: localState.stopped,
|
|
646
|
+
delta,
|
|
647
|
+
unprojectedPoint,
|
|
648
|
+
ray: raycaster.ray,
|
|
649
|
+
camera: camera,
|
|
650
|
+
// Hijack stopPropagation, which just sets a flag
|
|
651
|
+
stopPropagation: () => {
|
|
652
|
+
// https://github.com/pmndrs/react-three-fiber/issues/596
|
|
653
|
+
// Events are not allowed to stop propagation if the pointer has been captured
|
|
654
|
+
const capturesForPointer = 'pointerId' in event && internal.capturedMap.get(event.pointerId); // We only authorize stopPropagation...
|
|
655
|
+
|
|
656
|
+
if ( // ...if this pointer hasn't been captured
|
|
657
|
+
!capturesForPointer || // ... or if the hit object is capturing the pointer
|
|
658
|
+
capturesForPointer.has(hit.eventObject)) {
|
|
659
|
+
raycastEvent.stopped = localState.stopped = true; // Propagation is stopped, remove all other hover records
|
|
660
|
+
// An event handler is only allowed to flush other handlers if it is hovered itself
|
|
661
|
+
|
|
662
|
+
if (internal.hovered.size && Array.from(internal.hovered.values()).find(i => i.eventObject === hit.eventObject)) {
|
|
663
|
+
// Objects cannot flush out higher up objects that have already caught the event
|
|
664
|
+
const higher = intersections.slice(0, intersections.indexOf(hit));
|
|
665
|
+
cancelPointer([...higher, hit]);
|
|
666
|
+
}
|
|
664
667
|
}
|
|
665
|
-
}
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
668
|
+
},
|
|
669
|
+
// there should be a distinction between target and currentTarget
|
|
670
|
+
target: {
|
|
671
|
+
hasPointerCapture,
|
|
672
|
+
setPointerCapture,
|
|
673
|
+
releasePointerCapture
|
|
674
|
+
},
|
|
675
|
+
currentTarget: {
|
|
676
|
+
hasPointerCapture,
|
|
677
|
+
setPointerCapture,
|
|
678
|
+
releasePointerCapture
|
|
679
|
+
},
|
|
680
|
+
nativeEvent: event
|
|
681
|
+
}; // Call subscribers
|
|
682
|
+
|
|
683
|
+
callback(raycastEvent); // Event bubbling may be interrupted by stopPropagation
|
|
684
|
+
|
|
685
|
+
if (localState.stopped === true) break;
|
|
686
|
+
}
|
|
684
687
|
}
|
|
685
688
|
}
|
|
686
689
|
|
|
@@ -504,9 +504,7 @@ function removeInteractivity(store, object) {
|
|
|
504
504
|
});
|
|
505
505
|
}
|
|
506
506
|
function createEvents(store) {
|
|
507
|
-
const temp = new THREE__namespace.Vector3();
|
|
508
507
|
/** Calculates delta */
|
|
509
|
-
|
|
510
508
|
function calculateDistance(event) {
|
|
511
509
|
const {
|
|
512
510
|
internal
|
|
@@ -606,108 +604,113 @@ function createEvents(store) {
|
|
|
606
604
|
|
|
607
605
|
|
|
608
606
|
function handleIntersects(intersections, event, delta, callback) {
|
|
609
|
-
|
|
610
|
-
raycaster,
|
|
611
|
-
pointer,
|
|
612
|
-
camera,
|
|
613
|
-
internal
|
|
614
|
-
} = store.getState(); // If anything has been found, forward it to the event listeners
|
|
615
|
-
|
|
607
|
+
// If anything has been found, forward it to the event listeners
|
|
616
608
|
if (intersections.length) {
|
|
617
|
-
const unprojectedPoint = temp.set(pointer.x, pointer.y, 0).unproject(camera);
|
|
618
609
|
const localState = {
|
|
619
610
|
stopped: false
|
|
620
611
|
};
|
|
621
612
|
|
|
622
613
|
for (const hit of intersections) {
|
|
623
|
-
const
|
|
624
|
-
var _internal$capturedMap, _internal$capturedMap2;
|
|
614
|
+
const state = getRootState(hit.object);
|
|
625
615
|
|
|
626
|
-
|
|
627
|
-
|
|
616
|
+
if (state) {
|
|
617
|
+
const {
|
|
618
|
+
raycaster,
|
|
619
|
+
pointer,
|
|
620
|
+
camera,
|
|
621
|
+
internal
|
|
622
|
+
} = state;
|
|
623
|
+
const unprojectedPoint = new THREE__namespace.Vector3(pointer.x, pointer.y, 0).unproject(camera);
|
|
628
624
|
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
625
|
+
const hasPointerCapture = id => {
|
|
626
|
+
var _internal$capturedMap, _internal$capturedMap2;
|
|
627
|
+
|
|
628
|
+
return (_internal$capturedMap = (_internal$capturedMap2 = internal.capturedMap.get(id)) == null ? void 0 : _internal$capturedMap2.has(hit.eventObject)) != null ? _internal$capturedMap : false;
|
|
633
629
|
};
|
|
634
630
|
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
631
|
+
const setPointerCapture = id => {
|
|
632
|
+
const captureData = {
|
|
633
|
+
intersection: hit,
|
|
634
|
+
target: event.target
|
|
635
|
+
};
|
|
636
|
+
|
|
637
|
+
if (internal.capturedMap.has(id)) {
|
|
638
|
+
// if the pointerId was previously captured, we add the hit to the
|
|
639
|
+
// event capturedMap.
|
|
640
|
+
internal.capturedMap.get(id).set(hit.eventObject, captureData);
|
|
641
|
+
} else {
|
|
642
|
+
// if the pointerId was not previously captured, we create a map
|
|
643
|
+
// containing the hitObject, and the hit. hitObject is used for
|
|
644
|
+
// faster access.
|
|
645
|
+
internal.capturedMap.set(id, new Map([[hit.eventObject, captureData]]));
|
|
646
|
+
} // Call the original event now
|
|
647
|
+
event.target.setPointerCapture(id);
|
|
648
|
+
};
|
|
647
649
|
|
|
648
|
-
|
|
649
|
-
|
|
650
|
+
const releasePointerCapture = id => {
|
|
651
|
+
const captures = internal.capturedMap.get(id);
|
|
650
652
|
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
653
|
+
if (captures) {
|
|
654
|
+
releaseInternalPointerCapture(internal.capturedMap, hit.eventObject, captures, id);
|
|
655
|
+
}
|
|
656
|
+
}; // Add native event props
|
|
655
657
|
|
|
656
658
|
|
|
657
|
-
|
|
659
|
+
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.
|
|
658
660
|
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
661
|
+
for (let prop in event) {
|
|
662
|
+
let property = event[prop]; // Only copy over atomics, leave functions alone as these should be
|
|
663
|
+
// called as event.nativeEvent.fn()
|
|
662
664
|
|
|
663
|
-
|
|
664
|
-
|
|
665
|
+
if (typeof property !== 'function') extractEventProps[prop] = property;
|
|
666
|
+
}
|
|
665
667
|
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
668
|
+
let raycastEvent = { ...hit,
|
|
669
|
+
...extractEventProps,
|
|
670
|
+
pointer,
|
|
671
|
+
intersections,
|
|
672
|
+
stopped: localState.stopped,
|
|
673
|
+
delta,
|
|
674
|
+
unprojectedPoint,
|
|
675
|
+
ray: raycaster.ray,
|
|
676
|
+
camera: camera,
|
|
677
|
+
// Hijack stopPropagation, which just sets a flag
|
|
678
|
+
stopPropagation: () => {
|
|
679
|
+
// https://github.com/pmndrs/react-three-fiber/issues/596
|
|
680
|
+
// Events are not allowed to stop propagation if the pointer has been captured
|
|
681
|
+
const capturesForPointer = 'pointerId' in event && internal.capturedMap.get(event.pointerId); // We only authorize stopPropagation...
|
|
682
|
+
|
|
683
|
+
if ( // ...if this pointer hasn't been captured
|
|
684
|
+
!capturesForPointer || // ... or if the hit object is capturing the pointer
|
|
685
|
+
capturesForPointer.has(hit.eventObject)) {
|
|
686
|
+
raycastEvent.stopped = localState.stopped = true; // Propagation is stopped, remove all other hover records
|
|
687
|
+
// An event handler is only allowed to flush other handlers if it is hovered itself
|
|
688
|
+
|
|
689
|
+
if (internal.hovered.size && Array.from(internal.hovered.values()).find(i => i.eventObject === hit.eventObject)) {
|
|
690
|
+
// Objects cannot flush out higher up objects that have already caught the event
|
|
691
|
+
const higher = intersections.slice(0, intersections.indexOf(hit));
|
|
692
|
+
cancelPointer([...higher, hit]);
|
|
693
|
+
}
|
|
691
694
|
}
|
|
692
|
-
}
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
695
|
+
},
|
|
696
|
+
// there should be a distinction between target and currentTarget
|
|
697
|
+
target: {
|
|
698
|
+
hasPointerCapture,
|
|
699
|
+
setPointerCapture,
|
|
700
|
+
releasePointerCapture
|
|
701
|
+
},
|
|
702
|
+
currentTarget: {
|
|
703
|
+
hasPointerCapture,
|
|
704
|
+
setPointerCapture,
|
|
705
|
+
releasePointerCapture
|
|
706
|
+
},
|
|
707
|
+
nativeEvent: event
|
|
708
|
+
}; // Call subscribers
|
|
709
|
+
|
|
710
|
+
callback(raycastEvent); // Event bubbling may be interrupted by stopPropagation
|
|
711
|
+
|
|
712
|
+
if (localState.stopped === true) break;
|
|
713
|
+
}
|
|
711
714
|
}
|
|
712
715
|
}
|
|
713
716
|
|
|
@@ -504,9 +504,7 @@ function removeInteractivity(store, object) {
|
|
|
504
504
|
});
|
|
505
505
|
}
|
|
506
506
|
function createEvents(store) {
|
|
507
|
-
const temp = new THREE__namespace.Vector3();
|
|
508
507
|
/** Calculates delta */
|
|
509
|
-
|
|
510
508
|
function calculateDistance(event) {
|
|
511
509
|
const {
|
|
512
510
|
internal
|
|
@@ -606,108 +604,113 @@ function createEvents(store) {
|
|
|
606
604
|
|
|
607
605
|
|
|
608
606
|
function handleIntersects(intersections, event, delta, callback) {
|
|
609
|
-
|
|
610
|
-
raycaster,
|
|
611
|
-
pointer,
|
|
612
|
-
camera,
|
|
613
|
-
internal
|
|
614
|
-
} = store.getState(); // If anything has been found, forward it to the event listeners
|
|
615
|
-
|
|
607
|
+
// If anything has been found, forward it to the event listeners
|
|
616
608
|
if (intersections.length) {
|
|
617
|
-
const unprojectedPoint = temp.set(pointer.x, pointer.y, 0).unproject(camera);
|
|
618
609
|
const localState = {
|
|
619
610
|
stopped: false
|
|
620
611
|
};
|
|
621
612
|
|
|
622
613
|
for (const hit of intersections) {
|
|
623
|
-
const
|
|
624
|
-
var _internal$capturedMap, _internal$capturedMap2;
|
|
614
|
+
const state = getRootState(hit.object);
|
|
625
615
|
|
|
626
|
-
|
|
627
|
-
|
|
616
|
+
if (state) {
|
|
617
|
+
const {
|
|
618
|
+
raycaster,
|
|
619
|
+
pointer,
|
|
620
|
+
camera,
|
|
621
|
+
internal
|
|
622
|
+
} = state;
|
|
623
|
+
const unprojectedPoint = new THREE__namespace.Vector3(pointer.x, pointer.y, 0).unproject(camera);
|
|
628
624
|
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
625
|
+
const hasPointerCapture = id => {
|
|
626
|
+
var _internal$capturedMap, _internal$capturedMap2;
|
|
627
|
+
|
|
628
|
+
return (_internal$capturedMap = (_internal$capturedMap2 = internal.capturedMap.get(id)) == null ? void 0 : _internal$capturedMap2.has(hit.eventObject)) != null ? _internal$capturedMap : false;
|
|
633
629
|
};
|
|
634
630
|
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
631
|
+
const setPointerCapture = id => {
|
|
632
|
+
const captureData = {
|
|
633
|
+
intersection: hit,
|
|
634
|
+
target: event.target
|
|
635
|
+
};
|
|
636
|
+
|
|
637
|
+
if (internal.capturedMap.has(id)) {
|
|
638
|
+
// if the pointerId was previously captured, we add the hit to the
|
|
639
|
+
// event capturedMap.
|
|
640
|
+
internal.capturedMap.get(id).set(hit.eventObject, captureData);
|
|
641
|
+
} else {
|
|
642
|
+
// if the pointerId was not previously captured, we create a map
|
|
643
|
+
// containing the hitObject, and the hit. hitObject is used for
|
|
644
|
+
// faster access.
|
|
645
|
+
internal.capturedMap.set(id, new Map([[hit.eventObject, captureData]]));
|
|
646
|
+
} // Call the original event now
|
|
647
|
+
event.target.setPointerCapture(id);
|
|
648
|
+
};
|
|
647
649
|
|
|
648
|
-
|
|
649
|
-
|
|
650
|
+
const releasePointerCapture = id => {
|
|
651
|
+
const captures = internal.capturedMap.get(id);
|
|
650
652
|
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
653
|
+
if (captures) {
|
|
654
|
+
releaseInternalPointerCapture(internal.capturedMap, hit.eventObject, captures, id);
|
|
655
|
+
}
|
|
656
|
+
}; // Add native event props
|
|
655
657
|
|
|
656
658
|
|
|
657
|
-
|
|
659
|
+
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.
|
|
658
660
|
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
661
|
+
for (let prop in event) {
|
|
662
|
+
let property = event[prop]; // Only copy over atomics, leave functions alone as these should be
|
|
663
|
+
// called as event.nativeEvent.fn()
|
|
662
664
|
|
|
663
|
-
|
|
664
|
-
|
|
665
|
+
if (typeof property !== 'function') extractEventProps[prop] = property;
|
|
666
|
+
}
|
|
665
667
|
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
668
|
+
let raycastEvent = { ...hit,
|
|
669
|
+
...extractEventProps,
|
|
670
|
+
pointer,
|
|
671
|
+
intersections,
|
|
672
|
+
stopped: localState.stopped,
|
|
673
|
+
delta,
|
|
674
|
+
unprojectedPoint,
|
|
675
|
+
ray: raycaster.ray,
|
|
676
|
+
camera: camera,
|
|
677
|
+
// Hijack stopPropagation, which just sets a flag
|
|
678
|
+
stopPropagation: () => {
|
|
679
|
+
// https://github.com/pmndrs/react-three-fiber/issues/596
|
|
680
|
+
// Events are not allowed to stop propagation if the pointer has been captured
|
|
681
|
+
const capturesForPointer = 'pointerId' in event && internal.capturedMap.get(event.pointerId); // We only authorize stopPropagation...
|
|
682
|
+
|
|
683
|
+
if ( // ...if this pointer hasn't been captured
|
|
684
|
+
!capturesForPointer || // ... or if the hit object is capturing the pointer
|
|
685
|
+
capturesForPointer.has(hit.eventObject)) {
|
|
686
|
+
raycastEvent.stopped = localState.stopped = true; // Propagation is stopped, remove all other hover records
|
|
687
|
+
// An event handler is only allowed to flush other handlers if it is hovered itself
|
|
688
|
+
|
|
689
|
+
if (internal.hovered.size && Array.from(internal.hovered.values()).find(i => i.eventObject === hit.eventObject)) {
|
|
690
|
+
// Objects cannot flush out higher up objects that have already caught the event
|
|
691
|
+
const higher = intersections.slice(0, intersections.indexOf(hit));
|
|
692
|
+
cancelPointer([...higher, hit]);
|
|
693
|
+
}
|
|
691
694
|
}
|
|
692
|
-
}
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
695
|
+
},
|
|
696
|
+
// there should be a distinction between target and currentTarget
|
|
697
|
+
target: {
|
|
698
|
+
hasPointerCapture,
|
|
699
|
+
setPointerCapture,
|
|
700
|
+
releasePointerCapture
|
|
701
|
+
},
|
|
702
|
+
currentTarget: {
|
|
703
|
+
hasPointerCapture,
|
|
704
|
+
setPointerCapture,
|
|
705
|
+
releasePointerCapture
|
|
706
|
+
},
|
|
707
|
+
nativeEvent: event
|
|
708
|
+
}; // Call subscribers
|
|
709
|
+
|
|
710
|
+
callback(raycastEvent); // Event bubbling may be interrupted by stopPropagation
|
|
711
|
+
|
|
712
|
+
if (localState.stopped === true) break;
|
|
713
|
+
}
|
|
711
714
|
}
|
|
712
715
|
}
|
|
713
716
|
|
|
@@ -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-407f3d70.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-5350eaac.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-05f8627d.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-05f8627d.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-407f3d70.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-5350eaac.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-05f8627d.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-05f8627d.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';
|