@lace-cloud/canvas 0.32.1 → 0.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Canvas-JRY2HAY6.css → Canvas-VQQEZSPA.css} +9 -11
- package/dist/{chunk-J5BZ7EOQ.mjs → chunk-5X3CA44U.mjs} +247 -188
- package/dist/chunk-5X3CA44U.mjs.map +1 -0
- package/dist/engine/index.cjs +248 -187
- package/dist/engine/index.cjs.map +1 -1
- package/dist/engine/index.d.mts +15 -3
- package/dist/engine/index.d.ts +15 -3
- package/dist/engine/index.mjs +5 -1
- package/dist/index.cjs +1162 -989
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +5 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.mjs +744 -620
- package/dist/index.mjs.map +1 -1
- package/dist/{registry-BLwYarIE.d.ts → registry-BwXo1iVe.d.mts} +30 -19
- package/dist/{registry-BLwYarIE.d.mts → registry-BwXo1iVe.d.ts} +30 -19
- package/package.json +10 -5
- package/dist/chunk-J5BZ7EOQ.mjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -113,16 +113,16 @@ var import_proto17 = require("@lace-cloud/proto");
|
|
|
113
113
|
var import_feedback = require("@lace-cloud/ui/feedback");
|
|
114
114
|
|
|
115
115
|
// src/App.tsx
|
|
116
|
-
var
|
|
117
|
-
var
|
|
116
|
+
var import_react43 = require("@xyflow/react");
|
|
117
|
+
var import_react44 = require("react");
|
|
118
118
|
var import_App = require("./App-IFIOMNV7.css");
|
|
119
119
|
|
|
120
120
|
// src/Canvas.tsx
|
|
121
121
|
var import_style = require("@xyflow/react/dist/style.css");
|
|
122
|
-
var import_Canvas = require("./Canvas-
|
|
122
|
+
var import_Canvas = require("./Canvas-VQQEZSPA.css");
|
|
123
123
|
var import_proto10 = require("@lace-cloud/proto");
|
|
124
|
-
var
|
|
125
|
-
var
|
|
124
|
+
var import_react23 = require("@xyflow/react");
|
|
125
|
+
var import_react24 = require("react");
|
|
126
126
|
|
|
127
127
|
// src/components/CanvasControls.tsx
|
|
128
128
|
var import_ui = require("@lace-cloud/ui");
|
|
@@ -548,21 +548,25 @@ function isEmphasized(action, ctx) {
|
|
|
548
548
|
|
|
549
549
|
// src/utils/key-chord.ts
|
|
550
550
|
var BARE_KEYS = ["Delete", "Backspace"];
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
551
|
+
var MODIFIERS = ["Mod", "Ctrl"];
|
|
552
|
+
function parseChord(spec, mac) {
|
|
553
|
+
if (BARE_KEYS.some((bare) => bare === spec)) {
|
|
554
|
+
return { modifier: void 0, shift: false, key: spec };
|
|
555
|
+
}
|
|
556
|
+
const [head, ...rest] = spec.split("+");
|
|
557
|
+
const modifier = MODIFIERS.find((m) => m === head);
|
|
558
|
+
if (!modifier || modifier === "Ctrl" && mac) return void 0;
|
|
559
|
+
if (rest.length === 1 && rest[0] !== "") return { modifier, shift: false, key: rest[0] };
|
|
556
560
|
if (rest.length === 2 && rest[0] === "Shift" && rest[1] !== "") {
|
|
557
|
-
return {
|
|
561
|
+
return { modifier, shift: true, key: rest[1] };
|
|
558
562
|
}
|
|
559
563
|
return void 0;
|
|
560
564
|
}
|
|
561
565
|
var MAC_GLYPHS = { Backspace: "\u232B", Delete: "\u2326" };
|
|
562
566
|
function formatChord(spec, mac) {
|
|
563
|
-
const chord = parseChord(spec);
|
|
567
|
+
const chord = parseChord(spec, mac);
|
|
564
568
|
if (!chord) return void 0;
|
|
565
|
-
if (!chord.
|
|
569
|
+
if (!chord.modifier) return mac ? MAC_GLYPHS[chord.key] ?? chord.key : chord.key;
|
|
566
570
|
const key = chord.key.length === 1 ? chord.key.toUpperCase() : chord.key;
|
|
567
571
|
if (mac) return `${chord.shift ? "\u21E7" : ""}\u2318${key}`;
|
|
568
572
|
return ["Ctrl", ...chord.shift ? ["Shift"] : [], key].join("+");
|
|
@@ -974,8 +978,8 @@ var edgeTypes = { [DEPENDENCY_EDGE_TYPE]: DependencyEdge };
|
|
|
974
978
|
|
|
975
979
|
// src/components/nodes/GroupNode.tsx
|
|
976
980
|
var import_proto4 = require("@lace-cloud/proto");
|
|
977
|
-
var
|
|
978
|
-
var
|
|
981
|
+
var import_react12 = require("@xyflow/react");
|
|
982
|
+
var import_react13 = require("react");
|
|
979
983
|
|
|
980
984
|
// src/state/canvas-context.ts
|
|
981
985
|
var import_react6 = require("react");
|
|
@@ -1140,9 +1144,144 @@ function BadgeRow({ badges }) {
|
|
|
1140
1144
|
)) });
|
|
1141
1145
|
}
|
|
1142
1146
|
|
|
1147
|
+
// src/components/nodes/CallHandles.tsx
|
|
1148
|
+
var import_react7 = require("@xyflow/react");
|
|
1149
|
+
var import_react8 = require("react");
|
|
1150
|
+
|
|
1151
|
+
// src/utils/handleId.ts
|
|
1152
|
+
var NODE_HANDLE = "node";
|
|
1153
|
+
function parseHandleId(handleId, prefix) {
|
|
1154
|
+
if (!handleId) return null;
|
|
1155
|
+
const marker = `${prefix}:`;
|
|
1156
|
+
if (!handleId.startsWith(marker)) return null;
|
|
1157
|
+
const name = handleId.slice(marker.length);
|
|
1158
|
+
return name.length > 0 ? name : null;
|
|
1159
|
+
}
|
|
1160
|
+
function sourceHandleId(output) {
|
|
1161
|
+
return `out:${output}`;
|
|
1162
|
+
}
|
|
1163
|
+
function targetHandleId(input) {
|
|
1164
|
+
return `in:${input}`;
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1167
|
+
// src/components/nodes/pinColor.ts
|
|
1168
|
+
var STRING = {
|
|
1169
|
+
fill: "var(--lace-pin-string-fill)",
|
|
1170
|
+
stroke: "var(--lace-pin-string-stroke)",
|
|
1171
|
+
ring: "var(--lace-pin-string-ring)"
|
|
1172
|
+
};
|
|
1173
|
+
var NUMBER = {
|
|
1174
|
+
fill: "var(--lace-pin-number-fill)",
|
|
1175
|
+
stroke: "var(--lace-pin-number-stroke)",
|
|
1176
|
+
ring: "var(--lace-pin-number-ring)"
|
|
1177
|
+
};
|
|
1178
|
+
var BOOL = {
|
|
1179
|
+
fill: "var(--lace-pin-bool-fill)",
|
|
1180
|
+
stroke: "var(--lace-pin-bool-stroke)",
|
|
1181
|
+
ring: "var(--lace-pin-bool-ring)"
|
|
1182
|
+
};
|
|
1183
|
+
var LIST = {
|
|
1184
|
+
fill: "var(--lace-pin-list-fill)",
|
|
1185
|
+
stroke: "var(--lace-pin-list-stroke)",
|
|
1186
|
+
ring: "var(--lace-pin-list-ring)"
|
|
1187
|
+
};
|
|
1188
|
+
var MAP = {
|
|
1189
|
+
fill: "var(--lace-pin-map-fill)",
|
|
1190
|
+
stroke: "var(--lace-pin-map-stroke)",
|
|
1191
|
+
ring: "var(--lace-pin-map-ring)"
|
|
1192
|
+
};
|
|
1193
|
+
var OBJECT = {
|
|
1194
|
+
fill: "var(--lace-pin-object-fill)",
|
|
1195
|
+
stroke: "var(--lace-pin-object-stroke)",
|
|
1196
|
+
ring: "var(--lace-pin-object-ring)"
|
|
1197
|
+
};
|
|
1198
|
+
var ANY = {
|
|
1199
|
+
fill: "var(--lace-pin-any-fill)",
|
|
1200
|
+
stroke: "var(--lace-pin-any-stroke)",
|
|
1201
|
+
ring: "var(--lace-pin-any-ring)"
|
|
1202
|
+
};
|
|
1203
|
+
var FAMILY_COLORS = {
|
|
1204
|
+
string: STRING,
|
|
1205
|
+
number: NUMBER,
|
|
1206
|
+
bool: BOOL,
|
|
1207
|
+
boolean: BOOL,
|
|
1208
|
+
list: LIST,
|
|
1209
|
+
set: LIST,
|
|
1210
|
+
tuple: LIST,
|
|
1211
|
+
map: MAP,
|
|
1212
|
+
object: OBJECT,
|
|
1213
|
+
any: ANY
|
|
1214
|
+
};
|
|
1215
|
+
var ANY_PIN_COLOR = ANY;
|
|
1216
|
+
function inferTypeFamily(type) {
|
|
1217
|
+
const t = (type || "").trim().toLowerCase();
|
|
1218
|
+
if (t === "" || t === "any") return "any";
|
|
1219
|
+
for (const family of ["list", "set", "tuple", "map", "object"]) {
|
|
1220
|
+
if (t.startsWith(family)) return family;
|
|
1221
|
+
}
|
|
1222
|
+
return t;
|
|
1223
|
+
}
|
|
1224
|
+
function pinColor(pin) {
|
|
1225
|
+
const family = pin.type_family ?? inferTypeFamily(pin.type);
|
|
1226
|
+
return FAMILY_COLORS[family] ?? ANY;
|
|
1227
|
+
}
|
|
1228
|
+
function pinFace(color, wired) {
|
|
1229
|
+
return wired ? { background: color.fill, borderColor: color.stroke } : { background: "var(--lace-node-bg)", borderColor: color.ring };
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1232
|
+
// src/components/nodes/CallHandles.tsx
|
|
1233
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1234
|
+
var handleStyle = (top, side) => ({
|
|
1235
|
+
background: ANY_PIN_COLOR.fill,
|
|
1236
|
+
borderColor: ANY_PIN_COLOR.stroke,
|
|
1237
|
+
borderWidth: 1,
|
|
1238
|
+
borderStyle: "solid",
|
|
1239
|
+
width: 8,
|
|
1240
|
+
height: 8,
|
|
1241
|
+
top,
|
|
1242
|
+
[side]: -4
|
|
1243
|
+
});
|
|
1244
|
+
var CallHandles = ({
|
|
1245
|
+
nodeId,
|
|
1246
|
+
callWired,
|
|
1247
|
+
metaWired,
|
|
1248
|
+
headerHeight
|
|
1249
|
+
}) => {
|
|
1250
|
+
const updateNodeInternals = (0, import_react7.useUpdateNodeInternals)();
|
|
1251
|
+
const drawn = `${callWired}|${metaWired.join("|")}`;
|
|
1252
|
+
(0, import_react8.useEffect)(() => {
|
|
1253
|
+
updateNodeInternals(nodeId);
|
|
1254
|
+
}, [nodeId, drawn, updateNodeInternals]);
|
|
1255
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
1256
|
+
callWired && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1257
|
+
import_react7.Handle,
|
|
1258
|
+
{
|
|
1259
|
+
id: sourceHandleId(""),
|
|
1260
|
+
type: "source",
|
|
1261
|
+
position: import_react7.Position.Right,
|
|
1262
|
+
isConnectable: false,
|
|
1263
|
+
className: "lace-pin-handle",
|
|
1264
|
+
style: handleStyle(headerHeight / 2, "right")
|
|
1265
|
+
}
|
|
1266
|
+
),
|
|
1267
|
+
metaWired.map((meta) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1268
|
+
import_react7.Handle,
|
|
1269
|
+
{
|
|
1270
|
+
id: targetHandleId(meta),
|
|
1271
|
+
type: "target",
|
|
1272
|
+
position: import_react7.Position.Left,
|
|
1273
|
+
isConnectable: false,
|
|
1274
|
+
className: "lace-pin-handle",
|
|
1275
|
+
style: handleStyle(headerHeight / 2, "left")
|
|
1276
|
+
},
|
|
1277
|
+
meta
|
|
1278
|
+
))
|
|
1279
|
+
] });
|
|
1280
|
+
};
|
|
1281
|
+
|
|
1143
1282
|
// src/components/nodes/CardActions.tsx
|
|
1144
1283
|
var import_ui5 = require("@lace-cloud/ui");
|
|
1145
|
-
var
|
|
1284
|
+
var import_react9 = require("react");
|
|
1146
1285
|
|
|
1147
1286
|
// src/core/panels/row-actions.ts
|
|
1148
1287
|
function rowActionsFor(ctx, panelId, target = {}) {
|
|
@@ -1160,17 +1299,17 @@ function useEditorEnvExtras() {
|
|
|
1160
1299
|
|
|
1161
1300
|
// src/components/nodes/CardActions.tsx
|
|
1162
1301
|
var import_CardActions = require("./CardActions-QLTNQUVW.css");
|
|
1163
|
-
var
|
|
1302
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1164
1303
|
function CardActions({ target }) {
|
|
1165
1304
|
const { ctx, runner } = useCanvas();
|
|
1166
1305
|
const envExtras = useEditorEnvExtras();
|
|
1167
|
-
const actions = (0,
|
|
1306
|
+
const actions = (0, import_react9.useMemo)(
|
|
1168
1307
|
() => resolveContributions(ctx.contributions, ctx.ports, ctx, target).actions.filter(
|
|
1169
1308
|
(a) => a.placement === "card"
|
|
1170
1309
|
),
|
|
1171
1310
|
[ctx, target]
|
|
1172
1311
|
);
|
|
1173
|
-
const runOnCard = (0,
|
|
1312
|
+
const runOnCard = (0, import_react9.useCallback)(
|
|
1174
1313
|
(action) => (e) => {
|
|
1175
1314
|
e.stopPropagation();
|
|
1176
1315
|
void runner.run(action, ctx, target, envExtras);
|
|
@@ -1179,13 +1318,13 @@ function CardActions({ target }) {
|
|
|
1179
1318
|
);
|
|
1180
1319
|
return actions.map((action) => {
|
|
1181
1320
|
const state = actionState(action, ctx, runner.busy(action, ctx, target));
|
|
1182
|
-
return /* @__PURE__ */ (0,
|
|
1321
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1183
1322
|
import_ui5.Tooltip,
|
|
1184
1323
|
{
|
|
1185
1324
|
name: action.label,
|
|
1186
1325
|
content: state.disabledReason,
|
|
1187
1326
|
placement: "bottom-end",
|
|
1188
|
-
children: (describedBy) => /* @__PURE__ */ (0,
|
|
1327
|
+
children: (describedBy) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1189
1328
|
"button",
|
|
1190
1329
|
{
|
|
1191
1330
|
type: "button",
|
|
@@ -1193,7 +1332,7 @@ function CardActions({ target }) {
|
|
|
1193
1332
|
"aria-label": action.label,
|
|
1194
1333
|
"aria-describedby": describedBy,
|
|
1195
1334
|
...(0, import_ui5.inertProps)(isInert(state), runOnCard(action)),
|
|
1196
|
-
children: action.icon ? /* @__PURE__ */ (0,
|
|
1335
|
+
children: action.icon ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(CanvasIcon, { name: action.icon }) : action.label
|
|
1197
1336
|
}
|
|
1198
1337
|
)
|
|
1199
1338
|
},
|
|
@@ -1207,11 +1346,11 @@ var import_GroupNode = require("./GroupNode-NJOGOGQM.css");
|
|
|
1207
1346
|
|
|
1208
1347
|
// src/components/nodes/use-rename-instance.ts
|
|
1209
1348
|
var import_proto3 = require("@lace-cloud/proto");
|
|
1210
|
-
var
|
|
1349
|
+
var import_react11 = require("react");
|
|
1211
1350
|
|
|
1212
1351
|
// src/core/pipeline.ts
|
|
1213
1352
|
var import_proto2 = require("@lace-cloud/proto");
|
|
1214
|
-
var
|
|
1353
|
+
var import_react10 = require("react");
|
|
1215
1354
|
function projectFrame(frame, arrangement) {
|
|
1216
1355
|
return (0, import_proto2.projectCanvasView)(frame.bundle, arrangement, {
|
|
1217
1356
|
canUndo: frame.canUndo,
|
|
@@ -1241,8 +1380,8 @@ function carrySelection(selection, oldPath, newPath) {
|
|
|
1241
1380
|
}
|
|
1242
1381
|
var NO_SOURCE = { source: null, end: null, session: null };
|
|
1243
1382
|
function useCanvasSource(source, onCommandResult, onSessionEnd) {
|
|
1244
|
-
const [held, setHeld] = (0,
|
|
1245
|
-
(0,
|
|
1383
|
+
const [held, setHeld] = (0, import_react10.useState)({ ...NO_SOURCE, port: null });
|
|
1384
|
+
(0, import_react10.useEffect)(() => {
|
|
1246
1385
|
const session = {};
|
|
1247
1386
|
const unsubscribe = source.subscribe(
|
|
1248
1387
|
(next) => setHeld({ source: next, end: null, session, port: source }),
|
|
@@ -1266,9 +1405,9 @@ function useCanvasSource(source, onCommandResult, onSessionEnd) {
|
|
|
1266
1405
|
// src/components/nodes/use-rename-instance.ts
|
|
1267
1406
|
function useRenameInstance() {
|
|
1268
1407
|
const { bundle, view, arrangement, updateArrangement, selection, setSelection, runner } = useCanvas();
|
|
1269
|
-
const latest = (0,
|
|
1408
|
+
const latest = (0, import_react11.useRef)({ view, selection });
|
|
1270
1409
|
latest.current = { view, selection };
|
|
1271
|
-
return (0,
|
|
1410
|
+
return (0, import_react11.useCallback)(
|
|
1272
1411
|
async (canvasPath, newId) => {
|
|
1273
1412
|
const { scope, id: oldId } = (0, import_proto3.instanceAddress)(bundle, canvasPath);
|
|
1274
1413
|
if (!newId || newId === oldId) return;
|
|
@@ -1291,7 +1430,7 @@ function useRenameInstance() {
|
|
|
1291
1430
|
}
|
|
1292
1431
|
|
|
1293
1432
|
// src/components/nodes/GroupNode.tsx
|
|
1294
|
-
var
|
|
1433
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1295
1434
|
var GroupHeader = ({
|
|
1296
1435
|
label,
|
|
1297
1436
|
memberCount,
|
|
@@ -1306,13 +1445,13 @@ var GroupHeader = ({
|
|
|
1306
1445
|
onEditChange,
|
|
1307
1446
|
onEditBlur,
|
|
1308
1447
|
onEditKeyDown
|
|
1309
|
-
}) => /* @__PURE__ */ (0,
|
|
1448
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1310
1449
|
"div",
|
|
1311
1450
|
{
|
|
1312
1451
|
className: `lace-group-node__header lace-group-node__header--${collapsed ? "collapsed" : "expanded"}`,
|
|
1313
1452
|
style: collapsed ? { height: import_proto4.GROUP_HEADER_HEIGHT } : void 0,
|
|
1314
1453
|
children: [
|
|
1315
|
-
/* @__PURE__ */ (0,
|
|
1454
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1316
1455
|
"button",
|
|
1317
1456
|
{
|
|
1318
1457
|
type: "button",
|
|
@@ -1320,11 +1459,11 @@ var GroupHeader = ({
|
|
|
1320
1459
|
className: "lace-group-node__collapse-btn",
|
|
1321
1460
|
title: collapsed ? "Expand" : "Collapse",
|
|
1322
1461
|
"aria-label": collapsed ? "Expand" : "Collapse",
|
|
1323
|
-
children: /* @__PURE__ */ (0,
|
|
1462
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(CanvasIcon, { name: collapsed ? "chevron-right" : "chevron-down" })
|
|
1324
1463
|
}
|
|
1325
1464
|
),
|
|
1326
|
-
/* @__PURE__ */ (0,
|
|
1327
|
-
editing ? /* @__PURE__ */ (0,
|
|
1465
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "lace-group-node__glyph", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(CanvasIcon, { name: "group" }) }),
|
|
1466
|
+
editing ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1328
1467
|
"input",
|
|
1329
1468
|
{
|
|
1330
1469
|
ref: inputRef,
|
|
@@ -1335,26 +1474,29 @@ var GroupHeader = ({
|
|
|
1335
1474
|
className: "lace-group-node__rename-input",
|
|
1336
1475
|
onClick: (e) => e.stopPropagation()
|
|
1337
1476
|
}
|
|
1338
|
-
) : /* @__PURE__ */ (0,
|
|
1339
|
-
/* @__PURE__ */ (0,
|
|
1477
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "lace-group-node__label", onDoubleClick, title: label, children: label }),
|
|
1478
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "lace-group-node__count", children: [
|
|
1340
1479
|
memberCount,
|
|
1341
1480
|
" ",
|
|
1342
1481
|
memberCount === 1 ? "module" : "modules"
|
|
1343
1482
|
] }),
|
|
1344
|
-
hovered && /* @__PURE__ */ (0,
|
|
1483
|
+
hovered && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(CardActions, { target })
|
|
1345
1484
|
]
|
|
1346
1485
|
}
|
|
1347
1486
|
);
|
|
1348
|
-
var InterfacePinRow = ({
|
|
1487
|
+
var InterfacePinRow = ({
|
|
1488
|
+
pin,
|
|
1489
|
+
y,
|
|
1490
|
+
spans
|
|
1491
|
+
}) => {
|
|
1349
1492
|
const isInput = pin.side === "input";
|
|
1350
|
-
return /* @__PURE__ */ (0,
|
|
1493
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1351
1494
|
"div",
|
|
1352
1495
|
{
|
|
1353
1496
|
style: {
|
|
1354
1497
|
position: "absolute",
|
|
1355
1498
|
top: y - import_proto4.NODE_ROW_HEIGHT / 2,
|
|
1356
|
-
left: 0,
|
|
1357
|
-
right: 0,
|
|
1499
|
+
...spans ? { left: 0, right: 0 } : { [isInput ? "left" : "right"]: 0 },
|
|
1358
1500
|
height: import_proto4.NODE_ROW_HEIGHT,
|
|
1359
1501
|
paddingLeft: isInput ? 12 : 8,
|
|
1360
1502
|
paddingRight: isInput ? 8 : 12,
|
|
@@ -1364,12 +1506,12 @@ var InterfacePinRow = ({ pin, y }) => {
|
|
|
1364
1506
|
},
|
|
1365
1507
|
title: pin.name,
|
|
1366
1508
|
children: [
|
|
1367
|
-
/* @__PURE__ */ (0,
|
|
1368
|
-
|
|
1509
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1510
|
+
import_react12.Handle,
|
|
1369
1511
|
{
|
|
1370
1512
|
id: pin.handleId,
|
|
1371
1513
|
type: isInput ? "target" : "source",
|
|
1372
|
-
position: isInput ?
|
|
1514
|
+
position: isInput ? import_react12.Position.Left : import_react12.Position.Right,
|
|
1373
1515
|
isConnectable: false,
|
|
1374
1516
|
className: "lace-pin-handle",
|
|
1375
1517
|
style: {
|
|
@@ -1384,26 +1526,26 @@ var InterfacePinRow = ({ pin, y }) => {
|
|
|
1384
1526
|
}
|
|
1385
1527
|
}
|
|
1386
1528
|
),
|
|
1387
|
-
/* @__PURE__ */ (0,
|
|
1529
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "lace-group-node__pin-label", style: { maxWidth: import_proto4.COLLAPSED_GROUP_WIDTH - 28 }, children: pin.name })
|
|
1388
1530
|
]
|
|
1389
1531
|
}
|
|
1390
1532
|
);
|
|
1391
1533
|
};
|
|
1392
|
-
var GroupNode = ({ data }) => {
|
|
1534
|
+
var GroupNode = ({ id, data }) => {
|
|
1393
1535
|
const { editable, bundle, arrangement, updateArrangement } = useCanvas();
|
|
1394
1536
|
const rename = useRenameInstance();
|
|
1395
|
-
const [editing, setEditing] = (0,
|
|
1396
|
-
const [editValue, setEditValue] = (0,
|
|
1397
|
-
const [hovered, setHovered] = (0,
|
|
1398
|
-
const inputRef = (0,
|
|
1537
|
+
const [editing, setEditing] = (0, import_react13.useState)(false);
|
|
1538
|
+
const [editValue, setEditValue] = (0, import_react13.useState)(data.label);
|
|
1539
|
+
const [hovered, setHovered] = (0, import_react13.useState)(false);
|
|
1540
|
+
const inputRef = (0, import_react13.useRef)(null);
|
|
1399
1541
|
const collapsed = data.collapsed;
|
|
1400
|
-
(0,
|
|
1542
|
+
(0, import_react13.useEffect)(() => {
|
|
1401
1543
|
if (editing && inputRef.current) {
|
|
1402
1544
|
inputRef.current.focus();
|
|
1403
1545
|
inputRef.current.select();
|
|
1404
1546
|
}
|
|
1405
1547
|
}, [editing]);
|
|
1406
|
-
const onDoubleClick = (0,
|
|
1548
|
+
const onDoubleClick = (0, import_react13.useCallback)(
|
|
1407
1549
|
(e) => {
|
|
1408
1550
|
if (!editable) return;
|
|
1409
1551
|
e.stopPropagation();
|
|
@@ -1412,15 +1554,15 @@ var GroupNode = ({ data }) => {
|
|
|
1412
1554
|
},
|
|
1413
1555
|
[data.label, editable]
|
|
1414
1556
|
);
|
|
1415
|
-
const renamingRef = (0,
|
|
1416
|
-
const commitRename = (0,
|
|
1557
|
+
const renamingRef = (0, import_react13.useRef)(false);
|
|
1558
|
+
const commitRename = (0, import_react13.useCallback)(async () => {
|
|
1417
1559
|
if (renamingRef.current) return;
|
|
1418
1560
|
renamingRef.current = true;
|
|
1419
1561
|
setEditing(false);
|
|
1420
1562
|
await rename(data.groupId, editValue.trim());
|
|
1421
1563
|
renamingRef.current = false;
|
|
1422
1564
|
}, [editValue, data.groupId, rename]);
|
|
1423
|
-
const onKeyDown = (0,
|
|
1565
|
+
const onKeyDown = (0, import_react13.useCallback)(
|
|
1424
1566
|
(e) => {
|
|
1425
1567
|
e.stopPropagation();
|
|
1426
1568
|
if (e.key === "Enter") commitRename();
|
|
@@ -1428,14 +1570,14 @@ var GroupNode = ({ data }) => {
|
|
|
1428
1570
|
},
|
|
1429
1571
|
[commitRename]
|
|
1430
1572
|
);
|
|
1431
|
-
const toggleCollapsed = (0,
|
|
1573
|
+
const toggleCollapsed = (0, import_react13.useCallback)(
|
|
1432
1574
|
(e) => {
|
|
1433
1575
|
e.stopPropagation();
|
|
1434
1576
|
updateArrangement(withGroupCollapsed(bundle, arrangement, data.groupId, !data.collapsed));
|
|
1435
1577
|
},
|
|
1436
1578
|
[bundle, data.groupId, data.collapsed, arrangement, updateArrangement]
|
|
1437
1579
|
);
|
|
1438
|
-
const target = (0,
|
|
1580
|
+
const target = (0, import_react13.useMemo)(() => ({ groupId: data.groupId }), [data.groupId]);
|
|
1439
1581
|
const headerProps = {
|
|
1440
1582
|
label: data.label,
|
|
1441
1583
|
memberCount: data.memberCount,
|
|
@@ -1451,11 +1593,24 @@ var GroupNode = ({ data }) => {
|
|
|
1451
1593
|
onEditBlur: commitRename,
|
|
1452
1594
|
onEditKeyDown: onKeyDown
|
|
1453
1595
|
};
|
|
1596
|
+
const inputs = data.interfacePins.filter((p) => p.side === "input");
|
|
1597
|
+
const outputs = data.interfacePins.filter((p) => p.side === "output");
|
|
1598
|
+
const callHandles = /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1599
|
+
CallHandles,
|
|
1600
|
+
{
|
|
1601
|
+
nodeId: id,
|
|
1602
|
+
callWired: data.callWired,
|
|
1603
|
+
metaWired: data.metaWired,
|
|
1604
|
+
headerHeight: import_proto4.GROUP_HEADER_HEIGHT
|
|
1605
|
+
}
|
|
1606
|
+
);
|
|
1607
|
+
const pinRows = (spans) => [
|
|
1608
|
+
...inputs.map((pin, i) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(InterfacePinRow, { pin, y: (0, import_proto4.groupPinY)(i), spans }, pin.handleId)),
|
|
1609
|
+
...outputs.map((pin, i) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(InterfacePinRow, { pin, y: (0, import_proto4.groupPinY)(i), spans }, pin.handleId))
|
|
1610
|
+
];
|
|
1454
1611
|
if (collapsed) {
|
|
1455
|
-
const inputs = data.interfacePins.filter((p) => p.side === "input");
|
|
1456
|
-
const outputs = data.interfacePins.filter((p) => p.side === "output");
|
|
1457
1612
|
const bare = data.interfacePins.length === 0;
|
|
1458
|
-
return /* @__PURE__ */ (0,
|
|
1613
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1459
1614
|
"div",
|
|
1460
1615
|
{
|
|
1461
1616
|
"data-group": data.groupId,
|
|
@@ -1465,15 +1620,15 @@ var GroupNode = ({ data }) => {
|
|
|
1465
1620
|
onMouseEnter: () => setHovered(true),
|
|
1466
1621
|
onMouseLeave: () => setHovered(false),
|
|
1467
1622
|
children: [
|
|
1468
|
-
/* @__PURE__ */ (0,
|
|
1469
|
-
/* @__PURE__ */ (0,
|
|
1470
|
-
|
|
1471
|
-
|
|
1623
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(GroupHeader, { ...headerProps }),
|
|
1624
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(BadgeRow, { badges: data.badges }),
|
|
1625
|
+
callHandles,
|
|
1626
|
+
pinRows(true)
|
|
1472
1627
|
]
|
|
1473
1628
|
}
|
|
1474
1629
|
);
|
|
1475
1630
|
}
|
|
1476
|
-
return /* @__PURE__ */ (0,
|
|
1631
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1477
1632
|
"div",
|
|
1478
1633
|
{
|
|
1479
1634
|
"data-group": data.groupId,
|
|
@@ -1483,8 +1638,10 @@ var GroupNode = ({ data }) => {
|
|
|
1483
1638
|
onMouseEnter: () => setHovered(true),
|
|
1484
1639
|
onMouseLeave: () => setHovered(false),
|
|
1485
1640
|
children: [
|
|
1486
|
-
/* @__PURE__ */ (0,
|
|
1487
|
-
/* @__PURE__ */ (0,
|
|
1641
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(GroupHeader, { ...headerProps }),
|
|
1642
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(BadgeRow, { badges: data.badges }),
|
|
1643
|
+
callHandles,
|
|
1644
|
+
pinRows(false)
|
|
1488
1645
|
]
|
|
1489
1646
|
}
|
|
1490
1647
|
);
|
|
@@ -1493,8 +1650,8 @@ var GroupNode_default = GroupNode;
|
|
|
1493
1650
|
|
|
1494
1651
|
// src/components/nodes/ModuleNode.tsx
|
|
1495
1652
|
var import_proto6 = require("@lace-cloud/proto");
|
|
1496
|
-
var
|
|
1497
|
-
var
|
|
1653
|
+
var import_react15 = require("@xyflow/react");
|
|
1654
|
+
var import_react16 = require("react");
|
|
1498
1655
|
|
|
1499
1656
|
// src/core/decorate.ts
|
|
1500
1657
|
var import_proto5 = require("@lace-cloud/proto");
|
|
@@ -1560,19 +1717,6 @@ function diagnosticsBadge(held) {
|
|
|
1560
1717
|
};
|
|
1561
1718
|
}
|
|
1562
1719
|
|
|
1563
|
-
// src/utils/handleId.ts
|
|
1564
|
-
var NODE_HANDLE = "node";
|
|
1565
|
-
function parseHandleId(handleId, prefix) {
|
|
1566
|
-
if (!handleId) return null;
|
|
1567
|
-
const marker = `${prefix}:`;
|
|
1568
|
-
if (!handleId.startsWith(marker)) return null;
|
|
1569
|
-
const name = handleId.slice(marker.length);
|
|
1570
|
-
return name.length > 0 ? name : null;
|
|
1571
|
-
}
|
|
1572
|
-
function sourceHandleId(output) {
|
|
1573
|
-
return `out:${output}`;
|
|
1574
|
-
}
|
|
1575
|
-
|
|
1576
1720
|
// src/utils/typed-name.ts
|
|
1577
1721
|
function typedName(name, type) {
|
|
1578
1722
|
return type ? `${name}: ${type}` : name;
|
|
@@ -1582,81 +1726,26 @@ function typedName(name, type) {
|
|
|
1582
1726
|
var import_ModuleNode = require("./ModuleNode-LPPBJZCD.css");
|
|
1583
1727
|
|
|
1584
1728
|
// src/components/nodes/node-config-bus.tsx
|
|
1585
|
-
var
|
|
1586
|
-
var
|
|
1587
|
-
var NodeConfigBusContext = (0,
|
|
1729
|
+
var import_react14 = require("react");
|
|
1730
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1731
|
+
var NodeConfigBusContext = (0, import_react14.createContext)(null);
|
|
1588
1732
|
function NodeConfigBusProvider({
|
|
1589
1733
|
onOpen,
|
|
1590
1734
|
children
|
|
1591
1735
|
}) {
|
|
1592
|
-
const onOpenRef = (0,
|
|
1736
|
+
const onOpenRef = (0, import_react14.useRef)(onOpen);
|
|
1593
1737
|
onOpenRef.current = onOpen;
|
|
1594
|
-
const stableRef = (0,
|
|
1595
|
-
return /* @__PURE__ */ (0,
|
|
1738
|
+
const stableRef = (0, import_react14.useRef)((instanceId) => onOpenRef.current(instanceId));
|
|
1739
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(NodeConfigBusContext.Provider, { value: stableRef.current, children });
|
|
1596
1740
|
}
|
|
1597
1741
|
function useOpenNodeConfig() {
|
|
1598
|
-
const fn = (0,
|
|
1742
|
+
const fn = (0, import_react14.useContext)(NodeConfigBusContext);
|
|
1599
1743
|
if (!fn) throw new Error("useOpenNodeConfig: mount inside <NodeConfigBusProvider>");
|
|
1600
1744
|
return fn;
|
|
1601
1745
|
}
|
|
1602
1746
|
|
|
1603
|
-
// src/components/nodes/pinColor.ts
|
|
1604
|
-
var STRING = {
|
|
1605
|
-
fill: "var(--lace-pin-string-fill)",
|
|
1606
|
-
stroke: "var(--lace-pin-string-stroke)"
|
|
1607
|
-
};
|
|
1608
|
-
var NUMBER = {
|
|
1609
|
-
fill: "var(--lace-pin-number-fill)",
|
|
1610
|
-
stroke: "var(--lace-pin-number-stroke)"
|
|
1611
|
-
};
|
|
1612
|
-
var BOOL = {
|
|
1613
|
-
fill: "var(--lace-pin-bool-fill)",
|
|
1614
|
-
stroke: "var(--lace-pin-bool-stroke)"
|
|
1615
|
-
};
|
|
1616
|
-
var LIST = {
|
|
1617
|
-
fill: "var(--lace-pin-list-fill)",
|
|
1618
|
-
stroke: "var(--lace-pin-list-stroke)"
|
|
1619
|
-
};
|
|
1620
|
-
var MAP = {
|
|
1621
|
-
fill: "var(--lace-pin-map-fill)",
|
|
1622
|
-
stroke: "var(--lace-pin-map-stroke)"
|
|
1623
|
-
};
|
|
1624
|
-
var OBJECT = {
|
|
1625
|
-
fill: "var(--lace-pin-object-fill)",
|
|
1626
|
-
stroke: "var(--lace-pin-object-stroke)"
|
|
1627
|
-
};
|
|
1628
|
-
var ANY = {
|
|
1629
|
-
fill: "var(--lace-pin-any-fill)",
|
|
1630
|
-
stroke: "var(--lace-pin-any-stroke)"
|
|
1631
|
-
};
|
|
1632
|
-
var FAMILY_COLORS = {
|
|
1633
|
-
string: STRING,
|
|
1634
|
-
number: NUMBER,
|
|
1635
|
-
bool: BOOL,
|
|
1636
|
-
boolean: BOOL,
|
|
1637
|
-
list: LIST,
|
|
1638
|
-
set: LIST,
|
|
1639
|
-
tuple: LIST,
|
|
1640
|
-
map: MAP,
|
|
1641
|
-
object: OBJECT,
|
|
1642
|
-
any: ANY
|
|
1643
|
-
};
|
|
1644
|
-
var ANY_PIN_COLOR = ANY;
|
|
1645
|
-
function inferTypeFamily(type) {
|
|
1646
|
-
const t = (type || "").trim().toLowerCase();
|
|
1647
|
-
if (t === "" || t === "any") return "any";
|
|
1648
|
-
for (const family of ["list", "set", "tuple", "map", "object"]) {
|
|
1649
|
-
if (t.startsWith(family)) return family;
|
|
1650
|
-
}
|
|
1651
|
-
return t;
|
|
1652
|
-
}
|
|
1653
|
-
function pinColor(pin) {
|
|
1654
|
-
const family = pin.type_family ?? inferTypeFamily(pin.type);
|
|
1655
|
-
return FAMILY_COLORS[family] ?? ANY;
|
|
1656
|
-
}
|
|
1657
|
-
|
|
1658
1747
|
// src/components/nodes/ModuleNode.tsx
|
|
1659
|
-
var
|
|
1748
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1660
1749
|
var ICON_SIZE = 16;
|
|
1661
1750
|
var LABEL_ROOM = import_proto6.NODE_WIDTH - 28;
|
|
1662
1751
|
var labelRoom = (shared) => shared ? LABEL_ROOM / 2 - 4 : LABEL_ROOM;
|
|
@@ -1667,14 +1756,14 @@ var PROBLEM_RING = {
|
|
|
1667
1756
|
neutral: void 0
|
|
1668
1757
|
};
|
|
1669
1758
|
var PinRow = ({ pin, side, top, shared, problem, isConnectable }) => {
|
|
1670
|
-
const color = pinColor(pin);
|
|
1671
1759
|
const isInput = side === "input";
|
|
1672
1760
|
const filled = !!pin.wired;
|
|
1761
|
+
const face = pinFace(pinColor(pin), filled);
|
|
1673
1762
|
const ring = problem ? PROBLEM_RING[problem.tone] : void 0;
|
|
1674
1763
|
const isError = problem?.tone === "error";
|
|
1675
|
-
const
|
|
1676
|
-
background:
|
|
1677
|
-
borderColor: ring ??
|
|
1764
|
+
const handleStyle2 = {
|
|
1765
|
+
background: face.background,
|
|
1766
|
+
borderColor: ring ?? face.borderColor,
|
|
1678
1767
|
borderWidth: ring ? 2 : 1.5,
|
|
1679
1768
|
borderStyle: "solid",
|
|
1680
1769
|
width: 10,
|
|
@@ -1683,7 +1772,7 @@ var PinRow = ({ pin, side, top, shared, problem, isConnectable }) => {
|
|
|
1683
1772
|
top: import_proto6.NODE_ROW_HEIGHT / 2
|
|
1684
1773
|
};
|
|
1685
1774
|
const about = `${typedName(pin.name, pin.type)}${pin.description ? ` \u2014 ${pin.description}` : ""}`;
|
|
1686
|
-
return /* @__PURE__ */ (0,
|
|
1775
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1687
1776
|
"div",
|
|
1688
1777
|
{
|
|
1689
1778
|
className: "lace-pin-row",
|
|
@@ -1702,18 +1791,18 @@ var PinRow = ({ pin, side, top, shared, problem, isConnectable }) => {
|
|
|
1702
1791
|
title: problem ? `${problem.message}
|
|
1703
1792
|
${about}` : about,
|
|
1704
1793
|
children: [
|
|
1705
|
-
/* @__PURE__ */ (0,
|
|
1706
|
-
|
|
1794
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1795
|
+
import_react15.Handle,
|
|
1707
1796
|
{
|
|
1708
|
-
id:
|
|
1797
|
+
id: isInput ? targetHandleId(pin.name) : sourceHandleId(pin.name),
|
|
1709
1798
|
type: isInput ? "target" : "source",
|
|
1710
|
-
position: isInput ?
|
|
1799
|
+
position: isInput ? import_react15.Position.Left : import_react15.Position.Right,
|
|
1711
1800
|
isConnectable,
|
|
1712
1801
|
className: "lace-pin-handle",
|
|
1713
|
-
style:
|
|
1802
|
+
style: handleStyle2
|
|
1714
1803
|
}
|
|
1715
1804
|
),
|
|
1716
|
-
/* @__PURE__ */ (0,
|
|
1805
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1717
1806
|
"span",
|
|
1718
1807
|
{
|
|
1719
1808
|
className: `lace-module-node__pin-row-label lace-module-node__pin-row-label--${isError ? "error" : filled ? "wired" : "default"}`,
|
|
@@ -1728,17 +1817,17 @@ ${about}` : about,
|
|
|
1728
1817
|
var ModuleNode = ({ id, data }) => {
|
|
1729
1818
|
const { editable, bundle } = useCanvas();
|
|
1730
1819
|
const rename = useRenameInstance();
|
|
1731
|
-
const connecting = (0,
|
|
1820
|
+
const connecting = (0, import_react15.useStore)(nodeDragging);
|
|
1732
1821
|
const openNodeConfig = useOpenNodeConfig();
|
|
1733
|
-
const [editing, setEditing] = (0,
|
|
1734
|
-
const [editValue, setEditValue] = (0,
|
|
1735
|
-
const [hovered, setHovered] = (0,
|
|
1736
|
-
const [imgFailed, setImgFailed] = (0,
|
|
1737
|
-
const [collapsed, setCollapsed] = (0,
|
|
1738
|
-
const [showAllInputs, setShowAllInputs] = (0,
|
|
1739
|
-
const inputRef = (0,
|
|
1740
|
-
const renamingRef = (0,
|
|
1741
|
-
(0,
|
|
1822
|
+
const [editing, setEditing] = (0, import_react16.useState)(false);
|
|
1823
|
+
const [editValue, setEditValue] = (0, import_react16.useState)(id);
|
|
1824
|
+
const [hovered, setHovered] = (0, import_react16.useState)(false);
|
|
1825
|
+
const [imgFailed, setImgFailed] = (0, import_react16.useState)(false);
|
|
1826
|
+
const [collapsed, setCollapsed] = (0, import_react16.useState)(false);
|
|
1827
|
+
const [showAllInputs, setShowAllInputs] = (0, import_react16.useState)(false);
|
|
1828
|
+
const inputRef = (0, import_react16.useRef)(null);
|
|
1829
|
+
const renamingRef = (0, import_react16.useRef)(false);
|
|
1830
|
+
(0, import_react16.useEffect)(() => {
|
|
1742
1831
|
if (editing && inputRef.current) {
|
|
1743
1832
|
inputRef.current.focus();
|
|
1744
1833
|
inputRef.current.select();
|
|
@@ -1746,7 +1835,7 @@ var ModuleNode = ({ id, data }) => {
|
|
|
1746
1835
|
}, [editing]);
|
|
1747
1836
|
const inputs = data.inputs ?? [];
|
|
1748
1837
|
const outputs = data.outputs ?? [];
|
|
1749
|
-
const { shownInputs, hiddenInputCount } = (0,
|
|
1838
|
+
const { shownInputs, hiddenInputCount } = (0, import_react16.useMemo)(() => {
|
|
1750
1839
|
if (showAllInputs) {
|
|
1751
1840
|
return { shownInputs: inputs, hiddenInputCount: 0 };
|
|
1752
1841
|
}
|
|
@@ -1757,15 +1846,15 @@ var ModuleNode = ({ id, data }) => {
|
|
|
1757
1846
|
};
|
|
1758
1847
|
}, [inputs, showAllInputs]);
|
|
1759
1848
|
const inputRows = shownInputs.length + (hiddenInputCount > 0 ? 1 : 0);
|
|
1760
|
-
const updateNodeInternals = (0,
|
|
1849
|
+
const updateNodeInternals = (0, import_react15.useUpdateNodeInternals)();
|
|
1761
1850
|
const drawnHandles = [
|
|
1762
|
-
...shownInputs.map((pin) =>
|
|
1851
|
+
...shownInputs.map((pin) => targetHandleId(pin.name)),
|
|
1763
1852
|
...outputs.map((pin) => sourceHandleId(pin.name))
|
|
1764
1853
|
].join("|");
|
|
1765
|
-
(0,
|
|
1854
|
+
(0, import_react16.useEffect)(() => {
|
|
1766
1855
|
updateNodeInternals(id);
|
|
1767
1856
|
}, [id, drawnHandles, updateNodeInternals]);
|
|
1768
|
-
const onDoubleClick = (0,
|
|
1857
|
+
const onDoubleClick = (0, import_react16.useCallback)(
|
|
1769
1858
|
(e) => {
|
|
1770
1859
|
if (!editable) return;
|
|
1771
1860
|
e.stopPropagation();
|
|
@@ -1774,14 +1863,14 @@ var ModuleNode = ({ id, data }) => {
|
|
|
1774
1863
|
},
|
|
1775
1864
|
[id, editable, bundle]
|
|
1776
1865
|
);
|
|
1777
|
-
const commitRename = (0,
|
|
1866
|
+
const commitRename = (0, import_react16.useCallback)(async () => {
|
|
1778
1867
|
if (renamingRef.current) return;
|
|
1779
1868
|
renamingRef.current = true;
|
|
1780
1869
|
setEditing(false);
|
|
1781
1870
|
await rename(id, editValue.trim());
|
|
1782
1871
|
renamingRef.current = false;
|
|
1783
1872
|
}, [editValue, id, rename]);
|
|
1784
|
-
const onKeyDown = (0,
|
|
1873
|
+
const onKeyDown = (0, import_react16.useCallback)(
|
|
1785
1874
|
(e) => {
|
|
1786
1875
|
e.stopPropagation();
|
|
1787
1876
|
if (e.key === "Enter") commitRename();
|
|
@@ -1789,7 +1878,7 @@ var ModuleNode = ({ id, data }) => {
|
|
|
1789
1878
|
},
|
|
1790
1879
|
[commitRename]
|
|
1791
1880
|
);
|
|
1792
|
-
const onHeaderClick = (0,
|
|
1881
|
+
const onHeaderClick = (0, import_react16.useCallback)(
|
|
1793
1882
|
(e) => {
|
|
1794
1883
|
if (!e.shiftKey && !e.metaKey && !e.ctrlKey) {
|
|
1795
1884
|
openNodeConfig(data.id);
|
|
@@ -1797,12 +1886,12 @@ var ModuleNode = ({ id, data }) => {
|
|
|
1797
1886
|
},
|
|
1798
1887
|
[data.id, openNodeConfig]
|
|
1799
1888
|
);
|
|
1800
|
-
const target = (0,
|
|
1801
|
-
const toggleCollapsed = (0,
|
|
1889
|
+
const target = (0, import_react16.useMemo)(() => ({ nodeId: data.id }), [data.id]);
|
|
1890
|
+
const toggleCollapsed = (0, import_react16.useCallback)((e) => {
|
|
1802
1891
|
e.stopPropagation();
|
|
1803
1892
|
setCollapsed((v) => !v);
|
|
1804
1893
|
}, []);
|
|
1805
|
-
const toggleShowAllInputs = (0,
|
|
1894
|
+
const toggleShowAllInputs = (0, import_react16.useCallback)((e) => {
|
|
1806
1895
|
e.stopPropagation();
|
|
1807
1896
|
setShowAllInputs((v) => !v);
|
|
1808
1897
|
}, []);
|
|
@@ -1814,7 +1903,7 @@ var ModuleNode = ({ id, data }) => {
|
|
|
1814
1903
|
const bodyHeight = rowCount * import_proto6.NODE_ROW_HEIGHT;
|
|
1815
1904
|
const nodeHeight = import_proto6.NODE_HEADER_HEIGHT + bodyHeight;
|
|
1816
1905
|
const stateClass = hasAnyError ? "lace-module-node--error" : isNew ? "lace-module-node--new" : "";
|
|
1817
|
-
return /* @__PURE__ */ (0,
|
|
1906
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1818
1907
|
"div",
|
|
1819
1908
|
{
|
|
1820
1909
|
className: `lace-module-node${collapsed ? " lace-module-node--collapsed" : ""}${stateClass ? ` ${stateClass}` : ""}`,
|
|
@@ -1822,7 +1911,7 @@ var ModuleNode = ({ id, data }) => {
|
|
|
1822
1911
|
onMouseEnter: () => setHovered(true),
|
|
1823
1912
|
onMouseLeave: () => setHovered(false),
|
|
1824
1913
|
children: [
|
|
1825
|
-
/* @__PURE__ */ (0,
|
|
1914
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1826
1915
|
"div",
|
|
1827
1916
|
{
|
|
1828
1917
|
className: "lace-module-node__header",
|
|
@@ -1830,7 +1919,7 @@ var ModuleNode = ({ id, data }) => {
|
|
|
1830
1919
|
onClick: onHeaderClick,
|
|
1831
1920
|
title: badges.length > 0 ? badges.map((b) => b.title ?? b.label).join("\n") : data.label,
|
|
1832
1921
|
children: [
|
|
1833
|
-
/* @__PURE__ */ (0,
|
|
1922
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1834
1923
|
"button",
|
|
1835
1924
|
{
|
|
1836
1925
|
type: "button",
|
|
@@ -1838,10 +1927,10 @@ var ModuleNode = ({ id, data }) => {
|
|
|
1838
1927
|
className: "lace-module-node__collapse-btn",
|
|
1839
1928
|
title: collapsed ? "Expand" : "Collapse",
|
|
1840
1929
|
"aria-label": collapsed ? "Expand" : "Collapse",
|
|
1841
|
-
children: /* @__PURE__ */ (0,
|
|
1930
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(CanvasIcon, { name: collapsed ? "chevron-right" : "chevron-down" })
|
|
1842
1931
|
}
|
|
1843
1932
|
),
|
|
1844
|
-
showIcon ? /* @__PURE__ */ (0,
|
|
1933
|
+
showIcon ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1845
1934
|
"img",
|
|
1846
1935
|
{
|
|
1847
1936
|
src: data.icon_url,
|
|
@@ -1850,8 +1939,8 @@ var ModuleNode = ({ id, data }) => {
|
|
|
1850
1939
|
style: { width: ICON_SIZE, height: ICON_SIZE },
|
|
1851
1940
|
onError: () => setImgFailed(true)
|
|
1852
1941
|
}
|
|
1853
|
-
) : /* @__PURE__ */ (0,
|
|
1854
|
-
editing ? /* @__PURE__ */ (0,
|
|
1942
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "lace-module-node__icon-fallback", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(CanvasIcon, { name: "module" }) }),
|
|
1943
|
+
editing ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1855
1944
|
"input",
|
|
1856
1945
|
{
|
|
1857
1946
|
ref: inputRef,
|
|
@@ -1862,7 +1951,7 @@ var ModuleNode = ({ id, data }) => {
|
|
|
1862
1951
|
className: "lace-module-node__rename-input",
|
|
1863
1952
|
onClick: (e) => e.stopPropagation()
|
|
1864
1953
|
}
|
|
1865
|
-
) : /* @__PURE__ */ (0,
|
|
1954
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1866
1955
|
"span",
|
|
1867
1956
|
{
|
|
1868
1957
|
className: "lace-module-node__label",
|
|
@@ -1871,33 +1960,22 @@ var ModuleNode = ({ id, data }) => {
|
|
|
1871
1960
|
children: data.label
|
|
1872
1961
|
}
|
|
1873
1962
|
),
|
|
1874
|
-
hovered && /* @__PURE__ */ (0,
|
|
1963
|
+
hovered && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(CardActions, { target })
|
|
1875
1964
|
]
|
|
1876
1965
|
}
|
|
1877
1966
|
),
|
|
1878
|
-
/* @__PURE__ */ (0,
|
|
1879
|
-
|
|
1880
|
-
|
|
1967
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(BadgeRow, { badges }),
|
|
1968
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1969
|
+
CallHandles,
|
|
1881
1970
|
{
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
className: "lace-pin-handle",
|
|
1887
|
-
style: {
|
|
1888
|
-
background: ANY_PIN_COLOR.fill,
|
|
1889
|
-
borderColor: ANY_PIN_COLOR.stroke,
|
|
1890
|
-
borderWidth: 1,
|
|
1891
|
-
borderStyle: "solid",
|
|
1892
|
-
width: 8,
|
|
1893
|
-
height: 8,
|
|
1894
|
-
top: import_proto6.NODE_HEADER_HEIGHT / 2,
|
|
1895
|
-
right: -4
|
|
1896
|
-
}
|
|
1971
|
+
nodeId: id,
|
|
1972
|
+
callWired: !!data.call_wired,
|
|
1973
|
+
metaWired: data.meta_wired ?? [],
|
|
1974
|
+
headerHeight: import_proto6.NODE_HEADER_HEIGHT
|
|
1897
1975
|
}
|
|
1898
1976
|
),
|
|
1899
|
-
!collapsed && /* @__PURE__ */ (0,
|
|
1900
|
-
shownInputs.map((pin, i) => /* @__PURE__ */ (0,
|
|
1977
|
+
!collapsed && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "lace-module-node__body", style: { height: bodyHeight }, children: [
|
|
1978
|
+
shownInputs.map((pin, i) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1901
1979
|
PinRow,
|
|
1902
1980
|
{
|
|
1903
1981
|
pin,
|
|
@@ -1909,7 +1987,7 @@ var ModuleNode = ({ id, data }) => {
|
|
|
1909
1987
|
},
|
|
1910
1988
|
`in:${pin.name}`
|
|
1911
1989
|
)),
|
|
1912
|
-
outputs.map((pin, i) => /* @__PURE__ */ (0,
|
|
1990
|
+
outputs.map((pin, i) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1913
1991
|
PinRow,
|
|
1914
1992
|
{
|
|
1915
1993
|
pin,
|
|
@@ -1920,7 +1998,7 @@ var ModuleNode = ({ id, data }) => {
|
|
|
1920
1998
|
},
|
|
1921
1999
|
`out:${pin.name}`
|
|
1922
2000
|
)),
|
|
1923
|
-
hiddenInputCount > 0 && /* @__PURE__ */ (0,
|
|
2001
|
+
hiddenInputCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1924
2002
|
"div",
|
|
1925
2003
|
{
|
|
1926
2004
|
className: "lace-module-node__hidden-count",
|
|
@@ -1945,20 +2023,19 @@ var ModuleNode = ({ id, data }) => {
|
|
|
1945
2023
|
}
|
|
1946
2024
|
)
|
|
1947
2025
|
] }),
|
|
1948
|
-
collapsed && /* @__PURE__ */ (0,
|
|
2026
|
+
collapsed && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
1949
2027
|
inputs.map((pin, i) => {
|
|
1950
|
-
const
|
|
1951
|
-
return /* @__PURE__ */ (0,
|
|
1952
|
-
|
|
2028
|
+
const face = pinFace(pinColor(pin), !!pin.wired);
|
|
2029
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2030
|
+
import_react15.Handle,
|
|
1953
2031
|
{
|
|
1954
|
-
id:
|
|
2032
|
+
id: targetHandleId(pin.name),
|
|
1955
2033
|
type: "target",
|
|
1956
|
-
position:
|
|
2034
|
+
position: import_react15.Position.Left,
|
|
1957
2035
|
isConnectable: editable,
|
|
1958
2036
|
className: "lace-pin-handle",
|
|
1959
2037
|
style: {
|
|
1960
|
-
|
|
1961
|
-
borderColor: pin.wired ? color.stroke : color.fill,
|
|
2038
|
+
...face,
|
|
1962
2039
|
borderWidth: 1,
|
|
1963
2040
|
borderStyle: "solid",
|
|
1964
2041
|
width: 8,
|
|
@@ -1967,22 +2044,21 @@ var ModuleNode = ({ id, data }) => {
|
|
|
1967
2044
|
left: -4
|
|
1968
2045
|
}
|
|
1969
2046
|
},
|
|
1970
|
-
|
|
2047
|
+
targetHandleId(pin.name)
|
|
1971
2048
|
);
|
|
1972
2049
|
}),
|
|
1973
2050
|
outputs.map((pin, i) => {
|
|
1974
|
-
const
|
|
1975
|
-
return /* @__PURE__ */ (0,
|
|
1976
|
-
|
|
2051
|
+
const face = pinFace(pinColor(pin), !!pin.wired);
|
|
2052
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2053
|
+
import_react15.Handle,
|
|
1977
2054
|
{
|
|
1978
|
-
id:
|
|
2055
|
+
id: sourceHandleId(pin.name),
|
|
1979
2056
|
type: "source",
|
|
1980
|
-
position:
|
|
2057
|
+
position: import_react15.Position.Right,
|
|
1981
2058
|
isConnectable: editable,
|
|
1982
2059
|
className: "lace-pin-handle",
|
|
1983
2060
|
style: {
|
|
1984
|
-
|
|
1985
|
-
borderColor: pin.wired ? color.stroke : color.fill,
|
|
2061
|
+
...face,
|
|
1986
2062
|
borderWidth: 1,
|
|
1987
2063
|
borderStyle: "solid",
|
|
1988
2064
|
width: 8,
|
|
@@ -1991,27 +2067,27 @@ var ModuleNode = ({ id, data }) => {
|
|
|
1991
2067
|
right: -4
|
|
1992
2068
|
}
|
|
1993
2069
|
},
|
|
1994
|
-
|
|
2070
|
+
sourceHandleId(pin.name)
|
|
1995
2071
|
);
|
|
1996
2072
|
})
|
|
1997
2073
|
] }),
|
|
1998
|
-
editable && /* @__PURE__ */ (0,
|
|
1999
|
-
/* @__PURE__ */ (0,
|
|
2000
|
-
|
|
2074
|
+
editable && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
2075
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2076
|
+
import_react15.Handle,
|
|
2001
2077
|
{
|
|
2002
2078
|
id: NODE_HANDLE,
|
|
2003
2079
|
type: "source",
|
|
2004
|
-
position:
|
|
2080
|
+
position: import_react15.Position.Bottom,
|
|
2005
2081
|
onClick: void 0,
|
|
2006
2082
|
className: "lace-module-node__grip"
|
|
2007
2083
|
}
|
|
2008
2084
|
),
|
|
2009
|
-
/* @__PURE__ */ (0,
|
|
2010
|
-
|
|
2085
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2086
|
+
import_react15.Handle,
|
|
2011
2087
|
{
|
|
2012
2088
|
id: NODE_HANDLE,
|
|
2013
2089
|
type: "target",
|
|
2014
|
-
position:
|
|
2090
|
+
position: import_react15.Position.Top,
|
|
2015
2091
|
isConnectableStart: false,
|
|
2016
2092
|
isConnectableEnd: connecting,
|
|
2017
2093
|
className: "lace-module-node__drop"
|
|
@@ -2026,9 +2102,9 @@ var ModuleNode_default = ModuleNode;
|
|
|
2026
2102
|
|
|
2027
2103
|
// src/components/PaperGrid.tsx
|
|
2028
2104
|
var import_PaperGrid = require("./PaperGrid-JG4GBRDP.css");
|
|
2029
|
-
var
|
|
2105
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
2030
2106
|
function PaperGrid() {
|
|
2031
|
-
return /* @__PURE__ */ (0,
|
|
2107
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "lace-paper-layers lace-canvas-paper", "aria-hidden": "true" });
|
|
2032
2108
|
}
|
|
2033
2109
|
|
|
2034
2110
|
// src/core/editor-actions.ts
|
|
@@ -12921,7 +12997,9 @@ var CORE_EDITOR_ACTIONS = [
|
|
|
12921
12997
|
icon: "redo",
|
|
12922
12998
|
section: "history",
|
|
12923
12999
|
placement: "toolbar",
|
|
12924
|
-
|
|
13000
|
+
// ⇧⌘Z / Ctrl+Shift+Z everywhere, and Ctrl+Y where Windows and Linux
|
|
13001
|
+
// bind it; the first is what the tooltip spells.
|
|
13002
|
+
keys: ["Mod+Shift+z", "Ctrl+y"],
|
|
12925
13003
|
requiredPorts: ["editor"],
|
|
12926
13004
|
requiredContext: ["editable"],
|
|
12927
13005
|
enabledWhen: [{ key: "redoable", reason: "Nothing to redo" }],
|
|
@@ -13054,7 +13132,7 @@ var CORE_EDITOR_ACTIONS = [
|
|
|
13054
13132
|
];
|
|
13055
13133
|
|
|
13056
13134
|
// src/core/use-action-keys.ts
|
|
13057
|
-
var
|
|
13135
|
+
var import_react17 = require("react");
|
|
13058
13136
|
|
|
13059
13137
|
// src/contribution-types.ts
|
|
13060
13138
|
var KEY_SCOPES = ["surface", "app"];
|
|
@@ -13077,7 +13155,7 @@ function isFormTarget(target) {
|
|
|
13077
13155
|
return tag === "INPUT" || tag === "TEXTAREA" || tag === "SELECT" || target.isContentEditable;
|
|
13078
13156
|
}
|
|
13079
13157
|
function useFocusWhenNoneHeld(root, mounted) {
|
|
13080
|
-
(0,
|
|
13158
|
+
(0, import_react17.useEffect)(() => {
|
|
13081
13159
|
const element = root.current;
|
|
13082
13160
|
if (!mounted || !element) return;
|
|
13083
13161
|
const doc = element.ownerDocument;
|
|
@@ -13092,24 +13170,60 @@ function useFocusWhenNoneHeld(root, mounted) {
|
|
|
13092
13170
|
return () => view?.removeEventListener("focus", takeFocus);
|
|
13093
13171
|
}, [root, mounted]);
|
|
13094
13172
|
}
|
|
13173
|
+
var focusKeepers = /* @__PURE__ */ new WeakSet();
|
|
13174
|
+
function keeperOf(focused) {
|
|
13175
|
+
for (let at = focused.parentElement; at; at = at.parentElement) {
|
|
13176
|
+
if (focusKeepers.has(at)) return at;
|
|
13177
|
+
}
|
|
13178
|
+
return void 0;
|
|
13179
|
+
}
|
|
13180
|
+
function useFocusKeptOnRemoval(target, mounted) {
|
|
13181
|
+
(0, import_react17.useEffect)(() => {
|
|
13182
|
+
const element = target.current;
|
|
13183
|
+
if (!mounted || !element) return;
|
|
13184
|
+
const doc = element.ownerDocument;
|
|
13185
|
+
focusKeepers.add(element);
|
|
13186
|
+
let held;
|
|
13187
|
+
const onFocusIn = (e) => {
|
|
13188
|
+
const focused = e.target instanceof Element ? e.target : void 0;
|
|
13189
|
+
held = focused && keeperOf(focused) === element ? focused : void 0;
|
|
13190
|
+
};
|
|
13191
|
+
const observer = new MutationObserver(() => {
|
|
13192
|
+
if (!held || held.isConnected) return;
|
|
13193
|
+
held = void 0;
|
|
13194
|
+
if (doc.activeElement === null || doc.activeElement === doc.body) {
|
|
13195
|
+
element.focus({ preventScroll: true });
|
|
13196
|
+
}
|
|
13197
|
+
});
|
|
13198
|
+
element.addEventListener("focusin", onFocusIn);
|
|
13199
|
+
observer.observe(element, { childList: true, subtree: true });
|
|
13200
|
+
return () => {
|
|
13201
|
+
observer.disconnect();
|
|
13202
|
+
element.removeEventListener("focusin", onFocusIn);
|
|
13203
|
+
focusKeepers.delete(element);
|
|
13204
|
+
};
|
|
13205
|
+
}, [target, mounted]);
|
|
13206
|
+
}
|
|
13095
13207
|
function keyScopeOf(action) {
|
|
13096
13208
|
return action.keyScope ?? "surface";
|
|
13097
13209
|
}
|
|
13098
|
-
function matchesKey(e, spec) {
|
|
13099
|
-
const chord = parseChord(spec);
|
|
13210
|
+
function matchesKey(e, spec, mac) {
|
|
13211
|
+
const chord = parseChord(spec, mac);
|
|
13100
13212
|
if (!chord) return false;
|
|
13101
13213
|
const modHeld = e.metaKey || e.ctrlKey;
|
|
13102
|
-
|
|
13214
|
+
const held = { Mod: modHeld, Ctrl: e.ctrlKey && !e.metaKey };
|
|
13215
|
+
if (chord.modifier ? !held[chord.modifier] : modHeld || e.altKey) return false;
|
|
13103
13216
|
if (e.shiftKey !== chord.shift) return false;
|
|
13104
13217
|
return e.key.toLowerCase() === chord.key.toLowerCase();
|
|
13105
13218
|
}
|
|
13106
13219
|
function useActionKeys(actions, ctx, runner, envExtras) {
|
|
13107
|
-
(0,
|
|
13220
|
+
(0, import_react17.useEffect)(() => {
|
|
13108
13221
|
if (!ctx || !envExtras) return;
|
|
13109
13222
|
const activeCtx = ctx;
|
|
13110
13223
|
const activeEnvExtras = envExtras;
|
|
13111
13224
|
const targets = targetsByCtx.get(ctx) ?? {};
|
|
13112
13225
|
const target = {};
|
|
13226
|
+
const mac = isMacPlatform();
|
|
13113
13227
|
function bind(scope) {
|
|
13114
13228
|
const { handlesFormTargets } = KEY_SCOPE_RULES[scope];
|
|
13115
13229
|
const element = targets[scope];
|
|
@@ -13121,7 +13235,7 @@ function useActionKeys(actions, ctx, runner, envExtras) {
|
|
|
13121
13235
|
if (!handlesFormTargets && isFormTarget(e.target)) return;
|
|
13122
13236
|
for (const action of keyed) {
|
|
13123
13237
|
for (const spec of action.keys ?? []) {
|
|
13124
|
-
if (matchesKey(e, spec)) {
|
|
13238
|
+
if (matchesKey(e, spec, mac)) {
|
|
13125
13239
|
e.preventDefault();
|
|
13126
13240
|
e.stopPropagation();
|
|
13127
13241
|
void runner.run(action, activeCtx, target, activeEnvExtras);
|
|
@@ -13141,10 +13255,10 @@ function useActionKeys(actions, ctx, runner, envExtras) {
|
|
|
13141
13255
|
}
|
|
13142
13256
|
|
|
13143
13257
|
// src/hooks/useContextMenu.ts
|
|
13144
|
-
var
|
|
13258
|
+
var import_react18 = require("react");
|
|
13145
13259
|
function useContextMenu() {
|
|
13146
|
-
const [contextMenu, setContextMenu] = (0,
|
|
13147
|
-
const showContextMenu = (0,
|
|
13260
|
+
const [contextMenu, setContextMenu] = (0, import_react18.useState)(null);
|
|
13261
|
+
const showContextMenu = (0, import_react18.useCallback)((request) => {
|
|
13148
13262
|
setContextMenu({
|
|
13149
13263
|
x: request.x,
|
|
13150
13264
|
y: request.y,
|
|
@@ -13152,21 +13266,21 @@ function useContextMenu() {
|
|
|
13152
13266
|
groupId: request.groupId
|
|
13153
13267
|
});
|
|
13154
13268
|
}, []);
|
|
13155
|
-
const dismissContextMenu = (0,
|
|
13269
|
+
const dismissContextMenu = (0, import_react18.useCallback)(() => {
|
|
13156
13270
|
setContextMenu(null);
|
|
13157
13271
|
}, []);
|
|
13158
13272
|
return { contextMenu, showContextMenu, dismissContextMenu };
|
|
13159
13273
|
}
|
|
13160
13274
|
|
|
13161
13275
|
// src/hooks/useGroupLogic.ts
|
|
13162
|
-
var
|
|
13276
|
+
var import_react19 = require("react");
|
|
13163
13277
|
function drawnPosition(groups, node) {
|
|
13164
13278
|
const parent = node.parentId ? groups.find((g) => g.id === node.parentId) : void 0;
|
|
13165
13279
|
if (!parent) return node.position;
|
|
13166
13280
|
return { x: parent.position.x + node.position.x, y: parent.position.y + node.position.y };
|
|
13167
13281
|
}
|
|
13168
13282
|
function useGroupLogic(nodes, edges, groups, newNodeIds, decorations) {
|
|
13169
|
-
return (0,
|
|
13283
|
+
return (0, import_react19.useMemo)(() => {
|
|
13170
13284
|
const parentOf = /* @__PURE__ */ new Map();
|
|
13171
13285
|
for (const g of groups) {
|
|
13172
13286
|
for (const id of g.node_ids) parentOf.set(id, g);
|
|
@@ -13210,7 +13324,9 @@ function useGroupLogic(nodes, edges, groups, newNodeIds, decorations) {
|
|
|
13210
13324
|
collapsed: true,
|
|
13211
13325
|
hasErrors,
|
|
13212
13326
|
badges: groupBadges,
|
|
13213
|
-
interfacePins: pinsOf(group2)
|
|
13327
|
+
interfacePins: pinsOf(group2),
|
|
13328
|
+
callWired: !!group2.call_wired,
|
|
13329
|
+
metaWired: group2.meta_wired ?? []
|
|
13214
13330
|
}
|
|
13215
13331
|
});
|
|
13216
13332
|
} else {
|
|
@@ -13225,7 +13341,9 @@ function useGroupLogic(nodes, edges, groups, newNodeIds, decorations) {
|
|
|
13225
13341
|
collapsed: false,
|
|
13226
13342
|
hasErrors: hasErrorBadge(groupBadges),
|
|
13227
13343
|
badges: groupBadges,
|
|
13228
|
-
interfacePins:
|
|
13344
|
+
interfacePins: pinsOf(group2),
|
|
13345
|
+
callWired: !!group2.call_wired,
|
|
13346
|
+
metaWired: group2.meta_wired ?? []
|
|
13229
13347
|
}
|
|
13230
13348
|
});
|
|
13231
13349
|
}
|
|
@@ -13251,8 +13369,11 @@ function useGroupLogic(nodes, edges, groups, newNodeIds, decorations) {
|
|
|
13251
13369
|
}, [nodes, edges, groups, newNodeIds, decorations]);
|
|
13252
13370
|
}
|
|
13253
13371
|
function pinsOf(group2) {
|
|
13254
|
-
const pins = (side,
|
|
13255
|
-
return [
|
|
13372
|
+
const pins = (side, handleId, of = []) => of.map((pin) => ({ ...pin, handleId: handleId(pin.name), side, color: pinColor(pin) }));
|
|
13373
|
+
return [
|
|
13374
|
+
...pins("input", targetHandleId, group2.inputs),
|
|
13375
|
+
...pins("output", sourceHandleId, group2.outputs)
|
|
13376
|
+
];
|
|
13256
13377
|
}
|
|
13257
13378
|
function renderEdgeToRfEdge(e) {
|
|
13258
13379
|
return {
|
|
@@ -13260,20 +13381,20 @@ function renderEdgeToRfEdge(e) {
|
|
|
13260
13381
|
source: e.source,
|
|
13261
13382
|
target: e.target,
|
|
13262
13383
|
sourceHandle: sourceHandleId(e.source_output),
|
|
13263
|
-
targetHandle:
|
|
13384
|
+
targetHandle: targetHandleId(e.target_input),
|
|
13264
13385
|
data: { source_output: e.source_output, target_input: e.target_input },
|
|
13265
13386
|
type: DEPENDENCY_EDGE_TYPE
|
|
13266
13387
|
};
|
|
13267
13388
|
}
|
|
13268
13389
|
|
|
13269
13390
|
// src/hooks/useNewNodeTracking.ts
|
|
13270
|
-
var
|
|
13391
|
+
var import_react20 = require("react");
|
|
13271
13392
|
function useNewNodeTracking(view) {
|
|
13272
|
-
const [addedIds, setAddedIds] = (0,
|
|
13273
|
-
const [newNodeIds, setNewNodeIds] = (0,
|
|
13274
|
-
const prevCardIdsRef = (0,
|
|
13275
|
-
const sessionLoadedRef = (0,
|
|
13276
|
-
(0,
|
|
13393
|
+
const [addedIds, setAddedIds] = (0, import_react20.useState)(/* @__PURE__ */ new Set());
|
|
13394
|
+
const [newNodeIds, setNewNodeIds] = (0, import_react20.useState)(/* @__PURE__ */ new Set());
|
|
13395
|
+
const prevCardIdsRef = (0, import_react20.useRef)(/* @__PURE__ */ new Set());
|
|
13396
|
+
const sessionLoadedRef = (0, import_react20.useRef)(false);
|
|
13397
|
+
(0, import_react20.useEffect)(() => {
|
|
13277
13398
|
if (!view) return;
|
|
13278
13399
|
const nodeIds = new Set(view.nodes.map((n) => n.id));
|
|
13279
13400
|
const cardIds = /* @__PURE__ */ new Set([...nodeIds, ...view.groups.map((g) => g.id)]);
|
|
@@ -13294,7 +13415,7 @@ function useNewNodeTracking(view) {
|
|
|
13294
13415
|
setNewNodeIds(track(nodeIds));
|
|
13295
13416
|
prevCardIdsRef.current = cardIds;
|
|
13296
13417
|
}, [view]);
|
|
13297
|
-
const clearNew = (0,
|
|
13418
|
+
const clearNew = (0, import_react20.useCallback)((...ids) => {
|
|
13298
13419
|
setNewNodeIds((s) => {
|
|
13299
13420
|
const next = new Set(s);
|
|
13300
13421
|
let changed = false;
|
|
@@ -13309,8 +13430,8 @@ function useNewNodeTracking(view) {
|
|
|
13309
13430
|
|
|
13310
13431
|
// src/hooks/useViewport.ts
|
|
13311
13432
|
var import_proto9 = require("@lace-cloud/proto");
|
|
13312
|
-
var
|
|
13313
|
-
var
|
|
13433
|
+
var import_react21 = require("@xyflow/react");
|
|
13434
|
+
var import_react22 = require("react");
|
|
13314
13435
|
var FIT = { duration: 300, maxZoom: 1 };
|
|
13315
13436
|
var PAN_MS = 300;
|
|
13316
13437
|
var RESIZE_MS = 200;
|
|
@@ -13323,38 +13444,38 @@ function sightOf(pane) {
|
|
|
13323
13444
|
return { pane: { width: box.width, height: box.height }, visible: visibleArea(box, chrome) };
|
|
13324
13445
|
}
|
|
13325
13446
|
function useViewport(pane, focusIds) {
|
|
13326
|
-
const { fitView, getNode, getNodes, getNodesBounds, getViewport, setViewport } = (0,
|
|
13327
|
-
const headingRef = (0,
|
|
13328
|
-
const keptRevealRef = (0,
|
|
13329
|
-
const heading = (0,
|
|
13447
|
+
const { fitView, getNode, getNodes, getNodesBounds, getViewport, setViewport } = (0, import_react21.useReactFlow)();
|
|
13448
|
+
const headingRef = (0, import_react22.useRef)(null);
|
|
13449
|
+
const keptRevealRef = (0, import_react22.useRef)(null);
|
|
13450
|
+
const heading = (0, import_react22.useCallback)(() => {
|
|
13330
13451
|
const h = headingRef.current;
|
|
13331
13452
|
return h && performance.now() < h.until ? h : null;
|
|
13332
13453
|
}, []);
|
|
13333
|
-
const move = (0,
|
|
13454
|
+
const move = (0, import_react22.useCallback)(
|
|
13334
13455
|
(viewport, duration) => {
|
|
13335
13456
|
headingRef.current = { viewport, until: performance.now() + duration };
|
|
13336
13457
|
void setViewport(viewport, { duration });
|
|
13337
13458
|
},
|
|
13338
13459
|
[setViewport]
|
|
13339
13460
|
);
|
|
13340
|
-
const moved = (0,
|
|
13461
|
+
const moved = (0, import_react22.useCallback)(() => {
|
|
13341
13462
|
headingRef.current = null;
|
|
13342
13463
|
keptRevealRef.current = null;
|
|
13343
13464
|
}, []);
|
|
13344
|
-
const onMoveStart = (0,
|
|
13465
|
+
const onMoveStart = (0, import_react22.useCallback)(
|
|
13345
13466
|
(event) => {
|
|
13346
13467
|
if (event) moved();
|
|
13347
13468
|
},
|
|
13348
13469
|
[moved]
|
|
13349
13470
|
);
|
|
13350
|
-
const fit = (0,
|
|
13471
|
+
const fit = (0, import_react22.useCallback)(() => {
|
|
13351
13472
|
if (!pane) return;
|
|
13352
13473
|
headingRef.current = null;
|
|
13353
13474
|
keptRevealRef.current = null;
|
|
13354
13475
|
const { pane: size, visible } = sightOf(pane);
|
|
13355
13476
|
void fitView({ ...FIT, padding: fitPadding(size, visible) });
|
|
13356
13477
|
}, [pane, fitView]);
|
|
13357
|
-
const panIntoView = (0,
|
|
13478
|
+
const panIntoView = (0, import_react22.useCallback)(
|
|
13358
13479
|
(rect) => {
|
|
13359
13480
|
if (!pane) return;
|
|
13360
13481
|
const from = heading()?.viewport ?? getViewport();
|
|
@@ -13366,9 +13487,9 @@ function useViewport(pane, focusIds) {
|
|
|
13366
13487
|
},
|
|
13367
13488
|
[pane, heading, getViewport, move]
|
|
13368
13489
|
);
|
|
13369
|
-
const resized = (0,
|
|
13490
|
+
const resized = (0, import_react22.useRef)((_was, _after) => {
|
|
13370
13491
|
});
|
|
13371
|
-
(0,
|
|
13492
|
+
(0, import_react22.useLayoutEffect)(() => {
|
|
13372
13493
|
resized.current = (was, after) => {
|
|
13373
13494
|
const from = heading()?.viewport ?? getViewport();
|
|
13374
13495
|
const drawn = getNodes().filter((n) => !n.hidden);
|
|
@@ -13389,7 +13510,7 @@ function useViewport(pane, focusIds) {
|
|
|
13389
13510
|
else if (outcome.kind === "move") move(outcome.viewport, RESIZE_MS);
|
|
13390
13511
|
};
|
|
13391
13512
|
});
|
|
13392
|
-
(0,
|
|
13513
|
+
(0, import_react22.useEffect)(() => {
|
|
13393
13514
|
if (!pane || typeof ResizeObserver === "undefined") return;
|
|
13394
13515
|
let before = sightOf(pane).visible;
|
|
13395
13516
|
let judged = before;
|
|
@@ -13445,11 +13566,11 @@ function useViewport(pane, focusIds) {
|
|
|
13445
13566
|
window.removeEventListener("pointercancel", release, true);
|
|
13446
13567
|
};
|
|
13447
13568
|
}, [pane, moved]);
|
|
13448
|
-
return (0,
|
|
13569
|
+
return (0, import_react22.useMemo)(() => ({ fit, panIntoView, onMoveStart }), [fit, panIntoView, onMoveStart]);
|
|
13449
13570
|
}
|
|
13450
13571
|
|
|
13451
13572
|
// src/Canvas.tsx
|
|
13452
|
-
var
|
|
13573
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
13453
13574
|
var nodeTypes = {
|
|
13454
13575
|
moduleNode: ModuleNode_default,
|
|
13455
13576
|
groupNode: GroupNode_default
|
|
@@ -13478,28 +13599,28 @@ function CompositeEditor({
|
|
|
13478
13599
|
pane,
|
|
13479
13600
|
decorations
|
|
13480
13601
|
}) {
|
|
13481
|
-
const { getNode, getNodesBounds } = (0,
|
|
13602
|
+
const { getNode, getNodesBounds } = (0, import_react23.useReactFlow)();
|
|
13482
13603
|
const viewport = useViewport(pane, focusIds);
|
|
13483
|
-
const xyflowInitialized = (0,
|
|
13604
|
+
const xyflowInitialized = (0, import_react23.useNodesInitialized)();
|
|
13484
13605
|
const nodesInitialized = xyflowInitialized || view.nodes.length === 0;
|
|
13485
|
-
(0,
|
|
13606
|
+
(0, import_react24.useEffect)(() => {
|
|
13486
13607
|
registerGoToNode((nodeId) => {
|
|
13487
13608
|
if (!getNode(nodeId)) return;
|
|
13488
13609
|
viewport.panIntoView(getNodesBounds([nodeId]));
|
|
13489
13610
|
});
|
|
13490
13611
|
}, [registerGoToNode, getNode, getNodesBounds, viewport]);
|
|
13491
|
-
(0,
|
|
13612
|
+
(0, import_react24.useEffect)(() => {
|
|
13492
13613
|
layout.panIntoView = viewport.panIntoView;
|
|
13493
13614
|
}, [layout, viewport]);
|
|
13494
|
-
const firedRef = (0,
|
|
13495
|
-
(0,
|
|
13615
|
+
const firedRef = (0, import_react24.useRef)(false);
|
|
13616
|
+
(0, import_react24.useEffect)(() => {
|
|
13496
13617
|
if (firedRef.current || !pane || !nodesInitialized || view.nodes.length === 0) return;
|
|
13497
13618
|
firedRef.current = true;
|
|
13498
13619
|
requestAnimationFrame(viewport.fit);
|
|
13499
13620
|
}, [pane, nodesInitialized, view.nodes.length, viewport]);
|
|
13500
13621
|
const groupLogic = useGroupLogic(view.nodes, view.edges, view.groups, newNodeIds, decorations);
|
|
13501
|
-
const revealedRef = (0,
|
|
13502
|
-
(0,
|
|
13622
|
+
const revealedRef = (0, import_react24.useRef)(addedIds);
|
|
13623
|
+
(0, import_react24.useEffect)(() => {
|
|
13503
13624
|
if (editing) return;
|
|
13504
13625
|
const shown = [...addedIds].filter((id) => !revealedRef.current.has(id)).flatMap((id) => {
|
|
13505
13626
|
const node = groupLogic.rfNodes.find((n) => n.id === id);
|
|
@@ -13513,10 +13634,10 @@ function CompositeEditor({
|
|
|
13513
13634
|
viewport.panIntoView((0, import_proto10.extentOf)(shown.map((s) => s.rect)));
|
|
13514
13635
|
}, [editing, addedIds, groupLogic.rfNodes, view, viewport]);
|
|
13515
13636
|
const rfEdgesFromView = groupLogic.rfEdges;
|
|
13516
|
-
const selectedNodeIds = (0,
|
|
13517
|
-
const selectedEdgeIds = (0,
|
|
13518
|
-
const [rfEdges, setRfEdges] = (0,
|
|
13519
|
-
(0,
|
|
13637
|
+
const selectedNodeIds = (0, import_react24.useMemo)(() => new Set(selection.nodes), [selection.nodes]);
|
|
13638
|
+
const selectedEdgeIds = (0, import_react24.useMemo)(() => new Set(selection.edges), [selection.edges]);
|
|
13639
|
+
const [rfEdges, setRfEdges] = (0, import_react24.useState)(rfEdgesFromView);
|
|
13640
|
+
(0, import_react24.useEffect)(() => {
|
|
13520
13641
|
setRfEdges((prev) => {
|
|
13521
13642
|
const held = new Set(prev.filter((e) => e.selected).map((e) => e.id));
|
|
13522
13643
|
return rfEdgesFromView.map(
|
|
@@ -13524,16 +13645,16 @@ function CompositeEditor({
|
|
|
13524
13645
|
);
|
|
13525
13646
|
});
|
|
13526
13647
|
}, [rfEdgesFromView, selectedEdgeIds]);
|
|
13527
|
-
const onEdgesChange = (0,
|
|
13648
|
+
const onEdgesChange = (0, import_react24.useCallback)(
|
|
13528
13649
|
(changes) => {
|
|
13529
|
-
setRfEdges((prev) => (0,
|
|
13650
|
+
setRfEdges((prev) => (0, import_react23.applyEdgeChanges)(changes, prev));
|
|
13530
13651
|
onSelect("edges", changes);
|
|
13531
13652
|
},
|
|
13532
13653
|
[onSelect]
|
|
13533
13654
|
);
|
|
13534
13655
|
const rfNodesFromView = groupLogic.rfNodes;
|
|
13535
|
-
const [rfNodes, setRfNodes] = (0,
|
|
13536
|
-
(0,
|
|
13656
|
+
const [rfNodes, setRfNodes] = (0, import_react24.useState)(rfNodesFromView);
|
|
13657
|
+
(0, import_react24.useEffect)(() => {
|
|
13537
13658
|
setRfNodes((prev) => {
|
|
13538
13659
|
const current = new Map(prev.map((n) => [n.id, n]));
|
|
13539
13660
|
return rfNodesFromView.map((n) => {
|
|
@@ -13550,14 +13671,14 @@ function CompositeEditor({
|
|
|
13550
13671
|
});
|
|
13551
13672
|
});
|
|
13552
13673
|
}, [rfNodesFromView, selectedNodeIds]);
|
|
13553
|
-
const onNodesChange = (0,
|
|
13674
|
+
const onNodesChange = (0, import_react24.useCallback)(
|
|
13554
13675
|
(changes) => {
|
|
13555
|
-
setRfNodes((prev) => (0,
|
|
13676
|
+
setRfNodes((prev) => (0, import_react23.applyNodeChanges)(changes, prev));
|
|
13556
13677
|
onSelect("nodes", changes);
|
|
13557
13678
|
},
|
|
13558
13679
|
[onSelect]
|
|
13559
13680
|
);
|
|
13560
|
-
const onNodeDragStop = (0,
|
|
13681
|
+
const onNodeDragStop = (0, import_react24.useCallback)(
|
|
13561
13682
|
(_e, _draggedNode, draggedNodes) => {
|
|
13562
13683
|
const positions = {};
|
|
13563
13684
|
for (const n of draggedNodes) {
|
|
@@ -13571,8 +13692,8 @@ function CompositeEditor({
|
|
|
13571
13692
|
style: { stroke: "var(--lace-canvas-edge-stroke)", strokeWidth: 1.5 },
|
|
13572
13693
|
animated: false
|
|
13573
13694
|
};
|
|
13574
|
-
return /* @__PURE__ */ (0,
|
|
13575
|
-
|
|
13695
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
13696
|
+
import_react23.ReactFlow,
|
|
13576
13697
|
{
|
|
13577
13698
|
onInit,
|
|
13578
13699
|
nodes: rfNodes,
|
|
@@ -13611,9 +13732,9 @@ function CompositeEditor({
|
|
|
13611
13732
|
proOptions: { hideAttribution: true },
|
|
13612
13733
|
style: { background: "var(--lace-color-bg-canvas)" },
|
|
13613
13734
|
children: [
|
|
13614
|
-
/* @__PURE__ */ (0,
|
|
13615
|
-
/* @__PURE__ */ (0,
|
|
13616
|
-
nodesInitialized ? /* @__PURE__ */ (0,
|
|
13735
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(CanvasControls, { onFit: viewport.fit }),
|
|
13736
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(PaperGrid, {}),
|
|
13737
|
+
nodesInitialized ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { hidden: true, "data-rendered": "" }) : null
|
|
13617
13738
|
]
|
|
13618
13739
|
}
|
|
13619
13740
|
);
|
|
@@ -13634,7 +13755,7 @@ function Canvas({ height }) {
|
|
|
13634
13755
|
editing
|
|
13635
13756
|
} = useCanvas();
|
|
13636
13757
|
const editor = ctx.ports.editor;
|
|
13637
|
-
const makeEnvExtras = (0,
|
|
13758
|
+
const makeEnvExtras = (0, import_react24.useCallback)(
|
|
13638
13759
|
() => ({
|
|
13639
13760
|
bundle,
|
|
13640
13761
|
arrangement: { get: () => arrangement, update: updateArrangement },
|
|
@@ -13642,42 +13763,43 @@ function Canvas({ height }) {
|
|
|
13642
13763
|
}),
|
|
13643
13764
|
[bundle, arrangement, updateArrangement, layout]
|
|
13644
13765
|
);
|
|
13645
|
-
const focusIds = (0,
|
|
13766
|
+
const focusIds = (0, import_react24.useMemo)(() => {
|
|
13646
13767
|
const wires = new Set(selection.edges);
|
|
13647
13768
|
const ends = view.edges.filter((e) => wires.has(e.id)).flatMap((e) => [e.source, e.target]);
|
|
13648
13769
|
return [.../* @__PURE__ */ new Set([...selection.nodes, ...ends])];
|
|
13649
13770
|
}, [selection, view.edges]);
|
|
13650
13771
|
const { contextMenu, showContextMenu, dismissContextMenu } = useContextMenu();
|
|
13651
13772
|
const { addedIds, newNodeIds, clearNew } = useNewNodeTracking(view);
|
|
13652
|
-
(0,
|
|
13773
|
+
(0, import_react24.useEffect)(() => {
|
|
13653
13774
|
clearNew(...selection.nodes);
|
|
13654
13775
|
}, [selection.nodes, clearNew]);
|
|
13655
|
-
const [pane, setPane] = (0,
|
|
13656
|
-
const surfaceRef = (0,
|
|
13657
|
-
(0,
|
|
13776
|
+
const [pane, setPane] = (0, import_react24.useState)(null);
|
|
13777
|
+
const surfaceRef = (0, import_react24.useRef)(null);
|
|
13778
|
+
(0, import_react24.useEffect)(() => {
|
|
13658
13779
|
registerKeyTarget(ctx, "surface", surfaceRef.current);
|
|
13659
13780
|
return () => registerKeyTarget(ctx, "surface", null);
|
|
13660
13781
|
}, [ctx]);
|
|
13661
|
-
const onSurfacePointerDown = (0,
|
|
13782
|
+
const onSurfacePointerDown = (0, import_react24.useCallback)((e) => {
|
|
13662
13783
|
if (isFormTarget(e.target)) return;
|
|
13663
13784
|
surfaceRef.current?.focus();
|
|
13664
13785
|
}, []);
|
|
13665
|
-
|
|
13666
|
-
const
|
|
13786
|
+
useFocusKeptOnRemoval(surfaceRef, true);
|
|
13787
|
+
const goToNodeRef = (0, import_react24.useRef)(null);
|
|
13788
|
+
const registerGoToNode = (0, import_react24.useCallback)((fn) => {
|
|
13667
13789
|
goToNodeRef.current = fn;
|
|
13668
13790
|
}, []);
|
|
13669
|
-
const reported = (0,
|
|
13670
|
-
(0,
|
|
13791
|
+
const reported = (0, import_react24.useRef)(selection);
|
|
13792
|
+
(0, import_react24.useLayoutEffect)(() => {
|
|
13671
13793
|
reported.current = selection;
|
|
13672
13794
|
}, [selection]);
|
|
13673
|
-
const selectNow = (0,
|
|
13795
|
+
const selectNow = (0, import_react24.useCallback)(
|
|
13674
13796
|
(next) => {
|
|
13675
13797
|
reported.current = next;
|
|
13676
13798
|
setSelection(next);
|
|
13677
13799
|
},
|
|
13678
13800
|
[setSelection]
|
|
13679
13801
|
);
|
|
13680
|
-
const onSelect = (0,
|
|
13802
|
+
const onSelect = (0, import_react24.useCallback)(
|
|
13681
13803
|
(side, changes) => {
|
|
13682
13804
|
const was = reported.current[side];
|
|
13683
13805
|
const held = new Set(was);
|
|
@@ -13693,14 +13815,14 @@ function Canvas({ height }) {
|
|
|
13693
13815
|
},
|
|
13694
13816
|
[selectNow]
|
|
13695
13817
|
);
|
|
13696
|
-
const onOpenNodeConfig = (0,
|
|
13818
|
+
const onOpenNodeConfig = (0, import_react24.useCallback)(
|
|
13697
13819
|
(instanceId) => {
|
|
13698
13820
|
selectNow({ nodes: [instanceId], edges: [] });
|
|
13699
13821
|
goToNodeRef.current?.(instanceId);
|
|
13700
13822
|
},
|
|
13701
13823
|
[selectNow]
|
|
13702
13824
|
);
|
|
13703
|
-
const onDragStop = (0,
|
|
13825
|
+
const onDragStop = (0, import_react24.useCallback)(
|
|
13704
13826
|
(positions) => {
|
|
13705
13827
|
const pinned = Object.keys(positions).reduce(
|
|
13706
13828
|
(next, id) => withScopesPinned(bundle, view, next, id),
|
|
@@ -13710,7 +13832,7 @@ function Canvas({ height }) {
|
|
|
13710
13832
|
},
|
|
13711
13833
|
[bundle, view, arrangement, updateArrangement]
|
|
13712
13834
|
);
|
|
13713
|
-
const onConnect = (0,
|
|
13835
|
+
const onConnect = (0, import_react24.useCallback)(
|
|
13714
13836
|
async (conn) => {
|
|
13715
13837
|
if (!conn.source || !conn.target || !editor) return;
|
|
13716
13838
|
const source = (0, import_proto10.instanceAddress)(bundle, conn.source);
|
|
@@ -13732,16 +13854,16 @@ function Canvas({ height }) {
|
|
|
13732
13854
|
},
|
|
13733
13855
|
[editor, runner, bundle]
|
|
13734
13856
|
);
|
|
13735
|
-
const menuTarget = (0,
|
|
13857
|
+
const menuTarget = (0, import_react24.useMemo)(() => {
|
|
13736
13858
|
if (!contextMenu) return NO_ENV_EXTRAS_TARGET;
|
|
13737
13859
|
if (contextMenu.groupId) return groupTarget(contextMenu.groupId);
|
|
13738
13860
|
return { nodeId: contextMenu.nodeId ?? void 0 };
|
|
13739
13861
|
}, [contextMenu]);
|
|
13740
|
-
const menuCtx = (0,
|
|
13862
|
+
const menuCtx = (0, import_react24.useMemo)(
|
|
13741
13863
|
() => menuContext(ctx, menuTarget.nodeId ?? null),
|
|
13742
13864
|
[ctx, menuTarget.nodeId]
|
|
13743
13865
|
);
|
|
13744
|
-
const menuActions = (0,
|
|
13866
|
+
const menuActions = (0, import_react24.useMemo)(() => {
|
|
13745
13867
|
if (!contextMenu) return [];
|
|
13746
13868
|
const placement = menuTarget.nodeId === void 0 ? "pane-menu" : "node-menu";
|
|
13747
13869
|
return resolveContributions(
|
|
@@ -13751,17 +13873,17 @@ function Canvas({ height }) {
|
|
|
13751
13873
|
menuTarget
|
|
13752
13874
|
).actions.filter((a) => a.placement === placement);
|
|
13753
13875
|
}, [contextMenu, menuCtx, menuTarget]);
|
|
13754
|
-
const menuReason = (0,
|
|
13876
|
+
const menuReason = (0, import_react24.useCallback)(
|
|
13755
13877
|
(action) => disabledReason(action, menuCtx, runner.busy(action, menuCtx, menuTarget)),
|
|
13756
13878
|
[runner, menuCtx, menuTarget]
|
|
13757
13879
|
);
|
|
13758
|
-
const runMenuAction = (0,
|
|
13880
|
+
const runMenuAction = (0, import_react24.useCallback)(
|
|
13759
13881
|
(action) => {
|
|
13760
13882
|
void runner.run(action, menuCtx, menuTarget, makeEnvExtras());
|
|
13761
13883
|
},
|
|
13762
13884
|
[runner, menuCtx, menuTarget, makeEnvExtras]
|
|
13763
13885
|
);
|
|
13764
|
-
return /* @__PURE__ */ (0,
|
|
13886
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(NodeConfigBusProvider, { onOpen: onOpenNodeConfig, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
13765
13887
|
"div",
|
|
13766
13888
|
{
|
|
13767
13889
|
ref: surfaceRef,
|
|
@@ -13776,7 +13898,7 @@ function Canvas({ height }) {
|
|
|
13776
13898
|
outline: "none"
|
|
13777
13899
|
},
|
|
13778
13900
|
children: [
|
|
13779
|
-
/* @__PURE__ */ (0,
|
|
13901
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
13780
13902
|
ContextMenu,
|
|
13781
13903
|
{
|
|
13782
13904
|
contextMenu,
|
|
@@ -13786,8 +13908,8 @@ function Canvas({ height }) {
|
|
|
13786
13908
|
onDismiss: dismissContextMenu
|
|
13787
13909
|
}
|
|
13788
13910
|
),
|
|
13789
|
-
/* @__PURE__ */ (0,
|
|
13790
|
-
/* @__PURE__ */ (0,
|
|
13911
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { ref: setPane, style: { position: "relative", flex: "1 1 auto", minHeight: 0 }, children: [
|
|
13912
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
13791
13913
|
CompositeEditor,
|
|
13792
13914
|
{
|
|
13793
13915
|
view,
|
|
@@ -13809,7 +13931,7 @@ function Canvas({ height }) {
|
|
|
13809
13931
|
decorations
|
|
13810
13932
|
}
|
|
13811
13933
|
),
|
|
13812
|
-
view.nodes.length === 0 && view.groups.length === 0 ? /* @__PURE__ */ (0,
|
|
13934
|
+
view.nodes.length === 0 && view.groups.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(EmptyCanvas, { editable }) : null
|
|
13813
13935
|
] })
|
|
13814
13936
|
]
|
|
13815
13937
|
}
|
|
@@ -13817,7 +13939,7 @@ function Canvas({ height }) {
|
|
|
13817
13939
|
}
|
|
13818
13940
|
|
|
13819
13941
|
// src/components/Drawer.tsx
|
|
13820
|
-
var
|
|
13942
|
+
var import_react25 = require("react");
|
|
13821
13943
|
|
|
13822
13944
|
// src/utils/style-vars.ts
|
|
13823
13945
|
function readTokenPx(el, name) {
|
|
@@ -13826,7 +13948,7 @@ function readTokenPx(el, name) {
|
|
|
13826
13948
|
|
|
13827
13949
|
// src/components/Drawer.tsx
|
|
13828
13950
|
var import_Drawer = require("./Drawer-34ZYTEWE.css");
|
|
13829
|
-
var
|
|
13951
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
13830
13952
|
var KEY_STEP = 16;
|
|
13831
13953
|
function readDrawerBounds(el) {
|
|
13832
13954
|
const min = readTokenPx(el, "--lace-size-drawer-min");
|
|
@@ -13838,30 +13960,30 @@ function clampWidth(width, bounds) {
|
|
|
13838
13960
|
return Math.min(bounds.max, Math.max(bounds.min, width));
|
|
13839
13961
|
}
|
|
13840
13962
|
function Drawer({ label, children }) {
|
|
13841
|
-
const ref = (0,
|
|
13842
|
-
const [bounds, setBounds] = (0,
|
|
13843
|
-
const [width, setWidth] = (0,
|
|
13844
|
-
const [measured, setMeasured] = (0,
|
|
13845
|
-
const drag = (0,
|
|
13846
|
-
(0,
|
|
13963
|
+
const ref = (0, import_react25.useRef)(null);
|
|
13964
|
+
const [bounds, setBounds] = (0, import_react25.useState)(null);
|
|
13965
|
+
const [width, setWidth] = (0, import_react25.useState)(null);
|
|
13966
|
+
const [measured, setMeasured] = (0, import_react25.useState)(0);
|
|
13967
|
+
const drag = (0, import_react25.useRef)(null);
|
|
13968
|
+
(0, import_react25.useLayoutEffect)(() => {
|
|
13847
13969
|
if (ref.current) setBounds(readDrawerBounds(ref.current));
|
|
13848
13970
|
}, []);
|
|
13849
|
-
(0,
|
|
13971
|
+
(0, import_react25.useLayoutEffect)(() => {
|
|
13850
13972
|
if (ref.current) setMeasured(Math.round(ref.current.getBoundingClientRect().width));
|
|
13851
13973
|
}, [width]);
|
|
13852
|
-
const onPointerDown = (0,
|
|
13974
|
+
const onPointerDown = (0, import_react25.useCallback)((e) => {
|
|
13853
13975
|
e.preventDefault();
|
|
13854
13976
|
e.currentTarget.setPointerCapture(e.pointerId);
|
|
13855
13977
|
drag.current = { x: e.clientX, width: ref.current?.getBoundingClientRect().width ?? 0 };
|
|
13856
13978
|
}, []);
|
|
13857
|
-
const onPointerMove = (0,
|
|
13979
|
+
const onPointerMove = (0, import_react25.useCallback)(
|
|
13858
13980
|
(e) => {
|
|
13859
13981
|
if (!drag.current) return;
|
|
13860
13982
|
setWidth(clampWidth(drag.current.width + drag.current.x - e.clientX, bounds));
|
|
13861
13983
|
},
|
|
13862
13984
|
[bounds]
|
|
13863
13985
|
);
|
|
13864
|
-
const onPointerUp = (0,
|
|
13986
|
+
const onPointerUp = (0, import_react25.useCallback)((e) => {
|
|
13865
13987
|
drag.current = null;
|
|
13866
13988
|
e.currentTarget.releasePointerCapture(e.pointerId);
|
|
13867
13989
|
}, []);
|
|
@@ -13872,8 +13994,8 @@ function Drawer({ label, children }) {
|
|
|
13872
13994
|
setWidth(clampWidth(next, bounds));
|
|
13873
13995
|
};
|
|
13874
13996
|
const style = width === null ? void 0 : { "--drawer-width": `${width}px` };
|
|
13875
|
-
return /* @__PURE__ */ (0,
|
|
13876
|
-
/* @__PURE__ */ (0,
|
|
13997
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("aside", { ref, className: "lace-app__drawer", "aria-label": label, style, children: [
|
|
13998
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
13877
13999
|
"div",
|
|
13878
14000
|
{
|
|
13879
14001
|
className: "lace-app__drawer-handle",
|
|
@@ -13890,19 +14012,19 @@ function Drawer({ label, children }) {
|
|
|
13890
14012
|
onKeyDown
|
|
13891
14013
|
}
|
|
13892
14014
|
),
|
|
13893
|
-
/* @__PURE__ */ (0,
|
|
14015
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "lace-app__drawer-body", children })
|
|
13894
14016
|
] });
|
|
13895
14017
|
}
|
|
13896
14018
|
|
|
13897
14019
|
// src/components/ErrorBoundary.tsx
|
|
13898
|
-
var
|
|
14020
|
+
var import_react26 = __toESM(require("react"));
|
|
13899
14021
|
var import_ErrorBoundary = require("./ErrorBoundary-IXSIVZFH.css");
|
|
13900
|
-
var
|
|
14022
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
13901
14023
|
function ErrorState({ message }) {
|
|
13902
|
-
return /* @__PURE__ */ (0,
|
|
13903
|
-
/* @__PURE__ */ (0,
|
|
13904
|
-
/* @__PURE__ */ (0,
|
|
13905
|
-
/* @__PURE__ */ (0,
|
|
14024
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "lace-error-state", role: "alert", children: [
|
|
14025
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("h3", { className: "lace-error-state__title", children: "Something went wrong" }),
|
|
14026
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("pre", { className: "lace-error-state__message", children: message }),
|
|
14027
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
13906
14028
|
"button",
|
|
13907
14029
|
{
|
|
13908
14030
|
type: "button",
|
|
@@ -13913,7 +14035,7 @@ function ErrorState({ message }) {
|
|
|
13913
14035
|
)
|
|
13914
14036
|
] });
|
|
13915
14037
|
}
|
|
13916
|
-
var ErrorBoundary = class extends
|
|
14038
|
+
var ErrorBoundary = class extends import_react26.default.Component {
|
|
13917
14039
|
constructor() {
|
|
13918
14040
|
super(...arguments);
|
|
13919
14041
|
this.state = { error: null };
|
|
@@ -13923,7 +14045,7 @@ var ErrorBoundary = class extends import_react24.default.Component {
|
|
|
13923
14045
|
}
|
|
13924
14046
|
render() {
|
|
13925
14047
|
if (this.state.error) {
|
|
13926
|
-
return /* @__PURE__ */ (0,
|
|
14048
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ErrorState, { message: this.state.error.message });
|
|
13927
14049
|
}
|
|
13928
14050
|
return this.props.children;
|
|
13929
14051
|
}
|
|
@@ -13932,23 +14054,23 @@ var ErrorBoundary = class extends import_react24.default.Component {
|
|
|
13932
14054
|
// src/components/ToolbarAction.tsx
|
|
13933
14055
|
var import_ui6 = require("@lace-cloud/ui");
|
|
13934
14056
|
var import_ToolbarAction = require("./ToolbarAction-PQNWHJSU.css");
|
|
13935
|
-
var
|
|
14057
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
13936
14058
|
var TIP = "bottom-start";
|
|
13937
14059
|
function actionTip(keys, reason) {
|
|
13938
14060
|
const chord = keys?.[0] ? formatChord(keys[0], isMacPlatform()) : void 0;
|
|
13939
14061
|
if (!chord && !reason) return void 0;
|
|
13940
|
-
return /* @__PURE__ */ (0,
|
|
13941
|
-
chord ? /* @__PURE__ */ (0,
|
|
13942
|
-
reason ? /* @__PURE__ */ (0,
|
|
14062
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { className: "lace-action-tip", children: [
|
|
14063
|
+
chord ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("kbd", { className: "lace-action-tip__key", children: chord }) : null,
|
|
14064
|
+
reason ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "lace-action-tip__reason", children: reason }) : null
|
|
13943
14065
|
] });
|
|
13944
14066
|
}
|
|
13945
14067
|
function ToolbarAction({ action, disabledReason: disabledReason2, emphasized, busyLabel, onRun }) {
|
|
13946
14068
|
const busy = busyLabel !== void 0;
|
|
13947
14069
|
const inert = isInert({ disabledReason: disabledReason2, busyLabel });
|
|
13948
14070
|
const tooltip = actionTip(action.keys, disabledReason2);
|
|
13949
|
-
const glyph = action.icon ? /* @__PURE__ */ (0,
|
|
14071
|
+
const glyph = action.icon ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(CanvasIcon, { name: action.icon }) : void 0;
|
|
13950
14072
|
if (action.primary) {
|
|
13951
|
-
return /* @__PURE__ */ (0,
|
|
14073
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
13952
14074
|
import_ui6.Button,
|
|
13953
14075
|
{
|
|
13954
14076
|
rung: true,
|
|
@@ -13967,10 +14089,10 @@ function ToolbarAction({ action, disabledReason: disabledReason2, emphasized, bu
|
|
|
13967
14089
|
);
|
|
13968
14090
|
}
|
|
13969
14091
|
if (glyph) {
|
|
13970
|
-
return /* @__PURE__ */ (0,
|
|
14092
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
13971
14093
|
import_ui6.IconButton,
|
|
13972
14094
|
{
|
|
13973
|
-
icon: busy ? /* @__PURE__ */ (0,
|
|
14095
|
+
icon: busy ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_ui6.Spinner, { size: 14, "aria-hidden": "true" }) : glyph,
|
|
13974
14096
|
"aria-label": action.label,
|
|
13975
14097
|
size: "md",
|
|
13976
14098
|
"aria-disabled": inert,
|
|
@@ -13980,7 +14102,7 @@ function ToolbarAction({ action, disabledReason: disabledReason2, emphasized, bu
|
|
|
13980
14102
|
}
|
|
13981
14103
|
);
|
|
13982
14104
|
}
|
|
13983
|
-
return /* @__PURE__ */ (0,
|
|
14105
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
13984
14106
|
import_ui6.Button,
|
|
13985
14107
|
{
|
|
13986
14108
|
rung: true,
|
|
@@ -13999,7 +14121,7 @@ function ToolbarAction({ action, disabledReason: disabledReason2, emphasized, bu
|
|
|
13999
14121
|
}
|
|
14000
14122
|
|
|
14001
14123
|
// src/core/CommandArgsForm.tsx
|
|
14002
|
-
var
|
|
14124
|
+
var import_react27 = require("react");
|
|
14003
14125
|
|
|
14004
14126
|
// scripts/command-tree.mjs
|
|
14005
14127
|
var EFFECTS = /* @__PURE__ */ new Map([
|
|
@@ -15281,6 +15403,9 @@ var COMMANDS = {
|
|
|
15281
15403
|
],
|
|
15282
15404
|
"short": "o"
|
|
15283
15405
|
},
|
|
15406
|
+
"source": {
|
|
15407
|
+
"type": "string"
|
|
15408
|
+
},
|
|
15284
15409
|
"sourcePath": {
|
|
15285
15410
|
"type": "string"
|
|
15286
15411
|
},
|
|
@@ -15476,6 +15601,9 @@ function completeArgs(path, partial) {
|
|
|
15476
15601
|
|
|
15477
15602
|
// src/contracts/schemas.ts
|
|
15478
15603
|
var import_zod = require("zod");
|
|
15604
|
+
function reads() {
|
|
15605
|
+
return (schema) => schema;
|
|
15606
|
+
}
|
|
15479
15607
|
var REASON_PREFIX = "REASON_";
|
|
15480
15608
|
function reasonWire(reason) {
|
|
15481
15609
|
return reasonToJSON(reason).slice(REASON_PREFIX.length).toLowerCase();
|
|
@@ -15524,10 +15652,11 @@ var commandDiagnosticSchema = import_zod.z.object({
|
|
|
15524
15652
|
line: import_zod.z.number().optional(),
|
|
15525
15653
|
column: import_zod.z.number().optional()
|
|
15526
15654
|
});
|
|
15655
|
+
var VERDICTS = ["already-lace-style", "convertible", "uncomposable", "lossy"];
|
|
15527
15656
|
var moduleValidateResultSchema = import_zod.z.object({
|
|
15528
15657
|
root: import_zod.z.string().min(1).optional(),
|
|
15529
15658
|
treeHash: import_zod.z.string().min(1).optional(),
|
|
15530
|
-
verdict: import_zod.z.enum(
|
|
15659
|
+
verdict: import_zod.z.enum(VERDICTS).optional(),
|
|
15531
15660
|
residuals: import_zod.z.array(
|
|
15532
15661
|
import_zod.z.object({
|
|
15533
15662
|
construct: import_zod.z.string(),
|
|
@@ -15661,7 +15790,7 @@ var registryDescribeSchema = import_zod.z.object({
|
|
|
15661
15790
|
version: import_zod.z.string(),
|
|
15662
15791
|
source: import_zod.z.string(),
|
|
15663
15792
|
treeHash: import_zod.z.string(),
|
|
15664
|
-
verdict: import_zod.z.
|
|
15793
|
+
verdict: import_zod.z.enum(VERDICTS),
|
|
15665
15794
|
interface: import_zod.z.object({
|
|
15666
15795
|
inputs: import_zod.z.array(
|
|
15667
15796
|
import_zod.z.object({
|
|
@@ -15685,39 +15814,41 @@ var stackSourceSchema = import_zod.z.object({
|
|
|
15685
15814
|
ref: import_zod.z.string().optional(),
|
|
15686
15815
|
path: import_zod.z.string().optional()
|
|
15687
15816
|
});
|
|
15688
|
-
var stackSchema =
|
|
15689
|
-
|
|
15690
|
-
|
|
15691
|
-
|
|
15692
|
-
|
|
15693
|
-
|
|
15694
|
-
|
|
15695
|
-
|
|
15696
|
-
|
|
15697
|
-
|
|
15698
|
-
|
|
15699
|
-
|
|
15700
|
-
|
|
15701
|
-
|
|
15702
|
-
|
|
15703
|
-
|
|
15704
|
-
|
|
15705
|
-
|
|
15706
|
-
|
|
15707
|
-
|
|
15708
|
-
|
|
15709
|
-
|
|
15710
|
-
|
|
15711
|
-
|
|
15712
|
-
|
|
15713
|
-
|
|
15714
|
-
|
|
15715
|
-
|
|
15716
|
-
|
|
15717
|
-
|
|
15718
|
-
|
|
15719
|
-
|
|
15720
|
-
})
|
|
15817
|
+
var stackSchema = reads()(
|
|
15818
|
+
import_zod.z.object({
|
|
15819
|
+
id: import_zod.z.string(),
|
|
15820
|
+
orgId: import_zod.z.string(),
|
|
15821
|
+
teamId: import_zod.z.string(),
|
|
15822
|
+
connectionId: import_zod.z.string(),
|
|
15823
|
+
slug: import_zod.z.string(),
|
|
15824
|
+
name: import_zod.z.string(),
|
|
15825
|
+
description: import_zod.z.string().nullable(),
|
|
15826
|
+
source: stackSourceSchema.nullable(),
|
|
15827
|
+
stateSerial: import_zod.z.number(),
|
|
15828
|
+
stateLineage: import_zod.z.string().nullable(),
|
|
15829
|
+
stateVersion: import_zod.z.number().nullable(),
|
|
15830
|
+
stateLastWrittenAt: import_zod.z.string().nullable(),
|
|
15831
|
+
lastAppliedRunId: import_zod.z.string().nullable(),
|
|
15832
|
+
lastDriftScanAt: import_zod.z.string().nullable(),
|
|
15833
|
+
lastDriftStatus: import_zod.z.string().nullable(),
|
|
15834
|
+
lastDriftCount: import_zod.z.number(),
|
|
15835
|
+
lastDriftStale: import_zod.z.boolean(),
|
|
15836
|
+
lastDriftConfirmedAt: import_zod.z.string().nullable(),
|
|
15837
|
+
lastDriftUndeterminedReason: import_zod.z.string().nullable(),
|
|
15838
|
+
createdBy: import_zod.z.string(),
|
|
15839
|
+
createdAt: import_zod.z.string(),
|
|
15840
|
+
updatedAt: import_zod.z.string(),
|
|
15841
|
+
archivedAt: import_zod.z.string().nullable(),
|
|
15842
|
+
connection: import_zod.z.object({ name: import_zod.z.string(), provider: import_zod.z.string(), awsAccountId: import_zod.z.string().nullable() }).nullable(),
|
|
15843
|
+
createdByName: import_zod.z.string().nullable(),
|
|
15844
|
+
lastApply: import_zod.z.object({
|
|
15845
|
+
runId: import_zod.z.string(),
|
|
15846
|
+
bundleSnapshotId: import_zod.z.string(),
|
|
15847
|
+
completedAt: import_zod.z.string().nullable(),
|
|
15848
|
+
initiatedByName: import_zod.z.string().nullable()
|
|
15849
|
+
}).nullable()
|
|
15850
|
+
})
|
|
15851
|
+
);
|
|
15721
15852
|
var stackListSchema = import_zod.z.object({
|
|
15722
15853
|
items: import_zod.z.array(stackSchema),
|
|
15723
15854
|
nextCursor: import_zod.z.string().nullable(),
|
|
@@ -15730,29 +15861,39 @@ var driftedResourceSchema = import_zod.z.object({
|
|
|
15730
15861
|
details: import_zod.z.string().optional(),
|
|
15731
15862
|
goldenAttributes: import_zod.z.record(import_zod.z.string(), import_zod.z.unknown()),
|
|
15732
15863
|
liveProperties: import_zod.z.record(import_zod.z.string(), import_zod.z.unknown()),
|
|
15733
|
-
diff: import_zod.z.array(
|
|
15864
|
+
diff: import_zod.z.array(
|
|
15865
|
+
import_zod.z.object({
|
|
15866
|
+
path: import_zod.z.string(),
|
|
15867
|
+
declared: import_zod.z.unknown().optional(),
|
|
15868
|
+
detected: import_zod.z.unknown().optional()
|
|
15869
|
+
})
|
|
15870
|
+
),
|
|
15734
15871
|
findingId: import_zod.z.string().nullable()
|
|
15735
15872
|
});
|
|
15736
|
-
var driftSchema =
|
|
15737
|
-
|
|
15738
|
-
|
|
15739
|
-
|
|
15740
|
-
|
|
15741
|
-
|
|
15742
|
-
|
|
15743
|
-
|
|
15744
|
-
|
|
15745
|
-
|
|
15746
|
-
|
|
15747
|
-
|
|
15748
|
-
|
|
15749
|
-
|
|
15750
|
-
|
|
15751
|
-
|
|
15752
|
-
|
|
15753
|
-
|
|
15754
|
-
|
|
15755
|
-
})
|
|
15873
|
+
var driftSchema = reads()(
|
|
15874
|
+
import_zod.z.object({
|
|
15875
|
+
stackId: import_zod.z.string(),
|
|
15876
|
+
scannedAt: import_zod.z.string(),
|
|
15877
|
+
driftStatus: import_zod.z.literal("DRIFTED"),
|
|
15878
|
+
totalResources: import_zod.z.number(),
|
|
15879
|
+
stateSerial: import_zod.z.number(),
|
|
15880
|
+
driftedResources: import_zod.z.array(driftedResourceSchema)
|
|
15881
|
+
}).nullable()
|
|
15882
|
+
);
|
|
15883
|
+
var stackDescribeSchema = reads()(
|
|
15884
|
+
import_zod.z.object({
|
|
15885
|
+
stack: stackSchema.nullable(),
|
|
15886
|
+
state: import_zod.z.object({
|
|
15887
|
+
serial: import_zod.z.number(),
|
|
15888
|
+
lineage: import_zod.z.string(),
|
|
15889
|
+
terraformVersion: import_zod.z.string(),
|
|
15890
|
+
resourceCount: import_zod.z.number(),
|
|
15891
|
+
resourcesByType: import_zod.z.record(import_zod.z.string(), import_zod.z.number()),
|
|
15892
|
+
resources: import_zod.z.array(import_zod.z.object({ address: import_zod.z.string(), type: import_zod.z.string() }))
|
|
15893
|
+
}).nullable(),
|
|
15894
|
+
drift: driftSchema
|
|
15895
|
+
})
|
|
15896
|
+
);
|
|
15756
15897
|
var policySummarySchema = import_zod.z.object({
|
|
15757
15898
|
policyId: import_zod.z.string(),
|
|
15758
15899
|
name: import_zod.z.string(),
|
|
@@ -15760,77 +15901,81 @@ var policySummarySchema = import_zod.z.object({
|
|
|
15760
15901
|
approvalMode: import_zod.z.string().nullable(),
|
|
15761
15902
|
ruleIds: import_zod.z.array(import_zod.z.string())
|
|
15762
15903
|
});
|
|
15763
|
-
var policyListSchema =
|
|
15764
|
-
|
|
15765
|
-
|
|
15766
|
-
|
|
15767
|
-
|
|
15768
|
-
|
|
15769
|
-
|
|
15770
|
-
|
|
15771
|
-
|
|
15772
|
-
|
|
15773
|
-
|
|
15774
|
-
|
|
15775
|
-
|
|
15776
|
-
|
|
15777
|
-
|
|
15778
|
-
|
|
15779
|
-
|
|
15780
|
-
|
|
15781
|
-
|
|
15782
|
-
|
|
15783
|
-
|
|
15784
|
-
|
|
15785
|
-
|
|
15786
|
-
|
|
15787
|
-
|
|
15788
|
-
|
|
15789
|
-
|
|
15790
|
-
|
|
15791
|
-
|
|
15792
|
-
|
|
15793
|
-
|
|
15794
|
-
|
|
15795
|
-
|
|
15796
|
-
|
|
15797
|
-
|
|
15798
|
-
|
|
15799
|
-
|
|
15800
|
-
|
|
15801
|
-
|
|
15802
|
-
|
|
15803
|
-
|
|
15804
|
-
|
|
15805
|
-
|
|
15806
|
-
|
|
15807
|
-
|
|
15808
|
-
|
|
15809
|
-
|
|
15810
|
-
|
|
15811
|
-
|
|
15812
|
-
|
|
15813
|
-
|
|
15814
|
-
|
|
15815
|
-
|
|
15816
|
-
|
|
15817
|
-
|
|
15818
|
-
|
|
15819
|
-
|
|
15820
|
-
|
|
15821
|
-
|
|
15822
|
-
|
|
15823
|
-
|
|
15824
|
-
|
|
15825
|
-
|
|
15826
|
-
|
|
15827
|
-
|
|
15828
|
-
|
|
15829
|
-
|
|
15830
|
-
|
|
15831
|
-
|
|
15832
|
-
|
|
15833
|
-
|
|
15904
|
+
var policyListSchema = reads()(
|
|
15905
|
+
import_zod.z.object({
|
|
15906
|
+
stack: import_zod.z.string().nullable(),
|
|
15907
|
+
policies: import_zod.z.array(policySummarySchema)
|
|
15908
|
+
})
|
|
15909
|
+
);
|
|
15910
|
+
var runSchema = reads()(
|
|
15911
|
+
import_zod.z.object({
|
|
15912
|
+
id: import_zod.z.string(),
|
|
15913
|
+
stackId: import_zod.z.string(),
|
|
15914
|
+
orgId: import_zod.z.string(),
|
|
15915
|
+
teamId: import_zod.z.string(),
|
|
15916
|
+
kind: import_zod.z.string(),
|
|
15917
|
+
status: import_zod.z.string(),
|
|
15918
|
+
initiatedByUserId: import_zod.z.string().nullable(),
|
|
15919
|
+
initiatedVia: import_zod.z.string(),
|
|
15920
|
+
runnerIdentity: import_zod.z.string().nullable(),
|
|
15921
|
+
runnerLocation: import_zod.z.string().nullable(),
|
|
15922
|
+
bundleSnapshotId: import_zod.z.string().nullable(),
|
|
15923
|
+
sourceCommitSha: import_zod.z.string().nullable(),
|
|
15924
|
+
sourceRef: import_zod.z.string().nullable(),
|
|
15925
|
+
sourcePrUrl: import_zod.z.string().nullable(),
|
|
15926
|
+
sourceOverride: import_zod.z.boolean(),
|
|
15927
|
+
planResourceAdd: import_zod.z.number().nullable(),
|
|
15928
|
+
planResourceChange: import_zod.z.number().nullable(),
|
|
15929
|
+
planResourceDestroy: import_zod.z.number().nullable(),
|
|
15930
|
+
planLocation: import_zod.z.string().nullable(),
|
|
15931
|
+
planHumanLocation: import_zod.z.string().nullable(),
|
|
15932
|
+
applyLogLocation: import_zod.z.string().nullable(),
|
|
15933
|
+
policyResultsLocation: import_zod.z.string().nullable(),
|
|
15934
|
+
policyPassed: import_zod.z.boolean().nullable(),
|
|
15935
|
+
policyResolution: import_zod.z.unknown().nullable(),
|
|
15936
|
+
changeRequestId: import_zod.z.string().nullable(),
|
|
15937
|
+
cancelReason: import_zod.z.string().nullable(),
|
|
15938
|
+
startedAt: import_zod.z.string().nullable(),
|
|
15939
|
+
completedAt: import_zod.z.string().nullable(),
|
|
15940
|
+
errorMessage: import_zod.z.string().nullable(),
|
|
15941
|
+
sourceTreeHash: import_zod.z.string().nullable(),
|
|
15942
|
+
attestationStatus: import_zod.z.string().nullable(),
|
|
15943
|
+
attestedAt: import_zod.z.string().nullable(),
|
|
15944
|
+
attestation: import_zod.z.string().nullable(),
|
|
15945
|
+
createdAt: import_zod.z.string(),
|
|
15946
|
+
updatedAt: import_zod.z.string(),
|
|
15947
|
+
// The run's page in the portal. The CLI builds it on every Run it prints
|
|
15948
|
+
// (apps/cli/internal/kernel/api/runs.go, from the configured base URL and the
|
|
15949
|
+
// selected organization and team); the API's own record carries none, so
|
|
15950
|
+
// a portal mount reading the API body sees it absent — optional so both
|
|
15951
|
+
// bodies parse. A host opens this link and never composes a portal route.
|
|
15952
|
+
url: import_zod.z.string().optional(),
|
|
15953
|
+
// The provider versions the Run's lockfile pins, each with the
|
|
15954
|
+
// organization's admission it ran under when the version is one admitted
|
|
15955
|
+
// outside the curated range. A single-run read carries it; a list does
|
|
15956
|
+
// not, and the CLI omits an empty one.
|
|
15957
|
+
providers: import_zod.z.array(
|
|
15958
|
+
import_zod.z.object({
|
|
15959
|
+
address: import_zod.z.string(),
|
|
15960
|
+
version: import_zod.z.string(),
|
|
15961
|
+
admission: import_zod.z.object({
|
|
15962
|
+
id: import_zod.z.string(),
|
|
15963
|
+
admittedBy: import_zod.z.string(),
|
|
15964
|
+
admittedByName: import_zod.z.string().nullable(),
|
|
15965
|
+
admittedAt: import_zod.z.string()
|
|
15966
|
+
}).optional()
|
|
15967
|
+
})
|
|
15968
|
+
).optional(),
|
|
15969
|
+
// The CLI's own `api.Run` decode struct (apps/cli/internal/kernel/api/runs.go) has no
|
|
15970
|
+
// json tag for these, so every CLI JSON golden omits them; the API always sends
|
|
15971
|
+
// them (apps/api/src/verticals/runs/routes/schemas/runs.ts) — optional so both bodies parse.
|
|
15972
|
+
keepStack: import_zod.z.boolean().optional(),
|
|
15973
|
+
version: import_zod.z.number().optional(),
|
|
15974
|
+
lastHeartbeatAt: import_zod.z.string().nullable().optional(),
|
|
15975
|
+
initiatedByName: import_zod.z.string().nullable().optional(),
|
|
15976
|
+
stackName: import_zod.z.string().nullable().optional()
|
|
15977
|
+
})
|
|
15978
|
+
);
|
|
15834
15979
|
var runListSchema = import_zod.z.object({
|
|
15835
15980
|
items: import_zod.z.array(runSchema),
|
|
15836
15981
|
nextCursor: import_zod.z.string().nullable(),
|
|
@@ -15881,27 +16026,29 @@ var stackPreviewSchema = import_zod.z.object({
|
|
|
15881
16026
|
stack: stackIdentSchema,
|
|
15882
16027
|
treeHash: import_zod.z.string(),
|
|
15883
16028
|
plan: import_zod.z.object({ summary: planSummarySchema, human: import_zod.z.string() }),
|
|
15884
|
-
policy:
|
|
15885
|
-
|
|
15886
|
-
|
|
15887
|
-
|
|
15888
|
-
|
|
15889
|
-
|
|
15890
|
-
|
|
15891
|
-
|
|
15892
|
-
|
|
15893
|
-
import_zod.z.
|
|
15894
|
-
|
|
15895
|
-
|
|
15896
|
-
|
|
15897
|
-
|
|
15898
|
-
|
|
15899
|
-
|
|
15900
|
-
|
|
15901
|
-
|
|
15902
|
-
|
|
15903
|
-
|
|
15904
|
-
|
|
16029
|
+
policy: reads()(
|
|
16030
|
+
import_zod.z.object({
|
|
16031
|
+
mode: import_zod.z.string(),
|
|
16032
|
+
policyId: import_zod.z.string(),
|
|
16033
|
+
ruleId: import_zod.z.string(),
|
|
16034
|
+
rulesFired: import_zod.z.array(import_zod.z.string()),
|
|
16035
|
+
reason: import_zod.z.string(),
|
|
16036
|
+
approvalMode: import_zod.z.string().nullable(),
|
|
16037
|
+
isAuthoringTimePreview: import_zod.z.boolean(),
|
|
16038
|
+
bindings: import_zod.z.array(
|
|
16039
|
+
import_zod.z.object({
|
|
16040
|
+
policyId: import_zod.z.string(),
|
|
16041
|
+
name: import_zod.z.string(),
|
|
16042
|
+
handler: import_zod.z.string(),
|
|
16043
|
+
mode: import_zod.z.string(),
|
|
16044
|
+
decision: import_zod.z.string(),
|
|
16045
|
+
reason: import_zod.z.string(),
|
|
16046
|
+
rulesFired: import_zod.z.array(import_zod.z.string()),
|
|
16047
|
+
approvalMode: import_zod.z.string().nullable()
|
|
16048
|
+
})
|
|
16049
|
+
)
|
|
16050
|
+
}).nullable()
|
|
16051
|
+
),
|
|
15905
16052
|
// What the Preview shows of the Agents bound at it: the curated queue of
|
|
15906
16053
|
// their Advisories about this tree, how many were recorded under the
|
|
15907
16054
|
// Preview's floor, how many bound Agents have not answered, and how many
|
|
@@ -15979,54 +16126,68 @@ var moduleImportSchema = moduleConvertResultSchema.extend({
|
|
|
15979
16126
|
importResiduals: import_zod.z.array(importResidualSchema)
|
|
15980
16127
|
});
|
|
15981
16128
|
var artifactRefSchema = import_zod.z.object({ url: import_zod.z.string(), key: import_zod.z.string() });
|
|
15982
|
-
var runPlanSchema =
|
|
15983
|
-
|
|
15984
|
-
|
|
15985
|
-
|
|
15986
|
-
|
|
15987
|
-
|
|
16129
|
+
var runPlanSchema = reads()(
|
|
16130
|
+
import_zod.z.object({
|
|
16131
|
+
runId: import_zod.z.string(),
|
|
16132
|
+
status: import_zod.z.string().nullable(),
|
|
16133
|
+
// The counts the Run recorded, each null for a Run whose plan has none.
|
|
16134
|
+
summary: import_zod.z.object({
|
|
16135
|
+
resourceAdd: import_zod.z.number().nullable(),
|
|
16136
|
+
resourceChange: import_zod.z.number().nullable(),
|
|
16137
|
+
resourceDestroy: import_zod.z.number().nullable()
|
|
16138
|
+
}).nullable(),
|
|
16139
|
+
planHuman: artifactRefSchema.nullable()
|
|
16140
|
+
})
|
|
16141
|
+
);
|
|
15988
16142
|
var runLogsEventSchema = import_zod.z.discriminatedUnion("type", [
|
|
15989
16143
|
import_zod.z.object({ type: import_zod.z.literal("log"), text: import_zod.z.string() }),
|
|
15990
16144
|
import_zod.z.object({ type: import_zod.z.literal("result"), status: import_zod.z.string().nullable() })
|
|
15991
16145
|
]);
|
|
15992
|
-
var whoamiSchema =
|
|
15993
|
-
|
|
15994
|
-
|
|
15995
|
-
|
|
16146
|
+
var whoamiSchema = reads()(
|
|
16147
|
+
import_zod.z.object({
|
|
16148
|
+
organization: import_zod.z.string().nullable(),
|
|
16149
|
+
// A machine credential's principal names no person.
|
|
16150
|
+
user: import_zod.z.object({ email: import_zod.z.string(), id: import_zod.z.string(), name: import_zod.z.string() }).optional()
|
|
16151
|
+
})
|
|
16152
|
+
);
|
|
15996
16153
|
var orgListSchema = import_zod.z.object({
|
|
15997
16154
|
items: import_zod.z.array(import_zod.z.object({ slug: import_zod.z.string(), name: import_zod.z.string(), role: import_zod.z.string() }))
|
|
15998
16155
|
});
|
|
15999
|
-
var teamListSchema =
|
|
16000
|
-
|
|
16001
|
-
import_zod.z.
|
|
16002
|
-
|
|
16003
|
-
|
|
16004
|
-
|
|
16005
|
-
|
|
16006
|
-
|
|
16007
|
-
|
|
16008
|
-
|
|
16009
|
-
|
|
16010
|
-
|
|
16011
|
-
|
|
16012
|
-
|
|
16013
|
-
|
|
16014
|
-
|
|
16015
|
-
|
|
16016
|
-
|
|
16017
|
-
|
|
16156
|
+
var teamListSchema = reads()(
|
|
16157
|
+
import_zod.z.object({
|
|
16158
|
+
items: import_zod.z.array(
|
|
16159
|
+
import_zod.z.object({
|
|
16160
|
+
id: import_zod.z.string(),
|
|
16161
|
+
orgId: import_zod.z.string(),
|
|
16162
|
+
name: import_zod.z.string(),
|
|
16163
|
+
slug: import_zod.z.string(),
|
|
16164
|
+
description: import_zod.z.string().nullish(),
|
|
16165
|
+
createdBy: import_zod.z.string(),
|
|
16166
|
+
createdAt: import_zod.z.string(),
|
|
16167
|
+
updatedAt: import_zod.z.string(),
|
|
16168
|
+
role: import_zod.z.string().optional(),
|
|
16169
|
+
memberCount: import_zod.z.number().optional()
|
|
16170
|
+
})
|
|
16171
|
+
),
|
|
16172
|
+
nextCursor: import_zod.z.string().nullable(),
|
|
16173
|
+
hasMore: import_zod.z.boolean(),
|
|
16174
|
+
createUrl: import_zod.z.string()
|
|
16175
|
+
})
|
|
16176
|
+
);
|
|
16018
16177
|
var connectionListSchema = import_zod.z.object({
|
|
16019
16178
|
items: import_zod.z.array(
|
|
16020
|
-
|
|
16021
|
-
|
|
16022
|
-
|
|
16023
|
-
|
|
16024
|
-
|
|
16025
|
-
|
|
16026
|
-
|
|
16027
|
-
|
|
16028
|
-
|
|
16029
|
-
|
|
16179
|
+
reads()(
|
|
16180
|
+
import_zod.z.object({
|
|
16181
|
+
id: import_zod.z.string(),
|
|
16182
|
+
name: import_zod.z.string(),
|
|
16183
|
+
provider_type: import_zod.z.string(),
|
|
16184
|
+
status: import_zod.z.string(),
|
|
16185
|
+
status_reason: import_zod.z.string().nullable(),
|
|
16186
|
+
created_at: import_zod.z.string(),
|
|
16187
|
+
updated_at: import_zod.z.string(),
|
|
16188
|
+
metadata: import_zod.z.record(import_zod.z.string(), import_zod.z.unknown())
|
|
16189
|
+
})
|
|
16190
|
+
)
|
|
16030
16191
|
),
|
|
16031
16192
|
createUrl: import_zod.z.string()
|
|
16032
16193
|
});
|
|
@@ -16108,15 +16269,15 @@ function resultFailure(path, data) {
|
|
|
16108
16269
|
}
|
|
16109
16270
|
|
|
16110
16271
|
// src/core/CommandArgsForm.tsx
|
|
16111
|
-
var
|
|
16272
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
16112
16273
|
function flagsOf(path) {
|
|
16113
16274
|
return COMMANDS[path].flags;
|
|
16114
16275
|
}
|
|
16115
16276
|
function CommandArgsForm({ form }) {
|
|
16116
|
-
const [values, setValues] = (0,
|
|
16277
|
+
const [values, setValues] = (0, import_react27.useState)({});
|
|
16117
16278
|
if (!form) return null;
|
|
16118
16279
|
const flags = isCommandPath(form.path) ? flagsOf(form.path) : {};
|
|
16119
|
-
return /* @__PURE__ */ (0,
|
|
16280
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
16120
16281
|
"form",
|
|
16121
16282
|
{
|
|
16122
16283
|
className: "lace-command-args-form",
|
|
@@ -16127,16 +16288,16 @@ function CommandArgsForm({ form }) {
|
|
|
16127
16288
|
children: [
|
|
16128
16289
|
form.missing.map((key) => {
|
|
16129
16290
|
const flagType = flags[key]?.type;
|
|
16130
|
-
return /* @__PURE__ */ (0,
|
|
16131
|
-
/* @__PURE__ */ (0,
|
|
16132
|
-
flagType === "bool" ? /* @__PURE__ */ (0,
|
|
16291
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("label", { className: "lace-command-args-form__field", children: [
|
|
16292
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: key }),
|
|
16293
|
+
flagType === "bool" ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
16133
16294
|
"input",
|
|
16134
16295
|
{
|
|
16135
16296
|
type: "checkbox",
|
|
16136
16297
|
checked: Boolean(values[key]),
|
|
16137
16298
|
onChange: (e) => setValues((prev) => ({ ...prev, [key]: e.target.checked }))
|
|
16138
16299
|
}
|
|
16139
|
-
) : /* @__PURE__ */ (0,
|
|
16300
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
16140
16301
|
"input",
|
|
16141
16302
|
{
|
|
16142
16303
|
type: "text",
|
|
@@ -16147,9 +16308,9 @@ function CommandArgsForm({ form }) {
|
|
|
16147
16308
|
)
|
|
16148
16309
|
] }, key);
|
|
16149
16310
|
}),
|
|
16150
|
-
/* @__PURE__ */ (0,
|
|
16151
|
-
/* @__PURE__ */ (0,
|
|
16152
|
-
/* @__PURE__ */ (0,
|
|
16311
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "lace-command-args-form__actions", children: [
|
|
16312
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { type: "submit", children: "Continue" }),
|
|
16313
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { type: "button", onClick: form.cancel, children: "Cancel" })
|
|
16153
16314
|
] })
|
|
16154
16315
|
]
|
|
16155
16316
|
}
|
|
@@ -16901,10 +17062,10 @@ var CORE_COMMAND_ACTIONS = [
|
|
|
16901
17062
|
var import_proto11 = require("@lace-cloud/proto");
|
|
16902
17063
|
|
|
16903
17064
|
// src/core/define-overlay.ts
|
|
16904
|
-
var
|
|
17065
|
+
var import_react30 = require("react");
|
|
16905
17066
|
|
|
16906
17067
|
// src/core/use-command-read.ts
|
|
16907
|
-
var
|
|
17068
|
+
var import_react29 = require("react");
|
|
16908
17069
|
|
|
16909
17070
|
// src/utils/is-plain-object.ts
|
|
16910
17071
|
function isPlainObject(val) {
|
|
@@ -16912,11 +17073,11 @@ function isPlainObject(val) {
|
|
|
16912
17073
|
}
|
|
16913
17074
|
|
|
16914
17075
|
// src/core/panel-scope.tsx
|
|
16915
|
-
var
|
|
16916
|
-
var
|
|
17076
|
+
var import_react28 = require("react");
|
|
17077
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
16917
17078
|
var noopReportError = () => {
|
|
16918
17079
|
};
|
|
16919
|
-
var PanelScopeContext = (0,
|
|
17080
|
+
var PanelScopeContext = (0, import_react28.createContext)(null);
|
|
16920
17081
|
function PanelScope({
|
|
16921
17082
|
ctx,
|
|
16922
17083
|
target = {},
|
|
@@ -16926,14 +17087,14 @@ function PanelScope({
|
|
|
16926
17087
|
children
|
|
16927
17088
|
}) {
|
|
16928
17089
|
const reportError = onReadError ?? noopReportError;
|
|
16929
|
-
const value = (0,
|
|
17090
|
+
const value = (0, import_react28.useMemo)(
|
|
16930
17091
|
() => ({ ctx, target, paths: new Set(paths), tick, reportError }),
|
|
16931
17092
|
[ctx, target, paths, tick, reportError]
|
|
16932
17093
|
);
|
|
16933
|
-
return /* @__PURE__ */ (0,
|
|
17094
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(PanelScopeContext.Provider, { value, children });
|
|
16934
17095
|
}
|
|
16935
17096
|
function usePanelScope() {
|
|
16936
|
-
const value = (0,
|
|
17097
|
+
const value = (0, import_react28.useContext)(PanelScopeContext);
|
|
16937
17098
|
if (!value) {
|
|
16938
17099
|
throw new Error(
|
|
16939
17100
|
"usePanelScope: not inside a <PanelScope> \u2014 mount panels/overlays through App, which wraps every declared-read contribution"
|
|
@@ -16967,20 +17128,20 @@ function useCommandRead(read, target) {
|
|
|
16967
17128
|
const effectiveTarget = target ?? scope.target;
|
|
16968
17129
|
const args = read.args(scope.ctx, effectiveTarget);
|
|
16969
17130
|
const key = args === null ? null : stableJson(args);
|
|
16970
|
-
const [state, setState] = (0,
|
|
16971
|
-
const prevKeyRef = (0,
|
|
17131
|
+
const [state, setState] = (0, import_react29.useState)(INITIAL);
|
|
17132
|
+
const prevKeyRef = (0, import_react29.useRef)(NOT_YET_READ);
|
|
16972
17133
|
const inputs = {
|
|
16973
17134
|
path: read.path,
|
|
16974
17135
|
args,
|
|
16975
17136
|
commands: scope.ctx.ports.commands,
|
|
16976
17137
|
reportError: scope.reportError
|
|
16977
17138
|
};
|
|
16978
|
-
const inputsRef = (0,
|
|
16979
|
-
(0,
|
|
17139
|
+
const inputsRef = (0, import_react29.useRef)(inputs);
|
|
17140
|
+
(0, import_react29.useEffect)(() => {
|
|
16980
17141
|
inputsRef.current = inputs;
|
|
16981
17142
|
});
|
|
16982
|
-
const request = (0,
|
|
16983
|
-
(0,
|
|
17143
|
+
const request = (0, import_react29.useMemo)(() => ({ key, tick: scope.tick }), [key, scope.tick]);
|
|
17144
|
+
(0, import_react29.useEffect)(() => {
|
|
16984
17145
|
const { path, args: args2, commands, reportError } = inputsRef.current;
|
|
16985
17146
|
const keyChanged = prevKeyRef.current !== request.key;
|
|
16986
17147
|
prevKeyRef.current = request.key;
|
|
@@ -17025,7 +17186,7 @@ function defineOverlay(o) {
|
|
|
17025
17186
|
useDecorations(ctx) {
|
|
17026
17187
|
const { data } = useCommandRead(o.read);
|
|
17027
17188
|
const view = ctx.view;
|
|
17028
|
-
return (0,
|
|
17189
|
+
return (0, import_react30.useMemo)(
|
|
17029
17190
|
() => data ? o.decorate(view, data) : EMPTY_DECORATIONS2,
|
|
17030
17191
|
[o.decorate, view, data]
|
|
17031
17192
|
);
|
|
@@ -17082,24 +17243,24 @@ var import_ui7 = require("@lace-cloud/ui");
|
|
|
17082
17243
|
|
|
17083
17244
|
// src/components/Banner.tsx
|
|
17084
17245
|
var import_Banner = require("./Banner-4TSIKYLF.css");
|
|
17085
|
-
var
|
|
17246
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
17086
17247
|
function Banner({ severity, message, className, actions }) {
|
|
17087
|
-
return /* @__PURE__ */ (0,
|
|
17248
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
17088
17249
|
"div",
|
|
17089
17250
|
{
|
|
17090
17251
|
className: `lace-banner lace-banner--${severity} ${className}`,
|
|
17091
17252
|
role: severity === "error" ? "alert" : "status",
|
|
17092
17253
|
children: [
|
|
17093
|
-
/* @__PURE__ */ (0,
|
|
17094
|
-
/* @__PURE__ */ (0,
|
|
17095
|
-
actions ? /* @__PURE__ */ (0,
|
|
17254
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "lace-banner__icon", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(CanvasIcon, { name: severity }) }),
|
|
17255
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "lace-banner__message", children: message }),
|
|
17256
|
+
actions ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "lace-banner__actions", children: actions }) : null
|
|
17096
17257
|
]
|
|
17097
17258
|
}
|
|
17098
17259
|
);
|
|
17099
17260
|
}
|
|
17100
17261
|
|
|
17101
17262
|
// src/core/panels/RowActionBanner.tsx
|
|
17102
|
-
var
|
|
17263
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
17103
17264
|
function bannerMessage(opening, actions) {
|
|
17104
17265
|
return [opening, ...actions.flatMap((action) => action.choice ? [action.choice] : [])].join(
|
|
17105
17266
|
" "
|
|
@@ -17109,7 +17270,7 @@ function RowActionBanner({ ctx, panelId, severity, className, opening }) {
|
|
|
17109
17270
|
const { runner } = useCanvas();
|
|
17110
17271
|
const envExtras = useEditorEnvExtras();
|
|
17111
17272
|
const actions = rowActionsFor(ctx, panelId);
|
|
17112
|
-
return /* @__PURE__ */ (0,
|
|
17273
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
17113
17274
|
Banner,
|
|
17114
17275
|
{
|
|
17115
17276
|
severity,
|
|
@@ -17117,7 +17278,7 @@ function RowActionBanner({ ctx, panelId, severity, className, opening }) {
|
|
|
17117
17278
|
message: bannerMessage(opening, actions),
|
|
17118
17279
|
actions: actions.length === 0 ? void 0 : actions.map((action) => {
|
|
17119
17280
|
const state = actionState(action, ctx, runner.busy(action, ctx, {}));
|
|
17120
|
-
return /* @__PURE__ */ (0,
|
|
17281
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
17121
17282
|
import_ui7.Button,
|
|
17122
17283
|
{
|
|
17123
17284
|
rung: true,
|
|
@@ -17138,9 +17299,9 @@ function RowActionBanner({ ctx, panelId, severity, className, opening }) {
|
|
|
17138
17299
|
}
|
|
17139
17300
|
|
|
17140
17301
|
// src/core/panels/ConflictBanner.tsx
|
|
17141
|
-
var
|
|
17302
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
17142
17303
|
function ConflictBanner({ ctx }) {
|
|
17143
|
-
return /* @__PURE__ */ (0,
|
|
17304
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
17144
17305
|
RowActionBanner,
|
|
17145
17306
|
{
|
|
17146
17307
|
ctx,
|
|
@@ -17164,9 +17325,9 @@ var conflictPanel = {
|
|
|
17164
17325
|
var import_ui8 = require("@lace-cloud/ui");
|
|
17165
17326
|
|
|
17166
17327
|
// src/components/Identifier.tsx
|
|
17167
|
-
var
|
|
17328
|
+
var import_react31 = require("react");
|
|
17168
17329
|
var import_Identifier = require("./Identifier-V6MZ37EG.css");
|
|
17169
|
-
var
|
|
17330
|
+
var import_jsx_runtime22 = (
|
|
17170
17331
|
// biome-ignore lint/suspicious/noArrayIndexKey: a segment's place in the name is its identity.
|
|
17171
17332
|
require("react/jsx-runtime")
|
|
17172
17333
|
);
|
|
@@ -17174,15 +17335,15 @@ function identifierSegments(text) {
|
|
|
17174
17335
|
return text.split(/(?<=[_.])/);
|
|
17175
17336
|
}
|
|
17176
17337
|
function Identifier({ text, className }) {
|
|
17177
|
-
return /* @__PURE__ */ (0,
|
|
17178
|
-
i > 0 ? /* @__PURE__ */ (0,
|
|
17338
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: className ? `lace-identifier ${className}` : "lace-identifier", children: identifierSegments(text).map((segment, i) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_react31.Fragment, { children: [
|
|
17339
|
+
i > 0 ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("wbr", {}) : null,
|
|
17179
17340
|
segment
|
|
17180
17341
|
] }, i)) });
|
|
17181
17342
|
}
|
|
17182
17343
|
|
|
17183
17344
|
// src/core/panels/DiagnosticsPanel.tsx
|
|
17184
17345
|
var import_DiagnosticsPanel = require("./DiagnosticsPanel-MSK72CGM.css");
|
|
17185
|
-
var
|
|
17346
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
17186
17347
|
function locationOf(file, line) {
|
|
17187
17348
|
return line === void 0 ? file : `${file}:${line}`;
|
|
17188
17349
|
}
|
|
@@ -17193,36 +17354,36 @@ function DiagnosticsPanel({ ctx }) {
|
|
|
17193
17354
|
const { runner } = useCanvas();
|
|
17194
17355
|
const envExtras = useEditorEnvExtras();
|
|
17195
17356
|
const diagnostics = ctx.diagnostics;
|
|
17196
|
-
return /* @__PURE__ */ (0,
|
|
17357
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("ul", { className: "lace-diagnostics-panel", role: "list", children: diagnostics.map((d, index) => {
|
|
17197
17358
|
const key = rowKey(d, index);
|
|
17198
17359
|
const target = { diagnostic: d };
|
|
17199
17360
|
const actions = rowActionsFor(ctx, "diagnostics", target);
|
|
17200
|
-
return /* @__PURE__ */ (0,
|
|
17361
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
17201
17362
|
"li",
|
|
17202
17363
|
{
|
|
17203
17364
|
className: `lace-diagnostics-panel__row lace-diagnostics-panel__row--${d.severity}`,
|
|
17204
17365
|
children: [
|
|
17205
|
-
/* @__PURE__ */ (0,
|
|
17206
|
-
/* @__PURE__ */ (0,
|
|
17207
|
-
/* @__PURE__ */ (0,
|
|
17208
|
-
d.file !== void 0 && /* @__PURE__ */ (0,
|
|
17366
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "lace-diagnostics-panel__icon", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(CanvasIcon, { name: d.severity }) }),
|
|
17367
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("span", { className: "lace-diagnostics-panel__body", children: [
|
|
17368
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "lace-diagnostics-panel__message", children: d.message }),
|
|
17369
|
+
d.file !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
17209
17370
|
Identifier,
|
|
17210
17371
|
{
|
|
17211
17372
|
className: "lace-diagnostics-panel__file",
|
|
17212
17373
|
text: locationOf(d.file, d.line)
|
|
17213
17374
|
}
|
|
17214
17375
|
),
|
|
17215
|
-
d.instance_id !== void 0 && /* @__PURE__ */ (0,
|
|
17376
|
+
d.instance_id !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
17216
17377
|
Identifier,
|
|
17217
17378
|
{
|
|
17218
17379
|
className: "lace-diagnostics-panel__where",
|
|
17219
17380
|
text: d.input_name ? `${d.instance_id}.${d.input_name}` : d.instance_id
|
|
17220
17381
|
}
|
|
17221
17382
|
),
|
|
17222
|
-
d.code !== void 0 && /* @__PURE__ */ (0,
|
|
17383
|
+
d.code !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Identifier, { className: "lace-diagnostics-panel__code", text: d.code }),
|
|
17223
17384
|
actions.map((action) => {
|
|
17224
17385
|
const state = actionState(action, ctx, runner.busy(action, ctx, target));
|
|
17225
|
-
return /* @__PURE__ */ (0,
|
|
17386
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
17226
17387
|
import_ui8.Button,
|
|
17227
17388
|
{
|
|
17228
17389
|
rung: true,
|
|
@@ -17259,13 +17420,13 @@ var diagnosticsPanel = {
|
|
|
17259
17420
|
|
|
17260
17421
|
// src/core/panels/edge-inspector.ts
|
|
17261
17422
|
var import_proto13 = require("@lace-cloud/proto");
|
|
17262
|
-
var
|
|
17423
|
+
var import_react32 = require("react");
|
|
17263
17424
|
|
|
17264
17425
|
// src/components/panels/EdgeInspectorPanel.tsx
|
|
17265
17426
|
var import_proto12 = require("@lace-cloud/proto");
|
|
17266
17427
|
var import_ui9 = require("@lace-cloud/ui");
|
|
17267
17428
|
var import_EdgeInspectorPanel = require("./EdgeInspectorPanel-JD6CVUAT.css");
|
|
17268
|
-
var
|
|
17429
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
17269
17430
|
function EdgeInspectorPanel({
|
|
17270
17431
|
source,
|
|
17271
17432
|
target,
|
|
@@ -17274,23 +17435,23 @@ function EdgeInspectorPanel({
|
|
|
17274
17435
|
onDelete,
|
|
17275
17436
|
onClose
|
|
17276
17437
|
}) {
|
|
17277
|
-
const title = /* @__PURE__ */ (0,
|
|
17278
|
-
/* @__PURE__ */ (0,
|
|
17279
|
-
/* @__PURE__ */ (0,
|
|
17280
|
-
/* @__PURE__ */ (0,
|
|
17438
|
+
const title = /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { children: [
|
|
17439
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "lace-edge-panel__title-eyebrow", children: "Connection" }),
|
|
17440
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "lace-edge-panel__title", children: [
|
|
17441
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Identifier, { text: source }),
|
|
17281
17442
|
" \u2192 ",
|
|
17282
|
-
/* @__PURE__ */ (0,
|
|
17443
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Identifier, { text: target })
|
|
17283
17444
|
] })
|
|
17284
17445
|
] });
|
|
17285
|
-
const footer = onDelete ? /* @__PURE__ */ (0,
|
|
17286
|
-
return /* @__PURE__ */ (0,
|
|
17287
|
-
/* @__PURE__ */ (0,
|
|
17288
|
-
/* @__PURE__ */ (0,
|
|
17289
|
-
/* @__PURE__ */ (0,
|
|
17290
|
-
/* @__PURE__ */ (0,
|
|
17291
|
-
/* @__PURE__ */ (0,
|
|
17446
|
+
const footer = onDelete ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_ui9.Button, { rung: true, variant: "danger", fullWidth: true, onClick: onDelete, children: "Delete connection" }) : void 0;
|
|
17447
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_ui9.Panel, { title, footer, onClose, children: [
|
|
17448
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "lace-edge-panel__section-label", children: "Wiring" }),
|
|
17449
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "lace-edge-panel__wiring", children: [
|
|
17450
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Identifier, { text: sourceOutput ? `${source}.outputs.${sourceOutput}` : (0, import_proto12.callText)(source) }),
|
|
17451
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "lace-edge-panel__wiring-arrow", children: "\u2193" }),
|
|
17452
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Identifier, { text: `${target}.inputs.${targetInput}` })
|
|
17292
17453
|
] }),
|
|
17293
|
-
onDelete && /* @__PURE__ */ (0,
|
|
17454
|
+
onDelete && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "lace-edge-panel__hint", children: "Delete or press Backspace with the edge selected to remove this connection. Create new edges by dragging between the pins on each node's edge." })
|
|
17294
17455
|
] });
|
|
17295
17456
|
}
|
|
17296
17457
|
|
|
@@ -17328,7 +17489,7 @@ function EdgeInspectorPanel2({ ctx }) {
|
|
|
17328
17489
|
const edge = ctx.view.edges.find((e) => e.id === selected);
|
|
17329
17490
|
if (!edge) return null;
|
|
17330
17491
|
const disconnect = rowActionsFor(ctx, "edge-inspector").find((a) => a.id === "disconnect");
|
|
17331
|
-
return (0,
|
|
17492
|
+
return (0, import_react32.createElement)(EdgeInspectorPanel, {
|
|
17332
17493
|
source: edge.source,
|
|
17333
17494
|
target: edge.target,
|
|
17334
17495
|
sourceOutput: edge.source_output,
|
|
@@ -17353,9 +17514,9 @@ var edgeInspectorPanel = {
|
|
|
17353
17514
|
|
|
17354
17515
|
// src/core/panels/Markers.tsx
|
|
17355
17516
|
var import_ui10 = require("@lace-cloud/ui");
|
|
17356
|
-
var
|
|
17517
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
17357
17518
|
function UnsavedMarker() {
|
|
17358
|
-
return /* @__PURE__ */ (0,
|
|
17519
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_ui10.Badge, { variant: "warning", dot: true, role: "status", className: "lace-marker lace-marker--unsaved", children: "Unsaved" });
|
|
17359
17520
|
}
|
|
17360
17521
|
var unsavedMarker = {
|
|
17361
17522
|
id: "unsaved-marker",
|
|
@@ -17367,7 +17528,7 @@ var unsavedMarker = {
|
|
|
17367
17528
|
Component: UnsavedMarker
|
|
17368
17529
|
};
|
|
17369
17530
|
function UngeneratedMarker() {
|
|
17370
|
-
return /* @__PURE__ */ (0,
|
|
17531
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_ui10.Badge, { variant: "neutral", role: "status", className: "lace-marker lace-marker--ungenerated", children: "Not generated" });
|
|
17371
17532
|
}
|
|
17372
17533
|
var ungeneratedMarker = {
|
|
17373
17534
|
id: "ungenerated-marker",
|
|
@@ -17380,15 +17541,15 @@ var ungeneratedMarker = {
|
|
|
17380
17541
|
};
|
|
17381
17542
|
|
|
17382
17543
|
// src/core/panels/module-config.ts
|
|
17383
|
-
var
|
|
17544
|
+
var import_react40 = require("react");
|
|
17384
17545
|
|
|
17385
17546
|
// src/components/panels/ModuleConfigPanel.tsx
|
|
17386
17547
|
var import_proto15 = require("@lace-cloud/proto");
|
|
17387
17548
|
var import_ui19 = require("@lace-cloud/ui");
|
|
17388
|
-
var
|
|
17549
|
+
var import_react39 = require("react");
|
|
17389
17550
|
|
|
17390
17551
|
// src/hooks/useDraft.ts
|
|
17391
|
-
var
|
|
17552
|
+
var import_react34 = require("react");
|
|
17392
17553
|
|
|
17393
17554
|
// src/utils/deep-equal.ts
|
|
17394
17555
|
function deepEqual(a, b) {
|
|
@@ -17405,15 +17566,15 @@ function deepEqual(a, b) {
|
|
|
17405
17566
|
}
|
|
17406
17567
|
|
|
17407
17568
|
// src/hooks/useUpdateState.ts
|
|
17408
|
-
var
|
|
17569
|
+
var import_react33 = require("react");
|
|
17409
17570
|
function useUpdateState(updateFn) {
|
|
17410
|
-
const [status, setStatus] = (0,
|
|
17411
|
-
const mountedRef = (0,
|
|
17412
|
-
const resetTimerRef = (0,
|
|
17413
|
-
const safeSetStatus = (0,
|
|
17571
|
+
const [status, setStatus] = (0, import_react33.useState)("idle");
|
|
17572
|
+
const mountedRef = (0, import_react33.useRef)(true);
|
|
17573
|
+
const resetTimerRef = (0, import_react33.useRef)(null);
|
|
17574
|
+
const safeSetStatus = (0, import_react33.useCallback)((next) => {
|
|
17414
17575
|
if (mountedRef.current) setStatus(next);
|
|
17415
17576
|
}, []);
|
|
17416
|
-
const scheduleReset = (0,
|
|
17577
|
+
const scheduleReset = (0, import_react33.useCallback)(
|
|
17417
17578
|
(delay) => {
|
|
17418
17579
|
if (resetTimerRef.current !== null) clearTimeout(resetTimerRef.current);
|
|
17419
17580
|
resetTimerRef.current = setTimeout(() => {
|
|
@@ -17423,7 +17584,7 @@ function useUpdateState(updateFn) {
|
|
|
17423
17584
|
},
|
|
17424
17585
|
[safeSetStatus]
|
|
17425
17586
|
);
|
|
17426
|
-
const handleUpdate = (0,
|
|
17587
|
+
const handleUpdate = (0, import_react33.useCallback)(async () => {
|
|
17427
17588
|
safeSetStatus("updating");
|
|
17428
17589
|
try {
|
|
17429
17590
|
await updateFn();
|
|
@@ -17434,7 +17595,7 @@ function useUpdateState(updateFn) {
|
|
|
17434
17595
|
scheduleReset(2e3);
|
|
17435
17596
|
}
|
|
17436
17597
|
}, [updateFn, safeSetStatus, scheduleReset]);
|
|
17437
|
-
(0,
|
|
17598
|
+
(0, import_react33.useEffect)(() => {
|
|
17438
17599
|
mountedRef.current = true;
|
|
17439
17600
|
return () => {
|
|
17440
17601
|
mountedRef.current = false;
|
|
@@ -17452,7 +17613,7 @@ function keeping(drafts, keep) {
|
|
|
17452
17613
|
return new Map([...drafts].filter(([key, draft]) => keep(key, draft)));
|
|
17453
17614
|
}
|
|
17454
17615
|
function useDraft(seed, send) {
|
|
17455
|
-
const [drafts, setDrafts] = (0,
|
|
17616
|
+
const [drafts, setDrafts] = (0, import_react34.useState)(() => /* @__PURE__ */ new Map());
|
|
17456
17617
|
const unsettled = (key, draft) => key in seed && !deepEqual(draft, seed[key]);
|
|
17457
17618
|
const live = keeping(drafts, unsettled);
|
|
17458
17619
|
if (live.size < drafts.size) setDrafts((prev) => keeping(prev, unsettled));
|
|
@@ -17473,13 +17634,13 @@ function useDraft(seed, send) {
|
|
|
17473
17634
|
}
|
|
17474
17635
|
|
|
17475
17636
|
// src/components/AccordionSection.tsx
|
|
17476
|
-
var
|
|
17637
|
+
var import_react35 = require("react");
|
|
17477
17638
|
var import_AccordionSection = require("./AccordionSection-5X2XWUYY.css");
|
|
17478
|
-
var
|
|
17639
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
17479
17640
|
function AccordionSection({ title, defaultOpen = false, badge, children }) {
|
|
17480
|
-
const [open, setOpen] = (0,
|
|
17481
|
-
return /* @__PURE__ */ (0,
|
|
17482
|
-
/* @__PURE__ */ (0,
|
|
17641
|
+
const [open, setOpen] = (0, import_react35.useState)(defaultOpen);
|
|
17642
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: `lace-accordion${open ? " lace-accordion--open" : ""}`, children: [
|
|
17643
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
17483
17644
|
"button",
|
|
17484
17645
|
{
|
|
17485
17646
|
type: "button",
|
|
@@ -17487,13 +17648,13 @@ function AccordionSection({ title, defaultOpen = false, badge, children }) {
|
|
|
17487
17648
|
onClick: () => setOpen((v) => !v),
|
|
17488
17649
|
"aria-expanded": open,
|
|
17489
17650
|
children: [
|
|
17490
|
-
/* @__PURE__ */ (0,
|
|
17491
|
-
/* @__PURE__ */ (0,
|
|
17492
|
-
badge && /* @__PURE__ */ (0,
|
|
17651
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "lace-accordion__chevron", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(CanvasIcon, { name: "chevron-right" }) }),
|
|
17652
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "lace-accordion__title", children: title }),
|
|
17653
|
+
badge && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "lace-accordion__badge", children: badge })
|
|
17493
17654
|
]
|
|
17494
17655
|
}
|
|
17495
17656
|
),
|
|
17496
|
-
/* @__PURE__ */ (0,
|
|
17657
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "lace-accordion__body", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "lace-accordion__body-inner", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "lace-accordion__body-content", children }) }) })
|
|
17497
17658
|
] });
|
|
17498
17659
|
}
|
|
17499
17660
|
|
|
@@ -17504,7 +17665,7 @@ var import_panels_shared8 = require("./panels-shared-3HUQC7TC.css");
|
|
|
17504
17665
|
// src/components/UpdateButton.tsx
|
|
17505
17666
|
var import_ui11 = require("@lace-cloud/ui");
|
|
17506
17667
|
var import_UpdateButton = require("./UpdateButton-TJKSFVBA.css");
|
|
17507
|
-
var
|
|
17668
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
17508
17669
|
var variantByStatus = {
|
|
17509
17670
|
updating: "primary",
|
|
17510
17671
|
updated: "success",
|
|
@@ -17520,7 +17681,7 @@ function variantOf({ status, dirty }, blocked) {
|
|
|
17520
17681
|
return dirty && blocked === void 0 ? "primary" : "secondary";
|
|
17521
17682
|
}
|
|
17522
17683
|
function UpdateButton({ draft, label, blocked }) {
|
|
17523
|
-
return /* @__PURE__ */ (0,
|
|
17684
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "lace-commit-foot", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
17524
17685
|
import_ui11.Button,
|
|
17525
17686
|
{
|
|
17526
17687
|
rung: true,
|
|
@@ -17538,13 +17699,13 @@ function UpdateButton({ draft, label, blocked }) {
|
|
|
17538
17699
|
// src/components/panels/ModuleDetails.tsx
|
|
17539
17700
|
var import_proto14 = require("@lace-cloud/proto");
|
|
17540
17701
|
var import_ui18 = require("@lace-cloud/ui");
|
|
17541
|
-
var
|
|
17702
|
+
var import_react38 = require("react");
|
|
17542
17703
|
|
|
17543
17704
|
// src/components/panels/BlockEditor.tsx
|
|
17544
17705
|
var import_ui12 = require("@lace-cloud/ui");
|
|
17545
|
-
var
|
|
17706
|
+
var import_react36 = require("react");
|
|
17546
17707
|
var import_panels_shared = require("./panels-shared-3HUQC7TC.css");
|
|
17547
|
-
var
|
|
17708
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
17548
17709
|
function replaceAt(list, index, item) {
|
|
17549
17710
|
return list.map((x, i) => i === index ? item : x);
|
|
17550
17711
|
}
|
|
@@ -17552,8 +17713,8 @@ function blockTitle(block) {
|
|
|
17552
17713
|
return [block.type, ...block.labels.map((l) => `"${l}"`)].join(" ");
|
|
17553
17714
|
}
|
|
17554
17715
|
function BlockEditor({ blocks, onChange, editable, templates }) {
|
|
17555
|
-
return /* @__PURE__ */ (0,
|
|
17556
|
-
blocks.map((block, i) => /* @__PURE__ */ (0,
|
|
17716
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
|
|
17717
|
+
blocks.map((block, i) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
17557
17718
|
BlockCard,
|
|
17558
17719
|
{
|
|
17559
17720
|
block,
|
|
@@ -17563,7 +17724,7 @@ function BlockEditor({ blocks, onChange, editable, templates }) {
|
|
|
17563
17724
|
},
|
|
17564
17725
|
i
|
|
17565
17726
|
)),
|
|
17566
|
-
editable && (templates ? /* @__PURE__ */ (0,
|
|
17727
|
+
editable && (templates ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "lace-panel-row-actions", children: templates.map((t) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
17567
17728
|
import_ui12.Button,
|
|
17568
17729
|
{
|
|
17569
17730
|
variant: "secondary",
|
|
@@ -17584,7 +17745,7 @@ function BlockEditor({ blocks, onChange, editable, templates }) {
|
|
|
17584
17745
|
]
|
|
17585
17746
|
},
|
|
17586
17747
|
t.type
|
|
17587
|
-
)) }) : /* @__PURE__ */ (0,
|
|
17748
|
+
)) }) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
17588
17749
|
NewBlockRow,
|
|
17589
17750
|
{
|
|
17590
17751
|
onAdd: (type, label) => onChange([
|
|
@@ -17596,10 +17757,10 @@ function BlockEditor({ blocks, onChange, editable, templates }) {
|
|
|
17596
17757
|
] });
|
|
17597
17758
|
}
|
|
17598
17759
|
function NewBlockRow({ onAdd }) {
|
|
17599
|
-
const [type, setType] = (0,
|
|
17600
|
-
const [label, setLabel] = (0,
|
|
17601
|
-
return /* @__PURE__ */ (0,
|
|
17602
|
-
/* @__PURE__ */ (0,
|
|
17760
|
+
const [type, setType] = (0, import_react36.useState)("");
|
|
17761
|
+
const [label, setLabel] = (0, import_react36.useState)("");
|
|
17762
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "lace-panel-row-actions", children: [
|
|
17763
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
17603
17764
|
import_ui12.Input,
|
|
17604
17765
|
{
|
|
17605
17766
|
value: type,
|
|
@@ -17609,7 +17770,7 @@ function NewBlockRow({ onAdd }) {
|
|
|
17609
17770
|
mono: true
|
|
17610
17771
|
}
|
|
17611
17772
|
),
|
|
17612
|
-
/* @__PURE__ */ (0,
|
|
17773
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
17613
17774
|
import_ui12.Input,
|
|
17614
17775
|
{
|
|
17615
17776
|
value: label,
|
|
@@ -17619,7 +17780,7 @@ function NewBlockRow({ onAdd }) {
|
|
|
17619
17780
|
mono: true
|
|
17620
17781
|
}
|
|
17621
17782
|
),
|
|
17622
|
-
/* @__PURE__ */ (0,
|
|
17783
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
17623
17784
|
import_ui12.Button,
|
|
17624
17785
|
{
|
|
17625
17786
|
variant: "secondary",
|
|
@@ -17643,13 +17804,13 @@ function BlockCard({ block, editable, onChange, onRemove }) {
|
|
|
17643
17804
|
[field]: value
|
|
17644
17805
|
})
|
|
17645
17806
|
});
|
|
17646
|
-
return /* @__PURE__ */ (0,
|
|
17647
|
-
/* @__PURE__ */ (0,
|
|
17648
|
-
/* @__PURE__ */ (0,
|
|
17649
|
-
editable && /* @__PURE__ */ (0,
|
|
17807
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "lace-panel-validation-block", children: [
|
|
17808
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "lace-panel-row-actions", children: [
|
|
17809
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Identifier, { className: "lace-panel-row-card__name", text: blockTitle(block) }),
|
|
17810
|
+
editable && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
17650
17811
|
import_ui12.IconButton,
|
|
17651
17812
|
{
|
|
17652
|
-
icon: /* @__PURE__ */ (0,
|
|
17813
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(CanvasIcon, { name: "close" }),
|
|
17653
17814
|
"aria-label": `Remove the ${block.type} block`,
|
|
17654
17815
|
size: "md",
|
|
17655
17816
|
tooltipPlacement: "bottom-end",
|
|
@@ -17659,8 +17820,8 @@ function BlockCard({ block, editable, onChange, onRemove }) {
|
|
|
17659
17820
|
] }),
|
|
17660
17821
|
block.attributes.map((attribute, i) => (
|
|
17661
17822
|
// biome-ignore lint/suspicious/noArrayIndexKey: attributes are positional; the render keeps their order
|
|
17662
|
-
/* @__PURE__ */ (0,
|
|
17663
|
-
/* @__PURE__ */ (0,
|
|
17823
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "lace-panel-row-actions lace-panel-row-actions--field", children: [
|
|
17824
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
17664
17825
|
import_ui12.Input,
|
|
17665
17826
|
{
|
|
17666
17827
|
value: attribute.name,
|
|
@@ -17671,7 +17832,7 @@ function BlockCard({ block, editable, onChange, onRemove }) {
|
|
|
17671
17832
|
readOnly: !editable
|
|
17672
17833
|
}
|
|
17673
17834
|
),
|
|
17674
|
-
/* @__PURE__ */ (0,
|
|
17835
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
17675
17836
|
import_ui12.Input,
|
|
17676
17837
|
{
|
|
17677
17838
|
value: attribute.value,
|
|
@@ -17682,10 +17843,10 @@ function BlockCard({ block, editable, onChange, onRemove }) {
|
|
|
17682
17843
|
readOnly: !editable
|
|
17683
17844
|
}
|
|
17684
17845
|
),
|
|
17685
|
-
editable && /* @__PURE__ */ (0,
|
|
17846
|
+
editable && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
17686
17847
|
import_ui12.IconButton,
|
|
17687
17848
|
{
|
|
17688
|
-
icon: /* @__PURE__ */ (0,
|
|
17849
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(CanvasIcon, { name: "close" }),
|
|
17689
17850
|
"aria-label": `Remove ${attribute.name || "the argument"}`,
|
|
17690
17851
|
size: "md",
|
|
17691
17852
|
tooltipPlacement: "bottom-end",
|
|
@@ -17694,7 +17855,7 @@ function BlockCard({ block, editable, onChange, onRemove }) {
|
|
|
17694
17855
|
)
|
|
17695
17856
|
] }, i)
|
|
17696
17857
|
)),
|
|
17697
|
-
editable && /* @__PURE__ */ (0,
|
|
17858
|
+
editable && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
17698
17859
|
import_ui12.Button,
|
|
17699
17860
|
{
|
|
17700
17861
|
variant: "secondary",
|
|
@@ -17703,7 +17864,7 @@ function BlockCard({ block, editable, onChange, onRemove }) {
|
|
|
17703
17864
|
children: "+ Add argument"
|
|
17704
17865
|
}
|
|
17705
17866
|
),
|
|
17706
|
-
(block.blocks.length > 0 || editable) && /* @__PURE__ */ (0,
|
|
17867
|
+
(block.blocks.length > 0 || editable) && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
17707
17868
|
BlockEditor,
|
|
17708
17869
|
{
|
|
17709
17870
|
blocks: block.blocks,
|
|
@@ -17739,7 +17900,7 @@ function firstDuplicate(items, keyFn) {
|
|
|
17739
17900
|
|
|
17740
17901
|
// src/components/panels/LocalsPanel.tsx
|
|
17741
17902
|
var import_panels_shared2 = require("./panels-shared-3HUQC7TC.css");
|
|
17742
|
-
var
|
|
17903
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
17743
17904
|
function toRows(locals) {
|
|
17744
17905
|
return (locals ?? []).map((l) => ({ id: l.name, ...l }));
|
|
17745
17906
|
}
|
|
@@ -17756,10 +17917,10 @@ function LocalsContent({ locals, onSave }) {
|
|
|
17756
17917
|
const updateRow = (index, field, value) => setRows(rows.map((r, i) => i === index ? { ...r, [field]: value } : r));
|
|
17757
17918
|
const nameDupes = findDuplicateIndices(rows, (r) => r.name);
|
|
17758
17919
|
const duplicate = firstDuplicate(rows, (r) => r.name);
|
|
17759
|
-
return /* @__PURE__ */ (0,
|
|
17760
|
-
rows.map((row, i) => /* @__PURE__ */ (0,
|
|
17761
|
-
/* @__PURE__ */ (0,
|
|
17762
|
-
/* @__PURE__ */ (0,
|
|
17920
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
|
|
17921
|
+
rows.map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
|
|
17922
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "lace-panel-row-actions lace-panel-row-actions--field", children: [
|
|
17923
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
17763
17924
|
import_ui13.Input,
|
|
17764
17925
|
{
|
|
17765
17926
|
value: row.name,
|
|
@@ -17772,10 +17933,10 @@ function LocalsContent({ locals, onSave }) {
|
|
|
17772
17933
|
readOnly: !editable
|
|
17773
17934
|
}
|
|
17774
17935
|
),
|
|
17775
|
-
editable && /* @__PURE__ */ (0,
|
|
17936
|
+
editable && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
17776
17937
|
import_ui13.IconButton,
|
|
17777
17938
|
{
|
|
17778
|
-
icon: /* @__PURE__ */ (0,
|
|
17939
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(CanvasIcon, { name: "close" }),
|
|
17779
17940
|
"aria-label": "Remove local",
|
|
17780
17941
|
size: "md",
|
|
17781
17942
|
tooltipPlacement: "bottom-end",
|
|
@@ -17783,8 +17944,8 @@ function LocalsContent({ locals, onSave }) {
|
|
|
17783
17944
|
}
|
|
17784
17945
|
)
|
|
17785
17946
|
] }),
|
|
17786
|
-
nameDupes.has(i) && /* @__PURE__ */ (0,
|
|
17787
|
-
/* @__PURE__ */ (0,
|
|
17947
|
+
nameDupes.has(i) && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "lace-panel-row-error", children: "Duplicate local name" }),
|
|
17948
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "lace-panel-row-content", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
17788
17949
|
import_ui13.Textarea,
|
|
17789
17950
|
{
|
|
17790
17951
|
value: row.value,
|
|
@@ -17798,8 +17959,8 @@ function LocalsContent({ locals, onSave }) {
|
|
|
17798
17959
|
}
|
|
17799
17960
|
) })
|
|
17800
17961
|
] }, row.id)),
|
|
17801
|
-
editable && /* @__PURE__ */ (0,
|
|
17802
|
-
/* @__PURE__ */ (0,
|
|
17962
|
+
editable && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
|
|
17963
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
17803
17964
|
import_ui13.Button,
|
|
17804
17965
|
{
|
|
17805
17966
|
variant: "secondary",
|
|
@@ -17808,7 +17969,7 @@ function LocalsContent({ locals, onSave }) {
|
|
|
17808
17969
|
children: "+ Add local"
|
|
17809
17970
|
}
|
|
17810
17971
|
),
|
|
17811
|
-
/* @__PURE__ */ (0,
|
|
17972
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
17812
17973
|
UpdateButton,
|
|
17813
17974
|
{
|
|
17814
17975
|
draft,
|
|
@@ -17820,13 +17981,13 @@ function LocalsContent({ locals, onSave }) {
|
|
|
17820
17981
|
] });
|
|
17821
17982
|
}
|
|
17822
17983
|
function LocalsPanel({ onClose, ...content }) {
|
|
17823
|
-
return /* @__PURE__ */ (0,
|
|
17984
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_ui13.Panel, { title: "Locals", onClose, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(LocalsContent, { ...content }) });
|
|
17824
17985
|
}
|
|
17825
17986
|
|
|
17826
17987
|
// src/components/panels/ModuleInterfacePanel.tsx
|
|
17827
17988
|
var import_ui14 = require("@lace-cloud/ui");
|
|
17828
17989
|
var import_panels_shared3 = require("./panels-shared-3HUQC7TC.css");
|
|
17829
|
-
var
|
|
17990
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
17830
17991
|
function variablesToRows(variables) {
|
|
17831
17992
|
return variables.map((v) => ({
|
|
17832
17993
|
id: v.name,
|
|
@@ -17958,13 +18119,13 @@ function ModuleInterfaceContent({ settings, onSave }) {
|
|
|
17958
18119
|
const variableDupes = findDuplicateIndices(variables, (v) => v.name);
|
|
17959
18120
|
const outputDupes = findDuplicateIndices(outputs, (o) => o.name);
|
|
17960
18121
|
const exposable = settings.call_outputs.filter((text) => !outputs.some((o) => o.value === text));
|
|
17961
|
-
return /* @__PURE__ */ (0,
|
|
17962
|
-
/* @__PURE__ */ (0,
|
|
17963
|
-
/* @__PURE__ */ (0,
|
|
17964
|
-
variables.length === 0 && /* @__PURE__ */ (0,
|
|
17965
|
-
variables.map((v, i) => /* @__PURE__ */ (0,
|
|
17966
|
-
/* @__PURE__ */ (0,
|
|
17967
|
-
v.added ? /* @__PURE__ */ (0,
|
|
18122
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
|
|
18123
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "lace-panel-hint", children: "The module's public surface: the variables its callers set and the outputs they read." }),
|
|
18124
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("h4", { className: "lace-panel-section-title", children: "Inputs" }),
|
|
18125
|
+
variables.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "lace-panel-hint", children: "No variables." }),
|
|
18126
|
+
variables.map((v, i) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
|
|
18127
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "lace-panel-row-actions lace-panel-row-actions--field", children: [
|
|
18128
|
+
v.added ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
17968
18129
|
import_ui14.Input,
|
|
17969
18130
|
{
|
|
17970
18131
|
label: "Name",
|
|
@@ -17975,11 +18136,11 @@ function ModuleInterfaceContent({ settings, onSave }) {
|
|
|
17975
18136
|
mono: true,
|
|
17976
18137
|
error: variableDupes.has(i)
|
|
17977
18138
|
}
|
|
17978
|
-
) : /* @__PURE__ */ (0,
|
|
17979
|
-
editable && /* @__PURE__ */ (0,
|
|
18139
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Identifier, { className: "lace-panel-row-card__name", text: v.name }),
|
|
18140
|
+
editable && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
17980
18141
|
import_ui14.IconButton,
|
|
17981
18142
|
{
|
|
17982
|
-
icon: /* @__PURE__ */ (0,
|
|
18143
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(CanvasIcon, { name: "close" }),
|
|
17983
18144
|
"aria-label": `Remove variable ${v.name}`,
|
|
17984
18145
|
size: "md",
|
|
17985
18146
|
tooltipPlacement: "bottom-end",
|
|
@@ -17987,8 +18148,8 @@ function ModuleInterfaceContent({ settings, onSave }) {
|
|
|
17987
18148
|
}
|
|
17988
18149
|
)
|
|
17989
18150
|
] }),
|
|
17990
|
-
variableDupes.has(i) && /* @__PURE__ */ (0,
|
|
17991
|
-
/* @__PURE__ */ (0,
|
|
18151
|
+
variableDupes.has(i) && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "lace-panel-row-error", children: "Duplicate variable name" }),
|
|
18152
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
17992
18153
|
import_ui14.Input,
|
|
17993
18154
|
{
|
|
17994
18155
|
label: "Type",
|
|
@@ -18000,8 +18161,8 @@ function ModuleInterfaceContent({ settings, onSave }) {
|
|
|
18000
18161
|
readOnly: !editable
|
|
18001
18162
|
}
|
|
18002
18163
|
) }),
|
|
18003
|
-
v.defaultText && /* @__PURE__ */ (0,
|
|
18004
|
-
/* @__PURE__ */ (0,
|
|
18164
|
+
v.defaultText && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_ui14.Input, { label: "Default", value: v.defaultText, fullWidth: true, mono: true, readOnly: true }) }),
|
|
18165
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "lace-panel-row-content", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18005
18166
|
import_ui14.Textarea,
|
|
18006
18167
|
{
|
|
18007
18168
|
label: "Description",
|
|
@@ -18013,9 +18174,9 @@ function ModuleInterfaceContent({ settings, onSave }) {
|
|
|
18013
18174
|
readOnly: !editable
|
|
18014
18175
|
}
|
|
18015
18176
|
) }),
|
|
18016
|
-
/* @__PURE__ */ (0,
|
|
18017
|
-
/* @__PURE__ */ (0,
|
|
18018
|
-
/* @__PURE__ */ (0,
|
|
18177
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "lace-panel-row-actions", children: [
|
|
18178
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { className: "lace-panel-checkbox-row", children: [
|
|
18179
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18019
18180
|
"input",
|
|
18020
18181
|
{
|
|
18021
18182
|
type: "checkbox",
|
|
@@ -18024,10 +18185,10 @@ function ModuleInterfaceContent({ settings, onSave }) {
|
|
|
18024
18185
|
disabled: !editable
|
|
18025
18186
|
}
|
|
18026
18187
|
),
|
|
18027
|
-
/* @__PURE__ */ (0,
|
|
18188
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: "Required" })
|
|
18028
18189
|
] }),
|
|
18029
|
-
/* @__PURE__ */ (0,
|
|
18030
|
-
/* @__PURE__ */ (0,
|
|
18190
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { className: "lace-panel-checkbox-row", children: [
|
|
18191
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18031
18192
|
"input",
|
|
18032
18193
|
{
|
|
18033
18194
|
type: "checkbox",
|
|
@@ -18036,10 +18197,10 @@ function ModuleInterfaceContent({ settings, onSave }) {
|
|
|
18036
18197
|
disabled: !editable
|
|
18037
18198
|
}
|
|
18038
18199
|
),
|
|
18039
|
-
/* @__PURE__ */ (0,
|
|
18200
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: "Ephemeral" })
|
|
18040
18201
|
] }),
|
|
18041
|
-
/* @__PURE__ */ (0,
|
|
18042
|
-
/* @__PURE__ */ (0,
|
|
18202
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { className: "lace-panel-checkbox-row", children: [
|
|
18203
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18043
18204
|
"input",
|
|
18044
18205
|
{
|
|
18045
18206
|
type: "checkbox",
|
|
@@ -18048,10 +18209,10 @@ function ModuleInterfaceContent({ settings, onSave }) {
|
|
|
18048
18209
|
disabled: !editable
|
|
18049
18210
|
}
|
|
18050
18211
|
),
|
|
18051
|
-
/* @__PURE__ */ (0,
|
|
18212
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: "Sensitive" })
|
|
18052
18213
|
] }),
|
|
18053
|
-
/* @__PURE__ */ (0,
|
|
18054
|
-
/* @__PURE__ */ (0,
|
|
18214
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { className: "lace-panel-checkbox-row", children: [
|
|
18215
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18055
18216
|
"input",
|
|
18056
18217
|
{
|
|
18057
18218
|
type: "checkbox",
|
|
@@ -18060,13 +18221,13 @@ function ModuleInterfaceContent({ settings, onSave }) {
|
|
|
18060
18221
|
disabled: !editable
|
|
18061
18222
|
}
|
|
18062
18223
|
),
|
|
18063
|
-
/* @__PURE__ */ (0,
|
|
18224
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: "Nullable" })
|
|
18064
18225
|
] })
|
|
18065
18226
|
] }),
|
|
18066
|
-
(v.validation.length > 0 || editable) && /* @__PURE__ */ (0,
|
|
18067
|
-
/* @__PURE__ */ (0,
|
|
18068
|
-
v.validation.map((block, j) => /* @__PURE__ */ (0,
|
|
18069
|
-
/* @__PURE__ */ (0,
|
|
18227
|
+
(v.validation.length > 0 || editable) && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "lace-panel-row-content", children: [
|
|
18228
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "lace-panel-subsection-label", children: "Validation" }),
|
|
18229
|
+
v.validation.map((block, j) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "lace-panel-validation-block", children: [
|
|
18230
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18070
18231
|
import_ui14.Input,
|
|
18071
18232
|
{
|
|
18072
18233
|
value: block.condition,
|
|
@@ -18078,7 +18239,7 @@ function ModuleInterfaceContent({ settings, onSave }) {
|
|
|
18078
18239
|
readOnly: !editable
|
|
18079
18240
|
}
|
|
18080
18241
|
),
|
|
18081
|
-
/* @__PURE__ */ (0,
|
|
18242
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18082
18243
|
import_ui14.Input,
|
|
18083
18244
|
{
|
|
18084
18245
|
value: block.error_message,
|
|
@@ -18089,10 +18250,10 @@ function ModuleInterfaceContent({ settings, onSave }) {
|
|
|
18089
18250
|
readOnly: !editable
|
|
18090
18251
|
}
|
|
18091
18252
|
),
|
|
18092
|
-
editable && /* @__PURE__ */ (0,
|
|
18253
|
+
editable && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18093
18254
|
import_ui14.IconButton,
|
|
18094
18255
|
{
|
|
18095
|
-
icon: /* @__PURE__ */ (0,
|
|
18256
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(CanvasIcon, { name: "close" }),
|
|
18096
18257
|
"aria-label": "Remove validation rule",
|
|
18097
18258
|
size: "md",
|
|
18098
18259
|
tooltipPlacement: "bottom-end",
|
|
@@ -18100,15 +18261,15 @@ function ModuleInterfaceContent({ settings, onSave }) {
|
|
|
18100
18261
|
}
|
|
18101
18262
|
)
|
|
18102
18263
|
] }, block.id)),
|
|
18103
|
-
editable && /* @__PURE__ */ (0,
|
|
18264
|
+
editable && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_ui14.Button, { variant: "secondary", size: "sm", onClick: () => addValidation(i), children: "+ Add validation rule" })
|
|
18104
18265
|
] })
|
|
18105
18266
|
] }, v.id)),
|
|
18106
|
-
editable && /* @__PURE__ */ (0,
|
|
18107
|
-
/* @__PURE__ */ (0,
|
|
18108
|
-
outputs.length === 0 && /* @__PURE__ */ (0,
|
|
18109
|
-
outputs.map((o, i) => /* @__PURE__ */ (0,
|
|
18110
|
-
/* @__PURE__ */ (0,
|
|
18111
|
-
/* @__PURE__ */ (0,
|
|
18267
|
+
editable && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_ui14.Button, { variant: "secondary", size: "sm", onClick: addVariable, children: "+ Add variable" }),
|
|
18268
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("h4", { className: "lace-panel-section-title", children: "Outputs" }),
|
|
18269
|
+
outputs.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "lace-panel-hint", children: "No outputs." }),
|
|
18270
|
+
outputs.map((o, i) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
|
|
18271
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "lace-panel-row-actions lace-panel-row-actions--field", children: [
|
|
18272
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18112
18273
|
import_ui14.Input,
|
|
18113
18274
|
{
|
|
18114
18275
|
label: "Name",
|
|
@@ -18121,10 +18282,10 @@ function ModuleInterfaceContent({ settings, onSave }) {
|
|
|
18121
18282
|
error: outputDupes.has(i) || editable && !o.name.trim()
|
|
18122
18283
|
}
|
|
18123
18284
|
),
|
|
18124
|
-
editable && /* @__PURE__ */ (0,
|
|
18285
|
+
editable && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18125
18286
|
import_ui14.IconButton,
|
|
18126
18287
|
{
|
|
18127
|
-
icon: /* @__PURE__ */ (0,
|
|
18288
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(CanvasIcon, { name: "close" }),
|
|
18128
18289
|
"aria-label": `Remove output ${o.name}`,
|
|
18129
18290
|
size: "md",
|
|
18130
18291
|
tooltipPlacement: "bottom-end",
|
|
@@ -18132,7 +18293,7 @@ function ModuleInterfaceContent({ settings, onSave }) {
|
|
|
18132
18293
|
}
|
|
18133
18294
|
)
|
|
18134
18295
|
] }),
|
|
18135
|
-
/* @__PURE__ */ (0,
|
|
18296
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18136
18297
|
import_ui14.Input,
|
|
18137
18298
|
{
|
|
18138
18299
|
label: "Value",
|
|
@@ -18145,7 +18306,7 @@ function ModuleInterfaceContent({ settings, onSave }) {
|
|
|
18145
18306
|
error: editable && !o.value.trim()
|
|
18146
18307
|
}
|
|
18147
18308
|
) }),
|
|
18148
|
-
/* @__PURE__ */ (0,
|
|
18309
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "lace-panel-row-content", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18149
18310
|
import_ui14.Textarea,
|
|
18150
18311
|
{
|
|
18151
18312
|
label: "Description",
|
|
@@ -18157,8 +18318,8 @@ function ModuleInterfaceContent({ settings, onSave }) {
|
|
|
18157
18318
|
readOnly: !editable
|
|
18158
18319
|
}
|
|
18159
18320
|
) }),
|
|
18160
|
-
/* @__PURE__ */ (0,
|
|
18161
|
-
/* @__PURE__ */ (0,
|
|
18321
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { className: "lace-panel-checkbox-row", children: [
|
|
18322
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18162
18323
|
"input",
|
|
18163
18324
|
{
|
|
18164
18325
|
type: "checkbox",
|
|
@@ -18167,12 +18328,12 @@ function ModuleInterfaceContent({ settings, onSave }) {
|
|
|
18167
18328
|
disabled: !editable
|
|
18168
18329
|
}
|
|
18169
18330
|
),
|
|
18170
|
-
/* @__PURE__ */ (0,
|
|
18331
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: "Sensitive" })
|
|
18171
18332
|
] }),
|
|
18172
|
-
(o.depends_on.length > 0 || editable && settings.dependency_options.length > 0) && /* @__PURE__ */ (0,
|
|
18173
|
-
/* @__PURE__ */ (0,
|
|
18174
|
-
!editable ? o.depends_on.map((dep) => /* @__PURE__ */ (0,
|
|
18175
|
-
/* @__PURE__ */ (0,
|
|
18333
|
+
(o.depends_on.length > 0 || editable && settings.dependency_options.length > 0) && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "lace-panel-row-content", children: [
|
|
18334
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "lace-panel-subsection-label", children: "Depends on" }),
|
|
18335
|
+
!editable ? o.depends_on.map((dep) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "lace-panel-depends-item", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Identifier, { text: dep }) }, dep)) : settings.dependency_options.map((dep) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { className: "lace-panel-checkbox-row", children: [
|
|
18336
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18176
18337
|
"input",
|
|
18177
18338
|
{
|
|
18178
18339
|
type: "checkbox",
|
|
@@ -18180,14 +18341,14 @@ function ModuleInterfaceContent({ settings, onSave }) {
|
|
|
18180
18341
|
onChange: () => toggleDependsOn(i, dep)
|
|
18181
18342
|
}
|
|
18182
18343
|
),
|
|
18183
|
-
/* @__PURE__ */ (0,
|
|
18344
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Identifier, { text: dep })
|
|
18184
18345
|
] }, dep))
|
|
18185
18346
|
] }),
|
|
18186
|
-
outputDupes.has(i) && /* @__PURE__ */ (0,
|
|
18347
|
+
outputDupes.has(i) && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "lace-panel-row-error", children: "Output names must be unique." })
|
|
18187
18348
|
] }, o.id)),
|
|
18188
|
-
editable && /* @__PURE__ */ (0,
|
|
18189
|
-
/* @__PURE__ */ (0,
|
|
18190
|
-
exposable.length > 0 && /* @__PURE__ */ (0,
|
|
18349
|
+
editable && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "lace-panel-row-actions", children: [
|
|
18350
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_ui14.Button, { variant: "secondary", size: "sm", onClick: () => addOutput("", ""), children: "+ Add output" }),
|
|
18351
|
+
exposable.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18191
18352
|
import_ui14.Select,
|
|
18192
18353
|
{
|
|
18193
18354
|
"aria-label": "Expose a call's output",
|
|
@@ -18203,7 +18364,7 @@ function ModuleInterfaceContent({ settings, onSave }) {
|
|
|
18203
18364
|
}
|
|
18204
18365
|
)
|
|
18205
18366
|
] }),
|
|
18206
|
-
editable && /* @__PURE__ */ (0,
|
|
18367
|
+
editable && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
18207
18368
|
UpdateButton,
|
|
18208
18369
|
{
|
|
18209
18370
|
draft,
|
|
@@ -18214,7 +18375,7 @@ function ModuleInterfaceContent({ settings, onSave }) {
|
|
|
18214
18375
|
] });
|
|
18215
18376
|
}
|
|
18216
18377
|
function ModuleInterfacePanel({ onClose, ...content }) {
|
|
18217
|
-
return /* @__PURE__ */ (0,
|
|
18378
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_ui14.Panel, { title: "Module Interface", onClose, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ModuleInterfaceContent, { ...content }) });
|
|
18218
18379
|
}
|
|
18219
18380
|
|
|
18220
18381
|
// src/components/panels/module-actions.ts
|
|
@@ -18333,7 +18494,7 @@ var import_panels_shared7 = require("./panels-shared-3HUQC7TC.css");
|
|
|
18333
18494
|
// src/components/panels/ProvidersPanel.tsx
|
|
18334
18495
|
var import_ui15 = require("@lace-cloud/ui");
|
|
18335
18496
|
var import_panels_shared4 = require("./panels-shared-3HUQC7TC.css");
|
|
18336
|
-
var
|
|
18497
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
18337
18498
|
function toRows2(providers) {
|
|
18338
18499
|
if (!providers || providers.length === 0) return [];
|
|
18339
18500
|
return providers.map((p) => ({
|
|
@@ -18384,10 +18545,10 @@ function ProvidersContent({ providers, onSave }) {
|
|
|
18384
18545
|
(c, ei) => ei === entryIndex ? { ...c, [field]: value } : c
|
|
18385
18546
|
)
|
|
18386
18547
|
);
|
|
18387
|
-
return /* @__PURE__ */ (0,
|
|
18388
|
-
rows.map((row, pi) => /* @__PURE__ */ (0,
|
|
18389
|
-
/* @__PURE__ */ (0,
|
|
18390
|
-
/* @__PURE__ */ (0,
|
|
18548
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
|
|
18549
|
+
rows.map((row, pi) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
|
|
18550
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "lace-panel-row-actions lace-panel-row-actions--field", children: [
|
|
18551
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
18391
18552
|
import_ui15.Input,
|
|
18392
18553
|
{
|
|
18393
18554
|
value: row.name,
|
|
@@ -18397,7 +18558,7 @@ function ProvidersContent({ providers, onSave }) {
|
|
|
18397
18558
|
readOnly: !editable
|
|
18398
18559
|
}
|
|
18399
18560
|
),
|
|
18400
|
-
/* @__PURE__ */ (0,
|
|
18561
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
18401
18562
|
import_ui15.Input,
|
|
18402
18563
|
{
|
|
18403
18564
|
value: row.alias,
|
|
@@ -18407,10 +18568,10 @@ function ProvidersContent({ providers, onSave }) {
|
|
|
18407
18568
|
readOnly: !editable
|
|
18408
18569
|
}
|
|
18409
18570
|
),
|
|
18410
|
-
editable && /* @__PURE__ */ (0,
|
|
18571
|
+
editable && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
18411
18572
|
import_ui15.IconButton,
|
|
18412
18573
|
{
|
|
18413
|
-
icon: /* @__PURE__ */ (0,
|
|
18574
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(CanvasIcon, { name: "close" }),
|
|
18414
18575
|
"aria-label": "Remove provider",
|
|
18415
18576
|
size: "md",
|
|
18416
18577
|
tooltipPlacement: "bottom-end",
|
|
@@ -18418,9 +18579,9 @@ function ProvidersContent({ providers, onSave }) {
|
|
|
18418
18579
|
}
|
|
18419
18580
|
)
|
|
18420
18581
|
] }),
|
|
18421
|
-
/* @__PURE__ */ (0,
|
|
18422
|
-
row.configEntries.map((entry, ei) => /* @__PURE__ */ (0,
|
|
18423
|
-
/* @__PURE__ */ (0,
|
|
18582
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "lace-panel-row-sublabel", children: "Config" }),
|
|
18583
|
+
row.configEntries.map((entry, ei) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "lace-panel-row-actions lace-panel-row-actions--field", children: [
|
|
18584
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
18424
18585
|
import_ui15.Input,
|
|
18425
18586
|
{
|
|
18426
18587
|
value: entry.key,
|
|
@@ -18430,7 +18591,7 @@ function ProvidersContent({ providers, onSave }) {
|
|
|
18430
18591
|
readOnly: !editable
|
|
18431
18592
|
}
|
|
18432
18593
|
),
|
|
18433
|
-
/* @__PURE__ */ (0,
|
|
18594
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
18434
18595
|
import_ui15.Input,
|
|
18435
18596
|
{
|
|
18436
18597
|
value: entry.value,
|
|
@@ -18440,10 +18601,10 @@ function ProvidersContent({ providers, onSave }) {
|
|
|
18440
18601
|
readOnly: !editable
|
|
18441
18602
|
}
|
|
18442
18603
|
),
|
|
18443
|
-
editable && /* @__PURE__ */ (0,
|
|
18604
|
+
editable && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
18444
18605
|
import_ui15.IconButton,
|
|
18445
18606
|
{
|
|
18446
|
-
icon: /* @__PURE__ */ (0,
|
|
18607
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(CanvasIcon, { name: "close" }),
|
|
18447
18608
|
"aria-label": "Remove config key",
|
|
18448
18609
|
size: "md",
|
|
18449
18610
|
tooltipPlacement: "bottom-end",
|
|
@@ -18454,7 +18615,7 @@ function ProvidersContent({ providers, onSave }) {
|
|
|
18454
18615
|
}
|
|
18455
18616
|
)
|
|
18456
18617
|
] }, entry.id)),
|
|
18457
|
-
editable && /* @__PURE__ */ (0,
|
|
18618
|
+
editable && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
18458
18619
|
import_ui15.Button,
|
|
18459
18620
|
{
|
|
18460
18621
|
variant: "secondary",
|
|
@@ -18466,9 +18627,9 @@ function ProvidersContent({ providers, onSave }) {
|
|
|
18466
18627
|
children: "+ Add config key"
|
|
18467
18628
|
}
|
|
18468
18629
|
),
|
|
18469
|
-
(row.blocks.length > 0 || editable) && /* @__PURE__ */ (0,
|
|
18470
|
-
/* @__PURE__ */ (0,
|
|
18471
|
-
/* @__PURE__ */ (0,
|
|
18630
|
+
(row.blocks.length > 0 || editable) && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
|
|
18631
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "lace-panel-row-sublabel", children: "Nested blocks" }),
|
|
18632
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
18472
18633
|
BlockEditor,
|
|
18473
18634
|
{
|
|
18474
18635
|
blocks: row.blocks,
|
|
@@ -18478,21 +18639,21 @@ function ProvidersContent({ providers, onSave }) {
|
|
|
18478
18639
|
)
|
|
18479
18640
|
] })
|
|
18480
18641
|
] }, row.id)),
|
|
18481
|
-
editable && /* @__PURE__ */ (0,
|
|
18482
|
-
/* @__PURE__ */ (0,
|
|
18483
|
-
/* @__PURE__ */ (0,
|
|
18642
|
+
editable && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
|
|
18643
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_ui15.Button, { variant: "secondary", size: "sm", onClick: addProvider, children: "+ Add provider" }),
|
|
18644
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(UpdateButton, { draft, label: "Update providers" })
|
|
18484
18645
|
] })
|
|
18485
18646
|
] });
|
|
18486
18647
|
}
|
|
18487
18648
|
function ProvidersPanel({ providers, onSave, onClose }) {
|
|
18488
|
-
return /* @__PURE__ */ (0,
|
|
18649
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_ui15.Panel, { title: "Providers", onClose, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ProvidersContent, { providers, onSave }) });
|
|
18489
18650
|
}
|
|
18490
18651
|
|
|
18491
18652
|
// src/components/panels/ResourcesPanel.tsx
|
|
18492
18653
|
var import_ui16 = require("@lace-cloud/ui");
|
|
18493
|
-
var
|
|
18654
|
+
var import_react37 = require("react");
|
|
18494
18655
|
var import_panels_shared5 = require("./panels-shared-3HUQC7TC.css");
|
|
18495
|
-
var
|
|
18656
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
18496
18657
|
function ResourcesContent({
|
|
18497
18658
|
resources,
|
|
18498
18659
|
dependencyOptions,
|
|
@@ -18502,9 +18663,9 @@ function ResourcesContent({
|
|
|
18502
18663
|
onAdd
|
|
18503
18664
|
}) {
|
|
18504
18665
|
const { editable } = useCanvas();
|
|
18505
|
-
return /* @__PURE__ */ (0,
|
|
18506
|
-
resources.length === 0 && /* @__PURE__ */ (0,
|
|
18507
|
-
resources.map((resource) => /* @__PURE__ */ (0,
|
|
18666
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
|
|
18667
|
+
resources.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "lace-panel-hint", children: "No resources or data sources." }),
|
|
18668
|
+
resources.map((resource) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
18508
18669
|
ResourceCard,
|
|
18509
18670
|
{
|
|
18510
18671
|
resource,
|
|
@@ -18517,7 +18678,7 @@ function ResourcesContent({
|
|
|
18517
18678
|
},
|
|
18518
18679
|
resource.id
|
|
18519
18680
|
)),
|
|
18520
|
-
editable && /* @__PURE__ */ (0,
|
|
18681
|
+
editable && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(NewResourceRow, { managed, onAdd })
|
|
18521
18682
|
] });
|
|
18522
18683
|
}
|
|
18523
18684
|
var MANAGED_OPTION = { value: "resource", label: "Resource" };
|
|
@@ -18527,14 +18688,14 @@ function NewResourceRow({
|
|
|
18527
18688
|
onAdd
|
|
18528
18689
|
}) {
|
|
18529
18690
|
const options = managed ? [MANAGED_OPTION, DATA_OPTION] : [DATA_OPTION];
|
|
18530
|
-
const [chosen, setChosen] = (0,
|
|
18691
|
+
const [chosen, setChosen] = (0, import_react37.useState)("resource");
|
|
18531
18692
|
const kind = managed ? chosen : "data";
|
|
18532
|
-
const [type, setType] = (0,
|
|
18533
|
-
const [name, setName] = (0,
|
|
18534
|
-
return /* @__PURE__ */ (0,
|
|
18535
|
-
/* @__PURE__ */ (0,
|
|
18536
|
-
/* @__PURE__ */ (0,
|
|
18537
|
-
/* @__PURE__ */ (0,
|
|
18693
|
+
const [type, setType] = (0, import_react37.useState)("");
|
|
18694
|
+
const [name, setName] = (0, import_react37.useState)("");
|
|
18695
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "lace-panel-row-card", children: [
|
|
18696
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "lace-panel-subsection-label", children: "Add a resource" }),
|
|
18697
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "lace-panel-row-actions", children: [
|
|
18698
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
18538
18699
|
import_ui16.Select,
|
|
18539
18700
|
{
|
|
18540
18701
|
"aria-label": "New resource kind",
|
|
@@ -18543,7 +18704,7 @@ function NewResourceRow({
|
|
|
18543
18704
|
onChange: (e) => setChosen(e.target.value === "data" ? "data" : "resource")
|
|
18544
18705
|
}
|
|
18545
18706
|
),
|
|
18546
|
-
/* @__PURE__ */ (0,
|
|
18707
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
18547
18708
|
import_ui16.Input,
|
|
18548
18709
|
{
|
|
18549
18710
|
value: type,
|
|
@@ -18553,7 +18714,7 @@ function NewResourceRow({
|
|
|
18553
18714
|
mono: true
|
|
18554
18715
|
}
|
|
18555
18716
|
),
|
|
18556
|
-
/* @__PURE__ */ (0,
|
|
18717
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
18557
18718
|
import_ui16.Input,
|
|
18558
18719
|
{
|
|
18559
18720
|
value: name,
|
|
@@ -18563,7 +18724,7 @@ function NewResourceRow({
|
|
|
18563
18724
|
mono: true
|
|
18564
18725
|
}
|
|
18565
18726
|
),
|
|
18566
|
-
/* @__PURE__ */ (0,
|
|
18727
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
18567
18728
|
import_ui16.Button,
|
|
18568
18729
|
{
|
|
18569
18730
|
variant: "secondary",
|
|
@@ -18599,20 +18760,20 @@ function ResourceCard({ resource, dependencyOptions, editable, onUpdate, onRemov
|
|
|
18599
18760
|
{ field: "for_each", placeholder: "e.g. var.names" },
|
|
18600
18761
|
{ field: "provider", placeholder: "e.g. aws.west" }
|
|
18601
18762
|
];
|
|
18602
|
-
return /* @__PURE__ */ (0,
|
|
18603
|
-
/* @__PURE__ */ (0,
|
|
18604
|
-
/* @__PURE__ */ (0,
|
|
18605
|
-
/* @__PURE__ */ (0,
|
|
18763
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
|
|
18764
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "lace-panel-row-actions", children: [
|
|
18765
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_ui16.Badge, { variant: resource.kind === "data" ? "info" : "neutral", children: resource.kind === "data" ? "data" : "resource" }),
|
|
18766
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
18606
18767
|
Identifier,
|
|
18607
18768
|
{
|
|
18608
18769
|
className: "lace-panel-row-card__name",
|
|
18609
18770
|
text: `${resource.type}.${resource.name}`
|
|
18610
18771
|
}
|
|
18611
18772
|
),
|
|
18612
|
-
editable && /* @__PURE__ */ (0,
|
|
18773
|
+
editable && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
18613
18774
|
import_ui16.IconButton,
|
|
18614
18775
|
{
|
|
18615
|
-
icon: /* @__PURE__ */ (0,
|
|
18776
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(CanvasIcon, { name: "close" }),
|
|
18616
18777
|
"aria-label": `Remove ${resource.type}.${resource.name}`,
|
|
18617
18778
|
size: "md",
|
|
18618
18779
|
tooltipPlacement: "bottom-end",
|
|
@@ -18621,7 +18782,7 @@ function ResourceCard({ resource, dependencyOptions, editable, onUpdate, onRemov
|
|
|
18621
18782
|
)
|
|
18622
18783
|
] }),
|
|
18623
18784
|
metaArguments.map(
|
|
18624
|
-
({ field, placeholder }) => draft[field] || editable ? /* @__PURE__ */ (0,
|
|
18785
|
+
({ field, placeholder }) => draft[field] || editable ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
18625
18786
|
import_ui16.Input,
|
|
18626
18787
|
{
|
|
18627
18788
|
label: field,
|
|
@@ -18634,11 +18795,11 @@ function ResourceCard({ resource, dependencyOptions, editable, onUpdate, onRemov
|
|
|
18634
18795
|
}
|
|
18635
18796
|
) }, field) : null
|
|
18636
18797
|
),
|
|
18637
|
-
/* @__PURE__ */ (0,
|
|
18798
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "lace-panel-row-sublabel", children: "Arguments" }),
|
|
18638
18799
|
draft.arguments.map((argument, i) => (
|
|
18639
18800
|
// biome-ignore lint/suspicious/noArrayIndexKey: argument rows are positional while edited
|
|
18640
|
-
/* @__PURE__ */ (0,
|
|
18641
|
-
/* @__PURE__ */ (0,
|
|
18801
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "lace-panel-row-actions lace-panel-row-actions--field", children: [
|
|
18802
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
18642
18803
|
import_ui16.Input,
|
|
18643
18804
|
{
|
|
18644
18805
|
value: argument.name,
|
|
@@ -18650,7 +18811,7 @@ function ResourceCard({ resource, dependencyOptions, editable, onUpdate, onRemov
|
|
|
18650
18811
|
error: argumentDupes.has(i)
|
|
18651
18812
|
}
|
|
18652
18813
|
),
|
|
18653
|
-
/* @__PURE__ */ (0,
|
|
18814
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
18654
18815
|
import_ui16.Input,
|
|
18655
18816
|
{
|
|
18656
18817
|
value: argument.value,
|
|
@@ -18661,10 +18822,10 @@ function ResourceCard({ resource, dependencyOptions, editable, onUpdate, onRemov
|
|
|
18661
18822
|
readOnly: !editable
|
|
18662
18823
|
}
|
|
18663
18824
|
),
|
|
18664
|
-
editable && /* @__PURE__ */ (0,
|
|
18825
|
+
editable && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
18665
18826
|
import_ui16.IconButton,
|
|
18666
18827
|
{
|
|
18667
|
-
icon: /* @__PURE__ */ (0,
|
|
18828
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(CanvasIcon, { name: "close" }),
|
|
18668
18829
|
"aria-label": `Remove ${argument.name || "the argument"}`,
|
|
18669
18830
|
size: "md",
|
|
18670
18831
|
tooltipPlacement: "bottom-end",
|
|
@@ -18676,7 +18837,7 @@ function ResourceCard({ resource, dependencyOptions, editable, onUpdate, onRemov
|
|
|
18676
18837
|
)
|
|
18677
18838
|
] }, i)
|
|
18678
18839
|
)),
|
|
18679
|
-
editable && /* @__PURE__ */ (0,
|
|
18840
|
+
editable && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
18680
18841
|
import_ui16.Button,
|
|
18681
18842
|
{
|
|
18682
18843
|
variant: "secondary",
|
|
@@ -18685,9 +18846,9 @@ function ResourceCard({ resource, dependencyOptions, editable, onUpdate, onRemov
|
|
|
18685
18846
|
children: "+ Add argument"
|
|
18686
18847
|
}
|
|
18687
18848
|
),
|
|
18688
|
-
(draft.blocks.length > 0 || editable) && /* @__PURE__ */ (0,
|
|
18689
|
-
/* @__PURE__ */ (0,
|
|
18690
|
-
/* @__PURE__ */ (0,
|
|
18849
|
+
(draft.blocks.length > 0 || editable) && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
|
|
18850
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "lace-panel-row-sublabel", children: "Nested blocks" }),
|
|
18851
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
18691
18852
|
BlockEditor,
|
|
18692
18853
|
{
|
|
18693
18854
|
blocks: draft.blocks,
|
|
@@ -18696,10 +18857,10 @@ function ResourceCard({ resource, dependencyOptions, editable, onUpdate, onRemov
|
|
|
18696
18857
|
}
|
|
18697
18858
|
)
|
|
18698
18859
|
] }),
|
|
18699
|
-
(draft.depends_on.length > 0 || editable && dependencyOptions.length > 0) && /* @__PURE__ */ (0,
|
|
18700
|
-
/* @__PURE__ */ (0,
|
|
18701
|
-
!editable ? draft.depends_on.map((dep) => /* @__PURE__ */ (0,
|
|
18702
|
-
/* @__PURE__ */ (0,
|
|
18860
|
+
(draft.depends_on.length > 0 || editable && dependencyOptions.length > 0) && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
|
|
18861
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "lace-panel-row-sublabel", children: "Depends on" }),
|
|
18862
|
+
!editable ? draft.depends_on.map((dep) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "lace-panel-depends-item", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Identifier, { text: dep }) }, dep)) : dependencyOptions.map((dep) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("label", { className: "lace-panel-checkbox-row", children: [
|
|
18863
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
18703
18864
|
"input",
|
|
18704
18865
|
{
|
|
18705
18866
|
type: "checkbox",
|
|
@@ -18710,10 +18871,10 @@ function ResourceCard({ resource, dependencyOptions, editable, onUpdate, onRemov
|
|
|
18710
18871
|
)
|
|
18711
18872
|
}
|
|
18712
18873
|
),
|
|
18713
|
-
/* @__PURE__ */ (0,
|
|
18874
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Identifier, { text: dep })
|
|
18714
18875
|
] }, dep))
|
|
18715
18876
|
] }),
|
|
18716
|
-
editable && /* @__PURE__ */ (0,
|
|
18877
|
+
editable && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
18717
18878
|
UpdateButton,
|
|
18718
18879
|
{
|
|
18719
18880
|
draft: card,
|
|
@@ -18727,7 +18888,7 @@ function ResourceCard({ resource, dependencyOptions, editable, onUpdate, onRemov
|
|
|
18727
18888
|
// src/components/panels/TerraformConfigPanel.tsx
|
|
18728
18889
|
var import_ui17 = require("@lace-cloud/ui");
|
|
18729
18890
|
var import_panels_shared6 = require("./panels-shared-3HUQC7TC.css");
|
|
18730
|
-
var
|
|
18891
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
18731
18892
|
function toRows3(terraform) {
|
|
18732
18893
|
return (terraform?.required_providers ?? []).map((req) => ({
|
|
18733
18894
|
id: req.name,
|
|
@@ -18759,9 +18920,9 @@ function TerraformConfigContent({ terraform, onSave }) {
|
|
|
18759
18920
|
const { requiredVersion, providers } = draft.value;
|
|
18760
18921
|
const setProviders2 = (next) => draft.set("providers", next);
|
|
18761
18922
|
const updateProvider = (index, field, value) => setProviders2(providers.map((p, i) => i === index ? { ...p, [field]: value } : p));
|
|
18762
|
-
return /* @__PURE__ */ (0,
|
|
18763
|
-
/* @__PURE__ */ (0,
|
|
18764
|
-
/* @__PURE__ */ (0,
|
|
18923
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
|
|
18924
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("h4", { className: "lace-panel-section-title", children: "Required Version" }),
|
|
18925
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "lace-panel-field", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
18765
18926
|
import_ui17.Input,
|
|
18766
18927
|
{
|
|
18767
18928
|
value: requiredVersion,
|
|
@@ -18771,10 +18932,10 @@ function TerraformConfigContent({ terraform, onSave }) {
|
|
|
18771
18932
|
readOnly: !editable
|
|
18772
18933
|
}
|
|
18773
18934
|
) }),
|
|
18774
|
-
/* @__PURE__ */ (0,
|
|
18775
|
-
providers.map((p, i) => /* @__PURE__ */ (0,
|
|
18776
|
-
/* @__PURE__ */ (0,
|
|
18777
|
-
/* @__PURE__ */ (0,
|
|
18935
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("h4", { className: "lace-panel-section-title", children: "Required Providers" }),
|
|
18936
|
+
providers.map((p, i) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
|
|
18937
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "lace-panel-row-actions lace-panel-row-actions--field", children: [
|
|
18938
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
18778
18939
|
import_ui17.Input,
|
|
18779
18940
|
{
|
|
18780
18941
|
value: p.name,
|
|
@@ -18784,10 +18945,10 @@ function TerraformConfigContent({ terraform, onSave }) {
|
|
|
18784
18945
|
readOnly: !editable
|
|
18785
18946
|
}
|
|
18786
18947
|
),
|
|
18787
|
-
editable && /* @__PURE__ */ (0,
|
|
18948
|
+
editable && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
18788
18949
|
import_ui17.IconButton,
|
|
18789
18950
|
{
|
|
18790
|
-
icon: /* @__PURE__ */ (0,
|
|
18951
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(CanvasIcon, { name: "close" }),
|
|
18791
18952
|
"aria-label": "Remove provider",
|
|
18792
18953
|
size: "md",
|
|
18793
18954
|
tooltipPlacement: "bottom-end",
|
|
@@ -18795,7 +18956,7 @@ function TerraformConfigContent({ terraform, onSave }) {
|
|
|
18795
18956
|
}
|
|
18796
18957
|
)
|
|
18797
18958
|
] }),
|
|
18798
|
-
/* @__PURE__ */ (0,
|
|
18959
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
18799
18960
|
import_ui17.Input,
|
|
18800
18961
|
{
|
|
18801
18962
|
value: p.source,
|
|
@@ -18805,7 +18966,7 @@ function TerraformConfigContent({ terraform, onSave }) {
|
|
|
18805
18966
|
readOnly: !editable
|
|
18806
18967
|
}
|
|
18807
18968
|
) }),
|
|
18808
|
-
/* @__PURE__ */ (0,
|
|
18969
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
18809
18970
|
import_ui17.Input,
|
|
18810
18971
|
{
|
|
18811
18972
|
value: p.version,
|
|
@@ -18815,7 +18976,7 @@ function TerraformConfigContent({ terraform, onSave }) {
|
|
|
18815
18976
|
readOnly: !editable
|
|
18816
18977
|
}
|
|
18817
18978
|
) }),
|
|
18818
|
-
(p.aliases || editable) && /* @__PURE__ */ (0,
|
|
18979
|
+
(p.aliases || editable) && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
18819
18980
|
import_ui17.Input,
|
|
18820
18981
|
{
|
|
18821
18982
|
value: p.aliases,
|
|
@@ -18828,7 +18989,7 @@ function TerraformConfigContent({ terraform, onSave }) {
|
|
|
18828
18989
|
}
|
|
18829
18990
|
) })
|
|
18830
18991
|
] }, p.id)),
|
|
18831
|
-
editable && /* @__PURE__ */ (0,
|
|
18992
|
+
editable && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
18832
18993
|
import_ui17.Button,
|
|
18833
18994
|
{
|
|
18834
18995
|
variant: "secondary",
|
|
@@ -18840,37 +19001,37 @@ function TerraformConfigContent({ terraform, onSave }) {
|
|
|
18840
19001
|
children: "+ Add provider"
|
|
18841
19002
|
}
|
|
18842
19003
|
),
|
|
18843
|
-
/* @__PURE__ */ (0,
|
|
18844
|
-
/* @__PURE__ */ (0,
|
|
18845
|
-
editable && /* @__PURE__ */ (0,
|
|
19004
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("h4", { className: "lace-panel-section-title", children: "Backend" }),
|
|
19005
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "lace-panel-hint", children: "Terraform state is managed by Lace Cloud. The HTTP backend is configured automatically during generation." }),
|
|
19006
|
+
editable && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(UpdateButton, { draft, label: "Update terraform block" })
|
|
18846
19007
|
] });
|
|
18847
19008
|
}
|
|
18848
19009
|
function TerraformConfigPanel({ terraform, onSave, onClose }) {
|
|
18849
|
-
return /* @__PURE__ */ (0,
|
|
19010
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_ui17.Panel, { title: "Terraform Configuration", onClose, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TerraformConfigContent, { terraform, onSave }) });
|
|
18850
19011
|
}
|
|
18851
19012
|
|
|
18852
19013
|
// src/components/panels/ModuleDetails.tsx
|
|
18853
|
-
var
|
|
19014
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
18854
19015
|
function assertApplied(result) {
|
|
18855
19016
|
if (!result?.success) throw new Error("apply failed");
|
|
18856
19017
|
}
|
|
18857
19018
|
var sectionKey = (moduleKey, section) => `${moduleKey}:${section}`;
|
|
18858
19019
|
function ModuleDetails({ moduleKey, open = [] }) {
|
|
18859
19020
|
const { bundle, runner } = useCanvas();
|
|
18860
|
-
const settings = (0,
|
|
19021
|
+
const settings = (0, import_react38.useMemo)(() => (0, import_proto14.deriveSettingsConfig)(bundle, moduleKey), [bundle, moduleKey]);
|
|
18861
19022
|
if (!settings) return null;
|
|
18862
|
-
if (settings.reference) return /* @__PURE__ */ (0,
|
|
19023
|
+
if (settings.reference) return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(ReferenceDetails, { settings });
|
|
18863
19024
|
const apply2 = async (actions) => {
|
|
18864
19025
|
assertApplied(await runner.apply(actions));
|
|
18865
19026
|
};
|
|
18866
|
-
return /* @__PURE__ */ (0,
|
|
18867
|
-
/* @__PURE__ */ (0,
|
|
19027
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
|
|
19028
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
18868
19029
|
AccordionSection,
|
|
18869
19030
|
{
|
|
18870
19031
|
title: "Resources",
|
|
18871
19032
|
defaultOpen: open.includes("Resources"),
|
|
18872
19033
|
badge: `(${settings.resources.length})`,
|
|
18873
|
-
children: /* @__PURE__ */ (0,
|
|
19034
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
18874
19035
|
ResourcesContent,
|
|
18875
19036
|
{
|
|
18876
19037
|
resources: settings.resources,
|
|
@@ -18884,7 +19045,7 @@ function ModuleDetails({ moduleKey, open = [] }) {
|
|
|
18884
19045
|
)
|
|
18885
19046
|
}
|
|
18886
19047
|
),
|
|
18887
|
-
/* @__PURE__ */ (0,
|
|
19048
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(AccordionSection, { title: "Interface", defaultOpen: open.includes("Interface"), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
18888
19049
|
ModuleInterfaceContent,
|
|
18889
19050
|
{
|
|
18890
19051
|
settings,
|
|
@@ -18892,13 +19053,13 @@ function ModuleDetails({ moduleKey, open = [] }) {
|
|
|
18892
19053
|
},
|
|
18893
19054
|
sectionKey(moduleKey, "Interface")
|
|
18894
19055
|
) }),
|
|
18895
|
-
/* @__PURE__ */ (0,
|
|
19056
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
18896
19057
|
AccordionSection,
|
|
18897
19058
|
{
|
|
18898
19059
|
title: "Moved and import blocks",
|
|
18899
19060
|
defaultOpen: open.includes("Moved and import blocks"),
|
|
18900
19061
|
badge: settings.directives.length > 0 ? `(${settings.directives.length})` : void 0,
|
|
18901
|
-
children: /* @__PURE__ */ (0,
|
|
19062
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
18902
19063
|
DirectivesContent,
|
|
18903
19064
|
{
|
|
18904
19065
|
directives: settings.directives,
|
|
@@ -18908,7 +19069,7 @@ function ModuleDetails({ moduleKey, open = [] }) {
|
|
|
18908
19069
|
)
|
|
18909
19070
|
}
|
|
18910
19071
|
),
|
|
18911
|
-
/* @__PURE__ */ (0,
|
|
19072
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(AccordionSection, { title: "Locals", defaultOpen: open.includes("Locals"), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
18912
19073
|
LocalsContent,
|
|
18913
19074
|
{
|
|
18914
19075
|
locals: settings.locals,
|
|
@@ -18916,7 +19077,7 @@ function ModuleDetails({ moduleKey, open = [] }) {
|
|
|
18916
19077
|
},
|
|
18917
19078
|
sectionKey(moduleKey, "Locals")
|
|
18918
19079
|
) }),
|
|
18919
|
-
/* @__PURE__ */ (0,
|
|
19080
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(AccordionSection, { title: "Providers", defaultOpen: open.includes("Providers"), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
18920
19081
|
ProvidersContent,
|
|
18921
19082
|
{
|
|
18922
19083
|
providers: settings.providers,
|
|
@@ -18924,7 +19085,7 @@ function ModuleDetails({ moduleKey, open = [] }) {
|
|
|
18924
19085
|
},
|
|
18925
19086
|
sectionKey(moduleKey, "Providers")
|
|
18926
19087
|
) }),
|
|
18927
|
-
/* @__PURE__ */ (0,
|
|
19088
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(AccordionSection, { title: "Terraform Config", defaultOpen: open.includes("Terraform Config"), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
18928
19089
|
TerraformConfigContent,
|
|
18929
19090
|
{
|
|
18930
19091
|
terraform: settings.terraform,
|
|
@@ -18941,9 +19102,9 @@ function DirectivesContent({
|
|
|
18941
19102
|
const { editable } = useCanvas();
|
|
18942
19103
|
const draft = useDraft({ blocks: directives }, ({ blocks: blocks2 }) => onSave(blocks2));
|
|
18943
19104
|
const { blocks } = draft.value;
|
|
18944
|
-
return /* @__PURE__ */ (0,
|
|
18945
|
-
blocks.length === 0 && /* @__PURE__ */ (0,
|
|
18946
|
-
/* @__PURE__ */ (0,
|
|
19105
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
|
|
19106
|
+
blocks.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "lace-panel-hint", children: "No moved or import blocks." }),
|
|
19107
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
18947
19108
|
BlockEditor,
|
|
18948
19109
|
{
|
|
18949
19110
|
blocks,
|
|
@@ -18955,32 +19116,32 @@ function DirectivesContent({
|
|
|
18955
19116
|
]
|
|
18956
19117
|
}
|
|
18957
19118
|
),
|
|
18958
|
-
editable && /* @__PURE__ */ (0,
|
|
19119
|
+
editable && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(UpdateButton, { draft, label: "Update moved and import blocks" })
|
|
18959
19120
|
] });
|
|
18960
19121
|
}
|
|
18961
19122
|
function ReferenceDetails({ settings }) {
|
|
18962
19123
|
const reference = settings.reference;
|
|
18963
19124
|
if (!reference) return null;
|
|
18964
|
-
return /* @__PURE__ */ (0,
|
|
18965
|
-
/* @__PURE__ */ (0,
|
|
18966
|
-
/* @__PURE__ */ (0,
|
|
18967
|
-
/* @__PURE__ */ (0,
|
|
18968
|
-
/* @__PURE__ */ (0,
|
|
18969
|
-
/* @__PURE__ */ (0,
|
|
19125
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
|
|
19126
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(AccordionSection, { title: "Source", defaultOpen: true, children: [
|
|
19127
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "lace-panel-hint", children: "A reference: Lace reads it where its source points and never edits it." }),
|
|
19128
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "lace-panel-row-actions lace-panel-row-actions--stacked", children: [
|
|
19129
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_ui18.Input, { label: "Source", value: reference.source, fullWidth: true, mono: true, readOnly: true }),
|
|
19130
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_ui18.Input, { label: "Version", value: reference.version, fullWidth: true, mono: true, readOnly: true })
|
|
18970
19131
|
] })
|
|
18971
19132
|
] }),
|
|
18972
|
-
/* @__PURE__ */ (0,
|
|
18973
|
-
/* @__PURE__ */ (0,
|
|
18974
|
-
settings.variables.length === 0 && /* @__PURE__ */ (0,
|
|
18975
|
-
settings.variables.map((v) => /* @__PURE__ */ (0,
|
|
18976
|
-
/* @__PURE__ */ (0,
|
|
18977
|
-
settings.outputs.map((o) => /* @__PURE__ */ (0,
|
|
19133
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(AccordionSection, { title: "Interface", defaultOpen: true, children: [
|
|
19134
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("h4", { className: "lace-panel-section-title", children: "Inputs" }),
|
|
19135
|
+
settings.variables.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "lace-panel-hint", children: "The IR holds no interface for this reference." }),
|
|
19136
|
+
settings.variables.map((v) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "lace-panel-depends-item", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Identifier, { text: `${typedName(v.name, v.type)}${v.required ? " (required)" : ""}` }) }, v.name)),
|
|
19137
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("h4", { className: "lace-panel-section-title", children: "Outputs" }),
|
|
19138
|
+
settings.outputs.map((o) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "lace-panel-depends-item", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Identifier, { text: typedName(o.name, o.type) }) }, o.name))
|
|
18978
19139
|
] })
|
|
18979
19140
|
] });
|
|
18980
19141
|
}
|
|
18981
19142
|
|
|
18982
19143
|
// src/components/panels/ModuleConfigPanel.tsx
|
|
18983
|
-
var
|
|
19144
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
18984
19145
|
var MODE_ITEMS = [
|
|
18985
19146
|
{ value: "empty", label: "Unset" },
|
|
18986
19147
|
{ value: "literal", label: "Lit" },
|
|
@@ -19084,12 +19245,12 @@ function callActions(config, address, fields) {
|
|
|
19084
19245
|
}
|
|
19085
19246
|
function ModuleConfigPanel({ instance_id, onClose }) {
|
|
19086
19247
|
const { editable, bundle, runner } = useCanvas();
|
|
19087
|
-
const config = (0,
|
|
19248
|
+
const config = (0, import_react39.useMemo)(
|
|
19088
19249
|
() => (0, import_proto15.deriveNodeConfig)(bundle, instance_id),
|
|
19089
19250
|
[bundle, instance_id]
|
|
19090
19251
|
);
|
|
19091
|
-
const address = (0,
|
|
19092
|
-
const seed = (0,
|
|
19252
|
+
const address = (0, import_react39.useMemo)(() => (0, import_proto15.instanceAddress)(bundle, instance_id), [bundle, instance_id]);
|
|
19253
|
+
const seed = (0, import_react39.useMemo)(() => callFields(config), [config]);
|
|
19093
19254
|
const draft = useDraft(seed, async (fields2) => {
|
|
19094
19255
|
if (!config) throw new Error(`no instance ${instance_id} to update`);
|
|
19095
19256
|
const result = await runner.apply(callActions(config, address, fields2));
|
|
@@ -19109,7 +19270,7 @@ function ModuleConfigPanel({ instance_id, onClose }) {
|
|
|
19109
19270
|
value: mode === "literal" ? current.value ?? blankLiteral(input) : current.value
|
|
19110
19271
|
});
|
|
19111
19272
|
};
|
|
19112
|
-
const { requiredInputs, optionalInputs } = (0,
|
|
19273
|
+
const { requiredInputs, optionalInputs } = (0, import_react39.useMemo)(
|
|
19113
19274
|
() => ({
|
|
19114
19275
|
requiredInputs: (config?.inputs ?? []).filter((i) => i.required),
|
|
19115
19276
|
optionalInputs: (config?.inputs ?? []).filter((i) => !i.required)
|
|
@@ -19125,7 +19286,7 @@ function ModuleConfigPanel({ instance_id, onClose }) {
|
|
|
19125
19286
|
...m,
|
|
19126
19287
|
disabled: !editable || m.value === "wired" || currentMode === "wired"
|
|
19127
19288
|
}));
|
|
19128
|
-
return /* @__PURE__ */ (0,
|
|
19289
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
19129
19290
|
import_ui19.ModeToggle,
|
|
19130
19291
|
{
|
|
19131
19292
|
value: currentMode,
|
|
@@ -19137,29 +19298,29 @@ function ModuleConfigPanel({ instance_id, onClose }) {
|
|
|
19137
19298
|
}
|
|
19138
19299
|
function renderInputField(input) {
|
|
19139
19300
|
const currentMode = binding(input)?.mode ?? input.mode;
|
|
19140
|
-
return /* @__PURE__ */ (0,
|
|
19141
|
-
/* @__PURE__ */ (0,
|
|
19142
|
-
/* @__PURE__ */ (0,
|
|
19143
|
-
input.required && /* @__PURE__ */ (0,
|
|
19301
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "lace-panel-field", children: [
|
|
19302
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("label", { className: "lace-panel-row-label", children: [
|
|
19303
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Identifier, { text: input.name }),
|
|
19304
|
+
input.required && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "lace-mcp__required-star", children: "*" })
|
|
19144
19305
|
] }),
|
|
19145
19306
|
renderModeSelector(input),
|
|
19146
|
-
/* @__PURE__ */ (0,
|
|
19307
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "lace-panel-row-content", children: [
|
|
19147
19308
|
currentMode === "wired" && renderWiredEditor(input),
|
|
19148
19309
|
currentMode === "variable" && renderVariableEditor(input),
|
|
19149
19310
|
currentMode === "expression" && renderExpressionEditor(input),
|
|
19150
19311
|
currentMode === "literal" && renderLiteralEditor(input)
|
|
19151
19312
|
] }),
|
|
19152
|
-
input.description && /* @__PURE__ */ (0,
|
|
19313
|
+
input.description && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "lace-panel-field__description", children: input.description })
|
|
19153
19314
|
] }, input.name);
|
|
19154
19315
|
}
|
|
19155
19316
|
function renderWiredEditor(input) {
|
|
19156
19317
|
const label = input.wired_source ?? "Not wired";
|
|
19157
|
-
return /* @__PURE__ */ (0,
|
|
19158
|
-
/* @__PURE__ */ (0,
|
|
19159
|
-
editable && /* @__PURE__ */ (0,
|
|
19318
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "lace-mcp__wired-row", children: [
|
|
19319
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "lace-mcp__wired-input", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_ui19.Input, { value: label, readOnly: true, fullWidth: true, mono: true }) }),
|
|
19320
|
+
editable && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
19160
19321
|
import_ui19.IconButton,
|
|
19161
19322
|
{
|
|
19162
|
-
icon: /* @__PURE__ */ (0,
|
|
19323
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(CanvasIcon, { name: "close" }),
|
|
19163
19324
|
"aria-label": "Disconnect this input",
|
|
19164
19325
|
size: "md",
|
|
19165
19326
|
tooltipPlacement: "bottom-end",
|
|
@@ -19169,7 +19330,7 @@ function ModuleConfigPanel({ instance_id, onClose }) {
|
|
|
19169
19330
|
] });
|
|
19170
19331
|
}
|
|
19171
19332
|
function renderVariableEditor(input) {
|
|
19172
|
-
return /* @__PURE__ */ (0,
|
|
19333
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
19173
19334
|
import_ui19.Input,
|
|
19174
19335
|
{
|
|
19175
19336
|
value: binding(input)?.variable ?? "",
|
|
@@ -19185,7 +19346,7 @@ function ModuleConfigPanel({ instance_id, onClose }) {
|
|
|
19185
19346
|
);
|
|
19186
19347
|
}
|
|
19187
19348
|
function renderExpressionEditor(input) {
|
|
19188
|
-
return /* @__PURE__ */ (0,
|
|
19349
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
19189
19350
|
import_ui19.Textarea,
|
|
19190
19351
|
{
|
|
19191
19352
|
value: binding(input)?.expression ?? "",
|
|
@@ -19203,7 +19364,7 @@ function ModuleConfigPanel({ instance_id, onClose }) {
|
|
|
19203
19364
|
const kind = literalKind(input.type);
|
|
19204
19365
|
const updateValue = (next) => setBinding(input, { value: next });
|
|
19205
19366
|
if (kind === "bool") {
|
|
19206
|
-
return /* @__PURE__ */ (0,
|
|
19367
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
19207
19368
|
"select",
|
|
19208
19369
|
{
|
|
19209
19370
|
className: "lace-mcp__select",
|
|
@@ -19211,14 +19372,14 @@ function ModuleConfigPanel({ instance_id, onClose }) {
|
|
|
19211
19372
|
onChange: (e) => updateValue(e.target.value === "true"),
|
|
19212
19373
|
disabled: !editable,
|
|
19213
19374
|
children: [
|
|
19214
|
-
/* @__PURE__ */ (0,
|
|
19215
|
-
/* @__PURE__ */ (0,
|
|
19375
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("option", { value: "true", children: "True" }),
|
|
19376
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("option", { value: "false", children: "False" })
|
|
19216
19377
|
]
|
|
19217
19378
|
}
|
|
19218
19379
|
);
|
|
19219
19380
|
}
|
|
19220
19381
|
if (kind === "number") {
|
|
19221
|
-
return /* @__PURE__ */ (0,
|
|
19382
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
19222
19383
|
import_ui19.Input,
|
|
19223
19384
|
{
|
|
19224
19385
|
type: "number",
|
|
@@ -19231,7 +19392,7 @@ function ModuleConfigPanel({ instance_id, onClose }) {
|
|
|
19231
19392
|
}
|
|
19232
19393
|
if (kind === "collection") {
|
|
19233
19394
|
const jsonStr = typeof value === "string" ? value : JSON.stringify(value ?? null, null, 2);
|
|
19234
|
-
return /* @__PURE__ */ (0,
|
|
19395
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
19235
19396
|
import_ui19.Textarea,
|
|
19236
19397
|
{
|
|
19237
19398
|
value: jsonStr,
|
|
@@ -19249,7 +19410,7 @@ function ModuleConfigPanel({ instance_id, onClose }) {
|
|
|
19249
19410
|
}
|
|
19250
19411
|
);
|
|
19251
19412
|
}
|
|
19252
|
-
return /* @__PURE__ */ (0,
|
|
19413
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
19253
19414
|
import_ui19.Input,
|
|
19254
19415
|
{
|
|
19255
19416
|
value: String(value ?? ""),
|
|
@@ -19266,34 +19427,34 @@ function ModuleConfigPanel({ instance_id, onClose }) {
|
|
|
19266
19427
|
);
|
|
19267
19428
|
}
|
|
19268
19429
|
if (!config) {
|
|
19269
|
-
return /* @__PURE__ */ (0,
|
|
19270
|
-
/* @__PURE__ */ (0,
|
|
19430
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_ui19.Panel, { title: "Error", onClose, children: [
|
|
19431
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "lace-mcp__error-title", children: [
|
|
19271
19432
|
'Failed to load configuration for "',
|
|
19272
19433
|
instance_id,
|
|
19273
19434
|
'":'
|
|
19274
19435
|
] }),
|
|
19275
|
-
/* @__PURE__ */ (0,
|
|
19436
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "lace-mcp__error-detail", children: "Instance not found in the current Bundle." })
|
|
19276
19437
|
] });
|
|
19277
19438
|
}
|
|
19278
19439
|
const dependsOn = fields.depends_on;
|
|
19279
19440
|
const setProviders2 = (next) => draft.set("providers", next);
|
|
19280
|
-
const title = /* @__PURE__ */ (0,
|
|
19281
|
-
/* @__PURE__ */ (0,
|
|
19282
|
-
/* @__PURE__ */ (0,
|
|
19441
|
+
const title = /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "lace-mcp__title", children: [
|
|
19442
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "lace-mcp__title-eyebrow", children: "Module" }),
|
|
19443
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("h3", { className: "lace-mcp__title-id", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Identifier, { text: instance_id }) })
|
|
19283
19444
|
] });
|
|
19284
|
-
const footer = editable ? /* @__PURE__ */ (0,
|
|
19285
|
-
return /* @__PURE__ */ (0,
|
|
19286
|
-
requiredInputs.length > 0 && /* @__PURE__ */ (0,
|
|
19287
|
-
optionalInputs.length > 0 && /* @__PURE__ */ (0,
|
|
19288
|
-
config.dependency_options.length > 0 && /* @__PURE__ */ (0,
|
|
19445
|
+
const footer = editable ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(UpdateButton, { draft, label: "Update configuration" }) : void 0;
|
|
19446
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_ui19.Panel, { title, footer, flush: true, onClose, children: [
|
|
19447
|
+
requiredInputs.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(AccordionSection, { title: "Required Inputs", defaultOpen: true, badge: `(${requiredInputs.length})`, children: requiredInputs.map(renderInputField) }),
|
|
19448
|
+
optionalInputs.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(AccordionSection, { title: "Optional Inputs", defaultOpen: true, badge: `(${optionalInputs.length})`, children: optionalInputs.map(renderInputField) }),
|
|
19449
|
+
config.dependency_options.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
19289
19450
|
AccordionSection,
|
|
19290
19451
|
{
|
|
19291
19452
|
title: "Depends On",
|
|
19292
19453
|
badge: dependsOn.length > 0 ? `(${dependsOn.length})` : void 0,
|
|
19293
19454
|
children: [
|
|
19294
|
-
/* @__PURE__ */ (0,
|
|
19295
|
-
config.dependency_options.map((option) => /* @__PURE__ */ (0,
|
|
19296
|
-
/* @__PURE__ */ (0,
|
|
19455
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "lace-mcp__depends-hint", children: "Select sibling instances this module depends on." }),
|
|
19456
|
+
config.dependency_options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("label", { className: "lace-mcp__depends-item", children: [
|
|
19457
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
19297
19458
|
"input",
|
|
19298
19459
|
{
|
|
19299
19460
|
type: "checkbox",
|
|
@@ -19306,29 +19467,29 @@ function ModuleConfigPanel({ instance_id, onClose }) {
|
|
|
19306
19467
|
)
|
|
19307
19468
|
}
|
|
19308
19469
|
),
|
|
19309
|
-
/* @__PURE__ */ (0,
|
|
19470
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Identifier, { className: "lace-mcp__depends-label", text: option })
|
|
19310
19471
|
] }, option))
|
|
19311
19472
|
]
|
|
19312
19473
|
}
|
|
19313
19474
|
),
|
|
19314
|
-
(fields.providers.length > 0 || editable) && /* @__PURE__ */ (0,
|
|
19475
|
+
(fields.providers.length > 0 || editable) && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
19315
19476
|
AccordionSection,
|
|
19316
19477
|
{
|
|
19317
19478
|
title: "Providers",
|
|
19318
19479
|
badge: fields.providers.length > 0 ? `(${fields.providers.length})` : void 0,
|
|
19319
19480
|
children: [
|
|
19320
|
-
/* @__PURE__ */ (0,
|
|
19481
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "lace-mcp__depends-hint", children: [
|
|
19321
19482
|
"Map each child-local provider name to the root provider reference passed down (e.g.",
|
|
19322
19483
|
" ",
|
|
19323
|
-
/* @__PURE__ */ (0,
|
|
19484
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("code", { children: "aws" }),
|
|
19324
19485
|
" \u2192 ",
|
|
19325
|
-
/* @__PURE__ */ (0,
|
|
19486
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("code", { children: "aws.west" }),
|
|
19326
19487
|
")."
|
|
19327
19488
|
] }),
|
|
19328
19489
|
fields.providers.map((row, i) => (
|
|
19329
19490
|
// biome-ignore lint/suspicious/noArrayIndexKey: rows are positional and freely editable
|
|
19330
|
-
/* @__PURE__ */ (0,
|
|
19331
|
-
/* @__PURE__ */ (0,
|
|
19491
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "lace-mcp__provider-row", children: [
|
|
19492
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
19332
19493
|
import_ui19.Input,
|
|
19333
19494
|
{
|
|
19334
19495
|
value: row.key,
|
|
@@ -19340,8 +19501,8 @@ function ModuleConfigPanel({ instance_id, onClose }) {
|
|
|
19340
19501
|
readOnly: !editable
|
|
19341
19502
|
}
|
|
19342
19503
|
),
|
|
19343
|
-
/* @__PURE__ */ (0,
|
|
19344
|
-
/* @__PURE__ */ (0,
|
|
19504
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "lace-mcp__provider-arrow", children: "=" }),
|
|
19505
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
19345
19506
|
import_ui19.Input,
|
|
19346
19507
|
{
|
|
19347
19508
|
value: row.value,
|
|
@@ -19353,10 +19514,10 @@ function ModuleConfigPanel({ instance_id, onClose }) {
|
|
|
19353
19514
|
readOnly: !editable
|
|
19354
19515
|
}
|
|
19355
19516
|
),
|
|
19356
|
-
editable && /* @__PURE__ */ (0,
|
|
19517
|
+
editable && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
19357
19518
|
import_ui19.IconButton,
|
|
19358
19519
|
{
|
|
19359
|
-
icon: /* @__PURE__ */ (0,
|
|
19520
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(CanvasIcon, { name: "close" }),
|
|
19360
19521
|
"aria-label": "Remove this provider mapping",
|
|
19361
19522
|
size: "md",
|
|
19362
19523
|
tooltipPlacement: "bottom-end",
|
|
@@ -19365,7 +19526,7 @@ function ModuleConfigPanel({ instance_id, onClose }) {
|
|
|
19365
19526
|
)
|
|
19366
19527
|
] }, i)
|
|
19367
19528
|
)),
|
|
19368
|
-
editable && /* @__PURE__ */ (0,
|
|
19529
|
+
editable && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
19369
19530
|
import_ui19.Button,
|
|
19370
19531
|
{
|
|
19371
19532
|
variant: "secondary",
|
|
@@ -19377,15 +19538,15 @@ function ModuleConfigPanel({ instance_id, onClose }) {
|
|
|
19377
19538
|
]
|
|
19378
19539
|
}
|
|
19379
19540
|
),
|
|
19380
|
-
(fields.count || fields.for_each || editable) && /* @__PURE__ */ (0,
|
|
19381
|
-
/* @__PURE__ */ (0,
|
|
19541
|
+
(fields.count || fields.for_each || editable) && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(AccordionSection, { title: "Repetition", children: [
|
|
19542
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "lace-mcp__depends-hint", children: [
|
|
19382
19543
|
"The call's ",
|
|
19383
|
-
/* @__PURE__ */ (0,
|
|
19544
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("code", { children: "count" }),
|
|
19384
19545
|
" or ",
|
|
19385
|
-
/* @__PURE__ */ (0,
|
|
19546
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("code", { children: "for_each" }),
|
|
19386
19547
|
": one module, called once per instance."
|
|
19387
19548
|
] }),
|
|
19388
|
-
/* @__PURE__ */ (0,
|
|
19549
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
19389
19550
|
import_ui19.Input,
|
|
19390
19551
|
{
|
|
19391
19552
|
label: "count",
|
|
@@ -19397,7 +19558,7 @@ function ModuleConfigPanel({ instance_id, onClose }) {
|
|
|
19397
19558
|
readOnly: !editable
|
|
19398
19559
|
}
|
|
19399
19560
|
),
|
|
19400
|
-
/* @__PURE__ */ (0,
|
|
19561
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
19401
19562
|
import_ui19.Input,
|
|
19402
19563
|
{
|
|
19403
19564
|
label: "for_each",
|
|
@@ -19410,26 +19571,26 @@ function ModuleConfigPanel({ instance_id, onClose }) {
|
|
|
19410
19571
|
}
|
|
19411
19572
|
)
|
|
19412
19573
|
] }),
|
|
19413
|
-
config.outputs.length > 0 && /* @__PURE__ */ (0,
|
|
19414
|
-
/* @__PURE__ */ (0,
|
|
19415
|
-
/* @__PURE__ */ (0,
|
|
19416
|
-
/* @__PURE__ */ (0,
|
|
19574
|
+
config.outputs.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(AccordionSection, { title: "Outputs", badge: `(${config.outputs.length})`, children: config.outputs.map((o) => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "lace-mcp__output-card", children: [
|
|
19575
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "lace-mcp__output-header", children: [
|
|
19576
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Identifier, { className: "lace-mcp__output-name", text: o.name }),
|
|
19577
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Identifier, { className: "lace-mcp__output-type", text: o.type ?? "" })
|
|
19417
19578
|
] }),
|
|
19418
|
-
o.description && /* @__PURE__ */ (0,
|
|
19419
|
-
o.sensitive && /* @__PURE__ */ (0,
|
|
19579
|
+
o.description && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "lace-mcp__output-description", children: o.description }),
|
|
19580
|
+
o.sensitive && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "lace-mcp__output-sensitive", children: "sensitive" })
|
|
19420
19581
|
] }, o.name)) }),
|
|
19421
|
-
config.module_key && /* @__PURE__ */ (0,
|
|
19422
|
-
/* @__PURE__ */ (0,
|
|
19423
|
-
/* @__PURE__ */ (0,
|
|
19424
|
-
/* @__PURE__ */ (0,
|
|
19425
|
-
/* @__PURE__ */ (0,
|
|
19426
|
-
config.source && /* @__PURE__ */ (0,
|
|
19582
|
+
config.module_key && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
|
|
19583
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "lace-mcp__module-heading", children: [
|
|
19584
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "lace-mcp__title-eyebrow", children: "Called module" }),
|
|
19585
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { children: [
|
|
19586
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Identifier, { text: config.module_key }),
|
|
19587
|
+
config.source && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { className: "lace-mcp__module-source", children: [
|
|
19427
19588
|
" \xB7 ",
|
|
19428
|
-
/* @__PURE__ */ (0,
|
|
19589
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Identifier, { text: config.source })
|
|
19429
19590
|
] })
|
|
19430
19591
|
] })
|
|
19431
19592
|
] }),
|
|
19432
|
-
/* @__PURE__ */ (0,
|
|
19593
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ModuleDetails, { moduleKey: config.module_key }, config.module_key)
|
|
19433
19594
|
] })
|
|
19434
19595
|
] });
|
|
19435
19596
|
}
|
|
@@ -19439,7 +19600,7 @@ function ModuleConfigPanel2({ ctx }) {
|
|
|
19439
19600
|
const { setSelection } = useCanvas();
|
|
19440
19601
|
const instanceId = ctx.selection.nodes[0];
|
|
19441
19602
|
if (!instanceId) return null;
|
|
19442
|
-
return (0,
|
|
19603
|
+
return (0, import_react40.createElement)(ModuleConfigPanel, {
|
|
19443
19604
|
key: instanceId,
|
|
19444
19605
|
instance_id: instanceId,
|
|
19445
19606
|
onClose: () => setSelection(NO_SELECTION)
|
|
@@ -19455,11 +19616,11 @@ var moduleConfigPanel = {
|
|
|
19455
19616
|
};
|
|
19456
19617
|
|
|
19457
19618
|
// src/core/panels/SourceRefusedBanner.tsx
|
|
19458
|
-
var
|
|
19619
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
19459
19620
|
var LOCKED = "The canvas can't take this module's .tf, so editing, saving and generating are locked until it can; the Diagnostics tab says why.";
|
|
19460
19621
|
var OUT_OF_LACE_SHAPE = "This Terraform is not in lace shape yet, so the canvas shows it read-only.";
|
|
19461
19622
|
function SourceRefusedBanner({ ctx }) {
|
|
19462
|
-
return /* @__PURE__ */ (0,
|
|
19623
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
19463
19624
|
RowActionBanner,
|
|
19464
19625
|
{
|
|
19465
19626
|
ctx,
|
|
@@ -19481,21 +19642,21 @@ var sourceRefusedPanel = {
|
|
|
19481
19642
|
|
|
19482
19643
|
// src/core/panels/settings.ts
|
|
19483
19644
|
var import_ui21 = require("@lace-cloud/ui");
|
|
19484
|
-
var
|
|
19645
|
+
var import_react41 = require("react");
|
|
19485
19646
|
|
|
19486
19647
|
// src/components/panels/UnifiedSettingsPanel.tsx
|
|
19487
19648
|
var import_ui20 = require("@lace-cloud/ui");
|
|
19488
19649
|
var import_panels_shared9 = require("./panels-shared-3HUQC7TC.css");
|
|
19489
|
-
var
|
|
19650
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
19490
19651
|
function UnifiedSettingsPanel({ onClose }) {
|
|
19491
19652
|
const { bundle } = useCanvas();
|
|
19492
|
-
return /* @__PURE__ */ (0,
|
|
19653
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_ui20.Panel, { title: "Settings", flush: true, onClose, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ModuleDetails, { moduleKey: bundle.entry, open: ["Interface"] }, bundle.entry) });
|
|
19493
19654
|
}
|
|
19494
19655
|
|
|
19495
19656
|
// src/core/panels/settings.ts
|
|
19496
19657
|
function SettingsPanel(_props) {
|
|
19497
19658
|
const { setSettingsOpen } = useCanvas();
|
|
19498
|
-
return (0,
|
|
19659
|
+
return (0, import_react41.createElement)(UnifiedSettingsPanel, {
|
|
19499
19660
|
onClose: () => setSettingsOpen(false)
|
|
19500
19661
|
});
|
|
19501
19662
|
}
|
|
@@ -19509,8 +19670,8 @@ var settingsPanel = {
|
|
|
19509
19670
|
};
|
|
19510
19671
|
function SettingsToggle({ ctx }) {
|
|
19511
19672
|
const { setSettingsOpen } = useCanvas();
|
|
19512
|
-
return (0,
|
|
19513
|
-
icon: (0,
|
|
19673
|
+
return (0, import_react41.createElement)(import_ui21.IconButton, {
|
|
19674
|
+
icon: (0, import_react41.createElement)(CanvasIcon, { name: "settings" }),
|
|
19514
19675
|
"aria-label": "Settings",
|
|
19515
19676
|
size: "md",
|
|
19516
19677
|
tooltipPlacement: "bottom-end",
|
|
@@ -19865,10 +20026,10 @@ function createActionRunner(ports, store, options = {}) {
|
|
|
19865
20026
|
}
|
|
19866
20027
|
|
|
19867
20028
|
// src/core/use-editing.ts
|
|
19868
|
-
var
|
|
20029
|
+
var import_react42 = require("react");
|
|
19869
20030
|
function useEditing(runner) {
|
|
19870
|
-
const [editing, setEditing] = (0,
|
|
19871
|
-
(0,
|
|
20031
|
+
const [editing, setEditing] = (0, import_react42.useState)(() => runner.editing());
|
|
20032
|
+
(0, import_react42.useEffect)(() => {
|
|
19872
20033
|
setEditing(runner.editing());
|
|
19873
20034
|
return runner.onEditingChange(setEditing);
|
|
19874
20035
|
}, [runner]);
|
|
@@ -19876,7 +20037,7 @@ function useEditing(runner) {
|
|
|
19876
20037
|
}
|
|
19877
20038
|
|
|
19878
20039
|
// src/App.tsx
|
|
19879
|
-
var
|
|
20040
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
19880
20041
|
var EMPTY_CONTRIBUTIONS = { overlays: [], panels: [], actions: [] };
|
|
19881
20042
|
var NO_TARGET2 = {};
|
|
19882
20043
|
function OverlayRunner({
|
|
@@ -19885,8 +20046,8 @@ function OverlayRunner({
|
|
|
19885
20046
|
tick,
|
|
19886
20047
|
onDecorations
|
|
19887
20048
|
}) {
|
|
19888
|
-
const lastErrorRef = (0,
|
|
19889
|
-
const onReadError = (0,
|
|
20049
|
+
const lastErrorRef = (0, import_react44.useRef)(/* @__PURE__ */ new Map());
|
|
20050
|
+
const onReadError = (0, import_react44.useCallback)(
|
|
19890
20051
|
(path, error) => {
|
|
19891
20052
|
const next = error?.message ?? null;
|
|
19892
20053
|
if (lastErrorRef.current.get(path) === next) return;
|
|
@@ -19895,7 +20056,7 @@ function OverlayRunner({
|
|
|
19895
20056
|
},
|
|
19896
20057
|
[ctx.ports.presenter]
|
|
19897
20058
|
);
|
|
19898
|
-
return /* @__PURE__ */ (0,
|
|
20059
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(PanelScope, { ctx, paths: overlay.paths, tick, onReadError, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(OverlayDecorations, { overlay, ctx, onDecorations }) });
|
|
19899
20060
|
}
|
|
19900
20061
|
function OverlayDecorations({
|
|
19901
20062
|
overlay,
|
|
@@ -19903,15 +20064,15 @@ function OverlayDecorations({
|
|
|
19903
20064
|
onDecorations
|
|
19904
20065
|
}) {
|
|
19905
20066
|
const decorations = overlay.useDecorations(ctx);
|
|
19906
|
-
(0,
|
|
20067
|
+
(0, import_react44.useEffect)(() => {
|
|
19907
20068
|
onDecorations(overlay.id, decorations);
|
|
19908
20069
|
}, [overlay.id, decorations, onDecorations]);
|
|
19909
|
-
(0,
|
|
20070
|
+
(0, import_react44.useEffect)(() => () => onDecorations(overlay.id, null), [overlay.id, onDecorations]);
|
|
19910
20071
|
return null;
|
|
19911
20072
|
}
|
|
19912
20073
|
function PanelSlot({ panel, ctx, tick }) {
|
|
19913
|
-
const [readErrors, setReadErrors] = (0,
|
|
19914
|
-
const onReadError = (0,
|
|
20074
|
+
const [readErrors, setReadErrors] = (0, import_react44.useState)(/* @__PURE__ */ new Map());
|
|
20075
|
+
const onReadError = (0, import_react44.useCallback)((path, error) => {
|
|
19915
20076
|
setReadErrors((prev) => {
|
|
19916
20077
|
if (error === null) {
|
|
19917
20078
|
if (!prev.has(path)) return prev;
|
|
@@ -19924,7 +20085,7 @@ function PanelSlot({ panel, ctx, tick }) {
|
|
|
19924
20085
|
return next;
|
|
19925
20086
|
});
|
|
19926
20087
|
}, []);
|
|
19927
|
-
return /* @__PURE__ */ (0,
|
|
20088
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
19928
20089
|
PanelScope,
|
|
19929
20090
|
{
|
|
19930
20091
|
ctx,
|
|
@@ -19932,13 +20093,13 @@ function PanelSlot({ panel, ctx, tick }) {
|
|
|
19932
20093
|
tick,
|
|
19933
20094
|
onReadError,
|
|
19934
20095
|
children: [
|
|
19935
|
-
[...readErrors].map(([path, error]) => /* @__PURE__ */ (0,
|
|
20096
|
+
[...readErrors].map(([path, error]) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("p", { className: "lace-app__panel-error", children: [
|
|
19936
20097
|
"Couldn't load ",
|
|
19937
20098
|
path,
|
|
19938
20099
|
": ",
|
|
19939
20100
|
error.message
|
|
19940
20101
|
] }, path)),
|
|
19941
|
-
/* @__PURE__ */ (0,
|
|
20102
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(panel.Component, { ctx })
|
|
19942
20103
|
]
|
|
19943
20104
|
}
|
|
19944
20105
|
);
|
|
@@ -19948,12 +20109,12 @@ function BottomTabs({
|
|
|
19948
20109
|
ctx,
|
|
19949
20110
|
tick
|
|
19950
20111
|
}) {
|
|
19951
|
-
const [manualId, setManualId] = (0,
|
|
20112
|
+
const [manualId, setManualId] = (0, import_react44.useState)(null);
|
|
19952
20113
|
const manual = manualId !== null ? panels.find((p) => p.id === manualId) : void 0;
|
|
19953
20114
|
const active = manual ?? panels[0] ?? null;
|
|
19954
20115
|
if (panels.length === 0) return null;
|
|
19955
|
-
return /* @__PURE__ */ (0,
|
|
19956
|
-
/* @__PURE__ */ (0,
|
|
20116
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "lace-app__bottom", children: [
|
|
20117
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "lace-app__bottom-tabs", role: "tablist", children: panels.map((panel) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
19957
20118
|
"button",
|
|
19958
20119
|
{
|
|
19959
20120
|
type: "button",
|
|
@@ -19965,7 +20126,7 @@ function BottomTabs({
|
|
|
19965
20126
|
},
|
|
19966
20127
|
panel.id
|
|
19967
20128
|
)) }),
|
|
19968
|
-
/* @__PURE__ */ (0,
|
|
20129
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "lace-app__bottom-content", children: active && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(PanelSlot, { panel: active, ctx, tick }) })
|
|
19969
20130
|
] });
|
|
19970
20131
|
}
|
|
19971
20132
|
function endMessage(end) {
|
|
@@ -19977,8 +20138,8 @@ function App({
|
|
|
19977
20138
|
height = "100vh",
|
|
19978
20139
|
results: hostResults
|
|
19979
20140
|
}) {
|
|
19980
|
-
const results = (0,
|
|
19981
|
-
const writeReport = (0,
|
|
20141
|
+
const results = (0, import_react44.useMemo)(() => hostResults ?? createResultStore(), [hostResults]);
|
|
20142
|
+
const writeReport = (0, import_react44.useCallback)(
|
|
19982
20143
|
(result, session2) => {
|
|
19983
20144
|
try {
|
|
19984
20145
|
results.write("report", session2, result, { stack: void 0 });
|
|
@@ -19989,44 +20150,44 @@ function App({
|
|
|
19989
20150
|
},
|
|
19990
20151
|
[results, ports.presenter]
|
|
19991
20152
|
);
|
|
19992
|
-
const dropReport = (0,
|
|
20153
|
+
const dropReport = (0, import_react44.useCallback)((session2) => results.detach("report", session2), [results]);
|
|
19993
20154
|
const { source, end, session } = useCanvasSource(ports.source, writeReport, dropReport);
|
|
19994
|
-
const [arrangement, setArrangement] = (0,
|
|
20155
|
+
const [arrangement, setArrangement] = (0, import_react44.useState)(() => ports.viewState.load());
|
|
19995
20156
|
const stack = ports.context.stack;
|
|
19996
|
-
const [selection, setSelection] = (0,
|
|
19997
|
-
const [settingsOpen, setSettingsOpen] = (0,
|
|
19998
|
-
const select = (0,
|
|
20157
|
+
const [selection, setSelection] = (0, import_react44.useState)(NO_SELECTION);
|
|
20158
|
+
const [settingsOpen, setSettingsOpen] = (0, import_react44.useState)(false);
|
|
20159
|
+
const select = (0, import_react44.useCallback)((next) => {
|
|
19999
20160
|
setSelection(next);
|
|
20000
20161
|
if (next.nodes.length > 0 || next.edges.length > 0) setSettingsOpen(false);
|
|
20001
20162
|
}, []);
|
|
20002
|
-
const [pendingForm, setPendingForm] = (0,
|
|
20003
|
-
const [overlayDecorations, setOverlayDecorations] = (0,
|
|
20004
|
-
const layoutRef = (0,
|
|
20163
|
+
const [pendingForm, setPendingForm] = (0, import_react44.useState)(null);
|
|
20164
|
+
const [overlayDecorations, setOverlayDecorations] = (0, import_react44.useState)({});
|
|
20165
|
+
const layoutRef = (0, import_react44.useRef)({ panIntoView: () => {
|
|
20005
20166
|
} });
|
|
20006
20167
|
const { commands, presenter, editor } = ports;
|
|
20007
|
-
const runner = (0,
|
|
20168
|
+
const runner = (0, import_react44.useMemo)(
|
|
20008
20169
|
() => createActionRunner({ commands, presenter, editor }, results, {
|
|
20009
20170
|
onPendingFormChange: setPendingForm
|
|
20010
20171
|
}),
|
|
20011
20172
|
[commands, presenter, editor, results]
|
|
20012
20173
|
);
|
|
20013
|
-
(0,
|
|
20174
|
+
(0, import_react44.useEffect)(() => {
|
|
20014
20175
|
return () => {
|
|
20015
20176
|
runner.dispose();
|
|
20016
20177
|
};
|
|
20017
20178
|
}, [runner]);
|
|
20018
|
-
const tick = (0,
|
|
20179
|
+
const tick = (0, import_react44.useSyncExternalStore)(results.subscribe, results.getTick);
|
|
20019
20180
|
const editing = useEditing(runner);
|
|
20020
|
-
const updateArrangement = (0,
|
|
20181
|
+
const updateArrangement = (0, import_react44.useCallback)(
|
|
20021
20182
|
(next) => {
|
|
20022
20183
|
setArrangement(next);
|
|
20023
20184
|
ports.viewState.save(next);
|
|
20024
20185
|
},
|
|
20025
20186
|
[ports.viewState]
|
|
20026
20187
|
);
|
|
20027
|
-
const
|
|
20028
|
-
if (source &&
|
|
20029
|
-
|
|
20188
|
+
const pruned = (0, import_react44.useRef)(false);
|
|
20189
|
+
if (source && !pruned.current) {
|
|
20190
|
+
pruned.current = true;
|
|
20030
20191
|
const gced = gcArrangement(source.bundle, arrangement);
|
|
20031
20192
|
if (gced !== arrangement) {
|
|
20032
20193
|
queueMicrotask(() => {
|
|
@@ -20035,18 +20196,18 @@ function App({
|
|
|
20035
20196
|
});
|
|
20036
20197
|
}
|
|
20037
20198
|
}
|
|
20038
|
-
const view = (0,
|
|
20199
|
+
const view = (0, import_react44.useMemo)(
|
|
20039
20200
|
() => source ? projectFrame(source, arrangement) : null,
|
|
20040
20201
|
[source, arrangement]
|
|
20041
20202
|
);
|
|
20042
|
-
const reconciledFrame = (0,
|
|
20043
|
-
(0,
|
|
20203
|
+
const reconciledFrame = (0, import_react44.useRef)(null);
|
|
20204
|
+
(0, import_react44.useLayoutEffect)(() => {
|
|
20044
20205
|
if (!source || !view || reconciledFrame.current === source) return;
|
|
20045
20206
|
reconciledFrame.current = source;
|
|
20046
20207
|
setSelection((current) => reconcileSelection(view, current));
|
|
20047
20208
|
}, [source, view]);
|
|
20048
20209
|
const editable = ports.editor !== void 0 && !source?.sourceRefused;
|
|
20049
|
-
const merged = (0,
|
|
20210
|
+
const merged = (0, import_react44.useMemo)(
|
|
20050
20211
|
() => ({
|
|
20051
20212
|
overlays: [...CORE_CONTRIBUTIONS.overlays, ...contributions.overlays],
|
|
20052
20213
|
panels: [...CORE_CONTRIBUTIONS.panels, ...contributions.panels],
|
|
@@ -20054,17 +20215,17 @@ function App({
|
|
|
20054
20215
|
}),
|
|
20055
20216
|
[contributions]
|
|
20056
20217
|
);
|
|
20057
|
-
const resultSlots = (0,
|
|
20218
|
+
const resultSlots = (0, import_react44.useSyncExternalStore)(results.subscribe, results.getSnapshot);
|
|
20058
20219
|
const stackId = stack?.id;
|
|
20059
|
-
const live = (0,
|
|
20220
|
+
const live = (0, import_react44.useMemo)(
|
|
20060
20221
|
() => source && session ? liveSlots(resultSlots, { session, treeHash: source.treeHash, stack: stackId }) : null,
|
|
20061
20222
|
[resultSlots, source, session, stackId]
|
|
20062
20223
|
);
|
|
20063
|
-
const diagnostics = (0,
|
|
20224
|
+
const diagnostics = (0, import_react44.useMemo)(
|
|
20064
20225
|
() => source && live ? diagnosticsOf(source.diagnostics, live.report ? reportDiagnostics(live.report) : []) : [],
|
|
20065
20226
|
[source, live]
|
|
20066
20227
|
);
|
|
20067
|
-
const ctx = (0,
|
|
20228
|
+
const ctx = (0, import_react44.useMemo)(() => {
|
|
20068
20229
|
if (!source || !view) return null;
|
|
20069
20230
|
return {
|
|
20070
20231
|
ports,
|
|
@@ -20081,11 +20242,11 @@ function App({
|
|
|
20081
20242
|
contributions: merged
|
|
20082
20243
|
};
|
|
20083
20244
|
}, [ports, source, view, stack, selection, settingsOpen, merged, diagnostics, editable]);
|
|
20084
|
-
const resolved = (0,
|
|
20245
|
+
const resolved = (0, import_react44.useMemo)(() => {
|
|
20085
20246
|
if (!ctx) return EMPTY_CONTRIBUTIONS;
|
|
20086
20247
|
return resolveContributions(merged, ports, ctx, NO_TARGET2);
|
|
20087
20248
|
}, [merged, ports, ctx]);
|
|
20088
|
-
const setOverlayDecoration = (0,
|
|
20249
|
+
const setOverlayDecoration = (0, import_react44.useCallback)((id, next) => {
|
|
20089
20250
|
setOverlayDecorations((prev) => {
|
|
20090
20251
|
if (next === null) {
|
|
20091
20252
|
if (!(id in prev)) return prev;
|
|
@@ -20095,11 +20256,11 @@ function App({
|
|
|
20095
20256
|
return prev[id] === next ? prev : { ...prev, [id]: next };
|
|
20096
20257
|
});
|
|
20097
20258
|
}, []);
|
|
20098
|
-
const decorations = (0,
|
|
20259
|
+
const decorations = (0, import_react44.useMemo)(() => {
|
|
20099
20260
|
if (!view || !source) return { nodes: {} };
|
|
20100
20261
|
return decorate(view, Object.values(overlayDecorations), diagnostics);
|
|
20101
20262
|
}, [view, source, overlayDecorations, diagnostics]);
|
|
20102
|
-
const envExtras = (0,
|
|
20263
|
+
const envExtras = (0, import_react44.useMemo)(() => {
|
|
20103
20264
|
if (!source) return null;
|
|
20104
20265
|
return {
|
|
20105
20266
|
bundle: source.bundle,
|
|
@@ -20111,16 +20272,18 @@ function App({
|
|
|
20111
20272
|
resolved.actions.filter((action) => action.placement === "toolbar"),
|
|
20112
20273
|
resolved.panels.filter((panel) => panel.slot === "toolbar")
|
|
20113
20274
|
);
|
|
20114
|
-
const rootRef = (0,
|
|
20115
|
-
(0,
|
|
20275
|
+
const rootRef = (0, import_react44.useRef)(null);
|
|
20276
|
+
(0, import_react44.useEffect)(() => {
|
|
20116
20277
|
if (!ctx) return;
|
|
20117
20278
|
registerKeyTarget(ctx, "app", rootRef.current);
|
|
20118
20279
|
return () => registerKeyTarget(ctx, "app", null);
|
|
20119
20280
|
}, [ctx]);
|
|
20120
|
-
|
|
20281
|
+
const rootMounted = Boolean(ctx && view && source && envExtras);
|
|
20282
|
+
useFocusWhenNoneHeld(rootRef, rootMounted);
|
|
20283
|
+
useFocusKeptOnRemoval(rootRef, rootMounted);
|
|
20121
20284
|
useActionKeys(ctx && envExtras ? resolved.actions : [], ctx, runner, envExtras);
|
|
20122
20285
|
if (!ctx || !view || !source || !envExtras) {
|
|
20123
|
-
return end ? /* @__PURE__ */ (0,
|
|
20286
|
+
return end ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ErrorState, { message: endMessage(end) }) : null;
|
|
20124
20287
|
}
|
|
20125
20288
|
const contextValue = {
|
|
20126
20289
|
ports,
|
|
@@ -20141,8 +20304,8 @@ function App({
|
|
|
20141
20304
|
const bannerPanels = resolved.panels.filter((panel) => panel.slot === "banner");
|
|
20142
20305
|
const bottomPanels = resolved.panels.filter((panel) => panel.slot === "bottom");
|
|
20143
20306
|
const drawerPanel = resolved.panels.find((panel) => panel.slot === "drawer");
|
|
20144
|
-
return /* @__PURE__ */ (0,
|
|
20145
|
-
resolved.overlays.map((overlay) => /* @__PURE__ */ (0,
|
|
20307
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(ErrorBoundary, { children: [
|
|
20308
|
+
resolved.overlays.map((overlay) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
20146
20309
|
OverlayRunner,
|
|
20147
20310
|
{
|
|
20148
20311
|
overlay,
|
|
@@ -20152,15 +20315,15 @@ function App({
|
|
|
20152
20315
|
},
|
|
20153
20316
|
overlay.id
|
|
20154
20317
|
)),
|
|
20155
|
-
/* @__PURE__ */ (0,
|
|
20156
|
-
(toolbar.sections.length > 0 || toolbar.trailing.length > 0) && /* @__PURE__ */ (0,
|
|
20157
|
-
toolbar.sections.map((section, index) => /* @__PURE__ */ (0,
|
|
20158
|
-
index > 0 ? /* @__PURE__ */ (0,
|
|
20159
|
-
/* @__PURE__ */ (0,
|
|
20318
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(CanvasContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { ref: rootRef, className: "lace-app", style: { height }, tabIndex: -1, children: [
|
|
20319
|
+
(toolbar.sections.length > 0 || toolbar.trailing.length > 0) && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "lace-app__toolbar", children: [
|
|
20320
|
+
toolbar.sections.map((section, index) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_react44.Fragment, { children: [
|
|
20321
|
+
index > 0 ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "lace-app__toolbar-separator", "aria-hidden": "true" }) : null,
|
|
20322
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "lace-app__toolbar-section", children: [
|
|
20160
20323
|
section.actions.map((action) => (
|
|
20161
20324
|
// `runner.busy` reads the store, whose every write
|
|
20162
20325
|
// re-renders App (`resultSlots`).
|
|
20163
|
-
/* @__PURE__ */ (0,
|
|
20326
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
20164
20327
|
ToolbarAction,
|
|
20165
20328
|
{
|
|
20166
20329
|
action,
|
|
@@ -20171,20 +20334,20 @@ function App({
|
|
|
20171
20334
|
action.id
|
|
20172
20335
|
)
|
|
20173
20336
|
)),
|
|
20174
|
-
section.panels.map((panel) => /* @__PURE__ */ (0,
|
|
20337
|
+
section.panels.map((panel) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(PanelSlot, { panel, ctx, tick }, panel.id))
|
|
20175
20338
|
] })
|
|
20176
20339
|
] }, section.key ?? "")),
|
|
20177
|
-
toolbar.trailing.length > 0 && /* @__PURE__ */ (0,
|
|
20340
|
+
toolbar.trailing.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "lace-app__toolbar-end", children: toolbar.trailing.map((panel) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(PanelSlot, { panel, ctx, tick }, panel.id)) })
|
|
20178
20341
|
] }),
|
|
20179
|
-
/* @__PURE__ */ (0,
|
|
20180
|
-
/* @__PURE__ */ (0,
|
|
20181
|
-
/* @__PURE__ */ (0,
|
|
20182
|
-
/* @__PURE__ */ (0,
|
|
20183
|
-
/* @__PURE__ */ (0,
|
|
20342
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "lace-app__banners", children: bannerPanels.map((panel) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(PanelSlot, { panel, ctx, tick }, panel.id)) }),
|
|
20343
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "lace-app__body", children: [
|
|
20344
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "lace-app__main", children: [
|
|
20345
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "lace-app__canvas", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react43.ReactFlowProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Canvas, { height: "100%" }) }) }),
|
|
20346
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(BottomTabs, { panels: bottomPanels, ctx, tick })
|
|
20184
20347
|
] }),
|
|
20185
|
-
drawerPanel && /* @__PURE__ */ (0,
|
|
20348
|
+
drawerPanel && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Drawer, { label: drawerPanel.title, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(PanelSlot, { panel: drawerPanel, ctx, tick }, drawerPanel.id) })
|
|
20186
20349
|
] }),
|
|
20187
|
-
/* @__PURE__ */ (0,
|
|
20350
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(CommandArgsForm, { form: pendingForm })
|
|
20188
20351
|
] }) })
|
|
20189
20352
|
] });
|
|
20190
20353
|
}
|
|
@@ -20971,6 +21134,16 @@ function convertGraphError(e) {
|
|
|
20971
21134
|
function convertCreatedRef(r) {
|
|
20972
21135
|
return { scope: r.scope, id: r.id, moduleKey: r.module_key, sourceId: r.source_id };
|
|
20973
21136
|
}
|
|
21137
|
+
|
|
21138
|
+
// src/generated/stack-slug.ts
|
|
21139
|
+
var STACK_SLUG_PATTERN = "^[a-z](?:[a-z0-9-]{0,61}[a-z0-9])?$";
|
|
21140
|
+
var STACK_SLUG_DESCRIPTION = "Slug must be 1-63 characters of lowercase letters, digits and hyphens, starting with a letter and not ending with a hyphen";
|
|
21141
|
+
|
|
21142
|
+
// src/core/stack-slug.ts
|
|
21143
|
+
var stackSlugRule = {
|
|
21144
|
+
pattern: new RegExp(STACK_SLUG_PATTERN),
|
|
21145
|
+
description: STACK_SLUG_DESCRIPTION
|
|
21146
|
+
};
|
|
20974
21147
|
// Annotate the CommonJS export names for ESM import in node:
|
|
20975
21148
|
0 && (module.exports = {
|
|
20976
21149
|
AccordionSection,
|