@weasel-js/labkit 1.4.2 → 1.4.4
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 +20 -2
- package/dist/_dts/{CanvasStackContext-kjILVnPj.d.ts → CanvasStackContext-kTEZvEgE.d.ts} +1 -1
- package/dist/_dts/{PrefsForm.d-CgxUequc.d.ts → PrefsForm.d-DDHFANkc.d.ts} +1 -1
- package/dist/_dts/{frac-A4R6v4ld.d.ts → frac-z7ker2Vx.d.ts} +11 -7
- package/dist/_dts/{index-CsU9WhjM.d.ts → index-Blv9uQzu.d.ts} +42 -9
- package/dist/_dts/types-B9_zrHmb.d.ts +166 -0
- package/dist/_dts/{types-BbXpvQa8.d.ts → types-BP2OCcpg.d.ts} +21 -3
- package/dist/_dts/types-x92Kfeme.d.ts +62 -0
- package/dist/_dts/{useTrialState-DKjqpv20.d.ts → useTrialState-D6Vb3T-g.d.ts} +7 -7
- package/dist/canvas/index.d.ts +9 -8
- package/dist/canvas/index.js +1 -2
- package/dist/chrome/index.d.ts +7 -6
- package/dist/chrome/index.js +5 -5
- package/dist/{chunk-ULDW42CR.js → chunk-2P6PP5N4.js} +33 -23
- package/dist/chunk-2P6PP5N4.js.map +1 -0
- package/dist/{chunk-W2FJR5FF.js → chunk-64ZCN3DA.js} +74 -76
- package/dist/chunk-64ZCN3DA.js.map +1 -0
- package/dist/{chunk-NSOVI3AZ.js → chunk-BKFVHKJH.js} +6 -6
- package/dist/{chunk-NSOVI3AZ.js.map → chunk-BKFVHKJH.js.map} +1 -1
- package/dist/chunk-E44SU6XS.js +50 -0
- package/dist/chunk-E44SU6XS.js.map +1 -0
- package/dist/{chunk-WS6ZRV75.js → chunk-FQMJUVHJ.js} +3 -3
- package/dist/{chunk-WS6ZRV75.js.map → chunk-FQMJUVHJ.js.map} +1 -1
- package/dist/{chunk-FJG4PHTL.js → chunk-I6JCVE24.js} +3 -3
- package/dist/chunk-I6JCVE24.js.map +1 -0
- package/dist/{chunk-UDXOYZEC.js → chunk-MOM3GOVY.js} +4 -4
- package/dist/{chunk-UDXOYZEC.js.map → chunk-MOM3GOVY.js.map} +1 -1
- package/dist/{chunk-TN7YSJVU.js → chunk-RS3HRQWU.js} +3 -3
- package/dist/{chunk-TN7YSJVU.js.map → chunk-RS3HRQWU.js.map} +1 -1
- package/dist/{chunk-UTOEDPNU.js → chunk-SMHP6XZ4.js} +7 -6
- package/dist/chunk-SMHP6XZ4.js.map +1 -0
- package/dist/{chunk-D5KQ5OY6.js → chunk-TJ7QY3OC.js} +3 -3
- package/dist/{chunk-D5KQ5OY6.js.map → chunk-TJ7QY3OC.js.map} +1 -1
- package/dist/{chunk-XKENZTNE.js → chunk-U3IYHIAE.js} +71 -55
- package/dist/chunk-U3IYHIAE.js.map +1 -0
- package/dist/chunk-W3ECWC2K.js +7335 -0
- package/dist/chunk-W3ECWC2K.js.map +1 -0
- package/dist/controls/index.d.ts +5 -4
- package/dist/controls/index.js +3 -3
- package/dist/dragdrop/index.d.ts +6 -5
- package/dist/dragdrop/index.js +1 -2
- package/dist/index.d.ts +139 -26
- package/dist/index.js +309 -144
- package/dist/index.js.map +1 -1
- package/dist/layers/index.d.ts +7 -6
- package/dist/layers/index.js +2 -3
- package/dist/loupe/index.d.ts +8 -7
- package/dist/loupe/index.js +1 -2
- package/dist/passthrough/weasel-canvas.d.ts +1 -3
- package/dist/passthrough/weasel-canvas.js +1 -1
- package/dist/passthrough/weasel-canvas.js.map +1 -1
- package/dist/passthrough/weasel-ui.d.ts +98 -20
- package/dist/passthrough/weasel-ui.js +1 -2
- package/dist/primitives/index.js +3 -4
- package/dist/state/index.d.ts +6 -3
- package/dist/state/index.js +3 -2
- package/dist/state/index.js.map +1 -1
- package/dist/styles.css +82 -15
- package/dist/surface/index.js +1 -2
- package/dist/ui/layers/index.js +1 -2
- package/dist/undo/index.d.ts +6 -6
- package/package.json +7 -7
- package/src/annotations/ExportMenu.test.tsx +16 -0
- package/src/annotations/ExportMenu.tsx +0 -5
- package/src/annotations/frac.test.ts +4 -4
- package/src/annotations/frac.ts +3 -2
- package/src/annotations/index.ts +1 -1
- package/src/annotations/store.ts +2 -2
- package/src/annotations/svgNodes.ts +1 -2
- package/src/config/builder.test.ts +56 -2
- package/src/config/builder.ts +73 -13
- package/src/config/index.ts +16 -1
- package/src/config/path.test.ts +109 -0
- package/src/config/path.ts +76 -0
- package/src/config/resolve.test.ts +93 -2
- package/src/config/resolve.ts +72 -29
- package/src/config/types.ts +99 -9
- package/src/config/visible.ts +6 -4
- package/src/controls/ControlPanel.stories.tsx +38 -4
- package/src/controls/ControlPanel.test.tsx +114 -0
- package/src/controls/ControlPanel.tsx +99 -50
- package/src/index.ts +17 -2
- package/src/instrument/serializers.ts +36 -0
- package/src/instrument/types.ts +4 -2
- package/src/lab/Lab.test.tsx +29 -1
- package/src/lab/Lab.tsx +10 -1
- package/src/lab/LabShell.test.tsx +8 -0
- package/src/lab/LabShell.tsx +17 -3
- package/src/lab/LabSwitcher.less +85 -0
- package/src/lab/LabSwitcher.test.tsx +96 -0
- package/src/lab/LabSwitcher.tsx +112 -0
- package/src/lab/index.ts +2 -0
- package/src/primitives/ZoomControl.less +6 -2
- package/src/primitives/ZoomControl.tsx +1 -0
- package/src/state/helpers.test.ts +20 -0
- package/src/state/helpers.ts +17 -1
- package/src/state/store.test.ts +155 -1
- package/src/state/store.ts +32 -26
- package/src/state/types.ts +24 -3
- package/src/state/useTrialState.ts +1 -1
- package/src/styles.less +1 -0
- package/src/theme/base.less +4 -4
- package/src/trial/Trial.config.test.tsx +44 -0
- package/src/trial/Trial.tsx +3 -3
- package/src/trial/TrialChrome.tsx +10 -5
- package/src/trial/trialOps.ts +7 -10
- package/dist/_dts/types-lg4TSCb2.d.ts +0 -164
- package/dist/_dts/weasel-canvas-FJTFi3ZZ.d.ts +0 -5041
- package/dist/chunk-54ZWZ5FQ.js +0 -29997
- package/dist/chunk-54ZWZ5FQ.js.map +0 -1
- package/dist/chunk-FJG4PHTL.js.map +0 -1
- package/dist/chunk-ISSVF5PT.js +0 -7263
- package/dist/chunk-ISSVF5PT.js.map +0 -1
- package/dist/chunk-ULDW42CR.js.map +0 -1
- package/dist/chunk-UTOEDPNU.js.map +0 -1
- package/dist/chunk-W2FJR5FF.js.map +0 -1
- package/dist/chunk-XKENZTNE.js.map +0 -1
package/dist/layers/index.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { E as LayerDescriptor } from '../_dts/frac-
|
|
2
|
-
export { B as LayerCapability } from '../_dts/frac-
|
|
1
|
+
import { E as LayerDescriptor } from '../_dts/frac-z7ker2Vx.js';
|
|
2
|
+
export { B as LayerCapability } from '../_dts/frac-z7ker2Vx.js';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import 'react';
|
|
5
|
-
import '../_dts/types-
|
|
6
|
-
import '
|
|
7
|
-
import '../_dts/PrefsForm.d-
|
|
8
|
-
import '../_dts/types-
|
|
5
|
+
import '../_dts/types-B9_zrHmb.js';
|
|
6
|
+
import '@weasel-js/core';
|
|
7
|
+
import '../_dts/PrefsForm.d-DDHFANkc.js';
|
|
8
|
+
import '../_dts/types-x92Kfeme.js';
|
|
9
|
+
import '../_dts/types-BP2OCcpg.js';
|
|
9
10
|
import '../_dts/types-DJ79Tg5J.js';
|
|
10
11
|
|
|
11
12
|
/** A layer that may itself contain layers. A plain `LayerDescriptor` is one
|
package/dist/layers/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
export { LayerList } from '../chunk-
|
|
1
|
+
export { LayerList } from '../chunk-BKFVHKJH.js';
|
|
2
2
|
import '../chunk-SBXNQW4G.js';
|
|
3
|
-
import '../chunk-
|
|
4
|
-
import '../chunk-54ZWZ5FQ.js';
|
|
3
|
+
import '../chunk-W3ECWC2K.js';
|
|
5
4
|
//# sourceMappingURL=index.js.map
|
|
6
5
|
//# sourceMappingURL=index.js.map
|
package/dist/loupe/index.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { ae as LoupePoint, af as LoupeMode, V as ViewTransform, W as WorldFrame, c as WorldSpec, a2 as ViewportSize, K as LoupeRenderArgs, N as ResolvedLoupe } from '../_dts/frac-
|
|
3
|
-
export { L as LOUPE_DEFAULTS, G as LoupeCapability, J as LoupeDeclaration, ab as resolveLoupe } from '../_dts/frac-
|
|
4
|
-
import { c as CanvasStackSurface, C as CanvasLayerDescriptor } from '../_dts/CanvasStackContext-
|
|
2
|
+
import { ae as LoupePoint, af as LoupeMode, V as ViewTransform, W as WorldFrame, c as WorldSpec, a2 as ViewportSize, K as LoupeRenderArgs, N as ResolvedLoupe } from '../_dts/frac-z7ker2Vx.js';
|
|
3
|
+
export { L as LOUPE_DEFAULTS, G as LoupeCapability, J as LoupeDeclaration, ab as resolveLoupe } from '../_dts/frac-z7ker2Vx.js';
|
|
4
|
+
import { c as CanvasStackSurface, C as CanvasLayerDescriptor } from '../_dts/CanvasStackContext-kTEZvEgE.js';
|
|
5
5
|
import { RefObject, ReactNode } from 'react';
|
|
6
|
-
import '../_dts/types-
|
|
7
|
-
import '
|
|
8
|
-
import '../_dts/PrefsForm.d-
|
|
9
|
-
import '../_dts/types-
|
|
6
|
+
import '../_dts/types-B9_zrHmb.js';
|
|
7
|
+
import '@weasel-js/core';
|
|
8
|
+
import '../_dts/PrefsForm.d-DDHFANkc.js';
|
|
9
|
+
import '../_dts/types-x92Kfeme.js';
|
|
10
|
+
import '../_dts/types-BP2OCcpg.js';
|
|
10
11
|
import '../_dts/types-DJ79Tg5J.js';
|
|
11
12
|
|
|
12
13
|
/** Props for `<CanvasLoupe>`. */
|
package/dist/loupe/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
export { CanvasLoupe, DomLoupe, LOUPE_DEFAULTS, LoupeBubble, TrialLoupe, drawCanvasLens, lensCamera, lensSourceRect, resolveLoupe, sampleStack, useLoupe } from '../chunk-
|
|
1
|
+
export { CanvasLoupe, DomLoupe, LOUPE_DEFAULTS, LoupeBubble, TrialLoupe, drawCanvasLens, lensCamera, lensSourceRect, resolveLoupe, sampleStack, useLoupe } from '../chunk-TJ7QY3OC.js';
|
|
2
2
|
import '../chunk-CTRKTLYZ.js';
|
|
3
3
|
import '../chunk-2AYGEN57.js';
|
|
4
4
|
import '../chunk-CQLQPQ4P.js';
|
|
5
|
-
import '../chunk-54ZWZ5FQ.js';
|
|
6
5
|
//# sourceMappingURL=index.js.map
|
|
7
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,3 +1 @@
|
|
|
1
|
-
export {
|
|
2
|
-
import 'react';
|
|
3
|
-
import 'react/jsx-runtime';
|
|
1
|
+
export { ComputeFitViewOptions, FALLBACK_FIT_VIEW, IndicatorStyle, MinimapCanvas, MinimapCanvasProps, MinimapFit, SceneViewCanvas, SceneViewCanvasProps, SceneViewDrawOne, buildSceneViewCommands, computeFitView, computeIndicatorCommand, renderSceneToCanvas } from '@weasel-js/core';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { FALLBACK_FIT_VIEW, MinimapCanvas, SceneViewCanvas, buildSceneViewCommands, computeFitView, computeIndicatorCommand, renderSceneToCanvas } from '
|
|
1
|
+
export { FALLBACK_FIT_VIEW, MinimapCanvas, SceneViewCanvas, buildSceneViewCommands, computeFitView, computeIndicatorCommand, renderSceneToCanvas } from '@weasel-js/core';
|
|
2
2
|
//# sourceMappingURL=weasel-canvas.js.map
|
|
3
3
|
//# sourceMappingURL=weasel-canvas.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"weasel-canvas.js"}
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"weasel-canvas.js","sourcesContent":[]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
2
|
+
import { ToolPrefLeaf, ToolPrefGroup, ToolsApi } from '@weasel-js/core';
|
|
3
|
+
export { ToolPref as BuiltinPref, ToolPrefBoolean as PrefBoolean, ToolPrefBooleanControl as PrefBooleanControl, ToolPrefColor as PrefColor, ToolPrefCustom as PrefCustom, ToolPrefEnum as PrefEnum, ToolPrefEnumControl as PrefEnumControl, ToolPrefEnumEncoding as PrefEnumEncoding, ToolPrefGroup as PrefGroup, ToolPrefKind as PrefKind, ToolPrefLeaf as PrefLeaf, ToolPrefNumber as PrefNumber, ToolPrefNumberControl as PrefNumberControl, ToolPrefNumberUnit as PrefNumberUnit, ToolPrefObject as PrefObject, ToolPrefPaint as PrefPaint, ToolPrefString as PrefString, ToolPrefStringControl as PrefStringControl } from '@weasel-js/core';
|
|
4
4
|
import * as react from 'react';
|
|
5
5
|
import { ReactNode, CSSProperties, ButtonHTMLAttributes, ReactElement, KeyboardEvent, RefObject, PointerEvent, RefCallback } from 'react';
|
|
6
6
|
export { LayerStack, LayerStackItem, LayerStackProps } from '../ui/layers/index.js';
|
|
7
|
-
export { a as PrefRenderContext, P as PrefRenderer } from '../_dts/PrefsForm.d-
|
|
7
|
+
export { a as PrefRenderContext, P as PrefRenderer } from '../_dts/PrefsForm.d-DDHFANkc.js';
|
|
8
8
|
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';
|
|
9
9
|
export { DialogTrigger as CalloutTrigger } from 'react-aria-components';
|
|
10
10
|
|
|
@@ -136,18 +136,6 @@ declare function Icon({ name, className, size, label }: IconProps & {
|
|
|
136
136
|
name: IconName;
|
|
137
137
|
}): react_jsx_runtime.JSX.Element;
|
|
138
138
|
|
|
139
|
-
/** Holds the set of available modes and which one is active, and notifies
|
|
140
|
-
* subscribers when that changes. `getVersion` is a monotonic counter for
|
|
141
|
-
* render-cache invalidation. Unknown mode ids throw rather than being
|
|
142
|
-
* ignored. */
|
|
143
|
-
interface ModeRegistry {
|
|
144
|
-
current(): ModeDefinition;
|
|
145
|
-
setMode(id: string): void;
|
|
146
|
-
byId(id: string): ModeDefinition;
|
|
147
|
-
getVersion(): number;
|
|
148
|
-
subscribe(listener: () => void): () => void;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
139
|
/** Props for {@link ActionBar}. */
|
|
152
140
|
interface ActionBarProps {
|
|
153
141
|
/** Group key — only actions with `action.group === group` are rendered. */
|
|
@@ -904,6 +892,11 @@ type ButtonSize = 'sm' | 'md';
|
|
|
904
892
|
type ButtonBase = {
|
|
905
893
|
variant?: ButtonVariant;
|
|
906
894
|
size?: ButtonSize;
|
|
895
|
+
/** A button that stays down: renders `aria-pressed` and holds the active
|
|
896
|
+
* treatment while it is on. For a control that reports a state rather than
|
|
897
|
+
* firing an action -- a panel toggle, a mode switch. Left off, the button
|
|
898
|
+
* announces no pressed state at all, which is what an action button wants. */
|
|
899
|
+
pressed?: boolean;
|
|
907
900
|
disabled?: boolean;
|
|
908
901
|
loading?: boolean;
|
|
909
902
|
leadingIcon?: ReactNode;
|
|
@@ -1649,6 +1642,67 @@ interface ToolGroupProps {
|
|
|
1649
1642
|
*/
|
|
1650
1643
|
declare function ToolGroup(props: ToolGroupProps): react_jsx_runtime.JSX.Element;
|
|
1651
1644
|
|
|
1645
|
+
/** The full vocabulary of capability tags shipped in the default preset.
|
|
1646
|
+
* Apps and other consumers can add their own tags; this list is what
|
|
1647
|
+
* `weasel-modes` itself uses. */
|
|
1648
|
+
declare const ALL_TAGS: readonly ["navigation", "creates-selection", "creates-paths", "creates-shapes", "creates-text", "edits-anchors", "edits-text", "transforms-selection", "samples-color", "applies-fill", "edits-page"];
|
|
1649
|
+
/** One capability a tool or contribution declares, and a mode allows. Any
|
|
1650
|
+
* string is accepted so apps can add tags of their own; `ALL_TAGS` is the
|
|
1651
|
+
* set this package ships. */
|
|
1652
|
+
type CapabilityTag = (typeof ALL_TAGS)[number] | (string & {});
|
|
1653
|
+
|
|
1654
|
+
/** How a mode tints the workspace — the area around the page — so the user
|
|
1655
|
+
* can see at a glance which mode is active. */
|
|
1656
|
+
interface WorkspaceVisual {
|
|
1657
|
+
tint?: string;
|
|
1658
|
+
gradient?: 'top-down' | 'bottom-up';
|
|
1659
|
+
intensity?: number;
|
|
1660
|
+
}
|
|
1661
|
+
/**
|
|
1662
|
+
* A mode: an app-level editing context that narrows which tools are usable and
|
|
1663
|
+
* how the workspace looks. Tools live inside modes; a tool is never "in" one.
|
|
1664
|
+
*
|
|
1665
|
+
* `kind` picks the lifecycle. A `soft` mode (path-edit, isolation, text-edit)
|
|
1666
|
+
* is a scoped context with no commit ceremony — every edit inside it is
|
|
1667
|
+
* independently undoable and `exit` is non-destructive. A `strict` mode
|
|
1668
|
+
* (free-transform, crop) is a transaction: the whole session collapses to one
|
|
1669
|
+
* undoable step and leaving requires an explicit `commit` or `cancel`.
|
|
1670
|
+
*/
|
|
1671
|
+
interface ModeDefinition {
|
|
1672
|
+
id: string;
|
|
1673
|
+
kind: 'soft' | 'strict';
|
|
1674
|
+
/** Capability tags this mode allows beyond IMPLICIT_TAGS. */
|
|
1675
|
+
allows: CapabilityTag[];
|
|
1676
|
+
/** When true, out-of-target objects dim at the renderer layer. */
|
|
1677
|
+
scoping: boolean;
|
|
1678
|
+
workspace?: WorkspaceVisual;
|
|
1679
|
+
entry?: {
|
|
1680
|
+
shortcut?: string;
|
|
1681
|
+
trigger?: 'double-click-target';
|
|
1682
|
+
};
|
|
1683
|
+
exit?: {
|
|
1684
|
+
shortcut?: string;
|
|
1685
|
+
};
|
|
1686
|
+
commit?: {
|
|
1687
|
+
shortcut?: string;
|
|
1688
|
+
};
|
|
1689
|
+
cancel?: {
|
|
1690
|
+
shortcut?: string;
|
|
1691
|
+
};
|
|
1692
|
+
}
|
|
1693
|
+
|
|
1694
|
+
/** Holds the set of available modes and which one is active, and notifies
|
|
1695
|
+
* subscribers when that changes. `getVersion` is a monotonic counter for
|
|
1696
|
+
* render-cache invalidation. Unknown mode ids throw rather than being
|
|
1697
|
+
* ignored. */
|
|
1698
|
+
interface ModeRegistry {
|
|
1699
|
+
current(): ModeDefinition;
|
|
1700
|
+
setMode(id: string): void;
|
|
1701
|
+
byId(id: string): ModeDefinition;
|
|
1702
|
+
getVersion(): number;
|
|
1703
|
+
subscribe(listener: () => void): () => void;
|
|
1704
|
+
}
|
|
1705
|
+
|
|
1652
1706
|
interface ShortcutInput {
|
|
1653
1707
|
key: string | readonly string[];
|
|
1654
1708
|
mod?: boolean;
|
|
@@ -1899,6 +1953,19 @@ declare const NumberField: react.ForwardRefExoticComponent<Omit<NumberFieldProps
|
|
|
1899
1953
|
className?: string;
|
|
1900
1954
|
} & react.RefAttributes<HTMLInputElement>>;
|
|
1901
1955
|
|
|
1956
|
+
/** The `portalContainer` prop every weasel overlay accepts. */
|
|
1957
|
+
interface OverlayPortalProps {
|
|
1958
|
+
/**
|
|
1959
|
+
* Where the overlay's portal mounts. Defaults to the nearest ancestor of
|
|
1960
|
+
* the overlay's own position that carries a weasel theme, so the overlay
|
|
1961
|
+
* resolves the same `--wzl-*` tokens as the control it belongs to. Pass
|
|
1962
|
+
* `null` for `document.body`.
|
|
1963
|
+
*/
|
|
1964
|
+
portalContainer?: Element | null;
|
|
1965
|
+
}
|
|
1966
|
+
/** React Aria props minus the portal key a weasel overlay owns. */
|
|
1967
|
+
type WithoutPortalTarget<T> = Omit<T, 'UNSTABLE_portalContainer'>;
|
|
1968
|
+
|
|
1902
1969
|
/** One option in a {@link Select}'s `options` list. */
|
|
1903
1970
|
type SelectOption = {
|
|
1904
1971
|
value: string;
|
|
@@ -1937,7 +2004,7 @@ type SelectProps<T extends Key$1 = string> = Omit<SelectProps$1<object>, 'childr
|
|
|
1937
2004
|
*/
|
|
1938
2005
|
width?: 'fill' | 'fit';
|
|
1939
2006
|
className?: string;
|
|
1940
|
-
};
|
|
2007
|
+
} & OverlayPortalProps;
|
|
1941
2008
|
/**
|
|
1942
2009
|
* Form select wrapping React Aria's Select. Pass either `options` for a
|
|
1943
2010
|
* quick declarative render or `children` of `<SelectItem>` for control over
|
|
@@ -1988,8 +2055,14 @@ type ComboBoxProps<T extends Key = string> = Omit<ComboBoxProps$1<object>, 'chil
|
|
|
1988
2055
|
defaultSelectedKey?: T;
|
|
1989
2056
|
onSelectionChange?: (key: T | null) => void;
|
|
1990
2057
|
emptyLabel?: ReactNode;
|
|
2058
|
+
/**
|
|
2059
|
+
* `'fill'` (the default) takes the width of whatever row the combo box sits
|
|
2060
|
+
* in. `'fit'` sizes the input to its widest option, so it neither swallows a
|
|
2061
|
+
* toolbar's slack nor cuts a selection off once one is made.
|
|
2062
|
+
*/
|
|
2063
|
+
width?: 'fill' | 'fit';
|
|
1991
2064
|
className?: string;
|
|
1992
|
-
};
|
|
2065
|
+
} & OverlayPortalProps;
|
|
1993
2066
|
/**
|
|
1994
2067
|
* Filterable single-select wrapping React Aria's ComboBox. The user can
|
|
1995
2068
|
* type to filter; selection commits to `onSelectionChange`. When no value
|
|
@@ -2017,11 +2090,16 @@ type RangeSliderProps = Omit<SliderProps$1, 'children' | 'className'> & {
|
|
|
2017
2090
|
* Linear range slider on React Aria. Single-value by default; pass an array
|
|
2018
2091
|
* to `value` / `defaultValue` for multi-thumb. Distinct from `Slider`, which
|
|
2019
2092
|
* is fully controlled and gives each thumb its own bounds and readout.
|
|
2093
|
+
*
|
|
2094
|
+
* The root is a column flex container and the track stretches to it, so
|
|
2095
|
+
* `align-items` on the root or on a wrapper that replaces it governs the
|
|
2096
|
+
* *horizontal* axis here and collapses the track to its content width. Style
|
|
2097
|
+
* the wrapper around one, not the root.
|
|
2020
2098
|
*/
|
|
2021
2099
|
declare function RangeSlider(props: RangeSliderProps): react_jsx_runtime.JSX.Element;
|
|
2022
2100
|
|
|
2023
2101
|
/** Props for {@link Dialog}, on top of React Aria's `ModalOverlay` props. */
|
|
2024
|
-
type DialogProps = Omit<ModalOverlayProps
|
|
2102
|
+
type DialogProps = Omit<WithoutPortalTarget<ModalOverlayProps>, 'children' | 'className'> & OverlayPortalProps & {
|
|
2025
2103
|
/** Heading rendered in the dialog's default header. Omit when supplying
|
|
2026
2104
|
* a custom `header` slot via children. */
|
|
2027
2105
|
title?: ReactNode;
|
|
@@ -2052,7 +2130,7 @@ declare function Dialog(props: DialogProps): react_jsx_runtime.JSX.Element;
|
|
|
2052
2130
|
type CalloutTone = 'info' | 'warning' | 'danger';
|
|
2053
2131
|
|
|
2054
2132
|
/** Props for {@link Callout}, on top of React Aria's `Popover` props. */
|
|
2055
|
-
type CalloutProps = Omit<PopoverProps
|
|
2133
|
+
type CalloutProps = Omit<WithoutPortalTarget<PopoverProps>, 'children' | 'className' | 'isNonModal' | 'triggerRef'> & OverlayPortalProps & {
|
|
2056
2134
|
children?: ReactNode;
|
|
2057
2135
|
className?: string;
|
|
2058
2136
|
/** Optional heading rendered above the body. */
|
|
@@ -2547,5 +2625,5 @@ declare const MINUS_SIGN = "\u2212";
|
|
|
2547
2625
|
*/
|
|
2548
2626
|
declare function formatNumber(value: number, options?: Intl.NumberFormatOptions): string;
|
|
2549
2627
|
|
|
2550
|
-
export { ActionBar, ActionsBar, Badge, Button, Callout, Checkbox, ComboBox, ComboBoxItem, CurveEditor, DataGrid, Dialog, Disclosure, DisclosureRow, DragHandleGlyph, EDGE_PROFILES, Field, ICON_PATHS, Icon, Input, KeyCap, KeySequence, MINUS_SIGN, NumberField, OptionsBar, Plot2D, PointPlotter, Powerline,
|
|
2628
|
+
export { ActionBar, ActionsBar, Badge, Button, Callout, Checkbox, ComboBox, ComboBoxItem, CurveEditor, DataGrid, Dialog, Disclosure, DisclosureRow, DragHandleGlyph, EDGE_PROFILES, Field, ICON_PATHS, Icon, Input, KeyCap, KeySequence, MINUS_SIGN, NumberField, OptionsBar, Plot2D, PointPlotter, Powerline, 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 };
|
|
2551
2629
|
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, DisclosureDirection, DisclosureProps, DisclosureRowProps, DragHandleGlyphProps, EdgeCap, EdgeProfile, EndpointMode, FieldOrientation, FieldProps, FillSettings, GradientTrackOpts, GridSettings, IconName, IconProps, 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,4 @@
|
|
|
1
1
|
import '../chunk-SBXNQW4G.js';
|
|
2
|
-
export { m as ActionBar,
|
|
3
|
-
import '../chunk-54ZWZ5FQ.js';
|
|
2
|
+
export { m as ActionBar, r8 as ActionsBar, Lt as Badge, a3 as Button, g3 as Callout, l5 as CalloutTrigger, o as Checkbox, g2 as ComboBox, v3 as ComboBoxItem, L as CurveEditor, s2 as DataGrid, l3 as Dialog, r5 as Disclosure, i2 as DisclosureRow, n4 as DragHandleGlyph, Je as EDGE_PROFILES, n2 as Field, t as ICON_PATHS, r as Icon, u2 as Input, s3 as KeyCap, c2 as KeySequence, c3 as LayerStack, e2 as MINUS_SIGN, f2 as NumberField, r7 as OptionsBar, f3 as Plot2D, n7 as PointPlotter, r9 as Powerline, u3 as Radio, l as RadioGroup, l2 as RangeSlider, g as Select, b2 as SelectItem, n5 as Sidebar, s4 as SidebarPanel, y2 as Slider, a2 as Switch, c4 as Tab, s5 as TabList, l4 as TabPanel, o4 as Tabs, r6 as ToggleBar, o3 as ToolButton, n6 as ToolGroup, _2 as ToolPalette, Jn as chromaAt, u4 as detectPlatform, a as dlog, r3 as fieldClasses, t3 as formatNumber, d2 as formatShortcut, u5 as formatShortcutParts, o2 as inferKeycapKind, i as isDebugEnabled, t2 as isPrefLeaf, e as keyGlyph, p2 as keySpecFromKey, d as keySpecsFromMods, qn as oklchToHex, v2 as paintGradientTrack, n3 as prefValueAtPath, s as useReorderDragList, a4 as useRovingTabIndex, r4 as visiblePrefSubtree } from '../chunk-W3ECWC2K.js';
|
|
4
3
|
//# sourceMappingURL=weasel-ui.js.map
|
|
5
4
|
//# sourceMappingURL=weasel-ui.js.map
|
package/dist/primitives/index.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
export { FloatingPanel, JobProgress, Legend, Sidebar } from '../chunk-
|
|
2
|
-
export { FpsMeter, ScaleIndicator, StatusBar, Toolbar, ZoomControl } from '../chunk-
|
|
1
|
+
export { FloatingPanel, JobProgress, Legend, Sidebar } from '../chunk-MOM3GOVY.js';
|
|
2
|
+
export { FpsMeter, ScaleIndicator, StatusBar, Toolbar, ZoomControl } from '../chunk-SMHP6XZ4.js';
|
|
3
3
|
import '../chunk-SBXNQW4G.js';
|
|
4
|
-
import '../chunk-
|
|
4
|
+
import '../chunk-W3ECWC2K.js';
|
|
5
5
|
import '../chunk-CQLQPQ4P.js';
|
|
6
|
-
import '../chunk-54ZWZ5FQ.js';
|
|
7
6
|
//# sourceMappingURL=index.js.map
|
|
8
7
|
//# sourceMappingURL=index.js.map
|
package/dist/state/index.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
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, e as UndockedPanel, f as UndockedPanels, g as dockPanel, p as panelKey, u as undockPanel } 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-D6Vb3T-g.js';
|
|
2
|
+
import { S as SerializedTrial, I as InstrumentSerializers, T as TrialRecord, U as UndoStack, a as StorageAdapter } from '../_dts/types-BP2OCcpg.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-BP2OCcpg.js';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
5
|
import { ReactNode } from 'react';
|
|
6
6
|
import 'zustand/vanilla';
|
|
7
|
+
import '../_dts/types-B9_zrHmb.js';
|
|
8
|
+
import '@weasel-js/core';
|
|
9
|
+
import '../_dts/PrefsForm.d-DDHFANkc.js';
|
|
7
10
|
|
|
8
11
|
/** The storage key a lab writes one of its buckets under. Namespaced by
|
|
9
12
|
* `storageKey` so two labs sharing an origin do not collide. */
|
package/dist/state/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { createLabStore } from '../chunk-
|
|
2
|
-
export { CURRENT_DOCUMENT_VERSION, createLabStore, createMemoryAdapter, decodeUrlHash, deserializeTrials, dockPanel, emptyUndoStack, encodeUrlHash, labDocumentKey, labStorageKey, localStorageAdapter, noneAdapter, panelKey, quarantineKey, serializeTrials, sessionStorageAdapter, undockPanel, urlHashAdapter, useTrialState } from '../chunk-
|
|
1
|
+
import { createLabStore } from '../chunk-2P6PP5N4.js';
|
|
2
|
+
export { CURRENT_DOCUMENT_VERSION, createLabStore, createMemoryAdapter, decodeUrlHash, deserializeTrials, dockPanel, emptyUndoStack, encodeUrlHash, labDocumentKey, labStorageKey, localStorageAdapter, noneAdapter, panelKey, quarantineKey, serializeTrials, sessionStorageAdapter, undockPanel, urlHashAdapter, useTrialState } from '../chunk-2P6PP5N4.js';
|
|
3
3
|
import { LabStoreProvider, TrialIdProvider } from '../chunk-2YILQ7Y5.js';
|
|
4
4
|
export { LabStoreContext, LabStoreProvider, TrialIdContext, TrialIdProvider, useLabStore, useTrialId } from '../chunk-2YILQ7Y5.js';
|
|
5
|
+
import '../chunk-E44SU6XS.js';
|
|
5
6
|
import { useRef } from 'react';
|
|
6
7
|
import { jsx } from 'react/jsx-runtime';
|
|
7
8
|
|
package/dist/state/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/state/SingletonExperiment.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/state/SingletonExperiment.tsx"],"names":[],"mappings":";;;;;;;;AAKA,IAAM,oBAAA,GAAuB,eAAA;AAoBtB,SAAS,2BAAA,CAAoC;AAAA,EAClD,EAAA;AAAA,EACA,aAAA;AAAA,EACA,YAAA;AAAA,EACA,OAAA;AAAA,EACA,UAAA;AAAA,EACA;AACF,CAAA,EAA6C;AAC3C,EAAA,MAAM,QAAA,GAAW,OAAwB,IAAI,CAAA;AAC7C,EAAA,IAAI,QAAA,CAAS,YAAY,IAAA,EAAM;AAC7B,IAAA,MAAM,KAAA,GAAQ,cAAA,CAAe,EAAE,UAAA,EAAY,SAAS,CAAA;AACpD,IAAA,IAAI,CAAC,KAAA,CAAM,QAAA,EAAS,CAAE,MAAA,CAAO,IAAA,CAAK,CAAC,CAAA,KAAM,CAAA,CAAE,EAAA,KAAO,EAAE,CAAA,EAAG;AACrD,MAAA,KAAA,CAAM,QAAA,GAAW,QAAA,CAAS;AAAA,QACxB,EAAA;AAAA,QACA,cAAA,EAAgB,oBAAA;AAAA,QAChB,MAAA,EAAQ,aAAA;AAAA,QACR,KAAA,EAAO,YAAA;AAAA,QACP,IAAA,EAAM,EAAE,IAAA,EAAM,CAAA,EAAG,GAAA,EAAK,EAAE,CAAA,EAAG,CAAA,EAAG,CAAA,EAAG,CAAA,EAAE;AAAE,OACtC,CAAA;AAAA,IACH;AACA,IAAA,QAAA,CAAS,OAAA,GAAU,KAAA;AAAA,EACrB;AACA,EAAA,uBACE,GAAA,CAAC,gBAAA,EAAA,EAAiB,KAAA,EAAO,QAAA,CAAS,OAAA,EAChC,8BAAC,eAAA,EAAA,EAAgB,OAAA,EAAS,EAAA,EAAK,QAAA,EAAS,CAAA,EAC1C,CAAA;AAEJ","file":"index.js","sourcesContent":["import { type ReactNode, useRef } from 'react';\nimport { LabStoreProvider, TrialIdProvider } from './context';\nimport { createLabStore, type LabStore } from './store';\nimport type { StorageAdapter } from './types';\n\nconst SINGLETON_INSTRUMENT = '__singleton__';\n\n/** Props for `<SingletonExperimentProvider>`. */\nexport interface SingletonExperimentProviderProps<TS, TC> {\n /** Stable id for the synthetic trial; also doubles as the\n * TrialIdContext value. */\n id: string;\n initialConfig: TC;\n initialState: TS;\n storage: StorageAdapter;\n storageKey: string;\n children: ReactNode;\n}\n\n/**\n * One-trial `<Lab>` substitute for single-screen experiments. Mounts\n * a `LabStoreProvider` + `TrialIdProvider` with one synthetic\n * trial, so `useTrialState` works without going through the\n * full `<Lab instruments={...}>` runtime.\n */\nexport function SingletonExperimentProvider<TS, TC>({\n id,\n initialConfig,\n initialState,\n storage,\n storageKey,\n children,\n}: SingletonExperimentProviderProps<TS, TC>) {\n const storeRef = useRef<LabStore | null>(null);\n if (storeRef.current === null) {\n const store = createLabStore({ storageKey, storage });\n if (!store.getState().trials.some((w) => w.id === id)) {\n store.getState().addTrial({\n id,\n instrumentName: SINGLETON_INSTRUMENT,\n config: initialConfig,\n state: initialState,\n view: { zoom: 1, pan: { x: 0, y: 0 } },\n });\n }\n storeRef.current = store;\n }\n return (\n <LabStoreProvider store={storeRef.current}>\n <TrialIdProvider trialId={id}>{children}</TrialIdProvider>\n </LabStoreProvider>\n );\n}\n"]}
|