@weasel-js/labkit 1.4.4 → 1.5.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 +54 -6
- package/dist/_dts/{CanvasStackContext-kTEZvEgE.d.ts → CanvasStackContext-CJNMS6mz.d.ts} +1 -1
- package/dist/_dts/{PrefsForm.d-DDHFANkc.d.ts → PrefsForm.d-DPy9I8It.d.ts} +4 -0
- package/dist/_dts/Select.d-Gwr8fLpK.d.ts +453 -0
- package/dist/_dts/{frac-z7ker2Vx.d.ts → frac-B4okC2lX.d.ts} +291 -31
- package/dist/_dts/{index-Blv9uQzu.d.ts → index-BNdz-tNd.d.ts} +105 -17
- package/dist/_dts/index-CSJoj4LC.d.ts +248 -0
- package/dist/_dts/{types-B9_zrHmb.d.ts → types-DzoNY1pO.d.ts} +91 -4
- package/dist/_dts/usePanZoom-Pzf9f2jh.d.ts +160 -0
- package/dist/_dts/useTrialState-uLlmaccn.d.ts +212 -0
- package/dist/canvas/index.d.ts +18 -129
- package/dist/canvas/index.js +4 -2
- package/dist/chrome/index.d.ts +5 -93
- package/dist/chrome/index.js +10 -6
- package/dist/chunk-7PFH3CNM.js +150 -0
- package/dist/chunk-7PFH3CNM.js.map +1 -0
- package/dist/{chunk-I6JCVE24.js → chunk-CEIUBPPW.js} +143 -17
- package/dist/chunk-CEIUBPPW.js.map +1 -0
- package/dist/chunk-EH7UEQV7.js +590 -0
- package/dist/chunk-EH7UEQV7.js.map +1 -0
- package/dist/{chunk-MOM3GOVY.js → chunk-EHGVROVV.js} +125 -27
- package/dist/chunk-EHGVROVV.js.map +1 -0
- package/dist/{chunk-TJ7QY3OC.js → chunk-ERFMC6WU.js} +160 -78
- package/dist/chunk-ERFMC6WU.js.map +1 -0
- package/dist/{chunk-CTRKTLYZ.js → chunk-H6ZAOWNE.js} +11 -11
- package/dist/chunk-H6ZAOWNE.js.map +1 -0
- package/dist/{chunk-64ZCN3DA.js → chunk-IHUVQ3TX.js} +250 -160
- package/dist/chunk-IHUVQ3TX.js.map +1 -0
- package/dist/{chunk-FQMJUVHJ.js → chunk-IJJUK4FU.js} +53 -46
- package/dist/chunk-IJJUK4FU.js.map +1 -0
- package/dist/chunk-IXTQI7JX.js +737 -0
- package/dist/chunk-IXTQI7JX.js.map +1 -0
- package/dist/{chunk-BKFVHKJH.js → chunk-MDVTK5U3.js} +4 -4
- package/dist/{chunk-BKFVHKJH.js.map → chunk-MDVTK5U3.js.map} +1 -1
- package/dist/chunk-PHK4W562.js +72 -0
- package/dist/chunk-PHK4W562.js.map +1 -0
- package/dist/chunk-PJ7WEQBJ.js +18 -0
- package/dist/chunk-PJ7WEQBJ.js.map +1 -0
- package/dist/chunk-RWNDDKOH.js +682 -0
- package/dist/chunk-RWNDDKOH.js.map +1 -0
- package/dist/chunk-T3EC2DXD.js +12628 -0
- package/dist/chunk-T3EC2DXD.js.map +1 -0
- package/dist/{chunk-SMHP6XZ4.js → chunk-UN4U4P63.js} +10 -8
- package/dist/chunk-UN4U4P63.js.map +1 -0
- package/dist/chunk-WIG6XHJ7.js +35 -0
- package/dist/chunk-WIG6XHJ7.js.map +1 -0
- package/dist/chunk-Z76KEZAX.js +15 -0
- package/dist/chunk-Z76KEZAX.js.map +1 -0
- package/dist/chunk-ZDHY47EV.js +363 -0
- package/dist/chunk-ZDHY47EV.js.map +1 -0
- package/dist/config/index.d.ts +276 -0
- package/dist/config/index.js +8 -0
- package/dist/config/index.js.map +1 -0
- package/dist/controls/index.d.ts +3 -4
- package/dist/controls/index.js +4 -3
- package/dist/dragdrop/index.d.ts +3 -5
- package/dist/index.d.ts +266 -413
- package/dist/index.js +1775 -2251
- package/dist/index.js.map +1 -1
- package/dist/layers/index.d.ts +4 -6
- package/dist/layers/index.js +2 -2
- package/dist/loupe/index.d.ts +69 -20
- package/dist/loupe/index.js +2 -2
- package/dist/passthrough/weasel-ui.d.ts +175 -309
- package/dist/passthrough/weasel-ui.js +1 -1
- package/dist/primitives/index.d.ts +55 -6
- package/dist/primitives/index.js +6 -4
- package/dist/state/index.d.ts +13 -8
- package/dist/state/index.js +18 -13
- package/dist/state/index.js.map +1 -1
- package/dist/styles.css +223 -76
- package/dist/surface/index.d.ts +44 -7
- package/dist/surface/index.js +2 -1
- package/dist/ui/layers/index.js +1 -1
- package/dist/undo/index.d.ts +3 -5
- package/package.json +15 -8
- package/src/annotations/AnnotationOverlay.tsx +56 -5
- package/src/annotations/Annotations.less +4 -0
- package/src/annotations/Annotations.overlay.test.tsx +105 -6
- package/src/annotations/drawOne.test.ts +1 -1
- package/src/annotations/drawOne.ts +2 -2
- package/src/annotations/paint.test.ts +2 -2
- package/src/annotations/paint.ts +1 -1
- package/src/annotations/preload.ts +6 -0
- package/src/annotations/store.test.ts +18 -0
- package/src/annotations/store.ts +5 -4
- package/src/annotations/svgNodes.test.ts +2 -2
- package/src/annotations/svgNodes.ts +1 -0
- package/src/annotations/toolMap.test.ts +9 -5
- package/src/annotations/toolMap.ts +6 -3
- package/src/annotations/types.ts +6 -3
- package/src/canvas/CameraWheelContext.ts +12 -0
- package/src/canvas/CanvasStack.stories.tsx +1 -1
- package/src/canvas/CanvasStack.test.tsx +25 -0
- package/src/canvas/CanvasStack.tsx +31 -4
- package/src/canvas/Stage.less +18 -0
- package/src/canvas/Stage.test.tsx +186 -0
- package/src/canvas/Stage.tsx +134 -0
- package/src/canvas/camera.test.ts +17 -2
- package/src/canvas/camera.ts +9 -9
- package/src/canvas/index.ts +4 -0
- package/src/canvas/usePanZoom.test.ts +28 -0
- package/src/canvas/usePanZoom.ts +21 -9
- package/src/chrome/ChromeRegions.stories.tsx +1 -4
- package/src/chrome/LabChrome.tsx +130 -0
- package/src/chrome/builtins.test.ts +1 -0
- package/src/chrome/builtins.tsx +21 -31
- package/src/chrome/index.ts +16 -0
- package/src/chrome/labRegions.test.tsx +208 -0
- package/src/chrome/labTypes.ts +50 -0
- package/src/chrome/merge.ts +7 -9
- package/src/chrome/regions/PaletteRegion.test.tsx +6 -4
- package/src/chrome/regions/PaletteRegion.tsx +16 -9
- package/src/chrome/regions/SidebarRegion.stories.tsx +44 -0
- package/src/chrome/regions/SidebarRegion.tsx +25 -13
- package/src/chrome/regions/StatusRegion.tsx +15 -8
- package/src/chrome/regions/ToolbarRegion.tsx +34 -16
- package/src/chrome/types.ts +50 -20
- package/src/config/auto.test.ts +12 -0
- package/src/config/auto.ts +15 -0
- package/src/config/autoConfig.test.ts +107 -0
- package/src/config/autoConfig.ts +153 -0
- package/src/config/builder.test.ts +42 -0
- package/src/config/builder.ts +68 -17
- package/src/config/declarationEmit.fixture.ts +11 -0
- package/src/config/declarationEmit.test.ts +51 -0
- package/src/config/entry.test.ts +46 -0
- package/src/config/index.ts +16 -1
- package/src/config/nodeClasses.test.ts +18 -0
- package/src/config/path.ts +7 -2
- package/src/config/resolve.test.ts +25 -0
- package/src/config/resolve.ts +17 -1
- package/src/config/types.ts +34 -2
- package/src/config/useResolvedConfig.ts +26 -0
- package/src/controls/AutoControls.stories.tsx +88 -0
- package/src/controls/ControlPanel.stories.tsx +42 -1
- package/src/controls/ControlPanel.test.tsx +530 -4
- package/src/controls/ControlPanel.tsx +562 -82
- package/src/fake-indexeddb-auto.d.ts +5 -0
- package/src/index.test.ts +7 -0
- package/src/index.ts +66 -5
- package/src/instrument/serializers.test.ts +22 -0
- package/src/instrument/serializers.ts +40 -1
- package/src/instrument/types.ts +25 -1
- package/src/lab/Lab.chrome.test.tsx +16 -0
- package/src/lab/Lab.less +4 -13
- package/src/lab/Lab.persist.test.tsx +147 -0
- package/src/lab/Lab.stories.tsx +1 -3
- package/src/lab/Lab.surface.test.tsx +71 -3
- package/src/lab/Lab.test.tsx +168 -16
- package/src/lab/Lab.tsx +434 -129
- package/src/lab/LabContext.ts +8 -0
- package/src/lab/LabFit.stories.less +18 -0
- package/src/lab/LabFit.stories.tsx +219 -0
- package/src/lab/LabFullChrome.stories.tsx +1 -4
- package/src/lab/LabHeader.test.tsx +40 -9
- package/src/lab/LabHeader.tsx +7 -14
- package/src/lab/LabPalette.tsx +13 -26
- package/src/lab/LabRoot.test.tsx +56 -0
- package/src/lab/LabRoot.tsx +47 -0
- package/src/lab/LabShell.less +73 -15
- package/src/lab/LabShell.stories.tsx +50 -1
- package/src/lab/LabShell.tsx +18 -27
- package/src/lab/LabSwitcher.less +18 -11
- package/src/lab/LabSwitcher.test.tsx +14 -9
- package/src/lab/LabSwitcher.tsx +8 -4
- package/src/lab/Workspace.less +1 -1
- package/src/lab/Workspace.stories.tsx +1 -1
- package/src/lab/Workspace.surface.test.tsx +1 -0
- package/src/lab/fitCheck.test.ts +57 -0
- package/src/lab/fitCheck.ts +125 -0
- package/src/lab/index.ts +2 -0
- package/src/layers/LayerList.stories.tsx +1 -1
- package/src/loupe/AGENTS.md +17 -5
- package/src/loupe/Loupe.less +1 -1
- package/src/loupe/LoupeGestures.tsx +67 -0
- package/src/loupe/TrialLoupe.tsx +43 -28
- package/src/loupe/canvasLens.ts +1 -1
- package/src/loupe/index.ts +4 -0
- package/src/loupe/loupeActions.ts +98 -0
- package/src/loupe/types.ts +1 -1
- package/src/loupe/useLoupe.test.tsx +60 -3
- package/src/loupe/useLoupe.ts +29 -49
- package/src/passthrough/weasel-ui.ts +9 -0
- package/src/primitives/FloatingPanel.stories.tsx +14 -2
- package/src/primitives/FloatingPanel.test.tsx +47 -16
- package/src/primitives/FloatingPanel.tsx +11 -25
- package/src/primitives/FpsMeter.stories.tsx +1 -1
- package/src/primitives/JobProgress.stories.tsx +1 -1
- package/src/primitives/Legend.stories.tsx +1 -1
- package/src/primitives/ScaleIndicator.stories.tsx +1 -1
- package/src/primitives/Sidebar.less +7 -0
- package/src/primitives/Sidebar.stories.tsx +1 -1
- package/src/primitives/Split.less +14 -0
- package/src/primitives/Split.test.tsx +133 -0
- package/src/primitives/Split.tsx +175 -0
- package/src/primitives/StatusBar.stories.tsx +1 -1
- package/src/primitives/Toolbar.stories.tsx +1 -1
- package/src/primitives/ZoomControl.tsx +5 -2
- package/src/primitives/index.ts +2 -0
- package/src/specimen/Specimen.less +95 -0
- package/src/specimen/Specimen.stories.tsx +13 -0
- package/src/specimen/Specimen.test.tsx +13 -0
- package/src/specimen/Specimen.tsx +888 -0
- package/src/state/Persistence.stories.tsx +75 -0
- package/src/state/Persistence.tsx +33 -0
- package/src/state/SingletonExperiment.test.tsx +47 -53
- package/src/state/SingletonExperiment.tsx +24 -13
- package/src/state/adapterContract.ts +116 -0
- package/src/state/adapters.test.ts +113 -61
- package/src/state/adapters.ts +328 -69
- package/src/state/document.test.ts +71 -96
- package/src/state/document.ts +66 -52
- package/src/state/helpers.test.ts +1 -1
- package/src/state/index.ts +8 -0
- package/src/state/labRecords.test.ts +105 -0
- package/src/state/labRecords.ts +160 -0
- package/src/state/openLabStore.test.ts +658 -0
- package/src/state/openLabStore.ts +403 -0
- package/src/state/records.test.ts +234 -0
- package/src/state/records.ts +219 -0
- package/src/state/store.test.ts +169 -635
- package/src/state/store.ts +146 -163
- package/src/state/toolSlot.test.ts +1 -1
- package/src/state/types.ts +65 -17
- package/src/state/useOpenOnce.ts +68 -0
- package/src/state/usePersistedState.test.tsx +125 -0
- package/src/state/usePersistedState.ts +66 -0
- package/src/state/useTrialState.test.tsx +87 -3
- package/src/state/useTrialState.ts +9 -1
- package/src/state/view.test.ts +49 -15
- package/src/state/view.ts +18 -1
- package/src/styles.less +3 -0
- package/src/surface/AGENTS.md +39 -7
- package/src/surface/SurfaceContext.ts +26 -3
- package/src/surface/index.ts +2 -0
- package/src/surface/useSurfaceTile.test.tsx +1 -0
- package/src/surface/useSurfaceTile.ts +6 -5
- package/src/surface/useTiledSurface.test.tsx +231 -1
- package/src/surface/useTiledSurface.ts +76 -15
- package/src/theme/Interstellar.stories.tsx +9 -9
- package/src/theme/interstellar.test.ts +17 -6
- package/src/theme/interstellar.theme.json +180 -0
- package/src/theme/interstellar.ts +8 -5
- package/src/tools/labTool.ts +11 -0
- package/src/trial/Trial.annotations.persist.test.tsx +100 -58
- package/src/trial/Trial.annotations.test.tsx +59 -7
- package/src/trial/Trial.canvas.test.tsx +32 -0
- package/src/trial/Trial.config.test.tsx +75 -2
- package/src/trial/Trial.job.test.tsx +3 -3
- package/src/trial/Trial.less +5 -26
- package/src/trial/Trial.stories.tsx +5 -3
- package/src/trial/Trial.test.tsx +31 -4
- package/src/trial/Trial.trialId.test.tsx +23 -1
- package/src/trial/Trial.tsx +139 -52
- package/src/trial/TrialBody.tsx +17 -141
- package/src/trial/TrialChrome.tsx +24 -7
- package/src/trial/trialOps.test.ts +101 -1
- package/src/trial/trialOps.ts +67 -7
- package/dist/_dts/types-BP2OCcpg.d.ts +0 -155
- package/dist/_dts/types-x92Kfeme.d.ts +0 -62
- package/dist/_dts/useTrialState-D6Vb3T-g.d.ts +0 -99
- package/dist/chunk-2P6PP5N4.js +0 -553
- package/dist/chunk-2P6PP5N4.js.map +0 -1
- package/dist/chunk-64ZCN3DA.js.map +0 -1
- package/dist/chunk-CTRKTLYZ.js.map +0 -1
- package/dist/chunk-E44SU6XS.js +0 -50
- package/dist/chunk-E44SU6XS.js.map +0 -1
- package/dist/chunk-FQMJUVHJ.js.map +0 -1
- package/dist/chunk-I6JCVE24.js.map +0 -1
- package/dist/chunk-MOM3GOVY.js.map +0 -1
- package/dist/chunk-SMHP6XZ4.js.map +0 -1
- package/dist/chunk-TJ7QY3OC.js.map +0 -1
- package/dist/chunk-U3IYHIAE.js +0 -343
- package/dist/chunk-U3IYHIAE.js.map +0 -1
- package/dist/chunk-W3ECWC2K.js +0 -7335
- package/dist/chunk-W3ECWC2K.js.map +0 -1
- package/src/theme/interstellar.tokens.json +0 -61
package/dist/layers/index.d.ts
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { aa as LayerDescriptor } from '../_dts/frac-B4okC2lX.js';
|
|
2
|
+
export { a9 as LayerCapability } from '../_dts/frac-B4okC2lX.js';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import 'react';
|
|
5
|
-
import '../_dts/types-
|
|
5
|
+
import '../_dts/types-DzoNY1pO.js';
|
|
6
6
|
import '@weasel-js/core';
|
|
7
|
-
import '../_dts/PrefsForm.d-
|
|
8
|
-
import '../_dts/types-x92Kfeme.js';
|
|
9
|
-
import '../_dts/types-BP2OCcpg.js';
|
|
7
|
+
import '../_dts/PrefsForm.d-DPy9I8It.js';
|
|
10
8
|
import '../_dts/types-DJ79Tg5J.js';
|
|
11
9
|
|
|
12
10
|
/** A layer that may itself contain layers. A plain `LayerDescriptor` is one
|
package/dist/layers/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { LayerList } from '../chunk-
|
|
1
|
+
export { LayerList } from '../chunk-MDVTK5U3.js';
|
|
2
2
|
import '../chunk-SBXNQW4G.js';
|
|
3
|
-
import '../chunk-
|
|
3
|
+
import '../chunk-T3EC2DXD.js';
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
package/dist/loupe/index.d.ts
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
4
|
-
import { c as CanvasStackSurface, C as CanvasLayerDescriptor } from '../_dts/CanvasStackContext-
|
|
2
|
+
import { aG as LoupePoint, aH as LoupeMode, k as ViewTransform, W as WorldFrame, a as WorldSpec, V as ViewportSize, ad as LoupeRenderArgs, ag as ResolvedLoupe } from '../_dts/frac-B4okC2lX.js';
|
|
3
|
+
export { a8 as LOUPE_DEFAULTS, ab as LoupeCapability, ac as LoupeDeclaration, aD as resolveLoupe } from '../_dts/frac-B4okC2lX.js';
|
|
4
|
+
import { c as CanvasStackSurface, C as CanvasLayerDescriptor } from '../_dts/CanvasStackContext-CJNMS6mz.js';
|
|
5
5
|
import { RefObject, ReactNode } from 'react';
|
|
6
|
-
import '
|
|
7
|
-
import '
|
|
8
|
-
import '../_dts/PrefsForm.d-
|
|
9
|
-
import '../_dts/types-x92Kfeme.js';
|
|
10
|
-
import '../_dts/types-BP2OCcpg.js';
|
|
6
|
+
import { Action } from '@weasel-js/core';
|
|
7
|
+
import '../_dts/types-DzoNY1pO.js';
|
|
8
|
+
import '../_dts/PrefsForm.d-DPy9I8It.js';
|
|
11
9
|
import '../_dts/types-DJ79Tg5J.js';
|
|
12
10
|
|
|
13
11
|
/** Props for `<CanvasLoupe>`. */
|
|
@@ -56,7 +54,7 @@ interface SourceRect {
|
|
|
56
54
|
*/
|
|
57
55
|
declare function lensSourceRect(aim: LoupePoint, factor: number, diameter: number, dpr: number): SourceRect;
|
|
58
56
|
/**
|
|
59
|
-
* The
|
|
57
|
+
* The color a stack presents at a point: the topmost visible layer with
|
|
60
58
|
* anything opaque there, or `null` when every layer is transparent — which is
|
|
61
59
|
* the honest answer for a point showing nothing but the workspace behind.
|
|
62
60
|
*/
|
|
@@ -120,6 +118,53 @@ interface LoupeBubbleProps {
|
|
|
120
118
|
*/
|
|
121
119
|
declare function LoupeBubble({ aim, diameter, hostRef, children }: LoupeBubbleProps): react_jsx_runtime.JSX.Element;
|
|
122
120
|
|
|
121
|
+
/**
|
|
122
|
+
* The loupe's two bindable interactions, as `Action` descriptors the gesture
|
|
123
|
+
* dispatcher routes: hold a key to peek, and walk the magnification with the
|
|
124
|
+
* wheel.
|
|
125
|
+
*
|
|
126
|
+
* Free of React so the routing can be tested without a DOM.
|
|
127
|
+
*/
|
|
128
|
+
|
|
129
|
+
/** Canonical id of the hold-to-peek action. */
|
|
130
|
+
declare const LOUPE_PEEK_ID = "loupe.peek";
|
|
131
|
+
/** Canonical id of the wheel-magnify action. */
|
|
132
|
+
declare const LOUPE_MAGNIFY_ID = "loupe.magnify";
|
|
133
|
+
/** What the actions do to a live loupe. Every member is read through the
|
|
134
|
+
* object on each invocation, so one stable instance serves the life of the
|
|
135
|
+
* registration. */
|
|
136
|
+
interface LoupeInputApi {
|
|
137
|
+
/** Whether the lens is up. The wheel belongs to the loupe only while it is;
|
|
138
|
+
* otherwise `loupe.magnify` declines and the dispatcher leaves the event
|
|
139
|
+
* unhandled, which is what hands it back to the lab's own pan/zoom. */
|
|
140
|
+
shown: () => boolean;
|
|
141
|
+
/** Raise or drop the hold-to-peek flag. */
|
|
142
|
+
setPeeking: (on: boolean) => void;
|
|
143
|
+
/** Multiply the magnification by one wheel notch of `deltaY`. */
|
|
144
|
+
magnifyBy: (deltaY: number) => void;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Build the loupe's actions. `peekKey` is a `KeyboardEvent.key`; passing
|
|
148
|
+
* `null` omits `loupe.peek` entirely rather than registering a binding no key
|
|
149
|
+
* can match.
|
|
150
|
+
*/
|
|
151
|
+
declare function createLoupeActions(input: LoupeInputApi, peekKey: string | null): readonly Action[];
|
|
152
|
+
|
|
153
|
+
/** Props for `<LoupeGestures>`. */
|
|
154
|
+
interface LoupeGesturesProps {
|
|
155
|
+
/** The element the dispatcher listens on — the same one the lens tracks. */
|
|
156
|
+
hostRef: RefObject<HTMLElement | null>;
|
|
157
|
+
input: LoupeInputApi;
|
|
158
|
+
/** `KeyboardEvent.key` for hold-to-peek, or `null` for no peek binding. */
|
|
159
|
+
peekKey: string | null;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* The loupe's input, routed. Render it inside a `<WeaselProvider isolate>` —
|
|
163
|
+
* with no registry in scope it renders nothing rather than registering
|
|
164
|
+
* actions that could never fire.
|
|
165
|
+
*/
|
|
166
|
+
declare function LoupeGestures(props: LoupeGesturesProps): react_jsx_runtime.JSX.Element | null;
|
|
167
|
+
|
|
123
168
|
/** Props for `<TrialLoupe>`. */
|
|
124
169
|
interface TrialLoupeProps {
|
|
125
170
|
capability: ResolvedLoupe;
|
|
@@ -139,7 +184,7 @@ interface TrialLoupeProps {
|
|
|
139
184
|
* stack it is mounted inside, or the instrument's own `render` at a magnified
|
|
140
185
|
* camera.
|
|
141
186
|
*/
|
|
142
|
-
declare function TrialLoupe({ capability, enabled, state, config, view, worldSpec, hostRef, }: TrialLoupeProps): react_jsx_runtime.JSX.Element
|
|
187
|
+
declare function TrialLoupe({ capability, enabled, state, config, view, worldSpec, hostRef, }: TrialLoupeProps): react_jsx_runtime.JSX.Element;
|
|
143
188
|
|
|
144
189
|
/** Options for {@link useLoupe}. */
|
|
145
190
|
interface UseLoupeOptions {
|
|
@@ -148,7 +193,7 @@ interface UseLoupeOptions {
|
|
|
148
193
|
hostRef: RefObject<HTMLElement | null>;
|
|
149
194
|
/** Whether the loupe is turned on. Hold-to-peek shows it regardless. */
|
|
150
195
|
enabled: boolean;
|
|
151
|
-
/** Hex
|
|
196
|
+
/** Hex color at a host point. Omitted, the loupe reports no color — which
|
|
152
197
|
* is the honest answer for a surface with no pixels to read. */
|
|
153
198
|
sample?: (p: LoupePoint) => string | null;
|
|
154
199
|
}
|
|
@@ -165,18 +210,22 @@ interface LoupeState {
|
|
|
165
210
|
setFactor: (factor: number) => void;
|
|
166
211
|
/** Sample what the lens shows at a point inside it. */
|
|
167
212
|
pick: (p?: LoupePoint) => string | null;
|
|
213
|
+
/** What `<LoupeGestures>` drives the lens through. Stable for the life of
|
|
214
|
+
* the hook, so registering the actions on it does not churn. */
|
|
215
|
+
input: LoupeInputApi;
|
|
168
216
|
}
|
|
169
217
|
/**
|
|
170
|
-
* Binds `@weasel-js/loupe`'s model to a host element and
|
|
171
|
-
*
|
|
218
|
+
* Binds `@weasel-js/loupe`'s model to a host element and tracks the pointer
|
|
219
|
+
* across it.
|
|
172
220
|
*
|
|
173
|
-
*
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
*
|
|
177
|
-
*
|
|
221
|
+
* The peek key and the wheel are not here: they are `loupe.peek` and
|
|
222
|
+
* `loupe.magnify`, routed through the gesture dispatcher that
|
|
223
|
+
* `<LoupeGestures>` mounts on the same host. Aiming stays a plain listener
|
|
224
|
+
* because a hover is not a gesture the grammar names — `GESTURE_DESCRIPTORS`
|
|
225
|
+
* has no continuous-motion entry, and inventing one to carry the lens' aim
|
|
226
|
+
* would be an input taxonomy change, not a loupe change.
|
|
178
227
|
*/
|
|
179
228
|
declare function useLoupe({ capability, hostRef, enabled, sample }: UseLoupeOptions): LoupeState;
|
|
180
229
|
|
|
181
|
-
export { CanvasLoupe, DomLoupe, LoupeBubble, LoupeRenderArgs, ResolvedLoupe, TrialLoupe, drawCanvasLens, lensCamera, lensSourceRect, sampleStack, useLoupe };
|
|
182
|
-
export type { CanvasLoupeProps, DomLoupeProps, LensCamera, LoupeBubbleProps, LoupeState, SourceRect, TrialLoupeProps, UseLoupeOptions };
|
|
230
|
+
export { CanvasLoupe, DomLoupe, LOUPE_MAGNIFY_ID, LOUPE_PEEK_ID, LoupeBubble, LoupeGestures, LoupeRenderArgs, ResolvedLoupe, TrialLoupe, createLoupeActions, drawCanvasLens, lensCamera, lensSourceRect, sampleStack, useLoupe };
|
|
231
|
+
export type { CanvasLoupeProps, DomLoupeProps, LensCamera, LoupeBubbleProps, LoupeGesturesProps, LoupeInputApi, LoupeState, SourceRect, TrialLoupeProps, UseLoupeOptions };
|
package/dist/loupe/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { CanvasLoupe, DomLoupe, LOUPE_DEFAULTS, LoupeBubble, TrialLoupe, drawCanvasLens, lensCamera, lensSourceRect, resolveLoupe, sampleStack, useLoupe } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { CanvasLoupe, DomLoupe, LOUPE_DEFAULTS, LOUPE_MAGNIFY_ID, LOUPE_PEEK_ID, LoupeBubble, LoupeGestures, TrialLoupe, createLoupeActions, drawCanvasLens, lensCamera, lensSourceRect, resolveLoupe, sampleStack, useLoupe } from '../chunk-ERFMC6WU.js';
|
|
2
|
+
import '../chunk-H6ZAOWNE.js';
|
|
3
3
|
import '../chunk-2AYGEN57.js';
|
|
4
4
|
import '../chunk-CQLQPQ4P.js';
|
|
5
5
|
//# sourceMappingURL=index.js.map
|