@statorjs/stator 2.0.0 → 2.0.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@statorjs/stator",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "Server-canonical web framework: business logic in composable state machines, UI as a thin renderer binding machine outputs to DOM positions. Ships TypeScript source (Vite/tsx-native by design).",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -88,7 +88,7 @@
88
88
  "pino-pretty": "^13.1.3",
89
89
  "vite": "^6.0.0",
90
90
  "vitest": "^2.1.0",
91
- "@statorjs/stator": "2.0.0"
91
+ "@statorjs/stator": "2.0.1"
92
92
  },
93
93
  "scripts": {
94
94
  "typecheck": "tsc --noEmit",
@@ -33,15 +33,22 @@ export interface DefineMachineConfig<
33
33
  emits?: EmitsConfig<C, E>
34
34
  context: C
35
35
  initial: NoInfer<S>
36
- /** Transitions see `helpers.reads` typed as `ReadsMap<TReads>`. */
37
- states: Record<S, StateNode<C, E, S, ReadsMap<TReads>>>
36
+ /** Transitions see `helpers.reads` typed as `ReadsMap<TReads>`.
37
+ *
38
+ * The state union S is inferred from this map's KEYS and nowhere else —
39
+ * every interior S position (`to:`, the machine-level `on:`) is NoInfer.
40
+ * Without that, `to:` string literals become competing inference
41
+ * candidates, and whenever they don't happen to cover every state the
42
+ * union silently collapses to the covered subset (surfaced by the store's
43
+ * cart machine when its line ops moved to machine-level `on:`). */
44
+ states: Record<S, StateNode<C, E, NoInfer<S>, ReadsMap<TReads>>>
38
45
  /** Machine-level transitions: handlers that apply in ANY state, consulted only
39
46
  * when the current state does not declare the event (a state-scoped handler
40
47
  * always wins). The home for a completion event whose handling must not depend
41
48
  * on an unrelated machine-wide state — e.g. a per-record save completing while
42
49
  * the machine is busy reloading the collection. Without this, such a
43
50
  * completion is dropped wherever the current state has no handler for it. */
44
- on?: OnMap<C, E, S, ReadsMap<TReads>>
51
+ on?: OnMap<C, E, NoInfer<S>, ReadsMap<TReads>>
45
52
  selectors?: Sel
46
53
  /** APP machines only: persist this machine's snapshot through the AppStore
47
54
  * so its state survives restarts. Opt-in — caches and other
@@ -62,6 +62,7 @@ export interface GlobalHTMLAttributes {
62
62
 
63
63
  /** Per-element extra attributes. Extend as components need them. */
64
64
  export interface ElementSpecificAttributes {
65
+ time: { datetime?: string }
65
66
  a: { href?: string; target?: string; rel?: string; download?: string | boolean }
66
67
  button: {
67
68
  type?: 'submit' | 'reset' | 'button'