@weasel-js/labkit 1.7.0 → 1.7.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 (208) hide show
  1. package/README.md +3 -3
  2. package/dist/_dts/{CanvasStackContext-D2jnIwfk.d.ts → CanvasStackContext-Cjy6I-Iv.d.ts} +4 -1
  3. package/dist/_dts/{Stage-CCWfQQWM.d.ts → Stage-D6t7o0pF.d.ts} +3 -2
  4. package/dist/_dts/{index-CsYqUHD3.d.ts → index-BTmaRy6a.d.ts} +10 -6
  5. package/dist/_dts/{types-CSm9jgol.d.ts → index-DCMA4Fy1.d.ts} +59 -113
  6. package/dist/_dts/{types-CRPSGFAp.d.ts → types-BUBSIZuV.d.ts} +8 -7
  7. package/dist/_dts/{useTrialState-CTZPgeZ7.d.ts → useTrialState-Bh8bzFgE.d.ts} +1 -1
  8. package/dist/canvas/index.d.ts +8 -6
  9. package/dist/canvas/index.js +6 -6
  10. package/dist/chrome/index.d.ts +7 -5
  11. package/dist/chrome/index.js +10 -9
  12. package/dist/chunk-2ES4W47N.js +8 -0
  13. package/dist/chunk-2ES4W47N.js.map +1 -0
  14. package/dist/{chunk-WPLAANH4.js → chunk-2N7UBSS2.js} +12 -12
  15. package/dist/chunk-2N7UBSS2.js.map +1 -0
  16. package/dist/chunk-4KSC7NXL.js +15491 -0
  17. package/dist/chunk-4KSC7NXL.js.map +1 -0
  18. package/dist/{chunk-7BO7HNGF.js → chunk-CEGFXTBD.js} +8 -61
  19. package/dist/chunk-CEGFXTBD.js.map +1 -0
  20. package/dist/{chunk-275JRRVD.js → chunk-E23Q6A3Y.js} +232 -37
  21. package/dist/chunk-E23Q6A3Y.js.map +1 -0
  22. package/dist/{chunk-GOZLNM4L.js → chunk-E6NARGU7.js} +5 -5
  23. package/dist/{chunk-GOZLNM4L.js.map → chunk-E6NARGU7.js.map} +1 -1
  24. package/dist/{chunk-IJJUK4FU.js → chunk-EESJUSYR.js} +5 -6
  25. package/dist/chunk-EESJUSYR.js.map +1 -0
  26. package/dist/{chunk-HXXTULDN.js → chunk-EFXRM6XQ.js} +8 -11
  27. package/dist/chunk-EFXRM6XQ.js.map +1 -0
  28. package/dist/chunk-F4ACIK7Z.js +210 -0
  29. package/dist/chunk-F4ACIK7Z.js.map +1 -0
  30. package/dist/{chunk-FMK7UQ6V.js → chunk-FB4MIZOO.js} +61 -44
  31. package/dist/chunk-FB4MIZOO.js.map +1 -0
  32. package/dist/{chunk-AWQG7FCC.js → chunk-FG3EXZDV.js} +3 -3
  33. package/dist/{chunk-AWQG7FCC.js.map → chunk-FG3EXZDV.js.map} +1 -1
  34. package/dist/{chunk-I5DUQ5HM.js → chunk-GAHELLJT.js} +75 -72
  35. package/dist/chunk-GAHELLJT.js.map +1 -0
  36. package/dist/{chunk-YT75VYRD.js → chunk-IBVRMHW5.js} +5 -5
  37. package/dist/{chunk-YT75VYRD.js.map → chunk-IBVRMHW5.js.map} +1 -1
  38. package/dist/{chunk-T5IBSPAM.js → chunk-JFOJESJF.js} +33 -23
  39. package/dist/chunk-JFOJESJF.js.map +1 -0
  40. package/dist/{chunk-RWNDDKOH.js → chunk-PMLZP7RT.js} +18 -15
  41. package/dist/chunk-PMLZP7RT.js.map +1 -0
  42. package/dist/{chunk-Y23G2VZL.js → chunk-READTDQX.js} +2 -2
  43. package/dist/chunk-READTDQX.js.map +1 -0
  44. package/dist/{chunk-JVBYV6TL.js → chunk-ROGJWDQA.js} +3 -3
  45. package/dist/{chunk-JVBYV6TL.js.map → chunk-ROGJWDQA.js.map} +1 -1
  46. package/dist/{chunk-ZIFPHIWZ.js → chunk-T6DLGEJB.js} +12 -14
  47. package/dist/chunk-T6DLGEJB.js.map +1 -0
  48. package/dist/{chunk-24W5VEJW.js → chunk-ULYYNWGP.js} +2 -2
  49. package/dist/{chunk-24W5VEJW.js.map → chunk-ULYYNWGP.js.map} +1 -1
  50. package/dist/{chunk-UNAZSLWE.js → chunk-VYVGVBGY.js} +17 -20
  51. package/dist/chunk-VYVGVBGY.js.map +1 -0
  52. package/dist/{chunk-KMJ7RWD3.js → chunk-WLMDTI2Q.js} +3 -3
  53. package/dist/{chunk-KMJ7RWD3.js.map → chunk-WLMDTI2Q.js.map} +1 -1
  54. package/dist/{chunk-J7OWWTCW.js → chunk-XE5HJOPL.js} +5 -6
  55. package/dist/chunk-XE5HJOPL.js.map +1 -0
  56. package/dist/chunk-XVUKDSYV.js +38 -0
  57. package/dist/chunk-XVUKDSYV.js.map +1 -0
  58. package/dist/{chunk-FZ7YFQN7.js → chunk-YCFKW5RX.js} +3 -3
  59. package/dist/chunk-YCFKW5RX.js.map +1 -0
  60. package/dist/{chunk-CQLQPQ4P.js → chunk-ZQIHJXP4.js} +2 -2
  61. package/dist/chunk-ZQIHJXP4.js.map +1 -0
  62. package/dist/config/index.d.ts +18 -10
  63. package/dist/config/index.js +4 -4
  64. package/dist/controls/index.d.ts +4 -7
  65. package/dist/controls/index.js +6 -5
  66. package/dist/dragdrop/index.d.ts +23 -3
  67. package/dist/dragdrop/index.js +4 -3
  68. package/dist/fonts/oswald-tabular-digits.woff2 +0 -0
  69. package/dist/index.d.ts +60 -714
  70. package/dist/index.js +357 -334
  71. package/dist/index.js.map +1 -1
  72. package/dist/job/index.d.ts +8 -0
  73. package/dist/job/index.js +1 -1
  74. package/dist/layers/index.d.ts +6 -5
  75. package/dist/layers/index.js +3 -2
  76. package/dist/loupe/index.d.ts +100 -30
  77. package/dist/loupe/index.js +585 -6
  78. package/dist/loupe/index.js.map +1 -1
  79. package/dist/overview/index.d.ts +4 -2
  80. package/dist/overview/index.js +15 -14
  81. package/dist/overview/index.js.map +1 -1
  82. package/dist/passthrough/weasel-canvas.d.ts +2 -0
  83. package/dist/passthrough/weasel-ui.d.ts +2 -2871
  84. package/dist/passthrough/weasel-ui.js +3 -2
  85. package/dist/primitives/index.d.ts +213 -3
  86. package/dist/primitives/index.js +8 -7
  87. package/dist/state/index.d.ts +7 -5
  88. package/dist/state/index.js +6 -6
  89. package/dist/styles.css +60 -44
  90. package/dist/surface/index.d.ts +10 -2
  91. package/dist/surface/index.js +1 -1
  92. package/dist/undo/index.d.ts +5 -3
  93. package/package.json +11 -11
  94. package/src/annotations/AnnotationOverlay.abandon.test.tsx +143 -0
  95. package/src/annotations/AnnotationOverlay.tsx +50 -31
  96. package/src/annotations/Annotations.overlay.test.tsx +31 -0
  97. package/src/annotations/capture.browser.test.ts +41 -0
  98. package/src/annotations/capture.ts +14 -7
  99. package/src/annotations/drawOne.ts +2 -2
  100. package/src/annotations/frac.test.ts +44 -1
  101. package/src/annotations/frac.ts +46 -18
  102. package/src/annotations/index.ts +1 -0
  103. package/src/annotations/paint.test.ts +74 -33
  104. package/src/annotations/paint.ts +70 -32
  105. package/src/annotations/store.test.ts +212 -2
  106. package/src/annotations/store.ts +130 -27
  107. package/src/annotations/svgNodes.test.ts +22 -10
  108. package/src/annotations/svgNodes.ts +3 -3
  109. package/src/annotations/types.ts +29 -10
  110. package/src/canvas/CameraInput.test.tsx +30 -0
  111. package/src/canvas/CameraInput.tsx +16 -15
  112. package/src/canvas/CanvasStack.tsx +5 -5
  113. package/src/canvas/CanvasStackContext.ts +4 -1
  114. package/src/canvas/Stage.tsx +3 -3
  115. package/src/canvas/cameraRegistry.ts +1 -0
  116. package/src/canvas/worldSpec.ts +3 -1
  117. package/src/chrome/builtins.test.ts +7 -6
  118. package/src/chrome/builtins.tsx +5 -1
  119. package/src/chrome/index.ts +1 -1
  120. package/src/chrome/merge.test.ts +5 -0
  121. package/src/chrome/merge.ts +4 -2
  122. package/src/chrome/regions/PaletteRegion.test.tsx +2 -3
  123. package/src/chrome/regions/PaletteRegion.tsx +3 -4
  124. package/src/chrome/regions/ViewportRegion.browser.test.less +6 -0
  125. package/src/chrome/regions/ViewportRegion.browser.test.tsx +38 -0
  126. package/src/chrome/regions/ViewportRegion.less +6 -0
  127. package/src/chrome/regions/ViewportRegion.tsx +10 -4
  128. package/src/chrome/types.ts +4 -2
  129. package/src/config/auto.ts +1 -0
  130. package/src/config/builder.ts +6 -0
  131. package/src/config/types.ts +2 -1
  132. package/src/controls/ControlPanel.test.tsx +37 -3
  133. package/src/controls/ControlPanel.tsx +12 -3
  134. package/src/dragdrop/DragDropRuntime.tsx +22 -13
  135. package/src/dragdrop/DragGhost.tsx +3 -0
  136. package/src/dragdrop/Palette.tsx +2 -0
  137. package/src/index.test.ts +5 -0
  138. package/src/index.ts +1 -1
  139. package/src/instrument/types.ts +0 -6
  140. package/src/job/useJob.ts +14 -9
  141. package/src/lab/Lab.tsx +5 -1
  142. package/src/lab/LabShell.less +1 -0
  143. package/src/lab/LabSwitcher.browser.test.tsx +27 -0
  144. package/src/lab/LabSwitcher.less +2 -0
  145. package/src/lab/LabZoom.tsx +4 -4
  146. package/src/lab/Workspace.tsx +48 -52
  147. package/src/loupe/AGENTS.md +28 -15
  148. package/src/loupe/CanvasLoupe.tsx +2 -3
  149. package/src/loupe/DomLoupe.tsx +1 -7
  150. package/src/loupe/Loupe.less +16 -0
  151. package/src/loupe/TrialLoupe.tsx +120 -57
  152. package/src/loupe/index.ts +1 -6
  153. package/src/loupe/types.test.ts +3 -3
  154. package/src/loupe/types.ts +24 -27
  155. package/src/loupe/useLoupe.test.tsx +29 -4
  156. package/src/loupe/useLoupe.ts +20 -17
  157. package/src/overview/OverviewMarks.tsx +12 -4
  158. package/src/overview/TrialOverview.tsx +3 -3
  159. package/src/passthrough/weasel-ui.test.ts +1 -1
  160. package/src/passthrough/weasel-ui.ts +1 -1
  161. package/src/primitives/FloatingPanel.tsx +7 -3
  162. package/src/primitives/JobProgress.less +1 -0
  163. package/src/primitives/Readout.test.tsx +2 -2
  164. package/src/primitives/Split.tsx +69 -41
  165. package/src/primitives/Toolbar.tsx +3 -3
  166. package/src/primitives/ZoomControl.less +1 -2
  167. package/src/specimen/Specimen.tsx +0 -1
  168. package/src/state/undock.ts +3 -0
  169. package/src/state/useOpenOnce.ts +20 -16
  170. package/src/state/view.ts +1 -0
  171. package/src/surface/index.ts +1 -1
  172. package/src/surface/useTiledSurface.test.tsx +14 -0
  173. package/src/surface/useTiledSurface.ts +11 -3
  174. package/src/trial/Trial.annotations.test.tsx +73 -0
  175. package/src/trial/Trial.less +0 -16
  176. package/src/trial/Trial.loupe.test.tsx +28 -11
  177. package/src/trial/Trial.tsx +74 -62
  178. package/src/trial/TrialChrome.tsx +6 -3
  179. package/src/trial/index.ts +2 -0
  180. package/src/trial/loupeSwitch.ts +15 -0
  181. package/dist/_dts/LayerList.d-DiuEArKq.d.ts +0 -83
  182. package/dist/_dts/PrefsRow.d-TOZ7BgD9.d.ts +0 -79
  183. package/dist/_dts/PropertyPanel.d-D-1paCbE.d.ts +0 -141
  184. package/dist/_dts/Select.d-Bensr_MT.d.ts +0 -579
  185. package/dist/_dts/index-B2Yj5aA0.d.ts +0 -274
  186. package/dist/chunk-275JRRVD.js.map +0 -1
  187. package/dist/chunk-4LJSC7MB.js +0 -143
  188. package/dist/chunk-4LJSC7MB.js.map +0 -1
  189. package/dist/chunk-7BO7HNGF.js.map +0 -1
  190. package/dist/chunk-CQLQPQ4P.js.map +0 -1
  191. package/dist/chunk-FMK7UQ6V.js.map +0 -1
  192. package/dist/chunk-FZ7YFQN7.js.map +0 -1
  193. package/dist/chunk-HXXTULDN.js.map +0 -1
  194. package/dist/chunk-I5DUQ5HM.js.map +0 -1
  195. package/dist/chunk-IJJUK4FU.js.map +0 -1
  196. package/dist/chunk-J7OWWTCW.js.map +0 -1
  197. package/dist/chunk-M7HP3FTK.js +0 -549
  198. package/dist/chunk-M7HP3FTK.js.map +0 -1
  199. package/dist/chunk-MIM5R4ZT.js +0 -14972
  200. package/dist/chunk-MIM5R4ZT.js.map +0 -1
  201. package/dist/chunk-RWNDDKOH.js.map +0 -1
  202. package/dist/chunk-T5IBSPAM.js.map +0 -1
  203. package/dist/chunk-UNAZSLWE.js.map +0 -1
  204. package/dist/chunk-WPLAANH4.js.map +0 -1
  205. package/dist/chunk-Y23G2VZL.js.map +0 -1
  206. package/dist/chunk-ZIFPHIWZ.js.map +0 -1
  207. package/src/primitives/useRovingTabIndex.test.ts +0 -48
  208. package/src/primitives/useRovingTabIndex.ts +0 -88
@@ -1,12 +1,20 @@
1
1
  import { a as JobCapability, J as JobHandle } from '../_dts/types-DJ79Tg5J.js';
2
2
  export { b as JobEvent, c as JobFailure, d as JobStatus } from '../_dts/types-DJ79Tg5J.js';
3
3
 
4
+ /** Inputs to `useJob`. `setState` receives each item folded in by the
5
+ * capability's `onItem`. */
4
6
  interface UseJobOptions<TS, TC, TItem> {
5
7
  capability: JobCapability<TS, TC, TItem>;
6
8
  config: TC;
7
9
  state: TS;
8
10
  setState: (next: TS | ((prev: TS) => TS)) => void;
9
11
  }
12
+ /**
13
+ * Drive a `JobCapability` and report its progress. `start` cancels any run in
14
+ * flight and begins again; results from a superseded or canceled run are
15
+ * dropped. With `auto`, it starts on mount and again whenever `key` changes
16
+ * element-wise. Unmounting aborts the run.
17
+ */
10
18
  declare function useJob<TS, TC, TItem>({ capability, config, state, setState, }: UseJobOptions<TS, TC, TItem>): JobHandle;
11
19
 
12
20
  export { JobCapability, JobHandle, useJob };
package/dist/job/index.js CHANGED
@@ -1,3 +1,3 @@
1
- export { useJob } from '../chunk-HXXTULDN.js';
1
+ export { useJob } from '../chunk-EFXRM6XQ.js';
2
2
  //# sourceMappingURL=index.js.map
3
3
  //# sourceMappingURL=index.js.map
@@ -1,8 +1,9 @@
1
- export { L as LayerList, a as LayerListItem, b as LayerListProps, c as LayerMove, m as moveLayers } from '../_dts/LayerList.d-DiuEArKq.js';
2
- export { L as LayerCapability, a as LayerDescriptor } from '../_dts/types-CSm9jgol.js';
1
+ export { LayerList, LayerListItem, LayerListProps, LayerMove, moveLayers } from '@weasel-js/ui';
2
+ export { ad as LayerCapability, ae as LayerDescriptor } from '../_dts/index-DCMA4Fy1.js';
3
+ import '@weasel-js/core';
3
4
  import 'react';
4
- import '../_dts/PrefsRow.d-TOZ7BgD9.js';
5
5
  import '@weasel-js/theme';
6
- import '@weasel-js/core';
7
- import '../_dts/types-CRPSGFAp.js';
6
+ import '../_dts/types-BUBSIZuV.js';
7
+ import '@weasel-js/quantity';
8
+ import '@weasel-js/geom';
8
9
  import '../_dts/types-DJ79Tg5J.js';
@@ -1,5 +1,6 @@
1
1
  import '../chunk-2RVCB2PT.js';
2
- export { E3 as LayerList, x3 as moveLayers } from '../chunk-MIM5R4ZT.js';
3
- import '../chunk-275JRRVD.js';
2
+ export { D2 as LayerList, S2 as moveLayers } from '../chunk-4KSC7NXL.js';
3
+ import '../chunk-E23Q6A3Y.js';
4
+ import '../chunk-XVUKDSYV.js';
4
5
  //# sourceMappingURL=index.js.map
5
6
  //# sourceMappingURL=index.js.map
@@ -1,14 +1,16 @@
1
- import { ai as LoupePoint, ah as LoupeMode, aj as LoupeRenderArgs, am as ResolvedLoupe } from '../_dts/types-CSm9jgol.js';
2
- import { WorldFrame, WorldSpec, ViewportSize } from '../canvas/index.js';
3
- import { ViewTransform } from '../index.js';
4
- export { ae as LOUPE_DEFAULTS, af as LoupeCapability, ag as LoupeDeclaration, aK as resolveLoupe } from '../_dts/types-CSm9jgol.js';
1
+ import { LoupePoint, LoupeMode } from '@weasel-js/loupe';
2
+ export { LoupeMode, LoupePoint } from '@weasel-js/loupe';
5
3
  import * as react from 'react';
6
- import { RefObject, ReactNode } from 'react';
4
+ import { ReactNode, RefObject } from 'react';
7
5
  import { CanvasStackSurface, CanvasLayerDescriptor } from '../canvas/index.js';
6
+ import { WorldFrame, WorldSpec, ViewportSize } from '../canvas/index.js';
7
+ import { ViewTransform } from '../index.js';
8
8
  import { Action } from '@weasel-js/core';
9
- import '../_dts/PrefsRow.d-TOZ7BgD9.js';
9
+ import '@weasel-js/ui';
10
10
  import '@weasel-js/theme';
11
- import '../_dts/types-CRPSGFAp.js';
11
+ import '../_dts/types-BUBSIZuV.js';
12
+ import '@weasel-js/quantity';
13
+ import '@weasel-js/geom';
12
14
  import '../_dts/types-DJ79Tg5J.js';
13
15
 
14
16
  /** Props for `<CanvasLoupe>`. */
@@ -77,6 +79,71 @@ declare function drawCanvasLens(ctx: CanvasRenderingContext2D, opts: {
77
79
  canvases: Map<string, HTMLCanvasElement>;
78
80
  }): void;
79
81
 
82
+ /** What a DOM loupe's `render` is handed: the camera to draw the content
83
+ * through again. */
84
+ interface LoupeRenderArgs {
85
+ /** The trial's own camera composed with the magnification, about the aimed
86
+ * point — so drawing the same content through it magnifies in place. */
87
+ view: ViewTransform;
88
+ /** The magnification on its own, for whatever must not scale with the
89
+ * camera. */
90
+ factor: number;
91
+ mode: LoupeMode;
92
+ /** The size of the viewport `view` is written for: the trial's content well,
93
+ * not the lens. The lens shows a circle cut out of it. */
94
+ size: ViewportSize;
95
+ }
96
+ /**
97
+ * How a lens magnifies.
98
+ *
99
+ * With no `render`, the lens re-draws the canvas stack's layers through a
100
+ * zoomed camera, so it stays sharp at any factor. Over DOM content, `render`
101
+ * draws it instead: given a camera, draw me again.
102
+ */
103
+ interface LoupeOptions {
104
+ render?: (args: LoupeRenderArgs) => ReactNode;
105
+ /** Opening magnification, clamped to the bounds below. Default 6. */
106
+ factor?: number;
107
+ /** What the wheel clamps to. Defaults 2 and 32. */
108
+ minFactor?: number;
109
+ maxFactor?: number;
110
+ /** `'vector'` (default) re-renders the content magnified; `'pixel'` blows up
111
+ * the pixels the instrument presented. A `render` loupe is always vector —
112
+ * DOM has no framebuffer to enlarge. */
113
+ mode?: LoupeMode;
114
+ /** Lens diameter in CSS px. Default 200. */
115
+ diameter?: number;
116
+ /** Held for a momentary peek while the loupe is off. Default `'Alt'`; `null`
117
+ * turns hold-to-peek off. Matched against `KeyboardEvent.key`. */
118
+ peekKey?: string | null;
119
+ /** Called with the color under the aim, wherever the surface can say. The
120
+ * canvas painter reads it back; a DOM loupe has no pixels to sample. */
121
+ onColorChange?: (hex: string) => void;
122
+ }
123
+ /** {@link LoupeOptions} with every default filled in. */
124
+ interface ResolvedLoupe {
125
+ render?: (args: LoupeRenderArgs) => ReactNode;
126
+ onColorChange?: (hex: string) => void;
127
+ factor: number;
128
+ minFactor: number;
129
+ maxFactor: number;
130
+ mode: LoupeMode;
131
+ diameter: number;
132
+ peekKey: string | null;
133
+ }
134
+ /** What `resolveLoupe` fills in for anything a declaration leaves unset. */
135
+ declare const LOUPE_DEFAULTS: {
136
+ readonly factor: 6;
137
+ readonly minFactor: 2;
138
+ readonly maxFactor: 32;
139
+ readonly mode: "vector";
140
+ readonly diameter: 200;
141
+ readonly peekKey: "Alt";
142
+ };
143
+ /** `options` with every default filled in and `factor` clamped to
144
+ * `[minFactor, maxFactor]`. A loupe with its own `render` is always `'vector'`. */
145
+ declare function resolveLoupe(options?: LoupeOptions): ResolvedLoupe;
146
+
80
147
  /** Props for `<DomLoupe>`. */
81
148
  interface DomLoupeProps {
82
149
  aim: LoupePoint;
@@ -88,12 +155,10 @@ interface DomLoupeProps {
88
155
  /** The trial's own camera. */
89
156
  view: ViewTransform;
90
157
  frame?: WorldFrame;
91
- state: unknown;
92
- config: unknown;
93
158
  render: (args: LoupeRenderArgs) => React.ReactNode;
94
159
  }
95
160
  /**
96
- * Paints a lens over DOM content by asking the instrument to draw itself again
161
+ * Paints a lens over DOM content by asking its `render` to draw it again
97
162
  * at a magnified camera.
98
163
  *
99
164
  * The stage is a full copy of the host, so the instrument's own layout still
@@ -101,7 +166,7 @@ interface DomLoupeProps {
101
166
  * where it already was, and the stage is then slid by `diameter / 2 - aim` to
102
167
  * bring it to the middle of the lens.
103
168
  */
104
- declare function DomLoupe({ aim, factor, mode, diameter, size, view, frame, state, config, render, }: DomLoupeProps): react.JSX.Element;
169
+ declare function DomLoupe({ aim, factor, mode, diameter, size, view, frame, render, }: DomLoupeProps): react.JSX.Element;
105
170
 
106
171
  /** Props for `<LoupeBubble>`. */
107
172
  interface LoupeBubbleProps {
@@ -170,29 +235,34 @@ interface LoupeGesturesProps {
170
235
  declare function LoupeGestures(props: LoupeGesturesProps): react.JSX.Element | null;
171
236
 
172
237
  /** Props for `<TrialLoupe>`. */
173
- interface TrialLoupeProps {
174
- capability: ResolvedLoupe;
175
- /** Whether the trial's loupe is turned on. Hold-to-peek shows it anyway. */
176
- enabled: boolean;
177
- state: unknown;
178
- config: unknown;
179
- /** The trial's own camera. */
180
- view: ViewTransform;
181
- worldSpec?: WorldSpec;
182
- /** The element the lens tracks. A loupe mounted inside a `<CanvasStack>`
183
- * takes the stack's own element instead, and this goes unused. */
238
+ interface TrialLoupeProps extends LoupeOptions {
239
+ /** Whether the lens is turned on. Omitted, it follows the trial's toolbar
240
+ * toggle, which the trial offers while a lens like this is mounted — and is
241
+ * off outside a trial. Hold-to-peek shows it either way. */
242
+ enabled?: boolean;
243
+ /** The camera a `render` lens composes its magnification onto. Defaults to
244
+ * the camera around it, and to the identity outside one. */
245
+ view?: ViewTransform;
246
+ /** The element the lens tracks. Defaults to the canvas stack or stage around
247
+ * it, and outside both to a box wrapped around `children`. */
184
248
  hostRef?: RefObject<HTMLElement | null>;
249
+ /** Content for the lens to sit over. Wrapped in a box of the lens's own only
250
+ * when nothing around it gives the lens an element to track. */
251
+ children?: ReactNode;
185
252
  }
186
253
  /**
187
- * A trial's loupe, painted by whichever painter suits its content: the canvas
188
- * stack it is mounted inside, or the instrument's own `render` at a magnified
189
- * camera.
254
+ * A trial's magnifier, mounted by the instrument wherever its content is: in
255
+ * a canvas instrument's `render`, a stage's `overlay`, or around DOM content.
256
+ *
257
+ * With no `render` inside a `<CanvasStack>`, it re-draws the stack's own
258
+ * layers through a zoomed camera. With `render`, it asks for the content again
259
+ * at a magnified camera.
190
260
  */
191
- declare function TrialLoupe({ capability, enabled, state, config, view, worldSpec, hostRef, }: TrialLoupeProps): react.JSX.Element;
261
+ declare function TrialLoupe({ enabled, view, hostRef, children, render, factor, minFactor, maxFactor, mode, diameter, peekKey, onColorChange, }: TrialLoupeProps): react.JSX.Element;
192
262
 
193
263
  /** Options for {@link useLoupe}. */
194
264
  interface UseLoupeOptions {
195
- capability: ResolvedLoupe;
265
+ options: ResolvedLoupe;
196
266
  /** The element the lens tracks the pointer across. */
197
267
  hostRef: RefObject<HTMLElement | null>;
198
268
  /** Whether the loupe is turned on. Hold-to-peek shows it regardless. */
@@ -229,7 +299,7 @@ interface LoupeState {
229
299
  * has no continuous-motion entry, and inventing one to carry the lens' aim
230
300
  * would be an input taxonomy change, not a loupe change.
231
301
  */
232
- declare function useLoupe({ capability, hostRef, enabled, sample }: UseLoupeOptions): LoupeState;
302
+ declare function useLoupe({ options, hostRef, enabled, sample }: UseLoupeOptions): LoupeState;
233
303
 
234
- export { CanvasLoupe, DomLoupe, LOUPE_MAGNIFY_ID, LOUPE_PEEK_ID, LoupeBubble, LoupeGestures, LoupeMode, LoupePoint, LoupeRenderArgs, ResolvedLoupe, TrialLoupe, createLoupeActions, drawCanvasLens, lensCamera, lensSourceRect, sampleStack, useLoupe };
235
- export type { CanvasLoupeProps, DomLoupeProps, LensCamera, LoupeBubbleProps, LoupeGesturesProps, LoupeInputApi, LoupeState, SourceRect, TrialLoupeProps, UseLoupeOptions };
304
+ export { CanvasLoupe, DomLoupe, LOUPE_DEFAULTS, LOUPE_MAGNIFY_ID, LOUPE_PEEK_ID, LoupeBubble, LoupeGestures, TrialLoupe, createLoupeActions, drawCanvasLens, lensCamera, lensSourceRect, resolveLoupe, sampleStack, useLoupe };
305
+ export type { CanvasLoupeProps, DomLoupeProps, LensCamera, LoupeBubbleProps, LoupeGesturesProps, LoupeInputApi, LoupeOptions, LoupeRenderArgs, LoupeState, ResolvedLoupe, SourceRect, TrialLoupeProps, UseLoupeOptions };