@weasel-js/labkit 1.7.3 → 1.8.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/{CanvasStackContext-Cjy6I-Iv.d.ts → CanvasStackContext-C0fzFsQg.d.ts} +1 -1
- package/dist/_dts/{Stage-D6t7o0pF.d.ts → Stage-Cvwxdnfp.d.ts} +2 -2
- package/dist/_dts/{index-BTmaRy6a.d.ts → index-DEHRoTXK.d.ts} +2 -2
- package/dist/_dts/{index-DCMA4Fy1.d.ts → index-DRaswz91.d.ts} +1 -1
- package/dist/_dts/{types-BUBSIZuV.d.ts → types-DUfQ0isU.d.ts} +5 -1
- package/dist/_dts/{useTrialState-Bh8bzFgE.d.ts → useTrialState-CS4TdWPW.d.ts} +1 -1
- package/dist/canvas/index.d.ts +5 -5
- package/dist/chrome/index.d.ts +3 -3
- package/dist/chrome/index.js +4 -4
- package/dist/{chunk-4TJ34FXA.js → chunk-3L4MLLQB.js} +4 -4
- package/dist/chunk-3L4MLLQB.js.map +1 -0
- package/dist/{chunk-XSJJTXNA.js → chunk-7KAETQSS.js} +19 -19
- package/dist/chunk-7KAETQSS.js.map +1 -0
- package/dist/{chunk-YCFKW5RX.js → chunk-J5HJJDLF.js} +11 -2
- package/dist/chunk-J5HJJDLF.js.map +1 -0
- package/dist/{chunk-E6NARGU7.js → chunk-MOTDMMMN.js} +3 -3
- package/dist/{chunk-E6NARGU7.js.map → chunk-MOTDMMMN.js.map} +1 -1
- package/dist/{chunk-LPGBC63T.js → chunk-NVKBL7ZE.js} +3 -3
- package/dist/{chunk-LPGBC63T.js.map → chunk-NVKBL7ZE.js.map} +1 -1
- package/dist/chunk-WURZTJGQ.js +15756 -0
- package/dist/chunk-WURZTJGQ.js.map +1 -0
- package/dist/{chunk-IBVRMHW5.js → chunk-XXACAPVU.js} +3 -3
- package/dist/{chunk-IBVRMHW5.js.map → chunk-XXACAPVU.js.map} +1 -1
- package/dist/{chunk-4X44DMRS.js → chunk-YDE6XATS.js} +7 -7
- package/dist/{chunk-4X44DMRS.js.map → chunk-YDE6XATS.js.map} +1 -1
- package/dist/{chunk-HBGH344L.js → chunk-YX75W6EK.js} +53 -16
- package/dist/chunk-YX75W6EK.js.map +1 -0
- package/dist/config/index.d.ts +12 -5
- package/dist/config/index.js +2 -2
- package/dist/controls/index.d.ts +2 -2
- package/dist/controls/index.js +3 -3
- package/dist/dragdrop/index.d.ts +2 -2
- package/dist/index.d.ts +10 -10
- package/dist/index.js +175 -189
- package/dist/index.js.map +1 -1
- package/dist/layers/index.d.ts +2 -2
- package/dist/layers/index.js +1 -1
- package/dist/loupe/index.d.ts +1 -1
- package/dist/overview/index.d.ts +1 -1
- package/dist/passthrough/weasel-ui.js +1 -1
- package/dist/primitives/index.js +3 -3
- package/dist/state/index.d.ts +4 -4
- package/dist/state/index.js +3 -3
- package/dist/styles.css +9 -7
- package/dist/undo/index.d.ts +2 -2
- package/package.json +11 -11
- package/src/config/builder.ts +11 -1
- package/src/config/types.ts +5 -1
- package/src/controls/ControlMatrix.test.tsx +10 -0
- package/src/controls/ControlMatrix.tsx +58 -8
- package/src/controls/ControlPanel.test.tsx +30 -0
- package/src/theme/interstellar.theme.json +0 -14
- package/dist/chunk-4TJ34FXA.js.map +0 -1
- package/dist/chunk-HBGH344L.js.map +0 -1
- package/dist/chunk-IRMPZIYU.js +0 -15583
- package/dist/chunk-IRMPZIYU.js.map +0 -1
- package/dist/chunk-XSJJTXNA.js.map +0 -1
- package/dist/chunk-YCFKW5RX.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -9,29 +9,29 @@ 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-YDE6XATS.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-YDE6XATS.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-NVKBL7ZE.js';
|
|
17
|
+
export { JobProgress, Legend, Readout, Split } from './chunk-NVKBL7ZE.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-3L4MLLQB.js';
|
|
21
|
+
export { FpsMeter, ScaleIndicator, StatusBar, Toolbar, ZoomControl } from './chunk-3L4MLLQB.js';
|
|
22
22
|
import './chunk-CZZPXUOU.js';
|
|
23
|
-
import { unruledConfigSchema, createLabStore, openLabStore, panelKey } from './chunk-
|
|
24
|
-
export { CURRENT_DOCUMENT_VERSION, dockPanel, labDocumentKey, openLabStore, panelKey, quarantineKey, undockPanel, useTrialState } from './chunk-
|
|
23
|
+
import { unruledConfigSchema, createLabStore, openLabStore, panelKey } from './chunk-XXACAPVU.js';
|
|
24
|
+
export { CURRENT_DOCUMENT_VERSION, dockPanel, labDocumentKey, openLabStore, panelKey, quarantineKey, undockPanel, useTrialState } from './chunk-XXACAPVU.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 { ControlMatrix } from './chunk-
|
|
28
|
-
export { ControlPanel, inDialog, summarizeValue } from './chunk-
|
|
29
|
-
import { useConfigSchema } from './chunk-
|
|
30
|
-
export { sectionTree, useConfigSchema } from './chunk-
|
|
27
|
+
export { ControlMatrix } from './chunk-YX75W6EK.js';
|
|
28
|
+
export { ControlPanel, inDialog, summarizeValue } from './chunk-7KAETQSS.js';
|
|
29
|
+
import { useConfigSchema } from './chunk-MOTDMMMN.js';
|
|
30
|
+
export { sectionTree, useConfigSchema } from './chunk-MOTDMMMN.js';
|
|
31
31
|
import { useLabContext, LabContext } from './chunk-Z76KEZAX.js';
|
|
32
32
|
export { LabContext, useLabContext } from './chunk-Z76KEZAX.js';
|
|
33
|
-
import { useResolvedConfig } from './chunk-
|
|
34
|
-
export { BaseNode, BooleanNode, ColorNode, CustomNode, EnumNode, GroupNode, ListNode, NumberNode, StringNode, ValueNode, applyRules, builtinRules, f, isConfigBranch, resolveConfigSchema, titleCase, useResolvedConfig } from './chunk-
|
|
33
|
+
import { useResolvedConfig } from './chunk-J5HJJDLF.js';
|
|
34
|
+
export { BaseNode, BooleanNode, ColorNode, CustomNode, EnumNode, GroupNode, ListNode, NumberNode, StringNode, ValueNode, applyRules, builtinRules, f, isConfigBranch, resolveConfigSchema, titleCase, useResolvedConfig } from './chunk-J5HJJDLF.js';
|
|
35
35
|
export { fromConfigFields, isLeafVisible } from './chunk-WLMDTI2Q.js';
|
|
36
36
|
import { hasConfigPath, schemaNodeAtPath, applyConfigWrite, resolveAutoConfig, isAuto, isRecord, autoPathsOf, fillConfigDefaults } from './chunk-READTDQX.js';
|
|
37
37
|
export { auto, autoPathsOf, fillConfigDefaults, hasConfigPath, isAuto, resolveAutoConfig, schemaNodeAtPath, valueAtPath, withValueAtPath } from './chunk-READTDQX.js';
|
|
@@ -50,8 +50,8 @@ export { CanvasStackContext } from './chunk-ZQIHJXP4.js';
|
|
|
50
50
|
import { LabStoreContext, TrialIdProvider, TrialIdContext } from './chunk-2YILQ7Y5.js';
|
|
51
51
|
export { LabStoreContext, LabStoreProvider, TrialIdContext, TrialIdProvider, useLabStore, useTrialId } from './chunk-2YILQ7Y5.js';
|
|
52
52
|
import './chunk-2RVCB2PT.js';
|
|
53
|
-
import { D2,
|
|
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,
|
|
53
|
+
import { D2, S, X, U, G, p6, o3, c, Xt, c4, a5, l5, u3, s3, r3, a7, i3, o5, s5, c5, l8, p, f2, u2, y, O2, b4, l9, w2, c6, i4, h2, j, k2, ce, le, ye, b3, j2, n6, a8, C3, l3, u, v3, d3, j3, r4, n7, r5, i5, p2, f, n8, o4, p4, l7, w, L, n9, j4, xe2, n2 } from './chunk-WURZTJGQ.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, l10 as Jog, D2 as LayerList, re as PauseIcon, ne as PlayIcon, be as PropertyControl, ye as PropertyField, b3 as PropertyGroup, le as PropertyList, ce as PropertyPanel, L2 as PropertyRow, ue as PropertySpan, B as ResetIcon, O2 as Select, ae as StepBackIcon, $ as StepForwardIcon, ie as StopIcon, x2 as Subpanel, s3 as ToggleBar, oe as TokenPanel, H2 as inferTokenType, S as moveLayers, O3 as refitScale } from './chunk-WURZTJGQ.js';
|
|
55
55
|
import { serializeSvg } from './chunk-E23Q6A3Y.js';
|
|
56
56
|
import './chunk-XVUKDSYV.js';
|
|
57
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';
|
|
@@ -92,7 +92,7 @@ function createMarkDrawOne(opts) {
|
|
|
92
92
|
}
|
|
93
93
|
function resolveMarkStyle(data, opts) {
|
|
94
94
|
return {
|
|
95
|
-
color: opts.meaning?.statuses?.find((
|
|
95
|
+
color: opts.meaning?.statuses?.find((s4) => s4.id === data.status)?.color,
|
|
96
96
|
// Read off the node rather than through the store's `isStale`, which
|
|
97
97
|
// wants a projected Annotation this path does not have.
|
|
98
98
|
stale: isStale(data.seen, opts.config, opts.positionDependsOn ?? [])
|
|
@@ -105,7 +105,7 @@ function capturePlan(base, format) {
|
|
|
105
105
|
if (format === "svg") return "svg-document";
|
|
106
106
|
return base?.kind === "svg" ? "svg-document" : "raster-stack";
|
|
107
107
|
}
|
|
108
|
-
function nestBaseSvg(markup,
|
|
108
|
+
function nestBaseSvg(markup, w3, h2) {
|
|
109
109
|
const doc = new DOMParser().parseFromString(markup, "image/svg+xml");
|
|
110
110
|
const root = doc.documentElement;
|
|
111
111
|
if (doc.getElementsByTagName("parsererror").length > 0 || root.localName !== "svg") {
|
|
@@ -113,17 +113,17 @@ function nestBaseSvg(markup, w2, h2) {
|
|
|
113
113
|
}
|
|
114
114
|
root.setAttribute("x", "0");
|
|
115
115
|
root.setAttribute("y", "0");
|
|
116
|
-
root.setAttribute("width", String(
|
|
116
|
+
root.setAttribute("width", String(w3));
|
|
117
117
|
root.setAttribute("height", String(h2));
|
|
118
118
|
return new XMLSerializer().serializeToString(root);
|
|
119
119
|
}
|
|
120
|
-
function embedRasterBase(base,
|
|
120
|
+
function embedRasterBase(base, w3, h2, onWarn) {
|
|
121
121
|
const href = base.kind === "canvas" ? base.canvas.toDataURL() : base.kind === "image" ? base.src : "";
|
|
122
122
|
if (base.kind === "image" && !href.startsWith("data:")) {
|
|
123
123
|
onWarn?.(`base image '${href}' is a reference, so this SVG is not self-contained`);
|
|
124
124
|
}
|
|
125
|
-
return serializeSvg([{ kind: "image", href, x: 0, y: 0, width:
|
|
126
|
-
viewBox: { x: 0, y: 0, width:
|
|
125
|
+
return serializeSvg([{ kind: "image", href, x: 0, y: 0, width: w3, height: h2 }], {
|
|
126
|
+
viewBox: { x: 0, y: 0, width: w3, height: h2 }
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
129
|
function markNodesOf(scene, draw, scale) {
|
|
@@ -139,15 +139,15 @@ function markNodesOf(scene, draw, scale) {
|
|
|
139
139
|
}
|
|
140
140
|
function composeCaptureSvg(args) {
|
|
141
141
|
const { base, scene, draw, scale, onWarn } = args;
|
|
142
|
-
const { w:
|
|
143
|
-
const baseXml = base === void 0 ? "" : base.kind === "svg" ? nestBaseSvg(base.markup,
|
|
142
|
+
const { w: w3, h: h2 } = draw.content;
|
|
143
|
+
const baseXml = base === void 0 ? "" : base.kind === "svg" ? nestBaseSvg(base.markup, w3, h2) : embedRasterBase(base, w3, h2, onWarn);
|
|
144
144
|
const marksXml = serializeSvg(markNodesOf(scene, draw, scale), {
|
|
145
|
-
viewBox: { x: 0, y: 0, width:
|
|
145
|
+
viewBox: { x: 0, y: 0, width: w3, height: h2 },
|
|
146
146
|
onWarn
|
|
147
147
|
});
|
|
148
|
-
const outW = Math.max(1, Math.round(
|
|
148
|
+
const outW = Math.max(1, Math.round(w3 * scale));
|
|
149
149
|
const outH = Math.max(1, Math.round(h2 * scale));
|
|
150
|
-
return `<svg xmlns="${SVG_NS}" width="${outW}" height="${outH}" viewBox="0 0 ${
|
|
150
|
+
return `<svg xmlns="${SVG_NS}" width="${outW}" height="${outH}" viewBox="0 0 ${w3} ${h2}">${baseXml}${marksXml}</svg>`;
|
|
151
151
|
}
|
|
152
152
|
function context2d(width, height) {
|
|
153
153
|
const canvas = document.createElement("canvas");
|
|
@@ -283,13 +283,13 @@ var MarkHistory = class {
|
|
|
283
283
|
return null;
|
|
284
284
|
}
|
|
285
285
|
canUndo(at) {
|
|
286
|
-
return this.next(this.undoable, (
|
|
286
|
+
return this.next(this.undoable, (s4) => s4.canUndo(), at) !== null;
|
|
287
287
|
}
|
|
288
288
|
canRedo(at) {
|
|
289
|
-
return this.next(this.redoable, (
|
|
289
|
+
return this.next(this.redoable, (s4) => s4.canRedo(), at) !== null;
|
|
290
290
|
}
|
|
291
291
|
undo(at) {
|
|
292
|
-
const target = this.next(this.undoable, (
|
|
292
|
+
const target = this.next(this.undoable, (s4) => s4.canUndo(), at);
|
|
293
293
|
const scene = target === null ? void 0 : at(target);
|
|
294
294
|
if (!scene) return false;
|
|
295
295
|
this.replaying = "undo";
|
|
@@ -300,7 +300,7 @@ var MarkHistory = class {
|
|
|
300
300
|
}
|
|
301
301
|
}
|
|
302
302
|
redo(at) {
|
|
303
|
-
const target = this.next(this.redoable, (
|
|
303
|
+
const target = this.next(this.redoable, (s4) => s4.canRedo(), at);
|
|
304
304
|
const scene = target === null ? void 0 : at(target);
|
|
305
305
|
if (!scene) return false;
|
|
306
306
|
this.replaying = "redo";
|
|
@@ -429,21 +429,21 @@ function createAnnotationStore(opts) {
|
|
|
429
429
|
if (!scene) return [];
|
|
430
430
|
const out = [];
|
|
431
431
|
for (const id of scene.renderOrder()) {
|
|
432
|
-
const
|
|
433
|
-
if (
|
|
432
|
+
const a4 = project(target, String(id));
|
|
433
|
+
if (a4) out.push(a4);
|
|
434
434
|
}
|
|
435
435
|
return out;
|
|
436
436
|
};
|
|
437
437
|
const all = () => liveTargets().flatMap(marksOn);
|
|
438
|
-
const matches = (
|
|
439
|
-
if (q.target !== void 0 &&
|
|
440
|
-
if (q.kind !== void 0 &&
|
|
441
|
-
if (q.status !== void 0 &&
|
|
438
|
+
const matches = (a4, q) => {
|
|
439
|
+
if (q.target !== void 0 && a4.target !== q.target) return false;
|
|
440
|
+
if (q.kind !== void 0 && a4.kind !== q.kind) return false;
|
|
441
|
+
if (q.status !== void 0 && a4.status !== q.status) return false;
|
|
442
442
|
if (q.tags !== void 0) {
|
|
443
|
-
const have =
|
|
443
|
+
const have = a4.tags ?? [];
|
|
444
444
|
for (const t of q.tags) if (!have.includes(t)) return false;
|
|
445
445
|
}
|
|
446
|
-
if (q.where && !q.where(
|
|
446
|
+
if (q.where && !q.where(a4)) return false;
|
|
447
447
|
return true;
|
|
448
448
|
};
|
|
449
449
|
const nodeOf = (id) => {
|
|
@@ -461,17 +461,17 @@ function createAnnotationStore(opts) {
|
|
|
461
461
|
return parts ? project(parts.target, parts.node) : void 0;
|
|
462
462
|
},
|
|
463
463
|
query(q) {
|
|
464
|
-
return q ? all().filter((
|
|
464
|
+
return q ? all().filter((a4) => matches(a4, q)) : all();
|
|
465
465
|
},
|
|
466
466
|
hitTest(target, pt, tol = 0) {
|
|
467
|
-
return marksOn(target).filter((
|
|
467
|
+
return marksOn(target).filter((a4) => fracContains(a4.frac, pt, tol)).reverse();
|
|
468
468
|
},
|
|
469
469
|
within(target, box) {
|
|
470
|
-
return marksOn(target).filter((
|
|
470
|
+
return marksOn(target).filter((a4) => fracEncloses(box, a4.frac));
|
|
471
471
|
},
|
|
472
|
-
isStale(
|
|
473
|
-
const keys = targetOf(
|
|
474
|
-
return isStale(
|
|
472
|
+
isStale(a4, config) {
|
|
473
|
+
const keys = targetOf(a4.target)?.positionDependsOn ?? [];
|
|
474
|
+
return isStale(a4.seen, config, keys);
|
|
475
475
|
},
|
|
476
476
|
canUndo() {
|
|
477
477
|
return history.canUndo(historySceneAt);
|
|
@@ -624,7 +624,7 @@ function fitView(content, pane) {
|
|
|
624
624
|
const zoom = content.w > 0 && content.h > 0 ? Math.min(pane.w / content.w, pane.h / content.h) : 1;
|
|
625
625
|
return { zoom: Number.isFinite(zoom) && zoom > 0 ? zoom : 1, pan: { x: 0, y: 0 } };
|
|
626
626
|
}
|
|
627
|
-
var sameRect = (
|
|
627
|
+
var sameRect = (a4, b3) => a4 !== null && a4.x === b3.x && a4.y === b3.y && a4.w === b3.w && a4.h === b3.h;
|
|
628
628
|
function ToolBridge({ toolId }) {
|
|
629
629
|
const tools = useActiveToolContext();
|
|
630
630
|
const setActive = tools.setActive;
|
|
@@ -938,20 +938,6 @@ var interstellar_theme_default = {
|
|
|
938
938
|
type: "color"
|
|
939
939
|
}
|
|
940
940
|
},
|
|
941
|
-
"fg-muted": {
|
|
942
|
-
by: "mode",
|
|
943
|
-
dark: {
|
|
944
|
-
value: "#a8a8c0",
|
|
945
|
-
type: "color"
|
|
946
|
-
}
|
|
947
|
-
},
|
|
948
|
-
"fg-subtle": {
|
|
949
|
-
by: "mode",
|
|
950
|
-
dark: {
|
|
951
|
-
value: "#5a5a78",
|
|
952
|
-
type: "color"
|
|
953
|
-
}
|
|
954
|
-
},
|
|
955
941
|
accent: {
|
|
956
942
|
by: "mode",
|
|
957
943
|
dark: {
|
|
@@ -1123,7 +1109,7 @@ function Portalled({
|
|
|
1123
1109
|
}
|
|
1124
1110
|
function UndockedSections({ trialId, sections, onDock }) {
|
|
1125
1111
|
if (sections.length === 0) return null;
|
|
1126
|
-
return /* @__PURE__ */ jsx(Fragment, { children: sections.map((
|
|
1112
|
+
return /* @__PURE__ */ jsx(Fragment, { children: sections.map((c6) => /* @__PURE__ */ jsx(Portalled, { trialId, contribution: c6, onDock }, c6.id)) });
|
|
1127
1113
|
}
|
|
1128
1114
|
var NO_OP = () => {
|
|
1129
1115
|
};
|
|
@@ -1147,17 +1133,17 @@ function TrialChrome({
|
|
|
1147
1133
|
const lab = useLabContext();
|
|
1148
1134
|
const storeCtx = useContext(LabStoreContext);
|
|
1149
1135
|
if (!storeCtx) throw new Error("[labkit] TrialChrome requires <LabStoreProvider>");
|
|
1150
|
-
const updateTrialView = useStore(storeCtx.store, (
|
|
1151
|
-
const updateTrialSidebarWidth = useStore(storeCtx.store, (
|
|
1152
|
-
const setTrialTitle = useStore(storeCtx.store, (
|
|
1153
|
-
const setTrialSectionCollapsed = useStore(storeCtx.store, (
|
|
1154
|
-
const updateTrialConfig = useStore(storeCtx.store, (
|
|
1155
|
-
const updateTrialState = useStore(storeCtx.store, (
|
|
1156
|
-
const undockPanelAction = useStore(storeCtx.store, (
|
|
1157
|
-
const dockPanelAction = useStore(storeCtx.store, (
|
|
1158
|
-
const undockedPanels = useStore(storeCtx.store, (
|
|
1136
|
+
const updateTrialView = useStore(storeCtx.store, (s4) => s4.updateTrialView);
|
|
1137
|
+
const updateTrialSidebarWidth = useStore(storeCtx.store, (s4) => s4.updateTrialSidebarWidth);
|
|
1138
|
+
const setTrialTitle = useStore(storeCtx.store, (s4) => s4.setTrialTitle);
|
|
1139
|
+
const setTrialSectionCollapsed = useStore(storeCtx.store, (s4) => s4.setTrialSectionCollapsed);
|
|
1140
|
+
const updateTrialConfig = useStore(storeCtx.store, (s4) => s4.updateTrialConfig);
|
|
1141
|
+
const updateTrialState = useStore(storeCtx.store, (s4) => s4.updateTrialState);
|
|
1142
|
+
const undockPanelAction = useStore(storeCtx.store, (s4) => s4.undockPanel);
|
|
1143
|
+
const dockPanelAction = useStore(storeCtx.store, (s4) => s4.dockPanel);
|
|
1144
|
+
const undockedPanels = useStore(storeCtx.store, (s4) => s4.undockedPanels);
|
|
1159
1145
|
const undockedIds = useMemo(
|
|
1160
|
-
() => Object.values(undockedPanels).filter((
|
|
1146
|
+
() => Object.values(undockedPanels).filter((p5) => p5.trialId === trialId).map((p5) => p5.sectionId),
|
|
1161
1147
|
[undockedPanels, trialId]
|
|
1162
1148
|
);
|
|
1163
1149
|
const view2d = as2DView(record.view);
|
|
@@ -1218,7 +1204,7 @@ function TrialChrome({
|
|
|
1218
1204
|
undockedPanels: undockedIds,
|
|
1219
1205
|
undockPanel: (sectionId, as) => undockPanelAction(trialId, sectionId, as),
|
|
1220
1206
|
dockPanel: (sectionId) => dockPanelAction(trialId, sectionId),
|
|
1221
|
-
savedSnapshots: lab.savedSnapshots.filter((
|
|
1207
|
+
savedSnapshots: lab.savedSnapshots.filter((s4) => s4.trialId === trialId),
|
|
1222
1208
|
saveSnapshot: (name) => lab.saveSnapshot(trialId, name),
|
|
1223
1209
|
loadSnapshot: (snapshotId) => lab.loadSnapshot(trialId, snapshotId),
|
|
1224
1210
|
clone: () => lab.cloneTrial(trialId),
|
|
@@ -1266,7 +1252,7 @@ function TrialChrome({
|
|
|
1266
1252
|
),
|
|
1267
1253
|
[instrument, ctx, trialChrome, chrome, suppress, lab.controls]
|
|
1268
1254
|
);
|
|
1269
|
-
const inRegion = (region) => contributions.filter((
|
|
1255
|
+
const inRegion = (region) => contributions.filter((c6) => c6.region === region);
|
|
1270
1256
|
const handleKeyDown = (e) => {
|
|
1271
1257
|
const mod = e.metaKey || e.ctrlKey;
|
|
1272
1258
|
if (!mod) return;
|
|
@@ -1304,7 +1290,7 @@ function TrialChrome({
|
|
|
1304
1290
|
TrialBody,
|
|
1305
1291
|
{
|
|
1306
1292
|
width: record.sidebarWidth,
|
|
1307
|
-
onWidthChange: (
|
|
1293
|
+
onWidthChange: (w3) => updateTrialSidebarWidth(trialId, w3),
|
|
1308
1294
|
contentClassName: instrument.canvas || instrument.stage ? "lk-trial__content--flush" : void 0,
|
|
1309
1295
|
sidebar: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1310
1296
|
/* @__PURE__ */ jsx(SidebarRegion, { contributions: inRegion("sidebar"), ctx }),
|
|
@@ -1312,7 +1298,7 @@ function TrialChrome({
|
|
|
1312
1298
|
UndockedSections,
|
|
1313
1299
|
{
|
|
1314
1300
|
trialId,
|
|
1315
|
-
sections: inRegion("sidebar").filter((
|
|
1301
|
+
sections: inRegion("sidebar").filter((c6) => undockedIds.includes(c6.id)),
|
|
1316
1302
|
onDock: ctx.dockPanel
|
|
1317
1303
|
}
|
|
1318
1304
|
)
|
|
@@ -1336,8 +1322,8 @@ function Trial({ id, chrome, suppress }) {
|
|
|
1336
1322
|
const lab = useLabContext();
|
|
1337
1323
|
const storeCtx = useContext(LabStoreContext);
|
|
1338
1324
|
if (!storeCtx) throw new Error("[labkit] <Trial> requires <LabStoreProvider>");
|
|
1339
|
-
const instruments = useStore(storeCtx.store, (
|
|
1340
|
-
const record = useStore(storeCtx.store, (
|
|
1325
|
+
const instruments = useStore(storeCtx.store, (s4) => s4.instruments) ?? lab.instruments;
|
|
1326
|
+
const record = useStore(storeCtx.store, (s4) => s4.trials.find((w3) => w3.id === id));
|
|
1341
1327
|
const instrument = record ? instruments.find((i4) => i4.name === record.instrumentName) : void 0;
|
|
1342
1328
|
const kept = useKeptMarks(instrument?.annotations?.storage, id);
|
|
1343
1329
|
if (!record) {
|
|
@@ -1410,14 +1396,14 @@ function TrialRuntime({
|
|
|
1410
1396
|
);
|
|
1411
1397
|
const [pointer] = useState(createPointerStore);
|
|
1412
1398
|
const canvasContainerRef = useRef(null);
|
|
1413
|
-
const updateTrialState = useStore(store, (
|
|
1414
|
-
const updateTrialConfig = useStore(store, (
|
|
1415
|
-
const updateTrialView = useStore(store, (
|
|
1416
|
-
const updateTrialUndoStack = useStore(store, (
|
|
1417
|
-
const updateTrialAnnotations = useStore(store, (
|
|
1418
|
-
const labToolId = useStore(store, (
|
|
1419
|
-
const setLabTool = useStore(store, (
|
|
1420
|
-
const setTrialTool = useStore(store, (
|
|
1399
|
+
const updateTrialState = useStore(store, (s4) => s4.updateTrialState);
|
|
1400
|
+
const updateTrialConfig = useStore(store, (s4) => s4.updateTrialConfig);
|
|
1401
|
+
const updateTrialView = useStore(store, (s4) => s4.updateTrialView);
|
|
1402
|
+
const updateTrialUndoStack = useStore(store, (s4) => s4.updateTrialUndoStack);
|
|
1403
|
+
const updateTrialAnnotations = useStore(store, (s4) => s4.updateTrialAnnotations);
|
|
1404
|
+
const labToolId = useStore(store, (s4) => s4.activeToolId);
|
|
1405
|
+
const setLabTool = useStore(store, (s4) => s4.setLabTool);
|
|
1406
|
+
const setTrialTool = useStore(store, (s4) => s4.setTrialTool);
|
|
1421
1407
|
const schema = useConfigSchema(instrument);
|
|
1422
1408
|
const { config } = useResolvedConfig(schema, record.config, record.auto);
|
|
1423
1409
|
const busRef = useRef(null);
|
|
@@ -1441,7 +1427,7 @@ function TrialRuntime({
|
|
|
1441
1427
|
const maxDepth = undoCap?.maxDepth ?? 50;
|
|
1442
1428
|
const snapshotIfNeeded = (event) => {
|
|
1443
1429
|
if (!undoCap || !undoEvents.has(event)) return;
|
|
1444
|
-
const current = store.getState().trials.find((
|
|
1430
|
+
const current = store.getState().trials.find((w3) => w3.id === record.id);
|
|
1445
1431
|
if (!current) return;
|
|
1446
1432
|
const snap = structuredClone(current.state);
|
|
1447
1433
|
updateTrialUndoStack(record.id, (prev) => pushSnapshot(prev, snap, maxDepth));
|
|
@@ -1609,7 +1595,7 @@ function TrialRuntime({
|
|
|
1609
1595
|
const canvasLayers = useMemo(() => {
|
|
1610
1596
|
if (!instrument.canvas) return [];
|
|
1611
1597
|
const baseLayers = instrument.canvas.layers;
|
|
1612
|
-
const ordered = layerOrder ? [...baseLayers].sort((
|
|
1598
|
+
const ordered = layerOrder ? [...baseLayers].sort((a4, b3) => layerOrder.indexOf(a4.id) - layerOrder.indexOf(b3.id)) : baseLayers;
|
|
1613
1599
|
return ordered.map((layer) => ({
|
|
1614
1600
|
id: layer.id,
|
|
1615
1601
|
visible: layerVisibility[layer.id] !== false,
|
|
@@ -1624,7 +1610,7 @@ function TrialRuntime({
|
|
|
1624
1610
|
return instrument.layers.ids.map((l8) => typeof l8 === "string" ? { id: l8, label: l8 } : l8);
|
|
1625
1611
|
}, [instrument.layers]);
|
|
1626
1612
|
const layerItems = useMemo(() => {
|
|
1627
|
-
const ordered = layerOrder ? [...layerDescriptors].sort((
|
|
1613
|
+
const ordered = layerOrder ? [...layerDescriptors].sort((a4, b3) => layerOrder.indexOf(a4.id) - layerOrder.indexOf(b3.id)) : layerDescriptors;
|
|
1628
1614
|
const pinnedLast = [
|
|
1629
1615
|
...ordered.filter((l8) => !l8.alwaysOn),
|
|
1630
1616
|
...ordered.filter((l8) => l8.alwaysOn)
|
|
@@ -1637,7 +1623,7 @@ function TrialRuntime({
|
|
|
1637
1623
|
}));
|
|
1638
1624
|
}, [layerDescriptors, layerOrder, layerVisibility]);
|
|
1639
1625
|
const dragDropResult = useDragDrop({
|
|
1640
|
-
capability: instrument.dragDrop ?? { palette: [], onDrop: (_p, _i,
|
|
1626
|
+
capability: instrument.dragDrop ?? { palette: [], onDrop: (_p, _i, s4) => s4 },
|
|
1641
1627
|
canvasContainerRef,
|
|
1642
1628
|
view: view2d ?? DEFAULT_VIEW,
|
|
1643
1629
|
worldSpec: instrument.canvas?.worldSpec,
|
|
@@ -1654,8 +1640,8 @@ function TrialRuntime({
|
|
|
1654
1640
|
});
|
|
1655
1641
|
const paletteItems = useMemo(() => {
|
|
1656
1642
|
if (!instrument.dragDrop) return [];
|
|
1657
|
-
const
|
|
1658
|
-
return typeof
|
|
1643
|
+
const p5 = instrument.dragDrop.palette;
|
|
1644
|
+
return typeof p5 === "function" ? p5(record.state, config) : p5;
|
|
1659
1645
|
}, [instrument.dragDrop, record.state, config]);
|
|
1660
1646
|
const layersWithFeedback = useMemo(() => {
|
|
1661
1647
|
if (!dragDropResult.drag?.feedback) return canvasLayers;
|
|
@@ -1727,7 +1713,7 @@ function TrialRuntime({
|
|
|
1727
1713
|
{
|
|
1728
1714
|
items: layerItems,
|
|
1729
1715
|
onReorder: (move) => {
|
|
1730
|
-
setLayerOrder(
|
|
1716
|
+
setLayerOrder(S(layerItems, move).map((l8) => l8.id));
|
|
1731
1717
|
bus.emit("layers.reorder");
|
|
1732
1718
|
},
|
|
1733
1719
|
onVisibilityChange: (lid, visible) => {
|
|
@@ -1850,7 +1836,7 @@ function addTrial(trials, instruments, instrumentName, options = {}) {
|
|
|
1850
1836
|
return [...trials, record];
|
|
1851
1837
|
}
|
|
1852
1838
|
function cloneTrial(trials, id) {
|
|
1853
|
-
const sourceIdx = trials.findIndex((
|
|
1839
|
+
const sourceIdx = trials.findIndex((w3) => w3.id === id);
|
|
1854
1840
|
const source = trials[sourceIdx];
|
|
1855
1841
|
if (!source) return trials;
|
|
1856
1842
|
const clone = {
|
|
@@ -1865,11 +1851,11 @@ function cloneTrial(trials, id) {
|
|
|
1865
1851
|
}
|
|
1866
1852
|
function closeTrial(trials, id) {
|
|
1867
1853
|
if (trials.length <= 1) return trials;
|
|
1868
|
-
const next = trials.filter((
|
|
1854
|
+
const next = trials.filter((w3) => w3.id !== id);
|
|
1869
1855
|
return next.length === trials.length ? trials : next;
|
|
1870
1856
|
}
|
|
1871
1857
|
function resetTrial(trials, id, instruments) {
|
|
1872
|
-
const idx = trials.findIndex((
|
|
1858
|
+
const idx = trials.findIndex((w3) => w3.id === id);
|
|
1873
1859
|
const current = trials[idx];
|
|
1874
1860
|
if (!current) return trials;
|
|
1875
1861
|
const instrument = findInstrument(instruments, current.instrumentName);
|
|
@@ -1887,7 +1873,7 @@ function resetTrial(trials, id, instruments) {
|
|
|
1887
1873
|
return [...trials.slice(0, idx), reset, ...trials.slice(idx + 1)];
|
|
1888
1874
|
}
|
|
1889
1875
|
function swapTrial(trials, instruments, id, instrumentName, options = {}) {
|
|
1890
|
-
const idx = trials.findIndex((
|
|
1876
|
+
const idx = trials.findIndex((w3) => w3.id === id);
|
|
1891
1877
|
const current = trials[idx];
|
|
1892
1878
|
if (!current) return trials;
|
|
1893
1879
|
const [record] = addTrial([], instruments, instrumentName, options);
|
|
@@ -1895,10 +1881,10 @@ function swapTrial(trials, instruments, id, instrumentName, options = {}) {
|
|
|
1895
1881
|
return [...trials.slice(0, idx), record, ...trials.slice(idx + 1)];
|
|
1896
1882
|
}
|
|
1897
1883
|
function reorderTrials(trials, ids) {
|
|
1898
|
-
const byId = new Map(trials.map((
|
|
1899
|
-
const named = ids.map((id) => byId.get(id)).filter((
|
|
1900
|
-
const seen = new Set(named.map((
|
|
1901
|
-
const rest = trials.filter((
|
|
1884
|
+
const byId = new Map(trials.map((w3) => [w3.id, w3]));
|
|
1885
|
+
const named = ids.map((id) => byId.get(id)).filter((w3) => w3 !== void 0);
|
|
1886
|
+
const seen = new Set(named.map((w3) => w3.id));
|
|
1887
|
+
const rest = trials.filter((w3) => !seen.has(w3.id));
|
|
1902
1888
|
return [...named, ...rest];
|
|
1903
1889
|
}
|
|
1904
1890
|
function findOvershoot(bound, items, tolerance = 1) {
|
|
@@ -1913,7 +1899,7 @@ function findOvershoot(bound, items, tolerance = 1) {
|
|
|
1913
1899
|
return worst;
|
|
1914
1900
|
}
|
|
1915
1901
|
function tagAndClasses(el) {
|
|
1916
|
-
return el.tagName.toLowerCase() + [...el.classList].map((
|
|
1902
|
+
return el.tagName.toLowerCase() + [...el.classList].map((c6) => `.${c6}`).join("");
|
|
1917
1903
|
}
|
|
1918
1904
|
function describeElement(el) {
|
|
1919
1905
|
if (el.classList.length > 0) return tagAndClasses(el);
|
|
@@ -1996,7 +1982,7 @@ function LabHeader({ addTrial: addTrial2 = true }) {
|
|
|
1996
1982
|
]
|
|
1997
1983
|
}
|
|
1998
1984
|
) : /* @__PURE__ */ jsx(
|
|
1999
|
-
|
|
1985
|
+
p6,
|
|
2000
1986
|
{
|
|
2001
1987
|
"aria-label": "Add trial",
|
|
2002
1988
|
label: "Add trial\u2026",
|
|
@@ -2012,7 +1998,7 @@ function LabThemeSwitcher() {
|
|
|
2012
1998
|
function LabPalette({ tools, contributions }) {
|
|
2013
1999
|
const ctx = useLabChromeContext();
|
|
2014
2000
|
const all = labContributions(tools, contributions);
|
|
2015
|
-
return /* @__PURE__ */ jsx(PaletteRegion, { contributions: all.filter((
|
|
2001
|
+
return /* @__PURE__ */ jsx(PaletteRegion, { contributions: all.filter((c6) => c6.region === "palette"), ctx });
|
|
2016
2002
|
}
|
|
2017
2003
|
function LabRoot({ children, mode = "auto", className }) {
|
|
2018
2004
|
const resolved = useResolvedColorMode(mode);
|
|
@@ -2031,13 +2017,13 @@ function locate(url) {
|
|
|
2031
2017
|
function currentPage(path, pages) {
|
|
2032
2018
|
const here = locate(path);
|
|
2033
2019
|
const onDoc = (doc) => here.doc.endsWith(doc);
|
|
2034
|
-
const routed = pages.findIndex((
|
|
2035
|
-
if (!
|
|
2036
|
-
const page = locate(
|
|
2020
|
+
const routed = pages.findIndex((p5) => {
|
|
2021
|
+
if (!p5.href.includes("#")) return false;
|
|
2022
|
+
const page = locate(p5.href);
|
|
2037
2023
|
return onDoc(page.doc) && (here.route === page.route || here.route.startsWith(`${page.route}/`));
|
|
2038
2024
|
});
|
|
2039
2025
|
if (routed >= 0) return routed;
|
|
2040
|
-
return pages.findIndex((
|
|
2026
|
+
return pages.findIndex((p5) => !p5.href.includes("#") && onDoc(locate(p5.href).doc));
|
|
2041
2027
|
}
|
|
2042
2028
|
function LabSwitcher({ title, pages, path, className }) {
|
|
2043
2029
|
const [open, setOpen] = useState(false);
|
|
@@ -2158,8 +2144,8 @@ function LabZoomControls() {
|
|
|
2158
2144
|
cameras?.subscribe ?? noSubscribe2,
|
|
2159
2145
|
() => cameras && focusedTrialId ? cameras.get(focusedTrialId) : null
|
|
2160
2146
|
);
|
|
2161
|
-
const zoom = useStore(storeCtx.store, (
|
|
2162
|
-
const record =
|
|
2147
|
+
const zoom = useStore(storeCtx.store, (s4) => {
|
|
2148
|
+
const record = s4.trials.find((t) => t.id === focusedTrialId);
|
|
2163
2149
|
return as2DView(record?.view)?.zoom ?? null;
|
|
2164
2150
|
});
|
|
2165
2151
|
const live = zoom !== null && camera !== null;
|
|
@@ -2253,11 +2239,11 @@ function createWorkspaceStore(grid) {
|
|
|
2253
2239
|
return store;
|
|
2254
2240
|
}
|
|
2255
2241
|
function extentOf(store, id) {
|
|
2256
|
-
const
|
|
2257
|
-
if (!
|
|
2242
|
+
const p5 = store.getNode(id)?.membership?.placement;
|
|
2243
|
+
if (!p5) return null;
|
|
2258
2244
|
const out = {};
|
|
2259
|
-
if (
|
|
2260
|
-
if (
|
|
2245
|
+
if (p5.size) out.size = p5.size;
|
|
2246
|
+
if (p5.span) out.span = p5.span;
|
|
2261
2247
|
return Object.keys(out).length > 0 ? out : null;
|
|
2262
2248
|
}
|
|
2263
2249
|
function PanelFrame({ panel, floating = false }) {
|
|
@@ -2278,11 +2264,11 @@ function Workspace({
|
|
|
2278
2264
|
viewport
|
|
2279
2265
|
}) {
|
|
2280
2266
|
const items = Children.toArray(children);
|
|
2281
|
-
const tilePanels = useMemo(() => (panels ?? []).filter((
|
|
2282
|
-
const floatPanels = useMemo(() => (panels ?? []).filter((
|
|
2267
|
+
const tilePanels = useMemo(() => (panels ?? []).filter((p5) => p5.as === "tile"), [panels]);
|
|
2268
|
+
const floatPanels = useMemo(() => (panels ?? []).filter((p5) => p5.as === "floating"), [panels]);
|
|
2283
2269
|
const idKey = JSON.stringify([
|
|
2284
2270
|
...items.map((_2, i4) => ids?.[i4] ?? `lk-ws-${i4}`),
|
|
2285
|
-
...tilePanels.map((
|
|
2271
|
+
...tilePanels.map((p5) => `lk-panel-${p5.key}`)
|
|
2286
2272
|
]);
|
|
2287
2273
|
const nodeIds = useMemo(() => JSON.parse(idKey).map(asNodeId), [idKey]);
|
|
2288
2274
|
const layoutRef = useLatest(layout);
|
|
@@ -2334,7 +2320,7 @@ function Workspace({
|
|
|
2334
2320
|
const chrome = useMemo(() => {
|
|
2335
2321
|
const byId = new Map(nodeIds.map((id, i4) => [id, items[i4]]));
|
|
2336
2322
|
const panelByNode = new Map(
|
|
2337
|
-
tilePanels.map((
|
|
2323
|
+
tilePanels.map((p5) => [`lk-panel-${p5.key}`, p5])
|
|
2338
2324
|
);
|
|
2339
2325
|
return {
|
|
2340
2326
|
[PANEL_KIND]: ({ node }) => {
|
|
@@ -2352,7 +2338,7 @@ function Workspace({
|
|
|
2352
2338
|
}
|
|
2353
2339
|
};
|
|
2354
2340
|
}, [nodeIds, items, reorderable, tilePanels]);
|
|
2355
|
-
const floatingLayer = floatPanels.length === 0 ? null : /* @__PURE__ */ jsx("div", { className: "lk-workspace__floating", children: floatPanels.map((
|
|
2341
|
+
const floatingLayer = floatPanels.length === 0 ? null : /* @__PURE__ */ jsx("div", { className: "lk-workspace__floating", children: floatPanels.map((p5) => /* @__PURE__ */ jsx(PanelFrame, { panel: p5, floating: true }, p5.key)) });
|
|
2356
2342
|
const grid = /* @__PURE__ */ jsx(
|
|
2357
2343
|
Container,
|
|
2358
2344
|
{
|
|
@@ -2449,9 +2435,9 @@ function buildNebula(list, theme, mode, density) {
|
|
|
2449
2435
|
const ctx = { theme, resolved: resolveTheme(theme, { mode, density }) };
|
|
2450
2436
|
const n6 = colorCount(list, ctx) ?? NEBULA_SLOTS.length;
|
|
2451
2437
|
const colors = Array.from({ length: n6 }, (_2, i4) => colorAt(list, i4, ctx));
|
|
2452
|
-
const blobs = colors.map((
|
|
2453
|
-
const
|
|
2454
|
-
return `radial-gradient(ellipse ${
|
|
2438
|
+
const blobs = colors.map((c6, i4) => {
|
|
2439
|
+
const p5 = NEBULA_SLOTS[i4 % NEBULA_SLOTS.length];
|
|
2440
|
+
return `radial-gradient(ellipse ${p5.sx} ${p5.sy} at ${p5.cx} ${p5.cy}, color-mix(in srgb, ${c6} 22%, transparent), transparent ${p5.stop})`;
|
|
2455
2441
|
});
|
|
2456
2442
|
blobs.push("radial-gradient(ellipse at center, #0a0a18 0%, #02020a 100%)");
|
|
2457
2443
|
return blobs.join(", ");
|
|
@@ -2471,7 +2457,7 @@ function LabPanes({
|
|
|
2471
2457
|
void 0,
|
|
2472
2458
|
{ scope: "lab" }
|
|
2473
2459
|
);
|
|
2474
|
-
const main = contributions.some((
|
|
2460
|
+
const main = contributions.some((c6) => c6.region === "aside") ? /* @__PURE__ */ jsx(
|
|
2475
2461
|
Split,
|
|
2476
2462
|
{
|
|
2477
2463
|
className: "lk-lab__panes",
|
|
@@ -2481,15 +2467,15 @@ function LabPanes({
|
|
|
2481
2467
|
label: "Lab aside",
|
|
2482
2468
|
defaultWidth: 320,
|
|
2483
2469
|
width: asideWidth,
|
|
2484
|
-
onWidthChange: (
|
|
2485
|
-
setAsideWidth(
|
|
2470
|
+
onWidthChange: (w3) => {
|
|
2471
|
+
setAsideWidth(w3);
|
|
2486
2472
|
surface?.invalidateRects();
|
|
2487
2473
|
},
|
|
2488
2474
|
sidebar: /* @__PURE__ */ jsx(LabAsideRegion, { contributions }),
|
|
2489
2475
|
children
|
|
2490
2476
|
}
|
|
2491
2477
|
) : children;
|
|
2492
|
-
if (!contributions.some((
|
|
2478
|
+
if (!contributions.some((c6) => c6.region === "sidebar")) return main;
|
|
2493
2479
|
return /* @__PURE__ */ jsx(
|
|
2494
2480
|
Split,
|
|
2495
2481
|
{
|
|
@@ -2499,8 +2485,8 @@ function LabPanes({
|
|
|
2499
2485
|
label: "Lab sidebar",
|
|
2500
2486
|
defaultWidth: 260,
|
|
2501
2487
|
width: sidebarWidth,
|
|
2502
|
-
onWidthChange: (
|
|
2503
|
-
setSidebarWidth(
|
|
2488
|
+
onWidthChange: (w3) => {
|
|
2489
|
+
setSidebarWidth(w3);
|
|
2504
2490
|
surface?.invalidateRects();
|
|
2505
2491
|
},
|
|
2506
2492
|
sidebar: /* @__PURE__ */ jsx(LabSidebarRegion, { contributions }),
|
|
@@ -2558,14 +2544,14 @@ function LabRuntime({
|
|
|
2558
2544
|
useLayoutEffect(() => {
|
|
2559
2545
|
store.getState().setInstruments(instruments);
|
|
2560
2546
|
}, [instruments, store]);
|
|
2561
|
-
const trials = useStore(store, (
|
|
2547
|
+
const trials = useStore(store, (s4) => s4.trials);
|
|
2562
2548
|
const [cameras] = useState(createCameraRegistry);
|
|
2563
2549
|
const [focusPick, setFocusPick] = useState(null);
|
|
2564
2550
|
const focusedTrialId = trials.some((t) => t.id === focusPick) ? focusPick : trials[0]?.id ?? null;
|
|
2565
|
-
const savedSnapshots = useStore(store, (
|
|
2566
|
-
const modeValue = useStore(store, (
|
|
2567
|
-
const layout = useStore(store, (
|
|
2568
|
-
const undockedPanels = useStore(store, (
|
|
2551
|
+
const savedSnapshots = useStore(store, (s4) => s4.savedSnapshots);
|
|
2552
|
+
const modeValue = useStore(store, (s4) => s4.mode);
|
|
2553
|
+
const layout = useStore(store, (s4) => s4.layout);
|
|
2554
|
+
const undockedPanels = useStore(store, (s4) => s4.undockedPanels);
|
|
2569
2555
|
const panelHostsRef = useRef(null);
|
|
2570
2556
|
if (panelHostsRef.current === null) panelHostsRef.current = createPanelHostRegistry();
|
|
2571
2557
|
const outerSurface = useSurfaceOptional();
|
|
@@ -2578,17 +2564,17 @@ function LabRuntime({
|
|
|
2578
2564
|
const bufferRef = useRef({ w: 0, h: 0 });
|
|
2579
2565
|
const surfaceRef = useRef(null);
|
|
2580
2566
|
const onFrame = useCallback((frame) => {
|
|
2581
|
-
const canvases = [ownUnderRef.current, ownOverRef.current].filter((
|
|
2567
|
+
const canvases = [ownUnderRef.current, ownOverRef.current].filter((c6) => c6 !== null);
|
|
2582
2568
|
if (canvases.length === 0) return;
|
|
2583
|
-
const
|
|
2569
|
+
const w3 = Math.round(frame.size.width * frame.dpr);
|
|
2584
2570
|
const h2 = Math.round(frame.size.height * frame.dpr);
|
|
2585
|
-
if (bufferRef.current.w !==
|
|
2586
|
-
bufferRef.current = { w:
|
|
2587
|
-
for (const
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2571
|
+
if (bufferRef.current.w !== w3 || bufferRef.current.h !== h2) {
|
|
2572
|
+
bufferRef.current = { w: w3, h: h2 };
|
|
2573
|
+
for (const c6 of canvases) {
|
|
2574
|
+
c6.width = w3;
|
|
2575
|
+
c6.height = h2;
|
|
2576
|
+
c6.style.width = `${frame.size.width}px`;
|
|
2577
|
+
c6.style.height = `${frame.size.height}px`;
|
|
2592
2578
|
}
|
|
2593
2579
|
surfaceRef.current?.invalidateAll();
|
|
2594
2580
|
return;
|
|
@@ -2654,8 +2640,8 @@ function LabRuntime({
|
|
|
2654
2640
|
() => labContributions([...annotationTools, ...tools ?? []], labChrome),
|
|
2655
2641
|
[annotationTools, tools, labChrome]
|
|
2656
2642
|
);
|
|
2657
|
-
const hasFooterChrome = labChromeAll.some((
|
|
2658
|
-
const hasPaneChrome = labChromeAll.some((
|
|
2643
|
+
const hasFooterChrome = labChromeAll.some((c6) => c6.region === "footer");
|
|
2644
|
+
const hasPaneChrome = labChromeAll.some((c6) => c6.region === "sidebar" || c6.region === "aside");
|
|
2659
2645
|
useEffect(() => {
|
|
2660
2646
|
if (mode && mode !== store.getState().mode) {
|
|
2661
2647
|
store.getState().setMode(mode);
|
|
@@ -2663,14 +2649,14 @@ function LabRuntime({
|
|
|
2663
2649
|
}, [mode, store]);
|
|
2664
2650
|
const contextValue = useMemo(() => {
|
|
2665
2651
|
const replaceTrials = (next) => {
|
|
2666
|
-
const currentById = new Map(store.getState().trials.map((
|
|
2667
|
-
const merged = next.map((
|
|
2652
|
+
const currentById = new Map(store.getState().trials.map((w3) => [w3.id, w3]));
|
|
2653
|
+
const merged = next.map((w3) => currentById.get(w3.id) ?? w3);
|
|
2668
2654
|
store.setState({ trials: merged });
|
|
2669
2655
|
};
|
|
2670
2656
|
const replaceAndFocusAdded = (next) => {
|
|
2671
|
-
const before = new Set(store.getState().trials.map((
|
|
2657
|
+
const before = new Set(store.getState().trials.map((w3) => w3.id));
|
|
2672
2658
|
replaceTrials(next);
|
|
2673
|
-
const added = next.find((
|
|
2659
|
+
const added = next.find((w3) => !before.has(w3.id));
|
|
2674
2660
|
if (added) setFocusPick(added.id);
|
|
2675
2661
|
};
|
|
2676
2662
|
return {
|
|
@@ -2695,7 +2681,7 @@ function LabRuntime({
|
|
|
2695
2681
|
const current = store.getState();
|
|
2696
2682
|
const next = swapTrial(current.trials, instruments, id, instrumentName, options);
|
|
2697
2683
|
if (next === current.trials) return;
|
|
2698
|
-
const record = next[current.trials.findIndex((
|
|
2684
|
+
const record = next[current.trials.findIndex((w3) => w3.id === id)];
|
|
2699
2685
|
const { [id]: extent, ...layoutRest } = current.layout;
|
|
2700
2686
|
if (extent) current.setLayout({ ...layoutRest, [record.id]: extent });
|
|
2701
2687
|
replaceTrials(next);
|
|
@@ -2705,17 +2691,17 @@ function LabRuntime({
|
|
|
2705
2691
|
focusTrial: (id) => setFocusPick(id),
|
|
2706
2692
|
resetTrial: (id) => {
|
|
2707
2693
|
const next = resetTrial(store.getState().trials, id, instruments);
|
|
2708
|
-
const record = next.find((
|
|
2694
|
+
const record = next.find((w3) => w3.id === id);
|
|
2709
2695
|
if (!record) return;
|
|
2710
|
-
store.setState((
|
|
2711
|
-
trials:
|
|
2712
|
-
(
|
|
2696
|
+
store.setState((s4) => ({
|
|
2697
|
+
trials: s4.trials.map(
|
|
2698
|
+
(w3) => w3.id === id ? { ...w3, config: record.config, state: record.state, view: record.view } : w3
|
|
2713
2699
|
)
|
|
2714
2700
|
}));
|
|
2715
2701
|
},
|
|
2716
2702
|
savedSnapshots,
|
|
2717
2703
|
saveSnapshot: (trialId, name) => {
|
|
2718
|
-
const taken = store.getState().savedSnapshots.filter((
|
|
2704
|
+
const taken = store.getState().savedSnapshots.filter((s4) => s4.trialId === trialId).length;
|
|
2719
2705
|
store.getState().saveSnapshot(trialId, name ?? `Snapshot ${taken + 1}`);
|
|
2720
2706
|
},
|
|
2721
2707
|
loadSnapshot: (trialId, snapshotId) => {
|
|
@@ -2753,13 +2739,13 @@ function LabRuntime({
|
|
|
2753
2739
|
Workspace,
|
|
2754
2740
|
{
|
|
2755
2741
|
panels: workspacePanels,
|
|
2756
|
-
ids: trials.map((
|
|
2742
|
+
ids: trials.map((w3) => w3.id),
|
|
2757
2743
|
resizable: true,
|
|
2758
2744
|
reorderable: true,
|
|
2759
2745
|
onReorder: (ids) => contextValue.reorderTrials(ids),
|
|
2760
2746
|
layout,
|
|
2761
2747
|
onLayoutChange: (next) => store.getState().setLayout(next),
|
|
2762
|
-
children: trials.map((
|
|
2748
|
+
children: trials.map((w3) => /* @__PURE__ */ jsx(Trial, { id: w3.id, chrome, suppress }, w3.id))
|
|
2763
2749
|
}
|
|
2764
2750
|
);
|
|
2765
2751
|
return /* @__PURE__ */ jsx(LabStoreContext.Provider, { value: { store }, children: /* @__PURE__ */ jsx(PersistenceContext.Provider, { value: opened.records, children: /* @__PURE__ */ jsx(AnnotationPreloadContext.Provider, { value: opened.marks, children: /* @__PURE__ */ jsx(LabContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(CameraRegistryContext.Provider, { value: cameras, children: /* @__PURE__ */ jsx(
|
|
@@ -2940,9 +2926,9 @@ function ButtonsAndToggles() {
|
|
|
2940
2926
|
/* @__PURE__ */ jsx(Xt, { status: "muted", children: "MUTED" })
|
|
2941
2927
|
] }) }),
|
|
2942
2928
|
/* @__PURE__ */ jsx(Cell, { label: "Checkbox, Switch", children: /* @__PURE__ */ jsxs("div", { className: "lk-specimen__row", children: [
|
|
2943
|
-
/* @__PURE__ */ jsx(
|
|
2944
|
-
/* @__PURE__ */ jsx(
|
|
2945
|
-
/* @__PURE__ */ jsx(
|
|
2929
|
+
/* @__PURE__ */ jsx(c4, { isSelected: snap, onChange: setSnap, children: "Snap to grid" }),
|
|
2930
|
+
/* @__PURE__ */ jsx(c4, { isIndeterminate: true, children: "Mixed" }),
|
|
2931
|
+
/* @__PURE__ */ jsx(a5, { isSelected: wifi, onChange: setWifi, children: "Wifi" })
|
|
2946
2932
|
] }) }),
|
|
2947
2933
|
/* @__PURE__ */ jsx(Cell, { label: "RadioGroup", children: /* @__PURE__ */ jsxs(l5, { label: "Snap mode", orientation: "horizontal", defaultValue: "grid", children: [
|
|
2948
2934
|
/* @__PURE__ */ jsx(u3, { value: "off", children: "Off" }),
|
|
@@ -2951,7 +2937,7 @@ function ButtonsAndToggles() {
|
|
|
2951
2937
|
] }) }),
|
|
2952
2938
|
/* @__PURE__ */ jsxs(Cell, { label: "ToggleBar", children: [
|
|
2953
2939
|
/* @__PURE__ */ jsx(
|
|
2954
|
-
|
|
2940
|
+
s3,
|
|
2955
2941
|
{
|
|
2956
2942
|
ariaLabel: "Align",
|
|
2957
2943
|
value: align,
|
|
@@ -2964,7 +2950,7 @@ function ButtonsAndToggles() {
|
|
|
2964
2950
|
}
|
|
2965
2951
|
),
|
|
2966
2952
|
/* @__PURE__ */ jsx(
|
|
2967
|
-
|
|
2953
|
+
s3,
|
|
2968
2954
|
{
|
|
2969
2955
|
ariaLabel: "Align, flat",
|
|
2970
2956
|
variant: "flat",
|
|
@@ -2990,7 +2976,7 @@ function ButtonsAndToggles() {
|
|
|
2990
2976
|
}
|
|
2991
2977
|
),
|
|
2992
2978
|
/* @__PURE__ */ jsx(
|
|
2993
|
-
|
|
2979
|
+
a7,
|
|
2994
2980
|
{
|
|
2995
2981
|
items: [
|
|
2996
2982
|
{ value: "undo", label: "Undo", onAction: () => {
|
|
@@ -3003,7 +2989,7 @@ function ButtonsAndToggles() {
|
|
|
3003
2989
|
] }) }),
|
|
3004
2990
|
/* @__PURE__ */ jsx(Cell, { label: "MenuButton, Disclosure", children: /* @__PURE__ */ jsxs("div", { className: "lk-specimen__row", children: [
|
|
3005
2991
|
/* @__PURE__ */ jsx(
|
|
3006
|
-
|
|
2992
|
+
p6,
|
|
3007
2993
|
{
|
|
3008
2994
|
label: "Add trial\u2026",
|
|
3009
2995
|
onAction: () => {
|
|
@@ -3017,14 +3003,14 @@ function ButtonsAndToggles() {
|
|
|
3017
3003
|
/* @__PURE__ */ jsx(i3, { open, onToggle: () => setOpen((o4) => !o4), label: "Shapes" })
|
|
3018
3004
|
] }) }),
|
|
3019
3005
|
/* @__PURE__ */ jsx(Cell, { label: "Tabs", children: /* @__PURE__ */ jsxs(o5, { children: [
|
|
3020
|
-
/* @__PURE__ */ jsxs(
|
|
3021
|
-
/* @__PURE__ */ jsx(
|
|
3022
|
-
/* @__PURE__ */ jsx(
|
|
3023
|
-
/* @__PURE__ */ jsx(
|
|
3006
|
+
/* @__PURE__ */ jsxs(s5, { "aria-label": "Sections", children: [
|
|
3007
|
+
/* @__PURE__ */ jsx(c5, { id: "props", children: "Props" }),
|
|
3008
|
+
/* @__PURE__ */ jsx(c5, { id: "events", children: "Events" }),
|
|
3009
|
+
/* @__PURE__ */ jsx(c5, { id: "snapshot", children: "Snapshot" })
|
|
3024
3010
|
] }),
|
|
3025
|
-
/* @__PURE__ */ jsx(
|
|
3026
|
-
/* @__PURE__ */ jsx(
|
|
3027
|
-
/* @__PURE__ */ jsx(
|
|
3011
|
+
/* @__PURE__ */ jsx(l8, { id: "props", children: "Props panel." }),
|
|
3012
|
+
/* @__PURE__ */ jsx(l8, { id: "events", children: "Events panel." }),
|
|
3013
|
+
/* @__PURE__ */ jsx(l8, { id: "snapshot", children: "Snapshot panel." })
|
|
3028
3014
|
] }) }),
|
|
3029
3015
|
/* @__PURE__ */ jsx(Cell, { label: "Keycaps", children: /* @__PURE__ */ jsxs("div", { className: "lk-specimen__row", children: [
|
|
3030
3016
|
/* @__PURE__ */ jsx(p, { keys: [{ label: "\u2318" }, { label: "\u21E7" }, { label: "K" }], separator: "+" }),
|
|
@@ -3089,9 +3075,9 @@ function FieldsAndPickers() {
|
|
|
3089
3075
|
)
|
|
3090
3076
|
] }),
|
|
3091
3077
|
/* @__PURE__ */ jsxs(Cell, { label: "RangeSlider, Slider", children: [
|
|
3092
|
-
/* @__PURE__ */ jsx(
|
|
3078
|
+
/* @__PURE__ */ jsx(l9, { label: "Range", defaultValue: [20, 80], minValue: 0, maxValue: 100 }),
|
|
3093
3079
|
/* @__PURE__ */ jsx(
|
|
3094
|
-
|
|
3080
|
+
l9,
|
|
3095
3081
|
{
|
|
3096
3082
|
label: "Opacity",
|
|
3097
3083
|
defaultValue: 75,
|
|
@@ -3101,7 +3087,7 @@ function FieldsAndPickers() {
|
|
|
3101
3087
|
}
|
|
3102
3088
|
),
|
|
3103
3089
|
/* @__PURE__ */ jsx(
|
|
3104
|
-
|
|
3090
|
+
w2,
|
|
3105
3091
|
{
|
|
3106
3092
|
ariaLabel: "Pair",
|
|
3107
3093
|
min: 0,
|
|
@@ -3116,7 +3102,7 @@ function FieldsAndPickers() {
|
|
|
3116
3102
|
] }),
|
|
3117
3103
|
/* @__PURE__ */ jsxs(Cell, { label: "DetentSlider, InlineRange", children: [
|
|
3118
3104
|
/* @__PURE__ */ jsx(
|
|
3119
|
-
|
|
3105
|
+
c6,
|
|
3120
3106
|
{
|
|
3121
3107
|
items: [0.25, 0.5, 1, 2, 4],
|
|
3122
3108
|
value: rate,
|
|
@@ -3171,9 +3157,9 @@ function PanelsAndRows() {
|
|
|
3171
3157
|
]);
|
|
3172
3158
|
const [panelCollapsed, setPanelCollapsed] = useState(false);
|
|
3173
3159
|
return /* @__PURE__ */ jsxs(Section, { title: "Panels & property rows", children: [
|
|
3174
|
-
/* @__PURE__ */ jsx(Cell, { label: "PropertyPanel", children: /* @__PURE__ */ jsx(
|
|
3160
|
+
/* @__PURE__ */ jsx(Cell, { label: "PropertyPanel", children: /* @__PURE__ */ jsx(ce, { title: "Shape", children: /* @__PURE__ */ jsxs(le, { children: [
|
|
3175
3161
|
/* @__PURE__ */ jsx(
|
|
3176
|
-
|
|
3162
|
+
ye,
|
|
3177
3163
|
{
|
|
3178
3164
|
kind: "number",
|
|
3179
3165
|
control: "slider",
|
|
@@ -3186,7 +3172,7 @@ function PanelsAndRows() {
|
|
|
3186
3172
|
}
|
|
3187
3173
|
),
|
|
3188
3174
|
/* @__PURE__ */ jsx(
|
|
3189
|
-
|
|
3175
|
+
ye,
|
|
3190
3176
|
{
|
|
3191
3177
|
kind: "number",
|
|
3192
3178
|
control: "slider",
|
|
@@ -3199,7 +3185,7 @@ function PanelsAndRows() {
|
|
|
3199
3185
|
}
|
|
3200
3186
|
),
|
|
3201
3187
|
/* @__PURE__ */ jsx(
|
|
3202
|
-
|
|
3188
|
+
ye,
|
|
3203
3189
|
{
|
|
3204
3190
|
kind: "color",
|
|
3205
3191
|
label: "Fill",
|
|
@@ -3209,9 +3195,9 @@ function PanelsAndRows() {
|
|
|
3209
3195
|
onAlphaChange: setAlpha
|
|
3210
3196
|
}
|
|
3211
3197
|
),
|
|
3212
|
-
/* @__PURE__ */ jsx(
|
|
3198
|
+
/* @__PURE__ */ jsx(ye, { kind: "color", label: "Stroke", value: stroke, onChange: setStroke }),
|
|
3213
3199
|
/* @__PURE__ */ jsx(
|
|
3214
|
-
|
|
3200
|
+
ye,
|
|
3215
3201
|
{
|
|
3216
3202
|
kind: "number",
|
|
3217
3203
|
label: "Count",
|
|
@@ -3223,7 +3209,7 @@ function PanelsAndRows() {
|
|
|
3223
3209
|
}
|
|
3224
3210
|
),
|
|
3225
3211
|
/* @__PURE__ */ jsx(
|
|
3226
|
-
|
|
3212
|
+
ye,
|
|
3227
3213
|
{
|
|
3228
3214
|
kind: "enum",
|
|
3229
3215
|
label: "Line cap",
|
|
@@ -3236,7 +3222,7 @@ function PanelsAndRows() {
|
|
|
3236
3222
|
}
|
|
3237
3223
|
),
|
|
3238
3224
|
/* @__PURE__ */ jsx(
|
|
3239
|
-
|
|
3225
|
+
ye,
|
|
3240
3226
|
{
|
|
3241
3227
|
kind: "enum",
|
|
3242
3228
|
control: "toggle",
|
|
@@ -3250,10 +3236,10 @@ function PanelsAndRows() {
|
|
|
3250
3236
|
]
|
|
3251
3237
|
}
|
|
3252
3238
|
),
|
|
3253
|
-
/* @__PURE__ */ jsx(
|
|
3254
|
-
/* @__PURE__ */ jsx(
|
|
3239
|
+
/* @__PURE__ */ jsx(ye, { kind: "string", label: "Label", value: label, onChange: setLabel }),
|
|
3240
|
+
/* @__PURE__ */ jsx(ye, { kind: "boolean", label: "Visible", value: visible, onChange: setVisible }),
|
|
3255
3241
|
/* @__PURE__ */ jsx(b3, { title: "Bevel", defaultCollapsed: true, children: /* @__PURE__ */ jsx(
|
|
3256
|
-
|
|
3242
|
+
ye,
|
|
3257
3243
|
{
|
|
3258
3244
|
kind: "number",
|
|
3259
3245
|
control: "slider",
|
|
@@ -3279,7 +3265,7 @@ function PanelsAndRows() {
|
|
|
3279
3265
|
D2,
|
|
3280
3266
|
{
|
|
3281
3267
|
items: layers,
|
|
3282
|
-
onReorder: (move) => setLayers(
|
|
3268
|
+
onReorder: (move) => setLayers(S(layers, move)),
|
|
3283
3269
|
renderBody: (item) => /* @__PURE__ */ jsxs("div", { children: [
|
|
3284
3270
|
"settings for ",
|
|
3285
3271
|
item.label
|
|
@@ -3287,7 +3273,7 @@ function PanelsAndRows() {
|
|
|
3287
3273
|
}
|
|
3288
3274
|
) }),
|
|
3289
3275
|
/* @__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(
|
|
3290
|
-
|
|
3276
|
+
a8,
|
|
3291
3277
|
{
|
|
3292
3278
|
title: "Selection",
|
|
3293
3279
|
collapsed: panelCollapsed,
|
|
@@ -3312,7 +3298,7 @@ function OverlaysAndFeedback() {
|
|
|
3312
3298
|
] }),
|
|
3313
3299
|
/* @__PURE__ */ jsx("button", { type: "button", ref: calloutAnchor, onClick: () => setCalloutOpen(true), children: "Callout" }),
|
|
3314
3300
|
/* @__PURE__ */ jsx(
|
|
3315
|
-
|
|
3301
|
+
v3,
|
|
3316
3302
|
{
|
|
3317
3303
|
triggerRef: calloutAnchor,
|
|
3318
3304
|
isOpen: calloutOpen,
|
|
@@ -3407,14 +3393,14 @@ function ToolChrome() {
|
|
|
3407
3393
|
},
|
|
3408
3394
|
id
|
|
3409
3395
|
)) }) }),
|
|
3410
|
-
/* @__PURE__ */ jsx(Cell, { label: "ToolOptionsBar", children: /* @__PURE__ */ jsxs(
|
|
3396
|
+
/* @__PURE__ */ jsx(Cell, { label: "ToolOptionsBar", children: /* @__PURE__ */ jsxs(p4, { label: "Text", children: [
|
|
3411
3397
|
/* @__PURE__ */ jsx(c, { size: "sm", variant: "ghost", iconOnly: true, ariaLabel: "Bold", children: "B" }),
|
|
3412
3398
|
/* @__PURE__ */ jsx(c, { size: "sm", variant: "ghost", iconOnly: true, ariaLabel: "Italic", children: "I" })
|
|
3413
3399
|
] }) }),
|
|
3414
3400
|
/* @__PURE__ */ jsx(Cell, { label: "ResizeHandle", children: /* @__PURE__ */ jsxs("div", { className: "lk-specimen__box", children: [
|
|
3415
3401
|
/* @__PURE__ */ jsx("div", { className: "lk-specimen__box-main", children: "content" }),
|
|
3416
3402
|
/* @__PURE__ */ jsx(
|
|
3417
|
-
|
|
3403
|
+
l7,
|
|
3418
3404
|
{
|
|
3419
3405
|
value: paneWidth,
|
|
3420
3406
|
min: 100,
|