@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.
- package/README.md +3 -3
- package/dist/_dts/{CanvasStackContext-D2jnIwfk.d.ts → CanvasStackContext-Cjy6I-Iv.d.ts} +4 -1
- package/dist/_dts/{Stage-CCWfQQWM.d.ts → Stage-D6t7o0pF.d.ts} +3 -2
- package/dist/_dts/{index-CsYqUHD3.d.ts → index-BTmaRy6a.d.ts} +10 -6
- package/dist/_dts/{types-CSm9jgol.d.ts → index-DCMA4Fy1.d.ts} +59 -113
- package/dist/_dts/{types-CRPSGFAp.d.ts → types-BUBSIZuV.d.ts} +8 -7
- package/dist/_dts/{useTrialState-CTZPgeZ7.d.ts → useTrialState-Bh8bzFgE.d.ts} +1 -1
- package/dist/canvas/index.d.ts +8 -6
- package/dist/canvas/index.js +6 -6
- package/dist/chrome/index.d.ts +7 -5
- package/dist/chrome/index.js +10 -9
- package/dist/chunk-2ES4W47N.js +8 -0
- package/dist/chunk-2ES4W47N.js.map +1 -0
- package/dist/{chunk-WPLAANH4.js → chunk-2N7UBSS2.js} +12 -12
- package/dist/chunk-2N7UBSS2.js.map +1 -0
- package/dist/chunk-4KSC7NXL.js +15491 -0
- package/dist/chunk-4KSC7NXL.js.map +1 -0
- package/dist/{chunk-7BO7HNGF.js → chunk-CEGFXTBD.js} +8 -61
- package/dist/chunk-CEGFXTBD.js.map +1 -0
- package/dist/{chunk-275JRRVD.js → chunk-E23Q6A3Y.js} +232 -37
- package/dist/chunk-E23Q6A3Y.js.map +1 -0
- package/dist/{chunk-GOZLNM4L.js → chunk-E6NARGU7.js} +5 -5
- package/dist/{chunk-GOZLNM4L.js.map → chunk-E6NARGU7.js.map} +1 -1
- package/dist/{chunk-IJJUK4FU.js → chunk-EESJUSYR.js} +5 -6
- package/dist/chunk-EESJUSYR.js.map +1 -0
- package/dist/{chunk-HXXTULDN.js → chunk-EFXRM6XQ.js} +8 -11
- package/dist/chunk-EFXRM6XQ.js.map +1 -0
- package/dist/chunk-F4ACIK7Z.js +210 -0
- package/dist/chunk-F4ACIK7Z.js.map +1 -0
- package/dist/{chunk-FMK7UQ6V.js → chunk-FB4MIZOO.js} +61 -44
- package/dist/chunk-FB4MIZOO.js.map +1 -0
- package/dist/{chunk-AWQG7FCC.js → chunk-FG3EXZDV.js} +3 -3
- package/dist/{chunk-AWQG7FCC.js.map → chunk-FG3EXZDV.js.map} +1 -1
- package/dist/{chunk-I5DUQ5HM.js → chunk-GAHELLJT.js} +75 -72
- package/dist/chunk-GAHELLJT.js.map +1 -0
- package/dist/{chunk-YT75VYRD.js → chunk-IBVRMHW5.js} +5 -5
- package/dist/{chunk-YT75VYRD.js.map → chunk-IBVRMHW5.js.map} +1 -1
- package/dist/{chunk-T5IBSPAM.js → chunk-JFOJESJF.js} +33 -23
- package/dist/chunk-JFOJESJF.js.map +1 -0
- package/dist/{chunk-RWNDDKOH.js → chunk-PMLZP7RT.js} +18 -15
- package/dist/chunk-PMLZP7RT.js.map +1 -0
- package/dist/{chunk-Y23G2VZL.js → chunk-READTDQX.js} +2 -2
- package/dist/chunk-READTDQX.js.map +1 -0
- package/dist/{chunk-JVBYV6TL.js → chunk-ROGJWDQA.js} +3 -3
- package/dist/{chunk-JVBYV6TL.js.map → chunk-ROGJWDQA.js.map} +1 -1
- package/dist/{chunk-ZIFPHIWZ.js → chunk-T6DLGEJB.js} +12 -14
- package/dist/chunk-T6DLGEJB.js.map +1 -0
- package/dist/{chunk-24W5VEJW.js → chunk-ULYYNWGP.js} +2 -2
- package/dist/{chunk-24W5VEJW.js.map → chunk-ULYYNWGP.js.map} +1 -1
- package/dist/{chunk-UNAZSLWE.js → chunk-VYVGVBGY.js} +17 -20
- package/dist/chunk-VYVGVBGY.js.map +1 -0
- package/dist/{chunk-KMJ7RWD3.js → chunk-WLMDTI2Q.js} +3 -3
- package/dist/{chunk-KMJ7RWD3.js.map → chunk-WLMDTI2Q.js.map} +1 -1
- package/dist/{chunk-J7OWWTCW.js → chunk-XE5HJOPL.js} +5 -6
- package/dist/chunk-XE5HJOPL.js.map +1 -0
- package/dist/chunk-XVUKDSYV.js +38 -0
- package/dist/chunk-XVUKDSYV.js.map +1 -0
- package/dist/{chunk-FZ7YFQN7.js → chunk-YCFKW5RX.js} +3 -3
- package/dist/chunk-YCFKW5RX.js.map +1 -0
- package/dist/{chunk-CQLQPQ4P.js → chunk-ZQIHJXP4.js} +2 -2
- package/dist/chunk-ZQIHJXP4.js.map +1 -0
- package/dist/config/index.d.ts +18 -10
- package/dist/config/index.js +4 -4
- package/dist/controls/index.d.ts +4 -7
- package/dist/controls/index.js +6 -5
- package/dist/dragdrop/index.d.ts +23 -3
- package/dist/dragdrop/index.js +4 -3
- package/dist/fonts/oswald-tabular-digits.woff2 +0 -0
- package/dist/index.d.ts +60 -714
- package/dist/index.js +357 -334
- package/dist/index.js.map +1 -1
- package/dist/job/index.d.ts +8 -0
- package/dist/job/index.js +1 -1
- package/dist/layers/index.d.ts +6 -5
- package/dist/layers/index.js +3 -2
- package/dist/loupe/index.d.ts +100 -30
- package/dist/loupe/index.js +585 -6
- package/dist/loupe/index.js.map +1 -1
- package/dist/overview/index.d.ts +4 -2
- package/dist/overview/index.js +15 -14
- package/dist/overview/index.js.map +1 -1
- package/dist/passthrough/weasel-canvas.d.ts +2 -0
- package/dist/passthrough/weasel-ui.d.ts +2 -2871
- package/dist/passthrough/weasel-ui.js +3 -2
- package/dist/primitives/index.d.ts +213 -3
- package/dist/primitives/index.js +8 -7
- package/dist/state/index.d.ts +7 -5
- package/dist/state/index.js +6 -6
- package/dist/styles.css +60 -44
- package/dist/surface/index.d.ts +10 -2
- package/dist/surface/index.js +1 -1
- package/dist/undo/index.d.ts +5 -3
- package/package.json +11 -11
- package/src/annotations/AnnotationOverlay.abandon.test.tsx +143 -0
- package/src/annotations/AnnotationOverlay.tsx +50 -31
- package/src/annotations/Annotations.overlay.test.tsx +31 -0
- package/src/annotations/capture.browser.test.ts +41 -0
- package/src/annotations/capture.ts +14 -7
- package/src/annotations/drawOne.ts +2 -2
- package/src/annotations/frac.test.ts +44 -1
- package/src/annotations/frac.ts +46 -18
- package/src/annotations/index.ts +1 -0
- package/src/annotations/paint.test.ts +74 -33
- package/src/annotations/paint.ts +70 -32
- package/src/annotations/store.test.ts +212 -2
- package/src/annotations/store.ts +130 -27
- package/src/annotations/svgNodes.test.ts +22 -10
- package/src/annotations/svgNodes.ts +3 -3
- package/src/annotations/types.ts +29 -10
- package/src/canvas/CameraInput.test.tsx +30 -0
- package/src/canvas/CameraInput.tsx +16 -15
- package/src/canvas/CanvasStack.tsx +5 -5
- package/src/canvas/CanvasStackContext.ts +4 -1
- package/src/canvas/Stage.tsx +3 -3
- package/src/canvas/cameraRegistry.ts +1 -0
- package/src/canvas/worldSpec.ts +3 -1
- package/src/chrome/builtins.test.ts +7 -6
- package/src/chrome/builtins.tsx +5 -1
- package/src/chrome/index.ts +1 -1
- package/src/chrome/merge.test.ts +5 -0
- package/src/chrome/merge.ts +4 -2
- package/src/chrome/regions/PaletteRegion.test.tsx +2 -3
- package/src/chrome/regions/PaletteRegion.tsx +3 -4
- package/src/chrome/regions/ViewportRegion.browser.test.less +6 -0
- package/src/chrome/regions/ViewportRegion.browser.test.tsx +38 -0
- package/src/chrome/regions/ViewportRegion.less +6 -0
- package/src/chrome/regions/ViewportRegion.tsx +10 -4
- package/src/chrome/types.ts +4 -2
- package/src/config/auto.ts +1 -0
- package/src/config/builder.ts +6 -0
- package/src/config/types.ts +2 -1
- package/src/controls/ControlPanel.test.tsx +37 -3
- package/src/controls/ControlPanel.tsx +12 -3
- package/src/dragdrop/DragDropRuntime.tsx +22 -13
- package/src/dragdrop/DragGhost.tsx +3 -0
- package/src/dragdrop/Palette.tsx +2 -0
- package/src/index.test.ts +5 -0
- package/src/index.ts +1 -1
- package/src/instrument/types.ts +0 -6
- package/src/job/useJob.ts +14 -9
- package/src/lab/Lab.tsx +5 -1
- package/src/lab/LabShell.less +1 -0
- package/src/lab/LabSwitcher.browser.test.tsx +27 -0
- package/src/lab/LabSwitcher.less +2 -0
- package/src/lab/LabZoom.tsx +4 -4
- package/src/lab/Workspace.tsx +48 -52
- package/src/loupe/AGENTS.md +28 -15
- package/src/loupe/CanvasLoupe.tsx +2 -3
- package/src/loupe/DomLoupe.tsx +1 -7
- package/src/loupe/Loupe.less +16 -0
- package/src/loupe/TrialLoupe.tsx +120 -57
- package/src/loupe/index.ts +1 -6
- package/src/loupe/types.test.ts +3 -3
- package/src/loupe/types.ts +24 -27
- package/src/loupe/useLoupe.test.tsx +29 -4
- package/src/loupe/useLoupe.ts +20 -17
- package/src/overview/OverviewMarks.tsx +12 -4
- package/src/overview/TrialOverview.tsx +3 -3
- package/src/passthrough/weasel-ui.test.ts +1 -1
- package/src/passthrough/weasel-ui.ts +1 -1
- package/src/primitives/FloatingPanel.tsx +7 -3
- package/src/primitives/JobProgress.less +1 -0
- package/src/primitives/Readout.test.tsx +2 -2
- package/src/primitives/Split.tsx +69 -41
- package/src/primitives/Toolbar.tsx +3 -3
- package/src/primitives/ZoomControl.less +1 -2
- package/src/specimen/Specimen.tsx +0 -1
- package/src/state/undock.ts +3 -0
- package/src/state/useOpenOnce.ts +20 -16
- package/src/state/view.ts +1 -0
- package/src/surface/index.ts +1 -1
- package/src/surface/useTiledSurface.test.tsx +14 -0
- package/src/surface/useTiledSurface.ts +11 -3
- package/src/trial/Trial.annotations.test.tsx +73 -0
- package/src/trial/Trial.less +0 -16
- package/src/trial/Trial.loupe.test.tsx +28 -11
- package/src/trial/Trial.tsx +74 -62
- package/src/trial/TrialChrome.tsx +6 -3
- package/src/trial/index.ts +2 -0
- package/src/trial/loupeSwitch.ts +15 -0
- package/dist/_dts/LayerList.d-DiuEArKq.d.ts +0 -83
- package/dist/_dts/PrefsRow.d-TOZ7BgD9.d.ts +0 -79
- package/dist/_dts/PropertyPanel.d-D-1paCbE.d.ts +0 -141
- package/dist/_dts/Select.d-Bensr_MT.d.ts +0 -579
- package/dist/_dts/index-B2Yj5aA0.d.ts +0 -274
- package/dist/chunk-275JRRVD.js.map +0 -1
- package/dist/chunk-4LJSC7MB.js +0 -143
- package/dist/chunk-4LJSC7MB.js.map +0 -1
- package/dist/chunk-7BO7HNGF.js.map +0 -1
- package/dist/chunk-CQLQPQ4P.js.map +0 -1
- package/dist/chunk-FMK7UQ6V.js.map +0 -1
- package/dist/chunk-FZ7YFQN7.js.map +0 -1
- package/dist/chunk-HXXTULDN.js.map +0 -1
- package/dist/chunk-I5DUQ5HM.js.map +0 -1
- package/dist/chunk-IJJUK4FU.js.map +0 -1
- package/dist/chunk-J7OWWTCW.js.map +0 -1
- package/dist/chunk-M7HP3FTK.js +0 -549
- package/dist/chunk-M7HP3FTK.js.map +0 -1
- package/dist/chunk-MIM5R4ZT.js +0 -14972
- package/dist/chunk-MIM5R4ZT.js.map +0 -1
- package/dist/chunk-RWNDDKOH.js.map +0 -1
- package/dist/chunk-T5IBSPAM.js.map +0 -1
- package/dist/chunk-UNAZSLWE.js.map +0 -1
- package/dist/chunk-WPLAANH4.js.map +0 -1
- package/dist/chunk-Y23G2VZL.js.map +0 -1
- package/dist/chunk-ZIFPHIWZ.js.map +0 -1
- package/src/primitives/useRovingTabIndex.test.ts +0 -48
- package/src/primitives/useRovingTabIndex.ts +0 -88
package/dist/job/index.d.ts
CHANGED
|
@@ -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
package/dist/layers/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
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 '
|
|
7
|
-
import '
|
|
6
|
+
import '../_dts/types-BUBSIZuV.js';
|
|
7
|
+
import '@weasel-js/quantity';
|
|
8
|
+
import '@weasel-js/geom';
|
|
8
9
|
import '../_dts/types-DJ79Tg5J.js';
|
package/dist/layers/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import '../chunk-2RVCB2PT.js';
|
|
2
|
-
export {
|
|
3
|
-
import '../chunk-
|
|
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
|
package/dist/loupe/index.d.ts
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
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 {
|
|
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 '
|
|
9
|
+
import '@weasel-js/ui';
|
|
10
10
|
import '@weasel-js/theme';
|
|
11
|
-
import '../_dts/types-
|
|
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
|
|
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,
|
|
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
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
view
|
|
181
|
-
|
|
182
|
-
|
|
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
|
|
188
|
-
*
|
|
189
|
-
*
|
|
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({
|
|
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
|
-
|
|
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({
|
|
302
|
+
declare function useLoupe({ options, hostRef, enabled, sample }: UseLoupeOptions): LoupeState;
|
|
233
303
|
|
|
234
|
-
export { CanvasLoupe, DomLoupe, LOUPE_MAGNIFY_ID, LOUPE_PEEK_ID, LoupeBubble, LoupeGestures,
|
|
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 };
|