@sarmal/core 0.17.1 → 0.18.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 +113 -89
- package/dist/auto-init.cjs.map +1 -1
- package/dist/auto-init.js +112 -88
- package/dist/auto-init.js.map +1 -1
- package/dist/curves/artemis2.cjs +10 -7
- package/dist/curves/artemis2.d.cts +1 -1
- package/dist/curves/artemis2.d.ts +1 -1
- package/dist/curves/artemis2.js +9 -6
- 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 +53 -40
- package/dist/curves/index.d.cts +29 -29
- package/dist/curves/index.d.ts +29 -29
- package/dist/curves/index.js +69 -40
- 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 +125 -93
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +74 -35
- package/dist/index.d.ts +74 -35
- package/dist/index.js +143 -93
- package/dist/index.js.map +1 -1
- package/dist/types-frtEoAq6.d.cts +317 -0
- package/dist/types-frtEoAq6.d.ts +317 -0
- package/package.json +1 -1
- package/dist/types-BL9HhEmk.d.cts +0 -299
- package/dist/types-BL9HhEmk.d.ts +0 -299
package/dist/index.d.cts
CHANGED
|
@@ -1,31 +1,45 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export {
|
|
10
|
-
|
|
11
|
-
|
|
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 SarmalOptions,
|
|
8
|
+
} from "./types-frtEoAq6.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-frtEoAq6.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";
|
|
28
|
+
import "./curves/rose52.cjs";
|
|
29
|
+
import "./curves/star.cjs";
|
|
30
|
+
import "./curves/star4.cjs";
|
|
31
|
+
import "./curves/star7.cjs";
|
|
18
32
|
|
|
19
33
|
interface SVGRendererOptions extends BaseRendererOptions {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
34
|
+
/** Container element that will contain the SVG */
|
|
35
|
+
container: Element;
|
|
36
|
+
engine: Engine;
|
|
37
|
+
/** @default 'Loading' */
|
|
38
|
+
ariaLabel?: string;
|
|
25
39
|
}
|
|
26
40
|
interface SVGSarmalOptions extends Omit<SVGRendererOptions, "container" | "engine"> {
|
|
27
|
-
|
|
28
|
-
|
|
41
|
+
/** @default 120 */
|
|
42
|
+
trailLength?: number;
|
|
29
43
|
}
|
|
30
44
|
/**
|
|
31
45
|
* Creates a live SVG renderer for sarmal animations
|
|
@@ -47,22 +61,27 @@ declare function createSVGRenderer(options: SVGRendererOptions): SarmalInstance;
|
|
|
47
61
|
* controlled.pause() // Pause later
|
|
48
62
|
* ```
|
|
49
63
|
*/
|
|
50
|
-
declare function createSarmalSVG(
|
|
51
|
-
|
|
52
|
-
|
|
64
|
+
declare function createSarmalSVG(
|
|
65
|
+
container: Element,
|
|
66
|
+
curveDef: CurveDef,
|
|
67
|
+
options?: SVGSarmalOptions,
|
|
68
|
+
): SarmalInstance;
|
|
53
69
|
|
|
54
70
|
/**
|
|
55
71
|
* Can be passed directly to `trailColor`,
|
|
56
72
|
* or can be mixed/sliced before passing as a prop.
|
|
57
73
|
*/
|
|
58
74
|
declare const palettes: {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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"];
|
|
65
81
|
};
|
|
82
|
+
type SarmalPalette = keyof typeof palettes;
|
|
83
|
+
|
|
84
|
+
declare function createEngine(curveDef: CurveDef, trailLength?: number): Engine;
|
|
66
85
|
|
|
67
86
|
/**
|
|
68
87
|
* Creates a Canvas 2D renderer for sarmal animations
|
|
@@ -84,6 +103,26 @@ declare function createRenderer(options: RendererOptions): SarmalInstance;
|
|
|
84
103
|
* controlled.pause() // Pause later
|
|
85
104
|
* ```
|
|
86
105
|
*/
|
|
87
|
-
declare function createSarmal(
|
|
106
|
+
declare function createSarmal(
|
|
107
|
+
canvas: HTMLCanvasElement,
|
|
108
|
+
curveDef: CurveDef,
|
|
109
|
+
options?: SarmalOptions,
|
|
110
|
+
): SarmalInstance;
|
|
88
111
|
|
|
89
|
-
export {
|
|
112
|
+
export {
|
|
113
|
+
BaseRendererOptions,
|
|
114
|
+
CurveDef,
|
|
115
|
+
Engine,
|
|
116
|
+
RendererOptions,
|
|
117
|
+
type SVGRendererOptions,
|
|
118
|
+
type SVGSarmalOptions,
|
|
119
|
+
SarmalInstance,
|
|
120
|
+
SarmalOptions,
|
|
121
|
+
type SarmalPalette,
|
|
122
|
+
createEngine,
|
|
123
|
+
createRenderer,
|
|
124
|
+
createSVGRenderer,
|
|
125
|
+
createSarmal,
|
|
126
|
+
createSarmalSVG,
|
|
127
|
+
palettes,
|
|
128
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,31 +1,45 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export {
|
|
10
|
-
|
|
11
|
-
|
|
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 SarmalOptions,
|
|
8
|
+
} from "./types-frtEoAq6.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-frtEoAq6.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";
|
|
28
|
+
import "./curves/rose52.js";
|
|
29
|
+
import "./curves/star.js";
|
|
30
|
+
import "./curves/star4.js";
|
|
31
|
+
import "./curves/star7.js";
|
|
18
32
|
|
|
19
33
|
interface SVGRendererOptions extends BaseRendererOptions {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
34
|
+
/** Container element that will contain the SVG */
|
|
35
|
+
container: Element;
|
|
36
|
+
engine: Engine;
|
|
37
|
+
/** @default 'Loading' */
|
|
38
|
+
ariaLabel?: string;
|
|
25
39
|
}
|
|
26
40
|
interface SVGSarmalOptions extends Omit<SVGRendererOptions, "container" | "engine"> {
|
|
27
|
-
|
|
28
|
-
|
|
41
|
+
/** @default 120 */
|
|
42
|
+
trailLength?: number;
|
|
29
43
|
}
|
|
30
44
|
/**
|
|
31
45
|
* Creates a live SVG renderer for sarmal animations
|
|
@@ -47,22 +61,27 @@ declare function createSVGRenderer(options: SVGRendererOptions): SarmalInstance;
|
|
|
47
61
|
* controlled.pause() // Pause later
|
|
48
62
|
* ```
|
|
49
63
|
*/
|
|
50
|
-
declare function createSarmalSVG(
|
|
51
|
-
|
|
52
|
-
|
|
64
|
+
declare function createSarmalSVG(
|
|
65
|
+
container: Element,
|
|
66
|
+
curveDef: CurveDef,
|
|
67
|
+
options?: SVGSarmalOptions,
|
|
68
|
+
): SarmalInstance;
|
|
53
69
|
|
|
54
70
|
/**
|
|
55
71
|
* Can be passed directly to `trailColor`,
|
|
56
72
|
* or can be mixed/sliced before passing as a prop.
|
|
57
73
|
*/
|
|
58
74
|
declare const palettes: {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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"];
|
|
65
81
|
};
|
|
82
|
+
type SarmalPalette = keyof typeof palettes;
|
|
83
|
+
|
|
84
|
+
declare function createEngine(curveDef: CurveDef, trailLength?: number): Engine;
|
|
66
85
|
|
|
67
86
|
/**
|
|
68
87
|
* Creates a Canvas 2D renderer for sarmal animations
|
|
@@ -84,6 +103,26 @@ declare function createRenderer(options: RendererOptions): SarmalInstance;
|
|
|
84
103
|
* controlled.pause() // Pause later
|
|
85
104
|
* ```
|
|
86
105
|
*/
|
|
87
|
-
declare function createSarmal(
|
|
106
|
+
declare function createSarmal(
|
|
107
|
+
canvas: HTMLCanvasElement,
|
|
108
|
+
curveDef: CurveDef,
|
|
109
|
+
options?: SarmalOptions,
|
|
110
|
+
): SarmalInstance;
|
|
88
111
|
|
|
89
|
-
export {
|
|
112
|
+
export {
|
|
113
|
+
BaseRendererOptions,
|
|
114
|
+
CurveDef,
|
|
115
|
+
Engine,
|
|
116
|
+
RendererOptions,
|
|
117
|
+
type SVGRendererOptions,
|
|
118
|
+
type SVGSarmalOptions,
|
|
119
|
+
SarmalInstance,
|
|
120
|
+
SarmalOptions,
|
|
121
|
+
type SarmalPalette,
|
|
122
|
+
createEngine,
|
|
123
|
+
createRenderer,
|
|
124
|
+
createSVGRenderer,
|
|
125
|
+
createSarmal,
|
|
126
|
+
createSarmalSVG,
|
|
127
|
+
palettes,
|
|
128
|
+
};
|