@sarmal/core 0.14.0 → 0.15.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.
Files changed (61) hide show
  1. package/dist/auto-init.cjs +239 -115
  2. package/dist/auto-init.cjs.map +1 -1
  3. package/dist/auto-init.d.cts +1 -2
  4. package/dist/auto-init.d.ts +1 -2
  5. package/dist/auto-init.js +238 -114
  6. package/dist/auto-init.js.map +1 -1
  7. package/dist/curves/artemis2.cjs +10 -7
  8. package/dist/curves/artemis2.d.cts +1 -1
  9. package/dist/curves/artemis2.d.ts +1 -1
  10. package/dist/curves/artemis2.js +9 -6
  11. package/dist/curves/astroid.cjs +4 -4
  12. package/dist/curves/astroid.d.cts +1 -1
  13. package/dist/curves/astroid.d.ts +1 -1
  14. package/dist/curves/astroid.js +3 -3
  15. package/dist/curves/deltoid.cjs +4 -4
  16. package/dist/curves/deltoid.d.cts +1 -1
  17. package/dist/curves/deltoid.d.ts +1 -1
  18. package/dist/curves/deltoid.js +3 -3
  19. package/dist/curves/epicycloid3.cjs +4 -4
  20. package/dist/curves/epicycloid3.d.cts +1 -1
  21. package/dist/curves/epicycloid3.d.ts +1 -1
  22. package/dist/curves/epicycloid3.js +3 -3
  23. package/dist/curves/epitrochoid7.cjs +5 -5
  24. package/dist/curves/epitrochoid7.d.cts +1 -1
  25. package/dist/curves/epitrochoid7.d.ts +1 -1
  26. package/dist/curves/epitrochoid7.js +4 -4
  27. package/dist/curves/index.cjs +32 -28
  28. package/dist/curves/index.d.cts +21 -21
  29. package/dist/curves/index.d.ts +21 -21
  30. package/dist/curves/index.js +44 -28
  31. package/dist/curves/lame.cjs +6 -5
  32. package/dist/curves/lame.d.cts +1 -1
  33. package/dist/curves/lame.d.ts +1 -1
  34. package/dist/curves/lame.js +5 -4
  35. package/dist/curves/lissajous32.cjs +4 -4
  36. package/dist/curves/lissajous32.d.cts +1 -1
  37. package/dist/curves/lissajous32.d.ts +1 -1
  38. package/dist/curves/lissajous32.js +3 -3
  39. package/dist/curves/lissajous43.cjs +4 -4
  40. package/dist/curves/lissajous43.d.cts +1 -1
  41. package/dist/curves/lissajous43.d.ts +1 -1
  42. package/dist/curves/lissajous43.js +3 -3
  43. package/dist/curves/rose3.cjs +4 -4
  44. package/dist/curves/rose3.d.cts +1 -1
  45. package/dist/curves/rose3.d.ts +1 -1
  46. package/dist/curves/rose3.js +3 -3
  47. package/dist/curves/rose5.cjs +4 -4
  48. package/dist/curves/rose5.d.cts +1 -1
  49. package/dist/curves/rose5.d.ts +1 -1
  50. package/dist/curves/rose5.js +3 -3
  51. package/dist/index.cjs +303 -123
  52. package/dist/index.cjs.map +1 -1
  53. package/dist/index.d.cts +73 -23
  54. package/dist/index.d.ts +73 -23
  55. package/dist/index.js +320 -123
  56. package/dist/index.js.map +1 -1
  57. package/dist/types-BL9HhEmk.d.cts +312 -0
  58. package/dist/types-BL9HhEmk.d.ts +312 -0
  59. package/package.json +1 -1
  60. package/dist/types-BQosOzlf.d.cts +0 -276
  61. package/dist/types-BQosOzlf.d.ts +0 -276
package/dist/index.d.cts CHANGED
@@ -1,27 +1,41 @@
1
- import { B as BaseRendererOptions, E as Engine, S as SarmalInstance, C as CurveDef, R as RendererOptions, a as SarmalOptions } from './types-BQosOzlf.cjs';
2
- export { J as JumpOptions, P as PalettePreset, b as Point, c as SeekOptions, T as TrailStyle } from './types-BQosOzlf.cjs';
3
- export { CurveName, curves } from './curves/index.cjs';
4
- export { artemis2 } from './curves/artemis2.cjs';
5
- export { astroid } from './curves/astroid.cjs';
6
- export { deltoid } from './curves/deltoid.cjs';
7
- export { epicycloid3 } from './curves/epicycloid3.cjs';
8
- export { epitrochoid7 } from './curves/epitrochoid7.cjs';
9
- export { lame } from './curves/lame.cjs';
10
- export { lissajous32 } from './curves/lissajous32.cjs';
11
- export { lissajous43 } from './curves/lissajous43.cjs';
12
- export { rose3 } from './curves/rose3.cjs';
13
- export { rose5 } from './curves/rose5.cjs';
1
+ import {
2
+ B as BaseRendererOptions,
3
+ E as Engine,
4
+ S as SarmalInstance,
5
+ C as CurveDef,
6
+ R as RendererOptions,
7
+ a as SarmalOptions,
8
+ } from "./types-BL9HhEmk.cjs";
9
+ export {
10
+ J as JumpOptions,
11
+ P as Point,
12
+ b as RuntimeRenderOptions,
13
+ c as SeekOptions,
14
+ T as TrailColor,
15
+ d as TrailStyle,
16
+ } from "./types-BL9HhEmk.cjs";
17
+ export { CurveName, curves } from "./curves/index.cjs";
18
+ export { artemis2 } from "./curves/artemis2.cjs";
19
+ export { astroid } from "./curves/astroid.cjs";
20
+ export { deltoid } from "./curves/deltoid.cjs";
21
+ export { epicycloid3 } from "./curves/epicycloid3.cjs";
22
+ export { epitrochoid7 } from "./curves/epitrochoid7.cjs";
23
+ export { lame } from "./curves/lame.cjs";
24
+ export { lissajous32 } from "./curves/lissajous32.cjs";
25
+ export { lissajous43 } from "./curves/lissajous43.cjs";
26
+ export { rose3 } from "./curves/rose3.cjs";
27
+ export { rose5 } from "./curves/rose5.cjs";
14
28
 
15
29
  interface SVGRendererOptions extends BaseRendererOptions {
16
- /** Container element that will contain the SVG */
17
- container: Element;
18
- engine: Engine;
19
- /** @default 'Loading' */
20
- ariaLabel?: string;
30
+ /** Container element that will contain the SVG */
31
+ container: Element;
32
+ engine: Engine;
33
+ /** @default 'Loading' */
34
+ ariaLabel?: string;
21
35
  }
22
36
  interface SVGSarmalOptions extends Omit<SVGRendererOptions, "container" | "engine"> {
23
- /** @default 120 */
24
- trailLength?: number;
37
+ /** @default 120 */
38
+ trailLength?: number;
25
39
  }
26
40
  /**
27
41
  * Creates a live SVG renderer for sarmal animations
@@ -43,10 +57,27 @@ declare function createSVGRenderer(options: SVGRendererOptions): SarmalInstance;
43
57
  * controlled.pause() // Pause later
44
58
  * ```
45
59
  */
46
- declare function createSarmalSVG(container: Element, curveDef: CurveDef, options?: SVGSarmalOptions): SarmalInstance;
60
+ declare function createSarmalSVG(
61
+ container: Element,
62
+ curveDef: CurveDef,
63
+ options?: SVGSarmalOptions,
64
+ ): SarmalInstance;
47
65
 
48
66
  declare function createEngine(curveDef: CurveDef, trailLength?: number): Engine;
49
67
 
68
+ /**
69
+ * Can be passed directly to `trailColor`,
70
+ * or can be mixed/sliced before passing as a prop.
71
+ */
72
+ declare const palettes: {
73
+ readonly bard: ["#a855f7", "#3b82f6", "#14b8a6", "#ec4899"];
74
+ readonly sunset: ["#f97316", "#dc2626", "#9333ea", "#f472b6"];
75
+ readonly ocean: ["#1e3a8a", "#06b6d4", "#22d3ee", "#e0f2fe"];
76
+ readonly ice: ["#1e3a8a", "#67e8f9"];
77
+ readonly fire: ["#7f1d1d", "#fbbf24"];
78
+ readonly forest: ["#14532d", "#86efac"];
79
+ };
80
+
50
81
  /**
51
82
  * Creates a Canvas 2D renderer for sarmal animations
52
83
  * Renders the skeleton and the trail
@@ -67,6 +98,25 @@ declare function createRenderer(options: RendererOptions): SarmalInstance;
67
98
  * controlled.pause() // Pause later
68
99
  * ```
69
100
  */
70
- declare function createSarmal(canvas: HTMLCanvasElement, curveDef: CurveDef, options?: SarmalOptions): SarmalInstance;
101
+ declare function createSarmal(
102
+ canvas: HTMLCanvasElement,
103
+ curveDef: CurveDef,
104
+ options?: SarmalOptions,
105
+ ): SarmalInstance;
71
106
 
72
- export { BaseRendererOptions, CurveDef, Engine, RendererOptions, type SVGRendererOptions, type SVGSarmalOptions, SarmalInstance, SarmalOptions, createEngine, createRenderer, createSVGRenderer, createSarmal, createSarmalSVG };
107
+ export {
108
+ BaseRendererOptions,
109
+ CurveDef,
110
+ Engine,
111
+ RendererOptions,
112
+ type SVGRendererOptions,
113
+ type SVGSarmalOptions,
114
+ SarmalInstance,
115
+ SarmalOptions,
116
+ createEngine,
117
+ createRenderer,
118
+ createSVGRenderer,
119
+ createSarmal,
120
+ createSarmalSVG,
121
+ palettes,
122
+ };
package/dist/index.d.ts CHANGED
@@ -1,27 +1,41 @@
1
- import { B as BaseRendererOptions, E as Engine, S as SarmalInstance, C as CurveDef, R as RendererOptions, a as SarmalOptions } from './types-BQosOzlf.js';
2
- export { J as JumpOptions, P as PalettePreset, b as Point, c as SeekOptions, T as TrailStyle } from './types-BQosOzlf.js';
3
- export { CurveName, curves } from './curves/index.js';
4
- export { artemis2 } from './curves/artemis2.js';
5
- export { astroid } from './curves/astroid.js';
6
- export { deltoid } from './curves/deltoid.js';
7
- export { epicycloid3 } from './curves/epicycloid3.js';
8
- export { epitrochoid7 } from './curves/epitrochoid7.js';
9
- export { lame } from './curves/lame.js';
10
- export { lissajous32 } from './curves/lissajous32.js';
11
- export { lissajous43 } from './curves/lissajous43.js';
12
- export { rose3 } from './curves/rose3.js';
13
- export { rose5 } from './curves/rose5.js';
1
+ import {
2
+ B as BaseRendererOptions,
3
+ E as Engine,
4
+ S as SarmalInstance,
5
+ C as CurveDef,
6
+ R as RendererOptions,
7
+ a as SarmalOptions,
8
+ } from "./types-BL9HhEmk.js";
9
+ export {
10
+ J as JumpOptions,
11
+ P as Point,
12
+ b as RuntimeRenderOptions,
13
+ c as SeekOptions,
14
+ T as TrailColor,
15
+ d as TrailStyle,
16
+ } from "./types-BL9HhEmk.js";
17
+ export { CurveName, curves } from "./curves/index.js";
18
+ export { artemis2 } from "./curves/artemis2.js";
19
+ export { astroid } from "./curves/astroid.js";
20
+ export { deltoid } from "./curves/deltoid.js";
21
+ export { epicycloid3 } from "./curves/epicycloid3.js";
22
+ export { epitrochoid7 } from "./curves/epitrochoid7.js";
23
+ export { lame } from "./curves/lame.js";
24
+ export { lissajous32 } from "./curves/lissajous32.js";
25
+ export { lissajous43 } from "./curves/lissajous43.js";
26
+ export { rose3 } from "./curves/rose3.js";
27
+ export { rose5 } from "./curves/rose5.js";
14
28
 
15
29
  interface SVGRendererOptions extends BaseRendererOptions {
16
- /** Container element that will contain the SVG */
17
- container: Element;
18
- engine: Engine;
19
- /** @default 'Loading' */
20
- ariaLabel?: string;
30
+ /** Container element that will contain the SVG */
31
+ container: Element;
32
+ engine: Engine;
33
+ /** @default 'Loading' */
34
+ ariaLabel?: string;
21
35
  }
22
36
  interface SVGSarmalOptions extends Omit<SVGRendererOptions, "container" | "engine"> {
23
- /** @default 120 */
24
- trailLength?: number;
37
+ /** @default 120 */
38
+ trailLength?: number;
25
39
  }
26
40
  /**
27
41
  * Creates a live SVG renderer for sarmal animations
@@ -43,10 +57,27 @@ declare function createSVGRenderer(options: SVGRendererOptions): SarmalInstance;
43
57
  * controlled.pause() // Pause later
44
58
  * ```
45
59
  */
46
- declare function createSarmalSVG(container: Element, curveDef: CurveDef, options?: SVGSarmalOptions): SarmalInstance;
60
+ declare function createSarmalSVG(
61
+ container: Element,
62
+ curveDef: CurveDef,
63
+ options?: SVGSarmalOptions,
64
+ ): SarmalInstance;
47
65
 
48
66
  declare function createEngine(curveDef: CurveDef, trailLength?: number): Engine;
49
67
 
68
+ /**
69
+ * Can be passed directly to `trailColor`,
70
+ * or can be mixed/sliced before passing as a prop.
71
+ */
72
+ declare const palettes: {
73
+ readonly bard: ["#a855f7", "#3b82f6", "#14b8a6", "#ec4899"];
74
+ readonly sunset: ["#f97316", "#dc2626", "#9333ea", "#f472b6"];
75
+ readonly ocean: ["#1e3a8a", "#06b6d4", "#22d3ee", "#e0f2fe"];
76
+ readonly ice: ["#1e3a8a", "#67e8f9"];
77
+ readonly fire: ["#7f1d1d", "#fbbf24"];
78
+ readonly forest: ["#14532d", "#86efac"];
79
+ };
80
+
50
81
  /**
51
82
  * Creates a Canvas 2D renderer for sarmal animations
52
83
  * Renders the skeleton and the trail
@@ -67,6 +98,25 @@ declare function createRenderer(options: RendererOptions): SarmalInstance;
67
98
  * controlled.pause() // Pause later
68
99
  * ```
69
100
  */
70
- declare function createSarmal(canvas: HTMLCanvasElement, curveDef: CurveDef, options?: SarmalOptions): SarmalInstance;
101
+ declare function createSarmal(
102
+ canvas: HTMLCanvasElement,
103
+ curveDef: CurveDef,
104
+ options?: SarmalOptions,
105
+ ): SarmalInstance;
71
106
 
72
- export { BaseRendererOptions, CurveDef, Engine, RendererOptions, type SVGRendererOptions, type SVGSarmalOptions, SarmalInstance, SarmalOptions, createEngine, createRenderer, createSVGRenderer, createSarmal, createSarmalSVG };
107
+ export {
108
+ BaseRendererOptions,
109
+ CurveDef,
110
+ Engine,
111
+ RendererOptions,
112
+ type SVGRendererOptions,
113
+ type SVGSarmalOptions,
114
+ SarmalInstance,
115
+ SarmalOptions,
116
+ createEngine,
117
+ createRenderer,
118
+ createSVGRenderer,
119
+ createSarmal,
120
+ createSarmalSVG,
121
+ palettes,
122
+ };