@weasel-js/labkit 1.6.1 → 1.7.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/dist/_dts/{CanvasStackContext-Wo6OwIVM.d.ts → CanvasStackContext-D2jnIwfk.d.ts} +1 -1
- package/dist/_dts/{LayerList.d-BoELAMsM.d.ts → LayerList.d-DiuEArKq.d.ts} +2 -2
- package/dist/_dts/PrefsRow.d-TOZ7BgD9.d.ts +79 -0
- package/dist/_dts/PropertyPanel.d-D-1paCbE.d.ts +141 -0
- package/dist/_dts/{Select.d-Cr8-zoup.d.ts → Select.d-Bensr_MT.d.ts} +11 -1
- package/dist/_dts/{Stage-DWBBi8IU.d.ts → Stage-CCWfQQWM.d.ts} +58 -18
- package/dist/_dts/index-B2Yj5aA0.d.ts +274 -0
- package/dist/_dts/{index-CKyX0ME_.d.ts → index-CsYqUHD3.d.ts} +2 -2
- package/dist/_dts/{types-DTuViBvc.d.ts → types-CRPSGFAp.d.ts} +13 -4
- package/dist/_dts/{types-B7yBTTF9.d.ts → types-CSm9jgol.d.ts} +2 -2
- package/dist/_dts/{useTrialState-CMaV6UD4.d.ts → useTrialState-CTZPgeZ7.d.ts} +1 -1
- package/dist/canvas/index.d.ts +6 -6
- package/dist/canvas/index.js +2 -2
- package/dist/chrome/index.d.ts +5 -5
- package/dist/chrome/index.js +8 -8
- package/dist/{chunk-QGMOA2YE.js → chunk-275JRRVD.js} +67 -70
- package/dist/chunk-275JRRVD.js.map +1 -0
- package/dist/{chunk-KHK5FGER.js → chunk-4LJSC7MB.js} +8 -10
- package/dist/chunk-4LJSC7MB.js.map +1 -0
- package/dist/{chunk-SLAQPUI4.js → chunk-7BO7HNGF.js} +5 -5
- package/dist/{chunk-SLAQPUI4.js.map → chunk-7BO7HNGF.js.map} +1 -1
- package/dist/chunk-CZZPXUOU.js +3 -0
- package/dist/{chunk-SBXNQW4G.js.map → chunk-CZZPXUOU.js.map} +1 -1
- package/dist/{chunk-6FLXL3I7.js → chunk-FMK7UQ6V.js} +19 -4
- package/dist/chunk-FMK7UQ6V.js.map +1 -0
- package/dist/{chunk-O6FFFOHS.js → chunk-FZ7YFQN7.js} +16 -8
- package/dist/chunk-FZ7YFQN7.js.map +1 -0
- package/dist/{chunk-GHGO52SO.js → chunk-GOZLNM4L.js} +5 -5
- package/dist/{chunk-GHGO52SO.js.map → chunk-GOZLNM4L.js.map} +1 -1
- package/dist/{chunk-4TT3PNPR.js → chunk-I5DUQ5HM.js} +33 -36
- package/dist/chunk-I5DUQ5HM.js.map +1 -0
- package/dist/{chunk-NEXR37YJ.js → chunk-J7OWWTCW.js} +4 -5
- package/dist/chunk-J7OWWTCW.js.map +1 -0
- package/dist/{chunk-IRTGUQ5O.js → chunk-KMJ7RWD3.js} +16 -6
- package/dist/chunk-KMJ7RWD3.js.map +1 -0
- package/dist/{chunk-S4NCI32V.js → chunk-M7HP3FTK.js} +4 -4
- package/dist/{chunk-S4NCI32V.js.map → chunk-M7HP3FTK.js.map} +1 -1
- package/dist/chunk-MIM5R4ZT.js +14972 -0
- package/dist/chunk-MIM5R4ZT.js.map +1 -0
- package/dist/{chunk-ASOK76ZH.js → chunk-T5IBSPAM.js} +59 -26
- package/dist/chunk-T5IBSPAM.js.map +1 -0
- package/dist/{chunk-DWMSB4CA.js → chunk-UNAZSLWE.js} +82 -16
- package/dist/chunk-UNAZSLWE.js.map +1 -0
- package/dist/{chunk-TJ77A4A3.js → chunk-Y23G2VZL.js} +5 -9
- package/dist/chunk-Y23G2VZL.js.map +1 -0
- package/dist/{chunk-HKV7LRHY.js → chunk-YT75VYRD.js} +4 -4
- package/dist/{chunk-HKV7LRHY.js.map → chunk-YT75VYRD.js.map} +1 -1
- package/dist/{chunk-CGHF6RZV.js → chunk-ZIFPHIWZ.js} +9 -7
- package/dist/chunk-ZIFPHIWZ.js.map +1 -0
- package/dist/config/index.d.ts +16 -9
- package/dist/config/index.js +4 -4
- package/dist/controls/index.d.ts +2 -2
- package/dist/controls/index.js +5 -5
- package/dist/dragdrop/index.d.ts +3 -3
- package/dist/index.d.ts +263 -24
- package/dist/index.js +376 -237
- package/dist/index.js.map +1 -1
- package/dist/layers/index.d.ts +4 -4
- package/dist/layers/index.js +2 -2
- package/dist/loupe/index.d.ts +4 -4
- package/dist/loupe/index.js +2 -2
- package/dist/overview/index.d.ts +2 -2
- package/dist/overview/index.js +9 -8
- package/dist/overview/index.js.map +1 -1
- package/dist/passthrough/weasel-ui.d.ts +208 -38
- package/dist/passthrough/weasel-ui.js +3 -3
- package/dist/primitives/index.d.ts +3 -178
- package/dist/primitives/index.js +6 -6
- package/dist/state/index.d.ts +5 -5
- package/dist/state/index.js +4 -4
- package/dist/styles.css +91 -83
- package/dist/undo/index.d.ts +3 -3
- package/package.json +13 -12
- package/src/annotations/AnnotationOverlay.tsx +2 -2
- package/src/annotations/Annotations.less +0 -10
- package/src/annotations/MarkList.tsx +4 -8
- package/src/annotations/paint.test.ts +3 -14
- package/src/annotations/paint.ts +3 -19
- package/src/annotations/svgNodes.test.ts +6 -9
- package/src/annotations/svgNodes.ts +3 -3
- package/src/canvas/AGENTS.md +1 -0
- package/src/canvas/CameraInput.tsx +44 -33
- package/src/canvas/CanvasStack.tsx +6 -1
- package/src/canvas/LinkedCursor.less +1 -1
- package/src/canvas/Stage.test.tsx +33 -4
- package/src/canvas/Stage.tsx +6 -1
- package/src/canvas/cameraRegistry.test.ts +55 -0
- package/src/canvas/cameraRegistry.ts +86 -0
- package/src/canvas/cameraZoom.test.ts +46 -0
- package/src/canvas/cameraZoom.ts +24 -0
- package/src/canvas/index.ts +14 -2
- package/src/canvas/sharedScope.test.tsx +94 -0
- package/src/chrome/ChromeRegions.stories.tsx +1 -0
- package/src/chrome/regions/PaletteRegion.less +0 -7
- package/src/chrome/regions/SidebarRegion.less +12 -2
- package/src/config/builder.test.ts +2 -1
- package/src/config/builder.ts +12 -5
- package/src/config/fromConfigField.test.ts +14 -0
- package/src/config/fromConfigField.ts +18 -4
- package/src/config/path.ts +2 -5
- package/src/config/resolve.ts +4 -0
- package/src/config/types.ts +13 -9
- package/src/controls/ControlPanel.less +1 -1
- package/src/controls/ControlPanel.stories.tsx +3 -2
- package/src/controls/ControlPanel.test.tsx +64 -11
- package/src/controls/ControlPanel.tsx +52 -2
- package/src/index.ts +15 -1
- package/src/lab/Lab.tsx +83 -72
- package/src/lab/{LabFit.stories.less → LabFit.browser.test.less} +1 -1
- package/src/lab/{LabFit.stories.tsx → LabFit.browser.test.tsx} +41 -63
- package/src/lab/LabFullChrome.stories.tsx +1 -0
- package/src/lab/LabHeader.test.tsx +24 -14
- package/src/lab/LabHeader.tsx +11 -12
- package/src/lab/LabShell.less +8 -17
- package/src/lab/LabSwitcher.less +6 -6
- package/src/lab/LabZoom.test.tsx +223 -0
- package/src/lab/LabZoom.tsx +170 -0
- package/src/lab/index.ts +1 -0
- package/src/loupe/LoupeGestures.tsx +1 -1
- package/src/overview/TrialOverview.tsx +7 -5
- package/src/passthrough/weasel-ui.test.ts +2 -0
- package/src/passthrough/weasel-ui.ts +16 -4
- package/src/primitives/FloatingPanel.test.tsx +11 -0
- package/src/primitives/FloatingPanel.tsx +2 -5
- package/src/primitives/JobProgress.less +1 -1
- package/src/primitives/Legend.stories.tsx +1 -0
- package/src/primitives/Readout.browser.test.tsx +137 -0
- package/src/primitives/Readout.less +12 -0
- package/src/primitives/Readout.stories.tsx +58 -0
- package/src/primitives/Readout.test.tsx +93 -0
- package/src/primitives/Readout.tsx +56 -0
- package/src/primitives/index.ts +2 -0
- package/src/specimen/Specimen.stories.tsx +1 -0
- package/src/specimen/Specimen.tsx +2 -2
- package/src/state/Persistence.browser.test.tsx +47 -0
- package/src/state/store.test.ts +5 -1
- package/src/state/usePersistedState.test.tsx +1 -1
- package/src/styles.less +1 -0
- package/src/theme/Interstellar.stories.tsx +3 -1
- package/src/theme/base.less +21 -47
- package/src/theme/interstellar.test.ts +1 -1
- package/src/theme/interstellar.theme.json +10 -3
- package/src/trial/Trial.less +0 -13
- package/src/trial/Trial.tsx +12 -6
- package/src/trial/TrialChrome.tsx +21 -3
- package/dist/_dts/PrefsRow.d-DFpPIeIC.d.ts +0 -39
- package/dist/_dts/PropertyField.d-D0ndfIIt.d.ts +0 -404
- package/dist/chunk-4TT3PNPR.js.map +0 -1
- package/dist/chunk-6FLXL3I7.js.map +0 -1
- package/dist/chunk-ASOK76ZH.js.map +0 -1
- package/dist/chunk-CGHF6RZV.js.map +0 -1
- package/dist/chunk-DWMSB4CA.js.map +0 -1
- package/dist/chunk-IRTGUQ5O.js.map +0 -1
- package/dist/chunk-KHK5FGER.js.map +0 -1
- package/dist/chunk-NEXR37YJ.js.map +0 -1
- package/dist/chunk-O6FFFOHS.js.map +0 -1
- package/dist/chunk-QGMOA2YE.js.map +0 -1
- package/dist/chunk-SBXNQW4G.js +0 -3
- package/dist/chunk-TJ77A4A3.js.map +0 -1
- package/dist/chunk-TYN6MLXX.js +0 -13864
- package/dist/chunk-TYN6MLXX.js.map +0 -1
- package/src/state/Persistence.stories.tsx +0 -75
|
@@ -1,404 +0,0 @@
|
|
|
1
|
-
import * as react from 'react';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
|
-
import { ToolPrefNumberFormat, FillStyle, PaintKind } from '@weasel-js/core';
|
|
4
|
-
import { S as StanceProps } from './PrefsRow.d-DFpPIeIC.js';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Display-formatter for numbers. Use this anywhere a number is shown to
|
|
8
|
-
* a user. The whole point: negative values get prefixed with the real
|
|
9
|
-
* MINUS SIGN (U+2212) instead of the ASCII HYPHEN-MINUS (U+002D) that
|
|
10
|
-
* `toLocaleString` and template literals produce by default.
|
|
11
|
-
*
|
|
12
|
-
* U+2212 is the same visual width as `+` and reads as a sign rather
|
|
13
|
-
* than a hyphen — columns of signed numbers align cleanly and the
|
|
14
|
-
* glyph doesn't get confused with a bullet or list dash.
|
|
15
|
-
*/
|
|
16
|
-
declare const MINUS_SIGN = "\u2212";
|
|
17
|
-
/**
|
|
18
|
-
* Formats a number for display, substituting {@link MINUS_SIGN} for the ASCII
|
|
19
|
-
* hyphen `toLocaleString` emits. Non-finite values stringify as-is.
|
|
20
|
-
*/
|
|
21
|
-
declare function formatNumber(value: number, options?: Intl.NumberFormatOptions): string;
|
|
22
|
-
/** One unit's conversion into the shown unit: a bare factor, or a scale that
|
|
23
|
-
* also moves zero. Structurally the kit's `UnitEntry`, kept local so this
|
|
24
|
-
* formatting helper stays free of the scene vocabulary. */
|
|
25
|
-
type UnitTableEntry = number | {
|
|
26
|
-
factor: number;
|
|
27
|
-
offset?: number;
|
|
28
|
-
};
|
|
29
|
-
/** Suffixes a person may type, each mapped to its conversion. */
|
|
30
|
-
type UnitTable = Record<string, UnitTableEntry>;
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* How much room a container gives its rows — gaps, padding, and field height,
|
|
34
|
-
* moved together. Set on any container in the family; it reaches every
|
|
35
|
-
* descendant, so an inner group can differ from the panel around it.
|
|
36
|
-
*/
|
|
37
|
-
type PropertyDensity = 'tight' | 'normal' | 'roomy';
|
|
38
|
-
/** Where an inline row's label and control sit on the row's cross axis. Set on
|
|
39
|
-
* a container to line a whole column of them up. */
|
|
40
|
-
type PropertyAlign = 'start' | 'center' | 'end' | 'baseline';
|
|
41
|
-
/** Metric props every container in the family takes. Both reach descendants,
|
|
42
|
-
* so the nearest container that states one wins. */
|
|
43
|
-
interface PropertyMetricProps {
|
|
44
|
-
/** Room the rows get. Unset inherits from an outer container, else `normal`. */
|
|
45
|
-
density?: PropertyDensity;
|
|
46
|
-
/**
|
|
47
|
-
* Cross-axis alignment of an inline row's label and control. `baseline` sits
|
|
48
|
-
* the control on the label's first-line baseline, which is what lines a
|
|
49
|
-
* column of swatches up against labels of different heights. Unset keeps each
|
|
50
|
-
* variant's own alignment — a color row centers its label and swatch and
|
|
51
|
-
* sinks the pair to the row's bottom edge, which keeps a paired alpha track
|
|
52
|
-
* level with its neighbour.
|
|
53
|
-
*/
|
|
54
|
-
align?: PropertyAlign;
|
|
55
|
-
}
|
|
56
|
-
/** Props for `<PropertyPanel>`. */
|
|
57
|
-
interface PropertyPanelProps extends PropertyMetricProps, StanceProps {
|
|
58
|
-
title?: ReactNode;
|
|
59
|
-
/** Controls on the trailing edge of the title row — a switch, a clear
|
|
60
|
-
* button. They sit outside the heading, so they neither take its type nor
|
|
61
|
-
* join its accessible name. */
|
|
62
|
-
actions?: ReactNode;
|
|
63
|
-
/**
|
|
64
|
-
* Lets text inside the panel be selected and copied. A panel is chrome by
|
|
65
|
-
* default, so a drag across it moves a slider rather than painting a
|
|
66
|
-
* selection; a `debug` panel defaults to selectable, since what it shows —
|
|
67
|
-
* ids, keys, traces — is there to be copied.
|
|
68
|
-
*/
|
|
69
|
-
selectable?: boolean;
|
|
70
|
-
children: ReactNode;
|
|
71
|
-
className?: string;
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* A titled panel holding property rows — the sidebar container the rest of
|
|
75
|
-
* this module's components fill.
|
|
76
|
-
*
|
|
77
|
-
* `stance` says what kind of content it holds and `tone` which of its peers it
|
|
78
|
-
* is; the theme's `--wzl-panel-*` and `--wzl-stance-*` slots decide how each looks. A stanced
|
|
79
|
-
* panel's title takes the row-label recipe rather than the display title.
|
|
80
|
-
*/
|
|
81
|
-
declare function PropertyPanel({ title, actions, selectable, children, className, density, align, stance, tone, }: PropertyPanelProps): react.JSX.Element;
|
|
82
|
-
/** How a property list packs its rows into two columns. */
|
|
83
|
-
type PropertyListPack = 'auto-color' | 'pairs' | 'one-up';
|
|
84
|
-
/** Props for `<PropertyList>`. */
|
|
85
|
-
interface PropertyListProps extends PropertyMetricProps {
|
|
86
|
-
children: ReactNode;
|
|
87
|
-
className?: string;
|
|
88
|
-
/**
|
|
89
|
-
* How rows pack into the 2-column grid.
|
|
90
|
-
* - `'auto-color'` (default): only color rows pair side-by-side; everything
|
|
91
|
-
* else spans the full width. Right for sparse top-level panels.
|
|
92
|
-
* - `'pairs'`: every row auto-places into the 2-column grid two-per-row.
|
|
93
|
-
* Headers and subpanels still span the full width; wrap any other
|
|
94
|
-
* full-width child in `<PropertySpan>`. Right for dense effect bodies.
|
|
95
|
-
* - `'one-up'`: every row spans the full width, color rows included. Right
|
|
96
|
-
* for a palette — a column of swatches read as a group.
|
|
97
|
-
*/
|
|
98
|
-
pack?: PropertyListPack;
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Grid container for PropertyRows. Use standalone for chrome-less layouts, or
|
|
102
|
-
* nest inside <PropertyPanel/> for the standard glass card.
|
|
103
|
-
*/
|
|
104
|
-
declare const PropertyList: react.ForwardRefExoticComponent<PropertyListProps & react.RefAttributes<HTMLDivElement>>;
|
|
105
|
-
/** Props for `<PropertySpan>`. */
|
|
106
|
-
interface PropertySpanProps {
|
|
107
|
-
children: ReactNode;
|
|
108
|
-
className?: string;
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Wrapper that makes an arbitrary child span both columns of a
|
|
112
|
-
* `<PropertyList pack="pairs">`, a `<PropertyGroup pack="pairs">` body, or a
|
|
113
|
-
* `<Subpanel>`. `<PropertyRow span>` covers the row case; this covers
|
|
114
|
-
* everything else a consumer puts in the grid.
|
|
115
|
-
*/
|
|
116
|
-
declare function PropertySpan({ children, className }: PropertySpanProps): react.JSX.Element;
|
|
117
|
-
/** Which control shape a row holds, which decides its intrinsic layout. */
|
|
118
|
-
type PropertyRowVariant = 'default' | 'color' | 'checkbox';
|
|
119
|
-
/** Whether a row's label sits above its control or beside it. */
|
|
120
|
-
type PropertyRowLayout = 'block' | 'inline';
|
|
121
|
-
/** Props for `<PropertyRow>`. */
|
|
122
|
-
interface PropertyRowProps extends PropertyMetricProps {
|
|
123
|
-
label: ReactNode;
|
|
124
|
-
/** Right-aligned readout shown next to the label (e.g. current value). */
|
|
125
|
-
readout?: ReactNode;
|
|
126
|
-
/**
|
|
127
|
-
* Help text for the row, shown in a tooltip off an ⓘ affordance beside the
|
|
128
|
-
* label. Empty or absent renders no affordance.
|
|
129
|
-
*/
|
|
130
|
-
description?: string;
|
|
131
|
-
variant?: PropertyRowVariant;
|
|
132
|
-
/**
|
|
133
|
-
* Label position relative to the control. Unset takes the variant's own
|
|
134
|
-
* orientation: `block` — label above control — for the default variant, and
|
|
135
|
-
* `inline` for the color and checkbox variants, which read as a row.
|
|
136
|
-
*/
|
|
137
|
-
layout?: PropertyRowLayout;
|
|
138
|
-
/**
|
|
139
|
-
* Take the full width of the enclosing grid. Only has an effect inside a
|
|
140
|
-
* `<PropertyList pack="pairs">` or a `<Subpanel>`; elsewhere rows are already
|
|
141
|
-
* full width.
|
|
142
|
-
*/
|
|
143
|
-
span?: boolean;
|
|
144
|
-
children: ReactNode;
|
|
145
|
-
htmlFor?: string;
|
|
146
|
-
/** The control is a group of several (a segmented toggle), not one element.
|
|
147
|
-
* The row then renders as a `<div>`: a `<label>` hands a click on its text to
|
|
148
|
-
* its first control, which in a group means selecting the first option. Each
|
|
149
|
-
* member has to carry its own name. */
|
|
150
|
-
group?: boolean;
|
|
151
|
-
className?: string;
|
|
152
|
-
/** The row is auto: its value is not pinned and the owner computes it. The
|
|
153
|
-
* control is hidden — its box kept, so the row does not resize — and the
|
|
154
|
-
* row reads out the word instead. */
|
|
155
|
-
auto?: boolean;
|
|
156
|
-
/** Given, the row's label toggles `auto` when it is clicked. Omitted, the row
|
|
157
|
-
* can show an auto state but not change it.
|
|
158
|
-
*
|
|
159
|
-
* The label then names that toggle, so a control passed as `children` has to
|
|
160
|
-
* carry its own accessible name — every `<PropertyField>` does. */
|
|
161
|
-
onAutoChange?: (next: boolean) => void;
|
|
162
|
-
/**
|
|
163
|
-
* What draws the row's control. `bare` (the default) is a native input the
|
|
164
|
-
* row's stylesheet dresses; `framed` is a kit field bringing its own frame,
|
|
165
|
-
* which the row then leaves alone — see {@link PropertyFieldChrome}.
|
|
166
|
-
*/
|
|
167
|
-
chrome?: PropertyFieldChrome;
|
|
168
|
-
}
|
|
169
|
-
/** The label-plus-control frame `<PropertyField>` draws its rows in. Use it
|
|
170
|
-
* directly for a control no field kind covers. */
|
|
171
|
-
declare function PropertyRow({ label, readout, description, variant, layout, span, children, htmlFor, group, className, density, align, auto, onAutoChange, chrome, }: PropertyRowProps): react.JSX.Element;
|
|
172
|
-
|
|
173
|
-
/**
|
|
174
|
-
* Which controls a field is drawn with.
|
|
175
|
-
*
|
|
176
|
-
* - `'bare'` (the default): native inputs the property row's own stylesheet
|
|
177
|
-
* draws — the compact controls of an inspector sidebar or a lab panel.
|
|
178
|
-
* - `'framed'`: the kit's field components, each bringing its own frame —
|
|
179
|
-
* for a surface whose row does not style its controls (`SelectionPanel`,
|
|
180
|
-
* `ToolOptionsBar`), or that needs what only they do, such as reading a
|
|
181
|
-
* unit typed into a number (`accepts`).
|
|
182
|
-
*
|
|
183
|
-
* The two differ only where the kit still has two widgets for one job; a
|
|
184
|
-
* slider, a switch, a font picker and a paint are the same in both.
|
|
185
|
-
*/
|
|
186
|
-
type PropertyFieldChrome = 'bare' | 'framed';
|
|
187
|
-
/** One choice of an enum field. */
|
|
188
|
-
interface PropertyOption<T extends string> {
|
|
189
|
-
value: T;
|
|
190
|
-
/** The option's name. A string also names its segment for a screen reader. */
|
|
191
|
-
label: ReactNode;
|
|
192
|
-
/** What a segment shows in place of `label` when the full one would not fit
|
|
193
|
-
* — a glyph or a letter. `label` stays the accessible name. */
|
|
194
|
-
glyph?: ReactNode;
|
|
195
|
-
/** Shown but not choosable: a value the control reports and cannot author. */
|
|
196
|
-
disabled?: boolean;
|
|
197
|
-
}
|
|
198
|
-
/** Props every kind of field shares. */
|
|
199
|
-
interface FieldBase {
|
|
200
|
-
/** The control's accessible name. A `<PropertyField>` takes it from a string
|
|
201
|
-
* `label` when this is omitted. */
|
|
202
|
-
name?: string;
|
|
203
|
-
/** The sources the field reads disagree — a multi-selection whose nodes
|
|
204
|
-
* differ. The control shows no value, in whatever form it has for that. */
|
|
205
|
-
mixed?: boolean;
|
|
206
|
-
/**
|
|
207
|
-
* The sources agree on holding nothing: whatever is in effect comes from a
|
|
208
|
-
* fallback further down. The control shows no chosen value rather than
|
|
209
|
-
* inventing one, since the next edit would write the invention back.
|
|
210
|
-
*/
|
|
211
|
-
unset?: boolean;
|
|
212
|
-
chrome?: PropertyFieldChrome;
|
|
213
|
-
/** Class on the control element itself. */
|
|
214
|
-
className?: string;
|
|
215
|
-
/** Id for the control element, for a `<label htmlFor>` outside it. */
|
|
216
|
-
id?: string;
|
|
217
|
-
}
|
|
218
|
-
/** A boolean field. */
|
|
219
|
-
interface PropertyBooleanFieldProps extends FieldBase {
|
|
220
|
-
kind: 'boolean';
|
|
221
|
-
/** `checkbox` (default), `switch`, or `toggle` — a one-segment pressable bar. */
|
|
222
|
-
control?: 'checkbox' | 'switch' | 'toggle';
|
|
223
|
-
/** Absent reads as off. */
|
|
224
|
-
value: boolean | undefined;
|
|
225
|
-
onChange: (next: boolean) => void;
|
|
226
|
-
/** A `toggle`'s segment content. Defaults to the first letter of `name`. */
|
|
227
|
-
glyph?: ReactNode;
|
|
228
|
-
}
|
|
229
|
-
/** A number field. */
|
|
230
|
-
interface PropertyNumberFieldProps extends FieldBase {
|
|
231
|
-
kind: 'number';
|
|
232
|
-
/** `input` (default) for a typed number; `slider` for a track with an
|
|
233
|
-
* editable readout, where the range matters more than the exact value. */
|
|
234
|
-
control?: 'input' | 'slider';
|
|
235
|
-
/** Absent reads as an empty field. */
|
|
236
|
-
value: number | null | undefined;
|
|
237
|
-
/**
|
|
238
|
-
* The committed value. Given `onInput` as well, it fires once a drag ends,
|
|
239
|
-
* or on blur or Enter in a typed field; on its own it fires on every move
|
|
240
|
-
* and keystroke. A `framed` typed field commits only on blur or Enter,
|
|
241
|
-
* whichever callbacks it has.
|
|
242
|
-
*/
|
|
243
|
-
onChange: (next: number) => void;
|
|
244
|
-
/** The live value, fired continuously. Pass it alongside `onChange` when the
|
|
245
|
-
* write is expensive — cheap state here, the costly work there. */
|
|
246
|
-
onInput?: (next: number) => void;
|
|
247
|
-
/** A slider's track runs 0..100 where these are omitted. */
|
|
248
|
-
min?: number;
|
|
249
|
-
max?: number;
|
|
250
|
-
step?: number;
|
|
251
|
-
/**
|
|
252
|
-
* Suffix after the value. A string becomes a dim word unit (`px`); pass JSX
|
|
253
|
-
* like `<sup>°</sup>` for a symbol. Display only — the value stays a number.
|
|
254
|
-
*/
|
|
255
|
-
unit?: ReactNode;
|
|
256
|
-
/** Units a person may type into a `framed` field, each mapped to the factor
|
|
257
|
-
* that turns it into the unit shown: `{ mm: 0.1, cm: 1 }`. */
|
|
258
|
-
accepts?: Readonly<UnitTable>;
|
|
259
|
-
/** A slider readout's display. Defaults to the value at `step`'s precision. */
|
|
260
|
-
format?: (value: number) => ReactNode;
|
|
261
|
-
/** A named display for the value: `compact` reads `2.00M`. `format` wins. */
|
|
262
|
-
notation?: ToolPrefNumberFormat;
|
|
263
|
-
placeholder?: string;
|
|
264
|
-
/** A `framed` unitless field's stepper buttons. Default `true`. */
|
|
265
|
-
steppers?: boolean;
|
|
266
|
-
}
|
|
267
|
-
/** A text field. */
|
|
268
|
-
interface PropertyStringFieldProps extends FieldBase {
|
|
269
|
-
kind: 'string';
|
|
270
|
-
control?: 'input' | 'textarea';
|
|
271
|
-
/** Absent reads as an empty field. */
|
|
272
|
-
value: string | null | undefined;
|
|
273
|
-
/**
|
|
274
|
-
* The committed text. On its own it fires on every keystroke. Given
|
|
275
|
-
* `onInput` as well, the field drafts: `onInput` gets each keystroke and
|
|
276
|
-
* this fires once, on blur or Enter, and only if the text changed.
|
|
277
|
-
*/
|
|
278
|
-
onChange: (next: string) => void;
|
|
279
|
-
onInput?: (next: string) => void;
|
|
280
|
-
placeholder?: string;
|
|
281
|
-
maxLength?: number;
|
|
282
|
-
}
|
|
283
|
-
/** A choice among fixed options. */
|
|
284
|
-
interface PropertyEnumFieldProps<T extends string = string> extends FieldBase {
|
|
285
|
-
kind: 'enum';
|
|
286
|
-
/**
|
|
287
|
-
* `select` (default) is a dropdown. `radio` and `toggle` show every option
|
|
288
|
-
* at once — a radio group chooses, and a toggle is a row of pressable
|
|
289
|
-
* segments. Drawn `bare`, both are segments.
|
|
290
|
-
*/
|
|
291
|
-
control?: 'select' | 'radio' | 'toggle';
|
|
292
|
-
/** Absent, or not one of `options`, chooses nothing. */
|
|
293
|
-
value: T | undefined;
|
|
294
|
-
options: ReadonlyArray<PropertyOption<T>>;
|
|
295
|
-
onChange: (next: T) => void;
|
|
296
|
-
/** Shown while no option is chosen. Defaults to "Choose option…". */
|
|
297
|
-
placeholder?: string;
|
|
298
|
-
}
|
|
299
|
-
/** A single color. */
|
|
300
|
-
interface PropertyColorFieldProps extends FieldBase {
|
|
301
|
-
kind: 'color';
|
|
302
|
-
/** `#rrggbb`, or `#rrggbbaa` when `alpha` is `true`. */
|
|
303
|
-
value: string | undefined;
|
|
304
|
-
/**
|
|
305
|
-
* The committed color. `bare`: given `onInput` as well, it fires once the
|
|
306
|
-
* picker closes; on its own it fires on every move. `framed`: it fires once
|
|
307
|
-
* per gesture, whichever callbacks it has.
|
|
308
|
-
*/
|
|
309
|
-
onChange: (next: string) => void;
|
|
310
|
-
onInput?: (next: string) => void;
|
|
311
|
-
/**
|
|
312
|
-
* Offer an opacity track. `true` keeps the alpha in `value` as `#rrggbbaa`;
|
|
313
|
-
* a number is the 0..1 alpha held apart from it, reported through
|
|
314
|
-
* `onAlphaChange` / `onAlphaInput`.
|
|
315
|
-
*/
|
|
316
|
-
alpha?: boolean | number;
|
|
317
|
-
onAlphaChange?: (next: number) => void;
|
|
318
|
-
onAlphaInput?: (next: number) => void;
|
|
319
|
-
/** Draw the opacity track inert, for a consumer that drops alpha. */
|
|
320
|
-
alphaDisabled?: boolean;
|
|
321
|
-
}
|
|
322
|
-
/** A whole paint: a solid, a gradient, a pattern, or none. */
|
|
323
|
-
interface PropertyPaintFieldProps extends FieldBase {
|
|
324
|
-
kind: 'paint';
|
|
325
|
-
/** `swatch` (default) opens the editor in a popover, for a narrow slot;
|
|
326
|
-
* `inline` draws the kind bar and its editor in place. */
|
|
327
|
-
control?: 'swatch' | 'inline';
|
|
328
|
-
/** `null` is an explicit "no paint"; `undefined` is nothing to show. */
|
|
329
|
-
value: FillStyle | null | undefined;
|
|
330
|
-
onChange: (next: FillStyle | null) => void;
|
|
331
|
-
onInput?: (next: FillStyle | null) => void;
|
|
332
|
-
/** Offer "None". Default `true`. */
|
|
333
|
-
allowNone?: boolean;
|
|
334
|
-
/** Restrict the kinds offered. Default: every registered kind. */
|
|
335
|
-
kinds?: readonly PaintKind[];
|
|
336
|
-
}
|
|
337
|
-
/** A font family, picked from the live font registry. */
|
|
338
|
-
interface PropertyFontFamilyFieldProps extends FieldBase {
|
|
339
|
-
kind: 'font-family';
|
|
340
|
-
value: string | undefined;
|
|
341
|
-
onChange: (next: string) => void;
|
|
342
|
-
/** The weight and slant the family is drawn at, so the picker names the
|
|
343
|
-
* variant that will actually paint. */
|
|
344
|
-
weight?: number;
|
|
345
|
-
fontStyle?: 'normal' | 'italic';
|
|
346
|
-
}
|
|
347
|
-
/**
|
|
348
|
-
* One field for {@link PropertyControl} and {@link PropertyField}, keyed by
|
|
349
|
-
* `kind`.
|
|
350
|
-
*/
|
|
351
|
-
type PropertyControlProps<T extends string = string> = PropertyBooleanFieldProps | PropertyNumberFieldProps | PropertyStringFieldProps | PropertyEnumFieldProps<T> | PropertyColorFieldProps | PropertyPaintFieldProps | PropertyFontFamilyFieldProps;
|
|
352
|
-
/** Row props {@link PropertyField} adds to the field it draws. */
|
|
353
|
-
interface PropertyFieldRowProps extends PropertyMetricProps {
|
|
354
|
-
label: ReactNode;
|
|
355
|
-
/**
|
|
356
|
-
* Text beside the label. On a slider it replaces the editable readout —
|
|
357
|
-
* use it when the row is not showing a number a caller could type back,
|
|
358
|
-
* such as an auto row's `auto`.
|
|
359
|
-
*/
|
|
360
|
-
readout?: ReactNode;
|
|
361
|
-
description?: string;
|
|
362
|
-
layout?: PropertyRowLayout;
|
|
363
|
-
/** Take the full width of the enclosing grid — see `<PropertyRow span>`. */
|
|
364
|
-
span?: boolean;
|
|
365
|
-
/** The row is auto — see `<PropertyRow auto>`. */
|
|
366
|
-
auto?: boolean;
|
|
367
|
-
/** Toggles `auto` from the row's label — see `<PropertyRow onAutoChange>`. */
|
|
368
|
-
onAutoChange?: (next: boolean) => void;
|
|
369
|
-
/** Class on the row. `controlClassName` reaches the control. */
|
|
370
|
-
rowClassName?: string;
|
|
371
|
-
controlClassName?: string;
|
|
372
|
-
}
|
|
373
|
-
/** Props for {@link PropertyField}: one field, and the row around it. */
|
|
374
|
-
type PropertyFieldProps<T extends string = string> = PropertyFieldRowProps & DistributiveOmit<PropertyControlProps<T>, 'className' | 'id'>;
|
|
375
|
-
type DistributiveOmit<U, K extends PropertyKey> = U extends unknown ? Omit<U, K> : never;
|
|
376
|
-
/**
|
|
377
|
-
* A labeled settings row for one field, its control chosen by `kind` (and
|
|
378
|
-
* `control`): `<PropertyField kind="number" control="slider" label="Blur" …>`.
|
|
379
|
-
*
|
|
380
|
-
* The row is a {@link PropertyRow}; the control is the one
|
|
381
|
-
* {@link PropertyControl} draws for the same props. Every schema-driven
|
|
382
|
-
* settings surface in the kit — `ControlPanel`, `PrefsForm`, `SelectionPanel`
|
|
383
|
-
* — draws its built-in kinds through that one mapping, so a kind's control
|
|
384
|
-
* is decided once.
|
|
385
|
-
*
|
|
386
|
-
* Callbacks follow the field's shape: a discrete control (a box, a choice)
|
|
387
|
-
* reports each pick; a continuous or typed one reports every change through
|
|
388
|
-
* `onChange` alone, or splits them into live `onInput` and settled
|
|
389
|
-
* `onChange` when given both. `mixed` and `unset` show a field whose sources
|
|
390
|
-
* disagree, or agree on holding nothing.
|
|
391
|
-
*/
|
|
392
|
-
declare function PropertyField<T extends string = string>(props: PropertyFieldProps<T>): react.JSX.Element;
|
|
393
|
-
/**
|
|
394
|
-
* The control for one field, with no row around it — for a cell that shares
|
|
395
|
-
* a row with others, or a surface that draws its own row. Keyed by `kind`
|
|
396
|
-
* (and `control`), the same mapping {@link PropertyField} draws.
|
|
397
|
-
*
|
|
398
|
-
* A slider brings its readout beside the track. Several elements come back
|
|
399
|
-
* as siblings rather than wrapped, so the surrounding row lays them out.
|
|
400
|
-
*/
|
|
401
|
-
declare function PropertyControl<T extends string = string>(typed: PropertyControlProps<T>): react.JSX.Element;
|
|
402
|
-
|
|
403
|
-
export { MINUS_SIGN as M, PropertyControl as b, PropertyField as d, PropertyList as f, PropertyPanel as i, PropertyRow as k, PropertySpan as o, formatNumber as s };
|
|
404
|
-
export type { PropertyMetricProps as P, PropertyListPack as a, PropertyControlProps as c, PropertyFieldProps as e, PropertyListProps as g, PropertyOption as h, PropertyPanelProps as j, PropertyRowLayout as l, PropertyRowProps as m, PropertyRowVariant as n, PropertySpanProps as p, PropertyAlign as q, PropertyDensity as r };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/annotations/ExportMenu.tsx","../src/annotations/MarkList.tsx","../src/chrome/builtins.tsx","../src/annotations/toolMap.ts","../src/tools/labTool.ts","../src/chrome/merge.ts","../src/chrome/regions/SidebarRegion.tsx","../src/chrome/regions/StatusRegion.tsx","../src/chrome/regions/ToolbarRegion.tsx","../src/chrome/LabChrome.tsx","../src/chrome/regions/PaletteRegion.tsx","../src/chrome/regions/TitleBarRegion.tsx","../src/chrome/regions/ViewportRegion.tsx"],"names":["g","jsx","jsxs","u","d","n","o","renderEntry"],"mappings":";;;;;;;;;;;AAOA,IAAM,MAAA,GAAS,CAAC,CAAA,EAAG,CAAA,EAAG,CAAC,CAAA;AACvB,IAAM,OAAA,GAAU;AAAA,EACd,EAAE,EAAA,EAAI,KAAA,EAAO,KAAA,EAAO,KAAA,EAAM;AAAA,EAC1B,EAAE,EAAA,EAAI,KAAA,EAAO,KAAA,EAAO,KAAA;AACtB,CAAA;AAIA,SAAS,SAAS,MAAA,EAA+B;AAC/C,EAAA,OAAO,CAAA,EAAG,OAAO,MAAA,CAAO,OAAA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AAA,kBAAAA,GAAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAM,EAAA,EAAI;AAAA,WAAA;AAAA,UARX,CAAA,CAAE;AAAA,SAST;AAAA,MAEJ,CAAC;AAAA;AAAA,GACH;AAEJ","file":"chunk-4TT3PNPR.js","sourcesContent":["import { ExportIcon } from '@weasel-js/ui';\nimport { useId, useState } from 'react';\nimport { Callout } from '../passthrough/weasel-ui';\nimport { Toolbar } from '../primitives/Toolbar';\nimport { useAnnotationsOptional } from './AnnotationsContext';\nimport type { CaptureResult } from './types';\n\nconst SCALES = [1, 2, 4] as const;\nconst FORMATS = [\n { id: 'png', label: 'PNG' },\n { id: 'svg', label: 'SVG' },\n] as const;\n\ntype Format = (typeof FORMATS)[number]['id'];\n\nfunction fileName(result: CaptureResult): string {\n return `${result.target.replace(/[^a-z0-9._-]+/gi, '-')}.${result.format}`;\n}\n\n/** A blob the person asked for, handed to the browser's own save flow. The\n * object URL is revoked on the next turn — revoking it synchronously races\n * the navigation the click starts. */\nfunction download(result: CaptureResult): void {\n const url = URL.createObjectURL(result.blob);\n const a = document.createElement('a');\n a.href = url;\n a.download = fileName(result);\n a.click();\n setTimeout(() => URL.revokeObjectURL(url), 0);\n}\n\n/** PNG goes to the clipboard as an image. SVG goes as text: `image/svg+xml`\n * needs Chromium's `web ` prefix and nothing else reads it, while the markup\n * is what a person pasting a vector export actually wants. */\nasync function copy(result: CaptureResult): Promise<void> {\n if (result.format === 'svg') {\n await navigator.clipboard.writeText(await result.blob.text());\n return;\n }\n await navigator.clipboard.write([new ClipboardItem({ 'image/png': result.blob })]);\n}\n\n/**\n * Export a target's picture with its marks on it.\n *\n * A panel rather than a button because a mark belongs to a target: with more\n * than one pane, \"export\" on its own does not say what.\n *\n * Reads the store through the hook the way `<MarkList>` does — the chrome\n * context carries no instrument state and is not the route to it.\n */\nexport function ExportMenu() {\n const marks = useAnnotationsOptional();\n const [anchor, setAnchor] = useState<HTMLSpanElement | null>(null);\n const [open, setOpen] = useState(false);\n const [target, setTarget] = useState<string | null>(null);\n const [format, setFormat] = useState<Format>('png');\n const [scale, setScale] = useState<number>(2);\n const [busy, setBusy] = useState(false);\n const [error, setError] = useState<string | null>(null);\n const titleId = useId();\n\n if (!marks) return null;\n const targets = marks.targets();\n const chosen = target ?? targets[0]?.id ?? null;\n\n const run = async (then: (r: CaptureResult) => void | Promise<void>): Promise<void> => {\n if (!chosen) return;\n setBusy(true);\n setError(null);\n try {\n await then(await marks.capture(chosen, { format, scale }));\n setOpen(false);\n } catch (err) {\n setError(err instanceof Error ? err.message : String(err));\n } finally {\n setBusy(false);\n }\n };\n\n return (\n <span className=\"lk-export\" ref={setAnchor}>\n <Toolbar.Button\n iconOnly\n pressed={open}\n aria-label=\"Export\"\n title=\"Export\"\n onClick={() => setOpen((was) => !was)}\n >\n <ExportIcon size={16} />\n </Toolbar.Button>\n <Callout\n triggerRef={{ current: anchor }}\n isOpen={open}\n onOpenChange={setOpen}\n onDismiss={() => setOpen(false)}\n placement=\"bottom end\"\n aria-labelledby={titleId}\n >\n <div className=\"lk-export__panel\">\n <span className=\"lk-export__title\" id={titleId}>\n Export\n </span>\n\n <label className=\"lk-export__row\">\n <span>Target</span>\n {/* Native controls: role, name and keyboard operability for free,\n and a five-control panel is not the place to rebuild them. */}\n <select\n aria-label=\"Target\"\n value={chosen ?? ''}\n onChange={(e) => setTarget(e.target.value)}\n >\n {targets.map((t) => (\n <option key={t.id} value={t.id}>\n {t.id}\n </option>\n ))}\n </select>\n </label>\n\n {/* A <fieldset>/<legend> cannot do this: a legend is outside its\n fieldset's grid formatting context, so it will not take a grid\n column and every choice row drops below its own label. */}\n <div className=\"lk-export__row\">\n <span>Format</span>\n <span className=\"lk-export__choices\" role=\"radiogroup\" aria-label=\"Format\">\n {FORMATS.map((f) => (\n <label key={f.id}>\n <input\n type=\"radio\"\n name=\"lk-export-format\"\n checked={format === f.id}\n onChange={() => setFormat(f.id)}\n />\n {f.label}\n </label>\n ))}\n </span>\n </div>\n\n <div className=\"lk-export__row\">\n <span>Scale</span>\n <span className=\"lk-export__choices\" role=\"radiogroup\" aria-label=\"Scale\">\n {SCALES.map((s) => (\n <label key={s}>\n <input\n type=\"radio\"\n name=\"lk-export-scale\"\n checked={scale === s}\n onChange={() => setScale(s)}\n />\n {s}×\n </label>\n ))}\n </span>\n </div>\n\n <div className=\"lk-export__actions\">\n <button type=\"button\" disabled={busy || !chosen} onClick={() => run(download)}>\n Download\n </button>\n <button type=\"button\" disabled={busy || !chosen} onClick={() => run(copy)}>\n Copy\n </button>\n </div>\n\n {error ? (\n <p className=\"lk-export__error\" role=\"alert\">\n {error}\n </p>\n ) : null}\n </div>\n </Callout>\n </span>\n );\n}\n","import { Input } from '../passthrough/weasel-ui';\nimport { useAnnotations } from './AnnotationsContext';\nimport type { AnnotationMeaning } from './types';\n\n/** Props for `<MarkList>`. */\nexport interface MarkListProps {\n /** The instrument's vocabulary. Omitted, rows carry no status control —\n * a host that declared none owns what a mark means. */\n meaning?: AnnotationMeaning;\n /** The live config, for answering staleness. */\n config: unknown;\n}\n\n/** Every mark on this trial's targets: what it says, and whether it still\n * describes the picture under it.\n *\n * Reads the store through the hook, which re-renders on every mutation — so a\n * mark drawn on a pane appears here without anything wiring the two. */\nexport function MarkList({ meaning, config }: MarkListProps) {\n const marks = useAnnotations();\n const all = marks.query();\n const statuses = meaning?.statuses ?? [];\n\n if (all.length === 0) {\n return <div className=\"lk-mark-list__empty\">No marks yet</div>;\n }\n\n return (\n <ul className=\"lk-mark-list\">\n {all.map((a) => {\n const stale = marks.isStale(a, config);\n return (\n <li className=\"lk-mark-list__row\" key={a.id}>\n <div className=\"lk-mark-list__head\">\n <span className=\"lk-mark-list__kind\">{a.kind}</span>\n <span className=\"lk-mark-list__target\">{a.target}</span>\n {stale ? <span className=\"lk-mark-list__stale\">stale</span> : null}\n <button\n type=\"button\"\n className=\"lk-mark-list__drop\"\n aria-label={`Remove ${a.kind} on ${a.target}`}\n onClick={() => marks.remove(a.id)}\n >\n ×\n </button>\n </div>\n <Input\n className=\"lk-mark-list__title\"\n aria-label={`Title of ${a.kind} on ${a.target}`}\n value={a.title ?? ''}\n placeholder=\"Untitled\"\n onChange={(next) => marks.update(a.id, { title: next })}\n />\n {statuses.length > 0 ? (\n // A native select: it carries role, name and keyboard operability\n // for free, and a sidebar row is not the place to rebuild them.\n <select\n className=\"lk-mark-list__status\"\n aria-label={`Status of ${a.kind} on ${a.target}`}\n value={a.status ?? ''}\n onChange={(e) => marks.update(a.id, { status: e.target.value })}\n >\n <option value=\"\">—</option>\n {statuses.map((s) => (\n <option key={s.id} value={s.id}>\n {s.label}\n </option>\n ))}\n </select>\n ) : null}\n </li>\n );\n })}\n </ul>\n );\n}\n","import {\n CloneIcon,\n CloseIcon,\n FitIcon,\n LoupeIcon,\n RedoIcon,\n ResetIcon,\n SnapshotIcon,\n UndoIcon,\n ZoomInIcon,\n ZoomOutIcon,\n} from '@weasel-js/ui';\nimport { ExportMenu } from '../annotations/ExportMenu';\nimport { MarkList } from '../annotations/MarkList';\nimport type { ControlRenderer } from '../config/types';\nimport { ControlPanel } from '../controls/ControlPanel';\nimport type { Instrument } from '../instrument/types';\nimport { MenuButton } from '../passthrough/weasel-ui';\nimport { FpsMeter } from '../primitives/FpsMeter';\nimport { ScaleIndicator } from '../primitives/ScaleIndicator';\nimport { ZoomControl } from '../primitives/ZoomControl';\nimport type { TrialChromeContext, TrialContribution } from './types';\n\nconst ZOOM_STEP = 1.25;\n\n/** The property groups inside a contribution are folded under keys prefixed\n * with that contribution's id, so a group called `marks` cannot fold the\n * sidebar section of the same name. `ControlPanel` keys by bare label, so the\n * prefix goes on here and comes off again. */\nfunction groupFolds(\n collapsedSections: Readonly<Record<string, boolean>>,\n id: string,\n): Record<string, boolean> {\n const prefix = `${id}/`;\n const out: Record<string, boolean> = {};\n for (const [key, value] of Object.entries(collapsedSections)) {\n if (key.startsWith(prefix)) out[key.slice(prefix.length)] = value;\n }\n return out;\n}\n\n/**\n * The contributions a trial gets from what its instrument declared. This is\n * the whole \"declaring a capability provides the chrome\" rule — it replaces\n * the presence checks that used to be spread across the runtime.\n */\nexport function builtinContributions(\n instrument: Instrument,\n ctx: TrialChromeContext,\n controls?: Record<string, ControlRenderer>,\n): TrialContribution[] {\n const out: TrialContribution[] = [];\n const zoom = ctx.zoom;\n\n // Weasel history is the undo authority for marks, so declaring `annotations`\n // gets the buttons whether or not the instrument also declares `undo`.\n if (instrument.undo != null || instrument.annotations != null) {\n out.push({\n id: 'undo',\n region: 'toolbar',\n group: 'history',\n item: {\n icon: UndoIcon,\n label: 'Undo',\n shortcut: 'Mod+Z',\n disabled: !ctx.canUndo,\n onActivate: ctx.undo,\n },\n });\n out.push({\n id: 'redo',\n region: 'toolbar',\n group: 'history',\n item: {\n icon: RedoIcon,\n label: 'Redo',\n shortcut: 'Mod+Shift+Z',\n disabled: !ctx.canRedo,\n onActivate: ctx.redo,\n },\n });\n }\n\n // A tool id shares the contribution namespace, so a tool called `close`\n // collides with the built-in close button and throws. Annotation tools are\n // not here: the lab's rail carries them.\n for (const t of instrument.tools?.tools ?? []) {\n out.push({\n id: t.id,\n region: 'palette',\n group: t.group,\n item: { icon: t.icon, label: t.label, shortcut: t.shortcut },\n });\n }\n\n if (instrument.loupe != null) {\n out.push({\n id: 'loupe',\n region: 'toolbar',\n group: 'view',\n item: {\n icon: LoupeIcon,\n label: 'Loupe',\n pressed: ctx.loupeOn,\n onActivate: ctx.toggleLoupe,\n },\n });\n }\n\n // Zoom acts on the view of the trial, so it is a viewport control. A trial\n // holding a non-2D view reports zoom as null and gets none of this.\n if ((instrument.canvas != null || instrument.stage != null) && zoom !== null) {\n out.push({\n id: 'zoom-out',\n region: 'viewport',\n group: 'zoom',\n item: {\n icon: ZoomOutIcon,\n label: 'Zoom out',\n onActivate: () => ctx.setZoom(zoom / ZOOM_STEP),\n },\n });\n out.push({\n id: 'zoom-in',\n region: 'viewport',\n group: 'zoom',\n item: {\n icon: ZoomInIcon,\n label: 'Zoom in',\n onActivate: () => ctx.setZoom(zoom * ZOOM_STEP),\n },\n });\n out.push({\n id: 'actual-size',\n region: 'viewport',\n group: 'zoom',\n item: { icon: FitIcon, label: 'Actual size', onActivate: () => ctx.setZoom(1) },\n });\n out.push({\n id: 'zoom-control',\n region: 'viewport',\n group: 'zoom',\n render: (c) => <ZoomControl zoom={c.zoom ?? 1} onZoomChange={c.setZoom} />,\n });\n out.push({\n id: 'scale',\n region: 'status',\n group: 'view',\n render: (c) => <ScaleIndicator zoom={c.zoom ?? 1} />,\n });\n if (instrument.canvas != null) {\n out.push({\n id: 'fps',\n region: 'status',\n group: 'view',\n end: true,\n render: () => <FpsMeter />,\n });\n }\n }\n\n if (instrument.annotations != null) {\n // A popover, so it takes the `render` escape: the panel picks a target,\n // and an icon button cannot ask which one.\n out.push({\n id: 'export',\n region: 'toolbar',\n group: 'trial',\n end: true,\n render: () => <ExportMenu />,\n });\n out.push({\n id: 'marks',\n region: 'sidebar',\n item: {\n title: 'Marks',\n body: <MarkList meaning={instrument.annotations.meaning} config={ctx.config} />,\n },\n });\n }\n\n if (Object.keys(ctx.configSchema.group.children).length > 0) {\n out.push({\n id: 'settings',\n region: 'sidebar',\n item: {\n title: 'Settings',\n body: (\n <ControlPanel\n schema={ctx.configSchema}\n config={ctx.config as Record<string, unknown>}\n auto={ctx.auto}\n setConfig={(key, value) => ctx.setConfig(String(key), value)}\n renderers={controls}\n collapsed={groupFolds(ctx.collapsedSections, 'settings')}\n onCollapse={(label, next) => ctx.setSectionCollapsed(`settings/${label}`, next)}\n />\n ),\n },\n });\n }\n\n if (ctx.savedSnapshots.length > 0) {\n // A menu is not an icon button, so it takes the render escape.\n out.push({\n id: 'snapshot-load',\n region: 'toolbar',\n group: 'trial',\n end: true,\n render: (c) => (\n <MenuButton\n aria-label=\"Load snapshot\"\n label=\"Load…\"\n items={c.savedSnapshots.map((sn) => ({ value: sn.id, label: sn.name }))}\n onAction={(id) => c.loadSnapshot(id)}\n />\n ),\n });\n }\n out.push({\n id: 'clone',\n region: 'titlebar',\n end: true,\n item: { icon: CloneIcon, label: 'Clone trial', onActivate: ctx.clone },\n });\n out.push({\n id: 'reset',\n region: 'titlebar',\n end: true,\n item: { icon: ResetIcon, label: 'Reset trial', onActivate: ctx.reset },\n });\n out.push({\n id: 'snapshot',\n region: 'titlebar',\n end: true,\n item: {\n icon: SnapshotIcon,\n label: 'Save snapshot',\n shortcut: 'Mod+S',\n onActivate: () => ctx.saveSnapshot(),\n },\n });\n out.push({\n id: 'close',\n region: 'titlebar',\n end: true,\n item: {\n icon: CloseIcon,\n label: ctx.isLastTrial ? 'Cannot close the last trial' : 'Close trial',\n danger: true,\n disabled: ctx.isLastTrial,\n onActivate: ctx.close,\n },\n });\n\n return out;\n}\n","import type { BuiltinToolId } from '@weasel-js/core';\nimport {\n ArrowIcon,\n EllipseIcon,\n HandIcon,\n LineIcon,\n PencilIcon,\n RectIcon,\n SelectIcon,\n TextIcon,\n} from '@weasel-js/ui';\nimport type { InstrumentList } from '../instrument/types';\nimport type { TrialTool } from '../tools/types';\nimport type { AnnotationKind } from './types';\n\n/** Which weasel tool an annotation tool drives, and what kind of mark that\n * makes. `select` makes none. */\nexport interface AnnotationToolInfo {\n weaselTool: BuiltinToolId;\n kind?: AnnotationKind;\n}\n\n// `arrow` and `stroke` have no weasel tool of their own, so the kind cannot be\n// read back from the insert — the overlay takes it from the tool id it holds.\nconst TOOLS: Record<string, AnnotationToolInfo> = {\n select: { weaselTool: 'select' },\n stroke: { weaselTool: 'pencil', kind: 'stroke' },\n line: { weaselTool: 'line', kind: 'line' },\n arrow: { weaselTool: 'line', kind: 'arrow' },\n rect: { weaselTool: 'rect', kind: 'rect' },\n ellipse: { weaselTool: 'ellipse', kind: 'ellipse' },\n text: { weaselTool: 'text', kind: 'text' },\n};\n\n/** The tools a lab's rail gets when any instrument declares `annotations`.\n * Ids share the lab's contribution namespace with its own `tools`, and the\n * lab's tool slot holds whichever is active. */\nexport const ANNOTATION_TOOLS: readonly TrialTool[] = [\n // Not in `TOOLS`: an id the map does not carry is what leaves the overlay idle.\n { id: 'pointer', label: 'Interact', icon: HandIcon, group: 'annotate' },\n { id: 'select', label: 'Select', icon: SelectIcon, group: 'annotate' },\n { id: 'stroke', label: 'Freehand', icon: PencilIcon, group: 'annotate' },\n { id: 'line', label: 'Line', icon: LineIcon, group: 'annotate' },\n { id: 'arrow', label: 'Arrow', icon: ArrowIcon, group: 'annotate' },\n { id: 'rect', label: 'Rectangle', icon: RectIcon, group: 'annotate' },\n { id: 'ellipse', label: 'Ellipse', icon: EllipseIcon, group: 'annotate' },\n { id: 'text', label: 'Text', icon: TextIcon, group: 'annotate' },\n];\n\n/** The annotation tools a lab's rail carries for these instruments: none\n * without an annotating instrument, else the union of what each asks for. */\nexport function labAnnotationTools(instruments: InstrumentList): readonly TrialTool[] {\n const wanted = new Set<string>();\n for (const i of instruments) {\n if (i.annotations == null) continue;\n if (i.annotations.tools == null) return ANNOTATION_TOOLS;\n for (const id of i.annotations.tools) wanted.add(id);\n }\n return ANNOTATION_TOOLS.filter((t) => wanted.has(t.id));\n}\n\n/** What `id` drives, or undefined for a tool that is not one of these. */\nexport function annotationToolInfo(id: string | null): AnnotationToolInfo | undefined {\n return id === null ? undefined : TOOLS[id];\n}\n\n/** Every weasel tool the overlay has to mount for this palette to work. */\nexport const ANNOTATION_WEASEL_TOOLS: readonly BuiltinToolId[] = [\n ...new Set(Object.values(TOOLS).map((t) => t.weaselTool)),\n];\n","import { labAnnotationTools } from '../annotations/toolMap';\nimport type { InstrumentList } from '../instrument/types';\n\n/**\n * The tool the lab's slot holds, once its default is applied: a lab with any\n * annotating instrument starts in `pointer`, so a first click reaches the\n * instrument rather than the marks over it, or in the first annotation tool\n * its rail carries when `pointer` is not among them.\n */\nexport function resolveLabTool(slot: string | null, instruments: InstrumentList): string | null {\n if (slot !== null) return slot;\n const tools = labAnnotationTools(instruments);\n if (tools.some((t) => t.id === 'pointer')) return 'pointer';\n return tools[0]?.id ?? null;\n}\n","/**\n * Concatenate contribution bundles into one list, preserving order — order\n * decides how a region lays its contributions out, so it is part of the\n * result, not an accident of it.\n *\n * Throws on a duplicate id rather than dropping one: a contribution silently\n * losing to a later bundle is the failure a registry exists to prevent.\n */\nexport function mergeContributions<T extends { id: string }>(\n ...bundles: readonly (readonly T[])[]\n): T[] {\n const out: T[] = [];\n const seen = new Set<string>();\n for (const bundle of bundles) {\n for (const entry of bundle) {\n if (seen.has(entry.id)) {\n throw new Error(\n `[labkit] mergeContributions: duplicate contribution id \"${entry.id}\". ` +\n 'Two bundles registered the same id; rename one, or suppress the ' +\n 'built-in before adding yours.',\n );\n }\n seen.add(entry.id);\n out.push(entry);\n }\n }\n return out;\n}\n\n/**\n * Drop contributions by id. Throws when an id is not present: a typo that\n * silently suppresses nothing is the same class of bug as a duplicate id\n * silently winning.\n */\nexport function suppressContributions<T extends { id: string }>(\n bundle: readonly T[],\n ids: readonly string[],\n): T[] {\n const present = new Set(bundle.map((c) => c.id));\n for (const id of ids) {\n if (!present.has(id)) {\n throw new Error(\n `[labkit] cannot suppress \"${id}\": no contribution with that id. ` +\n `Present ids: ${[...present].join(', ')}`,\n );\n }\n }\n const drop = new Set(ids);\n return bundle.filter((c) => !drop.has(c.id));\n}\n","import { type StanceProps, useStance } from '@weasel-js/ui';\nimport type { ReactNode } from 'react';\nimport type {\n RegionContribution,\n SidebarSection,\n SidebarSlotContext,\n TrialChromeContext,\n} from '../types';\n\n/** Props for `<SidebarRegion>`. */\nexport interface SidebarRegionProps<TCtx extends SidebarSlotContext = TrialChromeContext> {\n contributions: readonly RegionContribution<NoInfer<TCtx>>[];\n ctx: TCtx;\n /** Which region's items to lay out. */\n region?: string;\n}\n\nfunction Section({\n title,\n collapsed,\n onCollapsedChange,\n onUndock,\n children,\n stance,\n tone,\n}: StanceProps & {\n title: string;\n collapsed: boolean;\n onCollapsedChange: (collapsed: boolean) => void;\n onUndock?: () => void;\n children: ReactNode;\n}) {\n return (\n <section className=\"lk-sidebar-section\" {...useStance({ stance, tone })}>\n <div className=\"lk-sidebar-section__bar\">\n <button\n type=\"button\"\n className=\"lk-sidebar-section__head\"\n aria-expanded={!collapsed}\n onClick={() => onCollapsedChange(!collapsed)}\n >\n {title}\n </button>\n {onUndock ? (\n <button\n type=\"button\"\n className=\"lk-sidebar-section__undock\"\n aria-label={`Undock ${title}`}\n title={`Undock ${title}`}\n onClick={onUndock}\n >\n ⧉\n </button>\n ) : null}\n </div>\n {collapsed ? null : <div className=\"lk-sidebar-section__body\">{children}</div>}\n </section>\n );\n}\n\n/** Lays `sidebar` contributions out as titled, collapsible sections — a\n * trial's, or the lab's. A section the trial has torn out is not rendered\n * here — `Trial` portals its body into the workspace instead. A context with\n * no `undockPanel` offers no tear-out. */\nexport function SidebarRegion<TCtx extends SidebarSlotContext = TrialChromeContext>({\n contributions,\n ctx,\n region = 'sidebar',\n}: SidebarRegionProps<TCtx>) {\n if (contributions.length === 0) return null;\n return (\n <>\n {contributions.map((c) => {\n if (c.render) return <div key={c.id}>{c.render(ctx)}</div>;\n if (c.region !== region || !c.item) return null;\n if (ctx.undockedPanels?.includes(c.id)) return null;\n const item = c.item as SidebarSection;\n return (\n <Section\n key={c.id}\n title={item.title}\n stance={item.stance}\n tone={item.tone}\n collapsed={ctx.collapsedSections[c.id] ?? item.defaultCollapsed ?? false}\n onCollapsedChange={(next) => ctx.setSectionCollapsed(c.id, next)}\n onUndock={\n ctx.undockPanel && item.undockable !== false\n ? () => ctx.undockPanel?.(c.id, item.undockAs ?? 'tile')\n : undefined\n }\n >\n {item.body}\n </Section>\n );\n })}\n </>\n );\n}\n","import { StatusBar } from '../../primitives/StatusBar';\nimport type { RegionContribution, StatusReadout, TrialChromeContext } from '../types';\n\n/** Props for `<StatusRegion>`. */\nexport interface StatusRegionProps<TCtx = TrialChromeContext> {\n contributions: readonly RegionContribution<NoInfer<TCtx>>[];\n ctx: TCtx;\n /** Which region's readouts to lay out; the lab's footer is `footer`. */\n region?: string;\n}\n\n/** Lays a bar's readouts out. */\nexport function StatusRegion<TCtx = TrialChromeContext>({\n contributions,\n ctx,\n region = 'status',\n}: StatusRegionProps<TCtx>) {\n if (contributions.length === 0) return null;\n return (\n <StatusBar>\n {contributions.map((c) => {\n if (c.render)\n return (\n <StatusBar.Section key={c.id} end={c.end}>\n {c.render(ctx)}\n </StatusBar.Section>\n );\n if (c.region !== region || !c.item) return null;\n const item = c.item as StatusReadout;\n return (\n <StatusBar.Section key={c.id} end={c.end}>\n <span title={item.title}>{item.text}</span>\n </StatusBar.Section>\n );\n })}\n </StatusBar>\n );\n}\n","import type { ReactNode } from 'react';\nimport { Toolbar } from '../../primitives/Toolbar';\nimport type { RegionContribution, ToolbarItem, TrialChromeContext } from '../types';\n\n/** Props for `<ToolbarRegion>`. */\nexport interface ToolbarRegionProps<TCtx = TrialChromeContext> {\n contributions: readonly RegionContribution<NoInfer<TCtx>>[];\n ctx: TCtx;\n /** Which region's items to lay out; the lab's action bar is `header`. */\n region?: string;\n /** The bar's accessible name. */\n label?: string;\n}\n\ninterface Group<TCtx> {\n key: string;\n end: boolean;\n entries: RegionContribution<TCtx>[];\n}\n\n/** Bucket by group, preserving first-appearance order. Ungrouped\n * contributions each become their own bucket so they stay in place. */\nfunction groupsOf<TCtx>(contributions: readonly RegionContribution<TCtx>[]): Group<TCtx>[] {\n const groups: Group<TCtx>[] = [];\n const byKey = new Map<string, Group<TCtx>>();\n for (const c of contributions) {\n if (c.group == null) {\n groups.push({ key: c.id, end: c.end ?? false, entries: [c] });\n continue;\n }\n let g = byKey.get(c.group);\n if (!g) {\n g = { key: c.group, end: c.end ?? false, entries: [] };\n byKey.set(c.group, g);\n groups.push(g);\n }\n g.entries.push(c);\n }\n return groups;\n}\n\nfunction renderEntry<TCtx>(c: RegionContribution<TCtx>, ctx: TCtx, region: string): ReactNode {\n if (c.render) return <span key={c.id}>{c.render(ctx)}</span>;\n if (c.region !== region || !c.item) return null;\n const {\n icon: Icon,\n label,\n shortcut,\n disabled,\n danger,\n showLabel,\n pressed,\n onActivate,\n } = c.item as ToolbarItem<TCtx>;\n return (\n <Toolbar.Button\n key={c.id}\n iconOnly={!showLabel}\n variant={danger ? 'danger' : 'default'}\n disabled={disabled}\n pressed={pressed}\n aria-label={label}\n title={shortcut ? `${label} (${shortcut})` : label}\n onClick={() => onActivate(ctx)}\n >\n <Icon size={16} />\n {showLabel ? <span>{label}</span> : null}\n </Toolbar.Button>\n );\n}\n\n/** Lays a bar's contributions out, grouped by their `group`. */\nexport function ToolbarRegion<TCtx = TrialChromeContext>({\n contributions,\n ctx,\n region = 'toolbar',\n label = 'Trial actions',\n}: ToolbarRegionProps<TCtx>) {\n if (contributions.length === 0) return null;\n const groups = groupsOf(contributions);\n return (\n <Toolbar aria-label={label}>\n {groups.map((g) => (\n <Toolbar.Group key={g.key} end={g.end} aria-label={g.key}>\n {g.entries.map((c) => renderEntry(c, ctx, region))}\n </Toolbar.Group>\n ))}\n </Toolbar>\n );\n}\n","import { useContext, useMemo } from 'react';\nimport { useStore } from 'zustand/react';\nimport { useLabContext } from '../lab/LabContext';\nimport { LabStoreContext } from '../state/context';\nimport { usePersistedState } from '../state/usePersistedState';\nimport { resolveLabTool } from '../tools/labTool';\nimport type { TrialTool } from '../tools/types';\nimport type { LabChromeContext, LabContribution, LabRegion } from './labTypes';\nimport { mergeContributions } from './merge';\nimport { SidebarRegion } from './regions/SidebarRegion';\nimport { StatusRegion } from './regions/StatusRegion';\nimport { ToolbarRegion } from './regions/ToolbarRegion';\n\n/** The lab's chrome context: the lab itself, plus the lab's tool slot. Throws\n * outside a `<Lab>`. */\nexport function useLabChromeContext(): LabChromeContext {\n const lab = useLabContext();\n const storeCtx = useContext(LabStoreContext);\n if (!storeCtx) throw new Error('[labkit] lab chrome requires <LabStoreProvider>');\n const slot = useStore(storeCtx.store, (s) => s.activeToolId);\n const storeInstruments = useStore(storeCtx.store, (s) => s.instruments);\n const activeToolId = resolveLabTool(slot, storeInstruments ?? lab.instruments);\n const setLabTool = useStore(storeCtx.store, (s) => s.setLabTool);\n return useMemo(\n () => ({ ...lab, activeToolId, setActiveTool: setLabTool }),\n [lab, activeToolId, setLabTool],\n );\n}\n\n/** The lab's contributions for one region, in declaration order. */\nexport function contributionsIn<TCtx = LabChromeContext>(\n contributions: readonly LabContribution<TCtx>[],\n region: LabRegion,\n): LabContribution<TCtx>[] {\n return contributions.filter((c) => c.region === region);\n}\n\n/** The palette contributions a lab's `tools` stand for. Declaring a tool is\n * shorthand for contributing a palette item that writes the lab's tool\n * slot. */\nexport function toolContributions(tools: readonly TrialTool[]): LabContribution[] {\n return tools.map((t) => ({\n id: t.id,\n region: 'palette' as const,\n ...(t.group === undefined ? {} : { group: t.group }),\n item: {\n icon: t.icon,\n label: t.label,\n ...(t.shortcut === undefined ? {} : { shortcut: t.shortcut }),\n },\n }));\n}\n\n/** Everything the lab's chrome renders, from both of the ways a lab declares\n * it. Tools and contributions share one id namespace, so a tool colliding\n * with a contribution throws here rather than one of them silently losing. */\nexport function labContributions(\n tools: readonly TrialTool[] | undefined,\n chrome: readonly LabContribution[] | undefined,\n): LabContribution[] {\n return mergeContributions<LabContribution>(toolContributions(tools ?? []), [...(chrome ?? [])]);\n}\n\n/** Props shared by the lab's region mounts. Each takes the lab's whole\n * contribution list and lays out the part addressed to it. */\nexport interface LabRegionProps {\n contributions: readonly LabContribution[];\n}\n\n/** The lab's action bar, in the shell header beside the title. */\nexport function LabHeaderRegion({ contributions }: LabRegionProps) {\n const ctx = useLabChromeContext();\n return (\n <ToolbarRegion\n region=\"header\"\n label=\"Lab actions\"\n contributions={contributionsIn(contributions, 'header')}\n ctx={ctx}\n />\n );\n}\n\nfunction LabSections({ contributions, region }: LabRegionProps & { region: 'sidebar' | 'aside' }) {\n const lab = useLabChromeContext();\n const [collapsedSections, setFolds] = usePersistedState<Record<string, boolean>>(\n `lk-lab-${region}-folds`,\n {},\n { scope: 'lab' },\n );\n const ctx = useMemo(\n () => ({\n ...lab,\n collapsedSections,\n setSectionCollapsed: (key: string, collapsed: boolean) =>\n setFolds((f) => ({ ...f, [key]: collapsed })),\n }),\n [lab, collapsedSections, setFolds],\n );\n return (\n <SidebarRegion\n contributions={contributionsIn(contributions, region)}\n ctx={ctx}\n region={region}\n />\n );\n}\n\n/** The lab's sidebar sections. Fold state is a lab-scoped persisted value, so it\n * survives a reload in a stored lab and lasts the session in an unstored one. */\nexport function LabSidebarRegion({ contributions }: LabRegionProps) {\n return <LabSections contributions={contributions} region=\"sidebar\" />;\n}\n\n/** The lab's aside sections, on the far side of the workspace from the sidebar.\n * Fold state persists the way the sidebar's does. */\nexport function LabAsideRegion({ contributions }: LabRegionProps) {\n return <LabSections contributions={contributions} region=\"aside\" />;\n}\n\n/** The lab's readouts, in the shell footer below the workspace. */\nexport function LabFooterRegion({ contributions }: LabRegionProps) {\n const ctx = useLabChromeContext();\n return (\n <StatusRegion\n region=\"footer\"\n contributions={contributionsIn(contributions, 'footer')}\n ctx={ctx}\n />\n );\n}\n","import { ToolButton, ToolGroup } from '../../passthrough/weasel-ui';\nimport { useRovingTabIndex } from '../../primitives/useRovingTabIndex';\nimport type { RegionContribution, ToolItem, ToolSlotContext, TrialChromeContext } from '../types';\n\n/** Props for `<PaletteRegion>`. */\nexport interface PaletteRegionProps<TCtx extends ToolSlotContext = TrialChromeContext> {\n contributions: readonly RegionContribution<NoInfer<TCtx>>[];\n ctx: TCtx;\n /** Which region's items to lay out. The lab's rail names the same box\n * `palette` too, so this only moves for a chrome that does not. */\n region?: string;\n}\n\n/** A tool strip: a trial's, or the lab's. Selection lives in whichever tool\n * slot the context carries; this region only reflects it. An item carrying\n * `onActivate` is a command instead — it presses, and never latches. */\nexport function PaletteRegion<TCtx extends ToolSlotContext = TrialChromeContext>({\n contributions,\n ctx,\n region = 'palette',\n}: PaletteRegionProps<TCtx>) {\n const { ref, onKeyDown } = useRovingTabIndex<HTMLDivElement>('vertical');\n if (contributions.length === 0) return null;\n return (\n <div\n ref={ref}\n className=\"lk-palette-region\"\n role=\"toolbar\"\n aria-label=\"Tools\"\n aria-orientation=\"vertical\"\n onKeyDown={onKeyDown}\n >\n <ToolGroup orientation=\"vertical\">\n {contributions.map((c) => {\n if (c.render) return <span key={c.id}>{c.render(ctx)}</span>;\n if (c.region !== region || !c.item) return null;\n const { icon: Icon, label, shortcut, disabled, onActivate } = c.item as ToolItem<TCtx>;\n return (\n <ToolButton\n key={c.id}\n icon={<Icon size={16} />}\n label={label}\n shortcut={shortcut}\n active={onActivate ? false : ctx.activeToolId === c.id}\n disabled={disabled}\n onClick={onActivate ? () => onActivate(ctx) : () => ctx.setActiveTool(c.id)}\n />\n );\n })}\n </ToolGroup>\n </div>\n );\n}\n","import type { ReactNode } from 'react';\nimport type { TrialChromeContext, TrialContribution } from '../types';\n\n/** Which end of the title bar a `<TitleBarRegion>` lays out: `'lead'` renders\n * the contributions that leave `end` unset, before the title; `'actions'`\n * renders the ones that set it, after everything else. */\nexport type TitleBarPlacement = 'lead' | 'actions';\n\n/** Props for `<TitleBarRegion>`. */\nexport interface TitleBarRegionProps {\n contributions: readonly TrialContribution[];\n ctx: TrialChromeContext;\n /** Defaults to `'actions'`, where the built-ins live. */\n placement?: TitleBarPlacement;\n}\n\nfunction renderEntry(c: TrialContribution, ctx: TrialChromeContext): ReactNode {\n if (c.render) return <span key={c.id}>{c.render(ctx)}</span>;\n if (c.region !== 'titlebar' || !c.item) return null;\n const { icon: Icon, label, shortcut, disabled, danger, onActivate } = c.item;\n return (\n <button\n key={c.id}\n type=\"button\"\n className={`lk-titlebar-button${danger ? ' lk-titlebar-button--danger' : ''}`}\n disabled={disabled}\n aria-label={label}\n title={shortcut ? `${label} (${shortcut})` : label}\n onClick={() => onActivate(ctx)}\n // The bar behind these buttons is the window drag surface, so a press\n // that lands here must not also start a drag.\n onPointerDown={(e) => e.stopPropagation()}\n onMouseDown={(e) => e.stopPropagation()}\n >\n <Icon size={16} />\n </button>\n );\n}\n\n/** Lays a trial's `titlebar` contributions out at one end of the bar. */\nexport function TitleBarRegion({ contributions, ctx, placement = 'actions' }: TitleBarRegionProps) {\n const wanted = placement === 'actions';\n const mine = contributions.filter((c) => (c.end ?? false) === wanted);\n if (mine.length === 0) return null;\n return (\n <span className={wanted ? 'lk-trial__titlebar-actions' : 'lk-trial__titlebar-lead'}>\n {mine.map((c) => renderEntry(c, ctx))}\n </span>\n );\n}\n","import { useRovingTabIndex } from '../../primitives/useRovingTabIndex';\nimport type { TrialChromeContext, TrialContribution } from '../types';\n\n/** Props for `<ViewportRegion>`. */\nexport interface ViewportRegionProps {\n contributions: readonly TrialContribution[];\n ctx: TrialChromeContext;\n}\n\n/**\n * Controls acting on the view of a trial. Anchored inside the content well\n * rather than in the toolbar, which acts on the trial itself.\n */\nexport function ViewportRegion({ contributions, ctx }: ViewportRegionProps) {\n const { ref, onKeyDown } = useRovingTabIndex<HTMLDivElement>();\n if (contributions.length === 0) return null;\n return (\n <div\n ref={ref}\n className=\"lk-viewport-controls\"\n role=\"toolbar\"\n aria-label=\"View\"\n onKeyDown={onKeyDown}\n >\n {contributions.map((c) => {\n if (c.render) return <span key={c.id}>{c.render(ctx)}</span>;\n if (c.region !== 'viewport' || !c.item) return null;\n const { icon: Icon, label, disabled, onActivate } = c.item;\n return (\n <button\n key={c.id}\n type=\"button\"\n className=\"lk-viewport-controls__button\"\n aria-label={label}\n title={label}\n disabled={disabled}\n onClick={() => onActivate(ctx)}\n >\n <Icon size={16} />\n </button>\n );\n })}\n </div>\n );\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/primitives/JobProgress.tsx","../src/primitives/Legend.tsx","../src/primitives/Split.tsx"],"names":["jsx","jsxs","store"],"mappings":";;;;;;AAYO,SAAS,WAAA,CAAY,EAAE,GAAA,EAAK,SAAA,EAAU,EAAqB;AAChE,EAAA,MAAM,EAAE,MAAA,EAAQ,IAAA,EAAM,KAAA,EAAO,QAAA,EAAU,OAAM,GAAI,GAAA;AACjD,EAAA,IAAI,MAAA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M,eAAe,UAAA,EAAY,EAAE,IAAA,EAAM,IAAI,CAAA;AAAA,MAC/C;AACA,MAAA,MAAM,IAAA,GAAQ,KAAA,CAAM,YAAA,CAAa,UAAU,GAAG,IAAA,EAAqC,CAAA;AACnF,MAAA,IAAI,OAAO,IAAA,KAAS,QAAA,IAAY,IAAA,KAAS,SAAS,OAAA,EAAS;AAC3D,MAAA,QAAA,CAAS,OAAA,GAAU,IAAA;AACnB,MAAA,gBAAA,CAAiB,UAAU,IAAI,CAAA;AAAA,IACjC,CAAC,CAAA;AAAA,IACH,CAAC,KAAK;AAAA,GACR;AAEA,EAAA,MAAM,MAAA,GAAS,OAAA;AAAA,IACb,OAAO;AAAA,MACL,SAAS,sBAAMF,IAAC,KAAA,EAAA,EAAI,SAAA,EAAW,kBAAmB,QAAA,EAAA,OAAA,EAAQ,CAAA;AAAA,MAC1D,SAAS,sBAAMA,IAAC,KAAA,EAAA,EAAI,SAAA,EAAW,kBAAmB,QAAA,EAAS;AAAA,KAC7D,CAAA;AAAA,IACA,CAAC,OAAA,EAAS,QAAA,EAAU,gBAAA,EAAkB,gBAAgB;AAAA,GACxD;AAEA,EAAA,uBACEA,IAAC,QAAA,EAAA,EAAS,KAAA,EACR,0BAAAA,GAAAA,CAAC,wBAAA,EAAA,EAAyB,UAAA,EAAY,UAAA,EACpC,QAAA,kBAAAA,GAAAA;AAAA,IAAC,SAAA;AAAA,IAAA;AAAA,MACC,QAAA,EAAU,OAAA;AAAA,MACV,MAAA;AAAA,MACA,SAAA,EAAW,SAAA,GAAY,CAAA,uBAAA,EAA0B,SAAS,CAAA,CAAA,GAAK,wBAAA;AAAA,MAC/D,WAAA,EAAW,IAAA;AAAA,MACX;AAAA;AAAA,KAEJ,CAAA,EACF,CAAA;AAEJ","file":"chunk-6FLXL3I7.js","sourcesContent":["import { ErrorIcon, WarningIcon } from '@weasel-js/ui';\nimport type { JobHandle } from '../job/types';\n\n/** Props for `<JobProgress>`. */\nexport interface JobProgressProps {\n job: JobHandle;\n className?: string;\n}\n\n/** A running job's progress, failures and outcome. Determinate once the job\n * reports a total; a job that cannot count up front never sends one, so the\n * bar stays indeterminate rather than inventing a denominator. */\nexport function JobProgress({ job, className }: JobProgressProps) {\n const { status, done, total, failures, error } = job;\n if (status === 'idle') return null;\n\n const determinate = total !== null && total > 0;\n const fraction = determinate ? Math.min(1, done / total) : 0;\n const cls = ['lk-job', `lk-job--${status}`, className].filter(Boolean).join(' ');\n\n return (\n <div className={cls}>\n <div\n className={`lk-job__track${determinate ? '' : ' lk-job__track--indeterminate'}`}\n role=\"progressbar\"\n aria-label=\"Job progress\"\n aria-valuenow={determinate ? done : undefined}\n aria-valuemin={determinate ? 0 : undefined}\n aria-valuemax={determinate ? total : undefined}\n >\n {/* Scaling a full-width bar keeps the fill off the layout path, so\n progress updates never reflow the status bar. */}\n <div\n className=\"lk-job__fill\"\n style={{ transform: `scaleX(${determinate ? fraction : 1})` }}\n />\n </div>\n\n <span className=\"lk-job__count\">\n {done}\n {determinate ? ` / ${total}` : ''}\n </span>\n\n {failures.length > 0 && (\n <span className=\"lk-job__failures\" title={failures.map((f) => f.error).join('\\n')}>\n <WarningIcon size={14} />\n {failures.length} failed\n </span>\n )}\n\n {error && (\n <span className=\"lk-job__error\" title={error}>\n <ErrorIcon size={14} />\n {error}\n </span>\n )}\n\n {status === 'running' && (\n <button type=\"button\" className=\"lk-job__cancel\" onClick={job.cancel}>\n Cancel\n </button>\n )}\n </div>\n );\n}\n","import type { CSSProperties } from 'react';\n\n/** How a legend entry's swatch is drawn, matching how the thing looks on canvas. */\nexport type LegendMark = 'line' | 'dash' | 'dot' | 'band';\n\n/** One row of a legend: a swatch and what it means. */\nexport interface LegendEntry {\n key: string;\n label: string;\n color: string;\n /** Defaults to `'line'`. */\n mark?: LegendMark;\n}\n\n/** Props for `<Legend>`. */\nexport interface LegendProps {\n entries: readonly LegendEntry[];\n className?: string;\n}\n\n/** A color key. Presentational only — no handlers, no state, no hover behavior. */\nexport function Legend({ entries, className }: LegendProps) {\n return (\n <ul className={className ? `lk-legend ${className}` : 'lk-legend'}>\n {entries.map((entry) => {\n const mark = entry.mark ?? 'line';\n return (\n <li className=\"lk-legend__row\" key={entry.key}>\n <span\n aria-hidden=\"true\"\n className={`lk-legend__swatch lk-legend__swatch--${mark}`}\n style={{ '--lk-legend-ink': entry.color } as CSSProperties}\n />\n <span className=\"lk-legend__label\">{entry.label}</span>\n </li>\n );\n })}\n </ul>\n );\n}\n","import { type ReactNode, useEffect, useMemo, useRef } from 'react';\nimport { asNodeId, createNode, Store, stripStrategy } from 'windease';\nimport { type ChromeMap, Container, Provider, StrategyRegistryProvider } from 'windease/react';\n\nconst ZONE_ID = asNodeId('lk-split');\nconst SIDEBAR_ID = asNodeId('lk-split-sidebar');\nconst CONTENT_ID = asNodeId('lk-split-content');\nconst STRATEGIES = { strip: stripStrategy as never };\n\n/** Props for `<Split>`. */\nexport interface SplitProps {\n /** The sidebar pane's contents. */\n sidebar: ReactNode;\n /** The edge the sidebar sits on. Read once, when the strip mounts. Default `'start'`. */\n side?: 'start' | 'end';\n /** The content pane's contents. */\n children: ReactNode;\n /** Names the sidebar pane, and through it the seam. Default `'Sidebar'`. */\n label?: string;\n /** Extra classes on the strip, which always has `lk-split`. */\n className?: string;\n /** The class on the sidebar pane. */\n sidebarClassName?: string;\n /** The class on the content pane. */\n contentClassName?: string;\n /** The sidebar's current extent in pixels. Omit to leave it unpersisted: the\n * seam still works, its result just does not outlive the mount. */\n width?: number;\n /** Where the sidebar starts before anyone drags it. */\n defaultWidth?: number;\n minWidth?: number;\n maxWidth?: number;\n /** How little the content pane may be squeezed to. Reported as the seam's\n * reachable maximum, so the drag stops there rather than clamping silently. */\n contentMinWidth?: number;\n /** Fires through the drag, not on release: the pane is already there. */\n onWidthChange?: (width: number) => void;\n /**\n * Fixed extent. Omit in an app — the strip measures its own box. Supply it\n * where nothing measures, notably jsdom, or both panes lay out at zero.\n */\n viewport?: { w: number; h: number };\n}\n\n/**\n * A sidebar and a content pane as a two-pane strip with a draggable seam.\n *\n * The seam is `stripStrategy`'s own resize affordance, so it arrives as a\n * `role=\"separator\"` carrying the reachable range, operable by pointer and by\n * arrows / Home / End, and clamped against the content pane's floor rather\n * than against the sidebar's alone.\n */\nexport function Split({\n sidebar,\n children,\n side = 'start',\n label = 'Sidebar',\n className,\n sidebarClassName,\n contentClassName,\n width,\n defaultWidth = 320,\n minWidth = 140,\n maxWidth = 720,\n contentMinWidth = 160,\n onWidthChange,\n viewport,\n}: SplitProps) {\n // The cross-axis half of every size hint below is inert: a horizontal strip\n // stretches its panes to the container's height and never reads `h`.\n const storeRef = useRef<Store | null>(null);\n if (storeRef.current === null) {\n const store = new Store();\n store.registerNode(\n createNode({\n kind: 'zone',\n id: ZONE_ID,\n // A strip's seam resizes the pane before it, which on the end side is the\n // content; 'neighbor' has the seam size the sidebar after it too.\n container: {\n strategyId: 'strip',\n config: {\n axis: 'x',\n resizable: true,\n ...(side === 'end' ? { resizeMode: 'neighbor' } : {}),\n },\n },\n }),\n );\n const sidebarNode = createNode({\n kind: 'sidebar',\n id: SIDEBAR_ID,\n parentId: ZONE_ID,\n meta: { title: label },\n placement: { size: { w: width ?? defaultWidth } },\n hints: { minSize: { w: minWidth, h: 0 }, maxSize: { w: maxWidth, h: 0 } },\n });\n const contentNode = createNode({\n kind: 'content',\n id: CONTENT_ID,\n parentId: ZONE_ID,\n meta: { title: 'Content' },\n hints: { minSize: { w: contentMinWidth, h: 0 } },\n });\n // A strip lays its children out in registration order.\n for (const node of side === 'end' ? [contentNode, sidebarNode] : [sidebarNode, contentNode]) {\n store.registerNode(node);\n }\n store.showNode(SIDEBAR_ID);\n store.showNode(CONTENT_ID);\n storeRef.current = store;\n }\n const store = storeRef.current;\n\n // What the store last held, so the placement event can tell a drag from the\n // echo of our own write and a controlled `width` does not fight the seam.\n const widthRef = useRef(width ?? defaultWidth);\n\n useEffect(() => {\n store.setHints(SIDEBAR_ID, {\n minSize: { w: minWidth, h: 0 },\n maxSize: { w: maxWidth, h: 0 },\n });\n store.setHints(CONTENT_ID, { minSize: { w: contentMinWidth, h: 0 } });\n }, [store, minWidth, maxWidth, contentMinWidth]);\n\n useEffect(() => {\n store.setMeta(SIDEBAR_ID, { title: label });\n }, [store, label]);\n\n useEffect(() => {\n if (width === undefined || width === widthRef.current) return;\n widthRef.current = width;\n store.patchPlacement(SIDEBAR_ID, { size: { w: width } });\n }, [store, width]);\n\n const onWidthChangeRef = useRef(onWidthChange);\n onWidthChangeRef.current = onWidthChange;\n useEffect(\n () =>\n store.events.on('node.placementChanged', () => {\n // A neighbor drag pins the content's width too; unpinned, it goes on filling the strip.\n if ((store.getPlacement(CONTENT_ID)?.size as { w?: number } | undefined)?.w !== undefined) {\n store.patchPlacement(CONTENT_ID, { size: {} });\n }\n const next = (store.getPlacement(SIDEBAR_ID)?.size as { w?: number } | undefined)?.w;\n if (typeof next !== 'number' || next === widthRef.current) return;\n widthRef.current = next;\n onWidthChangeRef.current?.(next);\n }),\n [store],\n );\n\n const chrome = useMemo<ChromeMap>(\n () => ({\n sidebar: () => <div className={sidebarClassName}>{sidebar}</div>,\n content: () => <div className={contentClassName}>{children}</div>,\n }),\n [sidebar, children, sidebarClassName, contentClassName],\n );\n\n return (\n <Provider store={store}>\n <StrategyRegistryProvider strategies={STRATEGIES}>\n <Container\n parentId={ZONE_ID}\n chrome={chrome}\n className={className ? `lk-split windease-zone ${className}` : 'lk-split windease-zone'}\n affordances\n viewport={viewport}\n />\n </StrategyRegistryProvider>\n </Provider>\n );\n}\n"]}
|