@ntalmagor/3drize-viewer 0.1.18 → 0.1.20

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.
@@ -99,7 +99,7 @@ export const CameraController = ({ enableAutoAnimation = true, animationDuration
99
99
  event.step.transitions.forEach((transition) => {
100
100
  const { state, properties, pathId } = transition;
101
101
  if (state === 'camera') {
102
- // console.log('Camera transition detected. Starting animation to new camera state:', properties);
102
+ console.log('Camera transition detected. Starting animation to new camera state:', properties);
103
103
  isInAnimatedTransition.current = true;
104
104
  if (pathId) {
105
105
  const offset = camera
@@ -1,6 +1,6 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import RiseLogo from './RiseLogo.js';
3
3
  const LoadingIndicator = ({ text, fullScreen = false, animate = true, size = 80, }) => {
4
- return (_jsx("div", { children: _jsx(RiseLogo, { size: size, animated: animate, loop: true }) }));
4
+ return (_jsxs("div", { children: [text && _jsx("div", { className: "loading-text", children: text }), _jsx(RiseLogo, { size: size, animated: animate, loop: true })] }));
5
5
  };
6
6
  export default LoadingIndicator;
@@ -1 +1 @@
1
- {"version":3,"file":"useCameraAnimation.d.ts","sourceRoot":"","sources":["../../src/hooks/useCameraAnimation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAc,MAAM,OAAO,CAAC;AAGtD,OAAO,EAAW,KAAK,WAAW,EAAE,KAAK,eAAe,EAAE,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAO5G,UAAU,yBAAyB;IACjC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAC;IACjC,iBAAiB,CAAC,EAAE,MAAM,IAAI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,CAAC,EAAE,YAAY,CAAC;IACxB,WAAW,CAAC,EAAE,eAAe,GAAG,YAAY,CAAC;IAC7C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,kBAAkB,GAAI,UAAS,yBAA8B,EAAE,cAAa,WAA+B;;;+BA0MpF;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE;4BApKhD,qBAAqB,aACnB,MAAM,SACV,MAAM,iBACG,YAAY;kCAwHjB,YAAY,aACX,MAAM,SACV,MAAM;wCAgCA,eAAe,aACjB,MAAM,SACV,MAAM;wBAuCR,MAAM,aACA,MAAM,SACV,MAAM;qBAOL,YAAY,aACV,OAAO,aACN,MAAM,SACV,MAAM;gCA2BL,YAAY,UACZ,MAAM,eACF,MAAM,aACR,MAAM,aACL,MAAM,SACV,MAAM;;;CA4EhB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -10,15 +10,18 @@ export const useCameraAnimation = (options = {}, cameraState = {}) => {
10
10
  // const cameraState = useAppSelector(selectCamera);
11
11
  const { interpolateProperty } = useMouseHandlers();
12
12
  const orbitControls = useOrbitControls();
13
- const cameraRef = useRef(cameraManager.getCamera());
13
+ const cameraRef = useRef(null);
14
14
  const animationRef = useRef(null);
15
15
  const isAnimatingRef = useRef(false);
16
16
  const handlers = cameraState.handlers;
17
- // Update camera reference when Three.js camera changes
17
+ // Keep cameraRef synced with the singleton. The hook may be initialized
18
+ // before the host component's effect calls cameraManager.setCamera(...),
19
+ // so a one-shot backfill races and leaves the ref null in production.
18
20
  useEffect(() => {
19
- if (!cameraRef.current) {
21
+ cameraRef.current = cameraManager.getCamera();
22
+ return cameraManager.subscribe(() => {
20
23
  cameraRef.current = cameraManager.getCamera();
21
- }
24
+ });
22
25
  }, []);
23
26
  // Kill any running animation
24
27
  const killAnimation = () => {
@@ -1 +1 @@
1
- {"version":3,"file":"useInteraction.d.ts","sourceRoot":"","sources":["../../src/hooks/useInteraction.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAyB,wBAAwB,EAA8B,MAAM,wBAAwB,CAAC;AAkB1J,wBAAgB,cAAc,CAAC,EAE7B,cAAc,EACd,SAAS,GACV,EAAE;IACD,cAAc,EAAE,WAAW,CAAC;IAC5B,SAAS,EAAE,iBAAiB,EAAE,CAAC;CAChC;iCA8OW,wBAAwB,KAC/B,IAAI;;;;EAwCR;AAED,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"useInteraction.d.ts","sourceRoot":"","sources":["../../src/hooks/useInteraction.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAyB,wBAAwB,EAA8B,MAAM,wBAAwB,CAAC;AAiB1J,wBAAgB,cAAc,CAAC,EAE7B,cAAc,EACd,SAAS,GACV,EAAE;IACD,cAAc,EAAE,WAAW,CAAC;IAC5B,SAAS,EAAE,iBAAiB,EAAE,CAAC;CAChC;iCA8OW,wBAAwB,KAC/B,IAAI;;;;EAwCR;AAED,eAAe,cAAc,CAAC"}
@@ -12,7 +12,6 @@ import { AnimationsManager } from '@ntalmagor/3drize-core';
12
12
  import useCameraAnimation from '../hooks/useCameraAnimation.js';
13
13
  import { useFrameAnimations } from '../hooks/useFrameAnimations.js';
14
14
  import { useObjectEffects } from '../hooks/useObjectEffects.js';
15
- // import AnimationsManager from '../utils/AnimationsManager';
16
15
  import { findById } from '../utils/sceneQuery.js';
17
16
  // =============================================================================
18
17
  // TYPES
@@ -68,6 +67,7 @@ cameraSettings, sequences, }) {
68
67
  if (!animationIds || animationIds.length === 0)
69
68
  return;
70
69
  console.log('[useInteraction] triggerAnimations:', animationIds);
70
+ console.log('Available sequences:', sequences.map(s => s.id));
71
71
  animationIds.forEach(animationId => {
72
72
  const sequence = sequences.find(s => s.id === animationId);
73
73
  if (sequence) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ntalmagor/3drize-viewer",
3
- "version": "0.1.18",
3
+ "version": "0.1.20",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -26,6 +26,7 @@
26
26
  "@react-three/fiber": "^9",
27
27
  "@react-three/rapier": "^2",
28
28
  "react": "^18 || ^19",
29
+ "@ntalmagor/3drize-core": "^0.1.13",
29
30
  "three": "^0.170"
30
31
  },
31
32
  "devDependencies": {
@@ -37,7 +38,5 @@
37
38
  "three": "^0.170.0",
38
39
  "typescript": "^5.7.2"
39
40
  },
40
- "dependencies": {
41
- "@ntalmagor/3drize-core": "^0.1.13"
42
- }
41
+ "dependencies": {}
43
42
  }