motion 13.1.1 → 13.2.0

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.
@@ -0,0 +1,29 @@
1
+ import * as motion_dom from 'motion-dom';
2
+ import { MotionValue } from 'framer-motion/dom';
3
+
4
+ interface ThreeUniform<T = unknown> {
5
+ value: T;
6
+ }
7
+ type ThreeUniforms<T extends object> = {
8
+ [K in keyof T]: ThreeUniform<T[K]>;
9
+ };
10
+ type ThreeEffectValues = Record<string, MotionValue>;
11
+ type ThreeObject = Record<string, any>;
12
+ /**
13
+ * Binds motion values to Three.js objects, materials and uniforms.
14
+ *
15
+ * Register with `animate.addEffect(threeEffect)` so `animate()` can target
16
+ * meshes, lights, cameras, materials and uniforms directly, or call it
17
+ * yourself to wire up existing motion values:
18
+ *
19
+ * ```ts
20
+ * threeEffect(mesh, { x, rotateY, color })
21
+ * threeEffect(uniforms, { progress })
22
+ * ```
23
+ *
24
+ * Writes happen once per frame in `frame.preRender`, ahead of render loops
25
+ * scheduled with `frame.render`.
26
+ */
27
+ declare const threeEffect: motion_dom.AnimateEffect<ThreeObject>;
28
+
29
+ export { type ThreeEffectValues, type ThreeUniform, type ThreeUniforms, threeEffect };
package/dist/vgpu.d.ts ADDED
@@ -0,0 +1,25 @@
1
+ import * as motion_dom from 'motion-dom';
2
+ import { MotionValue } from 'framer-motion/dom';
3
+
4
+ type VGPUEffectValues = Record<string, MotionValue>;
5
+ type Subject = Record<string, any>;
6
+ /**
7
+ * Binds motion values to vgpu shared uniforms, Effect/Draw/Compute bindings
8
+ * ("params.time"), scene nodes (x, rotateY, scale), cameras, lights,
9
+ * materials, orbit controls and target clear colors.
10
+ *
11
+ * Register with `animate.addEffect(vgpuEffect)` so `animate()` can target
12
+ * these subjects directly, or call it yourself to wire up existing motion
13
+ * values:
14
+ *
15
+ * ```ts
16
+ * vgpuEffect(wave, { "params.time": time })
17
+ * vgpuEffect(cube, { x, rotateY })
18
+ * ```
19
+ *
20
+ * Changed values are batched into a single set() per subject per frame in
21
+ * `frame.preRender`, ahead of render loops scheduled with `frame.render`.
22
+ */
23
+ declare const vgpuEffect: motion_dom.AnimateEffect<Subject>;
24
+
25
+ export { type VGPUEffectValues, vgpuEffect };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "motion",
3
- "version": "13.1.1",
3
+ "version": "13.2.0",
4
4
  "description": "An animation library for JavaScript and React.",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/es/index.mjs",
@@ -23,6 +23,18 @@
23
23
  "import": "./dist/es/mini.mjs",
24
24
  "default": "./dist/cjs/mini.js"
25
25
  },
26
+ "./three": {
27
+ "types": "./dist/three.d.ts",
28
+ "require": "./dist/cjs/three.js",
29
+ "import": "./dist/es/three.mjs",
30
+ "default": "./dist/cjs/three.js"
31
+ },
32
+ "./vgpu": {
33
+ "types": "./dist/vgpu.d.ts",
34
+ "require": "./dist/cjs/vgpu.js",
35
+ "import": "./dist/es/vgpu.mjs",
36
+ "default": "./dist/cjs/vgpu.js"
37
+ },
26
38
  "./react": {
27
39
  "types": "./dist/react.d.ts",
28
40
  "require": "./dist/cjs/react.js",
@@ -72,11 +84,12 @@
72
84
  "build": "yarn clean && tsc -p . && rollup -c",
73
85
  "dev": "concurrently -c blue,red -n tsc,rollup --kill-others \"tsc --watch -p . --preserveWatchOutput\" \"rollup --config --watch --no-watch.clearScreen\"",
74
86
  "clean": "rm -rf types dist lib",
87
+ "test": "jest --config jest.config.json --max-workers=2",
75
88
  "prepack": "yarn build",
76
89
  "postpublish": "git push --tags"
77
90
  },
78
91
  "dependencies": {
79
- "framer-motion": "^13.1.1",
92
+ "framer-motion": "^13.2.0",
80
93
  "tslib": "^2.4.0"
81
94
  },
82
95
  "peerDependencies": {
@@ -91,5 +104,5 @@
91
104
  "optional": true
92
105
  }
93
106
  },
94
- "gitHead": "1b037b0032578b52af94b06ff3920bfa0aaa5e36"
107
+ "gitHead": "e871ba7f175d0609cef84f416f984e8e84be8333"
95
108
  }