@mt-gloss/ui 0.1.98 → 0.1.100

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.
@@ -1,11 +1,27 @@
1
1
  import { RefObject } from 'react';
2
2
  export type BellCutoutMode = 'default' | 'lock' | 'unread-count';
3
3
  export interface BellCutoutProps {
4
- /** null → no chrome rendered. 'default' / 'lock' / 'unread-count' → chrome with corresponding data-mode. */
5
- mode: BellCutoutMode | null;
4
+ /**
5
+ * Explicit prop-supplied mode (back-compat DEV-probe path). When
6
+ * subscribeToCoordinator=true (default) and ctx.state.lockHint != null,
7
+ * the ctx value WINS and this prop is ignored.
8
+ */
9
+ mode?: BellCutoutMode | null;
6
10
  /** When mode='unread-count', this drives the ::before count prefix via data-count. */
7
11
  count?: number;
8
12
  /** Anchor element to derive cutout circle center from. */
9
13
  anchorRef: RefObject<HTMLElement | null>;
14
+ /**
15
+ * When true (default), subscribe to PanelContext and derive 'lock' mode from
16
+ * state.lockHint. When false, BellCutout ignores context entirely and reflects
17
+ * only the `mode` prop — used by test scaffolds + isolated mounts.
18
+ */
19
+ subscribeToCoordinator?: boolean;
20
+ /**
21
+ * Optional cardId → display-label map. When state.lockHint.activeCardId is
22
+ * present, the rendered dwell text reads `cardLabels[activeCardId]`. When the
23
+ * id is absent from the map, the literal id is rendered as fallback.
24
+ */
25
+ cardLabels?: Record<string, string>;
10
26
  }
11
27
  export declare function BellCutout(props: BellCutoutProps): import("react/jsx-runtime").JSX.Element | null;
@@ -1,10 +1,96 @@
1
1
  import { AssertReport } from '../orchestrator/transitionToPanel';
2
+ /**
3
+ * Phase 11.5 P6 W5 — per-constraint assertion row. `pass: 'wiring_only'`
4
+ * marks rows verified by source-proof (Rule 11) when no runtime probe is
5
+ * available (C13 same-position slide, C14 cross-position handoff).
6
+ */
7
+ export type AssertRow = {
8
+ id: string;
9
+ constraint: string;
10
+ expected: string;
11
+ actual: string;
12
+ pass: boolean | 'wiring_only';
13
+ };
2
14
  export type { AssertReport };
3
15
  /**
4
16
  * Pure DOM-walk — exported separately for tests + external callers that want a
5
17
  * one-shot probe without flipping the global flag.
6
18
  */
7
19
  export declare function assertPanelDomShape(): AssertReport;
20
+ /**
21
+ * Canonical 14 CC ids (declaration order). G3 gate token — one literal
22
+ * `id: 'CN'` per line so a `-c` line-count grep for
23
+ * `id:\s*'C(1[0-4]|[1-9])'` returns ≥14.
24
+ */
25
+ export declare const CC_IDS: readonly [{
26
+ readonly id: "C1";
27
+ }, {
28
+ readonly id: "C2";
29
+ }, {
30
+ readonly id: "C3";
31
+ }, {
32
+ readonly id: "C4";
33
+ }, {
34
+ readonly id: "C5";
35
+ }, {
36
+ readonly id: "C6";
37
+ }, {
38
+ readonly id: "C7";
39
+ }, {
40
+ readonly id: "C8";
41
+ }, {
42
+ readonly id: "C9";
43
+ }, {
44
+ readonly id: "C10";
45
+ }, {
46
+ readonly id: "C11";
47
+ }, {
48
+ readonly id: "C12";
49
+ }, {
50
+ readonly id: "C13";
51
+ }, {
52
+ readonly id: "C14";
53
+ }];
54
+ /**
55
+ * Compute the 14 CC rows against the current live DOM. Pure walk; no
56
+ * side effects. Returns rows in C1..C14 declaration order.
57
+ */
58
+ export declare function assertCcOnly(): AssertRow[];
59
+ /**
60
+ * Look up a single CC row by id. Returns `undefined` if not present (e.g.,
61
+ * passed an out-of-range id). Convenience wrapper around `assertCcOnly()`.
62
+ */
63
+ export declare function getCcRowById(id: string): AssertRow | undefined;
64
+ /**
65
+ * Thin wrapper returning both Q12 + CC verdicts. Per user override
66
+ * (Option 3 de-scope, 2026-05-14): `q12` maps to the existing P3b
67
+ * Q12-12 single source-of-motion DOM check (the same AssertReport shape
68
+ * returned by `assertPanelDomShape()`), surfaced here as a 1-row array
69
+ * for shape uniformity. No fabricated Q12-01..Q12-11 walks.
70
+ */
71
+ export declare function assertPanelTruths(): {
72
+ q12: AssertRow[];
73
+ cc: AssertRow[];
74
+ };
75
+ type AsserterSurface = {
76
+ enable: () => void;
77
+ disable: () => void;
78
+ isEnabled: () => boolean;
79
+ getLastReport: () => AssertReport | null;
80
+ recordTransition: (r: AssertReport) => void;
81
+ assertOnce: () => AssertReport;
82
+ assertCcOnly: () => AssertRow[];
83
+ getCcRowById: (id: string) => AssertRow | undefined;
84
+ assertPanelTruths: () => {
85
+ q12: AssertRow[];
86
+ cc: AssertRow[];
87
+ };
88
+ };
89
+ declare global {
90
+ interface Window {
91
+ __panelsAsserter?: AsserterSurface;
92
+ }
93
+ }
8
94
  /**
9
95
  * Enable the Q12-12 asserter. First call assigns `window.__panelsAsserter`
10
96
  * (only on first enable — avoids repeated reassignment per Rule 29).
@@ -61,6 +61,11 @@ export interface LockHint {
61
61
  activeCardId: string | null;
62
62
  expiresAt: number;
63
63
  }
64
+ export interface SettingsBufferDelta {
65
+ kind: 'settings';
66
+ changes: Record<string, unknown>;
67
+ }
68
+ export type BufferDelta = SettingsBufferDelta;
64
69
  export type SideEffect = {
65
70
  type: 'SCHEDULE_TIMER';
66
71
  ms: number;
@@ -77,6 +82,10 @@ export type SideEffect = {
77
82
  previousPanelId: PanelId;
78
83
  } | {
79
84
  type: 'COMMIT_BUFFER';
85
+ payload?: {
86
+ cardId: string;
87
+ delta: BufferDelta;
88
+ };
80
89
  } | {
81
90
  type: 'DISCARD_BUFFER';
82
91
  } | {
@@ -88,6 +97,7 @@ export interface PanelState {
88
97
  bellCutoutOpen: boolean;
89
98
  isDirty: boolean;
90
99
  lockHint: LockHint | null;
100
+ bufferByCard: Record<string, BufferDelta>;
91
101
  lastClose: {
92
102
  panelId: PanelId;
93
103
  reason: CloseReason;
@@ -114,6 +124,15 @@ export type PanelAction = {
114
124
  hint: LockHint;
115
125
  } | {
116
126
  type: 'CLEAR_LOCK_HINT';
127
+ } | {
128
+ type: 'SET_BUFFER_VALUE';
129
+ cardId: string;
130
+ key: string;
131
+ value: unknown;
132
+ } | {
133
+ type: 'CLEAR_BUFFER';
134
+ cardId: string;
117
135
  } | {
118
136
  type: 'DRAIN_SIDE_EFFECTS';
137
+ count?: number;
119
138
  };
@@ -44,7 +44,8 @@ export { CloneStage } from './stage3d/CloneStage';
44
44
  export type { CloneStageProps } from './stage3d/CloneStage';
45
45
  export { CloneCard } from './stage3d/CloneCard';
46
46
  export type { CloneCardProps } from './stage3d/CloneCard';
47
- export { enablePanelAsserter, disablePanelAsserter, assertPanelDomShape, } from './asserter/domWalkAsserter';
47
+ export { enablePanelAsserter, disablePanelAsserter, assertPanelDomShape, assertCcOnly, getCcRowById, assertPanelTruths, } from './asserter/domWalkAsserter';
48
+ export type { AssertRow } from './asserter/domWalkAsserter';
48
49
  export type { SettingsShellProps } from './shells/SettingsShell';
49
50
  export { usePanelCoordinator } from './hooks/usePanelCoordinator';
50
51
  export type { UsePanelCoordinatorReturn } from './hooks/usePanelCoordinator';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mt-gloss/ui",
3
- "version": "0.1.98",
3
+ "version": "0.1.100",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "restricted"