@wafertools/wafermap 0.26.1 → 0.28.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.
- package/AGENTS.md +10 -2
- package/CHANGELOG.md +670 -0
- package/README.md +46 -3
- package/dist/packages/canvas-adapter/canvasTheme.d.ts +4 -0
- package/dist/packages/canvas-adapter/canvasTheme.js +1 -1
- package/dist/packages/canvas-adapter/charts/barPanel.d.ts +16 -0
- package/dist/packages/canvas-adapter/charts/barPanel.js +1 -1
- package/dist/packages/canvas-adapter/charts/binCluster.d.ts +0 -1
- package/dist/packages/canvas-adapter/charts/binCluster.js +1 -1
- package/dist/packages/canvas-adapter/charts/boxplot.d.ts +21 -2
- package/dist/packages/canvas-adapter/charts/boxplot.js +1 -1
- package/dist/packages/canvas-adapter/charts/capability.d.ts +10 -11
- package/dist/packages/canvas-adapter/charts/capability.js +1 -1
- package/dist/packages/canvas-adapter/charts/chartShell.d.ts +337 -3
- package/dist/packages/canvas-adapter/charts/chartShell.js +1 -1
- package/dist/packages/canvas-adapter/charts/correlation.d.ts +8 -10
- package/dist/packages/canvas-adapter/charts/correlation.js +2 -1
- package/dist/packages/canvas-adapter/charts/groupedBarPlot.d.ts +50 -0
- package/dist/packages/canvas-adapter/charts/groupedBarPlot.js +1 -0
- package/dist/packages/canvas-adapter/charts/histogram.d.ts +12 -2
- package/dist/packages/canvas-adapter/charts/histogram.js +1 -1
- package/dist/packages/canvas-adapter/charts/regionYieldDiagram.d.ts +0 -1
- package/dist/packages/canvas-adapter/charts/regionYieldDiagram.js +1 -1
- package/dist/packages/canvas-adapter/charts/scatter.d.ts +6 -1
- package/dist/packages/canvas-adapter/charts/scatter.js +1 -1
- package/dist/packages/canvas-adapter/charts/testPassRate.d.ts +20 -0
- package/dist/packages/canvas-adapter/charts/testPassRate.js +1 -0
- package/dist/packages/canvas-adapter/charts/trend.d.ts +37 -0
- package/dist/packages/canvas-adapter/charts/trend.js +1 -0
- package/dist/packages/canvas-adapter/dieList.js +7 -7
- package/dist/packages/canvas-adapter/hitGrid.d.ts +22 -0
- package/dist/packages/canvas-adapter/hitGrid.js +1 -0
- package/dist/packages/canvas-adapter/identityHeader.d.ts +46 -0
- package/dist/packages/canvas-adapter/identityHeader.js +1 -0
- package/dist/packages/canvas-adapter/index.d.ts +2 -1
- package/dist/packages/canvas-adapter/index.js +1 -1
- package/dist/packages/canvas-adapter/insightsTab.d.ts +51 -5
- package/dist/packages/canvas-adapter/insightsTab.js +1 -1
- package/dist/packages/canvas-adapter/maplessSummary.d.ts +5 -1
- package/dist/packages/canvas-adapter/maplessSummary.js +1 -1
- package/dist/packages/canvas-adapter/renderWaferGallery.d.ts +15 -2
- package/dist/packages/canvas-adapter/renderWaferGallery.js +1 -20
- package/dist/packages/canvas-adapter/renderWaferMap.d.ts +110 -18
- package/dist/packages/canvas-adapter/renderWaferMap.js +1 -1
- package/dist/packages/canvas-adapter/summaryPanel.d.ts +233 -37
- package/dist/packages/canvas-adapter/summaryPanel.js +3 -3
- package/dist/packages/canvas-adapter/toCanvas.d.ts +6 -0
- package/dist/packages/canvas-adapter/toCanvas.js +1 -1
- package/dist/packages/canvas-adapter/toolbar.d.ts +352 -15
- package/dist/packages/canvas-adapter/toolbar.js +2 -2
- package/dist/packages/canvas-adapter/userGuideHtml.d.ts +1 -1
- package/dist/packages/canvas-adapter/userGuideHtml.js +115 -41
- package/dist/packages/canvas-adapter/version.d.ts +2 -2
- package/dist/packages/canvas-adapter/version.js +1 -1
- package/dist/packages/canvas-adapter/warnings.d.ts +21 -0
- package/dist/packages/canvas-adapter/warnings.js +1 -1
- package/dist/packages/core/dies.d.ts +11 -0
- package/dist/packages/core/dies.js +1 -1
- package/dist/packages/core/utils.d.ts +11 -0
- package/dist/packages/core/utils.js +1 -1
- package/dist/packages/renderer/binColors.d.ts +80 -0
- package/dist/packages/renderer/binColors.js +1 -0
- package/dist/packages/renderer/buildView.d.ts +100 -6
- package/dist/packages/renderer/buildView.js +1 -1
- package/dist/packages/renderer/buildWaferMap.d.ts +112 -7
- package/dist/packages/renderer/buildWaferMap.js +1 -1
- package/dist/packages/renderer/colorMap.d.ts +16 -15
- package/dist/packages/renderer/colorMap.js +1 -1
- package/dist/packages/renderer/colorSchemes.d.ts +45 -26
- package/dist/packages/renderer/colorSchemes.js +1 -1
- package/dist/packages/renderer/index.d.ts +3 -1
- package/dist/packages/renderer/index.js +1 -1
- package/dist/packages/stats/analyzeWaferLot.js +1 -1
- package/dist/packages/stats/analyzeWaferMap.js +1 -1
- package/dist/packages/stats/binPareto.d.ts +15 -0
- package/dist/packages/stats/binPareto.js +1 -1
- package/dist/packages/stats/clusterDetection.js +1 -1
- package/dist/packages/stats/connectedComponents.d.ts +14 -0
- package/dist/packages/stats/connectedComponents.js +1 -0
- package/dist/packages/stats/correlation.d.ts +26 -0
- package/dist/packages/stats/correlation.js +1 -1
- package/dist/packages/stats/facets.js +1 -1
- package/dist/packages/stats/filterFindings.d.ts +18 -0
- package/dist/packages/stats/filterFindings.js +1 -1
- package/dist/packages/stats/findingsNarrative.js +1 -1
- package/dist/packages/stats/histogram.d.ts +47 -2
- package/dist/packages/stats/histogram.js +1 -1
- package/dist/packages/stats/index.d.ts +6 -0
- package/dist/packages/stats/index.js +1 -1
- package/dist/packages/stats/mergeTestDefs.d.ts +44 -0
- package/dist/packages/stats/mergeTestDefs.js +1 -0
- package/dist/packages/stats/metadataColumns.d.ts +20 -4
- package/dist/packages/stats/metadataColumns.js +1 -1
- package/dist/packages/stats/patternClassification.js +1 -1
- package/dist/packages/stats/population.d.ts +23 -0
- package/dist/packages/stats/population.js +1 -0
- package/dist/packages/stats/renderFindingsReport.js +15 -15
- package/dist/packages/stats/renderSummaryReport.js +35 -32
- package/dist/packages/stats/reportHtml.js +38 -13
- package/dist/packages/stats/testPassRate.d.ts +85 -0
- package/dist/packages/stats/testPassRate.js +1 -0
- package/dist/packages/stats/trend.d.ts +40 -0
- package/dist/packages/stats/trend.js +1 -0
- package/dist/packages/stats/types.d.ts +117 -6
- package/dist/packages/stats/yield.js +1 -1
- package/llms.txt +6 -0
- package/package.json +9 -5
- package/dist/packages/canvas-adapter/metadataBadge.d.ts +0 -30
- package/dist/packages/canvas-adapter/metadataBadge.js +0 -1
|
@@ -3,8 +3,172 @@ import type { Die } from '../core/dies.js';
|
|
|
3
3
|
import type { TestDef, MetadataFieldDef } from '../renderer/buildWaferMap.js';
|
|
4
4
|
import type { StatsSeverity } from '../stats/types.js';
|
|
5
5
|
export declare function logWmapVersionOnce(): void;
|
|
6
|
-
export declare const WMAP_TOKEN_NAMES: readonly ["z", "icon", "icon-hover", "icon-active", "bg-hover", "bg-active", "separator", "surface", "border", "menu-hover", "menu-active", "panel-bg", "text-muted", "text", "text-strong", "warn-bg", "warn-border", "warn-text", "err-bg", "err-border", "err-text", "info-bg", "info-text", "selected", "finding-indicator", "canvas-bg", "bar-fill"
|
|
6
|
+
export declare const WMAP_TOKEN_NAMES: readonly ["z", "icon", "icon-hover", "icon-active", "bg-hover", "bg-active", "separator", "surface", "border", "control-border", "menu-hover", "menu-active", "font-family", "font-size", "density", "panel-bg", "text-muted", "text", "text-strong", "warn-bg", "warn-border", "warn-text", "err-bg", "err-border", "err-text", "info-bg", "info-text", "selected", "finding-indicator", "canvas-bg", "bar-fill"];
|
|
7
7
|
export type WmapTokenName = (typeof WMAP_TOKEN_NAMES)[number];
|
|
8
|
+
/**
|
|
9
|
+
* The shapes an interactive element comes in. Nineteen sites set
|
|
10
|
+
* `cursor: pointer` with their own padding, border, radius and hover handling;
|
|
11
|
+
* they were not nineteen different controls, but four shapes restated by hand.
|
|
12
|
+
* That restatement is the mechanism behind most of the drift this file's other
|
|
13
|
+
* scales exist to stop.
|
|
14
|
+
*
|
|
15
|
+
* These return STYLE, not elements — call sites keep their own markup and event
|
|
16
|
+
* wiring, and merely stop deciding what a button looks like. Spread first, then
|
|
17
|
+
* add layout:
|
|
18
|
+
*
|
|
19
|
+
* Object.assign(btn.style, { ...controlStyle('outlined'), marginLeft: 'auto' });
|
|
20
|
+
*/
|
|
21
|
+
export type ControlKind =
|
|
22
|
+
/** Bordered, transparent ground — the default button (Summary report, Export CSV). */
|
|
23
|
+
'outlined'
|
|
24
|
+
/** No border or ground — icon buttons and inline text actions. */
|
|
25
|
+
| 'bare'
|
|
26
|
+
/** Bordered, tinted when on — segmented options and filter toggles. */
|
|
27
|
+
| 'toggle';
|
|
28
|
+
/**
|
|
29
|
+
* Give a control the library's hover feedback. `controlStyle` returns static
|
|
30
|
+
* style and cannot attach listeners, so this is the second half of the pair —
|
|
31
|
+
* call it wherever you spread `controlStyle`.
|
|
32
|
+
*
|
|
33
|
+
* Without it a bordered control is indistinguishable from a bordered label: it
|
|
34
|
+
* has the shape of a button and does nothing when the pointer is over it.
|
|
35
|
+
* wmap's toolbar icon buttons wired this from the start; its outlined TEXT
|
|
36
|
+
* buttons (Summary report, View die list, the CSV exports, Back) wired nothing
|
|
37
|
+
* at all, so the two halves of the same library disagreed about whether a
|
|
38
|
+
* button reacts. tsmap's `.tb-btn` has always had it.
|
|
39
|
+
*/
|
|
40
|
+
export declare function wireControlHover(el: HTMLElement, kind?: ControlKind): void;
|
|
41
|
+
export declare function controlStyle(kind: ControlKind, on?: boolean): Partial<CSSStyleDeclaration>;
|
|
42
|
+
export declare const SPACE: {
|
|
43
|
+
xxs: string;
|
|
44
|
+
xs: string;
|
|
45
|
+
sm: string;
|
|
46
|
+
md: string;
|
|
47
|
+
lg: string;
|
|
48
|
+
xl: string;
|
|
49
|
+
xxl: string;
|
|
50
|
+
xxxl: string;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Elevation. Fourteen distinct box-shadow literals existed across the two repos
|
|
54
|
+
* with no rule for which belonged where, so every new component invented one.
|
|
55
|
+
* Three tiers is what the values actually clustered into.
|
|
56
|
+
*/
|
|
57
|
+
export declare const SHADOW: {
|
|
58
|
+
/** Resting surface — a panel or card sitting on the page. */
|
|
59
|
+
panel: string;
|
|
60
|
+
/** Transient overlay — menu, dropdown, popover, tooltip. */
|
|
61
|
+
menu: string;
|
|
62
|
+
/** Modal — the only thing above everything else. */
|
|
63
|
+
modal: string;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Motion. One duration and one easing: a UI this dense has no reason to vary
|
|
67
|
+
* them, and ten different `transition` literals is not expressiveness, it is
|
|
68
|
+
* ten authors guessing. Respect `prefers-reduced-motion` at the call site.
|
|
69
|
+
*/
|
|
70
|
+
export declare const MOTION: {
|
|
71
|
+
/** State changes — hover, active, disclosure. */
|
|
72
|
+
fast: string;
|
|
73
|
+
/** Movement the eye should follow — a chevron rotating, a panel sliding. */
|
|
74
|
+
base: string;
|
|
75
|
+
};
|
|
76
|
+
/** Line height. Tight for single-line chrome, base for prose. */
|
|
77
|
+
export declare const LEADING: {
|
|
78
|
+
none: string;
|
|
79
|
+
tight: string;
|
|
80
|
+
base: string;
|
|
81
|
+
};
|
|
82
|
+
/** Opacity. `muted` de-emphasises; `disabled` is the one WCAG-relevant value. */
|
|
83
|
+
export declare const ALPHA: {
|
|
84
|
+
muted: string;
|
|
85
|
+
disabled: string;
|
|
86
|
+
};
|
|
87
|
+
/** Uppercase micro-label tracking — one value, not four. */
|
|
88
|
+
export declare const TRACKING = "0.05em";
|
|
89
|
+
/**
|
|
90
|
+
* Horizontal gutter between a scrolling surface's cards and the edge of the
|
|
91
|
+
* window (or host container) they scroll inside.
|
|
92
|
+
*
|
|
93
|
+
* A card is a bounded surface: flush to the viewport you see three borders and
|
|
94
|
+
* the screen edge standing in for the fourth, which reads as clipped rather
|
|
95
|
+
* than as a design choice. This is the gap that stops that.
|
|
96
|
+
*
|
|
97
|
+
* Why 12 (`SPACE.xl`): three different insets were in use when this was added —
|
|
98
|
+
* the Insights bands at 10, the gallery bar at 4, and tsmap's own `#toolbar` at
|
|
99
|
+
* 12 — so there was no incumbent value to inherit. 12 is on the `SPACE` scale,
|
|
100
|
+
* sits at the tight end of the 12-24px page-margin range the major design
|
|
101
|
+
* systems use (Material/HIG 16, Bootstrap 12), which is the right end for a
|
|
102
|
+
* dense analysis tool, and is the only candidate with an anchor outside this
|
|
103
|
+
* library: it matches the host toolbar directly above the map, so cards line up
|
|
104
|
+
* with the toolbar's own content rather than missing it by a couple of pixels.
|
|
105
|
+
*
|
|
106
|
+
* Deliberately NOT applied to the wafer map canvas, which stays full-bleed —
|
|
107
|
+
* map area is the priority and a margin would only shrink it. Same exception
|
|
108
|
+
* UI_STANDARDS.md already names for content that wants to fill its box.
|
|
109
|
+
*/
|
|
110
|
+
export declare const EDGE_GUTTER: string;
|
|
111
|
+
/**
|
|
112
|
+
* Inset for a wafer map's OWN chrome — its chrome row (identity + toolbar) and
|
|
113
|
+
* a Summary panel docked inside the map area — from the edge of that map area.
|
|
114
|
+
*
|
|
115
|
+
* Deliberately small, and deliberately NOT `EDGE_GUTTER`. That one is the gap
|
|
116
|
+
* between a bounded surface and the edge of the REGION it lives in. A map
|
|
117
|
+
* embedded in a gallery card is already inside such a region: the card supplies
|
|
118
|
+
* the outer inset, and a second 12px within it stacks two gutters — the thing
|
|
119
|
+
* UI_STANDARDS.md's gutter rule forbids. It reads exactly like what it is, a
|
|
120
|
+
* toolbar standing 12px off the side of a card.
|
|
121
|
+
*
|
|
122
|
+
* A STANDALONE map is the other case: there the map area IS the region, so its
|
|
123
|
+
* chrome takes `EDGE_GUTTER` like any other bounded surface against an edge.
|
|
124
|
+
* `RenderOptions.chromeInset` is how the caller says which it is —
|
|
125
|
+
* `renderWaferGallery` passes this value for its cards, everything else takes
|
|
126
|
+
* the `EDGE_GUTTER` default.
|
|
127
|
+
*
|
|
128
|
+
* This constant was deleted once, when the toolbar moved out of the map box and
|
|
129
|
+
* the Summary panel was briefly its only user. That was wrong: the chrome row
|
|
130
|
+
* inherited the same context problem the moment it started carrying the
|
|
131
|
+
* toolbar, and giving every map `EDGE_GUTTER` put the two-gutter bug straight
|
|
132
|
+
* back into gallery cards.
|
|
133
|
+
*/
|
|
134
|
+
export declare const MAP_CHROME_INSET: string;
|
|
135
|
+
export declare const RADIUS: {
|
|
136
|
+
/** Buttons, inputs, menu rows, segmented toggles, swatches. */
|
|
137
|
+
control: string;
|
|
138
|
+
/** Cards, panels, menus, modals — anything that contains other components. */
|
|
139
|
+
container: string;
|
|
140
|
+
/** Badges, count pills, status chips — fully rounded, size-independent. */
|
|
141
|
+
pill: string;
|
|
142
|
+
};
|
|
143
|
+
export declare const FONT: {
|
|
144
|
+
/**
|
|
145
|
+
* The typeface. wmap is embedded in a host and should read as part of it, so
|
|
146
|
+
* this INHERITS by default rather than imposing a stack — a host that sets
|
|
147
|
+
* nothing still gets the fallback below.
|
|
148
|
+
*
|
|
149
|
+
* There were three different hardcoded stacks across five sites
|
|
150
|
+
* (`system-ui, sans-serif` in the summary panel and toolbar,
|
|
151
|
+
* `system-ui, -apple-system, "Segoe UI", sans-serif` in the gallery), none
|
|
152
|
+
* matching tsmap's own `-apple-system`-first body stack. On Linux those
|
|
153
|
+
* resolve to different faces, so the summary panel's value table and the
|
|
154
|
+
* Insights value table — the same data, side by side — rendered in different
|
|
155
|
+
* typefaces.
|
|
156
|
+
*/
|
|
157
|
+
family: string;
|
|
158
|
+
meta: string;
|
|
159
|
+
body: string;
|
|
160
|
+
sub: string;
|
|
161
|
+
heading: string;
|
|
162
|
+
stat: string;
|
|
163
|
+
};
|
|
164
|
+
/**
|
|
165
|
+
* The resolved numeric size for canvas `ctx.font`, in px. `delta` matches FONT's
|
|
166
|
+
* tiers for 0 and above (`body`, `sub`, `heading`, `stat`) and `-1` for `meta`.
|
|
167
|
+
* `-2` has no DOM tier by design: it is the map canvas's plot-coupled floor
|
|
168
|
+
* (colorbar tick labels, axis ticks — see toCanvas.ts), which annotates dense
|
|
169
|
+
* data rather than chrome and so sits below the 11px DOM minimum.
|
|
170
|
+
*/
|
|
171
|
+
export declare function fontPx(delta?: number, el?: Element | null): number;
|
|
8
172
|
export declare const CLR: {
|
|
9
173
|
icon: string;
|
|
10
174
|
iconHover: string;
|
|
@@ -14,8 +178,10 @@ export declare const CLR: {
|
|
|
14
178
|
separator: string;
|
|
15
179
|
menuBg: string;
|
|
16
180
|
menuBorder: string;
|
|
181
|
+
controlBorder: string;
|
|
17
182
|
menuHover: string;
|
|
18
183
|
menuActive: string;
|
|
184
|
+
canvasBg: string;
|
|
19
185
|
panelBg: string;
|
|
20
186
|
label: string;
|
|
21
187
|
value: string;
|
|
@@ -31,7 +197,6 @@ export declare const CLR: {
|
|
|
31
197
|
findingHighlight: string;
|
|
32
198
|
findingIndicator: string;
|
|
33
199
|
barFill: string;
|
|
34
|
-
barFillMuted: string;
|
|
35
200
|
};
|
|
36
201
|
/**
|
|
37
202
|
* Findings-severity → colour, shared by summaryPanel.ts (severity dots/borders
|
|
@@ -110,7 +275,29 @@ export declare function setDetachWindowOpener(opener: DetachWindowOpener | null)
|
|
|
110
275
|
* window is treated as titleless regardless of `document.title`). Navigating
|
|
111
276
|
* to a real URL would fix it but means either re-running the host page's own
|
|
112
277
|
* script inside the popup (real risk of double side effects) or requiring a
|
|
113
|
-
* dedicated blank same-origin asset — not worth it for a cosmetic issue.
|
|
278
|
+
* dedicated blank same-origin asset — not worth it for a cosmetic issue.
|
|
279
|
+
*
|
|
280
|
+
* Why this looks different from renderWaferMap's own "Expand" (a modal with
|
|
281
|
+
* wmap's own JS-drawn title bar, see `openOverlay` below): a real
|
|
282
|
+
* `window.open()` popup always carries genuine OS/browser chrome (title bar,
|
|
283
|
+
* and — deliberately, for anti-phishing reasons — an address-bar-ish
|
|
284
|
+
* element), and no window-features flag suppresses that in modern browsers;
|
|
285
|
+
* the feature string above (`width=560,height=600`) is sized-only for
|
|
286
|
+
* exactly this reason. This is a real inconsistency (raised 2026-08-29):
|
|
287
|
+
* `openWindowForCard`'s own fallback path (`window.open` returning null,
|
|
288
|
+
* e.g. Tauri's WebView) already routes through `openFloatingWindow` —
|
|
289
|
+
* wmap's own chrome, pixel-identical to the modal — so the mismatch is
|
|
290
|
+
* scoped to the real-popup case specifically.
|
|
291
|
+
*
|
|
292
|
+
* Possible future change: make `openWindowForCard` always take the
|
|
293
|
+
* `openFloatingWindow` branch (never call this function), for visual
|
|
294
|
+
* consistency with the standalone map's modal everywhere. Deliberately not
|
|
295
|
+
* done: the whole reason gallery cards detach into real windows rather than
|
|
296
|
+
* modals is so several can be open at once for side-by-side comparison,
|
|
297
|
+
* including dragged out to a second monitor — `openFloatingWindow`'s content
|
|
298
|
+
* is confined inside the host page/tab, so forcing it would trade away that
|
|
299
|
+
* capability for cosmetic consistency. Revisit only if that comparison
|
|
300
|
+
* workflow turns out not to matter in practice. */
|
|
114
301
|
export declare function openDetachWindow(label: string): Window | null;
|
|
115
302
|
export declare const MODE_LABELS: Record<PlotMode, string>;
|
|
116
303
|
export declare const BIN_LEGEND_MODES: Set<PlotMode>;
|
|
@@ -170,6 +357,29 @@ export declare function saveTextFile(text: string, filename: string, mimeType: s
|
|
|
170
357
|
* window." Passing the popup's own `window` fixes this.
|
|
171
358
|
*/
|
|
172
359
|
export declare function nextFrame(fn: () => void, ownerWindow?: Window): void;
|
|
360
|
+
/**
|
|
361
|
+
* Wire roving-focus keyboard navigation onto an already-roled menu:
|
|
362
|
+
* ArrowUp/Down move between items, Home/End jump to ends, Enter/Space activate
|
|
363
|
+
* the focused item, Escape (or Tab) closes the menu and returns focus to the
|
|
364
|
+
* trigger. `close` should remove the menu and clear any open-menu bookkeeping.
|
|
365
|
+
* Focus moves to the first item on open. Returns nothing; the listener lives on
|
|
366
|
+
* the menu element and dies with it.
|
|
367
|
+
*/
|
|
368
|
+
/**
|
|
369
|
+
* Roving keyboard focus over a live list of options — Arrow/Home/End to move,
|
|
370
|
+
* Enter/Space to activate, Escape/Tab to dismiss.
|
|
371
|
+
*
|
|
372
|
+
* Deliberately does NOT move focus itself: that is the one thing the two
|
|
373
|
+
* callers genuinely disagree about. A toolbar menu wants its first item focused
|
|
374
|
+
* on open; the searchable list in `chartShell.ts` must leave focus on its
|
|
375
|
+
* search box, and had its own copy of this whole switch for that single
|
|
376
|
+
* difference — thirty duplicated lines guarding one line of divergence.
|
|
377
|
+
*
|
|
378
|
+
* `items()` is called per keystroke, not captured: the searchable list filters
|
|
379
|
+
* its rows as you type, and a snapshot would navigate rows that are no longer
|
|
380
|
+
* shown.
|
|
381
|
+
*/
|
|
382
|
+
export declare function wireListNavigation(container: HTMLElement, items: () => HTMLElement[], dismiss: () => void): void;
|
|
173
383
|
export declare function overlayRootFor(anchor: Element): Element;
|
|
174
384
|
export declare function menuLayerFor(anchor: Element): HTMLElement;
|
|
175
385
|
/** The shared tooltip element for `doc` (default: the host page's own
|
|
@@ -202,7 +412,48 @@ export declare function reparentTooltip(parent?: HTMLElement): void;
|
|
|
202
412
|
* map), and the `parentElement !==` guard means the DOM is only actually
|
|
203
413
|
* touched when the root has changed, not on every mousemove.
|
|
204
414
|
*/
|
|
415
|
+
/**
|
|
416
|
+
* Place the tooltip near the cursor without covering the thing it describes.
|
|
417
|
+
*
|
|
418
|
+
* `anchor` used to be consulted only for `overlayRootFor` — placement was
|
|
419
|
+
* computed from the cursor point alone, and since `y` starts ABOVE the cursor
|
|
420
|
+
* (`clientY - 8`) the box then extended down over whatever was being pointed at.
|
|
421
|
+
* On the map canvas that is harmless and in fact necessary: the anchor is the
|
|
422
|
+
* whole canvas, so "don't overlap the anchor" would push the tooltip off the map
|
|
423
|
+
* entirely. On a small anchor — a bar, a badge, a row, an icon button — there IS
|
|
424
|
+
* somewhere else to go, and covering it while describing it is a real defect.
|
|
425
|
+
*
|
|
426
|
+
* So the anchor's box is avoided only when the anchor is small enough for that to
|
|
427
|
+
* be feasible: flip to just below it, else just above it. A large anchor keeps
|
|
428
|
+
* exactly the previous cursor-following behaviour.
|
|
429
|
+
*/
|
|
205
430
|
export declare function positionTooltip(tooltip: HTMLDivElement, anchor: Element, clientX: number, clientY: number): void;
|
|
431
|
+
/**
|
|
432
|
+
* Wire the shared themed tooltip onto a plain DOM element.
|
|
433
|
+
*
|
|
434
|
+
* Hoisted out of `maplessSummary.ts`, which had the only copy — and whose comment
|
|
435
|
+
* already recorded why this exists: a native `title` is a different, browser-native
|
|
436
|
+
* tooltip, slow to appear (OS hover delay) and in an unthemed system font/colour,
|
|
437
|
+
* while every hover surface built through `createToolbarHelpers` uses this instant
|
|
438
|
+
* dark one. `summaryPanel.ts` and the hand-built expand buttons in
|
|
439
|
+
* `renderWaferMap`/`renderWaferGallery` were still on `title`.
|
|
440
|
+
*
|
|
441
|
+
* `text` may be a string, a getter (for a hint that changes with the control's own
|
|
442
|
+
* state, e.g. the findings severity chips' show/hide), or omitted to live-read the
|
|
443
|
+
* element's `aria-label` at hover time — the same thing `makeBtn` does, so a
|
|
444
|
+
* control whose label changes with its state (expand ⇄ reattach) stays correct
|
|
445
|
+
* without re-wiring.
|
|
446
|
+
*
|
|
447
|
+
* `asDataPoint` is for an element that is NOT already a control: it makes the
|
|
448
|
+
* element a tab stop, announces it as a single datum (`role="img"`), and sets
|
|
449
|
+
* `aria-label`, so the tooltip's content reaches the keyboard and a screen reader
|
|
450
|
+
* (WCAG 1.4.13 — content shown on hover must be reachable and dismissable without
|
|
451
|
+
* a pointer). Never pass it for a `<button>`: that would add a nested focus stop
|
|
452
|
+
* and overwrite the control's own accessible name.
|
|
453
|
+
*/
|
|
454
|
+
export declare function wireTooltip(target: HTMLElement, text?: string | (() => string), opts?: {
|
|
455
|
+
asDataPoint?: boolean;
|
|
456
|
+
}): void;
|
|
206
457
|
export interface ToolbarHelpers {
|
|
207
458
|
makeBtn(iconKey: string, label: string, onClick: () => void): HTMLButtonElement;
|
|
208
459
|
setActive(btn: HTMLButtonElement, active: boolean): void;
|
|
@@ -302,8 +553,9 @@ export interface ExpandToggleHandle {
|
|
|
302
553
|
/**
|
|
303
554
|
* Shared "click/Enter/Space toggles an expand/collapse state, Escape or an
|
|
304
555
|
* outside click closes it" wiring — the small interaction pattern behind both
|
|
305
|
-
* the
|
|
306
|
-
* header's
|
|
556
|
+
* the shared identity header's metadata reveal (identityHeader.ts, used by
|
|
557
|
+
* renderWaferMap.ts) and the gallery card header's own reveal
|
|
558
|
+
* (renderWaferGallery.ts). `trigger` gets
|
|
307
559
|
* `role="button"`/`tabindex` and the event listeners; `onChange(open)` is
|
|
308
560
|
* called whenever the state actually changes (never redundantly) — the
|
|
309
561
|
* caller owns all the resulting DOM (aria-expanded text, panel visibility,
|
|
@@ -327,6 +579,14 @@ export type CheckMenuRow = {
|
|
|
327
579
|
* missing feature, and the user has no way to learn the condition.
|
|
328
580
|
*/
|
|
329
581
|
disabledHint?: string;
|
|
582
|
+
/**
|
|
583
|
+
* Marks a row that *does* something rather than holding a state — "Clear
|
|
584
|
+
* overlays", "Reset orientation". Rendered as a plain `menuitem` with no
|
|
585
|
+
* tick: every other row here is a checkbox, and an action wearing an
|
|
586
|
+
* unchecked ✓ both looks like a toggle that is off and announces itself as
|
|
587
|
+
* one to a screen reader.
|
|
588
|
+
*/
|
|
589
|
+
action?: boolean;
|
|
330
590
|
onClick: (e: MouseEvent) => void;
|
|
331
591
|
};
|
|
332
592
|
/**
|
|
@@ -334,13 +594,27 @@ export type CheckMenuRow = {
|
|
|
334
594
|
* Each row with an `onClick` is a toggleable item; rows with `section` are headers.
|
|
335
595
|
* Stays open after each click so the user can toggle multiple items.
|
|
336
596
|
*/
|
|
337
|
-
export declare function buildCheckMenuEl(anchorRect: DOMRect, rows: CheckMenuRow[], helpers: Pick<ToolbarHelpers, '
|
|
597
|
+
export declare function buildCheckMenuEl(anchorRect: DOMRect, rows: CheckMenuRow[], helpers: Pick<ToolbarHelpers, 'makeMenuSection'>, ownerWindow?: Window): HTMLDivElement;
|
|
338
598
|
export declare function createToolbarHelpers(tooltip: HTMLDivElement): ToolbarHelpers;
|
|
339
599
|
export type OverlayMode = 'modal' | 'window';
|
|
340
600
|
export interface OverlayOptions {
|
|
341
601
|
/** Optional title shown in the header left. */
|
|
342
602
|
title?: string;
|
|
343
603
|
mode: OverlayMode;
|
|
604
|
+
/**
|
|
605
|
+
* Override the box's natural (non-maximized) size. Defaults to a 700px
|
|
606
|
+
* square, which suits a circular wafer map — the content this overlay was
|
|
607
|
+
* built for — but is actively wrong for wide content: the Insights suite
|
|
608
|
+
* lays out ~1330px wide in a normal page, so a 700px square modal makes
|
|
609
|
+
* "expand" produce something SMALLER than the view it expanded from.
|
|
610
|
+
*
|
|
611
|
+
* Also the restore target for maximize and minimize, so an overridden size
|
|
612
|
+
* survives both round trips.
|
|
613
|
+
*/
|
|
614
|
+
boxSize?: {
|
|
615
|
+
width: string;
|
|
616
|
+
height: string;
|
|
617
|
+
};
|
|
344
618
|
/**
|
|
345
619
|
* Called when the maximized state changes — use to reparent tooltips etc. Uses
|
|
346
620
|
* a CSS maximize (the box grows to fill its backdrop/the viewport), not the
|
|
@@ -412,6 +686,11 @@ export declare function openFloatingWindow(opts: Omit<OverlayOptions, 'mode'>):
|
|
|
412
686
|
export interface ReparentModalOptions {
|
|
413
687
|
ownerDocument?: Document;
|
|
414
688
|
title?: string;
|
|
689
|
+
/** Natural box size — see `OverlayOptions.boxSize`. */
|
|
690
|
+
boxSize?: {
|
|
691
|
+
width: string;
|
|
692
|
+
height: string;
|
|
693
|
+
};
|
|
415
694
|
/** Called after the modal has closed and every element has been restored to its original position (or appended back, if its original spot is no longer available — see the stale-reference note above). Runs once, even if nothing was actually moved (the re-entrancy guard tripped). */
|
|
416
695
|
onClosed?: () => void;
|
|
417
696
|
}
|
|
@@ -433,18 +712,33 @@ export declare function openReparentedModal(elements: HTMLElement[], opts?: Repa
|
|
|
433
712
|
* hardBin/softBin restriction (which still changes the die colours, just from
|
|
434
713
|
* a smaller scheme set).
|
|
435
714
|
*/
|
|
715
|
+
/** The colour preferences the palette menu reads and writes. */
|
|
716
|
+
export interface PaletteState {
|
|
717
|
+
plotMode: PlotMode;
|
|
718
|
+
binColorScheme?: string;
|
|
719
|
+
valueColorScheme?: string;
|
|
720
|
+
useDefinedBinColors?: boolean;
|
|
721
|
+
}
|
|
436
722
|
/**
|
|
437
|
-
* Colour-scheme picker
|
|
723
|
+
* Colour-scheme picker. Lists bin palettes in `hardBin`/`softBin` and value
|
|
724
|
+
* gradients everywhere else — including the stacked modes, whose maps are
|
|
725
|
+
* values (a bin's occurrence rate per position), not bin categories. The two
|
|
726
|
+
* are separate preferences, so choosing a gradient for values leaves the bin
|
|
727
|
+
* palette alone and vice versa; nothing is reset on a mode switch.
|
|
728
|
+
*
|
|
729
|
+
* Colours that arrive with the data (`BinDef.color`) are a layer over the bin
|
|
730
|
+
* palette, not a pseudo-palette: the "Use colours from bin definitions" row
|
|
731
|
+
* appears only when some definition carries a colour, and turning it off
|
|
732
|
+
* shows the palette's own colours for those bins.
|
|
438
733
|
*
|
|
439
|
-
*
|
|
440
|
-
*
|
|
441
|
-
* schemes do — "how is this data encoded" — and keeping it here means one
|
|
442
|
-
* control rather than a new axis of settings.
|
|
734
|
+
* "Mark failing dies" used to live here too; it is in Overlays, beside the
|
|
735
|
+
* pass/fail display rows it belongs with.
|
|
443
736
|
*/
|
|
444
|
-
export declare function makePaletteBtn(helpers: ToolbarHelpers,
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
737
|
+
export declare function makePaletteBtn(helpers: ToolbarHelpers, getState: () => PaletteState, hasDefinedBinColors: () => boolean, apply: (partial: {
|
|
738
|
+
binColorScheme?: string;
|
|
739
|
+
valueColorScheme?: string;
|
|
740
|
+
useDefinedBinColors?: boolean;
|
|
741
|
+
}) => void): {
|
|
448
742
|
btn: HTMLButtonElement;
|
|
449
743
|
sync: () => void;
|
|
450
744
|
};
|
|
@@ -460,6 +754,49 @@ export declare function requestedPassFailDisplay(opts: {
|
|
|
460
754
|
* test returns no entries at all — its value mode IS test pass/fail, there is
|
|
461
755
|
* no alternative display to choose.
|
|
462
756
|
*/
|
|
757
|
+
/** The overlay flags an overlays menu offers, however the host stores them. */
|
|
758
|
+
export interface OverlayFlags {
|
|
759
|
+
showRingBoundaries?: boolean;
|
|
760
|
+
showQuadrantBoundaries?: boolean;
|
|
761
|
+
showDieLabels?: boolean;
|
|
762
|
+
showReticle?: boolean;
|
|
763
|
+
showXYIndicator?: boolean;
|
|
764
|
+
passFailDisplay?: 'off' | 'spec' | 'test';
|
|
765
|
+
/**
|
|
766
|
+
* Moved here from the Colour scheme menu, where it had been the one entry
|
|
767
|
+
* that was not a scheme — a marker drawn over dies sitting among mutually
|
|
768
|
+
* exclusive palettes. Overlays is where its sibling already lived: the
|
|
769
|
+
* pass/fail display rows below are the same kind of judgement about the same
|
|
770
|
+
* dies, and putting the two in different menus made neither findable from the
|
|
771
|
+
* other.
|
|
772
|
+
*/
|
|
773
|
+
markFailingDies?: boolean;
|
|
774
|
+
}
|
|
775
|
+
/**
|
|
776
|
+
* The Overlays menu's rows — the five geometry toggles plus whatever
|
|
777
|
+
* `passFailMenuRows` offers for the active test.
|
|
778
|
+
*
|
|
779
|
+
* Built identically by `renderWaferMap` and `renderWaferGallery`, which is the
|
|
780
|
+
* problem it solves: the two lists were the same five labels in the same order
|
|
781
|
+
* with the same option keys, differing only in where the flags live
|
|
782
|
+
* (`viewOpts` vs `sharedOpts`) and how a change is applied (`applyOpts` vs
|
|
783
|
+
* `updateShared`). Adding a sixth overlay meant remembering both, and the map
|
|
784
|
+
* and the gallery quietly offering different menus is the failure that follows
|
|
785
|
+
* from forgetting.
|
|
786
|
+
*
|
|
787
|
+
* `reticleEnabled` stays a caller input: a single map knows whether ITS wafer
|
|
788
|
+
* has a reticle, and the gallery whether ANY item does — genuinely different
|
|
789
|
+
* questions with the same answer type.
|
|
790
|
+
*/
|
|
791
|
+
export declare function overlayMenuRows(flags: OverlayFlags, reticleEnabled: boolean, passFail: {
|
|
792
|
+
functionalActive: boolean;
|
|
793
|
+
hasLimits: boolean;
|
|
794
|
+
hasRecorded: boolean;
|
|
795
|
+
binMode: boolean;
|
|
796
|
+
}, apply: (patch: OverlayFlags) => void): CheckMenuRow[];
|
|
797
|
+
/** Whether any overlay is on — the Overlays button's "active" state. Shared for
|
|
798
|
+
* the same reason as the rows: it enumerates the same five flags. */
|
|
799
|
+
export declare function anyOverlayActive(flags: OverlayFlags): boolean;
|
|
463
800
|
export declare function passFailMenuRows(state: {
|
|
464
801
|
functionalActive: boolean;
|
|
465
802
|
hasLimits: boolean;
|