@sarmal/core 0.26.0 → 0.27.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 (79) hide show
  1. package/dist/auto-init.cjs +145 -106
  2. package/dist/auto-init.js +144 -105
  3. package/dist/cli.js +1048 -0
  4. package/dist/cli.js.map +1 -0
  5. package/dist/curves/artemis2.cjs +16 -10
  6. package/dist/curves/artemis2.d.cts +1 -1
  7. package/dist/curves/artemis2.d.ts +1 -1
  8. package/dist/curves/artemis2.js +15 -9
  9. package/dist/curves/astroid.cjs +4 -4
  10. package/dist/curves/astroid.d.cts +1 -1
  11. package/dist/curves/astroid.d.ts +1 -1
  12. package/dist/curves/astroid.js +3 -3
  13. package/dist/curves/deltoid.cjs +4 -4
  14. package/dist/curves/deltoid.d.cts +1 -1
  15. package/dist/curves/deltoid.d.ts +1 -1
  16. package/dist/curves/deltoid.js +3 -3
  17. package/dist/curves/epicycloid3.cjs +4 -4
  18. package/dist/curves/epicycloid3.d.cts +1 -1
  19. package/dist/curves/epicycloid3.d.ts +1 -1
  20. package/dist/curves/epicycloid3.js +3 -3
  21. package/dist/curves/epitrochoid7.cjs +5 -5
  22. package/dist/curves/epitrochoid7.d.cts +1 -1
  23. package/dist/curves/epitrochoid7.d.ts +1 -1
  24. package/dist/curves/epitrochoid7.js +4 -4
  25. package/dist/curves/index.cjs +59 -43
  26. package/dist/curves/index.d.cts +29 -29
  27. package/dist/curves/index.d.ts +29 -29
  28. package/dist/curves/index.js +75 -43
  29. package/dist/curves/lame.cjs +6 -5
  30. package/dist/curves/lame.d.cts +1 -1
  31. package/dist/curves/lame.d.ts +1 -1
  32. package/dist/curves/lame.js +5 -4
  33. package/dist/curves/lissajous32.cjs +4 -4
  34. package/dist/curves/lissajous32.d.cts +1 -1
  35. package/dist/curves/lissajous32.d.ts +1 -1
  36. package/dist/curves/lissajous32.js +3 -3
  37. package/dist/curves/lissajous43.cjs +4 -4
  38. package/dist/curves/lissajous43.d.cts +1 -1
  39. package/dist/curves/lissajous43.d.ts +1 -1
  40. package/dist/curves/lissajous43.js +3 -3
  41. package/dist/curves/rose3.cjs +4 -4
  42. package/dist/curves/rose3.d.cts +1 -1
  43. package/dist/curves/rose3.d.ts +1 -1
  44. package/dist/curves/rose3.js +3 -3
  45. package/dist/curves/rose5.cjs +4 -4
  46. package/dist/curves/rose5.d.cts +1 -1
  47. package/dist/curves/rose5.d.ts +1 -1
  48. package/dist/curves/rose5.js +3 -3
  49. package/dist/curves/rose52.cjs +5 -5
  50. package/dist/curves/rose52.d.cts +1 -1
  51. package/dist/curves/rose52.d.ts +1 -1
  52. package/dist/curves/rose52.js +4 -4
  53. package/dist/curves/star.cjs +8 -5
  54. package/dist/curves/star.d.cts +1 -1
  55. package/dist/curves/star.d.ts +1 -1
  56. package/dist/curves/star.js +7 -4
  57. package/dist/curves/star4.cjs +8 -5
  58. package/dist/curves/star4.d.cts +1 -1
  59. package/dist/curves/star4.d.ts +1 -1
  60. package/dist/curves/star4.js +7 -4
  61. package/dist/curves/star7.cjs +8 -5
  62. package/dist/curves/star7.d.cts +1 -1
  63. package/dist/curves/star7.d.ts +1 -1
  64. package/dist/curves/star7.js +7 -4
  65. package/dist/index.cjs +131 -94
  66. package/dist/index.d.cts +78 -58
  67. package/dist/index.d.ts +78 -58
  68. package/dist/index.js +152 -94
  69. package/dist/renderer-shared-OR--cv-t.d.ts +49 -0
  70. package/dist/renderer-shared-jqw_Q1WO.d.cts +49 -0
  71. package/dist/terminal.cjs +593 -0
  72. package/dist/terminal.cjs.map +1 -0
  73. package/dist/terminal.d.cts +44 -0
  74. package/dist/terminal.d.ts +44 -0
  75. package/dist/terminal.js +585 -0
  76. package/dist/terminal.js.map +1 -0
  77. package/dist/types-zbxUgcmZ.d.cts +280 -266
  78. package/dist/types-zbxUgcmZ.d.ts +280 -266
  79. package/package.json +11 -1
package/dist/index.d.cts CHANGED
@@ -1,31 +1,52 @@
1
- import { B as BaseRendererOptions, E as Engine, S as SarmalInstance, C as CurveDef, P as Point, R as RendererOptions, a as ControlPoint, b as SarmalOptions } from './types-zbxUgcmZ.cjs';
2
- export { J as JumpOptions, c as RuntimeRenderOptions, d as SeekOptions, T as TrailColor, e as TrailStyle } from './types-zbxUgcmZ.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';
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 ControlPoint,
8
+ P as Point,
9
+ b as SarmalOptions,
10
+ } from "./types-zbxUgcmZ.cjs";
11
+ export {
12
+ J as JumpOptions,
13
+ c as RuntimeRenderOptions,
14
+ d as SeekOptions,
15
+ T as TrailColor,
16
+ e as TrailStyle,
17
+ } from "./types-zbxUgcmZ.cjs";
18
+ export { CurveName, curves } from "./curves/index.cjs";
19
+ export {
20
+ B as BoundaryResult,
21
+ S as SarmalPalette,
22
+ c as computeBoundaries,
23
+ p as palettes,
24
+ } from "./renderer-shared-jqw_Q1WO.cjs";
25
+ export { artemis2 } from "./curves/artemis2.cjs";
26
+ export { astroid } from "./curves/astroid.cjs";
27
+ export { deltoid } from "./curves/deltoid.cjs";
28
+ export { epicycloid3 } from "./curves/epicycloid3.cjs";
29
+ export { epitrochoid7 } from "./curves/epitrochoid7.cjs";
30
+ export { lame } from "./curves/lame.cjs";
31
+ export { lissajous32 } from "./curves/lissajous32.cjs";
32
+ export { lissajous43 } from "./curves/lissajous43.cjs";
33
+ export { rose3 } from "./curves/rose3.cjs";
34
+ export { rose5 } from "./curves/rose5.cjs";
35
+ import "./curves/rose52.cjs";
36
+ import "./curves/star.cjs";
37
+ import "./curves/star4.cjs";
38
+ import "./curves/star7.cjs";
18
39
 
19
40
  interface SVGRendererOptions extends BaseRendererOptions {
20
- /** SVG element the renderer draws into directly */
21
- container: SVGSVGElement;
22
- engine: Engine;
23
- /** @default 'Loading' */
24
- ariaLabel?: string;
41
+ /** SVG element the renderer draws into directly */
42
+ container: SVGSVGElement;
43
+ engine: Engine;
44
+ /** @default 'Loading' */
45
+ ariaLabel?: string;
25
46
  }
26
47
  interface SVGSarmalOptions extends Omit<SVGRendererOptions, "container" | "engine"> {
27
- /** @default 120 */
28
- trailLength?: number;
48
+ /** @default 120 */
49
+ trailLength?: number;
29
50
  }
30
51
  /**
31
52
  * Creates a live SVG renderer for sarmal animations
@@ -50,36 +71,11 @@ declare function createSVGRenderer(options: SVGRendererOptions): SarmalInstance;
50
71
  * controlled.pause() // Pause later
51
72
  * ```
52
73
  */
53
- declare function createSarmalSVG(container: SVGSVGElement, curveDef: CurveDef, options?: SVGSarmalOptions): SarmalInstance;
54
-
55
- interface BoundaryResult {
56
- scale: number;
57
- offsetX: number;
58
- offsetY: number;
59
- }
60
- /**
61
- * Computes how to map engine coordinates into a viewport of the given logical size.
62
- * ! Returns `null` if `pts` is empty
63
- * ! Throws if all points are identical
64
- *
65
- * Padding per side is `max(FIT_PADDING * dim, minPaddingPx)`, so the stricter constraint wins.
66
- * `minPaddingPx` defaults to `FIT_PADDING_MIN` (4px) for pixel-space callers.
67
- * Pass `0` when the logical space is itself a normalized viewBox (e.g. SVG export).
68
- */
69
- declare function computeBoundaries(pts: Point[], logicalWidth: number, logicalHeight: number, minPaddingPx?: number): BoundaryResult | null;
70
- /**
71
- * Can be passed directly to `trailColor`,
72
- * or can be mixed/sliced before passing as a prop.
73
- */
74
- declare const palettes: {
75
- readonly bard: ["#a855f7", "#3b82f6", "#14b8a6", "#ec4899"];
76
- readonly sunset: ["#f97316", "#dc2626", "#9333ea", "#f472b6"];
77
- readonly ocean: ["#1e3a8a", "#06b6d4", "#22d3ee", "#e0f2fe"];
78
- readonly ice: ["#1e3a8a", "#67e8f9"];
79
- readonly fire: ["#7f1d1d", "#fbbf24"];
80
- readonly forest: ["#14532d", "#86efac"];
81
- };
82
- type SarmalPalette = keyof typeof palettes;
74
+ declare function createSarmalSVG(
75
+ container: SVGSVGElement,
76
+ curveDef: CurveDef,
77
+ options?: SVGSarmalOptions,
78
+ ): SarmalInstance;
83
79
 
84
80
  declare function createEngine(curveDef: CurveDef, trailLength?: number): Engine;
85
81
 
@@ -127,9 +123,12 @@ declare function evaluateCatmullRom(points: Array<ControlPoint>, phase: number):
127
123
  * createSarmal(canvas, curve)
128
124
  * ```
129
125
  */
130
- declare function drawCurve(points: Array<ControlPoint>, opts?: {
126
+ declare function drawCurve(
127
+ points: Array<ControlPoint>,
128
+ opts?: {
131
129
  name?: string;
132
- }): CurveDef;
130
+ },
131
+ ): CurveDef;
133
132
 
134
133
  /**
135
134
  * Creates a sarmal animation on a canvas element
@@ -145,6 +144,27 @@ declare function drawCurve(points: Array<ControlPoint>, opts?: {
145
144
  * controlled.pause() // Pause later
146
145
  * ```
147
146
  */
148
- declare function createSarmal(canvas: HTMLCanvasElement, curveDef: CurveDef, options?: SarmalOptions): SarmalInstance;
147
+ declare function createSarmal(
148
+ canvas: HTMLCanvasElement,
149
+ curveDef: CurveDef,
150
+ options?: SarmalOptions,
151
+ ): SarmalInstance;
149
152
 
150
- export { BaseRendererOptions, type BoundaryResult, CurveDef, Engine, Point, RendererOptions, type SVGRendererOptions, type SVGSarmalOptions, SarmalInstance, SarmalOptions, type SarmalPalette, computeBoundaries, createEngine, createRenderer, createSVGRenderer, createSarmal, createSarmalSVG, drawCurve, evaluateCatmullRom, palettes };
153
+ export {
154
+ BaseRendererOptions,
155
+ CurveDef,
156
+ Engine,
157
+ Point,
158
+ RendererOptions,
159
+ type SVGRendererOptions,
160
+ type SVGSarmalOptions,
161
+ SarmalInstance,
162
+ SarmalOptions,
163
+ createEngine,
164
+ createRenderer,
165
+ createSVGRenderer,
166
+ createSarmal,
167
+ createSarmalSVG,
168
+ drawCurve,
169
+ evaluateCatmullRom,
170
+ };
package/dist/index.d.ts CHANGED
@@ -1,31 +1,52 @@
1
- import { B as BaseRendererOptions, E as Engine, S as SarmalInstance, C as CurveDef, P as Point, R as RendererOptions, a as ControlPoint, b as SarmalOptions } from './types-zbxUgcmZ.js';
2
- export { J as JumpOptions, c as RuntimeRenderOptions, d as SeekOptions, T as TrailColor, e as TrailStyle } from './types-zbxUgcmZ.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';
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 ControlPoint,
8
+ P as Point,
9
+ b as SarmalOptions,
10
+ } from "./types-zbxUgcmZ.js";
11
+ export {
12
+ J as JumpOptions,
13
+ c as RuntimeRenderOptions,
14
+ d as SeekOptions,
15
+ T as TrailColor,
16
+ e as TrailStyle,
17
+ } from "./types-zbxUgcmZ.js";
18
+ export { CurveName, curves } from "./curves/index.js";
19
+ export {
20
+ B as BoundaryResult,
21
+ S as SarmalPalette,
22
+ c as computeBoundaries,
23
+ p as palettes,
24
+ } from "./renderer-shared-OR--cv-t.js";
25
+ export { artemis2 } from "./curves/artemis2.js";
26
+ export { astroid } from "./curves/astroid.js";
27
+ export { deltoid } from "./curves/deltoid.js";
28
+ export { epicycloid3 } from "./curves/epicycloid3.js";
29
+ export { epitrochoid7 } from "./curves/epitrochoid7.js";
30
+ export { lame } from "./curves/lame.js";
31
+ export { lissajous32 } from "./curves/lissajous32.js";
32
+ export { lissajous43 } from "./curves/lissajous43.js";
33
+ export { rose3 } from "./curves/rose3.js";
34
+ export { rose5 } from "./curves/rose5.js";
35
+ import "./curves/rose52.js";
36
+ import "./curves/star.js";
37
+ import "./curves/star4.js";
38
+ import "./curves/star7.js";
18
39
 
19
40
  interface SVGRendererOptions extends BaseRendererOptions {
20
- /** SVG element the renderer draws into directly */
21
- container: SVGSVGElement;
22
- engine: Engine;
23
- /** @default 'Loading' */
24
- ariaLabel?: string;
41
+ /** SVG element the renderer draws into directly */
42
+ container: SVGSVGElement;
43
+ engine: Engine;
44
+ /** @default 'Loading' */
45
+ ariaLabel?: string;
25
46
  }
26
47
  interface SVGSarmalOptions extends Omit<SVGRendererOptions, "container" | "engine"> {
27
- /** @default 120 */
28
- trailLength?: number;
48
+ /** @default 120 */
49
+ trailLength?: number;
29
50
  }
30
51
  /**
31
52
  * Creates a live SVG renderer for sarmal animations
@@ -50,36 +71,11 @@ declare function createSVGRenderer(options: SVGRendererOptions): SarmalInstance;
50
71
  * controlled.pause() // Pause later
51
72
  * ```
52
73
  */
53
- declare function createSarmalSVG(container: SVGSVGElement, curveDef: CurveDef, options?: SVGSarmalOptions): SarmalInstance;
54
-
55
- interface BoundaryResult {
56
- scale: number;
57
- offsetX: number;
58
- offsetY: number;
59
- }
60
- /**
61
- * Computes how to map engine coordinates into a viewport of the given logical size.
62
- * ! Returns `null` if `pts` is empty
63
- * ! Throws if all points are identical
64
- *
65
- * Padding per side is `max(FIT_PADDING * dim, minPaddingPx)`, so the stricter constraint wins.
66
- * `minPaddingPx` defaults to `FIT_PADDING_MIN` (4px) for pixel-space callers.
67
- * Pass `0` when the logical space is itself a normalized viewBox (e.g. SVG export).
68
- */
69
- declare function computeBoundaries(pts: Point[], logicalWidth: number, logicalHeight: number, minPaddingPx?: number): BoundaryResult | null;
70
- /**
71
- * Can be passed directly to `trailColor`,
72
- * or can be mixed/sliced before passing as a prop.
73
- */
74
- declare const palettes: {
75
- readonly bard: ["#a855f7", "#3b82f6", "#14b8a6", "#ec4899"];
76
- readonly sunset: ["#f97316", "#dc2626", "#9333ea", "#f472b6"];
77
- readonly ocean: ["#1e3a8a", "#06b6d4", "#22d3ee", "#e0f2fe"];
78
- readonly ice: ["#1e3a8a", "#67e8f9"];
79
- readonly fire: ["#7f1d1d", "#fbbf24"];
80
- readonly forest: ["#14532d", "#86efac"];
81
- };
82
- type SarmalPalette = keyof typeof palettes;
74
+ declare function createSarmalSVG(
75
+ container: SVGSVGElement,
76
+ curveDef: CurveDef,
77
+ options?: SVGSarmalOptions,
78
+ ): SarmalInstance;
83
79
 
84
80
  declare function createEngine(curveDef: CurveDef, trailLength?: number): Engine;
85
81
 
@@ -127,9 +123,12 @@ declare function evaluateCatmullRom(points: Array<ControlPoint>, phase: number):
127
123
  * createSarmal(canvas, curve)
128
124
  * ```
129
125
  */
130
- declare function drawCurve(points: Array<ControlPoint>, opts?: {
126
+ declare function drawCurve(
127
+ points: Array<ControlPoint>,
128
+ opts?: {
131
129
  name?: string;
132
- }): CurveDef;
130
+ },
131
+ ): CurveDef;
133
132
 
134
133
  /**
135
134
  * Creates a sarmal animation on a canvas element
@@ -145,6 +144,27 @@ declare function drawCurve(points: Array<ControlPoint>, opts?: {
145
144
  * controlled.pause() // Pause later
146
145
  * ```
147
146
  */
148
- declare function createSarmal(canvas: HTMLCanvasElement, curveDef: CurveDef, options?: SarmalOptions): SarmalInstance;
147
+ declare function createSarmal(
148
+ canvas: HTMLCanvasElement,
149
+ curveDef: CurveDef,
150
+ options?: SarmalOptions,
151
+ ): SarmalInstance;
149
152
 
150
- export { BaseRendererOptions, type BoundaryResult, CurveDef, Engine, Point, RendererOptions, type SVGRendererOptions, type SVGSarmalOptions, SarmalInstance, SarmalOptions, type SarmalPalette, computeBoundaries, createEngine, createRenderer, createSVGRenderer, createSarmal, createSarmalSVG, drawCurve, evaluateCatmullRom, palettes };
153
+ export {
154
+ BaseRendererOptions,
155
+ CurveDef,
156
+ Engine,
157
+ Point,
158
+ RendererOptions,
159
+ type SVGRendererOptions,
160
+ type SVGSarmalOptions,
161
+ SarmalInstance,
162
+ SarmalOptions,
163
+ createEngine,
164
+ createRenderer,
165
+ createSVGRenderer,
166
+ createSarmal,
167
+ createSarmalSVG,
168
+ drawCurve,
169
+ evaluateCatmullRom,
170
+ };