@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.
Files changed (45) hide show
  1. package/README.md +4 -4
  2. package/dist/auto-init.cjs.map +1 -1
  3. package/dist/auto-init.js.map +1 -1
  4. package/dist/curves/artemis2.d.cts +1 -1
  5. package/dist/curves/artemis2.d.ts +1 -1
  6. package/dist/curves/astroid.d.cts +1 -1
  7. package/dist/curves/astroid.d.ts +1 -1
  8. package/dist/curves/deltoid.d.cts +1 -1
  9. package/dist/curves/deltoid.d.ts +1 -1
  10. package/dist/curves/epicycloid3.d.cts +1 -1
  11. package/dist/curves/epicycloid3.d.ts +1 -1
  12. package/dist/curves/epitrochoid7.d.cts +1 -1
  13. package/dist/curves/epitrochoid7.d.ts +1 -1
  14. package/dist/curves/index.d.cts +1 -1
  15. package/dist/curves/index.d.ts +1 -1
  16. package/dist/curves/lame.d.cts +1 -1
  17. package/dist/curves/lame.d.ts +1 -1
  18. package/dist/curves/lissajous32.d.cts +1 -1
  19. package/dist/curves/lissajous32.d.ts +1 -1
  20. package/dist/curves/lissajous43.d.cts +1 -1
  21. package/dist/curves/lissajous43.d.ts +1 -1
  22. package/dist/curves/rose3.d.cts +1 -1
  23. package/dist/curves/rose3.d.ts +1 -1
  24. package/dist/curves/rose5.d.cts +1 -1
  25. package/dist/curves/rose5.d.ts +1 -1
  26. package/dist/curves/rose52.d.cts +1 -1
  27. package/dist/curves/rose52.d.ts +1 -1
  28. package/dist/curves/star.d.cts +1 -1
  29. package/dist/curves/star.d.ts +1 -1
  30. package/dist/curves/star4.d.cts +1 -1
  31. package/dist/curves/star4.d.ts +1 -1
  32. package/dist/curves/star7.d.cts +1 -1
  33. package/dist/curves/star7.d.ts +1 -1
  34. package/dist/index.cjs.map +1 -1
  35. package/dist/index.d.cts +12 -53
  36. package/dist/index.d.ts +12 -53
  37. package/dist/index.js.map +1 -1
  38. package/dist/{renderer-shared-Bcc_1IaT.d.cts → renderer-shared-9Xf6sIlx.d.cts} +1 -1
  39. package/dist/{renderer-shared-DWPVHjKZ.d.ts → renderer-shared-DElz98PT.d.ts} +1 -1
  40. package/dist/terminal.d.cts +2 -2
  41. package/dist/terminal.d.ts +2 -2
  42. package/dist/{types-B1XeFpuq.d.cts → types-D_ERoVvi.d.cts} +121 -1
  43. package/dist/{types-B1XeFpuq.d.ts → types-D_ERoVvi.d.ts} +121 -1
  44. package/package.json +5 -5
  45. package/skills/core/SKILL.md +3 -3
@@ -1,4 +1,4 @@
1
- import { P as Point } from './types-B1XeFpuq.cjs';
1
+ import { P as Point } from './types-D_ERoVvi.cjs';
2
2
 
3
3
  interface BoundaryResult {
4
4
  scale: number;
@@ -1,4 +1,4 @@
1
- import { P as Point } from './types-B1XeFpuq.js';
1
+ import { P as Point } from './types-D_ERoVvi.js';
2
2
 
3
3
  interface BoundaryResult {
4
4
  scale: number;
@@ -1,5 +1,5 @@
1
- import { C as CurveDef } from './types-B1XeFpuq.cjs';
2
- import { R as Rgb } from './renderer-shared-Bcc_1IaT.cjs';
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;
@@ -1,5 +1,5 @@
1
- import { C as CurveDef } from './types-B1XeFpuq.js';
2
- import { R as Rgb } from './renderer-shared-DWPVHjKZ.js';
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, DotMatrixRuntimeRenderOptions as D, Engine as E, JumpOptions as J, MorphStrategy as M, Point as P, RendererOptions as R, SarmalInstance as S, TrailColor as T, TrailStyle as a, ControlPoint as b, SarmalOptions as c, BaseRuntimeRenderOptions as d, RuntimeRenderOptions as e, SeekOptions as f };
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, DotMatrixRuntimeRenderOptions as D, Engine as E, JumpOptions as J, MorphStrategy as M, Point as P, RendererOptions as R, SarmalInstance as S, TrailColor as T, TrailStyle as a, ControlPoint as b, SarmalOptions as c, BaseRuntimeRenderOptions as d, RuntimeRenderOptions as e, SeekOptions as f };
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.1",
4
- "description": "Curve path based loading indicators and their renderer",
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
- "parametric",
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": {
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: core
3
- description: Parametric curve loading indicators for the web. Use when adding animated
4
- spinners or loading indicators with @sarmal/core — covers createSarmal (canvas),
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 parametric math curves as animated loading/thinking indicators. It is not a CSS spinner — it is a canvas or SVG renderer that animates a moving "head" dot leaving a fading trail along a curve path.
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