@weasel-js/labkit 1.4.0-pre.1 → 1.4.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/dist/_dts/{CanvasStackContext-LnCfqNBA.d.ts → CanvasStackContext-BIRUVVGH.d.ts} +1 -1
- package/dist/_dts/PrefsForm.d-CgxUequc.d.ts +20 -0
- package/dist/_dts/{frac-C-2c72Ij.d.ts → frac-X7mWgd7y.d.ts} +10 -4
- package/dist/_dts/{index-BDVzvRzQ.d.ts → index-FEa1MudK.d.ts} +8 -2
- package/dist/_dts/{types-DYMaEvM5.d.ts → types-ChVJJHvk.d.ts} +3 -0
- package/dist/_dts/{types-D6s4b7if.d.ts → types-lg4TSCb2.d.ts} +3 -1
- package/dist/_dts/{useTrialState-gmMvZqPc.d.ts → useTrialState-Cdm13fvl.d.ts} +2 -1
- package/dist/_dts/weasel-canvas-FJTFi3ZZ.d.ts +5041 -0
- package/dist/canvas/index.d.ts +16 -16
- package/dist/canvas/index.js +2 -2
- package/dist/chrome/index.d.ts +6 -6
- package/dist/chrome/index.js +5 -5
- package/dist/chunk-2YILQ7Y5.js +33 -0
- package/dist/chunk-2YILQ7Y5.js.map +1 -0
- package/dist/{chunk-TO2FUOKF.js → chunk-53AZ2O2N.js} +16 -13
- package/dist/chunk-53AZ2O2N.js.map +1 -0
- package/dist/{chunk-QB5SM4BM.js → chunk-7TRFMIWX.js} +55 -41
- package/dist/chunk-7TRFMIWX.js.map +1 -0
- package/dist/{chunk-6OEYTYML.js → chunk-BMQWLKOL.js} +15 -15
- package/dist/chunk-BMQWLKOL.js.map +1 -0
- package/dist/{chunk-M75ZU6ZZ.js → chunk-D7QIPGEB.js} +3 -3
- package/dist/{chunk-M75ZU6ZZ.js.map → chunk-D7QIPGEB.js.map} +1 -1
- package/dist/{chunk-L5QJOOLV.js → chunk-DG2IFMLA.js} +1309 -273
- package/dist/chunk-DG2IFMLA.js.map +1 -0
- package/dist/{chunk-LN6JDUGB.js → chunk-HXXTULDN.js} +2 -2
- package/dist/{chunk-LN6JDUGB.js.map → chunk-HXXTULDN.js.map} +1 -1
- package/dist/{chunk-RBGKL7NF.js → chunk-J6SBFZYT.js} +1807 -1814
- package/dist/chunk-J6SBFZYT.js.map +1 -0
- package/dist/{chunk-XJ6N32QP.js → chunk-LJSIUFYD.js} +14 -30
- package/dist/chunk-LJSIUFYD.js.map +1 -0
- package/dist/{chunk-AE5CNVRU.js → chunk-MIT3ISW4.js} +37 -31
- package/dist/chunk-MIT3ISW4.js.map +1 -0
- package/dist/{chunk-HHGVISVZ.js → chunk-MSR7EVS6.js} +7 -5
- package/dist/chunk-MSR7EVS6.js.map +1 -0
- package/dist/{chunk-ESIQNQ6K.js → chunk-OFCBEZMU.js} +12 -6
- package/dist/chunk-OFCBEZMU.js.map +1 -0
- package/dist/{chunk-HMFODCOX.js → chunk-PP7ZWAMV.js} +83 -75
- package/dist/chunk-PP7ZWAMV.js.map +1 -0
- package/dist/{chunk-E2UQVZ44.js → chunk-RLOXQZW3.js} +3 -3
- package/dist/{chunk-E2UQVZ44.js.map → chunk-RLOXQZW3.js.map} +1 -1
- package/dist/controls/index.d.ts +4 -3
- package/dist/controls/index.js +3 -3
- package/dist/dragdrop/index.d.ts +5 -5
- package/dist/dragdrop/index.js +2 -2
- package/dist/index.d.ts +57 -77
- package/dist/index.js +308 -161
- package/dist/index.js.map +1 -1
- package/dist/job/index.js +1 -1
- package/dist/layers/index.d.ts +6 -6
- package/dist/layers/index.js +3 -3
- package/dist/loupe/index.d.ts +7 -13
- package/dist/loupe/index.js +2 -2
- package/dist/passthrough/weasel-canvas.d.ts +3 -343
- package/dist/passthrough/weasel-canvas.js +1 -1
- package/dist/passthrough/weasel-ui.d.ts +141 -2866
- package/dist/passthrough/weasel-ui.js +2 -2
- package/dist/primitives/index.js +4 -4
- package/dist/state/index.d.ts +3 -3
- package/dist/state/index.js +4 -2
- package/dist/state/index.js.map +1 -1
- package/dist/styles.css +74 -5
- package/dist/surface/index.d.ts +17 -2
- package/dist/surface/index.js +3 -2
- package/dist/ui/layers/index.js +2 -2
- package/dist/undo/index.d.ts +6 -5
- package/package.json +8 -8
- package/src/annotations/AnnotationOverlay.tsx +10 -6
- package/src/annotations/Annotations.less +6 -0
- package/src/annotations/Annotations.overlay.test.tsx +113 -0
- package/src/annotations/MarkList.tsx +3 -2
- package/src/canvas/CanvasStack.tsx +8 -13
- package/src/canvas/useOrbit.test.ts +93 -1
- package/src/canvas/useOrbit.ts +41 -34
- package/src/canvas/usePanZoom.test.ts +102 -1
- package/src/canvas/usePanZoom.ts +54 -36
- package/src/config/builder.test.ts +5 -0
- package/src/config/builder.ts +6 -0
- package/src/config/types.ts +1 -0
- package/src/controls/ControlPanel.test.tsx +23 -0
- package/src/controls/ControlPanel.tsx +3 -0
- package/src/job/useJob.ts +1 -1
- package/src/lab/Lab.surface.test.tsx +8 -3
- package/src/lab/LabHeader.test.tsx +12 -0
- package/src/lab/LabHeader.tsx +16 -6
- package/src/lab/Workspace.tsx +1 -1
- package/src/layers/LayerList.test.tsx +72 -1
- package/src/layers/LayerList.tsx +40 -32
- package/src/passthrough/weasel-ui.test.ts +9 -0
- package/src/passthrough/weasel-ui.ts +4 -0
- package/src/primitives/FloatingPanel.test.tsx +82 -0
- package/src/primitives/FloatingPanel.tsx +59 -41
- package/src/primitives/ZoomControl.tsx +2 -0
- package/src/state/store.ts +10 -0
- package/src/state/types.ts +3 -0
- package/src/surface/AGENTS.md +11 -1
- package/src/surface/index.ts +7 -1
- package/src/surface/useSurfaceTile.ts +20 -2
- package/src/surface/useTiledSurface.ts +4 -1
- package/src/theme/Interstellar.stories.tsx +4 -3
- package/src/theme/base.less +39 -1
- package/src/trial/Trial.less +27 -5
- package/src/trial/TrialBody.test.tsx +67 -0
- package/src/trial/TrialBody.tsx +155 -0
- package/src/trial/TrialChrome.tsx +18 -10
- package/src/trial/index.ts +2 -0
- package/dist/_dts/DrawCommand-B3bskUsC.d.ts +0 -564
- package/dist/_dts/PrefsForm-BkUJZx0A.d.ts +0 -204
- package/dist/_dts/fitViewToBounds-dZ2UDB6e.d.ts +0 -21
- package/dist/_dts/shapeKinds-Cx_rxwsa.d.ts +0 -87
- package/dist/_dts/types-C-gh9Ap-.d.ts +0 -695
- package/dist/chunk-6OEYTYML.js.map +0 -1
- package/dist/chunk-AE5CNVRU.js.map +0 -1
- package/dist/chunk-ESIQNQ6K.js.map +0 -1
- package/dist/chunk-HHGVISVZ.js.map +0 -1
- package/dist/chunk-HMFODCOX.js.map +0 -1
- package/dist/chunk-L5QJOOLV.js.map +0 -1
- package/dist/chunk-QB5SM4BM.js.map +0 -1
- package/dist/chunk-RBGKL7NF.js.map +0 -1
- package/dist/chunk-TO2FUOKF.js.map +0 -1
- package/dist/chunk-XJ6N32QP.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { RefObject } from 'react';
|
|
3
|
-
import { V as ViewTransform, W as WorldFrame } from './frac-
|
|
3
|
+
import { V as ViewTransform, W as WorldFrame } from './frac-X7mWgd7y.js';
|
|
4
4
|
|
|
5
5
|
/** One layer of a canvas stack: its id, whether it is currently shown, and how
|
|
6
6
|
* it paints itself. */
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { T as ToolPrefLeaf } from './weasel-canvas-FJTFi3ZZ.js';
|
|
3
|
+
|
|
4
|
+
/** What a {@link PrefRenderer} is given for the leaf it is rendering. */
|
|
5
|
+
interface PrefRenderContext {
|
|
6
|
+
/** Dotted path of the leaf within the schema root. */
|
|
7
|
+
path: string;
|
|
8
|
+
/** The schema node. App renderers narrow this to their own kind shape. */
|
|
9
|
+
pref: ToolPrefLeaf;
|
|
10
|
+
/** Current value — `values` at `path`, falling back to `pref.default`. */
|
|
11
|
+
value: unknown;
|
|
12
|
+
setValue: (value: unknown) => void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Renders the control cell for one preference leaf. Returning `null`
|
|
16
|
+
* collapses the row.
|
|
17
|
+
*/
|
|
18
|
+
type PrefRenderer = (ctx: PrefRenderContext) => ReactNode;
|
|
19
|
+
|
|
20
|
+
export type { PrefRenderer as P, PrefRenderContext as a };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ComponentType, ReactNode, RefObject } from 'react';
|
|
2
|
-
import { R as ResolvedConfig, C as ConfigField, a as ConfigSchema } from './types-
|
|
3
|
-
import { c as SavedSnapshot } from './types-
|
|
2
|
+
import { R as ResolvedConfig, C as ConfigField, a as ConfigSchema } from './types-lg4TSCb2.js';
|
|
3
|
+
import { c as SavedSnapshot } from './types-ChVJJHvk.js';
|
|
4
4
|
import { J as JobHandle, a as JobCapability } from './types-DJ79Tg5J.js';
|
|
5
|
-
import { S as Scene } from './
|
|
5
|
+
import { S as Scene } from './weasel-canvas-FJTFi3ZZ.js';
|
|
6
6
|
|
|
7
7
|
/** How an instrument's world sits on the canvas, independent of the camera.
|
|
8
8
|
* The defaults reproduce the convention labkit shipped before this existed:
|
|
@@ -177,6 +177,12 @@ interface TrialChromeContext {
|
|
|
177
177
|
setActiveTool: (id: string) => void;
|
|
178
178
|
}
|
|
179
179
|
|
|
180
|
+
/** A point on the magnified surface, in its own CSS pixels. */
|
|
181
|
+
interface LoupePoint {
|
|
182
|
+
x: number;
|
|
183
|
+
y: number;
|
|
184
|
+
}
|
|
185
|
+
|
|
180
186
|
/** How a loupe magnifies. `'vector'` re-renders the source through a zoomed-in
|
|
181
187
|
* view, so content stays sharp at any factor; `'pixel'` blows up the actual
|
|
182
188
|
* pixels the surface presented. */
|
|
@@ -732,4 +738,4 @@ declare function fracContains(box: FracRect, pt: FracPoint, tol?: number): boole
|
|
|
732
738
|
declare function fracIntersects(outer: FracRect, inner: FracRect): boolean;
|
|
733
739
|
|
|
734
740
|
export { LOUPE_DEFAULTS as L, annotationsFromJSON as a3, applyCamera as a4, createAnnotationScene as a5, createAnnotationStore as a6, fracContains as a7, fracIntersects as a8, fracToWorld as a9, resolveFrame as aa, resolveLoupe as ab, roundFrac as ac, worldToFrac as ad, DEFAULT_FRAME as x };
|
|
735
|
-
export type { TrialRegion as $, AnnotationData as A, LayerCapability as B, CaptureSource as C, DragFeedback as D, LayerDescriptor as E, FracPoint as F, LoupeCapability as G, HitResult as H, Instrument as I, LoupeDeclaration as J, LoupeRenderArgs as K, MarkScene as M, ResolvedLoupe as N, SidebarSection as O, PaletteItem as P, StatusReadout as Q, RenderContext as R, SerializedAnnotations as S, TrialTool as T, SystemEvent as U, ViewTransform as V, WorldFrame as W, ToolCapability as X, ToolItem as Y, ToolbarItem as Z, TrialChromeContext as _, Point as a, UndoCapability as a0, ViewportControl as a1, ViewportSize as a2,
|
|
741
|
+
export type { TrialRegion as $, AnnotationData as A, LayerCapability as B, CaptureSource as C, DragFeedback as D, LayerDescriptor as E, FracPoint as F, LoupeCapability as G, HitResult as H, Instrument as I, LoupeDeclaration as J, LoupeRenderArgs as K, MarkScene as M, ResolvedLoupe as N, SidebarSection as O, PaletteItem as P, StatusReadout as Q, RenderContext as R, SerializedAnnotations as S, TrialTool as T, SystemEvent as U, ViewTransform as V, WorldFrame as W, ToolCapability as X, ToolItem as Y, ToolbarItem as Z, TrialChromeContext as _, Point as a, UndoCapability as a0, ViewportControl as a1, ViewportSize as a2, LoupePoint as ae, LoupeMode as af, DragDropCapability as b, WorldSpec as c, WorldRect as d, AnnotationMeaning as e, CaptureOptions as f, CaptureResult as g, AnnotationTarget as h, AnnotationsApi as i, AnnotationsCapability as j, AnnotationKind as k, InstrumentList as l, TrialContribution as m, Annotation as n, AnnotationInit as o, AnnotationPatch as p, AnnotationQuery as q, AnnotationStatus as r, AnnotationStoreOptions as s, AnnotationTargetInfo as t, CanvasCapability as u, CanvasLayer as v, CaptureDeps as w, FracRect as y, IconComponent as z };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { R as ResolvedConfig, C as ConfigField, c as ControlRenderer } from './types-
|
|
3
|
+
import { R as ResolvedConfig, C as ConfigField, c as ControlRenderer } from './types-lg4TSCb2.js';
|
|
4
4
|
|
|
5
5
|
/** Props for `<PropertyPanel>`. */
|
|
6
6
|
interface PropertyPanelProps {
|
|
@@ -155,6 +155,12 @@ interface NumberRowProps {
|
|
|
155
155
|
max?: number;
|
|
156
156
|
step?: number;
|
|
157
157
|
placeholder?: string;
|
|
158
|
+
/**
|
|
159
|
+
* Optional suffix rendered after the field. A string becomes a dim "word"
|
|
160
|
+
* unit (e.g. "px"); pass JSX like `<sup>°</sup>` for symbol units. Display
|
|
161
|
+
* only — it never participates in parsing, and the value stays a number.
|
|
162
|
+
*/
|
|
163
|
+
unit?: ReactNode;
|
|
158
164
|
layout?: PropertyRowLayout;
|
|
159
165
|
description?: string;
|
|
160
166
|
/** Take the full width of the enclosing grid — see `<PropertyRow span>`. */
|
|
@@ -162,7 +168,7 @@ interface NumberRowProps {
|
|
|
162
168
|
}
|
|
163
169
|
/** A number typed directly. Reach for `<SliderRow>` when the range matters
|
|
164
170
|
* more than the exact value. */
|
|
165
|
-
declare function NumberRow({ label, value, onChange, min, max, step, placeholder, layout, description, span, }: NumberRowProps): react_jsx_runtime.JSX.Element;
|
|
171
|
+
declare function NumberRow({ label, value, onChange, min, max, step, placeholder, unit, layout, description, span, }: NumberRowProps): react_jsx_runtime.JSX.Element;
|
|
166
172
|
interface PropertyOption<T extends string> {
|
|
167
173
|
value: T;
|
|
168
174
|
label: ReactNode;
|
|
@@ -30,6 +30,9 @@ interface TrialRecord<TS = unknown, TC = unknown, TV = unknown> {
|
|
|
30
30
|
view: TV;
|
|
31
31
|
/** This trial's own tool slot. Undefined means it reads the lab's. */
|
|
32
32
|
activeToolId?: string | null;
|
|
33
|
+
/** The extent the trial's sidebar was last dragged to, in pixels. Undefined
|
|
34
|
+
* until someone moves the seam. */
|
|
35
|
+
sidebarWidth?: number;
|
|
33
36
|
/** The marks on this trial's annotation targets, as `AnnotationsApi.toJSON`
|
|
34
37
|
* wrote them. Opaque here, and absent for a trial whose instrument declares
|
|
35
38
|
* no `annotations` — or declares its own `storage`. Not in `state`, which
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { T as ToolPrefLeaf, a as ToolPrefGroup } from './weasel-canvas-FJTFi3ZZ.js';
|
|
2
|
+
import { P as PrefRenderer } from './PrefsForm.d-CgxUequc.js';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Renders the control cell for one config leaf. Identical to weasel-ui's
|
|
@@ -22,6 +23,7 @@ interface Annotations {
|
|
|
22
23
|
min?: number;
|
|
23
24
|
max?: number;
|
|
24
25
|
step?: number;
|
|
26
|
+
suffix?: string;
|
|
25
27
|
control?: string;
|
|
26
28
|
options?: readonly ConfigOption[];
|
|
27
29
|
placeholder?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as StorageAdapter, b as LabStoreState, T as TrialRecord, c as SavedSnapshot, h as LabMode, e as UndockedPanel, I as InstrumentSerializers, C as CreateLabStoreOptions, d as TrialStateHandle } from './types-
|
|
1
|
+
import { a as StorageAdapter, b as LabStoreState, T as TrialRecord, c as SavedSnapshot, h as LabMode, e as UndockedPanel, I as InstrumentSerializers, C as CreateLabStoreOptions, d as TrialStateHandle } from './types-ChVJJHvk.js';
|
|
2
2
|
import * as react from 'react';
|
|
3
3
|
import { ReactNode, ReactElement } from 'react';
|
|
4
4
|
import { StoreApi } from 'zustand/vanilla';
|
|
@@ -25,6 +25,7 @@ interface LabStoreActions {
|
|
|
25
25
|
updateTrialState: <TS>(id: string, next: TS | ((prev: TS) => TS)) => void;
|
|
26
26
|
updateTrialConfig: <TC>(id: string, key: keyof TC, value: TC[keyof TC]) => void;
|
|
27
27
|
updateTrialView: (id: string, view: unknown) => void;
|
|
28
|
+
updateTrialSidebarWidth: (id: string, width: number) => void;
|
|
28
29
|
updateTrialAnnotations: (id: string, doc: unknown) => void;
|
|
29
30
|
updateTrialUndoStack: (id: string, next: TrialRecord['undoStack'] | ((prev: TrialRecord['undoStack']) => TrialRecord['undoStack'])) => void;
|
|
30
31
|
setTrialInstrument: (id: string, instrumentName: string) => void;
|