@xenosystem/blocks 0.11.4 → 0.11.5
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/edit/index.d.ts +4 -3
- package/dist/edit/index.js +271 -499
- package/package.json +3 -3
package/dist/edit/index.js
CHANGED
|
@@ -1201,6 +1201,7 @@ var LayersPanelController = class {
|
|
|
1201
1201
|
|
|
1202
1202
|
// src/edit/layers/react/LayersPanelView.tsx
|
|
1203
1203
|
import { useCallback, useEffect as useEffect2, useRef as useRef2, useState, useSyncExternalStore } from "react";
|
|
1204
|
+
import { Badge, ChipToggle, ColorTag, Column, EmptyState, IconButton, Input, RowList, Row, ScrollArea, SearchField, StatusBar, Text, Toolbar, VirtualWindow } from "@xenosystem/components/chrome";
|
|
1204
1205
|
|
|
1205
1206
|
// src/edit/layers/react/icons.tsx
|
|
1206
1207
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1215,9 +1216,6 @@ var base = (size) => ({
|
|
|
1215
1216
|
strokeLinejoin: "round",
|
|
1216
1217
|
"aria-hidden": true
|
|
1217
1218
|
});
|
|
1218
|
-
function ChevronIcon({ size = 12, className }) {
|
|
1219
|
-
return /* @__PURE__ */ jsx("svg", { ...base(size), className, children: /* @__PURE__ */ jsx("path", { d: "m9 18 6-6-6-6" }) });
|
|
1220
|
-
}
|
|
1221
1219
|
function EyeIcon({ size = 12, className }) {
|
|
1222
1220
|
return /* @__PURE__ */ jsxs("svg", { ...base(size), className, children: [
|
|
1223
1221
|
/* @__PURE__ */ jsx("path", { d: "M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7Z" }),
|
|
@@ -1243,21 +1241,8 @@ function UnlockIcon({ size = 12, className }) {
|
|
|
1243
1241
|
/* @__PURE__ */ jsx("path", { d: "M8 11V7a4 4 0 0 1 7.5-2" })
|
|
1244
1242
|
] });
|
|
1245
1243
|
}
|
|
1246
|
-
function KindGlyph({ size =
|
|
1247
|
-
return /* @__PURE__ */ jsx(
|
|
1248
|
-
"span",
|
|
1249
|
-
{
|
|
1250
|
-
"aria-hidden": true,
|
|
1251
|
-
style: {
|
|
1252
|
-
width: size,
|
|
1253
|
-
height: size,
|
|
1254
|
-
borderRadius: 2,
|
|
1255
|
-
border: "1px solid currentColor",
|
|
1256
|
-
opacity: 0.5,
|
|
1257
|
-
flex: "0 0 auto"
|
|
1258
|
-
}
|
|
1259
|
-
}
|
|
1260
|
-
);
|
|
1244
|
+
function KindGlyph({ size = 10 }) {
|
|
1245
|
+
return /* @__PURE__ */ jsx("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ jsx("rect", { x: "4", y: "4", width: "16", height: "16", rx: "2" }) });
|
|
1261
1246
|
}
|
|
1262
1247
|
|
|
1263
1248
|
// src/edit/layers/react/Thumbnail.tsx
|
|
@@ -1317,7 +1302,7 @@ function Thumbnail({ size, data }) {
|
|
|
1317
1302
|
}
|
|
1318
1303
|
|
|
1319
1304
|
// src/edit/layers/react/LayersPanelView.tsx
|
|
1320
|
-
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
1305
|
+
import { Fragment, jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
1321
1306
|
var DRAG_THRESHOLD = 4;
|
|
1322
1307
|
function LayersPanelView({ controller }) {
|
|
1323
1308
|
const subscribe = useCallback((cb) => controller.subscribe(cb), [controller]);
|
|
@@ -1371,6 +1356,7 @@ function LayersPanelView({ controller }) {
|
|
|
1371
1356
|
const onRowPointerDown = useCallback(
|
|
1372
1357
|
(e, row) => {
|
|
1373
1358
|
if (e.button !== 0) return;
|
|
1359
|
+
if (e.target?.closest?.("button,input")) return;
|
|
1374
1360
|
pressRef.current = { id: row.id, x: e.clientX, y: e.clientY, dragging: false };
|
|
1375
1361
|
controller.selectNode(row.id, { ctrl: e.ctrlKey, meta: e.metaKey, shift: e.shiftKey });
|
|
1376
1362
|
e.currentTarget.setPointerCapture(e.pointerId);
|
|
@@ -1419,61 +1405,41 @@ function LayersPanelView({ controller }) {
|
|
|
1419
1405
|
},
|
|
1420
1406
|
[controller, renamingId]
|
|
1421
1407
|
);
|
|
1422
|
-
return /* @__PURE__ */ jsxs2(
|
|
1423
|
-
controller.isSearchShown()
|
|
1424
|
-
|
|
1425
|
-
{
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1408
|
+
return /* @__PURE__ */ jsxs2(Column, { className: "xeno-layers-panel", children: [
|
|
1409
|
+
controller.isSearchShown() ? /* @__PURE__ */ jsx3(Toolbar, { children: /* @__PURE__ */ jsx3(SearchField, { value: controller.getFilter(), onChange: (v) => controller.setFilter(v), placeholder: "Search layers", label: "Search layers" }) }) : null,
|
|
1410
|
+
/* @__PURE__ */ jsxs2(ScrollArea, { ref: scrollRef, onScroll, onKeyDown, tabIndex: 0, children: [
|
|
1411
|
+
/* @__PURE__ */ jsx3(RowList, { role: "tree", "aria-label": "Layers", children: /* @__PURE__ */ jsx3(VirtualWindow, { totalHeight: window_.totalHeight, offsetTop: window_.offsetTop, children: windowRows.map((row) => /* @__PURE__ */ jsx3(
|
|
1412
|
+
LayerRow,
|
|
1413
|
+
{
|
|
1414
|
+
row,
|
|
1415
|
+
controller,
|
|
1416
|
+
columns,
|
|
1417
|
+
rowHeight,
|
|
1418
|
+
selected: controller.isSelected(row.id),
|
|
1419
|
+
active: controller.getActiveId() === row.id,
|
|
1420
|
+
renaming: renamingId === row.id,
|
|
1421
|
+
renameDraft,
|
|
1422
|
+
onRenameDraft: setRenameDraft,
|
|
1423
|
+
dropHint: drag?.target && drag.target.targetId === row.id ? drag.target.position : null,
|
|
1424
|
+
onPointerDown: onRowPointerDown,
|
|
1425
|
+
onPointerMove: onRowPointerMove,
|
|
1426
|
+
onPointerUp: onRowPointerUp
|
|
1427
|
+
},
|
|
1428
|
+
row.id
|
|
1429
|
+
)) }) }),
|
|
1430
|
+
rows.length === 0 ? /* @__PURE__ */ jsx3(EmptyState, { title: "No layers" }) : null
|
|
1431
|
+
] }),
|
|
1432
|
+
/* @__PURE__ */ jsx3(
|
|
1433
|
+
StatusBar,
|
|
1437
1434
|
{
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
role: "
|
|
1444
|
-
"aria-label": "Layers",
|
|
1445
|
-
children: [
|
|
1446
|
-
/* @__PURE__ */ jsx3("div", { style: { height: window_.totalHeight, position: "relative" }, children: /* @__PURE__ */ jsx3("div", { style: { transform: `translateY(${window_.offsetTop}px)` }, children: windowRows.map((row) => /* @__PURE__ */ jsx3(
|
|
1447
|
-
LayerRow,
|
|
1448
|
-
{
|
|
1449
|
-
row,
|
|
1450
|
-
controller,
|
|
1451
|
-
columns,
|
|
1452
|
-
rowHeight,
|
|
1453
|
-
selected: controller.isSelected(row.id),
|
|
1454
|
-
active: controller.getActiveId() === row.id,
|
|
1455
|
-
renaming: renamingId === row.id,
|
|
1456
|
-
renameDraft,
|
|
1457
|
-
onRenameDraft: setRenameDraft,
|
|
1458
|
-
dropHint: drag?.target && drag.target.targetId === row.id ? drag.target.position : null,
|
|
1459
|
-
onPointerDown: onRowPointerDown,
|
|
1460
|
-
onPointerMove: onRowPointerMove,
|
|
1461
|
-
onPointerUp: onRowPointerUp
|
|
1462
|
-
},
|
|
1463
|
-
row.id
|
|
1464
|
-
)) }) }),
|
|
1465
|
-
rows.length === 0 && /* @__PURE__ */ jsx3("div", { style: S.empty, children: "No layers" })
|
|
1466
|
-
]
|
|
1435
|
+
left: /* @__PURE__ */ jsxs2(Text, { role: "number", children: [
|
|
1436
|
+
rows.length,
|
|
1437
|
+
" ",
|
|
1438
|
+
rows.length === 1 ? "layer" : "layers"
|
|
1439
|
+
] }),
|
|
1440
|
+
right: controller.getOrderLabel() ? /* @__PURE__ */ jsx3(Text, { role: "meta", children: controller.getOrderLabel() }) : null
|
|
1467
1441
|
}
|
|
1468
|
-
)
|
|
1469
|
-
/* @__PURE__ */ jsxs2("div", { style: S.footer, children: [
|
|
1470
|
-
/* @__PURE__ */ jsxs2("span", { children: [
|
|
1471
|
-
rows.length,
|
|
1472
|
-
" ",
|
|
1473
|
-
rows.length === 1 ? "layer" : "layers"
|
|
1474
|
-
] }),
|
|
1475
|
-
controller.getOrderLabel() && /* @__PURE__ */ jsx3("span", { style: S.dim, children: controller.getOrderLabel() })
|
|
1476
|
-
] })
|
|
1442
|
+
)
|
|
1477
1443
|
] });
|
|
1478
1444
|
}
|
|
1479
1445
|
function LayerRow(props) {
|
|
@@ -1481,25 +1447,49 @@ function LayerRow(props) {
|
|
|
1481
1447
|
const node = row.node;
|
|
1482
1448
|
const container = isContainer(node);
|
|
1483
1449
|
const thumb = controller.getThumbnail(node.thumbnailKey);
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
height: rowHeight,
|
|
1487
|
-
paddingLeft: 4 + row.depth * 10,
|
|
1488
|
-
background: selected ? "var(--xeno-border)" : "transparent",
|
|
1489
|
-
opacity: row.matched ? 1 : 0.45,
|
|
1490
|
-
boxShadow: active ? "inset 0 0 0 1px var(--xeno-control)" : void 0,
|
|
1491
|
-
borderTop: dropHint === "before" ? "1px solid var(--xeno-muted)" : "1px solid transparent",
|
|
1492
|
-
borderBottom: dropHint === "after" ? "1px solid var(--xeno-muted)" : "1px solid transparent",
|
|
1493
|
-
outline: dropHint === "into" ? "1px solid var(--xeno-active)" : void 0
|
|
1494
|
-
};
|
|
1495
|
-
return /* @__PURE__ */ jsxs2(
|
|
1496
|
-
"div",
|
|
1450
|
+
return /* @__PURE__ */ jsx3(
|
|
1451
|
+
Row,
|
|
1497
1452
|
{
|
|
1498
1453
|
"data-layer-row": row.id,
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1454
|
+
height: rowHeight,
|
|
1455
|
+
depth: row.depth,
|
|
1456
|
+
selected,
|
|
1457
|
+
active,
|
|
1458
|
+
dimmed: !row.matched,
|
|
1459
|
+
dropHint,
|
|
1460
|
+
expanded: container ? row.expanded : void 0,
|
|
1461
|
+
onExpandedChange: container ? () => controller.toggleExpanded(row.id) : void 0,
|
|
1462
|
+
icon: columns.includes("thumbnail") && node.thumbnailKey ? /* @__PURE__ */ jsx3(Thumbnail, { size: controller.getThumbnailSize(), data: thumb }) : /* @__PURE__ */ jsx3(KindGlyph, {}),
|
|
1463
|
+
leading: /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
1464
|
+
columns.includes("visibility") && node.visible !== void 0 ? /* @__PURE__ */ jsx3(IconButton, { size: "sm", icon: node.visible ? /* @__PURE__ */ jsx3(EyeIcon, {}) : /* @__PURE__ */ jsx3(EyeOffIcon, {}), label: node.visible ? "Hide layer" : "Show layer", active: node.visible, onClick: () => controller.toggleProp("visible", row.id) }) : null,
|
|
1465
|
+
columns.includes("lock") && node.locked !== void 0 ? /* @__PURE__ */ jsx3(IconButton, { size: "sm", icon: node.locked ? /* @__PURE__ */ jsx3(LockIcon, {}) : /* @__PURE__ */ jsx3(UnlockIcon, {}), label: node.locked ? "Unlock layer" : "Lock layer", active: node.locked, onClick: () => controller.toggleProp("locked", row.id) }) : null,
|
|
1466
|
+
columns.includes("solo") && node.solo !== void 0 ? /* @__PURE__ */ jsx3(ChipToggle, { glyph: "S", label: "Solo", on: !!node.solo, onChange: () => controller.toggleProp("solo", row.id) }) : null,
|
|
1467
|
+
columns.includes("mute") && node.muted !== void 0 ? /* @__PURE__ */ jsx3(ChipToggle, { glyph: "M", label: "Mute", on: !!node.muted, onChange: () => controller.toggleProp("muted", row.id) }) : null,
|
|
1468
|
+
columns.includes("arm") && node.armed !== void 0 ? /* @__PURE__ */ jsx3(ChipToggle, { glyph: "R", label: "Arm", on: !!node.armed, onChange: () => controller.toggleProp("armed", row.id) }) : null,
|
|
1469
|
+
columns.includes("colorLabel") && node.colorLabel !== void 0 ? /* @__PURE__ */ jsx3(ColorTag, { color: node.colorLabel }) : null
|
|
1470
|
+
] }),
|
|
1471
|
+
label: renaming ? /* @__PURE__ */ jsx3(
|
|
1472
|
+
Input,
|
|
1473
|
+
{
|
|
1474
|
+
autoFocus: true,
|
|
1475
|
+
value: props.renameDraft,
|
|
1476
|
+
onChange: (v) => props.onRenameDraft(v),
|
|
1477
|
+
onBlur: () => controller.commitRename(props.renameDraft),
|
|
1478
|
+
onKeyDown: (e) => {
|
|
1479
|
+
e.stopPropagation();
|
|
1480
|
+
if (e.key === "Enter") controller.commitRename(props.renameDraft);
|
|
1481
|
+
if (e.key === "Escape") controller.cancelRename();
|
|
1482
|
+
},
|
|
1483
|
+
label: "Layer name"
|
|
1484
|
+
}
|
|
1485
|
+
) : node.name,
|
|
1486
|
+
trailing: /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
1487
|
+
node.adornments?.map((a, i) => /* @__PURE__ */ jsx3(Badge, { size: "sm", title: a.tooltip, children: a.kind === "spinner" ? "\u2026" : a.label ?? "" }, a.id ?? `${a.kind}-${i}`)),
|
|
1488
|
+
columns.includes("opacity") && node.opacity !== void 0 ? /* @__PURE__ */ jsxs2(Text, { role: "number", children: [
|
|
1489
|
+
Math.round(node.opacity * 100),
|
|
1490
|
+
"%"
|
|
1491
|
+
] }) : null
|
|
1492
|
+
] }),
|
|
1503
1493
|
onPointerDown: (e) => props.onPointerDown(e, row),
|
|
1504
1494
|
onPointerMove: props.onPointerMove,
|
|
1505
1495
|
onPointerUp: props.onPointerUp,
|
|
@@ -1508,228 +1498,10 @@ function LayerRow(props) {
|
|
|
1508
1498
|
e.preventDefault();
|
|
1509
1499
|
controller.requestContextMenu(row.id, e.clientX, e.clientY);
|
|
1510
1500
|
},
|
|
1511
|
-
title: node.name
|
|
1512
|
-
children: [
|
|
1513
|
-
/* @__PURE__ */ jsx3("span", { style: S.twistyCell, children: container && /* @__PURE__ */ jsx3(
|
|
1514
|
-
"button",
|
|
1515
|
-
{
|
|
1516
|
-
type: "button",
|
|
1517
|
-
style: {
|
|
1518
|
-
...S.iconBtn,
|
|
1519
|
-
transform: row.expanded ? "rotate(90deg)" : "none"
|
|
1520
|
-
},
|
|
1521
|
-
onPointerDown: (e) => e.stopPropagation(),
|
|
1522
|
-
onClick: (e) => {
|
|
1523
|
-
e.stopPropagation();
|
|
1524
|
-
controller.toggleExpanded(row.id);
|
|
1525
|
-
},
|
|
1526
|
-
"aria-label": row.expanded ? "Collapse" : "Expand",
|
|
1527
|
-
children: /* @__PURE__ */ jsx3(ChevronIcon, {})
|
|
1528
|
-
}
|
|
1529
|
-
) }),
|
|
1530
|
-
columns.includes("visibility") && node.visible !== void 0 && /* @__PURE__ */ jsx3(
|
|
1531
|
-
"button",
|
|
1532
|
-
{
|
|
1533
|
-
type: "button",
|
|
1534
|
-
style: { ...S.iconBtn, opacity: node.visible ? 0.85 : 0.35 },
|
|
1535
|
-
onPointerDown: (e) => e.stopPropagation(),
|
|
1536
|
-
onClick: (e) => {
|
|
1537
|
-
e.stopPropagation();
|
|
1538
|
-
controller.toggleProp("visible", row.id);
|
|
1539
|
-
},
|
|
1540
|
-
"aria-label": node.visible ? "Hide layer" : "Show layer",
|
|
1541
|
-
children: node.visible ? /* @__PURE__ */ jsx3(EyeIcon, {}) : /* @__PURE__ */ jsx3(EyeOffIcon, {})
|
|
1542
|
-
}
|
|
1543
|
-
),
|
|
1544
|
-
columns.includes("lock") && node.locked !== void 0 && /* @__PURE__ */ jsx3(
|
|
1545
|
-
"button",
|
|
1546
|
-
{
|
|
1547
|
-
type: "button",
|
|
1548
|
-
style: { ...S.iconBtn, opacity: node.locked ? 0.85 : 0.3 },
|
|
1549
|
-
onPointerDown: (e) => e.stopPropagation(),
|
|
1550
|
-
onClick: (e) => {
|
|
1551
|
-
e.stopPropagation();
|
|
1552
|
-
controller.toggleProp("locked", row.id);
|
|
1553
|
-
},
|
|
1554
|
-
"aria-label": node.locked ? "Unlock layer" : "Lock layer",
|
|
1555
|
-
children: node.locked ? /* @__PURE__ */ jsx3(LockIcon, {}) : /* @__PURE__ */ jsx3(UnlockIcon, {})
|
|
1556
|
-
}
|
|
1557
|
-
),
|
|
1558
|
-
columns.includes("solo") && node.solo !== void 0 && /* @__PURE__ */ jsx3(ToggleChip, { label: "S", on: !!node.solo, onClick: () => controller.toggleProp("solo", row.id) }),
|
|
1559
|
-
columns.includes("mute") && node.muted !== void 0 && /* @__PURE__ */ jsx3(ToggleChip, { label: "M", on: !!node.muted, onClick: () => controller.toggleProp("muted", row.id) }),
|
|
1560
|
-
columns.includes("arm") && node.armed !== void 0 && /* @__PURE__ */ jsx3(ToggleChip, { label: "R", on: !!node.armed, onClick: () => controller.toggleProp("armed", row.id) }),
|
|
1561
|
-
columns.includes("colorLabel") && node.colorLabel !== void 0 && /* @__PURE__ */ jsx3(
|
|
1562
|
-
"span",
|
|
1563
|
-
{
|
|
1564
|
-
style: {
|
|
1565
|
-
...S.colorLabel,
|
|
1566
|
-
background: node.colorLabel || "transparent",
|
|
1567
|
-
border: node.colorLabel ? "none" : "1px solid var(--xeno-control)"
|
|
1568
|
-
},
|
|
1569
|
-
"aria-hidden": true
|
|
1570
|
-
}
|
|
1571
|
-
),
|
|
1572
|
-
columns.includes("thumbnail") && node.thumbnailKey && /* @__PURE__ */ jsx3(Thumbnail, { size: controller.getThumbnailSize(), data: thumb }),
|
|
1573
|
-
!node.thumbnailKey && /* @__PURE__ */ jsx3(KindGlyph, {}),
|
|
1574
|
-
renaming ? /* @__PURE__ */ jsx3(
|
|
1575
|
-
"input",
|
|
1576
|
-
{
|
|
1577
|
-
autoFocus: true,
|
|
1578
|
-
value: props.renameDraft,
|
|
1579
|
-
onChange: (e) => props.onRenameDraft(e.target.value),
|
|
1580
|
-
onPointerDown: (e) => e.stopPropagation(),
|
|
1581
|
-
onBlur: () => controller.commitRename(props.renameDraft),
|
|
1582
|
-
onKeyDown: (e) => {
|
|
1583
|
-
e.stopPropagation();
|
|
1584
|
-
if (e.key === "Enter") controller.commitRename(props.renameDraft);
|
|
1585
|
-
if (e.key === "Escape") controller.cancelRename();
|
|
1586
|
-
},
|
|
1587
|
-
style: S.renameInput,
|
|
1588
|
-
"aria-label": "Layer name"
|
|
1589
|
-
}
|
|
1590
|
-
) : /* @__PURE__ */ jsx3("span", { style: S.name, children: node.name }),
|
|
1591
|
-
node.adornments?.map((a, i) => /* @__PURE__ */ jsx3("span", { style: S.badge, title: a.tooltip, children: a.kind === "spinner" ? "\u2026" : a.label ?? "" }, a.id ?? `${a.kind}-${i}`)),
|
|
1592
|
-
columns.includes("opacity") && node.opacity !== void 0 && /* @__PURE__ */ jsxs2("span", { style: S.opacity, children: [
|
|
1593
|
-
Math.round(node.opacity * 100),
|
|
1594
|
-
"%"
|
|
1595
|
-
] })
|
|
1596
|
-
]
|
|
1597
|
-
}
|
|
1598
|
-
);
|
|
1599
|
-
}
|
|
1600
|
-
function ToggleChip({
|
|
1601
|
-
label,
|
|
1602
|
-
on,
|
|
1603
|
-
onClick
|
|
1604
|
-
}) {
|
|
1605
|
-
return /* @__PURE__ */ jsx3(
|
|
1606
|
-
"button",
|
|
1607
|
-
{
|
|
1608
|
-
type: "button",
|
|
1609
|
-
style: { ...S.chip, opacity: on ? 1 : 0.35, background: on ? "var(--xeno-control)" : "transparent" },
|
|
1610
|
-
onPointerDown: (e) => e.stopPropagation(),
|
|
1611
|
-
onClick: (e) => {
|
|
1612
|
-
e.stopPropagation();
|
|
1613
|
-
onClick();
|
|
1614
|
-
},
|
|
1615
|
-
"aria-pressed": on,
|
|
1616
|
-
"aria-label": label,
|
|
1617
|
-
children: label
|
|
1501
|
+
title: node.name
|
|
1618
1502
|
}
|
|
1619
1503
|
);
|
|
1620
1504
|
}
|
|
1621
|
-
var S = {
|
|
1622
|
-
root: {
|
|
1623
|
-
display: "flex",
|
|
1624
|
-
flexDirection: "column",
|
|
1625
|
-
height: "100%",
|
|
1626
|
-
minHeight: 0,
|
|
1627
|
-
fontSize: 11,
|
|
1628
|
-
color: "var(--xeno-text)",
|
|
1629
|
-
background: "var(--xeno-canvas)",
|
|
1630
|
-
userSelect: "none"
|
|
1631
|
-
},
|
|
1632
|
-
header: {
|
|
1633
|
-
display: "flex",
|
|
1634
|
-
alignItems: "center",
|
|
1635
|
-
padding: "4px 6px",
|
|
1636
|
-
background: "var(--xeno-panel-header)",
|
|
1637
|
-
flex: "0 0 auto"
|
|
1638
|
-
},
|
|
1639
|
-
search: {
|
|
1640
|
-
width: "100%",
|
|
1641
|
-
height: 20,
|
|
1642
|
-
background: "var(--xeno-canvas)",
|
|
1643
|
-
color: "inherit",
|
|
1644
|
-
border: "1px solid var(--xeno-border)",
|
|
1645
|
-
borderRadius: 2,
|
|
1646
|
-
fontSize: 11,
|
|
1647
|
-
padding: "0 6px",
|
|
1648
|
-
outline: "none"
|
|
1649
|
-
},
|
|
1650
|
-
scroll: { flex: "1 1 auto", minHeight: 0, overflowY: "auto", overflowX: "hidden", outline: "none" },
|
|
1651
|
-
row: {
|
|
1652
|
-
display: "flex",
|
|
1653
|
-
alignItems: "center",
|
|
1654
|
-
gap: 4,
|
|
1655
|
-
paddingRight: 6,
|
|
1656
|
-
boxSizing: "border-box",
|
|
1657
|
-
cursor: "default",
|
|
1658
|
-
overflow: "hidden"
|
|
1659
|
-
},
|
|
1660
|
-
twistyCell: { width: 12, display: "flex", alignItems: "center", flex: "0 0 auto" },
|
|
1661
|
-
iconBtn: {
|
|
1662
|
-
display: "flex",
|
|
1663
|
-
alignItems: "center",
|
|
1664
|
-
justifyContent: "center",
|
|
1665
|
-
width: 14,
|
|
1666
|
-
height: 14,
|
|
1667
|
-
padding: 0,
|
|
1668
|
-
border: "none",
|
|
1669
|
-
borderRadius: 2,
|
|
1670
|
-
background: "transparent",
|
|
1671
|
-
color: "inherit",
|
|
1672
|
-
cursor: "pointer",
|
|
1673
|
-
flex: "0 0 auto"
|
|
1674
|
-
},
|
|
1675
|
-
chip: {
|
|
1676
|
-
width: 14,
|
|
1677
|
-
height: 14,
|
|
1678
|
-
padding: 0,
|
|
1679
|
-
border: "none",
|
|
1680
|
-
borderRadius: 2,
|
|
1681
|
-
color: "inherit",
|
|
1682
|
-
fontSize: 9,
|
|
1683
|
-
lineHeight: "14px",
|
|
1684
|
-
cursor: "pointer",
|
|
1685
|
-
flex: "0 0 auto"
|
|
1686
|
-
},
|
|
1687
|
-
colorLabel: { width: 4, height: 14, borderRadius: 2, flex: "0 0 auto" },
|
|
1688
|
-
name: { flex: "1 1 auto", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", minWidth: 0 },
|
|
1689
|
-
renameInput: {
|
|
1690
|
-
flex: "1 1 auto",
|
|
1691
|
-
minWidth: 0,
|
|
1692
|
-
height: 16,
|
|
1693
|
-
background: "var(--xeno-canvas)",
|
|
1694
|
-
color: "inherit",
|
|
1695
|
-
border: "1px solid var(--xeno-control)",
|
|
1696
|
-
borderRadius: 2,
|
|
1697
|
-
fontSize: 11,
|
|
1698
|
-
padding: "0 4px",
|
|
1699
|
-
outline: "none"
|
|
1700
|
-
},
|
|
1701
|
-
badge: {
|
|
1702
|
-
fontSize: 9,
|
|
1703
|
-
padding: "0 4px",
|
|
1704
|
-
height: 14,
|
|
1705
|
-
lineHeight: "14px",
|
|
1706
|
-
borderRadius: 2,
|
|
1707
|
-
background: "var(--xeno-border-subtle)",
|
|
1708
|
-
color: "var(--xeno-muted)",
|
|
1709
|
-
flex: "0 0 auto"
|
|
1710
|
-
},
|
|
1711
|
-
opacity: {
|
|
1712
|
-
fontSize: 10,
|
|
1713
|
-
color: "var(--xeno-muted)",
|
|
1714
|
-
fontVariantNumeric: "tabular-nums",
|
|
1715
|
-
flex: "0 0 auto",
|
|
1716
|
-
minWidth: 30,
|
|
1717
|
-
textAlign: "right"
|
|
1718
|
-
},
|
|
1719
|
-
empty: { padding: 12, fontSize: 10, opacity: 0.4, textTransform: "uppercase", letterSpacing: "0.08em" },
|
|
1720
|
-
footer: {
|
|
1721
|
-
display: "flex",
|
|
1722
|
-
alignItems: "center",
|
|
1723
|
-
justifyContent: "space-between",
|
|
1724
|
-
gap: 8,
|
|
1725
|
-
padding: "2px 6px",
|
|
1726
|
-
fontSize: 9,
|
|
1727
|
-
color: "var(--xeno-muted)",
|
|
1728
|
-
background: "var(--xeno-panel-header)",
|
|
1729
|
-
flex: "0 0 auto"
|
|
1730
|
-
},
|
|
1731
|
-
dim: { opacity: 0.7 }
|
|
1732
|
-
};
|
|
1733
1505
|
|
|
1734
1506
|
// src/edit/layers/panel.ts
|
|
1735
1507
|
function createLayersPanel(options = {}) {
|
|
@@ -3038,7 +2810,7 @@ var InspectorPanelController = class {
|
|
|
3038
2810
|
|
|
3039
2811
|
// src/edit/inspector/react/InspectorPanelView.tsx
|
|
3040
2812
|
import { useCallback as useCallback3, useSyncExternalStore as useSyncExternalStore2 } from "react";
|
|
3041
|
-
import { Badge, Column, EmptyState, Field, FieldGroup, IconButton as
|
|
2813
|
+
import { Badge as Badge2, Column as Column2, EmptyState as EmptyState2, Field, FieldGroup, IconButton as IconButton3, ScrollArea as ScrollArea2, SearchField as SearchField2, Section, Select as Select2, Stack as Stack2, Text as Text3 } from "@xenosystem/components/chrome";
|
|
3042
2814
|
|
|
3043
2815
|
// src/edit/inspector/react/icons.tsx
|
|
3044
2816
|
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
@@ -3092,19 +2864,19 @@ function XIcon({ size = 10 }) {
|
|
|
3092
2864
|
import { useCallback as useCallback2, useRef as useRef3 } from "react";
|
|
3093
2865
|
import {
|
|
3094
2866
|
AxisLabel,
|
|
3095
|
-
IconButton,
|
|
3096
|
-
Input,
|
|
2867
|
+
IconButton as IconButton2,
|
|
2868
|
+
Input as Input2,
|
|
3097
2869
|
ProportionBar,
|
|
3098
2870
|
SegmentedControl,
|
|
3099
2871
|
Select,
|
|
3100
2872
|
Stack,
|
|
3101
2873
|
Swatch,
|
|
3102
|
-
Text,
|
|
2874
|
+
Text as Text2,
|
|
3103
2875
|
TextArea,
|
|
3104
2876
|
TextButton,
|
|
3105
2877
|
Toggle
|
|
3106
2878
|
} from "@xenosystem/components/chrome";
|
|
3107
|
-
import { Fragment, jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
2879
|
+
import { Fragment as Fragment2, jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
3108
2880
|
function displayText(field, controller) {
|
|
3109
2881
|
const draft = controller.getDraft(field.id);
|
|
3110
2882
|
if (draft !== void 0) return draft;
|
|
@@ -3216,7 +2988,7 @@ function NumberWidget({ field, controller, component }) {
|
|
|
3216
2988
|
return /* @__PURE__ */ jsxs4(Stack, { direction: "row", gap: 2, pad: "none", children: [
|
|
3217
2989
|
component !== void 0 && field.components?.[component] ? /* @__PURE__ */ jsx5(AxisLabel, { scrubbable: editable, onPointerDown, onPointerMove, onPointerUp, children: field.components[component] }) : null,
|
|
3218
2990
|
/* @__PURE__ */ jsx5(
|
|
3219
|
-
|
|
2991
|
+
Input2,
|
|
3220
2992
|
{
|
|
3221
2993
|
inputMode: "decimal",
|
|
3222
2994
|
value: text,
|
|
@@ -3240,7 +3012,7 @@ function VectorWidget({ field, controller }) {
|
|
|
3240
3012
|
const expanded = controller.isExpanded(field.id) || !controller.isUniformVector(field.id);
|
|
3241
3013
|
const value = controller.getFieldValue(field.id);
|
|
3242
3014
|
const count = Array.isArray(value) ? value.length : field.components?.length ?? 0;
|
|
3243
|
-
const toggle = (label, title) => /* @__PURE__ */ jsx5(
|
|
3015
|
+
const toggle = (label, title) => /* @__PURE__ */ jsx5(IconButton2, { size: "sm", icon: /* @__PURE__ */ jsx5("span", { "aria-hidden": true, children: "\u22EF" }), label, onClick: () => controller.toggleExpanded(field.id) });
|
|
3244
3016
|
if (!expanded && field.expandable) {
|
|
3245
3017
|
return /* @__PURE__ */ jsxs4(Stack, { direction: "row", gap: 3, pad: "none", children: [
|
|
3246
3018
|
/* @__PURE__ */ jsx5(NumberWidget, { field, controller, component: 0 }),
|
|
@@ -3269,7 +3041,7 @@ function TextWidget({ field, controller }) {
|
|
|
3269
3041
|
onKeyDown: handlers.onKeyDown
|
|
3270
3042
|
};
|
|
3271
3043
|
if (field.type === "textarea") return /* @__PURE__ */ jsx5(TextArea, { ...shared, rows: field.rows ?? 3 });
|
|
3272
|
-
return /* @__PURE__ */ jsx5(
|
|
3044
|
+
return /* @__PURE__ */ jsx5(Input2, { ...shared });
|
|
3273
3045
|
}
|
|
3274
3046
|
function CodeWidget({ field, controller }) {
|
|
3275
3047
|
const editable = isFieldEditable(field);
|
|
@@ -3369,11 +3141,11 @@ function ListWidget({ field, controller }) {
|
|
|
3369
3141
|
};
|
|
3370
3142
|
return /* @__PURE__ */ jsxs4(Stack, { gap: 2, pad: "none", children: [
|
|
3371
3143
|
items.map((item, i) => /* @__PURE__ */ jsxs4(Stack, { direction: "row", gap: 2, pad: "none", children: [
|
|
3372
|
-
/* @__PURE__ */ jsx5(
|
|
3373
|
-
editable ? /* @__PURE__ */ jsxs4(
|
|
3374
|
-
/* @__PURE__ */ jsx5(
|
|
3375
|
-
/* @__PURE__ */ jsx5(
|
|
3376
|
-
/* @__PURE__ */ jsx5(
|
|
3144
|
+
/* @__PURE__ */ jsx5(Text2, { role: "meta", children: typeof item === "string" ? item : JSON.stringify(item) }),
|
|
3145
|
+
editable ? /* @__PURE__ */ jsxs4(Fragment2, { children: [
|
|
3146
|
+
/* @__PURE__ */ jsx5(IconButton2, { size: "sm", icon: /* @__PURE__ */ jsx5("span", { "aria-hidden": true, children: "\u2191" }), label: "Move up", disabled: i === 0, onClick: () => move(i, i - 1) }),
|
|
3147
|
+
/* @__PURE__ */ jsx5(IconButton2, { size: "sm", icon: /* @__PURE__ */ jsx5("span", { "aria-hidden": true, children: "\u2193" }), label: "Move down", disabled: i === items.length - 1, onClick: () => move(i, i + 1) }),
|
|
3148
|
+
/* @__PURE__ */ jsx5(IconButton2, { size: "sm", icon: /* @__PURE__ */ jsx5(XIcon, {}), label: "Remove", onClick: () => write(items.filter((_, j) => j !== i)) })
|
|
3377
3149
|
] }) : null
|
|
3378
3150
|
] }, i)),
|
|
3379
3151
|
editable ? /* @__PURE__ */ jsx5(TextButton, { onClick: () => write([...items, ""]), children: "+ Add" }) : null
|
|
@@ -3381,7 +3153,7 @@ function ListWidget({ field, controller }) {
|
|
|
3381
3153
|
}
|
|
3382
3154
|
function InfoWidget({ field, controller }) {
|
|
3383
3155
|
const value = controller.getFieldValue(field.id);
|
|
3384
|
-
return /* @__PURE__ */ jsx5(
|
|
3156
|
+
return /* @__PURE__ */ jsx5(Text2, { role: "meta", children: value === void 0 || value === null ? "\u2014" : String(value) });
|
|
3385
3157
|
}
|
|
3386
3158
|
function JsonWidget({ field, controller }) {
|
|
3387
3159
|
const editable = isFieldEditable(field);
|
|
@@ -3403,7 +3175,7 @@ function JsonWidget({ field, controller }) {
|
|
|
3403
3175
|
}
|
|
3404
3176
|
|
|
3405
3177
|
// src/edit/inspector/react/InspectorPanelView.tsx
|
|
3406
|
-
import { Fragment as
|
|
3178
|
+
import { Fragment as Fragment3, jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
3407
3179
|
function InspectorPanelView({ controller }) {
|
|
3408
3180
|
const subscribe = useCallback3((cb) => controller.subscribe(cb), [controller]);
|
|
3409
3181
|
const getSnapshot = useCallback3(() => controller.getRevision(), [controller]);
|
|
@@ -3421,15 +3193,15 @@ function InspectorPanelView({ controller }) {
|
|
|
3421
3193
|
);
|
|
3422
3194
|
const multi = targets.length > 1;
|
|
3423
3195
|
const blocked = multi && !controller.canEditTargets();
|
|
3424
|
-
return /* @__PURE__ */ jsxs5(
|
|
3196
|
+
return /* @__PURE__ */ jsxs5(Column2, { className: "xeno-inspector-panel", children: [
|
|
3425
3197
|
controller.isSearchShown() ? /* @__PURE__ */ jsxs5(Stack2, { direction: "row", gap: 6, children: [
|
|
3426
|
-
/* @__PURE__ */ jsx6(
|
|
3427
|
-
targets.length > 0 ? /* @__PURE__ */ jsx6(
|
|
3198
|
+
/* @__PURE__ */ jsx6(SearchField2, { value: controller.getFilter(), onChange: (v) => controller.setFilter(v), placeholder: "Search properties", label: "Search properties" }),
|
|
3199
|
+
targets.length > 0 ? /* @__PURE__ */ jsx6(Badge2, { children: multi ? `${targets.length} selected` : targets[0]?.label ?? targets[0]?.id }) : null
|
|
3428
3200
|
] }) : null,
|
|
3429
|
-
multi ? /* @__PURE__ */ jsx6(Stack2, { pad: "inset", children: /* @__PURE__ */ jsx6(
|
|
3430
|
-
/* @__PURE__ */ jsx6(
|
|
3201
|
+
multi ? /* @__PURE__ */ jsx6(Stack2, { pad: "inset", children: /* @__PURE__ */ jsx6(Text3, { role: "caption", children: blocked ? `${targets.length} selected \u2014 multi-editing is disabled` : `${targets.length} selected \xB7 shared values shown` }) }) : null,
|
|
3202
|
+
/* @__PURE__ */ jsx6(ScrollArea2, { children: /* @__PURE__ */ jsxs5("div", { onKeyDown, tabIndex: 0, role: "group", "aria-label": "Properties", className: "xeno-inspector-properties", children: [
|
|
3431
3203
|
sections.map((projected) => /* @__PURE__ */ jsx6(SectionView, { projected, controller }, projected.section.id)),
|
|
3432
|
-
sections.length === 0 ? /* @__PURE__ */ jsx6(
|
|
3204
|
+
sections.length === 0 ? /* @__PURE__ */ jsx6(EmptyState2, { title: targets.length === 0 ? "Nothing selected" : "No properties" }) : null
|
|
3433
3205
|
] }) })
|
|
3434
3206
|
] });
|
|
3435
3207
|
}
|
|
@@ -3445,13 +3217,13 @@ function SectionView({ projected, controller }) {
|
|
|
3445
3217
|
onCollapsedChange: () => controller.toggleSectionCollapsed(section.id),
|
|
3446
3218
|
enabled: section.enabled?.value,
|
|
3447
3219
|
onEnabledChange: section.enabled ? () => controller.toggleSectionEnabled(section.id) : void 0,
|
|
3448
|
-
badge: section.badge ? /* @__PURE__ */ jsx6(
|
|
3449
|
-
actions: /* @__PURE__ */ jsxs5(
|
|
3450
|
-
section.actions?.map((action) => /* @__PURE__ */ jsx6(
|
|
3220
|
+
badge: section.badge ? /* @__PURE__ */ jsx6(Badge2, { children: section.badge }) : null,
|
|
3221
|
+
actions: /* @__PURE__ */ jsxs5(Fragment3, { children: [
|
|
3222
|
+
section.actions?.map((action) => /* @__PURE__ */ jsx6(IconButton3, { size: "sm", icon: /* @__PURE__ */ jsx6("span", { "aria-hidden": true, children: action.label.slice(0, 1) }), label: action.label, disabled: action.disabled, onClick: () => controller.runAction(section.id, action.id) }, action.id)),
|
|
3451
3223
|
section.addMenu && section.addMenu.length > 0 ? /* @__PURE__ */ jsx6(AddMenu, { section, controller }) : null
|
|
3452
3224
|
] }),
|
|
3453
3225
|
children: [
|
|
3454
|
-
empty && section.emptyHint ? /* @__PURE__ */ jsx6(Stack2, { pad: "inset", children: /* @__PURE__ */ jsx6(
|
|
3226
|
+
empty && section.emptyHint ? /* @__PURE__ */ jsx6(Stack2, { pad: "inset", children: /* @__PURE__ */ jsx6(Text3, { role: "caption", children: section.emptyHint }) }) : null,
|
|
3455
3227
|
/* @__PURE__ */ jsx6(FieldGroup, { labelWidth: controller.getLabelWidth(), children: fields.map((field) => /* @__PURE__ */ jsx6(FieldRow, { field, controller }, field.id)) })
|
|
3456
3228
|
]
|
|
3457
3229
|
}
|
|
@@ -3469,7 +3241,7 @@ function FieldRow({ field, controller }) {
|
|
|
3469
3241
|
const easingOptions = anim?.easingOptions ?? [];
|
|
3470
3242
|
const easing = anim?.easing ?? "";
|
|
3471
3243
|
const easingAll = easingOptions.some((o) => o.value === easing) ? easingOptions : [{ value: easing, label: easing || "\u2014" }, ...easingOptions];
|
|
3472
|
-
return /* @__PURE__ */ jsxs5(
|
|
3244
|
+
return /* @__PURE__ */ jsxs5(Fragment3, { children: [
|
|
3473
3245
|
/* @__PURE__ */ jsx6(
|
|
3474
3246
|
Field,
|
|
3475
3247
|
{
|
|
@@ -3478,24 +3250,24 @@ function FieldRow({ field, controller }) {
|
|
|
3478
3250
|
focused,
|
|
3479
3251
|
onLabelClick: () => controller.focusField(field.id),
|
|
3480
3252
|
onContextMenu: (x, y) => controller.requestContextMenu(field.id, x, y),
|
|
3481
|
-
leading: showKeyframes ? /* @__PURE__ */ jsxs5(
|
|
3482
|
-
/* @__PURE__ */ jsx6(
|
|
3483
|
-
anim.animated ? /* @__PURE__ */ jsxs5(
|
|
3484
|
-
/* @__PURE__ */ jsx6(
|
|
3485
|
-
/* @__PURE__ */ jsx6(
|
|
3486
|
-
/* @__PURE__ */ jsx6(
|
|
3253
|
+
leading: showKeyframes ? /* @__PURE__ */ jsxs5(Fragment3, { children: [
|
|
3254
|
+
/* @__PURE__ */ jsx6(IconButton3, { size: "sm", icon: /* @__PURE__ */ jsx6(StopwatchIcon, {}), label: "Toggle animation", active: anim.animated, onClick: () => controller.keyframe(field.id, "toggleAnim") }),
|
|
3255
|
+
anim.animated ? /* @__PURE__ */ jsxs5(Fragment3, { children: [
|
|
3256
|
+
/* @__PURE__ */ jsx6(IconButton3, { size: "sm", icon: /* @__PURE__ */ jsx6(PrevIcon, {}), label: "Previous keyframe", disabled: anim.canPrev === false, onClick: () => controller.keyframe(field.id, "prev") }),
|
|
3257
|
+
/* @__PURE__ */ jsx6(IconButton3, { size: "sm", icon: /* @__PURE__ */ jsx6(DiamondIcon, { filled: !!anim.onKeyframe }), label: anim.onKeyframe ? "Remove keyframe" : "Add keyframe", onClick: () => controller.keyframe(field.id, anim.onKeyframe ? "remove" : "add") }),
|
|
3258
|
+
/* @__PURE__ */ jsx6(IconButton3, { size: "sm", icon: /* @__PURE__ */ jsx6(NextIcon, {}), label: "Next keyframe", disabled: anim.canNext === false, onClick: () => controller.keyframe(field.id, "next") })
|
|
3487
3259
|
] }) : null
|
|
3488
3260
|
] }) : null,
|
|
3489
|
-
trailing: /* @__PURE__ */ jsxs5(
|
|
3261
|
+
trailing: /* @__PURE__ */ jsxs5(Fragment3, { children: [
|
|
3490
3262
|
showKeyframes && anim.animated && anim.onKeyframe ? /* @__PURE__ */ jsx6(Select2, { size: "sm", options: easingAll, value: easing, label: "Easing", onChange: (v) => controller.keyframe(field.id, "setEasing", v) }) : null,
|
|
3491
|
-
showKeyframes ? /* @__PURE__ */ jsx6(
|
|
3492
|
-
controller.areTokensShown() && field.token?.bindable !== false ? /* @__PURE__ */ jsx6(
|
|
3493
|
-
field.defaultValue !== void 0 && isFieldEditable(field) ? /* @__PURE__ */ jsx6(
|
|
3263
|
+
showKeyframes ? /* @__PURE__ */ jsx6(Badge2, { size: "sm", children: controller.keyframeChip(field.id) }) : null,
|
|
3264
|
+
controller.areTokensShown() && field.token?.bindable !== false ? /* @__PURE__ */ jsx6(IconButton3, { size: "sm", icon: /* @__PURE__ */ jsx6(LinkIcon, {}), label: bound ? "Unbind token" : "Bind token", active: bound, onClick: () => controller.bindToken(field.id, bound ? null : controller.getTokens()[0]?.id ?? null) }) : null,
|
|
3265
|
+
field.defaultValue !== void 0 && isFieldEditable(field) ? /* @__PURE__ */ jsx6(IconButton3, { size: "sm", icon: /* @__PURE__ */ jsx6(ResetIcon, {}), label: "Reset to default", onClick: () => controller.resetField(field.id) }) : null
|
|
3494
3266
|
] }),
|
|
3495
|
-
children: bound ? /* @__PURE__ */ jsx6(
|
|
3267
|
+
children: bound ? /* @__PURE__ */ jsx6(Badge2, { title: `Bound to ${field.token?.tokenName ?? field.token?.tokenId}`, children: field.token?.tokenName ?? field.token?.tokenId }) : /* @__PURE__ */ jsx6(FieldWidget, { field, controller })
|
|
3496
3268
|
}
|
|
3497
3269
|
),
|
|
3498
|
-
field.description && field.type === "info" ? /* @__PURE__ */ jsx6(Stack2, { pad: "inset", children: /* @__PURE__ */ jsx6(
|
|
3270
|
+
field.description && field.type === "info" ? /* @__PURE__ */ jsx6(Stack2, { pad: "inset", children: /* @__PURE__ */ jsx6(Text3, { role: "caption", children: field.description }) }) : null
|
|
3499
3271
|
] });
|
|
3500
3272
|
}
|
|
3501
3273
|
function FieldWidget({
|
|
@@ -4483,7 +4255,7 @@ var HistoryPanelController = class {
|
|
|
4483
4255
|
|
|
4484
4256
|
// src/edit/history/react/HistoryPanelView.tsx
|
|
4485
4257
|
import { useCallback as useCallback4, useEffect as useEffect3, useRef as useRef4, useSyncExternalStore as useSyncExternalStore3 } from "react";
|
|
4486
|
-
import { Badge as
|
|
4258
|
+
import { Badge as Badge3, Column as Column3, EmptyState as EmptyState3, IconButton as IconButton4, InlineConfirm, RowList as RowList2, Row as Row2, ScrollArea as ScrollArea3, SearchField as SearchField3, StatusBar as StatusBar2, Text as Text4, Toolbar as Toolbar2, VirtualWindow as VirtualWindow2 } from "@xenosystem/components/chrome";
|
|
4487
4259
|
|
|
4488
4260
|
// src/edit/history/react/icons.tsx
|
|
4489
4261
|
import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
@@ -4579,7 +4351,7 @@ function PendingGlyph({ size = 9 }) {
|
|
|
4579
4351
|
}
|
|
4580
4352
|
|
|
4581
4353
|
// src/edit/history/react/HistoryPanelView.tsx
|
|
4582
|
-
import { Fragment as
|
|
4354
|
+
import { Fragment as Fragment4, jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
4583
4355
|
function HistoryPanelView({ controller }) {
|
|
4584
4356
|
const subscribe = useCallback4((cb) => controller.subscribe(cb), [controller]);
|
|
4585
4357
|
const getSnapshot = useCallback4(() => controller.getRevision(), [controller]);
|
|
@@ -4628,29 +4400,29 @@ function HistoryPanelView({ controller }) {
|
|
|
4628
4400
|
},
|
|
4629
4401
|
[controller]
|
|
4630
4402
|
);
|
|
4631
|
-
return /* @__PURE__ */ jsxs7(
|
|
4403
|
+
return /* @__PURE__ */ jsxs7(Column3, { className: "xeno-history-panel", children: [
|
|
4632
4404
|
/* @__PURE__ */ jsx8(
|
|
4633
|
-
|
|
4405
|
+
Toolbar2,
|
|
4634
4406
|
{
|
|
4635
|
-
left: /* @__PURE__ */ jsxs7(
|
|
4636
|
-
/* @__PURE__ */ jsx8(
|
|
4637
|
-
/* @__PURE__ */ jsx8(
|
|
4407
|
+
left: /* @__PURE__ */ jsxs7(Fragment4, { children: [
|
|
4408
|
+
/* @__PURE__ */ jsx8(IconButton4, { size: "sm", icon: /* @__PURE__ */ jsx8(UndoIcon, {}), label: "Undo", disabled: !controller.canUndo(), onClick: () => controller.undo() }),
|
|
4409
|
+
/* @__PURE__ */ jsx8(IconButton4, { size: "sm", icon: /* @__PURE__ */ jsx8(RedoIcon, {}), label: "Redo", disabled: !controller.canRedo(), onClick: () => controller.redo() })
|
|
4638
4410
|
] }),
|
|
4639
|
-
right: /* @__PURE__ */ jsxs7(
|
|
4640
|
-
/* @__PURE__ */ jsxs7(
|
|
4411
|
+
right: /* @__PURE__ */ jsxs7(Fragment4, { children: [
|
|
4412
|
+
/* @__PURE__ */ jsxs7(Text4, { role: "number", children: [
|
|
4641
4413
|
controller.getAppliedCount(),
|
|
4642
4414
|
" / ",
|
|
4643
4415
|
controller.getTotalCount()
|
|
4644
4416
|
] }),
|
|
4645
|
-
controller.isClearAllowed() ? /* @__PURE__ */ jsx8(
|
|
4417
|
+
controller.isClearAllowed() ? /* @__PURE__ */ jsx8(IconButton4, { size: "sm", icon: /* @__PURE__ */ jsx8(TrashIcon, {}), label: "Clear history", onClick: () => controller.requestClear() }) : null
|
|
4646
4418
|
] }),
|
|
4647
|
-
children: controller.isSearchShown() ? /* @__PURE__ */ jsx8(
|
|
4419
|
+
children: controller.isSearchShown() ? /* @__PURE__ */ jsx8(SearchField3, { value: controller.getFilter(), onChange: (v) => controller.setFilter(v), placeholder: "Search history", label: "Search history" }) : null
|
|
4648
4420
|
}
|
|
4649
4421
|
),
|
|
4650
4422
|
controller.isConfirmingClear() ? /* @__PURE__ */ jsx8(InlineConfirm, { message: "Clear all history?", label: "Confirm clear history", confirmLabel: "Clear", onConfirm: () => controller.confirmClearNow(), onCancel: () => controller.cancelClear() }) : null,
|
|
4651
|
-
controller.isPruned() ? /* @__PURE__ */ jsx8(
|
|
4652
|
-
/* @__PURE__ */ jsxs7(
|
|
4653
|
-
/* @__PURE__ */ jsx8(
|
|
4423
|
+
controller.isPruned() ? /* @__PURE__ */ jsx8(Text4, { role: "caption", children: "Earlier history discarded (limit reached)" }) : null,
|
|
4424
|
+
/* @__PURE__ */ jsxs7(ScrollArea3, { ref: scrollRef, onScroll, onKeyDown, onMouseLeave: () => controller.setHovered(null), tabIndex: 0, children: [
|
|
4425
|
+
/* @__PURE__ */ jsx8(RowList2, { role: "listbox", "aria-label": "History", children: /* @__PURE__ */ jsx8(VirtualWindow2, { totalHeight: window_.totalHeight, offsetTop: window_.offsetTop, children: windowRows.map((row) => /* @__PURE__ */ jsx8(
|
|
4654
4426
|
HistoryRowView,
|
|
4655
4427
|
{
|
|
4656
4428
|
row,
|
|
@@ -4660,17 +4432,17 @@ function HistoryPanelView({ controller }) {
|
|
|
4660
4432
|
},
|
|
4661
4433
|
row.entryId ?? "__original__"
|
|
4662
4434
|
)) }) }),
|
|
4663
|
-
rows.length === 0 ? /* @__PURE__ */ jsx8(
|
|
4435
|
+
rows.length === 0 ? /* @__PURE__ */ jsx8(EmptyState3, { title: "No history" }) : null
|
|
4664
4436
|
] }),
|
|
4665
4437
|
memory ? /* @__PURE__ */ jsx8(
|
|
4666
|
-
|
|
4438
|
+
StatusBar2,
|
|
4667
4439
|
{
|
|
4668
|
-
left: /* @__PURE__ */ jsxs7(
|
|
4440
|
+
left: /* @__PURE__ */ jsxs7(Text4, { role: "number", children: [
|
|
4669
4441
|
memory.usedMB.toFixed(1),
|
|
4670
4442
|
" MB",
|
|
4671
4443
|
memory.limitMB ? ` / ${memory.limitMB} MB` : ""
|
|
4672
4444
|
] }),
|
|
4673
|
-
right: memory.onDiskCount !== void 0 ? /* @__PURE__ */ jsxs7(
|
|
4445
|
+
right: memory.onDiskCount !== void 0 ? /* @__PURE__ */ jsxs7(Text4, { role: "meta", children: [
|
|
4674
4446
|
memory.onDiskCount,
|
|
4675
4447
|
" on disk"
|
|
4676
4448
|
] }) : null
|
|
@@ -4684,7 +4456,7 @@ function HistoryRowView({ row, controller, rowHeight, focused }) {
|
|
|
4684
4456
|
const failed = entry?.status === "failed";
|
|
4685
4457
|
const jumpable = controller.isJumpAllowed() && entry?.caps?.jumpable !== false;
|
|
4686
4458
|
return /* @__PURE__ */ jsx8(
|
|
4687
|
-
|
|
4459
|
+
Row2,
|
|
4688
4460
|
{
|
|
4689
4461
|
height: rowHeight,
|
|
4690
4462
|
selected: row.current,
|
|
@@ -4702,17 +4474,17 @@ function HistoryRowView({ row, controller, rowHeight, focused }) {
|
|
|
4702
4474
|
controller.requestContextMenu(row.entryId, e.clientX, e.clientY);
|
|
4703
4475
|
},
|
|
4704
4476
|
title: row.label,
|
|
4705
|
-
trailing: /* @__PURE__ */ jsxs7(
|
|
4477
|
+
trailing: /* @__PURE__ */ jsxs7(Fragment4, { children: [
|
|
4706
4478
|
pending ? /* @__PURE__ */ jsx8(PendingGlyph, {}) : null,
|
|
4707
|
-
failed ? /* @__PURE__ */ jsx8(
|
|
4708
|
-
controller.isSourceShown() && entry?.source && entry.source !== "user" ? /* @__PURE__ */ jsx8(
|
|
4709
|
-
entry?.coalesced && entry.coalesced > 1 ? /* @__PURE__ */ jsxs7(
|
|
4479
|
+
failed ? /* @__PURE__ */ jsx8(Badge3, { size: "sm", tone: "error", children: "failed" }) : null,
|
|
4480
|
+
controller.isSourceShown() && entry?.source && entry.source !== "user" ? /* @__PURE__ */ jsx8(Badge3, { size: "sm", title: `Source: ${entry.source}`, children: entry.source === "agent" ? "AI" : "S" }) : null,
|
|
4481
|
+
entry?.coalesced && entry.coalesced > 1 ? /* @__PURE__ */ jsxs7(Badge3, { size: "sm", title: `${entry.coalesced} actions coalesced`, children: [
|
|
4710
4482
|
"\xD7",
|
|
4711
4483
|
entry.coalesced
|
|
4712
4484
|
] }) : null,
|
|
4713
|
-
controller.areTimestampsShown() && entry?.at !== void 0 ? /* @__PURE__ */ jsx8(
|
|
4485
|
+
controller.areTimestampsShown() && entry?.at !== void 0 ? /* @__PURE__ */ jsx8(Text4, { role: "meta", children: formatTime(entry.at) }) : null,
|
|
4714
4486
|
pending ? /* @__PURE__ */ jsx8(
|
|
4715
|
-
|
|
4487
|
+
IconButton4,
|
|
4716
4488
|
{
|
|
4717
4489
|
size: "sm",
|
|
4718
4490
|
icon: /* @__PURE__ */ jsx8(XIcon2, {}),
|
|
@@ -5814,7 +5586,7 @@ function drawAlphaStrip(ctx, w, h, hsv) {
|
|
|
5814
5586
|
}
|
|
5815
5587
|
|
|
5816
5588
|
// src/edit/color/react/ColorPanelView.tsx
|
|
5817
|
-
import { Fragment as
|
|
5589
|
+
import { Fragment as Fragment5, jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
5818
5590
|
var SPACE_LABEL = {
|
|
5819
5591
|
hex: "HEX",
|
|
5820
5592
|
rgb: "RGB",
|
|
@@ -5919,14 +5691,14 @@ function ColorPanelView({ controller }) {
|
|
|
5919
5691
|
);
|
|
5920
5692
|
const componentLabels = COMPONENT_LABELS[space];
|
|
5921
5693
|
const comps = value.components ?? [];
|
|
5922
|
-
return /* @__PURE__ */ jsxs8("div", { style:
|
|
5923
|
-
controller.getChannelsMode() === "fg-bg" && /* @__PURE__ */ jsxs8("div", { style:
|
|
5694
|
+
return /* @__PURE__ */ jsxs8("div", { style: S.root, className: "xeno-color-panel", children: [
|
|
5695
|
+
controller.getChannelsMode() === "fg-bg" && /* @__PURE__ */ jsxs8("div", { style: S.channels, children: [
|
|
5924
5696
|
/* @__PURE__ */ jsx9(
|
|
5925
5697
|
"button",
|
|
5926
5698
|
{
|
|
5927
5699
|
type: "button",
|
|
5928
5700
|
"aria-pressed": controller.getActiveChannel() === "fg",
|
|
5929
|
-
style: { ...
|
|
5701
|
+
style: { ...S.chip, ...controller.getActiveChannel() === "fg" ? S.chipActive : null, background: value.hex },
|
|
5930
5702
|
onClick: () => controller.setChannel("fg"),
|
|
5931
5703
|
title: "Foreground"
|
|
5932
5704
|
}
|
|
@@ -5935,7 +5707,7 @@ function ColorPanelView({ controller }) {
|
|
|
5935
5707
|
"button",
|
|
5936
5708
|
{
|
|
5937
5709
|
type: "button",
|
|
5938
|
-
style:
|
|
5710
|
+
style: S.swap,
|
|
5939
5711
|
onClick: () => controller.swapChannels(),
|
|
5940
5712
|
title: "Swap FG/BG (X)",
|
|
5941
5713
|
children: "\u21C4"
|
|
@@ -5946,20 +5718,20 @@ function ColorPanelView({ controller }) {
|
|
|
5946
5718
|
{
|
|
5947
5719
|
type: "button",
|
|
5948
5720
|
"aria-pressed": controller.getActiveChannel() === "bg",
|
|
5949
|
-
style: { ...
|
|
5721
|
+
style: { ...S.chip, ...controller.getActiveChannel() === "bg" ? S.chipActive : null },
|
|
5950
5722
|
onClick: () => controller.setChannel("bg"),
|
|
5951
5723
|
title: "Background"
|
|
5952
5724
|
}
|
|
5953
5725
|
)
|
|
5954
5726
|
] }),
|
|
5955
|
-
/* @__PURE__ */ jsxs8("div", { style:
|
|
5727
|
+
/* @__PURE__ */ jsxs8("div", { style: S.pickerRow, children: [
|
|
5956
5728
|
/* @__PURE__ */ jsx9(
|
|
5957
5729
|
"canvas",
|
|
5958
5730
|
{
|
|
5959
5731
|
ref: spectrumRef,
|
|
5960
5732
|
width: 200,
|
|
5961
5733
|
height: 140,
|
|
5962
|
-
style: { ...
|
|
5734
|
+
style: { ...S.spectrum, ...bound ? S.disabled : null },
|
|
5963
5735
|
onPointerDown: (e) => onSpectrumPointer(e, true),
|
|
5964
5736
|
onPointerMove: (e) => onSpectrumPointer(e, false),
|
|
5965
5737
|
onPointerUp: endDrag
|
|
@@ -5971,7 +5743,7 @@ function ColorPanelView({ controller }) {
|
|
|
5971
5743
|
ref: hueRef,
|
|
5972
5744
|
width: 14,
|
|
5973
5745
|
height: 140,
|
|
5974
|
-
style: { ...
|
|
5746
|
+
style: { ...S.strip, ...bound ? S.disabled : null },
|
|
5975
5747
|
onPointerDown: (e) => onHuePointer(e, true),
|
|
5976
5748
|
onPointerMove: (e) => onHuePointer(e, false),
|
|
5977
5749
|
onPointerUp: endDrag
|
|
@@ -5983,20 +5755,20 @@ function ColorPanelView({ controller }) {
|
|
|
5983
5755
|
ref: alphaRef,
|
|
5984
5756
|
width: 14,
|
|
5985
5757
|
height: 140,
|
|
5986
|
-
style: { ...
|
|
5758
|
+
style: { ...S.strip, ...bound ? S.disabled : null },
|
|
5987
5759
|
onPointerDown: (e) => onAlphaPointer(e, true),
|
|
5988
5760
|
onPointerMove: (e) => onAlphaPointer(e, false),
|
|
5989
5761
|
onPointerUp: endDrag
|
|
5990
5762
|
}
|
|
5991
5763
|
)
|
|
5992
5764
|
] }),
|
|
5993
|
-
/* @__PURE__ */ jsxs8("div", { style:
|
|
5765
|
+
/* @__PURE__ */ jsxs8("div", { style: S.controls, children: [
|
|
5994
5766
|
/* @__PURE__ */ jsx9(
|
|
5995
5767
|
"select",
|
|
5996
5768
|
{
|
|
5997
5769
|
value: space,
|
|
5998
5770
|
onChange: (e) => controller.setSpace(e.target.value),
|
|
5999
|
-
style:
|
|
5771
|
+
style: S.select,
|
|
6000
5772
|
"aria-label": "Color model",
|
|
6001
5773
|
children: EDIT_SPACES.map((s) => /* @__PURE__ */ jsx9("option", { value: s, children: SPACE_LABEL[s] }, s))
|
|
6002
5774
|
}
|
|
@@ -6008,12 +5780,12 @@ function ColorPanelView({ controller }) {
|
|
|
6008
5780
|
value: value.hex,
|
|
6009
5781
|
onChange: onHexInput,
|
|
6010
5782
|
disabled: bound,
|
|
6011
|
-
style:
|
|
5783
|
+
style: S.hexInput,
|
|
6012
5784
|
"aria-label": "Hex",
|
|
6013
5785
|
spellCheck: false
|
|
6014
5786
|
}
|
|
6015
|
-
) : /* @__PURE__ */ jsx9("div", { style:
|
|
6016
|
-
/* @__PURE__ */ jsx9("span", { style:
|
|
5787
|
+
) : /* @__PURE__ */ jsx9("div", { style: S.componentRow, children: (componentLabels ?? []).map((label, i) => /* @__PURE__ */ jsxs8("label", { style: S.componentField, children: [
|
|
5788
|
+
/* @__PURE__ */ jsx9("span", { style: S.componentLabel, children: label }),
|
|
6017
5789
|
/* @__PURE__ */ jsx9(
|
|
6018
5790
|
"input",
|
|
6019
5791
|
{
|
|
@@ -6021,12 +5793,12 @@ function ColorPanelView({ controller }) {
|
|
|
6021
5793
|
value: roundForSpace(space, i, comps[i] ?? 0),
|
|
6022
5794
|
onChange: (e) => onComponentInput(i, e.target.value),
|
|
6023
5795
|
disabled: bound,
|
|
6024
|
-
style:
|
|
5796
|
+
style: S.numInput
|
|
6025
5797
|
}
|
|
6026
5798
|
)
|
|
6027
5799
|
] }, label)) }),
|
|
6028
|
-
controller.isAlphaShown() && /* @__PURE__ */ jsxs8("label", { style:
|
|
6029
|
-
/* @__PURE__ */ jsx9("span", { style:
|
|
5800
|
+
controller.isAlphaShown() && /* @__PURE__ */ jsxs8("label", { style: S.alphaField, children: [
|
|
5801
|
+
/* @__PURE__ */ jsx9("span", { style: S.componentLabel, children: "A" }),
|
|
6030
5802
|
/* @__PURE__ */ jsx9(
|
|
6031
5803
|
"input",
|
|
6032
5804
|
{
|
|
@@ -6036,20 +5808,20 @@ function ColorPanelView({ controller }) {
|
|
|
6036
5808
|
value: Math.round(value.alpha * 100),
|
|
6037
5809
|
onChange: (e) => controller.setAlpha(Number(e.target.value) / 100, { commit: true }),
|
|
6038
5810
|
disabled: bound,
|
|
6039
|
-
style:
|
|
5811
|
+
style: S.numInput
|
|
6040
5812
|
}
|
|
6041
5813
|
)
|
|
6042
5814
|
] }),
|
|
6043
|
-
/* @__PURE__ */ jsx9("button", { type: "button", style:
|
|
5815
|
+
/* @__PURE__ */ jsx9("button", { type: "button", style: S.iconBtn, title: "Pick from screen", onClick: () => controller.requestEyedropper(), children: "\u29BF" })
|
|
6044
5816
|
] }),
|
|
6045
|
-
controller.hasTokens() && /* @__PURE__ */ jsxs8("div", { style:
|
|
6046
|
-
/* @__PURE__ */ jsx9("span", { style:
|
|
5817
|
+
controller.hasTokens() && /* @__PURE__ */ jsxs8("div", { style: S.tokenRow, children: [
|
|
5818
|
+
/* @__PURE__ */ jsx9("span", { style: S.componentLabel, children: "Token" }),
|
|
6047
5819
|
/* @__PURE__ */ jsxs8(
|
|
6048
5820
|
"select",
|
|
6049
5821
|
{
|
|
6050
5822
|
value: controller.getBoundTokenId() ?? "",
|
|
6051
5823
|
onChange: (e) => e.target.value ? controller.bindToken(e.target.value) : controller.unbindToken(),
|
|
6052
|
-
style:
|
|
5824
|
+
style: S.select,
|
|
6053
5825
|
"aria-label": "Bind token",
|
|
6054
5826
|
children: [
|
|
6055
5827
|
/* @__PURE__ */ jsx9("option", { value: "", children: "\u2014 raw \u2014" }),
|
|
@@ -6057,17 +5829,17 @@ function ColorPanelView({ controller }) {
|
|
|
6057
5829
|
]
|
|
6058
5830
|
}
|
|
6059
5831
|
),
|
|
6060
|
-
bound && /* @__PURE__ */ jsx9("button", { type: "button", style:
|
|
5832
|
+
bound && /* @__PURE__ */ jsx9("button", { type: "button", style: S.textBtn, onClick: () => controller.unbindToken(), children: "Unbind" })
|
|
6061
5833
|
] }),
|
|
6062
|
-
/* @__PURE__ */ jsxs8("div", { style:
|
|
6063
|
-
/* @__PURE__ */ jsx9("span", { style:
|
|
6064
|
-
/* @__PURE__ */ jsx9("button", { type: "button", style:
|
|
5834
|
+
/* @__PURE__ */ jsxs8("div", { style: S.swatchHeader, children: [
|
|
5835
|
+
/* @__PURE__ */ jsx9("span", { style: S.sectionLabel, children: "Swatches" }),
|
|
5836
|
+
/* @__PURE__ */ jsx9("button", { type: "button", style: S.textBtn, onClick: () => void controller.addSwatch(), children: "+ Save" })
|
|
6065
5837
|
] }),
|
|
6066
|
-
/* @__PURE__ */ jsx9("div", { style:
|
|
5838
|
+
/* @__PURE__ */ jsx9("div", { style: S.swatchGrid, children: controller.getSwatches().map((hex) => /* @__PURE__ */ jsx9(
|
|
6067
5839
|
"button",
|
|
6068
5840
|
{
|
|
6069
5841
|
type: "button",
|
|
6070
|
-
style: { ...
|
|
5842
|
+
style: { ...S.swatch, background: hex },
|
|
6071
5843
|
title: hex,
|
|
6072
5844
|
onClick: () => controller.selectColor(hex),
|
|
6073
5845
|
onContextMenu: (e) => {
|
|
@@ -6077,13 +5849,13 @@ function ColorPanelView({ controller }) {
|
|
|
6077
5849
|
},
|
|
6078
5850
|
hex
|
|
6079
5851
|
)) }),
|
|
6080
|
-
controller.getRecent().length > 0 && /* @__PURE__ */ jsxs8(
|
|
6081
|
-
/* @__PURE__ */ jsx9("div", { style:
|
|
6082
|
-
/* @__PURE__ */ jsx9("div", { style:
|
|
5852
|
+
controller.getRecent().length > 0 && /* @__PURE__ */ jsxs8(Fragment5, { children: [
|
|
5853
|
+
/* @__PURE__ */ jsx9("div", { style: S.sectionLabel, children: "Recent" }),
|
|
5854
|
+
/* @__PURE__ */ jsx9("div", { style: S.swatchGrid, children: controller.getRecent().map((hex, i) => /* @__PURE__ */ jsx9(
|
|
6083
5855
|
"button",
|
|
6084
5856
|
{
|
|
6085
5857
|
type: "button",
|
|
6086
|
-
style: { ...
|
|
5858
|
+
style: { ...S.swatch, background: hex },
|
|
6087
5859
|
title: hex,
|
|
6088
5860
|
onClick: () => controller.selectColor(hex)
|
|
6089
5861
|
},
|
|
@@ -6099,7 +5871,7 @@ function roundForSpace(space, index, v) {
|
|
|
6099
5871
|
if (space === "oklch") return Math.round(v * 10) / 10;
|
|
6100
5872
|
return Math.round(v);
|
|
6101
5873
|
}
|
|
6102
|
-
var
|
|
5874
|
+
var S = {
|
|
6103
5875
|
root: { display: "flex", flexDirection: "column", gap: 8, padding: 8, fontSize: 11, color: "var(--xeno-text)", background: "var(--xeno-canvas)", minWidth: 232, userSelect: "none" },
|
|
6104
5876
|
channels: { display: "flex", alignItems: "center", gap: 6 },
|
|
6105
5877
|
chip: { width: 28, height: 20, borderRadius: 2, border: "1px solid var(--xeno-control)", background: "var(--xeno-canvas)", cursor: "pointer", padding: 0 },
|
|
@@ -7396,9 +7168,9 @@ var curveManifest = {
|
|
|
7396
7168
|
|
|
7397
7169
|
// src/edit/curve/react/CurvePanelView.tsx
|
|
7398
7170
|
import { useCallback as useCallback6, useEffect as useEffect5, useRef as useRef6, useSyncExternalStore as useSyncExternalStore5 } from "react";
|
|
7399
|
-
import { EmptyState as
|
|
7171
|
+
import { EmptyState as EmptyState4, StatusBar as StatusBar3, Toolbar as Toolbar3, ToolbarGroup } from "@xenosystem/components/chrome";
|
|
7400
7172
|
import { formatTick } from "@xenosystem/time-core";
|
|
7401
|
-
import { Fragment as
|
|
7173
|
+
import { Fragment as Fragment6, jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
7402
7174
|
var DASHES = ["none", "4 2", "1 2", "6 2 1 2"];
|
|
7403
7175
|
function CurvePanelView({ controller, showPresets = true }) {
|
|
7404
7176
|
const state = useSyncExternalStore5(controller.subscribe, controller.getState, controller.getState);
|
|
@@ -7479,7 +7251,7 @@ function CurvePanelView({ controller, showPresets = true }) {
|
|
|
7479
7251
|
const channels = state.curves?.channels ?? [];
|
|
7480
7252
|
return /* @__PURE__ */ jsxs9("div", { style: SHELL, children: [
|
|
7481
7253
|
/* @__PURE__ */ jsx10(
|
|
7482
|
-
|
|
7254
|
+
Toolbar3,
|
|
7483
7255
|
{
|
|
7484
7256
|
left: /* @__PURE__ */ jsx10(ToolbarGroup, { children: ["linear", "bezier", "hold", "step"].map((mode) => /* @__PURE__ */ jsx10("button", { type: "button", style: button(), onClick: () => controller.setInterpolation(mode), children: mode }, mode)) }),
|
|
7485
7257
|
right: /* @__PURE__ */ jsxs9(ToolbarGroup, { end: true, children: [
|
|
@@ -7489,7 +7261,7 @@ function CurvePanelView({ controller, showPresets = true }) {
|
|
|
7489
7261
|
}
|
|
7490
7262
|
),
|
|
7491
7263
|
showPresets ? /* @__PURE__ */ jsx10(
|
|
7492
|
-
|
|
7264
|
+
Toolbar3,
|
|
7493
7265
|
{
|
|
7494
7266
|
left: /* @__PURE__ */ jsx10(ToolbarGroup, { children: EASING_PRESETS.slice(0, 6).map((preset) => /* @__PURE__ */ jsx10(
|
|
7495
7267
|
"button",
|
|
@@ -7504,7 +7276,7 @@ function CurvePanelView({ controller, showPresets = true }) {
|
|
|
7504
7276
|
)) })
|
|
7505
7277
|
}
|
|
7506
7278
|
) : null,
|
|
7507
|
-
channels.length === 0 ? /* @__PURE__ */ jsx10(
|
|
7279
|
+
channels.length === 0 ? /* @__PURE__ */ jsx10(EmptyState4, { title: "No curves", hint: "Wire an animated property into this panel's input." }) : /* @__PURE__ */ jsx10(
|
|
7508
7280
|
"div",
|
|
7509
7281
|
{
|
|
7510
7282
|
ref: containerRef,
|
|
@@ -7618,7 +7390,7 @@ function CurvePanelView({ controller, showPresets = true }) {
|
|
|
7618
7390
|
}
|
|
7619
7391
|
),
|
|
7620
7392
|
/* @__PURE__ */ jsx10(
|
|
7621
|
-
|
|
7393
|
+
StatusBar3,
|
|
7622
7394
|
{
|
|
7623
7395
|
left: `${channels.length} channel${channels.length === 1 ? "" : "s"}`,
|
|
7624
7396
|
right: /* @__PURE__ */ jsx10("span", { className: "tabular-nums", children: state.playheadTick !== null ? formatTick(state.playheadTick, state.timebase) : "" })
|
|
@@ -7633,7 +7405,7 @@ function Handles({
|
|
|
7633
7405
|
scale
|
|
7634
7406
|
}) {
|
|
7635
7407
|
const sides = ["in", "out"];
|
|
7636
|
-
return /* @__PURE__ */ jsx10(
|
|
7408
|
+
return /* @__PURE__ */ jsx10(Fragment6, { children: sides.map((side) => {
|
|
7637
7409
|
const tangent = side === "in" ? keyframe.tangentIn : keyframe.tangentOut;
|
|
7638
7410
|
if (!tangent) return null;
|
|
7639
7411
|
const hx = scale.tickToX(keyframe.tick + tangent.x);
|
|
@@ -8273,7 +8045,7 @@ var viewportManifest = {
|
|
|
8273
8045
|
|
|
8274
8046
|
// src/edit/viewport/react/ViewportPanelView.tsx
|
|
8275
8047
|
import { useEffect as useEffect6, useRef as useRef7, useSyncExternalStore as useSyncExternalStore6 } from "react";
|
|
8276
|
-
import { Badge as
|
|
8048
|
+
import { Badge as Badge4, StatusBar as StatusBar4 } from "@xenosystem/components/chrome";
|
|
8277
8049
|
import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
8278
8050
|
var SLOT_STYLE = {
|
|
8279
8051
|
"top-left": { top: 8, left: 8 },
|
|
@@ -8383,11 +8155,11 @@ function ViewportPanelView({
|
|
|
8383
8155
|
fontSize: 11,
|
|
8384
8156
|
zIndex: 20
|
|
8385
8157
|
},
|
|
8386
|
-
children: /* @__PURE__ */ jsx11(
|
|
8158
|
+
children: /* @__PURE__ */ jsx11(Badge4, { tone: "error", children: "graphics context lost \u2014 restoring" })
|
|
8387
8159
|
}
|
|
8388
8160
|
) : null,
|
|
8389
8161
|
showStats && state.stats ? /* @__PURE__ */ jsx11("div", { style: { position: "absolute", left: 0, right: 0, bottom: 0, zIndex: 10 }, children: /* @__PURE__ */ jsx11(
|
|
8390
|
-
|
|
8162
|
+
StatusBar4,
|
|
8391
8163
|
{
|
|
8392
8164
|
left: state.stats.fps !== void 0 ? `${Math.round(state.stats.fps)} fps` : void 0,
|
|
8393
8165
|
right: state.surface ? `${state.surface.cssWidth}\xD7${state.surface.cssHeight} @${state.surface.dpr}\xD7` : void 0
|
|
@@ -9040,17 +8812,17 @@ var findManifest = {
|
|
|
9040
8812
|
// src/edit/find/react/FindPanelView.tsx
|
|
9041
8813
|
import { useSyncExternalStore as useSyncExternalStore7 } from "react";
|
|
9042
8814
|
import {
|
|
9043
|
-
Badge as
|
|
9044
|
-
EmptyState as
|
|
9045
|
-
IconButton as
|
|
9046
|
-
Row as
|
|
9047
|
-
RowList as
|
|
9048
|
-
ScrollArea as
|
|
9049
|
-
SearchField as
|
|
8815
|
+
Badge as Badge5,
|
|
8816
|
+
EmptyState as EmptyState5,
|
|
8817
|
+
IconButton as IconButton5,
|
|
8818
|
+
Row as Row3,
|
|
8819
|
+
RowList as RowList3,
|
|
8820
|
+
ScrollArea as ScrollArea4,
|
|
8821
|
+
SearchField as SearchField4,
|
|
9050
8822
|
Section as Section2,
|
|
9051
|
-
StatusBar as
|
|
8823
|
+
StatusBar as StatusBar5,
|
|
9052
8824
|
TextButton as TextButton2,
|
|
9053
|
-
Toolbar as
|
|
8825
|
+
Toolbar as Toolbar4,
|
|
9054
8826
|
ToolbarGroup as ToolbarGroup2
|
|
9055
8827
|
} from "@xenosystem/components/chrome";
|
|
9056
8828
|
import { jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
@@ -9092,12 +8864,12 @@ function StatusLine({
|
|
|
9092
8864
|
hasText
|
|
9093
8865
|
}) {
|
|
9094
8866
|
if (status === "invalidPattern") {
|
|
9095
|
-
return /* @__PURE__ */ jsx12(
|
|
8867
|
+
return /* @__PURE__ */ jsx12(Badge5, { tone: "error", title: message ?? void 0, children: "invalid pattern" });
|
|
9096
8868
|
}
|
|
9097
8869
|
if (status === "failed") {
|
|
9098
|
-
return /* @__PURE__ */ jsx12(
|
|
8870
|
+
return /* @__PURE__ */ jsx12(Badge5, { tone: "error", title: message ?? void 0, children: "search failed" });
|
|
9099
8871
|
}
|
|
9100
|
-
if (status === "searching") return /* @__PURE__ */ jsx12(
|
|
8872
|
+
if (status === "searching") return /* @__PURE__ */ jsx12(Badge5, { children: "searching\u2026" });
|
|
9101
8873
|
if (!hasText || status === "idle") return null;
|
|
9102
8874
|
return /* @__PURE__ */ jsxs11("span", { style: { fontVariantNumeric: "tabular-nums", fontSize: 10, opacity: 0.55 }, children: [
|
|
9103
8875
|
displayIndex,
|
|
@@ -9123,7 +8895,7 @@ function FindPanelView({
|
|
|
9123
8895
|
}
|
|
9124
8896
|
};
|
|
9125
8897
|
const renderMatch = (match, index) => /* @__PURE__ */ jsx12(
|
|
9126
|
-
|
|
8898
|
+
Row3,
|
|
9127
8899
|
{
|
|
9128
8900
|
noIcon: true,
|
|
9129
8901
|
selected: index === state.index,
|
|
@@ -9147,10 +8919,10 @@ function FindPanelView({
|
|
|
9147
8919
|
let flatIndex = -1;
|
|
9148
8920
|
return /* @__PURE__ */ jsxs11("div", { style: { display: "flex", flexDirection: "column", height: "100%", minHeight: 0 }, onKeyDown, children: [
|
|
9149
8921
|
/* @__PURE__ */ jsx12(
|
|
9150
|
-
|
|
8922
|
+
Toolbar4,
|
|
9151
8923
|
{
|
|
9152
8924
|
left: /* @__PURE__ */ jsx12(
|
|
9153
|
-
|
|
8925
|
+
SearchField4,
|
|
9154
8926
|
{
|
|
9155
8927
|
value: state.text,
|
|
9156
8928
|
onChange: (value) => controller.setText(value),
|
|
@@ -9159,7 +8931,7 @@ function FindPanelView({
|
|
|
9159
8931
|
),
|
|
9160
8932
|
right: /* @__PURE__ */ jsxs11(ToolbarGroup2, { end: true, children: [
|
|
9161
8933
|
/* @__PURE__ */ jsx12(
|
|
9162
|
-
|
|
8934
|
+
IconButton5,
|
|
9163
8935
|
{
|
|
9164
8936
|
label: "Match case",
|
|
9165
8937
|
active: state.options.caseSensitive,
|
|
@@ -9168,7 +8940,7 @@ function FindPanelView({
|
|
|
9168
8940
|
}
|
|
9169
8941
|
),
|
|
9170
8942
|
/* @__PURE__ */ jsx12(
|
|
9171
|
-
|
|
8943
|
+
IconButton5,
|
|
9172
8944
|
{
|
|
9173
8945
|
label: "Whole word",
|
|
9174
8946
|
active: state.options.wholeWord,
|
|
@@ -9177,7 +8949,7 @@ function FindPanelView({
|
|
|
9177
8949
|
}
|
|
9178
8950
|
),
|
|
9179
8951
|
/* @__PURE__ */ jsx12(
|
|
9180
|
-
|
|
8952
|
+
IconButton5,
|
|
9181
8953
|
{
|
|
9182
8954
|
label: "Regular expression",
|
|
9183
8955
|
active: state.options.regex,
|
|
@@ -9189,7 +8961,7 @@ function FindPanelView({
|
|
|
9189
8961
|
}
|
|
9190
8962
|
),
|
|
9191
8963
|
/* @__PURE__ */ jsx12(
|
|
9192
|
-
|
|
8964
|
+
Toolbar4,
|
|
9193
8965
|
{
|
|
9194
8966
|
divided: false,
|
|
9195
8967
|
left: /* @__PURE__ */ jsx12(
|
|
@@ -9205,7 +8977,7 @@ function FindPanelView({
|
|
|
9205
8977
|
),
|
|
9206
8978
|
right: /* @__PURE__ */ jsxs11(ToolbarGroup2, { end: true, children: [
|
|
9207
8979
|
/* @__PURE__ */ jsx12(
|
|
9208
|
-
|
|
8980
|
+
IconButton5,
|
|
9209
8981
|
{
|
|
9210
8982
|
label: "Previous match",
|
|
9211
8983
|
disabled: state.matches.length === 0,
|
|
@@ -9214,7 +8986,7 @@ function FindPanelView({
|
|
|
9214
8986
|
}
|
|
9215
8987
|
),
|
|
9216
8988
|
/* @__PURE__ */ jsx12(
|
|
9217
|
-
|
|
8989
|
+
IconButton5,
|
|
9218
8990
|
{
|
|
9219
8991
|
label: "Next match",
|
|
9220
8992
|
disabled: state.matches.length === 0,
|
|
@@ -9228,10 +9000,10 @@ function FindPanelView({
|
|
|
9228
9000
|
),
|
|
9229
9001
|
state.message && state.status === "invalidPattern" ? /* @__PURE__ */ jsx12("div", { style: { padding: "2px 8px 4px", fontSize: 9, opacity: 0.6 }, children: state.message }) : null,
|
|
9230
9002
|
state.replaceVisible ? /* @__PURE__ */ jsx12(
|
|
9231
|
-
|
|
9003
|
+
Toolbar4,
|
|
9232
9004
|
{
|
|
9233
9005
|
left: /* @__PURE__ */ jsx12(
|
|
9234
|
-
|
|
9006
|
+
SearchField4,
|
|
9235
9007
|
{
|
|
9236
9008
|
value: state.replaceText,
|
|
9237
9009
|
onChange: (value) => controller.setReplaceText(value),
|
|
@@ -9248,24 +9020,24 @@ function FindPanelView({
|
|
|
9248
9020
|
] })
|
|
9249
9021
|
}
|
|
9250
9022
|
) : null,
|
|
9251
|
-
showResults ? /* @__PURE__ */ jsx12(
|
|
9252
|
-
|
|
9023
|
+
showResults ? /* @__PURE__ */ jsx12(ScrollArea4, { children: state.status === "idle" ? /* @__PURE__ */ jsx12(EmptyState5, { title: "Find", hint: "Type to search. Enter goes to the next match." }) : state.status === "invalidPattern" ? /* @__PURE__ */ jsx12(
|
|
9024
|
+
EmptyState5,
|
|
9253
9025
|
{
|
|
9254
9026
|
title: "Invalid pattern",
|
|
9255
9027
|
hint: state.message ?? "The expression could not be read. Fix it to search."
|
|
9256
9028
|
}
|
|
9257
|
-
) : state.status === "failed" ? /* @__PURE__ */ jsx12(
|
|
9029
|
+
) : state.status === "failed" ? /* @__PURE__ */ jsx12(EmptyState5, { title: "Search failed", hint: state.message ?? "The host could not complete the search." }) : state.noResults ? /* @__PURE__ */ jsx12(EmptyState5, { title: "No matches", hint: `Nothing in scope matches \u201C${state.text}\u201D.` }) : state.groups.length === 1 && state.groups[0].id === "" ? /* @__PURE__ */ jsx12(RowList3, { children: state.matches.map((m) => renderMatch(m, ++flatIndex)) }) : state.groups.map((group) => /* @__PURE__ */ jsx12(
|
|
9258
9030
|
Section2,
|
|
9259
9031
|
{
|
|
9260
9032
|
title: group.label || "Results",
|
|
9261
9033
|
flush: true,
|
|
9262
|
-
badge: /* @__PURE__ */ jsx12(
|
|
9263
|
-
children: /* @__PURE__ */ jsx12(
|
|
9034
|
+
badge: /* @__PURE__ */ jsx12(Badge5, { children: group.matches.length }),
|
|
9035
|
+
children: /* @__PURE__ */ jsx12(RowList3, { children: group.matches.map((m) => renderMatch(m, ++flatIndex)) })
|
|
9264
9036
|
},
|
|
9265
9037
|
group.id
|
|
9266
9038
|
)) }) : null,
|
|
9267
9039
|
/* @__PURE__ */ jsx12(
|
|
9268
|
-
|
|
9040
|
+
StatusBar5,
|
|
9269
9041
|
{
|
|
9270
9042
|
left: state.truncated ? `showing first ${state.matches.length}` : void 0,
|
|
9271
9043
|
right: state.options.scope
|
|
@@ -9915,17 +9687,17 @@ var commentsManifest = {
|
|
|
9915
9687
|
// src/edit/comments/react/CommentsPanelView.tsx
|
|
9916
9688
|
import { useSyncExternalStore as useSyncExternalStore8 } from "react";
|
|
9917
9689
|
import {
|
|
9918
|
-
Badge as
|
|
9919
|
-
EmptyState as
|
|
9920
|
-
ScrollArea as
|
|
9690
|
+
Badge as Badge6,
|
|
9691
|
+
EmptyState as EmptyState6,
|
|
9692
|
+
ScrollArea as ScrollArea5,
|
|
9921
9693
|
Section as Section3,
|
|
9922
9694
|
SegmentedControl as SegmentedControl2,
|
|
9923
|
-
StatusBar as
|
|
9695
|
+
StatusBar as StatusBar6,
|
|
9924
9696
|
TextButton as TextButton3,
|
|
9925
|
-
Toolbar as
|
|
9697
|
+
Toolbar as Toolbar5,
|
|
9926
9698
|
ToolbarGroup as ToolbarGroup3
|
|
9927
9699
|
} from "@xenosystem/components/chrome";
|
|
9928
|
-
import { Fragment as
|
|
9700
|
+
import { Fragment as Fragment7, jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
9929
9701
|
var ANCHOR_BADGE = {
|
|
9930
9702
|
live: null,
|
|
9931
9703
|
stale: {
|
|
@@ -9965,8 +9737,8 @@ function ThreadCard({
|
|
|
9965
9737
|
},
|
|
9966
9738
|
children: /* @__PURE__ */ jsxs12("div", { style: { padding: "6px 8px", display: "flex", flexDirection: "column", gap: 4 }, children: [
|
|
9967
9739
|
/* @__PURE__ */ jsxs12("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
|
|
9968
|
-
badge ? /* @__PURE__ */ jsx13(
|
|
9969
|
-
thread.resolved ? /* @__PURE__ */ jsx13(
|
|
9740
|
+
badge ? /* @__PURE__ */ jsx13(Badge6, { tone: badge.tone, title: badge.title, children: badge.label }) : null,
|
|
9741
|
+
thread.resolved ? /* @__PURE__ */ jsx13(Badge6, { children: "resolved" }) : null,
|
|
9970
9742
|
/* @__PURE__ */ jsx13("span", { style: { marginLeft: "auto", fontSize: 9, opacity: 0.4 }, children: formatAge(thread.createdAt, now) })
|
|
9971
9743
|
] }),
|
|
9972
9744
|
thread.anchorLabel ? /* @__PURE__ */ jsx13(
|
|
@@ -10066,7 +9838,7 @@ function CommentsPanelView({
|
|
|
10066
9838
|
const resolved = state.threads.filter((t) => t.thread.resolved);
|
|
10067
9839
|
return /* @__PURE__ */ jsxs12("div", { style: { display: "flex", flexDirection: "column", height: "100%", minHeight: 0 }, children: [
|
|
10068
9840
|
/* @__PURE__ */ jsx13(
|
|
10069
|
-
|
|
9841
|
+
Toolbar5,
|
|
10070
9842
|
{
|
|
10071
9843
|
left: /* @__PURE__ */ jsx13(
|
|
10072
9844
|
SegmentedControl2,
|
|
@@ -10105,23 +9877,23 @@ function CommentsPanelView({
|
|
|
10105
9877
|
" about.",
|
|
10106
9878
|
state.filter.includeOrphaned === false ? /* @__PURE__ */ jsx13(TextButton3, { onClick: () => controller.setFilter({ includeOrphaned: true }), children: "Show" }) : null
|
|
10107
9879
|
] }) : null,
|
|
10108
|
-
/* @__PURE__ */ jsx13(
|
|
9880
|
+
/* @__PURE__ */ jsx13(ScrollArea5, { children: state.threads.length === 0 ? state.filteredEmpty ? (
|
|
10109
9881
|
// NOT "no comments". There are comments; this filter hides them, and telling a
|
|
10110
9882
|
// reviewer their feedback is gone is worse than telling them nothing.
|
|
10111
9883
|
/* @__PURE__ */ jsx13(
|
|
10112
|
-
|
|
9884
|
+
EmptyState6,
|
|
10113
9885
|
{
|
|
10114
9886
|
title: "Nothing matches this filter",
|
|
10115
9887
|
hint: `${state.totals.all} comment${state.totals.all === 1 ? "" : "s"} on this document.`
|
|
10116
9888
|
}
|
|
10117
9889
|
)
|
|
10118
9890
|
) : /* @__PURE__ */ jsx13(
|
|
10119
|
-
|
|
9891
|
+
EmptyState6,
|
|
10120
9892
|
{
|
|
10121
9893
|
title: "No comments",
|
|
10122
9894
|
hint: emptyHint ?? "Select something and add a comment."
|
|
10123
9895
|
}
|
|
10124
|
-
) : /* @__PURE__ */ jsxs12(
|
|
9896
|
+
) : /* @__PURE__ */ jsxs12(Fragment7, { children: [
|
|
10125
9897
|
open.map((view) => /* @__PURE__ */ jsx13(
|
|
10126
9898
|
ThreadCard,
|
|
10127
9899
|
{
|
|
@@ -10183,7 +9955,7 @@ function CommentsPanelView({
|
|
|
10183
9955
|
) })
|
|
10184
9956
|
] }),
|
|
10185
9957
|
/* @__PURE__ */ jsx13(
|
|
10186
|
-
|
|
9958
|
+
StatusBar6,
|
|
10187
9959
|
{
|
|
10188
9960
|
left: `${state.totals.open} open`,
|
|
10189
9961
|
right: state.totals.stale > 0 ? `${state.totals.stale} edited` : void 0
|
|
@@ -11355,8 +11127,8 @@ var nodegraphManifest = {
|
|
|
11355
11127
|
|
|
11356
11128
|
// src/edit/nodegraph/react/NodeGraphPanelView.tsx
|
|
11357
11129
|
import { useCallback as useCallback7, useEffect as useEffect7, useRef as useRef8, useSyncExternalStore as useSyncExternalStore9 } from "react";
|
|
11358
|
-
import { EmptyState as
|
|
11359
|
-
import { Fragment as
|
|
11130
|
+
import { EmptyState as EmptyState7, StatusBar as StatusBar7, Toolbar as Toolbar6, ToolbarGroup as ToolbarGroup4 } from "@xenosystem/components/chrome";
|
|
11131
|
+
import { Fragment as Fragment8, jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
11360
11132
|
var HEADER_H2 = 24;
|
|
11361
11133
|
var PORT_ROW_H2 = 18;
|
|
11362
11134
|
function NodeGraphPanelView({ controller }) {
|
|
@@ -11437,7 +11209,7 @@ function NodeGraphPanelView({ controller }) {
|
|
|
11437
11209
|
const total = state.graph?.nodes.length ?? 0;
|
|
11438
11210
|
return /* @__PURE__ */ jsxs13("div", { style: SHELL2, children: [
|
|
11439
11211
|
/* @__PURE__ */ jsx14(
|
|
11440
|
-
|
|
11212
|
+
Toolbar6,
|
|
11441
11213
|
{
|
|
11442
11214
|
right: /* @__PURE__ */ jsxs13(ToolbarGroup4, { end: true, children: [
|
|
11443
11215
|
/* @__PURE__ */ jsx14("button", { type: "button", style: button2(), onClick: () => controller.fit(false), children: "Fit" }),
|
|
@@ -11445,7 +11217,7 @@ function NodeGraphPanelView({ controller }) {
|
|
|
11445
11217
|
] })
|
|
11446
11218
|
}
|
|
11447
11219
|
),
|
|
11448
|
-
total === 0 ? /* @__PURE__ */ jsx14(
|
|
11220
|
+
total === 0 ? /* @__PURE__ */ jsx14(EmptyState7, { title: "Empty graph", hint: "Wire a host graph into this panel's input." }) : /* @__PURE__ */ jsxs13(
|
|
11449
11221
|
"div",
|
|
11450
11222
|
{
|
|
11451
11223
|
ref: containerRef,
|
|
@@ -11509,7 +11281,7 @@ function NodeGraphPanelView({ controller }) {
|
|
|
11509
11281
|
}
|
|
11510
11282
|
),
|
|
11511
11283
|
/* @__PURE__ */ jsx14(
|
|
11512
|
-
|
|
11284
|
+
StatusBar7,
|
|
11513
11285
|
{
|
|
11514
11286
|
left: `${total} node${total === 1 ? "" : "s"}`,
|
|
11515
11287
|
right: /* @__PURE__ */ jsxs13("span", { className: "tabular-nums", children: [
|
|
@@ -11579,7 +11351,7 @@ function NodeRect({ node, selected, zoom }) {
|
|
|
11579
11351
|
children: node.title
|
|
11580
11352
|
}
|
|
11581
11353
|
),
|
|
11582
|
-
node.collapsed ? null : /* @__PURE__ */ jsxs13(
|
|
11354
|
+
node.collapsed ? null : /* @__PURE__ */ jsxs13(Fragment8, { children: [
|
|
11583
11355
|
node.inputs.map((port, i) => /* @__PURE__ */ jsx14(
|
|
11584
11356
|
Port,
|
|
11585
11357
|
{
|
|
@@ -12884,22 +12656,22 @@ var treeManifest = {
|
|
|
12884
12656
|
// src/edit/tree/react/TreePanelView.tsx
|
|
12885
12657
|
import { useCallback as useCallback8, useEffect as useEffect8, useRef as useRef9, useState as useState2, useSyncExternalStore as useSyncExternalStore10 } from "react";
|
|
12886
12658
|
import {
|
|
12887
|
-
Badge as
|
|
12888
|
-
EmptyState as
|
|
12659
|
+
Badge as Badge7,
|
|
12660
|
+
EmptyState as EmptyState8,
|
|
12889
12661
|
ErrorState,
|
|
12890
|
-
IconButton as
|
|
12662
|
+
IconButton as IconButton6,
|
|
12891
12663
|
LoadingState,
|
|
12892
|
-
Row as
|
|
12893
|
-
ScrollArea as
|
|
12894
|
-
SearchField as
|
|
12895
|
-
StatusBar as
|
|
12896
|
-
Toolbar as
|
|
12664
|
+
Row as Row4,
|
|
12665
|
+
ScrollArea as ScrollArea6,
|
|
12666
|
+
SearchField as SearchField5,
|
|
12667
|
+
StatusBar as StatusBar8,
|
|
12668
|
+
Toolbar as Toolbar7,
|
|
12897
12669
|
ToolbarGroup as ToolbarGroup5
|
|
12898
12670
|
} from "@xenosystem/components/chrome";
|
|
12899
12671
|
import { computeWindow as computeWindow3 } from "@xenosystem/tree-core";
|
|
12900
12672
|
|
|
12901
12673
|
// src/edit/tree/react/icons.tsx
|
|
12902
|
-
import { Fragment as
|
|
12674
|
+
import { Fragment as Fragment9, jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
12903
12675
|
function Svg({ children, size = 11 }) {
|
|
12904
12676
|
return /* @__PURE__ */ jsx15(
|
|
12905
12677
|
"svg",
|
|
@@ -12952,37 +12724,37 @@ function RefreshGlyph() {
|
|
|
12952
12724
|
}
|
|
12953
12725
|
var PATHS = {
|
|
12954
12726
|
folder: /* @__PURE__ */ jsx15("path", { d: "M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z" }),
|
|
12955
|
-
file: /* @__PURE__ */ jsxs14(
|
|
12727
|
+
file: /* @__PURE__ */ jsxs14(Fragment9, { children: [
|
|
12956
12728
|
/* @__PURE__ */ jsx15("path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z" }),
|
|
12957
12729
|
/* @__PURE__ */ jsx15("path", { d: "M14 2v4a2 2 0 0 0 2 2h4" })
|
|
12958
12730
|
] }),
|
|
12959
|
-
"folder-tree": /* @__PURE__ */ jsxs14(
|
|
12731
|
+
"folder-tree": /* @__PURE__ */ jsxs14(Fragment9, { children: [
|
|
12960
12732
|
/* @__PURE__ */ jsx15("path", { d: "M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z" }),
|
|
12961
12733
|
/* @__PURE__ */ jsx15("path", { d: "M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2a1 1 0 0 0-.8-.4h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z" }),
|
|
12962
12734
|
/* @__PURE__ */ jsx15("path", { d: "M3 5a2 2 0 0 0 2 2h3" }),
|
|
12963
12735
|
/* @__PURE__ */ jsx15("path", { d: "M3 3v13a2 2 0 0 0 2 2h3" })
|
|
12964
12736
|
] }),
|
|
12965
|
-
box: /* @__PURE__ */ jsxs14(
|
|
12737
|
+
box: /* @__PURE__ */ jsxs14(Fragment9, { children: [
|
|
12966
12738
|
/* @__PURE__ */ jsx15("path", { d: "M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z" }),
|
|
12967
12739
|
/* @__PURE__ */ jsx15("path", { d: "m3.3 7 8.7 5 8.7-5" }),
|
|
12968
12740
|
/* @__PURE__ */ jsx15("path", { d: "M12 22V12" })
|
|
12969
12741
|
] }),
|
|
12970
12742
|
component: /* @__PURE__ */ jsx15("path", { d: "m12 2 4 4-4 4-4-4Zm0 12 4 4-4 4-4-4ZM2 12l4-4 4 4-4 4Zm12 0 4-4 4 4-4 4Z" }),
|
|
12971
|
-
"file-text": /* @__PURE__ */ jsxs14(
|
|
12743
|
+
"file-text": /* @__PURE__ */ jsxs14(Fragment9, { children: [
|
|
12972
12744
|
/* @__PURE__ */ jsx15("path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z" }),
|
|
12973
12745
|
/* @__PURE__ */ jsx15("path", { d: "M14 2v4a2 2 0 0 0 2 2h4" }),
|
|
12974
12746
|
/* @__PURE__ */ jsx15("path", { d: "M8 13h8M8 17h5" })
|
|
12975
12747
|
] }),
|
|
12976
|
-
heading: /* @__PURE__ */ jsx15(
|
|
12977
|
-
bot: /* @__PURE__ */ jsxs14(
|
|
12748
|
+
heading: /* @__PURE__ */ jsx15(Fragment9, { children: /* @__PURE__ */ jsx15("path", { d: "M6 4v16M18 4v16M6 12h12" }) }),
|
|
12749
|
+
bot: /* @__PURE__ */ jsxs14(Fragment9, { children: [
|
|
12978
12750
|
/* @__PURE__ */ jsx15("rect", { x: "3", y: "8", width: "18", height: "12", rx: "2" }),
|
|
12979
12751
|
/* @__PURE__ */ jsx15("path", { d: "M12 4v4M8 14h.01M16 14h.01" })
|
|
12980
12752
|
] }),
|
|
12981
|
-
link: /* @__PURE__ */ jsxs14(
|
|
12753
|
+
link: /* @__PURE__ */ jsxs14(Fragment9, { children: [
|
|
12982
12754
|
/* @__PURE__ */ jsx15("path", { d: "M10 13a5 5 0 0 0 7.5.5l3-3a5 5 0 0 0-7-7l-1.8 1.7" }),
|
|
12983
12755
|
/* @__PURE__ */ jsx15("path", { d: "M14 11a5 5 0 0 0-7.5-.5l-3 3a5 5 0 0 0 7 7l1.8-1.7" })
|
|
12984
12756
|
] }),
|
|
12985
|
-
"link-2-off": /* @__PURE__ */ jsxs14(
|
|
12757
|
+
"link-2-off": /* @__PURE__ */ jsxs14(Fragment9, { children: [
|
|
12986
12758
|
/* @__PURE__ */ jsx15("path", { d: "M9 17H7A5 5 0 0 1 7 7" }),
|
|
12987
12759
|
/* @__PURE__ */ jsx15("path", { d: "M15 7h2a5 5 0 0 1 4 8" }),
|
|
12988
12760
|
/* @__PURE__ */ jsx15("path", { d: "M8 12h4" }),
|
|
@@ -12995,7 +12767,7 @@ function TreeIcon({ name, size = 11 }) {
|
|
|
12995
12767
|
}
|
|
12996
12768
|
|
|
12997
12769
|
// src/edit/tree/react/TreePanelView.tsx
|
|
12998
|
-
import { Fragment as
|
|
12770
|
+
import { Fragment as Fragment10, jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
12999
12771
|
function TreePanelView({
|
|
13000
12772
|
controller,
|
|
13001
12773
|
rowHeight = 24,
|
|
@@ -13027,7 +12799,7 @@ function TreePanelView({
|
|
|
13027
12799
|
const sourceState = source?.sourceState ?? "idle";
|
|
13028
12800
|
const body = (() => {
|
|
13029
12801
|
if (!source || sourceState === "idle") {
|
|
13030
|
-
return /* @__PURE__ */ jsx16(
|
|
12802
|
+
return /* @__PURE__ */ jsx16(EmptyState8, { title: "No source", hint: emptyHint ?? "Connect a source to browse it." });
|
|
13031
12803
|
}
|
|
13032
12804
|
if (sourceState === "loading" && state.rows.length === 0) {
|
|
13033
12805
|
return /* @__PURE__ */ jsx16(LoadingState, { label: source.sourceMessage ?? "Loading\u2026" });
|
|
@@ -13044,8 +12816,8 @@ function TreePanelView({
|
|
|
13044
12816
|
);
|
|
13045
12817
|
}
|
|
13046
12818
|
if (state.rows.length === 0) {
|
|
13047
|
-
return state.filter ? /* @__PURE__ */ jsx16(
|
|
13048
|
-
|
|
12819
|
+
return state.filter ? /* @__PURE__ */ jsx16(EmptyState8, { title: "No matches", hint: `Nothing matches \u201C${state.filter}\u201D.` }) : /* @__PURE__ */ jsx16(
|
|
12820
|
+
EmptyState8,
|
|
13049
12821
|
{
|
|
13050
12822
|
title: "Nothing here",
|
|
13051
12823
|
hint: emptyHint ?? source.sourceMessage ?? "This source has no items yet."
|
|
@@ -13060,7 +12832,7 @@ function TreePanelView({
|
|
|
13060
12832
|
overscan
|
|
13061
12833
|
});
|
|
13062
12834
|
const slice = state.rows.slice(window2.startIndex, window2.endIndex);
|
|
13063
|
-
return /* @__PURE__ */ jsx16(
|
|
12835
|
+
return /* @__PURE__ */ jsx16(ScrollArea6, { children: /* @__PURE__ */ jsx16(
|
|
13064
12836
|
"div",
|
|
13065
12837
|
{
|
|
13066
12838
|
ref: scrollRef,
|
|
@@ -13092,10 +12864,10 @@ function TreePanelView({
|
|
|
13092
12864
|
})();
|
|
13093
12865
|
return /* @__PURE__ */ jsxs15("div", { style: { display: "flex", flexDirection: "column", height: "100%", minHeight: 0 }, children: [
|
|
13094
12866
|
/* @__PURE__ */ jsx16(
|
|
13095
|
-
|
|
12867
|
+
Toolbar7,
|
|
13096
12868
|
{
|
|
13097
12869
|
left: showSearch ? /* @__PURE__ */ jsx16(
|
|
13098
|
-
|
|
12870
|
+
SearchField5,
|
|
13099
12871
|
{
|
|
13100
12872
|
value: state.filter,
|
|
13101
12873
|
onChange: (term) => controller.setFilter(term),
|
|
@@ -13103,22 +12875,22 @@ function TreePanelView({
|
|
|
13103
12875
|
}
|
|
13104
12876
|
) : void 0,
|
|
13105
12877
|
right: /* @__PURE__ */ jsxs15(ToolbarGroup5, { end: true, children: [
|
|
13106
|
-
/* @__PURE__ */ jsx16(
|
|
12878
|
+
/* @__PURE__ */ jsx16(IconButton6, { icon: /* @__PURE__ */ jsx16(ExpandGlyph, {}), label: "Expand all", onClick: () => controller.expandAll() }),
|
|
13107
12879
|
/* @__PURE__ */ jsx16(
|
|
13108
|
-
|
|
12880
|
+
IconButton6,
|
|
13109
12881
|
{
|
|
13110
12882
|
icon: /* @__PURE__ */ jsx16(CollapseGlyph, {}),
|
|
13111
12883
|
label: "Collapse all",
|
|
13112
12884
|
onClick: () => controller.collapseAll()
|
|
13113
12885
|
}
|
|
13114
12886
|
),
|
|
13115
|
-
/* @__PURE__ */ jsx16(
|
|
12887
|
+
/* @__PURE__ */ jsx16(IconButton6, { icon: /* @__PURE__ */ jsx16(RefreshGlyph, {}), label: "Refresh", onClick: () => controller.refresh() })
|
|
13116
12888
|
] })
|
|
13117
12889
|
}
|
|
13118
12890
|
),
|
|
13119
12891
|
body,
|
|
13120
12892
|
/* @__PURE__ */ jsx16(
|
|
13121
|
-
|
|
12893
|
+
StatusBar8,
|
|
13122
12894
|
{
|
|
13123
12895
|
left: `${state.rows.length} item${state.rows.length === 1 ? "" : "s"}`,
|
|
13124
12896
|
right: state.selection.length > 0 ? `${state.selection.length} selected` : void 0
|
|
@@ -13177,7 +12949,7 @@ function TreeRowView({
|
|
|
13177
12949
|
},
|
|
13178
12950
|
title: drop?.reason,
|
|
13179
12951
|
children: /* @__PURE__ */ jsx16(
|
|
13180
|
-
|
|
12952
|
+
Row4,
|
|
13181
12953
|
{
|
|
13182
12954
|
role: "treeitem",
|
|
13183
12955
|
"aria-expanded": row.container ? row.expanded : void 0,
|
|
@@ -13212,7 +12984,7 @@ function TreeRowView({
|
|
|
13212
12984
|
onPointerUp: () => {
|
|
13213
12985
|
if (state.drag) controller.endDrag();
|
|
13214
12986
|
},
|
|
13215
|
-
icon: /* @__PURE__ */ jsxs15(
|
|
12987
|
+
icon: /* @__PURE__ */ jsxs15(Fragment10, { children: [
|
|
13216
12988
|
twisty,
|
|
13217
12989
|
/* @__PURE__ */ jsx16(NodeIcon, { icon: node.icon ?? defaultIconFor(node.kind) })
|
|
13218
12990
|
] }),
|
|
@@ -13242,15 +13014,15 @@ function TreeRowView({
|
|
|
13242
13014
|
}
|
|
13243
13015
|
) : node.label,
|
|
13244
13016
|
meta: /* @__PURE__ */ jsx16(ChildStateChip, { row, controller }),
|
|
13245
|
-
trailing: /* @__PURE__ */ jsxs15(
|
|
13017
|
+
trailing: /* @__PURE__ */ jsxs15(Fragment10, { children: [
|
|
13246
13018
|
columns?.map((columnId) => /* @__PURE__ */ jsx16("span", { style: { opacity: 0.7, fontVariantNumeric: "tabular-nums" }, children: node.columns?.[columnId] ?? "" }, columnId)),
|
|
13247
13019
|
node.glyphs?.map((glyph) => /* @__PURE__ */ jsx16("span", { title: glyph.title, style: { display: "flex", opacity: 0.7 }, children: /* @__PURE__ */ jsx16(NodeIcon, { icon: glyph.icon }) }, glyph.id)),
|
|
13248
13020
|
node.badges?.map((badge) => (
|
|
13249
13021
|
// Opaque: the host formatted the text, the panel only places it.
|
|
13250
|
-
/* @__PURE__ */ jsx16(
|
|
13022
|
+
/* @__PURE__ */ jsx16(Badge7, { tone: badge.tone, className: badge.title ? void 0 : void 0, children: badge.text }, badge.id)
|
|
13251
13023
|
)),
|
|
13252
13024
|
node.actions?.map((action) => /* @__PURE__ */ jsx16(
|
|
13253
|
-
|
|
13025
|
+
IconButton6,
|
|
13254
13026
|
{
|
|
13255
13027
|
size: "sm",
|
|
13256
13028
|
icon: /* @__PURE__ */ jsx16(NodeIcon, { icon: action.icon }),
|
|
@@ -13276,7 +13048,7 @@ function ChildStateChip({
|
|
|
13276
13048
|
}
|
|
13277
13049
|
if (row.childState === "error") {
|
|
13278
13050
|
const error = row.node.error;
|
|
13279
|
-
return /* @__PURE__ */ jsx16(
|
|
13051
|
+
return /* @__PURE__ */ jsx16(Badge7, { tone: "error", children: error?.code === "denied" ? "no access" : error?.code ?? "failed" });
|
|
13280
13052
|
}
|
|
13281
13053
|
if (row.node.hasMore && row.expanded) {
|
|
13282
13054
|
return /* @__PURE__ */ jsx16(
|
|
@@ -13293,7 +13065,7 @@ function ChildStateChip({
|
|
|
13293
13065
|
);
|
|
13294
13066
|
}
|
|
13295
13067
|
if (row.node.truncatedAt !== void 0) {
|
|
13296
|
-
return /* @__PURE__ */ jsx16(
|
|
13068
|
+
return /* @__PURE__ */ jsx16(Badge7, { tone: "warning", children: `first ${row.node.truncatedAt}` });
|
|
13297
13069
|
}
|
|
13298
13070
|
if (row.expanded && isEmptyContainer(row.node)) {
|
|
13299
13071
|
return /* @__PURE__ */ jsx16("span", { style: { opacity: 0.4, fontSize: 9 }, children: "empty" });
|