@sarmal/core 0.37.1 → 0.37.4
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.map +1 -1
- package/dist/auto-init.js.map +1 -1
- package/dist/curves/artemis2.d.cts +1 -1
- package/dist/curves/artemis2.d.ts +1 -1
- package/dist/curves/astroid.d.cts +1 -1
- package/dist/curves/astroid.d.ts +1 -1
- package/dist/curves/deltoid.d.cts +1 -1
- package/dist/curves/deltoid.d.ts +1 -1
- package/dist/curves/epicycloid3.d.cts +1 -1
- package/dist/curves/epicycloid3.d.ts +1 -1
- package/dist/curves/epitrochoid7.d.cts +1 -1
- package/dist/curves/epitrochoid7.d.ts +1 -1
- package/dist/curves/index.d.cts +1 -1
- package/dist/curves/index.d.ts +1 -1
- package/dist/curves/lame.d.cts +1 -1
- package/dist/curves/lame.d.ts +1 -1
- package/dist/curves/lissajous32.d.cts +1 -1
- package/dist/curves/lissajous32.d.ts +1 -1
- package/dist/curves/lissajous43.d.cts +1 -1
- package/dist/curves/lissajous43.d.ts +1 -1
- package/dist/curves/rose3.d.cts +1 -1
- package/dist/curves/rose3.d.ts +1 -1
- package/dist/curves/rose5.d.cts +1 -1
- package/dist/curves/rose5.d.ts +1 -1
- package/dist/curves/rose52.d.cts +1 -1
- package/dist/curves/rose52.d.ts +1 -1
- package/dist/curves/star.d.cts +1 -1
- package/dist/curves/star.d.ts +1 -1
- package/dist/curves/star4.d.cts +1 -1
- package/dist/curves/star4.d.ts +1 -1
- package/dist/curves/star7.d.cts +1 -1
- package/dist/curves/star7.d.ts +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -53
- package/dist/index.d.ts +12 -53
- package/dist/index.js.map +1 -1
- package/dist/{renderer-shared-Bcc_1IaT.d.cts → renderer-shared-9Xf6sIlx.d.cts} +1 -1
- package/dist/{renderer-shared-DWPVHjKZ.d.ts → renderer-shared-DElz98PT.d.ts} +1 -1
- package/dist/terminal.d.cts +2 -2
- package/dist/terminal.d.ts +2 -2
- package/dist/{types-B1XeFpuq.d.cts → types-D_ERoVvi.d.cts} +121 -1
- package/dist/{types-B1XeFpuq.d.ts → types-D_ERoVvi.d.ts} +121 -1
- package/package.json +5 -5
- package/skills/core/SKILL.md +3 -3
package/dist/terminal.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CurveDef } from './types-
|
|
2
|
-
import { R as Rgb } from './renderer-shared-
|
|
1
|
+
import { C as CurveDef } from './types-D_ERoVvi.cjs';
|
|
2
|
+
import { R as Rgb } from './renderer-shared-9Xf6sIlx.cjs';
|
|
3
3
|
|
|
4
4
|
type ColorCapability = "truecolor" | "256-color" | "monochrome";
|
|
5
5
|
type DotCol = 0 | 1;
|
package/dist/terminal.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CurveDef } from './types-
|
|
2
|
-
import { R as Rgb } from './renderer-shared-
|
|
1
|
+
import { C as CurveDef } from './types-D_ERoVvi.js';
|
|
2
|
+
import { R as Rgb } from './renderer-shared-DElz98PT.js';
|
|
3
3
|
|
|
4
4
|
type ColorCapability = "truecolor" | "256-color" | "monochrome";
|
|
5
5
|
type DotCol = 0 | 1;
|
|
@@ -347,5 +347,125 @@ interface SarmalOptions extends Omit<RendererOptions, "canvas" | "engine"> {
|
|
|
347
347
|
/** @default 120 */
|
|
348
348
|
trailLength?: number;
|
|
349
349
|
}
|
|
350
|
+
/**
|
|
351
|
+
* Shared init options for canvas and SVG renderer bindings.
|
|
352
|
+
* Changing any of these after mount destroys and recreates the instance.
|
|
353
|
+
*/
|
|
354
|
+
interface BaseInit {
|
|
355
|
+
trailLength?: number;
|
|
356
|
+
headRadius?: number;
|
|
357
|
+
autoStart?: boolean;
|
|
358
|
+
initialPhase?: number;
|
|
359
|
+
/** @default true */
|
|
360
|
+
pauseOnHidden?: boolean;
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* Canvas-specific init options. Extends {@link BaseInit} with buffer sizing.
|
|
364
|
+
* Changing any of these after mount destroys and recreates the instance.
|
|
365
|
+
*/
|
|
366
|
+
interface CanvasInit extends BaseInit {
|
|
367
|
+
width?: number;
|
|
368
|
+
height?: number;
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* Dot matrix renderer init options.
|
|
372
|
+
* Changing any of these after mount destroys and recreates the instance.
|
|
373
|
+
*/
|
|
374
|
+
interface DotMatrixInit {
|
|
375
|
+
/**
|
|
376
|
+
* Number of dot columns in the grid.
|
|
377
|
+
* @default 32
|
|
378
|
+
*/
|
|
379
|
+
cols?: number;
|
|
380
|
+
/**
|
|
381
|
+
* Number of dot rows in the grid.
|
|
382
|
+
* @default 32
|
|
383
|
+
*/
|
|
384
|
+
rows?: number;
|
|
385
|
+
/**
|
|
386
|
+
* Corner rounding of each dot: `0` = sharp square, `1` = full circle.
|
|
387
|
+
* @default 1
|
|
388
|
+
*/
|
|
389
|
+
roundness?: number;
|
|
390
|
+
/**
|
|
391
|
+
* Number of trail points to keep.
|
|
392
|
+
* Larger values produce longer trails.
|
|
393
|
+
* If omitted, a value is chosen based on the grid density.
|
|
394
|
+
*/
|
|
395
|
+
trailLength?: number;
|
|
396
|
+
autoStart?: boolean;
|
|
397
|
+
initialPhase?: number;
|
|
398
|
+
/** @default true */
|
|
399
|
+
pauseOnHidden?: boolean;
|
|
400
|
+
/** Canvas buffer width in pixels. Falls back to parent `clientWidth`, then 300. */
|
|
401
|
+
width?: number;
|
|
402
|
+
/** Canvas buffer height in pixels. Falls back to parent `clientHeight`, then 300. */
|
|
403
|
+
height?: number;
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* Options for `createSarmalDotMatrix`
|
|
407
|
+
*
|
|
408
|
+
* Init fields (`cols`, `rows`, `roundness`, `trailLength`, `autoStart`, `initialPhase`, `pauseOnHidden`)
|
|
409
|
+
* require recreating the instance on change.
|
|
410
|
+
* Runtime fields (`trailColor`, `trailStyle`, `skeletonColor`)
|
|
411
|
+
* can be updated live through {@link SarmalInstance.setRenderOptions}.
|
|
412
|
+
*/
|
|
413
|
+
interface DotMatrixSarmalOptions extends Omit<DotMatrixInit, "width" | "height"> {
|
|
414
|
+
/**
|
|
415
|
+
* Color of lit dots. Single color string for solid mode; array of two or more colors for gradient mode.
|
|
416
|
+
* Gradient mode samples a color per dot based on its position in the trail (tail to head).
|
|
417
|
+
* Background dots always use the first color at 5% opacity.
|
|
418
|
+
* @default '#ffffff'
|
|
419
|
+
*/
|
|
420
|
+
trailColor?: TrailColor;
|
|
421
|
+
/**
|
|
422
|
+
* Trail rendering style.
|
|
423
|
+
* - `'default'`: solid color, alpha varies by intensity.
|
|
424
|
+
* - `'gradient-static'`: each dot's color is sampled from the `trailColor` gradient. Requires `trailColor` array.
|
|
425
|
+
* - `'gradient-animated'`: same as `gradient-static` but the gradient phase shifts over time.
|
|
426
|
+
* @default 'default'
|
|
427
|
+
*/
|
|
428
|
+
trailStyle?: TrailStyle;
|
|
429
|
+
/**
|
|
430
|
+
* Color of the skeleton dots. Accepts `#rrggbb`, `#rgb`, `rgb()`, `rgba()`, or `oklch()`.
|
|
431
|
+
* Pass `"transparent"` to disable the skeleton entirely.
|
|
432
|
+
* @default '#ffffff'
|
|
433
|
+
*/
|
|
434
|
+
skeletonColor?: string;
|
|
435
|
+
}
|
|
436
|
+
/**
|
|
437
|
+
* Framework-agnostic configuration shared by all canvas/SVG renderer bindings.
|
|
438
|
+
*
|
|
439
|
+
* Framework packages (React, Svelte, etc.) extend this with their specific
|
|
440
|
+
* surface: `class`/`className`, style type, event naming, bindable instance.
|
|
441
|
+
*/
|
|
442
|
+
interface BaseSarmalOptions {
|
|
443
|
+
curve: CurveDef;
|
|
444
|
+
trailColor?: TrailColor;
|
|
445
|
+
skeletonColor?: string;
|
|
446
|
+
headColor?: string;
|
|
447
|
+
trailStyle?: TrailStyle;
|
|
448
|
+
morphDuration?: number;
|
|
449
|
+
/** @default 'normalized' */
|
|
450
|
+
morphStrategy?: MorphStrategy;
|
|
451
|
+
trailLength?: number;
|
|
452
|
+
headRadius?: number;
|
|
453
|
+
trailWidth?: number;
|
|
454
|
+
autoStart?: boolean;
|
|
455
|
+
initialPhase?: number;
|
|
456
|
+
/** @default true */
|
|
457
|
+
pauseOnHidden?: boolean;
|
|
458
|
+
}
|
|
459
|
+
/**
|
|
460
|
+
* Framework-agnostic configuration shared by all dot matrix renderer bindings.
|
|
461
|
+
*
|
|
462
|
+
* Framework packages extend this with their specific surface: `class`/`className`, etc.
|
|
463
|
+
*/
|
|
464
|
+
interface BaseDotMatrixOptions extends DotMatrixSarmalOptions {
|
|
465
|
+
curve: CurveDef;
|
|
466
|
+
morphDuration?: number;
|
|
467
|
+
/** @default 'normalized' */
|
|
468
|
+
morphStrategy?: MorphStrategy;
|
|
469
|
+
}
|
|
350
470
|
|
|
351
|
-
export type { BaseRendererOptions as B, CurveDef as C,
|
|
471
|
+
export type { BaseRendererOptions as B, CurveDef as C, DotMatrixSarmalOptions as D, Engine as E, JumpOptions as J, MorphStrategy as M, Point as P, RendererOptions as R, SarmalInstance as S, TrailColor as T, DotMatrixRuntimeRenderOptions as a, ControlPoint as b, SarmalOptions as c, BaseDotMatrixOptions as d, BaseInit as e, BaseRuntimeRenderOptions as f, BaseSarmalOptions as g, CanvasInit as h, DotMatrixInit as i, RuntimeRenderOptions as j, SeekOptions as k, TrailStyle as l };
|
|
@@ -347,5 +347,125 @@ interface SarmalOptions extends Omit<RendererOptions, "canvas" | "engine"> {
|
|
|
347
347
|
/** @default 120 */
|
|
348
348
|
trailLength?: number;
|
|
349
349
|
}
|
|
350
|
+
/**
|
|
351
|
+
* Shared init options for canvas and SVG renderer bindings.
|
|
352
|
+
* Changing any of these after mount destroys and recreates the instance.
|
|
353
|
+
*/
|
|
354
|
+
interface BaseInit {
|
|
355
|
+
trailLength?: number;
|
|
356
|
+
headRadius?: number;
|
|
357
|
+
autoStart?: boolean;
|
|
358
|
+
initialPhase?: number;
|
|
359
|
+
/** @default true */
|
|
360
|
+
pauseOnHidden?: boolean;
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* Canvas-specific init options. Extends {@link BaseInit} with buffer sizing.
|
|
364
|
+
* Changing any of these after mount destroys and recreates the instance.
|
|
365
|
+
*/
|
|
366
|
+
interface CanvasInit extends BaseInit {
|
|
367
|
+
width?: number;
|
|
368
|
+
height?: number;
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* Dot matrix renderer init options.
|
|
372
|
+
* Changing any of these after mount destroys and recreates the instance.
|
|
373
|
+
*/
|
|
374
|
+
interface DotMatrixInit {
|
|
375
|
+
/**
|
|
376
|
+
* Number of dot columns in the grid.
|
|
377
|
+
* @default 32
|
|
378
|
+
*/
|
|
379
|
+
cols?: number;
|
|
380
|
+
/**
|
|
381
|
+
* Number of dot rows in the grid.
|
|
382
|
+
* @default 32
|
|
383
|
+
*/
|
|
384
|
+
rows?: number;
|
|
385
|
+
/**
|
|
386
|
+
* Corner rounding of each dot: `0` = sharp square, `1` = full circle.
|
|
387
|
+
* @default 1
|
|
388
|
+
*/
|
|
389
|
+
roundness?: number;
|
|
390
|
+
/**
|
|
391
|
+
* Number of trail points to keep.
|
|
392
|
+
* Larger values produce longer trails.
|
|
393
|
+
* If omitted, a value is chosen based on the grid density.
|
|
394
|
+
*/
|
|
395
|
+
trailLength?: number;
|
|
396
|
+
autoStart?: boolean;
|
|
397
|
+
initialPhase?: number;
|
|
398
|
+
/** @default true */
|
|
399
|
+
pauseOnHidden?: boolean;
|
|
400
|
+
/** Canvas buffer width in pixels. Falls back to parent `clientWidth`, then 300. */
|
|
401
|
+
width?: number;
|
|
402
|
+
/** Canvas buffer height in pixels. Falls back to parent `clientHeight`, then 300. */
|
|
403
|
+
height?: number;
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* Options for `createSarmalDotMatrix`
|
|
407
|
+
*
|
|
408
|
+
* Init fields (`cols`, `rows`, `roundness`, `trailLength`, `autoStart`, `initialPhase`, `pauseOnHidden`)
|
|
409
|
+
* require recreating the instance on change.
|
|
410
|
+
* Runtime fields (`trailColor`, `trailStyle`, `skeletonColor`)
|
|
411
|
+
* can be updated live through {@link SarmalInstance.setRenderOptions}.
|
|
412
|
+
*/
|
|
413
|
+
interface DotMatrixSarmalOptions extends Omit<DotMatrixInit, "width" | "height"> {
|
|
414
|
+
/**
|
|
415
|
+
* Color of lit dots. Single color string for solid mode; array of two or more colors for gradient mode.
|
|
416
|
+
* Gradient mode samples a color per dot based on its position in the trail (tail to head).
|
|
417
|
+
* Background dots always use the first color at 5% opacity.
|
|
418
|
+
* @default '#ffffff'
|
|
419
|
+
*/
|
|
420
|
+
trailColor?: TrailColor;
|
|
421
|
+
/**
|
|
422
|
+
* Trail rendering style.
|
|
423
|
+
* - `'default'`: solid color, alpha varies by intensity.
|
|
424
|
+
* - `'gradient-static'`: each dot's color is sampled from the `trailColor` gradient. Requires `trailColor` array.
|
|
425
|
+
* - `'gradient-animated'`: same as `gradient-static` but the gradient phase shifts over time.
|
|
426
|
+
* @default 'default'
|
|
427
|
+
*/
|
|
428
|
+
trailStyle?: TrailStyle;
|
|
429
|
+
/**
|
|
430
|
+
* Color of the skeleton dots. Accepts `#rrggbb`, `#rgb`, `rgb()`, `rgba()`, or `oklch()`.
|
|
431
|
+
* Pass `"transparent"` to disable the skeleton entirely.
|
|
432
|
+
* @default '#ffffff'
|
|
433
|
+
*/
|
|
434
|
+
skeletonColor?: string;
|
|
435
|
+
}
|
|
436
|
+
/**
|
|
437
|
+
* Framework-agnostic configuration shared by all canvas/SVG renderer bindings.
|
|
438
|
+
*
|
|
439
|
+
* Framework packages (React, Svelte, etc.) extend this with their specific
|
|
440
|
+
* surface: `class`/`className`, style type, event naming, bindable instance.
|
|
441
|
+
*/
|
|
442
|
+
interface BaseSarmalOptions {
|
|
443
|
+
curve: CurveDef;
|
|
444
|
+
trailColor?: TrailColor;
|
|
445
|
+
skeletonColor?: string;
|
|
446
|
+
headColor?: string;
|
|
447
|
+
trailStyle?: TrailStyle;
|
|
448
|
+
morphDuration?: number;
|
|
449
|
+
/** @default 'normalized' */
|
|
450
|
+
morphStrategy?: MorphStrategy;
|
|
451
|
+
trailLength?: number;
|
|
452
|
+
headRadius?: number;
|
|
453
|
+
trailWidth?: number;
|
|
454
|
+
autoStart?: boolean;
|
|
455
|
+
initialPhase?: number;
|
|
456
|
+
/** @default true */
|
|
457
|
+
pauseOnHidden?: boolean;
|
|
458
|
+
}
|
|
459
|
+
/**
|
|
460
|
+
* Framework-agnostic configuration shared by all dot matrix renderer bindings.
|
|
461
|
+
*
|
|
462
|
+
* Framework packages extend this with their specific surface: `class`/`className`, etc.
|
|
463
|
+
*/
|
|
464
|
+
interface BaseDotMatrixOptions extends DotMatrixSarmalOptions {
|
|
465
|
+
curve: CurveDef;
|
|
466
|
+
morphDuration?: number;
|
|
467
|
+
/** @default 'normalized' */
|
|
468
|
+
morphStrategy?: MorphStrategy;
|
|
469
|
+
}
|
|
350
470
|
|
|
351
|
-
export type { BaseRendererOptions as B, CurveDef as C,
|
|
471
|
+
export type { BaseRendererOptions as B, CurveDef as C, DotMatrixSarmalOptions as D, Engine as E, JumpOptions as J, MorphStrategy as M, Point as P, RendererOptions as R, SarmalInstance as S, TrailColor as T, DotMatrixRuntimeRenderOptions as a, ControlPoint as b, SarmalOptions as c, BaseDotMatrixOptions as d, BaseInit as e, BaseRuntimeRenderOptions as f, BaseSarmalOptions as g, CanvasInit as h, DotMatrixInit as i, RuntimeRenderOptions as j, SeekOptions as k, TrailStyle as l };
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sarmal/core",
|
|
3
|
-
"version": "0.37.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.37.4",
|
|
4
|
+
"description": "Animated curve library for loading states and ambient motion",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"animation",
|
|
7
7
|
"canvas",
|
|
8
8
|
"curve",
|
|
9
9
|
"loading",
|
|
10
|
-
"
|
|
11
|
-
"spinner",
|
|
10
|
+
"loading-indicator",
|
|
12
11
|
"svg",
|
|
13
|
-
"tanstack-intent"
|
|
12
|
+
"tanstack-intent",
|
|
13
|
+
"trail"
|
|
14
14
|
],
|
|
15
15
|
"homepage": "https://sarmal.art",
|
|
16
16
|
"bugs": {
|
package/skills/core/SKILL.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: core
|
|
3
|
-
description:
|
|
4
|
-
|
|
3
|
+
description: Animated curve library for the web. Use when adding animated curves,
|
|
4
|
+
loading indicators, or ambient motion with @sarmal/core — covers createSarmal (canvas),
|
|
5
5
|
createSarmalSVG, createSarmalDotMatrix, terminal renderer, built-in curves,
|
|
6
6
|
lifecycle, animation controls, and auto-init.
|
|
7
7
|
license: MIT
|
|
@@ -9,7 +9,7 @@ license: MIT
|
|
|
9
9
|
|
|
10
10
|
# @sarmal/core
|
|
11
11
|
|
|
12
|
-
sarmal renders
|
|
12
|
+
sarmal renders animated curves as loading indicators, thinking states, or ambient motion. It is a canvas or SVG renderer that animates a moving "head" dot leaving a fading trail along a curve path.
|
|
13
13
|
|
|
14
14
|
## Type definitions (read these first)
|
|
15
15
|
|