@weasel-js/labkit 1.3.0 → 1.4.0-pre.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 +226 -55
- package/dist/_dts/CanvasStackContext-LnCfqNBA.d.ts +42 -0
- package/dist/_dts/DrawCommand-B3bskUsC.d.ts +564 -0
- package/dist/_dts/{PrefsForm-BYa6cWnO.d.ts → PrefsForm-BkUJZx0A.d.ts} +4 -1
- package/dist/_dts/fitViewToBounds-dZ2UDB6e.d.ts +21 -0
- package/dist/_dts/frac-C-2c72Ij.d.ts +735 -0
- package/dist/_dts/index-BDVzvRzQ.d.ts +236 -0
- package/dist/_dts/shapeKinds-Cx_rxwsa.d.ts +87 -0
- package/dist/_dts/{DrawCommand-DBB45NfN.d.ts → types-C-gh9Ap-.d.ts} +1 -582
- package/dist/_dts/{types-DCGEcMO_.d.ts → types-D6s4b7if.d.ts} +1 -1
- package/dist/_dts/{types-1Sdxy_Pv.d.ts → types-DYMaEvM5.d.ts} +26 -1
- package/dist/_dts/{useTrialState-CsGMjhu9.d.ts → useTrialState-gmMvZqPc.d.ts} +7 -2
- package/dist/canvas/index.d.ts +110 -26
- package/dist/canvas/index.js +5 -4
- package/dist/chrome/index.d.ts +9 -6
- package/dist/chrome/index.js +6 -6
- package/dist/chunk-2AYGEN57.js +32 -0
- package/dist/chunk-2AYGEN57.js.map +1 -0
- package/dist/chunk-6OEYTYML.js +669 -0
- package/dist/chunk-6OEYTYML.js.map +1 -0
- package/dist/{chunk-BMW4TDP5.js → chunk-AE5CNVRU.js} +3 -3
- package/dist/{chunk-BMW4TDP5.js.map → chunk-AE5CNVRU.js.map} +1 -1
- package/dist/{chunk-CPUJ3QXL.js → chunk-CQLQPQ4P.js} +2 -2
- package/dist/chunk-CQLQPQ4P.js.map +1 -0
- package/dist/chunk-CTRKTLYZ.js +33 -0
- package/dist/chunk-CTRKTLYZ.js.map +1 -0
- package/dist/chunk-E2UQVZ44.js +458 -0
- package/dist/chunk-E2UQVZ44.js.map +1 -0
- package/dist/{chunk-LGKRIUSW.js → chunk-ESIQNQ6K.js} +32 -7
- package/dist/chunk-ESIQNQ6K.js.map +1 -0
- package/dist/{chunk-JDROYQM3.js → chunk-HHGVISVZ.js} +130 -131
- package/dist/chunk-HHGVISVZ.js.map +1 -0
- package/dist/{chunk-BDJXIBRZ.js → chunk-HMFODCOX.js} +126 -29
- package/dist/chunk-HMFODCOX.js.map +1 -0
- package/dist/{chunk-QCICIHEO.js → chunk-L5QJOOLV.js} +839 -320
- package/dist/chunk-L5QJOOLV.js.map +1 -0
- package/dist/{chunk-3XXPU73K.js → chunk-M75ZU6ZZ.js} +9 -7
- package/dist/chunk-M75ZU6ZZ.js.map +1 -0
- package/dist/{chunk-QRYPXSGP.js → chunk-QB5SM4BM.js} +16 -8
- package/dist/chunk-QB5SM4BM.js.map +1 -0
- package/dist/chunk-RBGKL7NF.js +7128 -0
- package/dist/chunk-RBGKL7NF.js.map +1 -0
- package/dist/{chunk-WTI26YTM.js → chunk-TO2FUOKF.js} +40 -13
- package/dist/chunk-TO2FUOKF.js.map +1 -0
- package/dist/{chunk-4TMMVIDM.js → chunk-XJ6N32QP.js} +50 -6
- package/dist/chunk-XJ6N32QP.js.map +1 -0
- package/dist/controls/index.d.ts +4 -28
- package/dist/controls/index.js +3 -3
- package/dist/dragdrop/index.d.ts +9 -5
- package/dist/dragdrop/index.js +3 -3
- package/dist/index.d.ts +517 -234
- package/dist/index.js +1769 -143
- package/dist/index.js.map +1 -1
- package/dist/layers/index.d.ts +6 -5
- package/dist/layers/index.js +3 -3
- package/dist/loupe/index.d.ts +187 -0
- package/dist/loupe/index.js +7 -0
- package/dist/loupe/index.js.map +1 -0
- package/dist/passthrough/weasel-canvas.d.ts +3 -1
- package/dist/passthrough/weasel-canvas.js +1 -1
- package/dist/passthrough/weasel-ui.d.ts +138 -91
- package/dist/passthrough/weasel-ui.js +2 -2
- package/dist/primitives/index.d.ts +3 -1
- package/dist/primitives/index.js +5 -5
- package/dist/state/index.d.ts +3 -3
- package/dist/state/index.js +2 -2
- package/dist/styles.css +229 -1
- package/dist/surface/index.d.ts +18 -2
- package/dist/surface/index.js +2 -2
- package/dist/ui/layers/index.js +2 -2
- package/dist/undo/index.d.ts +5 -4
- package/package.json +14 -7
- package/src/annotations/AnnotationOverlay.tsx +205 -0
- package/src/annotations/AnnotationTargets.tsx +37 -0
- package/src/annotations/Annotations.less +129 -0
- package/src/annotations/Annotations.meaning.test.tsx +111 -0
- package/src/annotations/Annotations.overlay.test.tsx +142 -0
- package/src/annotations/AnnotationsContext.ts +49 -0
- package/src/annotations/ExportMenu.test.tsx +86 -0
- package/src/annotations/ExportMenu.tsx +182 -0
- package/src/annotations/MarkList.tsx +75 -0
- package/src/annotations/capture.test.ts +140 -0
- package/src/annotations/capture.ts +237 -0
- package/src/annotations/drawOne.test.ts +56 -0
- package/src/annotations/drawOne.ts +47 -0
- package/src/annotations/frac.test.ts +59 -0
- package/src/annotations/frac.ts +66 -0
- package/src/annotations/history.test.ts +82 -0
- package/src/annotations/history.ts +118 -0
- package/src/annotations/index.ts +37 -0
- package/src/annotations/paint.test.ts +125 -0
- package/src/annotations/paint.ts +130 -0
- package/src/annotations/staleness.test.ts +56 -0
- package/src/annotations/staleness.ts +41 -0
- package/src/annotations/store.test.ts +247 -0
- package/src/annotations/store.ts +347 -0
- package/src/annotations/svgNodes.test.ts +77 -0
- package/src/annotations/svgNodes.ts +74 -0
- package/src/annotations/toolMap.test.ts +36 -0
- package/src/annotations/toolMap.ts +54 -0
- package/src/annotations/types.ts +229 -0
- package/src/annotations/view.test.ts +37 -0
- package/src/annotations/view.ts +40 -0
- package/src/canvas/AGENTS.md +55 -5
- package/src/canvas/CanvasStack.test.tsx +27 -1
- package/src/canvas/CanvasStack.tsx +29 -4
- package/src/canvas/CanvasStackContext.ts +23 -4
- package/src/canvas/camera.test.ts +78 -0
- package/src/canvas/camera.ts +62 -0
- package/src/canvas/canvasCoords.test.ts +26 -0
- package/src/canvas/canvasCoords.ts +20 -7
- package/src/canvas/index.ts +16 -1
- package/src/canvas/useLayerScheduler.ts +7 -3
- package/src/canvas/usePanZoom.test.ts +36 -5
- package/src/canvas/usePanZoom.ts +20 -15
- package/src/canvas/worldSpec.test.ts +63 -0
- package/src/canvas/worldSpec.ts +48 -0
- package/src/chrome/builtins.test.ts +31 -1
- package/src/chrome/builtins.tsx +63 -19
- package/src/chrome/regions/PaletteRegion.test.tsx +22 -1
- package/src/chrome/regions/PaletteRegion.tsx +4 -0
- package/src/chrome/regions/SidebarRegion.tsx +37 -13
- package/src/chrome/regions/ToolbarRegion.tsx +2 -1
- package/src/chrome/regions/ViewportRegion.tsx +9 -1
- package/src/chrome/regions/regions.test.tsx +6 -1
- package/src/chrome/types.ts +20 -0
- package/src/controls/ControlPanel.test.tsx +38 -0
- package/src/controls/ControlPanel.tsx +50 -3
- package/src/dragdrop/DragDropRuntime.tsx +8 -2
- package/src/dragdrop/dragDrop.test.tsx +29 -2
- package/src/index.test.ts +23 -0
- package/src/index.ts +93 -4
- package/src/instrument/SineWave.smoke.test.tsx +1 -0
- package/src/instrument/types.ts +24 -1
- package/src/lab/Lab.surface.test.tsx +162 -0
- package/src/lab/Lab.tsx +102 -17
- package/src/lab/Lab.undock.test.tsx +85 -0
- package/src/lab/LabFullChrome.stories.tsx +20 -0
- package/src/lab/LabShell.less +11 -0
- package/src/lab/Workspace.less +73 -0
- package/src/lab/Workspace.surface.test.tsx +2 -0
- package/src/lab/Workspace.tsx +97 -8
- package/src/lab/index.ts +1 -1
- package/src/lab/panelHost.ts +37 -0
- package/src/loupe/AGENTS.md +49 -0
- package/src/loupe/CanvasLoupe.tsx +83 -0
- package/src/loupe/DomLoupe.tsx +62 -0
- package/src/loupe/Loupe.less +38 -0
- package/src/loupe/LoupeBubble.tsx +32 -0
- package/src/loupe/TrialLoupe.tsx +93 -0
- package/src/loupe/canvasLens.test.ts +205 -0
- package/src/loupe/canvasLens.ts +141 -0
- package/src/loupe/index.ts +19 -0
- package/src/loupe/types.test.ts +29 -0
- package/src/loupe/types.ts +90 -0
- package/src/loupe/useHostSize.ts +30 -0
- package/src/loupe/useLoupe.test.tsx +197 -0
- package/src/loupe/useLoupe.ts +189 -0
- package/src/passthrough/weasel-ui.ts +3 -0
- package/src/primitives/FloatingPanel.test.tsx +76 -1
- package/src/primitives/FloatingPanel.tsx +19 -3
- package/src/primitives/ScaleIndicator.test.tsx +7 -2
- package/src/primitives/Sidebar.less +18 -0
- package/src/primitives/Toolbar.less +8 -0
- package/src/primitives/Toolbar.tsx +5 -0
- package/src/primitives/useRovingTabIndex.test.ts +21 -0
- package/src/primitives/useRovingTabIndex.ts +26 -17
- package/src/state/document.test.ts +23 -0
- package/src/state/document.ts +14 -2
- package/src/state/index.ts +2 -0
- package/src/state/store.test.ts +24 -0
- package/src/state/store.ts +35 -1
- package/src/state/types.ts +11 -0
- package/src/state/undock.test.ts +40 -0
- package/src/state/undock.ts +39 -0
- package/src/styles.less +2 -0
- package/src/surface/SurfaceContext.ts +4 -0
- package/src/surface/index.ts +8 -3
- package/src/surface/useSurfaceTile.test.tsx +2 -0
- package/src/surface/useSurfaceTile.ts +7 -1
- package/src/surface/useTiledSurface.test.tsx +58 -0
- package/src/surface/useTiledSurface.ts +38 -3
- package/src/trial/Trial.annotations.persist.test.tsx +166 -0
- package/src/trial/Trial.annotations.test.tsx +121 -0
- package/src/trial/Trial.canvas.test.tsx +76 -1
- package/src/trial/Trial.less +19 -0
- package/src/trial/Trial.loupe.test.tsx +128 -0
- package/src/trial/Trial.stories.tsx +1 -0
- package/src/trial/Trial.test.tsx +12 -0
- package/src/trial/Trial.trialId.test.tsx +36 -0
- package/src/trial/Trial.tsx +215 -40
- package/src/trial/TrialChrome.tsx +35 -0
- package/src/trial/UndockedSections.tsx +65 -0
- package/src/trial/trialOps.test.ts +21 -0
- package/src/trial/trialOps.ts +5 -3
- package/dist/_dts/types-BttTIent.d.ts +0 -314
- package/dist/chunk-3XXPU73K.js.map +0 -1
- package/dist/chunk-4TMMVIDM.js.map +0 -1
- package/dist/chunk-6X5RBC6G.js +0 -366
- package/dist/chunk-6X5RBC6G.js.map +0 -1
- package/dist/chunk-BDJXIBRZ.js.map +0 -1
- package/dist/chunk-CPUJ3QXL.js.map +0 -1
- package/dist/chunk-JDROYQM3.js.map +0 -1
- package/dist/chunk-LGKRIUSW.js.map +0 -1
- package/dist/chunk-QCICIHEO.js.map +0 -1
- package/dist/chunk-QRYPXSGP.js.map +0 -1
- package/dist/chunk-RGT4EJIB.js +0 -6961
- package/dist/chunk-RGT4EJIB.js.map +0 -1
- package/dist/chunk-T66HU3HX.js +0 -17
- package/dist/chunk-T66HU3HX.js.map +0 -1
- package/dist/chunk-WTI26YTM.js.map +0 -1
package/dist/layers/index.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { E as LayerDescriptor } from '../_dts/frac-C-2c72Ij.js';
|
|
2
|
+
export { B as LayerCapability } from '../_dts/frac-C-2c72Ij.js';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import 'react';
|
|
5
|
-
import '../_dts/types-
|
|
6
|
-
import '../_dts/PrefsForm-
|
|
7
|
-
import '../_dts/types-
|
|
5
|
+
import '../_dts/types-D6s4b7if.js';
|
|
6
|
+
import '../_dts/PrefsForm-BkUJZx0A.js';
|
|
7
|
+
import '../_dts/types-DYMaEvM5.js';
|
|
8
8
|
import '../_dts/types-DJ79Tg5J.js';
|
|
9
|
+
import '../_dts/types-C-gh9Ap-.js';
|
|
9
10
|
|
|
10
11
|
/** Props for `<LayerList>`. */
|
|
11
12
|
interface LayerListProps {
|
package/dist/layers/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { LayerList } from '../chunk-
|
|
1
|
+
export { LayerList } from '../chunk-AE5CNVRU.js';
|
|
2
2
|
import '../chunk-SBXNQW4G.js';
|
|
3
|
-
import '../chunk-
|
|
4
|
-
import '../chunk-
|
|
3
|
+
import '../chunk-RBGKL7NF.js';
|
|
4
|
+
import '../chunk-L5QJOOLV.js';
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ae as LoupeMode, V as ViewTransform, W as WorldFrame, c as WorldSpec, a2 as ViewportSize, K as LoupeRenderArgs, N as ResolvedLoupe } from '../_dts/frac-C-2c72Ij.js';
|
|
3
|
+
export { L as LOUPE_DEFAULTS, G as LoupeCapability, J as LoupeDeclaration, ab as resolveLoupe } from '../_dts/frac-C-2c72Ij.js';
|
|
4
|
+
import { c as CanvasStackSurface, C as CanvasLayerDescriptor } from '../_dts/CanvasStackContext-LnCfqNBA.js';
|
|
5
|
+
import { RefObject, ReactNode } from 'react';
|
|
6
|
+
import '../_dts/types-D6s4b7if.js';
|
|
7
|
+
import '../_dts/PrefsForm-BkUJZx0A.js';
|
|
8
|
+
import '../_dts/types-DYMaEvM5.js';
|
|
9
|
+
import '../_dts/types-DJ79Tg5J.js';
|
|
10
|
+
import '../_dts/types-C-gh9Ap-.js';
|
|
11
|
+
|
|
12
|
+
/** A point on the magnified surface, in its own CSS pixels. */
|
|
13
|
+
interface LoupePoint {
|
|
14
|
+
x: number;
|
|
15
|
+
y: number;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** Props for `<CanvasLoupe>`. */
|
|
19
|
+
interface CanvasLoupeProps {
|
|
20
|
+
aim: LoupePoint;
|
|
21
|
+
factor: number;
|
|
22
|
+
mode: LoupeMode;
|
|
23
|
+
diameter: number;
|
|
24
|
+
/** The stack being magnified: its layers, its pixels, and its measured box. */
|
|
25
|
+
surface: CanvasStackSurface;
|
|
26
|
+
view: ViewTransform;
|
|
27
|
+
frame: WorldFrame;
|
|
28
|
+
worldSpec?: WorldSpec;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Paints a lens over a `<CanvasStack>` by re-drawing the stack's layers through
|
|
32
|
+
* a zoomed camera — so the magnified content is as sharp as the original, at
|
|
33
|
+
* any factor. `pixel` mode enlarges what the stack presented instead.
|
|
34
|
+
*/
|
|
35
|
+
declare function CanvasLoupe({ aim, factor, mode, diameter, surface, view, frame, worldSpec, }: CanvasLoupeProps): react_jsx_runtime.JSX.Element;
|
|
36
|
+
|
|
37
|
+
/** The camera a round lens of `diameter` shows a magnified region through, and
|
|
38
|
+
* the coordinate system it is read in — the instrument's own `WorldSpec`,
|
|
39
|
+
* resolved against the lens rather than the stack. */
|
|
40
|
+
interface LensCamera {
|
|
41
|
+
view: ViewTransform;
|
|
42
|
+
frame: WorldFrame;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* What a lens aimed at `aim` renders the stack's layers through.
|
|
46
|
+
*
|
|
47
|
+
* The lens is its own viewport, so the world spec resolves against its box: an
|
|
48
|
+
* instrument centred on its viewport is centred in the lens too.
|
|
49
|
+
*/
|
|
50
|
+
declare function lensCamera(aim: LoupePoint, outer: ViewTransform, outerFrame: WorldFrame, factor: number, diameter: number, worldSpec?: WorldSpec): LensCamera;
|
|
51
|
+
/** A rectangle in a backing store's own device pixels. */
|
|
52
|
+
interface SourceRect {
|
|
53
|
+
sx: number;
|
|
54
|
+
sy: number;
|
|
55
|
+
sw: number;
|
|
56
|
+
sh: number;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The region a pixel-mode lens copies out of a presented canvas: the `diameter
|
|
60
|
+
* / factor` CSS px around `aim`, in that canvas' backing-store pixels.
|
|
61
|
+
*/
|
|
62
|
+
declare function lensSourceRect(aim: LoupePoint, factor: number, diameter: number, dpr: number): SourceRect;
|
|
63
|
+
/**
|
|
64
|
+
* The colour a stack presents at a point: the topmost visible layer with
|
|
65
|
+
* anything opaque there, or `null` when every layer is transparent — which is
|
|
66
|
+
* the honest answer for a point showing nothing but the workspace behind.
|
|
67
|
+
*/
|
|
68
|
+
declare function sampleStack(layers: readonly CanvasLayerDescriptor[], canvases: Map<string, HTMLCanvasElement>, p: LoupePoint, dpr: number): string | null;
|
|
69
|
+
/** Redraw the stack into a lens' own canvas. `mode` decides whether the layers
|
|
70
|
+
* are re-run at the lens camera or their presented pixels are enlarged. */
|
|
71
|
+
declare function drawCanvasLens(ctx: CanvasRenderingContext2D, opts: {
|
|
72
|
+
aim: LoupePoint;
|
|
73
|
+
factor: number;
|
|
74
|
+
diameter: number;
|
|
75
|
+
dpr: number;
|
|
76
|
+
mode: 'vector' | 'pixel';
|
|
77
|
+
outer: ViewTransform;
|
|
78
|
+
outerFrame?: WorldFrame;
|
|
79
|
+
worldSpec?: WorldSpec;
|
|
80
|
+
layers: readonly CanvasLayerDescriptor[];
|
|
81
|
+
canvases: Map<string, HTMLCanvasElement>;
|
|
82
|
+
}): void;
|
|
83
|
+
|
|
84
|
+
/** Props for `<DomLoupe>`. */
|
|
85
|
+
interface DomLoupeProps {
|
|
86
|
+
aim: LoupePoint;
|
|
87
|
+
factor: number;
|
|
88
|
+
mode: LoupeMode;
|
|
89
|
+
diameter: number;
|
|
90
|
+
/** The host the instrument draws into, which the stage reproduces. */
|
|
91
|
+
size: ViewportSize;
|
|
92
|
+
/** The trial's own camera. */
|
|
93
|
+
view: ViewTransform;
|
|
94
|
+
frame?: WorldFrame;
|
|
95
|
+
state: unknown;
|
|
96
|
+
config: unknown;
|
|
97
|
+
render: (args: LoupeRenderArgs) => React.ReactNode;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Paints a lens over DOM content by asking the instrument to draw itself again
|
|
101
|
+
* at a magnified camera.
|
|
102
|
+
*
|
|
103
|
+
* The stage is a full copy of the host, so the instrument's own layout still
|
|
104
|
+
* holds; the camera is composed about the aimed point, which keeps that point
|
|
105
|
+
* where it already was, and the stage is then slid by `diameter / 2 - aim` to
|
|
106
|
+
* bring it to the middle of the lens.
|
|
107
|
+
*/
|
|
108
|
+
declare function DomLoupe({ aim, factor, mode, diameter, size, view, frame, state, config, render, }: DomLoupeProps): react_jsx_runtime.JSX.Element;
|
|
109
|
+
|
|
110
|
+
/** Props for `<LoupeBubble>`. */
|
|
111
|
+
interface LoupeBubbleProps {
|
|
112
|
+
/** Where the lens is aimed, in its container's own pixels. */
|
|
113
|
+
aim: LoupePoint;
|
|
114
|
+
diameter: number;
|
|
115
|
+
hostRef?: RefObject<HTMLDivElement | null>;
|
|
116
|
+
children: ReactNode;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* The lens itself: a circle centred on the aimed point, clipping whatever a
|
|
120
|
+
* painter draws into it.
|
|
121
|
+
*
|
|
122
|
+
* It takes no pointer events, so the pan, the wheel and anything underneath
|
|
123
|
+
* keep working while it is up — and it is `aria-hidden`, since it magnifies
|
|
124
|
+
* content already on the page rather than adding any.
|
|
125
|
+
*/
|
|
126
|
+
declare function LoupeBubble({ aim, diameter, hostRef, children }: LoupeBubbleProps): react_jsx_runtime.JSX.Element;
|
|
127
|
+
|
|
128
|
+
/** Props for `<TrialLoupe>`. */
|
|
129
|
+
interface TrialLoupeProps {
|
|
130
|
+
capability: ResolvedLoupe;
|
|
131
|
+
/** Whether the trial's loupe is turned on. Hold-to-peek shows it anyway. */
|
|
132
|
+
enabled: boolean;
|
|
133
|
+
state: unknown;
|
|
134
|
+
config: unknown;
|
|
135
|
+
/** The trial's own camera. */
|
|
136
|
+
view: ViewTransform;
|
|
137
|
+
worldSpec?: WorldSpec;
|
|
138
|
+
/** The element the lens tracks. A loupe mounted inside a `<CanvasStack>`
|
|
139
|
+
* takes the stack's own element instead, and this goes unused. */
|
|
140
|
+
hostRef?: RefObject<HTMLElement | null>;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* A trial's loupe, painted by whichever painter suits its content: the canvas
|
|
144
|
+
* stack it is mounted inside, or the instrument's own `render` at a magnified
|
|
145
|
+
* camera.
|
|
146
|
+
*/
|
|
147
|
+
declare function TrialLoupe({ capability, enabled, state, config, view, worldSpec, hostRef, }: TrialLoupeProps): react_jsx_runtime.JSX.Element | null;
|
|
148
|
+
|
|
149
|
+
/** Options for {@link useLoupe}. */
|
|
150
|
+
interface UseLoupeOptions {
|
|
151
|
+
capability: ResolvedLoupe;
|
|
152
|
+
/** The element the lens tracks the pointer across. */
|
|
153
|
+
hostRef: RefObject<HTMLElement | null>;
|
|
154
|
+
/** Whether the loupe is turned on. Hold-to-peek shows it regardless. */
|
|
155
|
+
enabled: boolean;
|
|
156
|
+
/** Hex colour at a host point. Omitted, the loupe reports no colour — which
|
|
157
|
+
* is the honest answer for a surface with no pixels to read. */
|
|
158
|
+
sample?: (p: LoupePoint) => string | null;
|
|
159
|
+
}
|
|
160
|
+
/** A loupe as a React view reads it. */
|
|
161
|
+
interface LoupeState {
|
|
162
|
+
/** Whether the lens should be drawn. */
|
|
163
|
+
visible: boolean;
|
|
164
|
+
/** Where it is aimed, in the host's own pixels. */
|
|
165
|
+
aim: LoupePoint;
|
|
166
|
+
factor: number;
|
|
167
|
+
mode: LoupeMode;
|
|
168
|
+
color: string | null;
|
|
169
|
+
setMode: (mode: LoupeMode) => void;
|
|
170
|
+
setFactor: (factor: number) => void;
|
|
171
|
+
/** Sample what the lens shows at a point inside it. */
|
|
172
|
+
pick: (p?: LoupePoint) => string | null;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Binds `@weasel-js/loupe`'s model to a host element and drives it from the
|
|
176
|
+
* pointer, the peek key and the wheel.
|
|
177
|
+
*
|
|
178
|
+
* These are plain listeners rather than gesture bindings because labkit trials
|
|
179
|
+
* do not route input through the dispatcher — see the loupe entry under
|
|
180
|
+
* "Selection, actions & UI panels" in `docs/TODO.md`. They are all in this one
|
|
181
|
+
* hook so that when trial input does go through it, this is the only file to
|
|
182
|
+
* rewrite.
|
|
183
|
+
*/
|
|
184
|
+
declare function useLoupe({ capability, hostRef, enabled, sample }: UseLoupeOptions): LoupeState;
|
|
185
|
+
|
|
186
|
+
export { CanvasLoupe, DomLoupe, LoupeBubble, LoupeRenderArgs, ResolvedLoupe, TrialLoupe, drawCanvasLens, lensCamera, lensSourceRect, sampleStack, useLoupe };
|
|
187
|
+
export type { CanvasLoupeProps, DomLoupeProps, LensCamera, LoupeBubbleProps, LoupeState, SourceRect, TrialLoupeProps, UseLoupeOptions };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { CanvasLoupe, DomLoupe, LOUPE_DEFAULTS, LoupeBubble, TrialLoupe, drawCanvasLens, lensCamera, lensSourceRect, resolveLoupe, sampleStack, useLoupe } from '../chunk-E2UQVZ44.js';
|
|
2
|
+
import '../chunk-CTRKTLYZ.js';
|
|
3
|
+
import '../chunk-2AYGEN57.js';
|
|
4
|
+
import '../chunk-CQLQPQ4P.js';
|
|
5
|
+
import '../chunk-L5QJOOLV.js';
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { N as Node,
|
|
1
|
+
import { N as Node, P as Path, S as Scene } from '../_dts/types-C-gh9Ap-.js';
|
|
2
|
+
import { V as View, D as DrawCommand, P as PathDrawCommand } from '../_dts/DrawCommand-B3bskUsC.js';
|
|
2
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
4
|
import { Ref } from 'react';
|
|
5
|
+
import { B as Bounds, V as ViewportDims } from '../_dts/fitViewToBounds-dZ2UDB6e.js';
|
|
4
6
|
|
|
5
7
|
/**
|
|
6
8
|
* NodeShape — the **shape trait's** registry. Each trait of a node
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { FALLBACK_FIT_VIEW, MinimapCanvas, SceneViewCanvas, buildSceneViewCommands, computeFitView, computeIndicatorCommand, renderSceneToCanvas } from '../chunk-
|
|
1
|
+
export { FALLBACK_FIT_VIEW, MinimapCanvas, SceneViewCanvas, buildSceneViewCommands, computeFitView, computeIndicatorCommand, renderSceneToCanvas } from '../chunk-L5QJOOLV.js';
|
|
2
2
|
//# sourceMappingURL=weasel-canvas.js.map
|
|
3
3
|
//# sourceMappingURL=weasel-canvas.js.map
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import { T as ToolPrefLeaf, a as ToolPrefGroup } from '../_dts/PrefsForm-
|
|
2
|
-
export { b as BuiltinPref, c as PrefBoolean, d as PrefBooleanControl, e as PrefColor, f as PrefCustom, g as PrefEnum, h as PrefEnumControl, i as PrefEnumEncoding, j as PrefKind, k as PrefNumber, l as PrefNumberControl, m as PrefNumberUnit, n as PrefObject, o as PrefPaint, p as PrefRenderContext, P as PrefRenderer, q as PrefString, r as PrefStringControl } from '../_dts/PrefsForm-
|
|
1
|
+
import { T as ToolPrefLeaf, a as ToolPrefGroup } from '../_dts/PrefsForm-BkUJZx0A.js';
|
|
2
|
+
export { b as BuiltinPref, c as PrefBoolean, d as PrefBooleanControl, e as PrefColor, f as PrefCustom, g as PrefEnum, h as PrefEnumControl, i as PrefEnumEncoding, j as PrefKind, k as PrefNumber, l as PrefNumberControl, m as PrefNumberUnit, n as PrefObject, o as PrefPaint, p as PrefRenderContext, P as PrefRenderer, q as PrefString, r as PrefStringControl } from '../_dts/PrefsForm-BkUJZx0A.js';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import * as react from 'react';
|
|
5
|
-
import { MutableRefObject, ReactNode, CSSProperties, ButtonHTMLAttributes, ReactElement, KeyboardEvent, PointerEvent as PointerEvent$1, RefCallback
|
|
5
|
+
import { MutableRefObject, ReactNode, CSSProperties, ButtonHTMLAttributes, ReactElement, KeyboardEvent, RefObject, PointerEvent as PointerEvent$1, RefCallback } from 'react';
|
|
6
6
|
export { LayerStack, LayerStackItem, LayerStackProps } from '../ui/layers/index.js';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { O as Op, a as NodeId, P as Path, S as Scene, H as History } from '../_dts/types-C-gh9Ap-.js';
|
|
8
|
+
import { V as View, D as DrawCommand } from '../_dts/DrawCommand-B3bskUsC.js';
|
|
9
|
+
import { B as Bounds } from '../_dts/fitViewToBounds-dZ2UDB6e.js';
|
|
10
|
+
import { K as KitInsertShape } from '../_dts/shapeKinds-Cx_rxwsa.js';
|
|
11
|
+
import { TextFieldProps, ValidationResult, CheckboxProps as CheckboxProps$1, SwitchProps as SwitchProps$1, TabProps as TabProps$1, TabListProps as TabListProps$1, TabPanelProps as TabPanelProps$1, TabsProps as TabsProps$1, RadioProps as RadioProps$1, RadioGroupProps as RadioGroupProps$1, NumberFieldProps as NumberFieldProps$1, SelectProps as SelectProps$1, ListBoxItemProps, ComboBoxProps as ComboBoxProps$1, SliderProps as SliderProps$1, ModalOverlayProps, DialogProps as DialogProps$1, PopoverProps } from 'react-aria-components';
|
|
12
|
+
export { DialogTrigger as CalloutTrigger } from 'react-aria-components';
|
|
9
13
|
|
|
10
14
|
/**
|
|
11
15
|
* Namespaced, opt-in console tracing. Off by default; production builds
|
|
@@ -1037,86 +1041,6 @@ interface PasteSpec {
|
|
|
1037
1041
|
* the `Action` type. */
|
|
1038
1042
|
type GestureSpec = KeySpec$1 | KeyHeldSpec | WheelSpec | ClickSpec | DoubleClickSpec | ContextMenuSpec | DragSpec | PointerDownSpec | LongPressSpec | MultiTouchSpec | MultiTouchTapSpec | DropSpec | PasteSpec;
|
|
1039
1043
|
|
|
1040
|
-
/**
|
|
1041
|
-
* The kit's built-in shape kinds — one table, every other spelling derived.
|
|
1042
|
-
*
|
|
1043
|
-
* Lives in `core/` rather than beside the shape tools because both layers ask
|
|
1044
|
-
* questions of the same set: the interactions layer decides whether
|
|
1045
|
-
* `insertAction` can paint a live preview for a kind, and the canvas layer
|
|
1046
|
-
* decides which shape tools `useBuiltinShapeTools` mounts and what
|
|
1047
|
-
* `BUNDLE_TOOLS` / `defaultNodeRouting` / `defaultNodeProperties` enumerate.
|
|
1048
|
-
*
|
|
1049
|
-
* This module imports nothing on purpose: `useBuiltinShapeTools` imports the
|
|
1050
|
-
* package barrel, so anything barrel-reachable that needs these lists at
|
|
1051
|
-
* module-evaluation time must not route through it.
|
|
1052
|
-
*/
|
|
1053
|
-
/** What the kit knows about one built-in shape kind. */
|
|
1054
|
-
interface ShapeKindDescriptor {
|
|
1055
|
-
/** Mounted as a built-in shape tool by `useBuiltinShapeTools`, and so a
|
|
1056
|
-
* member of `BuiltinShapeToolId` / `KIT_SHAPE_KINDS`. `image` is false:
|
|
1057
|
-
* `useImageTool` needs a `src` and can't be auto-mounted. */
|
|
1058
|
-
readonly tool: boolean;
|
|
1059
|
-
/** `insertAction` emits an `insertPreview` overlay for this kind, and the
|
|
1060
|
-
* dispatcher overlay layer knows how to draw it. Kinds without one still
|
|
1061
|
-
* commit; they just have no live drag preview (`pen` and `lasso` don't
|
|
1062
|
-
* route through `insertAction` at all). */
|
|
1063
|
-
readonly insertPreview: boolean;
|
|
1064
|
-
}
|
|
1065
|
-
/**
|
|
1066
|
-
* Declaration order is the enumeration order of every derived list —
|
|
1067
|
-
* `KIT_SHAPE_KINDS`, and through it `defaultNodeRouting` /
|
|
1068
|
-
* `defaultNodeProperties` / `BUNDLE_TOOLS.exhaustive`.
|
|
1069
|
-
*/
|
|
1070
|
-
declare const SHAPE_KINDS: {
|
|
1071
|
-
readonly rect: {
|
|
1072
|
-
readonly tool: true;
|
|
1073
|
-
readonly insertPreview: true;
|
|
1074
|
-
};
|
|
1075
|
-
readonly ellipse: {
|
|
1076
|
-
readonly tool: true;
|
|
1077
|
-
readonly insertPreview: true;
|
|
1078
|
-
};
|
|
1079
|
-
readonly line: {
|
|
1080
|
-
readonly tool: true;
|
|
1081
|
-
readonly insertPreview: true;
|
|
1082
|
-
};
|
|
1083
|
-
readonly polygon: {
|
|
1084
|
-
readonly tool: true;
|
|
1085
|
-
readonly insertPreview: true;
|
|
1086
|
-
};
|
|
1087
|
-
readonly star: {
|
|
1088
|
-
readonly tool: true;
|
|
1089
|
-
readonly insertPreview: true;
|
|
1090
|
-
};
|
|
1091
|
-
readonly pen: {
|
|
1092
|
-
readonly tool: true;
|
|
1093
|
-
readonly insertPreview: false;
|
|
1094
|
-
};
|
|
1095
|
-
readonly pencil: {
|
|
1096
|
-
readonly tool: true;
|
|
1097
|
-
readonly insertPreview: true;
|
|
1098
|
-
};
|
|
1099
|
-
readonly lasso: {
|
|
1100
|
-
readonly tool: true;
|
|
1101
|
-
readonly insertPreview: false;
|
|
1102
|
-
};
|
|
1103
|
-
readonly text: {
|
|
1104
|
-
readonly tool: true;
|
|
1105
|
-
readonly insertPreview: true;
|
|
1106
|
-
};
|
|
1107
|
-
readonly image: {
|
|
1108
|
-
readonly tool: false;
|
|
1109
|
-
readonly insertPreview: true;
|
|
1110
|
-
};
|
|
1111
|
-
};
|
|
1112
|
-
/** The keys of a shape-kind table whose descriptor sets `F` to `true`. */
|
|
1113
|
-
type ShapeKindsWhere<T, F extends keyof ShapeKindDescriptor> = {
|
|
1114
|
-
[K in keyof T]: T[K] extends Record<F, true> ? K : never;
|
|
1115
|
-
}[keyof T];
|
|
1116
|
-
/** The insert kinds the kit's dispatcher overlay layer knows how to render.
|
|
1117
|
-
* Consumer-defined kinds fall outside it: no live preview, commit unaffected. */
|
|
1118
|
-
type KitInsertShape = ShapeKindsWhere<typeof SHAPE_KINDS, 'insertPreview'>;
|
|
1119
|
-
|
|
1120
1044
|
/** A 2D point in either world or screen coordinates. */
|
|
1121
1045
|
interface Point2 {
|
|
1122
1046
|
x: number;
|
|
@@ -1718,10 +1642,59 @@ interface PoseProjection<TPose> {
|
|
|
1718
1642
|
supportsRotation?(pose: TPose): boolean;
|
|
1719
1643
|
}
|
|
1720
1644
|
|
|
1645
|
+
/** All easings in one bag — useful for demos / pickers. */
|
|
1646
|
+
declare const EASINGS: {
|
|
1647
|
+
readonly linear: EasingFn;
|
|
1648
|
+
readonly easeInQuad: EasingFn;
|
|
1649
|
+
readonly easeOutQuad: EasingFn;
|
|
1650
|
+
readonly easeInOutQuad: EasingFn;
|
|
1651
|
+
readonly easeInCubic: EasingFn;
|
|
1652
|
+
readonly easeOutCubic: EasingFn;
|
|
1653
|
+
readonly easeInOutCubic: EasingFn;
|
|
1654
|
+
readonly easeInQuart: EasingFn;
|
|
1655
|
+
readonly easeOutQuart: EasingFn;
|
|
1656
|
+
readonly easeInOutQuart: EasingFn;
|
|
1657
|
+
readonly easeInQuint: EasingFn;
|
|
1658
|
+
readonly easeOutQuint: EasingFn;
|
|
1659
|
+
readonly easeInOutQuint: EasingFn;
|
|
1660
|
+
readonly easeInSine: EasingFn;
|
|
1661
|
+
readonly easeOutSine: EasingFn;
|
|
1662
|
+
readonly easeInOutSine: EasingFn;
|
|
1663
|
+
readonly easeInExpo: EasingFn;
|
|
1664
|
+
readonly easeOutExpo: EasingFn;
|
|
1665
|
+
readonly easeInOutExpo: EasingFn;
|
|
1666
|
+
readonly easeInCirc: EasingFn;
|
|
1667
|
+
readonly easeOutCirc: EasingFn;
|
|
1668
|
+
readonly easeInOutCirc: EasingFn;
|
|
1669
|
+
readonly easeInBack: EasingFn;
|
|
1670
|
+
readonly easeOutBack: EasingFn;
|
|
1671
|
+
readonly easeInOutBack: EasingFn;
|
|
1672
|
+
readonly easeInElastic: EasingFn;
|
|
1673
|
+
readonly easeOutElastic: EasingFn;
|
|
1674
|
+
readonly easeInOutElastic: EasingFn;
|
|
1675
|
+
readonly easeInBounce: EasingFn;
|
|
1676
|
+
readonly easeOutBounce: EasingFn;
|
|
1677
|
+
readonly easeInOutBounce: EasingFn;
|
|
1678
|
+
};
|
|
1679
|
+
/** The name of one of the built-in easing curves. */
|
|
1680
|
+
type EasingName = keyof typeof EASINGS;
|
|
1681
|
+
|
|
1682
|
+
/** Cubic-bezier control points, CSS `cubic-bezier()` order. The curve's two
|
|
1683
|
+
* endpoints are implicit at (0,0) and (1,1). */
|
|
1684
|
+
interface BezierEasing {
|
|
1685
|
+
/** `readonly` so an `as const` preset is assignable; nothing ever writes it. */
|
|
1686
|
+
bezier: readonly [number, number, number, number];
|
|
1687
|
+
}
|
|
1688
|
+
/** An easing curve as a value: a function, the name of a built-in, or control
|
|
1689
|
+
* points. Anything an editor has to name, show or serialize must not be a bare
|
|
1690
|
+
* function, which is why the union exists. */
|
|
1691
|
+
type EasingSpec = EasingFn | EasingName | BezierEasing;
|
|
1692
|
+
|
|
1721
1693
|
/** An easing curve: maps normalized progress `t ∈ [0, 1]` to eased progress.
|
|
1722
1694
|
* Curves may leave the 0–1 range in the middle (back, elastic) but should
|
|
1723
1695
|
* pass through 0 at 0 and 1 at 1. */
|
|
1724
1696
|
type EasingFn = (t: number) => number;
|
|
1697
|
+
|
|
1725
1698
|
/** Factory interpolator: built ONCE at tween start with (from, to), the returned
|
|
1726
1699
|
* function is called with `t ∈ [0, 1]` each frame. Use for interpolators with
|
|
1727
1700
|
* expensive setup (color-space conversion, path-string parsing) — d3-interpolate's
|
|
@@ -1734,7 +1707,7 @@ interface ViewAnimationOptions {
|
|
|
1734
1707
|
/** Duration in ms. Default 250. */
|
|
1735
1708
|
ms?: number;
|
|
1736
1709
|
/** Easing curve. Default `easeOutCubic`. */
|
|
1737
|
-
easing?:
|
|
1710
|
+
easing?: EasingSpec;
|
|
1738
1711
|
/** Replace the kit's log-scale / fixed-anchor curve. */
|
|
1739
1712
|
interpolator?: InterpolatorFactory<View>;
|
|
1740
1713
|
/** Fires when the target is reached. Not called on cancel. */
|
|
@@ -3956,6 +3929,13 @@ type Thumb = {
|
|
|
3956
3929
|
label?: string;
|
|
3957
3930
|
shape?: ThumbShape;
|
|
3958
3931
|
bounds?: [number, number] | ((ctx: BoundsCtx) => [number, number]);
|
|
3932
|
+
/**
|
|
3933
|
+
* Spoken form of `value`, published as `aria-valuetext`. Required by ARIA
|
|
3934
|
+
* whenever `value` is not the quantity the user is choosing — an index into
|
|
3935
|
+
* a value list, a log-scaled position — since `aria-valuenow` alone then
|
|
3936
|
+
* announces a number that means nothing.
|
|
3937
|
+
*/
|
|
3938
|
+
valueText?: string;
|
|
3959
3939
|
};
|
|
3960
3940
|
/**
|
|
3961
3941
|
* Passed to a thumb's `bounds` function: the full thumb list and this thumb's
|
|
@@ -3981,7 +3961,13 @@ type TrackCtx = {
|
|
|
3981
3961
|
*
|
|
3982
3962
|
* `stops` are attractors: a drag that passes within a few pixels of one lands
|
|
3983
3963
|
* on it, and the arrow keys move stop to stop. `step` still quantizes the
|
|
3984
|
-
* values between them.
|
|
3964
|
+
* values between them. Each one is drawn on the track as a mark; pass
|
|
3965
|
+
* `showStops: false` for a track whose own paint already reads as the stops.
|
|
3966
|
+
*
|
|
3967
|
+
* `trackClick: 'move-nearest'` makes a press on bare track send the closest
|
|
3968
|
+
* thumb there and continue as a drag. It is off by default because on a
|
|
3969
|
+
* multi-thumb editor a stray click would yank a stop the user was not aiming
|
|
3970
|
+
* at; `onAddThumb`, where it is set, keeps the track press.
|
|
3985
3971
|
*
|
|
3986
3972
|
* `constraint: 'ordered'` keeps thumbs from crossing each other. Supplying
|
|
3987
3973
|
* `onAddThumb` makes a click on empty track create a thumb, and supplying
|
|
@@ -3997,6 +3983,8 @@ type SliderProps<T extends Thumb = Thumb> = {
|
|
|
3997
3983
|
max: number;
|
|
3998
3984
|
step?: number;
|
|
3999
3985
|
stops?: number[];
|
|
3986
|
+
showStops?: boolean;
|
|
3987
|
+
trackClick?: 'none' | 'move-nearest';
|
|
4000
3988
|
constraint?: 'free' | 'ordered';
|
|
4001
3989
|
onAddThumb?: (atValue: number) => T | null;
|
|
4002
3990
|
onRemoveThumb?: (index: number) => boolean;
|
|
@@ -4684,8 +4672,8 @@ type RangeSliderProps = Omit<SliderProps$1, 'children' | 'className'> & {
|
|
|
4684
4672
|
};
|
|
4685
4673
|
/**
|
|
4686
4674
|
* Linear range slider on React Aria. Single-value by default; pass an array
|
|
4687
|
-
* to `value` / `defaultValue` for multi-thumb. Distinct from
|
|
4688
|
-
*
|
|
4675
|
+
* to `value` / `defaultValue` for multi-thumb. Distinct from `Slider`, which
|
|
4676
|
+
* is fully controlled and gives each thumb its own bounds and readout.
|
|
4689
4677
|
*/
|
|
4690
4678
|
declare function RangeSlider(props: RangeSliderProps): react_jsx_runtime.JSX.Element;
|
|
4691
4679
|
|
|
@@ -4717,6 +4705,65 @@ type DialogProps = Omit<ModalOverlayProps, 'children' | 'className'> & {
|
|
|
4717
4705
|
*/
|
|
4718
4706
|
declare function Dialog(props: DialogProps): react_jsx_runtime.JSX.Element;
|
|
4719
4707
|
|
|
4708
|
+
/** Accent color of a {@link Callout}'s border and arrow. */
|
|
4709
|
+
type CalloutTone = 'info' | 'warning' | 'danger';
|
|
4710
|
+
|
|
4711
|
+
/** Props for {@link Callout}, on top of React Aria's `Popover` props. */
|
|
4712
|
+
type CalloutProps = Omit<PopoverProps, 'children' | 'className' | 'isNonModal' | 'triggerRef'> & {
|
|
4713
|
+
children?: ReactNode;
|
|
4714
|
+
className?: string;
|
|
4715
|
+
/** Optional heading rendered above the body. */
|
|
4716
|
+
title?: ReactNode;
|
|
4717
|
+
/** Footer slot — typically action buttons. */
|
|
4718
|
+
footer?: ReactNode;
|
|
4719
|
+
/** Accent tone for border + arrow. Default `info`. */
|
|
4720
|
+
tone?: CalloutTone;
|
|
4721
|
+
/**
|
|
4722
|
+
* `true` — blocks interaction with the rest of the app until dismissed;
|
|
4723
|
+
* inner dialog is `role="alertdialog"`. `false` (default) — non-blocking:
|
|
4724
|
+
* the app stays interactive; Esc / outside click / close button dismiss.
|
|
4725
|
+
*/
|
|
4726
|
+
modal?: boolean;
|
|
4727
|
+
/**
|
|
4728
|
+
* Show the × button. Defaults to `!modal`. In programmatic
|
|
4729
|
+
* `triggerRef`/`anchorRect` modes the close button needs controlled open
|
|
4730
|
+
* (`isOpen` + `onOpenChange`); with only `defaultOpen` it has no open-state
|
|
4731
|
+
* setter to call and cannot close.
|
|
4732
|
+
*/
|
|
4733
|
+
showCloseButton?: boolean;
|
|
4734
|
+
/**
|
|
4735
|
+
* The user asked for this callout to go away — the × button or Escape.
|
|
4736
|
+
*
|
|
4737
|
+
* Distinct from `onOpenChange`, which a non-modal popover *also* fires when
|
|
4738
|
+
* interaction or focus merely leaves it. On a canvas that's every click on
|
|
4739
|
+
* the artwork, so a consumer that pins `isOpen` and treats `onOpenChange`
|
|
4740
|
+
* as dismissal retires messages nobody read. Use this instead: it fires
|
|
4741
|
+
* only on a deliberate act, and never on incidental focus loss.
|
|
4742
|
+
*/
|
|
4743
|
+
onDismiss?: () => void;
|
|
4744
|
+
/** Anchor to an arbitrary element (programmatic use, with `isOpen`). */
|
|
4745
|
+
triggerRef?: RefObject<Element | null>;
|
|
4746
|
+
/**
|
|
4747
|
+
* Anchor to a client-coordinate rect — e.g. a scene node's on-screen box.
|
|
4748
|
+
* The callout re-anchors whenever this rect changes, so a consumer that
|
|
4749
|
+
* recomputes it on pan, zoom, or scene edits keeps the arrow on its target.
|
|
4750
|
+
* Takes precedence over `triggerRef`.
|
|
4751
|
+
*/
|
|
4752
|
+
anchorRect?: {
|
|
4753
|
+
x: number;
|
|
4754
|
+
y: number;
|
|
4755
|
+
width: number;
|
|
4756
|
+
height: number;
|
|
4757
|
+
};
|
|
4758
|
+
};
|
|
4759
|
+
/**
|
|
4760
|
+
* Anchored callout with an arrow pointing at its source — a trigger
|
|
4761
|
+
* element, an arbitrary `triggerRef`, or a client-space `anchorRect`.
|
|
4762
|
+
* Wraps React Aria Popover + Dialog; positioning, collision flipping,
|
|
4763
|
+
* dismissal, and focus behavior come from the underlying primitives.
|
|
4764
|
+
*/
|
|
4765
|
+
declare function Callout(props: CalloutProps): react_jsx_runtime.JSX.Element;
|
|
4766
|
+
|
|
4720
4767
|
/**
|
|
4721
4768
|
* Coordinate transforms (model ↔ plot) for Plot2D. Pure / deterministic —
|
|
4722
4769
|
* no DOM, no React, no state.
|
|
@@ -5144,5 +5191,5 @@ declare const MINUS_SIGN = "\u2212";
|
|
|
5144
5191
|
*/
|
|
5145
5192
|
declare function formatNumber(value: number, options?: Intl.NumberFormatOptions): string;
|
|
5146
5193
|
|
|
5147
|
-
export { ActionBar, ActionsBar, Badge, Button, Checkbox, ComboBox, ComboBoxItem, CurveEditor, DataGrid, Dialog, DragHandleGlyph, EDGE_PROFILES, Field, Input, KeyCap, KeySequence, MINUS_SIGN, NumberField, OptionsBar, Plot2D, PointPlotter, Powerline, ToolPrefGroup as PrefGroup, ToolPrefLeaf as PrefLeaf, Radio, RadioGroup, RangeSlider, Select, SelectItem, Sidebar, SidebarPanel, Slider, Switch, Tab, TabList, TabPanel, Tabs, ToggleBar, ToolButton, ToolGroup, ToolPalette, chromaAt, detectPlatform, dlog, fieldClasses, formatNumber, formatShortcut, formatShortcutParts, inferKeycapKind, isDebugEnabled, isPrefLeaf, keyGlyph, keySpecFromKey, keySpecsFromMods, oklchToHex, paintGradientTrack, prefValueAtPath, useReorderDragList, useRovingTabIndex, visiblePrefSubtree };
|
|
5148
|
-
export type { ActionBarProps, ActionsBarItem, ActionsBarProps, ActionsBarSize, ActionsBarVariant, AddPointMode, AnchorRenderProps, AxesSettings, BadgeProps, BadgeShape, BadgeSize, BadgeTone, BadgeVariant, BoundsCtx, BuiltInEdgeName, ButtonProps, ButtonSize, ButtonVariant, CheckboxProps, ChromaCurve, ChromaCurvePoint, ComboBoxItemProps, ComboBoxOption, ComboBoxProps, ControlPoint, CurveDomain, CurveEditorProps, DataGridColumn, DataGridProps, DialogProps, DragHandleGlyphProps, EdgeCap, EdgeProfile, EndpointMode, FieldOrientation, FieldProps, FillSettings, GradientTrackOpts, GridSettings, InputProps, InterpolationMode, KeyCapProps, KeyCapVariant, KeySequenceProps, KeySpec, KeycapKind, LayerListItem, LogicalMod, LogicalModSpec, NumberFieldProps, OptionsBarItem, OptionsBarProps, OptionsBarSize, OptionsBarVariant, Platform, Plot2DCoords, Plot2DHandle, Plot2DProps, PointPlotterProps, PowerlineProps, PowerlineSegment, RadioGroupProps, RadioProps, RangeSliderProps, ReorderDragHandlers, ReorderDragState, RovingItem, RovingTabIndex, SelectItemProps, SelectOption, SelectProps, SidebarPanelProps, SidebarProps, SliderProps, SwitchProps, TabListProps, TabPanelProps, TabProps, TabsProps, Thumb, ThumbRenderCtx, ThumbShape, ToggleBarItem, ToggleBarProps, ToggleBarSize, ToggleBarVariant, ToolButtonProps, ToolGroupProps, ToolPaletteProps, TrackCtx, UseReorderDragListOptions, UseRovingTabIndexOptions };
|
|
5194
|
+
export { ActionBar, ActionsBar, Badge, Button, Callout, Checkbox, ComboBox, ComboBoxItem, CurveEditor, DataGrid, Dialog, DragHandleGlyph, EDGE_PROFILES, Field, Input, KeyCap, KeySequence, MINUS_SIGN, NumberField, OptionsBar, Plot2D, PointPlotter, Powerline, ToolPrefGroup as PrefGroup, ToolPrefLeaf as PrefLeaf, Radio, RadioGroup, RangeSlider, Select, SelectItem, Sidebar, SidebarPanel, Slider, Switch, Tab, TabList, TabPanel, Tabs, ToggleBar, ToolButton, ToolGroup, ToolPalette, chromaAt, detectPlatform, dlog, fieldClasses, formatNumber, formatShortcut, formatShortcutParts, inferKeycapKind, isDebugEnabled, isPrefLeaf, keyGlyph, keySpecFromKey, keySpecsFromMods, oklchToHex, paintGradientTrack, prefValueAtPath, useReorderDragList, useRovingTabIndex, visiblePrefSubtree };
|
|
5195
|
+
export type { ActionBarProps, ActionsBarItem, ActionsBarProps, ActionsBarSize, ActionsBarVariant, AddPointMode, AnchorRenderProps, AxesSettings, BadgeProps, BadgeShape, BadgeSize, BadgeTone, BadgeVariant, BoundsCtx, BuiltInEdgeName, ButtonProps, ButtonSize, ButtonVariant, CalloutProps, CheckboxProps, ChromaCurve, ChromaCurvePoint, ComboBoxItemProps, ComboBoxOption, ComboBoxProps, ControlPoint, CurveDomain, CurveEditorProps, DataGridColumn, DataGridProps, DialogProps, DragHandleGlyphProps, EdgeCap, EdgeProfile, EndpointMode, FieldOrientation, FieldProps, FillSettings, GradientTrackOpts, GridSettings, InputProps, InterpolationMode, KeyCapProps, KeyCapVariant, KeySequenceProps, KeySpec, KeycapKind, LayerListItem, LogicalMod, LogicalModSpec, NumberFieldProps, OptionsBarItem, OptionsBarProps, OptionsBarSize, OptionsBarVariant, Platform, Plot2DCoords, Plot2DHandle, Plot2DProps, PointPlotterProps, PowerlineProps, PowerlineSegment, RadioGroupProps, RadioProps, RangeSliderProps, ReorderDragHandlers, ReorderDragState, RovingItem, RovingTabIndex, SelectItemProps, SelectOption, SelectProps, SidebarPanelProps, SidebarProps, SliderProps, SwitchProps, TabListProps, TabPanelProps, TabProps, TabsProps, Thumb, ThumbRenderCtx, ThumbShape, ToggleBarItem, ToggleBarProps, ToggleBarSize, ToggleBarVariant, ToolButtonProps, ToolGroupProps, ToolPaletteProps, TrackCtx, UseReorderDragListOptions, UseRovingTabIndexOptions };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '../chunk-SBXNQW4G.js';
|
|
2
|
-
export { m as ActionBar, r4 as ActionsBar, It as Badge,
|
|
3
|
-
import '../chunk-
|
|
2
|
+
export { m as ActionBar, r4 as ActionsBar, It as Badge, a3 as Button, h2 as Callout, c5 as CalloutTrigger, o as Checkbox, p3 as ComboBox, m3 as ComboBoxItem, F as CurveEditor, s as DataGrid, c as Dialog, n2 as DragHandleGlyph, Je as EDGE_PROFILES, n as Field, u as Input, s2 as KeyCap, c2 as KeySequence, c3 as LayerStack, e2 as MINUS_SIGN, f as NumberField, r3 as OptionsBar, f2 as Plot2D, n5 as PointPlotter, r5 as Powerline, u2 as Radio, l as RadioGroup, l2 as RangeSlider, p as Select, h as SelectItem, n3 as Sidebar, s3 as SidebarPanel, _2 as Slider, a2 as Switch, c4 as Tab, s4 as TabList, l3 as TabPanel, o4 as Tabs, r2 as ToggleBar, o3 as ToolButton, n4 as ToolGroup, _4 as ToolPalette, In as chromaAt, u3 as detectPlatform, a as dlog, r as fieldClasses, t as formatNumber, d2 as formatShortcut, u4 as formatShortcutParts, o2 as inferKeycapKind, i as isDebugEnabled, b2 as isPrefLeaf, e as keyGlyph, p2 as keySpecFromKey, d as keySpecsFromMods, Fn as oklchToHex, v2 as paintGradientTrack, x2 as prefValueAtPath, i2 as useReorderDragList, a4 as useRovingTabIndex, S as visiblePrefSubtree } from '../chunk-RBGKL7NF.js';
|
|
3
|
+
import '../chunk-L5QJOOLV.js';
|
|
4
4
|
//# sourceMappingURL=weasel-ui.js.map
|
|
5
5
|
//# sourceMappingURL=weasel-ui.js.map
|
|
@@ -113,7 +113,7 @@ declare function Toolbar({ children, 'aria-label': ariaLabel }: ToolbarProps): r
|
|
|
113
113
|
declare namespace Toolbar {
|
|
114
114
|
var Title: ({ children }: TitleProps) => react_jsx_runtime.JSX.Element;
|
|
115
115
|
var Group: ({ children, end, "aria-label": ariaLabel }: ToolbarGroupProps) => react_jsx_runtime.JSX.Element;
|
|
116
|
-
var Button: ({ children, onClick, disabled, title, "aria-label": ariaLabel, variant, iconOnly, }: ToolbarButtonProps) => react_jsx_runtime.JSX.Element;
|
|
116
|
+
var Button: ({ children, onClick, disabled, title, "aria-label": ariaLabel, variant, iconOnly, pressed, }: ToolbarButtonProps) => react_jsx_runtime.JSX.Element;
|
|
117
117
|
var Spacer: () => react_jsx_runtime.JSX.Element;
|
|
118
118
|
}
|
|
119
119
|
interface TitleProps {
|
|
@@ -138,6 +138,8 @@ interface ToolbarButtonProps {
|
|
|
138
138
|
variant?: 'default' | 'danger';
|
|
139
139
|
/** Square, for a button whose whole content is one glyph. */
|
|
140
140
|
iconOnly?: boolean;
|
|
141
|
+
/** Makes this a toggle: `aria-pressed`, and held down while true. */
|
|
142
|
+
pressed?: boolean;
|
|
141
143
|
}
|
|
142
144
|
|
|
143
145
|
/** Props for `<ZoomControl>`. */
|
package/dist/primitives/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { FloatingPanel, JobProgress, Legend, Sidebar } from '../chunk-
|
|
2
|
-
export { FpsMeter, ScaleIndicator, StatusBar, Toolbar, ZoomControl } from '../chunk-
|
|
3
|
-
import '../chunk-CPUJ3QXL.js';
|
|
1
|
+
export { FloatingPanel, JobProgress, Legend, Sidebar } from '../chunk-QB5SM4BM.js';
|
|
2
|
+
export { FpsMeter, ScaleIndicator, StatusBar, Toolbar, ZoomControl } from '../chunk-HHGVISVZ.js';
|
|
4
3
|
import '../chunk-SBXNQW4G.js';
|
|
5
|
-
import '../chunk-
|
|
6
|
-
import '../chunk-
|
|
4
|
+
import '../chunk-RBGKL7NF.js';
|
|
5
|
+
import '../chunk-CQLQPQ4P.js';
|
|
6
|
+
import '../chunk-L5QJOOLV.js';
|
|
7
7
|
//# sourceMappingURL=index.js.map
|
|
8
8
|
//# sourceMappingURL=index.js.map
|
package/dist/state/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { C as CURRENT_DOCUMENT_VERSION, L as LabStore, a as LabStoreActions, b as LabStoreContext, c as LabStoreProvider, T as TrialIdContext, d as TrialIdProvider, e as createLabStore, f as createMemoryAdapter, l as labDocumentKey, g as localStorageAdapter, n as noneAdapter, q as quarantineKey, s as sessionStorageAdapter, u as urlHashAdapter, h as useLabStore, i as useTrialId, j as useTrialState } from '../_dts/useTrialState-
|
|
2
|
-
import { S as SerializedTrial, I as InstrumentSerializers, T as TrialRecord, U as UndoStack, a as StorageAdapter } from '../_dts/types-
|
|
3
|
-
export { C as CreateLabStoreOptions, L as LabDocument, b as LabStoreState, M as Migration, c as SavedSnapshot, d as TrialStateHandle } from '../_dts/types-
|
|
1
|
+
export { C as CURRENT_DOCUMENT_VERSION, L as LabStore, a as LabStoreActions, b as LabStoreContext, c as LabStoreProvider, T as TrialIdContext, d as TrialIdProvider, e as createLabStore, f as createMemoryAdapter, l as labDocumentKey, g as localStorageAdapter, n as noneAdapter, q as quarantineKey, s as sessionStorageAdapter, u as urlHashAdapter, h as useLabStore, i as useTrialId, j as useTrialState } from '../_dts/useTrialState-gmMvZqPc.js';
|
|
2
|
+
import { S as SerializedTrial, I as InstrumentSerializers, T as TrialRecord, U as UndoStack, a as StorageAdapter } from '../_dts/types-DYMaEvM5.js';
|
|
3
|
+
export { C as CreateLabStoreOptions, L as LabDocument, b as LabStoreState, M as Migration, c as SavedSnapshot, d as TrialStateHandle, e as UndockedPanel, f as UndockedPanels, g as dockPanel, p as panelKey, u as undockPanel } from '../_dts/types-DYMaEvM5.js';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
5
|
import { ReactNode } from 'react';
|
|
6
6
|
import 'zustand/vanilla';
|
package/dist/state/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createLabStore, LabStoreProvider, TrialIdProvider } from '../chunk-
|
|
2
|
-
export { CURRENT_DOCUMENT_VERSION, LabStoreContext, LabStoreProvider, TrialIdContext, TrialIdProvider, createLabStore, createMemoryAdapter, decodeUrlHash, deserializeTrials, emptyUndoStack, encodeUrlHash, labDocumentKey, labStorageKey, localStorageAdapter, noneAdapter, quarantineKey, serializeTrials, sessionStorageAdapter, urlHashAdapter, useLabStore, useTrialId, useTrialState } from '../chunk-
|
|
1
|
+
import { createLabStore, LabStoreProvider, TrialIdProvider } from '../chunk-XJ6N32QP.js';
|
|
2
|
+
export { CURRENT_DOCUMENT_VERSION, LabStoreContext, LabStoreProvider, TrialIdContext, TrialIdProvider, createLabStore, createMemoryAdapter, decodeUrlHash, deserializeTrials, dockPanel, emptyUndoStack, encodeUrlHash, labDocumentKey, labStorageKey, localStorageAdapter, noneAdapter, panelKey, quarantineKey, serializeTrials, sessionStorageAdapter, undockPanel, urlHashAdapter, useLabStore, useTrialId, useTrialState } from '../chunk-XJ6N32QP.js';
|
|
3
3
|
import { useRef } from 'react';
|
|
4
4
|
import { jsx } from 'react/jsx-runtime';
|
|
5
5
|
|