uidex 0.7.0 → 0.9.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 (51) hide show
  1. package/dist/cli/cli.cjs +1112 -1054
  2. package/dist/cli/cli.cjs.map +1 -1
  3. package/dist/headless/index.cjs +4 -448
  4. package/dist/headless/index.cjs.map +1 -1
  5. package/dist/headless/index.d.cts +41 -11
  6. package/dist/headless/index.d.ts +41 -11
  7. package/dist/headless/index.js +4 -450
  8. package/dist/headless/index.js.map +1 -1
  9. package/dist/index.cjs +147 -3252
  10. package/dist/index.cjs.map +1 -1
  11. package/dist/index.d.cts +43 -316
  12. package/dist/index.d.ts +43 -316
  13. package/dist/index.js +133 -3254
  14. package/dist/index.js.map +1 -1
  15. package/dist/playwright/index.cjs +175 -0
  16. package/dist/playwright/index.cjs.map +1 -1
  17. package/dist/playwright/index.d.cts +2 -0
  18. package/dist/playwright/index.d.ts +2 -0
  19. package/dist/playwright/index.js +167 -0
  20. package/dist/playwright/index.js.map +1 -1
  21. package/dist/playwright/states-reporter.cjs +123 -0
  22. package/dist/playwright/states-reporter.cjs.map +1 -0
  23. package/dist/playwright/states-reporter.d.cts +46 -0
  24. package/dist/playwright/states-reporter.d.ts +46 -0
  25. package/dist/playwright/states-reporter.js +88 -0
  26. package/dist/playwright/states-reporter.js.map +1 -0
  27. package/dist/playwright/states.cjs +118 -0
  28. package/dist/playwright/states.cjs.map +1 -0
  29. package/dist/playwright/states.d.cts +120 -0
  30. package/dist/playwright/states.d.ts +120 -0
  31. package/dist/playwright/states.js +88 -0
  32. package/dist/playwright/states.js.map +1 -0
  33. package/dist/react/index.cjs +163 -3255
  34. package/dist/react/index.cjs.map +1 -1
  35. package/dist/react/index.d.cts +62 -275
  36. package/dist/react/index.d.ts +62 -275
  37. package/dist/react/index.js +151 -3268
  38. package/dist/react/index.js.map +1 -1
  39. package/dist/scan/index.cjs +1292 -345
  40. package/dist/scan/index.cjs.map +1 -1
  41. package/dist/scan/index.d.cts +305 -12
  42. package/dist/scan/index.d.ts +305 -12
  43. package/dist/scan/index.js +1283 -345
  44. package/dist/scan/index.js.map +1 -1
  45. package/package.json +12 -16
  46. package/dist/cloud/index.cjs +0 -682
  47. package/dist/cloud/index.cjs.map +0 -1
  48. package/dist/cloud/index.d.cts +0 -270
  49. package/dist/cloud/index.d.ts +0 -270
  50. package/dist/cloud/index.js +0 -645
  51. package/dist/cloud/index.js.map +0 -1
@@ -12,6 +12,32 @@ interface EntityRef {
12
12
  kind: EntityKind;
13
13
  id: string;
14
14
  }
15
+ /**
16
+ * The four kinds every captured route is expected to render — the state-matrix
17
+ * axis. A capture that only shoots the happy path leaves most of the value on
18
+ * the table, so a missing core kind must be captured, waived (the page CANNOT
19
+ * render it), or acknowledged in the MISSING_KINDS baseline.
20
+ */
21
+ declare const CORE_STATE_KINDS: readonly ["loading", "empty", "populated", "error"];
22
+ type CoreStateKind = (typeof CORE_STATE_KINDS)[number];
23
+ /** `variant` is any state outside the matrix (a dialog, wizard step, multi-currency…). */
24
+ type StateKind = CoreStateKind | "variant";
25
+ /**
26
+ * A declared render state of an entity — the "story"-like unit: a named
27
+ * condition the page/feature/widget can render in (loading / empty / error /
28
+ * multi-currency / …). Enumerated on the entity (not derived from syntax), it
29
+ * is the contract the visual-states capture must satisfy and the anchor for
30
+ * per-state acceptance criteria. Fixtures + capture mechanics stay in the spec;
31
+ * the registry holds only the name (+ optional kind / per-state acceptance).
32
+ */
33
+ interface StateDecl {
34
+ name: string;
35
+ /** Canonical kind for the state-matrix axis (defaults to `variant`). */
36
+ kind?: StateKind;
37
+ /** Acceptance criteria that only this state can evidence. */
38
+ acceptance?: string[];
39
+ description?: string;
40
+ }
15
41
  interface Metadata {
16
42
  name?: string;
17
43
  description?: string;
@@ -21,6 +47,21 @@ interface Metadata {
21
47
  flows?: readonly string[];
22
48
  features?: string[];
23
49
  widgets?: string[];
50
+ /** Declared render states (see StateDecl); the capture-completeness gate. */
51
+ states?: StateDecl[];
52
+ /**
53
+ * `false` opts this page/feature/widget out of visual-states capture forever
54
+ * (a redirect, a static notice, an internal target). The page-coverage gate
55
+ * treats an opted-out route as accounted-for. Reason belongs in `description`.
56
+ */
57
+ capture?: boolean;
58
+ /**
59
+ * Per-core-kind waivers: a core kind this page's route legitimately CANNOT
60
+ * render (a create form has no `empty`), mapped to a substantive reason. The
61
+ * state-matrix gate treats a waived kind as accounted-for. A waiver is a
62
+ * permanent design statement — unlike MISSING_KINDS backlog, which is debt.
63
+ */
64
+ waivers?: Partial<Record<CoreStateKind, string>>;
24
65
  }
25
66
  interface EntityWithMetaBase {
26
67
  id: string;
@@ -102,12 +143,6 @@ interface Registry {
102
143
  onReportsChange(cb: () => void): () => void;
103
144
  }
104
145
 
105
- interface UserIdentity {
106
- id: string;
107
- name?: string;
108
- avatar?: string;
109
- }
110
-
111
146
  type ThemePreference = "light" | "dark" | "auto";
112
147
  type ResolvedTheme = "light" | "dark";
113
148
  interface ViewStackEntry {
@@ -122,11 +157,6 @@ interface SessionSnapshot {
122
157
  mode: SurfaceMode;
123
158
  theme: ThemePreference;
124
159
  resolvedTheme: ResolvedTheme;
125
- /**
126
- * Identity for the local user. Set once at session creation; gates realtime
127
- * features (cursor labels, presence) and auto-populates report attribution.
128
- */
129
- user: UserIdentity | null;
130
160
  }
131
161
  type SessionState = SessionSnapshot;
132
162
 
@@ -12,6 +12,32 @@ interface EntityRef {
12
12
  kind: EntityKind;
13
13
  id: string;
14
14
  }
15
+ /**
16
+ * The four kinds every captured route is expected to render — the state-matrix
17
+ * axis. A capture that only shoots the happy path leaves most of the value on
18
+ * the table, so a missing core kind must be captured, waived (the page CANNOT
19
+ * render it), or acknowledged in the MISSING_KINDS baseline.
20
+ */
21
+ declare const CORE_STATE_KINDS: readonly ["loading", "empty", "populated", "error"];
22
+ type CoreStateKind = (typeof CORE_STATE_KINDS)[number];
23
+ /** `variant` is any state outside the matrix (a dialog, wizard step, multi-currency…). */
24
+ type StateKind = CoreStateKind | "variant";
25
+ /**
26
+ * A declared render state of an entity — the "story"-like unit: a named
27
+ * condition the page/feature/widget can render in (loading / empty / error /
28
+ * multi-currency / …). Enumerated on the entity (not derived from syntax), it
29
+ * is the contract the visual-states capture must satisfy and the anchor for
30
+ * per-state acceptance criteria. Fixtures + capture mechanics stay in the spec;
31
+ * the registry holds only the name (+ optional kind / per-state acceptance).
32
+ */
33
+ interface StateDecl {
34
+ name: string;
35
+ /** Canonical kind for the state-matrix axis (defaults to `variant`). */
36
+ kind?: StateKind;
37
+ /** Acceptance criteria that only this state can evidence. */
38
+ acceptance?: string[];
39
+ description?: string;
40
+ }
15
41
  interface Metadata {
16
42
  name?: string;
17
43
  description?: string;
@@ -21,6 +47,21 @@ interface Metadata {
21
47
  flows?: readonly string[];
22
48
  features?: string[];
23
49
  widgets?: string[];
50
+ /** Declared render states (see StateDecl); the capture-completeness gate. */
51
+ states?: StateDecl[];
52
+ /**
53
+ * `false` opts this page/feature/widget out of visual-states capture forever
54
+ * (a redirect, a static notice, an internal target). The page-coverage gate
55
+ * treats an opted-out route as accounted-for. Reason belongs in `description`.
56
+ */
57
+ capture?: boolean;
58
+ /**
59
+ * Per-core-kind waivers: a core kind this page's route legitimately CANNOT
60
+ * render (a create form has no `empty`), mapped to a substantive reason. The
61
+ * state-matrix gate treats a waived kind as accounted-for. A waiver is a
62
+ * permanent design statement — unlike MISSING_KINDS backlog, which is debt.
63
+ */
64
+ waivers?: Partial<Record<CoreStateKind, string>>;
24
65
  }
25
66
  interface EntityWithMetaBase {
26
67
  id: string;
@@ -102,12 +143,6 @@ interface Registry {
102
143
  onReportsChange(cb: () => void): () => void;
103
144
  }
104
145
 
105
- interface UserIdentity {
106
- id: string;
107
- name?: string;
108
- avatar?: string;
109
- }
110
-
111
146
  type ThemePreference = "light" | "dark" | "auto";
112
147
  type ResolvedTheme = "light" | "dark";
113
148
  interface ViewStackEntry {
@@ -122,11 +157,6 @@ interface SessionSnapshot {
122
157
  mode: SurfaceMode;
123
158
  theme: ThemePreference;
124
159
  resolvedTheme: ResolvedTheme;
125
- /**
126
- * Identity for the local user. Set once at session creation; gates realtime
127
- * features (cursor labels, presence) and auto-populates report attribution.
128
- */
129
- user: UserIdentity | null;
130
160
  }
131
161
  type SessionState = SessionSnapshot;
132
162