@react-three/viverse 0.2.9 → 0.2.11

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.
@@ -15,8 +15,8 @@ export type CharacterAnimationActionProps = {
15
15
  loop?: AnimationActionLoopStyles;
16
16
  additiveReferenceClip?: AnimationClip;
17
17
  } & Omit<ActionParams<RootState>, 'until'> & CharacterAnimationOptions & StartAnimationOptions;
18
- export declare function CharacterAnimationLayer({ name, children }: {
19
- name: string;
18
+ export declare function CharacterAnimationLayer({ name, children, }: {
19
+ name: string | undefined | Array<string | undefined>;
20
20
  children?: ReactNode;
21
21
  }): import("react/jsx-runtime").JSX.Element;
22
22
  export declare const CharacterAnimationAction: import("react").ForwardRefExoticComponent<{
package/dist/animation.js CHANGED
@@ -12,8 +12,10 @@ export const AdditiveCharacterAnimationAction = forwardRef(({ referenceClip: ref
12
12
  return _jsx(CharacterAnimationAction, { ref: ref, additiveReferenceClip: referenceClip, ...props });
13
13
  });
14
14
  const CharacterAnimationLayerContext = createContext(undefined);
15
- export function CharacterAnimationLayer({ name, children }) {
16
- return _jsx(CharacterAnimationLayerContext.Provider, { value: name, children: children });
15
+ export function CharacterAnimationLayer({ name, children, }) {
16
+ // eslint-disable-next-line react-hooks/exhaustive-deps
17
+ const layers = useMemo(() => name, [JSON.stringify(name)]);
18
+ return _jsx(CharacterAnimationLayerContext.Provider, { value: layers, children: children });
17
19
  }
18
20
  export const CharacterAnimationAction = forwardRef(({ additiveReferenceClip, until, init, dependencies, update, fadeDuration, paused, loop, sync, crossFade, layer, ...animationOptions }, ref) => {
19
21
  const layerFromContext = useContext(CharacterAnimationLayerContext);
@@ -39,6 +41,16 @@ export const CharacterAnimationAction = forwardRef(({ additiveReferenceClip, unt
39
41
  cleanupAnimation?.();
40
42
  };
41
43
  }, until: until ?? (() => animationFinished(animation)), update: update, dependencies: dependencies != null
42
- ? [...dependencies, animationOptions.mask, fadeDuration, paused, sync, crossFade, animation, model, layer]
44
+ ? [
45
+ ...dependencies,
46
+ animationOptions.mask,
47
+ fadeDuration,
48
+ paused,
49
+ sync,
50
+ crossFade,
51
+ animation,
52
+ model,
53
+ JSON.stringify(layer),
54
+ ]
43
55
  : undefined }));
44
56
  });
package/package.json CHANGED
@@ -29,7 +29,7 @@
29
29
  "@pixiv/three-vrm": "^3.4.2",
30
30
  "zustand": "^5.0.6",
31
31
  "@react-three/xr": "^6.6.20",
32
- "@pmndrs/viverse": "^0.2.9"
32
+ "@pmndrs/viverse": "^0.2.11"
33
33
  },
34
34
  "peerDependencies": {
35
35
  "@react-three/fiber": "*"
@@ -40,7 +40,7 @@
40
40
  "@types/react": "^19.1.8",
41
41
  "react": "^19.1.0"
42
42
  },
43
- "version": "0.2.9",
43
+ "version": "0.2.11",
44
44
  "scripts": {
45
45
  "build": "tsc",
46
46
  "check:prettier": "prettier --check src",