@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.
- package/dist/auto-init.cjs +145 -106
- package/dist/auto-init.js +144 -105
- package/dist/cli.js +1048 -0
- package/dist/cli.js.map +1 -0
- package/dist/curves/artemis2.cjs +16 -10
- package/dist/curves/artemis2.d.cts +1 -1
- package/dist/curves/artemis2.d.ts +1 -1
- package/dist/curves/artemis2.js +15 -9
- package/dist/curves/astroid.cjs +4 -4
- package/dist/curves/astroid.d.cts +1 -1
- package/dist/curves/astroid.d.ts +1 -1
- package/dist/curves/astroid.js +3 -3
- package/dist/curves/deltoid.cjs +4 -4
- package/dist/curves/deltoid.d.cts +1 -1
- package/dist/curves/deltoid.d.ts +1 -1
- package/dist/curves/deltoid.js +3 -3
- package/dist/curves/epicycloid3.cjs +4 -4
- package/dist/curves/epicycloid3.d.cts +1 -1
- package/dist/curves/epicycloid3.d.ts +1 -1
- package/dist/curves/epicycloid3.js +3 -3
- package/dist/curves/epitrochoid7.cjs +5 -5
- package/dist/curves/epitrochoid7.d.cts +1 -1
- package/dist/curves/epitrochoid7.d.ts +1 -1
- package/dist/curves/epitrochoid7.js +4 -4
- package/dist/curves/index.cjs +59 -43
- package/dist/curves/index.d.cts +29 -29
- package/dist/curves/index.d.ts +29 -29
- package/dist/curves/index.js +75 -43
- package/dist/curves/lame.cjs +6 -5
- package/dist/curves/lame.d.cts +1 -1
- package/dist/curves/lame.d.ts +1 -1
- package/dist/curves/lame.js +5 -4
- package/dist/curves/lissajous32.cjs +4 -4
- package/dist/curves/lissajous32.d.cts +1 -1
- package/dist/curves/lissajous32.d.ts +1 -1
- package/dist/curves/lissajous32.js +3 -3
- package/dist/curves/lissajous43.cjs +4 -4
- package/dist/curves/lissajous43.d.cts +1 -1
- package/dist/curves/lissajous43.d.ts +1 -1
- package/dist/curves/lissajous43.js +3 -3
- package/dist/curves/rose3.cjs +4 -4
- package/dist/curves/rose3.d.cts +1 -1
- package/dist/curves/rose3.d.ts +1 -1
- package/dist/curves/rose3.js +3 -3
- package/dist/curves/rose5.cjs +4 -4
- package/dist/curves/rose5.d.cts +1 -1
- package/dist/curves/rose5.d.ts +1 -1
- package/dist/curves/rose5.js +3 -3
- package/dist/curves/rose52.cjs +5 -5
- package/dist/curves/rose52.d.cts +1 -1
- package/dist/curves/rose52.d.ts +1 -1
- package/dist/curves/rose52.js +4 -4
- package/dist/curves/star.cjs +8 -5
- package/dist/curves/star.d.cts +1 -1
- package/dist/curves/star.d.ts +1 -1
- package/dist/curves/star.js +7 -4
- package/dist/curves/star4.cjs +8 -5
- package/dist/curves/star4.d.cts +1 -1
- package/dist/curves/star4.d.ts +1 -1
- package/dist/curves/star4.js +7 -4
- package/dist/curves/star7.cjs +8 -5
- package/dist/curves/star7.d.cts +1 -1
- package/dist/curves/star7.d.ts +1 -1
- package/dist/curves/star7.js +7 -4
- package/dist/index.cjs +131 -94
- package/dist/index.d.cts +78 -58
- package/dist/index.d.ts +78 -58
- package/dist/index.js +152 -94
- package/dist/renderer-shared-OR--cv-t.d.ts +49 -0
- package/dist/renderer-shared-jqw_Q1WO.d.cts +49 -0
- package/dist/terminal.cjs +593 -0
- package/dist/terminal.cjs.map +1 -0
- package/dist/terminal.d.cts +44 -0
- package/dist/terminal.d.ts +44 -0
- package/dist/terminal.js +585 -0
- package/dist/terminal.js.map +1 -0
- package/dist/types-zbxUgcmZ.d.cts +280 -266
- package/dist/types-zbxUgcmZ.d.ts +280 -266
- package/package.json +11 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,31 +1,52 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
28
|
-
|
|
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(
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
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(
|
|
126
|
+
declare function drawCurve(
|
|
127
|
+
points: Array<ControlPoint>,
|
|
128
|
+
opts?: {
|
|
131
129
|
name?: string;
|
|
132
|
-
}
|
|
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(
|
|
147
|
+
declare function createSarmal(
|
|
148
|
+
canvas: HTMLCanvasElement,
|
|
149
|
+
curveDef: CurveDef,
|
|
150
|
+
options?: SarmalOptions,
|
|
151
|
+
): SarmalInstance;
|
|
149
152
|
|
|
150
|
-
export {
|
|
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 {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
28
|
-
|
|
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(
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
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(
|
|
126
|
+
declare function drawCurve(
|
|
127
|
+
points: Array<ControlPoint>,
|
|
128
|
+
opts?: {
|
|
131
129
|
name?: string;
|
|
132
|
-
}
|
|
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(
|
|
147
|
+
declare function createSarmal(
|
|
148
|
+
canvas: HTMLCanvasElement,
|
|
149
|
+
curveDef: CurveDef,
|
|
150
|
+
options?: SarmalOptions,
|
|
151
|
+
): SarmalInstance;
|
|
149
152
|
|
|
150
|
-
export {
|
|
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
|
+
};
|