@shopify/klint 0.0.4 → 0.0.7

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.
@@ -728,4 +728,4 @@ interface KlintPlugins {
728
728
  Thing: Thing;
729
729
  }
730
730
 
731
- export { Color, Easing, KlintPlugins, SVGfont, State, Text, Thing, Time, Vector };
731
+ export { Color, Easing, type KlintPlugins, SVGfont, State, Text, Thing, Time, Vector };
@@ -386,8 +386,7 @@ var Easing = class {
386
386
  const m = val - 1;
387
387
  const t = val * 2;
388
388
  const k = 1.70158 * 1.525;
389
- if (val < 0.5)
390
- return val * t * (t * (k + 1) - k);
389
+ if (val < 0.5) return val * t * (t * (k + 1) - k);
391
390
  return 1 + 2 * m * m * (2 * m * (k + 1) + k);
392
391
  };
393
392
  this.bounceOut = (val) => {
@@ -417,8 +416,7 @@ var Easing = class {
417
416
  };
418
417
  this.bounceInOut = (val) => {
419
418
  const t = val * 2;
420
- if (t < 1)
421
- return 0.5 - 0.5 * this.bounceOut(1 - t);
419
+ if (t < 1) return 0.5 - 0.5 * this.bounceOut(1 - t);
422
420
  return 0.5 + 0.5 * this.bounceOut(t - 1);
423
421
  };
424
422
  this.elasticIn = (val) => {
@@ -431,8 +429,7 @@ var Easing = class {
431
429
  this.elasticInOut = (val) => {
432
430
  const s = 2 * val - 1;
433
431
  const k = (80 * s - 9) * Math.PI / 18;
434
- if (s < 0)
435
- return -0.5 * Math.pow(2, 10 * s) * Math.sin(k);
432
+ if (s < 0) return -0.5 * Math.pow(2, 10 * s) * Math.sin(k);
436
433
  return 1 + 0.5 * Math.pow(2, -10 * s) * Math.sin(k);
437
434
  };
438
435
  this.smoothstep = (val, x0 = 0, x1 = 1) => {
@@ -563,8 +560,7 @@ var SVGfont = class {
563
560
  const glyph = this.glyphs.get(char);
564
561
  if (glyph) {
565
562
  totalWidth += glyph.horizAdvX;
566
- if (i < chars.length - 1)
567
- totalWidth += letterSpacing;
563
+ if (i < chars.length - 1) totalWidth += letterSpacing;
568
564
  }
569
565
  });
570
566
  let currentX = 0;
@@ -589,8 +585,7 @@ var SVGfont = class {
589
585
  }
590
586
  for (const char of chars) {
591
587
  const glyph = this.glyphs.get(char);
592
- if (!glyph)
593
- continue;
588
+ if (!glyph) continue;
594
589
  if (!glyph.d) {
595
590
  currentX += glyph.horizAdvX + letterSpacing;
596
591
  continue;
@@ -599,8 +594,7 @@ var SVGfont = class {
599
594
  const subpaths = glyph.d.split(/(?=[Mm])/);
600
595
  const glyphContours = [];
601
596
  for (const subpath of subpaths) {
602
- if (!subpath.trim())
603
- continue;
597
+ if (!subpath.trim()) continue;
604
598
  path.setAttribute("d", subpath);
605
599
  const pathLength = path.getTotalLength();
606
600
  const numPoints = Math.max(10, Math.floor(pathLength * factor));
@@ -705,7 +699,7 @@ var State = class {
705
699
  var State_default = State;
706
700
 
707
701
  // src/plugins/Vector.tsx
708
- var Vector = class {
702
+ var Vector = class _Vector {
709
703
  /**
710
704
  * Creates a new Vector
711
705
  * @param x - X-coordinate (default: 0)
@@ -812,7 +806,7 @@ var Vector = class {
812
806
  * @returns A new Vector with the same coordinates
813
807
  */
814
808
  copy() {
815
- return new Vector(this.x, this.y);
809
+ return new _Vector(this.x, this.y);
816
810
  }
817
811
  /**
818
812
  * Normalizes this vector (sets its magnitude to 1)
@@ -843,7 +837,7 @@ var Vector = class {
843
837
  static fromAngle(center, a, r) {
844
838
  const x = Math.cos(a) * r + center.x;
845
839
  const y = Math.sin(a) * r + center.y;
846
- return new Vector(x, y);
840
+ return new _Vector(x, y);
847
841
  }
848
842
  };
849
843
  var Vector_default = Vector;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@shopify/klint",
3
3
  "author": "arthurcloche",
4
4
  "license": "MIT",
5
- "version": "0.0.4",
5
+ "version": "0.0.7",
6
6
  "description": "A modern creative coding library",
7
7
  "type": "module",
8
8
  "main": "dist/index.cjs",
@@ -20,6 +20,10 @@
20
20
  "type": "git",
21
21
  "url": "https://github.com/Shopify/Klint"
22
22
  },
23
+ "publishConfig": {
24
+ "access": "public",
25
+ "@shopify:registry": "https://registry.npmjs.org/"
26
+ },
23
27
  "files": [
24
28
  "dist"
25
29
  ],
@@ -70,11 +74,11 @@
70
74
  "concurrently": "^8.2.0",
71
75
  "jsdom": "^26.0.0",
72
76
  "rimraf": "^5.0.0",
73
- "tsup": "^6.7.0",
77
+ "tsup": "^8.4.0",
74
78
  "typescript": "^5.0.0",
75
79
  "vite": "^6.2.5",
76
80
  "vite-tsconfig-paths": "^5.1.4",
77
- "vitest": "^0.32.0",
81
+ "vitest": "^3.1.1",
78
82
  "vitest-canvas-mock": "^0.3.3"
79
83
  }
80
84
  }