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