@weasel-js/labkit 1.7.1 → 1.7.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/dist/chrome/index.js +4 -4
- package/dist/{chunk-GAHELLJT.js → chunk-RODIY7HI.js} +7 -7
- package/dist/{chunk-GAHELLJT.js.map → chunk-RODIY7HI.js.map} +1 -1
- package/dist/{chunk-4KSC7NXL.js → chunk-U6UQVGFP.js} +1984 -1892
- package/dist/chunk-U6UQVGFP.js.map +1 -0
- package/dist/chunk-WFALF2X2.js +302 -0
- package/dist/chunk-WFALF2X2.js.map +1 -0
- package/dist/{chunk-JFOJESJF.js → chunk-WWJDPNZZ.js} +22 -22
- package/dist/chunk-WWJDPNZZ.js.map +1 -0
- package/dist/{chunk-CEGFXTBD.js → chunk-XRX5S5NT.js} +4 -4
- package/dist/{chunk-CEGFXTBD.js.map → chunk-XRX5S5NT.js.map} +1 -1
- package/dist/{chunk-FB4MIZOO.js → chunk-XZDCEMEL.js} +6 -6
- package/dist/chunk-XZDCEMEL.js.map +1 -0
- package/dist/controls/index.d.ts +55 -3
- package/dist/controls/index.js +3 -2
- package/dist/fonts/oswald-tabular-digits.woff2 +0 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +135 -134
- package/dist/index.js.map +1 -1
- package/dist/layers/index.js +1 -1
- package/dist/passthrough/weasel-ui.js +1 -1
- package/dist/primitives/index.js +3 -3
- package/dist/styles.css +228 -11
- package/package.json +11 -11
- package/src/annotations/capture.browser.test.ts +9 -3
- package/src/canvas/Stage.test.tsx +34 -25
- package/src/chrome/labRegions.test.tsx +37 -26
- package/src/chrome/regions/PaletteRegion.test.tsx +2 -2
- package/src/controls/ControlMatrix.less +245 -0
- package/src/controls/ControlMatrix.stories.less +13 -0
- package/src/controls/ControlMatrix.stories.tsx +135 -0
- package/src/controls/ControlMatrix.test.tsx +206 -0
- package/src/controls/ControlMatrix.tsx +446 -0
- package/src/controls/ControlPanel.tsx +4 -2
- package/src/controls/index.ts +6 -0
- package/src/dragdrop/dragDrop.test.tsx +34 -33
- package/src/index.ts +6 -0
- package/src/lab/Lab.chrome.test.tsx +15 -10
- package/src/lab/Lab.nebula.test.tsx +5 -5
- package/src/lab/Lab.surface.test.tsx +30 -21
- package/src/lab/Lab.test.tsx +75 -74
- package/src/lab/Lab.undock.test.tsx +15 -10
- package/src/lab/LabHeader.test.tsx +15 -14
- package/src/lab/LabPalette.test.tsx +12 -7
- package/src/lab/LabShell.less +1 -2
- package/src/lab/LabZoom.test.tsx +55 -44
- package/src/lab/Workspace.surface.test.tsx +16 -13
- package/src/lab/Workspace.test.tsx +32 -27
- package/src/overview/OverviewMarks.test.tsx +9 -8
- package/src/overview/TrialOverview.test.tsx +18 -17
- package/src/primitives/FpsMeter.less +1 -2
- package/src/primitives/JobProgress.less +1 -2
- package/src/primitives/ScaleIndicator.less +1 -1
- package/src/primitives/StatusBar.less +1 -1
- package/src/specimen/Specimen.less +1 -0
- package/src/styles.less +3 -0
- package/src/trial/Trial.annotations.persist.test.tsx +20 -9
- package/src/trial/Trial.annotations.test.tsx +46 -41
- package/src/trial/Trial.canvas.test.tsx +21 -17
- package/src/trial/Trial.config.test.tsx +34 -27
- package/src/trial/Trial.loupe.test.tsx +27 -18
- package/src/trial/Trial.targets.test.tsx +9 -8
- package/src/trial/Trial.test.tsx +51 -46
- package/src/trial/Trial.trialId.test.tsx +7 -6
- package/dist/chunk-4KSC7NXL.js.map +0 -1
- package/dist/chunk-FB4MIZOO.js.map +0 -1
- package/dist/chunk-JFOJESJF.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -9,22 +9,23 @@ import { useJob } from './chunk-EFXRM6XQ.js';
|
|
|
9
9
|
export { useJob } from './chunk-EFXRM6XQ.js';
|
|
10
10
|
import { markCommands, boundsOf, roundFrac, worldToFrac, fracToWorld, fracEncloses, fracContains, POINT_MARK_SHAPE, roundPoints, fromShape, markSvgNodes, toShape } from './chunk-F4ACIK7Z.js';
|
|
11
11
|
export { fracContains, fracEncloses, fracToWorld, markCommands, markSvgNodes, roundFrac, worldToFrac } from './chunk-F4ACIK7Z.js';
|
|
12
|
-
import { ANNOTATION_WEASEL_TOOLS, annotationToolInfo, suppressContributions, mergeContributions, builtinContributions, TRANSIENT_BUILTINS, TitleBarRegion, ToolbarRegion, PaletteRegion, ViewportRegion, SidebarRegion, StatusRegion, resolveLabTool, useLabChromeContext, labContributions, labAnnotationTools, LabHeaderRegion, LabFooterRegion, LabAsideRegion, LabSidebarRegion } from './chunk-
|
|
13
|
-
export { ANNOTATION_TOOLS, ANNOTATION_WEASEL_TOOLS, ExportMenu, LabAsideRegion, LabFooterRegion, LabHeaderRegion, LabSidebarRegion, MarkList, PaletteRegion, SidebarRegion, StatusRegion, TRANSIENT_BUILTINS, TitleBarRegion, ToolbarRegion, ViewportRegion, annotationToolInfo, builtinContributions, contributionsIn, labContributions, mergeContributions, suppressContributions, toolContributions, useLabChromeContext } from './chunk-
|
|
12
|
+
import { ANNOTATION_WEASEL_TOOLS, annotationToolInfo, suppressContributions, mergeContributions, builtinContributions, TRANSIENT_BUILTINS, TitleBarRegion, ToolbarRegion, PaletteRegion, ViewportRegion, SidebarRegion, StatusRegion, resolveLabTool, useLabChromeContext, labContributions, labAnnotationTools, LabHeaderRegion, LabFooterRegion, LabAsideRegion, LabSidebarRegion } from './chunk-RODIY7HI.js';
|
|
13
|
+
export { ANNOTATION_TOOLS, ANNOTATION_WEASEL_TOOLS, ExportMenu, LabAsideRegion, LabFooterRegion, LabHeaderRegion, LabSidebarRegion, MarkList, PaletteRegion, SidebarRegion, StatusRegion, TRANSIENT_BUILTINS, TitleBarRegion, ToolbarRegion, ViewportRegion, annotationToolInfo, builtinContributions, contributionsIn, labContributions, mergeContributions, suppressContributions, toolContributions, useLabChromeContext } from './chunk-RODIY7HI.js';
|
|
14
14
|
import { AnnotationsContext } from './chunk-3RY6WL5T.js';
|
|
15
15
|
export { AnnotationsContext, useAnnotations, useAnnotationsOptional } from './chunk-3RY6WL5T.js';
|
|
16
|
-
import { Split, JobProgress, Legend } from './chunk-
|
|
17
|
-
export { JobProgress, Legend, Readout, Split } from './chunk-
|
|
16
|
+
import { Split, JobProgress, Legend } from './chunk-XZDCEMEL.js';
|
|
17
|
+
export { JobProgress, Legend, Readout, Split } from './chunk-XZDCEMEL.js';
|
|
18
18
|
import { FloatingPanel } from './chunk-XE5HJOPL.js';
|
|
19
19
|
export { FloatingPanel } from './chunk-XE5HJOPL.js';
|
|
20
|
-
import { Toolbar, StatusBar, ScaleIndicator, ZoomControl } from './chunk-
|
|
21
|
-
export { FpsMeter, ScaleIndicator, StatusBar, Toolbar, ZoomControl } from './chunk-
|
|
20
|
+
import { Toolbar, StatusBar, ScaleIndicator, ZoomControl } from './chunk-XRX5S5NT.js';
|
|
21
|
+
export { FpsMeter, ScaleIndicator, StatusBar, Toolbar, ZoomControl } from './chunk-XRX5S5NT.js';
|
|
22
22
|
import './chunk-CZZPXUOU.js';
|
|
23
23
|
import { unruledConfigSchema, createLabStore, openLabStore, panelKey } from './chunk-IBVRMHW5.js';
|
|
24
24
|
export { CURRENT_DOCUMENT_VERSION, dockPanel, labDocumentKey, openLabStore, panelKey, quarantineKey, undockPanel, useTrialState } from './chunk-IBVRMHW5.js';
|
|
25
25
|
import { newId, useWarnIgnoredChange, useOpenOnce, PersistenceContext, createRecordCache, noneAdapter, defaultStorage, usePersistedState } from './chunk-PMLZP7RT.js';
|
|
26
26
|
export { Persistence, createIndexedDbAdapter, createMemoryAdapter, indexedDbAdapter, localStorageAdapter, noneAdapter, sessionStorageAdapter, urlHashAdapter, usePersistedState } from './chunk-PMLZP7RT.js';
|
|
27
|
-
export {
|
|
27
|
+
export { ControlMatrix } from './chunk-WFALF2X2.js';
|
|
28
|
+
export { ControlPanel, inDialog, summarizeValue } from './chunk-WWJDPNZZ.js';
|
|
28
29
|
import { useConfigSchema } from './chunk-E6NARGU7.js';
|
|
29
30
|
export { sectionTree, useConfigSchema } from './chunk-E6NARGU7.js';
|
|
30
31
|
import { useLabContext, LabContext } from './chunk-Z76KEZAX.js';
|
|
@@ -49,8 +50,8 @@ export { CanvasStackContext } from './chunk-ZQIHJXP4.js';
|
|
|
49
50
|
import { LabStoreContext, TrialIdProvider, TrialIdContext } from './chunk-2YILQ7Y5.js';
|
|
50
51
|
export { LabStoreContext, LabStoreProvider, TrialIdContext, TrialIdProvider, useLabStore, useTrialId } from './chunk-2YILQ7Y5.js';
|
|
51
52
|
import './chunk-2RVCB2PT.js';
|
|
52
|
-
import { D2, S2, X, U, G, p4, o3, c, Xt,
|
|
53
|
-
export { c as Button, V as CloseIcon, xe as CollapseIcon, _ as CurveField,
|
|
53
|
+
import { D2, S2, X, U, G, p4, o3, c, Xt, c6, a6, l5, u3, a5, r3, a8, i3, o5, s4, c7, l9, p, f2, u2, y, O2, b4, l10, S, c8, i4, h2, j, k2, ae2, oe, de, b3, j2, n6, a9, C3, l3, u, v2, d3, j3, r4, n7, r5, i5, p2, f, n8, o4, c5, l8, w, L, n9, j4, xe2, n2 } from './chunk-U6UQVGFP.js';
|
|
54
|
+
export { c as Button, V as CloseIcon, xe as CollapseIcon, _ as CurveField, s as DetailList, c2 as DetailRow, Se as ExpandIcon, l as Icon, u2 as Input, l11 as Jog, D2 as LayerList, re as PauseIcon, ne as PlayIcon, fe2 as PropertyControl, de as PropertyField, b3 as PropertyGroup, oe as PropertyList, ae2 as PropertyPanel, L2 as PropertyRow, se as PropertySpan, B as ResetIcon, O2 as Select, ae as StepBackIcon, $ as StepForwardIcon, ie as StopIcon, x2 as Subpanel, a5 as ToggleBar, oe2 as TokenPanel, H2 as inferTokenType, S2 as moveLayers, O3 as refitScale } from './chunk-U6UQVGFP.js';
|
|
54
55
|
import { serializeSvg } from './chunk-E23Q6A3Y.js';
|
|
55
56
|
import './chunk-XVUKDSYV.js';
|
|
56
57
|
import { makeViewportZoomAction, createScene, asNodeId as asNodeId$1, registerNodeShape, useLatest, WeaselProvider, SceneCanvas, createPointerStore, PointerContextProvider, DepRegistryProvider, ActionsProvider, ActiveToolContextProvider, useActionsRegistry, useDepSource, ActionDisabledReason, useGestureDispatcher, sceneFromJSON, warmRender, renderSceneToPixels, useActiveToolContext } from '@weasel-js/core';
|
|
@@ -91,7 +92,7 @@ function createMarkDrawOne(opts) {
|
|
|
91
92
|
}
|
|
92
93
|
function resolveMarkStyle(data, opts) {
|
|
93
94
|
return {
|
|
94
|
-
color: opts.meaning?.statuses?.find((
|
|
95
|
+
color: opts.meaning?.statuses?.find((s3) => s3.id === data.status)?.color,
|
|
95
96
|
// Read off the node rather than through the store's `isStale`, which
|
|
96
97
|
// wants a projected Annotation this path does not have.
|
|
97
98
|
stale: isStale(data.seen, opts.config, opts.positionDependsOn ?? [])
|
|
@@ -273,8 +274,8 @@ var MarkHistory = class {
|
|
|
273
274
|
/** The target `undo` would act on, skipping any whose scene has nothing
|
|
274
275
|
* left — a scene can drop entries this ordering still lists. */
|
|
275
276
|
next(stack, can, at) {
|
|
276
|
-
for (let
|
|
277
|
-
const target = stack[
|
|
277
|
+
for (let i4 = stack.length - 1; i4 >= 0; i4--) {
|
|
278
|
+
const target = stack[i4];
|
|
278
279
|
if (target === void 0) continue;
|
|
279
280
|
const scene = at(target);
|
|
280
281
|
if (scene && can(scene)) return target;
|
|
@@ -282,13 +283,13 @@ var MarkHistory = class {
|
|
|
282
283
|
return null;
|
|
283
284
|
}
|
|
284
285
|
canUndo(at) {
|
|
285
|
-
return this.next(this.undoable, (
|
|
286
|
+
return this.next(this.undoable, (s3) => s3.canUndo(), at) !== null;
|
|
286
287
|
}
|
|
287
288
|
canRedo(at) {
|
|
288
|
-
return this.next(this.redoable, (
|
|
289
|
+
return this.next(this.redoable, (s3) => s3.canRedo(), at) !== null;
|
|
289
290
|
}
|
|
290
291
|
undo(at) {
|
|
291
|
-
const target = this.next(this.undoable, (
|
|
292
|
+
const target = this.next(this.undoable, (s3) => s3.canUndo(), at);
|
|
292
293
|
const scene = target === null ? void 0 : at(target);
|
|
293
294
|
if (!scene) return false;
|
|
294
295
|
this.replaying = "undo";
|
|
@@ -299,7 +300,7 @@ var MarkHistory = class {
|
|
|
299
300
|
}
|
|
300
301
|
}
|
|
301
302
|
redo(at) {
|
|
302
|
-
const target = this.next(this.redoable, (
|
|
303
|
+
const target = this.next(this.redoable, (s3) => s3.canRedo(), at);
|
|
303
304
|
const scene = target === null ? void 0 : at(target);
|
|
304
305
|
if (!scene) return false;
|
|
305
306
|
this.replaying = "redo";
|
|
@@ -311,9 +312,9 @@ var MarkHistory = class {
|
|
|
311
312
|
}
|
|
312
313
|
};
|
|
313
314
|
function drop(stack, value) {
|
|
314
|
-
for (let
|
|
315
|
-
if (stack[
|
|
316
|
-
stack.splice(
|
|
315
|
+
for (let i4 = stack.length - 1; i4 >= 0; i4--) {
|
|
316
|
+
if (stack[i4] === value) {
|
|
317
|
+
stack.splice(i4, 1);
|
|
317
318
|
return;
|
|
318
319
|
}
|
|
319
320
|
}
|
|
@@ -428,21 +429,21 @@ function createAnnotationStore(opts) {
|
|
|
428
429
|
if (!scene) return [];
|
|
429
430
|
const out = [];
|
|
430
431
|
for (const id of scene.renderOrder()) {
|
|
431
|
-
const
|
|
432
|
-
if (
|
|
432
|
+
const a5 = project(target, String(id));
|
|
433
|
+
if (a5) out.push(a5);
|
|
433
434
|
}
|
|
434
435
|
return out;
|
|
435
436
|
};
|
|
436
437
|
const all = () => liveTargets().flatMap(marksOn);
|
|
437
|
-
const matches = (
|
|
438
|
-
if (q.target !== void 0 &&
|
|
439
|
-
if (q.kind !== void 0 &&
|
|
440
|
-
if (q.status !== void 0 &&
|
|
438
|
+
const matches = (a5, q) => {
|
|
439
|
+
if (q.target !== void 0 && a5.target !== q.target) return false;
|
|
440
|
+
if (q.kind !== void 0 && a5.kind !== q.kind) return false;
|
|
441
|
+
if (q.status !== void 0 && a5.status !== q.status) return false;
|
|
441
442
|
if (q.tags !== void 0) {
|
|
442
|
-
const have =
|
|
443
|
+
const have = a5.tags ?? [];
|
|
443
444
|
for (const t of q.tags) if (!have.includes(t)) return false;
|
|
444
445
|
}
|
|
445
|
-
if (q.where && !q.where(
|
|
446
|
+
if (q.where && !q.where(a5)) return false;
|
|
446
447
|
return true;
|
|
447
448
|
};
|
|
448
449
|
const nodeOf = (id) => {
|
|
@@ -460,17 +461,17 @@ function createAnnotationStore(opts) {
|
|
|
460
461
|
return parts ? project(parts.target, parts.node) : void 0;
|
|
461
462
|
},
|
|
462
463
|
query(q) {
|
|
463
|
-
return q ? all().filter((
|
|
464
|
+
return q ? all().filter((a5) => matches(a5, q)) : all();
|
|
464
465
|
},
|
|
465
466
|
hitTest(target, pt, tol = 0) {
|
|
466
|
-
return marksOn(target).filter((
|
|
467
|
+
return marksOn(target).filter((a5) => fracContains(a5.frac, pt, tol)).reverse();
|
|
467
468
|
},
|
|
468
469
|
within(target, box) {
|
|
469
|
-
return marksOn(target).filter((
|
|
470
|
+
return marksOn(target).filter((a5) => fracEncloses(box, a5.frac));
|
|
470
471
|
},
|
|
471
|
-
isStale(
|
|
472
|
-
const keys = targetOf(
|
|
473
|
-
return isStale(
|
|
472
|
+
isStale(a5, config) {
|
|
473
|
+
const keys = targetOf(a5.target)?.positionDependsOn ?? [];
|
|
474
|
+
return isStale(a5.seen, config, keys);
|
|
474
475
|
},
|
|
475
476
|
canUndo() {
|
|
476
477
|
return history.canUndo(historySceneAt);
|
|
@@ -511,7 +512,7 @@ function createAnnotationStore(opts) {
|
|
|
511
512
|
for (const [target, scene] of scenes) {
|
|
512
513
|
const next = wanted.get(target) ?? [];
|
|
513
514
|
const now = scene.getSelection();
|
|
514
|
-
if (now.length === next.length && next.every((n6,
|
|
515
|
+
if (now.length === next.length && next.every((n6, i4) => String(now[i4]) === n6)) continue;
|
|
515
516
|
scene.setSelection(next.map(asNodeId$1));
|
|
516
517
|
}
|
|
517
518
|
});
|
|
@@ -623,7 +624,7 @@ function fitView(content, pane) {
|
|
|
623
624
|
const zoom = content.w > 0 && content.h > 0 ? Math.min(pane.w / content.w, pane.h / content.h) : 1;
|
|
624
625
|
return { zoom: Number.isFinite(zoom) && zoom > 0 ? zoom : 1, pan: { x: 0, y: 0 } };
|
|
625
626
|
}
|
|
626
|
-
var sameRect = (
|
|
627
|
+
var sameRect = (a5, b3) => a5 !== null && a5.x === b3.x && a5.y === b3.y && a5.w === b3.w && a5.h === b3.h;
|
|
627
628
|
function ToolBridge({ toolId }) {
|
|
628
629
|
const tools = useActiveToolContext();
|
|
629
630
|
const setActive = tools.setActive;
|
|
@@ -1122,7 +1123,7 @@ function Portalled({
|
|
|
1122
1123
|
}
|
|
1123
1124
|
function UndockedSections({ trialId, sections, onDock }) {
|
|
1124
1125
|
if (sections.length === 0) return null;
|
|
1125
|
-
return /* @__PURE__ */ jsx(Fragment, { children: sections.map((
|
|
1126
|
+
return /* @__PURE__ */ jsx(Fragment, { children: sections.map((c7) => /* @__PURE__ */ jsx(Portalled, { trialId, contribution: c7, onDock }, c7.id)) });
|
|
1126
1127
|
}
|
|
1127
1128
|
var NO_OP = () => {
|
|
1128
1129
|
};
|
|
@@ -1146,15 +1147,15 @@ function TrialChrome({
|
|
|
1146
1147
|
const lab = useLabContext();
|
|
1147
1148
|
const storeCtx = useContext(LabStoreContext);
|
|
1148
1149
|
if (!storeCtx) throw new Error("[labkit] TrialChrome requires <LabStoreProvider>");
|
|
1149
|
-
const updateTrialView = useStore(storeCtx.store, (
|
|
1150
|
-
const updateTrialSidebarWidth = useStore(storeCtx.store, (
|
|
1151
|
-
const setTrialTitle = useStore(storeCtx.store, (
|
|
1152
|
-
const setTrialSectionCollapsed = useStore(storeCtx.store, (
|
|
1153
|
-
const updateTrialConfig = useStore(storeCtx.store, (
|
|
1154
|
-
const updateTrialState = useStore(storeCtx.store, (
|
|
1155
|
-
const undockPanelAction = useStore(storeCtx.store, (
|
|
1156
|
-
const dockPanelAction = useStore(storeCtx.store, (
|
|
1157
|
-
const undockedPanels = useStore(storeCtx.store, (
|
|
1150
|
+
const updateTrialView = useStore(storeCtx.store, (s3) => s3.updateTrialView);
|
|
1151
|
+
const updateTrialSidebarWidth = useStore(storeCtx.store, (s3) => s3.updateTrialSidebarWidth);
|
|
1152
|
+
const setTrialTitle = useStore(storeCtx.store, (s3) => s3.setTrialTitle);
|
|
1153
|
+
const setTrialSectionCollapsed = useStore(storeCtx.store, (s3) => s3.setTrialSectionCollapsed);
|
|
1154
|
+
const updateTrialConfig = useStore(storeCtx.store, (s3) => s3.updateTrialConfig);
|
|
1155
|
+
const updateTrialState = useStore(storeCtx.store, (s3) => s3.updateTrialState);
|
|
1156
|
+
const undockPanelAction = useStore(storeCtx.store, (s3) => s3.undockPanel);
|
|
1157
|
+
const dockPanelAction = useStore(storeCtx.store, (s3) => s3.dockPanel);
|
|
1158
|
+
const undockedPanels = useStore(storeCtx.store, (s3) => s3.undockedPanels);
|
|
1158
1159
|
const undockedIds = useMemo(
|
|
1159
1160
|
() => Object.values(undockedPanels).filter((p4) => p4.trialId === trialId).map((p4) => p4.sectionId),
|
|
1160
1161
|
[undockedPanels, trialId]
|
|
@@ -1174,9 +1175,9 @@ function TrialChrome({
|
|
|
1174
1175
|
() => cameras?.get(trialId) ?? null
|
|
1175
1176
|
);
|
|
1176
1177
|
const ctx = useMemo(() => {
|
|
1177
|
-
const setZoom = (
|
|
1178
|
-
if (camera) zoomCameraTo(camera,
|
|
1179
|
-
else if (view2d) updateTrialView(trialId, withZoom(view2d,
|
|
1178
|
+
const setZoom = (z) => {
|
|
1179
|
+
if (camera) zoomCameraTo(camera, z);
|
|
1180
|
+
else if (view2d) updateTrialView(trialId, withZoom(view2d, z));
|
|
1180
1181
|
};
|
|
1181
1182
|
return {
|
|
1182
1183
|
trialId,
|
|
@@ -1217,7 +1218,7 @@ function TrialChrome({
|
|
|
1217
1218
|
undockedPanels: undockedIds,
|
|
1218
1219
|
undockPanel: (sectionId, as) => undockPanelAction(trialId, sectionId, as),
|
|
1219
1220
|
dockPanel: (sectionId) => dockPanelAction(trialId, sectionId),
|
|
1220
|
-
savedSnapshots: lab.savedSnapshots.filter((
|
|
1221
|
+
savedSnapshots: lab.savedSnapshots.filter((s3) => s3.trialId === trialId),
|
|
1221
1222
|
saveSnapshot: (name) => lab.saveSnapshot(trialId, name),
|
|
1222
1223
|
loadSnapshot: (snapshotId) => lab.loadSnapshot(trialId, snapshotId),
|
|
1223
1224
|
clone: () => lab.cloneTrial(trialId),
|
|
@@ -1265,7 +1266,7 @@ function TrialChrome({
|
|
|
1265
1266
|
),
|
|
1266
1267
|
[instrument, ctx, trialChrome, chrome, suppress, lab.controls]
|
|
1267
1268
|
);
|
|
1268
|
-
const inRegion = (region) => contributions.filter((
|
|
1269
|
+
const inRegion = (region) => contributions.filter((c7) => c7.region === region);
|
|
1269
1270
|
const handleKeyDown = (e) => {
|
|
1270
1271
|
const mod = e.metaKey || e.ctrlKey;
|
|
1271
1272
|
if (!mod) return;
|
|
@@ -1311,7 +1312,7 @@ function TrialChrome({
|
|
|
1311
1312
|
UndockedSections,
|
|
1312
1313
|
{
|
|
1313
1314
|
trialId,
|
|
1314
|
-
sections: inRegion("sidebar").filter((
|
|
1315
|
+
sections: inRegion("sidebar").filter((c7) => undockedIds.includes(c7.id)),
|
|
1315
1316
|
onDock: ctx.dockPanel
|
|
1316
1317
|
}
|
|
1317
1318
|
)
|
|
@@ -1335,9 +1336,9 @@ function Trial({ id, chrome, suppress }) {
|
|
|
1335
1336
|
const lab = useLabContext();
|
|
1336
1337
|
const storeCtx = useContext(LabStoreContext);
|
|
1337
1338
|
if (!storeCtx) throw new Error("[labkit] <Trial> requires <LabStoreProvider>");
|
|
1338
|
-
const instruments = useStore(storeCtx.store, (
|
|
1339
|
-
const record = useStore(storeCtx.store, (
|
|
1340
|
-
const instrument = record ? instruments.find((
|
|
1339
|
+
const instruments = useStore(storeCtx.store, (s3) => s3.instruments) ?? lab.instruments;
|
|
1340
|
+
const record = useStore(storeCtx.store, (s3) => s3.trials.find((w2) => w2.id === id));
|
|
1341
|
+
const instrument = record ? instruments.find((i4) => i4.name === record.instrumentName) : void 0;
|
|
1341
1342
|
const kept = useKeptMarks(instrument?.annotations?.storage, id);
|
|
1342
1343
|
if (!record) {
|
|
1343
1344
|
return /* @__PURE__ */ jsxs("div", { className: "lk-trial lk-trial--unknown", children: [
|
|
@@ -1409,14 +1410,14 @@ function TrialRuntime({
|
|
|
1409
1410
|
);
|
|
1410
1411
|
const [pointer] = useState(createPointerStore);
|
|
1411
1412
|
const canvasContainerRef = useRef(null);
|
|
1412
|
-
const updateTrialState = useStore(store, (
|
|
1413
|
-
const updateTrialConfig = useStore(store, (
|
|
1414
|
-
const updateTrialView = useStore(store, (
|
|
1415
|
-
const updateTrialUndoStack = useStore(store, (
|
|
1416
|
-
const updateTrialAnnotations = useStore(store, (
|
|
1417
|
-
const labToolId = useStore(store, (
|
|
1418
|
-
const setLabTool = useStore(store, (
|
|
1419
|
-
const setTrialTool = useStore(store, (
|
|
1413
|
+
const updateTrialState = useStore(store, (s3) => s3.updateTrialState);
|
|
1414
|
+
const updateTrialConfig = useStore(store, (s3) => s3.updateTrialConfig);
|
|
1415
|
+
const updateTrialView = useStore(store, (s3) => s3.updateTrialView);
|
|
1416
|
+
const updateTrialUndoStack = useStore(store, (s3) => s3.updateTrialUndoStack);
|
|
1417
|
+
const updateTrialAnnotations = useStore(store, (s3) => s3.updateTrialAnnotations);
|
|
1418
|
+
const labToolId = useStore(store, (s3) => s3.activeToolId);
|
|
1419
|
+
const setLabTool = useStore(store, (s3) => s3.setLabTool);
|
|
1420
|
+
const setTrialTool = useStore(store, (s3) => s3.setTrialTool);
|
|
1420
1421
|
const schema = useConfigSchema(instrument);
|
|
1421
1422
|
const { config } = useResolvedConfig(schema, record.config, record.auto);
|
|
1422
1423
|
const busRef = useRef(null);
|
|
@@ -1566,9 +1567,9 @@ function TrialRuntime({
|
|
|
1566
1567
|
view: record.view,
|
|
1567
1568
|
setView,
|
|
1568
1569
|
zoom: view2d?.zoom ?? 1,
|
|
1569
|
-
setZoom: (
|
|
1570
|
+
setZoom: (z) => {
|
|
1570
1571
|
if (!view2d) return;
|
|
1571
|
-
updateTrialView(record.id, withZoom(view2d,
|
|
1572
|
+
updateTrialView(record.id, withZoom(view2d, z));
|
|
1572
1573
|
},
|
|
1573
1574
|
activeToolId: resolvedToolId,
|
|
1574
1575
|
visibleLayers,
|
|
@@ -1608,7 +1609,7 @@ function TrialRuntime({
|
|
|
1608
1609
|
const canvasLayers = useMemo(() => {
|
|
1609
1610
|
if (!instrument.canvas) return [];
|
|
1610
1611
|
const baseLayers = instrument.canvas.layers;
|
|
1611
|
-
const ordered = layerOrder ? [...baseLayers].sort((
|
|
1612
|
+
const ordered = layerOrder ? [...baseLayers].sort((a5, b3) => layerOrder.indexOf(a5.id) - layerOrder.indexOf(b3.id)) : baseLayers;
|
|
1612
1613
|
return ordered.map((layer) => ({
|
|
1613
1614
|
id: layer.id,
|
|
1614
1615
|
visible: layerVisibility[layer.id] !== false,
|
|
@@ -1623,7 +1624,7 @@ function TrialRuntime({
|
|
|
1623
1624
|
return instrument.layers.ids.map((l8) => typeof l8 === "string" ? { id: l8, label: l8 } : l8);
|
|
1624
1625
|
}, [instrument.layers]);
|
|
1625
1626
|
const layerItems = useMemo(() => {
|
|
1626
|
-
const ordered = layerOrder ? [...layerDescriptors].sort((
|
|
1627
|
+
const ordered = layerOrder ? [...layerDescriptors].sort((a5, b3) => layerOrder.indexOf(a5.id) - layerOrder.indexOf(b3.id)) : layerDescriptors;
|
|
1627
1628
|
const pinnedLast = [
|
|
1628
1629
|
...ordered.filter((l8) => !l8.alwaysOn),
|
|
1629
1630
|
...ordered.filter((l8) => l8.alwaysOn)
|
|
@@ -1636,7 +1637,7 @@ function TrialRuntime({
|
|
|
1636
1637
|
}));
|
|
1637
1638
|
}, [layerDescriptors, layerOrder, layerVisibility]);
|
|
1638
1639
|
const dragDropResult = useDragDrop({
|
|
1639
|
-
capability: instrument.dragDrop ?? { palette: [], onDrop: (_p, _i,
|
|
1640
|
+
capability: instrument.dragDrop ?? { palette: [], onDrop: (_p, _i, s3) => s3 },
|
|
1640
1641
|
canvasContainerRef,
|
|
1641
1642
|
view: view2d ?? DEFAULT_VIEW,
|
|
1642
1643
|
worldSpec: instrument.canvas?.worldSpec,
|
|
@@ -1793,7 +1794,7 @@ function TrialRuntime({
|
|
|
1793
1794
|
// src/trial/trialOps.ts
|
|
1794
1795
|
var DEFAULT_VIEW2 = { zoom: 1, pan: { x: 0, y: 0 } };
|
|
1795
1796
|
function findInstrument(instruments, name) {
|
|
1796
|
-
const found = instruments.find((
|
|
1797
|
+
const found = instruments.find((i4) => i4.name === name);
|
|
1797
1798
|
if (!found) {
|
|
1798
1799
|
throw new Error(`[labkit] Unknown instrument: "${name}"`);
|
|
1799
1800
|
}
|
|
@@ -1912,7 +1913,7 @@ function findOvershoot(bound, items, tolerance = 1) {
|
|
|
1912
1913
|
return worst;
|
|
1913
1914
|
}
|
|
1914
1915
|
function tagAndClasses(el) {
|
|
1915
|
-
return el.tagName.toLowerCase() + [...el.classList].map((
|
|
1916
|
+
return el.tagName.toLowerCase() + [...el.classList].map((c7) => `.${c7}`).join("");
|
|
1916
1917
|
}
|
|
1917
1918
|
function describeElement(el) {
|
|
1918
1919
|
if (el.classList.length > 0) return tagAndClasses(el);
|
|
@@ -1999,7 +2000,7 @@ function LabHeader({ addTrial: addTrial2 = true }) {
|
|
|
1999
2000
|
{
|
|
2000
2001
|
"aria-label": "Add trial",
|
|
2001
2002
|
label: "Add trial\u2026",
|
|
2002
|
-
items: lab.instruments.map((
|
|
2003
|
+
items: lab.instruments.map((i4) => ({ value: i4.name, label: i4.title ?? i4.name })),
|
|
2003
2004
|
onAction: (name) => lab.addTrial(name)
|
|
2004
2005
|
}
|
|
2005
2006
|
) });
|
|
@@ -2011,7 +2012,7 @@ function LabThemeSwitcher() {
|
|
|
2011
2012
|
function LabPalette({ tools, contributions }) {
|
|
2012
2013
|
const ctx = useLabChromeContext();
|
|
2013
2014
|
const all = labContributions(tools, contributions);
|
|
2014
|
-
return /* @__PURE__ */ jsx(PaletteRegion, { contributions: all.filter((
|
|
2015
|
+
return /* @__PURE__ */ jsx(PaletteRegion, { contributions: all.filter((c7) => c7.region === "palette"), ctx });
|
|
2015
2016
|
}
|
|
2016
2017
|
function LabRoot({ children, mode = "auto", className }) {
|
|
2017
2018
|
const resolved = useResolvedColorMode(mode);
|
|
@@ -2084,13 +2085,13 @@ function LabSwitcher({ title, pages, path, className }) {
|
|
|
2084
2085
|
]
|
|
2085
2086
|
}
|
|
2086
2087
|
) }),
|
|
2087
|
-
open && /* @__PURE__ */ jsx("div", { className: "lk-switcher-menu", id: menuId, role: "menu", children: pages.map((page,
|
|
2088
|
+
open && /* @__PURE__ */ jsx("div", { className: "lk-switcher-menu", id: menuId, role: "menu", children: pages.map((page, i4) => /* @__PURE__ */ jsx(
|
|
2088
2089
|
"a",
|
|
2089
2090
|
{
|
|
2090
2091
|
href: page.href,
|
|
2091
2092
|
role: "menuitem",
|
|
2092
2093
|
className: "lk-switcher-item",
|
|
2093
|
-
"aria-current":
|
|
2094
|
+
"aria-current": i4 === here ? "page" : void 0,
|
|
2094
2095
|
onClick: close,
|
|
2095
2096
|
children: page.label
|
|
2096
2097
|
},
|
|
@@ -2157,8 +2158,8 @@ function LabZoomControls() {
|
|
|
2157
2158
|
cameras?.subscribe ?? noSubscribe2,
|
|
2158
2159
|
() => cameras && focusedTrialId ? cameras.get(focusedTrialId) : null
|
|
2159
2160
|
);
|
|
2160
|
-
const zoom = useStore(storeCtx.store, (
|
|
2161
|
-
const record =
|
|
2161
|
+
const zoom = useStore(storeCtx.store, (s3) => {
|
|
2162
|
+
const record = s3.trials.find((t) => t.id === focusedTrialId);
|
|
2162
2163
|
return as2DView(record?.view)?.zoom ?? null;
|
|
2163
2164
|
});
|
|
2164
2165
|
const live = zoom !== null && camera !== null;
|
|
@@ -2280,7 +2281,7 @@ function Workspace({
|
|
|
2280
2281
|
const tilePanels = useMemo(() => (panels ?? []).filter((p4) => p4.as === "tile"), [panels]);
|
|
2281
2282
|
const floatPanels = useMemo(() => (panels ?? []).filter((p4) => p4.as === "floating"), [panels]);
|
|
2282
2283
|
const idKey = JSON.stringify([
|
|
2283
|
-
...items.map((_2,
|
|
2284
|
+
...items.map((_2, i4) => ids?.[i4] ?? `lk-ws-${i4}`),
|
|
2284
2285
|
...tilePanels.map((p4) => `lk-panel-${p4.key}`)
|
|
2285
2286
|
]);
|
|
2286
2287
|
const nodeIds = useMemo(() => JSON.parse(idKey).map(asNodeId), [idKey]);
|
|
@@ -2331,7 +2332,7 @@ function Workspace({
|
|
|
2331
2332
|
[onReorder]
|
|
2332
2333
|
);
|
|
2333
2334
|
const chrome = useMemo(() => {
|
|
2334
|
-
const byId = new Map(nodeIds.map((id,
|
|
2335
|
+
const byId = new Map(nodeIds.map((id, i4) => [id, items[i4]]));
|
|
2335
2336
|
const panelByNode = new Map(
|
|
2336
2337
|
tilePanels.map((p4) => [`lk-panel-${p4.key}`, p4])
|
|
2337
2338
|
);
|
|
@@ -2397,7 +2398,7 @@ async function openStoredLab({ instruments, defaultInstrument, mode }, storageKe
|
|
|
2397
2398
|
const marks = /* @__PURE__ */ new Map();
|
|
2398
2399
|
await Promise.all(
|
|
2399
2400
|
opened.store.getState().trials.map(async (trial) => {
|
|
2400
|
-
const kept = instruments.find((
|
|
2401
|
+
const kept = instruments.find((i4) => i4.name === trial.instrumentName)?.annotations?.storage;
|
|
2401
2402
|
if (!kept) return;
|
|
2402
2403
|
try {
|
|
2403
2404
|
marks.set(trial.id, await kept.load());
|
|
@@ -2447,10 +2448,10 @@ var NEBULA_SLOTS = [
|
|
|
2447
2448
|
function buildNebula(list, theme, mode, density) {
|
|
2448
2449
|
const ctx = { theme, resolved: resolveTheme(theme, { mode, density }) };
|
|
2449
2450
|
const n6 = colorCount(list, ctx) ?? NEBULA_SLOTS.length;
|
|
2450
|
-
const colors = Array.from({ length: n6 }, (_2,
|
|
2451
|
-
const blobs = colors.map((
|
|
2452
|
-
const p4 = NEBULA_SLOTS[
|
|
2453
|
-
return `radial-gradient(ellipse ${p4.sx} ${p4.sy} at ${p4.cx} ${p4.cy}, color-mix(in srgb, ${
|
|
2451
|
+
const colors = Array.from({ length: n6 }, (_2, i4) => colorAt(list, i4, ctx));
|
|
2452
|
+
const blobs = colors.map((c7, i4) => {
|
|
2453
|
+
const p4 = NEBULA_SLOTS[i4 % NEBULA_SLOTS.length];
|
|
2454
|
+
return `radial-gradient(ellipse ${p4.sx} ${p4.sy} at ${p4.cx} ${p4.cy}, color-mix(in srgb, ${c7} 22%, transparent), transparent ${p4.stop})`;
|
|
2454
2455
|
});
|
|
2455
2456
|
blobs.push("radial-gradient(ellipse at center, #0a0a18 0%, #02020a 100%)");
|
|
2456
2457
|
return blobs.join(", ");
|
|
@@ -2470,7 +2471,7 @@ function LabPanes({
|
|
|
2470
2471
|
void 0,
|
|
2471
2472
|
{ scope: "lab" }
|
|
2472
2473
|
);
|
|
2473
|
-
const main = contributions.some((
|
|
2474
|
+
const main = contributions.some((c7) => c7.region === "aside") ? /* @__PURE__ */ jsx(
|
|
2474
2475
|
Split,
|
|
2475
2476
|
{
|
|
2476
2477
|
className: "lk-lab__panes",
|
|
@@ -2488,7 +2489,7 @@ function LabPanes({
|
|
|
2488
2489
|
children
|
|
2489
2490
|
}
|
|
2490
2491
|
) : children;
|
|
2491
|
-
if (!contributions.some((
|
|
2492
|
+
if (!contributions.some((c7) => c7.region === "sidebar")) return main;
|
|
2492
2493
|
return /* @__PURE__ */ jsx(
|
|
2493
2494
|
Split,
|
|
2494
2495
|
{
|
|
@@ -2557,14 +2558,14 @@ function LabRuntime({
|
|
|
2557
2558
|
useLayoutEffect(() => {
|
|
2558
2559
|
store.getState().setInstruments(instruments);
|
|
2559
2560
|
}, [instruments, store]);
|
|
2560
|
-
const trials = useStore(store, (
|
|
2561
|
+
const trials = useStore(store, (s3) => s3.trials);
|
|
2561
2562
|
const [cameras] = useState(createCameraRegistry);
|
|
2562
2563
|
const [focusPick, setFocusPick] = useState(null);
|
|
2563
2564
|
const focusedTrialId = trials.some((t) => t.id === focusPick) ? focusPick : trials[0]?.id ?? null;
|
|
2564
|
-
const savedSnapshots = useStore(store, (
|
|
2565
|
-
const modeValue = useStore(store, (
|
|
2566
|
-
const layout = useStore(store, (
|
|
2567
|
-
const undockedPanels = useStore(store, (
|
|
2565
|
+
const savedSnapshots = useStore(store, (s3) => s3.savedSnapshots);
|
|
2566
|
+
const modeValue = useStore(store, (s3) => s3.mode);
|
|
2567
|
+
const layout = useStore(store, (s3) => s3.layout);
|
|
2568
|
+
const undockedPanels = useStore(store, (s3) => s3.undockedPanels);
|
|
2568
2569
|
const panelHostsRef = useRef(null);
|
|
2569
2570
|
if (panelHostsRef.current === null) panelHostsRef.current = createPanelHostRegistry();
|
|
2570
2571
|
const outerSurface = useSurfaceOptional();
|
|
@@ -2577,17 +2578,17 @@ function LabRuntime({
|
|
|
2577
2578
|
const bufferRef = useRef({ w: 0, h: 0 });
|
|
2578
2579
|
const surfaceRef = useRef(null);
|
|
2579
2580
|
const onFrame = useCallback((frame) => {
|
|
2580
|
-
const canvases = [ownUnderRef.current, ownOverRef.current].filter((
|
|
2581
|
+
const canvases = [ownUnderRef.current, ownOverRef.current].filter((c7) => c7 !== null);
|
|
2581
2582
|
if (canvases.length === 0) return;
|
|
2582
2583
|
const w2 = Math.round(frame.size.width * frame.dpr);
|
|
2583
2584
|
const h2 = Math.round(frame.size.height * frame.dpr);
|
|
2584
2585
|
if (bufferRef.current.w !== w2 || bufferRef.current.h !== h2) {
|
|
2585
2586
|
bufferRef.current = { w: w2, h: h2 };
|
|
2586
|
-
for (const
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2587
|
+
for (const c7 of canvases) {
|
|
2588
|
+
c7.width = w2;
|
|
2589
|
+
c7.height = h2;
|
|
2590
|
+
c7.style.width = `${frame.size.width}px`;
|
|
2591
|
+
c7.style.height = `${frame.size.height}px`;
|
|
2591
2592
|
}
|
|
2592
2593
|
surfaceRef.current?.invalidateAll();
|
|
2593
2594
|
return;
|
|
@@ -2653,8 +2654,8 @@ function LabRuntime({
|
|
|
2653
2654
|
() => labContributions([...annotationTools, ...tools ?? []], labChrome),
|
|
2654
2655
|
[annotationTools, tools, labChrome]
|
|
2655
2656
|
);
|
|
2656
|
-
const hasFooterChrome = labChromeAll.some((
|
|
2657
|
-
const hasPaneChrome = labChromeAll.some((
|
|
2657
|
+
const hasFooterChrome = labChromeAll.some((c7) => c7.region === "footer");
|
|
2658
|
+
const hasPaneChrome = labChromeAll.some((c7) => c7.region === "sidebar" || c7.region === "aside");
|
|
2658
2659
|
useEffect(() => {
|
|
2659
2660
|
if (mode && mode !== store.getState().mode) {
|
|
2660
2661
|
store.getState().setMode(mode);
|
|
@@ -2706,15 +2707,15 @@ function LabRuntime({
|
|
|
2706
2707
|
const next = resetTrial(store.getState().trials, id, instruments);
|
|
2707
2708
|
const record = next.find((w2) => w2.id === id);
|
|
2708
2709
|
if (!record) return;
|
|
2709
|
-
store.setState((
|
|
2710
|
-
trials:
|
|
2710
|
+
store.setState((s3) => ({
|
|
2711
|
+
trials: s3.trials.map(
|
|
2711
2712
|
(w2) => w2.id === id ? { ...w2, config: record.config, state: record.state, view: record.view } : w2
|
|
2712
2713
|
)
|
|
2713
2714
|
}));
|
|
2714
2715
|
},
|
|
2715
2716
|
savedSnapshots,
|
|
2716
2717
|
saveSnapshot: (trialId, name) => {
|
|
2717
|
-
const taken = store.getState().savedSnapshots.filter((
|
|
2718
|
+
const taken = store.getState().savedSnapshots.filter((s3) => s3.trialId === trialId).length;
|
|
2718
2719
|
store.getState().saveSnapshot(trialId, name ?? `Snapshot ${taken + 1}`);
|
|
2719
2720
|
},
|
|
2720
2721
|
loadSnapshot: (trialId, snapshotId) => {
|
|
@@ -2939,18 +2940,18 @@ function ButtonsAndToggles() {
|
|
|
2939
2940
|
/* @__PURE__ */ jsx(Xt, { status: "muted", children: "MUTED" })
|
|
2940
2941
|
] }) }),
|
|
2941
2942
|
/* @__PURE__ */ jsx(Cell, { label: "Checkbox, Switch", children: /* @__PURE__ */ jsxs("div", { className: "lk-specimen__row", children: [
|
|
2942
|
-
/* @__PURE__ */ jsx(
|
|
2943
|
-
/* @__PURE__ */ jsx(
|
|
2944
|
-
/* @__PURE__ */ jsx(
|
|
2943
|
+
/* @__PURE__ */ jsx(c6, { isSelected: snap, onChange: setSnap, children: "Snap to grid" }),
|
|
2944
|
+
/* @__PURE__ */ jsx(c6, { isIndeterminate: true, children: "Mixed" }),
|
|
2945
|
+
/* @__PURE__ */ jsx(a6, { isSelected: wifi, onChange: setWifi, children: "Wifi" })
|
|
2945
2946
|
] }) }),
|
|
2946
|
-
/* @__PURE__ */ jsx(Cell, { label: "RadioGroup", children: /* @__PURE__ */ jsxs(
|
|
2947
|
+
/* @__PURE__ */ jsx(Cell, { label: "RadioGroup", children: /* @__PURE__ */ jsxs(l5, { label: "Snap mode", orientation: "horizontal", defaultValue: "grid", children: [
|
|
2947
2948
|
/* @__PURE__ */ jsx(u3, { value: "off", children: "Off" }),
|
|
2948
2949
|
/* @__PURE__ */ jsx(u3, { value: "grid", children: "Grid" }),
|
|
2949
2950
|
/* @__PURE__ */ jsx(u3, { value: "pixel", children: "Pixel" })
|
|
2950
2951
|
] }) }),
|
|
2951
2952
|
/* @__PURE__ */ jsxs(Cell, { label: "ToggleBar", children: [
|
|
2952
2953
|
/* @__PURE__ */ jsx(
|
|
2953
|
-
|
|
2954
|
+
a5,
|
|
2954
2955
|
{
|
|
2955
2956
|
ariaLabel: "Align",
|
|
2956
2957
|
value: align,
|
|
@@ -2963,7 +2964,7 @@ function ButtonsAndToggles() {
|
|
|
2963
2964
|
}
|
|
2964
2965
|
),
|
|
2965
2966
|
/* @__PURE__ */ jsx(
|
|
2966
|
-
|
|
2967
|
+
a5,
|
|
2967
2968
|
{
|
|
2968
2969
|
ariaLabel: "Align, flat",
|
|
2969
2970
|
variant: "flat",
|
|
@@ -2989,7 +2990,7 @@ function ButtonsAndToggles() {
|
|
|
2989
2990
|
}
|
|
2990
2991
|
),
|
|
2991
2992
|
/* @__PURE__ */ jsx(
|
|
2992
|
-
|
|
2993
|
+
a8,
|
|
2993
2994
|
{
|
|
2994
2995
|
items: [
|
|
2995
2996
|
{ value: "undo", label: "Undo", onAction: () => {
|
|
@@ -3013,17 +3014,17 @@ function ButtonsAndToggles() {
|
|
|
3013
3014
|
]
|
|
3014
3015
|
}
|
|
3015
3016
|
),
|
|
3016
|
-
/* @__PURE__ */ jsx(
|
|
3017
|
+
/* @__PURE__ */ jsx(i3, { open, onToggle: () => setOpen((o4) => !o4), label: "Shapes" })
|
|
3017
3018
|
] }) }),
|
|
3018
3019
|
/* @__PURE__ */ jsx(Cell, { label: "Tabs", children: /* @__PURE__ */ jsxs(o5, { children: [
|
|
3019
|
-
/* @__PURE__ */ jsxs(
|
|
3020
|
-
/* @__PURE__ */ jsx(
|
|
3021
|
-
/* @__PURE__ */ jsx(
|
|
3022
|
-
/* @__PURE__ */ jsx(
|
|
3020
|
+
/* @__PURE__ */ jsxs(s4, { "aria-label": "Sections", children: [
|
|
3021
|
+
/* @__PURE__ */ jsx(c7, { id: "props", children: "Props" }),
|
|
3022
|
+
/* @__PURE__ */ jsx(c7, { id: "events", children: "Events" }),
|
|
3023
|
+
/* @__PURE__ */ jsx(c7, { id: "snapshot", children: "Snapshot" })
|
|
3023
3024
|
] }),
|
|
3024
|
-
/* @__PURE__ */ jsx(
|
|
3025
|
-
/* @__PURE__ */ jsx(
|
|
3026
|
-
/* @__PURE__ */ jsx(
|
|
3025
|
+
/* @__PURE__ */ jsx(l9, { id: "props", children: "Props panel." }),
|
|
3026
|
+
/* @__PURE__ */ jsx(l9, { id: "events", children: "Events panel." }),
|
|
3027
|
+
/* @__PURE__ */ jsx(l9, { id: "snapshot", children: "Snapshot panel." })
|
|
3027
3028
|
] }) }),
|
|
3028
3029
|
/* @__PURE__ */ jsx(Cell, { label: "Keycaps", children: /* @__PURE__ */ jsxs("div", { className: "lk-specimen__row", children: [
|
|
3029
3030
|
/* @__PURE__ */ jsx(p, { keys: [{ label: "\u2318" }, { label: "\u21E7" }, { label: "K" }], separator: "+" }),
|
|
@@ -3088,9 +3089,9 @@ function FieldsAndPickers() {
|
|
|
3088
3089
|
)
|
|
3089
3090
|
] }),
|
|
3090
3091
|
/* @__PURE__ */ jsxs(Cell, { label: "RangeSlider, Slider", children: [
|
|
3091
|
-
/* @__PURE__ */ jsx(
|
|
3092
|
+
/* @__PURE__ */ jsx(l10, { label: "Range", defaultValue: [20, 80], minValue: 0, maxValue: 100 }),
|
|
3092
3093
|
/* @__PURE__ */ jsx(
|
|
3093
|
-
|
|
3094
|
+
l10,
|
|
3094
3095
|
{
|
|
3095
3096
|
label: "Opacity",
|
|
3096
3097
|
defaultValue: 75,
|
|
@@ -3115,7 +3116,7 @@ function FieldsAndPickers() {
|
|
|
3115
3116
|
] }),
|
|
3116
3117
|
/* @__PURE__ */ jsxs(Cell, { label: "DetentSlider, InlineRange", children: [
|
|
3117
3118
|
/* @__PURE__ */ jsx(
|
|
3118
|
-
|
|
3119
|
+
c8,
|
|
3119
3120
|
{
|
|
3120
3121
|
items: [0.25, 0.5, 1, 2, 4],
|
|
3121
3122
|
value: rate,
|
|
@@ -3170,9 +3171,9 @@ function PanelsAndRows() {
|
|
|
3170
3171
|
]);
|
|
3171
3172
|
const [panelCollapsed, setPanelCollapsed] = useState(false);
|
|
3172
3173
|
return /* @__PURE__ */ jsxs(Section, { title: "Panels & property rows", children: [
|
|
3173
|
-
/* @__PURE__ */ jsx(Cell, { label: "PropertyPanel", children: /* @__PURE__ */ jsx(
|
|
3174
|
+
/* @__PURE__ */ jsx(Cell, { label: "PropertyPanel", children: /* @__PURE__ */ jsx(ae2, { title: "Shape", children: /* @__PURE__ */ jsxs(oe, { children: [
|
|
3174
3175
|
/* @__PURE__ */ jsx(
|
|
3175
|
-
|
|
3176
|
+
de,
|
|
3176
3177
|
{
|
|
3177
3178
|
kind: "number",
|
|
3178
3179
|
control: "slider",
|
|
@@ -3185,7 +3186,7 @@ function PanelsAndRows() {
|
|
|
3185
3186
|
}
|
|
3186
3187
|
),
|
|
3187
3188
|
/* @__PURE__ */ jsx(
|
|
3188
|
-
|
|
3189
|
+
de,
|
|
3189
3190
|
{
|
|
3190
3191
|
kind: "number",
|
|
3191
3192
|
control: "slider",
|
|
@@ -3198,7 +3199,7 @@ function PanelsAndRows() {
|
|
|
3198
3199
|
}
|
|
3199
3200
|
),
|
|
3200
3201
|
/* @__PURE__ */ jsx(
|
|
3201
|
-
|
|
3202
|
+
de,
|
|
3202
3203
|
{
|
|
3203
3204
|
kind: "color",
|
|
3204
3205
|
label: "Fill",
|
|
@@ -3208,9 +3209,9 @@ function PanelsAndRows() {
|
|
|
3208
3209
|
onAlphaChange: setAlpha
|
|
3209
3210
|
}
|
|
3210
3211
|
),
|
|
3211
|
-
/* @__PURE__ */ jsx(
|
|
3212
|
+
/* @__PURE__ */ jsx(de, { kind: "color", label: "Stroke", value: stroke, onChange: setStroke }),
|
|
3212
3213
|
/* @__PURE__ */ jsx(
|
|
3213
|
-
|
|
3214
|
+
de,
|
|
3214
3215
|
{
|
|
3215
3216
|
kind: "number",
|
|
3216
3217
|
label: "Count",
|
|
@@ -3222,7 +3223,7 @@ function PanelsAndRows() {
|
|
|
3222
3223
|
}
|
|
3223
3224
|
),
|
|
3224
3225
|
/* @__PURE__ */ jsx(
|
|
3225
|
-
|
|
3226
|
+
de,
|
|
3226
3227
|
{
|
|
3227
3228
|
kind: "enum",
|
|
3228
3229
|
label: "Line cap",
|
|
@@ -3235,7 +3236,7 @@ function PanelsAndRows() {
|
|
|
3235
3236
|
}
|
|
3236
3237
|
),
|
|
3237
3238
|
/* @__PURE__ */ jsx(
|
|
3238
|
-
|
|
3239
|
+
de,
|
|
3239
3240
|
{
|
|
3240
3241
|
kind: "enum",
|
|
3241
3242
|
control: "toggle",
|
|
@@ -3249,10 +3250,10 @@ function PanelsAndRows() {
|
|
|
3249
3250
|
]
|
|
3250
3251
|
}
|
|
3251
3252
|
),
|
|
3252
|
-
/* @__PURE__ */ jsx(
|
|
3253
|
-
/* @__PURE__ */ jsx(
|
|
3253
|
+
/* @__PURE__ */ jsx(de, { kind: "string", label: "Label", value: label, onChange: setLabel }),
|
|
3254
|
+
/* @__PURE__ */ jsx(de, { kind: "boolean", label: "Visible", value: visible, onChange: setVisible }),
|
|
3254
3255
|
/* @__PURE__ */ jsx(b3, { title: "Bevel", defaultCollapsed: true, children: /* @__PURE__ */ jsx(
|
|
3255
|
-
|
|
3256
|
+
de,
|
|
3256
3257
|
{
|
|
3257
3258
|
kind: "number",
|
|
3258
3259
|
control: "slider",
|
|
@@ -3286,7 +3287,7 @@ function PanelsAndRows() {
|
|
|
3286
3287
|
}
|
|
3287
3288
|
) }),
|
|
3288
3289
|
/* @__PURE__ */ jsx(Cell, { label: "Sidebar, SidebarPanel", children: /* @__PURE__ */ jsx("div", { className: "lk-specimen__box", children: /* @__PURE__ */ jsx(n6, { side: "right", ariaLabel: "Specimen sidebar", children: /* @__PURE__ */ jsx(
|
|
3289
|
-
|
|
3290
|
+
a9,
|
|
3290
3291
|
{
|
|
3291
3292
|
title: "Selection",
|
|
3292
3293
|
collapsed: panelCollapsed,
|
|
@@ -3305,7 +3306,7 @@ function OverlaysAndFeedback() {
|
|
|
3305
3306
|
const toasts = useMemo(() => C3(), []);
|
|
3306
3307
|
return /* @__PURE__ */ jsxs(Section, { title: "Overlays & feedback", children: [
|
|
3307
3308
|
/* @__PURE__ */ jsx(Cell, { label: "Tooltip, Callout, Dialog, Toast", children: /* @__PURE__ */ jsxs("div", { className: "lk-specimen__row", children: [
|
|
3308
|
-
/* @__PURE__ */ jsxs(
|
|
3309
|
+
/* @__PURE__ */ jsxs(l3, { children: [
|
|
3309
3310
|
/* @__PURE__ */ jsx(Focusable, { children: /* @__PURE__ */ jsx("button", { type: "button", children: "Hover me" }) }),
|
|
3310
3311
|
/* @__PURE__ */ jsx(u, { placement: "bottom", children: "Duplicates the selected layer" })
|
|
3311
3312
|
] }),
|
|
@@ -3406,14 +3407,14 @@ function ToolChrome() {
|
|
|
3406
3407
|
},
|
|
3407
3408
|
id
|
|
3408
3409
|
)) }) }),
|
|
3409
|
-
/* @__PURE__ */ jsx(Cell, { label: "ToolOptionsBar", children: /* @__PURE__ */ jsxs(
|
|
3410
|
+
/* @__PURE__ */ jsx(Cell, { label: "ToolOptionsBar", children: /* @__PURE__ */ jsxs(c5, { label: "Text", children: [
|
|
3410
3411
|
/* @__PURE__ */ jsx(c, { size: "sm", variant: "ghost", iconOnly: true, ariaLabel: "Bold", children: "B" }),
|
|
3411
3412
|
/* @__PURE__ */ jsx(c, { size: "sm", variant: "ghost", iconOnly: true, ariaLabel: "Italic", children: "I" })
|
|
3412
3413
|
] }) }),
|
|
3413
3414
|
/* @__PURE__ */ jsx(Cell, { label: "ResizeHandle", children: /* @__PURE__ */ jsxs("div", { className: "lk-specimen__box", children: [
|
|
3414
3415
|
/* @__PURE__ */ jsx("div", { className: "lk-specimen__box-main", children: "content" }),
|
|
3415
3416
|
/* @__PURE__ */ jsx(
|
|
3416
|
-
|
|
3417
|
+
l8,
|
|
3417
3418
|
{
|
|
3418
3419
|
value: paneWidth,
|
|
3419
3420
|
min: 100,
|
|
@@ -3537,7 +3538,7 @@ function EditorsAndPlots() {
|
|
|
3537
3538
|
}
|
|
3538
3539
|
) }),
|
|
3539
3540
|
/* @__PURE__ */ jsx(Cell, { label: "Timeline", wide: true, children: /* @__PURE__ */ jsx("div", { className: "lk-specimen__timeline", children: /* @__PURE__ */ jsx(
|
|
3540
|
-
|
|
3541
|
+
xe2,
|
|
3541
3542
|
{
|
|
3542
3543
|
tracks,
|
|
3543
3544
|
duration: 2e3,
|