coily 0.8.1 → 0.9.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/dist/api.cjs CHANGED
@@ -490,7 +490,7 @@ class Spring {
490
490
  set target(value) {
491
491
  if (value !== __privateGet$1(this, _target)) {
492
492
  if (__privateGet$1(this, _solver).position !== __privateGet$1(this, _solver).lazyPosition) {
493
- __privateGet$1(this, _solver).tick(0, false);
493
+ __privateGet$1(this, _solver).tick(0);
494
494
  }
495
495
  if (!__privateGet$1(this, _scheduler$1).has(__privateGet$1(this, _solver))) {
496
496
  __privateGet$1(this, _scheduler$1).add(__privateGet$1(this, _solver));
@@ -507,7 +507,7 @@ class Spring {
507
507
  const position = value - __privateGet$1(this, _target);
508
508
  if (position !== __privateGet$1(this, _solver).position) {
509
509
  if (__privateGet$1(this, _solver).position !== __privateGet$1(this, _solver).lazyPosition) {
510
- __privateGet$1(this, _solver).tick(0, false);
510
+ __privateGet$1(this, _solver).tick(0);
511
511
  }
512
512
  if (!__privateGet$1(this, _scheduler$1).has(__privateGet$1(this, _solver))) {
513
513
  __privateGet$1(this, _scheduler$1).add(__privateGet$1(this, _solver));
@@ -576,6 +576,12 @@ class Spring {
576
576
  onStop(callback) {
577
577
  return __privateGet$1(this, _solver).onStop(callback);
578
578
  }
579
+ jumpTo(value) {
580
+ __privateSet$1(this, _target, value);
581
+ __privateGet$1(this, _solver).position = 0;
582
+ __privateGet$1(this, _solver).velocity = 0;
583
+ __privateGet$1(this, _solver).tick(0);
584
+ }
579
585
  }
580
586
  _target = new WeakMap();
581
587
  _solver = new WeakMap();
package/dist/api.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { S as SpringSystem } from './shared/coily.fc8a32a3.cjs';
2
- export { a as Spring } from './shared/coily.fc8a32a3.cjs';
1
+ import { S as SpringSystem } from './shared/coily.0b4474af.cjs';
2
+ export { a as Spring } from './shared/coily.0b4474af.cjs';
3
3
 
4
4
  declare function createSpringSystem(): SpringSystem;
5
5
 
package/dist/api.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { S as SpringSystem } from './shared/coily.fc8a32a3.mjs';
2
- export { a as Spring } from './shared/coily.fc8a32a3.mjs';
1
+ import { S as SpringSystem } from './shared/coily.0b4474af.mjs';
2
+ export { a as Spring } from './shared/coily.0b4474af.mjs';
3
3
 
4
4
  declare function createSpringSystem(): SpringSystem;
5
5
 
package/dist/api.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { S as SpringSystem } from './shared/coily.fc8a32a3.js';
2
- export { a as Spring } from './shared/coily.fc8a32a3.js';
1
+ import { S as SpringSystem } from './shared/coily.0b4474af.js';
2
+ export { a as Spring } from './shared/coily.0b4474af.js';
3
3
 
4
4
  declare function createSpringSystem(): SpringSystem;
5
5
 
package/dist/api.mjs CHANGED
@@ -488,7 +488,7 @@ class Spring {
488
488
  set target(value) {
489
489
  if (value !== __privateGet$1(this, _target)) {
490
490
  if (__privateGet$1(this, _solver).position !== __privateGet$1(this, _solver).lazyPosition) {
491
- __privateGet$1(this, _solver).tick(0, false);
491
+ __privateGet$1(this, _solver).tick(0);
492
492
  }
493
493
  if (!__privateGet$1(this, _scheduler$1).has(__privateGet$1(this, _solver))) {
494
494
  __privateGet$1(this, _scheduler$1).add(__privateGet$1(this, _solver));
@@ -505,7 +505,7 @@ class Spring {
505
505
  const position = value - __privateGet$1(this, _target);
506
506
  if (position !== __privateGet$1(this, _solver).position) {
507
507
  if (__privateGet$1(this, _solver).position !== __privateGet$1(this, _solver).lazyPosition) {
508
- __privateGet$1(this, _solver).tick(0, false);
508
+ __privateGet$1(this, _solver).tick(0);
509
509
  }
510
510
  if (!__privateGet$1(this, _scheduler$1).has(__privateGet$1(this, _solver))) {
511
511
  __privateGet$1(this, _scheduler$1).add(__privateGet$1(this, _solver));
@@ -574,6 +574,12 @@ class Spring {
574
574
  onStop(callback) {
575
575
  return __privateGet$1(this, _solver).onStop(callback);
576
576
  }
577
+ jumpTo(value) {
578
+ __privateSet$1(this, _target, value);
579
+ __privateGet$1(this, _solver).position = 0;
580
+ __privateGet$1(this, _solver).velocity = 0;
581
+ __privateGet$1(this, _solver).tick(0);
582
+ }
577
583
  }
578
584
  _target = new WeakMap();
579
585
  _solver = new WeakMap();
package/dist/loop.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { S as SpringSystem } from './shared/coily.fc8a32a3.cjs';
1
+ import { S as SpringSystem } from './shared/coily.0b4474af.cjs';
2
2
 
3
3
  declare function start(system: SpringSystem): () => void;
4
4
 
package/dist/loop.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { S as SpringSystem } from './shared/coily.fc8a32a3.mjs';
1
+ import { S as SpringSystem } from './shared/coily.0b4474af.mjs';
2
2
 
3
3
  declare function start(system: SpringSystem): () => void;
4
4
 
package/dist/loop.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { S as SpringSystem } from './shared/coily.fc8a32a3.js';
1
+ import { S as SpringSystem } from './shared/coily.0b4474af.js';
2
2
 
3
3
  declare function start(system: SpringSystem): () => void;
4
4
 
@@ -69,6 +69,7 @@ declare class Spring {
69
69
  onUpdate(callback: () => void): () => void;
70
70
  onStart(callback: () => void): () => void;
71
71
  onStop(callback: () => void): () => void;
72
+ jumpTo(value: number): void;
72
73
  }
73
74
 
74
75
  interface SpringOptions {
@@ -69,6 +69,7 @@ declare class Spring {
69
69
  onUpdate(callback: () => void): () => void;
70
70
  onStart(callback: () => void): () => void;
71
71
  onStop(callback: () => void): () => void;
72
+ jumpTo(value: number): void;
72
73
  }
73
74
 
74
75
  interface SpringOptions {
@@ -69,6 +69,7 @@ declare class Spring {
69
69
  onUpdate(callback: () => void): () => void;
70
70
  onStart(callback: () => void): () => void;
71
71
  onStop(callback: () => void): () => void;
72
+ jumpTo(value: number): void;
72
73
  }
73
74
 
74
75
  interface SpringOptions {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coily",
3
- "version": "0.8.1",
3
+ "version": "0.9.0",
4
4
  "description": "Simulate values using spring physics",
5
5
  "author": "Tim Morris <timthewebguy@gmail.com>",
6
6
  "homepage": "https://github.com/tkofh/coily#readme",