kuinetic 0.2.0 → 0.2.2

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.
@@ -7,10 +7,6 @@ import type { Animator } from '../core/animator.js';
7
7
  import { type AdvancedEnv, type WindowLike, type RafFunction, type CafFunction, clamp } from './base.js';
8
8
  import { type AudioBand } from './audio.js';
9
9
  export { clamp };
10
- export type CameraParamAccessor = EffectParams | {
11
- num?: (name: string, fallback?: number) => number;
12
- text?: (name: string, fallback?: string) => string;
13
- };
14
10
  export interface CameraLayer {
15
11
  element: HTMLElement;
16
12
  depthZ: number;
@@ -6,10 +6,6 @@ import type { Registry } from '../core/registry.js';
6
6
  import type { Animator } from '../core/animator.js';
7
7
  import { type AdvancedEnv, type WindowLike, type DocumentLike, type RafFunction, type CafFunction, clamp } from './base.js';
8
8
  export { clamp };
9
- export type FluidParamAccessor = EffectParams | {
10
- num?: (name: string, fallback?: number) => number;
11
- text?: (name: string, fallback?: string) => string;
12
- };
13
9
  export interface FluidDrop {
14
10
  x: number;
15
11
  y: number;
@@ -6,10 +6,6 @@ import type { Registry } from '../core/registry.js';
6
6
  import type { Animator } from '../core/animator.js';
7
7
  import { type AdvancedEnv, type WindowLike, type DocumentLike, type RafFunction, type CafFunction, clamp } from './base.js';
8
8
  export { clamp };
9
- export type ParticleParamAccessor = EffectParams | {
10
- num?: (name: string, fallback?: number) => number;
11
- text?: (name: string, fallback?: string) => string;
12
- };
13
9
  export interface Particle {
14
10
  x: number;
15
11
  y: number;
@@ -6,10 +6,6 @@ import type { Registry } from '../core/registry.js';
6
6
  import type { Animator } from '../core/animator.js';
7
7
  import { type AdvancedEnv, type WindowLike, type RafFunction, type CafFunction, clamp, lerp } from './base.js';
8
8
  export { clamp, lerp };
9
- export type SceneParamAccessor = EffectParams | {
10
- num?: (name: string, fallback?: number) => number;
11
- text?: (name: string, fallback?: string) => string;
12
- };
13
9
  export interface TransitionValue {
14
10
  from: number;
15
11
  to: number;
@@ -39,16 +39,21 @@
39
39
  *
40
40
  * ## Opt-out
41
41
  *
42
- * `data-kui-manual` on a bundle's own `<script>` tag means "this bundle does not auto-init". Put it
43
- * on every tag to get exactly the pre-auto-start behaviour back. Marking *core* manual necessarily
44
- * disables the whole chain, because core is the only thing that creates an animator — so a tier
45
- * that sees core go manual stays quiet rather than complaining that core is missing.
42
+ * `data-kui-manual` on a bundle's own `<script>` tag means "this bundle does not auto-init". On a
43
+ * tier it takes that tier out entirely. On *core* it means "do not auto-START": core makes no
44
+ * animator and starts nothing, and the author builds one by hand, as before auto-start existed.
45
+ * It does not mean "do not wire tiers" — a page that loads `kuinetic.advanced.js` next to a manual
46
+ * core still wants the advanced effects on the animator it builds. So core keeps its factory
47
+ * wrapped in a registration-only mode (`guarded`, below): every animator built by hand gets the
48
+ * tiers that have loaded, in either tag order, before its first scan whenever that is possible.
46
49
  */
47
50
  /** Only what this file calls. Structural, because it cannot import the real types. */
48
51
  interface AnimatorLike {
49
52
  start(): unknown;
50
53
  scan(root?: ParentNode): unknown;
51
54
  reset(el: Element): void;
55
+ /** Present on the real `Animator`; a destroyed one must stop receiving tiers. */
56
+ destroy?(): unknown;
52
57
  }
53
58
  type Options = Record<string, unknown>;
54
59
  /** The IIFE namespace object a bundle built with `--global-name=kuinetic` exposes. */
@@ -235,8 +235,19 @@ export interface ActivationDiagnosticsRequest {
235
235
  spec: ActivationSpec;
236
236
  /** Declared support from the composed primitives; empty means no primitive claimed anything. */
237
237
  supported: NamedActivation[];
238
+ /**
239
+ * What each composed effect declares on its own. Optional: without it the check can only compare
240
+ * against the intersection in `supported`, exactly as it did before compositions were told apart.
241
+ */
242
+ claims?: ActivationSupportClaim[];
238
243
  reporter: Reporter;
239
244
  }
245
+ /** One composed effect's own declaration, as `compile.ts` records it. */
246
+ export interface ActivationSupportClaim {
247
+ supported: NamedActivation[];
248
+ /** The effect is an entrance — a reveal, which is what an `enter` trigger is written for. */
249
+ entrance: boolean;
250
+ }
240
251
  /**
241
252
  * Report every way an authored activation looks like a mistake.
242
253
  *
@@ -1,3 +1,4 @@
1
+ import type { ActivationSupportClaim } from './activation.js';
1
2
  import type { Registry, ResolvedEffect } from './registry.js';
2
3
  import type { SequenceStep } from './sequence.js';
3
4
  import type { TargetScope } from './target.js';
@@ -115,6 +116,12 @@ export interface CompiledPlan {
115
116
  defaultActivation?: Activation;
116
117
  /** Activations every composed primitive supports, for enforcement by the animator. */
117
118
  supportedActivations: NamedActivation[];
119
+ /**
120
+ * What each composed effect declares on its own, in authoring order. `supportedActivations` above
121
+ * is their intersection and cannot say *which* effect a trigger does not suit, or whether an
122
+ * entrance beside it is what the trigger was written for — `warnAboutActivation` needs both.
123
+ */
124
+ activationClaims: ActivationSupportClaim[];
118
125
  /**
119
126
  * Timelines every composed primitive supports. Empty means none — `style-plan.ts` must not
120
127
  * apply a native `view()`/`scroll()` timeline the author's effect doesn't declare support for,
@@ -6,7 +6,6 @@ import type { ElementConfig } from '../element-config.js';
6
6
  import type { Registry } from '../registry.js';
7
7
  import type { Reporter } from '../reporter.js';
8
8
  import type { Activation, InstanceState, ParsedValue, Timeline } from '../types.js';
9
- export type { StaggerGroupKeys } from '../stagger-config.js';
10
9
  /** Everything `Animator.install` needs. Moved here verbatim from `animator.ts`'s own
11
10
  * `InstallRequest`, plus three optional fields that are absent for every HEAD code path. */
12
11
  export interface InstallRequest {
@@ -49,8 +49,13 @@ export interface GestureOptions {
49
49
  * shell swallowed every click on its own dots and buttons, because the click was delivered to the
50
50
  * shell. `swipeable` recognises and publishes an attribute — it never moves anything — so it has
51
51
  * nothing to stay under the cursor for and opts out.
52
+ *
53
+ * `'drag'` is the middle path for a gesture that moves nothing but must still *finish*: no capture
54
+ * on `pointerdown` (so a tap or click reaches its real target), capture once movement crosses the
55
+ * threshold. A flick that leaves a small element otherwise never delivers `pointerup` to it, and
56
+ * the swipe is never reported. A drag is not a click, so retargeting after it costs nothing.
52
57
  */
53
- capturePointer?: boolean;
58
+ capturePointer?: boolean | 'drag';
54
59
  }
55
60
  export interface GestureDeps {
56
61
  now(): number;
@@ -2,7 +2,7 @@ import type { StyleLedger } from './owned-styles.js';
2
2
  import type { Reporter } from './reporter.js';
3
3
  import type { StaggerFrom, StaggerGroupKeys, StaggerLayout } from './stagger-config.js';
4
4
  export { parseStaggerAttribute, resolveStaggerConfig } from './stagger-config.js';
5
- export type { GridOrigin, StaggerAxis, StaggerColumns, StaggerConfig, StaggerFrom, StaggerGroupKeys, StaggerLayout, } from './stagger-config.js';
5
+ export type { StaggerFrom, StaggerGroupKeys, StaggerLayout, } from './stagger-config.js';
6
6
  /**
7
7
  * Rank every child of a group of `count` animated children.
8
8
  *
package/package.json CHANGED
@@ -1,9 +1,14 @@
1
1
  {
2
2
  "name": "kuinetic",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
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",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/AINSEP/kuinetic.git"
10
+ },
11
+ "homepage": "https://kuinetic.com",
7
12
  "sideEffects": [
8
13
  "*.css"
9
14
  ],
@@ -58,6 +63,9 @@
58
63
  "test:browser": "npm run build && node scripts/run-browser-tests.mjs",
59
64
  "test:visual": "npm run build && node scripts/visual-regression.mjs",
60
65
  "test:visual:update": "npm run build && node scripts/visual-regression.mjs --update",
66
+ "test:visual:pages": "npm run build && node scripts/visual-regression-pages.mjs",
67
+ "test:visual:pages:update": "npm run build && node scripts/visual-regression-pages.mjs --update",
68
+ "test:pages": "npm run build && node scripts/run-browser-tests.mjs --only page-",
61
69
  "generate:css": "node scripts/generate-preset-css.mjs",
62
70
  "generate:nav": "node scripts/generate-nav-header.mjs",
63
71
  "record": "npm run build && node scripts/verify-browser.mjs --record",
@@ -84,7 +92,6 @@
84
92
  "pngjs": "^7.0.0",
85
93
  "size-limit": "^13.0.3",
86
94
  "tailwindcss": "^4.3.3",
87
- "three": "^0.186.0",
88
95
  "typescript": "^5.9.3",
89
96
  "typescript-eslint": "^8.66.0",
90
97
  "vitest": "^2.1.9"