@sarmal/core 0.16.0 → 0.17.1

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 (84) hide show
  1. package/README.md +4 -4
  2. package/dist/auto-init.cjs +145 -89
  3. package/dist/auto-init.cjs.map +1 -1
  4. package/dist/auto-init.js +144 -88
  5. package/dist/auto-init.js.map +1 -1
  6. package/dist/curves/artemis2.cjs +7 -10
  7. package/dist/curves/artemis2.d.cts +1 -1
  8. package/dist/curves/artemis2.d.ts +1 -1
  9. package/dist/curves/artemis2.js +6 -9
  10. package/dist/curves/astroid.cjs +4 -4
  11. package/dist/curves/astroid.d.cts +1 -1
  12. package/dist/curves/astroid.d.ts +1 -1
  13. package/dist/curves/astroid.js +3 -3
  14. package/dist/curves/deltoid.cjs +4 -4
  15. package/dist/curves/deltoid.d.cts +1 -1
  16. package/dist/curves/deltoid.d.ts +1 -1
  17. package/dist/curves/deltoid.js +3 -3
  18. package/dist/curves/epicycloid3.cjs +4 -4
  19. package/dist/curves/epicycloid3.d.cts +1 -1
  20. package/dist/curves/epicycloid3.d.ts +1 -1
  21. package/dist/curves/epicycloid3.js +3 -3
  22. package/dist/curves/epitrochoid7.cjs +5 -5
  23. package/dist/curves/epitrochoid7.d.cts +1 -1
  24. package/dist/curves/epitrochoid7.d.ts +1 -1
  25. package/dist/curves/epitrochoid7.js +4 -4
  26. package/dist/curves/index.cjs +101 -33
  27. package/dist/curves/index.cjs.map +1 -1
  28. package/dist/curves/index.d.cts +29 -21
  29. package/dist/curves/index.d.ts +29 -21
  30. package/dist/curves/index.js +97 -45
  31. package/dist/curves/index.js.map +1 -1
  32. package/dist/curves/lame.cjs +5 -6
  33. package/dist/curves/lame.d.cts +1 -1
  34. package/dist/curves/lame.d.ts +1 -1
  35. package/dist/curves/lame.js +4 -5
  36. package/dist/curves/lissajous32.cjs +4 -4
  37. package/dist/curves/lissajous32.d.cts +1 -1
  38. package/dist/curves/lissajous32.d.ts +1 -1
  39. package/dist/curves/lissajous32.js +3 -3
  40. package/dist/curves/lissajous43.cjs +4 -4
  41. package/dist/curves/lissajous43.d.cts +1 -1
  42. package/dist/curves/lissajous43.d.ts +1 -1
  43. package/dist/curves/lissajous43.js +3 -3
  44. package/dist/curves/rose3.cjs +4 -4
  45. package/dist/curves/rose3.d.cts +1 -1
  46. package/dist/curves/rose3.d.ts +1 -1
  47. package/dist/curves/rose3.js +3 -3
  48. package/dist/curves/rose5.cjs +4 -4
  49. package/dist/curves/rose5.d.cts +1 -1
  50. package/dist/curves/rose5.d.ts +1 -1
  51. package/dist/curves/rose5.js +3 -3
  52. package/dist/curves/rose52.cjs +21 -0
  53. package/dist/curves/rose52.cjs.map +1 -0
  54. package/dist/curves/rose52.d.cts +9 -0
  55. package/dist/curves/rose52.d.ts +9 -0
  56. package/dist/curves/rose52.js +19 -0
  57. package/dist/curves/rose52.js.map +1 -0
  58. package/dist/curves/star.cjs +21 -0
  59. package/dist/curves/star.cjs.map +1 -0
  60. package/dist/curves/star.d.cts +8 -0
  61. package/dist/curves/star.d.ts +8 -0
  62. package/dist/curves/star.js +19 -0
  63. package/dist/curves/star.js.map +1 -0
  64. package/dist/curves/star4.cjs +21 -0
  65. package/dist/curves/star4.cjs.map +1 -0
  66. package/dist/curves/star4.d.cts +9 -0
  67. package/dist/curves/star4.d.ts +9 -0
  68. package/dist/curves/star4.js +19 -0
  69. package/dist/curves/star4.js.map +1 -0
  70. package/dist/curves/star7.cjs +21 -0
  71. package/dist/curves/star7.cjs.map +1 -0
  72. package/dist/curves/star7.d.cts +9 -0
  73. package/dist/curves/star7.d.ts +9 -0
  74. package/dist/curves/star7.js +19 -0
  75. package/dist/curves/star7.js.map +1 -0
  76. package/dist/index.cjs +139 -85
  77. package/dist/index.cjs.map +1 -1
  78. package/dist/index.d.cts +39 -72
  79. package/dist/index.d.ts +39 -72
  80. package/dist/index.js +139 -103
  81. package/dist/index.js.map +1 -1
  82. package/dist/types-BL9HhEmk.d.cts +246 -259
  83. package/dist/types-BL9HhEmk.d.ts +246 -259
  84. package/package.json +1 -1
package/dist/index.d.cts CHANGED
@@ -1,41 +1,31 @@
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";
1
+ import { B as BaseRendererOptions, E as Engine, S as SarmalInstance, C as CurveDef, R as RendererOptions, a as SarmalOptions } from './types-BL9HhEmk.cjs';
2
+ export { J as JumpOptions, P as Point, b as RuntimeRenderOptions, c as SeekOptions, T as TrailColor, d as TrailStyle } from './types-BL9HhEmk.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';
14
+ import './curves/rose52.cjs';
15
+ import './curves/star.cjs';
16
+ import './curves/star4.cjs';
17
+ import './curves/star7.cjs';
28
18
 
29
19
  interface SVGRendererOptions extends BaseRendererOptions {
30
- /** Container element that will contain the SVG */
31
- container: Element;
32
- engine: Engine;
33
- /** @default 'Loading' */
34
- ariaLabel?: string;
20
+ /** Container element that will contain the SVG */
21
+ container: Element;
22
+ engine: Engine;
23
+ /** @default 'Loading' */
24
+ ariaLabel?: string;
35
25
  }
36
26
  interface SVGSarmalOptions extends Omit<SVGRendererOptions, "container" | "engine"> {
37
- /** @default 120 */
38
- trailLength?: number;
27
+ /** @default 120 */
28
+ trailLength?: number;
39
29
  }
40
30
  /**
41
31
  * Creates a live SVG renderer for sarmal animations
@@ -48,20 +38,16 @@ declare function createSVGRenderer(options: SVGRendererOptions): SarmalInstance;
48
38
  *
49
39
  * @example
50
40
  * ```ts
51
- * import { createSarmalSVG, curves } from '@sarmal/core'
52
- * const sarmal = createSarmalSVG(document.getElementById('spinner'), curves.epitrochoid7)
41
+ * import { createSarmalSVG, epitrochoid7 } from '@sarmal/core'
42
+ * const sarmal = createSarmalSVG(document.getElementById('spinner'), epitrochoid7)
53
43
  *
54
44
  * // To control manually, use autoStart: false
55
- * const controlled = createSarmalSVG(container, curves.artemis2, { autoStart: false })
45
+ * const controlled = createSarmalSVG(container, rose5, { autoStart: false })
56
46
  * controlled.play() // Start when ready
57
47
  * controlled.pause() // Pause later
58
48
  * ```
59
49
  */
60
- declare function createSarmalSVG(
61
- container: Element,
62
- curveDef: CurveDef,
63
- options?: SVGSarmalOptions,
64
- ): SarmalInstance;
50
+ declare function createSarmalSVG(container: Element, curveDef: CurveDef, options?: SVGSarmalOptions): SarmalInstance;
65
51
 
66
52
  declare function createEngine(curveDef: CurveDef, trailLength?: number): Engine;
67
53
 
@@ -70,12 +56,12 @@ declare function createEngine(curveDef: CurveDef, trailLength?: number): Engine;
70
56
  * or can be mixed/sliced before passing as a prop.
71
57
  */
72
58
  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"];
59
+ readonly bard: ["#a855f7", "#3b82f6", "#14b8a6", "#ec4899"];
60
+ readonly sunset: ["#f97316", "#dc2626", "#9333ea", "#f472b6"];
61
+ readonly ocean: ["#1e3a8a", "#06b6d4", "#22d3ee", "#e0f2fe"];
62
+ readonly ice: ["#1e3a8a", "#67e8f9"];
63
+ readonly fire: ["#7f1d1d", "#fbbf24"];
64
+ readonly forest: ["#14532d", "#86efac"];
79
65
  };
80
66
 
81
67
  /**
@@ -89,34 +75,15 @@ declare function createRenderer(options: RendererOptions): SarmalInstance;
89
75
  *
90
76
  * @example
91
77
  * ```ts
92
- * import { createSarmal, curves } from '@sarmal/core'
93
- * const sarmal = createSarmal(canvas, curves.artemis2)
78
+ * import { createSarmal, rose3 } from '@sarmal/core'
79
+ * const sarmal = createSarmal(canvas, rose3)
94
80
  *
95
81
  * // To control manually, use autoStart: false
96
- * const controlled = createSarmal(canvas, curves.artemis2, { autoStart: false })
82
+ * const controlled = createSarmal(canvas, rose3, { autoStart: false })
97
83
  * controlled.play() // Start when ready
98
84
  * controlled.pause() // Pause later
99
85
  * ```
100
86
  */
101
- declare function createSarmal(
102
- canvas: HTMLCanvasElement,
103
- curveDef: CurveDef,
104
- options?: SarmalOptions,
105
- ): SarmalInstance;
87
+ declare function createSarmal(canvas: HTMLCanvasElement, curveDef: CurveDef, options?: SarmalOptions): SarmalInstance;
106
88
 
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
- };
89
+ export { BaseRendererOptions, CurveDef, Engine, RendererOptions, type SVGRendererOptions, type SVGSarmalOptions, SarmalInstance, SarmalOptions, createEngine, createRenderer, createSVGRenderer, createSarmal, createSarmalSVG, palettes };
package/dist/index.d.ts CHANGED
@@ -1,41 +1,31 @@
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";
1
+ import { B as BaseRendererOptions, E as Engine, S as SarmalInstance, C as CurveDef, R as RendererOptions, a as SarmalOptions } from './types-BL9HhEmk.js';
2
+ export { J as JumpOptions, P as Point, b as RuntimeRenderOptions, c as SeekOptions, T as TrailColor, d as TrailStyle } from './types-BL9HhEmk.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';
14
+ import './curves/rose52.js';
15
+ import './curves/star.js';
16
+ import './curves/star4.js';
17
+ import './curves/star7.js';
28
18
 
29
19
  interface SVGRendererOptions extends BaseRendererOptions {
30
- /** Container element that will contain the SVG */
31
- container: Element;
32
- engine: Engine;
33
- /** @default 'Loading' */
34
- ariaLabel?: string;
20
+ /** Container element that will contain the SVG */
21
+ container: Element;
22
+ engine: Engine;
23
+ /** @default 'Loading' */
24
+ ariaLabel?: string;
35
25
  }
36
26
  interface SVGSarmalOptions extends Omit<SVGRendererOptions, "container" | "engine"> {
37
- /** @default 120 */
38
- trailLength?: number;
27
+ /** @default 120 */
28
+ trailLength?: number;
39
29
  }
40
30
  /**
41
31
  * Creates a live SVG renderer for sarmal animations
@@ -48,20 +38,16 @@ declare function createSVGRenderer(options: SVGRendererOptions): SarmalInstance;
48
38
  *
49
39
  * @example
50
40
  * ```ts
51
- * import { createSarmalSVG, curves } from '@sarmal/core'
52
- * const sarmal = createSarmalSVG(document.getElementById('spinner'), curves.epitrochoid7)
41
+ * import { createSarmalSVG, epitrochoid7 } from '@sarmal/core'
42
+ * const sarmal = createSarmalSVG(document.getElementById('spinner'), epitrochoid7)
53
43
  *
54
44
  * // To control manually, use autoStart: false
55
- * const controlled = createSarmalSVG(container, curves.artemis2, { autoStart: false })
45
+ * const controlled = createSarmalSVG(container, rose5, { autoStart: false })
56
46
  * controlled.play() // Start when ready
57
47
  * controlled.pause() // Pause later
58
48
  * ```
59
49
  */
60
- declare function createSarmalSVG(
61
- container: Element,
62
- curveDef: CurveDef,
63
- options?: SVGSarmalOptions,
64
- ): SarmalInstance;
50
+ declare function createSarmalSVG(container: Element, curveDef: CurveDef, options?: SVGSarmalOptions): SarmalInstance;
65
51
 
66
52
  declare function createEngine(curveDef: CurveDef, trailLength?: number): Engine;
67
53
 
@@ -70,12 +56,12 @@ declare function createEngine(curveDef: CurveDef, trailLength?: number): Engine;
70
56
  * or can be mixed/sliced before passing as a prop.
71
57
  */
72
58
  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"];
59
+ readonly bard: ["#a855f7", "#3b82f6", "#14b8a6", "#ec4899"];
60
+ readonly sunset: ["#f97316", "#dc2626", "#9333ea", "#f472b6"];
61
+ readonly ocean: ["#1e3a8a", "#06b6d4", "#22d3ee", "#e0f2fe"];
62
+ readonly ice: ["#1e3a8a", "#67e8f9"];
63
+ readonly fire: ["#7f1d1d", "#fbbf24"];
64
+ readonly forest: ["#14532d", "#86efac"];
79
65
  };
80
66
 
81
67
  /**
@@ -89,34 +75,15 @@ declare function createRenderer(options: RendererOptions): SarmalInstance;
89
75
  *
90
76
  * @example
91
77
  * ```ts
92
- * import { createSarmal, curves } from '@sarmal/core'
93
- * const sarmal = createSarmal(canvas, curves.artemis2)
78
+ * import { createSarmal, rose3 } from '@sarmal/core'
79
+ * const sarmal = createSarmal(canvas, rose3)
94
80
  *
95
81
  * // To control manually, use autoStart: false
96
- * const controlled = createSarmal(canvas, curves.artemis2, { autoStart: false })
82
+ * const controlled = createSarmal(canvas, rose3, { autoStart: false })
97
83
  * controlled.play() // Start when ready
98
84
  * controlled.pause() // Pause later
99
85
  * ```
100
86
  */
101
- declare function createSarmal(
102
- canvas: HTMLCanvasElement,
103
- curveDef: CurveDef,
104
- options?: SarmalOptions,
105
- ): SarmalInstance;
87
+ declare function createSarmal(canvas: HTMLCanvasElement, curveDef: CurveDef, options?: SarmalOptions): SarmalInstance;
106
88
 
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
- };
89
+ export { BaseRendererOptions, CurveDef, Engine, RendererOptions, type SVGRendererOptions, type SVGSarmalOptions, SarmalInstance, SarmalOptions, createEngine, createRenderer, createSVGRenderer, createSarmal, createSarmalSVG, palettes };