@weasel-js/labkit 1.4.0 → 1.4.2
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 +8 -0
- package/dist/_dts/{CanvasStackContext-D6M0o8cQ.d.ts → CanvasStackContext-kjILVnPj.d.ts} +1 -1
- package/dist/_dts/PrefsForm.d-CgxUequc.d.ts +20 -0
- package/dist/_dts/{frac-QS7XzvpG.d.ts → frac-A4R6v4ld.d.ts} +36 -13
- package/dist/_dts/{index-B2X21G1c.d.ts → index-CsU9WhjM.d.ts} +90 -30
- package/dist/_dts/{types-ChVJJHvk.d.ts → types-BbXpvQa8.d.ts} +20 -1
- package/dist/_dts/{types-C1Zw7s5P.d.ts → types-lg4TSCb2.d.ts} +2 -1
- package/dist/_dts/{useTrialState-Cdm13fvl.d.ts → useTrialState-DKjqpv20.d.ts} +5 -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 +15 -9
- package/dist/chrome/index.js +5 -5
- package/dist/{chunk-7VW3S44V.js → chunk-54ZWZ5FQ.js} +908 -301
- package/dist/chunk-54ZWZ5FQ.js.map +1 -0
- package/dist/{chunk-Y2HK44TG.js → chunk-D5KQ5OY6.js} +3 -3
- package/dist/{chunk-Y2HK44TG.js.map → chunk-D5KQ5OY6.js.map} +1 -1
- package/dist/{chunk-VHFQKAUL.js → chunk-FJG4PHTL.js} +83 -75
- package/dist/chunk-FJG4PHTL.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-L5WBGUVR.js → chunk-ISSVF5PT.js} +2753 -2654
- package/dist/chunk-ISSVF5PT.js.map +1 -0
- package/dist/chunk-NSOVI3AZ.js +170 -0
- package/dist/chunk-NSOVI3AZ.js.map +1 -0
- package/dist/{chunk-YQGQUBKA.js → chunk-TN7YSJVU.js} +62 -60
- package/dist/chunk-TN7YSJVU.js.map +1 -0
- package/dist/{chunk-4AMN4MMB.js → chunk-UDXOYZEC.js} +53 -39
- package/dist/chunk-UDXOYZEC.js.map +1 -0
- package/dist/{chunk-LJSIUFYD.js → chunk-ULDW42CR.js} +23 -2
- package/dist/chunk-ULDW42CR.js.map +1 -0
- package/dist/{chunk-QR5V3AFG.js → chunk-UTOEDPNU.js} +5 -5
- package/dist/{chunk-QR5V3AFG.js.map → chunk-UTOEDPNU.js.map} +1 -1
- package/dist/{chunk-UD7TEHZT.js → chunk-W2FJR5FF.js} +35 -22
- package/dist/chunk-W2FJR5FF.js.map +1 -0
- package/dist/{chunk-B5VWJBWM.js → chunk-WS6ZRV75.js} +3 -3
- package/dist/{chunk-B5VWJBWM.js.map → chunk-WS6ZRV75.js.map} +1 -1
- package/dist/{chunk-W3KSUXXR.js → chunk-XKENZTNE.js} +45 -14
- package/dist/chunk-XKENZTNE.js.map +1 -0
- package/dist/controls/index.d.ts +4 -3
- package/dist/controls/index.js +3 -3
- package/dist/dragdrop/index.d.ts +8 -8
- package/dist/dragdrop/index.js +2 -2
- package/dist/index.d.ts +75 -110
- package/dist/index.js +148 -115
- package/dist/index.js.map +1 -1
- package/dist/job/index.js +1 -1
- package/dist/layers/index.d.ts +26 -11
- 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 +123 -3088
- 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 +2 -2
- package/dist/styles.css +30 -3
- package/dist/surface/index.js +2 -2
- package/dist/ui/layers/index.d.ts +22 -9
- package/dist/ui/layers/index.js +2 -2
- package/dist/undo/index.d.ts +6 -5
- package/package.json +8 -8
- package/src/annotations/AnnotationTargets.tsx +6 -1
- package/src/annotations/Annotations.overlay.test.tsx +2 -0
- package/src/annotations/types.ts +4 -1
- package/src/canvas/CanvasStack.tsx +8 -13
- package/src/canvas/useOrbit.test.ts +97 -1
- package/src/canvas/useOrbit.ts +41 -34
- package/src/canvas/usePanZoom.test.ts +106 -1
- package/src/canvas/usePanZoom.ts +54 -36
- package/src/chrome/ChromeRegions.stories.tsx +42 -1
- package/src/chrome/builtins.test.ts +4 -0
- package/src/chrome/builtins.tsx +18 -0
- package/src/chrome/index.ts +1 -1
- package/src/chrome/regions/SidebarRegion.tsx +7 -6
- package/src/chrome/regions/TitleBarRegion.test.tsx +64 -0
- package/src/chrome/regions/TitleBarRegion.tsx +16 -7
- package/src/chrome/regions/ToolbarRegion.test.tsx +14 -0
- package/src/chrome/regions/ToolbarRegion.tsx +2 -2
- package/src/chrome/regions/ViewportRegion.tsx +2 -2
- package/src/chrome/regions/regions.test.tsx +45 -1
- package/src/chrome/types.ts +21 -3
- package/src/controls/ControlPanel.test.tsx +38 -0
- package/src/controls/ControlPanel.tsx +51 -6
- package/src/dragdrop/DragDropRuntime.tsx +74 -61
- package/src/dragdrop/Palette.tsx +4 -3
- package/src/dragdrop/dragDrop.test.tsx +35 -12
- package/src/index.ts +2 -1
- package/src/instrument/types.ts +4 -5
- package/src/job/useJob.ts +1 -1
- package/src/lab/Lab.test.tsx +7 -0
- package/src/lab/Lab.tsx +2 -2
- package/src/lab/LabContext.ts +5 -1
- package/src/lab/LabShell.less +17 -2
- package/src/lab/Workspace.tsx +1 -1
- package/src/layers/AGENTS.md +29 -7
- package/src/layers/LayerList.less +16 -0
- package/src/layers/LayerList.stories.tsx +66 -0
- package/src/layers/LayerList.test.tsx +185 -2
- package/src/layers/LayerList.tsx +221 -74
- package/src/layers/index.ts +1 -1
- package/src/passthrough/weasel-ui.ts +5 -0
- package/src/primitives/FloatingPanel.test.tsx +87 -0
- package/src/primitives/FloatingPanel.tsx +59 -41
- package/src/state/store.test.ts +78 -0
- package/src/state/store.ts +27 -0
- package/src/state/types.ts +20 -0
- package/src/trial/Trial.less +4 -0
- package/src/trial/Trial.targets.test.tsx +96 -0
- package/src/trial/Trial.test.tsx +171 -14
- package/src/trial/Trial.tsx +4 -1
- package/src/trial/TrialChrome.tsx +22 -2
- package/src/trial/TrialTitleBar.tsx +7 -3
- package/src/trial/index.ts +1 -0
- package/src/trial/trialOps.test.ts +49 -1
- package/src/trial/trialOps.ts +28 -6
- 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-4AMN4MMB.js.map +0 -1
- package/dist/chunk-7VW3S44V.js.map +0 -1
- package/dist/chunk-L5WBGUVR.js.map +0 -1
- package/dist/chunk-LJSIUFYD.js.map +0 -1
- package/dist/chunk-UD7TEHZT.js.map +0 -1
- package/dist/chunk-VHFQKAUL.js.map +0 -1
- package/dist/chunk-W3KSUXXR.js.map +0 -1
- package/dist/chunk-XCBCZEBO.js +0 -94
- package/dist/chunk-XCBCZEBO.js.map +0 -1
- package/dist/chunk-YQGQUBKA.js.map +0 -1
package/dist/canvas/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { ReactNode, WheelEvent, PointerEvent } from 'react';
|
|
3
|
-
import { V as ViewTransform, c as WorldSpec, a2 as ViewportSize, a as Point, W as WorldFrame } from '../_dts/frac-
|
|
4
|
-
export { x as DEFAULT_FRAME, a4 as applyCamera, aa as resolveFrame } from '../_dts/frac-
|
|
5
|
-
import { C as CanvasLayerDescriptor } from '../_dts/CanvasStackContext-
|
|
6
|
-
export { a as CanvasStackContext, b as CanvasStackContextValue, c as CanvasStackSurface } from '../_dts/CanvasStackContext-
|
|
7
|
-
import '../_dts/types-
|
|
8
|
-
import '../_dts/
|
|
9
|
-
import '../_dts/
|
|
2
|
+
import { ReactNode, WheelEvent, PointerEvent as PointerEvent$1 } from 'react';
|
|
3
|
+
import { V as ViewTransform, c as WorldSpec, a2 as ViewportSize, a as Point, W as WorldFrame } from '../_dts/frac-A4R6v4ld.js';
|
|
4
|
+
export { x as DEFAULT_FRAME, a4 as applyCamera, aa as resolveFrame } from '../_dts/frac-A4R6v4ld.js';
|
|
5
|
+
import { C as CanvasLayerDescriptor } from '../_dts/CanvasStackContext-kjILVnPj.js';
|
|
6
|
+
export { a as CanvasStackContext, b as CanvasStackContextValue, c as CanvasStackSurface } from '../_dts/CanvasStackContext-kjILVnPj.js';
|
|
7
|
+
import '../_dts/types-lg4TSCb2.js';
|
|
8
|
+
import '../_dts/weasel-canvas-FJTFi3ZZ.js';
|
|
9
|
+
import '../_dts/PrefsForm.d-CgxUequc.js';
|
|
10
|
+
import '../_dts/types-BbXpvQa8.js';
|
|
10
11
|
import '../_dts/types-DJ79Tg5J.js';
|
|
11
|
-
import '../_dts/types-C-gh9Ap-.js';
|
|
12
12
|
|
|
13
13
|
/** Props for `<CanvasStack>`. */
|
|
14
14
|
interface CanvasStackProps {
|
|
@@ -99,9 +99,7 @@ interface UseOrbitOptions {
|
|
|
99
99
|
}
|
|
100
100
|
interface OrbitHandlers {
|
|
101
101
|
onWheel: (e: WheelEvent<HTMLElement>) => void;
|
|
102
|
-
onPointerDown: (e: PointerEvent<HTMLElement>) => void;
|
|
103
|
-
onPointerMove: (e: PointerEvent<HTMLElement>) => void;
|
|
104
|
-
onPointerUp: (e: PointerEvent<HTMLElement>) => void;
|
|
102
|
+
onPointerDown: (e: PointerEvent$1<HTMLElement>) => void;
|
|
105
103
|
onDoubleClick: () => void;
|
|
106
104
|
isDragging: () => boolean;
|
|
107
105
|
}
|
|
@@ -120,15 +118,17 @@ interface UsePanZoomOptions {
|
|
|
120
118
|
* wheel anchors in this frame; omitting it anchors at the element's
|
|
121
119
|
* top-left, which is what labkit did before a frame could be declared. */
|
|
122
120
|
frame?: WorldFrame;
|
|
121
|
+
/** A primary-button press released without ever crossing the drag
|
|
122
|
+
* threshold. The pointer session owns the release, so the gesture's end is
|
|
123
|
+
* reported here rather than left for a consumer's own `onPointerUp`. */
|
|
124
|
+
onTap?: (e: PointerEvent) => void;
|
|
123
125
|
}
|
|
124
126
|
interface PanZoomHandlers {
|
|
125
127
|
onWheel: (e: WheelEvent<HTMLElement>) => void;
|
|
126
|
-
onPointerDown: (e: PointerEvent<HTMLElement>) => void;
|
|
127
|
-
onPointerMove: (e: PointerEvent<HTMLElement>) => void;
|
|
128
|
-
onPointerUp: (e: PointerEvent<HTMLElement>) => void;
|
|
128
|
+
onPointerDown: (e: PointerEvent$1<HTMLElement>) => void;
|
|
129
129
|
isDragging: () => boolean;
|
|
130
130
|
}
|
|
131
|
-
declare function usePanZoom({ view, onViewChange, minZoom, maxZoom, frame, }: UsePanZoomOptions): PanZoomHandlers;
|
|
131
|
+
declare function usePanZoom({ view, onViewChange, minZoom, maxZoom, frame, onTap, }: UsePanZoomOptions): PanZoomHandlers;
|
|
132
132
|
|
|
133
133
|
export { CanvasLayerDescriptor, CanvasStack, PITCH_LIMIT, ViewportSize, WorldFrame, WorldSpec, centerOn, clampPitch, orbitAfterDrag, orbitAfterWheel, screenToWorld, useOrbit, usePanZoom, worldToScreen, wrapYaw, zoomAt };
|
|
134
134
|
export type { CanvasStackProps, OrbitHandlers, OrbitView, PanZoomHandlers, UseOrbitOptions, UsePanZoomOptions, Vec3, ZoomAtOptions };
|
package/dist/canvas/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { CanvasStack, PITCH_LIMIT, clampPitch, orbitAfterDrag, orbitAfterWheel, useOrbit, usePanZoom, wrapYaw } from '../chunk-
|
|
1
|
+
export { CanvasStack, PITCH_LIMIT, clampPitch, orbitAfterDrag, orbitAfterWheel, useOrbit, usePanZoom, wrapYaw } from '../chunk-FJG4PHTL.js';
|
|
2
2
|
export { centerOn, zoomAt } from '../chunk-CTRKTLYZ.js';
|
|
3
3
|
export { DEFAULT_FRAME, applyCamera, resolveFrame, screenToWorld, worldToScreen } from '../chunk-2AYGEN57.js';
|
|
4
4
|
export { CanvasStackContext } from '../chunk-CQLQPQ4P.js';
|
|
5
|
-
import '../chunk-
|
|
5
|
+
import '../chunk-54ZWZ5FQ.js';
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
7
7
|
//# sourceMappingURL=index.js.map
|
package/dist/chrome/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { c as ControlRenderer } from '../_dts/types-
|
|
2
|
-
import { I as Instrument, _ as TrialChromeContext, m as TrialContribution } from '../_dts/frac-
|
|
3
|
-
export { z as IconComponent, O as SidebarSection, Q as StatusReadout, Y as ToolItem, Z as ToolbarItem, $ as TrialRegion, a1 as ViewportControl } from '../_dts/frac-
|
|
1
|
+
import { c as ControlRenderer } from '../_dts/types-lg4TSCb2.js';
|
|
2
|
+
import { I as Instrument, _ as TrialChromeContext, m as TrialContribution } from '../_dts/frac-A4R6v4ld.js';
|
|
3
|
+
export { z as IconComponent, O as SidebarSection, Q as StatusReadout, Y as ToolItem, Z as ToolbarItem, $ as TrialRegion, a1 as ViewportControl } from '../_dts/frac-A4R6v4ld.js';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
|
-
import '../_dts/
|
|
5
|
+
import '../_dts/weasel-canvas-FJTFi3ZZ.js';
|
|
6
6
|
import 'react';
|
|
7
|
-
import '../_dts/
|
|
7
|
+
import '../_dts/PrefsForm.d-CgxUequc.js';
|
|
8
|
+
import '../_dts/types-BbXpvQa8.js';
|
|
8
9
|
import '../_dts/types-DJ79Tg5J.js';
|
|
9
|
-
import '../_dts/types-C-gh9Ap-.js';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* The contributions a trial gets from what its instrument declared. This is
|
|
@@ -58,13 +58,19 @@ interface StatusRegionProps {
|
|
|
58
58
|
/** Lays a trial's `status` contributions out as readouts. */
|
|
59
59
|
declare function StatusRegion({ contributions, ctx }: StatusRegionProps): react_jsx_runtime.JSX.Element | null;
|
|
60
60
|
|
|
61
|
+
/** Which end of the title bar a `<TitleBarRegion>` lays out: `'lead'` renders
|
|
62
|
+
* the contributions that leave `end` unset, before the title; `'actions'`
|
|
63
|
+
* renders the ones that set it, after everything else. */
|
|
64
|
+
type TitleBarPlacement = 'lead' | 'actions';
|
|
61
65
|
/** Props for `<TitleBarRegion>`. */
|
|
62
66
|
interface TitleBarRegionProps {
|
|
63
67
|
contributions: readonly TrialContribution[];
|
|
64
68
|
ctx: TrialChromeContext;
|
|
69
|
+
/** Defaults to `'actions'`, where the built-ins live. */
|
|
70
|
+
placement?: TitleBarPlacement;
|
|
65
71
|
}
|
|
66
|
-
/** Lays a trial's `titlebar` contributions out
|
|
67
|
-
declare function TitleBarRegion({ contributions, ctx }: TitleBarRegionProps): react_jsx_runtime.JSX.Element | null;
|
|
72
|
+
/** Lays a trial's `titlebar` contributions out at one end of the bar. */
|
|
73
|
+
declare function TitleBarRegion({ contributions, ctx, placement }: TitleBarRegionProps): react_jsx_runtime.JSX.Element | null;
|
|
68
74
|
|
|
69
75
|
/** Props for `<ToolbarRegion>`. */
|
|
70
76
|
interface ToolbarRegionProps {
|
|
@@ -86,4 +92,4 @@ interface ViewportRegionProps {
|
|
|
86
92
|
declare function ViewportRegion({ contributions, ctx }: ViewportRegionProps): react_jsx_runtime.JSX.Element | null;
|
|
87
93
|
|
|
88
94
|
export { PaletteRegion, SidebarRegion, StatusRegion, TitleBarRegion, ToolbarRegion, TrialChromeContext, TrialContribution, ViewportRegion, builtinContributions, mergeContributions, suppressContributions };
|
|
89
|
-
export type { PaletteRegionProps, SidebarRegionProps, StatusRegionProps, TitleBarRegionProps, ToolbarRegionProps, ViewportRegionProps };
|
|
95
|
+
export type { PaletteRegionProps, SidebarRegionProps, StatusRegionProps, TitleBarPlacement, TitleBarRegionProps, ToolbarRegionProps, ViewportRegionProps };
|
package/dist/chrome/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { PaletteRegion, SidebarRegion, StatusRegion, TitleBarRegion, ToolbarRegion, ViewportRegion, builtinContributions, mergeContributions, suppressContributions } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
3
|
-
import '../chunk-
|
|
1
|
+
export { PaletteRegion, SidebarRegion, StatusRegion, TitleBarRegion, ToolbarRegion, ViewportRegion, builtinContributions, mergeContributions, suppressContributions } from '../chunk-W2FJR5FF.js';
|
|
2
|
+
import '../chunk-UTOEDPNU.js';
|
|
3
|
+
import '../chunk-XKENZTNE.js';
|
|
4
4
|
import '../chunk-SBXNQW4G.js';
|
|
5
|
-
import '../chunk-
|
|
5
|
+
import '../chunk-ISSVF5PT.js';
|
|
6
6
|
import '../chunk-CQLQPQ4P.js';
|
|
7
|
-
import '../chunk-
|
|
7
|
+
import '../chunk-54ZWZ5FQ.js';
|
|
8
8
|
//# sourceMappingURL=index.js.map
|
|
9
9
|
//# sourceMappingURL=index.js.map
|