@ntalmagor/3drize-viewer 0.1.10 → 0.1.12
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/dist/components/AnimatedObject.d.ts +1 -1
- package/dist/components/AnimatedObject.d.ts.map +1 -1
- package/dist/components/AnimatedObject.js +11 -6
- package/dist/components/CameraController.js +4 -4
- package/dist/components/Clouds.js +2 -2
- package/dist/components/CreatedObject.d.ts +2 -0
- package/dist/components/CreatedObject.d.ts.map +1 -1
- package/dist/components/CreatedObject.js +13 -32
- package/dist/components/CustomPrimitive.d.ts +2 -0
- package/dist/components/CustomPrimitive.d.ts.map +1 -1
- package/dist/components/CustomPrimitive.js +6 -8
- package/dist/components/EffectsGenerator.js +19 -19
- package/dist/components/EffectsGroup.js +1 -1
- package/dist/components/EnvironmentManager.js +2 -2
- package/dist/components/Frame.d.ts +3 -3
- package/dist/components/Frame.d.ts.map +1 -1
- package/dist/components/Frame.js +11 -9
- package/dist/components/FrameImage.js +1 -1
- package/dist/components/Galaxy.js +2 -2
- package/dist/components/GalleryLayout.d.ts +3 -1
- package/dist/components/GalleryLayout.d.ts.map +1 -1
- package/dist/components/GalleryLayout.js +5 -5
- package/dist/components/Lensflare.js +1 -1
- package/dist/components/Letter.js +2 -2
- package/dist/components/Letters.js +1 -1
- package/dist/components/LightsManager.js +2 -2
- package/dist/components/Lines.js +1 -1
- package/dist/components/ObjectNode.d.ts +2 -0
- package/dist/components/ObjectNode.d.ts.map +1 -1
- package/dist/components/ObjectNode.js +39 -39
- package/dist/components/ObjectsRenderer.d.ts +3 -0
- package/dist/components/ObjectsRenderer.d.ts.map +1 -1
- package/dist/components/ObjectsRenderer.js +3 -3
- package/dist/components/ObjectsRendererApi.d.ts +31 -0
- package/dist/components/ObjectsRendererApi.d.ts.map +1 -0
- package/dist/components/ObjectsRendererApi.js +76 -0
- package/dist/components/Ocean.js +5 -5
- package/dist/components/ParticlesR3f.js +4 -4
- package/dist/components/PathRenderer.js +1 -1
- package/dist/components/ProductionScene.d.ts +17 -13
- package/dist/components/ProductionScene.d.ts.map +1 -1
- package/dist/components/ProductionScene.js +29 -8
- package/dist/components/ProjectLoader.d.ts +2 -1
- package/dist/components/ProjectLoader.d.ts.map +1 -1
- package/dist/components/ProjectLoader.js +5 -5
- package/dist/components/Rain.js +1 -1
- package/dist/components/SceneBuilder.d.ts.map +1 -1
- package/dist/components/SceneBuilder.js +5 -4
- package/dist/components/ShootingStar.js +1 -1
- package/dist/components/ShootingStars.js +1 -1
- package/dist/components/SkyController.js +6 -6
- package/dist/components/SkySystem.js +8 -8
- package/dist/components/Skybox.js +2 -2
- package/dist/components/Stars.js +3 -3
- package/dist/components/SunLight.js +1 -1
- package/dist/components/Text2D.js +1 -1
- package/dist/components/Text3D.js +1 -1
- package/dist/components/effects/AuraEffect.js +1 -1
- package/dist/components/effects/AuroraEffect.js +1 -1
- package/dist/components/effects/BlackHoleEffect.js +1 -1
- package/dist/components/effects/ConstellationEffect.js +1 -1
- package/dist/components/effects/DataStreamEffect.js +1 -1
- package/dist/components/effects/DnaHelixEffect.js +1 -1
- package/dist/components/effects/FireEffect.js +1 -1
- package/dist/components/effects/ForcefieldEffect.js +1 -1
- package/dist/components/effects/HologramEffect.js +1 -1
- package/dist/components/effects/IceCrystalsEffect.js +1 -1
- package/dist/components/effects/LightningEffect.js +1 -1
- package/dist/components/effects/MoleculesEffect.js +1 -1
- package/dist/components/effects/NeuralNetworkEffect.js +1 -1
- package/dist/components/effects/OrbEffect.js +1 -1
- package/dist/components/effects/PortalEffect.js +1 -1
- package/dist/components/effects/ShockwaveEffect.js +1 -1
- package/dist/components/effects/SmokePlumeEffect.js +1 -1
- package/dist/components/effects/SmokeRingEffect.js +1 -1
- package/dist/components/effects/VolumetricFogEffect.js +1 -1
- package/dist/hooks/useCameraAnimation.js +3 -3
- package/dist/hooks/useContinuousEffects.js +1 -1
- package/dist/hooks/useFrameAnimations.d.ts +27 -0
- package/dist/hooks/useFrameAnimations.d.ts.map +1 -0
- package/dist/hooks/useFrameAnimations.js +217 -0
- package/dist/hooks/useGsapAnimation.d.ts +130 -0
- package/dist/hooks/useGsapAnimation.d.ts.map +1 -0
- package/dist/hooks/useGsapAnimation.js +316 -0
- package/dist/hooks/useInteraction.d.ts +22 -0
- package/dist/hooks/useInteraction.d.ts.map +1 -0
- package/dist/hooks/useInteraction.js +240 -0
- package/dist/hooks/useObjectAnimation.js +2 -2
- package/dist/hooks/useObjectEdges.js +1 -1
- package/dist/hooks/useObjectEffects.d.ts +29 -0
- package/dist/hooks/useObjectEffects.d.ts.map +1 -0
- package/dist/hooks/useObjectEffects.js +162 -0
- package/dist/hooks/useSkyUniforms.js +1 -1
- package/dist/hooks/useTransformControls.js +1 -1
- package/dist/index.js +102 -102
- package/dist/shaders/ShaderEffectsMaterial.js +1 -1
- package/dist/utils/anchorUtils.js +1 -1
- package/dist/utils/utils3d.js +1 -1
- package/package.json +5 -3
|
@@ -10,7 +10,7 @@ export interface AnimatedObjectProps {
|
|
|
10
10
|
visible?: boolean;
|
|
11
11
|
children?: React.ReactNode;
|
|
12
12
|
parentRef?: React.RefObject<Object3D>;
|
|
13
|
-
|
|
13
|
+
handleObjectClick?: (createdObject: CreatedObjectSettings, ref: Object3D, event: ThreeEvent<MouseEvent>) => void;
|
|
14
14
|
onPointerEnter?: (e: ThreeEvent<PointerEvent>) => void;
|
|
15
15
|
onPointerLeave?: (e: ThreeEvent<PointerEvent>) => void;
|
|
16
16
|
anchor?: AnchorSettings | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnimatedObject.d.ts","sourceRoot":"","sources":["../../src/components/AnimatedObject.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+C,MAAM,OAAO,CAAC;AAEpE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAQvG,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,kBAAkB,EAAE,iBAAiB,CAAC;IACtC,aAAa,EAAE,qBAAqB,CAAC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IACtC,
|
|
1
|
+
{"version":3,"file":"AnimatedObject.d.ts","sourceRoot":"","sources":["../../src/components/AnimatedObject.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+C,MAAM,OAAO,CAAC;AAEpE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAQvG,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,kBAAkB,EAAE,iBAAiB,CAAC;IACtC,aAAa,EAAE,qBAAqB,CAAC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IACtC,iBAAiB,CAAC,EAAE,CAAC,aAAa,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;IACjH,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC;IACvD,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC;IACvD,MAAM,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,eAAe,CAAC,EAAE,OAAO,CAAC;CAE3B;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA6JvD,CAAC;AAGH,eAAe,cAAc,CAAC"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useRef, useEffect, useCallback, memo } from 'react';
|
|
3
3
|
import { useFrame } from '@react-three/fiber';
|
|
4
|
-
import { useAnimationEvents } from '../hooks/useAnimationEvents';
|
|
5
|
-
import { usePathAnimation } from '../hooks/usePathAnimation';
|
|
4
|
+
import { useAnimationEvents } from '../hooks/useAnimationEvents.js';
|
|
5
|
+
import { usePathAnimation } from '../hooks/usePathAnimation.js';
|
|
6
6
|
import { AnimationsManager } from '@ntalmagor/3drize-core';
|
|
7
|
-
import { applyAnchorSettings } from '../utils/anchorUtils';
|
|
8
|
-
import EffectsGroup from './EffectsGroup';
|
|
9
|
-
import { useObjectAnimation } from '../hooks/useObjectAnimation';
|
|
7
|
+
import { applyAnchorSettings } from '../utils/anchorUtils.js';
|
|
8
|
+
import EffectsGroup from './EffectsGroup.js';
|
|
9
|
+
import { useObjectAnimation } from '../hooks/useObjectAnimation.js';
|
|
10
10
|
export const AnimatedObject = memo(({ stateKey, transitionSettings, createdObject,
|
|
11
11
|
// speed = 1,
|
|
12
|
-
visible = true, children, parentRef,
|
|
12
|
+
visible = true, children, parentRef, handleObjectClick, onPointerEnter, onPointerLeave, anchor, hovered = false, animateMaterial = true,
|
|
13
13
|
// isActive = false,
|
|
14
14
|
}) => {
|
|
15
15
|
const internalRef = useRef(null);
|
|
@@ -115,6 +115,11 @@ visible = true, children, parentRef, onClick, onPointerEnter, onPointerLeave, an
|
|
|
115
115
|
if (anchor)
|
|
116
116
|
applyAnchorSettings(anchor, groupRef.current, rotation);
|
|
117
117
|
});
|
|
118
|
+
const onClick = (e) => {
|
|
119
|
+
if (handleObjectClick && groupRef.current) {
|
|
120
|
+
handleObjectClick(createdObject, groupRef.current, e);
|
|
121
|
+
}
|
|
122
|
+
};
|
|
118
123
|
return (_jsx(_Fragment, { children: _jsxs("group", { ref: groupRef, position: position, scale: scale, rotation: rotation, visible: visible, onClick: (e) => { e.stopPropagation(); onClick?.(e); }, onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, name: createdObject.meshSettings.name, userData: { id: createdObject.id }, children: [children, _jsx(EffectsGroup, { createdObject: createdObject })] }) }));
|
|
119
124
|
});
|
|
120
125
|
AnimatedObject.displayName = 'AnimatedObject';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useEffect, useRef } from 'react';
|
|
2
2
|
import { useFrame, useThree } from '@react-three/fiber';
|
|
3
|
-
import { useCameraAnimation } from '../hooks/useCameraAnimation';
|
|
4
|
-
import { cameraManager } from '../utils/CameraSingleton';
|
|
5
|
-
import { useAnimationEvents } from '../hooks/useAnimationEvents';
|
|
6
|
-
import { usePathAnimation } from '../hooks/usePathAnimation';
|
|
3
|
+
import { useCameraAnimation } from '../hooks/useCameraAnimation.js';
|
|
4
|
+
import { cameraManager } from '../utils/CameraSingleton.js';
|
|
5
|
+
import { useAnimationEvents } from '../hooks/useAnimationEvents.js';
|
|
6
|
+
import { usePathAnimation } from '../hooks/usePathAnimation.js';
|
|
7
7
|
export const CameraController = ({ enableAutoAnimation = true, animationDuration = 1, animationEase = "power2.out", settings }) => {
|
|
8
8
|
const { camera, set } = useThree();
|
|
9
9
|
const cameraRef = useRef(camera);
|
|
@@ -2,8 +2,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useRef, useState, useCallback } from 'react';
|
|
3
3
|
import * as THREE from 'three';
|
|
4
4
|
import { useThree, useFrame } from '@react-three/fiber';
|
|
5
|
-
import { useMaterialApplication } from '../hooks/useMaterialApplication';
|
|
6
|
-
import { useSkySystem } from '../hooks/useSkySystem';
|
|
5
|
+
import { useMaterialApplication } from '../hooks/useMaterialApplication.js';
|
|
6
|
+
import { useSkySystem } from '../hooks/useSkySystem.js';
|
|
7
7
|
const CLOUD_COLORS = {
|
|
8
8
|
night: new THREE.Color(0.1, 0.1, 0.2),
|
|
9
9
|
sunrise: new THREE.Color(0.8, 0.4, 0.4),
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { CreatedObjectSettings } from "@ntalmagor/3drize-core";
|
|
3
3
|
import { Object3D } from "three";
|
|
4
|
+
import { type ThreeEvent } from '@react-three/fiber';
|
|
4
5
|
interface CreatedObjectProps {
|
|
5
6
|
createdObject: CreatedObjectSettings;
|
|
6
7
|
children: React.ReactNode;
|
|
7
8
|
shouldApply3driseMaterial?: boolean;
|
|
8
9
|
onObjectReady?: (object: CreatedObjectSettings, ref: Object3D) => void;
|
|
10
|
+
handleObjectClick?: (createdObject: CreatedObjectSettings, ref: Object3D, event: ThreeEvent<MouseEvent>) => void;
|
|
9
11
|
}
|
|
10
12
|
declare const CreatedObject: React.FC<CreatedObjectProps>;
|
|
11
13
|
export default CreatedObject;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreatedObject.d.ts","sourceRoot":"","sources":["../../src/components/CreatedObject.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4C,MAAM,OAAO,CAAC;AAEjE,OAAO,KAAK,EAAe,qBAAqB,EAAkC,MAAM,wBAAwB,CAAC;AAOjH,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"CreatedObject.d.ts","sourceRoot":"","sources":["../../src/components/CreatedObject.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4C,MAAM,OAAO,CAAC;AAEjE,OAAO,KAAK,EAAe,qBAAqB,EAAkC,MAAM,wBAAwB,CAAC;AAOjH,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAMjC,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAWrD,UAAU,kBAAkB;IAC1B,aAAa,EAAE,qBAAqB,CAAC;IACrC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,KAAK,IAAI,CAAC;IACvE,iBAAiB,CAAC,EAAE,CAAC,aAAa,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;CAElH;AAED,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAiK9C,CAAC;AAIH,eAAe,aAAa,CAAC"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useRef, useEffect, useState, memo } from "react";
|
|
3
3
|
import { DEFAULT_EDGES_SETTINGS } from "@ntalmagor/3drize-core";
|
|
4
|
-
import { useMaterialApplication } from "../hooks/useMaterialApplication";
|
|
5
|
-
import { useTransformControls } from "../hooks/useTransformControls";
|
|
4
|
+
import { useMaterialApplication } from "../hooks/useMaterialApplication.js";
|
|
5
|
+
import { useTransformControls } from "../hooks/useTransformControls.js";
|
|
6
6
|
import { RigidBody } from '@react-three/rapier';
|
|
7
|
-
import { cameraManager } from "../utils/CameraSingleton";
|
|
8
|
-
import AnimatedObject from "./AnimatedObject";
|
|
9
|
-
import { useFrameEffects } from "../hooks/useFrameEffects";
|
|
7
|
+
import { cameraManager } from "../utils/CameraSingleton.js";
|
|
8
|
+
import AnimatedObject from "./AnimatedObject.js";
|
|
9
|
+
import { useFrameEffects } from "../hooks/useFrameEffects.js";
|
|
10
10
|
// import { useSceneClick } from "~/contextProviders/SceneClickContext";
|
|
11
|
-
import { useObjectEdges } from "../hooks/useObjectEdges";
|
|
12
|
-
const CreatedObject = memo(({ createdObject, children, shouldApply3driseMaterial = true, onObjectReady, }) => {
|
|
11
|
+
import { useObjectEdges } from "../hooks/useObjectEdges.js";
|
|
12
|
+
const CreatedObject = memo(({ createdObject, children, shouldApply3driseMaterial = true, onObjectReady, handleObjectClick, }) => {
|
|
13
13
|
const isSelected = false;
|
|
14
14
|
// const isSelected = useObjectSelection(createdObject.id);
|
|
15
15
|
// const { handleObjectClick: contextHandleObjectClick } = useSceneClick();
|
|
@@ -79,12 +79,12 @@ const CreatedObject = memo(({ createdObject, children, shouldApply3driseMaterial
|
|
|
79
79
|
handlePointerLeave();
|
|
80
80
|
e.stopPropagation();
|
|
81
81
|
};
|
|
82
|
-
const
|
|
82
|
+
const onClick = (e) => {
|
|
83
83
|
console.log('[1] CreatedObject.handleObjectClick:', createdObject.id, createdObject.meshSettings?.name);
|
|
84
|
-
if (createdObject.type === 'gallery') {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
84
|
+
// if (createdObject.type === 'gallery') {
|
|
85
|
+
// e.stopPropagation();
|
|
86
|
+
// return
|
|
87
|
+
// }
|
|
88
88
|
// contextHandleObjectClick(
|
|
89
89
|
// createdObject,
|
|
90
90
|
// meshRef.current,
|
|
@@ -92,25 +92,6 @@ const CreatedObject = memo(({ createdObject, children, shouldApply3driseMaterial
|
|
|
92
92
|
// e
|
|
93
93
|
// );
|
|
94
94
|
};
|
|
95
|
-
const handleTransformStart = () => {
|
|
96
|
-
console.log('Transform started for object:', createdObject.id);
|
|
97
|
-
isTransforming.current = true;
|
|
98
|
-
};
|
|
99
|
-
const handleTransformEnd = () => {
|
|
100
|
-
isTransforming.current = false;
|
|
101
|
-
if (meshRef.current) {
|
|
102
|
-
console.log('Transform ended for object:', createdObject.id);
|
|
103
|
-
const updatedSettings = {
|
|
104
|
-
...createdObject,
|
|
105
|
-
meshSettings: {
|
|
106
|
-
...createdObject.meshSettings,
|
|
107
|
-
position: [meshRef.current.position.x, meshRef.current.position.y, meshRef.current.position.z],
|
|
108
|
-
rotation: [meshRef.current.rotation.x, meshRef.current.rotation.y, meshRef.current.rotation.z],
|
|
109
|
-
scale: [meshRef.current.scale.x, meshRef.current.scale.y, meshRef.current.scale.z]
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
95
|
const anchorEnabled = createdObject.meshSettings.anchor && createdObject.meshSettings.anchor.enabled;
|
|
115
96
|
// console.log("createdObject.meshSettings", createdObject.meshSettings)
|
|
116
97
|
// console.log("Rendered CreatedObject:", createdObject.rigidBodySettings);
|
|
@@ -125,7 +106,7 @@ const CreatedObject = memo(({ createdObject, children, shouldApply3driseMaterial
|
|
|
125
106
|
position: anchorEnabled ? [anchoredPosition.x, anchoredPosition.y, anchoredPosition.z] : animatedTransform.position
|
|
126
107
|
}, createdObject: createdObject,
|
|
127
108
|
// animateMaterial={!useDreiMaterials}
|
|
128
|
-
parentRef: meshRef, visible: createdObject.meshSettings.visible,
|
|
109
|
+
parentRef: meshRef, visible: createdObject.meshSettings.visible, handleObjectClick: handleObjectClick, onPointerEnter: handleObjectEnter, onPointerLeave: e => handleObjectLeave(e), children: createdObject.rigidBodySettings?.enabled ? (_jsx(RigidBody, { type: createdObject.rigidBodySettings?.type || 'dynamic', mass: createdObject.rigidBodySettings?.mass || 1, colliders: createdObject.userData?.type === 'plane'
|
|
129
110
|
? 'cuboid' // Force box collider for planes
|
|
130
111
|
: undefined // Auto-detect for others
|
|
131
112
|
, friction: createdObject.rigidBodySettings?.friction, restitution: createdObject.rigidBodySettings?.restitution, gravityScale: createdObject.rigidBodySettings?.gravityScale ?? 1, linearDamping: createdObject.rigidBodySettings?.linearDamping ?? 0.01, angularDamping: createdObject.rigidBodySettings?.angularDamping ?? 0.01, children: children })) : (children) }));
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { type CameraState, type CreatedObjectSettings } from "@ntalmagor/3drize-core";
|
|
3
3
|
import { Object3D } from "three";
|
|
4
|
+
import { type ThreeEvent } from '@react-three/fiber';
|
|
4
5
|
interface CustomPrimitiveProps {
|
|
5
6
|
createdObject: CreatedObjectSettings;
|
|
6
7
|
cameraSettings: CameraState;
|
|
7
8
|
updateObjectSettings?: (updatedSettings: CreatedObjectSettings) => void;
|
|
8
9
|
onObjectReady?: (object: CreatedObjectSettings, ref: Object3D) => void;
|
|
10
|
+
handleObjectClick?: (createdObject: CreatedObjectSettings, ref: Object3D, event: ThreeEvent<MouseEvent>) => void;
|
|
9
11
|
}
|
|
10
12
|
declare const CustomPrimitive: React.FC<CustomPrimitiveProps>;
|
|
11
13
|
export default CustomPrimitive;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomPrimitive.d.ts","sourceRoot":"","sources":["../../src/components/CustomPrimitive.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4C,MAAM,OAAO,CAAC;AAEjE,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,qBAAqB,EAI5B,MAAM,wBAAwB,CAAC;AAIxD,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"CustomPrimitive.d.ts","sourceRoot":"","sources":["../../src/components/CustomPrimitive.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4C,MAAM,OAAO,CAAC;AAEjE,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,qBAAqB,EAI5B,MAAM,wBAAwB,CAAC;AAIxD,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAMjC,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAOrD,UAAU,oBAAoB;IAC5B,aAAa,EAAE,qBAAqB,CAAC;IACrC,cAAc,EAAE,WAAW,CAAA;IAC3B,oBAAoB,CAAC,EAAE,CAAC,eAAe,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACxE,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,KAAK,IAAI,CAAC;IACvE,iBAAiB,CAAC,EAAE,CAAC,aAAa,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;CAClH;AAED,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAuHlD,CAAC;AAIH,eAAe,eAAe,CAAC"}
|
|
@@ -2,13 +2,13 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import React, { useRef, useEffect, memo, useState } from "react";
|
|
3
3
|
import { ObjectManager, createDefaultEffectState, applyTransformEffects } from "@ntalmagor/3drize-core";
|
|
4
4
|
// import ObjectManager from "~/utils/ObjectManager";
|
|
5
|
-
import { useMaterialApplication } from "../hooks/useMaterialApplication";
|
|
5
|
+
import { useMaterialApplication } from "../hooks/useMaterialApplication.js";
|
|
6
6
|
import { useFrame } from "@react-three/fiber";
|
|
7
|
-
import MaterialLibrary from "./MaterialLibrary";
|
|
7
|
+
import MaterialLibrary from "./MaterialLibrary.js";
|
|
8
8
|
// import type { AnimatedTransform } from "~/types/mesh";
|
|
9
|
-
import CreatedObject from "./CreatedObject";
|
|
10
|
-
import { useFrameEffects } from "../hooks/useFrameEffects";
|
|
11
|
-
const CustomPrimitive = memo(({ createdObject, cameraSettings, updateObjectSettings, onObjectReady, }) => {
|
|
9
|
+
import CreatedObject from "./CreatedObject.js";
|
|
10
|
+
import { useFrameEffects } from "../hooks/useFrameEffects.js";
|
|
11
|
+
const CustomPrimitive = memo(({ createdObject, cameraSettings, updateObjectSettings, onObjectReady, handleObjectClick, }) => {
|
|
12
12
|
// const { handleObjectClick } = useSceneClick();
|
|
13
13
|
// console.log("Rendering CustomPrimitive with settings:", createdObject.name, createdObject);
|
|
14
14
|
const meshRef = useRef(null);
|
|
@@ -68,9 +68,7 @@ const CustomPrimitive = memo(({ createdObject, cameraSettings, updateObjectSetti
|
|
|
68
68
|
const geometry = obj.object.geometry;
|
|
69
69
|
return (
|
|
70
70
|
// <Select enabled={isSelected}>
|
|
71
|
-
_jsx(CreatedObject, { createdObject: createdObject, shouldApply3driseMaterial: false,
|
|
72
|
-
// Outer group must be registered so transform animations and edges share the same root
|
|
73
|
-
onObjectReady: (object, ref) => {
|
|
71
|
+
_jsx(CreatedObject, { createdObject: createdObject, shouldApply3driseMaterial: false, handleObjectClick: handleObjectClick, onObjectReady: (object, ref) => {
|
|
74
72
|
onObjectReady && onObjectReady(object, ref);
|
|
75
73
|
}, children: _jsx("primitive", { ref: meshRef, name: obj.name, object: obj.object, visible: materialReady && createdObject.meshSettings.visible, position: [0, 0, 0], rotation: [0, 0, 0], scale: [1, 1, 1], children: useDreiMaterials && createdObject.type === 'mesh' && createdObject.meshSettings.visible && (_jsx(MaterialLibrary, { materialSettings: createdObject.materialSettings })) }, obj.id) })
|
|
76
74
|
// {/* </Select> */}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
3
|
import { Box3, Sphere } from 'three';
|
|
4
|
-
import MoleculesEffect from './effects/MoleculesEffect';
|
|
5
|
-
import ShockwaveEffect from './effects/ShockwaveEffect';
|
|
6
|
-
import AuraEffect from './effects/AuraEffect';
|
|
7
|
-
import DataStreamEffect from './effects/DataStreamEffect';
|
|
8
|
-
import ConstellationEffect from './effects/ConstellationEffect';
|
|
9
|
-
import HologramEffect from './effects/HologramEffect';
|
|
10
|
-
import PortalEffect from './effects/PortalEffect';
|
|
11
|
-
import DnaHelixEffect from './effects/DnaHelixEffect';
|
|
12
|
-
import OrbEffect from './effects/OrbEffect';
|
|
13
|
-
import LightningEffect from './effects/LightningEffect';
|
|
14
|
-
import AuroraEffect from './effects/AuroraEffect';
|
|
15
|
-
import FireEffect from './effects/FireEffect';
|
|
16
|
-
import ForcefieldEffect from './effects/ForcefieldEffect';
|
|
17
|
-
import NeuralNetworkEffect from './effects/NeuralNetworkEffect';
|
|
18
|
-
import BlackHoleEffect from './effects/BlackHoleEffect';
|
|
19
|
-
import IceCrystalsEffect from './effects/IceCrystalsEffect';
|
|
20
|
-
import SmokePlumeEffect from './effects/SmokePlumeEffect';
|
|
21
|
-
import VolumetricFogEffect from './effects/VolumetricFogEffect';
|
|
22
|
-
import SmokeRingEffect from './effects/SmokeRingEffect';
|
|
4
|
+
import MoleculesEffect from './effects/MoleculesEffect.js';
|
|
5
|
+
import ShockwaveEffect from './effects/ShockwaveEffect.js';
|
|
6
|
+
import AuraEffect from './effects/AuraEffect.js';
|
|
7
|
+
import DataStreamEffect from './effects/DataStreamEffect.js';
|
|
8
|
+
import ConstellationEffect from './effects/ConstellationEffect.js';
|
|
9
|
+
import HologramEffect from './effects/HologramEffect.js';
|
|
10
|
+
import PortalEffect from './effects/PortalEffect.js';
|
|
11
|
+
import DnaHelixEffect from './effects/DnaHelixEffect.js';
|
|
12
|
+
import OrbEffect from './effects/OrbEffect.js';
|
|
13
|
+
import LightningEffect from './effects/LightningEffect.js';
|
|
14
|
+
import AuroraEffect from './effects/AuroraEffect.js';
|
|
15
|
+
import FireEffect from './effects/FireEffect.js';
|
|
16
|
+
import ForcefieldEffect from './effects/ForcefieldEffect.js';
|
|
17
|
+
import NeuralNetworkEffect from './effects/NeuralNetworkEffect.js';
|
|
18
|
+
import BlackHoleEffect from './effects/BlackHoleEffect.js';
|
|
19
|
+
import IceCrystalsEffect from './effects/IceCrystalsEffect.js';
|
|
20
|
+
import SmokePlumeEffect from './effects/SmokePlumeEffect.js';
|
|
21
|
+
import VolumetricFogEffect from './effects/VolumetricFogEffect.js';
|
|
22
|
+
import SmokeRingEffect from './effects/SmokeRingEffect.js';
|
|
23
23
|
const EffectsGenerator = ({ settings, object }) => {
|
|
24
24
|
if (!settings.enabled)
|
|
25
25
|
return null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import EffectsGenerator from './EffectsGenerator';
|
|
2
|
+
import EffectsGenerator from './EffectsGenerator.js';
|
|
3
3
|
const EffectsGroup = ({ createdObject }) => {
|
|
4
4
|
if (!createdObject.effects || createdObject.effects.length === 0)
|
|
5
5
|
return null;
|
|
@@ -2,8 +2,8 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
import { useMemo, forwardRef } from 'react';
|
|
3
3
|
import { Environment } from '@react-three/drei';
|
|
4
4
|
import { useThree } from '@react-three/fiber';
|
|
5
|
-
import SkySystem from './SkySystem';
|
|
6
|
-
import { useCubeCamera } from '../hooks/useCubeCamera';
|
|
5
|
+
import SkySystem from './SkySystem.js';
|
|
6
|
+
import { useCubeCamera } from '../hooks/useCubeCamera.js';
|
|
7
7
|
const EnvironmentManager = forwardRef(({ hdrSettings, cubeCameraResolution = 512,
|
|
8
8
|
// SkySystemProps — all forwarded to SkySystem
|
|
9
9
|
timeSettings, visible = true, sunSystemVisible = false, sunSize, moonSize, skyboxScale, sunIntensity, castShadow, shadowMapSize, playerPosition, starsSettings, cloudsSettings, cloudsMaterialSettings, skyControllerSettings, rainSettings, fogSettings, onTimeOfDayChange, onTimeUpdate, }, ref) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ThreeEvent } from '@react-three/fiber';
|
|
2
|
-
import {
|
|
2
|
+
import { Object3D } from "three";
|
|
3
3
|
import type { CreatedObjectSettings, HoverSettings } from '@ntalmagor/3drize-core';
|
|
4
4
|
import type { GalleryLayoutSettings } from '@ntalmagor/3drize-core';
|
|
5
5
|
import type { TransformEffect, ColorEffect } from '@ntalmagor/3drize-core';
|
|
@@ -20,7 +20,7 @@ export interface FrameProps {
|
|
|
20
20
|
side: number;
|
|
21
21
|
materialSettings: MaterialSettings;
|
|
22
22
|
children?: React.ReactNode;
|
|
23
|
-
|
|
23
|
+
handleObjectClick?: (createdObject: CreatedObjectSettings, ref: Object3D, event: ThreeEvent<MouseEvent>) => void;
|
|
24
24
|
}
|
|
25
|
-
export default function Frame({ url, isActive, createdObject, position, rotation, shapeType, hoverSettings, transformEffects, colorEffects, layoutSettings, side, materialSettings, children,
|
|
25
|
+
export default function Frame({ url, isActive, createdObject, position, rotation, shapeType, hoverSettings, transformEffects, colorEffects, layoutSettings, side, materialSettings, children, handleObjectClick, }: FrameProps): import("react/jsx-runtime").JSX.Element | null;
|
|
26
26
|
//# sourceMappingURL=Frame.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Frame.d.ts","sourceRoot":"","sources":["../../src/components/Frame.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Frame.d.ts","sourceRoot":"","sources":["../../src/components/Frame.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAmC,QAAQ,EAAsB,MAAM,OAAO,CAAC;AACtF,OAAO,KAAK,EAAE,qBAAqB,EAAE,aAAa,EAAgB,MAAM,wBAAwB,CAAC;AACjG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAG/D,OAAO,EAAiB,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAMrE,YAAY,EAAE,cAAc,EAAE,CAAC;AAE/B,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,OAAO,CAAC;IAClB,aAAa,EAAE,qBAAqB,CAAC;IACrC,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,aAAa,EAAE,aAAa,CAAC;IAC7B,gBAAgB,CAAC,EAAE,eAAe,EAAE,CAAC;IACrC,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;IAC7B,cAAc,EAAE,qBAAqB,CAAC;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,iBAAiB,CAAC,EAAE,CAClB,aAAa,EAAE,qBAAqB,EACpC,GAAG,EAAE,QAAQ,EACb,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;CAC1C;AAED,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAC5B,GAAG,EACH,QAAQ,EACR,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,SAAoB,EACpB,aAAa,EACb,gBAAqB,EACrB,YAAiB,EACjB,cAAc,EACd,IAAI,EACJ,gBAAgB,EAChB,QAAQ,EACR,iBAAiB,GAClB,EAAE,UAAU,kDAoFZ"}
|
package/dist/components/Frame.js
CHANGED
|
@@ -3,12 +3,12 @@ import { useRef, useState, useEffect } from "react";
|
|
|
3
3
|
import { useCursor } from "@react-three/drei";
|
|
4
4
|
import { BackSide, DoubleSide, FrontSide, Mesh } from "three";
|
|
5
5
|
import { texturesManager } from "@ntalmagor/3drize-core";
|
|
6
|
-
import { FrameGeometry } from "./FrameGeometry";
|
|
7
|
-
import { FrameImage } from "./FrameImage";
|
|
8
|
-
import MaterialLibrary from "./MaterialLibrary";
|
|
9
|
-
import { useFrameEffects } from "../hooks/useFrameEffects";
|
|
10
|
-
import { useObjectAnimation } from "../hooks/useObjectAnimation";
|
|
11
|
-
export default function Frame({ url, isActive, createdObject, position, rotation, shapeType = 'circle', hoverSettings, transformEffects = [], colorEffects = [], layoutSettings, side, materialSettings, children,
|
|
6
|
+
import { FrameGeometry } from "./FrameGeometry.js";
|
|
7
|
+
import { FrameImage } from "./FrameImage.js";
|
|
8
|
+
import MaterialLibrary from "./MaterialLibrary.js";
|
|
9
|
+
import { useFrameEffects } from "../hooks/useFrameEffects.js";
|
|
10
|
+
import { useObjectAnimation } from "../hooks/useObjectAnimation.js";
|
|
11
|
+
export default function Frame({ url, isActive, createdObject, position, rotation, shapeType = 'circle', hoverSettings, transformEffects = [], colorEffects = [], layoutSettings, side, materialSettings, children, handleObjectClick, }) {
|
|
12
12
|
const frameRef = useRef(new Mesh());
|
|
13
13
|
const imageRef = useRef(null);
|
|
14
14
|
const [texture, setTexture] = useState(null);
|
|
@@ -39,12 +39,14 @@ export default function Frame({ url, isActive, createdObject, position, rotation
|
|
|
39
39
|
];
|
|
40
40
|
const showFront = side === FrontSide || side === DoubleSide;
|
|
41
41
|
const showBack = side === BackSide || side === DoubleSide;
|
|
42
|
-
const
|
|
42
|
+
const onClick = (e) => {
|
|
43
|
+
e.stopPropagation();
|
|
43
44
|
if (!frameRef.current)
|
|
44
45
|
return;
|
|
45
|
-
|
|
46
|
+
// const clickedPoint = e.point;
|
|
47
|
+
handleObjectClick?.(createdObject, frameRef.current, e);
|
|
46
48
|
};
|
|
47
49
|
if (!texture)
|
|
48
50
|
return null;
|
|
49
|
-
return (_jsx("mesh", { name: url, ref: frameRef, position: position, rotation: rotation, scale: scale, raycast: () => null, onPointerEnter: handlePointerEnter, onPointerLeave: handlePointerLeave, onClick:
|
|
51
|
+
return (_jsx("mesh", { name: url, ref: frameRef, position: position, rotation: rotation, scale: scale, raycast: () => null, onPointerEnter: handlePointerEnter, onPointerLeave: handlePointerLeave, onClick: onClick, children: children ? children : (_jsxs(_Fragment, { children: [_jsx(FrameGeometry, { shapeType: 'rectangle', layoutSettings: layoutSettings, scale: layoutSettings.outerFrameScale }), _jsx(MaterialLibrary, { materialSettings: materialSettings }), showFront && (_jsx(FrameImage, { ref: imageRef, texture: texture, shapeType: 'rectangle', position: [0, 0, 0.02] })), showBack && (_jsx(FrameImage, { texture: texture, shapeType: 'rectangle', position: [0, 0, -0.02], rotation: [0, Math.PI, 0], isBack: true }))] })) }));
|
|
50
52
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
-
import { FrameGeometry } from "./FrameGeometry";
|
|
3
|
+
import { FrameGeometry } from "./FrameGeometry.js";
|
|
4
4
|
export const FrameImage = forwardRef(({ texture, shapeType, position, rotation, isBack = false, layoutSettings, }, ref) => {
|
|
5
5
|
const width = layoutSettings?.width || 1;
|
|
6
6
|
const height = layoutSettings?.height || 1;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import Stars from './Stars';
|
|
3
|
-
import ShootingStars from './ShootingStars';
|
|
2
|
+
import Stars from './Stars.js';
|
|
3
|
+
import ShootingStars from './ShootingStars.js';
|
|
4
4
|
const Galaxy = ({ settings }) => {
|
|
5
5
|
if (!settings.visible)
|
|
6
6
|
return null;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { Object3D } from 'three';
|
|
2
3
|
import type { CreatedObjectSettings } from '@ntalmagor/3drize-core';
|
|
4
|
+
import { type ThreeEvent } from '@react-three/fiber';
|
|
3
5
|
export interface GalleryLayoutProps {
|
|
4
6
|
createdObject: CreatedObjectSettings;
|
|
5
7
|
selectedFrameUrl?: string;
|
|
6
|
-
|
|
8
|
+
handleObjectClick?: (createdObject: CreatedObjectSettings, ref: Object3D, event: ThreeEvent<MouseEvent>) => void;
|
|
7
9
|
}
|
|
8
10
|
declare const GalleryLayout: React.FC<GalleryLayoutProps>;
|
|
9
11
|
export default GalleryLayout;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GalleryLayout.d.ts","sourceRoot":"","sources":["../../src/components/GalleryLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0B,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"GalleryLayout.d.ts","sourceRoot":"","sources":["../../src/components/GalleryLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0B,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAS,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,KAAK,EAAE,qBAAqB,EAAuC,MAAM,wBAAwB,CAAC;AAKzG,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,WAAW,kBAAkB;IACjC,aAAa,EAAE,qBAAqB,CAAC;IACrC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iBAAiB,CAAC,EAAE,CAAC,aAAa,EAAE,qBAAqB,EACvD,GAAG,EAAE,QAAQ,EACb,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;CAC1C;AAED,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAkD/C,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo, useRef } from 'react';
|
|
3
3
|
import { updateCurrentLayoutSettings } from '@ntalmagor/3drize-core';
|
|
4
|
-
import Frame from './Frame';
|
|
5
|
-
import EffectsGenerator from './EffectsGenerator';
|
|
6
|
-
import { ImageGeometry } from './ImageGeometry';
|
|
7
|
-
const GalleryLayout = ({ createdObject, selectedFrameUrl,
|
|
4
|
+
import Frame from './Frame.js';
|
|
5
|
+
import EffectsGenerator from './EffectsGenerator.js';
|
|
6
|
+
import { ImageGeometry } from './ImageGeometry.js';
|
|
7
|
+
const GalleryLayout = ({ createdObject, selectedFrameUrl, handleObjectClick, }) => {
|
|
8
8
|
const groupRef = useRef(null);
|
|
9
9
|
const { config, materialSettings, animations } = createdObject;
|
|
10
10
|
const galleryLayout = config || {
|
|
@@ -13,6 +13,6 @@ const GalleryLayout = ({ createdObject, selectedFrameUrl, onFrameSelect, }) => {
|
|
|
13
13
|
outerFrameScale: 1,
|
|
14
14
|
};
|
|
15
15
|
const { frames, layoutSettings } = useMemo(() => updateCurrentLayoutSettings(galleryLayout), [galleryLayout]);
|
|
16
|
-
return (_jsx("group", { ref: groupRef, scale: [1, 1, 1], position: [0, 0, 0], rotation: [0, 0, 0], children: frames.map((frame, index) => (_jsxs(Frame, { url: frame.url, isActive: selectedFrameUrl === frame.url, createdObject: createdObject, position: frame.position, rotation: frame.rotation, hoverSettings: { sensitivity: 0.5, applyToChildren: false }, transformEffects: animations?.transform?.effects || [], layoutSettings: layoutSettings, side: galleryLayout?.side || 2, materialSettings: materialSettings,
|
|
16
|
+
return (_jsx("group", { ref: groupRef, scale: [1, 1, 1], position: [0, 0, 0], rotation: [0, 0, 0], children: frames.map((frame, index) => (_jsxs(Frame, { url: frame.url, isActive: selectedFrameUrl === frame.url, createdObject: createdObject, position: frame.position, rotation: frame.rotation, hoverSettings: { sensitivity: 0.5, applyToChildren: false }, transformEffects: animations?.transform?.effects || [], layoutSettings: layoutSettings, side: galleryLayout?.side || 2, materialSettings: materialSettings, handleObjectClick: handleObjectClick, children: [layoutSettings.geometryType !== 'none' && (_jsx(ImageGeometry, { url: frame.url, geometryType: layoutSettings.geometryType, outerFrameScale: layoutSettings.outerFrameScale })), createdObject.effects?.map((effect, effectIndex) => (_jsx(EffectsGenerator, { settings: effect }, effectIndex)))] }, index))) }));
|
|
17
17
|
};
|
|
18
18
|
export default GalleryLayout;
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useRef, useMemo, useCallback } from 'react';
|
|
3
3
|
import * as THREE from 'three';
|
|
4
4
|
import { useThree } from '@react-three/fiber';
|
|
5
|
-
import { useSkySystem } from '../hooks/useSkySystem';
|
|
5
|
+
import { useSkySystem } from '../hooks/useSkySystem.js';
|
|
6
6
|
export function createFlareTexture(type) {
|
|
7
7
|
const canvas = document.createElement('canvas');
|
|
8
8
|
canvas.width = 256;
|
|
@@ -2,9 +2,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useRef, useState, useEffect } from 'react';
|
|
3
3
|
import { useFrame } from '@react-three/fiber';
|
|
4
4
|
import { useCursor, Text, Text3D, Center } from '@react-three/drei';
|
|
5
|
-
import MaterialLibrary from './MaterialLibrary';
|
|
5
|
+
import MaterialLibrary from './MaterialLibrary.js';
|
|
6
6
|
import { createDefaultEffectState, applyTransformEffects } from '@ntalmagor/3drize-core';
|
|
7
|
-
import { useFrameEffects } from '../hooks/useFrameEffects';
|
|
7
|
+
import { useFrameEffects } from '../hooks/useFrameEffects.js';
|
|
8
8
|
import { fontManager } from '@ntalmagor/3drize-core';
|
|
9
9
|
const getText3DConfig = (config) => {
|
|
10
10
|
const c = config;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useRef } from 'react';
|
|
3
|
-
import Letter from './Letter';
|
|
3
|
+
import Letter from './Letter.js';
|
|
4
4
|
export default function Letters({ text, config, materialSettings, hoverSettings, transformEffects = [], colorEffects = [], onLetterClick, }) {
|
|
5
5
|
const ref = useRef(null);
|
|
6
6
|
const characters = text.split('');
|
|
@@ -2,8 +2,8 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import { useRef, useEffect, useMemo } from 'react';
|
|
3
3
|
import { useFrame, useThree } from '@react-three/fiber';
|
|
4
4
|
import { useHelper } from '@react-three/drei';
|
|
5
|
-
import { createSunPosition } from '../utils/utils3d';
|
|
6
|
-
import { useLightHandlers } from '../hooks/useLightHandlers';
|
|
5
|
+
import { createSunPosition } from '../utils/utils3d.js';
|
|
6
|
+
import { useLightHandlers } from '../hooks/useLightHandlers.js';
|
|
7
7
|
import { Color, DirectionalLightHelper, SpotLightHelper, PointLightHelper, } from 'three';
|
|
8
8
|
const LightHelperMesh = ({ position, lightName, lightColor, hasHandlers, onEnter, onLeave, size = 0.5, }) => {
|
|
9
9
|
if (!hasHandlers)
|
package/dist/components/Lines.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
3
|
import { PositionsCreator } from '@ntalmagor/3drize-core';
|
|
4
|
-
import Path from './Path';
|
|
4
|
+
import Path from './Path.js';
|
|
5
5
|
const Lines = ({ createdObject, transitionSettings }) => {
|
|
6
6
|
if (!createdObject)
|
|
7
7
|
return null;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Object3D } from "three";
|
|
3
3
|
import type { CameraState, CreatedObjectSettings, ObjectTreeNode } from "@ntalmagor/3drize-core";
|
|
4
|
+
import { type ThreeEvent } from '@react-three/fiber';
|
|
4
5
|
type ObjectNodeProps = {
|
|
5
6
|
node: ObjectTreeNode;
|
|
6
7
|
cameraSettings: CameraState;
|
|
7
8
|
onObjectReady?: (object: CreatedObjectSettings, ref: Object3D) => void;
|
|
9
|
+
handleObjectClick?: (object: CreatedObjectSettings, ref: Object3D, event: ThreeEvent<MouseEvent>) => void;
|
|
8
10
|
};
|
|
9
11
|
declare const ObjectNode: React.FC<ObjectNodeProps>;
|
|
10
12
|
export default ObjectNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectNode.d.ts","sourceRoot":"","sources":["../../src/components/ObjectNode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+B,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAA6D,cAAc,EAA0B,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"ObjectNode.d.ts","sourceRoot":"","sources":["../../src/components/ObjectNode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+B,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAA6D,cAAc,EAA0B,MAAM,wBAAwB,CAAC;AAEpL,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAWrD,KAAK,eAAe,GAAG;IACnB,IAAI,EAAE,cAAc,CAAC;IACrB,cAAc,EAAE,WAAW,CAAC;IAC5B,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,KAAK,IAAI,CAAC;IACvE,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;CAC7G,CAAC;AAkDF,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAyJzC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|