@xenosystem/blocks 0.12.9 → 0.13.1
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/chunk-BP4EYOCQ.js +109 -0
- package/dist/chunk-GQWAIPDF.js +125 -0
- package/dist/chunk-J5XEAON6.js +279 -0
- package/dist/data/index.js +169 -295
- package/dist/edit/index.d.ts +4 -4
- package/dist/edit/index.js +405 -708
- package/dist/icons/index.d.ts +41 -0
- package/dist/icons/index.js +116 -0
- package/dist/ops/index.js +140 -199
- package/dist/time/index.d.ts +2 -1
- package/dist/time/index.js +109 -205
- package/package.json +5 -1
package/dist/edit/index.js
CHANGED
|
@@ -1,3 +1,31 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DiamondIcon,
|
|
3
|
+
EntryIcon,
|
|
4
|
+
EyedropperIcon,
|
|
5
|
+
KindGlyph,
|
|
6
|
+
LinkIcon,
|
|
7
|
+
LockStateIcon,
|
|
8
|
+
NextIcon,
|
|
9
|
+
PendingGlyph,
|
|
10
|
+
PrevIcon,
|
|
11
|
+
RedoIcon,
|
|
12
|
+
ResetIcon,
|
|
13
|
+
StopwatchIcon,
|
|
14
|
+
SwapIcon,
|
|
15
|
+
TrashIcon,
|
|
16
|
+
TreeIcon,
|
|
17
|
+
UndoIcon,
|
|
18
|
+
VisibilityIcon,
|
|
19
|
+
XIcon,
|
|
20
|
+
XIcon2
|
|
21
|
+
} from "../chunk-J5XEAON6.js";
|
|
22
|
+
import {
|
|
23
|
+
CaseGlyph,
|
|
24
|
+
ChevronGlyph,
|
|
25
|
+
CollapseGlyph,
|
|
26
|
+
ExpandGlyph,
|
|
27
|
+
RefreshGlyph
|
|
28
|
+
} from "../chunk-GQWAIPDF.js";
|
|
1
29
|
import "../chunk-2KG3PWR4.js";
|
|
2
30
|
|
|
3
31
|
// src/edit/layers/panel.ts
|
|
@@ -1338,7 +1366,7 @@ var LAYERS_DECLARATION = {
|
|
|
1338
1366
|
component: "fragment",
|
|
1339
1367
|
children: [
|
|
1340
1368
|
{ component: "layers/Thumbnail", when: { item: "hasThumbnail" }, props: { thumbnailKey: { item: "thumbnailKey" }, size: { input: "view.thumbnailSize" } } },
|
|
1341
|
-
{ component: "
|
|
1369
|
+
{ component: "icons/Kind", when: { item: "noThumbnail" } }
|
|
1342
1370
|
]
|
|
1343
1371
|
}
|
|
1344
1372
|
},
|
|
@@ -1346,8 +1374,8 @@ var LAYERS_DECLARATION = {
|
|
|
1346
1374
|
node: {
|
|
1347
1375
|
component: "fragment",
|
|
1348
1376
|
children: [
|
|
1349
|
-
{ component: "chrome/IconButton", when: { item: "showVisibility" }, props: { size: { value: "sm" }, icon: { node: { component: "
|
|
1350
|
-
{ component: "chrome/IconButton", when: { item: "showLock" }, props: { size: { value: "sm" }, icon: { node: { component: "
|
|
1377
|
+
{ component: "chrome/IconButton", when: { item: "showVisibility" }, props: { size: { value: "sm" }, icon: { node: { component: "icons/Visibility", props: { open: { item: "visible" } } } }, label: { item: "visibilityLabel" }, active: { item: "visible" } }, on: { onClick: toggle("visible") } },
|
|
1378
|
+
{ component: "chrome/IconButton", when: { item: "showLock" }, props: { size: { value: "sm" }, icon: { node: { component: "icons/LockState", props: { locked: { item: "locked" } } } }, label: { item: "lockLabel" }, active: { item: "locked" } }, on: { onClick: toggle("locked") } },
|
|
1351
1379
|
{ component: "chrome/ChipToggle", when: { item: "showSolo" }, props: { glyph: { value: "S" }, label: { value: "Solo" }, on: { item: "solo" } }, on: { onChange: toggle("solo") } },
|
|
1352
1380
|
{ component: "chrome/ChipToggle", when: { item: "showMute" }, props: { glyph: { value: "M" }, label: { value: "Mute" }, on: { item: "muted" } }, on: { onChange: toggle("muted") } },
|
|
1353
1381
|
{ component: "chrome/ChipToggle", when: { item: "showArm" }, props: { glyph: { value: "R" }, label: { value: "Arm" }, on: { item: "armed" } }, on: { onChange: toggle("armed") } },
|
|
@@ -1401,57 +1429,9 @@ var LAYERS_DECLARATION = {
|
|
|
1401
1429
|
// src/edit/layers/react/LayersPanelView.tsx
|
|
1402
1430
|
import { Badge, ChipToggle, ColorTag, Column, EmptyState, IconButton, Input, RowList, Row, ScrollArea, SearchField, StatusBar, Text, Toolbar, VirtualWindow } from "@xenosystem/components/chrome";
|
|
1403
1431
|
|
|
1404
|
-
// src/edit/layers/react/icons.tsx
|
|
1405
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
1406
|
-
var base = (size) => ({
|
|
1407
|
-
width: size,
|
|
1408
|
-
height: size,
|
|
1409
|
-
viewBox: "0 0 24 24",
|
|
1410
|
-
fill: "none",
|
|
1411
|
-
stroke: "currentColor",
|
|
1412
|
-
strokeWidth: 1.5,
|
|
1413
|
-
strokeLinecap: "round",
|
|
1414
|
-
strokeLinejoin: "round",
|
|
1415
|
-
"aria-hidden": true
|
|
1416
|
-
});
|
|
1417
|
-
function EyeIcon({ size = 12, className }) {
|
|
1418
|
-
return /* @__PURE__ */ jsxs("svg", { ...base(size), className, children: [
|
|
1419
|
-
/* @__PURE__ */ jsx("path", { d: "M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7Z" }),
|
|
1420
|
-
/* @__PURE__ */ jsx("path", { d: "M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z" })
|
|
1421
|
-
] });
|
|
1422
|
-
}
|
|
1423
|
-
function EyeOffIcon({ size = 12, className }) {
|
|
1424
|
-
return /* @__PURE__ */ jsxs("svg", { ...base(size), className, children: [
|
|
1425
|
-
/* @__PURE__ */ jsx("path", { d: "M10.7 5.1A11 11 0 0 1 12 5c6.5 0 10 7 10 7a18 18 0 0 1-2.4 3.4M6.6 6.6A18 18 0 0 0 2 12s3.5 7 10 7a10.9 10.9 0 0 0 5.4-1.4" }),
|
|
1426
|
-
/* @__PURE__ */ jsx("path", { d: "M14.1 14.1a3 3 0 1 1-4.2-4.2" }),
|
|
1427
|
-
/* @__PURE__ */ jsx("path", { d: "m2 2 20 20" })
|
|
1428
|
-
] });
|
|
1429
|
-
}
|
|
1430
|
-
function LockIcon({ size = 12, className }) {
|
|
1431
|
-
return /* @__PURE__ */ jsxs("svg", { ...base(size), className, children: [
|
|
1432
|
-
/* @__PURE__ */ jsx("rect", { width: "14", height: "10", x: "5", y: "11", rx: "2" }),
|
|
1433
|
-
/* @__PURE__ */ jsx("path", { d: "M8 11V7a4 4 0 0 1 8 0v4" })
|
|
1434
|
-
] });
|
|
1435
|
-
}
|
|
1436
|
-
function UnlockIcon({ size = 12, className }) {
|
|
1437
|
-
return /* @__PURE__ */ jsxs("svg", { ...base(size), className, children: [
|
|
1438
|
-
/* @__PURE__ */ jsx("rect", { width: "14", height: "10", x: "5", y: "11", rx: "2" }),
|
|
1439
|
-
/* @__PURE__ */ jsx("path", { d: "M8 11V7a4 4 0 0 1 7.5-2" })
|
|
1440
|
-
] });
|
|
1441
|
-
}
|
|
1442
|
-
function KindGlyph({ size = 10 }) {
|
|
1443
|
-
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" }) });
|
|
1444
|
-
}
|
|
1445
|
-
function VisibilityIcon({ open, size }) {
|
|
1446
|
-
return open ? /* @__PURE__ */ jsx(EyeIcon, { size }) : /* @__PURE__ */ jsx(EyeOffIcon, { size });
|
|
1447
|
-
}
|
|
1448
|
-
function LockStateIcon({ locked, size }) {
|
|
1449
|
-
return locked ? /* @__PURE__ */ jsx(LockIcon, { size }) : /* @__PURE__ */ jsx(UnlockIcon, { size });
|
|
1450
|
-
}
|
|
1451
|
-
|
|
1452
1432
|
// src/edit/layers/react/Thumbnail.tsx
|
|
1453
1433
|
import { useEffect, useRef } from "react";
|
|
1454
|
-
import { jsx
|
|
1434
|
+
import { jsx } from "react/jsx-runtime";
|
|
1455
1435
|
function Thumbnail({ size, data }) {
|
|
1456
1436
|
const ref = useRef(null);
|
|
1457
1437
|
useEffect(() => {
|
|
@@ -1486,7 +1466,7 @@ function Thumbnail({ size, data }) {
|
|
|
1486
1466
|
img.src = data.dataURL;
|
|
1487
1467
|
}
|
|
1488
1468
|
}, [data, size]);
|
|
1489
|
-
return /* @__PURE__ */
|
|
1469
|
+
return /* @__PURE__ */ jsx(
|
|
1490
1470
|
"canvas",
|
|
1491
1471
|
{
|
|
1492
1472
|
ref,
|
|
@@ -1506,7 +1486,7 @@ function Thumbnail({ size, data }) {
|
|
|
1506
1486
|
}
|
|
1507
1487
|
|
|
1508
1488
|
// src/edit/layers/react/LayersPanelView.tsx
|
|
1509
|
-
import { Fragment, jsx as
|
|
1489
|
+
import { Fragment, jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
1510
1490
|
var DRAG_THRESHOLD = 4;
|
|
1511
1491
|
function LayersPanelView({ controller }) {
|
|
1512
1492
|
const subscribe = useCallback((cb) => controller.subscribe(cb), [controller]);
|
|
@@ -1514,13 +1494,13 @@ function LayersPanelView({ controller }) {
|
|
|
1514
1494
|
useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
|
|
1515
1495
|
const view = layersViewState(controller);
|
|
1516
1496
|
const ui5 = (intent) => applyLayersUi(controller, intent);
|
|
1517
|
-
return /* @__PURE__ */
|
|
1518
|
-
view.searchShown ? /* @__PURE__ */
|
|
1519
|
-
/* @__PURE__ */
|
|
1520
|
-
/* @__PURE__ */
|
|
1521
|
-
view.empty ? /* @__PURE__ */
|
|
1497
|
+
return /* @__PURE__ */ jsxs(Column, { className: "xeno-layers-panel", children: [
|
|
1498
|
+
view.searchShown ? /* @__PURE__ */ jsx2(Toolbar, { children: /* @__PURE__ */ jsx2(SearchField, { value: view.filter, onChange: (v) => ui5({ kind: "filter", value: v }), placeholder: "Search layers", label: "Search layers" }) }) : null,
|
|
1499
|
+
/* @__PURE__ */ jsxs(LayersScroller, { controller, children: [
|
|
1500
|
+
/* @__PURE__ */ jsx2(RowList, { role: "tree", "aria-label": "Layers", children: /* @__PURE__ */ jsx2(VirtualWindow, { totalHeight: view.totalHeight, offsetTop: view.offsetTop, children: view.rows.map((row2) => /* @__PURE__ */ jsx2(LayerRow, { row: row2, thumbnailSize: view.thumbnailSize, controller }, row2.id)) }) }),
|
|
1501
|
+
view.empty ? /* @__PURE__ */ jsx2(EmptyState, { title: "No layers" }) : null
|
|
1522
1502
|
] }),
|
|
1523
|
-
/* @__PURE__ */
|
|
1503
|
+
/* @__PURE__ */ jsx2(StatusBar, { left: /* @__PURE__ */ jsx2(Text, { role: "number", children: view.count }), right: view.orderLabel ? /* @__PURE__ */ jsx2(Text, { role: "meta", children: view.orderLabel }) : null })
|
|
1524
1504
|
] });
|
|
1525
1505
|
}
|
|
1526
1506
|
function LayersScroller({ controller, children }) {
|
|
@@ -1604,11 +1584,11 @@ function LayersScroller({ controller, children }) {
|
|
|
1604
1584
|
},
|
|
1605
1585
|
[controller]
|
|
1606
1586
|
);
|
|
1607
|
-
return /* @__PURE__ */
|
|
1587
|
+
return /* @__PURE__ */ jsx2(ScrollArea, { ref: scrollRef, onScroll, onKeyDown, onPointerDown, onPointerMove, onPointerUp, tabIndex: 0, children });
|
|
1608
1588
|
}
|
|
1609
1589
|
function LayersRenameField({ id, controller }) {
|
|
1610
1590
|
const [draft, setDraft] = useState(() => controller.getTree().nodes[id]?.name ?? "");
|
|
1611
|
-
return /* @__PURE__ */
|
|
1591
|
+
return /* @__PURE__ */ jsx2(
|
|
1612
1592
|
Input,
|
|
1613
1593
|
{
|
|
1614
1594
|
autoFocus: true,
|
|
@@ -1625,11 +1605,11 @@ function LayersRenameField({ id, controller }) {
|
|
|
1625
1605
|
);
|
|
1626
1606
|
}
|
|
1627
1607
|
function LayersThumbnail({ thumbnailKey, size, controller }) {
|
|
1628
|
-
return /* @__PURE__ */
|
|
1608
|
+
return /* @__PURE__ */ jsx2(Thumbnail, { size, data: controller.getThumbnail(thumbnailKey) });
|
|
1629
1609
|
}
|
|
1630
1610
|
function LayerRow({ row: row2, thumbnailSize, controller }) {
|
|
1631
1611
|
const ui5 = (intent) => applyLayersUi(controller, intent);
|
|
1632
|
-
return /* @__PURE__ */
|
|
1612
|
+
return /* @__PURE__ */ jsx2(
|
|
1633
1613
|
Row,
|
|
1634
1614
|
{
|
|
1635
1615
|
"data-layer-row": row2.id,
|
|
@@ -1641,19 +1621,19 @@ function LayerRow({ row: row2, thumbnailSize, controller }) {
|
|
|
1641
1621
|
dropHint: row2.dropHint,
|
|
1642
1622
|
expanded: row2.expanded,
|
|
1643
1623
|
title: row2.title,
|
|
1644
|
-
icon: row2.hasThumbnail ? /* @__PURE__ */
|
|
1645
|
-
leading: /* @__PURE__ */
|
|
1646
|
-
row2.showVisibility ? /* @__PURE__ */
|
|
1647
|
-
row2.showLock ? /* @__PURE__ */
|
|
1648
|
-
row2.showSolo ? /* @__PURE__ */
|
|
1649
|
-
row2.showMute ? /* @__PURE__ */
|
|
1650
|
-
row2.showArm ? /* @__PURE__ */
|
|
1651
|
-
row2.showColor ? /* @__PURE__ */
|
|
1624
|
+
icon: row2.hasThumbnail ? /* @__PURE__ */ jsx2(LayersThumbnail, { thumbnailKey: row2.thumbnailKey, size: thumbnailSize, controller }) : /* @__PURE__ */ jsx2(KindGlyph, {}),
|
|
1625
|
+
leading: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1626
|
+
row2.showVisibility ? /* @__PURE__ */ jsx2(IconButton, { size: "sm", icon: /* @__PURE__ */ jsx2(VisibilityIcon, { open: row2.visible }), label: row2.visibilityLabel, active: row2.visible, onClick: () => ui5({ kind: "toggleProp", id: row2.id, prop: "visible" }) }) : null,
|
|
1627
|
+
row2.showLock ? /* @__PURE__ */ jsx2(IconButton, { size: "sm", icon: /* @__PURE__ */ jsx2(LockStateIcon, { locked: row2.locked }), label: row2.lockLabel, active: row2.locked, onClick: () => ui5({ kind: "toggleProp", id: row2.id, prop: "locked" }) }) : null,
|
|
1628
|
+
row2.showSolo ? /* @__PURE__ */ jsx2(ChipToggle, { glyph: "S", label: "Solo", on: row2.solo, onChange: () => ui5({ kind: "toggleProp", id: row2.id, prop: "solo" }) }) : null,
|
|
1629
|
+
row2.showMute ? /* @__PURE__ */ jsx2(ChipToggle, { glyph: "M", label: "Mute", on: row2.muted, onChange: () => ui5({ kind: "toggleProp", id: row2.id, prop: "muted" }) }) : null,
|
|
1630
|
+
row2.showArm ? /* @__PURE__ */ jsx2(ChipToggle, { glyph: "R", label: "Arm", on: row2.armed, onChange: () => ui5({ kind: "toggleProp", id: row2.id, prop: "armed" }) }) : null,
|
|
1631
|
+
row2.showColor ? /* @__PURE__ */ jsx2(ColorTag, { color: row2.colorLabel }) : null
|
|
1652
1632
|
] }),
|
|
1653
|
-
label: row2.renaming ? /* @__PURE__ */
|
|
1654
|
-
trailing: /* @__PURE__ */
|
|
1655
|
-
row2.adornments.map((a) => /* @__PURE__ */
|
|
1656
|
-
row2.showOpacity ? /* @__PURE__ */
|
|
1633
|
+
label: row2.renaming ? /* @__PURE__ */ jsx2(LayersRenameField, { id: row2.id, controller }) : row2.name,
|
|
1634
|
+
trailing: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1635
|
+
row2.adornments.map((a) => /* @__PURE__ */ jsx2(Badge, { size: "sm", title: a.title, children: a.text }, a.key)),
|
|
1636
|
+
row2.showOpacity ? /* @__PURE__ */ jsx2(Text, { role: "number", children: row2.opacity }) : null
|
|
1657
1637
|
] }),
|
|
1658
1638
|
onExpandedChange: () => ui5({ kind: "toggleExpanded", id: row2.id }),
|
|
1659
1639
|
onDoubleClick: () => ui5({ kind: "beginRename", id: row2.id }),
|
|
@@ -1661,15 +1641,12 @@ function LayerRow({ row: row2, thumbnailSize, controller }) {
|
|
|
1661
1641
|
}
|
|
1662
1642
|
);
|
|
1663
1643
|
}
|
|
1664
|
-
var LAYERS_RUNTIME_UNITS = ["layers/Scroller", "layers/RenameField", "layers/Thumbnail"
|
|
1644
|
+
var LAYERS_RUNTIME_UNITS = ["layers/Scroller", "layers/RenameField", "layers/Thumbnail"];
|
|
1665
1645
|
function layersRuntimeComponents(controller) {
|
|
1666
1646
|
return {
|
|
1667
|
-
"layers/Scroller": ({ children }) => /* @__PURE__ */
|
|
1668
|
-
"layers/RenameField": ({ id }) => /* @__PURE__ */
|
|
1669
|
-
"layers/Thumbnail": ({ thumbnailKey, size }) => /* @__PURE__ */
|
|
1670
|
-
"layers/KindGlyph": KindGlyph,
|
|
1671
|
-
"layers/VisibilityIcon": VisibilityIcon,
|
|
1672
|
-
"layers/LockStateIcon": LockStateIcon
|
|
1647
|
+
"layers/Scroller": ({ children }) => /* @__PURE__ */ jsx2(LayersScroller, { controller, children }),
|
|
1648
|
+
"layers/RenameField": ({ id }) => /* @__PURE__ */ jsx2(LayersRenameField, { id, controller }),
|
|
1649
|
+
"layers/Thumbnail": ({ thumbnailKey, size }) => /* @__PURE__ */ jsx2(LayersThumbnail, { thumbnailKey, size, controller })
|
|
1673
1650
|
};
|
|
1674
1651
|
}
|
|
1675
1652
|
|
|
@@ -2574,9 +2551,9 @@ var InspectorPanelController = class {
|
|
|
2574
2551
|
composeValue(fieldId, numeric, component) {
|
|
2575
2552
|
if (component === void 0) return numeric;
|
|
2576
2553
|
const current = this.getFieldValue(fieldId);
|
|
2577
|
-
const
|
|
2578
|
-
|
|
2579
|
-
return
|
|
2554
|
+
const base = Array.isArray(current) ? [...current] : [];
|
|
2555
|
+
base[component] = numeric;
|
|
2556
|
+
return base;
|
|
2580
2557
|
}
|
|
2581
2558
|
// ── Vector expander (scalar ⇔ per-element) ────────────────────────────────
|
|
2582
2559
|
/** Whether a vector field is showing per-element rows. */
|
|
@@ -3128,7 +3105,7 @@ var ui2 = (kind, fields = {}) => ({ emit: "ui", value: { object: { kind: { value
|
|
|
3128
3105
|
var iconButton = (glyph, label, emit, extra = {}) => ({
|
|
3129
3106
|
component: "chrome/IconButton",
|
|
3130
3107
|
...extra.when ? { when: extra.when } : {},
|
|
3131
|
-
props: { size: { value: "sm" }, icon: { node: { component: `
|
|
3108
|
+
props: { size: { value: "sm" }, icon: { node: { component: `icons/${glyph}` } }, label, ...extra.props ?? {} },
|
|
3132
3109
|
on: { onClick: emit }
|
|
3133
3110
|
});
|
|
3134
3111
|
var INSPECTOR_DECLARATION = {
|
|
@@ -3211,10 +3188,10 @@ var INSPECTOR_DECLARATION = {
|
|
|
3211
3188
|
component: "fragment",
|
|
3212
3189
|
when: { item: "showKeyframes" },
|
|
3213
3190
|
children: [
|
|
3214
|
-
iconButton("
|
|
3215
|
-
iconButton("
|
|
3216
|
-
{ component: "chrome/IconButton", when: { item: "animated" }, props: { size: { value: "sm" }, icon: { node: { component: "
|
|
3217
|
-
iconButton("
|
|
3191
|
+
iconButton("Stopwatch", { value: "Toggle animation" }, ui2("keyframe", { fieldId: { item: "id" }, op: { value: "toggleAnim" } }), { props: { active: { item: "animated" } } }),
|
|
3192
|
+
iconButton("Prev", { value: "Previous keyframe" }, ui2("keyframe", { fieldId: { item: "id" }, op: { value: "prev" } }), { when: { item: "animated" }, props: { disabled: { item: "prevDisabled" } } }),
|
|
3193
|
+
{ component: "chrome/IconButton", when: { item: "animated" }, props: { size: { value: "sm" }, icon: { node: { component: "icons/Diamond", props: { filled: { item: "onKeyframe" } } } }, label: { item: "keyframeLabel" } }, on: { onClick: ui2("keyframe", { fieldId: { item: "id" }, op: { item: "keyframeOp" } }) } },
|
|
3194
|
+
iconButton("Next", { value: "Next keyframe" }, ui2("keyframe", { fieldId: { item: "id" }, op: { value: "next" } }), { when: { item: "animated" }, props: { disabled: { item: "nextDisabled" } } })
|
|
3218
3195
|
]
|
|
3219
3196
|
}
|
|
3220
3197
|
},
|
|
@@ -3224,8 +3201,8 @@ var INSPECTOR_DECLARATION = {
|
|
|
3224
3201
|
children: [
|
|
3225
3202
|
{ component: "chrome/Select", when: { item: "showEasing" }, props: { size: { value: "sm" }, options: { item: "easingOptions" }, value: { item: "easing" }, label: { value: "Easing" } }, on: { onChange: ui2("setEasing", { fieldId: { item: "id" }, easing: { arg: "" } }) } },
|
|
3226
3203
|
{ component: "chrome/Badge", when: { item: "showKeyframes" }, props: { size: { value: "sm" } }, children: [text2({ item: "keyframeChip" })] },
|
|
3227
|
-
iconButton("
|
|
3228
|
-
iconButton("
|
|
3204
|
+
iconButton("Link", { item: "tokenActionLabel" }, ui2("bindToken", { fieldId: { item: "id" } }), { when: { item: "showToken" }, props: { active: { item: "bound" } } }),
|
|
3205
|
+
iconButton("Reset", { value: "Reset to default" }, ui2("resetField", { fieldId: { item: "id" } }), { when: { item: "showReset" } })
|
|
3229
3206
|
]
|
|
3230
3207
|
}
|
|
3231
3208
|
}
|
|
@@ -3258,54 +3235,6 @@ var INSPECTOR_DECLARATION = {
|
|
|
3258
3235
|
// src/edit/inspector/react/InspectorPanelView.tsx
|
|
3259
3236
|
import { Badge as Badge2, Column as Column2, EmptyState as EmptyState2, Field, FieldGroup, IconButton as IconButton3, Menu, ScrollArea as ScrollArea2, SearchField as SearchField2, Section, Select as Select2, Stack as Stack2, Text as Text3 } from "@xenosystem/components/chrome";
|
|
3260
3237
|
|
|
3261
|
-
// src/edit/inspector/react/icons.tsx
|
|
3262
|
-
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
3263
|
-
var base2 = (size) => ({
|
|
3264
|
-
width: size,
|
|
3265
|
-
height: size,
|
|
3266
|
-
viewBox: "0 0 24 24",
|
|
3267
|
-
fill: "none",
|
|
3268
|
-
stroke: "currentColor",
|
|
3269
|
-
strokeWidth: 1.5,
|
|
3270
|
-
strokeLinecap: "round",
|
|
3271
|
-
strokeLinejoin: "round",
|
|
3272
|
-
"aria-hidden": true
|
|
3273
|
-
});
|
|
3274
|
-
function StopwatchIcon({ size = 11 }) {
|
|
3275
|
-
return /* @__PURE__ */ jsxs3("svg", { ...base2(size), children: [
|
|
3276
|
-
/* @__PURE__ */ jsx4("path", { d: "M10 2h4" }),
|
|
3277
|
-
/* @__PURE__ */ jsx4("path", { d: "M12 14v-4" }),
|
|
3278
|
-
/* @__PURE__ */ jsx4("path", { d: "M20 14a8 8 0 1 1-16 0 8 8 0 0 1 16 0Z" })
|
|
3279
|
-
] });
|
|
3280
|
-
}
|
|
3281
|
-
function DiamondIcon({ size = 9, filled = false }) {
|
|
3282
|
-
return /* @__PURE__ */ jsx4("svg", { ...base2(size), fill: filled ? "currentColor" : "none", children: /* @__PURE__ */ jsx4("path", { d: "m12 3 7 9-7 9-7-9z" }) });
|
|
3283
|
-
}
|
|
3284
|
-
function PrevIcon({ size = 9 }) {
|
|
3285
|
-
return /* @__PURE__ */ jsx4("svg", { ...base2(size), children: /* @__PURE__ */ jsx4("path", { d: "m15 18-6-6 6-6" }) });
|
|
3286
|
-
}
|
|
3287
|
-
function NextIcon({ size = 9 }) {
|
|
3288
|
-
return /* @__PURE__ */ jsx4("svg", { ...base2(size), children: /* @__PURE__ */ jsx4("path", { d: "m9 18 6-6-6-6" }) });
|
|
3289
|
-
}
|
|
3290
|
-
function LinkIcon({ size = 10 }) {
|
|
3291
|
-
return /* @__PURE__ */ jsxs3("svg", { ...base2(size), children: [
|
|
3292
|
-
/* @__PURE__ */ jsx4("path", { d: "M10 13a5 5 0 0 0 7.5.5l3-3a5 5 0 0 0-7-7l-1.8 1.7" }),
|
|
3293
|
-
/* @__PURE__ */ jsx4("path", { d: "M14 11a5 5 0 0 0-7.5-.5l-3 3a5 5 0 0 0 7 7l1.8-1.7" })
|
|
3294
|
-
] });
|
|
3295
|
-
}
|
|
3296
|
-
function ResetIcon({ size = 10 }) {
|
|
3297
|
-
return /* @__PURE__ */ jsxs3("svg", { ...base2(size), children: [
|
|
3298
|
-
/* @__PURE__ */ jsx4("path", { d: "M3 12a9 9 0 1 0 3-6.7L3 8" }),
|
|
3299
|
-
/* @__PURE__ */ jsx4("path", { d: "M3 3v5h5" })
|
|
3300
|
-
] });
|
|
3301
|
-
}
|
|
3302
|
-
function XIcon({ size = 10 }) {
|
|
3303
|
-
return /* @__PURE__ */ jsxs3("svg", { ...base2(size), children: [
|
|
3304
|
-
/* @__PURE__ */ jsx4("path", { d: "M18 6 6 18" }),
|
|
3305
|
-
/* @__PURE__ */ jsx4("path", { d: "m6 6 12 12" })
|
|
3306
|
-
] });
|
|
3307
|
-
}
|
|
3308
|
-
|
|
3309
3238
|
// src/edit/inspector/react/widgets.tsx
|
|
3310
3239
|
import { useCallback as useCallback2, useRef as useRef3 } from "react";
|
|
3311
3240
|
import {
|
|
@@ -3322,7 +3251,7 @@ import {
|
|
|
3322
3251
|
TextButton,
|
|
3323
3252
|
Toggle
|
|
3324
3253
|
} from "@xenosystem/components/chrome";
|
|
3325
|
-
import { Fragment as Fragment2, jsx as
|
|
3254
|
+
import { Fragment as Fragment2, jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
3326
3255
|
function displayText(field, controller) {
|
|
3327
3256
|
const draft = controller.getDraft(field.id);
|
|
3328
3257
|
if (draft !== void 0) return draft;
|
|
@@ -3431,9 +3360,9 @@ function NumberWidget({ field, controller, component }) {
|
|
|
3431
3360
|
return typeof v === "number" ? formatNumeric(v, field) : "";
|
|
3432
3361
|
})() : displayText(field, controller);
|
|
3433
3362
|
const position = numericValue === null ? null : valueToPosition(numericValue, field);
|
|
3434
|
-
return /* @__PURE__ */
|
|
3435
|
-
component !== void 0 && field.components?.[component] ? /* @__PURE__ */
|
|
3436
|
-
/* @__PURE__ */
|
|
3363
|
+
return /* @__PURE__ */ jsxs2(Stack, { direction: "row", gap: 2, pad: "none", children: [
|
|
3364
|
+
component !== void 0 && field.components?.[component] ? /* @__PURE__ */ jsx3(AxisLabel, { scrubbable: editable, onPointerDown, onPointerMove, onPointerUp, children: field.components[component] }) : null,
|
|
3365
|
+
/* @__PURE__ */ jsx3(
|
|
3437
3366
|
Input2,
|
|
3438
3367
|
{
|
|
3439
3368
|
inputMode: "decimal",
|
|
@@ -3451,22 +3380,22 @@ function NumberWidget({ field, controller, component }) {
|
|
|
3451
3380
|
...ariaSliderProps(field, numericValue)
|
|
3452
3381
|
}
|
|
3453
3382
|
),
|
|
3454
|
-
controller.getNumericMode() === "slider" && position !== null && Number.isFinite(position) ? /* @__PURE__ */
|
|
3383
|
+
controller.getNumericMode() === "slider" && position !== null && Number.isFinite(position) ? /* @__PURE__ */ jsx3(ProportionBar, { segments: [{ value: position, opacity: 0.9 }, { value: 1 - position, opacity: 0.08 }] }) : null
|
|
3455
3384
|
] });
|
|
3456
3385
|
}
|
|
3457
3386
|
function VectorWidget({ field, controller }) {
|
|
3458
3387
|
const expanded = controller.isExpanded(field.id) || !controller.isUniformVector(field.id);
|
|
3459
3388
|
const value = controller.getFieldValue(field.id);
|
|
3460
3389
|
const count = Array.isArray(value) ? value.length : field.components?.length ?? 0;
|
|
3461
|
-
const toggle2 = (label, title) => /* @__PURE__ */
|
|
3390
|
+
const toggle2 = (label, title) => /* @__PURE__ */ jsx3(IconButton2, { size: "sm", icon: /* @__PURE__ */ jsx3("span", { "aria-hidden": true, children: "\u22EF" }), label, onClick: () => controller.toggleExpanded(field.id) });
|
|
3462
3391
|
if (!expanded && field.expandable) {
|
|
3463
|
-
return /* @__PURE__ */
|
|
3464
|
-
/* @__PURE__ */
|
|
3392
|
+
return /* @__PURE__ */ jsxs2(Stack, { direction: "row", gap: 3, pad: "none", children: [
|
|
3393
|
+
/* @__PURE__ */ jsx3(NumberWidget, { field, controller, component: 0 }),
|
|
3465
3394
|
toggle2("Expand", "Edit each axis separately")
|
|
3466
3395
|
] });
|
|
3467
3396
|
}
|
|
3468
|
-
return /* @__PURE__ */
|
|
3469
|
-
Array.from({ length: count }, (_, i) => /* @__PURE__ */
|
|
3397
|
+
return /* @__PURE__ */ jsxs2(Stack, { direction: "row", gap: 3, pad: "none", children: [
|
|
3398
|
+
Array.from({ length: count }, (_, i) => /* @__PURE__ */ jsx3(NumberWidget, { field, controller, component: i }, i)),
|
|
3470
3399
|
field.expandable && controller.isUniformVector(field.id) ? toggle2("Collapse", "Link axes") : null
|
|
3471
3400
|
] });
|
|
3472
3401
|
}
|
|
@@ -3486,15 +3415,15 @@ function TextWidget({ field, controller }) {
|
|
|
3486
3415
|
onBlur: handlers.onBlur,
|
|
3487
3416
|
onKeyDown: handlers.onKeyDown
|
|
3488
3417
|
};
|
|
3489
|
-
if (field.type === "textarea") return /* @__PURE__ */
|
|
3490
|
-
return /* @__PURE__ */
|
|
3418
|
+
if (field.type === "textarea") return /* @__PURE__ */ jsx3(TextArea, { ...shared, rows: field.rows ?? 3 });
|
|
3419
|
+
return /* @__PURE__ */ jsx3(Input2, { ...shared });
|
|
3491
3420
|
}
|
|
3492
3421
|
function CodeWidget({ field, controller }) {
|
|
3493
3422
|
const editable = isFieldEditable(field);
|
|
3494
3423
|
const mixed = isFieldMixed(field);
|
|
3495
3424
|
const handlers = useEditingHandlers(field, controller);
|
|
3496
3425
|
const expression = field.type === "expression";
|
|
3497
|
-
return /* @__PURE__ */
|
|
3426
|
+
return /* @__PURE__ */ jsx3(
|
|
3498
3427
|
TextArea,
|
|
3499
3428
|
{
|
|
3500
3429
|
variant: "mono",
|
|
@@ -3528,7 +3457,7 @@ function BooleanWidget({ field, controller }) {
|
|
|
3528
3457
|
const editable = isFieldEditable(field);
|
|
3529
3458
|
const mixed = isFieldMixed(field);
|
|
3530
3459
|
const on = controller.getFieldValue(field.id) === true;
|
|
3531
|
-
return /* @__PURE__ */
|
|
3460
|
+
return /* @__PURE__ */ jsx3(Toggle, { size: "sm", checked: on, mixed, label: field.label, disabled: !editable, onChange: (next) => controller.setValue(field.id, next) });
|
|
3532
3461
|
}
|
|
3533
3462
|
function SelectWidget({ field, controller }) {
|
|
3534
3463
|
const editable = isFieldEditable(field);
|
|
@@ -3538,12 +3467,12 @@ function SelectWidget({ field, controller }) {
|
|
|
3538
3467
|
const value = mixed ? "" : String(current ?? "");
|
|
3539
3468
|
const hasCurrent = mixed || value === "" || options.some((o) => o.value === value);
|
|
3540
3469
|
const all = hasCurrent ? options : [{ value, label: value }, ...options];
|
|
3541
|
-
return /* @__PURE__ */
|
|
3470
|
+
return /* @__PURE__ */ jsx3(Select, { options: all, value, mixed, disabled: !editable, label: field.label, onChange: (next) => controller.setValue(field.id, next) });
|
|
3542
3471
|
}
|
|
3543
3472
|
function SegmentedWidget({ field, controller }) {
|
|
3544
3473
|
const editable = isFieldEditable(field);
|
|
3545
3474
|
const current = String(controller.getFieldValue(field.id) ?? "");
|
|
3546
|
-
return /* @__PURE__ */
|
|
3475
|
+
return /* @__PURE__ */ jsx3(
|
|
3547
3476
|
SegmentedControl,
|
|
3548
3477
|
{
|
|
3549
3478
|
size: "sm",
|
|
@@ -3561,7 +3490,7 @@ function ColorWidget({ field, controller }) {
|
|
|
3561
3490
|
const raw = controller.getFieldValue(field.id);
|
|
3562
3491
|
const hex = typeof raw === "string" ? raw : typeof raw?.hex === "string" ? raw.hex : "";
|
|
3563
3492
|
const editable = isFieldEditable(field);
|
|
3564
|
-
return /* @__PURE__ */
|
|
3493
|
+
return /* @__PURE__ */ jsx3(
|
|
3565
3494
|
Swatch,
|
|
3566
3495
|
{
|
|
3567
3496
|
color: hex || void 0,
|
|
@@ -3585,26 +3514,26 @@ function ListWidget({ field, controller }) {
|
|
|
3585
3514
|
next.splice(to, 0, moved);
|
|
3586
3515
|
write(next);
|
|
3587
3516
|
};
|
|
3588
|
-
return /* @__PURE__ */
|
|
3589
|
-
items.map((item, i) => /* @__PURE__ */
|
|
3590
|
-
/* @__PURE__ */
|
|
3591
|
-
editable ? /* @__PURE__ */
|
|
3592
|
-
/* @__PURE__ */
|
|
3593
|
-
/* @__PURE__ */
|
|
3594
|
-
/* @__PURE__ */
|
|
3517
|
+
return /* @__PURE__ */ jsxs2(Stack, { gap: 2, pad: "none", children: [
|
|
3518
|
+
items.map((item, i) => /* @__PURE__ */ jsxs2(Stack, { direction: "row", gap: 2, pad: "none", children: [
|
|
3519
|
+
/* @__PURE__ */ jsx3(Text2, { role: "meta", children: typeof item === "string" ? item : JSON.stringify(item) }),
|
|
3520
|
+
editable ? /* @__PURE__ */ jsxs2(Fragment2, { children: [
|
|
3521
|
+
/* @__PURE__ */ jsx3(IconButton2, { size: "sm", icon: /* @__PURE__ */ jsx3("span", { "aria-hidden": true, children: "\u2191" }), label: "Move up", disabled: i === 0, onClick: () => move(i, i - 1) }),
|
|
3522
|
+
/* @__PURE__ */ jsx3(IconButton2, { size: "sm", icon: /* @__PURE__ */ jsx3("span", { "aria-hidden": true, children: "\u2193" }), label: "Move down", disabled: i === items.length - 1, onClick: () => move(i, i + 1) }),
|
|
3523
|
+
/* @__PURE__ */ jsx3(IconButton2, { size: "sm", icon: /* @__PURE__ */ jsx3(XIcon, {}), label: "Remove", onClick: () => write(items.filter((_, j) => j !== i)) })
|
|
3595
3524
|
] }) : null
|
|
3596
3525
|
] }, i)),
|
|
3597
|
-
editable ? /* @__PURE__ */
|
|
3526
|
+
editable ? /* @__PURE__ */ jsx3(TextButton, { onClick: () => write([...items, ""]), children: "+ Add" }) : null
|
|
3598
3527
|
] });
|
|
3599
3528
|
}
|
|
3600
3529
|
function InfoWidget({ field, controller }) {
|
|
3601
3530
|
const value = controller.getFieldValue(field.id);
|
|
3602
|
-
return /* @__PURE__ */
|
|
3531
|
+
return /* @__PURE__ */ jsx3(Text2, { role: "meta", children: value === void 0 || value === null ? "\u2014" : String(value) });
|
|
3603
3532
|
}
|
|
3604
3533
|
function JsonWidget({ field, controller }) {
|
|
3605
3534
|
const editable = isFieldEditable(field);
|
|
3606
3535
|
const handlers = useEditingHandlers(field, controller);
|
|
3607
|
-
return /* @__PURE__ */
|
|
3536
|
+
return /* @__PURE__ */ jsx3(
|
|
3608
3537
|
TextArea,
|
|
3609
3538
|
{
|
|
3610
3539
|
variant: "mono",
|
|
@@ -3621,21 +3550,21 @@ function JsonWidget({ field, controller }) {
|
|
|
3621
3550
|
}
|
|
3622
3551
|
|
|
3623
3552
|
// src/edit/inspector/react/InspectorPanelView.tsx
|
|
3624
|
-
import { Fragment as Fragment3, jsx as
|
|
3553
|
+
import { Fragment as Fragment3, jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
3625
3554
|
function InspectorPanelView({ controller }) {
|
|
3626
3555
|
const subscribe = useCallback3((cb) => controller.subscribe(cb), [controller]);
|
|
3627
3556
|
const getSnapshot = useCallback3(() => controller.getRevision(), [controller]);
|
|
3628
3557
|
useSyncExternalStore2(subscribe, getSnapshot, getSnapshot);
|
|
3629
3558
|
const view = inspectorViewState(controller);
|
|
3630
|
-
return /* @__PURE__ */
|
|
3631
|
-
view.searchShown ? /* @__PURE__ */
|
|
3632
|
-
/* @__PURE__ */
|
|
3633
|
-
view.hasTarget ? /* @__PURE__ */
|
|
3559
|
+
return /* @__PURE__ */ jsxs3(Column2, { className: "xeno-inspector-panel", children: [
|
|
3560
|
+
view.searchShown ? /* @__PURE__ */ jsxs3(Stack2, { direction: "row", gap: 6, children: [
|
|
3561
|
+
/* @__PURE__ */ jsx4(SearchField2, { value: view.filter, onChange: (v) => controller.setFilter(v), placeholder: "Search properties", label: "Search properties" }),
|
|
3562
|
+
view.hasTarget ? /* @__PURE__ */ jsx4(Badge2, { children: view.targetLabel }) : null
|
|
3634
3563
|
] }) : null,
|
|
3635
|
-
view.multi ? /* @__PURE__ */
|
|
3636
|
-
/* @__PURE__ */
|
|
3637
|
-
view.sections.map((section) => /* @__PURE__ */
|
|
3638
|
-
view.empty ? /* @__PURE__ */
|
|
3564
|
+
view.multi ? /* @__PURE__ */ jsx4(Stack2, { pad: "inset", children: /* @__PURE__ */ jsx4(Text3, { role: "caption", children: view.banner }) }) : null,
|
|
3565
|
+
/* @__PURE__ */ jsx4(ScrollArea2, { children: /* @__PURE__ */ jsxs3(InspectorProperties, { controller, children: [
|
|
3566
|
+
view.sections.map((section) => /* @__PURE__ */ jsx4(SectionView, { section, controller }, section.id)),
|
|
3567
|
+
view.empty ? /* @__PURE__ */ jsx4(EmptyState2, { title: view.emptyTitle }) : null
|
|
3639
3568
|
] }) })
|
|
3640
3569
|
] });
|
|
3641
3570
|
}
|
|
@@ -3649,15 +3578,15 @@ function InspectorProperties({ controller, children }) {
|
|
|
3649
3578
|
},
|
|
3650
3579
|
[controller]
|
|
3651
3580
|
);
|
|
3652
|
-
return /* @__PURE__ */
|
|
3581
|
+
return /* @__PURE__ */ jsx4("div", { onKeyDown, tabIndex: 0, role: "group", "aria-label": "Properties", className: "xeno-inspector-properties", children });
|
|
3653
3582
|
}
|
|
3654
3583
|
function ActionGlyph({ glyph }) {
|
|
3655
|
-
return /* @__PURE__ */
|
|
3584
|
+
return /* @__PURE__ */ jsx4("span", { "aria-hidden": true, children: glyph });
|
|
3656
3585
|
}
|
|
3657
3586
|
function SectionView({ section, controller }) {
|
|
3658
3587
|
const ui5 = (intent) => applyInspectorUi(controller, intent);
|
|
3659
3588
|
const hasActions = section.actions.length > 0 || section.hasAddMenu;
|
|
3660
|
-
return /* @__PURE__ */
|
|
3589
|
+
return /* @__PURE__ */ jsxs3(
|
|
3661
3590
|
Section,
|
|
3662
3591
|
{
|
|
3663
3592
|
title: section.title,
|
|
@@ -3667,22 +3596,22 @@ function SectionView({ section, controller }) {
|
|
|
3667
3596
|
onCollapsedChange: () => ui5({ kind: "toggleSectionCollapsed", sectionId: section.id }),
|
|
3668
3597
|
enabled: section.enabled,
|
|
3669
3598
|
onEnabledChange: () => ui5({ kind: "toggleSectionEnabled", sectionId: section.id }),
|
|
3670
|
-
badge: section.badge ? /* @__PURE__ */
|
|
3671
|
-
actions: hasActions ? /* @__PURE__ */
|
|
3672
|
-
section.actions.map((action) => /* @__PURE__ */
|
|
3673
|
-
section.hasAddMenu ? /* @__PURE__ */
|
|
3599
|
+
badge: section.badge ? /* @__PURE__ */ jsx4(Badge2, { children: section.badge }) : null,
|
|
3600
|
+
actions: hasActions ? /* @__PURE__ */ jsxs3(Fragment3, { children: [
|
|
3601
|
+
section.actions.map((action) => /* @__PURE__ */ jsx4(IconButton3, { size: "sm", icon: /* @__PURE__ */ jsx4(ActionGlyph, { glyph: action.glyph }), label: action.label, disabled: action.disabled, onClick: () => ui5({ kind: "runAction", sectionId: section.id, actionId: action.id }) }, action.id)),
|
|
3602
|
+
section.hasAddMenu ? /* @__PURE__ */ jsx4(Menu, { size: "sm", trigger: "\uFF0B", items: section.addItems, label: section.addLabel, align: "end", onSelect: (id) => ui5({ kind: "addItem", sectionId: section.id, itemId: id }) }) : null
|
|
3674
3603
|
] }) : null,
|
|
3675
3604
|
children: [
|
|
3676
|
-
section.showEmptyHint ? /* @__PURE__ */
|
|
3677
|
-
/* @__PURE__ */
|
|
3605
|
+
section.showEmptyHint ? /* @__PURE__ */ jsx4(Stack2, { pad: "inset", children: /* @__PURE__ */ jsx4(Text3, { role: "caption", children: section.emptyHint }) }) : null,
|
|
3606
|
+
/* @__PURE__ */ jsx4(FieldGroup, { labelWidth: section.labelWidth, children: section.fields.map((row2) => /* @__PURE__ */ jsx4(FieldRow, { row: row2, controller }, row2.id)) })
|
|
3678
3607
|
]
|
|
3679
3608
|
}
|
|
3680
3609
|
);
|
|
3681
3610
|
}
|
|
3682
3611
|
function FieldRow({ row: row2, controller }) {
|
|
3683
3612
|
const ui5 = (intent) => applyInspectorUi(controller, intent);
|
|
3684
|
-
return /* @__PURE__ */
|
|
3685
|
-
/* @__PURE__ */
|
|
3613
|
+
return /* @__PURE__ */ jsxs3(Fragment3, { children: [
|
|
3614
|
+
/* @__PURE__ */ jsxs3(
|
|
3686
3615
|
Field,
|
|
3687
3616
|
{
|
|
3688
3617
|
label: row2.label,
|
|
@@ -3690,25 +3619,25 @@ function FieldRow({ row: row2, controller }) {
|
|
|
3690
3619
|
focused: row2.focused,
|
|
3691
3620
|
onLabelClick: () => ui5({ kind: "focusField", fieldId: row2.id }),
|
|
3692
3621
|
onContextMenu: (x, y) => ui5({ kind: "contextMenu", fieldId: row2.id, x, y }),
|
|
3693
|
-
leading: row2.showKeyframes ? /* @__PURE__ */
|
|
3694
|
-
/* @__PURE__ */
|
|
3695
|
-
row2.animated ? /* @__PURE__ */
|
|
3696
|
-
row2.animated ? /* @__PURE__ */
|
|
3697
|
-
row2.animated ? /* @__PURE__ */
|
|
3622
|
+
leading: row2.showKeyframes ? /* @__PURE__ */ jsxs3(Fragment3, { children: [
|
|
3623
|
+
/* @__PURE__ */ jsx4(IconButton3, { size: "sm", icon: /* @__PURE__ */ jsx4(StopwatchIcon, {}), label: "Toggle animation", active: row2.animated, onClick: () => ui5({ kind: "keyframe", fieldId: row2.id, op: "toggleAnim" }) }),
|
|
3624
|
+
row2.animated ? /* @__PURE__ */ jsx4(IconButton3, { size: "sm", icon: /* @__PURE__ */ jsx4(PrevIcon, {}), label: "Previous keyframe", disabled: row2.prevDisabled, onClick: () => ui5({ kind: "keyframe", fieldId: row2.id, op: "prev" }) }) : null,
|
|
3625
|
+
row2.animated ? /* @__PURE__ */ jsx4(IconButton3, { size: "sm", icon: /* @__PURE__ */ jsx4(DiamondIcon, { filled: row2.onKeyframe }), label: row2.keyframeLabel, onClick: () => ui5({ kind: "keyframe", fieldId: row2.id, op: row2.keyframeOp }) }) : null,
|
|
3626
|
+
row2.animated ? /* @__PURE__ */ jsx4(IconButton3, { size: "sm", icon: /* @__PURE__ */ jsx4(NextIcon, {}), label: "Next keyframe", disabled: row2.nextDisabled, onClick: () => ui5({ kind: "keyframe", fieldId: row2.id, op: "next" }) }) : null
|
|
3698
3627
|
] }) : null,
|
|
3699
|
-
trailing: /* @__PURE__ */
|
|
3700
|
-
row2.showEasing ? /* @__PURE__ */
|
|
3701
|
-
row2.showKeyframes ? /* @__PURE__ */
|
|
3702
|
-
row2.showToken ? /* @__PURE__ */
|
|
3703
|
-
row2.showReset ? /* @__PURE__ */
|
|
3628
|
+
trailing: /* @__PURE__ */ jsxs3(Fragment3, { children: [
|
|
3629
|
+
row2.showEasing ? /* @__PURE__ */ jsx4(Select2, { size: "sm", options: row2.easingOptions, value: row2.easing, label: "Easing", onChange: (v) => ui5({ kind: "setEasing", fieldId: row2.id, easing: v }) }) : null,
|
|
3630
|
+
row2.showKeyframes ? /* @__PURE__ */ jsx4(Badge2, { size: "sm", children: row2.keyframeChip }) : null,
|
|
3631
|
+
row2.showToken ? /* @__PURE__ */ jsx4(IconButton3, { size: "sm", icon: /* @__PURE__ */ jsx4(LinkIcon, {}), label: row2.tokenActionLabel, active: row2.bound, onClick: () => ui5({ kind: "bindToken", fieldId: row2.id }) }) : null,
|
|
3632
|
+
row2.showReset ? /* @__PURE__ */ jsx4(IconButton3, { size: "sm", icon: /* @__PURE__ */ jsx4(ResetIcon, {}), label: "Reset to default", onClick: () => ui5({ kind: "resetField", fieldId: row2.id }) }) : null
|
|
3704
3633
|
] }),
|
|
3705
3634
|
children: [
|
|
3706
|
-
row2.bound ? /* @__PURE__ */
|
|
3707
|
-
row2.unbound ? /* @__PURE__ */
|
|
3635
|
+
row2.bound ? /* @__PURE__ */ jsx4(Badge2, { title: row2.tokenTitle, children: row2.tokenLabel }) : null,
|
|
3636
|
+
row2.unbound ? /* @__PURE__ */ jsx4(FieldWidget, { field: row2.field, controller }) : null
|
|
3708
3637
|
]
|
|
3709
3638
|
}
|
|
3710
3639
|
),
|
|
3711
|
-
row2.showInfoNote ? /* @__PURE__ */
|
|
3640
|
+
row2.showInfoNote ? /* @__PURE__ */ jsx4(Stack2, { pad: "inset", children: /* @__PURE__ */ jsx4(Text3, { role: "caption", children: row2.infoNote }) }) : null
|
|
3712
3641
|
] });
|
|
3713
3642
|
}
|
|
3714
3643
|
function FieldWidget({
|
|
@@ -3717,50 +3646,44 @@ function FieldWidget({
|
|
|
3717
3646
|
}) {
|
|
3718
3647
|
switch (field.type) {
|
|
3719
3648
|
case "number":
|
|
3720
|
-
return /* @__PURE__ */
|
|
3649
|
+
return /* @__PURE__ */ jsx4(NumberWidget, { field, controller });
|
|
3721
3650
|
case "vector":
|
|
3722
|
-
return /* @__PURE__ */
|
|
3651
|
+
return /* @__PURE__ */ jsx4(VectorWidget, { field, controller });
|
|
3723
3652
|
case "boolean":
|
|
3724
|
-
return /* @__PURE__ */
|
|
3653
|
+
return /* @__PURE__ */ jsx4(BooleanWidget, { field, controller });
|
|
3725
3654
|
case "select":
|
|
3726
|
-
return /* @__PURE__ */
|
|
3655
|
+
return /* @__PURE__ */ jsx4(SelectWidget, { field, controller });
|
|
3727
3656
|
case "segmented":
|
|
3728
|
-
return /* @__PURE__ */
|
|
3657
|
+
return /* @__PURE__ */ jsx4(SegmentedWidget, { field, controller });
|
|
3729
3658
|
case "color":
|
|
3730
|
-
return /* @__PURE__ */
|
|
3659
|
+
return /* @__PURE__ */ jsx4(ColorWidget, { field, controller });
|
|
3731
3660
|
case "list":
|
|
3732
|
-
return /* @__PURE__ */
|
|
3661
|
+
return /* @__PURE__ */ jsx4(ListWidget, { field, controller });
|
|
3733
3662
|
case "info":
|
|
3734
|
-
return /* @__PURE__ */
|
|
3663
|
+
return /* @__PURE__ */ jsx4(InfoWidget, { field, controller });
|
|
3735
3664
|
case "text":
|
|
3736
3665
|
case "textarea":
|
|
3737
3666
|
case "file":
|
|
3738
|
-
return /* @__PURE__ */
|
|
3667
|
+
return /* @__PURE__ */ jsx4(TextWidget, { field, controller });
|
|
3739
3668
|
case "code":
|
|
3740
3669
|
case "expression":
|
|
3741
|
-
return /* @__PURE__ */
|
|
3670
|
+
return /* @__PURE__ */ jsx4(CodeWidget, { field, controller });
|
|
3742
3671
|
case "custom": {
|
|
3743
3672
|
const Renderer = controller.getRenderer(field);
|
|
3744
|
-
if (!Renderer) return /* @__PURE__ */
|
|
3745
|
-
return /* @__PURE__ */
|
|
3673
|
+
if (!Renderer) return /* @__PURE__ */ jsx4(JsonWidget, { field, controller });
|
|
3674
|
+
return /* @__PURE__ */ jsx4(Renderer, { field, controller });
|
|
3746
3675
|
}
|
|
3747
3676
|
case "json":
|
|
3748
3677
|
default:
|
|
3749
|
-
return /* @__PURE__ */
|
|
3678
|
+
return /* @__PURE__ */ jsx4(JsonWidget, { field, controller });
|
|
3750
3679
|
}
|
|
3751
3680
|
}
|
|
3752
|
-
var INSPECTOR_RUNTIME_UNITS = ["inspector/FieldWidget", "inspector/Properties", "inspector/ActionGlyph"
|
|
3681
|
+
var INSPECTOR_RUNTIME_UNITS = ["inspector/FieldWidget", "inspector/Properties", "inspector/ActionGlyph"];
|
|
3753
3682
|
function inspectorRuntimeComponents(controller) {
|
|
3754
3683
|
return {
|
|
3755
|
-
"inspector/FieldWidget": ({ field }) => /* @__PURE__ */
|
|
3756
|
-
"inspector/Properties": ({ children }) => /* @__PURE__ */
|
|
3757
|
-
"inspector/ActionGlyph": ActionGlyph
|
|
3758
|
-
"inspector/StopwatchIcon": StopwatchIcon,
|
|
3759
|
-
"inspector/DiamondIcon": DiamondIcon,
|
|
3760
|
-
"inspector/PrevIcon": PrevIcon,
|
|
3761
|
-
"inspector/NextIcon": NextIcon,
|
|
3762
|
-
"inspector/LinkIcon": LinkIcon,
|
|
3763
|
-
"inspector/ResetIcon": ResetIcon
|
|
3684
|
+
"inspector/FieldWidget": ({ field }) => /* @__PURE__ */ jsx4(FieldWidget, { field, controller }),
|
|
3685
|
+
"inspector/Properties": ({ children }) => /* @__PURE__ */ jsx4(InspectorProperties, { controller, children }),
|
|
3686
|
+
"inspector/ActionGlyph": ActionGlyph
|
|
3764
3687
|
};
|
|
3765
3688
|
}
|
|
3766
3689
|
|
|
@@ -4854,8 +4777,8 @@ var HISTORY_DECLARATION = {
|
|
|
4854
4777
|
node: {
|
|
4855
4778
|
component: "fragment",
|
|
4856
4779
|
children: [
|
|
4857
|
-
{ component: "chrome/IconButton", props: { size: { value: "sm" }, icon: { node: { component: "
|
|
4858
|
-
{ component: "chrome/IconButton", props: { size: { value: "sm" }, icon: { node: { component: "
|
|
4780
|
+
{ component: "chrome/IconButton", props: { size: { value: "sm" }, icon: { node: { component: "icons/Undo" } }, label: { value: "Undo" }, disabled: { input: "view.cannotUndo" } }, on: { onClick: ui3("undo") } },
|
|
4781
|
+
{ component: "chrome/IconButton", props: { size: { value: "sm" }, icon: { node: { component: "icons/Redo" } }, label: { value: "Redo" }, disabled: { input: "view.cannotRedo" } }, on: { onClick: ui3("redo") } }
|
|
4859
4782
|
]
|
|
4860
4783
|
}
|
|
4861
4784
|
},
|
|
@@ -4864,7 +4787,7 @@ var HISTORY_DECLARATION = {
|
|
|
4864
4787
|
component: "fragment",
|
|
4865
4788
|
children: [
|
|
4866
4789
|
{ component: "chrome/Text", props: { role: { value: "number" } }, children: [text3({ input: "view.counter" })] },
|
|
4867
|
-
{ component: "chrome/IconButton", when: { input: "view.clearAllowed" }, props: { size: { value: "sm" }, icon: { node: { component: "
|
|
4790
|
+
{ component: "chrome/IconButton", when: { input: "view.clearAllowed" }, props: { size: { value: "sm" }, icon: { node: { component: "icons/Trash" } }, label: { value: "Clear history" } }, on: { onClick: ui3("requestClear") } }
|
|
4868
4791
|
]
|
|
4869
4792
|
}
|
|
4870
4793
|
}
|
|
@@ -4901,7 +4824,7 @@ var HISTORY_DECLARATION = {
|
|
|
4901
4824
|
struck: { item: "future" },
|
|
4902
4825
|
noIcon: { item: "hideIcon" },
|
|
4903
4826
|
interactive: { item: "jumpable" },
|
|
4904
|
-
icon: { node: { component: "
|
|
4827
|
+
icon: { node: { component: "icons/HistoryEntry", props: { name: { item: "iconName" } } } },
|
|
4905
4828
|
label: { item: "label" },
|
|
4906
4829
|
meta: { item: "meta" },
|
|
4907
4830
|
"data-history-row": { item: "key" },
|
|
@@ -4910,7 +4833,7 @@ var HISTORY_DECLARATION = {
|
|
|
4910
4833
|
node: {
|
|
4911
4834
|
component: "fragment",
|
|
4912
4835
|
children: [
|
|
4913
|
-
{ component: "
|
|
4836
|
+
{ component: "icons/Pending", when: { item: "pending" } },
|
|
4914
4837
|
{ component: "chrome/Badge", when: { item: "failed" }, props: { size: { value: "sm" }, tone: { value: "error" } }, children: [text3({ value: "failed" })] },
|
|
4915
4838
|
{ component: "chrome/Badge", when: { item: "showSource" }, props: { size: { value: "sm" }, title: { item: "sourceTitle" } }, children: [text3({ item: "sourceGlyph" })] },
|
|
4916
4839
|
{ component: "chrome/Badge", when: { item: "showCoalesced" }, props: { size: { value: "sm" }, title: { item: "coalescedTitle" } }, children: [text3({ item: "coalescedText" })] },
|
|
@@ -4947,130 +4870,35 @@ var HISTORY_DECLARATION = {
|
|
|
4947
4870
|
|
|
4948
4871
|
// src/edit/history/react/HistoryPanelView.tsx
|
|
4949
4872
|
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";
|
|
4950
|
-
|
|
4951
|
-
// src/edit/history/react/icons.tsx
|
|
4952
|
-
import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
4953
|
-
var svgBase = (size) => ({
|
|
4954
|
-
width: size,
|
|
4955
|
-
height: size,
|
|
4956
|
-
viewBox: "0 0 24 24",
|
|
4957
|
-
fill: "none",
|
|
4958
|
-
stroke: "currentColor",
|
|
4959
|
-
strokeWidth: 1.5,
|
|
4960
|
-
strokeLinecap: "round",
|
|
4961
|
-
strokeLinejoin: "round",
|
|
4962
|
-
"aria-hidden": true
|
|
4963
|
-
});
|
|
4964
|
-
var ENTRY_PATHS = {
|
|
4965
|
-
// painting
|
|
4966
|
-
brush: ["M9.06 11.9l8.07-8.06a2.85 2.85 0 1 1 4.03 4.03l-8.06 8.08", "M7.07 14.94c-1.66 0-3 1.35-3 3.02 0 1.33-2.5 1.52-2 2.02 1.08 1.1 2.49 2.02 4 2.02 2.2 0 4-1.8 4-4.04a3.01 3.01 0 0 0-3-3.02z"],
|
|
4967
|
-
eraser: ["m7 21-4.3-4.3a1 1 0 0 1 0-1.4l10-10a1 1 0 0 1 1.4 0l5.6 5.6a1 1 0 0 1 0 1.4L13 21", "M22 21H7"],
|
|
4968
|
-
fill: ["m19 11-8-8-8.6 8.6a2 2 0 0 0 0 2.8l5.2 5.2a2 2 0 0 0 2.8 0L19 11Z", "m5 2 5 5", "M2 13h15"],
|
|
4969
|
-
// adjustment / effects
|
|
4970
|
-
filter: ["M4 6h16", "M7 12h10", "M10 18h4"],
|
|
4971
|
-
// geometry
|
|
4972
|
-
transform: ["M5 9 2 12l3 3", "M9 5l3-3 3 3", "M15 19l-3 3-3-3", "M19 9l3 3-3 3", "M2 12h20", "M12 2v20"],
|
|
4973
|
-
crop: ["M6 2v14a2 2 0 0 0 2 2h14", "M18 22V8a2 2 0 0 0-2-2H2"],
|
|
4974
|
-
// layers
|
|
4975
|
-
addLayer: ["M3 3h18v18H3z", "M12 8v8", "M8 12h8"],
|
|
4976
|
-
deleteLayer: ["M3 6h18", "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6", "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"],
|
|
4977
|
-
merge: ["m12 2 4 4-4 4", "M4 6h12", "m12 14 4 4-4 4", "M4 18h12"],
|
|
4978
|
-
// clipboard / text / selection
|
|
4979
|
-
paste: ["M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2", "M9 2h6v4H9z"],
|
|
4980
|
-
text: ["M4 7V4h16v3", "M9 20h6", "M12 4v16"],
|
|
4981
|
-
selection: ["M4 8V6a2 2 0 0 1 2-2h2", "M16 4h2a2 2 0 0 1 2 2v2", "M20 16v2a2 2 0 0 1-2 2h-2", "M8 20H6a2 2 0 0 1-2-2v-2"],
|
|
4982
|
-
// ai + snapshots
|
|
4983
|
-
ai: ["m12 3 1.9 5.8L20 10l-5.2 2.9L13 19l-2.9-5.2L4 12l6.1-1.9z"],
|
|
4984
|
-
snapshot: ["M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3Z", "M15 13a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"],
|
|
4985
|
-
// timeline / audio
|
|
4986
|
-
keyframe: ["m12 3 6 9-6 9-6-9z"],
|
|
4987
|
-
clip: ["M3 5h18v14H3z", "M8 5v14", "M16 5v14"],
|
|
4988
|
-
volume: ["M11 5 6 9H2v6h4l5 4V5Z", "M16 9a4 4 0 0 1 0 6"],
|
|
4989
|
-
document: ["M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", "M14 2v5h6"],
|
|
4990
|
-
// fallbacks / chrome
|
|
4991
|
-
generic: ["M5 5h14v14H5z"],
|
|
4992
|
-
original: ["M3 12a9 9 0 1 0 9-9", "M3 4v5h5"],
|
|
4993
|
-
rotateCcw: ["M3 12a9 9 0 1 0 3-6.7L3 8", "M3 3v5h5"]
|
|
4994
|
-
};
|
|
4995
|
-
function EntryIcon({ name, size = 11 }) {
|
|
4996
|
-
const paths = ENTRY_PATHS[name] ?? ENTRY_PATHS.generic;
|
|
4997
|
-
return /* @__PURE__ */ jsx7("svg", { ...svgBase(size), children: paths.map((d, i) => /* @__PURE__ */ jsx7("path", { d }, i)) });
|
|
4998
|
-
}
|
|
4999
|
-
function XIcon2({ size = 10 }) {
|
|
5000
|
-
return /* @__PURE__ */ jsxs6("svg", { ...svgBase(size), children: [
|
|
5001
|
-
/* @__PURE__ */ jsx7("path", { d: "M18 6 6 18" }),
|
|
5002
|
-
/* @__PURE__ */ jsx7("path", { d: "m6 6 12 12" })
|
|
5003
|
-
] });
|
|
5004
|
-
}
|
|
5005
|
-
function TrashIcon({ size = 11 }) {
|
|
5006
|
-
return /* @__PURE__ */ jsxs6("svg", { ...svgBase(size), children: [
|
|
5007
|
-
/* @__PURE__ */ jsx7("path", { d: "M3 6h18" }),
|
|
5008
|
-
/* @__PURE__ */ jsx7("path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6" }),
|
|
5009
|
-
/* @__PURE__ */ jsx7("path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" })
|
|
5010
|
-
] });
|
|
5011
|
-
}
|
|
5012
|
-
function UndoIcon({ size = 11 }) {
|
|
5013
|
-
return /* @__PURE__ */ jsxs6("svg", { ...svgBase(size), children: [
|
|
5014
|
-
/* @__PURE__ */ jsx7("path", { d: "M9 14 4 9l5-5" }),
|
|
5015
|
-
/* @__PURE__ */ jsx7("path", { d: "M4 9h10.5a5.5 5.5 0 0 1 0 11H11" })
|
|
5016
|
-
] });
|
|
5017
|
-
}
|
|
5018
|
-
function RedoIcon({ size = 11 }) {
|
|
5019
|
-
return /* @__PURE__ */ jsxs6("svg", { ...svgBase(size), children: [
|
|
5020
|
-
/* @__PURE__ */ jsx7("path", { d: "m15 14 5-5-5-5" }),
|
|
5021
|
-
/* @__PURE__ */ jsx7("path", { d: "M20 9H9.5a5.5 5.5 0 0 0 0 11H13" })
|
|
5022
|
-
] });
|
|
5023
|
-
}
|
|
5024
|
-
function PendingGlyph({ size = 9 }) {
|
|
5025
|
-
return /* @__PURE__ */ jsx7(
|
|
5026
|
-
"span",
|
|
5027
|
-
{
|
|
5028
|
-
className: "xeno-history-spinner",
|
|
5029
|
-
"aria-label": "Pending",
|
|
5030
|
-
style: {
|
|
5031
|
-
width: size,
|
|
5032
|
-
height: size,
|
|
5033
|
-
borderRadius: 2,
|
|
5034
|
-
border: "1px solid currentColor",
|
|
5035
|
-
borderRightColor: "transparent",
|
|
5036
|
-
opacity: 0.8,
|
|
5037
|
-
display: "inline-block",
|
|
5038
|
-
flex: "0 0 auto"
|
|
5039
|
-
}
|
|
5040
|
-
}
|
|
5041
|
-
);
|
|
5042
|
-
}
|
|
5043
|
-
|
|
5044
|
-
// src/edit/history/react/HistoryPanelView.tsx
|
|
5045
|
-
import { Fragment as Fragment4, jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
4873
|
+
import { Fragment as Fragment4, jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
5046
4874
|
function HistoryPanelView({ controller }) {
|
|
5047
4875
|
const subscribe = useCallback4((cb) => controller.subscribe(cb), [controller]);
|
|
5048
4876
|
const getSnapshot = useCallback4(() => controller.getRevision(), [controller]);
|
|
5049
4877
|
useSyncExternalStore3(subscribe, getSnapshot, getSnapshot);
|
|
5050
4878
|
const view = historyViewState(controller);
|
|
5051
4879
|
const ui5 = (intent) => applyHistoryUi(controller, intent);
|
|
5052
|
-
return /* @__PURE__ */
|
|
5053
|
-
/* @__PURE__ */
|
|
4880
|
+
return /* @__PURE__ */ jsxs4(Column3, { className: "xeno-history-panel", children: [
|
|
4881
|
+
/* @__PURE__ */ jsx5(
|
|
5054
4882
|
Toolbar2,
|
|
5055
4883
|
{
|
|
5056
|
-
left: /* @__PURE__ */
|
|
5057
|
-
/* @__PURE__ */
|
|
5058
|
-
/* @__PURE__ */
|
|
4884
|
+
left: /* @__PURE__ */ jsxs4(Fragment4, { children: [
|
|
4885
|
+
/* @__PURE__ */ jsx5(IconButton4, { size: "sm", icon: /* @__PURE__ */ jsx5(UndoIcon, {}), label: "Undo", disabled: view.cannotUndo, onClick: () => ui5({ kind: "undo" }) }),
|
|
4886
|
+
/* @__PURE__ */ jsx5(IconButton4, { size: "sm", icon: /* @__PURE__ */ jsx5(RedoIcon, {}), label: "Redo", disabled: view.cannotRedo, onClick: () => ui5({ kind: "redo" }) })
|
|
5059
4887
|
] }),
|
|
5060
|
-
right: /* @__PURE__ */
|
|
5061
|
-
/* @__PURE__ */
|
|
5062
|
-
view.clearAllowed ? /* @__PURE__ */
|
|
4888
|
+
right: /* @__PURE__ */ jsxs4(Fragment4, { children: [
|
|
4889
|
+
/* @__PURE__ */ jsx5(Text4, { role: "number", children: view.counter }),
|
|
4890
|
+
view.clearAllowed ? /* @__PURE__ */ jsx5(IconButton4, { size: "sm", icon: /* @__PURE__ */ jsx5(TrashIcon, {}), label: "Clear history", onClick: () => ui5({ kind: "requestClear" }) }) : null
|
|
5063
4891
|
] }),
|
|
5064
|
-
children: view.searchShown ? /* @__PURE__ */
|
|
4892
|
+
children: view.searchShown ? /* @__PURE__ */ jsx5(SearchField3, { value: view.filter, onChange: (v) => ui5({ kind: "filter", value: v }), placeholder: "Search history", label: "Search history" }) : null
|
|
5065
4893
|
}
|
|
5066
4894
|
),
|
|
5067
|
-
view.confirmingClear ? /* @__PURE__ */
|
|
5068
|
-
view.pruned ? /* @__PURE__ */
|
|
5069
|
-
/* @__PURE__ */
|
|
5070
|
-
/* @__PURE__ */
|
|
5071
|
-
view.empty ? /* @__PURE__ */
|
|
4895
|
+
view.confirmingClear ? /* @__PURE__ */ jsx5(InlineConfirm, { message: "Clear all history?", label: "Confirm clear history", confirmLabel: "Clear", onConfirm: () => ui5({ kind: "confirmClear" }), onCancel: () => ui5({ kind: "cancelClear" }) }) : null,
|
|
4896
|
+
view.pruned ? /* @__PURE__ */ jsx5(Text4, { role: "caption", children: "Earlier history discarded (limit reached)" }) : null,
|
|
4897
|
+
/* @__PURE__ */ jsxs4(HistoryScroller, { controller, children: [
|
|
4898
|
+
/* @__PURE__ */ jsx5(RowList2, { role: "listbox", "aria-label": "History", children: /* @__PURE__ */ jsx5(VirtualWindow2, { totalHeight: view.totalHeight, offsetTop: view.offsetTop, children: view.rows.map((row2) => /* @__PURE__ */ jsx5(HistoryRowView, { row: row2, controller }, row2.key)) }) }),
|
|
4899
|
+
view.empty ? /* @__PURE__ */ jsx5(EmptyState3, { title: "No history" }) : null
|
|
5072
4900
|
] }),
|
|
5073
|
-
view.hasMemory ? /* @__PURE__ */
|
|
4901
|
+
view.hasMemory ? /* @__PURE__ */ jsx5(StatusBar2, { left: /* @__PURE__ */ jsx5(Text4, { role: "number", children: view.memoryText }), right: view.memoryDisk ? /* @__PURE__ */ jsx5(Text4, { role: "meta", children: view.memoryDisk }) : null }) : null
|
|
5074
4902
|
] });
|
|
5075
4903
|
}
|
|
5076
4904
|
function HistoryScroller({ controller, children }) {
|
|
@@ -5105,14 +4933,14 @@ function HistoryScroller({ controller, children }) {
|
|
|
5105
4933
|
},
|
|
5106
4934
|
[controller]
|
|
5107
4935
|
);
|
|
5108
|
-
return /* @__PURE__ */
|
|
4936
|
+
return /* @__PURE__ */ jsx5(ScrollArea3, { ref: scrollRef, onScroll, onKeyDown, onMouseLeave: () => controller.setHovered(null), tabIndex: 0, children });
|
|
5109
4937
|
}
|
|
5110
4938
|
function HistoryCancelButton({ entryId, controller }) {
|
|
5111
|
-
return /* @__PURE__ */
|
|
4939
|
+
return /* @__PURE__ */ jsx5(
|
|
5112
4940
|
IconButton4,
|
|
5113
4941
|
{
|
|
5114
4942
|
size: "sm",
|
|
5115
|
-
icon: /* @__PURE__ */
|
|
4943
|
+
icon: /* @__PURE__ */ jsx5(XIcon2, {}),
|
|
5116
4944
|
label: "Cancel operation",
|
|
5117
4945
|
onClick: (e) => {
|
|
5118
4946
|
e.stopPropagation();
|
|
@@ -5123,7 +4951,7 @@ function HistoryCancelButton({ entryId, controller }) {
|
|
|
5123
4951
|
}
|
|
5124
4952
|
function HistoryRowView({ row: row2, controller }) {
|
|
5125
4953
|
const ui5 = (intent) => applyHistoryUi(controller, intent);
|
|
5126
|
-
return /* @__PURE__ */
|
|
4954
|
+
return /* @__PURE__ */ jsx5(
|
|
5127
4955
|
Row2,
|
|
5128
4956
|
{
|
|
5129
4957
|
height: row2.height,
|
|
@@ -5132,18 +4960,18 @@ function HistoryRowView({ row: row2, controller }) {
|
|
|
5132
4960
|
struck: row2.future,
|
|
5133
4961
|
noIcon: row2.hideIcon,
|
|
5134
4962
|
interactive: row2.jumpable,
|
|
5135
|
-
icon: /* @__PURE__ */
|
|
4963
|
+
icon: /* @__PURE__ */ jsx5(EntryIcon, { name: row2.iconName }),
|
|
5136
4964
|
label: row2.label,
|
|
5137
4965
|
meta: row2.meta,
|
|
5138
4966
|
"data-history-row": row2.key,
|
|
5139
4967
|
title: row2.label,
|
|
5140
|
-
trailing: /* @__PURE__ */
|
|
5141
|
-
row2.pending ? /* @__PURE__ */
|
|
5142
|
-
row2.failed ? /* @__PURE__ */
|
|
5143
|
-
row2.showSource ? /* @__PURE__ */
|
|
5144
|
-
row2.showCoalesced ? /* @__PURE__ */
|
|
5145
|
-
row2.showTime ? /* @__PURE__ */
|
|
5146
|
-
row2.pending ? /* @__PURE__ */
|
|
4968
|
+
trailing: /* @__PURE__ */ jsxs4(Fragment4, { children: [
|
|
4969
|
+
row2.pending ? /* @__PURE__ */ jsx5(PendingGlyph, {}) : null,
|
|
4970
|
+
row2.failed ? /* @__PURE__ */ jsx5(Badge3, { size: "sm", tone: "error", children: "failed" }) : null,
|
|
4971
|
+
row2.showSource ? /* @__PURE__ */ jsx5(Badge3, { size: "sm", title: row2.sourceTitle, children: row2.sourceGlyph }) : null,
|
|
4972
|
+
row2.showCoalesced ? /* @__PURE__ */ jsx5(Badge3, { size: "sm", title: row2.coalescedTitle, children: row2.coalescedText }) : null,
|
|
4973
|
+
row2.showTime ? /* @__PURE__ */ jsx5(Text4, { role: "meta", children: row2.time }) : null,
|
|
4974
|
+
row2.pending ? /* @__PURE__ */ jsx5(HistoryCancelButton, { entryId: row2.cancelId, controller }) : null
|
|
5147
4975
|
] }),
|
|
5148
4976
|
onClick: () => ui5({ kind: "jump", entryId: row2.entryId }),
|
|
5149
4977
|
onMouseEnter: () => ui5({ kind: "hover", entryId: row2.entryId }),
|
|
@@ -5151,16 +4979,11 @@ function HistoryRowView({ row: row2, controller }) {
|
|
|
5151
4979
|
}
|
|
5152
4980
|
);
|
|
5153
4981
|
}
|
|
5154
|
-
var HISTORY_RUNTIME_UNITS = ["history/Scroller", "history/CancelButton"
|
|
4982
|
+
var HISTORY_RUNTIME_UNITS = ["history/Scroller", "history/CancelButton"];
|
|
5155
4983
|
function historyRuntimeComponents(controller) {
|
|
5156
4984
|
return {
|
|
5157
|
-
"history/Scroller": ({ children }) => /* @__PURE__ */
|
|
5158
|
-
"history/CancelButton": ({ entryId }) => /* @__PURE__ */
|
|
5159
|
-
"history/EntryIcon": EntryIcon,
|
|
5160
|
-
"history/PendingGlyph": PendingGlyph,
|
|
5161
|
-
"history/UndoIcon": UndoIcon,
|
|
5162
|
-
"history/RedoIcon": RedoIcon,
|
|
5163
|
-
"history/TrashIcon": TrashIcon
|
|
4985
|
+
"history/Scroller": ({ children }) => /* @__PURE__ */ jsx5(HistoryScroller, { controller, children }),
|
|
4986
|
+
"history/CancelButton": ({ entryId }) => /* @__PURE__ */ jsx5(HistoryCancelButton, { entryId, controller })
|
|
5164
4987
|
};
|
|
5165
4988
|
}
|
|
5166
4989
|
|
|
@@ -5299,10 +5122,10 @@ function rgbToHex(r, g, b) {
|
|
|
5299
5122
|
return `#${enc(r)}${enc(g)}${enc(b)}`;
|
|
5300
5123
|
}
|
|
5301
5124
|
function rgbaToCssHex(c) {
|
|
5302
|
-
const
|
|
5303
|
-
if (finite(c.a, 1) >= 1) return
|
|
5125
|
+
const base = rgbToHex(c.r, c.g, c.b);
|
|
5126
|
+
if (finite(c.a, 1) >= 1) return base;
|
|
5304
5127
|
const a = clamp2(Math.round(clamp2(finite(c.a, 1), 0, 1) * 255), 0, 255).toString(16).padStart(2, "0");
|
|
5305
|
-
return `${
|
|
5128
|
+
return `${base}${a}`;
|
|
5306
5129
|
}
|
|
5307
5130
|
function rgbToHsv(r, g, b) {
|
|
5308
5131
|
const rn = clamp2(finite(r), 0, 255) / 255;
|
|
@@ -6301,7 +6124,7 @@ var COLOR_DECLARATION = {
|
|
|
6301
6124
|
row(
|
|
6302
6125
|
[
|
|
6303
6126
|
{ component: "chrome/ColorChip", props: { color: { input: "view.hex" }, label: { value: "Foreground" }, pressed: { input: "view.fgActive" } }, on: { onClick: ui4("setChannel", { channel: { value: "fg" } }) } },
|
|
6304
|
-
{ component: "chrome/IconButton", props: { size: { value: "sm" }, icon: { node: { component: "
|
|
6127
|
+
{ component: "chrome/IconButton", props: { size: { value: "sm" }, icon: { node: { component: "icons/Swap" } }, label: { value: "Swap FG/BG (X)" } }, on: { onClick: ui4("swapChannels") } },
|
|
6305
6128
|
{ component: "chrome/ColorChip", props: { color: { value: null }, label: { value: "Background" }, pressed: { input: "view.bgActive" } }, on: { onClick: ui4("setChannel", { channel: { value: "bg" } }) } }
|
|
6306
6129
|
],
|
|
6307
6130
|
{},
|
|
@@ -6314,7 +6137,7 @@ var COLOR_DECLARATION = {
|
|
|
6314
6137
|
{ component: "chrome/Input", when: { input: "view.isHex" }, props: { variant: { value: "mono" }, label: { value: "Hex" }, value: { input: "view.hex" }, disabled: { input: "view.bound" } }, on: { onChange: ui4("setHex", { value: { arg: "" } }) } },
|
|
6315
6138
|
{ component: "chrome/NumberInput", each: { input: "view.components", key: "key" }, props: { caption: { item: "label" }, value: { item: "value" }, disabled: { input: "view.bound" } }, on: { onChange: ui4("setComponent", { index: { item: "index" }, value: { arg: "" } }) } },
|
|
6316
6139
|
{ component: "chrome/NumberInput", when: { input: "view.alphaShown" }, props: { caption: { value: "A" }, label: { value: "Alpha" }, min: { value: 0 }, max: { value: 100 }, value: { input: "view.alphaPercent" }, disabled: { input: "view.bound" } }, on: { onChange: ui4("setAlpha", { percent: { arg: "" } }) } },
|
|
6317
|
-
{ component: "chrome/IconButton", props: { size: { value: "sm" }, icon: { node: { component: "
|
|
6140
|
+
{ component: "chrome/IconButton", props: { size: { value: "sm" }, icon: { node: { component: "icons/Eyedropper" } }, label: { value: "Pick from screen" } }, on: { onClick: ui4("eyedropper") } }
|
|
6318
6141
|
],
|
|
6319
6142
|
{ gap: { value: 4 } }
|
|
6320
6143
|
),
|
|
@@ -6432,54 +6255,33 @@ function drawAlphaStrip(ctx, w, h, hsv) {
|
|
|
6432
6255
|
|
|
6433
6256
|
// src/edit/color/react/ColorPanelView.tsx
|
|
6434
6257
|
import { CanvasSurface, ColorChip, Column as Column4, Field as Field2, IconButton as IconButton5, Input as Input3, NumberInput, Section as Section2, Select as Select3, Stack as Stack3, SwatchGrid, TextButton as TextButton2 } from "@xenosystem/components/chrome";
|
|
6435
|
-
|
|
6436
|
-
// src/edit/color/react/icons.tsx
|
|
6437
|
-
import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
6438
|
-
var svg = { width: 11, height: 11, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true };
|
|
6439
|
-
function EyedropperIcon() {
|
|
6440
|
-
return /* @__PURE__ */ jsxs8("svg", { ...svg, children: [
|
|
6441
|
-
/* @__PURE__ */ jsx9("path", { d: "m2 22 1-1h3l9-9" }),
|
|
6442
|
-
/* @__PURE__ */ jsx9("path", { d: "M3 21v-3l9-9" }),
|
|
6443
|
-
/* @__PURE__ */ jsx9("path", { d: "m15 6 3.4-3.4a2.1 2.1 0 1 1 3 3L18 9l.4.4a2.1 2.1 0 1 1-3 3l-3.8-3.8a2.1 2.1 0 1 1 3-3l.4.4Z" })
|
|
6444
|
-
] });
|
|
6445
|
-
}
|
|
6446
|
-
function SwapIcon() {
|
|
6447
|
-
return /* @__PURE__ */ jsxs8("svg", { ...svg, children: [
|
|
6448
|
-
/* @__PURE__ */ jsx9("path", { d: "m16 3 4 4-4 4" }),
|
|
6449
|
-
/* @__PURE__ */ jsx9("path", { d: "M20 7H4" }),
|
|
6450
|
-
/* @__PURE__ */ jsx9("path", { d: "m8 21-4-4 4-4" }),
|
|
6451
|
-
/* @__PURE__ */ jsx9("path", { d: "M4 17h16" })
|
|
6452
|
-
] });
|
|
6453
|
-
}
|
|
6454
|
-
|
|
6455
|
-
// src/edit/color/react/ColorPanelView.tsx
|
|
6456
|
-
import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
6258
|
+
import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
6457
6259
|
function ColorPanelView({ controller }) {
|
|
6458
6260
|
const subscribe = useCallback5((cb) => controller.subscribe(cb), [controller]);
|
|
6459
6261
|
const getSnapshot = useCallback5(() => controller.getRevision(), [controller]);
|
|
6460
6262
|
useSyncExternalStore4(subscribe, getSnapshot, getSnapshot);
|
|
6461
6263
|
const view = colorViewState(controller);
|
|
6462
6264
|
const ui5 = (intent) => applyColorUi(controller, intent);
|
|
6463
|
-
return /* @__PURE__ */
|
|
6464
|
-
view.fgBg ? /* @__PURE__ */
|
|
6465
|
-
/* @__PURE__ */
|
|
6466
|
-
/* @__PURE__ */
|
|
6467
|
-
/* @__PURE__ */
|
|
6265
|
+
return /* @__PURE__ */ jsx6(Column4, { className: "xeno-color-panel", children: /* @__PURE__ */ jsxs5(Stack3, { gap: 8, children: [
|
|
6266
|
+
view.fgBg ? /* @__PURE__ */ jsxs5(Stack3, { direction: "row", pad: "none", children: [
|
|
6267
|
+
/* @__PURE__ */ jsx6(ColorChip, { color: view.hex, label: "Foreground", pressed: view.fgActive, onClick: () => ui5({ kind: "setChannel", channel: "fg" }) }),
|
|
6268
|
+
/* @__PURE__ */ jsx6(IconButton5, { size: "sm", icon: /* @__PURE__ */ jsx6(SwapIcon, {}), label: "Swap FG/BG (X)", onClick: () => ui5({ kind: "swapChannels" }) }),
|
|
6269
|
+
/* @__PURE__ */ jsx6(ColorChip, { color: null, label: "Background", pressed: view.bgActive, onClick: () => ui5({ kind: "setChannel", channel: "bg" }) })
|
|
6468
6270
|
] }) : null,
|
|
6469
|
-
/* @__PURE__ */
|
|
6470
|
-
/* @__PURE__ */
|
|
6471
|
-
/* @__PURE__ */
|
|
6472
|
-
view.isHex ? /* @__PURE__ */
|
|
6473
|
-
view.components.map((comp) => /* @__PURE__ */
|
|
6474
|
-
view.alphaShown ? /* @__PURE__ */
|
|
6475
|
-
/* @__PURE__ */
|
|
6271
|
+
/* @__PURE__ */ jsx6(ColorPicker, { controller }),
|
|
6272
|
+
/* @__PURE__ */ jsxs5(Stack3, { direction: "row", pad: "none", gap: 4, children: [
|
|
6273
|
+
/* @__PURE__ */ jsx6(Select3, { size: "sm", label: "Color model", value: view.space, options: view.spaceOptions, onChange: (v) => ui5({ kind: "setSpace", space: v }) }),
|
|
6274
|
+
view.isHex ? /* @__PURE__ */ jsx6(Input3, { variant: "mono", label: "Hex", value: view.hex, onChange: (v) => ui5({ kind: "setHex", value: v }), disabled: view.bound }) : null,
|
|
6275
|
+
view.components.map((comp) => /* @__PURE__ */ jsx6(NumberInput, { caption: comp.label, value: comp.value, onChange: (n) => ui5({ kind: "setComponent", index: comp.index, value: n }), disabled: view.bound }, comp.key)),
|
|
6276
|
+
view.alphaShown ? /* @__PURE__ */ jsx6(NumberInput, { caption: "A", label: "Alpha", min: 0, max: 100, value: view.alphaPercent, onChange: (n) => ui5({ kind: "setAlpha", percent: n }), disabled: view.bound }) : null,
|
|
6277
|
+
/* @__PURE__ */ jsx6(IconButton5, { size: "sm", icon: /* @__PURE__ */ jsx6(EyedropperIcon, {}), label: "Pick from screen", onClick: () => ui5({ kind: "eyedropper" }) })
|
|
6476
6278
|
] }),
|
|
6477
|
-
view.hasTokens ? /* @__PURE__ */
|
|
6478
|
-
/* @__PURE__ */
|
|
6479
|
-
view.bound ? /* @__PURE__ */
|
|
6279
|
+
view.hasTokens ? /* @__PURE__ */ jsx6(Field2, { label: "Token", htmlFor: "xeno-color-token", children: /* @__PURE__ */ jsxs5(Stack3, { direction: "row", pad: "none", gap: 4, children: [
|
|
6280
|
+
/* @__PURE__ */ jsx6(Select3, { size: "sm", label: "Bind token", value: view.boundTokenId, placeholder: "\u2014 raw \u2014", options: view.tokenOptions, onChange: (id) => ui5({ kind: "bindToken", tokenId: id }) }),
|
|
6281
|
+
view.bound ? /* @__PURE__ */ jsx6(TextButton2, { onClick: () => ui5({ kind: "unbindToken" }), children: "Unbind" }) : null
|
|
6480
6282
|
] }) }) : null,
|
|
6481
|
-
/* @__PURE__ */
|
|
6482
|
-
view.hasRecent ? /* @__PURE__ */
|
|
6283
|
+
/* @__PURE__ */ jsx6(Section2, { title: "Swatches", flush: true, actions: /* @__PURE__ */ jsx6(TextButton2, { onClick: () => ui5({ kind: "addSwatch" }), children: "+ Save" }), children: /* @__PURE__ */ jsx6(SwatchGrid, { label: "Swatches", children: view.swatches.map((sw) => /* @__PURE__ */ jsx6(ColorChip, { size: "grid", color: sw.hex, label: sw.hex, onClick: () => ui5({ kind: "selectColor", hex: sw.hex }), onContextMenu: () => ui5({ kind: "removeSwatch", hex: sw.hex }) }, sw.key)) }) }),
|
|
6284
|
+
view.hasRecent ? /* @__PURE__ */ jsx6(Section2, { title: "Recent", flush: true, children: /* @__PURE__ */ jsx6(SwatchGrid, { label: "Recent", children: view.recent.map((r) => /* @__PURE__ */ jsx6(ColorChip, { size: "grid", color: r.hex, label: r.hex, onClick: () => ui5({ kind: "selectColor", hex: r.hex }) }, r.key)) }) }) : null
|
|
6483
6285
|
] }) });
|
|
6484
6286
|
}
|
|
6485
6287
|
function ColorPicker({ controller }) {
|
|
@@ -6557,8 +6359,8 @@ function ColorPicker({ controller }) {
|
|
|
6557
6359
|
controller.endDrag();
|
|
6558
6360
|
}
|
|
6559
6361
|
}, [controller]);
|
|
6560
|
-
return /* @__PURE__ */
|
|
6561
|
-
/* @__PURE__ */
|
|
6362
|
+
return /* @__PURE__ */ jsxs5(Stack3, { direction: "row", pad: "none", children: [
|
|
6363
|
+
/* @__PURE__ */ jsx6(
|
|
6562
6364
|
CanvasSurface,
|
|
6563
6365
|
{
|
|
6564
6366
|
ref: spectrumRef,
|
|
@@ -6573,7 +6375,7 @@ function ColorPicker({ controller }) {
|
|
|
6573
6375
|
onPointerUp: endDrag
|
|
6574
6376
|
}
|
|
6575
6377
|
),
|
|
6576
|
-
/* @__PURE__ */
|
|
6378
|
+
/* @__PURE__ */ jsx6(
|
|
6577
6379
|
CanvasSurface,
|
|
6578
6380
|
{
|
|
6579
6381
|
ref: hueRef,
|
|
@@ -6587,7 +6389,7 @@ function ColorPicker({ controller }) {
|
|
|
6587
6389
|
onPointerUp: endDrag
|
|
6588
6390
|
}
|
|
6589
6391
|
),
|
|
6590
|
-
controller.isAlphaShown() ? /* @__PURE__ */
|
|
6392
|
+
controller.isAlphaShown() ? /* @__PURE__ */ jsx6(
|
|
6591
6393
|
CanvasSurface,
|
|
6592
6394
|
{
|
|
6593
6395
|
ref: alphaRef,
|
|
@@ -6603,12 +6405,10 @@ function ColorPicker({ controller }) {
|
|
|
6603
6405
|
) : null
|
|
6604
6406
|
] });
|
|
6605
6407
|
}
|
|
6606
|
-
var COLOR_RUNTIME_UNITS = ["color/Picker"
|
|
6408
|
+
var COLOR_RUNTIME_UNITS = ["color/Picker"];
|
|
6607
6409
|
function colorRuntimeComponents(controller) {
|
|
6608
6410
|
return {
|
|
6609
|
-
"color/Picker": () => /* @__PURE__ */
|
|
6610
|
-
"color/SwapIcon": SwapIcon,
|
|
6611
|
-
"color/EyedropperIcon": EyedropperIcon
|
|
6411
|
+
"color/Picker": () => /* @__PURE__ */ jsx6(ColorPicker, { controller })
|
|
6612
6412
|
};
|
|
6613
6413
|
}
|
|
6614
6414
|
function clamp01(n) {
|
|
@@ -7355,7 +7155,7 @@ var CurveController = class {
|
|
|
7355
7155
|
const hit = modifiers.pan ? { kind: "plot" } : this.hitTest(x, y);
|
|
7356
7156
|
const tick = this.scale.xToTick(x);
|
|
7357
7157
|
const value = this.scale.yToValue(y);
|
|
7358
|
-
const
|
|
7158
|
+
const base = {
|
|
7359
7159
|
startX: x,
|
|
7360
7160
|
startY: y,
|
|
7361
7161
|
startTick: tick,
|
|
@@ -7368,13 +7168,13 @@ var CurveController = class {
|
|
|
7368
7168
|
additive: modifiers.additive === true
|
|
7369
7169
|
};
|
|
7370
7170
|
if (modifiers.pan) {
|
|
7371
|
-
this.drag = { ...
|
|
7171
|
+
this.drag = { ...base, kind: "pan" };
|
|
7372
7172
|
this.notify();
|
|
7373
7173
|
return true;
|
|
7374
7174
|
}
|
|
7375
7175
|
if (hit.kind === "tangent") {
|
|
7376
7176
|
this.drag = {
|
|
7377
|
-
...
|
|
7177
|
+
...base,
|
|
7378
7178
|
kind: "tangent",
|
|
7379
7179
|
tangent: { channelId: hit.channelId, keyId: hit.keyId, side: hit.side }
|
|
7380
7180
|
};
|
|
@@ -7393,12 +7193,12 @@ var CurveController = class {
|
|
|
7393
7193
|
origin[keyRefId(candidate)] = { tick: found.key.tick, value: found.key.value };
|
|
7394
7194
|
editable.push(candidate);
|
|
7395
7195
|
}
|
|
7396
|
-
this.drag = { ...
|
|
7196
|
+
this.drag = { ...base, kind: "moveKeys", keys: editable, origin };
|
|
7397
7197
|
this.notify();
|
|
7398
7198
|
return true;
|
|
7399
7199
|
}
|
|
7400
7200
|
this.drag = {
|
|
7401
|
-
...
|
|
7201
|
+
...base,
|
|
7402
7202
|
kind: "marquee",
|
|
7403
7203
|
marquee: { fromTick: tick, toTick: tick, fromValue: value, toValue: value }
|
|
7404
7204
|
};
|
|
@@ -7898,7 +7698,7 @@ var curveManifest = {
|
|
|
7898
7698
|
import { useCallback as useCallback6, useEffect as useEffect5, useRef as useRef6, useSyncExternalStore as useSyncExternalStore5 } from "react";
|
|
7899
7699
|
import { EmptyState as EmptyState4, StatusBar as StatusBar3, Toolbar as Toolbar3, ToolbarGroup } from "@xenosystem/components/chrome";
|
|
7900
7700
|
import { formatTick } from "@xenosystem/time-core";
|
|
7901
|
-
import { Fragment as Fragment5, jsx as
|
|
7701
|
+
import { Fragment as Fragment5, jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
7902
7702
|
var DASHES = ["none", "4 2", "1 2", "6 2 1 2"];
|
|
7903
7703
|
function CurvePanelView({ controller, showPresets = true }) {
|
|
7904
7704
|
const state = useSyncExternalStore5(controller.subscribe, controller.getState, controller.getState);
|
|
@@ -7977,21 +7777,21 @@ function CurvePanelView({ controller, showPresets = true }) {
|
|
|
7977
7777
|
const preview = state.preview;
|
|
7978
7778
|
const selected = new Set(state.selection.keys.map(keyRefId));
|
|
7979
7779
|
const channels = state.curves?.channels ?? [];
|
|
7980
|
-
return /* @__PURE__ */
|
|
7981
|
-
/* @__PURE__ */
|
|
7780
|
+
return /* @__PURE__ */ jsxs6("div", { style: SHELL, children: [
|
|
7781
|
+
/* @__PURE__ */ jsx7(
|
|
7982
7782
|
Toolbar3,
|
|
7983
7783
|
{
|
|
7984
|
-
left: /* @__PURE__ */
|
|
7985
|
-
right: /* @__PURE__ */
|
|
7986
|
-
["aligned", "broken", "flat"].map((mode) => /* @__PURE__ */
|
|
7987
|
-
/* @__PURE__ */
|
|
7784
|
+
left: /* @__PURE__ */ jsx7(ToolbarGroup, { children: ["linear", "bezier", "hold", "step"].map((mode) => /* @__PURE__ */ jsx7("button", { type: "button", style: button(), onClick: () => controller.setInterpolation(mode), children: mode }, mode)) }),
|
|
7785
|
+
right: /* @__PURE__ */ jsxs6(ToolbarGroup, { end: true, children: [
|
|
7786
|
+
["aligned", "broken", "flat"].map((mode) => /* @__PURE__ */ jsx7("button", { type: "button", style: button(), onClick: () => controller.setTangentMode(mode), children: mode }, mode)),
|
|
7787
|
+
/* @__PURE__ */ jsx7("button", { type: "button", style: button(), onClick: () => controller.fitAll(), children: "Fit" })
|
|
7988
7788
|
] })
|
|
7989
7789
|
}
|
|
7990
7790
|
),
|
|
7991
|
-
showPresets ? /* @__PURE__ */
|
|
7791
|
+
showPresets ? /* @__PURE__ */ jsx7(
|
|
7992
7792
|
Toolbar3,
|
|
7993
7793
|
{
|
|
7994
|
-
left: /* @__PURE__ */
|
|
7794
|
+
left: /* @__PURE__ */ jsx7(ToolbarGroup, { children: EASING_PRESETS.slice(0, 6).map((preset) => /* @__PURE__ */ jsx7(
|
|
7995
7795
|
"button",
|
|
7996
7796
|
{
|
|
7997
7797
|
type: "button",
|
|
@@ -8004,7 +7804,7 @@ function CurvePanelView({ controller, showPresets = true }) {
|
|
|
8004
7804
|
)) })
|
|
8005
7805
|
}
|
|
8006
7806
|
) : null,
|
|
8007
|
-
channels.length === 0 ? /* @__PURE__ */
|
|
7807
|
+
channels.length === 0 ? /* @__PURE__ */ jsx7(EmptyState4, { title: "No curves", hint: "Wire an animated property into this panel's input." }) : /* @__PURE__ */ jsx7(
|
|
8008
7808
|
"div",
|
|
8009
7809
|
{
|
|
8010
7810
|
ref: containerRef,
|
|
@@ -8018,7 +7818,7 @@ function CurvePanelView({ controller, showPresets = true }) {
|
|
|
8018
7818
|
onPointerUp,
|
|
8019
7819
|
onPointerCancel: onPointerUp,
|
|
8020
7820
|
onKeyDown,
|
|
8021
|
-
children: /* @__PURE__ */
|
|
7821
|
+
children: /* @__PURE__ */ jsxs6(
|
|
8022
7822
|
"svg",
|
|
8023
7823
|
{
|
|
8024
7824
|
"data-canvas": "curve-plot",
|
|
@@ -8026,7 +7826,7 @@ function CurvePanelView({ controller, showPresets = true }) {
|
|
|
8026
7826
|
height: "100%",
|
|
8027
7827
|
style: { position: "absolute", inset: 0, display: "block" },
|
|
8028
7828
|
children: [
|
|
8029
|
-
/* @__PURE__ */
|
|
7829
|
+
/* @__PURE__ */ jsx7(
|
|
8030
7830
|
"line",
|
|
8031
7831
|
{
|
|
8032
7832
|
x1: scale.gutterPx,
|
|
@@ -8036,7 +7836,7 @@ function CurvePanelView({ controller, showPresets = true }) {
|
|
|
8036
7836
|
stroke: "var(--xeno-control)"
|
|
8037
7837
|
}
|
|
8038
7838
|
),
|
|
8039
|
-
scale.minValue < 0 && scale.maxValue > 0 ? /* @__PURE__ */
|
|
7839
|
+
scale.minValue < 0 && scale.maxValue > 0 ? /* @__PURE__ */ jsx7(
|
|
8040
7840
|
"line",
|
|
8041
7841
|
{
|
|
8042
7842
|
x1: scale.gutterPx,
|
|
@@ -8051,7 +7851,7 @@ function CurvePanelView({ controller, showPresets = true }) {
|
|
|
8051
7851
|
const channel = channels.find((c) => c.id === series.channelId);
|
|
8052
7852
|
if (!channel || series.points.length === 0) return null;
|
|
8053
7853
|
const d = series.points.map((p, i) => `${i === 0 ? "M" : "L"}${scale.tickToX(p.tick).toFixed(2)},${scale.valueToY(p.value).toFixed(2)}`).join(" ");
|
|
8054
|
-
return /* @__PURE__ */
|
|
7854
|
+
return /* @__PURE__ */ jsx7(
|
|
8055
7855
|
"path",
|
|
8056
7856
|
{
|
|
8057
7857
|
d,
|
|
@@ -8071,9 +7871,9 @@ function CurvePanelView({ controller, showPresets = true }) {
|
|
|
8071
7871
|
const x = scale.tickToX(shown.tick);
|
|
8072
7872
|
const y = scale.valueToY(shown.value);
|
|
8073
7873
|
const isSelected = selected.has(id);
|
|
8074
|
-
return /* @__PURE__ */
|
|
8075
|
-
isSelected ? /* @__PURE__ */
|
|
8076
|
-
/* @__PURE__ */
|
|
7874
|
+
return /* @__PURE__ */ jsxs6("g", { children: [
|
|
7875
|
+
isSelected ? /* @__PURE__ */ jsx7(Handles, { keyframe: key, x, y, scale }) : null,
|
|
7876
|
+
/* @__PURE__ */ jsx7(
|
|
8077
7877
|
"rect",
|
|
8078
7878
|
{
|
|
8079
7879
|
x: x - 3,
|
|
@@ -8089,7 +7889,7 @@ function CurvePanelView({ controller, showPresets = true }) {
|
|
|
8089
7889
|
] }, id);
|
|
8090
7890
|
})
|
|
8091
7891
|
),
|
|
8092
|
-
preview?.marquee ? /* @__PURE__ */
|
|
7892
|
+
preview?.marquee ? /* @__PURE__ */ jsx7(
|
|
8093
7893
|
"rect",
|
|
8094
7894
|
{
|
|
8095
7895
|
x: Math.min(scale.tickToX(preview.marquee.fromTick), scale.tickToX(preview.marquee.toTick)),
|
|
@@ -8102,7 +7902,7 @@ function CurvePanelView({ controller, showPresets = true }) {
|
|
|
8102
7902
|
stroke: "var(--xeno-active)"
|
|
8103
7903
|
}
|
|
8104
7904
|
) : null,
|
|
8105
|
-
state.playheadTick !== null ? /* @__PURE__ */
|
|
7905
|
+
state.playheadTick !== null ? /* @__PURE__ */ jsx7(
|
|
8106
7906
|
"line",
|
|
8107
7907
|
{
|
|
8108
7908
|
x1: scale.tickToX(state.playheadTick),
|
|
@@ -8117,11 +7917,11 @@ function CurvePanelView({ controller, showPresets = true }) {
|
|
|
8117
7917
|
)
|
|
8118
7918
|
}
|
|
8119
7919
|
),
|
|
8120
|
-
/* @__PURE__ */
|
|
7920
|
+
/* @__PURE__ */ jsx7(
|
|
8121
7921
|
StatusBar3,
|
|
8122
7922
|
{
|
|
8123
7923
|
left: `${channels.length} channel${channels.length === 1 ? "" : "s"}`,
|
|
8124
|
-
right: /* @__PURE__ */
|
|
7924
|
+
right: /* @__PURE__ */ jsx7("span", { className: "tabular-nums", children: state.playheadTick !== null ? formatTick(state.playheadTick, state.timebase) : "" })
|
|
8125
7925
|
}
|
|
8126
7926
|
)
|
|
8127
7927
|
] });
|
|
@@ -8133,14 +7933,14 @@ function Handles({
|
|
|
8133
7933
|
scale
|
|
8134
7934
|
}) {
|
|
8135
7935
|
const sides = ["in", "out"];
|
|
8136
|
-
return /* @__PURE__ */
|
|
7936
|
+
return /* @__PURE__ */ jsx7(Fragment5, { children: sides.map((side) => {
|
|
8137
7937
|
const tangent = side === "in" ? keyframe.tangentIn : keyframe.tangentOut;
|
|
8138
7938
|
if (!tangent) return null;
|
|
8139
7939
|
const hx = scale.tickToX(keyframe.tick + tangent.x);
|
|
8140
7940
|
const hy = scale.valueToY(keyframe.value + tangent.y);
|
|
8141
|
-
return /* @__PURE__ */
|
|
8142
|
-
/* @__PURE__ */
|
|
8143
|
-
/* @__PURE__ */
|
|
7941
|
+
return /* @__PURE__ */ jsxs6("g", { children: [
|
|
7942
|
+
/* @__PURE__ */ jsx7("line", { x1: x, y1: y, x2: hx, y2: hy, stroke: "var(--xeno-active)", strokeWidth: 1 }),
|
|
7943
|
+
/* @__PURE__ */ jsx7("rect", { x: hx - 2, y: hy - 2, width: 4, height: 4, fill: "var(--xeno-text)" })
|
|
8144
7944
|
] }, side);
|
|
8145
7945
|
}) });
|
|
8146
7946
|
}
|
|
@@ -8774,7 +8574,7 @@ var viewportManifest = {
|
|
|
8774
8574
|
// src/edit/viewport/react/ViewportPanelView.tsx
|
|
8775
8575
|
import { useEffect as useEffect6, useRef as useRef7, useSyncExternalStore as useSyncExternalStore6 } from "react";
|
|
8776
8576
|
import { Badge as Badge4, StatusBar as StatusBar4 } from "@xenosystem/components/chrome";
|
|
8777
|
-
import { jsx as
|
|
8577
|
+
import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
8778
8578
|
var SLOT_STYLE = {
|
|
8779
8579
|
"top-left": { top: 8, left: 8 },
|
|
8780
8580
|
"top-center": { top: 8, left: "50%", transform: "translateX(-50%)" },
|
|
@@ -8802,7 +8602,7 @@ function ViewportPanelView({
|
|
|
8802
8602
|
return controller.mount(canvas, container);
|
|
8803
8603
|
}, [controller]);
|
|
8804
8604
|
const hidden = new Set(state.hiddenSlots);
|
|
8805
|
-
return /* @__PURE__ */
|
|
8605
|
+
return /* @__PURE__ */ jsxs7(
|
|
8806
8606
|
"div",
|
|
8807
8607
|
{
|
|
8808
8608
|
ref: containerRef,
|
|
@@ -8841,7 +8641,7 @@ function ViewportPanelView({
|
|
|
8841
8641
|
touchAction: "none"
|
|
8842
8642
|
},
|
|
8843
8643
|
children: [
|
|
8844
|
-
/* @__PURE__ */
|
|
8644
|
+
/* @__PURE__ */ jsx8(
|
|
8845
8645
|
"canvas",
|
|
8846
8646
|
{
|
|
8847
8647
|
ref: canvasRef,
|
|
@@ -8852,7 +8652,7 @@ function ViewportPanelView({
|
|
|
8852
8652
|
VIEWPORT_SLOTS.map((slot) => {
|
|
8853
8653
|
const content = overlays?.[slot];
|
|
8854
8654
|
if (!content || hidden.has(slot)) return null;
|
|
8855
|
-
return /* @__PURE__ */
|
|
8655
|
+
return /* @__PURE__ */ jsx8(
|
|
8856
8656
|
"div",
|
|
8857
8657
|
{
|
|
8858
8658
|
"data-viewport-slot": slot,
|
|
@@ -8870,7 +8670,7 @@ function ViewportPanelView({
|
|
|
8870
8670
|
slot
|
|
8871
8671
|
);
|
|
8872
8672
|
}),
|
|
8873
|
-
state.contextLost ? /* @__PURE__ */
|
|
8673
|
+
state.contextLost ? /* @__PURE__ */ jsx8(
|
|
8874
8674
|
"div",
|
|
8875
8675
|
{
|
|
8876
8676
|
style: {
|
|
@@ -8883,10 +8683,10 @@ function ViewportPanelView({
|
|
|
8883
8683
|
fontSize: 11,
|
|
8884
8684
|
zIndex: 20
|
|
8885
8685
|
},
|
|
8886
|
-
children: /* @__PURE__ */
|
|
8686
|
+
children: /* @__PURE__ */ jsx8(Badge4, { tone: "error", children: "graphics context lost \u2014 restoring" })
|
|
8887
8687
|
}
|
|
8888
8688
|
) : null,
|
|
8889
|
-
showStats && state.stats ? /* @__PURE__ */
|
|
8689
|
+
showStats && state.stats ? /* @__PURE__ */ jsx8("div", { style: { position: "absolute", left: 0, right: 0, bottom: 0, zIndex: 10 }, children: /* @__PURE__ */ jsx8(
|
|
8890
8690
|
StatusBar4,
|
|
8891
8691
|
{
|
|
8892
8692
|
left: state.stats.fps !== void 0 ? `${Math.round(state.stats.fps)} fps` : void 0,
|
|
@@ -9553,35 +9353,30 @@ import {
|
|
|
9553
9353
|
Toolbar as Toolbar4,
|
|
9554
9354
|
ToolbarGroup as ToolbarGroup2
|
|
9555
9355
|
} from "@xenosystem/components/chrome";
|
|
9556
|
-
import { jsx as
|
|
9356
|
+
import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
9557
9357
|
function CaseIcon() {
|
|
9558
|
-
return /* @__PURE__ */
|
|
9559
|
-
/* @__PURE__ */ jsx13("path", { d: "m3 15 4-8 4 8" }),
|
|
9560
|
-
/* @__PURE__ */ jsx13("path", { d: "M4 13h6" }),
|
|
9561
|
-
/* @__PURE__ */ jsx13("circle", { cx: "18", cy: "12", r: "3" }),
|
|
9562
|
-
/* @__PURE__ */ jsx13("path", { d: "M21 9v6" })
|
|
9563
|
-
] });
|
|
9358
|
+
return /* @__PURE__ */ jsx9(CaseGlyph, { size: 12 });
|
|
9564
9359
|
}
|
|
9565
9360
|
function WordIcon() {
|
|
9566
|
-
return /* @__PURE__ */
|
|
9567
|
-
/* @__PURE__ */
|
|
9568
|
-
/* @__PURE__ */
|
|
9569
|
-
/* @__PURE__ */
|
|
9361
|
+
return /* @__PURE__ */ jsxs8("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: [
|
|
9362
|
+
/* @__PURE__ */ jsx9("path", { d: "M7 12h10" }),
|
|
9363
|
+
/* @__PURE__ */ jsx9("path", { d: "M3 7v10" }),
|
|
9364
|
+
/* @__PURE__ */ jsx9("path", { d: "M21 7v10" })
|
|
9570
9365
|
] });
|
|
9571
9366
|
}
|
|
9572
9367
|
function RegexIcon() {
|
|
9573
|
-
return /* @__PURE__ */
|
|
9574
|
-
/* @__PURE__ */
|
|
9575
|
-
/* @__PURE__ */
|
|
9576
|
-
/* @__PURE__ */
|
|
9577
|
-
/* @__PURE__ */
|
|
9368
|
+
return /* @__PURE__ */ jsxs8("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: [
|
|
9369
|
+
/* @__PURE__ */ jsx9("path", { d: "M12 4v8" }),
|
|
9370
|
+
/* @__PURE__ */ jsx9("path", { d: "m8.5 6 7 4" }),
|
|
9371
|
+
/* @__PURE__ */ jsx9("path", { d: "m8.5 10 7-4" }),
|
|
9372
|
+
/* @__PURE__ */ jsx9("path", { d: "M5 18h2" })
|
|
9578
9373
|
] });
|
|
9579
9374
|
}
|
|
9580
9375
|
function UpIcon() {
|
|
9581
|
-
return /* @__PURE__ */
|
|
9376
|
+
return /* @__PURE__ */ jsx9("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ jsx9("path", { d: "m18 15-6-6-6 6" }) });
|
|
9582
9377
|
}
|
|
9583
9378
|
function DownIcon() {
|
|
9584
|
-
return /* @__PURE__ */
|
|
9379
|
+
return /* @__PURE__ */ jsx9("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ jsx9("path", { d: "m6 9 6 6 6-6" }) });
|
|
9585
9380
|
}
|
|
9586
9381
|
function StatusLine({
|
|
9587
9382
|
status,
|
|
@@ -9592,14 +9387,14 @@ function StatusLine({
|
|
|
9592
9387
|
hasText
|
|
9593
9388
|
}) {
|
|
9594
9389
|
if (status === "invalidPattern") {
|
|
9595
|
-
return /* @__PURE__ */
|
|
9390
|
+
return /* @__PURE__ */ jsx9(Badge5, { tone: "error", title: message ?? void 0, children: "invalid pattern" });
|
|
9596
9391
|
}
|
|
9597
9392
|
if (status === "failed") {
|
|
9598
|
-
return /* @__PURE__ */
|
|
9393
|
+
return /* @__PURE__ */ jsx9(Badge5, { tone: "error", title: message ?? void 0, children: "search failed" });
|
|
9599
9394
|
}
|
|
9600
|
-
if (status === "searching") return /* @__PURE__ */
|
|
9395
|
+
if (status === "searching") return /* @__PURE__ */ jsx9(Badge5, { children: "searching\u2026" });
|
|
9601
9396
|
if (!hasText || status === "idle") return null;
|
|
9602
|
-
return /* @__PURE__ */
|
|
9397
|
+
return /* @__PURE__ */ jsxs8("span", { style: { fontVariantNumeric: "tabular-nums", fontSize: 10, opacity: 0.55 }, children: [
|
|
9603
9398
|
displayIndex,
|
|
9604
9399
|
"/",
|
|
9605
9400
|
count,
|
|
@@ -9622,7 +9417,7 @@ function FindPanelView({
|
|
|
9622
9417
|
controller.clear();
|
|
9623
9418
|
}
|
|
9624
9419
|
};
|
|
9625
|
-
const renderMatch = (match, index) => /* @__PURE__ */
|
|
9420
|
+
const renderMatch = (match, index) => /* @__PURE__ */ jsx9(
|
|
9626
9421
|
Row3,
|
|
9627
9422
|
{
|
|
9628
9423
|
noIcon: true,
|
|
@@ -9632,7 +9427,7 @@ function FindPanelView({
|
|
|
9632
9427
|
event.preventDefault();
|
|
9633
9428
|
controller.requestContextMenu?.(match.id, event.clientX, event.clientY);
|
|
9634
9429
|
},
|
|
9635
|
-
label: /* @__PURE__ */
|
|
9430
|
+
label: /* @__PURE__ */ jsx9("span", { children: highlightSegments(match.snippet ?? "", match.ranges).map((segment, i) => /* @__PURE__ */ jsx9(
|
|
9636
9431
|
"span",
|
|
9637
9432
|
{
|
|
9638
9433
|
style: segment.hit ? { background: "var(--xeno-control)", borderRadius: 2 } : void 0,
|
|
@@ -9645,11 +9440,11 @@ function FindPanelView({
|
|
|
9645
9440
|
match.id
|
|
9646
9441
|
);
|
|
9647
9442
|
let flatIndex = -1;
|
|
9648
|
-
return /* @__PURE__ */
|
|
9649
|
-
/* @__PURE__ */
|
|
9443
|
+
return /* @__PURE__ */ jsxs8("div", { style: { display: "flex", flexDirection: "column", height: "100%", minHeight: 0 }, onKeyDown, children: [
|
|
9444
|
+
/* @__PURE__ */ jsx9(
|
|
9650
9445
|
Toolbar4,
|
|
9651
9446
|
{
|
|
9652
|
-
left: /* @__PURE__ */
|
|
9447
|
+
left: /* @__PURE__ */ jsx9(
|
|
9653
9448
|
SearchField4,
|
|
9654
9449
|
{
|
|
9655
9450
|
value: state.text,
|
|
@@ -9657,42 +9452,42 @@ function FindPanelView({
|
|
|
9657
9452
|
placeholder
|
|
9658
9453
|
}
|
|
9659
9454
|
),
|
|
9660
|
-
right: /* @__PURE__ */
|
|
9661
|
-
/* @__PURE__ */
|
|
9455
|
+
right: /* @__PURE__ */ jsxs8(ToolbarGroup2, { end: true, children: [
|
|
9456
|
+
/* @__PURE__ */ jsx9(
|
|
9662
9457
|
IconButton6,
|
|
9663
9458
|
{
|
|
9664
9459
|
label: "Match case",
|
|
9665
9460
|
active: state.options.caseSensitive,
|
|
9666
9461
|
onClick: () => controller.setOptions({ caseSensitive: !state.options.caseSensitive }),
|
|
9667
|
-
icon: /* @__PURE__ */
|
|
9462
|
+
icon: /* @__PURE__ */ jsx9(CaseIcon, {})
|
|
9668
9463
|
}
|
|
9669
9464
|
),
|
|
9670
|
-
/* @__PURE__ */
|
|
9465
|
+
/* @__PURE__ */ jsx9(
|
|
9671
9466
|
IconButton6,
|
|
9672
9467
|
{
|
|
9673
9468
|
label: "Whole word",
|
|
9674
9469
|
active: state.options.wholeWord,
|
|
9675
9470
|
onClick: () => controller.setOptions({ wholeWord: !state.options.wholeWord }),
|
|
9676
|
-
icon: /* @__PURE__ */
|
|
9471
|
+
icon: /* @__PURE__ */ jsx9(WordIcon, {})
|
|
9677
9472
|
}
|
|
9678
9473
|
),
|
|
9679
|
-
/* @__PURE__ */
|
|
9474
|
+
/* @__PURE__ */ jsx9(
|
|
9680
9475
|
IconButton6,
|
|
9681
9476
|
{
|
|
9682
9477
|
label: "Regular expression",
|
|
9683
9478
|
active: state.options.regex,
|
|
9684
9479
|
onClick: () => controller.setOptions({ regex: !state.options.regex }),
|
|
9685
|
-
icon: /* @__PURE__ */
|
|
9480
|
+
icon: /* @__PURE__ */ jsx9(RegexIcon, {})
|
|
9686
9481
|
}
|
|
9687
9482
|
)
|
|
9688
9483
|
] })
|
|
9689
9484
|
}
|
|
9690
9485
|
),
|
|
9691
|
-
/* @__PURE__ */
|
|
9486
|
+
/* @__PURE__ */ jsx9(
|
|
9692
9487
|
Toolbar4,
|
|
9693
9488
|
{
|
|
9694
9489
|
divided: false,
|
|
9695
|
-
left: /* @__PURE__ */
|
|
9490
|
+
left: /* @__PURE__ */ jsx9(
|
|
9696
9491
|
StatusLine,
|
|
9697
9492
|
{
|
|
9698
9493
|
status: state.status,
|
|
@@ -9703,34 +9498,34 @@ function FindPanelView({
|
|
|
9703
9498
|
hasText: state.text !== ""
|
|
9704
9499
|
}
|
|
9705
9500
|
),
|
|
9706
|
-
right: /* @__PURE__ */
|
|
9707
|
-
/* @__PURE__ */
|
|
9501
|
+
right: /* @__PURE__ */ jsxs8(ToolbarGroup2, { end: true, children: [
|
|
9502
|
+
/* @__PURE__ */ jsx9(
|
|
9708
9503
|
IconButton6,
|
|
9709
9504
|
{
|
|
9710
9505
|
label: "Previous match",
|
|
9711
9506
|
disabled: state.matches.length === 0,
|
|
9712
9507
|
onClick: () => controller.previous(),
|
|
9713
|
-
icon: /* @__PURE__ */
|
|
9508
|
+
icon: /* @__PURE__ */ jsx9(UpIcon, {})
|
|
9714
9509
|
}
|
|
9715
9510
|
),
|
|
9716
|
-
/* @__PURE__ */
|
|
9511
|
+
/* @__PURE__ */ jsx9(
|
|
9717
9512
|
IconButton6,
|
|
9718
9513
|
{
|
|
9719
9514
|
label: "Next match",
|
|
9720
9515
|
disabled: state.matches.length === 0,
|
|
9721
9516
|
onClick: () => controller.next(),
|
|
9722
|
-
icon: /* @__PURE__ */
|
|
9517
|
+
icon: /* @__PURE__ */ jsx9(DownIcon, {})
|
|
9723
9518
|
}
|
|
9724
9519
|
),
|
|
9725
|
-
/* @__PURE__ */
|
|
9520
|
+
/* @__PURE__ */ jsx9(TextButton3, { onClick: () => controller.setReplaceVisible(!state.replaceVisible), children: state.replaceVisible ? "Hide replace" : "Replace" })
|
|
9726
9521
|
] })
|
|
9727
9522
|
}
|
|
9728
9523
|
),
|
|
9729
|
-
state.message && state.status === "invalidPattern" ? /* @__PURE__ */
|
|
9730
|
-
state.replaceVisible ? /* @__PURE__ */
|
|
9524
|
+
state.message && state.status === "invalidPattern" ? /* @__PURE__ */ jsx9("div", { style: { padding: "2px 8px 4px", fontSize: 9, opacity: 0.6 }, children: state.message }) : null,
|
|
9525
|
+
state.replaceVisible ? /* @__PURE__ */ jsx9(
|
|
9731
9526
|
Toolbar4,
|
|
9732
9527
|
{
|
|
9733
|
-
left: /* @__PURE__ */
|
|
9528
|
+
left: /* @__PURE__ */ jsx9(
|
|
9734
9529
|
SearchField4,
|
|
9735
9530
|
{
|
|
9736
9531
|
value: state.replaceText,
|
|
@@ -9738,9 +9533,9 @@ function FindPanelView({
|
|
|
9738
9533
|
placeholder: "Replace with"
|
|
9739
9534
|
}
|
|
9740
9535
|
),
|
|
9741
|
-
right: /* @__PURE__ */
|
|
9742
|
-
/* @__PURE__ */
|
|
9743
|
-
/* @__PURE__ */
|
|
9536
|
+
right: /* @__PURE__ */ jsxs8(ToolbarGroup2, { end: true, children: [
|
|
9537
|
+
/* @__PURE__ */ jsx9(TextButton3, { disabled: !state.canReplace, onClick: () => controller.replaceCurrent(), children: "Replace" }),
|
|
9538
|
+
/* @__PURE__ */ jsxs8(TextButton3, { disabled: !state.canReplace, onClick: () => controller.replaceAll(), children: [
|
|
9744
9539
|
"All (",
|
|
9745
9540
|
state.matches.length,
|
|
9746
9541
|
")"
|
|
@@ -9748,23 +9543,23 @@ function FindPanelView({
|
|
|
9748
9543
|
] })
|
|
9749
9544
|
}
|
|
9750
9545
|
) : null,
|
|
9751
|
-
showResults ? /* @__PURE__ */
|
|
9546
|
+
showResults ? /* @__PURE__ */ jsx9(ScrollArea4, { children: state.status === "idle" ? /* @__PURE__ */ jsx9(EmptyState5, { title: "Find", hint: "Type to search. Enter goes to the next match." }) : state.status === "invalidPattern" ? /* @__PURE__ */ jsx9(
|
|
9752
9547
|
EmptyState5,
|
|
9753
9548
|
{
|
|
9754
9549
|
title: "Invalid pattern",
|
|
9755
9550
|
hint: state.message ?? "The expression could not be read. Fix it to search."
|
|
9756
9551
|
}
|
|
9757
|
-
) : state.status === "failed" ? /* @__PURE__ */
|
|
9552
|
+
) : state.status === "failed" ? /* @__PURE__ */ jsx9(EmptyState5, { title: "Search failed", hint: state.message ?? "The host could not complete the search." }) : state.noResults ? /* @__PURE__ */ jsx9(EmptyState5, { title: "No matches", hint: `Nothing in scope matches \u201C${state.text}\u201D.` }) : state.groups.length === 1 && state.groups[0].id === "" ? /* @__PURE__ */ jsx9(RowList3, { children: state.matches.map((m) => renderMatch(m, ++flatIndex)) }) : state.groups.map((group) => /* @__PURE__ */ jsx9(
|
|
9758
9553
|
Section3,
|
|
9759
9554
|
{
|
|
9760
9555
|
title: group.label || "Results",
|
|
9761
9556
|
flush: true,
|
|
9762
|
-
badge: /* @__PURE__ */
|
|
9763
|
-
children: /* @__PURE__ */
|
|
9557
|
+
badge: /* @__PURE__ */ jsx9(Badge5, { children: group.matches.length }),
|
|
9558
|
+
children: /* @__PURE__ */ jsx9(RowList3, { children: group.matches.map((m) => renderMatch(m, ++flatIndex)) })
|
|
9764
9559
|
},
|
|
9765
9560
|
group.id
|
|
9766
9561
|
)) }) : null,
|
|
9767
|
-
/* @__PURE__ */
|
|
9562
|
+
/* @__PURE__ */ jsx9(
|
|
9768
9563
|
StatusBar5,
|
|
9769
9564
|
{
|
|
9770
9565
|
left: state.truncated ? `showing first ${state.matches.length}` : void 0,
|
|
@@ -10425,7 +10220,7 @@ import {
|
|
|
10425
10220
|
Toolbar as Toolbar5,
|
|
10426
10221
|
ToolbarGroup as ToolbarGroup3
|
|
10427
10222
|
} from "@xenosystem/components/chrome";
|
|
10428
|
-
import { Fragment as Fragment6, jsx as
|
|
10223
|
+
import { Fragment as Fragment6, jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
10429
10224
|
var ANCHOR_BADGE = {
|
|
10430
10225
|
live: null,
|
|
10431
10226
|
stale: {
|
|
@@ -10449,7 +10244,7 @@ function ThreadCard({
|
|
|
10449
10244
|
const badge = ANCHOR_BADGE[anchorState];
|
|
10450
10245
|
const replying = controller.getState().replyingTo === thread.id;
|
|
10451
10246
|
const orphaned = anchorState === "orphaned";
|
|
10452
|
-
return /* @__PURE__ */
|
|
10247
|
+
return /* @__PURE__ */ jsx10(
|
|
10453
10248
|
"div",
|
|
10454
10249
|
{
|
|
10455
10250
|
style: {
|
|
@@ -10463,13 +10258,13 @@ function ThreadCard({
|
|
|
10463
10258
|
event.preventDefault();
|
|
10464
10259
|
controller.requestContextMenu(thread.id, event.clientX, event.clientY);
|
|
10465
10260
|
},
|
|
10466
|
-
children: /* @__PURE__ */
|
|
10467
|
-
/* @__PURE__ */
|
|
10468
|
-
badge ? /* @__PURE__ */
|
|
10469
|
-
thread.resolved ? /* @__PURE__ */
|
|
10470
|
-
/* @__PURE__ */
|
|
10261
|
+
children: /* @__PURE__ */ jsxs9("div", { style: { padding: "6px 8px", display: "flex", flexDirection: "column", gap: 4 }, children: [
|
|
10262
|
+
/* @__PURE__ */ jsxs9("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
|
|
10263
|
+
badge ? /* @__PURE__ */ jsx10(Badge6, { tone: badge.tone, title: badge.title, children: badge.label }) : null,
|
|
10264
|
+
thread.resolved ? /* @__PURE__ */ jsx10(Badge6, { children: "resolved" }) : null,
|
|
10265
|
+
/* @__PURE__ */ jsx10("span", { style: { marginLeft: "auto", fontSize: 9, opacity: 0.4 }, children: formatAge(thread.createdAt, now) })
|
|
10471
10266
|
] }),
|
|
10472
|
-
thread.anchorLabel ? /* @__PURE__ */
|
|
10267
|
+
thread.anchorLabel ? /* @__PURE__ */ jsx10(
|
|
10473
10268
|
"button",
|
|
10474
10269
|
{
|
|
10475
10270
|
type: "button",
|
|
@@ -10492,15 +10287,15 @@ function ThreadCard({
|
|
|
10492
10287
|
children: thread.anchorLabel
|
|
10493
10288
|
}
|
|
10494
10289
|
) : null,
|
|
10495
|
-
view.messages.map((message) => /* @__PURE__ */
|
|
10496
|
-
/* @__PURE__ */
|
|
10497
|
-
/* @__PURE__ */
|
|
10498
|
-
/* @__PURE__ */
|
|
10499
|
-
message.editedAt ? /* @__PURE__ */
|
|
10290
|
+
view.messages.map((message) => /* @__PURE__ */ jsxs9("div", { style: { display: "flex", flexDirection: "column", gap: 1 }, children: [
|
|
10291
|
+
/* @__PURE__ */ jsxs9("div", { style: { display: "flex", alignItems: "baseline", gap: 4 }, children: [
|
|
10292
|
+
/* @__PURE__ */ jsx10("span", { style: { fontSize: 10, fontWeight: 600 }, children: message.authorName ?? message.authorId }),
|
|
10293
|
+
/* @__PURE__ */ jsx10("span", { style: { fontSize: 9, opacity: 0.35 }, children: formatAge(message.createdAt, now) }),
|
|
10294
|
+
message.editedAt ? /* @__PURE__ */ jsx10("span", { style: { fontSize: 9, opacity: 0.3 }, children: "edited" }) : null
|
|
10500
10295
|
] }),
|
|
10501
|
-
/* @__PURE__ */
|
|
10296
|
+
/* @__PURE__ */ jsx10("p", { style: { fontSize: 11, opacity: 0.75, margin: 0, whiteSpace: "pre-wrap" }, children: message.body })
|
|
10502
10297
|
] }, message.id)),
|
|
10503
|
-
allowReactions && thread.reactions?.length ? /* @__PURE__ */
|
|
10298
|
+
allowReactions && thread.reactions?.length ? /* @__PURE__ */ jsx10("div", { style: { display: "flex", gap: 4 }, children: thread.reactions.map((reaction) => /* @__PURE__ */ jsxs9(
|
|
10504
10299
|
TextButton4,
|
|
10505
10300
|
{
|
|
10506
10301
|
onClick: () => controller.react(
|
|
@@ -10516,8 +10311,8 @@ function ThreadCard({
|
|
|
10516
10311
|
},
|
|
10517
10312
|
reaction.emoji
|
|
10518
10313
|
)) }) : null,
|
|
10519
|
-
replying ? /* @__PURE__ */
|
|
10520
|
-
/* @__PURE__ */
|
|
10314
|
+
replying ? /* @__PURE__ */ jsxs9("div", { style: { display: "flex", gap: 4 }, children: [
|
|
10315
|
+
/* @__PURE__ */ jsx10(
|
|
10521
10316
|
"input",
|
|
10522
10317
|
{
|
|
10523
10318
|
value: controller.getState().replyDraft,
|
|
@@ -10544,11 +10339,11 @@ function ThreadCard({
|
|
|
10544
10339
|
}
|
|
10545
10340
|
}
|
|
10546
10341
|
),
|
|
10547
|
-
/* @__PURE__ */
|
|
10548
|
-
] }) : /* @__PURE__ */
|
|
10549
|
-
/* @__PURE__ */
|
|
10550
|
-
/* @__PURE__ */
|
|
10551
|
-
/* @__PURE__ */
|
|
10342
|
+
/* @__PURE__ */ jsx10(TextButton4, { onClick: () => controller.reply(thread.id), children: "Send" })
|
|
10343
|
+
] }) : /* @__PURE__ */ jsxs9("div", { style: { display: "flex", gap: 6 }, children: [
|
|
10344
|
+
/* @__PURE__ */ jsx10(TextButton4, { onClick: () => controller.setReplyingTo(thread.id), children: "Reply" }),
|
|
10345
|
+
/* @__PURE__ */ jsx10(TextButton4, { onClick: () => controller.resolve(thread.id, !thread.resolved), children: thread.resolved ? "Reopen" : "Resolve" }),
|
|
10346
|
+
/* @__PURE__ */ jsx10(TextButton4, { onClick: () => controller.remove(thread.id), children: "Delete" })
|
|
10552
10347
|
] })
|
|
10553
10348
|
] })
|
|
10554
10349
|
}
|
|
@@ -10564,11 +10359,11 @@ function CommentsPanelView({
|
|
|
10564
10359
|
const now = controller.clock();
|
|
10565
10360
|
const open = state.threads.filter((t) => !t.thread.resolved);
|
|
10566
10361
|
const resolved = state.threads.filter((t) => t.thread.resolved);
|
|
10567
|
-
return /* @__PURE__ */
|
|
10568
|
-
/* @__PURE__ */
|
|
10362
|
+
return /* @__PURE__ */ jsxs9("div", { style: { display: "flex", flexDirection: "column", height: "100%", minHeight: 0 }, children: [
|
|
10363
|
+
/* @__PURE__ */ jsx10(
|
|
10569
10364
|
Toolbar5,
|
|
10570
10365
|
{
|
|
10571
|
-
left: /* @__PURE__ */
|
|
10366
|
+
left: /* @__PURE__ */ jsx10(
|
|
10572
10367
|
SegmentedControl2,
|
|
10573
10368
|
{
|
|
10574
10369
|
label: "Show",
|
|
@@ -10581,7 +10376,7 @@ function CommentsPanelView({
|
|
|
10581
10376
|
]
|
|
10582
10377
|
}
|
|
10583
10378
|
),
|
|
10584
|
-
right: /* @__PURE__ */
|
|
10379
|
+
right: /* @__PURE__ */ jsx10(ToolbarGroup3, { end: true, children: /* @__PURE__ */ jsx10(
|
|
10585
10380
|
SegmentedControl2,
|
|
10586
10381
|
{
|
|
10587
10382
|
label: "Sort",
|
|
@@ -10596,33 +10391,33 @@ function CommentsPanelView({
|
|
|
10596
10391
|
) })
|
|
10597
10392
|
}
|
|
10598
10393
|
),
|
|
10599
|
-
state.totals.orphaned > 0 ? /* @__PURE__ */
|
|
10394
|
+
state.totals.orphaned > 0 ? /* @__PURE__ */ jsxs9("div", { style: { padding: "2px 8px", fontSize: 9, opacity: 0.6 }, children: [
|
|
10600
10395
|
state.totals.orphaned,
|
|
10601
10396
|
" comment",
|
|
10602
10397
|
state.totals.orphaned === 1 ? "" : "s",
|
|
10603
10398
|
" lost the content",
|
|
10604
10399
|
state.totals.orphaned === 1 ? " it was" : " they were",
|
|
10605
10400
|
" about.",
|
|
10606
|
-
state.filter.includeOrphaned === false ? /* @__PURE__ */
|
|
10401
|
+
state.filter.includeOrphaned === false ? /* @__PURE__ */ jsx10(TextButton4, { onClick: () => controller.setFilter({ includeOrphaned: true }), children: "Show" }) : null
|
|
10607
10402
|
] }) : null,
|
|
10608
|
-
/* @__PURE__ */
|
|
10403
|
+
/* @__PURE__ */ jsx10(ScrollArea5, { children: state.threads.length === 0 ? state.filteredEmpty ? (
|
|
10609
10404
|
// NOT "no comments". There are comments; this filter hides them, and telling a
|
|
10610
10405
|
// reviewer their feedback is gone is worse than telling them nothing.
|
|
10611
|
-
/* @__PURE__ */
|
|
10406
|
+
/* @__PURE__ */ jsx10(
|
|
10612
10407
|
EmptyState6,
|
|
10613
10408
|
{
|
|
10614
10409
|
title: "Nothing matches this filter",
|
|
10615
10410
|
hint: `${state.totals.all} comment${state.totals.all === 1 ? "" : "s"} on this document.`
|
|
10616
10411
|
}
|
|
10617
10412
|
)
|
|
10618
|
-
) : /* @__PURE__ */
|
|
10413
|
+
) : /* @__PURE__ */ jsx10(
|
|
10619
10414
|
EmptyState6,
|
|
10620
10415
|
{
|
|
10621
10416
|
title: "No comments",
|
|
10622
10417
|
hint: emptyHint ?? "Select something and add a comment."
|
|
10623
10418
|
}
|
|
10624
|
-
) : /* @__PURE__ */
|
|
10625
|
-
open.map((view) => /* @__PURE__ */
|
|
10419
|
+
) : /* @__PURE__ */ jsxs9(Fragment6, { children: [
|
|
10420
|
+
open.map((view) => /* @__PURE__ */ jsx10(
|
|
10626
10421
|
ThreadCard,
|
|
10627
10422
|
{
|
|
10628
10423
|
view,
|
|
@@ -10632,7 +10427,7 @@ function CommentsPanelView({
|
|
|
10632
10427
|
},
|
|
10633
10428
|
view.thread.id
|
|
10634
10429
|
)),
|
|
10635
|
-
showResolved && resolved.length > 0 ? /* @__PURE__ */
|
|
10430
|
+
showResolved && resolved.length > 0 ? /* @__PURE__ */ jsx10(Section4, { title: `Resolved (${resolved.length})`, flush: true, children: resolved.map((view) => /* @__PURE__ */ jsx10(
|
|
10636
10431
|
ThreadCard,
|
|
10637
10432
|
{
|
|
10638
10433
|
view,
|
|
@@ -10643,8 +10438,8 @@ function CommentsPanelView({
|
|
|
10643
10438
|
view.thread.id
|
|
10644
10439
|
)) }) : null
|
|
10645
10440
|
] }) }),
|
|
10646
|
-
/* @__PURE__ */
|
|
10647
|
-
/* @__PURE__ */
|
|
10441
|
+
/* @__PURE__ */ jsxs9("div", { style: { borderTop: "1px solid var(--xeno-border-subtle)", padding: 6 }, children: [
|
|
10442
|
+
/* @__PURE__ */ jsx10(
|
|
10648
10443
|
"textarea",
|
|
10649
10444
|
{
|
|
10650
10445
|
value: state.draft,
|
|
@@ -10672,7 +10467,7 @@ function CommentsPanelView({
|
|
|
10672
10467
|
}
|
|
10673
10468
|
}
|
|
10674
10469
|
),
|
|
10675
|
-
/* @__PURE__ */
|
|
10470
|
+
/* @__PURE__ */ jsx10("div", { style: { display: "flex", justifyContent: "flex-end", marginTop: 2 }, children: /* @__PURE__ */ jsx10(
|
|
10676
10471
|
TextButton4,
|
|
10677
10472
|
{
|
|
10678
10473
|
strong: true,
|
|
@@ -10682,7 +10477,7 @@ function CommentsPanelView({
|
|
|
10682
10477
|
}
|
|
10683
10478
|
) })
|
|
10684
10479
|
] }),
|
|
10685
|
-
/* @__PURE__ */
|
|
10480
|
+
/* @__PURE__ */ jsx10(
|
|
10686
10481
|
StatusBar6,
|
|
10687
10482
|
{
|
|
10688
10483
|
left: `${state.totals.open} open`,
|
|
@@ -11399,7 +11194,7 @@ var GraphController = class {
|
|
|
11399
11194
|
*/
|
|
11400
11195
|
pointerDown(px, py, modifiers = {}) {
|
|
11401
11196
|
const point = this.scale.screenToGraph(px, py);
|
|
11402
|
-
const
|
|
11197
|
+
const base = {
|
|
11403
11198
|
startPx: { x: px, y: py },
|
|
11404
11199
|
startGraph: point,
|
|
11405
11200
|
nodeIds: [],
|
|
@@ -11410,13 +11205,13 @@ var GraphController = class {
|
|
|
11410
11205
|
additive: modifiers.additive === true
|
|
11411
11206
|
};
|
|
11412
11207
|
if (modifiers.pan) {
|
|
11413
|
-
this.drag = { ...
|
|
11208
|
+
this.drag = { ...base, kind: "pan" };
|
|
11414
11209
|
this.notify();
|
|
11415
11210
|
return true;
|
|
11416
11211
|
}
|
|
11417
11212
|
const hit = this.hitTest(px, py);
|
|
11418
11213
|
if (hit.kind === "port") {
|
|
11419
|
-
this.drag = { ...
|
|
11214
|
+
this.drag = { ...base, kind: "connect", source: hit.ref };
|
|
11420
11215
|
this.notify();
|
|
11421
11216
|
return true;
|
|
11422
11217
|
}
|
|
@@ -11433,7 +11228,7 @@ var GraphController = class {
|
|
|
11433
11228
|
movable.push(id);
|
|
11434
11229
|
}
|
|
11435
11230
|
void node;
|
|
11436
|
-
this.drag = { ...
|
|
11231
|
+
this.drag = { ...base, kind: "moveNodes", nodeIds: movable, origin };
|
|
11437
11232
|
this.notify();
|
|
11438
11233
|
return true;
|
|
11439
11234
|
}
|
|
@@ -11442,7 +11237,7 @@ var GraphController = class {
|
|
|
11442
11237
|
this.notify();
|
|
11443
11238
|
return false;
|
|
11444
11239
|
}
|
|
11445
|
-
this.drag = { ...
|
|
11240
|
+
this.drag = { ...base, kind: "marquee", marquee: { x: point.x, y: point.y, width: 0, height: 0 } };
|
|
11446
11241
|
this.notify();
|
|
11447
11242
|
return true;
|
|
11448
11243
|
}
|
|
@@ -11856,7 +11651,7 @@ var nodegraphManifest = {
|
|
|
11856
11651
|
// src/edit/nodegraph/react/NodeGraphPanelView.tsx
|
|
11857
11652
|
import { useCallback as useCallback7, useEffect as useEffect7, useRef as useRef8, useSyncExternalStore as useSyncExternalStore9 } from "react";
|
|
11858
11653
|
import { EmptyState as EmptyState7, StatusBar as StatusBar7, Toolbar as Toolbar6, ToolbarGroup as ToolbarGroup4 } from "@xenosystem/components/chrome";
|
|
11859
|
-
import { Fragment as Fragment7, jsx as
|
|
11654
|
+
import { Fragment as Fragment7, jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
11860
11655
|
var HEADER_H2 = 24;
|
|
11861
11656
|
var PORT_ROW_H2 = 18;
|
|
11862
11657
|
function NodeGraphPanelView({ controller }) {
|
|
@@ -11935,17 +11730,17 @@ function NodeGraphPanelView({ controller }) {
|
|
|
11935
11730
|
const selectedNodes = new Set(state.selection.nodeIds);
|
|
11936
11731
|
const selectedEdges = new Set(state.selection.edgeIds);
|
|
11937
11732
|
const total = state.graph?.nodes.length ?? 0;
|
|
11938
|
-
return /* @__PURE__ */
|
|
11939
|
-
/* @__PURE__ */
|
|
11733
|
+
return /* @__PURE__ */ jsxs10("div", { style: SHELL2, children: [
|
|
11734
|
+
/* @__PURE__ */ jsx11(
|
|
11940
11735
|
Toolbar6,
|
|
11941
11736
|
{
|
|
11942
|
-
right: /* @__PURE__ */
|
|
11943
|
-
/* @__PURE__ */
|
|
11944
|
-
/* @__PURE__ */
|
|
11737
|
+
right: /* @__PURE__ */ jsxs10(ToolbarGroup4, { end: true, children: [
|
|
11738
|
+
/* @__PURE__ */ jsx11("button", { type: "button", style: button2(), onClick: () => controller.fit(false), children: "Fit" }),
|
|
11739
|
+
/* @__PURE__ */ jsx11("button", { type: "button", style: button2(), onClick: () => controller.fit(true), children: "Fit selection" })
|
|
11945
11740
|
] })
|
|
11946
11741
|
}
|
|
11947
11742
|
),
|
|
11948
|
-
total === 0 ? /* @__PURE__ */
|
|
11743
|
+
total === 0 ? /* @__PURE__ */ jsx11(EmptyState7, { title: "Empty graph", hint: "Wire a host graph into this panel's input." }) : /* @__PURE__ */ jsxs10(
|
|
11949
11744
|
"div",
|
|
11950
11745
|
{
|
|
11951
11746
|
ref: containerRef,
|
|
@@ -11960,15 +11755,15 @@ function NodeGraphPanelView({ controller }) {
|
|
|
11960
11755
|
onPointerCancel: onPointerUp,
|
|
11961
11756
|
onKeyDown,
|
|
11962
11757
|
children: [
|
|
11963
|
-
/* @__PURE__ */
|
|
11758
|
+
/* @__PURE__ */ jsx11(
|
|
11964
11759
|
"svg",
|
|
11965
11760
|
{
|
|
11966
11761
|
"data-canvas": "nodegraph-surface",
|
|
11967
11762
|
width: "100%",
|
|
11968
11763
|
height: "100%",
|
|
11969
11764
|
style: { position: "absolute", inset: 0, display: "block" },
|
|
11970
|
-
children: /* @__PURE__ */
|
|
11971
|
-
state.edges.map(({ edge, from, to }) => /* @__PURE__ */
|
|
11765
|
+
children: /* @__PURE__ */ jsxs10("g", { transform: `translate(${-scale.x * scale.zoom} ${-scale.y * scale.zoom}) scale(${scale.zoom})`, children: [
|
|
11766
|
+
state.edges.map(({ edge, from, to }) => /* @__PURE__ */ jsx11(
|
|
11972
11767
|
"path",
|
|
11973
11768
|
{
|
|
11974
11769
|
d: edgePath(from, to),
|
|
@@ -11979,8 +11774,8 @@ function NodeGraphPanelView({ controller }) {
|
|
|
11979
11774
|
},
|
|
11980
11775
|
edge.id
|
|
11981
11776
|
)),
|
|
11982
|
-
preview?.connection ? /* @__PURE__ */
|
|
11983
|
-
state.nodes.map((node) => /* @__PURE__ */
|
|
11777
|
+
preview?.connection ? /* @__PURE__ */ jsx11(PendingWire, { controller, preview, zoom: scale.zoom }) : null,
|
|
11778
|
+
state.nodes.map((node) => /* @__PURE__ */ jsx11(
|
|
11984
11779
|
NodeRect,
|
|
11985
11780
|
{
|
|
11986
11781
|
node,
|
|
@@ -11989,7 +11784,7 @@ function NodeGraphPanelView({ controller }) {
|
|
|
11989
11784
|
},
|
|
11990
11785
|
node.id
|
|
11991
11786
|
)),
|
|
11992
|
-
preview?.marquee ? /* @__PURE__ */
|
|
11787
|
+
preview?.marquee ? /* @__PURE__ */ jsx11(
|
|
11993
11788
|
"rect",
|
|
11994
11789
|
{
|
|
11995
11790
|
x: preview.marquee.x,
|
|
@@ -12004,15 +11799,15 @@ function NodeGraphPanelView({ controller }) {
|
|
|
12004
11799
|
] })
|
|
12005
11800
|
}
|
|
12006
11801
|
),
|
|
12007
|
-
preview?.connection && !preview.connection.verdict.ok && preview.connection.target ? /* @__PURE__ */
|
|
11802
|
+
preview?.connection && !preview.connection.verdict.ok && preview.connection.target ? /* @__PURE__ */ jsx11("div", { style: REASON, children: preview.connection.verdict.reason }) : null
|
|
12008
11803
|
]
|
|
12009
11804
|
}
|
|
12010
11805
|
),
|
|
12011
|
-
/* @__PURE__ */
|
|
11806
|
+
/* @__PURE__ */ jsx11(
|
|
12012
11807
|
StatusBar7,
|
|
12013
11808
|
{
|
|
12014
11809
|
left: `${total} node${total === 1 ? "" : "s"}`,
|
|
12015
|
-
right: /* @__PURE__ */
|
|
11810
|
+
right: /* @__PURE__ */ jsxs10("span", { className: "tabular-nums", children: [
|
|
12016
11811
|
Math.round(scale.zoom * 100),
|
|
12017
11812
|
"%"
|
|
12018
11813
|
] })
|
|
@@ -12030,7 +11825,7 @@ function PendingWire({
|
|
|
12030
11825
|
const from = controller.portPosition(connection.source.nodeId, connection.source.portId);
|
|
12031
11826
|
if (!from) return null;
|
|
12032
11827
|
const ok = connection.verdict.ok;
|
|
12033
|
-
return /* @__PURE__ */
|
|
11828
|
+
return /* @__PURE__ */ jsx11(
|
|
12034
11829
|
"path",
|
|
12035
11830
|
{
|
|
12036
11831
|
d: edgePath(from, connection.to),
|
|
@@ -12043,8 +11838,8 @@ function PendingWire({
|
|
|
12043
11838
|
}
|
|
12044
11839
|
function NodeRect({ node, selected, zoom }) {
|
|
12045
11840
|
const height = node.collapsed ? HEADER_H2 : node.height;
|
|
12046
|
-
return /* @__PURE__ */
|
|
12047
|
-
/* @__PURE__ */
|
|
11841
|
+
return /* @__PURE__ */ jsxs10("g", { opacity: node.disabled ? 0.45 : 1, children: [
|
|
11842
|
+
/* @__PURE__ */ jsx11(
|
|
12048
11843
|
"rect",
|
|
12049
11844
|
{
|
|
12050
11845
|
x: node.x,
|
|
@@ -12057,7 +11852,7 @@ function NodeRect({ node, selected, zoom }) {
|
|
|
12057
11852
|
strokeWidth: (selected ? 1.5 : 1) / zoom
|
|
12058
11853
|
}
|
|
12059
11854
|
),
|
|
12060
|
-
/* @__PURE__ */
|
|
11855
|
+
/* @__PURE__ */ jsx11(
|
|
12061
11856
|
"rect",
|
|
12062
11857
|
{
|
|
12063
11858
|
x: node.x,
|
|
@@ -12068,7 +11863,7 @@ function NodeRect({ node, selected, zoom }) {
|
|
|
12068
11863
|
fill: node.color ?? "var(--xeno-border)"
|
|
12069
11864
|
}
|
|
12070
11865
|
),
|
|
12071
|
-
/* @__PURE__ */
|
|
11866
|
+
/* @__PURE__ */ jsx11(
|
|
12072
11867
|
"text",
|
|
12073
11868
|
{
|
|
12074
11869
|
x: node.x + 8,
|
|
@@ -12079,8 +11874,8 @@ function NodeRect({ node, selected, zoom }) {
|
|
|
12079
11874
|
children: node.title
|
|
12080
11875
|
}
|
|
12081
11876
|
),
|
|
12082
|
-
node.collapsed ? null : /* @__PURE__ */
|
|
12083
|
-
node.inputs.map((port, i) => /* @__PURE__ */
|
|
11877
|
+
node.collapsed ? null : /* @__PURE__ */ jsxs10(Fragment7, { children: [
|
|
11878
|
+
node.inputs.map((port, i) => /* @__PURE__ */ jsx11(
|
|
12084
11879
|
Port,
|
|
12085
11880
|
{
|
|
12086
11881
|
x: node.x,
|
|
@@ -12091,7 +11886,7 @@ function NodeRect({ node, selected, zoom }) {
|
|
|
12091
11886
|
},
|
|
12092
11887
|
port.id
|
|
12093
11888
|
)),
|
|
12094
|
-
node.outputs.map((port, i) => /* @__PURE__ */
|
|
11889
|
+
node.outputs.map((port, i) => /* @__PURE__ */ jsx11(
|
|
12095
11890
|
Port,
|
|
12096
11891
|
{
|
|
12097
11892
|
x: node.x + node.width,
|
|
@@ -12112,8 +11907,8 @@ function Port({
|
|
|
12112
11907
|
align,
|
|
12113
11908
|
disabled
|
|
12114
11909
|
}) {
|
|
12115
|
-
return /* @__PURE__ */
|
|
12116
|
-
/* @__PURE__ */
|
|
11910
|
+
return /* @__PURE__ */ jsxs10("g", { opacity: disabled ? 0.4 : 1, children: [
|
|
11911
|
+
/* @__PURE__ */ jsx11(
|
|
12117
11912
|
"rect",
|
|
12118
11913
|
{
|
|
12119
11914
|
x: x - 3,
|
|
@@ -12125,7 +11920,7 @@ function Port({
|
|
|
12125
11920
|
strokeWidth: 0.5
|
|
12126
11921
|
}
|
|
12127
11922
|
),
|
|
12128
|
-
/* @__PURE__ */
|
|
11923
|
+
/* @__PURE__ */ jsx11(
|
|
12129
11924
|
"text",
|
|
12130
11925
|
{
|
|
12131
11926
|
x: align === "left" ? x + 8 : x - 8,
|
|
@@ -13397,105 +13192,7 @@ import {
|
|
|
13397
13192
|
ToolbarGroup as ToolbarGroup5
|
|
13398
13193
|
} from "@xenosystem/components/chrome";
|
|
13399
13194
|
import { computeWindow as computeWindow3 } from "@xenosystem/tree-core";
|
|
13400
|
-
|
|
13401
|
-
// src/edit/tree/react/icons.tsx
|
|
13402
|
-
import { Fragment as Fragment8, jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
13403
|
-
function Svg({ children, size = 11 }) {
|
|
13404
|
-
return /* @__PURE__ */ jsx16(
|
|
13405
|
-
"svg",
|
|
13406
|
-
{
|
|
13407
|
-
width: size,
|
|
13408
|
-
height: size,
|
|
13409
|
-
viewBox: "0 0 24 24",
|
|
13410
|
-
fill: "none",
|
|
13411
|
-
stroke: "currentColor",
|
|
13412
|
-
strokeWidth: "1.5",
|
|
13413
|
-
strokeLinecap: "round",
|
|
13414
|
-
strokeLinejoin: "round",
|
|
13415
|
-
"aria-hidden": "true",
|
|
13416
|
-
children
|
|
13417
|
-
}
|
|
13418
|
-
);
|
|
13419
|
-
}
|
|
13420
|
-
function ChevronGlyph() {
|
|
13421
|
-
return /* @__PURE__ */ jsx16(Svg, { size: 9, children: /* @__PURE__ */ jsx16("path", { d: "m9 18 6-6-6-6" }) });
|
|
13422
|
-
}
|
|
13423
|
-
function ExpandGlyph() {
|
|
13424
|
-
return /* @__PURE__ */ jsxs15(Svg, { children: [
|
|
13425
|
-
/* @__PURE__ */ jsx16("path", { d: "M12 22v-6" }),
|
|
13426
|
-
/* @__PURE__ */ jsx16("path", { d: "M12 8V2" }),
|
|
13427
|
-
/* @__PURE__ */ jsx16("path", { d: "m9 5 3-3 3 3" }),
|
|
13428
|
-
/* @__PURE__ */ jsx16("path", { d: "m9 19 3 3 3-3" }),
|
|
13429
|
-
/* @__PURE__ */ jsx16("path", { d: "M4 12H2" }),
|
|
13430
|
-
/* @__PURE__ */ jsx16("path", { d: "M10 12H8" }),
|
|
13431
|
-
/* @__PURE__ */ jsx16("path", { d: "M16 12h-2" }),
|
|
13432
|
-
/* @__PURE__ */ jsx16("path", { d: "M22 12h-2" })
|
|
13433
|
-
] });
|
|
13434
|
-
}
|
|
13435
|
-
function CollapseGlyph() {
|
|
13436
|
-
return /* @__PURE__ */ jsxs15(Svg, { children: [
|
|
13437
|
-
/* @__PURE__ */ jsx16("path", { d: "M12 22v-6" }),
|
|
13438
|
-
/* @__PURE__ */ jsx16("path", { d: "M12 8V2" }),
|
|
13439
|
-
/* @__PURE__ */ jsx16("path", { d: "m9 13 3 3 3-3" }),
|
|
13440
|
-
/* @__PURE__ */ jsx16("path", { d: "m9 11 3-3 3 3" }),
|
|
13441
|
-
/* @__PURE__ */ jsx16("path", { d: "M4 12H2" }),
|
|
13442
|
-
/* @__PURE__ */ jsx16("path", { d: "M22 12h-2" })
|
|
13443
|
-
] });
|
|
13444
|
-
}
|
|
13445
|
-
function RefreshGlyph() {
|
|
13446
|
-
return /* @__PURE__ */ jsxs15(Svg, { children: [
|
|
13447
|
-
/* @__PURE__ */ jsx16("path", { d: "M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }),
|
|
13448
|
-
/* @__PURE__ */ jsx16("path", { d: "M3 3v5h5" }),
|
|
13449
|
-
/* @__PURE__ */ jsx16("path", { d: "M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16" }),
|
|
13450
|
-
/* @__PURE__ */ jsx16("path", { d: "M16 16h5v5" })
|
|
13451
|
-
] });
|
|
13452
|
-
}
|
|
13453
|
-
var PATHS = {
|
|
13454
|
-
folder: /* @__PURE__ */ jsx16("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" }),
|
|
13455
|
-
file: /* @__PURE__ */ jsxs15(Fragment8, { children: [
|
|
13456
|
-
/* @__PURE__ */ jsx16("path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z" }),
|
|
13457
|
-
/* @__PURE__ */ jsx16("path", { d: "M14 2v4a2 2 0 0 0 2 2h4" })
|
|
13458
|
-
] }),
|
|
13459
|
-
"folder-tree": /* @__PURE__ */ jsxs15(Fragment8, { children: [
|
|
13460
|
-
/* @__PURE__ */ jsx16("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" }),
|
|
13461
|
-
/* @__PURE__ */ jsx16("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" }),
|
|
13462
|
-
/* @__PURE__ */ jsx16("path", { d: "M3 5a2 2 0 0 0 2 2h3" }),
|
|
13463
|
-
/* @__PURE__ */ jsx16("path", { d: "M3 3v13a2 2 0 0 0 2 2h3" })
|
|
13464
|
-
] }),
|
|
13465
|
-
box: /* @__PURE__ */ jsxs15(Fragment8, { children: [
|
|
13466
|
-
/* @__PURE__ */ jsx16("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" }),
|
|
13467
|
-
/* @__PURE__ */ jsx16("path", { d: "m3.3 7 8.7 5 8.7-5" }),
|
|
13468
|
-
/* @__PURE__ */ jsx16("path", { d: "M12 22V12" })
|
|
13469
|
-
] }),
|
|
13470
|
-
component: /* @__PURE__ */ jsx16("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" }),
|
|
13471
|
-
"file-text": /* @__PURE__ */ jsxs15(Fragment8, { children: [
|
|
13472
|
-
/* @__PURE__ */ jsx16("path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z" }),
|
|
13473
|
-
/* @__PURE__ */ jsx16("path", { d: "M14 2v4a2 2 0 0 0 2 2h4" }),
|
|
13474
|
-
/* @__PURE__ */ jsx16("path", { d: "M8 13h8M8 17h5" })
|
|
13475
|
-
] }),
|
|
13476
|
-
heading: /* @__PURE__ */ jsx16(Fragment8, { children: /* @__PURE__ */ jsx16("path", { d: "M6 4v16M18 4v16M6 12h12" }) }),
|
|
13477
|
-
bot: /* @__PURE__ */ jsxs15(Fragment8, { children: [
|
|
13478
|
-
/* @__PURE__ */ jsx16("rect", { x: "3", y: "8", width: "18", height: "12", rx: "2" }),
|
|
13479
|
-
/* @__PURE__ */ jsx16("path", { d: "M12 4v4M8 14h.01M16 14h.01" })
|
|
13480
|
-
] }),
|
|
13481
|
-
link: /* @__PURE__ */ jsxs15(Fragment8, { children: [
|
|
13482
|
-
/* @__PURE__ */ jsx16("path", { d: "M10 13a5 5 0 0 0 7.5.5l3-3a5 5 0 0 0-7-7l-1.8 1.7" }),
|
|
13483
|
-
/* @__PURE__ */ jsx16("path", { d: "M14 11a5 5 0 0 0-7.5-.5l-3 3a5 5 0 0 0 7 7l1.8-1.7" })
|
|
13484
|
-
] }),
|
|
13485
|
-
"link-2-off": /* @__PURE__ */ jsxs15(Fragment8, { children: [
|
|
13486
|
-
/* @__PURE__ */ jsx16("path", { d: "M9 17H7A5 5 0 0 1 7 7" }),
|
|
13487
|
-
/* @__PURE__ */ jsx16("path", { d: "M15 7h2a5 5 0 0 1 4 8" }),
|
|
13488
|
-
/* @__PURE__ */ jsx16("path", { d: "M8 12h4" }),
|
|
13489
|
-
/* @__PURE__ */ jsx16("path", { d: "m2 2 20 20" })
|
|
13490
|
-
] }),
|
|
13491
|
-
"circle-dot": /* @__PURE__ */ jsx16("rect", { x: "9", y: "9", width: "6", height: "6", rx: "1" })
|
|
13492
|
-
};
|
|
13493
|
-
function TreeIcon({ name, size = 11 }) {
|
|
13494
|
-
return /* @__PURE__ */ jsx16(Svg, { size, children: PATHS[name] ?? PATHS["circle-dot"] });
|
|
13495
|
-
}
|
|
13496
|
-
|
|
13497
|
-
// src/edit/tree/react/TreePanelView.tsx
|
|
13498
|
-
import { Fragment as Fragment9, jsx as jsx17, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
13195
|
+
import { Fragment as Fragment8, jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
13499
13196
|
function TreePanelView({
|
|
13500
13197
|
controller,
|
|
13501
13198
|
rowHeight = 24,
|
|
@@ -13527,13 +13224,13 @@ function TreePanelView({
|
|
|
13527
13224
|
const sourceState = source?.sourceState ?? "idle";
|
|
13528
13225
|
const body = (() => {
|
|
13529
13226
|
if (!source || sourceState === "idle") {
|
|
13530
|
-
return /* @__PURE__ */
|
|
13227
|
+
return /* @__PURE__ */ jsx12(EmptyState8, { title: "No source", hint: emptyHint ?? "Connect a source to browse it." });
|
|
13531
13228
|
}
|
|
13532
13229
|
if (sourceState === "loading" && state.rows.length === 0) {
|
|
13533
|
-
return /* @__PURE__ */
|
|
13230
|
+
return /* @__PURE__ */ jsx12(LoadingState, { label: source.sourceMessage ?? "Loading\u2026" });
|
|
13534
13231
|
}
|
|
13535
13232
|
if (sourceState === "error" || sourceState === "denied") {
|
|
13536
|
-
return /* @__PURE__ */
|
|
13233
|
+
return /* @__PURE__ */ jsx12(
|
|
13537
13234
|
ErrorState,
|
|
13538
13235
|
{
|
|
13539
13236
|
title: sourceState === "denied" ? "Access not granted" : "Could not read this source",
|
|
@@ -13544,7 +13241,7 @@ function TreePanelView({
|
|
|
13544
13241
|
);
|
|
13545
13242
|
}
|
|
13546
13243
|
if (state.rows.length === 0) {
|
|
13547
|
-
return state.filter ? /* @__PURE__ */
|
|
13244
|
+
return state.filter ? /* @__PURE__ */ jsx12(EmptyState8, { title: "No matches", hint: `Nothing matches \u201C${state.filter}\u201D.` }) : /* @__PURE__ */ jsx12(
|
|
13548
13245
|
EmptyState8,
|
|
13549
13246
|
{
|
|
13550
13247
|
title: "Nothing here",
|
|
@@ -13560,7 +13257,7 @@ function TreePanelView({
|
|
|
13560
13257
|
overscan
|
|
13561
13258
|
});
|
|
13562
13259
|
const slice = state.rows.slice(window2.startIndex, window2.endIndex);
|
|
13563
|
-
return /* @__PURE__ */
|
|
13260
|
+
return /* @__PURE__ */ jsx12(ScrollArea6, { children: /* @__PURE__ */ jsx12(
|
|
13564
13261
|
"div",
|
|
13565
13262
|
{
|
|
13566
13263
|
ref: scrollRef,
|
|
@@ -13574,7 +13271,7 @@ function TreePanelView({
|
|
|
13574
13271
|
e.preventDefault();
|
|
13575
13272
|
}
|
|
13576
13273
|
},
|
|
13577
|
-
children: /* @__PURE__ */
|
|
13274
|
+
children: /* @__PURE__ */ jsx12("div", { style: { height: window2.totalHeight, position: "relative" }, children: /* @__PURE__ */ jsx12("div", { style: { transform: `translateY(${window2.offsetTop}px)` }, children: slice.map((row2) => /* @__PURE__ */ jsx12(
|
|
13578
13275
|
TreeRowView,
|
|
13579
13276
|
{
|
|
13580
13277
|
row: row2,
|
|
@@ -13590,11 +13287,11 @@ function TreePanelView({
|
|
|
13590
13287
|
}
|
|
13591
13288
|
) });
|
|
13592
13289
|
})();
|
|
13593
|
-
return /* @__PURE__ */
|
|
13594
|
-
/* @__PURE__ */
|
|
13290
|
+
return /* @__PURE__ */ jsxs11("div", { style: { display: "flex", flexDirection: "column", height: "100%", minHeight: 0 }, children: [
|
|
13291
|
+
/* @__PURE__ */ jsx12(
|
|
13595
13292
|
Toolbar7,
|
|
13596
13293
|
{
|
|
13597
|
-
left: showSearch ? /* @__PURE__ */
|
|
13294
|
+
left: showSearch ? /* @__PURE__ */ jsx12(
|
|
13598
13295
|
SearchField5,
|
|
13599
13296
|
{
|
|
13600
13297
|
value: state.filter,
|
|
@@ -13602,22 +13299,22 @@ function TreePanelView({
|
|
|
13602
13299
|
placeholder: "Filter\u2026"
|
|
13603
13300
|
}
|
|
13604
13301
|
) : void 0,
|
|
13605
|
-
right: /* @__PURE__ */
|
|
13606
|
-
/* @__PURE__ */
|
|
13607
|
-
/* @__PURE__ */
|
|
13302
|
+
right: /* @__PURE__ */ jsxs11(ToolbarGroup5, { end: true, children: [
|
|
13303
|
+
/* @__PURE__ */ jsx12(IconButton7, { icon: /* @__PURE__ */ jsx12(ExpandGlyph, {}), label: "Expand all", onClick: () => controller.expandAll() }),
|
|
13304
|
+
/* @__PURE__ */ jsx12(
|
|
13608
13305
|
IconButton7,
|
|
13609
13306
|
{
|
|
13610
|
-
icon: /* @__PURE__ */
|
|
13307
|
+
icon: /* @__PURE__ */ jsx12(CollapseGlyph, {}),
|
|
13611
13308
|
label: "Collapse all",
|
|
13612
13309
|
onClick: () => controller.collapseAll()
|
|
13613
13310
|
}
|
|
13614
13311
|
),
|
|
13615
|
-
/* @__PURE__ */
|
|
13312
|
+
/* @__PURE__ */ jsx12(IconButton7, { icon: /* @__PURE__ */ jsx12(RefreshGlyph, {}), label: "Refresh", onClick: () => controller.refresh() })
|
|
13616
13313
|
] })
|
|
13617
13314
|
}
|
|
13618
13315
|
),
|
|
13619
13316
|
body,
|
|
13620
|
-
/* @__PURE__ */
|
|
13317
|
+
/* @__PURE__ */ jsx12(
|
|
13621
13318
|
StatusBar8,
|
|
13622
13319
|
{
|
|
13623
13320
|
left: `${state.rows.length} item${state.rows.length === 1 ? "" : "s"}`,
|
|
@@ -13639,7 +13336,7 @@ function TreeRowView({
|
|
|
13639
13336
|
const selected = state.selection.includes(row2.id);
|
|
13640
13337
|
const renaming = state.renaming?.id === row2.id ? state.renaming : null;
|
|
13641
13338
|
const drop = state.drag?.targetId === row2.id ? state.drag : null;
|
|
13642
|
-
const twisty = row2.container ? /* @__PURE__ */
|
|
13339
|
+
const twisty = row2.container ? /* @__PURE__ */ jsx12(
|
|
13643
13340
|
"span",
|
|
13644
13341
|
{
|
|
13645
13342
|
role: "button",
|
|
@@ -13659,13 +13356,13 @@ function TreeRowView({
|
|
|
13659
13356
|
transition: "transform 80ms ease",
|
|
13660
13357
|
opacity: 0.7
|
|
13661
13358
|
},
|
|
13662
|
-
children: /* @__PURE__ */
|
|
13359
|
+
children: /* @__PURE__ */ jsx12(ChevronGlyph, { size: 9 })
|
|
13663
13360
|
}
|
|
13664
13361
|
) : (
|
|
13665
13362
|
// A leaf still reserves the twisty column, so labels stay in ONE column across mixed rows.
|
|
13666
|
-
/* @__PURE__ */
|
|
13363
|
+
/* @__PURE__ */ jsx12("span", { style: { width: 12, flex: "0 0 auto" } })
|
|
13667
13364
|
);
|
|
13668
|
-
return /* @__PURE__ */
|
|
13365
|
+
return /* @__PURE__ */ jsx12(
|
|
13669
13366
|
"div",
|
|
13670
13367
|
{
|
|
13671
13368
|
style: {
|
|
@@ -13676,7 +13373,7 @@ function TreeRowView({
|
|
|
13676
13373
|
boxShadow: drop?.position === "into" ? "inset 0 0 0 1px var(--xeno-active)" : drop?.position === "before" ? "inset 0 1px 0 0 var(--xeno-active)" : drop?.position === "after" ? "inset 0 -1px 0 0 var(--xeno-active)" : void 0
|
|
13677
13374
|
},
|
|
13678
13375
|
title: drop?.reason,
|
|
13679
|
-
children: /* @__PURE__ */
|
|
13376
|
+
children: /* @__PURE__ */ jsx12(
|
|
13680
13377
|
Row4,
|
|
13681
13378
|
{
|
|
13682
13379
|
role: "treeitem",
|
|
@@ -13712,11 +13409,11 @@ function TreeRowView({
|
|
|
13712
13409
|
onPointerUp: () => {
|
|
13713
13410
|
if (state.drag) controller.endDrag();
|
|
13714
13411
|
},
|
|
13715
|
-
icon: /* @__PURE__ */
|
|
13412
|
+
icon: /* @__PURE__ */ jsxs11(Fragment8, { children: [
|
|
13716
13413
|
twisty,
|
|
13717
|
-
/* @__PURE__ */
|
|
13414
|
+
/* @__PURE__ */ jsx12(NodeIcon, { icon: node.icon ?? defaultIconFor(node.kind) })
|
|
13718
13415
|
] }),
|
|
13719
|
-
label: renaming ? /* @__PURE__ */
|
|
13416
|
+
label: renaming ? /* @__PURE__ */ jsx12(
|
|
13720
13417
|
"input",
|
|
13721
13418
|
{
|
|
13722
13419
|
autoFocus: true,
|
|
@@ -13741,19 +13438,19 @@ function TreeRowView({
|
|
|
13741
13438
|
}
|
|
13742
13439
|
}
|
|
13743
13440
|
) : node.label,
|
|
13744
|
-
meta: /* @__PURE__ */
|
|
13745
|
-
trailing: /* @__PURE__ */
|
|
13746
|
-
columns?.map((columnId) => /* @__PURE__ */
|
|
13747
|
-
node.glyphs?.map((glyph) => /* @__PURE__ */
|
|
13441
|
+
meta: /* @__PURE__ */ jsx12(ChildStateChip, { row: row2, controller }),
|
|
13442
|
+
trailing: /* @__PURE__ */ jsxs11(Fragment8, { children: [
|
|
13443
|
+
columns?.map((columnId) => /* @__PURE__ */ jsx12("span", { style: { opacity: 0.7, fontVariantNumeric: "tabular-nums" }, children: node.columns?.[columnId] ?? "" }, columnId)),
|
|
13444
|
+
node.glyphs?.map((glyph) => /* @__PURE__ */ jsx12("span", { title: glyph.title, style: { display: "flex", opacity: 0.7 }, children: /* @__PURE__ */ jsx12(NodeIcon, { icon: glyph.icon }) }, glyph.id)),
|
|
13748
13445
|
node.badges?.map((badge) => (
|
|
13749
13446
|
// Opaque: the host formatted the text, the panel only places it.
|
|
13750
|
-
/* @__PURE__ */
|
|
13447
|
+
/* @__PURE__ */ jsx12(Badge7, { tone: badge.tone, className: badge.title ? void 0 : void 0, children: badge.text }, badge.id)
|
|
13751
13448
|
)),
|
|
13752
|
-
node.actions?.map((action) => /* @__PURE__ */
|
|
13449
|
+
node.actions?.map((action) => /* @__PURE__ */ jsx12(
|
|
13753
13450
|
IconButton7,
|
|
13754
13451
|
{
|
|
13755
13452
|
size: "sm",
|
|
13756
|
-
icon: /* @__PURE__ */
|
|
13453
|
+
icon: /* @__PURE__ */ jsx12(NodeIcon, { icon: action.icon }),
|
|
13757
13454
|
label: action.label,
|
|
13758
13455
|
disabled: action.disabled,
|
|
13759
13456
|
onClick: () => controller.runAction(row2.id, action.id)
|
|
@@ -13772,14 +13469,14 @@ function ChildStateChip({
|
|
|
13772
13469
|
}) {
|
|
13773
13470
|
if (!row2.container) return null;
|
|
13774
13471
|
if (row2.childState === "loading") {
|
|
13775
|
-
return /* @__PURE__ */
|
|
13472
|
+
return /* @__PURE__ */ jsx12("span", { style: { opacity: 0.5, fontSize: 9 }, children: "loading\u2026" });
|
|
13776
13473
|
}
|
|
13777
13474
|
if (row2.childState === "error") {
|
|
13778
13475
|
const error = row2.node.error;
|
|
13779
|
-
return /* @__PURE__ */
|
|
13476
|
+
return /* @__PURE__ */ jsx12(Badge7, { tone: "error", children: error?.code === "denied" ? "no access" : error?.code ?? "failed" });
|
|
13780
13477
|
}
|
|
13781
13478
|
if (row2.node.hasMore && row2.expanded) {
|
|
13782
|
-
return /* @__PURE__ */
|
|
13479
|
+
return /* @__PURE__ */ jsx12(
|
|
13783
13480
|
"span",
|
|
13784
13481
|
{
|
|
13785
13482
|
role: "button",
|
|
@@ -13793,18 +13490,18 @@ function ChildStateChip({
|
|
|
13793
13490
|
);
|
|
13794
13491
|
}
|
|
13795
13492
|
if (row2.node.truncatedAt !== void 0) {
|
|
13796
|
-
return /* @__PURE__ */
|
|
13493
|
+
return /* @__PURE__ */ jsx12(Badge7, { tone: "warning", children: `first ${row2.node.truncatedAt}` });
|
|
13797
13494
|
}
|
|
13798
13495
|
if (row2.expanded && isEmptyContainer(row2.node)) {
|
|
13799
|
-
return /* @__PURE__ */
|
|
13496
|
+
return /* @__PURE__ */ jsx12("span", { style: { opacity: 0.4, fontSize: 9 }, children: "empty" });
|
|
13800
13497
|
}
|
|
13801
13498
|
return null;
|
|
13802
13499
|
}
|
|
13803
13500
|
function NodeIcon({ icon }) {
|
|
13804
13501
|
if (icon.kind === "text") {
|
|
13805
|
-
return /* @__PURE__ */
|
|
13502
|
+
return /* @__PURE__ */ jsx12("span", { style: { fontSize: 11, lineHeight: 1, display: "flex", alignItems: "center" }, children: icon.value });
|
|
13806
13503
|
}
|
|
13807
|
-
return /* @__PURE__ */
|
|
13504
|
+
return /* @__PURE__ */ jsx12(TreeIcon, { name: icon.name });
|
|
13808
13505
|
}
|
|
13809
13506
|
|
|
13810
13507
|
// src/edit/tree/panel.ts
|