kuinetic 0.2.3 → 0.3.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.
Files changed (76) hide show
  1. package/README.md +2 -2
  2. package/dist/esm/advanced/index.mjs +1 -1
  3. package/dist/esm/{chunk-FYMZW5N2.mjs → chunk-4QKMEDM4.mjs} +6745 -2562
  4. package/dist/esm/{chunk-FASAEQDR.mjs → chunk-7NW4OLOC.mjs} +506 -29
  5. package/dist/esm/{chunk-MZQG2VMG.mjs → chunk-DAVDOYOS.mjs} +92 -495
  6. package/dist/esm/{chunk-AEQGC2KM.mjs → chunk-EDFJTT5B.mjs} +2 -1
  7. package/dist/esm/core/index.mjs +3 -3
  8. package/dist/esm/effects/index.mjs +3 -3
  9. package/dist/esm/index.mjs +4 -4
  10. package/dist/esm/notes/index.mjs +284 -5
  11. package/dist/kuinetic.advanced.js +2 -1
  12. package/dist/kuinetic.advanced.min.js +1 -1
  13. package/dist/kuinetic.all.js +5158 -930
  14. package/dist/kuinetic.all.min.js +2 -2
  15. package/dist/kuinetic.css +1207 -73
  16. package/dist/kuinetic.js +5157 -929
  17. package/dist/kuinetic.min.css +1 -1
  18. package/dist/kuinetic.min.js +1 -1
  19. package/dist/kuinetic.notes.js +1 -1
  20. package/dist/types/advanced/shaders.d.ts +1 -1
  21. package/dist/types/core/channels.d.ts +1 -1
  22. package/dist/types/core/easing.d.ts +9 -0
  23. package/dist/types/core/effect-context.d.ts +5 -0
  24. package/dist/types/core/element-config.d.ts +2 -0
  25. package/dist/types/core/flip.d.ts +25 -1
  26. package/dist/types/core/gesture.d.ts +5 -0
  27. package/dist/types/core/image-flight.d.ts +23 -0
  28. package/dist/types/core/js-effect-preparer.d.ts +3 -1
  29. package/dist/types/core/owned-styles.d.ts +2 -1
  30. package/dist/types/core/params.d.ts +1 -1
  31. package/dist/types/core/parse.d.ts +1 -0
  32. package/dist/types/core/registry.d.ts +1 -1
  33. package/dist/types/core/types.d.ts +11 -1
  34. package/dist/types/effects/auto-motion.d.ts +8 -0
  35. package/dist/types/effects/carousel/archive.d.ts +18 -0
  36. package/dist/types/effects/carousel/coast.d.ts +7 -0
  37. package/dist/types/effects/carousel/deck.d.ts +26 -2
  38. package/dist/types/effects/carousel/drag.d.ts +19 -7
  39. package/dist/types/effects/carousel/glide.d.ts +89 -0
  40. package/dist/types/effects/carousel/index.d.ts +7 -0
  41. package/dist/types/effects/carousel/line.d.ts +10 -0
  42. package/dist/types/effects/carousel/row-copies.d.ts +10 -0
  43. package/dist/types/effects/carousel/row.d.ts +3 -0
  44. package/dist/types/effects/carousel/shape-fit.d.ts +46 -0
  45. package/dist/types/effects/carousel/sources.d.ts +26 -0
  46. package/dist/types/effects/carousel/sphere.d.ts +23 -0
  47. package/dist/types/effects/carousel/stack.d.ts +4 -3
  48. package/dist/types/effects/catalog/confetti.d.ts +2 -0
  49. package/dist/types/effects/catalog/cursor-trail.d.ts +2 -0
  50. package/dist/types/effects/catalog/curtains.d.ts +2 -0
  51. package/dist/types/effects/catalog/image-flight.d.ts +2 -0
  52. package/dist/types/effects/catalog/line-boil.d.ts +2 -0
  53. package/dist/types/effects/catalog/number-tokens.d.ts +5 -0
  54. package/dist/types/effects/catalog/numbers-shared.d.ts +3 -4
  55. package/dist/types/effects/catalog/text-shared.d.ts +13 -6
  56. package/dist/types/effects/catalog/typewriter-scatter.d.ts +5 -0
  57. package/dist/types/effects/catalog/view-transitions.d.ts +32 -1
  58. package/dist/types/effects/catalog/wobble.d.ts +2 -0
  59. package/dist/types/effects/gestures/drag-options.d.ts +17 -0
  60. package/dist/types/effects/layout/departures.d.ts +21 -0
  61. package/dist/types/effects/motion-path/fit.d.ts +4 -0
  62. package/dist/types/effects/scroll-mechanics/progress-output.d.ts +9 -0
  63. package/dist/types/effects/step-marking.d.ts +7 -4
  64. package/dist/types/effects/svg/morph-loop.d.ts +5 -0
  65. package/dist/types/effects/svg/text-path.d.ts +2 -0
  66. package/dist/types/effects/three-d/cube.d.ts +2 -0
  67. package/dist/types/effects/tween/index.d.ts +2 -1
  68. package/dist/types/effects/tween/properties.d.ts +1 -1
  69. package/dist/types/effects/tween/toggle.d.ts +6 -0
  70. package/dist/types/notes/effects.d.ts +1 -0
  71. package/dist/types/notes/index.d.ts +11 -0
  72. package/dist/types/notes/showcase.d.ts +1 -0
  73. package/dist/types/showcase/lightbox-flight.d.ts +11 -0
  74. package/dist/types/showcase/lightbox.d.ts +2 -1
  75. package/dist/types/showcase/modal-shell.d.ts +5 -0
  76. package/package.json +1 -1
@@ -50,8 +50,10 @@ export type StepState = 'before' | 'active' | 'after';
50
50
  * link ledgers and the inline-style ledger they were both modelled on.
51
51
  */
52
52
  export interface StepMarker {
53
- /** Stamp `before`/`active`/`after` across the tracked elements. Cheap enough to call per flip. */
54
- mark(index: number): void;
53
+ /** Stamp state; drift opts controls into live distance without the shape-only offset attribute. */
54
+ mark(index: number, drift?: number): void;
55
+ /** Update only cached control distances between full marks; never resolves or stamps attributes. */
56
+ updateDistance(drift: number): void;
55
57
  /** Give every touched element back the attribute value it had before this instance existed. */
56
58
  restore: Cleanup;
57
59
  }
@@ -60,16 +62,17 @@ export interface StepMarker {
60
62
  *
61
63
  * `resolve` is called per flip rather than once at setup, so a list rendered or reordered after
62
64
  * this element was prepared is still picked up. Flips are rare — the caller is expected to guard on
63
- * the index actually changing — while frames are not.
65
+ * the index actually changing — while frames use `updateDistance` with the cached control offsets.
64
66
  *
65
67
  * @param resolve - Produces the current step elements, in document order.
66
68
  * @param warn - Optional diagnostic sink, called at most once per marker. Callers prefix their own
67
69
  * effect name, the way every other warning in this library names the attribute to go and fix.
70
+ * @param groupSize - For controls, use consecutive groups of this many slides instead of parents.
68
71
  * @returns A marker; call `restore` from the primitive's teardown.
69
72
  * @complexity O(n) per `mark` in the number of step elements; O(n) space in elements ever touched.
70
73
  * @overallScore 100
71
74
  */
72
- export declare function createStepMarker(resolve: () => Iterable<Element>, warn?: (message: string) => void): StepMarker;
75
+ export declare function createStepMarker(resolve: () => Iterable<Element>, warn?: (message: string) => void, groupSize?: () => number): StepMarker;
73
76
  /**
74
77
  * Where one step sits relative to the live one, as a signed number of places *around a ring*.
75
78
  *
@@ -0,0 +1,5 @@
1
+ import type { PrepareContext } from '../../core/effect-context.js';
2
+ import type { SetupResult } from '../../core/instances.js';
3
+ import type { EffectParams } from '../../core/types.js';
4
+ /** An opt-in loop; the interactive morph's listeners, timing and geometry remain separate. */
5
+ export declare function prepareMorphLoop(path: Element, params: EffectParams, ctx: PrepareContext): SetupResult;
@@ -0,0 +1,2 @@
1
+ import type { Primitive } from '../../core/types.js';
2
+ export declare const TEXT_PATH_PRIMITIVE: Primitive;
@@ -0,0 +1,2 @@
1
+ import type { Primitive } from '../../core/types.js';
2
+ export declare const cubeVariant: NonNullable<Primitive['variantFor']>;
@@ -18,7 +18,8 @@ export declare const TWEEN_PRIMITIVES: Primitive[];
18
18
  * 0) ...`, not a missing endpoint — so, per D1's correction #5, `animation-fill-mode: both` pins that
19
19
  * exact authored value on the channel forever once the animation finishes; it never resolves against
20
20
  * whatever the cascade underneath would otherwise say. That is precisely the shape `EffectPhase`'s
21
- * own doc calls out as the trap: fifteen of the catalog's fifty-four `cloak: true` entrances close
21
+ * own doc calls out as the trap: fifteen of the catalog's `cloak: true` entrances (ninety-six presets carry the flag in all,
22
+ * counted from the registry) close
22
23
  * their block the same way and are *deliberately* left unphased rather than marked `entrance`,
23
24
  * because `entrance` specifically means "plays once and releases the channel". `tween` is that same
24
25
  * closed shape by construction — every property group's `to` block closes, with no exception — so it
@@ -20,7 +20,7 @@ import type { Channel, ParamSpec, ParameterSchema } from '../../core/types.js';
20
20
  * fallbacks mean for an axis the author did not name.
21
21
  */
22
22
  /** One rendering unit: a single CSS property (or filter list) written by one keyframe block. */
23
- export type TweenGroup = 'translate' | 'rotate' | 'scale' | 'opacity' | 'filter' | 'color' | 'background';
23
+ export type TweenGroup = 'translate' | 'rotate' | 'scale' | 'opacity' | 'filter' | 'color' | 'background' | 'border-radius';
24
24
  /**
25
25
  * Declared in rendering order rather than derived from `TWEEN_PROPERTIES`'s key order, so
26
26
  * `tween opacity:0 x:100` and `tween x:100 opacity:0` compile to the same track order. Two
@@ -0,0 +1,6 @@
1
+ import type { PrepareContext } from '../../core/effect-context.js';
2
+ import type { Cleanup } from '../../core/types.js';
3
+ import type { TweenGroup } from './properties.js';
4
+ export declare function toggleProperty(group: TweenGroup): string;
5
+ /** Clicks write opted-in destinations or release to the current stylesheet; no style reads. */
6
+ export declare function prepareToggle(el: Element, groups: readonly TweenGroup[], ctx: PrepareContext): Cleanup;
@@ -0,0 +1 @@
1
+ export declare const EFFECT_NOTES: Readonly<Record<string, readonly string[]>>;
@@ -1,4 +1,5 @@
1
1
  import type { ParamNotes } from '../core/describe.js';
2
+ import { EFFECT_NOTES } from './effects.js';
2
3
  /**
3
4
  * The plain-words note for every parameter in the bundled catalog, read by `describe()`.
4
5
  *
@@ -11,3 +12,13 @@ import type { ParamNotes } from '../core/describe.js';
11
12
  * resolve a note, and every key here must name a parameter that exists.
12
13
  */
13
14
  export declare const PARAM_NOTES: ParamNotes;
15
+ /**
16
+ * Plain-words notes about whole effects, keyed by preset name, shown on the Notes tab of the
17
+ * "Show code" popover. Prose only documentation pages read, so it lives in this entry beside
18
+ * `PARAM_NOTES` rather than on each preset, for the same reason: inline, it would ship to every
19
+ * visitor of every site using the library.
20
+ *
21
+ * Kept in step with the registry by `test/param-notes.test.ts`: every key must name a registered
22
+ * preset. Not every preset needs an entry; the tab only appears for those that have one.
23
+ */
24
+ export { EFFECT_NOTES };
@@ -5,3 +5,4 @@ import type { ParamNotes } from '../core/describe.js';
5
5
  * step-progress).
6
6
  */
7
7
  export declare const SHOWCASE_NOTES: ParamNotes;
8
+ export declare const ROW_NOTES: ParamNotes;
@@ -0,0 +1,11 @@
1
+ import type { ModalMotion } from './modal-shell.js';
2
+ interface LightboxFlightOptions {
3
+ source: () => HTMLImageElement | null;
4
+ view: HTMLImageElement;
5
+ duration: number;
6
+ easing: string;
7
+ warn(message: string): void;
8
+ }
9
+ /** The shell owns this handle across decode, open, reverse, re-entry and release. */
10
+ export declare function lightboxFlight(dialog: HTMLElement, options: LightboxFlightOptions): ModalMotion;
11
+ export {};
@@ -6,7 +6,8 @@ import type { Cleanup, Preset, Primitive } from '../core/types.js';
6
6
  *
7
7
  * Every card of the deck becomes one gallery, opened at the card clicked, through the same
8
8
  * `galleryContent` the `lightbox` effect opens — buttons, keys, swipe, `loop`, the media rules and
9
- * the one shared modal shell, unforked.
9
+ * the one shared modal shell, unforked. Decks have no params of their own here, so they always get
10
+ * the default arrow placement (`bottom-right`).
10
11
  *
11
12
  * What counts as a click is the deck's to say, and it already says it. The listener is on the host
12
13
  * in the *bubble* phase, and a deck's drag consumes the click that ends a drag in the *capture*
@@ -1,3 +1,7 @@
1
+ export interface ModalMotion {
2
+ dismiss(): Promise<unknown> | undefined;
3
+ cancel(): void;
4
+ }
1
5
  export interface ModalContent {
2
6
  node: HTMLElement;
3
7
  label: string;
@@ -18,6 +22,7 @@ export interface ModalContent {
18
22
  * pauses its own motion for exactly as long as the viewer shows one of its cards.
19
23
  */
20
24
  opener?: Element;
25
+ motion?: (layer: HTMLElement) => ModalMotion;
21
26
  }
22
27
  export interface ModalShell {
23
28
  open(content: ModalContent): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kuinetic",
3
- "version": "0.2.3",
3
+ "version": "0.3.0",
4
4
  "description": "Declarative web animation from HTML attributes. Native CSS where possible, JS only where necessary.",
5
5
  "type": "module",
6
6
  "license": "MIT",