@weasel-js/labkit 1.2.0 → 1.3.0-pre.0
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/{DrawCommand-C_XboUpz.d.ts → DrawCommand-DBB45NfN.d.ts} +196 -52
- package/dist/_dts/PrefsForm-BYa6cWnO.d.ts +201 -0
- package/dist/_dts/index-DgcNdEdh.d.ts +314 -0
- package/dist/_dts/types-1Sdxy_Pv.d.ts +90 -0
- package/dist/_dts/types-AHlQxBNN.d.ts +162 -0
- package/dist/_dts/{useTrialState-BMNIx3Cy.d.ts → useTrialState-CsGMjhu9.d.ts} +5 -87
- package/dist/canvas/index.d.ts +7 -3
- package/dist/canvas/index.js +2 -1
- package/dist/chrome/index.d.ts +86 -0
- package/dist/chrome/index.js +8 -0
- package/dist/chrome/index.js.map +1 -0
- package/dist/{chunk-VUU5UXHE.js → chunk-4TMMVIDM.js} +8 -5
- package/dist/chunk-4TMMVIDM.js.map +1 -0
- package/dist/{chunk-THBG7FQZ.js → chunk-HFDVGF4X.js} +15 -12
- package/dist/chunk-HFDVGF4X.js.map +1 -0
- package/dist/{chunk-574LJAV4.js → chunk-NS54R52R.js} +31 -21
- package/dist/chunk-NS54R52R.js.map +1 -0
- package/dist/{chunk-G5TJVQQT.js → chunk-O2BULFHX.js} +5 -14
- package/dist/chunk-O2BULFHX.js.map +1 -0
- package/dist/chunk-O7NVSCLN.js +266 -0
- package/dist/chunk-O7NVSCLN.js.map +1 -0
- package/dist/chunk-PO6L3NSH.js +366 -0
- package/dist/chunk-PO6L3NSH.js.map +1 -0
- package/dist/chunk-PQJ5B2U2.js +27 -0
- package/dist/chunk-PQJ5B2U2.js.map +1 -0
- package/dist/chunk-RVNN4CHQ.js +212 -0
- package/dist/chunk-RVNN4CHQ.js.map +1 -0
- package/dist/chunk-TLGRYALP.js +6151 -0
- package/dist/chunk-TLGRYALP.js.map +1 -0
- package/dist/{chunk-SFL7NFKN.js → chunk-V7PRSIRQ.js} +15 -7
- package/dist/chunk-V7PRSIRQ.js.map +1 -0
- package/dist/{chunk-BOHF3PQO.js → chunk-Z6HJ5FEM.js} +8111 -5190
- package/dist/chunk-Z6HJ5FEM.js.map +1 -0
- package/dist/chunk-ZZAYVX4X.js +505 -0
- package/dist/chunk-ZZAYVX4X.js.map +1 -0
- package/dist/controls/index.d.ts +19 -5
- package/dist/controls/index.js +3 -1
- package/dist/dragdrop/index.d.ts +4 -2
- package/dist/index.d.ts +246 -106
- package/dist/index.js +673 -559
- package/dist/index.js.map +1 -1
- package/dist/layers/index.d.ts +5 -3
- package/dist/layers/index.js +2 -1
- package/dist/passthrough/weasel-canvas.d.ts +69 -13
- package/dist/passthrough/weasel-canvas.js +1 -1
- package/dist/passthrough/weasel-ui.d.ts +3799 -3672
- package/dist/passthrough/weasel-ui.js +2 -2
- package/dist/primitives/index.d.ts +102 -8
- package/dist/primitives/index.js +4 -1
- package/dist/state/index.d.ts +3 -2
- package/dist/state/index.js +2 -2
- package/dist/styles.css +542 -153
- package/dist/surface/index.js +2 -1
- package/dist/ui/layers/index.js +4 -3
- package/dist/undo/index.d.ts +4 -2
- package/package.json +16 -7
- package/src/canvas/AGENTS.md +4 -0
- package/src/canvas/CanvasStack.tsx +6 -2
- package/src/canvas/useLayerScheduler.ts +22 -15
- package/src/canvas/usePanZoom.test.ts +80 -0
- package/src/canvas/usePanZoom.ts +16 -2
- package/src/chrome/ChromeRegions.stories.tsx +106 -0
- package/src/chrome/builtins.test.ts +153 -0
- package/src/chrome/builtins.tsx +205 -0
- package/src/chrome/index.ts +25 -0
- package/src/chrome/merge.test.ts +51 -0
- package/src/chrome/merge.ts +52 -0
- package/src/chrome/regions/PaletteRegion.less +14 -0
- package/src/chrome/regions/PaletteRegion.test.tsx +36 -0
- package/src/chrome/regions/PaletteRegion.tsx +41 -0
- package/src/chrome/regions/SidebarRegion.tsx +56 -0
- package/src/chrome/regions/StatusRegion.tsx +31 -0
- package/src/chrome/regions/TitleBarRegion.tsx +41 -0
- package/src/chrome/regions/ToolbarRegion.test.tsx +82 -0
- package/src/chrome/regions/ToolbarRegion.tsx +71 -0
- package/src/chrome/regions/ViewportRegion.less +42 -0
- package/src/chrome/regions/ViewportRegion.tsx +37 -0
- package/src/chrome/regions/regions.test.tsx +81 -0
- package/src/chrome/types.ts +127 -0
- package/src/config/builder.test.ts +87 -0
- package/src/config/builder.ts +224 -0
- package/src/config/fromConfigField.test.ts +93 -0
- package/src/config/fromConfigField.ts +74 -0
- package/src/config/index.ts +22 -0
- package/src/config/resolve.test.ts +120 -0
- package/src/config/resolve.ts +67 -0
- package/src/config/rules.ts +68 -0
- package/src/config/types.ts +108 -0
- package/src/config/useConfigSchema.ts +30 -0
- package/src/config/visible.ts +20 -0
- package/src/controls/ControlPanel.less +4 -58
- package/src/controls/ControlPanel.stories.tsx +86 -0
- package/src/controls/ControlPanel.test.tsx +223 -10
- package/src/controls/ControlPanel.tsx +202 -203
- package/src/dragdrop/DragDropRuntime.tsx +36 -18
- package/src/dragdrop/DragGhost.less +1 -1
- package/src/dragdrop/Palette.less +1 -1
- package/src/index.ts +25 -3
- package/src/instrument/SineWave.smoke.test.tsx +8 -1
- package/src/instrument/defineInstrument.test.ts +38 -1
- package/src/instrument/defineInstrument.ts +31 -4
- package/src/instrument/index.ts +1 -0
- package/src/instrument/types.ts +27 -4
- package/src/instrument/validateConfigSchema.test.ts +13 -3
- package/src/instrument/validateConfigSchema.ts +7 -10
- package/src/lab/Lab.chrome.test.tsx +65 -0
- package/src/lab/Lab.tsx +58 -15
- package/src/lab/LabContext.ts +6 -0
- package/src/lab/LabFullChrome.stories.tsx +308 -0
- package/src/lab/LabHeader.test.tsx +42 -0
- package/src/lab/LabHeader.tsx +57 -0
- package/src/lab/LabPalette.test.tsx +35 -0
- package/src/lab/LabPalette.tsx +34 -0
- package/src/lab/LabShell.less +50 -3
- package/src/lab/Workspace.less +1 -30
- package/src/lab/Workspace.test.tsx +20 -10
- package/src/lab/Workspace.tsx +5 -8
- package/src/lab/index.ts +2 -0
- package/src/layers/AGENTS.md +1 -1
- package/src/layers/LayerList.less +31 -7
- package/src/layers/LayerList.tsx +17 -4
- package/src/passthrough/weasel-ui.ts +23 -0
- package/src/primitives/DragHandleGlyph.tsx +29 -0
- package/src/primitives/FloatingPanel.less +28 -0
- package/src/primitives/FloatingPanel.stories.tsx +46 -0
- package/src/primitives/FloatingPanel.test.tsx +240 -0
- package/src/primitives/FloatingPanel.tsx +190 -0
- package/src/primitives/FpsMeter.test.tsx +44 -0
- package/src/primitives/FpsMeter.tsx +20 -9
- package/src/primitives/JobProgress.less +69 -0
- package/src/primitives/JobProgress.stories.tsx +48 -0
- package/src/primitives/JobProgress.tsx +65 -0
- package/src/primitives/Legend.less +47 -0
- package/src/primitives/Legend.stories.tsx +32 -0
- package/src/primitives/Legend.test.tsx +57 -0
- package/src/primitives/Legend.tsx +40 -0
- package/src/primitives/Sidebar.less +32 -2
- package/src/primitives/StatusBar.less +7 -0
- package/src/primitives/StatusBar.tsx +10 -3
- package/src/primitives/Toolbar.less +50 -3
- package/src/primitives/Toolbar.test.tsx +67 -1
- package/src/primitives/Toolbar.tsx +72 -6
- package/src/primitives/ZoomControl.less +31 -0
- package/src/primitives/ZoomControl.tsx +76 -0
- package/src/primitives/floating.entry.test.tsx +14 -0
- package/src/primitives/index.ts +10 -2
- package/src/primitives/useRovingTabIndex.test.ts +27 -0
- package/src/primitives/useRovingTabIndex.ts +79 -0
- package/src/state/store.ts +11 -3
- package/src/state/toolSlot.test.ts +36 -0
- package/src/state/types.ts +4 -0
- package/src/styles.less +6 -0
- package/src/surface/useTiledSurface.ts +14 -10
- package/src/test-setup.ts +26 -0
- package/src/theme/base.less +19 -2
- package/src/theme/interstellar.tokens.json +6 -2
- package/src/tools/types.ts +24 -0
- package/src/trial/Trial.config.test.tsx +113 -0
- package/src/trial/Trial.job.test.tsx +13 -15
- package/src/trial/Trial.less +115 -10
- package/src/trial/Trial.stories.tsx +1 -0
- package/src/trial/Trial.test.tsx +67 -96
- package/src/trial/Trial.tsx +80 -39
- package/src/trial/TrialChrome.tsx +99 -80
- package/src/trial/TrialDragContext.ts +10 -0
- package/src/trial/TrialTitleBar.tsx +41 -0
- package/src/trial/index.ts +1 -15
- package/src/trial/trialChrome.borders.test.ts +38 -0
- package/src/ui/layers/LayerStack.less +9 -9
- package/src/ui/layers/LayerStack.tsx +1 -13
- package/src/ui/properties/CurveField.less +2 -2
- package/src/ui/properties/CurveField.test.tsx +11 -11
- package/src/ui/properties/PropertyGroup.less +2 -2
- package/src/ui/properties/PropertyPanel.less +55 -41
- package/src/ui/properties/SpeechBalloonPanels.stories.tsx +4 -2
- package/src/ui/properties/storyLayouts.tsx +2 -2
- package/dist/_dts/index-JFAYj5Tv.d.ts +0 -144
- package/dist/_dts/types-x92Kfeme.d.ts +0 -62
- package/dist/chunk-574LJAV4.js.map +0 -1
- package/dist/chunk-5R2ATYPJ.js +0 -201
- package/dist/chunk-5R2ATYPJ.js.map +0 -1
- package/dist/chunk-73KA7WBO.js +0 -5992
- package/dist/chunk-73KA7WBO.js.map +0 -1
- package/dist/chunk-BOHF3PQO.js.map +0 -1
- package/dist/chunk-G5TJVQQT.js.map +0 -1
- package/dist/chunk-PMAU3SEE.js +0 -126
- package/dist/chunk-PMAU3SEE.js.map +0 -1
- package/dist/chunk-SFL7NFKN.js.map +0 -1
- package/dist/chunk-THBG7FQZ.js.map +0 -1
- package/dist/chunk-VUU5UXHE.js.map +0 -1
- package/src/instrument/capabilityDetector.test.ts +0 -64
- package/src/instrument/capabilityDetector.ts +0 -20
- package/src/trial/DefaultSidebar.tsx +0 -29
- package/src/trial/DefaultStatusBar.tsx +0 -19
- package/src/trial/DefaultToolbar.tsx +0 -92
- package/src/trial/slotTypes.ts +0 -54
package/dist/layers/index.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { L as LayerCapability } from '../_dts/index-
|
|
1
|
+
import { f as LayerDescriptor } from '../_dts/index-DgcNdEdh.js';
|
|
2
|
+
export { L as LayerCapability } from '../_dts/index-DgcNdEdh.js';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import 'react';
|
|
5
|
-
import '../_dts/types-
|
|
5
|
+
import '../_dts/types-AHlQxBNN.js';
|
|
6
|
+
import '../_dts/PrefsForm-BYa6cWnO.js';
|
|
7
|
+
import '../_dts/types-1Sdxy_Pv.js';
|
|
6
8
|
import '../_dts/types-DJ79Tg5J.js';
|
|
7
9
|
|
|
8
10
|
/** Props for `<LayerList>`. */
|
package/dist/layers/index.js
CHANGED
|
@@ -1,6 +1,68 @@
|
|
|
1
|
+
import { N as Node, V as View, P as Path, D as DrawCommand, S as Scene, B as Bounds, a as ViewportDims, b as PathDrawCommand } from '../_dts/DrawCommand-DBB45NfN.js';
|
|
1
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
3
|
import { Ref } from 'react';
|
|
3
|
-
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* NodeShape — the **shape trait's** registry. Each trait of a node
|
|
7
|
+
* (shape, routing, label, icon, affordances, …) is its own registry;
|
|
8
|
+
* this one holds the per-kind `paint` + `silhouette` (and future
|
|
9
|
+
* fields) used by `defaultDrawOne`, clipping, non-rect hit-testing,
|
|
10
|
+
* and lasso/area-select.
|
|
11
|
+
*
|
|
12
|
+
* Teaching the kit about a new kind of shape goes through this registry
|
|
13
|
+
* rather than by overriding `drawOne`. Overrides are still possible but
|
|
14
|
+
* shouldn't be the default seam: most consumers want the same dispatch
|
|
15
|
+
* logic, just extended with their own shape kinds (images, custom paths,
|
|
16
|
+
* SVG fragments, etc.).
|
|
17
|
+
*
|
|
18
|
+
* Built-in entries (`kit:text`, `kit:path`, `kit:rect-fallback`) are
|
|
19
|
+
* registered at module load. Consumer entries added via
|
|
20
|
+
* `registerNodeShape` join the chain; the first entry whose
|
|
21
|
+
* `matches` predicate returns true paints the node.
|
|
22
|
+
*
|
|
23
|
+
* Two priority tiers:
|
|
24
|
+
* - `'high'` — checked before all `'normal'` entries. Use this to
|
|
25
|
+
* override a kit built-in for a specific data shape (e.g. a custom
|
|
26
|
+
* text renderer that wins over `kit:text`).
|
|
27
|
+
* - `'normal'` (default) — appended after the built-ins.
|
|
28
|
+
*
|
|
29
|
+
* Within a tier, entries run in registration order. Each
|
|
30
|
+
* `registerNodeShape` call returns a disposer that removes the
|
|
31
|
+
* entry — useful for tests, for plugin lifecycles, and for swapping
|
|
32
|
+
* implementations at runtime.
|
|
33
|
+
*
|
|
34
|
+
* See `docs/superpowers/specs/2026-05-24-node-traits-reframe-design.md`
|
|
35
|
+
* for the trait taxonomy.
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
/** Optional per-call paint context, threaded through `defaultDrawOne`'s third
|
|
39
|
+
* argument. Lets a rendering entry point override ambient environment reads
|
|
40
|
+
* — the headless `renderSceneToPixels` path supplies its own bitmap resolver
|
|
41
|
+
* here so consumers reuse their own decode caches. Custom painters may
|
|
42
|
+
* ignore it entirely. */
|
|
43
|
+
interface NodePaintCtx {
|
|
44
|
+
/** Override bitmap resolution for image nodes. When set it is authoritative:
|
|
45
|
+
* the global `imageCache` is not consulted, and an `undefined` result
|
|
46
|
+
* paints the deterministic grey placeholder outline (never the ambient
|
|
47
|
+
* load-status error variant). */
|
|
48
|
+
resolveImage?: (node: Node<unknown, string, unknown>) => ImageBitmap | undefined;
|
|
49
|
+
/** The node's derived path, resolved by the scene-aware `drawOne` wrapper
|
|
50
|
+
* before painting: `paint` has no scene handle, and deriving needs the
|
|
51
|
+
* dependencies' poses. **Absent** for a node that derives from nothing —
|
|
52
|
+
* the wrapper hands such a node the caller's own ctx untouched. `null`
|
|
53
|
+
* means the node derives but has nothing to draw. */
|
|
54
|
+
derivedPath?: Path | null;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Per-node draw function — the scene-slot `drawOne` signature shared by
|
|
58
|
+
* `<SceneCanvas>`, `renderSceneToCanvas` and `renderSceneToPixels`, so a
|
|
59
|
+
* consumer can reuse one callback across a main canvas and a detached view.
|
|
60
|
+
*
|
|
61
|
+
* Called once per node in the walk. Returned commands are world-space; the
|
|
62
|
+
* caller applies the view transform at the group level. `ctx` is supplied by
|
|
63
|
+
* the scene-aware wrappers — see {@link NodePaintCtx}.
|
|
64
|
+
*/
|
|
65
|
+
type SceneViewDrawOne<TData, TLayer extends string, TPose> = (node: Node<TData, TLayer, TPose>, pose: TPose, view: View, ctx?: NodePaintCtx) => DrawCommand[];
|
|
4
66
|
|
|
5
67
|
/**
|
|
6
68
|
* `renderSceneToCanvas` — substrate for detached, read-only scene views
|
|
@@ -21,17 +83,6 @@ import { N as Node, V as View, D as DrawCommand, S as Scene, B as Bounds, a as V
|
|
|
21
83
|
* in sync by hand where it matters (DPR handling, viewToMat3 wrap).
|
|
22
84
|
*/
|
|
23
85
|
|
|
24
|
-
/**
|
|
25
|
-
* Per-node draw function. Mirrors the scene-slot `drawOne` signature on
|
|
26
|
-
* `<SceneCanvas>` (`SceneSlotConfig.drawOne`) so consumers can reuse the
|
|
27
|
-
* same callback (or a simplified variant) between a main canvas and a
|
|
28
|
-
* detached scene-view canvas.
|
|
29
|
-
*
|
|
30
|
-
* The function is called once per node in `scene.renderOrder()`. Returned
|
|
31
|
-
* commands are in world coords; the caller's `view` is applied at the
|
|
32
|
-
* group level (see `renderSceneToCanvas`'s implementation).
|
|
33
|
-
*/
|
|
34
|
-
type SceneViewDrawOne<TData, TLayer extends string, TPose> = (node: Node<TData, TLayer, TPose>, pose: TPose, view: View) => DrawCommand[];
|
|
35
86
|
/** What to draw into an existing canvas: the scene, the view, and the same
|
|
36
87
|
* painting hooks `<SceneCanvas>` takes. */
|
|
37
88
|
interface RenderSceneToCanvasArgs<TData, TLayer extends string, TPose> {
|
|
@@ -254,7 +305,12 @@ interface MinimapCanvasProps<TData, TLayer extends string, TPose> {
|
|
|
254
305
|
* can reuse it (typically simplified — just colored AABBs). */
|
|
255
306
|
drawOne: SceneViewDrawOne<TData, TLayer, TPose>;
|
|
256
307
|
/** Fit policy. Defaults to `"scene"` (AABB union of leaf poses). See
|
|
257
|
-
* `MinimapFit` for the full shape.
|
|
308
|
+
* `MinimapFit` for the full shape.
|
|
309
|
+
*
|
|
310
|
+
* Framing is derived from **document** poses, not `scene.overrides` — a
|
|
311
|
+
* node moved by an override paints where the override puts it, outside the
|
|
312
|
+
* frame if it goes there, rather than making the whole minimap rescale on
|
|
313
|
+
* every frame of a drag or a settle. */
|
|
258
314
|
fit?: MinimapFit<TData, TLayer, TPose>;
|
|
259
315
|
/** Pose → AABB. Defaults to identity (`pose as Bounds`), matching
|
|
260
316
|
* `sceneAdapter` / `useSelectTool`. */
|
|
@@ -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-Z6HJ5FEM.js';
|
|
2
2
|
//# sourceMappingURL=weasel-canvas.js.map
|
|
3
3
|
//# sourceMappingURL=weasel-canvas.js.map
|