@sarmal/core 0.12.0 → 0.13.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 +114 -82
  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 +113 -81
  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 +135 -87
  52. package/dist/index.cjs.map +1 -1
  53. package/dist/index.d.cts +69 -34
  54. package/dist/index.d.ts +69 -34
  55. package/dist/index.js +152 -87
  56. package/dist/index.js.map +1 -1
  57. package/dist/types-BW0bpL1Z.d.cts +290 -0
  58. package/dist/types-BW0bpL1Z.d.ts +290 -0
  59. package/package.json +1 -1
  60. package/dist/types-BzgdhxE0.d.cts +0 -260
  61. package/dist/types-BzgdhxE0.d.ts +0 -260
package/dist/index.d.ts CHANGED
@@ -1,35 +1,40 @@
1
- import { E as Engine, S as SarmalInstance, C as CurveDef, R as RendererOptions, a as SarmalOptions } from './types-BzgdhxE0.js';
2
- export { J as JumpOptions, P as PalettePreset, b as Point, c as SeekOptions, T as TrailStyle } from './types-BzgdhxE0.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-BW0bpL1Z.js";
9
+ export {
10
+ J as JumpOptions,
11
+ P as PalettePreset,
12
+ b as Point,
13
+ c as SeekOptions,
14
+ T as TrailStyle,
15
+ } from "./types-BW0bpL1Z.js";
16
+ export { CurveName, curves } from "./curves/index.js";
17
+ export { artemis2 } from "./curves/artemis2.js";
18
+ export { astroid } from "./curves/astroid.js";
19
+ export { deltoid } from "./curves/deltoid.js";
20
+ export { epicycloid3 } from "./curves/epicycloid3.js";
21
+ export { epitrochoid7 } from "./curves/epitrochoid7.js";
22
+ export { lame } from "./curves/lame.js";
23
+ export { lissajous32 } from "./curves/lissajous32.js";
24
+ export { lissajous43 } from "./curves/lissajous43.js";
25
+ export { rose3 } from "./curves/rose3.js";
26
+ export { rose5 } from "./curves/rose5.js";
14
27
 
15
- interface SVGRendererOptions {
16
- /** Container element that will contain the SVG */
17
- container: Element;
18
- engine: Engine;
19
- /** @default '#ffffff' */
20
- skeletonColor?: string;
21
- /** @default '#ffffff' */
22
- trailColor?: string;
23
- /** @default '#ffffff' */
24
- headColor?: string;
25
- /** @default 4 */
26
- headRadius?: number;
27
- /** @default 'Loading' */
28
- ariaLabel?: string;
28
+ interface SVGRendererOptions extends BaseRendererOptions {
29
+ /** Container element that will contain the SVG */
30
+ container: Element;
31
+ engine: Engine;
32
+ /** @default 'Loading' */
33
+ ariaLabel?: string;
29
34
  }
30
35
  interface SVGSarmalOptions extends Omit<SVGRendererOptions, "container" | "engine"> {
31
- /** @default 120 */
32
- trailLength?: number;
36
+ /** @default 120 */
37
+ trailLength?: number;
33
38
  }
34
39
  /**
35
40
  * Creates a live SVG renderer for sarmal animations
@@ -44,10 +49,18 @@ declare function createSVGRenderer(options: SVGRendererOptions): SarmalInstance;
44
49
  * ```ts
45
50
  * import { createSarmalSVG, curves } from '@sarmal/core'
46
51
  * const sarmal = createSarmalSVG(document.getElementById('spinner'), curves.epitrochoid7)
47
- * sarmal.start()
52
+ *
53
+ * // To control manually, use autoStart: false
54
+ * const controlled = createSarmalSVG(container, curves.artemis2, { autoStart: false })
55
+ * controlled.play() // Start when ready
56
+ * controlled.pause() // Pause later
48
57
  * ```
49
58
  */
50
- declare function createSarmalSVG(container: Element, curveDef: CurveDef, options?: SVGSarmalOptions): SarmalInstance;
59
+ declare function createSarmalSVG(
60
+ container: Element,
61
+ curveDef: CurveDef,
62
+ options?: SVGSarmalOptions,
63
+ ): SarmalInstance;
51
64
 
52
65
  declare function createEngine(curveDef: CurveDef, trailLength?: number): Engine;
53
66
 
@@ -64,9 +77,31 @@ declare function createRenderer(options: RendererOptions): SarmalInstance;
64
77
  * ```ts
65
78
  * import { createSarmal, curves } from '@sarmal/core'
66
79
  * const sarmal = createSarmal(canvas, curves.artemis2)
67
- * sarmal.start()
80
+ *
81
+ * // To control manually, use autoStart: false
82
+ * const controlled = createSarmal(canvas, curves.artemis2, { autoStart: false })
83
+ * controlled.play() // Start when ready
84
+ * controlled.pause() // Pause later
68
85
  * ```
69
86
  */
70
- declare function createSarmal(canvas: HTMLCanvasElement, curveDef: CurveDef, options?: SarmalOptions): SarmalInstance;
87
+ declare function createSarmal(
88
+ canvas: HTMLCanvasElement,
89
+ curveDef: CurveDef,
90
+ options?: SarmalOptions,
91
+ ): SarmalInstance;
71
92
 
72
- export { CurveDef, Engine, RendererOptions, type SVGRendererOptions, type SVGSarmalOptions, SarmalInstance, SarmalOptions, createEngine, createRenderer, createSVGRenderer, createSarmal, createSarmalSVG };
93
+ export {
94
+ BaseRendererOptions,
95
+ CurveDef,
96
+ Engine,
97
+ RendererOptions,
98
+ type SVGRendererOptions,
99
+ type SVGSarmalOptions,
100
+ SarmalInstance,
101
+ SarmalOptions,
102
+ createEngine,
103
+ createRenderer,
104
+ createSVGRenderer,
105
+ createSarmal,
106
+ createSarmalSVG,
107
+ };