coily 0.10.1 → 0.12.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.
package/README.md CHANGED
@@ -32,7 +32,6 @@ The `createSpring` function takes the following arguments:
32
32
 
33
33
  - `config: SpringConfig`
34
34
  The configuration for the spring. `SpringConfig` takes the following parameters:
35
-
36
35
  - `config.mass: number`
37
36
  How massive the spring is. A lower number will allow the spring to speed up and slow down more quickly than a
38
37
  larger number. Larger numbers are more likely to overshoot the `target`
@@ -47,7 +46,6 @@ The `createSpring` function takes the following arguments:
47
46
 
48
47
  - `options: SpringOptions`
49
48
  Additional options for the spring. `SpringOptions` takes the following parameters:
50
-
51
49
  - `options.restingDistance: number`
52
50
  The minimum difference between the `target` and `value` at which the spring will consider itself "at" the `target`
53
51
 
@@ -229,7 +227,7 @@ The links take one of two forms:
229
227
  const chain = createSpringChain(
230
228
  0, // initial
231
229
  [50, 50, (value) => value * 1.25],
232
- { mass: 10, tension: 3000, friction: 300 } // config
230
+ { mass: 10, tension: 3000, friction: 300 }, // config
233
231
  )
234
232
  ```
235
233
 
@@ -0,0 +1,2 @@
1
+ import { _ as defineSpring, a as Spring2D, c as Spring2DWithOffset, d as SpringPosition, f as SpringTarget, g as SpringState, h as SpringOptions, i as TickerOptions, l as Vector2, m as SpringConfig, n as SpringSystemOptions, o as Spring2DPosition, p as SpringWithOffset, r as createSpringSystem, s as Spring2DTarget, t as SpringSystem, u as Spring } from "./system-Do5rE0j7.js";
2
+ export { type Spring, type Spring2D, type Spring2DPosition, type Spring2DTarget, type Spring2DWithOffset, type SpringConfig, type SpringOptions, type SpringPosition, type SpringState, type SpringSystem, type SpringSystemOptions, type SpringTarget, type SpringWithOffset, type TickerOptions, type Vector2, createSpringSystem, defineSpring };
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ import { r as defineSpring, t as createSpringSystem } from "./system-DPaqec-Z.js";
2
+ export { createSpringSystem, defineSpring };
package/dist/nuxt.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ import { NuxtModule } from "@nuxt/schema";
2
+
3
+ //#region src/vue/nuxt.d.ts
4
+ interface CoilyModuleOptions {
5
+ debug?: boolean;
6
+ }
7
+ declare const coilyModule: NuxtModule;
8
+ //#endregion
9
+ export { CoilyModuleOptions, coilyModule as default };
package/dist/nuxt.js ADDED
@@ -0,0 +1,69 @@
1
+ import { addComponent, addImports, addPluginTemplate, defineNuxtModule } from "@nuxt/kit";
2
+ //#region src/vue/nuxt.ts
3
+ function getPluginTemplate(options) {
4
+ return `import { createSpringSystem } from 'coily'
5
+ import { provideSpringSystem } from 'coily/vue'
6
+
7
+ export default defineNuxtPlugin((nuxtApp) => {
8
+ nuxtApp.hook('app:created', (vueApp) => {
9
+ const system = createSpringSystem(${options.debug ? "{ debug: true }" : ""})
10
+ provideSpringSystem(system, vueApp)
11
+
12
+ if(import.meta.client) {
13
+ system.start()
14
+ }
15
+ })
16
+ })`;
17
+ }
18
+ const coilyModule = defineNuxtModule({
19
+ meta: {
20
+ name: "coily",
21
+ configKey: "coily"
22
+ },
23
+ defaults: { debug: false },
24
+ async setup(_options) {
25
+ addPluginTemplate({
26
+ name: "coily",
27
+ filename: "coily.plugin.mjs",
28
+ mode: "all",
29
+ getContents: () => getPluginTemplate(_options)
30
+ });
31
+ addImports([
32
+ {
33
+ from: "coily/vue",
34
+ name: "useSpring"
35
+ },
36
+ {
37
+ from: "coily/vue",
38
+ name: "useSpring2D"
39
+ },
40
+ {
41
+ from: "coily/vue",
42
+ name: "SpringRef",
43
+ type: true
44
+ },
45
+ {
46
+ from: "coily/vue",
47
+ name: "SpringRef2D",
48
+ type: true
49
+ },
50
+ {
51
+ from: "coily",
52
+ name: "defineSpring"
53
+ },
54
+ {
55
+ from: "coily",
56
+ name: "SpringConfig",
57
+ type: true
58
+ }
59
+ ]);
60
+ addComponent({
61
+ name: "SpringValue",
62
+ filePath: "coily/vue",
63
+ export: "SpringValue",
64
+ chunkName: "placement"
65
+ });
66
+ }
67
+ });
68
+ //#endregion
69
+ export { coilyModule as default };