@weasel-js/labkit 1.6.0 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. package/dist/_dts/{CanvasStackContext-DQgcH1ny.d.ts → CanvasStackContext-Wo6OwIVM.d.ts} +1 -1
  2. package/dist/_dts/FloatingPanel-7j0IcXwz.d.ts +30 -0
  3. package/dist/_dts/{LayerList.d-2c9yup5Y.d.ts → LayerList.d-BoELAMsM.d.ts} +2 -2
  4. package/dist/_dts/{index-DINmCuLA.d.ts → PropertyField.d-D0ndfIIt.d.ts} +34 -83
  5. package/dist/_dts/{Select.d-BchGMC2Y.d.ts → Select.d-Cr8-zoup.d.ts} +4 -5
  6. package/dist/_dts/{usePanZoom-Bq73pwFe.d.ts → Stage-DWBBi8IU.d.ts} +80 -35
  7. package/dist/_dts/{index-B0--8PEM.d.ts → index-CKyX0ME_.d.ts} +12 -13
  8. package/dist/_dts/{frac-DTRq7Xpb.d.ts → types-B7yBTTF9.d.ts} +699 -649
  9. package/dist/_dts/{types-B7y8hX1D.d.ts → types-DTuViBvc.d.ts} +20 -1
  10. package/dist/_dts/{useTrialState-CP4jfuKl.d.ts → useTrialState-CMaV6UD4.d.ts} +2 -3
  11. package/dist/canvas/index.d.ts +39 -7
  12. package/dist/canvas/index.js +5 -3
  13. package/dist/chrome/index.d.ts +4 -5
  14. package/dist/chrome/index.js +8 -6
  15. package/dist/chunk-24W5VEJW.js +18 -0
  16. package/dist/chunk-24W5VEJW.js.map +1 -0
  17. package/dist/chunk-3RY6WL5T.js +38 -0
  18. package/dist/chunk-3RY6WL5T.js.map +1 -0
  19. package/dist/{chunk-H5VIV7MQ.js → chunk-4TT3PNPR.js} +60 -51
  20. package/dist/chunk-4TT3PNPR.js.map +1 -0
  21. package/dist/{chunk-ZORVNOKX.js → chunk-6FLXL3I7.js} +9 -145
  22. package/dist/chunk-6FLXL3I7.js.map +1 -0
  23. package/dist/{chunk-HFRE4QQV.js → chunk-ASOK76ZH.js} +53 -22
  24. package/dist/chunk-ASOK76ZH.js.map +1 -0
  25. package/dist/chunk-AWQG7FCC.js +19 -0
  26. package/dist/chunk-AWQG7FCC.js.map +1 -0
  27. package/dist/chunk-CGHF6RZV.js +300 -0
  28. package/dist/chunk-CGHF6RZV.js.map +1 -0
  29. package/dist/chunk-DWMSB4CA.js +228 -0
  30. package/dist/chunk-DWMSB4CA.js.map +1 -0
  31. package/dist/{chunk-USO6TERP.js → chunk-GHGO52SO.js} +11 -9
  32. package/dist/chunk-GHGO52SO.js.map +1 -0
  33. package/dist/{chunk-MOLIUNVH.js → chunk-HKV7LRHY.js} +4 -4
  34. package/dist/{chunk-MOLIUNVH.js.map → chunk-HKV7LRHY.js.map} +1 -1
  35. package/dist/{chunk-VQ47KWD5.js → chunk-IRTGUQ5O.js} +5 -4
  36. package/dist/chunk-IRTGUQ5O.js.map +1 -0
  37. package/dist/{chunk-H6ZAOWNE.js → chunk-JVBYV6TL.js} +3 -3
  38. package/dist/{chunk-H6ZAOWNE.js.map → chunk-JVBYV6TL.js.map} +1 -1
  39. package/dist/chunk-KHK5FGER.js +145 -0
  40. package/dist/chunk-KHK5FGER.js.map +1 -0
  41. package/dist/chunk-NEXR37YJ.js +144 -0
  42. package/dist/chunk-NEXR37YJ.js.map +1 -0
  43. package/dist/{chunk-BVL7Y574.js → chunk-O6FFFOHS.js} +14 -6
  44. package/dist/chunk-O6FFFOHS.js.map +1 -0
  45. package/dist/chunk-QGMOA2YE.js +731 -0
  46. package/dist/chunk-QGMOA2YE.js.map +1 -0
  47. package/dist/{chunk-ERFMC6WU.js → chunk-S4NCI32V.js} +19 -10
  48. package/dist/chunk-S4NCI32V.js.map +1 -0
  49. package/dist/{chunk-3FI7Y4R4.js → chunk-SLAQPUI4.js} +4 -4
  50. package/dist/{chunk-3FI7Y4R4.js.map → chunk-SLAQPUI4.js.map} +1 -1
  51. package/dist/{chunk-AWH3SRPW.js → chunk-TJ77A4A3.js} +3 -31
  52. package/dist/chunk-TJ77A4A3.js.map +1 -0
  53. package/dist/{chunk-WUJXJC5O.js → chunk-TYN6MLXX.js} +691 -1395
  54. package/dist/chunk-TYN6MLXX.js.map +1 -0
  55. package/dist/{chunk-RS3HRQWU.js → chunk-WPLAANH4.js} +4 -3
  56. package/dist/chunk-WPLAANH4.js.map +1 -0
  57. package/dist/config/index.d.ts +36 -35
  58. package/dist/config/index.js +4 -5
  59. package/dist/controls/index.d.ts +91 -7
  60. package/dist/controls/index.js +5 -4
  61. package/dist/dragdrop/index.d.ts +8 -6
  62. package/dist/dragdrop/index.js +3 -2
  63. package/dist/index.d.ts +50 -77
  64. package/dist/index.js +138 -254
  65. package/dist/index.js.map +1 -1
  66. package/dist/layers/index.d.ts +3 -4
  67. package/dist/layers/index.js +2 -1
  68. package/dist/loupe/index.d.ts +19 -16
  69. package/dist/loupe/index.js +5 -3
  70. package/dist/overview/index.d.ts +56 -0
  71. package/dist/overview/index.js +288 -0
  72. package/dist/overview/index.js.map +1 -0
  73. package/dist/passthrough/weasel-ui.d.ts +38 -38
  74. package/dist/passthrough/weasel-ui.js +2 -1
  75. package/dist/primitives/index.d.ts +19 -43
  76. package/dist/primitives/index.js +5 -3
  77. package/dist/state/index.d.ts +7 -7
  78. package/dist/state/index.js +4 -5
  79. package/dist/state/index.js.map +1 -1
  80. package/dist/styles.css +63 -1
  81. package/dist/undo/index.d.ts +3 -3
  82. package/package.json +13 -9
  83. package/src/annotations/index.ts +1 -0
  84. package/src/annotations/store.test.ts +26 -0
  85. package/src/annotations/store.ts +25 -6
  86. package/src/annotations/toolMap.test.ts +37 -2
  87. package/src/annotations/toolMap.ts +13 -0
  88. package/src/annotations/types.ts +27 -0
  89. package/src/canvas/AGENTS.md +8 -10
  90. package/src/canvas/CameraInput.test.tsx +136 -0
  91. package/src/canvas/CameraInput.tsx +311 -0
  92. package/src/canvas/CanvasStack.tsx +42 -58
  93. package/src/canvas/LinkedCursor.less +16 -0
  94. package/src/canvas/LinkedCursor.tsx +54 -0
  95. package/src/canvas/Stage.tsx +42 -37
  96. package/src/canvas/cameraView.test.ts +60 -0
  97. package/src/canvas/cameraView.ts +61 -0
  98. package/src/canvas/index.ts +11 -2
  99. package/src/chrome/regions/SidebarRegion.test.tsx +9 -2
  100. package/src/config/builder.ts +3 -3
  101. package/src/config/entry.test.ts +3 -1
  102. package/src/config/fromConfigField.ts +1 -0
  103. package/src/config/index.ts +4 -1
  104. package/src/config/resolve.ts +11 -1
  105. package/src/config/sectionTree.test.ts +12 -6
  106. package/src/config/sectionTree.ts +15 -5
  107. package/src/config/types.ts +21 -0
  108. package/src/controls/ControlPanel.test.tsx +12 -2
  109. package/src/controls/ControlPanel.tsx +28 -9
  110. package/src/controls/inDialog.test.tsx +18 -0
  111. package/src/controls/inDialog.tsx +2 -10
  112. package/src/index.test.ts +1 -1
  113. package/src/index.ts +8 -4
  114. package/src/instrument/SineWave.smoke.test.tsx +2 -0
  115. package/src/instrument/types.ts +10 -1
  116. package/src/lab/Lab.nebula.test.tsx +11 -2
  117. package/src/lab/Lab.test.tsx +3 -1
  118. package/src/lab/Lab.tsx +4 -4
  119. package/src/loupe/AGENTS.md +7 -6
  120. package/src/loupe/LoupeGestures.tsx +14 -9
  121. package/src/loupe/TrialLoupe.tsx +5 -5
  122. package/src/loupe/index.ts +1 -0
  123. package/src/loupe/loupeActions.ts +6 -2
  124. package/src/overview/AGENTS.md +38 -0
  125. package/src/overview/OverviewMarks.test.tsx +100 -0
  126. package/src/overview/OverviewMarks.tsx +93 -0
  127. package/src/overview/TrialOverview.less +53 -0
  128. package/src/overview/TrialOverview.stories.tsx +50 -0
  129. package/src/overview/TrialOverview.test.tsx +116 -0
  130. package/src/overview/TrialOverview.tsx +374 -0
  131. package/src/overview/index.ts +2 -0
  132. package/src/passthrough/weasel-ui.ts +7 -0
  133. package/src/specimen/Specimen.tsx +19 -2
  134. package/src/state/labRecords.test.ts +4 -1
  135. package/src/state/store.test.ts +4 -4
  136. package/src/state/useTrialState.test.tsx +1 -1
  137. package/src/styles.less +2 -0
  138. package/src/theme/Interstellar.stories.tsx +1 -5
  139. package/src/tools/labTool.ts +6 -2
  140. package/src/trial/Trial.annotations.test.tsx +16 -0
  141. package/src/trial/Trial.loupe.test.tsx +73 -1
  142. package/src/trial/Trial.stories.tsx +2 -0
  143. package/src/trial/Trial.tsx +17 -1
  144. package/src/trial/trialOps.test.ts +4 -4
  145. package/dist/_dts/inDialog-D5ZKGjiD.d.ts +0 -23
  146. package/dist/_dts/number.d-OeQYQoUO.d.ts +0 -28
  147. package/dist/chunk-2AYGEN57.js +0 -32
  148. package/dist/chunk-2AYGEN57.js.map +0 -1
  149. package/dist/chunk-AWH3SRPW.js.map +0 -1
  150. package/dist/chunk-BVL7Y574.js.map +0 -1
  151. package/dist/chunk-ERFMC6WU.js.map +0 -1
  152. package/dist/chunk-H5VIV7MQ.js.map +0 -1
  153. package/dist/chunk-HFRE4QQV.js.map +0 -1
  154. package/dist/chunk-RS3HRQWU.js.map +0 -1
  155. package/dist/chunk-TT5C5S6R.js +0 -368
  156. package/dist/chunk-TT5C5S6R.js.map +0 -1
  157. package/dist/chunk-USO6TERP.js.map +0 -1
  158. package/dist/chunk-VQ47KWD5.js.map +0 -1
  159. package/dist/chunk-WUJXJC5O.js.map +0 -1
  160. package/dist/chunk-ZORVNOKX.js.map +0 -1
  161. package/src/canvas/usePanZoom.test.ts +0 -244
  162. package/src/canvas/usePanZoom.ts +0 -147
@@ -1,6 +1,6 @@
1
1
  import * as react from 'react';
2
2
  import { RefObject } from 'react';
3
- import { m as ViewTransform, W as WorldFrame } from './frac-DTRq7Xpb.js';
3
+ import { b as ViewTransform, W as WorldFrame } from './types-B7yBTTF9.js';
4
4
 
5
5
  /** One layer of a canvas stack: its id, whether it is currently shown, and how
6
6
  * it paints itself. */
@@ -0,0 +1,30 @@
1
+ import react__default, { ReactNode } from 'react';
2
+ import { Corner } from 'windease';
3
+
4
+ /** Props for `<FloatingPanel>`. */
5
+ interface FloatingPanelProps {
6
+ children: ReactNode;
7
+ /** Corner it rests in before it has ever been dragged. Default `'bottom-left'`. */
8
+ anchor?: Corner;
9
+ /** Corners that may capture it. Default: all four. */
10
+ snapCorners?: readonly Corner[];
11
+ /** Pixels in from a corner when snapped. Default 12. */
12
+ inset?: number;
13
+ /** Name to remember its position under, through `usePersistedState` — so it
14
+ * is remembered only inside a lab or a `<Persistence>`. Omit to forget on
15
+ * reload. */
16
+ persist?: string;
17
+ className?: string;
18
+ }
19
+ /**
20
+ * A draggable box that floats over its offset parent and snaps to its corners.
21
+ *
22
+ * Drives windease's `floatingStrategy` as a pure function rather than mounting a
23
+ * windease container: a lab overlay has one item and no zone tree, so the node
24
+ * model would be all cost. Pointer handling is therefore this component's, and
25
+ * windease's own affordance rendering never participates.
26
+ */
27
+ declare function FloatingPanel({ children, anchor, snapCorners, inset, persist, className, }: FloatingPanelProps): react__default.JSX.Element;
28
+
29
+ export { FloatingPanel as a };
30
+ export type { FloatingPanelProps as F };
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
1
+ import * as react from 'react';
2
2
  import { ReactNode } from 'react';
3
3
  import { S as StanceProps } from './PrefsRow.d-DFpPIeIC.js';
4
4
 
@@ -77,7 +77,7 @@ declare function moveLayers(items: LayerListItem[], move: LayerMove): LayerListI
77
77
  * card whose controls fold away; either can nest child layers. Selection,
78
78
  * visibility, removal and an add palette are each on when their handler is given.
79
79
  */
80
- declare function LayerList(props: LayerListProps): react_jsx_runtime.JSX.Element;
80
+ declare function LayerList(props: LayerListProps): react.JSX.Element;
81
81
 
82
82
  export { LayerList as L, moveLayers as m };
83
83
  export type { LayerListItem as a, LayerListProps as b, LayerMove as c };
@@ -1,11 +1,33 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
1
  import * as react from 'react';
3
2
  import { ReactNode } from 'react';
4
- import { S as StanceProps } from './PrefsRow.d-DFpPIeIC.js';
5
3
  import { ToolPrefNumberFormat, FillStyle, PaintKind } from '@weasel-js/core';
6
- import { U as UnitTable } from './number.d-OeQYQoUO.js';
7
- import { R as ResolvedConfig, b as ConfigField, C as ControlRenderer } from './types-B7y8hX1D.js';
8
- import './inDialog-D5ZKGjiD.js';
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>;
9
31
 
10
32
  /**
11
33
  * How much room a container gives its rows — gaps, padding, and field height,
@@ -56,7 +78,7 @@ interface PropertyPanelProps extends PropertyMetricProps, StanceProps {
56
78
  * is; the theme's `--wzl-panel-*` and `--wzl-stance-*` slots decide how each looks. A stanced
57
79
  * panel's title takes the row-label recipe rather than the display title.
58
80
  */
59
- declare function PropertyPanel({ title, actions, selectable, children, className, density, align, stance, tone, }: PropertyPanelProps): react_jsx_runtime.JSX.Element;
81
+ declare function PropertyPanel({ title, actions, selectable, children, className, density, align, stance, tone, }: PropertyPanelProps): react.JSX.Element;
60
82
  /** How a property list packs its rows into two columns. */
61
83
  type PropertyListPack = 'auto-color' | 'pairs' | 'one-up';
62
84
  /** Props for `<PropertyList>`. */
@@ -91,7 +113,7 @@ interface PropertySpanProps {
91
113
  * `<Subpanel>`. `<PropertyRow span>` covers the row case; this covers
92
114
  * everything else a consumer puts in the grid.
93
115
  */
94
- declare function PropertySpan({ children, className }: PropertySpanProps): react_jsx_runtime.JSX.Element;
116
+ declare function PropertySpan({ children, className }: PropertySpanProps): react.JSX.Element;
95
117
  /** Which control shape a row holds, which decides its intrinsic layout. */
96
118
  type PropertyRowVariant = 'default' | 'color' | 'checkbox';
97
119
  /** Whether a row's label sits above its control or beside it. */
@@ -146,7 +168,7 @@ interface PropertyRowProps extends PropertyMetricProps {
146
168
  }
147
169
  /** The label-plus-control frame `<PropertyField>` draws its rows in. Use it
148
170
  * directly for a control no field kind covers. */
149
- declare function PropertyRow({ label, readout, description, variant, layout, span, children, htmlFor, group, className, density, align, auto, onAutoChange, chrome, }: PropertyRowProps): react_jsx_runtime.JSX.Element;
171
+ declare function PropertyRow({ label, readout, description, variant, layout, span, children, htmlFor, group, className, density, align, auto, onAutoChange, chrome, }: PropertyRowProps): react.JSX.Element;
150
172
 
151
173
  /**
152
174
  * Which controls a field is drawn with.
@@ -367,7 +389,7 @@ type DistributiveOmit<U, K extends PropertyKey> = U extends unknown ? Omit<U, K>
367
389
  * `onChange` when given both. `mixed` and `unset` show a field whose sources
368
390
  * disagree, or agree on holding nothing.
369
391
  */
370
- declare function PropertyField<T extends string = string>(props: PropertyFieldProps<T>): react_jsx_runtime.JSX.Element;
392
+ declare function PropertyField<T extends string = string>(props: PropertyFieldProps<T>): react.JSX.Element;
371
393
  /**
372
394
  * The control for one field, with no row around it — for a cell that shares
373
395
  * a row with others, or a surface that draws its own row. Keyed by `kind`
@@ -376,78 +398,7 @@ declare function PropertyField<T extends string = string>(props: PropertyFieldPr
376
398
  * A slider brings its readout beside the track. Several elements come back
377
399
  * as siblings rather than wrapped, so the surrounding row lays them out.
378
400
  */
379
- declare function PropertyControl<T extends string = string>(typed: PropertyControlProps<T>): react_jsx_runtime.JSX.Element;
380
-
381
- /** How a panel packs its rows into the two-column property grid.
382
- * - `'auto'`: narrow controls (numbers, checkboxes, dropdowns, colors) sit
383
- * two per row; the ones that need the width — text, sliders, segmented
384
- * toggles — span it.
385
- * - `'pairs'`: every row pairs. A control that needs the full width says so
386
- * itself, with `<PropertyRow span>`.
387
- * - `'one-up'`: one control per row, colors excepted.
388
- */
389
- type ControlPack = 'auto' | 'pairs' | 'one-up';
390
- interface ControlPanelProps<TC extends Record<string, unknown>> extends StanceProps {
391
- /** The instrument's resolved config schema. */
392
- schema?: ResolvedConfig;
393
- /** @deprecated Pass `schema`. A field list is adapted into one internally. */
394
- fields?: ConfigField[];
395
- config: TC;
396
- /** Writes one value. The path is dotted for a leaf inside an `f.group`, and
397
- * the bare key for one at the root. */
398
- setConfig: (path: string, value: unknown) => void;
399
- /**
400
- * Control overrides and app-defined kinds, PrefsForm-style. Keys are config
401
- * paths (checked first) or leaf kinds. A renderer returning `null` collapses
402
- * the row; entries override the built-in rows on collision.
403
- */
404
- renderers?: Record<string, ControlRenderer>;
405
- /** How rows pack into the two-column grid. Defaults to `'pairs'`. */
406
- pack?: ControlPack;
407
- /**
408
- * Where a row's label sits relative to its control. Unset takes each row's
409
- * own orientation — `block` (label above, which is what leaves a paired row
410
- * room for its value) for most, `inline` for colors and checkboxes.
411
- */
412
- layout?: PropertyRowLayout;
413
- /** Room the rows get. Passed straight to the property list. */
414
- density?: PropertyDensity;
415
- /** Cross-axis alignment of an inline row's label and control. */
416
- align?: PropertyAlign;
417
- /**
418
- * Fold each section away behind a twisty, starting `'open'` or `'closed'`.
419
- * Unset draws the heading alone, as the panel always has — unless a section
420
- * in the schema declares how it opens, which makes that section foldable on
421
- * its own and outranks this for that one section.
422
- */
423
- collapse?: 'open' | 'closed';
424
- /**
425
- * Which sections are folded, keyed as `onCollapse` reports them. Given, the
426
- * panel keeps no state of its own: every toggle arrives at `onCollapse`
427
- * instead, which is where a lab that remembers a trial's sections writes
428
- * them.
429
- */
430
- collapsed?: Readonly<Record<string, boolean>>;
431
- /** A fold moved. The key is a section's label — prefixed by its group's
432
- * dotted path when the section sits inside one — or a group's own path. */
433
- onCollapse?: (key: string, collapsed: boolean) => void;
434
- /** Dotted paths currently unpinned. A row in this set hides its control and
435
- * reads out `auto`, and clicking its label writes the sentinel back through
436
- * `setConfig`. Omitted, the panel keeps the set itself: the labels still
437
- * toggle and the sentinel never reaches `setConfig`, which would otherwise
438
- * store it as the row's value. */
439
- auto?: ReadonlySet<string>;
440
- /** Draw leaves marked `hidden`. */
441
- showHidden?: boolean;
442
- /** Heads the panel. With `title`, `stance` or `tone` given, the rows sit in a
443
- * `<PropertyPanel>` carrying them; with none, they are the bare list. */
444
- title?: ReactNode;
445
- className?: string;
446
- }
447
- /** Render an instrument's config schema as a stack of controls, each writing
448
- * back through `setConfig`. Built on the property rows, so a lab's controls
449
- * are the same aligned, themed rows the rest of the kit uses. */
450
- declare function ControlPanel<TC extends Record<string, unknown>>({ schema, fields, config, setConfig, renderers, pack, layout, density, align, collapse, collapsed, onCollapse, auto: given, showHidden, title, stance, tone, className, }: ControlPanelProps<TC>): react_jsx_runtime.JSX.Element;
401
+ declare function PropertyControl<T extends string = string>(typed: PropertyControlProps<T>): react.JSX.Element;
451
402
 
452
- export { ControlPanel as C, PropertyControl as b, PropertyField as d, PropertyList as f, PropertyPanel as i, PropertyRow as k, PropertySpan as o };
453
- 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 };
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,4 +1,3 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
1
  import * as react from 'react';
3
2
  import { ReactNode, ButtonHTMLAttributes, ReactElement } from 'react';
4
3
  import { S as StanceProps } from './PrefsRow.d-DFpPIeIC.js';
@@ -239,7 +238,7 @@ interface IconProps {
239
238
  * in; reach for this when the glyph is chosen at runtime. */
240
239
  declare function Icon({ name, className, size, label, filled, fillOpacity, }: IconProps & {
241
240
  name: IconName;
242
- }): react_jsx_runtime.JSX.Element;
241
+ }): react.JSX.Element;
243
242
 
244
243
  /** The tooltip fields a segmented bar's item carries. */
245
244
  interface SegmentTooltipFields {
@@ -407,7 +406,7 @@ type FieldProps = {
407
406
  * compose Field internally. Use Field directly when you need a custom
408
407
  * control to sit in the same visual rhythm.
409
408
  */
410
- declare function Field({ orientation, className, children }: FieldProps): react_jsx_runtime.JSX.Element;
409
+ declare function Field({ orientation, className, children }: FieldProps): react.JSX.Element;
411
410
  /**
412
411
  * The class names {@link Field} paints its slots with, so a control composing
413
412
  * its own layout can match the same form-row rhythm.
@@ -553,7 +552,7 @@ type SelectProps<T extends Key = string> = Omit<SelectProps$1<object>, 'children
553
552
  * `aria-label` or a string `label`, as `Button` does; `tooltip` replaces that
554
553
  * text.
555
554
  */
556
- declare function Select<T extends Key = string>(props: SelectProps<T>): react_jsx_runtime.JSX.Element;
555
+ declare function Select<T extends Key = string>(props: SelectProps<T>): react.JSX.Element;
557
556
  /** Props for {@link SelectItem}, on top of React Aria's `ListBoxItem` props. */
558
557
  type SelectItemProps = Omit<ListBoxItemProps, 'className' | 'children'> & {
559
558
  children?: ReactNode;
@@ -564,7 +563,7 @@ type SelectItemProps = Omit<ListBoxItemProps, 'className' | 'children'> & {
564
563
  * selected. A string child supplies its own `textValue`; anything richer must
565
564
  * pass one so type-to-select and screen readers have something to read.
566
565
  */
567
- declare function SelectItem({ children, className, textValue, ...rest }: SelectItemProps): react_jsx_runtime.JSX.Element;
566
+ declare function SelectItem({ children, className, textValue, ...rest }: SelectItemProps): react.JSX.Element;
568
567
 
569
568
  export { Button as B, Select as S, ToggleBar as T, Icon as d, Input as e, Field as m, ICON_PATHS as o, SelectItem as q, fieldClasses as t };
570
569
  export type { FieldOrientation as F, IconProps as I, OverlayPortalProps as O, WithoutPortalTarget as W, ButtonProps as a, ButtonSize as b, ButtonVariant as c, InputProps as f, SelectProps as g, ToggleBarItem as h, ToggleBarProps as i, ToggleBarSize as j, ToggleBarVariant as k, SegmentTooltipFields as l, FieldProps as n, IconName as p, SelectItemProps as r, SelectOption as s };
@@ -1,7 +1,75 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { ReactNode, WheelEvent, PointerEvent as PointerEvent$1 } from 'react';
3
- import { m as ViewTransform, b as WorldSpec, V as ViewportSize, n as Point, W as WorldFrame } from './frac-DTRq7Xpb.js';
4
- import { C as CanvasLayerDescriptor } from './CanvasStackContext-DQgcH1ny.js';
1
+ import * as react from 'react';
2
+ import { RefObject, ReactNode } from 'react';
3
+ import { ViewApi } from '@weasel-js/core';
4
+ import { W as WorldFrame, P as Point, b as ViewTransform, l as WorldSpec, V as ViewportSize } from './types-B7yBTTF9.js';
5
+ import { C as CanvasLayerDescriptor } from './CanvasStackContext-Wo6OwIVM.js';
6
+
7
+ /** The view id the stage publishes its pointer under. */
8
+ declare const STAGE_VIEW_ID = "stage";
9
+ /**
10
+ * A camera, as the things that sit beside it read it: an overview, a loupe, a
11
+ * linked cursor. Points are *frame-local* — the world with `y` multiplied by
12
+ * `frame.yDir` — which is the space `view` works in.
13
+ */
14
+ interface CameraContextValue {
15
+ /** The camera as a weasel `ViewApi`, clamped to its zoom range. */
16
+ view: ViewApi;
17
+ frame: WorldFrame;
18
+ /** The element the camera's dispatcher listens on. */
19
+ element: () => HTMLElement | null;
20
+ /** The content's own rect, frame-local, when it has one — a `<Stage>`'s. */
21
+ content?: {
22
+ x: number;
23
+ y: number;
24
+ width: number;
25
+ height: number;
26
+ };
27
+ }
28
+ /** The camera around the caller, or `null` outside one. */
29
+ declare const CameraContext: react.Context<CameraContextValue | null>;
30
+ /** Set by a host that already provides one input scope for everything inside
31
+ * it — a trial — so the camera, the loupe and an overview share it. */
32
+ declare const CameraScopeContext: react.Context<boolean>;
33
+ /**
34
+ * The actions and deps a camera routes through: the ones a trial provides, or
35
+ * an isolated set of its own. Isolated, because an actions registry holds one
36
+ * dispatcher, and a camera must not take input from a canvas beside it. The
37
+ * pointer store is the exception — one already in scope is kept, since sharing
38
+ * it is the point.
39
+ */
40
+ declare function CameraScope({ children }: {
41
+ children: ReactNode;
42
+ }): react.JSX.Element;
43
+ /** Options for {@link useCameraView}. */
44
+ interface CameraViewOptions {
45
+ view: ViewTransform;
46
+ onViewChange: (v: ViewTransform) => void;
47
+ frame: WorldFrame;
48
+ hostRef: RefObject<HTMLElement | null>;
49
+ minZoom?: number;
50
+ maxZoom?: number;
51
+ }
52
+ /**
53
+ * A labkit camera as a stable `ViewApi`. Its zoom range is widened to keep the
54
+ * opening zoom reachable — captured once, so a zoom-out cannot shrink the
55
+ * range and strand the opening view behind it.
56
+ */
57
+ declare function useCameraView({ view, onViewChange, frame, hostRef, minZoom, maxZoom, }: CameraViewOptions): ViewApi;
58
+ /** Props for `<CameraInput>`. */
59
+ interface CameraInputProps {
60
+ hostRef: RefObject<HTMLElement | null>;
61
+ camera: ViewApi;
62
+ frame: WorldFrame;
63
+ /** A primary-button press released without crossing the drag threshold, at
64
+ * the world point it landed on. */
65
+ onTap?: (world: Point) => void;
66
+ }
67
+ /**
68
+ * Mounts the dispatcher on `hostRef` and routes the camera's gestures through
69
+ * it. Render it inside a `<CameraScope>`; with no actions registry in scope it
70
+ * renders nothing.
71
+ */
72
+ declare function CameraInput(props: CameraInputProps): react.JSX.Element | null;
5
73
 
6
74
  /** Props for `<CanvasStack>`. */
7
75
  interface CanvasStackProps {
@@ -24,8 +92,9 @@ interface CanvasStackProps {
24
92
  }
25
93
  /** Stacks one `<canvas>` per layer and drives them from a shared view, so a
26
94
  * layer that changes rarely is not redrawn with one that changes every frame.
27
- * Handles sizing, device pixel ratio, and pan/zoom. */
28
- declare function CanvasStack({ layers, view: viewProp, onViewChange, worldSpec, minZoom, maxZoom, width, height, className, onResize, onHitTest, children, }: CanvasStackProps): react_jsx_runtime.JSX.Element;
95
+ * Handles sizing and device pixel ratio; pan and zoom route through weasel's
96
+ * gesture dispatcher (`<CameraInput>`). */
97
+ declare function CanvasStack({ layers, view: viewProp, onViewChange, worldSpec, minZoom, maxZoom, width, height, className, onResize, onHitTest, children, }: CanvasStackProps): react.JSX.Element;
29
98
 
30
99
  /** Bounds and coordinate system a {@link zoomAt} works in. */
31
100
  interface ZoomAtOptions {
@@ -82,36 +151,12 @@ interface StageProps {
82
151
  declare function fitStage(size: ViewportSize, viewport: ViewportSize): ViewTransform;
83
152
  /**
84
153
  * DOM content of a fixed size, panned and zoomed by a camera — what
85
- * `<CanvasStack>` is for layers drawn to a canvas. The content is laid out at
154
+ * `<CanvasStack>` is for layers drawn to a canvas. Pan and zoom route through
155
+ * weasel's gesture dispatcher (`<CameraInput>`). The content is laid out at
86
156
  * its own size and transformed, so everything inside keeps its layout and a
87
157
  * measurement of any element in it reports where it is actually drawn.
88
158
  */
89
- declare function Stage({ size, view: viewProp, onViewChange, minZoom, maxZoom, onResize, hostRef, overlay, children, }: StageProps): react_jsx_runtime.JSX.Element;
90
-
91
- interface UsePanZoomOptions {
92
- view: ViewTransform;
93
- onViewChange: (v: ViewTransform) => void;
94
- /** The opening `view.zoom` always stays reachable, widening these past
95
- * whatever is passed here if it would otherwise exclude it. */
96
- minZoom?: number;
97
- maxZoom?: number;
98
- /** The instrument's coordinate system, resolved against the viewport. The
99
- * wheel anchors in this frame; omitting it anchors at the element's
100
- * top-left, which is what labkit did before a frame could be declared. */
101
- frame?: WorldFrame;
102
- /** A primary-button press released without ever crossing the drag
103
- * threshold. The pointer session owns the release, so the gesture's end is
104
- * reported here rather than left for a consumer's own `onPointerUp`. */
105
- onTap?: (e: PointerEvent) => void;
106
- }
107
- interface PanZoomHandlers {
108
- /** Zoom about the pointer. `anchor` is the element the pointer position is
109
- * measured against, for an event whose `currentTarget` is some other box. */
110
- onWheel: (e: WheelEvent<HTMLElement> | globalThis.WheelEvent, anchor?: Element) => void;
111
- onPointerDown: (e: PointerEvent$1<HTMLElement>) => void;
112
- isDragging: () => boolean;
113
- }
114
- declare function usePanZoom({ view, onViewChange, minZoom, maxZoom, frame, onTap, }: UsePanZoomOptions): PanZoomHandlers;
159
+ declare function Stage({ size, view: viewProp, onViewChange, minZoom, maxZoom, onResize, hostRef, overlay, children, }: StageProps): react.JSX.Element;
115
160
 
116
- export { CanvasStack as C, Stage as S, centerOn as c, fitStage as f, screenToWorld as s, usePanZoom as u, worldToScreen as w, zoomAt as z };
117
- export type { PanZoomHandlers as P, UsePanZoomOptions as U, ZoomAtOptions as Z, CanvasStackProps as a, StageProps as b };
161
+ export { CameraContext as C, STAGE_VIEW_ID as S, CameraInput as b, CameraScope as d, CameraScopeContext as e, CanvasStack as g, Stage as i, centerOn as k, fitStage as l, screenToWorld as s, useCameraView as u, worldToScreen as w, zoomAt as z };
162
+ export type { ZoomAtOptions as Z, CameraContextValue as a, CameraInputProps as c, CameraViewOptions as f, CanvasStackProps as h, StageProps as j };
@@ -1,6 +1,5 @@
1
- import { C as ControlRenderer, d as ConfigRule } from './types-B7y8hX1D.js';
2
- import { O as Instrument, as as TrialChromeContext, R as TrialContribution, T as TrialRecord, t as InstrumentList, g as SavedSnapshot, s as LabMode, aq as ToolSlotContext, a6 as ContributionBase, ar as ToolbarItem, ap as ToolItem, aj as SidebarSection, am as StatusReadout, K as TrialTool, af as RegionContribution, ak as SidebarSlotContext } from './frac-DTRq7Xpb.js';
3
- import * as react_jsx_runtime from 'react/jsx-runtime';
1
+ import { d as ControlRenderer, c as ConfigRule } from './types-DTuViBvc.js';
2
+ import { R as Instrument, ax as TrialChromeContext, Y as TrialContribution, T as TrialRecord, t as InstrumentList, f as SavedSnapshot, s as LabMode, av as ToolSlotContext, a9 as ContributionBase, aw as ToolbarItem, au as ToolItem, ao as SidebarSection, ar as StatusReadout, O as TrialTool, ak as RegionContribution, ap as SidebarSlotContext } from './types-B7yBTTF9.js';
4
3
  import * as react from 'react';
5
4
  import { ReactNode } from 'react';
6
5
 
@@ -142,15 +141,15 @@ interface LabRegionProps {
142
141
  contributions: readonly LabContribution[];
143
142
  }
144
143
  /** The lab's action bar, in the shell header beside the title. */
145
- declare function LabHeaderRegion({ contributions }: LabRegionProps): react_jsx_runtime.JSX.Element;
144
+ declare function LabHeaderRegion({ contributions }: LabRegionProps): react.JSX.Element;
146
145
  /** The lab's sidebar sections. Fold state is a lab-scoped persisted value, so it
147
146
  * survives a reload in a stored lab and lasts the session in an unstored one. */
148
- declare function LabSidebarRegion({ contributions }: LabRegionProps): react_jsx_runtime.JSX.Element;
147
+ declare function LabSidebarRegion({ contributions }: LabRegionProps): react.JSX.Element;
149
148
  /** The lab's aside sections, on the far side of the workspace from the sidebar.
150
149
  * Fold state persists the way the sidebar's does. */
151
- declare function LabAsideRegion({ contributions }: LabRegionProps): react_jsx_runtime.JSX.Element;
150
+ declare function LabAsideRegion({ contributions }: LabRegionProps): react.JSX.Element;
152
151
  /** The lab's readouts, in the shell footer below the workspace. */
153
- declare function LabFooterRegion({ contributions }: LabRegionProps): react_jsx_runtime.JSX.Element;
152
+ declare function LabFooterRegion({ contributions }: LabRegionProps): react.JSX.Element;
154
153
 
155
154
  /**
156
155
  * Concatenate contribution bundles into one list, preserving order — order
@@ -183,7 +182,7 @@ interface PaletteRegionProps<TCtx extends ToolSlotContext = TrialChromeContext>
183
182
  /** A tool strip: a trial's, or the lab's. Selection lives in whichever tool
184
183
  * slot the context carries; this region only reflects it. An item carrying
185
184
  * `onActivate` is a command instead — it presses, and never latches. */
186
- declare function PaletteRegion<TCtx extends ToolSlotContext = TrialChromeContext>({ contributions, ctx, region, }: PaletteRegionProps<TCtx>): react_jsx_runtime.JSX.Element | null;
185
+ declare function PaletteRegion<TCtx extends ToolSlotContext = TrialChromeContext>({ contributions, ctx, region, }: PaletteRegionProps<TCtx>): react.JSX.Element | null;
187
186
 
188
187
  /** Props for `<SidebarRegion>`. */
189
188
  interface SidebarRegionProps<TCtx extends SidebarSlotContext = TrialChromeContext> {
@@ -196,7 +195,7 @@ interface SidebarRegionProps<TCtx extends SidebarSlotContext = TrialChromeContex
196
195
  * trial's, or the lab's. A section the trial has torn out is not rendered
197
196
  * here — `Trial` portals its body into the workspace instead. A context with
198
197
  * no `undockPanel` offers no tear-out. */
199
- declare function SidebarRegion<TCtx extends SidebarSlotContext = TrialChromeContext>({ contributions, ctx, region, }: SidebarRegionProps<TCtx>): react_jsx_runtime.JSX.Element | null;
198
+ declare function SidebarRegion<TCtx extends SidebarSlotContext = TrialChromeContext>({ contributions, ctx, region, }: SidebarRegionProps<TCtx>): react.JSX.Element | null;
200
199
 
201
200
  /** Props for `<StatusRegion>`. */
202
201
  interface StatusRegionProps<TCtx = TrialChromeContext> {
@@ -206,7 +205,7 @@ interface StatusRegionProps<TCtx = TrialChromeContext> {
206
205
  region?: string;
207
206
  }
208
207
  /** Lays a bar's readouts out. */
209
- declare function StatusRegion<TCtx = TrialChromeContext>({ contributions, ctx, region, }: StatusRegionProps<TCtx>): react_jsx_runtime.JSX.Element | null;
208
+ declare function StatusRegion<TCtx = TrialChromeContext>({ contributions, ctx, region, }: StatusRegionProps<TCtx>): react.JSX.Element | null;
210
209
 
211
210
  /** Which end of the title bar a `<TitleBarRegion>` lays out: `'lead'` renders
212
211
  * the contributions that leave `end` unset, before the title; `'actions'`
@@ -220,7 +219,7 @@ interface TitleBarRegionProps {
220
219
  placement?: TitleBarPlacement;
221
220
  }
222
221
  /** Lays a trial's `titlebar` contributions out at one end of the bar. */
223
- declare function TitleBarRegion({ contributions, ctx, placement }: TitleBarRegionProps): react_jsx_runtime.JSX.Element | null;
222
+ declare function TitleBarRegion({ contributions, ctx, placement }: TitleBarRegionProps): react.JSX.Element | null;
224
223
 
225
224
  /** Props for `<ToolbarRegion>`. */
226
225
  interface ToolbarRegionProps<TCtx = TrialChromeContext> {
@@ -232,7 +231,7 @@ interface ToolbarRegionProps<TCtx = TrialChromeContext> {
232
231
  label?: string;
233
232
  }
234
233
  /** Lays a bar's contributions out, grouped by their `group`. */
235
- declare function ToolbarRegion<TCtx = TrialChromeContext>({ contributions, ctx, region, label, }: ToolbarRegionProps<TCtx>): react_jsx_runtime.JSX.Element | null;
234
+ declare function ToolbarRegion<TCtx = TrialChromeContext>({ contributions, ctx, region, label, }: ToolbarRegionProps<TCtx>): react.JSX.Element | null;
236
235
 
237
236
  /** Props for `<ViewportRegion>`. */
238
237
  interface ViewportRegionProps {
@@ -243,7 +242,7 @@ interface ViewportRegionProps {
243
242
  * Controls acting on the view of a trial. Anchored inside the content well
244
243
  * rather than in the toolbar, which acts on the trial itself.
245
244
  */
246
- declare function ViewportRegion({ contributions, ctx }: ViewportRegionProps): react_jsx_runtime.JSX.Element | null;
245
+ declare function ViewportRegion({ contributions, ctx }: ViewportRegionProps): react.JSX.Element | null;
247
246
 
248
247
  export { resetTrial as B, suppressContributions as C, toolContributions as D, useLabChromeContext as E, useLabContext as F, PaletteRegion as P, SidebarRegion as S, ViewportRegion as V, LabAsideRegion as a, LabContext as c, LabFooterRegion as e, LabHeaderRegion as f, LabSidebarRegion as i, StatusRegion as l, TitleBarRegion as n, ToolbarRegion as p, addTrial as s, builtinContributions as t, cloneTrial as u, closeTrial as v, contributionsIn as w, labContributions as x, mergeContributions as y, reorderTrials as z };
249
248
  export type { AddTrialOptions as A, LabContribution as L, TitleBarPlacement as T, LabChromeContext as b, LabContextValue as d, LabRegion as g, LabRegionProps as h, PaletteRegionProps as j, SidebarRegionProps as k, StatusRegionProps as m, TitleBarRegionProps as o, ToolbarRegionProps as q, ViewportRegionProps as r };